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
If template symlinks are disabled and this module is installed but not enabled then add session notification in addition to template notification, as template notification may not be seen if module installed via modman. Observes: core_block_abstract_to_html_after
public function addNotEnabledWarning(Varien_Event_Observer $observer) { /* @var $block Mage_Core_Block_Abstract */ $block = $observer->getBlock(); /* @var $helper EW_NativePasswords_Helper_Data */ $helper = Mage::helper('ew_nativepasswords'); if($block->getNameInLayout() != self::ADMIN_NOTIFICATIONS_BLOCK_NAME) { return; //not interested in this block } if($helper->isEnabled()) { return; //module functionality enabled -- no concerns. } if(Mage::registry(EW_NativePasswords_Block_Adminhtml_Notification_Enabled::MESSAGE_SHOWN_CANARY_REGISTRY_KEY)) { return; //message successfully shown via template notification } //module is installed (or this method wouldn't exist), but functionality is disabled, //and template symlinks are disabled. //fall back to session notification. $message = $helper->getNotEnabledMessage(); if(!Mage::getStoreConfig(Mage_Core_Block_Template::XML_PATH_TEMPLATE_ALLOW_SYMLINK)) { //add message about template symlinks $message .= "<br /><br />" . //line break $helper->__( 'Additionally, template symlinks are disabled. It is required to enable these for modules installed via modman. ' . 'Please visit the Developer -> Template Settings section of '. '<a href="%s">system configuration</a> and set Allow Symlinks to Yes.', Mage::getUrl('adminhtml/system_config/edit', array('section'=>'dev')) ); } Mage::getSingleton('adminhtml/session')->addWarning($message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register_block_core_comment_template()\n {\n }", "public function atmf_html_backend(){\n\n $template_loader = new Uou_Atmf_Load_Template();\n ob_start();\n $template = $template_loader->locate_template( 'popup.php' );\n\n if(is_user_logged_in() ){\n include( $template );\n }\n echo ob_get_clean();\n\n }", "private function configureTemplate(){\n\t\t$template = $this->getTemplate();\n\t\t$template->setPageSubtitle($this->getModule()->getDisplayedName());\n\t}", "function register_block_core_post_template()\n {\n }", "function the_block_template_skip_link()\n {\n }", "public function add_email_template()\n {\n \n\t\t$this->arr_view_data['page_title'] = \"Manage \".$this->module_title;\n $this->arr_view_data['parent_module_icon'] = \"fa fa-home\";\n $this->arr_view_data['parent_module_title'] = \"Dashboard\";\n $this->arr_view_data['parent_module_url'] = url('/').'/admin/dashboard';\n $this->arr_view_data['module_icon'] = $this->module_icon;\n $this->arr_view_data['module_title'] = \"Manage \".$this->module_title;\n\t\t$this->arr_view_data['module_url_path'] = $this->module_url_path;\n\t\t$this->arr_view_data['admin_url_path'] = $this->admin_url_path;\n\t\t$this->arr_view_data['admin_panel_slug'] = $this->admin_panel_slug;\n\t\t\n\t\treturn view($this->module_view_folder.'.add',$this->arr_view_data);\n }", "public function Base_Render_Before($Sender) {\n if(GetValue('Panel',$Sender->Assets) && $Sender->MasterView != 'admin') {\n\t $RecentlyActiveModule = new RecentlyActiveModule($Sender);\n $Sender->AddModule($RecentlyActiveModule);\n\t}\n }", "function register_block_core_template_part()\n {\n }", "public function Base_Render_Before($Sender) {\n if(GetValue('Panel',$Sender->Assets) && $Sender->MasterView != 'admin') {\n $RecentlyActiveModule = new RecentlyActiveModule($Sender);\n $Sender->AddModule($RecentlyActiveModule);\n }\n }", "public function printContent()\n {\n GeneralUtility::logDeprecatedFunction();\n echo $this->moduleTemplate->renderContent();\n }", "private function get_module_timetable_html() {\n\n global $USER, $COURSE;\n\n $result = '';\n\n $config = get_config('block_module_info');\n $params = array();\n $params['objectclass'] = 'module';\n $params['week'] = (empty($config->week)) ? '' :$config->week;\n $params['day'] = (empty($config->day)) ? '' : $config->day;\n $params['period'] = (empty($config->period)) ? '' : $config->period;\n $params['identifier'] = $COURSE->idnumber;\n $params['style'] = $config->style;\n $params['template'] = $config->template;\n\n $linkstring = get_string('default_module_smart_link', 'block_module_info');\n\n $result = html_writer::link(new moodle_url($config->baseurl, $params), $linkstring, array('target' => '_BLANK'));\n $result = html_writer::tag('div', $result, array('class'=>'smart-link'));\n\n return $result;\n }", "protected function handleLostPasswordTemplate()\n {\n $id = $this->config['passwordsetting']['lostpasswordtmpl'];\n if (empty($id)) {\n return;\n }\n $bodyHtml = $this->getEmailTemplateBodyHtml($id);\n $find = '<p>$config_site_url</p>';\n\n if (!empty($bodyHtml) && false !== strpos($bodyHtml, $find)) {\n $replace = '<p><a title=\"$config_site_url\" href=\"$config_site_url\">$config_site_url</a></p>';\n $bodyHtml = str_replace($find, $replace, $bodyHtml);\n\n $this->updateEmailTemplateBodyHtml($id, $bodyHtml);\n }\n }", "private function configureTemplate(){\n\t\t$viewdirectory = DIR_MODULE . $this->getModule()->getLocation() . 'view/';\n\t\t// add module css\n\t\t$template = $this->getTemplate();\n\t\t$template->addStyle('<link href=\"'.$viewdirectory.'css/style.css\" rel=\"stylesheet\"/>');\n\t\n\t\t$template->setPageTitle($this->getModule()->getDisplayedName());\n\t}", "private function configureTemplate(){\n\t\t$viewdirectory = DIR_MODULE . $this->getModule()->getLocation() . 'view/';\n\t\t// add module css\n\t\t$template = $this->getTemplate();\n\t\t$template->addStyle('<link href=\"'.$viewdirectory.'css/style.css\" rel=\"stylesheet\"/>');\n\n\t\t$template->setPageTitle($this->getModule()->getDisplayedName());\n\t}", "public static function installBlockTemplate(&$block, &$module, &$log)\n {\n if (null == $block->get('template')) {\n return true;\n }\n\n $tplHandler =& xoops_gethandler('tplfile');\n\n $criteria =new CriteriaCompo();\n $criteria->add(new Criteria('tpl_type', 'block'));\n $criteria->add(new Criteria('tpl_tplset', 'default'));\n $criteria->add(new Criteria('tpl_module', $module->get('dirname')));\n $criteria->add(new Criteria('tpl_file', $block->get('template')));\n $tplfiles =& $tplHandler->getObjects($criteria);\n\n if (count($tplfiles) > 0) {\n $tplfile =& $tplfiles[0];\n } else {\n $tplfile =& $tplHandler->create();\n $tplfile->set('tpl_refid', $block->get('bid'));\n $tplfile->set('tpl_tplset', 'default');\n $tplfile->set('tpl_file', $block->get('template'));\n $tplfile->set('tpl_module', $module->get('dirname'));\n $tplfile->set('tpl_type', 'block');\n // $tplfile->setVar('tpl_desc', $tpl_desc);\n $tplfile->set('tpl_lastimported', 0);\n }\n\n $tplSource = Legacy_ModuleInstallUtils::readTemplateFile($module->get('dirname'), $block->get('template'), true);\n $tplfile->set('tpl_source', $tplSource);\n $tplfile->set('tpl_lastmodified', time());\n\n if ($tplHandler->insert($tplfile)) {\n $log->addReport(XCube_Utils::formatString(_AD_LEGACY_MESSAGE_BLOCK_TEMPLATE_INSTALLED, $block->get('template')));\n return true;\n } else {\n $log->addError(XCube_Utils::formatString(_AD_LEGACY_ERROR_BLOCK_TEMPLATE_INSTALL, $block->get('name')));\n return false;\n }\n }", "function add_note_link($module_key) {\r\n\r\n\treturn true;\r\n\r\n}", "function moduleContent() {\n \tglobal $LANG;\n switch((string)$this->MOD_SETTINGS[\"function\"]) {\n \tdefault:\n case 1:\n \t\t\t\t$content .= '<p><a href=\"#\" onclick=\"jumpToUrl(\\'\\/typo3\\/alt_doc.php?returnUrl=\\'+T3_THIS_LOCATION+\\'&edit[tx_x4econgress_congresses]['.$this->id.']=new\\',\\'txx4econgressM1\\',\\'txx4econgressM1\\');\"><img src=\"http://histsem.unibas.ch/fileadmin/histsem/_templates/images/icon_new.gif\"> '.$LANG->getLL(\"new\").'</a></p>';\n\n $this->content.=$this->doc->section(\"\",$content,0,1);\n\t\t\t\tisset($_GET[remSeries]) ? $series = 1 : $series = '';\n\t\t\t\t$content = $this->showCongresses();\n\t\t\t\t$this->content.=$this->doc->section($LANG->getLL(\"show\"),$content,0,1);\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n break;\n }\n }", "public function getModuleTemplate() {}", "public function getModuleTemplate() {}", "function wp_enable_block_templates()\n {\n }", "function tpl_add_content()\n\t{\n\t\treturn true;\n\t}", "function theme_install_page($content) {\n drupal_set_header('Content-Type: text/html; charset=utf-8');\n\n // Assign content.\n $variables['content'] = $content;\n // Delay setting the message variable so it can be processed below.\n $variables['show_messages'] = FALSE;\n // The maintenance preprocess function is recycled here.\n template_preprocess_maintenance_page($variables);\n\n // Special handling of error messages\n $messages = drupal_set_message();\n if (isset($messages['error'])) {\n $title = count($messages['error']) > 1 ? st('The following errors must be resolved before you can continue the installation process') : st('The following error must be resolved before you can continue the installation process');\n $variables['messages'] .= '<h3>'. $title .':</h3>';\n $variables['messages'] .= theme('status_messages', 'error');\n $variables['content'] .= '<p>'. st('Please check the error messages and <a href=\"!url\">try again</a>.', array('!url' => request_uri())) .'</p>';\n }\n \n // Special handling of warning messages\n if (isset($messages['warning'])) {\n $title = count($messages['warning']) > 1 ? st('The following installation warnings should be carefully reviewed') : st('The following installation warning should be carefully reviewed');\n $variables['messages'] .= '<h4>'. $title .':</h4>';\n $variables['messages'] .= theme('status_messages', 'warning');\n }\n\n // Special handling of status messages\n if (isset($messages['status'])) {\n $title = count($messages['status']) > 1 ? st('The following installation warnings should be carefully reviewed, but in most cases may be safely ignored') : st('The following installation warning should be carefully reviewed, but in most cases may be safely ignored');\n $variables['messages'] .= '<h4>'. $title .':</h4>';\n $variables['messages'] .= theme('status_messages', 'status');\n }\n\n // This was called as a theme hook (not template), so we need to\n // fix path_to_theme() for the template, to point at the actual\n // theme rather than system module as owner of the hook.\n global $theme_path;\n $theme_path = 'themes/garland';\n\n return theme_render_template('themes/garland/maintenance-page.tpl.php', $variables);\n}", "function _add_block_template_info($template_item)\n {\n }", "function postfixadmin_optpage_register_block() {\n global $optpage_blocks;\n global $AllowVacation;\n global $AllowChangePass;\n\n // if ( !soupNazi() ) {\n\n bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');\n textdomain('postfixadmin');\n $optpage_blocks[] = array(\n 'name' => _(\"Forwarding\"),\n 'url' => '../plugins/postfixadmin/postfixadmin_forward.php',\n 'desc' => _(\"Here you can create and edit E-Mail forwards.\"),\n 'js' => false\n );\n bindtextdomain('squirrelmail', SM_PATH . 'locale');\n textdomain('squirrelmail');\n\n bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');\n textdomain('postfixadmin');\n if ($AllowVacation) {\n $optpage_blocks[] = array(\n 'name' => _(\"Auto Response\"),\n 'url' => '../plugins/postfixadmin/postfixadmin_vacation.php',\n 'desc' => _(\"Set an OUT OF OFFICE message or auto responder for your mail.\"),\n 'js' => false\n );\n bindtextdomain('squirrelmail', SM_PATH . 'locale');\n textdomain('squirrelmail');\n }\n bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');\n textdomain('postfixadmin');\n if ($AllowChangePass) {\n $optpage_blocks[] = array(\n 'name' => _(\"Change Password\"),\n 'url' => '../plugins/postfixadmin/postfixadmin_changepass.php',\n 'desc' => _(\"Change your mailbox password.\"),\n 'js' => false\n );\n bindtextdomain('squirrelmail', SM_PATH . 'locale');\n textdomain('squirrelmail');\n }\n}", "function render_block_core_comment_template($attributes, $content, $block)\n {\n }", "public function finalize() {\n\n\t\t// template debug\n\t\tif ($this->config) {\n\t\t\tif ($this->config->get('storefront_template_debug')) {\n\t\t\t\t// storefront enabling\n\t\t\t\tif (!IS_ADMIN && !isset($this->session->data['tmpl_debug']) && isset($this->request->get['tmpl_debug'])) {\n\t\t\t\t\t$this->session->data['tmpl_debug'] = isset($this->request->get['tmpl_debug']);\n\t\t\t\t}\n\n\t\t\t\tif ((isset($this->session->data['tmpl_debug']) && isset($this->request->get['tmpl_debug'])) && ($this->session->data['tmpl_debug'] == $this->request->get['tmpl_debug'])) {\n\n\t\t\t\t\t$block_details = $this->layout->getBlockDetails($this->instance_id);\n\t\t\t\t\t$excluded_blocks = array( 'common/head' );\n\n\t\t\t\t\tif (!empty($this->instance_id) && (string)$this->instance_id != '0' && !in_array($block_details['controller'], $excluded_blocks)) {\n\t\t\t\t\t\tif (!empty($this->parent_controller)) {\n\t\t\t\t\t\t\t//build block template file path based on primary template used\n\t\t\t\t\t\t\t//template path is based on parent block 'template_dir'\n\t\t\t\t\t\t\t$tmp_dir = $this->parent_controller->view->data['template_dir'].\"template/\";\n\t\t\t\t\t\t\t$block_tpl_file = $tmp_dir.$this->view->getTemplate();\n\t\t\t\t\t\t\t$prt_block_tpl_file = $tmp_dir.$this->parent_controller->view->getTemplate();\n\t\t\t\t\t\t\t$args = array( 'block_id' => $this->instance_id,\n\t\t\t\t\t\t\t\t\t\t\t'block_controller' => $this->dispatcher->getFile(),\n\t\t\t\t\t\t\t\t\t\t\t'block_tpl' => $block_tpl_file,\n\t\t\t\t\t\t\t\t\t\t\t'parent_id' => $this->parent_controller->instance_id,\n\t\t\t\t\t\t\t\t\t\t\t'parent_controller' => $this->parent_controller->dispatcher->getFile(),\n\t\t\t\t\t\t\t\t\t\t\t'parent_tpl' => $prt_block_tpl_file\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$debug_wrapper = $this->dispatch('common/template_debug', array( 'instance_id' => $this->instance_id, 'details' => $args ));\n\t\t\t\t\t\t\t$debug_output = $debug_wrapper->dispatchGetOutput();\n\t\t\t\t\t\t\t$output = trim($this->view->getOutput());\n\t\t\t\t\t\t\tif (!empty($output)) $output = '<span class=\"block_tmpl_wrapper\">' . $output . $debug_output . '</span>';\n\t\t\t\t\t\t\t$this->view->setOutput($output);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tunset($this->session->data['tmpl_debug']);\n\t\t\t}\n\t\t}\n\t\t$this->view->render();\n\t}", "function register_block_core_comment_content()\n {\n }", "function listNotifications( ){\n global $lang, $config;\n $sReturn = null;\n\n if( $config['login'] == 'admin' || $config['pass'] == 'admin' )\n $sReturn .= '<li>'.$lang['Change_login_and_pass'].' <a href=\"?p=tools-config\">'.$lang['More'].' &raquo;</a></li>';\n\n if( is_file( 'index.php' ) && time( ) - filemtime( 'index.php' ) > 6480000 ){\n $sReturn .= '<li>'.$lang['Check_for_fixes'].' <a href=\"http://opensolution.org/?p=download&amp;sDir=Quick.Cart/bugfixes\" target=\"_blank\">'.$lang['More'].' &raquo;</a></li>';\n }\n\n if( strstr( $_SERVER['REQUEST_URI'], 'admin.php' ) ){\n $sReturn .= '<li>'.$lang['Increase_security'].' <a href=\"'.$config['manual_link'].'information#3\" target=\"_blank\">'.$lang['More'].' &raquo;</a></li>';\n } \n\n if( !defined( 'LICENSE_NO_LINK' ) && is_dir( DIR_TEMPLATES.$config['skin'].'/' ) ){\n foreach( new DirectoryIterator( DIR_TEMPLATES.$config['skin'].'/' ) as $oFileDir ) {\n if( strstr( $oFileDir->getFilename( ), '.php' ) && preg_match( '/http:\\/\\/opensolution\\.org|http:\\/\\/www\\.opensolution\\.org/i', file_get_contents( DIR_TEMPLATES.$config['skin'].'/'.$oFileDir->getFilename( ) ) ) ){\n define( 'LICENSE_LINK_OK', true );\n break;\n }\n } // end foreach\n\n if( !defined( 'LICENSE_LINK_OK' ) )\n $sReturn .= '<li>Please restore the footer link <strong>\"powered by Quick.Cart\"</strong> redirecting to <strong>http://opensolution.org/</strong> <a href=\"http://opensolution.org/licenses.html\" target=\"_blank\">'.$lang['More'].' &raquo;</a></li>';\n }\n\n if( !empty( $sReturn ) )\n $sReturn .= '<li>'.$lang['Last_login'].': <strong>'.displayDate( $config['before_last_login'], $config['date_format_admin_default'] ).'</strong></li>';\n\n return $sReturn;\n}", "function moduleContent()\t{\n\t\tif(!is_array($GLOBALS[\"TYPO3_CONF_VARS\"][\"SYS\"][\"nodes\"])){\n\t\t $content=\"<h2 style=\\\"color:red;\\\">NO SERVERS CONFIGURED, PLASE SETUP YOUR NODES IN localconf.php</h2>\";\n\t\t $this->content.=$this->doc->section(\"No servers available\",$content,0,1);\n\t\t return;\n\t\t}\n\t\tswitch((string)$this->MOD_SETTINGS[\"function\"])\t{\n\t\t\tcase 2:\n /*\n\t\t\t\t$content=\"<div align=center><strong>Hello World!</strong></div><br />\n\t\t\t\t\tThe 'Kickstarter' has made this module automatically, it contains a default framework for a backend module but apart from it does nothing useful until you open the script '\".substr(t3lib_extMgm::extPath(\"typo3_cluster\"),strlen(PATH_site)).\"mod1/index.php' and edit it!\n\t\t\t\t\t<HR>\n\t\t\t\t\t<br />This is the GET/POST vars sent to the script:<br />\".\n\t\t\t\t\t\"GET:\".t3lib_div::view_array($_GET).\"<br />\".\n\t\t\t\t\t\"POST:\".t3lib_div::view_array($_POST).\"<br />\".\n\t\t\t\t\t\"\";\n */\n \n\t\t\t $mode=$_POST[\"mode\"];\n\t\t\t if (stristr(\"update\",$mode)){\n\t\t\t\t $file=$_POST[\"updfile\"];\n\t\t\t\t $servers=$_POST[\"server_selected\"];\n\t\t\t\t $this->content.=$this->updateServers($file,$servers);\n\t\t\t }else{\n\t\t\t\t $content=$this->getUpdateform($mode);\n\t\t\t\t $this->content.=$this->doc->section(\"Update typo3conf to all servers:\",$content,0,1);\n\t\t\t }\n \n\t\t\t break;\n\n\t\t\tcase 1:\n\t\t\t foreach($GLOBALS[\"TYPO3_CONF_VARS\"][\"SYS\"][\"nodes\"] as $node){\t\t\t\t\n\t\t\t\t $start=$this->getmicrotime();\n\t\t\t\t $testhandler=@fopen(\"http://{$node['host']}/index.php?eID=cluster_worker&action=systemStatus&typo3_cluster_execute=1\",\"r\");\n\t\t\t\t if(!$testhandler){\n\t\t\t\t $nodestat[$node['host']]['alive']=false;\n\t\t\t\t }else{\n\t\t\t\t $nodestat[$node['host']]['alive']=true;\n\t\t\t\t $nodestat[$node['host']]['ping']=$this->getmicrotime() - $start;\t\t\t\t \n\t\t\t\t $nodestat[$node['host']]['sys']=fread($testhandler,8192);\n\t\t\t\t fclose($testhandler);\n\t\t\t\t }\t \t\t\t\t\n\t\t\t }\n\t\t\t \n\t\t\t \n\t\t\t $content=\"<table align=\\\"center\\\" border=\\\"1\\\" cellpadding=\\\"8\\\"><tr><th>Host:</th><th>Status:</th><th>Ping:</th><th>System Status:</th></tr>\";\n\t\t\t foreach($nodestat as $host=>$nodedata){\n\t\t\t\tif($nodedata['alive']){\n\t\t\t\t $status=\"<span style=\\\"color:#0F0;font-weight:bold;\\\">ALIVE</span>\";\n\t\t\t\t $ping=round(($nodedata['ping']*1000)).\" ms\";\n\t\t\t\t $sys=\"<span style=\\\"font-family:Courier New,fixed;font-size:11px;\\\">{$nodedata['sys']}</span>\";\n\t\t\t\t}else{\n\t\t\t\t $status=\"<span style=\\\"color:#F00;font-weight:bold;\\\">DEAD</span>\";\n\t\t\t\t $ping=\"N/A\";\n\t\t\t\t $sys=\"N/A\";\n\t\t\t\t}\n\t\t\t\t$content.=\"<tr><td>$host</td><td>$status</td><td>$ping</td><td>$sys</td></tr>\";\n\t\t\t }\t\t\t \n\t\t\t $content.=\"</table>\";\n\t\t\t $this->content.=$this->doc->section(\"Check cluster health:\",$content,0,1);\n\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$content=\"<div align=center><strong>Menu item #3...</strong></div>\";\n\t\t\t\t$this->content.=$this->doc->section(\"Message #3:\",$content,0,1);\n\t\t\tbreak;\n\t\t}\n\t}", "function get_the_block_template_html()\n {\n }", "public function getContent()\n {\n $stop = $this->getWarningMultishopHtml();\n if ($stop) {\n return $stop;\n }\n $adv = Tools::getValue('adv', 0);\n\n $this->context->smarty->assign('adv', $adv);\n\n $msg = $this->postProcess();\n\n $output = $msg;\n $oldPS = false;\n $this->context->controller->addJS($this->_path . 'views/js/admin-panel.js');\n\n if (_PS_VERSION_ < 1.6) {\n $oldPS = true;\n $this->context->controller->addJS($this->_path . 'views/js/plugins/bootstrap.min.js');\n $this->context->controller->addCSS($this->_path . 'views/css/admin-theme_15.css');\n }\n $configured = $this->isConfigured();\n $is_new_shop = $this->showNewShopForm(Context::getContext()->shop);\n $shop_id = null;\n if ($is_new_shop) {\n $shop_id = Context::getContext()->shop->id;\n }\n\n $skip_url_params = [\n 'skip' => 1,\n 'configure' => $this->name,\n 'tab_module' => $this->tab,\n 'module_name' => $this->name,\n ];\n $skipurl = $this->context->link->getAdminLink('AdminModules', true);\n $separator = strpos($skipurl, '?') === false ? '?' : '&';\n $skipurl .= $separator . http_build_query($skip_url_params);\n\n $redirect = $this->context->shop->getBaseURL(true, false) . $this->_path . 'config.php';\n $token = Tools::encrypt($redirect);\n $paramsPopup = 'email=' . $this->context->employee->email . '&token=' . $token;\n $dfEnabledV9 = Configuration::get('DF_ENABLED_V9');\n\n $this->context->smarty->assign('oldPS', $oldPS);\n $this->context->smarty->assign('module_dir', $this->_path);\n $this->context->smarty->assign('configured', $configured);\n $this->context->smarty->assign('is_new_shop', $is_new_shop);\n $this->context->smarty->assign('shop_id', $shop_id);\n $this->context->smarty->assign('checkConnection', $this->checkOutsideConnection());\n $this->context->smarty->assign('tokenAjax', Tools::encrypt('doofinder-ajax'));\n $this->context->smarty->assign('skipurl', $skipurl);\n $this->context->smarty->assign('paramsPopup', $paramsPopup);\n $this->context->smarty->assign('dfEnabledV9', $dfEnabledV9);\n\n $output .= $this->context->smarty->fetch($this->local_path . 'views/templates/admin/configure.tpl');\n if ($configured) {\n $feed_indexed = Configuration::get('DF_FEED_INDEXED', false);\n if (empty($feed_indexed)) {\n $controller_url = $this->context->link->getAdminLink('DoofinderAdmin', true) . '&ajax=1';\n $this->context->smarty->assign('update_feed_url', $controller_url . '&action=UpdateConfigurationField');\n $this->context->smarty->assign('check_feed_url', $controller_url . '&action=CheckConfigurationField');\n $output .= $this->context->smarty->fetch($this->local_path . 'views/templates/admin/indexation_status.tpl');\n }\n\n $output .= $this->context->smarty->fetch($this->local_path . 'views/templates/admin/configure_administration_panel.tpl');\n $output .= $this->renderFormDataFeed($adv);\n if ($adv) {\n $output .= $this->renderFormAdvanced();\n }\n $adv_url = $this->context->link->getAdminLink('AdminModules', true) . '&adv=1'\n . '&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name;\n $this->context->smarty->assign('adv_url', $adv_url);\n }\n\n $output .= $this->context->smarty->fetch($this->local_path . 'views/templates/admin/configure_footer.tpl');\n\n return $output;\n }", "protected function prepareQuickTemplate() {\n\t\t$parserOutput = $this->getRandomFeaturedUser();\n\t\t$po = '';\n\t\tif ( $parserOutput !== null ) {\n\t\t\t$po = $parserOutput->getText();\n\t\t\t// This MUST be done before the parent::prepareQuickTemplate() call!\n\t\t\t$this->getOutput()->addModuleStyles( $parserOutput->getModuleStyles() );\n\t\t}\n\n\t\tif ( class_exists( 'RandomGameUnit' ) ) {\n\t\t\t$this->getOutput()->addModuleStyles( 'ext.RandomGameUnit.css' );\n\t\t}\n\n\t\t$tpl = parent::prepareQuickTemplate();\n\t\t$originalFooterLinks = $tpl->get( 'footerlinks' );\n\n\t\t$linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();\n\t\t$tpl->set( 'mainpage', $linkRenderer->makeKnownLink(\n\t\t\tTitle::newMainPage(),\n\t\t\t$this->msg( 'mainpage' )->text()\n\t\t) );\n\t\t$tpl->set( 'specialpages', $this->specialPagesLink() );\n\t\t$tpl->set( 'help', $this->helpLink() );\n\t\t$tpl->set( 'advertise', $this->advertiseLink() );\n\n\t\t// Can't lazily just overwrite 'footerlinks' because that way we'd also end up\n\t\t// overwriting any and all extension-added links as well!\n\t\t$originalFooterLinks = $tpl->get( 'footerlinks' );\n\n\t\t// Filter out \"last modified on <date>\" from footer items, we render that differently\n\t\t// and only for certain (NS_MAIN etc.) pages\n\t\t$originalFooterLinks['info'] = array_diff( $originalFooterLinks['info'], [ 'lastmod' ] );\n\n\t\t// Filter out duplicate entries, we don't want two \"Privacy Policy\" or\n\t\t// \"About\" (etc.) links in the footer\n\t\t$a = array_diff( $originalFooterLinks['places'], [ 'privacy', 'about', 'disclaimer' ] );\n\t\t$originalFooterLinks['places'] = array_merge(\n\t\t\t[\n\t\t\t\t'mainpage',\n\t\t\t\t'about',\n\t\t\t\t'specialpages',\n\t\t\t\t'help',\n\t\t\t\t'disclaimer',\n\t\t\t\t'advertise',\n\t\t\t],\n\t\t\t$a\n\t\t);\n\n\t\t$tpl->set( 'footerlinks', [\n\t\t\t'info' => $originalFooterLinks['info'],\n\t\t\t'places' => $originalFooterLinks['places']\n\t\t] );\n\n\t\t$tpl->set( 'nimbus-randomfeatureduser', $po );\n\t\treturn $tpl;\n\t}", "function opanda_show_knews_html() {\r\n\r\n if ( !class_exists(\"KnewsPlugin\") ) {\r\n ?>\r\n <div class=\"form-group\">\r\n <label class=\"col-sm-2 control-label\"></label>\r\n <div class=\"control-group controls col-sm-10\">\r\n <p><strong><?php _e('The K-news plugin is not found on your website. Emails will not be saved.', 'opanda') ?></strong></p>\r\n </div>\r\n </div>\r\n <?php\r\n } else {\r\n ?>\r\n <div class=\"form-group\">\r\n <label class=\"col-sm-2 control-label\"></label>\r\n <div class=\"control-group controls col-sm-10\">\r\n <p><?php _e('You can set a list where the subscribers should be added in the settings of a particular locker.', 'opanda') ?></p>\r\n </div>\r\n </div>\r\n <?php\r\n }\r\n}", "function register_block_core_heading()\n {\n }", "function uultra_update_user_custom_link_content()\r\n\t{\r\n\t\t$package_id = $_POST[\"package_id\"];\t\t\r\n\t\r\n\t\t\t\r\n\t\t$modules = $this->uultra_get_user_navigator_for_membership($package_id);\t\t\t\t\r\n\t\t$modules_custom = $this->uultra_get_custom_modules_for_membership($package_id); \r\n\t\t\r\n\t\t$id = $_POST[\"link_id\"];\t\t\t\t\r\n\t\t$uu_content = $_POST[\"widget_text\"];\r\n\t\t\r\n\t\t$html = '';\r\n\t\t\r\n\t\t\r\n\t\tif(isset($modules[$id]) )\r\n\t\t{\r\n\t\t\t$link =$modules[$id] ;\r\n\t\t\t$modules[$id]['content'] =$uu_content;\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t//custom array\r\n\t\t\t$modules_custom[$id]['content'] =$uu_content;\t\r\n\t\t\t\t\t\t\r\n\t\t\t$html = __('Done!', 'xoousers');\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\techo $html;\r\n\t\t\r\n\t\tif($package_id=='')\r\n\t\t{\r\n\t\t\tupdate_option('userultra_default_user_features_custom',$modules);\r\n\t\t\tupdate_option('userultra_default_user_features_added_admin',$modules_custom);\r\n\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tupdate_option('userultra_default_user_features_custom_package_'.$package_id.'',$modules);\r\n\t\t\tupdate_option('userultra_default_user_features_added_admin_package_'.$package_id.'',$modules_custom);\r\n\t\t\t\r\n\t\t\r\n\t\t}\r\n\t\tdie();\r\n\t\r\n\t}", "protected function runtimeProcessTemplate()\n\t{\n\t// Here we grab the theme to get the javascript and css include file.\n\t\t$theme = new Theme($this->theme);\n\t\t$this->addJSInclude($theme->getUrl('js'));\n\t\t$this->addCssInclude($theme->getUrl('css'));\n\n\t\t$this->preStartupJs[] = 'var baseUrl = ' . json_encode(ActiveSite::getLink()) . ';';\n\n\t\tif(isset($this->menuObjects))\n\t\t\tforeach($this->menuObjects as $name => $menuDisplay)\n\t\t{\n\t\t\t$this->addRegion($name, $menuDisplay->makeDisplay());\n\t\t}\n\n\t// This line ensures that any additional content we add below that requires a fully-functional system doesn't\n\t// choke the installer.\n\t\tif(defined('INSTALLMODE') && INSTALLMODE) return true;\n\n\t// Add the messages to the page.\n\t\tif(count($this->messages) > 0)\n\t\t{\n\t\t\t$outputMessage = new HtmlObject('div');\n\t\t\t$outputMessage->addClass('messageContainer');\n\n\t\t\tforeach($this->messages as $message)\n\t\t\t{\n\t\t\t\t$outputMessage->insertNewHtmlObject('div')->wrapAround($message);\n\t\t\t}\n\t\t\t$this->addRegion('messages', (string) $outputMessage);\n\t\t}\n\t}", "function ou_df_preprocess_block(&$variables) {\n $block = $variables['block'];\n // Allow the standard wrappers to come through if contextual links exist on\n // the block.\n if ($block->module == 'system' && $block->delta == 'main' && empty($variables['title_prefix'])) {\n $variables['theme_hook_suggestions'][] = 'block__no_wrappers';\n }\n}", "public function render_notice(): void {\n\t\tglobal $hook_suffix;\n\n\t\tif ( ! $this->is_plugins_page( $hook_suffix ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$network_wide = is_network_admin();\n\t\t$flag = $this->get_activation_flag( $network_wide );\n\n\t\tif ( ! $flag ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Unset the flag so that the notice only shows once.\n\t\t$this->delete_activation_flag( $network_wide );\n\n\t\trequire_once WEBSTORIES_PLUGIN_DIR_PATH . 'includes/templates/admin/activation-notice.php';\n\t}", "protected function renderModuleContent() {}", "public function hookDisplayAdminProductsExtra()\n {\n $this->context->smarty->assign(\n array(\n 'my_module_name' => Configuration::get('MYMODULE_NAME'),\n 'my_module_link' => $this->context->link->getModuleLink('myetickets', 'display'),\n 'is_eticket' => Eticket::isEticketProduct((int)Tools::getValue('id_product')),\n 'languages' => $this->context->controller->_languages,\n 'default_form_language' => (int)Configuration::get('PS_LANG_DEFAULT')\n )\n );\n return $this->display(__FILE__, 'adminProductExtra.tpl');\n }", "public function notifyModerators(&$comment) {\n if (!$comment instanceof modxTalksPost && !$comment instanceof modxTalksTempPost) {\n return false;\n }\n\n $this->modx->lexicon->load('modxtalks:emails');\n\n /**\n * Get User info\n */\n $user = $comment->getUserData();\n $images_url = $this->modx->getOption('site_url') . substr($this->config['imgUrl'], 1);\n\n if ($comment instanceof modxTalksPost) {\n $cid = $comment->conversationId;\n $idx = $comment->idx;\n $link = $this->generateLink($cid, $idx, 'full');\n $subject = $this->modx->lexicon('modxtalks.email_new_comment');\n $text = $this->modx->lexicon('modxtalks.email_added_new_comment', array(\n 'link' => $link,\n 'name' => $user['name'],\n ));\n } elseif ($comment instanceof modxTalksTempPost) {\n $subject = $this->modx->lexicon('modxtalks.email_new_premoderated_comment');\n $text = $this->modx->lexicon('modxtalks.email_user_add_premoderated_comment', array(\n 'name' => $user['name'],\n ));\n }\n\n $params = array(\n 'title' => 'Заголовок',\n 'content' => $this->modx->stripTags($this->bbcode($comment->content)),\n 'images_url' => $images_url,\n 'avatar' => $this->getAvatar($user['email'], 50),\n 'text' => $text,\n 'date' => date($this->config['dateFormat'] . ' O', $comment->time),\n );\n\n /**\n * get email body\n */\n $body = $this->getChunk('mt_send_mail', $params);\n\n /**\n * send notifications\n */\n $success = false;\n\n $emails = $this->getUsersEmailsByGroups($this->config['moderator'], $comment);\n\n /**\n * send notifications to moderators\n */\n if (!empty($emails)) {\n if ($this->sendEmail($subject, $body, $emails)) {\n $success = true;\n }\n }\n\n return $success;\n }", "function isfnet_preprocess_block(&$variables, $hook) {\n // Use a bare template for the page's main content.\n if ($variables['block_html_id'] == 'block-system-main') {\n $variables['theme_hook_suggestions'][] = 'block__bare';\n }\n $variables['title_attributes_array']['class'][] = 'block-title';\n}", "function templ_extend(){\r\n\t\t$modules_array = array();\r\n\t\t$modules_array = array('templatic-custom_taxonomy','templatic-custom_fields','templatic-registration','templatic-monetization','templatic-claim_ownership');\r\n\t\trequire_once(TEMPL_MONETIZE_FOLDER_PATH.'templ_header_section.php' );\r\n\t\t?>\r\n <p class=\"tevolution_desc\"><?php echo __('Here are the most popular directory extensions to extend the functionality of your Business Directory site and make it more powerful. Please click the \"Details & Purchase\" button next to any of them to find out more about the functions they each offer.','templatic-admin');?></p>\r\n <?php\r\n\t\techo '\r\n\t\t<div id=\"tevolution_bundled\" class=\"metabox-holder wrapper widgets-holder-wrap\"><table cellspacing=\"0\" class=\"wp-list-tev-table postbox fixed pages \">\r\n\t\t\t<tbody style=\"background:white; padding:40px;\">\r\n\t\t\t<tr><td>\r\n\t\t\t';\r\n\t\t/* This is the correct way to loop over the directory. */\t\t\t\r\n\t\tdo_action('tevolution_extend_box');\r\n\t\t/* to get t plugins */\t\t\t\r\n\t\techo '</td></tr>\r\n\t\t</tbody></table>\r\n\t\t</div>\r\n\t\t';\r\n\t\r\n\t\trequire_once(TEMPL_MONETIZE_FOLDER_PATH.'templ_footer_section.php' );\r\n\t}", "function onRenderModule (&$module, $attribs) {\r\n\t\tstatic $chromed = false;\r\n\t\t/* Detect layout path in T3 themes */\r\n\t\tif (T3Common::detect()) {\t\t\t\r\n\t\t\t//remove outline style which added when tp=1\r\n\t\t\t//T3 template provide an advanced tp mode which could show more information than the default \t\t\t\r\n\t\t\tif(JRequest::getBool('tp')) {\r\n\t\t\t\t$attribs['style'] = preg_replace ('/\\s\\boutline\\b/i', '', $attribs['style']);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//chrome for module\r\n\t\t\tif (!$chromed) {\r\n\t\t\t\t$chromed = true;\r\n\t\t\t\t//we don't need chrome multi times\r\n\t\t\t\t$chromePath = T3Path::getPath ('html'.DS.'modules.php', false);\r\n\t\t\t\tif (file_exists($chromePath)) {\r\n\t\t\t\t\trequire_once ($chromePath);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function INSTALL($e) { $s=$im='';\n\n\nif($GLOBALS['admin']) {\n\n$GLOBALS['article']['template']='blank';\n\n\nSTYLES(\"mod\",\"\n.iDIR,.iYES,.iNON,.iDEL,.iUPD,.iADD { cursor:pointer; clear:left;float:left; }\n.iNON {color: #aaa}\n.iDEL {color: red}\n.iYES,.iUPD {color: green}\n.iADD {color: rgb(0,255,0)}\n.iNON,.iSS {text-decoration:line-through}\n.iNON:before,.iNON:after,.iSS:before,.iSS:after {content:' '}\n.iYES,.iOK {text-decoration:none}\n\n.iDIR {font-weight: bold; float:left; valign:top; }\n.iT {float:left;margin-top:20pt;}\n\n.p1 { color: #3F3F3F; text-decoration: line-through; background: #DFDFDF; } /* вычеркнутый */\n.p2 { background: #FFD0C0; } /* вставленный */\n\n\");\n\n $upgrade=gglob($GLOBALS['host_module'].\"install/*.php\");\n foreach($upgrade as $l) { $xi=explode('/',$l); $m=array_pop($xi);\n\t\t$im.=\"'$m',\";\n\t\t$s.=\"<div class='mod' id='module__$m'>\".$m.\"</div>\";\n\t}\n\nSCRIPTS(\"mod\",\"\nvar install_modules_n=0;\nfunction check_mod_do() { if(typeof install_modules[install_modules_n] == 'undefined') { install_modules_n=0; return; }\n\tvar m=install_modules[install_modules_n++];\n\tzabil('module__'+m,'<img src='+www_design+'img/ajax.gif>'+vzyal('module__'+m));\n\tmajax('module.php',{mod:'INSTALL',a:'testmod',module:m});\n}\nvar install_modules=[\".trim($im,',').\"];\n\nvar timestart;\nfunction dodo(module,allwork,time,skip,aram) {\n\tif(skip) {\n\t\tvar timenow = new Date();\n\t\tvar t=timenow.getTime()-timestart.getTime();\n\t\tvar e=parseInt((t/skip)*allwork)-t;\n\t\tzabilc('timet',' &nbsp; &nbsp; &nbsp; осталось: '+pr_time(e)+' сек');\n\t} else { timestart = new Date(); }\n\tvar ara={mod:'INSTALL',a:'do',module:module,allwork:allwork,time:time,skip:skip};\n\tif(typeof(aram)=='object') for(var i in aram) ara[i]=aram[i];\n\tmajax('module.php',ara);\n}\n\nfunction pr_time(t) { var N=new Date(); N.setTime(t); var s=pr00(N.getUTCSeconds());\n\tif(N.getUTCMinutes()) s=pr00(N.getUTCMinutes())+':'+s;\n\tif(N.getUTCHours()) s=pr00(N.getUTCHours())+':'+s;\n\treturn s;\n} function pr00(n){return ((''+n).length<2?'0'+n:n)}\n\n\npage_onstart.push('check_mod_do()');\n\n\");\n\n}\n\nreturn \"<table width=100% style='border: 1px dotted red'>\n<tr valign=top>\n\t<td>\n\t\t\n\t\t<div id='mesto_module'>$s</div>\n\t</td>\n\t<td width='100%'><div id='mesto_otvet'>\".admin_login().\"</div></td>\n</tr></table>\";\n\n}", "public function hookDisplayAdminProductsExtra()\n {\n return $this->get('twig')->render('@PrestaShop/Products/module_panel.html.twig');\n }", "function moduleContent()\t{\n\t\t$mod = t3lib_div::makeInstance('tx_groupdelegation');\n\n\t\tif($mod->checkAdminAndSetAdminGroupsSqlString() === false) {\n\t\t\t$this->content .= $GLOBALS['LANG']->getLL('no_permission');\n\t\t} else {\n\t\t\t$mod->setEditableUsers();\n\n\t\t\t\t//build edit user form\n\t\t\tif(t3lib_div::GPvar('user') && !t3lib_div::GPvar('edit')) {\n\t\t\t\t$this->content.=$this->doc->section($GLOBALS['LANG']->getLL('edit_user'),$mod->renderEditUserForm(),0,1);\n\n\t\t\t\t//save and build user overview\n\t\t\t} elseif(t3lib_div::GPvar('user') && t3lib_div::GPvar('edit')) {\n\t\t\t\t$mod->save();\n\t\t\t\t$mod->setEditableUsers();\n\t\t\t\t$this->content .= $this->doc->section($GLOBALS['LANG']->getLL('editable_user_overview'),$mod->renderUserOverview(),0,1);\n\n\t\t\t\t\t//build user overview\n\t\t\t} else {\n\t\t\t\t\t$this->content .= $this->doc->section($GLOBALS['LANG']->getLL('editable_user_overview'),$mod->renderUserOverview(),0,1);\n\t\t\t}\n\t\t}\n\t}", "function myblocks() {\n $this->name=\"myblocks\";\n $this->title=\"<#LANG_MODULE_MYBLOCKS#>\";\n $this->module_category=\"<#LANG_SECTION_SETTINGS#>\";\n $this->checkInstalled();\n}", "function ibm_apim_theme_preprocess_block(&$vars) {\r\n if ($vars['block']->module == 'superfish' || $vars['block']->module == 'nice_menu') {\r\n $vars['content_attributes_array']['class'][] = 'clearfix';\r\n }\r\n if (!$vars['block']->subject) {\r\n $vars['content_attributes_array']['class'][] = 'no-title';\r\n }\r\n if ($vars['block']->region == 'menu_bar' || $vars['block']->region == 'top_menu') {\r\n $vars['title_attributes_array']['class'][] = 'element-invisible';\r\n }\r\n}", "function moduleContent() {\n\n\t\t// Check that we can get the template page\n\t\t$this->templateUid = intval($GLOBALS['MCONF']['uidOfTemplate']);\n\t\t\n\t\tif(!$this->checkTemplatePage()) {\n\t\t\treturn $GLOBALS['LANG']->getLL('errorNoTemplate');\n\t\t}\n\n\t\t// What to do?\n\t\tif(t3lib_div::_GP('formPosted')) {\n\t\t\tif($this->createSpace()) {\n\t\t\t\t$this->content .= $this->renderSpaceInfo();\n\t\t\t} else {\n\t\t\t\t$this->content .= $this->renderForm();\n\t\t\t}\n\t\t} else {\n\t\t\t$this->content .= $this->renderForm();\t\n\t\t}\n\t}", "function _inject_theme_attribute_in_block_template_content($template_content)\n {\n }", "function _resolve_home_block_template()\n {\n }", "function m_packageHome()\n\t{\n\t\t\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_PACKAGE_FILE\",$this->packageTemplate);\n\n\t\t#SETTING ALL TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_ATTACHED_BLK\", \"attached_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_BUTTON_BLK\", \"btn_blk\");\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_SHOPURL\",SITE_URL.\"ecom/\");\n\t\t\t\t\n\t\t$this->ObTpl->set_var(\"attached_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"btn_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",\"\");\n\t\t\n\t\t//defining language variables\n\t\t$this->ObTpl->set_var(\"LANG_VAR_PRODUCTPACKAGE\",LANG_PRODUCTPACKAGES);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_CREATEPACKAGE\",LANG_CREATEPACKAGE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_RECORDSFOUND\",LANG_RECORDSFOUND);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_SEARCH\",LANG_SEARCH);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_ID\",LANG_ID);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_NAME\",LANG_NAME);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_PRODUCTSTXT\",LANG_PRODUCTSTXT);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_DISASSEMBLE\",LANG_DISASSEMBLE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_EDITPACKAGE\",LANG_EDITPACKAGE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_EDIT\",LANG_EDIT);\n\n\t\tif(!isset($this->request['search']))\n\t\t{\n\t\t\t$this->request['search']=\"\";\n\t\t}\t\n\t\t\n\t\t#TO DISPLAY CURRENTLY ATTACHED ITEMS\n\t\t$query1 = \"SELECT vSku,vTitle,iProdId_PK,iKit FROM \".PRODUCTS.\" WHERE iKit='1' OR iKit='2' \";\n\n\t\tif(!empty($this->request['search']))\n\t\t{\n\t\t\t$query1.=\" AND vTitle like '%\".$this->request['search'].\"%' OR vSku like '%\".$this->request['search'].\"%'\";\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_LINK\",\"<a href=\".SITE_URL.\"ecom/adminindex.php?action=ec_package.home>View all</a>\");\n\t\t}\t\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_LINK\",\"\");\n\t\t}\n\t\n\t\t$this->obDb->query=$query1;\n\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t$recordCount=$this->obDb->record_count;\n\t\t$this->ObTpl->set_var(\"TPL_VAR_RECORDCOUNT\",$recordCount);\n\t\tif($recordCount>0)\n\t\t{\n\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t{\n\t\t\t\t$this->obDb->query= \"SELECT iKitId_PK FROM \".PRODUCTKITS.\" WHERE iKitid='\".$queryResult[$j]->iProdId_PK.\"'\";\n\t\t\t\t$rs = $this->obDb->fetchQuery();\n\t\t\t\t$rCount=$this->obDb->record_count;\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_RCOUNT\",$rCount);\n\n\t\t\t\t$this->obDb->query= \"SELECT vOwnerType,iOwner_FK FROM \".FUSIONS.\" WHERE iSubId_FK='\".$queryResult[$j]->iProdId_PK.\"' AND vType='product'\";\n\t\t\t\t$rs1 = $this->obDb->fetchQuery();\n\t\t\t\t\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TYPE\",$rs1[0]->vOwnerType);\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_OWNER\",$rs1[0]->iOwner_FK);\n\n\t\t\t\tif($queryResult[$j]->iKit==1)\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECKED\",\"checked=\\\"checked\\\"\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECKED\",\"\");\n\t\t\t\t}\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SKU\",$this->libFunc->m_displayContent($queryResult[$j]->vSku));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_KITID\",$rs[0]->iKitId_PK);\n\t\t\t\t$this->ObTpl->parse(\"attached_blk\",\"TPL_ATTACHED_BLK\",true);\n\t\t\t\t$this->ObTpl->parse(\"btn_blk\",\"TPL_BUTTON_BLK\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_NOPACKAGE);\n\t\t}\n\t\t\n\t\t#END DISPLAY CURRENTLY ATTACHED ITEMS\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_PACKAGE_FILE\"));\n\t}", "function installError($errorMsg) {\n\t\t$templateMgr =& TemplateManager::getManager();\n\t\t$templateMgr->assign(array('isInstallError' => true, 'errorMsg' => $errorMsg));\n\t\t$this->display();\n\t}", "public function notificationAction(){\n\t\t$this->loadLayout(); \n\t\t$this->renderLayout();\n\t}", "public function forTemplate() {\n\t\treturn; \n\t}", "function add_admin_notice() {\r\n\t\tglobal $current_user ;\r\n\t\tglobal $pagenow;\r\n\r\n\t\t$user_id = $current_user->ID;\r\n\r\n\t\tdo_action( $this->pluginPrefix.'_before_notification_displayed', $current_user, $pagenow );\r\n\r\n\t\tif ( current_user_can( 'manage_options' ) ){\r\n\r\n\t\t\t\t$plugin_serial_status = get_option( $this->pluginSerialStatus );\r\n\t\t\t\tif ( $plugin_serial_status != 'found' ){\r\n\t\t\t\t\t// Check that the user hasn't already clicked to ignore the message\r\n\t\t\t\t\tif ( ! get_user_meta($user_id, $this->pluginPrefix.'_dismiss_notification' ) ) {\r\n\t\t\t\t\t\techo $finalMessage = apply_filters($this->pluginPrefix.'_notification_message','<div class=\"error wppb-serial-notification\" >'.$this->notificaitonMessage.'</div>', $this->notificaitonMessage);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdo_action( $this->pluginPrefix.'_notification_displayed', $current_user, $pagenow, $plugin_serial_status );\r\n\r\n\t\t}\r\n\r\n\t\tdo_action( $this->pluginPrefix.'_after_notification_displayed', $current_user, $pagenow );\r\n\r\n\t}", "function moduleContent()\t{\n\t\tswitch((string)$this->MOD_SETTINGS[\"function\"])\t{\n\t\t\tcase 1:\n\t\t\t\t$content = $this->makeAclOptions();\n\t\t\t\t$this->content .= $this->doc->section(\"Message #1:\",$content,0,1);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$content = $this->deleteCache();\n\t\t\t\t$this->content .= $this->doc->section(\"Message #1:\",$content,0,1);\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function renew(){\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "protected function getHTMLTemplate()\n {\n if (is_file($tpl = $this->supportPath . '/templates/html.tpl')) {\n return file_get_contents($tpl);\n }\n\n return <<<HTMLTPL\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns =\"http://www.w3.org/1999/xhtml\">\n<head>\n <meta content=\"text/html;charset=utf-8\"/>\n <title>Behat Test Suite</title>\n <link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\"/>\n <style type=\"text/css\">\n body {\n margin:0px;\n padding:0px;\n position:relative;\n }\n #behat {\n float:left;\n font-family: Georgia, serif;\n font-size:18px;\n line-height:26px;\n }\n #behat .statistics {\n float:left;\n width:100%;\n margin-bottom:15px;\n }\n #behat .statistics:before {\n content:'Behat';\n position:absolute;\n color: #1C4B20 !important;\n text-shadow: white 1px 1px 1px;\n font-size:48px !important;\n font-family: Lobster, Tahoma;\n top:22px;\n left:20px;\n }\n #behat .statistics p {\n text-align:right;\n padding:5px 15px;\n margin:0px;\n border-right:10px solid #000;\n }\n #behat .statistics.failed p {\n border-color:#C20000;\n }\n #behat .statistics.passed p {\n border-color:#3D7700;\n }\n #behat .feature {\n margin:15px;\n }\n #behat h2, #behat h3, #behat h4 {\n margin:0px 0px 5px 0px;\n padding:0px;\n font-family:Georgia;\n }\n #behat h2 .title, #behat h3 .title, #behat h4 .title {\n font-weight:normal;\n }\n #behat .path {\n font-size:10px;\n font-weight:normal;\n font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace !important;\n color:#999;\n padding:0px 5px;\n float:right;\n }\n #behat h3 .path {\n margin-right:4%;\n }\n #behat ul.tags {\n font-size:14px;\n font-weight:bold;\n color:#246AC1;\n list-style:none;\n margin:0px;\n padding:0px;\n }\n #behat ul.tags li {\n display:inline;\n }\n #behat ul.tags li:after {\n content:' ';\n }\n #behat ul.tags li:last-child:after {\n content:'';\n }\n #behat .feature > p {\n margin-top:0px;\n margin-left:20px;\n }\n #behat .scenario {\n margin-left:20px;\n margin-bottom:40px;\n }\n #behat .scenario > ol {\n margin:0px;\n list-style:none;\n margin-left:20px;\n padding:0px;\n }\n #behat .scenario > ol:after {\n content:'';\n display:block;\n clear:both;\n }\n #behat .scenario > ol li {\n float:left;\n width:95%;\n padding-left:5px;\n border-left:5px solid;\n margin-bottom:4px;\n }\n #behat .scenario > ol li .argument {\n margin:10px 20px;\n font-size:16px;\n }\n #behat .scenario > ol li table.argument {\n border:1px solid #d2d2d2;\n }\n #behat .scenario > ol li table.argument td {\n padding:5px 10px;\n background:#f3f3f3;\n }\n #behat .scenario > ol li .keyword {\n font-weight:bold;\n }\n #behat .scenario > ol li .path {\n float:right;\n }\n #behat .scenario .examples {\n margin-top:20px;\n margin-left:40px;\n }\n #behat .scenario .examples table {\n margin-left:20px;\n }\n #behat .scenario .examples table thead td {\n font-weight:bold;\n text-align:center;\n }\n #behat .scenario .examples table td {\n padding:2px 10px;\n font-size:16px;\n }\n #behat .scenario .examples table .failed.exception td {\n border-left:5px solid #000;\n border-color:#C20000 !important;\n padding-left:0px;\n }\n pre {\n font-family:monospace;\n }\n .snippet {\n font-size:14px;\n color:#000;\n margin-left:20px;\n }\n .backtrace {\n font-size:12px;\n color:#C20000;\n overflow:hidden;\n margin-left:20px;\n }\n #behat .passed {\n background:#DBFFB4;\n border-color:#65C400 !important;\n color:#3D7700;\n }\n #behat .failed {\n background:#FFFBD3;\n border-color:#C20000 !important;\n color:#C20000;\n }\n #behat .undefined, #behat .pending {\n border-color:#FAF834 !important;\n background:#FCFB98;\n color:#000;\n }\n #behat .skipped {\n background:lightCyan;\n border-color:cyan !important;\n color:#000;\n }\n </style>\n</head>\n<body>\n <div id=\"behat\">\n {{ body }}\n </div>\n</body>\n</html>\nHTMLTPL;\n }", "function tap_mod_init() \n {\n $funcion = 'mod_page_handler';\n elgg_register_page_handler('tap_mod', $funcion);\n }", "protected function setupTemplate() {\r\n \r\n }", "public function isAllowedToChangeTemplate() {\n \treturn ($this->settings->tpl_ajax_template_change == 2 || ($this->settings->tpl_ajax_template_change && isset($_SESSION['User'])));\t\n }", "function useTemplate($path_to_root_dir)\n{\n global $area, $path_to_root_dir, $error_msg_text, $sys_msg_text;\n $sys_info = getSysInfo();\n \n //this is the first place where we see that sys-tables don't exist!!\n if ($sys_info['no_tables']) {\n $link_text = __('PolyPager found the database. Very good. <br/>But: it seems that it does not yet have its database configured. By clicking on the following link you can assure that all the tables that PolyPager needs to operate are being created (if they have not been already).<br/>');\n $link_href = \"admin/?&cmd=create\";\n global $area;\n if ($area == '_admin') {\n $link_href = './?&cmd=create';\n }\n if ($area == '_gallery') {\n $link_href = '../../admin/?&cmd=create';\n }\n $error_msg_text[] = '<span id=\"no_tables_warning\">'.$link_text.'<a href=\"'.$link_href.'\">click here to create the tables.</a></span>';\n }\n if (utf8_strpos($sys_info['skin'], 'picswap')>-1) {\n $skin = 'picswap';\n } else {\n $skin = $sys_info['skin'];\n }\n $template_dirpath = $path_to_root_dir.\"/style/skins/\".$skin;\n $template_filepath = $template_dirpath.\"/template.php\";\n if (file_exists($template_filepath)) {\n @include($template_filepath);\n } else if (file_exists($template_dirpath)) {\n if ($area == '_admin') {\n $sys_msg_text[] = 'The template.php file in the '.$skin.'-directory couldn\\'t be found';\n }\n // we fall silently back to the template file\n @include($template_dirpath.\"/template.php.template\");\n } else {\n $sys_msg_text[] = __('Warning: No template could be found for the selected skin.');\n @include($path_to_root_dir.\"/style/skins/polly/template.php.template\");\n }\n}", "function autoregister_install()\n {\n // read email template for new autoregister\n $content = file_get_contents( osc_plugins_path() . osc_plugin_folder(__FILE__).'autoregister_new_user_info' );\n $aContent = json_decode($content, true);\n $s_internal_name = 'autoregister_new_user_info';\n $aFields = array('s_internal_name' => $s_internal_name, 'b_indelible' => '1');\n $aFieldsDescription = array();\n\n foreach($aContent as $key => $value) {\n $aFieldsDescription[$key]['s_title'] = $value['title'];\n $aFieldsDescription[$key]['s_text'] = $value['description'];\n }\n // add page as email template\n $page = Page::newInstance()->findByInternalName($s_internal_name);\n if(!isset($page['pk_i_id'])) {\n $result = Page::newInstance()->insert($aFields, $aFieldsDescription) ;\n } else {\n osc_add_flash_error_message(_m(\"Oops! That internal name is already in use. We can't make the changes\", 'autoregister'), 'admin') ;\n }\n }", "protected function _prepareLayout()\n {\n parent::_prepareLayout();\n \n if ( Mage::getSingleton('magna_news/wysiwyg_config')->isEnabled() )\n {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n }", "function opanda_show_mymail_html() {\r\n \r\n if ( !defined('MYMAIL_VERSION') ) {\r\n ?>\r\n <div class=\"form-group\">\r\n <label class=\"col-sm-2 control-label\"></label>\r\n <div class=\"control-group controls col-sm-10\">\r\n <p><strong><?php _e('The MyMail plugin is not found on your website. Emails will not be saved.', 'opanda') ?></strong></p>\r\n </div>\r\n </div>\r\n <?php\r\n } else {\r\n ?>\r\n <div class=\"form-group\">\r\n <label class=\"col-sm-2 control-label\"></label>\r\n <div class=\"control-group controls col-sm-10\">\r\n <p><?php _e('You can set a list where the subscribers should be added in the settings of a particular locker.', 'opanda') ?></p>\r\n </div>\r\n </div>\r\n <?php\r\n }\r\n}", "public function onAfterRender()\n\t{\n\t\t// Get requested component, view and task\n\t\t$app = JFactory::getApplication();\n $tpl = $app->input->getInt('tp', 0);\n\t\t$option\t\t= $app->input->getCmd('option', '');\n\t\t$view\t\t= $app->input->getCmd('view', '');\n\t\t$layout\t\t= $app->input->getCmd('layout', '');\n\t\t$user\t\t= JFactory::getUser();\n\t\t// Remove scrollspy jQuery conflict\n\t\tif ($app->isAdmin() && $option == 'com_pagebuilder')\n\t\t{\n\t\t\tif ( $view == 'configuration')\n\t\t\t{\n\t\t\t\t$html = $app->getBody();\n\n\t\t\t\tif (preg_match_all(\"/\\\\$\\('\\.subhead'\\)\\.scrollspy\\(\\{[^\\r\\n]+\\}\\);/\", $html, $matches, PREG_SET_ORDER))\n\t\t\t\t{\n\t\t\t\t\t$html = preg_replace(\"/\\\\$\\('\\.subhead'\\)\\.scrollspy\\(\\{[^\\r\\n]+\\}\\);/\", '', $html);\n\t\t\t\t\t$app->setBody($html);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n if ($app->isAdmin() || $tpl) return;\n\t\t\n\t\t$doc \t\t\t= JFactory::getDocument();\t\n\t\tif (get_class($doc) != \"JDocumentHTML\") return;\t\t\n\n\t\tif ($app->isSite() && $option == 'com_content' && $view == 'form' && $layout == 'edit' && $user->get('id') > 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Check if JoomlaShine extension framework is enabled?\n\t\t$framework = JTable::getInstance('Extension');\n\t\t$framework->load(\n\t\t\tarray(\n\t\t\t\t'element'\t=> 'jsnframework',\n\t\t\t\t'type'\t\t=> 'plugin',\n\t\t\t\t'folder'\t=> 'system'\n\t\t\t)\n\t\t);\n\t\t\n\t\t// Do nothing if JSN Extension framework not found.\n\t\tif ( !$framework->extension_id ) return;\n\t\t\n\t\t// Require base shorcode element\t\t\n\t\trequire_once JSNPB_ADMIN_ROOT . '/libraries/innotheme/shortcode/element.php';\n\t\trequire_once JSNPB_ADMIN_ROOT . '/libraries/innotheme/shortcode/parent.php';\n\t\trequire_once JSNPB_ADMIN_ROOT . '/libraries/innotheme/shortcode/child.php';\n\t\t\n\t\t\n\t\tglobal $JSNPbElements;\n\t\t$JSNPbElements\t\t= new JSNPagebuilderHelpersElements();\n\t\t\n\t\t// Get PageBuilder configuration.\n\t\t$params \t\t\t= JSNConfigHelper::get('com_pagebuilder');\n\t\t// Check if it's enabled or not.\n\t\t$isEnabled\t\t\t= $params->get('enable_pagebuilder', 1);\n\t\t\n\t\t// Do nothing if PageBuilder not enabled;\n\t\tif ( !$isEnabled ) {} ;\n\t\t\t\t\t\n\t\t$data\t= $doc->getHeadData();\t\t\n\t\t\n\t\tJHtml::_('jquery.framework');\n\t\t$doc->addScript( JSNPB_PLG_SYSTEM_ASSETS_URL . 'js/joomlashine.noconflict.js', 'text/javascript');\n\t\t$doc->addScript( JSNPB_PLG_SYSTEM_ASSETS_URL . '3rd-party/bootstrap3/js/bootstrap.min.js', 'text/javascript' );\n\t\t\n\t\t$doc->addStyleSheet( JSNPB_PLG_SYSTEM_ASSETS_URL . '3rd-party/bootstrap3/css/bootstrap.min.css', 'text/css' );\n $doc->addStyleSheet( JSNPB_PLG_SYSTEM_ASSETS_URL . 'css/pagebuilder.css', 'text/css' );\n\t\t$doc->addStyleSheet( JSNPB_PLG_SYSTEM_ASSETS_URL . 'css/jsn-gui-frontend.css', 'text/css' );\n\t\t$doc->addStyleSheet( JSNPB_PLG_SYSTEM_ASSETS_URL . 'css/front_end.css', 'text/css' );\n\t\t$doc->addStyleSheet( JSNPB_PLG_SYSTEM_ASSETS_URL . 'css/front_end_responsive.css', 'text/css' );\n\t\t\n\t\t// Store the assets before transforming.\n\t\t$inlineScriptBefore\t= isset($data['script']['text/javascript']) ? $data['script']['text/javascript'] : '';\n\t\t$inlineStyleBefore\t= isset($data['style']['text/css']) ? $data['style']['text/css'] : '';\n\t\t$scriptsBefore\t= $data['scripts'];\n\t\t$styleSheetsBefore\t= $data['styleSheets'];\n\t\t\n\t\t$scriptCount\t\t= count($scriptsBefore);\n\t\t$styleSheetCount\t= count($styleSheetsBefore);\n\t\n\t\t// Analyze page content and use PageBuilder to\n\t\t// transform code if Pb structure found.\n\t\n\t\t// Get the responsed body\n\t\t$content\t= JResponse::getBody();\n\t\t// preg_replace falsely process $ symobols as commands in text copy.\n\t\t$content = str_replace('$', '&dollar;', $content);\n\t\n\t\t$body_content = '';\n\t\tpreg_match(\"/<body.*\\/body>/si\", $content, $body_content);\n\t\t\n\t\tif (!isset($body_content[0])) return;\n\t\t\n\t\t$body_content = $body_content[0];\n\t\t\n\t\t$helper\t\t\t\t= new JSNPagebuilderHelpersBuilder();\n\t\t// Transform the content inside body tag only\n\t\t$body_content\t=\t$helper->generateShortCode($body_content, false, 'frontend');\n\t\t// Apply the body content into page content\n\t\t$content = preg_replace(\"/(<body.*\\/body>)/si\", $body_content, $content);\n\t\t \n\t\t/*\n\t\t * Arrange the assets loaded from PageBuilder\n\t\t * Because onAfterRender not accept add assets by JFactory::getDocument()\n\t\t * so we need under code to modify document's header \n\t\t */\n\t\t$data\t= $doc->getHeadData();\n\t\t\n\t\t$inlineScriptAfter\t= isset($data['script']['text/javascript']) ? $data['script']['text/javascript'] : '';\n\t\t$inlineStyleAfter\t= isset($data['style']['text/css']) ? $data['style']['text/css'] : '';\n\t\t$scriptsAfter\t\t= $data['scripts'];\n\t\t$styleSheetsAfter\t= $data['styleSheets'];\n\t\t\n\t\t// Separate assets of page builder.\n\t\t$pbInlineScript\t\t= str_replace($inlineScriptBefore, '', $inlineScriptAfter);\n\t\t$pbInlineStyle\t\t= str_replace($inlineStyleBefore, '', $inlineStyleAfter);\n\t\t$pbScripts\t\t\t= array_splice($scriptsAfter, $scriptCount);\n\t\t$pbStyleSheets\t\t= array_splice($styleSheetsAfter, $styleSheetCount);\n\t\n\t\t// Append PageBuilder's assets\n\t\t// Only support css file with type is \"text/css\"\n\t\t// and js type with type is \"text/javascript\"\n\t\t// in this period.\n\t\t$pbAssets\t\t= array();\n\t\tif (count($pbStyleSheets)) {\n\t\t\tforeach ($pbStyleSheets as $css=>$v){\n\t\t\t\t$pbAssets[]\t= '<link rel=\"stylesheet\" href=\"' . $css . '\" type=\"text/css\" />';\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (count($pbScripts)) {\n\t\t\tforeach ($pbScripts as $js=>$v) {\n\t\t\t\t$pbAssets[]\t= '<script src=\"' . $js . '\" type=\"text/javascript\"></script>';\n\t\t\t}\n\t\t}\n\t\t$pbAssets[]\t\t= '<script type=\"text/javascript\">' . $pbInlineScript . '</script>';\n\t\t$pbAssets[]\t\t= '<style>' . $pbInlineStyle . '</style>';\n\t\t\n\t\t$pbAssets\t\t= implode(\"\\n\", $pbAssets);\n\t\t\n\t\t// Append assets to content\n\t\t$content\t\t= str_replace(\"</head>\", $pbAssets . \"\\n</head>\", $content);\n\t\t// preg_replace falsely process $ symobols as commands in text copy.\n\t\t$content = str_replace('&dollar;', '$', $content);\n\t\tJResponse::setBody($content);\n\t}", "public function templateComment()\n {\n // just showing how powerful can commenting be with extension\n }", "function moderateTemplates() {\n\tglobal $communityPaths,$communitySettings;\n\n\t$templates = readJsonFile($communityPaths['community-templates-info']);\n\n\tif ( ! $templates ) return;\n\tforeach ($templates as $template) {\n\t\t$template['Compatible'] = versionCheck($template);\n\t\tif ( $template[\"DeprecatedMaxVer\"] && version_compare($communitySettings['unRaidVersion'],$template[\"DeprecatedMaxVer\"],\">\") )\n\t\t\t$template['Deprecated'] = true;\n\n\t\t$template['ModeratorComment'] = $template['CaComment'] ?: $template['ModeratorComment'];\n\t\t$o[] = $template;\n\t}\n\twriteJsonFile($communityPaths['community-templates-info'],$o);\n\tpluginDupe($o);\n}", "function defaultTemplate() {\n\t\t$l = $this->api->locate('addons',__NAMESPACE__,'location');\n\t\t$addon_location = $this->api->locate('addons',__NAMESPACE__);\n\t\t$this->api->pathfinder->addLocation($addon_location,array(\n\t\t\t//'js'=>'templates/js',\n\t\t\t//'css'=>'templates/css',\n //'template'=>'templates',\n\t\t))->setParent($l);\n\n //return array('view/lister/tags');\n return parent::defaultTemplate();\n }", "function register_block_core_comment_edit_link()\n {\n }", "public function configure(): void\n {\n $this->setDecorator(false);\n $this->setTemplate($this->actionName.$this->getExtension());\n if ('global' == $this->moduleName)\n {\n $this->setDirectory($this->context->getConfiguration()->getDecoratorDir($this->getTemplate()));\n }\n else\n {\n $this->setDirectory($this->context->getConfiguration()->getTemplateDir($this->moduleName, $this->getTemplate()));\n }\n }", "protected function _prepareLayout()\n {\n parent::_prepareLayout();\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n }", "protected function _prepareLayout()\n {\n parent::_prepareLayout();\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n }", "function lastcomments_block() {\r\n\r\n\tglobal $template;\r\n\t// Action if sidepanel is enabled\r\n\tif (pluginGetVariable('lastcomments', 'sidepanel')) {\r\n\t\t$template['vars']['plugin_lastcomments'] = lastcomments();\r\n\t} else {\r\n\t\t$template['vars']['plugin_lastcomments'] = \"\";\r\n\t}\r\n}", "function createOld() {\n\t $my\t= JFactory::getUser();\n\n\t $Itemid = $GLOBALS[JNEWS.'itemidAca'];\n\t if(!empty($Itemid)){\n\t\t $item = '&Itemid=' . $Itemid ;\n\t }else{\n\t\t $item = '';\n\t }\n\n\t $this->_addCSS();\n\n\t $hidden = '';\n\t $htmlOK = false;\n\t $HTML = '';\n\t $formname = 'modjnewsForm'.$this->num;\n\t //check if subscription listing is not empty\n\t //if not empty print the module\n\t //else just print the message\n\t \t$HTML .= '<div id=\"jnews_module'.$this->num.'\">';\n\t\t\t\t\t\tswitch( $this->effect ) {\n\t\t\t\t\t\t case 'default':\n\t\t\t\t\t\t $HTML .= '';\n\t\t\t\t\t\t break;\n\t\t\t\t\t\t case 'mootools-slide':\n\t\t\t\t\t\t\t\t$HTML .= $this->_addMootoolsSlide();\n\t\t\t\t\t\t break;\n\t\t\t\t\t\t case 'mootools-modal':\n\t\t\t \t \t$HTML .= $this->_addMootoolsModal();\n\t\t\t\t\t\t break;\n\t\t\t\t\t\t default:\n\t\t\t\t\t\t $HTML .= '';\n\t\t\t\t\t\t}\n\n\t\tif (!empty($this->lists)) {\n\t\t \t$subscriber = '';\n\t\t if ($my->id >0) {\t//login\n\t\t\t $loggedin = true;\n\t\t\t $subscriber = $this->_getSubscriberInfo($my->id);\n\t\t\t if(empty($subscriber)) $loggedin = false;\n\t\t } else {\t//logout\n\t\t\t $loggedin = false;\n\t\t }\n\n\t\t if (!$loggedin && $GLOBALS[JNEWS.'allow_unregistered']) {\n\t\t\t $HTML .= $this->_printscript();\n\t\t }\n\n\t\t if ( !$GLOBALS[JNEWS.'disabletooltip'] ) {\n\t\t\t\tif( version_compare( JVERSION,'3.0.0','<' ) ) {\n\t\t\t\t\tJHTML::_('behavior.tooltip');\n\t\t\t\t} else {\n\t\t\t\t\tJHtml::_('behavior.tooltip');\n\t\t\t\t}\n\t\t }\n\n\t\t $linkForm = 'option='.JNEWS_OPTION;\n\t\t\t$linkForm = jNews_Tools::completeLink( $linkForm, false, false );\n\n\t\t $HTML .= '<form action=\"'.$linkForm.'\" method=\"post\" name=\"modjnewsForm'.$this->num.'\">';\n\n\t\t //pretext\n\t\t if (!empty($this->introtext)) {\n\t\t\t $text = '<span class=\"pretext\">'. $this->introtext .'</span>';\n\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t }\n\n\t\t //subscription list///889\n\t\t $HTML .= $this->_showSubcriptionListOld($subscriber, $loggedin, $item);\n\n\t\t if ( !$loggedin ) {\n\t\t\t if ($GLOBALS[JNEWS.'allow_unregistered']) {\n\t\t\t \t$HTML .= $this->showInputFields();\n\t\t\t } else {\t//required registered\n\t\t\t\t $HTML .= $this->NeedToRegister();\n\t\t\t \t$htmlOK = false;\n\t\t\t }\n\n\t\t\t $HTML .= $this->showReceiveHTML($subscriber);\n\n\t\t\t $HTML .= $this->showTerms($subscriber);\n\n\t\t\t //for captcha\n\t\t\t if($GLOBALS[JNEWS.'level'] > 1){//check the version is plus or pro\n\t\t\t\t if(empty($esc) && $this->enable_captcha){//check if $esc has been initialized\n\t\t\t\t\t $code = jNews_Captcha::generateCode('5');\n\t\t\t\t\t $HTML .= $this->_showCaptcha($code);\n\t\t\t\t\t $hidden .= $this->_showCaptchaHidden($code);\n\t\t\t\t }\n\t\t\t }\n\n\t\t\t $HTML .= $this->_showButton(false);\n\n\t\t } else {\t//login\n\t\t\t\t\t$HTML .= $this->forLoggedIn($Itemid);\n\t\t }\n\n\t\t if (!empty($this->posttext)) {\n\t\t\t $text = '<span class=\"postext\">'. $this->posttext .'</span>';\n\t\t\t $HTML .= jnews::printLine($this->linear, $text);\n\t\t }\n\n\t\t\t\tif( version_compare( JVERSION,'3.0.0','<' ) ) {\n\t\t\t\t\t$HTML .= JHTML::_( 'form.token' );\n\t\t\t\t} else {\n\t\t\t\t\t$HTML .= JHtml::_( 'form.token' );\n\t\t\t\t}\n\n\t\t $HTML .= $hidden . '</form>';\n\t } else {\t// no listing\n\t\t $HTML .= '<p class=\"jnews-nolist\">'. _JNEWS_LIST_NOT_AVAIL .'</p>';\n\t }\n\n\t if($this->effect != 'mootools-slide'){\n\t\t \t$HTML .= '<div style=\"display:none; width:50px;\" id=\"message'.$this->num.'\"></div>';\n\t\t \t$HTML .= '<div style=\"display:none; width:50px; padding-top:5px; height:100%\" id=\"ajax_loading'.$this->num.'\"><!--<img alt=\"loader\" src=\"'.JURI::base().'components/'.JNEWS_OPTION.'/images/16/ajax-loader.gif\"/>'._JNEWS_PLEASE_WAIT.'--></div>';\n\t }\n\n\t $HTML .= '';\n\n\t switch ($this->effect) {\n\t\t\t\t\tcase 'mootools-slide':\n\t\t\t\t\t\t$HTML .= '</div></div>';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'mootools-modal':\n\t\t\t\t\t\t$HTML .= '</div></div></div>';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'default':\n\t\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t }\n\n\t\t$HTML .= '</div>';\n\t\t$HTML .= '<div style=\"display:none\" ><a href=\"http://www.joobi.co\">Joomla Extensions</a> powered by Joobi</div>';\n\t return $HTML;\n\n\t}", "function _page_welcome_block() {\n global $user;\n \n return array(array(\n 'id' => 'welcome',\n 'title' => 'Welcome',\n 'content' => 'You are logged in as <strong>' . htmlspecialchars($user['uid'], ENT_QUOTES, 'UTF-8') . '</strong> (<strong>' . htmlspecialchars($user['identity'], ENT_QUOTES, 'UTF-8') . '</strong>).'\n ));\n}", "function shop_preprocess_maintenance_page(&$vars) {\n // While markup for normal pages is split into page.tpl.php and html.tpl.php,\n // the markup for the maintenance page is all in the single\n // maintenance-page.tpl.php template. So, to have what's done in\n // shop_preprocess_html() also happen on the maintenance page, it has to be\n // called here.\n shop_preprocess_html($vars);\n}", "function setupTemplate() {\r\n\t\tparent::setupTemplate();\r\n\t\tLocale::requireComponents(array(LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_OJS_EDITOR, LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_OJS_AUTHOR, LOCALE_COMPONENT_OJS_MANAGER));\r\n\t\t$templateMgr =& TemplateManager::getManager();\r\n\t\t$isEditor = Validation::isEditor();\r\n\t\t\r\n\t\tif (Request::getRequestedPage() == 'editor') {\r\n\t\t\t$templateMgr->assign('helpTopicId', 'editorial.editorsRole');\r\n\t\t\r\n\t\t} else {\r\n\t\t\t$templateMgr->assign('helpTopicId', 'editorial.sectionEditorsRole');\r\n\t\t}\r\n\t\t\r\n\t\t$roleSymbolic = $isEditor ? 'editor' : 'sectionEditor';\r\n\t\t$roleKey = $isEditor ? 'user.role.coordinator' : 'user.role.sectionEditor';\r\n\t\t$pageHierarchy = array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, 'user'), $roleKey), array(Request::url(null, $roleSymbolic, 'submissionsReport'), 'editor.reports.reportGenerator'));\r\n\t\t\r\n\t\t$templateMgr->assign('pageHierarchy', $pageHierarchy);\r\n\t}", "protected function content_template() {\n\t}", "function ctools_default_block_info($module, $delta, &$info) {\n $core_modules = array('aggregator', 'block', 'blog', 'blogapi', 'book', 'color', 'comment', 'contact', 'drupal', 'filter', 'forum', 'help', 'legacy', 'locale', 'menu', 'node', 'path', 'ping', 'poll', 'profile', 'search', 'statistics', 'taxonomy', 'throttle', 'tracker', 'upload', 'user', 'watchdog', 'system');\n\n if (in_array($module, $core_modules)) {\n $info['icon'] = 'icon_core_block.png';\n $info['category'] = t('Miscellaneous');\n }\n else {\n $info['icon'] = 'icon_contrib_block.png';\n $info['category'] = t('Miscellaneous');\n }\n}", "protected function moduleContent() {\r\n switch ((string) $this->MOD_SETTINGS['function']) {\r\n case 1:\r\n // Get default project name\r\n $path = PATH_site . 'fileadmin/templates/';\r\n $dirs = scandir($path);\r\n\r\n // Filter directories\r\n foreach ($dirs as $dir) {\r\n if ($dir != '.' && $dir != '..' && $dir != 'default' && $dir != 'ts')\r\n $projectDir = $dir;\r\n }\r\n\r\n // Form submitted\r\n if ($_POST['submit_config']) { \r\n \t// No basedomain given\r\n \tif(!$_POST['project_basedomainde']) {\r\n \t\t$errorMessageContent = '<h3>'.$GLOBALS['LANG']->getLL('noBasedomain').'</h3>';\r\n \t\t$errorMessageContent .= '<p>'.$GLOBALS['LANG']->getLL('noBasedomainText').'</p>';\r\n\t $content = '<div class=\"alert alert-error\">'.$errorMessageContent.'</div>';\r\n\t $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('title'), $content, 0, 1);\t \t\t\r\n \t} \r\n \telse if(!$_POST['project_email']) {\r\n \t\t$errorMessageContent = '<h3>'.$GLOBALS['LANG']->getLL('noEmail').'</h3>';\r\n \t\t$errorMessageContent .= '<p>'.$GLOBALS['LANG']->getLL('noEmailText').'</p>';\r\n\t $content = '<div class=\"alert alert-error\">'.$errorMessageContent.'</div>';\r\n\t $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('title'), $content, 0, 1);\t \t\r\n \t}\r\n \telse if(!$this->checkEmail($_POST['project_email'])) {\r\n \t\t$errorMessageContent = '<h3>'.$GLOBALS['LANG']->getLL('noValidEmail').'</h3>';\r\n \t\t$errorMessageContent .= '<p>'.$GLOBALS['LANG']->getLL('noValidEmailText').'</p>';\r\n\t $content = '<div class=\"alert alert-error\">'.$errorMessageContent.'</div>';\r\n\t $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('title'), $content, 0, 1);\t \t\r\n \t}\r\n \telse if(!$_POST['project_httphost']) {\r\n \t\t$errorMessageContent = '<h3>'.$GLOBALS['LANG']->getLL('noHttpHost').'</h3>';\r\n \t\t$errorMessageContent .= '<p>'.$GLOBALS['LANG']->getLL('noHttpHostText').'</p>';\r\n\t $content = '<div class=\"alert alert-error\">'.$errorMessageContent.'</div>';\r\n\t $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('title'), $content, 0, 1);\t \t\r\n \t}\r\n \telse { \t \t \t\r\n\t // Get project name\r\n\t $projectName = trim(strtolower($_POST['project_name']));\r\n\t \r\n\t // Check if uppercase\r\n\t if(ctype_upper($_POST['project_name'])) {\r\n\t\t \t$projectNameUpper = $_POST['project_name']; \r\n\t\t \t$projectDirUpper = strtoupper($projectDir); \r\n\t }\r\n\t else {\r\n\t\t $projectNameUpper = $projectName;\r\n\t\t $projectDirUpper = $projectDir; \r\n\t }\r\n\t \t\r\n\t // Rename dir\r\n\t rename($path . $projectDir, $path . $projectName);\r\n\t\r\n\t /* Change files BEGIN */\r\n\t \r\n\t // Files to change\r\n\t $files = array(\r\n\t PATH_site . 'fileadmin/templates/ts/setup/JavaScriptIncludes_setup.ts',\r\n\t PATH_site . 'fileadmin/templates/ts/TSConfig/Page.ts',\r\n\t PATH_site . 'typo3conf/new_localconf.php'\r\n\t );\r\n\t\r\n\t // Parse files\r\n\t foreach ($files as $f) {\r\n\t // Open file\r\n\t $data = file_get_contents($f);\r\n\t\r\n\t // Change data\r\n\t $data = str_replace($projectDir, $projectName, $data);\r\n\t\r\n\t // Write file\r\n\t file_put_contents($f, $data);\r\n\t }\r\n\t \r\n\t /* Change files END */\r\n\t \r\n\t /* Change files with uppercase BEGIN */\r\n\t \r\n\t // Files to change\r\n\t $files2 = array(\r\n\t PATH_site . 'fileadmin/templates/ts/setup/lib_setup.ts',\r\n\t PATH_site . 'fileadmin/templates/ts/constants/StandardConfig_constants.ts',\r\n\t PATH_site . 'fileadmin/templates/ts/setup/lib_setup.ts',\r\n\t );\r\n\t \r\n\t // Parse files\r\n\t foreach ($files2 as $f2) {\r\n\t // Open file\r\n\t $data2 = file_get_contents($f2);\r\n\t\r\n\t // Change data\r\n\t $data2 = str_replace(ucfirst($projectDir), ucfirst($projectNameUpper), $data2);\r\n\t\r\n\t // Write file\r\n\t file_put_contents($f2, $data2);\r\n\t } \r\n\t \r\n\t /* Change files with uppercase END */\r\n\t \r\n\t /* Copyright notice BEGIN */\r\n\t \r\n\t $copyrightNotice = $_POST['project_copyright'];\r\n\t if(!$copyrightNotice) $copyrightNotice = $GLOBALS['LANG']->getLL('copyrightDefault');\r\n\t \r\n\t $files3 = array(\r\n\t \tPATH_site . 'fileadmin/templates/ts/setup/StandardConfig_setup.ts',\r\n\t );\r\n\t \r\n\t foreach($files3 as $f3) {\r\n\t\t // Open file\r\n\t\t $data3 = file_get_contents($f3);\r\n\t\t \r\n\t\t // Change data\r\n\t\t $data3 = str_replace(\"headerComment =\",\"headerComment = \".$copyrightNotice,$data3);\r\n\t\t \r\n\t\t // Write file\r\n\t\t file_put_contents($f3, $data3);\r\n\t }\r\n\t \r\n\t /* Copyright notice END */\r\n\t \r\n\t /* Basedomain BEGIN */\r\n\t \r\n\t $files4 = array(\r\n\t \tPATH_site . 'fileadmin/templates/ts/constants/StandardConfig_constants.ts',\r\n\t );\r\n\t \r\n\t foreach($files4 as $f4) {\r\n\t \t$basedomainDE = trim($_POST['project_basedomainde'],'/').'/';\r\n\t \t$basedomainEN = trim($_POST['project_basedomainen'],'/').'/';\r\n\t \t$httpHost = trim($_POST['project_httphost'],'/');\r\n\t \t\r\n\t \t$basedomainDEPreview = trim($_POST['preview_basedomainde'],'/').'/';\r\n\t \t$basedomainENPreview = trim($_POST['preview_basedomainen'],'/').'/';\r\n\t \t$httpHostPreview = trim($_POST['preview_httphost'],'/');\r\n\t \t\r\n\t \t$basedomainDELive = trim($_POST['live_basedomainde'],'/').'/';\r\n\t \t$basedomainENLive = trim($_POST['live_basedomainen'],'/').'/';\r\n\t \t$httpHostLive = trim($_POST['live_httphost'],'/');\t \t\t \t\r\n\t \r\n\t\t // Open file\r\n\t\t $data4 = file_get_contents($f4);\r\n\t\t \r\n// Add data\r\n$data4 = \"\".$data4.\"\r\n\r\n# # medbootstraptools [BEGIN]\r\n\r\n[globalVar = IENV:HTTP_HOST = \".$httpHost.\"]\r\n\r\nt3bootstrap {\r\n\\tbasedomain.de = \".$basedomainDE.\"\r\n\\tbasedomain.en = \".$basedomainEN.\"\r\n}\r\n\r\n[globalVar = IENV:HTTP_HOST = \".$httpHostPreview.\"]\r\n\r\nt3bootstrap {\r\n\\tbasedomain.de = \".$basedomainDEPreview.\"\r\n\\tbasedomain.en = \".$basedomainENPreview.\"\r\n}\r\n\r\n[globalVar = IENV:HTTP_HOST = \".$httpHostLive.\"]\r\n\r\nt3bootstrap {\r\n\\tbasedomain.de = \".$basedomainDELive.\"\r\n\\tbasedomain.en = \".$basedomainENLive.\"\r\n}\r\n\r\n[global]\r\n\r\n# # medbootstraptools [END]\";\r\n\t\t \r\n\t\t // Write file\r\n\t\t file_put_contents($f4, $data4);\r\n\t }\r\n\t \r\n\t /* Basedomain END */\r\n\t \r\n\t /* Robots BEGIN */\r\n\t \r\n\t // Get file\r\n\t $robotsFile = PATH_site . 'fileadmin/templates/ts/setup/StandardConfig_setup.ts';\r\n\t \r\n\t // Open file\r\n\t $robotsFileContent = file_get_contents($robotsFile);\r\n\t \r\n// Add data\r\n$robotsFileContent = \"\".$robotsFileContent.\"\r\n\r\n# # medbootstraptools [BEGIN]\r\n\r\n[globalVar = IENV:HTTP_HOST = \".$httpHost.\"]\r\n\r\npage.meta.robots = noindex, nofollow\r\n\r\n[globalVar = IENV:HTTP_HOST = \".$httpHostPreview.\"]\r\n\r\npage.meta.robots = noindex, nofollow\r\n\r\n[globalVar = IENV:HTTP_HOST = \".$httpHostLive.\"]\r\n\r\npage.meta.robots = index, follow\r\n\r\n[global]\r\n\r\n# # medbootstraptools [END]\";\r\n\r\n\t\t\t\t\t\t// Write file\r\n\t\t\t\t\t\tfile_put_contents($robotsFile, $robotsFileContent);\r\n\t \r\n\t /* Robots END */\r\n\t \r\n\t /* Responsive or not BEGIN */\r\n\t \r\n\t if ($_POST['project_responsive'] != \"on\") {\r\n\t $resp = PATH_site . 'fileadmin/templates/ts/setup/CSSIncludes_setup.ts';\r\n\t \r\n\t $dataResp = file_get_contents($resp);\r\n\t $dataResp = str_replace(\"bootstrap-responsive\",\"no-responsive\",$dataResp);\r\n\t \r\n\t file_put_contents($resp, $dataResp);\r\n\t \r\n\t // Rename t3bootstrap responsive\r\n\t $t3bootstrapResp = PATH_site . 'fileadmin/templates/default/less/t3bootstrap-responsive.less';\r\n\t rename($t3bootstrapResp,$t3bootstrapResp.'_doNotUse');\r\n\t \r\n\t\t // File\r\n\t\t $lessConfigFile = PATH_site . 'fileadmin/templates/ts/setup/Extensions_setup.ts';\r\n\t\t \r\n\t\t // Get content\r\n\t\t $lessConfigFileContent = file_get_contents($lessConfigFile);\r\n\t\t \r\n\t\t // Remove LESS config for responsive CSS file\r\n\t\t $lessConfigFileContent = preg_replace('/t3bootstrap-responsive {[^{}]*}/', '', $lessConfigFileContent);\t\r\n\t\t \r\n\t\t // Write file\r\n\t\t file_put_contents($lessConfigFile, $lessConfigFileContent); \r\n\t }\r\n\t \r\n\t /* Responsive or not END */\r\n\t\r\n\t /* Install Tool password BEGIN */\r\n\t\r\n\t $localconfFile = PATH_site . 'typo3conf/new_localconf.php';\r\n\t $localconfData = file_get_contents($localconfFile);\r\n\t\r\n\t $newInstallPassword = $this->generatePW();\r\n\t\r\n\t $localConfContent = \"// Updated by medbootstraptools \" . date(\"d.m.y\", time()) . \" \" . date(\"H:i:s\", time()) . \"\\n\\$TYPO3_CONF_VARS['BE']['installToolPassword'] = '\" . md5($newInstallPassword) . \"';\";\r\n\t\r\n\t $localconfData = str_replace(\"?>\", \"\\n\" . $localConfContent . \"\\n?>\", $localconfData);\r\n\t file_put_contents($localconfFile, $localconfData);\r\n\t\r\n\t /* Install Tool password END */\r\n\t \r\n\t /* Update site name BEGIN */\r\n\t \r\n\t // Get localconf\r\n\t $data = file_get_contents($localconfFile);\r\n\t \r\n\t $data = str_replace(\"\\$TYPO3_CONF_VARS['SYS']['sitename'] = '\".ucfirst($projectDir).\"';\", \"\\$TYPO3_CONF_VARS['SYS']['sitename'] = '\".ucfirst($projectNameUpper).\"';\", $data);\r\n\t\r\n\t // Write file\r\n\t file_put_contents($localconfFile, $data); \r\n\t \r\n\t /* Update site name END */\t \r\n\t \r\n\t /* Settings LIVE/PREVIEW server BEGIN */\r\n\t \r\n\t // Get file\r\n\t $settingsFile = PATH_typo3conf . 'settings.php';\r\n\t \r\n\t // Get settings\r\n\t $server = $_POST['live_server'];\r\n\t $host = $_POST['live_host'];\r\n\t $username = $_POST['live_username'];\r\n\t $dbPassword = $_POST['live_password'];\r\n\t $database = $_POST['live_database'];\r\n\t $imPath = $_POST['live_impath'];\r\n\t \r\n\t $previewServer = $_POST['preview_server'];\r\n\t $previewHost = $_POST['preview_host'];\r\n\t $previewUsername = $_POST['preview_username'];\r\n\t $previewDbPassword = $_POST['preview_password'];\r\n\t $previewDatabase = $_POST['preview_database'];\t \r\n\t $previewImPath = $_POST['preview_impath']; \r\n\t \r\n\t // Get content\r\n\t if(!$server && !$host && !$username && !$dbPassword && !$database && !$previewServer && !$previewHost && !$previewUsername && !$previewDbPassword && !$previewDatabase && !$imPath && !$previewImPath) {\r\n$settingsContent = \"<?php\r\n\\$TYPO3_CONF_VARS['GFX']['im_path_lzw'] = '/usr/local/bin/';\r\n\\$TYPO3_CONF_VARS['GFX']['im_path'] = '/usr/local/bin/';\r\n?>\";\r\n\t }\r\n\t else {\r\n$settingsContent = \"<?php\r\n\\tif(\\$_SERVER['SERVER_NAME'] == '\".$server.\"') {\r\n\\t\\t\\$typo_db_username = '\".$username.\"';\r\n\\t\\t\\$typo_db_password = '\".$dbPassword.\"';\r\n\\t\\t\\$typo_db_host = '\".$host.\"';\r\n\\t\\t\\$typo_db = '\".$database.\"';\r\n\\t\\t\\$TYPO3_CONF_VARS['GFX']['im_path_lzw'] = '\".$imPath.\"';\r\n\\t\\t\\$TYPO3_CONF_VARS['GFX']['im_path'] = '\".$imPath.\"';\r\n\\t}\r\n\\telse if(\\$_SERVER['SERVER_NAME'] == '\".$previewServer.\"') {\r\n\\t\\t\\$typo_db_username = '\".$previewUsername.\"';\r\n\\t\\t\\$typo_db_password = '\".$previewDbPassword.\"';\r\n\\t\\t\\$typo_db_host = '\".$previewHost.\"';\r\n\\t\\t\\$typo_db = '\".$previewDatabase.\"';\r\n\\t\\t\\$TYPO3_CONF_VARS['GFX']['im_path_lzw'] = '\".$previewImPath.\"';\r\n\\t\\t\\$TYPO3_CONF_VARS['GFX']['im_path'] = '\".$previewImPath.\"';\r\n\\t}\r\n?>\";\r\n\t }\r\n\t \r\n\t file_put_contents($settingsFile, $settingsContent);\t \r\n\t \r\n\t /* Settings LIVE/PREVIEW server END */ \r\n\t \r\n\t /* Import database BEGIN */\r\n\t \r\n\t /**\r\n\t * @todo Replace @mysql_connect, as TYPO3 Backend is already connected; change import script class\r\n\t */\r\n\t \t\r\n\t \t// Connect to database\r\n\t \t$connection = @mysql_connect(TYPO3_db_host,TYPO3_db_username,TYPO3_db_password);\r\n\t \t\t \t\r\n\t \t// Get SQL file\r\n\t \t$filename = PATH_typo3conf.'ext/medbootstraptools/mod1/sql/t3bootstrap.sql';\r\n\t \t$compress = false;\r\n\t \t\r\n\t\t\t\t\t\t$dump = new phpMyImporter(TYPO3_db,$connection,$filename,$compress);\r\n\t\t\t\t\t\t$dump->utf8 = true; // Uses UTF8 connection with MySQL server, default: true \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$dump->doImport();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/* Clear sys_log and be_sessions table after import [BEGIN] */\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tmysql_query(\"TRUNCATE TABLE sys_log\"); \r\n\t\t\t\t\t\t//mysql_query(\"TRUNCATE TABLE be_sessions\"); \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/* Clear sys_log and be_sessions table after import [END] */\r\n\t\t\t\t\t\t\r\n\t /* Import database END */\r\n\t \r\n\t /* Update contact form BEGIN */\r\n\t \r\n\t $email = $_POST['project_email'];\t \r\n\t \r\n\t $GLOBALS['TYPO3_DB']->sql_query(\"UPDATE tt_content SET pi_flexform = REPLACE(pi_flexform, '[email protected]', '\".$email.\"') WHERE uid=103\");\t \r\n\t $GLOBALS['TYPO3_DB']->sql_query(\"UPDATE tt_content SET pi_flexform = REPLACE(pi_flexform, '\".ucfirst($projectDirUpper).\"', '\".ucfirst($projectNameUpper).\"') WHERE uid=103\");\t \r\n\t \r\n\t /* Update contact form END */\t \r\n\t \r\n\t /* Templavoilà BEGIN */\r\n\t\r\n\t $GLOBALS['TYPO3_DB']->sql_query(\"UPDATE tx_templavoila_datastructure SET belayout = REPLACE(belayout, '\" . $projectDir . \"', '\" . $projectName . \"') WHERE uid=1\");\r\n\t $GLOBALS['TYPO3_DB']->sql_query(\"UPDATE tx_templavoila_tmplobj SET fileref = REPLACE(fileref, '\" . $projectDir . \"', '\" . $projectName . \"') WHERE uid=1\");\r\n\t $GLOBALS['TYPO3_DB']->sql_query(\"UPDATE tx_templavoila_tmplobj SET fileref_md5 = MD5(fileref) WHERE uid=1\");\r\n\t \r\n\t /* Templavoilà BEGIN */\r\n\t\r\n\t /* Update page ID 1 BEGIN */\r\n\t\r\n\t $updateArrayMod = array(\r\n\t 'tx_medbootstraptools_bootstrapconfig' => 1,\r\n\t 'title' => ucfirst($projectNameUpper)\r\n\t );\r\n\t\r\n\t $resMod = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('pages', 'uid=1', $updateArrayMod);\r\n\t\r\n\t /* Update page ID 1 END */\r\n\t \r\n\t /* Update user group ID 2 BEGIN */\r\n\t \r\n\t $updateArrayUser = array(\r\n\t 'title' => ucfirst($projectNameUpper).' '.$GLOBALS['LANG']->getLL('admin'),\r\n\t 'description' => ucfirst($projectNameUpper).' '.$GLOBALS['LANG']->getLL('adminUserGroup')\r\n\t );\r\n\t\r\n\t $resMod = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('be_groups', 'uid=2', $updateArrayUser); \r\n\t \r\n\t /* Update user group ID 2 END */ \r\n\t \r\n\t /* Update user group ID 3 BEGIN */\r\n\t \r\n\t $updateArrayUser2 = array(\r\n\t 'title' => ucfirst($projectNameUpper).' '.$GLOBALS['LANG']->getLL('editor'),\r\n\t 'description' => ucfirst($projectNameUpper).' '.$GLOBALS['LANG']->getLL('editorUserGroup')\r\n\t );\r\n\t\r\n\t $resMod2 = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('be_groups', 'uid=3', $updateArrayUser2); \r\n\t \r\n\t /* Update user group ID 3 END */\t \r\n\t \r\n\t /* Create backend users BEGIN */\r\n\t \r\n\t $beUsers = explode(\"\\n\",trim($_POST['project_beusers']));\r\n\t if($_POST['project_beusers']) {\r\n\t\t $beUsersFinal = array();\r\n\t\t foreach($beUsers as $beUser) {\r\n\t\t\t \t$beUsersFinal[] = trim($beUser); \r\n\t\t }\r\n\t\t \r\n\t\t $beUsers = $beUsersFinal;\r\n\t\t \r\n\t\t foreach($beUsers as $beUser) {\r\n\t\t \t$userData = explode(\",\",$beUser);\r\n\t\t \t\r\n\t\t \tif($userData[0] != 'admin') {\r\n\t\t\t\t\t\t\t\t\t$insertArray = array(\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t'username' => trim(str_replace('\"','',stripslashes($userData[0]))),\t\r\n\t\t\t\t\t\t\t\t\t\t'admin' => trim(str_replace('\"','',stripslashes($userData[5]))),\r\n\t\t\t\t\t\t\t\t\t\t'realName' => trim(str_replace('\"','',stripslashes($userData[1]))),\r\n\t\t\t\t\t\t\t\t\t\t'email' => trim(str_replace('\"','',stripslashes($userData[2]))),\r\n\t\t\t\t\t\t\t\t\t\t'lang' => trim(str_replace('\"','',stripslashes($userData[3]))),\r\n\t\t\t\t\t\t\t\t\t\t'tstamp' => time(),\r\n\t\t\t\t\t\t\t\t\t\t'crdate' => time(),\r\n\t\t\t\t\t\t\t\t\t\t'usergroup' => trim(str_replace('\"','',stripslashes($userData[4])))\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}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$resBeUser = $GLOBALS['TYPO3_DB']->exec_INSERTquery('be_users', $insertArray); \r\n\t\t }\r\n\t }\r\n\t \r\n\t /* Create backend users END */\r\n\t\r\n\t /* Backend user passwords BEGIN */\r\n\t\r\n\t // Create 10 passwords\r\n\t $passwordArr = array();\r\n\t for ($i = 1; $i <= 10; $i++) {\r\n\t $passwordArr[] = $this->generatePW();\r\n\t }\r\n\t\r\n\t // Get all be_users\r\n\t $resUsers = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,username', 'be_users', 'disable=0 AND deleted=0', '', '', '');\r\n\t $i = 0;\r\n\t $passwordArrWithUsername = array();\r\n\t while ($rowUsers = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resUsers)) {\r\n\t $passwordArrWithUsername[$rowUsers['username']] = $passwordArr[$i];\r\n\t\r\n\t // Create salted password\r\n\t $password = $passwordArr[$i]; // plain-text password\r\n\t $saltedPassword = '';\r\n\t if (t3lib_extMgm::isLoaded('saltedpasswords')) {\r\n\t if (tx_saltedpasswords_div::isUsageEnabled('FE')) {\r\n\t $objSalt = tx_saltedpasswords_salts_factory::getSaltingInstance(NULL);\r\n\t if (is_object($objSalt)) {\r\n\t $saltedPassword = $objSalt->getHashedPassword($password);\r\n\t }\r\n\t }\r\n\t }\r\n else {\r\n\t \t$saltedPassword = $password; \r\n }\t \r\n\t\r\n\t $updateArray = array(\r\n\t 'password' => $saltedPassword\r\n\t );\r\n\t\r\n\t $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('be_users', 'uid=' . $rowUsers['uid'], $updateArray);\r\n\t\r\n\t $i++;\r\n\t }\r\n\t\r\n\t /* Backend user passwords END */\t \r\n\t\r\n\t /* Switch localconf BEGIN */\r\n\t \r\n\t // Clear temp files\r\n\t\t\t\t\t\tforeach (glob(PATH_typo3conf . \"temp_*.php\") as $filename) {\r\n\t\t\t\t\t\t unlink($filename);\r\n\t\t\t\t\t\t}\t\t\t\t\t\t\t \r\n\t \r\n\t // Get files\r\n\t $localconfFileAct = PATH_typo3conf . 'localconf.php';\r\n\t $localconfFileOld = PATH_typo3conf . 'old_localconf.php';\r\n\t $localconfFileNew = PATH_typo3conf . 'new_localconf.php';\r\n\t \t \r\n\t \t// Include localconf to get database connection for new localconf file \r\n\t \r\n\t // Open new_localconf.php\r\n\t $localconfFileNewContent = file_get_contents($localconfFileNew);\r\n\t \r\n\t $localconfFileNewContent = str_replace(\r\n\t \tarray(\r\n\t \t\t\"\\$typo_db_username = '';\",\r\n\t \t\t\"\\$typo_db_password = '';\",\r\n\t \t\t\"\\$typo_db_host = '';\",\r\n\t \t\t\"\\$typo_db = '';\"\r\n\t \t),\r\n\t \tarray(\r\n\t \t\t\"\\$typo_db_username = '\".TYPO3_db_username.\"';\",\r\n\t \t\t\"\\$typo_db_password = '\".TYPO3_db_password.\"';\",\r\n\t \t\t\"\\$typo_db_host = '\".TYPO3_db_host.\"';\",\r\n\t \t\t\"\\$typo_db = '\".TYPO3_db.\"';\"\t \t\t\r\n\t \t),\r\n\t \t$localconfFileNewContent\r\n\t );\r\n\t \r\n\t file_put_contents($localconfFileNew, $localconfFileNewContent);\r\n\t \t \r\n\t // Rename files\r\n\t rename($localconfFileAct,$localconfFileOld);\r\n\t rename($localconfFileNew,$localconfFileAct);\r\n\t \r\n\t /* Switch localconf END */\t \t \r\n\t\r\n\t // Success message\r\n\t $successMessageContent = '<h3>'.$GLOBALS['LANG']->getLL('configSaved').'</h3>';\r\n\t $successMessageContent .= '<p><br /><b>'.$GLOBALS['LANG']->getLL('backendPasses').'</b><br />';\r\n\t $c = 0;\r\n\t foreach ($passwordArrWithUsername as $pKey => $pVal) {\r\n\t if ($c == 0) {\r\n\t $successMessageContent .= $pKey . ': ' . $pVal;\r\n\t } else {\r\n\t $successMessageContent .= '<br />' . $pKey . ': ' . $pVal;\r\n\t }\r\n\t\r\n\t $c++;\r\n\t }\r\n\t $successMessageContent .= '</p>';\r\n\t $successMessageContent .= '<p><br /><b>'.$GLOBALS['LANG']->getLL('installToolPassword').'</b><br />' . $newInstallPassword . '</p>';\r\n\t // Import SQL\r\n\t $successMessageContent .= '<p><br /><b>'.$GLOBALS['LANG']->getLL('database').'</b><br />'.$GLOBALS['LANG']->getLL('databaseSuccess').'</p>'; \r\n\t \r\n\t $content = '<div class=\"alert alert-success\">'.$successMessageContent.'</div>';\r\n\t $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('title'), $content, 0, 1);\t \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Clear typo3temp folder recursively\r\n\t\t\t\t\t\t$this->emptyDirectory(PATH_site.'typo3temp/Cache/Code');\t \r\n\t }\r\n\t } else {\r\n\t // Check if module has already been deactivated\r\n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_medbootstraptools_bootstrapconfig','pages','uid=1','','','');\r\n\t $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\r\n\t \r\n\t if($row['tx_medbootstraptools_bootstrapconfig'] == 1) {\r\n\t $content = '<p><b>'.$GLOBALS['LANG']->getLL('configAlready').'</b></p>';\r\n\t }\r\n\r\n else { \t\r\n $content = '\r\n <form method=\"post\" action=\"\">\r\n \t<div class=\"settings\">\r\n\t \t<h4>'.$GLOBALS['LANG']->getLL('generalSettings').'</h4>\r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('projectName').'</label>\r\n\t <input type=\"text\" name=\"project_name\" value=\"' . $projectDir . '\">\r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('basedomainDE').'</label>\r\n\t <input type=\"text\" placeholder=\"http://subdomain.domain.de/\" name=\"project_basedomainde\" class=\"input-middle\"> \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('basedomainEN').'</label>\r\n\t <input type=\"text\" placeholder=\"http://subdomain.domain.de/en/\" name=\"project_basedomainen\" class=\"input-middle\"> \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('httpHost').'</label>\r\n\t <input type=\"text\" name=\"project_httphost\" placeholder=\"subdomain.domain.de\">\r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('copyrightNotice').'</label>\r\n\t <input type=\"text\" class=\"input-long\" placeholder=\"'.$GLOBALS['LANG']->getLL('copyrightDefault').'\" name=\"project_copyright\"> \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('email').'</label>\r\n\t <input type=\"text\" name=\"project_email\" placeholder=\"[email protected]\">\r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('adminUser').' <i>'.$GLOBALS['LANG']->getLL('adminUserInfo').'</i>:</label>\r\n\t <textarea cols=\"5\" rows=\"10\" class=\"textarea-beusers\" name=\"project_beusers\"></textarea>\r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('responsive').'</label>\r\n\t <input type=\"checkbox\" name=\"project_responsive\" checked=\"checked\"> \r\n\t \r\n\t <h4>'.$GLOBALS['LANG']->getLL('databaseConnectionPreview').'</h4>\r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('basedomainDE').'</label>\r\n\t <input type=\"text\" placeholder=\"http://subdomain.domain.de/\" name=\"preview_basedomainde\" class=\"input-middle\"> \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('basedomainEN').'</label>\r\n\t <input type=\"text\" placeholder=\"http://subdomain.domain.de/en/\" name=\"preview_basedomainen\" class=\"input-middle\"> \t \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('httpHost').'</label>\r\n\t <input type=\"text\" name=\"preview_httphost\" placeholder=\"subdomain.domain.de\">\t \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('serverName').'</label>\r\n\t <input type=\"text\" name=\"preview_server\" placeholder=\"domain.de\"> \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('username').'</label>\r\n\t <input type=\"text\" name=\"preview_username\" autocomplete=\"off\">\r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('password').'</label>\r\n\t <input type=\"password\" name=\"preview_password\" autocomplete=\"off\"> \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('host').'</label>\r\n\t <input type=\"text\" name=\"preview_host\"> \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('database').'</label>\r\n\t <input type=\"text\" name=\"preview_database\"> \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('imageMagickPath').'</label>\r\n\t <input type=\"text\" name=\"preview_impath\" placeholder=\"/usr/local/bin/\"> \r\n\t \r\n\t <h4>'.$GLOBALS['LANG']->getLL('databaseConnection').'</h4>\r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('basedomainDE').'</label>\r\n\t <input type=\"text\" placeholder=\"http://subdomain.domain.de/\" name=\"live_basedomainde\" class=\"input-middle\"> \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('basedomainEN').'</label>\r\n\t <input type=\"text\" placeholder=\"http://subdomain.domain.de/en/\" name=\"live_basedomainen\" class=\"input-middle\"> \t \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('httpHost').'</label>\r\n\t <input type=\"text\" name=\"live_httphost\" placeholder=\"subdomain.domain.de\">\t \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('serverName').'</label>\r\n\t <input type=\"text\" name=\"live_server\" placeholder=\"domain.de\"> \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('username').'</label>\r\n\t <input type=\"text\" name=\"live_username\" autocomplete=\"off\">\r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('password').'</label>\r\n\t <input type=\"password\" name=\"live_password\" autocomplete=\"off\"> \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('host').'</label>\r\n\t <input type=\"text\" name=\"live_host\"> \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('database').'</label>\r\n\t <input type=\"text\" name=\"live_database\"> \r\n\t \r\n\t <label>'.$GLOBALS['LANG']->getLL('imageMagickPath').'</label>\r\n\t <input type=\"text\" name=\"live_impath\" placeholder=\"/usr/local/bin/\"> \r\n\t \r\n\t <input type=\"hidden\" name=\"submit_config\" value=\"1\">\r\n\t <p><a href=\"javascript:void(0);\" class=\"btn btn-primary btn-submit\">'.$GLOBALS['LANG']->getLL('save').'</a></p>\r\n </div>\r\n </form>\r\n ';\r\n }\r\n $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('title'), $content, 0, 1);\r\n }\r\n break;\r\n }\r\n }", "function main()\t{\n\t\tglobal $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t// Access check!\n\t\t// The page will show only if there is a valid page and if this page may be viewed by the user\n\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n\t\t$access = is_array($this->pageinfo) ? 1 : 0;\n\t\n\t\t\t// initialize doc\n\t\t$this->doc = t3lib_div::makeInstance('template');\n\t\t$this->doc->setModuleTemplate(t3lib_extMgm::extPath('ics_utopia') . 'mod3/mod_template.html');\n\t\t$this->doc->backPath = $BACK_PATH;\n\t\t$docHeaderButtons = $this->getButtons();\n\n\t\tif (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id))\t{\n\n\t\t\t\t// Draw the form\n\t\t\t$this->doc->form = '<form action=\"\" method=\"post\" enctype=\"multipart/form-data\">';\n\n\t\t\t\t// JavaScript\n\t\t\t$this->doc->JScode = '\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 0;\n\t\t\t\t\tfunction jumpToUrl(URL)\t{\n\t\t\t\t\t\tdocument.location = URL;\n\t\t\t\t\t}\n\t\t\t\t</script>\n\t\t\t';\n\t\t\t$this->doc->postCode='\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 1;\n\t\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = 0;\n\t\t\t\t</script>\n\t\t\t';\n\t\t\t\t// Render content:\n\t\t\t$this->moduleContent();\n\t\t} else {\n\t\t\t\t// If no access or if ID == zero\n\t\t\t$docHeaderButtons['save'] = '';\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t}\n\n\t\t\t// compile document\n\t\t$markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);\n\t\t$markers['CONTENT'] = $this->content;\n\n\t\t\t\t// Build the <body> for the module\n\t\t$this->content = $this->doc->startPage($LANG->getLL('title'));\n\t\t$this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);\n\t\t$this->content.= $this->doc->endPage();\n\t\t$this->content = $this->doc->insertStylesAndJS($this->content);\n\t\n\t}", "public function load_template_methods()\n\t{\n\t\tif (!$this->modtemplates)\n\t\t{\n\t\t\trequire_once(cms_join_path(dirname(__FILE__), 'module_support', 'modtemplates.inc.php'));\n\t\t\t$this->modtemplates = true;\n\t\t}\n\t}", "protected function content_template()\n\t{\n\t\t//\n\t}", "public function render_available_modules_template() {\n\n global $canvys;\n\n // The specific drop target of the shortcodes to show\n for ( $i=0; $i<3; $i++ ) : ?>\n\n <script type=\"text/html\" id=\"tmpl-cv-builder-module-options-dropzone-<?php echo $i; ?>\">\n\n <div class=\"cv-modal-content-padding\">\n\n <div class=\"cv-grid-6 has-clearfix spacing-2\">\n\n <?php foreach ( $canvys['shortcodes'] as $shortcode ) {\n\n if ( ! $shortcode->config['builder_element'] ) {\n continue;\n }\n\n if ( (int) $i !== $shortcode->config['drop_target'] ) {\n continue;\n } ?>\n <div>\n <a class=\"cv-composer-available-module\" data-handle=\"<?php echo $shortcode->config['handle']; ?>\">\n <i class=\"icon-<?php echo $shortcode->config['icon']; ?>\"></i>\n <strong><?php echo $shortcode->config['title']; ?></strong>\n </a>\n </div>\n <?php } ?>\n\n </div>\n\n </div>\n\n </script>\n\n <?php endfor;\n\n }", "function opnada_show_mailpoet_html() {\r\n\r\n if ( !defined('WYSIJA') ) {\r\n ?>\r\n <div class=\"form-group\">\r\n <label class=\"col-sm-2 control-label\"></label>\r\n <div class=\"control-group controls col-sm-10\">\r\n <p><strong><?php _e('The MailPoet plugin is not found on your website. Emails will not be saved.', 'opanda') ?></strong></p>\r\n </div>\r\n </div>\r\n <?php\r\n } else {\r\n ?>\r\n <div class=\"form-group\">\r\n <label class=\"col-sm-2 control-label\"></label>\r\n <div class=\"control-group controls col-sm-10\">\r\n <p><?php _e('You can set a list where the subscribers should be added in the settings of a particular locker.', 'opanda') ?></p>\r\n </div>\r\n </div>\r\n <?php\r\n }\r\n}", "function isCustomTemplate() {\n\t\treturn false;\n\t}", "function getHTML() \r\n {\r\n \r\n // Make a new Template object\r\n //$path = SITE_PATH_TEMPLATES;\r\n $path = $this->pathModuleRoot.'templates/';\r\n // Replace $path with the following line if you want to create a\r\n // template tailored for this page:\r\n //$path = $this->pathModuleRoot.'templates/';\r\n \r\n \r\n // store the link values\r\n // $this->linkValues[ 'view' ] = 'add/new/href/data/here';\r\n\r\n \r\n // store the link labels\r\n// $this->linkLabels[ 'add' ] = $this->labels->getLabel( '[Add]' );\r\n// $this->linkLabels[ 'edit' ] = $this->labels->getLabel( '[Edit]' );\r\n// $this->linkLabels[ 'del' ] = $this->labels->getLabel( '[Delete]' );\r\n// $this->linkLabels[ 'cont' ] = $this->labels->getLabel( '[Continue]');\r\n // $this->linkLabels[ 'view' ] = 'new link label here';\r\n\r\n \r\n // store any additional link Columns\r\n // example:\r\n //$title = $this->labels->getLabel( '[title_groups]');\r\n //$columnLabel = $this->labels->getLabel( '[groups]');\r\n //$link = $this->linkValues[ 'groups' ];\r\n //$fieldName = 'accessgroup_id';\r\n //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName);\r\n\r\n \r\n // store the page labels\r\n // NOTE: use this location to update any label tags ...\r\n // example:\r\n // $name = $user->getName();\r\n // $this->labels->setLabelTag( '[Title]', '[userName]', $name);\r\n \r\n \r\n $this->prepareTemplate( $path );\r\n \r\n // store the Row Manager's XML Node Name\r\n // $this->template->set( 'rowManagerXMLNodeName', RowManager_AssignmentsManager::XML_NODE_NAME );\r\n $this->template->set( 'rowManagerXMLNodeName', $this->listManager->getRowManagerXMLNodeName() );\r\n \r\n \r\n \r\n // store the primary key field name for the data being displayed\r\n $this->template->set( 'primaryKeyFieldName', 'staffactivity_id');\r\n\r\n // Set calendar variables\r\n \t\t $this->template->set('year_id', $this->year_id); \r\n\t\t $this->template->set('month_id', $this->month_id);\r\n\t\t $this->template->set('first_weekday', $this->first_weekday);\t\t \r\n $this->template->set('monthEventDataList', $this->monthEvents);\t\r\n \r\n// \t echo '<pre>'.print_r($this->monthEvents,true).'</pre>';\r\n\t\r\n \r\n $activityTypeColors = new RowManager_ActivityTypeManager();\r\n $typeList = $activityTypeColors->getListIterator();\r\n $typeArray = $typeList->getDataList();\r\n \r\n $eventTypeColorArray = array();\r\n reset($typeArray);\r\n foreach (array_keys($typeArray) as $key)\r\n {\r\n\t $record = current($typeArray);\t \r\n\t $eventTypeColorArray[$record['activitytype_abbr']] = $record['activitytype_color'];\r\n\t next($typeArray);\r\n }\r\n\t $this->template->set('colorCodeList', $eventTypeColorArray);\t\t \r\n \r\n /*\r\n * Set up any additional data transfer to the Template here...\r\n */\r\n\r\n // now add the data for the Campus Group JumpList\r\n $jumpLink = $this->linkValues['jumpLink'];\r\n $jumpList = array();\r\n// if ( $this->adminManager->hasSitePriv() )\r\n// {\r\n// $jumpList[ $jumpLink.page_ViewStudentYearInSchool::DISPLAY_ALL_ID ] = 'Show All';\r\n// }\r\n foreach( $this->monthValues as $key=>$value) {\r\n $jumpList[ $jumpLink.$key ] = $value;\r\n }\r\n $this->template->set( 'jumpList', $jumpList );\r\n // echo '<pre>'.print_r($jumpList,true).'</pre>';\r\n // echo 'jumpLink['.$jumpLink.']<br/>';\r\n $this->template->set( 'defaultMonth', $jumpLink.$this->month_id );\r\n\r\n\r\n $templateName = 'page_ViewScheduleCalendar.tpl.php';\r\n\t\t// if you are creating a custom template for this page then \r\n\t\t// replace $templateName with the following:\r\n\t\t//$templateName = 'page_PeoplebyCampuses.php';\r\n\t\t\r\n\t\treturn $this->template->fetch( $templateName );\r\n \r\n }", "function pnRender_block_nocache($param, $content, &$smarty) {\n return $content;\n}", "protected function addForkTemplatePath()\n\t{\n\t\t$this->addTemplatePath(JPATH_COMPONENT .DS. 'fork' .DS. 'views' .DS. $this->getName() .DS. 'tmpl');\n\t}", "public function get_sessioninfo_output() {\n\n $result = '';\n\n // Display section heading\n $result .= mod_info_collapsible_region_start('schedule-heading', 'modinfo-viewlet-schedule', get_string('schedule_header', 'block_module_info'), 'modinfo-schedule', false, true);\n $result .= html_writer::start_tag('div', array('id'=>'schedule-pane'));\n\n // First check to see if there is any session information\n if (! empty($this->data->block_config->additional_session_subheading) || $this->data->block_config->enable_personal_timetable_link || $this->data->block_config->enable_module_timetable_link || !empty($this->data->block_config->custom_timetable_url)) {\n\n $result .= html_writer::start_tag('div', array('id' => 'schedule'));\n\n // Only display personal timetable link if user is logged in\n if(!isguestuser()) {\n if($this->data->block_config->enable_personal_timetable_link == true) {\n $result .= $this->get_personal_timetable_html();\n }\n } else {\n $result .= html_writer::tag('div', get_string('login_to_view_timetable', 'block_module_info'));\n }\n\n // Module timetable link\n if($this->data->block_config->enable_module_timetable_link == true) {\n $result .= $this->get_module_timetable_html();\n }\n\n // Display custom timetable link if URL is specified\n if(!empty($this->data->block_config->custom_timetable_url)) {\n $result .= $this->get_custom_timetable_html();\n }\n\n // Display each session\n foreach($this->data->block_config->additional_session_subheading as $key=>$value) {\n // Session title:\n $result .= html_writer::tag('h2', s($value), array('class'=>'session-heading'));\n\n // Formatted session details:\n $a = new stdClass();\n $a->day = $this->data->block_config->additional_session_day[$key];\n $a->time = $this->data->block_config->additional_session_time[$key];\n $a->location = $this->data->block_config->additional_session_location[$key];\n $result .= html_writer::tag('div', get_string('session_details', 'block_module_info', $a), array('class'=>'session-details'));\n }\n\n $result .= html_writer::end_tag('div');\n\n } else {\n $result .= $this->output->box(get_string('nosessionsavailable', 'block_module_info'));\n }\n\n $result .= html_writer::end_tag('div');\n $result .= mod_info_collapsible_region_end(true);\n\n return $result;\n }", "function misc()\n\t{\n\t\tif (!cron_installed()) attach_message(do_lang_tempcode('CRON_NEEDED_TO_WORK',escape_html(brand_base_url().'/docs'.strval(ocp_version()).'/pg/tut_configuration')),'warn');\n\n\t\trequire_code('templates_donext');\n\t\treturn do_next_manager(get_page_title('WELCOME_EMAILS'),comcode_lang_string('DOC_WELCOME_EMAILS'),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t/*\t type\t\t\t\t\t\t\t page\t params\t\t\t\t\t\t\t\t\t\t\t\t\t zone\t */\n\t\t\t\t\t\tarray('add_one',array('_SELF',array('type'=>'ad'),'_SELF'),do_lang('ADD_WELCOME_EMAIL')),\n\t\t\t\t\t\tarray('edit_one',array('_SELF',array('type'=>'ed'),'_SELF'),do_lang('EDIT_WELCOME_EMAIL')),\n\t\t\t\t\t),\n\t\t\t\t\tdo_lang('WELCOME_EMAILS')\n\t\t);\n\t}", "function display_notification()\n {\n //if session notify is set\n if(isset($_SESSION['notify']))\n {\n //set the type variable to the type of notification\n $type = $_SESSION['notify']['type'];\n //set the message variable to the message of notification\n $message = $_SESSION['notify']['message'];\n\n //create $html variable to equal bootstrap string for alerts\n //insert the message & type variables into the string to pull in corresponding css\n $html = '<div class=\"alert alert-'.$type.' role=\"alert\"><strong>'.$message.'</strong></div>';\n\n echo $html; \n\n //unset session (removes message when page is refreshed)\n unset($_SESSION['notify']);\n }\n }", "function lastcomments_page() {\r\n\r\n\tglobal $SYSTEM_FLAGS, $template, $CurrentHandler;\r\n\t// Action if ppage is enabled\r\n\tif (pluginGetVariable('lastcomments', 'ppage') && ($CurrentHandler['handlerParams']['value']['pluginName'] == 'core')) {\r\n\t\t$SYSTEM_FLAGS['info']['title']['group'] = \"lastcomments\";\r\n\t\t$template['vars']['mainblock'] = lastcomments(1);\r\n\t} else {\r\n\t\terror404();\r\n\t}\r\n}", "function pmi_preprocess_page(&$vars) {\n\n // redirect /home to front page with 301\n if ($_SERVER[\"REQUEST_URI\"] == '/home') {\n drupal_goto('', NULL, NULL, 301);\n }\n\n $vars['tabs2'] = menu_secondary_local_tasks();\n\n // Hook into color.module\n /*if (module_exists('color')) {\n _color_page_alter($vars);\n }*/\n\n/*if (arg(0) == \"user\") {\n $vars['title'] = 'Learning Portal';\n}*/\n\n\nif ($_GET['q'] == 'node/add/survey') {\n $vars['title'] = 'Find the course that’s right for you.';\n}\n\n// Add per content type pages\nif (isset($vars['node'])) {\n// Add template naming suggestion. It should alway use hyphens.\n// If node type is \"custom_news\", it will pickup \"page-custom-news.tpl.php\".\n$vars['template_files'][] = 'page-'. str_replace('_', '-', $vars['node']->type);\n}\n//used for feed icon\n// Store comments and the comment form in variables\n\n/* $vars['comments'] = $vars['comment_form'] = '';\n if (module_exists('comment') && isset($vars['node'])) {\n $vars['comments'] = comment_render($vars['node']);\n $vars['comment_form'] = drupal_get_form('comment_form',\n array('nid' => $vars['node']->nid));\n }*/\n\n\n\n}", "function wmf_redirect_template_warning_notice() {\n\t$screen = get_current_screen();\n\tif ( ! isset( $screen ) ) {\n\t\treturn;\n\t}\n\n\tif ( 'edit' !== $screen->parent_base || 'page' !== $screen->post_type ) {\n\t\treturn;\n\t}\n\n\tif ( ! wmf_is_redirect_template_page( get_the_ID() ) ) {\n\t\treturn;\n\t}\n\n\t?>\n\t<div class=\"notice notice-warning\">\n\t\t<p>\n\t\t\t<?php esc_html_e( 'This page is using the \"Redirect Page\" page template.', 'shiro-admin' ); ?>\n\t\t\t<?php esc_html_e( 'It will redirect to the newest child page which declares this page as its parent.', 'shiro-admin' ); ?>\n\t\t\t<?php esc_html_e( 'Change the template if you wish to edit this page directly.', 'shiro-admin' ); ?>\n\t\t</p>\n\t</div>\n\t<?php\n}", "function sample_admin_notice__success() {\n ?>\n <div class=\"notice notice-success is-dismissible\">\n <p><?php _e( 'RAR Example Plugin Installed!', 'sample-text-domain' ); ?></p>\n </div>\n <?php\n}", "public function before()\n {\n if($this->auto_render && in_array($this->request->action(), $this->skip_auto_render)) {\n $this->auto_render = FALSE;\n }\n\n parent::before();\n\n /* Mobile template handling */\n if($this->is_mobile)\n $this->template = 'mobile/layout';\n\n if ($this->auto_render === TRUE) {\n // Если AJAX запрос, то происходит подмена шаблона, чтобы не выводить лишние данные\n // Выводится только блок с контентом\n // шаблон 'ajax/layout' содержит всего одну строчку \"<?php echo $content;\"\n if ($this->request->is_ajax() === TRUE) {\n $this->template = View::factory('global/ajax');\n }\n else\n {\n $this->template = View::factory($this->template);\n }\n\n // В этой переменной будет инициализирован шаблон блока с контентом\n $this->template->content = '';\n\n /* выбор шаблона для рендера */\n if(!in_array($this->request->action(), $this->skip_auto_content_apply))\n $this->template->content = $this->getContentTemplate($this->content_template);\n }\n }" ]
[ "0.5877249", "0.5773055", "0.5721786", "0.5715341", "0.54135823", "0.5402291", "0.53973484", "0.5394881", "0.53817725", "0.53554344", "0.5343942", "0.53348714", "0.5315233", "0.5301589", "0.5295684", "0.52753484", "0.5273519", "0.52457774", "0.52457774", "0.523847", "0.5228103", "0.5210879", "0.5204433", "0.5203924", "0.5192766", "0.5170823", "0.5167881", "0.5158398", "0.5155204", "0.5153787", "0.5150472", "0.51418626", "0.51398844", "0.5137547", "0.5131606", "0.5123891", "0.5120926", "0.5117979", "0.51153666", "0.5114081", "0.5097309", "0.5069486", "0.5063617", "0.50631225", "0.50609654", "0.50478095", "0.5045767", "0.50435036", "0.50408655", "0.5040356", "0.50274956", "0.50235", "0.5022488", "0.5011568", "0.50095445", "0.5006222", "0.5003615", "0.50012934", "0.49999747", "0.49892822", "0.49836898", "0.49752933", "0.4971496", "0.49711475", "0.49696752", "0.49641818", "0.49577385", "0.49485782", "0.49418432", "0.49349427", "0.49305582", "0.49247167", "0.49181238", "0.49144658", "0.49144658", "0.49128732", "0.49109256", "0.49104446", "0.49075082", "0.4904102", "0.4899995", "0.48950458", "0.48914537", "0.4890254", "0.48887253", "0.48863068", "0.48837394", "0.48720595", "0.4867879", "0.4867867", "0.48653993", "0.4865153", "0.48640552", "0.48528123", "0.4851669", "0.48515987", "0.4850721", "0.48501238", "0.4842811", "0.48404074" ]
0.7050951
0
Jamie Alnasir, created. Obtain RHUL User's Student ID from currently logged in, LDAP authenticated RHUL user
function getRHUL_UserID() { global $RHUL_Non_Stu_ID; if ( is_user_logged_in() ) { global $wpdb; $wp_user = strtoupper(wp_get_current_user()->user_login); // Get currently logged-in Wordpress user $sql = "SELECT meta_value FROM cswp_usermeta WHERE meta_key = 'adi_studentno' AND user_id = " . "(SELECT user_id FROM cswp_usermeta WHERE meta_key = 'adi_samaccountname' AND meta_value = '" . $wp_user . "');"; $results = $wpdb->get_results($sql); // In case the "adi_studentno" key does not exist (i.e. a staff member) // returns -1 for this! if (!$results) { return $RHUL_Non_Stu_ID; }; try { return $results[0]->meta_value; } catch (Exception $e) { return -1; } } else { return -1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function student_id()\n\t\t{\n\t\t$custom = $this->custom_parsed();\n\t\tif(isset($custom['student_id']))\n\t\t\t{\n\t\t\treturn $custom['student_id'];\n\t\t\t}\n\t\telseif(isset($custom['person_id']))\n\t\t\t{\n\t\t\t$p = new Person($custom['person_id']);\n\t\t\treturn Student::addperson($p);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t$info = $this->infoarray();\n\t\t\tif(isset($info['payer_email']))\n\t\t\t\t{\n\t\t\t\t$p = Person::get_by_email($info['payer_email']);\n\t\t\t\tif($p === false)\n\t\t\t\t\t{\n\t\t\t\t\t$name = $info['first_name'] . ' ' . $info['last_name'];\n\t\t\t\t\t$person_id = Person::add2($info['payer_email'], $name);\n\t\t\t\t\treturn Student::addperson(new Person($person_id));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\treturn false;\n\t\t}", "function _create_user($user_data){\n \n $person_id=$this->model->insert($user_data);\n return $person_id;\n \n }", "function add_student(){\n\t\t\t\n\t\t\t$st_id = self::$db->quote($_POST['id']);\n\t\t\t$fname = self::$db->quote($_POST['firstname']);\n\t\t\t$lname = self::$db->quote($_POST['lastname']);\n\t\t\t$area = self::$db->quote($_POST['area']);\n\t\t\t$result = self::$admin->addStudent($st_id,$fname,$lname,$area);\n\n\t\t\tif($result == 1){\n\t\t\t\techo \"User Added Successfully....\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\techo \"something wrong\";\n\t\t\t}\n\t\t}", "public function createStudent($firstName, $lastName, $userName, $password, $emailAddress, $studentId, $major, $address);", "public function get_student_id() {\n\t\t\treturn $this->student_id;\n\t\t}", "function create_newuser($data){\n\tglobal $DB, $CFG, $USER;\n\t$atalvariables = get_atalvariables();\n\t$roleid = theme_get_roleidbyname('student');\n\t$schoolname = '';\n\t$city = '';\n\tif ($data->flag == 'add') {\n\t\t// Creating new user.\n\t\t$usertype = $data->usertype;\n\t\tif($usertype=='student'){\n\t\t\t//Can only be created by incharge login [logged in user id used to fetch the school id]\n\t\t\t$schooldata = $DB->get_record('user_school', array('userid'=>$USER->id), '*', MUST_EXIST);\n\t\t\t$schoolid = (isset($schooldata->schoolid))?$schooldata->schoolid:0;\n\t\t\t$roleid = theme_get_roleidbyname('student');\n\t\t} else{\n\t\t\t$schoolid = $data->school;\n\t\t\t$roleid = theme_get_roleidbyname($usertype);\n\t\t}\n\t\t$state = \"0\";\n\t\t$sql = \"SELECT s.name,c.name as city,ss.name as state FROM {school} s JOIN {city} c ON s.cityid = c.id LEFT JOIN {state} ss ON c.stateid=ss.id WHERE s.id=\".$schoolid;\n\t\t$result = $DB->get_record_sql($sql);\n\t\tif(isset($result->name)){\n\t\t\t$schoolname = $result->name;\n\t\t $city = $result->city;\n\t\t\t$state = (!empty($result->state))?$result->state:'0';\n\t\t}\n\t\t$user = new stdClass();\n\t\t$user->auth = 'manual';\n\t\t$user->confirmed = 1;\n\t\t$user->deleted = 0;\n\t\t$user->timezone = '99';\n\t\t$user->mnethostid = 1;\n\t\tif(isset($data->username)){\n\t\t\t$user->username = $data->username;\n\t\t}\n\t\telse\n\t\t\t$user->username = trim($data->email);\n\t\t//$user->password = hash_internal_user_password($data->newpassword);\n\t\t$ran = generate_randomstring();\n\t\t$user->passraw = $ran;\n\t\t$user->password=hash_internal_user_password($ran);\n\t\t$user->firstname = $data->firstname;\n\t\t$user->lastname = $data->lastname;\n\t\t$user->email = $data->email;\n\t\t$user->icq = \"newuser\";\n\t\t$user->msn = $roleid;\n\t\t$user->institution = $schoolname;\n\t\t$user->city = $city;\n\t\t/* if(isset($data->state)){\n\t\t\t$user->aim = $data->state;\n\t\t} */\n\t\t$user->aim = (isset($data->state) && !empty($data->state))?$data->state:$state;\n\t\t$user->country = 'IN';\n\t\t$user->timecreated = time();\n\t\t$user->timemodified = time();\n\t\tif(isset($data->gender)){\n\t\t\t$user->gender = $data->gender;\n\t\t}\n\t\tif(isset($data->phone1)){\n\t\t\t$user->phone1 = $data->phone1;\n\t\t}\n\t\t// Insert the user into the database.\n\t\t$newuserid = $DB->insert_record('user', $user);\n\t\t$usercontext = context_user::instance($newuserid);\n\t\t$cm = new stdClass();\n\t\t$cm->userid = $newuserid;\n\t\t$cm->schoolid = $schoolid;\n\t\t$cm->role = $usertype;\n\t\tif(isset($data->studentclass)){\n\t\t\t$cm->studentclass = $data->studentclass;\n\t\t}\n\t\t$DB->insert_record('user_school', $cm);\n\t}\n\t$name = $user->firstname.' '.$user->lastname;\n\tsend_welcomemail($roleid,$newuserid,$name,$data->email,$user->username,$ran);\n\treturn true;\n}", "public function post_student() {\n $params = array(\n 'ruid' => Input::get('ruid'), \n 'net_id'=> Input::get('net_id'),\n 'passwd'=> Hash::make(Input::get('passwd')), \n 'email_addr' => Input::get('email_addr'), \n 'grad_year' => Input::get('grad_year'), \n 'major' => Input::get('major'), \n 'credits' => Input::get('credits'), \n 'gpa' => Input::get('gpa')\n );\n \n $user = User::create(array('net_id' => $params['net_id'], 'passwd' => $params['passwd']));\n $user->save();\n\n $student = new Student;\n $student->fill($params);\n $student->save();\n\n Auth::login($user);\n\n return Redirect::to('account/studentedit');\n }", "public function getStudentId()\n {\n return $this->studentId;\n }", "public function create_sid()\n {\n }", "function user_create($attributes){\n //check for compulsory fields\n if (!array_key_exists(\"username\",$attributes)){ return (\"Missing compulsory field [username]\"); }\n if (!array_key_exists(\"firstname\",$attributes)){ return (\"Missing compulsory field [firstname]\"); }\n if (!array_key_exists(\"surname\",$attributes)){ return (\"Missing compulsory field [surname]\"); }\n if (!array_key_exists(\"email\",$attributes)){ return (\"Missing compulsory field [email]\"); }\n if (!array_key_exists(\"container\",$attributes)){ return (\"Missing compulsory field [container]\"); }\n if (!is_array($attributes[\"container\"])){ return (\"Container attribute must be an array.\"); }\n\n if (array_key_exists(\"password\",$attributes) && !$this->_use_ssl){ \n // Modified by SysCo/al\n $this->_error = TRUE;\n $this->_error_message = 'FATAL: SSL must be configured on your webserver and enabled in the class to set passwords.';\n exit();\n }\n\n if (!array_key_exists(\"display_name\",$attributes)){ $attributes[\"display_name\"]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"]; }\n\n //translate the schema\n $add=$this->adldap_schema($attributes);\n \n //additional stuff only used for adding accounts\n $add[\"cn\"][0]=$attributes[\"display_name\"];\n $add[$this->_cn_identifier][0]=$attributes[\"username\"];\n $add[\"objectclass\"][0]=\"top\";\n $add[\"objectclass\"][1]=\"person\";\n $add[\"objectclass\"][2]=\"organizationalPerson\";\n $add[\"objectclass\"][3]=\"user\"; //person?\n //$add[\"name\"][0]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"];\n\n //set the account control attribute\n $control_options=array(\"NORMAL_ACCOUNT\");\n if (!$attributes[\"enabled\"]){ $control_options[]=\"ACCOUNTDISABLE\"; }\n $add[\"userAccountControl\"][0]=$this->account_control($control_options);\n //echo (\"<pre>\"); print_r($add);\n\n //determine the container\n $attributes[\"container\"]=array_reverse($attributes[\"container\"]);\n $container=\"OU=\".implode(\",OU=\",$attributes[\"container\"]);\n\n //add the entry\n $result=@ldap_add($this->_conn, \"CN=\".$add[\"cn\"][0].\", \".$container.\",\".$this->_base_dn, $add);\n if ($result!=true){ return (false); }\n \n return (true);\n }", "function createStudent($common, $firstName, $lastName, $studentID, $email, $major) {\n\t\tparent::doQuery(\"INSERT INTO `Proj2Students` (`FirstName`, `LastName`, `StudentID`, `Email`, `Major`, `Status`) \n\t\tVALUES ('$firstName', '$lastName', '$studentID', '$email', '$major', 'N')\", $common);\n\t}", "public function get_user_id();", "function identifyUser() {\n}", "public function getID(): string {\n\t\treturn 'user_ldap';\n\t}", "public function getCurrentStudentId()\n {\n return $this->getAttribute('student_id');\n }", "public function getStudentId() {\n\t\tpreg_match ( '/\\d{9}/', $this->transcript, $ID ); // this will get the SID of the student\n\n\t\tif (count ( $ID ) > 0) {\n\t\t\t\t\n\t\t\t// $key= mt_rand ( MIN_KEY, MAX_KEY ); // will append a random key to the SI\n\t\t\treturn $ID [0]; // . strval($key);\n\t\t} else\n\t\t\treturn null;\n\t}", "function user_students ($target_user = \"\") {\n if (!$target_user) {\n global $user;\n $target_user = $user;\n } else {\n $target_user = eto_user_load(array('name' => $target_user));\n }\n\n if (!$target_user) {\n drupal_not_found();\n exit;\n }\n\n if ($target_user->uid != $user->uid) {\n if (! user_acccess('administer the site')) {\n drupal_access_denied();\n exit;\n }\n }\n\n $title = \"My Students\";\n drupal_set_title($title);\n $output = \"<h2>$title</h2>\\n\";\n\n $students = sb_assignment_load ($target_user->uid, \"student_uid\");\n\n $schedule_url = sb_user_base($target_user) . \"/schedule\";\n \n $output .= l(\"+Add an appointment with a student\", $schedule_url);\n\n if ($students) {\n $output .= \"<ul>\\n\";\n foreach ($students as $uid => $name) {\n $u = eto_user_load($uid);\n $output .= \"<li>\" \n\t. theme('eto_user', $u, TRUE)\n\t. \"</li>\\n\";\n }\n $output .= \"</ul>\\n\";\n } else {\n $output .= \"<p>You have no students assigned yet.</p>\\n\";\n }\n\n return $output;\n}", "public function single_student_create(){\n\t\t$user_data['name'] = html_escape($this->input->post('name'));\n\t\t$user_data['email'] = html_escape($this->input->post('email'));\n\t\t$user_data['password'] = sha1(html_escape($this->input->post('password')));\n\t\t$user_data['birthday'] = strtotime(html_escape($this->input->post('birthday')));\n\t\t$user_data['gender'] = html_escape($this->input->post('gender'));\n\t\t$user_data['blood_group'] = html_escape($this->input->post('blood_group'));\n\t\t$user_data['address'] = html_escape($this->input->post('address'));\n\t\t$user_data['phone'] = html_escape($this->input->post('phone'));\n\t\t$user_data['role'] = 'student';\n\t\t$user_data['school_id'] = $this->school_id;\n\t\t$user_data['watch_history'] = '[]';\n\n\t\t// check email duplication\n\t\t$duplication_status = $this->check_duplication('on_create', $user_data['email']);\n\t\tif($duplication_status){\n\t\t\t$this->db->insert('users', $user_data);\n\t\t\t$user_id = $this->db->insert_id();\n\n\t\t\t$student_data['code'] = student_code();\n\t\t\t$student_data['user_id'] = $user_id;\n\t\t\t$student_data['parent_id'] = html_escape($this->input->post('parent_id'));\n\t\t\t$student_data['session'] = $this->active_session;\n\t\t\t$student_data['school_id'] = $this->school_id;\n\t\t\t$this->db->insert('students', $student_data);\n\t\t\t$student_id = $this->db->insert_id();\n\n\t\t\t$enroll_data['student_id'] = $student_id;\n\t\t\t$enroll_data['class_id'] = html_escape($this->input->post('class_id'));\n\t\t\t$enroll_data['section_id'] = html_escape($this->input->post('section_id'));\n\t\t\t$enroll_data['session'] = $this->active_session;\n\t\t\t$enroll_data['school_id'] = $this->school_id;\n\t\t\t$this->db->insert('enrols', $enroll_data);\n\n\t\t\tmove_uploaded_file($_FILES['student_image']['tmp_name'], 'uploads/users/'.$user_id.'.jpg');\n\n\t\t\t$response = array(\n\t\t\t\t'status' => true,\n\t\t\t\t'notification' => get_phrase('student_added_successfully')\n\t\t\t);\n\t\t}else{\n\t\t\t$response = array(\n\t\t\t\t'status' => false,\n\t\t\t\t'notification' => get_phrase('sorry_this_email_has_been_taken')\n\t\t\t);\n\t\t}\n\n\t\treturn json_encode($response);\n\t}", "public function create_student($username, $firstname, $lastname, $email, $pass1, $pass2)\r\n\t{\r\n\r\n\t\t/* \r\n\t\t\tvalidate_input() is in charge of validating the input parameters\r\n\t\t\tbefore we do anything else. It returns an array of error messages \r\n\t\t*/\r\n\t\t$error_array = $this->validate_input($username, $firstname, $lastname, $email, $pass1, $pass2);\r\n\t\t/* \r\n\t\t\tIf we receive an array that IS NOT empty then we have ERRORS. Therefore we return the array,\r\n\t\t\tfor UX purposes, and EXIT the current process.\r\n\t\t*/\r\n\t\tif(count($error_array)>0)\r\n\t\t{\r\n\t\t\treturn $error_array;\r\n\t\t\texit();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$pass = $pass1;\r\n\t\t}\r\n\r\n\t\t//Secondly, we check if the email is in the system\r\n\t\tif ($this->check_for_email($email) !== TRUE)\r\n\t\t{\r\n\t\t\t//If it does not return TRUE, it returns an error message\r\n\t\t\treturn $this->check_for_email($email);\r\n\t\t}\r\n\r\n\t\t//Now, we check if the username is in the system\r\n\t\tif ($this->check_for_username($username) !== TRUE)\r\n\t\t{\r\n\t\t\t//If it does not return TRUE, it returns an error message\r\n\t\t\treturn $this->check_for_username($username);\r\n\t\t}\r\n\r\n\t\t//We generate a random string between 40 and 50 characters of length, to\r\n\t\t//use as the salt.\r\n\t\t$salt = generate_random_string(40, 50);\r\n\r\n\t\t//If we reach this far, we need to hash the password!\r\n\t\t//The function returns the hashed password.\r\n\t\t$password = $this->hash_password($pass, $salt);\r\n\r\n\t\t//We make use of the global dbCon that we've created in the config file\r\n\t\tglobal $dbCon;\r\n\r\n\t\t//This is pretty basic SQL. We use Prepared Statements\r\n\t\t$sql = \"INSERT INTO student \"\r\n\t\t\t\t. \"(username, firstname, lastname, email, password, salt, \"\r\n\t\t\t\t. \"permission) \"\r\n\t\t\t\t. \"VALUES \"\r\n\t\t\t\t. \"(?, ?, ?, ?, ?, ?, 1);\";\r\n\t\t//We Prepare the Statement\r\n\t\t$stmt = $dbCon->prepare($sql);\r\n\t\tif ($stmt === false)\r\n\t\t{\r\n\t\t\t//Oh no, the statement wasn't prepared correct! Trigger the Error!\r\n\t\t\ttrigger_error('SQL Error: ' . $dbCon->error, E_USER_ERROR);\r\n\t\t}\r\n\t\t//So, let's bind the parameters to the prepared statement.\r\n\t\t//the first part means that all six parameters are strings, the rest\r\n\t\t//are the parameters we pass to the statement.\r\n\t\t$stmt->bind_param('ssssss', $username, $firstname, $lastname, $email, $password, $salt); //Bind parameters.\r\n\t\t//Execute the statement\r\n\t\t$stmt->execute();\r\n\t\t//Get the insertet ID (the new Student's ID in the DB)\r\n\t\t$id = $stmt->insert_id;\r\n\t\t//We check if it is an integer higher than 0\r\n\t\tif ($id > 0)\r\n\t\t{\r\n\t\t\t//It is, which means that the Student has been created and saved\r\n\t\t\t$stmt->close();\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\t//Well, since we reached this far, the if statement wasn't executed.\r\n\t\t//Save the error\r\n\t\t$error = $stmt->error;\r\n\t\t//Close down the statement (good practice)\r\n\t\t$stmt->close();\r\n\t\treturn $error;\r\n\t}", "function nb_get_student_meta(){\n\tglobal $current_user;\n\n\tif( $current_user->ID != null){\n\t\t$sid = $current_user->ID;\n\t\t$student = get_userdata($sid); \n\n\t}\n\t\n\treturn $student;\n\n}", "public function get_user() {\r\n return $this->util_model->get_data(\r\n 'schools', \r\n array('unitname') \r\n );\r\n }", "public function _getStudentNumber()\n {\n $user = \"\";\n if ($this->has('user'))\n $user = $this->user;\n else\n $user = TableRegistry::get('Users')->get($this->user_id);\n\n return substr($user->login, 2);\n }", "public function student()\n {\n return $this->hasOne(User::class,\n 'id',\n SchemaConstant::STUDENT_FOREIGN_KEY );\n }", "public function user_create($attributes){\n // Check for compulsory fields\n if (!array_key_exists(\"username\",$attributes)){ return (\"Missing compulsory field [username]\"); }\n if (!array_key_exists(\"firstname\",$attributes)){ return (\"Missing compulsory field [firstname]\"); }\n if (!array_key_exists(\"surname\",$attributes)){ return (\"Missing compulsory field [surname]\"); }\n if (!array_key_exists(\"email\",$attributes)){ return (\"Missing compulsory field [email]\"); }\n if (!array_key_exists(\"container\",$attributes)){ return (\"Missing compulsory field [container]\"); }\n if (!is_array($attributes[\"container\"])){ return (\"Container attribute must be an array.\"); }\n\n if (array_key_exists(\"password\",$attributes) && (!$this->_use_ssl && !$this->_use_tls)){ \n throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');\n }\n\n if (!array_key_exists(\"display_name\",$attributes)){ $attributes[\"display_name\"]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"]; }\n\n // Translate the schema\n $add=$this->adldap_schema($attributes);\n \n // Additional stuff only used for adding accounts\n if (isset($attributes['cn'])) {\n \t$add['cn'][0]=$attributes['cn']; // EXTENDED by CST\n } else {\n \t$add[\"cn\"][0]=$attributes[\"display_name\"];\n }\n $add[\"samaccountname\"][0]=$attributes[\"username\"];\n $add[\"objectclass\"][0]=\"top\";\n $add[\"objectclass\"][1]=\"person\";\n $add[\"objectclass\"][2]=\"organizationalPerson\";\n $add[\"objectclass\"][3]=\"user\"; //person?\n //$add[\"name\"][0]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"];\n\n // Set the account control attribute\n $control_options=array(\"NORMAL_ACCOUNT\");\n if (!$attributes['enabled']){ $control_options[]=\"ACCOUNTDISABLE\"; }\n $add[\"userAccountControl\"][0]=$this->account_control($control_options);\n //echo (\"<pre>\"); print_r($add);\n\n // Determine the container\n $attributes[\"container\"]=array_reverse($attributes[\"container\"]);\n $container=\"OU=\".implode(\",OU=\",$attributes[\"container\"]);\t\t\n\t\t\n\t\t// Add the entry\n\t\t$result=@ldap_add($this->_conn, \"CN=\".$add[\"cn\"][0].\", \".$container.\",\".$this->_base_dn, $add); \n if ($result!=true){ return (false); }\n\t\t\n return (true);\n }", "function getUserIdentifier()\n\t{\n\t\tif ($this->serverType == \"activedirectory\") {\n\t\t\treturn $this->attr_sambalogin;\n\t\t} else {\n\t\t\treturn $this->attr_login;\n\t\t}\n\t}", "public function registerStudent($surname, $firstname, $othername, $picture, $address, $birthdate, $admin, $class, $class_type, $class_arm, $status){\n\t\t\t$sql = \"INSERT INTO student (id, surname, firstname, othername, birth_date, address, picture, status, clazz_id, clazz_type_id, class_arm_id, admin_id, created_at, updated_at) VALUES(NULL,'$surname', '$firstname', '$othername', '$birthdate', '$address','$picture', '$status', '$class', '$class_type', '$class_arm','$admin', NULL, NULL)\";\n\t\t\t$condition_check=$this->connection()->exec($sql);\t\n\t\t\t// die($condition_check);\n\n\t\t\tif ($condition_check) {\t\t\t//this condition checks if record has been inserted into the database\n\t\t\t\t$query = $this->connection()->prepare(\"SELECT * FROM student ORDER BY id DESC\");\n\t\t\t\t$query->execute();\n\t\t\t\t$last_id_record=$query->fetch();\n\t\t\t\t$last_id=$last_id_record['id'];\t\n\t\t\t\treturn $last_id;\t//inserted record id return for a purpose\n\t\t\t}else{\n\t\t\t\tdie('record not inserted, pls contact adminitrator');\n\t\t\t}\n\t\t\t\n\t\t}", "function getObjectSid($ldapUser)\n\t{\n\t\t$criteria = '('.$this->getUserIdentifier().'='.$ldapUser.')';\n\t\t$justthese = array(\"objectsid\");\n\n\t\t// if the directory is AD, then bind first with the search user first\n\t\tif ($this->serverType == \"activedirectory\")\n\t\t{\n\t\t\t$this->bindauth($this->searchUser, $this->searchPassword);\n\t\t}\n\n\t\t$i = 0;\n\t\t$searchDN = $this->people;\n\n\t\twhile ($i <= 2)\n\t\t{\n\t\t\t$ldapSearchResult = @ldap_search($this->connection, $searchDN, $criteria, $justthese);\n\n\t\t\tif (!$ldapSearchResult)\n\t\t\t{\n\t\t\t\t$this->error = ldap_errno($this->connection).\" \".ldap_error($this->connection);\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\t$entry = ldap_first_entry($this->connection, $ldapSearchResult);\n\n\t\t\tif (!$entry)\n\t\t\t{\n\t\t\t\t// Si pas de resultat on cherche dans le domaine\n\t\t\t\t$searchDN = $this->domain;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$i++;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\tif ($entry)\n\t\t{\n\t\t\t$ldapBinary = ldap_get_values_len($this->connection, $entry, \"objectsid\");\n\t\t\t$SIDText = $this->binSIDtoText($ldapBinary[0]);\n\t\t\treturn $SIDText;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error = ldap_errno($this->connection).\" \".ldap_error($this->connection);\n\t\t\treturn '?';\n\t\t}\n\t}", "function assignstudent(){\n\t\t\n\t\t$insert = array();\n\t\t$insert['rolename'] = $this->input->post(\"rolename\");\n\t\t$insert['user_id'] = $this->input->post(\"studentid\");\t\t\n\t\t$azureRoleDetails = $this->Azure->getAzureRoleDetails($insert['rolename']);\n\t\t$insert['azure_vm_id'] = $azureRoleDetails['id'];\n\t\t\n\t\t$user = $this->User->getUser($insert['user_id']);\n\t\t// $vminfo = $this->Azure->;\n if($user){ \n \t$return = $this->Azure->assignStudent($insert);\n\t\t}else\n $return = array(\"type\" => \"danger\",\"msg\" => \"The students was not found.\");\t\t\t\n\t\t\n\t\techo json_encode($return);\n\t}", "public function getIdStudent(){\n\t\treturn $this->idStudent;\n\t}", "function createNewUser($F_Name, $L_Name, $Email, $DOB, $cell_number, $Address, $City, $State, $Zip, $Country)\n{\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\n \"INSERT INTO \" . $db_table_prefix . \" student_info(\n\t\tF_Name,\n L_Name,\n Email,\n DOB,\n Cell_number,\n Address,\n City,\n State,\n Zip,\n Country\n\t\t)\n\t\tVALUES (\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t?,\n\t\t?\n\t\t)\"\n );\n $stmt->bind_param(\"ssssssssss\", $F_Name, $L_Name, $Email,$DOB, $cell_number, $Address, $City, $State, $Zip, $Country);\n $result = $stmt->execute();\n $stmt->close();\n return $result;\n\n}", "function create_user($name, $email, $pass, $type, $sex, $dob)\n\t{\n\t\t$con = dbConnect(\"localhost\", \"root\", \"\", \"jobportal\");\n\t\tif($con)\n\t\t{\n\t\t\t//Insertion into User Master\n\t\t\tmysqli_query($con, \"INSERT INTO user_master(uName, uEmail, uPass,\n\t\t\tuType, uSex, uDob) VALUES ('$name', '$email', '$pass', '$type', '$sex', '$dob')\");\n\t\t\t\n\t\t\t//Last ID generated\n\t\t\t$uId = mysqli_insert_id($con);\n\t\t\treturn $uId;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getStudentId(): int\n {\n return $this->studentId;\n }", "public function create_sso_user($provider, $sso_id, $email, $screen_name)\n\t{\n\t\t$this->db->set('sso_provider', $provider);\n\t\t$this->db->set('sso_id', $sso_id);\n\t\t$this->db->set('email', $email);\n\t\t$this->db->set('screen_name', $screen_name);\n\t\t$this->db->set('is_active', 'yes');\n\n\t\t$this->db->insert('user');\n\n\t\treturn $this->db->insert_id();\n\t}", "public function createUser($firstname,$lastname,$phone,$email,$pass,$const_id,$role_id){\n if (!$this->isStudentExists($username)) {\n $password = md5($pass);\n $apikey = $this->generateApiKey();\n $stmt = $this->con->prepare(\"INSERT INTO users (firstname, lastname, phone_number, email, password, constituent_id, role_id) values(?, ?, ?, ?, ?, ?, ?)\");\n $stmt->bind_param(\"ssdssii\", $firstname, $lastname, $phone, $email, $pass, $const_id, $role_id);\n $result = $stmt->execute();\n $stmt->close();\n if ($result) {\n return 0;\n } else {\n return 1;\n }\n } else {\n return 2;\n }\n }", "function addStudent($name, $institution, $major, $minor, $identification, $passkey, $google, $yahoo, $live, $facebook, $linkedin, $twitter){\n\n\t\t$this->connection->query(\"INSERT INTO students (stud_name, stud_inst, stud_major, stud_minor, stud_identification, stud_passkey, stud_google, stud_yahoo, stud_live, stud_facebook, stud_linkedin, stud_twitter) VALUES ('$name', '$institution', '$major', '$minor', '$identification', '$passkey', '$google', '$yahoo', '$live', '$facebook', '$linkedin', '$twitter' )\",true);\n\t\tif($_SESSION['query']){\n\t\t\treturn \"Student Successfully Added\";\n\t\t}else{\n\t\t\treturn \"Failed to add Student!\";\t\t\n\t\t}\t\n\n\t}", "protected function createUser ()\n {\n /* Method of the UserFactory class */\n $this->_objUser = UserFactory::createUser(ucfirst($_SESSION[\"userType\"])); \n $this->_objUser->setFirstName($_SESSION[\"emailID\"]);\n }", "function add_primary_user($admin_email, $admin_first_name, $admin_last_name, $admin_department, $admin_password, $accountID, $permissions){\r\n global $db;\r\n $query = 'INSERT INTO Users(AccountID_FK, Username, Password, First_Name, Last_Name, Department, Permissions)\r\n VALUES (:AccountID, :Email, :Password, :First_Name, :Last_Name, :Department, :Permissions)';\r\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n $statement = $db->prepare($query);\r\n $statement->bindParam(':Email', $admin_email);\r\n $statement->bindParam(':First_Name', $admin_first_name);\r\n $statement->bindParam(':Last_Name', $admin_last_name);\r\n $statement->bindParam(':Department', $admin_department);\r\n $statement->bindParam(':Password', $admin_password);\r\n $statement->bindParam(':AccountID', $accountID);\r\n $statement->bindParam(':Permissions', $permissions);\r\n echo \"User Account ID is: \" . $accountID;\r\n $statement->execute();\r\n $last_id = $db->lastInsertId();\r\n echo \"New record created succesfully. User ID is: \" . $last_id;\r\n $statement->closeCursor();\r\n return $last_id;\r\n}", "function ibm_uid ( $dn ) { return dn2uid($dn); }", "public function stuUserLogin() {\n\t\tif(isset($_POST['txtUName']) && isset($_POST['subDomain'])){\n\t\t\t$schl_query=\"select id from schools where code='\".trim($_POST['subDomain']).\"'\";\n\t\t\t$schl_query_res = mysqli_query($this->connfed, $schl_query);\n\t\t if(mysqli_num_rows($schl_query_res)>0){\n\t\t\t$school_data=mysqli_fetch_assoc($schl_query_res);\n\t\t\t$hash_salt_query=\"select u.id,hashed_password,salt,u.email,batch_id,b.course_id,b.start_date,b.end_date,u.username from users u left join students s on s.user_id = u.id left join batches b on b.id = s.batch_id where u.username='\".trim($_POST['txtUName']).\"' and u.school_id='\".$school_data['id'].\"' and u.admin!=1 and u.employee!=1 and u.student!=0\";\n\t\t\t$hash_salt_res = mysqli_query($this->connfed, $hash_salt_query);\n\t\t\tif(mysqli_num_rows($hash_salt_res)>0){\t\n\t\t\t \t$row=mysqli_fetch_assoc($hash_salt_res);\n\t\t\t\t$hash_pwd = $row['hashed_password'];\n\t\t\t\t$salt = $row['salt'];\n\t\t\t\t$pwd=$salt.$_POST['txtPwd'];\n\t\t\t\t$hash_new_pwd=hash('sha1',$pwd);\n\t\t\t\tif ($hash_pwd==$hash_new_pwd) {\n\t\t\t\t\t $_SESSION['std_id']=$row['id'];\n\t\t\t\t\t $_SESSION['username']=$row['username'];\n\t\t\t\t\t $_SESSION['user_email']=$row['email'];\n\t\t\t\t\t $_SESSION['batch_id']=$row['batch_id'];\n\t\t\t\t\t $_SESSION['start_date']= date(\"Y-m-d\",strtotime($row['start_date']));\n\t\t\t\t\t $_SESSION['end_date'] = date(\"Y-m-d\",strtotime($row['end_date']));\n\t\t\t\t\t $_SESSION['school_id']=$school_data['id'];\n\t\t\t\t\t $_SESSION['course_id']=$row['course_id'];\n\t\t\t\t\t return 1;\n\t\t\t\t}else{\n\t\t\t\t\t $message=\"Paasword does not matched.\";\n\t\t\t\t\t $_SESSION['error_msg'] = $message;\t\n\t\t\t\t\t return 0;\n\t\t\t\t}\n\t\t\t }else{\n\t\t\t \t\t$message=\"Incorrect Username or Password\";\n\t\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\t\treturn 0;\n\t\t\t }\n\t\t\t}else{\n\t\t\t\t$message=\"Incorrect Username or Password\";\n\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}", "public function getIdStudent()\n {\n return $this->id_student;\n }", "function create_user ( $ID, $first_name, $last_name, $email ) {\n\tglobal $access_token, $canvas_base_url;\n\t\n\t$pass=md5(uniqid($first_name.$last_name, true));\n\t$url=$canvas_base_url.\"/api/v1/accounts/1/users.json\";\n\tsystem(\"curl $url -F 'user[name]=$first_name $last_name' -F 'user[short_name]=$first_name' -F 'pseudonym[unique_id]=$email' -F 'pseudonym[password]=$pass' -F 'pseudonym[sis_user_id]=$ID' -H 'Authorization: Bearer $access_token'\");\n\t\n}", "abstract protected function getUserId() ;", "public function getOwner()\n\t{\n\t\tglobal $mysql;\n\t\t$result = $mysql->query(\"SELECT `sid` FROM `students` WHERE `laptop` = \".$this->getID());\n\t\tif ( !$result || mysqli_num_rows($result) == 0 )\n\t\t\treturn false;\n\t\treturn new Student(mysqli_result($result, 0, \"sid\"));\n\t}", "public function create_student($row)\n\t\t{\n\t\t\t$student = new Student();\n\t\t\t$student->setId($row['id']);\n\t\t\t$student->setFirstName($row['firstName']);\n\t\t\t$student->setLastName($row['lastName']);\n\t\t\t$student->setGender($row['gender']);\n\t\t\t$student->setAge($row['age']);\n\t\t\t$student->setGroup($row['sgroup']);\n\t\t\t$student->setFaculty($row['faculty']);\n\t\t\t\n\t\t\treturn $student;\n\t\t}", "function getUsername($as)\n{\n $attributes = $as->getAttributes();\n $sp = $as->getAuthSource();\n if (isset($attributes['eduPersonTargetedID']))\n {\n $doc = new DOMDocument();\n $doc->loadXML($attributes['eduPersonTargetedID'][0]);\n $nameID = $doc->getElementsByTagName('NameID');\n foreach ($nameID as $node)\n $username = $as->getAuthData('saml:sp:IdP') . '!' . $node->nodeValue;\n\n }\n elseif(isset($attributes['subject-id']))\n $username = $attributes['subject-id'][0];\n elseif ($sp->getAuthId() == 'oauth')\n $username = $as->getAuthData('saml:sp:IdP') . '!anonymous';\n else\n $username = null;\n \n return $username;\n}", "function getRHUL_FirstName() {\n return getRHUL_LDAP_FieldValue(\"first_name\");\n}", "public function add_user($key) {\r\n\t\t// Look for the student in the temp_student table.\r\n\t\t$temp_student = $this->db->get_where('temp_student', array('temp_user_key' => $key));\r\n\t\tif (!$temp_student)\r\n\t\t\treturn null;\r\n\r\n\t\tif ($temp_student->num_rows() != 1)\r\n\t\t\treturn null;\r\n\r\n\t\t$row = $temp_student->row();\r\n\t\t$rollno = $row->student_rollno;\r\n\r\n\t\t$user_added = parent::add_user($key);\r\n\t\tif (!$user_added)\r\n\t\t\treturn null;\r\n\r\n\t\t$data = array(\r\n\t\t\t'user_id' => $user_added,\r\n\t\t\t'student_rollno' => $rollno\r\n\t\t);\r\n\r\n\t\t$student_added = $this->db->insert('student', $data);\r\n\t\tif (!$student_added)\r\n\t\t\treturn null;\r\n\r\n\t\treturn $user_added;\r\n\t}", "public function createUser () {\n syslog( LOG_INFO, 'Create a Lineberty User \\n' );\n\n $url = '/users';\n\n return $this->runRequest($url, 'POST', null);\n }", "public function addStudent()\n {\n $student = new Student();\n $student->name = 'Shakib';\n $student->email = '[email protected]';\n $student->save();\n\n return 'Student Added Successfully!';\n }", "public function get_logged_in_student_details() {\n\t\t$user_id = $this->session->userdata('user_id');\n\t\t$student_data = $this->db->get_where('students', array('user_id' => $user_id))->row_array();\n\t\t$student_details = $this->get_student_details_by_id('student', $student_data['id']);\n\t\treturn $student_details;\n\t}", "public function authenticate() {\n\n $ldap = Yii::app()->ldap;\n\n $result = $ldap->authenticate($this->username, $this->password);\n $ldapUserInfo = $ldap->user()->infoCollection($this->username, array(\"mail\", \"displayname\"));\n\n\n if (!$result) {\n $this->errorCode = self::ERROR_USERNAME_INVALID;\n } else {\n\n $this->setState('fullname', $ldapUserInfo->displayname);\n $this->setState('email', $ldapUserInfo->mail);\n\n $dbUser = Users::model()->findByAttributes(array('ldap' => $this->username));\n if (!$dbUser) {\n $dbUser = new Users();\n $dbUser->ldap = $this->username;\n $dbUser->full_name = $ldapUserInfo->displayname;\n $dbUser->pass = $this->password;\n $dbUser->mail = $ldapUserInfo->mail;\n $dbUser->salt = 'f';\n $dbUser->url = 'f';\n $dbUser->create = time();\n\n $dbUser->save();\n //print_r($dbUser);\n }\n \n $this->_id = $dbUser->primaryKey;\n\n $this->errorCode = self::ERROR_NONE;\n \n }\n\n\n return !$this->errorCode;\n }", "private function get_student_id($param = '')\r\n\t{\r\n\t\treturn $this->db->get_where('students', array('npm' => $param))->row('student_id');\r\n\t}", "public function add_user($idcard, $name, $surname, $email, $password, $role, $salt){\n\n\n $dataLogin = array(\n 'user_id' => $idcard,\n 'email_login' => $email,\n 'pass_login' => password_hash($salt.$password, CRYPT_BLOWFISH),\n 'salt_login' => strrev($salt),\n 'tbl_roles_id' => $role\n\n );\n $this->db->insert('tbl_login', $dataLogin);\n //gives us whatever the PK value is last\n //return $this->db->insert_id(); code below will get ID (this-db-insert-id)\n $id = $this->db->insert_id();\n\n\n //adding user data to its table\n $dataUser = array(\n 'tbl_login_id_login' => $id,\n 'user_name' => $name,\n 'user_surname' => $surname\n );\n $this->db->insert('tbl_users', $dataUser);\n\n return $id;\n\n }", "public function diviroids_user_id($atts)\n {\n return DiviRoids_Security::get_current_user('ID');\n }", "public function getUserID () {\n return $this->id;\n }", "function Student($common, $id) {\n\t\t// Student ID used as unique identifier for students\n\t\tparent::Base($common, $id, 'Proj2Students', 'StudentID');\n\t}", "public function getUsername(): string\n {\n return (string) $this->studentNumber;\n }", "public function insert()\n { if (!is_null($this->id))\n trigger_error(\"User::insert(): Attempt to insert a User object that already has its ID property set (to $this->id).\", E_USER_ERROR); \n // Insert the User\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $sql = \"INSERT INTO users ( user_name, user_password_hash, user_email, orcid, orcid_code, orcid_access_token ) VALUES ( :user_name , :user_password_hash , :user_email, :orcid, :orcid_code, :orcid_access_token)\";\n $st = $conn->prepare($sql);\n $st->bindValue(\":user_name\", $this->userName, PDO::PARAM_STR);\n\t$st->bindValue(\":user_password_hash\", $this->userPasswordHash, PDO::PARAM_STR);\n\t$st->bindValue(\":user_email\", $this->userEmail, PDO::PARAM_STR);\n $st->bindValue(\":orcid\", $this->orcid, PDO::PARAM_STR); \n $st->bindValue(\":orcid_code\", $this->orcidCode, PDO::PARAM_STR); \n $st->bindValue(\":orcid_access_token\", $this->orcidAccessToken, PDO::PARAM_STR); \n $st->execute();\n $this->id = $conn->lastInsertId();\n $conn = null;\n return $this->id;\n }", "public function addStudent($studentId = FALSE){\n\n if ($studentId) {\n $this->db->where('usr_id', $studentId);\n $this->db->update('user', array('usr_assigned_lecturer_id' => $this->session->userdata('id')));\n }\n }", "function user_id () {\r\n\t$info = user_info();\r\n\treturn (isset($info[0]) ? $info[0] : 0);\r\n}", "function getStudentInformation($STID){\n //By default, put nothing in here.\n\t\t$already_completed_parental_application=\"\";\t\t\n $housing_app_completed_in_system=\"\";\n $first_name=\"\";\n $last_name=\"\";\n $middle_name=\"\";\n $student_ID = \"\";\n $student_DATE_OF_BIRTH = \"\";\n $parental_email_address = \"\";\n $student_app_date = \"\";\n\n\n //As long as there is something in the search.\n while($row=oci_fetch_array($STID,OCI_ASSOC)){\n\t\t //Check whether or not they have already completed the Parental Agreement and if they have,\n //use this field to keep them from progressing forward within this application to move forward. (Onward to Page2.php)\n $already_completed_parental_application=$row[\"NC_SH_PRNTL_APPRVL\"];\n //Check whether or not they have a completed housing application on file.\n $housing_app_completed_in_system=$row[\"SS_STAT_INDICATOR\"];\n //Assign first name from the query lookup.\n $first_name = $row[\"FIRST_NAME\"];\n //Assign last name from the query lookup.\n $last_name = $row[\"LAST_NAME\"];\n //Assign middle name from the query lookup.\n $middle_name = $row[\"MIDDLE_NAME\"];\n //Assign the ID from the query lookup.\n $student_ID = $row[\"EMPLID\"];\n //Assign the student DOB to the query lookup.\n $student_DATE_OF_BIRTH = $row[\"BIRTHDATE\"];\n //Assign the email\n $parental_email_address = $row[\"EMAIL_ADDR\"];\n //Assign the application date\n $student_app_date_temp = $row[\"NC_PROCESS_DTTM\"];\n\t\t \n\t\t //For whatever reason, if there is a \" \" (BLANK) in the field, lets write blank, as it \n\t\t //will trigger the condition if the end-user does not have any information within the \"SS_STAT_INDICATOR\" field.\n\t\t //Create a condition that writes the word \"BLANK\" if there is nothing in the field.\n\t\t\t\n\t\t\t//Fields this affects\n\t\t\t//NC_SH_PRNTL_APPRVL (WHETHER THE END USER HAS ALREADY COMPLETED THIS WEB APPLICATION)\n\t\t\t//SS_STAT_INDICATOR (WHETHER THE STUDENT HAS A COMPLETED HOUSING APPLICATION)\n\t\t\t//MIDDLE_NAME (FOR SOME WILD REASON THE QUERY DOES NOT PULL A MIDDLE NAME FOR THE STUDENT).\t\t\t\n\t\t\t\n\t\t\t//Untouched below...\n\t\t\t/*\n\t\t\tif ($already_completed_parental_application==\" \"||$housing_app_completed_in_system==\" \"||$middle_name==\" \"){\n\t\t\t\t $already_completed_parental_application=\"BLANK\"; //Assign the word, BLANK, to whether or not the end user has completed this web application. \n $housing_app_completed_in_system=\"BLANK\";\t//Assign the word, BLANK, to the housing application status in MyPack Portal.\n\t\t\t\t $middle_name=\"BLANK\"; //Assign the word, BLANK, to the middle name pulled (remember to remove this on page3.php when it is displayed back to the user.)\n\t\t }\n\t\t\t*end untouched.\n\t\t\t*/\n\t\t\t//Changes added for the above wrong condition on 02/01/2016.\n\t\t\t//If the field for NC_SH_PRNTL_APPRVL is blank, set the value that's sent back to PAGE1 to BLANK.\n\t\t\tif ($already_completed_parental_application==\" \"){\n\t\t\t$already_completed_parental_application=\"BLANK\"; //Assign the word, BLANK, to whether or not the end user has completed this web application.\n\t\t\t}\n\t\t\t//If the SS_STAT_INDICATOR is blank, set the value that's sent back to PAGE1 to BLANK.\n\t\t\telse if($housing_app_completed_in_system==\" \"){\n\t\t\t$housing_app_completed_in_system=\"BLANK\";\t//Assign the word, BLANK, to the housing application status in MyPack Portal.\n\t\t\t}\n\t\t\t//If the Middle Name is blank, set the value back to Page1 to BLANK.\n\t\t\telse if($middle_name==\" \"){\n\t\t\t\t$middle_name=\"BLANK\";\n\t\t\t}\n\t\t\t//End changes on 02/01/2016.\t\t\n\t\t\t\n\t\t\t\n //End creating a condition...\n\t\t \n\t\t \n\t\t \n }\n\t\t\n\t\t //FORMAT OF NC_PROCESS_DTTM IS DD-MM-YY H:i:s.00000000 AM\n\t\t //Only return a set amount of information.\n\t\t //SHOULD RETURN DD-MM-YY\n\t\t $date_of_application_formatted = substr($student_app_date_temp,0,9);\n\t\t $student_app_date = $date_of_application_formatted;\n\t\t\n\t\t\n //Return information from the database lookup.\n //return $already_completed_parental_application.\" \".$housing_app_completed_in_system.\" \".$first_name.\" \".$last_name.\" \".$middle_name.\" \".$student_ID.\" \".$student_DATE_OF_BIRTH.\" \".$parental_email_address.\" \".$student_app_date;\n\t\t\n\t\t//To prevent empty fields from breaking the communication between this file and the scripts/checkInformation.js that is \n\t\t//used within the /parental_consent/scripts/ let's make the field separator a \",\" (comma) vs an empty field.\n\t\treturn $already_completed_parental_application.\",\".$housing_app_completed_in_system.\",\".$first_name.\",\".$last_name.\",\".$middle_name.\",\".$student_ID.\",\".$student_DATE_OF_BIRTH.\",\".$parental_email_address.\",\".$student_app_date.\",\";\n\t\t\n\t}", "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 createEnterpriseUser($input);", "function insert() {\n if (!\\MongoId::isValid($this->getProvider()->getId())) {\n if ($this->getContext()->getUser()->isAuthenticated()) {\n $provider = $this->getContext()->getUser()->getUserDetails()->getProvider()->getId();\n if (\\MongoId::isValid($provider->getId())) {\n $this->setProvider($provider);\n } else {\n throw new \\Exception(\"Cannot assign staff member to the current provider. Please log out and try again.\");\n }\n }\n }\n if (trim($this->getUsername()) == '') {\n $this->setUsername(\\Ficus\\Counter::getNextCounter('STAFF'));\n }\n return parent::insert();\n }", "public function studentProfile($student_name,$user_id) {\n\t\t//assign public class values to function variable\n\t\t$data = $this->data;\n\t\t$data['common_data'] = $this->common_data;\n\t\t$data['page'] = 'my_profile';\n\t\t$data['pageName'] = 'My Profile';\n\t\tif(isset($data['common_data']['user_data']['role']) && $data['common_data']['user_data']['role'] == INACTIVE_STATUS_ID){\n\t\t\theader(\"Location: \".ROUTE_PROFILE);\n\t\t\tdie();\n\t\t}\n\t\t$data['user_details'] = $this->user_model->getUserById($user_id);\n\t\tif(preg_replace(\"/&([a-z])[a-z]+;/i\", \"$1\", htmlentities(strtolower(str_replace(' ', '', $data['user_details']['first_name'])))) != preg_replace(\"/&([a-z])[a-z]+;/i\", \"$1\", htmlentities(strtolower(str_replace(' ', '', $tutor_name))))){\n\t\t\theader(\"Location: \".ROUTE_ERROR_PAGE);\n\t\t\tdie();\n\t\t}\n\t\t$data['student_subjects'] = $this->user_model->getSubjectsByStudentId($user_id);\n\t\t$student_subjects_id = $this->profile_model->getSubjectsByStudentId($user_id);\n\t\t$subject_id = \"\";\n\t\tif(!empty($student_subjects_id)){\n\t\t\tforeach ($student_subjects_id as $sub_id){\n\t\t\t\t$subject_id .= $sub_id.\",\";\n\t\t\t}\n\t\t}\n\t\t$data['related_students'] = \"\";\n\t\tif(!empty($subject_id)){\n\t\t\t$subject_id = rtrim($subject_id,',');\n\t\t\t$data['related_students'] = $this->profile_model->relatedStudents($subject_id,$user_id);\n\t\t}\n\t\t$data['student_reviews'] = $this->reviews_model->getStudentReviews($user_id);\n\t\tif(empty($data['user_details']) || $data['user_details']['role'] != STUDENT){\n\t\t\theader(\"Location: \".ROUTE_ERROR_PAGE);\n\t\t\tdie();\n\t\t}\n\t\t$template['body_content'] = $this->load->view('frontend/profile/student-profile', $data, true);\t\n\t\t$this->load->view('frontend/layouts/template', $template, false);\n\t}", "function get_user_id()\r\n {\r\n return $this->user->get_id();\r\n }", "public function getUserIdentifier()\n {\n // that's why I am sending the id here\n return $this->id;\n }", "public function actionCreate()\n {\n $session = \\yii::$app->session;\n $user_type = $session->get('type',-1);\n\n $model = new Student();\n $user = new User();\n\n if ($model->load(Yii::$app->request->post())) {\n $stu = User::findOne($model->user_id);\n if($stu !== null){\n $model->addError('user_id', 'ID exists');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n $user->id = $model->user_id;\n $user->username = strval($model->user_id);\n $user->password = '#'.$model->stu_ssn;\n $user->user_type = 2;\n if($model->stu_cost === ''){\n $model->stu_cost = 0;\n }\n if($user->save()) {\n if ($model->save()) {\n return $this->redirect(['view', 'id' => $model->user_id]);\n }\n else{\n $user->delete();\n }\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public static function SID_to_userid($sid)\n {\n if (strncmp($sid, \"S-\", 2) != 0)\n {\n $sid = ActiveDirectory::SID_to_string($sid);\t// Make sid human-readable.\n }\n\n // sid is now a human-readable string:\n $fields = explode(\"-\", $sid, 18);\n // 0 = 'S-'\n // 1 = revisionLevel\n // 2 = identifierAuthority \n // 3 ... 17 = subAuthorities\n\n $num_fields = count($fields);\n if ($num_fields < 4 or $num_fields > 18 or $fields[0] !=\"S\" or\n intval($fields[1]) != Secrets::SID_REV_LVL or \n intval($fields[2]) != Secrets::SID_ID_AUTH or\n !ActiveDirectory::match_subauth($fields, Secrets::SID_SUBAUTH)) {\n echo(\"<br/>In SID_to_userid() !!!!!!!!!!!!!!! <br/>\");\n var_dump($sid);\n //exit();\n throw new \\UnexpectedValueException('Malformed SID.');\n }\n\n // Which fields vary from person to person?\n $unique_start = 3 + count(Secrets::SID_SUBAUTH);\n $num_unique = $num_fields - $unique_start;\n $uid = 0;\n for ($i = 0; $i < $num_unique; $i++) {\n // Each sub-auth is a 32bit unsigned long:\n $uid += intval($fields[$i + $unique_start]) << (32 * $i);\n }\n\n return $uid;\n }", "protected function getUserId() {}", "protected function getUserId() {}", "public function __construct($userName_or_arborId, $nameOnly = true) { \r\n if (isset($_SESSION['studentDetail'])) {\r\n Config::debug(\"Student::__construct: session detail found\");\r\n if ($_SESSION['studentDetail']['arborId'] == $userName_or_arborId ||\r\n (isset($_SESSION['studentDetail']['userName']) && $_SESSION['studentDetail']['userName'] == $userName_or_arborId)) {\r\n $this->detail = $_SESSION['studentDetail'];\r\n return;\r\n }\r\n Config::debug(\"Student::__construct: session detail found, but not matched\");\r\n }\r\n \r\n Config::debug(\"Student::__construct: no session detail found\");\r\n \r\n $this->client = new GraphQLClient();\r\n\r\n if (is_numeric($userName_or_arborId)) {\r\n $this->detail['arborId'] = $userName_or_arborId;\r\n } else {\r\n $this->detail['userName'] = $userName_or_arborId;\r\n /* Ugh, got to look up using email address */\r\n Config::debug(\"Student::__construct: looking for email\");\r\n $emailAddress = $userName_or_arborId . \"@\" . Config::$site_emaildomain;\r\n $emailQuery = \"{ EmailAddress (emailAddress: \\\"$emailAddress\\\") { emailAddressOwner { id }}}\";\r\n $emailAddress = $this->client->rawQuery($emailQuery)->getData()['EmailAddress'];\r\n Config::debug(\"Student::__construct: query complete\");\r\n if (!isset($emailAddress[0])) {\r\n die(\"Your email address \" . $userName_or_arborId . '@' . Config::$site_emaildomain .\" appears unrecognised.\");\r\n }\r\n if (isset($emailAddress[1])) {\r\n die(\"Your email address appears to have more than one owner. This cannot possibly be right\");\r\n }\r\n if ($emailAddress[0]['emailAddressOwner']['entityType'] != 'Student') {\r\n die(\"Your email address \" . $userName_or_arborId . '@' . Config::$site_emaildomain .\" appears not to belong to a student.\");\r\n }\r\n Config::debug(\"Student::__construct: email found\");\r\n $this->detail['arborId'] = $emailAddress[0]['emailAddressOwner']['id'];\r\n }\r\n $id = $this->detail['arborId'];\r\n $this->query = <<<EOF\r\nStudent (id: $id) {\r\n id\r\n preferredFirstName\r\n preferredLastName\r\n academicLevel {\r\n id\r\n shortName\r\n }\r\n}\r\nEOF;\r\n $queryForBehaviourPoints = false;\r\n if (!$nameOnly) {\r\n /* Before we query Arbor, let's see if we have them cached */\r\n if ($this->getBehaviourNetPointsFromCache() == false) {\r\n $queryForBehaviourPoints = true;\r\n if (empty(Config::$queryMyDshs)) {\r\n $ayEve = $this->getAY('eve');\r\n $ayPost = $this->getAY('post');\r\n $this->query .= <<<EOF\r\n BehaviouralIncidentStudentInvolvement (student__id: $id behaviouralIncident__incidentDatetime_before: \"$ayPost\" behaviouralIncident__incidentDatetime_after: \"$ayEve\") {\r\n severity\r\n student {\r\n academicLevel {\r\n shortName\r\n }\r\n }\r\n }\r\n PointAward (student__id: $id awardedDatetime_before: \"$ayPost\" awardedDatetime_after: \"$ayEve\") {\r\n points\r\n }\r\n EOF;\r\n }\r\n }\r\n }\r\n \r\n $this->query = \"query { $this->query }\";\r\n $result = $this->client->rawQuery($this->query)->getData();\r\n \r\n foreach (['preferredFirstName', 'preferredLastName'] as $n) {\r\n $this->detail[$n] = $result['Student'][0][$n];\r\n }\r\n $matches = [];\r\n if (preg_match('/[1-9][0-9]*|[0RKN]$/', $result['Student'][0]['academicLevel']['shortName'], $matches) == 0) {\r\n die(\"Student {$this->getFirstName()} {$this->getLastName()}'s year group {$result['Student'][0]['academicLevel']['shortName']} is invalid.\");\r\n }\r\n $this->detail['yearGroup'] = $matches[0];\r\n if ($queryForBehaviourPoints) {\r\n if (empty(Config::$queryMyDshs)) {\r\n $p = 0;\r\n foreach ($result['BehaviouralIncidentStudentInvolvement'] as $i) {\r\n $p += $i['severity'];\r\n }\r\n foreach ($result['PointAward'] as $i) {\r\n $p += $i['points'];\r\n }\r\n } else {\r\n $client = new \\GuzzleHttp\\Client(['base_uri' => Config::$queryMyDshs, 'timeout' => 1.0,]);\r\n $key = Config::$queryMyDshsApiKey;\r\n try {\r\n $response = $client->get(\"{$this->getId()}/praise-points/total\",\r\n ['headers' => [ 'Authorization' => \"Bearer $key\",],]\r\n );\r\n \r\n } catch (\\Exception $e) {\r\n die(\"There has been a problem communicating with MyDSHS.\");\r\n }\r\n $p = (string)$response->getBody();\r\n if (!is_numeric($p)) {\r\n echo \"<pre>\" . $response->getBody() . \"</pre>\";\r\n die(\"There has been a problem communicating with MyDSHS.\");\r\n }\r\n }\r\n $this->detail['behaviourNetPoints'] = $p;\r\n $this->db->dosql(\"INSERT INTO pointsCache (arbor_id, arborPoints) VALUES ('\"\r\n . $this->getId() . \"', '\"\r\n . $this->getBehaviourNetPoints() . \"');\");\r\n }\r\n if (isset ($_SESSION)) {\r\n $_SESSION['studentDetail'] = $this->detail;\r\n }\r\n }", "public function add()\n\t{\n\t\t// TODO\n\t\t// if(user has permissions){}\n\t\t$this -> loadModel('User');\n\t\tif($this -> request -> is('post') && !$this -> User -> exists($this -> request -> data['SgaPerson']['user_id']))\n\t\t{\n\t\t\t$this -> Session -> setFlash(\"Please select a valid JacketPages user to add.\");\n\t\t\t$this -> redirect(array('action' => 'index',$id));\n\t\t}\n\t\t$this -> loadModel('User');\n\t\tif ($this -> request -> is('post'))\n\t\t{\n\t\t\t$this -> SgaPerson -> create();\n\t\t\tif ($this -> SgaPerson -> save($this -> data))\n\t\t\t{\n\t\t\t\t$user = $this -> User -> read(null, $this -> data['SgaPerson']['user_id']);\n\t\t\t\t$this -> User -> set('level', 'sga_user');\n\t\t\t\t$this -> User -> set('sga_id', $this -> SgaPerson -> getInsertID());\n\t\t\t\t$this -> User -> save();\n\t\t\t\t$this -> Session -> setFlash(__('The user has been added to SGA.', true));\n\t\t\t\t$this -> redirect(array('action' => 'index'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this -> Session -> setFlash(__('Invalid user. User may already be assigned a role in SGA. Please try again.', true));\n\t\t\t}\n\t\t}\n\t}", "function create_user($data) {\n\t\t$data['created'] = date('Y-m-d H:i:s');\n\n\t\tif ($this->db->insert($this->table_name, $data)) {\n\t\t\t$user_id = $this->db->insert_id();\n\t\t\treturn array('user_id' => $user_id);\n\t\t}\n\t\treturn NULL;\n\t}", "function AddStudent($first_name, $last_name, $email, $hashed_pass, $mysqli){\n\n $date = date(\"Y-m-d\");\n $sql = \"INSERT INTO student (First_name, Last_name, Email_address, Password, Registerred_date, Validated, Banned, Number_of_reports) VALUES ('$first_name', '$last_name','$email', '$hashed_pass', '$date', FALSE, FALSE, '0')\";\n\n if($mysqli->query($sql) === TRUE){\n return $mysqli->insert_id;\n }\n else{\n return 0;\n }\n}", "function create_user()\n{\n\t// Check to see if the account is admin\n\t$account_type = account_type();\n\t\n\tif ( $account_type == 0 )\n\t{\n\t\t// Connect to the database\n\t\t$link = dbConnect();\n\t\t\n\t\t$query = mysql_query( \"SELECT first_name, last_name FROM BCD_User WHERE username = '\" . $_SESSION[ 'username' ] . \"'\" );\n\t\t\n\t\t// Close the database\n\t\tdbClose( $link );\n\t}\n}", "public function get_user_id()\n {\n return self::getUser();\n }", "public function createUser($uid, $fullname, $phone_no, $email, $login_with){\n\n if(!$this->isUserIdExist($uid)){\n $stmt = $this->con->prepare(\"INSERT INTO users (uid, fullname, phone_no, email, login_with,reg_date) VALUES (?,?,?,?,?,?);\");\n $stmt->bind_param(\"ssssss\",$uid, $fullname, $phone_no, $email, $login_with,$reg_date);\n $reg_date = date(\"Y-m-d\").' '.date(\"H:i:s\");\n if($stmt->execute()){\n return USER_CREATED;\n }else{\n return USER_FAILURE;\n }\n }\n return USER_EXISTS;\n }", "public function getUserID(){\n return($this->userID);\n }", "public function identity()\r\n {\r\n\t\t$storage = $this->get_storage();\r\n\r\n if ($storage->is_empty()) {\r\n return null;\r\n }\r\n if( is_null(self::$login_user) ){\r\n $u = $storage->read();\r\n\t\t\tself::$login_user = Model_User::instance()->user($u['uid']);\r\n \r\n global $VIEW_AUTH_USERID;\r\n $VIEW_AUTH_USERID = idtourl(self::$login_user['uid']);\r\n }\r\n return self::$login_user; \r\n }", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "function addNewUser($SHSCID,$FirstName,$LastName,$Email){\n global $mysqli;\n $result = true;\n $q = \"INSERT INTO Clinician VALUES ('$SHSCID','$FirstName','$LastName','$Email', 0)\";\n $result = $mysqli->query($q);\n \n if ($result) \n\treturn \"success\";\n\telse\n\treturn $mysqli->error;\n}", "public function get_uid() {\n\t\treturn 'create';\n\t}", "public function executeAddStudent(sfWebRequest $request)\n {\n $formData = $request->getPostParameters();\n \n // Get database connection\n $conn = Doctrine_Manager::getInstance();\n $this->guard_user_collection = new Doctrine_Collection('sfGuardUser');\n $this->student_user_collection = new Doctrine_Collection('StudentUser');\n\n // fetch the first 'domain' from the table and set it to $domain\n try {\n $domain = Doctrine_Core::getTable('Email')->createQuery('a')->fetchOne()->getDomain();\n } catch (Exception $e) {\n $this->getUser()->setFlash('error', 'Unable to find a domain record. Please check the email_domain table.');\n $this->redirect('project/tool');\n }\n \n $guard_user = new sfGuardUser();\n $password = $this->random_password();\n \n $guard_user->setEmailAddress('[email protected]');\n $guard_user->setUsername($formData['snum']);\n $guard_user->setPassword($password); \n $guard_user->setFirstName($formData['fName']);\n $guard_user->setLastName($formData['lName']);\n $guard_user->setIsActive(true);\n $guard_user->setIsSuperAdmin(false);\n $this->guard_user_collection->add($guard_user);\n\n $user = new StudentUser();\n $user->snum = $formData['snum'];\n $user->first_name = $formData['fName'];\n $user->last_name = $formData['lName'];\n $this->student_user_collection->add($user);\n \n // Commit the new student into database\n try {\n $this->student_user_collection->save();\n $this->guard_user_collection->save();\n } catch (Doctrine_Connection_Mysql_Exception $e) {\n $this->getUser()->setFlash('error', 'Failed to import students. Please check for duplicated entries and try again. Message: ' . $e->getMessage());\n $this->redirect('project/tool');\n }\n \n //call to the email \n $emailAttempt = $this->emailPassword($user->snum, $user->first_name, $user->last_name);\n if ($emailAttempt != null)//null is recieved if successful, $snum if not\n {\n $this->getUser()->setFlash('error', 'Added Student Successfully. Email NOT sent to s' . $formData['snum'] . '@'. $domain);\n $this->redirect('project/tool');\n }\n else \n {\n //notice including the added student number\n $this->getUser()->setFlash('notice', 'Student \"'.$formData['snum'].'\" added successfully.');\n $this->redirect('project/tool');\n }\n }", "function assign_user()\n\t{\n\t\tglobal $current_user;\n\t\t$ass_user = $this->column_fields[\"assigned_user_id\"];\t\t\n\t\tif( $ass_user != $current_user->id)\n\t\t{\n\t\t\t$result = $this->db->query(\"select id from ec_users where user_name = '\".$ass_user.\"' or last_name = '\".$ass_user.\"'\");\n\t\t\tif($this->db->num_rows($result) != 1)\n\t\t\t{\n\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $current_user->id;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\n\t\t\t\t$row = $this->db->fetchByAssoc($result, -1, false);\n\t\t\t\tif (isset($row['id']) && $row['id'] != -1)\n \t {\n\t\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $row['id'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->column_fields[\"assigned_user_id\"] = $current_user->id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function create()\n {\n return $this->db->putUser($this->getDefaultAttributes());\n }", "final static public function CreateUser(){\n\t\t\n\t\t$wr = static::validation();\n\t\t$record = new static::$modelNM();\t//instantiate new object\n\t\t$record->username = $_POST[\"username\"];\n\t\t$record->fname = $_POST[\"fname\"];\n\t\t$record->lname = $_POST[\"lname\"];\n\t\t$record->gender = $_POST[\"gender\"];\n\t\t$record->phone = $_POST[\"phone\"];\n\t\t$record->birthday = $_POST[\"birthday\"];\n\t\t$record->email = $_POST[\"email\"];\n\t\t$record->addhashpassword($_POST[\"password\"]);\n\n\n\t\tif($wr != \"\") {\n\t\t\techo $wr;\n\t\t\t$_SESSION[\"Temprecord\"] = $record;\n\t\t\treturn NULL;\n\t\t} else {\n\t\t\t//$_SESSION[\"Temprecord\"] = NULL;\n\t\t}\n\t\t\n\t\n\t\t$record->GoFunction(\"Insert\");\t//Run Insert() in modol class and echo success or not\n\t\tsetcookie(\"Username\", $_POST[\"username\"], time() + (86400 * 30), \"/\");\n\t\treturn 1;\t//return display html table code from ShowData\n\t}", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "function get_user () {\n\t\treturn $this->user_id;\n\t}", "function getUserID($sUsername) {\n global $default;\n\n $id = lookupID($default->users_table, \"username\", $sUsername);\n\n $this->iId = $id;\n }", "abstract protected function getUser();", "function new_user($firstName,$lastName,$email,$password){\t\n $salt = generate_salt();\n $encPassword = encrypt_password($password,$salt);\n\n //$user = create_user_object($firstName,$lastName,$email,$encPassword,$salt,$userType);\n save_user_info($firstName,$lastName,$email,$encPassword,$salt);\n \n return true;\n}", "public function getT_StudentID($rno)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql=\"select student_id from student where student_rollNo=:sno\";\n\t\t\t\t\t\t\t$this->openDB();\n\t\t\t\t\t\t\t$this->prepareQuery($sql);\n\t\t\t\t\t\t\t$this->bindQueryParam(':sno',$rno);\t\t\t\t\t\t \n\t\t\t\t\t\t\t$result=$this->executeQuery();\n\t\t\t\t\t\t $this->closeDB();\n\t\t\t\t\t\t return $result;\n\t\t\t\t\t}", "public function addstudent($Xstu,$stunum,$stuname,$sex,$classname)\n\t{\n\t\t// $data['id'] = NULL;\n\t\t$data['Xstu'] = $Xstu;\n\t\t$data['stunum'] = $stunum;\n\t\t$data['stuname'] = $stuname;\n\t\t$data['sex'] = $sex;\n\t\t$data['classname']=$classname;\n\t\t$this->data($data,true)->isUpdate(false)->save();\n\t\t// $this->id=NULL;\n\t\t// $addstudent->Xstu = $Xstu;\n\t\t// $addstudent->stunum = $stunum;\n\t\t// $addstudent->stuname = $stuname;\n\t\t// $addstudent->sex = $sex;\n\t\t// $addstudent->save();\n\t\t// 获取自增ID\n\t\t// echo $this->id;\n\t}", "function get_uid($uid){\n\t\t$this->uid = $uid;\n\t}" ]
[ "0.674963", "0.621119", "0.6153856", "0.6140616", "0.60628843", "0.5982785", "0.5963221", "0.59045786", "0.58852434", "0.5839819", "0.5813154", "0.5811203", "0.5809368", "0.5800788", "0.5797575", "0.57789135", "0.5754408", "0.5737554", "0.57173586", "0.5713428", "0.57105273", "0.5702972", "0.5688522", "0.56652766", "0.5660962", "0.56468284", "0.56402564", "0.5627701", "0.5618791", "0.56052566", "0.55917466", "0.5584712", "0.5558491", "0.5549992", "0.5548278", "0.5545931", "0.5523623", "0.55113506", "0.5506221", "0.55011874", "0.54965794", "0.54811543", "0.5475306", "0.5463806", "0.5456971", "0.5435912", "0.5430939", "0.5420309", "0.5416539", "0.54060656", "0.5403325", "0.53910613", "0.53869176", "0.5371897", "0.5366416", "0.53586537", "0.53494596", "0.5345778", "0.5345178", "0.5341567", "0.53360766", "0.5334309", "0.53301334", "0.53175247", "0.53119445", "0.53091365", "0.530591", "0.5291136", "0.5278878", "0.5273531", "0.5273531", "0.52662313", "0.52583706", "0.5257408", "0.5255173", "0.52515477", "0.5245717", "0.5235792", "0.5235265", "0.52345634", "0.5234494", "0.5234128", "0.52299154", "0.52274", "0.5227138", "0.5224293", "0.52242243", "0.52206016", "0.52206016", "0.52206016", "0.52206016", "0.52206016", "0.52206016", "0.52143055", "0.5214172", "0.52129495", "0.5212727", "0.52022904", "0.5201438", "0.52011085" ]
0.59452975
7
Jamie Alnasir, created. Obtain RHUL User's given LDAP Field from currently logged in, LDAP authenticated RHUL user
function getRHUL_LDAP_FieldValue($aField) { if ( is_user_logged_in() ) { global $wpdb; $wp_user = strtoupper(wp_get_current_user()->user_login); // Get currently logged-in Wordpress user $sql = "SELECT meta_value FROM cswp_usermeta WHERE meta_key = '" . $aField . "' AND user_id = " . "(SELECT user_id FROM cswp_usermeta WHERE meta_key = 'adi_samaccountname' AND meta_value = '" . $wp_user . "');"; $results = $wpdb->get_results($sql); return $results[0]->meta_value; } else { return ""; // Return empty string if field/value not found } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function user_create($attributes){\n //check for compulsory fields\n if (!array_key_exists(\"username\",$attributes)){ return (\"Missing compulsory field [username]\"); }\n if (!array_key_exists(\"firstname\",$attributes)){ return (\"Missing compulsory field [firstname]\"); }\n if (!array_key_exists(\"surname\",$attributes)){ return (\"Missing compulsory field [surname]\"); }\n if (!array_key_exists(\"email\",$attributes)){ return (\"Missing compulsory field [email]\"); }\n if (!array_key_exists(\"container\",$attributes)){ return (\"Missing compulsory field [container]\"); }\n if (!is_array($attributes[\"container\"])){ return (\"Container attribute must be an array.\"); }\n\n if (array_key_exists(\"password\",$attributes) && !$this->_use_ssl){ \n // Modified by SysCo/al\n $this->_error = TRUE;\n $this->_error_message = 'FATAL: SSL must be configured on your webserver and enabled in the class to set passwords.';\n exit();\n }\n\n if (!array_key_exists(\"display_name\",$attributes)){ $attributes[\"display_name\"]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"]; }\n\n //translate the schema\n $add=$this->adldap_schema($attributes);\n \n //additional stuff only used for adding accounts\n $add[\"cn\"][0]=$attributes[\"display_name\"];\n $add[$this->_cn_identifier][0]=$attributes[\"username\"];\n $add[\"objectclass\"][0]=\"top\";\n $add[\"objectclass\"][1]=\"person\";\n $add[\"objectclass\"][2]=\"organizationalPerson\";\n $add[\"objectclass\"][3]=\"user\"; //person?\n //$add[\"name\"][0]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"];\n\n //set the account control attribute\n $control_options=array(\"NORMAL_ACCOUNT\");\n if (!$attributes[\"enabled\"]){ $control_options[]=\"ACCOUNTDISABLE\"; }\n $add[\"userAccountControl\"][0]=$this->account_control($control_options);\n //echo (\"<pre>\"); print_r($add);\n\n //determine the container\n $attributes[\"container\"]=array_reverse($attributes[\"container\"]);\n $container=\"OU=\".implode(\",OU=\",$attributes[\"container\"]);\n\n //add the entry\n $result=@ldap_add($this->_conn, \"CN=\".$add[\"cn\"][0].\", \".$container.\",\".$this->_base_dn, $add);\n if ($result!=true){ return (false); }\n \n return (true);\n }", "function getRHUL_FirstName() {\n return getRHUL_LDAP_FieldValue(\"first_name\");\n}", "public function getUserfield();", "function user_info($username,$fields=NULL){\n if ($username==NULL){ return (false); }\n if (!$this->_bind){ return (false); }\n if ('' == $this->_users_dn) {\n $this->_users_dn = $this->_base_dn;\n }\n\n $filter = \"(&(\".$this->_cn_identifier.\"=\".$username.\"))\";\n if ($fields==NULL){ $fields=array($this->_cn_identifier,\"mail\",$this->_group_attribute,\"department\",\"description\",\"displayname\",\"gecos\",\"telephonenumber\",\"primarygroupid\"); }\n $sr=ldap_search($this->_conn,$this->_users_dn,$filter,$fields);\n $entries = $this->ldap_get_entries_raw($sr);\n \n // AD does not return the primary group in the ldap query, we may need to fudge it\n // SysCo/al added a test to check if $entries[0][\"primarygroupid\"][0] exists\n $add_primary_group = FALSE;\n if ($this->_real_primarygroup){\n if (isset($one_entry[\"primarygroupid\"][0])) {\n $pri_grp_rid = $one_entry[\"primarygroupid\"][0];\n if (isset($this->_cache_group_dn[$pri_grp_rid])) {\n $dn_group = $this->_cache_group_dn[$pri_grp_rid];\n $one_entry[$this->_group_attribute][] = $dn_group;\n $add_primary_group = TRUE;\n } else {\n $r = ldap_read($this->_conn, $this->_base_dn, \"(objectclass=*)\", array(\"objectSid\")) or exit();\n $data = ldap_get_entries($this->_conn, $r);\n if (isset($data[0][\"objectsid\"][0])) {\n $domain_sid = $data[0][\"objectsid\"][0];\n $domain_sid_s = sid2str($domain_sid);\n $r = ldap_search($this->_conn, $this->_base_dn, \"objectSid=\".$domain_sid_s.\"-\".$pri_grp_rid, array(\"distinguishedname\")) or exit();\n $data = ldap_get_entries($this->_conn, $r);\n if (isset($data[0][\"distinguishedname\"][0])) {\n $dn_group = $data[0][\"distinguishedname\"][0];\n $one_entry[$this->_group_attribute][] = $dn_group;\n $add_primary_group = TRUE;\n if (count($this->_cache_group_dn) < 1000) { // Don't overload the memory cache\n $this->_cache_group_dn[$pri_grp_rid] = $dn_group;\n }\n }\n }\n }\n }\n } else {\n $entries[0][$this->_group_attribute][]=\"CN=Domain Users,CN=Users,\".$this->_base_dn;\n $add_primary_group = TRUE;\n }\n if ($add_primary_group) {\n @$entries[0][$this->_group_attribute][\"count\"]++;\n }\n\n return ($entries);\n }", "function ldap_auth_create_user($username, $data) {\n\t// Check that we have the values. register_user() will take\n\t// care of more detailed validation.\n\t$firstname = elgg_extract('firstname', $data);\n\t$lastname = elgg_extract('lastname', $data);\n\t$email = elgg_extract('mail', $data);\n\t$password = substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', mt_rand(1,10))),1,20);\n\n\t// Combine firstname and lastname\n\t$name = implode(' ', array($firstname, $lastname));\n \n\ttry {\n\t\t$guid = register_user($username, $password, $name, $email);\n\t} catch (Exception $e) {\n\t\tregister_error($e->getMessage());\n\t\treturn false;\n\t}\n\n\tif (!$guid) {\n\t\tregister_error(elgg_echo('ldap_auth:no_register'));\n\t\telgg_log(\"Failed to create an account for LDAP user $username\");\n\t\treturn false;\n\t}\n\n\t$user = get_entity($guid);\n\n\t// Allow plugins to respond to the registration\n\t$params = array(\n\t\t'user' => $user,\n\t\t'ldap_entry' => $data,\n\t);\n\n\tif (!elgg_trigger_plugin_hook('register', 'user', $params, true)) {\n\t\t// For some reason one of the plugins returned false.\n\t\t// This most likely means that something went wrong\n\t\t// and we will have to remove the user.\n\t\t$user->delete();\n\n\t\tregister_error(elgg_echo('registerbad'));\n\n\t\treturn false;\n\t}\n\n\t// Validate the user\n\telgg_set_user_validation_status($guid, true, 'LDAP plugin based validation');\n\n\treturn true;\n}", "protected function _createUser() {\n\t\t$user = System_Locator_TableLocator::getInstance()->get('User')->createRow();\n\t\t$user->username = $this->getUsername();\n\t\t$user->setPassword($this->getPassword());\n\t\t$user->email = $this->getEmail();\n\t\t$user->countryCode = $this->getCountryCode();\n\t\t$user->createdAt = date(DATE_ISO8601); \n\t\treturn $user;\n\t}", "function user_create($data){\n if(isset($data['umd_val'])){\n $dval = $data['umd_val'];\n } else if(count($this->domain_seq)){\n $dval = $this->domain_seq[0];\n } else {\n return 2;\n }\n if(!isset($this->domains[$dval])) return 2;\n if(!in_array($dval,$this->quest_provider('d:user','create',TRUE,FALSE)))\n return 3;\n $tmp = $this->domains[$dval]->user_create($data);\n if($tmp>0) return $tmp;\n foreach($this->domains as $cd) $cd->cache_clear();\n return $this->vdn_make($data['uname'],$dval);\n }", "public function user_create($attributes){\n // Check for compulsory fields\n if (!array_key_exists(\"username\",$attributes)){ return (\"Missing compulsory field [username]\"); }\n if (!array_key_exists(\"firstname\",$attributes)){ return (\"Missing compulsory field [firstname]\"); }\n if (!array_key_exists(\"surname\",$attributes)){ return (\"Missing compulsory field [surname]\"); }\n if (!array_key_exists(\"email\",$attributes)){ return (\"Missing compulsory field [email]\"); }\n if (!array_key_exists(\"container\",$attributes)){ return (\"Missing compulsory field [container]\"); }\n if (!is_array($attributes[\"container\"])){ return (\"Container attribute must be an array.\"); }\n\n if (array_key_exists(\"password\",$attributes) && (!$this->_use_ssl && !$this->_use_tls)){ \n throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');\n }\n\n if (!array_key_exists(\"display_name\",$attributes)){ $attributes[\"display_name\"]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"]; }\n\n // Translate the schema\n $add=$this->adldap_schema($attributes);\n \n // Additional stuff only used for adding accounts\n if (isset($attributes['cn'])) {\n \t$add['cn'][0]=$attributes['cn']; // EXTENDED by CST\n } else {\n \t$add[\"cn\"][0]=$attributes[\"display_name\"];\n }\n $add[\"samaccountname\"][0]=$attributes[\"username\"];\n $add[\"objectclass\"][0]=\"top\";\n $add[\"objectclass\"][1]=\"person\";\n $add[\"objectclass\"][2]=\"organizationalPerson\";\n $add[\"objectclass\"][3]=\"user\"; //person?\n //$add[\"name\"][0]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"];\n\n // Set the account control attribute\n $control_options=array(\"NORMAL_ACCOUNT\");\n if (!$attributes['enabled']){ $control_options[]=\"ACCOUNTDISABLE\"; }\n $add[\"userAccountControl\"][0]=$this->account_control($control_options);\n //echo (\"<pre>\"); print_r($add);\n\n // Determine the container\n $attributes[\"container\"]=array_reverse($attributes[\"container\"]);\n $container=\"OU=\".implode(\",OU=\",$attributes[\"container\"]);\t\t\n\t\t\n\t\t// Add the entry\n\t\t$result=@ldap_add($this->_conn, \"CN=\".$add[\"cn\"][0].\", \".$container.\",\".$this->_base_dn, $add); \n if ($result!=true){ return (false); }\n\t\t\n return (true);\n }", "function get_user_by($field, $value)\n {\n }", "function create_user()\n{\n\t// Check to see if the account is admin\n\t$account_type = account_type();\n\t\n\tif ( $account_type == 0 )\n\t{\n\t\t// Connect to the database\n\t\t$link = dbConnect();\n\t\t\n\t\t$query = mysql_query( \"SELECT first_name, last_name FROM BCD_User WHERE username = '\" . $_SESSION[ 'username' ] . \"'\" );\n\t\t\n\t\t// Close the database\n\t\tdbClose( $link );\n\t}\n}", "function ldap_get_user($username_or_email, $db) {\n if( is_mail($username_or_email) && $db->mailExists($username_or_email) ) {\n return $db->getUserWithMail($username_or_email);\n }\n if($db->userExists($username_or_email)) {\n return $db->getUser($username_or_email);\n }\n return false;\n}", "public function creer_user() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$userdata = $this->creer_definition_user_create_ws ();\n\t\t$this->onDebug ( $userdata, 1 );\n\t\treturn $this->getObjetZabbixWsclient ()\n\t\t\t->userCreate ( $userdata );\n\t}", "public function createUser () {\n syslog( LOG_INFO, 'Create a Lineberty User \\n' );\n\n $url = '/users';\n\n return $this->runRequest($url, 'POST', null);\n }", "function getLdapEntry()\n\t{\n\t\trequire_once ('./include/functions.php');\t// for password_hash()\n\n\t\t// Required\n\t\t$entry['uid'][0] = $this->username;\n\t\t$entry['sn'][0] = $this->surname;\n\t\t$entry['cn'][0] = $this->commonName;\n\n\t\t// Optional\n\t\tif ($this->givenname) {\n\t\t\t$entry['givenname'][0] = $this->givenname;\n\t\t}\n\t\tif ($this->password) {\n\t\t\t$entry['userPassword'][0] = password_hash($this->password, $this->pw_hash);\n\t\t}\n\t\tif ($this->description) {\n\t\t\t$entry['description'][0] = $this->description;\n\t\t}\n\t\tif ($this->telephoneNumber) {\n\t\t\t$entry['telephonenumber'][0] = $this->telephoneNumber;\n\t\t}\n\t\tif ($this->mail) {\n\t\t\t$entry['mail'][0] = $this->mail;\n\t\t}\n\t\tif ($this->organizationName) {\n\t\t\t$entry['o'][0] = $this->organizationName;\n\t\t}\n\n\t\t// Required (objectClass)\n\t\t$entry['objectClass'][0] = 'inetOrgPerson';\n\t\t$entry['objectClass'][1] = 'top';\n\n\t\treturn $entry;\n\t}", "function addLDAPUser($user_username, $user_password, $user_email, $user_namelast, $user_namefirst,$app_auto_user_activate){\n\t\t$this->db->sql('select * from users where username=:username limit 1');\n\t\t$this->db->addParam(\":username\",$user_username);\n\t\t$this->user_result = $this->db->execute();\n\t\t\n\t\t//if the user name doesn't exist add it and mark it as LDAP\n\t\tif( $this->db->getResultCount() == 0 ){\n\t\t\t$user_password = MD5($user_password);\n\t\t\t$this->db->sql('insert into user_audit_login (username, password, email, name_last, name_first, is_activated, is_ldap )values(:username, :password, :email, :name_last, :name_first, :is_activated, :is_ldap)');\n\t\t\t$this->db->addParam(\":username\",$user_username);\n\t\t\t$this->db->addParam(\":password\",$user_password);\n\t\t\t$this->db->addParam(\":email\",$user_email );\n\t\t\t$this->db->addParam(\":name_last\",$user_namelast);\n\t\t\t$this->db->addParam(\":name_first\",$user_namefirst);\n\t\t\t$this->db->addParam(\":is_activated\",$app_auto_user_activate);\n\t\t\t$this->db->addParam(\":is_ldap\",1);\n\t\t\t$this->db->execute();\n\t\t\t\n\t\t\t/* \n\t\t\t\tToDO:\n\t\t\t\tAdd roles\n\t\t\t\tAdd enterprises\n\t\t\t\t\n\t\t\t\t$CONFIG['model_LDAP_user_activate_roles']\t= array(\"guest\");\n\t\t\t\t$CONFIG['model_LDAP_user_activate_ent']\t\t= array(\"1\");\n\t\t\t*/\n\t\t\t\n\t\t}\n\t}", "abstract protected function getUser();", "function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }", "function getRHUL_LastName() {\n return getRHUL_LDAP_FieldValue(\"last_name\");\n}", "function hc_user_field($user, $field){\n\t\t$args = array(\n\t\t\t\t'single' => true,\n\t\t\t\t'username' => $user,\n\t\t\t\t'fields' => $field\n\t\t\t);\n\t\t$userObject = hc_get_users($args);\n\t\techo $userObject[0]->$field;\n\t}", "function addnewuser() {\n \t\t\t$this->set('GetUserQ', $this->Users->GetUsers(0));\n \t\t\t$this->set('GetLevelsQ', $this->AccessLevels->index());\n \t\t}", "function getRHUL_DisplayName() {\n\treturn getRHUL_LDAP_FieldValue(\"adi_givenname\");\n}", "private function create()\n {\n return $this->db->putUser($this->getDefaultAttributes());\n }", "function addNewUser($division, $department, $name, $mobile, $email, $empid, $city, $whrereincity, $zone, $username, $password){\r\n $time = time();\r\n /* If admin sign up, give admin user level */\r\n if(strcasecmp($username, ADMIN_NAME) == 0){\r\n $ulevel = ADMIN_LEVEL;\r\n }else{\r\n $ulevel = USER_LEVEL;\r\n }\r\n $active = false;\r\n\t if($active == \"true\"){\r\n\t $active = 1;\r\n\t }else if($active == \"false\"){\r\n\t $active = 0;\r\n\t }\r\n\t \r\n $q = \"INSERT INTO \".TBL_USERS.\" VALUES ('','$division', '$department', '$name', '$mobile', '$email', '$empid', '$city', '$whrereincity', '$zone', '$username', '$password', '0', '$ulevel', '$time', '0')\";\r\n\t return mysql_query($q, $this->connection); \r\n }", "abstract public function user();", "function addUserFromEnt(&$ent) {\n print \"HURTZ\";\n $newUser = new AuthngUser();\n $newUser->setName($ent['name']);\n $newUser->setFullname($ent['fullname']);\n $newUser->setGroupname($ent['groupname']);\n $newUser->setPassword($ent['password']);\n $newUser->setUid($ent['uid']);\n\n if ($ent['priv'] && is_array($ent['priv'])) {\n foreach ($ent['priv'] as $privent) {\n $newPrivilege = new Privilege();\n $newPrivilege->setId($privent['id']);\n $newPrivilege->setName($privent['name']);\n $newPrivilege->setDescription($privent['description']);\n\n $newUser->addPrivilege($newPrivilege);\n }\n }\n\n $this->users[\"${ent['name']}\"] = $newUser;\n }", "public function createEnterpriseUser($input);", "function _create_user($user_data){\n \n $person_id=$this->model->insert($user_data);\n return $person_id;\n \n }", "function ldap_authenticate($user, $username, $password) {\n\tif ( is_a($user, 'WP_User') ) { return $user; }\n\n\t// Uncomment to only allow users to authenticate with LDAP and not against the default WP U/P\n\t//remove_filter('authenticate', 'wp_authenticate_username_password', 20, 3);\n\n\tif ( empty($username) ) {\n return new WP_Error('empty_username', __('<strong>ERROR</strong>: The username field is empty.'));\n }\n\n if ( empty($password) ) {\n return new WP_Error('empty_password', __('<strong>ERROR</strong>: The password field is empty.'));\n }\n\t\n\t// VU LDAP Credentials\n\t$ldapSettings = array();\n\n\t$ldapSettings['ldapHost'] = 'ldaps://123.123.123.123';\n\t$ldapSettings['ldapPort'] = 637;\n\t$ldapSettings['ldapUser'] = 'adminUser';\n\t$ldapSettings['ldapPass'] = 'adminPass';\n\t$ldapSettings['searchbase'] = 'DC=valpo,DC=edu';\n\t$ldapSettings['filter'] = '(sAMAccountName='.$username.')';\n\t\n\t$ds = ldap_connect($ldapSettings['ldapHost'], $ldapSettings['ldapPort'])\n or die(\"There was a problem connecting to LDAP Server - \".$ldapSettings['ldapHost']);\n\tldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);\n\tldap_set_option($ds, LDAP_OPT_REFERRALS, 0);\n\n\t$r = ldap_bind($ds,$ldapSettings['ldapUser'],$ldapSettings['ldapPass']);\n\t$sr = ldap_search($ds, $ldapSettings['searchbase'], $ldapSettings['filter']);\n\t$userInfo = ldap_get_entries($ds, $sr);\n\tif (isset($userInfo[0]['dn'])) {\n\t\t$userdn = $userInfo[0]['dn'];\n\n\t\t$dsVerify = ldap_connect($ldapSettings['ldapHost'], $ldapSettings['ldapPort'])\n\t\t or die(\"There was a problem connecting to LDAP Server - \".$ldapSettings['ldapHost']);\n\t\t$rVerify=@ldap_bind($dsVerify,$userdn,stripslashes($password));\n\t} else {\n\t\treturn new WP_Error('invalid_username', __('<strong>Login Error</strong>: LDAP user not found.'));\n\t}\n\n\tif (!$rVerify) {\n\t\treturn new WP_Error('invalid_password', __('<strong>Login Error</strong>: Password incorrect.'));\n\t} else {\n\t\t$user = get_userdatabylogin($username);\n\t\tif ( !$user || (strtolower($user->user_login) != strtolower($username)) ) {\n\t\t\treturn new WP_Error('invalid_username', __('<strong>Login Error</strong>: LDAP credentials are correct but not added to Wordpress. Contact IMC to be properly setup.'));\n\n\t\t} else {\n\t\t\treturn new WP_User($user->ID);\t\n\t\t}\n\t} \n}", "function create($username, $password='', $ID_Entity='', $secureLevel=9){\n\t\t$username = trim(strtolower($username));\n\t\tif(preg_match(PATTERN_EMAIL, $username)){\n\t\t\t$cols = array(\t\t'Username'\t=>\t$username,\n\t\t\t\t\t\t\t\t'Password'\t=>\t$password,\n\t\t\t\t\t\t\t\t'ID_User'\t=>\t$ID_Entity,\n\t\t\t\t\t\t\t\t'SecureLevel'\t=>\t$secureLevel);\n\t\t\t$this->ID_User = dbInsert($cols, 'GBM_SYS_User');\n\t\t\t$this->username = $username;\n\t\t\treturn $this->ID_User;\n\t\t}else{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "protected function createUser ()\n {\n /* Method of the UserFactory class */\n $this->_objUser = UserFactory::createUser(ucfirst($_SESSION[\"userType\"])); \n $this->_objUser->setFirstName($_SESSION[\"emailID\"]);\n }", "protected function buildUser()\n {\n return null;\n }", "function createUser($name, $xpath, $settings)\n {\n \t$GLOBALS['log']->debug(\"Called createUser\");\n\t $user = new User();\n\t\t$user->user_name = $name;\n\t\t$user->email1 = $name;\n\t\t$user->last_name = $name;\n\t\t$user->employee_status = 'Active';\n\t\t$user->status = 'Active';\n\t\t$user->is_admin = 0;\n\t\t$user->external_auth_only = 1;\n\t\t$user->system_generated_password = 0;\n\t\t\n\t\t// Loop through the create custom fields and update their values in the \n\t\t// user object from the xml SAML response.\n\t\t$customFields = $this->getCustomFields($settings, 'create');\n \t$GLOBALS['log']->debug(\"number of custom fields: \" . count($customFields));\n\t\tforeach ($customFields as $field) \n\t\t{\n\t\t\t$GLOBALS['log']->debug(\"xpath for $field is \" . $settings->saml_settings['create'][$field]);\n\t\t\t$xmlNodes = $xpath->query($settings->saml_settings['create'][$field]);\n\t\t\tif ($xmlNodes === false)\n\t\t\t{\n\t\t\t\t// malformed xpath!\n\t\t\t\t$GLOBALS['log']->debug(\"Bad xpath: \" . $settings->saml_settings['create'][$field]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($xmlNodes->length == 0)\n\t\t\t{\n\t\t\t\t// no nodes match xpath!\n\t\t\t\t$GLOBALS['log']->debug(\"No nodes match this xpath: \" . $settings->saml_settings['create'][$field]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif ($field == 'id')\n\t\t\t{\n\t\t\t\t$user->new_with_id = true;\n\t\t\t}\n\t\t\t\n\t\t\t$xmlValue = $xmlNodes->item(0)->nodeValue;\n\t\t\t$GLOBALS['log']->debug(\"Setting $field to $xmlValue\");\n\t\t\t$user->$field = $xmlValue;\n\t\t}\n\t\t\n \t$GLOBALS['log']->debug(\"finished loop - saving.\");\n\t\t$user->save();\n \t$GLOBALS['log']->debug(\"New user id is \" . $user->id);\n\t\treturn $user->id;\n\t}", "public function add_user_get(){\r\n if (!$this->pronet_model->add_user('Fname Lname', '7711223344553', '[email protected]', '31111225', '1990-01-01','134091830-2')) {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }", "function create_newuser($data){\n\tglobal $DB, $CFG, $USER;\n\t$atalvariables = get_atalvariables();\n\t$roleid = theme_get_roleidbyname('student');\n\t$schoolname = '';\n\t$city = '';\n\tif ($data->flag == 'add') {\n\t\t// Creating new user.\n\t\t$usertype = $data->usertype;\n\t\tif($usertype=='student'){\n\t\t\t//Can only be created by incharge login [logged in user id used to fetch the school id]\n\t\t\t$schooldata = $DB->get_record('user_school', array('userid'=>$USER->id), '*', MUST_EXIST);\n\t\t\t$schoolid = (isset($schooldata->schoolid))?$schooldata->schoolid:0;\n\t\t\t$roleid = theme_get_roleidbyname('student');\n\t\t} else{\n\t\t\t$schoolid = $data->school;\n\t\t\t$roleid = theme_get_roleidbyname($usertype);\n\t\t}\n\t\t$state = \"0\";\n\t\t$sql = \"SELECT s.name,c.name as city,ss.name as state FROM {school} s JOIN {city} c ON s.cityid = c.id LEFT JOIN {state} ss ON c.stateid=ss.id WHERE s.id=\".$schoolid;\n\t\t$result = $DB->get_record_sql($sql);\n\t\tif(isset($result->name)){\n\t\t\t$schoolname = $result->name;\n\t\t $city = $result->city;\n\t\t\t$state = (!empty($result->state))?$result->state:'0';\n\t\t}\n\t\t$user = new stdClass();\n\t\t$user->auth = 'manual';\n\t\t$user->confirmed = 1;\n\t\t$user->deleted = 0;\n\t\t$user->timezone = '99';\n\t\t$user->mnethostid = 1;\n\t\tif(isset($data->username)){\n\t\t\t$user->username = $data->username;\n\t\t}\n\t\telse\n\t\t\t$user->username = trim($data->email);\n\t\t//$user->password = hash_internal_user_password($data->newpassword);\n\t\t$ran = generate_randomstring();\n\t\t$user->passraw = $ran;\n\t\t$user->password=hash_internal_user_password($ran);\n\t\t$user->firstname = $data->firstname;\n\t\t$user->lastname = $data->lastname;\n\t\t$user->email = $data->email;\n\t\t$user->icq = \"newuser\";\n\t\t$user->msn = $roleid;\n\t\t$user->institution = $schoolname;\n\t\t$user->city = $city;\n\t\t/* if(isset($data->state)){\n\t\t\t$user->aim = $data->state;\n\t\t} */\n\t\t$user->aim = (isset($data->state) && !empty($data->state))?$data->state:$state;\n\t\t$user->country = 'IN';\n\t\t$user->timecreated = time();\n\t\t$user->timemodified = time();\n\t\tif(isset($data->gender)){\n\t\t\t$user->gender = $data->gender;\n\t\t}\n\t\tif(isset($data->phone1)){\n\t\t\t$user->phone1 = $data->phone1;\n\t\t}\n\t\t// Insert the user into the database.\n\t\t$newuserid = $DB->insert_record('user', $user);\n\t\t$usercontext = context_user::instance($newuserid);\n\t\t$cm = new stdClass();\n\t\t$cm->userid = $newuserid;\n\t\t$cm->schoolid = $schoolid;\n\t\t$cm->role = $usertype;\n\t\tif(isset($data->studentclass)){\n\t\t\t$cm->studentclass = $data->studentclass;\n\t\t}\n\t\t$DB->insert_record('user_school', $cm);\n\t}\n\t$name = $user->firstname.' '.$user->lastname;\n\tsend_welcomemail($roleid,$newuserid,$name,$data->email,$user->username,$ran);\n\treturn true;\n}", "public function authenticate() {\n\n $ldap = Yii::app()->ldap;\n\n $result = $ldap->authenticate($this->username, $this->password);\n $ldapUserInfo = $ldap->user()->infoCollection($this->username, array(\"mail\", \"displayname\"));\n\n\n if (!$result) {\n $this->errorCode = self::ERROR_USERNAME_INVALID;\n } else {\n\n $this->setState('fullname', $ldapUserInfo->displayname);\n $this->setState('email', $ldapUserInfo->mail);\n\n $dbUser = Users::model()->findByAttributes(array('ldap' => $this->username));\n if (!$dbUser) {\n $dbUser = new Users();\n $dbUser->ldap = $this->username;\n $dbUser->full_name = $ldapUserInfo->displayname;\n $dbUser->pass = $this->password;\n $dbUser->mail = $ldapUserInfo->mail;\n $dbUser->salt = 'f';\n $dbUser->url = 'f';\n $dbUser->create = time();\n\n $dbUser->save();\n //print_r($dbUser);\n }\n \n $this->_id = $dbUser->primaryKey;\n\n $this->errorCode = self::ERROR_NONE;\n \n }\n\n\n return !$this->errorCode;\n }", "function wp_newUser( $args ) {\n \n global $wp_xmlrpc_server, $wp_roles;\n $wp_xmlrpc_server->escape($args);\n\n $blog_ID = (int) $args[0]; // for future use\n $username = $args[1];\n $password = $args[2];\n $content_struct = $args[3];\n $send_mail = isset( $args[4] ) ? $args[4] : false;\n\n if ( ! $user = $wp_xmlrpc_server->login( $username, $password ) )\n return $wp_xmlrpc_server->error;\n\n if ( ! current_user_can( 'create_users' ) )\n return new IXR_Error( 401, __( 'You are not allowed to create users' ) );\n\n // this hold all the user data\n $user_data = array();\n \n $user_data['user_login'] = '';\n if( isset ( $content_struct['user_login'] ) ) {\n\n $user_data['user_login'] = sanitize_user( $content_struct['user_login'] );\n //Remove any non-printable chars from the login string to see if we have ended up with an empty username\n $user_data['user_login'] = trim( $user_data['user_login'] );\n\n }\n\n if( empty ( $user_data['user_login'] ) )\n return new IXR_Error( 403, __( 'Cannot create a user with an empty login name. ' ) );\n if( username_exists ( $user_data['user_login'] ) )\n return new IXR_Error( 403, __( 'This username is already registered.' ) );\n\n //password cannot be empty\n if( empty ( $content_struct['user_pass'] ) )\n return new IXR_Error( 403, __( 'password cannot be empty' ) );\n\n $user_data['user_pass'] = $content_struct['user_pass'];\n\n // check whether email address is valid\n if( ! is_email( $content_struct['user_email'] ) )\n return new IXR_Error( 403, __( 'email id is not valid' ) );\n\n // check whether it is already registered\n if( email_exists( $content_struct['user_email'] ) )\n return new IXR_Error( 403, __( 'This email address is already registered' ) );\n\n $user_data['user_email'] = $content_struct['user_email'];\n\n // If no role is specified default role is used\n $user_data['role'] = get_option('default_role');\n if( isset ( $content_struct['role'] ) ) {\n\n if( ! isset ( $wp_roles ) )\n $wp_roles = new WP_Roles ();\n if( ! array_key_exists( $content_struct['role'], $wp_roles->get_names() ) )\n return new IXR_Error( 403, __( 'The role specified is not valid' ) );\n $user_data['role'] = $content_struct['role'];\n \n }\n\n $user_data['first_name'] = '';\n if( isset ( $content_struct['first_name'] ) )\n $user_data['first_name'] = $content_struct['first_name'];\n\n $user_data['last_name'] = '';\n if( isset ( $content_struct['last_name'] ) )\n $user_data['last_name'] = $content_struct['last_name'];\n\n $user_data['user_url'] = '';\n if( isset ( $content_struct['user_url'] ) )\n $user_data['user_url'] = $content_struct['user_url'];\n\n $user_id = wp_insert_user( $user_data );\n\n if ( is_wp_error( $user_id ) )\n return new IXR_Error( 500, $user_id->get_error_message() );\n\n if ( ! $user_id )\n return new IXR_Error( 500, __( 'Sorry, your entry could not be posted. Something wrong happened.' ) );\n\n if( $send_mail ) {\n \n $subject = \"[\".get_bloginfo('name').\"] Your username and password\";\n $message = \"Username: \".$user_data['user_login'].\"\\nPassword: \".$user_data['user_pass'].\"\\n\".get_bloginfo('siteurl').\"/wp-login.php\";\n wp_mail( $user_data['user_email'], $subject, $message );\n \n }\n\n return strval( $user_id );\n\n}", "public function testUserCreateWithInstalledDomainAccessFields() {\n $user = $this->drupalCreateUser();\n $user->save();\n self::assertNotEmpty($user->id());\n }", "function lookupUser($uid) {\n\t$host = \"ldap.bath.ac.uk\";\n\t$dn = \"o=bath.ac.uk\";\n\t$con = ldap_connect($host);\n\t// anonymous login\n\tldap_bind($con);\n\t$results = ldap_search($con, $dn, \"uid=\" . $uid);\n\t// get array from search results\n\t$entries = ldap_get_entries($con, $results);\n\t// ensure a user has been found\n\tif ($entries[\"count\"] > 0) {\n\t\treturn Array (\n\t\t\t\"found\" => 1,\n\t\t\t\"uidnumber\" => $entries[0][\"uidnumber\"][0],\n\t\t\t\"accountstate\" => $entries[0][\"accountstate\"][0],\n\t\t\t\"displayname\" => $entries[0][\"displayname\"][0],\n\t\t\t\"mail\" => $entries[0][\"mail\"][0]\n\t\t);\n\t}\n\telse {\n\t\treturn Array (\"found\" => 0);\n\t}\n}", "function get_user_details()\r\n{\r\n\tdo_log(\"get_user_details called\",5);\r\n\tglobal $userid,$userstate,$forum_id,$username,$email,\r\n\t\t\t$ts3_user_id,$existing_main,$existing_main_name,$corp_ids,$director_corp_ids,\r\n\t\t\t$group_membership,$SETTINGS, $isAdmin, $isSuperAdmin, $jabber_user_name, $registered_characters;\r\n\r\n\t// BigSako: initialize forum_id\r\n\t$forum_id = -1;\r\n\t\r\n\t$isAdmin = false;\r\n\t$isSuperAdmin = false;\r\n\r\n\t$as_user_flood_protect = 0;\r\n\t\r\n\tif($_COOKIE[$SETTINGS['forum_cookie_id']])\r\n\t{\r\n\t\t$forum_hash=sanitise($_COOKIE[$SETTINGS['forum_cookie_id']]); // BigSako: Prevent possible SQL Injection here! Very dangerous \r\n\t\t\r\n\t\t$forum_id=lookup_forum_id($forum_hash);\r\n\t\tdo_log(\"get_user_details(): forum_hash = '$forum_hash', forum_id='$forum_id'\", 9);\r\n\t}\r\n\tif($forum_id<1) \r\n\t{\r\n\t\tdo_log(\"get_user_details(): no forum_id retrieved - exiting...\", 9);\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t$db = connectToDB();\r\n\t\r\n\t// asume user (see further below)\r\nasuser:\r\n\t\r\n\t// set corp ids to an empty array for now\r\n\t$corp_ids = array();\r\n\t$director_corp_ids = array();\r\n\t\t\r\n\t// query the forum and see who this is\r\n\t$sql = \"select user_id,user_name,forum_id,email,state,\" .\r\n\t\t\t\"ts3_user_id,has_regged_main,jabber_user_name from auth_users where forum_id='\".$forum_id.\"'\";\r\n\tdo_log(\"sql='$sql'\", 9);\r\n\t$sth=$db->query($sql);\r\n\tif($sth->num_rows == 1) // should be exactly one result\r\n\t{\r\n\t\t$result=$sth->fetch_array();\r\n\t\t$userid=$result['user_id'];\t\t\r\n\t\t$username=$result['user_name'];\r\n\t\t$userstate=$result['state'];\r\n\t\t$email=$result['email'];\r\n\r\n\t\t$ts3_user_id = $result['ts3_user_id'];\r\n\t\t$jabber_user_name = $result['jabber_user_name'];\r\n\t\t$existing_main=$result['has_regged_main'];\r\n\t\t\r\n\t\t// get main character\r\n\t\t$sth2 = $db->query(\"SELECT character_name FROM api_characters WHERE character_id = $existing_main \");\r\n\t\t$res2 = $sth2->fetch_array();\r\n\t\t$existing_main_name = $res2['character_name'];\r\n\t\t\r\n\t\t\r\n\t\t// get groups\r\n\t\t$sth3 = $db->query(\"SELECT group_id FROM group_membership WHERE user_id = $userid AND state=0\");\r\n\t\t$group_membership = array();\r\n\t\t$group_membership[0] = 0;\r\n\t\t\r\n\t\t$cnt = 1;\r\n\t\t\r\n\t\twhile ($row3 = $sth3->fetch_array())\r\n\t\t{\r\n\t\t\t$group_membership[$cnt] = $row3['group_id'];\r\n\t\t\tif ($row3['group_id'] == ADMIN_GROUP_ID || $row3['group_id'] == SUPERADMIN_GROUP_ID)\r\n\t\t\t{\r\n\t\t\t\t$isAdmin = true;\r\n\t\t\t}\r\n if ($row3['group_id'] == SUPERADMIN_GROUP_ID)\r\n {\r\n $isSuperAdmin = true;\r\n }\r\n\t\t\t$cnt++;\r\n\t\t}\r\n\r\n\t\t\r\n\t\t// check for ASSUME_USER flag\r\n\t\tif ($isAdmin == true && isset($_COOKIE['API_ASUSER']) && $as_user_flood_protect == 0)\r\n\t\t{\r\n\t\t\t$forum_id = intval($_COOKIE['API_ASUSER']);\r\n\t\t\tdo_log(\"Admin is asuming to be user with forum_id $forum_id\", 1);\r\n\t\t\t// reset isAdmin\r\n\t\t\t$isAdmin = false;\r\n\t\t\t$as_user_flood_protect = 1;\r\n\t\t\tgoto asuser;\r\n\t\t}\r\n\t\t\r\n\t\t// get corp ids\r\n\t\t$res = $db->query(\"SELECT a.corp_id, a.is_director, a.is_ceo, c.is_allowed_to_reg as corp_reg, d.is_allowed_to_reg as alliance_reg FROM api_characters a, corporations c, alliances d\r\n \t\t\t\tWHERE c.corp_id = a.corp_id AND a.user_id = $userid AND a.state <= 10 AND c.alliance_id = d.alliance_id\");\r\n\t\t\r\n\t\twhile ($row = $res->fetch_array())\r\n\t\t{\r\n\t\t\t$corp_ids[] = $row['corp_id'];\r\n\t\t\tif (($row['corp_reg'] == 1 || $row['alliance_reg']) && ($row['is_director'] >= 1 || $row['is_ceo'] == 1))\r\n\t\t\t{\r\n\t\t\t\t$director_corp_ids[] = $row['corp_id'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t} else if ($sth->num_rows == 0) { // user has registered at the forums, but does not have an account here\r\n\t\tdo_log(\"New user?\",5);\r\n\t\t$existing_main = -1;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$result = get_forum_details($forum_id);\r\n\t\t// edit: dont forget to escape the username and the email \r\n\t\t$username=$db->real_escape_string($result['username']);\r\n\t\t$email=$db->real_escape_string($result['email']);\r\n\t\t\r\n\t\t// insert user into our database in auth_users\r\n\t\t$sql = \"insert into auth_users (user_name,forum_id,email,state) values \" .\r\n\t\t\t\t\t\"('$username','$forum_id','$email','0')\";\r\n\t\t$sth=$db->query($sql);\r\n\t\t\r\n\t\t// if insert was not successful, it either is an sql error (unlikely) OR\r\n\t\t// the user was already registered, so we need to manually fix this.\r\n\t\tif ($sth == false)\r\n\t\t{\r\n\t\t\tdo_log(\"Inserting user $username with forum_id $forum_id failed...\", 1);\r\n\t\t\tdo_log(\"qry='$sql'\", 1);\r\n\t\t\terror_page(\"Error\", \"It appears that you are already registered with a different forum account. Please contact the IT Team.<br /> \".\r\n\t\t\t\t\t\t\"Details: forum-username: $username, forum_id: $forum_id\");\r\n\t\t\texit;\r\n\t\t\t//return false;\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// get user id etc...\r\n\t\t\t$sth=$db->query(\"select user_id,user_name,forum_id,email,state,ts3_user_id from auth_users where forum_id='$forum_id'\");\r\n\r\n\t\t\t$result=$sth->fetch_array();\r\n\t\t\t$userid=$result['user_id'];\r\n\t\t\t$username=$result['user_name'];\r\n\t\t\t$userstate=$result['state'];\r\n\t\t\t$email=$result['email'];\r\n\t\t\t$ts3_user_id = $result['ts3_user_id'];\r\n\t\t\t\r\n\t\t\t// give user the default group 0\r\n\t\t\t$db->query(\"INSERT INTO group_membership (group_id, user_id, state, previous_state) VALUES (0, $userid, 0, 0)\");\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$sth3 = $db->query(\"SELECT group_id FROM group_membership WHERE user_id = $userid AND state=0\");\r\n\t\t$group_membership = array();\r\n\t\t$group_membership[0] = 0;\r\n\t\t\r\n\t\t$cnt = 1;\r\n\t\t\r\n\t\twhile ($row3 = $sth3->fetch_array())\r\n\t\t{\r\n\t\t\t$group_membership[$cnt] = $row3['group_id'];\r\n\t\t\tif ($row3['group_id'] == ADMIN_GROUP_ID && !isset($_COOKIE['API_ASUSER']))\r\n\t\t\t{\r\n\t\t\t\t$isAdmin = true;\r\n\t\t\t}\r\n\t\t\t$cnt++;\r\n\t\t}\r\n\r\n\r\n\t} else {\r\n\t\tdo_log(\"error happened, more than 1 row returned...\", 5);\r\n\t\treturn false;\r\n\t}\r\n\r\n\r\n // now that we got that far: query all characters belonging to that user with an active API\r\n $registered_characters = array();\r\n\r\n $sql = \"SELECT character_id, character_name FROM api_characters WHERE user_id = $userid AND state < 90 order by key_id,character_name\";\r\n $res = $db->query($sql);\r\n\r\n while ($row = $res->fetch_array())\r\n {\r\n $registered_characters[$row['character_id']] = $row['character_name'];\r\n }\r\n\r\n\tdo_log(\"Username has been determined to be \".$GLOBALS[\"username\"],9);\r\n\treturn true;\r\n}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "abstract protected function getUserId() ;", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "protected function getBackendUser() {}", "public function create_user($user)\n{\t\n\t $uname=$user->__get('uname');\n\t//echo $username;\n\t $pwd=$user->__get('password');\n\t $fname=$user->__get('fname');\n\t $lname=$user->__get('lname');\n\t $mail=$user->__get('email');\n\t $gender=$user->__get('gender');\n\t $role=$user->__get('role');\n\t $dob=$user->__get('dob');\n\t$con = connect();\n\tmysqli_query($con, \"INSERT INTO user VALUES(NULL,'$fname','$lname','$uname','$pwd','$mail','$gender',STR_TO_DATE('$dob','%m/%d/%Y'),'$role')\");\n}", "function makeUser($firstname, $lastname, $username, $email, $department, $isReadOnly){\n $password = genPassword(7);\n $md5_password = md5($password);\n sqlQuery(\"INSERT INTO users SET user_firstname='$firstname', user_lastname='$lastname', user_username='$username', user_email='$email', user_isreadonly='$isReadOnly', user_department='$department', user_password='$md5_password'\");\n sendSignupEmail(getUserId($username), $password);\n alog(\"Added user $username\");\n}", "public function getCreateUser()\n\t{\n\t\treturn $this->CreateUser;\n\t}", "function getUser() {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'username', 1 => 'title', 2 => 'first_name', 3 => 'last_name', 4 => 'password', 5 => 'contactemail', 6 => 'contacttelephone', 7 => 'newsletter', 8 =>'pcode', 9 => 'store_owner', 10 => 'house', 11 => 'street', 12 => 'town', 13 => 'county', 14 => 'geolong', 15 => 'geolat', 16 => 'avatar', 17 => 'mobile', 18 => 'optout');\n $idfields = array(0 => 'id');\n $idvals = array(0 => $this->ID);\n $rs = $DBA->selectQuery(DBUSERTABLE, $fields, $idfields, $idvals);\n\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $this->setUserVar('Username', $res['username']);\n $this->setUserVar('Title', $res['title']);\n $this->setUserVar('FirstName', $res['first_name']);\n $this->setUserVar('LastName', $res['last_name']);\n $this->setUserVar('ContactEmail', $res['contactemail']);\n $this->setUserVar('ContactTelephone', $res['contacttelephone']);\n $this->setUserVar('NewsletterSubscriber', $res['newsletter']);\n $this->setUserVar('Area', $res['pcode']);\n $this->setUserVar('StoreOwner', $res['store_owner']);\n $this->setUserVar('House', $res['house']);\n $this->setUserVar('Street', $res['street']);\n $this->setUserVar('Town', $res['town']);\n $this->setUserVar('County', $res['county']);\n $this->setUserVar('PCode', $res['pcode']);\n $this->setUserVar('Long', $res['geolong']);\n $this->setUserVar('Lat', $res['geolat']);\n $this->setUserVar('Avatar', $res['avatar']);\n $this->setUserVar('Mobile', $res['mobile']);\n $this->setUserVar('DMOptOut', $res['optout']);\n $this->formatAddress();\n $this->formatEmail();\n if ($this->Lat == '')\n {\n $this->GeoLocate();\n }\n }\n }\n }", "function messenger_find_user_or_create($uid)\n{\n $user = user_load($uid);\n\n $error = new stdClass();\n $error->message = \"User not found\";\n $error->error = True;\n\n if (!isset($user->uid)) {\n return drupal_json_output($error);\n }\n\n $result = messenger_find_or_create_user($user);\n\n\n if ($result) {\n $success = new stdClass();\n $success->data = $result;\n\n\n return drupal_json_output($success);\n } else {\n $error->message = \"An error\";\n return drupal_json_output($error);\n }\n}", "function get_user () {\n\t\treturn $this->user_id;\n\t}", "private function getAndSetAuthInfo() {\n #Authentication\n #$this->userIdentifier will be empty if the unser doesn't provide a credential\n #If in the future we implement API keys, then I suggest we only look for\n #the DN if the API key isn't presented.\n #Failure to authenticate is handled elsewhere\n if(is_null($this->userIdentifier)){\n $this->userIdentifier = Get_User_Principle_PI();\n $this->userIdentifierType = 'X509';\n }\n }", "function getUserName($us_id)\n\t{\n\t\t$func = create_function('$id',$this->UserNameFunc);\n\t\treturn $func($us_id);\n\t}", "static private function createNewUserFromPost() {\r\n\t\t$errors = array();\r\n\r\n\t\t$activationHash = (System::isAtLocalhost()) ? '' : self::getRandomHash();\r\n\t\t$newAccountId = DB::getInstance()->insert('account',\r\n\t\t\t\tarray('username', 'name', 'mail', 'password', 'registerdate', 'activation_hash'),\r\n\t\t\t\tarray($_POST['new_username'], $_POST['name'], $_POST['email'], self::passwordToHash($_POST['password']), time(), $activationHash));\r\n\r\n\t\tself::$IS_ON_REGISTER_PROCESS = true;\r\n\t\tself::$NEW_REGISTERED_ID = $newAccountId;\r\n\r\n\t\tif ($newAccountId === false)\r\n\t\t\t$errors[] = __('There went something wrong. Please contact the administrator.');\r\n\t\telse {\r\n\t\t\tself::importEmptyValuesFor($newAccountId);\r\n\t\t\tself::setSpecialConfigValuesFor($newAccountId);\r\n\r\n\t\t\tif ($activationHash != '')\r\n\t\t\t\tself::setAndSendActivationKeyFor($newAccountId, $errors);\r\n\t\t}\r\n\r\n\t\tself::$IS_ON_REGISTER_PROCESS = false;\r\n\t\tself::$NEW_REGISTERED_ID = -1;\r\n\r\n\t\treturn $errors;\r\n\t}", "function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n unset($DBA, $rs, $fields, $fieldvals);\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'id');\n $idfields = array(0 => 'username');\n $idvals = array(0 => $this->Username);\n $rs = $DBA->selectQuery(DBUSERTABLE, $fields, $idfields, $idvals);\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $this->setUserVar('ID', $res['id']);\n }\n }\n unset($DBA, $rs, $fields, $idfields, $idvals);\n }", "function one_user_info($first = FALSE, $username = NULL, $fields = NULL, $group_cn_cache_only = FALSE, $groups_filtering = '', $in_groups_filtering = array())\n\t{\n $this->_warning_message = '';\n\t\t$sr = FALSE;\n\t\tif ($first) {\n\t\t\tif ($username==NULL){ return (false); }\n\t\t\tif (!$this->_bind_paged){ return (false); }\n if ('' == $this->_users_dn) {\n $this->_users_dn = $this->_base_dn;\n }\n\n if (1 == $this->_ldap_server_type) { // Active Directory\n $filter = \"(&(objectClass=user)(samaccounttype=\". ADLDAP_NORMAL_ACCOUNT .\")(objectCategory=person)(\".$this->_cn_identifier.\"=\".$username.\")\".$groups_filtering.\")\";\n if ($fields==NULL){ $fields=array($this->_cn_identifier,\"mail\",$this->_group_attribute,\"department\",\"description\",\"displayname\",\"telephonenumber\",\"primarygroupid\",\"distinguishedname\"); }\n } elseif (3 == $this->_ldap_server_type) { // legacy Active Directory\n $filter = \"(&(objectClass=user)(samaccounttype=\". ADLDAP_NORMAL_ACCOUNT .\")(objectCategory=person)(\".$this->_cn_identifier.\"=\".$username.\"))\";\n if ($fields==NULL){ $fields=array($this->_cn_identifier,\"mail\",$this->_group_attribute,\"department\",\"description\",\"displayname\",\"telephonenumber\",\"primarygroupid\",\"distinguishedname\"); }\n } else { // Generic LDAP (2) or others\n $filter = \"(&(objectClass=posixAccount)(\".$this->_cn_identifier.\"=\".$username.\"))\";\n if ($fields==NULL){ $fields=array($this->_cn_identifier,\"mail\",$this->_group_attribute,\"department\",\"gecos\",\"description\",\"displayname\",\"telephonenumber\",\"gidnumber\",\"distinguishedname\"); }\n }\n\t\t\t$this->_oui_paged_sr = @ldap_search($this->_conn_paged,$this->_users_dn,$filter,$fields);\n if (4 == ldap_errno($this->_conn_paged)) {\n $cr = @ldap_count_entries($this->_conn_paged,$this->_oui_paged_sr);\n $this->_warning_message = \"LDAP server cannot return more than $cr records.\";\n }\n // echo \"DEBUG: Error: \".ldap_errno($this->_conn_paged);\n // $cr = ldap_count_entries($this->_conn_paged,$sr);\n // echo $cr;\n // echo \"DEBUG: Error: \".ldap_errno($this->_conn_paged);\n\t\t}\n\t\tif ($one_entry = $this->ldap_get_one_entry_raw(\"ONE_USER\", $first, $this->_oui_paged_sr, $this->_conn_paged)) {\n // AD does not return the primary group in the ldap query, we may need to fudge it\n // SysCo/al added a test to check if $entries[0][\"primarygroupid\"][0] exists\n $add_primary_group = FALSE;\n if ($this->_real_primarygroup) {\n if (isset($one_entry[\"primarygroupid\"][0])) {\n $pri_grp_rid = $one_entry[\"primarygroupid\"][0];\n if (isset($this->_cache_group_dn[$pri_grp_rid])) {\n $dn_group = $this->_cache_group_dn[$pri_grp_rid];\n $one_entry[$this->_group_attribute][] = $dn_group;\n $add_primary_group = TRUE;\n } else {\n $r = ldap_read($this->_conn, $this->_base_dn, \"(objectclass=*)\", array(\"objectSid\")) or exit();\n $data = ldap_get_entries($this->_conn, $r);\n if (isset($data[0][\"objectsid\"][0])) {\n $domain_sid = $data[0][\"objectsid\"][0];\n $domain_sid_s = sid2str($domain_sid);\n $r = ldap_search($this->_conn, $this->_base_dn, \"objectSid=\".$domain_sid_s.\"-\".$pri_grp_rid, array(\"distinguishedname\")) or exit();\n $data = ldap_get_entries($this->_conn, $r);\n if (isset($data[0][\"distinguishedname\"][0])) {\n $dn_group = $data[0][\"distinguishedname\"][0];\n $one_entry[$this->_group_attribute][] = $dn_group;\n $add_primary_group = TRUE;\n if (count($this->_cache_group_dn) < 1000) { // Don't overload the memory cache\n $this->_cache_group_dn[$pri_grp_rid] = $dn_group;\n }\n }\n }\n }\n }\n } else {\n $one_entry[$this->_group_attribute][]=\"CN=Domain Users,CN=Users,\".$this->_base_dn;\n $add_primary_group = TRUE;\n }\n\n if ($add_primary_group) {\n @$one_entry[$this->_group_attribute][\"count\"]++;\n }\n \n if ((1 == $this->_ldap_server_type) && ( '' != $groups_filtering)) { // Active Directory (but not legacy)\n // Add the nested groups of the user\n $filter = \"(&(objectCategory=group)(member:1.2.840.113556.1.4.1941:=\".$one_entry[$this->_cn_identifier][0].\")\".$groups_filtering.\")\";\n $internal_fields = array(\"cn\");\n $group_array = array();\n // SysCo/al added ldap_search error handling\n if (FALSE !== ($sr = @ldap_search($this->_conn,$this->_base_dn,$filter, $internal_fields))) {\n $group_entries = $this->rCountRemover(ldap_get_entries($this->_conn, $sr));\n foreach ($group_entries as $group_entry) {\n $group_array[] = $group_entry['cn'][0];\n }\n }\n foreach($group_array as $one_group) {\n $add_it = TRUE;\n foreach($this->nice_names($one_entry[$this->_group_attribute]) as $level_one_group) {\n if (strpos($one_group, $level_one_group) !== FALSE) {\n $add_it = FALSE;\n }\n }\n if ($add_it) {\n $one_entry[$this->_group_attribute][] = $one_group;\n @$one_entry[$this->_group_attribute][\"count\"]++;\n }\n }\n\n // Adding all implicit groups if needed\n foreach($in_groups_filtering as $one_group_filtering) {\n $filter = \"(&(objectClass=user)(samaccounttype=\". ADLDAP_NORMAL_ACCOUNT .\")(objectCategory=person)(\".$this->_cn_identifier.\"=\".$one_entry[$this->_cn_identifier][0].\")\".$one_group_filtering['distinguishedname'].\")\";\n $internal_fields = array(\"cn\");\n // SysCo/al added ldap_search error handling\n if (FALSE !== ($sr = @ldap_search($this->_conn,$this->_base_dn,$filter, $internal_fields))) {\n if (ldap_count_entries($this->_conn, $sr) > 0) {\n $add_it = TRUE;\n foreach($this->nice_names($one_entry[$this->_group_attribute]) as $level_one_group) {\n if (strpos($one_group_filtering['name'], $level_one_group) !== FALSE) {\n $add_it = FALSE;\n }\n }\n if ($add_it) {\n $one_entry[$this->_group_attribute][] = $one_group_filtering['name'];\n @$one_entry[$this->_group_attribute][\"count\"]++;\n }\n }\n }\n }\n }\n\t\t}\n\t\treturn ($one_entry);\n }" ]
[ "0.6394863", "0.63353646", "0.62664324", "0.62260175", "0.6101506", "0.6061821", "0.6053742", "0.60437", "0.600321", "0.59909856", "0.5981068", "0.59469885", "0.59184784", "0.5888247", "0.5878838", "0.5869327", "0.5850902", "0.5841218", "0.5829959", "0.5823872", "0.5796932", "0.57876486", "0.57692325", "0.5736195", "0.57004774", "0.56961787", "0.5693393", "0.5673826", "0.56701803", "0.5654425", "0.565213", "0.56429315", "0.56418806", "0.5632426", "0.5627502", "0.5617782", "0.5594734", "0.55870223", "0.5586913", "0.5582432", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.5581889", "0.55816215", "0.55816215", "0.55816215", "0.55816215", "0.55816215", "0.55816215", "0.5580793", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.5580334", "0.55790645", "0.55725867", "0.55618876", "0.5559627", "0.55557936", "0.55534303", "0.5552963", "0.55496764", "0.55445415", "0.55399877", "0.55363077" ]
0.62889326
2
Jamie Alnasir, created. Obtain RHUL User's Display name from currently logged in, LDAP authenticated RHUL user
function getRHUL_DisplayName() { return getRHUL_LDAP_FieldValue("adi_givenname"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function name() {\n return isset($this->_adaptee->user_info['user_displayname']) ? $this->_adaptee->user_info['user_displayname'] : null;\n }", "public function getUserDisplayName();", "public function diviroids_user_displayname($atts)\n {\n return DiviRoids_Security::get_current_user('display_name');\n }", "function getRHUL_FirstName() {\n return getRHUL_LDAP_FieldValue(\"first_name\");\n}", "function getRHUL_LastName() {\n return getRHUL_LDAP_FieldValue(\"last_name\");\n}", "public function get_user_name() { \n\n\t\tif ($this->user == '-1') { return _('All'); } \n\t\t\n\t\t$user = new User($this->user);\n\t\treturn $user->fullname . \" (\" . $user->username . \")\";\n\t\t\n\t}", "function ffl_fix_user_display_name($user_id)\n{\n\t//set the display name\n\t$info = get_userdata( $user_id );\n \n\t$display_name = trim($info->first_name . ' ' . $info->last_name);\n\tif(!$display_name)\n\t\t$display_name = $info->user_login;\n\t\t\t \n\t$args = array(\n\t\t\t'ID' => $user_id,\n\t\t\t'display_name' => $display_name\n\t);\n \n\twp_update_user( $args ) ;\n}", "function user_name () {\r\n\t$info = user_info();\r\n\treturn (isset($info[1]) ? $info[1] : 'default');\r\n}", "function pilau_default_user_display_name( $user_id ) {\n\t\t// Fetch current user meta information\n\t\t$first = get_user_meta( $user_id, 'first_name', true );\n\t\t$last = get_user_meta( $user_id, 'last_name', true );\n\t\t$display = trim( $first . \" \" . $last );\n\t\t// Update\n\t\twp_update_user( array( \"ID\" => $user_id, \"display_name\" => $display ) );\n\t}", "protected function user()\n {\n if ($this->wrappedObject->security) {\n return ' this user\\'s ';\n }\n\n $user = $this->wrappedObject->revisionable()->withTrashed()->first(['first_name', 'last_name']);\n\n return ' '.$user->first_name.' '.$user->last_name.'\\'s ';\n }", "public function usualname()\n\t{\n\t\treturn coalesce(User::info('UsualName'), User::info('Username'));\n\t}", "public function getExternalUserName();", "public function diviroids_user_firstname($atts)\n {\n return DiviRoids_Security::get_current_user('user_firstname');\n }", "public function diviroids_user_lastname($atts)\n {\n return DiviRoids_Security::get_current_user('user_lastname');\n }", "public function displayUser()\n {\n $entry = $this->getEntry();\n if ($entry) {\n return $entry->displayUser();\n }\n }", "Public Function getUserName()\n\t{\n\t\treturn $this->firstName . ' ' . $this->lastName;\n\t}", "public function RefreshDisplayName() {\n\t\t\tif ($this->blnDisplayRealNameFlag)\n\t\t\t\t$this->strDisplayName = $this->strFirstName . ' ' . $this->strLastName;\n\t\t\telse\n\t\t\t\t$this->strDisplayName = $this->strUsername;\n\t\t\t$this->Save();\n\t\t}", "function get_user_name() {\n return $this->call('get_user_name', array(), TRUE);\n }", "public function getDisplayName()\n\t{\n\t\treturn $this->m_oUser->DisplayName;\n\t}", "public function getDisplayName() { $n = $this->data->get(\"displayName\", null);\n if (!empty($n)) {\n return $n;\n }\n \n // I have google's name?\n if (($g = $this->getGoogleInfo())) {\n if (isset($g->givenName) && !empty($g->givenName)) {\n return $g->givenName;\n }\n if (isset($g->name) && !empty($g->name)) {\n return $g->name;\n }\n }\n \n // user is current user?? load his name if he is\n $currentUser = JFactory::getUser();\n if ((int)($currentUser->id) == (int)$this->userid) {\n return ucwords(strtolower($currentUser->name));\n }\n \n // load user and get his name\n $user = F_User::getUserById((int)$this->$userid);\n if ($user) {\n return ucwords(strtolower($user->name));\n }\n \n // wtf\n return \"???\";\n }", "private function updateName()\n {\n if (!LOCAL) {\n $ds = ldap_connect(\"addressbook.ic.ac.uk\");\n $r = ldap_bind($ds);\n $justthese = array(\"displayname\");\n $sr = ldap_search(\n $ds,\n \"ou=People,ou=shibboleth,dc=ic,dc=ac,dc=uk\",\n \"uid=\".$this->getUser(),\n $justthese\n );\n $info = ldap_get_entries($ds, $sr);\n if ($info[\"count\"] > 0) {\n $this->setName($info[0]['displayname'][0]);\n return ($info[0]['displayname'][0]);\n } else {\n return false;\n }\n } else {\n $name = $this->getName();\n return $name;\n }\n }", "public function getAccountRealName() {\n // cn is a standard LDAP attibute\n if (!empty($_SERVER['AUTHORIZE_CN']))\n return $_SERVER['AUTHORIZE_CN'];\n // Some installations may prefer to use displayName\n else if (!empty($_SERVER['AUTHORIZE_DISPLAYNAME']))\n return $_SERVER['AUTHORIZE_DISPLAYNAME'];\n // Some installations may populate the name field with the user's real\n // name. This seems to be erroneous, based on Microsoft documenting\n // this attribute as an RDN, so only use it as a last resort.\n else if (!empty($_SERVER['AUTHORIZE_NAME']))\n return $_SERVER['AUTHORIZE_NAME'];\n else\n return parent::getAccountRealName();\n }", "public function display_name($uid = 0) {\r\n\t\tif ($uid > 0) {\r\n\t\t\t$uname = $this->core($uid)->get(\"username\");\r\n\t\t\t$rname = $this->core($uid)->get(\"name\");\r\n\t\t\tif (strtolower($uname == $rname)) {\r\n\t\t\t\treturn $uname;\r\n\t\t\t} else {\r\n\t\t\t\treturn $rname;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn $this->username(0);\r\n\t\t}\r\n\t}", "function user_create($attributes){\n //check for compulsory fields\n if (!array_key_exists(\"username\",$attributes)){ return (\"Missing compulsory field [username]\"); }\n if (!array_key_exists(\"firstname\",$attributes)){ return (\"Missing compulsory field [firstname]\"); }\n if (!array_key_exists(\"surname\",$attributes)){ return (\"Missing compulsory field [surname]\"); }\n if (!array_key_exists(\"email\",$attributes)){ return (\"Missing compulsory field [email]\"); }\n if (!array_key_exists(\"container\",$attributes)){ return (\"Missing compulsory field [container]\"); }\n if (!is_array($attributes[\"container\"])){ return (\"Container attribute must be an array.\"); }\n\n if (array_key_exists(\"password\",$attributes) && !$this->_use_ssl){ \n // Modified by SysCo/al\n $this->_error = TRUE;\n $this->_error_message = 'FATAL: SSL must be configured on your webserver and enabled in the class to set passwords.';\n exit();\n }\n\n if (!array_key_exists(\"display_name\",$attributes)){ $attributes[\"display_name\"]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"]; }\n\n //translate the schema\n $add=$this->adldap_schema($attributes);\n \n //additional stuff only used for adding accounts\n $add[\"cn\"][0]=$attributes[\"display_name\"];\n $add[$this->_cn_identifier][0]=$attributes[\"username\"];\n $add[\"objectclass\"][0]=\"top\";\n $add[\"objectclass\"][1]=\"person\";\n $add[\"objectclass\"][2]=\"organizationalPerson\";\n $add[\"objectclass\"][3]=\"user\"; //person?\n //$add[\"name\"][0]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"];\n\n //set the account control attribute\n $control_options=array(\"NORMAL_ACCOUNT\");\n if (!$attributes[\"enabled\"]){ $control_options[]=\"ACCOUNTDISABLE\"; }\n $add[\"userAccountControl\"][0]=$this->account_control($control_options);\n //echo (\"<pre>\"); print_r($add);\n\n //determine the container\n $attributes[\"container\"]=array_reverse($attributes[\"container\"]);\n $container=\"OU=\".implode(\",OU=\",$attributes[\"container\"]);\n\n //add the entry\n $result=@ldap_add($this->_conn, \"CN=\".$add[\"cn\"][0].\", \".$container.\",\".$this->_base_dn, $add);\n if ($result!=true){ return (false); }\n \n return (true);\n }", "function getUserName($us_id)\n\t{\n\t\t$func = create_function('$id',$this->UserNameFunc);\n\t\treturn $func($us_id);\n\t}", "public function getNameIdentificationBd() {\n global $advancedCustomUser;\n if (!empty($this->name) && empty($advancedCustomUser->doNotIndentifyByName)) {\n return $this->name;\n }\n if (!empty($this->email) && empty($advancedCustomUser->doNotIndentifyByEmail)) {\n return $this->email;\n }\n if (!empty($this->user) && empty($advancedCustomUser->doNotIndentifyByUserName)) {\n return $this->user;\n }\n if (!empty($this->channelName)) {\n return $this->channelName;\n }\n return __(\"Unknown User\");\n }", "public function getNameForDisplay()\n {\n if (null !== $this->getName() && '' !== $this->getName()) {\n return $this->getName();\n } elseif (1 == $this->getRealUserName()) {\n return $this->getUsername();\n }\n\n return $this->getEmail();\n }", "public function DisplayName() {\n\t\t\n\t\tif (!empty($this->profil)) {\n\t\t\t\n\t\t\treturn $this->profil['user']['displayName'];\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "function getUsername(){return $this->getName();}", "function p_usrnam($username)\n{\n\treturn config_item(\"username_as_lowercase\")? lc($username) : $username;\n}", "public function setDisplayNameAction($header_data,$name){ \n try {\n $user = Users::findById($header_data['id']);\n if(empty($name)) {\n $user->username = '';\n } else {\n $user->username = $name;\n }\n $user->save();\n Library::output(true, '1', USER_NAME_SAVED, null);\n } catch (Exception $e) {\n Library::logging('error',\"API : setDisplayName : \".$e.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n }", "function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }", "public function getGivenName ();", "function create_user()\n{\n\t// Check to see if the account is admin\n\t$account_type = account_type();\n\t\n\tif ( $account_type == 0 )\n\t{\n\t\t// Connect to the database\n\t\t$link = dbConnect();\n\t\t\n\t\t$query = mysql_query( \"SELECT first_name, last_name FROM BCD_User WHERE username = '\" . $_SESSION[ 'username' ] . \"'\" );\n\t\t\n\t\t// Close the database\n\t\tdbClose( $link );\n\t}\n}", "public function GetUserName ();", "public function generateUsername(){\n $this->username = strtolower(substr($this->firstname,0,1).$this->lastname.$this->id());\n }", "public function getAuthorName()\n {\n return $this->author ? $this->author : $this->createUser->firstname . ' ' . $this->createUser->lastname;\n }", "public function getDisplayHolderNameAttribute()\n {\n if ($this->user_id) return $this->user->displayName;\n return '<a href=\"http://'.$this->alias.'.deviantart.com\">'.$this->alias.'@dA</a>';\n }", "public static function getNameIdentification() {\n global $advancedCustomUser;\n if (self::isLogged()) {\n if (!empty(self::getName()) && empty($advancedCustomUser->doNotIndentifyByName)) {\n return self::getName();\n }\n if (!empty(self::getMail()) && empty($advancedCustomUser->doNotIndentifyByEmail)) {\n return self::getMail();\n }\n if (!empty(self::getUserName()) && empty($advancedCustomUser->doNotIndentifyByUserName)) {\n return self::getUserName();\n }\n if (!empty(self::getUserChannelName())) {\n return self::getUserChannelName();\n }\n }\n return __(\"Unknown User\");\n }", "public function getUserOrProperName()\n {\n $person = $this->getPerson();\n if (strtolower($person->getEmail()) != strtolower($this->username)) {\n return $this->username;\n } else {\n $init = substr($person->getFirstname(), 0, 1);\n return \"{$init}. {$person->getLastname()}\";\n }\n }", "function phptemplate_username($object) {\r\n if ($object->uid && $object->name) {\r\n // Shorten the name when it is too long or it will break many tables.\r\n if (drupal_strlen($object->name) > 20) {\r\n $name = drupal_substr($object->name, 0, 15) .'...';\r\n }\r\n else {\r\n $name = $object->name;\r\n }\r\n if (user_access('access user profiles')) {\r\n $output = l($name, 'user/'. $object->uid, array('attributes' => array('title' => t('View user profile.'))));\r\n }\r\n else {\r\n $output = check_plain($name);\r\n }\r\n }\r\n else if ($object->name) {\r\n // Sometimes modules display content composed by people who are\r\n // not registered members of the site (e.g. mailing list or news\r\n // aggregator modules). This clause enables modules to display\r\n // the true author of the content.\r\n if (!empty($object->homepage)) {\r\n $output = l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow')));\r\n }\r\n else {\r\n $output = check_plain($object->name);\r\n }\r\n // Display or hide 'not verified' text\r\n if (theme_get_setting('user_notverified_display') == 1) {\r\n $output .= ' ('. t('not verified') .')';\r\n }\r\n }\r\n else {\r\n $output = variable_get('anonymous', t('Anonymous'));\r\n }\r\n return $output;\r\n}", "private function userDisplay() {\n $showHandle = $this->get('username');\n if (isset($showHandle)) {\n echo '<li class=\"user-handle\">'.$showHandle.'</li>';\n }\n }", "public function name()\n\t{\n\t\treturn User::info('Username');\n\t}", "function get_user_full_name() {\n echo $_SESSION['SESS_USER_FIRST'] . ' ' . $_SESSION['SESS_USER_LAST'];\n }", "function getDisplayName(){\n\t\treturn $this->display_name;\n\t}", "function getUserName() {\n\t\treturn $this->nickname;\n\t\t/*\n\t\tif(!$this->user_name) {\n\t\t\t$this->sql(\"SELECT nickname FROM \".UT_USE.\" WHERE id = \".$this->user_id);\n\t\t\t$this->user_name = $this->getQueryResult(0, \"nickname\");\n \t\t}\n\t\treturn $this->user_name;\n\t\t*/\n\t}", "function _create_proper_name_field() {\r\n global $locale;\r\n $full_name = $locale->getLocaleFormattedName($this->first_name, $this->last_name, $this->salutation);\r\n $this->name = $full_name;\r\n $this->full_name = $full_name; \r\n\r\n\t}", "function getUserName()\r\n\t{\r\n\t\treturn $this->UserName;\r\n\t}", "private function retrieve_name() {\n\t\t$replacement = null;\n\n\t\t$user_id = $this->retrieve_userid();\n\t\t$name = get_the_author_meta( 'display_name', $user_id );\n\t\tif ( $name !== '' ) {\n\t\t\t$replacement = $name;\n\t\t}\n\n\t\treturn $replacement;\n\t}", "public function getOwnerusername() {}", "function getUserName() {\n return $this->userName . \".guest\";\n }", "function getFirst_Name(){\n$user = $this->loadUserLogin(Yii::app()->user->user_id);\nreturn $user->first_name;\n}", "public function getMemberName() {\n return Html::a( $this->user->username, Yii::$app->params['url_admin'].'/user/view?id='.$this->user->id );\n }", "public function getName(): string {\n\t\treturn $this->l10nFactory->get('user_ldap')->t('LDAP User backend');\n\t}", "public function user_create($attributes){\n // Check for compulsory fields\n if (!array_key_exists(\"username\",$attributes)){ return (\"Missing compulsory field [username]\"); }\n if (!array_key_exists(\"firstname\",$attributes)){ return (\"Missing compulsory field [firstname]\"); }\n if (!array_key_exists(\"surname\",$attributes)){ return (\"Missing compulsory field [surname]\"); }\n if (!array_key_exists(\"email\",$attributes)){ return (\"Missing compulsory field [email]\"); }\n if (!array_key_exists(\"container\",$attributes)){ return (\"Missing compulsory field [container]\"); }\n if (!is_array($attributes[\"container\"])){ return (\"Container attribute must be an array.\"); }\n\n if (array_key_exists(\"password\",$attributes) && (!$this->_use_ssl && !$this->_use_tls)){ \n throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');\n }\n\n if (!array_key_exists(\"display_name\",$attributes)){ $attributes[\"display_name\"]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"]; }\n\n // Translate the schema\n $add=$this->adldap_schema($attributes);\n \n // Additional stuff only used for adding accounts\n if (isset($attributes['cn'])) {\n \t$add['cn'][0]=$attributes['cn']; // EXTENDED by CST\n } else {\n \t$add[\"cn\"][0]=$attributes[\"display_name\"];\n }\n $add[\"samaccountname\"][0]=$attributes[\"username\"];\n $add[\"objectclass\"][0]=\"top\";\n $add[\"objectclass\"][1]=\"person\";\n $add[\"objectclass\"][2]=\"organizationalPerson\";\n $add[\"objectclass\"][3]=\"user\"; //person?\n //$add[\"name\"][0]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"];\n\n // Set the account control attribute\n $control_options=array(\"NORMAL_ACCOUNT\");\n if (!$attributes['enabled']){ $control_options[]=\"ACCOUNTDISABLE\"; }\n $add[\"userAccountControl\"][0]=$this->account_control($control_options);\n //echo (\"<pre>\"); print_r($add);\n\n // Determine the container\n $attributes[\"container\"]=array_reverse($attributes[\"container\"]);\n $container=\"OU=\".implode(\",OU=\",$attributes[\"container\"]);\t\t\n\t\t\n\t\t// Add the entry\n\t\t$result=@ldap_add($this->_conn, \"CN=\".$add[\"cn\"][0].\", \".$container.\",\".$this->_base_dn, $add); \n if ($result!=true){ return (false); }\n\t\t\n return (true);\n }", "public function getUserName();", "public function getUserName() {}", "function getUnameFromId( $userid = 0, $usereal = 0, $is_linked = 1 )\n {\t\t\n\t\tif (isset($this)) {\n\t\t\t$zariliaUser = &$this;\n\t\t} else {\n\t\t\tglobal $zariliaUser;\n\t\t}\t\t\n $name = '';\n $userid = intval( $userid ) > 0 ? intval( $userid ) : $zariliaUser->getVar( 'uid' );\n $usereal = intval( $usereal );\n if ( $userid > 0 ) {\n $member_handler = &zarilia_gethandler( 'member' );\n $user = &$member_handler->getUser( $userid );\n if ( is_object( $user ) ) {\n if ( $usereal ) {\n $name = htmlSpecialChars( $user->getVar( 'name' ), ENT_QUOTES );\n } else {\n $name = htmlSpecialChars( $user->getVar( 'uname' ), ENT_QUOTES );\n }\n }\n if ( $is_linked ) {\n $name = '<a href=\"' . ZAR_URL . '/index.php?page_type=userinfo&uid=' . $userid . '\">' . $name . '</a>';\n }\n } else {\n $name = $GLOBALS['zariliaConfig']['anonymous'];\n }\n return $name;\n }", "public function getUserName()\n {\n return $this->user_name;\n }", "public function getUserFullName() {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getHumanName();", "public function username(){\n \treturn $this->users->name.' '.$this->users->ape;\n }", "public function displayName()\n {\n if (isset($this->data['name']) && config('gzero.use_users_nicks')) {\n return $this->data['name'];\n }\n\n if (isset($this->data['first_name']) || isset($this->data['last_name'])) {\n return $this->data['first_name'] . ' ' . $this->data['last_name'];\n }\n\n return trans('gzero-core::common.anonymous');\n }", "public function getUserName()\n {\n return $this->getName();\n }", "public function getName()\n {\n $firstName = $this->getFieldValue(self::FIELD_FIRST_NAME);\n $lastName = $this->getFieldValue(self::FIELD_LAST_NAME);\n // User does not exist.\n if (!$firstName && !$lastName) {\n $name = 'Unknown&nbsp;User';\n } else {\n $name = \"{$firstName} {$lastName}\";\n }\n\n return $name;\n }", "function getRHUL_FullName() {\n return getRHUL_FirstName() . \" \" . getRHUL_LastName();\n}", "public function createUser () {\n syslog( LOG_INFO, 'Create a Lineberty User \\n' );\n\n $url = '/users';\n\n return $this->runRequest($url, 'POST', null);\n }", "function get_displayname($username)\n{\n if ($username == do_lang('UNKNOWN')) {\n return $username;\n }\n if ($username == do_lang('GUEST')) {\n return $username;\n }\n if ($username == do_lang('DELETED')) {\n return $username;\n }\n\n if (method_exists($GLOBALS['FORUM_DRIVER'], 'get_displayname')) {\n $displayname = $GLOBALS['FORUM_DRIVER']->get_displayname($username);\n return ($displayname === null) ? $username : $displayname;\n }\n\n return $username;\n}", "public function getUserName() {\n if (isset($this->rUser)) {\n return $this->rUser->getFullName();\n }\n return '';\n }", "function userName($user_id)\n {\n global $obj_rep;\n \n $condtion = \" user_id='\" . $user_id . \"'\";\n \n $sql = $obj_rep->query(\"first_name,last_name\", \"user_registration\", $condtion);\n \n $result = $obj_rep->get_all_row($sql);\n return $fullName = $result['first_name'] . \" \" . $result['last_name'];\n }", "public function getUserName()\n {\n return $this->getUserAttribute(static::ATTRIBUTE_NAME);\n }", "function util_getUsableName($displayName, $firstName, $lastName, $email)\n{\n\t$displayName = trim($displayName);\n\tif (!empty($displayName))\n\t{\n\t\treturn $displayName ;\n\t}\n\telse\n\t{\n\t\t$displayName = trim($firstName . \" \" . $lastName);\n\t\tif (!empty($displayName))\n\t\t{\n\t\t\treturn $displayName ;\n\t\t}\n\t\t\n\t\t$email = trim($email);\n\t\tif (!empty($email))\n\t\t{\n\t\t\t$parts = explode('@', $email);\n\t\t\t$displayName = (count($parts) > 0) ? ucfirst($parts[0]) : '' ;\n\t\t}\n\t}\n\t\n\treturn $displayName ;\n}", "function getFirst_Name(){\n $user = $this->loadUser(Yii::app()->user->id);\n\treturn $user->firstname;\n }", "public function getUserNameIdentifier()\n {\n return $this->user_name;\n }", "public function getCreator()\n\t{\n\t\treturn UserUtil::getUser($this->creator)->getFullName();\n\t}", "public function getDisplayName() {}", "public function printCreatedBy()\n {\n if ($this->createdBy->status == User::STATUS_DELETED) {\n return Html::tag('em', \\Yii::t('app', 'deleted'), ['class' => 'small']);\n }\n return Html::a($this->createdBy->username, ['/' . ForumModule::getInstance()->id . '/profile/view', 'id' => $this->createdBy->id], ['class' => 'link-secondary link-underline-opacity-0 link-underline-opacity-100-hover']);\n }", "static function getUserDisplayNameById($id, $short = false) {\n $user = DB::executeFirstRow('SELECT first_name, last_name, email FROM ' . TABLE_PREFIX . 'users WHERE id = ?', $id);\n \n if($user) {\n return Users::getUserDisplayName($user, $short);\n } else {\n return null;\n } // if\n }", "public function getUserTitle() {\n\t\tif ($this->userTitle) return StringUtil::encodeHTML($this->userTitle);\n\t\telse if ($this->rank) return WCF::getLanguage()->get(StringUtil::encodeHTML($this->rank->rankTitle));\n\t}", "public static function displayName(): string;", "public function getUsersName(){\n //Get the Id\n $userId = $_GET[\"userId\"];\n //Gets the users name \n $usersName = $this->individualGroupModel->getTheUsersName($userId); \n //echos out a created users name given the first and last name\n echo $usersName->User_First_Name . \" \" . $usersName->User_Last_Name;\n }", "function user_name($user = false)\n{\n $user = $user ? $user : $GLOBALS['user'];\n\n // first check if the name is in the DB\n if ($info = user_info($user))\n return $info['name'];\n\n //no, it isn't. fetch it from the master server\n return master_user_name($user);\n}", "function getUsername()\n\t{\n\t\treturn $this->Info['Username'];\n\t}", "protected function createUser ()\n {\n /* Method of the UserFactory class */\n $this->_objUser = UserFactory::createUser(ucfirst($_SESSION[\"userType\"])); \n $this->_objUser->setFirstName($_SESSION[\"emailID\"]);\n }", "public function getDisplayName() {\r\n $displayName = $this->fname.' '.$this->lname;\r\n if(strlen($displayName) <= 1) {\r\n $displayName = explode('@',$this->email);\r\n return($displayName[0]);\r\n }\r\n return($displayName);\r\n }", "function getLabel() {\n\t\treturn $this->getUsername();\n\t}", "public function getUsername()\n {\n return $this->getDuckname();\n }", "public function getName() {\n\t\tif($this->_name)\n\t\t\treturn $this->_name;\n\t\tif ($this->first_name != '')\n\t\t\treturn $this->first_name . ($this->last_name ? ' ' . $this->last_name : '');\n\t\telse\n\t\t\treturn $this->username ? $this->username : $this->email;\n\t}", "public function getName()\n {\n // Look for value only if not already set\n if (!isset($this->name)) {\n $us = SemanticScuttle_Service_Factory::get('User');\n $user = $us->getUser($this->id);\n $this->name = $user['name'];\n }\n return $this->name;\n }", "public function getFullName()\n {\n if (! $this->_getVar('user_name')) {\n $name = ltrim($this->_getVar('user_first_name') . ' ') .\n ltrim($this->_getVar('user_surname_prefix') . ' ') .\n $this->_getVar('user_last_name');\n\n if (! $name) {\n // Use obfuscated login name\n $name = $this->getLoginName();\n $name = substr($name, 0, 3) . str_repeat('*', max(5, strlen($name) - 2));\n }\n\n $this->_setVar('user_name', $name);\n\n // \\MUtil_Echo::track($name);\n }\n\n return $this->_getVar('user_name');\n }", "public function getDisplayname()\n\t{\n\t\treturn $this->displayname;\n\t}", "public function getUser_lname()\n {\n return $this->user_lname;\n }", "function displayName() {\n\n // call the database variable\n global $db;\n\n $sql = \"SELECT * from users WHERE id='\".$_SESSION['my_id'].\"'\";\n $result = $db-> query($sql);\n\n if ($result-> num_rows > 0) {\n while ($user = $result->fetch_assoc()) {\n\n if ($user['fname'] && $user['lname'] != null) {\n echo $user['fname'] . \" \" . $user['lname'];\n } else {\n echo $user['email'];\n }\n\n }\n }\n\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "function gratis_preprocess_username(&$vars) {\n // Update the username so it's the full name of the user.\n $account = $vars['account'];\n\n // Revise the name trimming done in template_preprocess_username.\n $name = $vars['name_raw'] = format_username($account);\n\n // Trim the altered name as core does, but with a higher character limit.\n if (drupal_strlen($name) > 35) {\n $name = drupal_substr($name, 0, 18) . '...';\n }\n\n // Assign the altered name to $vars['name'].\n $vars['name'] = check_plain($name);\n}", "public function feide_name() {\n\t\t\tif(isset($this->attributes['displayName'][0])) {\n\t\t\t\t$this->feide_name = $this->attributes['displayName'][0];\n\t\t\t\t// echo \"displayName set!!!\";\n\t\t\t} else if(isset($this->attributes['givenName'][0]) && isset($this->attributes['sn'][0])) {\n\t\t\t\t$this->feide_name = $this->attributes['givenName'][0] . ' ' . $this->attributes['sn'][0];\n\t\t\t\t// echo \"givenName/sn set!!!\";\n\t\t\t} else if(isset($this->attributes['cn'][0])) {\n\t\t\t\t$this->feide_name = $this->attributes['cn'][0];\n\t\t\t\t// echo \"cn set!!!\";\n\t\t\t} // FALLBACK IF NO NAME IS ACCESSIBLE FROM ANY OF THE ABOVE ATTRIBS...\n\t\t\telse {\n\t\t\t\t$this->feide_name = $this->attributes['eduPersonPrincipalName'][0];\n\t\t\t}\n\n\t\t\treturn $this->feide_name;\n\t\t}", "function identifyUser() {\n}", "public function getUserName() {\n\t\tif(($username=$this->getState('__username'))!==null) return $username;\n\t\telse return NULL;\n\t}" ]
[ "0.701753", "0.6982576", "0.69400346", "0.68017745", "0.67323995", "0.6725332", "0.6624461", "0.66169864", "0.6601405", "0.6553752", "0.6485967", "0.6474154", "0.6438809", "0.64247125", "0.64222777", "0.6411011", "0.64054996", "0.63948095", "0.63901496", "0.63757926", "0.637059", "0.63540274", "0.6342763", "0.6336718", "0.6292597", "0.6292522", "0.6240901", "0.62168187", "0.6192752", "0.61813134", "0.61703616", "0.61543965", "0.61294097", "0.61279863", "0.61276245", "0.6123647", "0.61156327", "0.6105091", "0.6103157", "0.6101555", "0.6099752", "0.6079831", "0.607109", "0.606515", "0.6063249", "0.605218", "0.6050387", "0.6048655", "0.6046807", "0.60427", "0.60242885", "0.6016854", "0.60092735", "0.60057324", "0.59969866", "0.59941065", "0.5983885", "0.598226", "0.5980451", "0.5980397", "0.5977464", "0.59735477", "0.5970067", "0.596895", "0.5950982", "0.59497195", "0.59481364", "0.5944899", "0.593193", "0.59274167", "0.5927073", "0.5920575", "0.5919323", "0.59107786", "0.591025", "0.58965755", "0.58940375", "0.58907306", "0.5889602", "0.58890265", "0.5885684", "0.5881749", "0.58815336", "0.5880069", "0.5877188", "0.5870341", "0.5865166", "0.5864266", "0.5860895", "0.585646", "0.5850459", "0.5850188", "0.58490896", "0.5847485", "0.5847485", "0.5847485", "0.58437496", "0.5843661", "0.58368886", "0.5833794" ]
0.7530642
0
Jamie Alnasir, created. Obtain RHUL User's first name from currently logged in, LDAP authenticated RHUL user
function getRHUL_FirstName() { return getRHUL_LDAP_FieldValue("first_name"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRHUL_DisplayName() {\n\treturn getRHUL_LDAP_FieldValue(\"adi_givenname\");\n}", "public function diviroids_user_firstname($atts)\n {\n return DiviRoids_Security::get_current_user('user_firstname');\n }", "function getRHUL_LastName() {\n return getRHUL_LDAP_FieldValue(\"last_name\");\n}", "Public Function getUserName()\n\t{\n\t\treturn $this->firstName . ' ' . $this->lastName;\n\t}", "public function getHonoreeFirstName();", "public function getUserOrProperName()\n {\n $person = $this->getPerson();\n if (strtolower($person->getEmail()) != strtolower($this->username)) {\n return $this->username;\n } else {\n $init = substr($person->getFirstname(), 0, 1);\n return \"{$init}. {$person->getLastname()}\";\n }\n }", "public function getUserFirstName() :string {\n\t\treturn($this->userFirstName);\n\t}", "function getFirst_Name(){\n $user = $this->loadUser(Yii::app()->user->id);\n\treturn $user->firstname;\n }", "public function getGivenName ();", "function getFirst_Name() {\n $user = $this->loadUser(Yii::app()->user->id);\n return $user->first_name;\n }", "function get_user_name() {\n return $this->call('get_user_name', array(), TRUE);\n }", "public function getExternalUserName();", "public function requestFirstname();", "public function getuserFirstName()\n {\n return $this->userFirstName;\n }", "function user_name () {\r\n\t$info = user_info();\r\n\treturn (isset($info[1]) ? $info[1] : 'default');\r\n}", "public function get_user_name() { \n\n\t\tif ($this->user == '-1') { return _('All'); } \n\t\t\n\t\t$user = new User($this->user);\n\t\treturn $user->fullname . \" (\" . $user->username . \")\";\n\t\t\n\t}", "public function diviroids_user_lastname($atts)\n {\n return DiviRoids_Security::get_current_user('user_lastname');\n }", "public function getFirstUserName() {\n\t\treturn $this->firstUserName;\n\t}", "protected function user()\n {\n if ($this->wrappedObject->security) {\n return ' this user\\'s ';\n }\n\n $user = $this->wrappedObject->revisionable()->withTrashed()->first(['first_name', 'last_name']);\n\n return ' '.$user->first_name.' '.$user->last_name.'\\'s ';\n }", "public function getUserFirstName () {\n\t\treturn ($this->userFirstName);\n\t}", "function getFirst_Name(){\n$user = $this->loadUserLogin(Yii::app()->user->user_id);\nreturn $user->first_name;\n}", "public function usualname()\n\t{\n\t\treturn coalesce(User::info('UsualName'), User::info('Username'));\n\t}", "function getUsername(){return $this->getName();}", "private function updateName()\n {\n if (!LOCAL) {\n $ds = ldap_connect(\"addressbook.ic.ac.uk\");\n $r = ldap_bind($ds);\n $justthese = array(\"displayname\");\n $sr = ldap_search(\n $ds,\n \"ou=People,ou=shibboleth,dc=ic,dc=ac,dc=uk\",\n \"uid=\".$this->getUser(),\n $justthese\n );\n $info = ldap_get_entries($ds, $sr);\n if ($info[\"count\"] > 0) {\n $this->setName($info[0]['displayname'][0]);\n return ($info[0]['displayname'][0]);\n } else {\n return false;\n }\n } else {\n $name = $this->getName();\n return $name;\n }\n }", "function getUserName()\r\n\t{\r\n\t\treturn $this->UserName;\r\n\t}", "public function name() {\n return isset($this->_adaptee->user_info['user_displayname']) ? $this->_adaptee->user_info['user_displayname'] : null;\n }", "public function generateUsername(){\n $this->username = strtolower(substr($this->firstname,0,1).$this->lastname.$this->id());\n }", "function getUserName($us_id)\n\t{\n\t\t$func = create_function('$id',$this->UserNameFunc);\n\t\treturn $func($us_id);\n\t}", "function userName($user_id)\n {\n global $obj_rep;\n \n $condtion = \" user_id='\" . $user_id . \"'\";\n \n $sql = $obj_rep->query(\"first_name,last_name\", \"user_registration\", $condtion);\n \n $result = $obj_rep->get_all_row($sql);\n return $fullName = $result['first_name'] . \" \" . $result['last_name'];\n }", "public function getUserFullName() {\n return $this->first_name . ' ' . $this->last_name;\n }", "function getUserName() {\n\t\treturn $this->nickname;\n\t\t/*\n\t\tif(!$this->user_name) {\n\t\t\t$this->sql(\"SELECT nickname FROM \".UT_USE.\" WHERE id = \".$this->user_id);\n\t\t\t$this->user_name = $this->getQueryResult(0, \"nickname\");\n \t\t}\n\t\treturn $this->user_name;\n\t\t*/\n\t}", "public function GetUserName ();", "public function getAuthorName()\n {\n return $this->author ? $this->author : $this->createUser->firstname . ' ' . $this->createUser->lastname;\n }", "public function getUserName() {}", "function p_usrnam($username)\n{\n\treturn config_item(\"username_as_lowercase\")? lc($username) : $username;\n}", "public function getFullName()\n {\n if (! $this->_getVar('user_name')) {\n $name = ltrim($this->_getVar('user_first_name') . ' ') .\n ltrim($this->_getVar('user_surname_prefix') . ' ') .\n $this->_getVar('user_last_name');\n\n if (! $name) {\n // Use obfuscated login name\n $name = $this->getLoginName();\n $name = substr($name, 0, 3) . str_repeat('*', max(5, strlen($name) - 2));\n }\n\n $this->_setVar('user_name', $name);\n\n // \\MUtil_Echo::track($name);\n }\n\n return $this->_getVar('user_name');\n }", "public function getUserName()\n {\n return $this->user_name;\n }", "public function getFirstNameOrUsername() {\n return $this->first_name ? : $this->username;\n }", "public function getUserDisplayName();", "public function getName() {\n\t\tif($this->_name)\n\t\t\treturn $this->_name;\n\t\tif ($this->first_name != '')\n\t\t\treturn $this->first_name . ($this->last_name ? ' ' . $this->last_name : '');\n\t\telse\n\t\t\treturn $this->username ? $this->username : $this->email;\n\t}", "public function getUserName()\n {\n return $this->getName();\n }", "public function getCustomerFirstname();", "function getFirstName() {\n\t$COMMON = new Common($debug);\n\t$uID = $_SESSION[\"userID\"];\n\n\t$sql = \"select * from Proj2Advisors where `id` = '$uID'\";\n\t$rs = $COMMON->executeQuery($sql, $_SERVER[\"SCRIPT_NAME\"]);\n\t$row = mysql_fetch_row($rs);\n\n\t$name = $row[1];\n\treturn $name;\n}", "public function getUserName();", "public function getUserName() {\n\t\tif(($username=$this->getState('__username'))!==null) return $username;\n\t\telse return NULL;\n\t}", "public function name(): string {\n return (string) $this->user?->first_name;\n }", "function get_the_author_firstname()\n {\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "function UserFirstName($uid) {\n\t$uidarray = array('uid'=>new MongoId($uid));\n\t$uresult = FindOneInCollection('UserInfo', $uidarray);\nreturn $uresult['first_name'];\t\t\t\n}", "public function getUserName()\n {\n return $this->getUserAttribute(static::ATTRIBUTE_NAME);\n }", "public function getFirstname() {\n return $this->getValue('firstname');\n }", "function _create_proper_name_field() {\r\n global $locale;\r\n $full_name = $locale->getLocaleFormattedName($this->first_name, $this->last_name, $this->salutation);\r\n $this->name = $full_name;\r\n $this->full_name = $full_name; \r\n\r\n\t}", "public function getName()\n {\n $firstName = $this->getFieldValue(self::FIELD_FIRST_NAME);\n $lastName = $this->getFieldValue(self::FIELD_LAST_NAME);\n // User does not exist.\n if (!$firstName && !$lastName) {\n $name = 'Unknown&nbsp;User';\n } else {\n $name = \"{$firstName} {$lastName}\";\n }\n\n return $name;\n }", "function getUsername()\n\t{\n\t\treturn $this->Info['Username'];\n\t}", "function getPersonName($user) {\n if ($user==null || (!isset($user[\"lastname\"]) && !isset($user[\"firstname\"])) )\n return '';\n $ret =\"\";\n if (isset($user[\"title\"]))\n $ret = $user[\"title\"].' ';\n $ret .= $user[\"lastname\"].\" \".$user[\"firstname\"];\n if (isset($user[\"birthname\"]) && trim($user[\"birthname\"])!=\"\")\n $ret .= \" (\".trim($user[\"birthname\"]).\")\";\n return $ret;\n}", "public function getAccountRealName() {\n // cn is a standard LDAP attibute\n if (!empty($_SERVER['AUTHORIZE_CN']))\n return $_SERVER['AUTHORIZE_CN'];\n // Some installations may prefer to use displayName\n else if (!empty($_SERVER['AUTHORIZE_DISPLAYNAME']))\n return $_SERVER['AUTHORIZE_DISPLAYNAME'];\n // Some installations may populate the name field with the user's real\n // name. This seems to be erroneous, based on Microsoft documenting\n // this attribute as an RDN, so only use it as a last resort.\n else if (!empty($_SERVER['AUTHORIZE_NAME']))\n return $_SERVER['AUTHORIZE_NAME'];\n else\n return parent::getAccountRealName();\n }", "public function getUserName() {\n if (isset($this->rUser)) {\n return $this->rUser->getFullName();\n }\n return '';\n }", "function pilau_default_user_display_name( $user_id ) {\n\t\t// Fetch current user meta information\n\t\t$first = get_user_meta( $user_id, 'first_name', true );\n\t\t$last = get_user_meta( $user_id, 'last_name', true );\n\t\t$display = trim( $first . \" \" . $last );\n\t\t// Update\n\t\twp_update_user( array( \"ID\" => $user_id, \"display_name\" => $display ) );\n\t}", "public function getFirst_name()\r\n {\r\n return $this->first_name;\r\n }", "public function getUsername() {}", "public function getFirstName()\n {\n\t\t$res = $this->getEntity()->getFirstName();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getFirstName();\n\t\t}\n return $res;\n }", "function getFirstName() {\n\t\treturn $this->getInfo('FirstName');\n\t}", "public function getOwnerusername() {}", "public function getFirstname() {}", "public function getUserName()\n {\n return $this->formattedData['username'];\n }", "public function getUsername()\n {\n return $this->getDuckname();\n }", "function get_user_full_name() {\n echo $_SESSION['SESS_USER_FIRST'] . ' ' . $_SESSION['SESS_USER_LAST'];\n }", "function set_first_name($first_name='*')\r\n{\r\n\t$this->first_name = '';\t\t// return\r\n\t\r\n\t// Get Random Name\r\n\tif ( $first_name == '*' )\r\n\t{\r\n\t\tif ( !isset($this->gender) ) $this->set_gender();\r\n\t\t$this->first_name = $this->_get_random_first_name($this->gender);\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$this->first_name = $first_name;\r\n\t}\r\n\t\r\n\t// capitalize\r\n\t$this->first_name = ucwords($this->first_name);\r\n\t\r\n\t// adjust hyphenates\r\n\tif ( $_pos = strpos($this->first_name, '-') )\r\n\t{\r\n\t\t$this->first_name = substr($this->first_name, 0, $_pos+1) . '-' . ucwords( substr($this->first_name, $_pos+1) );\r\n\t}\r\n\t\r\n\treturn $this->first_name;\r\n}", "function getUserName()\n {\n if($this->isLogin())\n {\n $personId =$this->ci->session->userdata('personId');\n return $this->ci->Util_model->getUserName($personId);\n }\n else\n {\n return false;\n } \n }", "function gratis_preprocess_username(&$vars) {\n // Update the username so it's the full name of the user.\n $account = $vars['account'];\n\n // Revise the name trimming done in template_preprocess_username.\n $name = $vars['name_raw'] = format_username($account);\n\n // Trim the altered name as core does, but with a higher character limit.\n if (drupal_strlen($name) > 35) {\n $name = drupal_substr($name, 0, 18) . '...';\n }\n\n // Assign the altered name to $vars['name'].\n $vars['name'] = check_plain($name);\n}", "public function getUserName() {\n return $this->userName;\n }", "public function getUsername()\n {\n return $this->getName();\n }", "protected function _getRealName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function diviroids_user_displayname($atts)\n {\n return DiviRoids_Security::get_current_user('display_name');\n }", "function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }", "public function getNameIdentificationBd() {\n global $advancedCustomUser;\n if (!empty($this->name) && empty($advancedCustomUser->doNotIndentifyByName)) {\n return $this->name;\n }\n if (!empty($this->email) && empty($advancedCustomUser->doNotIndentifyByEmail)) {\n return $this->email;\n }\n if (!empty($this->user) && empty($advancedCustomUser->doNotIndentifyByUserName)) {\n return $this->user;\n }\n if (!empty($this->channelName)) {\n return $this->channelName;\n }\n return __(\"Unknown User\");\n }", "public function getUserName()\n {\n return $this->user->name;\n }", "public function getFirstName() {}", "public function getFirstName() {}", "public function getuserName()\n {\n return $this->userName;\n }", "public function getHonoreeLastName();", "function ffl_fix_user_display_name($user_id)\n{\n\t//set the display name\n\t$info = get_userdata( $user_id );\n \n\t$display_name = trim($info->first_name . ' ' . $info->last_name);\n\tif(!$display_name)\n\t\t$display_name = $info->user_login;\n\t\t\t \n\t$args = array(\n\t\t\t'ID' => $user_id,\n\t\t\t'display_name' => $display_name\n\t);\n \n\twp_update_user( $args ) ;\n}", "public function getUserName()\n {\n return $this->userName;\n }", "public function getUserName()\n {\n return $this->userName;\n }", "public function getUser_fname()\n {\n return $this->user_fname;\n }", "public function getUserName() {\n\t\treturn ($this->userName);\n\t}", "public function username() {\n\n $correctformat = $this->inputmanager;\n\n $name = $_POST['name'];\n\n return $correctformat->nameformt($name);\n\n }", "public function getFirstName()\n {\n return $this->first_name ?? $this->nickname ?? $this->name;\n }", "function getFirstName()\r\n\t{\r\n\t\treturn $this->FirstName;\r\n\t}", "public function getGivenName()\n {\n return $this->getProperty(\"GivenName\");\n }", "public function getFirstName();", "public function getFirstName()\n {\n return parent::getFirstName();\n }", "public function getFirstName(){\n \n return $this->first_name;\n \n }", "protected function createUser ()\n {\n /* Method of the UserFactory class */\n $this->_objUser = UserFactory::createUser(ucfirst($_SESSION[\"userType\"])); \n $this->_objUser->setFirstName($_SESSION[\"emailID\"]);\n }", "protected function generateUserName($personObj) {\n $len = strlen($personObj->firstname);\n $found = false;\n $count = 1;\n $accessMech = I2CE::getUserAccess();\n $username = false;\n while ($count <= $len) {\n $username = preg_replace(\"/\\s+/\",'',strtolower($personObj->surname . substr($personObj->firstname,0,$count)));\n if (!$accessMech->userExists($username,false)) {\n break;\n }\n $username = false;\n $count++;\n }\n if ($username) {\n return $username; \n }\n $count =0;\n do {\n $username = preg_replace(\"/\\s+/\".'',strtolower($personObj->surname . $count));\n $count++;\n } while ($accessMech->userExists($username,false));\n return $username;\n }", "function wac_vendor_name($user){\n\t$firstname = get_user_meta($user->ID,'first_name',true);\n\t$lastname = get_user_meta($user->ID,'last_name',true);\n\t\n\t$fullName = $user->data->user_nicename;\n\tif(!empty($firstname)){\n\t\t$fullName = trim($firstname.' '.$lastname);\n\t}\n\treturn $fullName;\n}", "public function getForename(){\n return $this->_getModelProperty('forename');\n }", "public function username(){\n \treturn $this->users->name.' '.$this->users->ape;\n }" ]
[ "0.7391707", "0.72755057", "0.7143627", "0.69097334", "0.678016", "0.67243993", "0.6723048", "0.67192423", "0.6713279", "0.67096895", "0.6649425", "0.66383636", "0.66374373", "0.6618861", "0.6598477", "0.6577183", "0.6573467", "0.65643364", "0.65478337", "0.65313697", "0.6527167", "0.6527067", "0.6468745", "0.64431894", "0.64415276", "0.64318013", "0.6430222", "0.6415271", "0.6409047", "0.6407682", "0.6375768", "0.6366645", "0.63629824", "0.6353725", "0.6343828", "0.634188", "0.6340928", "0.6340589", "0.6340369", "0.63394815", "0.63243675", "0.6306731", "0.62886983", "0.62827134", "0.6271441", "0.62693596", "0.6266798", "0.6266468", "0.6266468", "0.6266468", "0.62660015", "0.62575376", "0.62527245", "0.62518364", "0.6241509", "0.62391603", "0.62364197", "0.6234586", "0.62213254", "0.62106997", "0.62047863", "0.61935955", "0.61892015", "0.6186907", "0.61824954", "0.6182232", "0.61816096", "0.6178779", "0.61754024", "0.6170441", "0.61631155", "0.61618245", "0.61616457", "0.616111", "0.61609316", "0.61528647", "0.6150222", "0.6147298", "0.6147158", "0.6142127", "0.6142127", "0.61369187", "0.61316055", "0.61255157", "0.6121185", "0.6121185", "0.61172503", "0.6110362", "0.6108252", "0.6107171", "0.6106492", "0.6105766", "0.6102983", "0.6098697", "0.60956925", "0.6093151", "0.6091917", "0.60904086", "0.6084911", "0.60826594" ]
0.7825748
0
Jamie Alnasir, created. Obtain RHUL User's last name from currently logged in, LDAP authenticated RHUL user
function getRHUL_LastName() { return getRHUL_LDAP_FieldValue("last_name"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function diviroids_user_lastname($atts)\n {\n return DiviRoids_Security::get_current_user('user_lastname');\n }", "function getRHUL_DisplayName() {\n\treturn getRHUL_LDAP_FieldValue(\"adi_givenname\");\n}", "function getRHUL_FirstName() {\n return getRHUL_LDAP_FieldValue(\"first_name\");\n}", "public function getLastName();", "public function getLastname() {}", "public function getLastUserName() {\n\t\treturn $this->lastUserName;\n\t}", "public function getLastName() {}", "public function getLastName() {}", "public function getUserLastName () {\n\t\treturn ($this->userLastName);\n\t}", "public function getUser_lname()\n {\n return $this->user_lname;\n }", "public function getuserLastName()\n {\n return $this->userLastName;\n }", "public function getLastname(): string;", "public function getUserLastName() :string {\n\t\treturn($this->userFirstName);\n\t}", "public function getHonoreeLastName();", "public function getLastName(){\n \n return $this->last_name;\n \n }", "public function getLastname() {\n return $this->getValue('lastname');\n }", "function get_user_name() {\n return $this->call('get_user_name', array(), TRUE);\n }", "public function getLastName() {\n\t\treturn $this->getCustomField( 'last_name' );\n\t}", "public function getLastName() {\n\t\treturn $this->last_name;\n\t}", "public function getLastName(): string;", "Public Function getUserName()\n\t{\n\t\treturn $this->firstName . ' ' . $this->lastName;\n\t}", "public function getLastName()\n\t{\n\t\treturn $this->last_name;\n\t}", "public function get_user_name() { \n\n\t\tif ($this->user == '-1') { return _('All'); } \n\t\t\n\t\t$user = new User($this->user);\n\t\treturn $user->fullname . \" (\" . $user->username . \")\";\n\t\t\n\t}", "public function getLastName()\n {\n return $this->last_name;\n }", "public function getLastName()\n {\n return $this->last_name;\n }", "public function getLastName()\n {\n return $this->last_name;\n }", "public function getLastName()\n {\n return $this->last_name;\n }", "public function getLastName()\n {\n return $this->last_name;\n }", "public function getLastname()\r\n\t{\r\n\t\treturn $this->lastname;\r\n\t}", "public function getLastname()\r\n {\r\n return $this->lastname;\r\n }", "public function getCustomerLastname();", "public function getUserOrProperName()\n {\n $person = $this->getPerson();\n if (strtolower($person->getEmail()) != strtolower($this->username)) {\n return $this->username;\n } else {\n $init = substr($person->getFirstname(), 0, 1);\n return \"{$init}. {$person->getLastname()}\";\n }\n }", "public function getLastname() {\n\t\treturn $this->lastname;\n\t}", "function UserLastName($uid) {\n\t$uidarray = array('uid'=>new MongoId($uid));\n\t$uresult = FindOneInCollection('UserInfo', $uidarray);\nreturn $uresult['last_name'];\t\t\t\n}", "public function getLastNameAttribute(): string\n {\n if ($this->user !== null) {\n return $this->user->last_name;\n }\n return '';\n }", "function getLastName()\r\n\t{\r\n\t\treturn $this->LastName;\r\n\t}", "public function getLastName()\n {\n $res = $this->getEntity()->getLastName();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getLastName();\n\t\t}\n return $res;\n }", "public function getLastName() { return $this->lastName; }", "function getLastname()\n {\n return $this->lastname;\n }", "public function getLastName(){\n\t\t\treturn $this->lastname;\n\t\t}", "public function getLastname(): string\n {\n return $this->_lastname;\n }", "public function getLastname() {\n return $this->lastname;\n }", "public function getLastName() {\n\n return $this->last_name;\n\n }", "public function getUserFullName() {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getFullName()\n {\n if (! $this->_getVar('user_name')) {\n $name = ltrim($this->_getVar('user_first_name') . ' ') .\n ltrim($this->_getVar('user_surname_prefix') . ' ') .\n $this->_getVar('user_last_name');\n\n if (! $name) {\n // Use obfuscated login name\n $name = $this->getLoginName();\n $name = substr($name, 0, 3) . str_repeat('*', max(5, strlen($name) - 2));\n }\n\n $this->_setVar('user_name', $name);\n\n // \\MUtil_Echo::track($name);\n }\n\n return $this->_getVar('user_name');\n }", "public function getLastName() :string {\n\t\treturn (string)$this->last_name;\n\t}", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getExternalUserName();", "public function getLastname()\n {\n return $this->lastname;\n\n }", "function get_user_full_name() {\n echo $_SESSION['SESS_USER_FIRST'] . ' ' . $_SESSION['SESS_USER_LAST'];\n }", "public function name() {\n return isset($this->_adaptee->user_info['user_displayname']) ? $this->_adaptee->user_info['user_displayname'] : null;\n }", "public function getLastName()\n {\n return parent::getLastName();\n }", "public function get_last_name ( $user_id ) {\n\t\t// sanitize the data\n\t\t$user_id = intval( sanitize_text_field( $user_id ));\n\n\t\t$nickname = get_user_meta( $user_id, \"nickname\", true ) ;\n\t\t$last_name = get_user_meta( $user_id, \"last_name\", true ) ;\n\n\t\t// if last name empty thne use nickname\n\t\t$last_name = ( $last_name ) ? $last_name : $nickname ;\n\n\t\treturn $last_name;\n\t}", "public function getGivenName ();", "function user_name () {\r\n\t$info = user_info();\r\n\treturn (isset($info[1]) ? $info[1] : 'default');\r\n}", "protected function user()\n {\n if ($this->wrappedObject->security) {\n return ' this user\\'s ';\n }\n\n $user = $this->wrappedObject->revisionable()->withTrashed()->first(['first_name', 'last_name']);\n\n return ' '.$user->first_name.' '.$user->last_name.'\\'s ';\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "public function getUserProfileLastName(): string {\n\t\treturn ($this->userProfileLastName);\n\t}", "public function getUserLastName($user_id)\n\t{\n\t\t$user = $this->find($user_id);\n\t\treturn $user->last_name;\n\t}", "public function getUserDisplayName();", "protected function _getRealName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getLastName() {\n return($this->lastName);\n }", "public function getLastName() {\n return($this->lastName);\n }", "function getUserName() {\n\t\treturn $this->nickname;\n\t\t/*\n\t\tif(!$this->user_name) {\n\t\t\t$this->sql(\"SELECT nickname FROM \".UT_USE.\" WHERE id = \".$this->user_id);\n\t\t\t$this->user_name = $this->getQueryResult(0, \"nickname\");\n \t\t}\n\t\treturn $this->user_name;\n\t\t*/\n\t}", "public function getName()\n {\n $result = null;\n if (isset($this->userInfo['first_name']) && isset($this->userInfo['last_name'])) {\n $result = $this->userInfo['first_name'] . ' ' . $this->userInfo['last_name'];\n } elseif (isset($this->userInfo['first_name']) && !isset($this->userInfo['last_name'])) {\n $result = $this->userInfo['first_name'];\n } elseif (!isset($this->userInfo['first_name']) && isset($this->userInfo['last_name'])) {\n $result = $this->userInfo['last_name'];\n }\n return $result;\n }", "public function getLastName() {\n return $this->lastname;\n }", "public function getLastname()\n {\n return $this->lastname;\n }", "function get_the_author_lastname()\n {\n }", "function set_last_name($last_name='*')\r\n{\r\n\t$this->last_name = '';\t\t// return\r\n\t\r\n\t// get random name\r\n\tif ( $last_name == '*' )\r\n\t{\r\n\t\t$this->last_name = $this->_get_random_last_name();\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$this->last_name = $last_name;\r\n\t}\r\n\t\r\n\t// capitalize\r\n\t$this->last_name = ucwords($this->last_name);\r\n\t\r\n\t// tweaks\r\n\tif ( substr($this->last_name, 0, 2) == 'Mc' ) $this->last_name = 'Mc' . ucwords( substr($this->last_name, 2) );\r\n\t\r\n\treturn $this->last_name;\r\n}", "public function usualname()\n\t{\n\t\treturn coalesce(User::info('UsualName'), User::info('Username'));\n\t}", "public function getLastName()\n {\n return $this->get('LastName');\n }", "public function getLastName()\n {\n return $this->response['last_name'] ?: null;\n }", "public function getUserName() {\n if (isset($this->rUser)) {\n return $this->rUser->getFullName();\n }\n return '';\n }", "function getRHUL_FullName() {\n return getRHUL_FirstName() . \" \" . getRHUL_LastName();\n}", "public function getAccountRealName() {\n // cn is a standard LDAP attibute\n if (!empty($_SERVER['AUTHORIZE_CN']))\n return $_SERVER['AUTHORIZE_CN'];\n // Some installations may prefer to use displayName\n else if (!empty($_SERVER['AUTHORIZE_DISPLAYNAME']))\n return $_SERVER['AUTHORIZE_DISPLAYNAME'];\n // Some installations may populate the name field with the user's real\n // name. This seems to be erroneous, based on Microsoft documenting\n // this attribute as an RDN, so only use it as a last resort.\n else if (!empty($_SERVER['AUTHORIZE_NAME']))\n return $_SERVER['AUTHORIZE_NAME'];\n else\n return parent::getAccountRealName();\n }", "private function updateName()\n {\n if (!LOCAL) {\n $ds = ldap_connect(\"addressbook.ic.ac.uk\");\n $r = ldap_bind($ds);\n $justthese = array(\"displayname\");\n $sr = ldap_search(\n $ds,\n \"ou=People,ou=shibboleth,dc=ic,dc=ac,dc=uk\",\n \"uid=\".$this->getUser(),\n $justthese\n );\n $info = ldap_get_entries($ds, $sr);\n if ($info[\"count\"] > 0) {\n $this->setName($info[0]['displayname'][0]);\n return ($info[0]['displayname'][0]);\n } else {\n return false;\n }\n } else {\n $name = $this->getName();\n return $name;\n }\n }", "function userName($user_id)\n {\n global $obj_rep;\n \n $condtion = \" user_id='\" . $user_id . \"'\";\n \n $sql = $obj_rep->query(\"first_name,last_name\", \"user_registration\", $condtion);\n \n $result = $obj_rep->get_all_row($sql);\n return $fullName = $result['first_name'] . \" \" . $result['last_name'];\n }", "function getPersonLastName()\n {\n return $this->getValueByFieldName('person_lname');\n }", "public function getLastName()\n {\n return App_Formatting::emptyToNull($this->lastName->getValue());\n }", "public function getLastName(): string\n {\n return $this->lastName;\n }", "public function getLastName(): string\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->getProfile() ? $this->getProfile()->getLastName() : null;\n }", "public function getName() {\n\t\tif($this->_name)\n\t\t\treturn $this->_name;\n\t\tif ($this->first_name != '')\n\t\t\treturn $this->first_name . ($this->last_name ? ' ' . $this->last_name : '');\n\t\telse\n\t\t\treturn $this->username ? $this->username : $this->email;\n\t}", "public function getApplicantLastName()\n {\n return $this->getProperty('applicant_last_name');\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }", "public function getLastName()\n {\n return $this->lastName;\n }" ]
[ "0.7479828", "0.74220574", "0.73495203", "0.7298347", "0.7289797", "0.71917665", "0.7187261", "0.7187261", "0.7176694", "0.7137894", "0.71244526", "0.7068086", "0.70651025", "0.7016912", "0.70092475", "0.6988241", "0.6983635", "0.69517547", "0.6938907", "0.69175303", "0.69050545", "0.6892223", "0.6847168", "0.6845265", "0.6845265", "0.6845265", "0.6845265", "0.6845265", "0.68270683", "0.68178695", "0.6814279", "0.68100864", "0.68067664", "0.68012255", "0.6800762", "0.67900735", "0.678305", "0.6765496", "0.6752494", "0.6751426", "0.67219615", "0.6703505", "0.67005306", "0.66940004", "0.66911614", "0.66910744", "0.6690088", "0.6690088", "0.6690088", "0.6690088", "0.6690088", "0.6690088", "0.6690088", "0.6690088", "0.6685488", "0.6684774", "0.6681652", "0.6676156", "0.6666919", "0.665701", "0.66560596", "0.66438013", "0.6634187", "0.66181684", "0.6598644", "0.65908754", "0.6589767", "0.658081", "0.6573764", "0.6573764", "0.65716493", "0.657095", "0.65697074", "0.65694124", "0.65672284", "0.65583843", "0.655827", "0.6545122", "0.6521076", "0.65164787", "0.6510064", "0.6508262", "0.65028226", "0.6501598", "0.65015304", "0.6500041", "0.6478599", "0.6478599", "0.6478256", "0.6471962", "0.6468189", "0.64529425", "0.64529425", "0.64529425", "0.64529425", "0.64529425", "0.64529425", "0.64529425", "0.64529425", "0.64529425" ]
0.8195224
0
Jamie Alnasir, created. Obtain RHUL User's full name from currently logged in, LDAP authenticated RHUL user
function getRHUL_FullName() { return getRHUL_FirstName() . " " . getRHUL_LastName(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRHUL_DisplayName() {\n\treturn getRHUL_LDAP_FieldValue(\"adi_givenname\");\n}", "function getRHUL_LastName() {\n return getRHUL_LDAP_FieldValue(\"last_name\");\n}", "function getRHUL_FirstName() {\n return getRHUL_LDAP_FieldValue(\"first_name\");\n}", "public function get_user_name() { \n\n\t\tif ($this->user == '-1') { return _('All'); } \n\t\t\n\t\t$user = new User($this->user);\n\t\treturn $user->fullname . \" (\" . $user->username . \")\";\n\t\t\n\t}", "function user_name () {\r\n\t$info = user_info();\r\n\treturn (isset($info[1]) ? $info[1] : 'default');\r\n}", "public function diviroids_user_lastname($atts)\n {\n return DiviRoids_Security::get_current_user('user_lastname');\n }", "function get_user_name() {\n return $this->call('get_user_name', array(), TRUE);\n }", "public function getExternalUserName();", "Public Function getUserName()\n\t{\n\t\treturn $this->firstName . ' ' . $this->lastName;\n\t}", "public function usualname()\n\t{\n\t\treturn coalesce(User::info('UsualName'), User::info('Username'));\n\t}", "private function updateName()\n {\n if (!LOCAL) {\n $ds = ldap_connect(\"addressbook.ic.ac.uk\");\n $r = ldap_bind($ds);\n $justthese = array(\"displayname\");\n $sr = ldap_search(\n $ds,\n \"ou=People,ou=shibboleth,dc=ic,dc=ac,dc=uk\",\n \"uid=\".$this->getUser(),\n $justthese\n );\n $info = ldap_get_entries($ds, $sr);\n if ($info[\"count\"] > 0) {\n $this->setName($info[0]['displayname'][0]);\n return ($info[0]['displayname'][0]);\n } else {\n return false;\n }\n } else {\n $name = $this->getName();\n return $name;\n }\n }", "public function diviroids_user_firstname($atts)\n {\n return DiviRoids_Security::get_current_user('user_firstname');\n }", "public function generateUsername(){\n $this->username = strtolower(substr($this->firstname,0,1).$this->lastname.$this->id());\n }", "function p_usrnam($username)\n{\n\treturn config_item(\"username_as_lowercase\")? lc($username) : $username;\n}", "public function getFullName()\n {\n if (! $this->_getVar('user_name')) {\n $name = ltrim($this->_getVar('user_first_name') . ' ') .\n ltrim($this->_getVar('user_surname_prefix') . ' ') .\n $this->_getVar('user_last_name');\n\n if (! $name) {\n // Use obfuscated login name\n $name = $this->getLoginName();\n $name = substr($name, 0, 3) . str_repeat('*', max(5, strlen($name) - 2));\n }\n\n $this->_setVar('user_name', $name);\n\n // \\MUtil_Echo::track($name);\n }\n\n return $this->_getVar('user_name');\n }", "public function getGivenName ();", "public function getUserOrProperName()\n {\n $person = $this->getPerson();\n if (strtolower($person->getEmail()) != strtolower($this->username)) {\n return $this->username;\n } else {\n $init = substr($person->getFirstname(), 0, 1);\n return \"{$init}. {$person->getLastname()}\";\n }\n }", "function getUsername(){return $this->getName();}", "function user_create($attributes){\n //check for compulsory fields\n if (!array_key_exists(\"username\",$attributes)){ return (\"Missing compulsory field [username]\"); }\n if (!array_key_exists(\"firstname\",$attributes)){ return (\"Missing compulsory field [firstname]\"); }\n if (!array_key_exists(\"surname\",$attributes)){ return (\"Missing compulsory field [surname]\"); }\n if (!array_key_exists(\"email\",$attributes)){ return (\"Missing compulsory field [email]\"); }\n if (!array_key_exists(\"container\",$attributes)){ return (\"Missing compulsory field [container]\"); }\n if (!is_array($attributes[\"container\"])){ return (\"Container attribute must be an array.\"); }\n\n if (array_key_exists(\"password\",$attributes) && !$this->_use_ssl){ \n // Modified by SysCo/al\n $this->_error = TRUE;\n $this->_error_message = 'FATAL: SSL must be configured on your webserver and enabled in the class to set passwords.';\n exit();\n }\n\n if (!array_key_exists(\"display_name\",$attributes)){ $attributes[\"display_name\"]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"]; }\n\n //translate the schema\n $add=$this->adldap_schema($attributes);\n \n //additional stuff only used for adding accounts\n $add[\"cn\"][0]=$attributes[\"display_name\"];\n $add[$this->_cn_identifier][0]=$attributes[\"username\"];\n $add[\"objectclass\"][0]=\"top\";\n $add[\"objectclass\"][1]=\"person\";\n $add[\"objectclass\"][2]=\"organizationalPerson\";\n $add[\"objectclass\"][3]=\"user\"; //person?\n //$add[\"name\"][0]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"];\n\n //set the account control attribute\n $control_options=array(\"NORMAL_ACCOUNT\");\n if (!$attributes[\"enabled\"]){ $control_options[]=\"ACCOUNTDISABLE\"; }\n $add[\"userAccountControl\"][0]=$this->account_control($control_options);\n //echo (\"<pre>\"); print_r($add);\n\n //determine the container\n $attributes[\"container\"]=array_reverse($attributes[\"container\"]);\n $container=\"OU=\".implode(\",OU=\",$attributes[\"container\"]);\n\n //add the entry\n $result=@ldap_add($this->_conn, \"CN=\".$add[\"cn\"][0].\", \".$container.\",\".$this->_base_dn, $add);\n if ($result!=true){ return (false); }\n \n return (true);\n }", "protected function user()\n {\n if ($this->wrappedObject->security) {\n return ' this user\\'s ';\n }\n\n $user = $this->wrappedObject->revisionable()->withTrashed()->first(['first_name', 'last_name']);\n\n return ' '.$user->first_name.' '.$user->last_name.'\\'s ';\n }", "function getUserName($us_id)\n\t{\n\t\t$func = create_function('$id',$this->UserNameFunc);\n\t\treturn $func($us_id);\n\t}", "public function GetUserName ();", "public function getAccountRealName() {\n // cn is a standard LDAP attibute\n if (!empty($_SERVER['AUTHORIZE_CN']))\n return $_SERVER['AUTHORIZE_CN'];\n // Some installations may prefer to use displayName\n else if (!empty($_SERVER['AUTHORIZE_DISPLAYNAME']))\n return $_SERVER['AUTHORIZE_DISPLAYNAME'];\n // Some installations may populate the name field with the user's real\n // name. This seems to be erroneous, based on Microsoft documenting\n // this attribute as an RDN, so only use it as a last resort.\n else if (!empty($_SERVER['AUTHORIZE_NAME']))\n return $_SERVER['AUTHORIZE_NAME'];\n else\n return parent::getAccountRealName();\n }", "public function getUserFullName() {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function name() {\n return isset($this->_adaptee->user_info['user_displayname']) ? $this->_adaptee->user_info['user_displayname'] : null;\n }", "public function getUserName() {}", "public function getUserName();", "public function diviroids_user_displayname($atts)\n {\n return DiviRoids_Security::get_current_user('display_name');\n }", "public function getUserDisplayName();", "function _create_proper_name_field() {\r\n global $locale;\r\n $full_name = $locale->getLocaleFormattedName($this->first_name, $this->last_name, $this->salutation);\r\n $this->name = $full_name;\r\n $this->full_name = $full_name; \r\n\r\n\t}", "public function getOwnerusername() {}", "function create_user()\n{\n\t// Check to see if the account is admin\n\t$account_type = account_type();\n\t\n\tif ( $account_type == 0 )\n\t{\n\t\t// Connect to the database\n\t\t$link = dbConnect();\n\t\t\n\t\t$query = mysql_query( \"SELECT first_name, last_name FROM BCD_User WHERE username = '\" . $_SESSION[ 'username' ] . \"'\" );\n\t\t\n\t\t// Close the database\n\t\tdbClose( $link );\n\t}\n}", "function get_user_full_name() {\n echo $_SESSION['SESS_USER_FIRST'] . ' ' . $_SESSION['SESS_USER_LAST'];\n }", "public function personal_username($full_name){\r\n $random = mt_rand(00000, 99999);\r\n $username = url_title($full_name.$random);\r\n\r\n $query = $this->db->get_where('user', ['khojeko_username' => $username]);\r\n if($query->num_rows() == 0 )\r\n return $username;\r\n else\r\n $this->personal_username($full_name);\r\n }", "public function getUsername() {}", "public function getNameIdentificationBd() {\n global $advancedCustomUser;\n if (!empty($this->name) && empty($advancedCustomUser->doNotIndentifyByName)) {\n return $this->name;\n }\n if (!empty($this->email) && empty($advancedCustomUser->doNotIndentifyByEmail)) {\n return $this->email;\n }\n if (!empty($this->user) && empty($advancedCustomUser->doNotIndentifyByUserName)) {\n return $this->user;\n }\n if (!empty($this->channelName)) {\n return $this->channelName;\n }\n return __(\"Unknown User\");\n }", "function getUserName()\r\n\t{\r\n\t\treturn $this->UserName;\r\n\t}", "function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }", "function getUserName() {\n return $this->userName . \".guest\";\n }", "function userName($user_id)\n {\n global $obj_rep;\n \n $condtion = \" user_id='\" . $user_id . \"'\";\n \n $sql = $obj_rep->query(\"first_name,last_name\", \"user_registration\", $condtion);\n \n $result = $obj_rep->get_all_row($sql);\n return $fullName = $result['first_name'] . \" \" . $result['last_name'];\n }", "function UserLastName($uid) {\n\t$uidarray = array('uid'=>new MongoId($uid));\n\t$uresult = FindOneInCollection('UserInfo', $uidarray);\nreturn $uresult['last_name'];\t\t\t\n}", "public function username(){\n \treturn $this->users->name.' '.$this->users->ape;\n }", "public function getUsername()\n {\n return $this->getDuckname();\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "function getUserName() {\n\t\treturn $this->nickname;\n\t\t/*\n\t\tif(!$this->user_name) {\n\t\t\t$this->sql(\"SELECT nickname FROM \".UT_USE.\" WHERE id = \".$this->user_id);\n\t\t\t$this->user_name = $this->getQueryResult(0, \"nickname\");\n \t\t}\n\t\treturn $this->user_name;\n\t\t*/\n\t}", "function gratis_preprocess_username(&$vars) {\n // Update the username so it's the full name of the user.\n $account = $vars['account'];\n\n // Revise the name trimming done in template_preprocess_username.\n $name = $vars['name_raw'] = format_username($account);\n\n // Trim the altered name as core does, but with a higher character limit.\n if (drupal_strlen($name) > 35) {\n $name = drupal_substr($name, 0, 18) . '...';\n }\n\n // Assign the altered name to $vars['name'].\n $vars['name'] = check_plain($name);\n}", "function user_name($user = false)\n{\n $user = $user ? $user : $GLOBALS['user'];\n\n // first check if the name is in the DB\n if ($info = user_info($user))\n return $info['name'];\n\n //no, it isn't. fetch it from the master server\n return master_user_name($user);\n}", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername();", "function getCanonicalName( $username ) {\n return $username;\n }", "public function getFullname(): string;", "public function getLastname() {}", "public function GetFullName()\n {\n return $this->firstname . \" \" . $this->lastname . \" (\" . $this->username . \")\";\n }", "public function getUserName() {\n if (isset($this->rUser)) {\n return $this->rUser->getFullName();\n }\n return '';\n }", "public function user_create($attributes){\n // Check for compulsory fields\n if (!array_key_exists(\"username\",$attributes)){ return (\"Missing compulsory field [username]\"); }\n if (!array_key_exists(\"firstname\",$attributes)){ return (\"Missing compulsory field [firstname]\"); }\n if (!array_key_exists(\"surname\",$attributes)){ return (\"Missing compulsory field [surname]\"); }\n if (!array_key_exists(\"email\",$attributes)){ return (\"Missing compulsory field [email]\"); }\n if (!array_key_exists(\"container\",$attributes)){ return (\"Missing compulsory field [container]\"); }\n if (!is_array($attributes[\"container\"])){ return (\"Container attribute must be an array.\"); }\n\n if (array_key_exists(\"password\",$attributes) && (!$this->_use_ssl && !$this->_use_tls)){ \n throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');\n }\n\n if (!array_key_exists(\"display_name\",$attributes)){ $attributes[\"display_name\"]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"]; }\n\n // Translate the schema\n $add=$this->adldap_schema($attributes);\n \n // Additional stuff only used for adding accounts\n if (isset($attributes['cn'])) {\n \t$add['cn'][0]=$attributes['cn']; // EXTENDED by CST\n } else {\n \t$add[\"cn\"][0]=$attributes[\"display_name\"];\n }\n $add[\"samaccountname\"][0]=$attributes[\"username\"];\n $add[\"objectclass\"][0]=\"top\";\n $add[\"objectclass\"][1]=\"person\";\n $add[\"objectclass\"][2]=\"organizationalPerson\";\n $add[\"objectclass\"][3]=\"user\"; //person?\n //$add[\"name\"][0]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"];\n\n // Set the account control attribute\n $control_options=array(\"NORMAL_ACCOUNT\");\n if (!$attributes['enabled']){ $control_options[]=\"ACCOUNTDISABLE\"; }\n $add[\"userAccountControl\"][0]=$this->account_control($control_options);\n //echo (\"<pre>\"); print_r($add);\n\n // Determine the container\n $attributes[\"container\"]=array_reverse($attributes[\"container\"]);\n $container=\"OU=\".implode(\",OU=\",$attributes[\"container\"]);\t\t\n\t\t\n\t\t// Add the entry\n\t\t$result=@ldap_add($this->_conn, \"CN=\".$add[\"cn\"][0].\", \".$container.\",\".$this->_base_dn, $add); \n if ($result!=true){ return (false); }\n\t\t\n return (true);\n }", "public function display_name($uid = 0) {\r\n\t\tif ($uid > 0) {\r\n\t\t\t$uname = $this->core($uid)->get(\"username\");\r\n\t\t\t$rname = $this->core($uid)->get(\"name\");\r\n\t\t\tif (strtolower($uname == $rname)) {\r\n\t\t\t\treturn $uname;\r\n\t\t\t} else {\r\n\t\t\t\treturn $rname;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn $this->username(0);\r\n\t\t}\r\n\t}", "public function getAuthorName()\n {\n return $this->author ? $this->author : $this->createUser->firstname . ' ' . $this->createUser->lastname;\n }", "public function getUserName()\n {\n return $this->user_name;\n }", "function user_fullname($user) {\n\t$nick = (!empty($user->nickname)) ? \" '\".$user->nickname.\"' \" : \"\";\n\techo $user->user_firstname . $nick . $user->user_lastname;\n}", "public function username() {\n\n $correctformat = $this->inputmanager;\n\n $name = $_POST['name'];\n\n return $correctformat->nameformt($name);\n\n }", "function getUsername()\n\t{\n\t\treturn $this->Info['Username'];\n\t}", "public function getUser_lname()\n {\n return $this->user_lname;\n }", "private function generateUsername() {\n $name = \"\";\n $name = $this->generator->generateString(4, '2346789abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRTUVWXYZ');\n $table = 'participant_data';\n $conditions = array('passcode' => $name);\n $existing_users = $this->getListFromDB($table, $conditions);\n if (empty($existing_users)) {\n return $name; \n }\n else {\n return $this->generateUsername();\n }\n \n }", "public function getUsername()\n {\n }", "public function getUsername()\n {\n }", "function pilau_default_user_display_name( $user_id ) {\n\t\t// Fetch current user meta information\n\t\t$first = get_user_meta( $user_id, 'first_name', true );\n\t\t$last = get_user_meta( $user_id, 'last_name', true );\n\t\t$display = trim( $first . \" \" . $last );\n\t\t// Update\n\t\twp_update_user( array( \"ID\" => $user_id, \"display_name\" => $display ) );\n\t}", "public function getUserName()\n {\n return $this->getName();\n }", "function ffl_fix_user_display_name($user_id)\n{\n\t//set the display name\n\t$info = get_userdata( $user_id );\n \n\t$display_name = trim($info->first_name . ' ' . $info->last_name);\n\tif(!$display_name)\n\t\t$display_name = $info->user_login;\n\t\t\t \n\t$args = array(\n\t\t\t'ID' => $user_id,\n\t\t\t'display_name' => $display_name\n\t);\n \n\twp_update_user( $args ) ;\n}", "public function createUser () {\n syslog( LOG_INFO, 'Create a Lineberty User \\n' );\n\n $url = '/users';\n\n return $this->runRequest($url, 'POST', null);\n }", "function addLDAPUser($user_username, $user_password, $user_email, $user_namelast, $user_namefirst,$app_auto_user_activate){\n\t\t$this->db->sql('select * from users where username=:username limit 1');\n\t\t$this->db->addParam(\":username\",$user_username);\n\t\t$this->user_result = $this->db->execute();\n\t\t\n\t\t//if the user name doesn't exist add it and mark it as LDAP\n\t\tif( $this->db->getResultCount() == 0 ){\n\t\t\t$user_password = MD5($user_password);\n\t\t\t$this->db->sql('insert into user_audit_login (username, password, email, name_last, name_first, is_activated, is_ldap )values(:username, :password, :email, :name_last, :name_first, :is_activated, :is_ldap)');\n\t\t\t$this->db->addParam(\":username\",$user_username);\n\t\t\t$this->db->addParam(\":password\",$user_password);\n\t\t\t$this->db->addParam(\":email\",$user_email );\n\t\t\t$this->db->addParam(\":name_last\",$user_namelast);\n\t\t\t$this->db->addParam(\":name_first\",$user_namefirst);\n\t\t\t$this->db->addParam(\":is_activated\",$app_auto_user_activate);\n\t\t\t$this->db->addParam(\":is_ldap\",1);\n\t\t\t$this->db->execute();\n\t\t\t\n\t\t\t/* \n\t\t\t\tToDO:\n\t\t\t\tAdd roles\n\t\t\t\tAdd enterprises\n\t\t\t\t\n\t\t\t\t$CONFIG['model_LDAP_user_activate_roles']\t= array(\"guest\");\n\t\t\t\t$CONFIG['model_LDAP_user_activate_ent']\t\t= array(\"1\");\n\t\t\t*/\n\t\t\t\n\t\t}\n\t}", "public function name()\n\t{\n\t\treturn User::info('Username');\n\t}", "public function getName() {\n\t\tif($this->_name)\n\t\t\treturn $this->_name;\n\t\tif ($this->first_name != '')\n\t\t\treturn $this->first_name . ($this->last_name ? ' ' . $this->last_name : '');\n\t\telse\n\t\t\treturn $this->username ? $this->username : $this->email;\n\t}", "public function getFullNameWithLogin()\n\t{\n\t\treturn \"{$this->firstname} {$this->lastname} ({$this->login})\";\n\t}", "public function getLastName();", "public function getCreator()\n\t{\n\t\treturn UserUtil::getUser($this->creator)->getFullName();\n\t}", "public function getUsername() {\n }", "public function getUsersName(){\n //Get the Id\n $userId = $_GET[\"userId\"];\n //Gets the users name \n $usersName = $this->individualGroupModel->getTheUsersName($userId); \n //echos out a created users name given the first and last name\n echo $usersName->User_First_Name . \" \" . $usersName->User_Last_Name;\n }", "protected function _getRealName()\n {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getUserName()\n {\n return $this->getUserAttribute(static::ATTRIBUTE_NAME);\n }", "function getUserName()\n {\n if($this->isLogin())\n {\n $personId =$this->ci->session->userdata('personId');\n return $this->ci->Util_model->getUserName($personId);\n }\n else\n {\n return false;\n } \n }", "function GetUserFullName()\r\n{\r\n if(isset($_SESSION['firstname']) || isset($_SESSION['lastname'])){\r\n $userfullname = Escape($_SESSION['firstname']).\" \".Escape($_SESSION ['lastname']);\r\n return $userfullname;\r\n }\r\n return \"LoggedIn User\";\r\n}", "public function getLastname(): string;", "public function getUserName() : string\n {\n return $this->userName;\n }", "public function getUserName() : string\n {\n return $this->userName;\n }", "public function getUserName() {\n\t\tif(($username=$this->getState('__username'))!==null) return $username;\n\t\telse return NULL;\n\t}", "function GetName ()\n {\n $this->username = isset( $_SESSION [ \"username\" ] ) ? sanitize_string( $_SESSION [ \"username\" ] ) : null;\n if ( !$this->username ) {\n $this->username = isset( $_COOKIE [ \"username\" ] ) ? sanitize_string( $_COOKIE [ \"username\" ] ) : null;\n }\n $this->mongo->setCollection( COLLECTION_ADMINS );\n $data = $this->mongo->dataFindOne( array( \"username\" => $this->username ) );\n return isset( $data[ \"name\" ] ) ? $data[ \"name\" ] : \"?\";\n }", "public function getUsername()\n {\n return $this->getName();\n }", "public function getUserName()\n {\n return $this->formattedData['username'];\n }", "public function getUserName() {\n return $this->userName;\n }", "public function getHonoreeFirstName();", "public function getLastUserName() {\n\t\treturn $this->lastUserName;\n\t}", "function getPersonName($user) {\n if ($user==null || (!isset($user[\"lastname\"]) && !isset($user[\"firstname\"])) )\n return '';\n $ret =\"\";\n if (isset($user[\"title\"]))\n $ret = $user[\"title\"].' ';\n $ret .= $user[\"lastname\"].\" \".$user[\"firstname\"];\n if (isset($user[\"birthname\"]) && trim($user[\"birthname\"])!=\"\")\n $ret .= \" (\".trim($user[\"birthname\"]).\")\";\n return $ret;\n}", "function get_user_name()\n {\n return isset($_SESSION['username']) ? $_SESSION['username'] : null;\n }", "protected function createUser ()\n {\n /* Method of the UserFactory class */\n $this->_objUser = UserFactory::createUser(ucfirst($_SESSION[\"userType\"])); \n $this->_objUser->setFirstName($_SESSION[\"emailID\"]);\n }", "public function getuserName()\n {\n return $this->userName;\n }" ]
[ "0.70048314", "0.6899066", "0.6890519", "0.66397214", "0.65319425", "0.6529683", "0.65253556", "0.6507658", "0.6478806", "0.64651966", "0.64519334", "0.6428762", "0.6412827", "0.640427", "0.63621294", "0.6355641", "0.63514113", "0.6346236", "0.6326977", "0.6321939", "0.6318881", "0.63072807", "0.62989354", "0.6289784", "0.6270826", "0.6234616", "0.623401", "0.6229678", "0.62222946", "0.6211457", "0.6203692", "0.6158012", "0.61547476", "0.61364365", "0.6129267", "0.6103841", "0.6103727", "0.60967433", "0.6090896", "0.6075936", "0.60706854", "0.6066907", "0.6062101", "0.6058379", "0.6058379", "0.6058379", "0.6053816", "0.60510844", "0.60487294", "0.6034156", "0.6034156", "0.6034156", "0.6034156", "0.6034156", "0.6031219", "0.6029695", "0.6027635", "0.6027628", "0.60216737", "0.6019823", "0.60019755", "0.5981481", "0.59766644", "0.5974558", "0.5973934", "0.59732723", "0.5972195", "0.5967837", "0.5967682", "0.5967682", "0.596268", "0.5959174", "0.5957065", "0.59536475", "0.59490216", "0.59248793", "0.59221506", "0.59199136", "0.59096915", "0.58933944", "0.58906996", "0.5889379", "0.588711", "0.5878156", "0.5875129", "0.58742136", "0.5873597", "0.5864957", "0.5864957", "0.5863305", "0.585552", "0.5851457", "0.58513206", "0.5850206", "0.58499753", "0.5841273", "0.583763", "0.5835192", "0.582981", "0.5827876" ]
0.6109468
35
Jamie Alnasir, created. Obtain RHUL User's Display name from currently logged in, LDAP authenticated RHUL user
function getRHUL_Email() { return getRHUL_LDAP_FieldValue("adi_mail"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRHUL_DisplayName() {\n\treturn getRHUL_LDAP_FieldValue(\"adi_givenname\");\n}", "public function name() {\n return isset($this->_adaptee->user_info['user_displayname']) ? $this->_adaptee->user_info['user_displayname'] : null;\n }", "public function getUserDisplayName();", "public function diviroids_user_displayname($atts)\n {\n return DiviRoids_Security::get_current_user('display_name');\n }", "function getRHUL_FirstName() {\n return getRHUL_LDAP_FieldValue(\"first_name\");\n}", "function getRHUL_LastName() {\n return getRHUL_LDAP_FieldValue(\"last_name\");\n}", "public function get_user_name() { \n\n\t\tif ($this->user == '-1') { return _('All'); } \n\t\t\n\t\t$user = new User($this->user);\n\t\treturn $user->fullname . \" (\" . $user->username . \")\";\n\t\t\n\t}", "function ffl_fix_user_display_name($user_id)\n{\n\t//set the display name\n\t$info = get_userdata( $user_id );\n \n\t$display_name = trim($info->first_name . ' ' . $info->last_name);\n\tif(!$display_name)\n\t\t$display_name = $info->user_login;\n\t\t\t \n\t$args = array(\n\t\t\t'ID' => $user_id,\n\t\t\t'display_name' => $display_name\n\t);\n \n\twp_update_user( $args ) ;\n}", "function user_name () {\r\n\t$info = user_info();\r\n\treturn (isset($info[1]) ? $info[1] : 'default');\r\n}", "function pilau_default_user_display_name( $user_id ) {\n\t\t// Fetch current user meta information\n\t\t$first = get_user_meta( $user_id, 'first_name', true );\n\t\t$last = get_user_meta( $user_id, 'last_name', true );\n\t\t$display = trim( $first . \" \" . $last );\n\t\t// Update\n\t\twp_update_user( array( \"ID\" => $user_id, \"display_name\" => $display ) );\n\t}", "protected function user()\n {\n if ($this->wrappedObject->security) {\n return ' this user\\'s ';\n }\n\n $user = $this->wrappedObject->revisionable()->withTrashed()->first(['first_name', 'last_name']);\n\n return ' '.$user->first_name.' '.$user->last_name.'\\'s ';\n }", "public function usualname()\n\t{\n\t\treturn coalesce(User::info('UsualName'), User::info('Username'));\n\t}", "public function getExternalUserName();", "public function diviroids_user_firstname($atts)\n {\n return DiviRoids_Security::get_current_user('user_firstname');\n }", "public function diviroids_user_lastname($atts)\n {\n return DiviRoids_Security::get_current_user('user_lastname');\n }", "public function displayUser()\n {\n $entry = $this->getEntry();\n if ($entry) {\n return $entry->displayUser();\n }\n }", "Public Function getUserName()\n\t{\n\t\treturn $this->firstName . ' ' . $this->lastName;\n\t}", "public function RefreshDisplayName() {\n\t\t\tif ($this->blnDisplayRealNameFlag)\n\t\t\t\t$this->strDisplayName = $this->strFirstName . ' ' . $this->strLastName;\n\t\t\telse\n\t\t\t\t$this->strDisplayName = $this->strUsername;\n\t\t\t$this->Save();\n\t\t}", "function get_user_name() {\n return $this->call('get_user_name', array(), TRUE);\n }", "public function getDisplayName()\n\t{\n\t\treturn $this->m_oUser->DisplayName;\n\t}", "public function getDisplayName() { $n = $this->data->get(\"displayName\", null);\n if (!empty($n)) {\n return $n;\n }\n \n // I have google's name?\n if (($g = $this->getGoogleInfo())) {\n if (isset($g->givenName) && !empty($g->givenName)) {\n return $g->givenName;\n }\n if (isset($g->name) && !empty($g->name)) {\n return $g->name;\n }\n }\n \n // user is current user?? load his name if he is\n $currentUser = JFactory::getUser();\n if ((int)($currentUser->id) == (int)$this->userid) {\n return ucwords(strtolower($currentUser->name));\n }\n \n // load user and get his name\n $user = F_User::getUserById((int)$this->$userid);\n if ($user) {\n return ucwords(strtolower($user->name));\n }\n \n // wtf\n return \"???\";\n }", "private function updateName()\n {\n if (!LOCAL) {\n $ds = ldap_connect(\"addressbook.ic.ac.uk\");\n $r = ldap_bind($ds);\n $justthese = array(\"displayname\");\n $sr = ldap_search(\n $ds,\n \"ou=People,ou=shibboleth,dc=ic,dc=ac,dc=uk\",\n \"uid=\".$this->getUser(),\n $justthese\n );\n $info = ldap_get_entries($ds, $sr);\n if ($info[\"count\"] > 0) {\n $this->setName($info[0]['displayname'][0]);\n return ($info[0]['displayname'][0]);\n } else {\n return false;\n }\n } else {\n $name = $this->getName();\n return $name;\n }\n }", "public function getAccountRealName() {\n // cn is a standard LDAP attibute\n if (!empty($_SERVER['AUTHORIZE_CN']))\n return $_SERVER['AUTHORIZE_CN'];\n // Some installations may prefer to use displayName\n else if (!empty($_SERVER['AUTHORIZE_DISPLAYNAME']))\n return $_SERVER['AUTHORIZE_DISPLAYNAME'];\n // Some installations may populate the name field with the user's real\n // name. This seems to be erroneous, based on Microsoft documenting\n // this attribute as an RDN, so only use it as a last resort.\n else if (!empty($_SERVER['AUTHORIZE_NAME']))\n return $_SERVER['AUTHORIZE_NAME'];\n else\n return parent::getAccountRealName();\n }", "public function display_name($uid = 0) {\r\n\t\tif ($uid > 0) {\r\n\t\t\t$uname = $this->core($uid)->get(\"username\");\r\n\t\t\t$rname = $this->core($uid)->get(\"name\");\r\n\t\t\tif (strtolower($uname == $rname)) {\r\n\t\t\t\treturn $uname;\r\n\t\t\t} else {\r\n\t\t\t\treturn $rname;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn $this->username(0);\r\n\t\t}\r\n\t}", "function user_create($attributes){\n //check for compulsory fields\n if (!array_key_exists(\"username\",$attributes)){ return (\"Missing compulsory field [username]\"); }\n if (!array_key_exists(\"firstname\",$attributes)){ return (\"Missing compulsory field [firstname]\"); }\n if (!array_key_exists(\"surname\",$attributes)){ return (\"Missing compulsory field [surname]\"); }\n if (!array_key_exists(\"email\",$attributes)){ return (\"Missing compulsory field [email]\"); }\n if (!array_key_exists(\"container\",$attributes)){ return (\"Missing compulsory field [container]\"); }\n if (!is_array($attributes[\"container\"])){ return (\"Container attribute must be an array.\"); }\n\n if (array_key_exists(\"password\",$attributes) && !$this->_use_ssl){ \n // Modified by SysCo/al\n $this->_error = TRUE;\n $this->_error_message = 'FATAL: SSL must be configured on your webserver and enabled in the class to set passwords.';\n exit();\n }\n\n if (!array_key_exists(\"display_name\",$attributes)){ $attributes[\"display_name\"]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"]; }\n\n //translate the schema\n $add=$this->adldap_schema($attributes);\n \n //additional stuff only used for adding accounts\n $add[\"cn\"][0]=$attributes[\"display_name\"];\n $add[$this->_cn_identifier][0]=$attributes[\"username\"];\n $add[\"objectclass\"][0]=\"top\";\n $add[\"objectclass\"][1]=\"person\";\n $add[\"objectclass\"][2]=\"organizationalPerson\";\n $add[\"objectclass\"][3]=\"user\"; //person?\n //$add[\"name\"][0]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"];\n\n //set the account control attribute\n $control_options=array(\"NORMAL_ACCOUNT\");\n if (!$attributes[\"enabled\"]){ $control_options[]=\"ACCOUNTDISABLE\"; }\n $add[\"userAccountControl\"][0]=$this->account_control($control_options);\n //echo (\"<pre>\"); print_r($add);\n\n //determine the container\n $attributes[\"container\"]=array_reverse($attributes[\"container\"]);\n $container=\"OU=\".implode(\",OU=\",$attributes[\"container\"]);\n\n //add the entry\n $result=@ldap_add($this->_conn, \"CN=\".$add[\"cn\"][0].\", \".$container.\",\".$this->_base_dn, $add);\n if ($result!=true){ return (false); }\n \n return (true);\n }", "function getUserName($us_id)\n\t{\n\t\t$func = create_function('$id',$this->UserNameFunc);\n\t\treturn $func($us_id);\n\t}", "public function getNameIdentificationBd() {\n global $advancedCustomUser;\n if (!empty($this->name) && empty($advancedCustomUser->doNotIndentifyByName)) {\n return $this->name;\n }\n if (!empty($this->email) && empty($advancedCustomUser->doNotIndentifyByEmail)) {\n return $this->email;\n }\n if (!empty($this->user) && empty($advancedCustomUser->doNotIndentifyByUserName)) {\n return $this->user;\n }\n if (!empty($this->channelName)) {\n return $this->channelName;\n }\n return __(\"Unknown User\");\n }", "public function getNameForDisplay()\n {\n if (null !== $this->getName() && '' !== $this->getName()) {\n return $this->getName();\n } elseif (1 == $this->getRealUserName()) {\n return $this->getUsername();\n }\n\n return $this->getEmail();\n }", "public function DisplayName() {\n\t\t\n\t\tif (!empty($this->profil)) {\n\t\t\t\n\t\t\treturn $this->profil['user']['displayName'];\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "function getUsername(){return $this->getName();}", "function p_usrnam($username)\n{\n\treturn config_item(\"username_as_lowercase\")? lc($username) : $username;\n}", "public function setDisplayNameAction($header_data,$name){ \n try {\n $user = Users::findById($header_data['id']);\n if(empty($name)) {\n $user->username = '';\n } else {\n $user->username = $name;\n }\n $user->save();\n Library::output(true, '1', USER_NAME_SAVED, null);\n } catch (Exception $e) {\n Library::logging('error',\"API : setDisplayName : \".$e.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n }", "function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }", "public function getGivenName ();", "function create_user()\n{\n\t// Check to see if the account is admin\n\t$account_type = account_type();\n\t\n\tif ( $account_type == 0 )\n\t{\n\t\t// Connect to the database\n\t\t$link = dbConnect();\n\t\t\n\t\t$query = mysql_query( \"SELECT first_name, last_name FROM BCD_User WHERE username = '\" . $_SESSION[ 'username' ] . \"'\" );\n\t\t\n\t\t// Close the database\n\t\tdbClose( $link );\n\t}\n}", "public function GetUserName ();", "public function generateUsername(){\n $this->username = strtolower(substr($this->firstname,0,1).$this->lastname.$this->id());\n }", "public function getAuthorName()\n {\n return $this->author ? $this->author : $this->createUser->firstname . ' ' . $this->createUser->lastname;\n }", "public function getDisplayHolderNameAttribute()\n {\n if ($this->user_id) return $this->user->displayName;\n return '<a href=\"http://'.$this->alias.'.deviantart.com\">'.$this->alias.'@dA</a>';\n }", "public static function getNameIdentification() {\n global $advancedCustomUser;\n if (self::isLogged()) {\n if (!empty(self::getName()) && empty($advancedCustomUser->doNotIndentifyByName)) {\n return self::getName();\n }\n if (!empty(self::getMail()) && empty($advancedCustomUser->doNotIndentifyByEmail)) {\n return self::getMail();\n }\n if (!empty(self::getUserName()) && empty($advancedCustomUser->doNotIndentifyByUserName)) {\n return self::getUserName();\n }\n if (!empty(self::getUserChannelName())) {\n return self::getUserChannelName();\n }\n }\n return __(\"Unknown User\");\n }", "public function getUserOrProperName()\n {\n $person = $this->getPerson();\n if (strtolower($person->getEmail()) != strtolower($this->username)) {\n return $this->username;\n } else {\n $init = substr($person->getFirstname(), 0, 1);\n return \"{$init}. {$person->getLastname()}\";\n }\n }", "function phptemplate_username($object) {\r\n if ($object->uid && $object->name) {\r\n // Shorten the name when it is too long or it will break many tables.\r\n if (drupal_strlen($object->name) > 20) {\r\n $name = drupal_substr($object->name, 0, 15) .'...';\r\n }\r\n else {\r\n $name = $object->name;\r\n }\r\n if (user_access('access user profiles')) {\r\n $output = l($name, 'user/'. $object->uid, array('attributes' => array('title' => t('View user profile.'))));\r\n }\r\n else {\r\n $output = check_plain($name);\r\n }\r\n }\r\n else if ($object->name) {\r\n // Sometimes modules display content composed by people who are\r\n // not registered members of the site (e.g. mailing list or news\r\n // aggregator modules). This clause enables modules to display\r\n // the true author of the content.\r\n if (!empty($object->homepage)) {\r\n $output = l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow')));\r\n }\r\n else {\r\n $output = check_plain($object->name);\r\n }\r\n // Display or hide 'not verified' text\r\n if (theme_get_setting('user_notverified_display') == 1) {\r\n $output .= ' ('. t('not verified') .')';\r\n }\r\n }\r\n else {\r\n $output = variable_get('anonymous', t('Anonymous'));\r\n }\r\n return $output;\r\n}", "private function userDisplay() {\n $showHandle = $this->get('username');\n if (isset($showHandle)) {\n echo '<li class=\"user-handle\">'.$showHandle.'</li>';\n }\n }", "public function name()\n\t{\n\t\treturn User::info('Username');\n\t}", "function get_user_full_name() {\n echo $_SESSION['SESS_USER_FIRST'] . ' ' . $_SESSION['SESS_USER_LAST'];\n }", "function getDisplayName(){\n\t\treturn $this->display_name;\n\t}", "function getUserName() {\n\t\treturn $this->nickname;\n\t\t/*\n\t\tif(!$this->user_name) {\n\t\t\t$this->sql(\"SELECT nickname FROM \".UT_USE.\" WHERE id = \".$this->user_id);\n\t\t\t$this->user_name = $this->getQueryResult(0, \"nickname\");\n \t\t}\n\t\treturn $this->user_name;\n\t\t*/\n\t}", "function _create_proper_name_field() {\r\n global $locale;\r\n $full_name = $locale->getLocaleFormattedName($this->first_name, $this->last_name, $this->salutation);\r\n $this->name = $full_name;\r\n $this->full_name = $full_name; \r\n\r\n\t}", "function getUserName()\r\n\t{\r\n\t\treturn $this->UserName;\r\n\t}", "private function retrieve_name() {\n\t\t$replacement = null;\n\n\t\t$user_id = $this->retrieve_userid();\n\t\t$name = get_the_author_meta( 'display_name', $user_id );\n\t\tif ( $name !== '' ) {\n\t\t\t$replacement = $name;\n\t\t}\n\n\t\treturn $replacement;\n\t}", "public function getOwnerusername() {}", "function getUserName() {\n return $this->userName . \".guest\";\n }", "function getFirst_Name(){\n$user = $this->loadUserLogin(Yii::app()->user->user_id);\nreturn $user->first_name;\n}", "public function getMemberName() {\n return Html::a( $this->user->username, Yii::$app->params['url_admin'].'/user/view?id='.$this->user->id );\n }", "public function getName(): string {\n\t\treturn $this->l10nFactory->get('user_ldap')->t('LDAP User backend');\n\t}", "public function user_create($attributes){\n // Check for compulsory fields\n if (!array_key_exists(\"username\",$attributes)){ return (\"Missing compulsory field [username]\"); }\n if (!array_key_exists(\"firstname\",$attributes)){ return (\"Missing compulsory field [firstname]\"); }\n if (!array_key_exists(\"surname\",$attributes)){ return (\"Missing compulsory field [surname]\"); }\n if (!array_key_exists(\"email\",$attributes)){ return (\"Missing compulsory field [email]\"); }\n if (!array_key_exists(\"container\",$attributes)){ return (\"Missing compulsory field [container]\"); }\n if (!is_array($attributes[\"container\"])){ return (\"Container attribute must be an array.\"); }\n\n if (array_key_exists(\"password\",$attributes) && (!$this->_use_ssl && !$this->_use_tls)){ \n throw new adLDAPException('SSL must be configured on your webserver and enabled in the class to set passwords.');\n }\n\n if (!array_key_exists(\"display_name\",$attributes)){ $attributes[\"display_name\"]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"]; }\n\n // Translate the schema\n $add=$this->adldap_schema($attributes);\n \n // Additional stuff only used for adding accounts\n if (isset($attributes['cn'])) {\n \t$add['cn'][0]=$attributes['cn']; // EXTENDED by CST\n } else {\n \t$add[\"cn\"][0]=$attributes[\"display_name\"];\n }\n $add[\"samaccountname\"][0]=$attributes[\"username\"];\n $add[\"objectclass\"][0]=\"top\";\n $add[\"objectclass\"][1]=\"person\";\n $add[\"objectclass\"][2]=\"organizationalPerson\";\n $add[\"objectclass\"][3]=\"user\"; //person?\n //$add[\"name\"][0]=$attributes[\"firstname\"].\" \".$attributes[\"surname\"];\n\n // Set the account control attribute\n $control_options=array(\"NORMAL_ACCOUNT\");\n if (!$attributes['enabled']){ $control_options[]=\"ACCOUNTDISABLE\"; }\n $add[\"userAccountControl\"][0]=$this->account_control($control_options);\n //echo (\"<pre>\"); print_r($add);\n\n // Determine the container\n $attributes[\"container\"]=array_reverse($attributes[\"container\"]);\n $container=\"OU=\".implode(\",OU=\",$attributes[\"container\"]);\t\t\n\t\t\n\t\t// Add the entry\n\t\t$result=@ldap_add($this->_conn, \"CN=\".$add[\"cn\"][0].\", \".$container.\",\".$this->_base_dn, $add); \n if ($result!=true){ return (false); }\n\t\t\n return (true);\n }", "public function getUserName();", "public function getUserName() {}", "function getUnameFromId( $userid = 0, $usereal = 0, $is_linked = 1 )\n {\t\t\n\t\tif (isset($this)) {\n\t\t\t$zariliaUser = &$this;\n\t\t} else {\n\t\t\tglobal $zariliaUser;\n\t\t}\t\t\n $name = '';\n $userid = intval( $userid ) > 0 ? intval( $userid ) : $zariliaUser->getVar( 'uid' );\n $usereal = intval( $usereal );\n if ( $userid > 0 ) {\n $member_handler = &zarilia_gethandler( 'member' );\n $user = &$member_handler->getUser( $userid );\n if ( is_object( $user ) ) {\n if ( $usereal ) {\n $name = htmlSpecialChars( $user->getVar( 'name' ), ENT_QUOTES );\n } else {\n $name = htmlSpecialChars( $user->getVar( 'uname' ), ENT_QUOTES );\n }\n }\n if ( $is_linked ) {\n $name = '<a href=\"' . ZAR_URL . '/index.php?page_type=userinfo&uid=' . $userid . '\">' . $name . '</a>';\n }\n } else {\n $name = $GLOBALS['zariliaConfig']['anonymous'];\n }\n return $name;\n }", "public function getUserName()\n {\n return $this->user_name;\n }", "public function getUserFullName() {\n return $this->first_name . ' ' . $this->last_name;\n }", "public function getHumanName();", "public function username(){\n \treturn $this->users->name.' '.$this->users->ape;\n }", "public function displayName()\n {\n if (isset($this->data['name']) && config('gzero.use_users_nicks')) {\n return $this->data['name'];\n }\n\n if (isset($this->data['first_name']) || isset($this->data['last_name'])) {\n return $this->data['first_name'] . ' ' . $this->data['last_name'];\n }\n\n return trans('gzero-core::common.anonymous');\n }", "public function getUserName()\n {\n return $this->getName();\n }", "public function getName()\n {\n $firstName = $this->getFieldValue(self::FIELD_FIRST_NAME);\n $lastName = $this->getFieldValue(self::FIELD_LAST_NAME);\n // User does not exist.\n if (!$firstName && !$lastName) {\n $name = 'Unknown&nbsp;User';\n } else {\n $name = \"{$firstName} {$lastName}\";\n }\n\n return $name;\n }", "function getRHUL_FullName() {\n return getRHUL_FirstName() . \" \" . getRHUL_LastName();\n}", "public function createUser () {\n syslog( LOG_INFO, 'Create a Lineberty User \\n' );\n\n $url = '/users';\n\n return $this->runRequest($url, 'POST', null);\n }", "function get_displayname($username)\n{\n if ($username == do_lang('UNKNOWN')) {\n return $username;\n }\n if ($username == do_lang('GUEST')) {\n return $username;\n }\n if ($username == do_lang('DELETED')) {\n return $username;\n }\n\n if (method_exists($GLOBALS['FORUM_DRIVER'], 'get_displayname')) {\n $displayname = $GLOBALS['FORUM_DRIVER']->get_displayname($username);\n return ($displayname === null) ? $username : $displayname;\n }\n\n return $username;\n}", "public function getUserName() {\n if (isset($this->rUser)) {\n return $this->rUser->getFullName();\n }\n return '';\n }", "function userName($user_id)\n {\n global $obj_rep;\n \n $condtion = \" user_id='\" . $user_id . \"'\";\n \n $sql = $obj_rep->query(\"first_name,last_name\", \"user_registration\", $condtion);\n \n $result = $obj_rep->get_all_row($sql);\n return $fullName = $result['first_name'] . \" \" . $result['last_name'];\n }", "public function getUserName()\n {\n return $this->getUserAttribute(static::ATTRIBUTE_NAME);\n }", "function util_getUsableName($displayName, $firstName, $lastName, $email)\n{\n\t$displayName = trim($displayName);\n\tif (!empty($displayName))\n\t{\n\t\treturn $displayName ;\n\t}\n\telse\n\t{\n\t\t$displayName = trim($firstName . \" \" . $lastName);\n\t\tif (!empty($displayName))\n\t\t{\n\t\t\treturn $displayName ;\n\t\t}\n\t\t\n\t\t$email = trim($email);\n\t\tif (!empty($email))\n\t\t{\n\t\t\t$parts = explode('@', $email);\n\t\t\t$displayName = (count($parts) > 0) ? ucfirst($parts[0]) : '' ;\n\t\t}\n\t}\n\t\n\treturn $displayName ;\n}", "function getFirst_Name(){\n $user = $this->loadUser(Yii::app()->user->id);\n\treturn $user->firstname;\n }", "public function getUserNameIdentifier()\n {\n return $this->user_name;\n }", "public function getCreator()\n\t{\n\t\treturn UserUtil::getUser($this->creator)->getFullName();\n\t}", "public function getDisplayName() {}", "public function printCreatedBy()\n {\n if ($this->createdBy->status == User::STATUS_DELETED) {\n return Html::tag('em', \\Yii::t('app', 'deleted'), ['class' => 'small']);\n }\n return Html::a($this->createdBy->username, ['/' . ForumModule::getInstance()->id . '/profile/view', 'id' => $this->createdBy->id], ['class' => 'link-secondary link-underline-opacity-0 link-underline-opacity-100-hover']);\n }", "static function getUserDisplayNameById($id, $short = false) {\n $user = DB::executeFirstRow('SELECT first_name, last_name, email FROM ' . TABLE_PREFIX . 'users WHERE id = ?', $id);\n \n if($user) {\n return Users::getUserDisplayName($user, $short);\n } else {\n return null;\n } // if\n }", "public function getUserTitle() {\n\t\tif ($this->userTitle) return StringUtil::encodeHTML($this->userTitle);\n\t\telse if ($this->rank) return WCF::getLanguage()->get(StringUtil::encodeHTML($this->rank->rankTitle));\n\t}", "public static function displayName(): string;", "public function getUsersName(){\n //Get the Id\n $userId = $_GET[\"userId\"];\n //Gets the users name \n $usersName = $this->individualGroupModel->getTheUsersName($userId); \n //echos out a created users name given the first and last name\n echo $usersName->User_First_Name . \" \" . $usersName->User_Last_Name;\n }", "function user_name($user = false)\n{\n $user = $user ? $user : $GLOBALS['user'];\n\n // first check if the name is in the DB\n if ($info = user_info($user))\n return $info['name'];\n\n //no, it isn't. fetch it from the master server\n return master_user_name($user);\n}", "function getUsername()\n\t{\n\t\treturn $this->Info['Username'];\n\t}", "protected function createUser ()\n {\n /* Method of the UserFactory class */\n $this->_objUser = UserFactory::createUser(ucfirst($_SESSION[\"userType\"])); \n $this->_objUser->setFirstName($_SESSION[\"emailID\"]);\n }", "public function getDisplayName() {\r\n $displayName = $this->fname.' '.$this->lname;\r\n if(strlen($displayName) <= 1) {\r\n $displayName = explode('@',$this->email);\r\n return($displayName[0]);\r\n }\r\n return($displayName);\r\n }", "function getLabel() {\n\t\treturn $this->getUsername();\n\t}", "public function getUsername()\n {\n return $this->getDuckname();\n }", "public function getName() {\n\t\tif($this->_name)\n\t\t\treturn $this->_name;\n\t\tif ($this->first_name != '')\n\t\t\treturn $this->first_name . ($this->last_name ? ' ' . $this->last_name : '');\n\t\telse\n\t\t\treturn $this->username ? $this->username : $this->email;\n\t}", "public function getName()\n {\n // Look for value only if not already set\n if (!isset($this->name)) {\n $us = SemanticScuttle_Service_Factory::get('User');\n $user = $us->getUser($this->id);\n $this->name = $user['name'];\n }\n return $this->name;\n }", "public function getFullName()\n {\n if (! $this->_getVar('user_name')) {\n $name = ltrim($this->_getVar('user_first_name') . ' ') .\n ltrim($this->_getVar('user_surname_prefix') . ' ') .\n $this->_getVar('user_last_name');\n\n if (! $name) {\n // Use obfuscated login name\n $name = $this->getLoginName();\n $name = substr($name, 0, 3) . str_repeat('*', max(5, strlen($name) - 2));\n }\n\n $this->_setVar('user_name', $name);\n\n // \\MUtil_Echo::track($name);\n }\n\n return $this->_getVar('user_name');\n }", "public function getDisplayname()\n\t{\n\t\treturn $this->displayname;\n\t}", "public function getUser_lname()\n {\n return $this->user_lname;\n }", "function displayName() {\n\n // call the database variable\n global $db;\n\n $sql = \"SELECT * from users WHERE id='\".$_SESSION['my_id'].\"'\";\n $result = $db-> query($sql);\n\n if ($result-> num_rows > 0) {\n while ($user = $result->fetch_assoc()) {\n\n if ($user['fname'] && $user['lname'] != null) {\n echo $user['fname'] . \" \" . $user['lname'];\n } else {\n echo $user['email'];\n }\n\n }\n }\n\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "public function getUsername()\n {\n // TODO: Implement getUsername() method.\n }", "function gratis_preprocess_username(&$vars) {\n // Update the username so it's the full name of the user.\n $account = $vars['account'];\n\n // Revise the name trimming done in template_preprocess_username.\n $name = $vars['name_raw'] = format_username($account);\n\n // Trim the altered name as core does, but with a higher character limit.\n if (drupal_strlen($name) > 35) {\n $name = drupal_substr($name, 0, 18) . '...';\n }\n\n // Assign the altered name to $vars['name'].\n $vars['name'] = check_plain($name);\n}", "public function feide_name() {\n\t\t\tif(isset($this->attributes['displayName'][0])) {\n\t\t\t\t$this->feide_name = $this->attributes['displayName'][0];\n\t\t\t\t// echo \"displayName set!!!\";\n\t\t\t} else if(isset($this->attributes['givenName'][0]) && isset($this->attributes['sn'][0])) {\n\t\t\t\t$this->feide_name = $this->attributes['givenName'][0] . ' ' . $this->attributes['sn'][0];\n\t\t\t\t// echo \"givenName/sn set!!!\";\n\t\t\t} else if(isset($this->attributes['cn'][0])) {\n\t\t\t\t$this->feide_name = $this->attributes['cn'][0];\n\t\t\t\t// echo \"cn set!!!\";\n\t\t\t} // FALLBACK IF NO NAME IS ACCESSIBLE FROM ANY OF THE ABOVE ATTRIBS...\n\t\t\telse {\n\t\t\t\t$this->feide_name = $this->attributes['eduPersonPrincipalName'][0];\n\t\t\t}\n\n\t\t\treturn $this->feide_name;\n\t\t}", "function identifyUser() {\n}", "public function getUserName() {\n\t\tif(($username=$this->getState('__username'))!==null) return $username;\n\t\telse return NULL;\n\t}" ]
[ "0.7530642", "0.701753", "0.6982576", "0.69400346", "0.68017745", "0.67323995", "0.6725332", "0.6624461", "0.66169864", "0.6601405", "0.6553752", "0.6485967", "0.6474154", "0.6438809", "0.64247125", "0.64222777", "0.6411011", "0.64054996", "0.63948095", "0.63901496", "0.63757926", "0.637059", "0.63540274", "0.6342763", "0.6336718", "0.6292597", "0.6292522", "0.6240901", "0.62168187", "0.6192752", "0.61813134", "0.61703616", "0.61543965", "0.61294097", "0.61279863", "0.61276245", "0.6123647", "0.61156327", "0.6105091", "0.6103157", "0.6101555", "0.6099752", "0.6079831", "0.607109", "0.606515", "0.6063249", "0.605218", "0.6050387", "0.6048655", "0.6046807", "0.60427", "0.60242885", "0.6016854", "0.60092735", "0.60057324", "0.59969866", "0.59941065", "0.5983885", "0.598226", "0.5980451", "0.5980397", "0.5977464", "0.59735477", "0.5970067", "0.596895", "0.5950982", "0.59497195", "0.59481364", "0.5944899", "0.593193", "0.59274167", "0.5927073", "0.5920575", "0.5919323", "0.59107786", "0.591025", "0.58965755", "0.58940375", "0.58907306", "0.5889602", "0.58890265", "0.5885684", "0.5881749", "0.58815336", "0.5880069", "0.5877188", "0.5870341", "0.5865166", "0.5864266", "0.5860895", "0.585646", "0.5850459", "0.5850188", "0.58490896", "0.5847485", "0.5847485", "0.5847485", "0.58437496", "0.5843661", "0.58368886", "0.5833794" ]
0.0
-1
Jamie Alnasir, created. Obtain RHUL User's Start Year from currently logged in, LDAP authenticated RHUL user
function getRHUL_StartYear() { $dname = getRHUL_LDAP_FieldValue("adi_displayname"); if (strpos($dname, "(")) { $p = (int)strpos($dname, "("); return substr($dname, $p+1, 4); } else { return "0"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStartYear()\n {\n return $this->getParameter('startYear');\n }", "function getYearOfBirth() {\n global $USER;\n\t$yearOfBirth = date(\"Y\", $USER['dob']);\n\treturn $yearOfBirth;\n}", "private function get_start_date_for_this_ac_year() {\n\t\t\t$ac_year = $this->resolve_year();\n\t\t\t$query = sprintf(\"SELECT TO_CHAR(START_DATE, 'dd/mm/yyyy') AS START_DATE_FORMATTED FROM FES.SESSIONS WHERE SESSION_LONG_DESC = '%s'\", $ac_year);\n\t\t\t\t\t\n\t\t\t//print_r($query);\n\t\t\t\t\t\n\t\t\tif ($data = $this->execute_query($query)) {\n\t\t\t\tforeach ($data as $datum) {\n\t\t\t\t\t$start = $datum->START_DATE_FORMATTED;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$d = explode('/', $start);\n\t\t\t$day = (substr($d[0], 0, 1) == 0) ? sprintf('%1d', $d[0]) : $d[0];\n\t\t\t$month = (substr($d[1], 0, 1) == 0) ? sprintf('%1d', $d[1]) : $d[1];\n\t\t\t$year = $d[2];\n\t\t\t$start_date = mktime(0,0,0,$month,$day,$year, 0);\n\t\t\treturn $start_date;\n\t\t}", "public function getYear() {}", "private function resolve_year() {\n $academicYearStart = strftime(\"%Y\",strtotime(\"-8 months\",time()));\n $academicYearEnd = strftime(\"%Y\",strtotime(\"+4 months\",time()));\n return \"Academic Year $academicYearStart/$academicYearEnd\";\n }", "protected function getMinimumReportYear(){\n if( $this->getCurrentUser() != null && in_array('Admin', $this->getCurrentRoles()) ){\n return 2017;\n }\n else{\n return 2018;\n }\n }", "function getCurrentYear ()\n\t{\n\t\treturn date ('Y');\n\t}", "function get_year()\n {\n $datearray=getdate($this->timestamp);\n return $datearray[\"year\"];\n }", "function gec_copyrightYears($startYr = '') {\n // if startYr is greater than current year, return current year\n if ($startYr >= date(\"Y\")) {\n return ('<p>&copy ' . date(\"Y\") . '</p>');\n }\n // get current year and format as 2 digits if start year provided\n if ($startYr) {\n $currentYr = date(\"y\");\n }\n // otherwise, format as four digits and return\n else {\n return ('<p>&copy ' . date(\"Y\") . '</p>');\n }\n // return start year as 4 digits - current year as 2 digits\n /* @var $currentYr type */\n return ('<p>&copy ' . $startYr . '-' . $currentYr . '</p>' );\n}", "function displayYears($startYear)\n{\n $currentYear = date('Y'); // Grab the current year\n if($currentYear > $startYear)\n {\n return $startYear . ' - ' . $currentYear;\n }\n else\n {\n return $currentYear;\n }\n}", "function currentYear() {\n\t\tif (func_num_args()) {\n\t\t\tif (func_get_arg(0) >= 1901 && func_get_arg(0) <= 2037) { //See note section above\n\t\t\t\t$this->_currentYear = func_get_arg(0);\n\t\t\t\t$this->_monthTimestamp = $this->_dayTimestamp = mktime(0,0,0,$this->_currentMonth,1,$this->_currentYear);\n\t\t\t\t$this->_currentMonthNumDays = intval(date('t',$this->_monthTimestamp));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuser_error(\"You can only set the currentYear property of the Calendar class to a value between 1901 and 2037\", E_USER_NOTICE);\n\t\t\t}\n\t\t}\n\t\telse return $this->_currentYear;\n\t}", "public static function getCurrentSchoolYear() {\n\t\t$year = date('Y');\n\t\t$month = date('m');\n\t\tif ($month >= 9) {\n\t\t\t$year++;\n\t\t}\n\t\treturn $year;\n\t}", "public function getYear()\n\t{\n\t\t$sqlYear = \"SELECT * FROM edu_academic_year WHERE NOW() >= from_month AND NOW() <= to_month AND status = 'Active'\";\n\t\t$year_result = $this->db->query($sqlYear);\n\t\t$ress_year = $year_result->result();\n\n\t\tif($year_result->num_rows()==1)\n\t\t{\n\t\t\tforeach ($year_result->result() as $rows)\n\t\t\t{\n\t\t\t $year_id = $rows->year_id;\n\t\t\t}\n\t\t\treturn $year_id;\n\t\t}\n\t}", "function set_start_year($startYear,&$error)\r\n {\r\n if (strlen($startYear) > 0)\r\n\t\t{\r\n //check if the name contains special characters\r\n if (!preg_match('/^\\d{4}$/', $startYear))\r\n {\r\n \r\n $error = \"Start Year Is Not Valid\";\r\n }\r\n else\r\n { //sanitize and feed back up the pipe to display in the form and save on the server\r\n $this->StartYear = filter_var(trim($startYear), FILTER_SANITIZE_NUMBER_INT); \r\n \r\n //return a valid css class\r\n\t\t\treturn \"class='valid'\"; \r\n }\r\n }//end if >0\r\n else\r\n {\r\n \r\n $error = \"Start Year Must Be Greater Than Zero\";\r\n\r\n //return a invalid css class\r\n\t\t\t return \"class='error'\";\r\n }//end else\r\n\r\n }", "public function getMinYearBuilt();", "function getMinYears()\n {\n return 0;\n }", "public function get_year_permastruct()\n {\n }", "public function getYear() : string;", "public function getYear()\n\t{\n\t\treturn $this->year \n\t\t\t?? $this->year = date('Y');\n\t}", "public function getShntyear()\n {\n return $this->shntyear;\n }", "function autoUpdatingCopyright($startYear){\n $startYear = intval($startYear);\n \n // current year (e.g. 2007)\n $year = intval(date('Y'));\n \n // is the current year greater than the\n // given start year?\n if ($year > $startYear)\n return $startYear .'-'. $year;\n else\n return $startYear;\n}", "function autoUpdatingCopyright($startYear){\n $startYear = intval($startYear);\n \n // current year (e.g. 2007)\n $year = intval(date('Y'));\n \n // is the current year greater than the\n // given start year?\n if ($year > $startYear)\n return $startYear .'-'. $year;\n else\n return $startYear;\n}", "public function getExpiryYear()\n {\n return $this->getParameter('expiryYear');\n }", "public function getYear(){\n\t\treturn $this->_year;\n\t}", "public function getExpiryYear()\n {\n return $this->expiry_year;\n }", "public function getDateStartYear($date=null){\n\t\t$dateNew = date(\"Y-01-01 H:i:s\",strtotime($date));\n\t\treturn $dateNew;\n\t}", "public function getCurrentYear() {\n return date('Y');\n }", "public function getYear() {\n return $this->_year;\n }", "protected function getYears()\n {\n\t// need to connect to the database here in order to run the\n\t// function mysql_real_escape_string\n\t$isconnected = $this->cedarconnect() ;\n\tif( $isconnected != \"good\" )\n\t{\n\t print( \"$isconnected\\n\" ) ;\n\t exit( 0 ) ;\n\t}\n\n\t$kinst = $_REQUEST['kinst'] ;\n\tif( $kinst )\n\t{\n\t $kinst = mysql_real_escape_string( trim( $kinst ) ) ;\n\t}\n\n\t$params = $_REQUEST['params'] ;\n\tif( $params )\n\t{\n\t $params = mysql_real_escape_string( trim( $params ) ) ;\n\t}\n\n\t$query = \"SELECT DISTINCT d.YEAR\" ;\n\tif( $kinst && !$params )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_type rt,\" ;\n\t $query .= \" tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=rt.RECORD_TYPE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND rt.KINST=$kinst\" ;\n\t}\n\telse if( $params && !$kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND ri.PARAMETER_ID in ($params)\" ;\n\t}\n\telse if( $params && $kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_type rt,\" ;\n\t $query .= \" tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=rt.RECORD_TYPE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND rt.KINST=$kinst\" ;\n\t $query .= \" AND ri.PARAMETER_ID in ($params)\" ;\n\t}\n\telse if( !$params && !$kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t}\n\n\t$query .= \" ORDER BY d.YEAR ASC\" ;\n\t//print( \"$query\\n\" ) ;\n\n\t$result = parent::dbquery( $query ) ;\n\t$num_rows = mysql_num_rows( $result ) ;\n\tif( $num_rows != 0 )\n\t{\n\t while( $line = mysql_fetch_row( $result ) )\n\t {\n\t\tif( $line )\n\t\t{\n\t\t $colnum = 0 ;\n\t\t foreach( $line as $value )\n\t\t {\n\t\t\tif( $colnum > 0 ) echo \",\" ;\n\t\t\techo $value ;\n\t\t\t$colnum++ ;\n\t\t }\n\t\t echo \"\\n\" ;\n\t\t}\n\t }\n\t}\n\n\tparent::dbclose( $result ) ;\n }", "protected function year(){\n return $this->now->format('Y');\n }", "public function getYear()\n {\n return $this->_getDateValue('Y');\n }", "public static function getCurrentYear() {\n return date('Y');\n }", "public function getYear()\n\t{\n\t\treturn $this->year;\n\t}", "public function getYear()\n {\n return $this->year;\n }", "public function getYear()\n {\n return $this->year;\n }", "public function getExpiryYear()\n {\n return $this->expiryYear;\n }", "function years($lowfirst=NO)\n\t{\n\t\tglobal $db;\n\n\t\t$this->error = new error('Year');\n\n\t\t$this->years = array();\n\n\t\t$curyear = date('Y');\n\t\t$hascuryear = NO;\n\t\t$unknown = array();\n\n\t\t$sql = \"SELECT * FROM years WHERE yer_year<=\".(date('Y')+1).\" ORDER BY yer_year \".($lowfirst==YES?'ASC':'DESC');\n\t\t//#echo $sql;\n\t\t$result = mysql_query($sql,$db);\n\t\t//#print_r ($result);\n\t\t$this->error->mysql(__FILE__,__LINE__);\n\t\twhile ($row = mysql_fetch_assoc($result))\n\t\t{\n\t\t\tif ($row['yer_year'] != 'Unknown')\n\t\t\t{\n\t\t\t\t$this->years[] = $row;\n\n\t\t\t\t$year = $row['yer_year'];\n\t\t\t\tif ($year == $curyear) { $hascuryear = YES; }\n\t\t\t}\n\t\t\telse { $unknown = array($row); }\n\t\t}\n\t\t$this->years = array_merge($this->years,$unknown);\n\n\t\tif ($hascuryear == NO)\n\t\t{\n\t\t\t// insert the current year\n\t\t\t$sql = \"INSERT INTO year VALUES (NULL,$curyear)\";\n\t\t\tmysql_query($sql,$db);\n\t\t\t$this->error->mysql(__FILE__,__LINE__);\n\t\t\t$curarr = array('yer_yearID'=>mysql_insert_id(),'yer_year'=>$curyear);\n\t\t\tif ($lowfirst == YES) { $this->years[] = $curarr; }\n\t\t\telse { $this->years = array_merge(array($curarr),$this->years); }\n\t\t}\n\t}", "public function modelYear();", "public function getYear()\r\n\t{\r\n\t\treturn $this->format('y');\r\n\t}", "public function getYear()\n\t\t{\n\t\t\t$date = new \\DateTime($this->created_at);\n\t\t\treturn $date->format('Y');\n\t\t}", "function get_year($cur_date,$type){\n $date_split=split(\"-\",$cur_date);\n if ($type=='1'){\n // Return 2003 Format\n return date(\"Y\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n elseif ($type=='2'){\n // Return 03 format\n return date(\"y\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n }", "public function getYear() : int\n {\n return $this->year;\n }", "function getYear()\n {\n if (!isset($this->iyear) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iyear;\n }", "public function getValidFromYear()\n {\n return $this->valid_from_year;\n }", "public function GetYear() {\n return $this->format('Y');\n }", "public function getFullYear()\r\n\t{\r\n\t\treturn $this->format('Y');\r\n\t}", "public function set_year($from=NULL)\n\t{\n\t $tpl = Ashtree_Common_Template::instance();\n\t \n\t $this_year = date('Y');\n\t \n\t\treturn $tpl->year = (isset($from) && ($from < $this_year)) ? \"{$from}-{$this_year}\" : $this_year;\n\t}", "public function GetThisYear()\n\t\t{\n\t\t\t$year = date('Y');\n\t\t\treturn $year;\n\t\t}", "public function get_year_of_study(){\n\t\t$query = $this->db->get('year');\n\t\treturn $query->result();\n\t}", "function centuryFromYear($year)\n{\n return $year%100==0?(int)floor($year/100):(int)floor($year/100)+1;\n}", "function getYear()\r\n {\r\n return $this->ano;\r\n }", "public function getSsStartYears()\n {\n $years = array();\n $first = date(\"Y\");\n\n for ($index=5; $index>=0; $index--) {\n $year = $first - $index;\n $years[$year] = $year;\n }\n $years = array(0=>$this->__('Year'))+$years;\n return $years;\n }", "function getYear($digits=2){\r\n switch($digits){\r\n case 2: return date('y',$this->timestamp); \r\n case 4: return date('Y',$this->timestamp); \r\n default: return date('Y',$this->timestamp); \r\n }\r\n }", "public function addYear($year = 1)\r\n {\r\n $date = date(self::MASK_TIMESTAMP_USER, mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year + $year));\r\n $this->setValue($date);\r\n return $this;\r\n }", "function nextYear($interval=1){ return $this->_getDate(0,0,$interval); }", "public function year()\n\t{\n\t\treturn date('Y');\n\t}", "public function getSchoolStartDateAttribute()\n {\n if($this->actualClassroom) {\n return $this->actualClassroom->year;\n } else {\n return null;\n }\n \n }", "public function getAcademicYearStartEndDates( $currentYear=NULL, $asDateTimeObject=false, $yearOffset=NULL ) {\n\n $userServiceUtil = $this->container->get('user_service_utility');\n\n //1) get start/end dates from resapp site settings\n $startEndDates = $userServiceUtil->getAcademicYearStartEndDates($currentYear,$asDateTimeObject,$yearOffset,'resapp','resappAcademicYearStart','resappAcademicYearEnd');\n\n $startDate = $startEndDates['startDate'];\n $endDate = $startEndDates['endDate'];\n\n //echo \"startDate=\".$startDate.\"<br>\";\n //echo \"endDate=\".$endDate.\"<br>\";\n\n if( $startDate == NULL || $endDate == NULL ) {\n //2) get start/end dates from default site settings\n $startEndDates = $userServiceUtil->getAcademicYearStartEndDates($currentYear,$asDateTimeObject,$yearOffset);\n\n if( $startDate == NULL ) {\n $startDate = $startEndDates['startDate'];\n }\n\n if( $endDate == NULL ) {\n $endDate = $startEndDates['endDate'];\n }\n\n if( $startDate == NULL || $endDate == NULL ) {\n $currentYear = intval(date(\"Y\"));\n\n //3) If still missing, set to the default value to July 1st\n if( $startDate == NULL ) {\n //$startDate = new \\DateTime($currentYear.\"-07-01\");\n if( $asDateTimeObject ) {\n $startDate = new \\DateTime($currentYear.\"-07-01\");\n } else {\n $startDate = $currentYear.\"-07-01\";\n }\n }\n\n //3) If still missing, set to the default value to June 30\n if( $endDate == NULL ) {\n //$endDate = new \\DateTime($currentYear.\"-06-30\");\n if( $asDateTimeObject ) {\n $endDate = new \\DateTime($currentYear . \"-06-30\");\n } else {\n $endDate = $currentYear . \"-06-30\";\n }\n }\n }\n }\n\n return array(\n 'startDate'=> $startDate,\n 'endDate'=> $endDate,\n );\n }", "public function setStartYear($value)\n {\n return $this->setYearParameter('startYear', $value);\n }", "function GetYear($usn){\r\n\t//to use the global variables\r\n\tglobal $year1st,$year2nd,$year3rd,$year4th;\r\n\t$formattedusn = preg_replace('/\\s+/', '', $usn);\r\n\t$properusn = strtolower($formattedusn);\r\n\t$year = $properusn[3].$properusn[4];\r\n\tif($properusn[7] == 4){\r\n\t\t$year=$year-1;\r\n\t}\r\n\tif ($year == $year1st){\r\n return \"1st Year.\";\r\n }elseif($year == $year2nd){\r\n return \"2nd Year.\";\r\n }elseif($year == $year3rd){\r\n return \"3rd Year.\";\r\n\t}elseif($year == $year4th){\r\n\t\treturn \"4th Year.\";\r\n\t}else return \"No year set\";\r\n\t\r\n}", "public function is_year()\n {\n }", "function getMaxYears()\n {\n return 9999;\n }", "public function getYear()\n {\n if ($this->isReady) {\n if ($strReturn = $this->matchRegex($this->_strSource, IMDB::IMDB_YEAR, 1)) {\n return intval($strReturn);\n }\n }\n return 0;\n }", "function x_current_year($a) {\n return date('Y');\n}", "public function year_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'default' => 'year-01-01'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 100\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_end', $this->CDT->add_year($this->P->value('limit')));\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = ($this->P->value('date_range_end', 'ymd') > $this->P->value('date_range_start', 'ymd')) ? 1 : -1;\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo {\n\t\t\t$vars['conditional']\t= array\t(\t'is_current_year'\t\t=>\t($this->CDT->year == $today['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t\t\t\t\t\t'is_not_current_year'\t=>\t($this->CDT->year == $today['year']) ? FALSE : TRUE\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$vars['single']\t= array('year'\t=> $this->CDT->year);\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'year'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_year($dir);\n\t\t\t$count++;\n\t\t} while ($count < $this->P->value('limit') AND $this->CDT->year < $this->P->value('date_range_end', 'year'));\n\n\t\treturn $output;\n\t}", "public function getPublicationYear() {\n $fields = array('publicationYear');\n $result = TingOpenformatMethods::parseFields($this->_getPublicationDetails(), $fields);\n return (is_array($result)) ? reset($result) : $result;\n }", "function erp_financial_start_date() {\n $financial_year_dates = erp_get_financial_year_dates();\n\n return $financial_year_dates['start'];\n}", "public function enableYear() {\n\t\t$this->displayYear = true;\n\t}", "function getyear($txt)\n {\n\t\n\t return substr($txt,0,4);\n }", "public function getCurrentOrLastStudentCareerSchoolYear()\n {\n $object = $this->getCurrentStudentCareerSchoolYear();\n if (is_null($object))\n {\n return $this->getLastStudentCareerSchoolYear();\n }\n else\n return $object;\n }", "function dayOfProgrammer($year) {\n if($year <1918 && $year%400!=0 && $year%100==0 ) {\n $date=date_create($year.'-01-01');\n date_add($date,date_interval_create_from_date_string(\"254 days\"));\n return date_format($date,\"d.m.Y\"); \n } else if($year == 1918) {\n $date=date_create($year.'-01-01');\n date_add($date,date_interval_create_from_date_string(\"268 days\"));\n return date_format($date,\"d.m.Y\");\n } else {\n $date=date_create($year.'-01-01');\n date_add($date,date_interval_create_from_date_string(\"255 days\"));\n return date_format($date,\"d.m.Y\");\n }\n}", "public function calcYearUser($date)\n {\n\n $date = new \\DateTime($date); // data de nascimento\n $interval = $date->diff(new \\DateTime()); // data definida\n return $interval->format('%Y');\n\n }", "public function getCurrentYear()\n {\n if (! $this->hasGeoLocator()) {\n return (new \\DateTime)->format('Y');\n }\n $timezone = $this->geoLocator->getTimezone($this->getClientIp());\n\n return (new \\DateTime(null, new \\DateTimeZone($timezone)))->format('Y');\n }", "public function getActiveYears() {\n return $this->activeYears;\n }", "function get_current_finacial_year(){\n $str_query=\"select financial_year_id, year_name, date_start, date_end from financial_year \n where CURDATE() between date_start and date_end\";\n\tif (!$this->sql_query($str_query)){\n return false;\n\t}\n\t\n return $this->fetch();\n }", "function get_date_frm_loc_in_yr($location_in_year,$cur_date){\n $date_split=split(\"-\",$cur_date);\n return date(\"d-m-Y\",mktime (0,0,0,1,$location_in_year,$date_split[2]));\n }", "public function hasStartYear() {\n return $this->_has(4);\n }", "function this_year()\n{\n global $db; // golbalize db variable:\n $thisYear = date('Y') . '-01-01';\n $nextYear = ((int) date('Y') + 1) . '-01-01';\n $datesIds = $db->getMany(DATES, [\n 'date' => $thisYear,\n 'dates.date' => $nextYear,\n ], ['id', 'date'], ['date' => '>=', 'dates.date' => '<=']);\n if ($db->count > 0) {\n return $datesIds;\n }\n}", "public function getYear()\n {\n if (!isset($this->year))\n {\n $this->year = $this->getHelper()->getYearFromPath($this->getPathname()) ?? false;\n }\n\n return $this->year;\n }", "function find_dob_yr($year)\n {\n $this->db->_protect_identifiers = FALSE;\n\n return $this->db->select('name, nat, cat, dob_md')\n ->from('authors')\n ->join('nats', 'nats.id = authors.nat_id')\n ->join('cats', 'cats.id = authors.cat_id')\n ->where('dob_yr', $year)\n ->order_by(\"str_to_date(dob_md, '%M %E')\")\n ->get()->result();\n }", "public function getPublicationYearOfComponent() {\n return $this->publicationYearOfComponent;\n }", "public function getYear()\n {\n return $this->calendarMonth->getYear();\n }", "public function getSsStartYears()\n {\n $years = [];\n $first = date(\"Y\");\n\n for ($index = 5; $index >= 0; $index--) {\n $year = $first - $index;\n $years[$year] = $year;\n }\n return $years;\n }", "function set_end_year($endYear,&$error)\r\n {\r\n if (strlen($endYear) > 0)\r\n\t\t{\r\n //check if the name contains special characters\r\n if (!preg_match('/^\\d{4}$/', $endYear))\r\n {\r\n \r\n $error = \"End Year Is Not Valid\";\r\n }\r\n else\r\n { //sanitize and feed back up the pipe to display in the form and save on the server\r\n $this->EndYear = filter_var(trim($endYear), FILTER_SANITIZE_NUMBER_INT); \r\n\r\n //return a valid css class\r\n\t\t\treturn \"class='valid'\";\r\n }\r\n }//end if >0\r\n else\r\n {\r\n \r\n $error = \"End Year Must Be Greater Than Zero\";\r\n\r\n //return a invalid css class\r\n\t\t\t return \"class='error'\";\r\n }//end else\r\n\r\n }", "function lib4ridora_construct_year_filter($form_state) {\n // Get the values out of the form.\n $year_type = $form_state['values']['year']['select'];\n $to = empty($form_state['values']['year']['to']) ? \"*\" : $form_state['values']['year']['to'];\n $from = empty($form_state['values']['year']['from']) ? \"*\" : $form_state['values']['year']['from'];\n // If nothing was entered in the date fields, exit early.\n if ($to == \"*\" && $from == \"*\") {\n return \"\";\n }\n\n // Convert to proper format for solr.\n if ($to != '*') {\n $to_date = new DateTime();\n $to = date_format($to_date->createFromFormat('Y/m/d/G:i:s', \"$to/12/31/23:59:59\"), 'Y-m-d\\TH:i:s\\Z');\n }\n if ($from != '*') {\n $from_date = new DateTime();\n $from = date_format($from_date->createFromFormat('Y/m/d/G:i:s', \"$from/01/01/0:00:00\"), 'Y-m-d\\TH:i:s\\Z');\n }\n\n // Return fq string.\n module_load_include(\"inc\", \"islandora_solr\", \"includes/utilities\");\n switch ($year_type) {\n case \"publication year\":\n $publication_year_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_publication_year', 'mods_originInfo_encoding_w3cdtf_keyDate_yes_dateIssued_dt'));\n return \"$publication_year_field:[$from TO $to]\";\n\n case \"reporting year\":\n $reporting_year_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_reporting_year', 'mods_originInfo_encoding_w3cdtf_type_reporting year_dateOther_dt'));\n return \"$reporting_year_field:[$from TO $to]\";\n\n default:\n return \"\";\n }\n}", "function generate_years($id = 'year', $startYear = '', $endYear = '') {\n $startYear = (strlen(trim($startYear)) ? $startYear : date('Y') - 10);\n $endYear = (strlen(trim($endYear)) ? $endYear : date('Y'));\n\n if (!holds_int($startYear) || !holds_int($endYear)) {\n return 'Year must be integer value!';\n }\n\n if ((strlen(trim($startYear)) < 4) || (strlen(trim($endYear)) < 4)) {\n return 'Year must be 4 digits in length!';\n }\n\n if (trim($startYear) > trim($endYear)) {\n return 'Start Year cannot be greater than End Year!';\n }\n\n //start the select tag\n $html = '<select id=\"' . $id . '\" name=\"' . $id . '\">\"n\"';\n $html .= '<option value=\"\">-- Year --</option>\"n\"';\n //echo each year as an option \n for ($i = $endYear; $i >= $startYear; $i--) {\n $html .= '<option value=\"' . $i . '\">' . $i . '</option>\"n\"';\n }\n //close the select tag\n $html .= \"</select>\";\n\n return $html;\n }", "function addDateYears($mySQLFormatDate, $noOfYearsToAdd)\n{\n\t\t$ed = strtotime('+' .$noOfYearsToAdd . ' years', strtotime($mySQLFormatDate)); \n\t\t$retDate = date('Y-m-d', $ed); \n\t\treturn $retDate;\n\t\n}", "public function years()\n {\n // ->paginate();\n\n // $users = User::all()\n // ->paginate();\n $users = User::where('active','=','1')->where('yearofLeaving','=','%1969')->take(12)->get();\n\n return view('public.welcome', compact('users'));\n }", "function get_yr_nxt($cur_date){\n $date_split=split(\"-\",$cur_date);\n return date(\"d-m-Y\",mktime (0,0,0,$date_split[1],$date_split[0],($date_split[2]+1)));\n }", "public function getAlbumYear()\n {\n return $this->albumYear;\n }", "function getMediaYears($date)\n{\n $sql = \"SELECT media_year,media_year_start,media_year_end from media_calendar where media_year <= YEAR('\" . $date . \"') GROUP by media_year ORDER BY media_year DESC\";\n $result = getResult($sql);\n return $result;\n}", "public function getNextUserID()\n {\n $lastID = $this->lastUserID();\n $year = substr($lastID, 0, (strpos($lastID, '-') ?: +1));\n if ($year >= date(\"Y\")) {\n return $year . '-' . ($this->getUserNo($lastID) + 1);\n } else {\n return ($year + 1) . '-1001';\n }\n }", "public function __year ( $sField, $mValue )\n {\n return \"EXTRACT(YEAR FROM $sField) = $mValue\";\n }", "public function getYear(): string\n {\n return $this->toLocalizedString('y');\n }", "private function retrieve_currentyear() {\n\t\tstatic $replacement;\n\n\t\tif ( ! isset( $replacement ) ) {\n\t\t\t$replacement = date_i18n( 'Y' );\n\t\t}\n\n\t\treturn $replacement;\n\t}", "public function getYearListAppTr() \n {\t\t\n $this->db->select('to_char(th_date_from,\\'yyyy\\') as \"CM_YEAR\"');\n $this->db->from(\"ims_hris.training_head\");\n $this->db->where(\"th_internal_external = 'EXTERNAL_AGENCY'\");\n $this->db->group_by(\"th_date_from\");\n $this->db->order_by(\"TO_CHAR(th_date_from,'YYYY') desc\");\n $q = $this->db->get();\n \n return $q->result();\n }", "function getYearReg($selYear=\"\"){\n\t\t//if($selYear==\"\")\n\t\t//\t$selYear = date(\"Y\");\n\t\t$strYear = \"<option value=''>0000</option>\";\n\t\tfor($ind=1901;$ind<=date(\"Y\")+5;$ind++){\n\t\t\tif($ind == $selYear)\n\t\t\t\t$strSel = \"selected\";\n\t\t\telse\n\t\t\t\t$strSel = \"\";\n\t\t\t\t\n\t\t\t$strYear.=\"<option value=\".$ind.\" $strSel>\".(strlen($ind)==1?\"0\".$ind:$ind).\"</option>\";\n\t\t}\n\t\t\n\t\treturn $strYear;\n\t}", "public function getYearList() \n {\t\t\n $this->db->select(\"to_char(cm_date, 'yyyy') as cm_year\");\n $this->db->from(\"ims_hris.calendar_main\");\n $this->db->where(\"to_char(cm_date, 'yyyy')::numeric >= to_char(current_date, 'yyyy')::numeric - 15\");\n $this->db->group_by(\"to_char(cm_date, 'YYYY')\");\n $this->db->order_by(\"to_char(cm_date, 'YYYY') desc\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "public static function getFirstDayOfCurrentYear()\n\t{\n\t\t$dateInSeconds = mktime(0, 0, 0, 1, 1, date('Y'));\n\t\t$date = date('Y-m-d', $dateInSeconds);\n\t\treturn $date;\n\t}", "protected function getYearString() {\n\t\tif ($this->showsAllYears()) {\n\t\t\treturn $this->titleForAllYears();\n\t\t} elseif ($this->showsLast6Months()) {\n\t\t\treturn __('Last 6 months');\n\t\t} elseif ($this->showsLast12Months()) {\n\t\t\treturn __('Last 12 months');\n\t\t}\n\n\t\treturn $this->year;\n\t}" ]
[ "0.6580952", "0.6534069", "0.6500907", "0.64486784", "0.6407487", "0.62256145", "0.61999327", "0.6197664", "0.61660033", "0.6134222", "0.6069793", "0.6050429", "0.6046336", "0.6003379", "0.5990239", "0.5976513", "0.59656984", "0.594819", "0.59429795", "0.5912817", "0.5911117", "0.5911117", "0.59009564", "0.58815765", "0.58546454", "0.5843151", "0.5834452", "0.5820866", "0.5813671", "0.5809508", "0.5793875", "0.5788719", "0.5786749", "0.5785757", "0.5785757", "0.57435507", "0.5737715", "0.5731426", "0.5703118", "0.56973994", "0.56894034", "0.56882423", "0.56831044", "0.5677261", "0.5672965", "0.56702477", "0.56591624", "0.56173927", "0.5596718", "0.5586514", "0.5586467", "0.5581794", "0.55599207", "0.5558028", "0.5556634", "0.5549426", "0.55333054", "0.5520244", "0.55111915", "0.54963475", "0.5479305", "0.5468113", "0.54579765", "0.54457474", "0.5435723", "0.5432107", "0.54241675", "0.5419151", "0.541484", "0.5401373", "0.53960395", "0.53927475", "0.53806406", "0.5361555", "0.535786", "0.534815", "0.5346648", "0.53231025", "0.5311265", "0.53032804", "0.53001225", "0.5297109", "0.52953017", "0.5295221", "0.5278167", "0.5271962", "0.5263709", "0.5260946", "0.5260806", "0.52558565", "0.5253612", "0.5252976", "0.52446234", "0.5236219", "0.52314067", "0.523113", "0.5229704", "0.52191323", "0.52173984", "0.52112764" ]
0.70028317
0
Jamie Alnasir, created. Determine whether site is running from within a frame of an Android or iOS app These apps load the ChooseSurvey Wordpress site setting the RHUL_App parameter to "true" i.e. therefore it is sufficient just to check whether RHUL_App has been set, as direct access through a browser (even on a mobile) will not require this URL parameter to be set.
function isRHULApp() { if (isset($_GET['RHUL_App'])) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function qa_is_mobile_probably()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\trequire_once QA_INCLUDE_DIR . 'util/string.php';\n\n\t// inspired by: http://dangerousprototypes.com/docs/PhpBB3_MOD:_Replacement_mobile_browser_detection_for_mobile_themes\n\n\t$loweragent = strtolower(@$_SERVER['HTTP_USER_AGENT']);\n\n\tif (strpos($loweragent, 'ipad') !== false) // consider iPad as desktop\n\t\treturn false;\n\n\t$mobileheaders = array('HTTP_X_OPERAMINI_PHONE', 'HTTP_X_WAP_PROFILE', 'HTTP_PROFILE');\n\n\tforeach ($mobileheaders as $header)\n\t\tif (isset($_SERVER[$header]))\n\t\t\treturn true;\n\n\tif (qa_string_matches_one($loweragent, array(\n\t\t'android', 'phone', 'mobile', 'windows ce', 'palm', ' mobi', 'wireless', 'blackberry', 'opera mini', 'symbian',\n\t\t'nokia', 'samsung', 'ericsson,', 'vodafone/', 'kindle', 'ipod', 'wap1.', 'wap2.', 'sony', 'sanyo', 'sharp',\n\t\t'panasonic', 'philips', 'pocketpc', 'avantgo', 'blazer', 'ipaq', 'up.browser', 'up.link', 'mmp', 'smartphone', 'midp',\n\t)))\n\t\treturn true;\n\n\treturn qa_string_matches_one(strtolower(@$_SERVER['HTTP_ACCEPT']), array(\n\t\t'application/vnd.wap.xhtml+xml', 'text/vnd.wap.wml',\n\t));\n}", "function pp_came_from_rcp() {\n\n\tif ( isset( $_GET['referrer'] ) && 'rcp_site' === $_GET['referrer'] ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "private function _set_mobile_apps()\n {\n if (is_array($this->mobile_apps) AND count($this->mobile_apps) > 0)\n {\n foreach ($this->mobile_apps as $key => $val)\n {\n if (FALSE !== (strpos(strtolower($this->agent), $key)))\n {\n $this->mobile_app = $val;\n $this->is_mobile_app = TRUE;\n return TRUE;\n }\n }\n }\n return FALSE;\n }", "function rhd_is_mobile() {\n\t$mobile_browser = 0;\n\n\tif (preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|android)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {\n\t $mobile_browser++;\n\t}\n\n\tif ((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml') > 0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))) {\n\t $mobile_browser++;\n\t}\n\n\t$mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'], 0, 4));\n\t$mobile_agents = array(\n\t 'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',\n\t 'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',\n\t 'ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-',\n\t 'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-',\n\t 'newt','noki','oper','palm','pana','pant','phil','play','port','prox',\n\t 'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar',\n\t 'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-',\n\t 'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp',\n\t 'wapr','webc','winw','winw','xda ','xda-');\n\n\tif (in_array($mobile_ua,$mobile_agents)) {\n\t $mobile_browser++;\n\t}\n\n\tif ( array_key_exists( 'ALL_HTTP', $_SERVER ) ) {\n\t\tif (strpos(strtolower($_SERVER['ALL_HTTP']),'OperaMini') > 0) {\n\t\t $mobile_browser++;\n\t\t}\n\t}\n\n\tif (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'windows') > 0) {\n\t $mobile_browser = 0;\n\t}\n\n\tif ( $mobile_browser > 0 ) {\n\t\t$mobile_browser = TRUE;\n\t} else {\n\t\t$mobile_browser = FALSE;\n\t}\n\n\treturn $mobile_browser;\n}", "function wp_is_mobile() {\r\n static $is_mobile;\r\n\r\n if ( isset( $is_mobile ) )\r\n return $is_mobile;\r\n\r\n if ( empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {\r\n $is_mobile = false;\r\n } elseif ( strpos( $_SERVER[ 'HTTP_USER_AGENT' ], 'Mobile' ) !== false // many mobile devices ( all iPhone, iPad, etc. )\r\n || strpos( $_SERVER[ 'HTTP_USER_AGENT' ], 'Android' ) !== false\r\n || strpos( $_SERVER[ 'HTTP_USER_AGENT' ], 'BlackBerry' ) !== false\r\n || strpos( $_SERVER[ 'HTTP_USER_AGENT' ], 'Opera Mini' ) !== false\r\n ) {\r\n $is_mobile = true;\r\n } else {\r\n $is_mobile = false;\r\n }\r\n\r\n return $is_mobile;\r\n }", "function jetpackme_is_mobile() {\r\n \r\n // Are Jetpack Mobile functions available?\r\n if ( ! function_exists( 'jetpack_is_mobile' ) )\r\n return false;\r\n \r\n // Is Mobile theme showing?\r\n if ( isset( $_COOKIE['akm_mobile'] ) && $_COOKIE['akm_mobile'] == 'false' )\r\n return false;\r\n \r\n return jetpack_is_mobile();\r\n}", "function ms_site_check()\n {\n }", "public function checkAcquiaHosted() {\n return isset($_SERVER['AH_SITE_ENVIRONMENT'], $_SERVER['AH_SITE_NAME']);\n }", "function p2_is_iphone() {\n\t$output = false;\n\n\tif ( ( isset( $_SERVER['HTTP_USER_AGENT'] ) && strstr( $_SERVER['HTTP_USER_AGENT'], 'iPhone' ) && ! strstr( $_SERVER['HTTP_USER_AGENT'], 'iPad' ) ) || isset( $_GET['iphone'] ) && $_GET['iphone'] )\n\t\t$output = true;\n\n\t$output = (bool) apply_filters( 'p2_is_iphone', $output );\n\n\treturn $output;\n}", "protected function isPageSliderContext()\n\t{\n\t\treturn $this->request->get('IFRAME') === 'Y';\n\t}", "public function isSite() {\n return false;\n }", "function canHandleCurrentUrl() ;", "private function what_page() {\n $query = (isset($_REQUEST['qa']) && $_SERVER['REQUEST_METHOD'] == \"GET\") ? $_REQUEST['qa'] : FALSE;\n if (!$query)\n return false;\n\n return $query;\n }", "function MobileDetected() \n{\n\t$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);\n\t$accept = strtolower($_SERVER['HTTP_ACCEPT']);\n \n\tif( strpos($accept,'text/vnd.wap.wml')!==false || strpos($accept,'application/vnd.wap.xhtml+xml')!==false ) \n\t\treturn 1; // Mobile browser detected by HTTP-headers\n \n\tif( isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE']) ) \n\t\treturn 2; // Mobile browser detected by server settings\n\n\n\tif(preg_match('/(ipad|android|symbianos|opera mini|ipod|blackberry|'.\n\t\t'palm os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine|iris|3g_t|'.\n\t\t'windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile|'.\n\t\t'mini 9.5|vx1000|lge |m800|e860|u940|ux840|compal|'.\n\t\t'wireless| mobi|ahong|lg380|lgku|lgu900|lg210|lg47|lg920|lg840|'.\n\t\t'lg370|sam-r|mg50|s55|g83|t66|vx400|mk99|d615|d763|el370|sl900|'.\n\t\t'mp500|samu3|samu4|vx10|xda_|samu5|samu6|samu7|samu9|a615|b832|'.\n\t\t'm881|s920|n210|s700|c-810|_h797|mob-x|sk16d|848b|mowser|s580|'.\n\t\t'r800|471x|v120|rim8|c500foma:|160x|x160|480x|x640|t503|w839|'.\n\t\t'i250|sprint|w398samr810|m5252|c7100|mt126|x225|s5330|s820|'.\n\t\t'htil-g1|fly v71|s302|-x113|novarra|k610i|-three|8325rc|8352rc|'.\n\t\t'sanyo|vx54|c888|nx250|n120|mtk |c5588|s710|t880|c5005|i;458x|'.\n\t\t'p404i|s210|c5100|teleca|s940|c500|s590|foma|samsu|vx8|vx9|a1000|'.\n\t\t'_mms|myx|a700|gu1100|bc831|e300|ems100|me701|me702m-three|sd588|'.\n\t\t's800|8325rc|ac831|mw200|brew |d88|htc\\/|htc_touch|355x|m50|km100|'.\n\t\t'd736|p-9521|telco|sl74|ktouch|m4u\\/|me702|8325rc|kddi|phone|lg |'.\n\t\t'sonyericsson|samsung|240x|x320vx10|nokia|sony cmd|motorola|'.\n\t\t'up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|'.\n\t\t'pocket|kindle|silk|hpwos|mobile|psp|treo)/', $user_agent)) \n\t{\n\t\treturn 3; // Mobile browser detected by User Agent signature\n\t}\n\n\tif(in_array(substr($user_agent,0,4),\n\t\tArray(\"1207\", \"3gso\", \"4thp\", \"501i\", \"502i\", \"503i\", \"504i\", \"505i\", \"506i\",\n\t\t\t \"6310\", \"6590\", \"770s\", \"802s\", \"a wa\", \"abac\", \"acer\", \"acoo\", \"acs-\",\n\t\t\t \"aiko\", \"airn\", \"alav\", \"alca\", \"alco\", \"amoi\", \"anex\", \"anny\", \"anyw\",\n\t\t\t \"aptu\", \"arch\", \"argo\", \"aste\", \"asus\", \"attw\", \"au-m\", \"audi\", \"aur \",\n\t\t\t \"aus \", \"avan\", \"beck\", \"bell\", \"benq\", \"bilb\", \"bird\", \"blac\", \"blaz\",\n\t\t\t \"brew\", \"brvw\", \"bumb\", \"bw-n\", \"bw-u\", \"c55/\", \"capi\", \"ccwa\", \"cdm-\",\n\t\t\t \"cell\", \"chtm\", \"cldc\", \"cmd-\", \"cond\", \"craw\", \"dait\", \"dall\", \"dang\",\n\t\t\t \"dbte\", \"dc-s\", \"devi\", \"dica\", \"dmob\", \"doco\", \"dopo\", \"ds-d\", \"ds12\",\n\t\t\t \"el49\", \"elai\", \"eml2\", \"emul\", \"eric\", \"erk0\", \"esl8\", \"ez40\", \"ez60\",\n\t\t\t \"ez70\", \"ezos\", \"ezwa\", \"ezze\", \"fake\", \"fetc\", \"fly-\", \"fly_\", \"g-mo\",\n\t\t\t \"g1 u\", \"g560\", \"gene\", \"gf-5\", \"go.w\", \"good\", \"grad\", \"grun\", \"haie\",\n\t\t\t \"hcit\", \"hd-m\", \"hd-p\", \"hd-t\", \"hei-\", \"hiba\", \"hipt\", \"hita\", \"hp i\",\n\t\t\t \"hpip\", \"hs-c\", \"htc \", \"htc-\", \"htc_\", \"htca\", \"htcg\", \"htcp\", \"htcs\",\n\t\t\t \"htct\", \"http\", \"huaw\", \"hutc\", \"i-20\", \"i-go\", \"i-ma\", \"i230\", \"iac\",\n\t\t\t \"iac-\", \"iac/\", \"ibro\", \"idea\", \"ig01\", \"ikom\", \"im1k\", \"inno\", \"ipaq\",\n\t\t\t \"iris\", \"jata\", \"java\", \"jbro\", \"jemu\", \"jigs\", \"kddi\", \"keji\", \"kgt\",\n\t\t\t \"kgt/\", \"klon\", \"kpt \", \"kwc-\", \"kyoc\", \"kyok\", \"leno\", \"lexi\", \"lg g\",\n\t\t\t \"lg-a\", \"lg-b\", \"lg-c\", \"lg-d\", \"lg-f\", \"lg-g\", \"lg-k\", \"lg-l\", \"lg-m\",\n\t\t\t \"lg-o\", \"lg-p\", \"lg-s\", \"lg-t\", \"lg-u\", \"lg-w\", \"lg/k\", \"lg/l\", \"lg/u\",\n\t\t\t \"lg50\", \"lg54\", \"lge-\", \"lge/\", \"libw\", \"lynx\", \"m-cr\", \"m1-w\", \"m3ga\",\n\t\t\t \"m50/\", \"mate\", \"maui\", \"maxo\", \"mc01\", \"mc21\", \"mcca\", \"medi\", \"merc\",\n\t\t\t \"meri\", \"midp\", \"mio8\", \"mioa\", \"mits\", \"mmef\", \"mo01\", \"mo02\", \"mobi\",\n\t\t\t \"mode\", \"modo\", \"mot \", \"mot-\", \"moto\", \"motv\", \"mozz\", \"mt50\", \"mtp1\",\n\t\t\t \"mtv \", \"mwbp\", \"mywa\", \"n100\", \"n101\", \"n102\", \"n202\", \"n203\", \"n300\",\n\t\t\t \"n302\", \"n500\", \"n502\", \"n505\", \"n700\", \"n701\", \"n710\", \"nec-\", \"nem-\",\n\t\t\t \"neon\", \"netf\", \"newg\", \"newt\", \"nok6\", \"noki\", \"nzph\", \"o2 x\", \"o2-x\",\n\t\t\t \"o2im\", \"opti\", \"opwv\", \"oran\", \"owg1\", \"p800\", \"palm\", \"pana\", \"pand\",\n\t\t\t \"pant\", \"pdxg\", \"pg-1\", \"pg-2\", \"pg-3\", \"pg-6\", \"pg-8\", \"pg-c\", \"pg13\",\n\t\t\t \"phil\", \"pire\", \"play\", \"pluc\", \"pn-2\", \"pock\", \"port\", \"pose\", \"prox\",\n\t\t\t \"psio\", \"pt-g\", \"qa-a\", \"qc-2\", \"qc-3\", \"qc-5\", \"qc-7\", \"qc07\", \"qc12\",\n\t\t\t \"qc21\", \"qc32\", \"qc60\", \"qci-\", \"qtek\", \"qwap\", \"r380\", \"r600\", \"raks\",\n\t\t\t \"rim9\", \"rove\", \"rozo\", \"s55/\", \"sage\", \"sama\", \"samm\", \"sams\", \"sany\",\n\t\t\t \"sava\", \"sc01\", \"sch-\", \"scoo\", \"scp-\", \"sdk/\", \"se47\", \"sec-\", \"sec0\",\n\t\t\t \"sec1\", \"semc\", \"send\", \"seri\", \"sgh-\", \"shar\", \"sie-\", \"siem\", \"sk-0\",\n\t\t\t \"sl45\", \"slid\", \"smal\", \"smar\", \"smb3\", \"smit\", \"smt5\", \"soft\", \"sony\",\n\t\t\t \"sp01\", \"sph-\", \"spv \", \"spv-\", \"sy01\", \"symb\", \"t-mo\", \"t218\", \"t250\",\n\t\t\t \"t600\", \"t610\", \"t618\", \"tagt\", \"talk\", \"tcl-\", \"tdg-\", \"teli\", \"telm\",\n\t\t\t \"tim-\", \"topl\", \"tosh\", \"treo\", \"ts70\", \"tsm-\", \"tsm3\", \"tsm5\", \"tx-9\",\n\t\t\t \"up.b\", \"upg1\", \"upsi\", \"utst\", \"v400\", \"v750\", \"veri\", \"virg\", \"vite\",\n\t\t\t \"vk-v\", \"vk40\", \"vk50\", \"vk52\", \"vk53\", \"vm40\", \"voda\", \"vulc\", \"vx52\",\n\t\t\t \"vx53\", \"vx60\", \"vx61\", \"vx70\", \"vx80\", \"vx81\", \"vx83\", \"vx85\", \"vx98\",\n\t\t\t \"w3c \", \"w3c-\", \"wap-\", \"wapa\", \"wapi\", \"wapj\", \"wapm\", \"wapp\", \"wapr\",\n\t\t\t \"waps\", \"wapt\", \"wapu\", \"wapv\", \"wapy\", \"webc\", \"whit\", \"wig \", \"winc\",\n\t\t\t \"winw\", \"wmlb\", \"wonu\", \"x700\", \"xda-\", \"xda2\", \"xdag\", \"yas-\", \"your\",\n\t\t\t \"zeto\", \"zte-\"))) \n\t{\n\t\treturn 4; // Mobile browser detected by User Agent signature\n\t}\n\n\treturn false; // Mobile browser not found\n}", "function is_lti_request() {\n $good_message_type = $_REQUEST[\"lti_message_type\"] == \"basic-lti-launch-request\";\n $good_lti_version = $_REQUEST[\"lti_version\"] == \"LTI-1p0\";\n $resource_link_id = $_REQUEST[\"resource_link_id\"];\n if ($good_message_type and $good_lti_version and isset($resource_link_id) ) return(true);\n return false;\n}", "function detectAgent()\n {\n\t$iphone = strpos($_SERVER['HTTP_USER_AGENT'],\"iPhone\");\n\t$android = strpos($_SERVER['HTTP_USER_AGENT'],\"Android\");\n\t$palmpre = strpos($_SERVER['HTTP_USER_AGENT'],\"webOS\");\n\t$berry = strpos($_SERVER['HTTP_USER_AGENT'],\"BlackBerry\");\n\t$ipod = strpos($_SERVER['HTTP_USER_AGENT'],\"iPod\");\n\t$ipad = strpos($_SERVER['HTTP_USER_AGENT'], \"iPad\");\n\t\t\n\tif ($android || $palmpre || $berry == true) \n\t{ \n\t\t$long = \"https://play.google.com/store/apps/details?id=com.guestpass.app\";\n\t\t//genshort\n\t\t$shorten = geturl($long);\n\t\t$short = trimString($shorten);\n\t\t//save file\n\t\tgenFile($long, $short);\n\t\t//enter into database\n\t\tinsertDB($long, $short);\n\t\t//clickanalytics??\t\t\n\t\tclickanalytics($short);\n\t\theader(\"Location: $long\"); \n\t} \n\telse if ($iphone || $ipod || $ipad == true)\n\t{\n\t\t$long = \"https://itunes.apple.com/us/app/guestops/id582206023\";\n\t\t//genshort\n\t\t$shorten = geturl($long);\n\t\t$short = trimString($shorten);\n\t\t//save file\n\t\tgenFile($long, $short);\n\t\t//enter into database\n\t\tinsertDB($long, $short);\n\t\t//clickanalytics??\t\t\n\t\tclickanalytics($short);\n\t\theader(\"Location: $long\"); \n\t}\n\telse\n\t{ header('Location: http://www.grata.com'); } \n }", "function trueSiteUrl() {\n\t\treturn $GLOBALS[\"trueSiteUrl\"];\n\t}", "function alaya_is_mobile() {\n\t$user_agent = $_SERVER['HTTP_USER_AGENT'];\n\t$mobile_agents = Array(\"240x320\",\"acer\",\"acoon\",\"acs-\",\"abacho\",\"ahong\",\"airness\",\"alcatel\",\"amoi\",\"android\",\"anywhereyougo.com\",\"applewebkit/525\",\"applewebkit/532\",\"asus\",\"audio\",\"au-mic\",\"avantogo\",\"becker\",\"benq\",\"bilbo\",\"bird\",\"blackberry\",\"blazer\",\"bleu\",\"cdm-\",\"compal\",\"coolpad\",\"danger\",\"dbtel\",\"dopod\",\"elaine\",\"eric\",\"etouch\",\"fly \",\"fly_\",\"fly-\",\"go.web\",\"goodaccess\",\"gradiente\",\"grundig\",\"haier\",\"hedy\",\"hitachi\",\"htc\",\"huawei\",\"hutchison\",\"inno\",\"ipod\",\"jbrowser\",\"kddi\",\"kgt\",\"kwc\",\"lenovo\",\"lg \",\"lg2\",\"lg3\",\"lg4\",\"lg5\",\"lg7\",\"lg8\",\"lg9\",\"lg-\",\"lge-\",\"lge9\",\"longcos\",\"maemo\",\"mercator\",\"meridian\",\"micromax\",\"midp\",\"mini\",\"mitsu\",\"mmm\",\"mmp\",\"mobi\",\"mot-\",\"moto\",\"nec-\",\"netfront\",\"newgen\",\"nexian\",\"nf-browser\",\"nintendo\",\"nitro\",\"nokia\",\"nook\",\"novarra\",\"obigo\",\"palm\",\"panasonic\",\"pantech\",\"philips\",\"phone\",\"pg-\",\"playstation\",\"pocket\",\"pt-\",\"qc-\",\"qtek\",\"rover\",\"sagem\",\"sama\",\"samu\",\"sanyo\",\"samsung\",\"sch-\",\"scooter\",\"sec-\",\"sendo\",\"sgh-\",\"sharp\",\"siemens\",\"sie-\",\"softbank\",\"sony\",\"spice\",\"sprint\",\"spv\",\"symbian\",\"tablet\",\"talkabout\",\"tcl-\",\"teleca\",\"telit\",\"tianyu\",\"tim-\",\"toshiba\",\"tsm\",\"up.browser\",\"utec\",\"utstar\",\"verykool\",\"virgin\",\"vk-\",\"voda\",\"voxtel\",\"vx\",\"wap\",\"wellco\",\"wig browser\",\"wii\",\"windows ce\",\"wireless\",\"xda\",\"xde\",\"zte\");\n\t$is_mobile = false;\n\tforeach ($mobile_agents as $device) {\n\t\tif (stristr($user_agent, $device)) {\n\t\t\t$is_mobile = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\t$is_mobile = apply_filters('alaya_is_mobile', $is_mobile);\n\treturn $is_mobile;\n}", "function jetpack_is_atomic_site() {\n\t$at_options = get_option( 'at_options', array() );\n\treturn ! empty( $at_options ) || defined( 'WPCOMSH__PLUGIN_FILE' );\n}", "static function is_mobile()\n\t{\t\t\n\t\tif(!isset(self::$_libs['user_agent'])){\n\t\t\tself::loadLibrary('SHIN_User_agent', TRUE);\n\t\t}\n\t\treturn self::$_libs['user_agent']->is_mobile();\n\t}", "public function canHandleCurrentUrl() {}", "public static function is_mobile() {\n\t\t//If is the first checking\n\t\tif (self::$mobile==null) {\n\t\t\t//If exists the variable nomob\n\t\t\tif (GET::exists('nomob')) {\n\t\t\t\t//Se the user is from a PC\n\t\t\t\tCOOKIE::set('ale_mobile','false',30*24*60);\n\t\t\t\tself::$mobile=false;\n\t\t\t} else {\n\t\t\t\t//Check if was calculated the device of the user\n\t\t\t\tif (COOKIE::exists('ale_mobile'))\n\t\t\t\t\tself::$mobile=COOKIE::val('ale_mobile')=='true';\t//Set the old value\n\t\t\t\telse {\n\t\t\t\t\t//Find what device is\n\t\t\t\t\tself::$mobile = false;\n\t\t\t\t\t//List of devices\n\t\t\t\t\t$devices = array(\n\t\t\t\t\t\t\t\"Android\" => \"android.*mobile\",\n\t\t\t\t\t\t\t\"Androidtablet\" => \"android(?!.*mobile)\",\n\t\t\t\t\t\t\t\"Blackberry\" => \"blackberry\",\n\t\t\t\t\t\t\t\"Blackberrytablet\" => \"rim tablet os\",\n\t\t\t\t\t\t\t\"Iphone\" => \"(iphone|ipod)\",\n\t\t\t\t\t\t\t\"Ipad\" => \"(ipad)\",\n\t\t\t\t\t\t\t\"Palm\" => \"(avantgo|blazer|elaine|hiptop|palm|plucker|xiino)\",\n\t\t\t\t\t\t\t\"Windows\" => \"windows ce; (iemobile|ppc|smartphone)\",\n\t\t\t\t\t\t\t\"Windowsphone\" => \"windows phone os\",\n\t\t\t\t\t\t\t\"Generic\" => \"(webos|android|kindle|mobile|mmp|midp|pocket|psp|symbian|smartphone|treo|up.browser|up.link|vodafone|wap|opera mini|opera mobi)\"\n\t\t\t\t\t\t);\n\t\t\t\t\t//If is from a wap connection\n\t\t\t\t\tif (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE']))\n\t\t\t\t\t\tself::$mobile = true;\n\t\t\t\t\telseif (strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') > 0 || strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') > 0) {\n\t\t\t\t\t\t//If accept a wap response is a mobile device\n\t\t\t\t\t\tself::$mobile = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Control all the devices to find it\n\t\t\t\t\t\tforeach ($devices as $device => $regexp) \n\t\t\t\t\t\t\tif(preg_match(\"/$regexp/i\", $_SERVER['HTTP_USER_AGENT'])) \n\t\t\t\t\t\t\t\tself::$mobile = true;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Set a cookie to not calculate again\n\t\t\t\tCOOKIE::set('ale_mobile',(self::$mobile)?'true':'false',30*24*60);\n\t\t\t}\n\t\t}\n\t\treturn self::$mobile;\n\t}", "static public function isMobile()\n {\n if (isset($_SERVER['HTTP_VIA'])\n || isset($_SERVER['HTTP_X_NOKIA_CONNECTION_MODE'])\n || isset($_SERVER['HTTP_X_UP_CALLING_LINE_ID'])\n // Check whether the browser/gateway says it accepts WML.\n || isset($_SERVER['HTTP_ACCEPT']) && strpos(strtoupper($_SERVER['HTTP_ACCEPT']), \"VND.WAP.WML\") > 0 )\n {\n return true;\n }\n \n $browser = isset($_SERVER['HTTP_USER_AGENT']) ? trim($_SERVER['HTTP_USER_AGENT']) : '';\n $clientkeywords = array(\n 'nokia', 'sony', 'ericsson', 'mot', 'samsung', 'htc', 'sgh', 'lg', 'sharp', 'sie-'\n , 'philips', 'panasonic', 'alcatel', 'lenovo', 'iphone', 'ipod', 'blackberry', 'meizu',\n 'android', 'netfront', 'symbian', 'ucweb', 'windowsce', 'palm', 'operamini',\n 'operamobi', 'opera mobi', 'openwave', 'nexusone', 'cldc', 'midp', 'wap', 'mobile'\n );\n if (preg_match(\"/(\" . implode('|', $clientkeywords) . \")/i\", $browser) && strpos($browser, 'ipad') === false) {\n return TRUE;\n } else {\n return FALSE;\n }\n }", "function is_iphone()\n {\n return dev::isIphone();\n }", "function scr_is($script)\n{\n return ROUTE[WEBSITE_REQUEST] == $script;\n}", "function accouk_is_dev() {\n if(get_site_url(null,null,'https') === \"https://www.andrewchart.co.uk\") {\n return false;\n } else { \n return true;\n }\n}", "function is_user_preference_short_url() {\n\treturn (isset($_COOKIE['doShort'])) ? true : false;\n}", "function ywsl_check_wpengine() {\n\t\t$is_wp_engine = defined( 'WPE_APIKEY' );\n\n\t\tif ( $is_wp_engine && ! defined( 'YWSL_FINAL_SLASH' ) ) {\n\t\t\tdefine( 'YWSL_FINAL_SLASH', true );\n\t\t}\n\n\t\treturn $is_wp_engine;\n\t}", "function ismobile(){\n\t$ua = strtolower($_SERVER['HTTP_USER_AGENT']);\n\n\t$uachar = \"/(nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|mobile)/i\";\n\t$smartuachar = \"/(ipad)/i\";\n\t\t\n\t//if(($ua == '' || preg_match($uachar, $ua))&& !strpos(strtolower($_SERVER['REQUEST_URI']),'wap'))\n\tif(!(preg_match($smartuachar, $ua)) && ($ua == '' || preg_match($uachar, $ua))&& !strpos(strtolower($_SERVER['REQUEST_URI']),'wap'))\n\t{\n\n\t if (!empty($Loaction))\n\t {\n\t return false;\n\t }else{\n\t \treturn true;\n\n\t }\n\n\t}\n\t}", "public static function isAppVisible($result) {\n\n $criteria = static::select('site_name', 'max_cvss',\n 'allow_mitm', 'allow_hide_icon',\n 'allow_weak_cryptographic_api', 'allow_vulnerable_leak',\n 'allow_malicious_leak', 'max_no_rules_broken',\n 'max_no_flow', 'allow_cert_pinning_mitm', 'allow_api_key', 'allow_password',\n 'allow_privilege_escalation', 'max_vulnerability_count', 'created_at')\n ->orderBy('created_at', 'desc')\n ->first();\n\n if ( (!$criteria->allow_mitm) && ($result->mitm) ) {\n return false;\n }\n\n if ( (!$criteria->allow_hide_icon) && ($result->hide_icon) ) {\n return false;\n }\n\n if ( (!$criteria->allow_weak_cryptographic_api) && ($result->weak_crypto) ) {\n return false;\n }\n\n if ( (!$criteria->allow_vulnerable_leak) && ($result->vulnerable_leak) ) {\n return false;\n }\n\n if ( (!$criteria->allow_malicious_leak) && ($result->malicious_leak) ) {\n return false;\n }\n\n if( ($criteria->max_no_rules_broken != -1) && ($criteria->max_no_rules_broken < $result->no_rules_broken) ) {\n return false;\n }\n\n if( ($criteria->max_no_flow != -1) && ($criteria->max_no_flow < $result->no_flow) ) {\n return false;\n }\n\n if ( (!$criteria->allow_cert_pinning_mitm) && ($result->cert_pinning_mitm) ) {\n return false;\n }\n\n if ( (!$criteria->allow_api_key) && ($result->api_key) ) {\n return false;\n }\n\n if ( (!$criteria->allow_password) && ($result->password) ) {\n return false;\n }\n\n if ( (!$criteria->allow_privilege_escalation) && ($result->privilege_escalation) ) {\n return false;\n }\n\n if( ($criteria->max_vulnerability_count != -1) && ($criteria->max_vulnerability_count < $result->vulnerability_count) ) {\n return false;\n }\n\n if( (bccomp($criteria->max_cvss, '10.0', 1) != 0) &&\n (bccomp($criteria->max_cvss, $result->mitm_cvss, 1) != 1) &&\n (bccomp($criteria->max_cvss, $result->cert_pinning_mitm_cvss, 1) != 1) &&\n (bccomp($criteria->max_cvss, $result->privilege_escalation_cvss, 1) != 1) ) {\n\n return false;\n }\n\n return true;\n }", "public function canManageRadioLandingPage();", "public function app() {\n $iPod = stripos($_SERVER['HTTP_USER_AGENT'],\"iPod\");\n $iPhone = stripos($_SERVER['HTTP_USER_AGENT'],\"iPhone\");\n $iPad = stripos($_SERVER['HTTP_USER_AGENT'],\"iPad\");\n $Android = stripos($_SERVER['HTTP_USER_AGENT'],\"Android\");\n $webOS = stripos($_SERVER['HTTP_USER_AGENT'],\"webOS\");\n\n //do something with this information\n if( $iPod || $iPhone ){\n return redirect()->to(\"https://apps.apple.com/us/app/mcledger/id1499626950?ls=1\");\n //browser reported as an iPhone/iPod touch -- do something here\n } else if($iPad){\n return redirect()->to(\"https://apps.apple.com/us/app/mcledger/id1499626950?ls=1\");\n //browser reported as an iPad -- do something here\n } else if($Android){\n return redirect()->to(\"https://play.google.com/store/apps/details?id=com.mcledger.app\");\n //browser reported as an Android device -- do something here\n } else if($webOS){\n return redirect()->to(\"https://portal.mcledger.co/register\");\n //browser reported as a webOS device -- do something here\n } else {\n return redirect()->to(\"https://portal.mcledger.co/register\");\n }\n\n return 'Sorry cannot detect your browser';\n }", "Public Function IsSelfHosted()\n\t{\n\t\tif(class_exists('Zend_Registry'))\n\t\t{\n\t\t\tif(Zend_Registry::get('Application/Mode') == 'SelfHosted')\n\t\t\t{\n\t\t\t\treturn '0';\n\t\t\t}\n\t\t}\n\t\treturn $this->isSelfHosted;\t\n\t}", "static public function isWebDocument() {\n return isset($_SERVER[\"HTTP_HOST\"]);\n }", "public function beforeRoute() {\n \n F3::set('v', Cfg::instance()->v);\n F3::set('app_dir', Cfg::instance()->app_dir);\n F3::set('master_url', Cfg::instance()->master_url);\n \n // logged in to the game?\n if (FB::instance()->me) {\n $c = new UsersController();\n F3::set('user', $c->getCurrentUser());\n } else {\n echo F3::render('templates/notloggedin.php');\n return FALSE;\n }\n \n // whitelisting\n if (!App::isWhitelisted(FB::instance()->user_id)) {\n F3::error(404);\n return FALSE;\n }\n \n // Sanitizing Fat-Free's REQUEST global also sanitizes PHP's $_REQUEST\n F3::set('REQUEST', F3::scrub($_REQUEST));\n\n }", "static function is_requested_page()\n {\n $retval = FALSE;\n // First, check the screen for the \"ngg\" property. This is how ngglegacy pages register themselves\n $screen = get_current_screen();\n if (property_exists($screen, 'ngg') && $screen->ngg) {\n $retval = $screen->id;\n } else {\n foreach (self::get_instance()->get_all() as $slug => $properties) {\n // Are we rendering a NGG added page?\n if (isset($properties['hook_suffix'])) {\n $hook_suffix = $properties['hook_suffix'];\n if (did_action(\"load-{$hook_suffix}\")) {\n $retval = $slug;\n break;\n }\n }\n }\n }\n return $retval;\n }", "function wp_is_mobile()\n {\n }", "function check_plugin_mainscreen_name()\r\r\n{\r\r\n $screen = get_current_screen();\r\r\n if (is_object($screen) && $screen->id == 'toplevel_page_oneclick-google-map') {\r\r\n return true;\r\r\n }\r\r\n else {\r\r\n return false;\r\r\n }\r\r\n}", "protected function detectSite() {\n\t\tif ( isset($this->forceSite) )\n\t\t\treturn $this->forceSite;\n\t\tif ( isset(Yii::app()->params['site']) )\n\t\t\treturn Yii::app()->params['site'];\n\t\t\n\t\t$rule = $this->createSiteUrlRule();\n\t\t$vars = $this->parseUrlVars(Yii::app()->request, $rule);\n\t\t\n\t\t$site = null;\n\t\tif ( $vars!==false && isset($vars['site']) )\n\t\t\t$site = $vars['site'];\n\t\telseif ( isset($this->defaultSite) )\n\t\t\t$site = $this->defaultSite;\n\t\t\n\t\treturn $site;\n\t}", "private static function checkAppIsExist ($app = null ) {\n\t\tif ( $app == null )\n\t\t\t$app = self::$url[0];\n\t\tif ( !isset($app))\n\t\t\treturn false ;\n\t\tif ( !empty($app)) {\n//\t\t\t$app = trim(strtolower($app));\n\t\t\t$app = trim($app);\n\t\t\t$appPatch = self::$appPatch.$app;\n\t\t\tif (is_dir($appPatch)) {\n//\t\t\t\tarray_shift(self::$url);\n\t\t\t\tself::$app = $app;\n\t\t\t\treturn true ;\n\t\t\t} else {\n\t\t\t\treturn false ;\n\t\t\t}\n\t\t}\n\t\treturn true ;\n\t}", "protected function isRequestMobile() {\n\t\t$mobileUserAgents = array(\n\t\t\t'iPhone', 'MIDP', 'AvantGo', 'BlackBerry', 'J2ME', 'Opera Mini', 'DoCoMo', 'NetFront',\n\t\t\t'Nokia', 'PalmOS', 'PalmSource', 'portalmmm', 'Plucker', 'ReqwirelessWeb', 'iPod', 'iPad',\n\t\t\t'SonyEricsson', 'Symbian', 'UP\\.Browser', 'Windows CE', 'Xiino', 'Android'\n\t\t);\n\t\t$currentUserAgent = $this->getRemote('userAgent');\n\t\tforeach($mobileUserAgents as $userAgent) {\n\t\t\tif(strpos($currentUserAgent, $userAgent) !== false) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function is_sp_widget_context() {\n\t\tif ( isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'],$this->id_base) !== false ) {\n\t\t\treturn true;\n\t\t} elseif ( isset($_REQUEST['_wp_http_referer']) && strpos($_REQUEST['_wp_http_referer'],$this->id_base) !== false ) {\n\t\t\treturn true;\n\t\t} elseif ( isset($_REQUEST['widget_id']) && strpos($_REQUEST['widget_id'],$this->id_base) !== false ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static function isWeb()\n {\n return (!self::isApi())?true: false;\n }", "function ltiLaunchCheck() {\n global $CFG, $PDO;\n if ( ! ltiIsRequest() ) return false;\n $session_id = ltiSetupSession($PDO);\n if ( $session_id === false ) return false;\n\n // Redirect back to ourselves...\n $url = curPageURL();\n $query = false;\n if ( isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) {\n $query = true;\n $url .= '?' . $_SERVER['QUERY_STRING'];\n }\n\n $location = sessionize($url);\n session_write_close(); // To avoid any race conditions...\n\n if ( headers_sent() ) {\n echo('<p><a href=\"'.$url.'\">Click to continue</a></p>');\n } else { \n header('Location: '.$location);\n }\n exit();\n}", "public static function isRunningOnCgiServerApi() {}", "static function hasAnAnswerPage ()\n {\n return true;\n }", "function is_test_request() {\n\t$proxied = defined( 'WPORG_PROXIED_REQUEST' ) && WPORG_PROXIED_REQUEST;\n\t$sandbox = defined( 'WPORG_SANDBOXED' ) && WPORG_SANDBOXED;\n\n\treturn $proxied && $sandbox;\n}", "public static function isWebCall() {\n\t\treturn !self::isShellCall();\n\t}", "private function _isResource() {\n $Info = explode('.', $_SERVER[\"REQUEST_URI\"]);\n $rVal = false;\n\n if ( count($Info) > 1 ) { $rVal = true; }\n\n // Return the Boolean Response\n return $rVal;\n }", "function check_access() {\n if (!get_site()) {\n return true; // no access check before site is fully set up\n }\n $context = empty($this->context) ? get_context_instance(CONTEXT_SYSTEM) : $this->context;\n foreach($this->req_capability as $cap) {\n if (is_valid_capability($cap) and has_capability($cap, $context)) {\n return true;\n }\n }\n return false;\n }", "function detectMobileDevice()\n{\n\treturn false;\n}", "function is_my_reading_library_page() {\r\n global $wp;\r\n $wp->parse_request();\r\n\r\n return (\r\n get_query_var('my_reading_library_library') ||\r\n get_query_var('my_reading_library_id') ||\r\n get_query_var('my_reading_library_page') || \r\n get_query_var('my_reading_library_title') ||\r\n get_query_var('my_reading_library_author') ||\r\n\t\tget_query_var('my_reading_library_reader')\r\n\t); \r\n}", "function is_options_save_page()\n{\n $self = $_SERVER['PHP_SELF'];\n $request = $_SERVER['REQUEST_URI'];\n\n return stripos($self, 'options.php') !== false || stripos($request, 'options.php') !== false;\n}", "public function isMobileApiCall() {\n\t\t\t\t\t\theader('Access-Control-Allow-Origin:*');\n\t\theader('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');\n\t\theader('Access-Control-Max-Age: 286400');\n\t\theader('Access-Control-Allow-Credentials: true');\n\t\theader('Access-Control-Allow-Headers: xocmerchantid,XOCMERCHANTID,XOCSESSION,xocsession,purpletreemultivendor,Purpletreemultivendor,PURPLETREEMULTIVENDOR');\n\t\tif(NULL !== apache_request_headers()){\n\t\t\tforeach(apache_request_headers() as $key =>$value) {\n\t\t\t\tif($key == 'purpletreemultivendor' || $key == 'Purpletreemultivendor' || $key == 'PURPLETREEMULTIVENDOR') {\n\t\t\t$key = strtolower($key);\n\t\t\t\t\tif ($this->config->get('module_purpletree_multivendor_status')) {\n\t\t\t\t\t\t$query = $this->db->query(\"SELECT * FROM `\" . DB_PREFIX . \"api` WHERE `username` = '\" . $key . \"' AND `key` ='\" . $value . \"'\");\n\t\t\t\t\t\tif($query->num_rows) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static function isMultiSiteEnabled()\n {\n return sfConfig::get('app_rt_enable_multi_site', false);\n }", "private function _set_mobile()\n {\n if (is_array($this->mobiles) AND count($this->mobiles) > 0)\n {\n foreach ($this->mobiles as $key => $val)\n {\n if (FALSE !== (strpos(strtolower($this->agent), $key)))\n {\n $this->is_desktop = FALSE;\n $this->is_mobile = TRUE;\n $this->mobile = $val;\n $this->_set_mobile_apps();\n return TRUE;\n }\n }\n }\n return FALSE;\n }", "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 hasWebsite() {\n return $this->_has(9);\n }", "public function hasAppid()\n {\n return $this->appid !== null;\n }", "public function hasAppid()\n {\n return $this->appid !== null;\n }", "public function hasAppid()\n {\n return $this->appid !== null;\n }", "protected function isSuhosinLoadedAndActive() {}", "function fusion_is_builder_frame() {\n\tif ( class_exists( 'Fusion_App' ) ) {\n\t\t$fusion_app = Fusion_App::get_instance();\n\t\treturn $fusion_app->get_builder_status();\n\t}\n\treturn false;\n}", "function wp_browser_detect(){\n\t//Browsers\n\tglobal $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;\n\n\t//$browser = get_browser(null, true); //@TODO \"Nebula\" 0: Find a server this works on and then wrap in if $browser, then echo the version number too\n\t//@TODO \"Nebula\" 0: Also look into the function wp_check_browser_version().\n\n if ( $is_lynx ) {\n \treturn 'Lynx';\n } elseif ( $is_gecko ) {\n \treturn 'Gecko';\n } elseif ( $is_opera ) {\n \treturn 'Opera';\n } elseif ( $is_NS4 ) {\n \treturn 'NS4';\n } elseif ( $is_safari ) {\n \treturn 'Safari';\n } elseif ( $is_chrome ) {\n \treturn 'Chrome';\n } elseif ( $is_IE ) {\n \treturn 'IE';\n } else {\n \treturn 'Unknown Browser';\n }\n}", "public function getApp();", "private static function verifyRequest()\n {\n if(isset($_SERVER['HTTP_USER_AGENT']) == false)\n {\n InvalidUserAgentResponse::executeResponse();\n exit();\n }\n\n if(strlen($_SERVER['HTTP_USER_AGENT']) == 0)\n {\n InvalidUserAgentResponse::executeResponse();\n exit();\n }\n\n if(strlen($_SERVER['HTTP_USER_AGENT']) > 624)\n {\n InvalidUserAgentResponse::executeResponse();\n exit();\n }\n\n $UnsupportedRequestMethod = true;\n\n if(strtoupper($_SERVER['REQUEST_METHOD']) == 'GET')\n {\n $UnsupportedRequestMethod = false;\n }\n\n if(strtoupper($_SERVER['REQUEST_METHOD']) == 'POST')\n {\n $UnsupportedRequestMethod = false;\n }\n\n if($UnsupportedRequestMethod)\n {\n UnsupportedVersion::executeResponse();\n exit();\n }\n }", "function fusion_is_preview_frame() {\n\tif ( class_exists( 'Fusion_App' ) ) {\n\t\t$fusion_app = Fusion_App::get_instance();\n\t\treturn $fusion_app->get_preview_status();\n\t}\n\treturn false;\n}", "private function isRoot()\n {\n if (isset($_SERVER['SERVER_SOFTWARE']) && preg_match('/(Development Server)/i', $_SERVER['SERVER_SOFTWARE']) && ($_SERVER['REQUEST_URI'] === '/'))\n {\n return true;\n }\n else if(($_SERVER['REQUEST_URI'] === '/') || count(slashExploder($_SERVER['REQUEST_URI'])) === 1)\n {\n return true;\n }\n\n return false;\n }", "function rocket_bypass() {\r\n\tglobal $wp;\r\n\r\n\tstatic $bypass = null;\r\n\r\n\tif ( rocket_get_constant( 'WP_ROCKET_IS_TESTING', false ) ) {\r\n\t\t$bypass = null;\r\n\t}\r\n\r\n\tif ( ! is_null( $bypass ) ) {\r\n\t\treturn $bypass;\r\n\t}\r\n\r\n\t$url = wp_parse_url( add_query_arg( $wp->query_vars, home_url( $wp->request ) ) );\r\n\t$bypass = isset( $url['query'] ) && false !== strpos( $url['query'], 'nowprocket' );\r\n\r\n\treturn $bypass;\r\n}", "public function mobile($ipad=''){\n\t \t\n\t\t($ipad!=''?$ipad='ipad|':$ipad=NULL);\n\t\t\n\t\t$regex_match=\"/(\".$ipad.\"nokia|iphone|android|motorola|^mot\\-|softbank|foma|docomo|kddi|up\\.browser|up\\.link|\";\n\t\t$regex_match.=\"htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|\";\n\t\t$regex_match.=\"blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam\\-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|\";\t\n\t\t$regex_match.=\"symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte\\-|longcos|pantech|gionee|^sie\\-|portalmmm|\";\n\t\t$regex_match.=\"jig\\s browser|hiptop|^ucweb|^benq|haier|^lct|opera\\s*mobi|opera\\*mini|320x320|240x320|176x220\";\n\t\t$regex_match.=\")/i\";\t\t\n\t\treturn isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE']) or preg_match($regex_match, strtolower($_SERVER['HTTP_USER_AGENT']));\n\t}", "public function hasAppType()\n {\n return $this->app_type !== null;\n }", "public static function is_current_url_a_system_page(){\n $current_page_url = SwpmMiscUtils::get_current_page_url();\n \n //Check if the current page is the membership renewal page.\n $renewal_url = SwpmSettings::get_instance()->get_value('renewal-page-url'); \n if (empty($renewal_url)) {return false;}\n if (SwpmMiscUtils::compare_url($renewal_url, $current_page_url)) {return true;}\n\n //Check if the current page is the membership logn page.\n $login_page_url = SwpmSettings::get_instance()->get_value('login-page-url');\n if (empty($login_page_url)) {return false;}\n if (SwpmMiscUtils::compare_url($login_page_url, $current_page_url)) {return true;}\n\n //Check if the current page is the membership join page.\n $registration_page_url = SwpmSettings::get_instance()->get_value('registration-page-url');\n if (empty($registration_page_url)) {return false;}\n if (SwpmMiscUtils::compare_url($registration_page_url, $current_page_url)) {return true;}\n \n return false;\n }", "private function checkSameSiteNoneCompatible()\n {\n $compatible = false;\n\n $this->agent = new Agent();\n\n try {\n $browser = $this->getBrowserDetails();\n $platform = $this->getPlatformDetails();\n\n if ($this->agent->is('Chrome') && $browser['major'] >= 67) {\n $compatible = true;\n }\n\n if ($this->agent->is('iOS') && $platform['major'] > 12) {\n $compatible = true;\n }\n\n if ($this->agent->is('OS X') &&\n ($this->agent->is('Safari') && !$this->agent->is('iOS')) &&\n $platform['float'] > 10.14\n ) {\n $compatible = true;\n }\n\n if ($this->agent->is('UCBrowser') &&\n $browser['float'] > 12.13\n ) {\n $compatible = true;\n }\n\n return $compatible;\n } catch (\\Exception $e) {\n return false;\n }\n }", "public function isViddler($url)\n {\n return strpos($url, 'viddler.com/') !== FALSE;\n\t}", "function robots_access(){\r\n if(is_production() && get_option('blog_public') == '0') update_option('blog_public', '1');\r\n if(!is_production() && get_option('blog_public') == '1') update_option('blog_public', '0');\r\n}", "private function _isMobile(){\n\t\t/* getting user agent reference */\n\t\t$this->load->library('user_agent');\n\t\t\n\t\t/* return the requested device type */\n\t\treturn $this->agent->is_mobile();\n\t}", "function _detectURI() {\n\t\t$aURL = array();\n\n\t\t// Try to get the request URL\n\t\tif (!empty($_SERVER['REQUEST_URI'])) {\n\t\t\t$aURL = parse_url($_SERVER['REQUEST_URI']);\n\t\t}\n\n\t\t// Fill in the empty values\n\t\tif (empty($aURL['scheme'])) {\n\t\t\tif (!empty($_SERVER['HTTP_SCHEME'])) {\n\t\t\t\t$aURL['scheme'] = $_SERVER['HTTP_SCHEME'];\n\t\t\t} else {\n\t\t\t\t$aURL['scheme'] = (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') ? 'https' : 'http';\n\t\t\t}\n\t\t}\n\n\t\tif (empty($aURL['host'])) {\n\t\t\tif (!empty($_SERVER['HTTP_HOST'])) {\n\t\t\t\tif (strpos($_SERVER['HTTP_HOST'], ':') > 0) {\n\t\t\t\t\tlist($aURL['host'], $aURL['port']) = explode(':', $_SERVER['HTTP_HOST']);\n\t\t\t\t} else {\n\t\t\t\t\t$aURL['host'] = $_SERVER['HTTP_HOST'];\n\t\t\t\t}\n\t\t\t} else if (!empty($_SERVER['SERVER_NAME'])) {\n\t\t\t\t$aURL['host'] = $_SERVER['SERVER_NAME'];\n\t\t\t} else {\n\t\t\t\tprint \"xajax Error: xajax failed to automatically identify your Request URI.\";\n\t\t\t\tprint \"Please set the Request URI explicitly when you instantiate the xajax object.\";\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\n\t\tif (empty($aURL['port']) && !empty($_SERVER['SERVER_PORT'])) {\n\t\t\t$aURL['port'] = $_SERVER['SERVER_PORT'];\n\t\t}\n\n\t\tif (empty($aURL['path'])) {\n\t\t\tif (!empty($_SERVER['PATH_INFO'])) {\n\t\t\t\t$sPath = parse_url($_SERVER['PATH_INFO']);\n\t\t\t} else {\n\t\t\t\t$sPath = parse_url($_SERVER['PHP_SELF']);\n\t\t\t}\n\t\t\t$aURL['path'] = $sPath['path'];\n\t\t\tunset($sPath);\n\t\t}\n\n\t\tif (!empty($aURL['query'])) {\n\t\t\t$aURL['query'] = '?'.$aURL['query'];\n\t\t}\n\n\t\t// Build the URL: Start with scheme, user and pass\n\t\t$sURL = $aURL['scheme'].'://';\n\t\tif (!empty($aURL['user'])) {\n\t\t\t$sURL.= $aURL['user'];\n\t\t\tif (!empty($aURL['pass'])) {\n\t\t\t\t$sURL.= ':'.$aURL['pass'];\n\t\t\t}\n\t\t\t$sURL.= '@';\n\t\t}\n\n\t\t// Add the host\n\t\t$sURL.= $aURL['host'];\n\n\t\t// Add the port if needed\n\t\tif (!empty($aURL['port']) && (($aURL['scheme'] == 'http' && $aURL['port'] != 80) || ($aURL['scheme'] == 'https' && $aURL['port'] != 443))) {\n\t\t\t$sURL.= ':'.$aURL['port'];\n\t\t}\n\n\t\t// Add the path and the query string\n\t\t$sURL.= $aURL['path'].@$aURL['query'];\n\n\t\t// Clean up\n\t\tunset($aURL);\n\t\treturn $sURL;\n\t}", "public function wpseo_detected () {\n\t\treturn defined('WPSEO_VERSION') ? true: false;\n\t}", "function intercept_request(){\n\t\t\tglobal $wp_query;\n\t\t\t$rqt = isset($wp_query->query_vars['pagename']) ? $wp_query->query_vars['pagename'] : '';\n\n\t\t\tif ($rqt === 'splashgate') {\n\t\t\t\t$splashgate_options = array();\n\t\t\t\t$splashgate_options = get_option('splashgate_options');\n\t\t\t\t\n\t\t\t\tif (!empty($splashgate_options['splashpage_id'])) {\n\t\t\t\t\t$splash_link = get_permalink( $splashgate_options['splashpage_id'] );\n\t\t\t\t\tif ($splash_link) {\n\t\t\t\t\t\twp_redirect( $splash_link );\n\t\t\t\t\t\texit;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t}", "function pt_landing_page_open() {\n\npt_check_oto();\n\nglobal $post, $site_options, $launch_options;\n\nforeach ( $site_options as $value ) {\n\t$$value['id'] = pt_isset($value['value']); \n}\n\n// Product Launch...\n$launch = new PtLaunch($post->ID, $launch_options);\n$launch->buildLaunchPage();\n\n$evergreen = $launch->evergreenCookie();\n\n$lp = get_post_meta($post->ID, 'pt_landing_meta_box', true);\n$width = pt_isset($lp['lp-page-width']);\n$right_column = pt_isset($lp['lp-page-right-width']);\n$padding = pt_isset($lp['lp-page-padding']);\n$pagebg = pt_isset($lp['lp-page-bg']);\n$header = pt_isset($lp['lp-header-image']);\n$header_height = pt_isset($lp['lp-header-height']);\n$header_pad_top = floor( $header_height / 4 );\n$commsys = pt_isset($lp['lp-comments-type']);\n$fbappid = pt_isset($lp['lp-comments-fb-appid']);\n$fbuid = pt_isset($lp['lp-comments-fb-notify']);\n$header_remove = pt_isset($lp['lp-header-remove']);\n$template = pt_isset($lp['lp-page-custom']);\n$font_face = pt_isset($lp['lp-content-font']);\n$font_size = pt_isset($lp['lp-content-size']);\n$line_height = pt_isset($lp['lp-content-line-height']);\n$head_font = pt_isset($lp['lp-content-heading-font']);\n$head_opt_left = pt_isset($lp['lp-page-width']) - 280;\n$footer_font = pt_isset($lp['lp-page-footer-font']);\n$footer_font_size = pt_isset($lp['lp-page-footer-font-size']);\n\npt_minisite_popup_cookies();\n$seo = new PtSeo;\n\n$cssoutput = '';\n\n$cssoutput .= 'body{ ';\n$cssoutput .= 'margin:0;padding:0; ';\n\nif ( $template == 'custom' ) {\n\t$background_image = ( $lp['lp-custom-background-image'] != '' ) ? ' url(' . $lp['lp-custom-background-image'] . ') ' . $lp['lp-custom-background-repeat'] . ' ' . $lp['lp-custom-background-attach'] . ' ' . $lp['lp-custom-background-pos'] : '';\n\t$cssoutput .= 'background: ' . $lp['lp-custom-background-color'] . $background_image . '; ';\n}\n\n$cssoutput .= '}' . \"\\n\";\n\n$cssoutput .= '#before-header { width:' . $width . 'px; }' . \"\\n\";\n$cssoutput .= '#header { width:' . $width . 'px; }' . \"\\n\";\n$cssoutput .= '#wrapper { width:' . $width . 'px; }' . \"\\n\";\n$cssoutput .= '#lp-header-image{';\nswitch ( $header['type'] ) {\n\t\n\tcase 'custom-hbackground':\n\t\t$cssoutput .= 'background:url(' . $header['upload'] . ') no-repeat ' . $header['align'] . ';';\n\tbreak;\n}\n\n$cssoutput .= ' }' . \"\\n\";\n\n$cssoutput .= '#header-bg{ height:' . $header_height . 'px; }' . \"\\n\";\n$cssoutput .= '#header{ height:' . $header_height . 'px; }' . \"\\n\";\n$cssoutput .= '#lp-header-image{ height:' . $header_height . 'px; }' . \"\\n\";\n$cssoutput .= '#header #logo{ padding-top:' . $header_pad_top . 'px; }' . \"\\n\";\n$cssoutput .= '#header .header_optin{ position:absolute; top:0; left:' . $head_opt_left . 'px; }' . \"\\n\";\n$cssoutput .= '#footer { width:' . $width . 'px; }' . \"\\n\";\n\n$left_column = (($width - $right_column) - ( $padding * 2 )) - 20;\n\n$cssoutput .= '.sales-left { width:' . $left_column . 'px;float:left; display:inline; }' . \"\\n\";\n$cssoutput .= '.sales-right { width:' . $right_column . 'px;float:right; display:inline; }' . \"\\n\";\n\n$cssoutput .= '#copy { padding-left:' . $padding . 'px; padding-right:' . $padding . 'px; font-family: ' . stripslashes($font_face) . '; font-size: ' . $font_size . 'px; }' . \"\\n\";\n$cssoutput .= '#copy h1, h2, h3, h4, h5, h6 { font-family:' . stripslashes($head_font) . '; }' . \"\\n\";\n$cssoutput .= '#copy p, #copy ul li, #copy ol li { line-height: ' . $line_height . 'px; }' . \"\\n\";\n$cssoutput .= '#copy p.jboxcommhead { line-height:1; }' . \"\\n\";\n$cssoutput .= '#copy ul.greenarrow li, #copy ul.redarrow li, #copy ul.bluearrow li, #copy ul.greencheck li, #copy ul.redcheck li, #copy ul.bluecheck li, #copy ul.redbullet li { line-height: ' . $line_height . 'px; }' . \"\\n\";\n\n$cssoutput .= '#footer{ font-family: ' . $footer_font . '; font-size: ' . $footer_font_size . 'px; height:35px; line-height:35px; padding:0; text-align:center; }' . \"\\n\";\n$cssoutput .= '#footer a, #footer a:hover { font-family: ' . $footer_font . '; font-size: ' . $footer_font_size . 'px; }' . \"\\n\";\n$cssoutput .= '.footinfo{ position:relative; height:25px; line-height:25px; width:190px; margin:0 auto; padding:0; }' . \"\\n\";\n\n$cssoutput .= '#lp-top-menu { font-size:14px; color: #555555; }' . \"\\n\";\n$cssoutput .= '#lp-top-menu a { text-decoration:none; font-weight:500; font-size:14px; padding:10px 20px; }' . \"\\n\";\n$cssoutput .= '#lp-top-menu a:hover { text-decoration:none; opacity:0.8; }' . \"\\n\";\n$cssoutput .= 'h3#comments, #respond h3 { text-transform:uppercase; font-size:16px; font-family:' . stripslashes($font_face) . '; }' . \"\\n\";\n\n// css styling for custom design start...\nif ( $template == 'custom' ) {\n\t$content_image_bg = ( $lp['lp-custom-content-background-image'] != '' ) ? ' url(' . $lp['lp-custom-content-background-image'] . ') ' . $lp['lp-custom-content-background-repeat'] : '';\n\t$cssoutput .= '#saleswrapper { background:' . $lp['lp-custom-content-background-color'] . $content_image_bg . '; }' . \"\\n\";\n\n\tif ( $lp['lp-custom-content-border'] != '' ) {\n\t\t$cssoutput .= '#saleswrapper { border:' . $lp['lp-custom-content-border-width'] . 'px ' . $lp['lp-custom-content-border'] . ' ' . $lp['lp-custom-content-border-color'] . '; }' . \"\\n\";\n\t\tif ( $lp['lp-custom-content-border-radius'] > 0 ) {\n\t\t\t$cssoutput .= '#saleswrapper { border-radius:' . $lp['lp-custom-content-border-radius'] . 'px;-moz-border-radius:' . $lp['lp-custom-content-border-radius'] . 'px;-webkit-border-radius:' . $lp['lp-custom-content-border-radius'] . 'px; }' . \"\\n\";\n\t\t}\n\t}\n\n\tif ( $lp['lp-custom-footer-text-remove'] == 'true' ) {\n\t\t$cssoutput .= '.footinfo{ display:none; }' . \"\\n\";\n\t\t$cssoutput .= '#footer{ text-indent:-9999px; }' . \"\\n\";\n\t}\n\n\tif ( $lp['lp-custom-footer-background-transparent'] != 'true' ) {\n\t\t$footer_image_bg = ( pt_isset($lp['lp-custom-footer-background-image']) != '' ) ? ' url(' . pt_isset($lp['lp-custom-footer-background-image']) . ') ' . pt_isset($lp['lp-custom-footer-background-repeat']) : '';\n\t\t$cssoutput .= '#footer { height:' . pt_isset($lp['lp-custom-footer-height']) . 'px; background:' . pt_isset($lp['lp-custom-footer-background-color']) . $footer_image_bg . ' !important; }' . \"\\n\";\n\t}\n}\n\npt_minisite_popup_cookies();\n$xmlns = ( $commsys == 'fbcomm' || $commsys == 'allcomm') ? 'xmlns:fb=\"http://www.facebook.com/2008/fbml\" xmlns:og=\"http://opengraphprotocol.org/schema/\"' : '';\n$ogdesc = pt_excerpt($post->post_content, 160, false );\n$remove = array(\"\\n\", \"\\r\\n\", \"\\r\");\n?>\n\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" <?php language_attributes(); echo $xmlns; ?>>\n\n<head profile=\"http://gmpg.org/xfn/11\">\n<meta http-equiv=\"Content-Type\" content=\"<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>\" />\n\n<title><?php pt_seo_title(); ?></title>\n\n<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>\n\n<link rel=\"stylesheet\" type=\"text/css\" href=\"<?php bloginfo('stylesheet_url'); ?>\" media=\"screen\" />\n<link rel=\"pingback\" href=\"<?php bloginfo('pingback_url'); ?>\" />\n\n<?php wp_head(); ?>\n\n<?php if ( $commsys == 'fbcomm' || $commsys == 'allcomm' ) { ?>\n<meta property='fb:app_id' content='<?php echo $fbappid;?>' />\n<meta property=\"og:title\" content=\"<?php echo trim(wptexturize($post->post_title));?>\" />\n<meta property=\"og:type\" content=\"article\" />\n<meta property=\"og:url\" content=\"<?php echo get_permalink($post->ID); ?>\" />\n<meta property=\"og:site_name\" content=\"<?php bloginfo('name'); ?>\" />\n<meta property=\"og:image\" content=\"\" />\n<meta property=\"fb:app_id\" content=\"<?php echo $fbappid;?>\" />\n<meta property=\"og:description\" content=\"<?php echo trim(wptexturize(str_replace($remove, '', $ogdesc))); ?>\" />\n<?php } ?>\n\t\t\n<link rel=\"stylesheet\" href=\"<?php bloginfo('template_url'); ?>/lib/css/minisites.css\" type=\"text/css\" media=\"screen\" />\n\n<?php \n// Load Custom Minisite Skin\n$custom = explode(\"-\", $lp['lp-page-custom']);\n$skin = pt_isset($custom[0]);\n$scheme = pt_isset($custom[1]) . '.css';\n\nif ( $template == 'custom' ) {\necho '<link rel=\"stylesheet\" href=\"' . get_bloginfo('template_url') . '/lib/skins/minisite/custom/custom.css\" type=\"text/css\" media=\"screen\" />';\n} else {\necho '<link rel=\"stylesheet\" href=\"' . get_bloginfo('template_url') . '/lib/skins/minisite/' . $skin . '/' . $scheme . '\" type=\"text/css\" media=\"screen\" />';\n}\n?>\n\n<script type=\"text/javascript\">\nfunction SetCookie(cookieName, cookieValue, nDays)\n{\n \tvar today = new Date();\n \tvar expire = new Date();\n \tif (nDays==null || nDays==0) nDays=1;\n \texpire.setTime(today.getTime() + 3600000*24*nDays);\n \tdocument.cookie=cookieName + \"=\" + escape(cookieValue) + \"; expires=\" + expire.toGMTString() + \"; path=<?php echo COOKIEPATH; ?>\";\n}\n</script>\n\n<?php if ( pt_isset($lp['lp-page-upsell']) == 'yes' && !isset($_COOKIE['oto-' . $post->ID]) ) { ?>\n<script type=\"text/javascript\">\nSetCookie('oto-<?php echo $post->ID; ?>', '<?php echo md5($post->ID); ?>', 365);\n</script>\n<?php } ?>\n<?php echo $evergreen; ?>\n<style type=\"text/css\">\n<?php echo $cssoutput; ?>\n</style>\n<?php if ( $pt_enable_popup == 'false' && pt_isset($lp['lp-page-popup']) == 'true' ) { ?>\n<script type=\"text/javascript\" src=\"<?php echo PT_REL_SCRIPTS ?>/popup.js\"></script>\n<?php } ?>\n\n<?php if (pt_isset($lp['lp-page-exit'], false) == 'true'){\n\tadd_action('wp_footer', 'pt_onuserexit');\t\n}\n?>\n\n<script type=\"text/javascript\" src=\"<?php echo PT_REL_SCRIPTS ?>/cufon/cufon.js\"></script>\n<script type=\"text/javascript\" src=\"<?php echo PT_REL_SCRIPTS ?>/cufon/Hand_Of_Sean.font.js\"></script>\n<script type=\"text/javascript\" src=\"<?php echo PT_REL_SCRIPTS ?>/cufon/Delicious.font.js\"></script>\n\n<!--[if gte IE 9]>\n\t<script type=\"text/javascript\">\n\t\tCufon.set('engine', 'canvas');\n\t</script>\n<![endif]-->\n\n<?php pt_minisite_cufon(); ?>\n\n<script type=\"text/javascript\">\nCufon.replace(\".lp-comm-txt\", {\n\tfontFamily: \"Hand Of Sean\"\n});\nCufon.replace(\"#social-cta\", {\n\tfontFamily: \"Delicious\"\n});\n</script>\n\n\n<script type=\"text/javascript\">\njQuery(document).ready(function(){\n\tjQuery('#nav4 > *:first-child').css('border', 'none');\n});\n</script>\n<?php\nif ( $pt_custom_favicon ) {\n\techo '<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"' . $pt_custom_favicon . '\" />';\n}\n?>\n<link href='http://fonts.googleapis.com/css?family=Ubuntu:400,500,700|Exo:300,400,500,600,700,800|Ubuntu+Condensed|Open+Sans:400,300,600,700,800|Roboto:400,300,500,700,900|Handlee' rel='stylesheet' type='text/css'>\n</head>\n\n<body>\n<?php\n}", "public function is_application_id_in_config() {\n\t\treturn defined( 'ALGOLIA_APPLICATION_ID' );\n\t}", "function sloodle_autoreg_enabled_site()\n {\n return (bool)sloodle_get_config('sloodle_allow_autoreg');\n }", "public function isLaunchable() {\n // on the application launch list is confusing.\n return false;\n }", "public function is_site_enabled( $app_id ) {\n\n\t\tif ( 'off' === $this->site_status( $app_id ) ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\n\t}", "function fon_set_dev_url( ) {\n $fon_dev_url = get_option('fon_dev_url');\n $url_extension = pathinfo( $_SERVER['HTTP_HOST'], PATHINFO_EXTENSION );\n if ( filter_var($fon_dev_url, FILTER_VALIDATE_URL) && ( $url_extension == \"dev\" || $url_extension == \"local\" ) ) {\n return $fon_dev_url;\n } else {\n return false; // act as normal; will pull main site info from db\n }\n}", "function is_live() {\n\treturn preg_match( DEVELOPMENT_HOSTS_EXPRESSION, $_SERVER['SERVER_NAME']) ? false : true;\n}", "public function checkAppOnPage($appId,$pageId) {\n try {\n $result = $this->facebook->api('/' . $pageId . '/tabs/app_' . $appId, 'GET');\n // print_r($result);\n if(isset($result['data'][0]['id'])) {\n return true;\n } else {\n return false;\n }\n } catch (Exception $e) {\n // echo \"<pre>\";\n // print_r($e);\n }\n }", "public static function isWeb()\n {\n return !self::isCLI();\n }", "public function verifyApiCaller() : bool\n {\n $verified = false;\n\n // check for NOAUTH and no-auth-pages configuration for current page\n // these two settings must be present for the endpoint to be visible outside of REDCap\n if (isset($_GET['NOAUTH']) && in_array($_GET['page'], parent::getConfig()[\"no-auth-pages\"])) \n {\n // MODIFY THIS CHECK for the security needs of your system.\n // This hardcoded token should be changed and pulled from a secure location,\n // if using with a third-party service.\n $rctoken = $_REQUEST['rctoken'];\n if ($rctoken === 'ca5d63d58b507615c328da941270ddf0')//IMPORTANT: modify token and pull from a secure location\n {\n $verified = true;\n }\n }\n // if endpoint is not externally accessible, then this endpoint user has been authenticated by REDCap\n else\n {\n $verified = true;\n }\n\n\n return $verified;\n }", "function is_robot(){\n\n\t\treturn (new user_agent)->is_robot();\n\n\t}", "function is_mobile(){\n\n\t\treturn (new user_agent)->is_mobile();\n\n\t}", "private function checkrequest()\n {\n // This method checks if there is user input, and returns the request_method if evaluated to be true\n if ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n $this->request = \"post\";\n return true;\n } elseif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n $this->request = \"get\";\n return true;\n } else {\n $this->request = false;\n }\n }", "public function AppLocalOrServer()\n {\n if (preg_match('/localhost/i', base_url())) return \"local\";\n else return \"server\";\n }", "function checkOEmbedUrl($url) {\n\n $parsedUrl = parse_url($url);\n $domain = str_replace('www.','',$parsedUrl['host']);\n\n switch ($domain) {\n\n case 'youtube.com':\n return true;\n break;\n\n case 'm.youtube.com':\n return true;\n break;\n\n case 'flickr.com':\n return true;\n break;\n\n case 'm.flickr.com':\n return true;\n break;\n\n /*case 'viddler.com':\n return true;\n break;*/\n\n case 'vimeo.com':\n return true;\n break;\n\n case 'dribbble.com':\n return true;\n break;\n\n case 'drbl.in':\n return true;\n break;\n\n case 'instagr.am':\n return true;\n break;\n\n case 'instagram.com':\n return true;\n break;\n\n case 'amazon.com':\n return true;\n break;\n\n case 'amzn.com':\n return true;\n break;\n\n case 'twitpic.com':\n return true;\n break;\n\n case 'speakerdeck.com':\n return true;\n break;\n\n case 'slideshare.net':\n return true;\n break;\n\n case 'skitch.com':\n return true;\n break;\n\n case 'img.skitch.com':\n return true;\n break;\n\n case 'gist.github.com':\n return true;\n break;\n\n case 'huffduffer.com':\n return true;\n break;\n\n case 'soundcloud.com':\n return true;\n break;\n\n case 'ted.com':\n return true;\n break;\n\n /*case 'wikipedia.org':\n return true;\n break;\n\n case 'en.wikipedia.org':\n return true;\n break;*/\n\n default:\n return false;\n break;\n\n }\nreturn false;\n}", "public function getStatus(){\r\n if($this->scopeConfigInterface->getValue(self::XML_PATH_ENABLED,ScopeInterface::SCOPE_WEBSITE) ==1){\r\n return true;\r\n }\r\n return false;\r\n }", "function launchpad_set_page_defines() {\n\tglobal $site_options;\n\t\n\t/** Google Analytics ID. */\n\tdefine('GA_ID', isset($site_options['google_analytics_id']) ? $site_options['google_analytics_id'] : '');\n\n\t/** Whether to use cache. If things get weird, turn it off by setting the value to 0. */\n\tdefine('USE_CACHE', isset($site_options['cache_timeout']) ? (int) $site_options['cache_timeout'] : 0);\n}", "static function is_browser()\n\t{\n\t\tif(!isset(self::$_libs['user_agent'])){\n\t\t\tself::loadLibrary('SHIN_User_agent', TRUE);\n\t\t}\n\t\treturn self::$_libs['user_agent']->is_browser();\n\t}", "public function isSiteSpecific()\n {\n return $this->siteSpecific;\n }", "public function canShowScript() {\n\t\t$pluginUpgrader = new Utils\\PluginUpgraderSilentAjax();\n\t\t$miLite = $pluginUpgrader->pluginSlugs['miLite'];\n\t\t$miPro = $pluginUpgrader->pluginSlugs['miPro'];\n\t\t$emLite = $pluginUpgrader->pluginSlugs['emLite'];\n\t\t$emPro = $pluginUpgrader->pluginSlugs['emPro'];\n\t\t$activePlugins = get_option( 'active_plugins' );\n\n\t\tif (\n\t\t\tin_array( $miLite, $activePlugins, true ) ||\n\t\t\tin_array( $miPro, $activePlugins, true ) ||\n\t\t\tin_array( $emLite, $activePlugins, true ) ||\n\t\t\tin_array( $emPro, $activePlugins, true )\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$googleAnalyticsId = aioseo()->options->deprecated->webmasterTools->googleAnalytics->id;\n\t\t$gtmContainerId = aioseo()->options->deprecated->webmasterTools->googleAnalytics->gtmContainerId;\n\n\t\tif (\n\t\t\tin_array( 'googleAnalytics', aioseo()->internalOptions->internal->deprecatedOptions, true ) &&\n\t\t\t! $googleAnalyticsId &&\n\t\t\t! $gtmContainerId\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ! $this->userIsExcluded();\n\t}", "static function isAuthenticated($app) {\n $found = AuthControllerNative::isAuthenticated($app->request->post());\n if($found['authenticated']) {\n return $app->render(200, $found);\n } \n \n $fb = AuthControllerFacebook::isAuthenticated($app->request->post());\n if($fb) {\n return $app->render(222, $found);\n } else {\n return $app->render(400, $found);\n }\n }" ]
[ "0.58524644", "0.5750067", "0.5718198", "0.5651891", "0.5651299", "0.56134164", "0.56000686", "0.55439585", "0.5540365", "0.5510022", "0.55087036", "0.5506605", "0.5493972", "0.548934", "0.54890025", "0.5464478", "0.5461525", "0.54600227", "0.5429646", "0.5428719", "0.54189724", "0.5415055", "0.5413829", "0.5413622", "0.5409089", "0.5389539", "0.5382743", "0.5313485", "0.5305328", "0.5276322", "0.5275229", "0.52569884", "0.52553153", "0.5244309", "0.52348495", "0.52346754", "0.5219815", "0.52022284", "0.51902187", "0.5184564", "0.51798147", "0.5170679", "0.51583195", "0.5155361", "0.5154015", "0.51526654", "0.5143975", "0.5135029", "0.5127628", "0.5127344", "0.5124884", "0.5114301", "0.51115835", "0.50925994", "0.5091838", "0.50892437", "0.5080518", "0.50770265", "0.50757456", "0.50757456", "0.50757456", "0.50668675", "0.50554174", "0.50478035", "0.504685", "0.50431126", "0.5034796", "0.50293374", "0.5012994", "0.50122666", "0.5010487", "0.50098145", "0.5008573", "0.49990025", "0.49966213", "0.49924776", "0.49887896", "0.49807134", "0.49795532", "0.49777982", "0.4976821", "0.49720868", "0.4971137", "0.49700513", "0.4960445", "0.4952315", "0.4950237", "0.49499816", "0.4947902", "0.49451736", "0.49437383", "0.49432316", "0.49413645", "0.49377015", "0.49334252", "0.4929864", "0.49230653", "0.4923023", "0.4918449", "0.4915781" ]
0.75202775
0
Jamie Alnasir, created. Determine whether site is running in RHUL Survey Message view mode
function isMsgViewMode() { if (isset($_GET['msg_id'])) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function shouldDisplayMessage()\n\t{\n\t\t// Only on admin app\n\t\tif (!$this->app->isClient('administrator'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only if authenticated\n\t\tif (JFactory::getUser()->guest)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only on HTML documents\n\t\tif ($this->app->getDocument()->getType() !== 'html')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only on full page requests\n\t\tif ($this->app->input->getCmd('tmpl', 'index') === 'component')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only to com_cpanel\n\t\tif ($this->app->input->get('option') !== 'com_cpanel')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "static function hasAnAnswerPage ()\n {\n return true;\n }", "public static function checkVisitor() {\n $request = app('request');\n $showMessage = TRUE;\n if (isset($_COOKIE['alchemy_visited']) && $_COOKIE['alchemy_visited'] != null)\n {\n $showMessage = FALSE;\n } else {\n self::updateVisitorCookie();\n }\n return $showMessage;\n \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}", "private function should_display_translate_notice() {\n\t\tif ( defined( 'HESTIA_PRO_FLAG' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( get_option( 'show_on_front' ) === 'page' ) {\n\t\t\tif ( defined( 'POLYLANG_VERSION' ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( defined( 'TRP_PLUGIN_VERSION' ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( get_option( 'icl_sitepress_settings' ) !== false ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasMsg(){\n return $this->_has(18);\n }", "public function has_tracking() {\n\t\t\treturn $this->hastracking == 'Y' ? true : false;\n\t\t}", "function isMessage(){\r\n return isset($_SESSION['message'])?true:false;\r\n}", "function isRHULApp() {\n\n\tif (isset($_GET['RHUL_App'])) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n}", "function is_lti_request() {\n $good_message_type = $_REQUEST[\"lti_message_type\"] == \"basic-lti-launch-request\";\n $good_lti_version = $_REQUEST[\"lti_version\"] == \"LTI-1p0\";\n $resource_link_id = $_REQUEST[\"resource_link_id\"];\n if ($good_message_type and $good_lti_version and isset($resource_link_id) ) return(true);\n return false;\n}", "private function should_show_feedback_notice() {\n\t\t$activated_time = get_option( 'neve_install' );\n\t\tif ( ! empty( $activated_time ) ) {\n\t\t\tif ( time() - intval( $activated_time ) > 14 * DAY_IN_SECONDS ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function detect()\n { if ($this->bLog)\n {\n $fp = @fopen($this->bLog,'a+');\n if ($fp)\n {\n fputs($fp,\"\\r\\n\".date(\"d-m-Y H:i:s\").' ['.$this->rq.'] from '.$this->sIp = getenv(\"REMOTE_ADDR\"));\n fclose($fp);\n }\n }\n // destroy session?\n if ($this->bdestroy_session) session_destroy();\n // redirect?\n if ($this->urlRedirect!=''){\n if (!headers_sent()) header(\"location: $this->urlRedirect\");\n }\n return TRUE;\n }", "public function hasWeddingmsg(){\n return $this->_has(25);\n }", "static function hasMessage()\n {\n foreach (self::TYPES as $type)\n {\n if (self::has($type)) return true;\n }\n return false;\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 displayFeedbackQuestionnaire(): bool {\n // and a feedback questionnaire exists\n // and the feedback questionnare has not been answered\n return $this->userResponse != null &&\n $this->feedbackQuestionnaire != null\n && $this->userFeedbackQuestionnaireResponse == null;\n }", "public function isAccepted_as_talk() {\n\t\t$this->getAccepted_as_talk();\n\t}", "public function isSessionMessage() {}", "function templ_fetch_mail_type()\r\n{\r\n\t$tmpdata = get_option('templatic_settings');\r\n\tif(@$tmpdata['php_mail'] == 'php_mail')\r\n\t{\r\n\t\treturn true;\t\r\n\t}\r\n\treturn false;\r\n}", "public function isVerified() {\n\t\treturn $this->oehhstat == 'V';\n\t}", "public function hasIfmsg(){\n return $this->_has(28);\n }", "public function areLoginMessagesEnabled() : bool{\n \treturn $this->login_message;\n }", "function check_for_querystrings() {\r\n\t\t\tif ( isset( $_REQUEST['message'] ) ) {\r\n\t\t\t\tUM()->shortcodes()->message_mode = true;\r\n\t\t\t}\r\n\t\t}", "private function isSmartMessage($lpcid) {\r\n $query = $this->db->select('testtype, smartmessage')\r\n ->from('landingpage_collection')\r\n ->where('landingpage_collectionid', $lpcid)\r\n ->get();\r\n $row = $query->row();\r\n return $row->testtype == OPT_TESTTYPE_VISUALAB && $row->smartmessage == OPT_IS_SMS_TEST;\r\n }", "function it_exchange_is_membership_addon_builder_view() {\n return it_exchange_is_page( 'membership' );\n}", "protected function isMailMode() {\n return ($this->mode == Notification_NotificationTemplate::MODE_MAIL);\n }", "public function hasMessage()\n {\n return $this->hasMessage;\n }", "public function is_show_ask_for_review_notice() {\n return (\n nk_theme()->theme_dashboard()->theme_id &&\n nk_theme()->theme_dashboard()->theme_uri &&\n nk_theme()->theme_dashboard()->ask_for_review &&\n 'show' === nk_theme()->get_option( 'ask_for_review_status', 'first' )\n );\n }", "function pzdc_has_hub_community() {\n global $PraizedCommunity;\n return $PraizedCommunity->tpt_has_hub_community();\n}", "static function is_demo(){\n if (config_item('demo_mode') == 'TRUE') {\n Applib::make_flashdata(array('response_status' => 'error','message' => lang('demo_warning')));\n redirect($_SERVER['HTTP_REFERER']);\n }\n }", "function pzdc_hub_community_is_hub() {\n global $PraizedCommunity;\n return $PraizedCommunity->tpt_community_is_hub($PraizedCommunity->tpt_hub_community);\n}", "public function detectMessage(){\n\n\t\t$result=$this->model->newMessageDetection();\n\n\t\tif($result!==false){\n\t\t\techo json_encode($result);\n\t\t}else{\n\t\t\techo 'false';\n\t\t}\n\t}", "private static function is_constantcontact_page(){\r\n \tglobal $plugin_page,$pagenow;\r\n\r\n \treturn ($pagenow === 'admin.php' && isset($_GET['page']) && $_GET['page'] === 'gf_constantcontact');\r\n\t}", "public function canSend()\n {\n $flag = intval(setting(\"mail_notify_{$this->getTemplateTag()}\"));\n\n return !!$flag;\n }", "public function activateOfficialsSurvey()\n {\n return $this->mailer->activateOfficialsSurvey($this->data);\n }", "public function isSiteAdmin(){\n\t\treturn $this->rank_user==config('ranks.SITE_ADMIN');\n\t}", "function isEmailMode() {\n\n if (isset($_POST['msg_text'])) {\n return true;\n } else {\n return false;\n }\n\n}", "function can_process()\n{\n global $controller, $Mode;\n if ( strlen( $_POST[ 'reported_by' ] ) > 0 )\n {\n return\n (!is_empty( $_POST[ 'gate_code' ], 'Superior Response' )) &&\n (!is_empty( $_POST[ 'superior_confirmed' ], 'Superior Confirmation' )) &&\n (!is_empty( $_POST[ 'superior_comments' ], 'Superior Comments' ))\n ;\n }\n else\n {\n return\n (!is_empty( $_POST[ 'gate_code' ], 'Employee Response' )) &&\n (!is_empty( $_POST[ 'employee_confirmed' ], 'Employee Confirmation' )) &&\n (!is_empty( $_POST[ 'employee_comments' ], 'Employee Comments' ))\n ;\n }\n}", "public function valide_messageid() {\n\t\tif (empty ( $this->getMessageId () )) {\n\t\t\t$this->onDebug ( $this->getMessageId (), 2 );\n\t\t\t$this->onError ( \"Il faut un message id renvoye par O365 pour travailler\" );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function getWebhookStatus()\n {\n return (bool)Mage::getStoreConfigFlag('trello_api/webhook/status');\n }", "function is_order_received_page() {\n return ( is_page( carton_get_page_id( 'thanks' ) ) ) ? true : false;\n }", "public function notificationsafeenvrnmnt(){\n $this->load->model('resident/maintainsafeenvironment_model', 'seadl');\n return $this->seadl->safeenvrnmntnotifications();\n //return false;\n }", "public function doesSupportRichMessage()\n {\n return in_array($this->requestSource, $this->supportedRichMessagePlatforms);\n }", "public function needsVerificationMessage ();", "protected function shouldShowNewsButton()\n\t{\n\t\t$news_view = ee('Model')->get('MemberNewsView')\n\t\t\t->filter('member_id', ee()->session->userdata('member_id'))\n\t\t\t->first();\n\n\t\treturn ( ! $news_view OR version_compare(APP_VER, $news_view->version, '>'));\n\t}", "function checkVisual($contentId=0) {\r\n\t\tglobal $option;\r\n\r\n\t\t$func = JRequest::getVar('view');\r\n\r\n\t\treturn ( $option == 'com_eventlist'\r\n\t\t&& $func == 'details'\r\n\t\t);\r\n\t}", "public function getMessage(){\n if( !isset($this->openForm) ) return false;\n if( !is_bool($this->openForm) && !is_array($this->openForm) )\n return self::getFormMessage($this->openForm);\n if( is_array($this->openForm) )\n return self::getFormMessage($this->openForm['formid']);\n return false;\n }", "private function getModalTitleText() : \\Magento\\Framework\\Phrase\n {\n return __('Are You Sure You Want to Turn Off Page Builder?');\n }", "public function getShowQuestionTitles() \n\t{\n\t\treturn ($this->display_question_titles) ? 1 : 0;\n\t}", "function dialogue_is_a_conversation(stdClass $message) {\n if ($message->conversationindex == 1) { // Opener always has index of 1.\n return true;\n }\n return false;\n}", "public function isSite() {\n return false;\n }", "protected function _isDuringTest($questionnaire) {\n\t\treturn $questionnaire['Questionnaire']['status'] == NetCommonsBlockComponent::STATUS_PUBLISHED ? false : true;\n\t}", "public static function canViewNewTickets()\n\t{\n\t\tif (!auth()->check()) return false;\n\t\t$member = \\PanicHDMember::find(auth()->user()->id);\n\n\t\tif ($member->isAdmin()){\n\t\t\treturn true;\n\t\t}elseif($member->isAgent() and $member->currentLevel() == 2){\n\t\t\tif(Setting::grab('agent_restrict')==1){\n\t\t\t\treturn $member->categories()->wherePivot('autoassign','1')->count()==0 ? false : true;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isMainPost()\n\t{\n\t\t$topic = ForumTopic::with(['messages' => function($q) {\n\t\t\t$q->orderBy('created_at','asc');\n\t\t}])->find($this->topic_id);\n\n\t\tif($topic->messages[0]->id == $this->id) return true;\n\n\t\treturn false;\n\n\t}", "public function checkForOneTimeDemoMessage(): bool\n {\n return $this->getCustomerAttrCreditHold() && $this->configProvider->isOptionCreditHoldEnable() && !$this->getFlag();\n }", "function get_is_upcoming_event_display($view): bool {\n $display = $view->current_display;\n\n switch ($display) {\n // Set the past events link for a topic filtered display.\n case 'page_1': // Event all display\n case 'page_3': // Event topic display\n case 'page_4': // Past topic display\n return TRUE;\n default:\n return FALSE;\n }\n}", "public function isVerified()\n\t{\n\t\tif (($record=$this->getActiveRecord())===null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool)$record->correo_verificado;\n\t}", "function it_exchange_is_memberships_addon_builder_view() {\n return it_exchange_is_page( 'memberships' );\n}", "public function is_needed() {\n\t\treturn $this->context->site_represents === 'company';\n\t}", "protected function is_view_page() {\n\t\treturn false;\n\t}", "protected function is_first_time()\n\t{\n\t\tif ( !get_site_option( 'cur_from' ) && !get_site_option( 'confirm-user-registration' ) ) :\n\t\t\treturn TRUE;\n\t\telse :\n\t\t\treturn FALSE;\n\t\tendif;\n\t}", "function isContactMode() {\n\n if (isset($_GET['cont'])) {\n return true;\n } else {\n return false;\n }\n\n}", "public function invite() {\n\t\tif (!$this->get_settings()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ($this->settings['mbd.active'] != 'true') {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$group = $this->Group->find('first', array(\n\t\t\t'fields' => array('Group.id'),\n\t\t\t'conditions' => array(\n\t\t\t\t'Group.key' => 'mbd'\n\t\t\t)\n\t\t));\n\t\t\n\t\t$project = $this->Project->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Project.status' => PROJECT_STATUS_OPEN,\n\t\t\t\t'Project.active' => true,\n\t\t\t\t'Project.group_id' => $group['Group']['id']\n\t\t\t),\n\t\t\t'order' => 'Project.id DESC'\n\t\t));\n\t\tif (!$project) {\n\t\t\treturn;\n\t\t}\n\n\t\t// so we can capture the output of the view into a string to write\n\t\t$this->autoRender = false;\n\t\n\t\t$survey_subject = empty($project['Project']['description']) ? 'Exciting Survey Opportunity - Act now!': $project['Project']['description'];\n\t\t$survey_award = $project['Project']['award'];\n\t\t$survey_length = $project['Project']['est_length'];\n\t\n\t\t$is_desktop = $project['Project']['desktop'];\n\t\t$is_mobile = $project['Project']['mobile'];\n\t\t$is_tablet = $project['Project']['tablet'];\n\t\t$survey_id = $project['Project']['id'];\n\n\t\t// grab the email template\n\t\tApp::uses('Controller', 'Controller');\n\t\tApp::uses('View', 'View');\n\t\t\n $controller = new Controller();\n\t\t$view = new View($controller, false);\n\t\t$view->layout = 'Emails/html/default';\n\t\t$nonce = '{{nonce}}';\n\t\t$survey_url = '{{survey_url}}';\n\t\t$unsubscribe_link = '{{unsubscribe_link}}';\n\t\t$view->set(compact('nonce', 'survey_url', 'unsubscribe_link', 'survey_award', 'survey_length', 'is_desktop', 'is_mobile', 'is_tablet', 'survey_id'));\n\t\t$view->viewPath = 'Emails/html';\n\t\t$email_body = $view->render('survey');\n\t\t$this->autoRender = true;\n\t\t\n\t\t// grab users\n\t\t$http = new HttpSocket(array(\n\t\t\t'timeout' => 15,\n\t\t\t'ssl_verify_host' => false // PHP does not seem to check SANs for CNs\n\t\t));\n\t\t$results = $http->get($this->settings['hostname.mbd'].'/ignite/getinvites?X-ApiKey='.$this->settings['mbd.api_key'], $this->options);\t\t\n\t\t$results = json_decode($results, true);\n\t\tif (empty($results)) {\n\t\t\t$this->out('API call failed');\n\t\t\tCakeLog::write('mbd.invite', 'API call failed');\n\t\t\treturn;\n\t\t} \n\t\t\n\t\t$this->out('Sending to '.count($results).' panelists');\n\t\tCakeLog::write('mbd.invite', 'Sending to '.count($results).' panelists');\n\t\t$total = count($results); \n\t\t\n\t\t$i = 0; \n\t\t$success = 0;\n\t\t$queued_emails = array();\n\t\tforeach ($results as $result) {\n\t\t\t$i++;\n\t\t\t$user = $this->User->find('first', array(\n\t\t\t\t'fields' => array('User.id', 'User.last_touched', 'User.ref_id', 'User.email', 'User.send_survey_email', 'User.send_email'),\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'User.id' => $result['panelistId'],\n\t\t\t\t\t'User.hellbanned' => false\n\t\t\t\t),\n\t\t\t\t'recursive' => -1\n\t\t\t));\n\t\t\tif (!$user) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$active = $http->get($result['url'].'&test=true',\n\t\t\t\tarray(),\n\t\t\t\tarray('header' => array(\n\t\t\t\t\t'Accept' => 'application/json',\n\t\t\t\t\t'Content-Type' => 'application/json; charset=UTF-8'\n\t\t\t\t))\n\t\t\t);\n\t\t\tif ($active['body'] == 'False') {\n\t\t\t\t$this->out($i.'/'.$total.' Email not send to '.$user['User']['id'].' because they have opted out of emails'); \n\t\t\t\tCakeLog::write('mbd.invite', $i.'/'.$total.' Email not send to '.$user['User']['id'].' because they have opted out of emails');\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// bypass the sending of email if user has opted out\n\t\t\tif (!$user['User']['send_survey_email'] || !$user['User']['send_email']) {\n\t\t\t\t$this->out($i.'/'.$total.' Email not send to '.$user['User']['id'].' because they have opted out of emails'); \n\t\t\t\tCakeLog::write('mbd.invite', $i.'/'.$total.' Email not send to '.$user['User']['id'].' because they have opted out of emails');\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$user_option = $this->UserOption->find('first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'UserOption.user_id' => $user['User']['id'],\n\t\t\t\t\t'UserOption.name' => 'mbd.last.invited'\n\t\t\t\t)\n\t\t\t)); \n\t\t\tif ($user_option && strtotime('-24 hours') <= strtotime($user_option['UserOption']['value'])) {\n\t\t\t\t$this->out($i.'/'.$total.' Skipped '.$user['User']['id'].' as they were emailed recently ('.$user_option['UserOption']['value'].')');\n\t\t\t\tCakeLog::write('mbd.invite', $i.'/'.$total.' Skipped '.$user['User']['id'].' as they were emailed recently ('.$user_option['UserOption']['value'].')');\n\t\t\t\tcontinue;\n\t\t\t} \n\t\t\t\n\t\t\t// MBD can send dupe invites\n\t\t\tif (in_array($user['User']['email'], $queued_emails)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$queued_emails[] = $user['User']['email']; \n\t\t\t\n\t\t\t// generate the email\n\t\t\t$nonce = substr($user['User']['ref_id'], 0, 21).'-'.substr(Utils::rand(10), 0, 10);\n\t\t\t$survey_url = HOSTNAME_WWW.'/surveys/pre/'.$project['Project']['id'].'/?nonce='.$nonce . '&from=email'.(!empty($project['Project']['code']) ? '&key='.$project['Project']['code'] : '');\n\t\t\t$unsubscribe_link = HOSTNAME_WWW.'/users/emails/'.$user['User']['ref_id'];\n\t\t\t\n\t\t\t$customized_email_body = str_replace(array(\n\t\t\t\t'{{nonce}}',\n\t\t\t\t'{{unsubscribe_link}}', \n\t\t\t\t'{{survey_url}}',\n\t\t\t\t'{{user_id}}'\n\t\t\t), array(\n\t\t\t\t$nonce,\n\t\t\t\t$unsubscribe_link, \n\t\t\t\t$survey_url,\n\t\t\t\t$user['User']['id']\n\t\t\t), $email_body);\n\t\t\t\n\t\t\t// create the one-time nonce\n\t\t\t$this->Nonce->create();\n\t\t\t$this->Nonce->save(array('Nonce' => array(\n\t\t\t\t'item_id' => $project['Project']['id'],\n\t\t\t\t'item_type' => 'survey',\n\t\t\t\t'user_id' => $user['User']['id'],\n\t\t\t\t'nonce' => $nonce\n\t\t\t)), false);\n\t\t\n\t\t\t$this->MailQueue->create();\n\t\t\t$this->MailQueue->save(array('MailQueue' => array(\n\t\t\t\t'user_id' => $user['User']['id'],\n\t\t\t\t'email' => $user['User']['email'],\n\t\t\t\t'subject' => $survey_subject,\n\t\t\t\t'project_id' => $project['Project']['id'],\n\t\t\t\t'body' => $customized_email_body,\n\t\t\t\t'status' => 'Queued'\n\t\t\t)));\n\t\t\t\n\t\t\t$success++;\n\t\t\t$this->out($i.'/'.$total.' Queued (#'.$user['User']['id'].': '.$user['User']['email'].')'); \n\t\t\tCakeLog::write('mbd.invite', $i.'/'.$total.' Queued (#'.$user['User']['id'].': '.$user['User']['email'].')');\n\t\t\t\n\t\t\tif (!$user_option) {\n\t\t\t\t$this->UserOption->create();\n\t\t\t\t$this->UserOption->save(array('UserOption' => array(\n\t\t\t\t\t'user_id' => $user['User']['id'],\n\t\t\t\t\t'name' => 'mbd.last.invited',\n\t\t\t\t\t'value' => date(DB_DATETIME)\n\t\t\t\t)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->UserOption->create();\n\t\t\t\t$this->UserOption->save(array('UserOption' => array(\n\t\t\t\t\t'id' => $user_option['UserOption']['id'],\n\t\t\t\t\t'value' => date(DB_DATETIME)\n\t\t\t\t)), true, array('value'));\n\t\t\t}\n\t\t}\n\t\t$this->out('Emails successfully sent out to '.$success); \n\t\tCakeLog::write('mbd.invite', 'Emails successfully sent out to '.$success);\n\t}", "function pp_came_from_rcp() {\n\n\tif ( isset( $_GET['referrer'] ) && 'rcp_site' === $_GET['referrer'] ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "function getInvitationMode() \n\t{\n\t\tinclude_once \"./Services/Administration/classes/class.ilSetting.php\";\n\t\t$surveySetting = new ilSetting(\"survey\");\n\t\t$unlimited_invitation = $surveySetting->get(\"unlimited_invitation\");\n\t\tif (!$unlimited_invitation && $this->invitation_mode == self::MODE_UNLIMITED)\n\t\t{\n\t\t\treturn self::MODE_PREDEFINED_USERS;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ($this->invitation_mode) ? $this->invitation_mode : self::MODE_UNLIMITED;\n\t\t}\n\t}", "public function isViewed() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn InputValidator::isEmpty($this->viewDate) ? false: true;\r\n\t}", "public function IsInMaintenanceMode(){\n\n\t\t// Obtain maintenance_mode index from config file\n $config_maintenance = $this->instance->config->item(\"maintenance_mode\");\n\n // validate if it's true\n if( $config_maintenance ){\n\n \t// load view and terminate output\n echo $this->instance->load->view('system/maintenance_mode', false, true);\n die();\n }\n }", "public function hasMessages()\r\n {\n return $this->fm->hasMessages();\n }", "static public function IsOutlook() {\n return (self::GetDeviceType() == \"WindowsOutlook\");\n }", "public function DisplayNice()\n {\n return $this->DisplayOnSite ? 'Yes' : 'No';\n }", "function runSurvey() {\n $this->autoRender = false; // turn off autoRender\n $this->response->disableCache(); // do not cache the page\n $type = $this->Session->read('Survey.type');\n switch ($type) {\n case 'user':\n if (array_key_exists('respondentGUID', $this->request->named)) { // check to see if this is a new survey\n $respondentGUID = $this->request->named['respondentGUID'];\n if (!$this->Session->check('Survey.progress')) {\n $respondentId = $this->Survey->Respondent->getIdByGuid($respondentGUID);\n $i = $this->Survey->Respondent->Response->find('count', array('conditions' => array('respondent_id' => $respondentId))); // check to see if a responds has already been provided\n if ($i > 0) {\n $currentResults = $this->Survey->Respondent->Response->getLatestResponse($respondentId);\n if (isset($currentResults['Hierarchy'])) {\n $this->Session->write('Survey.hierarcy', $currentResults['Hierarchy']);\n }\n if (isset($currentResults['Response']['maingoal'])) {\n $this->Session->write('Survey.mainGoal', $currentResults['Response']['maingoal']);\n }\n if (isset($currentResults['Answer'])) {\n $this->Session->write('Survey.answers', $currentResults['Answer']);\n }\n }\n $this->Session->write('Survey.type', 'user');\n $this->Session->write('Survey.started', date(\"Y-m-d H:i:s\"));\n // need to read the user information here, verify that it is a valid user for this survey, and add the info to the session\n $this->request->data = $this->Survey->Respondent->read(null, $respondentId); // read the respondent\n $id = $this->request->data['Respondent']['survey_id']; // get the ID of the survey being taken\n $this->Session->write('Survey.respondent', $respondentId);\n // id will only be set when a survey is just starting, so check for id\n $this->Survey->contain(array('Question' => 'Choice'));\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($id));\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $id); // set the survey id\n }\n }\n break;\n case 'test':\n if ($this->Session->check('Auth.User')) {\n if (array_key_exists('surveyId', $this->request->named)) { // check to see if this is a new survey\n $surveyId = $this->request->named['surveyId'];\n if (!is_null($surveyId) && !$this->Session->check('Survey.progress')) {\n $this->Survey->contain(array('Question' => 'Choice')); // get the survey data\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($surveyId)); // write the survey data to the session\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $surveyId); // set the survey id in the session\n }\n }\n break;\n }\n default:\n die('Error - survey type not in session. Session may have timed out. Reuse your original link to start a new session.');\n break;\n }\n if (!$this->Session->check('Survey.progress')) { // check the current survey progress\n //make sure the correct session variables are present in order to continue\n $this->Session->setFlash(__('Error with survey', true, null, \"warning\")); // send a warning\n if ($this->referer() != '/') {\n // if we have a reference that isn't root\n $this->redirect($this->referer()); // go to that original page\n } else {\n $this->redirect(array('action' => 'index')); // otherwise go back to the survey index\n }\n }\n $progress = $this->Session->read('Survey.progress'); // get the current progress from the session\n // direct to the correct step based on the progress variable in the session\n switch ($progress) {\n case INTRO:\n array_key_exists('intropage', $this->request->named) ? $introstep = $this->request->named['intropage'] : $introstep = 0;\n if ($introstep < 4) {\n $introstep++;\n $this->layout = 'intro'; // use the intro layout\n $this->set('intropage', $introstep);\n $this->render('/Elements/intro');\n break;\n }\n case RIGHTS:\n $this->layout = 'rights'; // use the rights layout\n $id = $this->Session->read('Survey.id'); // get the survey id the session\n $consent = $this->Survey->field('consent', array('id' => $id)); // retrieve the informed consent information\n $this->set('consent', $consent); // send the custome consent form to the view\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('controller' => 'surveys', 'action' => 'answerQuestions')); // send to the question action\n break;\n case GDTA_ENTRY:\n $this->redirect(array('action' => 'enterGdta')); // send to the GDTA portion\n break;\n case SUMMARY:\n $this->redirect(array('action' => 'createSvgResult')); // send to the GDTA summary\n break;\n }\n }", "public function isNewsletterPopUpEnable() \n {\n return (bool) Mage::getStoreConfig(self::XML_PATH_ENABLE);\n }", "public function actionCheckUserMode() {\n $this->redirect(array('blogTaskInboxView'));\n }", "public function isLogoutOnSurvey()\n {\n return (boolean) $this->_getVar('user_logout');\n }", "public function isGerechtigd()\n {\n if(isset($_SESSION['gebruiker'])&&!empty($_SESSION['gebruiker']))\n {\n $gebruiker=$_SESSION['gebruiker'];\n if ($gebruiker->getRecht() == \"medewerker\")\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n \n return false;\n \n \n }", "function lqd_app_view_message_template( $template ) {\n\tglobal $wp_query;\n\tif( isset( $wp_query->query_vars['messages-app-view'] ) && isset( $wp_query->query_vars['gc-sermons'] ) ) {\n\t\t$template = locate_template( array( 'single-gc-sermons-app-view.php' ) );\n\t}\n\treturn $template;\n}", "public function isMessage()\n {\n return !empty(self::$message);\n }", "protected function canReply(){\n return $this->canUserModify() &&\n $this->socialQuestion &&\n $this->isActive() &&\n $this->socialQuestion->SocialPermissions->canComment() &&\n !$this->connectObj->Parent->ID;\n }", "static public function isMailServerUsed()\r\n {\r\n $cfgMailSrvService = Warecorp_Config_Loader::getInstance()->getAppConfig('cfg.instance.xml')->{'mailsrv'};\r\n return $cfgMailSrvService->use && ( $cfgMailSrvService->use == 1 || $cfgMailSrvService->use == 'true' );\r\n }", "private function altMessageExist()\n { \n return !empty($this->altMessage);\n }", "public function isVerificationRequest(): bool\n {\n return $this->request->getParameter('hub_mode') === 'subscribe' && $this->request->getParameter('hub_verify_token');\n }", "function has_message($type)\n{\n if (isset($_SESSION[$type], $_SESSION[$type . '_time'])) {\n $old_time = $_SESSION[$type . '_time'];\n if ((time() - $old_time) < 3) {\n return true;\n } else {\n unset($_SESSION[$type], $_SESSION[$type . '_time']);\n }\n\n return false;\n }\n\n return false;\n}", "function has_logged_in()\n\t{\n\t\tif( $this->session->userdata('usir_nim') )\n\t\t{\n\t\t\tredirect('reminders');\n\t\t}\n\t\t\n\t}", "function scr_is($script)\n{\n return ROUTE[WEBSITE_REQUEST] == $script;\n}", "public function hasView()\n {\n return false;\n }", "function ms_site_check()\n {\n }", "function wcs_is_view_subscription_page() {\n\tglobal $wp;\n\n\treturn ( is_page( wc_get_page_id( 'myaccount' ) ) && isset( $wp->query_vars['view-subscription'] ) ) ? true : false;\n}", "private function check_meet_creation_limit()\n {\n $recent_shackmeet_count = count($this->load_recent_shackmeet_count());\n \n return $recent_shackmeet_count < 2;\n }", "public function present() {\n\t\tif($this->survey === null) {\n\t\t\treturn <<<HTML\n<p class=\"shoutout full\">Survey $this->tag does not exist.</p>\nHTML;\n\t\t}\n\n\t\tif($this->unavailable) {\n\t\t\treturn <<<HTML\n<p class=\"shoutout full\">Survey not available.</p>\nHTML;\n\t\t}\n\n\t\tif($this->user->atLeast(Member::INSTRUCTOR)) {\n\t\t\treturn $this->presentResults();\n\t\t}\n\n\t\tif($this->done) {\n\t\t\t$redirect = $this->site->root . $this->survey->redirect;\n\t\t\treturn <<<HTML\n<div class=\"full\">\n<p class=\"shoutout\">You have already completed this survey.</p>\n<p class=\"center\"><a href=\"$redirect\">Exit</a></p>\n</div>\n\nHTML;\n\t\t}\n\n\t\t$html = $this->survey->present($this->site);\n\n\t\treturn $html;\n\t}", "private function checkSpecialConditions(TelegramMethods $method)\r\n { \r\n $method->check_reply_markup();\r\n }", "private function isViewed() {\n $viewKey = $this->getViewKey();\n\n if ( Auth::check() ) {\n $viewed = Cache::get($viewKey.':user:'.Auth::user()->id);\n return !empty($viewed);\n } else {\n $time = session($viewKey);\n if ( !empty($time) ) {\n $viewed = (time() - $time) < config('counter.viewCountDuration') * 60;\n } else {\n $viewed = false;\n }\n return $viewed;\n }\n }", "function defaultViewExists () {\n\t\treturn isset ($this->_defaultView);\n\t}", "function pzdc_has_answer() {\n global $PraizedCommunity;\n return $PraizedCommunity->tpt_has_answer();\n}", "Public Function IsSelfHosted()\n\t{\n\t\tif(class_exists('Zend_Registry'))\n\t\t{\n\t\t\tif(Zend_Registry::get('Application/Mode') == 'SelfHosted')\n\t\t\t{\n\t\t\t\treturn '0';\n\t\t\t}\n\t\t}\n\t\treturn $this->isSelfHosted;\t\n\t}", "static function isTrackable()\n {\n if(!Auth::check())\n return true;\n $user = Auth::User();\n if(stristr($user->type, 'Employee') || stristr($user->type, 'Demo'))\n return false;\n return true;\n }", "function dialogue_can_track_dialogue($user = false) {\n global $USER, $CFG;\n\n // return unless enabled at site level\n if (empty($CFG->dialogue_trackreadentries)) {\n return false;\n }\n\n // default to logged if no user passed as param\n if ($user === false) {\n $user = $USER;\n }\n\n // dont allow guests to track\n if (isguestuser($user) or empty($user->id)) {\n return false;\n }\n\n // finally if user has trackForums set then allow tracking\n return true && ! empty($user->trackforums);\n}", "function cemhub_is_webform_integrated($nid) {\n $webform_settings = cemhub_get_integrated_webform_settings_by_node_id($nid);\n\n return !empty($webform_settings->active) ? TRUE : FALSE;\n}", "function isTV(){\n\t\tif ($this->view == \"tv\"){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isReviewer()\n {\n return $this->hasRole(HakAkses::REVIEWER);\n }", "public function isResearcher(){\n\t\t$member = Member::CurrentUser();\n\t\t$group = SiteConfig::current_site_config()->ResearchGroup();\n\t\tif($group && $member){\n\t\t\treturn $member->inGroup($group->Code);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\n\t}" ]
[ "0.608481", "0.58012897", "0.5794463", "0.55705565", "0.5557285", "0.5546865", "0.5511485", "0.5479734", "0.54782164", "0.5472729", "0.544241", "0.5423431", "0.5419479", "0.53651375", "0.53629", "0.5339953", "0.53270143", "0.53240573", "0.53018713", "0.5295207", "0.5282798", "0.5272023", "0.52632743", "0.5258986", "0.5256835", "0.52435946", "0.5233978", "0.5232429", "0.52313894", "0.5193072", "0.5186486", "0.5182366", "0.5158948", "0.5152424", "0.5149118", "0.5147526", "0.51439923", "0.5133294", "0.5127778", "0.5124988", "0.5123814", "0.5122717", "0.51193076", "0.51188767", "0.5111843", "0.51108706", "0.51082057", "0.51017386", "0.5096686", "0.50948316", "0.50929755", "0.50927866", "0.50922143", "0.5091632", "0.50892454", "0.5088262", "0.50861466", "0.5078712", "0.5072162", "0.5067937", "0.50674546", "0.50620395", "0.50598925", "0.5057174", "0.50561994", "0.50537336", "0.5051776", "0.5047239", "0.50444275", "0.5040045", "0.50262785", "0.50251204", "0.50244755", "0.5021288", "0.5020929", "0.5020809", "0.50206494", "0.5018552", "0.50149316", "0.5011259", "0.5005792", "0.5003832", "0.5002408", "0.49952245", "0.49950796", "0.49884036", "0.49874344", "0.49860328", "0.49853873", "0.49832305", "0.49812546", "0.49811417", "0.49811232", "0.4980924", "0.49720687", "0.49698615", "0.49678263", "0.49642554", "0.49642238", "0.49625114" ]
0.669295
0
Jamie Alnasir, created. Determine whether site is running in RHUL Contact mode
function isContactMode() { if (isset($_GET['cont'])) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function contactIsActive()\n {\n return true ;\n }", "public function hasContactInfo() {\n return ($this->phone || $this->email || $this->pager);\n }", "public function hasContactInformation() {\n\t\treturn $this->hasContactEmail() || $this->hasContactUrl();\n\t}", "private static function is_constantcontact_page(){\r\n \tglobal $plugin_page,$pagenow;\r\n\r\n \treturn ($pagenow === 'admin.php' && isset($_GET['page']) && $_GET['page'] === 'gf_constantcontact');\r\n\t}", "public function is_needed() {\n\t\treturn $this->context->site_represents === 'company';\n\t}", "function ms_site_check()\n {\n }", "public function isDefDomain(){\n return (boolean) $this->isActive() && ($this->getDomainName() == Yii::$app->params['domain_name']) && ($this->getDomainTopName() == 'ru');\n }", "function erp_is_contacts_page() {\n if ( empty( $_GET['page'] ) || $_GET['page'] != 'erp-crm' ) {\n return false;\n }\n\n if ( empty( $_GET['section'] ) || $_GET['section'] != 'contacts' || $_GET['section'] != 'companies' ) {\n return false;\n }\n\n return true;\n}", "function isRHULApp() {\n\n\tif (isset($_GET['RHUL_App'])) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n}", "function detect()\n { if ($this->bLog)\n {\n $fp = @fopen($this->bLog,'a+');\n if ($fp)\n {\n fputs($fp,\"\\r\\n\".date(\"d-m-Y H:i:s\").' ['.$this->rq.'] from '.$this->sIp = getenv(\"REMOTE_ADDR\"));\n fclose($fp);\n }\n }\n // destroy session?\n if ($this->bdestroy_session) session_destroy();\n // redirect?\n if ($this->urlRedirect!=''){\n if (!headers_sent()) header(\"location: $this->urlRedirect\");\n }\n return TRUE;\n }", "public function hasContactUrl() {\n\t\treturn $this->contactUrl !== null;\n\t}", "function tp_is_person() {\n\t$known = array('msie', 'mozilla', 'firefox', 'safari', 'webkit', 'opera', 'netscape', 'konqueror', 'gecko');\n\n\t$agent = strtolower($_SERVER['HTTP_USER_AGENT']);\n\n\tforeach ($known as $browser) {\n\t\tif (strpos($agent, $browser) !== false) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "function sloodle_autoreg_enabled_site()\n {\n return (bool)sloodle_get_config('sloodle_allow_autoreg');\n }", "public function isContactFormActivated()\n {\n $contact = get_option('activate_contact_form');\n if (@$contact == 1) { \n return true;\n }\n return false;\n }", "public function isSite() {\n return false;\n }", "function is_subdomain_install()\n {\n }", "function getContactSituationAction() {\n\t\t@$portal = DevblocksPlatform::importGPC($_REQUEST['portal'],'string','');\n\t\t\n\t\tUmPortalHelper::setCode($portal);\n\t\t\n\t\t$module = DevblocksPlatform::getExtension('sc.controller.contact',true,true);\n\t\t$module->getSituation();\n\t}", "public function checkAcquiaHosted() {\n return isset($_SERVER['AH_SITE_ENVIRONMENT'], $_SERVER['AH_SITE_NAME']);\n }", "public function hasWebsite() {\n return $this->_has(9);\n }", "protected function is_first_time()\n\t{\n\t\tif ( !get_site_option( 'cur_from' ) && !get_site_option( 'confirm-user-registration' ) ) :\n\t\t\treturn TRUE;\n\t\telse :\n\t\t\treturn FALSE;\n\t\tendif;\n\t}", "function pp_came_from_rcp() {\n\n\tif ( isset( $_GET['referrer'] ) && 'rcp_site' === $_GET['referrer'] ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public static function canDisplayContactsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_CONTACT);\n\t}", "private function usr(){\r\n\r\n if(defined(\"USER_ID\")){ return true;}else{return false;}\r\n\r\n }", "public function getContactMode()\n\t{\n\t\treturn array(0=>'walkin',1=>'phone',2=>'email');\n\t}", "function is_referral(){\n\n\t\treturn (new user_agent)->is_referral();\n\n\t}", "function hb_is_contact($sender_id,$sender_type,$receiver_id,$receiver_type)\r\n\t{\r\n\t\t$hb_is_contact_query = \"select id from tbl_contacts where (`sender_id` = '$sender_id' and `sender_type` = '$sender_type' and `receiver_id` = '$receiver_id' and `receiver_type` = '$receiver_type') or (`sender_id` = '$receiver_id' and `sender_type` = '$receiver_type' and `receiver_id` = '$sender_id' and `receiver_type` = '$sender_type')\";\r\n\t\t$hb_is_contact_result = hb_mysql_query($hb_is_contact_query) or die(hb_mysql_error());\r\n\t\t$hb_is_contact_answer = hb_mysql_num_rows($hb_is_contact_result);\r\n\t\tif($hb_is_contact_answer > 0)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function fiorello_mikado_contact_form_7_installed() {\n\t\treturn defined( 'WPCF7_VERSION' );\n\t}", "public function hasContactList()\n {\n return $this->contact !== null;\n }", "public function contact_company()\n {\n }", "function siteInformation_validate() {\n return true;\n}", "function theme_haarlem_is_extranet() {\n\n\tstatic $result;\n\t\n\tif (isset($result)) {\n\t\treturn $result;\n\t}\n\t\n\t$result = false;\n\tif (elgg_get_plugin_setting('is_extranet', 'theme_haarlem_intranet') == 'yes') {\n\t\t$result = true;\n\t}\n\t\n\treturn $result;\n}", "public function whois_looking_check(){\n\t\tglobal $post;\n\t\t$post_id = get_the_ID();\n\t\t$current_user_id = get_current_user_id();\n\t\t$author_user_id = $post->post_author;\n\t\tif ($current_user_id == $author_user_id){\n\t\t\t$include_file = plugin_dir_path( __FILE__ ) . \"subscription_view_author.php\";\n\t\t\tinclude_once($include_file);\n\t\t\tif (isset ($$subscription_view_author)){return;}\n\t\t\t$subscription_view_author = new subscription_view_author($post_id);\n\t\t}\n\t}", "public function getRequestContact(): bool {\n\t\treturn $this->requestContact;\n\t}", "function isBrandNew()\n\t{\n\t\treturn !$this->getHandler()->isExists();\n\t}", "function _pum_expert_mycv_user_is_current_contact($cid) {\n civicrm_initialize();\n $session = CRM_Core_Session::singleton();\n $contact_id = $session->get('userID');\n\n if ($contact_id == $cid) {\n return TRUE;\n }\n\n return FALSE;\n}", "function templ_fetch_mail_type()\r\n{\r\n\t$tmpdata = get_option('templatic_settings');\r\n\tif(@$tmpdata['php_mail'] == 'php_mail')\r\n\t{\r\n\t\treturn true;\t\r\n\t}\r\n\treturn false;\r\n}", "function cjpopups_is_local(){\n\tif($_SERVER['REMOTE_ADDR'] == '127.0.0.1'){\n\t\treturn true;\n\t}elseif(strpos(site_url(), 'cssjockey') > 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function check_form()\n\t{\n\t\tProfil_fields_forum::validate(PROFIL_FIELDS_CONTACT, 'contact', $this->errstr, Fsb::$session->id());\n\t}", "private function _isMobile(){\n\t\t/* getting user agent reference */\n\t\t$this->load->library('user_agent');\n\t\t\n\t\t/* return the requested device type */\n\t\treturn $this->agent->is_mobile();\n\t}", "public function hasWebsite() {\n return $this->_has(8);\n }", "public function contactExist(){\n $result = \\CRest::call('crm.contact.list', [\n 'filter' => [\n 'UF_CRM_CPF' => $this->cpf\n ],\n 'select' => 'ID',\n ]);\n\n return empty(!$result['result']);\n }", "Public Function IsSelfHosted()\n\t{\n\t\tif(class_exists('Zend_Registry'))\n\t\t{\n\t\t\tif(Zend_Registry::get('Application/Mode') == 'SelfHosted')\n\t\t\t{\n\t\t\t\treturn '0';\n\t\t\t}\n\t\t}\n\t\treturn $this->isSelfHosted;\t\n\t}", "function is_main_blog()\n {\n }", "abstract function is_agency();", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('AVATOR_ContactUs::contact');\n }", "public function isSiteSpecific()\n {\n return $this->siteSpecific;\n }", "private static function linkToNet()\n\t{\n\t\tif(!Loader::includeModule('socialservices'))\n\t\t\treturn false;\n\n\t\tif(self::isLinkedToNet())\n\t\t\treturn true;\n\n\t\t$result = false;\n\t\t$request = \\Bitrix\\Main\\Context::getCurrent()->getRequest();\n\t\t$host = ($request->isHttps() ? 'https://' : 'http://').$request->getHttpHost();\n\t\t$registerResult = \\CSocServBitrix24Net::registerSite($host);\n\n\t\tif(is_array($registerResult) && isset($registerResult[\"client_id\"]) && isset($registerResult[\"client_secret\"]))\n\t\t{\n\t\t\tOption::set('socialservices', 'bitrix24net_domain', $host);\n\t\t\tOption::set('socialservices', 'bitrix24net_id', $registerResult[\"client_id\"]);\n\t\t\tOption::set('socialservices', 'bitrix24net_secret', $registerResult[\"client_secret\"]);\n\t\t\t$result = true;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function is_needed() {\n\t\tif ( ( $this->context->site_represents === 'person' ) || is_author() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function getCustomerIsContactAttribute()\n {\n return Str::contains(strtolower($this->customer_type), 'contact');\n }", "function accouk_is_dev() {\n if(get_site_url(null,null,'https') === \"https://www.andrewchart.co.uk\") {\n return false;\n } else { \n return true;\n }\n}", "static function is_mobile()\n\t{\t\t\n\t\tif(!isset(self::$_libs['user_agent'])){\n\t\t\tself::loadLibrary('SHIN_User_agent', TRUE);\n\t\t}\n\t\treturn self::$_libs['user_agent']->is_mobile();\n\t}", "function jetpack_is_atomic_site() {\n\t$at_options = get_option( 'at_options', array() );\n\treturn ! empty( $at_options ) || defined( 'WPCOMSH__PLUGIN_FILE' );\n}", "public function hasContacts() {\n return $this->_has(7);\n }", "function horizon_contact_section() {\n\t\tget_template_part('inc/partials/homepage', 'contact');\n\t}", "protected function isSuhosinLoadedAndActive() {}", "function rhd_is_mobile() {\n\t$mobile_browser = 0;\n\n\tif (preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|android)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {\n\t $mobile_browser++;\n\t}\n\n\tif ((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml') > 0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))) {\n\t $mobile_browser++;\n\t}\n\n\t$mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'], 0, 4));\n\t$mobile_agents = array(\n\t 'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',\n\t 'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',\n\t 'ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-',\n\t 'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-',\n\t 'newt','noki','oper','palm','pana','pant','phil','play','port','prox',\n\t 'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar',\n\t 'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-',\n\t 'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp',\n\t 'wapr','webc','winw','winw','xda ','xda-');\n\n\tif (in_array($mobile_ua,$mobile_agents)) {\n\t $mobile_browser++;\n\t}\n\n\tif ( array_key_exists( 'ALL_HTTP', $_SERVER ) ) {\n\t\tif (strpos(strtolower($_SERVER['ALL_HTTP']),'OperaMini') > 0) {\n\t\t $mobile_browser++;\n\t\t}\n\t}\n\n\tif (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'windows') > 0) {\n\t $mobile_browser = 0;\n\t}\n\n\tif ( $mobile_browser > 0 ) {\n\t\t$mobile_browser = TRUE;\n\t} else {\n\t\t$mobile_browser = FALSE;\n\t}\n\n\treturn $mobile_browser;\n}", "function contactmod_cron () {\n return true;\n}", "public function hasAuthticket()\n {\n return $this->get(self::AUTHTICKET) !== null;\n }", "public function isHoster()\n\t{\n\t\t$hosters = include('OWNER.php');\n\t\treturn in_array($this->getFullName(), $hosters, true);\n\t}", "public function hasCompanyInfo()\n {\n $result = false;\n if ($this->getField('company') != '' && $this->getField('companyzipcode') != '') {\n $result = true;\n }\n return $result;\n }", "static public function isMailServerUsed()\r\n {\r\n $cfgMailSrvService = Warecorp_Config_Loader::getInstance()->getAppConfig('cfg.instance.xml')->{'mailsrv'};\r\n return $cfgMailSrvService->use && ( $cfgMailSrvService->use == 1 || $cfgMailSrvService->use == 'true' );\r\n }", "public function siteHead() {\n\t\t$webhook = $this->getValue('page');\n\t\tIF($this->webhook($webhook)) {\n\t\t $html = '';\n\t\t $css = THEME_DIR_CSS . 'contact3.css';\n\t\t IF(file_exists($css)) {\n\t\t\t$html .= Theme::css('css' . DS . 'contact3.css');\n\t\t } else {\n\t\t\t$html .= '<link rel=\"stylesheet\" href=\"' .$this->htmlPath(). 'layout' . DS . 'contact3.css\">' .PHP_EOL;\n\t\t }\n\n\t\t IF($this->getValue('google-recaptcha')){\n\t\t\t$html .= '<script src=\"https://www.google.com/recaptcha/api.js\"></script>';\n\t\t }\n\n\t\t return $html;\n\t\t}\n\n\t\t$webHookForBookingLog = $this->getValue('bookingsDisplayPage');\n\t\tIF($this->webhook($webHookForBookingLog)) {\n\t\t\t// Include plugin's CSS files\n\t\t\t$html = $this->includeCSS('BookingForm.css');\n\t\t\t\n\t\t\treturn $html;\n\t\t}\n\t}", "private function checkDomain() {\n return true;\n }", "public function is_home();", "public function hasContacts() {\n return $this->_has(6);\n }", "function is_primary_contact($contact_id = '')\n{\n if (!is_numeric($contact_id)) {\n $contact_id = get_contact_user_id();\n }\n\n if (total_rows('tblcontacts', array(\n 'id' => $contact_id,\n 'is_primary' => 1\n )) > 0) {\n return true;\n }\n\n return false;\n}", "function cj_authorship_check()\n{\n if (get_site_option(CJ_AUTHORSHIP_VERSION_OPTION) != \\CJ_Authorship\\CJ_Authorship_Handler::VERSION) {\n cj_authorship_install();\n }\n}", "function wp_ajax_health_check_dotorg_communication()\n {\n }", "private function wp_rocket_cloudflare_enabled() {\n\t\tif (function_exists('rocket_set_real_ip_cloudflare')) {\n\t\t\treturn true;\n\t\t}\n\t\treturn;\n\t}", "function is_robot(){\n\n\t\treturn (new user_agent)->is_robot();\n\n\t}", "public function isHeadManager()\n {\n return UserHeadManager::find()->andWhere('id=' . $this->user_id)->exists();\n }", "function is_guest_on_fangate(){\n\tglobal $gianism;\n\treturn $gianism->fb->is_guest_on_fangate();\n}", "public function contact() {\n $this->getView('navigation', array('pagename' => 'Contact'));\n $random = substr(md5(rand()), 0, 7);\n $this->getView('contact',array('cap' => $random));\n }", "public static function hostMatched() {\n\t\t// TODO: add third-party comparison\n\t\t$return = TRUE;\n\t\treturn TRUE;\n\t\tif (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_SERVER['HTTP_REFERER']) && isset($_SERVER['HTTP_HOST'])) {\n\t\t\tlist(, , $referer_host) = explode('/', $_SERVER['HTTP_REFERER'], 4);\n\t\t\tif ($_SERVER['HTTP_HOST'] != $referer_host) {\n\t\t\t\t// Request came from a different site.\n\t\t\t\t$return = FALSE;\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}", "public function isUsingMailList()\n\t{\n\t\treturn !empty($this->_modSettings['maillist_enabled']) && !empty($this->_modSettings['pbe_post_enabled']);\n\t}", "private function _isEnvisSet(){\n\t\t/* Variable initialization */\n\t\t$blnIsSet\t= true;\n\t\t\n\t\t/* if setup configuration is not done then then do needful */\n\t\tif($this->getEnvSetupConfigured() == 0){\n\t\t\t/* value overriding */\n\t\t\t$blnIsSet\t= false;\n\t\t}\n\t\t\n\t\t/* Redirect to set-up module */\n\t\tif((!$blnIsSet) && ($this->uri->segment(1) != 'settings' && $this->uri->segment(1) != 'mod' && $this->uri->segment(1) != 'manage_widgets' && $this->uri->segment(1) != 'manage-widgets' && $this->uri->segment(1) != 'social_wall' && $this->uri->segment(1) != 'social-wall')){\n\t\t\t/* redirecting to login */\n\t\t\tredirect(SITE_URL.'settings/setup');\n\t\t}\n\t}", "function comprobar_web($web){\n\t\tif(preg_match('/^http\\:\\/\\/www\\.[A-Za-z0-9-.]+\\.[A-Za-z]{2,4}$/', $web)){ \n\t\t\treturn 0; \n\t\t}else\n\t\t\treturn 1;\n\t}", "public function is_home()\n {\n }", "static public function isWebDocument() {\n return isset($_SERVER[\"HTTP_HOST\"]);\n }", "protected function isIntranet()\n {\n return false;\n }", "function can_process()\n{\n global $controller, $Mode;\n if ( strlen( $_POST[ 'reported_by' ] ) > 0 )\n {\n return\n (!is_empty( $_POST[ 'gate_code' ], 'Superior Response' )) &&\n (!is_empty( $_POST[ 'superior_confirmed' ], 'Superior Confirmation' )) &&\n (!is_empty( $_POST[ 'superior_comments' ], 'Superior Comments' ))\n ;\n }\n else\n {\n return\n (!is_empty( $_POST[ 'gate_code' ], 'Employee Response' )) &&\n (!is_empty( $_POST[ 'employee_confirmed' ], 'Employee Confirmation' )) &&\n (!is_empty( $_POST[ 'employee_comments' ], 'Employee Comments' ))\n ;\n }\n}", "function validateEmail($TO,$SUBJECT,$BODY,$headers){\r\n\r\n if(!$this->getAccessLevel() > 0) {echo 'false'; return false;}\r\n\r\n //$server = \"http://localhost/dev/pansophy\"; // dev server\r\n $server = \"http://pansophy.wooster.edu\";\r\n $referer = $_SERVER['HTTP_REFERER'];\r\n\t\t\r\n // check if server string is a substring of the referer string\r\n $pos = strpos($referer,$server);\r\n\r\n if($pos === false)\r\n return false;\r\n else if($pos == 0)\r\n return true;\r\n else \r\n return false;\r\n\t}", "public function authorize()\n {\n $contact = $this->route('contact');\n\n return $contact->user_id == auth()->id() || user()->acl < 9;\n }", "public function isFromVendor(): bool;", "function phpfmg_hotlinking_mysite(){\r\n $yes = phpfmg_is_mysite() \r\n && ( empty($_SERVER['HTTP_REFERER']) || false === strpos( strtolower($_SERVER['HTTP_REFERER']),'formmail-maker.com') ) ; // doesn't have referer of mysite\r\n\r\n if( $yes ){\r\n die( \"<b>Access Denied.</b>\r\n <br><br>\r\n You are visiting a form hotlinkink from <a href='http://www.formmail-maker.com'>formmail-maker.com</a> which is not allowed. \r\n Please read the <a href='http://www.formmail-maker.com/web-form-mail-faq.php'>FAQ</a>. \r\n \" );\r\n }; \r\n}", "function application_SupportEmail() {\n\treturn \"Support Lucterios <[email protected]>\";\n}", "function sloodle_autoenrol_enabled_site()\n {\n return (bool)sloodle_get_config('sloodle_allow_autoenrol');\n }", "public function checkEMailSettings ()\n {\n if (self::$cms_type == 'BlackCat') {\n return ((CATMAILER_ROUTINE == 'smtp') && (CATMAILER_SMTP_USERNAME != '') && (CATMAILER_SMTP_PASSWORD != ''));\n }\n else {\n return ((WBMAILER_ROUTINE == 'smtp') && (WBMAILER_SMTP_USERNAME != '') && (WBMAILER_SMTP_PASSWORD != ''));\n }\n }", "public function hasWWW() : bool {\n $host = $this->getHost();\n $www = substr($host, 0, 3);\n\n return $www == 'www';\n }", "function is_robots()\n {\n }", "public function isInsideHead()\r\n\t{\r\n\t\treturn Anowave_Ec_Model_System_Config_Position::GTM_LOCATION_HEAD == (int) Mage::getStoreConfig('ec/config/code_position');\r\n\t}", "protected function isIntranet(): bool\n\t{\n\t\treturn\n\t\t\tisset($this->arResult['SITE']['DOMAIN_ID']['CURRENT']) &&\n\t\t\t(\n\t\t\t\t$this->arResult['SITE']['DOMAIN_ID']['CURRENT'] === '0' ||\n\t\t\t\t$this->arResult['SITE']['DOMAIN_ID']['CURRENT'] === ''\n\t\t\t);\n\t}", "function tc_is_customizing() {\r\n //checks if is customizing : two contexts, admin and front (preview frame)\r\n global $pagenow;\r\n $is_customizing = false;\r\n if ( is_admin() && isset( $pagenow ) && 'customize.php' == $pagenow ) {\r\n $is_customizing = true;\r\n } else if ( ! is_admin() && isset($_REQUEST['wp_customize']) ) {\r\n $is_customizing = true;\r\n }\r\n return $is_customizing;\r\n }", "function wp_is_mobile() {\r\n static $is_mobile;\r\n\r\n if ( isset( $is_mobile ) )\r\n return $is_mobile;\r\n\r\n if ( empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {\r\n $is_mobile = false;\r\n } elseif ( strpos( $_SERVER[ 'HTTP_USER_AGENT' ], 'Mobile' ) !== false // many mobile devices ( all iPhone, iPad, etc. )\r\n || strpos( $_SERVER[ 'HTTP_USER_AGENT' ], 'Android' ) !== false\r\n || strpos( $_SERVER[ 'HTTP_USER_AGENT' ], 'BlackBerry' ) !== false\r\n || strpos( $_SERVER[ 'HTTP_USER_AGENT' ], 'Opera Mini' ) !== false\r\n ) {\r\n $is_mobile = true;\r\n } else {\r\n $is_mobile = false;\r\n }\r\n\r\n return $is_mobile;\r\n }", "function wp_is_mobile()\n {\n }", "function wac_is_vendor($uid=''){\n\t$cUID = (!empty($uid))? $uid : get_current_user_id();\n\tif(is_user_wcmp_vendor( $cUID )){\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function isIdentified()\n {\n return UserAgentInfoPeer::ID_LEVEL_NONE != $this->_id_level;\n }", "public function isResearcher(){\n\t\t$member = Member::CurrentUser();\n\t\t$group = SiteConfig::current_site_config()->ResearchGroup();\n\t\tif($group && $member){\n\t\t\treturn $member->inGroup($group->Code);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\n\t}", "public function hasContactlistTemplatesList()\n {\n return $this->contactlist_templates !== null;\n }", "function has_landing_page() {\n\n\tif ( is_archive() || is_tax() || is_category() || is_tag()) {\n\n\t\tif ( is_date() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$page = get_landing_page();\n\n\t\tif ($page) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\n\treturn false;\n}" ]
[ "0.64701265", "0.6431801", "0.6408887", "0.6329618", "0.6230345", "0.60684264", "0.59196275", "0.5905947", "0.5887736", "0.58697706", "0.58075714", "0.5799408", "0.57529277", "0.5729783", "0.57157534", "0.5710986", "0.56350446", "0.56303716", "0.5629863", "0.56279266", "0.56146926", "0.5575123", "0.5564398", "0.55637294", "0.5561653", "0.5550112", "0.5543633", "0.55421954", "0.55419916", "0.5533266", "0.5529031", "0.55064654", "0.5506457", "0.55024564", "0.5495356", "0.549496", "0.5486306", "0.5480037", "0.5479224", "0.5445902", "0.5443429", "0.54287857", "0.542639", "0.5420698", "0.5401627", "0.53932095", "0.5392594", "0.53898877", "0.5384957", "0.5378138", "0.5352248", "0.534454", "0.5341536", "0.5332517", "0.5329926", "0.5326742", "0.5317011", "0.53130865", "0.53096807", "0.53049594", "0.53043574", "0.53030616", "0.52977234", "0.5297157", "0.5292676", "0.5291614", "0.52915657", "0.5290942", "0.5289566", "0.5276499", "0.52691036", "0.5268375", "0.524405", "0.524324", "0.5240322", "0.52395463", "0.5237673", "0.5230995", "0.5227805", "0.5217936", "0.52178395", "0.5208059", "0.5204348", "0.5203111", "0.51853013", "0.5182072", "0.5179743", "0.51652604", "0.51650476", "0.5162152", "0.51561505", "0.5155716", "0.5151196", "0.5149527", "0.51460546", "0.5142845", "0.5139827", "0.51373607", "0.5133728", "0.51281077" ]
0.6709709
0
Jamie Alnasir, created. Determine whether site is running in RHUL Email mode
function isEmailMode() { if (isset($_POST['msg_text'])) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function isMailMode() {\n return ($this->mode == Notification_NotificationTemplate::MODE_MAIL);\n }", "function templ_fetch_mail_type()\r\n{\r\n\t$tmpdata = get_option('templatic_settings');\r\n\tif(@$tmpdata['php_mail'] == 'php_mail')\r\n\t{\r\n\t\treturn true;\t\r\n\t}\r\n\treturn false;\r\n}", "public static function isBrokenEmailEnvironment() {}", "public function isSendmail()\n {\n }", "public function checkEMailSettings ()\n {\n if (self::$cms_type == 'BlackCat') {\n return ((CATMAILER_ROUTINE == 'smtp') && (CATMAILER_SMTP_USERNAME != '') && (CATMAILER_SMTP_PASSWORD != ''));\n }\n else {\n return ((WBMAILER_ROUTINE == 'smtp') && (WBMAILER_SMTP_USERNAME != '') && (WBMAILER_SMTP_PASSWORD != ''));\n }\n }", "public function getIsEmailHeaderEnabled(): bool;", "public function isMail()\n {\n }", "public function isEmailDisabled()\n {\n return !Mage::getStoreConfigFlag('markdown/markdown/enable_email');\n }", "static public function isMailServerUsed()\r\n {\r\n $cfgMailSrvService = Warecorp_Config_Loader::getInstance()->getAppConfig('cfg.instance.xml')->{'mailsrv'};\r\n return $cfgMailSrvService->use && ( $cfgMailSrvService->use == 1 || $cfgMailSrvService->use == 'true' );\r\n }", "function validateEmail($TO,$SUBJECT,$BODY,$headers){\r\n\r\n if(!$this->getAccessLevel() > 0) {echo 'false'; return false;}\r\n\r\n //$server = \"http://localhost/dev/pansophy\"; // dev server\r\n $server = \"http://pansophy.wooster.edu\";\r\n $referer = $_SERVER['HTTP_REFERER'];\r\n\t\t\r\n // check if server string is a substring of the referer string\r\n $pos = strpos($referer,$server);\r\n\r\n if($pos === false)\r\n return false;\r\n else if($pos == 0)\r\n return true;\r\n else \r\n return false;\r\n\t}", "public function isSendmail() {\n\t\t$this->getSendmail();\n\t}", "public function has_email() {\r\n $options = get_option( 'myhome_redux' );\r\n if ( array_key_exists( 'mh-agent-email_show', $options ) && empty( $options['mh-agent-email_show'] ) ) {\r\n return false;\r\n }\r\n return ! empty( $this->email );\r\n }", "public function isUsingMailList()\n\t{\n\t\treturn !empty($this->_modSettings['maillist_enabled']) && !empty($this->_modSettings['pbe_post_enabled']);\n\t}", "function checkemail() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\t$email = $_REQUEST['data']['Member']['email'];\n\t\t\n\t\t$count = $this->Member->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\t\n\t\tif ($count > 0) {\n\t\t\techo \"false\";\n\t\t} else {\n\t\t\techo \"true\";\n\t\t}\n\t}", "function application_SupportEmail() {\n\treturn \"Support Lucterios <[email protected]>\";\n}", "function email_cron() {\n return true;\n}", "protected function useEmailNotifications()\n {\n return true;\n }", "function email_settings()\r\n\t{\r\n\t\tglobal $ibforums, $std, $print;\r\n\r\n\t\tif ($ibforums->member['disable_mail'])\r\n\t\t{\r\n\t\t\t$ibforums->lang['no_mail'] = sprintf($ibforums->lang['no_mail'], $ibforums->member['disable_mail_reason']);\r\n\r\n\t\t\t$this->output .= View::make(\"global.warn_window\", ['message' => $ibforums->lang['no_mail']]);\r\n\t\t} else\r\n\t\t{\r\n\r\n\t\t\t// PM_REMINDER: First byte = Email PM when received new\r\n\t\t\t// \t\t\tSecond byte= Show pop-up when new PM received\r\n\r\n\t\t\t$info = array();\r\n\r\n\t\t\tforeach (array('hide_email', 'allow_admin_mails', 'email_full', 'email_pm', 'auto_track') as $k)\r\n\t\t\t{\r\n\t\t\t\tif (!empty($this->member[$k]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$info[$k] = 'checked';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$info['key'] = $this->md5_check;\r\n\r\n\t\t\t$this->output .= View::make(\"ucp.email\", ['Profile' => $info]);\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 isEnableAdminEmail ()\n {\n return $this->scopeConfig->isSetFlag(\n 'b2bregistration/admin_notification/admin_notification_enable',\n ScopeInterface::SCOPE_STORE\n );\n }", "public function getPhraseDetectEmail() {\n\n return (bool) $this->phrase_detect_email;\n\n }", "protected function shouldSendEmail(): bool\r\n {\r\n return $this->sendEmail === Boolean::YES;\r\n }", "public function hasEmail() {\n return $this->_has(4);\n }", "function _elastic_email_has_valid_settings() {\n $site_mail = variable_get('site_mail', NULL);\n $username = variable_get(ELASTIC_EMAIL_USERNAME, NULL);\n $api_key = variable_get(ELASTIC_EMAIL_API_KEY, NULL);\n\n if (is_null($site_mail) || $site_mail == '') {\n return FALSE;\n }\n if (is_null($username) || $username == '') {\n return FALSE;\n }\n if (is_null($api_key) || $api_key == '') {\n return FALSE;\n }\n return TRUE;\n}", "private function checkEmailSettings(): bool\n {\n return (is_array($this->properties['mail_recipients']) || is_array($this->properties['mail_bcc']));\n }", "private function testEmail(){\n $this->user_panel->checkSecurity();\n $this->mail_handler->testEmailFunction();\n }", "public function isAutoNotifyEnabled()\n {\n return (Mage::getStoreConfig('easywebshopsms/abandoned_notifications/auto_notify_enable')==0) ? false : true;\n }", "private function mailerNative()\n { \n if( ! mail($this->rcptToCtring, $this->subject, $this->message, $this->header()) ){\n $this->debugMessages[] = 'Error: Sending email failed';\n return false;\n }\n else {\n $this->debugMessages[] = 'Success: Sending email succeeded';\n return true;\n }\n }", "public function _isEnabledShipmentsEmail()\r\n {\r\n return ($this->scopeConfig->getValue(self::EMAIL_SHIPMENTS)) ? true:false ;\r\n }", "function air_helper_mail_delivery_check() {\n if ( class_exists( 'Mailgun' ) && getenv( 'MAILGUN_API_KEY' ) && ( defined( 'MAILGUN_USEAPI' ) && MAILGUN_USEAPI ) ) {\n return true;\n }\n\n // SendGrid for legacy support.\n if ( class_exists( 'Sendgrid_Tools' ) && getenv( 'SENDGRID_API_KEY' ) ) {\n return true;\n }\n\n // Do not show the notice in dev.\n if ( 'development' === wp_get_environment_type() ) {\n return true;\n }\n\n add_action( 'admin_notices', 'air_helper_mail_delivery_not_configured_notice' );\n return false;\n}", "public function is_email() {\n return $this->is_email;\n }", "public function canSend()\n {\n $flag = intval(setting(\"mail_notify_{$this->getTemplateTag()}\"));\n\n return !!$flag;\n }", "public function isEmail();", "public function isQmail()\n {\n }", "public function isCheckEmail()\n {\n if( (!$this -> zgloszePozniej) && ($this -> emailAtt2User == '') ) :\n return false;\n endif;\n return true;\n }", "public function isMail()\n {\n $this->Mailer = 'mail';\n }", "public function _isEnabledInvoiceEmail()\r\n {\r\n return ($this->scopeConfig->getValue(self::EMAIL_INVOICE)) ? true:false ;\r\n }", "function theme_haarlem_is_extranet() {\n\n\tstatic $result;\n\t\n\tif (isset($result)) {\n\t\treturn $result;\n\t}\n\t\n\t$result = false;\n\tif (elgg_get_plugin_setting('is_extranet', 'theme_haarlem_intranet') == 'yes') {\n\t\t$result = true;\n\t}\n\t\n\treturn $result;\n}", "static public function IsOutlook() {\n return (self::GetDeviceType() == \"WindowsOutlook\");\n }", "function notify_addon_enabled_from_admin_panel() {\n return ( (!!qa_opt('qw_enable_email_notfn')) &&\n (\n (!!qa_opt('qw_notify_cat_followers')) ||\n (!!qa_opt('qw_notify_tag_followers')) ||\n (!!qa_opt('qw_notify_user_followers'))\n )\n );\n }", "public function checkAcquiaHosted() {\n return isset($_SERVER['AH_SITE_ENVIRONMENT'], $_SERVER['AH_SITE_NAME']);\n }", "public function notificationsafeenvrnmnt(){\n $this->load->model('resident/maintainsafeenvironment_model', 'seadl');\n return $this->seadl->safeenvrnmntnotifications();\n //return false;\n }", "function erp_is_smtp_enabled() {\n $erp_email_smtp_settings = get_option( 'erp_settings_erp-email_smtp', [] );\n\n if ( isset( $erp_email_smtp_settings['enable_smtp'] ) && filter_var( $erp_email_smtp_settings['enable_smtp'], FILTER_VALIDATE_BOOLEAN ) ) {\n return true;\n }\n\n return false;\n}", "function checkemail() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t\n\t\t$email = $_REQUEST['data']['Member']['email'];\n\t\t\n\t\t$count = $this->Member->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\t/*echo $count;\n\t\tdie;*/\n\t\tif ($count > 0) {\n\t\t\techo \"false\";\n\t\t} else {\n\t\t\techo \"true\";\n\t\t}\n\t}", "function opanda_show_mymail_html() {\r\n \r\n if ( !defined('MYMAIL_VERSION') ) {\r\n ?>\r\n <div class=\"form-group\">\r\n <label class=\"col-sm-2 control-label\"></label>\r\n <div class=\"control-group controls col-sm-10\">\r\n <p><strong><?php _e('The MyMail plugin is not found on your website. Emails will not be saved.', 'opanda') ?></strong></p>\r\n </div>\r\n </div>\r\n <?php\r\n } else {\r\n ?>\r\n <div class=\"form-group\">\r\n <label class=\"col-sm-2 control-label\"></label>\r\n <div class=\"control-group controls col-sm-10\">\r\n <p><?php _e('You can set a list where the subscribers should be added in the settings of a particular locker.', 'opanda') ?></p>\r\n </div>\r\n </div>\r\n <?php\r\n }\r\n}", "function set_email_to_html(){\n\treturn true;\n}", "protected function isMailingEnabled()\n {\n if ($this->user->email === \"\") {\n return false;\n }\n return true;\n }", "public function preLaunching() {\n\t\t\n\t\t$emailTo \t= Input::get('email');\n\t\t$filename = base_path().'/public/prelaunching.txt';\t\n\t\t$vars = array(\n\t\t\t'email'\t\t=>\t$emailTo\n\t\t);\n\n\t\t$bytesWritten = File::append($filename, $emailTo.\"\\n\");\n\t\tif ($bytesWritten === false)\n\t\t{\n\t\t return ['status' => false];\n\t\t}\n\t\t\n EmailTemplate::SendByKey('prelaunching', $vars, $emailTo);\n\t\t\n\t\treturn ['status' => true];\n }", "public function getUseCertifiedMailMail() : bool\n\t{\n\t\treturn $this->useCertifiedMail;\n\t}", "public function should_send_email() {\n\t\t$options = get_option( 'mylisting_notifications', [] );\n\t\t$notification = $this->get_key();\n\t\t$should_send = true;\n\n\t\tif ( isset( $options[ $notification ], $options[ $notification ]['send_email'] ) && $options[ $notification ]['send_email'] === 'disabled' ) {\n\t\t\t$should_send = false;\n\t\t}\n\n\t\treturn apply_filters( sprintf( 'mylisting/emails/%s:enabled', $notification ), $should_send );\n\t}", "public function testemailsetupAction(){\n $to = '[email protected]';\n $subject = 'the subject';\n $message = 'hello';\n $headers = 'From: [email protected]' . \"\\r\\n\" .\n 'Reply-To: [email protected]' . \"\\r\\n\" .\n 'X-Mailer: PHP/' . phpversion();\n date_default_timezone_set('America/Chicago');\n\n $mail = mail($to, $subject, $message, $headers);\n if($mail){\n echo \"YES\";\n\n } else{\n echo \"NO\";\n }\n //noResponse\n $this->getHelper('ViewRenderer')->setNoRender();\n }", "public function send() {\n\t\t//$isActive = EmailHelper::isActive('string parameter');\n\n\t\t// this is the refactored external static method\n\t\t$isActive = forward_static_call_array(\n\t\t\tarray($this->emailHelperClass, 'isActive'),\n\t\t\tarray('string parameter'));\n\n\t\tif($isActive) {\n\t\t\t// send logic here\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function practice2()\n {\n dump(config('mail.supportEmail'));\n }", "public function checkEmail() {\n $result = $this->model->checkEmail($_POST);\n if($result) {\n echo \"true\"; \n } else {\n echo \"false\";\n }\n }", "function sloodle_autoenrol_enabled_site()\n {\n return (bool)sloodle_get_config('sloodle_allow_autoenrol');\n }", "public static function generatesMissingEmails(): bool\n {\n return static::enabled(static::generateMissingEmails());\n }", "function send_email($to,$subject,$html,$text,$bcc_admin){\r\n\r\n\t\tif(!is_array($to)) $to = array($to);\r\n\r\n\t\tif($GLOBALS['server_info']['environment']=='dev') return true;\r\n\r\n\t\t@include_once($GLOBALS['server_info']['physical_root'].'inc/htmlMimeMail5/htmlMimeMail5.php');\r\n\t\t@include_once('/var/www/monrovia.com/root/inc/htmlMimeMail5/htmlMimeMail5.php');\t\t\t\t// LIVE\r\n\t\t@include_once('/var/www/vhosts/tpgphpdev1.net/httpdocs/inc/htmlMimeMail5/htmlMimeMail5.php');\t// STAGING\r\n\r\n\t\t$mail = new htmlMimeMail5();\r\n\t\t$mail->setHTMLCharset('UTF-8');\r\n\t\t$mail->setHeadCharset('UTF-8');\r\n\t\t$mail->setTextCharset('UTF-8');\r\n\t\t//if($_SERVER[\"HTTP_HOST\"]!='') $mail->setFrom('Monrovia Website <[email protected]>');\r\n\t\tif($GLOBALS['server_info']['environment']=='prod') $mail->setFrom('Monrovia Website <[email protected]>');\r\n\t\t$mail->setSubject($subject);\r\n\r\n\t\tif($text=='') $text = $html;\r\n\r\n\t\t$mail->setText($text);\r\n\t\t$mail->setHTML($html);\r\n\t\tif($GLOBALS['admin_email']!=''&&$bcc_admin&&$GLOBALS['admin_email']!=$to[0]) $mail->setBcc($GLOBALS['admin_email']);\r\n\t\t$result = @$mail->send($to);\r\n\t\treturn ($result===true);\r\n\t}", "public function verifyEmail()\n {\n return $this->getBoolean('verify_email');\n }", "public function hasEmail(): bool;", "function email_ok($email,$new=FALSE){\n if(empty($email)) return FALSE;\n if(!preg_match($this->pat_email,$email)) return FALSE;\n if(!$new) return TRUE;\n foreach($this->domains as $umd)\n if($umd->newemail_ok($email)>0) return FALSE;\n return TRUE;\n }", "function isRHULApp() {\n\n\tif (isset($_GET['RHUL_App'])) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n}", "function misc()\n\t{\n\t\tif (!cron_installed()) attach_message(do_lang_tempcode('CRON_NEEDED_TO_WORK',escape_html(brand_base_url().'/docs'.strval(ocp_version()).'/pg/tut_configuration')),'warn');\n\n\t\trequire_code('templates_donext');\n\t\treturn do_next_manager(get_page_title('WELCOME_EMAILS'),comcode_lang_string('DOC_WELCOME_EMAILS'),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t/*\t type\t\t\t\t\t\t\t page\t params\t\t\t\t\t\t\t\t\t\t\t\t\t zone\t */\n\t\t\t\t\t\tarray('add_one',array('_SELF',array('type'=>'ad'),'_SELF'),do_lang('ADD_WELCOME_EMAIL')),\n\t\t\t\t\t\tarray('edit_one',array('_SELF',array('type'=>'ed'),'_SELF'),do_lang('EDIT_WELCOME_EMAIL')),\n\t\t\t\t\t),\n\t\t\t\t\tdo_lang('WELCOME_EMAILS')\n\t\t);\n\t}", "public function isSMTP()\n {\n }", "public function isMail(): bool\n\t{\n\t\treturn $this->isOfType( static::TYPE_MAIL );\n\t}", "Public Function IsSelfHosted()\n\t{\n\t\tif(class_exists('Zend_Registry'))\n\t\t{\n\t\t\tif(Zend_Registry::get('Application/Mode') == 'SelfHosted')\n\t\t\t{\n\t\t\t\treturn '0';\n\t\t\t}\n\t\t}\n\t\treturn $this->isSelfHosted;\t\n\t}", "function sloodle_autoreg_enabled_site()\n {\n return (bool)sloodle_get_config('sloodle_allow_autoreg');\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}", "protected function _checkSendEmail()\n {\n // get the last shipment time\n $shipment = Mage::getResourceModel('sales/order_shipment_collection')\n ->addAttributeToSelect('created_at')\n ->addAttributeToFilter('store_id', $this->_storeId)\n ->setOrder('created_at', 'DESC')\n ->setPageSize(1)\n ->setCurPage(1);\n\n if ($shipment->count() != 0) {\n $lastShipment = $shipment->getFirstItem();\n $shipmentTime = $lastShipment->getCreatedAt();\n\n if ($shipmentTime) {\n return $this->_helper->checkAddAlert(\n $shipmentTime,\n $this->_helper->getConfig(\n NoShipmentsAlert_Helper_Data::PATH_ALERT_TIME,\n $this->_storeId\n ),\n NoShipmentsAlert_Helper_Data::ALERT_TYPE,\n $this->_storeId\n );\n }\n } else {\n // no records exist check monitor start date in config\n // to determine if an alert should be sent\n $startDate = $this->_helper->getConfig(\n NoShipmentsAlert_Helper_Data::PATH_START_DATE,\n $this->_storeId\n );\n if ($startDate) {\n return $this->_helper->checkAddAlert(\n $startDate,\n $this->_helper->getConfig(\n NoShipmentsAlert_Helper_Data::PATH_ALERT_TIME,\n $this->_storeId\n ),\n NoShipmentsAlert_Helper_Data::ALERT_TYPE,\n $this->_storeId\n );\n }\n }\n\n return false;\n }", "function mailcontrol($mailToValidate) \n\t{ \n $regexp = \"^[_a-z0-9-]+(\\.[a-z0-9-]+)*@([0-9a-z][0-9a-z-]*[0-9a-z]\\.)+[a-z]{2}[mtgvu]?$\"; \n if(eregi($regexp,$mailToValidate)) { \n return 1; \n }else{ \n return 0; \n } \n\t}", "public function emailnotification($args)\n {\n // Extract expected variables\n $to_uid = $args['to_uid'];\n $from_uid = $args['from_uid'];\n $subject = $args['subject'];\n\n // First check if the Mailer module is avaible\n if(!ModUtil::available('Mailer')) {\n return true;\n }\n\n // Then check if admin allowed email notifications\n $allow_emailnotification = ModUtil::getVar('InterCom', 'messages_allow_emailnotification');\n if ($allow_emailnotification != 1) {\n return true;\n }\n\n // check the user attributes for userprefs\n $user = DBUtil::selectObjectByID('users', $to_uid, 'uid', null, null, null, false);\n if (!is_array($user)){\n // WTF, no user data?\n return true;\n }\n\n if (!isset($user['__ATTRIBUTES__']) || (!isset($user['__ATTRIBUTES__']['ic_note'])\n && !isset($user['__ATTRIBUTES__']['ic_ar'])\n && !isset($user['__ATTRIBUTES__']['ic_art']))) {\n // ic_note: email notifiaction yes/no\n // ic_ar : autoreply yes/no\n // ic_art : autoreply text\n // load values from userprefs tables and store them in attributes\n // get all tables from the database, tbls is a non-assoc array\n $tbls = DBUtil::metaTables();\n // if old intercom_userprefs table exists, try to read the values for user $to_uid\n $olduserprefs = in_array('intercom_userprefs', $tbls);\n if ($olduserprefs == true) {\n $userprefs = DBUtil::selectObjectByID('intercom_userprefs', $to_uid, 'user_id');\n }\n if (is_null($userprefs)) {\n // userprefs table does not exist or userprefs for this user do not exist, create them with defaults\n $user['__ATTRIBUTES__']['ic_note'] = 0;\n $user['__ATTRIBUTES__']['ic_ar'] = 0;\n $user['__ATTRIBUTES__']['ic_art'] = '';\n } else {\n $user['__ATTRIBUTES__']['ic_note'] = $userprefs['email_notification'];\n $user['__ATTRIBUTES__']['ic_ar'] = $userprefs['autoreply'];\n $user['__ATTRIBUTES__']['ic_art'] = $userprefs['autoreply_text'];\n }\n // store attributes\n DBUtil::updateObject($user, 'users', '', 'uid');\n // delete entry in userprefs table\n if ($olduserprefs == true) {\n DBUtil::deleteObjectByID('intercom_userprefs', $to_uid, 'user_id');\n }\n }\n\n if ($user['__ATTRIBUTES__']['ic_note'] != 1) {\n return true;\n }\n\n // Get the needed variables for the mail\n\n $renderer = Zikula_View::getInstance('InterCom', false);\n $renderer->assign('message_from',UserUtil::getVar('uname', $from_uid));\n $renderer->assign('subject', $subject);\n $renderer->assign('viewinbox', ModUtil::url('InterCom', 'user', 'inbox'));\n $renderer->assign('prefs', ModUtil::url('InterCom', 'user', 'settings'));\n $renderer->assign('baseURL', System::getBaseUrl());\n\n $message = $renderer->fetch(\"mail/emailnotification.tpl\");\n\n $fromname = ModUtil::getVar('InterCom', 'messages_fromname');\n if ($fromname == '') {\n $fromname = System::getVar('sitename');\n }\n\n $fromaddress = ModUtil::getVar('InterCom', 'messages_from_email');\n if ($fromaddress == '') {\n $fromaddress = System::getVar('adminmail');\n }\n\n $modinfo = ModUtil::getInfo(ModUtil::getIdFromName('InterCom'));\n $args = array( 'fromname' => $fromname,\n 'fromaddress' => $fromaddress,\n 'toname' => UserUtil::getVar('uname', $to_uid),\n 'toaddress' => UserUtil::getVar('email', $to_uid),\n 'subject' => ModUtil::getVar('InterCom', 'messages_mailsubject'),\n 'body' => $message,\n 'headers' => array('X-Mailer: ' . $modinfo['name'] . ' ' . $modinfo['version']));\n ModUtil::apiFunc('Mailer', 'user', 'sendmessage', $args);\n return true;\n }", "function _check_member_event_options()\n\t{\n\t\t$rules['module_affiliate_marketing_member_events_alert_email'] = 'trim|valid_email';\n\t\t\n\t\t$this->validation->set_rules($rules);\n\t\t\n\t\t$fields['module_affiliate_marketing_member_events_alert_email'] = $this->lang->line('email');\n\t\t\n\t\t$this->validation->set_fields($fields);\n\t\t\t\n\t\tif ($this->validation->run() == FALSE)\t\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function process_mail(){\n\t\t$result = true;\n\t\t\n\t\tif(count($this->to) < 1){\n\t\t\treturn 'No email address.';\n\t\t}\n\t\t$this->set_eol();\n\t\t$this->get_message_type();\n\t\t$this->set_boundary();\n\t\t$headers = $this->set_headers();\n\t\t$body = $this->set_body();\n\t\t\n\t\tif($body == ''){\n\t\t\treturn 'Empty email body.';\n\t\t}\n\t\t$result = $this->send_mail($headers, $body);\n\t\treturn $result;\n\t}", "private static function canRemoveEmail() {\n\t\treturn\n\t\t\tRights::hasRight(Right::getByName('Premanager', 'registerWithoutEmail'));\n\t}", "public function hasEmailAddress()\n {\n return $this->_hasVar('user_email') && $this->_getVar('user_email');\n }", "public function isNewsletterPopUpEnable() \n {\n return (bool) Mage::getStoreConfig(self::XML_PATH_ENABLE);\n }", "public function getEmailOnBrokenLinkOnly() {}", "function bp_group_email_get_capabilities() {\r\n if ( bp_group_is_admin() || bp_group_is_mod() ) { \r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function isAutocreateNotification()\n {\n return (1 == $this->getConfig('autocreate/autocreate_notify'));\n }", "function erp_is_imap_active() {\n $options = get_option( 'erp_settings_erp-crm_email_connect_imap', [] );\n\n $imap_status = (boolean) isset( $options['imap_status'] ) ? $options['imap_status'] : 0;\n $enable_imap = ( isset( $options['enable_imap'] ) && $options['enable_imap'] == 'yes' ) ? true : false;\n\n if ( $enable_imap && $imap_status ) {\n return true;\n }\n\n return false;\n}", "public function isEmailRegistered()\n {\n return $this->isEmailAvailable($this->getEmailAddress());\n\n }", "public function is_needed() {\n\t\treturn $this->context->site_represents === 'company';\n\t}", "function email_support(): string\n{\n $macros = [];\n foreach (splitOption('defines') as $define) {\n $pos = strpos($define, '=');\n $macros[substr($define, 0, $pos)] = substr($define, $pos + 1);\n }\n// return getOption('support_email');\n return array_key_exists('support', $macros) ? $macros['support'] : '';\n}", "function CronEnabled($autoresponder_check=false)\n\t{\n\t\t/**\n\t\t * If cron isn't enabled at all, return straight away.\n\t\t */\n\t\tif (!SENDSTUDIO_CRON_ENABLED) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * If we're just checking autoresponders, then check that particular variable.\n\t\t */\n\t\tif ($autoresponder_check) {\n\t\t\tif (SENDSTUDIO_CRON_AUTORESPONDER > 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * If we're not just checking autoresponders, return true\n\t\t * as we're just checking whether cron is working or not.\n\t\t */\n\t\treturn true;\n\t}", "function checkEmail()\n {\n\t\t\t$email = $_POST['email'];\n\n\t\t\t// Check its existence (for example, execute a query from the database) ...\n\t\t\t$email_cek = $this->account_model->Check_TblUsers('email',$email);\n\t\t\t\n\t\t\tif($email_cek == 0)\n\t\t\t{\n\t\t\t\t$isAvailable = true;\n\t\t\t}else{\n\t\t\t\t$isAvailable = False;\n\t\t\t} \n\n\t\t\t// Finally, return a JSON\n\t\t\techo json_encode(array(\n\t\t\t\t'valid' => $isAvailable,\n\t\t\t));\n\t\t}", "public function is_email_template_enabled( $template = 'send' ) {\n\n\t\t\tif ( 'combine' === $template ) {\n\t\t\t\t$wc_email_settings_key = 'woocommerce_wc_sc_combined_email_coupon_settings';\n\t\t\t\t$sc_email_setting_key = 'smart_coupons_combine_emails';\n\t\t\t\t$default = 'no';\n\t\t\t} else {\n\t\t\t\t$wc_email_settings_key = 'woocommerce_wc_sc_email_coupon_settings';\n\t\t\t\t$sc_email_setting_key = 'smart_coupons_is_send_email';\n\t\t\t\t$default = 'yes';\n\t\t\t}\n\n\t\t\t$is_email_enabled = '';\n\n\t\t\t$wc_email_settings = get_site_option( $wc_email_settings_key );\n\n\t\t\t// If setting is not found in WC Email settings fetch it from SC admin settings.\n\t\t\tif ( false === $wc_email_settings ) {\n\t\t\t\t$is_email_enabled = get_site_option( $sc_email_setting_key, $default );\n\t\t\t} elseif ( is_array( $wc_email_settings ) && ! empty( $wc_email_settings ) ) {\n\t\t\t\t$is_email_enabled = ( isset( $wc_email_settings['enabled'] ) ) ? $wc_email_settings['enabled'] : $default;\n\t\t\t}\n\n\t\t\treturn $is_email_enabled;\n\t\t}", "function test_offer_email() {\n\t\t$this->autoRender = false;\n\t\tif(isset($this->data)) {\n\t\t\t\t$advertiser = unserialize($this->data['Cronemail']['array_string']);\n\t\t\t\t$content = '';\n\t\t\t\t$content .= '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>Zuni Merchant Page / Everyday Savings Offers</title></head><body style=\"margin:0px; padding:0px; font-size:0; \">';\n\t\t\t\t$content .= $this->offerhtml->email_header();\n\t\t\t\t$content .= $this->offerhtml->email_box();\n\t\t\t\t$content .= $this->offerhtml->email_content($advertiser);\n\t\t\t\t$content .= $this->offerhtml->email_footer().'</body></html>';\n\n\t\t\t\t$this->Email->sendAs = 'html';\n\t\t\t\t$this->Email->to = $this->data['Cronemail']['email'];\n\t\t\t\t$this->Email->subject = $this->common->getOfferEmailSubject();//'Zuni Merchant Page / Everyday Savings Offers';\n\t\t\t\t$this->Email->replyTo = $this->common->getReturnEmail();\n\t\t\t\t$this->Email->from = $this->common->getFromName().' <'.$this->common->getSalesEmail().'>';\n\t\t\t\t\n\t\t\t\t$this->body = '';\n\t\t\t\t$this->body .= $content;\n\t\t\t\t\n\t\t\t\t$this->Email->smtpOptions = array(\n\t\t\t\t\t'port'=>'25',\n\t\t\t\t\t'timeout'=>'30',\n\t\t\t\t\t'host' =>SMTP_HOST_NAME,\n\t\t\t\t\t'username'=>SMTP_USERNAME,\n\t\t\t\t\t'password'=>SMTP_PASSWORD\n\t\t\t\t);\n\t\t\t\t/* Set delivery method */\n\t\t\t\t$this->Email->delivery = 'smtp';\n\t\t\t\t/* Do not pass any args to send() */\n\t\t\t\t$this->Email->send($this->body);\n\t\t\t}\n\t\t\t$this->Session->setFlash('Test email sent successfully.');\n\t\t\tif(strpos($this->referer(),'ronemails/view')) {\n\t\t\t\t$this->redirect($this->referer());\n\t\t\t} else {\n\t\t\t\t$this->redirect(array('action'=>'index'));\n\t\t\t}\n\t}", "private function sendNotifyEmail(){\n $uS = Session::getInstance();\n $to = filter_var(trim($uS->referralFormEmail), FILTER_SANITIZE_EMAIL);\n\n try{\n if ($to !== FALSE && $to != '') {\n// $userData = $this->getUserData();\n $content = \"Hello,<br>\" . PHP_EOL . \"A new \" . $this->formTemplate->getTitle() . \" was submitted to \" . $uS->siteName . \". <br><br><a href='\" . $uS->resourceURL . \"house/register.php' target='_blank'>Click here to log into HHK and take action.</a><br>\" . PHP_EOL;\n\n $mail = prepareEmail();\n\n $mail->From = ($uS->NoReplyAddr ? $uS->NoReplyAddr : \"[email protected]\");\n $mail->FromName = htmlspecialchars_decode($uS->siteName, ENT_QUOTES);\n $mail->addAddress($to);\n\n $mail->isHTML(true);\n\n $mail->Subject = \"New \" . Labels::getString(\"Register\", \"onlineReferralTitle\", \"Referral\") . \" submitted\";\n $mail->msgHTML($content);\n\n if ($mail->send() === FALSE) {\n return false;\n }else{\n return true;\n }\n }\n }catch(\\Exception $e){\n return false;\n }\n return false;\n }", "function ms_site_check()\n {\n }", "function getEmailSubject() { return 'JS BUILDER'; }", "public function is_mailer_complete() {\n\n\t\tif ( ! $this->is_php_compatible() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$auth = new Auth();\n\n\t\tif (\n\t\t\t$auth->is_clients_saved() &&\n\t\t\t! $auth->is_auth_required()\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isEmailVerified()\n {\n return $this->is_verified === \"Y\";\n }", "function mkCheckServer($email)\n {\n // no validation if OS is Windows, return true\n if (defined(\"PHP_OS\") && !strcmp(substr(PHP_OS, 0, 3), \"WIN\")) return array(true, \"This method is not supported on Windows systems\");\n list($user, $domain) = split(\"@\", $email, 2);\n $mxlist = false;\n if ($this->checkserv) {\n @getmxrr($domain, $mxlist);\n $result = array(false, $domain . \" Mailserver not found\");\n if ($mxlist) {\n foreach ($mxlist as $mx) {\n $fp = fsockopen($mx, 25, $errno, $errstr, 20);\n if (!$fp) continue;\n socket_set_blocking($fp, false);\n $s = 0;\n $c = 0;\n $out = \"\";\n do {\n $out = fgets($fp, 2500);\n if (ereg(\"^220\", $out)) {\n $s = 0;\n $out = \"\";\n $c++;\n } else {\n if (($c > 0 && $out == \"\")) break;\n else $s++;\n if ($s > 9999) break;\n }\n } while ($out == \"\");\n socket_set_blocking($fp, true);\n fputs($fp, \"HELO ActiveMail\\n\");\n $out = fgets($fp, 3000);\n fputs($fp, \"MAIL FROM: $this->knownmail\\n\");\n $out = fgets($fp, 3000);\n fputs($fp, \"RCPT TO: $email\\n\");\n $out = fgets($fp, 3000);\n if (ereg(\"^250\", $out)) $result = array(true, $out);\n else $result = array(false, $out);\n fputs($fp, \"quit\\n\");\n fclose($fp);\n if ($result[0]) break;\n }\n } else $result = array(false, $email . \" Function getmxrr() not supported or Mailserver not found\");\n } else $result = array(true, $email . \" Mailserver not checked\");\n return $result;\n }", "public static function TestSiteOverridingAddress()\n\t{\n\t\treturn static::config()->admin_email_to;\n\t}", "function m_dspemails()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_EMAIL_FILE\",$this->emailTemplate);\n\n\t\t#SETTING ALL TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_EMAIL_BLK\", \"email_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_MESSAGE_BLK\", \"message_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_MSG_BLK1\", \"msg_blk1\");\n\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SALESURL\",SITE_URL.\"sales/\");\n\n\t\t#INTAILIZING ***\n\t\t$this->ObTpl->set_var(\"email_blk\",\"\");\t\n\t\t$this->ObTpl->set_var(\"message_blk\",\"\");\t\n\t\t$this->ObTpl->set_var(\"msg_blk1\",\"\");\t\n\t\t$this->ObTpl->set_var(\"msg_blk2\",\"\");\t\n\n\t\t$this->request['msg']=$this->libFunc->ifSet($this->request,\"msg\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",\"\");\n\n\t\t#DATABASE QUERY\n\t\t$this->obDb->query = \"SELECT * FROM \".EMAILS;\n\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t$campaigncount = $this->obDb->record_count;\n\t\tif($this->request['msg']==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_INSERTED);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\t\telseif($this->request['msg']==3)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_DELETED);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\t\telseif($this->request['msg']==5)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_SENT);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\n\t\tif($campaigncount>0)\n\t\t{\n\t\t\t#PARSING DISCOUNT BLOCK\n\t\t\tfor($j=0;$j<$campaigncount;$j++)\n\t\t\t{\t\t\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iMailid_PK);\n\t\t\t\tif ($queryResult[$j]->vUserList==\"All\"){\n $this->obDb->query = \"SELECT count(*) as cnt FROM \".CUSTOMERS.\" WHERE iStatus=1 AND iMailList !=0\";\n }else{ \n $this->obDb->query = \"SELECT count(*) as cnt FROM \".LEADLIST.\" WHERE iLeadId_FK='\". $queryResult[$j]->vUserList.\"'\";\n }\n\t\t\t\t$qryRs = $this->obDb->fetchQuery();\n\t\t\t\t\n\t\t\t\tif ($queryResult[$j]->vVisitorList==\"1\"){\n $this->obDb->query = \"SELECT count(*) as cnt FROM \".NEWSLETTERS;\n\t\t\t\t $qryVs = $this->obDb->fetchQuery();\n\t\t\t\t $qryRs[0]->cnt = $qryRs[0]->cnt + $qryVs[0]->cnt;\n }\n\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_USERCOUNT\",$qryRs[0]->cnt);\n \n $this->ObTpl->set_var(\"TPL_VAR_SUBJECT\",$this->libFunc->m_displayContent($queryResult[$j]->vSubject));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SID\",$this->libFunc->m_displayContent($queryResult[$j]->vSid));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_BUILDDATE\",$this->libFunc->dateFormat2($queryResult[$j]->tmBuildDate));\t\n\t\t\t\t$sentDate=$this->libFunc->dateFormat2($queryResult[$j]->tmSentDate);\n\t\t\t\tif(empty($sentDate))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",\"Send now\");\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_VIEWLABEL\",\"View/Sent\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",$sentDate);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_VIEWLABEL\",\"View\");\n\t\t\t\t}\n\t\t\t\t$this->ObTpl->parse(\"email_blk\",\"TPL_EMAIL_BLK\",true);\n\t\t\t}\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",$campaigncount.\" records found\");\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",MSG_NOEMAILS);\n\t\t\t$this->ObTpl->parse(\"message_blk\",\"TPL_MESSAGE_BLK\");\n\t\t}\n\t\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_EMAIL_FILE\"));\n\t}", "public function checkSettings() {\n try {\n $response = $this->getMailingLists();\n if (!empty($response->error)) {\n return $response->error;\n }\n\n if ($this->response_code != 200) {\n return \"An error occurred. Code {$this->response_code}, reponse: \" . var_export($this->response_body, TRUE) . \".\";\n }\n }\n catch (MailerException $e) {\n return $e->getMessage();\n }\n\n return TRUE;\n }", "public static function sendVerificationMail($email){\n $userId = $email;\n $url = $GLOBALS['server_url'] . $GLOBALS['user_dir'] . $GLOBALS['prj_dir'].\"/controller/verify_mail.php\";\n\n /**\n * Mailer script provided by the school\n * - We just added the $email, $url variables from our site\n */\n // create a new cURL resource\n $ch = curl_init();\n // set URL and other appropriate options\n $id = md5(uniqid(rand(), 1));\n\n $areWeStored = self::storeVerificationMailToDb($userId, $id);\n\n if($areWeStored == true) {\n curl_setopt($ch, CURLOPT_URL, \"http://kark.uit.no/internett/php/mailer/mailer.php?address=\" . $email . \"&url=\" . $url . \"?id=\" . $id);\n //curl_setopt($ch, CURLOPT_URL, \"http://www.dagbladet.no/\");\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n // grab URL and pass it to the browser\n $output = curl_exec($ch);\n /**\n * Mailer script provided by the school ends here\n */\n return true;\n }\n else{\n return false;\n }\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}", "public function isEmailVerification()\n {\n if (strtolower($this->CI->preferences->type('system')->item('users_emailVerification')) == 'optional') {\n return true;\n } else {\n if ($this->isEmailVerified()) {\n return true;\n } else {\n return false;\n }\n }\n }", "function verifica_email ($email)\r\n{\r\n\t$retorno = true;\r\n\r\n\t/* Aqui estaria el codigo para verificar \r\n\tla direccion de correo */\r\n\r\n\treturn $retorno;\r\n}", "function get_hoster_email()\t{\n\t\t// some mandants may have configured an individual hoster_email in their TS-Template\n\t\tif(!empty($this->conf['contact_email']) && t3lib_div::validEmail($this->conf['contact_email'])){\n\t\t\treturn $this->conf['contact_email'];\n\t\t}\n\n\t\t// default: take the email-adress given in tx_civserv_configuration\n\t\t$hoster_email=\"\";\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'cf_value',\t\t\t \t\t\t\t\t\t\t// SELECT ...\n\t\t\t'tx_civserv_configuration',\t\t\t\t\t\t// FROM ...\n\t\t\t'cf_key = \"mail_to\"',\t\t// AND title LIKE \"%blabla%\"', // WHERE...\n\t\t\t'', \t\t\t\t\t\t\t\t\t\t\t// GROUP BY...\n\t\t\t'', \t\t\t\t\t\t\t\t\t\t\t// ORDER BY...\n\t\t\t'' \t\t\t\t\t\t\t\t\t\t\t\t// LIMIT to 10 rows, starting with number 5 (MySQL compat.)\n\t\t);\n\t\tif($res){\n\t\t\t$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\n\t\t\t$hoster_email = $row['cf_value'];\n\t\t}else{\n\t\t\t$hoster_email = \"info@some_hoster.de\";\n\t\t}\n\t\tif ($hoster_email == ''){\n\t\t\t$hoster_email = \"info@some_hoster.de\";\n\t\t}\n\t\treturn $hoster_email;\n\t}", "public function isEnableCustomerEmail ()\n {\n return $this->scopeConfig->isSetFlag(\n 'b2bregistration/email_setting/customer_email_enable',\n ScopeInterface::SCOPE_STORE\n );\n }" ]
[ "0.69283617", "0.66048497", "0.6581484", "0.6540524", "0.65275234", "0.65176666", "0.6486412", "0.6423171", "0.6422441", "0.6363536", "0.6274178", "0.6256566", "0.62205285", "0.61253786", "0.607243", "0.60624963", "0.6054423", "0.60540456", "0.6052042", "0.60321015", "0.6027415", "0.6018802", "0.6018321", "0.60105085", "0.60006034", "0.5992799", "0.59666395", "0.5956427", "0.5941591", "0.59340817", "0.59191304", "0.5909683", "0.58948976", "0.5880679", "0.58773327", "0.58767414", "0.58352304", "0.58273816", "0.5812183", "0.5809993", "0.5805959", "0.5764558", "0.5760747", "0.5742422", "0.57423335", "0.57380545", "0.57347924", "0.5734282", "0.5709885", "0.5706516", "0.57020146", "0.56976265", "0.56952906", "0.5685015", "0.5683274", "0.56782013", "0.56556326", "0.56507283", "0.5650351", "0.5641718", "0.5641709", "0.56292224", "0.562748", "0.5608399", "0.5604191", "0.5588274", "0.55846643", "0.55776906", "0.55522424", "0.55491924", "0.5549006", "0.5545237", "0.55440986", "0.55406874", "0.55376077", "0.5534593", "0.5529655", "0.5518526", "0.5517337", "0.549741", "0.54940027", "0.54901874", "0.5489898", "0.5484175", "0.5471804", "0.54652566", "0.5458683", "0.54581714", "0.5455717", "0.5443804", "0.54353005", "0.54351306", "0.5433332", "0.5433148", "0.5431549", "0.54276794", "0.54271007", "0.5424751", "0.5423729", "0.54204524" ]
0.61971444
13
CARGA Tabla de mesas
public function cargaTablaMesas(){ $this->cargaMesas("no"); // Cabecera de tabla. echo "<div class='table-responsive'>"; echo "<table class='table table-striped table-sm table-bordered table-hover'>"; echo '<thead class="thead-dark">'; echo '<th>SALA</th>'; echo '<th>Mesa</th>'; echo '<th>Nº Comensales</th>'; echo '<th>Eliminar</th>'; echo '</thead>'; echo '<tbody>'; if (isset($_SESSION['MisMesas'])){ $misMesas=$_SESSION['MisMesas']; $numMesas=count($misMesas); }else{ $numMesas=0; } for($i=0;$i<$numMesas;++$i){ $row=$misMesas[$i]; echo "<tr>"; echo "<td>".$row['SAL_Nombre']."</td>"; echo "<td>".$row['MES_ID']."</td>"; echo "<td>".$row['MES_NPersonas']."</td>"; echo "<td>"; echo "<button style ='border:0' onclick=\"confirmaBajaMesa('".$row['SAL_ID']."','".$row['SAL_Nombre']."','".$row['MES_ID']."','".$row['MES_NPersonas']."');\"><img src='./Assets/Icons/eliminar.svg' alt='Eliminar' ></img></button>"; echo "</td>"; echo "</tr>"; } echo '</tbody>'; echo '</table>'; if ($numMesas==0){echo "No TIENE MESAS. INTRODUZCALAS AQUI MISMO";} echo '</div>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tabela($vetorComcadastros, $vetorComIndices){//Função que cria a tabela/lista recebe o vetor cos os cadsastros e outro com os indices\n retornaEscolhidos($vetorComcadastros, $vetorComIndices);//escreve a tabela\n }", "function datos_tablas(){\n\t\t$this->db->SELECT('*');\n\t\t$this->db->SELECT('persona.id as id_persona');\n\t\t$this->db->SELECT('mantenciones.estado as estado_mantencion');\n\t\t$this->db->SELECT('mantenciones.id as id_mantencion');\n\t\t$this->db->FROM('mantenciones');\n\t\t$this->db->join('codigos_ccu','mantenciones.id_cod_ccu = codigos_ccu.idcodigos_ccu','inner');\n\t\t$this->db->join('persona','mantenciones.id_chofer = persona.id','inner');\n\t\t$this->db->join('camiones','mantenciones.id_camion = camiones.id','inner');\n\t\t$this->db->where('mantenciones.eliminado', 0);\n\t\t$this->db->order_by('mantenciones.id', 'desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function crossTab($conteos,$codConteo,$nbrConteo,$columnas,$codColumna,$nbrColumna,$decimales=0,$mostrarTotales='A'){\n $conteosArr=array();\n foreach ($conteos as $conteo) {\n if(!isset($conteosArr[$conteo[$codConteo]])){\n $conteosArr[$conteo[$codConteo]]=array();\n }\n $conteosArr[$conteo[$codConteo]][$conteo['codigo']]=$conteo['cantidad'];\n }\n $columnArr=array();\n $columnArr[]=array('title' => $nbrConteo,'border' => 1,);\n foreach ($columnas as $columna) {\n $columnArr[]=array('title' => $columna[$nbrColumna], 'border' => 1, 'align' => 'R',);\n }\n if(in_array($mostrarTotales,array('F','A'))){\n $columnArr[]=array('title' => 'Totales','border' => 1,'align' => 'R',);\n }\n\n $reporteArr=$totales=array();\n $totales[]='Totales';\n foreach ($conteosArr as $anio => $value) {\n $subtotal=0;\n $tmp=array($anio);\n reset($columnas);\n foreach ($columnas as $columna) {\n if(!isset($totales[$columna[$codColumna]])){\n $totales[$columna[$codColumna]]=0;\n }\n if(!isset($value[$columna[$codColumna]])){\n $tmp[]=0;\n }\n else{\n $subtotal+=$value[$columna[$codColumna]];\n $tmp[]=number_format($value[$columna[$codColumna]],$decimales);\n $totales[$columna[$codColumna]]+=$value[$columna[$codColumna]];\n }\n }\n if(in_array($mostrarTotales,array('F','A'))){\n $tmp[]=number_format($subtotal,$decimales);\n }\n $reporteArr[]=$tmp;\n if(in_array($mostrarTotales,array('F','A'))){\n if(!isset($totales['subtotal'])){\n $totales['subtotal']=0;\n }\n $totales['subtotal']+=$subtotal;\n }\n }\n foreach ($totales as $key => $value) {\n if($value=='Totales'){\n continue;\n }\n $totales[$key]=number_format($value,$decimales);\n }\n if(in_array($mostrarTotales,array('C','A')) && count($reporteArr)){\n $reporteArr[]=array_values($totales);\n }\n $this->dataTable($columnArr,$reporteArr);\n $this->newLine();\n }", "public function tabla()\n {\n\n \treturn Datatables::eloquent(Encargos::query())->make(true);\n }", "public function Tabla( $header, $data, $config, $ta, $contigua = 0, $col_spe = 0 ) {\r\n\t\t$this->op_actual \t= 'tabla';\r\n\t\t$this->tw = $config;\r\n\t\t\r\n\t\tif ( $contigua == 0 || $this->getY() > ($this->pageHeight) ) {\r\n\t\t\t$this->AddPage();\r\n\t\t}\r\n\t\t$this->pagina_nueva = false;\r\n\t \r\n\t\t// Data\r\n\t $this->SetFillColor(250,250,250);\r\n\t $this->SetDrawColor(0,0,0);\r\n\t $this->SetTextColor(0);\r\n\t $this->SetFont('','',10);\r\n\t $fill = false;\r\n\t\t\r\n\t\tif ($col_spe == 0)\r\n\t\t\t$col = 4;\r\n\t\telse\r\n\t\t\t$col = $col_spe;\r\n\r\n\t\t$xw = 0;\r\n\t\t// sumar ancho de columnas anteriores\r\n\t\tfor ($c = 0; $c < $col; $c++)\r\n\t\t\tif (isset($this->tw[$c]))\r\n\t\t\t\t$xw += $this->tw[$c];\r\n\t\t\r\n\t\t$i = 0;\r\n\t\tforeach( $data as $row ) {\r\n\t\t\tif ( $this->getY() > ($this->pageHeight-20) ) {\r\n\t\t\t\t$this->Cell(array_sum($this->tw),0,'','T');\r\n\t\t\t\t$this->Ln();\r\n\t\t\t\t$this->AddPage();\r\n\t\t\t\t$y=$this->GetY();\r\n\t\t\t\t//$this->SetY($y+4);\r\n\t\t\t\t$this->TablaHeaderBM( $header, $config, true );\r\n\t\t\t\t$this->SetFont('','',10);\r\n\t\t\t\t$this->pagina_nueva = false;\r\n\t\t\t\t$fill = false;\r\n\t\t\t}\r\n\t\t\t$multi = 0;\r\n\r\n\t\t\t$y=$this->GetY();\r\n\t\t\t$x=$this->GetX();\r\n\t\t\t\r\n\t\t\t$x2 = $x + $xw;\r\n\t\t\t$this->SetX($x2);\r\n\t\t\t//$this->SetTextColor(255,0,0);\r\n\t\t\t$this->MultiCell( $this->tw[$col], 5, $this->capitalizar($row[$col]),1,$ta[$col]);\r\n\t\t\t$multi = $this->GetY();\r\n\t\t\t$multi_x = $this->GetX();\r\n\t\t\t$inter_y = $multi - $y;\r\n\t\t\t$this->SetY($y);\r\n\t\t\t$this->SetX($x);\r\n\r\n\t\t\t//$this->SetDrawColor( 200, 200, 200 );\r\n\t\t\t\r\n\t\t\tfor ( $j = 0; $j < count($row); $j++ ) {\t\r\n\t\t\t\tswitch ($j) {\r\n\t\t\t\tcase $col:\r\n\t\t\t\t\t$this->SetX($x2+$this->tw[$col]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$y=$this->GetY();\r\n\t\t\t\t\t$x=$this->GetX();\r\n\t\t\t\t\t$this->MultiCell( $this->tw[$j], $inter_y, $row[$j],1,$ta[$j]); // ,$fill)\r\n\t\t\t\t\t$this->SetY($y);\r\n\t\t\t\t\t$this->SetX($x+$this->tw[$j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($multi>0)\r\n\t\t\t\t$this->SetY($multi);\r\n\t\t\telse\r\n\t\t\t\t$this->Ln();\r\n\t\t\t$fill=!$fill;\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\t\r\n\t $this->Celda(array_sum($this->tw),0,'','T');\r\n\t\t$this->Ln();\r\n\t\t$this->op_actual = '';\r\n\t}", "public function dataTable();", "public function tableauMatieres()\n\t\t{\n\t\t\t// On dit à mysql que l'on veut travailler en UTF-8\n\t\t\tmysqli_query($this->co,\"SET NAMES UTF8\");\n\t\t\t$result = mysqli_query($this->co,\n\t\t\t\t\t\t\t\t \"SELECT nom_matiere FROM matiere\")\n\t\t\tor die(\"Connexion impossible : Connexion tableauMatieres()\");\n\n\t\t\t$matiere = Array ();\n\n\t\t\twhile ($row = mysqli_fetch_array($result)) {\n\t\t\t\t$matiere[] = $row[0];\n\t\t\t}\n\n\t\t\treturn $matiere;\n\t\t}", "function tampil_data($tabel)\n {\n $row = $this->db->prepare(\"SELECT * FROM sms\");\n $row->execute();\n return $hasil = $row->fetchAll();\n }", "function getTablaInformeAjuntament($desde,$hasta){\n \n // $this->ponerHorasTaller();\n // $this->ponerNumRegistro();\n \n \n $letra=getLetraCasal();\n $numeroRegistroCasalIngresos=getNumeroRegistroCasalIngresos();\n $numeroRegistroCasalDevoluciones=getNumeroRegistroCasalDevoluciones();\n \n $sql=\"SELECT id FROM casal_recibos WHERE fecha>='$desde' AND fecha<='$hasta' ORDER BY id ASC LIMIT 1\";\n if($this->db->query($sql)->num_rows()==0){\n $primero=0;\n }\n else {\n $primero=$this->db->query($sql)->row()->id;\n }\n \n $sql=\"SELECT id FROM casal_recibos WHERE fecha>='$desde' AND fecha<='$hasta' ORDER BY id DESC LIMIT 1\";\n if($this->db->query($sql)->num_rows()==0){\n $ultimo=0;\n }\n else {\n $ultimo=$this->db->query($sql)->row()->id;\n }\n \n $sql=\"SELECT r.id as id, r.fecha as fecha , r.id_socio as id_socio , r.importe as importe , r.recibo as recibo, s.nombre as nombre,s.apellidos as apellidos \n FROM casal_recibos r\n LEFT JOIN casal_socios_nuevo s ON s.num_socio=r.id_socio\n WHERE fecha>='$desde' AND fecha<='$hasta' ORDER BY r.id\";\n \n $sql=\"SELECT r.fecha as fecha,\"\n . \" lr.id_recibo as recibo,\"\n . \" lr.importe as importe, \"\n . \" t.nombre_corto as nombre,\"\n . \" t.horas_taller_T1 as horas_taller_T1,\"\n . \" t.horas_taller_T2 as horas_taller_T2,\"\n . \" t.horas_taller_T3 as horas_taller_T3,\"\n . \" s.dni as dni,\"\n . \" lr.tarjeta as tarjeta,\"\n . \" lr.periodos as periodos,\"\n . \" lr.id_taller as id_taller,\"\n . \" lr.id_socio as id_socio,\"\n . \" lr.id as id,\"\n . \" lr.num_registro as num_registro,\"\n . \" lr.num_registro_posicion as num_registro_posicion,\"\n . \" s.num_socio as num_socio\"\n . \" FROM casal_lineas_recibos lr\"\n . \" LEFT JOIN casal_recibos r ON lr.id_recibo=r.id\"\n . \" LEFT JOIN casal_talleres t ON t.id=lr.id_taller\"\n . \" LEFT JOIN casal_socios_nuevo s ON s.num_socio=lr.id_socio\"\n . \" WHERE lr.importe>0 AND lr.id_recibo>='$primero' AND lr.id_recibo<='$ultimo' ORDER BY lr.num_registro_posicion\";\n \n //log_message('INFO',$sql);\n \n $recibos=array(); \n if($this->db->query($sql)->num_rows()>0) \n $recibos=$this->db->query($sql)->result();\n \n \n $cabeceraTabla='<table class=\"table table-bordered table-hover\"><tbody>\n <thead>\n <tr >\n <th class=\"col-sm-1 text-center\">Data</th>\n <th class=\"col-sm-1 text-center\">Num Registre</th>\n <th class=\"col-sm-1 text-center\">DNI Usuari</th>\n <th class=\"col-sm-1 text-center\">Nom Actividad</th>\n <th class=\"col-sm-1 text-center\">Num Registre Ingrés</th>\n <th class=\"col-sm-1 text-center\" >Preu/hora</th>\n <th class=\"col-sm-1 text-center\">Import Base</th>\n <th class=\"col-sm-1 text-center\">% IVA (exempt)</th>\n <th class=\"col-sm-1 text-center\" style=\"border-top:2px solid black;border-right:2px solid black;border-left:2px solid black;\">IMPORT TOTAL</th>\n <th class=\"col-sm-1 text-center\">TIPOLOGIA INGRES</th>\n \n </tr>';\n \n \n \n $tabla=$cabeceraTabla;\n \n $importeTotal=0;\n foreach ($recibos as $k=>$v) {\n $fecha=$v->fecha;\n $fecha=substr($fecha,8,2).'/'.substr($fecha,5,2).'/'.substr($fecha,0,4);\n $tabla.='<tr>';\n $tabla.='<td class=\"text-center\">';\n $tabla.= $fecha;\n $tabla.='</td>';\n \n $num=strval($v->num_registro_posicion);\n while(strlen($num)<5) {\n $num='0'.$num;\n }\n $tabla.='<td class=\"text-center\">';\n $tabla.= $v->num_registro.$num;\n $tabla.='</td>';\n \n \n $dni=$v->dni;\n if($this->socios_model->validar_dni($dni)){\n $tabla.='<td class=\"text-center\">';\n $tabla.= strtoupper($dni);\n $tabla.='</td>';\n }\n else{\n $tabla.='<td class=\"text-center\" style=\"color:red\">';\n $tabla.= strtoupper($dni).\"(\".$v->num_socio.\")\";\n $tabla.='</td>';\n }\n \n $nombre=$v->nombre;\n $tabla.='<td class=\"text-center\">';\n $tabla.= $nombre;\n $tabla.='</td>';\n \n $recibo=$letra.' '.$v->recibo; \n $tabla.='<td class=\"text-center\">';\n $tabla.= $recibo;\n $tabla.='</td>';\n \n if($v->periodos==4) $horas=floatval($v->horas_taller_T1);\n if($v->periodos==2) $horas=floatval($v->horas_taller_T2);\n if($v->periodos==1) $horas=floatval($v->horas_taller_T3); \n //log_message('INFO', '===================='.$v->nombre.' '.$horas);\n \n if($horas>0)\n $preu_hora=number_format($v->importe/$horas*100,2); \n else \n $preu_hora=0;\n\n $tabla.='<td class=\"text-center\">';\n $tabla.= $preu_hora;\n $tabla.='</td>';\n \n \n \n $importe=$v->importe;\n $tabla.='<td class=\"text-center\" >';\n $tabla.= number_format($importe,2);\n $tabla.='</td>';\n \n $importe=$v->importe;\n $tabla.='<td class=\"text-center\">';\n $tabla.= '0.00';\n $tabla.='</td>';\n \n $importe=number_format($v->importe,2);\n $tabla.='<td class=\"text-center\" style=\"border-right:2px solid black;border-left:2px solid black;\">';\n $tabla.= number_format($importe,2);\n $tabla.='</td>';\n $importeTotal+=number_format($importe,2);\n \n $tarjeta=number_format($v->tarjeta,2);\n if($tarjeta==0) $pago=\"Efectiu\"; else $pago=\"TPV fisic\";\n $tabla.='<td class=\"text-center\">';\n $tabla.= $pago;\n $tabla.='</td>';\n \n $tabla.='</tr>';\n }\n \n \n $pieTabla='</tr></thead><thead><tr>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:0px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\">T O T A L S</th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:2px solid black;border-right:2px solid black;border-left:2px solid black;\">';\n $pieTabla.=number_format($importeTotal,2);\n $pieTabla.='</th>';\n $pieTabla.='</tr></thead></tody></table>';\n \n $tabla.=$pieTabla;\n \n \n $cabeceraTablaDevoluciones='<table class=\"table table-bordered table-hover\"><tbody>\n <thead>\n <tr >\n <th class=\"col-sm-1 text-center\">Data</th>\n <th class=\"col-sm-1 text-center\">Num Registre</th>\n <th class=\"col-sm-1 text-center\">DNI Usuari</th>\n <th class=\"col-sm-1 text-center\">Nom Actividad</th>\n <th class=\"col-sm-1 text-center\">Num Registre Devolució</th>\n <th class=\"col-sm-1 text-rigcenterht\" >Preu/hora</th>\n <th class=\"col-sm-1 text-center\">Import Base</th>\n <th class=\"col-sm-1 text-center\">% IVA (exempt)</th>\n <th class=\"col-sm-1 text-center\" style=\"border-top:2px solid black;border-right:2px solid black;border-left:2px solid black;\">IMPORT TOTAL</th>\n <th class=\"col-sm-1 text-center\">TIPOLOGIA DEVOLUCIÓ</th>\n \n </tr>';\n \n $tituloCasal=strtoupper(getTituloCasal());\n $salida='<h4>INFORME DETALLAT INGRESSOS</h4>'\n . ''\n . 'EQUIPAMENT MUNICIPA: <STRONG>'.$tituloCasal.'</STRONG>'\n . '<BR>'\n . 'ADJUDICATARI: <STRONG>'.'SERVEIS A LES PERSONES INCOOP, SCCL</STRONG>'\n . '<BR>'\n . 'NIF ADJUDICATARI: <STRONG>F60137411</STRONG>'\n . '<BR>'\n . 'NÚM CONTRACTE: <STRONG>18001022</STRONG>'\n . '<BR>'\n . 'Periode: <STRONG>'.substr($desde,8,2).'/'.substr($desde,5,2).'/'.substr($desde,0,4).' - '.substr($hasta,8,2).'/'.substr($hasta,5,2).'/'.substr($hasta,0,4).'</STRONG>'\n . '<BR>'\n . '<BR>'\n \n .$tabla.'<br>';\n \n $sql=\"SELECT r.fecha as fecha,\"\n . \" lr.id_recibo as recibo,\"\n . \" lr.importe as importe, \"\n . \" t.nombre_corto as nombre,\"\n . \" t.horas_taller_T1 as horas_taller_T1,\"\n . \" t.horas_taller_T2 as horas_taller_T2,\"\n . \" t.horas_taller_T3 as horas_taller_T3,\"\n . \" s.dni as dni,\"\n . \" lr.tarjeta as tarjeta,\"\n . \" lr.periodos as periodos,\"\n . \" lr.id_taller as id_taller,\"\n . \" lr.id_socio as id_socio,\"\n . \" lr.id as id,\"\n . \" lr.num_registro as num_registro,\"\n . \" lr.num_registro_posicion as num_registro_posicion,\"\n . \" s.num_socio\"\n . \" FROM casal_lineas_recibos lr\"\n . \" LEFT JOIN casal_recibos r ON lr.id_recibo=r.id\"\n . \" LEFT JOIN casal_talleres t ON t.id=lr.id_taller\"\n . \" LEFT JOIN casal_socios_nuevo s ON s.num_socio=lr.id_socio\"\n . \" WHERE lr.importe<0 AND lr.id_recibo>='$primero' AND lr.id_recibo<='$ultimo' ORDER BY lr.num_registro_posicion\";\n \n \n \n $recibos=array(); \n if($this->db->query($sql)->num_rows()>0) \n $recibos=$this->db->query($sql)->result();\n \n $tabla=$cabeceraTablaDevoluciones;\n $importeTotalDevoluciones=0;\n foreach ($recibos as $k=>$v) {\n $fecha=$v->fecha;\n $fecha=substr($fecha,8,2).'/'.substr($fecha,5,2).'/'.substr($fecha,0,4);\n $tabla.='<tr>';\n $tabla.='<td class=\"text-center\">';\n $tabla.= $fecha;\n $tabla.='</td>';\n \n $num=strval($v->num_registro_posicion);\n while(strlen($num)<5) {\n $num='0'.$num;\n } \n $tabla.='<td class=\"text-center\">';\n $tabla.= $v->num_registro.$num;;\n $tabla.='</td>';\n \n $dni=$v->dni;\n if($this->socios_model->validar_dni($dni)){\n $tabla.='<td class=\"text-center\">';\n $tabla.= strtoupper($dni);\n $tabla.='</td>';\n }\n else{\n $tabla.='<td class=\"text-center\" style=\"color:red\">';\n $tabla.= strtoupper($dni).\"(\".$v->num_socio.\")\";\n $tabla.='</td>';\n }\n \n $nombre=$v->nombre;\n $tabla.='<td class=\"text-center\">';\n $tabla.= $nombre;\n $tabla.='</td>';\n \n $recibo=$letra.' '.$v->recibo; \n $tabla.='<td class=\"text-center\">';\n $tabla.= $recibo;\n $tabla.='</td>';\n \n \n \n /*\n $id_taller=$v->id_taller;\n $periodos=$v->periodos;\n $id_socio=$v->id_socio;\n $importe=-$v->importe;\n $id=$v->id;\n $sql=\"SELECT * FROM casal_lineas_recibos WHERE id<'$id' AND id_taller='$id_taller' AND id_socio='$id_socio' AND periodos='$periodos' AND importe='$importe' ORDER BY id DESC LIMIT 1\";\n //log_message('INFO',$sql);\n if($this->db->query($sql)->num_rows()==1) {\n $recibo=$letra.' '.$this->db->query($sql)->row()->id_recibo;\n }\n else $recibo='';\n $tabla.='<td class=\"text-center\">';\n $tabla.= $recibo;\n $tabla.='</td>';\n */\n \n \n if($v->periodos==4) $horas=$v->horas_taller_T1;\n if($v->periodos==2) $horas=$v->horas_taller_T2;\n if($v->periodos==1) $horas=$v->horas_taller_T3; \n \n //log_message('INFO', '++=================='.$v->nombre.' '.$horas);\n \n $preu_hora=number_format($v->importe/$horas*100,2); \n $tabla.='<td class=\"text-center\">';\n $tabla.= -$preu_hora;\n $tabla.='</td>';\n \n \n \n $importe=number_format($v->importe,2);\n $tabla.='<td class=\"text-center\" >';\n $tabla.= -$importe;\n $tabla.='</td>';\n \n $importe=number_format($v->importe,2);\n $tabla.='<td class=\"text-center\">';\n $tabla.= '0.00';\n $tabla.='</td>';\n \n $importe=number_format($v->importe,2);\n $tabla.='<td class=\"text-center\" style=\"border-right:2px solid black;border-left:2px solid black;\">';\n $tabla.= -$importe;\n $tabla.='</td>';\n $importeTotalDevoluciones+=$importe;\n \n $tarjeta=number_format($v->tarjeta,2);\n if($tarjeta==0) $pago=\"Efectiu\"; else $pago=\"TPV fisic\";\n $tabla.='<td class=\"text-center\">';\n $tabla.= $pago;\n $tabla.='</td>';\n \n $tabla.='</tr>';\n }\n \n \n \n \n $pieTablaDevoluciones='</tr></thead><thead><tr>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:0px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\">T O T A L S</th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:2px solid black;border-right:2px solid black;border-left:2px solid black;\">';\n $pieTablaDevoluciones.=-number_format($importeTotalDevoluciones,2);\n $pieTablaDevoluciones.='</th>';\n $pieTablaDevoluciones.='</tr></thead></tody></table>';\n \n \n \n \n \n $salida.='<h4>INFORME DETALLAT DEVOLUCIONS</h4>'\n . ''\n . 'EQUIPAMENT MUNICIPA: <STRONG>'.$tituloCasal.'</STRONG>'\n . '<BR>'\n . 'ADJUDICATARI: <STRONG>'.'SERVEIS A LES PERSONES INCOOP, SCCL</STRONG>'\n . '<BR>'\n . 'NIF ADJUDICATARI: <STRONG>F60137411</STRONG>'\n . '<BR>'\n . 'NÚM CONTRACTE: <STRONG>18001022</STRONG>'\n . '<BR>'\n . 'Periode: <STRONG>'.substr($desde,8,2).'/'.substr($desde,5,2).'/'.substr($desde,0,4).' - '.substr($hasta,8,2).'/'.substr($hasta,5,2).'/'.substr($hasta,0,4).'</STRONG>'\n . '<BR>'\n . '<BR>';\n \n \n \n \n \n \n $salida.=$tabla;\n $salida.=$pieTablaDevoluciones;\n $salida.='<br><h4>RESUM TOTAL</h4>';\n \n $importeResumen=number_format($importeTotal,2)+number_format($importeTotalDevoluciones,2);\n $resumenTotal='<table class=\"table table-bordered table-hover\"><tbody>\n <thead>\n <tr >\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-top:2px solid black;border-right:2px solid black;border-left:2px solid black;\">IMPORT TOTAL</th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n \n </tr>\n <tr >\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:2px solid #DDDDDD;border-top:2px solid #DDDDDD;border-left:1px solid #DDDDDD;\">T O T A L S</th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:2px solid black;border-top:2px solid black;border-right:2px solid black;border-left:2px solid black;\">'.number_format($importeResumen,2).'</th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n \n </tr>\n\n\n\n </thead></tbody></table>';\n \n $salida.=$resumenTotal;\n \n \n \n \n return $salida;\n \n }", "public function getTabla(){\n return $this->table;\n }", "public function tampilDataGalang(){\n\t\t\n\t}", "function getTablas() {\r\n $tablas['inventario_equipo']['id']='inventario_equipo';\r\n $tablas['inventario_equipo']['nombre']='Inventario (equipo)';\r\n\r\n $tablas['inventario_grupo']['id']='inventario_grupo';\r\n $tablas['inventario_grupo']['nombre']='Inventario (grupo)';\r\n\r\n $tablas['inventario_estado']['id']='inventario_estado';\r\n $tablas['inventario_estado']['nombre']='Inventario (estado)';\r\n\r\n $tablas['inventario_marca']['id']='inventario_marca';\r\n $tablas['inventario_marca']['nombre']='Inventario (marca)';\r\n\r\n $tablas['obligacion_clausula']['id']='obligacion_clausula';\r\n $tablas['obligacion_clausula']['nombre']='Obligacion (clausula)';\r\n\r\n $tablas['obligacion_componente']['id']='obligacion_componente';\r\n $tablas['obligacion_componente']['nombre']='Obligacion (componente)';\r\n\r\n $tablas['documento_tipo']['id']='documento_tipo';\r\n $tablas['documento_tipo']['nombre']='Documento (Tipo)';\r\n\r\n \t\t$tablas['documento_tema']['id']='documento_tema';\r\n \t\t$tablas['documento_tema']['nombre']='Documento (Tema)';\r\n\r\n \t\t$tablas['documento_subtema']['id']='documento_subtema';\r\n \t\t$tablas['documento_subtema']['nombre']='Documento (Subtema)';\r\n\r\n \t\t$tablas['documento_estado']['id']='documento_estado';\r\n \t\t$tablas['documento_estado']['nombre']='Documento (Estado)';\r\n\r\n \t\t$tablas['documento_estado_respuesta']['id']='documento_estado_respuesta';\r\n \t\t$tablas['documento_estado_respuesta']['nombre']='Documento (Estado Respuesta)';\r\n\r\n \t\t$tablas['documento_actor']['id']='documento_actor';\r\n \t\t$tablas['documento_actor']['nombre']='Documento (Responsables)';\r\n\r\n \t\t$tablas['documento_tipo_actor']['id']='documento_tipo_actor';\r\n \t\t$tablas['documento_tipo_actor']['nombre']='Documento (Tipo de Responsable)';\r\n\r\n \t\t$tablas['riesgo_probabilidad']['id']='riesgo_probabilidad';\r\n \t\t$tablas['riesgo_probabilidad']['nombre']='Riesgo (Probabilidad)';\r\n\r\n \t\t$tablas['riesgo_categoria']['id']='riesgo_categoria';\r\n \t\t$tablas['riesgo_categoria']['nombre']='Riesgo (Categoria)';\r\n\r\n \t\t$tablas['riesgo_impacto']['id']='riesgo_impacto';\r\n \t\t$tablas['riesgo_impacto']['nombre']='Riesgo (Impacto)';\r\n\r\n \t\t$tablas['compromiso_estado']['id']='compromiso_estado';\r\n \t\t$tablas['compromiso_estado']['nombre']='Compromisos (Estado)';\r\n\r\n \t\t$tablas['departamento']['id']='departamento';\r\n \t\t$tablas['departamento']['nombre']='Departamentos';\r\n\r\n \t\t$tablas['departamento_region']['id']='departamento_region';\r\n \t\t$tablas['departamento_region']['nombre']='Departamentos (Region)';\r\n\r\n \t\t$tablas['municipio']['id']='municipio';\r\n \t\t$tablas['municipio']['nombre']='Municipios';\r\n\r\n $tablas['operador']['id']='operador';\r\n\t $tablas['operador']['nombre']='Operador';\r\n\r\n asort($tablas);\r\n return $tablas;\r\n }", "function crear_tabla()\n {\n //Array para saber cuantos dias tienen los meses\n $meses = array(\"31\", \"28\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"30\", \"31\", \"30\", \"31\");\n $cambio_mes = 0;\n //Recogemos los datos\n $num1 = filter_input(INPUT_POST, 'num1');\n $profe = filter_input(INPUT_POST, 'profe');\n $zona = filter_input(INPUT_POST, 'zona');\n $mes = filter_input(INPUT_POST, 'mes');\n $año = filter_input(INPUT_POST, 'año');\n\n //Recogemos los horarios del profesor y la zona seleccionados\n $h_profe=$this->model->get_h_profe($profe, $zona);\n $numeros[5]=\"\";\n $numeros[0]=$num1;\n //Sacamos los cinco numeros de la semana\n for($i=0;$i<5;$i++)\n {\n $numeros[$i+1] = $numeros[$i]+1;\n //si el numero es superior al dia maximo del mes entonces le restamos el dia maximo y reseteamos los dias\n if( $numeros[$i+1] > $meses[$mes-1])\n {\n $numeros[$i+1] = $numeros[$i+1] - $meses[$mes-1];\n //marcamos que cambiamos de mes\n $cambio_mes = 1;\n }\n\n }\n $total = \"\";\n //bucle para crear los tr de las horas\n for($i=8;$i<21;$i++)\n {\n //Quitamos las horas de comer\n if($i!=14 && $i!=15)\n {\n //generamos el primer td con la hora\n $total.=\"<tr><td>\".$i.\":00-\".($i+1).\":00</td>\";\n //bucle para sacar el resto de td\n for($k=0;$k<5;$k++)\n {\n $total .= \"<td class='$numeros[$k]-$i dia_$k'>\";\n //foreach de horarios para comprobar si coincide con la fecha y tenemos que printar un boton\n foreach ($h_profe as $hora)\n {\n //creamos otra variable de mes para no modificar la global\n $mes_1 = $mes;\n //Preguntas para saber si hay que modificar el mes, ya sea sumar o cambiar a 1\n if($cambio_mes == 1 && $mes_1 < 12 && $numeros[$k]<5)\n {\n $mes_1 = $mes_1+1;\n }\n else if( $cambio_mes == 1 && $mes_1 == 12 && $numeros[$k]<5)\n {\n $mes_1 = 1;\n $año = $año+1;\n }\n //Añadimos un zero a la izquierda si es inferior a 10\n $mes_1 = str_pad($mes_1, 2, \"0\", STR_PAD_LEFT);\n $dia = str_pad($numeros[$k], 2, \"0\", STR_PAD_LEFT);\n //Montamos la fecha\n $fecha = $año.\"-\".$mes_1.\"-\".$dia ;\n\n //Preguntamos si la hora del tr es la misma que la del horario y lo mismo con la fecha\n if($hora['hora']== $i && $hora['fecha'] == $fecha)\n {\n //Si coincide creamos el boton\n $total.= \"<button class='practica hvr-grow-shadow'>Marcar</button>\";\n }\n }\n //Le metemos un span oculto con los datos de dia y hora.\n $total .=\"<span style='display:none'>\".$numeros[$k].\" \".$i.\":00</span></td>\";\n\n }\n $total.=\"</tr>\";\n }\n }\n //Enviamos la tabla\n echo $total;\n }", "static public function mostrarTabla(){\n\n \t$item = null;\n $valor = null;\n\n \t$empresa = ControladorEmpresa::ctrMostrarEmpresa($item, $valor);\n\n \techo '{\n\t\t\t\"data\": [';\n\n\t\t\tfor($i = 0; $i < count($empresa)-1; $i++){\n\n\t\t\t\t\n\t\t\t\t echo '[\n\t\t\t \"'.($i+1).'\",\n\t\t\t \"'.$empresa[$i][\"ruta_imagen\"].'\",\n\t\t\t \"'.$empresa[$i][\"empresa\"].'\",\n\t\t\t \"'.$empresa[$i][\"direccion\"].'\",\n\t\t\t \"'.$empresa[$i][\"telefono\"].'\",\n\t\t\t \"'.$empresa[$i][\"celular\"].'\",\n\t\t\t \"'.$empresa[$i][\"ciudad\"].'\",\n\t\t\t \"'.$empresa[$i][\"responsable\"].'\",\n\t\t\t \"'.$empresa[$i][\"email\"].'\"\n\n\t\t\t ],';\n\n\t\t\t}\n\n\t\t\t echo'[\n\t\t\t \"'.count($empresa).'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"ruta_imagen\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"empresa\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"direccion\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"telefono\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"celular\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"ciudad\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"responsable\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"email\"].'\" \n\t\t\t ]\n\t\t\t]\n\t\t}';\n\n\n }", "public function imprimirTabla()\r\n {\r\n try\r\n {\r\n $consulta = \"SELECT * FROM xxnombretabla\";//el nombre de la tabla\r\n $objeto = $this->PDO->prepare($consulata);\r\n $objeto->execute();\r\n $tabla = $objeto->fetchAll(PDO::FETCH_OBJ);\r\n\r\n foreach ($tabla as $fila )\r\n {\r\n $xxnombreclase = new xxnombreclase();//se instancia la clase que se esta haciendo\r\n $xxnombreclase->__SET('xid:clase', $fila->xxcampoTabla);//se llama el campo de la tabla que corresponda con el atributo de la clase\r\n $xxnombreclase->__SET('xatributo:clase',$fila->xxcampoTabla);//se repite segun los campos que hayan en la tabla\r\n\r\n $result[] = $xxnombreclase;//se mete en el arreglo result[] la varible con la clase\r\n }\r\n\r\n } catch (Exception $e) {\r\n die($e->getMessage());\r\n }\r\n\r\n return $result;//se devuelve el arreglo result\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 tablaConversiones() {\n \n $array = array();\n $contador = 0;\n $output = \"\";\n $output2 = \"\";\n $heading = array('Numero ','Contenido de $var ', 'isset($var) ', 'empty($var) ', '(bool) $var ', 'is_null($var)');\n $var = array(null, 0, true, false, \"0\", \"\", \"foo\", $array, 2);\n $funciones = array('llamarIsset', 'llamarEmpty', 'llamarBool', 'llamarIsnull');\n \n $output .= \"<table class='table table-bordered'>\";\n $output .= \"<tr>\";\n // imprimimos cabecera\n foreach ($heading as $value) {\n $output .= \"<th>\" . $value . \" </th>\";\n }\n $output .= \"</tr>\";\n foreach ($var as $valor) {\n \n $contador++;\n $output .= \"<th> {$contador} </th>\";\n \n if ($valor === null) {\n $output2 = \"null\";\n } elseif($valor === true) {\n $output2 = \"true\";\n } elseif($valor === 2) {\n $output2 = \"unset(\\$var)\";\n } elseif($valor === \"\") {\n $output2 = \"\\\"\\\"\";\n } elseif($valor === false) {\n $output2 = \"false\";\n }else {\n $output2 = $valor;\n }\n \n $output .= \"<th> \\$var= \". $output2 .\" </th>\";\n \n foreach ($funciones as $funcion) {\n \n if ($valor == 2) {\n unset($valor);\n }\n if ($funcion($valor)) {\n $output .= \"<td class='true'> True </td>\";\n } else {\n $output .= \"<td class='false'> False </td>\";\n }\n }\n $output .= \"<tr>\";\n }\n \n $output .= \"</table>\";\n\n echo $output;\n }", "function getTablas() {\n $tablas['departamento']['id'] = 'departamento';\n $tablas['departamento']['nombre'] = 'Departamentos';\n\n $tablas['departamento_region']['id'] = 'departamento_region';\n $tablas['departamento_region']['nombre'] = 'Departamentos (Region)';\n\n $tablas['municipio']['id'] = 'municipio';\n $tablas['municipio']['nombre'] = 'Municipios';\n\n $tablas['operador']['id'] = 'operador';\n $tablas['operador']['nombre'] = 'Operador';\n\n $tablas['pais']['id'] = 'pais';\n $tablas['pais']['nombre'] = 'Paises';\n\n $tablas['ciudad']['id'] = 'ciudad';\n $tablas['ciudad']['nombre'] = 'Ciudades';\n\n $tablas['familias']['id'] = 'familias';\n $tablas['familias']['nombre'] = 'Familias';\n\n $tablas['monedas']['id'] = 'monedas';\n $tablas['monedas']['nombre'] = 'Monedas';\n\n $tablas['cuentas_financiero']['id'] = 'cuentas_financiero';\n $tablas['cuentas_financiero']['nombre'] = 'Cuentas';\n\n $tablas['cuentas_financiero_ut']['id'] = 'cuentas_financiero_ut';\n $tablas['cuentas_financiero_ut']['nombre'] = 'Cuentas UT';\n\n $tablas['cuentas_financiero_tipo']['id'] = 'cuentas_financiero_tipo';\n $tablas['cuentas_financiero_tipo']['nombre'] = 'Tipos de Cuentas';\n\n $tablas['extracto_movimiento']['id'] = 'extracto_movimiento';\n $tablas['extracto_movimiento']['nombre'] = 'Movimientos';\n\n $tablas['centropoblado']['id'] = 'centropoblado';\n $tablas['centropoblado']['nombre'] = 'Centros Poblados';\n\n $tablas['encuesta_tipo']['id'] = 'encuesta_tipo';\n $tablas['encuesta_tipo']['nombre'] = 'Tipo de Encuesta';\n\n $tablas['actividades_tipo']['id'] = 'actividades_tipo';\n $tablas['actividades_tipo']['nombre'] = 'Planes de Actividades';\n\n $tablas['tipohallazgo']['id'] = 'tipohallazgo';\n $tablas['tipohallazgo']['nombre'] = 'Tipo Hallazgo';\n\n asort($tablas);\n return $tablas;\n }", "function desplegarTabla($query,$anchtable=array(),$iconos=array(),$coLoTabla=\"table-primary\"){\n\n\tglobal $oBD;\n\n\t$registros = $oBD->consulta($query);\n\n\t$columnas = mysqli_num_fields($registros);\n\techo '<table class= \"table table-hover'.$coLoTabla.'\">';\n\t// creacion de la cabecera\n\techo '<tr class=\"table-dark\">';// hace el renglon\n\n\t// if (count($anchtable)){\n\t// \tforeach ($anchtable as $anch) {\n\t// \t\techo \"<td style=width:$anch.'%';></td>\";\n\t// \t\techo $anch;\n\t// \t}\n\t// }\n$k = 0;\n// si el count de iconos existe entonces me mandaron iconos \n\tif (count($iconos)){\n\t\tforeach ($iconos as $icono) {\n\t\t\techo $k;\n\t\t\t\t\t\n\t\t\tif (count($anchtable)) {\n\t\t\t\techo \"<td style=width:$anchtable[$k];>&nbsp;</td>\";\t\n\t\t\t}else{\n\t\t\t\techo \"<td>&nbsp;</td>\";\t\n\t\t\t}\n\n\t\t\t$k++;\n\t\t}\n\t}\n\t//echo $columnas;\n\techo $k;\n\t//$k=$k-1;\n\tfor ($c=0; $c < $columnas; $c++){\n\t\t// para traer los nombres de los campos\n\t\t$campo=mysqli_fetch_field_direct($registros,$c); // da la informacion de un campo en la base de datos\n\t\t \n\t\t if (count($anchtable)) {\n\t\t\t\techo \"<td style=width:$anchtable[$k];>$campo->name.$c</td>\";\t\n\t\t\t}else{\n\t\t\t\techo '<td style=\"width:(90/$columnas)%\">'.$campo->name.'</td>';\t\t\n\t\t\t}\n\t\t // echo $anchtable[$c];\n\t\t $k++;\n\t\t\n\t}\n\techo '</tr>';\n\t// fin cabecera\n\t// comienzo de registros\n\tfor ($r=0; $r < $oBD->numeRegistros; $r++) \n\t{ echo '<tr>';\n\t\t// agregando iconos\n\t\t// EN EL CASO DE QUE \"UPDATE EXISTA EN EL ARRGLO DE LOS ICONOS\"\n\t\tif (in_array(\"update\", $iconos)) {\n\t\t\t//da comportamiento de los iconos\n\t\t\techo '<td style=\"width:5%\"><img src=\"imagenes/update.png\"></td>';\n\t\t}\n\n\t\tif (in_array(\"delete\", $iconos)) {\n\t\t\t//da comportamiento de los iconos\n\t\t\techo '<td style=\"width:5%\"><img src=\"imagenes/delete.png\"></td>';\n\t\t}\n\n\n\t\t$campos = mysqli_fetch_array($registros);\n\t\t// despliega la informacion de un registro especifico\n\t\tfor ($c=0; $c < $columnas; $c++) \n\t\t\techo '<td>'.$campos[$c].'</td>';\n\t echo '</tr>';\n\t\t\n\t}\necho '</table>';\necho $k;\n}", "public function 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 }", "function getTabla() {\r\n return $this->tabla;\r\n }", "public function mostrarTablas(){\t\r\n\r\n\t\t$item = null;\r\n \t\t$valor = null;\r\n\r\n \t\t$proveedores = ControladorProveedores::ctrMostrarProveedores($item, $valor);\r\n\r\n\r\n \t\t$datosJson = '{\r\n\t\t \r\n\t \t\"data\": [ ';\r\n\r\n\t \tfor($i = 0; $i < count($proveedores); $i++){\r\n\r\n\t \t\t/*=============================================\r\n\t\t\tDEVOLVER DATOS JSON\r\n\t\t\t=============================================*/\r\n\r\n\t\t\t$datosJson\t .= '[\r\n\t\t\t\t \"'.($i+1).'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"codigo\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"rfc\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"razonSocial\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"fechaAlta\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"limiteCredito\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"diasCredito\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"rfc2\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"curp\"].'\"\r\n\t\t\t\t ],';\r\n\r\n\t \t}\r\n\r\n\t \t$datosJson = substr($datosJson, 0, -1);\r\n\r\n\t\t$datosJson.= ']\r\n\t\t\t \r\n\t\t}'; \r\n\r\n\t\techo $datosJson;\r\n\r\n \t}", "function tampil_data()\n\t{\n\t\t# perintah join digunakan untuk menggabungkan 2 table, yaitu penduduk dan kematian, agar data yang tampil lebih detail, karena pada tabel kematian hanya terdapat sedikit kolom, sehingga dengan menambah kolom nik, maka data yang ada di tabel penduduk juga otomatis terdeteksi karena perintah join, dengan aturan, nik harus sama antara tabel kematian dan nik yang ada di penduduk.\n\t\treturn $this->db->query(\"SELECT*FROM `kematian` left join penduduk on kematian.nik = penduduk.nik\")->result();\n\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 traiter_tableau($bloc) {\n\t// id \"unique\" pour les id du tableau\n\t$tabid = substr(md5($bloc), 0, 4);\n\n\t// Decouper le tableau en lignes\n\tpreg_match_all(',([|].*)[|]\\n,UmsS', $bloc, $regs, PREG_PATTERN_ORDER);\n\t$lignes = array();\n\t$debut_table = $summary = '';\n\t$l = 0;\n\n\t// Traiter chaque ligne\n\t$reg_line1 = ',^(\\|(' . _RACCOURCI_TH_SPAN . '))+$,sS';\n\t$reg_line_all = ',^(' . _RACCOURCI_TH_SPAN . ')$,sS';\n\t$hc = $hl = array();\n\tforeach ($regs[1] as $ligne) {\n\t\t$l++;\n\n\t\t// Gestion de la premiere ligne :\n\t\tif ($l == 1) {\n\t\t\t// - <caption> et summary dans la premiere ligne :\n\t\t\t// || caption | summary || (|summary est optionnel)\n\t\t\tif (preg_match(',^\\|\\|([^|]*)(\\|(.*))?$,sS', rtrim($ligne, '|'), $cap)) {\n\t\t\t\t$cap = array_pad($cap, 4, null);\n\t\t\t\t$l = 0;\n\t\t\t\tif ($caption = trim($cap[1])) {\n\t\t\t\t\t$debut_table .= \"<caption>\" . $caption . \"</caption>\\n\";\n\t\t\t\t}\n\t\t\t\t$summary = ' summary=\"' . entites_html(trim($cap[3])) . '\"';\n\t\t\t}\n\t\t\t// - <thead> sous la forme |{{titre}}|{{titre}}|\n\t\t\t// Attention thead oblige a avoir tbody\n\t\t\telse {\n\t\t\t\tif (preg_match($reg_line1, $ligne, $thead)) {\n\t\t\t\t\tpreg_match_all('/\\|([^|]*)/S', $ligne, $cols);\n\t\t\t\t\t$ligne = '';\n\t\t\t\t\t$cols = $cols[1];\n\t\t\t\t\t$colspan = 1;\n\t\t\t\t\tfor ($c = count($cols) - 1; $c >= 0; $c--) {\n\t\t\t\t\t\t$attr = '';\n\t\t\t\t\t\tif ($cols[$c] == '<') {\n\t\t\t\t\t\t\t$colspan++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($colspan > 1) {\n\t\t\t\t\t\t\t\t$attr = \" colspan='$colspan'\";\n\t\t\t\t\t\t\t\t$colspan = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// inutile de garder le strong qui n'a servi que de marqueur\n\t\t\t\t\t\t\t$cols[$c] = str_replace(array('{', '}'), '', $cols[$c]);\n\t\t\t\t\t\t\t$ligne = \"<th id='id{$tabid}_c$c'$attr>$cols[$c]</th>$ligne\";\n\t\t\t\t\t\t\t$hc[$c] = \"id{$tabid}_c$c\"; // pour mettre dans les headers des td\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$debut_table .= \"<thead><tr class='row_first'>\" .\n\t\t\t\t\t\t$ligne . \"</tr></thead>\\n\";\n\t\t\t\t\t$l = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Sinon ligne normale\n\t\tif ($l) {\n\t\t\t// Gerer les listes a puce dans les cellules\n\t\t\t// on declenche simplement sur \\n- car il y a les\n\t\t\t// -* -# -? -! (qui produisent des -&nbsp;!)\n\t\t\tif (strpos($ligne, \"\\n-\") !== false) {\n\t\t\t\t$ligne = traiter_listes($ligne);\n\t\t\t}\n\n\t\t\t// tout mettre dans un tableau 2d\n\t\t\tpreg_match_all('/\\|([^|]*)/S', $ligne, $cols);\n\n\t\t\t// Pas de paragraphes dans les cellules\n\t\t\tforeach ($cols[1] as &$col) {\n\t\t\t\tif (strlen($col = trim($col))) {\n\t\t\t\t\t$col = preg_replace(\"/\\n{2,}/S\", \"<br /> <br />\", $col);\n\t\t\t\t\tif (_AUTOBR) {\n\t\t\t\t\t\t$col = str_replace(\"\\n\", _AUTOBR . \"\\n\", $col);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// assembler le tableau\n\t\t\t$lignes[] = $cols[1];\n\t\t}\n\t}\n\n\t// maintenant qu'on a toutes les cellules\n\t// on prepare une liste de rowspan par defaut, a partir\n\t// du nombre de colonnes dans la premiere ligne.\n\t// Reperer egalement les colonnes numeriques pour les cadrer a droite\n\t$rowspans = $numeric = array();\n\t$n = $lignes ? count($lignes[0]) : 0;\n\t$k = count($lignes);\n\t// distinguer les colonnes numeriques a point ou a virgule,\n\t// pour les alignements eventuels sur \",\" ou \".\"\n\t$numeric_class = array(\n\t\t'.' => 'point',\n\t\t',' => 'virgule',\n\t\ttrue => ''\n\t);\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$align = true;\n\t\tfor ($j = 0; $j < $k; $j++) {\n\t\t\t$rowspans[$j][$i] = 1;\n\t\t\tif ($align and preg_match('/^[{+-]*(?:\\s|\\d)*([.,]?)\\d*[}]*$/', trim($lignes[$j][$i]), $r)) {\n\t\t\t\tif ($r[1]) {\n\t\t\t\t\t$align = $r[1];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$align = '';\n\t\t\t}\n\t\t}\n\t\t$numeric[$i] = $align ? (\" class='numeric \" . $numeric_class[$align] . \"'\") : '';\n\t}\n\tfor ($j = 0; $j < $k; $j++) {\n\t\tif (preg_match($reg_line_all, $lignes[$j][0])) {\n\t\t\t$hl[$j] = \"id{$tabid}_l$j\"; // pour mettre dans les headers des td\n\t\t} else {\n\t\t\tunset($hl[0]);\n\t\t}\n\t}\n\tif (!isset($hl[0])) {\n\t\t$hl = array();\n\t} // toute la colonne ou rien\n\n\t// et on parcourt le tableau a l'envers pour ramasser les\n\t// colspan et rowspan en passant\n\t$html = '';\n\n\tfor ($l = count($lignes) - 1; $l >= 0; $l--) {\n\t\t$cols = $lignes[$l];\n\t\t$colspan = 1;\n\t\t$ligne = '';\n\n\t\tfor ($c = count($cols) - 1; $c >= 0; $c--) {\n\t\t\t$attr = $numeric[$c];\n\t\t\t$cell = trim($cols[$c]);\n\t\t\tif ($cell == '<') {\n\t\t\t\t$colspan++;\n\n\t\t\t} elseif ($cell == '^') {\n\t\t\t\t$rowspans[$l - 1][$c] += $rowspans[$l][$c];\n\n\t\t\t} else {\n\t\t\t\tif ($colspan > 1) {\n\t\t\t\t\t$attr .= \" colspan='$colspan'\";\n\t\t\t\t\t$colspan = 1;\n\t\t\t\t}\n\t\t\t\tif (($x = $rowspans[$l][$c]) > 1) {\n\t\t\t\t\t$attr .= \" rowspan='$x'\";\n\t\t\t\t}\n\t\t\t\t$b = ($c == 0 and isset($hl[$l])) ? 'th' : 'td';\n\t\t\t\t$h = (isset($hc[$c]) ? $hc[$c] : '') . ' ' . (($b == 'td' and isset($hl[$l])) ? $hl[$l] : '');\n\t\t\t\tif ($h = trim($h)) {\n\t\t\t\t\t$attr .= \" headers='$h'\";\n\t\t\t\t}\n\t\t\t\t// inutile de garder le strong qui n'a servi que de marqueur\n\t\t\t\tif ($b == 'th') {\n\t\t\t\t\t$attr .= \" id='\" . $hl[$l] . \"'\";\n\t\t\t\t\t$cols[$c] = str_replace(array('{', '}'), '', $cols[$c]);\n\t\t\t\t}\n\t\t\t\t$ligne = \"\\n<$b\" . $attr . '>' . $cols[$c] . \"</$b>\" . $ligne;\n\t\t\t}\n\t\t}\n\n\t\t// ligne complete\n\t\t$class = alterner($l + 1, 'odd', 'even');\n\t\t$html = \"<tr class='row_$class $class'>$ligne</tr>\\n$html\";\n\t}\n\n\treturn \"\\n\\n<table\" . $GLOBALS['class_spip_plus'] . $summary . \">\\n\"\n\t. $debut_table\n\t. \"<tbody>\\n\"\n\t. $html\n\t. \"</tbody>\\n\"\n\t. \"</table>\\n\\n\";\n}", "public function cbo_mascota(){\n $data = array();\n $query = $this->db->get('mascota');\n if ($query->num_rows() > 0) {\n foreach ($query->result_array() as $row){\n $data[] = $row;\n }\n }\n $query->free_result();\n return $data;\n }", "function tablaDatos(){\n\n $editar = $this->Imagenes($this->PrimaryKey,0);\n $eliminar = $this->Imagenes($this->PrimaryKey,1);\n $sql = 'SELECT\n C.id_componentes,\n P.descripcion planta,\n S.descripcion secciones,\n E.descripcion Equipo,\n C.`descripcion` Componente\n ,'.$editar.','.$eliminar.' \nFROM\n `componentes` C\nINNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\nINNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\nINNER JOIN\n plantas P ON P.id_planta = S.id_planta\nWHERE\n \n C.`activo` = 1';\n \n $datos = $this->Consulta($sql,1); \n if(count($datos)){\n $_array_formu = array();\n $_array_formu = $this->generateHead($datos);\n $this->CamposHead = ( isset($_array_formu[0]) && is_array($_array_formu[0]) )? $_array_formu[0]: array();\n \n $tablaHtml = '<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"panel panel-default\">\n <div class=\"panel-body recargaDatos\" style=\"page-break-after: always;\">\n <div class=\"table-responsive\">';\n $tablaHtml .='';\n \t\t$tablaHtml .= $this->print_table($_array_formu, 7, true, 'table table-striped table-bordered',\"id='tablaDatos'\");\n \t\t$tablaHtml .=' </div>\n </div>\n </div>\n </div>\n </div>\n ';\n }else{\n $tablaHtml = '<div class=\"col-md-8\">\n <div class=\"alert alert-info alert-dismissable\">\n <button class=\"close\" aria-hidden=\"true\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Atenci&oacute;n</strong>\n No se encontraron registros.\n </div>\n </div>';\n }\n \n if($this->_datos=='r') echo $tablaHtml;\n else return $tablaHtml;\n \n }", "function dadosCadastros(){//função geral que será chamada na index\n pegaCadastrosJson();//pega os valores dos cadastros do arquivo JSON e salva em um array\n contaNumeroCadastros();//conta Quantos cadastros existem\n }", "public function toTable(){\r\n\t\t$datas = array();\r\n\t\tforeach ($this as $key => $value) {\r\n\t\t\tif(!in_array($key, $this->arraysis)){\r\n\t\t\t\t$datas[$key] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $datas;\r\n\t}", "function tampil_mahasiswa($id_mhs){\n\t\t\tglobal $con;\n\n\t\t\t$query=mysqli_query($con, \"SELECT a.*,b.*\n\t\t\t\t\t\t\t\t\t\tFROM tb_mahasiswa a,tb_prodi b \n\t\t\t\t\t\t\t\t\t\tWHERE a.id_prodi=b.id_prodi\n\t\t\t\t\t\t\t\t\t\tAND a.id_mhs='$id_mhs'\");\n\t\t\twhile($row=mysqli_fetch_array($query))\n\t\t\t\t$data[] = $row;\n\n\t\t\t\treturn $data;\n\t\t}", "function tabla_filas_proyecto($filas,$moneda,$cant,$tip,$barc,$artc,$desc,$prev,$mon,$mons,$monc,$tfdsc,$fdsc,$tdsc,$dsc,$IVA){\n\t\t$monchunk = explode(\"/\",$moneda); \n\t\t$Vmond = trim($monchunk[0]); // Nombre de Moneda\n\t\t$Vmons = trim($monchunk[1]); // Simbolo de Moneda\n\t\t$Vmonc = trim($monchunk[2]); // Tipo de Cambio\n\t\t$Vmonc = str_replace(\"(\",\"\",$Vmonc); //le quita el primer parentesis que rodea el tipo de cambio\n\t\t$Vmonc = str_replace(\" x 1)\",\"\",$Vmonc); //le quita el 2do. parentesis y el x 1\n\t\t\t$salida = '<br>';\n\t\t\t$salida.= '<table class = \"tablegrid\">';\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"30px\" height = \"30px\">No.</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"75px\">Cant.</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"300px\">Descipción</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"75px\">P. Unitario</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"75px\">Descuento</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"75px\">P. Total</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"30px\"></td>';\n\t\t\t$salida.= '</tr>';\n\t$STotal = 0;\n\t$Total = 0;\n\t$Rtotal = 0;\n\t$DescU = 0;\n\tif($filas>0){\n\t\tfor($i = 1; $i <= $filas; $i ++){\n\t\t\t//No.\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">'.$i.'.</td>';\n\t\t\t//Cantidad\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spancant'.$i.'\">'.$cant[$i].'</span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"cant'.$i.'\" id = \"cant'.$i.'\" value = \"'.$cant[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"tip'.$i.'\" id = \"tip'.$i.'\" value = \"'.$tip[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//Descripcion o Articulo\n\t\t\t$desc[$i] = utf8_decode($desc[$i]);\n\t\t\t$desc[$i] = trim($desc[$i]);\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"left\">'.$desc[$i];\n\t\t\t$salida.= '<input type = \"hidden\" name = \"barc'.$i.'\" id = \"barc'.$i.'\" value = \"'.$barc[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"artc'.$i.'\" id = \"artc'.$i.'\" value = \"'.$artc[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"desc'.$i.'\" id = \"desc'.$i.'\" value = \"'.$desc[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//Precio U.\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">'.trim($mons[$i]).' '.$prev[$i];\n\t\t\t$salida.= '<input type = \"hidden\" name = \"prev'.$i.'\" id = \"prev'.$i.'\" value = \"'.$prev[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"mon'.$i.'\" id = \"mon'.$i.'\" value = \"'.trim($mon[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"mons'.$i.'\" id = \"mons'.$i.'\" value = \"'.trim($mons[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"monc'.$i.'\" id = \"monc'.$i.'\" value = \"'.trim($monc[$i]).'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//Descuento\n\t\t\t$dsign = ($tdsc[$i] == \"P\")?\"%\":trim($mons[$i]);\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spandsc'.$i.'\">'.$dsign.' '.$dsc[$i].'</span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"tdsc'.$i.'\" id = \"tdsc'.$i.'\" value = \"'.$tdsc[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"dsc'.$i.'\" id = \"dsc'.$i.'\" value = \"'.$dsc[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//sub Total\n\t\t\t$rtot = ($prev[$i] * $cant[$i]);\n\t\t\tif($tdsc[$i] == \"P\"){\n\t\t\t\t$descuento = ($rtot *($dsc[$i])/100);\n\t\t\t}else if($tdsc[$i] == \"M\"){\n\t\t\t $descuento = $dsc[$i];\n\t\t\t}\n\t\t\t$Dcambiar = Cambio_Moneda($monc[$i],$Vmonc,$descuento);\n\t\t\t$DescU += $Dcambiar;\n\t\t\t$stot = $rtot - $descuento;\n\t\t\t$Dcambiar = Cambio_Moneda($monc[$i],$Vmonc,$stot);\n\t\t\t$STotal+= $Dcambiar;\n\t\t\t$Rcambiar = Cambio_Moneda($monc[$i],$Vmonc,$rtot);\n\t\t\t$Rtotal+= $Rcambiar;\n\t\t\t$stot = round($stot, 2);\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spanstot'.$i.'\">'.trim($mons[$i]).' '.$stot.'</span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"stot'.$i.'\" id = \"stot'.$i.'\" value = \"'.$stot.'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"rtot'.$i.'\" id = \"rtot'.$i.'\" value = \"'.$rtot.'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//---\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">';\n\t\t\t$salida.= '<a href = \"javascript:void(0);\" onclick = \"QuitarFilaVenta('.$i.')\" title = \"Quitar Fila\" style = \"border:none;\" ><img src = \"../../CONFIG/images/icons/delete.png\" style = \"vertical-align:middle;border:none;\"></a>';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '</tr>';\n\t\t}\n\t}\t\t\n\t\t\t//----\n\t\t\tif($tfdsc == \"P\"){\n\t\t\t\t$descuento = ($STotal *($fdsc)/100);\n\t\t\t}else if($tfdsc == \"M\"){\n\t\t\t $descuento = $fdsc;\n\t\t\t}\n\t\t\t$Total = $STotal - $descuento;\n\t\t\t$STotal = round($STotal, 2); //total sin iva\n\t\t\t$Total = round($Total, 2); //total sin iva\n\t\t\t$DescU = round($DescU, 2); //promedio de descuento\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td class = \"tdgrid\" colspan = \"3\" rowspan = \"4\">';\n\t\t\t$salida.= '<span id = \"spannota\">';\n\t\t\t$salida.= '<b>NOTA:</b> MONEDA PARA COTIZACI&Oacute;N: <b>'.$Vmond.'</b>. TIPO DE CAMBIO '.$Vmonc.' x 1';\n\t\t\t$salida.= '</span></td>';\n\t\t\t$salida.= '<td class = \"thgrid\">Desc/Unitarios</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spanpromdesc\"><b>'.$Vmons.' '.$DescU.'</b></span>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">-</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"promdesc\" id = \"promdesc\" value = \"'.$DescU.'\" /></td>';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td class = \"thgrid\">Subtotal</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">-</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spanstotal\"><b>'.$Vmons.' '.$STotal.'</b></span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"stotal\" id = \"stotal\" value = \"'.$STotal.'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" colspan = \"2\"></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td class = \"thgrid\">Desc/General</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">-</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spandscgeneral\"><b>'.$Vmons.' '.$descuento.'</b></span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"ttotal\" id = \"tdescuento\" value = \"'.$descuento.'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"ttotal\" id = \"ttdescuento\" value = \"'.$tfdsc.'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" colspan = \"2\"></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td class = \"thgrid\">TOTAL</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">-</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spanttotal\"><b>'.$Vmons.' '.$Total.'</b></span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"ttotal\" id = \"ttotal\" value = \"'.$Total.'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Rtotal\" id = \"Rtotal\" value = \"'.$Rtotal.'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"filas\" id = \"filas\" value = \"'.$filas.'\"/></td>';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" colspan = \"2\"></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '</table>';\n\t\t\t$salida.= '</form>';\n\t\t\t$salida.= '<br>';\n\t\n\treturn $salida;\n}", "public function getTcaTables() {}", "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}", "private function table_data()\n {\n $data = array();\n $args = array( \n 'post_type' => 'sutabu_ppdb',\n 'post_status' => 'publish',\n 'orderby' => 'title', \n 'order' => 'ASC', \n );\n\n $the_query = new WP_Query( $args );\n\n if($the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post();\n $data[] = array(\n 'id' => $dt->ID,\n 'perusahaan' => the_title(),\n 'total_ken' => the_content(),\n 'total_pen' => 'ok',\n 'tanggal' => 'ok'\n ); \n endwhile; endif;\n wp_reset_postdata();\n\n return $data;\n }", "public function gera_linhas_somatorios()\n\t{\n\t\tif(count($this->somatorios) > 0)\n\t\t{\n\t\t\techo \"<tr class=totalizadores>\";\n\t\t\tfor($i=0; $i < count($this->nome_colunas); $i++)\n\t\t\t{\n\t\t\t\t$alinhamento = $this->nome_colunas[$i][alinhamento];\n\n\t\t\t\tfor($b=0; $b < count($this->somatorios); $b++)\n\t\t\t\t{\n\t\t\t\t\tif($this->nome_colunas[$i][nome_coluna] == $this->somatorios[$b][nome_coluna])\n\t\t\t\t\t{\n\t\t\t\t\t\t$valor = $this->somatorios[$b][total];\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// \tVERIFICO SE E PARA IMPRIMIR O VALOR\n\t\t\t\tif($this->nome_colunas[$i][somatorio] == 's')\n\t\t\t\t{\n\t\t\t\t\t//\t ESCOLHO O TIPO DE DADO\n\t\t\t\t\tswitch($this->nome_colunas[$i][tipo])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'moeda':\n\t\t\t\t\t\t\t$valor = Util::exibe_valor_moeda($valor);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'data':\n\t\t\t\t\t\t\t$valor = Util::data_certa($valor);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$valor = $valor;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\techo \"\n\t\t\t\t\t\t \t<td align=$alinhamento>\n\t\t\t\t\t\t\t\t\" . $valor . \"\n\t\t\t\t\t\t \t</td>\n\t\t\t\t\t\t \";\n\t\t\t\t\t$valor = '';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"<td align=$alinhamento></td>\";\n\t\t\t\t}\n\n\n\n\t\t\t}\n\t\t\techo '</tr>';\n\t\t}\n\t}", "function cabecera($cedula, $ano, $mes){\r\n\t$cuerpo = \"\";\r\n\t$db = \"sidial\";\r\n\t$sql = \"SELECT * FROM VW_CABECERA_HISTORICO WHERE CE_TRABAJADOR = $cedula AND ANO = $ano AND MES = $mes\";\r\n\t$ds = new DataStore($db, $sql);\r\n\tif($ds->getNumRows()==0){\r\n\t\t$cuerpo .= \"<h4>No hay datos para la consulta</h4>\";;\r\n\t} else {\r\n\t\t$fila = $ds->getValues(0);\r\n\t $cuerpo .= '<table class=\"consulta\">';\r\n//\t $cuerpo .= '<tr class=\"par\"><th>Apellidos y nombres</th><td>' . $fila[\"NOMBRES\"] . \"</td></tr>\";\r\n\t $cuerpo .= '<tr class=\"par\"><th>Ubicaci&oacute;n</th><td>' . $fila[\"UBICACION\"] . \"</td></tr>\";\r\n\t $cuerpo .= '<tr class=\"par\"><th>Tipo de personal</th><td>' . $fila[\"TIPPER\"] . \"</td></tr>\";\r\n\t $cuerpo .= '<tr class=\"par\"><th>Dedicaci&oacute;n</th><td>' . $fila[\"DEDICACION\"] . \"</td></tr>\";\r\n\t $cuerpo .= '<tr class=\"par\"><th>Categor&iacute;a o cargo</th><td>' . $fila[\"CATEGORIA\"] . \"</td></tr>\";\r\n//\t $cuerpo .= '<tr class=\"par\"><th>Fecha de Ingreso</th><td>' . $fila[\"FE_INGRESO\"] . \"</td></tr>\";\r\n//\t $cuerpo .= '<tr class=\"par\"><th>Fecha de Jubilaci�n</th><td>' . $fila[\"FE_JUBILACION\"] . \"</td></tr>\";\r\n\t $cuerpo .= \"</table>\";\r\n\t}\r\n\treturn $cuerpo;\r\n}", "public function readTabla() {\r\n $query = 'SELECT * FROM ' . $this->tabla;\r\n\r\n\r\n \r\n\r\n $sentencia = $this->con->prepare($query);\r\n\r\n $sentencia->execute();\r\n\r\n return $sentencia;\r\n }", "public function tratarDados(){\r\n\t\r\n\t\r\n }", "public function mostrarTabla(){\n\n $item = null;\n $valor = null;\n\n $cargo = GestorCargo::verCargoController($item, $valor);\n\tif(count($cargo)>0){\n\t\techo '{\n\t\t\t\t\"data\": [';\n\n\t\t\t\tfor($i = 0; $i < count($cargo)-1; $i++){\n\n\t\t\t\t\t$itemTipoper = \"id_tipoper\";\n\t\t\t\t\t$valorTipoper = $cargo[$i][\"tipo_per\"];\n\n\t\t\t\t\t$tipoper = GestorTipoper::verTipoperController($itemTipoper, $valorTipoper);\n\n\t\t\t\t\techo '[\n\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\"'.$tipoper[\"nombre_tipoper\"].'\",\n\t\t\t\t\t\t\"'.$cargo[$i][\"nombre_cargo\"].'\",\n\t\t\t\t\t\t\"'.$cargo[$i][\"id_cargo\"].'\"\n\t\t\t\t\t],';\n\n\t\t\t\t}\n\t\t\t\t\t$itemTipoper = \"id_tipoper\";\n\t\t\t\t\t$valorTipoper = $cargo[count($cargo)-1][\"tipo_per\"];\n\n\t\t\t\t\t$tipoper = GestorTipoper::verTipoperController($itemTipoper, $valorTipoper);\n\n\t\t\techo'[\n\t\t\t\t\t\"'.count($cargo).'\",\n\t\t\t\t\t\"'.$tipoper[\"nombre_tipoper\"].'\",\n\t\t\t\t\t\"'.$cargo[count($cargo)-1][\"nombre_cargo\"].'\",\n\t\t\t\t\t\"'.$cargo[count($cargo)-1][\"id_cargo\"].'\"\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t}';\n\t}else{\n\t\t\techo '{ \"data\": [] }';\n\t\t}\n\n }", "function ImprimeTableFunciones($idTabla, $data, $pactu = \"\", $peli = \"\",$classCSS=\"\") {\n // echo \"ImprimeTable:::::::::::::::\".count($data[\"cuerpo\"]).\" <br>\";\n\t\ttry {\n // if (count($data) > 0) {\n\t\t\t $tabla = '<table id=\"'.$idTabla.'\" class=\"' . $classCSS . '\" cellpadding=\"0\" cellspacing=\"1\" border=\"1\" align=\"center\" style=\"text-align:center;\" >';\n\t\t\t if (count($data[\"columnas\"]) > 0) {\n\t\t\t\t$tabla.= '<thead>';\n $tabla .= '<tr>';\n $conta = 0;\n $conte = 0;\n\t\t\t\t\n for ($x = 0;$x < count($data[\"columnas\"]);$x++) {\n\t\t\t\t\t \n if ($pactu != \"\") {\n if ($conta == 0) {;\n\t\t\t\t\t\t $tabla.= '<th></th>';\n //$tabla.= '<td></td>';\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<th></th>';\n\t\t\t\t\t\t\t//$tabla.= '<td></td>';\n }\n }\n $conta++;\n $conte++;\n $tabla.= '<th>' . utf8_encode($data[\"columnas\"][$x]) . '</th>'; \n }\n\t\t\t\t$tabla.= '</tr>';\n\t\t\t\t$tabla.= '</thead>';\n\t\t\t }\n //===========CUERPO DE TABLA=================================================================================================\n $cantele = count($data[\"cuerpo\"]);\n if ($cantele > 0) {\n for ($i = 0;$i < $cantele;$i++) {\n $conta = 0;\n $conte = 0;\n $tabla.= \"<tr>\";\n for ($z = 0;$z < count($data[\"columnas\"]);$z++) {\n $columnas = $data[\"columnas\"][$z];\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n if ($pactu != \"\") {\n if ($conta == 0) {\n // $tabla.= '<td><a href=\"javascript:'.$pactu.'('. $data[\"cuerpo\"][$i][\"$columnas\"] .');\" title=\"Actualizar\" ><img title=\"Actualizar\" src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>';\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"'.$pactu.'('. $data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" title=\"Actualizar\" ><img src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<td><a href=\"#\" onClick=\"'.$peli.'('.$data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" ><img src=\"../imgcixphp/delete.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n }\n $conta++;\n $conte++;\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n $tabla.= '<td>&nbsp;' . $data[\"cuerpo\"][$i][\"$columnas\"] . '&nbsp; </td>'.\"\\n\";\n }\n }\n $tabla.= '</tr>';\n }\n \n }else{//solo si es k no hay datos\n\t\t\t\t$mensaje= \"No se encuentran Datos Registrados\"; \n\t\t\t $tabla.='<tfoot><tr> <td >&nbsp; '.$mensaje.' </td></tr></tfoot>';\n\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t//===========FIN CUERPO DE TABLA===========================================================================================\n $tabla.= '</table><br />';\n\t\t\t\t//}\n }catch(exception $e) {\n return $e->getMessage();\n }\n return $tabla;\n }", "public function get_mascota(){\n\t\t$id_zootecnico = $this->session->userdata('s_id_zootecnico');\n\t\t$data = array();\n\t\t$this->db->select('m.id_mascota, m.nombre, m.sexo, m.color, r.nombre AS \"raza\"');\n\t\t$this->db->from('mascota m, raza r, zootecnico z, cliente c, \n\t\t\tasignacion_cliente_z cz, asignacion_cliente_m cm');\n\t\t$this->db->where('m.id_raza = r.id_raza');\n\t\t$this->db->where('m.status != ','Perdido');\n\t\t$this->db->where('m.status != ','Finado');\n\t\t$this->db->where('m.id_mascota = cm.id_mascota');\n\t\t$this->db->where('cm.id_cliente = c.id_cliente');\n\t\t$this->db->where('c.id_cliente = cz.id_cliente');\n\t\t$this->db->where('cz.id_zootecnico = z.id_zootecnico');\n\t\t$this->db->where('z.id_zootecnico', $id_zootecnico);\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n\t\t\tforeach ($query->result_array() as $row){\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t}\n\t\t$query->free_result();\n\t\treturn $data;\n\t}", "function crear_tabla_horario()\n {\n //El funcionamiento es el mismo que en crear_tabla, excepto que aqui no le pasamos el profesor\n $meses = array(\"31\", \"28\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"30\", \"31\", \"30\", \"31\");\n $cambio_mes = 0;\n\n $num1 = filter_input(INPUT_POST, 'num1');\n\n $profe=$this->model->get_profe($_SESSION['iduser']);\n $zona = filter_input(INPUT_POST, 'zona');\n $mes = filter_input(INPUT_POST, 'mes');\n $año = filter_input(INPUT_POST, 'año');\n\n $mes = str_pad($mes, 2, \"0\", STR_PAD_LEFT);\n $h_profe=$this->model->get_h_profe($profe[0]['id_profesores'], $zona);\n $numeros[5]=\"\";\n $numeros[0]=$num1;\n for($i=0;$i<5;$i++)\n {\n\n $numeros[$i+1] = $numeros[$i]+1;\n\n if( $numeros[$i+1] > $meses[$mes-1])\n {\n $numeros[$i+1] = $numeros[$i+1] - $meses[$mes-1];\n $cambio_mes = 1;\n }\n\n }\n $total = \"\";\n for($i=8;$i<21;$i++)\n {\n if($i!=14 && $i!=15)\n {\n\n $total.=\"<tr><td>\".$i.\":00-\".($i+1).\":00</td>\";\n for($k=0;$k<5;$k++)\n {\n $total .= \"<td class='$numeros[$k]-$i dia_$k'>\";\n $ano=str_pad($numeros[$k],2,\"0\",STR_PAD_LEFT);\n //Si el horario del profe esta vacio printamos boton en todos los td\n if(!empty($h_profe))\n {\n $cont = 0;\n foreach ($h_profe as $hora)\n {\n $mes_1 = $mes;\n if($cambio_mes == 1 && $mes_1 < 12 && $numeros[$k]<5)\n {\n $mes_1 = $mes_1+1;\n }\n else if( $cambio_mes == 1 && $mes_1 == 12 && $numeros[$k]<5)\n {\n $mes_1 = 1;\n $año = $año+1;\n }\n $mes_1 = str_pad($mes_1, 2, \"0\", STR_PAD_LEFT);\n $fecha = $año.\"-\".$mes_1.\"-\".$ano;\n\n //Comprobamos si la hora y la fecha coincide y sumamos 1 al contador\n if($hora['hora']==$i && $hora['fecha'] == $fecha)\n {\n $cont++;\n }\n }\n //Si el cantador sigue en 0 printamos boton ya que significa que no ha sido marcada\n if($cont ==0)\n {\n $total.= \"<button class='horario hvr-grow-shadow'>Marcar</button>\";\n }\n }\n else\n {\n $total.= \"<button class='horario hvr-grow-shadow'>Marcar</button>\";\n }\n $total .=\"<span style='display:none'>\".$numeros[$k].\" \".$i.\":00</span></td>\";\n }\n $total.=\"</tr>\";\n }\n }\n echo $total;\n }", "function tabledata_Cadre_voirlestables ($serveur,$boolSPIP=false)\r\n{\r\n global $connect_statut, $spip_lang, $connect_id_auteur;\r\n\r\n $tables_extra = array();\r\n $tables_spip = array();\r\n $intNbExtra = 0 ;\r\n\r\n $sqlResultTables = sql_showbase('%');\r\n while ($tabNomTable = sql_fetch($sqlResultTables))\r\n {\r\n foreach ($tabNomTable as $key => $val)\r\n {\r\n if (preg_match('#^'.tabledata_table_prefix().'_#', $val))\r\n {\r\n $tables_spip[] = $val;\r\n }\r\n else\r\n {\r\n $tables_extra[] = $val;\r\n ++$intNbExtra ;\r\n }\r\n }\r\n }\r\n\r\n // affichage\r\n echo \"Choisir une table Extra parmis celle ci-dessous:\\n\";\r\n if ($intNbExtra<1)\r\n {\r\n echo \"Aucune table extra ne semble disponible.\";\r\n }\r\n else\r\n {\r\n echo tabledata_table_HTML ($tables_extra);\r\n }\r\n if ($boolSPIP)\r\n {\r\n echo \"<hr/>\";\r\n echo \"Les tables de SPIP :\\n\";\r\n echo tabledata_table_HTML ($tables_spip);\r\n }\r\n return;\r\n}", "function tabla_actores(){\n $fichero = \"bbdd/actores.csv\";\n $array_actores;\n\n //Si existe el fichero lo abrimos para leerlo\n $manejador = fopen($fichero, \"r\");\n if($manejador != FALSE){\n $j=0;\n while(($arrayFila= fgetcsv($manejador, 1000, \",\")) != FALSE){ \n $array_actores[$j] = array(\"id\" => $arrayFila[0], \"nombre\" => $arrayFila[1], \"anyo\" => $arrayFila[2], \"lugar\" => $arrayFila[3]);\n $j++;\n } \n fclose($manejador);\n } \n return $array_actores;\n }", "function generadataanuladofe($datas){\n\n\t\tinclude(\"application/config/conexdb_db2.php\");\n\t\t$fecha=$datas['fecha'];\n\t\t$serie=$datas['serie'];\n\t\t$correl=$datas['correl'];\n\t\t$nropdc=$datas['nropdc'];\t\t\n\t\t$codcia=$datas['cia']; \n\t\tif($fecha!=''||$serie!=''||$correl!=''){\n\t\t\tif($codcia==\"'10'\"){\n\t\t\t\t$wr=\" and a.SCTEFEC=\".$fecha.\" and a.SCTECIAA=\".$codcia.\" and a.SCTESERI=\".$serie.\" and a.SCTECORR=\".$correl.\" and a.SCTEPDCA=\".$nropdc\n\t\t\t\t;\n\t\t\t}else{\n\t\t\t\t$wr=\" and a.SCTEFEC=\".$fecha.\" and a.SCTECIAA='\".$codcia.\"' and a.SCTESERI='\".$serie.\"' and a.SCTECORR='\".$correl.\"' and a.SCTEPDCA=\".$nropdc\n\t\t\t\t;\t\n\t\t\t}\t\t\n\t\t\t$sql =\"select a.SCTEPER,a.SCTEFEC,a.SCTECIAA,a.SCTESUCA,a.SCTEALMA,a.SCTEPDCA,a.SCTESERA,a.SCTECORA,a.SCTESERI,a.SCTECORR,a.SCTERZSO,a.SCTECODE,a.SCTECRUC,a.SCTEUBIG,a.SCTEDIRE,a.SCTENCOM,a.SCTETDOC,a.SCTETPDO,a.SCTVENDE,a.SCTCCLIE,a.SCTCNRUC,a.SCTCRZSO,a.SCTCDIRE,a.SCTCTMON,a.SCTCODAU,a.SCTCSUST,a.SCTCTPNO,a.SCTGNETO,a.SCTGGEXE,a.SCTGNEXO,a.SCTGIGV,a.SCTGTOTA,a.SCTFECEM,a.SCTCCIMP,a.SCTMTIMP,a.SCTTASAI,a.SCTCSTS,a.SCTCUSUR,a.SCTCFECR,a.SCTCHORR,a.SCTIPFAC FROM LIBPRDDAT.SNT_CTRAM a where a.SCTCSTS='I'\".$wr;\n//print_r($sql);\n\t\t\t$dato = odbc_exec($dbconect, $sql)or die(\"<p>\" . odbc_errormsg());\n\t\t\tif (!$dato) {\n\t\t\t\t$data = FALSE;\n\t\t\t} else { \n\t\t\t\t$data = $dato; \n\t\t\t} \n\t\t}else{\n\t\t\t$data=FALSE;\t\n\t\t} \n\n\t\treturn $data; \n\t}", "public function mostra(){\n echo \"<tr><td>\".$this->codi.\"</td><td>\".$this->nom.\"</td></tr>\";\n }", "function insertTableInsumosVendidos($headers,$matrizDatos) {\n //verificar tabla a insertar (posteriormente puede ser una funcion):\n\n\n\n\n echo '<div class=\"card-body\">\n <div class=\"table-responsive\" >\n <table class=\"table table-bordered dataTableClase\" width=\"100%\" cellspacing=\"0\">'; //apertura de etiquetas\n //rellenar head:\n echo '<thead><tr>';\n foreach ($headers as $hd) {\n echo \"<th>\".$hd.\"</th>\";\n }\n echo'</tr></thead>';\n //rellenar el footer:\n echo '<tfoot><tr>';\n foreach ($headers as $hd) {\n echo \"<th>\".$hd.\"</th>\";\n }\n echo'</tr></tfoot>';\n echo '<tbody>';\n foreach ($matrizDatos as $reg) {\n echo \"<tr>\";\n foreach ($reg as $cell) {\n echo \"<td>\".$cap = ucfirst(mb_strtolower($cell)).\"</td>\"; // Capitalize\n }\n echo \"</tr>\";\n }\n echo '</tbody></table></div></div>'; //cierre etiquetas tabla\n}", "public function dataMahasiswa()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('tb_mahasiswa');\n\t\t$this->db->order_by('nim', 'asc');\n\t\t$data = $this->db->get('');\n\t\treturn $data;\n\t}", "static function getAlumnesTable(){\n $table = 'alumnes';\n\n // Table's primary key\n $primaryKey = 'id';\n\n // Array of database columns which should be read and sent back to DataTables.\n // The `db` parameter represents the column name in the database, while the `dt`\n // parameter represents the DataTables column identifier. In this case simple\n // indexes\n $columns = array(\n array( 'db' => 'id', 'dt' => 0 ),\n array( 'db' => 'primer_cognom', 'dt' => 1 ),\n array( 'db' => 'segon_cognom', 'dt' => 2 ),\n array( 'db' => 'nom', 'dt' => 3 ),\n array( 'db' => 'mobil', 'dt' => 4 ),\n array( 'db' => 'telefon', 'dt' => 5 ),\n array( \n 'db' => 'email', \n 'dt' => 6,\n 'formatter' => function( $d, $row ) {\n return \"<a href='mailto:$d'>$d</a>\";\n }\n ),\n array(\n 'db' => 'data_naixement',\n 'dt' => 7,\n 'formatter' => function( $d, $row ) {\n if ($d) {\n return date( 'd/m/Y', strtotime($d));\n } else{\n return \"\";\n }\n }\n ),\n array(\n 'db' => 'data_ingres',\n 'dt' => 8,\n 'formatter' => function( $d, $row ) {\n if ($d) {\n return date( 'd/m/Y', strtotime($d));\n } else{\n return \"\";\n }\n }\n ) \n );\n header('Content-Type: application/json; charset=utf-8');\n return json_encode(SSP::complex( $_GET, $table, $primaryKey, $columns, null, \"esborrat = 0\" ));\n }", "public function getTabla()\n {\n return Datatables::of($this->index())\n ->addColumn(\n 'acciones',\n function ($ret) {\n return '<button data-id=\"'.$ret->id_area_tematica.'\" class=\"btn btn-info btn-xs editar\" '.\n 'title=\"Editar\"><i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i></button>';\n }\n )\n ->make(true);\n }", "private function ObtenerCamposTabla(string $nombteTabla){\n $campos =array(); \n $this->EjecutarSQL(\"DESCRIBE \".$nombteTabla);\n foreach ($this->GetResultados() as $dato) $campos[] = $dato->Field;\n return $campos;\n }", "function getTabela($gui){\n global $dumper;\n\n\t$gui = bubblesort($gui, $_REQUEST[\"ordena_por\"]);\n\t$retorno = array();\n\t$header = $gui->header;\n\n\t// descobre o número de campos\n\t$max = count($header);\n\n // fazer essa verificação somente uma vez para performance\n if(!empty($gui->exibe)){\n foreach ($header as $k => $r) {\n if(isset($gui->exibe[\"e{$k}\"])){\n $retorno[\"header\"][$gui->exibe[\"e{$k}\"]] = utf8_encode(strip_tags($r));\n }\n }\n\n foreach($gui->itens as $r) {\n // descobre o número da linha\n $linha = $r->cont;\n $prod = array();\n\n // lista todos os itens\n for($coluna = 0; $coluna < $max; $coluna++) {\n if(isset($gui->exibe[\"e{$coluna}\"])) {\n $campo = $gui->getCampo($linha, $coluna);\n $prod[\"colunas\"][$gui->exibe[\"e{$coluna}\"]] = utf8_encode(strip_tags($campo[0]));\n $prod[\"classes\"][$gui->exibe[\"e{$coluna}\"]] = utf8_encode(strip_tags($campo[1]));\n $prod[\"handle\"] = utf8_encode(strip_tags($r->handle));\n if (empty($prod[\"handle\"])) {\n $prod[\"handle\"] = utf8_encode(strip_tags($r->HANDLE));\n }\n if (empty($prod[\"handle\"])) {\n $prod[\"handle\"] = utf8_encode(strip_tags($r->cont));\n }\n if (empty($prod[\"handle\"])) {\n $prod[\"handle\"] = utf8_encode(strip_tags($r->CONT));\n }\n }\n }\n $retorno[\"itens\"][] = $prod;\n }\n }\n\n // lista todos os campos\n else {\n foreach ($header as $k => $r) {\n $retorno[\"header\"][] = utf8_encode(strip_tags($r));\n }\n\n foreach($gui->itens as $r) {\n // descobre o número da linha\n $linha = $r->cont;\n $prod = array();\n\n // lista todos os itens\n for($coluna = 0; $coluna < $max; $coluna++) {\n $campo = $gui->getCampo($linha, $coluna);\n $prod[\"colunas\"][] = utf8_encode(strip_tags($campo[0]));\n $prod[\"classes\"][] = utf8_encode(strip_tags($campo[1]));\n $prod[\"handle\"] = utf8_encode(strip_tags($r->handle));\n if (empty($prod[\"handle\"])) {\n $prod[\"handle\"] = utf8_encode(strip_tags($r->HANDLE));\n }\n if (empty($prod[\"handle\"])) {\n $prod[\"handle\"] = utf8_encode(strip_tags($r->cont));\n }\n if (empty($prod[\"handle\"])) {\n $prod[\"handle\"] = utf8_encode(strip_tags($r->CONT));\n }\n }\n $retorno[\"itens\"][] = $prod;\n }\n }\n\n // faz o push dos prints com o retorno padrão\n if(!__DEVELOPER__) {\n\t $dumper->dumped = \"\";\n }\n\n $json[\"dev_log\"] = src\\creator\\widget\\Tools::toUTF8($dumper->dumped);\n $json[\"render\"] = $retorno;\n print_r(json_encode($json));\n}", "public function ListarMesas()\n{\n\tself::SetNames();\n\t$sql = \" select salas.codsala, salas.nombresala, salas.salacreada, mesas.codmesa, mesas.nombremesa, mesas.mesacreada, mesas.statusmesa FROM mesas LEFT JOIN salas ON mesas.codsala = salas.codsala\";\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}", "public function datatable()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'detailfasilitaskesehatan', 'read')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\t$table = 'detailfasilitaskesehatan';\n\t\t$primarykey = 'id';\n\t\t$columns = array(\n\t\t\tarray('db' => $primarykey, 'dt' => '0', 'field' => $primarykey,\n\t\t\t\t'formatter' => function($d, $row, $i){\n\t\t\t\t\treturn \"<div class='text-center'>\n\t\t\t\t\t\t<input type='checkbox' id='titleCheckdel' />\n\t\t\t\t\t\t<input type='hidden' class='deldata' name='item[\".$i.\"][deldata]' value='\".$d.\"' disabled />\n\t\t\t\t\t</div>\";\n\t\t\t\t}\n\t\t\t),\n\t\t\tarray('db' => $primarykey, 'dt' => '1', 'field' => $primarykey),\n\t\t\tarray('db' => 'b.namakategori', 'dt' => '2', 'field' => 'namakategori'),\n\t\t\tarray('db' => 'nama', 'dt' => '3', 'field' => 'nama'),\n\t\t\tarray('db' => 'kodefaskes', 'dt' => '4', 'field' => 'kodefaskes'),\n\t\t\t// array('db' => 'kelas', 'dt' => '5', 'field' => 'kelas'),\n\t\t\t// array('db' => 'direktur', 'dt' => '6', 'field' => 'direktur'),\n\t\t\tarray('db' => 'alamat', 'dt' => '5', 'field' => 'alamat'),\n\t\t\tarray('db' => 'kecamatan', 'dt' => '6', 'field' => 'kecamatan'),\n\t\t\t// array('db' => 'pemilik', 'dt' => '9', 'field' => 'pemilik'),\n\t\t\t// array('db' => 'telpon', 'dt' => '10', 'field' => 'telpon'),\n\t\t\t// array('db' => 'email', 'dt' => '11', 'field' => 'email'),\n\t\t\t// array('db' => 'website', 'dt' => '12', 'field' => 'website'),\n\t\t\t// array('db' => 'fax', 'dt' => '13', 'field' => 'fax'),\n\t\t\t// array('db' => 'ugd', 'dt' => '14', 'field' => 'ugd'),\n\t\t\t// array('db' => 'vip', 'dt' => '15', 'field' => 'vip'),\n\t\t\t// array('db' => 'vvip', 'dt' => '16', 'field' => 'vvip'),\n\t\t\t// array('db' => 'kelas1', 'dt' => '17', 'field' => 'kelas1'),\n\t\t\t// array('db' => 'kelas2', 'dt' => '18', 'field' => 'kelas2'),\n\t\t\t// array('db' => 'kelas3', 'dt' => '19', 'field' => 'kelas3'),\n\t\t\t// array('db' => 'jumdokter', 'dt' => '20', 'field' => 'jumdokter'),\n\t\t\t// array('db' => 'jumperawat', 'dt' => '21', 'field' => 'jumperawat'),\n\t\t\t// array('db' => 'foto', 'dt' => '22', 'field' => 'foto'),\n\t\t\t// array('db' => 'seourl', 'dt' => '7', 'field' => 'seourl'),\n\t\t\tarray('db' => $primarykey, 'dt' => '7', 'field' => $primarykey,\n\t\t\t\t'formatter' => function($d, $row, $i){\n\t\t\t\t\treturn \"<div class='text-center'>\n\t\t\t\t\t\t<div class='btn-group btn-group-xs'>\n\t\t\t\t\t\t\t<a href='admin.php?mod=detailfasilitaskesehatan&act=edit&id=\".$d.\"' class='btn btn-xs btn-default' id='\".$d.\"' data-toggle='tooltip' title='{$GLOBALS['_']['action_1']}'><i class='fa fa-pencil'></i></a>\n\t\t\t\t\t\t\t<a class='btn btn-xs btn-danger alertdel' id='\".$d.\"' data-toggle='tooltip' title='{$GLOBALS['_']['action_2']}'><i class='fa fa-times'></i></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\";\n\t\t\t\t}\n\t\t\t),\n\t\t);\n\t\t$joinquery = \"FROM detailfasilitaskesehatan AS a JOIN katfasilitaskesehatan AS b ON (b.idkategori = a.idkategori)\";\n\t\techo json_encode(SSP::simple($_POST, $this->poconnect, $table, $primarykey, $columns, $joinquery));\n\t}", "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}", "function ImprimeTable($idTabla, $data, $pactu = \"\", $peli = \"\",$classCSS=\"\") {\n // echo \"ImprimeTable:::::::::::::::\".count($data[\"cuerpo\"]).\" <br>\";\n\t\ttry {\n // if (count($data) > 0) {\n\t\t\t $tabla = '<table id=\"'.$idTabla.'\" class=\"' . $classCSS . '\" cellpadding=\"0\" cellspacing=\"1\" border=\"1\" align=\"center\" style=\"text-align:center\" >';\n\t\t\t if (count($data[\"columnas\"]) > 0) {\n\t\t\t\t$tabla.= '<thead>';\n $tabla .= '<tr>';\n $conta = 0;\n $conte = 0;\n\t\t\t\t\n for ($x = 0;$x < count($data[\"columnas\"]);$x++) {\n\t\t\t\t\t \n if ($pactu != \"\") {\n if ($conta == 0) {;\n\t\t\t\t\t\t $tabla.= '<th></th>';\n //$tabla.= '<td></td>';\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<th></th>';\n\t\t\t\t\t\t\t//$tabla.= '<td></td>';\n }\n }\n $conta++;\n $conte++;\n $tabla.= '<th>' . utf8_encode($data[\"columnas\"][$x]) . '</th>'; \n }\n\t\t\t\t$tabla.= \"</tr>\";\n\t\t\t\t$tabla.= '</thead>';\n\t\t\t }\n //===========CUERPO DE TABLA=================================================================================================\n $cantele = count($data[\"cuerpo\"]);\n if ($cantele > 0) {\n for ($i = 0;$i < $cantele;$i++) {\n $conta = 0;\n $conte = 0;\n $tabla.= \"<tr>\";\n for ($z = 0;$z < count($data[\"columnas\"]);$z++) {\n $columnas = $data[\"columnas\"][$z];\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n if ($pactu != \"\") {\n if ($conta == 0) {\n // $tabla.= '<td><a href=\"javascript:Modificar('. $data[\"cuerpo\"][$i][\"$columnas\"] .');\" title=\"Actualizar\" ><img title=\"Actualizar\" src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>';\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"Modificar('. $data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" title=\"Actualizar\" ><img title=\"Actualizar\" src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>';\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<td><a href=\"#\" onClick=\"Eliminar('.$data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" ><img src=\"../imgcixphp/delete.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>';\n }\n }\n }\n $conta++;\n $conte++;\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n $tabla.= '<td>' . $data[\"cuerpo\"][$i][\"$columnas\"] . ' </td>';\n }\n }\n $tabla.= \"</tr>\";\n }\n \n }else{//solo si es k no hay datos\n\t\t\t\t$mensaje= \"No se encuentran Ningun Dato Registrado\"; \n\t\t\t $tabla.='<tfoot><tr> <td >&nbsp; '.$mensaje.' </td></tr></tfoot>';\n\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t//===========FIN CUERPO DE TABLA===========================================================================================\n $tabla.= \"</table><br>\";\n\t\t\t\t//}\n }\n catch(exception $e) {\n return $e->getMessage();\n }\n return $tabla;\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 muestra_resultados() {\n \t//dd($datos);\n \t/*https://zinoui.com/blog/css-tables-tutorial*/\n \t/*https://vuejs.org/v2/examples/grid-component.html*/\n \t/*http://webgenio.com/2017/01/14/40-bonitas-plantillas-tablas-css/*/\n\n \t$result = \\DB::table('pimof.dbo.estimaciones AS e')\n \t\t->leftJoin('pimof.dbo.arboles AS a', 'a.id', '=', 'e.id_arboles')\n ->select([\n 'e.id'\n , 'a.genero'\n , 'a.epiteto'\n , 'e.d130'\n , 'e.ht'\n , 'e.densidad'\n , 'e.ecuacion'\n , 'e.fraccion'\n , 'e.biomasa'\n , 'e.carbono'\n ])\n ->get();\n\n //dd($result);\n\t\t\n\t\t$tabla = '\n\t\t\t<table id=\"miTablaPersonalizada\" class=\"table table-striped table-responsive\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>id</th>\n\t\t\t\t\t\t<th>Especie</th>\n\t\t\t\t\t\t<th>d130</th>\n\t\t\t\t\t\t<th>ht</th>\n\t\t\t\t\t\t<th>Densidad</th>\n\t\t\t\t\t\t<th>Fracción</th>\n\t\t\t\t\t\t<th>Ecuación</th>\n\t\t\t\t\t\t<th>Carbono</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t';\n\n foreach ($result as $registro) {\n\n \t$tabla .= '\n \t\t\t<tr>\n\t\t\t\t\t\t<td>' . $registro->id . '</td>\n\t\t\t\t\t\t<td>' . $registro->genero . ' ' . $registro->epiteto . '</td>\n\t\t\t\t\t\t<td>' . round($registro->d130, 1) . '</td>\n\t\t\t\t\t\t<td>' . round($registro->ht, 1) . '</td>\n\t\t\t\t\t\t<td>' . round($registro->densidad, 2) . '</td>\n\t\t\t\t\t\t<td>' . round($registro->fraccion, 2) . '</td>\n\t\t\t\t\t\t<td>' . $registro->ecuacion . '</td>\n\t\t\t\t\t\t<td><b>' . round($registro->carbono, 2) . '</b></td>\n\t\t\t\t\t</tr>\n \t';\n }\n\n $tabla .= '\n \t\t</tbody>\n\t\t\t</table>\n\t\t\t';\n\t\t\n\t\treturn response($tabla);\n }", "function Consulta_Informacion_Metas()\n {\n $sql=\"SELECT b.id,b.uid,year(b.fecha_inicio) AS ano, sum(b.no_dias) as no_dias,count(substr(b.fecha_inicio,1,4)) AS no_regs,\n sum(b.cantidad) AS total,a.name\n FROM crm_proyeccion as b LEFT JOIN users as a ON b.uid = a.uid\n WHERE b.active = 1 AND b.gid='\".$this->gid.\"' \".$this->filtro.\"\n GROUP BY substr(b.fecha_inicio,1,4)\n ORDER BY substr(b.fecha_inicio,1,4)\";\n $res=$this->db->sql_query($sql) or die (\"Error en la consulta: \".$sql);\n if($this->db->sql_numrows($res) > 0)\n {\n while(list($id,$_uid,$ano,$no_dias,$no_reg,$cantidad,$name) = $this->db->sql_fetchrow($res))\n {\n $this->array_metas[$ano]= $cantidad;\n }\n }\n }", "public function get_mascota_ex(){\n\t\t$id_zootecnico = $this->session->userdata('s_id_zootecnico');\n\t\t$data = array();\n\t\t$this->db->select('m.id_mascota, m.nombre, m.sexo, m.color, r.nombre AS \"raza\"');\n\t\t$this->db->from('mascota m, raza r, zootecnico z, cliente c, \n\t\t\tasignacion_cliente_z cz, asignacion_cliente_m cm');\n\t\t$this->db->where('m.id_raza = r.id_raza');\n\t\t$this->db->where('m.status != ','Perdido');\n\t\t$this->db->where('m.status != ','Finado');\n\t\t$this->db->where('m.id_mascota = cm.id_mascota');\n\t\t$this->db->where('cm.id_cliente = c.id_cliente');\n\t\t$this->db->where('c.id_cliente = cz.id_cliente');\n\t\t$this->db->where('cz.id_zootecnico = z.id_zootecnico');\n\t\t$this->db->where('z.id_zootecnico !=', $id_zootecnico);\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n\t\t\tforeach ($query->result_array() as $row){\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t}\n\t\t$query->free_result();\n\t\treturn $data;\n\t}", "function LUPE_criar_tabela_tab($prefixo, $rs, $vetCampo, $vetHidTab, $exc_tabela = '', $exc_campo = '') {\r\n\r\n echo \"<table id='tab{$prefixo}_Tabela' width='100%' border='1' cellspacing='0' cellpadding='0' vspace='0' hspace='0' class='Generica'>\\n\";\r\n echo \"<tr class='Generica'>\\n\";\r\n\r\n if (Ativo()) {\r\n echo \"<td class='Acao' width='1%' nowrap>\";\r\n echo '<a href=\"\" onclick=\"return tab'.$prefixo.'_Incluir();\" class=\"Titulo\"><img src=\"imagens/Incluir.gif\" border=\"0\" alt=\"Incluir\"></a>';\r\n echo \"</td>\\n\";\r\n }\r\n\r\n ForEach($vetCampo as $Campo => $Valor ) {\r\n echo \"<td class='Titulo'><b>\\n\";\r\n echo $Valor['nome'];\r\n echo \"</b></td>\\n\";\r\n }\r\n\r\n echo \"</tr>\\n\";\r\n\r\n if (mssql_num_rows($rs) != 0) {\r\n for ($i = 0; $i < mssql_num_rows($rs); $i++) {\r\n $row = mssql_fetch_array($rs);\r\n\r\n echo \"<tr id='tab{$prefixo}_linha{$i}' align=left>\\n\";\r\n\r\n if (Ativo()) {\r\n echo \"<td class='Acao' nowrap>\";\r\n\r\n echo '<a class=\"Registro\" href=\"\" onclick=\"return tab'.$prefixo.'_Alterar('.$i.');\"><img src=\"imagens/Alterar.gif\" border=\"0\" alt=\"Alterar\"></a>';\r\n\r\n echo '&nbsp;';\r\n\r\n echo '<a class=\"Registro\" href=\"\" onclick=\"return tab'.$prefixo.'_Excluir('.$i.');\"><img src=\"imagens/Excluir.gif\" border=\"0\" alt=\"Excluir\"></a>';\r\n\r\n if ($exc_campo == '' || $exc_tabela == '') {\r\n $exclui = 'N';\r\n } else {\r\n $sql = \"select $exc_campo from $exc_tabela where $exc_campo = \".$row[$exc_campo];\r\n if (mssql_num_rows(execsql($sql)) == 0)\r\n $exclui = 'N';\r\n else\r\n $exclui = 'E';\r\n }\r\n\r\n echo \"<input id='{$prefixo}_excluir$i' type='hidden' name='{$prefixo}_excluir[]' value='$exclui'>\\n\";\r\n\r\n ForEach($vetHidTab as $Valor)\r\n \t echo \"<input id='{$prefixo}_$Valor$i' type='hidden' name='{$prefixo}_{$Valor}[]' value='\".$row[$Valor].\"'>\\n\";\r\n\r\n echo \"</td>\\n\";\r\n }\r\n\r\n ForEach($vetCampo as $Campo => $Valor ) {\r\n echo \"<td id='{$prefixo}_cel_{$Campo}_{$i}' class='Registro'>\\n\";\r\n\r\n switch ($Valor['tipo']) {\r\n \tcase 'descDominio':\r\n if ($Valor['vetDominio'][$row[$Campo]] == '')\r\n echo $row[$Campo];\r\n else\r\n echo $Valor['vetDominio'][$row[$Campo]];\r\n \t\tbreak;\r\n\r\n default:\r\n echo $row[$Campo];\r\n \t\tbreak;\r\n }\r\n\r\n echo \"</td>\\n\";\r\n }\r\n\r\n echo\"</tr>\\n\";\r\n }\r\n }\r\n\r\n echo \"</table>\\n\";\r\n echo \"<script type='text/javascript'>\r\n tab{$prefixo}_TotLin = \".mssql_num_rows($rs).\";\r\n tab{$prefixo}_AtuLin = -1;\r\n </script>\";\r\n\r\n return 0;\r\n}", "public function rellenarTabla($cabecera,$cuerpo,$ini,$fin,$tipo){\n \n if($tipo == '1'){\n $tabla = \"<table class='table font-10 text-center'>\";\n $tablaHead =\"<thead><tr><th class='text-center'>FAMILIAR</th>\";\n }else{\n $tabla = \"<table class='table font-10 text-center'>\";\n $tablaHead =\"<thead><tr><th>NOMBRE</th>\";\n }\n \n //*********Se agregan las cabeceras a las tablas********\n \n $numRegistros = count($cabecera);\n \n for ($i=$ini; $i < $fin; $i++) {\n \n if($i < $numRegistros){\n $tablaHead = $tablaHead.\"<th class='text-center'>\".$cabecera[$i]->NOMBRE_ENFER.\"</th>\";\n }\n \n }\n\n $endThead = \"</tr></thead>\";\n $tablaBody = \"<tbody>\";\n $seEncontroRel = FALSE;\n\n //***********se agrega el body a las tablas************\n\n foreach ($cuerpo as $rel) {\n $enfermedad = explode(\",\", $rel->ENFERMEDAD);\n $numEnf = count($enfermedad);\n $rowTable = \"</tr><td>\".$rel->NOMBRE_PAR.\"</td>\";\n //se recorre las enfermedades en base a un inicio y un fin\n for ($i=$ini; $i < $fin; $i++) {\n //es te if es para que en caso de que el fin sea mayor al del arreglo no se rompa\n if($i < $numRegistros){\n //se recorren los enfermedades relacionadas\n for ($j=0; $j < $numEnf; $j++) {\n //se valisa si son iguales\n if($cabecera[$i]->ID_ENFER_PK == $enfermedad[$j]){\n //echo \"valor 1 \".$cabecera[$i]->ID_ENFER_PK.\"<br>\";\n //echo \"valor 2 \".$enfermedad[$j].\"<br>\";\n $seEncontroRel = TRUE;\n break;\n }else{\n $seEncontroRel = FALSE;\n }\n }\n //en base a la variable se agrega si o no\n if($seEncontroRel == FALSE){\n //se agrega un No si no corresponde\n $rowTable = $rowTable.\"<td>NO</td>\";\n }else{\n //se agrega un Si cuando sena iguales\n $rowTable = $rowTable.\"<td>SI</td>\";\n }\n }\n }\n //se agregan los valores a la tabla\n $tablaBody = $tablaBody.$rowTable.\"<tr>\";\n }\n //*****************************************************\n \n $endTBody = \"</tbody>\";\n $endTabla = \"</table>\";\n \n //se concatenan todos los valores para la creacion de la tabla\n $tablaFamily = $tabla.$tablaHead.$endThead.$tablaBody.$endTBody.$endTabla;\n\n //Se regresa la tabla\n return $tablaFamily;\n }", "function getAllTablesBar(){\n\n return $this->db->table('mesas')\n ->select('numero_Mesa, forma, personas, alto, ancho')\n ->where('id_puntos = 1')\n ->get()\n ->getResult();\n }", "public function get_CSV_Tal()\n\t\t {\n\n $handle = fopen(\"./tables/talents.csv\", \"r\");\n \n $first_row = true;\n $final_ata = array();\n $headers = array();\n \n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) \n\t\t\t{ \n if($first_row) \n\t\t\t\t{\n $headers = $data;\n $first_row = false;\n } else {\n $final_ata[] = array_combine($headers, array_values($data));\n }\n }\n \n $result_arr = array(); \n foreach($final_ata as $key => $value){\n $name = $final_ata[$key]['Abkuerzung'];\n $result_arr[$name] = $value;\n }\n return($result_arr); \n }", "function tabla_filas_compra_pago($filas,$tpago,$monto,$moneda,$tcambio,$opera,$boucher,$observ,$empresa,$caja,$banco,$cuenta,$tcambiodia){\n\t\t$tpago = explode(\"|\", $tpago);\n\t\t$monto = explode(\"|\", $monto);\n\t\t$moneda = explode(\"|\", $moneda);\n\t\t$tcambio = explode(\"|\", $tcambio);\n\t\t$opera = explode(\"|\", $opera);\n\t\t$boucher = explode(\"|\", $boucher);\n\t\t$observ = explode(\"|\", $observ);\n\t\t$empresa = explode(\"|\", $empresa);\n\t\t$caja = explode(\"|\", $caja);\n\t\t$banco = explode(\"|\", $banco);\n\t\t$cuenta = explode(\"|\", $cuenta);\n\t\t//----\n\t\t\t$salida.= '<table>';\n\t$i = 1;\t\n\t$total = 0;\n\tif($filas>0){\n\t\tfor($i = 1; $i <= $filas; $i ++){\n\t\t\t//acumulado\n\t\t\t$Dcambiar = 0;\n\t\t\t$Dcambiar = Cambio_Moneda($tcambio[$i],$tcambiodia,$monto[$i]);\n\t\t\t$total += $Dcambiar;\n\t\t\t//-\n\t\t\t$salida.= '<td>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Ttpag'.$i.'\" id = \"Ttpag'.$i.'\" value = \"'.$tpago[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tmonto'.$i.'\" id = \"Tmonto'.$i.'\" value = \"'.$monto[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tmoneda'.$i.'\" id = \"Tmoneda'.$i.'\" value = \"'.$moneda[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Ttipcambio'.$i.'\" id = \"Ttipcambio'.$i.'\" value = \"'.$tcambio[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Toperador'.$i.'\" id = \"Toperador'.$i.'\" value = \"'.utf8_decode($opera[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tboucher'.$i.'\" id = \"Tboucher'.$i.'\" value = \"'.trim($boucher[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tobserva'.$i.'\" id = \"Tobserva'.$i.'\" value = \"'.utf8_decode($observ[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tsucur'.$i.'\" id = \"Tsucur'.$i.'\" value = \"'.$empresa[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tcaja'.$i.'\" id = \"Tcaja'.$i.'\" value = \"'.$caja[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tbanco'.$i.'\" id = \"Tbanco'.$i.'\" value = \"'.$banco[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tcuenta'.$i.'\" id = \"Tcuenta'.$i.'\" value = \"'.$cuenta[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t}\n\t}\t\t\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"PagFilas\" id = \"PagFilas\" value = \"'.$filas.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"PagTotal\" id = \"PagTotal\" value = \"'.$total.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '</table>';\n\t\n\treturn $salida;\n}", "public function vistaMateriaModel($tabla){\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT id, id_maestro, nombre, horas, creditos, id_grupo FROM $tabla\");\t\r\n\t\t$stmt->execute();\r\n\r\n\t\t#fetchAll(): Obtiene todas las filas de un conjunto de resultados asociado al objeto PDOStatement. \r\n\t\treturn $stmt->fetchAll();\r\n\r\n\t\t$stmt->close();\r\n\r\n\t}", "static public function ctrAgregarTabla($datos){\n\n\t\t\n\t\techo '<table class=\"table table-bordered\">\n <tbody>\n <tr>\n <th style=\"width: 10px;\">#</th>\n <th style=\"width: 10px;\">Cantidad</th>\n <th style=\"width: 400px;\">Articulo</th>\n <th style=\"width: 70px;\">Precio</th>\n <th style=\"width: 70px;\">Total</th>\n <th style=\"width: 10px;\">Opciones</th> \n </tr>';\n\t\t\n\t\t\techo \"<tr>\n\t\t\t\t\t\n\t\t\t\t\t<td>1.</td>\n\t\t\t\t\t<td><span class='badge bg-red'>\".$datos['cantidadProducto'].\"</span></td>\n\t\t\t\t\t<td>\".$datos['productoNombre'].\"</td>\n\t\t\t\t\t<td style='text-align: right;'>$ \".$datos['precioVenta'].\".-</td>\n\t\t\t\t\t<td style='text-align: right;'>$ \".$datos['cantidadProducto']*$datos['precioVenta'].\".-</td>\n\t\t\t\t\t<td><button class='btn btn-link btn-xs' data-toggle='modal' data-target='#myModalEliminarItemVenta'><span class='glyphicon glyphicon-trash'></span></button></td>\n\t\t\t\t\t\n\t\t\t\t </tr>\";\n\t\t\t\t\n\t\techo '</tbody></table>';\n\t\t\t\t\n\t\t\n\t}", "abstract public function datatables();", "protected function getTcaTables() {}", "public function obtenerTabla() {\n $builder = $this->db->table($this->table);\n $data = $builder->get()->getResult();\n $tabla = '';\n foreach($data as $item):\n $accion = '<div class=\\\"custom-control custom-radio\\\">';\n $accion .= '<input type=\\\"radio\\\" id=\\\"row-'.$item->tipoTelefonoId.'\\\" name=\\\"id\\\" class=\\\"custom-control-input radio-edit\\\" value=\\\"'.$item->tipoTelefonoId.'\\\">';\n $accion .= '<label class=\\\"custom-control-label\\\" for=\\\"row-'.$item->tipoTelefonoId.'\\\"> </label> </div>';\n $tabla .= '{\n \"concepto\" : \"'.$item->tipoTelefonoTipo.'\",\n \"acciones\" : \"'.$accion.'\"\n },';\n endforeach;\n $tabla = substr($tabla, 0, strlen($tabla) - 1);\n $result = '{\"data\" : ['. $tabla .']}';\n return $this->response->setStatusCode(200)->setBody($result);\n }", "function tabla($base, $limite){\n\n\t\t$array = range ($base, $limite); //al array le asigno el rango en el que se tiene que crear\n\n\t\t\treturn $array; // pido que me lo devuelva\n\t}", "function getTitulos() {\n //arreglo para remplazar los titulos de las columnas \n $titulos_campos['dep_id'] = COD_DEPARTAMENTO;\n $titulos_campos['dep_nombre'] = NOMBRE_DEPARTAMENTO;\n\n $titulos_campos['der_id'] = COD_DEPARTAMENTO_REGION;\n $titulos_campos['der_nombre'] = NOMBRE_DEPARTAMENTO_REGION;\n\n $titulos_campos['mun_id'] = COD_MUNICIPIO;\n $titulos_campos['mun_nombre'] = NOMBRE_MUNICIPIO;\n $titulos_campos['mun_poblacion'] = POB_MUNICIPIO;\n\n $titulos_campos['ope_id'] = OPERADOR;\n $titulos_campos['ope_nombre'] = OPERADOR_NOMBRE;\n $titulos_campos['ope_sigla'] = OPERADOR_SIGLA;\n $titulos_campos['ope_contrato_no'] = OPERADOR_CONTRATO_NRO;\n $titulos_campos['ope_contrato_valor'] = OPERADOR_CONTRATO_VALOR;\n\n $titulos_campos['Id_Ciudad'] = TITULO_CIUDAD;\n $titulos_campos['Id_Pais'] = NOMBRE_PAIS;\n $titulos_campos['Nombre_Ciudad'] = NOMBRE_CIUDAD;\n\n $titulos_campos['Nombre_Pais'] = NOMBRE_PAIS;\n\n $titulos_campos['Id_Familia'] = TITULO_FAMILIAS;\n $titulos_campos['Descripcion_Familia'] = DESCRIPCION_FAMILIA;\n\n $titulos_campos['Id_Moneda'] = TITULO_MONEDA;\n $titulos_campos['Descripcion_Moneda'] = DESCRIPCION_MONEDA;\n\n $titulos_campos['cfi_numero'] = CUENTA_NUMERO;\n $titulos_campos['cfi_nombre'] = CUENTA_NOMBRE;\n\n $titulos_campos['cft_id'] = CUENTA_TIPO;\n $titulos_campos['cft_nombre'] = CUENTA_TIPO;\n\n $titulos_campos['mov_descripcion'] = MOVIMIENTO_DESCRIPCION;\n $titulos_campos['mov_tipo'] = MOVIMIENTO_TIPO;\n\n $titulos_campos['idCentroPoblado'] = TITULO_CENTRO_POBLADO;\n $titulos_campos['codigoDane'] = CODIGO_DANE_CENTRO_POBLADO;\n $titulos_campos['nombre'] = NOMBRE_CENTRO_POBLADO;\n $titulos_campos['mun_id'] = MUNICIPIO_CENTRO_POBLADO;\n\n $titulos_campos['enc_tipo_nombre'] = TIPO_INSTRUMENTO;\n $titulos_campos['enc_tipo_desc'] = DESCRIPCION_ACTIVIDAD;\n\n $titulos_campos['Descripcion_Tipo'] = \"Plan\";\n \n $titulos_campos['descripcionTipoHallazgo'] = DESCRIPCION_TIPO_HALLAZGO;\n $titulos_campos['descripcion'] = AREA_TIPO_HALLAZGO;\n\n return $titulos_campos;\n }", "public function buscarTablaPertenece($idCampo)\r\n {\r\n\r\n $mg = ZendExt_Aspect_TransactionManager::getInstance();\r\n $conn = $mg->getConnection('metadatos');\r\n $query = Doctrine_Query::create($conn);\r\n $result = $query->select('t.idnomeav,t.nombre,t.fechaini,t.fechafin,t.root,t.concepto,t.externa,\r\n\t\tc.idcampo,c.idnomeav,c.nombre,c.tipo,c.longitud,c.nombre_mostrar,c.regex,c.descripcion,c.tipocampo,c.visible')\r\n ->from('NomNomencladoreavestruc t')\r\n ->innerJoin('t.NomCampoestruc c')\r\n ->where(\"c.idcampo='$idCampo'\")\r\n ->execute()\r\n ->toArray();\r\n $arreglo = isset($result[0]) ? $result[0] : array();\r\n return $arreglo;\r\n }", "function mostrar_tabla()\n {\n return $this->mostrar_tabla_slickgrid();\n /*\n $sPrefs = '';\n $id_usuario= core\\ConfigGlobal::mi_id_usuario();\n $tipo = 'tabla_presentacion';\n $oPref = new usuarios\\Preferencia(array('id_usuario'=>$id_usuario,'tipo'=>$tipo));\n $sPrefs=$oPref->getPreferencia();\n if ($sPrefs == 'html') {\n return $this->mostrar_tabla_html();\n } else {\n return $this->mostrar_tabla_slickgrid();\n }\n */\n }", "function getColumnas($conn, $exitosa) {\n\t\tif ($exitosa){\t\t\t\n\t\t\t$sql = 'SELECT c1_int, c2_int FROM #php_test_table';\n\t\t\t\n\t\t\techo '<table border=1 >';\t\t\n\t\t\tprint \"<tr>\";\n\t\t\tprint \"<td><b> c1_int </b></td>\";\n\t\t\tprint \"<td><b> c2_int </b></td>\";\n\t\t\tprint \"</tr>\";\n\t\t\tforeach ($conn->query($sql) as $row) {\n\t\t\t\tprint \"<tr>\";\n\t\t\t\tprint \"<td>\" . $row['c1_int'] . \"</td>\";\n\t\t\t\tprint \"<td>\" . $row['c2_int'] . \"</td>\";\n\t\t\t\tprint \"</tr>\";\n\t\t\t}\n\t\t\techo '</table>';\n\t\t}\n\t}", "function ImprimeTableP($idTabla, $data, $pactu, $peli, $crxpag, $paginap = 1, $cantlink = 5,$classCSS=\"\") {\n\t\t$tabla = '<table id=\"' . $idTabla . '\" class=\"'.$classCSS.'\" cellpadding=\"0\" cellspacing=\"1\" border=\"1\" align=\"center\" style=\"text-align:center;\" >';\n try {\n //if (count($data) > 0) {\n\t\t\t if (count($data[\"columnas\"]) > 0) {\n\t\t\t\t$tabla.= '<thead>';\n $tabla .= '<tr>';\n $conta = 0;\n $conte = 0;\n for ($x = 0;$x < count($data[\"columnas\"]);$x++) {\n if ($pactu != \"\") {\n if ($conta == 0) {\n $tabla.= '<td></td>';\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {\n $tabla.= '<td></td>';\n }\n }\n $conta++;\n $conte++;\n $tabla.= '<th>' . utf8_encode($data[\"columnas\"][$x]) . '</th>'.\"\\n\";\n //$tabla.= Columna_Cabezera(\"f1\", utf8_encode($data[\"columnas\"][$x]));\n \n }\n \t\t$tabla.= '</tr>';\n\t\t\t\t$tabla.= '</thead>';\n\t\t\t }\n\t\t\t\n //===========CUERPO DE TABLA=================================================================================================\n $cantele = count($data[\"cuerpo\"]);\n if ($cantele > 0) {\n $fin = $paginap * $crxpag;\n $ini = $fin - $crxpag;\n for ($i = $ini;$i < $fin;$i++) {\n $conta = 0;\n $conte = 0;\n $tabla.= '<tr>';\n for ($z = 0;$z < count($data[\"columnas\"]);$z++) {\n $columnas = $data[\"columnas\"][$z];\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n if ($pactu != \"\") {\n if ($conta == 0) {\n // $tabla.= '<td><a href=\"' . $pactu . 'id=' . $data[\"cuerpo\"][$i][\"$columnas\"] . '&accion=Mactualizar\"><img src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>'.\"\\n\";\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"'.$pactu.'('. $data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" title=\"Actualizar\" ><img src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n // $tabla.= '<td><a href=\"' . $peli . 'id=' . $data[\"cuerpo\"][$i][\"$columnas\"] . '&accion=Eliminar\"><img src=\"../imgcixphp/ico_eliminar.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>'.\"\\n\";\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"'.$peli.'('.$data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" ><img src=\"../imgcixphp/delete.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n }\n $conta++;\n $conte++;\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n $tabla.= '<td>' . $data[\"cuerpo\"][$i][\"$columnas\"] . '</td> '.\"\\n\";\n }\n }\n $tabla.= '</tr>';\n } \n\t\t\t\t//===========FIN CUERPO DE TABLA===========================================================================================\n \t $tabla.= '</table><p style=\"clear:both;height:5px;\"></p>';\n\t\t\t \n\t\t\t //===========PAGINADO======================================================================================================================\n \t$paginado = Paginar($cantele, $crxpag, $paginap, $cantlink);\n $tabla.= $paginado;\n //===========FIN PAGINADO ==================================================================================================================\n \n \n }else{//solo si es k no hay datos\n\t\t\t\t$mensaje= \"No se encuentran Datos Registrados\"; \n\t\t\t \t $tabla.='<tfoot><tr> <td >&nbsp; '.$mensaje.' </td></tr></tfoot></table><br/>';\n\t\t\t\t}\n\t\t\t\n }catch(exception $e) {\n return $e->getMessage();\n }\n return $tabla;\n }", "function tabla_directores(){\n $fichero = \"bbdd/directores.csv\";\n $array_directores;\n\n //Si existe el fichero lo abrimos para leerlo\n $manejador = fopen($fichero, \"r\");\n if($manejador != FALSE){\n $j=0;\n while(($arrayFila= fgetcsv($manejador, 1000, \",\")) != FALSE){ \n $array_directores[$j] = array(\"id\" => $arrayFila[0], \"nombre\" => $arrayFila[1], \"anyo\" => $arrayFila[2], \"lugar\" => $arrayFila[3]);\n $j++;\n } \n fclose($manejador);\n } \n return $array_directores;\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 tabla()\n\t\t{\t//condicion para la proteccion de las vistas\n\t\t\t$id_empleado = $_SESSION['id_empleado'];\n\t\t\tif ($id_empleado == null)\n\t\t\t{\n\t\t\t\tredirect(base_url() . 'index.php/header/controller_inicio/login');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->load->view(\"header/Header_caja\");\n\t\t\t\t$this->load->view(\"ventas/Tabla_dinamica_producto\");\n\t\t\t}\n\t\t}", "function temporalidad($rm_id){\n $resultado=$this->model_mestrategico->get_resultado_mplazo($rm_id); \n $programado=$this->model_mestrategico->get_resultado_mplazo_programado($rm_id);\n $configuracion=$this->model_proyecto->configuracion_session();\n $tabla = '';\n $nro=0;\n foreach($programado as $row) {\n $nro++;\n $matriz [1][$nro]=$row['g_id'];\n $matriz [2][$nro]=$row['rmp_prog'];\n }\n\n $g=$configuracion[0]['conf_gestion_desde'];\n for($j = 1; $j<=5; $j++){\n $matriz_r[1][$j]=$g;\n $matriz_r[2][$j]='0'; //// P\n $matriz_r[3][$j]='0'; //// PA\n $matriz_r[4][$j]='0'; //// %PA\n $g++;\n }\n\n for($i = 1 ;$i<=$nro ;$i++){\n for($j = 1 ;$j<=5 ;$j++){\n if($matriz[1][$i]==$matriz_r[1][$j]){\n $matriz_r[2][$j]=round($matriz[2][$i],2);\n }\n }\n }\n\n $pa=0;\n for($j = 1 ;$j<=5 ;$j++){\n $pa=$pa+$matriz_r[2][$j];\n $matriz_r[3][$j]=$pa+$resultado[0]['rm_linea_base'];\n if($resultado[0]['rm_meta']!=0){\n $matriz_r[4][$j]=round(((($pa+$resultado[0]['rm_linea_base'])/$resultado[0]['rm_meta'])*100),2);\n }\n }\n return $matriz_r;\n }", "function ispis_tablice($ucenici)\n {\n echo '<table border=1>';\n foreach ($ucenici as $key => $ime) {\n echo '<tr><td>'\n .$key.'</td>;\n <td>'.$ime.'</td>;\n </tr>';\n }\n echo '</table>';\n }", "public function mostrar_tabla_anuncios(){\n\n\t\t$return = '';\n\t\t$mensaje = array('0' => 'Desactivado', '1' => 'Activo');\n\t\t$cols = array('id', 'clave_interna', 'provincia', 'municipio', 'tipo_venta', 'anuncio_promocionado',\n\t\t\t\t\t 'anuncio_e','paquete','activo','apto');\n\t\t$this->where('ussr',$this->user);\n\n\t\tif($salida = $this->get('anuncios', NULL, $cols)){\n\n\t\t\t$return .= '<table class=\"table table-bordered table-hover\">';\n\n\t\t\t$return .= '<tr>\n\t\t\t\t\t <th>Imagen</th>\n\t\t\t\t\t <th>Clave interna</th>\n\t\t\t\t\t <th>Paquete</th>\n\t\t\t\t\t <th>Provincia</th>\n\t\t\t\t\t <th>Operacion</th>\n\t\t\t\t\t <th>Nº imagenes</th>\n\t\t\t\t\t <th>Idiomas</th>\n\t\t\t\t\t <th>Contratado</th>\n\t\t\t\t\t <th>Anuncio apto</th>\n\t\t\t\t\t <th>Anuncio activo</th>\n\t\t\t\t\t <th>Opciones</th>\n\t\t\t\t\t </tr>';\n\t\t\t//por cada anuncio varias cosas habra que hacer\n\t\t\t$i=1;\t\t \n\t\t\tforeach ($salida as $key => $value) {\n\t\t\n\t\t\t\t$num = $i++;\n\t\t\t\t$id_arr = md5($value['id']);\n\t\t\t\t$imagen = $this->sacar_foto($id_arr, $this->user);\n\n\t\t\t\t$return .='<tr>\n\t\t\t\t\t \t<td>'.$imagen.'</td>\n\t\t\t\t\t <td>'.$value['clave_interna'].'</td>\n\t\t\t\t\t <td>'.$value['paquete'].'</td>\n\t\t\t\t\t <td>'.$value['provincia'].'<br />\n\t\t\t\t\t '.$this->show_municipio($value['municipio']).'</td>\n\t\t\t\t\t <td>'.$value['tipo_venta'].'</td>';\n\n\n\n\t\t\t\t//mostrara numero de imagenes en el anuncio\n\t\t\t\t$return .='<td>';\n\t\t\t\t$return .= $this->num_imagenes_anuncio($value['id']);\n\t\t\t\t$return .='</td>';\n\n\n\t\t\t\t//mostrando idiomas en los que esta el anuncio\n\t\t\t\t$return .='<td>';\n\t\t\t\t$return .= $this->idiomas_del_anuncio($value['id']);\n\t\t\t\t$return .='</td>';\n\n\t\t\t\t//estrella o promocionado\n\t\t\t\t$return .='<td>';\n\t\t\t\tif(!empty($value['anuncio_promocionado']) && ($value['anuncio_promocionado'] == 1)){\n\t\t\t\t\t$return .= 'Anuncio promocionado<br />';\t}\n\t\t\t\tif($value['anuncio_e'] == 1){\n\t\t\t\t\t$return .= 'Anuncio estrella';\t\t\t}\t\n\t\t\t\t\t\n\t\t\t $return .= '</td>';\n\t\t\t $return .= '<td>'.$value['apto'].'</td>';\n\t\t\t $return .= '<td id=\"act-'.$id_arr.'\">'.$mensaje[$value['activo']].'</td>';\n\t\t\t //dropdown de opciones\n\t\t\t $return .= '<td>'.$this->dropdown_tabla_anuncios($id_arr).'</td>';\n\t\t\n\t\t\t\t$return .= '</tr>';\n\n\t\t\t}//fin del foreach\n\n\t\t\t$return .= '</table>';\n\n\n\t\t}else{\n\t\t\t$return .= '<h5 id=\"sec1\">No hay anuncios 1 </h5>';\n\t\t}\n\n\t\treturn $return;\n\t}", "function setTabla($filas,$columnas){\r\n\t\t$this->setTitulo(\"Fotos\");\t\r\n\t\t$str=\"\";\r\n\t\t$contador=1;\r\n\t\t$str=\"<table>\";\r\n\t\tfor($i=0;$i<$filas;$i++){\r\n\t\t\t$str=$str.\"<tr>\";\r\n\t\t\tfor($j=0;$j<$columnas;$j++){\r\n\t\t\t\t$photo=\"photo_\".$contador++.\".png\";\r\n\t\t\t\t$str=$str.\"<td><img src='\".$photo.\"' width='150' height='150'></td>\";\r\n\t\t\t}\r\n\t\t\t$str=$str.\"</tr>\";\r\n\t\t}\r\n\t\t$str=$str.\"</table>\";\r\n\t\t$this->setContenido($str);\r\n\t}", "public function cabecera_2020($com_id,$tp){\n $obj_est=$this->model_producto->list_oestrategico($com_id); /// Objetivos Estrategicos\n $componente = $this->model_componente->get_componente_pi($com_id); //// DATOS COMPONENTE\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']); /// DATOS FASE\n //$proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']); //// DATOS PROYECTO\n $proyecto = $this->model_proyecto->get_datos_proyecto_unidad($fase[0]['proy_id']);\n\n $tabla='';\n $tabla.='<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" style=\"width:100%;\" align=\"center\">\n <tr>\n <td colspan=\"2\" style=\"width:100%; height: 1.2%; font-size: 14pt;\"><b>'.$this->session->userdata('entidad').'</b></td>\n </tr>\n <tr style=\"font-size: 8pt;\">\n <td style=\"width:10%; height: 1.2%\"><b>DIR. ADM.</b></td>\n <td style=\"width:90%;\">: '.strtoupper($proyecto[0]['dep_departamento']).'</td>\n </tr>\n <tr style=\"font-size: 8pt;\">\n <td style=\"width:10%; height: 1.2%\"><b>UNI. EJEC.</b></td>';\n if($tp==1){ // pdf\n $tabla.='<td style=\"width:90%;\">: '.strtoupper($proyecto[0]['dist_distrital']).'</td>';\n }\n else{ // excel\n $tabla.='<td style=\"width:90%;\">: '.mb_convert_encoding(strtoupper($proyecto[0]['dist_distrital']), 'cp1252', 'UTF-8').'</td>';\n }\n $tabla.='\n </tr>\n <tr style=\"font-size: 8pt;\">';\n if($this->gestion!=2020){\n $tabla.='<td style=\"height: 1.2%\"><b>';\n if($proyecto[0]['tp_id']==1){\n $tabla.='PROY. INV. ';\n }\n else{\n $tabla.='ACTIVIDAD ';\n }\n $tabla.='</b></td>';\n $tabla.='<td>: '.$proyecto[0]['aper_programa'].''.$proyecto[0]['aper_proyecto'].''.$proyecto[0]['aper_actividad'].' - '.strtoupper($proyecto[0]['proy_nombre']).'</td>';\n }\n else{\n $tabla.='<td style=\"height: 1.2%\"><b>';\n if($proyecto[0]['tp_id']==1){\n $tabla.='PROY. INV. ';\n }\n else{\n $tabla.=''.$proyecto[0]['tipo_adm'].' ';\n }\n $tabla.='</b></td>';\n if($tp==1){ /// pdf\n if($proyecto[0]['tp_id']==1){\n $tabla.='<td>: '.$proyecto[0]['aper_programa'].''.$proyecto[0]['aper_proyecto'].''.$proyecto[0]['aper_actividad'].' - '.strtoupper($proyecto[0]['proy_nombre']).'</td>';\n }\n else{\n $tabla.='<td>: '.$proyecto[0]['aper_programa'].''.$proyecto[0]['aper_proyecto'].''.$proyecto[0]['aper_actividad'].' '.$proyecto[0]['tipo'].' - '.strtoupper($proyecto[0]['act_descripcion']).'-'.$proyecto[0]['abrev'].'</td>';\n }\n }\n else{ /// Excel\n if($proyecto[0]['tp_id']==1){\n $tabla.='<td>: '.$proyecto[0]['aper_programa'].''.$proyecto[0]['aper_proyecto'].''.$proyecto[0]['aper_actividad'].' - '.mb_convert_encoding(strtoupper($proyecto[0]['proy_nombre']), 'cp1252', 'UTF-8').'</td>';\n }\n else{\n $tabla.='<td>: '.$proyecto[0]['aper_programa'].''.$proyecto[0]['aper_proyecto'].''.$proyecto[0]['aper_actividad'].' '.$proyecto[0]['tipo'].' - '.mb_convert_encoding(strtoupper($proyecto[0]['act_descripcion']), 'cp1252', 'UTF-8').'-'.$proyecto[0]['abrev'].'</td>';\n }\n } \n }\n $tabla.='\n </tr>\n <tr style=\"font-size: 8pt;\">';\n if($this->gestion!=2020){\n $tabla.='<td style=\"height: 1.2%\"><b>';\n if($proyecto[0]['tp_id']==1){\n $tabla.='COMPONENTE ';\n }\n else{\n $tabla.='SUB ACTIVIDAD ';\n }\n $tabla.='</b></td>';\n }\n else{\n $tabla.='<td style=\"height: 1.2%\"><b>';\n if($proyecto[0]['tp_id']==1){\n $tabla.='COMPONENTE ';\n }\n else{\n $tabla.='SERVICIO ';\n }\n $tabla.='</b></td>';\n }\n if($tp==1){ // pdf\n $tabla.='<td>: '.strtoupper($componente[0]['com_componente']).'</td>';\n }\n else{ // excel\n $tabla.='<td>: '.mb_convert_encoding(strtoupper($componente[0]['com_componente']), 'cp1252', 'UTF-8').'</td>';\n }\n $tabla.='\n </tr>\n </table>';\n return $tabla;\n }", "public function data()\n {\n $orders=libro::all();\n foreach ($orders as $key => $value) {\n \n if(count(autor::find($value->id_autor)))\n $value->id_autor=autor::find($value->id_autor)->nombre;\n else $value->id_autor='No asignado';\n \n }\n return \\Datatables::of($orders)->addColumn('action', 'libro.partials.vista')->make(true) ; \n }", "function retornaTabelas(){\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n $aRetorno = array();\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n # Recupera o nome da tabela e gera o nome da classe\n $aRetorno[] = (string)$aTabela['NOME'];\n }\n return $aRetorno;\n }", "function Consulta_Informacion_Metas()\n {\n $sql=\"SELECT b.id,b.uid,year(b.fecha_inicio) AS ano, month(b.fecha_inicio) AS mes,b.no_dias,count(substr(b.fecha_inicio,1,7)) AS no_regs,\n sum(b.cantidad) AS total,a.name\n FROM crm_proyeccion as b LEFT JOIN users as a ON b.uid = a.uid\n WHERE b.active = 1 AND year(b.fecha_inicio) ='\".$this->ano_id.\"' AND b.gid='\".$this->gid.\"' \".$this->filtro.\"\n GROUP BY substr(b.fecha_inicio,1,7)\n ORDER BY substr(b.fecha_inicio,1,7)\";\n $res=$this->db->sql_query($sql) or die (\"Error en la consulta: \".$sql);\n if($this->db->sql_numrows($res) > 0)\n {\n while(list($id,$_uid,$ano,$mes,$no_dias,$no_reg,$cantidad,$name) = $this->db->sql_fetchrow($res))\n {\n $this->array_metas[$mes]= $cantidad;\n }\n }\n }", "public function creaTablas($numTablas,$cabecera,$cuerpo,$numero,$tipo){\n //arreglo que contendra el numero de tablas\n $datos = array();\n\n if($cuerpo == NULL || $cuerpo == \"\"){\n $datos[0] = \"<table class='table font-10'><thead></thead><tbody><tr><td colspan='6' class='text-center'>Sin Antecedentes</td></tr></tbody></table>\";\n }else{\n //se le agregan los valores por posiciones al array\n for ($i=0; $i < $numTablas; $i++) {\n \n $inicia = $numero * $i;\n $termina = $numero + $inicia;\n $datos[$i] = $this->rellenarTabla($cabecera,$cuerpo,$inicia,$termina,$tipo);\n }\n }\n return $datos;\n }", "public function getDataUmum()\n {\n return DataTables::of(DataUmum::with(['Kecamatan'])->select(['id', 'kecamatan_id', 'tipologi', 'luas_wilayah', 'jumlah_penduduk','bts_wil_utara','bts_wil_timur','bts_wil_selatan','bts_wil_barat'])->get())\n ->addColumn( 'action', function ( $data ) {\n $edit_url = route('data.data-umum.edit', $data->id );\n\n $data['edit_url'] = $edit_url;\n\n return view('forms.action', $data);\n })\n ->make();\n }", "function ImprimirCabeceraTabla($tabla){\n echo \"<table><tr>\";\n foreach ($tabla as $valor){\n\n echo \"<th>\".$valor.\"</th>\";\n \n }\n echo \"</tr>\";\n}", "public function tablaIndex(){\n $listado = IngresosB3::orderBy('fecha', 'ASC')->get();\n\n foreach ($listado as $l){\n $l->fecha = date(\"d-m-Y h:i A\", strtotime($l->fecha));\n $servicio = ServiciosB3::where('id', $l->id_servicios)->pluck('nombre')->first();\n $l->servicio = $servicio;\n }\n\n return view('backend.bodega3.verificacion.tabla.tablaverificacion', compact('listado'));\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 cunsultas()\n {\n \t $data['categoria']=categoria::get();\n \t\t$data['unidad']=unidad::get();\n\n \t\treturn $data;\n }", "function retornaEscolhidos($vetorComcadastros, $vetorComIndices){\n $limite = count($vetorComIndices);//limite conta quantos indices tem\n cabeçalhoTabela();//imprime o cabeçalho da tabela\n for($x=0; $x<$limite; $x++){//executa um for que percorre todos os indices do Vetor com os indices\n $y = $vetorComIndices[$x];//$y é igual indice do primeiro cadastro\n echo \"<tr>\";//cria linha na tabela\n echo \"<th scope='row'>$y</th>\";//escreve qual é o indice\n foreach ($vetorComcadastros[$y] as $string){//percorre todos os dados do cadastro com indice $y\n echo \"<td>$string</td>\";//cria uma celula e dentro escreve o dado\n }\n echo \"<td>\",botaoAlterar($y),\"</td>\";//cria uma celula e põe dentro o botão alterar com o indice que ele deve alterar caso clicado\n echo \"<td>\",botaoExcluir($y),\"</td>\";\n echo \"</tr>\";//finaliza a linha\n }\n echo \"</tbody>\";//encerra o corpo da tabela\n echo \"</table>\";//encerra a tabela\n }", "function prikazi_sqltabelu($sql_tabela) {\n\n\tglobal $db;\n\n\techo \"<table class='dt-table'>\";\n\techo \"<h2>\" . $sql_tabela . \"</h2>\";\n\n\t// generisanje headera tabele (prikaz podataka)\n\n\t$komanda_head = \"SELECT * FROM $sql_tabela LIMIT 1\";\n\t$result_head = mysql_query($komanda_head, $db);\t\n\n\twhile ( $red = mysql_fetch_assoc($result_head) ) :\n\n\t\t$m = 0;\n\n\t\techo \"<tr class='dt-table'>\";\n\n\t\tforeach ($red as $item) {\n\t\n\t\t\t$kolona = mysql_field_name($result_head, $m);\n \t\t\techo \"<td class='dt-table'>\" . $kolona . \"</td>\";\n \t\t\t//echo \"<td>\" . $item . \"</td>\";\n \t\t$m++;\n\n\t\t}\n\n\t\techo \"</tr>\";\n\n\tendwhile;\n\n\t// generisanje tela tabele (prikaz podataka)\n\n\t$komanda_body = \"SELECT * FROM $sql_tabela\";\n\t$result_body = mysql_query($komanda_body, $db);\n\n\n\twhile ( $red = mysql_fetch_assoc($result_body) ) :\n\n\t\t$n = 0;\n\n\t\techo \"<tr class='dt-table'>\";\n\n\t\tforeach ($red as $item) {\n\t\n\t\t\t$kolona = mysql_field_name($result_body, $n);\n \t\t\techo \"<td class='dt-table'>\" . $item . \"</td>\";\n \t\t$n++;\n\n\t\t}\n\n\t\techo \"</tr>\";\n\n\tendwhile;\n\n\techo \"</table>\";\n\n}", "static public function mdlMostraPedidosTablas($valor){\n\n\t\tif($valor != null){\n\n\t\t\t$sql=\"SELECT\n\t\t\t\t\t\tt.id,\n\t\t\t\t\t\tt.codigo,\n\t\t\t\t\t\tc.codigo AS cod_cli,\n\t\t\t\t\t\tc.nombre,\n\t\t\t\t\t\tc.tipo_documento,\n\t\t\t\t\t\tc.documento,\n\t\t\t\t\t\tt.lista,\n\t\t\t\t\t\tt.vendedor,\n\t\t\t\t\t\tt.op_gravada,\n\t\t\t\t\t\tt.descuento_total,\n\t\t\t\t\t\tt.sub_total,\n\t\t\t\t\t\tt.igv,\n\t\t\t\t\t\tt.total,\n\t\t\t\t\t\tROUND(\n\t\t\t\t\t\tt.descuento_total / t.op_gravada * 100,\n\t\t\t\t\t\t2\n\t\t\t\t\t\t) AS dscto,\n\t\t\t\t\t\tt.condicion_venta,\n\t\t\t\t\t\tcv.descripcion,\n\t\t\t\t\t\tt.estado,\n\t\t\t\t\t\tt.usuario,\n\t\t\t\t\t\tt.agencia,\n\t\t\t\t\t\tu.nombre AS nom_usu,\n\t\t\t\t\t\tDATE(t.fecha) AS fecha,\n\t\t\t\t\t\tcv.dias,\n\t\t\t\t\t\tDATE_ADD(DATE(t.fecha), INTERVAL cv.dias DAY) AS fecha_ven\n\t\t\t\t\tFROM\n\t\t\t\t\t\ting_sal t\n\t\t\t\t\t\tLEFT JOIN clientesjf c\n\t\t\t\t\t\tON t.cliente = c.codigo\n\t\t\t\t\t\tLEFT JOIN condiciones_ventajf cv\n\t\t\t\t\t\tON t.condicion_venta = cv.id\n\t\t\t\t\t\tLEFT JOIN usuariosjf u\n\t\t\t\t\t\tON t.usuario = u.id\n\t\t\t\t\tWHERE t.estado = '$valor'\n\t\t\t\t\tORDER BY fecha DESC\";\n\n\t\t$stmt=Conexion::conectar()->prepare($sql);\n\n\t\t$stmt->execute();\n\n\t\treturn $stmt->fetchAll();\n\n\t\t}else{\n\n\t\t\t$sql=\"SELECT\n\t\t\t\t\tt.id,\n\t\t\t\t\tt.codigo,\n\t\t\t\t\tc.codigo AS cod_cli,\n\t\t\t\t\tc.nombre,\n\t\t\t\t\tc.tipo_documento,\n\t\t\t\t\tc.documento,\n\t\t\t\t\tt.lista,\n\t\t\t\t\tt.vendedor,\n\t\t\t\t\tt.op_gravada,\n\t\t\t\t\tt.descuento_total,\n\t\t\t\t\tt.sub_total,\n\t\t\t\t\tt.igv,\n\t\t\t\t\tt.total,\n\t\t\t\t\tROUND(\n\t\t\t\t\tt.descuento_total / t.op_gravada * 100,\n\t\t\t\t\t2\n\t\t\t\t\t) AS dscto,\n\t\t\t\t\tt.condicion_venta,\n\t\t\t\t\tcv.descripcion,\n\t\t\t\t\tt.estado,\n\t\t\t\t\tt.usuario,\n\t\t\t\t\tt.agencia,\n\t\t\t\t\tu.nombre AS nom_usu,\n\t\t\t\t\tDATE(t.fecha) AS fecha,\n\t\t\t\t\tcv.dias,\n\t\t\t\t\tDATE_ADD(DATE(t.fecha), INTERVAL cv.dias DAY) AS fecha_ven\n\t\t\t\tFROM\n\t\t\t\t\ting_sal t\n\t\t\t\t\tLEFT JOIN clientesjf c\n\t\t\t\t\tON t.cliente = c.codigo\n\t\t\t\t\tLEFT JOIN condiciones_ventajf cv\n\t\t\t\t\tON t.condicion_venta = cv.id\n\t\t\t\t\tLEFT JOIN usuariosjf u\n\t\t\t\t\tON t.usuario = u.id\n\t\t\t\tWHERE t.codigo = $valor\";\n\n\t\t$stmt=Conexion::conectar()->prepare($sql);\n\n\t\t$stmt->execute();\n\n\t\treturn $stmt->fetch();\n\n\t\t}\n\n\t\t$stmt=null;\n\n\t}", "public function visualizar() {\n echo $this->getTabuleiro();\n }", "public function tabla_alumnos()\n {\n //Para tablas cortas o pequeñas se recomienda all();\n $ver_tabla = AlumnoModel::select('id_alumno','nombre','ap_p','ap_m','semestre','sexo','promedio')->get();\n\n return view('sistemaITO/verAlumnos')->with('tabla',$ver_tabla);\n }", "public function getEduardoShow($data)\n {\n $sql = \"SELECT * FROM \".$this->tabla.\" WHERE id=\".$data->data;\n $tmp=$this->executeQuery($sql);\n $tablas['datos'] = $tmp[0];\n $tablas['error'] = 0;\n return $tablas;\n }", "public function data_matkul(){\n\t\t$tahun = \"t_tahun_akademik\";\n\t\t$mk = \"t_mk\";\n\t\t$data['content'] = \"report/matkul\";\n\t\t$data['data_tahun'] = $this->m_aka->get_all($tahun);\n\t\t$data['mk'] = $this->m_aka->get_all($mk);\n\t\t$this->load->view(\"content\", $data);\n\t}" ]
[ "0.65467465", "0.63148", "0.6192665", "0.6175271", "0.613008", "0.60767347", "0.6075878", "0.6071638", "0.60523987", "0.59665036", "0.5959776", "0.5940634", "0.5915693", "0.59123707", "0.59095633", "0.59029126", "0.59015125", "0.5873391", "0.5813777", "0.5781051", "0.57723635", "0.5769561", "0.5765104", "0.5760702", "0.57491636", "0.5745197", "0.57297486", "0.5727078", "0.5721761", "0.571329", "0.5709816", "0.57065487", "0.5706535", "0.57061243", "0.56969255", "0.5689673", "0.5688343", "0.5688218", "0.5663741", "0.5662224", "0.5660139", "0.56534714", "0.5642558", "0.5640935", "0.5634452", "0.56137806", "0.5607996", "0.5597011", "0.559393", "0.5583523", "0.5577125", "0.5570837", "0.5570142", "0.5567554", "0.5557873", "0.5555476", "0.5547964", "0.5538706", "0.5528309", "0.5509077", "0.5506747", "0.5506037", "0.5504874", "0.55025774", "0.5492866", "0.5486778", "0.5485332", "0.54804313", "0.5478353", "0.54780304", "0.5473883", "0.5467144", "0.546663", "0.5466026", "0.546195", "0.54600346", "0.5457268", "0.5456351", "0.5451528", "0.5448648", "0.5446707", "0.5446129", "0.54398364", "0.5438605", "0.54383457", "0.5437745", "0.54372203", "0.54355365", "0.54353356", "0.5432367", "0.5431649", "0.54115564", "0.54107654", "0.54093933", "0.54079866", "0.5405589", "0.5404577", "0.5403441", "0.5403393", "0.5396067" ]
0.57510775
24
SELECCIONA mesas desde comandas. Si enviamos miMesa es para que la seleccione por defecto. Y miesto=detalle le indica que deshabilita el control.
public function seleccionaMesas($mimesa,$miestado){ $this->cargaMesas("no"); if($miestado=="detalle"){$dis="disabled";}else{$dis="";} echo "<select class='form-control form-control-sm text-primary' ".$dis." id='inputMESA' name='inputMESA' required placeholder='Mesa de Sala en la que se situa la comanda'>"; foreach ($_SESSION['MisMesas'] as $mesa){ $ubica=$mesa['MES_ID'].'-'.$mesa['SAL_ID']; if ($ubica==$mimesa){$sel="selected";}else{$sel="";} echo "<option value='".$mesa['MES_ID'].'-'.$mesa['SAL_ID']."' ".$sel." ".$dis.">"."Mesa: ".$mesa['MES_ID']." de ".$mesa['SAL_Nombre']." (".$mesa['MES_NPersonas']." personas)</option>"; } echo "</select>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function sesionesMes($ProximaObraAnyo,$ProximaObraMes,$nombre_obra){\n \treturn Sesion::where(\"inicio\",\">=\",$ProximaObraAnyo.\"-\".$ProximaObraMes.\"-01\".\" 00:00:00\")->\n\t\t\t\twhere(\"inicio\",\"<=\",$ProximaObraAnyo.\"-\".$ProximaObraMes.\"-31\".\" 23:59:00\")->\n\t\t\t\twhere(\"nombre_obra\",$nombre_obra)\n\t\t\t\t->orderBy(\"inicio\",\"asc\")\n\t\t\t\t->get();\n }", "public function ActualizarMesas()\n\t{\n\n\t\tself::SetNames();\n\t\tif(empty($_POST[\"codmesa\"]) or empty($_POST[\"codsala\"]) or empty($_POST[\"nombremesa\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\t\t$sql = \" select codsala, nombremesa from mesas where codmesa != ? and codsala = ? and nombremesa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"codmesa\"], $_POST[\"codsala\"], $_POST[\"nombremesa\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\t\t\t$sql = \" update mesas set \"\n\t\t\t.\" codsala = ?, \"\n\t\t\t.\" nombremesa = ?, \"\n\t\t\t.\" statusmesa = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codmesa = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $codsala);\n\t\t\t$stmt->bindParam(2, $nombremesa);\n\t\t $stmt->bindParam(3, $statusmesa);\n\t\t\t$stmt->bindParam(4, $codmesa);\n\n\t\t\t$codmesa = strip_tags($_POST[\"codmesa\"]);\n\t\t\t$codsala = strip_tags($_POST[\"codsala\"]);\n\t\t\t$nombremesa = strip_tags($_POST[\"nombremesa\"]);\n\t\t\t$statusmesa = strip_tags($_POST[\"statusmesa\"]);\n\t\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> LA MESA EN SALA DEL RESTAURANT FUE ACTUALIZADA EXITOSAMENTE\";\n\t\techo \"</div>\";\t\t\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"2\";\n\t\t\texit;\n\t\t}\n\t}", "public function buscarMaterias($datos){\n try {\n $parametros = array(\"id_plan\" => $datos[\"id_plan\"] , \n \"anio\" => $datos[\"anio\"]);\n $resultado = $this->refControladorPersistencia->ejecutarSentencia(DbSentencias::BUSCAR_MATERIAS_EC, $parametros);\n $fila = $resultado->fetchAll(PDO::FETCH_ASSOC);\n\n return $fila;\n } catch(Exception $e){\n echo \"Error :\" . $e->getMessage(); \n }\n }", "function evt__enviar(){\n if($this->dep('datos')->tabla('mesa')->esta_cargada()){\n $m = $this->dep('datos')->tabla('mesa')->get();\n // print_r($m);\n $m['estado'] = 2;//Cambia el estado de la mesa a Enviado\n $this->dep('datos')->tabla('mesa')->set($m);\n // print_r($m['id_mesa']);\n $this->dep('datos')->tabla('mesa')->sincronizar();\n // $this->dep('datos')->tabla('mesa')->resetear();\n \n $m = $this->dep('datos')->tabla('mesa')->get_listado($m['id_mesa']);\n if($m[0]['estado'] == 2){//Obtengo de la BD y verifico que hizo cambios en la BD\n //Se enviaron correctamente los datos\n toba::notificacion()->agregar(utf8_decode(\"Los datos fueron enviados con éxito\"),\"info\");\n }\n else{\n //Se generó algún error al guardar en la BD\n toba::notificacion()->agregar(utf8_decode(\"Error al enviar la información, verifique su conexión a internet\"),\"info\");\n }\n }\n \n }", "public function cargaTablaMesas(){\n\t\t$this->cargaMesas(\"no\");\n\t\t// Cabecera de tabla.\n\t\techo \"<div class='table-responsive'>\";\n\t\techo \"<table class='table table-striped table-sm table-bordered table-hover'>\";\n\t\techo '<thead class=\"thead-dark\">';\n\t\t\techo '<th>SALA</th>';\n\t\t\techo '<th>Mesa</th>';\n\t\t\techo '<th>Nº Comensales</th>';\n\t\t\techo '<th>Eliminar</th>';\n\t\techo '</thead>';\t\t\n echo '<tbody>';\n\t\tif (isset($_SESSION['MisMesas'])){\n\t\t\t$misMesas=$_SESSION['MisMesas'];\n\t\t\t$numMesas=count($misMesas);\n\t\t}else{\n\t\t\t$numMesas=0;\n\t\t}\n\t\tfor($i=0;$i<$numMesas;++$i){\n\t\t\t$row=$misMesas[$i];\n\t\t\techo \"<tr>\";\n\t\t\techo \"<td>\".$row['SAL_Nombre'].\"</td>\";\n\t\t\techo \"<td>\".$row['MES_ID'].\"</td>\";\n\t\t\techo \"<td>\".$row['MES_NPersonas'].\"</td>\";\n\t\t\techo \"<td>\";\n\t\t\techo \"<button style ='border:0' onclick=\\\"confirmaBajaMesa('\".$row['SAL_ID'].\"','\".$row['SAL_Nombre'].\"','\".$row['MES_ID'].\"','\".$row['MES_NPersonas'].\"');\\\"><img src='./Assets/Icons/eliminar.svg' alt='Eliminar' ></img></button>\";\n\t\t\techo \"</td>\";\n\t\t\techo \"</tr>\";\n\t\t} \n\t\techo '</tbody>';\n\t\techo '</table>';\n\t\tif ($numMesas==0){echo \"No TIENE MESAS. INTRODUZCALAS AQUI MISMO\";}\t\t\n\t\techo '</div>';\n\t}", "public function setMesCalendario($mesCalendario){\n $this->mesCalendario = $mesCalendario;\n }", "function datos_censales($alumno)\n\t{\n $formulario_habilitado = $this->s__datos_config_reporte['formulario_habilitado'];\n\t\t//$habilitacion = $this->s__datos_config_reporte['habilitacion'];\n \n\t\t$formulario_terminado = toba::consulta_php('consultas_relevamiento_ingenierias')->get_formulario_terminado($formulario_habilitado, $alumno['encuestado']);\n\t\t\n\t\tif (!empty($formulario_terminado)) {\n\t\t\t$formulario_habilitado = $formulario_terminado[0]['formulario_habilitado'];\n\t\t\t$this->respuestas = toba::consulta_php('consultas_relevamiento_ingenierias')->get_respuestas_completas_formulario_habilitado_encuestado($formulario_habilitado, $alumno['encuestado']);\n\t\t\t\n\t\t\t//Respuestas Datos Censales Principales\n\t\t\t$rta_estado_civil \t= $this->get_respuestas(247);\n\t\t\t$rta_cant_hijos \t= $this->get_respuestas(248);\n\t\t\t$rta_cant_fliares \t= $this->get_respuestas(249);\n\t\t\t$rta_calle\t\t\t= $this->get_respuestas(251);\n\t\t\t$rta_numero\t\t\t= $this->get_respuestas(252);\n\t\t\t$rta_piso\t\t\t= $this->get_respuestas(253);\n\t\t\t$rta_depto\t\t\t= $this->get_respuestas(254);\n\t\t\t$rta_unidad\t\t\t= $this->get_respuestas(255);\n\t\t\t$rta_localidad\t\t= $this->get_respuestas(256);\n\t\t\t$rta_calle_proc\t\t= $this->get_respuestas(258);\n\t\t\t$rta_numero_proc\t= $this->get_respuestas(259);\n\t\t\t$rta_piso_proc\t\t= $this->get_respuestas(260);\n\t\t\t$rta_depto_proc\t\t= $this->get_respuestas(261);\n\t\t\t$rta_unidad_proc\t= $this->get_respuestas(262);\n\t\t\t$rta_localidad_proc\t= $this->get_respuestas(263);\n\t\t\t\n\t\t\t//Respuestas Datos Económicos - Financiamiento estudios\n\t\t\t$rtas_fuente = $this->get_respuestas(265, true);\n\t\t\t$rtas_beca\t = $this->get_respuestas(266, true);\n\t\t\t\n\t\t\t//Situación laboral\n\t\t\t$rta_cond_activ\t\t = $this->get_respuestas(268);\n\t\t\t$rta_es_usted\t\t = $this->get_respuestas(269);\n\t\t\t$rta_ocupacion_es\t = $this->get_respuestas(270);\n\t\t\t$rta_horas_semanales = $this->get_respuestas(271);\n\t\t\t$rta_rel_trab_carrera = $this->get_respuestas(272);\n\t\t\t\n\t\t\t//Situación del padre\n\t\t\t$rta_nivel_est_padre\t = $this->get_respuestas(274);\n\t\t\t$rta_vive_padre\t\t\t = $this->get_respuestas(275);\n\t\t\t$rta_cond_activ_padre\t = $this->get_respuestas(276);\n\t\t\t$rta_es_usted_padre\t\t = $this->get_respuestas(277);\n\t\t\t$rta_ocupacion_es_padre\t = $this->get_respuestas(278);\n\t\t\t$rta_si_no_trabaja_padre = $this->get_respuestas(279);\n\t\t\t\n\t\t\t//Situación de la madre\n\t\t\t$rta_nivel_est_madre\t = $this->get_respuestas(281);\n\t\t\t$rta_vive_madre\t\t\t = $this->get_respuestas(282);\n\t\t\t$rta_cond_activ_madre\t = $this->get_respuestas(283);\n\t\t\t$rta_es_usted_madre\t\t = $this->get_respuestas(284);\n\t\t\t$rta_ocupacion_es_madre\t = $this->get_respuestas(285);\n\t\t\t$rta_si_no_trabaja_madre = $this->get_respuestas(286);\n\t\t\t\n\t\t\t//Se arma la linea con las respuestas - Datos Censales Principales\n\t\t\t$linea = '|'.$rta_estado_civil['respuesta_valor'];\n\t\t\t$linea .= '|'.$rta_cant_hijos['respuesta_valor'];\n\t\t\t$linea .= '|'.$rta_cant_fliares['respuesta_valor'];\n\t\t\t$linea .= '|'.$rta_calle['respuesta_valor'].'|'.$rta_numero['respuesta_valor'].'|'.$rta_piso['respuesta_valor'];\n\t\t\t$linea .= '|'.$rta_depto['respuesta_valor'].'|'.$rta_unidad['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_localidad) ? '' : $rta_localidad['respuesta_valor'];\n\t\t\t$linea .= '|'.$rta_calle_proc['respuesta_valor'].'|'.$rta_numero_proc['respuesta_valor'].'|'.$rta_piso_proc['respuesta_valor'];\n\t\t\t$linea .= '|'.$rta_depto_proc['respuesta_valor'].'|'.$rta_unidad_proc['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_localidad_proc) ? '' : $rta_localidad_proc['respuesta_valor'];\n\t\t\t\n\t\t\t//Respuestas Datos Económicos - Financiamiento estudios\n\t\t\t$linea .= '|'.$this->get_lista_array_fuente($rtas_fuente).'|'.$this->get_lista_array_beca($rtas_beca);\n\t\t\t\n\t\t\t//Situación laboral\n\t\t\t$linea .= '|'.$rta_cond_activ['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_es_usted) \t\t ? '' : $rta_es_usted['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_ocupacion_es) \t ? '' : $rta_ocupacion_es['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_horas_semanales) ? '' : $rta_horas_semanales['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_rel_trab_carrera) ? '' : $rta_rel_trab_carrera['respuesta_valor'];\n\t\t\t\n\t\t\t//Situación del padre\n\t\t\t$linea .= '|'.$rta_nivel_est_padre['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_vive_padre) \t\t ? '' : $rta_vive_padre['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_cond_activ_padre) \t ? '' : $rta_cond_activ_padre['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_es_usted_padre) \t ? '' : $rta_es_usted_padre['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_ocupacion_es_padre) ? '' : $rta_ocupacion_es_padre['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_si_no_trabaja_padre) ? '' : $rta_si_no_trabaja_padre['respuesta_valor'];\n\t\t\t\n\t\t\t//Situación de la madre\n\t\t\t$linea .= '|'.$rta_nivel_est_madre['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_vive_madre) \t\t ? '' : $rta_vive_madre['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_cond_activ_madre)\t ? '' : $rta_cond_activ_madre['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_es_usted_madre) \t ? '' : $rta_es_usted_madre['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_ocupacion_es_madre) ? '' : $rta_ocupacion_es_madre['respuesta_valor'];\n\t\t\t$linea .= '|'.empty($rta_si_no_trabaja_madre) ? '' : $rta_si_no_trabaja_madre['respuesta_valor'];\n\t\t\t\n\t\t\t//Fecha de terminación del formulario\n\t\t\t$linea .= '|'.$formulario_terminado[0]['fecha_terminado'];\n\t\t} else {\n\t\t\t$linea = '|||||||||||||||||||||||||||||||';\n\t\t}\n\t\t\n\t\t//Se retornan las respuestas del alumno\n\t\treturn $linea;\n\t}", "function modificarMaquinaria(){\n\t\t$this->procedimiento='snx.ft_maquinaria_ime';\n\t\t$this->transaccion='SNX_MAQ_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_maquinaria','id_maquinaria','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('potencia','potencia','numeric');\n\t\t$this->setParametro('peso','peso','numeric');\n\t\t$this->setParametro('maquinaria','maquinaria','varchar');\n\t\t$this->setParametro('id_factorindexacion','id_factorindexacion','int4');\n\t\t$this->setParametro('id_tipopreciomaquinaria','id_tipopreciomaquinaria','int4');\n\t\t$this->setParametro('id_ambitoprecio','id_ambitoprecio','int4');\n\t\t\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 InsertarMesaParametros()\n\t{\n\t\t\t$objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso();\n $consulta =$objetoAccesoDato->RetornarConsulta(\"INSERT into mesa (codigo,estado,usos)values(:codigo,:estado,:usos)\");\n $consulta->bindValue(':codigo', $this->codigo, PDO::PARAM_STR);\n $consulta->bindValue(':estado', $this->estado, PDO::PARAM_STR);\n $consulta->bindValue(':usos', $this->usos, PDO::PARAM_INT);\n $consulta->execute();\t\n return $objetoAccesoDato->RetornarUltimoIdInsertado();\n }", "function get_seguro($mes='',$anio='',$id_sucursal=''){\n\t\t$sQuery=\"SELECT \n\t\t\t\tcontrol_salida_extra.*,\n\t\t\t\ttransportista.id as t_id, transportista.nombre as t_nombre , transportista.apellido as t_apellido\n\t\t\t\tFROM control_salida_extra\n\t\t\t\tInner Join transportista ON control_salida_extra.id_transportista = transportista.id\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tWHERE control_salida_extra.tipo=1 AND control_salida_extra.status<>'2' \";\n\t\t\n\t\tif($mes) {\t$sQuery.=\" AND month(control_salida_extra.fecha)='$mes' \";\t}\n\t\tif($anio) {\t$sQuery.=\" AND year(control_salida_extra.fecha)='$anio' \";\t}\n\t\tif($id_sucursal) {\t$sQuery.=\" AND control_salida_extra.id_sucursal = '$id_sucursal' \";\t}\n\t\t\n\t\t$sQuery.=\" ORDER BY control_salida_extra.id DESC \";\n\t//\techo ($sQuery);\n\t\t\n\t\t$result=mssql_query($sQuery) or die(mssql_min_error_severity());\n\t\t$i=0;\n\t\twhile($row=mssql_fetch_array($result)){\n\t\t\tforeach($row as $key=>$value){\n\t\t\t\t$res_array[$i][$key]=$value;\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\treturn($res_array);\n\t\t\n\t\t\t\t\n\t}", "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 function ListarMesas()\n{\n\tself::SetNames();\n\t$sql = \" select salas.codsala, salas.nombresala, salas.salacreada, mesas.codmesa, mesas.nombremesa, mesas.mesacreada, mesas.statusmesa FROM mesas LEFT JOIN salas ON mesas.codsala = salas.codsala\";\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}", "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 }", "public function pesquisarMercadoriaAction() {\r\n try {\r\n $this->getHelper('layout')->disableLayout();\r\n \r\n $params = $this->_getAllParams();\r\n $params = $this->_helper->util->urldecodeGet($params); \r\n $params = $this->_helper->util->utf8Decode($params); \r\n //$this->view->dataGrid = $this->view->utf8($this->mercadoriaDbTable->getDataGrid($params))->encode();\r\n $this->view->dataGrid = $this->_helper->util->utf8Encode($this->mercadoriaDbTable->getDataGrid($params));\r\n \r\n } catch (Exception $E) {\r\n \r\n die('ERRO|Ocorreu um erro ao tentar executar a operação. Tente novamente. Caso persista, contate o administrador do sistema.');\r\n }\r\n }", "static public function mdlIngresarMembresia($tabla,$datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(id_tipo_membresia,id_precio_membresia,fecha_inicio,fecha_fin,comprobante,id_usuario,id_miembro) VALUES (:id_tipo_membresia,:id_precio_membresia,:fecha_inicio,:fecha_fin,:comprobante,:id_usuario,:id_miembro)\");\n\n $stmt->bindParam(\":id_tipo_membresia\", $datos[\"id_tipo_membresia\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_precio_membresia\", $datos[\"id_precio_membresia\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fecha_inicio\", $datos[\"fecha_inicio\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fecha_fin\", $datos[\"fecha_fin\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":comprobante\", $datos[\"comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_usuario\", $datos[\"id_usuario\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_miembro\", $datos[\"id_miembro\"], PDO::PARAM_STR);\n\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "function mdatosEjercicios(){\n\t\t$conexion = conexionbasedatos();\n\n\t\t$consulta = \"select FE.IDEJERCICIO, FE.NOMBRE_EJERCICIO, FG.NOMBRE_MUSCULO , FE.NIVEL_EJERCICIO, FE.DESCRIPCION, FE.IDFOTO\n\t\t\t\t\tfrom final_ejercicio FE, final_grupo FG\n\t\t\t\t\twhere FE.MUSCULO = FG.IDGRUPO;\";\n\n\t\tif ($resultado = $conexion->query($consulta)) {\n\t\t\treturn $resultado;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\n\t}", "private function getMateriais() {\n\n $oDaoMaterial = new cl_matmater();\n $sCampos = \" m60_codmater as codigo, m60_descr as descricao, m61_descr as unidade\";\n\n $sCamposGrupo = \" , 0 as codigogrupo \";\n if ($this->lAgruparGrupoSubgrupo) {\n $sCamposGrupo = \" , m65_sequencial as codigogrupo \";\n }\n $sCampos .= $sCamposGrupo;\n\n $aOrdem = array();\n $aWhere = array();\n $aWhere[] = \" instit = {$this->iInstituicao} \";\n\n $aOrdem[] = \" m60_descr \";\n\n if ($this->sDepartamentos) {\n $aWhere[] = \" m70_coddepto in ({$this->sDepartamentos}) \";\n }\n\n if ($this->sGrupoSubgrupo) {\n $aWhere[] = \" db121_sequencial in ({$this->sGrupoSubgrupo}) \";\n }\n\n $sCampoDepartamento = \", 0 as depto, '' as departamento\";\n if ($this->iQuebraPagina == RelatorioDeDistribuicao::QUEBRA_PAGINA_DEPARTAMENTO) {\n $sCampoDepartamento = \", m70_coddepto as depto, descrdepto as departamento \";\n }\n $sCampos .= $sCampoDepartamento;\n $sWhere = \" where \" . implode(\" and \", $aWhere);\n $sOrdem = \" order by \" . implode(\", \", $aOrdem);\n\n $sql = \" select distinct {$sCampos} \";\n $sql .= \" from matmater \";\n $sql .= \" inner join matunid on m60_codmatunid = m61_codmatunid \";\n $sql .= \" inner join matmatermaterialestoquegrupo on m60_codmater = m68_matmater \";\n $sql .= \" inner join materialestoquegrupo on m68_materialestoquegrupo = m65_sequencial \";\n $sql .= \" inner join db_estruturavalor on db121_sequencial = m65_db_estruturavalor \";\n $sql .= \" inner join matestoque on m60_codmater = m70_codmatmater \";\n $sql .= \" inner join db_depart on coddepto = m70_coddepto \";\n\n\n $sql .= \"{$sWhere} {$sOrdem} \";\n\n $rsMateriais = $oDaoMaterial->sql_record($sql);\n\n $aMateriais = array();\n for ($i = 0; $i < $oDaoMaterial->numrows; $i++) {\n\n $oMaterial = db_utils::fieldsMemory($rsMateriais, $i);\n $oMaterial->totalPeriodo = 0.0;\n $oMaterial->mediaPeriodo = 0.0;\n $aMateriais[] = $oMaterial;\n\n if (!isset($this->aDepartamentos[$oMaterial->depto])) {\n\n $oDeptartamento = new stdClass();\n $oDeptartamento->codigo = $oMaterial->depto;\n $oDeptartamento->descricao = $oMaterial->departamento;\n $oDeptartamento->itens = array();\n $this->aDepartamentos[$oDeptartamento->codigo] = $oDeptartamento;\n }\n }\n return $aMateriais;\n }", "public function consultaSeguimientos(){\n\t\t$conect= Yii::app()->db;\n\t\t$sqlConsSegPaiDer=\"select fecha_seguim_compderecho,seguim_compderecho from seguimiento_compderecho \n\t\twhere id_pai=:id_pai and id_derechocespa=:id_derechocespa and num_doc=:num_doc order by fecha_seguim_compderecho desc\";\n\t\t$segCompDer=$conect->createCommand($sqlConsSegPaiDer);\n\t\t$segCompDer->bindParam(\":id_pai\",$this->id_pai,PDO::PARAM_INT);\n\t\t$segCompDer->bindParam(\":id_derechocespa\",$this->id_derechocespa,PDO::PARAM_INT);\n\t\t$segCompDer->bindParam(\":num_doc\",$this->num_doc,PDO::PARAM_STR);\n\t\t$readConsSegPaiDer=$segCompDer->query();\n\t\t$resConsSegPaiDer=$readConsSegPaiDer->readAll();\n\t\t$readConsSegPaiDer->close();\n\t\treturn $resConsSegPaiDer;\n\t}", "public function CarregaMensal($aDados)\r\n {\r\n $aDados = (array) $aDados;\r\n \r\n $idplanificacion = $aDados['cplanificacion'];\r\n $pais = $aDados['idPais'];\r\n $sede = $aDados['idSede'];\r\n $indicador = $aDados['idIndicador'];\r\n \r\n $model = Container::getModel(\"TInforme\");\r\n \r\n //Busca Trismestre\r\n $result = $model->BuscaMensual($idplanificacion, $pais, $sede, $indicador);\r\n \r\n //Dados para o Chart Plan\r\n $EneroPlan = $result[0]->enero_plan;\r\n $FebreroPlan = $result[0]->febrero_plan;\r\n $MarzoPlan = $result[0]->marzo_plan;\r\n $AbrilPlan = $result[0]->abril_plan;\r\n $MayoPlan = $result[0]->mayo_plan;\r\n $JunioPlan = $result[0]->junio_plan;\r\n $JulioPlan = $result[0]->julio_plan;\r\n $AgostoPlan = $result[0]->agosto_plan;\r\n $SeptiembrePlan = $result[0]->septiembre_plan;\r\n $OctubrePlan = $result[0]->octubre_plan;\r\n $NoviembrePlan = $result[0]->noviembre_plan;\r\n $DiciembrePlan = $result[0]->diciembre_plan;\r\n \r\n //Dados para o Chart Real\r\n $EneroReal = $result[0]->enero_real;\r\n $FebreroReal = $result[0]->febrero_real;\r\n $MarzoReal = $result[0]->marzo_real;\r\n $AbrilReal = $result[0]->abril_real;\r\n $MayoReal = $result[0]->mayo_real;\r\n $JunioReal = $result[0]->junio_real;\r\n $JulioReal = $result[0]->julio_real;\r\n $AgostoReal = $result[0]->agosto_real;\r\n $SeptiembreReal = $result[0]->septiembre_real;\r\n $OctubreReal = $result[0]->octubre_real;\r\n $NoviembreReal = $result[0]->noviembre_real;\r\n $DiciembreReal = $result[0]->diciembre_real;\r\n \r\n //tudo junto pq deu merda separado\r\n echo json_encode(array(\"plan\" => $EneroPlan. ',' . $FebreroPlan. ',' . $MarzoPlan. ',' . $AbrilPlan. ',' . $MayoPlan. ',' . $JunioPlan. ',' . $JulioPlan. ',' . $AgostoPlan. ',' .$SeptiembrePlan. ',' .$OctubrePlan. ',' .$NoviembrePlan. ',' .$DiciembrePlan. ',' .\r\n $EneroReal. ',' .$FebreroReal. ',' .$MarzoReal. ',' .$AbrilReal. ',' .$MayoReal. ',' .$JunioReal. ',' .$JulioReal. ',' .$AgostoReal. ',' .$SeptiembreReal. ',' .$OctubreReal. ',' .$NoviembreReal. ',' .$DiciembreReal));\r\n }", "private function MetodoDeRetornoValoresJSOM(){\n\t\t\n\t\t// Cria um array com os dados.\n\t\t$out = array(\n\t\t\t'dataAdmissao'=>date('d/m/Y', strtotime($this->DataAdmissao)),\n\t\t\t'diasTrabalhado'=>$this->DiasTrabalhado,\n\t\t\t'salarioFuncionario'=>number_format($this->SalarioFuncionario, 2, ',', '.'),\n\t\t\t'salario'=>number_format($this->Salario, 2, ',', '.'),\n\t\t\t'feriasId'=>$this->FeriasId,\n\t\t\t'diasFerias'=>$this->DiasFerias,\n\t\t\t'valorFerias'=>number_format($this->ValorFerias, 2, ',', '.'),\n\t\t\t'valorUmTercoFerias'=>number_format($this->ValorUmTercoFerias, 2, ',', '.'),\n\t\t\t'vendaUmTercoFerias'=>$this->VendaUmTercoFerias,\n\t\t\t'valorFeriasVendida'=>number_format($this->ValorFeriasVendida, 2, ',', '.'),\n\t\t\t'valorUmTercoFeriasVendida'=>number_format($this->ValorUmTercoFeriasVendida, 2, ',', '.'),\t\t\t\n\t\t\t'aliquotaIRFerias'=>$this->AliquotaIRFerias,\n\t\t\t'valorIRFerias'=>number_format($this->ValorIRFerias, 2, ',', '.'),\n\t\t\t'salarioBruto'=>number_format($this->SalarioBruto, 2, ',', '.'),\n\t\t\t'totalVencimentos'=>number_format($this->TotalVencimentos, 2, ',', '.'),\n\t\t\t'valorIR'=>number_format($this->ValorIR, 2, ',', '.'),\n\t\t\t'aliquotaIR'=>$this->AliquotaIR,\n\t\t\t'faixaIR'=>$this->Faixa,\n\t\t\t'valorInss'=>number_format($this->ValorINSS, 2, ',', '.'),\n\t\t\t'porcentagemInss'=>$this->PorcentagemInss,\n\t\t\t'valorSecundarioINSS'=>number_format($this->ValorSecundarioINSS, 2, ',', '.'),\n\t\t\t'porcSecundarioInss'=>$this->PorcSecundarioInss,\t\t\t\n\t\t\t'numDependentes'=>$this->NumDependentes,\n\t\t\t'descontoDep'=>number_format($this->DescontoDep, 2, ',', '.'),\n\t\t\t'valorPensao'=>number_format($this->ValorPensao, 2, ',', '.'),\n\t\t\t'porcPensao'=>$this->PorcentagemPensao,\n\t\t\t'valeTransporte'=>number_format($this->ValorValetran, 2, ',', '.'),\n\t\t\t'valeTransportePorc'=>$this->ValeTransportePorc,\n\t\t\t'valeRefeicao'=>number_format($this->ValorRefeicao, 2, ',', '.'),\n\t\t\t'valeRefeicaoPorc'=>$this->ValeRefeicaoPorc,\n\t\t\t'valorFaltas'=>number_format($this->ValorFaltas, 2, ',', '.'),\n\t\t\t'adiantamentoDecimoTerceiro'=>number_format($this->AdiantamentoDecimoTerceiro, 2, ',', '.'),\n\t\t\t'liquidoFerias'=>number_format($this->ValorLiquidoFerias, 2, ',', '.'),\n\t\t\t'valorLiquido'=>number_format($this->ValorLiquido, 2, ',', '.'),\n\t\t\t'valorFeriasMes1'=>number_format($this->ValorFeriasMes1, 2, ',', '.'),\n\t\t\t'valorFeriasMes2'=>number_format($this->ValorFeriasMes2, 2, ',', '.'),\t\n\t\t\t'teste'=>$this->Teste\n\t\t);\n\n\t\t// Retorna um json com os dados da folha de pagamento.\n\t\techo json_encode($out);\n\t}", "public function pesquisarMercadoriaFornecedorAction() {\r\n try {\r\n $this->getHelper('layout')->disableLayout();\r\n \r\n $params = $this->_getAllParams();\r\n $params = $this->_helper->util->urldecodeGet($params); \r\n $params = $this->_helper->util->utf8Decode($params); \r\n //$this->view->dataGrid = $this->view->utf8($this->mercadoriaDbTable->getDataGrid($params))->encode();\r\n $this->view->dataGrid = $this->_helper->util->utf8Encode($this->mercadoriaDbTable->getDataGrid($params));\r\n \r\n } catch (Exception $E) {\r\n \r\n die('ERRO|Ocorreu um erro ao tentar executar a operação. Tente novamente. Caso persista, contate o administrador do sistema.');\r\n }\r\n }", "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 }", "private function compilar_metadatos_generales_basicos()\n\t{\n\t\t//-- Datos basicos --\n\t\t$this->manejador_interface->mensaje('Info basica', false);\n\t\t$nombre_clase = 'toba_mc_gene__basicos';\n\t\t$archivo = $this->get_dir_generales_compilados() . '/' . $nombre_clase . '.php';\n\t\t$clase = new toba_clase_datos( $nombre_clase );\n\t\t$datos = toba_proyecto_db::cargar_info_basica( $this->get_id() );\n\t\t$clase->agregar_metodo_datos('info_basica', $datos);\n\t\t$this->manejador_interface->progreso_avanzar();\n\t\t//-- Fuentes --\n\t\tforeach( $this->get_indice_fuentes() as $fuente ) {\n\t\t\t$datos = toba_proyecto_db::get_info_fuente_datos( $this->get_id(), $fuente );\n\t\t\t//-- Se busca la relacion entre nombre_tabla y dt\n\t\t\t$mapeo = toba_proyecto_db::get_mapeo_tabla_dt($this->get_id(), $fuente);\n\t\t\t$datos['mapeo_tablas_dt'] = $mapeo;\n\t\t\t$clase->agregar_metodo_datos('info_fuente__'.$fuente, $datos );\n\t\t}\n\t\t$this->manejador_interface->progreso_avanzar();\n\t\t//-- Permisos --\n\t\tforeach( $this->get_indice_permisos() as $permiso ) {\n\t\t\t$datos = toba_proyecto_db::get_descripcion_permiso( $this->get_id(), $permiso );\n\t\t\t$clase->agregar_metodo_datos('info_permiso__'.$permiso, $datos );\n\t\t}\n\t\t$this->manejador_interface->progreso_avanzar();\n\t\t//-- Indice de componentes --\n\t\t$datos = toba_proyecto_db::get_mapeo_componentes_indice( $this->get_id() );\n\t\t$clase->agregar_metodo_datos('info_indices_componentes', $datos );\n\t\t$this->manejador_interface->progreso_avanzar();\n\t\t//Creo el archivo\n\t\t$clase->guardar( $archivo );\n\t\t$this->manejador_interface->progreso_fin();\n\t}", "function uf_sme_select_montotiposervicio($as_codemp,$as_codtar,$as_codtiptra,$as_nomina)\r\n\t{\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//\t Function: uf_sme_select_montotiposervicio\r\n\t\t// Access: public \r\n\t\t// Argumento: $as_codemp //codigo de empresa \r\n\t\t// $as_codtra //codigo del servicio\r\n\t\t// $as_codtiptra //codigo de tipo de Servicio\r\n\t\t// $as_nomina //codigo de la nomina\r\n\t\t//\t Returns: Retorna un Booleano\r\n\t\t// Description: Funcion que verifica si existe el servicio medico en la tabla sme_montoseguntipo\r\n\t\t//\t Creado Por: Ing. Miguel Palencia\r\n\t\t// Fecha Creación: 03/03/2016 \t\t\t\t\t\t\t\tFecha Última Modificación : \r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t$lb_valido=false;\r\n\t\t$ls_sql = \"SELECT * FROM sme_montoseguntipo \".\r\n\t\t\t\t \" WHERE codemp='\".$as_codemp.\"'\".\r\n\t\t\t\t \" AND codnom='\".$as_nomina.\"'\" .\r\n\t\t\t\t \" AND codtipservicio='\".$as_codtiptra.\"'\" ;\r\n\t\t//print $ls_sql;\r\n\t\t$rs_data=$this->io_sql->select($ls_sql);\r\n\t\tif($rs_data===false)\r\n\t\t{\r\n\t\t\t$this->io_msg->message(\"CLASE->Monto Tipo segun Tipo de Servicio MÉTODO->uf_sme_select_montotiposervicio ERROR->\".$this->io_funcion->uf_convertirmsg($this->io_sql->message));\r\n\t\t\t$lb_valido=false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif($row=$this->io_sql->fetch_row($rs_data))\r\n\t\t\t{\r\n\t\t\t\t$lb_valido=true;\r\n\t\t\t\t$this->io_sql->free_result($rs_data);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $lb_valido;\r\n\t}", "public function getMesDisponivelParaProcessamento($iTipoCalculo) {\n\n $iAnoSessao = $this->getAno();\n $iInstituicao = db_getsession(\"DB_instit\");\n $iMesParaProcessamento = 0;\n $oDaoHistoricoCalculo = db_utils::getDao(\"benshistoricocalculo\");\n /**\n * @todo Modificar o parametro para os parametros da instituicao do patrimonio\n */\n if (!$this->hasParametroDepreciacaoHabilitado()) {\n throw new Exception(_M('patrimonial.patrimonio.PlanilhaCalculo.depreciacao_nao_configurada_para_instituicao'));\n }\n\n $dtInicioDepreciacao = $this->getDataInicioDepreciacao();\n $aDataImplantacao = explode(\"-\", $dtInicioDepreciacao);\n $iMesImplantacao = $aDataImplantacao[1];\n $iAnoImplantacao = $aDataImplantacao[0];\n\n $sWhere = \" t57_tipocalculo = {$iTipoCalculo} \";\n $sWhere .= \" and t57_tipoprocessamento = {$this->iTipoProcessamento} \";\n $sWhere .= \" and t57_processado is true \";\n $sWhere .= \" and t57_ativo is true \";\n $sWhere .= \" and t57_ano = {$iAnoSessao} \";\n $sWhere .= \" and t57_instituicao = {$iInstituicao}\";\n\n /**\n * Pesquisamos se existe algum mes processado\n * Caso já exista algum mes, devemos retornar o proximo mes.\n */\n $sSqlCalculosProcessadas = $oDaoHistoricoCalculo->sql_query_file(null,\"max(t57_mes) as mes\", null, $sWhere);\n $rsCalculosProcessados = $oDaoHistoricoCalculo->sql_record($sSqlCalculosProcessadas);\n $iMesParaProcessamento = $iMesImplantacao;\n\n if ($oDaoHistoricoCalculo->numrows > 0) {\n\n $iMesParaProcessamento = db_utils::fieldsMemory($rsCalculosProcessados, 0)->mes;\n\n if (empty($iMesParaProcessamento)) {\n\n $iMesParaProcessamento += 1;\n if ($iAnoImplantacao == $iAnoSessao) {\n $iMesParaProcessamento = $iMesImplantacao;\n }\n\n /**\n * Processando tipo de depreciação manual\n * Caso não haja depreciações processadas, buscar o primeiro mês que haja bem adquirido\n */\n if ($this->iTipoProcessamento == 2) {\n\n $oDaoBens = db_utils::getDao(\"bens\");\n $sWhere = \" t44_benstipodepreciacao = 5\";\n $sOrder = \" t52_dtaqu asc limit 1\";\n $sSqlMes = $oDaoBens->sql_query_tipodepreciacao(null, \"t52_dtaqu as data\", $sOrder, $sWhere);\n $rsMes = $oDaoBens->sql_record($sSqlMes);\n\n if($oDaoBens->numrows == 0) {\n throw new Exception(_M('patrimonial.patrimonio.PlanilhaCalculo.nao_existem_bens_para_depreciacao'));\n }\n\n $dtAquisicaoBem = db_utils::fieldsMemory($rsMes, 0)->data;\n $aDataAquisicao = explode(\"-\",$dtAquisicaoBem);\n $iMesParaProcessamento = $aDataAquisicao[1];\n\n if($iAnoSessao < $aDataAquisicao[0]) {\n\n $oParms = new stdClass();\n $oParms-> iAnoSessao = $iAnoSessao;\n $oParms->aDataAquisicao = $aDataAquisicao;\n throw new Exception(_M('patrimonial.patrimonio.PlanilhaCalculo.sem_bens_para_depreciacao_no_ano', $oParms));\n //throw new Exception(\"Não existem bens para serem depreciados no ano {$iAnoSessao}.\\n O primeiro bem adquirido foi cadastrado em {$aDataAquisicao[0]} \");\n }\n\n /**\n * Caso o ano da sessão for maior que o ano de aquisição, setamos o mês para janeiro do ano corrente\n */\n if ($iAnoSessao > $aDataAquisicao[0]) {\n $iMesParaProcessamento = 1;\n }\n }\n\n\n } else {\n $iMesParaProcessamento += 1;\n }\n\n if ($iMesParaProcessamento > 12) {\n $iMesParaProcessamento = 0;\n }\n\n\n }\n return $iMesParaProcessamento;\n }", "public function importacionLinea($tipo) {\n //echo \"llego2\";\n $codLin = '02';\n $tipConsult = $tipo;\n $dtActFecha = date(\"Y-m\", strtotime(date()));//'2019-02';//\n //$dtAntFecha = date(\"Y-m\", strtotime(date()));//restarle 1 mes//'2019-01';//\n\t$dtAntFecha = date(\"Y-m\", strtotime('-1 month', strtotime(date())));//Se resta 1 mes.\n //Generar Manualmente\n //$dtActFecha ='2019-04';\n //$dtAntFecha ='2019-03';\n \n \n try {\n $obj_con = new cls_Base();\n $obj_var = new cls_Global();\n $con = $obj_con->conexionServidor();\n //$rawDataANT = array();\n $rawDataACT = array();\n \n $sql = \"SELECT A.COD_LIN, A.COD_TIP, A.COD_MAR, D.NOM_LIN, E.NOM_TIP, F.NOM_MAR,\"\n . \"SUM(A.P_PROME*B.EXI_TOT) AS COS_ACT, \";\n $sql .= \"IFNULL((SELECT X.COSTO_T FROM \" . $obj_con->BdServidor . \".IG0007 X \"\n . \" WHERE X.COD_LIN=A.COD_LIN AND X.COD_MAR=A.COD_MAR AND TIP_CON='$tipConsult' \"\n . \" AND ANO_MES='$dtAntFecha'),0) COS_ANT \"; \n $sql .= \" FROM \" . $obj_con->BdServidor . \".IG0020 A \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0022 B ON A.COD_ART=B.COD_ART \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0001 D ON A.COD_LIN=D.COD_LIN \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0002 E ON A.COD_TIP=E.COD_TIP \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0003 F ON A.COD_MAR=F.COD_MAR \";\n $sql .= \" WHERE B.EXI_TOT <> 0 \"; \n $sql .=($codLin!='')?\" AND A.COD_LIN='$codLin' \":\"\";\n $sql .=($tipConsult!='TD')?\" AND A.COD_TIP='$tipConsult' \":\"\";\n $sql .=\" GROUP BY A.COD_LIN,A.COD_MAR ORDER BY COD_LIN,COD_MAR \";\n $sentencia = $con->query($sql);\n if ($sentencia->num_rows > 0) {\n while ($fila = $sentencia->fetch_assoc()) {//Array Asociativo\n $rawDataACT[] = $fila;\n }\n }\n //cls_Global::putMessageLogFile($sql);\n for ($i = 0; $i < sizeof($rawDataACT); $i++) {\n \n $sql=\"INSERT INTO \" . $obj_con->BdServidor . \".IG0007 \n (COD_LIN,COD_TIP,COD_MAR,NOM_MAR,COST_ANT,COST_ACT,COSTO_T,FEC_SIS,TIP_CON,ANO_MES)VALUES \n ('\" . $rawDataACT[$i]['COD_LIN'] . \"',\n '\" . $rawDataACT[$i]['COD_TIP'] . \"',\n '\" . $rawDataACT[$i]['COD_MAR'] . \"',\n '\" . $rawDataACT[$i]['NOM_MAR'] . \"',\n '\" . $rawDataACT[$i]['COS_ANT'] . \"',\n '\" . $rawDataACT[$i]['COS_ACT'] . \"',\n '\" . $rawDataACT[$i]['COS_ACT'] . \"',\n '\" . $dtActFecha . \"-01',\n '\" . $tipConsult . \"',\n '\" . $dtActFecha . \"')\";\n //cls_Global::putMessageLogFile($rawDataACT[$i]['COS_ACT']);\n //cls_Global::putMessageLogFile($sql);\n $command = $con->prepare($sql); \n $command->execute();\n \n \n } \n\n $con->commit();\n $con->close();\n return true;\n } catch (Exception $e) { // se arroja una excepción si una consulta falla\n //return VSexception::messageSystem('NO_OK', $e->getMessage(), 41, null, null);\n $con->rollback();\n $con->close();\n throw $e;\n return false;\n }\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}", "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 }", "function insertarMaquinaria(){\n\t\t$this->procedimiento='snx.ft_maquinaria_ime';\n\t\t$this->transaccion='SNX_MAQ_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('potencia','potencia','numeric');\n\t\t$this->setParametro('peso','peso','numeric');\n\t\t$this->setParametro('maquinaria','maquinaria','varchar');\n\t\t$this->setParametro('id_factorindexacion','id_factorindexacion','int4');\t\t\n\t\t$this->setParametro('id_tipopreciomaquinaria','id_tipopreciomaquinaria','int4');\n\t\t$this->setParametro('id_ambitoprecio','id_ambitoprecio','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function insertarMetodologia(){\n\t\t$this->procedimiento='gem.f_metodologia_ime';\n\t\t$this->transaccion='GEM_GEMETO_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function get_mecanismos_carga()\n\t{\n\t\t$param = $this->get_definicion_parametros(true);\t\t\n\t\t$tipos = array();\n\t\tif (in_array('carga_metodo', $param, true)) {\n\t\t\t$tipos[] = array('carga_metodo', 'Método de consulta PHP');\n\t\t}\n\t\tif (in_array('carga_lista', $param, true)) {\n\t\t\t$tipos[] = array('carga_lista', 'Lista fija de Opciones');\n\t\t}\t\t\n\t\tif (in_array('carga_sql', $param, true)) {\t\t\n\t\t\t$tipos[] = array('carga_sql', 'Consulta SQL');\n\t\t}\n\t\treturn $tipos;\n\t}", "function Consulta_Informacion_Metas()\n {\n $sql=\"SELECT b.id,b.uid,year(b.fecha_inicio) AS ano, month(b.fecha_inicio) AS mes,b.no_dias,count(substr(b.fecha_inicio,1,7)) AS no_regs,\n sum(b.cantidad) AS total,a.name\n FROM crm_proyeccion as b LEFT JOIN users as a ON b.uid = a.uid\n WHERE b.active = 1 AND year(b.fecha_inicio) ='\".$this->ano_id.\"' AND b.gid='\".$this->gid.\"' \".$this->filtro.\"\n GROUP BY substr(b.fecha_inicio,1,7)\n ORDER BY substr(b.fecha_inicio,1,7)\";\n $res=$this->db->sql_query($sql) or die (\"Error en la consulta: \".$sql);\n if($this->db->sql_numrows($res) > 0)\n {\n while(list($id,$_uid,$ano,$mes,$no_dias,$no_reg,$cantidad,$name) = $this->db->sql_fetchrow($res))\n {\n $this->array_metas[$mes]= $cantidad;\n }\n }\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 }", "public static function GetProdutosMaisVendidos($mes, $ano){\n if (($mes == \"9999\") && ($ano == \"9999\")){\n self::$results = self::query(\"SELECT nomeProduto, sum(qtProduto) FROM tbControle as con INNER JOIN tbProduto as pro on con.cdProduto = pro.cdProduto GROUP BY nomeProduto ORDER BY sum(qtProduto) DESC LIMIT 5\");\n } else {\n self::$results = self::query(\"SELECT nomeProduto, sum(qtProduto) FROM tbControle as con INNER JOIN tbProduto as pro on con.cdProduto = pro.cdProduto INNER JOIN tbComanda as comanda on con.cdComanda = comanda.cdComanda WHERE MONTH(dtComanda) = 06 and YEAR(dtComanda) = 2018 GROUP BY nomeProduto ORDER BY sum(qtProduto) DESC LIMIT 5\");\n }\n \n \n self::$resultRetorno = [];\n if (is_array(self::$results) || is_object(self::$results)){\n foreach(self::$results as $result){\n array_push(self::$resultRetorno, $result);\n }\n }\n return self::$resultRetorno;\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->cm16_i_cemiterio = ($this->cm16_i_cemiterio == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_i_cemiterio\"]:$this->cm16_i_cemiterio);\n $this->cm16_c_nome = ($this->cm16_c_nome == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_c_nome\"]:$this->cm16_c_nome);\n $this->cm16_c_endereco = ($this->cm16_c_endereco == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_c_endereco\"]:$this->cm16_c_endereco);\n $this->cm16_c_cidade = ($this->cm16_c_cidade == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_c_cidade\"]:$this->cm16_c_cidade);\n $this->cm16_c_bairro = ($this->cm16_c_bairro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_c_bairro\"]:$this->cm16_c_bairro);\n $this->cm16_c_cep = ($this->cm16_c_cep == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_c_cep\"]:$this->cm16_c_cep);\n $this->cm16_c_telefone = ($this->cm16_c_telefone == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_c_telefone\"]:$this->cm16_c_telefone);\n }else{\n $this->cm16_i_cemiterio = ($this->cm16_i_cemiterio == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm16_i_cemiterio\"]:$this->cm16_i_cemiterio);\n }\n }", "function evt__procesar(){\n $m = $this->dep('datos')->tabla('mesa')->get();\n $p = array_search('junta_electoral', $this->s__perfil);\n if($p !== false){//Ingreso con perfil junta_electoral\n $m['estado'] = 3;//Cambia el estado de la mesa a Confirmado\n }\n else{\n $p = array_search('secretaria', $this->s__perfil);\n if($p !== false){//Ingreso con perfil secretaria\n $m['estado'] = 4;//Cambia el estado de la mesa a Definitivo\n }\n else{\n $p = array_search('autoridad_mesa', $this->s__perfil); \n if($p !== false){//Ingreso con perfil autoridad de mesa\n $m['estado'] = 1;//Cambia el estado de la mesa a Cargado\n }\n }\n }\n $this->dep('datos')->tabla('mesa')->set($m);\n// print_r($m['id_mesa']);\n $this->dep('datos')->tabla('mesa')->sincronizar();\n $this->dep('datos')->tabla('mesa')->resetear();\n \n \n if(isset($this->s__retorno)){//debe retornar a confirmar\n if($this->s__retorno_estado=='')\n $dato = true;\n else\n $dato['f'] = $this->s__retorno_estado;\n toba::vinculador()->navegar_a(\"\",$this->s__retorno,$dato); \n $this->s__retorno = null; \n $this->s__id_mesa = null;\n $this->s__retorno_estado = null;\n }\n }", "public function tableauMatieres()\n\t\t{\n\t\t\t// On dit à mysql que l'on veut travailler en UTF-8\n\t\t\tmysqli_query($this->co,\"SET NAMES UTF8\");\n\t\t\t$result = mysqli_query($this->co,\n\t\t\t\t\t\t\t\t \"SELECT nom_matiere FROM matiere\")\n\t\t\tor die(\"Connexion impossible : Connexion tableauMatieres()\");\n\n\t\t\t$matiere = Array ();\n\n\t\t\twhile ($row = mysqli_fetch_array($result)) {\n\t\t\t\t$matiere[] = $row[0];\n\t\t\t}\n\n\t\t\treturn $matiere;\n\t\t}", "public function mostrarTodosMaquinas() {\n \n //FUNCION CON LA CONSULTA A REALIZAR\n $sql = \"SELECT M.*, A.*, E.* FROM MAQUINA M INNER JOIN area_maquina A ON M.AREAMAQCODIGO=A.AREAMAQCODIGO INNER JOIN ESTADO E ON M.ESTCODIGO=E.ESTCODIGO WHERE E.ESTCODIGO != 11 ORDER BY M.MAQUINOMBRE\";\n $this->_conexion->ejecutar_sentencia($sql);\n return $this->_conexion->retorna_select();\n \n }", "private function compilar_metadatos_generales_puntos_control()\n\t{\n\t\t$this->manejador_interface->mensaje('Puntos de control', false);\n\t\tforeach( toba_info_editores::get_puntos_control() as $punto_control ) {\n\t\t\t$nombre_clase = 'toba_mc_gene__pcontrol_' . $punto_control['pto_control'];\n\t\t\t$archivo = $this->get_dir_generales_compilados() . '/'. $nombre_clase .'.php';\n\t\t\t$clase = new toba_clase_datos( $nombre_clase );\n\t\t\t//Cabecera\n\t\t\t$datos['cabecera'] = $punto_control;\n\t\t\t$datos['parametros'] = toba_proyecto_db::punto_control_parametros( $this->get_id(), $punto_control['pto_control'] );\n\t\t\t$datos['controles'] = toba_proyecto_db::punto_control_controles( $this->get_id(), $punto_control['pto_control'] );\n\t\t\t//Guardo el archivo\n\t\t\t$clase->agregar_metodo_datos('get_info', $datos );\n\t\t\t$clase->guardar( $archivo );\n\t\t\t$this->manejador_interface->progreso_avanzar();\n\t\t}\n\t\t$this->manejador_interface->progreso_fin();\n\t}", "function verMas()\t\r\n\t\t{\r\n\t\t\t\r\n\t\t\tglobal $use;\r\n\t\t\tglobal $priv;\r\n\r\n\t\t\t//NOTA: Para ver si funciona tienen que asociarle un adherente en la tabla socios, ya que en los datos de ejemplo todos son titulares\r\n\t\t\t//NOTA: Lo que hice fue: en tabla socios en numero_soc=00044 cambiar el campo soc_titula de manera que quede soc_titula=00277\r\n\t\t\t\r\n\t\t\t//---------------CONSULTA QUE DEVUELVE TODA LA INFO DEL ASOCIADO TITULAR----------------\r\n\t\t\t\r\n\t\t\t$numero_socio = $_GET['num_soc']; //Es el número del socio titular que debe ser tomado del PASO 1\r\n\t\t\t\r\n\r\n\t\t\t\t$resultadoTitular = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t\t\t\t\t\t FROM socios,persona \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio' \r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n AND socios.numero_soc= socios.soc_titula\");\r\n\t\t\t\t\t\t\t\t\t \r\n\r\n\t\t\tif(!$resultadoTitular)\r\n\t\t\t{\r\n\t\t\t\t$error=[\r\n\t\t\t\t'menu'\t\t\t=>\"Atenciones\",\r\n\t\t\t\t'funcion'\t\t=>\"verMas\",\r\n\t\t\t\t'descripcion'\t=>\"No se encuentra al titular $numero_socio\"\r\n\t\t\t\t];\r\n\t\t\t\techo $GLOBALS['twig']->render('/Atenciones/error.html', compact('error','use','priv'));\t\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t///---FUNCIÓN PARA CALCULAR EDAD----\r\n\t\t\t\r\n\t\t\t$fecha=$resultadoTitular[0]['fecnacim'];\r\n\t\t\t$dias = explode(\"-\", $fecha, 3);\r\n\t\t\t\r\n\t\t\t// $dias[0] es el año\r\n\t\t\t// $dias[1] es el mes\r\n\t\t\t// $dias[2] es el dia\r\n\t\t\t\r\n\t\t\t// mktime toma los datos en el orden (0,0,0, mes, dia, año) \r\n\t\t\t$dias = mktime(0,0,0,$dias[1],$dias[2],$dias[0]);\r\n\t\t\t$edad = (int)((time()-$dias)/31556926 );\r\n\t\t\t$resultadoTitular[0]['edad']=$edad;\r\n\t\t\t\r\n\t\t\t///---FIN FUNCIÓN PARA CALCULAR EDAD----\r\n\t\t\t\r\n\t\t\t$estado[0]='1';\r\n\t\t\t$estado[1]='1';\r\n\t\t\t$estado[2]='1';\r\n\t\t\t$estado[3]='1';\r\n\t\t\t$estado[4]='1';\r\n\t\t\t\r\n\t\t\t//---------------CONSULTA QUE DEVUELVE TODA LA INFO DE LOS SERVICIOS DEL ASOCIADO TITULAR----------------\r\n\t\t\t\r\n\t\t\t//Por cuota\r\n\t\t\t$resultadoTitularServicios1 = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t,fme_adhsrv.codigo,fme_adhsrv.parentesco,fme_adhsrv.periodoini,fme_adhsrv.periodofin,fme_adhsrv.motivobaja,fme_adhsrv.documento\r\n\t\t\t\t,tar_srv.nombre AS nombreplan,tar_srv.idmutual \r\n\t\t\t\t\t\t\t\t\t FROM socios,persona,fme_adhsrv,tar_srv \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio' \r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n AND socios.numero_soc= socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND fme_adhsrv.socnumero = socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND fme_adhsrv.codigo = tar_srv.idmutual\");\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\tif(!$resultadoTitularServicios1)\r\n\t\t\t\t$estado[0]='0';\r\n\t\t\t\r\n\t\t\t//Por tarjeta\r\n\t\t\t$resultadoTitularServicios2 = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t,tar_srv.nombre AS nombreplan,tar_srv.codigo AS codigotarsrv, tar_srvadherentes.codigo, tar_srvadherentes.parentesco \r\n\t\t\t\t\t\t\t\t\t FROM socios,persona,tar_srv, tar_srvadherentes \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio' \r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n AND socios.numero_soc= socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND tar_srvadherentes.socnumero = socios.soc_titula \r\n\t\t\t\t\t\t\t\t\t AND tar_srvadherentes.codigo = tar_srv.codigo\");\r\n\t\t\t\r\n\t\t\tif(!$resultadoTitularServicios2)\r\n\t\t\t\t$estado[1]='0';\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//---------------CONSULTA QUE DEVUELVE TODA LA INFO DE LOS ADHERENTES DEL ASOCIADO TITULAR CON APORTES POR CUOTA----------------\r\n\t\t\t\r\n\r\n\t\t $resultadoAdherentes1 = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t,fme_adhsrv.codigo,fme_adhsrv.parentesco,fme_adhsrv.periodoini,fme_adhsrv.periodofin,fme_adhsrv.motivobaja,fme_adhsrv.documento\r\n\t\t\t\t,tar_srv.nombre AS nombreplan,tar_srv.idmutual \r\n\t\t\t\t\t\t\t\t\t FROM socios,persona,fme_adhsrv,tar_srv \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio'\r\n\t\t\t\t\t\t\t\t\t AND socios.numero_soc != socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n\t\t\t\t\t\t\t\t\t AND fme_adhsrv.socnumero = socios.numero_soc \r\n\t\t\t\t\t\t\t\t\t AND fme_adhsrv.codigo = tar_srv.idmutual\");\r\n\t\t\t\r\n\t\t\tif(!$resultadoAdherentes1)\r\n\t\t\t\t$estado[2]='0';\r\n\t\t\t\r\n\t\t\t//---------------CONSULTA QUE DEVUELVE TODA LA INFO DE LOS ADHERENTES DEL ASOCIADO TITULAR CON APORTES POR TARJETA----------------\r\n\r\n\t\t\t$resultadoAdherentes2 = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t,tar_srv.nombre AS nombreplan,tar_srv.codigo AS codigotarsrv, tar_srvadherentes.codigo, tar_srvadherentes.parentesco \r\n\t\t\t\t\t\t\t\t\t FROM socios,persona,tar_srv, tar_srvadherentes \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio'\r\n\t\t\t\t\t\t\t\t\t AND socios.numero_soc != socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n\t\t\t\t\t\t\t\t\t AND tar_srvadherentes.socnumero = socios.numero_soc \r\n\t\t\t\t\t\t\t\t\t AND tar_srvadherentes.codigo = tar_srv.codigo\");\t\r\n\r\n\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\r\n\t\t\tif(!$resultadoAdherentes2)\r\n\t\t\t\t$estado[3]='0';\r\n\t\t\r\n\t\t \r\n\t\t\t//---------------CONSULTA QUE DEVUELVE EL LISTADO DE TODAS LAS ASISTENCIAS----------------\r\n\t\t\t\r\n\t\t\t//NOTA: Para que puedan ver si funciona o no hacer la prueba con el siguiente ejemplo:\r\n\t\t\t// En la tabla fme_asistencia modifiquen en cualquier lado y pongan alguno con doctitu = 06948018 (o busquen cualquier DNI de un socio titular y usen ese)\r\n\t\t\t// Cuando prueben el sistema vayan al ver más de Barrionuevo Samuel y van a ver el listado de atenciones que tiene asociado\r\n\t\t\t\r\n\t\t\t$asistencias = $GLOBALS['db']->select(\"SELECT fme_asistencia.doctitu, fme_asistencia.numdoc, fme_asistencia.nombre,\r\n\t\t\t\t\t\t\t\t\t fme_asistencia.fec_pedido, fme_asistencia.hora_pedido, fme_asistencia.dessit, fme_asistencia.fec_ate,\r\n\t\t\t\t\t\t\t\t\t fme_asistencia.sintomas, fme_asistencia.diagnostico, fme_asistencia.tratamiento, fme_asistencia.hora_aten,\r\n\t\t\t\t\t\t\t\t\t fme_asistencia.profesional\r\n\t\t\t\t\t\t\t\t\t FROM fme_asistencia, socios, persona \r\n\t\t\t\t\t\t\t\t\t WHERE soc_titula = '$numero_socio' \r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n\t\t\t\t\t\t\t\t\t AND numero_soc = soc_titula\r\n\t\t\t\t\t\t\t\t\t AND persona.numdoc = fme_asistencia.doctitu\");\r\n\t\t\t\r\n\t\t\tif(!$asistencias)\r\n\t\t\t\t$estado[4]='0';\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\techo $GLOBALS['twig']->render('/Atenciones/perfil.html', compact('resultadoTitular', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'resultadoTitularServicios1', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'resultadoTitularServicios2', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'resultadoAdherentes1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'resultadoAdherentes2',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'asistencias',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'estado','use','priv'));\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "public function setMostraCabecalhoMes($bMostraCabecalhoMes) {\n $this->bMostraCabecalhoMes = $bMostraCabecalhoMes;\n }", "function modificarMetodologia(){\n\t\t$this->procedimiento='gem.f_metodologia_ime';\n\t\t$this->transaccion='GEM_GEMETO_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_metodologia','id_metodologia','int4');\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function mostrarMaquinas() {\n \n //FUNCION CON LA CONSULTA A REALIZAR\n $sql = \"SELECT MAQUINA.MAQUICODIGO , MAQUINA.MAQUINOMBRE FROM AREA_MAQUINA INNER JOIN MAQUINA ON AREA_MAQUINA.AREAMAQCODIGO=MAQUINA.AREAMAQCODIGO WHERE AREA_MAQUINA.AREAMAQCODIGO='TIM07' OR AREA_MAQUINA.AREAMAQCODIGO='TIM10'\" ;\n $this->_conexion->ejecutar_sentencia($sql);\n return $this->_conexion->retorna_select();\n \n }", "private function compilar_metadatos_generales_consultas_php()\n\t{\n\t\t//-- Datos basicos --\n\t\t$this->manejador_interface->mensaje('Consultas PHP', false);\n\t\t$nombre_clase = 'toba_mc_gene__consultas_php';\n\t\t$archivo = $this->get_dir_generales_compilados() . '/' . $nombre_clase . '.php';\n\t\t$clase = new toba_clase_datos( $nombre_clase );\n\t\tforeach( $this->get_indice_consultas_php() as $clase_consultas ) {\n\t\t\t$datos = toba_proyecto_db::get_consulta_php( $this->get_id(), $clase_consultas );\n\t\t\t$clase->agregar_metodo_datos('info_consulta_php__'.$clase_consultas, $datos );\n\t\t\t$this->manejador_interface->progreso_avanzar();\n\t\t}\n\t\t//Creo el archivo\n\t\t$clase->guardar( $archivo );\n\t\t$this->manejador_interface->progreso_fin();\n\t}", "function insertarSolicitudMayor500000(){\n\t\t$this->procedimiento='mat.ft_solicitud_mayor_500000_ime';\n\t\t$this->transaccion='MAT_SMI_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('nro_po','nro_po','varchar');\n\t\t$this->setParametro('fecha_solicitud','fecha_solicitud','date');\n\t\t$this->setParametro('funcionario','funcionario','text');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha_po','fecha_po','date');\n\t\t$this->setParametro('monto_dolares','monto_dolares','numeric');\n\t\t$this->setParametro('nro_tramite','nro_tramite','varchar');\n\t\t$this->setParametro('proveedor','proveedor','varchar');\n\t\t$this->setParametro('monto_bolivianos','monto_bolivianos','numeric');\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 sortearMesasCommand(){\n // Borra todas las sorteadas exceptuando las de hoy. Esto es asi para evitar que el resorteo \n // en el mismo dia por ej en el turno 2 borre las mesas_sorteadas del turno anterior.\n // Si se hiciera, romperia la dependencia necesaria para generar el InformeFiscalizador de mesas,\n // ver calcularApRelevadas (creo que no se se usa en la practica pero por las dudas no rompo compatibilidad hacia atras)\n //\n // Genera un problema al tratar de implementar aperturas a pedido:\n // Si hoy se sortean $hoy+4 dias para adelante. Cuando pase al otro dia, se reusaran la mesas_sorteadas de ayer\n // porque el delete() no lo agarraba. Esto hace que las aperturas a pedido tengan efecto a diferencia de 2 dias\n //\n // Para evitar esto cuando se buscan mesas_sorteadas:\n // - Si fecha_backup > $hoy => BORRAR\n // - Si fecha_backup == $hoy && created_at < $hoy => BORRAR\n // - Si fecha_backup == $hoy && created_at == $hoy => DEJAR\n // Esto tiene un problema, si se cae el sistema un par de dias y vuelve entre turnos el segundo turno va a eliminar las mesas_sorteadas\n // con las que se usaron para relevar el primer turno. Lo optimo seria que el desarrollador re-sortee a primera hora para evitar esto\n // Hago un @HACK, y es que ademas verificar que no tenga InformeFiscalizadores\n // Esto NO agarra todos los casos, ya que estos son solo generados cuando se valida una apertura. Osea solo agarra si se cae varios dias,\n // el sistema vuelve entre turnos y cargaron&validaron una apertura en el primer turno antes del segundo sorteo\n // Octavio 06-12-2021\n try{\n $hoy = Carbon::now()->format(\"Y-m-d\");\n DB::table('mesas_sorteadas')->where('fecha_backup','>',$hoy)->delete();//Antes solo se hacia este delete\n\n $casinos_con_informes_fisca_creados_para_hoy = DB::table('informe_fiscalizadores')\n ->where('fecha','>=',$hoy)->select('id_casino')->get()->pluck('id_casino');\n\n DB::table('mesas_sorteadas')->where('fecha_backup','=',$hoy)\n ->where('created_at','<',$hoy)->whereNotIn('id_casino',$casinos_con_informes_fisca_creados_para_hoy)->delete();\n }catch(Exception $e){\n throw new \\Exception(\"FALLO durante la eliminación de sorteos mesa de paño - llame a un ADMINISTRADOR\", 1);\n }\n $sorteoController = new SorteoMesasController;\n $casinos = Casino::all();\n foreach ($casinos as $cas) {\n if(count($cas->mesas) > 0){\n for ($i=0; $i < self::$cantidad_dias_backup; $i++) {\n $fecha_backup = Carbon::now()->addDays($i)->format(\"Y-m-d\");\n $sorteadas = $sorteoController->sortear($cas->id_casino, $fecha_backup);\n }\n }\n }\n return $this->creaRelevamientoZip();\n }", "function compilar_metadatos_generales()\n\t{\n\t\t$this->manejador_interface->titulo(\"Compilando datos generales\");\n\t\ttoba_proyecto_db::set_db( $this->db );\n\t\t$path = $this->get_dir_generales_compilados();\n\t\ttoba_manejador_archivos::crear_arbol_directorios( $path );\n\t\t$this->compilar_metadatos_generales_basicos();\n\t\t$this->compilar_metadatos_generales_grupos_acceso();\n\t\t$this->compilar_metadatos_generales_puntos_control();\n\t\t$this->compilar_metadatos_generales_mensajes();\n\t\t$this->compilar_metadatos_generales_dimensiones();\n\t\t$this->compilar_metadatos_generales_consultas_php();\n\t\t$this->compilar_metadatos_generales_servicios_web();\n\t\t$this->compilar_metadatos_generales_pms();\n\n\t}", "public function gera_linhas_somatorios()\n\t{\n\t\tif(count($this->somatorios) > 0)\n\t\t{\n\t\t\techo \"<tr class=totalizadores>\";\n\t\t\tfor($i=0; $i < count($this->nome_colunas); $i++)\n\t\t\t{\n\t\t\t\t$alinhamento = $this->nome_colunas[$i][alinhamento];\n\n\t\t\t\tfor($b=0; $b < count($this->somatorios); $b++)\n\t\t\t\t{\n\t\t\t\t\tif($this->nome_colunas[$i][nome_coluna] == $this->somatorios[$b][nome_coluna])\n\t\t\t\t\t{\n\t\t\t\t\t\t$valor = $this->somatorios[$b][total];\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// \tVERIFICO SE E PARA IMPRIMIR O VALOR\n\t\t\t\tif($this->nome_colunas[$i][somatorio] == 's')\n\t\t\t\t{\n\t\t\t\t\t//\t ESCOLHO O TIPO DE DADO\n\t\t\t\t\tswitch($this->nome_colunas[$i][tipo])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'moeda':\n\t\t\t\t\t\t\t$valor = Util::exibe_valor_moeda($valor);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'data':\n\t\t\t\t\t\t\t$valor = Util::data_certa($valor);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$valor = $valor;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\techo \"\n\t\t\t\t\t\t \t<td align=$alinhamento>\n\t\t\t\t\t\t\t\t\" . $valor . \"\n\t\t\t\t\t\t \t</td>\n\t\t\t\t\t\t \";\n\t\t\t\t\t$valor = '';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"<td align=$alinhamento></td>\";\n\t\t\t\t}\n\n\n\n\t\t\t}\n\t\t\techo '</tr>';\n\t\t}\n\t}", "public function reporteMaestrosModel($perfilM, $luckyM, $desdeM, $hastaM, $zonaM, $estadoM){\n\n\t\t$query = \"SELECT u.idlucky lucky, u.company ferreteria, u.name nombres, CONCAT(u.lastname1,' ',u.lastname2) apellidos, u.dni dni, \n\t\t\t\t\t\t u.phone telefono, l.name distrito, z.zone zona, DATE_FORMAT(u.register, '%d/%m/%Y') fecha,\n \t\t\t\t DATE_FORMAT(u.register, '%H:%I:%S' ) hora,\n \t\t\t\t case when u.idstate = 1 then 'Activo' else 'Baja' end as estado\n\t\t\t\t FROM users u\n\t\t\t\t INNER JOIN zones z ON u.idzone = z.idzone\n\t\t\t\t INNER JOIN location l ON u.idloc = l.idloc\n\t\t\t\t WHERE idprofile = 4\";\n\n\t\t// Agrego la zona si esta especificada\n\t\tif ($zonaM <> 0) {\n\t\t\t$query .= \" and u.idzone = \".$zonaM;\n\t\t}\n\n\t\t// Agrego el estado si esta especificado\n\t\tif ($estadoM <> 3) {\n\t\t\t$query .= \" and u.idstate = \".$estadoM;\n\t\t}\n\n\t\t//Si tiene rango de fechas lo agrego al query\n\t\tif($desdeM != null && $hastaM !=null){\n\t\t\t$query .= \" and DATE(u.register) BETWEEN '\".$desdeM.\"' AND '\".$hastaM.\"'\";\n\t\t}\n\n\t\t//Si es ferretero solo saco sus maestros\n\t\tif ($perfilM == '3' ) {\n\t\t\t$query .= \" and u.idlucky = '\".$luckyM.\"'\";\n\t\t}\n\n\t\ttry{\n\t\t\t$stmt = Conexion::conectar()->prepare($query);\n\t\t\t$stmt->execute();\n\n\t\t\treturn $stmt;//->fetchAll();\n\n\t\t\t$stmt = null;\n\n\t\t}catch(PDOException $error){\n\t\t\techo 'error: '.$error->getMessage();\n\t\t}\n\t}", "public function __construct( $iCodigoOrdem = null ) {\n\n $this->iCodigoOrdem = $iCodigoOrdem;\n if (!empty($this->iCodigoOrdem)) {\n\n $oDaoMatOrdem = new cl_matordem();\n $oDaoMatestoqueitemoc = new cl_matestoqueitemoc();\n $oDaoItemAnulado = new cl_matordemitemanu();\n $sSqlValorAnulado = $oDaoItemAnulado->sql_query_file_anulado(\"sum(m36_vrlanu)\", \"m51_codordem = {$this->iCodigoOrdem}\");\n $sSqlMatestoqueitemoc = $oDaoMatestoqueitemoc->sql_query(null,null,\"sum(m71_valor) \", null,\"m52_codordem = {$this->iCodigoOrdem} and m73_cancelado is false\");\n\n $sCamposMatOrdem = \"m51_codordem , \";\n $sCamposMatOrdem .= \"m51_data , \";\n $sCamposMatOrdem .= \"m51_depto , \";\n $sCamposMatOrdem .= \"m51_numcgm , \";\n $sCamposMatOrdem .= \"m51_obs , \";\n $sCamposMatOrdem .= \"m51_tipo , \";\n $sCamposMatOrdem .= \"m51_valortotal , \";\n $sCamposMatOrdem .= \"m53_data , \";\n $sCamposMatOrdem .= \"({$sSqlValorAnulado}) as valoranulado, \";\n $sCamposMatOrdem .= \"($sSqlMatestoqueitemoc) as valorlancado \";\n\n $sSqlMatOrdem = $oDaoMatOrdem->sql_query_tot( null,$sCamposMatOrdem , null, \"m51_codordem = {$iCodigoOrdem}\");\n $rsMatOrdem = $oDaoMatOrdem->sql_record($sSqlMatOrdem);\n\n if ($oDaoMatOrdem->erro_status == \"0\") {\n throw new BusinessException(_M(self::URL_MENSAGEM.\"ordem_de_compra_nao_encontrada\"));\n }\n\n $oDadosMatOrdem = db_utils::fieldsMemory($rsMatOrdem, 0);\n $nLancar = $oDadosMatOrdem->m51_valortotal - $oDadosMatOrdem->valorlancado;\n $this->iCodigoFornecedor = $oDadosMatOrdem->m51_numcgm;\n $this->iCodigoDepartamento = $oDadosMatOrdem->m51_depto;\n $this->setEmissao(new DBDate($oDadosMatOrdem->m51_data));\n $this->setObservacao($oDadosMatOrdem->m51_obs);\n $this->setTipoCompra($oDadosMatOrdem->m51_tipo);\n $this->setTotalOrdem($oDadosMatOrdem->m51_valortotal);\n $this->setValorLancado($oDadosMatOrdem->valorlancado);\n $this->setValorLancar($nLancar);\n $this->nValorAnulado = $oDadosMatOrdem->valoranulado;\n\n\n /*\n * verificamos se a ordem esta anulada, caso venha valor no campo m53_data\n * instanciamos e setamos o objeto anulacao\n */\n if ( $oDadosMatOrdem->m53_data != '' ) {\n $this->setAnulacao(new DBDate($oDadosMatOrdem->m53_data));\n }\n }\n }", "static public function mdlIngresarTipoMembresia($tabla,$datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(id_empresa,nombre_membresia,id_usuario) VALUES (:id_empresa,:nombre_membresia,:id_usuario)\");\n\n $stmt->bindParam(\":id_empresa\", $datos[\"id_empresa\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":nombre_membresia\", $datos[\"nombre_membresia\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_usuario\", $datos[\"id_usuario\"], PDO::PARAM_STR);\n\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "function listarMetodologia(){\n\t\t$this->procedimiento='gem.f_metodologia_sel';\n\t\t$this->transaccion='GEM_GEMETO_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_metodologia','int4');\n\t\t$this->captura('codigo','varchar');\n\t\t$this->captura('nombre','varchar');\n\t\t$this->captura('estado_reg','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\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 listaTodosAniversariantesdoMes($mes){\r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objDao = Connection::getInstance();\r\n $consulta=\"SELECT Matricula,Nome,DataNascimento1,Fone FROM membros WHERE MONTH(DataNascimento1) = $mes\";\r\n \r\n $resultado = mysql_query($consulta) or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n \r\n $listaMembro = array();\r\n \r\n $i=0;\r\n \r\n while ($registro = mysql_fetch_array($resultado, MYSQL_ASSOC)){\r\n \r\n\t $membro = new objetoMembro();\r\n \r\n $membro->setMatricula($registro['Matricula']);\r\n $membro->setNome($registro['Nome']);\r\n $membro->setData($registro['DataNascimento1']); \r\n $membro->setFone($registro['Fone']); \r\n \r\n\t $listaMembro[$i] = $membro;\r\n \r\n\t $i++;\r\n\t}\r\n \r\n \r\n\t\treturn $listaMembro;\r\n\t\tmysql_free_result($resultado);\r\n $objDao->freebanco();\r\n \r\n }", "static public function mdlSelecMembresias($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 \");\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.\"' \");\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n }", "function ini__operacion (){\n \n //obtenemos el arreglo almacenado en la operacion \"aulas disponibles\". Su formato es :\n //Array ('id_aula'=>x 'hora_inicio'=>x 'hora_fin'=>x)\n $datos_ad=toba::memoria()->get_parametros();\n //esta condicion es fundamental para no quedarnos en la misma pantalla\n if(isset($datos_ad['id_aula'])){\n $this->s__accion=\"Vinculo\";\n $this->s__aula_disponible=$datos_ad;\n \n //eliminamos la informacion guardada en el arreglo $_SESSION\n toba::memoria()->limpiar_memoria();\n $this->set_pantalla('pant_persona');\n }\n }", "public function testConteoSmsPorMes() {\n $this->assertInternalType( 'integer', $this->ConteoSms->buscarConteoMes( date( 'n' ) ), \"El tipo de valor debe ser entero\" );\n $this->assertLessThanOrEqual( 8, $this->ConteoSms->buscarConteoMes( date( 'n' ) ), \"No corresponde la cantidad contabilizada del mes\" );\n $this->assertEqual( $this->ConteoSms->buscarConteoMes( 0 ), 0, \"No corresponde la cantida devuelta cuando el mes es incorrecto\" );\n $this->assertEqual( $this->ConteoSms->buscarConteoMes(), 0, \"No corresponde la cantida devuelta cuando el mes es nulo\" );\n }", "function getSemaforo() {\n\t\tglobal $usr;\n\n\t\tif ($this->extra[\"imprimir\"]) {\n\t\t\t$this->resultado = $this->__getSemaforoNormal();\n\t\t}\n\t\telseif ($usr->orientacion_semaforo == 0) {\n\t\t\t$this->resultado = $this->__getSemaforoNormal();\n\t\t}\n\t\telse {\n\t\t\t$this->resultado = $this->__getSemaforoInvertido();\n\t\t}\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->cm06_i_codigo = ($this->cm06_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_i_codigo\"]:$this->cm06_i_codigo);\n $this->cm06_i_sepultamento = ($this->cm06_i_sepultamento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_i_sepultamento\"]:$this->cm06_i_sepultamento);\n $this->cm06_i_ossoario = ($this->cm06_i_ossoario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_i_ossoario\"]:$this->cm06_i_ossoario);\n if($this->cm06_d_entrada == \"\"){\n $this->cm06_d_entrada_dia = ($this->cm06_d_entrada_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_d_entrada_dia\"]:$this->cm06_d_entrada_dia);\n $this->cm06_d_entrada_mes = ($this->cm06_d_entrada_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_d_entrada_mes\"]:$this->cm06_d_entrada_mes);\n $this->cm06_d_entrada_ano = ($this->cm06_d_entrada_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_d_entrada_ano\"]:$this->cm06_d_entrada_ano);\n if($this->cm06_d_entrada_dia != \"\"){\n $this->cm06_d_entrada = $this->cm06_d_entrada_ano.\"-\".$this->cm06_d_entrada_mes.\"-\".$this->cm06_d_entrada_dia;\n }\n }\n $this->cm06_t_obs = ($this->cm06_t_obs == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_t_obs\"]:$this->cm06_t_obs);\n }else{\n $this->cm06_i_codigo = ($this->cm06_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"cm06_i_codigo\"]:$this->cm06_i_codigo);\n }\n }", "public function getAllMesas(){\n\n\t\treturn $this->conn->get('lista_allmesa');\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->k142_sequencial = ($this->k142_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_sequencial\"]:$this->k142_sequencial);\n $this->k142_idret = ($this->k142_idret == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_idret\"]:$this->k142_idret);\n $this->k142_processo = ($this->k142_processo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_processo\"]:$this->k142_processo);\n if($this->k142_dataprocesso == \"\"){\n $this->k142_dataprocesso_dia = ($this->k142_dataprocesso_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_dataprocesso_dia\"]:$this->k142_dataprocesso_dia);\n $this->k142_dataprocesso_mes = ($this->k142_dataprocesso_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_dataprocesso_mes\"]:$this->k142_dataprocesso_mes);\n $this->k142_dataprocesso_ano = ($this->k142_dataprocesso_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_dataprocesso_ano\"]:$this->k142_dataprocesso_ano);\n if($this->k142_dataprocesso_dia != \"\"){\n $this->k142_dataprocesso = $this->k142_dataprocesso_ano.\"-\".$this->k142_dataprocesso_mes.\"-\".$this->k142_dataprocesso_dia;\n }\n }\n $this->k142_titular = ($this->k142_titular == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_titular\"]:$this->k142_titular);\n $this->k142_observacao = ($this->k142_observacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_observacao\"]:$this->k142_observacao);\n }else{\n $this->k142_sequencial = ($this->k142_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_sequencial\"]:$this->k142_sequencial);\n }\n }", "public function gerarDados() {\n \n if (empty($this->sDataInicial)) {\n throw new Exception(\"Data inicial nao informada!\");\n }\n \n if (empty($this->sDataFinal)) {\n throw new Exception(\"Data final não informada!\");\n }\n /**\n * Separamos a data do em ano, mes, dia\n */\n list($iAno, $iMes, $iDia) = explode(\"-\",$this->sDataFinal);\n $oInstituicao = db_stdClass::getDadosInstit(db_getsession(\"DB_instit\"));\n $sListaInstit = db_getsession(\"DB_instit\");\n $sSqlSubsidio = \"select c16_mes, \";\n $sSqlSubsidio .= \" c16_ano,\";\n $sSqlSubsidio .= \" c16_subsidiomensal,\";\n $sSqlSubsidio .= \" c16_subsidioextraordinario,\";\n $sSqlSubsidio .= \" z01_nome, \";\n $sSqlSubsidio .= \" z01_cgccpf \";\n $sSqlSubsidio .= \" from padsigapsubsidiosvereadores \"; \n $sSqlSubsidio .= \" inner join cgm on z01_numcgm = c16_numcgm \"; \n $sSqlSubsidio .= \" where c16_ano = {$iAno} \";\n $sSqlSubsidio .= \" and c16_mes <= $iMes\"; \n $sSqlSubsidio .= \" and c16_instit = {$sListaInstit}\";\n $sSqlSubsidio .= \" order by c16_ano, c16_mes\";\n $rsSubsidio = db_query($sSqlSubsidio); \n $iTotalLinhas = pg_num_rows($rsSubsidio);\n for ($i = 0; $i < $iTotalLinhas; $i++) {\n \n $sDiaMesAno = \"{$iAno}-\".str_pad($iMes, 2, \"0\", STR_PAD_LEFT).\"-\".str_pad($iDia, 2, \"0\", STR_PAD_LEFT);\n $oSubSidio = db_utils::fieldsMemory($rsSubsidio, $i);\n \n $oRetorno = new stdClass();\n $oRetorno->subCodigoEntidade = str_pad($this->iCodigoTCE, 4, \"0\", STR_PAD_LEFT);\n $oRetorno->subMesAnoMovimento = $sDiaMesAno;\n $iUltimoDiaMes = cal_days_in_month(CAL_GREGORIAN, $oSubSidio->c16_mes, $oSubSidio->c16_ano); \n $oRetorno->subMesAnoReferencia = $oSubSidio->c16_ano.\"-\".str_pad($oSubSidio->c16_mes, 2, \"0\", STR_PAD_LEFT).\"-\".\n str_pad($iUltimoDiaMes, 2, \"0\", STR_PAD_LEFT);\n $oRetorno->subNomeVereador = substr($oSubSidio->z01_nome, 0, 80); \n $oRetorno->subCPF = str_pad($oSubSidio->z01_cgccpf, 11, \"0\", STR_PAD_LEFT); \n $oRetorno->subMensal = $this->corrigeValor($oSubSidio->c16_subsidiomensal, 13); \n $oRetorno->subExtraordinario = $this->corrigeValor($oSubSidio->c16_subsidioextraordinario, 13); \n $oRetorno->subTotal = $this->corrigeValor(($oSubSidio->c16_subsidioextraordinario+\n $oSubSidio->c16_subsidiomensal), 13);\n array_push($this->aDados, $oRetorno); \n }\n return true;\n }", "function rotacionSeisMeses()\n {\n $rotacion_smeses = new \\stdClass();\n $rotacion_smeses->labels = [];\n $rotacion_smeses->data = [];\n\n // Prepare query\n $sql = \"\n SELECT (COUNT(f.id) / m.maquina_casillas) as result, DATE_FORMAT(f.factura_fecha_emision, '%m') AS month, DATE_FORMAT(f.factura_fecha_emision, '%M') AS month_letters\n FROM facturas as f, maquinas as m WHERE f.factura_fecha_emision <= DATE(NOW()) AND f.factura_fecha_emision > DATE_SUB(DATE(NOW()), INTERVAL 6 MONTH) $this->sql_condition\n GROUP BY month\";\n\n // Execute sql\n $query = DB::select($sql);\n\n // Config chart roacion ultimos 6 meses\n $rotacion_smeses->labels = array_pluck($query, 'month_letters');\n $rotacion_smeses->data = array_pluck($query, 'result');\n\n return $rotacion_smeses;\n }", "function Consulta_Informacion_Metas()\n {\n $sql=\"SELECT b.id,b.uid,year(b.fecha_inicio) AS ano, sum(b.no_dias) as no_dias,count(substr(b.fecha_inicio,1,4)) AS no_regs,\n sum(b.cantidad) AS total,a.name\n FROM crm_proyeccion as b LEFT JOIN users as a ON b.uid = a.uid\n WHERE b.active = 1 AND b.gid='\".$this->gid.\"' \".$this->filtro.\"\n GROUP BY substr(b.fecha_inicio,1,4)\n ORDER BY substr(b.fecha_inicio,1,4)\";\n $res=$this->db->sql_query($sql) or die (\"Error en la consulta: \".$sql);\n if($this->db->sql_numrows($res) > 0)\n {\n while(list($id,$_uid,$ano,$no_dias,$no_reg,$cantidad,$name) = $this->db->sql_fetchrow($res))\n {\n $this->array_metas[$ano]= $cantidad;\n }\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->d02_contri = ($this->d02_contri == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_contri\"]:$this->d02_contri);\n $this->d02_codedi = ($this->d02_codedi == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_codedi\"]:$this->d02_codedi);\n $this->d02_codigo = ($this->d02_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_codigo\"]:$this->d02_codigo);\n if($this->d02_dtauto == \"\"){\n $this->d02_dtauto_dia = ($this->d02_dtauto_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_dtauto_dia\"]:$this->d02_dtauto_dia);\n $this->d02_dtauto_mes = ($this->d02_dtauto_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_dtauto_mes\"]:$this->d02_dtauto_mes);\n $this->d02_dtauto_ano = ($this->d02_dtauto_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_dtauto_ano\"]:$this->d02_dtauto_ano);\n if($this->d02_dtauto_dia != \"\"){\n $this->d02_dtauto = $this->d02_dtauto_ano.\"-\".$this->d02_dtauto_mes.\"-\".$this->d02_dtauto_dia;\n }\n }\n $this->d02_autori = ($this->d02_autori == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_autori\"]:$this->d02_autori);\n $this->d02_idlog = ($this->d02_idlog == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_idlog\"]:$this->d02_idlog);\n if($this->d02_data == \"\"){\n $this->d02_data_dia = ($this->d02_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_data_dia\"]:$this->d02_data_dia);\n $this->d02_data_mes = ($this->d02_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_data_mes\"]:$this->d02_data_mes);\n $this->d02_data_ano = ($this->d02_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_data_ano\"]:$this->d02_data_ano);\n if($this->d02_data_dia != \"\"){\n $this->d02_data = $this->d02_data_ano.\"-\".$this->d02_data_mes.\"-\".$this->d02_data_dia;\n }\n }\n $this->d02_profun = ($this->d02_profun == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_profun\"]:$this->d02_profun);\n $this->d02_valorizacao = ($this->d02_valorizacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_valorizacao\"]:$this->d02_valorizacao);\n }else{\n $this->d02_contri = ($this->d02_contri == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_contri\"]:$this->d02_contri);\n }\n }", "public function alterar($oSicasConsultaMedica = NULL){\r\n\t\tif($oSicasConsultaMedica == NULL){\r\n\t\t\t// recebe dados do formulario\r\n\t\t\t$post = DadosFormulario::formSicasConsultaMedica(NULL, 2);\t\t\r\n\t\t\t// valida dados do formulario\r\n\t\t\t$oValidador = new ValidadorFormulario();\r\n\t\t\tif(!$oValidador->validaFormSicasConsultaMedica($post,2)){\r\n\t\t\t\t$this->msg = $oValidador->msg;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// cria variaveis para validacao com as chaves do array\r\n\t\t\tforeach($post as $i => $v) $$i = utf8_encode($v);\r\n\t\t\t// cria objeto para grava-lo no BD\r\n\t\t\t$oSicasAtendimento = new SicasAtendimento($cd_atendimento);\n\t\t\t$oSicasMedico = new SicasMedico($cd_medico);\n\t\t\t$oSicasTipoAtendimento = new SicasTipoAtendimento($cd_tipo_atendimento);\n\t\t\t$oSicasConsultaMedica = new SicasConsultaMedica($cd_consulta_medica,$oSicasAtendimento,$dt_consulta,$oSicasMedico,$qp_paciente,$exame_fisico,$exame_solicitado,$diag_paciente,$oSicasTipoAtendimento,$resultado,$tratamento,$status);\r\n\t\t}\t\t\r\n\t\t$oSicasConsultaMedicaBD = new SicasConsultaMedicaBD();\r\n\t\tif(!$oSicasConsultaMedicaBD->alterar($oSicasConsultaMedica)){\r\n\t\t\t$this->msg = $oSicasConsultaMedicaBD->msg;\r\n\t\t\treturn false;\t\r\n\t\t}\t\t\r\n\t\treturn true;\t\t\r\n\t}", "function Cargar_alojamientos_condiciones($clave, $filadesde, $buscar_paquete, $buscar_tipo){\r\n\r\n\t\t$conexion = $this ->Conexion;\r\n\t\t$Usuario = $this ->Usuario;\r\n\r\n\t\r\n\t\tif($buscar_tipo != ''){\r\n\t\t\t$paq = \" AND PAQUETE = '\".$buscar_paquete.\"'\";\r\n\t\t\t$CADENA_BUSCAR = \" WHERE CLAVE_CUADRO = '\".$clave.\"' AND TIPO = '\".$buscar_tipo.\"'\";\r\n\t\t\tif($buscar_paquete != ''){\r\n\t\t\t\t$CADENA_BUSCAR .= $paq;\t\r\n\t\t\t}\r\n\t\t}elseif($buscar_paquete != ''){\r\n\t\t\t$CADENA_BUSCAR = \" WHERE CLAVE_CUADRO = '\".$clave.\"' AND PAQUETE = '\".$buscar_paquete.\"'\";\r\n\t\t}else{\r\n\t\t\t$CADENA_BUSCAR = \" WHERE CLAVE_CUADRO = '\".$clave.\"'\"; \r\n \t\t}\r\n\r\n\r\n\t\t$resultado =$conexion->query(\"SELECT paquete, tipo, uso,\r\n\t\tDATE_FORMAT(salida_desde, '%d-%m-%Y') AS salida_desde,\r\n\t\tDATE_FORMAT(salida_hasta, '%d-%m-%Y') AS salida_hasta,\r\n\t\tDATE_FORMAT(reserva_desde, '%d-%m-%Y') AS reserva_desde,\r\n\t\tDATE_FORMAT(reserva_hasta, '%d-%m-%Y') AS reserva_hasta,\r\n\t\tmargen_1, margen_2, maximo, forma_calculo, valor_1, valor_2, acumulable, prioritario, aplicacion, regimen FROM hit_producto_cuadros_alojamientos_condiciones \".$CADENA_BUSCAR.\" ORDER BY paquete, tipo, uso, salida_desde, reserva_desde, margen_1\");\r\n\r\n\t\t/*if ($resultado == FALSE){\r\n\t\t\techo('Error en la consulta: '.$CADENA_BUSCAR);\r\n\t\t\t$resultado->close();\r\n\t\t\t$conexion->close();\r\n\t\t\texit;\r\n\t\t}*/\r\n\r\n\t\t//Guardamos el resultado en una matriz con un numero fijo de registros\r\n\t\t//que controlaremos por una tabla de configuracion de pantallas de usuarios. ESPECIFICO: Solo el nombre del formulario en la query\r\n\t\t$numero_filas =$conexion->query(\"SELECT LINEAS_MODIFICACION FROM hit_usuarios_formularios WHERE FORMULARIO = 'PRODUCTO_CUADROS_ALOJAMIENTOS_CONDICIONES' AND USUARIO = '\".$Usuario.\"'\");\r\n\t\t$Nfilas\t = $numero_filas->fetch_assoc();\t\t\t\t\t\t\t\t\t\t\t //------\r\n\r\n\t\t$folletos_condiciones = array();\r\n\t\tfor ($num_fila = $filadesde-1; $num_fila <= $filadesde + $Nfilas['LINEAS_MODIFICACION']-2; $num_fila++) {\r\n\t\t\t$resultado->data_seek($num_fila);\r\n\t\t\t$fila = $resultado->fetch_assoc();\r\n\t\t\t//Esto es para dejar de cargar lineas en caso de que sea la ultima pagina de la consulta\r\n\t\t\tif($fila['paquete'] == ''){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tarray_push($folletos_condiciones,$fila);\r\n\t\t}\r\n\r\n\t\t//Liberar Memoria usada por la consulta\r\n\t\t$resultado->close();\r\n\t\t$numero_filas->close();\r\n\r\n\t\treturn $folletos_condiciones;\t\t\t\t\t\t\t\t\t\t\t\r\n\t}", "function datos_simbolos_seleccion($id_seleccion,$id_usuario) {\n\t\t$query = \"SELECT seleccion_simbolos.*,repositorio_archivos.*\n\t\tFROM seleccion_simbolos,repositorio_archivos\n\t\tWHERE seleccion_simbolos.id_seleccion = '$id_seleccion'\n\t\tAND seleccion_simbolos.id_file=repositorio_archivos.file_id\n\t\tAND repositorio_archivos.id_usuario='$id_usuario'\n\t\tORDER BY seleccion_simbolos.orden 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$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 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}", "public function buscar_comprobante_venta_3($anio ,$mes ,$fech1 ,$fech2 ,$tipodocumento) {\n //CPC_TipoDocumento => F factura, B boleta\n //CPC_total => total de la FACTURA o BOLETA CPC_FechaRegistro BETWEEN '20121201' AND '20121202'\n\n $where=\"\";\n //----------\n if($anio!=\"--\" && $mes ==\"--\"){// SOLO AÑO\n $where=\"AND YEAR(CPC_FechaRegistro)='\" . $anio . \"'\";\n }\n if($anio!=\"--\" && $mes !=\"--\" ){// MES Y AÑO\n $where=\"AND YEAR(CPC_FechaRegistro)='\" . $anio . \"' AND MONTH(CPC_FechaRegistro)='\" . $mes .\"'\";\n }\n if($anio==\"--\" && $mes !=\"--\"){//MES CON AÑO ACTUAL\n $where=\"AND YEAR(CPC_FechaRegistro)=' \".date(\"Y\").\"' AND MONTH(CPC_FechaRegistro)='\" . $mes .\"'\";\n }\n\n //-----------------\n \n if($anio==\"--\" && $mes ==\"--\" && $fech1!=\"--\" && $fech2==\"--\"){//FECHA INICIAL\n $where=\"AND CPC_FechaRegistro > '\" . $fech1 . \"'\";\n }\n if($anio==\"--\" && $mes ==\"--\" && $fech1!=\"--\" && $fech2!=\"--\" ){//FECHA INICIAL Y FECHA FINAL\n $where=\"AND CPC_FechaRegistro >= '\" . $fech1 . \"' AND CPC_FechaRegistro <= '\" . $fech2 . \"'\";\n }\n \n \n //------------\n\n \n $wheretdoc= \"\";\n if($tipodocumento !=\"--\")\n $wheretdoc= \" AND CPC_TipoDocumento='\".$tipodocumento.\"' \";\n\n \n\n $sql = \" SELECT com.*,CONCAT(pe.PERSC_Nombre , ' ', pe.PERSC_ApellidoPaterno, ' ', pe.PERSC_ApellidoMaterno) as nombre , MONED_Simbolo from cji_comprobante com\n inner join cji_cliente cl on cl.CLIP_Codigo = com.CLIP_Codigo\n inner join cji_persona pe on pe.PERSP_Codigo = cl.PERSP_Codigo\n inner JOIN cji_moneda m ON m.MONED_Codigo=com.MONED_Codigo \n WHERE CPC_TipoOperacion='V' \".$wheretdoc.$where.\"\n \n UNION \n SELECT com.* ,EMPRC_RazonSocial as nombre ,MONED_Simbolo from cji_comprobante com\n inner join cji_cliente cl on cl.CLIP_Codigo = com.CLIP_Codigo\n inner join cji_empresa es on es.EMPRP_Codigo = cl.EMPRP_Codigo\n inner JOIN cji_moneda m ON m.MONED_Codigo = com.MONED_Codigo \n WHERE CPC_TipoOperacion='V' \".$wheretdoc.$where.\"\";\n\n //echo $sql;\n $query = $this->db->query($sql);\n if ($query->num_rows > 0) {\n foreach ($query->result() as $fila) {\n $data[] = $fila;\n }\n return $data;\n }\n return array();\n }", "public function movimentacaoEstoque($permissao) // Gera dados para tabela movimentacao de estoque\n\t\t{\n\t\t\t\n\t\t\tself::operacoes($permissao); // Gera o select(html) com as operacoes do bd\n\n\t\t\t// Busca dados do item\n\t\t\t$select = \"\n\t\t\t\tSELECT cod_item, item_desc, saldo\n\t\t\t\tFROM estoque\n\t\t\t\tWHERE item_desc = '{$_POST['item_desc']}'\";\t\t\t\t\t\t\n\t\t\t$result = $this->mysqli->query($select);\t\t\t\t\t\t\t\n\t\t\tself::checaBuscaVazia($result); // Confere se o select retornou algo\n\n\t\t\t$row = $result->fetch_assoc();\n\t\t\t// Gera conteudo da tabela\n\t\t\t$this->movimentacao .= \"\t\t\n\t\t\t<tr>\n\t\t\t\t<td id='alinhamento'>\".$row['cod_item'].\"</td>\n\t\t\t\t<td id='alinhamento'>\".$row['item_desc'].\"</td>\n\t\t\t\t<td id='alinhamento'>\".$row['saldo'].\"</td>\n\t\t\t\t\n\t\t\t\t<form method='POST' action='interacao_bd/update_movn_estoque.php'>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<div class='form-group'>\t\t\t\n\t\t\t\t\t\t\t<select class='form-control' onchange='submitForm(this.form);' name='cod_op' required>\t\t\t\t\t\t\n\t\t\t\t\t\t\t\".$this->operacoes.\"\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</div>\t\t\t\t\t\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input name='qtde' class='form-control' placeholder='Quantidade'>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<button style='width: 76%; margin-left: 12%; margin-right: 12%;' type='submit' class='btn btn-success'>Confirmar</button>\n\t\t\t\t\t</td>\n\t\t\t\t\t<input type='hidden' value='\".$row['cod_item'].\"' name='cod_item'/>\n\t\t\t\t</form>\n\t\t\t</tr>\";\t\n\n\t\t\techo $this->movimentacao; // Imprime a linha da tabela\n\t\t}", "public function insertMas(){\n\t \t\t\t// FIELDS TERMINATED BY ',' \n\t \t\t\t// ENCLOSED BY '\"' \n\t \t\t\t// LINES TERMINATED BY '\\r\\n'\n\t\t\t\t // IGNORE 1 LINES\n\t\t\t\t // (area,departamento,nombre_firma,puesto,ext,tel,cel,correo);\n\t\t}", "function __getSemaforoNormal() {\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\n\t\t$sql = \"SELECT sonido_semaforo FROM public.cliente_usuario_extendido where usuario_id=\".pg_escape_string($current_usuario_id);\n\t//\tprint($sql);\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\texit();\n\t\t}\n\n\t\t$row = $res->fetchRow();\n\t\t$sonido = $row[\"sonido_semaforo\"];\n\n\n\t\t/* OBTENER LOS DATOS Y PARSEARLO */\n\t\t$sql = \"SELECT * FROM reporte.semaforo(\".\n\t\t\t\tpg_escape_string($current_usuario_id).\")\";\n//\t\tprint($sql);\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\texit();\n\t\t}\n\n\t\t$row = $res->fetchRow();\n\t\t$dom = new DomDocument();\n\t\t$dom->preserveWhiteSpace = false;\n\t\t$dom->loadXML($row[\"semaforo\"]);\n\t\t$xpath = new DOMXpath($dom);\n\t\tunset($row[\"semaforo\"]);\n\n\t\t/* SI NO HAY DATOS MOSTRAR MENSAJE */\n\t\tif (!$xpath->query('//datos/dato')->length) {\n\t\t\treturn $this->__generarContenedorSinDatos();\n\t\t}\n\n\t\t$conf_objetivos = $xpath->query('//objetivos/objetivo[@objetivo_id>0]');\n\t\t$conf_nodos = $xpath->query('//propiedades/nodos/nodo[@nodo_id!=0]');\n\n\t\t/* TEMPLATE DEL GRAFICO */\n\t\t$T =& new Template_PHPLIB(($this->extra[\"imprimir\"])?REP_PATH_PRINTTEMPLATES:REP_PATH_TABLETEMPLATES);\n\t\t$T->setFile('tpl_tabla', 'semaforo.tpl');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_MONITORES', 'lista_monitores');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_MONITORES_UBICACION', 'lista_monitores_ubicacion');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_MONITORES_BLANCO', 'lista_monitores_blanco');\n\t\t$T->setBlock('tpl_tabla', 'TIENE_TOOLTIP', 'tiene_tooltip');\n\n\t\t$T->setBlock('tpl_tabla', 'LISTA_MONITORES_ESTADO', 'lista_monitores_estado');\n\t\t$T->setBlock('tpl_tabla', 'ESTADO_BLANCO', 'estado_blanco');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_SALTO_PRINT', 'bloque_salto_print');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_OBJETIVOS', 'lista_objetivos');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_OBJETIVOS0', 'lista_objetivos0');\n\n\t\t$T->setVar('__item_id', $this->__item_id);\n\t\t$T->setVar('__item_id_nuevo', REP_ITEM_EVENTOS);\n\t\t$T->setVar('__ancho_tabla', ($this->extra[\"popup\"])?'':'514px');\n\t\t$T->setVar('__display_botones', ($this->extra[\"popup\"])?'none':'inline');\n\t\t$T->setVar('__popup', ($this->extra[\"popup\"])?'1':'0');\n\n\t\t$tooltip_id = 0;\n\t\t$cnt_objetivos = 0;\n\n\t\t//OBTENER TIMEZONE DEL USUARIO\n\t\t$sql2 = \"SELECT _cliente_tz\".\"(\".pg_escape_string($current_usuario_id).\")\";\n\t\t$res0 =& $mdb2->query($sql2);\n\t\t\n\t\tif (MDB2::isError($res0)) {\n\t\t $log->setError($sql2, $res0->userinfo);\n\t\t exit();\n\t\t}\n\t\t$row = $res0->fetchRow();\n\t\t$tz= $row[\"_cliente_tz\"];\n\t\t\n\t\tdate_default_timezone_set('UTC');\n\t\t\n\t\t// RECORRE LOS OBJETIVOS\n\t\t$check_color='False';\n\t\tforeach ($conf_objetivos as $conf_objetivo) {\n\n\t\t\t//SEGUIRÁ SOLO SI EL OBJETIVO SE ENCUENTRA BIEN FORMADO\n\t\t\t$T->setVar('__objetivo_id', $conf_objetivo->getAttribute('objetivo_id'));\n\t\t\t$T->setVar('__objetivo_nombre', $conf_objetivo->getAttribute('nombre'));\n\t\t\t$T->setVar('__objetivo_servicio', $conf_objetivo->getAttribute('servicio'));\n\t\t\t$T->setVar('__objetivo_color', (($cnt_objetivos % 2) == 0)?'e9e9e9':'d4d4d4');\n\t\t\t$num_monitor = 0;\n\t\t\t$marcados =array();\n\t\t\t\n\t\t\t /* OBTENER LOS DATOS Y PARSEARLO */\n\t\t\t$sql2 = \"SELECT RANK() OVER (PARTITION BY \".pg_escape_string($current_usuario_id).\" ORDER BY termino DESC),* FROM public._periodos_marcados_v2(\".\n\t\t\t \t\t\t pg_escape_string($current_usuario_id).\",\".\n\t\t\t \t\t\t pg_escape_string($conf_objetivo->getAttribute('objetivo_id')).\",\".\n\t\t\t \t\t\t \"(now() - '1 DAY'::INTERVAL) AT TIME ZONE '\".$tz.\"',\".\n\t\t\t \t\t\t //pg_escape_string($this->timestamp->getInicioPeriodo()).\"',\".\n\t\t\t \t\t\t \"now() AT TIME ZONE '\".$tz.\"')AS foo ORDER BY termino DESC \";\n// print($sql2);\n\t\t\t $res2 =& $mdb2->query($sql2);\n\t\t\t if (MDB2::isError($res2)) {\n\t\t\t $log->setError($sql2, $res2->userinfo);\n\t\t\t exit();\n\t\t\t }\n\t\t\t \t\t\n\t\t\t while($row2 = $res2->fetchRow()) {\n\t\t\t $marcados[$row2[\"rank\"]]['marcado']= $row2[\"marcado\"];\n\t\t\t $marcados[$row2[\"rank\"]]['inicio']= substr($row2[\"inicio\"],0,-3);\n\t\t\t $marcados[$row2[\"rank\"]]['termino']= substr($row2[\"termino\"],0,-3);\n\t\t\t }\n\t\t\t date_default_timezone_set($tz);\n\t\t\t $now = new DateTime('now');\n// \t\t\t echo '<pre>';\tif($marcados[2]['marcado']==\"t\")var_dump($marcados);\n\t\t\t\n\t\t\tif ($this->extra[\"imprimir\"]) {\n\t\t\t\t$total_nodos = $xpath->query('//detalle[@objetivo_id='.$conf_objetivo->getAttribute('objetivo_id').']/detalles/detalle')->length;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$total_nodos = $conf_nodos->length;\n\t\t\t}\n\n\t\t\t$T->setVar('lista_monitores_estado', '');\n\t\t\t$T->setVar('estado_blanco', '');\n\t\t\t$T->setVar('bloque_salto_print', '');\n\t\t\t\n\t\t\t\n\t\t\tif($marcados[1]['marcado']==\"t\" ){\n\t\t\t $inicio = new DateTime($marcados[1]['inicio']);\n\t\t\t $intervalo = $now->diff($inicio);\n\t\t\t \n\t\t\t if($intervalo->format('%a')>0){\n\t\t\t $duracion= $intervalo->format('%a days %H:%I:%S').\"\\n\";\n\t\t\t }else{\n\t\t\t $duracion= $intervalo->format('%H:%I:%S').\"\\n\";\n\t\t\t }\n\t\t\t \n\t\t\t foreach ($conf_nodos as $conf_nodo) {\n\t\t\t $T->setVar('__monitor_id', $conf_nodo->getAttribute('nodo_id'));\n\t\t\t $T->setVar('__monitor_orden', $num_monitor);\n\t\t\t $T->setVar('__monitor_nombre', $conf_nodo->getAttribute('titulo'));\n\t\t\t $T->setVar('__monitor_ubicacion', $conf_nodo->getAttribute('subtitulo'));\n\t\t\t $T->setVar('__tooltip_id', $tooltip_id);\n\t\t\t \n\t\t\t $tag_dato = $xpath->query('//detalle[@objetivo_id='.$conf_objetivo->getAttribute('objetivo_id').']/detalles/detalle[@nodo_id='.$conf_nodo->getAttribute('nodo_id').']/datos/dato')->item(0);\n\t\t\t \n\t\t\t if ($tag_dato == null and $this->extra[\"imprimir\"]) {\n\t\t\t continue;\n\t\t\t }\n\t\t\t elseif ($tag_dato != null) {\n\t\t\t \n \t\t\t $conf_semaforo = $xpath->query('//semaforos/semaforo[@semaforo_id=6]')->item(0);\n \t\t\t \n \t\t\t $T->setVar('__evento_nombre', $conf_semaforo->getAttribute('nombre'));\n \t\t\t $T->setVar('__evento_descripcion', $conf_semaforo->getAttribute('descripcion'));\n \t\t\t $T->setVar('__evento_icono', REP_PATH_SPRITE_SEMAFORO.substr($conf_semaforo->getAttribute('icono'), 0, -4));\n \t\t\t $T->setVar('__evento_duracion', Utiles::formatDuracion($duracion, 0));\n \t\t\t $T->parse('tiene_tooltip', 'TIENE_TOOLTIP', false);\n\t\t\t }\n\t\t\t else {\n\t\t\t $T->setVar('__evento_nombre', '');\n\t\t\t $T->setVar('__evento_icono', 'sprite sprite-vacio');\n\t\t\t $T->setVar('__evento_duracion', '');\n\t\t\t $T->setVar('tiene_tooltip', '');\n\t\t\t }\n\t\t\t \n\t\t\t $T->parse('lista_monitores_estado', 'LISTA_MONITORES_ESTADO', true);\n\t\t\t if ($cnt_objetivos == 0) {\n\t\t\t $T->parse('lista_monitores', 'LISTA_MONITORES', true);\n\t\t\t $T->parse('lista_monitores_ubicacion', 'LISTA_MONITORES_UBICACION', true);\n\t\t\t }\n\t\t\t $tooltip_id++;\n\t\t\t $num_monitor++;\n\t\t\t \n\t\t\t if ($num_monitor % 6 == 0 or $num_monitor == $total_nodos) {\n\t\t\t $T->parse('bloque_salto_print', 'BLOQUE_SALTO_PRINT', true);\n\t\t\t $T->setVar('lista_monitores_estado', '');\n\t\t\t }\n\t\t\t \n\t\t\t }\n\t\t\t \n\t\t\t}else{\n\t\t\t \t \n \t\t\tforeach ($conf_nodos as $conf_nodo) {\n \t\t\t\t$T->setVar('__monitor_id', $conf_nodo->getAttribute('nodo_id'));\n \t\t\t\t$T->setVar('__monitor_orden', $num_monitor);\n \t\t\t\t$T->setVar('__monitor_nombre', $conf_nodo->getAttribute('titulo'));\n \t\t\t\t$T->setVar('__monitor_ubicacion', $conf_nodo->getAttribute('subtitulo'));\n \t\t\t\t$T->setVar('__tooltip_id', $tooltip_id);\n \n \t\t\t\t$tag_dato = $xpath->query('//detalle[@objetivo_id='.$conf_objetivo->getAttribute('objetivo_id').']/detalles/detalle[@nodo_id='.$conf_nodo->getAttribute('nodo_id').']/datos/dato')->item(0);\n \n \t\t\t\tif ($tag_dato == null and $this->extra[\"imprimir\"]) {\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\telseif ($tag_dato != null) {\n \t\t\t\t\t$conf_semaforo = $xpath->query('//semaforos/semaforo[@semaforo_id='.$tag_dato->getAttribute('semaforo_id').']')->item(0);\n \n \t\t\t\t\t$duracion =$tag_dato->getAttribute('duracion');\n \t\t\t\t\t\n \t\t\t\t\tif($marcados[2]['marcado']==\"t\" && $tag_dato->getAttribute('semaforo_id')!=4)\n \t\t\t\t\t{\n \t\t\t\t\t $inicio= new DateTime($marcados[2]['inicio']);\n \t\t\t\t\t $termino= new DateTime($marcados[2]['termino']);\n \t\t\t\t\t $diferencia = $termino->diff($inicio);\n \t\t\t\t\t if($diferencia->format('%a')>0){\n \t\t\t\t\t $duracion_marcado= $diferencia->format('%a days + %H hours + %I minutes + %S seconds').\"\\n\";\n \t\t\t\t\t}else{\n \t\t\t\t\t $duracion_marcado= $diferencia->format('%H hours + %I minutes + %S seconds').\"\\n\";\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t$fecha_nueva = new DateTimeImmutable($tag_dato->getAttribute('fecha'));\n \t\t\t\t\t$datetime=$fecha_nueva->modify('+ '.$duracion_marcado);\n \t\t\t\t\t$intervalo = $now->diff($datetime);\n \t\t\t\t\tif($intervalo->format('%a')>0){\n \t\t\t\t\t $duracion= $intervalo->format('%a days %H:%I:%S').\"\\n\";\n \t\t\t\t\t}else{\n \t\t\t\t\t $duracion= $intervalo->format('%H:%I:%S').\"\\n\";\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t$T->setVar('__evento_nombre', $conf_semaforo->getAttribute('nombre'));\n \t\t\t\t\t$T->setVar('__evento_descripcion', $conf_semaforo->getAttribute('descripcion'));\n \t\t\t\t\t$T->setVar('__evento_icono', REP_PATH_SPRITE_SEMAFORO.substr($conf_semaforo->getAttribute('icono'), 0, -4));\n \t\t\t\t\tif($conf_semaforo->getAttribute('icono')=='rojo.png'){\n \t\t\t\t\t\t$check_color='True';\n \t\t\t\t\t}\n \t\t\t\t\t$T->setVar('__evento_duracion', Utiles::formatDuracion($duracion, 0));\n \t\t\t\t\t$T->parse('tiene_tooltip', 'TIENE_TOOLTIP', false);\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\t$T->setVar('__evento_nombre', '');\n \t\t\t\t\t$T->setVar('__evento_icono', 'sprite sprite-vacio');\n \t\t\t\t\t$T->setVar('__evento_duracion', '');\n \t\t\t\t\t$T->setVar('tiene_tooltip', '');\n \t\t\t\t}\n \t\t\t\t$T->parse('lista_monitores_estado', 'LISTA_MONITORES_ESTADO', true);\n \n \t\t\t\tif ($cnt_objetivos == 0) {\n \t\t\t\t\t$T->parse('lista_monitores', 'LISTA_MONITORES', true);\n \t\t\t\t\t$T->parse('lista_monitores_ubicacion', 'LISTA_MONITORES_UBICACION', true);\n \t\t\t\t}\n \t\t\t\t$tooltip_id++;\n \t\t\t\t$num_monitor++;\n \n \t\t\t\tif ($num_monitor % 6 == 0 or $num_monitor == $total_nodos) {\n \t\t\t\t\t$T->parse('bloque_salto_print', 'BLOQUE_SALTO_PRINT', true);\n \t\t\t\t\t$T->setVar('lista_monitores_estado', '');\n \t\t\t\t}\n \t\t\t}\n }\n\t\t\t$T->setVar('estado_blanco', '');\n\t\t\tif($num_monitor == 0 && $this->extra[\"imprimir\"]){\n\t\t\t\t$T->parse('estado_blanco', 'ESTADO_BLANCO', false);\n\t\t\t\t$T->parse('bloque_salto_print', 'BLOQUE_SALTO_PRINT', true);\n\t\t\t}\n\n\t\t\t$T->parse('lista_objetivos', 'LISTA_OBJETIVOS', true);\n\t\t\t$T->parse('lista_objetivos0', 'LISTA_OBJETIVOS0', true);\n\t\t\t$cnt_objetivos++;\n\t\t}\n\t\t/* sirve para sonido por color*/\n\t\t$T->setVar('__session', $_SESSION[\"alerta\"]);\n\t\t$T->setVar('__checkcolor', $check_color);\n\t\tif($sonido =='t'){\n\t\t\tif($_SESSION[\"alerta\"]==\"\" AND $check_color=='True'){\n\t\t\t\t$T->setVar('__check', $check_color);\n\t\t\t\t$_SESSION[\"alerta\"] = True;\n\t\t\t}\n\t\t\tif($_SESSION[\"alerta\"]==True AND $check_color=='False'){\n\t\t\t\t$_SESSION[\"alerta\"] = False;\n\t\t\t}\n\n\t\t}\n\t\t$T->setVar('lista_monitores_blanco', '');\n\t\tif (($num_monitor % 6) != 0 and !$this->extra[\"popup\"]) {\n\t\t\tfor ($i = ($num_monitor % 6); $i <= 6; $i++) {\n\t\t\t\t$T->parse('lista_monitores_blanco', 'LISTA_MONITORES_BLANCO', true);\n\t\t\t}\n\t\t}\n\n\t\t$this->tiempo_expiracion = (strtotime($xpath->query(\"//fecha_expiracion\")->item(0)->nodeValue) - strtotime($xpath->query(\"//fecha\")->item(0)->nodeValue));\n\t\treturn $T->parse('out', 'tpl_tabla');\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->bo04_codmov = ($this->bo04_codmov == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_codmov\"]:$this->bo04_codmov);\n $this->bo04_codbo = ($this->bo04_codbo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_codbo\"]:$this->bo04_codbo);\n if($this->bo04_datamov == \"\"){\n $this->bo04_datamov_dia = ($this->bo04_datamov_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_datamov_dia\"]:$this->bo04_datamov_dia);\n $this->bo04_datamov_mes = ($this->bo04_datamov_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_datamov_mes\"]:$this->bo04_datamov_mes);\n $this->bo04_datamov_ano = ($this->bo04_datamov_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_datamov_ano\"]:$this->bo04_datamov_ano);\n if($this->bo04_datamov_dia != \"\"){\n $this->bo04_datamov = $this->bo04_datamov_ano.\"-\".$this->bo04_datamov_mes.\"-\".$this->bo04_datamov_dia;\n }\n }\n $this->bo04_coddepto_ori = ($this->bo04_coddepto_ori == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_coddepto_ori\"]:$this->bo04_coddepto_ori);\n $this->bo04_coddepto_dest = ($this->bo04_coddepto_dest == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_coddepto_dest\"]:$this->bo04_coddepto_dest);\n $this->bo04_entrada = ($this->bo04_entrada == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_entrada\"]:$this->bo04_entrada);\n $this->bo04_saida = ($this->bo04_saida == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_saida\"]:$this->bo04_saida);\n }else{\n $this->bo04_codmov = ($this->bo04_codmov == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_codmov\"]:$this->bo04_codmov);\n }\n }", "public static function formularioMarcas()\n {\n //Variable con los permisos del usuario\n $dato_tipo = Sentencias::Seleccionar(\"tipos_usuarios\", \"id\", array($_SESSION[\"tipo\"]), 0, null);\n\n //Variables de los campos de la tabla marcas\n $marca = null;\n\n \n\n //Se empiezan a validar los datos del formulario de marcas\n if(isset($_POST[\"formulario\"]))\n {\n //Se valida que no se dejen espacios vacios\n if($_POST[\"marca\"] != \"\")\n {\n //Se valida que la marca cumpla con los criterios\n if(Validaciones::alfanumerico($_POST[\"marca\"]) && Validaciones::longitud($_POST[\"marca\"], 20))\n {\n //Se divide en si es ingresar un registro o modificar uno existente\n //Aqui es donde se modifica el registro\n if(!empty($_GET[\"id_marca\"]))\n {\n //Se valida si el parametro es un numero\n if(is_numeric($_GET[\"id_marca\"]))\n {\n //Se divide entre solo actualizar marca, imagen y ambas a la vez\n //Aqui se actualiza el nombre y la imagen\n if(is_uploaded_file($_FILES[\"archivo\"][\"tmp_name\"]))\n {\n $img = $_POST[\"marca\"].time().\".jpg\";\n\n $campos_valores = array\n (\n 'marca' => $_POST[\"marca\"],\n 'imagen' => $img\n );\n\n $condiciones_parametros = array\n (\n 'id' => $_GET[\"id_marca\"]\n );\n\n Sentencias::Actualizar(\"marcas\", $campos_valores, $condiciones_parametros, 1, \"marcas.php\");\n move_uploaded_file($_FILES['archivo']['tmp_name'], \"../img/marcas/$img\");\n }\n\n //Aqui solo se actualizara el nombre\n else\n {\n $campos_valores = array\n (\n 'marca' => $_POST[\"marca\"]\n );\n\n $condiciones_parametros = array\n (\n 'id' => $_GET[\"id_marca\"]\n );\n\n Sentencias::Actualizar(\"marcas\", $campos_valores, $condiciones_parametros, 1, \"marcas.php\"); \n }\n }\n\n else\n {\n header(\"Location: marcas.php\");\n }\n }\n\n //Aqui es donde se agrega un nuevo registro\n else\n {\n //Se valida si ya se subio la imagen\n if(is_uploaded_file($_FILES[\"archivo\"][\"tmp_name\"]))\n {\n //Se validan los valores de la iamgen\n if(Validaciones::imagen($_FILES[\"archivo\"]))\n {\n $img = $_POST[\"marca\"].time().\".jpg\";\n $campos_valores = array\n (\n 'marca' => $_POST[\"marca\"],\n 'imagen' => $img\n );\n\n Sentencias::Insertar(\"marcas\", $campos_valores, 1, \"marcas.php\");\n move_uploaded_file($_FILES['archivo']['tmp_name'], \"../img/marcas/$img\");\n }\n\n else\n {\n Ventanas::Mensaje(2, \"La imagen no es valida\", null);\n }\n }\n\n else\n {\n Ventanas::Mensaje(2, \"Debe ingresar una imagen\", null);\n }\n }\n } \n\n else\n {\n Ventanas::Mensaje(2, \"El nombre de la marca no es valido\", null);\n }\n }\n\n else\n {\n Ventanas::Mensaje(2, \"No deje campos vacios\", null);\n }\n }\n\n //Renderiza el formulario de marcas\n echo\n (\"\n <form method='post' enctype='multipart/form-data' id='registro'>\n <div class='row'>\n <div class='container'>\n <div class='col s12 center-align'>\n <h4>Aqui puedes ingresar una nueva marca</h4>\n </div>\n <div class='input-field col s10 offset-s1'>\n <input id='marca' value='$marca' name='marca' type='text' class='validate' autocomplete='off'>\n <label for='marca' class='blue-text text-darken-4'>Nombre de la marca</label>\n </div>\n <div class='file-field input-field col s10 offset-s1'>\n <div class='btn blue darken-4'>\n <span>Imagen</span>\n <input type='file' name='archivo'>\n </div>\n <div class='file-path-wrapper'>\n <input class='file-path validate' type='text' placeholder='Seleccione una imagen para el usuario'>\n </div>\n </div>\n \");\n\n //Se renderiza el boton dependiendo de si es para crear o modificar\n if(empty($_GET[\"id_marca\"]))\n {\n //Se valida si tiene permisos para ingresar\n if($dato_tipo[\"marcas\"] == 2 || $dato_tipo[\"marcas\"] == 5 || $dato_tipo[\"marcas\"] == 6 || $dato_tipo[\"marcas\"] == 9)\n {\n echo\n (\"\n <div class='col s3 offset-s1'>\n <button name='formulario' class='waves-effect waves-light btn blue darken-4'>Ingresar marca</button>\n </div> \n \");\n } \n }\n\n else\n {\n //Se valida si tiene permisos para modificar\n if($dato_tipo[\"marcas\"] == 3 || $dato_tipo[\"marcas\"] == 5 || $dato_tipo[\"marcas\"] > 6)\n {\n echo\n (\"\n <div class='col s3 offset-s1'>\n <button name='formulario' class='waves-effect waves-light btn blue darken-4'>Actualizar marca</button>\n </div> \n \");\n } \n }\n\n echo\n (\" \n <div class='col s3'>\n <a href='marcas.php' class='waves-effect waves-light btn blue darken-4'>Limpiar campos</a>\n </div> \n </div>\n </div> \n </form>\n \");\n }", "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 }", "protected function encerrarDadosMatricula(Matricula $oMatricula, DiarioClasse $oDiario, $sResultadoFinal) {\n\n $oErroMensagem = new stdClass();\n $oErroMensagem->etapa = $oMatricula->getEtapaDeOrigem()->getNome();\n $oErroMensagem->aluno = $oMatricula->getAluno()->getCodigoAluno() . \" - \" .$oMatricula->getAluno()->getNome();\n\n $iEscola = db_getsession(\"DB_coddepto\");\n $oDiario->adicionarDisciplinasReprovadasComoProgressaoParcial();\n $sSituacao = '';\n $sSituacaoCursoAluno = \"APROVADO\";\n if ($sResultadoFinal == \"R\") {\n $sSituacaoCursoAluno = \"REPETENTE\";\n } else if ($sResultadoFinal == \"P\") {\n $sSituacaoCursoAluno = \"APROVADO PARCIAL\";\n }\n\n\n if ($oDiario->aprovadoComProgressaoParcial()) {\n\n $sResultadoFinal = \"A\";\n $sSituacaoCursoAluno = \"APROVADO\";\n $sSituacao = \"COM PROGRESSÃO PARCIAL/DEPENDÊNCIA\";\n }\n\n $iCodigoAluno = $oMatricula->getAluno()->getCodigoAluno();\n $this->atualizarConclusaoDaMatricula($oMatricula, 'S');\n\n $oDaoBaseMps = db_utils::getDao(\"basemps\");\n $oDaoMatriculaMov = db_utils::getDao(\"matriculamov\");\n $oDaoMatriculaMov->ed229_i_matricula = $oMatricula->getCodigo();\n $oDaoMatriculaMov->ed229_i_usuario = db_getsession(\"DB_id_usuario\");\n $oDaoMatriculaMov->ed229_c_procedimento = \"ENCERRAR AVALIAÇÕES\";\n $sDescricao = \"MATRÍCULA ENCERRADA EM \".date(\"d/m/Y\",db_getsession(\"DB_datausu\"));\n $sDescricao .= \" COM SITUAÇÃO DE {$sSituacaoCursoAluno} {$sSituacao}\";\n $oDaoMatriculaMov->ed229_t_descr = $sDescricao;\n $oDaoMatriculaMov->ed229_d_dataevento = date(\"Y-m-d\",db_getsession(\"DB_datausu\"));\n $oDaoMatriculaMov->ed229_c_horaevento = date(\"H:i\");\n $oDaoMatriculaMov->ed229_d_data = date(\"Y-m-d\",db_getsession(\"DB_datausu\"));\n $oDaoMatriculaMov->incluir(null);\n if ($oDaoMatriculaMov->erro_status == 0) {\n\n throw new BusinessException(\"Erro ao incluir movimentação da matrícula do aluno.\");\n }\n\n $oProximaEtapa = EtapaRepository::getProximaEtapa($oMatricula->getTurma(), $oMatricula->getEtapaDeOrigem());\n\n /**\n * Caso a ultima etapa seja vazia, devemos utilizar como base a ultima etapa da base curricular.\n */\n if ($oProximaEtapa == null) {\n //$oProximaEtapa = $oMatricula->getTurma()->getBaseCurricular()->getEtapaFinal();\n }\n if ($oProximaEtapa == null || $sResultadoFinal == \"R\") {\n $oProximaEtapa = $oMatricula->getEtapaDeOrigem();\n }\n\n $oDaoAlunoPossib = db_utils::getDao(\"alunopossib\");\n $sCamposAlunoPossib = \" alunopossib.*, alunocurso.*\";\n $sWhereAlunoPossib = \" ed56_i_escola = {$iEscola} AND ed56_i_aluno = {$iCodigoAluno}\";\n $sSqlAlunoPossib = $oDaoAlunoPossib->sql_query(\"\", $sCamposAlunoPossib, \"\", $sWhereAlunoPossib);\n $rsResultPossib = $oDaoAlunoPossib->sql_record($sSqlAlunoPossib);\n $iLinhasAlunoPoss = $oDaoAlunoPossib->numrows;\n $iBaseAnterior = \"\";\n $iCodigoBase = \"\";\n $oDadosAlunoCurso = null;\n\n if ($iLinhasAlunoPoss > 0) {\n\n $oDadosAlunoCurso = db_utils::fieldsMemory($rsResultPossib, 0);\n $iCodigoBase = $oMatricula->getTurma()->getBaseCurricular()->getCodigoSequencial();\n $iBaseAnterior = $iCodigoBase;\n $sWhereProximaSerie = \" ed34_i_base = {$oMatricula->getTurma()->getBaseCurricular()->getCodigoSequencial()} \";\n $sWhereProximaSerie .= \" AND ed34_i_serie = {$oProximaEtapa->getCodigo()}\";\n $sSqlProximaSerie = $oDaoBaseMps->sql_query(\"\", \"ed34_i_codigo\", \"\", $sWhereProximaSerie);\n\n $rsProximaSerie = $oDaoBaseMps->sql_record($sSqlProximaSerie);\n\n if ($oDaoBaseMps->numrows == 0) {\n\n $oProximaBase = $oMatricula->getTurma()->getBaseCurricular()->getBaseDeContinuacao();\n\n if ($oProximaBase != null) {\n $iCodigoBase = $oProximaBase->getCodigoSequencial();\n }\n }\n\n /**\n * caso a Proxima etapa seja a mesma, nao existe mais turmas para o encerramemtno\n */\n if ($oProximaEtapa->getCodigo() == $oMatricula->getEtapaDeOrigem()->getCodigo() &&\n $oMatricula->getTurma()->getBaseCurricular()->encerraCurso() && $sResultadoFinal != \"R\") {\n $sSituacaoCursoAluno = \"ENCERRADO\";\n }\n }\n\n /**\n * So devemos permitir a rematricula para proxima etapa para se o aluno for aprovado\n */\n $iCodigoEtapa = $oMatricula->getEtapaDeOrigem()->getCodigo();\n $iProximaBase = $iBaseAnterior;\n\n if ($sResultadoFinal == \"A\") {\n\n $iProximaBase = $iCodigoBase;\n $iCodigoEtapa = $oProximaEtapa->getCodigo();\n }\n\n if ($sResultadoFinal == 'P') {\n $sResultadoFinal = 'A';\n }\n $sSqlAlunoPossib = \" UPDATE alunopossib SET \";\n $sSqlAlunoPossib .= \" ed79_i_serie = {$iCodigoEtapa}, \";\n $sSqlAlunoPossib .= \" ed79_i_turno = {$oMatricula->getTurma()->getTurno()->getCodigoTurno()}, \";\n $sSqlAlunoPossib .= \" ed79_i_turmaant = {$oMatricula->getTurma()->getCodigo()}, \";\n $sSqlAlunoPossib .= \" ed79_c_resulant = '{$sResultadoFinal}', \";\n $sSqlAlunoPossib .= \" ed79_c_situacao = '{$sResultadoFinal}' \";\n $sSqlAlunoPossib .= \" WHERE ed79_i_alunocurso = {$oDadosAlunoCurso->ed56_i_codigo} \";\n $rsResultAlunoPossib = db_query($sSqlAlunoPossib);\n\n if (!$rsResultAlunoPossib) {\n\n $sErroMensagem = \"Não foi possível mover o aluno {$oMatricula->getAluno()->getNome()} \";\n $sErroMensagem .= \"para próxima etapa. \\n Motivo:\\n\";\n $sErroMensagem .= pg_last_error();\n throw new BusinessException($sErroMensagem);\n }\n\n $sSqlAlunoCurso = \" UPDATE alunocurso SET \";\n $sSqlAlunoCurso .= \" ed56_c_situacao = '{$sSituacaoCursoAluno}', \";\n $sSqlAlunoCurso .= \" ed56_i_escola = {$iEscola}, \";\n $sSqlAlunoCurso .= \" ed56_i_base = {$iProximaBase}, \";\n $sSqlAlunoCurso .= \" ed56_i_calendario = {$oDadosAlunoCurso->ed56_i_calendario}, \";\n $sSqlAlunoCurso .= \" ed56_i_baseant = {$iBaseAnterior}, \";\n $sSqlAlunoCurso .= \" ed56_i_calendarioant = null, \";\n $sSqlAlunoCurso .= \" ed56_c_situacaoant = '{$oMatricula->getSituacao()}' \";\n $sSqlAlunoCurso .= \" WHERE ed56_i_codigo = {$oDadosAlunoCurso->ed56_i_codigo} \";\n $rsAlunoCurso = db_query($sSqlAlunoCurso);\n\n if (!$rsAlunoCurso) {\n\n $sErroMensagem = \"Não foi possível encerrar o aluno {$oMatricula->getAluno()->getNome()} \";\n $sErroMensagem .= \"e move-lo para próxima base. \\n Motivo:\\n\";\n $sErroMensagem .= pg_last_error();\n\n throw new BusinessException($sErroMensagem);\n }\n }", "public function RegistrarMesas()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"codsala\"]) or empty($_POST[\"nombremesa\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\t$sql = \" select codsala, nombremesa from mesas where codsala = ? and nombremesa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_POST[\"codsala\"], $_POST[\"nombremesa\"]) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\t\t$query = \" insert into mesas values (null, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $codsala);\n\t\t$stmt->bindParam(2, $nombremesa);\n\t\t$stmt->bindParam(3, $mesacreada);\n\t\t$stmt->bindParam(4, $statusmesa);\n\n\t\t$codsala = strip_tags($_POST[\"codsala\"]);\n\t\t$nombremesa = strip_tags($_POST[\"nombremesa\"]);\n\t\t$mesacreada = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t$statusmesa = strip_tags(\"0\");\n\t\t$stmt->execute();\n\n\n\t\techo \"<div class='alert alert-success'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> LA MESA EN SALA DEL RESTAURANT FUE REGISTRADA EXITOSAMENTE\";\n\t\techo \"</div>\";\t\t\n\t\texit;\n\t}\n\telse\n\t{\n\t\techo \"2\";\n\t\texit;\n\t}\n}", "private function butacas_ocupadas($ProximaObraNombre,$ProximaObraMes,$ProximaObraAnyo){\n\t\t//las butacas reservadas de las sesiones en el mes analizado\n\t\t$reservas=Reserva::whereHas('sesion', function ($query) use ($ProximaObraNombre,$ProximaObraMes,$ProximaObraAnyo) {\n \t\t$query->where('nombre_obra', $ProximaObraNombre);\n \t\t$query->where(\"inicio\",\">=\",$ProximaObraAnyo.\"-\".$ProximaObraMes.\"-01\")->where(\"inicio\",\"<=\",$ProximaObraAnyo.\"-\".$ProximaObraMes.\"-31\");\n\t\t})->get();\n\t\t//las butacas bloqueadas aun no reservadas en el mes analizado\n\t\t$butacas=Butaca::whereHas('sesion', function ($query) use ($ProximaObraNombre,$ProximaObraMes,$ProximaObraAnyo) {\n \t\t$query->where('nombre_obra', $ProximaObraNombre);\n \t\t$query->where(\"inicio\",\">=\",$ProximaObraAnyo.\"-\".$ProximaObraMes.\"-01\")->where(\"inicio\",\"<=\",$ProximaObraAnyo.\"-\".$ProximaObraMes.\"-31\");\n\t\t})->get();\n\n\t\t$data[\"butacas_ocupadas_dia\"]=[];\n\t\tforeach ($reservas as $reserva) {\n\t\t\t$dia=Carbon::parse($reserva->sesion->inicio)->format('d');\n\t\t\t$dia=(int)$dia;\n\n\t\t\tif(isset($data[\"butacas_ocupadas_dia\"][$dia])){\n\t\t\t\t$data[\"butacas_ocupadas_dia\"][$dia]+=$reserva->num_butacas;\n\t\t\t}else{\n\t\t\t\t$data[\"butacas_ocupadas_dia\"][$dia]=$reserva->num_butacas;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tforeach ($butacas as $butaca) {\n\t\t\t$dia=Carbon::parse($butaca->sesion->inicio)->format('d');\n\t\t\t$dia=(int)$dia;\n\n\t\t\tif(isset($data[\"butacas_ocupadas_dia\"][$dia])){\n\t\t\t\t$data[\"butacas_ocupadas_dia\"][$dia]++;\n\t\t\t}else{\n\t\t\t\t$data[\"butacas_ocupadas_dia\"][$dia]=1;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn $data[\"butacas_ocupadas_dia\"];\n }", "function proceso4($testing,$desaprobar){\n //include($this->POROTO->ModelPath . '/alumnocarrera.php');\n //$claseAlumnoCarrera = new AlumnoCarreraModel($this->POROTO);\n include($this->POROTO->ModelPath . '/alumnomateria.php');\n include($this->POROTO->ControllerPath . '/correlativas.php');\n \n\t$db =& $this->POROTO->DB; \n\t$ses =& $this->POROTO->Session;\n\t$lib =& $this->POROTO->Libraries['siteLibrary'];\n\t\n $db->dbConnect(\"procesos/proceso4/\");\n\t$db->begintrans();\t\n $bOk=true;\n $cambios=array();\n \n\tif(!$ses->tienePermiso('','Proceso 4 - Proceso Actualizar/Desaprobar Condicionales')){\n $ses->setMessage(\"Acceso denegado. Contactese con el administrador.\", SessionMessageType::TransactionError);\n header(\"Location: /verprocesos\", TRUE, 302);\n exit();\n\t}\n\t \n if($testing==0){\n $cambios[]=\"EJECUCION Desaprobar:\".$desaprobar;\n }\n else\n {\n $cambios[]=\"SIMULACION Desaprobar:\".$desaprobar;\n }\n $cambios[]=\" \";\n \n $claseAlumnoMateria = new AlumnoMateriaModel($this->POROTO);\n $result=$claseAlumnoMateria->getAlumnoMateriaCondicionales();\n $claseCorrelativas = new correlativas($this->POROTO);\n \n $cambios[]=\"Listado de alumnos actualizar condicionalidades.\";\n \n foreach ($result as $alumnomateria) {\n //Obtengo las correlativas y si las cumple o no.\n $resultados=$claseCorrelativas->getCorrelativasAlumno($alumnomateria[\"idcarrera\"], $alumnomateria[\"idmateria\"], $alumnomateria[\"idcomision\"], $alumnomateria[\"idpersona\"],$alumnomateria[\"idalumnocarrera\"]);\n $valida=true;\n foreach($resultados as $regla){\n if ($regla[\"idregla\"]!=6 && $regla[\"estado\"]==false) $valida=false;\n }\n\n if($valida){//Si cumple con las correlativas, quito la condicionalidad\n if($testing==0){\n //Actualizar registro\n $res=$claseAlumnoMateria->quitarCondicionalidad($alumnomateria[\"idalumnomateria\"]); \n }\n $cambios[]=\"Alumno: \".$alumnomateria[\"idalumnomateria\"].\" \".$alumnomateria[\"alumno\"].\" \".$alumnomateria[\"documento\"].\" Carrera:\".$alumnomateria[\"idalumnocarrera\"].\" \".$alumnomateria[\"carrera\"].\" Materia:\".$alumnomateria[\"nombre\"].\" Quitar Condicionalidad\"; \n \n }else{\n //No quito la condicionalidad porque sigue condicional\n $cambios[]=\"Alumno: \".$alumnomateria[\"idalumnomateria\"].\" \".$alumnomateria[\"alumno\"].\" \".$alumnomateria[\"documento\"].\" Carrera:\".$alumnomateria[\"idalumnocarrera\"].\" \".$alumnomateria[\"carrera\"].\" Materia:\".$alumnomateria[\"nombre\"].\" Continua Cond.\";\n }\n }\n \n if($desaprobar==1 && $testing==0){\n $result=$claseAlumnoMateria->getAlumnoMateriaCondicionales(); \n $cambios[]=\"---\";\n $cambios[]=\"Listado de alumnos desaprobar condicionales.\";\n foreach ($result as $alumnomateria) {\n $claseAlumnoMateria->desaprobarCondicionales($alumnomateria[\"idalumnocarrera\"],$alumnomateria[\"idpersona\"],$alumnomateria[\"idalumnomateria\"],$this->POROTO->Config['estado_alumnomateria_desaprobada'],$ses->getUsuario(),0);\n $res=$claseAlumnoMateria->quitarCondicionalidad($alumnomateria[\"idalumnomateria\"]); \n $cambios[]=\"Alumno: \".$alumnomateria[\"idalumnomateria\"].\" \".$alumnomateria[\"alumno\"].\" \".$alumnomateria[\"documento\"].\" Carrera:\".$alumnomateria[\"idalumnocarrera\"].\" \".$alumnomateria[\"carrera\"].\" Materia:\".$alumnomateria[\"nombre\"].\" DESAPROBADA.\";\n }\n }\n\n \n\tif ($bOk === false) {\n\t\t$db->rollback();\n\t\t$ses->setMessage(\"Se produjo un error al ejecutar el proceso.<br>\", SessionMessageType::TransactionError);\n\t}\n\t else \n\t{\n if(count($cambios)>0){\n $log=$this->POROTO->TempPath.\"proceso4-log-\".date('Ymd').\"-\".date('Hi').\".txt\";\n $ruta=\"proceso4-log-\".date('Ymd').\"-\".date('Hi').\".txt\";\n for($i=0;$i<count($cambios);$i++){\n file_put_contents($log, $cambios[$i].\"\\n\", FILE_APPEND);\n }\n $ses->setMessage(\"Proceso ejecutado con éxito. <br> <a href='/procesos/downloadFile?file=\".$ruta.\"' >Ver log de acción</a><br>\", SessionMessageType::Success);\n }else{\n $ses->setMessage(\"Proceso ejecutado con éxito. <br> \", SessionMessageType::Success);\n }\n\t\t$db->commit();\n\t}\n\t\n\t$db->dbDisconnect();\n\theader(\"Location: /verprocesos\", TRUE, 302);\n }", "function listarMaquinaria(){\n\t\t$this->procedimiento='snx.ft_maquinaria_sel';\n\t\t$this->transaccion='SNX_MAQ_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_maquinaria','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('potencia','numeric');\n\t\t$this->captura('peso','numeric');\t\t\n\t\t$this->captura('maquinaria','varchar');\n\t\t$this->captura('usuario_ai','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_ai','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('valor','numeric');\n\t\t$this->captura('valormat','numeric');\n\t\t$this->captura('id_factorindexacion','int4');\n\t\t$this->captura('desc_factorindexacion','varchar');\n\t\t$this->captura('id_tipopreciomaquinaria','int4');\n\t\t$this->captura('tipopreciomaquinaria','varchar');\n\t\t$this->captura('id_ambitoprecio','int4');\n\t\t$this->captura('ambitoprecio','varchar');\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 ajustecambiario($periodo,$ejer,$moneda){\n\t\t\t// le kite el periodo and p.idperiodo=\".$periodo.\"\n\t\t\t$sql=$this->query(\"select m.IdPoliza,m.Cuenta,sum(m.Importe) importe,m.TipoMovto,c.description,p.relacionExt,p.concepto,c.manual_code,p.idperiodo\n\t\t\tfrom cont_movimientos m,cont_polizas p,cont_accounts c,cont_config conf\n\t\t\twhere m.cuenta=c.account_id and c.currency_id=\".$moneda.\" and p.idejercicio=\".$ejer.\" and c.`main_father`!=conf.CuentaBancos\n\t\t\tand m.IdPoliza=p.id and p.activo=1 and m.Activo=1 and p.relacionExt!=0 and p.idperiodo<=\".$periodo.\"\n\t\t\tgroup by p.relacionExt,m.TipoMovto\n\t\t\t\");\n\t\t\tif($sql->num_rows>0){\n\t\t\t\treturn $sql;\n\t\t\t}else{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t}", "function get_materias_equipo($filtro=array()){\n $where=\" WHERE 1=1 \";\n $where2=\" WHERE 1=1 \";\n if (isset($filtro['anio'])) {\n $where.= \" and anio= \".quote($filtro['anio']['valor']);\n }\n if (isset($filtro['carrera'])) {\n switch ($filtro['carrera']['condicion']) {\n case 'contiene':$where2.= \" and carrera ILIKE \".quote(\"%{$filtro['carrera']['valor']}%\");break;\n case 'no_contiene':$where2.= \" and carrera NOT ILIKE \".quote(\"%{$filtro['carrera']['valor']}%\");break;\n case 'comienza_con':$where2.= \"and carrera ILIKE \".quote(\"{$filtro['carrera']['valor']}%\");break;\n case 'termina_con':$where2.= \"and carrera ILIKE \".quote(\"%{$filtro['carrera']['valor']}\");break;\n case 'es_igual_a':$where2.= \" and carrera = \".quote(\"{$filtro['carrera']['valor']}\");break;\n case 'es_distinto_de':$where2.= \" and carrera <> \".quote(\"{$filtro['carrera']['valor']}\");break;\n }\t\n\t }\n if (isset($filtro['legajo'])) {\n $where2.= \" and legajo = \".quote($filtro['legajo']['valor']);\n }\n if (isset($filtro['vencidas'])) {\n $pdia = dt_mocovi_periodo_presupuestario::primer_dia_periodo_anio($filtro['anio']['valor']);\n $udia = dt_mocovi_periodo_presupuestario::ultimo_dia_periodo_anio($filtro['anio']['valor']);\n switch ($filtro['vencidas']['valor']) {\n //sin las designaciones vencidas, es decir solo vigentes\n case 1:$where.= \" and desde<='\".$udia.\"' and ( hasta>='\".$pdia.\"' or hasta is null )\";break;\n case 0:$where.= \" and not(desde<='\".$udia.\"' and ( hasta>='\".$pdia.\"' or hasta is null ))\";break;\n }\n }\n// if (isset($filtro['carrera'])) {\n// $where2.= \" and carrera= \".quote($filtro['carrera']['valor']);\n// }\n //si el usuario esta asociado a un perfil de datos\n $con=\"select sigla from unidad_acad \";\n $con = toba::perfil_de_datos()->filtrar($con);\n $resul=toba::db('designa')->consultar($con);\n if(count($resul)<=1){//es usuario de una unidad academica\n $where.=\" and uni_acad = \".quote($resul[0]['sigla']);\n }else{\n //print_r($filtro);exit;\n if (isset($filtro['uni_acad'])) {\n $where.= \" and uni_acad= \".quote($filtro['uni_acad']['valor']);\n }\n }\n \n $sql=\"select * from (select \n case when conj='sin_conj' then desc_materia else desc_mat_conj end as materia,\n case when conj='sin_conj' then cod_siu else cod_conj end as cod_siu,\n case when conj='sin_conj' then cod_carrera else car_conj end as carrera,\n case when conj='sin_conj' then ordenanza else ord_conj end as ordenanza,\n docente_nombre,legajo,cat_est,id_designacion,modulo,rol,periodo,id_conjunto\n from(\n select sub5.uni_acad,trim(d.apellido)||', '||trim(d.nombre) as docente_nombre,d.legajo,cat_est,sub5.id_designacion,carac,t_mo.descripcion as modulo,case when trim(rol)='NE' then 'Aux' else 'Resp' end as rol,p.descripcion as periodo,\n case when sub5.desc_materia is not null then 'en_conj' else 'sin_conj' end as conj,id_conjunto,\n m.desc_materia,m.cod_siu,pl.cod_carrera,pl.ordenanza,\n sub5.desc_materia as desc_mat_conj,sub5.cod_siu as cod_conj,sub5.cod_carrera as car_conj,sub5.ordenanza as ord_conj\n from(\n\n select sub2.id_designacion,sub2.id_materia,sub2.id_docente,sub2.id_periodo,sub2.modulo,sub2.carga_horaria,sub2.rol,sub2.observacion,cat_est,dedic,carac,desde,hasta,sub2.uni_acad,sub2.id_departamento,sub2.id_area,sub2.id_orientacion,sub4.desc_materia ,sub4.cod_carrera,sub4.ordenanza,sub4.cod_siu,sub3.id_conjunto\n from (select distinct * from (\n select distinct a.anio,b.id_designacion,b.id_docente,a.id_periodo,a.modulo,a.carga_horaria,a.rol,a.observacion,a.id_materia,b.uni_acad,cat_estat||dedic as cat_est,dedic,carac,desde,hasta,b.id_departamento,b.id_area,b.id_orientacion\n from asignacion_materia a, designacion b\n where a.id_designacion=b.id_designacion\n and not (b.hasta is not null and b.hasta<=b.desde)\n )sub1\n --where uni_acad='CRUB' and anio=2020 \n \".$where .\") sub2 \n left outer join \n ( select t_c.id_conjunto,t_p.anio,t_c.id_periodo,t_c.ua,t_e.id_materia\n from en_conjunto t_e,conjunto t_c, mocovi_periodo_presupuestario t_p\n WHERE t_e.id_conjunto=t_c.id_conjunto and t_p.id_periodo=t_c.id_periodo_pres \n )sub3 on (sub3.ua=sub2.uni_acad and sub3.id_periodo=sub2.id_periodo and sub3.anio=sub2.anio and sub3.id_materia=sub2.id_materia)\n left outer join (select t_e.id_conjunto,t_e.id_materia,t_m.desc_materia,t_m.cod_siu,t_p.cod_carrera,t_p.uni_acad,t_p.ordenanza\n from en_conjunto t_e,materia t_m ,plan_estudio t_p\n where t_e.id_materia=t_m.id_materia\n and t_p.id_plan=t_m.id_plan)sub4 on sub4.id_conjunto=sub3.id_conjunto\n\n\n\n )sub5\n LEFT OUTER JOIN docente d ON d.id_docente=sub5.id_docente\n LEFT OUTER JOIN periodo p ON p.id_periodo=sub5.id_periodo\n LEFT OUTER JOIN modulo t_mo ON sub5.modulo=t_mo.id_modulo\n LEFT OUTER JOIN materia m ON m.id_materia=sub5.id_materia\n LEFT OUTER JOIN plan_estudio pl ON pl.id_plan=m.id_plan\n )sub6)sub\n $where2\n order by id_conjunto,materia,docente_nombre\";\n return toba::db('designa')->consultar($sql);\n }", "static public function mdlSelecMembresiasNuevas($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 = '0'\");\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 = '0' \");\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n }", "function consulta_registro_compras_imprimir($w_anio, $w_mes, $w_anexo) {\n $sql = \"SELECT\n prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.pago_comprobante\n , prosic_tipo_comprobante.sunat_tipo_comprobante\n , prosic_comprobante.serie_comprobante\n , prosic_comprobante.anio_dua_comprobante\n , prosic_comprobante.nro_comprobante\n , prosic_tipo_documento.sunat_tipo_documento\n , prosic_anexo.codigo_anexo\n , SUBSTRING(prosic_anexo.descripcion_anexo,1,20)\n , prosic_comprobante.afecto_comprobante\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.igv_comprobante\n , prosic_comprobante.total_comprobante \t\n , prosic_comprobante.id_operacion\n , prosic_comprobante.no_gravadas_igv\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.isc_comprobante\n , prosic_comprobante.otros_tributos\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.tipo_cambio_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n , prosic_comprobante.id_moneda\n\t, prosic_comprobante.referencia_fecha\n\t, prosic_comprobante.referencia_serie\n\t, prosic_comprobante.referencia_nro\n\t, prosic_comprobante.referecia_tipo_doc\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_tipo_comprobante ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_tipo_documento ON (prosic_anexo.id_tipo_documento = prosic_tipo_documento.id_tipo_documento)\n WHERE prosic_comprobante.id_subdiario=3\";\n if ($w_anio != '')$sql.=\" AND prosic_comprobante.id_anio=\" . $w_anio;\n if ($w_mes != '')$sql.=\" AND prosic_comprobante.id_mes=\" . $w_mes;\n if ($w_anexo != '')$sql.=\" AND prosic_comprobante.id_anexo='\" . $w_anexo . \"'\";\n $sql.=\" ORDER BY prosic_tipo_comprobante.sunat_tipo_comprobante,prosic_comprobante.codigo_comprobante\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function desplegarCampo(Detallesmantenimientosdetablas $detalle,$numeroGrid,$sinValorPorDefecto=false){\n $size=$detalle->getTamanoCampo();\n $max=$detalle->getTamanoMaximoCampo();\n $javascript=$detalle->getJavascriptDesdeCampo();\n $valorPorDefecto=trim(obtenerValorPorDefecto($detalle));\n if($sinValorPorDefecto!=false){\n $valorPorDefecto=$ValorPorDefecto;\n }\n $id=$detalle->getIdCampo();\n $tipo=$detalle->getIdTipoCampo();\n $requerido=$detalle->getNulidadCampo();\n $accion=strtoupper($detalle->getAccionCampo());\n\n $ayuda=$detalle->getDescripcionCampo();\n\n if ($tipo == 14) { //Si es tipo Separador de Campos\n Campos::columnaGrid($numeroGrid);\n echo \"<center><strong>\" . $detalle->getNombreCampo() . \"</strong></center>\";\n Campos::finColumnaGrid();\n return;\n } else {\n Campos::columnaGrid($numeroGrid);\n echo $detalle->getNombreCampo();\n C::finColumnaGrid();\n }\n\n Campos::columnaGrid($numeroGrid);\n\n/*\n 1\tFecha\n 2\tFecha Hora\n 3\tHora\n 4\tArchivo\n 5\tNumerico\n 6\tMoneda\n 7\tCaracteres\n 8\tTexto\n 9\tTabla Extranjera\n 10\tBoton de Cheque\n 11\tBotones de Opcion Múltiple PENDIENTE\n 12\tFALSO\n 13\tLista Desplegable\n 14\tAgrupador de Campos\n 15\tSeparador De Campos Oculto PENDIENTE\n 16\tFinalizacion del Separador PENDIENTE\n 17\tTabla PENDIENTE\n 18\tBoton PENDIENTE\n 19\tRuta de archivo PENDIENTE\n 20 Editor HTML PopUp\n */\n\n\n //Aqui empieza la captura...\n if($tipo==1){\n $resFecha=$detalle->getRestriccionDeFechas();\n if(trim($resFecha)==\"\"){\n $resFecha=null;\n }\n if(trim($valorPorDefecto)==\"\"){\n $valorPorDefecto=null;\n }\n C::texto($id,$valorPorDefecto,10,10,\" READONLY \");\n }else if($tipo==2){\n $resFecha=$detalle->getRestriccionDeFechas();\n if(trim($resFecha)==\"\"){\n $resFecha=null;\n }\n C::texto($id,$valorPorDefecto,15,15,\" READONLY \");\n }else if($tipo==3){\n C::texto($id,$valorPorDefecto,10,10,\" READONLY \");\n }else if($tipo==5){\n C::entero($id,$valorPorDefecto,$size,$max,$javascript.\" READONLY \");\n }else if($tipo==6){\n C::flotante($id,$valorPorDefecto,$size,$max,$javascript.\" READONLY \");\n }else if($tipo==7){\n C::texto($id,$valorPorDefecto,$size,$max,$javascript.\" READONLY \");\n }else if($tipo==8){\n $filas=$detalle->getAltoCampo();\n C::textArea($id,$valorPorDefecto,$filas,$size,$javascript.\" READONLY \");\n }else if($tipo==9){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSet($id.\"selectDisabled\", $rsT, $valorPorDefecto,\" DISABLED \");\n C::oculto($id,$valorPorDefecto);\n }else if($tipo==10){\n $chequeado=false;\n if($valorPorDefecto==1){\n $chequeado=true;\n }\n C::chequeSiNo($id,'',$chequeado,1,\" DISABLED \");\n } else if($tipo==12){\n C::texto($id, $valorPorDefecto, $size, $max, $javascript.\" READONLY\");\n }else if($tipo==13){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSet($id.\"selectDisabled\", $rsT, $valorPorDefecto,\" DISABLED \");\n C::oculto($id,$valorPorDefecto);\n }else if($tipo==20){\n C::editorHTMLPopUp($id, $valorPorDefecto, $detalle->getNombreCampo());\n }else if($tipo==26){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSetConBusqueda($id, $rsT, $valorPorDefecto);\n }else if($tipo==27){\n $chequeado=false;\n if($valorPorDefecto=='A'){\n $chequeado=true;\n }\n C::chequeActivo($id,'',$chequeado);\n }else if($tipo==28){\n C::textoConMascara($id,$detalle->getQueryFiltro());\n }else if($tipo==29){\n C::selectCatalogoId($id,$detalle->getCatalogoId(), $valorPorDefecto);\n }\n\n C::finColumnaGrid();\n}", "static public function mdlSelecMembresiasRenovadas($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 = '1' \");\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 = '1' \");\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n }", "function consulta_intereses($tipo_personal)\r\n{\r\n\t$cedula=$_SESSION[\"cedula\"];\r\n\t//$cedula=3379195;\t\r\n\t$db=\"sidial_excel\";\r\n\t$sql=\"SELECT name FROM sysobjects ORDER BY name ASC\";\r\n\t$ds\t= new DataStore($db, $sql);\r\n\t//COMPROBACION PARA VERIFICAR QUE DEBE ESTAR EN UNO DE LOS LISTADOS 1998-2009 2010-2011 DOCENTES 1975-1997\r\n\t\r\n\t$sql=\"\r\n\t\t\tSELECT DISTINCT \r\n\t\t\t MST_TRABAJADOR.CE_TRABAJADOR,\r\n\t\t\t YEAR(case WHEN MST_CARGOS.FE_JUBILACION IS NULL THEN MST_CARGOS.FE_FIN_PRESTACIONES ELSE MST_CARGOS.FE_JUBILACION END) AS ano, \r\n\t\t\t ( LEFT(MST_CARGOS.TIPOPERSONAL,1)) AS TIPOP \r\n\t\t\tFROM MST_CARGOS, MST_TRABAJADOR\r\n\t\tWHERE ( MST_TRABAJADOR.CE_TRABAJADOR = MST_CARGOS.CE_TRABAJADOR ) AND\r\n\t\t\t ( SUBSTRING(MST_CARGOS.TIPOPERSONAL,4,2) <> '92' ) AND \r\n\t\t\t ( SUBSTRING(MST_CARGOS.TIPOPERSONAL,1,3) <> '140' ) AND\r\n\t\t\t ( LEFT(MST_CARGOS.TIPOPERSONAL,1) = '$tipo_personal' ) AND\r\n\t\t\t ( case WHEN MST_CARGOS.FE_JUBILACION IS NULL THEN MST_CARGOS.FE_FIN_PRESTACIONES ELSE MST_CARGOS.FE_JUBILACION END IS NOT NULL ) AND\r\n\t\t\t ( YEAR(case WHEN MST_CARGOS.FE_JUBILACION IS NULL THEN MST_CARGOS.FE_FIN_PRESTACIONES ELSE MST_CARGOS.FE_JUBILACION END) BETWEEN 1998 AND 2011) AND \r\n\t\t\t ( MST_CARGOS.EDO_CARGO in ('A','F','R'))\t\t AND\r\n\t\t\t ( MST_TRABAJADOR.CE_TRABAJADOR = $cedula )\r\n\tUNION\r\n\t\t\tSELECT DISTINCT \r\n\t\t\t\t MST_TRABAJADOR.CE_TRABAJADOR, \r\n\t\t\t\t YEAR(MST_CARGOS.FE_JUBILACION) AS ano, \r\n\t\t\t\t ( LEFT(MST_CARGOS.TIPOPERSONAL,1)) AS TIPOP \r\n\t\t\tFROM MST_CARGOS, MST_TRABAJADOR\r\n\t\t\tWHERE ( MST_TRABAJADOR.CE_TRABAJADOR = MST_CARGOS.CE_TRABAJADOR ) AND\t \r\n\t\t\t ( SUBSTRING(MST_CARGOS.TIPOPERSONAL,4,2) <> '92' ) AND \r\n\t\t\t ( SUBSTRING(MST_CARGOS.TIPOPERSONAL,1,3) <> '140' ) AND\r\n\t\t\t ( LEFT(MST_CARGOS.TIPOPERSONAL,1) in ('1','2') ) AND\r\n\t\t\t ( MST_TRABAJADOR.CE_TRABAJADOR IN (3933968,114369,35982,244073,132581,679107,249221,681896,1078900,101159,1052975,2091522,1092707,1643395,483638,293457,1670457,5813080,1637465,1637465,1656850,1382359,1065923,4145884,2466910,1669389,1689427,1685308,2874802,2096532,1691834,1962335,2871423,2871423,1666380,182263,329096,746969,142490,173098,1896904,1092378,3511460,1656583,2867184,1002253,1864558,3279568,1821423,2857785,1664183,1656829,1659258,1687227,2467208,2866511,1699977,1826819,2883516,2463505,873808,1962909,1670337,1657139,1936224,1069567,3272522,1937788,3509013,1058443,1421254,720148,1813383,1636415,1087526,3466550,2868263,986448,2817905,2874923,948051,1642541,1648008,1656112,2876406,1690773,1647539,1684711,1077182,2822145,2873680,2865496,2865496,1053937,1657595,1638230,2894078,1690806,2875505,2150844,3925136,3112870,1070094,2868196,2868196,2052862,1393187,3273723,3117961,2868120,1828935,1657071,1657708,1640153,1079351,2771176,3385888,1691923,2884368,1660359,2872781,2884063,1657016,1928058,3112467,3112467,1669754,102111,1596665,2882253,5840274,3114317,1697097,3384276,2615425,2772981,1808564,3549204,623000,1642632,3216047,3216047,3452259,2143069,2869481,1045110,2873319,3774735,2860981,1669510,1630481,2874708,2052523,1695316,7874916,2865414,1093201,3116899,1264086,3271391,2134926,2455791,5839228,2888884,1932516,1806083,3272281,2768929,682313,1653951,2877777,3379108,1646390,3351316,3651728,1406220,1656749,1671331,2869480,1099546,3103835,3643490,1821310,5845060,5841223,1644433,3272362,2756670,1636463,1636463,2885067,1669414,1904851,2874657,7813832,3647895,189946,1828799,3644154,2108386,2883448,3034515,2073729,3109689,5808707,3114779,3114929,2552063,3127646,3277192,3379641,2875004,630809,630809,2881400,4013426,3384915,2773317,3114318,3453391,3453391,2883406,3117188,1534688,3108641,2737889,3113473,2095163,3264718,641592,641592,3274123,3033918,2818607,4269195,3933874,2878798,3115114,1693461,3508301,3379498,3379783,3385668,4203679,3430341,3929217,1657495,3930047,393229,1650967,6005362,3578024,2686926,2867272,2773057,1826477,2052658,2743543,2869481,4150615,3929211,1656813,2884451,3110402,2626932,4522373,3926426,2626030,3078023,3107324,529896,3093473,3643185,3644519,4152751,3510876,3093473,1829277,3508075,1088991,1693764,1698737,3679377,3119021,2898488,3276637,3379821,3772750,4172440,2815083,3928054,3930244,2882357,3279863,3106568,3117188,4014967,1092093,2574801) )\r\n\t\t\t\t\"; \r\n\t\t\t$ds->executesql($sql);\r\n\t\t\t$todos=$ds->getValuesCol(\"CE_TRABAJADOR\");\r\n\t\t\t//echo count($todos);\r\n\t\t\t//LOS 280 DE 1975-1998 \r\n\t\t\tif(count($todos)<=282)\r\n\t\t\t{\r\n\t\t\t\techo \"<head><meta http-equiv=\\\"refresh\\\" content=\\\"0; url=../RRHH/consultaNominaForm.php\\\"></head>\"; \r\n\t\t\t\texit;\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$sql=\" SELECT MO_INT_ACUMULADO \r\n\t\t\t\t from MST_PRESTACIONES_DETALLE, MST_CARGOS\r\n\t\tWHERE ( MST_PRESTACIONES_DETALLE.CE_TRABAJADOR = MST_CARGOS.CE_TRABAJADOR ) AND\r\n\t\t\t ( SUBSTRING(MST_CARGOS.TIPOPERSONAL,4,2) <> '92' ) AND \r\n\t\t\t ( SUBSTRING(MST_CARGOS.TIPOPERSONAL,1,3) <> '140' ) AND\r\n\t\t\t ( LEFT(MST_CARGOS.TIPOPERSONAL,1) = MST_PRESTACIONES_DETALLE.TIPO_REGISTRO ) AND\r\n\t\t\t ( LEFT(MST_CARGOS.TIPOPERSONAL,1) = '$tipo_personal' ) AND\r\n\t\t\t ( case WHEN MST_CARGOS.FE_JUBILACION IS NULL THEN MST_CARGOS.FE_FIN_PRESTACIONES ELSE MST_CARGOS.FE_JUBILACION END IS NOT NULL ) AND\r\n\t\t\t ( YEAR(case WHEN MST_CARGOS.FE_JUBILACION IS NULL THEN MST_CARGOS.FE_FIN_PRESTACIONES ELSE MST_CARGOS.FE_JUBILACION END) BETWEEN 1998 AND 2011) AND \r\n\t\t\t ( MST_CARGOS.EDO_CARGO in ('A','F','R'))\t\t AND\r\n\t\t\t\t MST_PRESTACIONES_DETALLE.CE_TRABAJADOR = $cedula \r\n\t\t\t\t\t\tAND FE_HASTA = '2011-12-31' AND \r\n ( MST_PRESTACIONES_DETALLE.MO_INT_ACUMULADO > 0) \";\r\n\t\t\t\t$ds->executesql($sql);\r\n\t\t\t\t$MO_INT_ACUMULADO=$ds->getValueCol(0,\"MO_INT_ACUMULADO\");\r\n\t\t//\t\treturn($MO_INT_ACUMULADO);\r\n\t\t\t\treturn(0);\r\n\t\t\t}\t\t\r\n\t\r\n\t\r\n}", "function Cuerpo($acceso,$id_fam,$id_unidad,$impresion)\n\t{\n\t\t$this->SetFont('Arial','',8);\n\t\t\n\t\tif($id_fam!='' && $id_fam!=\"0\" ){\n\t\t\t$bus=$bus.\" and id_fam='$id_fam'\";\n\t\t\t\n\t\t\t$acceso->objeto->ejecutarSql(\"SELECT nombre_fam FROM familia where id_fam='$id_fam'\");\n\t\t\t$row=row($acceso);\n\t\t\t$this->SetX(15);\n\t\t\t$this->Cell(50,6,strtoupper(_(\"familia\")).\": \".utf8_decode(trim($row[\"nombre_fam\"])),\"0\",0,\"J\",$fill);\n\t\t}\n\n\t\tif($id_unidad!='' && $id_unidad!=\"0\" ){\n\t\t\t$bus=$bus.\" and id_unidad='$id_unidad'\";\n\t\t\t\n\t\t\t$acceso->objeto->ejecutarSql(\"SELECT nombre_unidad FROM unidad_medida where id_unidad='$id_unidad'\");\n\t\t\t$row=row($acceso);\n\t\t\t$this->Cell(50,6,strtoupper(_(\"unidad medida\")).\": \".utf8_decode(trim($row[\"nombre_unidad\"])),\"0\",0,\"J\",$fill);\n\t\t}\n\n\t\tif($impresion!='' && $impresion!=\"0\" ){\n\t\t\t$bus=$bus.\" and impresion='$impresion'\";\n\t\t\t$val=array(\"T\"=>\"SI\",\"F\"=>\"NO\");\n\t\t\t$this->Cell(50,6,strtoupper(_(\"para impresion\")).\": \".$val[\"$impresion\"],\"0\",0,\"J\",$fill);\n\t\t}\n\n\t\t\n\t\t$w=$this->TituloCampos();\n\t\t$bus=\" where id_m <>'' \";\n\n\t\tif($id_fam!='' && $id_fam!=\"0\" ){\n\t\t\t$bus=$bus.\" and id_fam='$id_fam'\";\n\t\t}\n\t\tif($id_unidad!='' && $id_unidad!=\"0\" ){\n\t\t\t$bus=$bus.\" and id_unidad='$id_unidad'\";\n\t\t}\n\t\tif($impresion!='' && $impresion!=\"0\" ){\n\t\t\t$bus=$bus.\" and impresion='$impresion'\";\n\t\t}\n\t\t$acceso->objeto->ejecutarSql(\"SELECT numero_mat,nombre_mat,nombre_fam,nombre_unidad FROM vista_matpadre $bus\");\n\t\t\n\t\t$this->SetFont('Arial','',9);\n\t\t$cont=1;\n\t\t$this->SetFillColor(249,249,249);\n\t\t$this->SetTextColor(0);\n\t\t\n\t\twhile ($row=row($acceso))\n\t\t{\n\t\t\t$this->SetX(15);\n\t\t\t/*$this->Cell($w[0],6,$cont,\"L\",0,\"C\",$fill);*/\n\t\t\t$this->Cell($w[0],6,utf8_decode(trim($row[\"numero_mat\"])),\"L\",0,\"J\",$fill);\n\t\t\t$this->Cell($w[1],6,utf8_decode(trim($row[\"nombre_mat\"])),\"0\",0,\"J\",$fill);\n\t\t\t$this->Cell($w[2],6,utf8_decode(trim($row[\"nombre_fam\"])),\"0\",0,\"J\",$fill);\n\t\t\t$this->Cell($w[3],6,utf8_decode(trim($row[\"nombre_unidad\"])),\"R\",0,\"J\",$fill);\n\n\t\t\t$this->Ln();\n\t\t\t$fill=!$fill;\n\t\t\t$cont++;\n\t\t}\n\t\t$this->SetX(15);\n\t\t$this->Cell(array_sum($w),5,'','T');\n\t}", "static public function mdlRealizarComprasGenerales($tabla, $datos){\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE $tabla SET usuario = :usuario, serie = :serie, idPedido = :idPedido, folioCompra = :folioCompra, cliente = :cliente, cantidad = :cantidad, importeCompra = :importeCompra, status = :status, sinAdquisicion = :sinAdquisicion, fechaRecepcion = :fechaRecepcion, fechaElaboracion = :fechaElaboracion, fechaTermino = :fechaTermino, observaciones = :observaciones, estado = :estado, pendiente = :pendiente WHERE idPedido = :idPedido and serie = :serie\");\r\n\r\n\t\t$stmt->bindParam(\":idPedido\", $datos[\"idPedido\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":usuario\", $datos[\"usuario\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":serie\", $datos[\"serie\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":folioCompra\", $datos[\"folioCompra\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":cliente\", $datos[\"cliente\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":cantidad\", $datos[\"cantidad\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":importeCompra\", $datos[\"importeCompra\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":status\", $datos[\"status\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":sinAdquisicion\", $datos[\"sinAdquisicion\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":fechaRecepcion\", $datos[\"fechaRecepcion\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":fechaElaboracion\", $datos[\"fechaElaboracion\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":fechaTermino\", $datos[\"fechaTermino\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":observaciones\", $datos[\"observaciones\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":estado\", $datos[\"estado\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":pendiente\", $datos[\"pendiente\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":id\", $datos[\"id\"], PDO::PARAM_INT);\r\n\r\n\t\tif($stmt->execute()){\r\n\r\n\t\t\treturn \"ok\";\t\r\n\r\n\t\t}else{\r\n\r\n\t\t\treturn \"error\";\r\n\t\t\r\n\t\t}\r\n\r\n\t\t$stmt->close();\r\n\t\t\r\n\t\t$stmt = null;\r\n\r\n\t}", "public function possuiCalculoPorDiaDoMes() {\n return $this->lControleDiasNoMes;\n }", "function mdatosEjercicioInformacion() {\n\t\t$conexion = conexionbasedatos();\n\t\t\n\t\t$idejercicio = $_GET[\"idejercicio\"];\n\n\t\t$consulta = \"select FE.IDEJERCICIO, FE.NOMBRE_EJERCICIO, FG.NOMBRE_MUSCULO , FE.NIVEL_EJERCICIO, FE.DESCRIPCION, FE.IDFOTO\n\t\t\t\t\tfrom final_ejercicio FE, final_grupo FG\n\t\t\t\t\twhere FE.MUSCULO = FG.IDGRUPO AND FE.IDEJERCICIO = $idejercicio;\";\n\n\t\tif ($resultado = $conexion->query($consulta)) {\n\t\t\treturn $resultado;\n\t\t} else {\n\t\t\treturn -1;\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}", "function cabecera($cedula, $ano, $mes){\r\n\t$cuerpo = \"\";\r\n\t$db = \"sidial\";\r\n\t$sql = \"SELECT * FROM VW_CABECERA_HISTORICO WHERE CE_TRABAJADOR = $cedula AND ANO = $ano AND MES = $mes\";\r\n\t$ds = new DataStore($db, $sql);\r\n\tif($ds->getNumRows()==0){\r\n\t\t$cuerpo .= \"<h4>No hay datos para la consulta</h4>\";;\r\n\t} else {\r\n\t\t$fila = $ds->getValues(0);\r\n\t $cuerpo .= '<table class=\"consulta\">';\r\n//\t $cuerpo .= '<tr class=\"par\"><th>Apellidos y nombres</th><td>' . $fila[\"NOMBRES\"] . \"</td></tr>\";\r\n\t $cuerpo .= '<tr class=\"par\"><th>Ubicaci&oacute;n</th><td>' . $fila[\"UBICACION\"] . \"</td></tr>\";\r\n\t $cuerpo .= '<tr class=\"par\"><th>Tipo de personal</th><td>' . $fila[\"TIPPER\"] . \"</td></tr>\";\r\n\t $cuerpo .= '<tr class=\"par\"><th>Dedicaci&oacute;n</th><td>' . $fila[\"DEDICACION\"] . \"</td></tr>\";\r\n\t $cuerpo .= '<tr class=\"par\"><th>Categor&iacute;a o cargo</th><td>' . $fila[\"CATEGORIA\"] . \"</td></tr>\";\r\n//\t $cuerpo .= '<tr class=\"par\"><th>Fecha de Ingreso</th><td>' . $fila[\"FE_INGRESO\"] . \"</td></tr>\";\r\n//\t $cuerpo .= '<tr class=\"par\"><th>Fecha de Jubilaci�n</th><td>' . $fila[\"FE_JUBILACION\"] . \"</td></tr>\";\r\n\t $cuerpo .= \"</table>\";\r\n\t}\r\n\treturn $cuerpo;\r\n}", "public function CarregaTrimestre($aDados)\r\n {\r\n $aDados = (array) $aDados;\r\n \r\n $idplanificacion = $aDados['cplanificacion'];\r\n $pais = $aDados['idPais'];\r\n $sede = $aDados['idSede'];\r\n $indicador = $aDados['idIndicador'];\r\n \r\n $model = Container::getModel(\"TInforme\");\r\n \r\n //Busca Trismestre\r\n $result = $model->BuscaTrimestre($idplanificacion, $pais, $sede, $indicador);\r\n \r\n // Acumulado\r\n if($result[0]->id_tipo == 1)\r\n {\r\n //Dados para o Chart Plan\r\n $T1Plan = $result[0]->enero_plan + $result[0]->febrero_plan + $result[0]->marzo_plan;\r\n $T2Plan = $result[0]->abril_plan + $result[0]->mayo_plan + $result[0]->junio_plan;\r\n $T3Plan = $result[0]->julio_plan + $result[0]->agosto_plan + $result[0]->septiembre_plan;\r\n $T4Plan = $result[0]->octubre_plan + $result[0]->noviembre_plan + $result[0]->diciembre_plan;\r\n \r\n //Dados para o Chart Real\r\n $T1Real = $result[0]->enero_real + $result[0]->febrero_real + $result[0]->marzo_real;\r\n $T2Real = $result[0]->abril_real + $result[0]->mayo_real + $result[0]->junio_real;\r\n $T3Real = $result[0]->julio_real + $result[0]->agosto_real + $result[0]->septiembre_real;\r\n $T4Real = $result[0]->octubre_real + $result[0]->noviembre_real + $result[0]->diciembre_real;\r\n }\r\n \r\n // Minimo\r\n if($result[0]->id_tipo == 2)\r\n {\r\n $aT1 = array($result[0]->enero_plan, $result[0]->febrero_plan, $result[0]->marzo_plan);\r\n $aT2 = array($result[0]->abril_plan, $result[0]->mayo_plan, $result[0]->junio_plan);\r\n $aT3 = array($result[0]->julio_plan, $result[0]->agosto_plan, $result[0]->septiembre_plan);\r\n $aT4 = array($result[0]->octubre_plan, $result[0]->noviembre_plan, $result[0]->diciembre_plan);\r\n \r\n //Dados para o Chart Plan\r\n $T1Plan = min($aT1);\r\n $T2Plan = min($aT2);\r\n $T3Plan = min($aT3);\r\n $T4Plan = min($aT4);\r\n \r\n $aR1 = array($result[0]->enero_real, $result[0]->febrero_real, $result[0]->marzo_real);\r\n $aR2 = array($result[0]->abril_real, $result[0]->mayo_real, $result[0]->junio_real);\r\n $aR3 = array($result[0]->julio_real, $result[0]->agosto_real, $result[0]->septiembre_real);\r\n $aR4 = array($result[0]->octubre_real, $result[0]->noviembre_real, $result[0]->diciembre_real);\r\n \r\n //Dados para o Chart Real\r\n $T1Real = min($aR1);\r\n $T2Real = min($aR2);\r\n $T3Real = min($aR3);\r\n $T4Real = min($aR4);\r\n }\r\n \r\n // Promedio\r\n if($result[0]->id_tipo == 3)\r\n {\r\n //Dados para o Chart Plan\r\n $T1Plan = ($result[0]->enero_plan + $result[0]->febrero_plan + $result[0]->marzo_plan) / 3;\r\n $T2Plan = ($result[0]->abril_plan + $result[0]->mayo_plan + $result[0]->junio_plan) / 3;\r\n $T3Plan = ($result[0]->julio_plan + $result[0]->agosto_plan + $result[0]->septiembre_plan) / 3;\r\n $T4Plan = ($result[0]->octubre_plan + $result[0]->noviembre_plan + $result[0]->diciembre_plan) / 3;\r\n \r\n //Dados para o Chart Real\r\n $T1Real = ($result[0]->enero_real + $result[0]->febrero_real + $result[0]->marzo_real) /3;\r\n $T2Real = ($result[0]->abril_real + $result[0]->mayo_real + $result[0]->junio_real) /3;\r\n $T3Real = ($result[0]->julio_real + $result[0]->agosto_real + $result[0]->septiembre_real) /3;\r\n $T4Real = ($result[0]->octubre_real + $result[0]->noviembre_real + $result[0]->diciembre_real) /3;\r\n }\r\n \r\n // Ultimo\r\n if($result[0]->id_tipo == 4)\r\n {\r\n $aT1 = array($result[0]->enero_plan, $result[0]->febrero_plan, $result[0]->marzo_plan);\r\n $aT2 = array($result[0]->abril_plan, $result[0]->mayo_plan, $result[0]->junio_plan);\r\n $aT3 = array($result[0]->julio_plan, $result[0]->agosto_plan, $result[0]->septiembre_plan);\r\n $aT4 = array($result[0]->octubre_plan, $result[0]->noviembre_plan, $result[0]->diciembre_plan);\r\n \r\n //Dados para o Chart Plan\r\n $T1Plan = max($aT1);\r\n $T2Plan = max($aT2);\r\n $T3Plan = max($aT3);\r\n $T4Plan = max($aT4);\r\n \r\n $aR1 = array($result[0]->enero_real, $result[0]->febrero_real, $result[0]->marzo_real);\r\n $aR2 = array($result[0]->abril_real, $result[0]->mayo_real, $result[0]->junio_real);\r\n $aR3 = array($result[0]->julio_real, $result[0]->agosto_real, $result[0]->septiembre_real);\r\n $aR4 = array($result[0]->octubre_real, $result[0]->noviembre_real, $result[0]->diciembre_real);\r\n \r\n //Dados para o Chart Real\r\n $T1Real = max($aR1);\r\n $T2Real = max($aR2);\r\n $T3Real = max($aR3);\r\n $T4Real = max($aR4);\r\n }\r\n \r\n //tudo junto pq deu merda separado\r\n echo json_encode(array(\"plan\" => $T1Plan . ',' . $T2Plan . ',' . $T3Plan. ',' . $T4Plan . ',' . $T1Real. ',' . $T2Real. ',' . $T3Real. ',' . $T4Real));\r\n // echo json_encode(array(\"real\" => $T1Real. ',' . $T2Real. ',' . $T3Real. ',' . $T4Real));\r\n }", "public function setMes($iMes) {\n $this->iMes = $iMes;\n }", "public function pesquisarMembroMatriculaDao($matricula){\r\n \r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objConexao = Connection::getInstance();\r\n $objMembro = new objetoMembro();\r\n \r\n $busca = mysql_query(\"Select Nome,Matricula from membros where Matricula = $matricula\") or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n $reg = mysql_fetch_assoc($busca);\r\n \r\n\tif($reg != \"\"){\r\n $objMembro->setMatricula($reg['Matricula']); $objMembro->setNome($reg['Nome']);\r\n }\r\n else{\r\n \r\n }\r\n \r\n mysql_free_result($busca); //limpa o resultado da pesquisa libera a memoria ocupado\r\n $objConexao->freebanco(); // fecha a conec��o com o banco\r\n return $objMembro;\r\n }", "public function reporteEspecificoMateria($criterio, $busqueda) {\r\n\t\tif ($this->noMaterias () > 0) {\r\n\t\t\t\r\n\t\t\t$vectorMaterias = array ();\r\n\t\t\t$sql = \"SELECT *FROM materia WHERE \" . $criterio . \"='\" . $busqueda . \"' ORDER BY nom_mat ASC\";\r\n\t\t\tmysql_query ( \"SET NAMES 'utf8'\" );\r\n\t\t\t$qry = mysql_query ( $sql ) or die ( \"Error en la tabla->\" . $this->tabla . \",de tipo:\" . mysql_error () . mysql_errno () );\r\n\t\t\twhile ( $ren = mysql_fetch_array ( $qry ) ) {\r\n\t\t\t\t$materia = new Materia ();\r\n\t\t\t\t$materia->setSiiaMateria ( $ren ['siia'] );\r\n\t\t\t\t$materia->setNombreMateria ( $ren ['nom_mat'] );\r\n\t\t\t\t$materia->setHorasTMateria ( $ren ['ht_mat'] );\r\n\t\t\t\t$materia->setHorasPMateria ( $ren ['hp_mat'] );\r\n\t\t\t\t$materia->setPreMateria ( $ren ['pre_mat'] );\r\n\t\t\t\t$materia->setPreMateriaDos ( $ren ['pre2_mat'] );\r\n\t\t\t\t$materia->setClaveSemMateria ( $ren ['cve_sem'] );\r\n\t\t\t\t$materia->setClaveBacMateria ( $ren ['cve_bac'] );\r\n\t\t\t\t\r\n\t\t\t\t$vectorMaterias [] = $materia;\r\n\t\t\t}\r\n\t\t\treturn $vectorMaterias;\r\n\t\t} else {\r\n\t\t\treturn 0; // NO HAY RESULTADOS\r\n\t\t}\r\n\t}", "private function consolaObjetoMetodo($clase = false) {\r\n\t\t\t$metodos = array_flip(get_class_methods($clase));\r\n\t\t\tif(array_key_exists('ejecutar', $metodos) == true):\r\n\t\t\t\t$this->consolaObjetoEjecutar($clase);\r\n\t\t\telseif(method_exists($clase, 'ejecutar') == true):\r\n\t\t\t\tthrow new \\RuntimeException(sprintf('El metodo: ejecutar no es posible ejecutarlo ya que puede ser privado o protegido en la clase: %, aplicación: %s', $this->objeto, $this->aplicacion));\r\n\t\t\telse:\r\n\t\t\t\tthrow new \\RuntimeException(sprintf('El metodo: ejecutar no existe en la clase: %, aplicación: %s', $this->objeto, $this->aplicacion));\r\n\t\t\tendif;\r\n\t\t}", "public function EliminarMesas()\n\t{\n\n\t\t$sql = \" select codmesa from ventas where codmesa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codmesa\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\n\t\t\t$sql = \" delete from mesas where codmesa = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codmesa);\n\t\t\t$codmesa = base64_decode($_GET[\"codmesa\"]);\n\t\t\t$stmt->execute();\n\n\t\t\theader(\"Location: mesas?mesage=1\");\n\t\t\texit;\n\n\t\t}else {\n\n\t\t\theader(\"Location: mesas?mesage=2\");\n\t\t\texit;\n\t\t}\n\n\t}", "public function datosMulta($datos) {\n $consultaExistenciaMulta = $this->db->select(\"SELECT * FROM multa \"\n . \"WHERE id = '\" . $datos . \"' \");\n\n if ($consultaExistenciaMulta != null) {\n return $consultaExistenciaMulta;\n } else {\n //Sino Inserto datos de Pre-Matricula del Estudiante\n echo 'Ni madres...';\n die;\n }\n }" ]
[ "0.60889816", "0.6005965", "0.5919875", "0.58665323", "0.58465487", "0.58387095", "0.5753883", "0.5751229", "0.5734401", "0.57342046", "0.5705258", "0.57033616", "0.568519", "0.56617665", "0.56130046", "0.5594884", "0.55743015", "0.5570555", "0.5559286", "0.5557701", "0.5555125", "0.55537474", "0.55468583", "0.5544525", "0.55384684", "0.55353314", "0.55323917", "0.5529906", "0.5510796", "0.5509587", "0.5503701", "0.55021614", "0.5488633", "0.5484763", "0.5480588", "0.5467102", "0.5460271", "0.5445587", "0.54409695", "0.5440419", "0.54153687", "0.5413939", "0.5407362", "0.5383991", "0.5377315", "0.5376342", "0.53677505", "0.5363795", "0.5356522", "0.53557307", "0.5354888", "0.5354717", "0.53545606", "0.53453124", "0.53435117", "0.5326068", "0.5320399", "0.52960825", "0.5292784", "0.5292294", "0.52921104", "0.5284027", "0.5279336", "0.52761644", "0.52688664", "0.5267527", "0.52664113", "0.5266314", "0.5263344", "0.5263138", "0.5262292", "0.5260582", "0.5258098", "0.5254324", "0.52505714", "0.5245632", "0.52418995", "0.52305", "0.52304465", "0.52294236", "0.52229095", "0.52222687", "0.52199495", "0.52155304", "0.52143574", "0.5210464", "0.52093774", "0.5207187", "0.52071273", "0.52019465", "0.51946795", "0.5193546", "0.518986", "0.51896614", "0.5187321", "0.5186349", "0.5185629", "0.5185055", "0.5184168", "0.5183796" ]
0.5973115
2
Ofrece un nombre coloquial de una mesa basada en el formato MMSS que se graba
public function daNombreMesa($mimesa){ $this->cargaMesas("no"); $nomMesa=""; foreach ($_SESSION['MisMesas'] as $mesa){ $ubica=$mesa['MES_ID'].'-'.$mesa['SAL_ID']; if ($ubica==$mimesa){ $nomMesa="Mesa: ".$mesa['MES_ID']." de ".$mesa['SAL_Nombre']." (".$mesa['MES_NPersonas']." personas)"; break; } } return $nomMesa; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toM($s) { \n $t = explode(\":\", $s); \n $h = settype($t[0], integer);\n $m = settype($t[1], integer);\n $mm = ($h * 60) + $m;\n return $mm;\n\t\t}", "function convert_time ($time = '') {\n $str_time = '';\n\n $time_in_second = $time / 1000;\n\n $nb_minutes = $time_in_second / 60;\n $nb_seconds = $time_in_second % 60;\n\n $str_time = $nb_seconds.'s';\n\n if ($nb_minutes >= 60) {\n $nb_heures = $nb_minutes / 60;\n $nb_minutes = $nb_minutes % 60;\n $str_time = floor($nb_heures).'h '.$nb_minutes.'m '.$str_time;\t\t\t\t\t\t\t\t\t\n } else {\n $str_time = floor($nb_minutes).'m '.$str_time;\n }\t\t\n return $str_time;\n\n }", "function get_hora_meridiano($hora){\n\t$hora = explode(\":\",$hora);\n\t$h = $hora[0];\n\t$m = $hora[1];\n\tif($h > 12){\n\t\t$h = $h - 12;\n\t\tif($h < 10){\n\t\t\t$h = '0'.$h;\n\t\t}\n\t\t$h = $h.':'.$m.' pm';\t\t\n\t}else{\n\t\tif($h == 12){\n\t\t\t$h = $h.':'.$m.' m';\n\t\t}else{\n\t\t\t$h = $h.':'.$m.' am';\n\t\t}\t\t\n\t}\n\treturn $h;\n}", "function milisecond_to_time($time) {\n $hours = gmdate(\"H\", $time / 1000);\n $mins = gmdate(\"i\", $time / 1000);\n $seconds = gmdate(\"s\", $time / 1000);\n if($hours > 24) {\n $tags = Math.floor($hours/24);\n $hours = $hours % 24;\n }\n $res = \"$hours:$mins:$seconds\";\n return $res;\n }", "function tiemposHMS($min){\n $min=(int)$min;\n $heure=(int)($min/60);\n $minute=(($min/60)-$heure)*60; \n return $heure .':' . $minute; \n \n \n \n }", "function hms($duree = 0) \n\t{\n\t\t$heures = round($duree / 3600);\n\t\t$minutes = round(($duree - $heures * 3600) / 60);\n\t\t$secondes = round(($duree - $heures * 3600 - $minutes * 60) / 60);\n\n\t\treturn str_pad($heures, 2, \"0\", STR_PAD_LEFT).':'.str_pad($minutes, 2, \"0\", STR_PAD_LEFT).':'.str_pad($secondes, 2, \"0\", STR_PAD_LEFT);\n\t}", "function convertTime($number)\n{\n $str_arr = explode('.', $number);\n\n $num = ($str_arr[0]);\n //floatval\n $point = ($str_arr[1]);\n $count = strlen($str_arr[1]);\n\n if ($count == 1 && $point < 10) {\n $point = $point * 10;\n }\n\n while ($point >= 60) {\n $num = $num + 1;\n $point = $point - 60;\n }\n $t = floatval($num . \".\" . $point);\n\n return $t;\n}", "function formatear_hora($parametro){\n\n\t\t/* Declaro variables personalizadas para que queden claros los datos */\n\t\t$hora = substr($parametro, 11, 2);\n\t\t$minuto = substr($parametro, 14, 2);\n\t\t$dia = substr($parametro, 8, 2);\n\t\t$mes = substr($parametro, 5, 2);\n\t\t\n\t\t/* Generamos el formato */\n\t\t$temp = $hora.\":\".$minuto;\n\t\t\n\t\treturn $temp;\n\t}", "function timeConversion($s) {\n /*\n * Write your code here.\n */\n $tim = \"\";\n $arr = preg_split(\"/[:]/\",$s);\n\n if( preg_match( '/AM$/', $arr[2]) ) {\n $replace = str_replace('AM', '', $arr[2]);\n if($arr[0] === \"12\"){\n $arr[0] = \"00\";\n }\n }else{ // PM\n $replace = str_replace('PM', '', $arr[2]);\n\n if($arr[0] !== \"12\"){\n $arr[0] = strval(intval($arr[0]) + 12);\n }\n }\n $arr[2] = $replace;\n return $arr[0] .\":\". $arr[1] .\":\". $arr[2];\n}", "function get_hh_mm($seconds) {\n $hours = floor($seconds / 60 / 60);\n $remaining_seconds = $seconds - ($hours * 60 * 60);\n $minutes = floor($remaining_seconds / 60);\n $f_hours = strlen($hours) == 1 ? \"0$hours\" : $hours;\n $f_minutes = strlen($minutes) == 1 ? \"0$minutes\" : $minutes;\n return \"$f_hours:$f_minutes\";\n}", "function m2h($mins) {\n if ($mins < 0)\n $min = abs($mins); \n else\n $min = $mins; \n \n // Arredonda a hora\n $h = floor($min / 60); \n $m = ($min - ($h * 60)) / 100; \n $horas = $h + $m; \n \n // Matemática da quinta série\n // Detalhe: Aqui também pode se usar o abs()\n if ($mins < 0)\n $horas *= -1; \n \n // Separa a hora dos minutos\n $sep = explode('.', $horas); \n $h = $sep[0]; \n if (empty($sep[1]))\n $sep[1] = 0; \n \n $m = $sep[1]; \n \n // Aqui um pequeno artifício pra colocar um zero no final\n if (strlen($m) < 2)\n $m = $m . 0; \n if($h > 0){\n\t\t\treturn sprintf('%2dh e %2dm', $h, $m);\n }else{\n\t\t\treturn sprintf('%2dm', $m);\n\t\t}\t\n}", "function minutos2horas($mins) {\nif ($mins < 0)\n\t$min = abs($mins);\nelse\n\t$min = $mins;\n \n$h = floor($min / 60);\n$m = ($min - ($h * 60)) / 100;\n$horas = $h + $m;\n \nif ($mins < 0)\n\t$horas *= -1;\n\n$sep = explode('.', $horas);\n$h = $sep[0];\nif (empty($sep[1]))\n\t$sep[1] = 00;\n\t$m = $sep[1];\n \nif (strlen($m) < 2)\n\t$m = $m . 0;\nreturn $h.':'.$m;\n }", "function getMois($date){\r\n\t\t@list($jour,$mois,$annee) = explode('/',$date);\r\n\t\tif(strlen($mois) == 1){\r\n\t\t\t$mois = \"0\".$mois;\r\n\t\t}\r\n\t\treturn $annee.$mois;\r\n}", "function time2D4($time){\n if ( strlen($time) <= 3 )\n $time = sprintf('%04d', $time);\n\n $result = array(\n 'hh' => '00',\n 'mm' => '00'\n );\n\n if ( strlen($time) == 4 ) {\n $result['hh'] = substr($time, 0, 2);\n $result['mm'] = substr($time, 2, 2);\n }\n\n return $result;\n }", "function primeiroDiaMes($data, $formato) {\r\n list($dia, $mes, $ano) = explode('/', $data);\r\n return date($formato, mktime(0, 0, 0, $mes, \"01\", $ano));\r\n /* if ($formato == \"1\") { //formato 1 = retorna dia/mes/ano\r\n return \"01/\".$mes.\"/\".$ano;\r\n } else { //formato 2 = retorna ano-mes-dia\r\n return $ano.\"-\".$mes.\"-01\";\r\n } */\r\n }", "function Fecha_mes_n($Ingresomes_c){\t\n$mes_mes_c = new DateTime($Ingresomes_c);\n$me = $mes_mes_c->format('m');\n$mes='';\nif($me=='01') $mes='01';\nif($me=='02') $mes='02';\nif($me=='03') $mes='03';\nif($me=='04') $mes='04';\nif($me=='05') $mes='05';\nif($me=='06') $mes='06';\nif($me=='07') $mes='07';\nif($me=='08') $mes='08';\nif($me=='09') $mes='09';\nif($me=='10') $mes='10';\nif($me=='11') $mes='11';\nif($me=='12') $mes='12';\n$cadena = (\"$mes\");\nreturn $cadena;\n}", "function Fecha_mes_n2($Ingresomes_c){\t\n$mes_mes_c = new DateTime($Ingresomes_c);\n$mes = $mes_mes_c->format('m');\nreturn $mes;\n}", "function sec2hms ($sec, $padHours = false) \n {\n\n $hours = intval(intval($sec) / 3600);\n $minutes = intval(($sec / 60) % 60);\n $seconds = intval($sec % 60); \n\t\n\t\n $hms = ($padHours?str_pad($hours, 2, \"0\", STR_PAD_LEFT):$hours). ':'.\n\t\t\tstr_pad($minutes, 2, \"0\", STR_PAD_LEFT). ':'.\n\t\t\tstr_pad($seconds, 2, \"0\", STR_PAD_LEFT);\n\n return $hms;\n \n }", "function msecsToTime($content)\n{\n\t$secs = floor($content / 1000);\n\t$mins = floor($secs / 60);\n\t$hours = floor($mins / 60);\n\t$secs = $secs % 60;\n\t$mins = $mins % 60; \n\tif (strlen($mins) < 2) $mins = \"0\" . $mins;\n\treturn \"$hours\" . \":\" . \"$mins\";\n}", "function convertMoeda(&$valorMoeda){\r\n\t\t$valorMoedaAux = explode('.' , $valorMoeda);\r\n\t\tif(isset ($valorMoedaAux[1])){\r\n\t\t\t$valorMoeda= \"R$ \".$valorMoedaAux[0].','.$valorMoedaAux[1];\r\n\t\t}else{\r\n\t\t\t$valorMoeda = \"R$ \".$valorMoedaAux[0].','.'00';\r\n\t\t}\r\n\t\treturn $valorMoeda;\r\n\t}", "function getMois($date)\r\n{\r\n @list ($jour, $mois, $annee) = explode('/', $date);\r\n unset($jour);\r\n if (strlen($mois) == 1) {\r\n $mois = '0' . $mois;\r\n }\r\n return $annee . $mois;\r\n}", "function Fecha_mes_c($Ingresomes_c){\t\n$mes_mes_c = new DateTime($Ingresomes_c);\n$me = $mes_mes_c->format('m');\n$mes='';\nif($me=='01') $mes='Ene';\nif($me=='02') $mes='Feb';\nif($me=='03') $mes='Mar';\nif($me=='04') $mes='Abr';\nif($me=='05') $mes='May';\nif($me=='06') $mes='Jun';\nif($me=='07') $mes='Jul';\nif($me=='08') $mes='Ago';\nif($me=='09') $mes='Sep';\nif($me=='10') $mes='Oct';\nif($me=='11') $mes='Nov';\nif($me=='12') $mes='Dic';\n$cadena = (\"$mes\");\nreturn $cadena;\n}", "function format_time($secs) {\n\t\t $times = array(3600, 60, 1);\n\t\t $time = '';\n\t\t $tmp = '';\n\t\t for($i = 1; $i < 3; $i++) {\n\t\t\t $tmp = floor($secs / $times[$i]);\n\t\t\t if($tmp < 1) {\n\t\t\t\t $tmp = '00';\n\t\t\t }\n\t\t\t elseif($tmp < 10) {\n\t\t\t\t $tmp = '0' . $tmp;\n\t\t\t }\n\t\t\t $time .= $tmp;\n\t\t\t if($i < 2) {\n\t\t\t\t $time .= ':';\n\t\t\t }\n\t\t\t $secs = $secs % $times[$i];\n\t\t }\n\t\t return $time;\n\t\t}", "function sec2time ($sec) {\n $sec = (int) $sec;\n $time = ''; $h = 0;\n if ($sec >= 3600 ) {\n $h = (int) ($sec / 3600);\n if ($h > 0) { $time .= $h.':'; }\n $sec = $sec - $h*3600;\n }\n $m = (int) ($sec / 60);\n if ($h == 0) { $time .= $m.':'; }\n else { $time .= sprintf(\"%02d\", $m).':'; };\n if ($m > 0) { $sec = $sec - $m*60; }\n $time .= sprintf(\"%02d\", $sec);\n return $time;\n}", "public function getMoisSuivant($mois)\n {\n $numAnnee = substr($mois, 0, 4);\n $numMois = substr($mois, 4, 2);\n if ($numMois == \"12\") {\n $numMois = \"01\";\n $numAnnee++;\n } else {\n $numMois++;\n }\n if (strlen($numMois) == 1)\n $numMois = \"0\" . $numMois;\n return $numAnnee . $numMois;\n }", "function tambahWaktu2($jam_mulai,$jam_selesai){\n//echo \"<br>\";\n//echo \"Jam Selesai : \".$jam_selesai='09:45:01';\n//echo \"<br>\";\n $times = array($jam_mulai,$jam_selesai);\n//$times = array('08:30:22','09:45:53');\n $seconds = 0;\n foreach ( $times as $time )\n {\n \tlist( $g, $i, $s ) = explode( ':', $time );\n \t$seconds += $g * 3600;\n \t$seconds += $i * 60;\n \t$seconds += $s;\n \n \n }\n $hours = floor( $seconds / 3600);\n if($hours<10){\n $hours='0'.$hours;\n }\n \n $seconds -= $hours * 3600;\n $minutes = floor( $seconds / 60);\n if($minutes<10){\n $minutes='0'.$minutes;\n }\n \n $seconds -= $minutes * 60; \n if($seconds<10){\n $seconds='0'.$seconds;\n } \n \n $waktu2=\"{$hours}:{$minutes}:{$seconds}\";\n return $waktu2;\n \n}", "function pasarATiempoFormato($tiempo) {\n $minutos = (int) ($tiempo / 3600);\n $milisegundos = (int) ($tiempo % 3600);\n\n $segundos = (int) ($milisegundos / 60);\n $milisegundos = (int) ($milisegundos % 60);\n\n return \"$minutos:$segundos:$milisegundos\";\n }", "function ultimoDiaMes($data, $formato) {\r\n list($dia, $mes, $ano) = explode('/', $data);\r\n return date($formato, mktime(0, 0, 0, $mes + 1, 0, $ano));\r\n }", "function sec2hms ($sec, $padHours = false) \n {\n\n // start with a blank string\n $hms = \"\";\n \n $minutes = intval(($sec / 60) % 60); \n\n // add minutes to $hms (with a leading 0 if needed)\n $hms .= str_pad($minutes, 2, \"0\", STR_PAD_LEFT). \":\";\n\n // seconds past the minute are found by dividing the total number of seconds\n // by 60 and using the remainder\n $seconds = intval($sec % 60); \n\n // add seconds to $hms (with a leading 0 if needed)\n $hms .= str_pad($seconds, 2, \"0\", STR_PAD_LEFT);\n\n // done!\n return $hms;\n \n }", "function get_hora_bd($hora){\n\t$h = substr($hora,0,2);\n\t$m = substr($hora,3,2);\n\t$meridiano = substr($hora,-2,2);\n\tif($meridiano == 'pm'){\n\t\t$h = $h + 12;\n\t\t$h = $h.':'.$m.':00';\n\t}else{\n\t\t$h = $h.':'.$m.':00';\n\t}\n\treturn $h;\n}", "function calcula_numero_dia_semana($dia,$mes,$ano){\r\n\t$nrodiasemana = date('w', mktime(0,0,0,$mes,$dia,$ano));\r\n\treturn $nrodiasemana;\r\n}", "function calcula_numero_dia_semana($dia,$mes,$ano){\r\n\t$nrodiasemana = date('w', mktime(0,0,0,$mes,$dia,$ano));\r\n\treturn $nrodiasemana;\r\n}", "function time_compact_ap_format($hours,$minutes,$meridien){\r\n\t$patterns = array(\"am\",\"pm\",\"AM\",\"PM\");\r\n\t$replacements = array(\"a.m.\",\"p.m.\",\"A.M.\",\"P.M.\");\r\n\t\r\n\t$meridien = str_replace($patterns,$replacements,$meridien);\r\n\t\r\n\tif($minutes == \"00\") return sprintf(\"%s %s\",$hours,$meridien);\r\n\telse return sprintf(\"%s:%s %s\",$hours,$minutes,$meridien);\r\n}", "function getMois($date)\n{\n @list($jour, $mois, $annee) = explode('/', $date);\n unset($jour);\n if (strlen($mois) == 1) {\n $mois = '0' . $mois;\n }\n return $annee . $mois;\n}", "function formatTime($time){\n if(!$time){\n return '-';\n }\n $seconds = ($time/1000);//\n $minutes =floor($seconds / 60);\n $seconds = ($seconds % 60);//\n $hours = floor($seconds / 3600);\n\n return $hours.':'.$minutes.':'.$seconds;\n }", "public static function formatMS(float $seconds): string\n {\n $time = \\round($seconds * 1000, 3);\n $dec = 3;\n\n $decLevel01 = 0.1;\n $decLevel0 = 0;\n $decLevel1 = 1;\n $decLevel10 = 10;\n $decLevel100 = 100;\n\n if ($time === 0.0 || $time >= $decLevel10 || $time >= $decLevel100) {\n $dec = $decLevel0;\n } elseif ($time >= $decLevel01) {\n $dec = $decLevel1;\n }\n\n return \\number_format($time, $dec, '.', ' ') . ' ms';\n }", "function timeConversion($s) {\n /*\n * Write your code here.\n */\n $timeArray = explode(':', $s);\n $hour = $timeArray[0];\n $minute = $timeArray[1];\n $sec = $timeArray[2];\n $period = substr($sec, 2);\n $originalSec = rtrim($sec, $period);\n $newTime;\n if((0 <= $hour && $hour < 12) && ($period == 'AM')) {\n $newTime = $hour.\":\".$minute.\":\".$originalSec;\n }elseif ((0 <= $hour && $hour < 12) && ($period == 'PM')) {\n $newTime = 12+$hour.\":\".$minute.\":\".$originalSec;\n }elseif (($hour == 12) && ($period == 'AM')) {\n $newTime = \"00\".\":\".$minute.\":\".$originalSec;\n }elseif (($hour == 12) && ($period == 'PM')) {\n $newTime = $hour.\":\".$minute.\":\".$originalSec;\n }\n\n return $newTime; \n\n\n\n}", "static function string_format_time($time){\r\n $h = intval($time / 60);\r\n $min = $time % 60;\r\n $ret = '';\r\n\r\n if($h > 0){\r\n if($h == 1){\r\n $ret .= $h.' heure ';\r\n } else {\r\n $ret .= $h.' heures ';\r\n }\r\n }\r\n\r\n if($min > 0){\r\n $ret .= $min . ' minutes';\r\n }\r\n\r\n if($time == 0){\r\n $ret .= '0 heure';\r\n }\r\n\r\n return $ret;\r\n }", "static function convertTime($s_time){\n\t\tif(is_numeric($s_time))\n\t\t\treturn (int) $s_time;\n\n\t\t$a_time = array(\n\t\t\t's' => 1,\n\t\t\t'm' => 60,\n\t\t\t'h' => 3600,\n\t\t\t'd' => 86400\n\t\t);\n\t\t$s_time = trim(strtolower($s_time));\n\t\t$s_char = substr($s_time, -1);\n\t\t$i = substr($s_time,0, -1);\n\t\treturn isset($a_time[$s_char]) ?\n\t\t\t$i*$a_time[$s_char]:\n\t\t\t$i;\n\t}", "function ultimoDiaMes($x_fecha_f){\r\n\techo \"entra a ultimo dia mes con fecha \".$x_fecha_f.\"<br>\";\r\n\t\t\t\t\t$temptime_f = strtotime($x_fecha_f);\t\r\n\t\t\t\t\t$x_numero_dia_f = strftime('%d', $temptime_f);\r\n\t\t\t\t\t$x_numero_mes_f = strftime('%m', $temptime_f);\r\n\t\t\t\t\techo \"numero mes\".$x_numero_mes_f.\"<br>\";\r\n\t\t\t\t\t$x_numero_anio_f = strftime('%Y', $temptime_f);\r\n\t\t\t\t\t$x_ultimo_dia_mes_f = strftime(\"%d\", mktime(0, 0, 0, $x_numero_mes_f+2, 0, $x_numero_anio_f));\r\n\techo \"el ultimo dia de mes es\".\t$x_ultimo_dia_mes_f .\"<br>\";\t\t\t\r\n\treturn $x_ultimo_dia_mes_f;\r\n}", "function sec2hms($sec, $padHours = false) {\r\n $hms = \"\";\r\n \r\n // do the hours first: there are 3600 seconds in an hour, so if we divide\r\n // the total number of seconds by 3600 and throw away the remainder, we're\r\n // left with the number of hours in those seconds\r\n $hours = intval(intval($sec) / 3600); \r\n\r\n // add hours to $hms (with a leading 0 if asked for)\r\n $hms .= ($padHours) \r\n ? str_pad($hours, 2, \"0\", STR_PAD_LEFT). \":\"\r\n : $hours. \":\";\r\n \r\n // dividing the total seconds by 60 will give us the number of minutes\r\n // in total, but we're interested in *minutes past the hour* and to get\r\n // this, we have to divide by 60 again and then use the remainder\r\n $minutes = intval(($sec / 60) % 60); \r\n\r\n // add minutes to $hms (with a leading 0 if needed)\r\n $hms .= str_pad($minutes, 2, \"0\", STR_PAD_LEFT). \":\";\r\n\r\n // seconds past the minute are found by dividing the total number of seconds\r\n // by 60 and using the remainder\r\n $seconds = intval($sec % 60); \r\n\r\n // add seconds to $hms (with a leading 0 if needed)\r\n $hms .= str_pad($seconds, 2, \"0\", STR_PAD_LEFT);\r\n\r\n // done!\r\n return $hms;\r\n \r\n}", "function horas_em_mintutos($hora)\n{\n\n if ($hora == '') {\n $hora = '00:00';\n }\n\n $h1 = explode(\":\", $hora);\n\n\n $minuto = $h1[1];\n $horas = $h1[0];\n\n\n if ($horas > 0) {\n\n if (substr($horas, 0, 1) == 0) {\n $horas = substr($horas, 1, 1);\n }\n\n $horas = $horas * 60;\n\n $minuto = $minuto + $horas;\n }\n\n\n\n\n return $minuto;\n}", "function turnTotalMinsIntoTime($totalMins) {\n $mins = intval($totalMins % 60);\n $hour = round((($totalMins - $mins) / 60),0);\n $mins = strlen($mins) < 2 ? \"0\".$mins : $mins;\n return $hour.\":\".$mins;\n}", "public static function toMs ($time)\n\t\t{\n\t\t\t// 06:23:16.213\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})[\\.:](\\d{3})/', $time, $match);\n\t\t\tif (count($match) == 5)\n\t\t\t\treturn (int) ( $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600 ) * 1000 + $match[ 4 ];\n\n\t\t\t// 06:23:16.21\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})[\\.:](\\d{2})/', $time, $match);\n\t\t\tif (count($match) == 5)\n\t\t\t\treturn ( $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600 ) * 1000 + $match[ 4 ] * 1000 / self::$fps;\n\n\t\t\t// 06:23:16\n\t\t\tpreg_match('/(\\d{2}):(\\d{2}):(\\d{2})/', $time, $match);\n\t\t\tif (count($match) == 4)\n\t\t\t\treturn ( $match[ 3 ] + $match[ 2 ] * 60 + $match[ 1 ] * 3600 ) * 1000;\n\n\t\t\treturn null;\n\t\t}", "function parse_ms_string( $ms_string ) {\n\n\tswitch ( strlen( trim( $ms_string ) ) ) {\n\t\tcase 0: return 0;\n\t\tcase 1: return $ms_string * 100;\n\t\tcase 2: return $ms_string * 10;\n\t\tdefault: return (int) substr( $ms_string, 0, 3 );\n\t}\n}", "function timeConversion($s) {\n return DATE(\"H:i:s\", STRTOTIME($s));\n\n}", "public static function timeunit(/* Long */ $time) {\n if ($time == null)\n return '';\n $sec = (int) $time % 60;\n $min = (int) ($time / 60) % 60;\n $hours = (int) ($time / 3600);\n return \"$hours:\" . sprintf('%02d', $min) . ':' . sprintf('%02d', $sec);\n }", "function convertir_hora_militar($seg_ini) {\n\n\t\t\t$horas = floor($seg_ini/3600);\n\t\t\t$minutos = floor(($seg_ini-($horas*3600))/60);\n\t\t\t\t\t\t\t\n\t\t\treturn $horas.\":\".$minutos;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "function hr_mjesec($month)\n{\n $mj_array[1] = 'Sijecanj';\n $mj_array[2] = 'Veljaca';\n $mj_array[3] = 'Ozujak';\n $mj_array[4] = 'Travanj';\n $mj_array[5] = 'Svibanj';\n $mj_array[6] = 'Lipanj';\n $mj_array[7] = 'Srpanj';\n $mj_array[8] = 'Kolovoz';\n $mj_array[9] = 'Rujan';\n $mj_array[10] = 'Listopad';\n $mj_array[11] = 'Studeni';\n $mj_array[12] = 'Prosinac';\n\n return $mj_array[$month];\n}", "function toS($t, $f = '%dh %dm') {\n if (intval($t) < 1) {\n\t\t\t\t return;\n\t\t\t }\n\t\t\t $h = floor($t/60);\n\t\t\t $m = $t%60;\n\t\t\t return sprintf($f, $h, $m);\n\t\t}", "function heure_to_minute($time)\n\t{\n\t\t$time = explode(':', $time);\n\t\treturn ($time[0]*60) + $time[1];\n\t}", "function obtener_mes($fecha) {\r\nreturn(substr($fecha,5,2));\r\n}", "function formatTime($tokenList)\n\t{\n\t\t$time = join(\" \",$tokenList);\t\t\n\n\t\t// if am/pm denoted as a or p, remove space between digit and a/p char\t\t\n\t\t$time = preg_replace(\"/([0-9]*[0-9]) (A|P) /i\", \" \\\\1\\\\2 \",$time);\n\t\t\n\t\t// compress small times like 8 - 5 or 8a - 5p\n\n\t\t$time = str_replace(\" - \",\"-\",$time);\n\t\t$time = str_replace(\"- \",\"-\",$time);\n\t\treturn $time;\t\t\n\t}", "function segundos_hhmm($seg) {\n $horas = floor($seg / 3600);\n $minutos = floor($seg / 60 % 60);\n $segundos = floor($seg % 60);\n\n return sprintf('%02d:%02d:%02d', $horas, $minutos, $segundos);\n }", "function convert_time($total)\n{\n return sprintf('%2d:%2d:%2d', intval($total/3600), intval($total/60) % 60, $total % 60);\n}", "function formatoMoneda($valor = NULL){\n\t\tif($valor){\n\n\t\t\t//retorno con valor S/.10,00\n\t\t\treturn 'S/.'. number_format($valor, 2, ',', '.');\n\n\t\t}\n\n\t}", "function obtener_minutos($fecha) {\r\nreturn(substr($fecha,14,2));\r\n}", "function getMois($date)\n{\n\t@list($jour, $mois, $annee) = explode('/', $date);\n\tif (strlen($mois) == 1) {\n\t\t$mois = \"0\" . $mois;\n\t}\n\treturn $annee . $mois;\n}", "function format_time($value, $event, $is_avg) {\n\tif ($event === \"333fm\" && $is_avg == false) return $value;\n\n\tif ($event === \"333mbf\") {\n\t\t$difference = 99 - intval(substr($value,-9,2));\n\t\t$missed = intval(substr($value,-1,2));\n\t\t$time = intval(substr($value,-7,5));\n\t\t$solved = $difference + $missed;\n\t\t$tried = $solved + $missed;\n\t\t$minutes = intval(intval($time) / 60);\n\t\t$seconds = intval($time) % 60;\n\t\tif ($minutes>0) $seconds = \"0\".$seconds;\n\t\treturn \"$solved/$tried $minutes:\".sprintf(\"%02d\",$seconds);\n\t}\n\n\t$minutes = intval(intval($value) / 6000);\n\t$seconds = (intval($value) % 6000) / 100;\n\n\tif ($minutes > 0) {\n\t\treturn \"$minutes:\".sprintf(\"%05.2f\",$seconds);\n\t}\n\n\treturn sprintf(\"%.2f\",$seconds);\n}", "function calc_chegada($partida,$tempo){\n \n \n $aux=split(\":\",$partida);\n\t\t$p=mktime($aux[0],$aux[1],$aux[2]);\n\n\t\t$aux=split(\":\",$tempo);\n\t\t$t=$aux[0]*3600+$aux[1]*60+$aux[2];\n\t\t\n\t\t$c=strftime(\"%H:%M:%S\",$p+$t);\n\t\t//echo \"$p<br>\";\n\t\t//echo \"$t<br>\";\n // echo $t+$p . \"<br>\";\n //echo \"$c<br>\";\n\t\t\n\t\treturn $c;\n }", "function SecondsToTimeNEW($inputTime) \n{\t\n\t//echo nl2br(\"Seconds are now: $Seconds \\n\");\n\t//HOUR\n\tif($inputTime>=(60*60))\n\t{\n\t\t$CaryOver=$inputTime%(60*60);\n\t\t$Hours=floor($inputTime/(60*60));\n\t\t$inputTime=$CaryOver;\n\t\t\n\t}\n //MIN\n\tif($inputTime>=60)\n\t{\n\t\t$CaryOver=$inputTime%60; //Remainder\n\t\t$Minutes=floor($inputTime/60);\n\t\t$inputTime=$CaryOver;\n\t\t//echo nl2br(\"Minutes are now: $CarryOver \\n\");\n\t\t\n\t}\n\t//SEC\n\t$Seconds=$inputTime;\n\t\t\n\t//NOW Correct the FORMAT\n\tif($Hours<10)\n\t{$Hours=\"0\".$Hours;}\t\n\tif($Minutes<10)\n\t{$Minutes=\"0\".$Minutes;}\n\tif($Seconds<10)\n\t{$Seconds=\"0\".$Seconds;}\n\t\n\t\n\treturn (\"$Hours:$Minutes:$Seconds\");\n}", "public static function min2str($min)\n {\n if ($min === null)\n return null;\n $m = $min % 60;\n $h = ($min - $m) / 60;\n return substr(100 + $h, 1) . ':' . substr(100 + $m, 1);\n }", "public static function formatTime($seconds){\n $time = \"\";\n // avoid dummi values\n if($seconds != \"n/a\"){\n $hours = floor($seconds / 3600);\n $mins = floor(($seconds - ($hours*3600)) / 60);\n $secs = floor(($seconds - ($hours*3600)) % 60);\n\n if($hours < 10)\n $hours = \"0\".$hours;\n if($mins < 10)\n $mins = \"0\".$mins;\n if($secs < 10)\n $secs = \"0\".$secs;\n\n $time = $hours.\":\".$mins.\":\".$secs;\n }\n else\n $time = \"n/a\";\n\n return $time; \n }", "function formatear_fecha_mes($parametro){\n\n\t\t/* Declaro variables personalizadas para que queden claros los datos */\n\t\t$mes = substr($parametro, 5, 2);\n\t\t$anno = substr($parametro, 0, 4);\n\t\tswitch($mes){\n\t\t\tcase 1: $mes = \"Enero\"; break;;\n\t\t\tcase 2: $mes = \"Febrero\"; break;;\n\t\t\tcase 3: $mes = \"Marzo\"; break;;\n\t\t\tcase 4: $mes = \"Abril\"; break;;\n\t\t\tcase 5: $mes = \"Mayo\"; break;;\n\t\t\tcase 6: $mes = \"Junio\"; break;;\n\t\t\tcase 7: $mes = \"Julio\"; break;;\n\t\t\tcase 8: $mes = \"Agosto\"; break;;\n\t\t\tcase 9: $mes = \"Septiembre\"; break;;\n\t\t\tcase 10: $mes = \"Octubre\"; break;;\n\t\t\tcase 11: $mes = \"Noviembre\"; break;;\n\t\t\tcase 12: $mes = \"Diciembre\"; break;;\n\t\t\tcase 13: $mes = \"Enero\"; $anno = $anno+1; break;;\n\t\t\tcase 14: $mes = \"Febrero\"; $anno = $anno+1; break;;\n\t\t\t\n\t\t}\n\t\t\n\t\t/* Generamos el formato */\n\t\t$temp = $mes.\" de \".$anno;\n\t\t\n\t\treturn $temp;\n\t}", "function hms2sec ($hms) {\n\tlist($h, $m, $s) = explode (\":\", $hms);\n\t$seconds = 0;\n\t$seconds += (intval($h) * 3600);\n\t$seconds += (intval($m) * 60);\n\t$seconds += (intval($s));\n\treturn $seconds;\n}", "function seconds_to_string($sec)\n {\n $hms = \"\";\n\t\t\n\t\t// for days\n\t\t$days = intval(intval($sec) / 86400);\n\t\t\n\t\t$hms .= ($days > 0) ? $days. \"d - \" : \"\";\n \n // do the hours first: there are 3600 seconds in an hour, so if we divide\n // the total number of seconds by 3600 and throw away the remainder, we're\n // left with the number of hours in those seconds\n $hours = intval(intval($sec / 3600) % 24);\n \n // add hours to $hms (with a leading 0 if asked for)\n $hms .= ($days == 0 && $hours == 0) ? \"\" : $hours. \"h - \";\n \n // dividing the total seconds by 60 will give us the number of minutes\n // in total, but we're interested in *minutes past the hour* and to get\n // this, we have to divide by 60 again and then use the remainder\n $minutes = intval(($sec / 60) % 60); \n \n // add minutes to $hms (with a leading 0 if needed) but only if minutes are not 0\n $hms .= ($days == 0 && $hours == 0 && $minutes == 0) ? \"\" : $minutes.\"m\";\n \n // seconds past the minute are found by dividing the total number of seconds\n // by 60 and using the remainder\n //$seconds = intval($sec % 60); \n \n // add seconds to $hms (with a leading 0 if needed)\n //$hms .= $seconds.\"s\";\n \n // if the total time is 0, show so\n\t\t$hms = empty($hms) ? 0 : $hms;\n\t\t\n\t\t// done!\n return $hms;\n }", "function humanReadableTime($seconds) {\n\n\t$hours = '00';\n\t$mins = '00';\n\n\tif ($seconds > 0) {\n\t\t$hours = str_pad(floor($seconds / 3600), 2, '0', STR_PAD_LEFT);\n\t\t$seconds %= 3600;\n\t}\n\n\tif ($seconds > 0) {\n\t\t$mins = str_pad(floor($seconds / 60), 2, '0', STR_PAD_LEFT);\n\t\t$seconds %= 60;\n\t}\n\n\t$seconds = str_pad($seconds, 2, '0', STR_PAD_LEFT);\n\n\n\treturn \"$hours:$mins:$seconds\";\n\n}", "public function meses_en_numeros($mes){\n switch ($mes) {\n case 'Ene':\n $mes2 = '01';\n break;\n case 'Febr':\n $mes2 = '02';\n break;\n case 'Mar':\n $mes2 = '03';\n break;\n case 'Abr':\n $mes2 = '04';\n break; \n case 'May':\n $mes2 = '05';\n break; \n case 'Jun':\n $mes2 = '06';\n break;\n case 'Jul':\n $mes2 = '07';\n break;\n case 'Ago':\n $mes2 = '08';\n break;\n case 'Sep':\n $mes2 = '09';\n break;\n case 'Oct':\n $mes2 = '10';\n break;\n case 'Nov':\n $mes2 = '11';\n break;\n case 'Dic':\n $mes2 = '12';\n break; \n default:\n # code...\n break;\n }\n return $mes2;\n }", "private function GetTimeHHMM() : string {\n\t\t\t$dt = new DateTime();\n\t\t\t$dtz = new DateTimeZone(\"EUROPE/Berlin\");\n\t\t\t$dt->setTimezone($dtz);\n\t\t\treturn $dt->format(\"H:i\");\n\t\t}", "function timeElapsed($sec){\n\n if( $sec <= 1 ) 'Agora mesmo';\n\n $date = [ 'ano' => 31536000,\n 'mes' => 2592000,\n 'dia' => 86400,\n 'hora' => 3600,\n 'minuto' => 60,\n 'segundo' => 1];\n \n foreach( $date as $name => $time ){\n $qtde = $sec / $time;\n if( $qtde >= 1 ) return 'há ' . floor( $qtde ) . ' ' . $name . ($qtde > 2 ? 's' : '');\n }\n\n }", "function get_hh_ss($seconds) {\n $hours = floor($seconds / 60 / 60);\n $minutes = floor(($seconds - ($hours * 60 * 60)) / 60);\n $d_seconds = $seconds - (($hours * 60 * 60) + ($minutes * 60));\n $f_hours = strlen($hours) == 1 ? \"0$hours\" : $hours;\n $f_minutes = strlen($minutes) == 1 ? \"0$minutes\" : $minutes;\n $f_seconds = strlen($d_seconds) == 1 ? \"0$d_seconds\" : $d_seconds;\n return \"$f_hours:$f_minutes:$f_seconds\";\n}", "function to_time($string){\n $split = explode(':', $string);\n $front = $split[0];\n $back = $split[1];\n // am or pm\n $period = substr($back, -2);\n $back = substr($back, 0,2);\n\n if($period == 'PM' and $front != '12'){\n $front += 12;\n }\n\n return ((string)$front . \":\" . (string)$back . \":00\");\n }", "function convertToHoursMins($time, $format = '%02d:%02d')\n{\n if ($time < 1) {\n return;\n }\n $hours = floor($time / 60);\n $minutes = ($time % 60);\n return sprintf($format, $hours, $minutes);\n}", "function conv12to24($arg1) {\n\t\t//check if single hour, if so add a 0 in front\n\t\t$arr1 = explode(\":\",$arg1);\n\t\t$hour = $arr1[0];\n\t\tif(strlen($arr1[0]) == 1) {\n\t\t\t$hour = '0'.$hour;\n\t\t}\n\t\t//Check if am or pm\n\t\t$arr2 = str_split($arr1[1],2);\n\t\t$min = $arr2[0];\n\t\tif($arr2[1] == 'pm') {\n\t\t\t$hour += 12;\n\t\t}\n\t\treturn $hour.\":\".$min;\n\t}", "public function dureehm(int $enMinutes)\n {\n $resultat = \"\";\n if ($enMinutes < 60) { $resultat = strval($enMinutes).\"mn\"; }\n else\n {\n $nbHeures = 0;\n $nbminutes = $enMinutes;\n while ($nbminutes >= 60)\n {\n $nbminutes -= 60;\n $nbHeures += 1;\n }\n $resultat = strval($nbHeures) . \"h\";\n if ($nbminutes > 0) $resultat .= \" \".strval($nbminutes).\"mn\";\n }\n return $resultat;\n }", "public function format(): string\n {\n foreach ($this->times as $unit => $value) {\n if ($this->time >= $value) {\n $time = floor($this->time / $value * 100) / 100;\n return \"{$time} {$unit}\";\n }\n }\n\n return round($this->time * 1000) . \" ms\";\n }", "function DIA_DE_LA_SEMANA($_FECHA) {\r\n\t// primero creo un array para saber los días de la semana\r\n\t$dias = array(0, 1, 2, 3, 4, 5, 6);\r\n\t$dia = substr($_FECHA, 0, 2);\r\n\t$mes = substr($_FECHA, 3, 2);\r\n\t$anio = substr($_FECHA, 6, 4);\r\n\t\r\n\t// en la siguiente instrucción $pru toma el día de la semana, lunes, martes,\r\n\t$pru = strtoupper($dias[intval((date(\"w\",mktime(0,0,0,$mes,$dia,$anio))))]);\r\n\treturn $pru;\r\n}", "function Fecha_mes($Ingresomes){\t\n$mes_mes = new DateTime($Ingresomes);\n$me = $mes_mes->format('m');\n$mes='';\nif($me=='01') $mes='Enero';\nif($me=='02') $mes='Febrero';\nif($me=='03') $mes='Marzo';\nif($me=='04') $mes='Abril';\nif($me=='05') $mes='Mayo';\nif($me=='06') $mes='Junio';\nif($me=='07') $mes='Julio';\nif($me=='08') $mes='Agosto';\nif($me=='09') $mes='Septiembre';\nif($me=='10') $mes='Octubre';\nif($me=='11') $mes='Noviembre';\nif($me=='12') $mes='Diciembre';\n$cadena = (\"$mes\");\nreturn $cadena;\n}", "function time_to_secs($time)\n{\n$timeArr = array_reverse(split(\":\", $time));\n$seconds = 0;\n$vals = Array(1, 60, 3600, 86400);\nforeach($timeArr as $key => $value)\n{\nif(!isset($vals[$key]))\nbreak;\n$seconds += $value * $vals[$key];\n}\nreturn $seconds;\n}", "function totalSecond($hh1, $mm1, $ss1 = '0', $hh2, $mm2, $ss3 = '0')\n {\n $seconds = mktime($hh1, $mm1, $ss1) - mktime($hh2, $mm2, $ss3);\n return $seconds;\n }", "function DiaSemanaExtenso($data){\n\t$ano = substr($data, 0, 4);\n\t$mes = substr($data, 5, -3);\n\t$dia = substr($data, 8, 9);\n\t$diasemana = date(\"w\", mktime(0, 0, 0, $mes, $dia, $ano));\n switch ($diasemana) { \n \tcase 0 : $semana = 'Domingo';\t\t\t\tbreak;\n case 1 : $semana = 'Segunda-Feira';\t\t\tbreak; \n case 2 : $semana = 'Terça-Feira';\t\t\tbreak; \n case 3 : $semana = 'Quarta-Feira';\t\t\tbreak; \n case 4 : $semana = 'Quinta-Feira';\t\t\tbreak; \n case 5 : $semana = 'Sexta-Feira';\t\t\tbreak; \n case 6 : $semana = 'Sábado';\t\t\t\tbreak; \n } \n return $semana; \n}", "function getMois($date): string\n {\n @list($jour, $mois, $annee) = explode('/', $date);\n unset($jour);\n if (strlen($mois) == 1) {\n $mois = '0' . $mois;\n }\n return $annee . $mois;\n }", "function seconds_to_time( $seconds, $format = 'H:m:s' ) {\n\t// extract hours\n\t$hours = floor($seconds / (60 * 60));\n\t\n\t// extract minutes\n\t$divisor_for_minutes = $seconds % ( 60 * 60 );\n\t$minutes = floor( $divisor_for_minutes / 60 );\n\t\n\t// extract the remaining seconds\n\t$divisor_for_seconds = $divisor_for_minutes % 60;\n\t$seconds = ceil( $divisor_for_seconds );\n\t\n\t$format = str_replace( 'H', str_pad( $hours, 2, \"0\", STR_PAD_LEFT ), $format );\n\t$format = str_replace( 'm', str_pad( $minutes, 2, \"0\", STR_PAD_LEFT ), $format );\n\t$format = str_replace( 's', str_pad( $seconds, 2, \"0\", STR_PAD_LEFT ), $format );\n\t\n\treturn $format;\n\t\n}", "function DurationFormat($mins) {\n if ($mins <=90 ) return \"$mins minutes\";\n return (int)($mins/60) . \" hours \" . (($mins%60) ? (($mins%60) . \" minutes\") : \"\");\n}", "public static function transformatorUscatJT(){\n $joasaTensiune=array(\n \"loj\" => Converter::from('length.mm')->to('length.m')->convert(1.5)->getValue(),\n \"g_oj\" => Converter::from('length.mm')->to('length.m')->convert(1)->getValue(),\n //2*0.5carton mm\n \"aoj\" => Converter::from('length.mm')->to('length.m')->convert(10)->getValue(),\n );\n return $joasaTensiune;\n }", "private function _getMillisecond()\n {\n\n list($s1, $s2) = explode(' ', microtime());\n return (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000);\n }", "function displayMontant($val) {\n if( $val < 1000 ) return $val;\n $val = $val/1000;\n if( $val < 1000 ) return \"${val} K\";\n $val = $val/1000;\n return \"${val} M\";\n}", "public function mes(){\n\n\t\t$date = $this->dia;\n $date = DateTime::createFromFormat('Y-m-d', $date);\n \t \n\t\treturn $date->format('m') - 1;\n\t}", "function time2string($timestamp=''){\n $meses = array('01' => 'enero','02'=>'febrero','03'=>'marzo','04'=>'abril','05'=>'mayo','06'=>'junio','07'=>'julio','08'=>'agosto','09'=>'septiembre','10'=>'octubre','11'=>'noviembre','12'=>'diciembre');\n $partes = preg_split('/[\\s,-]+/',$timestamp);\n $fecha = $partes[2].' de '.$meses[$partes[1]].' de '.$partes[0].' a las '.$partes[3];\n return $fecha;\n}", "public static function format(float $milliSeconds): string\n {\n $times = [\n 'hour' => 60 * 60 * 1000,\n 'min' => 60 * 1000,\n 'sec' => 1000,\n ];\n\n $time = \\round($milliSeconds * 1000);\n $minValue = 1.0;\n\n foreach ($times as $unit => $value) {\n if ($time >= $value) {\n $time = \\floor($time / $value * 100.0) / 100.0;\n\n return $time . ' ' . $unit . ($time === $minValue ? '' : 's');\n }\n }\n\n return $time . ' ms';\n }", "function time_duration($seconds = '', $use = null, $zeros = false)\n{\n\n // Define time periods\n $periods = array (\n 'years' => 31556926,\n 'Months' => 2629743,\n 'weeks' => 604800,\n 'days' => 86400,\n 'hours' => 3600,\n 'minutes' => 60,\n 'seconds' => 1\n );\n \n // Break into periods\n $seconds = (float) $seconds;\n $segments = array();\n foreach ($periods as $period => $value) {\n if ($use && strpos($use, $period[0]) === false) {\n continue;\n }\n $count = floor($seconds / $value);\n if ($count == 0 && !$zeros) {\n continue;\n }\n $segments[strtolower($period)] = $count;\n $seconds = $seconds % $value;\n }\n \n // Build the string\n $string = array();\n foreach ($segments as $key => $value) {\n $segment_name = substr($key, 0, -1);\n $segment = $value . ' ' . $segment_name;\n if ($value != 1) {\n $segment .= 's';\n }\n $string[] = $segment;\n }\n \n return implode(', ', $string);\n}", "function getrsstime($d) \r\n{ \r\n $parts=explode(' ',$d); \r\n $month=$parts[2]; \r\n $monthreal=getmonth($month);\r\n $time=explode(':',$parts[4]); \r\n $date=\"$parts[3]-$monthreal-$parts[1] $time[0]:$time[1]:$time[2]\"; \r\n return $date;\r\n}", "function format($seconds) {\r\n\t$days = floor($seconds / 86400);\r\n\tif ($days > 0) {\r\n\t\t$seconds -= $days * 86400;\r\n\t}\r\n\t$hours = floor($seconds / 3600);\r\n\tif ($days > 0 || $hours > 0) {\r\n\t\t$seconds -= $hours * 3600;\r\n\t}\r\n\t$minutes = floor($seconds / 60);\r\n\tif ($days > 0 || $hours > 0 || $minutes > 0) {\r\n\t\t$seconds -= $minutes * 60;\r\n\t}\r\n\tif ($hours < 10) $hours = '0'. $hours;\r\n\tif ($minutes < 10) $minutes = '0'.$minutes;\r\n\tif ($seconds < 10) $seconds = '0'.$seconds;\r\n\tif ($days > 0) {\r\n\t\treturn sprintf('%sj %sh %sm %ss', (string)$days, (string)$hours, (string)$minutes, (string)$seconds);\r\n\t} elseif ($hours > 0) {\r\n\t\treturn sprintf('%sh %sm %ss', (string)$hours, (string)$minutes, (string)$seconds);\r\n\t} elseif ($minutes > 0) {\r\n\t\treturn sprintf('%sm %ss', (string)$minutes, (string)$seconds);\r\n\t} else {\r\n\t\treturn sprintf('%ss', (string)$seconds);\r\n\t}\r\n}", "function quita_segundos($hora)\n{\n\t$sin_sec=explode(\":\",$hora);\n\t$final = $sin_sec[0].\":\".$sin_sec[1];\n\treturn $final;\n}", "static function time($value){\n\t\t$separator = \":\";\n\t\t$value = substr($value, 0, 8);\n\t\tif((strlen($value) == 8) && (substr($value, 2, 1) == $separator) && (substr($value, 5, 1) == $separator)){\n\t\t\t$hou = (int) substr($value, 0, 2);\n\t\t\t$min = (int) substr($value, 3, 2);\n\t\t\t$sec = (int) substr($value, 6, 2);\n\t\t}elseif((strlen($value) == 5) && (substr($value, 2, 1) == $separator)){\n\t\t\t$hou = (int) substr($value, 0, 2);\n\t\t\t$min = (int) substr($value, 3, 2);\n\t\t\t$sec = 0;\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t\tif(($hou < 0 || $hou > 23) || ($min < 0 || $min > 59) || ($sec < 0 || $sec > 59)){\n\t\t\treturn null;\n\t\t}else{\n\t\t\treturn str_pad($hou, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($min, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($sec, 2, \"0\", STR_PAD_LEFT);\n\t\t}\n\t}", "function timeFormat($string1, $string2, $string3){\n if ($string1 >=0 && $string1 <=9){\n $string1 = 0 . $string1;\n }\n if ($string2 >=0 && $string2 <=9){\n $string2 = 0 . $string2;\n }\n if ($string3 >=0 && $string2 <=9){\n $string3 = 0 . $string3;\n }\n return $string1 . \":\" . $string2 .\":\" . $string3;\n}", "function mesec($rBrMeseca)\n{\nswitch($rBrMeseca)\n{\n case ($rBrMeseca % 12 == 1):\n echo \"januar\";\n break;\n case ($rBrMeseca % 12 == 2):\n echo \"februar\";\n break;\n case ($rBrMeseca % 12 == 3):\n echo \"mart\";\n break;\n case ($rBrMeseca % 12 == 4):\n echo \"april\";\n break;\n case ($rBrMeseca % 12 == 5):\n echo \"maj\";\n break;\n case ($rBrMeseca % 12 == 6):\n echo \"jun\";\n break;\n case ($rBrMeseca % 12 == 7):\n echo \"jul\";\n break;\n case ($rBrMeseca % 12 == 8):\n echo \"avgust\";\n break;\n case ($rBrMeseca % 12 == 9):\n echo \"septembar\";\n break;\n case ($rBrMeseca % 12 == 10):\n echo \"oktobar\";\n break;\n case ($rBrMeseca % 12 == 11):\n echo \"novembar\";\n break;\n case ($rBrMeseca % 12 == 0):\n echo \"decembar\";\n break;\n default:\n echo \"greska\";\n break; \n}\n}", "protected function processTime($time)\n {\n return \\PHPExcel_Style_NumberFormat::toFormattedString($time,'hh:mm:ss');\n }", "function timecheck ($time) {\n $min = 0;\n if($time->h >= 1) {\n $min += 60*$time->h;\n }\n $min += $time->i;\n if($min == 0) {\n return \"Passage en cours...\";\n } else {\n return $min.\" min\";\n }\n \n\n}", "function humanTiming ($time)\n {\n\n $time = time() - $time; // to get the time since that moment\n $time = ($time<1)? 1 : $time;\n $tokens = array (\n 31536000 => 'tahun',\n 2592000 => 'bulan',\n 604800 => 'minggu',\n 86400 => 'hari',\n 3600 => 'jam',\n 60 => 'menit',\n 1 => 'detik'\n );\n\n foreach ($tokens as $unit => $text) {\n if ($time < $unit) continue;\n $numberOfUnits = floor($time / $unit);\n return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');\n }\n\n }", "private function time_rule($time){\n $hour = floor($time/3600);//divisão retornando parte inteira.\n $hour_rest = fmod($time, 3600);//divisão retornando restante\n $min = floor($hour_rest/60); // calculo de minutos apartir do restante de horas\n $sec = fmod($hour_rest, 60); // calculos dos segundos\n return $this->number_format($sec,$min,$hour);\n }" ]
[ "0.7345122", "0.6892717", "0.64956605", "0.64817697", "0.64528304", "0.6447038", "0.63788664", "0.636109", "0.6325262", "0.62845004", "0.6275526", "0.6263237", "0.6252585", "0.62312263", "0.62256145", "0.62249804", "0.6181721", "0.61523277", "0.6103493", "0.60977066", "0.60817885", "0.6062273", "0.60466677", "0.6014039", "0.60119927", "0.6009471", "0.5998696", "0.59834856", "0.5978817", "0.59702635", "0.5958514", "0.5958514", "0.59564203", "0.5937903", "0.5928677", "0.59232247", "0.5922194", "0.59204566", "0.5912626", "0.58872885", "0.58850706", "0.5883769", "0.5872495", "0.5871182", "0.5866795", "0.5861637", "0.5857361", "0.5852767", "0.5844884", "0.58442897", "0.5836382", "0.5808762", "0.58063525", "0.5800951", "0.5792608", "0.57923615", "0.5786278", "0.5772918", "0.57677895", "0.5764521", "0.5761401", "0.5747267", "0.57377446", "0.57301223", "0.57296306", "0.5720229", "0.5706977", "0.5703464", "0.57027197", "0.5692459", "0.5690329", "0.56883764", "0.56882906", "0.56872076", "0.5675956", "0.56757665", "0.5675486", "0.567302", "0.5669143", "0.5666311", "0.5666018", "0.56622034", "0.56438226", "0.5641782", "0.5635696", "0.56349313", "0.5631081", "0.5620752", "0.56185275", "0.56147414", "0.56029874", "0.560196", "0.55962926", "0.55898327", "0.558528", "0.5582611", "0.5578756", "0.5575083", "0.5573988", "0.55681795", "0.5567766" ]
0.0
-1
Add document_root_prefix to href if needed Uses Application global
public static function href(Application $application, string $src): string { if (URL::valid($src)) { return $src; } $prefix = $application->documentRootPrefix(); if ($prefix) { return Directory::path($prefix, $src); } return $src; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function qa_path_to_root()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\tglobal $qa_root_url_relative;\n\treturn $qa_root_url_relative;\n}", "function get_root_url() {\n return \"http://\" . $_SERVER['HTTP_HOST'] . '/' . ROOT_PATH;\n }", "function _polylang_fix_sitemap_prefix( $prefix = '' ) {\n\t$path = parse_url( \\home_url(), PHP_URL_PATH );\n\treturn \\trailingslashit( \"$prefix$path\" );\n}", "public static function fix_document_root()\n {\n if (!serverv('PATH_INFO') || serverv('DOCUMENT_ROOT')) {\n return;\n }\n $_SERVER['DOCUMENT_ROOT'] = str_replace(\n $_SERVER['PATH_INFO']\n , ''\n , str_replace(\n '\\\\'\n , '/'\n , serverv('PATH_TRANSLATED'))\n ) . '/';\n }", "function getRootURI() {\n\t\treturn (implode('/', array_splice(explode('/', $_SERVER['SCRIPT_NAME']), 0, -1)) . '/');\n\t}", "public function prefixLocalAnchorsWithScript() {}", "private function getDocrootRegexpPrefix(): string\n {\n return $this->isWebRootSite() ? basename($this->getRoot()) . '/' : '';\n }", "protected function getRootUrl()\n {\n return $this->appConfig->getRootUrl();\n }", "public static function rootUrl() {\n\t\treturn self::$_scheme . self::$_host;\n\t}", "public static function getApplicationBaseURL()\n {\n if (self::$applicationBaseURL == null) {\n $dir = dirname($_SERVER[\"SCRIPT_NAME\"]);\n if ($dir == \"/\") $dir = \"\";\n self::$applicationBaseURL = $dir.\"/\";\n }\n return self::$applicationBaseURL;\n }", "public static function getSiteRoot() {\n if (strtolower($_SERVER['SERVER_NAME'])=='www.palmettonewmedia.com') {\n return Config::getHTTPS() . '://www.palmettonewmedia.com/foodfinder';\n }\n else {\n return Config::getHTTPS() . '://' . $_SERVER['SERVER_NAME'];\n }\n }", "public static function getServiceRoot() {\n if (strtolower($_SERVER['SERVER_NAME'])=='www.palmettonewmedia.com') {\n return Config::getHTTPS() . '://www.palmettonewmedia.com/foodfinder/service';\n }\n else {\n return Config::getHTTPS() .'://' . $_SERVER['SERVER_NAME'] . '/service';\n }\n }", "function rootSite() {\n // $dirname = preg_replace('/\\\\\\+/', '/', dirname(realpath($uri)));\n $dirname = preg_replace('/\\\\\\+/', '/', dirname($_SERVER['PHP_SELF']));\n if (substr($dirname, -1) == \"/\")\n $dirname = substr($dirname, 0, strlen($dirname) - 1); // remove / if it is there to be consistent for URL\n return $dirname;\n }", "public function getBaseURL(){\n\t\tif($this->htaccess){\n\t\t\treturn \"/\";\n\t\t}\n\t\treturn \"\";\n\t}", "protected static function generate_base_url()\n\t{\n\t\t$base_url = parent::generate_base_url();\n\t\treturn str_replace('htdocs/novius-os/', '', $base_url);\n\t}", "public static function getCoreRoot() {\n if (strtolower($_SERVER['SERVER_NAME'])=='www.palmettonewmedia.com') {\n return Config::getHTTPS() . '//www.palmettonewmedia.com/foodfinder/core';\n }\n else {\n return Config::getHTTPS() . '://' . $_SERVER['SERVER_NAME'] . '/core';\n }\n }", "public function root(): string\n {\n return rtrim($this->getSchemeAndHttpHost() . $this->getBaseUrl(), '/');\n }", "function get_root_blog_url($root = false) {\r\n\r\n\t$url = '';\r\n\r\n\tif (site_url() == 'http://localhost/sites/thechristiancrew') {\r\n\t\t$url = 'http://localhost/sites';\r\n\t} else {\r\n\t\t$url = site_url();\r\n\t}\r\n\r\n\treturn $url;\r\n\r\n}", "public function getBaseURL() {\n $url = $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';\n \n $url .= $_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']);\n \n return $url;\n }", "protected static function getDocumentRoot() {\n\t\treturn BootstrapConfig::getParam(\"document_root\", $_SERVER['DOCUMENT_ROOT']);\n\t}", "public function domainLink($base = null) \n\t{\n $config = Zend_Registry::get ( 'app_config' );\n\t\tif ($base == null)\n\t\t{\n\t\t\t$configModule = Zend_Registry::get ( 'config' );\n\t\t\tif (self::$_httpPath === null) {\n\t\t\t\tself::$_httpPath = $config['baseHttpPath'] \n\t\t\t\t\t. $configModule['httpPath'];\n\t\t\t}\n\t\t\t\n\t\t\treturn self::$_httpPath;\n\t\t}\n\t\telse if ($base == 1)\n\t\t{\n\t\t\tif (self::$_baseHttpPath === null) {\n\t\t\t\tself::$_baseHttpPath = $config['baseHttpPath'];\n\t\t\t}\n\t\t\treturn self::$_baseHttpPath;\n\t\t}\n else if ($base == 2)\n {\n return $config['baseHttpPath'] . $config['textEditorPrefix'];\n }\n else if ($base == 3)\n {\n return $config['baseHttpPath'] . $config['tableFridPrefix'];\n }\n\t}", "function href() {\n\t\t$usemodrewrite = polarbear_setting('usemodrewrite');\n\t\tif ($usemodrewrite) {\n\t\t\treturn $this->fullpath();\n\t\t} else {\n\t\t\treturn $this->templateToUse() . '?polarbear-page=' . $this->getId();\n\t\t}\n\t}", "public function setAbsRefPrefix() {}", "public function rootUrl($include_host = false)\n {\n if ($include_host) {\n return $this->root;\n }\n\n return Utils::replaceFirstOccurrence($this->base, '', $this->root);\n }", "function url_for($script_path) {\n\t\t// add the leading '/' if not present\n\t\tif($script_path[0] != '/') {\n\t\t\t$script_path = '/'. $script_path;\n\t\t}\n\t\treturn WWW_ROOT . $script_path;\n\t}", "public static function setDocRoot($docRoot = '')\n {\n self::$isDocRootSet = true;\n if ($docRoot) {\n $_SERVER['DOCUMENT_ROOT'] = $docRoot;\n } elseif (isset($_SERVER['SERVER_SOFTWARE'])\n && 0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/')) {\n $_SERVER['DOCUMENT_ROOT'] = substr(\n $_SERVER['SCRIPT_FILENAME']\n ,0\n ,strlen($_SERVER['SCRIPT_FILENAME']) - strlen($_SERVER['SCRIPT_NAME']));\n $_SERVER['DOCUMENT_ROOT'] = rtrim($_SERVER['DOCUMENT_ROOT'], '\\\\');\n }\n }", "protected function defineOriginalRootPath() {}", "public static function setFullUrl(): void\n\t{\n\t\t$requestUri = urldecode(Server::get('REQUEST_URI'));\n\t\tstatic::$fullUrl = rtrim(preg_replace('#^' . static::$scriptDirectory . '#', '', $requestUri), '/');\n\t}", "function root_relative_url($input) {\n preg_match('|https?://([^/]+)(/.*)|i', $input, $matches);\n if (!isset($matches[1]) || !isset($matches[2])) {\n return $input;\n } elseif (($matches[1] === $_SERVER['SERVER_NAME']) || $matches[1] === $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT']) {\n return wp_make_link_relative($input);\n } else {\n return $input;\n }\n}", "function getBaseUrl()\n{\n $doc_root_folders = utf8_explode(\"/\", $_SERVER['DOCUMENT_ROOT']);\n $cwd__folders = utf8_explode(\"/\", getcwd());\n //the difference between those is the path from doc root to the folder where\n //all files for this URI reside\n $path_from_doc_root = implode(\"/\", array_diff($cwd__folders, $doc_root_folders));\n return $_SERVER['HTTP_HOST'].'/'.$path_from_doc_root;\n}", "function url_for($script_path) {\n //add the leading '/' if not present\n if ($script_path[0] != '/') {\n $script_path = \"/\" . $script_path;\n }\n return WWW_ROOT . $script_path;\n }", "function getSiteURL()\n\t{\n\t return JURI::root();\n\t}", "static public function getRootPath() {\n\t\treturn Page::$base_path;\n\t}", "public static function getApacheDocLink()\n {\n return 'https://www.phusionpassenger.com/library/config/apache/reference/#passengerruby';\n }", "private function getBaseURL() {\n $pageURL = 'http';\n if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {\n $pageURL .= 's';\n }\n $pageURL .= '://';\n if ($_SERVER['SERVER_PORT'] !== '80') {\n $pageURL .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\n } else {\n $pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n }\n $splitted = explode('?', $pageURL);\n if (substr($splitted[0], -1) === '/') {\n return $splitted[0];\n }\n\n return $splitted[0] . '/';\n }", "public static function getDocroot() \n\t{\n\t\treturn MHTTPD::$config['Paths']['docroot'];\n\t}", "protected static function _getURI(){\n $root = str_replace('\\\\', '/', self::$_config['root']);\n $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n $uri = $_SERVER['DOCUMENT_ROOT'].$uri;\n $uri = str_replace($root, '', $uri);\n \n return $uri;\n }", "public function baseUrl($suffix = '') {\n $protocol = strpos($_SERVER['SERVER_SIGNATURE'], '443') !== false ? 'https://' : 'http://';\n //$web_root = $protocol . $_SERVER['HTTP_HOST'] . \"/\" . \"Dropbox/odesk/pos/\";\n if ($_SERVER['HTTP_HOST'] == \"localhost\") {\n $web_root = $protocol . $_SERVER['HTTP_HOST'] . \"/\" . \"ticketchai_aj/tc-merchant-template/\";\n } elseif ($_SERVER['HTTP_HOST'] == \"192.168.1.48\") {\n $web_root = $protocol . $_SERVER['HTTP_HOST'] . \"/\" . \"ticketchai_aj/tc-merchant-template/\";\n } else {\n $web_root = $protocol . $_SERVER['HTTP_HOST'] . \"/\" . \"\";\n }\n\n $suffix = ltrim($suffix, '/');\n return $web_root . trim($suffix);\n }", "public function getRealUrlAliasBase(): string;", "public function getBaseHref()\n {\n $path = $this->http_path;\n\n if( ! empty( $this->module ) && $this->module !== 'index' )\n {\n if( substr( $path, -1 ) !== '/' ) {\n $path .= '/' . $this->module;\n } else {\n $path .= $this->module;\n }\n }\n\n return $path;\n }", "public function baseRelPath()\n {\n if($this instanceof Layout)\n {\n $class = Application::getApp();\n }\n else\n {\n $class = \\get_class($this);\n }\n $reflector = new \\ReflectionClass($class);\n $parts = \\explode('\\\\', $reflector->getName());\n $parts = \\array_chunk($parts, 3, false);\n return \\strtolower(\\implode('/', $parts[0])) . '/';\n }", "static public function site_url( $url = '', $root = true ){\n\t\tif (strpos($url, 'http') === 0) return $url;\n\t\treturn esc_url( home_url() . '/' . ltrim( $url, '/' ) );\n\t}", "function prefix_path( $url ) {\n\t$scheme = wp_parse_url( $url, PHP_URL_SCHEME );\n\n\t// If it's just a path, prepend the base URL to validate.\n\tif ( is_null( $scheme ) ) {\n\t\treturn home_url( $url );\n\t}\n\n\treturn $url;\n}", "static function addAlias()\n\t{\n\t\tPie_Config::set('pie', 'aliases', '', APP_WEB_DIR);\n\t}", "function site_url()\n {\n return getenv('ROOT');\n }", "public function setAppBasePath($appRootPath=null){\n\n $this->appRootPath = $appRootPath;\n $_SERVER['APP_ROOT_PATH']= $this->appRootPath;\n\n }", "protected function _getPrefix()\n\t{\n\t\t$ret = '/';\n\n\t\tif(isset($this->_options['namespace'])) {\n\t\t\t$ret .= isset($this->_options['prefix']) ? $this->_options['prefix'] : $this->_options['namespace'];\n\t\t}\n\n\t\treturn $ret;\n\t}", "function get_self_link() {\n\t\t$host = @parse_url( home_url() );\n\t\treturn set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) );\n\t}", "function baseUrl(){\n return sprintf(\n \"%s://%s\",\n isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',\n $_SERVER['SERVER_NAME']\n );\n }", "function currentPageURL()\n{\n $pageURL = 'http';\n if (array_key_exists('HTTPS', $_SERVER) && $_SERVER['HTTPS'] == 'on') {\n $pageURL .= 's';\n }\n $pageURL .= '://';\n if ($_SERVER['SERVER_PORT'] != '80') {\n $pageURL .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\n } else {\n $pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n }\n return $pageURL;\n}", "public static function setBaseUrl(): void\n\t{\n\t\tstatic::$scriptDirectory = str_replace('\\\\', '/', dirname(Server::get('SCRIPT_NAME')));\n\t\t$protocol = Server::get('REQUEST_SCHEME') . '://';\n\t\t$hostname = Server::get('HTTP_HOST');\n\t\tstatic::$baseUrl = $protocol . $hostname . static::$scriptDirectory;\n\t}", "public function UrlBase(){\n\t\treturn URL_APP;\n\t}", "function get_theme_root_uri($stylesheet_or_template = '', $theme_root = '')\n {\n }", "public function get_base_url()\r\n\t\t{\r\n\t\t\t$url = \"http\";\r\n \t\t\tif ( isset( $_SERVER[ 'HTTPS' ] ) && $_SERVER[ 'HTTPS' ] == \"on\" ) $url .= \"s\";\r\n\t\t\t$url .= \"://\";\r\n \t\t\tif ( $_SERVER[ 'SERVER_PORT' ] != \"80\" )\r\n\t\t\t\t$url .= $_SERVER[ 'SERVER_NAME' ]. \":\" . $_SERVER[ 'SERVER_PORT' ] . $_SERVER[ 'REQUEST_URI' ];\r\n\t\t\telse\r\n\t\t\t\t$url .= $_SERVER[ 'SERVER_NAME' ] . \"/\";\r\n\t\t\t\r\n\t\t\treturn $url . self::HOME_DIR;\r\n\t\t}", "public function baseUrl($suffix = '') {\n $protocol = strpos($_SERVER['SERVER_SIGNATURE'], '443') !== false ? 'https://' : 'http://';\n//$web_root = $protocol . $_SERVER['HTTP_HOST'] . \"/\" . \"Dropbox/odesk/pos/\";\n if ($_SERVER['HTTP_HOST'] == \"localhost\") {\n $web_root = $protocol . $_SERVER['HTTP_HOST'] . \"/\" . \"ticketchaiorg/ticketchai_aj/merchant-dashboard/\";\n } elseif ($_SERVER['HTTP_HOST'] == \"192.168.1.48\") {\n $web_root = $protocol . $_SERVER['HTTP_HOST'] . \"/\" . \"ticketchaiorg/ticketchai_aj/merchant-dashboard/\";\n } \n elseif ($_SERVER['HTTP_HOST'] == \"ticketchai.org\" || $_SERVER['HTTP_HOST'] == \"https://ticketchai.com\" || $_SERVER['HTTP_HOST'] == \"http://ticketchai.com/\" ) {\n $web_root = $protocol . $_SERVER['HTTP_HOST'] . \"/\" . \"ticketchaiorg/merchant-dashboard/\";\n }else {\n $web_root = $protocol . $_SERVER['HTTP_HOST'] . \"/\" . \"ticketchaiorg/merchant-dashboard/\";\n }\n\n $suffix = ltrim($suffix, '/');\n return $web_root . trim($suffix);\n }", "public static function root_url($path = '', Array $params = [], $url_prefix = null) {\n $prepared_path = self::append_params_to_path($path, $params);\n\n // set url_prefix\n if($url_prefix == null) { $url_prefix = self::$url_prefix; }\n\n return $url_prefix . '://' . self::$root_url . $prepared_path;\n }", "public static function getServerDocroot() \n\t{\n\t\treturn MHTTPD::$config['Paths']['server_docroot'];\n\t}", "function url_for($script_path){\n\nif($script_path[0] != '/'){\n \n $script_path = \"/\" . $script_path;\n}\n\n//echo WWW_ROOT .$script_path;\n\n\nreturn WWW_ROOT . $script_path;\n\n}", "public static function getApplicationPath() \r\n {\r\n if (!isset(self::$appPath)) \r\n {\r\n switch ($_SERVER['HTTP_HOST']) {\r\n case 'localhost':\r\n self::$appPath = 'http://' . $_SERVER['HTTP_HOST'] . '/Progetto/';\r\n break;\r\n case 'spano.sc.unica.it':\r\n // configurazione pubblica\r\n self::$appPath = 'http://' . $_SERVER['HTTP_HOST'] . '/amm2015/meloniFabrizio/';\r\n break;\r\n default:\r\n self::$appPath = '';\r\n break;\r\n }\r\n }\r\n \r\n return self::$appPath;\r\n }", "function getBaseURI(){\n\t\n\treturn \"http://\" . $_SERVER[ 'HTTP_HOST' ] . dirname( $_SERVER[ 'PHP_SELF' ] );\n}", "function rest_get_url_prefix()\n {\n }", "public function baseUrl()\n\t{\n\t\techo $_SERVER['SERVER_NAME'];\n\t}", "function getAppUrl() {\r\n\r\n $url = getHost() . getAppPath();\r\n\r\n return $url;\r\n\r\n }", "public function uri($include_root = true)\n {\n if ($include_root) {\n return $this->uri;\n }\n\n return Utils::replaceFirstOccurrence($this->root_path, '', $this->uri);\n }", "function url_for($script_path) {\n\t// adds the leading '/' if it isn't already passed through the argument\n\tif($script_path[0] != '/') {\n\t\t$script_path = \"/\" . $script_path;\n\t}\n\treturn WWW_ROOT . $script_path;\n}", "protected function initCtrlHasAbsNamespace () {\n\t\tif (mb_strpos($this->controller, '//') === 0)\n\t\t\t$this->flags |= static::FLAG_CONTROLLER_ABSOLUTE_NAMESPACE;\n\t}", "public static function base(): string\n\t{\n\t\treturn sprintf(\n\t\t\t'%s://%s/%s',\n\t\t\tisset($_SERVER['SERVER_PROTOCOL']) && strpos($_SERVER['SERVER_PROTOCOL'], 'HTTPS') !== false ? 'https' : 'http',\n\t\t\t$_SERVER['SERVER_NAME'] ?? 'apache',\n\t\t\tself::PUBLIC_PATH\n\t\t);\n\t}", "function ngwp_echo_base_tag($prefix = '')\n\t{\n\t\techo '<base href=\"' . $prefix . '/' . ICL_LANGUAGE_CODE . '/\" />';\n\t}", "public function initialize(){ \n $protocol = 'http';\n $host = 'localhost';\n $path = '';\n $url = '';\n \n if (isset($_SERVER['HTTP_HOST'])) {\n $protocol = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';\n $host = $_SERVER['HTTP_HOST'];\n $path = str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);\n $url = $protocol.'://'.$host.$path;\n }\n \n $url = trim($url, '/');\n\n $request = $_SERVER[\"REQUEST_URI\"];\n $request = trim($request, '/'); \n $request = explode('?', $request); \n \n // Remove the folder segments from the uri if the application is warking in a subfolder.\n $parts = explode('/', $url);\n $this->segments = explode('/', $request[0]);\n foreach($this->segments as $key => $segment){\n if(in_array($segment, $parts)){\n unset($this->segments[$key]);\n }\n else{\n $this->segments[$key] = $this->sanitize($segment);\n }\n }\n // Re-index the segments\n $this->segments = array_values($this->segments);\n \n $this->url = $protocol.'://'.$host.'/'.$_SERVER[\"REQUEST_URI\"];\n \n return $this->url;\n }", "function Twiloop_url_base()\n{\n $url_base = '';\n $url_base = strrpos($_SERVER['PHP_SELF'], '/', -4)+1;\n $url_base = substr($_SERVER['PHP_SELF'], 0, $url_base);\n $url_base = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$url_base;\n return $url_base;\n}", "public function getDocumentRoot()\n {\n $documentRoot = '';\n $normalized = $this->getNormalized();\n if (empty($normalized['web']['locations'])) {\n return $documentRoot;\n }\n foreach ($this->getNormalized()['web']['locations'] as $path => $location) {\n if (isset($location['root'])) {\n $documentRoot = $location['root'];\n }\n if ($path === '/') {\n break;\n }\n }\n\n return ltrim($documentRoot, '/');\n }", "private static function setUristr() {\n $uri_request = HttpHelper::getUri();\n if(WEB_DIR != \"/\") {\n self::$uri = str_replace(WEB_DIR, \"\", $uri_request);\n } else {\n self::$uri = substr($uri_request, 1);\n }\n }", "function wpcom_vip_themes_root_uri() {\n\tif ( ! is_admin() ) {\n\t\treturn home_url( '/wp-content/themes' );\n\t} else {\n\t\treturn content_url( '/themes' );\n\t}\n}", "function url_for($script_path){\n\n if ($script_path[0] != '/') {\n $script_path = '/' . $script_path;\n }\n \n return WWW_ROOT . $script_path;\n \n}", "function bu($url='')\n{\n static $baseUrl;\n $baseUrl=Yii::app()->request->baseUrl;\n $baseUrl .= $baseUrl.'/'.ltrim($url,'/');\n if(param('root_control'))\n {\n $baseUrl = \"/\" . param('root_control') . $baseUrl;\n }\n return $baseUrl; \n}", "public static function getCoreServiceRoot() {\n if (strtolower($_SERVER['SERVER_NAME'])=='www.palmettonewmedia.com') {\n return Config::getHTTPS() . '://www.palmettonewmedia.com/foodfinder/core/service';\n }\n else {\n return Config::getHTTPS() .'://' . $_SERVER['SERVER_NAME'] . '/core/service';\n }\n }", "function at_remove_dup_canonical_link() {\t\n\tif ( is_home() ) {\n return false;\n }\t\t\n}", "public static function _getAppDir($noSlashes){\n return ($noSlashes) ? ltrim(self::APP_BASE_DIR,'/') : self::APP_BASE_DIR;\n }", "public function getBaseUrl(){\n $uri = self::getCurrentUri();\n $url = self::getCurrentPage();\n\n if ($uri !== '/') {\n $url = trim(str_replace($uri, '', $url), '/');\n }\n\n return self::addBackSlash($url);\n }", "public function getFullPath() {\n\n // check if this document is also the site root, if so return /\n try {\n if(Site::isSiteRequest()) {\n $site = Site::getCurrentSite();\n if ($site instanceof Site) {\n if ($site->getRootDocument()->getId() == $this->getId()) {\n return \"/\";\n }\n }\n }\n } catch (\\Exception $e) {\n \\Logger::error($e);\n }\n\n // @TODO please forgive me, this is the dirtiest hack I've ever made :(\n // if you got confused by this functionality drop me a line and I'll buy you some beers :)\n\n // this is for the case that a link points to a document outside of the current site\n // in this case we look for a hardlink in the current site which points to the current document\n // why this could happen: we have 2 sites, in one site there's a hardlink to the other site and on a page inside\n // the hardlink there are snippets embedded and this snippets have links pointing to a document which is also\n // inside the hardlink scope, but this is an ID link, so we cannot rewrite the link the usual way because in the\n // snippet / link we don't know anymore that whe a inside a hardlink wrapped document\n if(!\\Pimcore::inAdmin() && Site::isSiteRequest() && !FrontendTool::isDocumentInCurrentSite($this)) {\n\n $documentService = new Document\\Service();\n $parent = $this;\n while($parent) {\n if($hardlinkId = $documentService->getDocumentIdFromHardlinkInSameSite(Site::getCurrentSite(), $parent)) {\n $hardlink = Document::getById($hardlinkId);\n if(FrontendTool::isDocumentInCurrentSite($hardlink)) {\n\n $siteRootPath = Site::getCurrentSite()->getRootPath();\n $siteRootPath = preg_quote($siteRootPath);\n $hardlinkPath = preg_replace(\"@^\" . $siteRootPath . \"@\", \"\", $hardlink->getRealFullPath());\n\n return preg_replace(\"@^\" . preg_quote($parent->getRealFullPath()) . \"@\", $hardlinkPath, $this->getRealFullPath());\n break;\n }\n }\n $parent = $parent->getParent();\n }\n\n $config = \\Pimcore\\Config::getSystemConfig();\n $front = \\Zend_Controller_Front::getInstance();\n $scheme = ($front->getRequest()->isSecure() ? \"https\" : \"http\") . \"://\";\n if($site = FrontendTool::getSiteForDocument($this)) {\n if($site->getMainDomain()) {\n // check if current document is the root of the different site, if so, preg_replace below doesn't work, so just return /\n if ($site->getRootDocument()->getId() == $this->getId()) {\n return $scheme . $site->getMainDomain() . \"/\";\n }\n return $scheme . $site->getMainDomain() . preg_replace(\"@^\" . $site->getRootPath() . \"/@\", \"/\", $this->getRealFullPath());\n }\n }\n\n if ($config->general->domain) {\n return $scheme . $config->general->domain . $this->getRealFullPath();\n }\n }\n\n $path = $this->getPath() . $this->getKey();\n return $path;\n }", "protected function getWebRoot() {}", "protected function getWebRoot() {}", "public static function getBaseUrl ()\r\n\t{\r\n\t\t# Obtain the value\r\n\t\t$baseUrl = dirname (substr ($_SERVER['SCRIPT_FILENAME'], strlen ($_SERVER['DOCUMENT_ROOT'])));\r\n\t\t\r\n\t\t# Convert backslashes to forwarded slashes if necessary\r\n\t\t$baseUrl = str_replace ('\\\\', '/', $baseUrl);\r\n\t\t\r\n\t\t# Deal with the special case of an application at top-level\r\n\t\tif ($baseUrl == '/') {$baseUrl = '';}\r\n\t\t\r\n\t\t# Return the value\r\n\t\treturn $baseUrl;\r\n\t}", "private function absolutePathPrefix() : string {\n return DIRECTORY_SEPARATOR . implode(\n DIRECTORY_SEPARATOR,\n [\n 'app',\n 'storage',\n 'app'\n ]\n );\n }", "function url_for($script_path)\n{\n // Add a leading \"/\" if not present\n if ($script_path[0] != '/') {\n $script_path = '/' . $script_path;\n }\n return WWW_ROOT . $script_path;\n}", "function url_for($script_path) {\r\n // add the leading '/' if not present\r\n if($script_path[0] != '/') {\r\n $script_path = \"/\" . $script_path;\r\n }\r\n return WWW_ROOT . $script_path;\r\n}", "public function getBaseUrl() {\r\n\t\treturn home_url();\r\n\t}", "function urlForPath($script_path)\n{\n // Add the leading '/' if not present\n if ($script_path[0] != '/') {\n $script_path = '/' . $script_path;\n }\n return WWW_ROOT . $script_path;\n}", "protected function setInitialRootPath() {}", "function setUri() {\n\t\tif (env('HTTP_X_REWRITE_URL')) {\n\t\t\t$uri = env('HTTP_X_REWRITE_URL');\n\t\t} elseif(env('REQUEST_URI')) {\n\t\t\t$uri = env('REQUEST_URI');\n\t\t} else {\n\t\t\tif (env('argv')) {\n\t\t\t\t$uri = env('argv');\n\n\t\t\t\tif (defined('SERVER_IIS')) {\n\t\t\t\t\t$uri = BASE_URL . $uri[0];\n\t\t\t\t} else {\n\t\t\t\t\t$uri = env('PHP_SELF') . '/' . $uri[0];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$uri = env('PHP_SELF') . '/' . env('QUERY_STRING');\n\t\t\t}\n\t\t}\n\t\treturn $uri;\n\t}", "public function getUrlWithPrefix()\n {\n if (substr($this->url, 0, 1) === '/') {\n return '/' . $this->resourcePrefix . ltrim($this->url, '/');\n }\n return $this->resourcePrefix . $this->url;\n }", "function curr_url_domain()\n{\n return Request::root(true);\n}", "function ajan_core_get_root_domain() {\n\n\t$domain = get_home_url( ajan_get_root_blog_id() );\n\n\treturn apply_filters( 'ajan_core_get_root_domain', $domain );\n}", "function set_subsite_root() {\n\t\t$this->is_subsite_root = true;\n\t}", "function getBaseUrls()\n{\n // reliable document_root (https://gist.github.com/jpsirois/424055)\n $root_path = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['SCRIPT_FILENAME']);\n $conf_path = rtrim(dirname(dirname(__FILE__)), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;\n\n // reliable document_root with symlinks resolved\n $info = new \\SplFileInfo($root_path);\n $real_root_path = $info->getRealPath();\n\n // defined root_relative url used in admin routing\n // ie: /my-dir/\n $root_relative_url = '/' . ltrim(\n str_replace(array($real_root_path, DIRECTORY_SEPARATOR), array('', '/'), $conf_path),\n '/'\n );\n // sanitize directory separator\n $base_url = (((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $root_relative_url;\n\n return array(\n 'root_relative_url' => $root_relative_url,\n 'base_url' => $base_url\n );\n}", "public function baseUrl() {\n return dirname($_SERVER['PHP_SELF']) . '/';\n }", "function curPageURL() {\n $pageURL = 'http';\n if (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n $pageURL .= \"://\";\n \n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n } else {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n }\n return $pageURL;\n }", "public function getRootPath()\n {\n if(null === $this->_rootPath) {\n $url = parse_url(str_replace('/index.php/', '/', $this->storeManager->getStore()->getUrl($this->getRouteName(), ['_type' => \\Magento\\Framework\\UrlInterface::URL_TYPE_LINK])));\n $this->_rootPath = isset($url['path']) ? $url['path'] : '';\n }\n\n return $this->_rootPath;\n }", "private function detectBaseUrl() {\n $this->baseurl = empty($this->subdir) ? '/' : \"/{$this->subdir}/\";\n }", "protected function setRootControllerNamespace()\n {\n if (is_null($this->namespace)) return;\n $this->app['Illuminate\\Contracts\\Routing\\UrlGenerator']\n ->setRootControllerNamespace($this->namespace);\n }" ]
[ "0.6490501", "0.6354338", "0.62335956", "0.6198966", "0.61890036", "0.61719996", "0.6144813", "0.5978498", "0.5964074", "0.59380424", "0.59124273", "0.5768808", "0.57648593", "0.5744351", "0.5740061", "0.57286316", "0.57194716", "0.56974506", "0.5693867", "0.56814", "0.56781244", "0.5654497", "0.5651789", "0.56458193", "0.56055003", "0.56019944", "0.5594479", "0.5590563", "0.55696666", "0.55670387", "0.556481", "0.5560939", "0.55529356", "0.5548221", "0.5539304", "0.55253065", "0.55242515", "0.5505154", "0.55039865", "0.5490838", "0.5490404", "0.5489289", "0.54724944", "0.54631644", "0.5456948", "0.54509014", "0.5447985", "0.54438084", "0.54391503", "0.5436943", "0.54359037", "0.5424243", "0.5423166", "0.54223806", "0.5420725", "0.5411302", "0.5394878", "0.53893054", "0.5385541", "0.53839046", "0.53815144", "0.53766716", "0.5375218", "0.5372416", "0.53644997", "0.535695", "0.5355352", "0.53436613", "0.53399736", "0.53301257", "0.53289956", "0.5326596", "0.5323705", "0.53120995", "0.53090584", "0.53084", "0.53007054", "0.5298134", "0.52950096", "0.5292919", "0.5289603", "0.52891386", "0.52840143", "0.5274769", "0.5274675", "0.52738714", "0.5273345", "0.52698624", "0.5267552", "0.526375", "0.52609694", "0.524998", "0.52491224", "0.52428454", "0.52380127", "0.5237922", "0.5234096", "0.5232109", "0.5231807", "0.52302164" ]
0.58635354
11
Consider adding Application as a parameter, add logic for document_root
public static function img(Application $app, string $src, string $text = '', array $attrs = []): string { return self::_img(self::href($app, $src), $text, $attrs, Directory::path($app->documentRoot(), $src)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function getApplication();", "function renderApplication(){\n\tinclude getApplicationSystemPath() . \"/public/layout/layout.php\";\t\n}", "public function getApplication(){ \r\n\t\treturn \\Yaf\\Application::app();\r\n\t}", "protected function _configureApplication()\n {\n $this->getApplication()\n ->setRequest(\\App\\Factory::createRequest())\n ->setRouter(\\App\\Factory::createRouter())\n ->setDispatcher(\\App\\Factory::createDispatcher())\n ;\n }", "function app_path()\n {\n return base_path() . '/app';\n }", "function getApplication();", "abstract public function createApplication();", "public function getApplication();", "public function getApplication();", "public function getApplication();", "public function getApplication();", "public function getApplication();", "public function createApplication()\n {\n }", "public function getApplicationPath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_APPLICATION);\r\n\t}", "public function __construct( $appRootPath=null ){\n \t \n $this->appRootPath = $appRootPath;//.$this->baseName();\n $_SERVER['APP_ROOT_PATH']= $this->appRootPath;\n\n }", "public function configure(\\Silex\\Application $application);", "public function createApplication()\n {\n return $this->app = new Application(__DIR__);\n }", "protected static function getDocumentRoot() {\n\t\treturn BootstrapConfig::getParam(\"document_root\", $_SERVER['DOCUMENT_ROOT']);\n\t}", "protected static function setAppPath()\n {\n self::$appPath = Application::$root.'app/';\n\n return self::$appPath;\n }", "public function getApplicationPath()\n {\n return app_path();\n }", "public static function getApplicationRoot(){\r\n $path = __DIR__;\r\n return $path;\r\n }", "public function getApplicationPath(){\n return Vimerito::getApplicationPath();\n }", "public function setApplication(\\Cloud\\Silex\\Application $app);", "public function createApplication()\n {\n return require dirname(__DIR__) . DIRECTORY_SEPARATOR . \"bootstrap.php\";\n }", "public function getApplication()\n\t{\n\t\treturn $this->application;\n\t}", "public function getApplication()\n\t{\n\t\treturn $this->application;\n\t}", "function start_application() {\n\t// The SAPI type is cgi-fcgi when accessed from the browser.\n\tif (PHP_SAPI === 'cgi-fcgi') {\n\t\t// Force secure site.\n\t\tif (FORCE_SECURE) {\n\t\t\tredirect_to_https();\n\t\t}\n\t}\n\n\trequire ABSPATH . 'vendor/autoload.php';\n\n\t// Make sure OpenOffice is running.\n\t// start_openoffice();\n\n\t// Include base classes.\n\tinclude_classes();\n\n\t// Include controllers.\n\tinclude_controllers();\n\n\t// Activate query string parameters.\n\tinclude_query_string();\n}", "function getAppPath() {\r\n\r\n $root = str_replace('\\\\', '/', $_SERVER['DOCUMENT_ROOT']);\r\n if (substr($root, -1) === '/') { // remove any trailing / which should not be there\r\n $root = substr($root, 0, -1);\r\n }\r\n $dir = str_replace('\\\\', '/', dirname(__FILE__));\r\n\r\n $path = str_replace($root, '', $dir) . '/';\r\n\r\n return $path;\r\n\r\n }", "protected function configureApplication(Application $app)\n {\n //\n }", "public function createApplication()\n {\n /** @var Application $app */\n $app = require __DIR__ . '/../../src/app.php';\n require __DIR__ . '/../../config/dev.php';\n require __DIR__ . '/../../src/controllers.php';\n $app['session.test'] = true;\n\n return $this->app = $app;\n }", "protected function setupApplication()\n {\n $this->call('publish:assets', ['package' => 'antares/foundation']);\n }", "public static function getApplicationPath() \r\n {\r\n if (!isset(self::$appPath)) \r\n {\r\n switch ($_SERVER['HTTP_HOST']) {\r\n case 'localhost':\r\n self::$appPath = 'http://' . $_SERVER['HTTP_HOST'] . '/Progetto/';\r\n break;\r\n case 'spano.sc.unica.it':\r\n // configurazione pubblica\r\n self::$appPath = 'http://' . $_SERVER['HTTP_HOST'] . '/amm2015/meloniFabrizio/';\r\n break;\r\n default:\r\n self::$appPath = '';\r\n break;\r\n }\r\n }\r\n \r\n return self::$appPath;\r\n }", "public function getApplication()\n {\n return $this->application;\n }", "public function getApplication()\n {\n return $this->application;\n }", "public function getApplication()\n {\n return $this->application;\n }", "public function getApplication()\n {\n return $this->application;\n }", "function startApplication(){\n\n\t// name space all the stuff for the application\n\t$_SESSION[ SESSION_NAME_SPACE ] = array();\n\t$_SESSION[ SESSION_NAME_SPACE ][ 'systemPath' ] = getcwd();\n\t$_SESSION[ SESSION_NAME_SPACE ][ 'factory' ] = new Factory();\n\n\t// lets output a message that the application has been reloaded.\n\t$initViewState = getFactory()->getBean( 'ViewState' );\n\t$initViewState->setResponse('Application Started at: ' . date( 'l jS \\of F Y h:i:s A' ), 'warning');\n\tsetViewState( $initViewState );\n}", "public static function getApplication() : Application\n {\n return self::$app;\n }", "public static function setApplicationFolder($prm_folder_name=\"application\")\n {\n global $application_folder;\n $application_folder = $prm_folder_name;\t\n\t}", "function tev_app() {\n return Tev\\Application\\Application::getInstance();\n }", "public function getAppPath() {\n return $this->_application_path;\n }", "function app()\n {\n return Application::instance();\n }", "public function getApplication()\r\n {\r\n return $this->Application;\r\n }", "public function app_path($path = null);", "public function getWebappPath();", "public static function buildApplication( Application $application );", "public static function ApplicationFolder()\n {\n return dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.Configuration::getApplicationFolder();\n }", "protected function defineOriginalRootPath() {}", "public function getApplication()\n {\n return $this->app;\n }", "public function getApplication()\n {\n return $this->app;\n }", "public function getApplication()\n {\n return $this->app;\n }", "public function getApplication()\n {\n return $this->app;\n }", "public function getApplicationPath()\n {\n return $this->applicationPath;\n }", "function app_template_path() {\n return APP_Wrapping::$main_template;\n}", "public function get_app() {\n\t\tif(self::$app)\n\t\t\treturn self::$app;\n\n\t\tglobal $a;\n\t\tself::$app = $a;\n\n\t\treturn self::$app;\n\t}", "protected function getApplicationContext() {}", "final public function getApplication()\n {\n return $this->_app;\n }", "public function getApp();", "protected function getAppPath()\n {\n return config()->path->app;\n }", "public function appPath()\n {\n return ltrim($this->basePath().'/app', '/');\n }", "private function getAppRootDir()\n {\n return $this->container->get('app.parameter_bag')->get('kernel.project_dir');\n }", "function __construct($_app) {\r\n $this->app = $_app;\r\n }", "public function bootstrap($app)\n {\n $app->params['uploadPath'] = $app->basePath . '/web/img/';\n //$app->params['uploadUrl'] => $app->urlManager->baseUrl . '/uploads/';\n }", "protected function createNecessaryDirectoriesInDocumentRoot() {}", "protected function createNecessaryDirectoriesInDocumentRoot() {}", "public static function app()\n {\n return self::$_app;\n }", "public static function getDocroot() \n\t{\n\t\treturn MHTTPD::$config['Paths']['docroot'];\n\t}", "public function setAppBasePath($appRootPath=null){\n\n $this->appRootPath = $appRootPath;\n $_SERVER['APP_ROOT_PATH']= $this->appRootPath;\n\n }", "protected function getWebRoot() {}", "protected function getWebRoot() {}", "public function baseApp()\n {\n return new BaseApplication();\n }", "public function GetAppDir ();", "public function _set_app(Application\\Base $app)\n\t{\n\t\t$this->app = $app;\n\t\t$this->app->notifier->notify('controller_created', $this, __METHOD__);\n\t}", "public function application(): Application\n {\n return self::instance()->runner->application();\n }", "protected function init($app) {}", "public function getAppPath()\n {\n return $this->_appPath;\n }", "public function bootstrap($app);", "public function bootstrap($app)\n {\n }", "public function bootstrap($app)\n {\n }", "function getApplicationSystemPath(){\n\treturn $_SESSION[ SESSION_NAME_SPACE ][ 'systemPath' ];\n}", "public function index(Application $application)\n\t{\n\t\t$documents = $application->documents;\n\t\t\n\t\tdd($documents);\n\t\t\n\t\treturn $this->showAll($documents,Document::class);\n\t}", "protected function refreshApplication()\n {\n $this->app = $this->createApplication();\n }", "protected function setInitialRootPath() {}", "public function getApplication()\n {\n return isset($this->application) ? $this->application : null;\n }", "protected function getTestApplicationPath()\n {\n return $this->getProjectRootPath() . '/testdata';\n }", "function get_application_path()\n{\n $proto = \"http\";\n\n // Detect if we are running HTTPS or proxied HTTPS\n if (server('HTTPS') == 'on') {\n // Web server is running native HTTPS\n $proto = \"https\";\n } elseif (server('HTTP_X_FORWARDED_PROTO') == \"https\") {\n // Web server is running behind a proxy which is running HTTPS\n $proto = \"https\";\n }\n\n if( isset( $_SERVER['HTTP_X_FORWARDED_SERVER'] ))\n $path = dirname(\"$proto://\" . server('HTTP_X_FORWARDED_SERVER') . server('SCRIPT_NAME')) . \"/\";\n else\n $path = dirname(\"$proto://\" . server('HTTP_HOST') . server('SCRIPT_NAME')) . \"/\";\n\n return $path;\n}", "public abstract function getApplicationNamespace();", "public function & SetAppDir ($appDir);", "function getPathToAppRoot() {\r\n\r\n\t\t$currdirectory = getcwd();\r\n\t\t$count = 0;\r\n\t\t$path = \"\";\r\n\r\n\t\t//We need to find the applications root\r\n\t\twhile(!file_exists(\"phpbmsversion.php\") && $count < 9){\r\n\r\n\t\t\t$path.=\"../\";\r\n\t\t\t@ chdir(\"../\");\r\n\t\t\t$count++;\r\n\r\n\t\t}//end while\r\n\r\n\t\tchdir($currdirectory);\r\n\r\n\t\tif($count < 9)\r\n\t\t\treturn $path;\r\n\t\telse\r\n\t\t\treturn NULL;\r\n\r\n}", "protected function getAppPath()\n {\n return __DIR__. '/../../../../app/';\n }", "public function get_app_script()\n {\n }", "function wpc_app( string $app_path, string $options = 'app' ): Urisoft\\App\\Http\\BaseKernel\n {\n try {\n $app = new App( $app_path, $options );\n } catch ( Exception $e ) {\n exit( $e->getMessage() );\n }\n\n return $app->kernel();\n }", "public function app()\r\n {\r\n return $this->app;\r\n }", "public function setApplicationPath($v) { $this->applicationPath = $v;return $this; }", "public function getAppPath()\n\t{\n\t\t$appName = $this->getAppName();\n\t\tif (empty($this->_appBasePath) || empty($appName)) {\n\t\t\trequire_once 'Syx/Platform/Exception.php';\n\t\t\tthrow new Syx_Platform_Exception('applications base path and application name must assign before use');\n\t\t}\n\t\treturn $this->_appBasePath . '/' . $appName;\n\t}", "public static function should_copy_to_docroot()\n\t{\n\t\treturn Kohana::$environment !== Kohana::DEVELOPMENT;\n\t}", "function get_application_name()\r\n {\r\n return self :: APPLICATION_NAME;\r\n }", "function get_application_name()\r\n {\r\n return self :: APPLICATION_NAME;\r\n }", "function get_application_name()\r\n {\r\n return self :: APPLICATION_NAME;\r\n }", "public function __construct($app)\n {\n }", "function getApplication() {\n return $this->step->application;\n }" ]
[ "0.6591904", "0.63326937", "0.632998", "0.62831527", "0.62819225", "0.6250558", "0.6240406", "0.62358826", "0.62358826", "0.62358826", "0.62358826", "0.62358826", "0.61676306", "0.60938525", "0.6078927", "0.60218173", "0.5995663", "0.5983967", "0.59428483", "0.5934132", "0.58904463", "0.5857184", "0.5853113", "0.5847856", "0.58269083", "0.58269083", "0.58132064", "0.57962865", "0.5755825", "0.57374305", "0.57341087", "0.573056", "0.5706196", "0.5706196", "0.5706196", "0.5706196", "0.5702869", "0.56967264", "0.56810987", "0.5674204", "0.5672494", "0.56571364", "0.5656408", "0.5652883", "0.56526476", "0.5650091", "0.56461054", "0.56397474", "0.56386226", "0.56386226", "0.56386226", "0.56386226", "0.56336427", "0.56189656", "0.5612655", "0.560021", "0.55938476", "0.5582836", "0.5566312", "0.5563541", "0.55603045", "0.5556476", "0.5548645", "0.55415267", "0.55415267", "0.55400455", "0.5535764", "0.552866", "0.55255884", "0.5524454", "0.5516676", "0.54828525", "0.54807705", "0.54717064", "0.5468143", "0.5462351", "0.5456899", "0.5454553", "0.5454553", "0.54369146", "0.5434259", "0.54338473", "0.5432895", "0.542648", "0.54196995", "0.5417494", "0.54156274", "0.54118675", "0.5409566", "0.53983045", "0.539297", "0.53886527", "0.5386938", "0.5385535", "0.53803045", "0.5377356", "0.5371169", "0.5371169", "0.5371169", "0.5368551", "0.5365001" ]
0.0
-1
Output an `` tag
public static function a(string $href, array|string $attributes, string $text = null): string { $attributes = self::toAttributes($attributes); $attributes['href'] = $href; return self::tag('a', $attributes, $text); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tag($tag_name, $op, $pref = '', $nl = false, $extra = '')\n{\n echo $pref . '<' ;\n if ($op == 'close') {\n echo '/' ;\n }\n echo $tag_name ;\n if ($extra != '') {\n echo ' ' . $extra ;\n }\n echo '>' ;\n if ($nl == true) {\n NL() ;\n }\n}", "public function asHTML() {\n return \"$this->before<$this->tag_name$this->attributes />$this->after\";\n }", "function output_tag($name='',$content='',$attrs='')\n{\n echo tag($name,$content,$attrs);\n}", "public final function startTag() : string\n {\n return $this->name ? '<' . $this->name . $this->attributes() . (static::$xhtml && $this->isEmpty ? ' />' : '>') : '';\n }", "public function __toString()\n {\n try {\n return $this->getTag('default');\n } catch (\\Exception $e) { // TODO be more specific, maybe!\n return '';\n };\n }", "public function shortcode() {\n\t\t\treturn \"\";\n\t\t}", "public function asHTML() {\n return \"$this->before<$this->tag_name$this->attributes>$this->content</$this->tag_name>$this->after\";\n }", "public function __toString() {\n return $this->tag();\n }", "function output_single_tag($name='', $attrs='')\n{\n echo single_tag($name,$attrs);\n}", "public function makeClosingTag()\n {\n if ($this->selfClosing) {\n return '';\n }\n\n return '</'.$this->name.'>';\n }", "function tag_escape($tag_name)\n {\n }", "function otag($tag=false, $class='', $style='', $id='', $extra='')\n\t{\n\t\tif($tag == false)\n\t\t{\n\t\t\t$tag = $this->default_tag['tag'];\n\t\t\t$class = $this->default_tag['class'];\n\t\t\t$style = $this->default_tag['style'];\n\t\t\t$extra = $this->default_tag['extra'];\n\t\t}\n\t\t$class = ($class != '' ? ' class=\"' . $class . '\"' : '');\n\t\t$style = ($style != '' ? ' style=\"' . $style . '\"' : '');\n\t\t$id = ($id != '' ? ' id=\"' . $id . '\"' : '');\n\t\t$extra = ($extra != '' ? ' ' . $extra : '');\n\t\tarray_push($this->closetags, $tag);\n\t\treturn $this->xecho('<' . $tag . $class . $style . $id . $extra . '>');\n\t}", "function tagins($stuffing) {\n return \"<\".$stuffing.\">\";\n }", "function tag($name='',$content='',$attrs='')\n{\n return \"<${name} ${attrs}>${content}</${name}>\";\n}", "function tagins($stuffing)\r\n{\r\n\treturn \"<\".$stuffing.\">\";\r\n}", "public final function endTag() : string\n {\n return $this->name && !$this->isEmpty ? '</' . $this->name . '>' : '';\n }", "function BeginTag($str){\r\n echo \"+TAG:\".$str;\r\n}", "function BeginTag($str){\r\n echo \"+TAG:\".$str;\r\n}", "function single_tag($name='', $attrs='')\n{\n return \"<${name} ${attrs} />\";\n}", "public function markup(): string;", "public function closeTag(): string\n {\n return $this->templateCloseTag;\n }", "function echoTag ($id,$tag,$highlight,$text,$markObjects)\r{\r\t\r\techo \"<span id=$id>\";\r\tif ($markObjects) {\r\t\tif ($tag == 'EVENT') { echo \"<span class=event>\"; } \r\t\telseif ($tag == 'TIMEX3') { echo \"<span class=timex>\"; } \r\t\telse { echo \" <span class=signal>\"; }\r\t}\r\tif ($highlight) { echo '<strong>'; }\r\tif ($id{0} == 'e') { $tagtype = 'event'; }\r\telseif ($id{0} == 't') { $tagtype = 'timex'; }\r\telseif ($id{0} == 's') { $tagtype = 'signal'; }\r\techo \"<span style=\\\"cursor:crosshair\\\" onClick=\\\"MM_goToURL('parent','displayTag.php?tagtype=$tagtype&text=$text')\\\">\";\r\techo $text;\r\techo \"</span>\";\r\tif ($highlight) { echo '</strong>'; }\r\tif ($markObjects) {\r\t\techo '</span><sub>'.$id.'</sub>';\r\t}\r\techo \"</span>\";\r}", "public function tag(): string;", "public function makeOpeningTag()\n {\n $return = '<'.$this->name;\n\n // add the attributes\n foreach ($this->attr as $key => $info) {\n $info = $this->getAttribute($key);\n $val = $info['value'];\n if (is_null($val)) {\n $return .= ' '.$key;\n } elseif ($info['doubleQuote']) {\n $return .= ' '.$key.'=\"'.$val.'\"';\n } else {\n $return .= ' '.$key.'=\\''.$val.'\\'';\n }\n }\n\n if ($this->selfClosing) {\n return $return.' />';\n } else {\n return $return.'>';\n }\n }", "function tagins($stuffing) {\n return \"<\".$stuffing.\">\".PHP_EOL;\n }", "public function render()\n {\n return <<<'blade'\n<{{$tag}} {!! $isButton($tag)?'type=\"button\"':'' !!} {{$attributes->merge(['class'=>'close'])}} data-dismiss=\"{{$dismiss}}\" aria-label=\"{{$ariaLabel}}\">\n <span aria-hidden=\"true\">{!! $icon !!}</span>\n</{{$tag}}>\nblade;\n }", "public function __toString()\n {\n $result = \"<{$this->getTagName()}\";\n foreach ($this->getAttributes() as $key => $value) {\n $result .= \" {$key}=\\\"\" . Util::escape($value) . \"\\\"\";\n }\n if ($this->hasChild()) {\n $result .= '>';\n foreach ($this->getChildren() as $node) {\n $result .= $node->toString();\n }\n $result .= \"</{$this->getTagName()}>\";\n } else {\n $result .= ' />';\n }\n return $result;\n }", "public function __toString(): string\n {\n return \"</{$this->name}:{$this->id}>\";\n }", "function ctag($close=1)\n\t{\n\t\t$close = ($close == 'all' ? count($this->closetags) : $close);\n\t\t$toecho = '';\n\t\tfor($i = 0; $i < $close; $i ++)\n\t\t{\n\t\t\t$thisclose = array_pop($this->closetags);\n\t\t\t$toecho .= '</' . $thisclose . '>';\n\t\t}\n\t\treturn $this->xecho($toecho);\n\t}", "public function label()\n {\n $result = $this->title;\n if ($this->tags) {\n $tags = '[' . implode('] [', preg_split('/\\s*,\\s*/', $this->tags)) . ']';\n $result .= ' <span style=\"font-weight:bold;padding-left:20px;float:right;\">' . $tags . '</span>';\n }\n return $result;\n }", "public function __toString(): string\n {\n $tags = [];\n foreach ($this->getTags() as $tag) {\n if ($tag === null) {\n $tags[] = null;\n continue;\n }\n\n $tags[] = '{' . trim('@' . $tag->getName() . ' ' . $tag) . '}';\n }\n\n return vsprintf($this->getBodyTemplate(), $tags);\n }", "public function toString()\n {\n return 'X-Magento-Tags: ' . $this->getFieldValue();\n }", "public function __toString()\n {\n return $this->tag;\n }", "function print_tag($var, $default = '&mdash;') {\n echo isset($var) ? $var : $default;\n}", "public function render(): string\n\t{\n\t\treturn implode(' ', array_filter([\n\n\t\t\t$this->formatted_type,\n\t\t\t$this->formatted_attributes,\n\t\t\t$this->formatted_charset,\n\t\t\t$this->formatted_null,\n\t\t\t$this->formatted_auto_increment,\n\t\t\t$this->formatted_default,\n\t\t\t$this->formatted_comment\n\n\t\t]));\n\t}", "public function tag(): string\n {\n return $this->tag;\n }", "function get_string() {\n\t\t$attribs = $this->__attribs();\n\t\t$str = $this->__str();\n\t\t$str = '<a'.$attribs.'>'.$this->label.$str.'</a>';\n\t\treturn $str;\n\t}", "public function closeTag()\n {\n return '</span>';\n }", "public function print_tags() {\n\t\tforeach ($this->photo_tags as $tag) {\n\t\t\techo '\n\t\t\t\t<div class=\"caption-tag\">\n\t\t\t\t\t<span class=\"crosshair\">&#127919;</span>';\n\t\t\t// Handle the different levels of completeness for an\n\t\t\techo\n\t\t\t (isset($tag['article']) ? \n\t\t\t '<a href=\"#\" class=\"item\">' . $tag['article'] . '</a>' : '');\n\t\t\techo \n\t\t\t\t(isset($tag['gender']) ?\n\t\t\t\t '<span class=\"seperator\"> - </span>\n\t\t\t\t\t<a href=\"#\" class=\"item\">' . $tag['gender'] . '</a>' : '');\n\t\t\techo\n\t\t\t (isset($tag['brand']) ?\n\t\t\t\t '<span class=\"seperator\"> - </span>\n\t\t\t\t\t<a href=\"#\" class=\"item\">' . $tag['brand'] . '</a>' : '');\n\t\t\techo '</div>';\n\t\t}\n\t}", "public function Render(): string\r\n {\r\n $callback = fn (?string $k, ?string $v): string => $k.'=\"'.\\htmlentities($v ?? '').'\"';\r\n $attributes = array_map($callback, \\array_keys($this->Attributes), \\array_values($this->Attributes));\r\n\r\n $children = '';\r\n if (count($this->Children) > 0) {\r\n $this->IsContainer = true;\r\n $children = implode('', $this->Children);\r\n }\r\n\r\n return '<'.strtolower($this->TagName).' '.implode(' ', $attributes).($this->IsContainer ? '' : '/').'>'.$children.($this->IsContainer ? '</'.\\strtolower($this->TagName).'>' : '');\r\n }", "function quote_open() {\n $this->doc .= '<blockquote><div class=\"no\">'.DOKU_LF;\n }", "public function getTag()\n {\n return 'restr';\n }", "public function __toString()\n {\n\n $attributes = array();\n \n $tag = '<'.$this->name;\n \n $attr = array();\n \n foreach( $this->attributes as $key => $value ) \n {\n if ( is_array($value) )\n {\n $value = str_replace('\"', \"'\", json_encode($value));\n }\n \n $attr[] = $key.'='.'\"'.$value.'\"';\n }\n\n $attr = implode(' ',$attr);\n \n $tag .= ' '.$attr;\n \n if ( (isset($this->content) && !is_null($this->content)) || ($this->name == 'textarea'))\n {\n $tag .= '>'.$this->content.'</'.$this->name.'>';\n }\n else\n { \n $tag .= ' />';\n }\n \n return $tag;\n }", "function CloseTag() {\n\t\tif (!empty($this->tag)) {\n\t\t\tfor ($in=0;$in<$this->indent; $in++) {\n\t\t\t\t$this->outputCode.=\"\";\n\t\t\t}\n\t\t\tif (!empty($this->tag))\n\t\t\t$this->outputCode.=\"</\".$this->tag.\">\";\n\t\t}\n\t\t//$this->outputCode.=\"\\n\";\n\t\t$this->indent--;\n\t}", "public function getBrickHtmlTagOpen($brick){\n return '';\n }", "function endTag ($tag = NULL)\n\t{\n\t\t$html = $tag ? \"</$tag>\" : \"</$this->tag>\";\n\t\t$this -> tag = '';\n\n\t\treturn $html;\n\t}", "public function __toString() {\n\t\t\t$html = \"<{$this->tag}\";\n\n\t\t\t// Add all the attributes\n\t\t\tforeach ($this->attributes as $key => $value) {\n\t\t\t\t$html .= \" {$key}=\\\"{$value}\\\"\";\n\t\t\t}\n\t\t\t$html .= \">\";\n\n\t\t\t// Add the inner html\n\t\t\t$html .= $this->inner;\n\n\t\t\t// Add children\n\t\t\tforeach ($this->children as $element) {\n\t\t\t\t$html .= $element;\n\t\t\t}\n\n\t\t\t// Close the tag\n\t\t\t$html .= \"</{$this->tag}>\";\n\n\t\t\treturn $html;\n\t\t}", "public function render()\n {\n return <<<'blade'\n<button {{ $attributes->merge(['class' => 'btn', 'type' => '']) }}>\n\t{{ $text }}\n</button>\nblade;\n }", "function display($tag , $value) {\n echo $tag . $value ;\n }", "public static function createEndTag($name){\n\t\treturn ('</'.$name.'>');\n\t}", "public function renderTagAttributes(){\n $row = '';\n foreach($this->tag_attributes as $key => $attribute)\n $row .= \"$key=\\\"$attribute\\\" \";\n return $row;\n }", "function stag($tag=false, $class='', $style='', $id='', $extra='')\n\t{\n\t\tif($tag == false)\n\t\t{\n\t\t\t$tag = $this->default_tag['tag'];\n\t\t\t$class = $this->default_tag['class'];\n\t\t\t$style = $this->default_tag['style'];\n\t\t\t$extra = $this->default_tag['extra'];\n\t\t}\n\t\t$class = ($class != '' ? ' class=\"' . $class . '\"' : '');\n\t\t$style = ($style != '' ? ' style=\"' . $style . '\"' : '');\n\t\t$id = ($id != '' ? ' id=\"' . $id . '\"' : '');\n\t\t$extra = ($extra != '' ? ' ' . $extra : '');\n\t\treturn $this->xecho('<' . $tag . $class . $style . $id . $extra . ' />');\n\t}", "private static function tag($tag, $arguments=false, $content='', $open=false) {\n\t\t$tag = strtolower(trim($tag));\n\t\t\n\t\t//start tag\n\t\t$return = '<' . $tag;\n\n\t\t//format arguments\n\t\t$arguments = self::arguments($arguments);\n\t\tforeach ($arguments as $key=>$value) {\n\t\t\tif ($value !== false) $return .= ' ' . strtolower(trim($key)) . '=\"' . htmlentities(trim($value)) . '\"';\n\t\t}\n\t\t\n\t\t//close tag\n\t\t$return .= '>';\n\t\tif (!in_array($tag, array('br', 'hr', 'img', 'meta'))) {\n\t\t\t//is a container tag\n\t\t\t$return .= $content;\n\t\t\tif ($open === false) $return .= '</' . $tag . '>';\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "static function renderCloseTag($name)\n {\n echo '</' . $name . '>'.PHP_EOL;\n }", "public function output_markup()\n\t\t{\t\t\t\n\t\t\techo $this->markup;\n\t\t\t\n\t\t}", "function tf_html_tag($tag, $attr = null, $end = null)\r\n {\r\n $inner = array($tag);\r\n if (isset($attr)) {\r\n foreach ($attr as $k => $v) {\r\n if (is_numeric($k)) {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($v), esc_attr($v));\r\n }\r\n else if ($v === true) {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($k), esc_attr($k));\r\n }\r\n else if ($v === false) {\r\n # ignore\r\n }\r\n else {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($k), esc_attr($v));\r\n }\r\n }\r\n }\r\n\r\n if ($end === true) {\r\n # close ELEMENT as HTML\r\n # <script></script>\r\n $body = '';\r\n $close = '</'.$tag.'>';\r\n }\r\n else if ($end === false) {\r\n # close ELEMENT as XML\r\n $inner[] = '/';\r\n $body = '';\r\n $close = '';\r\n }\r\n else {\r\n # if there is content close element, otherwise leave it open\r\n if (empty($end)) {\r\n $body = '';\r\n $close = '';\r\n }\r\n else {\r\n $body = strval($end);\r\n $close = '</'.$tag.'>';\r\n }\r\n }\r\n\r\n $open = '<'.implode(' ', $inner).'>';\r\n return $open.$body.$close;\r\n }", "function singlequoteclosing() {\n global $lang;\n $this->doc .= $lang['singlequoteclosing'];\n }", "function esc_xml($text)\n {\n }", "function writeHtmlCommonTagStart($tag, $attributes = [], $isCloseTag = true) {\n $html = \"<$tag \";\n foreach ($attributes as $key => $value) {\n if (is_numeric($key)) {\n $html .= $value;\n } else {\n $html .= \"$key=\\\"{$value}\\\"\";\n }\n }\n\n if ($isCloseTag) {\n $html .= \">\";\n } else {\n $html .= \"/>\";\n }\n\n echo $html;\n}", "public function render(): string\n {\n if ($this instanceof IsTextNode) {\n $html = implode('', $this->children);\n\n if ($this->escapeHtml) {\n $html = htmlspecialchars($html);\n }\n\n return $html;\n }\n\n $html = [\n '<'.$this->getName(),\n ];\n\n foreach ($this->attributes as $key => $value) {\n if (in_array($key, $this->booleanAttributes)) {\n if (! $value) {\n continue;\n }\n\n $html[] = ' '.$key;\n continue;\n }\n\n if ($value === null) {\n $html[] = ' '.$key;\n continue;\n }\n\n $value = htmlspecialchars((string) $value);\n\n $html[] = <<<EOL\n {$key}=\"{$value}\"\nEOL;\n }\n\n if ($this instanceof IsSingleton) {\n $html[] = ' />';\n } else {\n $html[] = '>';\n\n $html[] = $this->renderChildren();\n\n $html[] = '</'.$this->getName().'>';\n }\n\n $html = implode('', $html);\n\n return $html;\n }", "public function render()\r\n\t{\r\n\t\t$content = \"\";\r\n\t\t\r\n\t\tif (!empty($this->id)) \r\n\t\t{\r\n\t\t\t$content .= \"id='\" . $this->id . \"' \";\r\n\t\t}\r\n\t\t\r\n\t\tif (!empty($this->name)) \r\n\t\t{\r\n\t\t\t$content .= \"name='\" . $this->name . \"' \";\r\n\t\t}\r\n\t\t\r\n\t\tif (!empty($this->className)) \r\n\t\t{\r\n\t\t\t$content .= \"class='\" . $this->className . \"' \";\r\n\t\t}\r\n\t\t\r\n\t\treturn $content;\r\n\t}", "function mc_admin_strip_tags() {\n\n\treturn '<strong><em><i><b><span><a><code><pre>';\n}", "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 }", "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}", "function output_markup();", "public function xmlOutput()\n {\n return\n '<output>\n <answer>' . $this->answer . '</answer>\n <summary>' . htmlspecialchars($this->summary) . '</summary>\n </output>';\n }", "protected function renderElement() {\n $result = \"\";\n $result .= $this->getOpeningTag();\n $result .= (!empty($this->options['content'])) ? $this->options['content'] : \"\";\n $result .= $this->getClosingTag();\n return $result;\n }", "function fabric_remove_self_closing_tags($input) {\n return str_replace(' />', '>', $input);\n}", "static function make_tag( $tagname, $attrs, $content = null ) {\n\t\tif( empty( $tagname ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$html = '<' . $tagname;\n\n\t\tforeach( $attrs as $attr => $val ) {\n\t\t\t$html .= ' ' . $attr . '=\"' . esc_attr( $val ) . '\"';\n\t\t}\n\n\t\t// Self-closing tag:\n\t\tif( !isset( $content ) ) {\n\t\t\t$html .= ' />';\n\t\t}\n\t\telse {\n\t\t\t$html .= '>';\n\n\t\t\tif( $content !== false ) {\n\t\t\t\t$html .= $content . '</' . $tagname . '>';\n\t\t\t}\n\t\t}\n\n\t\treturn $html;\n\t}", "public function toHtml() {\n\t\techo '<mark '.$this->getAttributes().'>'.$this->renderChildren().'</mark>';\n\t}", "public function toHtml() {\n\t\techo '<output '.$this->getAttributes().'/>';\n\t}", "public function getHtmlAttribute() :string{\n return trim(call_user_func([$this, $this->formats[$this->syntax]]));\n }", "public function __toString(): string\n {\n return $this->toMetaTags();\n }", "public function __toString() {\n\t\treturn self::$before . $this->render() . self::$after;\n\t}", "public function getHtmlOutputAttribute()\n {\n return nl2br(e($this->description));\n }", "function print_debug($content, $tag) {\n $output = '<span style=\"display:none\" id=\"';\n $output .= $tag;\n $output .= '\">';\n print_r($output);\n print_r($content);\n print_r('</span>');\n}", "static function vox_html($utterance, $params){\n\n\t\textract(self::vox_prep_args($params) );\n\n\t\t$tag = (!isset($tag)) ? 'pre' : $tag;\n\t\t$label = (!isset($label)) ? '' : $label;\n\n\t\t$articulation = sprintf('<%s class=\"vox\">%s%s</%s><!-- /.vox -->', $tag, $label, $utterance, $tag);\n\n\t\treturn $articulation;\n\n\t}", "private function close() {\n echo \"</{$this->name}>\\n\";\n }", "protected function output() {\n\t\treturn \"<hr class=\\\"hr-text\\\" data-content=\\\"{$this->option( 'text', '' )}\\\"/>\";\n\t}", "public static function create($name, $attr=null, $content=true){\n\t\t$output = '';\n\t\t$shorttag = $content==false || is_null($content);\n\t\t$output .= self::createStartTag($name, $attr);\n\t\tif(!$shorttag)self::addTagToLog($name);\n\t\tif(is_string($content)){\n\t\t\t$output .= $content;\n\t\t\t$output .= self::end();\n\t\t}\n\t\treturn $output;\n\t}", "static public function writeTag($tag, $attrs = null, $text = null, $options = [])\n {\n $escape = $options['escape'] ?? true;\n $html = '<' . $tag . ($attrs ? $attrs->write($tag) : '');\n if (isset(self::$selfClose[$tag]) && $text === null) {\n $html .= '/>';\n } elseif ($text !== null) {\n $html .= '>'\n . ($escape ? \\htmlspecialchars($text) : $text)\n . '</' . $tag . '>';\n } else {\n $html .= '>';\n }\n return $html;\n }", "function saveXML($tagName) {\n if (!empty($this->_id)) {\n return '<'.$tagName.'>'.htmlspecialchars($this->_id).'</'.$tagName.'>'.\"\\n\";\n }\n return '';\n }", "private static function html() : string\n {\n return '<(.|\\n)*?>';\n }", "public final function getHtml() : string\n {\n return \\implode('', $this->children);\n }", "function doTagStuff(){}", "function showDetailsPair($tag, $value) {\n\t/**\n\t* 2016-03-16 INFO: AHH\n\t* Don't use <p> to space because the style sheet changes the color on a p\n\t*/\n\techo \"<div style=\\\"padding-top:20px;\\\">$tag<br />$value</div>\";\n}", "function cs_span($texte, $attr='') { return \"<span $attr>$texte</span>\"; }", "public function helperText()\n {\n return \"\";\n }", "public function t_open_tag_with_echo($sTag) {\n\t\t$this->oBeaut->add('<?php echo ');\n\t}", "static function renderTag($name, $attributes = null, $content = null)\n {\n if ($content)\n {\n self::renderOpenTag($name, $attributes);\n echo $content.\"</$name>\";\n }\n else\n {\n self::renderSingleTag($name, $attributes);\n }\n }", "public function __toString()\n\t{\n\t\t//empty line\n\t\t$text = ' ';\n\t\t$text .= 'id = ' . $this->id;\n\t\t$text .= ' description = ' . $this->description;\n\t\t$text .= ' price = ' . $this->price;\n\n\t\treturn $text;\n\n\t}", "public function render(): string\n {\n $string = str_repeat('#', intval($this->attributes['header'])) . ' ';\n if ($this->hasChildren() === true) {\n\n foreach ($this->children() as $child) {\n $string .= $child->render();\n }\n }\n $string .= \"{$this->escape($this->insert)}\";\n\n return $string;\n\n\n\n /*return str_repeat('#', intval($this->attributes['header'])) .\n \" {$this->escape($this->insert)}\";*/\n }", "public function __toString() {\n $str = \"<{$this->name} \";\n foreach ($this->attributes as $key => $val) {\n $str .= \"$key=\\\"$val\\\" \";\n }\n $str = rtrim($str) . \">\" . $this->value . \"</{$this->name}>\";\n\n return $str;\n }", "public function getIconTag() {\n\t\treturn '<img class=\"languageIcon jsTooltip\" src=\"' . $this->getIconPath() . '\" title=\"' . $this->getTitle() . '\" alt=\"' . $this->getTitle() . '\" />';\n\t}", "protected function _toHtml(): string\n {\n if (false != $this->getTemplate()) {\n return parent::_toHtml();\n }\n\n return sprintf('<li><a %s>%s</a>',\n $this->getLinkAttributes(), $this->escapeHtml($this->getLabel())\n );\n }", "function render(){\n\t\treturn $this->id.bnf::$separator;\n\t}", "function printTags(){\n\n\t\t/* Start HTML */\n\t\t$output = '<ul class=\"taglist\">';\n\t\t$tags = explode(',',$this->tags);\n\t\tforeach($tags as $tag){\n\t\t\t$output .= '<li class=\"tag\"><a href=\"#!/search&tags='.urlencode(strtolower(str_replace(' ','',$tag))).'\">'.$tag.'</a></li>';\n\t\t}\n\t\t$output .= '</ul>';\n\n\t\t/* Return HTML */\n\t\treturn $output;\n\t}", "public function render(): string\n {\n return $this->renderer->render(\n $this->bag->collect()->filter->hasAnyTag(...$this->tags)\n );\n }", "public function generate($inside = '')\n {\n if(!empty($this->labelNote))\n {\n $labelNote = ' <span>' . $this->labelNote . '</span>';\n }\n \n return \"<label>\\n<strong>\" . $this->label . \":</strong>\\n\" . $inside . $labelNote . \"</label>\\n\";\n }", "function endTag($parser, $element) {\r\n echo \"<br />\";\r\n}", "public function run() {\n echo CHtml::closeTag($this->tagName);\n }" ]
[ "0.6943976", "0.6933775", "0.6775729", "0.6772431", "0.6726125", "0.6718999", "0.67096645", "0.65643644", "0.6551411", "0.65505934", "0.6475362", "0.644128", "0.6438994", "0.64260095", "0.63917226", "0.638777", "0.6303655", "0.6303655", "0.6260509", "0.62432456", "0.623346", "0.6224837", "0.62124515", "0.6188903", "0.6173475", "0.6159668", "0.6151584", "0.6134076", "0.6121981", "0.6116193", "0.60841215", "0.60840315", "0.60686874", "0.6059078", "0.60367095", "0.6035793", "0.6014065", "0.60079724", "0.5999658", "0.59796697", "0.5970739", "0.5966449", "0.59554875", "0.59497106", "0.5938233", "0.59336275", "0.5926886", "0.5915415", "0.5915096", "0.58925813", "0.5878674", "0.5865876", "0.58569235", "0.58486724", "0.5847962", "0.58479124", "0.58316255", "0.58013386", "0.57903075", "0.5780154", "0.57725114", "0.5763186", "0.5753835", "0.5751054", "0.5745576", "0.57397985", "0.57179224", "0.5711703", "0.57093996", "0.5695761", "0.56954", "0.56952506", "0.56925344", "0.5687897", "0.568787", "0.5681532", "0.5670505", "0.5665778", "0.56634843", "0.56602025", "0.56540006", "0.56521195", "0.56493306", "0.5646556", "0.5642818", "0.56427807", "0.5641657", "0.5637254", "0.5632114", "0.5621455", "0.5619426", "0.5610447", "0.56100225", "0.5609658", "0.5609427", "0.5607637", "0.5606168", "0.5604856", "0.56045616", "0.55948573", "0.55925155" ]
0.0
-1
For speed, you must register your tag hook here in addition to $application>hooks>add Use the name returned as the hook name
public static function tag_attributes_alter_hook_name(string $name): string { $name = self::cleanTagName($name); self::$attributes_alter[$name] = true; return __CLASS__ . "::tag::$name"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hook()\n {\n \\add_action(\n $this->tag,\n $this->callback,\n $this->priority,\n $this->acceptedParams\n );\n }", "public function add_hooks()\n {\n }", "public function add_hooks()\n {\n }", "public function hook();", "function doTagStuff(){}", "function add_hook($hook, $function) {\n\n md_add_hook($hook, $function);\n\n }", "public static function addTagToLog($name){\n\t\tself::$tag_log[] = $name;\n\t}", "function did_filter($hook_name)\n {\n }", "public static function register()\n\t{\n\t\tForm::extensionMethod('addTag', callback(__CLASS__, 'addTag'));\n\t}", "public static function get_hook_name(){\r\n\t\treturn \"blog\";\r\n\t}", "function did_action($hook_name)\n {\n }", "public function tag()\n\t{\n\t\t$crud = $this->generate_crud('blog_tags');\n\t\t$this->mPageTitle = 'Blog Tags';\n\t\t$this->render_crud();\n\t}", "public function registerHooks() {\n\t\t// Nothing to do here right now\n\t\t// Others might want to know about this and get a chance to do their own work (like messing with our's :) )\n\t\tdo_action( 'pixelgrade_portfolio_registered_hooks' );\n\t}", "public function hook() {\n\t\t// the WPML API is not included by default\n\t\trequire_once ICL_PLUGIN_PATH . '/inc/wpml-api.php';\n\n\t\t$this->hook_actions();\n\t\t$this->hook_filters();\n\t}", "public function set_hooks() {\n\t\tadd_action( 'wp_head', array( $this, 'do_meta_tags' ), 0 );\n\t\t\tadd_filter( 'document_title_parts', array( $this, 'filter__the_title_parts' ), 1, 4 );\n\t}", "private function _add_hook($hook)\n\t{\n\t\tee()->db->insert('extensions', array(\n\t\t\t'class' => $this->class_name,\n\t\t\t'method' => $hook,\n\t\t\t'hook' => $hook,\n\t\t\t'settings' => serialize($this->settings),\n\t\t\t'priority' => 5,\n\t\t\t'version' => $this->version,\n\t\t\t'enabled' => 'y'\n\t\t));\n\t}", "protected function registerTag(): string\n {\n return 'var';\n }", "function wds_bb_custom_field_hook() {\n\tif ( ! class_exists( 'FLBuilder' ) ) {\n\t\treturn;\n\t}\n\n\t$plugin = wds_bb_custom_field_plugin();\n\t$plugin->register_hooks();\n}", "public function register_hooks() {\n\t\t\\add_filter( 'category_description', [ $this, 'add_shortcode_support' ] );\n\t\t\\add_filter( 'term_description', [ $this, 'add_shortcode_support' ] );\n\t}", "private function public_hooks()\n\t{\n\t}", "public function hook() {\n add_filter('pre_get_document_title', [$this, 'getTitle'], 10);\n add_filter('wp_head', [$this, 'outputMetaDescription'], 1);\n add_filter('wp_head', [$this, 'ogTags'], 2 );\n }", "function wp_ajax_add_tag()\n {\n }", "public static function add_tag_generator() {\n\t\twpcf7_add_tag_generator(\n\t\t\tself::$tag_name,\n\t\t\t__( 'Dynamic Dropdown', 'wpcf7' ),\n\t\t\t'wpcf7-tg-pane-dynamicdropdown',\n\t\t\tarray( __CLASS__, 'add_tag_panel' )\n\t\t);\n\t}", "public function add() {\n\t\t$this->display ( 'admin/tag/add.html' );\n\t}", "public function register_hooks() {\n\t\t\t\n\t\t\tif ( ! is_single() )\n\t\t\t\treturn;\n\n\t\t\tif ( 'podcast' !== get_post_type() )\n\t\t\t\treturn;\n\n\t\t\tadd_filter( 'language_attributes', function ( $output = '' ) {\n\t\t\t\treturn $output . ' prefix=\"og: http://ogp.me/ns#\"';\n\t\t\t} );\n\n\t\t\tadd_action( 'wp_head', array( $this, 'insert_' ) );\n\t\t}", "public function init_hooks() {\n\t}", "function add_tag($tag) {\n array_push($this->tags, $tag);\n }", "function on_add_extra()\r\n\t{\r\n\t}", "function kalatheme_icon_render_hooks() {\n $hooks['html_tag'] = array();\n return $hooks;\n}", "function load_tag_widget() {\n register_widget( 'custom_tag_widget' );\n}", "function doing_filter($hook_name = \\null)\n {\n }", "public function register_hooks() {\n\t\t\\add_action( 'edited_term', array( $this, 'save_meta' ), PHP_INT_MAX, 3 );\n\t\t\\add_action( 'delete_term', array( $this, 'delete_meta' ), PHP_INT_MAX, 3 );\n\t}", "public function addTagToPostInTheMiddle() {}", "public function add_hooks() {\n\n\t\t// Add action hooks\n\t\t$this->add_actions();\n\n\t\t// Add filter hooks\n\t\t$this->add_filters();\n\n\t\treturn null;\n\n\t}", "public function hook_after_add($id) { \n\t //Your code here\n\n\t }", "public function hook_after_add($id) { \n\t //Your code here\n\n\t }", "public function tag(): string;", "public function register_hooks() {\n\t\tadd_filter( 'pre_update_option_block_lab_license_key', array( $this, 'save_license_key' ) );\n\t}", "function get_tag_name( $tag ) {\n $tag_name = get_tag_data( $tag , 'tag_name' );\n return $tag_name;\n}", "public function hook()\n {\n // Add the settings tab\n// $this->on('!wprss_options_tabs', array($this, 'addTab'), null, 100);\n // Register the settings option, sections and fields\n// $this->on('!wprss_admin_init', array($this, 'register'));\n\n parent::hook();\n }", "function HookIt($tag,$attr=\"\",$indenting=\"1\"){\n\t\t$this->clsTag($tag,$attr,$indenting);\n\t}", "public function getTag()\n {\n }", "public function tagged( $tag );", "public function getName()\n {\n return 'tag';\n }", "public function getName()\n {\n return 'tag';\n }", "function tagName(){\n return 'TAG NAME HERE';\n}", "private function hooks() {\n\n\t\t\t// plugin meta\n\t\t\tadd_filter( 'plugin_row_meta', array( $this, 'plugin_meta' ), null, 2 );\n\n\t\t\t// Add template folder\n\t\t\tadd_filter( 'affwp_template_paths', array( $this, 'template' ) );\n\n\t\t}", "function wp_lazy_loading_enabled($tag_name, $context)\n {\n }", "public static function add_tag($name) {\n global $wpdb;\n $data = array(\n 'name' => $name\n );\n\n // Si no se inserta nada, retornamos false\n if (!$wpdb->insert('XTB_TAGS', $data, array('%s'))) {\n return null;\n }\n\n return $wpdb->insert_id;\n //return true;\n }", "function add_function ( $name ) {\r\n $this->_twig->addFunction( $name, new Twig_Function_Function( $name ) );\r\n }", "function TestRun_add_tag($run_id, $tag_name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.add_tag', array(new xmlrpcval($run_id, \"int\"), new xmlrpcval($tag_name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function hook($name, $fn, $args = array()) {\n if (strpos($name, '-') === false) {\n $name = $this->tab() . '-' . $name;\n }\n\n if ($this->isPHPScript($fn)) {\n $scriptId = count($this->hookScripts);\n $this->hookScripts[] = $fn;\n $fn = array($this, 'hookScript_' . $scriptId);\n }\n\n $this->hooks[] = array($name, $fn, $args);\n }", "public function set_hooks()\n\t{\n\t\tadd_action('init', 'register_shortcodes');\n\t}", "function doing_action($hook_name = \\null)\n {\n }", "public function attach_hooks() {\n\t\t$this->define_hooks();\n\t}", "public function getTag(): string;", "public function tag($tag) {\n $this->tag = $tag;\n }", "protected function hook1(): void { }", "public static function get($hook_name = '')\n {\n }", "function magimpact_entry_tags()\n\t{\n\t\t$tag_list = get_the_tag_list('', __(', ', 'twentythirteen'));\n\t\tif ($tag_list) {\n\t\t\techo '<span class=\"tags-links\">' . $tag_list . '</span>';\n\t\t}\n\n\t}", "function dynamicTagsMethod ($bean, $event, $arguments)\n {\n if ($bean->fetched_row['description'] !== $bean->description) {\n $link = \"tag_link\"; //name of relationship: bean to Tags\n $tags = [\"tag\"=> []]; //array for relating tags\n\n //retreive tags already related to the target record\n if ($bean->load_relationship($link)) {\n $relatedTags = $bean->$link->getBeans();\n if (!empty($relatedTags)) {\n\n //tag relationships cannot survive this hook\n //so to preserve already related tags, we must re-relate them\n foreach ($relatedTags as $relatedTag) {\n array_push($tags[tag],$relatedTag->name); \n }\n }\n }\n $desc = $bean->description;\n $desc = preg_replace(\"/\\r|\\n/\", \" \",$desc); //convert line breaks to spaces\n $descArray = [];\n $tagArray = [];\n $tagField = $bean->getTagField();\n $tagFieldProperties = $bean->field_defs[$tagField];\n $descArray = explode(\" \", $desc); //split description into array items at each space\n foreach ($descArray as $key => $descValue){\n if (substr($descValue, 0, 1) == '#') {\n $descValue = substr($descValue,1); \n array_push($tagArray,$descValue); //makes array of only those words beginning with hashtag\n foreach($tagArray as $tagName){\n $tagName = preg_replace('/[.,;:?!)}]/', '', $tagName); //removes punctuation from each word\n array_push($tags[tag],$tagName); //adds hashtag words as tags\n }\n }\n }\n\n //create and relate new and exiting tag records\n $SugarFieldTag = new SugarFieldTag();\n $SugarFieldTag->apiSave($bean, $tags, $tagField, $tagFieldProperties);\n }\n }", "function run_hook($hook_name, $args) {\n\n // Run a hook\n md_run_hook($hook_name, $args);\n \n }", "function flag_tag_handler($set = 1) {\n\t\t\t// Do nothing since 1.6\n\t\t\treturn;\n\t\t}", "public static function hook($event_name, $fn) \n {\n $instance = self::get_instance();\n $instance->hooks[$event_name][] = $fn;\n }", "public function hook_after_add($id) {\n\n }", "public function getName()\n {\n return 'azine_mailgun_webhooks_bundle_twig_extension';\n }", "function Core_AddAction( $hookName, $function )\n{\n\tCore_ModuleManager::getInstance()->dispatcher->addObserver( $function, $hookName );\n}", "function register_block_core_tag_cloud()\n {\n }", "public function register_hooks() {\n\t\tadd_filter( 'post_link_category', [ $this, 'post_link_category' ], 10, 3 );\n\t}", "public function attach_hooks() {\n\n\t\t$this->define_hooks();\n\n\t}", "public function getHookName(): string\n {\n return $this->hook_name;\n }", "function we_include_tag_file($name){\n\t$fn = 'we_tag_' . $name;\n\n\t// as default: all tag_functions are in this file.\n\tif(function_exists($fn)){\n\t\t// do noting\n\t\treturn true;\n\t}\n\tif(file_exists(WE_INCLUDES_PATH . 'we_tags/' . $fn . '.inc.php')){\n\t\trequire_once (WE_INCLUDES_PATH . 'we_tags/' . $fn . '.inc.php');\n\t\treturn true;\n\t}\n\t//error check is only required for custom tags\n\tif(file_exists(WE_INCLUDES_PATH . 'we_tags/custom_tags/' . $fn . '.inc.php')){\n\t\trequire_once (WE_INCLUDES_PATH . 'we_tags/custom_tags/' . $fn . '.inc.php');\n\t\treturn function_exists($fn) ? true : parseError(sprintf(g_l('parser', '[tag_not_known]'), trim($name)));\n\t}\n\n\t$toolinc = '';\n\tif(we_tool_lookup::getToolTag($name, $toolinc, true)){\n\t\trequire_once ($toolinc);\n\t\treturn function_exists($fn) ? true : parseError(sprintf(g_l('parser', '[tag_not_known]'), trim($name)));\n\t}\n\tif(strpos(trim($name), 'if') === 0){ // this ifTag does not exist\n\t\techo parseError(sprintf(g_l('parser', '[tag_not_known]'), trim($name)));\n\t\treturn false;\n\t}\n\treturn parseError(sprintf(g_l('parser', '[tag_not_known]'), trim($name)));\n}", "public function get_tag()\n {\n }", "public function getTag();", "public function getTag();", "public function register_hooks() {\n\t\t\\add_action( 'admin_action_duplicate_post_check_changes', [ $this, 'check_changes_action_handler' ] );\n\t}", "private function addTag()\n {\n $params = array();\n $params['db_link'] = $this->db;\n $params['ticket_id'] = $_REQUEST['ticket_id'];\n \n $data = array();\n $tagTitle = stripslashes(trim($_REQUEST['tag']));\n $tag = Utils::sanitize($tagTitle);\n \n $Tickets = new Tickets($params);\n $Tickets->addTag($tag, $tagTitle);\n \n echo '[{\"isError\":0, \"message\":\"Successfully added tag\"}]';\n exit;\n }", "protected function get_tag() {\n\t\treturn self::TAG;\n\t}", "function __construct($_name=\"\") {\n $this->_name = $_name ; \n \n // $this->hooks();\n \n }", "private function _addTags()\n {\n $metadata = $this->getRecordMetadata();\n $this->_record->addTags($metadata[self::TAGS]);\n }", "private function hooks(): void {\n\t\t// Steps loader hooks.\n\n\t\tadd_filter(\n\t\t\t'learndash_breezy_localize_script_data',\n\t\t\t$this->container->callback( Steps\\Loader::class, 'add_scripts_data' )\n\t\t);\n\t\tadd_action(\n\t\t\t'wp_ajax_' . Steps\\Loader::$sub_steps_ajax_action_name,\n\t\t\t$this->container->callback( Steps\\Loader::class, 'handle_sub_steps_ajax_request' )\n\t\t);\n\t\tadd_action(\n\t\t\t'wp_ajax_nopriv_' . Steps\\Loader::$sub_steps_ajax_action_name,\n\t\t\t$this->container->callback( Steps\\Loader::class, 'handle_sub_steps_ajax_request' )\n\t\t);\n\t}", "public function register_hooks() {\n\t\tadd_action( 'admin_init', [ $this, 'admin_init' ] );\n\t}", "function template_tag_handler( $id = \"\", $pos = \"\", $dload = \"\", $play = \"\", $list = \"\" ) {\n\t\t\t\n\t\t\t$this->putTag_runCount++;\n\t\t\tif ( $this->theSettings['disable_template_tag'] == \"true\" ) { return; }\n\t\t\t\n\t\t\tif ( !empty($id) && !is_numeric($id) ) {\n\t\t\t\t$this->external_call = true;\n\t\t\t\t$shortcodes_return = do_shortcode( $id );\n\t\t\t\t$this->external_call = false;\n\t\t\t}\n\t\t\techo $shortcodes_return;\n\t\t\treturn;\t\t\t\n\t\t}", "public function getName()\n {\n return 'tags';\n }", "public function register_hooks() {\n\t\tadd_filter( 'acf/pre_render_fields', array( $this, 'fields_on_translated_options_page' ), 10, 2 );\n\t\tadd_filter( 'acf/update_value', array( $this, 'overwrite_option_value' ), 10, 4 );\n\t\tadd_filter( 'acf/validate_post_id', [ $this, 'append_language_code_for_option_pages' ] );\n\t}", "private function hooks() {\n\t\t// Register rewrite tags.\n\t\tadd_action( 'wct_add_rewrite_tags', array( $this, 'add_rewrite_tags' ) );\n\n\t\t// Register the rewrite rules\n\t\tadd_action( 'wct_add_rewrite_rules', array( $this, 'add_rewrite_rules' ) );\n\n\t\t// Register the permastructs\n\t\tadd_action( 'wct_add_permastructs', array( $this, 'add_permastructs' ) );\n\t}", "function THEME_QuickTags() {\n if ( ! wp_script_is('quicktags') )\n return;\n ?>\n <script type=\"text/javascript\">\n QTags.addButton( 'embed_tag', 'embed', '<embed>', '</embed>', 'o', 'Make Embed Tag', 777 );\n </script>\n\n <script type=\"text/javascript\">\n QTags.addButton( 'spoiler_tag', 'spoiler', '<div class=\"spoiler Spoiler\"><div class=\"spoiler_head ToggleSpoiler\"><span class=\"spoiler_title\">Click for spoiler</span><span class=\"nice_svg tiny\"><svg><use href=\"#arrow_down\"></use></svg></span></div><div class=\"spoiler_content\">', '</div><div class=\"spoiler_footer click_able ToggleSpoiler\"><span class=\"nice_svg small\"><svg><use href=\"#arrow_down\"></use></svg></span></div></div>', 'o', 'Make Embed Tag', 777 );\n </script>\n <?php\n}", "public function _before_addon_load($name = NULL) {\n $this->before_addon_load($name);\n App::Module('Hook')->getHandler('Callback', 'before_addon_load', $name);\n }", "private function registerHook($hook, $phpcode) {\r\n $list =& vBulletinHook::init()->pluginlist;\r\n\r\n // Make sure the key exists, even if as an empty string\r\n if (empty($list[$hook])) $list[$hook] = '';\r\n // Append new code\r\n $list[$hook] .= \"\\n{$phpcode}\";\r\n }", "abstract public function register_hook_callbacks();", "function Piwik_AddAction( $hookName, $function )\n{\n\tPiwik_PluginsManager::getInstance()->dispatcher->addObserver( $function, $hookName );\n}", "protected function registerHooks() {\n\t\t$hooks = $this->elgg()->hooks;\n\t\t\n\t\t$hooks->registerHandler('action:validate', 'notifications/settings', __NAMESPACE__ . '\\Notifications::saveUserNotificationsSettings');\n\t\t$hooks->registerHandler('entity:url', 'object', __NAMESPACE__ . '\\Widgets::widgetTitleURL');\n\t\t$hooks->registerHandler('export:counters', 'elasticsearch', __NAMESPACE__ . '\\Elasticsearch::exportCounter');\n\t\t$hooks->registerHandler('group_tool_widgets', 'widget_manager', __NAMESPACE__ . '\\Widgets::groupToolBasedWidgets');\n\t\t$hooks->registerHandler('handlers', 'widgets', __NAMESPACE__ . '\\Widgets::registerHandlers');\n\t\t$hooks->registerHandler('prepare', 'notification:create:object:thewire', __NAMESPACE__ . '\\Notifications::prepareNotificationSubject', 600);\n\t\t$hooks->registerHandler('prepare', 'notification:create:object:thewire', __NAMESPACE__ . '\\Notifications::prepareReshareNotification', 700);\n\t\t$hooks->registerHandler('register', 'menu:entity', __NAMESPACE__ . '\\Menus::entityRegisterImprove', 501);\n\t\t$hooks->registerHandler('register', 'menu:social', __NAMESPACE__ . '\\Menus::entityRegisterReshare');\n\t\t$hooks->registerHandler('register', 'menu:entity', __NAMESPACE__ . '\\Menus::entityRegisterFeature');\n\t\t$hooks->registerHandler('register', 'menu:owner_block', __NAMESPACE__ . '\\Menus::ownerBlockRegister');\n\t\t$hooks->registerHandler('register', 'menu:page', __NAMESPACE__ . '\\Menus::pageRegister');\n\t\t$hooks->registerHandler('supported_types', 'entity_tools', __NAMESPACE__ . '\\Migrate::registerClass');\n\t}", "public function hook_before_add(&$arr) {\n\n }", "public function replace_3rd_party_pugins_hooks(){\n }", "public function remove_hooks()\n {\n }", "public function remove_hooks()\n {\n }", "function load_wp_auto_tagging(){\n\t\tif ( is_admin() ) {\n\t\t\tif ( apply_filters( 'wp_auto_tag_pre_check', class_exists( 'wp_auto_tagging' ) && wp_auto_tagging::prerequisites() ) ) {\n\t\t\t\trequire_once 'settings.php';\n\t\t\t\tregister_activation_hook( __FILE__, array('wp_auto_tagging_settings', 'register_defaults'));\n\t\t\t\tadd_action('init', array('wp_auto_tagging', 'instance'), -100, 0); \n\t\t\t} else {\n\t\t\t\t// let the user know prerequisites weren't met\n\t\t\t\tadd_action('admin_head', array('wp_auto_tagging', 'fail_notices'), 0, 0);\n\t\t\t}\n\t\t}\n\t}", "abstract protected function register_hook_callbacks();", "public function addTag($tag) {\n $this->init(); //it would actually work without it\n\n if (!in_array($tag,$this->tags)) {\n $tag = trim($tag);\n\n $this->tags['new'][] = $tag;\n return true;\n }\n\n return false;\n }", "function OnBeforeAdd(){\n }" ]
[ "0.74090123", "0.71108425", "0.71108425", "0.6898992", "0.6557372", "0.6431819", "0.64157265", "0.6414852", "0.64107656", "0.6336937", "0.6331583", "0.6303621", "0.62904334", "0.6263885", "0.62256926", "0.62168354", "0.61647487", "0.615726", "0.61542165", "0.614869", "0.61046475", "0.60979724", "0.60856813", "0.6075219", "0.6058316", "0.60517037", "0.6043627", "0.60185444", "0.6006099", "0.59952253", "0.5988475", "0.59747577", "0.59551275", "0.59214437", "0.5919738", "0.5919738", "0.5915983", "0.5912062", "0.5909355", "0.59091336", "0.58975124", "0.58902615", "0.58881116", "0.5879545", "0.5879545", "0.5879475", "0.58765614", "0.5871048", "0.5869103", "0.5864815", "0.5861579", "0.58583635", "0.5846688", "0.58304584", "0.58299357", "0.5820256", "0.58128697", "0.5810961", "0.58104193", "0.58067256", "0.5786884", "0.57849413", "0.5772661", "0.5766835", "0.5762935", "0.5760528", "0.57540286", "0.5751009", "0.5746719", "0.57443374", "0.5742976", "0.57325715", "0.57261115", "0.5722623", "0.5722623", "0.5722492", "0.57158226", "0.5715463", "0.5708209", "0.56966007", "0.5694268", "0.56924516", "0.56761247", "0.56750655", "0.5673991", "0.5672768", "0.5656911", "0.56502646", "0.5649196", "0.56478345", "0.5635244", "0.5634271", "0.5632211", "0.5625668", "0.5622492", "0.5622492", "0.5609361", "0.5606418", "0.5605064", "0.55970615" ]
0.6245951
14
Output an open tag or a single tag ($content === null)
public static function tag(string $name, array|string $attributes = [], string $content = null): string { $name = self::cleanTagName($name); if (array_key_exists($name, self::$attributes_alter)) { $attributes = Kernel::singleton()->application()->invokeTypedFilters(__METHOD__ . "::$name", $attributes, [ $attributes, $content, ], 0); } return "<$name" . self::attributes(self::toAttributes($attributes)) . ($content === null ? ' />' : ">$content</$name>"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function render($content)\n\t{\n\t\t$tag\t = $this->getTag();\n\t\t$placement = $this->getPlacement();\n\t\t$noAttribs = $this->getOption('noAttribs');\n\t\t$openOnly = $this->getOption('openOnly');\n\t\t$closeOnly = $this->getOption('closeOnly');\n\t\t$this->removeOption('noAttribs');\n\t\t$this->removeOption('openOnly');\n\t\t$this->removeOption('closeOnly');\n\n\t\t$attribs = null;\n\t\tif (!$noAttribs) {\n\t\t\t$attribs = $this->getOptions();\n\t\t}\n\n\t\t$element = $this->getElement();\n\t\t$errors = $element->getMessages();\n\t\tif ( ! empty($errors)) {\n\t\t\t$attribs['class'] .= ' error';\n\t\t}\n\t\telse {\n\t\t\t$attribs['class'] = str_replace(' error', '', $attribs['class']);\n\t\t}\n\n\t\tswitch ($placement) {\n\t\t\tcase self::APPEND:\n\t\t\t\tif ($closeOnly) {\n\t\t\t\t\treturn $content . $this->_getCloseTag($tag);\n\t\t\t\t}\n\t\t\t\tif ($openOnly) {\n\t\t\t\t\treturn $content . $this->_getOpenTag($tag, $attribs);\n\t\t\t\t}\n\t\t\t\treturn $content\n\t\t\t\t\t . $this->_getOpenTag($tag, $attribs)\n\t\t\t\t\t . $this->_getCloseTag($tag);\n\t\t\tcase self::PREPEND:\n\t\t\t\tif ($closeOnly) {\n\t\t\t\t\treturn $this->_getCloseTag($tag) . $content;\n\t\t\t\t}\n\t\t\t\tif ($openOnly) {\n\t\t\t\t\treturn $this->_getOpenTag($tag, $attribs) . $content;\n\t\t\t\t}\n\t\t\t\treturn $this->_getOpenTag($tag, $attribs)\n\t\t\t\t\t . $this->_getCloseTag($tag)\n\t\t\t\t\t . $content;\n\t\t\tdefault:\n\t\t\t\treturn (($openOnly || !$closeOnly) ? $this->_getOpenTag($tag, $attribs) : '')\n\t\t\t\t\t . $content\n\t\t\t\t\t . (($closeOnly || !$openOnly) ? $this->_getCloseTag($tag) : '');\n\t\t}\n\t}", "public function render($content)\n {\n $tag = $this->getTag();\n $placement = $this->getPlacement();\n $noAttribs = $this->getOption('noAttribs');\n $openOnly = $this->getOption('openOnly');\n $closeOnly = $this->getOption('closeOnly');\n\n $this->removeOption('noAttribs');\n $this->removeOption('openOnly');\n $this->removeOption('closeOnly');\n\n $attribs = null;\n if (!$noAttribs) {\n $attribs = $this->getOptions();\n }\n\n switch ($placement) {\n case self::APPEND:\n if ($closeOnly) {\n return $content . $this->_getCloseTag($tag);\n }\n if ($openOnly) {\n return $content . $this->_getOpenTag($tag, $attribs);\n }\n return $content\n . $this->_getOpenTag($tag, $attribs)\n . $this->_getCloseTag($tag);\n case self::PREPEND:\n if ($closeOnly) {\n return $this->_getCloseTag($tag) . $content;\n }\n if ($openOnly) {\n return $this->_getOpenTag($tag, $attribs) . $content;\n }\n return $this->_getOpenTag($tag, $attribs)\n . $this->_getCloseTag($tag)\n . $content;\n default:\n return (($openOnly || !$closeOnly) ? $this->_getOpenTag($tag, $attribs) : '')\n . $content\n . (($closeOnly || !$openOnly) ? $this->_getCloseTag($tag) : '');\n }\n }", "private static function tag($tag, $arguments=false, $content='', $open=false) {\n\t\t$tag = strtolower(trim($tag));\n\t\t\n\t\t//start tag\n\t\t$return = '<' . $tag;\n\n\t\t//format arguments\n\t\t$arguments = self::arguments($arguments);\n\t\tforeach ($arguments as $key=>$value) {\n\t\t\tif ($value !== false) $return .= ' ' . strtolower(trim($key)) . '=\"' . htmlentities(trim($value)) . '\"';\n\t\t}\n\t\t\n\t\t//close tag\n\t\t$return .= '>';\n\t\tif (!in_array($tag, array('br', 'hr', 'img', 'meta'))) {\n\t\t\t//is a container tag\n\t\t\t$return .= $content;\n\t\t\tif ($open === false) $return .= '</' . $tag . '>';\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "static function renderTag($name, $attributes = null, $content = null)\n {\n if ($content)\n {\n self::renderOpenTag($name, $attributes);\n echo $content.\"</$name>\";\n }\n else\n {\n self::renderSingleTag($name, $attributes);\n }\n }", "function output_tag($name='',$content='',$attrs='')\n{\n echo tag($name,$content,$attrs);\n}", "function tag($tag_name, $op, $pref = '', $nl = false, $extra = '')\n{\n echo $pref . '<' ;\n if ($op == 'close') {\n echo '/' ;\n }\n echo $tag_name ;\n if ($extra != '') {\n echo ' ' . $extra ;\n }\n echo '>' ;\n if ($nl == true) {\n NL() ;\n }\n}", "static function close_tags($content) {\n $position = 0;\n $open_tags = array();\n $ignored_tags = array('br', 'hr', 'img');\n\n while (($position = strpos($content, '<', $position)) !== FALSE)\n {\n if (preg_match(\"|^<(/?)([a-z\\d]+)\\b[^>]*>|i\", substr($content, $position), $match))\n {\n $tag = strtolower($match[2]);\n if (in_array($tag, $ignored_tags) == FALSE)\n {\n //тег открыт\n if (isset($match[1]) AND $match[1] == '')\n {\n if (isset($open_tags[$tag]))\n $open_tags[$tag]++;\n else\n $open_tags[$tag] = 1;\n }\n //тег закрыт\n if (isset($match[1]) AND $match[1] == '/')\n {\n if (isset($open_tags[$tag]))\n $open_tags[$tag]--;\n }\n }\n $position += strlen($match[0]);\n }\n else\n $position++;\n }\n\n foreach ($open_tags as $tag => $count_not_closed) {\n $content .= str_repeat(\"</{$tag}>\", $count_not_closed);\n }\n\n return $content;\n }", "function output_single_tag($name='', $attrs='')\n{\n echo single_tag($name,$attrs);\n}", "public final function startTag() : string\n {\n return $this->name ? '<' . $this->name . $this->attributes() . (static::$xhtml && $this->isEmpty ? ' />' : '>') : '';\n }", "public function tag($tag, $htmlOptions = array(), $content = false, $closeTag = true) {\n\t\t$html = '<' . $tag . self::renderAttributes($htmlOptions);\n\t\tif ($content === false)\n\t\t\treturn $closeTag ? $html . ' />' : $html . '>';\n\t\telse\n\t\t\treturn $closeTag ? $html . '>' . $content . '</' . $tag . '>' : $html . '>' . $content;\n\t}", "public function htmlTag($tag, array $attribs = array(), $content = null, $type = self::TAG_BOTH)\r\n {\r\n $closingBracket = $this->getClosingBracket();\r\n\r\n // Content\r\n if (is_array($content)) {\r\n $content = implode(self::EOL, $content);\r\n }\r\n\r\n $xhtml = '';\r\n\r\n // Tag header\r\n switch ($type) {\r\n case self::TAG_OPEN:\r\n $xhtml .= '<' . $tag . '' . $this->_htmlAttribs($attribs) . '>';\r\n $xhtml .= $content;\r\n break;\r\n\r\n case self::TAG_CLOSE:\r\n $xhtml .= '</' . $tag . $closingBracket;\r\n break;\r\n\r\n case self::TAG_BOTH:\r\n $xhtml .= '<' . $tag . '' . $this->_htmlAttribs($attribs) . '>';\r\n $xhtml .= $content;\r\n $xhtml .= '</' . $tag . $closingBracket;\r\n break;\r\n\r\n case self::TAG_ONLY:\r\n $xhtml .= '<' . $tag . '' . $this->_htmlAttribs($attribs) . $closingBracket;\r\n break;\r\n }\r\n\r\n return $xhtml;\r\n }", "static function div_open($arguments=false, $content='') {\n\t\treturn self::tag('div', $arguments, $content, true);\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 getOpeningTag() {\n return $this->openingTag;\n }", "public function getOpenTagWrapper()\n {\n }", "public function renderContentBegin()\n {\n echo CHtml::openTag('div', $this->htmlContentOptions);\n if (!empty($this->content))\n echo $this->content;\n }", "function otag($tag=false, $class='', $style='', $id='', $extra='')\n\t{\n\t\tif($tag == false)\n\t\t{\n\t\t\t$tag = $this->default_tag['tag'];\n\t\t\t$class = $this->default_tag['class'];\n\t\t\t$style = $this->default_tag['style'];\n\t\t\t$extra = $this->default_tag['extra'];\n\t\t}\n\t\t$class = ($class != '' ? ' class=\"' . $class . '\"' : '');\n\t\t$style = ($style != '' ? ' style=\"' . $style . '\"' : '');\n\t\t$id = ($id != '' ? ' id=\"' . $id . '\"' : '');\n\t\t$extra = ($extra != '' ? ' ' . $extra : '');\n\t\tarray_push($this->closetags, $tag);\n\t\treturn $this->xecho('<' . $tag . $class . $style . $id . $extra . '>');\n\t}", "public function renderContentBegin()\n {\n echo CHtml::openTag('div', $this->htmlContentOptions);\n if (!empty($this->content)) {\n echo $this->content;\n }\n }", "private function pop_tag($tag) {\n if ($tag === 'header') $tag = 'h2';\n\n $opener = null;\n if (count($this->stack) > 0) {\n $opener = array_pop($this->stack);\n }\n if ($opener === null || $opener['@name'] !== $tag) throw $this->makeError(\"</\" . $tag . \"> occurred without a corresponding open tag.\");\n\n switch ($tag) {\n case 'comment':\n $this->comment_nest_level--;\n break;\n\n case 'enablebackticks':\n case 'disablebackticks':\n $this->backticks_for_inline_code_enabled = $opener['@name'] === 'enablebackticks';\n break;\n\n case 'bookmark':\n $uid = $opener['@uid'];\n $label = implode('', $this->active_text_listeners[$uid]);\n unset($this->active_text_listeners[$uid]);\n for ($i = count($this->bookmark_list) - 1; $i >= 0; --$i) {\n if ($this->bookmark_list[$i]['uid'] === $uid) {\n $this->bookmark_list[$i]['label'] = $label;\n }\n }\n break;\n\n case 'image':\n if (isset($opener['@url'])) {\n $url = trim($opener['@url']);\n $alt_text = trim($opener['alt']);\n if ($alt_text === '') {\n $t = explode('/', $url);\n $alt_text = htmlspecialchars($t[count($t) - 1]);\n }\n\n if (isset($opener['mouseover'])) {\n $opener['title'] = $opener['mouseover'];\n unset($opener['mouseover']);\n }\n\n $this->output('<img src=\"' . $url . '\" alt=\"' . $alt_text . '\"');\n foreach ($opener as $attr => $value) {\n if ($attr[0] !== '@' && $attr !== 'comment') {\n $this->output(' ' . $attr . '=\"' . $value . '\"');\n }\n }\n $this->output('/>');\n }\n break;\n\n case 'note':\n case 'warning':\n $this->output('</div>');\n break;\n\n case 'code':\n $syntax = isset($opener['language']) ? $opener['language'] : 'none';\n $classes = isset($opener['classes']) ? explode(',', str_replace(' ', ',', $opener['classes'])) : array(); // classes are trimmed and ignored if empty.\n $code = $opener['@code'];\n $html = (new BlakesHtmlSyntaxHighlighter($syntax))->highlight($code, $classes);\n\n $this->output('<div');\n foreach ($opener as $attr => $value) {\n if ($attr[0] !== '@' && $attr !== 'language' && $attr !== 'classes') {\n $this->output(' ' . $attr . '=\"' . $value . '\"');\n }\n }\n $this->output('>');\n\n $this->output($html);\n $this->output('</div>');\n\n break;\n\n case 'tableofcontents':\n break;\n\n default:\n $this->output('</' . $tag . '>');\n break;\n }\n }", "public function logicTag($start, $end, &$content)\n {\n $result = explode($start, $content);\n if (isset($result[1]) === true) {\n $result = explode($end, $result[1]);\n\n return $result[0];\n }\n\n return '';\n }", "public function output($content = '') {\n $toPlaceholder = $this->getProperty('toPlaceholder','');\n if (!empty($toPlaceholder)) {\n $this->modx->setPlaceholder($toPlaceholder,$content);\n return '';\n }\n return $content;\n }", "private function processContent(){\n\t\t$this->textEnd = strpos($this->raw,\"</{$this->tag}\");\n\t\t$this->text = trim(substr($this->raw, $this->textStart, $this->textEnd - $this->textStart));\n\t}", "function wp_filter_content_tags($content, $context = \\null)\n {\n }", "function CloseTag() {\n\t\tif (!empty($this->tag)) {\n\t\t\tfor ($in=0;$in<$this->indent; $in++) {\n\t\t\t\t$this->outputCode.=\"\";\n\t\t\t}\n\t\t\tif (!empty($this->tag))\n\t\t\t$this->outputCode.=\"</\".$this->tag.\">\";\n\t\t}\n\t\t//$this->outputCode.=\"\\n\";\n\t\t$this->indent--;\n\t}", "public function renderOpenComment($node) {\n\t\tif ($node->isConditional) return parent::renderOpenComment($node);\n\t}", "private static function replaceTags($content)\n {\n $content = preg_replace(self::FORMAT['echo'], '<?php echo htmlspecialchars($2, ENT_QUOTES) ?>', $content);\n $content = preg_replace(self::FORMAT['plain_echo'], '<?php echo $2 ?>', $content);\n $content = preg_replace(self::FORMAT['tag'], '<?php $2 ?>', $content);\n\n return $content;\n }", "public function noContent()\n {\n return is_null($this->content) || empty($this->content);\n }", "public function strip_empty_tags( $content ) {\n\t\treturn preg_replace( '/<([a-z][\\w]*) ?><\\\\/\\\\1>/', '', $content );\n\t}", "function endTag ($tag = NULL)\n\t{\n\t\t$html = $tag ? \"</$tag>\" : \"</$this->tag>\";\n\t\t$this -> tag = '';\n\n\t\treturn $html;\n\t}", "protected function output() {\n\t\t$content = $this->option( 'content' );\n\t\t$content_path = $this->option( 'content_path' );\n\t\t$mmarkdown = $this->option( 'markdown' );\n\n\t\tif ( ! empty( $content_path ) && file_exists( $content_path ) ) {\n\t\t\twponion_catch_output();\n\t\t\tinclude $content_path;\n\t\t\t$content = wponion_catch_output( false );\n\t\t} elseif ( ! empty( $content ) && wponion_is_callable( $content ) ) {\n\t\t\twponion_catch_output();\n\t\t\techo wponion_callback( $content );\n\t\t\t$content = wponion_catch_output( false );\n\t\t}\n\n\t\tif ( true === $mmarkdown && ! empty( $content ) ) {\n\t\t\t$content = '<div class=\"wponion-markdown-output\">' . wponion_markdown( $content ) . '</div>';\n\t\t}\n\t\treturn $this->before() . do_shortcode( $content ) . $this->after();\n\t}", "protected function renderElement() {\n $result = \"\";\n $result .= $this->getOpeningTag();\n $result .= (!empty($this->options['content'])) ? $this->options['content'] : \"\";\n $result .= $this->getClosingTag();\n return $result;\n }", "protected static function handle_php_tags($content) {\n\t\treturn preg_replace('/\\<\\?(php|=)(.*?)\\?\\>/s', '', $content);\n\t}", "public function is_tag_closer()\n {\n }", "function echoTag ($id,$tag,$highlight,$text,$markObjects)\r{\r\t\r\techo \"<span id=$id>\";\r\tif ($markObjects) {\r\t\tif ($tag == 'EVENT') { echo \"<span class=event>\"; } \r\t\telseif ($tag == 'TIMEX3') { echo \"<span class=timex>\"; } \r\t\telse { echo \" <span class=signal>\"; }\r\t}\r\tif ($highlight) { echo '<strong>'; }\r\tif ($id{0} == 'e') { $tagtype = 'event'; }\r\telseif ($id{0} == 't') { $tagtype = 'timex'; }\r\telseif ($id{0} == 's') { $tagtype = 'signal'; }\r\techo \"<span style=\\\"cursor:crosshair\\\" onClick=\\\"MM_goToURL('parent','displayTag.php?tagtype=$tagtype&text=$text')\\\">\";\r\techo $text;\r\techo \"</span>\";\r\tif ($highlight) { echo '</strong>'; }\r\tif ($markObjects) {\r\t\techo '</span><sub>'.$id.'</sub>';\r\t}\r\techo \"</span>\";\r}", "protected static function parse_end(nodes\\Tag $node) {\n\t\t\n\t if($node->content[0] == '<') {\n\t $node->content = substr($node->content, 1);\n\t $node->trim_inner = true;\n\t }\n\t \n\t if($node->content[0] == '>') {\n\t $node->content = substr($node->content, 1);\n\t $node->trim_outer = true;\n\t $node->render_newline = false;\n\t if($node->previous_sibling())\n\t $node->previous_sibling()->render_newline = false;\n\t }\n\t\t\n\t\tif(in_array($node->tag_name, static::$parser->option('preserve')))\n\t\t\t$node->trim_inner = true;\n\t\t\n\t\tif($node->content[0] == '/') {\n\t\t\tif($node->content != '/')\n\t\t\t\t$node->exception('Parse error: self-closing tags cannot have content');\n\t\t\t\n\t\t\t$node->content = substr($node->content, 1);\n\t\t\t$node->self_closing = true;\n\t\t}\n\t\t\n\t\tif($node->content = trim($node->content)) {\n\t\t\t$text_node = new nodes\\Text();\n\t\t\t$text_node->set_from_parser(static::$parser);\n\t\t\t$text_node->root = $node->root;\n\t\t\t$text_node->parent = $node;\n\t\t\t$text_node->indent_level = 0;\n\t\t\t$text_node->content = $node->content;\n\t\t\tText::parse($text_node);\n\t\t\t\n\t\t\t$node->content = $text_node;\n\t\t}\n\t\t\n\t\tif($node->self_closing or $node->content)\n\t\t\tstatic::$parser->expect_indent(Parser::EXPECT_LESS | Parser::EXPECT_SAME);\n\t\t\n\t}", "public static function tag(string $name, $content = '', array $attr = null, string $indent = null, int $level = 0): string\n {\n // treat an explicit `null` value as an empty tag\n // as void tags are already covered below\n if ($content === null) {\n $content = '';\n }\n\n // force void elements to be self-closing\n if (static::isVoid($name) === true) {\n $content = null;\n }\n\n return parent::tag($name, $content, $attr, $indent, $level);\n }", "function tf_html_tag($tag, $attr = null, $end = null)\r\n {\r\n $inner = array($tag);\r\n if (isset($attr)) {\r\n foreach ($attr as $k => $v) {\r\n if (is_numeric($k)) {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($v), esc_attr($v));\r\n }\r\n else if ($v === true) {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($k), esc_attr($k));\r\n }\r\n else if ($v === false) {\r\n # ignore\r\n }\r\n else {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($k), esc_attr($v));\r\n }\r\n }\r\n }\r\n\r\n if ($end === true) {\r\n # close ELEMENT as HTML\r\n # <script></script>\r\n $body = '';\r\n $close = '</'.$tag.'>';\r\n }\r\n else if ($end === false) {\r\n # close ELEMENT as XML\r\n $inner[] = '/';\r\n $body = '';\r\n $close = '';\r\n }\r\n else {\r\n # if there is content close element, otherwise leave it open\r\n if (empty($end)) {\r\n $body = '';\r\n $close = '';\r\n }\r\n else {\r\n $body = strval($end);\r\n $close = '</'.$tag.'>';\r\n }\r\n }\r\n\r\n $open = '<'.implode(' ', $inner).'>';\r\n return $open.$body.$close;\r\n }", "public static function openTag($script, $openTag, $phpOpenTag, $endOpenTag, $phpEndOpenTag)\n {\n $data = Strings::splite($script, $openTag);\n //\n $output = $data[0];\n //\n for ($i = 1; $i < Collection::count($data); $i++) {\n $output .= $phpOpenTag;\n //\n $next = Strings::splite($data[$i], $endOpenTag);\n $output .= $next[0].$phpEndOpenTag;\n //\n for ($j = 1; $j < Collection::count($next); $j++) {\n if ($j == (Collection::count($next) - 1)) {\n $output .= $next[$j];\n } else {\n $output .= $next[$j].$endOpenTag;\n }\n }\n }\n\n return $output;\n }", "function jstag($content)\n\t{\n\t\treturn $this->xecho('<script type=\"text/javascript\">' . $content . '</script>');\n\t}", "private function hasHTMLTags()\n {\n return !(strcmp($this->content, strip_tags($this->content)) == 0);\n }", "public function getTag(): string|null;", "public function render_content()\n {\n if ( !empty( $this->label ) && !empty( $this->url ) ) : ?>\n <a\n href=\"<?= esc_url( $this->url ) ?>\"\n title=\"<?= esc_attr( !empty( $this->description ) ? $this->description : $this->label ) ?>\"\n target=\"<?= esc_attr( $this->target ) ?>\"\n ><?= esc_html( $this->label ) ?></a>\n <?php endif;\n }", "function echoContent($content) {\n if (method_exists($this->reporter, 'paintHTML')) {\n $this->reporter->paintHTML(\"<div class='rn_Hidden rn_verboseContent'>$content</div>\");\n }\n else {\n $this->dump($content);\n }\n }", "public function getContentType(): ?TagInterface;", "public function closeTag(): string\n {\n return $this->templateCloseTag;\n }", "public function getOutput($tag = 'body')\n\t{\n\t\tif (empty($this->content)) return;\n\n\t\t$content = '';\n\n\t\tif ($tag == 'body' && !$this->separate_assets) {\n\t\t\tif ($this->head->childNodes->length > 0) {\n\t\t\t\tforeach ($this->head->childNodes as $child) {\n\t\t\t\t\t$content .= $child->ownerDocument->saveHTML($child);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($this->body->childNodes->length > 0) {\n\t\t\tforeach ($this->body->childNodes as $child) {\n\t\t\t\t$content .= $child->ownerDocument->saveHTML($child);\n\t\t\t}\n\t\t}\n\t\treturn html_entity_decode($content);\n\t}", "function doTagStuff(){}", "function addition_tag($con, $tag)\n{\n echo $con ? $tag : \"\";\n}", "function nontag($content, $repeat=1)\n\t{\n\t\t$content = ($this->entitize_content) ? htmlentities('' . $content) : $content;\n\t\t$toecho = '';\n\t\tfor($i = 0; $i < $repeat; $i ++)\n\t\t{\n\t\t\t$toecho .= $content;\n\t\t}\n\t\treturn $this->xecho($toecho);\n\t}", "function ctag($close=1)\n\t{\n\t\t$close = ($close == 'all' ? count($this->closetags) : $close);\n\t\t$toecho = '';\n\t\tfor($i = 0; $i < $close; $i ++)\n\t\t{\n\t\t\t$thisclose = array_pop($this->closetags);\n\t\t\t$toecho .= '</' . $thisclose . '>';\n\t\t}\n\t\treturn $this->xecho($toecho);\n\t}", "static function renderOpenTag($name, $attributes = null)\n {\n echo '<'.$name;\n self::renderAttributes($attributes);\n echo '>'.PHP_EOL;\n }", "private function tag_close($tag)\r\n\t{\r\n\t\tif(!$this->current_tag instanceof SBBCodeParser_Document\r\n\t\t\t&& $tag !== $this->current_tag->tag())\r\n\t\t{\r\n\t\t\t$closing_tags = $this->bbcodes[$this->current_tag->tag()]->closing_tags();\r\n\r\n\t\t\tif(in_array($tag, $closing_tags) || in_array('/' . $tag, $closing_tags))\r\n\t\t\t\t$this->current_tag = $this->current_tag->parent();\r\n\t\t}\r\n\t\t\r\n\t\tif($this->current_tag instanceof SBBCodeParser_Document)\r\n\t\t\treturn false;\r\n\t\telse if($tag !== $this->current_tag->tag())\r\n\t\t{\r\n\t\t\t// check if this is a tag inside another tag like\r\n\t\t\t// [tag1] [tag2] [/tag1] [/tag2]\r\n\t\t\t$node = $this->current_tag->find_parent_by_tag($tag);\r\n\t\t\t\r\n\t\t\tif($node !== null)\r\n\t\t\t{\r\n\t\t\t\t$this->current_tag = $node->parent();\r\n\r\n\t\t\t\twhile(($node = $node->last_tag_node()) !== null)\r\n\t\t\t\t{\r\n\t\t\t\t\t$new_node = new SBBCodeParser_TagNode($node->tag(), $node->attributes());\r\n\t\t\t\t\t$this->current_tag->add_child($new_node);\r\n\t\t\t\t\t$this->current_tag = $new_node;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->current_tag = $this->current_tag->parent();\r\n\t\t\r\n\t\treturn true;\r\n\t}", "private function makeRegularTag($tagName, array $attributes = null, $content = '')\n {\n $output = \"<$tagName\";\n if ($attributes !== null) {\n $output .= ' '.$this->convertAttributes($attributes);\n }\n $output .= \">$content</$tagName>\";\n\n return $output;\n }", "public function getDefaultTag(): string|null;", "public function getFirstTagContent($tag, $input, $save = false) {\n $start = strpos($input, '<' . $tag . '>') + strlen($tag) + 2;\n\n // If the tag has attributes, remove them, for the end tag won't contain them\n if (strpos($tag, ' ') > 0) {\n $tag = substr($tag, 0, strpos($tag, ' '));\n }\n\n $end = strpos($input, '</' . $tag . '>') - $start;\n if ($end <= 0) {\n return '';\n }\n\n if ($save) {\n return trim(\n str_replace('--lt--', '<',\n str_replace('--gt--', '>', substr($input, $start, $end))\n )\n );\n }\n\n return trim(substr($input, $start, $end));\n }", "function close_html()\n{\n close_tag('html', '', true) ;\n}", "public function show() {\n // abre tag\n $this->open();\n echo \"\\n\";\n // si tiene contenido\n if ($this->children) {\n \n \n // recorre todos los objetos hijos\n foreach ($this->children as $child) {\n // si es objeto\n if (is_object($child)) {\n $child->show();\n }\n elseif ((is_string($child)) or (is_numeric($child))) {\n // si es texto\n echo $child;\n }\n }\n // cierra la tag\n $this->close();\n }\n }", "function print_tag($var, $default = '&mdash;') {\n echo isset($var) ? $var : $default;\n}", "function parse_content($node){\n $result = $node->xpath('//content'); // replace this with the XPath of the node\n if (!empty($result[0])) {\n // Optional replacements to convert custom XML tags to HTML equivalent\n $find_xml = array('section_title','section_content','section', 'texteparagraphe','titreparagraphe');\n $replace_html = array('h1','p','div','p','h2');\n $html = str_replace($find_xml, $replace_html, $result[0]->asXML());\n $node->addChild('content_html', $html);\n }\n return $node;\n}", "function tag($name='',$content='',$attrs='')\n{\n return \"<${name} ${attrs}>${content}</${name}>\";\n}", "public function the_builder_content( $content ) {\n\t\t\t$content = apply_filters( 'make_the_builder_content', $content );\n\t\t\t$content = str_replace( ']]>', ']]&gt;', $content );\n\t\t\techo $content;\n\t\t}", "function parse_content( $content ) {\n\t\tif ( is_null( $content ) ) {\n\t\t\t$this->body = null;\n\t\t}\n\n\t\t$this->body = do_shortcode( $content );\n\t}", "function renderFirst($tag = 'First') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page == 1) {\r\n\t\t\treturn '<b style=\" float:none;\" class=\"page_link\">'.$tag.'</b>';\r\n\t\t} else {\r\n\t\t\treturn '<a style=\" float:none;\" href=\"' . $this->php_self . '?page=1' . $this->append . '\">' . $tag . '</a> ';\r\n\t\t}\r\n\t}", "public function after_render($content = null) {\n\t\techo $content;\n\t}", "public static function addTags(string &$content = '') : bool\n {\n if (trim($content) === '') {\n return true;\n }\n\n $aeSession = \\MarkNotes\\Session::getInstance();\n $task = $aeSession->get('task');\n\n // Tags are only for the interface i.e. when the task is \"display\"\n if ($task !== 'display') {\n return true;\n }\n\n $aeDebug = \\MarkNotes\\Debug::getInstance();\n $aeFiles = \\MarkNotes\\Files::getInstance();\n $aeSettings = \\MarkNotes\\Settings::getInstance();\n\n $arrSettings = $aeSettings->getPlugins('options', 'tags');\n $sPrefix = $arrSettings['prefix'] ?? '§';\n $msg = $aeSettings->getText('apply_filter_tag', 'Display notes containing this tag', true);\n\n // Check if the file contains words present in the tags.json file : if the file being displayed\n // contains a word (f.i. \"javascript\") that is in the tags.json (so it's a known tag) and that\n // word is not prefixed by the \"§\" sign add it : transform the \"plain text\" word and add the \"tag\" prefix\n\n if ($aeFiles->fileExists($fname = $aeSettings->getFolderWebRoot().'tags.json')) {\n if (filesize($fname) > 0) {\n $aeJSON = \\MarkNotes\\JSON::getInstance();\n\n $arrTags = $aeJSON->json_decode($fname);\n\n foreach ($arrTags as $tag) {\n // For each tag, try to find the word in the markdown file\n\n // /( |\\\\n|\\\\r|\\\\t)+ Before the tag, allowed : space, carriage return, linefeed or tab\n // [^`\\/\\\\#_\\-§]? Before the tag, not allowed : `, /, \\, #, -, _ and § (the PREFIX_TAG)\n // ('.preg_quote($tag).') The tag term (f.i. \"javascript\"\n // (\\\\n|,|;|\\\\.|\\\\)|[[:blank:]]|$) After the tag, allowed : carriage return, comma, dot comma, dot, ending ), tag or space or end of line\n\n // Capture the full line (.* ---Full Regex--- .*)\n preg_match_all('/(.*( |\\\\n|\\\\r|\\\\t|\\\\*|\\\\#)+('.preg_quote($tag).')(\\\\n|,|;|\\\\.|\\\\)|\\\\t|\\\\*|\\\\#| |$)*)/i', $content, $matches);\n\n//@TODO : il y a un souci ave la regex qui ne devrait pas retrouver des\n//mots qui sont dans des attributs. title=\"marknotes\" ==> marknotes ne devrait\n//pas être matchés. Voir le plugin SEO qui fonctionne et qui exclu lui les\n//attributs.\n\n foreach ($matches[0] as $match) {\n if (count($match) > 0) {\n preg_match('/(.*( |\\\\n|\\\\r|\\\\t|\\\\*|\\\\#)+('.preg_quote($tag).')(?!([^<]+)?>)(\\\\n|,|;|\\\\.|\\\\)|\\\\t|\\\\*|\\\\#| |$).*)/i', $match, $matches);\n\n // The found tag is : $matches[3]\n /*<!-- build:debug -->*/\n /*if ($aeSettings->getDevMode()) {\n $aeDebug->here('Found tag '.$matches[3], 1);\n }*/\n /*<!-- endbuild -->*/\n\n // Replace, in the line, the word f.i. (don't use a preg_replace because preg_replace will replace all occurences of the word)\n\n // Line : Start a SSH connexion (original)\n // By : Start a §SSH connexion (new line)\n\n // $matches[2] : what was just before the tag f.i. \" Start a SSH, then ...\" => the space before SSH\n // $matches[3] : the tag \" Start a SSH, then ...\" => SSH\n // $matches[4] : what was just after the tag \" Start a SSH, then ...\" => the comma after SSH\n\n $sLine = str_ireplace($matches[2].$matches[3].$matches[4], $matches[2].'<span class=\"tag\" title=\"'.$msg.'\" data-task=\"fnPluginContentTag\" data-tag=\"'.$matches[3].'\">'.$matches[3].'</span>'.$matches[4], $matches[0]);\n\n // And now, replace the original line ($matches[0]) by the new one in the document.\n\n $content = str_replace($matches[0], $sLine, $content);\n } // if (count($match)>0)\n } // foreach ($matches[0] as $match)\n } // foreach\n } // if(filesize($fname)>0)\n } // if ($aeFiles->fileExists($fname=$this->_rootFolder.'tags.json'))\n\n return true;\n }", "function BeginTag($str){\r\n echo \"+TAG:\".$str;\r\n}", "function BeginTag($str){\r\n echo \"+TAG:\".$str;\r\n}", "static function div($arguments=false, $content='') {\n\t\treturn self::tag('div', $arguments, $content);\n\t}", "function end_tag() {\r\n\t\t$this->push_nodelist();\r\n\t\t\r\n\t}", "public function getOptionalContent() {}", "function atwork_semantic_field__field_tags(&$variables) {\n $output = '';\n // Token support for nodes\n if (module_exists('token') == TRUE) {\n global $user;\n\n if (arg(0) == 'node') {\n $nid = arg(1);\n }\n if (isset($nid)) {\n $node = node_load($nid);\n $data = array('node' => $node, 'user' => $user);\n }\n }\n $tag_icon = '<i class=\"icon-tag\"></i> ';\n // Render the label, if it's not hidden.\n if (!$variables['label_hidden']) {\n if (!empty($variables['label_element'])) {\n $output .= $tag_icon . '<' . $variables['label_element'] . ' class=\"' . $variables['label_classes'] . '\"' . $variables['title_attributes'] . '>';\n }\n $output .= $variables['label'] . $variables['label_suffix'] . '&nbsp;';\n if (!empty($variables['label_element'])) {\n $output .= '</' . $variables['label_element'] . '>';\n }\n }\n // Render the items.\n if (!empty($variables['content_element'])) {\n $output .= '<' . $variables['content_element'] . ' class=\"' . $variables['content_classes'] . '\"' . $variables['content_attributes'] . '>';\n }\n foreach ($variables['items'] as $delta => $item) {\n if ($variables['item_element']) {\n $output .= '<' . $variables['item_element'] . ' class=\"' . $variables['item_classes'][$delta] . '\"' . $variables['item_attributes'][$delta] . '>';\n }\n $output .= drupal_render($item);\n if ($variables['item_element']) {\n $output .= '</' . $variables['item_element'] . '>';\n }\n if (!empty($variables['item_separator']) && $delta < (count($variables['items']) - 1)) {\n $output .= $variables['item_separator'];\n }\n }\n if (!empty($variables['content_element'])) {\n $output .= '</' . $variables['content_element'] . '>';\n }\n // Render the top-level DIV.\n if (!empty($variables['field_element'])) {\n $output = '<' . $variables['field_element'] . ' class=\"' . $variables['classes'] . '\"' . $variables['attributes'] . '>' . $output . '</' . $variables['field_element'] . '>';\n }\n // Add a prefix and suffix to the field, if specified\n if (!empty($variables['field_prefix'])) {\n $output = $variables['field_prefix'] . $output;\n }\n if (!empty($variables['field_suffix'])) {\n $output .= $variables['field_suffix'];\n }\n if (isset($nid)) {\n return token_replace($output, $data);\n }\n else {\n return $output;\n }\n}", "static function make_tag( $tagname, $attrs, $content = null ) {\n\t\tif( empty( $tagname ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$html = '<' . $tagname;\n\n\t\tforeach( $attrs as $attr => $val ) {\n\t\t\t$html .= ' ' . $attr . '=\"' . esc_attr( $val ) . '\"';\n\t\t}\n\n\t\t// Self-closing tag:\n\t\tif( !isset( $content ) ) {\n\t\t\t$html .= ' />';\n\t\t}\n\t\telse {\n\t\t\t$html .= '>';\n\n\t\t\tif( $content !== false ) {\n\t\t\t\t$html .= $content . '</' . $tagname . '>';\n\t\t\t}\n\t\t}\n\n\t\treturn $html;\n\t}", "public abstract function do_shortcode( $atts, $content, $tag );", "public function output( $atts, $content = null ) {\n\t\t\tob_start();\n\t\t\tdo_action( 'vcex_shortcode_before', 'vcex_teaser', $atts );\n\t\t\tinclude( vcex_get_shortcode_template( 'vcex_teaser' ) );\n\t\t\tdo_action( 'vcex_shortcode_after', 'vcex_teaser', $atts );\n\t\t\treturn ob_get_clean();\n\t\t}", "public function render()\n {\n // Different conditions for different types of tags\n switch ($this->element) {\n\n // Img tags use the src\n case 'img':\n if (empty($this->getAttribute('src'))) {\n return '';\n }\n break;\n\n // Divs have the image as a background-image\n // https://regex101.com/r/eF0oD0/1\n default:\n if (!preg_match('#background-image:\\s*url\\([\\'\"]?[\\w\\/]#',\n $this->getAttribute('style'))) {\n return '';\n }\n }\n\n // Carry on with normal rendering\n return parent::render();\n }", "function sc_sidebar_content( $attr, $content ) {\n\t$content = do_shortcode( $content );\n\n\tob_start();\n\t?>\n\t<div class=\"page-sidebar-content\">\n\t\t<?php echo( $content ); ?>\n\t</div>\n\t<?php\n\treturn ob_get_clean();\n}", "public static function doIt(&$content = null) : bool\n\t{\n\t\tif (trim($content) === '') {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Try to find the tag : %TOC_9% (where 9 is the deepest\n\t\t// level to mention in the table of content (so, for headings\n\t\t// 1 -> 4, mention %TOC_4%)\n\n\t\tif (preg_match(\"/%TOC_(\\\\d)%/m\", $content, $match)) {\n\t\t\t$aeSettings = \\MarkNotes\\Settings::getInstance();\n\n\t\t\t// Get the deepest level\n\t\t\t$deepestLevel = (int)$match[1];\n\n\t\t\t// Retrieve every h2 till the lowest level (f.i. 4)\n\t\t\t$pattern = '/<h([2-'.$deepestLevel.']){1} *(id=\"(.*)\")?[^>]*>(.*)<\\/h[2-'.$deepestLevel.']>/i';\n\n\t\t\tif (preg_match_all($pattern, $content, $matches)) {\n\t\t\t\t$aeFiles = \\MarkNotes\\Files::getInstance();\n\t\t\t\t$aeFunctions = \\MarkNotes\\Functions::getInstance();\n\n\t\t\t\tlist($tags, $level, $id, $slug, $title) = $matches;\n\n\t\t\t\t// Retrieve the title for the section, from\n\t\t\t\t// settings.json\n\t\t\t\t$text = trim(self::getOptions('text', '**Table of content**'));\n\n\t\t\t\t// $text is probably written in the markdown language,\n\t\t\t\t// get html version\n\t\t\t\t$file=$aeSettings->getFolderLibs().\"erusev/parsedown/Parsedown.php\";\n\n\t\t\t\tif ($aeFiles->exists($file)) {\n\t\t\t\t\tinclude_once $aeSettings->getFolderLibs().\"erusev/parsedown/Parsedown.php\";\n\t\t\t\t\t$parsedown = new \\Parsedown();\n\t\t\t\t\t$text=$parsedown->text(trim($text));\n\t\t\t\t}\n\n\t\t\t\t// Just add a carriage return after each entries\n\t\t\t\t$heads = implode(\"\\n\", $matches[0]);\n\n\t\t\t\t$j = count($matches[0]);\n\n\t\t\t\t// Process every entries in the table of content\n\t\t\t\tfor ($i = 0; $i < $j; $i++) {\n\t\t\t\t\t/*<!-- build:debug -->*/\n\t\t\t\t\t// When the developper mode is enabled in\n\t\t\t\t\t// settings.json, the INCLUDE plugin will add a\n\t\t\t\t\t// sentence like\n\t\t\t\t\t//\n\t\t\t\t\t//\t###### DEV_MODE_PREFIX INCLUDE FILE\n\t\t\t\t\t// filename {.devmode}\n\t\t\t\t\t//\n\t\t\t\t\t// (DEV_MODE_PREFIX is a prefiw defined in\n\t\t\t\t\t// includes/constants.php)\n\t\t\t\t\t//\n\t\t\t\t\t// So, here in the Table of Content plugin, we\n\t\t\t\t\t// should ignore headings when the title starts\n\t\t\t\t\t// with the DEV_MODE_PREFIX and don't put them\n\t\t\t\t\t// in the table of content.\n\n\t\t\t\t\tif ($aeFunctions::startsWith($title[$i], DEV_MODE_PREFIX)) {\n\t\t\t\t\t\t$heads = str_replace($matches[0][$i], '', $heads);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t/*<!-- endbuild -->*/\n\n\t\t\t\t\t$entry = '<li class=\"toc'.$level[$i].'\"><a href=\"#'.$slug[$i].'\">'.$title[$i].'</a></li>';\n\n\t\t\t\t\t// Replace the header by the entry\n\t\t\t\t\t$heads = str_replace($matches[0][$i], $entry, $heads);\n\t\t\t\t}\n\n\t\t\t\t// Put everything in a navigation element\n\t\t\t\t$heads = \"<nav role='navigation' id='toc'><ul>\\n\".$heads.\"\\n</ul></nav>\";\n\n\t\t\t\t// Does we only display the title of the TOC\n\t\t\t\t// in a accordion ?\n\t\t\t\t$collapse = boolval(self::getOptions('collapse', 0));\n\n\t\t\t\tif ($collapse) {\n\t\t\t\t\t$text =\n\t\t\t\t\t\"<details>\".\n\t\t\t\t\t\t\"<summary>\".trim(strip_tags($text), ' ,;:').\"</summary>\".\n\t\t\t\t\t\t$heads.\n\t\t\t\t\t\"</details>\";\n\t\t\t\t} else {\n\t\t\t\t\t$text .= \"\\n\".$heads;\n\t\t\t\t}\n\t\t\t\t// And replace the tag (%TOC_3% f.i.) by the\n\t\t\t\t// table of content\n\t\t\t\t//$text = sprintf($text, $heads);\n\t\t\t\t$content = str_replace($match[0], $text, $content);\n\t\t\t} // if (preg_match_all($pattern\n\t\t} // if (preg_match(\"/%TOC_(\\\\d)%/\"\n\n\t\treturn true;\n\t}", "public function run(){\n\t\techo CHtml::closeTag($this->tagName);\n return CHtml::closeTag($this->tagName);\n\t}", "public function isSelfClosingTag($tag)\n {\n return $tag === 'br' || $tag === 'img';\n }", "public function tag(): string;", "function getElement($content=null)\n {\n return new T_Text_Plain($content);\n }", "function stag($tag=false, $class='', $style='', $id='', $extra='')\n\t{\n\t\tif($tag == false)\n\t\t{\n\t\t\t$tag = $this->default_tag['tag'];\n\t\t\t$class = $this->default_tag['class'];\n\t\t\t$style = $this->default_tag['style'];\n\t\t\t$extra = $this->default_tag['extra'];\n\t\t}\n\t\t$class = ($class != '' ? ' class=\"' . $class . '\"' : '');\n\t\t$style = ($style != '' ? ' style=\"' . $style . '\"' : '');\n\t\t$id = ($id != '' ? ' id=\"' . $id . '\"' : '');\n\t\t$extra = ($extra != '' ? ' ' . $extra : '');\n\t\treturn $this->xecho('<' . $tag . $class . $style . $id . $extra . ' />');\n\t}", "public function openTag()\n {\n $this->writer->write('<?php' . PHP_EOL);\n return $this;\n }", "public function is_tag($tag = '')\n {\n }", "function print_debug($content, $tag) {\n $output = '<span style=\"display:none\" id=\"';\n $output .= $tag;\n $output .= '\">';\n print_r($output);\n print_r($content);\n print_r('</span>');\n}", "function tidy_is_xhtml(tidy $object) {}", "function sw_open_graph_tags($info) {\n\t\t\t\n\t\t\t\t// We only modify the Open Graph tags on single blog post pages\n\t\t\t\tif(is_singular()):\n\t\t\t\t\t\n\t\t\t\t\t// If Yoast Open Graph is activated, we only output Open Graph tags if the user has filled out at least one field\n\t\t\t\t\t// Then we'll work along with Yoast to make sure all fields get filled properly\n\t\t\t\t\tif(defined('WPSEO_VERSION')):\n\t\t\t\t\t\tglobal $wpseo_og;\n\t\t\t\t\t\t$yoast_og_setting = has_action( 'wpseo_head', array( $wpseo_og, 'opengraph' ));\n\t\t\t\t\telse:\n\t\t\t\t\t\t$yoast_og_setting = false;\n\t\t\t\t\tendif;\n\t\t\t\t\t\t\n\t\t\t\t\tif(\n\t\t\t\t\t\t(isset($info['title']) && $info['title']) || \n\t\t\t\t\t\t(isset($info['description']) && $info['description']) || \n\t\t\t\t\t\t(isset($info['imageURL']) && $info['imageURL']) ||\n\t\t\t\t\t\t!$yoast_og_setting\n\t\t\t\t\t):\n\t\t\t\t\t\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* YOAST SEO: It rocks, so let's coordinate with it\t *\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\t// Check if Yoast Exists so we can coordinate output with their plugin accordingly\n\t\t\t\t\t\tif (defined('WPSEO_VERSION')):\n\n\t\t\t\t\t\t\t// Collect their Social Descriptions as backups if they're not defined in ours\n\t\t\t\t\t\t\t$yoast_og_title \t\t= get_post_meta( $info['postID'] , '_yoast_wpseo_opengraph-title' , true );\n\t\t\t\t\t\t\t$yoast_og_description \t= get_post_meta( $info['postID'] , '_yoast_wpseo_opengraph-description' , true );\n\t\t\t\t\t\t\t$yoast_og_image \t\t= get_post_meta( $info['postID'] , '_yoast_wpseo_opengraph-image' , true );\n\n\t\t\t\t\t\t\t// Collect their SEO fields as 3rd string backups in case we need them\n\t\t\t\t\t\t\t$yoast_seo_title\t\t= get_post_meta( $info['postID'] , '_yoast_wpseo_title' , true );\n\t\t\t\t\t\t\t$yoast_seo_description\t= get_post_meta( $info['postID'] , '_yoast_wpseo_metadesc' , true );\n\n\t\t\t\t\t\t\t// Cancel their output if ours have been defined so we don't have two sets of tags\n\t\t\t\t\t\t\tglobal $wpseo_og;\n\t\t\t\t\t\t\tremove_action( 'wpseo_head', array( $wpseo_og, 'opengraph' ), 30 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Fetch the WPSEO_SOCIAL Values\n\t\t\t\t\t\t\t$wpseo_social = get_option( 'wpseo_social' );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tendif;\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add all our Open Graph Tags to the Return Header Output\n\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:type\" content=\"article\" /> ';\n\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* JETPACK: If ours are enabled, disable theirs\t\t *\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t******************************************************************/\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( class_exists( 'JetPack' ) ) :\n\t\t\t\t\t\t\tadd_filter( 'jetpack_enable_opengraph', '__return_false', 99 );\n\t\t\t\t\t\t\tadd_filter( 'jetpack_enable_open_graph', '__return_false', 99 );\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* OPEN GRAPH TITLE\t\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t******************************************************************/\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Open Graph Title: Create an open graph title meta tag\n\t\t\t\t\t\tif($info['title']):\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If the user defined an social media title, let's use it.\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:title\" content=\"'.$info['title'].'\" />';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\telseif(isset($yoast_og_title) && $yoast_og_title):\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If the user defined an title over in Yoast, let's use it.\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:title\" content=\"'.$yoast_og_title.'\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\telseif(isset($yoast_seo_title) && $yoast_seo_title):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If the user defined an title over in Yoast, let's use it.\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:title\" content=\"'.$yoast_seo_title.'\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\telse:\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If nothing else is defined, let's use the post title\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:title\" content=\"'.convert_smart_quotes(htmlspecialchars_decode(get_the_title())).'\" />';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* OPEN GRAPH DESCRIPTION\t\t\t\t\t\t\t *\n\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\t\t// Open Graph Description: Create an open graph description meta tag\n\t\t\t\t\t\tif($info['description']):\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If the user defined an social media description, let's use it.\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:description\" content=\"'.$info['description'].'\" />';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\telseif(isset($yoast_og_description) && $yoast_og_description):\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If the user defined an description over in Yoast, let's use it.\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:description\" content=\"'.$yoast_og_description.'\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\telseif(isset($yoast_seo_description) && $yoast_seo_description):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If the user defined an description over in Yoast, let's use it.\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:description\" content=\"'.$yoast_seo_description.'\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\telse:\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If nothing else is defined, let's use the post excerpt\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:description\" content=\"'.convert_smart_quotes(htmlspecialchars_decode(sw_get_excerpt_by_id($info['postID']))).'\" />';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* OPEN GRAPH IMAGE\t\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t******************************************************************/\n\n\t\t\t\t\t\t// Open Graph Image: Create an open graph image meta tag\n\t\t\t\t\t\tif($info['imageURL']):\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If the user defined an image, let's use it.\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:image\" content=\"'.$info['imageURL'].'\" />';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\telseif(isset($yoast_og_image) && $yoast_og_image):\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If the user defined an image over in Yoast, let's use it.\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:image\" content=\"'.$yoast_og_image.'\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\telse:\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If nothing else is defined, let's use the post Thumbnail as long as we have the URL cached\n\t\t\t\t\t\t\t$og_image = get_post_meta( $info['postID'] , 'sw_open_thumbnail_url' , true );\n\t\t\t\t\t\t\tif($og_image):\n\t\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:image\" content=\"'.$og_image.'\" />';\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* OPEN GRAPH URL & Site Name\t\t\t\t\t\t *\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t******************************************************************/\n\n\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:url\" content=\"'.get_permalink().'\" />';\n\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:site_name\" content=\"'.get_bloginfo('name').'\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* OPEN GRAPH AUTHOR\t\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t******************************************************************/\n\n\t\t\t\t\t\t// Add the Facebook Author URL\n\t\t\t\t\t\tif( get_the_author_meta ( 'sw_fb_author' , sw_get_author($info['postID'])) ):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Output the Facebook Author URL\n\t\t\t\t\t\t\t$facebook_author = get_the_author_meta ( 'sw_fb_author' , sw_get_author($info['postID']));\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"article:author\" content=\"'.$facebook_author.'\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\telseif( get_the_author_meta ( 'facebook' , sw_get_author($info['postID'])) && defined('WPSEO_VERSION')):\n\n\t\t\t\t\t\t\t// Output the Facebook Author URL\n\t\t\t\t\t\t\t$facebook_author = get_the_author_meta ( 'facebook' , sw_get_author($info['postID']));\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"article:author\" content=\"'.$facebook_author.'\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* OPEN GRAPH PUBLISHER\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t******************************************************************/\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If they have a Facebook Publisher URL in our settings...\n\t\t\t\t\t\tif(isset($info['sw_user_options']['facebookPublisherUrl']) && $info['sw_user_options']['facebookPublisherUrl'] != ''):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Output the Publisher URL\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"article:publisher\" content=\"'.$info['sw_user_options']['facebookPublisherUrl'].'\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If they have a Facebook Publisher URL in Yoast's settings...\n\t\t\t\t\t\telseif(isset($wpseo_social) && isset($wpseo_social['facebook_site']) && $wpseo_social['facebook_site'] != ''):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Output the Publisher URL\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"article:publisher\" content=\"'.$wpseo_social['facebook_site'].'\" />';\t\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"article:published_time\" content=\"'.get_post_time('c').'\" />';\n\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"article:modified_time\" content=\"'.get_post_modified_time('c').'\" />';\n\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"og:updated_time\" content=\"'.get_post_modified_time('c').'\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* OPEN GRAPH APP ID\t\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t******************************************************************/\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the Facebook APP ID is in our settings...\n\t\t\t\t\t\tif(isset($info['sw_user_options']['facebookAppID']) && $info['sw_user_options']['facebookAppID'] != ''):\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Output the Facebook APP ID\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"fb:app_id\" content=\"'.$info['sw_user_options']['facebookAppID'].'\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the Facebook APP ID is set in Yoast's settings...\n\t\t\t\t\t\telseif(isset($wpseo_social) && isset($wpseo_social['fbadminapp']) && $wpseo_social['fbadminapp'] != ''):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Output the Facebook APP ID\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"fb:app_id\" content=\"'.$wpseo_social['fbadminapp'].'\" />';\t\n\t\t\t\t\t\t\n\t\t\t\t\t\telse:\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Output the Facebook APP ID\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta property=\"fb:app_id\" content=\"529576650555031\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t// Return the variable containing our information for the meta tags\n\t\t\t\treturn $info;\n\t\t\t\t\n\t\t\t}", "function displayTagTopHtml(){\n echo\n '<!DOCTYPE html>\n <html lang=\"fr\">';\n}", "function open_tag($element, $attr){\n\t\n}", "public function hasContent(){ return !empty($this->content); }", "function endTag($parser, $element) {\r\n echo \"<br />\";\r\n}", "public function getCanonical(): ?TagInterface;", "function Start_Tag($parser, $tag, $attribs)\r\n\t{\r\n\t\t$show = true;\r\n\t\t$close = '';\r\n\r\n\t\t$output = '';\r\n\r\n\t\tif ($tag == 'AMP') $output = '&amp;';\r\n\t\telse if ($tag == 'BOX')\r\n\t\t{\r\n\t\t\tif (isset($attribs[\"HANDLER\"]))\r\n\t\t\t{\r\n\t\t\t\t$handler = $attribs[\"HANDLER\"];\r\n\t\t\t\tif (file_exists(\"$handler.php\")) require_once(\"$handler.php\");\r\n\t\t\t\tif (class_exists($handler)) $box = new $handler;\r\n\t\t\t\telse die(\"Class does not exist ($handler).<br/>\\n\");\r\n\t\t\t}\r\n\t\t\telse $box = new Box();\r\n\t\t\tif (isset($attribs['TITLE'])) $box->title = $attribs['TITLE'];\r\n\t\t\tif (isset($attribs['TEMPLATE'])) $box->template = $attribs['TEMPLATE'];\r\n\t\t\tif (isset($attribs['ID'])) $box->name = $attribs['ID'];\r\n\t\t\t$this->objs[] = $box;\r\n\t\t\t$show = false;\r\n\t\t}\r\n\t\telse if ($tag == 'BR') $close = ' /';\r\n\t\telse if ($tag == 'COPY') $output .= '&copy;';\r\n\t\telse if ($tag == 'DOCTYPE')\r\n\t\t{\r\n\t\t\tif (isset($attribs['TYPE']))\r\n\t\t\t{\r\n\t\t\t\tif ($attribs['TYPE'] == 'strict')\r\n\t\t\t\t\t$output = '<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Strict//EN\"\r\n\t\t\t\t\t\t\"http://www.w3.org/TR/html4/strict.dtd\">';\r\n\t\t\t\tif ($attribs['TYPE'] == 'trans')\r\n\t\t\t\t\t$output = '<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\r\n\t\t\t\t\t\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">';\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ($tag == 'IMG') $close = ' /';\r\n\t\telse if ($tag == 'INCLUDE')\r\n\t\t{\r\n\t\t\t$inc_file = $attribs['FILE'];\r\n\t\t\tif (!file_exists($inc_file))\r\n\t\t\t{\r\n\t\t\t\tError(\"Template::Start_Tag()<br/>\r\n\t\t\t\t&lt;INCLUDE> File ({$inc_file}) does not exist.<br/>\r\n\t\t\t\tin {$this->template}\r\n\t\t\t\ton line \".xml_get_current_line_number($parser).\"<br/>\");\r\n\t\t\t}\r\n\t\t\trequire_once($inc_file);\r\n\t\t\t$class = $attribs['CLASS'];\r\n\t\t\tif (!class_exists($class)) Error(\"Template::Start_Tag()<br/>\r\n\t\t\t\t&lt;INCLUDE> Class ({$class}) does not exist.\r\n\t\t\t\tin {$this->template}\r\n\t\t\t\ton line \".xml_get_current_line_number($parser).\"<br/>\");\r\n\t\t\t$mod = new $class($this->data);\r\n\t\t\t$mod->Prepare($this->data);\r\n\t\t\tif (!isset($attribs['NAME'])) Error(\"Template::Start_Tag()<br/>\r\n\t\t\t\t&lt;INCLUDE> Attribute 'NAME' does not exist.\r\n\t\t\t\tin {$this->template}\r\n\t\t\t\ton line \".xml_get_current_line_number($parser).\"<br/>\");\r\n\t\t\t$this->includes[$attribs['NAME']] = $mod;\r\n\t\t\t$show = false;\r\n\t\t}\r\n\t\telse if ($tag == 'INPUT') $close = ' /';\r\n\t\telse if ($tag == 'LINK') $close = ' /';\r\n\t\telse if ($tag == 'META') $close = ' /';\r\n\t\telse if ($tag == 'NBSP') $output = '&nbsp;';\r\n\t\telse if ($tag == 'NULL') $show = false;\r\n\t\telse if ($tag == 'PRESENT')\r\n\t\t{\r\n\t\t\t$this->objs[] = $this->includes[$attribs['NAME']];\r\n\t\t\t$show = false;\r\n\t\t}\r\n\t\telse if ($tag == \"TEMPLATE\")\r\n\t\t{\r\n\t\t\tif (isset($attribs[\"FILE\"]))\r\n\t\t\t{\r\n\t\t\t\t$t = new Template();\r\n\t\t\t\t$obj = &$this->GetCurrentObject();\r\n\t\t\t\t$obj->out .= $t->Get($attribs[\"FILE\"]);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ($tag == \"XFORM\")\r\n\t\t{\r\n\t\t\tif (isset($attribs[\"NAME\"])) $name = $attribs[\"NAME\"];\r\n\t\t\telse $name = \"formUnnamed\";\r\n\t\t\t$form = new Form($name);\r\n\t\t\tforeach ($attribs as $name => $val) $form->attribs[$name] = $val;\r\n\t\t\t$this->objs[] = $form;\r\n\t\t}\r\n\t\telse if ($tag == \"XINPUT\")\r\n\t\t{\r\n\t\t\tif (isset($attribs[\"TYPE\"]))\r\n\t\t\t{\r\n\t\t\t\tif ($attribs[\"TYPE\"] == \"hidden\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$obj = &$this->GetCurrentObject();\r\n\t\t\t\t\t$obj->AddHidden($attribs[\"NAME\"], $attribs[\"VALUE\"]);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($attribs[\"TEXT\"])) $text = $attribs[\"TEXT\"];\r\n\t\t\telse $text = \"\";\r\n\t\t\tif (isset($attribs[\"NAME\"])) $name = $attribs[\"NAME\"];\r\n\t\t\telse $name = \"\";\r\n\t\t\tif (isset($attribs[\"VALUE\"])) $value = $attribs[\"VALUE\"];\r\n\t\t\telse $value = \"\";\r\n\t\t\tif (isset($attribs[\"HELP\"])) $help = $attribs[\"HELP\"];\r\n\t\t\telse $help = NULL;\r\n\r\n\t\t\t$obj = &$this->GetCurrentObject();\r\n\t\t\t$obj->AddInput($text, $attribs[\"TYPE\"], $name, $value, null, $help);\r\n\t\t}\r\n\r\n\t\tif ($show)\r\n\t\t{\r\n\t\t\t$obj = &$this->GetCurrentObject();\r\n\t\t\tif (strlen($output) > 0) $obj->out .= \"{$output}\";\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$obj->out .= '<'.strtolower($tag);\r\n\t\t\t\tforeach ($attribs as $name => $val)\r\n\t\t\t\t\t$obj->out .= ' '.strtolower($name).'=\"'.$val.'\"';\r\n\t\t\t\t$obj->out .= \"{$close}>\";\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected static function parse_start(nodes\\Tag $node) {\n\t\t\n\t $text_handler = '\\phphaml\\haml\\handlers\\Text';\n\t \n\t\tif($node->content[0] == '%') {\n\t\t\tif(!preg_match(self::RE_TAG, substr($node->content, 1), $match)) {\n\t\t\t static::$parser->force_handler($text_handler);\n\t\t\t return static::$parser->handle();\n\t\t\t}\n\t\t\t\n\t\t\t$node->content = substr($node->content, strlen($match[0]) + 1);\n\t\t\t$node->tag_name = $match[0];\n\t\t}\n\t\t\n\t\t$id = false;\n\t\t$classes = array();\n\t\twhile($node->content[0] == '.' or $node->content[0] == '#') {\n\t\t\t$type = $node->content[0] == '.' ? 'class' : 'id';\n\t\t\t\n\t\t\tif(!preg_match($type == 'id' ? self::RE_ID : self::RE_CLASS, substr($node->content, 1), $match)) {\n\t\t\t $node->remove();\n\t\t\t throw new NotHandledException();\n\t\t }\n\t\t\t\n\t\t\t$node->content = substr($node->content, strlen($match[0]) + 1);\n\t\t\t\n\t\t\tif($type == 'class')\n\t\t\t $classes[] = '\\'' . $match[0] . '\\'';\n\t\t\telse\n\t\t\t $id = $match[0];\n\t\t}\n\t\t\n\t\tif($classes)\n\t\t $node->attributes[] = array('\\'class\\'', $classes);\n\t\tif($id)\n\t\t $node->attributes[] = array('\\'id\\'', '\\'' . $id . '\\'');\n\t\t\n\t\tstatic::parse_html_attributes($node);\n\t\t\n\t}", "public function getBrickHtmlTagOpen($brick){\n return '';\n }", "function tag_html($selector, $source = false)\r\n{\r\n\r\n $r = get_noko($source)->get($selector)->toHtml();\r\n $r = str_replace(array(\"\\n\", \"\\t\"), '', $r);\r\n if ($r=='<root/>') $r='';\r\n $r=close_tags($r);\r\n if (DEV)\r\n xlogc('tag_html', $r, $selector, $source);\r\n\r\n return $r;\r\n}", "function do_shortcodes_in_html_tags($content, $ignore_html, $tagnames)\n {\n }", "function writeHtmlCommonTagStart($tag, $attributes = [], $isCloseTag = true) {\n $html = \"<$tag \";\n foreach ($attributes as $key => $value) {\n if (is_numeric($key)) {\n $html .= $value;\n } else {\n $html .= \"$key=\\\"{$value}\\\"\";\n }\n }\n\n if ($isCloseTag) {\n $html .= \">\";\n } else {\n $html .= \"/>\";\n }\n\n echo $html;\n}", "public static function outputContent($content)\n {\n CodeBoxComponent::outputContent($content);\n }", "function tagins($stuffing) {\n return \"<\".$stuffing.\">\";\n }", "protected function content_handle_no_teaser_block( $content ) {\n\t\tif ( (strpos($content, 'noTeaser:true') !== false || strpos($content, '\"noTeaser\":true') !== false) && strpos($content, '<!-- /wp:more -->') !== false) {\n\t\t\t$arr = explode('<!-- /wp:more -->', $content);\n\t\t\treturn trim($arr[1]);\n\t\t}\n\t\treturn $content;\n\t}" ]
[ "0.643995", "0.6388431", "0.63299", "0.6290756", "0.5912245", "0.5879813", "0.58448523", "0.58430237", "0.58027333", "0.5796313", "0.5791403", "0.5789499", "0.5672085", "0.5593494", "0.5538308", "0.5500186", "0.54998213", "0.5483006", "0.54526037", "0.54419327", "0.54399914", "0.5432999", "0.5417282", "0.54106945", "0.5396917", "0.5379961", "0.5377025", "0.53536636", "0.5353334", "0.5332175", "0.53162974", "0.5315787", "0.53148735", "0.52994746", "0.5298881", "0.5297257", "0.52915454", "0.5267779", "0.526442", "0.52610743", "0.5260512", "0.5252993", "0.52474743", "0.52464503", "0.52338755", "0.52330935", "0.5232281", "0.52164596", "0.5208784", "0.5203856", "0.5203017", "0.5197173", "0.5195685", "0.51803035", "0.5177476", "0.51757467", "0.5170846", "0.5154188", "0.51528615", "0.5150905", "0.5135496", "0.5131187", "0.5100512", "0.50997746", "0.5090771", "0.5089198", "0.5089198", "0.50865257", "0.50813967", "0.507841", "0.50742286", "0.5069108", "0.5063559", "0.5061696", "0.5060918", "0.50584525", "0.505782", "0.5056983", "0.50569755", "0.5054415", "0.504224", "0.5039726", "0.50394785", "0.503486", "0.5034266", "0.50240296", "0.5024013", "0.50233686", "0.50227356", "0.5018106", "0.50140154", "0.50086236", "0.5006592", "0.5002722", "0.5001395", "0.5000413", "0.49939796", "0.49924424", "0.4991854", "0.49825677", "0.4980613" ]
0.0
-1
self::tags('li', array('class' => 'highlight'), array('first item', 'second item'))
public static function tags(string $name, string|array $attributes, array $items, string $separator = "\n"): string { $attributes = self::toAttributes($attributes); $result = []; foreach ($items as $item) { $result[] = self::tag($name, $attributes, $item); } return implode($separator, $result) . $separator; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLiClass(): string;", "function gymfitness_li_class($classes,$item,$args) {\n \n $classes[] = 'nav-item';\n \n return $classes;\n\n}", "function htmltags($args) {\r\n\t\t$args['selections'] = $this->html_tags;\r\n\t\t$args['multiple'] = false;\r\n\t\t$args['width'] = '65';\r\n\t\t$args['tooltip'] = 'Choose the HTML tag to use';\r\n\t\t$this->select($args);\r\n\t}", "function tc_tag_list() {\r\n $post_terms = apply_filters( 'tc_tag_meta_list', $this -> _get_terms_of_tax_type( $hierarchical = false ) );\r\n $html = false;\r\n\r\n if ( false != $post_terms) {\r\n foreach( $post_terms as $term_id => $term ) {\r\n $html .= sprintf('<a class=\"%1$s\" href=\"%2$s\" title=\"%3$s\"> %4$s </a>',\r\n apply_filters( 'tc_tag_list_class', 'btn btn-mini btn-tag' ),\r\n get_term_link( $term_id , $term -> taxonomy ),\r\n esc_attr( sprintf( __( \"View all posts in %s\", 'customizr' ), $term -> name ) ),\r\n $term -> name\r\n );\r\n }//end foreach\r\n }//end if\r\n return apply_filters( 'tc_tag_list', $html );\r\n }", "public function tags();", "protected function getTag()\n {\n return 'ul';\n }", "function printTags(){\n\n\t\t/* Start HTML */\n\t\t$output = '<ul class=\"taglist\">';\n\t\t$tags = explode(',',$this->tags);\n\t\tforeach($tags as $tag){\n\t\t\t$output .= '<li class=\"tag\"><a href=\"#!/search&tags='.urlencode(strtolower(str_replace(' ','',$tag))).'\">'.$tag.'</a></li>';\n\t\t}\n\t\t$output .= '</ul>';\n\n\t\t/* Return HTML */\n\t\treturn $output;\n\t}", "function add_classes_on_li($classes, $item, $args) {\n $classes[] = 'nav-item';\n return $classes;\n}", "public function tags()\n {\n return array('html');\n }", "function druplex_field__field_portfolio_tag($variables) {\n\n $output = '<ul class=\"submitted\"><li><i class=\"icon-tags\"></i></li>';\n\n foreach ($variables['items'] as $delta => $item) {\n $output .= '<li>' . drupal_render($item) . '</li>';\n }\n\n $output .= '</ul>';\n \n return $output;\n}", "public function GetTagName() {\n\t\treturn 'li';\n\t}", "public function tags()\r\n {\r\n }", "function rtag($tag, $list, $class='', $style='', $extra='', $list_delim=',')\n\t{\n\t\tif(!(is_array($list)))\n\t\t{\n\t\t\t$list = explode($list_delim, $list);\n\t\t}\n\t\tforeach($list as $item)\n\t\t{\n\t\t\t$item = trim($item);\n\t\t\t$this->tag($tag, $item, $class, $style, '', $extra);\n\t\t}\n\t\treturn true;\n\t}", "function anchor_li($uri = '', $title = '', $attributes = '', $li_attributes = '') {\r\n $return = '<li ' . $li_attributes . '>';\r\n $return .= anchor($uri, $title, $attributes);\r\n $return .= '</li>';\r\n return $return;\r\n}", "public function getLiActiveClass(): string;", "function the_tags($before = \\null, $sep = ', ', $after = '')\n {\n }", "function gtags_make_tags_for_group() {\n\tglobal $bp, $wpdb;\n\t\n\t$group_tags = gtags_get_group_tags();\n\t$items = explode( \",\", $group_tags );\n\t$output = '';\n\tforeach( $items as $item ) {\n\t\t$item = trim( strtolower( $item ) );\n\t\tif ($item=='') continue;\n\t\t$link = $bp->root_domain . '/projets/tag/' . urlencode( $item );\n\t\t$output .= ' <a class=\"etiquette highlight\" href=\"'.$link.'\" title=\"Voir tous les projets ayant pour mots-clés '.$item.'\">#'.$item.'</a> ';\n\t}\n\n\treturn apply_filters( 'gtags_make_tags_for_group', $output, $items );\n}", "public function getTagList();", "function magimpact_entry_tags()\n\t{\n\t\t$tag_list = get_the_tag_list('', __(', ', 'twentythirteen'));\n\t\tif ($tag_list) {\n\t\t\techo '<span class=\"tags-links\">' . $tag_list . '</span>';\n\t\t}\n\n\t}", "function doTagStuff(){}", "protected function tags() {\n return [\n ['people', ['people']],\n ['all people', ['all', 'people']],\n ['none of those people', ['none', 'of', 'those', 'people']],\n ['space \" \" bar', ['space', ' ', 'bar']]\n ];\n }", "public function silo_highlights()\n\t{\n\t}", "public function getTags() {}", "public function silo_highlights()\r\n\t{\r\n\t}", "function get_the_tag_list_div( $before = '', $sep = '', $after = '', $id = 0 ) {\n return get_the_term_list_div( $id, 'post_tag', $before, $sep, $after );\n}", "function getTags($tags) {\n\n $result = '';\n\n $explode = explode(',',$tags);\n\n foreach ($explode as $tag) {\n $result .= '<a href=\"#\" rel=\"tag\">' . $tag . '</a>,';\n }\n\n return $result;\n}", "public function getTagClasses();", "function montheme_li_class($classes)\n{\n $classes = [];\n $classes[] = 'nav-item';\n\n return $classes;\n}", "function start_el(&$output, $item, $depth=0, $args=array(), $id = 0) {\n $object = $item->object;\n $type = $item->type;\n $title = $item->title;\n $description = $item->description;\n $permalink = $item->url;\n \n $output .=\"<li class='\" . implode(\" \", $item->classes) . \"'>\";\n // loop\n \n \n // vars\n $fa_style = \"fas\";\n $icon = get_field('icon', $item);\n $cat_filter = get_field('cat_filter', $item);\n $output .= '<a href=\"' . $permalink . '\"';\n $output .= 'data-filter=\".' . $cat_filter . '\">';\n $output .= '<i class=\"'.$fa_style . ' '.$icon.'\"></i>';\n $output .= $title;\n $output .= '</a>';\n \n }", "function ja_filter_bbpress_allowed_tags() {\n\n\treturn array(\n\n\n\n\t// Links\n\n\t\t\t'a' => array(\n\n\t\t\t\t\t'href' => array(),\n\n\t\t\t\t\t'title' => array(),\n\n\t\t\t\t\t'rel' => array()\n\n\t\t\t),\n\n\n\n\t\t\t// Quotes\n\n\t\t\t'blockquote' => array(\n\n\t\t\t\t\t'cite' => array()\n\n\t\t\t),\n\n\n\n\t\t\t// Code\n\n\t\t\t'code' => array(),\n\n\t\t\t'pre' => array(),\n\n\n\n\t\t\t// Formatting\n\n\t\t\t'em' => array(),\n\n\t\t\t'strong' => array(),\n\n\t\t\t'del' => array(\n\n\t\t\t\t\t'datetime' => true,\n\n\t\t\t),\n\n\n\n\t\t\t// Lists\n\n\t\t\t'ul' => array(),\n\n\t\t\t'ol' => array(\n\n\t\t\t\t\t'start' => true,\n\n\t\t\t),\n\n\t\t\t'li' => array(),\n\n\n\n\t\t\t// Images\n\n\t\t\t'img' => array(\n\n\t\t\t\t\t'src' => true,\n\n\t\t\t\t\t'border' => true,\n\n\t\t\t\t\t'alt' => true,\n\n\t\t\t\t\t'height' => true,\n\n\t\t\t\t\t'width' => true,\n\n\t\t\t)\n\n\t);\n\n}", "function htmltag ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('thtmltag');\n return $rc->newInstanceArgs( $arguments ); \n}", "function acitpo_entry_tags() {\n\t$tags = get_the_tag_list('', __('', 'acitpo'));\n\tif ($tags) {\n\t\tprintf('<div class=\"entry-tags\">%s</div>', $tags);\n\t}\n}", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "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 }", "function get_tags( $sep = ', ', $before = '', $after = '' ) {\n\t\treturn get_the_term_list($this->id, 'product_tag', $before, $sep, $after);\n\t}", "public function setLiClass(string $liClass);", "public function template_tags(): array\n\t{\n\t\treturn array(\n\t\t\t'is_primary_sidebar_active' => array($this, 'is_primary_sidebar_active'),\n\t\t\t'display_primary_sidebar' => array($this, 'display_primary_sidebar'),\n\t\t\t'post_style' => array($this, 'post_style'),\n\t\t);\n\t}", "public function tags()\n {\n $title = 'Tags';\n $tags = \\App\\Tag::get();\n return view('admin.modules.tags.list',['title' => $title, 'tags' => $tags]);\n }", "function components_list(){\n\n\t\t?><li data-type=\"test\" title=\"Sample Title\"></li><?php\n\t}", "public function multipleReturnTags() {\n }", "public function __invoke()\n {\n \n \n $tagsDB = $this->getLocator()->get('myBlog\\Model\\Tags');\n $ItemList = $tagsDB->getAllTags();\n $ItemList = iterator_to_array($ItemList);\n usort($ItemList, array($this, 'cmpWeight'));\n \n $tagsList = new \\Zend\\Tag\\ItemList();\n \n $index = 0;\n while($index<$this->cloud1Count && count($ItemList)>0) {\n $index++;\n $tag = array_shift($ItemList);\n $tag->setParam('url', $this->getView()->url('Home/tags', array('tags'=>$tag->getTitle())));\n $tagsList[] = $tag;\n }\n \n $tagCloud1 = new \\Zend\\Tag\\Cloud();\n $tagCloud1->setItemList($tagsList);\n $tagCloud1->getCloudDecorator()->setHTMLTags(array(\n 'ul' => array('class' => 'cloud-menu layout')\n ));\n $tagCloud1->getTagDecorator()->setClassList(array(\n 'tag1','tag2','tag3'\n ));\n \n \n $tagsList = new \\Zend\\Tag\\ItemList();\n \n while(count($ItemList)>0) {\n $tag = array_shift($ItemList);\n $tag->setParam('url', $this->getView()->url('Home/tags', array('tags'=>$tag->getTitle())));\n $tagsList[] = $tag;\n }\n \n $tagCloud2 = new \\Zend\\Tag\\Cloud();\n $tagCloud2->setItemList($tagsList);\n $tagCloud2->getCloudDecorator()->setHTMLTags(array(\n 'ul' => array('class' => 'cloud-tags layout')\n ));\n $tagCloud2->getTagDecorator()->setFontSizeUnit('%')->setMaxFontSize(200)->setMinFontSize(70);\n \n return $tagCloud1->__toString().$tagCloud2->__toString();\n }", "function add_additional_class_on_li($classes, $item, $args)\n{\n if (isset($args->add_li_class_to_footer)) {\n $classes[] = $args->add_li_class_to_footer;\n }\n return $classes;\n}", "protected function find_tags(){\n\t\tpreg_match_all(\"/%(.+?)%/\", $this->default, $this->tags );\n\t}", "function open_tag($element, $attr){\n\t\n}", "public function registerMarkupTags() {\n return [\n 'filters' => [\n 'formatMoney' => ['Elearning\\System\\Classes\\Helper', 'formatMoney'],\n 'formatHtml' => ['Elearning\\System\\Classes\\Helper', 'formatHtml'],\n 'generateRating' => ['Elearning\\System\\Classes\\Helper', 'generateRating'],\n 'formatDate' => ['Elearning\\System\\Classes\\Helper', 'formatDate'],\n 'formatProvince' => ['Elearning\\System\\Classes\\Helper', 'formatProvince'],\n 'formatDistrict' => ['Elearning\\System\\Classes\\Helper', 'formatDistrict'],\n 'formatDateForm' => ['Elearning\\System\\Classes\\Helper', 'formatDateForm'],\n 'checkStudentCourse' => ['Elearning\\System\\Classes\\Helper', 'checkStudentCourse'] \n ]\n ];\n }", "function makeListTags(){\n //add prefix for production\n $rootPrefix = \"\";\n $addPrefix = \"\";\n if ($_SERVER['SERVER_NAME'] == \"localhost\"){\n $rootPrefix = \"/portfolio\";\n } else {\n $addPrefix = \"3/public_html/sethjkalkstein.com\";\n }\n\n $listOfLinks = [\"About\" => $rootPrefix.\"/index.php\", \"Projects\" => $rootPrefix.\"/projects/index.php\", \"Resume\" => $rootPrefix.\"/resume.pdf\", \"Contact\" => $rootPrefix.\"/contact.php\"];\n\n foreach($listOfLinks as $lTitle => $lLink){\n $idText = \"\";\n if (getCurrentFile() == $addPrefix.$lLink){\n $idText = 'id=\"currentPage\"';\n }\n echo '<li><a '.$idText.' href=\"'.$lLink.'\">'.$lTitle.'</a></li>';\n }\n}", "function editTags($item, $_options = false) {\n\t\tglobal $model;\n\n\t\t$_ = '';\n\n\t\t$_ .= '<div class=\"tags i:defaultTags i:collapseHeader item_id:'.$item[\"id\"].'\"'.$this->jsData([\"tags\"]).'>';\n\t\t$_ .= '<h2>Tags ('.($item[\"tags\"] ? count($item[\"tags\"]) : 0).')</h2>';\n\t\t$_ .= $this->tagList($item[\"tags\"]);\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}", "private function _buildNaviListHtml( $list, $tag_name, $css_class, $selected = null ) {\n\t\tif ( @empty( $list ) ) return '';\n\t\t\n\t\t// init html\n\t\t$html = array();\n\t\t$html []= '<'. $tag_name. ' class=\"'. $css_class. '\">';\n\t\t\n\t\t// init level\n\t\t$init_level = $level = $list[0][0];\n\t\t\n\t\t// iterate through all\n\t\tforeach ( $list as $idx => $item ) {\n\t\t\tlist( $l, $t, $n ) = $item;\n\t\t\t\n\t\t\t// increase\n\t\t\tif ( $level < $l ) {\n\t\t\t\twhile( ++$level < $l ) {\n\t\t\t\t\t$html []= '<'. $tag_name. '>';\n\t\t\t\t\t$html []= '<li class=\"'. $css_class. '-level'. $l. '\">';\n\t\t\t\t}\n\t\t\t\t$level = $l;\n\t\t\t\t$html []= '<'. $tag_name. '>';\n\t\t\t}\n\t\t\t\n\t\t\t// decraese\n\t\t\telseif ( $level > $l ) {\n\t\t\t\t$html []= '</li>';\n\t\t\t\twhile ( --$level >= $l ) {\n\t\t\t\t\t$html []= '</'. $tag_name. '>';\n\t\t\t\t\t$html []= '</li>';\n\t\t\t\t}\n\t\t\t\t$level = $l;\n\t\t\t}\n\t\t\t\n\t\t\t// same level\n\t\t\telse if ( $idx > 0 )\n\t\t\t\t$html []= '</li>';\n\t\t\t\n\t\t\t// selected ?\n\t\t\t$selected_css = '';\n\t\t\tif ( ! is_null( $selected )\n\t\t\t\t&& ( ( is_array( $selected ) && $this->{ $selected[0] }( $n ) )\n\t\t\t\t\t|| ( ! is_array( $selected ) && $selected == $n )\n\t\t\t\t)\n\t\t\t)\n\t\t\t\t$selected_css = $css_class. '-selected';\n\t\t\t\n\t\t\t// build li and link\n\t\t\t$html []= '<li class=\"'. $css_class. '-level'. $l. ' '. $selected_css. '\">';\n\t\t\t$html []= '<a href=\"'. $n. '\">'. $t. '</a>';\n\t\t}\n\t\t$html []= '</li>';\n\t\t\n\t\t// go back to start\n\t\twhile ( --$level >= $init_level ) {\n\t\t\t$html []= '</'. $tag_name. '>';\n\t\t\t$html []= '</li>';\n\t\t}\n\t\t$html []= '</'. $tag_name. '>';\n\t\t\n\t\treturn join( '', $html );\n\t}", "function my_walker_nav_menu_start_el($item_output, $item, $depth, $args) {\n $classes = implode(' ', $item->classes);\n $item_output = preg_replace('/<a /', '<a class=\"'.$classes.'\"', $item_output, 1);\n return $item_output;\n }", "public function getList()\r\n {\r\n\t\tif (defined(\"WITH_SPHINX_TAGS\") && WITH_SPHINX_TAGS)\r\n\t\t{\r\n\t\t\t$tags = parent::getList();\r\n\t\t} else {\r\n\t\t\t$tags = $this->getGroupTagsList() +\r\n\t\t\t\t$this->getMembersTagsList() +\r\n\t\t\t\t$this->getDocumentsTagsList() +\r\n\t\t\t\t$this->getEventsTagsList() +\r\n\t\t\t\t$this->getPhotosTagsList() +\r\n\t\t\t\t$this->getListsTagsList();\r\n\t\t}\r\n return $tags;\r\n }", "public function render($tags);", "function makeLinks($nav)\r\n{\r\n$myReturn='';\r\n foreach($nav as $key => $value){\r\n if(THIS_PAGE == $key){//current page add active class\r\n \r\n $myReturn .='\r\n <li class=\"nav-item \">\r\n <a class=\"nav-link active\" href=\"' . $key . ' \">' . $value . ' </a>\r\n </li>'; \r\n \r\n \r\n }else{//add no formatting\r\n \r\n\r\n \r\n $myReturn .='\r\n <li class=\"nav-item\">\r\n <a class=\"nav-link\" href=\"' . $key . ' \">' . $value . ' </a>\r\n </li>'; }\r\n \r\n \r\n \r\n }\r\n \r\n \r\n return $myReturn;\r\n\r\n\r\n\r\n}", "public function add_tag_class( $taglinks ) {\n\t\t$tags = explode('</a>', $taglinks);\n\t\t$regex = \"#(.*tag-link[-])(.*)(' title.*)#e\";\n\t\tforeach( $tags as $tag ) {\n\t\t\t$tagn[] = preg_replace($regex, \"('$1$2 label radius tag-'.get_tag($2)->slug.'$3')\", $tag );\n\t\t}\n\t\t$taglinks = implode('</a>', $tagn);\n\t\treturn $taglinks;\n\t}", "function elevation_add_class_to_the_ul( $postarr ) {\n\t $postarr['post_content'] = str_replace('<ul>', '<ul class=\"list\">', $postarr['post_content'] );\n\t return $postarr;\n\t}", "function initialize () {\n $this->set_openingtag(\"<LI[attributes]>\");\n\t$this->set_closingtag(\"</LI>\");\n }", "public function compileTag()\n {\n $classNode = new \\Twig_Node_Expression_Constant('tag_field large ', $this->lineno);\n \n if ($this->hasNode('class')) {\n $classNode = new \\Twig_Node([\n $classNode,\n $this->getNode('class')\n ]);\n }\n $this->setNode('class', $classNode);\n\n \n \n // create list id node\n $this->compiler\n ->write('$context[\\'_fierce_tag_list_id\\'] = trim(preg_replace(\\'/[^a-zA-Z0-9_]+/\\', \\'_\\', ')\n ->subcompile($this->getNode('name'))\n ->raw(\"), '_') . '_tags';\\n\")\n ;\n $listIdNode = new \\Twig_Node_Expression_Name('_fierce_tag_list_id', $this->lineno);\n \n \n // output field\n parent::compileTag();\n \n // output list\n $this->openTag('ul', [\n 'id' => $listIdNode,\n 'class' => 'tag_list'\n ]);\n \n $this->compiler\n ->addDebugInfo($this)\n // the (array) cast bypasses a PHP 5.2.6 bug\n ->write(\"\\$context['_fierce_tag_list_options'] = twig_ensure_traversable(\")\n ->subcompile($this->getNode('options'))\n ->raw(\");\\n\")\n ;\n $this->compiler\n ->write(\"foreach (\\$context['_fierce_tag_list_options'] as \\$fierceTagListOption) {\\n\")\n ->indent()\n ->write(\"print '<li>' . htmlspecialchars(\\$fierceTagListOption) . '</li>';\\n\")\n ->outdent()\n ->write(\"}\\n\");\n ;\n \n self::closeTag('ul');\n \n // add js\n $this->requireScript(\\Fierce\\Env::get('fierce_src') . 'scripts/tag-field.controller.js');\n }", "public function getTag()\n {\n }", "function h2tag ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('th2tag');\n return $rc->newInstanceArgs( $arguments ); \n}", "public function setLiActiveClass(string $liActiveClass);", "public function tags_list()\n\t{\n\t\t$this->admin_header();\n\t\t\n\t\t//fetch the total number of categories\n\t\t$config['total_num_tag'] = $this->Admin_model->fetch_all_rows('tags');\n\t\t\n\t\t//fetch the total number of tags\n\t\t//$data['total_num_tags'] = $this->Admin_model->fetch_all_rows('tags');\n\t\t\n\t\t//$config['total_rows'] = $this->Admin_model->fetch_all_rows('food');\n\t\t \n\t\t$config['base_url'] = site_url(\"Admin/tags_list/\");\n\t\t$config['per_page'] = 50;\n\t\t$config['uri_segment'] = '3';\n\t\t$config['num_links'] = round($config['total_num_tag'] / $config['per_page']);\n\t\t\n\t\t$config['full_tag_open'] = '<ul class=\"pagination\">';\n\t\t$config['full_tag_close'] = '</ul>';\n\t\t\n\t\t$config['first_link'] = FALSE;\n\t\t\n\t\t$config['last_link'] = FALSE;\n\t\t\n\t\t$config['next_link'] = FALSE;\n\t\t\n\t\t$config['prev_link'] = FALSE;\n\t\t\n\t\t$config['cur_tag_open'] = '<li class=\"active\"><a href=\"#\">';\n\t\t$config['cur_tag_close'] = '</li>';\n\t\t\n\t\t$config['num_tag_open'] = '<li>';\n\t\t$config['num_tag_close'] = '</li>';\n\t\t\n\t\t$this->pagination->initialize($config);\n\t\t\n\t\t$page_number = $this->uri->segment(3);\n\t\t$data['tags'] = $this->Admin_model->fetch_tags($config['per_page'], $page_number);\n\t\t\n\t\t$data['total_num_pages'] = ceil($config['total_num_tag'] / $config['per_page']);\n\t\t$data['total_num_rows'] = $config['total_num_tag'];\n\t\t\n\t\t$url_segments = $this->uri->total_segments();\n\t\t$data['page_num'] = ($url_segments !== 3) ? 1 : $this->uri->segment(3);\n\t\t\n\t\t$this->add_tag_template('tags_list', $data);\n\t}", "function gtags_show_tags_chooser(){\n\t?>\n\t<span class=\"fr\">\n\t\tSuggestions : <span class=\"highlight etiquette\"><?php echo gtags_show_tags_in_add_form(); ?></span>\n\t</span>\n\t<?php \n}", "public function getTag();", "public function getTag();", "function ll_makelist($ll_infolinks, $widgetname){\n\techo '<nav class=\"' . $widgetname .'\"><ul class=\"liblinks-list ' . $widgetname .'\">';\n\tforeach ($ll_infolinks as $linktitle => $linkhref) {\n\t\techo '<li><a href=\"' . $linkhref . '\">' . $linktitle . '</a></li>';\n }\n echo '</ul></nav>';\n}", "public static function helperTagsHtml($tagSet, $options = null, $attributes = null)\n\t{\n\t\tif (!is_array($attributes))\n\t\t{\n\t\t\t$attributes=array();\n\t\t}\n\t\tif (!is_array($options))\n\t\t{\n\t\t\t$options=array();\n\t\t}\n\t\t$options = array_merge(array(\n\t\t\t'term' => '',\n\t\t\t'emClass' => ''\n\t\t), $options);\n\n\t\t/** @var $tagModel CMF_Core_Model_Tag */\n\t\t$tagModel = self::_getModelFromCache('CMF_Core_Model_Tag');\n\t\tif (!is_array($tagSet))\n\t\t{\n\t\t\t$tagSet = $tagModel->getTagsArrayFromSet($tagSet);\n\t\t}\n\t\tif (empty($tagSet))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t$tagsHtmlArray=Array();\n\n\t\tforeach ($tagSet as $tag)\n\t\t{\n\t\t\t$tagHtml = '';\n\t\t\t$attr = $attributes;\n\t\t\t$link = XenForo_Link::buildPublicLink('search/search', null, array('keywords' => $tag, 'type' => 'tag'));\n//\t\t\t$class = (empty($attr['class']) ? '' : htmlspecialchars($attr['class']));\n//\t\t\tunset($attr['class']);\n\n\t\t\tif (!empty($attr['tag']))\n\t\t\t{\n\t\t\t\t$wrapTag = $attr['tag'];\n\t\t\t\tunset($attr['tag']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$wrapTag='';\n\t\t\t}\n\t\t\t$attrString = XenForo_Template_Helper_Core::getAttributes($attr);\n\n\t\t\t$tag = ($options['term']) ? XenForo_Helper_String::highlightSearchTerm($tag, $options['term'], $options['emClass']) : htmlspecialchars($tag);\n\n//\t\t\t$tagHtml = \"<a href=\\\"{$link}\\\" class=\\\"{$class}\\\" {$attrString}>\" . $tag . \"</a>\";\n\t\t\t$tagHtml = \"<a href=\\\"{$link}\\\" {$attrString}>\" . $tag . \"</a>\";\n\n\t\t\t$tagsHtmlArray[] = (!empty($wrapTag)) ? \"<$wrapTag>$tagHtml</$wrapTag>\" : $tagHtml;\n\t\t}\n\t\treturn implode(', ', $tagsHtmlArray);\n\t}", "function lambert_custom_tag_cloud_widget($args) {\n // $args['largest'] = 18; //largest tag\n // $args['smallest'] = 10; //smallest tag\n // $args['unit'] = 'px'; //tag font unit\n $args['format'] = 'list'; //ul with a class of wp-tag-cloud\n return $args;\n}", "function crumble_stdHLight($atts, $content = null) {\r\n\treturn '<span class=\"highlight\">' . do_shortcode ( $content ) . '</span>';\r\n}", "function makeLinks($linkArray)\n{\n $myReturn = '';\n\n foreach($linkArray as $url => $text)\n {\n if($url == THIS_PAGE)\n {//selected page - add class reference\n $myReturn .= '<li><a class=\"selected\" href=\"' . $url . '\">' . $text . '</a></li>' . PHP_EOL;\n }else{\n $myReturn .= '<li><a href=\"' . $url . '\">' . $text . '</a></li>' . PHP_EOL;\n } \n }\n \n return $myReturn; \n}", "function tags_attr($selector, $attr, $text = '', $source = false)\r\n{\r\n\r\n\r\n $result = array();\r\n $text = trim($text);\r\n foreach (get_noko($source)->get($selector)->toArray() as $tag)\r\n if (!$text or @in_array($text,$tag['#text']))\r\n if (!empty($tag[$attr])) $result[] = trim($tag[$attr]);\r\n $r = $result;\r\n\r\n if (DEV)\r\n xlogc('tags_attr', $r, $selector, $attr, $source, $text);\r\n\r\n return $r;\r\n}", "public function do_tags()\n\t{\n\t\tforeach ($this->values as $id => $block)\n\t\t{\n\t\t\tforeach ($block as $name => $replace)\n\t\t\t{\n\t\t\t\t$find = \"{:$name}\";\n\t\t\t\t$this->merged[$id] = str_replace($find, $replace, $this->merged[$id]);\n\t\t\t}\n\t\t}\n\n\t}", "function formatListItem($array,$type,$i,$special='',$gilder='') {\n\t$itemArray = $array[$i];\n\t\n\tif(isset($itemArray['class']) && !is_array($itemArray['class'])) $itemArray['class'] = array($itemArray['class']);\n\t\n\tif($i==0) {\n\t\t$itemArray['class'][] = 'fli';\n\t}\n\tif($i==(count($array)-1)) {\n\t\t$itemArray['class'][] = 'lli';\n\t}\n\tif(!isEven($i)) $itemArray['class'][] = 'even';\n\t\n\t$extraneous_span = '';\n\tif((!empty($gilder) && $gilder==true) || (!empty($itemArray['gilder']) && $itemArray['gilder']==true)) {\n\t\t$extraneous_span = '<span class=\"gl-ir\"></span>';\n\t\t//$itemArray['class'][] = 'gl-ir';\n\t}\n\t\n\t$anchor_class = array();\n\tif(!empty($itemArray['anchor-class'])) {\n\t\tif(!is_array($itemArray['anchor-class'])) $itemArray['anchor-class'] = array($itemArray['anchor-class']);\n\t\t$anchor_class = array_merge($itemArray['anchor-class'],$anchor_class);\n\t}\n\tif($special=='hfeed') {\n\t\t// add class 'hentry' to the li\n\t\t// add class 'entry-title' to the anchor \n\t\t// add rel permalink to the anchor\n\t\t$anchor_class[] = 'entry-title';\n\t\t$itemArray['class'][] = 'hentry';\n\t\t\n\t\tif(empty($itemArray['rel'])) $itemArray['rel'] = array();\n\t\tif(!empty($itemArray['rel']) && !is_array($itemArray['rel'])) $itemArray['rel'] = array($itemArray['rel']);\n\t\tif(!in_array('permalink',$itemArray['rel'])) {\n\t\t\t$itemArray['rel'][] = 'permalink';\n\t\t}\n\t}\n\t\n\tif(strtolower($type)=='dt' && !empty($itemArray['class'])) {\n\t\tif(!is_array($itemArray['class'])) $itemArray['class'] = array($itemArray['class']);\n\t\tfor($i=0; $i<count($itemArray['class']); $i++) {\n\t\t\tif(strtolower($itemArray['class'][$i])=='role') {\n\t\t\t\t$itemArray['class'][] = 'vcard_'.$itemArray['class'][$i];\n\t\t\t\tunset($itemArray['class'][$i]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$text = $itemArray['text'];\n\tif(!preg_match('/<[^<^>]+>/',$text)) $text = formatText($text); // if the text DOESN'T contain HTML, format it.\n\t\n\t$sub = '';\n\tif(!empty($itemArray['sub']) && is_array($itemArray['sub'])) $sub = \"\\n\".createList($itemArray['sub'],'','sub');\n\t\n\tif(!empty($itemArray['link'])) {\n\t\t$list = '<'.$type.addAttributes('',@$itemArray['id'],@$itemArray['class']).'><a href=\"'.$itemArray['link'].'\"'.addAttributes(@$itemArray['title'],'',$anchor_class,@$itemArray['xfn'],@$itemArray['rel'],@$itemArray['accesskey'],@$itemArray['tabindex'],'','',@$itemArray['mime']).'>'.$extraneous_span.$text.'</a>'.$sub.'</'.$type.'>';\n\t}\n\telse {\n\t\t$list = '<'.$type.addAttributes(@$itemArray['title'],@$itemArray['id'],@$itemArray['class']).'>'.$extraneous_span.$text.$sub.'</'.$type.'>';\n\t}\n\t\n\treturn ' '.$list.\"\\n\";\n}", "public function typoSearchTagsHandlesMultipleMarkerPairs() {}", "public function tags(){\n $tagList = Tag::all();\n return view('tag.tags',['tagList'=>$tagList]);\n }", "public function quicktags()\n\t{\n\t\t/* Output */\n\t\t\\IPS\\Output::i()->title\t\t= \\IPS\\Member::loggedIn()->language()->addToStack( 'quick_tags' );\n\t\t\\IPS\\Output::i()->output \t= \\IPS\\Theme::i()->getTemplate( 'forms' )->quicktagsList();\n\t}", "function make_list(array $array)\n {\n echo \"<ul>\";\n \n foreach($array as $numb)\n {\n make_tag(\"li\", $numb);\n }\n\n echo \"</ul>\";\n }", "public function actionList() {\n $searchModel = new TagsSearch();\n $searchModel->load(Yii::$app->request->queryParams);\n $dataProvider = $searchModel->search();\n return $this->render('tag-list', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function HookIt($tag,$attr=\"\",$indenting=\"1\"){\n\t\t$this->clsTag($tag,$attr,$indenting);\n\t}", "function theme_task_list($items, $active = NULL) {\n $done = isset($items[$active]) || $active == NULL;\n $output = '<ol class=\"task-list\">';\n foreach ($items as $k => $item) {\n if ($active == $k) {\n $class = 'active';\n $done = false;\n }\n else {\n $class = $done ? 'done' : '';\n }\n $output .= '<li class=\"'. $class .'\">'. $item .'</li>';\n }\n $output .= '</ol>';\n return $output;\n}", "public function testHighlightCustom()\n {\n $str = 'The quick brown fox jumps over the dog.';\n $expected = 'The quick <em>brown</em> fox jumps over the dog.';\n $this->assertEquals($expected, $this->helper->highlight($str, 'brown', '<em>$1</em>'));\n }", "function highlight()\n{\n // echo \"data coming from hooks\";\n // intercept output\n $CI =& get_instance();\n $data = $CI->output->get_output();\n // find the quote and make it an array of words!\n // substr(string,start,length) method // 16 is for p tag stuff\n $quote = substr($data, strpos($data, '<p class=\"lead\">') + 16,\n strpos($data, '</p>') - (strpos($data, '<p class=\"lead\">') + 16));\n // get all the required data into aaray form \n $newdata = explode(\" \", $quote);\n // create new array for updated quote\n $requiredoutput = array();\n // iterate all the words and add strong tag to them, if there is any capital word \n foreach($newdata as $word)\n {\n if( preg_match(\"/[A-Z]+/\", $word) )\n {\n $word = \"<strong>\" . $word . \"</strong>\";\n }\n $requiredoutput[] = $word;\n }\n // put everything together\n $newquote = implode(\" \", $requiredoutput);\n $newquote = '<p class=\"lead\">' . $newquote . '</p>';\n $data = preg_replace('#<p class=\"lead\">.+</p>#', $newquote, $data);\n // output the page!\n $CI->output->set_output($data);\n $CI->output->_display();\n}", "public function add_class_the_tags($html){\n\t\t$postid = get_the_ID();\n\t\t$html = str_replace('<a','<a class=\"label radius\"',$html);\n\t\treturn $html;\n\t}", "public function tags() {\n\t\treturn $this->get_tags();\n\t}", "function show_tags()\n{\n global $xoopsModule, $xoopsSecurity;\n\n MWFunctions::include_required_files();\n\n RMTemplate::get()->assign('xoops_pagetitle', __('Tags Management', 'mywords'));\n\n // More used tags\n $db = XoopsDatabaseFactory::getDatabaseConnection();\n $sql = 'SELECT * FROM ' . $db->prefix('mod_mywords_tags') . ' ORDER BY posts DESC LIMIT 0,30';\n $result = $db->query($sql);\n $mtags = [];\n $size = 0;\n while (false !== ($row = $db->fetchArray($result))) {\n $mtags[$row['tag']] = $row;\n $size = $row['posts'] > $size ? $row['posts'] : $size;\n }\n\n ksort($mtags);\n\n // All tags\n list($num) = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('mod_mywords_tags')));\n $page = rmc_server_var($_GET, 'page', 1);\n $limit = isset($limit) && $limit > 0 ? $limit : 15;\n\n $tpages = ceil($num / $limit);\n $page = $page > $tpages ? $tpages : $page;\n\n $start = $num <= 0 ? 0 : ($page - 1) * $limit;\n\n $nav = new RMPageNav($num, $limit, $page, 5);\n $nav->target_url('tags.php?page={PAGE_NUM}');\n\n $sql = 'SELECT * FROM ' . $db->prefix('mod_mywords_tags') . \" ORDER BY id_tag DESC LIMIT $start,$limit\";\n\n $result = $db->query($sql);\n $tags = [];\n while (false !== ($row = $db->fetchArray($result))) {\n $tags[] = $row;\n }\n\n RMBreadCrumb::get()->add_crumb(__('Tags management', 'mywords'));\n\n xoops_cp_header();\n RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');\n RMTemplate::get()->add_script('..//include/js/scripts.php?file=tags-list.js');\n RMTemplate::get()->add_style('jquery.css', 'rmcommon');\n include RMTemplate::get()->get_template('admin/mywords-tags.php', 'module', 'mywords');\n\n xoops_cp_footer();\n}", "function tagName(){\n return 'TAG NAME HERE';\n}", "function RenderTabItem($Label, $URL, array $Classes) {\n\t$Result = sprintf(\"<li class=\\\"%s\\\">\\n\" .\n\t\t\t\t\t\t\t\t\t\t\"\t<span>%s</span>\\n\" .\n\t\t\t\t\t\t\t\t\t\t\"</li>\\n\",\n\t\t\t\t\t\t\t\t\t\tGetValue($URL, $Classes, ''),\n\t\t\t\t\t\t\t\t\t\tAnchor($Label, $URL));\n\treturn $Result;\n}", "function makeLinks($nav){\n \n $myReturn = '';\n foreach($nav as $key => $value){\n \n if(THIS_PAGE == $key)\n {//current page add active class \n $myReturn .= '\n <li class=\"nav-item\">\n <a class=\"nav-link active\" href=\"' . $key . '\">' . $value . '</a>\n </li>';\n \n \n }else{//add formatting\n $myReturn .= '\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"' . $key . '\">' . $value . '</a>\n </li>';\n \n }\n \n }\n \n return $myReturn;\n \n}", "function tc_get_the_tags() {\r\n return the_tags();\r\n}", "function add_new_class_list_categories($list) {\r\n $list = str_replace('cat-item', ' cat-item list-group-item', $list);\r\n return $list;\r\n}", "function otm_render_global_tags() {\n\n\t$tags = get_tags();\n\n\t// If we have tags\n\tif ( $tags ) :\n\n\t\t// Render title\n\t\tprintf( '<h3 class=\"c-section-title\">%s</h3>', __( 'Tags', 'otm' ) );\n\n\t\t// Start a list\n\t\techo '<ul class=\"c-menu c-tag-list\">';\n\n\t\t// Render each tag\n\t\tforeach ( $tags as $tag ) {\n\t\t\techo '<li class=\"c-menu__item c-tag-list__item c-read-more c-content-filter__input js-no-menu-toggle\" data-tag=\"' . $tag->slug . '\">' . $tag->name . '</li>';\n\t\t}\n\tendif;\n}", "public function getTags()\n {\n $title = \"Tags\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n // Get all the tags from db\n $tags = $this->di->get(\"tagModel\")->getAllTags();\n\n $data = [\n //\"items\" => $book->findAll(),\n \"tags\" => $tags,\n ];\n\n $view->add(\"pages/tags\", $data);\n //$view->add(\"blocks/footer\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }", "protected function getHighlight()\n {\n return [\n 'pre_tags' => ['<em class=\"highlight\">'],\n 'post_tags' => ['</em>'],\n 'fields' => [\n 'name' => [\n 'number_of_fragments' => 0,\n ],\n 'description' => [\n 'number_of_fragments' => 0,\n ],\n ],\n ];\n }", "public function get_tags(){\n\t \n\t return $this->tags;\n\t}", "function OrderedList( $atts, $content = null ) {\r\n return '<div class=\"OrderedList\">' . $content . '</div>';}", "function allowed_tags()\n {\n }", "public function unorderedListItemsProvider()\n {\n return [[new \\Urbania\\AppleNews\\Format\\ListItemStyle()]];\n }", "public function unorderedListItemsProvider()\n {\n return [[new \\Urbania\\AppleNews\\Format\\ListItemStyle()]];\n }", "function GetAllTags($activeTag = 'All')\n {\n $ret = array();\n $sql = 'SELECT TAG_DESC, TAG_ID ' .\n ' FROM TAGS ' .\n ' WHERE IS_ACTIVE = 1 ' .\n 'ORDER BY TAG_DESC ASC';\n\n $result = QueryDB($sql);\n \n while($result != null && $row = $result->fetch_array(MYSQLI_ASSOC))\n {\n if ($activeTag == $row['TAG_ID']) \n $ret[] = \n '<span class = \"tag activeFilter\" ' . \n ' title = \"Click to filter posts by ' . $row['TAG_DESC'] . '.' .\n '\" onclick = \"markForm(' . $row['TAG_ID'] . '); submitForm();\"' . '>' . $row['TAG_DESC'] .\n '</span>';\n \n else\n $ret[] = \n '<span class = \"tag inactiveFilter\" ' . \n ' title = \"Click to filter posts by ' . $row['TAG_DESC'] . '.' .\n '\" onclick = \"markForm(' . $row['TAG_ID'] . '); submitForm();\"' . '>' . $row['TAG_DESC'] .\n '</span>';\n }\n \n return $ret;\n }" ]
[ "0.62824345", "0.622383", "0.62200075", "0.61833775", "0.61633223", "0.6114175", "0.6094371", "0.6051584", "0.5986998", "0.59708667", "0.59673524", "0.5915572", "0.58881956", "0.5802569", "0.5785969", "0.57782716", "0.5749228", "0.5730729", "0.5686377", "0.5682676", "0.56569505", "0.5621678", "0.56214464", "0.5619338", "0.560583", "0.5594416", "0.5588772", "0.55815655", "0.5579732", "0.5557491", "0.5553016", "0.5542612", "0.5530011", "0.5530011", "0.5530011", "0.5530011", "0.5530011", "0.55254674", "0.55233884", "0.55229294", "0.5519491", "0.55090463", "0.55069846", "0.5502361", "0.54945", "0.546808", "0.5456307", "0.54303515", "0.54239625", "0.54075956", "0.5400406", "0.5399628", "0.53852504", "0.53823423", "0.5376398", "0.5373148", "0.53712416", "0.53623706", "0.53599477", "0.5355605", "0.532646", "0.532546", "0.53230995", "0.5321411", "0.5317454", "0.5315204", "0.5315204", "0.53098965", "0.5307065", "0.52965873", "0.52946675", "0.52942365", "0.52762014", "0.527481", "0.5274451", "0.52736616", "0.52600765", "0.5257427", "0.5251507", "0.52468294", "0.52453107", "0.5242252", "0.52320254", "0.52314496", "0.5229821", "0.5227717", "0.5222375", "0.5215796", "0.5215462", "0.5208042", "0.5200695", "0.5198666", "0.51986414", "0.51972103", "0.519505", "0.5193843", "0.51907414", "0.5189262", "0.5187173", "0.5187173", "0.51844406" ]
0.0
-1
Preserve html entities e.g. foreign languages in strings, particularly when embedded in HTML attributes.
public static function specialsIterator(iterable $iter): iterable { $result = []; foreach ($iter as $k => $v) { $result[$k] = self::specials($v); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function e_attr($string)\n{\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "function _xmlEntities($string) {\n return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');\n }", "function xml_entities($value) {\n\n return strtr(\n\n $value, \n\n array(\n\n \"<\" => \"&lt;\",\n\n \">\" => \"&gt;\",\n\n '\"' => \"&quot;\",\n\n \"'\" => \"&apos;\",\n\n \"&\" => \"&amp;\",\n\n )\n\n );\n\n}", "function xmlentities ( $string ) { \n\treturn str_replace ( array ('&', '<', '>', '\"'), array ('&amp;', '&lt;', '&gt;', '&#34;' ), $string ); \n}", "function wp_kses_normalize_entities( $string, $context = 'html' ) {\n $string = str_replace( '&', '&amp;', $string );\n \n // Change back the allowed entities in our list of allowed entities.\n if ( 'xml' === $context ) {\n $string = preg_replace_callback( '/&amp;([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_xml_named_entities', $string );\n } else {\n $string = preg_replace_callback( '/&amp;([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_named_entities', $string );\n }\n $string = preg_replace_callback( '/&amp;#(0*[0-9]{1,7});/', 'wp_kses_normalize_entities2', $string );\n $string = preg_replace_callback( '/&amp;#[Xx](0*[0-9A-Fa-f]{1,6});/', 'wp_kses_normalize_entities3', $string );\n \n return $string;\n}", "function entify($string) { \n /* used by /samuel/cv/, should leave tags as is and only convert chars */\n # echo \"<!-- $string -->\\n\";\n $from = array('/&/',\n '/å/', '/ä/', '/ö/',\n '/Å/', '/Ä/', '/Ö/',\n );\n $to = array('&amp;',\n '&aring;', '&auml;', '&ouml;',\n '&Aring;', '&Auml;', '&Ouml',\n );\n # echo \"<!-- $string -->\\n\";\n return preg_replace($from, $to, $string);\n }", "function escape($html) { return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\"); }", "function s2_htmlencode($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "function e($string){\n\n return htmlentities($string,'UTF-8', ENT_QUOTES,false);\n\n\n\n\n\n}", "function xmlentities($string)\n{\n return str_replace ( array ( '&', '\"', \"'\", '<', '>' ), array ( '&amp;' , '&quot;', '&apos;' , '&lt;' , '&gt;' ), $string );\n}", "function safehtml($in) {\n return htmlentities($in,ENT_COMPAT,'UTF-8');\n}", "function mysql_entities_fix_string($string){return htmlentities(mysql_fix_string($string));}", "function _twig_escape_html_attr_callback($matches)\n{\n /*\n * While HTML supports far more named entities, the lowest common denominator\n * has become HTML5's XML Serialisation which is restricted to the those named\n * entities that XML supports. Using HTML entities would result in this error:\n * XML Parsing Error: undefined entity\n */\n static $entityMap = array(\n 34 => 'quot', /* quotation mark */\n 38 => 'amp', /* ampersand */\n 60 => 'lt', /* less-than sign */\n 62 => 'gt', /* greater-than sign */\n );\n $chr = $matches[0];\n $ord = ord($chr);\n /**\n * The following replaces characters undefined in HTML with the\n * hex entity for the Unicode replacement character.\n */\n if (($ord <= 0x1f && $chr != \"\\t\" && $chr != \"\\n\" && $chr != \"\\r\") || ($ord >= 0x7f && $ord <= 0x9f)) {\n return '&#xFFFD;';\n }\n /**\n * Check if the current character to escape has a name entity we should\n * replace it with while grabbing the hex value of the character.\n */\n if (strlen($chr) == 1) {\n $hex = strtoupper(substr('00'.bin2hex($chr), -2));\n } else {\n $chr = twig_convert_encoding($chr, 'UTF-16BE', 'UTF-8');\n $hex = strtoupper(substr('0000'.bin2hex($chr), -4));\n }\n $int = hexdec($hex);\n if (array_key_exists($int, $entityMap)) {\n return sprintf('&%s;', $entityMap[$int]);\n }\n /**\n * Per OWASP recommendations, we'll use hex entities for any other\n * characters where a named entity does not exist.\n */\n return sprintf('&#x%s;', $hex);\n}", "function clean($string) {\n return html_entity_decode($string);\n \n}", "function e(string $s): string\n{\n return htmlspecialchars($s, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');\n}", "function escape($html) {\n return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\");\n}", "function convertHtmlEntities($str)\n{\n return htmlentities($str, ENT_QUOTES, \"UTF-8\");\n}", "function mysql_entities_fix_string($data)\n {\n // Fix &entity\\n;\n $data = str_replace(array('&amp;','&lt;','&gt;'), array('&amp;amp;','&amp;lt;','&amp;gt;'), $data);\n $data = preg_replace('/(&#*\\w+)[\\x00-\\x20]+;/u', '$1;', $data);\n $data = preg_replace('/(&#x*[0-9A-F]+);*/iu', '$1;', $data);\n $data = html_entity_decode($data, ENT_COMPAT, 'UTF-8');\n\n // Remove any attribute starting with \"on\" or xmlns\n $data = preg_replace('#(<[^>]+?[\\x00-\\x20\"\\'])(?:on|xmlns)[^>]*+>#iu', '$1>', $data);\n\n // Remove javascript: and vbscript: protocols\n $data = preg_replace('#([a-z]*)[\\x00-\\x20]*=[\\x00-\\x20]*([`\\'\"]*)[\\x00-\\x20]*j[\\x00-\\x20]*a[\\x00-\\x20]*v[\\x00-\\x20]*a[\\x00-\\x20]*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:#iu', '$1=$2nojavascript...', $data);\n $data = preg_replace('#([a-z]*)[\\x00-\\x20]*=([\\'\"]*)[\\x00-\\x20]*v[\\x00-\\x20]*b[\\x00-\\x20]*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:#iu', '$1=$2novbscript...', $data);\n $data = preg_replace('#([a-z]*)[\\x00-\\x20]*=([\\'\"]*)[\\x00-\\x20]*-moz-binding[\\x00-\\x20]*:#u', '$1=$2nomozbinding...', $data);\n\n // Only works in IE: <span style=\"width: expression(alert('Ping!'));\"></span>\n $data = preg_replace('#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`\\'\"]*.*?expression[\\x00-\\x20]*\\([^>]*+>#i', '$1>', $data);\n $data = preg_replace('#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`\\'\"]*.*?behaviour[\\x00-\\x20]*\\([^>]*+>#i', '$1>', $data);\n $data = preg_replace('#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`\\'\"]*.*?s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:*[^>]*+>#iu', '$1>', $data);\n\n // Remove namespaced elements (we do not need them)\n $data = preg_replace('#</*\\w+:\\w[^>]*+>#i', '', $data);\n\n do\n {\n // Remove really unwanted tags\n $old_data = $data;\n $data = preg_replace('#</*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*+>#i', '', $data);\n }\n while ($old_data !== $data);\n $data = trim($data);\n $data = stripslashes($data);\n $data=htmlspecialchars($data);\n return $data;\n }", "function xml_entities($text, $charset = 'UTF-8'){\n\t\t$xml_special_chars = array(\"&quot;\",\"&amp;\",\"&apos;\",\"&lt;\",\"&gt;\");\n $text = htmlentities($text, ENT_COMPAT, $charset, false);\n\n $xml_special_char_regex = \"(?\";\n foreach($xml_special_chars as $key => $value){\n $xml_special_char_regex .= \"(?!$value)\";\n }\n $xml_special_char_regex .= \")\";\n \n $pattern = \"/$xml_special_char_regex&([a-zA-Z0-9]+;)/\";\n return preg_replace($pattern, '&amp;${1}', $text);\n}", "function string_html_specialchars( $p_string ) {\r\n\t# achumakov: @ added to avoid warning output in unsupported codepages\r\n\t# e.g. 8859-2, windows-1257, Korean, which are treated as 8859-1.\r\n\t# This is VERY important for Eastern European, Baltic and Korean languages\r\n\treturn preg_replace(\"/&amp;(#[0-9]+|[a-z]+);/i\", \"&$1;\", @htmlspecialchars( $p_string, ENT_COMPAT, config_get('charset') ) );\r\n}", "function _un_htmlspecialchars($str)\n{\n\tstatic $rev_html_translation_table;\n\n\tif ( empty($rev_html_translation_table) )\n\t{\n\t\t$rev_html_translation_table = function_exists('get_html_translation_table') ? array_flip(get_html_translation_table(HTML_ENTITIES)) : array('&amp;' => '&', '&#039;' => '\\'', '&quot;' => '\"', '&lt;' => '<', '&gt;' => '>');\n\t}\n\treturn strtr(str_replace('<br />', \"\\n\", $str), $rev_html_translation_table);\n}", "public function htmlspecial($text) {\n // This converts single quote to &#039;\n $tooltip = htmlspecialchars($text,ENT_QUOTES);\n // since the result is parsed again with xml_parser, and xml_parser\n // autoconverts (apparently) &#039; back to single quote,\n // and then generates a parse error if this single quote occurs\n // within an atribute value expresses as <x attr='y'> (i.e. y has a\n // single quote).\n // Because of this we change &#039; to &#8217; -- which xml_parser\n // apparently leaves unchanged, and generates no error.\n $tooltip = preg_replace('/&#039;/','&#8217;',$tooltip);\n return $tooltip;\n}", "function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {\n if ( $double_encode ) {\n $string = @htmlspecialchars( $string, $quote_style, $charset );\n } else {\n // Decode &amp; into &\n $string = wp_specialchars_decode( $string, $quote_style );\n\n // Guarantee every &entity; is valid or re-encode the &\n $string = kses_normalize_entities( $string );\n\n // Now re-encode everything except &entity;\n $string = preg_split( '/(&#?x?[0-9a-z]+;)/i', $string, -1, PREG_SPLIT_DELIM_CAPTURE );\n\n for ( $i = 0; $i < count( $string ); $i += 2 )\n $string[$i ] = @htmlspecialchars( $string[$i], $quote_style, 'UTF-8' );\n\n $string = implode( '', $string );\n }\n\n return $string;\n\n}", "public static function entities_replace(string $html): string {\n\t\t$html = strtr($html, ['&ldquo;' => '\"', '&rdquo;' => '\"', '&lsquo;' => '\\'', '&rsquo;' => '\\'', ]);\n\t\treturn html_entity_decode($html);\n\t}", "function e($var){\n return trim(htmlentities($var,ENT_QUOTES,\"UTF-8\"));\n}", "public function encodeOnly($string){\n $final = html_entity_decode($string);\n return $final;\n }", "private static function entities($data)\n {\n return strtr($data, array(\n '<' => '&lt;',\n '>' => '&gt;',\n '\"' => '&quot;'\n ));\n }", "function string_html_entities( $p_string ) {\r\n\treturn htmlentities( $p_string, ENT_COMPAT, config_get('charset') );\r\n}", "function esc_attr( $text ) {\r\n\t$safe_text = wp_check_invalid_utf8( $text );\r\n\t$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\r\n\t/**\r\n\t * Filters a string cleaned and escaped for output in an HTML attribute.\r\n\t *\r\n\t * Text passed to esc_attr() is stripped of invalid or special characters\r\n\t * before output.\r\n\t *\r\n\t * @since 2.0.6\r\n\t *\r\n\t * @param string $safe_text The text after it has been escaped.\r\n\t * @param string $text The text prior to being escaped.\r\n\t */\r\n\treturn apply_filters( 'attribute_escape', $safe_text, $text );\r\n}", "public function htmlspecial($text) {\n // First, use the php function to convert quotes to html entities:\n // This converts single quote to &#039;\n $tooltip = htmlspecialchars($text,ENT_QUOTES);\n // since the result is parsed again with xml_parser, and xml_parser\n // autoconverts (apparently) &#039; back to single quote,\n // and then generates a parse error if this single quote occurs\n // within an atribute value expresses as <x attr='y'> (i.e. y has a\n // single quote).\n // Because of this we change &#039; to &#8217; -- which xml_parser\n // apparently leaves unchanged, and generates no error.\n $tooltip = preg_replace('/&#039;/','&#8217;',$tooltip);\n return $tooltip;\n}", "function escape_html($string) {\n $text = htmlspecialchars($string);\n // $text = strip_tags($string);\n\n return $text;\n}", "function h($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "function html($text)\n{\n\treturn htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\n}", "function protection($string)\n{\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "function unconvertHTML($strInput)//Convert html special code to standart form\n{\n\t//$strInput = html_entity_decode($strInput);\n\t$strInput = str_replace('&quot;', '\"', $strInput);\n\t$strInput = str_replace(\"&#039;\", \"'\", $strInput);\n\treturn $strInput;\n}", "function wp_specialchars_decode( $string, $quote_style = ENT_NOQUOTES ) {\n\t$string = (string) $string;\n\n\tif ( 0 === strlen( $string ) ) {\n\t\treturn '';\n\t}\n\n\t// Don't bother if there are no entities - saves a lot of processing\n\tif ( strpos( $string, '&' ) === false ) {\n\t\treturn $string;\n\t}\n\n\t// Match the previous behaviour of _wp_specialchars() when the $quote_style is not an accepted value\n\tif ( empty( $quote_style ) ) {\n\t\t$quote_style = ENT_NOQUOTES;\n\t} elseif ( !in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) {\n\t\t$quote_style = ENT_QUOTES;\n\t}\n\n\t// More complete than get_html_translation_table( HTML_SPECIALCHARS )\n\t$single = array( '&#039;' => '\\'', '&#x27;' => '\\'' );\n\t$single_preg = array( '/&#0*39;/' => '&#039;', '/&#x0*27;/i' => '&#x27;' );\n\t$double = array( '&quot;' => '\"', '&#034;' => '\"', '&#x22;' => '\"' );\n\t$double_preg = array( '/&#0*34;/' => '&#034;', '/&#x0*22;/i' => '&#x22;' );\n\t$others = array( '&lt;' => '<', '&#060;' => '<', '&gt;' => '>', '&#062;' => '>', '&amp;' => '&', '&#038;' => '&', '&#x26;' => '&' );\n\t$others_preg = array( '/&#0*60;/' => '&#060;', '/&#0*62;/' => '&#062;', '/&#0*38;/' => '&#038;', '/&#x0*26;/i' => '&#x26;' );\n\n\tif ( $quote_style === ENT_QUOTES ) {\n\t\t$translation = array_merge( $single, $double, $others );\n\t\t$translation_preg = array_merge( $single_preg, $double_preg, $others_preg );\n\t} elseif ( $quote_style === ENT_COMPAT || $quote_style === 'double' ) {\n\t\t$translation = array_merge( $double, $others );\n\t\t$translation_preg = array_merge( $double_preg, $others_preg );\n\t} elseif ( $quote_style === 'single' ) {\n\t\t$translation = array_merge( $single, $others );\n\t\t$translation_preg = array_merge( $single_preg, $others_preg );\n\t} elseif ( $quote_style === ENT_NOQUOTES ) {\n\t\t$translation = $others;\n\t\t$translation_preg = $others_preg;\n\t}\n\n\t// Remove zero padding on numeric entities\n\t$string = preg_replace( array_keys( $translation_preg ), array_values( $translation_preg ), $string );\n\n\t// Replace characters according to translation table\n\treturn strtr( $string, $translation );\n}", "function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}", "function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}", "function esc($str) {\n return htmlEnt($str);\n}", "function escape($string){\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "function _htmlentities($str) \n {\n $transtab=get_html_translation_table (HTML_ENTITIES,ENT_QUOTES);\n $transtab[chr(38)] = '&';\n return preg_replace(\"/&(?![A-Za-z]{0,4}\\w{2,3};|#[0-9]{2,5};)/\",\"&amp;\" , strtr($str, $transtab));\n }", "function esc_attr( $text ) {\n\t$safe_text = wp_check_invalid_utf8( $text );\n\t$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\n\t/**\n\t * Filter a string cleaned and escaped for output in an HTML attribute.\n\t *\n\t * Text passed to esc_attr() is stripped of invalid or special characters\n\t * before output.\n\t *\n\t * @since 2.0.6\n\t *\n\t * @param string $safe_text The text after it has been escaped.\n \t * @param string $text The text prior to being escaped.\n\t */\n\treturn apply_filters( 'attribute_escape', $safe_text, $text );\n}", "function string_attribute( $p_string ) \r\n{\r\n\t$p_string = string_html_specialchars( $p_string );\r\n\r\n\treturn $p_string;\r\n}", "function ab_removeEnts($s){ // reformat all entities so WP won't screw with them\n\treturn preg_replace('|&([0-9a-zA-Z#]{1,5});|', '__abENT__$1;', $s);\n}", "function e($value)\n {\n return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false);\n }", "function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}", "function _xss_sanitization_esc_attr( $text ) {\n $safe_text = wp_check_invalid_utf8( $text );\n $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\n return $safe_text;\n}", "function txt_UNhtmlspecialchars($t=\"\")\n\t{\n\t\t$t = str_replace( \"&amp;\" , \"&\", $t );\n\t\t$t = str_replace( \"&lt;\" , \"<\", $t );\n\t\t$t = str_replace( \"&gt;\" , \">\", $t );\n\t\t$t = str_replace( \"&quot;\", '\"', $t );\n\t\t$t = str_replace( \"&#039;\", \"'\", $t );\n\t\t\n\t\treturn $t;\n\t}", "function secur($string){return htmlspecialchars($string, ENT_QUOTES|ENT_SUBSTITUTE);}", "function h( $s ) {\n return htmlspecialchars($s, ENT_QUOTES, 'utf-8');\n}", "protected static function xmlentities($string) {\n return str_replace ( array ( '&', '\"', \"'\", '<', '>', '`' ), array ( '&amp;' , '&quot;', '&apos;' , '&lt;' , '&gt;', '&apos;' ), $string );\n }", "function sanitize($dirty){\n return htmlentities($dirty,ENT_QUOTES,\"UTF-8\");\n}", "public static function html($string) {\n return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');\n }", "function attribute_escape($text)\n {\n }", "function e($str) {\n return htmlspecialchars($str);\n}", "function sanitize_utf8($str){\n return htmlentities($str);\n }", "function preserveMarkup($content)\n{\n $content = utf8_str_replace(\"&\", \"&amp;\", $content);\n $content = utf8_str_replace(\">\", \"&gt;\", $content);\n $content = utf8_str_replace(\"<\", \"&lt;\", $content);\n return $content;\n}", "function html($data) {\n $data = htmlspecialchars($data, ENT_QUOTES); // <>\n return $data;\n }", "function e($string)\n{\n return htmlentities($string, null, 'UTF-8');\n}", "function makeTagEntities($str, $useNamedEntities = 1) {\n // Note that we should use &apos; for the single quote, but IE doesn't like it\n $arrReplace = $useNamedEntities ? array('&#39;','&quot;','&lt;','&gt;') : array('&#39;','&#34;','&#60;','&#62;');\n return str_replace(array(\"'\",'\"','<','>'), $arrReplace, $str);\n }", "function makeTagEntities($str, $useNamedEntities = 1) {\n // Note that we should use &apos; for the single quote, but IE doesn't like it\n $arrReplace = $useNamedEntities ? array('&#39;','&quot;','&lt;','&gt;') : array('&#39;','&#34;','&#60;','&#62;');\n return str_replace(array(\"'\",'\"','<','>'), $arrReplace, $str);\n }", "function removeHtmlAccentLigature($str) {\n $str = htmlentities($str, ENT_NOQUOTES, 'utf-8');\n $str = preg_replace('#&([A-Za-z])(?:acute|cedil|circ|grave|orn|ring|slash|th|tilde|uml|space);#', '\\1', $str); // Supréssion accent passe 1 \n $str = preg_replace('#&([A-Za-z]{2})(?:lig);#', '\\1', $str); // Transformations des ligatures \n //echo \"Supression des accents HTML : $str<br>\";\n return $str;\n }", "function filterSpecials($data){\n\n if(!$this->isUTF8($data))\n $data = utf8_encode($data);\n $data = htmlspecialchars($data, ENT_QUOTES);\n\n return $data;\n }", "function htmlchars($string = \"\")\n{\n return htmlspecialchars($string, ENT_QUOTES, \"UTF-8\");\n}", "function ha($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_QUOTES | ENT_IGNORE, 'UTF-8');\n}", "function encode_html($str)\r\n\t{\r\n\t\t$_POST[$this->_current_field] = htmlspecialchars($str, ENT_COMPAT, \"UTF-8\");\r\n\t}", "function mysql_entities_fix_string($connection, $string)\n {\n return htmlentities(mysql_fix_string($connection, $string));\n }", "function secu_txt($text) {\n return htmlentities(strip_tags($text), ENT_QUOTES, 'UTF-8');\n}", "function convertHTML($strInput) //Convert to html special code\n{\n\t//$strInput = htmlspecialchars($strInput, ENT_QUOTES);\n\t$strInput = str_replace('\"', '&quot;', $strInput);\n\t$strInput = str_replace(\"'\", \"&#039;\", $strInput);\n\treturn $strInput;\n}", "function htmlspecialchars_uni($message)\r\n{\r\n\t$message = preg_replace(\"#&(?!\\#[0-9]+;)#si\", \"&amp;\", $message); // Fix & but allow unicode\r\n\t$message = str_replace(\"<\", \"&lt;\", $message);\r\n\t$message = str_replace(\">\", \"&gt;\", $message);\r\n\t$message = str_replace(\"\\\"\", \"&quot;\", $message);\r\n\treturn $message;\r\n}", "function e($str) {\n echo htmlspecialchars($str, ENT_QUOTES);\n}", "function escape($string) {\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "function h($text){\n\treturn htmlspecialchars($text, ENT_QUOTES, Yii::app()->charset);\n}", "function htmlButTags($str) {\n\t$caracteres = get_html_translation_table(HTML_ENTITIES);\n\t// Find out the \"tags\" entities\n\t$remover = get_html_translation_table(HTML_SPECIALCHARS);\n\t// Spit out the tags entities from the original table\n\t$caracteres = array_diff($caracteres, $remover);\n\t// Translate the string....\n\t$str = strtr($str, $caracteres);\n\t\n\t// now amps\n\t$str = preg_replace(\"/&(?![A-Za-z]{0,4}\\w{2,3};|#[0-9]{2,3};)/\",\"&amp;\" , $str);\n\t\n\treturn $str;\n}", "function tep_decode_specialchars($string){\n $string=str_replace('&gt;', '>', $string);\n $string=str_replace('&lt;', '<', $string);\n $string=str_replace('&#039;', \"'\", $string);\n $string=str_replace('&quot;', \"\\\"\", $string);\n $string=str_replace('&amp;', '&', $string);\n\n return $string;\n }", "function encode($string){\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "public static function entities($value) {\n\t\treturn htmlentities($value, ENT_QUOTES, Config::get('application.encoding'), false);\n\t}", "function escp($text) {\r\n return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\r\n}", "function replace_accents($string) {\n\t $string = htmlentities($string);\n\t $string = preg_replace ('/&([a-zA-Z])(uml|acute|grave|circ|tilde|cedil|ring);/', '$1', $string);\n\t return html_entity_decode($string);\n\t}", "function xmlEntities($str)\n{\n $xml = array('&#34;','&#38;','&#38;','&#60;','&#62;','&#160;','&#161;','&#162;','&#163;','&#164;','&#165;','&#166;','&#167;','&#168;','&#169;','&#170;','&#171;','&#172;','&#173;','&#174;','&#175;','&#176;','&#177;','&#178;','&#179;','&#180;','&#181;','&#182;','&#183;','&#184;','&#185;','&#186;','&#187;','&#188;','&#189;','&#190;','&#191;','&#192;','&#193;','&#194;','&#195;','&#196;','&#197;','&#198;','&#199;','&#200;','&#201;','&#202;','&#203;','&#204;','&#205;','&#206;','&#207;','&#208;','&#209;','&#210;','&#211;','&#212;','&#213;','&#214;','&#215;','&#216;','&#217;','&#218;','&#219;','&#220;','&#221;','&#222;','&#223;','&#224;','&#225;','&#226;','&#227;','&#228;','&#229;','&#230;','&#231;','&#232;','&#233;','&#234;','&#235;','&#236;','&#237;','&#238;','&#239;','&#240;','&#241;','&#242;','&#243;','&#244;','&#245;','&#246;','&#247;','&#248;','&#249;','&#250;','&#251;','&#252;','&#253;','&#254;','&#255;');\n $html = array('&quot;','&amp;','&amp;','&lt;','&gt;','&nbsp;','&iexcl;','&cent;','&pound;','&curren;','&yen;','&brvbar;','&sect;','&uml;','&copy;','&ordf;','&laquo;','&not;','&shy;','&reg;','&macr;','&deg;','&plusmn;','&sup2;','&sup3;','&acute;','&micro;','&para;','&middot;','&cedil;','&sup1;','&ordm;','&raquo;','&frac14;','&frac12;','&frac34;','&iquest;','&Agrave;','&Aacute;','&Acirc;','&Atilde;','&Auml;','&Aring;','&AElig;','&Ccedil;','&Egrave;','&Eacute;','&Ecirc;','&Euml;','&Igrave;','&Iacute;','&Icirc;','&Iuml;','&ETH;','&Ntilde;','&Ograve;','&Oacute;','&Ocirc;','&Otilde;','&Ouml;','&times;','&Oslash;','&Ugrave;','&Uacute;','&Ucirc;','&Uuml;','&Yacute;','&THORN;','&szlig;','&agrave;','&aacute;','&acirc;','&atilde;','&auml;','&aring;','&aelig;','&ccedil;','&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;','&icirc;','&iuml;','&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;','&otilde;','&ouml;','&divide;','&oslash;','&ugrave;','&uacute;','&ucirc;','&uuml;','&yacute;','&thorn;','&yuml;');\n $str = str_replace($html,$xml,$str);\n $str = str_ireplace($html,$xml,$str);\n return $str;\n}", "function sanitxt($sanitxt) {\r\n\t$sanitxt = str_replace('><','> <',$sanitxt);\r\n\r\n\t// remove HTML tags\r\n\t$sanitxt = strip_tags($sanitxt);\r\n\r\n\t// remove multiple spaces\r\n\t$sanitxt = preg_replace('/\\s+/', ' ', $sanitxt);\r\n\r\n\t// convert smart quotes into normal\r\n\tconvert_smart_quotes($sanitxt);\r\n\r\n\t// replace quotes and ampersands with HTML chars (recommended)\r\n\t// and encode string to UTF-8. UTF-8 is default from PHP 5.4.0 only\r\n\r\n\t$sanitxt = htmlspecialchars($sanitxt,ENT_QUOTES,\"UTF-8\",FALSE);\r\n\r\nreturn($sanitxt);\r\n}", "function wp_specialchars_decode($text, $quote_style = \\ENT_NOQUOTES)\n {\n }", "function tep_html_unquote($string) {\n return str_replace(\"&#39;\", \"'\", $string);\n }", "function tep_html_unquote($string) {\n return str_replace(\"&#39;\", \"'\", $string);\n }", "static function specialCharsToHTML( $str )\n {\n $search = array(\n 'á', 'é', 'í', 'ó', 'ú',\n 'Á', 'É', 'Í', 'Ó', 'Ú',\n 'ñ', 'Ñ', '¿', '¡'\n );\n $replace = array(\n '&aacute;', '&eacute;', '&iacute;', '&oacute;', '&uacute;',\n '&Aacute;', '&Eacute;', '&Iacute;', '&Oacute;', '&Uacute;',\n '&ntilde;', '&Ntilde;', '&iquest;', '&iexcl;'\n );\n\n $str = str_replace($search, $replace, $str);\n return $str;\n }", "function _xss_sanitization_esc_html( $text ) {\n $safe_text = wp_check_invalid_utf8( $text );\n $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\n return $safe_text;\n}", "private function dohtmlentities($string) {\r\n\r\n return htmlentities($string, ENT_QUOTES, \"UTF-8\");\r\n\r\n }", "public function escapeHtml($html) {\n\t\t//[roman] da es die schöne double_encode Sache bei htmlentities erst ab der PHP 5.2.3 gibt hier ein fieser Mist...\n\t\tif (version_compare(PHP_VERSION, '5.2.3', '>=')) {\n\t\t\t$html= htmlentities($html, ENT_QUOTES, 'UTF-8', FALSE);\n\t\t} else {\n\t\t\t$html= html_entity_decode($html, ENT_QUOTES, 'UTF-8');\n\t\t\t$html= htmlentities($html, ENT_QUOTES, 'UTF-8');\n\t\t}\n\t\treturn $html;\n\t}", "function atk_htmlentities($string, $quote_style=ENT_COMPAT, $charset=null)\n{\n\treturn atkString::htmlentities($string, $quote_style, $charset);\n}", "function _make_safe_for_xml( $t )\n \t{\n \t\treturn str_replace( '&amp;#39;', '&#39;', htmlspecialchars( $t ) );\n \t}", "public function testHtml() {\n $this->assertEquals('String with b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.'));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i &lt;i&gt;tags&lt;/i&gt;.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('strip' => false)));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('whitelist' => '<b>')));\n $this->assertEquals('String with b &amp;amp; i tags.', Sanitize::html('String <b>with</b> b &amp; i <i>tags</i>.', array('double' => true)));\n }", "function convert_smart_quotes($string) {\r\n \t$search = array(chr(212),chr(213),chr(210),chr(211),chr(209),chr(208),chr(201),chr(145),chr(146),chr(147),chr(148),chr(151),chr(150),chr(133));\r\n\t$replace = array('&#8216;','&#8217;','&#8220;','&#8221;','&#8211;','&#8212;','&#8230;','&#8216;','&#8217;','&#8220;','&#8221;','&#8211;','&#8212;','&#8230;');\r\n return str_replace($search, $replace, $string); \r\n}", "function e($value)\n {\n return htmlentities($value, ENT_QUOTES, 'UTF-8', false);\n }", "function e($value)\n {\n return htmlentities($value, ENT_QUOTES, 'UTF-8', false);\n }", "function encode_desc(&$data)\n{\n $to_entities = get_html_translation_table(HTML_ENTITIES);\n\n $from_entities = array_flip($to_entities);\n\n $data = strtr($data,$from_entities);\n $data = strtr($data,$to_entities);\n\n return $data;\n}", "function tohtml($strValue)\n{\n return htmlspecialchars($strValue);\n}", "function sanitize_html_string($string)\n{\n $pattern[0] = '/\\&/';\n $pattern[1] = '/</';\n $pattern[2] = \"/>/\";\n $pattern[3] = '/\\n/';\n $pattern[4] = '/\"/';\n $pattern[5] = \"/'/\";\n $pattern[6] = \"/%/\";\n $pattern[7] = '/\\(/';\n $pattern[8] = '/\\)/';\n $pattern[9] = '/\\+/';\n $pattern[10] = '/-/';\n $replacement[0] = '&amp;';\n $replacement[1] = '&lt;';\n $replacement[2] = '&gt;';\n $replacement[3] = '<br>';\n $replacement[4] = '&quot;';\n $replacement[5] = '&#39;';\n $replacement[6] = '&#37;';\n $replacement[7] = '&#40;';\n $replacement[8] = '&#41;';\n $replacement[9] = '&#43;';\n $replacement[10] = '&#45;';\n return preg_replace($pattern, $replacement, $string);\n}", "function escape($string) {\n\n return htmlentities($string, ENT_QUOTES, 'ISO-8859-15');\n}", "function h($s) {\n return htmlspecialchars($s, ENT_QUOTES, 'UTF-8');\n}", "function sanitize_string($str)\r\n{\r\n\t$str = strip_tags($str);\r\n $str = htmlentities($str, ENT_QUOTES);\r\n return $str;\r\n}", "function unaccent_string($string) {\n if(strpos($string = htmlentities($string, ENT_QUOTES, 'UTF-8'), '&') !== false) {\n $string = html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|tilde|uml);~i', '$1', $string), ENT_QUOTES, 'UTF-8');\n }\n return $string;\n}" ]
[ "0.7137126", "0.70352286", "0.68276894", "0.6807053", "0.67911935", "0.6764284", "0.6735051", "0.6665122", "0.66609544", "0.66518575", "0.6635965", "0.6626374", "0.6625847", "0.6596042", "0.6593831", "0.65612555", "0.6559145", "0.6542217", "0.6453635", "0.6453101", "0.6444092", "0.6440516", "0.6439964", "0.64317656", "0.64258575", "0.64246976", "0.64174354", "0.64023495", "0.63946253", "0.63845766", "0.63834363", "0.6365149", "0.6351651", "0.6340866", "0.6329186", "0.6320763", "0.631946", "0.631946", "0.6307285", "0.63062584", "0.6304329", "0.63035744", "0.6299616", "0.6278254", "0.6276729", "0.6275393", "0.62714076", "0.626055", "0.6257424", "0.62534946", "0.6248392", "0.624567", "0.6232446", "0.6225169", "0.621818", "0.62132275", "0.6210703", "0.620484", "0.6204229", "0.6199098", "0.6199098", "0.61980337", "0.619719", "0.6196688", "0.6189643", "0.6171351", "0.6169492", "0.6168979", "0.6168191", "0.6156238", "0.6152806", "0.61500585", "0.6147769", "0.6146182", "0.6141012", "0.6138216", "0.61335564", "0.61174095", "0.6104856", "0.6099492", "0.6087208", "0.60823214", "0.6079149", "0.6079149", "0.60769725", "0.6072037", "0.6065045", "0.6061145", "0.60549545", "0.6044687", "0.60437185", "0.6038408", "0.60338193", "0.60338193", "0.60332", "0.60325104", "0.6032361", "0.60273814", "0.60254073", "0.6023949", "0.6006509" ]
0.0
-1
Preserve html entities e.g. foreign languages in strings, particularly when embedded in HTML attributes.
public static function specials(string $string): string { $matches = null; if (!preg_match('/&(#[0-9]+|[A-Za-z0-9]+);/', $string, $matches)) { return htmlspecialchars($string); } $search = $replace = []; foreach ($matches as $i => $match) { $search[] = "{\x01$i\x02}"; $replace[] = $match[0]; } $string = str_replace($replace, $search, $string); $string = htmlspecialchars($string); $string = str_replace($search, $replace, $string); // Leave this here for debugging return $string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function e_attr($string)\n{\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "function _xmlEntities($string) {\n return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');\n }", "function xml_entities($value) {\n\n return strtr(\n\n $value, \n\n array(\n\n \"<\" => \"&lt;\",\n\n \">\" => \"&gt;\",\n\n '\"' => \"&quot;\",\n\n \"'\" => \"&apos;\",\n\n \"&\" => \"&amp;\",\n\n )\n\n );\n\n}", "function xmlentities ( $string ) { \n\treturn str_replace ( array ('&', '<', '>', '\"'), array ('&amp;', '&lt;', '&gt;', '&#34;' ), $string ); \n}", "function wp_kses_normalize_entities( $string, $context = 'html' ) {\n $string = str_replace( '&', '&amp;', $string );\n \n // Change back the allowed entities in our list of allowed entities.\n if ( 'xml' === $context ) {\n $string = preg_replace_callback( '/&amp;([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_xml_named_entities', $string );\n } else {\n $string = preg_replace_callback( '/&amp;([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_named_entities', $string );\n }\n $string = preg_replace_callback( '/&amp;#(0*[0-9]{1,7});/', 'wp_kses_normalize_entities2', $string );\n $string = preg_replace_callback( '/&amp;#[Xx](0*[0-9A-Fa-f]{1,6});/', 'wp_kses_normalize_entities3', $string );\n \n return $string;\n}", "function entify($string) { \n /* used by /samuel/cv/, should leave tags as is and only convert chars */\n # echo \"<!-- $string -->\\n\";\n $from = array('/&/',\n '/å/', '/ä/', '/ö/',\n '/Å/', '/Ä/', '/Ö/',\n );\n $to = array('&amp;',\n '&aring;', '&auml;', '&ouml;',\n '&Aring;', '&Auml;', '&Ouml',\n );\n # echo \"<!-- $string -->\\n\";\n return preg_replace($from, $to, $string);\n }", "function escape($html) { return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\"); }", "function s2_htmlencode($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "function e($string){\n\n return htmlentities($string,'UTF-8', ENT_QUOTES,false);\n\n\n\n\n\n}", "function xmlentities($string)\n{\n return str_replace ( array ( '&', '\"', \"'\", '<', '>' ), array ( '&amp;' , '&quot;', '&apos;' , '&lt;' , '&gt;' ), $string );\n}", "function safehtml($in) {\n return htmlentities($in,ENT_COMPAT,'UTF-8');\n}", "function mysql_entities_fix_string($string){return htmlentities(mysql_fix_string($string));}", "function _twig_escape_html_attr_callback($matches)\n{\n /*\n * While HTML supports far more named entities, the lowest common denominator\n * has become HTML5's XML Serialisation which is restricted to the those named\n * entities that XML supports. Using HTML entities would result in this error:\n * XML Parsing Error: undefined entity\n */\n static $entityMap = array(\n 34 => 'quot', /* quotation mark */\n 38 => 'amp', /* ampersand */\n 60 => 'lt', /* less-than sign */\n 62 => 'gt', /* greater-than sign */\n );\n $chr = $matches[0];\n $ord = ord($chr);\n /**\n * The following replaces characters undefined in HTML with the\n * hex entity for the Unicode replacement character.\n */\n if (($ord <= 0x1f && $chr != \"\\t\" && $chr != \"\\n\" && $chr != \"\\r\") || ($ord >= 0x7f && $ord <= 0x9f)) {\n return '&#xFFFD;';\n }\n /**\n * Check if the current character to escape has a name entity we should\n * replace it with while grabbing the hex value of the character.\n */\n if (strlen($chr) == 1) {\n $hex = strtoupper(substr('00'.bin2hex($chr), -2));\n } else {\n $chr = twig_convert_encoding($chr, 'UTF-16BE', 'UTF-8');\n $hex = strtoupper(substr('0000'.bin2hex($chr), -4));\n }\n $int = hexdec($hex);\n if (array_key_exists($int, $entityMap)) {\n return sprintf('&%s;', $entityMap[$int]);\n }\n /**\n * Per OWASP recommendations, we'll use hex entities for any other\n * characters where a named entity does not exist.\n */\n return sprintf('&#x%s;', $hex);\n}", "function clean($string) {\n return html_entity_decode($string);\n \n}", "function e(string $s): string\n{\n return htmlspecialchars($s, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');\n}", "function escape($html) {\n return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\");\n}", "function convertHtmlEntities($str)\n{\n return htmlentities($str, ENT_QUOTES, \"UTF-8\");\n}", "function mysql_entities_fix_string($data)\n {\n // Fix &entity\\n;\n $data = str_replace(array('&amp;','&lt;','&gt;'), array('&amp;amp;','&amp;lt;','&amp;gt;'), $data);\n $data = preg_replace('/(&#*\\w+)[\\x00-\\x20]+;/u', '$1;', $data);\n $data = preg_replace('/(&#x*[0-9A-F]+);*/iu', '$1;', $data);\n $data = html_entity_decode($data, ENT_COMPAT, 'UTF-8');\n\n // Remove any attribute starting with \"on\" or xmlns\n $data = preg_replace('#(<[^>]+?[\\x00-\\x20\"\\'])(?:on|xmlns)[^>]*+>#iu', '$1>', $data);\n\n // Remove javascript: and vbscript: protocols\n $data = preg_replace('#([a-z]*)[\\x00-\\x20]*=[\\x00-\\x20]*([`\\'\"]*)[\\x00-\\x20]*j[\\x00-\\x20]*a[\\x00-\\x20]*v[\\x00-\\x20]*a[\\x00-\\x20]*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:#iu', '$1=$2nojavascript...', $data);\n $data = preg_replace('#([a-z]*)[\\x00-\\x20]*=([\\'\"]*)[\\x00-\\x20]*v[\\x00-\\x20]*b[\\x00-\\x20]*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:#iu', '$1=$2novbscript...', $data);\n $data = preg_replace('#([a-z]*)[\\x00-\\x20]*=([\\'\"]*)[\\x00-\\x20]*-moz-binding[\\x00-\\x20]*:#u', '$1=$2nomozbinding...', $data);\n\n // Only works in IE: <span style=\"width: expression(alert('Ping!'));\"></span>\n $data = preg_replace('#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`\\'\"]*.*?expression[\\x00-\\x20]*\\([^>]*+>#i', '$1>', $data);\n $data = preg_replace('#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`\\'\"]*.*?behaviour[\\x00-\\x20]*\\([^>]*+>#i', '$1>', $data);\n $data = preg_replace('#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`\\'\"]*.*?s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:*[^>]*+>#iu', '$1>', $data);\n\n // Remove namespaced elements (we do not need them)\n $data = preg_replace('#</*\\w+:\\w[^>]*+>#i', '', $data);\n\n do\n {\n // Remove really unwanted tags\n $old_data = $data;\n $data = preg_replace('#</*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*+>#i', '', $data);\n }\n while ($old_data !== $data);\n $data = trim($data);\n $data = stripslashes($data);\n $data=htmlspecialchars($data);\n return $data;\n }", "function xml_entities($text, $charset = 'UTF-8'){\n\t\t$xml_special_chars = array(\"&quot;\",\"&amp;\",\"&apos;\",\"&lt;\",\"&gt;\");\n $text = htmlentities($text, ENT_COMPAT, $charset, false);\n\n $xml_special_char_regex = \"(?\";\n foreach($xml_special_chars as $key => $value){\n $xml_special_char_regex .= \"(?!$value)\";\n }\n $xml_special_char_regex .= \")\";\n \n $pattern = \"/$xml_special_char_regex&([a-zA-Z0-9]+;)/\";\n return preg_replace($pattern, '&amp;${1}', $text);\n}", "function string_html_specialchars( $p_string ) {\r\n\t# achumakov: @ added to avoid warning output in unsupported codepages\r\n\t# e.g. 8859-2, windows-1257, Korean, which are treated as 8859-1.\r\n\t# This is VERY important for Eastern European, Baltic and Korean languages\r\n\treturn preg_replace(\"/&amp;(#[0-9]+|[a-z]+);/i\", \"&$1;\", @htmlspecialchars( $p_string, ENT_COMPAT, config_get('charset') ) );\r\n}", "function _un_htmlspecialchars($str)\n{\n\tstatic $rev_html_translation_table;\n\n\tif ( empty($rev_html_translation_table) )\n\t{\n\t\t$rev_html_translation_table = function_exists('get_html_translation_table') ? array_flip(get_html_translation_table(HTML_ENTITIES)) : array('&amp;' => '&', '&#039;' => '\\'', '&quot;' => '\"', '&lt;' => '<', '&gt;' => '>');\n\t}\n\treturn strtr(str_replace('<br />', \"\\n\", $str), $rev_html_translation_table);\n}", "public function htmlspecial($text) {\n // This converts single quote to &#039;\n $tooltip = htmlspecialchars($text,ENT_QUOTES);\n // since the result is parsed again with xml_parser, and xml_parser\n // autoconverts (apparently) &#039; back to single quote,\n // and then generates a parse error if this single quote occurs\n // within an atribute value expresses as <x attr='y'> (i.e. y has a\n // single quote).\n // Because of this we change &#039; to &#8217; -- which xml_parser\n // apparently leaves unchanged, and generates no error.\n $tooltip = preg_replace('/&#039;/','&#8217;',$tooltip);\n return $tooltip;\n}", "function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {\n if ( $double_encode ) {\n $string = @htmlspecialchars( $string, $quote_style, $charset );\n } else {\n // Decode &amp; into &\n $string = wp_specialchars_decode( $string, $quote_style );\n\n // Guarantee every &entity; is valid or re-encode the &\n $string = kses_normalize_entities( $string );\n\n // Now re-encode everything except &entity;\n $string = preg_split( '/(&#?x?[0-9a-z]+;)/i', $string, -1, PREG_SPLIT_DELIM_CAPTURE );\n\n for ( $i = 0; $i < count( $string ); $i += 2 )\n $string[$i ] = @htmlspecialchars( $string[$i], $quote_style, 'UTF-8' );\n\n $string = implode( '', $string );\n }\n\n return $string;\n\n}", "public static function entities_replace(string $html): string {\n\t\t$html = strtr($html, ['&ldquo;' => '\"', '&rdquo;' => '\"', '&lsquo;' => '\\'', '&rsquo;' => '\\'', ]);\n\t\treturn html_entity_decode($html);\n\t}", "function e($var){\n return trim(htmlentities($var,ENT_QUOTES,\"UTF-8\"));\n}", "public function encodeOnly($string){\n $final = html_entity_decode($string);\n return $final;\n }", "private static function entities($data)\n {\n return strtr($data, array(\n '<' => '&lt;',\n '>' => '&gt;',\n '\"' => '&quot;'\n ));\n }", "function string_html_entities( $p_string ) {\r\n\treturn htmlentities( $p_string, ENT_COMPAT, config_get('charset') );\r\n}", "function esc_attr( $text ) {\r\n\t$safe_text = wp_check_invalid_utf8( $text );\r\n\t$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\r\n\t/**\r\n\t * Filters a string cleaned and escaped for output in an HTML attribute.\r\n\t *\r\n\t * Text passed to esc_attr() is stripped of invalid or special characters\r\n\t * before output.\r\n\t *\r\n\t * @since 2.0.6\r\n\t *\r\n\t * @param string $safe_text The text after it has been escaped.\r\n\t * @param string $text The text prior to being escaped.\r\n\t */\r\n\treturn apply_filters( 'attribute_escape', $safe_text, $text );\r\n}", "public function htmlspecial($text) {\n // First, use the php function to convert quotes to html entities:\n // This converts single quote to &#039;\n $tooltip = htmlspecialchars($text,ENT_QUOTES);\n // since the result is parsed again with xml_parser, and xml_parser\n // autoconverts (apparently) &#039; back to single quote,\n // and then generates a parse error if this single quote occurs\n // within an atribute value expresses as <x attr='y'> (i.e. y has a\n // single quote).\n // Because of this we change &#039; to &#8217; -- which xml_parser\n // apparently leaves unchanged, and generates no error.\n $tooltip = preg_replace('/&#039;/','&#8217;',$tooltip);\n return $tooltip;\n}", "function escape_html($string) {\n $text = htmlspecialchars($string);\n // $text = strip_tags($string);\n\n return $text;\n}", "function h($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "function html($text)\n{\n\treturn htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\n}", "function protection($string)\n{\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "function unconvertHTML($strInput)//Convert html special code to standart form\n{\n\t//$strInput = html_entity_decode($strInput);\n\t$strInput = str_replace('&quot;', '\"', $strInput);\n\t$strInput = str_replace(\"&#039;\", \"'\", $strInput);\n\treturn $strInput;\n}", "function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}", "function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}", "function wp_specialchars_decode( $string, $quote_style = ENT_NOQUOTES ) {\n\t$string = (string) $string;\n\n\tif ( 0 === strlen( $string ) ) {\n\t\treturn '';\n\t}\n\n\t// Don't bother if there are no entities - saves a lot of processing\n\tif ( strpos( $string, '&' ) === false ) {\n\t\treturn $string;\n\t}\n\n\t// Match the previous behaviour of _wp_specialchars() when the $quote_style is not an accepted value\n\tif ( empty( $quote_style ) ) {\n\t\t$quote_style = ENT_NOQUOTES;\n\t} elseif ( !in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) {\n\t\t$quote_style = ENT_QUOTES;\n\t}\n\n\t// More complete than get_html_translation_table( HTML_SPECIALCHARS )\n\t$single = array( '&#039;' => '\\'', '&#x27;' => '\\'' );\n\t$single_preg = array( '/&#0*39;/' => '&#039;', '/&#x0*27;/i' => '&#x27;' );\n\t$double = array( '&quot;' => '\"', '&#034;' => '\"', '&#x22;' => '\"' );\n\t$double_preg = array( '/&#0*34;/' => '&#034;', '/&#x0*22;/i' => '&#x22;' );\n\t$others = array( '&lt;' => '<', '&#060;' => '<', '&gt;' => '>', '&#062;' => '>', '&amp;' => '&', '&#038;' => '&', '&#x26;' => '&' );\n\t$others_preg = array( '/&#0*60;/' => '&#060;', '/&#0*62;/' => '&#062;', '/&#0*38;/' => '&#038;', '/&#x0*26;/i' => '&#x26;' );\n\n\tif ( $quote_style === ENT_QUOTES ) {\n\t\t$translation = array_merge( $single, $double, $others );\n\t\t$translation_preg = array_merge( $single_preg, $double_preg, $others_preg );\n\t} elseif ( $quote_style === ENT_COMPAT || $quote_style === 'double' ) {\n\t\t$translation = array_merge( $double, $others );\n\t\t$translation_preg = array_merge( $double_preg, $others_preg );\n\t} elseif ( $quote_style === 'single' ) {\n\t\t$translation = array_merge( $single, $others );\n\t\t$translation_preg = array_merge( $single_preg, $others_preg );\n\t} elseif ( $quote_style === ENT_NOQUOTES ) {\n\t\t$translation = $others;\n\t\t$translation_preg = $others_preg;\n\t}\n\n\t// Remove zero padding on numeric entities\n\t$string = preg_replace( array_keys( $translation_preg ), array_values( $translation_preg ), $string );\n\n\t// Replace characters according to translation table\n\treturn strtr( $string, $translation );\n}", "function esc($str) {\n return htmlEnt($str);\n}", "function escape($string){\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "function _htmlentities($str) \n {\n $transtab=get_html_translation_table (HTML_ENTITIES,ENT_QUOTES);\n $transtab[chr(38)] = '&';\n return preg_replace(\"/&(?![A-Za-z]{0,4}\\w{2,3};|#[0-9]{2,5};)/\",\"&amp;\" , strtr($str, $transtab));\n }", "function esc_attr( $text ) {\n\t$safe_text = wp_check_invalid_utf8( $text );\n\t$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\n\t/**\n\t * Filter a string cleaned and escaped for output in an HTML attribute.\n\t *\n\t * Text passed to esc_attr() is stripped of invalid or special characters\n\t * before output.\n\t *\n\t * @since 2.0.6\n\t *\n\t * @param string $safe_text The text after it has been escaped.\n \t * @param string $text The text prior to being escaped.\n\t */\n\treturn apply_filters( 'attribute_escape', $safe_text, $text );\n}", "function string_attribute( $p_string ) \r\n{\r\n\t$p_string = string_html_specialchars( $p_string );\r\n\r\n\treturn $p_string;\r\n}", "function ab_removeEnts($s){ // reformat all entities so WP won't screw with them\n\treturn preg_replace('|&([0-9a-zA-Z#]{1,5});|', '__abENT__$1;', $s);\n}", "function e($value)\n {\n return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false);\n }", "function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}", "function _xss_sanitization_esc_attr( $text ) {\n $safe_text = wp_check_invalid_utf8( $text );\n $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\n return $safe_text;\n}", "function txt_UNhtmlspecialchars($t=\"\")\n\t{\n\t\t$t = str_replace( \"&amp;\" , \"&\", $t );\n\t\t$t = str_replace( \"&lt;\" , \"<\", $t );\n\t\t$t = str_replace( \"&gt;\" , \">\", $t );\n\t\t$t = str_replace( \"&quot;\", '\"', $t );\n\t\t$t = str_replace( \"&#039;\", \"'\", $t );\n\t\t\n\t\treturn $t;\n\t}", "function secur($string){return htmlspecialchars($string, ENT_QUOTES|ENT_SUBSTITUTE);}", "function h( $s ) {\n return htmlspecialchars($s, ENT_QUOTES, 'utf-8');\n}", "protected static function xmlentities($string) {\n return str_replace ( array ( '&', '\"', \"'\", '<', '>', '`' ), array ( '&amp;' , '&quot;', '&apos;' , '&lt;' , '&gt;', '&apos;' ), $string );\n }", "function sanitize($dirty){\n return htmlentities($dirty,ENT_QUOTES,\"UTF-8\");\n}", "public static function html($string) {\n return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');\n }", "function attribute_escape($text)\n {\n }", "function e($str) {\n return htmlspecialchars($str);\n}", "function preserveMarkup($content)\n{\n $content = utf8_str_replace(\"&\", \"&amp;\", $content);\n $content = utf8_str_replace(\">\", \"&gt;\", $content);\n $content = utf8_str_replace(\"<\", \"&lt;\", $content);\n return $content;\n}", "function sanitize_utf8($str){\n return htmlentities($str);\n }", "function html($data) {\n $data = htmlspecialchars($data, ENT_QUOTES); // <>\n return $data;\n }", "function e($string)\n{\n return htmlentities($string, null, 'UTF-8');\n}", "function filterSpecials($data){\n\n if(!$this->isUTF8($data))\n $data = utf8_encode($data);\n $data = htmlspecialchars($data, ENT_QUOTES);\n\n return $data;\n }", "function makeTagEntities($str, $useNamedEntities = 1) {\n // Note that we should use &apos; for the single quote, but IE doesn't like it\n $arrReplace = $useNamedEntities ? array('&#39;','&quot;','&lt;','&gt;') : array('&#39;','&#34;','&#60;','&#62;');\n return str_replace(array(\"'\",'\"','<','>'), $arrReplace, $str);\n }", "function makeTagEntities($str, $useNamedEntities = 1) {\n // Note that we should use &apos; for the single quote, but IE doesn't like it\n $arrReplace = $useNamedEntities ? array('&#39;','&quot;','&lt;','&gt;') : array('&#39;','&#34;','&#60;','&#62;');\n return str_replace(array(\"'\",'\"','<','>'), $arrReplace, $str);\n }", "function removeHtmlAccentLigature($str) {\n $str = htmlentities($str, ENT_NOQUOTES, 'utf-8');\n $str = preg_replace('#&([A-Za-z])(?:acute|cedil|circ|grave|orn|ring|slash|th|tilde|uml|space);#', '\\1', $str); // Supréssion accent passe 1 \n $str = preg_replace('#&([A-Za-z]{2})(?:lig);#', '\\1', $str); // Transformations des ligatures \n //echo \"Supression des accents HTML : $str<br>\";\n return $str;\n }", "function htmlchars($string = \"\")\n{\n return htmlspecialchars($string, ENT_QUOTES, \"UTF-8\");\n}", "function ha($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_QUOTES | ENT_IGNORE, 'UTF-8');\n}", "function encode_html($str)\r\n\t{\r\n\t\t$_POST[$this->_current_field] = htmlspecialchars($str, ENT_COMPAT, \"UTF-8\");\r\n\t}", "function secu_txt($text) {\n return htmlentities(strip_tags($text), ENT_QUOTES, 'UTF-8');\n}", "function mysql_entities_fix_string($connection, $string)\n {\n return htmlentities(mysql_fix_string($connection, $string));\n }", "function convertHTML($strInput) //Convert to html special code\n{\n\t//$strInput = htmlspecialchars($strInput, ENT_QUOTES);\n\t$strInput = str_replace('\"', '&quot;', $strInput);\n\t$strInput = str_replace(\"'\", \"&#039;\", $strInput);\n\treturn $strInput;\n}", "function htmlspecialchars_uni($message)\r\n{\r\n\t$message = preg_replace(\"#&(?!\\#[0-9]+;)#si\", \"&amp;\", $message); // Fix & but allow unicode\r\n\t$message = str_replace(\"<\", \"&lt;\", $message);\r\n\t$message = str_replace(\">\", \"&gt;\", $message);\r\n\t$message = str_replace(\"\\\"\", \"&quot;\", $message);\r\n\treturn $message;\r\n}", "function e($str) {\n echo htmlspecialchars($str, ENT_QUOTES);\n}", "function escape($string) {\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "function h($text){\n\treturn htmlspecialchars($text, ENT_QUOTES, Yii::app()->charset);\n}", "function htmlButTags($str) {\n\t$caracteres = get_html_translation_table(HTML_ENTITIES);\n\t// Find out the \"tags\" entities\n\t$remover = get_html_translation_table(HTML_SPECIALCHARS);\n\t// Spit out the tags entities from the original table\n\t$caracteres = array_diff($caracteres, $remover);\n\t// Translate the string....\n\t$str = strtr($str, $caracteres);\n\t\n\t// now amps\n\t$str = preg_replace(\"/&(?![A-Za-z]{0,4}\\w{2,3};|#[0-9]{2,3};)/\",\"&amp;\" , $str);\n\t\n\treturn $str;\n}", "function tep_decode_specialchars($string){\n $string=str_replace('&gt;', '>', $string);\n $string=str_replace('&lt;', '<', $string);\n $string=str_replace('&#039;', \"'\", $string);\n $string=str_replace('&quot;', \"\\\"\", $string);\n $string=str_replace('&amp;', '&', $string);\n\n return $string;\n }", "function encode($string){\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "public static function entities($value) {\n\t\treturn htmlentities($value, ENT_QUOTES, Config::get('application.encoding'), false);\n\t}", "function escp($text) {\r\n return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\r\n}", "function replace_accents($string) {\n\t $string = htmlentities($string);\n\t $string = preg_replace ('/&([a-zA-Z])(uml|acute|grave|circ|tilde|cedil|ring);/', '$1', $string);\n\t return html_entity_decode($string);\n\t}", "function xmlEntities($str)\n{\n $xml = array('&#34;','&#38;','&#38;','&#60;','&#62;','&#160;','&#161;','&#162;','&#163;','&#164;','&#165;','&#166;','&#167;','&#168;','&#169;','&#170;','&#171;','&#172;','&#173;','&#174;','&#175;','&#176;','&#177;','&#178;','&#179;','&#180;','&#181;','&#182;','&#183;','&#184;','&#185;','&#186;','&#187;','&#188;','&#189;','&#190;','&#191;','&#192;','&#193;','&#194;','&#195;','&#196;','&#197;','&#198;','&#199;','&#200;','&#201;','&#202;','&#203;','&#204;','&#205;','&#206;','&#207;','&#208;','&#209;','&#210;','&#211;','&#212;','&#213;','&#214;','&#215;','&#216;','&#217;','&#218;','&#219;','&#220;','&#221;','&#222;','&#223;','&#224;','&#225;','&#226;','&#227;','&#228;','&#229;','&#230;','&#231;','&#232;','&#233;','&#234;','&#235;','&#236;','&#237;','&#238;','&#239;','&#240;','&#241;','&#242;','&#243;','&#244;','&#245;','&#246;','&#247;','&#248;','&#249;','&#250;','&#251;','&#252;','&#253;','&#254;','&#255;');\n $html = array('&quot;','&amp;','&amp;','&lt;','&gt;','&nbsp;','&iexcl;','&cent;','&pound;','&curren;','&yen;','&brvbar;','&sect;','&uml;','&copy;','&ordf;','&laquo;','&not;','&shy;','&reg;','&macr;','&deg;','&plusmn;','&sup2;','&sup3;','&acute;','&micro;','&para;','&middot;','&cedil;','&sup1;','&ordm;','&raquo;','&frac14;','&frac12;','&frac34;','&iquest;','&Agrave;','&Aacute;','&Acirc;','&Atilde;','&Auml;','&Aring;','&AElig;','&Ccedil;','&Egrave;','&Eacute;','&Ecirc;','&Euml;','&Igrave;','&Iacute;','&Icirc;','&Iuml;','&ETH;','&Ntilde;','&Ograve;','&Oacute;','&Ocirc;','&Otilde;','&Ouml;','&times;','&Oslash;','&Ugrave;','&Uacute;','&Ucirc;','&Uuml;','&Yacute;','&THORN;','&szlig;','&agrave;','&aacute;','&acirc;','&atilde;','&auml;','&aring;','&aelig;','&ccedil;','&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;','&icirc;','&iuml;','&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;','&otilde;','&ouml;','&divide;','&oslash;','&ugrave;','&uacute;','&ucirc;','&uuml;','&yacute;','&thorn;','&yuml;');\n $str = str_replace($html,$xml,$str);\n $str = str_ireplace($html,$xml,$str);\n return $str;\n}", "function sanitxt($sanitxt) {\r\n\t$sanitxt = str_replace('><','> <',$sanitxt);\r\n\r\n\t// remove HTML tags\r\n\t$sanitxt = strip_tags($sanitxt);\r\n\r\n\t// remove multiple spaces\r\n\t$sanitxt = preg_replace('/\\s+/', ' ', $sanitxt);\r\n\r\n\t// convert smart quotes into normal\r\n\tconvert_smart_quotes($sanitxt);\r\n\r\n\t// replace quotes and ampersands with HTML chars (recommended)\r\n\t// and encode string to UTF-8. UTF-8 is default from PHP 5.4.0 only\r\n\r\n\t$sanitxt = htmlspecialchars($sanitxt,ENT_QUOTES,\"UTF-8\",FALSE);\r\n\r\nreturn($sanitxt);\r\n}", "function wp_specialchars_decode($text, $quote_style = \\ENT_NOQUOTES)\n {\n }", "function tep_html_unquote($string) {\n return str_replace(\"&#39;\", \"'\", $string);\n }", "function tep_html_unquote($string) {\n return str_replace(\"&#39;\", \"'\", $string);\n }", "static function specialCharsToHTML( $str )\n {\n $search = array(\n 'á', 'é', 'í', 'ó', 'ú',\n 'Á', 'É', 'Í', 'Ó', 'Ú',\n 'ñ', 'Ñ', '¿', '¡'\n );\n $replace = array(\n '&aacute;', '&eacute;', '&iacute;', '&oacute;', '&uacute;',\n '&Aacute;', '&Eacute;', '&Iacute;', '&Oacute;', '&Uacute;',\n '&ntilde;', '&Ntilde;', '&iquest;', '&iexcl;'\n );\n\n $str = str_replace($search, $replace, $str);\n return $str;\n }", "function _xss_sanitization_esc_html( $text ) {\n $safe_text = wp_check_invalid_utf8( $text );\n $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\n return $safe_text;\n}", "private function dohtmlentities($string) {\r\n\r\n return htmlentities($string, ENT_QUOTES, \"UTF-8\");\r\n\r\n }", "public function escapeHtml($html) {\n\t\t//[roman] da es die schöne double_encode Sache bei htmlentities erst ab der PHP 5.2.3 gibt hier ein fieser Mist...\n\t\tif (version_compare(PHP_VERSION, '5.2.3', '>=')) {\n\t\t\t$html= htmlentities($html, ENT_QUOTES, 'UTF-8', FALSE);\n\t\t} else {\n\t\t\t$html= html_entity_decode($html, ENT_QUOTES, 'UTF-8');\n\t\t\t$html= htmlentities($html, ENT_QUOTES, 'UTF-8');\n\t\t}\n\t\treturn $html;\n\t}", "function atk_htmlentities($string, $quote_style=ENT_COMPAT, $charset=null)\n{\n\treturn atkString::htmlentities($string, $quote_style, $charset);\n}", "function _make_safe_for_xml( $t )\n \t{\n \t\treturn str_replace( '&amp;#39;', '&#39;', htmlspecialchars( $t ) );\n \t}", "public function testHtml() {\n $this->assertEquals('String with b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.'));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i &lt;i&gt;tags&lt;/i&gt;.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('strip' => false)));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('whitelist' => '<b>')));\n $this->assertEquals('String with b &amp;amp; i tags.', Sanitize::html('String <b>with</b> b &amp; i <i>tags</i>.', array('double' => true)));\n }", "function convert_smart_quotes($string) {\r\n \t$search = array(chr(212),chr(213),chr(210),chr(211),chr(209),chr(208),chr(201),chr(145),chr(146),chr(147),chr(148),chr(151),chr(150),chr(133));\r\n\t$replace = array('&#8216;','&#8217;','&#8220;','&#8221;','&#8211;','&#8212;','&#8230;','&#8216;','&#8217;','&#8220;','&#8221;','&#8211;','&#8212;','&#8230;');\r\n return str_replace($search, $replace, $string); \r\n}", "function e($value)\n {\n return htmlentities($value, ENT_QUOTES, 'UTF-8', false);\n }", "function e($value)\n {\n return htmlentities($value, ENT_QUOTES, 'UTF-8', false);\n }", "function tohtml($strValue)\n{\n return htmlspecialchars($strValue);\n}", "function encode_desc(&$data)\n{\n $to_entities = get_html_translation_table(HTML_ENTITIES);\n\n $from_entities = array_flip($to_entities);\n\n $data = strtr($data,$from_entities);\n $data = strtr($data,$to_entities);\n\n return $data;\n}", "function sanitize_html_string($string)\n{\n $pattern[0] = '/\\&/';\n $pattern[1] = '/</';\n $pattern[2] = \"/>/\";\n $pattern[3] = '/\\n/';\n $pattern[4] = '/\"/';\n $pattern[5] = \"/'/\";\n $pattern[6] = \"/%/\";\n $pattern[7] = '/\\(/';\n $pattern[8] = '/\\)/';\n $pattern[9] = '/\\+/';\n $pattern[10] = '/-/';\n $replacement[0] = '&amp;';\n $replacement[1] = '&lt;';\n $replacement[2] = '&gt;';\n $replacement[3] = '<br>';\n $replacement[4] = '&quot;';\n $replacement[5] = '&#39;';\n $replacement[6] = '&#37;';\n $replacement[7] = '&#40;';\n $replacement[8] = '&#41;';\n $replacement[9] = '&#43;';\n $replacement[10] = '&#45;';\n return preg_replace($pattern, $replacement, $string);\n}", "function escape($string) {\n\n return htmlentities($string, ENT_QUOTES, 'ISO-8859-15');\n}", "function h($s) {\n return htmlspecialchars($s, ENT_QUOTES, 'UTF-8');\n}", "function sanitize_string($str)\r\n{\r\n\t$str = strip_tags($str);\r\n $str = htmlentities($str, ENT_QUOTES);\r\n return $str;\r\n}", "function unaccent_string($string) {\n if(strpos($string = htmlentities($string, ENT_QUOTES, 'UTF-8'), '&') !== false) {\n $string = html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|tilde|uml);~i', '$1', $string), ENT_QUOTES, 'UTF-8');\n }\n return $string;\n}" ]
[ "0.7135114", "0.703403", "0.6827141", "0.68063325", "0.67905045", "0.6763522", "0.6735091", "0.66647345", "0.665946", "0.6651248", "0.6636116", "0.662529", "0.66252834", "0.6595712", "0.65936446", "0.65612483", "0.6557385", "0.6542779", "0.6453192", "0.6452648", "0.6444492", "0.64399606", "0.6439629", "0.6431575", "0.6426192", "0.6424527", "0.6416828", "0.6400324", "0.6393874", "0.6383699", "0.6383588", "0.6364628", "0.63515943", "0.6340164", "0.6329327", "0.63195354", "0.63195354", "0.6319159", "0.6306363", "0.6305057", "0.6302771", "0.63027316", "0.62978464", "0.62783825", "0.62769336", "0.6275425", "0.62711936", "0.62617236", "0.62573093", "0.62530994", "0.6247267", "0.62470585", "0.6231467", "0.62244093", "0.62187344", "0.6212851", "0.62123257", "0.6205674", "0.6202514", "0.6197373", "0.61972165", "0.61972165", "0.6197155", "0.6195456", "0.6189672", "0.6170662", "0.61687565", "0.616848", "0.61677676", "0.6156374", "0.615311", "0.61487573", "0.6147805", "0.614594", "0.6140136", "0.6136824", "0.61327386", "0.61173326", "0.61034286", "0.60982895", "0.60878086", "0.6081673", "0.6079395", "0.6079395", "0.6075215", "0.6072138", "0.606286", "0.6061121", "0.605292", "0.6045189", "0.60437447", "0.6036814", "0.6033209", "0.6033209", "0.60330385", "0.6032549", "0.60324204", "0.6026088", "0.60251623", "0.6023554", "0.60052264" ]
0.0
-1
Extract Data attributes, supporting data_id formats (converted to dataid)
public static function dataAttributes(array $attributes): array { return ArrayTools::flatten(ArrayTools::filterKeyPrefixes(ArrayTools::keysReplace(array_change_key_case($attributes), '_', '-'), 'data-', true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _retrieveFormattedDataAttributes()\n {\n $dataAttribs = '';\n $filter = new Zend_Filter_Word_CamelCaseToDash();\n foreach ($this->_dataAttribs as $key => $value) {\n $key = strtolower($filter->filter($key));\n if ($value === true) {\n $value = 'true';\n } else if($value === false) {\n $value = 'false';\n }\n $dataAttribs .= \"data-$key=\\\"$value\\\" \";\n }\n return $dataAttribs;\n }", "function changeDataKeysId2Name($data){\n\t\t/*\n\t\t$res = array();\n\t\tforeach ($this->OnlyById as $aid=>$attribute) {\n\t\t\tif(!isset($data[$aid])) continue;\n\t\t\t$res[$attribute['name']] = $data[$aid];\n\t\t}\n\t\treturn $res;\n\t\t*/\n\t\t\n\t\t$res = array();\n\t\tforeach ($data as $aid=>$val){\n\t\t\tif(isset($this->OnlyById[$aid])){\n\t\t\t\t$res[$this->OnlyById[$aid]->fieldName] = $val;\n\t\t\t} else {\n\t\t\t\t$res[$aid] = $val;\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}", "public function extractAttributes($data) : array\n {\n return [\n 'merchant_id' => $this->merchant->id,\n 'sku' => $data['Model'],\n 'name' => $data['Name'],\n 'description' => $data['Description'],\n 'quantity' => $data['QTY'],\n 'original_price' => $data['Sales Price'],\n 'product_identifier' => $data['UPC'],\n 'product_identifier_type' => 'upc',\n 'brand' => $data['Brand Name'],\n 'condition' => 'new',\n 'specs' => $this->extractSpecs($data),\n ];\n }", "public function getDataAttribute($data)\n {\n $data = unserialize($data);\n\n return $data;\n }", "protected function setExtraFieldData( $data )\n {\n $raw = array();\n\n $offset = 0;\n $dataLength = strlen( $data );\n\n while ( $offset < $dataLength )\n {\n // Read header.\n $dec = unpack( \"vid/vlength\", substr( $data, $offset, 4 ) );\n $offset += 4;\n\n switch ( $dec[\"id\"] )\n {\n case self::EF_IZUNIX2:\n $raw[ \"EF_IZUNIX2\" ] = $this->getNewInfoZipExtraField( substr( $data, $offset, $dec[\"length\"] ), $dec[\"length\"] );\n break;\n\n case self::EF_IZUNIX:\n $raw[ \"EF_IZUNIX\" ] = $this->getOldInfoZipExtraField( substr( $data, $offset, $dec[\"length\"] ), $dec[\"length\"] );\n break;\n\n case self::EF_TIME:\n $raw[ \"EF_TIME\" ] = $this->getUniversalTimestampField( substr( $data, $offset, $dec[\"length\"] ), $dec[\"length\"] );\n break;\n }\n\n $offset += $dec[\"length\"];\n }\n\n $result = array();\n\n // The order is important.\n if ( isset( $raw[\"EF_TIME\"][\"mtime\"] ) )\n {\n $this->mtime = $raw[\"EF_TIME\"][\"mtime\"];\n }\n\n if ( isset( $raw[\"EF_TIME\"][\"atime\"] ) )\n {\n $this->atime = $raw[\"EF_TIME\"][\"atime\"];\n }\n\n if ( isset( $raw[\"EF_TIME\"][\"ctime\"] ) )\n {\n $this->ctime = $raw[\"EF_TIME\"][\"ctime\"];\n }\n\n if ( isset( $raw[\"EF_IZUNIX\"][\"mtime\"] ) )\n {\n $this->mtime = $raw[\"EF_IZUNIX\"][\"mtime\"];\n }\n\n if ( isset( $raw[\"EF_IZUNIX\"][\"atime\"] ) )\n {\n $this->atime = $raw[\"EF_IZUNIX\"][\"atime\"];\n }\n\n if ( isset( $raw[\"EF_IZUNIX\"][\"gid\"] ) )\n {\n $this->groupId = $raw[\"EF_IZUNIX\"][\"gid\"];\n }\n\n if ( isset( $raw[\"EF_IZUNIX\"][\"uid\"] ) )\n {\n $this->userId = $raw[\"EF_IZUNIX\"][\"uid\"];\n }\n\n if ( isset( $raw[\"EF_IZUNIX2\"][\"gid\"] ) )\n {\n $this->groupId = $raw[\"EF_IZUNIX2\"][\"gid\"];\n }\n\n if ( isset( $raw[\"EF_IZUNIX2\"][\"uid\"] ) )\n {\n $this->userId = $raw[\"EF_IZUNIX2\"][\"uid\"];\n }\n\n return $result;\n }", "function get_keytagid_data($data)\n\t {\n\t return $this->Tag_process->get_id_by_text($data);\n\t }", "protected function _prepareData($data)\n {\n foreach ($this->_mapAttributes as $attributeAlias => $attributeCode) {\n if (isset($data[$attributeAlias])) {\n $data[$attributeCode] = $data[$attributeAlias];\n unset($data[$attributeAlias]);\n }\n }\n return $data;\n }", "function _get_data_attrs($array){\n\t\t\t\tif(!function_exists('EVO_get_data_attrs')){\n\t\t\t\t\t$output = '';\n\t\t\t\t\tforeach($array as $key=>$val){\n\t\t\t\t\t\t$output .= 'data-'.$key.'=\"'.$val .'\" ';\n\t\t\t\t\t}\n\t\t\t\t\treturn $output;\n\t\t\t\t}else{\n\t\t\t\t\treturn EVO_get_data_attrs($array);\n\t\t\t\t}\n\t\t\t}", "protected function parseData($data){\r\n $d = array();\r\n if(is_string($data)){\r\n try{\r\n parse_str($data,$arr);\r\n $d = $arr;\r\n }catch(Exception $e){\r\n //del lam gi ca\r\n }\r\n }elseif(is_array($data)){\r\n $d = $data;\r\n }\r\n if(!$d) return null;\r\n unset($d[$this->idField]);\r\n $r = array();\r\n foreach($d as $f => $v){\r\n if(in_array($f, $this->fields)) $r[$f] = $v;\r\n }\r\n return $r;\r\n }", "public function parseSetData($data) {\n return $data;\n }", "public function getDataFields()\n {\n $query = 'response > record > marcRecord > datafield';\n $dataFields = $this->domCrawler->filter($query)->each(function (Crawler $node) {\n return new DataField($node);\n });\n\n\n return $dataFields;\n }", "private function extractIdsArray($data)\n {\n return array_pluck($data['photoset'], 'id');\n }", "private static function _cookData($data) {\n $tmp = array();\n if (isset($data['ad_id'])) $tmp['ad_id'] = $data['ad_id'];\n if (isset($data['label_type'])) $tmp['label_type'] = $data['label_type'];\n if (isset($data['ads_name'])) $tmp['ads_name'] = $data['ads_name'];\n if (isset($data['advertiser_uid'])) $tmp['advertiser_uid'] = $data['advertiser_uid'];\n if (isset($data['create_time'])) $tmp['create_time'] = $data['create_time'];\n if (isset($data['update_time'])) $tmp['update_time'] = $data['update_time'];\n return $tmp;\n }", "abstract public function getDataDesc();", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['out_id'])) $tmp['out_id'] = $data['out_id'];\n\t\tif(isset($data['file_id'])) $tmp['file_id'] = $data['file_id'];\n\t\tif(isset($data['label_id'])) $tmp['label_id'] = $data['label_id'];\n\t\tif(isset($data['create_time'])) $tmp['create_time'] = intval($data['create_time']);\n\t\tif(isset($data['update_time'])) $tmp['update_time'] = intval($data['update_time']);\n\t\treturn $tmp;\n\t}", "public function dataProviderParseIdList(): array\n {\n return [\n 'empty' => [\n '',\n [],\n ],\n 'single simple ID' => [\n '223',\n [['223']],\n ],\n 'single ID with delimiters' => [\n '\"223,3425\"',\n [['223,3425']],\n ],\n 'multiple IDs' => [\n '1, 2 ,33,777,4',\n [['1'], ['2'], ['33'], ['777'], ['4']],\n ],\n 'multiple with multiple columns' => [\n '1:foo,235:bar, 543:\"x:o\"',\n [['1', 'foo'], ['235', 'bar'], ['543', 'x:o']],\n ],\n ];\n }", "private function computeIdentifierAttribute(): void\n {\n $data = $this->content->jsonSerialize();\n $this->attributes['data-bb-identifier'] = str_replace('\\\\', '/', $data['type']) . '(' . $data['uid'] . ')';\n }", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['id'])) $tmp['id'] = $data['id'];\n\t\tif(isset($data['uuid'])) $tmp['uuid'] = $data['uuid'];\n\t\tif(isset($data['aid'])) $tmp['aid'] = $data['aid'];\n\t\tif(isset($data['denomination'])) $tmp['denomination'] = $data['denomination'];\n\t\tif(isset($data['use_denomination'])) $tmp['use_denomination'] = $data['use_denomination'];\n\t\tif(isset($data['status'])) $tmp['status'] = $data['status'];\n\t\tif(isset($data['send_type'])) $tmp['send_type'] = $data['send_type'];\n\t\tif(isset($data['sub_send_type'])) $tmp['sub_send_type'] = $data['sub_send_type'];\n\t\tif(isset($data['consume_time'])) $tmp['consume_time'] = $data['consume_time'];\n\t\tif(isset($data['out_order_id'])) $tmp['out_order_id'] = $data['out_order_id'];\n\t\tif(isset($data['start_time'])) $tmp['start_time'] = $data['start_time'];\n\t\tif(isset($data['end_time'])) $tmp['end_time'] = $data['end_time'];\n\t\tif(isset($data['update_time'])) $tmp['update_time'] = $data['update_time'];\n\t\tif(isset($data['densection'])) $tmp['densection'] = $data['densection'];\n\t\tif(isset($data['description'])) $tmp['description'] = $data['description'];\n\t\tif(isset($data['third_type'])) $tmp['third_type'] = $data['third_type'];\n\t\treturn $tmp;\n\t}", "private function parseData($data) : void\n {\n $this->id = $data['id'];\n $this->addressLine1 = $data['line1'];\n $this->addressLine2 = $data['line2'];\n $this->addressLine3 = $data['line3'];\n $this->addressLine4 = $data['line4'];\n $this->locality = $data['locality'];\n $this->townOrCity = $data['townOrcity']; // I wish they would correct this parameter...\n $this->county = $data['county'];\n }", "private function populateIdentifier(array $data, string $class): array\n {\n $identifier = 'id';\n $resourceMetadata = $this->resourceMetadataCollectionFactory->create($class);\n\n $operation = $resourceMetadata->getOperation();\n if ($operation instanceof HttpOperation) {\n $uriVariable = $operation->getUriVariables()[0] ?? null;\n\n if ($uriVariable) {\n $identifier = $uriVariable->getIdentifiers()[0] ?? 'id';\n }\n }\n\n $identifier = null === $this->nameConverter ? $identifier : $this->nameConverter->normalize($identifier, $class, self::FORMAT);\n\n if (!isset($data['_source'][$identifier])) {\n $data['_source'][$identifier] = $data['_id'];\n }\n\n return $data;\n }", "function extractMetadata($filedata) {\r\n\t\treturn array(\r\n\t\t\t'filename' => $this->filename($filedata),\r\n\t\t\t'filesize' => $this->filesize($filedata),\r\n\t\t\t'ext' => $this->ext($filedata),\r\n\t\t\t'mimetype' => $this->mimetype($filedata),\r\n\t\t);\r\n\t}", "public function getData($data) { \n\t\t\t\t$this->sponsor = $data[0]; \n\t\t\t\t$this->amount = $data[1];\n\t\t\t}", "protected function parseDataAttribute(string $dataAttribute): Generator\n {\n $matches = [];\n preg_match_all('/([a-zA-Z]+)([^|]*)/', $dataAttribute, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $match) {\n $name = $match[1];\n $options = [];\n\n if (isset($match[2])) {\n $allOptions = explode(',', $match[2]);\n foreach ($allOptions as $option) {\n $option = explode(':', $option);\n if (! isset($option[0], $option[1])) {\n continue;\n }\n\n $options[trim($option[0], ' {}\\'\\\"')] = trim($option[1], ' {}\\'\\\"');\n }\n }\n\n yield $name => $options;\n }\n }", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['id'])) $tmp['id'] = $data['id'];\n\t\tif(isset($data['title'])) $tmp['title'] = $data['title'];\n\t\tif(isset($data['guide'])) $tmp['guide'] = $data['guide'];\n\t\tif(isset($data['gtype'])) $tmp['gtype'] = $data['gtype'];\n\t\tif(isset($data['ntype'])) $tmp['ntype'] = $data['ntype'];\n\t\tif(isset($data['btype'])) $tmp['btype'] = $data['btype'];\n\t\tif(isset($data['img'])) $tmp['img'] = $data['img'];\n\t\tif(isset($data['status'])) $tmp['status'] = intval($data['status']);\n\t\tif(isset($data['start_time'])) $tmp['start_time'] = $data['start_time'];\n\t\tif(isset($data['update_time'])) $tmp['update_time'] = intval($data['update_time']);\n\t\tif(isset($data['end_time'])) $tmp['end_time'] = intval($data['end_time']);\n\t\treturn $tmp;\n\t}", "private function attributes($data)\n {\n if (is_array($data)) {\n $attrStr = '';\n foreach ($data as $key => $value) {\n if (is_integer($key)) {\n $attrStr .= $this->attributes($value);\n } else {\n $attrStr .= ' '.$key . '=' . $value;\n }\n }\n return $attrStr;\n }\n else {\n return ' '. $data->getName() . '=' . $data->getValue();\n }\n\n }", "private static function _cookData($data) {\n\t\t$tmp = array();\n $fields = array(\n 'htype', 'title', 'hd_start_time', 'hd_end_time', 'status', 'hd_object',\n 'condition_type', 'condition_value', 'rule_type', 'game_version', 'game_object',\n 'denomination','deadline','rule_content','rule_content_percent','create_time','subject_id',\n 'hd_object_addition_info', 'game_object_addition_info'\n );\n foreach ($fields as $field) {\n if(isset($data[$field])) {\n $tmp[$field] = $data[$field];\n }\n }\n\t\treturn $tmp;\n\t}", "public function getPpAttributes(PpDataset $ppDataset) {\n $query=$this->db->prepare('SHOW COLUMNS IN `'.$ppDataset->id.'`;');\n $query->execute();\n $columns=$query->fetchAll(PDO::FETCH_CLASS);\n $result=[];\n foreach ($columns as $column){\n $result[]=new PpAttribute($column->Field, $ppDataset->id, null, $column->Field, self::encodeDbDataType($column->Type), null);\n }\n return $result;\n }", "function hook_uuid_id_uri_data($data) {\n}", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['DAY_ID'])) $tmp['DAY_ID'] = intval($data['DAY_ID']);\n\t\tif(isset($data['GAME_ID'])) $tmp['GAME_ID'] = $data['GAME_ID'];\n\t\tif(isset($data['DL_TIMES'])) $tmp['DL_TIMES'] = intval($data['DL_TIMES']);\n\t\tif(isset($data['CRT_TIME'])) $tmp['CRT_TIME'] = $data['CRT_TIME'];\n\t\treturn $tmp;\n\t}", "public function _getData(): array\n {\n $result = [\n 'name' => $this->getName(),\n ];\n\n return parent::normalizeData($result);\n }", "public function getAttributes() {\n $attr = array();\n \n $attr[\"id\"] = $this->id_;\n $attr[\"taxonId\"] = $this->taxonId_;\n $attr[\"dbh\"] = $this->dbh_;\n $attr[\"lat\"] = $this->lat_;\n $attr[\"lng\"] = $this->lng_;\n $attr[\"layers\"] = $this->layers_;\n \n return $attr;\n }", "public function getIdentifyingAttribute();", "public function extract(array $data)\n\t{\t\t\n\t\t$result = array();\n\t\tforeach ($this->_fields as $f)\n\t\t{\n\t\t\t$result[$f] = null;\n\t\t\tif (array_key_exists($f, $data))\n\t\t\t{\n\t\t\t\t$result[$f] = $data[$f];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "private static function _cookData($data) {\n\t\t$tmp = array();\n if(isset($data['advertiser_uid'])) $tmp['advertiser_uid'] = $data['advertiser_uid'];\n if(isset($data['related_advertiser_uid'])) $tmp['related_advertiser_uid'] = $data['related_advertiser_uid'];\n if(isset($data['operator'])) $tmp['operator'] = $data['operator'];\n if(isset($data['create_time'])) $tmp['create_time'] = $data['create_time'];\n if(isset($data['update_time'])) $tmp['update_time'] = $data['update_time'];\n\t\treturn $tmp;\n\t}", "public function data ($data = null) {\r\n\t\t\r\n\t\tif (!isset($data)) return $this[0]->attributes;\r\n\t\t\r\n\t\tforeach ($this as $node) {\r\n\t\t\t\t\r\n\t\t\tforeach ($data as $name => $value) {\r\n\t\t\t\t\r\n\t\t\t\t$attrNode = $node->ownerDocument->createAttribute($name);\r\n\t\t\t\t$attrNode->value = $value;\r\n\t\t\t\t$node->appendChild($attrNode);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getAttributeId();", "public function unpackAdditionalAttributes(&$data, $mergeInstructions)\n {\n MonsterVariable::processEntityVariables($this);\n if (isset($data['comment'])) {\n $this->processComments($data['comment']);\n }\n }", "private function buildIds(){\n\n\t\t$string = 'data-id=\"'.$this->fullId.'\" ';\n\t\t$string .= 'data-column_id=\"'.$this->id.'\" ';\n\t\t$string .= 'data-section_id=\"'.$this->section_id.'\" ';\n\t\t$string .= 'data-post_id=\"'.$this->post_id.'\" ';\n\n\t\treturn $string;\n\t}", "public function getDataName()\n {\n return 'data' . ucfirst($this->getName());\n }", "function extractActionData($data) {\n $fields = array(\n 'surfer_handle',\n 'surfer_givenname',\n 'surfer_surname',\n 'surfer_email',\n 'surfer_valid',\n 'surfergroup_id',\n 'surfer_gender',\n 'surfer_avatar'\n );\n $result = array();\n foreach ($fields as $field) {\n if (isset($data[$field])) {\n $result[$field] = $data[$field];\n }\n }\n return $result;\n }", "function data_extract( array $files ) {\n\n // Recursively extract the data key from the files.\n return array_map(function($file) { \n\n // Extract the data key.\n return (isset($file['data']) ? $file['data'] : data_extract($file));\n\n }, $files);\n\n}", "protected function extractApiData() {\n\n foreach($this->apiData->items as $key => $value) { \n $key = $key + 1;\n $this->dataArray[$key]['id'] = $value->id;\n $this->dataArray[$key]['firstname'] = $value->firstname;\n $this->dataArray[$key]['lastname'] = $value->lastname;\n $this->dataArray[$key]['email'] = $value->email;\n $this->dataArray[$key]['dob'] = isset($value->dob) ? $value->dob : '';\n $this->dataArray[$key]['website_id'] = $value->website_id;\n $this->dataArray[$key]['store_id'] = $value->store_id;\n $this->dataArray[$key]['created_in'] = $value->created_in; \n $this->dataArray[$key]['group_id'] = $value->group_id; \n $this->dataArray[$key]['gender'] = $this->gender[$value->gender];\n $this->dataArray[$key]['address'] = $this->getAddress($value->addresses);\n }\n }", "function getFields($data) {\n $quote = \"'\";\n $separator = '';\n $fields = '';\n $values = '';\n\n $numerics = array('montant',\n 'id',\n 'annee',\n 'idvoix',\n 'idtype',\n 'idchoriste',\n 'idoeuvre',\n 'idevenement',\n 'idinscription');\n\n foreach($data as $field => $value) {\n if($fields != '') {\n $separator = ',';\n }\n $fields .= $separator;\n $fields .= $field;\n $values .= $separator;\n if(! in_array($field, $numerics))\n $values .= $quote;\n $values .= $data[$field];\n if(! in_array($field, $numerics))\n $values .= $quote;\n }\n\n return(array($fields, $values));\n }", "private function getInfoFromData($data)\n {\n return array(\n 'id' => $data->id,\n 'resource_uri' => $data->resource_uri,\n 'slug' => $data->slug,\n 'name' => $data->name,\n 'status' => $data->status,\n 'categories' => $data->categories,\n 'summary' => $data->summary,\n 'description' => $data->description,\n 'premium_type' => $data->premium_type,\n 'homepage' => $data->homepage,\n 'device_types' => $data->device_types,\n 'privacy_policy' => $data->privacy_policy,\n 'previews' => $data->previews,\n 'support_email' => $data->support_email,\n 'support_url' => $data->support_url);\n }", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['id'])) $tmp['id'] = intval($data['id']);\n\t\tif(isset($data['sort'])) $tmp['sort'] = intval($data['sort']);\n\t\tif(isset($data['game_id'])) $tmp['game_id'] = $data['game_id'];\n\t\tif(isset($data['name'])) $tmp['name'] = $data['name'];\n\t\tif(isset($data['content'])) $tmp['content'] = $data['content'];\n\t\tif(isset($data['activation_code'])) $tmp['activation_code'] = $data['activation_code'];\n\t\tif(isset($data['method'])) $tmp['method'] = $data['method'];\n\t\tif(isset($data['use_start_time'])) $tmp['use_start_time'] = $data['use_start_time'];\n\t\tif(isset($data['use_end_time'])) $tmp['use_end_time'] = $data['use_end_time'];\n\t\tif(isset($data['effect_start_time'])) $tmp['effect_start_time'] = $data['effect_start_time'];\n\t\tif(isset($data['effect_end_time'])) $tmp['effect_end_time'] = $data['effect_end_time'];\n\t\tif(isset($data['status'])) $tmp['status'] = intval($data['status']);\n\t\tif(isset($data['game_status'])) $tmp['game_status'] = $data['game_status'];\n\t\treturn $tmp;\n\t}", "function getDataById($data) \n {\n $sql = 'select extid as id, title, content, \n description, source from vacancy where `id` ';\n if (is_array($data)) {\n $sql .= ' in ('.implode(', ', $data).')';\n } else {\n $sql .= ' = '.$data;\n }\n\n $res = $this->db->query($sql);\n if (!$res) {\n throw new MysqlException(\"Error while getDataById\", 1);\n }\n\n $out = array();\n while ($obj = $res->fetch_object()) {\n $n = new VacancyExt;\n $n->id = $obj->id; \n $n->title = $obj->title;\n $n->content = $obj->content;\n $n->description = $obj->description; \n $n->source = $obj->source; \n $out[] = $n;\n } \n $res->close();\n\n return $out;\n\n\n\n }", "public function getMapDataAttributes()\n {\n $attributes = [\n 'data-zoom' => $this->Zoom,\n 'data-map-type' => $this->MapType,\n 'data-latitude' => $this->Latitude,\n 'data-longitude' => $this->Longitude,\n 'data-markers' => $this->MarkersJSON\n ];\n \n $this->extend('updateMapDataAttributes', $attributes);\n \n return $attributes;\n }", "public function objectIdentifierExposureTestData() {}", "public function getData($id)\r\n\t{\r\n\t\t$id = (int)$id;\r\n\t\t$sql = 'SELECT * FROM ' . TABLE_PREFIX . 'access_ticket_type att\r\n\t\t\t\tWHERE att.att_id = ?';\r\n\t\t$row = $this->db->query($sql, array($id))->fetch();\r\n\r\n\t\t$this->id = $row['att_id'];\r\n\t\t$this->groupcontroller = $row['att_groupcontroller'];\r\n\t\t$this->controller = $row['att_controller'];\r\n\t\t$this->action = $row['att_action'];\r\n\t\t$this->name = $row['att_name'];\r\n\t\t$this->description = $row['att_description'];\r\n\t\t$this->status = $row['att_status'];\r\n\t\t$this->ipaddress = long2ip($row['att_ipaddress']);\r\n\t\t$this->datecreated = $row['att_datecreated'];\r\n\t\t$this->datemodified = $row['att_datemodified'];\r\n\r\n\t}", "function getAttributes($id)\n {\n if (is_array($id)) {\n $query = sprintf('SELECT %1$s, attribute_name as name, attribute_key as \"key\", attribute_value as value FROM %2$s WHERE %1$s IN (%3$s)',\n $this->_params['id_column'],\n $this->_params['attribute_table'],\n implode(', ', $id));\n\n Horde::logMessage('SQL Query by Hylax_SQL_Attributes::getAttributes(): ' . $query, 'DEBUG');\n $rows = $this->_db->getAll($query, DB_FETCHMODE_ASSOC);\n if (is_a($rows, 'PEAR_Error')) {\n return $rows;\n }\n\n $id_column = $this->_params['id_column'];\n $data = array();\n foreach ($rows as $row) {\n if (empty($data[$row[$id_column]])) {\n $data[$row[$id_column]] = array();\n }\n $data[$row[$id_column]][] = array('name' => $row['name'],\n 'key' => $row['key'],\n 'value' => $row['value']);\n }\n return $data;\n } else {\n $query = sprintf('SELECT %1$s, attribute_name as name, attribute_key as \"key\", attribute_value as value FROM %2$s WHERE %1$s = %3$s',\n $this->_params['id_column'],\n $this->_params['attribute_table'],\n (int)$id);\n Horde::logMessage('SQL Query by Hylax_SQL_Attributes::getAttributes(): ' . $query, 'DEBUG');\n return $this->_db->getAll($query, DB_FETCHMODE_ASSOC);\n }\n }", "protected function getBParamDataAttributes() {}", "private static function _cookData($data) {\n\t $tmp = array();\n\t if(isset($data['request_id'])) $tmp['request_id'] = $data['request_id'];\n\t if(isset($data['unit_id'])) $tmp['unit_id'] = $data['unit_id'];\n\t if(isset($data['ad_id'])) $tmp['ad_id'] = $data['ad_id'];\n\t if(isset($data['originality_id'])) $tmp['originality_id'] = $data['originality_id'];\n\t if(isset($data['device_id'])) $tmp['device_id'] = $data['device_id'];\n\t if(isset($data['create_time'])) $tmp['create_time'] = $data['create_time'];\n\t if(isset($data['create_date'])) $tmp['create_date'] = $data['create_date'];\n\t return $tmp;\n\t}", "protected function getIDsFromJSON(array $data) {\n return $data;\n }", "public function createDataExpert($raw_data = array(), $id) {\n $expert = new Expert($raw_data);\n foreach ($this->reference as $name => $p) {\n $f_name = \"extract_\".$this->pimhelper->normalize_field($name);\n $value = $this->$f_name($expert->raw_data);\n $expert->setField($name, $value);\n }\n // Set product entity\n $this->experts[$id] = $expert;\n }", "public static function mapData($data, $additionalAttribute = null) {\n $result = [\n 'id' => $data->id,\n 'quiz_id' => $data->quiz_id,\n 'student_id' => $data->student_id,\n 'student_name' => $data->student->name,\n 'student_school' => $data->student->school,\n 'started_at' => date(\"Y-m-d H:i:s\", strtotime($data->started_at)),\n 'finished_at' => date(\"Y-m-d H:i:s\", strtotime($data->finished_at)),\n 'correct_number' => $data->correct_number,\n 'incorrect_number' => $data->incorrect_number,\n 'not_answered_number' => $data->not_answered_number,\n 'score' => $data->score,\n ];\n if($additionalAttribute) {\n $result = array_merge($result, $additionalAttribute);\n }\n return $result;\n }", "public function getDatasetIdArray()\n {\n $dataset = array();\n $classIdentifier = $this->openDataIni->variable( 'GeneralSettings', 'DatasetClassIdentifier' );\n $class = eZContentClass::fetchByIdentifier( $classIdentifier );\n if ( $class instanceof eZContentClass )\n {\n $params = array(\n 'ClassFilterType' => 'include',\n 'ClassFilterArray' => array( $classIdentifier ),\n 'Depth' => 1,\n 'DepthOperator' => 'ge'\n );\n $nodes = eZContentObjectTreeNode::subTreeByNodeID( $params, eZINI::instance( 'content.ini' )->variable( 'NodeSettings', 'RootNode' ) );\n foreach( $nodes as $node )\n {\n $dataset[] = self::generateUniqueId( $node->attribute( 'contentobject_id' ) );\n }\n }\n return $dataset;\n }", "public function _getDataAttributes($attrsRequested=null) {\n $result = array();\n foreach($this->attrs as $attr => $val) {\n if (is_null($attrsRequested) || in_array($attr, $attrsRequested)) {\r\n $result[] = \"data-{$attr}=\\\"{$val}\\\"\";\n }\r\n }\n return $result;\n }", "protected function normalizeDataStruct($data){\n $this->modelName = $data['name'];\n $this->validators = isset($data['validators'])?$data['validators']:array();\n return $data['fields'];\n }", "public function loadDataFromId(){\r\n\t\t\t$this -> loadFromId();\r\n\t }", "function getData($data = null){\r\n\t\treturn $this->fields->getData($data);\r\n\t}", "function get_attribute_by_id($zf_attribute_id, $key_format = 'database') {\n\t\tglobal $db;\n\t\t$query = 'SELECT attr.*, opt.products_options_name, val.products_options_values_name, opt.products_options_type ' .\n\t\t\t\t'FROM ' . TABLE_PRODUCTS_ATTRIBUTES . ' AS attr ' .\n\t\t\t\t'LEFT JOIN ' . TABLE_PRODUCTS_OPTIONS .\n\t\t\t\t' AS opt ON attr.options_id = opt.products_options_id ' .\n\t\t\t\t'LEFT JOIN ' . TABLE_PRODUCTS_OPTIONS_VALUES .\n\t\t\t\t' AS val ON attr.options_values_id = val.products_options_values_id ' .\n\t\t\t\t'WHERE attr.products_attributes_id = \\'' . (int)$zf_attribute_id . '\\' ' .\n\t\t\t\t'AND val.language_id = \\'' . (int)$_SESSION['languages_id'] . '\\' ' .\n\t\t\t\t'AND val.language_id = opt.language_id ';\n\n\t\tif($this->cache_time == 0) $queryResult = $db->Execute($query);\n\t\telse $queryResult = $db->Execute($query, false, true, $this->cache_time);\n\n\t\t$retval = array();\n\t\tif(!$queryResult->EOF) {\n\t\t\tswitch($key_format) {\n\t\t\t\tcase 'order':\n\t\t\t\t\t$retval = array(\n\t\t\t\t\t\t'option_id' => $queryResult->fields['options_id'],\n\t\t\t\t\t\t'value_id' => $queryResult->fields['options_values_id'],\n\t\t\t\t\t\t'value' => $queryResult->fields['products_options_values_name'],\n\t\t\t\t\t);\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'database':\n\t\t\t\tdefault:\n\t\t\t\t\tforeach($queryResult->fields as $key => $value) {\n\t\t\t\t\t\t$retval[$key] = zen_db_prepare_input($value);\n\t\t\t\t\t}\n\t\t\t\t\tunset($key); unset($value);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$queryResult->MoveNext();\n\t\t}\n\n\t\treturn $retval;\n\t}", "public function getData($id, $path, &$data) {\n $osda = $this->_interface->OsdAssociator($id);\n\n $cs = $osda->GetAssociatedOsds($path);\n if (!$cs->success_) {\n return $cs->error_;\n }\n\n if ($cs->result_->overlays !== null) {\n foreach ($cs->result_->overlays as $overlay) {\n $data['overlays'][$overlay->id] = $overlay->content;\n }\n } else {\n $data['overlays'] = array();\n }\n if ($cs->result_->crawlers !== null) {\n foreach ($cs->result_->crawlers as $crawler) {\n $data['crawlers'][$crawler->crawler_id][$crawler->item_id] = $crawler->item->content;\n }\n } else {\n $data['crawlers'] = array();\n }\n if ($cs->result_->pip !== null) {\n $data['pip'] = self::toArray($cs->result_->pip);\n } else {\n $data['pip'] = null;\n }\n if ($cs->result_->click_url !== null) {\n $data['click_url'] = $cs->result_->click_url->url;\n }\n return null;\n }", "private function prepareAttributes($tweetData)\n {\n return [\n 'tweet_id' => $tweetData['tweet']->id,\n 'total_retweets' => $tweetData['tweet']->retweet_count,\n 'counted_retweets' => $tweetData['retweets_count'],\n 'reach' => $tweetData['reach']\n ];\n }", "function getDataField() {return $this->_datafield;}", "public function getDataDefinition();", "public function get_data_id($id=0) {\t\treturn $this->db->query('', array($id))->row_array();\n\t\n\t}", "protected function extractFromData($data)\n {\n $data = [];\n foreach ($this->readers as $reader) { /* @var $reader AbstractMetadataReader */\n $data = array_merge($data, $reader->extractFromData($data));\n }\n return $data;\n }", "public function hydrate($data)\n\t{\n\t\tif (is_array($data))\n\t\t{\n\t\t\t//get our id back\n\t\t\t$this->id = $data['id'];\n\n\t\t\t//obviously we want to load our data.\n\t\t\t$this->data = $data['data'];\n\t\t}\n\t}", "public function decode(array $data): array\n {\n $fields = ['id'];\n foreach($fields as $key) {\n if(isset($data[$key])) {\n $data[$key] = $this->hashids->decode($data[$key])[0];\n }\n }\n return $data;\n }", "public function getAttributesFromHeaderRow($data = null)\n {\n $this->checkHeaderRowExists($data);\n $attributes = [];\n foreach ($data[0] as $attributeCode) {\n $attributes[] = $attributeCode;\n }\n return $attributes;\n }", "public static function mapDetailData($data, $additionalAttribute = null) {\n $result = [\n 'id' => $data->id,\n 'quiz_id' => $data->quiz_id,\n 'quiz' => Quiz::mapDetailData($data->quiz),\n 'student_id' => $data->student_id,\n 'student_name' => $data->student->name,\n 'student_school' => $data->student->school,\n 'started_at' => date(\"Y-m-d H:i:s\", strtotime($data->started_at)),\n 'finished_at' => date(\"Y-m-d H:i:s\", strtotime($data->finished_at)),\n 'correct_number' => $data->correct_number,\n 'incorrect_number' => $data->incorrect_number,\n 'not_answered_number' => $data->not_answered_number,\n 'score' => $data->score,\n 'corrections' => $data->corrections->map(function($item) {\n return AttemptCorrection::mapData($item);\n }),\n ];\n if($additionalAttribute) {\n $result = array_merge($result, $additionalAttribute);\n }\n return $result;\n }", "function parse_id($id) {\n\n }", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['id'])) $tmp['id'] = intval($data['id']);\n\t\tif(isset($data['sort'])) $tmp['sort'] = intval($data['sort']);\n\t\tif(isset($data['category_id'])) $tmp['category_id'] = intval($data['category_id']);\n\t\tif(isset($data['type'])) $tmp['type'] = intval($data['type']);\n\t\tif(isset($data['gift_num_type'])) $tmp['gift_num_type'] = $data['gift_num_type'];\n\t\tif(isset($data['total_num'])) $tmp['total_num'] = intval($data['total_num']);\n\t\tif(isset($data['preson_limit_num'])) $tmp['preson_limit_num'] = $data['preson_limit_num'];\n\t\tif(isset($data['remaind_num'])) $tmp['remaind_num'] = $data['remaind_num'];\n\t\tif(isset($data['consume_point'])) $tmp['consume_point'] = $data['consume_point'];\n\t\tif(isset($data['discountArr'])) $tmp['discountArr'] = $data['discountArr'];\n\t\tif(isset($data['game_object'])) $tmp['game_object'] = $data['game_object'];\n\t\tif(isset($data['game_ids'])) $tmp['game_ids'] = $data['game_ids'];\n\t\tif(isset($data['title'])) $tmp['title'] = $data['title'];\n\t\tif(isset($data['exchange_rule'])) $tmp['exchange_rule'] = $data['exchange_rule'];\n\t\tif(isset($data['descrip'])) $tmp['descrip'] = $data['descrip'];\n\t\tif(isset($data['img'])) $tmp['img'] = $data['img'];\n\t\tif(isset($data['icon'])) $tmp['icon'] = $data['icon'];\n\t\tif(isset($data['status'])) $tmp['status'] = $data['status'];\n\t\tif(isset($data['start_time'])) $tmp['start_time'] = $data['start_time'];\n\t\tif(isset($data['end_time'])) $tmp['end_time'] = $data['end_time'];\n\t\tif(isset($data['create_time'])) $tmp['create_time'] = intval($data['create_time']);\n\t\tif(isset($data['effect_time'])) $tmp['effect_time'] = intval($data['effect_time']);\n\t\treturn $tmp;\n\t}", "private function getData()\n {\n $data = [];\n\n $fileAttributes = $_FILES[$this->scope];\n foreach ($fileAttributes as $attributeName => $attributeValue) {\n $data[$attributeName] = $attributeValue[$this->getAttributeCode()];\n }\n\n return $data;\n }", "public function getValidIdAttributes(): array\n {\n return [\n 'Starts with _' => [\n 'attribute_id_0001.xsd', '_foo', \n ], \n 'Starts with letter' => [\n 'attribute_id_0002.xsd', 'f', \n ], \n 'Contains letter' => [\n 'attribute_id_0003.xsd', 'foo', \n ], \n 'Contains digit' => [\n 'attribute_id_0004.xsd', 'f00', \n ], \n 'Contains .' => [\n 'attribute_id_0005.xsd', 'f.bar', \n ], \n 'Contains -' => [\n 'attribute_id_0006.xsd', 'f-bar', \n ], \n 'Contains _' => [\n 'attribute_id_0007.xsd', 'f_bar', \n ], \n 'Surrounded by whitespaces' => [\n 'attribute_id_0008.xsd', 'foo_bar', \n ], \n ];\n }", "private function get_parsed_shortcode_data( $data ) {\n\t\tif ( strpos( $data, '::' ) ) {\n\t\t\t$shortcode_data = explode( '::', $data );\n\n\t\t\t$post_id = $shortcode_data[0];\n\t\t\t$shortcode_id = $shortcode_data[1];\n\t\t} else {\n\t\t\t/* in certain cases where we don't have an ID ( TTB ), get the current post ID */\n\t\t\t$post_id = get_the_ID();\n\t\t\t$shortcode_id = $data;\n\t\t}\n\n\t\treturn array(\n\t\t\t'post_id' => $post_id,\n\t\t\t'id' => $shortcode_id,\n\t\t);\n\t}", "function hook_uuid_uri_data($data) {\n}", "function hook_uuid_uri_data($data) {\n}", "abstract function getDataPattern();", "public static function toDataUS($data){\n\t\t$tmp = explode('/', $data);\n\t\treturn $tmp[2].'-'.$tmp[1].'-'.$tmp[0];\n\t}", "public function __construct($data)\n {\n foreach ($this->attributes as $attribute) {\n $this->data[$attribute] = (array_key_exists($attribute, $data)) ? $data[$attribute] : NULL;\n }\n }", "public function get_data()\n\t\t{\t\t// Should there be a common method for this?\n\t\t}", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();", "public function getData();" ]
[ "0.6250758", "0.6204206", "0.61354", "0.6122654", "0.59232295", "0.58402663", "0.5808955", "0.5781237", "0.5722934", "0.5690137", "0.5634834", "0.5605249", "0.55757767", "0.556094", "0.55237347", "0.55204344", "0.5520217", "0.5503675", "0.5502842", "0.5499392", "0.5451588", "0.5449366", "0.54411453", "0.54131716", "0.53911865", "0.5367424", "0.5362869", "0.5334559", "0.5332732", "0.53293943", "0.53246677", "0.5315512", "0.53144604", "0.5285018", "0.5282948", "0.5267104", "0.5265128", "0.5263049", "0.52618754", "0.52605426", "0.5256914", "0.5243451", "0.5242827", "0.522914", "0.52280366", "0.52144074", "0.5192951", "0.51894015", "0.5163236", "0.5160138", "0.5155059", "0.51536673", "0.5148059", "0.5147666", "0.5132481", "0.51256984", "0.5123616", "0.5120041", "0.5117172", "0.51021487", "0.5091771", "0.5086872", "0.5079386", "0.5066266", "0.5064863", "0.505964", "0.5054764", "0.5054041", "0.50467473", "0.50465095", "0.5044582", "0.5042292", "0.5040559", "0.50395334", "0.5037112", "0.5024983", "0.50184596", "0.50184596", "0.50167215", "0.5011344", "0.5011031", "0.50073826", "0.50037956", "0.50037956", "0.50037956", "0.50037956", "0.50037956", "0.50037956", "0.50037956", "0.50037956", "0.50037956", "0.50037956", "0.50037956", "0.50037956", "0.50037956", "0.50037956", "0.50037956", "0.50037956", "0.50037956", "0.50037956" ]
0.58395857
6
Includes standard HTML tags and data tags.
public static function tagAttributes(string $tag, array $attributes): array { $tag = self::cleanTagName($tag); if (!isset(self::$tag_attributes_cache[$tag])) { $allowed = self::$tag_attributes[$tag] ?? []; while (is_string($allowed)) { $allowed = self::$tag_attributes[$allowed] ?? []; } self::$tag_attributes_cache[$tag] = $allowed = array_merge($allowed, self::$global_attributes); } else { $allowed = self::$tag_attributes_cache[$tag]; } return ArrayTools::filter($attributes, $allowed) + self::dataAttributes($attributes); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function html($data) {\n $data = htmlspecialchars($data, ENT_QUOTES); // <>\n return $data;\n }", "public function tags()\n {\n return array('html');\n }", "function wrapHtml($data = '', $tag, $attrs = null, $single_tag = false)\n{\n\t$ret = '<'.$tag;\n\tif (is_array($attrs) && !empty($attrs))\n\t{\n\t\t$ret .= ' ';\n\t\tforeach($attrs as $attr => $val)\n\t\t$ret .= $attr .'=\"'.$val .'\" ';\n\t}\n\t\n\tif ($single_tag)\n\t\t$ret .= ' />';\n\telse\n\t\t$ret .= '>'. $data. '</'.$tag.'>';\n\treturn $ret;\n}", "public function getHTML($data);", "public function escapeHtml($data, $allowedTags = null){\n return $data;\n }", "function testHTMLInj($data){\n $original = $data;\n \n /*convert 5 predefined characters into HTML values.\t\t\n They are > (&gt;), < (%lt;), \" (&quot;), ' (&#039;), & (&amp;) */\t\t\t\n $data = htmlspecialchars($data);\n\n //check for possible html injection\n return !($data === $original);\n }", "function allowed_html() {\n $arr = array();\n return array(\n 'a' => array(\n 'href' => $arr,\n 'title' => $arr\n ),\n 'span' => array(\n 'style' => $arr\n ),\n 'u' => $arr,\n 'b' => $arr,\n 'i' => $arr,\n 'em' => $arr,\n 'strong' => $arr,\n );\n }", "public static function html($data = NULL)\n\t{\n\t\tif ($data === NULL)\n\t\t{\n\t\t\t$data = Request::current()->response()->body();\n\t\t}\n\n\t\t$data = (string) $data;\n\n\t\tRequest::current()->response()->body($data);\n\n\t\tKu_AJAX::headers('html');\n\t}", "function wp_filter_nohtml_kses($data)\n {\n }", "private function return_all(){\n\t\t$attributes=\"\";\n\t\tforeach($this->attr as $attr=>$val){\n\t\t\t$attributes.= (string)$attr.\"='\".preg_replace(\"/'/si\",\"\\'\",$val).\"' \";\n\t\t}\n\t\tif(!$this->self_closing){\n\t\t\t$content=\"\";\n\t\t\tforeach($this->content as $data){\n\t\t\t\t$content.=(string)$data;\n\t\t\t}\n\t\t\treturn \"<\".$this->type.\" \".$attributes.\">\".$content.\"</\".$this->type.\">\";\n\t\t}\n\t\telse{\n\t\t\treturn \"<\".$this->type.\" \".$attributes.\"/>\";\n\t\t}\n\t}", "protected function _beforeToHtml()\n {\n $this->_prepareData();\n return parent::_beforeToHtml();\n }", "protected function _beforeToHtml()\n {\n $this->_prepareData();\n return parent::_beforeToHtml();\n }", "function output_html($data, $query='') {\n // should be overridden\n return;\n }", "protected function _beforeToHtml()\n {\n return parent::_beforeToHtml();\n }", "public function html() {}", "function initialize () {\n $this->set_openingtag(\"<!DOCTYPE html><HTML[attributes]>\");\n \t$this->set_closingtag(\"</HTML>\");\n }", "protected function allow_html() {\n\t\tremove_filter( 'pre_term_description', 'wp_filter_kses' );\n\t\tremove_filter( 'term_description', 'wp_kses_data' );\n\n\t\tadd_filter( 'pre_term_description', 'wp_filter_post_kses' );\n\t}", "function addCommonHtml() \n\t{\n\t\treturn true;\n\t}", "public function testHtmlTag()\n {\n $this->assertProduces('<b>not bold</b>', '&lt;b&gt;not bold&lt;/b&gt;');\n $this->assertProduces('[b]<b>bold</b>[/b] <hr>', '<strong>&lt;b&gt;bold&lt;/b&gt;</strong> &lt;hr&gt;');\n }", "public static function getEscapedContentTags(){\n return \\Illuminate\\View\\Compilers\\BladeCompiler::getEscapedContentTags();\n }", "public abstract function asHTML();", "function initialize () {\n $this->set_openingtag(\"<PRE[attributes]>\");\n\t $this->set_closingtag(\"</PRE>\");\n }", "private function hasHTMLTags()\n {\n return !(strcmp($this->content, strip_tags($this->content)) == 0);\n }", "public function getHtml() {\n\t\t$html = '<' . $this->type;\n\t\t\n\t\tforeach($this->attributes as $name => $data) {\n\t\t\t$html .= $this->getHtmlAttribute($name, $data);\n\t\t}\n\t\t\n\t\tif( in_array($this->type, array('input', 'img', 'hr', 'br', 'meta', 'link')) ) {\n\t\t\t$html .= '/>';\n\t\t} else {\n\t\t\t$html .= '>';\n\t\t\t$html .= $this->getInnerHtml();\n\t\t\t$html .= '</' . $this->type . '>';\n\t\t}\n\t\t\n\t\treturn $html;\n\t}", "function wp_pre_kses_block_attributes($content, $allowed_html, $allowed_protocols)\n {\n }", "public function getHTML() {\n\t $markup = '';\n\n\t // open tags as required \n\t if($this->isBolded) {\n\t // add strong tag\n\t $markup .= '<strong>'; \n\t }\n\t\tif($this->isItalics) {\n\t // add emphisis tag\n\t $markup .= '<em>'; \n\t } \n\t\tif($this->isStrikethrough) {\n\t // add ?? tag\n\t } \n\t\tif($this->isUnderlined) {\n\t // add span tag with text decoration for underline\n\t $markup .= '<span style=\"text-decoration: underline;\">';\n\t }\n\n // add span tag to define color\n $markup .= '<span style=\"color: #' . $this->colour . ';\">';\n \n // TODO: add logic so the style is reused for each\n \n\t\t// add the text \n $markup .= $this->text;\n\n // add close tag for colour applicatoin\n $markup .= '</span>';\n\n // close tags as required\n\t if($this->isBolded) {\n\t // add close strong tag\n\t $markup .= '</strong>'; \n\t }\n\t\tif($this->isItalics) {\n\t // add close emphisis tag\n\t $markup .= '</em>'; \n\t } \n\t\tif($this->isStrikethrough) {\n\t // add close ?? tag \n\t } \n\t\tif($this->isUnderlined) {\n\t // add close span tag\n\t $markup .= '</span>';\n\t }\n\n\t\treturn $markup;\n\t}", "public function html();", "protected function safeToHtml($data) \n {\n if (get_magic_quotes_gpc()) {\n $data = stripslashes($data);\n }\n\n return htmlspecialchars($data);\n }", "private function getHtmlTags()\n {\n // Possible allowed HTML tags\n return [\n '!--' => 'https://www.w3schools.com/tags/tag_comment.asp',\n 'a' => 'https://www.w3schools.com/tags/tag_a.asp',\n 'abbr' => 'https://www.w3schools.com/tags/tag_abbr.asp',\n 'acronym' => 'https://www.w3schools.com/tags/tag_acronym.asp',\n 'address' => 'https://www.w3schools.com/tags/tag_address.asp',\n 'applet' => 'https://www.w3schools.com/tags/tag_applet.asp',\n 'area' => 'https://www.w3schools.com/tags/tag_area.asp',\n 'article' => 'https://www.w3schools.com/tags/tag_article.asp',\n 'aside' => 'https://www.w3schools.com/tags/tag_aside.asp',\n 'audio' => 'https://www.w3schools.com/tags/tag_audio.asp',\n 'b' => 'https://www.w3schools.com/tags/tag_b.asp',\n 'base' => 'https://www.w3schools.com/tags/tag_base.asp',\n 'basefont' => 'https://www.w3schools.com/tags/tag_basefont.asp',\n 'bdo' => 'https://www.w3schools.com/tags/tag_bdo.asp',\n 'big' => 'https://www.w3schools.com/tags/tag_font_style.asp',\n 'blockquote' => 'https://www.w3schools.com/tags/tag_blockquote.asp',\n 'br' => 'https://www.w3schools.com/tags/tag_br.asp',\n 'button' => 'https://www.w3schools.com/tags/tag_button.asp',\n 'canvas' => 'https://www.w3schools.com/tags/tag_canvas.asp',\n 'caption' => 'https://www.w3schools.com/tags/tag_caption.asp',\n 'center' => 'https://www.w3schools.com/tags/tag_center.asp',\n 'cite' => 'https://www.w3schools.com/tags/tag_cite.asp',\n 'code' => 'https://www.w3schools.com/tags/tag_code.asp',\n 'col' => 'https://www.w3schools.com/tags/tag_col.asp',\n 'colgroup' => 'https://www.w3schools.com/tags/tag_colgroup.asp',\n 'command' => 'https://www.w3schools.com/tags/tag_command.asp',\n 'datalist' => 'https://www.w3schools.com/tags/tag_datalist.asp',\n 'dd' => 'https://www.w3schools.com/tags/tag_dd.asp',\n 'del' => 'https://www.w3schools.com/tags/tag_del.asp',\n 'details' => 'https://www.w3schools.com/tags/tag_details.asp',\n 'dfn' => 'https://www.w3schools.com/tags/tag_dfn.asp',\n 'dir' => 'https://www.w3schools.com/tags/tag_dir.asp',\n 'div' => 'https://www.w3schools.com/tags/tag_div.asp',\n 'dl' => 'https://www.w3schools.com/tags/tag_dl.asp',\n 'dt' => 'https://www.w3schools.com/tags/tag_dt.asp',\n 'em' => 'https://www.w3schools.com/tags/tag_em.asp',\n 'embed' => 'https://www.w3schools.com/tags/tag_embed.asp',\n 'fieldset' => 'https://www.w3schools.com/tags/tag_fieldset.asp',\n 'figcaption' => 'https://www.w3schools.com/tags/tag_figcaption.asp',\n 'figure' => 'https://www.w3schools.com/tags/tag_figure.asp',\n 'font' => 'https://www.w3schools.com/tags/tag_font.asp',\n 'footer' => 'https://www.w3schools.com/tags/tag_footer.asp',\n 'form' => 'https://www.w3schools.com/tags/tag_form.asp',\n 'h1' => 'https://www.w3schools.com/tags/tag_hn.asp',\n 'h2' => 'https://www.w3schools.com/tags/tag_hn.asp',\n 'h3' => 'https://www.w3schools.com/tags/tag_hn.asp',\n 'h4' => 'https://www.w3schools.com/tags/tag_hn.asp',\n 'h5' => 'https://www.w3schools.com/tags/tag_hn.asp',\n 'h6' => 'https://www.w3schools.com/tags/tag_hn.asp',\n 'header' => 'https://www.w3schools.com/tags/tag_header.asp',\n 'hgroup' => 'https://www.w3schools.com/tags/tag_hgroup.asp',\n 'hr' => 'https://www.w3schools.com/tags/tag_hr.asp',\n 'i' => 'https://www.w3schools.com/tags/tag_i.asp',\n 'iframe' => 'https://www.w3schools.com/tags/tag_iframe.asp',\n 'img' => 'https://www.w3schools.com/tags/tag_img.asp',\n 'input' => 'https://www.w3schools.com/tags/tag_input.asp',\n 'ins' => 'https://www.w3schools.com/tags/tag_ins.asp',\n 'keygen' => 'https://www.w3schools.com/tags/tag_keygen.asp',\n 'kbd' => 'https://www.w3schools.com/tags/tag_kbd.asp',\n 'label' => 'https://www.w3schools.com/tags/tag_label.asp',\n 'legend' => 'https://www.w3schools.com/tags/tag_legend.asp',\n 'li' => 'https://www.w3schools.com/tags/tag_li.asp',\n 'map' => 'https://www.w3schools.com/tags/tag_map.asp',\n 'mark' => 'https://www.w3schools.com/tags/tag_mark.asp',\n 'menu' => 'https://www.w3schools.com/tags/tag_menu.asp',\n 'marquee' => '',\n 'meter' => 'https://www.w3schools.com/tags/tag_meter.asp',\n 'nav' => 'https://www.w3schools.com/tags/tag_nav.asp',\n 'nobr' => '',\n 'object' => 'https://www.w3schools.com/tags/tag_object.asp',\n 'ol' => 'https://www.w3schools.com/tags/tag_ol.asp',\n 'optgroup' => 'https://www.w3schools.com/tags/tag_optgroup.asp',\n 'option' => 'https://www.w3schools.com/tags/tag_option.asp',\n 'output' => 'https://www.w3schools.com/tags/tag_output.asp',\n 'p' => 'https://www.w3schools.com/tags/tag_p.asp',\n 'param' => 'https://www.w3schools.com/tags/tag_param.asp',\n 'pre' => 'https://www.w3schools.com/tags/tag_pre.asp',\n 'progress' => 'https://www.w3schools.com/tags/tag_progress.asp',\n 'q' => 'https://www.w3schools.com/tags/tag_q.asp',\n 'rp' => 'https://www.w3schools.com/tags/tag_rp.asp',\n 'rt' => 'https://www.w3schools.com/tags/tag_rt.asp',\n 'ruby' => 'https://www.w3schools.com/tags/tag_ruby.asp',\n 's' => 'https://www.w3schools.com/tags/tag_s.asp',\n 'samp' => 'https://www.w3schools.com/tags/tag_samp.asp',\n 'script' => 'https://www.w3schools.com/tags/tag_script.asp',\n 'section' => 'https://www.w3schools.com/tags/tag_section.asp',\n 'select' => 'https://www.w3schools.com/tags/tag_select.asp',\n 'small' => 'https://www.w3schools.com/tags/tag_small.asp',\n 'source' => 'https://www.w3schools.com/tags/tag_source.asp',\n 'span' => 'https://www.w3schools.com/tags/tag_span.asp',\n 'strike' => 'https://www.w3schools.com/tags/tag_strike.asp',\n 'strong' => 'https://www.w3schools.com/tags/tag_strong.asp',\n 'sub' => 'https://www.w3schools.com/tags/tag_sup.asp',\n 'summary' => 'https://www.w3schools.com/tags/tag_summary.asp',\n 'sup' => 'https://www.w3schools.com/tags/tag_sup.asp',\n 'table' => 'https://www.w3schools.com/tags/tag_table.asp',\n 'tbody' => 'https://www.w3schools.com/tags/tag_tbody.asp',\n 'td' => 'https://www.w3schools.com/tags/tag_td.asp',\n 'textarea' => 'https://www.w3schools.com/tags/tag_textarea.asp',\n 'tfoot' => 'https://www.w3schools.com/tags/tag_tfoot.asp',\n 'th' => 'https://www.w3schools.com/tags/tag_th.asp',\n 'thead' => 'https://www.w3schools.com/tags/tag_thead.asp',\n 'time' => 'https://www.w3schools.com/tags/tag_time.asp',\n 'tr' => 'https://www.w3schools.com/tags/tag_tr.asp',\n 'tt' => 'https://www.w3schools.com/tags/tag_font_style.asp',\n 'u' => 'https://www.w3schools.com/tags/tag_u.asp',\n 'ul' => 'https://www.w3schools.com/tags/tag_ul.asp',\n 'var' => 'https://www.w3schools.com/tags/tag_var.asp',\n 'video' => 'https://www.w3schools.com/tags/tag_video.asp',\n 'wbr' => 'https://www.w3schools.com/tags/tag_wbr.asp'\n ];\n }", "public function asHTML() {\n return \"$this->before<$this->tag_name$this->attributes>$this->content</$this->tag_name>$this->after\";\n }", "private function _print_html_head_metatags()\n\t{\n\t\treturn \"<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset={$this->charset}\\\" />\\n\";\n\t}", "function noTag($temp){\n\t$data\t= strip_tags($temp, \"<img \");\n\t$data\t= strip_tags($temp, \"<table \");\n\t$data\t= strip_tags($temp, \"<font \");\n\t$data\t= strip_tags($temp, \"<span \");\t\n\t$data\t= strip_tags($temp, \"<p \");\t\t\n\treturn $data;\n}", "function compile_html () {\n\t //here go the subtags & attributes\n $html = \"\"; \n\t $attributes = \"\";\n\t foreach ($this->attributes as $aid => $avalue) {\n\t foreach ($avalue as $vkey => $value) {\n\t $attributes .= \" {$vkey}=\\\"{$value}\\\"\";\n\t\t}\n\t }\n\t \n\t if ( strpos($this->openingtag, \"[content]\") !== false ) {\n\t $openingtag = str_replace (\"[attributes]\", $attributes, $this->openingtag);\n\t $openingtag = str_replace (\"[content]\", $this->content, $openingtag );\n\t $html .= $openingtag;\n\t } \n\t else {\n\t $html .= str_replace (\"[attributes]\", $attributes, $this->openingtag);\n\t $html .= $this->content;\n\t }\n\t \n\t foreach ($this->childrenElements as $childid => $element) {\n\t $html .= $element->compile_html();\n\t }\n\t \n\t \n\t if ($this->closingtag != \"\") { \n\t $html .= str_replace (\"[attributes]\", $attributes, $this->closingtag);\n\t }\n\t \n\t return $html;\n }", "function writeHtmlCommonTagStart($tag, $attributes = [], $isCloseTag = true) {\n $html = \"<$tag \";\n foreach ($attributes as $key => $value) {\n if (is_numeric($key)) {\n $html .= $value;\n } else {\n $html .= \"$key=\\\"{$value}\\\"\";\n }\n }\n\n if ($isCloseTag) {\n $html .= \">\";\n } else {\n $html .= \"/>\";\n }\n\n echo $html;\n}", "protected function defaultTags()\n\t{\n\t\t//TODO: Terminar a referencia html\n\t\treturn array(\n\t\t\t'div' => array(\n\t\t\t\t'tagName' => 'div',\n\t\t\t\t'hasClosingTag' => true,\n\t\t\t),\n\t\t\t'p' => array(\n\t\t\t\t'tagName' => 'p',\n\t\t\t\t'hasClosingTag' => true,\n\t\t\t),\n\t\t\t'span' => array(\n\t\t\t\t'tagName' => 'span',\n\t\t\t\t'hasClosingTag' => true,\n\t\t\t),\n\t\t\t'input' => array(\n\t\t\t\t'tagName' => 'input',\n\t\t\t\t'hasClosingTag' => false,\n\t\t\t),\n\t\t);\n\t}", "public function filter_wp_kses_allowed_data_attributes($allowed_html)\n {\n }", "function start_html($extra = '')\n{\n /** Starting the HTML document */\n start_tag('html', '', true, $extra) ;\n}", "function tf_html_tag($tag, $attr = null, $end = null)\r\n {\r\n $inner = array($tag);\r\n if (isset($attr)) {\r\n foreach ($attr as $k => $v) {\r\n if (is_numeric($k)) {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($v), esc_attr($v));\r\n }\r\n else if ($v === true) {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($k), esc_attr($k));\r\n }\r\n else if ($v === false) {\r\n # ignore\r\n }\r\n else {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($k), esc_attr($v));\r\n }\r\n }\r\n }\r\n\r\n if ($end === true) {\r\n # close ELEMENT as HTML\r\n # <script></script>\r\n $body = '';\r\n $close = '</'.$tag.'>';\r\n }\r\n else if ($end === false) {\r\n # close ELEMENT as XML\r\n $inner[] = '/';\r\n $body = '';\r\n $close = '';\r\n }\r\n else {\r\n # if there is content close element, otherwise leave it open\r\n if (empty($end)) {\r\n $body = '';\r\n $close = '';\r\n }\r\n else {\r\n $body = strval($end);\r\n $close = '</'.$tag.'>';\r\n }\r\n }\r\n\r\n $open = '<'.implode(' ', $inner).'>';\r\n return $open.$body.$close;\r\n }", "function mc_admin_strip_tags() {\n\n\treturn '<strong><em><i><b><span><a><code><pre>';\n}", "public abstract function get_html();", "function wpse_allowedtags() {\n return '<script>,<style>,<br>,<em>,<i>,<ul>,<ol>,<li>,<a>,<p>,<img>,<video>,<audio>';\n}", "function do_shortcodes_in_html_tags($content, $ignore_html, $tagnames)\n {\n }", "function doHtmlSpecChars() {\n $this->description = htmlspecialchars($this->description);\n $this->postsHeader = htmlspecialchars($this->postsHeader);\n $this->postBody = htmlspecialchars($this->postBody);\n $this->postsFooter = htmlspecialchars($this->postsFooter);\n $this->formLogged = htmlspecialchars($this->formLogged);\n $this->form = htmlspecialchars($this->form);\n $this->navigation = htmlspecialchars($this->navigation);\n $this->name = htmlspecialchars($this->name);\n $this->nameLin = htmlspecialchars($this->nameLin);\n $this->memberName = htmlspecialchars($this->memberName);\n $this->date = htmlspecialchars($this->date);\n $this->time = htmlspecialchars($this->time); \n $this->nextPage = htmlspecialchars($this->nextPage);\n $this->previousPage =htmlspecialchars($this->previousPage);\n $this->firstPage = htmlspecialchars($this->firstPage);\n $this->lastPage = htmlspecialchars($this->lastPage);\n\t$this->gravDefault = htmlspecialchars($this->gravDefault);\n }", "private function cnew_allowed_html() {\r\n $allowed_html = array(\r\n 'a' => array(\r\n 'class' => array(),\r\n 'href' => array(),\r\n 'title' => array(),\r\n ),\r\n 'b' => array(),\r\n 'strong' => array(),\r\n 'em' => array(),\r\n 'h1' => array(),\r\n 'h2' => array(),\r\n 'h3' => array(),\r\n 'h4' => array(),\r\n 'h5' => array(),\r\n 'h6' => array(),\r\n 'i' => array(),\r\n 'ul' => array(\r\n 'class' => array(),\r\n ),\r\n 'li' => array(\r\n 'class' => array(),\r\n ),\r\n 'ol' => array(\r\n 'class' => array(),\r\n ),\r\n 'p' => array(\r\n 'class' => array(),\r\n ),\r\n 'q' => array(\r\n 'cite' => array(),\r\n ),\r\n 'blockquote' => array(\r\n 'cite' => array(),\r\n ),\r\n 'cite' => array(\r\n 'title' => array(),\r\n ),\r\n 'abbr' => array(\r\n 'title' => array(),\r\n ),\r\n );\r\n\r\n return $allowed_html;\r\n }", "public function isHtml() {}", "private static function entities($data)\n {\n return strtr($data, array(\n '<' => '&lt;',\n '>' => '&gt;',\n '\"' => '&quot;'\n ));\n }", "public function getHTML();", "function filterSpecials($data){\n\n if(!$this->isUTF8($data))\n $data = utf8_encode($data);\n $data = htmlspecialchars($data, ENT_QUOTES);\n\n return $data;\n }", "function _sanitize_naughty_html($matches) {\n\t\t// encode opening brace\n\t\t$str = '&lt;' . $matches [1] . $matches [2] . $matches [3];\n\n\t\t// encode captured opening or closing brace to prevent recursive vectors\n\t\t$str .= str_replace(array('>', '<'), array('&gt;', '&lt;'), $matches [4]);\n\n\t\treturn $str;\n\t}", "function tag_html($selector, $source = false)\r\n{\r\n\r\n $r = get_noko($source)->get($selector)->toHtml();\r\n $r = str_replace(array(\"\\n\", \"\\t\"), '', $r);\r\n if ($r=='<root/>') $r='';\r\n $r=close_tags($r);\r\n if (DEV)\r\n xlogc('tag_html', $r, $selector, $source);\r\n\r\n return $r;\r\n}", "function initialize () {\n $this->set_openingtag(\"<U[attributes]>\");\n\t$this->set_closingtag(\"</U>\");\n }", "protected function _beforeToHtml()\n {\n $this->prepareBlockData();\n return parent::_beforeToHtml();\n }", "function generalTemplate ($data){\n\t\t\tob_start();\t\t\n\t\t\tif(isset($data['title']) and isset($data['description'])):\n\t\t\t?>\n\t\t\t<div class=\"title text\">\n\t\t\t\t<h1><?php echo $data['title']; ?></h1>\n\t\t\t</div>\n \n <div id=\"description text\">\n\t\t\t\t<?php echo $data['description']; ?>\n </div>\n\t\t\t<?php\n\t\t\tendif;\n\t\t\t$output = ob_get_contents();\n\t\t\tob_end_clean();\t\n\t\t\t\n\t\t\treturn $output;\n\t\t}", "function wp_kses_allowed_html($context = '')\n {\n }", "function acf_allow_unfiltered_html()\n{\n}", "public final function startTag() : string\n {\n return $this->name ? '<' . $this->name . $this->attributes() . (static::$xhtml && $this->isEmpty ? ' />' : '>') : '';\n }", "function htmltags($args) {\r\n\t\t$args['selections'] = $this->html_tags;\r\n\t\t$args['multiple'] = false;\r\n\t\t$args['width'] = '65';\r\n\t\t$args['tooltip'] = 'Choose the HTML tag to use';\r\n\t\t$this->select($args);\r\n\t}", "abstract function get_html();", "public function get_html() {\n\t\treturn wp_json_encode( $this->context->to_array(), JSON_PRETTY_PRINT );\n\t}", "function html_strip_unsafe($strData)\n\t\t{\n\t\t // Unsafe HTML tags/attributes that members may abuse\n\t\t $arrData=array(\n\t\t //'/<iframe(.*?)<\\/iframe>/is',\n\t\t '/<title(.*?)<\\/title>/is',\n\t\t '/<pre(.*?)<\\/pre>/is',\n\t\t '/<frame(.*?)<\\/frame>/is',\n\t\t '/<frameset(.*?)<\\/frameset>/is',\n\t\t //'/<object(.*?)<\\/object>/is',\n\t\t '/<script(.*?)<\\/script>/is',\n\t\t //'/<embed(.*?)<\\/embed>/is',\n\t\t '/<applet(.*?)<\\/applet>/is',\n\t\t '/<meta(.*?)>/is',\n\t\t '/<!doctype(.*?)>/is',\n\t\t '/<link(.*?)>/is',\n\t\t '/<body(.*?)>/is',\n\t\t '/<\\/body>/is',\n\t\t '/<head(.*?)>/is',\n\t\t '/<\\/head>/is',\n\t\t '/onload=\"(.*?)\"/is',\n\t\t '/onunload=\"(.*?)\"/is',\n\t\t '/onerror=\"(.*?)\"/is',\n\t\t '/onclick=\"(.*?)\"/is',\n\t\t '/onchange=\"(.*?)\"/is',\n\t\t '/onmouseover=\"(.*?)\"/is',\n\t\t '/autofocus=\"(.*?)\"/is',\n\t\t '/onfocus=\"(.*?)\"/is',\n\t\t '/<html(.*?)>/is',\n\t\t '/<\\/html>/is',\n\t\t );\n\t\t $strData = preg_replace($arrData, \"\", $strData);\n\t\t\t$strData = filter_var($strData, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);\n\n\t\t return $strData;\n\t\t}", "function allowed_tags()\n {\n }", "function cacap_allowed_tags() {\n\treturn array(\n\t\t'a' => array(\n\t\t\t'href' => array(),\n\t\t\t'rel' => array(),\n\t\t),\n\t\t'b' => array(),\n\t\t'br' => array(),\n\t\t'div' => array(\n\t\t\t'align' => array(),\n\t\t),\n\t\t'h1' => array(),\n\t\t'h2' => array(),\n\t\t'h3' => array(),\n\t\t'i' => array(),\n\t\t'li' => array(),\n\t\t'p' => array(),\n\t\t'ol' => array(),\n\t\t'ul' => array(),\n\t);\n}", "protected static function u_wrap ($data, $tag) {\n\t\t$in = $attributes = '';\n\t\tstatic::pre_processing($tag, $data);\n\t\tif (!static::data_prepare($data, $tag, $in, $attributes)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn \"<$tag$attributes>\".($in ? \" $in\" : '').\"\\n\";\n\t}", "function initialize () {\n $this->set_openingtag(\"<P[attributes]>\");\n\t$this->set_closingtag(\"</P>\");\n }", "function dev_get_safe_tags() {\n\n\t$tags = array(\n\t\t'a' => array(\n\t\t\t'href' => array (),\n\t\t\t'title' => array ()),\n\t\t'abbr' => array(\n\t\t\t'title' => array ()),\n\t\t'acronym' => array(\n\t\t\t'title' => array ()),\n\t\t'b' => array(),\n\t\t'blockquote' => array(\n\t\t\t'cite' => array ()),\n\t\t'cite' => array (),\n\t\t'code' => array(),\n\t\t'pre' => array(),\n\t\t'del' => array(\n\t\t\t'datetime' => array ()),\n\t\t'em' => array (), 'i' => array (),\n\t\t'q' => array(\n\t\t\t'cite' => array ()),\n\t\t'strike' => array(),\n\t\t'strong' => array(),\n\t\t'h1' => array(),\n\t\t'h2' => array(),\n\t\t'h3' => array(),\n\t\t'h4' => array(),\n\t\t'h5' => array(),\n\t\t'h6' => array(),\n\t\t'p' => array(),\n\t);\n\n\treturn apply_filters( 'dev_get_safe_tags', $tags );\n\n}", "public static function snohtml($data,$charset='ISO-8859-1'){\n\t\t\t$data=htmlspecialchars($data,ENT_QUOTES,$charset);\n\t\t\treturn $data;\n\t\t}", "private static function tag($tag, $arguments=false, $content='', $open=false) {\n\t\t$tag = strtolower(trim($tag));\n\t\t\n\t\t//start tag\n\t\t$return = '<' . $tag;\n\n\t\t//format arguments\n\t\t$arguments = self::arguments($arguments);\n\t\tforeach ($arguments as $key=>$value) {\n\t\t\tif ($value !== false) $return .= ' ' . strtolower(trim($key)) . '=\"' . htmlentities(trim($value)) . '\"';\n\t\t}\n\t\t\n\t\t//close tag\n\t\t$return .= '>';\n\t\tif (!in_array($tag, array('br', 'hr', 'img', 'meta'))) {\n\t\t\t//is a container tag\n\t\t\t$return .= $content;\n\t\t\tif ($open === false) $return .= '</' . $tag . '>';\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "function initialize () {\n $this->set_openingtag(\"<SCRIPT[attributes]>\");\n\t $this->set_closingtag(\"</SCRIPT>\");\n }", "function initialize () {\n $this->set_openingtag(\"\");\n\t$this->set_closingtag(\"<BR[attributes]/>\");\n }", "protected function registerUniversalTagAttributes() {}", "public function escapeHtml($data, $allowedTags = null)\n {\n if (!is_array($data)) {\n $data = (string)$data;\n }\n\n if (is_array($data)) {\n $result = [];\n foreach ($data as $item) {\n $result[] = $this->escapeHtml($item, $allowedTags);\n }\n } elseif (strlen($data)) {\n if (is_array($allowedTags) && !empty($allowedTags)) {\n $allowedTags = $this->filterProhibitedTags($allowedTags);\n $wrapperElementId = uniqid();\n $domDocument = new \\DOMDocument('1.0', 'UTF-8');\n set_error_handler(\n function ($errorNumber, $errorString) {\n throw new \\Exception($errorString, $errorNumber);\n }\n );\n $string = mb_convert_encoding($data, 'HTML-ENTITIES', 'UTF-8');\n try {\n $domDocument->loadHTML(\n '<html><body id=\"' . $wrapperElementId . '\">' . $string . '</body></html>'\n );\n } catch (\\Exception $e) {\n restore_error_handler();\n $this->getLogger()->critical($e);\n }\n restore_error_handler();\n\n $this->removeNotAllowedTags($domDocument, $allowedTags);\n $this->removeNotAllowedAttributes($domDocument);\n $this->escapeText($domDocument);\n $this->escapeAttributeValues($domDocument);\n\n $result = mb_convert_encoding($domDocument->saveHTML(), 'UTF-8', 'HTML-ENTITIES');\n preg_match('/<body id=\"' . $wrapperElementId . '\">(.+)<\\/body><\\/html>$/si', $result, $matches);\n return !empty($matches) ? $matches[1] : '';\n } else {\n $result = htmlspecialchars($data, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8', false);\n }\n } else {\n $result = $data;\n }\n return $result;\n }", "function initialize() {\n $this->set_openingtag(\"<CODE[attributes]>\");\n $this->set_closingtag(\"</CODE>\");\n }", "abstract protected function generateMarkup(array $data): string;", "public static function get_allowed_wp_kses_html()\n {\n }", "function initialize () {\n $this->set_openingtag(\"<SPAN[attributes]>\");\n\t $this->set_closingtag(\"</SPAN>\");\n }", "public function html(): string;", "public static function getRawTags(){\n return \\Illuminate\\View\\Compilers\\BladeCompiler::getRawTags();\n }", "abstract public function getHtml();", "function initialize() {\n $this->set_openingtag(\"<BASE[attributes]>\");\n $this->set_closingtag(\"\");\n }", "public function convertToHtmlValue($data);", "public abstract function html(): string;", "public function getHTML(): string;", "protected function generateHtml()\n\t{\n\t}", "function initialize () {\n $this->set_openingtag(\"<DIV[attributes]>[content]\");\n\t$this->set_closingtag(\"</DIV>\");\n }", "public function displayData()\r\n {\r\n $htmlContent = '';\r\n $htmlContent .= html_entity_decode($this->content);\r\n return $htmlContent;\r\n }", "function characterData($parser, $data) {\n \tif($data!='') {\n switch($this->current_tag) {\n case 'TAG': \n $this->element_object['TAG'] = htmlentities($data);\n break;\n case 'DESCRIPTION': \n $this->element_object['DESC'] = htmlentities($data);\n break; \n } \n \t}\n }", "public function renderHTML()\n {\n }", "function initialize() {\n $this->set_openingtag(\"<DATALIST[attributes]>\");\n $this->set_closingtag(\"</DATALIST>\");\n }", "public function getHTML() {\n // Define the variable to output the HTML in\n $out = '';\n\n // Add the HTML code for each meta tag\n foreach($this->meta as $entry)\n $out .= $entry->getHTML() . PHP_EOL;\n\n // Return the HTML code\n return $out;\n }", "public function asHTML() {\n return \"$this->before<$this->tag_name$this->attributes />$this->after\";\n }", "private function htmlFix() {\n // First, check if html is allowed\n if (!$this->allow_html) {\n $html = false;\n } elseif ($this->standard_html) {\n $html = true;\n } else {\n $html = false;\n }\n\n $newParseArray = array();\n while ($tag = array_shift($this->parseArray)) {\n switch ($tag) {\n case self::TAG_NOHTML_OPEN:\n case self::TAG_HTML_CLOSE:\n $html = false;\n break;\n case self::TAG_HTML_OPEN:\n case self::TAG_NOHTML_CLOSE:\n if ($this->allow_html) {\n $html = true;\n }\n break;\n\n default:\n if ($html) {\n if ($tag == self::BR_TAG) {\n $tag = \"\\n\";\n } // Really, no BR's in html code is wanted.\n $newParseArray[] = $tag;\n } else {\n $newParseArray[] = htmlspecialchars($tag);\n }\n }\n }\n $this->parseArray = $newParseArray;\n return true;\n }", "public function getHtml();", "function tee_html_tag($variables) {\n $element = $variables['element'];\n // Remove type=\"...\" attribute from <style> tags\n if($element['#tag'] === 'style') {\n unset($element['#attributes']['type']);\n }\n // Remove type=\"...\" attribute and CDATA pre/suffixes from <script> tags\n if($element['#tag'] === 'script') {\n unset($element['#attributes']['type'], $element['#value_prefix'], $element['#value_suffix']);\n }\n // Remove type=\"text/css\" from the <link> tags\n if($element['#tag'] === 'link' && $element['#attributes']['type'] === 'text/css') {\n unset($element['#attributes']['type']);\n }\n // Remove media=\"all\" attribute from <style> tags\n if (isset($element['#attributes']['media']) && $element['#attributes']['media'] === 'all') {\n unset($element['#attributes']['media']);\n }\n if (!isset($element['#value'])) {\n // Changed to remove XHTML's self-closing slashes: \" />\" becomes \">\".\n return '<' . $element['#tag'] . drupal_attributes($element['#attributes']) . \">\\n\";\n }\n else {\n $output = '<' . $element['#tag'] . drupal_attributes($element['#attributes']) . '>';\n if (isset($element['#value_prefix'])) {\n $output .= $element['#value_prefix'];\n }\n $output .= $element['#value'];\n if (isset($element['#value_suffix'])) {\n $output .= $element['#value_suffix'];\n }\n $output .= '</' . $element['#tag'] . \">\\n\";\n return $output;\n }\n}", "function mc_strip_tags() {\n\n\treturn apply_filters( 'mc_strip_tags', '<strong><em><i><b><span><br><a>' );\n}", "function wt_html_allowed() {\n\n\t$allowed = array(\n\t\t'a' => array( 'class' => true, 'title' => true, 'href' => true ),\n\t\t'abbr' => array( 'class' => true, 'title' => true ),\n\t\t'acronym' => array( 'class' => true, 'title' => true ),\n\t\t'code' => array( 'class' => true ),\n\t\t'em' => array( 'class' => true ),\n\t\t'strong' => array( 'class' => true ),\n\t\t'i' => array( 'class' => true ),\n\t\t'b' => array( 'class' => true ),\n\t\t'span' => array( 'class' => true )\n\t);\n\n\treturn apply_filters( 'wt_html_allowed', $allowed );\n}", "public function escapeHtml($data, $allowedTags = null)\n {\n return $this->adminHelper->escapeHtmlWithLinks($data, $allowedTags);\n }", "public function testHtml() {\n $this->assertEquals('String with b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.'));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i &lt;i&gt;tags&lt;/i&gt;.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('strip' => false)));\n $this->assertEquals('String &lt;b&gt;with&lt;/b&gt; b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('whitelist' => '<b>')));\n $this->assertEquals('String with b &amp;amp; i tags.', Sanitize::html('String <b>with</b> b &amp; i <i>tags</i>.', array('double' => true)));\n }", "public function wrap_HTML_with_HTML_tags()\n\t{\n\t\t$this->HTML = '<html><body>'.$this->HTML.'</body></html>';\n\t}", "function handlerCharacterData($a_xml_parser, $a_data)\n\t{\n\t\t// i don't know why this is necessary, but\n\t\t// the parser seems to convert \"&gt;\" to \">\" and \"&lt;\" to \"<\"\n\t\t// in character data, but we don't want that, because it's the\n\t\t// way we mask user html in our content, so we convert back...\n\t\t$a_data = str_replace(\"<\",\"&lt;\",$a_data);\n\t\t$a_data = str_replace(\">\",\"&gt;\",$a_data);\n\n\t\t// DELETE WHITESPACES AND NEWLINES OF CHARACTER DATA\n\t\t$a_data = preg_replace(\"/\\n/\",\"\",$a_data);\n\t\t$a_data = preg_replace(\"/\\t+/\",\"\",$a_data);\n\t\tif(!empty($a_data))\n\t\t{\n\t\t\t$this->cdata .= $a_data;\n\t\t}\n\t}", "private static function html() : string\n {\n return '<(.|\\n)*?>';\n }", "function get_html()\n\t{\n\n\t// incrase views\n\n\t}" ]
[ "0.6832139", "0.6757433", "0.6738663", "0.65818566", "0.63663435", "0.62460446", "0.6197367", "0.6151333", "0.6102051", "0.6090518", "0.60143244", "0.60143244", "0.6010617", "0.6001316", "0.5971223", "0.5930932", "0.5915687", "0.5885128", "0.5881662", "0.5849743", "0.58408725", "0.5837459", "0.5833501", "0.58328784", "0.58198464", "0.5809326", "0.58022565", "0.5778696", "0.5763536", "0.57580113", "0.5754551", "0.57439893", "0.57434815", "0.5739884", "0.57328033", "0.57195234", "0.57175565", "0.5713632", "0.56983304", "0.56969786", "0.5690314", "0.56658685", "0.5655495", "0.5654228", "0.5639273", "0.5634255", "0.56242883", "0.5612334", "0.56045365", "0.56016254", "0.559402", "0.55921483", "0.5589385", "0.558345", "0.55704", "0.5568718", "0.55616987", "0.555625", "0.55558276", "0.55513275", "0.5550319", "0.55500877", "0.5544428", "0.5536971", "0.5523691", "0.55223775", "0.5518958", "0.5517676", "0.5505535", "0.55012566", "0.5493917", "0.54896796", "0.54888684", "0.54835117", "0.5481798", "0.5480234", "0.54801685", "0.5478249", "0.5477589", "0.5474874", "0.54572815", "0.54559183", "0.5452132", "0.5452097", "0.54509175", "0.54503745", "0.54490983", "0.54445004", "0.54432327", "0.5436152", "0.543495", "0.54330856", "0.5431662", "0.5430642", "0.5428368", "0.5422742", "0.5422031", "0.5418587", "0.5418313", "0.5407447", "0.5402502" ]
0.0
-1
Add a class to an array of attributes
public static function addClass(array $attributes, string|array $class = ''): array { $attributes['class'] = CSS::addClass($attributes['class'] ?? '', $class); return $attributes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function add_class($attributes, $class) {\n if(isset($attributes['class'])) {\n $attributes['class'] .= ' '.$class;\n } else {\n $attributes['class'] = $class;\n }\n return $attributes;\n }", "public function addClass(array &$attrs, $class)\n {\n $this->ensureClass($attrs);\n $attrs['class'][] = $class;\n }", "function addAttributeClass($accessModifier, $attributeType, $dataType, $name) {\n\t\tarray_push($this->attributesArray, array(\"modifier\" => $accessModifier, \"attributeType\" => $attributeType, \"type\" => $dataType, \"name\" => $name, \"priority\" => true, \"parentClass\" => $this->name, \"conflicts\" => false, \"show\" => true));\n\t}", "private function computeClassAttribute(): void\n {\n $classes = $this->options['class'] ?? null;\n $paramClasses = $this->getRenderer()->getParam('class');\n\n if (null !== $classes || null !== $paramClasses) {\n $this->attributes['class'] = array_merge(\n $this->attributes['class'],\n $classes !== null ? is_array($classes) ? $classes : explode(' ', $classes) : [],\n $paramClasses !== null ? is_array($paramClasses) ? $paramClasses : explode(' ', $paramClasses) : []\n );\n }\n }", "public function addClassName(string $class): void {\n\t\t$this->m_attributes[\"class\"][] = $class;\n\t}", "public function addAttributes($arrAttributes) {\n foreach ($arrAttributes as $key => $val) {\n $this->attributes[$key] = $val;\n }\n }", "function omega_enforce_attributes(&$variables) {\n // Copy over the classes array into the attributes array.\n if (!empty($variables['classes_array'])) {\n $variables['attributes_array']['class'] = !empty($variables['attributes_array']['class']) ? array_merge($variables['attributes_array']['class'], $variables['classes_array']) : $variables['classes_array'];\n $variables['attributes_array']['class'] = array_unique($variables['attributes_array']['class']);\n }\n\n // Sync that with the classes array. Remember: We don't recommend using it.\n if (!empty($variables['attributes_array']['class'])) {\n $variables['classes_array'] = $variables['attributes_array']['class'];\n }\n}", "public function make(array $attributes = []);", "public function make(array $attributes = []);", "function gymfitness_a_class($atts,$item,$args) {\n \n $atts['class'] = 'nav-link pl-3 pr-3';\n \n return $atts;\n}", "public function __construct(array $attributes = []);", "private function fillArray($array) {\n\t\t$result = array();\n\t\tforeach ($array as $attr => $val) {\n\t\t\t$setMethod = 'set' . ucfirst($attr);\n\t\t\t$returnType = $this->getReturnTypeOfSetMethod($setMethod);\n\t\t\tif ($returnType) {\n\t\t\t\t$result[$attr] = new $returnType(); \n\t\t\t} else {\n\t\t\t\t$result[$attr] = 'abc';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function setAttributes(array $attributes);", "public function setAttributes(array $attributes);", "public function setAttributes(array $attributes);", "public function testAddClass()\n {\n $opts = [\n 'class' => 'class-1',\n ];\n $opts = $this->trait->addClass($opts, ' class-1 class-2 ');\n $this->assertEquals($opts, [\n 'class' => 'class-1 class-2',\n ]);\n // Test with an array\n $opts = $this->trait->addClass($opts, ['class-1', 'class-3']);\n $this->assertEquals($opts, [\n 'class' => 'class-1 class-2 class-3',\n ]);\n }", "public function buildAttributes()\n {\n $classes = new ClassFactory();\n $classes->add($this->default_class);\n\n if ($this->class) {\n foreach (explode(' ', $this->class) as $c) {\n $classes->add($c);\n }\n }\n\n $attr = new AttributeFactory();\n $attr->add('class', $classes->get());\n\n if ($this->role) {\n $attr->add('role', $this->role);\n }\n\n if ($this->id) {\n $attr->add('id', $this->id);\n }\n\n if ($this->aria_label) {\n $attr->add('aria-label', $this->aria_label);\n }\n\n if ($this->attributes) {\n foreach ($this->attributes as $key => $attribute) {\n $attr->add($key, $attribute);\n }\n }\n\n $this->data['attr'] = $attr->get();\n }", "private function addAttributes(array $attributes) : void\n {\n $this->attributes = $attributes;\n }", "public function add_class($class_name)\n {\n }", "function addClass($class) {\r\n if(empty($this->classes) || !$this->classes[$class]) {\r\n $this->classes[$class] = array();\r\n return true;\r\n //map array to class properties/methods\r\n }\r\n return false;\r\n }", "public function addClasses() {\n\t\t$classes = func_get_args();\n\n\t\tif (is_array($classes[0])) {\n\t\t\t$classes = $classes[0];\n\t\t}\n\n\t\tforeach ($classes as $class) {\n\t\t\teval('$tableName = '.$class.'::$table;');\n\t\t\t$this->_tableMap[$tableName] = $class;\n\t\t}\n\t}", "private function _index_classes() {\n $ix = array(); $aix = $this->attr_idx;\n foreach($this->attribs as $aid => &$a) {\n if(!empty($a['class'])) {\n $cl = $a['class'];\n if(!is_array($cl)) $cl = preg_split('|\\\\s+|',trim($cl));\n foreach($cl as $cl) {\n if(isset($ix[$cl])) {\n if(!is_array($ix[$cl])) $ix[$cl] = array($ix[$cl]=>$this->attr_idx[$ix[$cl]]);\n $ix[$cl][$aid] = $this->attr_idx[$aid];\n } else {\n $ix[$cl] = $aid;\n }\n }\n }\n }\n return $this->class_idx = $ix;\n }", "public function class_add($cid, $uinfoArray)\n\t{\n\t\t$e107 = e107::getInstance();\n\t\t$uc_sql = new db;\n\t\tforeach($uinfoArray as $uid => $curclass)\n\t\t{\n\t\t\tif ($curclass)\n\t\t\t{\n\t\t\t\t$newarray = array_unique(array_merge(explode(',', $curclass), array($cid)));\n\t\t\t\t$new_userclass = implode(',', $newarray);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$new_userclass = $cid;\n\t\t\t}\n\t\t\t$uc_sql->db_Update('user', \"user_class='\".$e107->tp->toDB($new_userclass, true).\"' WHERE user_id=\".intval($uid));\n\t\t}\n\t}", "public function testRenderShortcodeHandlesClassAttributeAsArray() {\n\t\tM::wpFunction( 'shortcode_atts', array(\n\t\t\t'return' => array(\n\t\t\t\t'class' => array( 'some-class', 'another-class' ),\n\t\t\t\t'tags' => 'h1,h2,h3',\n\t\t\t\t'title' => false,\n\t\t\t),\n\t\t) );\n\n\t\tM::wpFunction( 'get_the_content', array(\n\t\t\t'return' => '<h2 id=\"first-heading\">First heading</h2>',\n\t\t) );\n\n\t\tM::wpFunction( __NAMESPACE__ . '\\build_link_list', array(\n\t\t\t'return' => array(\n\t\t\t\t'<a href=\"#first-heading\">First heading</a>',\n\t\t\t),\n\t\t) );\n\n\t\tM::wpPassthruFunction( 'Growella\\TableOfContents\\Headings\\inject_heading_ids' );\n\t\tM::wpPassthruFunction( '_x' );\n\t\tM::wpPassthruFunction( 'esc_attr' );\n\n\t\t$this->assertContains(\n\t\t\t'class=\"growella-table-of-contents some-class another-class\"',\n\t\t\trender_shortcode( array() )\n\t\t);\n\t}", "public function __construct(array $attributes)\n {\n foreach ($attributes as $attribute => $value){\n $this->$attributes = $value;\n }\n }", "private function addCustomAttributes(array $attributes, HTMLPurifier_HTMLDefinition $definition)\n {\n foreach ($attributes as $attribute) {\n // Get configuration of attribute\n $required = !empty($attribute[3]) ? true : false;\n $onElement = $attribute[0];\n $attrName = $required ? $attribute[1] . '*' : $attribute[1];\n $validValues = $attribute[2];\n\n if ($onElement === '*') {\n $def = $validValues;\n if (is_string($validValues)) {\n $def = new $validValues();\n }\n\n if ($def instanceof \\HTMLPurifier_AttrDef) {\n $definition->info_global_attr[$attrName] = $def;\n }\n\n continue;\n\t }\n\n\t if (class_exists($validValues)) {\n\t\t$validValues = new $validValues();\n\t }\n\n $definition->addAttribute($onElement, $attrName, $validValues);\n }\n\n return $definition;\n }", "protected function addClass($node,$class)\n {\n $existing = $node->getAttribute('class');\n if (strlen($existing)>0) $existing .= ' '; // add space delimiter\n $existing .= $class;\n $node->setAttribute('class',$existing);\n }", "function custom_add_artwork_attr( $attributes ){\n\t\t\t$attributes['class'] .= ' equalize col-xs-12 col-sm-6 col-md-4';\n\t\t\t$attributes['itemtype'] = 'http://schema.org/ArtworkArticle';\n\t\t\t// return the attributes\n\t\t\treturn $attributes;\n\t\t}", "function add_cssclass($class_to_add, $classes)\n {\n }", "function ArrayToClass ($array) {\n \t$classes = implode(' ',$array);\n\n \tif (!empty($classes)) {\n \t\treturn 'class=\"' . $classes . '\"';\n \t}\n }", "public function setClass(array $class) {\n \t$this->_class = $class;\n \treturn $this;\n }", "public function fill(array $attributes = [])\n {\n $this->attributes = array_merge($this->attributes, $attributes);\n foreach($this->attributes['items'] as $key => $item) {\n if(is_array($item)) {\n $className = '\\App\\Items\\\\'.ucfirst($item['slug']);\n if(class_exists($className)) {\n $this->attributes['items'][$key] = new $className($item);\n }\n } elseif($item instanceof Item) {\n $this->attributes['items'][$key] = $item;\n }\n }\n foreach($this->attributes['systems'] as $key => $system) {\n if(is_array($system)) {\n $className = '\\App\\Systems\\\\'.ucfirst($system['slug']);\n if(class_exists($className)) {\n $this->attributes['systems'][$key] = new $className($system);\n }\n } elseif($system instanceof Item) {\n $this->attributes['systems'][$key] = $system;\n }\n }\n }", "function AddAttribute() {\n $db = Core::GetDB();\n\n $id = Core::GetFromPOST('id');\n $attrs = Core::GetFromPOST('attrs');\n\n $attrs = fix_attrs($attrs);\n\n foreach ($attrs AS $attr) {\n $attr = explode(':', $attr);\n\n if (count($attr) == 3) {\n if (empty($attr) === false) {\n $db->Query(\"DELETE FROM data_xml_attributes WHERE data_xml_item_id = $id AND attr_name='{$attr[0]}' LIMIT 1\");\n $db->Query(\"INSERT INTO data_xml_attributes (data_xml_item_id, attr_name, attr_value, attr_type) VALUES ($id, '{$attr[0]}', '{$attr[1]}', '{$attr[2]}')\");\n }\n }\n }\n}", "public function setClassNames(?array $classes): void {\n\t\t$this->setAttribute(\"class\", $classes ?? []);\n\t}", "public function add_class( $class = null ) {\n\t\t\n\t\tif ( !is_string( $class ) ) return;\n\t\t\n\t\t$this->classes = Halp::_add_class( $class, $this->classes );\n\t\n\t}", "public function setAttributes();", "function montheme_link_class($attr)\n{\n $attr['class'] = 'nav-link';\n\n return $attr;\n}", "function nav_menu_link_attributes( $attr ) {\n\n\t$attr['class'] = 'menu__link';\n\n\treturn $attr;\n}", "function _wp_post_thumbnail_class_filter_add($attr)\n {\n }", "protected function add_common_attribute_classes(){\n\t\tparent::add_common_attribute_classes();\n\t}", "public function GetAttributes() {\n\t\treturn [\n\t\t\t'class'=> implode(' ', $this->getCSS())\n\t\t];\n\t}", "function update_attributes($array = array())\n {\n foreach ($array as $key => $value) {\n $this->_stdObject->{$key} = $value;\n }\n }", "protected abstract function initializeAttributes(): array;", "public function setAttributes($arr) {\n foreach($arr as $key => $val) {\n switch($key) {\n case \"id\":\n case \"user_id\":\n //casting null to int will return 0; don't want that\n if ($val !== null) {\n $this->id_ = (int) $val;\n }\n break; \n case \"username\":\n $this->username_ = $val;\n break; \n case \"email\":\n $this->email_ = $val;\n break; \n case \"displayName\":\n case \"display_name\":\n $this->displayName_ = $val;\n break; \n case \"firstName\":\n case \"first_name\":\n $this->firstName_ = $val;\n break; \n case \"lastName\":\n case \"last_name\":\n $this->lastName_ = $val;\n break; \n case \"postalCode\":\n case \"postal_code\":\n $this->postalCode_ = $val;\n break; \n case \"isVerified\":\n case \"is_verified\":\n $this->isVerified_ = (int) $val;\n break; \n case \"privileges\":\n //might be a string of comma-separated numbers, or an array\n if (is_array($val)) {\n $this->privileges_ = $val;\n } else if ($val !== null) {\n //clear array first\n unset($this->privileges_);\n $this->privileges_ = array();\n $tmp = explode(\",\", $val);\n foreach($tmp as $v){\n if (is_numeric($v)) {\n //$this->privileges_[(int) $v] = 1;\n $this->privileges_[] = (int) $v;\n }\n }\n \n }\n break;\n\n default:\n //ignore any others\n }\n }\n }", "public function addClass($name) {\n\t\t$this->attributes[\"class\"][$name] = $name;\n\t\treturn $this;\n\t}", "public static function create(array $attributes = []);", "public static function create(array $attributes = []);", "function admin_bar_class($attributes)\n{\n $attributes['class'] = trim('admin-bar '.$attributes['class']);\n return $attributes;\n}", "function gymfitness_li_class($classes,$item,$args) {\n \n $classes[] = 'nav-item';\n \n return $classes;\n\n}", "function build_class_attribute($required, $extra_classes) {\n\t// Prepare the options\n\t// This allows people to pass in undefined for $classes (instead of an empty array) if they want it to be empty\n\tif (!is_array($extra_classes)) {\n\t\t$extra_classes = array();\n\t}\n\t\n\t// Build the class string\n\t$classes = array();\n\tif ($required) {\n\t\t$classes[] = 'required';\n\t}\n\t$classes = array_merge($classes, array_map('htmlentities', $extra_classes));\n\t$classes_html = 'class=\"' . join(' ', $classes) . '\"';\n\treturn $classes_html;\n}", "function montheme_li_class($classes)\n{\n $classes = [];\n $classes[] = 'nav-item';\n\n return $classes;\n}", "abstract function attributes(): array;", "protected function _setClassExt($arr)\n\t{\n\t\t$str = $arr['strClass'];\n\t\t$path = PATH_BACK_CLASS_ELSE_PLUGIN . 'accounting/' . $str . \".php\";\n\t\tif (!file_exists($path)) {\n\t\t\tif (FLAG_TEST) {\n\t\t\t\tvar_dump(__CLASS__ . '/' .__FUNCTION__. '/' .__LINE__);\n\t\t\t}\n\t\t\texit;\n\t\t}\n\t\trequire_once($path);\n\t\t$strClass = 'Code_Else_Plugin_Accounting_' . $str;\n\t\t$classCall = new $strClass;\n\t\t$classCall->run();\n\t}", "public function addClass($class) {\n\t\t$this->class .= $class.' ';\n\t}", "public static function addClass($array, $value, $key = 'class')\n {\n $array[$key] = isset($array[$key]) ? $array[$key].' '.$value : $value;\n\n return $array;\n }", "public function createAttribute(array $params)\n {\n }", "public function createFromArray(string $class, array $data);", "public function __construct(array $attributes = [])\n {\n }", "public function setAttributes($attributes){ }", "public function addClasses(array $classes)\n {\n $this->classes = array_merge($this->classes, $classes);\n return $this;\n }", "protected function listifyAttr( $array ) {\n\t\tksort( $array );\n\t\t$list = array();\n\t\tforeach ( $array as $name => $obj ) {\n\t\t\tif ( $obj === false ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$list[] = \"$name&nbsp;=&nbsp;<i>\" . $this->getClass( $obj, 'AttrDef_' ) . '</i>';\n\t\t}\n\n\t\treturn $this->listify( $list );\n\t}", "public function setClass($class);", "public function fillAttributes($attr_arr) {\n // If $attr_arr is an associative array, convert it to numerically indexed\n // If it's a numerically indexed array, treat it the same\n $index_keys = array_keys($attr_arr);\n foreach ($index_keys as $num => $val) {\n $attr_to_add = $attr_arr[$val];\n /* echo \"index_keys is $val \\n\"; */\n foreach ($this->attr as $key => $value) {\n /* echo \"this->key is $key and index_keys is $val \\n\"; */\n if ($attr_to_add and $key === $val) {\n $this->attr[$key] = $attr_to_add;\n break 1;\n }\n } \n }\n }", "abstract protected static function defineComparableAttributes(): array;", "function Html_CSS_Add($class,&$options)\n {\n if (empty($options[ \"CLASS\" ]))\n {\n $options[ \"CLASS\" ]=array();\n }\n elseif(!is_array($options[ \"CLASS\" ]))\n {\n $options[ \"CLASS\" ]=array($options[ \"CLASS\" ]);\n }\n\n array_push($options[ \"CLASS\" ],$class);\n\n $options[ \"CLASS\" ]=join(\",\",$options[ \"CLASS\" ]);\n }", "public function addAttributes($attributes)\n {\n $this->_attributes = array_unique(\n array_merge(\n $this->_attributes,\n array_keys($attributes)\n )\n );\n }", "private function appendAttributes(array $attrs): void\n {\n foreach ($attrs as $key => $value) {\n $this->appendAttribute($key, $value);\n }\n }", "public function addClass_post()\n {\n $postArray\t \t= $this->post();\n\t\t\n\t\t$dataArray = array(\n\t\t\t'instructor_id' \t\t\t\t=> $postArray['userId'],\n\t\t\t'class_name' \t\t\t\t\t=> $postArray['class_name'],\n\t\t\t'class_desc' \t\t\t\t\t=> $postArray['about_class'],\n\t\t\t'class_hours_length' \t\t\t=> $postArray['hours_length'],\n\t\t\t'class_min_length' \t\t\t\t=> $postArray['minutes_length'],\n\t\t\t'class_instruction' \t\t\t=> $postArray['special_instrauctions'],\n\t\t\t'complexity' \t\t\t\t\t=> $postArray['complexity'],\n\t\t\t'class_limit' \t\t\t\t\t=> 1,\n\t\t\t'class_date' \t\t\t\t\t=> $postArray['date_of_class'],\n\t\t\t'class_time' \t\t\t\t\t=> $postArray['time_hours'].\":\".$postArray['time_minutes'],\n\t\t\t'class_time_zone' \t\t\t\t=> $postArray['class_time_zone'],\n\t\t\t'class_cost' \t\t\t\t\t=> $postArray['cost'],\n\t\t\t'class_cancellation_policy' \t=> $postArray['cancellation_policy'],\n\t\t\t'class_cancellation_cost' \t\t=> $postArray['cancellation_cost'],\n\t\t\t'allow_message' \t\t\t\t=> $postArray['allow_msg'],\n\t\t\t'allow_bonus' \t\t\t\t\t=> $postArray['allow_bonus'],\n\t\t\t'status' \t\t\t\t\t\t=> 1,\n\t\t\t'date_added' \t\t\t\t\t=> date('Y-m-d H:i:s')\n\t\t\t);\n\t\t$this->Common_Model->insert('sj_class',$dataArray);\n\t\t$message = [\n 'message' => 'New class added successfully.'\n ];\n\t\t$this->set_response($message, REST_Controller::HTTP_OK); // UPDATED (200) being the HTTP response code\n }", "function addClassURI(){\n\t\t$classURIs = $this->classArray;\n\t\t$output = \"\";\n\t\t$db = $this->startDB();\n\t\t$sql = \"SELECT class_uuid, class_label\n\t\tFROM sp_classes\n\t\tWHERE 1\n\t\t\";\n\t\t$result = $db->fetchAll($sql);\n\t\tforeach($result as $row){\n\t\t\t$uuid = $row[\"class_uuid\"];\n\t\t\t$label = $row[\"class_label\"];\n\t\t\t$lcLabel = strtolower($label);\n\t\t\tforeach($classURIs as $lkey => $luri){\n\t\t\t\t$lclkey = strtolower($lkey);\n\t\t\t\tif($lclkey == $lcLabel){\n\t\t\t\t\t$uriex = explode(\"/\", $luri);\n\t\t\t\t\t$suffix = $uriex[count($uriex)-1];\n\t\t\t\t\t$prefURI = \"oc-gen:\".$suffix;\n\t\t\t\t\t$where = \"class_uuid = '$uuid' \";\n\t\t\t\t\t$data = array(\"class_uri\" => $prefURI);\n\t\t\t\t\t$db->update(\"sp_classes\", $data, $where);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function uvasomcmedept_add_classes( $classes ) {\n\t$classes[] = 'uvasomcmedept';\n\treturn $classes;\n}", "public static function __set_state(array $array)\n {\n $class = get_called_class();\n $object = new $class;\n foreach ($array['attributes'] as $key => $value) {\n $object->{$key} = $value;\n }\n return $object;\n }", "public function __construct(array $attributes){\n parent::__construct($attributes);\n }", "public static function cacheMutatedAttributes($class)\n {\n $mutatedAttributes = [];\n\n if (preg_match_all('/(?<=^|;)get([^;]+?)Attribute(;|$)/', implode(';', get_class_methods($class)), $matches))\n {\n foreach ($matches[1] as $match)\n {\n if (static::$snakeAttributes)\n $match = Str::snake($match);\n\n $mutatedAttributes[] = lcfirst($match);\n }\n }\n\n static::$mutatorCache[$class] = $mutatedAttributes;\n }", "public function __construct(array $attributes)\n {\n $this->attributes = $attributes;\n }", "function ninja_forms_add_class($classes) {\n\t$classes .= ' nav-menus-php';\n\t// return the $classes array\n\treturn $classes;\n}", "public function createAttributes()\n {\n /** @var \\Shopware\\Components\\Model\\ModelManager $em */\n $em = $this->get('models');\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'link',\n 'int(11)',\n true,\n null\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'show_by_default',\n 'int(1)',\n true,\n 0\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'deleted_position',\n 'int(11)',\n true,\n null\n );\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'base_sort',\n 'int(11)',\n true,\n null\n );\n\n $em->generateAttributeModels(['s_categories_attributes']);\n }", "abstract protected function setValidationCustomAttributes(): array;", "function add_classes_on_li($classes, $item, $args) {\n $classes[] = 'nav-item';\n return $classes;\n}", "function wck_add_metabox_classes( $classes ){\r\n\t\tarray_push($classes,'wck-post-box');\r\n\t\treturn $classes;\r\n\t}", "public function addExtraClasses($classes)\n {\n if (is_array($classes)) {\n $classes = implode(' ', $classes);\n }\n $this->_extraClasses = $classes;\n return $this;\n }", "public function addClass(string $class): HtmlElementInterface;", "protected function buildJSClassesArray() {}", "public function add_classes($classes)\n {\n $table = $this->return_table();\n $this->db->insert($table,$classes);\n }", "public function setAttributes($attributes);", "public function addClass(string $class): self\n\t{\n\t\t$this->getElementPrototype()->class[] = $class;\n\t\treturn $this;\n\t}", "public function setAttributes(array $params)\n {\n foreach($params as $name => $value) {\n $this->setAttribute($name, $value);\n }\n }", "public function __construct(array $attributes = []) {\n $this->attributes = $attributes;\n }", "function rocket_lazyload_exclude_class( $attributes ) {\n\t$attributes[] = 'class=\"custom-logo\"';\n // custom-logo\n\n\treturn $attributes;\n}", "public function addAttributes( $attributes )\n {\n if ( !is_array($attributes) )\n {\n throw new InvalidArgumentException('Array is expected!');\n }\n\n foreach ( $attributes as $name => $value )\n {\n $this->addAttribute($name, $value);\n }\n\n return $this;\n }", "public function __construct(array $attributes = [])\n {\n // Set type\n $path = explode('\\\\', get_class($this));\n $this->type = end($path);\n\n // Set attributes\n $this->fill($attributes);\n }", "function doCustomAttributes(&$element) \n {\n \n foreach ($element->ucAttributes as $key=>$value) {\n \n list($namespace,$attribute) = (strpos($key, \":\") > -1) ? explode(':',$key) : array(\"\", $key);\n $method = strtolower($attribute) . 'Attribute';\n if (strtolower($namespace) != 'flexy') {\n continue;\n }\n if ((strlen($attribute)) && (method_exists($this,$method))) {\n $this->{$method}($element, $element->getAttribute($key));\n }\n } \n }", "function addClass($classInfo) {\r\n $this->db->insert('class', $classInfo);\r\n }", "private function updateAttributes(array $array, array $attributes, QueryResult $result)\n {\n foreach ($array as $attribute) {\n if (array_key_exists($attribute, $attributes)) {\n $result->addAttribute($attribute, $attributes[$attribute]);\n }\n }\n }", "private function registerAttributeCastingList(): void\n {\n // Loops through all the class' methods, and loads the necessary ones in\n // the corresponding containers.\n foreach (\\get_class_methods($this) as $method) {\n // Loads casting mutators.\n if (\\strpos($method, self::$CASTPREFIX) === 0 && \\strlen($method) > \\strlen(self::$CASTPREFIX)) {\n $this->castList[] = $method;\n }\n }\n }", "public function getCustomAttributes(): array;", "public function push(string $class)\n {\n foreach (explode(' ', $class) as $item) {\n if ( ! $this->has($item))\n $this->classes[] = $item;\n }\n\n return $this;\n }", "protected function addClassToComponents($component, $class)\n {\n $this->components[$component][] = $class;\n }", "public function defineAttributes()\n\t{\n\t\treturn array();\n\t}", "private function __appendBodyClass(array $context = array()){\n\t\t\tforeach($context as $c) {\n\t\t\t\tif (is_numeric($c)) $c = 'id-' . $c;\n\t\t\t\t$body_class .= trim($c) . ' ';\n\t\t\t}\n\t\t\t$classes = array_merge(explode(' ', trim($body_class)), explode(' ', trim($this->_body_class)));\n\t\t\t$body_class = trim(implode(' ', $classes));\n\t\t\tif (!empty($body_class)) $this->Body->setAttribute('class', $body_class);\n\t\t}", "public function add_attributes( $attr_info_array )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t{\r\n\t\t\r\n\t\t\t$this->errno = DB_OK;\r\n\t\t\r\n\t\t\tif ( $this->cat_id == -1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tSuch category hasn't been created\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_ID;\r\n\t\t\t\treturn ;\r\n\t\t\t}\t\t\r\n\t\t\r\n\t\t\tif ( count ( $attr_info_array ) == 0 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tat least one attribute is mandatory\r\n\t\t\t\treturn WRONG_INPUT;\t\t\r\n\t\t\r\n\t\t\t$this->con->query(\"START TRANSACTION;\");\r\n\t\t\r\n\t\t\t$id = $this->insert_attributes ( $attr_info_array );\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tif ( $this->errno != DB_OK )\r\n\t\t\t{\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->con->query(\"COMMIT;\");\t\r\n\r\n\t\t\tif ( count ( $attr_info_array ) == 1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\treturns the first attribute's id\r\n\t\t\t\treturn $id;\r\n\t\t}" ]
[ "0.72273797", "0.6720254", "0.6456853", "0.6435644", "0.62808985", "0.62446797", "0.6172487", "0.61095035", "0.61095035", "0.6105817", "0.6029101", "0.60069907", "0.5965965", "0.5965965", "0.5965965", "0.5908778", "0.5883147", "0.58188796", "0.5810554", "0.5805374", "0.5783107", "0.57788867", "0.5777202", "0.57525396", "0.5751568", "0.57377714", "0.5713052", "0.5707306", "0.57048184", "0.5691634", "0.56807643", "0.5675555", "0.5668946", "0.56569934", "0.56304824", "0.561016", "0.5603273", "0.5601038", "0.55997616", "0.5598834", "0.55960196", "0.55838674", "0.55701375", "0.5564748", "0.5561253", "0.5527524", "0.5527524", "0.5520244", "0.55093086", "0.54974353", "0.5469794", "0.54691905", "0.54588443", "0.5455428", "0.5454442", "0.5444904", "0.5435223", "0.54253507", "0.5424982", "0.542405", "0.54186815", "0.540563", "0.53935856", "0.5393151", "0.5392958", "0.53849703", "0.53557694", "0.5348847", "0.53485346", "0.5342736", "0.53418154", "0.533841", "0.5330701", "0.5323269", "0.5317919", "0.5312082", "0.53045565", "0.52913296", "0.5287423", "0.528524", "0.52812696", "0.5277502", "0.5276382", "0.52741057", "0.5267783", "0.52631766", "0.5262096", "0.5254275", "0.5250372", "0.52495354", "0.5247713", "0.5232743", "0.521949", "0.52171326", "0.521513", "0.5209448", "0.5202806", "0.5202495", "0.52017987", "0.5194766" ]
0.68916047
1
Remove a class from an attributes "class" field
public static function removeClass(array $attributes, string $class = ''): array { $attributes['class'] = CSS::removeClass($attributes['class'] ?? '', $class); return $attributes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeClassName(string $class): void {\n\t\t$classes =& $this->m_attributes[\"class\"];\n\n\t\twhile(false !== ($i = array_search($class, $classes))) {\n\t\t\tarray_splice($classes, $i, 1);\n\t\t}\n\t}", "public function remove_class( $class = null ) {\n\t\n\t\tif ( !is_string( $class ) ) return;\n\t\t\n\t\t$this->classes = Halp::_remove_class( $class, $this->classes );\n\t\n\t}", "public function removeClass($element, $class) {\n $newClass = trim(preg_replace(\"/ *(?:$class)/i\", '', $element->getAttribute('class')));\n if ($newClass != '') {\n $element->setAttribute('class', $newClass);\n } else {\n $element->removeAttribute('class');\n }\n }", "function _wp_post_thumbnail_class_filter_remove($attr)\n {\n }", "public function remove_class($class_name)\n {\n }", "public function remove($class)\n {\n if ( ! $this->has($class))\n return $this;\n\n $class = trim($class);\n\n return $this->setValue(\n array_diff($this->all(), [$class])\n );\n }", "public function removeExtraClass($class)\n {\n //split at white space\n $classes = preg_split('/\\s+/', $class ?? '');\n foreach ($classes as $class) {\n //unset one by one\n unset($this->extraClasses[$class]);\n }\n return $this;\n }", "function setClass($a_class)\n\t{\n\t\tif (is_object($this->mob_node))\n\t\t{\n\t\t\t$mal_node = $this->mob_node->first_child();\n\t\t\tif (is_object($mal_node))\n\t\t\t{\n\t\t\t\tif (!empty($a_class))\n\t\t\t\t{\n\t\t\t\t\t$mal_node->set_attribute(\"Class\", $a_class);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($mal_node->has_attribute(\"Class\"))\n\t\t\t\t\t{\n\t\t\t\t\t\t$mal_node->remove_attribute(\"Class\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "final public function __unset($class) {\n\t\t$this->detachObject($class);\n\t}", "public function removeClass($name) {\n\t\tif( isset($this->attributes[\"class\"][$name]) ) {\n\t\t\tunset($this->attributes[\"class\"][$name]);\n\t\t}\n\t\treturn $this;\n\t}", "private function removeAttribute( $attr )\n {\n if (isset($this->attributeTypes[$attr]) || array_key_exists($attr, $this->attributeTypes))\n unset( $this->attributeTypes[$attr] ); // forma de remover un valor de un array...\n }", "function rocket_lazyload_exclude_class( $attributes ) {\n\t$attributes[] = 'class=\"custom-logo\"';\n // custom-logo\n\n\treturn $attributes;\n}", "public function removeClass($class)\n {\n $classes = $this->get('class');\n if ($classes) {\n $classes = trim(preg_replace('/(^| ){1}' . $class . '( |$){1}/i', ' ', $classes));\n $this->set('class', $classes);\n }\n\n return $this;\n }", "function admin_bar_class($attributes)\n{\n $attributes['class'] = trim('admin-bar '.$attributes['class']);\n return $attributes;\n}", "private function computeClassAttribute(): void\n {\n $classes = $this->options['class'] ?? null;\n $paramClasses = $this->getRenderer()->getParam('class');\n\n if (null !== $classes || null !== $paramClasses) {\n $this->attributes['class'] = array_merge(\n $this->attributes['class'],\n $classes !== null ? is_array($classes) ? $classes : explode(' ', $classes) : [],\n $paramClasses !== null ? is_array($paramClasses) ? $paramClasses : explode(' ', $paramClasses) : []\n );\n }\n }", "public function removeClass($var, $class)\n {\n $str = $this->getAttr($var, 'class');\n $str = preg_replace('/(' . $class . ')\\s?/', '', trim($str));\n $this->setAttr($var, 'class', $str);\n return $this;\n }", "public function class_remove($cid, $uinfoArray)\n\t{\n\t\t$e107 = e107::getInstance();\n\t\t$uc_sql = new db;\n\t\tforeach($uinfoArray as $uid => $curclass)\n\t\t{\n\t\t\t$newarray = array_diff(explode(',', $curclass), array('', $cid));\n\t\t\t$new_userclass = implode(',', $newarray);\n\t\t\t$uc_sql->db_Update('user', \"user_class='\".$e107->tp->toDB($new_userclass, true).\"' WHERE user_id=\".intval($uid));\n\t\t}\n\t}", "public function removeExtraClass($class)\n {\n $classes = preg_split('/\\s+/', $class);\n\n $extra = $this->getExtraClasses();\n\n foreach ($classes as $class) {\n unset($extra[$class]);\n }\n\n $this->extraClasses = $extra;\n\n return $this;\n }", "public function delColgroupClass($class)\n {\n if (is_array($class)) {\n $this->html_colgroup_class = array_diff($this->html_colgroup_class, $class);\n } elseif (is_string($class)) {\n $this->html_colgroup_class = array_diff($this->html_colgroup_class, [$class]);\n }\n }", "function remove_image_alignment( $attributes ) {\n $attributes['class'] = str_replace( 'alignleft', 'alignnone', $attributes['class'] );\n\treturn $attributes;\n}", "function be_remove_image_alignment( $attributes ) {\r\n $attributes['class'] = str_replace( 'alignleft', 'aligncenter', $attributes['class'] );\r\n\treturn $attributes;\r\n}", "public function removeAttributes()\n\t{\n\t\tforeach ($this->argsArray(func_get_args()) as $a) {\n\t\t\t$this->removed_attrs[] = $a;\n\t\t}\n\t}", "private static function add_class($attributes, $class) {\n if(isset($attributes['class'])) {\n $attributes['class'] .= ' '.$class;\n } else {\n $attributes['class'] = $class;\n }\n return $attributes;\n }", "private function clean_class() {\n $className = get_class($this);\n\n if ($pos = strrpos($className, '\\\\')) {\n return substr($className, $pos + 1);\n }\n\n return $className;\n }", "public function setClassOff($class)\n {\n $this->classOff = $class;\n return $this;\n }", "public static function stripClassType($className)\n {\n return preg_replace('/^(.*)[A-Z][^A-Z]+$/', '$1', $className);\n }", "function flexfour_remove_sticky_class($classes) {\n$classes = array_diff($classes, array(\"sticky\"));\nreturn $classes;\n}", "public function remove_attribute(string $attribute){\n foreach($this -> attributes as $key => $value){\n if($value -> get_name() === $attribute){\n array_splice($this -> attributes, $key, 1);\n }\n }\n }", "public function clearClass() {\n \t$this->_class = [];\n \treturn $this;\n }", "public function remove_attr($type){\n\t\tif(isset($this->attr[$type])){\n\t\t\tunset($this->attr[$type]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function unShare($class)\n {\n if (array_key_exists($class, $this->stack)) {\n $this->__unset($class);\n }\n }", "function omega_enforce_attributes(&$variables) {\n // Copy over the classes array into the attributes array.\n if (!empty($variables['classes_array'])) {\n $variables['attributes_array']['class'] = !empty($variables['attributes_array']['class']) ? array_merge($variables['attributes_array']['class'], $variables['classes_array']) : $variables['classes_array'];\n $variables['attributes_array']['class'] = array_unique($variables['attributes_array']['class']);\n }\n\n // Sync that with the classes array. Remember: We don't recommend using it.\n if (!empty($variables['attributes_array']['class'])) {\n $variables['classes_array'] = $variables['attributes_array']['class'];\n }\n}", "public static function RemoveClass($class, $element) {\n\n return 'Html.RemoveClass(\\'' . $element . '\\',\\'' . $class . '\\');';\n }", "function PREFIX_remove_page_class_from_post_class($classes) {\n\t$classes = array_diff( $classes, array(\"page\") );\n\n\treturn $classes;\n}", "public function removeAllAttributes()\n {\n $this->attr = [];\n }", "public function setClass($class)\n {\n $this->class = str_replace(array('/', '.'), '', $class);\n }", "function studiare_get_class_attribute($value) {\n\treturn studiare_get_inline_attr($value, 'class', ' ');\n}", "function sanitize_html_class($classname, $fallback = '')\n {\n }", "function lesson_importppt_isolate_class($string) {\n if($class = strstr($string, 'class=')) { // first step in isolating the class\n $class = substr($class, strpos($class, '=')+1); // this gets rid of <div blawblaw class= there are no \"\" or '' around the class name ...sigh...\n if (strstr($class, ' ')) {\n // spaces found, so cut off everything off after the first space\n return substr($class, 0, strpos($class, ' '));\n } else {\n // no spaces so nothing else in the div tag, cut off the >\n return substr($class, 0, strpos($class, '>'));\n }\n } else {\n // no class defined in the tag\n return '';\n }\n}", "protected function splitClass($class) {\n\n // make an array from $class\n $exlodeClass = explode(\"\\\\\", $class);\n\n // Delete the value with nothing, with the length = 0\n $deleteValue = array('');\n $cleanExplode = array_filter($exlodeClass, function($value) use ($deleteValue) {\n return !(in_array($value, $deleteValue, true));\n });\n \n return $cleanExplode[count($cleanExplode)-1];\n }", "public function removeExtAddon($classname);", "public function setClass($class);", "public function remove_attribute($name)\n {\n }", "function doop_sanitize_html_class_param( $class ) {\n $classes = ! empty( $class ) ? explode( ' ', $class ) : [];\n $sanitized = [];\n if ( ! empty( $classes ) ) {\n $sanitized = array_map( function( $cls ) {\n return sanitize_html_class( $cls );\n }, $classes );\n }\n return implode( ' ', $sanitized );\n }", "abstract public function removeAttribute($name, $domain = '');", "public function remove_meta_data(string $class, array $primary_index): void\n {\n //it is expected to be called - do nothing\n }", "function ea_clean_nav_menu_classes( $classes ) {\n\tif( ! is_array( $classes ) )\n\t\treturn $classes;\n\n\tforeach( $classes as $i => $class ) {\n\n\t\t// Remove class with menu item id\n\t\t$id = strtok( $class, 'menu-item-' );\n\t\tif( 0 < intval( $id ) )\n\t\t\tunset( $classes[ $i ] );\n\n\t\t// Remove menu-item-type-*\n\t\tif( false !== strpos( $class, 'menu-item-type-' ) )\n\t\t\tunset( $classes[ $i ] );\n\n\t\t// Remove menu-item-object-*\n\t\tif( false !== strpos( $class, 'menu-item-object-' ) )\n\t\t\tunset( $classes[ $i ] );\n\n\t\t// Change page ancestor to menu ancestor\n\t\tif( 'current-page-ancestor' == $class ) {\n\t\t\t$classes[] = 'current-menu-ancestor';\n\t\t\tunset( $classes[ $i ] );\n\t\t}\n\t}\n\n\t// Remove submenu class if depth is limited\n\tif( isset( $args->depth ) && 1 === $args->depth ) {\n\t\t$classes = array_diff( $classes, array( 'menu-item-has-children' ) );\n\t}\n\n\treturn $classes;\n}", "public function removeAttribute($attribute)\n {\n array_forget($this->attributes, $attribute);\n\n $this->update();\n }", "public function set_sanitize_class($class = 'SimplePie_Sanitize')\n {\n }", "function removeBlacklistedAttributes($attribs) \n { \n $this->_html = preg_replace('/[\\s]+('.$attribs.')=[\\s]*(\"[^\"]*\"|\\'[^\\']*\\')/i',\"\",$this->_html); \n $this->_html = preg_replace('/[\\s]+('.$attribs.')=[\\s]*[^ |^>]*/i',\"\",$this->_html); \n }", "function wd_clean_nav_menu_classes( $classes ) {\n\tif( ! is_array( $classes ) )\n\t\treturn $classes;\n\tforeach( $classes as $i => $class ) {\n\t\t// Remove class with menu item id\n\t\t$id = strtok( $class, 'menu-item-' );\n\t\tif( 0 < intval( $id ) )\n\t\t\tunset( $classes[ $i ] );\n\t\t// Remove menu-item-type-*\n\t\tif( false !== strpos( $class, 'menu-item-type-' ) )\n\t\t\tunset( $classes[ $i ] );\n\t\t// Remove menu-item-object-*\n\t\tif( false !== strpos( $class, 'menu-item-object-' ) )\n\t\t\tunset( $classes[ $i ] );\n\t\t// Change page ancestor to menu ancestor\n\t\tif( 'current-page-ancestor' == $class ) {\n\t\t\t$classes[] = 'current-menu-ancestor';\n\t\t\tunset( $classes[ $i ] );\n\t\t}\n\t}\n\t// Remove submenu class if depth is limited\n\tif( isset( $args->depth ) && 1 === $args->depth ) {\n\t\t$classes = array_diff( $classes, array( 'menu-item-has-children' ) );\n\t}\n\treturn $classes;\n}", "public function __unset($name) {\n\t\tif ($this->hasAttribute($name))\n\t\t\tunset($this->_attributes[$name]);\n\t\telse\n\t\t\tparent::__unset($name);\n\t}", "function Html_CSS_Reset(&$options)\n {\n $options[ \"CLASS\" ]=\"\";\n }", "protected function prepareForValidation($attributes)\n {\n $attributes['class'] = $this->sanitizeCode($attributes['class']);\n\n return $attributes;\n }", "function gymfitness_a_class($atts,$item,$args) {\n \n $atts['class'] = 'nav-link pl-3 pr-3';\n \n return $atts;\n}", "public static function unsanitiseClassName($class)\n {\n return str_replace('-', '\\\\', $class);\n }", "function sanitize_html_classes( $class, $fallback = null ) {\n if ( is_string( $class ) ) {\n $class = explode(\" \", $class);\n }\n\n if ( is_array( $class ) && count( $class ) > 0 ) {\n $class = array_map(\"sanitize_html_class\", $class);\n return implode(\" \", $class);\n }\n else {\n return sanitize_html_class( $class, $fallback );\n }\n }", "function organique_woo_body_class( $classes ) {\n\t\t$classes = (array) $classes;\n\t\t$class_to_remove = 'woocommerce';\n\n\t\tif ( in_array( $class_to_remove, $classes ) ) {\n\t\t\tunset( $classes[ array_search( $class_to_remove, $classes ) ] );\n\t\t}\n\n\t\treturn $classes;\n\t}", "function strip_empty_classes($menu)\n{\n $menu = preg_replace('/ class=\"\"| class=\"sub-menu\"/', '', $menu);\n return $menu;\n}", "public function setClass(string $class_name);", "function runkit_method_remove($classname, $methodname)\n{\n}", "function filter_post_classes( array $classes, array $class, int $id ) : array {\n\t$filtered = array_values(\n\t\tarray_filter(\n\t\t\t$classes,\n\t\t\tfunction ( string $cls ) : bool {\n\t\t\t\treturn ! in_array( $cls, [ 'hentry' ], true );\n\t\t\t}\n\t\t)\n\t);\n\treturn $filtered;\n}", "private function removePdeAlgorithm($className) {\n $deleted = false;\n $xmlFile = $this->getXmlFile();\n $doc = new DOMDocument;\n $stringXml = file_get_contents($xmlFile);\n $doc->loadXML($stringXml);\n $valid = $doc->validate();\n if ($valid) {\n $node = $doc->getElementById($className);\n }\n if ($valid && $node) {\n $pnode = $node->parentNode;\n $node = $pnode->removeChild($node);\n $deleted = $node != null;\n if ($deleted) {\n $doc->formatOutput = TRUE;\n $saved = $doc->save($xmlFile);\n }\n } else {\n $deleted = FALSE;\n }\n return $deleted && $saved;\n }", "public function __unset($name)\n\t{\n\t\tif(isset($this->_attributes[$name]))\n\t\t\tunset($this->_attributes[$name]);\n\t\telse\n\t\t\tparent::__unset($name);\n\t}", "public function remove_attributes( $id_array )\t\t\r\n\t\t{\r\n\t\t\t$this->errno = DB_OK;\r\n\r\n\t\t\tif ( $this->cat_id == -1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tSuch category hasn't been created\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_ID;\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$id_length = 0; \r\n\t\r\n\t\t\tif ( isset ( $id_array ) )\r\n\t\t\t\t$id_length = count ( $id_array );\r\n\t\t\t\t\r\n\t\t\tif ( $id_length == 0 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthe existance of at least one attribute is mandatory\r\n\t\t\t\treturn WRONG_INPUT;\t\t\r\n\t\t\t\r\n\t\t\t$this->con->query(\"START TRANSACTION;\");\r\n\t\t\t\r\n\t\t\tfor ( $i = 0; $i < $id_length; $i++ )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tfilling the database attribute attribute\r\n\t\t\t{\r\n\t\t\t\t$attr = new attribute( $this->con, $id_array[$i], $this->cat_id );\r\n\t\t\t\t\r\n\t\t\t\tif ( ( $this->errno = $attr->get_errno() ) != DB_OK )\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t\treturn ;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$attr->remove_attribute();\r\n\t\t\t\t\r\n\t\t\t\tif ( ( $this->errno = $attr->get_errno() ) != DB_OK )\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t\treturn ;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t$this->con->query(\"COMMIT;\");\r\n\t\r\n\t\t}", "function stripNamespace(string $class): string\n {\n return splitNamespace($class)[1];\n }", "function getAttributeClass( $attribute )\r\n\t{\r\n\t\treturn $this->object->getAttributeObject( $attribute );\r\n\t}", "function biClass($tag, $renameTags){\n preg_match_all('/class[=\"]+([\\w]+)/i', $tag, $tagRow);\n if(isset($tagRow[1][0])){\n $biClass = $tagRow[1][0];\n if(isset($renameTags->$biClass)){\n return $biClass;\n }\n }\n\n}", "public function clearAttributes ()\n {\n\n $this->attributes = null;\n $this->attributes = array();\n\n }", "public static function getClassWithoutNamespace($class)\n {\n $parts = explode(\"\\\\\", $class);\n return array_pop($parts);\n }", "function add_class_thumbnail($attr) {\n remove_filter('wp_get_attachment_image_attributes','add_class_thumbnail');\n $attr['class'] .= ' img-fluid';\n return $attr;\n}", "public function __unset($name)\n {\n // Dont' allow to unset attributes Ruts\n }", "public function setClass($class){\n $this->_class = $class;\n }", "function add_nolazy_class($attr) {\n remove_filter('wp_get_attachment_image_attributes', 'add_nolazy_class');\n $attr['class'] .= ' no-lazy';\n return $attr;\n}", "public function normalise_classes($classList)\n\t{\n\t\tif (is_array($classList))\n\t\t{\n\t\t\t$asArray = TRUE;\n\t\t\t$oldClasses = $classList;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$asArray = FALSE;\n\t\t\t$oldClasses = explode(',',$classList);\n\t\t}\n\t\t$dropClasses = array();\n\t\tforeach ($oldClasses as $c)\n\t\t{ // Look at our parents (which are in 'userclass_accum') - if any of them are contained in oldClasses, we can drop them.\n\t\t\t$tc = array_flip(explode(',',$this->class_tree[$c]['userclass_accum']));\n\t\t\tunset($tc[$c]);\t\t// Current class should be in $tc anyway\n\t\t\tforeach ($tc as $tc_c => $v)\n\t\t\t{\n\t\t\t\tif (in_array($tc_c,$oldClasses))\n\t\t\t\t{\n\t\t\t\t\t$dropClasses[] = $tc_c;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$newClasses = array_diff($oldClasses,$dropClasses);\n\t\tif ($asArray) { return $newClasses; }\n\t\treturn implode(',',$newClasses);\n\t}", "public function testChosenClassAttribute()\n {\n $class = $this->Chosen->getSetting('class');\n $dom = new DomDocument();\n $html = $this->getSelectInput();\n $dom->loadHTML($html);\n $select = $dom->getElementsByTagName('select')->item(0);\n $this->assertNotNull($select);\n $this->assertInstanceOf('DOMElement', $select);\n $this->assertEqual($class, $select->getAttribute('class'));\n\n // Adding a class to the options array should not remove the chosen class\n $customClass = 'my-custom-class';\n $dom = new DomDocument();\n $html = $this->getSelectInput(array('class' => $customClass));\n $dom->loadHTML($html);\n $select = $dom->getElementsByTagName('select')->item(0);\n $this->assertNotNull($select);\n $this->assertInstanceOf('DOMElement', $select);\n $this->assertEqual(\"{$customClass} {$class}\", $select->getAttribute('class'));\n }", "function filter_post_class($classes, $class, $post_id) {\n\t$classes[] = 'entry';\n\t$classes = array_filter($classes, function($class_name){\n\t\t// use !== 0 to ensure we match hentry at begining of string\n\t\treturn strpos($class_name, 'hentry') !== 0;\n\t});\n\n\treturn $classes;\n}", "function remove_attachment_title_attr( $attr ) {\n\tunset($attr['title']);\n\treturn $attr;\n}", "public function setClass($class) {\r\n\t$this->class = $class;\r\n }", "public function removeAttribute($key)\n {\n $key = strtolower($key);\n unset($this->attr[$key]);\n }", "protected function _removeClassNames($classNames)\n {\n if (!is_array($classNames)) {\n $classNames = [ $classNames ];\n }\n\n $classes = array_diff($this->_getClassNames(), $classNames);\n\n $this->setAttrib('class', trim(implode(' ', $classes)));\n }", "function montheme_link_class($attr)\n{\n $attr['class'] = 'nav-link';\n\n return $attr;\n}", "function desceEstilo($classe, $estilo)\n {\n if (! $this->layer) {\n return \"erro\";\n }\n $classe = $this->layer->getclass($classe);\n $classe->movestyledown($estilo);\n $this->layer->removeMetaData(\"cache\");\n return true;\n }", "public function removeElementsByClassName($className, $tag = '*', $node = null) {\n\n if ($node == null) {\n $node = $this;\n }\n $elements = $node->getElementsByClassName($className, $tag);\n /** @var DOMNode $element */\n foreach ($elements as $element) {\n $element->parentNode->removeChild($element);\n }\n\n }", "function studiare_class_attribute($value) {\n\techo studiare_get_class_attribute($value);\n}", "public function addClassName(string $class): void {\n\t\t$this->m_attributes[\"class\"][] = $class;\n\t}", "public function unsetAllAttributeValue()\n {\n foreach ($this->attributes as $key=>$val) {\n $this->$key = null;\n }\n }", "function _wp_post_thumbnail_class_filter_add($attr)\n {\n }", "public function clear($className = null);", "function delete_class_files($dir) {\n global $verbose;\n \n $all_files = scandir($dir);\n foreach ( $all_files as $f ) {\n if ( preg_match('#\\.class\\.php$#i', $f) || preg_match('#\\.map\\.inc\\.php$#i', $f)) {\n if ( unlink(\"$dir/$f\") ) {\n if ($verbose) {\n print_msg( sprintf('<br/>Deleted file: <code>%s/%s</code>',$dir,$f) );\n }\n }\n else {\n print_msg( sprintf('<br/>Failed to delete file: <code>%s/%s</code>',$dir,$f) );\n }\n }\n }\n}", "protected static function dropCache($class, $arguments) {\n global $daToCacheMappings;\n \n if (isset($daToCacheMappings[$class])) {\n foreach ($daToCacheMappings[$class] as $method => $keyFamily) {\n $keyParams = new Fwk\\cacheKeyParameters(false);\n foreach ($arguments as $arg) {\n $keyParams->addParam($arg);\n }\n Fwk\\cache::del($keyFamily, $keyParams);\n }\n }\n }", "function wd_clean_post_classes( $classes ) {\n\tif( ! is_array( $classes ) )\n\t\treturn $classes;\n\t$allowed_classes = array(\n \t\t'hentry',\n \t\t'type-' . get_post_type(),\n \t);\n\treturn array_intersect( $classes, $allowed_classes );\n}", "public function set_restriction_class($class = 'SimplePie_Restriction')\n {\n }", "public function strip_empty_classes($menu) {\n\t\t$menu = preg_replace('/ class=\"\"| class=\"sub-menu\"/','',$menu);\n\t\treturn $menu;\n\t}", "public function setClass($class){\n $this->class=$class;\n }", "public function setClassName(string $class): void {\n\t\t$this->setAttribute(\"class\", [$class]);\n\t}", "function hidrate ($className)\n {\n $this->A = array_hidrate ($this->A, $className);\n return $this;\n }", "function rem_custom_menu_items( $string, $custom_classes ) {\n $string = str_replace( \n 'class=\"menu-item ', \n 'class=\"' . join( ' ', $custom_classes ) . ' menu-item ', \n $string \n );\n\n return $string;\n}", "public function removeTagAttributes($tag)\n\t{\n\t\t$args = $this->argsArray(func_get_args());\n\t\tarray_shift($args);\n\t\t\n\t\tforeach ($args as $a) {\n\t\t\t$this->removed_tag_attrs[$tag][] = $a;\n\t\t}\n\t}", "private function reworkClassName() {\n $className = $this->className;\n\n if ( (is_array($className) && (count($className) == 0)) || (is_string($className) && (strlen($className) == 0)) ) {\n $this->className = array();\n return;\n }\n\n $arr = self::goodSplit($className, '::');\n // If this array > 2 elements: it's a subclass [example: OmsEvent::Account::Account]\n $this->className = $arr;\n if ( count($this->className) > 1 ) {\n $this->functionName = array_pop($this->className);\n }\n }" ]
[ "0.7434001", "0.6899663", "0.67737514", "0.6621767", "0.66172886", "0.642628", "0.63793886", "0.63396084", "0.6322687", "0.62766904", "0.6256748", "0.61204183", "0.6068338", "0.60415953", "0.60201555", "0.60154986", "0.5968506", "0.59184235", "0.58833253", "0.58758694", "0.5867536", "0.58638257", "0.5811224", "0.57638633", "0.5719539", "0.5709412", "0.56778234", "0.5674731", "0.5629807", "0.5625758", "0.5615645", "0.55837977", "0.55646366", "0.5555821", "0.5535585", "0.5511206", "0.5502944", "0.5498598", "0.54573065", "0.54166716", "0.5406917", "0.53992146", "0.5381477", "0.5377908", "0.5371699", "0.53638566", "0.5296759", "0.5284864", "0.528088", "0.5278606", "0.5275608", "0.5269193", "0.5255256", "0.52438915", "0.52397734", "0.5222667", "0.52157474", "0.5213629", "0.5209104", "0.52023625", "0.5191619", "0.51898986", "0.5185564", "0.5185474", "0.51837236", "0.5180103", "0.51800656", "0.516664", "0.5166447", "0.51606333", "0.51581573", "0.51568013", "0.51543576", "0.5152921", "0.5139406", "0.5128269", "0.51235527", "0.50996625", "0.50944525", "0.5084259", "0.5074214", "0.5066517", "0.5061701", "0.5050587", "0.50495404", "0.5039467", "0.5035057", "0.5034753", "0.5032571", "0.50290495", "0.5025002", "0.50248003", "0.50163144", "0.5015784", "0.5002023", "0.49939275", "0.49915323", "0.498578", "0.49719954", "0.49719235" ]
0.66380715
3
Convert attributes into a string easily appended after a tag
public static function attributes(array $attributes): string { $result = []; foreach ($attributes as $name => $value) { if ($value === null || $value === false) { continue; } if ($value === true) { $value = $name; } if (is_object($value)) { $value = method_exists($value, '__toString') ? $value->__toString() : strval($value); } if (!is_numeric($name)) { $result[] = strtolower($name) . '="' . self::specials(strval($value)) . '"'; } } if (count($result) === 0) { return ''; } return ' ' . implode(' ', $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAttribs(): string {\n\n $attribs = '';\n\n foreach ($this->attributes as $key => $value) {\n $key = strtolower($key);\n if ($value) {\n if ($key == 'value') {\n if (is_array($value)) {\n foreach ($value as $k => $i) {\n $value[$k] = htmlspecialchars($i);\n }\n }\n else {\n $value = htmlspecialchars($value);\n }\n }\n elseif ($key == 'href') {\n // For security reasons, we escape the values! They could be user-supplied hence skeptical.\n $value = urlencode($value);\n }\n $attribs .= $key . '=\"' . $value . '\" ';\n }\n else {\n $attribs .= $key . ' ';\n }\n }\n return trim($attribs);\n }", "function attributer($attributes){\n\t$output = '';\n\tforeach ($attributes as $attribute => $value) {\n\t \tif(is_array($value)){ //breaks down any array into a string\n\t \t\tswitch ($attribute) {\n\t \t\t\tcase 'class': \t$output .= 'class=\"'.implode(' ', $value).'\" '; break;\n\t \t\t\tcase 'onclick': $output .= $value.'()'; break;\n\t \t\t\tcase 'data': \tforeach ($value as $name=>$val) { $output .= 'data-'.$key.'= \"'.$val.'\" '; } break;\t \t\t\t\n\t \t\t\tdefault: \t\t$output .= $attribute.' '; break;\n\t \t\t}\t \t\t \n\t \t}\n\t \telse{ $output .= ' '.$attribute.'=\"'.$value.'\" ';\t} \t\n\t}\n\treturn $output;\n}", "public function renderTagAttributes(){\n $row = '';\n foreach($this->tag_attributes as $key => $attribute)\n $row .= \"$key=\\\"$attribute\\\" \";\n return $row;\n }", "function esc_attrs(array $attributes, $startWithSpace = true) {\n $pairs = [];\n foreach ($attributes as $name => $value) {\n if (is_int($name)) {\n $pairs[] = $value;\n } else {\n $pairs[] = $name.'=\"'.esc_attr($value).'\"';\n }\n }\n $prefix = !empty($pairs) && $startWithSpace ? ' ' : '';\n return $prefix.join(' ', $pairs);\n }", "protected function getAttributes() : string\n {\n $content = '';\n foreach ($this->attributes as $key => $value) {\n $content .= $key.'=\"'.$value.'\" ';\n }\n\n return trim($content);\n }", "protected function attributesToString()\n {\n $string = '';\n $XMLConvention = in_array(\n static::$outputLanguage,\n array(ENT_XML1, ENT_XHTML)\n );\n if (!empty($this->attributeList)) {\n foreach ($this->attributeList as $key => &$value) {\n if ($value !== null\n && ($value!==false\n || $XMLConvention)\n ) {\n $string .= sprintf(\n ' %s',\n $key\n );\n if ($value === true) {\n if ($XMLConvention) {\n $value = $key;\n } else {\n continue;\n }\n }\n $string .= sprintf(\n '=\"%s\"',\n implode(\n ' ',\n array_map(\n (\n static::$avoidXSS ?\n 'static:unXSS' :\n 'strval'\n ),\n (\n is_array($value) ?\n $value :\n array($value)\n )\n )\n )\n );\n }\n }\n }\n return $string;\n }", "public function attributeToString($attrs) {//{{{\n $html = array();\n if (empty($attrs)) return \"\";\n $n = $attrs->length;\n for ($i = 0 ;$i < $n; $i++) {\n $attr = $attrs->item($i);\n if ($attr->value == \"-\") {\n $html[] = $attr->name;\n } else {\n $html[] = $attr->name . \"=\\\"\" . $attr->value . \"\\\"\";\n }\n }\n if (empty($html)) return \"\";\n\n return \" \" . implode(\" \", $html);\n }", "protected function attrsToString()\n {\n $string = NULL;\n $this->prepareAttrs();\n foreach ($this->attrs as $attr => $value) {\n $string .= \"$attr=\\\"$value\\\" \";\n }\n return $string;\n }", "function tag_attributes($attributes)\n{\n if (is_string($attributes)) {\n $toProcess['name'] = $attributes;\n $toProcess['id'] = $attributes;\n } else {\n //don't allow 'value' to be set specifically as an attribute (why = consistency)\n unset($attributes['value']);\n $toProcess = $attributes;\n }\n\n $attr = array();\n foreach ($toProcess as $key => $attribute) {\n // Reject weird attribute names (a little more restrictively than necessary)\n if (preg_match('/[^A-Za-z0-9_:.-]/', $key)) {\n continue;\n }\n if (is_string($attribute)) {\n $attr[$key] = $key . '=\"' . html_escape($attribute) . '\"';\n } elseif ($attribute === true) {\n $attr[$key] = $key;\n }\n }\n return join(' ', $attr);\n}", "static function get_html_attributes( $attributes ) {\n $attr = '';\n foreach ( $attributes as $key => $value ) {\n if ( !is_null( $value ) ) {\n $attr .= \" data-$key='$value'\";\n }\n }\n return $attr;\n }", "private function attributes($attributes) {\n\t\t$attr = null;\n\t\tif (is_array($attributes)) {\n\t\t\tforeach ($attributes as $key=>$val) {\n\t\t\t\t$attr .= ' '.$key.'=\"'.$val.'\"';\n\t\t\t}\n\t\t} else {\n\t\t\t$attr .= ' '.$attributes;\n\t\t}\n\n\t\treturn $attr;\n\t}", "protected function getAttributesString()\n {\n $result = '';\n ksort($this->props);\n foreach ($this->props as $k => $v) {\n if (substr($k, 0, 1) !== '_') {\n if ($v === true) {\n $result .= $k . ' ';\n } else {\n $result .= $k . '=\"' . $this->escapeAttr($v) . '\" ';\n }\n }\n }\n if ($result) {\n $result = ' ' . trim($result);\n }\n\n return $result;\n }", "function concat_attr() {\n $str = \"\";\n if ($this->other_attr != NULL) {\n foreach($this->other_attr as $field => $value) {\n $str .= $field.'=\"'.$value.'\" ';\n }\n }\n return $str;\n }", "protected function getAttributesAsString() {\n\t\t\n\t\t$String = '';\n\t\tforeach ( $this->attributes as $Name => $Value )\n\t\t\t$String .= \"$Name=\\\"$Value\\\" \";\n\t\t\n\t\tif ( $this->Debug )\n\t\t\tDebugger::echoMessage( get_class() . '::getAttributesAsString() String=' .$String);\t\n\t\treturn $this->replaceSpecialChars( $String );\n\t\t\n\t}", "private function makeAttributes(array $options = null) : string\n {\n $attributes = '';\n if ($options === null) return $attributes;\n\n foreach ($options as $attribute => $value) {\n $attributes .= \"${attribute}=\\\"${value}\\\" \";\n }\n return $attributes;\n }", "protected function attributes(array $attributes)\n\t{\n\t\t$output = '';\n\n\t\tforeach($attributes as $attribute => $value)\n\t\t{\n\t\t\t$output .= ' '.$attribute.'=\"'.$value.'\"';\n\t\t}\n\n\t\treturn $output;\t\n\t}", "public static function attr($attributes = NULL)\n\t{\n\t\tif (empty($attributes))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t$final = '';\n\t\tforeach ($attributes as $key => $value)\n\t\t{\n\t\t\tif ($value === NULL)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$final .= ' '.$key.'=\"'.htmlspecialchars($value, ENT_QUOTES).'\"';\n\t\t}\n\n\t\treturn $final;\n\t}", "protected function emitAttributes(): string {\n\t\t$ret = \"\";\n\n\t\tforeach($this->m_attributes as $name => $attr) {\n\t\t\tif(!isset($attr) || (is_array($attr) && empty($attr))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$ret .= $this->emitAttribute($name, $attr);\n\t\t}\n\n\t\treturn $ret;\n\t}", "public function renderAttributeString()\n {\n $rendered = '';\n foreach ($this->attributes as $name => $value) {\n if ($name == 'name'\n && $this->hasAttribute('multiple')\n && substr($value, -2) != '[]'\n ) {\n $value .= '[]';\n }\n if (is_array($value)) {\n // arrays can be used for class attributes, space separated\n $set = '=\"' . htmlspecialchars(implode(' ', $value), ENT_QUOTES) .'\"';\n } elseif ($value===null) {\n // null indicates name only, like autofocus or readonly\n $set = '';\n } else {\n $set = '=\"' . htmlspecialchars($value, ENT_QUOTES) .'\"';\n }\n $rendered .= $name . $set . ' ';\n }\n return $rendered;\n }", "private function addAttribs($attr_ar)\n {\n $str = '';\n foreach ($attr_ar as $key => $val) {\n $str .= \" $key=\\\"$val\\\"\";\n }\n return $str;\n }", "function attributes($attributes = [])\n {\n $html = [];\n foreach ((array) $attributes as $key => $value) {\n if (is_numeric($key)) {\n $key = $value;\n }\n\n if (is_null($value)) {\n continue;\n }\n\n $html[] = $key . '=\"' . e($value) . '\"';\n }\n return count($html) > 0 ? ' '.implode(' ', $html) : '';\n }", "private function _assets_attributes($attributes)\n\t{\n\t\t$string = '';\n\t\t\n\t\tforeach($attributes as $name => $value)\n\t\t{\n\t\t\t$string .= $name . '=\"' . $value . '\" ';\n\t\t}\n\t\t\n\t\treturn $string;\n\t}", "public function __toString()\n {\n $attributes = '';\n\n if ($this->data) {\n ksort($this->data);\n foreach ($this->data as $name => $value) {\n $attributes .= \" $name=\\\"$value\\\"\";\n }\n }\n\n if ($this->tag) {\n return '<' . $this->tag . $attributes . (($this->selfclose) ? \" />\" : '>');\n }\n\n return $attributes;\n }", "public static function attributes($attrs) {\n\t\tif (empty($attrs))\n\t\t\treturn '';\n\n\t\tif (is_string($attrs))\n\t\t\treturn ' '.$attrs;\n\n\t\t$compiled = '';\n\t\tforeach ($attrs as $key => $val) {\n\t\t\t$compiled .= ' '.$key.'=\"'.$val.'\"';\n\t\t}\n\n\t\treturn $compiled;\n\t}", "public static function createAttrString($attr=null){\n\t\t$output = '';\n\t\tif(is_string($attr))parse_str($attr, $attr);\n\t\tif(is_null($attr))return '';\n\t\tforeach($attr as $key=>$value){\n\t\t\t$value = str_replace('\"', '\\\\\"', $value);\n\t\t\tif(is_null($value) or empty($value))$output .= (' '.$key);\n\t\t\telse $output .= (' '.$key.'=\"'.$value.'\"');\n\t\t}\n\t\treturn trim($output);\n\t}", "private static function expandAttributes( array $attribs ) {\n\t\t$ret = '';\n\t\tforeach ( $attribs as $key => $value ) {\n\t\t\tif ( $value === false ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( $value === true ) {\n\t\t\t\t$value = '';\n\t\t\t} elseif ( is_array( $value ) ) {\n\t\t\t\t$value = trim( join( ' ', $value ) );\n\t\t\t}\n\t\t\t$encoded = htmlspecialchars( $value, ENT_QUOTES );\n\t\t\t// PHP htmlspecialchars does not encode these by default:\n\t\t\t$encoded = strtr( $encoded, [\n\t\t\t\t\"\\n\" => '&#10;',\n\t\t\t\t\"\\r\" => '&#13;',\n\t\t\t\t\"\\t\" => '&#9;',\n\t\t\t] );\n\t\t\t$ret .= \" $key=\\\"$encoded\\\"\";\n\t\t}\n\t\treturn $ret;\n\t}", "public static function attributes($attrs)\n\t{\n\t\tif (empty($attrs))\n\t\t\treturn '';\n\n\t\tif (is_string($attrs))\n\t\t\treturn ' '.$attrs;\n\n\t\t$compiled = '';\n\t\tforeach($attrs as $key => $val)\n\t\t{\n\t\t\t$compiled .= ' '.$key.'=\"'.$val.'\"';\n\t\t}\n\n\t\treturn $compiled;\n\t}", "public function getAttrString(){\n\t\t$this->attrString = '';\n\t\tif(is_array($this->attr))\n\t\t\tarray_walk($this->attr, array($this, 'attrToString')); \n\t}", "public static function attributes($attributes) {\n\t\t$html = array();\n\n\t\tforeach ((array) $attributes as $key => $value) {\n\t\t\t// For numeric keys, we will assume that the key and the value are the\n\t\t\t// same, as this will convert HTML attributes such as \"required\" that\n\t\t\t// may be specified as required=\"required\", etc.\n\t\t\tif (is_numeric($key)) $key = $value;\n\n\t\t\tif ( ! is_null($value)) {\n\t\t\t\t$html[] = $key.'=\"'.static::entities($value).'\"';\n\t\t\t}\n\t\t}\n\n\t\treturn (count($html) > 0) ? ' '.implode(' ', $html) : '';\n\t}", "protected function _attributes($params, array $options = array()) {\n\t$defaults = array('escape' => true, 'prepend' => ' ', 'append' => '');\n\t$options += $defaults;\n\t$result = array();\n\n\tif (!is_array($params)) {\n\t return !$params ? '' : $options['prepend'] . $params;\n\t}\n\n\tforeach ($params as $key => $value) {\n\t if ($next = $this->_attribute($key, $value, $options)) {\n\t\t$result[] = $next;\n\t }\n\t}\n\treturn $result ? $options['prepend'] . implode(' ', $result) . $options['append'] : '';\n }", "function attributesToHtml($attributes) {\n $html='';\n if (is_array($attributes))\n foreach ($attributes as $attrName=>$attrValue) {\n $html.=' '.$attrName.'=\"'.$attrValue.'\"';\n } elseif(is_string($attributes))\n \t$html=$attributes;\n return $html;\n }", "public static function buildAttributes(array $options = array())\n {\n $attrs = '';\n\n foreach ($options as $key => $value) {\n if (is_string($key)) {\n $attrs .= $key.'=\"'.$value . '\" ';\n } else {\n $attrs .= $value . ' ';\n }\n }\n\n return $attrs;\n }", "public function __toString()\n {\n $attributes = [];\n foreach ($this->attributes as $key => $value) {\n // Make sure to transform arrays to json and esacpe the\n // output accordingly so we don't mess up the markup\n $value = is_array($value) ? json_encode($value) : e($value);\n\n $attributes[] = sprintf(\"data-item-%s='%s'\", $key, $value);\n }\n\n return implode(\" \", $attributes);\n }", "protected function renderAttributes()\n {\n $html = '';\n $no_key = ['loading'];\n\n foreach ($this->attributes as $key => $value) {\n if ($value === null) {\n continue;\n }\n\n if (is_numeric($key)) {\n $key = $value;\n }\n if (is_array($value)) {\n $value = implode(' ', $value);\n }\n\n if (in_array($key, $no_key, true)) {\n $element = htmlentities($value, ENT_QUOTES, 'UTF-8', false);\n } else {\n $element = $key . '=\"' . htmlentities($value, ENT_QUOTES, 'UTF-8', false) . '\"';\n }\n\n $html .= ' ' . $element;\n }\n\n return $html;\n }", "public static function attributes(array $attributes): string\n {\n $htmlAttributes = [];\n foreach ($attributes as $attributeName => $attributeValue) {\n $attributeValue = esc_attr($attributeValue);\n $htmlAttributes[] = \"$attributeName=\\\"$attributeValue\\\"\";\n }\n return implode(' ', $htmlAttributes);\n }", "protected function build()\r\n {\r\n $tag = array_shift($this->attributes);\r\n $content = implode('', $this->childs);\r\n if (empty($tag) || $tag == 'dummy') {\r\n return $content;\r\n }\r\n $spaces = $this->tagdep != 0 ? PHP_EOL.str_repeat(\" \",abs($this->tagdep)) : '';\r\n $strTag = $spaces.'<'.$tag;\r\n foreach ($this->attributes as $key => $value) {\r\n if (is_object($value) && !method_exists($value, '__toString')) {\r\n $strTag .= ' error=\"Attribute value is object ('.get_class($value).')\"';\r\n continue;\r\n }\r\n $strTag .= ' '.$key.'=\"'.htmlspecialchars($value, ENT_QUOTES).'\"';\r\n // la conversione del contentuto degli attributi viene fornita da Tag in modo\r\n // tale che non debba essere gestito dai suoi figli\r\n /*$strTag .= ' '.$key.'=\"'.$val.'\"';*/\r\n }\r\n $strTag .= '>';\r\n \r\n if (!in_array($tag, ['input', 'img', 'link', 'meta'])) {\r\n $strTag .= $content . ($this->tagdep < 0 ? $spaces : '') .\"</{$tag}>\";\r\n }\r\n return $strTag;\r\n }", "public function attributesToString($attributes)\n {\n if (is_string($attributes) && strlen($attributes) > 0) {\n\n $attributes = str_replace('\\'', '\"', $attributes); // convert to double quotes.\n\n if (strpos($attributes, 'method=') === false) {\n $attributes.= ' method=\"post\"';\n }\n if (strpos($attributes, 'accept-charset=') === false) {\n $attributes.= ' accept-charset=\"'.strtolower($this->charset).'\"';\n }\n return ' '.ltrim($attributes);\n }\n if (is_object($attributes) && count($attributes) > 0) {\n\n $attributes = (array)$attributes;\n }\n if (is_array($attributes) && count($attributes) > 0) {\n\n $atts = '';\n if (! isset($attributes['method'])) {\n $atts.= ' method=\"post\"';\n }\n if (! isset($attributes['accept-charset'])) {\n $atts.= ' accept-charset=\"'.strtolower($this->charset).'\"';\n }\n foreach ($attributes as $key => $val) {\n $atts.= ' '.$key.'=\"'.$val.'\"';\n }\n return $atts;\n }\n }", "private function _buildAttributes($attributes)\n\t{\n\t\t$attributeList = array();\n\t\tforeach($attributes as $attributeName => $attributeValue){\n\t\t\t$attributeList[] = $attributeName.'=\"'.$attributeValue.'\"';\n\t\t}\n\t\treturn implode(\" \",$attributeList);\n\t}", "function array_to_attrs($attrs)\n {\n $temp = array();\n foreach ($attrs as $name => $value) {\n $temp[] = $name . '=\"' . htmlspecialchars($value) . '\"';\n }\n return implode(' ', $temp);\n }", "private function _renderAttributes($attributes) {\n $html = \"\";\n if (count($attributes)) {\n foreach ($attributes as $attribute => $value) {\n $html .= \" {$attribute}=\\\"{$value}\\\" \";\n }\n }\n return trim($html);\n }", "public function createAttributesString(array $attributes)\n {\n $attributes = $this->prepareAttributes($attributes);\n $escape = $this->getEscapeHtmlHelper();\n $strings = array();\n foreach ($attributes as $key => $value) {\n $key = strtolower($key);\n if (!$value && isset($this->booleanAttributes[$key])) {\n // Skip boolean attributes that expect empty string as false value\n if ('' === $this->booleanAttributes[$key]['off']) {\n continue;\n }\n }\n\n //check if attribute is translatable\n if (isset($this->translatableAttributes[$key]) && !empty($value)) {\n if (($translator = $this->getTranslator()) !== null) {\n $value = $translator->translate(\n $value, $this->getTranslatorTextDomain()\n );\n }\n }\n\n //@TODO Escape event attributes like AbstractHtmlElement view helper does in htmlAttribs ??\n $strings[] = sprintf('%s=\"%s\"', $escape($key), $escape($value));\n }\n return implode(' ', $strings);\n }", "public static function attributesToString($attributes, $formtag = false)\n {\n if (is_string($attributes) && strlen($attributes) > 0) {\n if ($formtag == true && strpos($attributes, 'method=') === false) {\n $attributes .= ' method=\"post\"';\n }\n\n if ($formtag == true && strpos($attributes, 'accept-charset=') === false) {\n $attributes .= ' accept-charset=\"'.strtolower(Fly::getConfig('charset')).'\"';\n }\n\n return ' '.$attributes;\n }\n\n if (is_object($attributes) && count($attributes) > 0) {\n $attributes = (array)$attributes;\n }\n\n if (is_array($attributes) && count($attributes) > 0) {\n $atts = '';\n\n if (!isset($attributes['method']) && $formtag === true) {\n $atts .= ' method=\"post\"';\n }\n\n if (!isset($attributes['accept-charset']) && $formtag === true) {\n $atts .= ' accept-charset=\"'.strtolower(Fly::getConfig('charset')).'\"';\n }\n\n foreach ($attributes as $key => $val) {\n $atts .= ' '.$key.'=\"'.$val.'\"';\n }\n return $atts;\n }\n }", "private function HtmlAttributes($attributes)\r\n {\r\n $formatted = join(' ', array_map(function ($key) use ($attributes) {\r\n if (is_bool($attributes[$key])) {\r\n return $attributes[$key] ? $key : '';\r\n }\r\n return $key . '=\"' . $attributes[$key] . '\"';\r\n }, array_keys($attributes)));\r\n return $formatted;\r\n }", "public function getHtmlAttributes();", "public function __toString() {\n $str = \"<{$this->name} \";\n foreach ($this->attributes as $key => $val) {\n $str .= \"$key=\\\"$val\\\" \";\n }\n $str = rtrim($str) . \">\" . $this->value . \"</{$this->name}>\";\n\n return $str;\n }", "public function __toString()\n {\n\n $attributes = array();\n \n $tag = '<'.$this->name;\n \n $attr = array();\n \n foreach( $this->attributes as $key => $value ) \n {\n if ( is_array($value) )\n {\n $value = str_replace('\"', \"'\", json_encode($value));\n }\n \n $attr[] = $key.'='.'\"'.$value.'\"';\n }\n\n $attr = implode(' ',$attr);\n \n $tag .= ' '.$attr;\n \n if ( (isset($this->content) && !is_null($this->content)) || ($this->name == 'textarea'))\n {\n $tag .= '>'.$this->content.'</'.$this->name.'>';\n }\n else\n { \n $tag .= ' />';\n }\n \n return $tag;\n }", "protected function getHtmlAttributes($attributes) {\n\t\t$list = array();\n\t\tforeach ($attributes as $name=>$value) {\n\t\t\tif (!empty($value)) {\n\t\t\t\tif (is_scalar($value)) {\n\t\t\t\t\t$list[] = \"$name='\" . htmlentities($value, ENT_QUOTES, \"UTF-8\") . \"'\";\n\t\t\t\t} elseif (is_array($value)) {\n\t\t\t\t\t$list[] = $this->getHtmlAttributes($value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (count($list)>0) {\n\t\t\treturn \" \" . implode(\" \", $list);\n\t\t}\n\n\t\treturn \"\";\n\t}", "function ss_print_attributes($arr_data){\n\t\t$str_data = \"\";\n foreach ($arr_data as $key => $value) {\n \t$str_data .= $key.\"='\".$value.\"'\";\n }\n return $str_data;\n\t}", "public function moveHtmlAttributesToAdditionalArguments() {}", "static function serializeAttributes($map)\n {\n $s = \"\" ; foreach($map as $key=>$val) // implode map.\n {\n if (!empty($val))\n $s.= $key.\"=\\\"\".$val.\"\\\" \" ; // requote attributes\n }\n return $s ;\n }", "private function convertAttributes(array $attributes)\n {\n $output = '';\n\n foreach ($attributes as $name => $value) {\n // If $name is not set, then its a value-less attribute. (EG: 'async' and 'defer')\n if (is_int($name)) {\n $output .= \"$value \";\n } else {\n $output .= \"$name=\\\"$value\\\" \";\n }\n }\n\n return trim($output);\n }", "function acf_esc_attrs($attrs)\n{\n}", "public function build()\n\t{\n\t\t$result = '';\n\t\t$attrs = $this->getAll();\n\t\tforeach ($attrs as $attr => $value) {\n\t\t\tif (null === $value) {\n\t\t\t\t$result .= \"$attr \";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$result .= \"$attr=\\\"$value\\\" \";\n\t\t\t}\n\t\t}\n\n\t\treturn trim($result);\n\t}", "public function getHtmlAttributes() {}", "public function getHtmlAttributes() {}", "private static function parseAttrs($attrs) {\n\t\t$string = '';\n\n\t\tif (is_string($attrs)) {\n\t\t\t$attrs = ['class' => $attrs];\n\t\t}\n\n\t\tforeach ($attrs as $key => $val) {\n\t\t\tif (is_int($key)) {\n\t\t\t\t$string .= ' '.$val;\n\t\t\t} else {\n\t\t\t\t$string .= ' '.$key.'=\"'.$val.'\"';\n\t\t\t}\n\t\t}\n\n\t\treturn $string;\n\t}", "function attrs($props){\n return array_reduce(array_keys($props), function($res, $key) use ($props) {\n $res .= \"$key='$props[$key]'\";\n return $res;\n }, '');\n}", "public function language_attributes() {\n\t\t$attributes = [];\n\n\t\tif (is_rtl()) {\n\t\t\t$attributes[] = 'dir=\"rtl\"';\n\t\t}\n\n\t\t$lang = get_bloginfo('language');\n\n\t\tif ($lang) {\n\t\t\t$attributes[] = \"lang=\\\"$lang\\\"\";\n\t\t}\n\n\t\t$output = implode(' ', $attributes);\n\t\t$output = apply_filters('theme/language_attributes', $output);\n\n\t\treturn $output;\n\t}", "protected function convertAttribsToString($attribs)\n {\n $str = \"\";\n\n if (count($attribs) > 0)\n {\n foreach($attribs as $name=>$value)\n {\n if(strlen($value)>0)\n {\n $str .= sprintf( \"%s=\\\"%s\\\" \", $name, $value);\n }\n }\n }\n return trim($str);\n }", "public static function attributes( $slug, $attributes = [] ) {\n\n\t\t$out = '';\n\t\t$attr = apply_filters( \"fusion_attr_{$slug}\", $attributes );\n\n\t\tif ( empty( $attr ) ) {\n\t\t\t$attr['class'] = $slug;\n\t\t}\n\n\t\tforeach ( $attr as $name => $value ) {\n\t\t\tif ( empty( $value ) ) {\n\t\t\t\t$out .= ' ' . esc_html( $name );\n\t\t\t} else {\n\t\t\t\t$out .= ' ' . esc_html( $name ) . '=\"' . esc_attr( $value ) . '\"';\n\t\t\t}\n\t\t}\n\n\t\treturn trim( $out );\n\n\t}", "function studiare_get_inline_attr($value, $attr, $glue = '') {\n\tif(!empty($value)) {\n\n\t\tif(is_array($value) && count($value)) {\n\t\t\t$properties = implode($glue, $value);\n\t\t} elseif($value !== '') {\n\t\t\t$properties = $value;\n\t\t}\n\n\t\treturn $attr.'=\"'.esc_attr($properties).'\"';\n\t}\n\n\treturn '';\n}", "protected function renderAttributes(array $attributes)\n {\n $tmp = [];\n foreach ($attributes as $attr => $value) \n {\n if (strlen($value)) $tmp[] = $attr . '=\"' . (strpos($value, '<?') === false ? htmlspecialchars($value) : $value) . '\"';\n }\n return ' ' . implode(' ', $tmp);\n }", "private function _processAttributes($attributes){\r\n\r\n if(Help::isAssoc($attributes)){\r\n\r\n foreach($attributes as $key => $value){\r\n $attrs[] = $key.'('.$value.')';\r\n }\r\n }\r\n else{\r\n $attrs = $attributes;\r\n }\r\n\r\n return $attrs;\r\n }", "function language_attributes($doctype = 'html') {\n\t$attributes = array();\n\n\tif ( function_exists( 'is_rtl' ) && is_rtl() )\n\t\t$attributes[] = 'dir=\"rtl\"';\n\n\tif ( $lang = get_bloginfo('language') ) {\n\t\tif ( get_option('html_type') == 'text/html' || $doctype == 'html' )\n\t\t\t$attributes[] = \"lang=\\\"$lang\\\"\";\n\n\t\tif ( get_option('html_type') != 'text/html' || $doctype == 'xhtml' )\n\t\t\t$attributes[] = \"xml:lang=\\\"$lang\\\"\";\n\t}\n\n\t$output = implode(' ', $attributes);\n\n\t/**\n\t * Filter the language attributes for display in the html tag.\n\t *\n\t * @since 2.5.0\n\t *\n\t * @param string $output A space-separated list of language attributes.\n\t */\n\techo apply_filters( 'language_attributes', $output );\n}", "public static function toAttributes(array $data): string\n {\n if( $data===[] ) {\n return '';\n }\n\n $attribs = [];\n\n array_walk($data, static function($value, $key) use(&$attribs) {\n if( $value===true ) {\n $attribs[] = $key;\n } else {\n $attribs[] = $key.'=\"'.addslashes((string)$value).'\"';\n }\n });\n\n return implode(' ', $attribs);\n }", "public function escapeAttr($value)\n {\n return $this->_encode($value);\n }", "public function attributes($attributes, $ignore = array()) {\n\n\t\t$attribs = array();\n\t\t$ignore = (array) $ignore;\n\n\t\tforeach ($attributes as $name => $value) {\n\t\t\tif (in_array($name, $ignore)) continue;\n\n\t\t\t$attribs[] = sprintf('%s=\"%s\"', $name, htmlspecialchars($value));\n\t\t}\n\n\t\treturn implode(' ', $attribs);\n\t}", "function serialize() {\n $op = '';\n foreach ($this->attributes as $attrKey => $attrVal) {\n $op .= '$attributes[\\''.$attrKey.'\\'] = <<< SMCACHEEND'.\"\\n\";\n $op .= $attrVal.\"\\nSMCACHEEND;\\n\";\n }\n $op .= '$newVarTag = new SM_varTag($attributes);'.\"\\n\";\n return $op;\n }", "public function html_attributes( $attributes = array(), $prefix = '' ) {\n\n\t\t// If empty return false\n\t\tif ( empty( $attributes ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$options = false;\n\t\tif( isset( $attributes['data-plugin-options'] ) ) {\n\t\t\t$options = $attributes['data-plugin-options'];\n\t\t\tunset( $attributes['data-plugin-options'] );\n\t\t}\n\n\t\t$out = '';\n\t\tforeach ( $attributes as $key => $value ) {\n\n\t\t\tif( ! $value ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$key = $prefix . $key;\n\n\t\t\tif( true === $value ) {\n\t\t\t\t$value = 'true';\n\t\t\t}\n\n\t\t\t$out .= sprintf( ' %s=\"%s\"', esc_html( $key ), esc_attr( $value ) );\n\t\t}\n\n\t\tif( $options ) {\n\t\t\t$out .= sprintf( ' data-plugin-options=\\'%s\\'', $options );\n\t\t}\n\n\t\treturn $out;\n\t}", "protected function compileAttributes(HTMLElementInterface $element)\n\t{\n\t\t$attrs = array();\n\n\t\tforeach ($element->getAttributes() as $name => $value) {\n\n\t\t\tif ( $value == '' ) {\n\n\t\t\t\t$attrs[] = $this->valueOnOptionals ? \n\t\t\t\t\t\t $this->escape($name) . '=\"' . $this->escape($name) . '\"' : \n\t\t\t\t\t\t $this->escape($name);\n\n\t\t\t} elseif( is_numeric($name) ) {\n\n\t\t\t\t$attrs[] = $this->valueOnOptionals ? \n\t\t\t\t\t\t $this->escape($value) . '=\"' . $this->escape($value) . '\"' : \n\t\t\t\t\t\t $this->escape($value);\n\n\t\t\t} else {\n\n\t\t\t\t$attrs[] = $this->escape($name) . '=\"' . $this->escape($value) . '\"';\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\n\t\treturn implode(' ', $attrs);\n\t}", "public static function attributes($attributes)\n {\n $html = [ ];\n\n foreach ( (array)$attributes as $key => $value ) {\n $element = static::attributeElement($key, $value);\n\n if ( !is_null($element) ) {\n $html[] = $element;\n }\n }\n\n return count($html) > 0 ? ' ' . implode(' ', $html) : '';\n }", "public function attr() {\n\t\treturn utils::attr($this->attr, func_get_args());\n\t}", "public static function getAttributes(array $args = []): string\n {\n $attributes['type'] = self::makeElementProperty( $args['type'] ?? '', 'type' );\n\n $attributes['value'] = self::makeElementProperty( $args['value'] ?? '', 'value' );\n\n $attributes['id'] = self::makeElementProperty( $args['id'] ?? '', 'id' );\n\n $attributes['disabled'] = !empty( $args['disabled'] ?? false ) ? self::makeElementProperty( '', 'disabled' ) : '';\n\n $attributes['name'] = self::makeElementProperty( $args['name'] ?? '', 'name' );\n\n $args['class'] = !empty( $args['class'] ) && is_array( $args['class'] ) ? implode( ' ', $args['class'] ) : ($args['class'] ?? '');\n if ( !empty( $args['not-toggleable'] ) ) {\n $args['class'] .= ' not-toggleable';\n }\n $attributes['class'] = self::makeElementProperty( $args['class'], 'class' );\n\n $attributes['href'] = self::makeElementProperty( $args['href'] ?? '', 'href' );\n\n $attributes['placeholder'] = self::makeElementProperty(\n $args['placeholder'] ?? '',\n 'placeholder'\n );\n\n $attributes['role'] = self::makeElementProperty( $args['role'] ?? '', 'role' );\n\n foreach ( $args['data'] ?? [] as $key => $arg ) {\n $attributes['data_' . $key] = self::makeElementProperty( $arg, 'data-' . $key );\n }\n\n return implode( '', $attributes ) ?? '';\n }", "public function __toString()\n {\n $result = \"<{$this->getTagName()}\";\n foreach ($this->getAttributes() as $key => $value) {\n $result .= \" {$key}=\\\"\" . Util::escape($value) . \"\\\"\";\n }\n if ($this->hasChild()) {\n $result .= '>';\n foreach ($this->getChildren() as $node) {\n $result .= $node->toString();\n }\n $result .= \"</{$this->getTagName()}>\";\n } else {\n $result .= ' />';\n }\n return $result;\n }", "public static function attributes( $list=[] )\n {\n $atts = [];\n\n if( !empty( $list ) && is_array( $list ) )\n {\n foreach( $list as $key => $value )\n {\n if( is_numeric( $key ) ) continue;\n $key = Sanitize::toSlug( $key );\n $value = self::escape( $value, '\"' );\n $atts[] = $key .'=\"'. $value .'\"';\n }\n }\n return implode( \" \", $atts );\n }", "function studiare_get_inline_attrs($attrs) {\n\t$output = '';\n\n\tif(is_array($attrs) && count($attrs)) {\n\t\tforeach($attrs as $attr => $value) {\n\t\t\t$output .= ' '.studiare_get_inline_attr($value, $attr);\n\t\t}\n\t}\n\n\t$output = ltrim($output);\n\n\treturn $output;\n}", "public static function renderAttributes($htmlOptions = array()) {\n static $specialAttributes = array(\n 'autofocus' => 1,\n 'autoplay' => 1,\n 'controls' => 1,\n 'declare' => 1,\n 'default' => 1,\n 'disabled' => 1,\n 'ismap' => 1,\n 'loop' => 1,\n 'muted' => 1,\n 'playsinline' => 1,\n 'webkit-playsinline' => 1,\n 'nohref' => 1,\n 'noresize' => 1,\n 'novalidate' => 1,\n 'open' => 1,\n 'reversed' => 1,\n 'scoped' => 1,\n 'seamless' => 1,\n 'selected' => 1,\n 'typemustmatch' => 1,\n 'lazyload' => 1,\n ), $specialAttributesNoValue = array(\n 'defer' => 1,\n 'async' => 1\n );\n\n if ($htmlOptions === array()) return '';\n\n $html = '';\n if (isset($htmlOptions['encode'])) {\n $raw = !$htmlOptions['encode'];\n unset($htmlOptions['encode']);\n } else\n $raw = false;\n\n foreach ($htmlOptions as $name => $value) {\n if (isset($specialAttributes[$name])) {\n if ($value) {\n $html .= ' ' . $name;\n if (self::$renderSpecialAttributesValue) $html .= '=\"' . $name . '\"';\n }\n } else if (isset($specialAttributesNoValue[$name])) {\n $html .= ' ' . $name;\n } else if ($value !== null) $html .= ' ' . $name . '=\"' . ($raw ? $value : self::encodeAttribute($value)) . '\"';\n }\n\n return $html;\n }", "public function attr($attr)\n\t{\n\t\t$html = array();\n\n\t\t// For numeric keys we will assume that the key and the value are the same\n\t\t// as this will convert HTML attributes such as \"required\" to a correct\n\t\t// form like required=\"required\" instead of using incorrect numerics.\n\t\tforeach ((array) $attr as $key => $value)\n\t\t{\n\t\t\t$element = $this->_attr_element($key, $value);\n\n\t\t\tif ( ! is_null($element)) $html[] = $element;\n\t\t}\n\n\t\treturn count($html) > 0 ? ' '.implode(' ', $html) : '';\n\t}", "public static function body_attributes() {\n $attrs = apply_filters( 'insight_body_attributes', array() );\n\n $attrs_string = '';\n if ( ! empty( $attrs ) ) {\n foreach ( $attrs as $attr => $value ) {\n $attrs_string .= \" {$attr}=\" . '\"' . esc_attr( $value ) . '\"';\n }\n }\n echo '' . $attrs_string;\n }", "public function makeOpeningTag()\n {\n $return = '<'.$this->name;\n\n // add the attributes\n foreach ($this->attr as $key => $info) {\n $info = $this->getAttribute($key);\n $val = $info['value'];\n if (is_null($val)) {\n $return .= ' '.$key;\n } elseif ($info['doubleQuote']) {\n $return .= ' '.$key.'=\"'.$val.'\"';\n } else {\n $return .= ' '.$key.'=\\''.$val.'\\'';\n }\n }\n\n if ($this->selfClosing) {\n return $return.' />';\n } else {\n return $return.'>';\n }\n }", "function language_attributes() {\n\t$attributes = [];\n\n\tif ( is_rtl() ) {\n\t\t$attributes[] = 'dir=\"rtl\"';\n\t}\n\n\t$lang = get_bloginfo( 'language' );\n\n\tif ( $lang ) {\n\t\t$attributes[] = \"lang=\\\"$lang\\\"\";\n\t}\n\n\t$output = implode( ' ', $attributes );\n\t$output = apply_filters( 'soil/language_attributes', $output );\n\n\treturn $output;\n}", "function getDOMAttributes ( $attributes, $default = [] )\n{\n $style = getDOMAttribute('style', $attributes, $default);\n $classes = getDOMAttribute('class', $attributes, $default, 'classes');\n $id = getDOMAttribute('id', $attributes, $default);\n\n $result = $id . $classes . $style;\n\n // Add any attributes that start with \"data-\" or \"on\"\n foreach ($attributes as $key => $value)\n {\n if (preg_match('/^data-(.*)?/', $key) || preg_match('/^on(.*)?/', $key))\n $result .= ' ' . $key . '=\"' . $value . '\"';\n }\n return trim($result);\n}", "public static function buildAttributeString($attributes, int $lang = self::LANG_HTML5) : string\n\t{\n\t\t$str = '';\n\n\t\tif (! is_iterable($attributes)) {\n\t\t\tif (is_string($attributes)) {\n\t\t\t\t$attributes = static::parseAttributeString($attributes);\n\t\t\t} else {\n\t\t\t\tthrow new InvalidArgumentException(sprintf(\n\t\t\t\t\t\"Attributes must be string or iterable, given: '%s'.\", Variable::type($attributes)\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\tforeach($attributes as $name => $value) {\n\n\t\t\tif (is_array($value)) {\n\t\t\t\tif (array_filter($value, 'is_scalar') === $value) {\n\t\t\t\t\t$value = implode(' ', $value);\n\t\t\t\t} else {\n\t\t\t\t\t$value = json_encode($value, JSON_NUMERIC_CHECK);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$str .= ' ' . $name . '=\"' . static::escapeAttribute($value, $lang) . '\"';\n\t\t}\n\n\t\treturn $str;\n\t}", "function pnq_prepare_attrs( $attrs ) {\t\n\t$prepared_attrs = '';\n\tif( isset( $attrs ) ) {\t\t\n\t\tforeach( $attrs as $attr_name => $attr_val ) {\n\t\t\t$prepared_attrs = $prepared_attrs . $attr_name . '=\"' . esc_attr( $attr_val ) . '\"';\n\t\t}\n\t}\t\n\treturn $prepared_attrs;\n}", "protected static function create_attributes_string(array $attrs = []): string\n\t{\n\t\t$attrs_parts = [];\n\n\t\tforeach ($attrs as $attr_name => $attr_value) {\n\t\t\t$attrs_parts[] = \"{$attr_name}=\\\"{$attr_value}\\\"\";\n\t\t}\n\n\t\treturn implode(' ', $attrs_parts);\n\t}", "private function wash_attribs($node)\n {\n $result = '';\n $washed = array();\n\n foreach ($node->attributes as $name => $attr) {\n $key = strtolower($name);\n $value = $attr->nodeValue;\n\n if ($key == 'style' && ($style = $this->wash_style($value))) {\n // replace double quotes to prevent syntax error and XSS issues (#1490227)\n $result .= ' style=\"' . str_replace('\"', '&quot;', $style) . '\"';\n }\n else if (isset($this->_html_attribs[$key])) {\n $value = trim($value);\n $out = null;\n\n // in SVG to/from attribs may contain anything, including URIs\n if ($key == 'to' || $key == 'from') {\n $key = strtolower($node->getAttribute('attributeName'));\n if ($key && !isset($this->_html_attribs[$key])) {\n $key = null;\n }\n }\n\n if ($this->is_image_attribute($node->tagName, $key)) {\n $out = $this->wash_uri($value, true);\n }\n else if ($this->is_link_attribute($node->tagName, $key)) {\n if (!preg_match('!^(javascript|vbscript|data:text)!i', $value)\n && preg_match('!^([a-z][a-z0-9.+-]+:|//|#).+!i', $value)\n ) {\n $out = $value;\n }\n }\n else if ($this->is_funciri_attribute($node->tagName, $key)) {\n if (preg_match('/^[a-z:]*url\\(/i', $val)) {\n if (preg_match('/^([a-z:]*url)\\(\\s*[\\'\"]?([^\\'\"\\)]*)[\\'\"]?\\s*\\)/iu', $value, $match)) {\n if ($url = $this->wash_uri($match[2])) {\n $result .= ' ' . $attr->nodeName . '=\"' . $match[1] . '(' . htmlspecialchars($url, ENT_QUOTES) . ')'\n . substr($val, strlen($match[0])) . '\"';\n continue;\n }\n }\n else {\n $out = $value;\n }\n }\n else {\n $out = $value;\n }\n }\n else if ($key) {\n $out = $value;\n }\n\n if ($out !== null && $out !== '') {\n $result .= ' ' . $attr->nodeName . '=\"' . htmlspecialchars($out, ENT_QUOTES) . '\"';\n }\n else if ($value) {\n $washed[] = htmlspecialchars($attr->nodeName, ENT_QUOTES);\n }\n }\n else {\n $washed[] = htmlspecialchars($attr->nodeName, ENT_QUOTES);\n }\n }\n\n if (!empty($washed) && $this->config['show_washed']) {\n $result .= ' x-washed=\"' . implode(' ', $washed) . '\"';\n }\n\n return $result;\n }", "private function processAttrs(){\n\n\t\t$start = strlen($this->tag)+1;\n\t\t$temp = substr($this->raw,$start);\n\n\t\t//echo $temp . \"\\n\";\n\n\t\t$i=0;\n\t\tfor(; $i < strlen($temp); ){\n\t\t\tif($temp[$i] == '>') break;\n\t\t\t\t\n\t\t\t$pos = $this->skipWs($temp, $i);\n\t\t\t\t\n\t\t\t//echo \"should be r-{$temp[$pos]}\\n\";\n\t\t\t\t\n\t\t\t$pos2 = $this->skipToEqualOrWs($temp, $pos);\n\t\t\t\t\n\t\t\t//echo \"should be =-{$temp[$pos2]}\\n\";\n\t\t\t\t\n\t\t\t$attr = trim(substr($temp, $pos, $pos2 - $pos));\n\t\t\t\t\n\t\t\t//echo \"Got attribute-$attr\\n\";\n\t\t\t\t\n\t\t\tif(!empty($attr) && $pos2 < strlen($temp) && $temp[$pos2] == '='){\n\n\t\t\t\t//skip =\n\t\t\t\t$pos2++;\n\n\t\t\t\t$pos = $this->skipWs($temp, $pos2); //should be ' or \"\n\n\t\t\t\tif($temp[$pos] != '\"' && $temp[$pos] != \"'\"){\n\t\t\t\t\t//echo \"FAILED-{$temp[$pos]}\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$pos++; //skip the ' or \"\n\n\t\t\t\t$pos2 = $this->skipToQuote($temp, $pos, $temp[$pos-1]);\n\n\t\t\t\t$val = trim(substr($temp, $pos, $pos2-$pos),'\\'\"');\n\n\t\t\t\t$pos2++; //get past ' or \"\n\n\t\t\t\t$this->attributes[$attr] = $val;\n\n\t\t\t\t//echo \"$attr:$val\\n\";\n\t\t\t}\n\t\t\t$i = $pos2;\n\t\t}\n\t\t$this->textStart = $i+$start+1;\n\t}", "public static function buildAttributes(array $attributes)\n {\n $output = '';\n \n if(sizeof($attributes) > 0)\n {\n foreach ($attributes as $name => $value)\n {\n $output .= \"{$name}=\";\n\n // Handle multiple attribute values\n if(is_array($value))\n {\n $output .= \"'\";\n $output .= implode(' ', $value);\n $output .= \"'\";\n }\n else \n $output .= \"'{$value}'\";\n\n $output .= ' ';\n }\n }\n \n return $output;\n }", "protected function buildHtmlAttrs($params)\n {\n $html_params = $params['html'];\n $html = '';\n\n foreach ($html_params as $key => $val) {\n $html .= \" {$key}=\\\"{$val}\\\"\";\n }\n\n return $html;\n }", "private function attributes($data)\n {\n if (is_array($data)) {\n $attrStr = '';\n foreach ($data as $key => $value) {\n if (is_integer($key)) {\n $attrStr .= $this->attributes($value);\n } else {\n $attrStr .= ' '.$key . '=' . $value;\n }\n }\n return $attrStr;\n }\n else {\n return ' '. $data->getName() . '=' . $data->getValue();\n }\n\n }", "function e_attr($string)\n{\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "protected function buildAttributes($attributes, $form = null)\n {\n $atts = '';\n\n foreach ($attributes as $key => $value) {\n if ($value || $value === 0 || $value === '0') {\n $value = htmlspecialchars($value);\n $atts .= $key . '=\"' . $value . '\" ';\n }\n }\n\n return $atts;\n }", "public function get(): string\n {\n $attributes = [];\n foreach ($this->attributes as $k => $v) {\n if (is_string($v)) {\n $attributes[] = \"$k:\\\"$v\\\"\";\n } elseif ($v instanceof Closure) {\n $attributes[] = \"$k:\".$v();\n } elseif (is_bool($v)) {\n $attributes[] = \"$k:\".($v ? 'true' : 'false');\n } else {\n $attributes[] = \"$k:\".intval($v);\n }\n }\n\n return '{'.implode(',', $attributes).'}';\n }", "public function datagridAttributes(array $attributes)\n {\n $result = '';\n\n foreach ($attributes as $attributeName => $attributeValue) {\n $result .= ' '.$attributeName.'=\"'.$attributeValue.'\"';\n }\n\n return $result;\n }", "function get_string() {\n\t\t$attribs = $this->__attribs();\n\t\t$str = $this->__str();\n\t\t$str = '<a'.$attribs.'>'.$this->label.$str.'</a>';\n\t\treturn $str;\n\t}", "protected function _render_attrs($attrs) {\n\t$output = '';\n\tif ($this->_num_attrs($attrs) < 1) { return false; }\n\t\t$reserved_attributes = explode(', ', self::reserved_attributes);\n\t\tforeach($attrs as $key => $value) {\n\t\t\tif (is_array($reserved_attributes) && !in_array($key, $reserved_attributes) || $key == $reserved_attributes) {\n\t\t\t\t$output .= $key . '=\"' . $value . '\" ';\n\t\t\t}\n\t\t}\n\t\t$output = substr($output, 0, -1);\n\t\t\n\t\treturn $output;\n\t}", "function _navHtmlAttribs($attribs)\n{\n // filter out null values and empty string values\n foreach ($attribs as $key => $value) {\n if ($value === null || (is_string($value) && !strlen($value))) {\n unset($attribs[$key]);\n }\n }\n\n $xhtml = '';\n $view = get_view();\n foreach ((array) $attribs as $key => $val) {\n $key = $view->escape($key);\n\n if (('on' == substr($key, 0, 2)) || ('constraints' == $key)) {\n // Don't escape event attributes; _do_ substitute double quotes with singles\n if (!is_scalar($val)) {\n // non-scalar data should be cast to JSON first\n require_once 'Zend/Json.php';\n $val = Zend_Json::encode($val);\n }\n // Escape single quotes inside event attribute values.\n // This will create html, where the attribute value has\n // single quotes around it, and escaped single quotes or\n // non-escaped double quotes inside of it\n $val = str_replace('\\'', '&#39;', $val);\n } else {\n if (is_array($val)) {\n $val = implode(' ', $val);\n }\n $val = $view->escape($val);\n }\n\n if ('id' == $key) {\n $value = $val;\n if (strstr($value, '[')) {\n if ('[]' == substr($value, -2)) {\n $value = substr($value, 0, strlen($value) - 2);\n }\n $value = trim($value, ']');\n $value = str_replace('][', '-', $value);\n $value = str_replace('[', '-', $value);\n }\n $val = $value;\n }\n\n if (strpos($val, '\"') !== false) {\n $xhtml .= \" $key='$val'\";\n } else {\n $xhtml .= \" $key=\\\"$val\\\"\";\n }\n\n }\n return $xhtml;\n}", "public static function buildAttributesString($attributes = [], $attribute_quote_char = '\"')\n {\n $attribute_quote_char = self::getAttributeQuoteChar($attribute_quote_char);\n $attributes = self::flattenAttributes(self::evaluate($attributes));\n $attributes_string = '';\n foreach ($attributes as $attribute_name => $attribute_value) {\n if (is_object($attribute_value) and !method_exists($attribute_value, '__toString')) {\n $attribute_value = false;\n }\n $attribute_value = self::flattenAttributeValue($attribute_name, $attribute_value);\n if (isset($attribute_value) and $attribute_value !== false) {\n $attributes_string .= ' ' . self::escapeHtml($attribute_name);\n if ($attribute_value !== true) {\n $attributes_string .= '=' . $attribute_quote_char . self::escapeHtml($attribute_value) . $attribute_quote_char;\n }\n }\n }\n\n return $attributes_string;\n }", "public static function attr($string, $strict = true) {\n if(static::noNeedToEscape($string)) return $string;\n if($strict === true) {\n return preg_replace_callback('/[^a-z0-9,\\.\\-_]/iSu', 'static::escapeAttrChar', $string);\n }\n return static::html($string);\n }", "public function __toString()\n {\n $textLabels = $this->_getTextLabels();\n $out = array();\n\n foreach ($this->_attr as $attr => $value) {\n if (isset($textLabels[$attr])) {\n if (in_array($attr, array(\n self::EXPIRE_MONTH,\n self::EXPIRE_YEAR,\n self::NUMBER\n ))) {\n $out[] = sprintf('%15s %s (Encrypted: %s)',\n $textLabels[$attr] . ':',\n $value,\n substr($this->get($attr, true), 0, 8) . '...'\n );\n } else {\n $out[] = sprintf('%15s %s', $textLabels[$attr] . ':', $value);\n }\n }\n }\n\n return implode(\"\\n\", $out) . \"\\n\";\n }" ]
[ "0.7388372", "0.7255725", "0.71956015", "0.71204704", "0.709842", "0.7075592", "0.70477164", "0.7042661", "0.70360607", "0.70133597", "0.6997342", "0.6884745", "0.6820727", "0.6803763", "0.6784575", "0.67575204", "0.6753973", "0.674749", "0.6727663", "0.67265177", "0.6726126", "0.6686995", "0.66331", "0.6629961", "0.65626556", "0.65519583", "0.6549726", "0.6540106", "0.6506658", "0.6504016", "0.6482553", "0.6482419", "0.64819723", "0.64714617", "0.6457171", "0.6448015", "0.64335674", "0.64310694", "0.6420746", "0.64116126", "0.6350186", "0.63470703", "0.63206714", "0.6314537", "0.6291751", "0.6280083", "0.6275235", "0.6269854", "0.6268444", "0.62648493", "0.6254636", "0.6223112", "0.6213484", "0.6210536", "0.6210536", "0.6175443", "0.6161487", "0.6145355", "0.61427855", "0.61158895", "0.61155033", "0.6112479", "0.607508", "0.6069331", "0.6068167", "0.6067651", "0.6053805", "0.60393935", "0.60386246", "0.6035635", "0.6005221", "0.60006845", "0.59962213", "0.59865266", "0.59742767", "0.59718806", "0.59693813", "0.5961372", "0.59558105", "0.5955197", "0.59499305", "0.5948985", "0.59480506", "0.592875", "0.5928672", "0.59234416", "0.5921601", "0.59139425", "0.5892064", "0.58910495", "0.5879507", "0.58657056", "0.58626217", "0.58485925", "0.5846384", "0.584306", "0.58369696", "0.58015585", "0.5781867", "0.57783765" ]
0.6132563
59
Extract HTMLTags from some content. Tags are returned in the order they are found in a document.
public static function extractTags(string $tag, string|HTMLTag|array $mixed, bool $recursive = true): array { /* Handle a variety of inputs */ $contents = self::mixedToString($mixed); if (empty($contents)) { return []; } $tag = strtolower($tag); $endTag = "</$tag>"; $endTagPattern = '#</\s*' . $tag . '\s*>#si'; $results = []; $reverse_search = [ self::$RE_TAG_START_CHAR, self::$RE_TAG_END_CHAR, ]; $reverse_replace = [ $tag, $endTag, ]; $search = []; $replace = []; $search[] = '/<\s*' . $tag . '(\s+' . self::RE_ATTRIBUTES . ')>/si'; $replace[] = '<' . self::$RE_TAG_START_CHAR . '$1>'; $search[] = '/<\s*' . $tag . '\s*>/si'; $replace[] = '<' . self::$RE_TAG_START_CHAR . '$1>'; $search[] = $endTagPattern; $replace[] = self::$RE_TAG_END_CHAR; $contents = preg_replace($search, $replace, $contents); /* * Match patterns in order of probably valid order. This handles, in order: <tag /> <tag> ... </tag> <tag> (no * end tag) */ $patterns = self::_html_tag_patterns(); foreach ($patterns as $pattern) { $matches = []; while (preg_match_all($pattern, $contents, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { $search = []; $replace = []; foreach ($matches as $match) { [$matched, $matched_offset] = array_shift($match); [$attrs] = array_shift($match); $options = self::parseAttributes($attrs); if (count($match) !== 0) { [$tag_contents] = array_shift($match); } else { $tag_contents = false; } $results[] = new HTMLTag($tag, $options, $tag_contents, str_replace($reverse_search, $reverse_replace, $matched), $matched_offset); $token = '#@' . count($results) . '@#'; $search[] = $matched; $replace[] = $token; $reverse_search[] = $token; $reverse_replace[] = $matched; } $contents = str_replace($search, $replace, $contents); if (!$recursive) { break; } } } /* * Since we modify the contents as we parse, the undos all modifications in results */ foreach ($results as $result) { /* @var $result HTMLTag */ $inner_html = $result->innerHTML(); $outer_html = $result->outerHTML(); while (preg_match('/#@[0-9]+@#|[' . self::$RE_TAG_START_CHAR . self::$RE_TAG_END_CHAR . ']/', $inner_html)) { $inner_html = str_replace($reverse_search, $reverse_replace, $inner_html); $outer_html = str_replace($reverse_search, $reverse_replace, $outer_html); } $result->setInnerHTML($inner_html); $result->setOuterHTML($outer_html); } return $results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_tags ($content) {\n\t\t$tags = $matches = array();\n\t\tif (empty($content)) return $tags;\n\n\t\tpreg_match_all($this->get_catchall_regex(), $content, $matches);\n\t\tif (!empty($matches[1])) $tags = $matches[1];\n\n\t\tif (!empty($tags)) foreach ($tags as $idx => $tag) {\n\t\t\t$tmp = explode($this->fallback(), $tag);\n\t\t\t$clean = reset($tmp);\n\t\t\tif ($clean === $tag) continue;\n\t\t\t$tags[$idx] = $clean;\n\t\t}\n\n\t\treturn $tags;\n\t}", "private static function findTagsInContent($content)\n {\n preg_match_all('/@([^@]+)@/m', $content, $tags);\n\n //query all the tags with names from returned tags array\n return Tag::whereIn('name', $tags[1] ?? [])->get();\n }", "private function parseForTags($content) {\n $files = [];\n // image and link files\n if (preg_match_all('/<(a|img) [^>]*>/i', $content, $matches)) {\n foreach ($matches[1] as $key => $tag) {\n if ($uri = $this->extractUri($tag, $matches[0][$key])) {\n $source_uri = (!preg_match('/https?:\\/\\//', $uri) ? $this->source_domain : '') . $uri;\n //\n list($ignore, $filename) = D7Utils::filePathAndName($uri);\n $filename = D7Utils::niceFileName($filename);\n //\n $target_uri = $this->target_folder . $filename;\n $target_file = \\Drupal::service('file_system')->realpath($target_uri);\n //\n $files[$source_uri] = [\n 'file' => $target_file,\n 'uri' => $target_uri,\n //'replace' => $source_uri,\n ];\n }\n }\n }\n return $files;\n }", "protected function fetchTagsFromContent($content)\n {\n preg_match_all('/(#\\w+)/', $content, $matches);\n\n return collect(array_unique(array_shift($matches)));\n }", "private function getHtmlTags()\n {\n // Possible allowed HTML tags\n return [\n '!--' => 'https://www.w3schools.com/tags/tag_comment.asp',\n 'a' => 'https://www.w3schools.com/tags/tag_a.asp',\n 'abbr' => 'https://www.w3schools.com/tags/tag_abbr.asp',\n 'acronym' => 'https://www.w3schools.com/tags/tag_acronym.asp',\n 'address' => 'https://www.w3schools.com/tags/tag_address.asp',\n 'applet' => 'https://www.w3schools.com/tags/tag_applet.asp',\n 'area' => 'https://www.w3schools.com/tags/tag_area.asp',\n 'article' => 'https://www.w3schools.com/tags/tag_article.asp',\n 'aside' => 'https://www.w3schools.com/tags/tag_aside.asp',\n 'audio' => 'https://www.w3schools.com/tags/tag_audio.asp',\n 'b' => 'https://www.w3schools.com/tags/tag_b.asp',\n 'base' => 'https://www.w3schools.com/tags/tag_base.asp',\n 'basefont' => 'https://www.w3schools.com/tags/tag_basefont.asp',\n 'bdo' => 'https://www.w3schools.com/tags/tag_bdo.asp',\n 'big' => 'https://www.w3schools.com/tags/tag_font_style.asp',\n 'blockquote' => 'https://www.w3schools.com/tags/tag_blockquote.asp',\n 'br' => 'https://www.w3schools.com/tags/tag_br.asp',\n 'button' => 'https://www.w3schools.com/tags/tag_button.asp',\n 'canvas' => 'https://www.w3schools.com/tags/tag_canvas.asp',\n 'caption' => 'https://www.w3schools.com/tags/tag_caption.asp',\n 'center' => 'https://www.w3schools.com/tags/tag_center.asp',\n 'cite' => 'https://www.w3schools.com/tags/tag_cite.asp',\n 'code' => 'https://www.w3schools.com/tags/tag_code.asp',\n 'col' => 'https://www.w3schools.com/tags/tag_col.asp',\n 'colgroup' => 'https://www.w3schools.com/tags/tag_colgroup.asp',\n 'command' => 'https://www.w3schools.com/tags/tag_command.asp',\n 'datalist' => 'https://www.w3schools.com/tags/tag_datalist.asp',\n 'dd' => 'https://www.w3schools.com/tags/tag_dd.asp',\n 'del' => 'https://www.w3schools.com/tags/tag_del.asp',\n 'details' => 'https://www.w3schools.com/tags/tag_details.asp',\n 'dfn' => 'https://www.w3schools.com/tags/tag_dfn.asp',\n 'dir' => 'https://www.w3schools.com/tags/tag_dir.asp',\n 'div' => 'https://www.w3schools.com/tags/tag_div.asp',\n 'dl' => 'https://www.w3schools.com/tags/tag_dl.asp',\n 'dt' => 'https://www.w3schools.com/tags/tag_dt.asp',\n 'em' => 'https://www.w3schools.com/tags/tag_em.asp',\n 'embed' => 'https://www.w3schools.com/tags/tag_embed.asp',\n 'fieldset' => 'https://www.w3schools.com/tags/tag_fieldset.asp',\n 'figcaption' => 'https://www.w3schools.com/tags/tag_figcaption.asp',\n 'figure' => 'https://www.w3schools.com/tags/tag_figure.asp',\n 'font' => 'https://www.w3schools.com/tags/tag_font.asp',\n 'footer' => 'https://www.w3schools.com/tags/tag_footer.asp',\n 'form' => 'https://www.w3schools.com/tags/tag_form.asp',\n 'h1' => 'https://www.w3schools.com/tags/tag_hn.asp',\n 'h2' => 'https://www.w3schools.com/tags/tag_hn.asp',\n 'h3' => 'https://www.w3schools.com/tags/tag_hn.asp',\n 'h4' => 'https://www.w3schools.com/tags/tag_hn.asp',\n 'h5' => 'https://www.w3schools.com/tags/tag_hn.asp',\n 'h6' => 'https://www.w3schools.com/tags/tag_hn.asp',\n 'header' => 'https://www.w3schools.com/tags/tag_header.asp',\n 'hgroup' => 'https://www.w3schools.com/tags/tag_hgroup.asp',\n 'hr' => 'https://www.w3schools.com/tags/tag_hr.asp',\n 'i' => 'https://www.w3schools.com/tags/tag_i.asp',\n 'iframe' => 'https://www.w3schools.com/tags/tag_iframe.asp',\n 'img' => 'https://www.w3schools.com/tags/tag_img.asp',\n 'input' => 'https://www.w3schools.com/tags/tag_input.asp',\n 'ins' => 'https://www.w3schools.com/tags/tag_ins.asp',\n 'keygen' => 'https://www.w3schools.com/tags/tag_keygen.asp',\n 'kbd' => 'https://www.w3schools.com/tags/tag_kbd.asp',\n 'label' => 'https://www.w3schools.com/tags/tag_label.asp',\n 'legend' => 'https://www.w3schools.com/tags/tag_legend.asp',\n 'li' => 'https://www.w3schools.com/tags/tag_li.asp',\n 'map' => 'https://www.w3schools.com/tags/tag_map.asp',\n 'mark' => 'https://www.w3schools.com/tags/tag_mark.asp',\n 'menu' => 'https://www.w3schools.com/tags/tag_menu.asp',\n 'marquee' => '',\n 'meter' => 'https://www.w3schools.com/tags/tag_meter.asp',\n 'nav' => 'https://www.w3schools.com/tags/tag_nav.asp',\n 'nobr' => '',\n 'object' => 'https://www.w3schools.com/tags/tag_object.asp',\n 'ol' => 'https://www.w3schools.com/tags/tag_ol.asp',\n 'optgroup' => 'https://www.w3schools.com/tags/tag_optgroup.asp',\n 'option' => 'https://www.w3schools.com/tags/tag_option.asp',\n 'output' => 'https://www.w3schools.com/tags/tag_output.asp',\n 'p' => 'https://www.w3schools.com/tags/tag_p.asp',\n 'param' => 'https://www.w3schools.com/tags/tag_param.asp',\n 'pre' => 'https://www.w3schools.com/tags/tag_pre.asp',\n 'progress' => 'https://www.w3schools.com/tags/tag_progress.asp',\n 'q' => 'https://www.w3schools.com/tags/tag_q.asp',\n 'rp' => 'https://www.w3schools.com/tags/tag_rp.asp',\n 'rt' => 'https://www.w3schools.com/tags/tag_rt.asp',\n 'ruby' => 'https://www.w3schools.com/tags/tag_ruby.asp',\n 's' => 'https://www.w3schools.com/tags/tag_s.asp',\n 'samp' => 'https://www.w3schools.com/tags/tag_samp.asp',\n 'script' => 'https://www.w3schools.com/tags/tag_script.asp',\n 'section' => 'https://www.w3schools.com/tags/tag_section.asp',\n 'select' => 'https://www.w3schools.com/tags/tag_select.asp',\n 'small' => 'https://www.w3schools.com/tags/tag_small.asp',\n 'source' => 'https://www.w3schools.com/tags/tag_source.asp',\n 'span' => 'https://www.w3schools.com/tags/tag_span.asp',\n 'strike' => 'https://www.w3schools.com/tags/tag_strike.asp',\n 'strong' => 'https://www.w3schools.com/tags/tag_strong.asp',\n 'sub' => 'https://www.w3schools.com/tags/tag_sup.asp',\n 'summary' => 'https://www.w3schools.com/tags/tag_summary.asp',\n 'sup' => 'https://www.w3schools.com/tags/tag_sup.asp',\n 'table' => 'https://www.w3schools.com/tags/tag_table.asp',\n 'tbody' => 'https://www.w3schools.com/tags/tag_tbody.asp',\n 'td' => 'https://www.w3schools.com/tags/tag_td.asp',\n 'textarea' => 'https://www.w3schools.com/tags/tag_textarea.asp',\n 'tfoot' => 'https://www.w3schools.com/tags/tag_tfoot.asp',\n 'th' => 'https://www.w3schools.com/tags/tag_th.asp',\n 'thead' => 'https://www.w3schools.com/tags/tag_thead.asp',\n 'time' => 'https://www.w3schools.com/tags/tag_time.asp',\n 'tr' => 'https://www.w3schools.com/tags/tag_tr.asp',\n 'tt' => 'https://www.w3schools.com/tags/tag_font_style.asp',\n 'u' => 'https://www.w3schools.com/tags/tag_u.asp',\n 'ul' => 'https://www.w3schools.com/tags/tag_ul.asp',\n 'var' => 'https://www.w3schools.com/tags/tag_var.asp',\n 'video' => 'https://www.w3schools.com/tags/tag_video.asp',\n 'wbr' => 'https://www.w3schools.com/tags/tag_wbr.asp'\n ];\n }", "function wp_filter_content_tags($content, $context = \\null)\n {\n }", "static function close_tags($content) {\n $position = 0;\n $open_tags = array();\n $ignored_tags = array('br', 'hr', 'img');\n\n while (($position = strpos($content, '<', $position)) !== FALSE)\n {\n if (preg_match(\"|^<(/?)([a-z\\d]+)\\b[^>]*>|i\", substr($content, $position), $match))\n {\n $tag = strtolower($match[2]);\n if (in_array($tag, $ignored_tags) == FALSE)\n {\n //тег открыт\n if (isset($match[1]) AND $match[1] == '')\n {\n if (isset($open_tags[$tag]))\n $open_tags[$tag]++;\n else\n $open_tags[$tag] = 1;\n }\n //тег закрыт\n if (isset($match[1]) AND $match[1] == '/')\n {\n if (isset($open_tags[$tag]))\n $open_tags[$tag]--;\n }\n }\n $position += strlen($match[0]);\n }\n else\n $position++;\n }\n\n foreach ($open_tags as $tag => $count_not_closed) {\n $content .= str_repeat(\"</{$tag}>\", $count_not_closed);\n }\n\n return $content;\n }", "function getContentByTags($url, $tag){\n $html = file_get_contents($url);\n $doc_ = new DOMDocument();\n libxml_use_internal_errors(TRUE);\n if(!empty($html)){\n \t$doc_->loadHTML($html);\n \tlibxml_clear_errors();\n $tagTxt = array();\n $arr = $doc_->getElementsByTagName(\"a\");\n foreach($arr as $item) {\n $text = trim(preg_replace(\"/[\\r\\n]+/\", \" \", $item->nodeValue));\n array_push($tagTxt, $text.\"\\n\");\n }\n return $tagTxt;\n }\n}", "function ind_delete_extra_tags($content) {\n\t//Delete the chapters tags, because we don't need them\n\t$search = \"@(?:<p>)*\\s*\\[chapters\\]\\s*(?:</p>)*@i\";\n\t$content = preg_replace($search, '', $content);\n\t\n\t//Delete the chapters tags, because we don't need them\n\t$search = \"@(?:<p>)*\\s*\\[chapters\\s*:\\s*(\\d+)(||,left|,right)\\]\\s*(?:</p>)*@i\";\n\t$content = preg_replace($search, '', $content);\n\n\treturn $content;\n}", "private function getShortcodeTags( $content ) {\n\t\t$tags = [];\n\t\t$pattern = '\\\\[(\\\\[?)([^\\s]*)(?![\\\\w-])([^\\\\]\\\\/]*(?:\\\\/(?!\\\\])[^\\\\]\\\\/]*)*?)(?:(\\\\/)\\\\]|\\\\](?:([^\\\\[]*+(?:\\\\[(?!\\\\/\\\\2\\\\])[^\\\\[]*+)*+)\\\\[\\\\/\\\\2\\\\])?)(\\\\]?)';\n\t\tif ( preg_match_all( \"#$pattern#s\", $content, $matches ) && array_key_exists( 2, $matches ) ) {\n\t\t\t$tags = array_unique( $matches[2] );\n\t\t}\n\n\t\tif ( ! count( $tags ) ) {\n\t\t\treturn $tags;\n\t\t}\n\n\t\t// Extract nested shortcodes.\n\t\tforeach ( $matches[5] as $innerContent ) {\n\t\t\t$tags = array_merge( $tags, $this->getShortcodeTags( $innerContent ) );\n\t\t}\n\n\t\treturn $tags;\n\t}", "function closetags($html) {\n\t\tpreg_match_all('#<([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);\n\t\t$openedtags = $result[1]; #put all closed tags into an array\n\t\tpreg_match_all('#</([a-z]+)>#iU', $html, $result);\n\t\t$closedtags = $result[1];\n\t\t$len_opened = count($openedtags);\n\t\t# all tags are closed\n\t\tif (count($closedtags) == $len_opened) {\n\t\t\treturn $html;\n\t\t}\n\t\t\n\t\t$openedtags = array_reverse($openedtags);\n\t\t# close tags\n\t\tfor ($i=0; $i < $len_opened; $i++) {\n\t\t\tif (!in_array($openedtags[$i], $closedtags)){\n\t\t\t $html .= '</'.$openedtags[$i].'>';\n\t\t\t} else {\n\t\t\t unset($closedtags[array_search($openedtags[$i], $closedtags)]); }\n\t\t\t} \n\t\t\treturn $html;\n\t\t}", "private static function closetags ($html) {\n\t\t// put all opened tags into an array\n\t\tpreg_match_all ( \"#<([a-z]+)( .*)?(?!/)>#iU\", $html, $result );\n\t\t$openedtags = $result[1];\n\t\t// put all closed tags into an array\n\t\tpreg_match_all ( \"#</([a-z]+)>#iU\", $html, $result );\n\t\t$closedtags = $result[1];\n\t\t$len_opened = count ( $openedtags );\n\t\t// all tags are closed\n\t\tif(count($closedtags ) == $len_opened)\n\t\t\treturn $html;\n\t\t$openedtags = array_reverse ( $openedtags );\n\t\t// close tags\n\t\tfor( $i = 0; $i < $len_opened; $i++ ){\n\t\t\tif ( !in_array ( $openedtags[$i], $closedtags ) )\n\t\t\t\t$html .= \"</\" . $openedtags[$i] . \">\";\n\t\t\telse\n\t\t\t\tunset ( $closedtags[array_search ( $openedtags[$i], $closedtags)] );\n\t\t}\n\t\treturn $html;\n\t}", "protected function parse_content(){\n $m = array(); // we will keep here\n list( $t, $text ) = explode( \"<div class='post entry-content '>\", $this->page );\n list( $text, $t ) = explode( '</div>', $text );\n return $text;\n }", "function retrieve_tags($data)\n\t {\n\t\t $text = $data['text'];\n\t\t $lang_code = $data['lang_code'] ? $data['lang_code']:$this->language_translate->check($text);\n\t\t $retArr = array(); \n\t\t \n\t\t switch($lang_code)\n\t\t {\n\t\t case 'zh':\n $retArr = $this->tag_extract->retrieve_zh($text);\n break;\n case 'en':\n $retArr = $this->tag_extract->retrieve_en($text);\n break;\n default:\n\t\t $retArr = $this->tag_extract->retrieve_en($text);\n break;\n\t\t }//switch\n\t\t return $retArr;\n\t }", "private function processTags()\n {\n $dollarNotationPattern = \"~\" . REGEX_DOLLAR_NOTATION . \"~i\";\n $simpleTagPattern = \"~\" . REGEX_SIMPLE_TAG_PATTERN . \"~i\";\n $bodyTagPattern = \"~\" . REGEX_BODY_TAG_PATTERN . \"~is\";\n \n $tags = array();\n preg_match_all($this->REGEX_COMBINED, $this->view, $tags, PREG_SET_ORDER);\n \n foreach($tags as $tag)\n { \n $result = \"\";\n \n $tag = $tag[0];\n \n if (strlen($tag) == 0) continue;\n \n if (preg_match($simpleTagPattern, $tag) || preg_match($bodyTagPattern, $tag))\n {\n $this->handleTag($tag);\n }\n else if (preg_match($dollarNotationPattern, $tag))\n {\n $this->logger->log(Logger::LOG_LEVEL_DEBUG, 'View: processTags', \"Found ExpLang [$tag]\");\n $result = $this->EL_Engine->parse($tag);\n }\n \n if (isset ($result))\n {\n $this->update($tag, $result);\n }\n }\n }", "function remove_tags_intra_tags() {\r\n\t\t$ct_intra_tags = 0;\r\n\t\t$ct2 = -1;\r\n\t\twhile($ct2 != 0) {\r\n\t\t\t/*preg_match_all('/(<[^>]*)<[^<>]+?>/is', $this->code, $debug_matches);\r\n\t\t\tprint('$debug_matches: ');var_dump($debug_matches);*/\r\n\t\t\t$this->code = preg_replace('/(<(![^\\-][^<>]+|[^!<>]+))<[^<>]+?>/is', '$1', $this->code, -1, $ct2); // changed (2012-01-25)\r\n\t\t\t$ct_intra_tags += $ct2;\r\n\t\t}\r\n\t\t$this->logMsgIf(\"tags intra tags removed\", $ct_intra_tags);\r\n\t\t// we must also ignore the <head>!\r\n\t\t// the only tag that has content in the head that I can think of is <title>, so:\r\n\t\tpreg_match_all('/<title>(.*?)<\\/title>/is', $this->code, $title_matches);\r\n\t\tif(sizeof($title_matches[0]) > 1) {\r\n\t\t\tprint(\"Well, that's not good; found more than one (\" . sizeof($title_matches[0]) . \") &lt;title&gt; tags on this page!\");exit(0);\r\n\t\t}\r\n\t\tif(sizeof($title_matches[0]) === 0) {\r\n\t\t\t// nothing to do\r\n\t\t} else {\r\n\t\t\t$ct_title = 0;\r\n\t\t\t$initial_title_string = $title_string = $title_matches[0][0];\r\n\t\t\t$ct1 = -1;\r\n\t\t\r\n\t\t\twhile($ct1 != 0) {\r\n\t\t\t\t$title_string = preg_replace('/<title>(.*?)<[^<>]+?>(.*?)<\\/title>/is', '<title>$1$2</title>', $title_string, -1, $ct1);\r\n\t\t\t\t$ct_title += $ct1;\r\n\t\t\t}\r\n\t\t\t$this->code = str_replace($initial_title_string, $title_string, $this->code);\r\n\t\t}\r\n\t\t$this->logMsgIf(\"tags removed from title tag\", $ct_title);\r\n\t\t// this should only happen if something exists in both the acronyms and abbr files (erroneously) or if\r\n\t\t// an bbreviation is a substring of another abbreviation but we'll still clean it up\r\n\t\t//$this->code = preg_replace('/<(abbr|acronym) title=\"([^\"]*?)\"><(abbr|acronym) title=\"([^\"]*?)\">(.*?)<\\/(abbr|acronym)><\\/(abbr|acronym)>/is', '<$1 title=\"$2\">$4</$5>', $this->code, -1, $ct_redundant_acro);\r\n\t\t$ct_redundant_acro = 0;\r\n\t\t$array_tags = array('abbr', 'acronym');\r\n\t\t$tagNamesString = implode('|', $array_tags);\r\n\t\tforeach($array_tags as $tagName) {\r\n\t\t\t$OStrings = OM::getAllOStrings($this->code, '<' . $tagName, '</' . $tagName . '>');\r\n\t\t\t//var_dump($OStrings);exit(0);\r\n\t\t\t$counter = sizeof($OStrings) - 1;\r\n\t\t\twhile($counter >= 0) {\r\n\t\t\t\t$OString = $OStrings[$counter][0];\r\n\t\t\t\t$opening_tag = substr($OString, 0, strpos($OString, '>') + 1);\r\n\t\t\t\t$closing_tag = substr($OString, ReTidy::strpos_last($OString, '<'));\r\n\t\t\t\t$code_to_clean = substr($OString, strlen($opening_tag), strlen($OString) - strlen($opening_tag) - strlen($closing_tag));\r\n\t\t\t\t$needs_to_be_cleaned = false;\r\n\t\t\t\tforeach($array_tags as $tagName2) {\r\n\t\t\t\t\tif(strpos($code_to_clean, '<' . $tagName2) !== false) {\r\n\t\t\t\t\t\t$needs_to_be_cleaned = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif($needs_to_be_cleaned) {\r\n\t\t\t\t\t$offset = $OStrings[$counter][1];\r\n\t\t\t\t\t$code_to_clean = preg_replace('/<(' . $tagNamesString . ')[^<>]*?>/is', '', $code_to_clean);\r\n\t\t\t\t\t$code_to_clean = preg_replace('/<\\/(' . $tagNamesString . ')>/is', '', $code_to_clean);\r\n\t\t\t\t\t$new_OString = $opening_tag . $code_to_clean . $closing_tag;\r\n\t\t\t\t\t$this->code = substr($this->code, 0, $offset) . $new_OString . substr($this->code, $offset + strlen($OString));\r\n\t\t\t\t\t$ct_redundant_acro += 1;\r\n\t\t\t\t}\r\n\t\t\t\t$counter--;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->logMsgIf(\"redundant acronyms applications removed\", $ct_redundant_acro);\r\n\t}", "protected function parseContent($content) {\n $htmlDom = new \\DOMDocument();\n @$htmlDom->loadHTML('<?xml encoding=\"UTF-8\">' . $content);\n $elements = simplexml_import_dom($htmlDom);\n\n return $elements;\n }", "function do_shortcodes_in_html_tags($content, $ignore_html, $tagnames)\n {\n }", "private function parseContents($html)\n {\n if (ltrim($html) == '') {\n return '';\n }\n \n /* do we really have tags to omit parsing for?!?\n // Don't parse contents of \"iframe\" element.\n if ($this->name == 'iframe') {\n return $this->parseNoContents('iframe', $html);\n }\n\n // Only TEXT inside a \"script\" element.\n if ($this->name == 'script') {\n return $this->parseForeignContents('script', $html);\n }\n\n // Only TEXT inside a \"style\" element.\n if ($this->name == 'style') {\n return $this->parseForeignContents('style', $html);\n }\n */\n \n // Parse contents one token at a time.\n $remainingHtml = $html;\n while (preg_match(\"/^\\s*<\\/\\s*\".$this->name.\"\\s*>/is\", $remainingHtml) === 0) {\n $token = TokenFactory::buildFromHtml(\n $remainingHtml,\n $this,\n //false \n $this->getThrowOnError()\n );\n\n if ($token === false || $token->isClosingElementImplied($remainingHtml)) {\n return $remainingHtml;\n }\n \n if (!is_array($this->children)) {\n $this->children = array();\n }\n $remainingHtml = $token->parse($remainingHtml);\n $this->children[] = $token;\n }\n\n // Remove last token if contains only whitespace.\n if (!empty($this->children)) {\n $lastChildArray = array_slice($this->children, -1);\n $lastChild = array_pop($lastChildArray);\n if ($lastChild->isText() && trim($lastChild->getValue()) == '') {\n array_pop($this->children);\n }\n }\n\n // Remove remaining closing tag.\n $posOfClosingBracket = mb_strpos($remainingHtml, '>');\n\n return mb_substr($remainingHtml, $posOfClosingBracket + 1);\n }", "private function hasHTMLTags()\n {\n return !(strcmp($this->content, strip_tags($this->content)) == 0);\n }", "function strip_tags_content($text, $tags = '', $invert = false)\n{\n //removes <br> often found in google result text, which is not handled below\n $text = str_ireplace('<br>', '', $text);\n \n preg_match_all('/<(.+?)[\\s]*\\/?[\\s]*>/si', trim($tags), $tags);\n $tags = array_unique($tags[1]);\n \n if (is_array($tags) and count($tags) > 0) {\n //if invert is false, it will remove all tags except those passed a\n if ($invert == false) {\n return preg_replace('@<(?!(?:'. implode('|', $tags) .')\\b)(\\w+)\\b.*?>.*?</\\1>@si', '', $text);\n //if invert is true, it will remove only the tags passed to this function\n } else {\n return preg_replace('@<('. implode('|', $tags) .')\\b.*?>.*?</\\1>@si', '', $text);\n }\n //if no tags were passed to this function, simply remove all the tags\n } elseif ($invert == false) {\n return preg_replace('@<(\\w+)\\b.*?>.*?</\\1>@si', '', $text);\n }\n \n return $text;\n}", "function clean_inside_tags($txt,$tags){\n\t\t\t$txt =removeemptytags($txt);\n\t\t\tpreg_match_all(\"/<([^>]+)>/i\",$tags,$allTags,PREG_PATTERN_ORDER);\n\t\t\n\t\t\tforeach ($allTags[1] as $tag){\n\t\t\t\t$txt = preg_replace(\"/<\".$tag.\"[^>]*>/i\",\"<\".$tag.\">\",$txt);\n\t\t\t}\n\t\t\treturn $txt;\n\t\t}", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function extractMergeTagsPlaceHolders()\n {\n $pattern = '/' . preg_quote(static::TAG_PREFIX) .\n '((WAS' . preg_quote(static::TIME_DELIMITER) . ')?' .\n '(([A-Z0-9])' . '(' . preg_quote(static::CAPITAL_DELIMITER) . '|' .\n preg_quote(static::PROPERTY_DELIMITER) . ')?)+)' . // Not Coding Standard\n preg_quote(static::TAG_SUFFIX) .\n '/';\n // $this->mergeTags index 0 = with tag prefix and suffix, index 1 = without tag prefix and suffix\n $matchesCounts = preg_match_all($pattern, $this->content, $this->mergeTags);\n array_walk($this->mergeTags, 'static::resolveUniqueMergeTags');\n return $matchesCounts;\n }", "private function getTextBetweenTags($tag, $html, $strict = false)\n\t{\n\t\t// new dom document\n\t\t$dom = new domDocument;\n\n\t\t// load HTML\n\t\t($strict == true) ? $dom->loadXML($html) : $dom->loadHTML($html);\n\n\t\t// discard whitespace\n\t\t$dom->preserveWhiteSpace = false;\n\n\t\t// the array with results\n\t\t$results = array();\n\n\t\t// fetch the tag by name\n\t\t$content = $dom->getElementsByTagname($tag);\n\n\t\t// loop the content\n\t\tforeach($content as $item)\n\t\t{\n\t\t\t// add node value to results\n\t\t\t$results[] = $item->nodeValue;\n\t\t}\n\n\t\t// return the results\n\t\treturn $results;\n\t}", "function tc_get_the_tags() {\r\n return the_tags();\r\n}", "public function getContent_tagsArray() {\n\t\tif (!$this->_content_tagsArray) {\n\t\t\t$ret = array();\n\t\t\t$contents = $this->getObjects();\n\t\t\tforeach ($contents as $content){\n\t\t\t\t$tags = $content->getVar('content_tags','e');\n\t\t\t\t$tag_arr = explode(\",\",$tags);\n\t\t\t\tforeach ($tag_arr as $tag){\n\t\t\t\t\t$tag = trim($tag);\n\t\t\t\t\tif (isset($ret[$tag])){\n\t\t\t\t\t\t$ret[$tag]++;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$ret[$tag] = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach($ret as $k=>$v){\n\t\t\t\tif ($k != ''){\n\t\t\t\t\t$ret[$k] = $k.'('.$v.')';\n\t\t\t\t}else{\n\t\t\t\t\tunset($ret[$k]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_content_tagsArray = $ret;\n\t\t}\n\t\treturn $this->_content_tagsArray;\n\t}", "function parseHtml($s_str)\r\n{\r\n$i_indicatorL = 0;\r\n$i_indicatorR = 0;\r\n$s_tagOption = \"\";\r\n$i_arrayCounter = 0;\r\n$a_html = array();\r\n// Search for a tag in string\r\nwhile( is_int(($i_indicatorL=strpos($s_str,\"<\",$i_indicatorR))) ) {\r\n// Get everything into tag...\r\n$i_indicatorL++;\r\n$i_indicatorR = strpos($s_str,\">\", $i_indicatorL);\r\n$s_temp = substr($s_str, $i_indicatorL, ($i_indicatorR-$i_indicatorL) );\r\n$a_tag = explode( ' ', $s_temp );\r\n// Here we get the tag's name\r\nlist( ,$s_tagName,, ) = each($a_tag);\r\n$s_tagName = strtoupper($s_tagName);\r\n// Well, I am not interesting in <br>, </font> or anything else like that...\r\n// So, this is false for tags without options.\r\n$b_boolOptions = is_array(($s_tagOption=each($a_tag))) && $s_tagOption[1];\r\nif( $b_boolOptions ) {\r\n// Without this, we will mess up the array\r\n$i_arrayCounter = (int)count($a_html[$s_tagName]);\r\n// get the tag options, like src=\"htt://\". Here, s_tagTokOption is 'src'and s_tagTokValue is '\"http://\"'\r\n\r\ndo {\r\n$s_tagTokOption = strtoupper(strtok($s_tagOption[1], \"=\"));\r\n$s_tagTokValue = trim(strtok(\"=\"));\r\n$a_html[$s_tagName][$i_arrayCounter][$s_tagTokOption] =\r\n$s_tagTokValue;\r\n$b_boolOptions = is_array(($s_tagOption=each($a_tag))) &&\r\n$s_tagOption[1];\r\n} while( $b_boolOptions );\r\n}\r\n}\r\nreturn $a_html;\r\n}", "public function getTags()\n {\n if (! isset($this->tags)) {\n $this->tags =(($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getTagsQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->tags;\n }", "public static function getHtmlHeadByTag($text, $tags)\r\n\t{\r\n\t\t$head = ContentUtility::getHtmlHead($text);\r\n\t\t$rtn_text = \"\";\r\n\t\t\r\n\t\tif (!is_array($tags) && strlen(trim($tags)) > 0)\r\n\t\t{\r\n\t\t\t$tags = array(trim($tags));\r\n\t\t}\r\n\t\tforeach ($tags as $tag)\r\n\t\t{\r\n\t\t\t$tag = strtolower($tag);\r\n\t\r\n\t\t\t/* strip everything before <{tag}> */\r\n\t\t\t$start_pos\t= stripos($head, '<'.$tag);\r\n\t\t\t$temp_head = $head;\r\n\t\t\t\r\n\t\t\twhile ($start_pos !== false) \r\n\t\t\t{\r\n\t\t\t\t$temp_text = substr($temp_head, $start_pos);\r\n\t\t\r\n\t\t\t\t/* strip everything after </{tag}> or />*/\r\n\t\t\t\t$end_pos\t= stripos($temp_text, '</' . $tag . '>');\r\n\t\t\r\n\t\t\t\tif ($end_pos !== false) \r\n\t\t\t\t{\r\n\t\t\t\t\t$end_pos += strlen('</' . $tag . '>');\r\n\t\t\t\t\t\r\n\t\t\t\t\t// add an empty line after each tag information\r\n\t\t\t\t\t$rtn_text .= trim(substr($temp_text, 0, $end_pos)) . '\r\n\t\t\r\n\t';\r\n\t\t\t\t}\r\n\t\t\t\telse // match /> as ending tag if </tag> is not found\r\n\t\t\t\t{\r\n\t\t\t\t\t$end_pos\t= stripos($temp_text, '/>');\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($end_pos === false && stripos($temp_text, $tag.'>')===false){\r\n\t\t\t\t\t\t//if /> is not found, then this is not a valid XHTML\r\n\t\t\t\t\t\t//text iff it's not tag>\r\n\t\t\t\t\t\t$end_pos = stripos($temp_text, '>');\r\n\t\t\t\t\t\t$end_pos += strlen('>');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$end_pos += strlen('/>');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// add an empty line after each tag information\r\n\t\t\t\t\t$rtn_text .= trim(substr($temp_text, 0, $end_pos)) . '\r\n\t\t\r\n\t';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// initialize vars for next round of matching\r\n\t\t\t\t$temp_head = substr($temp_text, $end_pos);\r\n\t\t\t\t$start_pos = stripos($temp_head, '<'.$tag);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $rtn_text;\r\n\t}", "function strip_selected_tags($str, $tags = \"\", $stripContent = false)\n {\n preg_match_all(\"/<([^>]+)>/i\",$tags,$allTags,PREG_PATTERN_ORDER);\n foreach ($allTags[1] as $tag){\n if ($stripContent) {\n $str = preg_replace(\"/<\".$tag.\"[^>]*>.*<\\/\".$tag.\">/iU\",\"\",$str);\n }\n $str = preg_replace(\"/<\\/?\".$tag.\"[^>]*>/iU\",\"\",$str);\n }\n return $str;\n }", "public function parseCommentsLogsHtml($content){\n //$content = $content[0];\n\n $logs = explode('class=\"log\"', $content);\n unset($logs[0]);\n\n foreach ($logs as $_key => $_log){\n\n $log_parts = explode('<div class=\"ind\"></div>', $_log);\n\n $log_html = $log_parts[0];\n\n $date_string = explode('<div class=\"date\">', $log_html);\n $date_string = explode('</div>', $date_string[1]);\n $date_string = $date_string[0] ;\n\n if (strpos($date_string, '<span class=\"print\">') !== false){\n\n $date_string = explode('<span class=\"print\">', $date_string);\n $date_string = explode('</span>', $date_string[1]);\n\n $date_string = $date_string[0];\n\n }\n\n $tags_added = [];\n\n $log_html_without_strike = $log_html;\n\n if (strpos($log_html_without_strike, '<strike>') !== false){\n\n $log_html_without_strike = preg_replace('/<strike>(.){0,1000}<\\/strike>/', '', $log_html_without_strike);\n\n $tags_html = explode('<span class=\"tags\">', $log_html_without_strike);\n\n if (isset($tags_html[1])) {\n $tags_html = explode('</div>', $tags_html[1]);\n $tags_html = $tags_html[0];\n\n //$tags_html = strip_tags($tags_html);\n\n $tags_html = explode('<span', $tags_html);\n\n foreach ($tags_html as $_tag) {\n\n if (strpos($_tag, 'class=\"tag') === false)\n continue;\n\n $tag_parts = explode('</span>', $_tag);\n\n $tag_name = explode('\">', $tag_parts[0]);\n\n $tags_added[] = trim($tag_name[1]);\n\n }\n\n }\n\n }\n\n\n $logs[$_key] = [\n 'date' => $date_string,\n 'date_ymd' => self::convertDateStringToYmd($date_string),\n 'tags_added' => $tags_added,\n //'$tags_html' => $tags_html,\n //'$log_html_without_strike' => $log_html_without_strike,\n //'html' => $log_html,\n ];\n\n\n }\n\n\n return $logs ;\n\n }", "public function tags()\n {\n return array('html');\n }", "private function getSortedTags(): array\n {\n $commentTags = $this->docTagHelper->getCommentTagTokens();\n $sortedMetaTags = array_keys($this->tagMetadata);\n\n $tagNames = array_unique(\n array_column($commentTags, 'content')\n );\n\n uasort($tagNames, function ($tagA, $tagB) use ($sortedMetaTags) {\n $expectedPosA = array_search($tagA, $sortedMetaTags, true);\n $expectedPosB = array_search($tagB, $sortedMetaTags, true);\n\n if ($expectedPosA === false) {\n $expectedPosA = PHP_INT_MAX;\n }\n\n if ($expectedPosB === false) {\n $expectedPosB = PHP_INT_MAX;\n }\n\n if ($expectedPosA === $expectedPosB) {\n return 0;\n }\n\n return ($expectedPosA < $expectedPosB) ? -1 : 1;\n });\n\n return array_values($tagNames);\n }", "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}", "public function getTags() {}", "function remove_tags( $html, $tags, $strip_content = FALSE )\n\t{\n\t\t$content = '';\n\t\tif ( ! is_array( $tags ) )\n\t\t{\n\t\t\t$tags = ( strpos( $html, '>' ) !== FALSE ? explode( '>', str_replace( '<', '', $tags ) ) : [ $tags ] );\n\t\t\tif ( end( $tags ) == '' )\n\t\t\t{\n\t\t\t\tarray_pop( $tags );\n\t\t\t}\n\t\t}\n\t\tforeach ( $tags as $tag )\n\t\t{\n\t\t\tif ( $strip_content )\n\t\t\t{\n\t\t\t\t$content = '(.+</' . $tag . '[^>]*>|)';\n\t\t\t}\n\n\t\t\t$html = preg_replace( '#</?' . $tag . '[^>]*>' . $content . '#is', '', $html );\n\t\t}\n\n\t\treturn $html;\n\t}", "public function findCategories(&$body){\n $bodyArray = $this->getBodyArray($body);\n $rep = [\n 'tags:' => '',\n 'tag:' => '',\n ', ' => ',',\n \"\\n\" => '',\n \"\\r\" => ''\n ];\n $tags = false;\n foreach($bodyArray as $lines){\n $cleanLine = _j::replaceAll($rep, $line);\n if(_j::find(['tags:', 'tag:'], $cleanLine)){\n $tags = explode(',', $cleanLine);\n $body = str_replace($line, '', $body);\n break;\n }\n }\n return $tags;\n }", "public function extractContent()\n {\n $metas = $this->parsedDOM->getElementsByTagName('meta');\n\n // If exists meta-description, uses it\n foreach ($metas as $meta)\n {\n // Loops the list of attributes\n foreach ($meta->attributes as $attribute)\n {\n\n // Checks if the page is OG Compliant\n if ($attribute->name == 'name'\n && $attribute->value == 'og:description'\n && $meta->attributes->getNamedItem('content')->value !== ''\n ) {\n // Returns the og:description\n return trim($meta->attributes->getNamedItem('content')->value);\n }\n\n // looks for the description meta tag\n if ($attribute->name == 'name'\n && $attribute->value == 'description'\n && $meta->attributes->getNamedItem('content')->value !== ''\n ) {\n return trim($meta->attributes->getNamedItem('content')->value);\n }\n }\n }\n\n $article = $this->parsedDOM->getElementsByTagName('article')->item(0);\n\n if ($article !== null ) {\n // Search the first paragraph inside the article\n $paragraph = $article->firstChild->nodeValue;\n return trim($paragraph);\n\n }\n\n $paragraph = $this\n ->parsedDOM\n ->getElementsByTagName('p')\n ->item(0);\n\n if ($paragraph !== null) {\n return trim($paragraph);\n }\n\n return trim($this\n ->parsedDOM\n ->getElementsByTagName('body')\n ->item(0)\n ->nodeValue);\n }", "function displayTags($url) {\n\t\t\n\t\t$d = new DOMDocument;\n\t\t$d->loadHTMLFile($url);\n\t\t$body = $d->getElementsByTagName('body')->item(0);\n\t\t// perform innerhtml on $body by enumerating child nodes \n\t\t// and saving them individually\n\t\tforeach ($body->childNodes as $childNode) {\n \t\t\techo $d->saveHTML($childNode);\n\t\t}\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 }", "function getHeaderTags()\n {\n $filter = '(';\n for ($i = 1; $i <= 20; $i++) {\n $filter .= '//h' . $i . '|';\n }\n $filter = trim($filter, '|') . ')';\n \n $elements = $this->xpath->query($filter);\n $tags = [];\n foreach ($elements as $index => $element) {\n $level = filter_var($element->tagName, FILTER_SANITIZE_NUMBER_INT) - 1;\n $innerHtml = $this->DOMinnerHTML($element);\n \n $tags[$index]['header'] = $element->tagName;\n $tags[$index]['level'] = $level;\n $tags[$index]['name'] = trim(strip_tags($innerHtml));\n $tags[$index]['content'] = $innerHtml;\n $tags[$index]['toc'] = $this->getTOCFromTag($innerHtml);\n }\n return $tags;\n }", "function get_text_between_tags($string, $tagname){\r\n\t\t$d = new DOMDocument();\r\n\t\t@$d->loadHTML($string);\r\n\t\t$return = array();\r\n\t\tforeach($d->getElementsByTagName($tagname) as $item){\r\n\t\t\t\t$return[] = $item->textContent;\r\n\t\t}\r\n\t\treturn $return;\r\n}", "function CloseTags($html) {\n\t$html = preg_replace('/<[^>]*$/', '', $html); // ending with fraction of open tag\n\t// put open tags into an array\n\tpreg_match_all('#<([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);\n\t$opentags = $result[1];\n\t// put all closed tags into an array\n\tpreg_match_all('#</([a-z]+)>#iU', $html, $result);\n\t$closetags = $result[1];\n\t$len_opened = count($opentags);\n\t// if all tags are closed, we can return\n\tif (count($closetags) == $len_opened) {\n\t\treturn $html;\n\t}\n\t// close tags in reverse order that they were opened\n\t$opentags = array_reverse($opentags);\n\t// self closing tags\n\t$sc = array('br', 'input', 'img', 'hr', 'meta', 'link');\n\t// ,'frame','iframe','param','area','base','basefont','col'\n\t// should not skip tags that can have content inside!\n\tfor ($i = 0; $i < $len_opened; $i++) {\n\t\t$ot = strtolower($opentags[$i]);\n\t\tif (!in_array($opentags[$i], $closetags) && !in_array($ot, $sc)) {\n\t\t\t$html .= '</' . $opentags[$i] . '>';\n\t\t} else {\n\t\t\tunset($closetags[array_search($opentags[$i], $closetags)]);\n\t\t}\n\t}\n\treturn $html;\n}", "public function getList()\r\n {\r\n\t\tif (defined(\"WITH_SPHINX_TAGS\") && WITH_SPHINX_TAGS)\r\n\t\t{\r\n\t\t\t$tags = parent::getList();\r\n\t\t} else {\r\n\t\t\t$tags = $this->getGroupTagsList() +\r\n\t\t\t\t$this->getMembersTagsList() +\r\n\t\t\t\t$this->getDocumentsTagsList() +\r\n\t\t\t\t$this->getEventsTagsList() +\r\n\t\t\t\t$this->getPhotosTagsList() +\r\n\t\t\t\t$this->getListsTagsList();\r\n\t\t}\r\n return $tags;\r\n }", "public function get_tag_content($tag_to_grab, $input, $replace_html = true) {\n $tag_content = preg_split(\"/\\<$tag_to_grab\\>/i\", $input, 0);\n if (strpos($tag_to_grab, ' ') > 0) {\n $tag_to_grab = substr($tag_to_grab, 0, strpos($tag_to_grab, ' '));\n }\n\n $tag_content = preg_split(\"/\\<\\/$tag_to_grab\\>/i\", $tag_content[1], 0);\n\n if ($replace_html) {\n $tag_content[0] = str_replace('--lt--', '<', $tag_content[0]);\n $tag_content[0] = str_replace('--gt--', '>', $tag_content[0]);\n }\n\n return $tag_content[0];\n }", "function getOpeningTags(string $str): array\n{\n $openingTags = [];\n $pattern = \"/<[A-Z]+[^>]*>/\";\n preg_match_all($pattern, $str, $openingTags);\n $result = [];\n foreach ($openingTags as $oT) {\n foreach ($oT as $o) {\n $result[] = $o;\n }\n }\n return $result;\n}", "function getClosingTags(string $str): array\n{\n $closingTags = [];\n //update the pattern\n $pattern = \"/<\\/[A-Z]+>/\";\n preg_match_all($pattern, $str, $closingTags);\n $result = [];\n foreach ($closingTags as $cT) {\n foreach ($cT as $c) {\n $result[] = $c;\n }\n }\n return $result;\n}", "function filterHTMLTags( $text )\n{\n $text = preg_replace(\n array(\n // Remove invisible content\n '@<head[^>]*?>.*?</head>@siu',\n '@<style[^>]*?>.*?</style>@siu',\n '@<script[^>]*?.*?</script>@siu',\n '@<object[^>]*?.*?</object>@siu',\n '@<embed[^>]*?.*?</embed>@siu',\n '@<applet[^>]*?.*?</applet>@siu',\n '@<noframes[^>]*?.*?</noframes>@siu',\n '@<noscript[^>]*?.*?</noscript>@siu',\n '@<noembed[^>]*?.*?</noembed>@siu',\n // Add line breaks before and after blocks\n '@</?((address)|(blockquote)|(center)|(del))@iu',\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n '@</?((table)|(th)|(td)|(caption))@iu',\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n '@</?((frameset)|(frame)|(iframe))@iu',\n ),\n array(\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n \"\\n\\$0\", \"\\n\\$0\",\n ),\n $text );\n return strip_tags( $text );\n}", "public function getTags($aContentId)\n {\n $aFilters = $this->getFilters();\n \n if (array_key_exists('excludeContentId', $aFilters)\n && is_array($aFilters['excludeContentId'])) {\n $aContentId = array_diff($aContentId, $aFilters['excludeContentId']);\n }\n \n $aTags = $this->da->getTagsByTaggableFkId($aContentId,'cms_'.$aFilters['typeId']);\n \n if (array_key_exists('excludeTags', $aFilters)\n && is_array($aFilters['excludeTags'])) {\n $aTags = array_diff($aTags, $aFilters['excludeTags']);\n } \n return $aTags;\n }", "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 cardealer_filter_ptags_on_images($content){\r\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\r\n}", "function fix_tags($html) {\n $result = \"\";\n $tag_stack = array();\n\n // these corrections can simplify the regexp used to parse tags\n // remove whitespaces before '/' and between '/' and '>' in autoclosing tags\n $html = preg_replace(\"#\\s*/\\s*>#is\",\"/>\",$html);\n // remove whitespaces between '<', '/' and first tag letter in closing tags\n $html = preg_replace(\"#<\\s*/\\s*#is\",\"</\",$html);\n // remove whitespaces between '<' and first tag letter \n $html = preg_replace(\"#<\\s+#is\",\"<\",$html);\n\n while (preg_match(\"#(.*?)(<([a-z\\d]+)[^>]*/>|<([a-z\\d]+)[^>]*(?<!/)>|</([a-z\\d]+)[^>]*>)#is\",$html,$matches)) {\n $result .= $matches[1];\n $html = substr($html, strlen($matches[0]));\n\n // Closing tag \n if (isset($matches[5])) { \n $tag = $matches[5];\n\n if ($tag == $tag_stack[0]) {\n // Matched the last opening tag (normal state) \n // Just pop opening tag from the stack\n array_shift($tag_stack);\n $result .= $matches[2];\n } elseif (array_search($tag, $tag_stack)) { \n // We'll never should close 'table' tag such way, so let's check if any 'tables' found on the stack\n $no_critical_tags = !array_search('table',$tag_stack);\n if (!$no_critical_tags) {\n $no_critical_tags = (array_search('table',$tag_stack) >= array_search($tag, $tag_stack));\n };\n\n if ($no_critical_tags) {\n // Corresponding opening tag exist on the stack (somewhere deep)\n // Note that we can forget about 0 value returned by array_search, becaus it is handled by previous 'if'\n \n // Insert a set of closing tags for all non-matching tags\n $i = 0;\n while ($tag_stack[$i] != $tag) {\n $result .= \"</{$tag_stack[$i]}> \";\n $i++;\n }; \n \n // close current tag\n $result .= \"</{$tag_stack[$i]}> \";\n // remove it from the stack\n array_splice($tag_stack, $i, 1);\n // if this tag is not \"critical\", reopen \"run-off\" tags\n $no_reopen_tags = array(\"tr\",\"td\",\"table\",\"marquee\",\"body\",\"html\");\n if (array_search($tag, $no_reopen_tags) === false) {\n while ($i > 0) {\n $i--;\n $result .= \"<{$tag_stack[$i]}> \";\n }; \n } else {\n array_splice($tag_stack, 0, $i);\n };\n };\n } else {\n // No such tag found on the stack, just remove it (do nothing in out case, as we have to explicitly \n // add things to result\n };\n } elseif (isset($matches[4])) {\n // Opening tag\n $tag = $matches[4];\n array_unshift($tag_stack, $tag);\n $result .= $matches[2];\n } else {\n // Autoclosing tag; do nothing specific\n $result .= $matches[2];\n };\n };\n\n // Close all tags left\n while (count($tag_stack) > 0) {\n $tag = array_shift($tag_stack);\n $result .= \"</\".$tag.\">\";\n }\n\n return $result;\n}", "public abstract function cleanHTML($content);", "function wpgrade_filter_ptags_on_images($content){\r\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\r\n}", "function rssmi_html_tags($str){\n\t$htmlArray=array(\"<p>\",\"<a>\",\"<br>\");\n\t$str=strtolower($str);\n\t$str=str_replace(\"<\",\"\",$str);\n\t$str=str_replace(\">\",\"\",$str);\n\t$strA=explode(\",\", $str);\n\t$strHTML='';\n\tforeach ($strA as $val){\n\t\t\t$val = \"<\".$val.\">\";\n\t\tif (in_array($val,$htmlArray)){\n\t\t \t$strHTML.= $val;\n\t\t}\n\t}\n\treturn $strHTML;\t\n}", "function extract_tag( $html, $tag = 'div' )\n\t{\n\t\t$html = preg_replace( \"/(\\<\" . $tag . \")(.*?)(\" . $tag . \">)/si\", \"dada\", \"$html\" );\n\t\t$html = strip_tags( $html );\n\t\t$html = str_replace( \"<!--\", \"&lt;!--\", $html );\n\t\t$html = preg_replace( \"/(\\<)(.*?)(--\\>)/mi\", \"\" . nl2br( \"\\\\2\" ) . \"\", $html );\n\n\t\treturn $html;\n\t}", "protected function _getRelatedTags()\n {\n $uids = array();\n foreach ($this->_bookmarks as $bookmark) {\n $uids[] = (string)$bookmark->id;\n }\n $rtags = $this->_browser->getRelatedTags($uids);\n if (count($rtags)) {\n $html = '<div class=\"trean-tags-related\">'\n . Horde::img('tags.png') . ' <ul class=\"horde-tags\">';\n foreach (array_values($rtags) as $taginfo) {\n $html .= '<li>'\n . $GLOBALS['injector']->getInstance('Trean_TagBrowser')->addTagLink($taginfo['tag_name'])->link()\n . htmlspecialchars($taginfo['tag_name']) . '</a></li>';\n }\n return $html . '</ul></div>';\n }\n\n return '';\n }", "public function getHtmlElements();", "function apachesolr_add_tags_to_document(&$document, $text) {\r\n $tags_to_index = variable_get('apachesolr_tags_to_index', array(\r\n 'h1' => 'tags_h1',\r\n 'h2' => 'tags_h2_h3',\r\n 'h3' => 'tags_h2_h3',\r\n 'h4' => 'tags_h4_h5_h6',\r\n 'h5' => 'tags_h4_h5_h6',\r\n 'h6' => 'tags_h4_h5_h6',\r\n 'u' => 'tags_inline',\r\n 'b' => 'tags_inline',\r\n 'i' => 'tags_inline',\r\n 'strong' => 'tags_inline',\r\n 'em' => 'tags_inline',\r\n 'a' => 'tags_a'\r\n ));\r\n\r\n // Strip off all ignored tags.\r\n $text = strip_tags($text, '<'. implode('><', array_keys($tags_to_index)) .'>');\r\n\r\n preg_match_all('@<('. implode('|', array_keys($tags_to_index)) .')[^>]*>(.*)</\\1>@Ui', $text, $matches);\r\n foreach ($matches[1] as $key => $tag) {\r\n $tag = strtolower($tag);\r\n // We don't want to index links auto-generated by the url filter.\r\n if ($tag != 'a' || !preg_match('@(?:http://|https://|ftp://|mailto:|smb://|afp://|file://|gopher://|news://|ssl://|sslv2://|sslv3://|tls://|tcp://|udp://|www\\.)[a-zA-Z0-9]+@', $matches[2][$key])) {\r\n $document->{$tags_to_index[$tag]} .= ' '. $matches[2][$key];\r\n }\r\n }\r\n}", "private function extractScriptTags(&$content): string\n {\n $scripts = '';\n $scriptOpen = '<script';\n $scriptClose = '</script>';\n $scriptOpenPos = strpos($content, $scriptOpen);\n\n while ($scriptOpenPos !== false) {\n $scriptClosePos = strpos($content, $scriptClose, $scriptOpenPos);\n $script = substr($content, $scriptOpenPos, $scriptClosePos - $scriptOpenPos + strlen($scriptClose));\n $isXMagentoTemplate = strpos($script, 'text/x-magento-template') !== false;\n\n if ($isXMagentoTemplate) {\n $scriptOpenPos = strpos($content, $scriptOpen, $scriptClosePos);\n continue;\n }\n\n // HS: skip the scripts that contain excluded.\n if (strpos($script, 'excluded') !== false) {\n $scriptOpenPos = strpos($content, $scriptOpen, $scriptClosePos);\n continue;\n }\n\n $scripts .= \"\\n\" . $script;\n $content = str_replace($script, '', $content);\n // Script cut out, continue search from its position.\n $scriptOpenPos = strpos($content, $scriptOpen, $scriptOpenPos);\n }\n\n return $scripts;\n }", "public function tags() {\n\t\treturn $this->get_tags();\n\t}", "private function processTags($tags) {\n $results = array();\n foreach ($tags as $tag) {\n $results[] = array(\n 'file' => $tag->getAttribute('file'),\n 'start' => $tag->getAttribute('start'),\n 'end' => $tag->getAttribute('end'),\n );\n }\n return $results;\n }", "private static function do_shortcodes_in_html_tags( $content, $tagnames ) {\n $trans = array(\n '&#91;' => '&#091;',\n '&#93;' => '&#093;',\n );\n $content = strtr( $content, $trans );\n $trans = array(\n '[' => '&#91;',\n ']' => '&#93;',\n );\n\n $pattern = self::get_shortcode_regex( $tagnames );\n $textarr = self::html_split( $content );\n\n foreach ( $textarr as &$element ) {\n if ( '' == $element || '<' !== $element[0] ) {\n continue;\n }\n\n $noopen = false === strpos( $element, '[' );\n $noclose = false === strpos( $element, ']' );\n if ( $noopen || $noclose ) {\n // This element does not contain shortcodes.\n if ( $noopen xor $noclose ) {\n // Need to encode stray [ or ] chars.\n $element = strtr( $element, $trans );\n }\n continue;\n }\n\n if ( $ignore_html || '<!--' === substr( $element, 0, 4 ) || '<![CDATA[' === substr( $element, 0, 9 ) ) {\n // Encode all [ and ] chars.\n $element = strtr( $element, $trans );\n continue;\n }\n\n $attributes = $this->kses_attr_parse( $element );\n if ( false === $attributes ) {\n // Some plugins are doing things like [name] <[email]>.\n if ( 1 === preg_match( '%^<\\s*\\[\\[?[^\\[\\]]+\\]%', $element ) ) {\n $element = preg_replace_callback( \"/$pattern/\", 'do_shortcode_tag', $element );\n }\n\n // Looks like we found some crazy unfiltered HTML. Skipping it for sanity.\n $element = strtr( $element, $trans );\n continue;\n }\n\n // Get element name\n $front = array_shift( $attributes );\n $back = array_pop( $attributes );\n $matches = array();\n preg_match( '%[a-zA-Z0-9]+%', $front, $matches );\n $elname = $matches[0];\n\n // Look for shortcodes in each attribute separately.\n foreach ( $attributes as &$attr ) {\n $open = strpos( $attr, '[' );\n $close = strpos( $attr, ']' );\n if ( false === $open || false === $close ) {\n continue; // Go to next attribute. Square braces will be escaped at end of loop.\n }\n $double = strpos( $attr, '\"' );\n $single = strpos( $attr, \"'\" );\n if ( ( false === $single || $open < $single ) && ( false === $double || $open < $double ) ) {\n // $attr like '[shortcode]' or 'name = [shortcode]' implies unfiltered_html.\n // In this specific situation we assume KSES did not run because the input\n // was written by an administrator, so we should avoid changing the output\n // and we do not need to run KSES here.\n $attr = preg_replace_callback( \"/$pattern/\", array($this, 'do_shortcode_tag'), $attr );\n } else {\n // $attr like 'name = \"[shortcode]\"' or \"name = '[shortcode]'\"\n // We do not know if $content was unfiltered. Assume KSES ran before shortcodes.\n $count = 0;\n $new_attr = preg_replace_callback( \"/$pattern/\", array($this, 'do_shortcode_tag'), $attr, -1, $count );\n if ( $count > 0 ) {\n // Sanitize the shortcode output using KSES.\n $new_attr = $this->kses_one_attr( $new_attr, $elname );\n if ( '' !== trim( $new_attr ) ) {\n // The shortcode is safe to use now.\n $attr = $new_attr;\n }\n }\n }\n }\n $element = $front . implode( '', $attributes ) . $back;\n\n // Now encode any remaining [ or ] chars.\n $element = strtr( $element, $trans );\n }\n\n $content = implode( '', $textarr );\n\n return $content;\n }", "function tags() {\n\n\t\t$preloader = pb_query_preloader::getInstance();\n\t\t$preloadRow = $preloader->getPreloadArticleTag($this->id);\n\n\t\tif ($preloadRow) {\n\t\t\t$rows = $preloadRow;\n\t\t} else {\n\t\t\tglobal $polarbear_db;\n\t\t\t$sql = \"SELECT tagID FROM \" . POLARBEAR_DB_PREFIX . \"_article_tag_relation WHERE articleID = '$this->id'\";\n\t\t\t$rows = $polarbear_db->get_results($sql);\n\t\t}\n\n\t\t$arrTags = array();\n\t\tif ($rows) {\n\t\t\tforeach ($rows as $row) {\n\t\t\t\t$arrTags[] = polarbear_tag::getInstance($row->tagID);\n\t\t\t}\n\t\t}\n\n\t\tpb_pqp_log_speed(\"article tags()\");\n\n\t\treturn $arrTags;\n\t}", "public static function ok_tags($html){\n \treturn self::closetags(strip_tags($html, \"<b><strong><i><em>\"));\n }", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function baindesign324_filter_ptags_on_images($content){\n\t return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n\t}", "private function get_tags()\n\t{\n\t\t$this->n_tags = true;\n\t\treturn $this->m_tags;\n\t}", "private function get_tags()\n\t{\n\t\t$this->n_tags = true;\n\t\treturn $this->m_tags;\n\t}", "public function get_tag_content_array($tag_to_grab, $input) {\n $output = [];\n $tag_content = preg_split(\"/\\<$tag_to_grab\\>/i\", $input, 0);\n $i = 1;\n\n while ($i < sizeof($tag_content)) {\n if (strpos($tag_to_grab, ' ') > 0) {\n $tag_to_grab = substr($tag_to_grab, 0, strpos($tag_to_grab, ' '));\n }\n $block = preg_split(\"/\\<\\/$tag_to_grab\\>/i\", $tag_content[$i], 0);\n $output[] = $block[0];\n $i++;\n }\n\n return $output;\n }", "function tlh_filter_ptags_on_images( $content ) {\n\treturn preg_replace( '/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content );\n}", "function manhattan_remove_tags( $content ) {\r\n\t\t$tags = array(\r\n\t\t\t'<p>[' => '[',\r\n\t\t\t']</p>' => ']'\r\n\t\t);\r\n\t\t\r\n\t\treturn strtr( $content, $tags );\r\n\t}", "public static function close_tags($html){\n\n \t#put all opened tags into an array\n \tpreg_match_all(\"#<([a-z]+)( .*)?(?!/)>#iU\",$html,$result);\n \t$openedtags=$result[1];\n\n \t#put all closed tags into an array\n \tpreg_match_all(\"#</([a-z]+)>#iU\",$html,$result);\n \t$closedtags=$result[1];\n \t$len_opened = count($openedtags);\n\n \t#all tags are closed\n \tif(count($closedtags) == $len_opened){\n \t\treturn $html;\n \t}\n \t$openedtags = array_reverse($openedtags);\n\n \t#close tags\n \tfor($i=0;$i < $len_opened;$i++) {\n \t\tif (!in_array($openedtags[$i],$closedtags)){\n \t\t\t$html .= '</'.$openedtags[$i].'>';\n \t\t} else {\n \t\t\tunset($closedtags[array_search($openedtags[$i],$closedtags)]);\n \t\t}\n \t}\n \treturn $html;\n }", "public function stripSpecificTags($tags, $content)\n {\n foreach ($tags as $tag) {\n $content = preg_replace('/<\\\\/?' . $tag . '(.|\\\\s)*?>/', '', $content);\n }\n return $content;\n }", "function reparseWords($words_to_process) {\n $sql = \"SELECT `title`, `content` FROM `scrape_word_data` WHERE `title` = 'абиогенеза/ж' \";\n $res = _mysqli_query($sql);\n foreach($res as $item) {\n $content = $item['content'];\n\n $doc = new DOMDocument();\n $doc->loadHTML($content);\n $cnt = 0;\n foreach ($doc->childNodes as $item) {\n $cnt++;\n echo \"================== $cnt =================\\n\";\n print_r($item);\n }\n //echo $doc->saveHTML();\n }\n}", "protected function getPostTags(Crawler $postPage) {\n $tags = array();\n $tagsLinks = $postPage->filter('.post__tags .tags a');\n foreach ($tagsLinks as $tagLink){\n $tags[]=$tagLink->textContent;\n }\n return $tags;\n }", "function parseXmlTags($content, $tag_name)\n {\n $parsed_value=\"\";\n\n if (!empty($content) && !empty($tag_name))\n {\n preg_match_all(\"/<\".preg_quote($tag_name, \"/\").\">(.*?)<\\/\".preg_quote($tag_name, \"/\").\">/ims\", $content, $output_array, PREG_SET_ORDER);\n\n if (!empty($output_array[0][1]))\n {\n $parsed_value=trim($output_array[0][1]);\n }\n }\n\n return $parsed_value;\n }", "function custom_filter_ptags_on_images($content){\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "public function findTags(&$body){\n $bodyArray = $this->getBodyArray($body);\n $rep = [\n 'categories:' => '',\n 'category:' => '',\n ', ' => ',',\n \"\\n\" => '',\n \"\\r\" => ''\n ];\n $categories = false;\n foreach($bodyArray as $lines){\n $line = _j::replaceAll($rep, $line);\n if(_j::find(['categories:', 'category:'], $line)){\n $categories = explode(',', $categories);\n $body = str_replace($line, '', $body);\n break;\n }\n }\n return $categories;\n }", "public function get_tags()\r\n\t{\r\n\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=tag\");\r\n\t\treturn $xml;\r\n\t}", "protected function do_shortcodes_in_html_tags($content, $ignore_html, $tagnames) { //-+\n\t\t// Normalize entities in unfiltered HTML before adding placeholders.\n\t\t$trans = array('&#91;' => '&#091;', '&#93;' => '&#093;');\n\t\t$content = strtr($content, $trans);\n\t\t$trans = array('[' => '&#91;', ']' => '&#93;');\n\t\n\t\t$pattern = $this->get_shortcode_regex($tagnames);\n\t\t$textarr = $this->wp_html_split($content);\n\t\n\t\tforeach ($textarr as &$element) {\n\t\t\tif ('' == $element || '<' !== $element[0]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t$noopen = false === strpos($element, '[');\n\t\t\t$noclose = false === strpos($element, ']');\n\t\t\tif ($noopen || $noclose) {\n\t\t\t\t// This element does not contain shortcodes.\n\t\t\t\tif ($noopen xor $noclose) {\n\t\t\t\t\t// Need to encode stray [ or ] chars.\n\t\t\t\t\t$element = strtr($element, $trans);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\tif ($ignore_html || '<!--' === substr($element, 0, 4) || '<![CDATA[' === substr($element, 0, 9)) {\n\t\t\t\t// Encode all [ and ] chars.\n\t\t\t\t$element = strtr($element, $trans);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t$attributes = $this->wp_kses_attr_parse($element);\n\t\t\tif (false === $attributes) {\n\t\t\t\t// Some plugins are doing things like [name] <[email]>.\n\t\t\t\tif (1 === preg_match('%^<\\s*\\[\\[?[^\\[\\]]+\\]%', $element)) {\n\t\t\t\t\t$element = preg_replace_callback(\"/$pattern/\", [$this, 'do_shortcode_tag'], $element);\n\t\t\t\t}\n\t\n\t\t\t\t// Looks like we found some crazy unfiltered HTML. Skipping it for sanity.\n\t\t\t\t$element = strtr($element, $trans);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t// Get element name\n\t\t\t$front = array_shift($attributes);\n\t\t\t$back = array_pop($attributes);\n\t\t\t$matches = array();\n\t\t\tpreg_match('%[a-zA-Z0-9]+%', $front, $matches);\n\t\t\t$elname = $matches[0];\n\t\n\t\t\t// Look for shortcodes in each attribute separately.\n\t\t\tforeach ($attributes as &$attr) {\n\t\t\t\t$open = strpos($attr, '[');\n\t\t\t\t$close = strpos($attr, ']');\n\t\t\t\tif (false === $open || false === $close) {\n\t\t\t\t\tcontinue; // Go to next attribute. Square braces will be escaped at end of loop.\n\t\t\t\t}\n\t\t\t\t$double = strpos($attr, '\"');\n\t\t\t\t$single = strpos($attr, \"'\");\n\t\t\t\tif ((false === $single || $open < $single) && (false === $double || $open < $double)) {\n\t\t\t\t\t// $attr like '[shortcode]' or 'name = [shortcode]' implies unfiltered_html.\n\t\t\t\t\t// In this specific situation we assume KSES did not run because the input\n\t\t\t\t\t// was written by an administrator, so we should avoid changing the output\n\t\t\t\t\t// and we do not need to run KSES here.\n\t\t\t\t\t$attr = preg_replace_callback(\"/$pattern/\", [$this, 'do_shortcode_tag'], $attr);\n\t\t\t\t} else {\n\t\t\t\t\t// $attr like 'name = \"[shortcode]\"' or \"name = '[shortcode]'\"\n\t\t\t\t\t// We do not know if $content was unfiltered. Assume KSES ran before shortcodes.\n\t\t\t\t\t$count = 0;\n\t\t\t\t\t$new_attr = preg_replace_callback(\"/$pattern/\", [$this, 'do_shortcode_tag'], $attr, -1, $count);\n\t\t\t\t\tif ($count > 0) {\n\t\t\t\t\t\t// Sanitize the shortcode output using KSES.\n//!!!\t\t\t\t\t\t$new_attr = wp_kses_one_attr($new_attr, $elname);\n\t\t\t\t\t\tif ('' !== trim($new_attr)) {\n\t\t\t\t\t\t\t// The shortcode is safe to use now.\n\t\t\t\t\t\t\t$attr = $new_attr;\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$element = $front . implode('', $attributes) . $back;\n\t\n\t\t\t// Now encode any remaining [ or ] chars.\n\t\t\t$element = strtr($element, $trans);\n\t\t}\n\t\n\t\t$content = implode('', $textarr);\n\t\n\t\treturn $content;\n\t}", "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}", "static function getTags($content_type = '', $whole = false, $tag_ids = array(), $include = true, $order = 'lft', $order_dir = 'ASC')\n\t{\n\t\t$tags = array();\n\n\t\t$db = JFactory::getDBO();\n\t\t$query = $db->getQuery(true);\n\n\t\tif ($whole) { // get the whole object\n\t\t\t$query->select('a.*');\n\t\t} else {\n\t\t\t$query->select('a.id, a.path, a.title, a.level');\n\t\t}\n\t\t$query->from('#__tags AS a');\n\t\t$query->join('LEFT', $db->quoteName('#__tags').' AS b ON a.lft > b.lft AND a.rgt < b.rgt');\n\n\t\t// get tags for a specific content type\n\t\tif (!empty($content_type)) { // get only tags associated with the content type\n\t\t\t$query->join('INNER', $db->quoteName('#__contentitem_tag_map').' AS m ON m.tag_id = a.id AND m.type_alias ='.$db->quote($content_type));\n\t\t}\n\n\t\t$query->where('a.published = 1');\n\t\t$query->where($db->quoteName('a.alias').' <> '.$db->quote('root'));\n\n\t\t// get tags with specific ids\n\t\tif (is_array($tag_ids) && count($tag_ids) > 0) {\n\t\t\tJArrayHelper::toInteger($tag_ids);\n\t\t\t$tag_ids = implode(',', $tag_ids);\n\n\t\t\t$test_type = $include ? 'IN' : 'NOT IN';\n\t\t\t$query->where($db->quoteName('a.id').' '.$test_type.' ('.$tag_ids.')');\n\t\t}\n\n\t\t// access groups\n\t\t$user = JFactory::getUser();\n\t\t$groups = implode(',', $user->getAuthorisedViewLevels());\n\t\t$query->where('a.access IN (' . $groups . ')');\n\n\t\t// language\n\t\tif (JLanguageMultilang::isEnabled()) {\n\t\t\t$language = JHelperContent::getCurrentLanguage();\n\t\t\t$query->where($db->quoteName('a.language').' IN ('.$db->quote($language).', '.$db->quote('*').')');\n\t\t}\n\n\t\t$query->group('a.id, a.title, a.level, a.lft, a.rgt, a.parent_id, a.path');\n\t\t$query->order('a.'.$order.' '.$order_dir);\n\n\t\t$db->setQuery($query);\n\n\t\ttry {\n\t\t\t$tags = $db->loadObjectList();\n\t\t} catch (RuntimeException $e) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $tags;\n\t}", "function mdwpfp_filter_ptags_on_images($content){\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\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 }", "public function getElements()\n {\n $CONTENT = 0; // In content between the tages\n $IN_APOS = 1; // In a single quoted string in an element tag\n $IN_ENT = 2; // In an entity reference\n $IN_TAG = 3; // In an element tag (closing or opening does not matter\n $IN_QUOT = 4; // In a double quoted string in an element tag\n\n $length = strlen($this->_value);\n $result = array();\n $startPos = 0;\n $mode = $CONTENT;\n\n for ($i = 0; $i < $length; $i++) {\n switch ($this->_value[$i]) {\n case '&':\n if ($CONTENT === $mode) {\n if ($i > $startPos) {\n // Add content (does not start with < or &\n $result[] = substr($this->_value, $startPos, $i - $startPos);\n }\n $startPos = $i;\n $mode = $IN_ENT;\n }\n break;\n\n case ';':\n if ($IN_ENT === $mode) {\n // Add the entity (including & and ;\n $result[] = substr($this->_value, $startPos, $i - $startPos + 1);\n $startPos = $i + 1;\n $mode = $CONTENT;\n }\n break;\n\n case '<':\n if (($CONTENT === $mode) || ($IN_ENT === $mode)) {\n if ($i > $startPos) {\n // Add content (does not start with < or &\n $result[] = substr($this->_value, $startPos, $i - $startPos);\n }\n $startPos = $i;\n $mode = $IN_TAG;\n }\n break;\n\n case '>':\n if ($IN_TAG === $mode) {\n // Add the tag including opening '<' and closing '>'\n $result[] = substr($this->_value, $startPos, $i - $startPos + 1);\n $startPos = $i + 1;\n $mode = $CONTENT;\n }\n break;\n\n case '\\'':\n if ($IN_TAG === $mode) {\n // Only a mode change when in an element tag\n $mode = $IN_APOS;\n } elseif ($IN_APOS === $mode) {\n // End quote, resume tag mode\n $mode = $IN_TAG;\n }\n break;\n\n case '\"':\n if ($IN_TAG === $mode) {\n // End quote, resume tag mode\n $mode = $IN_QUOT;\n } elseif ($IN_QUOT === $mode) {\n // End quote, resume tag mode\n $mode = $IN_TAG;\n }\n break;\n\n // default:\n // Intentional fall through\n }\n }\n\n if ($startPos < $length) {\n $result[] = substr($this->_value, $startPos);\n }\n return $result;\n }", "public static function getContentTags(){\n return \\Illuminate\\View\\Compilers\\BladeCompiler::getContentTags();\n }", "private function processContent(){\n\t\t$this->textEnd = strpos($this->raw,\"</{$this->tag}\");\n\t\t$this->text = trim(substr($this->raw, $this->textStart, $this->textEnd - $this->textStart));\n\t}", "function filter_ptags_on_images($content){\n$content = preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\nreturn preg_replace('/<p>\\s*(<iframe .*>*.<\\/iframe>)\\s*<\\/p>/iU', '\\1', $content);\n}", "public abstract function get_html();" ]
[ "0.67558795", "0.62464356", "0.6056972", "0.6045867", "0.6034552", "0.58729476", "0.5839546", "0.577781", "0.5768152", "0.57487446", "0.5721718", "0.5692347", "0.5675597", "0.56672585", "0.5629265", "0.55759364", "0.55317855", "0.5505932", "0.5492731", "0.54720014", "0.54619825", "0.5455901", "0.54487175", "0.54487175", "0.54487175", "0.54487175", "0.54487175", "0.5440672", "0.542574", "0.54155314", "0.54126084", "0.5405894", "0.54041", "0.53965926", "0.53886163", "0.53812265", "0.53769", "0.5346377", "0.5343267", "0.53282785", "0.53262174", "0.5293305", "0.52916723", "0.5264876", "0.52641726", "0.52617013", "0.52579015", "0.5251367", "0.52410936", "0.52238894", "0.5221965", "0.52127737", "0.5205549", "0.5195391", "0.519223", "0.51739484", "0.51694274", "0.5169291", "0.5169038", "0.51484007", "0.514518", "0.5131988", "0.51239604", "0.5114762", "0.5111726", "0.5105535", "0.5098018", "0.50896525", "0.50847745", "0.50795746", "0.5075055", "0.5075055", "0.5075055", "0.5075055", "0.5075055", "0.5075055", "0.5073111", "0.50683725", "0.50683725", "0.506773", "0.50671524", "0.5063347", "0.50606096", "0.5038691", "0.50319886", "0.5022856", "0.5021195", "0.5017811", "0.50154346", "0.50101894", "0.5003786", "0.49999592", "0.499838", "0.49971935", "0.4987192", "0.49843284", "0.49767882", "0.49752936", "0.49731892", "0.49631423" ]
0.52261394
49
Close a tag. Must balance tag_open calls or an error is thrown.
public static function tag_close(string $name = null): string { if (count(self::$tag_stack) === 0) { throw new SemanticsException("Closing tag without open ($name)"); } $top_name = array_pop(self::$tag_stack); if ($name !== null && strcasecmp($name, $top_name) !== 0) { throw new SemanticsException("Closing tag $name when it should be $top_name"); } return '</' . $top_name . '>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function close_tag($tag, $pref, $nl)\n{\n tag($tag, 'close', $pref, $nl) ;\n}", "function _tag_close( $parser, $tag )\n {\n $this->curtag = &$this->curtag->parent;\n }", "function CloseTag() {\n\t\tif (!empty($this->tag)) {\n\t\t\tfor ($in=0;$in<$this->indent; $in++) {\n\t\t\t\t$this->outputCode.=\"\";\n\t\t\t}\n\t\t\tif (!empty($this->tag))\n\t\t\t$this->outputCode.=\"</\".$this->tag.\">\";\n\t\t}\n\t\t//$this->outputCode.=\"\\n\";\n\t\t$this->indent--;\n\t}", "public function closeTag($tag) {\n\t\treturn '</' . $tag . '>';\n\t}", "public static function closeTag($tag) {\n\t\treturn '</' . $tag . '>';\n\t}", "public static function closeTag($tag) {\n return '</' . $tag . '>';\n }", "function CloseTag($tag) {\n\t\t\t$removedStyle = array_pop($this->styleStack);\n\t\t\t$this->applyStyle();\n\t\t}", "public function close() {\n\t\t\n\t\t// Render close tag\n\t\t\n\t\t$this->_post_render();\n\t\t\n\t\techo true === $this->options['render_tag'] ? $this->_render_tag( true ) : '';\n\t\t\n\t\techo $this->options['after'];\n\t\t\n\t}", "private function tag_close($tag)\r\n\t{\r\n\t\tif(!$this->current_tag instanceof SBBCodeParser_Document\r\n\t\t\t&& $tag !== $this->current_tag->tag())\r\n\t\t{\r\n\t\t\t$closing_tags = $this->bbcodes[$this->current_tag->tag()]->closing_tags();\r\n\r\n\t\t\tif(in_array($tag, $closing_tags) || in_array('/' . $tag, $closing_tags))\r\n\t\t\t\t$this->current_tag = $this->current_tag->parent();\r\n\t\t}\r\n\t\t\r\n\t\tif($this->current_tag instanceof SBBCodeParser_Document)\r\n\t\t\treturn false;\r\n\t\telse if($tag !== $this->current_tag->tag())\r\n\t\t{\r\n\t\t\t// check if this is a tag inside another tag like\r\n\t\t\t// [tag1] [tag2] [/tag1] [/tag2]\r\n\t\t\t$node = $this->current_tag->find_parent_by_tag($tag);\r\n\t\t\t\r\n\t\t\tif($node !== null)\r\n\t\t\t{\r\n\t\t\t\t$this->current_tag = $node->parent();\r\n\r\n\t\t\t\twhile(($node = $node->last_tag_node()) !== null)\r\n\t\t\t\t{\r\n\t\t\t\t\t$new_node = new SBBCodeParser_TagNode($node->tag(), $node->attributes());\r\n\t\t\t\t\t$this->current_tag->add_child($new_node);\r\n\t\t\t\t\t$this->current_tag = $new_node;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->current_tag = $this->current_tag->parent();\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function closeTag(): string\n {\n return $this->templateCloseTag;\n }", "public function closeTag()\n {\n return '</span>';\n }", "public function close()\n {\n libxml_clear_errors();\n\n $this->reader->close();\n }", "public function closeTag()\n {\n $this->writer->write('?>' . PHP_EOL);\n return $this;\n }", "public function close()\n {\n ps_close_image($this->document->resource, $this->id);\n call_user_func($this->dtor);\n\n $this->document = $this->dtor = null;\n }", "public function closeHtmlTag($tag)\n {\n return $this->isSelfClosingTag($tag) ? '' : '</'.$tag.'>';\n }", "function close()\n {\n $this->link->close();\n }", "public static function close() {}", "public function close()\n {\n if ($this->closed)\n {\n return;\n }\n \n $this->closed = true;\n $this->writable = false;\n $this->data = '';\n \n if($this->handle)\n {\n $this->loop->removeCurlHandle($this->handle);\n $this->handle = null;\n }\n \n $this->emit('close');\n $this->removeAllListeners();\n }", "function close() {}", "public function close() {\r\n\t\tif ($this->opened) {\r\n\t\t\t$this->file->close();\r\n\t\t\t$this->opened = false;\r\n\t\t}\r\n\t}", "public function close() {}", "public function close() {}", "public function close() {}", "public function close() {}", "function create_close_tag($tagName)\n {\n return $this->createCloseTag($tagName);\n }", "public function getClosingTag() {\n return $this->closingTag;\n }", "abstract public function close();", "abstract public function close();", "abstract public function close();", "abstract public function close();", "abstract public function close();", "function foldClose(&$parser, $tag, $empty = false): void\n\t{\n\t\t$this->orig_obj->{$this->orig_close_method}($parser, strtoupper($tag), $empty);\n\t}", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close()\n {\n $this->fclose();\n }", "public function close(): void;", "public function close(): void;", "public function close(): void;", "public function setClosingTag($closingTag) {\n $this->closingTag = $closingTag;\n }", "public function close()\n {\n curl_close($this->curl);\n $this->curl = null;\n }", "public function close()\n {\n curl_close($this->_handle);\n }", "public function close()\n {\n curl_close($this->curl);\n $this->curl = null;\n }", "public function close()\n {\n if (fclose($this->stream)) {\n $this->stream = null;\n }\n }", "public function close()\n {\n curl_close($this->handle);\n }", "public function getCloseTagWrapper()\n {\n }", "public function close()\n {\n curl_close($this->curl);\n }", "public static function close()\n\t{\n\t\tself::$link->close();\n\t}", "function _close() {}", "function close_html()\n{\n close_tag('html', '', true) ;\n}", "public function close() {\n }", "public function close()\n {\n if ( $this->mh ){\n curl_multi_close( $this->mh );\n $this->mh = null;\n }\n }", "public function close()\n {\n }", "public function close()\n {\n }", "public function close() {\n // DO NOTHING!!!!\n }", "public function close() {\n\t}", "public static function close_tags($html){\n\n \t#put all opened tags into an array\n \tpreg_match_all(\"#<([a-z]+)( .*)?(?!/)>#iU\",$html,$result);\n \t$openedtags=$result[1];\n\n \t#put all closed tags into an array\n \tpreg_match_all(\"#</([a-z]+)>#iU\",$html,$result);\n \t$closedtags=$result[1];\n \t$len_opened = count($openedtags);\n\n \t#all tags are closed\n \tif(count($closedtags) == $len_opened){\n \t\treturn $html;\n \t}\n \t$openedtags = array_reverse($openedtags);\n\n \t#close tags\n \tfor($i=0;$i < $len_opened;$i++) {\n \t\tif (!in_array($openedtags[$i],$closedtags)){\n \t\t\t$html .= '</'.$openedtags[$i].'>';\n \t\t} else {\n \t\t\tunset($closedtags[array_search($openedtags[$i],$closedtags)]);\n \t\t}\n \t}\n \treturn $html;\n }", "public function close () {\n\t\treturn !empty($this->_close)\n\t\t\t? $this->_close\n\t\t\t: self::CLOSE\n\t\t;\n\t}", "public function close():void\n\t{\n\t\tif( $this->_status === self::STATUSES['DONE'] )\n\t\t\t$this->_status= self::STATUSES['CLOSED'];\n\t}", "public function close()\n {\n $this->_c->close();\n }", "private function close() {\n echo \"</{$this->name}>\\n\";\n }", "protected function close() {\n fclose($this->handle);\n }", "public function close()\n {\n if (null !== $this->handle && \\is_resource($this->handle)) {\n fclose($this->handle);\n $this->handle = null;\n }\n }", "public function closeTag()\n {\n return '</form> </div></div>';\n }", "function _close() {\n }", "abstract protected function close();", "function close_tag($tag, $sample_html) {\n return preg_replace(\"!(<{$tag}(\\s[^>]*[^/>])?)>!si\",\"\\\\1/>\",$sample_html);\n}", "private function close()\n {\n if ($this->stream) {\n $this->stream->close();\n }\n }", "public function close(): void\n {\n }", "public function close()\n {\n }", "public function close()\n {\n }", "public function close()\n {\n }", "public function close()\n {\n }", "public function close()\n {\n }", "public function close()\n {\n }", "public function close()\n {\n }", "public function close()\n {\n }", "public function close()\n {\n }", "public function close() {\n $this->stream->close();\n }", "public function endTag($tag)\n {\n if ($this->region->equals(TagRegion::IN_HEAD()) && $tag->upperName() === Tag::HEAD) {\n $this->region = TagRegion::PRE_BODY();\n }\n\n /*\n * We ignore close body tags (</body) and instead insert them when their outer scope is closed (/html). This is\n * closer to how a browser parser works. The idea here is if other tags are found after the <body>, (ex: <div>)\n * which are only allowed in the <body>, we will effectively move them into the body section.\n */\n if ($tag->upperName() === Tag::BODY) {\n return;\n }\n\n /*\n * We look for tag.upperName() from the end. If we can find it, we pop everything from thereon off the stack. If\n * we can't find it, we don't bother with closing the tag, since it doesn't have a matching open tag, though in\n * practice the HtmlParser class will have already manufactured a start tag.\n */\n for ($index = count($this->stack) - 1; $index >= 0; $index--) {\n if ($this->stack[$index] === $tag->upperName()) {\n while (count($this->stack) > $index) {\n if ($this->stack[count($this->stack) - 1] === Tag::SVG) {\n $this->region = TagRegion::IN_BODY();\n }\n $this->handler->endTag(new ParsedTag(array_pop($this->stack)));\n }\n\n return;\n }\n }\n }", "public function close()\n {\n curl_close($this->_session);\n }" ]
[ "0.72257227", "0.70528936", "0.7035683", "0.69079286", "0.6874167", "0.67322594", "0.67303836", "0.65943414", "0.6531123", "0.65046865", "0.64132315", "0.63182795", "0.6293621", "0.62470335", "0.6213686", "0.6177745", "0.61774683", "0.61674964", "0.615795", "0.6145885", "0.6127416", "0.6127416", "0.6127416", "0.61269283", "0.61241066", "0.6112738", "0.6103692", "0.6103692", "0.6103692", "0.6103692", "0.6103692", "0.6099512", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.6047184", "0.60420644", "0.60367084", "0.60367084", "0.60367084", "0.60212266", "0.5999904", "0.59904855", "0.5983074", "0.5979103", "0.5966885", "0.59546214", "0.59383637", "0.5879144", "0.58757585", "0.58695906", "0.5864849", "0.58604664", "0.5859281", "0.585824", "0.58462703", "0.58435494", "0.58374083", "0.5835648", "0.58165985", "0.58031833", "0.5800065", "0.57942593", "0.57872754", "0.57670146", "0.5766722", "0.5764231", "0.5760326", "0.5759757", "0.5753609", "0.57459", "0.57459", "0.57459", "0.57459", "0.57459", "0.57459", "0.57459", "0.57459", "0.57459", "0.573709", "0.5721818", "0.57175165" ]
0.609525
32
Like etag but for divs
public static function ediv(string|array $attributes = []): string { $args = array_merge(['div', ], func_get_args()); return call_user_func_array([__CLASS__, 'etag', ], $args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getETag() {}", "#[Pure]\nfunction ob_etaghandler($data, $mode) {}", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getETag() : string {\n return $this->ETag;\n }", "function check_send_etag($branch, $what=null)\n{\n\t$etag = get_etag($branch, $what);\n\n\t// process If-None-Match header used to poll running script results\n\tif (isset($_SERVER['HTTP_IF_NONE_MATCH']) && substr($_SERVER['HTTP_IF_NONE_MATCH'], 1, -1) == $etag)\n\t{\n\t\theader('HTTP/1.1 304 Not Modified');\n\t\texit;\n\t}\n\theader('ETag: \"'.$etag.'\"');\n\n\treturn $etag;\n}", "public static function _etag($id, $type = 'strong') {\n $id = (($type === 'weak') ? 'W/' : '').$id;\n\n self::response()->header('ETag', $id);\n \n if ($_SERVER['HTTP_IF_NONE_MATCH'] === $id) {\n self::halt(304);\n }\n }", "protected function etag($value, $type='strong')\r\n {\r\n $this->slim->etag($value);\r\n }", "protected function fixEtag()\n {\n if (is_string($this->etag)) {\n $arr = explode('-', $this->etag);\n if (count($arr) === 4) {\n $string = \"Make vimeo/psalm happy\";\n if (! is_null($this->path)) {\n $string = trim(basename($this->path));\n }\n $hash = hash('ripemd160', $string, false);\n $arr[0] = substr($hash, 4, 5);\n $arr[2] = $this->timestamp;\n $this->etag = sprintf(\"%s-%s-%x-%s\", $arr[0], $arr[1], $arr[2], $arr[3]);\n }\n }\n }", "public function end_etag_ob() {\n\t\tif ( headers_sent() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$content = ob_get_clean();\n\t\theader( 'Etag: ' . md5($content), true );\n\t\techo $content;\n\t}", "public function getEtag($regen=false);", "#[Pure]\nfunction http_cache_etag($etag = null) {}", "public function getEtag()\r\n {\r\n $etag = sprintf('%s/%s/%d', $this->getDatabase(), $this->getPath(), $this->getModified()->format('Y-m-d\\TH:i:s.uP'));\r\n\r\n return md5($etag);\r\n }", "public function generate_etag()\n\t{\n\t if ($this->response === NULL)\n\t\t{\n\t\t\tthrow new Kohana_Request_Exception('No response yet associated with request - cannot auto generate resource ETag');\n\t\t}\n\n\t\t// Generate a unique hash for the response\n\t\treturn '\"'.sha1($this->response).'\"';\n\t}", "public function getETag($path) {\n\t\treturn $this->calculateEtag($path, $this->stat($path));\n\t}", "function etag()\n {\n if (!empty($this->list)) {\n\n return '\"' . implode(\n ':',\n array($this->arg('action'),\n common_language(),\n $this->user->id,\n strtotime($this->list->created),\n strtotime($this->list->modified))\n )\n . '\"';\n }\n\n return null;\n }", "function etag()\n {\n if (!empty($this->notice)) {\n\n return '\"' . implode(\n ':',\n array($this->arg('action'),\n common_user_cache_hash($this->auth_user),\n common_language(),\n $this->notice->id,\n strtotime($this->notice->created))\n )\n . '\"';\n }\n\n return null;\n }", "public function getTag()\n {\n return 'nocache';\n }", "public function start_etag_ob() {\n\t\tob_start();\n\t}", "static public function getETag($path) {\n\t\treturn self::$defaultInstance->getETag($path);\n\t}", "public static function setETag($etag) {}", "public function setEtag(string $value): void\n {\n $this->etag = '\"'.$value.'\"';\n }", "public function setETag(string $value) {\n $this->ETag = $value;\n }", "private function generateEtag()\n\t{\n\t\t$etag = $this->getTable() . $this->getKey();\n\n\t\tif ( $this->usesTimestamps() )\n\t\t{\n\t\t\t$datetime = $this->updated_at;\n\n\t\t\tif ( $datetime instanceof \\DateTime )\n\t\t\t{\n\t\t\t\t$datetime = $this->fromDateTime($datetime);\n\t\t\t}\n\n\t\t\t$etag .= $datetime;\n\n\t\t}\n\n \treturn md5( $etag );\n\t}", "public function getETag($id)\n {\n return $this->_engine->read($id . '.etag');\n }", "public function getETag()\n {\n return $this->item['uuid'];\n }", "public function getETag()\n {\n return $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_ETAG];\n }", "static function div($arguments=false, $content='') {\n\t\treturn self::tag('div', $arguments, $content);\n\t}", "public static function etag($etag, $awayEtag, $notModifiedExit = true)\n {\n // header (\"Pragma: no-cache\"); // HTTP/1.0\n // header (\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\"); // always modified\n if ($notModifiedExit && isset($_SERVER['HTTP_IF_NONE_MATCH']) && $etag == $_SERVER['HTTP_IF_NONE_MATCH']) {\n echo 2;\n header('Etag: ' . $etag);\n header('HTTP/1.1 304 Not Modfied');\n //exit();\n } else {\n header('ETag: ' . $awayEtag);\n }\n }", "function get_etag($branch, $what=null)\n{\n\tglobal $db;\n\n\t$branch_id = label2id($branch);\n\n\t// using MAX(update)+SUM(time) as ETag\n\t$get_etag = $db->prepare($sql=\"SELECT MAX(updated)||' '||COALESCE(SUM(time),'') FROM results WHERE branch=:branch\".\n\t\t(empty($what) ? '' : limit_script_sql($what)));\n\t$etag = $get_etag->execute(array('branch' => $branch_id)) ? $get_etag->fetchColumn() : null;\n\t//error_log(__METHOD__.\"('$branch', '$what') sql='$sql', etag=\".toString($etag));\n\treturn $etag;\n}", "function cond_304($time, $etag = null) {\n header('Status: 304 Not Modified');\n cond_headers($time, $etag);\n}", "public function getEtag($regen=false)\n\t{\n\t\tif ( $this->exists && ($this->etag === false || $regen === true) )\n \t{\n \t\t$this->etag = $this->generateEtag();\n \t}\n\n \treturn $this->etag;\n\t}", "public function etag($value, $type = 'strong')\n {\n // Ensure type is correct\n if (!in_array($type, ['strong', 'weak'])) {\n throw new \\InvalidArgumentException('Invalid Brainwave::etag type. Expected \"strong\" or \"weak\".');\n }\n\n // Set etag value\n $value = '\"' . $value . '\"';\n if ($type === 'weak') {\n $value = 'W/'.$value;\n }\n $this['response']->setHeader('ETag', $value);\n\n // Check conditional GET\n if ($etagsHeader = $this['request']->getHeader('IF_NONE_MATCH')) {\n $etags = preg_split('@\\s*,\\s*@', $etagsHeader);\n if (in_array($value, $etags) || in_array('*', $etags)) {\n $this->halt('304');\n }\n }\n }", "public function realPageCacheContent() {}", "#[Pure]\nfunction http_match_etag($etag, $for_range = null) {}", "function wrap_embed_with_div($html, $url, $attr) {\n\n return '<div class=\"video_wrapper\"><div class=\"video-container\">' . $html . '</div></div>';\n\n}", "public function getCachedHTML($key);", "function tidy_get_html_ver(tidy $object) {}", "function markup_from_cache();", "protected function getETag( $path )\n {\n return ( md5( $path ) );\n }", "protected function _setEtag($etag)\n\t{\n\t\tJFactory::getApplication()->setHeader('ETag', $etag, true);\n\t}", "public function get_updated_html()\n {\n }", "static function div_open($arguments=false, $content='') {\n\t\treturn self::tag('div', $arguments, $content, true);\n\t}", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function cacheResponseContent($event)\n {\n $this->setHasCache($this->calculateCacheKey(), $event->sender->content, $this->dependency, $this->duration);\n }", "static function div($content, $id = Null, $class = Null) \n {\n return '<div ' . self::_id($id).self::_class($class) . '>'\n .self::$_nl.$content.'</div>'.self::$_nl;\n }", "function tidy_get_html(tidy $object) {}", "public function getETag()\n {\n $sETag = md5(implode($this->sqlData));\n\n return $sETag;\n }", "public function setAutoEtag(): static\n {\n $this->setEtag(md5(serialize(fileinfo($this->file->getPathname()))));\n return $this;\n }", "public abstract function get_html();", "public function setETag($value)\n {\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_ETAG] \n = $value;\n }", "private function fragmentTag()\n {\n return '<!-- FGC: [' . current_time(\"Y-m-d H:i:s\", 1) .'| ' .$this->hash. ']-->';\n }", "public function getOpenTagWrapper()\n {\n }", "public abstract function html(): string;", "function fabric_embed_wrap($cache, $url, $attr = '', $post_ID = '') {\n return '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "public function etag($tag = null, $weak = false) {\n\t\tif ($tag !== null) {\n\t\t\t$this->_headers['Etag'] = sprintf('%s\"%s\"', ($weak) ? 'W/' : null, $tag);\n\t\t}\n\t\tif (isset($this->_headers['Etag'])) {\n\t\t\treturn $this->_headers['Etag'];\n\t\t}\n\t\treturn null;\n\t}", "function get_tag( $attr, $value, $html ) {\r\n\t\t\r\n\t\t\t$attr = preg_quote($attr);\r\n\t\t\t$value = preg_quote($value);\r\n\t\t \r\n\t\t\t//scan the dom for a fully matching div tag\r\n\t\t\t$tag_regex = '/<div[^>]*'.$attr.'=\"'.$value.'\">(.*?)<\\\\/div>/si';\r\n\t\t\r\n\t\t\t//return first match\r\n\t\t\tpreg_match($tag_regex,\r\n\t\t\t$html,\r\n\t\t\t$matches);\r\n\t\t\treturn $matches[1];\r\n\t\t}", "function cond_quote_etag($etag) {\n return '\"' . preg_replace('/([\\\\\"])/', '\\\\\\\\$1', $etag) . '\"';\n}", "function block_version($content)\n {\n }", "abstract function get_html();", "public function getDIV($content, $class='', $id='')\n {\n if (!empty($id)) {\n $id = \" id=\\\"$id\\\"\";\n }\n if (!empty($class)) {\n $class = \" class=\\\"$class\\\"\";\n }\n\n $result = '<div'. $id . $class . '>' . $content . \"</div>\\n\";\n\n return $result;\n }", "public function tempPageCacheContent() {}", "public function getHTML(): string;", "function envolve_embed($html, $url, $attr, $post_id) {\n return '<div class=\"video\">' . $html . '</div>';\n}", "function envolve_embed($html, $url, $attr, $post_id) {\n return '<div class=\"video\">' . $html . '</div>';\n}", "function getHtmlId(){\n\t\t//this to have unique ID attribute of the main containing div in case there is more \n\t\t//than 1 of the same action box. Cache key is composed of $_htmlUniqueId prefix and \n\t\t//ID of the action box.\n\t\t$actionBoxId = $this->getId();\n\t\t\n\t\t$htmlUniqueId = wp_cache_get( $this->_html_UniqueId . $actionBoxId );\n\t\tif( false === $htmlUniqueId ){\n\t\t\t//this is the first\n\t\t\t$htmlUniqueId = 1;\n\t\t\twp_cache_set( $this->_html_UniqueId . $actionBoxId, $htmlUniqueId );\n\t\t} else {\n\t\t\t//another box is already displayed\n\t\t\t$htmlUniqueId++;\n\t\t\twp_cache_replace( $this->_html_UniqueId . $actionBoxId, $htmlUniqueId );\n\t\t}\n\t\t\n\t\treturn $actionBoxId.$htmlUniqueId;\n\t}", "function content_addDivToImage( $content ) {\n $pattern = '/(<img([^>]*)>)/i';\n $replacement = '<div class=\"image_wrapper\">$1</div>';\n $content = preg_replace( $pattern, $replacement, $content );\n\n return $content;\n}", "abstract public function getHtml();", "public function generateHtmlDivData()\n\t{\n\t\t// TODO : to be implemented\n\t}", "private function getHtmlBody(): string\n {\n return <<<EOT\n<div>A div tag</div>\n<script></script> // This tag should have a `nonce` attribute added\n<div>A div tag</div>\n<link rel=\"stylesheet\"> // This tag should have a `nonce` attribute added\n<div>A div tag</div>\n<h1>A heading</h1>\n<style></style> // This tag should have a `nonce` attribute added\n<div>A div tag</div>\nEOT;\n }", "public function cache() {\r\n\t\t$key = $this->cacher.'.' . $this->hash();\r\n\t\tif (($content = pzk_store($key)) === NULL) {\r\n\t\t\t$content = $this->getContent();\r\n\t\t\tpzk_store($key, $content);\r\n\t\t}\r\n\t\techo $content;\r\n\t}", "function remove_div_tag_and_its_content($string)\n{\n\n\t$dom = new DOMDocument();\n\n\t//avoid the whitespace after removing the node\n\t$dom->preserveWhiteSpace = false;\n\n\t//parse html dom elements\n\t$dom->loadHTML($string);\n\n\t//get the table from dom\n\tif($table = $dom->getElementsByTagName('div')->item(0)) {\n\n\t //remove the node by telling the parent node to remove the child\n\t $table->parentNode->removeChild($table);\n\n\t //save the new document\n\n\t return $dom->saveHTML();\n\t}else\n\t{\n\t\treturn $string;\n\t}\n}", "public function render()\n {\n // Different conditions for different types of tags\n switch ($this->element) {\n\n // Img tags use the src\n case 'img':\n if (empty($this->getAttribute('src'))) {\n return '';\n }\n break;\n\n // Divs have the image as a background-image\n // https://regex101.com/r/eF0oD0/1\n default:\n if (!preg_match('#background-image:\\s*url\\([\\'\"]?[\\w\\/]#',\n $this->getAttribute('style'))) {\n return '';\n }\n }\n\n // Carry on with normal rendering\n return parent::render();\n }", "public function html(): string;", "public function html() {}", "function we_tag($name, $attribs = array(), $content = '', $internal = false){\n\t$edMerk = isset($GLOBALS['we_editmode']) ? $GLOBALS['we_editmode'] : '';\n\t//FIXME: do we support this????\n\t$user = weTag_getAttribute('user', $attribs, array(), we_base_request::STRING_LIST);\n\tif(defined('WE_PROFILER')){\n\t\t$bt = WE_PROFILER_54 ? debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1) : debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t$prof = array('tag' => $name, 'line' => $bt[0]['line'], 'file' => $bt[0]['file'], 'time' => round((microtime(true) - WE_PROFILER), 5) . ' s', 'mem' => round(((memory_get_usage() / 1024))) . ' kB');\n\t\t$GLOBALS['we_profile'][] = $prof;\n\t\t//annotate tag, if possible\n\t\t$attribs['data-time'] = $prof['time'];\n\t\t$attribs['data-mem'] = $prof['mem'];\n\t\t$attribs['data-line'] = $prof['line'];\n\t\t$attribs['data-file'] = $prof['file'];\n\t}\n\t//make sure comment attribute is never shown\n\tswitch($name){\n\t\tcase 'setVar':\n\t\tcase 'xmlnode'://special handling inside tag setVar and xmlnode\n\t\t\t$attribs = removeAttribs($attribs, array('cachelifetime', 'comment', 'user'));\n\t\t\t$nameTo = '';\n\t\t\t$to = 'screen';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$to = weTag_getAttribute('to', $attribs, 'screen');\n\t\t\t$nameTo = weTag_getAttribute('nameto', $attribs, isset($attribs['name']) ? $attribs['name'] : '');\n\t\t\t$attribs = removeAttribs($attribs, array('cachelifetime', 'comment', 'to', 'nameto', 'user'));\n\n\t\t\t/* if to attribute is set, output of the tag is redirected to a variable\n\t\t\t * this makes only sense if tag output is equal to non-editmode */\n\t\t\tif($to != 'screen'){\n\t\t\t\t$GLOBALS['we_editmode'] = false;\n\t\t\t}\n\t}\n\n\t//make a copy of the name - this copy is never touched even not inside blocks/listviews etc.\n\tif(isset($attribs['name'])){\n\t\t$attribs['_name_orig'] = $attribs['name'];\n\t\t$attribs['name'] = we_tag_getPostName($attribs['name']);\n\t\tif(!empty($GLOBALS['we_editmode']) && ($GLOBALS['we_doc'] instanceof we_webEditionDocument)){\n\t\t\t$GLOBALS['we_doc']->addUsedElement($name, $attribs['name']);\n\t\t}\n\t}\n\n\tif($edMerk && $user && (!permissionhandler::hasPerm('ADMINISTRATOR'))){\n\t\tif(!in_array($_SESSION['user']['Username'], $user)){\n\t\t\t$GLOBALS['we_editmode'] = false;\n\t\t}\n\t}\n\n\tif(($foo = we_include_tag_file($name)) !== true){\n\t\treturn $foo;\n\t}\n\n\t$fn = 'we_tag_' . $name;\n\tswitch($fn){\n\t\tcase 'we_tag_setVar':\n\t\t\t$fn($attribs, $content, $internal);\n\t\t\t//nothing more to do don't waste time\n\t\t\treturn;\n\t\tdefault:\n\t\t\t$foo = $fn($attribs, $content, $internal);\n\t\t\t$GLOBALS['we_editmode'] = $edMerk;\n\t\t\treturn we_redirect_tagoutput($foo, $nameTo, $to);\n\t}\n}", "function embed_wrap( $cache ) {\n\treturn '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "public function GetETag($collectionId, $entity)\n\t{\n\t\treturn static::RESOURCE_SYNC_SETTINGS_NAME . ':' . parent::GetETag($collectionId, $entity);\n\t}", "protected function _setContent() {\n\t\tif (in_array($this->_status, array(304, 204))) {\n\t\t\t$this->body('');\n\t\t}\n\t}", "function opendiv($type, $divid=\"\", $divclass=\"\", $divaction=\"\"){\n\tswitch($type){\n\t\tcase \"sumcsinstructing\":\n\t\t\t$divid=$type;\n\t\t\t$message=\"<span class=\\\"classheader\\\">Classes Instructing</span><hr />\";\n\t\t\tbreak;\n\t\tcase \"sumcstaking\":\n\t\t\t$divid=$type;\n\t\t\t$message=\"<span class=\\\"classheader\\\">Classes Taking</span><hr />\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$message=\"\";\n\t\t\tbreak;\n\t}\n\tif($divclass!=\"\")$divclass=\"class=\\\"$divclass\\\"\";\n\treturn \"\\n<div id=\\\"$divid\\\" $divclass $divaction>$message\";\n}", "public function __construct($type=\"div\",$content=\"\",$attr=array(),$unique_id=False,$self_closing=false){#constructor method for any element\n\t\t$this->type=$type;#tag type\n\t\t$this->attr=$attr;# attributes for the tag\n\t\t$this->content=array((string)$content);#content (can be raw text)\n\t\t$this->self_closing=$self_closing;\n\t\tif (isset(debug_backtrace()[1]['object'])){\t\n\t\t\t$this->master=debug_backtrace()[1]['object'];\n\t\t}\n\t\telse{\n\t\t\t$this->master=\"None\";\n\t\t}\n\t\tif ($unique_id){\n\t\t\t$this->attr=array_merge($this->attr, array(\"id\"=>self::get_unique_id()));\n\t\t}\n\t}", "public function getDiv(): String\n {\n $val = '<div class=\"section\" id=\"section' . $this->__sectionNumber . '\">';\n $val .= '<svg class=\"mapoverview\" id=\"svg-span\">';\n $val .= $this->SVGOBJECTS;\n $val .= '</svg></div>';\n return $val;\n }", "function doTagStuff(){}", "public function html() {\r\n\t\tif (!@$_REQUEST['noCache'] && ($this->cacheable === true\r\n\t\t|| $this->cacheable === 'true')) {\r\n\t\t\t$this->cache();\r\n\t\t} else {\r\n\t\t\techo $this->getContent();\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function updatePage(){\r\n\t$pageData=base64_decode($_POST['data']);\r\n\t// Get the page we need to edit\r\n\t$html=getPage();\r\n\t// Iterate HTML, look for the editable region and make sure it's count matches the one being sent. \r\n\t$eid=0; // Assign logical number to each found class tag\r\n\tforeach($html->find('.clienteditor') as $e){ // TODO: change this to variable defined topic for edit regions\r\n\t \tif($eid==$_GET['id']){\r\n\t \t\t$e->innertext=$pageData;\r\n\t \t}\r\n\t\t$eid++;\r\n\t}\r\n\t// Post Back the updated HTML object.\r\n\t$result=postData($html);\r\n\techo \"{'status':'$result'}\";\r\n}", "public function innerHTML($el) {\n $doc = new DOMDocument();\n $doc->appendChild($doc->importNode($el, TRUE));\n $html = trim($doc->saveHTML($doc->documentElement));\n $html = html_entity_decode($html,ENT_HTML5, 'UTF-8');\n $tag = $el->nodeName;\n $tag_r = preg_replace('@^<' . $tag . '[^>]*>|</' . $tag . '>$@', '', $html);\n $tagshow = str_replace('<br>', \"\\r\\n\", $tag_r);\n $tagshow = str_replace('<br >', \"\\r\\n\", $tagshow);\n $tagshow = str_replace('<br/>', \"\\r\\n\", $tagshow);\n $tagshow = str_replace('<br />', \"\\r\\n\", $tagshow);\n return $tagshow;\n }", "function ajarRenderDinamycBlock($attributes, $content) {\n return '<h1 class=\"my-3\">'.$attributes['content'].'</h1>'.\n '<img src=\"'.$attributes['mediaURL'].'\" alt=\"'.$attributes['mediaAlt'].'\" />'.\n '<hr>';\n}" ]
[ "0.63747424", "0.62371063", "0.6232301", "0.6232301", "0.6232301", "0.6232301", "0.6232301", "0.6232301", "0.6232301", "0.6232301", "0.6100096", "0.59741014", "0.5918943", "0.5904675", "0.5896843", "0.5840765", "0.57865715", "0.57643354", "0.57092863", "0.5641326", "0.56099963", "0.5588638", "0.55847585", "0.5506829", "0.5497957", "0.5459093", "0.5446712", "0.54222476", "0.53995264", "0.5370729", "0.53542167", "0.5332591", "0.53243166", "0.5283188", "0.5280458", "0.5250137", "0.5237929", "0.5206959", "0.5204237", "0.5127275", "0.51206857", "0.5114257", "0.5095218", "0.5071497", "0.5069317", "0.5047007", "0.5030647", "0.502609", "0.49875033", "0.4986645", "0.4986645", "0.4986645", "0.4986645", "0.4986645", "0.4986645", "0.4986645", "0.4986645", "0.49831086", "0.49533156", "0.49092573", "0.49079728", "0.48911354", "0.4879633", "0.4874768", "0.48730823", "0.48612309", "0.48477817", "0.48467004", "0.48417497", "0.48348048", "0.48277497", "0.48254576", "0.48088208", "0.47999454", "0.4799932", "0.4798782", "0.47919118", "0.47919118", "0.477914", "0.47346047", "0.47247764", "0.4722327", "0.47196734", "0.4712627", "0.4689978", "0.4679214", "0.46773228", "0.46753702", "0.46723357", "0.46542147", "0.4653377", "0.46527913", "0.46494818", "0.4644764", "0.46394476", "0.4634083", "0.46309072", "0.4623471", "0.46149743", "0.46142018" ]
0.6045759
11
Like etag but for divs
public static function espan(string|array $attributes = []): string { $args = array_merge(['span', ], func_get_args()); return call_user_func_array([__CLASS__, 'etag', ], $args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getETag() {}", "#[Pure]\nfunction ob_etaghandler($data, $mode) {}", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getEtag()\n {\n return $this->etag;\n }", "public function getETag() : string {\n return $this->ETag;\n }", "public static function ediv(string|array $attributes = []): string {\n\t\t$args = array_merge(['div', ], func_get_args());\n\t\treturn call_user_func_array([__CLASS__, 'etag', ], $args);\n\t}", "function check_send_etag($branch, $what=null)\n{\n\t$etag = get_etag($branch, $what);\n\n\t// process If-None-Match header used to poll running script results\n\tif (isset($_SERVER['HTTP_IF_NONE_MATCH']) && substr($_SERVER['HTTP_IF_NONE_MATCH'], 1, -1) == $etag)\n\t{\n\t\theader('HTTP/1.1 304 Not Modified');\n\t\texit;\n\t}\n\theader('ETag: \"'.$etag.'\"');\n\n\treturn $etag;\n}", "public static function _etag($id, $type = 'strong') {\n $id = (($type === 'weak') ? 'W/' : '').$id;\n\n self::response()->header('ETag', $id);\n \n if ($_SERVER['HTTP_IF_NONE_MATCH'] === $id) {\n self::halt(304);\n }\n }", "protected function etag($value, $type='strong')\r\n {\r\n $this->slim->etag($value);\r\n }", "protected function fixEtag()\n {\n if (is_string($this->etag)) {\n $arr = explode('-', $this->etag);\n if (count($arr) === 4) {\n $string = \"Make vimeo/psalm happy\";\n if (! is_null($this->path)) {\n $string = trim(basename($this->path));\n }\n $hash = hash('ripemd160', $string, false);\n $arr[0] = substr($hash, 4, 5);\n $arr[2] = $this->timestamp;\n $this->etag = sprintf(\"%s-%s-%x-%s\", $arr[0], $arr[1], $arr[2], $arr[3]);\n }\n }\n }", "public function end_etag_ob() {\n\t\tif ( headers_sent() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$content = ob_get_clean();\n\t\theader( 'Etag: ' . md5($content), true );\n\t\techo $content;\n\t}", "public function getEtag($regen=false);", "#[Pure]\nfunction http_cache_etag($etag = null) {}", "public function getEtag()\r\n {\r\n $etag = sprintf('%s/%s/%d', $this->getDatabase(), $this->getPath(), $this->getModified()->format('Y-m-d\\TH:i:s.uP'));\r\n\r\n return md5($etag);\r\n }", "public function generate_etag()\n\t{\n\t if ($this->response === NULL)\n\t\t{\n\t\t\tthrow new Kohana_Request_Exception('No response yet associated with request - cannot auto generate resource ETag');\n\t\t}\n\n\t\t// Generate a unique hash for the response\n\t\treturn '\"'.sha1($this->response).'\"';\n\t}", "public function getETag($path) {\n\t\treturn $this->calculateEtag($path, $this->stat($path));\n\t}", "function etag()\n {\n if (!empty($this->list)) {\n\n return '\"' . implode(\n ':',\n array($this->arg('action'),\n common_language(),\n $this->user->id,\n strtotime($this->list->created),\n strtotime($this->list->modified))\n )\n . '\"';\n }\n\n return null;\n }", "function etag()\n {\n if (!empty($this->notice)) {\n\n return '\"' . implode(\n ':',\n array($this->arg('action'),\n common_user_cache_hash($this->auth_user),\n common_language(),\n $this->notice->id,\n strtotime($this->notice->created))\n )\n . '\"';\n }\n\n return null;\n }", "public function getTag()\n {\n return 'nocache';\n }", "public function start_etag_ob() {\n\t\tob_start();\n\t}", "static public function getETag($path) {\n\t\treturn self::$defaultInstance->getETag($path);\n\t}", "public static function setETag($etag) {}", "public function setEtag(string $value): void\n {\n $this->etag = '\"'.$value.'\"';\n }", "public function setETag(string $value) {\n $this->ETag = $value;\n }", "private function generateEtag()\n\t{\n\t\t$etag = $this->getTable() . $this->getKey();\n\n\t\tif ( $this->usesTimestamps() )\n\t\t{\n\t\t\t$datetime = $this->updated_at;\n\n\t\t\tif ( $datetime instanceof \\DateTime )\n\t\t\t{\n\t\t\t\t$datetime = $this->fromDateTime($datetime);\n\t\t\t}\n\n\t\t\t$etag .= $datetime;\n\n\t\t}\n\n \treturn md5( $etag );\n\t}", "public function getETag($id)\n {\n return $this->_engine->read($id . '.etag');\n }", "public function getETag()\n {\n return $this->item['uuid'];\n }", "public function getETag()\n {\n return $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_ETAG];\n }", "static function div($arguments=false, $content='') {\n\t\treturn self::tag('div', $arguments, $content);\n\t}", "public static function etag($etag, $awayEtag, $notModifiedExit = true)\n {\n // header (\"Pragma: no-cache\"); // HTTP/1.0\n // header (\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\"); // always modified\n if ($notModifiedExit && isset($_SERVER['HTTP_IF_NONE_MATCH']) && $etag == $_SERVER['HTTP_IF_NONE_MATCH']) {\n echo 2;\n header('Etag: ' . $etag);\n header('HTTP/1.1 304 Not Modfied');\n //exit();\n } else {\n header('ETag: ' . $awayEtag);\n }\n }", "function get_etag($branch, $what=null)\n{\n\tglobal $db;\n\n\t$branch_id = label2id($branch);\n\n\t// using MAX(update)+SUM(time) as ETag\n\t$get_etag = $db->prepare($sql=\"SELECT MAX(updated)||' '||COALESCE(SUM(time),'') FROM results WHERE branch=:branch\".\n\t\t(empty($what) ? '' : limit_script_sql($what)));\n\t$etag = $get_etag->execute(array('branch' => $branch_id)) ? $get_etag->fetchColumn() : null;\n\t//error_log(__METHOD__.\"('$branch', '$what') sql='$sql', etag=\".toString($etag));\n\treturn $etag;\n}", "function cond_304($time, $etag = null) {\n header('Status: 304 Not Modified');\n cond_headers($time, $etag);\n}", "public function getEtag($regen=false)\n\t{\n\t\tif ( $this->exists && ($this->etag === false || $regen === true) )\n \t{\n \t\t$this->etag = $this->generateEtag();\n \t}\n\n \treturn $this->etag;\n\t}", "public function etag($value, $type = 'strong')\n {\n // Ensure type is correct\n if (!in_array($type, ['strong', 'weak'])) {\n throw new \\InvalidArgumentException('Invalid Brainwave::etag type. Expected \"strong\" or \"weak\".');\n }\n\n // Set etag value\n $value = '\"' . $value . '\"';\n if ($type === 'weak') {\n $value = 'W/'.$value;\n }\n $this['response']->setHeader('ETag', $value);\n\n // Check conditional GET\n if ($etagsHeader = $this['request']->getHeader('IF_NONE_MATCH')) {\n $etags = preg_split('@\\s*,\\s*@', $etagsHeader);\n if (in_array($value, $etags) || in_array('*', $etags)) {\n $this->halt('304');\n }\n }\n }", "public function realPageCacheContent() {}", "#[Pure]\nfunction http_match_etag($etag, $for_range = null) {}", "function wrap_embed_with_div($html, $url, $attr) {\n\n return '<div class=\"video_wrapper\"><div class=\"video-container\">' . $html . '</div></div>';\n\n}", "public function getCachedHTML($key);", "function tidy_get_html_ver(tidy $object) {}", "function markup_from_cache();", "protected function getETag( $path )\n {\n return ( md5( $path ) );\n }", "protected function _setEtag($etag)\n\t{\n\t\tJFactory::getApplication()->setHeader('ETag', $etag, true);\n\t}", "public function get_updated_html()\n {\n }", "static function div_open($arguments=false, $content='') {\n\t\treturn self::tag('div', $arguments, $content, true);\n\t}", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function setEtag($var)\n {\n GPBUtil::checkString($var, True);\n $this->etag = $var;\n\n return $this;\n }", "public function cacheResponseContent($event)\n {\n $this->setHasCache($this->calculateCacheKey(), $event->sender->content, $this->dependency, $this->duration);\n }", "static function div($content, $id = Null, $class = Null) \n {\n return '<div ' . self::_id($id).self::_class($class) . '>'\n .self::$_nl.$content.'</div>'.self::$_nl;\n }", "function tidy_get_html(tidy $object) {}", "public function getETag()\n {\n $sETag = md5(implode($this->sqlData));\n\n return $sETag;\n }", "public function setAutoEtag(): static\n {\n $this->setEtag(md5(serialize(fileinfo($this->file->getPathname()))));\n return $this;\n }", "public abstract function get_html();", "public function setETag($value)\n {\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_ETAG] \n = $value;\n }", "private function fragmentTag()\n {\n return '<!-- FGC: [' . current_time(\"Y-m-d H:i:s\", 1) .'| ' .$this->hash. ']-->';\n }", "public function getOpenTagWrapper()\n {\n }", "public abstract function html(): string;", "function fabric_embed_wrap($cache, $url, $attr = '', $post_ID = '') {\n return '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "public function etag($tag = null, $weak = false) {\n\t\tif ($tag !== null) {\n\t\t\t$this->_headers['Etag'] = sprintf('%s\"%s\"', ($weak) ? 'W/' : null, $tag);\n\t\t}\n\t\tif (isset($this->_headers['Etag'])) {\n\t\t\treturn $this->_headers['Etag'];\n\t\t}\n\t\treturn null;\n\t}", "function get_tag( $attr, $value, $html ) {\r\n\t\t\r\n\t\t\t$attr = preg_quote($attr);\r\n\t\t\t$value = preg_quote($value);\r\n\t\t \r\n\t\t\t//scan the dom for a fully matching div tag\r\n\t\t\t$tag_regex = '/<div[^>]*'.$attr.'=\"'.$value.'\">(.*?)<\\\\/div>/si';\r\n\t\t\r\n\t\t\t//return first match\r\n\t\t\tpreg_match($tag_regex,\r\n\t\t\t$html,\r\n\t\t\t$matches);\r\n\t\t\treturn $matches[1];\r\n\t\t}", "function cond_quote_etag($etag) {\n return '\"' . preg_replace('/([\\\\\"])/', '\\\\\\\\$1', $etag) . '\"';\n}", "function block_version($content)\n {\n }", "abstract function get_html();", "public function getDIV($content, $class='', $id='')\n {\n if (!empty($id)) {\n $id = \" id=\\\"$id\\\"\";\n }\n if (!empty($class)) {\n $class = \" class=\\\"$class\\\"\";\n }\n\n $result = '<div'. $id . $class . '>' . $content . \"</div>\\n\";\n\n return $result;\n }", "public function tempPageCacheContent() {}", "public function getHTML(): string;", "function envolve_embed($html, $url, $attr, $post_id) {\n return '<div class=\"video\">' . $html . '</div>';\n}", "function envolve_embed($html, $url, $attr, $post_id) {\n return '<div class=\"video\">' . $html . '</div>';\n}", "function getHtmlId(){\n\t\t//this to have unique ID attribute of the main containing div in case there is more \n\t\t//than 1 of the same action box. Cache key is composed of $_htmlUniqueId prefix and \n\t\t//ID of the action box.\n\t\t$actionBoxId = $this->getId();\n\t\t\n\t\t$htmlUniqueId = wp_cache_get( $this->_html_UniqueId . $actionBoxId );\n\t\tif( false === $htmlUniqueId ){\n\t\t\t//this is the first\n\t\t\t$htmlUniqueId = 1;\n\t\t\twp_cache_set( $this->_html_UniqueId . $actionBoxId, $htmlUniqueId );\n\t\t} else {\n\t\t\t//another box is already displayed\n\t\t\t$htmlUniqueId++;\n\t\t\twp_cache_replace( $this->_html_UniqueId . $actionBoxId, $htmlUniqueId );\n\t\t}\n\t\t\n\t\treturn $actionBoxId.$htmlUniqueId;\n\t}", "function content_addDivToImage( $content ) {\n $pattern = '/(<img([^>]*)>)/i';\n $replacement = '<div class=\"image_wrapper\">$1</div>';\n $content = preg_replace( $pattern, $replacement, $content );\n\n return $content;\n}", "abstract public function getHtml();", "public function generateHtmlDivData()\n\t{\n\t\t// TODO : to be implemented\n\t}", "private function getHtmlBody(): string\n {\n return <<<EOT\n<div>A div tag</div>\n<script></script> // This tag should have a `nonce` attribute added\n<div>A div tag</div>\n<link rel=\"stylesheet\"> // This tag should have a `nonce` attribute added\n<div>A div tag</div>\n<h1>A heading</h1>\n<style></style> // This tag should have a `nonce` attribute added\n<div>A div tag</div>\nEOT;\n }", "public function cache() {\r\n\t\t$key = $this->cacher.'.' . $this->hash();\r\n\t\tif (($content = pzk_store($key)) === NULL) {\r\n\t\t\t$content = $this->getContent();\r\n\t\t\tpzk_store($key, $content);\r\n\t\t}\r\n\t\techo $content;\r\n\t}", "function remove_div_tag_and_its_content($string)\n{\n\n\t$dom = new DOMDocument();\n\n\t//avoid the whitespace after removing the node\n\t$dom->preserveWhiteSpace = false;\n\n\t//parse html dom elements\n\t$dom->loadHTML($string);\n\n\t//get the table from dom\n\tif($table = $dom->getElementsByTagName('div')->item(0)) {\n\n\t //remove the node by telling the parent node to remove the child\n\t $table->parentNode->removeChild($table);\n\n\t //save the new document\n\n\t return $dom->saveHTML();\n\t}else\n\t{\n\t\treturn $string;\n\t}\n}", "public function render()\n {\n // Different conditions for different types of tags\n switch ($this->element) {\n\n // Img tags use the src\n case 'img':\n if (empty($this->getAttribute('src'))) {\n return '';\n }\n break;\n\n // Divs have the image as a background-image\n // https://regex101.com/r/eF0oD0/1\n default:\n if (!preg_match('#background-image:\\s*url\\([\\'\"]?[\\w\\/]#',\n $this->getAttribute('style'))) {\n return '';\n }\n }\n\n // Carry on with normal rendering\n return parent::render();\n }", "public function html(): string;", "public function html() {}", "function we_tag($name, $attribs = array(), $content = '', $internal = false){\n\t$edMerk = isset($GLOBALS['we_editmode']) ? $GLOBALS['we_editmode'] : '';\n\t//FIXME: do we support this????\n\t$user = weTag_getAttribute('user', $attribs, array(), we_base_request::STRING_LIST);\n\tif(defined('WE_PROFILER')){\n\t\t$bt = WE_PROFILER_54 ? debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1) : debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t$prof = array('tag' => $name, 'line' => $bt[0]['line'], 'file' => $bt[0]['file'], 'time' => round((microtime(true) - WE_PROFILER), 5) . ' s', 'mem' => round(((memory_get_usage() / 1024))) . ' kB');\n\t\t$GLOBALS['we_profile'][] = $prof;\n\t\t//annotate tag, if possible\n\t\t$attribs['data-time'] = $prof['time'];\n\t\t$attribs['data-mem'] = $prof['mem'];\n\t\t$attribs['data-line'] = $prof['line'];\n\t\t$attribs['data-file'] = $prof['file'];\n\t}\n\t//make sure comment attribute is never shown\n\tswitch($name){\n\t\tcase 'setVar':\n\t\tcase 'xmlnode'://special handling inside tag setVar and xmlnode\n\t\t\t$attribs = removeAttribs($attribs, array('cachelifetime', 'comment', 'user'));\n\t\t\t$nameTo = '';\n\t\t\t$to = 'screen';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$to = weTag_getAttribute('to', $attribs, 'screen');\n\t\t\t$nameTo = weTag_getAttribute('nameto', $attribs, isset($attribs['name']) ? $attribs['name'] : '');\n\t\t\t$attribs = removeAttribs($attribs, array('cachelifetime', 'comment', 'to', 'nameto', 'user'));\n\n\t\t\t/* if to attribute is set, output of the tag is redirected to a variable\n\t\t\t * this makes only sense if tag output is equal to non-editmode */\n\t\t\tif($to != 'screen'){\n\t\t\t\t$GLOBALS['we_editmode'] = false;\n\t\t\t}\n\t}\n\n\t//make a copy of the name - this copy is never touched even not inside blocks/listviews etc.\n\tif(isset($attribs['name'])){\n\t\t$attribs['_name_orig'] = $attribs['name'];\n\t\t$attribs['name'] = we_tag_getPostName($attribs['name']);\n\t\tif(!empty($GLOBALS['we_editmode']) && ($GLOBALS['we_doc'] instanceof we_webEditionDocument)){\n\t\t\t$GLOBALS['we_doc']->addUsedElement($name, $attribs['name']);\n\t\t}\n\t}\n\n\tif($edMerk && $user && (!permissionhandler::hasPerm('ADMINISTRATOR'))){\n\t\tif(!in_array($_SESSION['user']['Username'], $user)){\n\t\t\t$GLOBALS['we_editmode'] = false;\n\t\t}\n\t}\n\n\tif(($foo = we_include_tag_file($name)) !== true){\n\t\treturn $foo;\n\t}\n\n\t$fn = 'we_tag_' . $name;\n\tswitch($fn){\n\t\tcase 'we_tag_setVar':\n\t\t\t$fn($attribs, $content, $internal);\n\t\t\t//nothing more to do don't waste time\n\t\t\treturn;\n\t\tdefault:\n\t\t\t$foo = $fn($attribs, $content, $internal);\n\t\t\t$GLOBALS['we_editmode'] = $edMerk;\n\t\t\treturn we_redirect_tagoutput($foo, $nameTo, $to);\n\t}\n}", "function embed_wrap( $cache ) {\n\treturn '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "public function GetETag($collectionId, $entity)\n\t{\n\t\treturn static::RESOURCE_SYNC_SETTINGS_NAME . ':' . parent::GetETag($collectionId, $entity);\n\t}", "protected function _setContent() {\n\t\tif (in_array($this->_status, array(304, 204))) {\n\t\t\t$this->body('');\n\t\t}\n\t}", "function opendiv($type, $divid=\"\", $divclass=\"\", $divaction=\"\"){\n\tswitch($type){\n\t\tcase \"sumcsinstructing\":\n\t\t\t$divid=$type;\n\t\t\t$message=\"<span class=\\\"classheader\\\">Classes Instructing</span><hr />\";\n\t\t\tbreak;\n\t\tcase \"sumcstaking\":\n\t\t\t$divid=$type;\n\t\t\t$message=\"<span class=\\\"classheader\\\">Classes Taking</span><hr />\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$message=\"\";\n\t\t\tbreak;\n\t}\n\tif($divclass!=\"\")$divclass=\"class=\\\"$divclass\\\"\";\n\treturn \"\\n<div id=\\\"$divid\\\" $divclass $divaction>$message\";\n}", "public function __construct($type=\"div\",$content=\"\",$attr=array(),$unique_id=False,$self_closing=false){#constructor method for any element\n\t\t$this->type=$type;#tag type\n\t\t$this->attr=$attr;# attributes for the tag\n\t\t$this->content=array((string)$content);#content (can be raw text)\n\t\t$this->self_closing=$self_closing;\n\t\tif (isset(debug_backtrace()[1]['object'])){\t\n\t\t\t$this->master=debug_backtrace()[1]['object'];\n\t\t}\n\t\telse{\n\t\t\t$this->master=\"None\";\n\t\t}\n\t\tif ($unique_id){\n\t\t\t$this->attr=array_merge($this->attr, array(\"id\"=>self::get_unique_id()));\n\t\t}\n\t}", "public function getDiv(): String\n {\n $val = '<div class=\"section\" id=\"section' . $this->__sectionNumber . '\">';\n $val .= '<svg class=\"mapoverview\" id=\"svg-span\">';\n $val .= $this->SVGOBJECTS;\n $val .= '</svg></div>';\n return $val;\n }", "function doTagStuff(){}", "public function html() {\r\n\t\tif (!@$_REQUEST['noCache'] && ($this->cacheable === true\r\n\t\t|| $this->cacheable === 'true')) {\r\n\t\t\t$this->cache();\r\n\t\t} else {\r\n\t\t\techo $this->getContent();\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function updatePage(){\r\n\t$pageData=base64_decode($_POST['data']);\r\n\t// Get the page we need to edit\r\n\t$html=getPage();\r\n\t// Iterate HTML, look for the editable region and make sure it's count matches the one being sent. \r\n\t$eid=0; // Assign logical number to each found class tag\r\n\tforeach($html->find('.clienteditor') as $e){ // TODO: change this to variable defined topic for edit regions\r\n\t \tif($eid==$_GET['id']){\r\n\t \t\t$e->innertext=$pageData;\r\n\t \t}\r\n\t\t$eid++;\r\n\t}\r\n\t// Post Back the updated HTML object.\r\n\t$result=postData($html);\r\n\techo \"{'status':'$result'}\";\r\n}", "public function innerHTML($el) {\n $doc = new DOMDocument();\n $doc->appendChild($doc->importNode($el, TRUE));\n $html = trim($doc->saveHTML($doc->documentElement));\n $html = html_entity_decode($html,ENT_HTML5, 'UTF-8');\n $tag = $el->nodeName;\n $tag_r = preg_replace('@^<' . $tag . '[^>]*>|</' . $tag . '>$@', '', $html);\n $tagshow = str_replace('<br>', \"\\r\\n\", $tag_r);\n $tagshow = str_replace('<br >', \"\\r\\n\", $tagshow);\n $tagshow = str_replace('<br/>', \"\\r\\n\", $tagshow);\n $tagshow = str_replace('<br />', \"\\r\\n\", $tagshow);\n return $tagshow;\n }", "function ajarRenderDinamycBlock($attributes, $content) {\n return '<h1 class=\"my-3\">'.$attributes['content'].'</h1>'.\n '<img src=\"'.$attributes['mediaURL'].'\" alt=\"'.$attributes['mediaAlt'].'\" />'.\n '<hr>';\n}" ]
[ "0.63747424", "0.62371063", "0.6232301", "0.6232301", "0.6232301", "0.6232301", "0.6232301", "0.6232301", "0.6232301", "0.6232301", "0.6100096", "0.6045759", "0.59741014", "0.5918943", "0.5904675", "0.5896843", "0.5840765", "0.57865715", "0.57643354", "0.57092863", "0.5641326", "0.56099963", "0.5588638", "0.55847585", "0.5506829", "0.5497957", "0.5459093", "0.5446712", "0.54222476", "0.53995264", "0.5370729", "0.53542167", "0.5332591", "0.53243166", "0.5283188", "0.5280458", "0.5250137", "0.5237929", "0.5206959", "0.5204237", "0.5127275", "0.51206857", "0.5114257", "0.5095218", "0.5071497", "0.5069317", "0.5047007", "0.5030647", "0.502609", "0.49875033", "0.4986645", "0.4986645", "0.4986645", "0.4986645", "0.4986645", "0.4986645", "0.4986645", "0.4986645", "0.49831086", "0.49533156", "0.49092573", "0.49079728", "0.48911354", "0.4879633", "0.4874768", "0.48730823", "0.48612309", "0.48477817", "0.48467004", "0.48417497", "0.48348048", "0.48277497", "0.48254576", "0.48088208", "0.47999454", "0.4799932", "0.4798782", "0.47919118", "0.47919118", "0.477914", "0.47346047", "0.47247764", "0.4722327", "0.47196734", "0.4712627", "0.4689978", "0.4679214", "0.46773228", "0.46753702", "0.46723357", "0.46542147", "0.4653377", "0.46527913", "0.46494818", "0.4644764", "0.46394476", "0.4634083", "0.46309072", "0.4623471", "0.46149743", "0.46142018" ]
0.0
-1
Extract the first tag contents of given type from HTML
public static function extractTagContents(string $tag, string $mixed): string { $result = self::extractTag($tag, $mixed); return $result->innerHTML(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extract_tag( $html, $tag = 'div' )\n\t{\n\t\t$html = preg_replace( \"/(\\<\" . $tag . \")(.*?)(\" . $tag . \">)/si\", \"dada\", \"$html\" );\n\t\t$html = strip_tags( $html );\n\t\t$html = str_replace( \"<!--\", \"&lt;!--\", $html );\n\t\t$html = preg_replace( \"/(\\<)(.*?)(--\\>)/mi\", \"\" . nl2br( \"\\\\2\" ) . \"\", $html );\n\n\t\treturn $html;\n\t}", "private function parseContents($html)\n {\n if (ltrim($html) == '') {\n return '';\n }\n \n /* do we really have tags to omit parsing for?!?\n // Don't parse contents of \"iframe\" element.\n if ($this->name == 'iframe') {\n return $this->parseNoContents('iframe', $html);\n }\n\n // Only TEXT inside a \"script\" element.\n if ($this->name == 'script') {\n return $this->parseForeignContents('script', $html);\n }\n\n // Only TEXT inside a \"style\" element.\n if ($this->name == 'style') {\n return $this->parseForeignContents('style', $html);\n }\n */\n \n // Parse contents one token at a time.\n $remainingHtml = $html;\n while (preg_match(\"/^\\s*<\\/\\s*\".$this->name.\"\\s*>/is\", $remainingHtml) === 0) {\n $token = TokenFactory::buildFromHtml(\n $remainingHtml,\n $this,\n //false \n $this->getThrowOnError()\n );\n\n if ($token === false || $token->isClosingElementImplied($remainingHtml)) {\n return $remainingHtml;\n }\n \n if (!is_array($this->children)) {\n $this->children = array();\n }\n $remainingHtml = $token->parse($remainingHtml);\n $this->children[] = $token;\n }\n\n // Remove last token if contains only whitespace.\n if (!empty($this->children)) {\n $lastChildArray = array_slice($this->children, -1);\n $lastChild = array_pop($lastChildArray);\n if ($lastChild->isText() && trim($lastChild->getValue()) == '') {\n array_pop($this->children);\n }\n }\n\n // Remove remaining closing tag.\n $posOfClosingBracket = mb_strpos($remainingHtml, '>');\n\n return mb_substr($remainingHtml, $posOfClosingBracket + 1);\n }", "function parse ($html) {\n // TODO fix by shijp : 临时方案\n if (is_array($html)) {\n return $html;\n }\n\n // If there are no HTML tags, ignore it\n if (false === strpos($html, '<'))\n return $html;\n if (! preg_match(\"/<(?=[a-zA-Z\\/])/\", $html))\n return $html;\n\n $this->clear();\n return parent::parse($html);\n }", "public function extractContent()\n {\n $metas = $this->parsedDOM->getElementsByTagName('meta');\n\n // If exists meta-description, uses it\n foreach ($metas as $meta)\n {\n // Loops the list of attributes\n foreach ($meta->attributes as $attribute)\n {\n\n // Checks if the page is OG Compliant\n if ($attribute->name == 'name'\n && $attribute->value == 'og:description'\n && $meta->attributes->getNamedItem('content')->value !== ''\n ) {\n // Returns the og:description\n return trim($meta->attributes->getNamedItem('content')->value);\n }\n\n // looks for the description meta tag\n if ($attribute->name == 'name'\n && $attribute->value == 'description'\n && $meta->attributes->getNamedItem('content')->value !== ''\n ) {\n return trim($meta->attributes->getNamedItem('content')->value);\n }\n }\n }\n\n $article = $this->parsedDOM->getElementsByTagName('article')->item(0);\n\n if ($article !== null ) {\n // Search the first paragraph inside the article\n $paragraph = $article->firstChild->nodeValue;\n return trim($paragraph);\n\n }\n\n $paragraph = $this\n ->parsedDOM\n ->getElementsByTagName('p')\n ->item(0);\n\n if ($paragraph !== null) {\n return trim($paragraph);\n }\n\n return trim($this\n ->parsedDOM\n ->getElementsByTagName('body')\n ->item(0)\n ->nodeValue);\n }", "function get_tag( $attr, $value, $html ) {\r\n\t\t\r\n\t\t\t$attr = preg_quote($attr);\r\n\t\t\t$value = preg_quote($value);\r\n\t\t \r\n\t\t\t//scan the dom for a fully matching div tag\r\n\t\t\t$tag_regex = '/<div[^>]*'.$attr.'=\"'.$value.'\">(.*?)<\\\\/div>/si';\r\n\t\t\r\n\t\t\t//return first match\r\n\t\t\tpreg_match($tag_regex,\r\n\t\t\t$html,\r\n\t\t\t$matches);\r\n\t\t\treturn $matches[1];\r\n\t\t}", "public function getContentType(): ?TagInterface;", "function extract_html_tag($line) {\n if (preg_match(self::REGEX_CODE, $line)) {\n return preg_replace(self::REGEX_CODE, '\\1', $line);\n }\n }", "protected function extractImageFromHTML($text, $type=''){\n if(!class_exists('DOMDocument') ){\n return;\n }\n $html = new DOMDocument();\n $html->recover = true;\n $html->strictErrorChecking = false;\n $html->loadHTML($text);\n $images = array();\n foreach($html->getElementsByTagName('img') as $image) {\n $imgSrc = preg_match('/http/', $image->getAttribute('src'))? $image->getAttribute('src') : JURI::root().$image->getAttribute('src');\n $images[] = array(\n 'src' => $imgSrc,\n 'class' => $image->getAttribute('class'),\n 'type' => $type\n );\n }\n return $images;\n }", "public abstract function get_html();", "function parseHtml($s_str)\r\n{\r\n$i_indicatorL = 0;\r\n$i_indicatorR = 0;\r\n$s_tagOption = \"\";\r\n$i_arrayCounter = 0;\r\n$a_html = array();\r\n// Search for a tag in string\r\nwhile( is_int(($i_indicatorL=strpos($s_str,\"<\",$i_indicatorR))) ) {\r\n// Get everything into tag...\r\n$i_indicatorL++;\r\n$i_indicatorR = strpos($s_str,\">\", $i_indicatorL);\r\n$s_temp = substr($s_str, $i_indicatorL, ($i_indicatorR-$i_indicatorL) );\r\n$a_tag = explode( ' ', $s_temp );\r\n// Here we get the tag's name\r\nlist( ,$s_tagName,, ) = each($a_tag);\r\n$s_tagName = strtoupper($s_tagName);\r\n// Well, I am not interesting in <br>, </font> or anything else like that...\r\n// So, this is false for tags without options.\r\n$b_boolOptions = is_array(($s_tagOption=each($a_tag))) && $s_tagOption[1];\r\nif( $b_boolOptions ) {\r\n// Without this, we will mess up the array\r\n$i_arrayCounter = (int)count($a_html[$s_tagName]);\r\n// get the tag options, like src=\"htt://\". Here, s_tagTokOption is 'src'and s_tagTokValue is '\"http://\"'\r\n\r\ndo {\r\n$s_tagTokOption = strtoupper(strtok($s_tagOption[1], \"=\"));\r\n$s_tagTokValue = trim(strtok(\"=\"));\r\n$a_html[$s_tagName][$i_arrayCounter][$s_tagTokOption] =\r\n$s_tagTokValue;\r\n$b_boolOptions = is_array(($s_tagOption=each($a_tag))) &&\r\n$s_tagOption[1];\r\n} while( $b_boolOptions );\r\n}\r\n}\r\nreturn $a_html;\r\n}", "public function parse($html);", "public function parse($html);", "public function getFirstTagContent($tag, $input, $save = false) {\n $start = strpos($input, '<' . $tag . '>') + strlen($tag) + 2;\n\n // If the tag has attributes, remove them, for the end tag won't contain them\n if (strpos($tag, ' ') > 0) {\n $tag = substr($tag, 0, strpos($tag, ' '));\n }\n\n $end = strpos($input, '</' . $tag . '>') - $start;\n if ($end <= 0) {\n return '';\n }\n\n if ($save) {\n return trim(\n str_replace('--lt--', '<',\n str_replace('--gt--', '>', substr($input, $start, $end))\n )\n );\n }\n\n return trim(substr($input, $start, $end));\n }", "function getTOCFromTag($html)\n {\n // TODO Getting allways the first one, investigate why sometimes have more.\n $tocs = [];\n $toc = '';\n if (preg_match(\"/_Toc[0-9]*/i\", $html, $tocs)) {\n $toc = current($tocs);\n }\n return $toc;\n }", "abstract function get_html();", "function extractText($array){\n\tif(count($array) <= 1){\n\t\t//we only have one tag to process!\n\t\t$value = \"\";\n\t\tfor ($i = 0; $i<count($array); $i++){\n\t\t\t$node = $array[$i];\n\t\t\t$value = $node->get_content();\n\t\t}\n\t\treturn $value;\n\t} \n}", "function extract_from_hyperlink($str, $type = 'id') {\n $result = '';\n\n $type = strtolower($type);\n $target = ($type === 'label' ? 2 : 1);\n\n $pattern = '#=HYPERLINK\\(\"([^\"]+)\",\"([^\"]+)\"\\)#';\n $matches = array();\n\n if(preg_match($pattern, $str, $matches)) {\n $result = $matches[$target];\n\n // additional processing required for IDs\n if ($target === 1) {\n $result = substr(strrchr($result, '/'), 1);\n }\n }\n\n return $result;\n}", "protected function parse_content(){\n $m = array(); // we will keep here\n list( $t, $text ) = explode( \"<div class='post entry-content '>\", $this->page );\n list( $text, $t ) = explode( '</div>', $text );\n return $text;\n }", "public function get_tag_content($tag_to_grab, $input, $replace_html = true) {\n $tag_content = preg_split(\"/\\<$tag_to_grab\\>/i\", $input, 0);\n if (strpos($tag_to_grab, ' ') > 0) {\n $tag_to_grab = substr($tag_to_grab, 0, strpos($tag_to_grab, ' '));\n }\n\n $tag_content = preg_split(\"/\\<\\/$tag_to_grab\\>/i\", $tag_content[1], 0);\n\n if ($replace_html) {\n $tag_content[0] = str_replace('--lt--', '<', $tag_content[0]);\n $tag_content[0] = str_replace('--gt--', '>', $tag_content[0]);\n }\n\n return $tag_content[0];\n }", "function get_first_paragraph($_id_post){\n\t\n\t$post = get_post($_id_post);\n\n\t$text = $post->post_content;\n\n\t$start = strpos($text, '<p>'); // Locate the first paragraph tag\n\t$end = strpos($text, '</p>', $start); // Locate the first paragraph closing tag\n\t$text = substr($text, $start, $end-$start+4); // Trim off everything after the closing paragraph tag\n\t$text = strip_shortcodes( $text ); // Remove shortcodes\n\t$text = apply_filters('the_content', $text); // remove tag html by wp\n\t$text = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $text);\t // Remove tag script\n\t$text = wpautop( $text );\t// Remove break\n\t$text = strip_tags($text);\t// Remove tags html\n\n\treturn $text ;\n\t \n}", "private function getFirstWithinAsset($asset, $type) {\n\t\t$widgetArray = $this->getAllWithinAsset($type,$asset,1);\n\t\tif(count($widgetArray)>0) {\n\t\t\tforeach($widgetArray as $widget) {\n\t\t\t\tif(!$widget->getDisplay()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach($widget->fieldContentsArray as $fieldContents) {\n\t\t\t\t\t\n\t\t\t\t\treturn $fieldContents;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn FALSE;\n\n\t}", "function sloodle_extract_first_image_url($html) {\n if (preg_match(\"/<img .*?(?=src)src=\\\"([^\\\"]+)\\\"/si\", $html, $m)) {\n \treturn $m[1];\n }\n return '';\n }", "public function getFirstChildByType($type)\n {\n foreach ($this->children as $child) {\n if ($child->getType() === $type) {\n return $child;\n }\n }\n return false;\n }", "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}", "abstract public function getTag($tagName);", "static protected function _extractTagContents($tag, $data)\n\t{\n\t\t$tag = trim($tag, '<> ');\n\t\t\n\t\tif (false !== strpos($data, '<' . $tag . '>') and \n\t\t\tfalse !== strpos($data, '</' . $tag . '>'))\n\t\t{\n\t\t\t$data = strstr($data, '<' . $tag . '>');\n\t\t\t$end = strpos($data, '</' . $tag . '>');\n\t\t\t\n\t\t\treturn substr($data, strlen($tag) + 2, $end - (strlen($tag) + 2));\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public function getFirst($type = 'article'){\n\t\t$this -> db -> select('*');\n\t\t$this -> db -> where('type', $type);\n\t\t$this -> db -> order_by('id');\n\t\t$result = $this -> db -> get($this -> tableName, 1) -> row_array();\n\n\t\treturn $result;\n\t}", "public function getTagName();", "public function getFirstTagNameDataProvider() {}", "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 getTagName ()\n\t{\n\t\treturn 'html';\n\t}", "public function getTag($tagName);", "function launchpad_find_flexible_content($type = '') {\n\tif($type === '') {\n\t\treturn '';\n\t}\n\t$attempt = locate_template('flexible/custom/' . $type);\n\tif($attempt) {\n\t\treturn $attempt;\n\t} else {\n\t\treturn locate_template('flexible/core/' . $type);\n\t}\n}", "function textile($content)\n{\n $parser = new \\Netcarver\\Textile\\Parser();\n\n return $parser\n ->setDocumentType('html5')\n ->parse($content);\n}", "function everything_in_tags($string, $tagname)\n{\n $pattern = \"#<\\s*?$tagname\\b[^>]*>(.*?)</$tagname\\b[^>]*>#s\";\n preg_match($pattern, $string, $matches);\n return $matches[1];\n}", "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 }", "function fett_process_html_tag(&$vars) {\n if (theme_get_setting('fett_html_tags')) {\n $el = &$vars['element'];\n\n // Remove type=\"...\" and CDATA prefix/suffix.\n unset($el['#attributes']['type'], $el['#value_prefix'], $el['#value_suffix']);\n\n // Remove media=\"all\" but leave others unaffected.\n if (isset($el['#attributes']['media']) && $el['#attributes']['media'] === 'all') {\n unset($el['#attributes']['media']);\n }\n }\n}", "function getFirstFuelType($dom) {\n $motor_table = $dom->find(\"table.listafichatecnica\", 0);\n $a_fuel = array();\n $fuel_row = $motor_table->find(\"tbody tr\", 3);\n $a_details = array();\n\n $type = trim($fuel_row->find(\"td\", 1)->plaintext);\n //print $type . \"\\n\";\n return $type;\n}", "function getFirstFuelType($dom) {\n $motor_table = $dom->find(\"table.listafichatecnica\", 0);\n $a_fuel = array();\n $fuel_row = $motor_table->find(\"tbody tr\", 3);\n $a_details = array();\n\n $type = trim($fuel_row->find(\"td\", 1)->plaintext);\n //print $type . \"\\n\";\n return $type;\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 getTagName() {}", "private function unifyHtml($html)\n {\n $htmlWithDocumentType = $this->ensureDocumentType($html);\n\n return $this->addContentTypeMetaTag($htmlWithDocumentType);\n }", "public function getHTML();", "function extract($content)\n\t{\n if (!is_string($content) OR !$this->is_pjax()) {\n return $content;\n }\n\n // We only process if we find a valid <body>\n preg_match('/(?:<body[^>]*>)(.*)<\\/body>/isU', $content, $matches);\n\n // Did we find the body\n if (count($matches) !== 2) {\n return $content;\n }\n\n $body = $matches[1];\n\n // Does the page have a title\n preg_match('@<title>([^<]+)</title>@', $content, $matches);\n\n // Did we find the title\n $title = (count($matches) === 2) ? $matches[0] : '';\n\n // Set new content\n return $title.$body;\n\t}", "public function autoParse()\n {\n $type = $this->getMimeType();\n $contents = '';\n\n if ($type == 'application/json' || $type == 'text/json') {\n $contents = $this->parseJson();\n } elseif ($type == 'application/xml' || $type == 'text/xml') {\n $contents = $this->parseXml();\n } elseif ($type == 'application/x-yaml' || $type == 'text/yaml') {\n $contents = $this->parseYaml();\n } else {\n $contents = $this->getContents();\n }\n\n return $contents;\n }", "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 extractFirst($pat) {\r\n preg_match($pat, $this->contents, $matches);\r\n return $matches;\r\n }", "function ep_get_teaser_or_body() {\n\n\t$content = ep_get_the_content(\"teaser\");\n\tif (empty($content)) {\n\t\t$content = ep_get_the_content(\"body\");\n\t}\n\treturn $content;\n}", "function extract_tag_contents($line) {\n if (preg_match(self::REGEX_TEXT, $line)) {\n $text = preg_replace(self::REGEX_TEXT, '\\2', $line);\n return $this->evaluate_variables($text);\n }\n }", "function catchFirstImage()\n{\n global $post, $posts;\n $first_img = '';\n ob_start();\n ob_end_clean();\n $output = preg_match_all(\n '/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i',\n $post->post_content,\n $matches\n );\n $first_img = $matches[1][0];\n if (empty($first_img)) {\n $first_img = get_template_directory_uri() . '/img/noimage.png';\n }\n return $first_img;\n}", "public function getFirstTagDataProvider() {}", "public function getNextTag($dump_type = 0 /*myFlvHandler::GET_NEXT_TAG_META*/)\n\t{\n\t\t$start_pos = $this->pos;\n\t\t$data = @fread($this->fh, 12);\n\t\tif (!strlen($data))\n\t\t\treturn null;\n\t\t\t\n\t\t$temp_data = $data[0].\"\\0\".substr($data,1, 3).$data[7].substr($data,4, 3).$data[11];\n\t\t\n\t\t$res = unpack(\"Ca/Nb/Nc/Cd\", $temp_data);\n\t\t$size = $res['b'] + self::TAG_WRAPPER_SIZE;\n\t\t\n\t\t$this->pos += $size;\n\t\t\n\t\tif ($dump_type == myFlvHandler::GET_NEXT_TAG_META)\n\t\t\t$data = null;\n\t\telse\n\t\t{\n\t\t\t$data = $data.fread($this->fh, $size - 12);\n\t\t\n\t\t\tif ($dump_type == myFlvHandler::GET_NEXT_TAG_DATA) // return actual tag\n\t\t\t\treturn $data;\n\t\t}\n\t\t\n\t\tfseek($this->fh, $this->pos, SEEK_SET);\n\t\t\n\t\t// type, size, timestamp, keyframe, start_pos, [data]\n\t\treturn array($res['a'], $size, $res['c'], ($res['d'] & 0xF0) == 0x10, $start_pos, $data);\n\t}", "public function buildContent($type) {\n $content = \"\";\n foreach ($this->json[$type] as $p) {\n $element = $this->getElementFromIdentifier($p['type']);\n if ($element === null) {\n continue;\n }\n $template = $element->getBuildTemplate();\n $content .= $template->render($p);\n }\n return $content;\n }", "public function extractTitle()\n {\n $title = $this->parsedDOM->getElementsByTagName('title')->item(0);\n\n if (\n $title !== null\n && $title->nodeValue !== ''\n ) {\n return $title->nodeValue;\n } else {\n return\n $this\n ->parsedDOM\n ->getElementsByTagName('h1')\n ->item(0)\n ->nodeValue;\n }\n }", "function findCode( $html ) {\n $code = '';\n\n foreach ( $html->find( 'main iframe, main script, main object, main form' ) as $element ) {\n $code .= '<tr>';\n $code .= '<td>' . $element->tag . '</td>';\n $code .= '<td><code>' . htmlspecialchars( $element ) . '</code></td>';\n $code .= '</tr>';\n }\n\n return $code;\n}", "function parse($data = \"\") {\n // bold, italic, h2 (Название)\n $data = preg_replace(\"/<span class=rvts78>(.+?)\\s?<\\/span>/i\",\"##**_$1_**\",$data);\n // bold. h3 (коротко)\n $data = preg_replace(\"/<span class=rvts23>(.+?)\\s?<\\/span>/i\",\"###**$1**\",$data);\n // bold (Статья)\n $data = preg_replace(\"/<span class=rvts(?:9|44)>(.+?)\\s?<\\/span>/i\",\"**$1**\",$data);\n // bold h4 (Раздел)\n $data = preg_replace(\"/<span class=rvts15>(.+?)\\s?<\\/span>/i\",\"####**$1**\",$data);\n\n $container = $data;\n\n $container = strip_tags($container);\n $container = preg_replace(\"/&nbsp;/s\",\" \",$container);\n $container = preg_replace(\"/(\\r\\n|\\n|\\r)+/s\",\"\\n\\n\",$container);\n return trim($container);\n}", "function getName($str){\n $value = preg_match_all('/<span itemprop=\\\"name\\\" class=\\\"vis\\\">(.*?)<\\/span>/s',$str, $names);\n $name = $names[0][0];\n $name = strip_tags($name);\n\n return $name;\n}", "public function getTag();", "public function getTag();", "function lessie_process_html_tag(&$vars) {\r\n $el = &$vars['element'];\r\n\r\n // Remove type=\"...\" and CDATA prefix/suffix.\r\n unset($el['#attributes']['type'], $el['#value_prefix'], $el['#value_suffix']);\r\n\r\n // Remove media=\"all\" but leave others unaffected.\r\n if (isset($el['#attributes']['media']) && $el['#attributes']['media'] === 'all') {\r\n unset($el['#attributes']['media']);\r\n }\r\n}", "function get_a_content($file){\r\n $h1count = preg_match_all(\"/(<a.*>)(\\w.*)(<.*>)/ismU\",$file,$patterns);\r\n return $patterns[2];\r\n}", "function getContentArrayForTemplating($code, $strip_template_content_comments = false) {\r\n\t\t// assume the main <h1> is directly in the content <div>\r\n\t//\t$inventing_h1 = false;\r\n\t//\t$h1_strpos = strpos($code, '<h1');\r\n\t\t//print('$h1_strpos: ');var_dump($h1_strpos);\r\n\t\t//print('code}}}<br>');\r\n\t\t//print($code);\r\n\t\t//print('{{{code<br>');\r\n\t\t//exit(0);\r\n\t\t$found_h1 = false;\r\n\t//\tif($h1_strpos === false) {\r\n\t\t\t// ideally we would run structure on every file and this problem would go away, but it shouldn't be bad to write a possibly overlapping solution here\r\n\t\t\t// take a shot; look for what seems like paragraph content then take the first block in its container\r\n\t\t\tpreg_match_all('/<(p|h[1-6])[^<>]*?>(.*?)<\\/\\1>/is', $code, $possible_heading_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t//var_dump($possible_heading_matches);\r\n\t\t\tforeach($possible_heading_matches[0] as $index => $value) {\r\n\t\t\t\t$possible_heading_content = $possible_heading_matches[2][$index][0];\r\n\t\t\t\t//var_dump($possible_heading_content);\r\n\t\t\t\t/*if(substr_count($possible_heading_content, '.') > 2 || substr_count($paragraph_content, ':') > 0) {\r\n\t\t\t\t\t$paragraph_offset = $possible_heading_matches[0][$index][1];\r\n\t\t\t\t\t$blockArray = OM::getContainingBlock($code, $paragraph_offset);\r\n\t\t\t\t\t//$blockString = $blockArray[0];\r\n\t\t\t\t\t//$offset_contained_string_in_block = $blockArray[1];\r\n\t\t\t\t\t$containing_block_offset = $blockArray[2];\r\n\t\t\t\t\tpreg_match('/<(h1|h2|h3|h4|h5|h6|p)[^<>]*?>(.*?)<\\/\\1>/is', $code, $h1_matches, PREG_OFFSET_CAPTURE, $containing_block_offset);\r\n\t\t\t\t\t$h1_strpos = $h1_matches[0][1];\r\n\t\t\t\t\t$inventing_h1 = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}*/\r\n\t\t\t\tif(ReTidy::isIndexical($possible_heading_content)) {\r\n\t\t\t\t\t//print('possible_heading_content is indexical.<br>');\r\n\t\t\t\t\t//print('$possible_heading_content: ' . $possible_heading_content);\r\n\t\t\t\t\t$h1_strpos = $possible_heading_matches[0][$index][1];\r\n\t\t\t\t\t$h1_including_tag = $possible_heading_matches[0][$index][0];\r\n\t\t\t\t\t$h1_previous_tag_name = $possible_heading_matches[1][$index][0];\r\n\t\t\t\t\t$found_h1 = true;\r\n\t//\t\t\t\t$inventing_h1 = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t//\t\tif(!$inventing_h1) {\r\n\t//\t\t\t//print($code);\r\n\t//\t\t\tprint('h1 not detected or created in getContentArrayForTemplating; this needs to be fixed.');exit(0);\r\n\t//\t\t}\r\n\t//\t}\r\n\t\t$get_content_more_crudely = true;\r\n\t\tif(strpos($code, '<div') === false) {\r\n\t\t\t//print('here347459475948759<br>');\r\n\t\t} else {\r\n\t\t\t//print('here347459475948760<br>');\r\n\t\t\tif($found_h1) {\r\n\t\t\t\t// we assume the code is syntactically sound for this...\r\n\t\t\t\tpreg_match_all('/<div/is', substr($code, 0, $h1_strpos), $open_div_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t\tpreg_match_all('/<\\/div>/is', substr($code, 0, $h1_strpos), $close_div_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t\t//print('$open_div_matches: ');var_dump($open_div_matches);\r\n\t\t\t\t$counter1 = sizeof($open_div_matches[0]) - 1;\r\n\t\t\t\t$counter2 = sizeof($close_div_matches[0]) - 1;\r\n\t\t\t\t$found_content_div = false;\r\n\t\t\t\t//print('here183945606067<br>');\r\n\t\t\t\tif(sizeof($open_div_matches) > 0) {\r\n\t\t\t\t\twhile($counter1 > -1) {\r\n\t\t\t\t\t\t//print('here183945606068<br>');\r\n\t\t\t\t\t\t$strpos_open_div = $open_div_matches[0][$counter1][1];\r\n\t\t\t\t\t\twhile($counter2 > -1) {\r\n\t\t\t\t\t\t\t//print('here183945606069<br>');\r\n\t\t\t\t\t\t\t$strpos_close_div = $close_div_matches[0][$counter2][1];\r\n\t\t\t\t\t\t\t$counter2--;\r\n\t\t\t\t\t\t\tif($strpos_close_div > $strpos_open_div) {\r\n\t\t\t\t\t\t\t\t$counter1--;\r\n\t\t\t\t\t\t\t\tcontinue 2;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$strpos_content_div = $strpos_open_div;\r\n\t\t\t\t\t\t\t\t$found_content_div = true;\r\n\t\t\t\t\t\t\t\tbreak 2;\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$counter1--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!$found_content_div) {\r\n\t\t\t\t//print('here347459475948761<br>');\r\n\t\t\t} else {\r\n\t\t\t\t//print('here347459475948762<br>');\r\n\t\t\t\t//$strpos_content_div = ReTidy::strpos_last(substr($code, 0, $h1_strpos), '<div');\r\n\t\t\t\t$content_div_code = OM::getOString($code, '<div', '</div>', $strpos_content_div);\r\n\t\t\t\t//print('$content_div_code: ');var_dump($content_div_code);\r\n\t\t\t\t$strlen_opening_content_div = strpos($content_div_code, '>') + 1;\r\n\t\t\t\t$content = substr($content_div_code, $strlen_opening_content_div, strlen($content_div_code) - $strlen_opening_content_div - 6);\r\n\t\t\t\t/*print('XXX9o9beep39o9XXX\r\n');\r\n\t\t\t\tprint('$content (div-wise): ' . $content);\r\n\t\t\t\tprint('\r\nXXX9o9beep49o9XXX\r\n\t\t\t\t');*/\r\n\t\t\t\t$content_offset = $strpos_content_div + $strlen_opening_content_div;\r\n\t\t\t\t$get_content_more_crudely = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($get_content_more_crudely) {\r\n\t\t\t//print('here347459475948763<br>');\r\n\t\t\t$body = OM::getOString($code, '<body', '</body>');\r\n\t\t\tif(strlen($body) === 0) {\r\n\t\t\t\t//print('here347459475948764<br>');\r\n\t\t\t\t//if($h1_strpos === false) {\r\n\t\t\t\tif(!$found_h1) {\r\n\t\t\t\t\t//return $code; // we return the unchanged code\r\n\t\t\t\t\t//ReTidy::fatal_error('did not find the &lt;body&gt; of the document or it has zero length');exit(0);\r\n\t\t\t\t\t$strpos_last_meta = ReTidy::strpos_last($code, '<meta');\r\n\t\t\t\t\t$content_offset = $strpos_last_meta + strpos($code, '>', $strpos_last_meta);\r\n\t\t\t\t\t$content = substr($code, $content_offset);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$content_offset = $h1_strpos;\r\n\t\t\t\t\t$content = substr($code, $h1_strpos);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t//print('here347459475948765<br>');\r\n\t\t\t\t$body_offset = strpos($code, '<body');\r\n\t\t\t\tpreg_match('/<body[^<>]*?>/is', $body, $opening_body_tag_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t\t$opening_body_tag = $opening_body_tag_matches[0][0];\r\n\t\t\t\t$strlen_opening_body_tag = strlen($opening_body_tag);\r\n\t\t\t\t$content = substr($body, $strlen_opening_body_tag, strlen($body) - $strlen_opening_body_tag - 7);\r\n\t\t\t\t$content_offset = $body_offset + $opening_body_tag_matches[0][1] + $strlen_opening_body_tag;\r\n\t\t\t\t//$cleaned_content = $content;\r\n\t\t\t}\r\n\t\t}\r\n\t\t/*\r\n\t\t// content; in this generalized templater order, attempts at grabbing the content are from the more specific to the more general\r\n\t\t$opening_content_div = '<div id=\"cn-centre-col-inner\">';\r\n\t\t$strpos_content_div = strpos($code, $opening_content_div);\r\n\t\tif($strpos_content_div !== false) {\r\n\t\t\t$content_div_code = OM::getOString($code, '<div', '</div>', $strpos_content_div);\r\n\t\t\t$strlen_opening_content_div = strlen($opening_content_div);\r\n\t\t\t$content = substr($content_div_code, $strlen_opening_content_div, strlen($content_div_code) - $strlen_opening_content_div - 6);\r\n\t\t\t$content_offset = $strpos_content_div + $strlen_opening_content_div;\r\n\t\t\t//print($content);exit(0);\r\n\t\t\t// call the end of content comment comment part of the content container rather than the content itself...\r\n\t\t\t// treating the open and close differently and possibly leaving us open to future problems...\r\n\t\t\t//$pos_close_content_comment = strpos($content, '<!-- clf2-nsi2 theme ends / Fin du thème clf2-nsi2 -->');\r\n\t\t\t//if($pos_close_content_comment !== false) {\r\n\t\t\t//\t$content = substr($content, 0, $pos_close_content_comment);\r\n\t\t\t//}\r\n\t\t\t//print($content);exit(0);\r\n\t\t\tif($strip_template_content_comments) {\r\n\t\t\t\t// remove template comments from the beginning of the content\r\n\t\t\t\t$cleaned_content = $content;\r\n\t\t\t\t$cleaned_content = str_replace('<!-- Content title begins / Début du titre du contenu -->', '', $cleaned_content);\r\n\t\t\t\t$cleaned_content = str_replace('<!-- Content Title ends / Fin du titre du contenu -->', '', $cleaned_content);\r\n\t\t\t\t$cleaned_content = str_replace('<!-- clf2-nsi2 theme begins / Début du thème clf2-nsi2 -->', '', $cleaned_content);\r\n\t\t\t\t// remove template comments from the end of the content?\r\n\t\t\t\t$cleaned_content = str_replace('<!-- clf2-nsi2 theme ends / Fin du thème clf2-nsi2 -->', '', $cleaned_content);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$opening_content_div = '<div class=\"center\">';\r\n\t\t\t$strpos_content_div = strpos($code, $opening_content_div);\r\n\t\t\tif($strpos_content_div !== false) {\r\n\t\t\t\t$content_div_code = OM::getOString($code, '<div', '</div>', $strpos_content_div);\r\n\t\t\t\t$strlen_opening_content_div = strlen($opening_content_div);\r\n\t\t\t\t$content = substr($content_div_code, $strlen_opening_content_div, strlen($content_div_code) - $strlen_opening_content_div - 6);\r\n\t\t\t\t$content_offset = $strpos_content_div + $strlen_opening_content_div;\r\n\t\t\t\tif($strip_template_content_comments) {\r\n\t\t\t\t\t// remove template comments from the beginning of the content\r\n\t\t\t\t\t$cleaned_content = $content;\r\n\t\t\t\t\t$cleaned_content = str_replace('<!-- CONTENT TITLE BEGINS | DEBUT DU TITRE DU CONTENU -->', '', $cleaned_content);\r\n\t\t\t\t\t$cleaned_content = str_replace('<!-- CONTENT TITLE ENDS | FIN DU TITRE DU CONTENU -->', '', $cleaned_content);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$body = OM::getOString($code, '<body', '</body>');\r\n\t\t\t\tif(strlen($body) === 0) {\r\n\t\t\t\t\t//return $code; // we return the unchanged code\r\n\t\t\t\t\tReTidy::fatal_error('did not find the &lt;body&gt; of the document or it has zero length');exit(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpreg_match('/<body[^<>]*?>/is', $body, $opening_body_tag_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t\t\t$opening_body_tag = $opening_body_tag_matches[0][0];\r\n\t\t\t\t\t$strlen_opening_body_tag = strlen($opening_body_tag);\r\n\t\t\t\t\t$content = substr($body, $strlen_opening_body_tag, strlen($body) - $strlen_opening_body_tag - 7);\r\n\t\t\t\t\t$content_offset = $opening_body_tag_matches[0][1] + $strlen_opening_body_tag;\r\n\t\t\t\t\t$cleaned_content = $content;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}*/\r\n\t\t// force every document to have an h1 and force the h1 to be at the start of the content\r\n\t\t//print('$h1_including_tag1: ' . $h1_including_tag);\r\n\t\t//print('$h1_previous_tag_name: ');var_dump($h1_previous_tag_name);\r\n\t\t//print('content_in_templating1: ' . $content);\r\n\t\tif(!$found_h1) {\r\n\t\t\t$h1_including_tag = '<h1>Dummy h1</h1>';\r\n\t\t\t$added_h1_length = strlen($h1_including_tag);\r\n\t\t\t$h1_previous_tag_name = 'h1';\r\n\t\t\t//$h1_strpos = $content_offset + 4;\r\n\t\t} else {\r\n\t\t\t$added_h1_length = 0;\r\n\t\t\t// cutting the h1 out\r\n\t\t\t//$content = substr($content, 0, $h1_strpos) . substr($content, $h1_strpos + strlen($h1_including_tag));\r\n\t\t\t//$content = substr($code, $content_offset, $h1_strpos) . substr($code, $h1_strpos + strlen($h1_including_tag), strlen($code) - $content_offset - ($h1_strpos + strlen($h1_including_tag)) - strlen(substr($code, $content_offset + strlen($content))));\r\n\t\t\t//$content = substr($code, $content_offset, $h1_strpos) . substr($code, $h1_strpos + strlen($h1_including_tag));\r\n\t\t\t$length_of_after_content = strlen($code) - $content_offset - strlen($content);\r\n\t\t\t$length_of_after_h1_including_tag = strlen($code) - ($h1_strpos + strlen($h1_including_tag));\r\n\t\t\t//print('after_content: ' . substr($code, $content_offset + strlen($content)));\r\n\t\t\t//print('after_h1_including_tag : ' . substr($code, $h1_strpos + strlen($h1_including_tag)));\r\n\t\t\t//$length_of_after_content = strlen(substr($code, $content_offset + strlen($content)));\r\n\t\t\t//$length_of_after_h1_including_tag = strlen(substr($code, $h1_strpos + strlen($h1_including_tag)));\r\n\t\t\t//print('substr($code, $content_offset, $h1_strpos - $content_offset) : ' . substr($code, $content_offset, $h1_strpos - $content_offset) );\r\n\t\t\t//print('substr($code, $h1_strpos + strlen($h1_including_tag), $length_of_after_h1_including_tag - $length_of_after_content) : ' . substr($code, $h1_strpos + strlen($h1_including_tag), $length_of_after_h1_including_tag - $length_of_after_content));\r\n\t\t\t$content = substr($code, $content_offset, $h1_strpos - $content_offset) . substr($code, $h1_strpos + strlen($h1_including_tag), $length_of_after_h1_including_tag - $length_of_after_content);\r\n\t\t}\r\n\t\t//print('substr($code, $h1_strpos, strlen($h1_including_tag)): ' . substr($code, $h1_strpos, strlen($h1_including_tag)));\r\n\t\t//print('$content in templating2: ');ReTidy::var_dump_full($content);\r\n\t\t$h1_including_tag = str_replace('<' . $h1_previous_tag_name, '<h1', $h1_including_tag);\r\n\t\t$h1_including_tag = str_replace('</' . $h1_previous_tag_name . '>', '</h1>', $h1_including_tag);\r\n\t\t$length_adjustment_due_to_previous_tag_name = 2 * (strlen('h1') - strlen($h1_previous_tag_name));\r\n\t\t//print('$h1_including_tag2: ' . $h1_including_tag);\r\n\t\t$content = $h1_including_tag . $content;\r\n\t\t//print('$content: ');var_dump($content);\r\n\t\t//print('$code2: ' . htmlentities($code));\r\n\t\t//print('content_in_templating3: ' . $content);\r\n\t\t//print('$code, $content_offset, $content: ');ReTidy::var_dump_full($code, $content_offset, $content);\r\n\t\t$code = substr($code, 0, $content_offset) . $content . substr($code, $content_offset + strlen($content) - $length_adjustment_due_to_previous_tag_name - $added_h1_length);\r\n\t\t// 2017-10-05\r\n\t\t// 2018-07-25; previously it was unclear why -2, but frequently we are converting a <p> to an <h1> making a difference in length of 2\r\n\t\t//$code = substr($code, 0, $content_offset) . $content . substr($code, $content_offset + strlen($content));\r\n\t\t//print('$code3: ' . htmlentities($code));\r\n\t\t// h1 inside the content\r\n\t//\tif(!$inventing_h1) {\r\n\t\t\tpreg_match('/<h1[^<>]*?>(.*?)<\\/h1>/is', $content, $h1_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t$h1 = $h1_matches[1][0];\r\n\t//\t} else {\r\n\t\t\t//print('should never get here...3489573495873');exit(0);\r\n\t\t\t//$h1 = $h1_matches[2][0];\r\n\t//\t\t$h1 = $possible_heading_content;\r\n\t//\t}\r\n\t\t// remove anchors and comments from the h1; if they are required, then the new versions should exist in the template\r\n\t\t$cleaned_h1 = $h1;\r\n\t\t$cleaned_h1 = preg_replace('/<a [^<>]*?>/is', '', $cleaned_h1);\r\n\t\t$cleaned_h1 = preg_replace('/<!--[^<>]*?-->/is', '', $cleaned_h1);\r\n\t\t$cleaned_h1 = str_replace('</a>', '', $cleaned_h1);\r\n\t\t$h1_offset = $content_offset + $h1_matches[1][1];\r\n\t\t// exclude the <h1> from the content for the purposes of templating\r\n\t\t//$content = substr($content, $h1_matches[0][1] + strlen($h1_matches[0][0]));\r\n\t\t//$content = str_replace($h1_matches[0][0], '', $content); // not good enough\r\n\t\t$content = substr($content, $h1_matches[0][1] + strlen($h1_matches[0][0]));\r\n\t\t//print('content_in_templating4: ' . $content);\r\n\t\t$content_offset += $h1_matches[0][1] + strlen($h1_matches[0][0]); \r\n\t\t// exclude the date modified from the content for the purposes of templating\r\n\t\t// this is very specific so we might need to have date modified detection similar to what's in the templateCode function (around line 600)\r\n\t\tif(preg_match('/<dl[^<>]*?>\\s*<dt>(Date modified:|Date de modification&#160;:)<\\/dt>\\s*<dd>\\s*<span>\\s*<time>([^<>]*?)<\\/time>\\s*<\\/span>\\s*<\\/dd>\\s*<\\/dl>/is', $content, $date_modified_matches, PREG_OFFSET_CAPTURE)) {\r\n\t\t\t//var_dump($date_modified_matches);\r\n\t\t\t$content = substr($content, 0, $date_modified_matches[0][1]);\r\n\t\t}\r\n\t\t//print('content_in_templating5: ' . $content);\r\n\t\t$cleaned_content = $content;\r\n\t\t//print('$cleaned_content1: ' . $cleaned_content);\r\n\t\t$array_content_comments_to_remove = array(\r\n\t\t'<!-- Content title begins / Début du titre du contenu -->',\r\n\t\t'<!-- Content Title ends / Fin du titre du contenu -->',\r\n\t\t'<!-- clf2-nsi2 theme begins / Début du thème clf2-nsi2 -->',\r\n\t\t'<!-- clf2-nsi2 theme ends / Fin du thème clf2-nsi2 -->',\r\n\t\t'<!-- CONTENT TITLE BEGINS | DEBUT DU TITRE DU CONTENU -->',\r\n\t\t'<!-- CONTENT TITLE ENDS | FIN DU TITRE DU CONTENU -->',\r\n\t\t'<!-- InstanceEndEditable -->',\r\n\t\t);\r\n\t\tforeach($array_content_comments_to_remove as $index => $value) {\r\n\t\t\t$cleaned_content = str_replace($value, '', $cleaned_content);\r\n\t\t}\r\n\t\t//print('$cleaned_content2: ' . $cleaned_content);\r\n\t\t$array_regex_content_comments_to_remove = array(\r\n\t\t'<!-- InstanceBeginEditable name=\"[^\"]*?\" -->',\r\n\t\t);\r\n\t\tforeach($array_regex_content_comments_to_remove as $index => $value) {\r\n\t\t\t$cleaned_content = preg_replace('/' . $value . '/is', '', $cleaned_content);\r\n\t\t}\r\n\t\t//print('ContentArray\t: ');var_dump(array($content, $content_offset, $cleaned_content, $h1, $h1_offset, $cleaned_h1));\r\n\t\t//print('$cleaned_content3: ' . $cleaned_content);\r\n\t\t//print('$code in getContentArray: ' . $code);\r\n\t\treturn array($code, $content, $content_offset, $cleaned_content, $h1, $h1_offset, $cleaned_h1);\r\n\t}", "function get_first_image(){\n\tglobal $post, $posts; \n\t$first_img = ''; \n\tob_start(); \n\tob_end_clean(); \n\t$output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches); \n\t$first_img = $matches[1][0]; \n\t\n\tif(empty($first_img)){ \n\t\t$first_img = get_template_directory_uri(). '/images/myhead.jpg'; \n\t}\n\t\n\treturn $first_img; \n}", "private function get_document_head( $html ) {\n\t\t$head_html = $html;\n\n\t\t// Find the opening `<head>` tag.\n\t\t$head_start = strpos( $html, '<head' );\n\t\tif ( false === $head_start ) {\n\t\t\t// Didn't find it. Return the original HTML.\n\t\t\treturn $html;\n\t\t}\n\n\t\t// Find the closing `</head>` tag.\n\t\t$head_end = strpos( $head_html, '</head>' );\n\t\tif ( false === $head_end ) {\n\t\t\t// Didn't find it. Find the opening `<body>` tag.\n\t\t\t$head_end = strpos( $head_html, '<body' );\n\n\t\t\t// Didn't find it. Return the original HTML.\n\t\t\tif ( false === $head_end ) {\n\t\t\t\treturn $html;\n\t\t\t}\n\t\t}\n\n\t\t// Extract the HTML from opening tag to the closing tag. Then add the closing tag.\n\t\t$head_html = substr( $head_html, $head_start, $head_end );\n\t\t$head_html .= '</head>';\n\n\t\treturn $head_html;\n\t}", "function remove_tags_intra_tags() {\r\n\t\t$ct_intra_tags = 0;\r\n\t\t$ct2 = -1;\r\n\t\twhile($ct2 != 0) {\r\n\t\t\t/*preg_match_all('/(<[^>]*)<[^<>]+?>/is', $this->code, $debug_matches);\r\n\t\t\tprint('$debug_matches: ');var_dump($debug_matches);*/\r\n\t\t\t$this->code = preg_replace('/(<(![^\\-][^<>]+|[^!<>]+))<[^<>]+?>/is', '$1', $this->code, -1, $ct2); // changed (2012-01-25)\r\n\t\t\t$ct_intra_tags += $ct2;\r\n\t\t}\r\n\t\t$this->logMsgIf(\"tags intra tags removed\", $ct_intra_tags);\r\n\t\t// we must also ignore the <head>!\r\n\t\t// the only tag that has content in the head that I can think of is <title>, so:\r\n\t\tpreg_match_all('/<title>(.*?)<\\/title>/is', $this->code, $title_matches);\r\n\t\tif(sizeof($title_matches[0]) > 1) {\r\n\t\t\tprint(\"Well, that's not good; found more than one (\" . sizeof($title_matches[0]) . \") &lt;title&gt; tags on this page!\");exit(0);\r\n\t\t}\r\n\t\tif(sizeof($title_matches[0]) === 0) {\r\n\t\t\t// nothing to do\r\n\t\t} else {\r\n\t\t\t$ct_title = 0;\r\n\t\t\t$initial_title_string = $title_string = $title_matches[0][0];\r\n\t\t\t$ct1 = -1;\r\n\t\t\r\n\t\t\twhile($ct1 != 0) {\r\n\t\t\t\t$title_string = preg_replace('/<title>(.*?)<[^<>]+?>(.*?)<\\/title>/is', '<title>$1$2</title>', $title_string, -1, $ct1);\r\n\t\t\t\t$ct_title += $ct1;\r\n\t\t\t}\r\n\t\t\t$this->code = str_replace($initial_title_string, $title_string, $this->code);\r\n\t\t}\r\n\t\t$this->logMsgIf(\"tags removed from title tag\", $ct_title);\r\n\t\t// this should only happen if something exists in both the acronyms and abbr files (erroneously) or if\r\n\t\t// an bbreviation is a substring of another abbreviation but we'll still clean it up\r\n\t\t//$this->code = preg_replace('/<(abbr|acronym) title=\"([^\"]*?)\"><(abbr|acronym) title=\"([^\"]*?)\">(.*?)<\\/(abbr|acronym)><\\/(abbr|acronym)>/is', '<$1 title=\"$2\">$4</$5>', $this->code, -1, $ct_redundant_acro);\r\n\t\t$ct_redundant_acro = 0;\r\n\t\t$array_tags = array('abbr', 'acronym');\r\n\t\t$tagNamesString = implode('|', $array_tags);\r\n\t\tforeach($array_tags as $tagName) {\r\n\t\t\t$OStrings = OM::getAllOStrings($this->code, '<' . $tagName, '</' . $tagName . '>');\r\n\t\t\t//var_dump($OStrings);exit(0);\r\n\t\t\t$counter = sizeof($OStrings) - 1;\r\n\t\t\twhile($counter >= 0) {\r\n\t\t\t\t$OString = $OStrings[$counter][0];\r\n\t\t\t\t$opening_tag = substr($OString, 0, strpos($OString, '>') + 1);\r\n\t\t\t\t$closing_tag = substr($OString, ReTidy::strpos_last($OString, '<'));\r\n\t\t\t\t$code_to_clean = substr($OString, strlen($opening_tag), strlen($OString) - strlen($opening_tag) - strlen($closing_tag));\r\n\t\t\t\t$needs_to_be_cleaned = false;\r\n\t\t\t\tforeach($array_tags as $tagName2) {\r\n\t\t\t\t\tif(strpos($code_to_clean, '<' . $tagName2) !== false) {\r\n\t\t\t\t\t\t$needs_to_be_cleaned = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif($needs_to_be_cleaned) {\r\n\t\t\t\t\t$offset = $OStrings[$counter][1];\r\n\t\t\t\t\t$code_to_clean = preg_replace('/<(' . $tagNamesString . ')[^<>]*?>/is', '', $code_to_clean);\r\n\t\t\t\t\t$code_to_clean = preg_replace('/<\\/(' . $tagNamesString . ')>/is', '', $code_to_clean);\r\n\t\t\t\t\t$new_OString = $opening_tag . $code_to_clean . $closing_tag;\r\n\t\t\t\t\t$this->code = substr($this->code, 0, $offset) . $new_OString . substr($this->code, $offset + strlen($OString));\r\n\t\t\t\t\t$ct_redundant_acro += 1;\r\n\t\t\t\t}\r\n\t\t\t\t$counter--;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->logMsgIf(\"redundant acronyms applications removed\", $ct_redundant_acro);\r\n\t}", "public function getTag($name, $type, $namespace = 'sulu');", "function catch_that_image() {\n global $post;\n\n $first_img = get_template_directory_uri() . '/img/svg/one.svg';\n\n $output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches);\n\n\tif(isset($matches[1][0])) {\n\t\t$first_img = $matches[1][0];\n\t}\n\n return $first_img;\n}", "function catch_that_image($post_content) {\r\n\t$first_img = '';\r\n\tob_start();\r\n\tob_end_clean();\r\n\t$output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post_content, $matches);\r\n\t$first_img = $matches [1] [0];\r\n\t//echo '<pre>';print_r($matches);echo '</pre>';\r\n\tif(empty($first_img)){ //Defines a default image\r\n\t\t$first_img = \"http://placehold.it/250x250\";\r\n\t}\r\n\treturn $first_img;\r\n}", "function parseHTML($url) {\n $html = getHTML($url);\n // php says this is some broken-ass html\n // attemtping to repair enough to make usable\n $dom = handleBrokenHTML($html);\n return simplexml_import_dom($dom);\n}", "public function tagsByType(string $type): StreamInterface\n {\n return $this->tags()->filter(function (SimpleXMLElement $e) use($type) { return $e['type'] == $type.'Tag'; });\n }", "function parse_content($node){\n $result = $node->xpath('//content'); // replace this with the XPath of the node\n if (!empty($result[0])) {\n // Optional replacements to convert custom XML tags to HTML equivalent\n $find_xml = array('section_title','section_content','section', 'texteparagraphe','titreparagraphe');\n $replace_html = array('h1','p','div','p','h2');\n $html = str_replace($find_xml, $replace_html, $result[0]->asXML());\n $node->addChild('content_html', $html);\n }\n return $node;\n}", "function getOpeningTags(string $str): array\n{\n $openingTags = [];\n $pattern = \"/<[A-Z]+[^>]*>/\";\n preg_match_all($pattern, $str, $openingTags);\n $result = [];\n foreach ($openingTags as $oT) {\n foreach ($oT as $o) {\n $result[] = $o;\n }\n }\n return $result;\n}", "public function getBodyTag() {}", "public function lnEleParse($ln) { /* Maybe rename this to lnEleGet() ? */\n if (array_key_exists($ln[0], $this->haml_ele_attribs_ar)) {\n return 'div';\n } elseif ($ln[0] === self::HAML_ELE) {\n $ln = self::lnRmFirstChar($ln);\n for ($i = 0, $len = strlen($ln); $i < $len; ++$i) {\n $ln_char = $ln[$i];\n if (array_key_exists($ln_char, $this->haml_ele_attribs_ar)) {\n return $ele = rtrim(substr_replace($ln, '', $i)); # When an id, class or whitespace is discovered...\n }\n }\n return $ln;\n }\n return FALSE;\n }", "public function getHTML(): string;", "private function extractCompositeTag()\n\t{\n\t\t// in this class as meaning \"composite page\"\n\t\t$pattern = \"/<\".self::$composite_tag.\"*.\\>/\";\n\t\t$result = ( (preg_match($pattern, $this->raw) == 1) ? true: false);\n\t\t\n\t\t// Now that we know we are dealing with a composite page,\n\t\t// we have 2 options on are hands:\n\t\t// a) page with <composite [options]>wikitext</composite>\n\t\t// b) page with <composite/> i.e. rest of the page is wikitext\n\n\t\tif ($result == true)\n\t\t{\n\t\t\t$pattern = \"/<\".self::$composite_tag.\"(?:.*)\\>(.*)(?:\\<.?\".self::$composite_tag.\">)/siU\";\n\t\t\tpreg_match($pattern,$this->raw,$m);\n\t\t\t$this->content = $m[1];\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "function oh_remove_type_attr($tag, $handle) {\n return preg_replace( \"/ type=['\\\"]text\\/(javascript|css)['\\\"]/\", '', $tag );\n}", "protected function scanTag()\n {\n return $this->scanInput('/^((?:[a-z][a-z0-9]*))/', 'tag');\n }", "private function field_html(int $type, string $field_name, string $additional_tags = '')\n {\n return $this->parse_safe_html($this->field($type, $field_name), $additional_tags);\n }", "function getContentByTags($url, $tag){\n $html = file_get_contents($url);\n $doc_ = new DOMDocument();\n libxml_use_internal_errors(TRUE);\n if(!empty($html)){\n \t$doc_->loadHTML($html);\n \tlibxml_clear_errors();\n $tagTxt = array();\n $arr = $doc_->getElementsByTagName(\"a\");\n foreach($arr as $item) {\n $text = trim(preg_replace(\"/[\\r\\n]+/\", \" \", $item->nodeValue));\n array_push($tagTxt, $text.\"\\n\");\n }\n return $tagTxt;\n }\n}", "function tidy_get_html(tidy $object) {}", "public function get_tag()\n {\n }", "function twig_first(Twig_Environment $env, $item)\n{\n $elements = twig_slice($env, $item, 0, 1, false);\n return is_string($elements) ? $elements[0] : current($elements);\n}", "function util_textContent($in_haystack, $in_tag)\r\n{\r\n\t$innerstring = util_innerString($in_haystack, \"<{$in_tag} \", \"</{$in_tag}>\", FALSE);\r\n\tif ($innerstring) {\r\n\t\treturn substr($innerstring, (strpos($innerstring, '>') + 1));\r\n\t} else {\r\n\t\treturn util_innerString($in_haystack, \"<{$in_tag}>\", \"</{$in_tag}>\", FALSE);\r\n\t}\r\n}", "public function getCanonical(): ?TagInterface;", "function article_html() {\n return parse(Registry::prop('article', 'html'), false);\n}", "function parseXmlTags($content, $tag_name)\n {\n $parsed_value=\"\";\n\n if (!empty($content) && !empty($tag_name))\n {\n preg_match_all(\"/<\".preg_quote($tag_name, \"/\").\">(.*?)<\\/\".preg_quote($tag_name, \"/\").\">/ims\", $content, $output_array, PREG_SET_ORDER);\n\n if (!empty($output_array[0][1]))\n {\n $parsed_value=trim($output_array[0][1]);\n }\n }\n\n return $parsed_value;\n }", "public function getHead($url)\n {\n $response = $this->get($url);\n\n $content = $response->getContent();\n $doc = $this->getDOMDocumentFromContent($content);\n $tags = $doc->getElementsByTagName('meta');\n\n $ogs = $this->extractOGTags($tags);\n\n return $ogs;\n }", "private function processContent(){\n\t\t$this->textEnd = strpos($this->raw,\"</{$this->tag}\");\n\t\t$this->text = trim(substr($this->raw, $this->textStart, $this->textEnd - $this->textStart));\n\t}", "function get_text_between_tags($string, $tagname){\r\n\t\t$d = new DOMDocument();\r\n\t\t@$d->loadHTML($string);\r\n\t\t$return = array();\r\n\t\tforeach($d->getElementsByTagName($tagname) as $item){\r\n\t\t\t\t$return[] = $item->textContent;\r\n\t\t}\r\n\t\treturn $return;\r\n}", "function tag_text($selector, $source = false)\r\n{ $t = tags_text($selector, $source);\r\n if ($t) $r = reset($t);\r\n else $r='';\r\n\r\n if (DEV)\r\n xlogc('tag_text', $r, $selector, $source);\r\n\r\n return $r;\r\n}", "function startTag($parser, $element, $attribute) {\r\n switch ($element) {\r\n case \"MAHASISWA\":echo \"<h3>Mahasiswa</h3>\";\r\n break;\r\n case \"NAMA\" : echo \"Nama : \";\r\n break;\r\n case \"ALAMAT\" : echo \"Alamat : \";\r\n break;\r\n }\r\n}", "function get_template($id, $type)\n{\n\t$query = \"SELECT template from users WHERE id='$id'\";\n\t$result = mysql_query($query) or die('Hiba a lekérdezésben: ' . mysql_error());\n\t$user = mysql_fetch_array($result, MYSQL_ASSOC);\n\tmysql_free_result($result);\n\t\n\t$less = explode(\"<post>\", $user['template']);\n\tif ($type == \"header\")\n\t\treturn $less[0];\n\telse\n\t{\n\t\t$less = explode(\"</post>\", $less[1]);\n\t\tif ($type == \"footer\")\n\t\t\t\treturn $less[1];\n\t\telse\n\t\t\treturn $less[0]; // post\n\t}\n}", "static function getElementContent(\\DOMDocument $dom, string $tag)\n {\n if (!is_object($dom->getElementsByTagName($tag)->item(0))) {\n return \"\";\n } else {\n return $dom->getElementsByTagName($tag)->item(0)->nodeValue;\n }\n }", "function readtag($xmltext) {\n \n\t $text = ltrim($xmltext); //left rrim\n\t \n\t $i = 1; //bypass \"<\"\n\t while ($text[$i]!='>') {\n\t $preout .= $text[$i];\n\t $i+=1;\n\t }\n\t \n\t $tagpart = explode(\" \",$preout); //split in case of tag attr\n\t \n\t return ($tagpart[0]); //roottag name \n }", "function get_content($url) {\n preg_match('/^([^?]+)(\\?path.*?)?(&content.*)?$/', $url, $matches);\n if (isset($matches[3])) {\n\t\tparse_str(substr($matches[3], 1), $content);\n\t} else {\n\t\t$content = '';\n\t}\n return $content['content'];\n}", "function displayTags($url) {\n\t\t\n\t\t$d = new DOMDocument;\n\t\t$d->loadHTMLFile($url);\n\t\t$body = $d->getElementsByTagName('body')->item(0);\n\t\t// perform innerhtml on $body by enumerating child nodes \n\t\t// and saving them individually\n\t\tforeach ($body->childNodes as $childNode) {\n \t\t\techo $d->saveHTML($childNode);\n\t\t}\n\t}", "function get_h1($file){\r\n $h1tags = preg_match_all(\"/(<h1.*>)(\\w.*)(<\\/h1>)/isxmU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "function get_p($file){\r\n $h1tags = preg_match_all(\"/(<p.*>)(\\w.*)(<\\/p>)/ismU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "function non_DOM_stripme($opening_tag_string) {\r\n\t\tpreg_match_all('/' . $opening_tag_string . '/is', $this->code, $matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\t//print(\"matches[0][size][0]: \");var_dump($matches[0][$size][0]);\r\n\t\t\tpreg_match('/<(\\w+)/is', $matches[0][$size][0], $tagname_matches);\r\n\t\t\t$tagname = $tagname_matches[1];\r\n\t\t\t$OString = OM::getOString($this->code, '<' . $tagname, '</' . $tagname . '>', $matches[0][$size][1]);\r\n\t\t\t//print(\"strlen(matches[0][size][0]): \");var_dump(strlen($matches[0][$size][0]));\r\n\t\t\t$substr = substr($OString, strlen($matches[0][$size][0]), strlen($OString) - strlen($matches[0][$size][0]) - (strlen($tagname) + 3));\r\n\t\t\t//print(\"OString: \");var_dump($OString);\r\n\t\t\t//print(\"substr: \");var_dump($substr);\r\n\t\t\t//$this->code = str_replace($OString, $substr, $this->code);\r\n\t\t\t$this->code = substr($this->code, 0, $matches[0][$size][1]) . $substr . substr($this->code, $matches[0][$size][1] + strlen($OString));\r\n\t\t\t$size--;\r\n\t\t}\r\n\t}" ]
[ "0.57939667", "0.55841506", "0.55683213", "0.5513134", "0.54844743", "0.5480904", "0.54522043", "0.54499936", "0.544259", "0.54399985", "0.53832686", "0.53832686", "0.5365185", "0.53619105", "0.5337303", "0.53188205", "0.52399427", "0.5226218", "0.5213006", "0.51754427", "0.5163383", "0.5145726", "0.5115504", "0.51059777", "0.50712645", "0.5064754", "0.50141895", "0.50114775", "0.5008822", "0.49988467", "0.49979812", "0.4985597", "0.49809992", "0.4980366", "0.49698332", "0.49489808", "0.49427998", "0.493655", "0.493655", "0.49361014", "0.49355596", "0.49254012", "0.49236777", "0.49208605", "0.49188298", "0.49114433", "0.4906783", "0.48915502", "0.48848438", "0.48787963", "0.4878687", "0.48727116", "0.48647162", "0.48638272", "0.4858753", "0.48551354", "0.48474687", "0.48432523", "0.48432523", "0.4832875", "0.48298046", "0.48219824", "0.4817985", "0.48100924", "0.48022187", "0.4801337", "0.47999722", "0.47972238", "0.47805423", "0.4759878", "0.47540662", "0.4752988", "0.474365", "0.4742146", "0.47402722", "0.47233117", "0.47219333", "0.47172257", "0.47144622", "0.47134638", "0.47087118", "0.47035867", "0.46951148", "0.46940315", "0.46921957", "0.46915343", "0.46913132", "0.46886098", "0.46881932", "0.46853575", "0.46839648", "0.46738777", "0.46696478", "0.4669378", "0.46642828", "0.4663271", "0.46627113", "0.4662069", "0.46546176", "0.4653612" ]
0.48781708
51
Extract the first tag object of given type from HTML
public static function extractTag(string $tag, mixed $mixed): HTMLTag { $result = self::extractTags($tag, $mixed, false); if (count($result) === 0) { throw new NotFoundException('No tag {tag}', ['tag' => $tag]); } $htmlTag = array_shift($result); return $htmlTag; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_tag( $attr, $value, $html ) {\r\n\t\t\r\n\t\t\t$attr = preg_quote($attr);\r\n\t\t\t$value = preg_quote($value);\r\n\t\t \r\n\t\t\t//scan the dom for a fully matching div tag\r\n\t\t\t$tag_regex = '/<div[^>]*'.$attr.'=\"'.$value.'\">(.*?)<\\\\/div>/si';\r\n\t\t\r\n\t\t\t//return first match\r\n\t\t\tpreg_match($tag_regex,\r\n\t\t\t$html,\r\n\t\t\t$matches);\r\n\t\t\treturn $matches[1];\r\n\t\t}", "abstract public function getTag($tagName);", "public function getTag($tagName);", "function extract_tag( $html, $tag = 'div' )\n\t{\n\t\t$html = preg_replace( \"/(\\<\" . $tag . \")(.*?)(\" . $tag . \">)/si\", \"dada\", \"$html\" );\n\t\t$html = strip_tags( $html );\n\t\t$html = str_replace( \"<!--\", \"&lt;!--\", $html );\n\t\t$html = preg_replace( \"/(\\<)(.*?)(--\\>)/mi\", \"\" . nl2br( \"\\\\2\" ) . \"\", $html );\n\n\t\treturn $html;\n\t}", "public function getContentType(): ?TagInterface;", "function parse ($html) {\n // TODO fix by shijp : 临时方案\n if (is_array($html)) {\n return $html;\n }\n\n // If there are no HTML tags, ignore it\n if (false === strpos($html, '<'))\n return $html;\n if (! preg_match(\"/<(?=[a-zA-Z\\/])/\", $html))\n return $html;\n\n $this->clear();\n return parent::parse($html);\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 getTagName();", "public function getTag();", "public function getTag();", "public function getTagName() {}", "public function parse($html);", "public function parse($html);", "function extract_from_hyperlink($str, $type = 'id') {\n $result = '';\n\n $type = strtolower($type);\n $target = ($type === 'label' ? 2 : 1);\n\n $pattern = '#=HYPERLINK\\(\"([^\"]+)\",\"([^\"]+)\"\\)#';\n $matches = array();\n\n if(preg_match($pattern, $str, $matches)) {\n $result = $matches[$target];\n\n // additional processing required for IDs\n if ($target === 1) {\n $result = substr(strrchr($result, '/'), 1);\n }\n }\n\n return $result;\n}", "public function getFirstTagNameDataProvider() {}", "function tidy_get_html(tidy $object) {}", "public function getFirstChildByType($type)\n {\n foreach ($this->children as $child) {\n if ($child->getType() === $type) {\n return $child;\n }\n }\n return false;\n }", "public function getFirstTagDataProvider() {}", "public static function lorPageElement();", "public function getFirstTagContent($tag, $input, $save = false) {\n $start = strpos($input, '<' . $tag . '>') + strlen($tag) + 2;\n\n // If the tag has attributes, remove them, for the end tag won't contain them\n if (strpos($tag, ' ') > 0) {\n $tag = substr($tag, 0, strpos($tag, ' '));\n }\n\n $end = strpos($input, '</' . $tag . '>') - $start;\n if ($end <= 0) {\n return '';\n }\n\n if ($save) {\n return trim(\n str_replace('--lt--', '<',\n str_replace('--gt--', '>', substr($input, $start, $end))\n )\n );\n }\n\n return trim(substr($input, $start, $end));\n }", "function getTOCFromTag($html)\n {\n // TODO Getting allways the first one, investigate why sometimes have more.\n $tocs = [];\n $toc = '';\n if (preg_match(\"/_Toc[0-9]*/i\", $html, $tocs)) {\n $toc = current($tocs);\n }\n return $toc;\n }", "function getFirstFuelType($dom) {\n $motor_table = $dom->find(\"table.listafichatecnica\", 0);\n $a_fuel = array();\n $fuel_row = $motor_table->find(\"tbody tr\", 3);\n $a_details = array();\n\n $type = trim($fuel_row->find(\"td\", 1)->plaintext);\n //print $type . \"\\n\";\n return $type;\n}", "function getFirstFuelType($dom) {\n $motor_table = $dom->find(\"table.listafichatecnica\", 0);\n $a_fuel = array();\n $fuel_row = $motor_table->find(\"tbody tr\", 3);\n $a_details = array();\n\n $type = trim($fuel_row->find(\"td\", 1)->plaintext);\n //print $type . \"\\n\";\n return $type;\n}", "public function getCanonical(): ?TagInterface;", "public function find($tag);", "protected function extractImageFromHTML($text, $type=''){\n if(!class_exists('DOMDocument') ){\n return;\n }\n $html = new DOMDocument();\n $html->recover = true;\n $html->strictErrorChecking = false;\n $html->loadHTML($text);\n $images = array();\n foreach($html->getElementsByTagName('img') as $image) {\n $imgSrc = preg_match('/http/', $image->getAttribute('src'))? $image->getAttribute('src') : JURI::root().$image->getAttribute('src');\n $images[] = array(\n 'src' => $imgSrc,\n 'class' => $image->getAttribute('class'),\n 'type' => $type\n );\n }\n return $images;\n }", "public function getTag($name, $type, $namespace = 'sulu');", "public function get_tag()\n {\n }", "function parseHtml($s_str)\r\n{\r\n$i_indicatorL = 0;\r\n$i_indicatorR = 0;\r\n$s_tagOption = \"\";\r\n$i_arrayCounter = 0;\r\n$a_html = array();\r\n// Search for a tag in string\r\nwhile( is_int(($i_indicatorL=strpos($s_str,\"<\",$i_indicatorR))) ) {\r\n// Get everything into tag...\r\n$i_indicatorL++;\r\n$i_indicatorR = strpos($s_str,\">\", $i_indicatorL);\r\n$s_temp = substr($s_str, $i_indicatorL, ($i_indicatorR-$i_indicatorL) );\r\n$a_tag = explode( ' ', $s_temp );\r\n// Here we get the tag's name\r\nlist( ,$s_tagName,, ) = each($a_tag);\r\n$s_tagName = strtoupper($s_tagName);\r\n// Well, I am not interesting in <br>, </font> or anything else like that...\r\n// So, this is false for tags without options.\r\n$b_boolOptions = is_array(($s_tagOption=each($a_tag))) && $s_tagOption[1];\r\nif( $b_boolOptions ) {\r\n// Without this, we will mess up the array\r\n$i_arrayCounter = (int)count($a_html[$s_tagName]);\r\n// get the tag options, like src=\"htt://\". Here, s_tagTokOption is 'src'and s_tagTokValue is '\"http://\"'\r\n\r\ndo {\r\n$s_tagTokOption = strtoupper(strtok($s_tagOption[1], \"=\"));\r\n$s_tagTokValue = trim(strtok(\"=\"));\r\n$a_html[$s_tagName][$i_arrayCounter][$s_tagTokOption] =\r\n$s_tagTokValue;\r\n$b_boolOptions = is_array(($s_tagOption=each($a_tag))) &&\r\n$s_tagOption[1];\r\n} while( $b_boolOptions );\r\n}\r\n}\r\nreturn $a_html;\r\n}", "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 }", "public abstract function get_html();", "private function getFirstWithinAsset($asset, $type) {\n\t\t$widgetArray = $this->getAllWithinAsset($type,$asset,1);\n\t\tif(count($widgetArray)>0) {\n\t\t\tforeach($widgetArray as $widget) {\n\t\t\t\tif(!$widget->getDisplay()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach($widget->fieldContentsArray as $fieldContents) {\n\t\t\t\t\t\n\t\t\t\t\treturn $fieldContents;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn FALSE;\n\n\t}", "abstract function getAsElem($dom);", "function twig_first(Twig_Environment $env, $item)\n{\n $elements = twig_slice($env, $item, 0, 1, false);\n return is_string($elements) ? $elements[0] : current($elements);\n}", "public function extractContent()\n {\n $metas = $this->parsedDOM->getElementsByTagName('meta');\n\n // If exists meta-description, uses it\n foreach ($metas as $meta)\n {\n // Loops the list of attributes\n foreach ($meta->attributes as $attribute)\n {\n\n // Checks if the page is OG Compliant\n if ($attribute->name == 'name'\n && $attribute->value == 'og:description'\n && $meta->attributes->getNamedItem('content')->value !== ''\n ) {\n // Returns the og:description\n return trim($meta->attributes->getNamedItem('content')->value);\n }\n\n // looks for the description meta tag\n if ($attribute->name == 'name'\n && $attribute->value == 'description'\n && $meta->attributes->getNamedItem('content')->value !== ''\n ) {\n return trim($meta->attributes->getNamedItem('content')->value);\n }\n }\n }\n\n $article = $this->parsedDOM->getElementsByTagName('article')->item(0);\n\n if ($article !== null ) {\n // Search the first paragraph inside the article\n $paragraph = $article->firstChild->nodeValue;\n return trim($paragraph);\n\n }\n\n $paragraph = $this\n ->parsedDOM\n ->getElementsByTagName('p')\n ->item(0);\n\n if ($paragraph !== null) {\n return trim($paragraph);\n }\n\n return trim($this\n ->parsedDOM\n ->getElementsByTagName('body')\n ->item(0)\n ->nodeValue);\n }", "function getName($str){\n $value = preg_match_all('/<span itemprop=\\\"name\\\" class=\\\"vis\\\">(.*?)<\\/span>/s',$str, $names);\n $name = $names[0][0];\n $name = strip_tags($name);\n\n return $name;\n}", "public function getFirst($type = 'article'){\n\t\t$this -> db -> select('*');\n\t\t$this -> db -> where('type', $type);\n\t\t$this -> db -> order_by('id');\n\t\t$result = $this -> db -> get($this -> tableName, 1) -> row_array();\n\n\t\treturn $result;\n\t}", "abstract function get_html();", "function GetTagName();", "public function getNextHref(): ?TagInterface;", "abstract protected function getTag() : Tag;", "public function getDOM($type)\n {\n $variable = $type . 'DOM';\n if (isset($this->$variable)) {\n return $this->$variable;\n }\n throw new OpenDocument_Exception('No DOM for ' . $type);\n }", "public function lnEleParse($ln) { /* Maybe rename this to lnEleGet() ? */\n if (array_key_exists($ln[0], $this->haml_ele_attribs_ar)) {\n return 'div';\n } elseif ($ln[0] === self::HAML_ELE) {\n $ln = self::lnRmFirstChar($ln);\n for ($i = 0, $len = strlen($ln); $i < $len; ++$i) {\n $ln_char = $ln[$i];\n if (array_key_exists($ln_char, $this->haml_ele_attribs_ar)) {\n return $ele = rtrim(substr_replace($ln, '', $i)); # When an id, class or whitespace is discovered...\n }\n }\n return $ln;\n }\n return FALSE;\n }", "public function getTagClass($name);", "public function get_tag_content($tag_to_grab, $input, $replace_html = true) {\n $tag_content = preg_split(\"/\\<$tag_to_grab\\>/i\", $input, 0);\n if (strpos($tag_to_grab, ' ') > 0) {\n $tag_to_grab = substr($tag_to_grab, 0, strpos($tag_to_grab, ' '));\n }\n\n $tag_content = preg_split(\"/\\<\\/$tag_to_grab\\>/i\", $tag_content[1], 0);\n\n if ($replace_html) {\n $tag_content[0] = str_replace('--lt--', '<', $tag_content[0]);\n $tag_content[0] = str_replace('--gt--', '>', $tag_content[0]);\n }\n\n return $tag_content[0];\n }", "function extractText($array){\n\tif(count($array) <= 1){\n\t\t//we only have one tag to process!\n\t\t$value = \"\";\n\t\tfor ($i = 0; $i<count($array); $i++){\n\t\t\t$node = $array[$i];\n\t\t\t$value = $node->get_content();\n\t\t}\n\t\treturn $value;\n\t} \n}", "function fett_process_html_tag(&$vars) {\n if (theme_get_setting('fett_html_tags')) {\n $el = &$vars['element'];\n\n // Remove type=\"...\" and CDATA prefix/suffix.\n unset($el['#attributes']['type'], $el['#value_prefix'], $el['#value_suffix']);\n\n // Remove media=\"all\" but leave others unaffected.\n if (isset($el['#attributes']['media']) && $el['#attributes']['media'] === 'all') {\n unset($el['#attributes']['media']);\n }\n }\n}", "public function getTagName ()\n\t{\n\t\treturn 'html';\n\t}", "public function getTag(string $name): ?TagInterface;", "public function getTag($tagName)\n\t{\n\t\t$tagName = (string)$tagName;\n\n\t\tif ( $this->hasTag($tagName) ) {\n\t\t\treturn $this->tags[ $tagName ];\n\t\t}\n\t}", "function extract_html_tag($line) {\n if (preg_match(self::REGEX_CODE, $line)) {\n return preg_replace(self::REGEX_CODE, '\\1', $line);\n }\n }", "function l1NodeCategory($x) {\n global $dom;\n $root = $dom->documentElement;\n $children = $root->childNodes;\n\n $node = $children->item($x);\n $nodeName = $node->nodeName;\n\n switch($nodeName) {\n case p:\n $category = \"pOrBlockquote\";\n break;\n case blockquote:\n $category = \"pOrBlockquote\";\n break;\n case h2:\n $category = \"h\";\n break;\n case h3:\n $category = \"h\";\n break;\n case h4:\n $category = \"h\";\n break;\n case h5:\n $category = \"h\";\n break;\n case pre:\n $category = \"pre\";\n break;\n case hr:\n $category = \"hr\";\n break;\n case table:\n $category = \"table\";\n break;\n case ol:\n $category = \"list\";\n break;\n case ul:\n $category = \"list\";\n break;\n case div:\n // If the first grandchild's nodeName is img then $category is image.\n if ($node->hasChildNodes()) {\n $grandChildren = $node->childNodes;\n $firstGChild = $grandChildren->item(0);\n $fGCNodeName = $firstGChild->nodeName;\n if ($fGCNodeName == \"img\") {\n $category = \"image\";\n break;\n }\n }\n // If there is a class attribute whose value is remarkbox then\n // $category is remark.\n $classAtt = $node->getAttribute(\"class\");\n if ($classAtt == \"remarkbox\") {\n $category = \"remark\";\n break;\n }\n form_destroy();\n die('The div is weird. Err 5187854. -Programmer.');\n default:\n form_destroy();\n die('Node category undefined. Err 6644297. -Programmer.');\n }\n\n return $category;\n}", "public function 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; }", "function get($id) {\n foreach ($this->body as $node) {\n if ($node instanceof Type) {\n if ($node->getID() == $id) {\n return $node;\n }\n }\n }\n }", "function parse_tag($data) {\n if (is_object($data)) {\n if (isset($data->id)) {\n $tag->id = $data->id;\n }\n $tag->name = $data->name;\n $tag->value = $data->value;\n $tag->ticketid = $data->ticketid;\n return $tag;\n } elseif (is_array($data)) {\n if ($data['id']) {\n $tag->id = $data->id;\n }\n $tag->name = $data['name'];\n $tag->value = $data['value'];\n $tag->ticketid = $data['ticketid'];\n return $tag;\n } else {\n return false;\n }\n }", "public function getFirstChild();", "private function parsePerson( $element, DOMElement $xml, $type )\n {\n foreach ( $xml->childNodes as $itemChild )\n {\n if ( $itemChild->nodeType === XML_ELEMENT_NODE )\n {\n $tagName = $itemChild->tagName;\n\n switch ( $tagName )\n {\n case 'name':\n case 'email':\n case 'uri':\n $element->$tagName = $itemChild->textContent;\n break;\n }\n }\n }\n }", "function startTag($parser, $element, $attribute) {\r\n switch ($element) {\r\n case \"MAHASISWA\":echo \"<h3>Mahasiswa</h3>\";\r\n break;\r\n case \"NAMA\" : echo \"Nama : \";\r\n break;\r\n case \"ALAMAT\" : echo \"Alamat : \";\r\n break;\r\n }\r\n}", "public function getBodyTag() {}", "function lesson_importppt_isolate_class($string) {\n if($class = strstr($string, 'class=')) { // first step in isolating the class\n $class = substr($class, strpos($class, '=')+1); // this gets rid of <div blawblaw class= there are no \"\" or '' around the class name ...sigh...\n if (strstr($class, ' ')) {\n // spaces found, so cut off everything off after the first space\n return substr($class, 0, strpos($class, ' '));\n } else {\n // no spaces so nothing else in the div tag, cut off the >\n return substr($class, 0, strpos($class, '>'));\n }\n } else {\n // no class defined in the tag\n return '';\n }\n}", "function lessie_process_html_tag(&$vars) {\r\n $el = &$vars['element'];\r\n\r\n // Remove type=\"...\" and CDATA prefix/suffix.\r\n unset($el['#attributes']['type'], $el['#value_prefix'], $el['#value_suffix']);\r\n\r\n // Remove media=\"all\" but leave others unaffected.\r\n if (isset($el['#attributes']['media']) && $el['#attributes']['media'] === 'all') {\r\n unset($el['#attributes']['media']);\r\n }\r\n}", "function everything_in_tags($string, $tagname)\n{\n $pattern = \"#<\\s*?$tagname\\b[^>]*>(.*?)</$tagname\\b[^>]*>#s\";\n preg_match($pattern, $string, $matches);\n return $matches[1];\n}", "static function getElementContent(\\DOMDocument $dom, string $tag)\n {\n if (!is_object($dom->getElementsByTagName($tag)->item(0))) {\n return \"\";\n } else {\n return $dom->getElementsByTagName($tag)->item(0)->nodeValue;\n }\n }", "private function parseElementName($html)\n {\n $elementMatchSuccessful = preg_match(\n \"/(<([\\/]?)(([a-z0-9\\-]+:)?[a-z0-9\\-]+))/i\",\n //\"/(<(([a-z0-9\\-]+:)?[a-z0-9\\-]+))/i\",\n $html,\n $elementMatches\n );\n if ($elementMatchSuccessful !== 1) {\n if ($this->getThrowOnError()) {\n throw new TokenizerException('Invalid element name.');\n }\n\n return null;\n }\n if (!empty($elementMatches[2])) {\n $this->isClosing = true;\n return ''; \n }\n return mb_strtolower($elementMatches[3]);\n }", "private function parseContents($html)\n {\n if (ltrim($html) == '') {\n return '';\n }\n \n /* do we really have tags to omit parsing for?!?\n // Don't parse contents of \"iframe\" element.\n if ($this->name == 'iframe') {\n return $this->parseNoContents('iframe', $html);\n }\n\n // Only TEXT inside a \"script\" element.\n if ($this->name == 'script') {\n return $this->parseForeignContents('script', $html);\n }\n\n // Only TEXT inside a \"style\" element.\n if ($this->name == 'style') {\n return $this->parseForeignContents('style', $html);\n }\n */\n \n // Parse contents one token at a time.\n $remainingHtml = $html;\n while (preg_match(\"/^\\s*<\\/\\s*\".$this->name.\"\\s*>/is\", $remainingHtml) === 0) {\n $token = TokenFactory::buildFromHtml(\n $remainingHtml,\n $this,\n //false \n $this->getThrowOnError()\n );\n\n if ($token === false || $token->isClosingElementImplied($remainingHtml)) {\n return $remainingHtml;\n }\n \n if (!is_array($this->children)) {\n $this->children = array();\n }\n $remainingHtml = $token->parse($remainingHtml);\n $this->children[] = $token;\n }\n\n // Remove last token if contains only whitespace.\n if (!empty($this->children)) {\n $lastChildArray = array_slice($this->children, -1);\n $lastChild = array_pop($lastChildArray);\n if ($lastChild->isText() && trim($lastChild->getValue()) == '') {\n array_pop($this->children);\n }\n }\n\n // Remove remaining closing tag.\n $posOfClosingBracket = mb_strpos($remainingHtml, '>');\n\n return mb_substr($remainingHtml, $posOfClosingBracket + 1);\n }", "function aggregator_element_start($parser, $name, $attributes) {\n global $item, $element, $tag;\n\n switch ($name) {\n case 'IMAGE':\n case 'TEXTINPUT':\n $element = $name;\n break;\n case 'ITEM':\n $element = $name;\n $item += 1;\n }\n\n $tag = $name;\n}", "public function newElement($type) {\n\t\treturn new Html($type);\n\t}", "function parseXmlElement($tag)\n { \n $temp = $this->simplexmlObject->xpath($tag);\n $output = (string)$temp[0];\n return $output;\n }", "abstract protected function getObjectTag();", "function oh_remove_type_attr($tag, $handle) {\n return preg_replace( \"/ type=['\\\"]text\\/(javascript|css)['\\\"]/\", '', $tag );\n}", "public function getNextTag($dump_type = 0 /*myFlvHandler::GET_NEXT_TAG_META*/)\n\t{\n\t\t$start_pos = $this->pos;\n\t\t$data = @fread($this->fh, 12);\n\t\tif (!strlen($data))\n\t\t\treturn null;\n\t\t\t\n\t\t$temp_data = $data[0].\"\\0\".substr($data,1, 3).$data[7].substr($data,4, 3).$data[11];\n\t\t\n\t\t$res = unpack(\"Ca/Nb/Nc/Cd\", $temp_data);\n\t\t$size = $res['b'] + self::TAG_WRAPPER_SIZE;\n\t\t\n\t\t$this->pos += $size;\n\t\t\n\t\tif ($dump_type == myFlvHandler::GET_NEXT_TAG_META)\n\t\t\t$data = null;\n\t\telse\n\t\t{\n\t\t\t$data = $data.fread($this->fh, $size - 12);\n\t\t\n\t\t\tif ($dump_type == myFlvHandler::GET_NEXT_TAG_DATA) // return actual tag\n\t\t\t\treturn $data;\n\t\t}\n\t\t\n\t\tfseek($this->fh, $this->pos, SEEK_SET);\n\t\t\n\t\t// type, size, timestamp, keyframe, start_pos, [data]\n\t\treturn array($res['a'], $size, $res['c'], ($res['d'] & 0xF0) == 0x10, $start_pos, $data);\n\t}", "function sloodle_extract_first_image_url($html) {\n if (preg_match(\"/<img .*?(?=src)src=\\\"([^\\\"]+)\\\"/si\", $html, $m)) {\n \treturn $m[1];\n }\n return '';\n }", "public function first(): ?\\StructType\\EwsBodyContentAttributedValueType\n {\n return parent::first();\n }", "function getTag($tag)\n {\n //print \"getting tag\\n\";\n return $this->_tagDTD->toTagStr($tag);\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 getTag(): string|null;", "public static function getBbTagType();", "function get_first_paragraph($_id_post){\n\t\n\t$post = get_post($_id_post);\n\n\t$text = $post->post_content;\n\n\t$start = strpos($text, '<p>'); // Locate the first paragraph tag\n\t$end = strpos($text, '</p>', $start); // Locate the first paragraph closing tag\n\t$text = substr($text, $start, $end-$start+4); // Trim off everything after the closing paragraph tag\n\t$text = strip_shortcodes( $text ); // Remove shortcodes\n\t$text = apply_filters('the_content', $text); // remove tag html by wp\n\t$text = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $text);\t // Remove tag script\n\t$text = wpautop( $text );\t// Remove break\n\t$text = strip_tags($text);\t// Remove tags html\n\n\treturn $text ;\n\t \n}", "protected function scanTag()\n {\n return $this->scanInput('/^((?:[a-z][a-z0-9]*))/', 'tag');\n }", "function gwt_drupal_process_html_tag(&$variables) {\n $tag = &$variables['element'];\n\n if ($tag['#tag'] == 'style' || $tag['#tag'] == 'script') {\n // Remove redundant type attribute and CDATA comments.\n unset($tag['#attributes']['type'], $tag['#value_prefix'], $tag['#value_suffix']);\n\n // Remove media=\"all\" but leave others unaffected.\n if (isset($tag['#attributes']['media']) && $tag['#attributes']['media'] === 'all') {\n unset($tag['#attributes']['media']);\n }\n }\n}", "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}", "function getFirstElement($array){\n\n /*\n * convert object to array first\n */\n\n if(is_object($array)){\n $array = (array) $array;\n }\n\n\n /*\n * check if this array is\n * php array\n */\n\n if(is_array($array)){\n return getElement($array);\n }\n\n /*\n * if json array\n * check if json is valid\n * and decode the array\n */\n\n $array = jsonDecode($array);\n\n /*\n * return with the first element\n */\n\n return getElement($array);\n\n}", "public static function get_first_type_match_for_doc($doc, $doc_type = \"wp\") {\r\n\t\t$types = self::get_all_types();\r\n\t\treturn self::_get_first_type_match_for_doc($doc, $types, $doc_type);\r\n\t}", "function tidy_get_head(tidy $object) {}", "public function forTagName($name) {\n\t\treturn Tag::where ( 'name', $name )->first ();\n\t}", "function catch_that_image() {\n global $post;\n\n $first_img = get_template_directory_uri() . '/img/svg/one.svg';\n\n $output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches);\n\n\tif(isset($matches[1][0])) {\n\t\t$first_img = $matches[1][0];\n\t}\n\n return $first_img;\n}", "static protected function _extractTagContents($tag, $data)\n\t{\n\t\t$tag = trim($tag, '<> ');\n\t\t\n\t\tif (false !== strpos($data, '<' . $tag . '>') and \n\t\t\tfalse !== strpos($data, '</' . $tag . '>'))\n\t\t{\n\t\t\t$data = strstr($data, '<' . $tag . '>');\n\t\t\t$end = strpos($data, '</' . $tag . '>');\n\t\t\t\n\t\t\treturn substr($data, strlen($tag) + 2, $end - (strlen($tag) + 2));\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public function getFirst(): LinkInterface;", "public function first () { return new XDTNodeList($this[0]); }", "public function findRelatedElement($type = null)\n {\n $model = $this->model;\n\n // invalid call\n if ($model->bootstrap_parentId == '' && !$this->isTypeOf(static::TYPE_START)) {\n return null;\n }\n\n $options = array(\n 'order' => 'sorting'\n );\n\n if ($type === null) {\n $column = 'bootstrap_parentId';\n $values[] = $model->id;\n } else {\n $column = array('bootstrap_parentId=? ', 'type=?');\n $values[] = $model->id;\n $values[] = $this->getTypeName($type);\n }\n\n return \\ContentModel::findOneBy($column, $values, $options);\n }", "function parse($data = \"\") {\n // bold, italic, h2 (Название)\n $data = preg_replace(\"/<span class=rvts78>(.+?)\\s?<\\/span>/i\",\"##**_$1_**\",$data);\n // bold. h3 (коротко)\n $data = preg_replace(\"/<span class=rvts23>(.+?)\\s?<\\/span>/i\",\"###**$1**\",$data);\n // bold (Статья)\n $data = preg_replace(\"/<span class=rvts(?:9|44)>(.+?)\\s?<\\/span>/i\",\"**$1**\",$data);\n // bold h4 (Раздел)\n $data = preg_replace(\"/<span class=rvts15>(.+?)\\s?<\\/span>/i\",\"####**$1**\",$data);\n\n $container = $data;\n\n $container = strip_tags($container);\n $container = preg_replace(\"/&nbsp;/s\",\" \",$container);\n $container = preg_replace(\"/(\\r\\n|\\n|\\r)+/s\",\"\\n\\n\",$container);\n return trim($container);\n}", "public function extractTitle()\n {\n $title = $this->parsedDOM->getElementsByTagName('title')->item(0);\n\n if (\n $title !== null\n && $title->nodeValue !== ''\n ) {\n return $title->nodeValue;\n } else {\n return\n $this\n ->parsedDOM\n ->getElementsByTagName('h1')\n ->item(0)\n ->nodeValue;\n }\n }", "public function getTag()\n {\n }", "function catchFirstImage()\n{\n global $post, $posts;\n $first_img = '';\n ob_start();\n ob_end_clean();\n $output = preg_match_all(\n '/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i',\n $post->post_content,\n $matches\n );\n $first_img = $matches[1][0];\n if (empty($first_img)) {\n $first_img = get_template_directory_uri() . '/img/noimage.png';\n }\n return $first_img;\n}", "public function getHtml_tag()\n\t{\n\t\treturn $this->html_tag;\n\t}", "function findCode( $html ) {\n $code = '';\n\n foreach ( $html->find( 'main iframe, main script, main object, main form' ) as $element ) {\n $code .= '<tr>';\n $code .= '<td>' . $element->tag . '</td>';\n $code .= '<td><code>' . htmlspecialchars( $element ) . '</code></td>';\n $code .= '</tr>';\n }\n\n return $code;\n}" ]
[ "0.5731173", "0.55962056", "0.5541299", "0.55411303", "0.54740983", "0.5439", "0.5388184", "0.5387688", "0.53454155", "0.53454155", "0.5306569", "0.5258658", "0.5258658", "0.52158713", "0.5215122", "0.5185534", "0.5163457", "0.51577264", "0.51574975", "0.51552755", "0.5143431", "0.51160103", "0.51160103", "0.5102248", "0.51019603", "0.5095028", "0.50847", "0.5081558", "0.50571615", "0.50316143", "0.50258553", "0.501464", "0.4997234", "0.49855977", "0.49809185", "0.4980471", "0.49725816", "0.4968707", "0.49674973", "0.49582553", "0.49556446", "0.4950502", "0.4938004", "0.49273863", "0.49141014", "0.49116647", "0.4897251", "0.48933163", "0.48905954", "0.4881282", "0.48804507", "0.48771024", "0.4874433", "0.4874433", "0.4874433", "0.4874433", "0.4874433", "0.48673275", "0.48605502", "0.48590007", "0.48469177", "0.48468164", "0.48461655", "0.4829318", "0.48276362", "0.48268732", "0.48252225", "0.48179612", "0.48028308", "0.47982353", "0.47956863", "0.478529", "0.47778058", "0.47765628", "0.47631866", "0.47623053", "0.47515327", "0.47495198", "0.4749497", "0.47391817", "0.4739061", "0.47360474", "0.47272715", "0.4726703", "0.4723846", "0.47202018", "0.47200972", "0.47190425", "0.47172582", "0.47069472", "0.47057152", "0.4702033", "0.46995658", "0.46943077", "0.46923456", "0.46901584", "0.46862805", "0.46849728", "0.46776822", "0.4674429" ]
0.48350585
63
Given a string like: "bcd e f " goo="1423" e1231="agerd" Generates the following map x = array(); x["a"] = "bcd e f" x("goo"] = "1423" x["e1232"] = "agerd" If `$mixed` is already an array, just returns as is
public static function parseAttributes(array|string $mixed): array { if (is_array($mixed)) { return $mixed; } if ($mixed === '') { return []; } $mixed = trim($mixed); if (empty($mixed)) { return []; } $matches = []; $mixed .= ' '; $attr = []; if (preg_match_all('/([a-zA-Z_:][-a-zA-Z0-9_:.]*)\s*=\s*(\'[^\']*\'|\"[^\"]*\"|[^\'\"]+)\s/', $mixed, $matches, PREG_SET_ORDER)) { $search = []; $replace = []; foreach ($matches as $match) { $search[] = $match[0]; $replace[] = ''; $attr[strtolower($match[1])] = StringTools::unquote($match[2]); } $mixed = str_replace($search, $replace, $mixed); } $mixed = trim(preg_replace('/\s+/', ' ', $mixed)); if (strlen($mixed) > 0) { $singles = explode(' ', $mixed); foreach ($singles as $single) { $attr[strtolower($single)] = true; } } return $attr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function string_to_value($mixed)\n{\n\tif(is_array($mixed)) {\n\t\tforeach($mixed as $key => $val) {\n\t\t\t$mixed[$key] = string_to_value($val);\n\t\t}\n\t}\n\telseif(is_string($mixed))\n\t{\n\t\t$str = rtrim($mixed);\n\t\tif(preg_match('`^null$`i', $str))\t\t\treturn null;\n\t\tif(preg_match('`^true$`i', $str))\t\t\treturn true;\n\t\tif(preg_match('`^false$`i', $str))\t\t\treturn false;\n\t\tif(preg_match('`^\\d+$`', $str))\t\t\t\treturn intval($str);\n\t\tif(preg_match('`^\\d+\\.\\d+$`', $str))\t\treturn floatval($str);\n\t\telse return $str;\n\t}\n\treturn $mixed;\n}", "public function map($mixed = null) {\n\t\tif (is_array($mixed)) {\n\t\t\t$result = array();\n\t\t\tforeach ($mixed as $_mixed) {\n\t\t\t\tif ($_result = $this->map($_mixed)) {\n\t\t\t\t\t$result[$_mixed] = $_result;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tif (is_string($mixed)) {\n\t\t\tif (strlen($mixed) === 2 && in_array($mixed, $this->_l10nMap)) {\n\t\t\t\treturn array_search($mixed, $this->_l10nMap);\n\t\t\t}\n\t\t\tif (isset($this->_l10nMap[$mixed])) {\n\t\t\t\treturn $this->_l10nMap[$mixed];\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->_l10nMap;\n\t}", "function fusion_string_to_array( $string ) {\n\n\t// If already an array, return early.\n\tif ( is_array( $string ) ) {\n\t\treturn $string;\n\t}\n\n\t$string = stripslashes( $string );\n\n\tif ( empty( $string ) ) {\n\t\treturn false;\n\t}\n\n\t$result = [];\n\t$pairs = explode( '&', $string );\n\n\tforeach ( $pairs as $key => $pair ) {\n\t\t// Use the original parse_str() on each element.\n\t\tparse_str( $pair, $params );\n\n\t\t$k = key( $params );\n\n\t\tif ( ! isset( $result[ $k ] ) ) {\n\t\t\t$result += $params;\n\t\t} else {\n\t\t\t$result[ $k ] = fusion_array_merge_recursive( $result[ $k ], $params[ $k ] );\n\t\t}\n\t}\n\n\treturn $result;\n}", "private function decode( $mixed = null )\n {\n if(get_class($mixed) == 'xmlrpcval') {\n $mixed = $mixed->getval();\n }\n\n if(is_array($mixed) == true && !empty($mixed)) {\n foreach($mixed as $index => $value) {\n $mixed[$index] = $this->decode($value);\n }\n }\n return $mixed;\n }", "function toArray($str)\n\t{\n\t\t$tmpItemArr = array_filter(explode('-dlm-',$str));\n\t\tforeach ($tmpItemArr as &$value) {\n \t\t$ItemArr = explode('-spl-', $value);\n\t\t\t$arr[$ItemArr[0]]['id'] = &$ItemArr[0]; // Item ID\n\t\t\t$arr[$ItemArr[0]]['qty'] = &$ItemArr[1]; // Item Quantity\n\t\t\t$arr[$ItemArr[0]]['cp'] = &$ItemArr[2]; // Item custom price\n\t\t\t$arr[$ItemArr[0]]['order'] = &$ItemArr[3]; // Item order\n\t\t}\n\t\treturn $arr;\n\t}", "function convert_basic_array($string, $delimitor, $separator)\n{\n\t$the_array = array();\n\t$row = explode($delimitor, $string);\n\tforeach($row AS $item)\n\t{\n\t\t$the_value = htmlentities(trim(strstr($item, $separator), $separator));\n\t\t\n\t\t$check_array = explode('**',$the_value);\n\t\tif(in_array('drillevent', $check_array))\n\t\t{\n\t\t\t$check_array[array_search('drillevent',$check_array)] = 'drillevent=';\n\t\t\t$the_value = implode('**', $check_array);\n\t\t}\n\t\t\n\t\tif($the_value == '_')\n\t\t{\n\t\t\t$the_value = '';\n\t\t}\n\t\t\n\t\t$the_array[strstr($item, $separator, TRUE)] = $the_value;\n\t}\n\t\n\treturn $the_array;\n}", "private function _clean_input_data($str) {\n\t\tif (is_array($str)) {\n\t\t\t$new_array = array();\n\t\t\tforeach ($str as $key => $val) {\n\t\t\t\t$new_array [ $this->_clean_input_keys($key) ] = $this->_clean_input_data($val);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}\n\n\t\t// We strip slashes if magic quotes is on to keep things consistent\n\t\tif ($this->quotes_gpc) {\n\t\t\t$str = stripslashes($str);\n\t\t}\n\n\t\t// Should we filter the input data?\n\t\tif ($this->use_xss_clean === true) {\n\t\t\t$str = Request::$xss_cleaner->xss_clean($str);\n\t\t}\n\n\t\t// Standardize newlines\n\t\tif (strpos($str, \"\\r\") !== false) {\n\t\t\t$str = str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $str);\n\t\t}\n\n\t\treturn $str;\n\t}", "private function getArrayKey($string, $vars) {\n\t $keys = explode('][', substr($string, 1, -1 ));\n\t\t\n\t foreach( $keys as $key ) {\n\t $vars = $vars[$key];\n\t }\n\t\t\n\t return $vars;\n\t}", "function parseINI($str) {\n list(, $data) = preg_split('/^\\\\[Data\\\\]\\\\s*$/mu', $str, 2);\n preg_match_all('/^([^=]+)=(.*)$/mu', $data, $matches);\n return array_combine(array_map('trim', $matches[1]), array_map('trim', $matches[2]));\n}", "function parse_response_array($string) {\n $response_string_array = explode(\"&\", $string);\n\n $proper_array = array();\n\n foreach ($response_string_array as $value) {\n list($key, $val) = explode(\"=\", $value);\n\n $val = urldecode($val);\n\n $proper_array[\"$key\"] = $val;\n }\n unset($key);\n unset($val);\n\n return $proper_array;\n }", "function convert_string_to_post_data($post_string, $exclude_array=array(), $replace_array=array())\n{\n\t$post_array = array();\n\t\n\t$post_array_level1 = explode('<>', $post_string);\n\t\n\tforeach($post_array_level1 AS $key_value)\n\t{\n\t\t$key_value_array = explode('=', $key_value);\n\t\t\n\t\t#Was an array\n\t\tif(isset($key_value_array[1]) && strpos($key_value_array[1], '|') !== FALSE)\n\t\t{\n\t\t\t$post_array[$key_value_array[0]] = array();\n\t\t\t$post_array_level2 = explode('**', $key_value_array[1]);\n\t\t\t\n\t\t\tforeach($post_array_level2 AS $sub_key_value)\n\t\t\t{\n\t\t\t\t$sub_key_value_array = explode('|', $sub_key_value);\n\t\t\t\t#Was an array\n\t\t\t\tif(strpos($sub_key_value_array[1], '_') !== FALSE && $sub_key_value_array[1] != '_' && $sub_key_value_array[0] != 'drillevent')\n\t\t\t\t{\n\t\t\t\t\t$post_array[$key_value_array[0]][$sub_key_value_array[0]] = array();\n\t\t\t\t\t$post_array_level3 = explode(',', $sub_key_value_array[1]);\n\t\t\t\t\t\n\t\t\t\t\tforeach($post_array_level3 AS $sub_sub_key_value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sub_sub_key_value_array = explode('_', $sub_sub_key_value);\n\t\t\t\t\t\t#If key is in the excluded array do not include it in the conversion results\n\t\t\t\t\t\tif(!in_array($key_value_array[0], $exclude_array) && !in_array($sub_key_value_array[0], $exclude_array) && !in_array($sub_sub_key_value_array[0], $exclude_array))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#If key requires replacing the value with that given, change it here\n\t\t\t\t\t\t\tif(array_key_exists($sub_sub_key_value_array[0], $replace_array))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$post_array[$key_value_array[0]][$sub_key_value_array[0]][$sub_sub_key_value_array[0]] = $replace_array[$sub_sub_key_value_array[0]];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$post_array[$key_value_array[0]][$sub_key_value_array[0]][$sub_sub_key_value_array[0]] = $sub_sub_key_value_array[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}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t#If was an empty string\n\t\t\t\t\tif($sub_key_value_array[1] == '_')\n\t\t\t\t\t{\n\t\t\t\t\t\t$sub_key_value_array[1] = '';\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t#If key is in the excluded array do not include it in the conversion results\n\t\t\t\t\tif(!in_array($key_value_array[0], $exclude_array) && !in_array($sub_key_value_array[0], $exclude_array))\n\t\t\t\t\t{\n\t\t\t\t\t\t#If key requires replacing the value with that given, change it here\n\t\t\t\t\t\tif(array_key_exists($sub_key_value_array[0], $replace_array))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$post_array[$key_value_array[0]][$sub_key_value_array[0]] = $replace_array[$sub_key_value_array[0]];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$post_array[$key_value_array[0]][$sub_key_value_array[0]] = $sub_key_value_array[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t#If was an empty string\n\t\t\tif(isset($key_value_array[1]) && $key_value_array[1] == '_')\n\t\t\t{\n\t\t\t\t$key_value_array[1] = '';\n\t\t\t}\n\t\t\t\n\t\t\t#If key is in the excluded array do not include it in the conversion results\n\t\t\tif(!in_array($key_value_array[0], $exclude_array))\n\t\t\t{\n\t\t\t\t#If key requires replacing the value with that given, change it here\n\t\t\t\tif(isset($key_value_array[1]) && array_key_exists($key_value_array[1], $replace_array))\n\t\t\t\t{\n\t\t\t\t\t$post_array[$key_value_array[0]] = $replace_array[$key_value_array[1]];\n\t\t\t\t}\n\t\t\t\telse if(isset($key_value_array[0]) && isset($key_value_array[1]))\n\t\t\t\t{\n\t\t\t\t\t$post_array[$key_value_array[0]] = $key_value_array[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\treturn $post_array;\n}", "function stringtoarray($string) {\r\n\t/**\r\n\t * Probamos que sea un array sin comprimir\r\n\t */\r\n\tif (is_string($string)) {\r\n\t\tif (strstr($string, 'array')) {\r\n\t\t\teval(\"\\$arrayAux = $string;\");\r\n\t\t\treturn $arrayAux;\r\n\t\t}\r\n\t} else {\r\n\t\treturn FALSE;\r\n\t}\r\n}", "function parseAssoc($returnArray, $key, $haystack) { //simple parse of url style concatenations & as delimiter = as key = value;\n\t$associations = explode(\"&\", $haystack);\n\tforeach ($associations as $association) {\n\t\t$assoc = explode(\"=\", $association);\n\t\tif (isset($assoc[1])) { //was there a key/value pair\n\t\t\tif (is_array($assoc[1])) { $returnArray[$key][$assoc[0]] = implode('',$assoc[1]); } //if array (happens with textarea)\n\t\t\telse { $returnArray[$key][$assoc[0]] = $assoc[1]; }\n\t\t}\n\t}\n\treturn($returnArray);\n}", "public static function extractSettingValues($string)\n {\n $values = [];\n $errors = [];\n\n $list = \\explode(\"\\n\", $string);\n $list = \\array_map('trim', $list);\n $list = \\array_filter($list, 'strlen');\n\n foreach ($list as $position => $text) {\n // Check for an explicit key.\n $matches = [];\n if (\\preg_match('/(.*)=(.*)/', $text, $matches)) {\n // Trim key and value to avoid unwanted spaces issues.\n $key = \\trim($matches[1]);\n $value = \\trim($matches[2]);\n $values[$key] = $value;\n } else {\n $errors[] = $position;\n }\n }\n\n return [$values, $errors];\n }", "function process_str_vars($params = array())\n\t{\n\t\tglobal $HTTP_POST_VARS, $HTTP_GET_VARS;\n\n\t\twhile( list($var, $param) = @each($params) )\n\t\t{\n\t\t\tif (!empty($HTTP_POST_VARS[$param]))\n\t\t\t{\n\t\t\t\t$data[$param] = str_replace(\"\\'\", \"''\", trim(htmlspecialchars($HTTP_POST_VARS[$param])));\n\t\t\t}\n\t\t\telse if (!empty($HTTP_GET_VARS[$param]))\n\t\t\t{\n\t\t\t\t$data[$param] = str_replace(\"\\'\", \"''\", trim(htmlspecialchars($HTTP_GET_VARS[$param])));\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "public static function setting($mixed)\n {\n // Check for array\n if ( is_array($mixed) ) {\n\n // Iterate through keypairs\n foreach ($mixed as $index => $key) {\n\n // Recursion\n self::set($key, true);\n }\n\n // Normal setter\n } else {\n\n // Set the keypair\n self::$data['vars'][$mixed] = null;\n }\n }", "public function fromString(string $string): array;", "protected function _clean_input_data($str)\n\t{\n\t\tif (is_array($str))\n\t\t{\n\t\t\t$new_array = array();\n\t\t\tforeach (array_keys($str) as $key)\n\t\t\t{\n\t\t\t\t$new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($str[$key]);\n\t\t\t}\n\t\t\treturn $new_array;\n\t\t}\n\n\t\t// Remove control characters\n\t\t$str = remove_invisible_characters($str, FALSE);\n\n\t\t// Standardize newlines if needed\n\t\treturn preg_replace('/(?:\\r\\n|[\\r\\n])/', PHP_EOL, $str);\n\n\t}", "function parse($string)\r\n\t{\r\n\r\n\t\t$str = explode('{', $string);\r\n\r\n\t\t$res = '';\r\n\r\n\t\tfor ($i = 0; isset($str[$i]); $i++)\r\n\t\t{\r\n\t\t\tif ($i === 0)\r\n\t\t\t{\r\n\t\t\t\t$res .= $str[$i];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$line = explode('}', $str[$i]);\r\n\t\t\t\t$key = $line[0];\r\n\t\t\t\tunset($line[0]);\r\n\r\n\t\t\t\tif ( $key && isset($this->vars[$key]) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$res .= $this->vars[$key].implode('}', $line);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tswitch ($this->unknowns)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcase \"keep\":\r\n\t\t\t\t\t\t\t$res .= '{'.$key;\r\n\t\t\t\t\t\t\tif (count ($line) >\t0) \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$res .= '}';\r\n\t\t\t\t\t\t\t\t$res .= implode('}', $line);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"remove\":\r\n\t\t\t\t\t\t\t\t$res .= implode('', $line);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"remove_nonjs\":\r\n\t\t\t\t\t\t\t\tif (!empty($key) && ((false === strpos($key, ' ')) && (false === strpos($key, \"\\n\")) && (false === strpos($key, \"\\t\"))))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$res .= implode('}', $line);\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$res .= '{'.$key;\r\n\t\t\t\t\t\t\t\t\tif (count ($line) >\t0) \r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$res .= '}';\r\n\t\t\t\t\t\t\t\t\t\t$res .= implode('}', $line);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"comment\":\r\n\t\t\t\t\t\t\t\t$res .= '<!-- '.$key.' -->'.implode('', $line);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase \"space\":\r\n\t\t\t\t\t\t\t\t$res .= '&nbsp;'.implode('', $line);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $res;\r\n\t}", "abstract public static function decode($string): array;", "function d2d_value_decode($string) {\n $array = preg_split('/\\$/', $string, 2);\n if (sizeof($array) != 2) {\n return array(FALSE, '');\n }\n switch ($array[0]) {\n case 'n': return array(TRUE, NULL);\n case 'b': return array(TRUE, $array[1] ? TRUE : FALSE);\n case 's': return array(TRUE, $array[1]);\n }\n return array(FALSE, '');\n}", "function _mixed($mixed)\n {\n return $mixed;\n }", "function str_to_array($str,$key){\n\t\t//remove the . from last line\n\t\t$str = trim($str,'.');\n\t\treturn explode($key,$str);\n\t}", "function dict_check($d, $s) {\n\tif ($d[\"type\"] != \"dictionary\")\n\tprint(\"not a dictionary\");\n\t$a = explode(\":\", $s);\n\t$dd = $d[\"value\"];\n\t$ret = array();\n\tforeach ($a as $k) {\n\t\tunset($t);\n\t\tif (preg_match('/^(.*)\\((.*)\\)$/', $k, $m)) {\n\t\t\t$k = $m[1];\n\t\t\t$t = $m[2];\n\t\t}\n\t\tif (!isset($dd[$k]))\n\t\tprint(\"dictionary is missing key(s)\");\n\t\tif (isset($t)) {\n\t\t\tif ($dd[$k][\"type\"] != $t)\n\t\t\tprint(\"invalid entry in dictionary\");\n\t\t\t$ret[] = $dd[$k][\"value\"];\n\t\t}\n\t\telse\n\t\t$ret[] = $dd[$k];\n\t}\n\treturn $ret;\n}", "public static function utf8ize($mixed)\n {\n if (is_array($mixed)) {\n foreach ($mixed as $key => $value) {\n $mixed[$key] = self::utf8ize($value);\n }\n } else {\n if (is_string($mixed)) {\n return utf8_encode($mixed);\n }\n }\n return $mixed;\n }", "public static function StringToMetadata($string){\r\n $string = explode(\",\", $string);\r\n foreach($string as $v){\r\n $tmp = explode(\"=>\", $v);\r\n $data[$tmp[0]] = $tmp[1];\r\n }\r\n return $data;\r\n }", "function string_translate($string, $number_dictionary){\n \n $string = strtolower($string);\n \n //for comparison\n //print_r(strtr($string, $number_dictionary)); \n\n $string = preg_split(\"/(\\,)|(\\?)|(\\!)|(\\.)|(\\s)+/\",$string,-1,\n PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n \n foreach($string as $key => $val){\n if(array_key_exists($val,$number_dictionary) == true){\n $string[$key] = $number_dictionary[$val];\n }\n }\n $string = implode($string);\n //print_r($string);\n \n return $string;\n}", "public function get_variables_from_str($str) {\n\t\tforeach($this->offsets as $k => $v) {\n\t\t\t$bin = mb_substr($str, $v, 2);\n\t\t\t$vars[$k] = implode(unpack(\"n\",$bin));\n\t\t}\n\t\treturn $vars;\n\t}", "private function _clean_input_data($str)\n {\n if (is_array($str))\n {\n $new_array = array();\n foreach ($str as $key => $val)\n {\n $new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);\n }\n return $new_array;\n }\n\n /* We strip slashes if magic quotes is on to keep things consistent\n\n NOTE: In PHP 5.4 get_magic_quotes_gpc() will always return 0 and\n it will probably not exist in future versions at all.\n */\n if (get_magic_quotes_gpc())\n {\n $str = stripslashes($str);\n }\n\n // Clean UTF-8 if supported\n $str = $this->clean_string($str);\n // Remove control characters\n $str = $this->remove_invisible_characters($str);\n\n // Should we filter the input data?\n if ($this->_enable_xss === true)\n {\n $str = $this->xss_clean($str);\n }\n\n\n // Standardize newlines if needed\n if ($this->_standardize_newlines == true)\n {\n if (strpos($str, \"\\r\") !== false)\n {\n $str = str_replace(array(\"\\r\\n\", \"\\r\", \"\\r\\n\\n\"), PHP_EOL, $str);\n }\n }\n\n return $str;\n }", "function getFilteredArrayFromString($string, $wasteValue){\n $params = [];\n foreach ($string as $item) {\n $res = explode('=', $item);\n //delete params with value = '3'\n if (!in_array($res[1], $wasteValue)) {\n $params[$res[0]] = $res[1];\n }\n }\n return $params;\n}", "protected function _clean_input_data($str)\n {\n if (is_array($str))\n {\n $new_array = array();\n foreach (array_keys($str) as $key)\n {\n $new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($str[$key]);\n }\n return $new_array;\n }\n\n /* We strip slashes if magic quotes is on to keep things consistent\n\n NOTE: In PHP 5.4 get_magic_quotes_gpc() will always return 0 and\n it will probably not exist in future versions at all.\n */\n if ( ! is_php('5.4') && get_magic_quotes_gpc())\n {\n $str = stripslashes($str);\n }\n\n // Clean UTF-8 if supported\n if (UTF8_ENABLED === TRUE)\n {\n $str = $this->uni->clean_string($str);\n }\n\n // Remove control characters\n $str = remove_invisible_characters($str, FALSE);\n\n // Standardize newlines if needed\n if ($this->_standardize_newlines === TRUE)\n {\n return preg_replace('/(?:\\r\\n|[\\r\\n])/', PHP_EOL, $str);\n }\n\n return $str;\n }", "function d2d_explode($string) {\n if (!is_string($string)) {\n return FALSE;\n }\n if (empty($string)) {\n return array();\n }\n // prepend two consecutive slashes by an '@' s.t. every slash followed\n // directly by a ',' resp. '=' really corresponds to an escaped character\n $string = str_replace('\\\\\\\\', '\\\\\\\\@', $string);\n // split array at ','-characters that are not preceded by a slash\n $array = preg_split('/(?<=[^\\\\\\\\]),|^,/', $string);\n $return_array = array();\n foreach ($array as $key => $value) {\n // split array at '='-characters that are not preceded by a slash\n $tokens = preg_split('/(?<=[^\\\\\\\\])=|^=/', $value);\n // not escaped '=' must occur exactly once, splitting the string into\n // exactly two strings\n if (sizeof($tokens) != 2) {\n return FALSE;\n }\n // undo first replacement for both tokens\n $parsed_key = str_replace('\\\\\\\\@', '\\\\\\\\', $tokens[0]);\n $parsed_value = str_replace('\\\\\\\\@', '\\\\\\\\', $tokens[1]);\n // unescape, i.e. remove slashes followed by a single character\n $parsed_key = preg_replace('/\\\\\\\\(.)/', '\\\\1', $parsed_key);\n $parsed_value = preg_replace('/\\\\\\\\(.)/', '\\\\1', $parsed_value);\n list($success, $decoded_parsed_value) = d2d_value_decode($parsed_value);\n if (!$success) {\n return FALSE;\n }\n $return_array[$parsed_key] = $decoded_parsed_value;\n }\n return $return_array;\n}", "public function wsiArrayPacker($mixed)\n {\n if (is_array($mixed)) {\n $arrKeys = array_keys($mixed);\n $isDigit = false;\n foreach ($arrKeys as $key) {\n if (is_int($key)) {\n $isDigit = true;\n break;\n }\n }\n if ($isDigit) {\n $mixed = $this->packArrayToObject($mixed);\n } else {\n $mixed = (object)$mixed;\n }\n }\n if (is_object($mixed) && isset($mixed->complexObjectArray)) {\n foreach ($mixed->complexObjectArray as $k => $v) {\n $mixed->complexObjectArray[$k] = $this->wsiArrayPacker($v);\n }\n }\n return $mixed;\n }", "public function associativeArrayUnpack(&$mixed)\n {\n if (is_array($mixed)) {\n $tmpArr = array();\n foreach ($mixed as $key => $value) {\n if (is_object($value)) {\n $value = get_object_vars($value);\n if (count($value) == 2 && isset($value['key']) && isset($value['value'])) {\n $tmpArr[$value['key']] = $value['value'];\n }\n }\n }\n if (count($tmpArr)) {\n $mixed = $tmpArr;\n }\n }\n\n if (is_object($mixed)) {\n $numOfVals = count(get_object_vars($mixed));\n if ($numOfVals == 2 && isset($mixed->key) && isset($mixed->value)) {\n $mixed = get_object_vars($mixed);\n /*\n * Processing an associative arrays.\n * $mixed->key = '2'; $mixed->value = '3'; turns to array(2 => '3');\n */\n $mixed = array($mixed['key'] => $mixed['value']);\n }\n }\n }", "function parse_string($string, $data = array(), $options = array()) {\n\n if (!$this->string_has_params($string)) {\n return $string;\n }\n\n //check if string is once param\n if ($this->parse_string_is_once_param($string)) {\n $param_key = $this->parse_string_extract_param($string);\n //print_r(compact('param_key'));\n if ($this->parse_param_exists($param_key, $data)) {\n return $this->parse_param_value($param_key, $data);\n }\n return $string; //param_key not exists, return string as is\n }\n\n $string1 = str_replace(\n array(\n $this->parse['before'],\n $this->parse['after']), array(\n '!-=0=-!' . $this->parse['before'],\n $this->parse['after'] . '!-=0=-!'), $string);\n\n $parsed = explode('!-=0=-!', $string1);\n $finded = array();\n foreach ($parsed as $ix => $item) {\n if ($item) {\n if ($this->parse_string_is_once_param($item)) {\n $param_key = $this->parse_string_extract_param($item);\n\n if ($this->parse_param_exists($param_key, $data)) {\n $parsed[$ix] = $this->parse_param_value($param_key, $data);\n }\n }\n }\n }\n return join($parsed);\n }", "public function convertExtraToArray( $string ) {\n\t\tif( !$string )\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t$_temp = array();\n\t\t\n\t\tif( $string == '#show_roles#' )\n\t\t{\n\t\t\t$roles = Yii::app()->authManager->getRoles();\n\t\t\tif( count($roles) )\n\t\t\t{\n\t\t\t\tforeach( $roles as $role )\n\t\t\t\t{\n\t\t\t\t\t$_temp[ $role->name ] = $role->name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$exploded = explode(\"\\n\", $string);\n\n\t\t\tif( count($exploded) )\n\t\t\t{\n\t\t\t\tforeach( $exploded as $explode )\n\t\t\t\t{\n\t\t\t\t\tlist($key, $value) = explode('=', $explode);\n\t\t\t\t\t$_temp[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\t\n\t\treturn $_temp;\n\t}", "private function set_up_replacements( $string ) {\n\t\t$replacements = [];\n\t\tif ( ! preg_match_all( '/{(.*?)}/iu', $string, $matches ) ) {\n\t\t\treturn $replacements;\n\t\t}\n\n\t\tforeach ( $matches[1] as $index => $variable ) {\n\t\t\t$value = Variables\\Variables::from( $variable, $this->args );\n\t\t\tif ( false !== $value ) {\n\t\t\t\t$replacements[ $matches[0][ $index ] ] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $replacements;\n\t}", "public function parse(string $string): array;", "function input_mapping(array $mapping, $data)\n{\n $translated = array();\n\n foreach ($mapping as $from => $to) {\n if (array_key_exists($from, $data))\n {\n $translated[$to] = strlen(trim($data[$from])) > 0 ? trim($data[$from]) : null;\n }\n }\n\n return $translated;\n}", "public function getArmorFromString(string $string): array{\r\n return $this->getConfig()->get($string);\r\n }", "private function extract($String) {\n $string = DB::quote($String);\n $numbers = [];\n\n $updatedString = dictionary($string);\n preg_match_all('!\\d+!', $updatedString, $matches);\n (isset($matches[0][0])) ? $numbers['RSVP']=$matches[0][0] : $numbers['RSVP']='NULL'; // TODO: this returns only the 1st number in the string after dict\n (isset($matches[0][1])) ? $numbers['Uncertin']=$matches[0][1] : $numbers['Uncertin']='NULL'; // TODO: this returns only the 2nd number in the string after dict\n (isset($matches[0][2])) ? $numbers['Ride']=$matches[0][2] : $numbers['Ride']=0; // TODO: this returns only the 3rd number in the string after dict\n ($numbers['Ride'] !=0 ) ? $numbers['Ride']=1 : $numbers['Ride']=0;\n\n (strlen($updatedString)>11) ? $numbers['Complex']=1 : $numbers['Complex']=0; // TODO: this relays on string being longer than 3 seperate dnumbers after dictionary\n\n return $numbers;\n }", "function wp_parse_str( $string, &$array ) {\n\tparse_str( $string, $array );\n\t$array = apply_filters( 'wp_parse_str', $array );\n}", "function stringfields($string)\n{\n\tatkdebug(\"Warning: deprecated use of stringfields(). Use atkStringParser class instead\");\n\t$tmp = \"\";\n\t$adding = false;\n\t$fields = array();\n\tfor ($i=0;$i<strlen($string);$i++)\n\t{\n\t\tif ($string[$i]==\"]\")\n\t\t{\n\t\t\t$adding = false;\n\t\t\t$fields[] = $tmp;\n\t\t\t$tmp=\"\";\n\t\t}\n\t\telse if ($string[$i]==\"[\")\n\t\t{\n\t\t\t$adding = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($adding) $tmp.=$string[$i];\n\t\t}\n\t}\n\n\treturn $fields;\n}", "function deCadenaToArrayOpcionesCarrito( $string ){\n\t\t$options = array();\n\t\t$temp = explode('{',$string);\n\t\tfor( $i=1 ; $i<count($temp); $i++ ){\n\t\t\t$k = explode('}',$temp[$i]);\n\t\t\t$options[(int)$temp[$i]] = end($k);\n\t\t}\n\t\treturn $options;\n\t}", "function keyvalues($data) {\n $ret = [];\n $data = explode(PHP_EOL, $data);\n foreach($data as $k=>$v){\n if(empty($v)) continue;\n $vv = explode('=', $v);\n if(isset($vv[1])) {\n $ret[$vv[0]] = $vv[1];\n } else {\n $ret[] = $v;\n }\n }\n return $ret;\n}", "private static function parseStr( $string ) {\n $chars = [\n \".\" => \".\",\n \" \" => \" \",\n ];\n\n // check if we even need to handle special chars\n $found = false;\n foreach($chars as $char => $v){\n if(mb_strpos($string,$char)){\n $found = true;\n break;\n }\n }\n if(!$found){\n // if not - return\n parse_str($string,$params);\n return $params;\n }\n\n //otherwise, let the crazyness begin\n\n //build uid\n $patterns = [];\n foreach($chars as $key => $v) {\n $rand = \"\";\n do {\n $rand .= rand(0,1000000);\n } while (mb_strpos($string,$rand) !== false);\n $patterns[$key] = $rand;\n }\n //sort by length descending to avoid overlap\n uasort($patterns,function($s1,$s2){\n return mb_strlen($s1) > mb_strlen($s2) ? -1 : 1;\n });\n\n // replace chars\n $replacements = [];\n foreach($patterns as $char => $escape){\n $string = preg_replace(\"#\".preg_quote($char).\"#u\",$escape,$string,-1,$count);\n if($count > 0){\n $replacements[$escape] = $chars[$char];\n }\n }\n\n parse_str($string,$params);\n\n // reverse replacement\n if(count($replacements) > 0){\n $replaceBack = function($str) use($replacements){\n foreach($replacements as $escape => $char){\n $str = preg_replace(\"#\".preg_quote($escape).\"#u\",$char,$str);\n }\n return $str;\n };\n\n $replaceBackRec = function(array $arr) use(&$replaceBackRec, $replaceBack){\n foreach($arr as $key => $val){\n $newkey = $replaceBack($key);\n if(is_array($val)){\n $val = $replaceBackRec($val);\n }else{\n $val = $replaceBack($val);\n }\n unset($arr[$key]);\n $arr[$newkey] = $val;\n }\n return $arr;\n };\n\n $params = $replaceBackRec($params);\n }\n\n return $params;\n }", "function atkDataDecode(&$vars)\n{\n\t$magicQuotes = get_magic_quotes_gpc();\n\n\tforeach (array_keys($vars) as $varname)\n\t{\n\t\t$value = &$vars[$varname];\n\t\t// We must strip all slashes from the input, since php puts slashes\n\t\t// in front of quotes that are passed by the url. (magic_quotes_gpc)\n\t\tif ($value !== NULL && $magicQuotes)\n\t\tatk_stripslashes($value);\n\n\t\tAE_decode($vars, $varname);\n\n\t\tif (strpos(strtoupper($varname),'_AMDAE_')>0) // Now I *know* that strpos could return 0 if _AMDAE_ *is* found\n\t\t// at the beginning of the string.. but since that's not a valid\n\t\t// encoded var, we do nothing with it.\n\t\t{\n\t\t\t// This string is encoded.\n\t\t\tlist($dimension1,$dimension2) = explode(\"_AMDAE_\",strtoupper($varname));\n\t\t\tif (is_array($value))\n\t\t\t{\n\t\t\t\t// Multidimensional thing\n\t\t\t\tfor ($i=0;$i<count($value);$i++)\n\t\t\t\t{\n\t\t\t\t\t$vars[strtolower($dimension1)][$i][strtolower($dimension2)] = $value[$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$vars[strtolower($dimension1)][strtolower($dimension2)] = $value;\n\t\t\t}\n\t\t}\n\t}\n}", "public function fromValues(\n $string,\n array $extraFields,\n $soft = false\n ) {\n Assert::string($string);\n\n foreach ($extraFields as $field) {\n\n Assert::isInstanceOf(\n $field,\n ExtraField::class\n );\n }\n\n $rawValues = explode(\n '||',\n $string\n );\n\n $rawValues = array_map(\n 'trim',\n $rawValues\n );\n\n $instances = [];\n\n foreach ($rawValues as $rawValue) {\n\n $nameAndValue = explode(\n '|',\n $rawValue\n );\n\n $nameAndValue = array_map(\n 'trim',\n $nameAndValue\n );\n\n if (count($nameAndValue) !== 2)\n throw new \\Exception(\n 'Не удалось разобрать значение дополнительного поля по строке.'\n );\n\n $name = $nameAndValue[0];\n $value = $nameAndValue[1];\n\n $fieldFilter = function (ExtraField $field) use ($name) {\n return $field->name === $name;\n };\n\n $matchedField = current(\n array_filter(\n $extraFields,\n $fieldFilter\n )\n );\n\n // Extra field of value has not found.\n if (!$matchedField) {\n\n if ($soft) {\n\n continue;\n\n } else {\n\n throw new \\Exception(\n 'Не удалось найти дополнительное поле по названию.'\n );\n }\n }\n\n Assert::string(\n $value,\n 'Значение дополнительного поля не является строкой.'\n );\n\n $matchedField->value = $value;\n $instances[] = $matchedField;\n }\n\n return $instances;\n }", "public function keyOf($mixedValue):String {\n\n\t\treturn array_search($mixedValue, $this->data);\n\n\t}", "function bdec_dict($s) {\n\tif ($s[0] != \"d\")\n\treturn;\n\t$sl = strlen($s);\n\t$i = 1;\n\t$v = array();\n\t$ss = \"d\";\n\tfor (;;) {\n\t\tif ($i >= $sl)\n\t\treturn;\n\t\tif ($s[$i] == \"e\")\n\t\tbreak;\n\t\t$ret = bdec(substr($s, $i));\n\t\tif (!isset($ret) || !is_array($ret) || $ret[\"type\"] != \"string\")\n\t\treturn;\n\t\t$k = $ret[\"value\"];\n\t\t$i += $ret[\"strlen\"];\n\t\t$ss .= $ret[\"string\"];\n\t\tif ($i >= $sl)\n\t\treturn;\n\t\t$ret = bdec(substr($s, $i));\n\t\tif (!isset($ret) || !is_array($ret))\n\t\treturn;\n\t\t$v[$k] = $ret;\n\t\t$i += $ret[\"strlen\"];\n\t\t$ss .= $ret[\"string\"];\n\t}\n\t$ss .= \"e\";\n\treturn array('type' => \"dictionary\", 'value' => $v, 'strlen' => strlen($ss), 'string' => $ss);\n}", "function parseAbstractString($string) {\r\n\t$array_ensembe = array();\r\n\t$ensembles = explode(';', $string);\r\n\tforeach($ensembles as $k=>$ensemble) {\r\n\t\tlist($ensemble_valeur, $valeurs) = explode(':', $ensemble);\r\n\t\t$array_ensembe[$k]['ensemble'] = $ensemble_valeur;\r\n\t\t$valeurs = explode(',', $valeurs);\r\n\t\t$array_ensembe[$k]['valeurs'] = array();\r\n\t\tforeach($valeurs as $j=>$valeur) {\r\n\t\t\tlist($array_ensembe[$k]['valeurs'][$j]['titre'], $array_ensembe[$k]['valeurs'][$j]['nom'], $type) = explode('|', $valeur);\r\n\t\t\tlist($type, $array_ensembe[$k]['valeurs'][$j]['defaut']) = explode('(', $type);\r\n\t\t\tlist($type, $enum) = explode('[', $type);\r\n\t\t\tif (!empty($enum)) $array_ensembe[$k]['valeurs'][$j]['enum'] = explode('/', $enum);\r\n\t\t\t$array_ensembe[$k]['valeurs'][$j]['type'] = $type;\r\n\t\t}\r\n\t}\r\n\treturn $array_ensembe;\r\n}", "function parse_query($str) {\n \n $str = html_entity_decode($str);\n\n $arr = array();\n \n $pairs = explode('&', $str);\n \n foreach ($pairs as $i) {\n list($name,$value) = explode('=', $i, 2);\n\n if (isset($arr[$name])) {\n if (is_array($arr[$name])) {\n $arr[$name][] = $value;\n }\n else {\n $arr[$name] = array($arr[$name], $value);\n }\n }\n else {\n $arr[$name] = $value;\n }\n }\n return $arr;\n }", "public function parse_str_raw($str, &$array=array()) {\n\t\t$str = rawurldecode($str);\n\t\t$str = trim($str, $sep1.' ');\n\t\t$arr = explode($sep1, $str);\n\t\t\n\t\t$result = array();\n\t\tif (count($arr)) {\n\t\t\tforeach ($arr AS $_str) {\n\t\t\t\t$_arr = explode($sep2, $_str);\n\t\t\t\t$_arr[0] = trim($_arr[0]);\n\t\t\t\tif ($_arr[0] !== '') {\n\t\t\t\t\t$result[$_arr[0]] = isset($_arr[1])?trim($_arr[1]):'';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$array = $result;\n\t}", "function string_to_array($array)\n{\n $arr = explode(',', $array);\n foreach($arr as $item)\n $result[$item] = $item;\n\n return $result;\n}", "public function parseSettings($settings) {\n # already array?\n if (!is_string($settings)) {\n return $settings;\n }\n $parts = explode(',', trim($settings));\n $s = array();\n foreach ($parts as $k => $v) {\n $kv = explode('=', trim($v));\n # convert all key values to lowercase to ease against simple typos\n $key = strtolower(trim($kv[0]));\n $s[$key] = trim($kv[1]);\n }\n return $s;\n }", "function custom_parsed()\n\t\t{\n\t\t$custom = array();\n\t\t$info = $this->infoarray();\n\t\tif(!isset($info['custom'])) { return $custom(); }\n\t\tforeach(explode(' ', $info['custom']) as $pair)\n\t\t\t{\n\t\t\tlist($k, $v) = explode('=', $pair);\n\t\t\t$custom[strtolower($k)] = ($v == 'false') ? false : intval($v);\n\t\t\t}\n\t\treturn $custom;\n\t\t}", "function serverStringToArray($str, &$array, &$frontParam)\n{\n // init param\n $array = array();\n $fronParam = \"\";\n\n // split front param, e.g. /index.php, and others, e.g. blogid=1&page=2\n if (strstr($str, \"?\")){\n list($frontParam, $args) = preg_split(\"/\\?/\", $str, 2);\n }\n else {\n $args = $str;\n $frontParam = \"\";\n }\n\n // If there is no args like blogid=1&page=2, return\n if (!strstr($str, \"=\") && !strlen($frontParam)) {\n $frontParam = $str;\n return;\n }\n\n $array = explode(\"&\", $args);\n}", "function string2params($params_string)\n{\n\n\tif (is_string($params_string))\n\t{\n\t\t$params\t\t= array();\n\t\tif (strpos($params_string , '/') !== false )\n\t\t{\n\t\t\t$raw_params = explode('/', $params_string);\n\n\t\t\tif (($c = count($raw_params)) % 2 == 0)\n\t\t\t{\n\t\t\t\t$i\t= 0;\n\t\t\t\tforeach ($raw_params as $param )\t// Step in twos\n\t\t\t\t{\n\t\t\t\t\tif ($i % 2 == 0)\n\t\t\t\t\t\t$params [$raw_params[$i]] = $raw_params[$i + 1];\t\t// Do the magic\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (strpos($params_string, '=') !== false )\n\t\t{\n\t\t\t$params_q\t= explode('&' , $params_string);\n\t\t\t\n\t\t\tforeach ($params_q as $this_q)\n\t\t\t{\n\t\t\t\tif (strpos($this_q, '='))\n\t\t\t\t{\n\t\t\t\t\tlist($key, $value)\t= explode('=', $this_q, 2);\n\t\t\t\t\t$params[$key]\t= $value;\n\t\t\t\t}\t\t\n\t\t\t}\n//\t\t\t// Join the two\n//\t\t\t$params\t\t= array_merge($params, $params_q);\n\t\t}\n\t\treturn $params;\n\t}\n}", "function transform_string($string){\n\t $data_string = \"\";\n\t $count = 0;\n\t $result;\n\t $even_found = false;\n\t $array = $this->transform_array->transform_key_words;\n\t $data_string = print_r($array, true);\n\n\t foreach($array as $key=>$value){\n\t\t\n\t\tif($count % 2 != 0 && $even_found){\n\t\t $data_string .= \"skipped at: \" . $key;\n\t\t $count++;\n\t\t continue;\n\t\t}\n\t\telse\n\t\t $even_found = false;\n\n\t\tpreg_match(\"/\\b\" . $key . \"\\b/\", $string, $result);\n\t\tif($result){\n\t\t if($count % 2 == 0)\n\t\t\t $even_found = true;\n\t\t $string = preg_replace(\"/\\b\" . $key . \"\\b/\", $value, $string);\n\t\t $data_string .= \"\\n\" . $string. \" \". $key . \", \" . $value;\n\t\t \n\t\t}\n\t\t$count++;\n\t }\n\t $data_string .= \"\\n\" . $string;\n\t file_put_contents(\"testdata\", $data_string);\n\t return $string;\t \n\n }", "function answersArray($strInput)\t{\n\t\t$strLine=explode(chr(10),$strInput);\n\t\tforeach($strLine as $intKey => $strLineValue)\t{\n\t\t\t$strValue = explode('|',$strLineValue);\n\t\t\t$arrOutput[$intKey+1]=trim($strValue[0]);\n\t\t}\n\t\treturn $arrOutput;\n\t}", "public function answer_mapping($str) {\n return Slu2DB::$answer_map[$str];\n }", "function arr2dict($arr, $keyfield, $valuefield, $allow_empty_value = 0) {\n $output = array();\n foreach ($arr as $row) {\n $key = lavnn($keyfield, $row, '');\n $value = lavnn($valuefield, $row, '');\n if ($key != '' && (($value != '') || $allow_empty_value > 0)) {\n $output[$key] = $value;\n }\n }\n return $output;\n}", "private function _readNvp($string)\r\n\t{\r\n\t\twhile (strlen($string))\r\n\t\t{\r\n\t\t\t$keypos = strpos($string, '=');\r\n\t\t\t$valuepos = strpos($string, '&') ? strpos($string, '&') : strlen($string);\r\n\t\t\t$nvp_array[urldecode(substr($string, 0, $keypos))] = urldecode(substr($string, $keypos + 1, $valuepos - $keypos - 1));\r\n\t\t\t$string = substr($string, $valuepos + 1, strlen($string));\r\n\t\t}\r\n\r\n\t\treturn $nvp_array;\r\n\t}", "public function parseStr($str, array &$arr = null) {\n return parse_str($str, $arr);\n }", "function siteorigin_panels_wp_import_post_meta_map($val) {\n\tif(is_string($val)) return str_replace('<<<br>>>', \"\\n\", $val);\n\telse return array_map('siteorigin_panels_wp_import_post_meta_map', $val);\n}", "protected function processFrom(string $string): array\n {\n return \\json_decode($string, true);\n }", "private function mapInputs($map, $input = array()){\n \t$ret = array();\n\n \t// empty the set default.\n \tif(empty($input)) {\n \t\t$input = $this->input;\n \t}\n\n \tforeach ($map as $key => $value) {\n\t\t\tif(is_numeric($key)){\n\t\t\t\t$ret[$value] = isset($input[$value]) ? $input[$value] : \"\";\n\t\t\t}else{\n\t\t\t\t$ret[$key] = isset($input[$value]) ? $input[$value] : \"\";\n\t\t\t}\n\t\t}\n\n return $ret;\n }", "protected function addStoredValues($string)\n {\n preg_match_all('/\\{stored\\[(.*?)\\]\\}/si', $string, $matches);\n\n $length = count($matches[0]);\n\n for ($i = 0; $i < $length; $i++) {\n $parts = explode('][', $matches[1][$i]);\n $value = $this->storedResult;\n foreach ($parts as $part) {\n if (isset($value[$part])) {\n $value = $value[$part];\n }\n }\n\n $string = str_replace($matches[0][$i], $value, $string);\n }\n\n return $string;\n }", "public static function toArray($string)\n\t{\n if(is_array($string))\n {\n return $string;\n }\n\n if (empty($string))\n {\n return null;\n }\n\n $timer = dmDebug::timer(\"dmString::toArray\");\n\n $array = array();\n\n // JQUERY STYLE - css expression\n self::retrieveCssFromString($string, $array);\n\n // DMS STYLE - string opt in name\n self::retrieveOptFromString($string, $array);\n\n $timer->addTime();\n\n return $array;\n\t}", "function sanitize($mixed = null)\n{\n if (!is_array($mixed)) {\n return convertHtmlEntities($mixed);\n }\n function array_map_recursive($callback, $array)\n {\n $func = function ($item) use (&$func, &$callback) {\n return is_array($item) ? array_map($func, $item) : call_user_func($callback, $item);\n };\n return array_map($func, $array);\n }\n return array_map_recursive('convertHtmlEntities', $mixed);\n}", "public function stringtoarray($stringa,$delimitatore=','){\n\t\treturn explode($delimitatore,$stringa);\n\t}", "private function str(string $str, array $map)\n {\n foreach ($map as $key => $value) {\n if (is_array($value) && count($value) > 0) {\n for ($j = 0; $j < count($value); $j++) {\n if (strpos($value[$j], $str) !== false)\n return ($key === self::UNKNOWN) ? null : $key;\n }\n } elseif (strpos($value, $str) !== false) {\n return ($key === self::UNKNOWN) ? null : $key;\n }\n }\n\n return null;\n }", "function get_tags($str) {\n $tags = array();\n if(!empty($str)) {\n $id_tags = explode(',', $str);\n\n foreach($id_tags as $id_tag) {\n $parts = explode('-', $id_tag);\n $id = $parts[0];\n $tag = $parts[1];\n $tags[$id] = $tag;\n }\n }\n\n return $tags;\n}", "function magictoolbox_WordPress_MagicScroll_parse_option_from_string($options) {\n $opt = array();\n\n $options = explode(\";\", $options);\n array_pop($options);\n\n foreach ($options as $value) {\n $value = trim($value);\n if (!empty($value)) {\n $value = explode(\":\", $value);\n // $opt[$value[0]] = trim($value[1]);\n $k = array_shift($value);\n $v = join(\":\",$value);\n $opt[$k] = trim($v);\n }\n }\n return $opt;\n}", "public static function stringToArray($str)\n {\n $parsed = [];\n $addresses = explode(',', $str);\n\n foreach ($addresses as $address) {\n $split = explode(' <', trim($address));\n\n if (trim($split[0]) === '') {\n continue;\n }\n\n if (!empty($split[1])) { // eg. John Doe <[email protected]>\n $name = trim($split[0]);\n $addr = trim(rtrim($split[1], '>'));\n } else { // eg. [email protected]\n $name = null;\n $addr = trim($split[0]);\n }\n\n $parsed[$addr] = $name;\n }\n\n return $parsed;\n }", "protected function setData( $mixed )\n {\n return $this->mixed = $mixed;\n }", "function str_minify($str){\n\tif(is_string($str)){\n\t\t$str=preg_replace('/\\\\s+/',' ',$str);\n\t\t$str=preg_replace('/\\\\s*([\\(\\)\\{\\};])\\\\s*/','$1',$str);\n\t\treturn $str;\n\t}elseif(is_array($str)){\n\t\tforeach($str as $key=>$value)\n\t\t\t$str[$key]=str_minify($value);\n\t}else{\n\t\treturn $str;\n\t}\n}", "function str_minify($str){\n\tif(is_string($str)){\n\t\t$str=preg_replace('/\\\\s+/',' ',$str);\n\t\t$str=preg_replace('/\\\\s*([\\(\\)\\{\\};])\\\\s*/','$1',$str);\n\t\treturn $str;\n\t}elseif(is_array($str)){\n\t\tforeach($str as $key=>$value)\n\t\t\t$str[$key]=str_minify($value);\n\t}else{\n\t\treturn $str;\n\t}\n}", "function string_to_alphabet_map($string) {\n $res_map = array(\"a\" => \"a\", \"b\" => \"b\", \"c\" => \"c\", \"d\" => \"d\", \"e\" => \"e\", \"f\" => \"f\",\n \"g\" => \"g\", \"h\" => \"h\", \"i\" => \"i\", \"j\" => \"j\", \"k\" => \"k\", \"l\" => \"l\",\n \"m\" => \"m\", \"n\" => \"n\", \"o\" => \"o\", \"p\" => \"p\", \"q\" => \"q\", \"r\" => \"r\",\n \"s\" => \"s\", \"t\" => \"t\", \"u\" => \"u\", \"v\" => \"v\", \"w\" => \"w\", \"x\" => \"x\",\n \"y\" => \"y\", \"z\" => \"z\");\n $keys = array_keys($res_map);\n for ($i=0; $i<26; $i++) {\n if ($string[$i] != null)\n $res_map[$keys[$i]] = ($string[$i]);\n else\n $res_map[$keys[$i]] = \"*\";\n }\n return $res_map;\n }", "public static function parseAttributeString(string $string) : array\n\t{\n\t\t$str = trim($string);\n\t\t$attributes = [];\n\n\t\tif ($str[0] !== '<') {\n\t\t\t// String does not start with a tag\n\t\t\t$str = \"<div $str></div>\";\n\t\t}\n\n\t\t$simpleXML = new SimpleXMLElement($str);\n\n\t\tforeach($simpleXML->attributes() as $name => $value) {\n\t\t\t$attributes[$name] = (string)$value;\n\t\t}\n\n\t\treturn $attributes;\n\t}", "protected static function parseInlineValues($string)\n {\n $values = array();\n $value = '';\n $string = str_replace(array('\\\\', \"''\"), array('\\\\\\\\', \"\\\\'\"), $string);\n $strLen = strlen($string);\n $cursor = 0;\n while ($cursor < $strLen) {\n switch ($string[$cursor]) {\n case '\\\\':\n $value .= $string[$cursor + 1];\n $cursor++;\n break;\n case ',':\n $values[] = $value;\n $value = '';\n break;\n case \"'\":\n if (empty($value)) {\n $value = $string[$cursor + 1];\n $cursor++;\n }\n break;\n default:\n $value .= $string[$cursor];\n }\n $cursor++;\n }\n\n if (!empty($value)) {\n $values[] = $value;\n }\n\n return $values;\n }", "private function returnMappedValue($line) {\n\t//--\n\t$array = array();\n\t$key = $this->unquote(trim(substr($line, 0, -1)));\n\t$array[$key] = '';\n\t//--\n\treturn $array;\n\t//--\n}", "function splitvalues($str)\n{\n\t$arr=array();\n\tif($str==\"\")\n\t{\n\t\t$arr[] = \"\";\n\t\treturn $arr;\n\t}\n\t$start=0;\n\t$i=0;\n\t$inquot=false;\n\twhile($i<=strlen($str))\n\t{\n\t\tif($i<strlen($str) && substr($str,$i,1)=='\"')\n\t\t\t$inquot=!$inquot;\n\t\telse if($i==strlen($str) || !$inquot && substr($str,$i,1)==',')\n\t\t{\n\t\t\t$val=substr($str,$start,$i-$start);\n\t\t\t$start=$i+1;\n\t\t\tif(strlen($val) && substr($val,0,1)=='\"')\n\t\t\t{\n\t\t\t\t$val=substr($val,1,strlen($val)-2);\n\t\t\t\t$val=str_replace('\"\"','\"',$val);\n\t\t\t}\n\t\t\t\n\t\t\tif( $val !== FALSE )\n\t\t\t$arr[]=$val;\n\t\t}\n\t\t$i++;\n\t}\n\treturn $arr;\n}", "public function urlarray($string = '') {\n $a = explode('/', strtolower($string));\n $array = array();\n $key = '';\n foreach($a as $k => $v){\n if($k % 2 == 0){\n $key = $v;\n } else {\n $array[$key] = $v;\n }\n }\n return $array;\n }", "private function _toType($value) {\n\t//--\n\tif($value === '') {\n\t\treturn null;\n\t} //end if\n\t//--\n\t$first_character = $value[0];\n\t$last_character = substr($value, -1, 1);\n\t//--\n\t$is_quoted = false;\n\tdo {\n\t\tif(!$value) {\n\t\t\tbreak;\n\t\t} //end if\n\t\tif($first_character != '\"' && $first_character != \"'\") {\n\t\t\tbreak;\n\t\t} //end if\n\t\tif($last_character != '\"' && $last_character != \"'\") {\n\t\t\tbreak;\n\t\t} //end if\n\t\t$is_quoted = true;\n\t} while (0);\n\t//--\n\tif($is_quoted) {\n\t\treturn strtr(substr($value, 1, -1), array ('\\\\\"' => '\"', '\\'\\'' => '\\'', '\\\\\\'' => '\\''));\n\t} //end if\n\t//--\n\tif(strpos($value, ' #') !== false && !$is_quoted) {\n\t\t$value = preg_replace('/\\s+#(.+)$/','',$value);\n\t} //end if\n\t//--\n\tif(!$is_quoted) {\n\t\t$value = str_replace('\\n', \"\\n\", $value);\n\t} //end if\n\t//--\n\tif($first_character == '[' && $last_character == ']') {\n\t\t// Take out strings sequences and mappings\n\t\t$innerValue = trim(substr($value, 1, -1));\n\t\tif($innerValue === '') {\n\t\t\treturn array();\n\t\t} //end if\n\t\t$explode = $this->_inlineEscape($innerValue);\n\t\t// Propagate value array\n\t\t$value = array();\n\t\tforeach($explode as $z => $v) {\n\t\t\t$value[] = $this->_toType($v);\n\t\t} //end foreach\n\t\treturn $value;\n\t} //end if\n\t//--\n\tif(strpos($value, ': ') !== false && $first_character != '{') {\n\t\t$array = explode(': ', $value);\n\t\t$key = trim($array[0]);\n\t\tarray_shift($array);\n\t\t$value = trim(implode(': ', $array));\n\t\t$value = $this->_toType($value);\n\t\treturn array($key => $value);\n\t} //end if\n\t//--\n\tif($first_character == '{' && $last_character == '}') {\n\t\t$innerValue = trim(substr($value, 1, -1));\n\t\tif($innerValue === '') {\n\t\t\treturn array();\n\t\t} //end if\n\t\t// Inline Mapping\n\t\t// Take out strings sequences and mappings\n\t\t$explode = $this->_inlineEscape($innerValue);\n\t\t// Propagate value array\n\t\t$array = array();\n\t\tforeach($explode as $z => $v) {\n\t\t\t$SubArr = $this->_toType($v);\n\t\t\tif(empty($SubArr)) {\n\t\t\t\tcontinue;\n\t\t\t} //end if\n\t\t\tif(is_array ($SubArr)) {\n\t\t\t\t$array[key($SubArr)] = $SubArr[key($SubArr)]; continue;\n\t\t\t} //end if\n\t\t\t$array[] = $SubArr;\n\t\t} //end foreach\n\t\treturn $array;\n\t} //end if\n\t//--\n\tif((string)$value == '') {\n\t\treturn '';\n\t} //end if\n\t//--\n\tif(strtolower($value) == 'null' || $value == '~') {\n\t\treturn null;\n\t} //end if\n\t//--\n\tif(is_numeric($value) && preg_match('/^(-|)[1-9]+[0-9]*$/', $value)){\n\t\t$intvalue = (int)$value;\n\t\tif($intvalue != PHP_INT_MAX) {\n\t\t\t$value = $intvalue;\n\t\t} //end if\n\t\treturn $value;\n\t} //end if\n\t//--\n\t/* this was added in v.0.5.1 but is unsafe !!\n\tif(is_numeric($value) && preg_match('/^0[xX][0-9a-fA-F]+$/', $value)) {\n\t\t// Hexadecimal value.\n\t\treturn hexdec($value);\n\t} //end if\n\t*/\n\t//--\n\tif(in_array(strtolower($value), array('true', 'on', '+', 'yes', 'y'))) {\n\t\treturn true;\n\t} //end if\n\t//--\n\tif(in_array(strtolower($value), array('false', 'off', '-', 'no', 'n'))) {\n\t\treturn false;\n\t} //end if\n\t//--\n\tif(is_numeric($value)) {\n\t\tif((string)$value == '0') {\n\t\t\treturn 0;\n\t\t} //end if\n\t\tif(rtrim($value, 0) === $value) {\n\t\t\t$value = (float)$value;\n\t\t} //end if\n\t\treturn $value;\n\t} //end if\n\t//--\n\treturn $value;\n\t//-- $k\n}", "public static function getParamsFromString($str)\n\t{\n\t\t$params = unserialize($str, [ 'allowed_classes' => false ]);\n\n\t\tif (\n\t\t\t!is_array($params)\n\t\t\t&& !empty($str)\n\t\t)\n\t\t{\n\t\t\t$tmp = explode(\"&\", $str);\n\t\t\tif (is_array($tmp) && count($tmp) > 0)\n\t\t\t{\n\t\t\t\t$params = array();\n\t\t\t\tforeach($tmp as $pair)\n\t\t\t\t{\n\t\t\t\t\tlist ($key, $value) = explode(\"=\", $pair);\n\t\t\t\t\t$params[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $params;\n\t}", "function variables_from_string($markup) {\r\n\t\t$regexp = new LiquidRegexp('/\\s*('.LIQUID_QUOTED_FRAGMENT.')\\s*/');\r\n\t\t$parts = explode(',', $markup);\r\n\t\t$result = array();\r\n\t\t\r\n\t\tforeach($parts as $part) {\r\n\t\t\t$regexp->match($part);\r\n\t\t\t\r\n\t\t\tif ($regexp->matches[1]) {\r\n\t\t\t\t$result[] = $regexp->matches[1];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t\t\r\n\t}", "function radAssocMap($inputs,$key,$noempty=false)\n {\n \t$arr = array();\n \tif(is_array($inputs))\n \t{\n \t\tforeach($inputs as $input)\n\t\t{\n\t\t\tif(isset( $input[$key]))\n\t\t\t\t{\n\t\t\t\t\tif( $noempty)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(trim( $input[$key])!=\"\")\n\t\t\t\t\t\t\t$arr[$input['name']] = stripslashes($input[$key]);\n\t\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isset($input['name'])) $arr[$input['name']] = stripslashes($input[$key]);\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t$arr[$input['name']] = false;\t\n\t\t}\n \t}\n\treturn $arr;\t\n }", "function processReqString ($req) {\r\n\r\n\t$question = explode(\"|\", $req);\r\n\tif(sizeof($req) ==0 ) {\r\n\t\techo 'error: The provided string is incorrect';\r\n\t\treturn null;\r\n\t}\r\n\t$arr = array_map(\"splitQuestions\", $question);\r\n\treturn $arr;\r\n\r\n\r\n}", "static public function load($mixed)\n {\n $d = new Data();\n return $d->l($mixed);\n }", "function initTriArray($tri_str)\n{\n\t$tri_A = explode(\"\\n\",$tri_str);\n\tfor($i = 0; $i < count($tri_A); ++$i)\n\t{\n\t\t$tri_A[$i] = explode(\" \",$tri_A[$i]); \n\n\t}\n\treturn $tri_A;\n}", "function getRaw($Str){\n\t$R = explode(';',$Str);\n\t$type = array(0,0,0,0,0,0,0,0,0); // [1] to [8] corresponds to mining PIDs\n\tforeach($R as $v){\n\t\t$entry = explode(',',$v);\n\t\t$type[$entry[0]] = $entry[1];\n\t\t$type[0] += $entry[1]; // $type[0] is the Sum of all entries\n\t}\n\treturn $type;\n}", "function genCategorStr($idstr, $catstr, $allstr){\n if (empty($idstr) || empty($catstr)) {\n return $allstr;//it was passed from str, but here it will become an array; \n } else {\n $_ids = explode(\"|\", $idstr);\n array_pop($_ids);\n array_shift($_ids);\n $_catestr = explode(\", \", $catstr);\n if (count($_ids) == count($_catestr)) {\n $categories = array_combine($_ids, $_catestr);\n return array(\"0\" => '[Website Category]') + $categories;//Here will return the array, not the string!!!!\n } else {\n return $allstr;\n }\n }\n}", "function decodeKeyValuePair($pair)\n{\n\t$operators = array(\"==\", \"!=\", \"<>\", \">=\", \"<=\", \"=\", \"<\", \">\");\n\n\tstatic $s_regex = null;\n\tif ($s_regex === null)\n\t{\n\t\t$s_regex = '/'.implode('|', array_map('preg_quote', $operators)).'/';\n\t}\n\n\tlist($key, $value) = preg_split($s_regex, $pair);\n\n\treturn array($key => stripQuotes($value));\n}", "function getItemsIdByRawString($string){\n\t$tmps = explode('|', $string);\n\t\n\t$result = array();\n\t\n\tforeach($tmps as $tmp){\n\t\t$id = substr($tmp, 1);\n\t\t$result[count($result)] = $id;\n\t}\n\t\n\treturn $result;\n}", "function decodeKeyValueSet($set)\n{\n\t$result = array();\n\t$items = explode(\" AND \",$set);\n\tfor ($i=0;$i<count($items);$i++)\n\t{\n\t\tif (strstr($items[$i], '!=') !== false)\n\t\t{\n\t\t\tlist($key,$value) = explode(\"!=\",$items[$i]);\n\t\t\t$result[trim($key)] = stripQuotes($value);\n\t\t}\n\t\telseif (strstr($items[$i], '=') !== false)\n\t\t{\n\t\t\tlist($key,$value) = explode(\"=\",$items[$i]);\n\t\t\t$result[trim($key)] = stripQuotes($value);\n\t\t}\n\t\telseif (stristr($items[$i], 'IS NULL') !== false)\n\t\t{\n\t\t\tlist($key) = preg_split('/IS NULL/i', $items[$i]);\n\t\t\t$result[trim($key)] = NULL;\n\t\t}\n\t}\n\treturn $result;\n}", "static function parseAttributes($attributes)\n {\n $map = array();\n $count = preg_match_all(\"!(\\w[\\w-]+)=([\\w\\\\\\/\\.%]+|([\\'\\\"])(.+?)\\\\3)!\", $attributes, $matches);\n for ($j = 0 ; $j < $count ; $j++)\n {\n list($key, $value, $unquotedValue) = array($matches[1][$j],$matches[2][$j],$matches[4][$j]);\n $map[$key] = !empty($unquotedValue) ? $unquotedValue : $value ;\n }\n return $map ;\n }", "function strTojugada($str){\n $v = explode(\",\",$str);\n $re['palabra'] = preg_replace(\"/'/\", '', trim($v[1]));\n $re['ini']['x'] = trim(str_replace(\"(\",'',$v[2]));\n $re['ini']['y'] = trim(str_replace(\")\",'',$v[3]));\n $re['end']['x'] = trim(str_replace(\"(\",'',$v[4]));\n $re['end']['y'] = trim(str_replace(\")\",'',$v[5]));\n if($re['ini']['y']==$re['end']['y']) $re['o'] = 'h';\n if($re['ini']['x']==$re['end']['x']) $re['o'] = 'v';\n\t\t\techo '<pre>';\n\t\t\tvar_dump($re);\n\t\t\techo '<pre>';\n return $re;\n }", "function smarty_modifier_array ($str, $blnLabels = FALSE)\n{\n\t\n\t$arr\t= explode (',', $str);\n\t\n\tif ($blnLabels)\n\t{\n\t\t\n\t\t$arrTmp\t= array ();\n\t\t\n\t\tforeach ($arr as $strVal)\n\t\t{\n\t\t\t\n\t\t\t$arrTmp[$strVal]\t= $strVal;\n\t\t\t\n\t\t}\n\t\t\n\t\t$arr\t= $arrTmp;\n\t\t\n\t}\n\t\n\treturn $arr;\n\t\n}", "function tidy_repair_string($data, $config = null, $encoding = null) {}" ]
[ "0.5898791", "0.5609636", "0.5327343", "0.52875704", "0.5141591", "0.5137075", "0.51131463", "0.51128757", "0.50913817", "0.50835985", "0.50608987", "0.500591", "0.50053555", "0.49929816", "0.49924803", "0.49763998", "0.49590722", "0.49411497", "0.4928098", "0.4925628", "0.48607564", "0.48565745", "0.48382884", "0.4834299", "0.48257157", "0.48209548", "0.4820035", "0.47977388", "0.4796813", "0.47678182", "0.47560647", "0.46947595", "0.46928197", "0.4692388", "0.46768567", "0.46572867", "0.46513692", "0.46490914", "0.46481803", "0.4640531", "0.4622532", "0.46204472", "0.4585912", "0.4571769", "0.4569098", "0.45604467", "0.45573732", "0.45496088", "0.45289695", "0.45271295", "0.45223746", "0.45208797", "0.450019", "0.449407", "0.4489897", "0.44615072", "0.44610423", "0.44538283", "0.4452276", "0.44514304", "0.44402534", "0.44285285", "0.44204062", "0.44185957", "0.44106942", "0.439241", "0.43913004", "0.4390647", "0.43894354", "0.43824783", "0.4380845", "0.43807313", "0.43751073", "0.43740222", "0.4373235", "0.43714318", "0.43702903", "0.43702903", "0.43675324", "0.4364658", "0.43458414", "0.43357787", "0.4330783", "0.43286484", "0.43256682", "0.43255773", "0.4325205", "0.43212855", "0.4311569", "0.4293846", "0.42896056", "0.42888525", "0.42877987", "0.4278392", "0.42660716", "0.42658323", "0.42650425", "0.42628628", "0.42480493", "0.42442444" ]
0.60718274
0
String length of HTML minus the HTML
public static function strlen(string $html_content): int { return strlen(self::strip($html_content)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getElementTextLength();", "public function getTextLength();", "public function length() {\r\n return strlen($this->contents);\r\n }", "function getLength() {\n\t\treturn $this->getAttribute(DOMIT_RSS_ATTR_LENGTH);\n\t}", "public function get_bodylength() {\n return \"Lichaamslengte = \" . $this->bodylength . \"m\";\n }", "public function getLength();", "function getLength(?string $content = null): int\n{\n if (!isset($content)) {\n return 0;\n }\n return grapheme_strlen(strip_tags($content));\n}", "function length(){\n\t\t//return strlen($this->_String4);\n\t\treturn Translate::Length($this->_String4,$this->getEncoding());\n\t}", "public function length() {\n \n return $this->getLength();\n }", "public function getLength() {}", "public function getLength() {}", "public function getLength() {}", "public function getLength() {}", "public function getTotalLength();", "public function getTotalLength();", "private final function getLength() {\n\t\t\treturn $this->length;\n\t\t}", "public function getTextLength()\n\t{\n\t\treturn $this->textLength;\n\t}", "public function getLength(): int;", "public function getLength(): int;", "public function length()\n {\n return UTF8::strlen($this->str, $this->encoding);\n }", "abstract public function getLength();", "public function length()\n {\n return $this->length;\n }", "function wprt_content_length() {\n\t$length = wprt_get_mod( 'blog_excerpt_length', '55' );\n\n\treturn $length;\n}", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getTotalLength() {}", "public function getTotalLength() {}", "function txt_mb_strlen( $t )\n\t{\n\t\treturn strlen( preg_replace(\"/&#([0-9]+);/\", \"-\", $this->txt_stripslashes( $t ) ) );\n }", "public function getSize(): int {\n\t\treturn mb_strlen($this->getContent());\n\t}", "public function strlen($date)\n {\n echo \"<h3><u> length of a string of $date </h2></u>\";\n $a=strlen($date);\n echo $a;\n echo \"<hr>\";\n }", "public function getContentLength() { return $this->content_length; }", "public function getLength()\r\n {\r\n return $this->length;\r\n }", "function _quail_server_count_nodes($html) {\n\treturn substr_count($html, '<');\n}", "public function getLength()\n\t\t{\n\t\t\treturn $this->length;\n\t\t}", "public function getLength() {\r\n return $this->length;\r\n }", "public function getLength()\n {\n return strlen($this->data);\n }", "public static function taggedStrLen($str)\n {\n return mb_strlen(preg_replace('/\n<[^>]*>/u', '', $str));\n }", "public function getRemainingLength()\n {\n return $this->remaining_length;\n }", "public function length();", "public function length();", "public function length()\n {\n return $this->provider->length();\n }", "public function getLength()\n {\n return 0;\n }", "public function getLength() {\n return $this->_length;\n }", "function pun_strlen($str)\r\n{\r\n\treturn strlen(preg_replace('/&#([0-9]+);/', '!', $str));\r\n}", "public function getLength() {\n \n return $this->_length;\n }", "function getLength ()\n\t{\n\t\treturn $this->_len ; \n\t}", "function getLength(): int\n {\n return $this->length;\n }", "public function length()\n\t{\n\t\treturn (sizeof($this->shortcodes));\n\t}", "function be_excerpt_length( $length ) { \n\t\n\t$length = '40'; \n\t\n\treturn $length;\n\t \n\t}", "public function getLen()\n {\n return $this->_len;\n }", "function ti_excerpt_length( $length ) {\n\treturn 24;\n}", "#[\\ReturnTypeWillChange]\n public function count() {\n return mb_strlen($this->string);\n }", "public function getContentLength() {\r\n return $this->__contentLength;\r\n }", "protected function get_length(): int\n\t{\n\t\treturn $this->end - $this->start + 1;\n\t}", "public function getLength(): ?string\n {\n $this->length = $this->DateStart->diff( $this->DateEnd, FALSE);\n return $this->length->format('%d');\n }", "function uwmadison_excerpt_length( $length ) {\n\t\treturn 40;\n\t}", "public function getCharLength();", "public function contentLength()\n {\n return strlen($this->body());\n }", "public function getLength() {\n\t\treturn null;\n\t}", "public function lenLiteral() {\n if ($this->_m_lenLiteral !== null)\n return $this->_m_lenLiteral;\n $this->_m_lenLiteral = ($this->isLenLiteralSeparate() ? $this->lenLiteralSeparate() : ($this->lenLiteralM1InTag() + 1));\n return $this->_m_lenLiteral;\n }", "public function getContentLength(): int\n {\n return $this->length;\n }", "public function getContentLength()\r\n\t{\r\n\t\treturn strlen($this->m_content);\r\n\t}", "public function getOutputLength();", "function acf_strlen($str)\n{\n}", "public function getTextWidth() {}", "private function countLength() {\n\n $this->_length = strlen($this->_value);\n }", "function d4tw_excerpt_length( $length ) {\n return 20;\n}", "function tz_excerpt_length($length) {\nreturn 55; }", "public function length() {\n return $this->count();\n }", "function xo_excerpt_length( $length ) {\n return 12;\n}", "public function length()\n {\n return $this->count();\n }", "public function getCompleteLength()\n {\n return $this->complete_length;\n }", "function wpe_excerptlength_homelatest($length) {\n return 13;\n}", "public function length() {\r\n return filesize($this->fullName());\r\n }", "public function count() {\n \n return $this->getLength();\n }", "public function getLength($id) {\r\n\t\t$contents = file_get_contents('http://m.youtube.com/watch?v=' . $id);\r\n\t\t$length = preg_match('/<div>([0-9:]*)&nbsp;/', $contents, $matches);\r\n\t\treturn ($this->JSON != 1) ? $matches[1] : json_encode($matches[1]);\r\n\t}", "public function size(): int\n {\n return $this->content->size();\n }", "function tn_custom_excerpt_length( $length ) {\r\n\t\treturn 15;\r\n\t\t}", "function getSubString($string, $length=NULL){\n if ($length == NULL)\n $length = 50;\n //Primero eliminamos las etiquetas html y luego cortamos el string\n $stringDisplay = substr(strip_tags($string), 0, $length);\n //Si el texto es mayor que la longitud se agrega puntos suspensivos\n if (strlen(strip_tags($string)) > $length)\n $stringDisplay .= ' ...';\n return $stringDisplay;\n}", "function twentyten_excerpt_length( $length ) {\n\treturn 40;\n}", "function twentyten_excerpt_length( $length ) {\n\treturn 40;\n}", "function rocked_excerpt_length( $length ) {\n\t$excerpt = get_theme_mod('exc_lenght', '55');\n\treturn $excerpt;\n}", "public function length() : int;", "public function flowControlledLength()\n {\n $padding_len = ($this->padding_length) ? $this->padding_length + 1 : 0;\n return strlen($this->data) + $padding_len;\n }", "public function origLen() { return $this->_m_origLen; }", "function wpt_excerpt_length( $length ) {\n\treturn 40;\n}", "function voyage_mikado_excerpt_length($length) {\n\n if(voyage_mikado_options()->getOptionValue('number_of_chars') !== '') {\n return esc_attr(voyage_mikado_options()->getOptionValue('number_of_chars'));\n } else {\n return 45;\n }\n }", "function darksnow_excerpt_length( $length ) {\n\treturn 40;\n}", "public function length()\n {\n return strlen($this->buffer);\n }", "public function excerpt_length($length) {\n\t\tglobal $wpv_loop_vars;\n\n\t\tif(isset($wpv_loop_vars) && $wpv_loop_vars['news'])\n\t\t\treturn 15;\n\n\t\treturn $length;\n\t}", "function wpex_new_excerpt_length($length) {\n\n\treturn 50;\n\n}", "public function getQueryStringLengthValue()\n {\n return $this->readWrapperValue(\"query_string_length\");\n }", "function rls_text_excerpt($length) {\n return 25;\n}", "function getLength(){\n\t\t$out = 0;\n\t\tfor($i=0;$i<sizeof($this->_Items);$i++){\n\t\t\t$out = $out + $this->_Items[$i]->getLength();\n\t\t}\n\t\treturn $out;\n\t}" ]
[ "0.7171381", "0.71345556", "0.7038034", "0.68024737", "0.6757246", "0.66371256", "0.66020584", "0.659037", "0.6510369", "0.6506391", "0.6506391", "0.6506391", "0.6506371", "0.64997435", "0.64997435", "0.64517134", "0.64210737", "0.6415625", "0.6415625", "0.6411896", "0.64112324", "0.6382607", "0.63726866", "0.6366932", "0.6366932", "0.6366932", "0.6366932", "0.6366932", "0.6366932", "0.6366932", "0.6366932", "0.63544405", "0.63542104", "0.634307", "0.633623", "0.63204473", "0.63188946", "0.630796", "0.63034385", "0.6285861", "0.6276436", "0.6275573", "0.62423205", "0.62364984", "0.6236061", "0.6236061", "0.62360007", "0.623122", "0.6224214", "0.6167401", "0.61555326", "0.61553794", "0.61512965", "0.6141914", "0.6130202", "0.6117044", "0.6112473", "0.61038584", "0.60983247", "0.60961103", "0.6090341", "0.60873675", "0.60834694", "0.60709995", "0.60687345", "0.6064397", "0.6042379", "0.6035678", "0.6023802", "0.6010444", "0.6001591", "0.5999155", "0.59884936", "0.5986439", "0.5968351", "0.5962789", "0.595774", "0.5951097", "0.59507483", "0.59470713", "0.5927433", "0.59198874", "0.5918666", "0.5914363", "0.5912508", "0.59099615", "0.59099615", "0.5906073", "0.5896608", "0.5893752", "0.58927596", "0.5885456", "0.5882309", "0.5881954", "0.5875312", "0.5874107", "0.5873729", "0.5861945", "0.5834579", "0.5829438" ]
0.7199639
0
Retrieve a substring of HTML while keeping the HTML valid.
public static function substr(string $html, int $offset = 0, int $length = null): string { $matches = false; if (!preg_match_all('/(<[A-Za-z0-9:_]+\s*[^>]*>|<\/[A-Za-z0-9:_]+>)/', $html, $matches, PREG_OFFSET_CAPTURE)) { $length = $length === null ? strlen($html) : $length; return substr($html, $offset, $length); } $stack = []; $text_offset = 0; $html_offset = 0; $result = ''; foreach ($matches[0] as $match) { [$tag, $tag_offset] = $match; if ($tag_offset > $html_offset) { $add_chars = $tag_offset - $html_offset; if ($text_offset + $add_chars > $length) { $add_chars = $length - $text_offset; $result .= substr($html, $html_offset, $add_chars); // $html_offset += $add_chars; break; } else { $result .= substr($html, $html_offset, $add_chars); $html_offset += $add_chars; $text_offset += $add_chars; } } $html_offset += strlen($tag); $end_tag = self::isEndTag($tag); if ($end_tag) { while (count($stack) > 0) { $stack_top = array_pop($stack); if ($stack_top === $end_tag) { $result .= $tag; $tag = false; break; } else { $result .= "<$end_tag><!-- Inserted missing start tag --></$end_tag>"; } } if ($tag) { $result .= "<$end_tag><!-- Inserted missing start tag --></$end_tag>"; } } else { $result .= $tag; $tags = self::parseTags($tag); foreach (array_keys($tags) as $start_tag) { $stack[] = $start_tag; } } } while (count($stack) > 0) { $end_tag = array_pop($stack); $result .= "</$end_tag>"; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function get_html();", "public function str_get_html() {\n\t\treturn call_user_func_array ( '\\Remios\\Utils\\Adapters\\simplehtmldom\\str_get_html' , func_get_args() );\n\t}", "abstract function get_html();", "static public function str_get_html() {\n\t\treturn call_user_func_array ( '\\str_get_html' , func_get_args() );\n\t}", "static public function str_get_html() {\n\t\treturn call_user_func_array ( '\\str_get_html' , func_get_args() );\n\t}", "public function getHTML();", "function _cut_html($str) {\n $str=preg_replace(\"'<[\\/\\!]*?[^<>]*?>'si\",\"\",$str);\n return $str;\n }", "public function getHTML(): string;", "function st_get_substr($str,$n=150,$more='...')\r{\r $str = strip_tags($str);\r if(strlen($str)<$n) return $str;\r $html = substr($str,0,$n);\r $html = substr($html,0,strrpos($html,' '));\r return $html.$more;\r}", "public static function getSubString($string, $length=NULL)\n{\n if ($length == NULL)\n $length = 50;\n //Primero eliminamos las etiquetas html y luego cortamos el string\n $stringDisplay = substr(strip_tags($string), 0, $length);\n //Si el texto es mayor que la longitud se agrega puntos suspensivos\n if (strlen(strip_tags($string)) > $length)\n $stringDisplay .= ' ...';\n return $stringDisplay;\n}", "function getSlice(int $start, int $end): string\n {\n if ($start === $end || $start < 0 || $end < 0) {\n return '';\n }\n\n if ($start < $end) {\n return (string) substr($this->html, $start, $end - $start);\n } else {\n return (string) substr($this->html, $end, $start - $end);\n }\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 }", "abstract public function getHtml();", "function getSubString($string, $length=NULL){\n if ($length == NULL)\n $length = 50;\n //Primero eliminamos las etiquetas html y luego cortamos el string\n $stringDisplay = substr(strip_tags($string), 0, $length);\n //Si el texto es mayor que la longitud se agrega puntos suspensivos\n if (strlen(strip_tags($string)) > $length)\n $stringDisplay .= ' ...';\n return $stringDisplay;\n}", "function util_textContent($in_haystack, $in_tag)\r\n{\r\n\t$innerstring = util_innerString($in_haystack, \"<{$in_tag} \", \"</{$in_tag}>\", FALSE);\r\n\tif ($innerstring) {\r\n\t\treturn substr($innerstring, (strpos($innerstring, '>') + 1));\r\n\t} else {\r\n\t\treturn util_innerString($in_haystack, \"<{$in_tag}>\", \"</{$in_tag}>\", FALSE);\r\n\t}\r\n}", "public function tidyHtml(string $html): string\n {\n // some point.\n return $html;\n }", "function extract_html_tag($line) {\n if (preg_match(self::REGEX_CODE, $line)) {\n return preg_replace(self::REGEX_CODE, '\\1', $line);\n }\n }", "public function getHTML($data);", "public function getText(): string {\n\t\t$html = $this->getHTML();\n\t\treturn Sanitizer::stripAllTags( $html );\n\t}", "public abstract function cleanHTML($content);", "function string_get_between($content,$start,$end){\n\t$r = explode($start, $content);\n\tif (isset($r[1])){\n\t\t$r = explode($end, $r[1]);\n\t\treturn $r[0];\n\t}\n\treturn '';\n}", "public function scanHTML($string) {\n $scanner = new HTML\\Scanner($this->htmlConfig);\n return $scanner->scan($string) . $scanner->end();\n }", "public static function strGetHtml($string) {\n\n\t\t$pathToSimpleHtmlDom = app_path('/Lib/Vendor/simple_html_dom.php');\n\t\trequire_once $pathToSimpleHtmlDom;\n\n\t\treturn str_get_html($string);\n\n\t}", "function html_body($html) {\n\t\tif (strpos($html, '<body') !== false) {\n\t\t\t$html = substr($html, strpos($html, '<body')+5);\n\t\t\t$html = substr($html, strpos($html, '>')+1);\n\t\t\t$html = substr($html, 0, strpos($html, '</body>'));\n\t\t}\n\t\treturn $html;\n\t}", "private function parseContents($html)\n {\n if (ltrim($html) == '') {\n return '';\n }\n \n /* do we really have tags to omit parsing for?!?\n // Don't parse contents of \"iframe\" element.\n if ($this->name == 'iframe') {\n return $this->parseNoContents('iframe', $html);\n }\n\n // Only TEXT inside a \"script\" element.\n if ($this->name == 'script') {\n return $this->parseForeignContents('script', $html);\n }\n\n // Only TEXT inside a \"style\" element.\n if ($this->name == 'style') {\n return $this->parseForeignContents('style', $html);\n }\n */\n \n // Parse contents one token at a time.\n $remainingHtml = $html;\n while (preg_match(\"/^\\s*<\\/\\s*\".$this->name.\"\\s*>/is\", $remainingHtml) === 0) {\n $token = TokenFactory::buildFromHtml(\n $remainingHtml,\n $this,\n //false \n $this->getThrowOnError()\n );\n\n if ($token === false || $token->isClosingElementImplied($remainingHtml)) {\n return $remainingHtml;\n }\n \n if (!is_array($this->children)) {\n $this->children = array();\n }\n $remainingHtml = $token->parse($remainingHtml);\n $this->children[] = $token;\n }\n\n // Remove last token if contains only whitespace.\n if (!empty($this->children)) {\n $lastChildArray = array_slice($this->children, -1);\n $lastChild = array_pop($lastChildArray);\n if ($lastChild->isText() && trim($lastChild->getValue()) == '') {\n array_pop($this->children);\n }\n }\n\n // Remove remaining closing tag.\n $posOfClosingBracket = mb_strpos($remainingHtml, '>');\n\n return mb_substr($remainingHtml, $posOfClosingBracket + 1);\n }", "function extractString($url, $start, $end) {\r\n $url = \" \".$url;\r\n $ini = strpos($url, $start);\r\n if ($ini == 0) return \"\";\r\n $ini += strlen($start);\r\n $len = strpos($url, $end, $ini) - $ini;\r\n return substr($url, $ini, $len);\r\n}", "public function getHtml();", "public abstract function html(): string;", "function getSubString($string, $length=NULL) {\n if ($length == NULL)\n $length = 45;\n //Primero eliminamos las etiquetas html y luego cortamos el string\n $stringDisplay = substr(strip_tags($string), 0, $length);\n //Si el texto es mayor que la longitud se agrega puntos suspensivos\n if (strlen(strip_tags($string)) > $length)\n $stringDisplay .= ' ...';\n return $stringDisplay;\n }", "function non_DOM_stripme($opening_tag_string) {\r\n\t\tpreg_match_all('/' . $opening_tag_string . '/is', $this->code, $matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\t//print(\"matches[0][size][0]: \");var_dump($matches[0][$size][0]);\r\n\t\t\tpreg_match('/<(\\w+)/is', $matches[0][$size][0], $tagname_matches);\r\n\t\t\t$tagname = $tagname_matches[1];\r\n\t\t\t$OString = OM::getOString($this->code, '<' . $tagname, '</' . $tagname . '>', $matches[0][$size][1]);\r\n\t\t\t//print(\"strlen(matches[0][size][0]): \");var_dump(strlen($matches[0][$size][0]));\r\n\t\t\t$substr = substr($OString, strlen($matches[0][$size][0]), strlen($OString) - strlen($matches[0][$size][0]) - (strlen($tagname) + 3));\r\n\t\t\t//print(\"OString: \");var_dump($OString);\r\n\t\t\t//print(\"substr: \");var_dump($substr);\r\n\t\t\t//$this->code = str_replace($OString, $substr, $this->code);\r\n\t\t\t$this->code = substr($this->code, 0, $matches[0][$size][1]) . $substr . substr($this->code, $matches[0][$size][1] + strlen($OString));\r\n\t\t\t$size--;\r\n\t\t}\r\n\t}", "public function getPlaintext(){\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// Strip scripts\n\t\twhile(($r = $dom->getElementsByTagName(\"script\")) && $r->length){\n $r->item(0)->parentNode->removeChild($r->item(0));\n\t\t}\n\t\t\n\t\t// Strip styles\n\t\twhile(($r = $dom->getElementsByTagName(\"style\")) && $r->length){\n $r->item(0)->parentNode->removeChild($r->item(0));\n\t\t}\n\t\t\n\t\t$plainText = $dom->textContent;\n\t\treturn self::stripWhitespace($plainText);\n\t}", "public function html(): string;", "function cropMainText($body = \"\") {\n $body = substr($body,strpos($body,'<div class=txt>'));\n if(strpos($body,'Знайти слова на сторiнцi') > 0){\n return substr($body,0,strpos($body,'Знайти слова на сторiнцi'));\n }\n else if(strpos($body,'Пошук') > 0){\n return $body;\n }else{\n print_r($body);\n die();\n }\n}", "public function getHTML(){\n\t\treturn $this->html;\n\t}", "function chopInnerText($haystack, $startNeedle, $endNeedle, $loopthru=1, $keepvars=0)\n{\t\n\n\t$pstr=$haystack;\n\t$pos=getInnerStrpos($haystack, $startNeedle, $endNeedle);\n\t\n\tif(is_numeric($pos[0]) && is_numeric($pos[1]))\n\t{\n\t\tif($loopthru)\n\t\t{\t\n\t\t\t$tstr=$pstr;\n\t\t\t$pstr=\"\";\n\t\t\twhile(is_numeric($pos[0]) && is_numeric($pos[1]))\n\t\t\t{\n\t\t\t\tif($keepvars)\n\t\t\t\t{\n\t\t\t\t\t$pstr.=substr($tstr,0,$pos[0]+strlen($startNeedle));\n\t\t\t\t\t$tstr=substr($tstr,$pos[0]+$pos[1],strlen($tstr));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$pstr.=substr($tstr,0,$pos[0]);\n\t\t\t\t\t$tstr=substr($tstr,$pos[0]+$pos[1],strlen($tstr));\n\t\t\t\t}\n\t\t\t\t$pos=getInnerStrpos($tstr, $startNeedle, $endNeedle);\n\t\t\t}\n\t\t\t\n\t\t\t$pstr.=substr($tstr,0,strlen($tstr)+1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($keepvars)\n\t\t\t{\n\t\t\t\t$pstr=substr($haystack,0,$pos[0]+strlen($startNeedle));\n\t\t\t\t$pstr.=substr($haystack,$pos[1]+$pos[0]-strlen($endNeedle),strlen($haystack));\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pstr=substr($haystack,0,$pos[0]);\n\t\t\t\t$pstr.=substr($haystack,$pos[1]+$pos[0],strlen($haystack));\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\treturn $pstr;\n}", "public static function getHTMLContent($text) {\r\n \r\n \r\n \r\n if(strpos($text,'<div id=\"content\">') !== false && strstr($text, '<div id=\"content\">', true) == \"\") {\r\n //the div element with id=content is the first element so I remove it\r\n $text = substr($text, strlen('<div id=\"content\">'));\r\n $text = trim(substr($text, 0, strlen($text)-strlen('</div>')));\r\n }\r\n \r\n return $text;\r\n\t}", "public function html(): string\n {\n $parser = new \\Parsedown();\n return $parser->text($this->data);\n }", "function somehtml($nohtml) {\n\t\t$nohtml = str_replace(\"&#124;\", \"|\", $nohtml);\n\t\treturn stripslashes(strip_tags($nohtml, '<p><a><font><ul><li><h1><h2><h3><h4><h5><h6><hr><b><u><i><strong><em><table><tr><td><tbody><tfoot><span><div><br><br /><blockquote><img><embed><object><form><input>'));\n\t}", "private function html($text) {\r\n return $text;\r\n }", "function extract_tag( $html, $tag = 'div' )\n\t{\n\t\t$html = preg_replace( \"/(\\<\" . $tag . \")(.*?)(\" . $tag . \">)/si\", \"dada\", \"$html\" );\n\t\t$html = strip_tags( $html );\n\t\t$html = str_replace( \"<!--\", \"&lt;!--\", $html );\n\t\t$html = preg_replace( \"/(\\<)(.*?)(--\\>)/mi\", \"\" . nl2br( \"\\\\2\" ) . \"\", $html );\n\n\t\treturn $html;\n\t}", "public function fetchHTML()\n {\n return $this->fetch();\n }", "function filter_html($as_admin,$source_member,$pos,&$len,&$comcode,$in_html,$in_semihtml)\n{\n\tif ((!$as_admin) && (!has_specific_permission($source_member,'use_very_dangerous_comcode')))\n\t{\n\t\tglobal $POTENTIAL_JS_NAUGHTY_ARRAY;\n\n\t\t$comcode=preg_replace('#(\\\\\\\\)+(\\[/(html|semihtml)\\])#','\\2',$comcode); // Stops sneaky trying to trick the end of the HTML tag to hack this function\n\n\t\tif (($in_html) && ($in_semihtml)) $ahead_end=max(strpos(strtolower($comcode),'[/html]',$pos),strpos(strtolower($comcode),'[/semihtml]',$pos));\n\t\telseif ($in_html) $ahead_end=strpos(strtolower($comcode),'[/html]',$pos);\n\t\telseif ($in_semihtml) $ahead_end=strpos(strtolower($comcode),'[/semihtml]',$pos);\n\t\telse $ahead_end=false;\n\t\tif ($ahead_end===false) $ahead_end=strlen($comcode);\n\t\t$ahead=substr($comcode,$pos,$ahead_end-$pos);\n\n\t\trequire_code('input_filter');\n\t\thard_filter_input_data__html($ahead);\n\n\t\t// Tidy up\n\t\t$comcode=substr($comcode,0,$pos).$ahead.substr($comcode,$ahead_end);\n\t\t$len=strlen($comcode);\n\t}\n}", "public function substr($start, $length) {\r\n return substr($this->contents, $start, $length);\r\n }", "public function cropHtmlWorksWithLinebreaks() {}", "function string_truncate_string($str, $length = 100, $ending = '...', $exact = false, $considerHtml = true)\r\n\t{\r\n\t\tif ($considerHtml)\r\n\t\t{\r\n\t\t\t// if the plain text is shorter than the maximum length, return the whole text\r\n\t\t\tif (strlen(preg_replace('/<.*?>/', '', $str)) <= $length)\r\n\t\t\t{\r\n\t\t\t\treturn $str;\r\n\t\t\t}\r\n\t\t\t// splits all html-tags to scanable lines\r\n\t\t\tpreg_match_all('/(<.+?>)?([^<>]*)/s', $str, $lines, PREG_SET_ORDER);\r\n\t\t\t$total_length = strlen($ending);\r\n\t\t\t$open_tags = array();\r\n\t\t\t$truncate = '';\r\n\t\t\tforeach ($lines as $line_matchings)\r\n\t\t\t{\r\n\t\t\t\t// if there is any html-tag in this line, handle it and add it (uncounted) to the output\r\n\t\t\t\tif (!empty($line_matchings[1]))\r\n\t\t\t\t{\r\n\t\t\t\t\t// if it's an \"empty element\" with or without xhtml-conform closing slash (f.e. <br/>)\r\n\t\t\t\t\tif (preg_match('/^<(\\s*.+?\\/\\s*|\\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\\s.+?)?)>$/is', $line_matchings[1]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// do nothing\r\n\t\t\t\t\t// if tag is a closing tag (f.e. </b>)\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (preg_match('/^<\\s*\\/([^\\s]+?)\\s*>$/s', $line_matchings[1], $tag_matchings))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// delete tag from $open_tags list\r\n\t\t\t\t\t\t$pos = array_search($tag_matchings[1], $open_tags);\r\n\t\t\t\t\t\tif ($pos !== false) {\r\n\t\t\t\t\t\t\tunset($open_tags[$pos]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t// if tag is an opening tag (f.e. <b>)\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (preg_match('/^<\\s*([^\\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// add tag to the beginning of $open_tags list\r\n\t\t\t\t\t\tarray_unshift($open_tags, strtolower($tag_matchings[1]));\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// add html-tag to $truncate'd text\r\n\t\t\t\t\t$truncate .= $line_matchings[1];\r\n\t\t\t\t}\r\n\t\t\t\t// calculate the length of the plain text part of the line; handle entities as one character\r\n\t\t\t\t$content_length = strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));\r\n\t\t\t\tif ($total_length+$content_length> $length)\r\n\t\t\t\t{\r\n\t\t\t\t\t// the number of characters which are left\r\n\t\t\t\t\t$left = $length - $total_length;\r\n\t\t\t\t\t$entities_length = 0;\r\n\t\t\t\t\t// search for html entities\r\n\t\t\t\t\tif (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// calculate the real length of all entities in the legal range\r\n\t\t\t\t\t\tforeach ($entities[0] as $entity)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif ($entity[1]+1-$entities_length <= $left)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$left--;\r\n\t\t\t\t\t\t\t\t$entities_length += strlen($entity[0]);\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// no more characters left\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$truncate .= substr($line_matchings[2], 0, $left+$entities_length);\r\n\t\t\t\t\t// maximum lenght is reached, so get off the loop\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$truncate .= $line_matchings[2];\r\n\t\t\t\t\t$total_length += $content_length;\r\n\t\t\t\t}\r\n\t\t\t\t// if the maximum length is reached, get off the loop\r\n\t\t\t\tif ($total_length>= $length)\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (strlen(strip_tags($str)) <= $length)\r\n\t\t\t{\r\n\t\t\t\treturn strip_tags($str);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$truncate = substr(strip_tags($str), 0, $length - strlen($ending));\r\n\t\t\t}\r\n\t\t}\r\n\t\t// if the words shouldn't be cut in the middle...\r\n\t\tif (!$exact)\r\n\t\t{\r\n\t\t\t// ...search the last occurance of a space...\r\n\t\t\t$spacepos = strrpos($truncate, ' ');\r\n\t\t\tif (isset($spacepos))\r\n\t\t\t{\r\n\t\t\t\t// ...and cut the text in this position\r\n\t\t\t\t$truncate = substr($truncate, 0, $spacepos);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// add the defined ending to the text\r\n\t\t$truncate .= $ending;\r\n\t\tif ($considerHtml)\r\n\t\t{\r\n\t\t\t// close all unclosed html-tags\r\n\t\t\tforeach ($open_tags as $tag)\r\n\t\t\t{\r\n\t\t\t\t$truncate .= '</' . $tag . '>';\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $truncate;\r\n\t}", "function getHtml(?array $element = null): string\n {\n return $element !== null\n ? substr($this->html, $element['start'], $element['end'] - $element['start'])\n : $this->html;\n }", "public function loadHTML($string) {\n $input = new HTML5_Inputstream_String($string);\n\n return $this->parse($input);\n }", "public function getHTML(): string {\n\t\t$fragment = $this->getRange()->cloneContents();\n\t\tCommentModifier::unwrapFragment( $fragment );\n\t\treturn DOMUtils::getFragmentInnerHTML( $fragment );\n\t}", "public function getExtract(string $content,$start,$lenght,$endStr)\n\t{\n\n $str = mb_substr($content, $start, $lenght - strlen($endStr) + 1, 'UTF-8');\n\n\t\t$extract = substr($str, 0, strrpos($str, ' ')) . $endStr . ' ...';\n\n\t\treturn $extract;\n\n\t}", "public function safeHtmlToNormalHtml(string $html): string;", "function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true) {\r\n if ($considerHtml) {\r\n // if the plain text is shorter than the maximum length, return the whole text\r\n if (strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\r\n return $text;\r\n }\r\n // splits all html-tags to scanable lines\r\n preg_match_all('/(<.+?>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER);\r\n $total_length = strlen($ending);\r\n $open_tags = array();\r\n $truncate = '';\r\n foreach ($lines as $line_matchings) {\r\n // if there is any html-tag in this line, handle it and add it (uncounted) to the output\r\n if (!empty($line_matchings[1])) {\r\n // if it's an \"empty element\" with or without xhtml-conform closing slash\r\n if (preg_match('/^<(\\s*.+?\\/\\s*|\\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\\s.+?)?)>$/is', $line_matchings[1])) {\r\n // do nothing\r\n // if tag is a closing tag\r\n } else if (preg_match('/^<\\s*\\/([^\\s]+?)\\s*>$/s', $line_matchings[1], $tag_matchings)) {\r\n // delete tag from $open_tags list\r\n $pos = array_search($tag_matchings[1], $open_tags);\r\n if ($pos !== false) {\r\n unset($open_tags[$pos]);\r\n }\r\n // if tag is an opening tag\r\n } else if (preg_match('/^<\\s*([^\\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings)) {\r\n // add tag to the beginning of $open_tags list\r\n array_unshift($open_tags, strtolower($tag_matchings[1]));\r\n }\r\n // add html-tag to $truncate'd text\r\n $truncate .= $line_matchings[1];\r\n }\r\n // calculate the length of the plain text part of the line; handle entities as one character\r\n $content_length = strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));\r\n if ($total_length+$content_length> $length) {\r\n // the number of characters which are left\r\n $left = $length - $total_length;\r\n $entities_length = 0;\r\n // search for html entities\r\n if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE)) {\r\n // calculate the real length of all entities in the legal range\r\n foreach ($entities[0] as $entity) {\r\n if ($entity[1]+1-$entities_length <= $left) {\r\n $left--;\r\n $entities_length += strlen($entity[0]);\r\n } else {\r\n // no more characters left\r\n break;\r\n }\r\n }\r\n }\r\n $truncate .= substr($line_matchings[2], 0, $left+$entities_length);\r\n // maximum lenght is reached, so get off the loop\r\n break;\r\n } else {\r\n $truncate .= $line_matchings[2];\r\n $total_length += $content_length;\r\n }\r\n // if the maximum length is reached, get off the loop\r\n if($total_length>= $length) {\r\n break;\r\n }\r\n }\r\n } else {\r\n if (strlen($text) <= $length) {\r\n return $text;\r\n } else {\r\n $truncate = substr($text, 0, $length - strlen($ending));\r\n }\r\n }\r\n // if the words shouldn't be cut in the middle...\r\n if (!$exact) {\r\n // ...search the last occurance of a space...\r\n $spacepos = strrpos($truncate, ' ');\r\n if (isset($spacepos)) {\r\n // ...and cut the text in this position\r\n $truncate = substr($truncate, 0, $spacepos);\r\n }\r\n }\r\n // add the defined ending to the text\r\n $truncate .= $ending;\r\n if($considerHtml) {\r\n // close all unclosed html-tags\r\n foreach ($open_tags as $tag) {\r\n $truncate .= '</' . $tag . '>';\r\n }\r\n }\r\n return $truncate;\r\n}", "protected function getCurrentHTML($url) {\n\t\treturn file_get_contents($url);\n\t}", "function removePartialTags($string) {\r\n\t\t$pos_close = strpos($string, \">\");\r\n\t\tif($pos_close != false) {\r\n\t\t\t$string = substr($string, $pos_close + 1);\r\n\t\t}\r\n\t\t$pos_open = strpos($string, \"<\");\r\n\t\tif($pos_open != false) {\r\n\t\t\t$string = substr($string, 0, $pos_open);\r\n\t\t}\r\n\t\t//print('removePartialTags cleaned string: ' . $string);\r\n\t\treturn $string;\r\n\t}", "static function technig_the_content($content)\n\t{\n\t\treturn substr($content, 0, 500);\n\t}", "protected function getHtmlFromRealPage($html)\n {\n // set body tag to lower case\n $html = str_replace('<BODY', '<body', $html);\n $html = str_replace('</BODY', '</body', $html);\n\n // explode from the body tag. If no body tag => end\n $res = explode('<body', $html);\n\n // the html content is between body tag openning and closing\n $content = '<page'.$res[1];\n $content = explode('</body', $content);\n $content = $content[0].'</page>';\n\n // extract the link tags from the original html\n // and add them before the content\n preg_match_all('/<link ([^>]*)[\\/]?>/isU', $html, $match);\n foreach ($match[1] as $src) {\n $content = '<link '.$src.'/>'.$content;\n }\n\n // extract the css style tags from the original html\n // and add them before the content\n preg_match_all('/<style[^>]*>(.*)<\\/style[^>]*>/isU', $html, $match);\n foreach ($match[0] as $src) {\n $content = $src.$content;\n }\n\n return $content;\n }", "function fcl_utilities_is_html($string) {\r\n return preg_match('/<\\s?[^\\>]*\\/?\\s?>/i', $string);\r\n}", "function str_limit_html($value, $limit = 200){\n \n if (mb_strwidth($value, 'UTF-8') <= $limit) {\n return $value;\n }\n \n // Strip text with HTML tags, sum html len tags too.\n // Is there another way to do it?\n do {\n $len = mb_strwidth( $value, 'UTF-8' );\n $len_stripped = mb_strwidth( strip_tags($value), 'UTF-8' );\n $len_tags = $len - $len_stripped;\n \n $value = mb_strimwidth($value, 0, $limit+$len_tags, '', 'UTF-8');\n } while( $len_stripped > $limit);\n \n // Load as HTML ignoring errors\n $dom = new DOMDocument();\n @$dom->loadHTML('<?xml encoding=\"utf-8\" ?>' . $value, LIBXML_HTML_NODEFDTD); \n\n // Fix the html errors\n $value = $dom->saveHtml($dom->getElementsByTagName('body')->item(0));\n \n // Remove body tag\n $value = mb_strimwidth($value, 6, mb_strwidth($value, 'UTF-8') - 13, '', 'UTF-8'); // <body> and </body>\n // Remove empty tags\n return preg_replace('/<(\\w+)\\b(?:\\s+[\\w\\-.:]+(?:\\s*=\\s*(?:\"[^\"]*\"|\"[^\"]*\"|[\\w\\-.:]+))?)*\\s*\\/?>\\s*<\\/\\1\\s*>/', '', $value);\n }", "public function regexHtml($aKey=NULL){\n\t\treturn $this->regexMatch($aKey,$this->regexHtml);\n\t}", "public function fetch() {\n return $this->html;\n }", "public function getHtmlSource();", "function parse ($html) {\n // TODO fix by shijp : 临时方案\n if (is_array($html)) {\n return $html;\n }\n\n // If there are no HTML tags, ignore it\n if (false === strpos($html, '<'))\n return $html;\n if (! preg_match(\"/<(?=[a-zA-Z\\/])/\", $html))\n return $html;\n\n $this->clear();\n return parent::parse($html);\n }", "function parseHtml($s_str)\r\n{\r\n$i_indicatorL = 0;\r\n$i_indicatorR = 0;\r\n$s_tagOption = \"\";\r\n$i_arrayCounter = 0;\r\n$a_html = array();\r\n// Search for a tag in string\r\nwhile( is_int(($i_indicatorL=strpos($s_str,\"<\",$i_indicatorR))) ) {\r\n// Get everything into tag...\r\n$i_indicatorL++;\r\n$i_indicatorR = strpos($s_str,\">\", $i_indicatorL);\r\n$s_temp = substr($s_str, $i_indicatorL, ($i_indicatorR-$i_indicatorL) );\r\n$a_tag = explode( ' ', $s_temp );\r\n// Here we get the tag's name\r\nlist( ,$s_tagName,, ) = each($a_tag);\r\n$s_tagName = strtoupper($s_tagName);\r\n// Well, I am not interesting in <br>, </font> or anything else like that...\r\n// So, this is false for tags without options.\r\n$b_boolOptions = is_array(($s_tagOption=each($a_tag))) && $s_tagOption[1];\r\nif( $b_boolOptions ) {\r\n// Without this, we will mess up the array\r\n$i_arrayCounter = (int)count($a_html[$s_tagName]);\r\n// get the tag options, like src=\"htt://\". Here, s_tagTokOption is 'src'and s_tagTokValue is '\"http://\"'\r\n\r\ndo {\r\n$s_tagTokOption = strtoupper(strtok($s_tagOption[1], \"=\"));\r\n$s_tagTokValue = trim(strtok(\"=\"));\r\n$a_html[$s_tagName][$i_arrayCounter][$s_tagTokOption] =\r\n$s_tagTokValue;\r\n$b_boolOptions = is_array(($s_tagOption=each($a_tag))) &&\r\n$s_tagOption[1];\r\n} while( $b_boolOptions );\r\n}\r\n}\r\nreturn $a_html;\r\n}", "function &getHTML()\n\t{\n\t\tinclude_once(\"./Services/PersonalDesktop/classes/class.ilBookmarkBlockGUI.php\");\n\t\t$bookmark_block_gui = new ilBookmarkBlockGUI(\"ilpersonaldesktopgui\", \"show\");\n\t\t\n\t\treturn $bookmark_block_gui->getHTML();\n\t}", "public function afterSave($html)\n {\n if ($this->temporaryCharset instanceof Element) {\n $this->temporaryCharset->parentNode->removeChild($this->temporaryCharset);\n }\n\n $result = preg_replace(self::HTML_GET_HTTP_EQUIV_TAG_PATTERN, '', $html, 1);\n\n if (! is_string($result)) {\n return $html;\n }\n\n return $result;\n }", "public function loadHTML();", "public function get_tag_content($tag_to_grab, $input, $replace_html = true) {\n $tag_content = preg_split(\"/\\<$tag_to_grab\\>/i\", $input, 0);\n if (strpos($tag_to_grab, ' ') > 0) {\n $tag_to_grab = substr($tag_to_grab, 0, strpos($tag_to_grab, ' '));\n }\n\n $tag_content = preg_split(\"/\\<\\/$tag_to_grab\\>/i\", $tag_content[1], 0);\n\n if ($replace_html) {\n $tag_content[0] = str_replace('--lt--', '<', $tag_content[0]);\n $tag_content[0] = str_replace('--gt--', '>', $tag_content[0]);\n }\n\n return $tag_content[0];\n }", "function remove_html($content) {\r\n\t$content = strip_tags($content);\r\n return $content;\r\n}", "function article_html() {\n return parse(Registry::prop('article', 'html'), false);\n}", "public function getHtmlContent()\n {\n return $this->htmlContent;\n }", "private static function html() : string\n {\n return '<(.|\\n)*?>';\n }", "public function get_html_filtered()\n\t{\n\t\t$html = (isset($this->HTML_rewritten))?$this->HTML_rewritten:$this->HTML;\n\t\treturn $html;\n\t}", "function breach_visual_html($str)\n{\n $ret = \"\";\n for ($i = 0; $i < strlen($str); $i++) {\n $ret .= breach_comment_string();\n $ret .= breach_zws_string();\n $ret .= substr($str, $i, 1);\n $ret .= breach_zws_string();\n $ret .= breach_comment_string();\n }\n return $ret;\n}", "public static function Get()\n\t\t{\n\t\t\treturn self::$html;\n\t\t}", "public static function cleanHTMLStr($html)\n {\n require_once __DIR__ . '/../../Libs/vendor/ezyang/htmlpurifier/library/HTMLPurifier.auto.php';\n $config = HTMLPurifier_Config::createDefault();\n $config->loadArray([\n 'Cache.DefinitionImpl' => null,\n 'Core.Encoding' => 'UTF-8',\n 'HTML.Allowed' => 'strong,em,a[href|title|target|rel|class|style],ul[style],ol[style],li[style],br,span[class|style]',\n 'Attr.AllowedFrameTargets' => array('_blank', '_self'),\n 'CSS.AllowTricky' => true,\n 'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding,padding-left,padding-right,color,background-color,text-align,display',\n 'AutoFormat.RemoveEmpty' => true\n ]);\n $purifier = new HTMLPurifier($config);\n return $purifier->purify($html);\n }", "public function cropHtmlWorksWithComplexContent() {}", "function truncate_html_str ($s, $MAX_LENGTH, &$trunc_str_len) {\n\n\t$trunc_str_len=0;\n\n\tif (func_num_args()>3) {\n\t\t$add_ellipsis = func_get_arg(3);\n\n\t} else {\n\t\t$add_ellipsis = true;\n\t}\n\n\tif (func_num_args()>4) {\n\t\t$with_tags = func_get_arg(4);\n\n\t} else {\n\t\t$with_tags = false;\n\t}\n\n\tif ($with_tags){\n\t\t$tag_expr = \"|<[^>]+>\";\n\n\t}\n\n\t$offset = 0; $character_count=0;\n\t# match a character, or characters encoded as html entity\n\t# treat each match as a single character\n\t#\n\twhile ((preg_match ('/(&#?[0-9A-z]+;'.$tag_expr.'|.|\\n)/', $s, $maches, PREG_OFFSET_CAPTURE, $offset) && ($character_count < $MAX_LENGTH))) {\n\t\t$offset += strlen($maches[0][0]);\n\t\t$character_count++;\n\t\t$str .= $maches[0][0];\n\t\t\n\t\n\t}\n\tif (($character_count == $MAX_LENGTH)&&($add_ellipsis)) {\n\t\t$str = $str.\"...\";\n\t}\n\t$trunc_str_len = $character_count;\n\treturn $str;\n\n \n}", "abstract protected function getHtmlBody();", "public function getSubString($string, $length = 30) {\n //Primero eliminamos las etiquetas html y luego cortamos el string\n $stringDisplay = substr(strip_tags($string), 0, $length);\n //Si el texto es mayor que la longitud se agrega puntos suspensivos\n if (strlen(strip_tags($string)) > $length)\n $stringDisplay .= ' ...';\n return $stringDisplay;\n }", "function cp_str_containsHTML($str){\r\n return ($str != str_replace(['>','<'],'',$str));\r\n}", "public static function removeHtml($string)\n\t{\n\t\t$string=trim($string);\n\t\t$string= html_entity_decode($string);\n\t\t$string=strip_tags($string);\n\n\t\treturn $string;\n\t}", "function get_text_between_tags($string, $tagname){\r\n\t\t$d = new DOMDocument();\r\n\t\t@$d->loadHTML($string);\r\n\t\t$return = array();\r\n\t\tforeach($d->getElementsByTagName($tagname) as $item){\r\n\t\t\t\t$return[] = $item->textContent;\r\n\t\t}\r\n\t\treturn $return;\r\n}", "function the_substr($string, $length) {\n\techo get_substr($string, $length);\n}", "public function findHtml($parsedEmail) {\n\t\t\treturn $this->find($parsedEmail, \"text/html\");\n\t\t}", "private function processContent(){\n\t\t$this->textEnd = strpos($this->raw,\"</{$this->tag}\");\n\t\t$this->text = trim(substr($this->raw, $this->textStart, $this->textEnd - $this->textStart));\n\t}", "public function getHtml() {\n\t\treturn $this->_html;\n\t}", "function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true) {\n\t\t\tif ($considerHtml) {\n\t\t\t\t// if the plain text is shorter than the maximum length, return the whole text\n\t\t\t\tif (strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n\t\t\t\t\treturn $text;\n\t\t\t\t}\n\t\t\t\t// splits all html-tags to scanable lines\n\t\t\t\tpreg_match_all('/(<.+?>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER);\n\t\t\t\t$total_length = strlen($ending);\n\t\t\t\t$open_tags = array();\n\t\t\t\t$truncate = '';\n\t\t\t\tforeach ($lines as $line_matchings) {\n\t\t\t\t\t// if there is any html-tag in this line, handle it and add it (uncounted) to the output\n\t\t\t\t\tif (!empty($line_matchings[1])) {\n\t\t\t\t\t\t// if it's an \"empty element\" with or without xhtml-conform closing slash\n\t\t\t\t\t\tif (preg_match('/^<(\\s*.+?\\/\\s*|\\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\\s.+?)?)>$/is', $line_matchings[1])) {\n\t\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t// if tag is a closing tag\n\t\t\t\t\t\t} else if (preg_match('/^<\\s*\\/([^\\s]+?)\\s*>$/s', $line_matchings[1], $tag_matchings)) {\n\t\t\t\t\t\t\t// delete tag from $open_tags list\n\t\t\t\t\t\t\t$pos = array_search($tag_matchings[1], $open_tags);\n\t\t\t\t\t\t\tif ($pos !== false) {\n\t\t\t\t\t\t\tunset($open_tags[$pos]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t// if tag is an opening tag\n\t\t\t\t\t\t} else if (preg_match('/^<\\s*([^\\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings)) {\n\t\t\t\t\t\t\t// add tag to the beginning of $open_tags list\n\t\t\t\t\t\t\tarray_unshift($open_tags, strtolower($tag_matchings[1]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// add html-tag to $truncate'd text\n\t\t\t\t\t\t$truncate .= $line_matchings[1];\n\t\t\t\t\t}\n\t\t\t\t\t// calculate the length of the plain text part of the line; handle entities as one character\n\t\t\t\t\t$content_length = strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));\n\t\t\t\t\tif ($total_length+$content_length> $length) {\n\t\t\t\t\t\t// the number of characters which are left\n\t\t\t\t\t\t$left = $length - $total_length;\n\t\t\t\t\t\t$entities_length = 0;\n\t\t\t\t\t\t// search for html entities\n\t\t\t\t\t\tif (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE)) {\n\t\t\t\t\t\t\t// calculate the real length of all entities in the legal range\n\t\t\t\t\t\t\tforeach ($entities[0] as $entity) {\n\t\t\t\t\t\t\t\tif ($entity[1]+1-$entities_length <= $left) {\n\t\t\t\t\t\t\t\t\t$left--;\n\t\t\t\t\t\t\t\t\t$entities_length += strlen($entity[0]);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// no more characters left\n\t\t\t\t\t\t\t\t\tbreak;\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$truncate .= substr($line_matchings[2], 0, $left+$entities_length);\n\t\t\t\t\t\t// maximum lenght is reached, so get off the loop\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$truncate .= $line_matchings[2];\n\t\t\t\t\t\t$total_length += $content_length;\n\t\t\t\t\t}\n\t\t\t\t\t// if the maximum length is reached, get off the loop\n\t\t\t\t\tif($total_length>= $length) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (strlen($text) <= $length) {\n\t\t\t\t\treturn $text;\n\t\t\t\t} else {\n\t\t\t\t\t$truncate = substr($text, 0, $length - strlen($ending));\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if the words shouldn't be cut in the middle...\n\t\t\tif (!$exact) {\n\t\t\t\t// ...search the last occurance of a space...\n\t\t\t\t$spacepos = strrpos($truncate, ' ');\n\t\t\t\tif (isset($spacepos)) {\n\t\t\t\t\t// ...and cut the text in this position\n\t\t\t\t\t$truncate = substr($truncate, 0, $spacepos);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// add the defined ending to the text\n\t\t\t$truncate .= $ending;\n\t\t\tif($considerHtml) {\n\t\t\t\t// close all unclosed html-tags\n\t\t\t\tforeach ($open_tags as $tag) {\n\t\t\t\t\t$truncate .= '</' . $tag . '>';\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $truncate;\n\t\t}", "public function loadHTMLFragment($string) {\n $input = new HTML5_Inputstream_String($string);\n\n return $this->parseFragment($input);\n }", "abstract protected function loadHtml($text= null);", "function GetBetween($content, $start, $end) {\r\n\t$r = explode($start, $content);\r\n\tif (isset($r[1])) {\r\n\t\t$rcount = count($r);\r\n\t\t$r = explode($end, $r[$rcount-2]);\r\n\t\treturn $r[0];\r\n\t}\r\n\treturn '';\r\n}", "function fa_truncate_html( $string, $length = 80, $ending = '...' ){\n\tif( $length == 0 ){\n\t\treturn '';\n\t}\n\t\n\t$str_length = function_exists('mb_strlen') ? mb_strlen( preg_replace('/<.*?>/', '', $string )) : strlen( preg_replace('/<.*?>/', '', $string ) );\t\n\t// if text without HTML is smaller than length, return the whole text\n\tif ( $str_length <= $length ) {\n\t\treturn $string;\n\t}\n\t\n\t$truncated \t\t= '';\n\t$total_length \t= 0;\n\t$opened \t\t= array();\n\t$auto_closed \t= array('img','br','input','hr','area','base','basefont','col','frame','isindex','link','meta','param');\n\t\n\tpreg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $string, $tags, PREG_SET_ORDER);\n\t\n\tforeach( $tags as $tag ){\n\t\t$tag_name = strtolower( $tag[2] );\n\t\tif( !in_array( $tag_name, $auto_closed ) ){\n\t\t\tif ( preg_match('/<[\\w]+[^>]*>/s', $tag[0] ) ){\n\t\t\t\tarray_unshift( $opened, $tag[2] );\n\t\t\t} else if ( preg_match( '/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag ) ){\n\t\t\t\t$pos = array_search( $closeTag[1], $opened );\n\t\t\t\tif ( $pos !== false ) {\n\t\t\t\t\tarray_splice( $opened, $pos, 1 );\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n\t\t// if empty, it's plain text\n\t\tif( !empty( $tag[2] ) ){\n\t\t\t$truncated .= $tag[1];\n\t\t}\t\n\t\t// calculate string length\n\t\t$string_length = function_exists( 'mb_strlen' ) ? mb_strlen( $tag[3] ) : strlen( $tag[3] );\n\t\tif( $total_length + $string_length <= $length ){\n\t\t\t$truncated .= $tag[3];\n\t\t\t$total_length += $string_length;\n\t\t}else{\n\t\t\tif( $total_length == 0 ){\n\t\t\t\t$truncated .= function_exists( 'mb_substr' ) ? mb_substr( $tag[3], 0, $length ) . $ending : substr( $tag[3], 0, $length ) . $ending;\n\t\t\t\tbreak;\t\n\t\t\t}\n\t\t\t$diff = $length - $total_length;\n\t\t\t$truncated .= function_exists( 'mb_substr' ) ? mb_substr( $tag[3], 0, $diff ) . $ending : substr( $tag[3], 0, $diff ) . $ending;\n\t\t\tbreak;\n\t\t}\t\t\n\t}\n\t// close all opened tags\n\tforeach ( $opened as $tag ) {\n\t\t$truncated .= '</'.$tag.'>';\n\t}\n\treturn $truncated;\n}", "public abstract function asHTML();", "public function getPreview()\n {\n $text_cut = mb_substr($this->getContent(), 0, 100);\n return $text_cut;\n }", "function truncate ($text, $length = 100, $options = array()) {\n $default = array(\n 'ending' => '...', 'exact' => true, 'html' => false\n );\n $options = array_merge($default, $options);\n extract($options);\n if ($html) {\n if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n return $text;\n }\n $totalLength = mb_strlen(strip_tags($ending));\n $openTags = array();\n $truncate = '';\n preg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);\n foreach ($tags as $tag) {\n if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) {\n if (preg_match('/<[\\w]+[^>]*>/s', $tag[0])) {\n array_unshift($openTags, $tag[2]);\n } else if (preg_match('/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag)) {\n $pos = array_search($closeTag[1], $openTags);\n if ($pos !== false) {\n array_splice($openTags, $pos, 1);\n }\n }\n }\n $truncate .= $tag[1];\n $contentLength = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3]));\n if ($contentLength + $totalLength > $length) {\n $left = $length - $totalLength;\n $entitiesLength = 0;\n if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE)) {\n foreach ($entities[0] as $entity) {\n if ($entity[1] + 1 - $entitiesLength <= $left) {\n $left--;\n $entitiesLength += mb_strlen($entity[0]);\n } else {\n break;\n }\n }\n }\n $truncate .= mb_substr($tag[3], 0 , $left + $entitiesLength);\n break;\n } else {\n $truncate .= $tag[3];\n $totalLength += $contentLength;\n }\n if ($totalLength >= $length) {\n break;\n }\n }\n } else {\n if (mb_strlen($text) <= $length) {\n return $text;\n } else {\n $truncate = mb_substr($text, 0, $length - mb_strlen($ending));\n }\n }\n if (!$exact) {\n $spacepos = mb_strrpos($truncate, ' ');\n if (isset($spacepos)) {\n if ($html) {\n $bits = mb_substr($truncate, $spacepos);\n preg_match_all('/<\\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER);\n if (!empty($droppedTags)) {\n foreach ($droppedTags as $closingTag) {\n if (!in_array($closingTag[1], $openTags)) {\n array_unshift($openTags, $closingTag[1]);\n }\n }\n }\n }\n $truncate = mb_substr($truncate, 0, $spacepos);\n }\n }\n $truncate .= $ending;\n if ($html) {\n foreach ($openTags as $tag) {\n $truncate .= '</'.$tag.'>';\n }\n }\n return $truncate;\n}", "function truncate ($text, $length = 100, $options = array()) {\n $default = array(\n 'ending' => '...', 'exact' => true, 'html' => false\n );\n $options = array_merge($default, $options);\n extract($options);\n if ($html) {\n if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n return $text;\n }\n $totalLength = mb_strlen(strip_tags($ending));\n $openTags = array();\n $truncate = '';\n preg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);\n foreach ($tags as $tag) {\n if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) {\n if (preg_match('/<[\\w]+[^>]*>/s', $tag[0])) {\n array_unshift($openTags, $tag[2]);\n } else if (preg_match('/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag)) {\n $pos = array_search($closeTag[1], $openTags);\n if ($pos !== false) {\n array_splice($openTags, $pos, 1);\n }\n }\n }\n $truncate .= $tag[1];\n $contentLength = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3]));\n if ($contentLength + $totalLength > $length) {\n $left = $length - $totalLength;\n $entitiesLength = 0;\n if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE)) {\n foreach ($entities[0] as $entity) {\n if ($entity[1] + 1 - $entitiesLength <= $left) {\n $left--;\n $entitiesLength += mb_strlen($entity[0]);\n } else {\n break;\n }\n }\n }\n $truncate .= mb_substr($tag[3], 0 , $left + $entitiesLength);\n break;\n } else {\n $truncate .= $tag[3];\n $totalLength += $contentLength;\n }\n if ($totalLength >= $length) {\n break;\n }\n }\n } else {\n if (mb_strlen($text) <= $length) {\n return $text;\n } else {\n $truncate = mb_substr($text, 0, $length - mb_strlen($ending));\n }\n }\n if (!$exact) {\n $spacepos = mb_strrpos($truncate, ' ');\n if (isset($spacepos)) {\n if ($html) {\n $bits = mb_substr($truncate, $spacepos);\n preg_match_all('/<\\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER);\n if (!empty($droppedTags)) {\n foreach ($droppedTags as $closingTag) {\n if (!in_array($closingTag[1], $openTags)) {\n array_unshift($openTags, $closingTag[1]);\n }\n }\n }\n }\n $truncate = mb_substr($truncate, 0, $spacepos);\n }\n }\n $truncate .= $ending;\n if ($html) {\n foreach ($openTags as $tag) {\n $truncate .= '</'.$tag.'>';\n }\n }\n return $truncate;\n}", "function cmshowcase_truncate($text, $length = 100, $ending = '...', $exact = true, $considerHtml = false) {\n if (is_array($ending)) {\n extract($ending);\n }\n if ($considerHtml) {\n if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n return $text;\n }\n $totalLength = mb_strlen($ending);\n $openTags = array();\n $truncate = '';\n preg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);\n foreach ($tags as $tag) {\n if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) {\n if (preg_match('/<[\\w]+[^>]*>/s', $tag[0])) {\n array_unshift($openTags, $tag[2]);\n } else if (preg_match('/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag)) {\n $pos = array_search($closeTag[1], $openTags);\n if ($pos !== false) {\n array_splice($openTags, $pos, 1);\n }\n }\n }\n $truncate .= $tag[1];\n\n $contentLength = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3]));\n if ($contentLength + $totalLength > $length) {\n $left = $length - $totalLength;\n $entitiesLength = 0;\n if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE)) {\n foreach ($entities[0] as $entity) {\n if ($entity[1] + 1 - $entitiesLength <= $left) {\n $left--;\n $entitiesLength += mb_strlen($entity[0]);\n } else {\n break;\n }\n }\n }\n\n $truncate .= mb_substr($tag[3], 0 , $left + $entitiesLength);\n break;\n } else {\n $truncate .= $tag[3];\n $totalLength += $contentLength;\n }\n if ($totalLength >= $length) {\n break;\n }\n }\n\n } else {\n if (mb_strlen($text) <= $length) {\n return $text;\n } else {\n $truncate = mb_substr($text, 0, $length - strlen($ending));\n }\n }\n if (!$exact) {\n $spacepos = mb_strrpos($truncate, ' ');\n if (isset($spacepos)) {\n if ($considerHtml) {\n $bits = mb_substr($truncate, $spacepos);\n preg_match_all('/<\\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER);\n if (!empty($droppedTags)) {\n foreach ($droppedTags as $closingTag) {\n if (!in_array($closingTag[1], $openTags)) {\n array_unshift($openTags, $closingTag[1]);\n }\n }\n }\n }\n $truncate = mb_substr($truncate, 0, $spacepos);\n }\n }\n\n $truncate .= $ending;\n\n if ($considerHtml) {\n foreach ($openTags as $tag) {\n $truncate .= '</'.$tag.'>';\n }\n }\n\n return $truncate;\n }", "function loadTemplateString($html)\n{\n $document = new DOMDocument('1.0', 'UTF-8');\n $internalErrors = libxml_use_internal_errors(true);\n $document->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));\n libxml_use_internal_errors($internalErrors);\n $document->formatOutput = true;\n return $document;\n}", "function sacar_html($str) {\r\n$allowed = \"<br>,<b>,<i>,<u>\";\r\nreturn strip_tags($str,$allowed);\r\n}", "public function getHTML() \n\t{\n\t\treturn $this->HTML;\n\t}", "static function limit_content($str, $length)\n {\n $str = strip_tags($str);\n $str = str_replace('[/', '[', $str);\n $str = strip_shortcodes($str);\n $str = explode(\" \", $str);\n return implode(\" \", array_slice($str, 0, $length));\n }", "public function urlGetContent($aURL){\n\t\t$tmp=file_get_contents($aURL);\n\t\t$this->regHtml=$tmp;\n\t}" ]
[ "0.64612013", "0.6358039", "0.62515956", "0.6195089", "0.6195089", "0.6149083", "0.59632057", "0.5939412", "0.5929724", "0.5919192", "0.5884656", "0.5807714", "0.58062893", "0.57838464", "0.57685274", "0.57540613", "0.57020235", "0.5656533", "0.5613139", "0.5597197", "0.5596987", "0.5587414", "0.5578331", "0.55770296", "0.5573739", "0.55597997", "0.55299824", "0.55299795", "0.551947", "0.5499433", "0.54922307", "0.54921395", "0.5489905", "0.5456595", "0.5453753", "0.54516566", "0.54437697", "0.54399663", "0.54276836", "0.5419958", "0.54110056", "0.54087275", "0.5395546", "0.53927857", "0.5385085", "0.5381599", "0.53756046", "0.5372813", "0.53579855", "0.5355622", "0.5353329", "0.5342774", "0.5339221", "0.53303456", "0.53120106", "0.5305977", "0.52968216", "0.52882564", "0.52808785", "0.5277758", "0.52767116", "0.52731836", "0.5266888", "0.52649254", "0.5245958", "0.5243946", "0.5216333", "0.5214154", "0.5205823", "0.5205742", "0.520018", "0.51938826", "0.51935005", "0.51911014", "0.5189657", "0.51840234", "0.5176659", "0.5175678", "0.5165894", "0.5162525", "0.5153933", "0.51533955", "0.5152326", "0.51222825", "0.5120304", "0.51050895", "0.5092867", "0.5091939", "0.50887805", "0.5086005", "0.50824463", "0.5081246", "0.5076864", "0.5076864", "0.5076077", "0.507215", "0.5068696", "0.5068604", "0.5068239", "0.50618756" ]
0.59680754
6
Remove any HTML tags from a string
public static function strip(string $x): string { return preg_replace('/ +/', ' ', trim(preg_replace('/<[^>]+>/', ' ', $x))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function strip_html_tags($string){\n return preg_replace(array('/\\<(script)(.+)>/i', '/\\<(.+)(script)>/i', '/\\<(style)(.+)>/i', '/\\<(.+)(style)>/i'), '', $string);\n }", "public static function removeHtml($string)\n\t{\n\t\t$string=trim($string);\n\t\t$string= html_entity_decode($string);\n\t\t$string=strip_tags($string);\n\n\t\treturn $string;\n\t}", "function strip_html_tags($str){\n $str = preg_replace('/(<|>)\\1{2}/is', '', $str);\n $str = preg_replace(\n array(// Remove invisible content\n '@<head[^>]*?>.*?</head>@siu',\n '@<style[^>]*?>.*?</style>@siu',\n '@<script[^>]*?.*?</script>@siu',\n '@<noscript[^>]*?.*?</noscript>@siu',\n ),\n \"\", //replace above with nothing\n $str );\n $str = replaceWhitespace($str);\n $str = strip_tags($str);\n return $str;\n}", "function filter_tags($string)\n{\n return preg_replace('/<[^>]*>/', ' ', $string);\n}", "public static function removeHTML(string $string): string\n {\n return html_entity_decode(strip_tags($string), ENT_QUOTES | ENT_HTML5, 'utf-8');\n }", "public static function stripHtml($string) {\n $string = strip_tags($string);\n $string = htmlspecialchars($string);\n return $string;\n }", "public static function stripHtml($string)\n {\n $strippedCss = preg_replace('/<style.*<\\/style>/s', '', $string);\n $strippedJs = preg_replace('/<script.*<\\/script>/s', '', $strippedCss);\n $removedOneLineTags = preg_replace(\"/<[^>\\n]*>/mu\", '', $strippedJs);\n $removedMultiLineTags = preg_replace(\"/<a [^>]*?>/s\", '', $removedOneLineTags);\n return $removedMultiLineTags;\n }", "function strip_all($str) {\n return safehtml(strip_tags($str));\n}", "function strip_html_tags( $text )\n{\n\t// PHP's strip_tags() function will remove tags, but it\n\t// doesn't remove scripts, styles, and other unwanted\n\t// invisible text between tags. Also, as a prelude to\n\t// tokenizing the text, we need to insure that when\n\t// block-level tags (such as <p> or <div>) are removed,\n\t// neighboring words aren't joined.\n\t$text = preg_replace(\n\t\t\tarray(\n\t\t\t\t\t// Remove invisible content\n\t\t\t\t\t'@<head[^>]*?>.*?</head>@siu',\n\t\t\t\t\t'@<style[^>]*?>.*?</style>@siu',\n\t\t\t\t\t'@<script[^>]*?.*?</script>@siu',\n\t\t\t\t\t'@<object[^>]*?.*?</object>@siu',\n\t\t\t\t\t'@<embed[^>]*?.*?</embed>@siu',\n\t\t\t\t\t'@<applet[^>]*?.*?</applet>@siu',\n\t\t\t\t\t'@<noframes[^>]*?.*?</noframes>@siu',\n\t\t\t\t\t'@<noscript[^>]*?.*?</noscript>@siu',\n\t\t\t\t\t'@<noembed[^>]*?.*?</noembed>@siu',\n\t\t\t\t\t/*'@<input[^>]*?>@siu',*/\n\t\t\t\t\t'@<form[^>]*?.*?</form>@siu',\n\n\t\t\t\t\t// Add line breaks before & after blocks\n\t\t\t\t\t'@<((br)|(hr))>@iu',\n\t\t\t\t\t'@</?((address)|(blockquote)|(center)|(del))@iu',\n\t\t\t\t\t'@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n\t\t\t\t\t'@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n\t\t\t\t\t'@</?((table)|(th)|(td)|(caption))@iu',\n\t\t\t\t\t'@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n\t\t\t\t\t'@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n\t\t\t\t\t'@</?((frameset)|(frame)|(iframe))@iu',\n\t),\n\tarray(\n\t\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \",\n\t\" \", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n\t\"\\n\\$0\", \"\\n\\$0\",\n\t),\n\t$text );\n\n\t// remove empty lines\n\t$text = preg_replace(\"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\", \"\\n\", $text);\n\t// remove leading spaces\n\t$text = preg_replace(\"/\\n( )*/\", \"\\n\", $text);\n\n\t// Remove all remaining tags and comments and return.\n\treturn strip_tags( $text );\n}", "function strip_only($str, $tags) {\n if(!is_array($tags)) {\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n foreach($tags as $tag) $str = preg_replace('#</?'.$tag.'[^>]*>#is', '', $str);\n return $str;\n}", "function _cut_html($str) {\n $str=preg_replace(\"'<[\\/\\!]*?[^<>]*?>'si\",\"\",$str);\n return $str;\n }", "function strips_all_tags( $html )\n\t{\n\t\t$search = [\n\t\t\t'@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments including CDATA\n\t\t];\n\t\t$result = preg_replace( $search, '', $html );\n\n\t\treturn $result;\n\t}", "function remove_html($content) {\r\n\t$content = strip_tags($content);\r\n return $content;\r\n}", "function stringStripTags ($string) {\n $string = preg_replace(\"/<del[^>]*>.+<\\/del[^>]*>/isU\", '', $string);\n $string = preg_replace(\"/<script[^>]*>.+<\\/script[^>]*>/isU\", '', $string);\n $string = preg_replace(\"/<style[^>]*>.+<\\/style[^>]*>/isU\", '', $string);\n $string = str_replace('>', '> ', $string);\n $string = str_replace('<', ' <', $string);\n $string = strip_tags($string);\n $string = preg_replace(\"/\\s+/\", \" \", $string);\n $string = trim($string);\n return $string;\n}", "function sacar_html($str) {\r\n$allowed = \"<br>,<b>,<i>,<u>\";\r\nreturn strip_tags($str,$allowed);\r\n}", "function plugins_strip_tags($string) {\n\treturn strip_tags($string, '<p><strong><em><span><ul><li><ol><blockquote>');\n}", "public static function remove_html(string $str, string $allowable_tags = ''): string\n {\n return \\strip_tags($str, $allowable_tags);\n }", "public function removeHTML($text){\n $text = html_entity_decode($text);\n\n\n // Alle Tags entfernen\n $text = strip_tags($text);\n\n $text = str_replace(\"&lt;br&gt;\", \"\", $text);\n $text = str_replace(\"&amp;lt;br&amp;gt;\", \"\", $text);\n\n\n return $text;\n }", "protected function strip_tags($string ){\n\t\treturn preg_replace('~\\s+~',' ',strip_tags($string));\n\t}", "public static function cleanHTML($string)\n {\n $cleaned = $string;\n $cleaned = str_replace('<', '&lt;', $cleaned);\n $cleaned = str_replace('>', '&gt;', $cleaned);\n\n return $cleaned;\n }", "function remove_html_tag_news($data){\n\treturn preg_replace('/ style=\".*?\"/i', '$1', strip_tags($data, '<i><a><b><u><div><hr>'));\n}", "function filterHTMLTags( $text )\n{\n $text = preg_replace(\n array(\n // Remove invisible content\n '@<head[^>]*?>.*?</head>@siu',\n '@<style[^>]*?>.*?</style>@siu',\n '@<script[^>]*?.*?</script>@siu',\n '@<object[^>]*?.*?</object>@siu',\n '@<embed[^>]*?.*?</embed>@siu',\n '@<applet[^>]*?.*?</applet>@siu',\n '@<noframes[^>]*?.*?</noframes>@siu',\n '@<noscript[^>]*?.*?</noscript>@siu',\n '@<noembed[^>]*?.*?</noembed>@siu',\n // Add line breaks before and after blocks\n '@</?((address)|(blockquote)|(center)|(del))@iu',\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n '@</?((table)|(th)|(td)|(caption))@iu',\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n '@</?((frameset)|(frame)|(iframe))@iu',\n ),\n array(\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n \"\\n\\$0\", \"\\n\\$0\",\n ),\n $text );\n return strip_tags( $text );\n}", "function stripcleantohtml($s) {\n\t// Also strips any <html> tags it may encouter\n\t// Use: Anything that shouldn't contain html (pretty much everything that is not a textarea)\n\treturn htmlentities(trim(strip_tags(stripslashes($s))), ENT_NOQUOTES, \"UTF-8\");\n}", "function wp_strip_all_tags($text, $remove_breaks = \\false)\n {\n }", "protected function stripHtmlTags($text)\n {\n $text = preg_replace(\n [\n // Remove invisible content\n /** @lang php */\n '@<head[^>]*?>.*?</head>@siu',\n /** @lang php */\n '@<style[^>]*?>.*?</style>@siu',\n /** @lang php */\n '@<script[^>]*?.*?</script>@siu',\n /** @lang php */\n '@<object[^>]*?.*?</object>@siu',\n /** @lang php */\n '@<embed[^>]*?.*?</embed>@siu',\n /** @lang php */\n '@<applet[^>]*?.*?</applet>@siu',\n /** @lang php */\n '@<noframes[^>]*?.*?</noframes>@siu',\n /** @lang php */\n '@<noscript[^>]*?.*?</noscript>@siu',\n /** @lang php */\n '@<noembed[^>]*?.*?</noembed>@siu',\n // Add line breaks before and after blocks\n '@</?((address)|(blockquote)|(center)|(del))@iu',\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n '@</?((table)|(th)|(td)|(caption))@iu',\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n '@</?((frameset)|(frame)|(iframe))@iu',\n ],\n [\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n \"\\n\\$0\", \"\\n\\$0\",\n ],\n $text\n );\n\n return strip_tags($text);\n }", "public static function strip_tags( $string ) {\n\t\t$string = wp_kses( $string, array() );\n\t\treturn str_replace( '&amp;', '&', $string ); // undo damage done by wp_kses_normalize_entities()\n\t}", "function strip_all_tags($content)\n{\n\t$content = preg_replace('/\\n/',' ',$content);\n\t$content = preg_replace('/<script.*<\\/script>/U',' ',$content);\n\t$content = preg_replace('/<style.*<\\/style>/U',' ',$content);\n\t$content = strip_tags($content);\n\treturn $content;\n}", "function sanitize(\n $html,\n $tags_to_remove = ['script', 'iframe', 'input', 'form'],\n $attributes_to_keep = ['title', 'href', 'src'],\n $text_to_keep = []\n) {\n $htmlContent = str_get_html($html);\n\n foreach ($htmlContent->find('*') as $element) {\n if (in_array($element->tag, $text_to_keep)) {\n $element->outertext = $element->plaintext;\n } elseif (in_array($element->tag, $tags_to_remove)) {\n $element->outertext = '';\n } else {\n foreach ($element->getAllAttributes() as $attributeName => $attribute) {\n if (!in_array($attributeName, $attributes_to_keep)) {\n $element->removeAttribute($attributeName);\n }\n }\n }\n }\n\n return $htmlContent;\n}", "function real_strip_tags($str, $allowable_tags = \"\")\n{\n return strip_tags($str, $allowable_tags);\n}", "public static function cleanInsideHtmlTags($str,$tags)\n\t{\n\t\tpreg_match_all('/<([^>]+)>/i',$tags,$allTags,PREG_PATTERN_ORDER);\n\t\tforeach($allTags[1] as $tag)\n\t\t{\n\t\t\t$str=preg_replace('/<'.$tag.' [^>]*>/i','<'.$tag.'>',$str);\n\t\t}\n\n\t\treturn $str;\n\t}", "function wpmantis_strip_only($str, $tags, $stripContent = false)\n{\n $content = '';\n if(!is_array($tags)) {\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n foreach($tags as $tag) {\n if ($stripContent)\n $content = '(.+</'.$tag.'[^>]*>|)';\n $str = preg_replace('#</?'.$tag.'[^>]*>'.$content.'#is', '', $str);\n }\n return $str;\n}", "public static function strip_tag_string($str)\n\t{\n\t\t$str = strip_tags($str);\n\t\t$str = trim($str);\n\t\treturn $str;\n\t}", "function strip_html_tags( $text )\r\n{\r\n $text = preg_replace(\r\n array(\r\n // Remove invisible content\r\n '@<head[^>]*?>.*?</head>@siu',\r\n '@<style[^>]*?>.*?</style>@siu',\r\n '@<script[^>]*?.*?</script>@siu',\r\n '@<object[^>]*?.*?</object>@siu',\r\n '@<embed[^>]*?.*?</embed>@siu',\r\n '@<applet[^>]*?.*?</applet>@siu',\r\n '@<noframes[^>]*?.*?</noframes>@siu',\r\n '@<noscript[^>]*?.*?</noscript>@siu',\r\n '@<noembed[^>]*?.*?</noembed>@siu',\r\n // Add line breaks before and after blocks\r\n '@</?((address)|(blockquote)|(center)|(del))@iu',\r\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\r\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\r\n '@</?((table)|(th)|(td)|(caption))@iu',\r\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\r\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\r\n '@</?((frameset)|(frame)|(iframe))@iu',\r\n ),\r\n array(\r\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\r\n $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\",\r\n $nl.\"\\$0\", $nl.\"\\$0\",\r\n ),\r\n $text );\r\n return strip_tags( $text );\r\n}", "function strip_only(&$str, $tags)\n{\n\tif(isset($str) && is_array($str))\n\t\treturn $str;\n if(!is_array($tags))\n\t{\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n\n\t$size = sizeof($tags);\n\t$keys = array_keys($tags);\n\tfor ($i=0; $i<$size; $i++)\n\t{\n\t\t$tag = $tags[$keys[$i]];\n\t\tif(isset($tag) && is_array($tag))\n\t\t\t$str = strip_only($str, $tag);\n\t\telse\n\t\t{\n\t\t\tif(stripos($str, $tag) !== false)\n\t\t\t\t$str = preg_replace('#</?'.$tag.'[^>]*>#is', '', $str);\n\t\t}\n\t}\n\treturn $str;\n}", "function sanitize($str){\n $str = strip_tags($str);\n return $str;\n }", "private function wpus_strip_tags($string, $remove_breaks = FALSE) {\n\t\t\t$string = preg_replace('/[\\r\\n\\t ]+/', ' ', $string);\n\n\t\t\t$string = preg_replace('@<(script|style)[^>]*?>.*?</\\\\1>@si', '', $string);\n\n\t\t\t$string = preg_replace('@ *</?\\s*(P|UL|OL|DL|BLOCKQUOTE)\\b[^>]*?> *@si', \"\\n\\n\", $string);\n\t\t\t$string = preg_replace('@ *<(BR|DIV|LI|DT|DD|TR|TD|H\\d)\\b[^>]*?> *@si', \"\\n\", $string);\n\t\t\t$string = preg_replace(\"@\\n\\n\\n+@si\", \"\\n\\n\", $string);\n\n\t\t\t$string = strip_tags($string);\n\n\t\t\tif($remove_breaks) {\n\t\t\t\t$string = preg_replace('/[\\r\\n\\t ]+/', ' ', $string);\n\t\t\t}\n\n\t\t\t// ...since we're pulling excerpts from the DB, some of the excerpts contain truncated HTML tags\n\t\t\t// that won't be picked up by strip_tags(). This removes any trailing HTML from the beginning\n\t\t\t// and end of the excerpt:\n\t\t\t$string = preg_replace('/.*>|<.*/', ' ', $string);\n\n\t\t\treturn trim($string);\n\t\t}", "function htmlButTags($str) {\n\t$caracteres = get_html_translation_table(HTML_ENTITIES);\n\t// Find out the \"tags\" entities\n\t$remover = get_html_translation_table(HTML_SPECIALCHARS);\n\t// Spit out the tags entities from the original table\n\t$caracteres = array_diff($caracteres, $remover);\n\t// Translate the string....\n\t$str = strtr($str, $caracteres);\n\t\n\t// now amps\n\t$str = preg_replace(\"/&(?![A-Za-z]{0,4}\\w{2,3};|#[0-9]{2,3};)/\",\"&amp;\" , $str);\n\t\n\treturn $str;\n}", "private function cleanForXML($string)\n {\n $string = strip_tags($string);\n $string = htmlentities($string, ENT_QUOTES, \"UTF-8\");\n $string = preg_replace(\"/&#?[a-z0-9]{2,8};/i\", \"\", $string);\n return $string;\n }", "private function cleanForXML($string)\n {\n $string = strip_tags($string);\n $string = htmlentities($string, ENT_QUOTES, \"UTF-8\");\n $string = preg_replace(\"/&#?[a-z0-9]{2,8};/i\", \"\", $string);\n return $string;\n }", "function strips_tags( $html, $disallowed_tag = 'script|style|noframes|select|option', $allowed_tag = '' )\n\t{\n\t\t//prep the string\n\t\t$html = ' ' . $html;\n\n\t\t//initialize keep tag logic\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\t$k = explode( '|', $allowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '<' . $k[ $i ], '[{(' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '</' . $k[ $i ], '[{(/' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\t\t//begin removal\n\t\t//remove comment blocks\n\t\twhile ( stripos( $html, '<!--' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<!--' );\n\t\t\t$pos[ 2 ] = stripos( $html, '-->', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 3;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//remove tags with content between them\n\t\tif ( strlen( $disallowed_tag ) > 0 )\n\t\t{\n\t\t\t$e = explode( '|', $disallowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $e ); $i++ )\n\t\t\t{\n\t\t\t\twhile ( stripos( $html, '<' . $e[ $i ] ) > 0 )\n\t\t\t\t{\n\t\t\t\t\t$len[ 1 ] = strlen( '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 1 ] = stripos( $html, '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 2 ] = stripos( $html, $e[ $i ] . '>', $pos[ 1 ] + $len[ 1 ] );\n\t\t\t\t\t$len[ 2 ] = $pos[ 2 ] - $pos[ 1 ] + $len[ 1 ];\n\t\t\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 2 ] );\n\t\t\t\t\t$html = str_replace( $x, '', $html );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//remove remaining tags\n\t\twhile ( stripos( $html, '<' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<' );\n\t\t\t$pos[ 2 ] = stripos( $html, '>', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 1;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//finalize keep tag\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '[{(' . $k[ $i ], '<' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '[{(/' . $k[ $i ], '</' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\n\t\treturn trim( $html );\n\t}", "public static function strip_html($text) {\n $search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\\\s\\\\S]*?--[ \\\\t\\\\n\\\\r]*>@', // Strip multi-line comments including CDATA\n '@<[\\\\/\\\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@&nbsp;@', // Strip space\n '@\\s+@', // change wrap or break space\n );\n $text = preg_replace($search, ' ', $text);\n $text = strip_tags($text);\n $text = trim($text);\n return $text;\n }", "function clean($str) {\n\t\treturn htmlentities(strip_tags($str));\n\t}", "function StripHTML($s_str,$s_line_feed = \"\\n\")\n{\n\t\t//\n\t\t// strip HTML comments (s option means include new lines in matches)\n\t\t//\n\t$s_str = preg_replace('/<!--([^-]*([^-]|-([^-]|-[^>])))*-->/s','',$s_str);\n\t\t//\n\t\t// strip any scripts (i option means case-insensitive)\n\t\t//\n\t$s_str = preg_replace('/<script[^>]*?>.*?<\\/script[^>]*?>/si','',$s_str);\n\t\t//\n\t\t// replace paragraphs with new lines (line feeds)\n\t\t//\n\t$s_str = preg_replace('/<p[^>]*?>/i',$s_line_feed,$s_str);\n\t\t//\n\t\t// replace breaks with new lines (line feeds)\n\t\t//\n\t$s_str = preg_replace('/<br[[:space:]]*\\/?[[:space:]]*>/i',$s_line_feed,$s_str);\n\t\t//\n\t\t// overcome this bug: http://bugs.php.net/bug.php?id=21311\n\t\t//\n\t$s_str = preg_replace('/<![^>]*>/s','',$s_str);\n\t\t//\n\t\t// get rid of all HTML tags\n\t\t//\n\t$s_str = strip_tags($s_str);\n\treturn ($s_str);\n}", "function strip_selected_tags($str, $tags = \"\", $stripContent = false)\n {\n preg_match_all(\"/<([^>]+)>/i\",$tags,$allTags,PREG_PATTERN_ORDER);\n foreach ($allTags[1] as $tag){\n if ($stripContent) {\n $str = preg_replace(\"/<\".$tag.\"[^>]*>.*<\\/\".$tag.\">/iU\",\"\",$str);\n }\n $str = preg_replace(\"/<\\/?\".$tag.\"[^>]*>/iU\",\"\",$str);\n }\n return $str;\n }", "function remove_tags( $html, $tags, $strip_content = FALSE )\n\t{\n\t\t$content = '';\n\t\tif ( ! is_array( $tags ) )\n\t\t{\n\t\t\t$tags = ( strpos( $html, '>' ) !== FALSE ? explode( '>', str_replace( '<', '', $tags ) ) : [ $tags ] );\n\t\t\tif ( end( $tags ) == '' )\n\t\t\t{\n\t\t\t\tarray_pop( $tags );\n\t\t\t}\n\t\t}\n\t\tforeach ( $tags as $tag )\n\t\t{\n\t\t\tif ( $strip_content )\n\t\t\t{\n\t\t\t\t$content = '(.+</' . $tag . '[^>]*>|)';\n\t\t\t}\n\n\t\t\t$html = preg_replace( '#</?' . $tag . '[^>]*>' . $content . '#is', '', $html );\n\t\t}\n\n\t\treturn $html;\n\t}", "function removePartialTags($string) {\r\n\t\t$pos_close = strpos($string, \">\");\r\n\t\tif($pos_close != false) {\r\n\t\t\t$string = substr($string, $pos_close + 1);\r\n\t\t}\r\n\t\t$pos_open = strpos($string, \"<\");\r\n\t\tif($pos_open != false) {\r\n\t\t\t$string = substr($string, 0, $pos_open);\r\n\t\t}\r\n\t\t//print('removePartialTags cleaned string: ' . $string);\r\n\t\treturn $string;\r\n\t}", "function sloodle_clean_for_output($str)\n {\n return sloodle_strip_new_lines(strip_tags(stripcslashes(@html_entity_decode($str, ENT_QUOTES, 'UTF-8'))));\n }", "function string_restore_valid_html_tags( $p_string, $p_multiline = true ) \r\n{\r\n\t$t_html_valid_tags = config_get( $p_multiline ? 'html_valid_tags' : 'html_valid_tags_single_line' );\r\n\r\n\tif ( OFF === $t_html_valid_tags || is_blank( $t_html_valid_tags ) ) {\r\n\t\treturn $p_string;\r\n\t}\r\n\r\n\t$tags = explode( ',', $t_html_valid_tags );\r\n\tforeach ($tags as $key => $value) \r\n\t{ \r\n \tif ( !is_blank( $value ) ) {\r\n \t$tags[$key] = trim($value); \r\n }\r\n }\r\n $tags = implode( '|', $tags);\r\n\r\n\t$p_string = preg_replace( '/&lt;(' . $tags . ')\\s*&gt;/ui', '<\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/&lt;\\/(' . $tags . ')\\s*&gt;/ui', '</\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/&lt;(' . $tags . ')\\s*\\/&gt;/ui', '<\\\\1 />', $p_string );\r\n\r\n\r\n\treturn $p_string;\r\n}", "function strip_htmltag($str, $all = TRUE)\n{\n\tglobal $_symbol_noexists;\n\tstatic $noexists_pattern;\n\n\tif (! isset($noexists_pattern))\n\t\t$noexists_pattern = '#<span class=\"noexists\">([^<]*)<a[^>]+>' .\n\t\t\tpreg_quote($_symbol_noexists, '#') . '</a></span>#';\n\n\t// Strip Dagnling-Link decoration (Tags and \"$_symbol_noexists\")\n\t$str = preg_replace($noexists_pattern, '$1', $str);\n\n\tif ($all) {\n\t\t// All other HTML tags\n\t\treturn preg_replace('#<[^>]+>#', '', $str);\n\t} else {\n\t\t// All other anchor-tags only\n\t\treturn preg_replace('#<a[^>]+>|</a>#i', '', $str);\n\t}\n}", "function stripcleantohtml($s){\n\t// Restores the added slashes (ie.: \" I\\'m John \"\n\t// for security in output, and escapes them in htmlentities(ie.: &quot; etc.)\n\t// Also strips any <html> tags it may encounter\n\treturn htmlentities(trim(strip_tags(stripslashes($s))), ENT_NOQUOTES, \"UTF-8\");\n}", "public static function trim_html($string = '')\n\t\t{\n\t\t\t$whitespace = '&nbsp;|\\<br\\>|\\<br\\s*\\/\\>|\\<p\\>(?:&nbsp;)*\\<\\/p\\>';\n\t\t\treturn preg_replace('/^(?:'.$whitespace.')+|(?:'.$whitespace.')+$/', '', (string)$string);\n\t\t}", "function removecomments_html($string) {\n\n //strpos of the opening tag\n $start_position = 0;\n\n //number of tags \"deep\" we are\n $current_count = 0;\n\n //go through the string and remove the tags:\n for ( $p = 0; $p < strlen($string); $p++ ) {\n //find opening tags\n if ( $string[$p] == \"<\" && $string[$p+1] == \"!\"\n && $string[$p+2] == \"-\" && $string[$p+3] == \"-\" )\n {\n $current_count++;\n if ( $current_count == 1 )\n {\n $start_position = $p;\n }\n }\n //find closing tags if applicable.\n if ( $current_count > 0 && $string[$p] == \"-\"\n && $string[$p+1] == \"-\" && $string[$p+2] == \">\")\n {\n $current_count--;\n if ( $current_count == 0 )\n {\n $p = $p + 3;\n $string = substr($string, 0, $start_position) . substr($string, $p);\n $start_position = 0;\n $p = 0;\n }\n }\n }\n\n //handle any uneven tags at the end.\n return substr($string, 0, (strpos($string, \"<!--\") == 0 ? strlen($string) : strpos($string, \"<!--\"))) . \"\\n\";\n }", "function stripHTMLTags( $content ) {\r\n \r\n $search = array (\"'<script[^>]*?>.*?</script>'si\", // Strip out javascript\r\n \"'<\\s*br\\s*(\\/)?>'i\", // Replace brs to spaces\r\n \"'<[\\/\\!]*?[^<>]*?>'si\", // Strip out html tags\r\n \"'([\\r\\n])[\\s]+'\", // Strip out white space\r\n \"'&(quot|#34);'i\", // Replace html entities\r\n \"'&(amp|#38);'i\",\r\n \"'&(lt|#60);'i\",\r\n \"'&(gt|#62);'i\",\r\n \"'&(nbsp|#160);'i\",\r\n \"'&(iexcl|#161);'i\",\r\n \"'&(cent|#162);'i\",\r\n \"'&(pound|#163);'i\",\r\n \"'&(copy|#169);'i\",\r\n \"'&#(\\d+);'\");\r\n \r\n $replace = array (\"\",\r\n \" \",\r\n \"\",\r\n \"\\\\1\",\r\n \"\\\"\",\r\n \"&\",\r\n \"<\",\r\n \">\",\r\n \" \",\r\n chr(161),\r\n chr(162),\r\n chr(163),\r\n chr(169),\r\n \"chr(\\\\1)\");\r\n \r\n $content = preg_replace ($search, $replace, $content);\r\n \r\n return $content;\r\n}", "public static function removeHtml($s)\n {\n $newLinesAfter = 'h1|h2|h3|h4|h5|h6|h7|h8';\n $newLineAfter = 'caption|div|li|p|tr';\n $removeContent = 'script|style|noframes|select|option|link';\n $spaceAfter = 'td|th';\n\n /**///prep the string\n $s = ' ' . preg_replace(\"/[\\\\r\\\\n]+/\", '', $s);\n\n //begin removal\n /**///remove comment blocks\n while(stripos($s,'<!--') > 0){\n $pos[1] = stripos($s,'<!--');\n $pos[2] = stripos($s,'-->', $pos[1]);\n $len[1] = $pos[2] - $pos[1] + 3;\n $x = substr($s,$pos[1],$len[1]);\n $s = str_replace($x,'',$s);\n }\n\n /**///remove tags with content between them\n if(strlen($removeContent) > 0){\n $e = explode('|', $removeContent);\n for($i=0;$i<count($e);$i++){\n while(stripos($s,'<' . $e[$i]) > 0){\n $len[1] = strlen('<' . $e[$i]);\n $pos[1] = stripos($s,'<' . $e[$i]);\n $pos[2] = stripos($s,$e[$i] . '>', $pos[1] + $len[1]);\n $len[2] = $pos[2] - $pos[1] + $len[1];\n $x = substr($s,$pos[1],$len[2]);\n $s = str_replace($x,'',$s);\n }\n }\n }\n\n foreach (explode('|', $newLinesAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \"\\n\\n\", $s);\n }\n foreach (explode('|', $newLineAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \"\\n\", $s);\n }\n foreach (explode('|', $spaceAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \" \", $s);\n }\n\n /**///remove remaining tags\n $start = 0;\n while(stripos($s,'<', $start) > 0){\n $pos[1] = stripos($s,'<', $start);\n $pos[2] = stripos($s,'>', $pos[1]);\n if (!$pos[2]) {\n //No closing tag! Skip this one\n $start = $pos[1]+1;\n } else {\n $len[1] = $pos[2] - $pos[1] + 1;\n $x = substr($s,$pos[1],$len[1]);\n $s = str_replace($x,'',$s);\n }\n }\n\n if (PHP_EOL != \"\\n\") {\n $s = str_replace(\"\\n\", PHP_EOL, $s);\n }\n return html_entity_decode(trim($s), ENT_QUOTES, 'cp1252');\n }", "protected function cleanHTML(string $html) : string\n {\n // $html = str_replace(\"\\n\", '', $html);\n for($i = 0; $i < 3; $i++) {\n $html = str_replace($this->prefixHTML, '', $html);\n $html = str_replace($this->postfixHTML, '', $html);\n $html = str_replace('<?xml version=\"1.0\" standalone=\"yes\"?>', '', $html);\n //remove white space\n $html = preg_replace('/\\s+/', ' ', $html);\n // $html = str_replace('> <', '><', $html);\n }\n\n return $html;\n }", "public static function removeClosingTags(string $text)\n {\n foreach (self::$selfClosing as $tag)\n {\n if (strpos($text, '</'.$tag.'>') !== false)\n {\n $text = str_replace('</'.$tag.'>', '', $text);\n }\n }\n\n return html_entity_decode($text);\n }", "function cleantohtml($s){\n\t// Restores the added slashes (ie.: \" I\\'m John \"\n\t// for security in output, and escapes them in htmlentities(ie.: &quot; etc.)\n\t// It preserves any <html> tags in that they are encoded aswell (like &lt;html&gt;)\n\t// As an extra security, if people would try to inject tags that would become tags\n\t// after stripping away bad characters, we do still strip tags but only after htmlentities,\n\t// so any genuine code examples will stay\n\treturn strip_tags(htmlentities(trim(stripslashes($s)), ENT_NOQUOTES, \"UTF-8\"));\n}", "function regexcleanhtml($text){\n\t//get rid of unneeded spaces\n\t$text=regexspacecleaner($text);\n\t\n\t//lets get rid of weird spacing first so we can make simpler quearies later\n\t$regex_pattern=\"/<\\s/\"; //makes < followed by a space just < (e.g. slkj < slkj = slkj <slkj)\n\t$text = preg_replace($regex_pattern, \"<\", $text);\n\t$regex_pattern=\"/\\s>/\"; //makes > preceded by a space just > (e.g. slkj > slkj = slkj> slkj)\n\t$text = preg_replace($regex_pattern, \">\", $text);\n\t$regex_pattern=\"/<\\/\\s/\";\n\t$text = preg_replace($regex_pattern, \"</\", $text); //makes </ followed by a space just </ (e.g. slkj </ slkj = slkj </slkj)\n\t\n\treturn $text;\n}", "function clean_content($string) {\n $patterns = array(\n '#^\\s*</p>#',\n '#<p>\\s*$#',\n '#<p>(\\s|&nbsp;)*+(<br\\s*/*>)?(\\s|&nbsp;)*</p>#'\n );\n // $patterns = '#<p>(\\s|&nbsp;)*+(<br\\s*/*>)?(\\s|&nbsp;)*</p>#i';\n\n return preg_replace($patterns, '', $string);\n}", "function strip_tags_content($text, $tags = '', $invert = false)\n{\n //removes <br> often found in google result text, which is not handled below\n $text = str_ireplace('<br>', '', $text);\n \n preg_match_all('/<(.+?)[\\s]*\\/?[\\s]*>/si', trim($tags), $tags);\n $tags = array_unique($tags[1]);\n \n if (is_array($tags) and count($tags) > 0) {\n //if invert is false, it will remove all tags except those passed a\n if ($invert == false) {\n return preg_replace('@<(?!(?:'. implode('|', $tags) .')\\b)(\\w+)\\b.*?>.*?</\\1>@si', '', $text);\n //if invert is true, it will remove only the tags passed to this function\n } else {\n return preg_replace('@<('. implode('|', $tags) .')\\b.*?>.*?</\\1>@si', '', $text);\n }\n //if no tags were passed to this function, simply remove all the tags\n } elseif ($invert == false) {\n return preg_replace('@<(\\w+)\\b.*?>.*?</\\1>@si', '', $text);\n }\n \n return $text;\n}", "function clean_html($html)\r\n{\r\n\t$html = preg_replace('/<script\\b[^>]*>(.*?)<\\/script>/is', \"\", $html);\r\n\t$html = preg_replace('/<style\\b[^>]*>(.*?)<\\/style>/is', \"\", $html);\r\n\t$html = preg_replace('/<link \\b[^>]*>(.*?)/is', \"\", $html);\r\n\r\n\treturn $html;\r\n}", "function clean($string){\n\t\t$string = trim($string); //remove white-spacing\n\t\t$string = htmlentities($string); //change to html\n\t\t$string = strip_tags($string); //delete html tags\n\t\treturn $string;\n\t}", "public function stripTags($string, $uiAllowedTags = false)\n {\n $string = str_replace('>', '> ', $string);\n\n if ($uiAllowedTags) {\n return strip_tags($string, $this->htmlTagProvider->getAllowedTags());\n }\n\n $result = trim(strip_tags($string));\n\n return preg_replace('/\\s+/u', ' ', $result);\n }", "function clean2html($s){\n\t\t// Restores the added slashes (ie.: \" I\\'m John \" for security in output, and escapes them in htmlentities(ie.: &quot; etc.)\n\t\t// It preserves any <html> tags in that they are encoded aswell (like &lt;html&gt;)\n\t\t// As an extra security, if people would try to inject tags that would become tags after stripping away bad characters,\n\t\t// we do still strip tags but only after htmlentities, so any genuine code examples will stay\n\t\t// Use: For input fields that may contain html, like a textarea\n\t\treturn strip_tags(htmlentities(trim(stripslashes($s))), ENT_NOQUOTES, \"UTF-8\");\n}", "function clean_inside_tags($txt,$tags){\n\t\t\t$txt =removeemptytags($txt);\n\t\t\tpreg_match_all(\"/<([^>]+)>/i\",$tags,$allTags,PREG_PATTERN_ORDER);\n\t\t\n\t\t\tforeach ($allTags[1] as $tag){\n\t\t\t\t$txt = preg_replace(\"/<\".$tag.\"[^>]*>/i\",\"<\".$tag.\">\",$txt);\n\t\t\t}\n\t\t\treturn $txt;\n\t\t}", "function guy_strip_bad($str, $mode='') {\n global $guy_c;\n $html_allowed = array('a', 'b', 'i', 'p', 'ol', 'ul', 'li', 'blockquote', 'br', 'em', 'sup', 'sub');\n\t$html_allowed_regexp = join('|',$html_allowed);\n\t$html_allowed_striptags = '<'.join('><',$html_allowed).'>';\n\t$str = strip_tags($str,$html_allowed_striptags);\n\t$str = preg_replace_callback(\"/<($html_allowed_regexp)\\b(.*?)>/si\",'guy_attrcheck',$str);\n\t$str = preg_replace('/<\\/([^ \n>]+)[^>]*>/si',$guy_c['lt'].'/$1'.$guy_c['gt'],$str);\n\t$str = preg_replace('#^\\s+$#m','',$str);\n\t$str = safehtml($str);\n\treturn $str;\n}", "function html_strip_unsafe($strData)\n\t\t{\n\t\t // Unsafe HTML tags/attributes that members may abuse\n\t\t $arrData=array(\n\t\t //'/<iframe(.*?)<\\/iframe>/is',\n\t\t '/<title(.*?)<\\/title>/is',\n\t\t '/<pre(.*?)<\\/pre>/is',\n\t\t '/<frame(.*?)<\\/frame>/is',\n\t\t '/<frameset(.*?)<\\/frameset>/is',\n\t\t //'/<object(.*?)<\\/object>/is',\n\t\t '/<script(.*?)<\\/script>/is',\n\t\t //'/<embed(.*?)<\\/embed>/is',\n\t\t '/<applet(.*?)<\\/applet>/is',\n\t\t '/<meta(.*?)>/is',\n\t\t '/<!doctype(.*?)>/is',\n\t\t '/<link(.*?)>/is',\n\t\t '/<body(.*?)>/is',\n\t\t '/<\\/body>/is',\n\t\t '/<head(.*?)>/is',\n\t\t '/<\\/head>/is',\n\t\t '/onload=\"(.*?)\"/is',\n\t\t '/onunload=\"(.*?)\"/is',\n\t\t '/onerror=\"(.*?)\"/is',\n\t\t '/onclick=\"(.*?)\"/is',\n\t\t '/onchange=\"(.*?)\"/is',\n\t\t '/onmouseover=\"(.*?)\"/is',\n\t\t '/autofocus=\"(.*?)\"/is',\n\t\t '/onfocus=\"(.*?)\"/is',\n\t\t '/<html(.*?)>/is',\n\t\t '/<\\/html>/is',\n\t\t );\n\t\t $strData = preg_replace($arrData, \"\", $strData);\n\t\t\t$strData = filter_var($strData, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);\n\n\t\t return $strData;\n\t\t}", "function stripcleantohtml( $s )\r\n\t\t{\r\n\t\t\treturn htmlentities(trim(strip_tags(stripslashes($s))), ENT_NOQUOTES, \"UTF-8\");\r\n\t\t}", "protected function cleanStr($str)\n {\n return html_entity_decode(strip_tags($str), ENT_QUOTES, 'UTF-8');\n }", "static function html_sanitization($input)\r\n {\r\n return strip_tags($input);\r\n }", "public abstract function cleanHTML($content);", "public function cleanUpValue($str)\n {\n return trim($this->escaper->escapeHtml(strip_tags($str)));\n }", "public function safeHtmlToNormalHtml(string $html): string;", "function remove_junk($str){\n $str = nl2br($str);\n $str = htmlspecialchars(strip_tags($str, ENT_QUOTES));\n return $str;\n}", "function remove_non_rss(string $html): string\n{\n $html = preg_replace('%<script.*?>.*?</script>%is', '', $html);\n $html = preg_replace('%<a href=\"#.*?>(.*?)</a>%is', '$1', $html);\n $html = preg_replace('%<a href=\"javascript.*?>(.*?)</a>%is', '$1', $html);\n return $html;\n}", "protected function cleanHtml($html) {\n $chain = new Zend_Filter();\n\n if($this->isFilterTags){\n $chain->addFilter(new Zend_Filter_StripTags(self::$tags));\n }\n $chain->addFilter(new Zend_Filter_StringTrim());\n\n $html = $chain->filter($html);\n\n $tmp = $html;\n while (1) {\n // Try and replace an occurrence of javascript:\n $html = preg_replace('/(<[^>]*)javascript:([^>]*>)/i', '$1$2', $html);\n \n\n // If nothing changed this iteration then break the loop\n if ($html == $tmp)\n break;\n\n $tmp = $html;\n }\n\n return $html;\n }", "function mc_strip_tags() {\n\n\treturn apply_filters( 'mc_strip_tags', '<strong><em><i><b><span><br><a>' );\n}", "public static function sanitize($string)\n {\n $search = array(\n '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n );\n\n $str = strip_tags($string);\n $str = preg_replace($search, '', $str);\n\n return $str;\n }", "function cleantohtml( $s )\r\n\t\t{\r\n\t\t\r\n\t\t\treturn strip_tags(htmlentities(trim(stripslashes($s))), ENT_NOQUOTES, \"UTF-8\");\r\n\t\t}", "function sanitize_html_string($string)\n{\n $pattern[0] = '/\\&/';\n $pattern[1] = '/</';\n $pattern[2] = \"/>/\";\n $pattern[3] = '/\\n/';\n $pattern[4] = '/\"/';\n $pattern[5] = \"/'/\";\n $pattern[6] = \"/%/\";\n $pattern[7] = '/\\(/';\n $pattern[8] = '/\\)/';\n $pattern[9] = '/\\+/';\n $pattern[10] = '/-/';\n $replacement[0] = '&amp;';\n $replacement[1] = '&lt;';\n $replacement[2] = '&gt;';\n $replacement[3] = '<br>';\n $replacement[4] = '&quot;';\n $replacement[5] = '&#39;';\n $replacement[6] = '&#37;';\n $replacement[7] = '&#40;';\n $replacement[8] = '&#41;';\n $replacement[9] = '&#43;';\n $replacement[10] = '&#45;';\n return preg_replace($pattern, $replacement, $string);\n}", "public static function cleanString($content) {\n $content = preg_replace(\"/&#?[a-z0-9]+;/i\",\"\",$content); \n $content = preg_replace(\"/[\\n\\r]/\",\"\",$content);\n $content = strip_tags($content);\n return $content;\n }", "function clean_str($string)\n{\n\t// get rid of tags\n\t$string = strip_tags($string);\n\n\t// get rid of html entities\n\t$string = preg_replace(\"/&#?[a-z0-9]+;/i\", \"\", $string);\n\n\t// trim the string\n\t$string = trim($string);\n\n\treturn (string) $string;\n}", "function clean($string) {\n return html_entity_decode($string);\n \n}", "function escape_html($string) {\n $text = htmlspecialchars($string);\n // $text = strip_tags($string);\n\n return $text;\n}", "public static function html_stripe_empty_tags(string $str): string\n {\n return (string) \\preg_replace(\n '/<[^\\\\/>]*?>\\\\s*?<\\\\/[^>]*?>/u',\n '',\n $str\n );\n }", "public function noHtml(string $string): string\n {\n return htmlentities($string, ENT_QUOTES | ENT_HTML5, 'UTF-8');\n }", "public static function convertHtmlToPlainText($string) {\n return html_entity_decode(strip_tags($string), ENT_COMPAT, 'UTF-8');\n }", "function clean_evil_tags( $t )\n {\n \t$t = preg_replace( \"/javascript/i\" , \"j&#097;v&#097;script\", $t );\n\t\t$t = preg_replace( \"/alert/i\" , \"&#097;lert\" , $t );\n\t\t$t = preg_replace( \"/about:/i\" , \"&#097;bout:\" , $t );\n\t\t$t = preg_replace( \"/onmouseover/i\", \"&#111;nmouseover\" , $t );\n\t\t$t = preg_replace( \"/onclick/i\" , \"&#111;nclick\" , $t );\n\t\t$t = preg_replace( \"/onload/i\" , \"&#111;nload\" , $t );\n\t\t$t = preg_replace( \"/onsubmit/i\" , \"&#111;nsubmit\" , $t );\n\t\t$t = preg_replace( \"/<body/i\" , \"&lt;body\" , $t );\n\t\t$t = preg_replace( \"/<html/i\" , \"&lt;html\" , $t );\n\t\t$t = preg_replace( \"/document\\./i\" , \"&#100;ocument.\" , $t );\n\t\t\n\t\treturn $t;\n }", "function rewrapHTML($str) {\n $pattern = '~(^|>)([^<]+)~';\n return preg_replace_callback($pattern, array(&$this, 'rewrapHTMLCallback'), $str);\n }", "function mc_admin_strip_tags() {\n\n\treturn '<strong><em><i><b><span><a><code><pre>';\n}", "private static function removeParagraphs($string)\n\t{\n\t\t$string = RL_RegEx::replace('^(\\s*</?p[^>]*>)+', '', $string);\n\t\t// Remove trailing paragraph tags\n\t\t$string = RL_RegEx::replace('(</?p[^>]*>\\s*)+$', '', $string);\n\t\t// Replace paragraph tags with double breaks\n\t\t$string = RL_RegEx::replace('(</p>\\s*<p[^>]*>|</?p[^>]*>)', '<br><br>', $string);\n\n\t\treturn $string;\n\t}", "function strip_selected_article_tags($str, $tags = \"\", $stripContent = false)\n\t{\n\t\t$tags = \"<script>\";\n\t\treturn strip_selected_tags($str, $tags, $stripContent);\n\t}", "public function tidyHtml(string $html): string\n {\n // some point.\n return $html;\n }", "function Clean($arr){\n foreach($arr as $key=>$value){\n $arr[$key] = strip_tags($value);\n }\n return $arr;\n}", "public function parseString( $str ) {\n\t\t\n\t\t$allowed_tags = '<a><b><i><u><em><strong><sup><sub><small>';\n\t\t\n\t\treturn strip_tags( $this->parse($str), $allowed_tags );\n\t\t\n\t}", "function yt_rip_tags( $string ) {\n\t\t$string = preg_replace ( '/<[^>]*>/', ' ', $string ); \n\t\t\n\t\t/*\n\t\t * remove control characters\n\t\t */\n\t\t$string = str_replace( \"\\r\", '', $string ); // --- replace with empty space\n\t\t$string = str_replace( \"\\n\", ' ', $string ); // --- replace with space\n\t\t$string = str_replace( \"\\t\", ' ', $string ); // --- replace with space\n\t\t\n\t\t/*\n\t\t * remove multiple spaces\n\t\t */\n\t\t$string = trim( preg_replace( '/ {2,}/', ' ', $string ) );\n\t\t\n\t\treturn $string; \n\t\n\t}", "function untag($string, $tag) {\n\t$tmpval = array();\n\t$preg = \"|<$tag>(.*?)</$tag>|s\";\n\n\tpreg_match_all($preg, $string, $tags);\n\tforeach ($tags[1] as $tmpcont){\n\t\t$tmpval[] = $tmpcont;\n\t}\n\treturn $tmpval;\n}", "public function stdWrap_stripHtml($content = '')\n {\n return strip_tags($content);\n }", "public static function xss_clean($str)\n\t{\n\t\tif (is_array($str))\n\t\t{\n\t\t\tforeach ($str as $i => $s)\n\t\t\t{\n\t\t\t\t// Recursively clean arrays\n\t\t\t\t$str[$i] = Security::xss_clean($s);\n\t\t\t}\n\n\t\t\treturn $str;\n\t\t}\n\n\t\t// Load HTML Purifier\n\t\t$purifier = Security::htmlpurifier();\n\n\t\t// Clean the HTML and return it\n\t\treturn $purifier->purify($str);\n\t}", "function strip_word_doc( $html, $allowed_tags = '' )\n\t{\n\t\tmb_regex_encoding( 'UTF-8' );\n\n\t\t//replace MS special characters first\n\t\t$search = [\n\t\t\t'/&lsquo;/u',\n\t\t\t'/&rsquo;/u',\n\t\t\t'/&ldquo;/u',\n\t\t\t'/&rdquo;/u',\n\t\t\t'/&mdash;/u',\n\t\t];\n\t\t$replace = [\n\t\t\t'\\'',\n\t\t\t'\\'',\n\t\t\t'\"',\n\t\t\t'\"',\n\t\t\t'-',\n\t\t];\n\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t//make sure _all_ html entities are converted to the plain ascii equivalents - it appears\n\t\t//in some MS headers, some html entities are encoded and some aren't\n\t\t$html = html_entity_decode( $html, ENT_QUOTES, 'UTF-8' );\n\n\t\t//try to strip out any C style comments first, since these, embedded in html comments, seem to\n\t\t//prevent strip_tags from removing html comments (MS Word introduced combination)\n\t\tif ( mb_stripos( $html, '/*' ) !== FALSE )\n\t\t{\n\t\t\t$html = mb_eregi_replace( '#/\\*.*?\\*/#s', '', $html, 'm' );\n\t\t}\n\n\t\t//introduce a space into any arithmetic expressions that could be caught by strip_tags so that they won't be\n\t\t//'<1' becomes '< 1'(note: somewhat application specific)\n\t\t$html = preg_replace(\n\t\t\t[\n\t\t\t\t'/<([0-9]+)/',\n\t\t\t], [\n\t\t\t\t'< $1',\n\t\t\t], $html );\n\t\t$html = strip_tags( $html, $allowed_tags );\n\n\t\t//eliminate extraneous whitespace from start and end of line, or anywhere there are two or more spaces, convert it to one\n\t\t$html = preg_replace(\n\t\t\t[\n\t\t\t\t'/^\\s\\s+/',\n\t\t\t\t'/\\s\\s+$/',\n\t\t\t\t'/\\s\\s+/u',\n\t\t\t], [\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t' ',\n\t\t\t], $html );\n\n\t\t//strip out inline css and simplify style tags\n\t\t$search = [\n\t\t\t'#<(strong|b)[^>]*>(.*?)</(strong|b)>#isu',\n\t\t\t'#<(em|i)[^>]*>(.*?)</(em|i)>#isu',\n\t\t\t'#<u[^>]*>(.*?)</u>#isu',\n\t\t];\n\t\t$replace = [\n\t\t\t'<b>$2</b>',\n\t\t\t'<i>$2</i>',\n\t\t\t'<u>$1</u>',\n\t\t];\n\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t//on some of the ?newer MS Word exports, where you get conditionals of the form 'if gte mso 9', etc., it appears\n\t\t//that whatever is in one of the html comments prevents strip_tags from eradicating the html comment that contains\n\t\t//some MS Style Definitions - this last bit gets rid of any leftover comments */\n\t\t$num_matches = preg_match_all( \"/\\<!--/u\", $html, $matches );\n\t\tif ( $num_matches )\n\t\t{\n\t\t\t$html = preg_replace( '/\\<!--(.)*--\\>/isu', '', $html );\n\t\t}\n\n\t\treturn $html;\n\t}", "function cleanup($html, $options = null) \n { \n if(isset($options) && is_array($options)){ \n $this->setOptions($options); \n } \n $this->_html = \"{$html}\"; \n\n if($this->_options['UseTidy'] && $this->_options['TidyBefore']){ \n $this->tidyClean(); \n } \n\n // Remove escape slashes \n $this->_html = stripslashes($this -> _html); \n\n if($this->_options['CleaningMethod']['tags'] == \"whitelist\"){ \n // Trim everything before body tag, leaving possible body attributes \n if(preg_match(\"/<body/i\", \"{$this -> _html}\")){ \n $this -> html = stristr($this -> _html, \"<body\"); \n } \n\n // strip tags, still leaving attributes, second variable is allowed tags \n $this->_html = strip_tags($this->_html, $this->_tag_whitelist); \n } \n\n if($this->_options['RemoveStyles']){ \n // Remove class and style attributes \n $this->removeBlacklistedAttributes(\"class|style\"); \n } \n\n if($this->_options['IsWord']){ \n $this->removeBlacklistedAttributes(\"lang|[ovwxp]:\\w+\"); \n } \n\n if($this->_options['CleaningMethod']['attributes'] == \"blacklist\"){ \n if(!empty ($this->_attrib_blacklist)){ \n $this->removeBlacklistedAttributes($this->_attrib_blacklist); \n } \n } \n\n if($this->_options['Optimize']){ \n $repl = 1; \n while($repl){ \n $repl = 0; \n foreach($this->_cleanup_tags as $tag){ \n // Strip empty inline tags \n $this -> _html = preg_replace(\"/<($tag)[^>]*>[\\s]*([(&nbsp;)]*)[\\s]*<\\/($tag)>/i\",\"\\\\2\", $this -> _html,-1,$count); \n $repl += $count; \n\n // Merge inline tags \n $this -> _html = preg_replace(\"/<\\/($tag)[^>]*>[\\s]*([(&nbsp;)]*)[\\s]*<($tag)>/i\",\"\\\\2\", $this -> _html,-1,$count); \n $repl += $count; \n } \n } \n\n // Drop empty paragraph tags \n if($this->_options['DropEmptyParas']){ \n $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\\s]*[(&nbsp;)]*[\\s]*<\\/(p|h[1-6]{1})>/i',\"\\r\\n\", $this -> _html); \n } \n\n // Trim extra spaces only if tidy is not set to indent \n if(!$this->_tidy_config['indent']){ \n // Trim extra spaces between words \n $this -> _html = preg_replace('/([^<>])[\\s]+([^<>])/i',\"\\\\1 \\\\2\", $this -> _html); \n\n // Trim extra spaces before tags \n $this -> _html = preg_replace('/[\\n|\\r|\\r\\n|][\\n|\\r|\\r\\n|]+</i',\"<\", $this -> _html); \n } \n } \n\n if($this->_options['DropEmptyParas'] && !$this->_options['Optimize']){ \n $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\\s]*[(&nbsp;)]*[\\s]*<\\/(p|h[1-6]{1})>/i',\"\\r\\n\", $this -> _html); \n } \n\n if($this->_options['FillEmptyTableCells']) { \n $this -> _html = preg_replace(\"/<td([^>]*)>[\\s]*<\\/td>/i\", \"<td\\\\1>&nbsp;</td>\", $this -> _html); \n } \n\n if($this->_options['Compress']){ \n // Trim spaces after tags \n $this -> _html = preg_replace('/>[\\s]+/',\">\", $this -> _html); \n\n // Trim spaces before end tags \n $this -> _html = preg_replace('/[\\s]+<\\//',\"</\", $this -> _html); \n\n // Trim spaces before tags \n $this -> _html = preg_replace('/[\\s]+</',\"<\", $this -> _html); \n\n // Trim extra spaces between words \n $this -> _html = preg_replace('/([^<>])[\\s]+([^<>])/',\"\\\\1 \\\\2\", $this -> _html); \n } \n\n if($this->_options['UseTidy'] && !$this->_options['TidyBefore']){ \n $this->tidyClean(); \n } \n return $this->output(\"{$this->_html}\"); \n }" ]
[ "0.804943", "0.8006684", "0.7999918", "0.79522073", "0.7798536", "0.7690215", "0.7681195", "0.76367205", "0.7569959", "0.7561783", "0.75556666", "0.75372773", "0.7520305", "0.7506479", "0.75035286", "0.74759746", "0.7461835", "0.7436526", "0.7379716", "0.73717606", "0.7324756", "0.7311947", "0.73083687", "0.730122", "0.7276423", "0.72353256", "0.7226605", "0.71765006", "0.71756554", "0.71402615", "0.7127163", "0.71254295", "0.709176", "0.707018", "0.7034235", "0.701937", "0.70121074", "0.69734424", "0.69734424", "0.69713813", "0.6904621", "0.6883823", "0.6834027", "0.6828022", "0.682713", "0.68062675", "0.6804912", "0.6796109", "0.6792273", "0.6792164", "0.6769585", "0.67579937", "0.6755139", "0.6731691", "0.6728596", "0.67202485", "0.6719138", "0.6718618", "0.66877747", "0.6682033", "0.66637635", "0.66436124", "0.6636047", "0.6631608", "0.66314554", "0.6629418", "0.66078424", "0.6585882", "0.657996", "0.6570081", "0.65192556", "0.6501222", "0.65008986", "0.6497972", "0.6487265", "0.6478981", "0.6455417", "0.64308983", "0.6428998", "0.6407134", "0.6394192", "0.6386832", "0.6365764", "0.6357655", "0.6355224", "0.6353785", "0.6345108", "0.6322428", "0.631733", "0.6315195", "0.6313428", "0.63035136", "0.629623", "0.6290899", "0.6278464", "0.6274", "0.62703586", "0.62671477", "0.6259806", "0.62549806", "0.62535894" ]
0.0
-1
Remove any solo tags which do not have attributes in them; useless tags etc.
public static function cleanTagsWithoutAttributes(array $tags, string $html): string { $empty_tags = implode('|', ArrayTools::preg_quote($tags, '|')); return preg_replace('|<(' . $empty_tags . ')>([^<>]*)</\1>|i', '$2', $html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeAllTags() {}", "function clean_inside_tags($txt,$tags){\n\t\t\t$txt =removeemptytags($txt);\n\t\t\tpreg_match_all(\"/<([^>]+)>/i\",$tags,$allTags,PREG_PATTERN_ORDER);\n\t\t\n\t\t\tforeach ($allTags[1] as $tag){\n\t\t\t\t$txt = preg_replace(\"/<\".$tag.\"[^>]*>/i\",\"<\".$tag.\">\",$txt);\n\t\t\t}\n\t\t\treturn $txt;\n\t\t}", "function wpmantis_strip_only($str, $tags, $stripContent = false)\n{\n $content = '';\n if(!is_array($tags)) {\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n foreach($tags as $tag) {\n if ($stripContent)\n $content = '(.+</'.$tag.'[^>]*>|)';\n $str = preg_replace('#</?'.$tag.'[^>]*>'.$content.'#is', '', $str);\n }\n return $str;\n}", "function DOM_delete_empty_attributes() {\r\n\t\t$query = '//' . ReTidy::get_html_namespace() . '*[@*=\"\"]';\r\n\t\t$tags_with_empty_attribute = $this->xpath->query($query);\r\n\t\tforeach($tags_with_empty_attribute as $tag) {\r\n\t\t\t$tagName = $tag->nodeName;\r\n\t\t\t$array_attributes = DTD::getAttributesForElementByType($tagName, \"#IMPLIED\");\r\n\t\t\tforeach($tag->attributes as $attribute) {\r\n\t\t\t\tif(strlen($attribute->nodeValue) === 0) {\r\n\t\t\t\t\tforeach($array_attributes as $attribute2){\r\n\t\t\t\t\t\tif($attribute->nodeName === $attribute2) {\r\n\t\t\t\t\t\t\t$attribute->nodeValue = \"XXX9o9stripme9o9XXX\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function remove_tags_intra_tags() {\r\n\t\t$ct_intra_tags = 0;\r\n\t\t$ct2 = -1;\r\n\t\twhile($ct2 != 0) {\r\n\t\t\t/*preg_match_all('/(<[^>]*)<[^<>]+?>/is', $this->code, $debug_matches);\r\n\t\t\tprint('$debug_matches: ');var_dump($debug_matches);*/\r\n\t\t\t$this->code = preg_replace('/(<(![^\\-][^<>]+|[^!<>]+))<[^<>]+?>/is', '$1', $this->code, -1, $ct2); // changed (2012-01-25)\r\n\t\t\t$ct_intra_tags += $ct2;\r\n\t\t}\r\n\t\t$this->logMsgIf(\"tags intra tags removed\", $ct_intra_tags);\r\n\t\t// we must also ignore the <head>!\r\n\t\t// the only tag that has content in the head that I can think of is <title>, so:\r\n\t\tpreg_match_all('/<title>(.*?)<\\/title>/is', $this->code, $title_matches);\r\n\t\tif(sizeof($title_matches[0]) > 1) {\r\n\t\t\tprint(\"Well, that's not good; found more than one (\" . sizeof($title_matches[0]) . \") &lt;title&gt; tags on this page!\");exit(0);\r\n\t\t}\r\n\t\tif(sizeof($title_matches[0]) === 0) {\r\n\t\t\t// nothing to do\r\n\t\t} else {\r\n\t\t\t$ct_title = 0;\r\n\t\t\t$initial_title_string = $title_string = $title_matches[0][0];\r\n\t\t\t$ct1 = -1;\r\n\t\t\r\n\t\t\twhile($ct1 != 0) {\r\n\t\t\t\t$title_string = preg_replace('/<title>(.*?)<[^<>]+?>(.*?)<\\/title>/is', '<title>$1$2</title>', $title_string, -1, $ct1);\r\n\t\t\t\t$ct_title += $ct1;\r\n\t\t\t}\r\n\t\t\t$this->code = str_replace($initial_title_string, $title_string, $this->code);\r\n\t\t}\r\n\t\t$this->logMsgIf(\"tags removed from title tag\", $ct_title);\r\n\t\t// this should only happen if something exists in both the acronyms and abbr files (erroneously) or if\r\n\t\t// an bbreviation is a substring of another abbreviation but we'll still clean it up\r\n\t\t//$this->code = preg_replace('/<(abbr|acronym) title=\"([^\"]*?)\"><(abbr|acronym) title=\"([^\"]*?)\">(.*?)<\\/(abbr|acronym)><\\/(abbr|acronym)>/is', '<$1 title=\"$2\">$4</$5>', $this->code, -1, $ct_redundant_acro);\r\n\t\t$ct_redundant_acro = 0;\r\n\t\t$array_tags = array('abbr', 'acronym');\r\n\t\t$tagNamesString = implode('|', $array_tags);\r\n\t\tforeach($array_tags as $tagName) {\r\n\t\t\t$OStrings = OM::getAllOStrings($this->code, '<' . $tagName, '</' . $tagName . '>');\r\n\t\t\t//var_dump($OStrings);exit(0);\r\n\t\t\t$counter = sizeof($OStrings) - 1;\r\n\t\t\twhile($counter >= 0) {\r\n\t\t\t\t$OString = $OStrings[$counter][0];\r\n\t\t\t\t$opening_tag = substr($OString, 0, strpos($OString, '>') + 1);\r\n\t\t\t\t$closing_tag = substr($OString, ReTidy::strpos_last($OString, '<'));\r\n\t\t\t\t$code_to_clean = substr($OString, strlen($opening_tag), strlen($OString) - strlen($opening_tag) - strlen($closing_tag));\r\n\t\t\t\t$needs_to_be_cleaned = false;\r\n\t\t\t\tforeach($array_tags as $tagName2) {\r\n\t\t\t\t\tif(strpos($code_to_clean, '<' . $tagName2) !== false) {\r\n\t\t\t\t\t\t$needs_to_be_cleaned = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif($needs_to_be_cleaned) {\r\n\t\t\t\t\t$offset = $OStrings[$counter][1];\r\n\t\t\t\t\t$code_to_clean = preg_replace('/<(' . $tagNamesString . ')[^<>]*?>/is', '', $code_to_clean);\r\n\t\t\t\t\t$code_to_clean = preg_replace('/<\\/(' . $tagNamesString . ')>/is', '', $code_to_clean);\r\n\t\t\t\t\t$new_OString = $opening_tag . $code_to_clean . $closing_tag;\r\n\t\t\t\t\t$this->code = substr($this->code, 0, $offset) . $new_OString . substr($this->code, $offset + strlen($OString));\r\n\t\t\t\t\t$ct_redundant_acro += 1;\r\n\t\t\t\t}\r\n\t\t\t\t$counter--;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->logMsgIf(\"redundant acronyms applications removed\", $ct_redundant_acro);\r\n\t}", "function strip_selected_tags($str, $tags = \"\", $stripContent = false)\n {\n preg_match_all(\"/<([^>]+)>/i\",$tags,$allTags,PREG_PATTERN_ORDER);\n foreach ($allTags[1] as $tag){\n if ($stripContent) {\n $str = preg_replace(\"/<\".$tag.\"[^>]*>.*<\\/\".$tag.\">/iU\",\"\",$str);\n }\n $str = preg_replace(\"/<\\/?\".$tag.\"[^>]*>/iU\",\"\",$str);\n }\n return $str;\n }", "function sanitize(\n $html,\n $tags_to_remove = ['script', 'iframe', 'input', 'form'],\n $attributes_to_keep = ['title', 'href', 'src'],\n $text_to_keep = []\n) {\n $htmlContent = str_get_html($html);\n\n foreach ($htmlContent->find('*') as $element) {\n if (in_array($element->tag, $text_to_keep)) {\n $element->outertext = $element->plaintext;\n } elseif (in_array($element->tag, $tags_to_remove)) {\n $element->outertext = '';\n } else {\n foreach ($element->getAllAttributes() as $attributeName => $attribute) {\n if (!in_array($attributeName, $attributes_to_keep)) {\n $element->removeAttribute($attributeName);\n }\n }\n }\n }\n\n return $htmlContent;\n}", "function wp_strip_all_tags($text, $remove_breaks = \\false)\n {\n }", "function strips_all_tags( $html )\n\t{\n\t\t$search = [\n\t\t\t'@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments including CDATA\n\t\t];\n\t\t$result = preg_replace( $search, '', $html );\n\n\t\treturn $result;\n\t}", "function strip_only($str, $tags) {\n if(!is_array($tags)) {\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n foreach($tags as $tag) $str = preg_replace('#</?'.$tag.'[^>]*>#is', '', $str);\n return $str;\n}", "function filter_tags($string)\n{\n return preg_replace('/<[^>]*>/', ' ', $string);\n}", "function strip_html_tags($str){\n $str = preg_replace('/(<|>)\\1{2}/is', '', $str);\n $str = preg_replace(\n array(// Remove invisible content\n '@<head[^>]*?>.*?</head>@siu',\n '@<style[^>]*?>.*?</style>@siu',\n '@<script[^>]*?.*?</script>@siu',\n '@<noscript[^>]*?.*?</noscript>@siu',\n ),\n \"\", //replace above with nothing\n $str );\n $str = replaceWhitespace($str);\n $str = strip_tags($str);\n return $str;\n}", "function mc_strip_tags() {\n\n\treturn apply_filters( 'mc_strip_tags', '<strong><em><i><b><span><br><a>' );\n}", "public static function globalNestingCorrectlyRemovesInvalidTagsDataProvider() {}", "function strip_only(&$str, $tags)\n{\n\tif(isset($str) && is_array($str))\n\t\treturn $str;\n if(!is_array($tags))\n\t{\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n\n\t$size = sizeof($tags);\n\t$keys = array_keys($tags);\n\tfor ($i=0; $i<$size; $i++)\n\t{\n\t\t$tag = $tags[$keys[$i]];\n\t\tif(isset($tag) && is_array($tag))\n\t\t\t$str = strip_only($str, $tag);\n\t\telse\n\t\t{\n\t\t\tif(stripos($str, $tag) !== false)\n\t\t\t\t$str = preg_replace('#</?'.$tag.'[^>]*>#is', '', $str);\n\t\t}\n\t}\n\treturn $str;\n}", "function strip_htmltag($str, $all = TRUE)\n{\n\tglobal $_symbol_noexists;\n\tstatic $noexists_pattern;\n\n\tif (! isset($noexists_pattern))\n\t\t$noexists_pattern = '#<span class=\"noexists\">([^<]*)<a[^>]+>' .\n\t\t\tpreg_quote($_symbol_noexists, '#') . '</a></span>#';\n\n\t// Strip Dagnling-Link decoration (Tags and \"$_symbol_noexists\")\n\t$str = preg_replace($noexists_pattern, '$1', $str);\n\n\tif ($all) {\n\t\t// All other HTML tags\n\t\treturn preg_replace('#<[^>]+>#', '', $str);\n\t} else {\n\t\t// All other anchor-tags only\n\t\treturn preg_replace('#<a[^>]+>|</a>#i', '', $str);\n\t}\n}", "function remove_tags( $html, $tags, $strip_content = FALSE )\n\t{\n\t\t$content = '';\n\t\tif ( ! is_array( $tags ) )\n\t\t{\n\t\t\t$tags = ( strpos( $html, '>' ) !== FALSE ? explode( '>', str_replace( '<', '', $tags ) ) : [ $tags ] );\n\t\t\tif ( end( $tags ) == '' )\n\t\t\t{\n\t\t\t\tarray_pop( $tags );\n\t\t\t}\n\t\t}\n\t\tforeach ( $tags as $tag )\n\t\t{\n\t\t\tif ( $strip_content )\n\t\t\t{\n\t\t\t\t$content = '(.+</' . $tag . '[^>]*>|)';\n\t\t\t}\n\n\t\t\t$html = preg_replace( '#</?' . $tag . '[^>]*>' . $content . '#is', '', $html );\n\t\t}\n\n\t\treturn $html;\n\t}", "private function removeTagsWithMultiplication() {\n\t\t$special = array(\n\t\t\t// TagText-TagAttribut => Multiplikate\n\t\t\t'img-alt' => 3,\n\t\t\t'img-title' => 4,\n\t\t\t'a-title' => 5,\n\t\t\t'a' => 5,\n\t\t\t'h1' => 20,\n\t\t\t'h2' => 9,\n\t\t\t'h3' => 8,\n\t\t\t'h4' => 7,\n\t\t\t'h5' => 6,\n\t\t\t'h6' => 5,\n\t\t\t'b' => 4,\n\t\t\t'u' => 3,\n\t\t\t'i' => 2,\n\t\t\t'em' => 3,\n\t\t\t'strong' => 4,\n\t\t\t'cite' => 2,\n\t\t\t'blockquote' => 2\n\t\t);\n\t\tforeach ($special as $tag => $multis) {\n\t\t\tif (strpos($tag, '-') !== false) {\n\t\t\t\t$split = explode('-', $tag);\n\t\t\t\t$tag = $split[0];\n\t\t\t\t$attr = $split[1];\n\t\t\t\t$this->html = preg_replace('#<'.$tag.'[^>]*'.$attr.'=\"([^\"]*)\"[^>]*>#i', str_repeat(' $1 ', $multis), $this->html);\n\t\t\t} else {\n\t\t\t\t$this->html = preg_replace('#<'.$tag.'(>|\\s.*?>)(.*?)</'.$tag.'>#is', str_repeat(' $2 ', $multis), $this->html);\n\t\t\t}\n\t\t}\n\t\t$this->html = strip_tags($this->html);\n\t}", "function get_tags_clean()\n{\n $tmp_tags = array();\n $tags = get_tags();\n foreach ($tags as $tag) {\n array_push($tmp_tags, $tag['name']);\n }\n $tags = $tmp_tags;\n\n return $tags;\n}", "function ind_delete_extra_tags($content) {\n\t//Delete the chapters tags, because we don't need them\n\t$search = \"@(?:<p>)*\\s*\\[chapters\\]\\s*(?:</p>)*@i\";\n\t$content = preg_replace($search, '', $content);\n\t\n\t//Delete the chapters tags, because we don't need them\n\t$search = \"@(?:<p>)*\\s*\\[chapters\\s*:\\s*(\\d+)(||,left|,right)\\]\\s*(?:</p>)*@i\";\n\t$content = preg_replace($search, '', $content);\n\n\treturn $content;\n}", "function jpk_remove_unwanted_tags() {\n\tremove_filter( 'jetpack_open_graph_tags', 'wpcom_twitter_cards_tags' );\n\tremove_filter( 'jetpack_open_graph_tags', 'change_twitter_site_param' );\n}", "function strips_tags( $html, $disallowed_tag = 'script|style|noframes|select|option', $allowed_tag = '' )\n\t{\n\t\t//prep the string\n\t\t$html = ' ' . $html;\n\n\t\t//initialize keep tag logic\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\t$k = explode( '|', $allowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '<' . $k[ $i ], '[{(' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '</' . $k[ $i ], '[{(/' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\t\t//begin removal\n\t\t//remove comment blocks\n\t\twhile ( stripos( $html, '<!--' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<!--' );\n\t\t\t$pos[ 2 ] = stripos( $html, '-->', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 3;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//remove tags with content between them\n\t\tif ( strlen( $disallowed_tag ) > 0 )\n\t\t{\n\t\t\t$e = explode( '|', $disallowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $e ); $i++ )\n\t\t\t{\n\t\t\t\twhile ( stripos( $html, '<' . $e[ $i ] ) > 0 )\n\t\t\t\t{\n\t\t\t\t\t$len[ 1 ] = strlen( '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 1 ] = stripos( $html, '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 2 ] = stripos( $html, $e[ $i ] . '>', $pos[ 1 ] + $len[ 1 ] );\n\t\t\t\t\t$len[ 2 ] = $pos[ 2 ] - $pos[ 1 ] + $len[ 1 ];\n\t\t\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 2 ] );\n\t\t\t\t\t$html = str_replace( $x, '', $html );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//remove remaining tags\n\t\twhile ( stripos( $html, '<' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<' );\n\t\t\t$pos[ 2 ] = stripos( $html, '>', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 1;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//finalize keep tag\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '[{(' . $k[ $i ], '<' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '[{(/' . $k[ $i ], '</' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\n\t\treturn trim( $html );\n\t}", "function noTag($temp){\n\t$data\t= strip_tags($temp, \"<img \");\n\t$data\t= strip_tags($temp, \"<table \");\n\t$data\t= strip_tags($temp, \"<font \");\n\t$data\t= strip_tags($temp, \"<span \");\t\n\t$data\t= strip_tags($temp, \"<p \");\t\t\n\treturn $data;\n}", "function trim_tags($info)\n\t\t{\n\t\t $i=0;\n\t\t while(!empty($info[$i]))\n\t\t {\n\t\t\t$info[$i]=strip_tags($info[$i]);\n\t\t\t$i++;\n\t\t }\n\t\t return $info;\n\t\t\n\t\t}", "function mc_admin_strip_tags() {\n\n\treturn '<strong><em><i><b><span><a><code><pre>';\n}", "public static function localNestingCorrectlyRemovesInvalidTagsDataProvider() {}", "function strip_all_tags($content)\n{\n\t$content = preg_replace('/\\n/',' ',$content);\n\t$content = preg_replace('/<script.*<\\/script>/U',' ',$content);\n\t$content = preg_replace('/<style.*<\\/style>/U',' ',$content);\n\t$content = strip_tags($content);\n\treturn $content;\n}", "function filterTags($source) {\n\t\t// filter pass setup\n\t\t$preTag = NULL;\n\t\t$postTag = $source;\n\t\t// find initial tag's position\n\t\t$tagOpen_start = strpos($source, '<');\n\t\t// interate through string until no tags left\n\t\twhile($tagOpen_start !== FALSE) {\n\t\t\t// process tag interatively\n\t\t\t$preTag .= substr($postTag, 0, $tagOpen_start);\n\t\t\t$postTag = substr($postTag, $tagOpen_start);\n\t\t\t$fromTagOpen = substr($postTag, 1);\n\t\t\t// end of tag\n\t\t\t$tagOpen_end = strpos($fromTagOpen, '>');\n\t\t\tif ($tagOpen_end === false) break;\n\t\t\t// next start of tag (for nested tag assessment)\n\t\t\t$tagOpen_nested = strpos($fromTagOpen, '<');\n\t\t\tif (($tagOpen_nested !== false) && ($tagOpen_nested < $tagOpen_end)) {\n\t\t\t\t$preTag .= substr($postTag, 0, ($tagOpen_nested+1));\n\t\t\t\t$postTag = substr($postTag, ($tagOpen_nested+1));\n\t\t\t\t$tagOpen_start = strpos($postTag, '<');\n\t\t\t\tcontinue;\n\t\t\t} \n\t\t\t$tagOpen_nested = (strpos($fromTagOpen, '<') + $tagOpen_start + 1);\n\t\t\t$currentTag = substr($fromTagOpen, 0, $tagOpen_end);\n\t\t\t$tagLength = strlen($currentTag);\n\t\t\tif (!$tagOpen_end) {\n\t\t\t\t$preTag .= $postTag;\n\t\t\t\t$tagOpen_start = strpos($postTag, '<');\t\t\t\n\t\t\t}\n\t\t\t// iterate through tag finding attribute pairs - setup\n\t\t\t$tagLeft = $currentTag;\n\t\t\t$attrSet = array();\n\t\t\t$currentSpace = strpos($tagLeft, ' ');\n\t\t\t// is end tag\n\t\t\tif (substr($currentTag, 0, 1) == \"/\") {\n\t\t\t\t$isCloseTag = TRUE;\n\t\t\t\tlist($tagName) = explode(' ', $currentTag);\n\t\t\t\t$tagName = substr($tagName, 1);\n\t\t\t// is start tag\n\t\t\t} else {\n\t\t\t\t$isCloseTag = FALSE;\n\t\t\t\tlist($tagName) = explode(' ', $currentTag);\n\t\t\t}\t\t\n\t\t\t// excludes all \"non-regular\" tagnames OR no tagname OR remove if xssauto is on and tag is blacklisted\n\t\t\tif ((!preg_match(\"/^[a-z][a-z0-9]*$/i\",$tagName)) || (!$tagName) || ((in_array(strtolower($tagName), $this->tagBlacklist)) && ($this->xssAuto))) { \t\t\t\t\n\t\t\t\t$postTag = substr($postTag, ($tagLength + 2));\n\t\t\t\t$tagOpen_start = strpos($postTag, '<');\n\t\t\t\t// don't append this tag\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// this while is needed to support attribute values with spaces in!\n\t\t\twhile ($currentSpace !== FALSE) {\n\t\t\t\t$fromSpace = substr($tagLeft, ($currentSpace+1));\n\t\t\t\t$nextSpace = strpos($fromSpace, ' ');\n\t\t\t\t$openQuotes = strpos($fromSpace, '\"');\n\t\t\t\t$closeQuotes = strpos(substr($fromSpace, ($openQuotes+1)), '\"') + $openQuotes + 1;\n\t\t\t\t// another equals exists\n\t\t\t\tif (strpos($fromSpace, '=') !== FALSE) {\n\t\t\t\t\t// opening and closing quotes exists\n\t\t\t\t\tif (($openQuotes !== FALSE) && (strpos(substr($fromSpace, ($openQuotes+1)), '\"') !== FALSE))\n\t\t\t\t\t\t$attr = substr($fromSpace, 0, ($closeQuotes+1));\n\t\t\t\t\t// one or neither exist\n\t\t\t\t\telse $attr = substr($fromSpace, 0, $nextSpace);\n\t\t\t\t// no more equals exist\n\t\t\t\t} else $attr = substr($fromSpace, 0, $nextSpace);\n\t\t\t\t// last attr pair\n\t\t\t\tif (!$attr) $attr = $fromSpace;\n\t\t\t\t// add to attribute pairs array\n\t\t\t\t$attrSet[] = $attr;\n\t\t\t\t// next inc\n\t\t\t\t$tagLeft = substr($fromSpace, strlen($attr));\n\t\t\t\t$currentSpace = strpos($tagLeft, ' ');\n\t\t\t}\n\t\t\t// appears in array specified by user\n\t\t\t$tagFound = in_array(strtolower($tagName), $this->tagsArray);\t\t\t\n\t\t\t// remove this tag on condition\n\t\t\tif ((!$tagFound && $this->tagsMethod) || ($tagFound && !$this->tagsMethod)) {\n\t\t\t\t// reconstruct tag with allowed attributes\n\t\t\t\tif (!$isCloseTag) {\n\t\t\t\t\t$attrSet = $this->filterAttr($attrSet);\n\t\t\t\t\t$preTag .= '<' . $tagName;\n\t\t\t\t\tfor ($i = 0; $i < count($attrSet); $i++)\n\t\t\t\t\t\t$preTag .= ' ' . $attrSet[$i];\n\t\t\t\t\t// reformat single tags to XHTML\n\t\t\t\t\tif (strpos($fromTagOpen, \"</\" . $tagName)) $preTag .= '>';\n\t\t\t\t\telse $preTag .= ' />';\n\t\t\t\t// just the tagname\n\t\t\t } else $preTag .= '</' . $tagName . '>';\n\t\t\t}\n\t\t\t// find next tag's start\n\t\t\t$postTag = substr($postTag, ($tagLength + 2));\n\t\t\t$tagOpen_start = strpos($postTag, '<');\t\t\t\n\t\t}\n\t\t// append any code after end of tags\n\t\t$preTag .= $postTag;\n\t\treturn $preTag;\n\t}", "protected function clearNoneHumanTags()\n {\n $filter = $this->DOM->filter('script');\n\n $filter->each(function (Crawler $crawler) {\n foreach ($crawler as $node) {\n $node->parentNode->removeChild($node);\n }\n });\n }", "function trim_tags2($info)\n\t\t{\n\t\t $i=0;\n\t\t while(!empty($info[$i]))\n\t\t {\n\t\t\t$info[$i]=strip_tags($info[$i]);\n\t\t\t$i++;\n\t\t }\n\t\t return $info;\n\t\t\n\t\t}", "function filterHTMLTags( $text )\n{\n $text = preg_replace(\n array(\n // Remove invisible content\n '@<head[^>]*?>.*?</head>@siu',\n '@<style[^>]*?>.*?</style>@siu',\n '@<script[^>]*?.*?</script>@siu',\n '@<object[^>]*?.*?</object>@siu',\n '@<embed[^>]*?.*?</embed>@siu',\n '@<applet[^>]*?.*?</applet>@siu',\n '@<noframes[^>]*?.*?</noframes>@siu',\n '@<noscript[^>]*?.*?</noscript>@siu',\n '@<noembed[^>]*?.*?</noembed>@siu',\n // Add line breaks before and after blocks\n '@</?((address)|(blockquote)|(center)|(del))@iu',\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n '@</?((table)|(th)|(td)|(caption))@iu',\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n '@</?((frameset)|(frame)|(iframe))@iu',\n ),\n array(\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n \"\\n\\$0\", \"\\n\\$0\",\n ),\n $text );\n return strip_tags( $text );\n}", "function fett_process_html_tag(&$vars) {\n if (theme_get_setting('fett_html_tags')) {\n $el = &$vars['element'];\n\n // Remove type=\"...\" and CDATA prefix/suffix.\n unset($el['#attributes']['type'], $el['#value_prefix'], $el['#value_suffix']);\n\n // Remove media=\"all\" but leave others unaffected.\n if (isset($el['#attributes']['media']) && $el['#attributes']['media'] === 'all') {\n unset($el['#attributes']['media']);\n }\n }\n}", "function strip_tags_content($text, $tags = '', $invert = false)\n{\n //removes <br> often found in google result text, which is not handled below\n $text = str_ireplace('<br>', '', $text);\n \n preg_match_all('/<(.+?)[\\s]*\\/?[\\s]*>/si', trim($tags), $tags);\n $tags = array_unique($tags[1]);\n \n if (is_array($tags) and count($tags) > 0) {\n //if invert is false, it will remove all tags except those passed a\n if ($invert == false) {\n return preg_replace('@<(?!(?:'. implode('|', $tags) .')\\b)(\\w+)\\b.*?>.*?</\\1>@si', '', $text);\n //if invert is true, it will remove only the tags passed to this function\n } else {\n return preg_replace('@<('. implode('|', $tags) .')\\b.*?>.*?</\\1>@si', '', $text);\n }\n //if no tags were passed to this function, simply remove all the tags\n } elseif ($invert == false) {\n return preg_replace('@<(\\w+)\\b.*?>.*?</\\1>@si', '', $text);\n }\n \n return $text;\n}", "function remove_html_tag_news($data){\n\treturn preg_replace('/ style=\".*?\"/i', '$1', strip_tags($data, '<i><a><b><u><div><hr>'));\n}", "function non_DOM_deleteme($opening_tag_string) {\r\n\t\tpreg_match_all('/' . $opening_tag_string . '/is', $this->code, $matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\tpreg_match('/<(\\w+)/is', $matches[0][$size][0], $tagname_matches);\r\n\t\t\t$tagname = $tagname_matches[1];\r\n\t\t\t$OString = OM::getOString($this->code, '<' . $tagname, '</' . $tagname . '>', $matches[0][$size][1]);\r\n\t\t\t$this->code = substr($this->code, 0, $matches[0][$size][1]) . substr($this->code, $matches[0][$size][1] + strlen($OString));\r\n\t\t\t$size--;\r\n\t\t}\r\n\t}", "function clean_redundant_sufficient_inline() {\r\n\t\t// dirty generator (word). the point is it cannot be done on <span>s since they are not inherently sufficient for a sort of styling (and perhaps that is why this was overlooked).\r\n\t\t// notice also that this only treats simple cases (tags without attributes) of which there may be a fair number.\r\n\t\t// this array is ordered so that tag names that are substrings of other tag names are done last (b)\r\n\t\t$sufficient_inlines = array('big', 'small', 'em', 'strong', 'sub', 'sup', 'strike', 'blink', 'i', 'b', 'u');\r\n\t\tforeach($sufficient_inlines as $sufficient_inline) {\r\n\t\t\t$opening_part = '<' . $sufficient_inline;\r\n\t\t\t$closing_part = '</' . $sufficient_inline . '>';\r\n\t\t\t$strlen_opening_part = strlen($opening_part);\r\n\t\t\t$strlen_closing_part = strlen($closing_part);\r\n\t\t\t$OStrings = OM::getAllOstrings($this->code, $opening_part, $closing_part);\r\n\t\t\t$index = sizeof($OStrings) - 1;\r\n\t\t\twhile($index > -1) {\r\n\t\t\t\t$OString = $OStrings[$index][0];\r\n\t\t\t\t//print('$OString: ');var_dump($OString);\r\n\t\t\t\tif($OString[strlen($opening_part)] !== ' ' && $OString[strlen($opening_part)] !== '>') { // then we are catching the wrong tag\r\n\t\t\t\t\t//print('wrong $OString: ');var_dump($OString);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$offset = $OStrings[$index][1];\r\n\t\t\t\t\t$initial_substr = $substr = substr($OString, $strlen_opening_part, strlen($OString) - $strlen_opening_part - $strlen_closing_part);\r\n\t\t\t\t\t$substr = str_replace('<' . $sufficient_inline . '>', '', $substr, $count1);\r\n\t\t\t\t\t$substr = str_replace($closing_part, '', $substr, $count2);\r\n\t\t\t\t\tif($count1 > 0 || $count2 > 0 && $count1 === $count2) {\r\n\t\t\t\t\t\t$cleaned_OString = $opening_part . $substr . $closing_part;\r\n\t\t\t\t\t\t//$this->code = substr($this->code, 0, $offset) . $cleaned_OString . substr($this->code, $offset + strlen($OString));\r\n\t\t\t\t\t\t$this->code = str_replace($OString, $cleaned_OString, $this->code);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$index--;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function cleanup($html, $options = null) \n { \n if(isset($options) && is_array($options)){ \n $this->setOptions($options); \n } \n $this->_html = \"{$html}\"; \n\n if($this->_options['UseTidy'] && $this->_options['TidyBefore']){ \n $this->tidyClean(); \n } \n\n // Remove escape slashes \n $this->_html = stripslashes($this -> _html); \n\n if($this->_options['CleaningMethod']['tags'] == \"whitelist\"){ \n // Trim everything before body tag, leaving possible body attributes \n if(preg_match(\"/<body/i\", \"{$this -> _html}\")){ \n $this -> html = stristr($this -> _html, \"<body\"); \n } \n\n // strip tags, still leaving attributes, second variable is allowed tags \n $this->_html = strip_tags($this->_html, $this->_tag_whitelist); \n } \n\n if($this->_options['RemoveStyles']){ \n // Remove class and style attributes \n $this->removeBlacklistedAttributes(\"class|style\"); \n } \n\n if($this->_options['IsWord']){ \n $this->removeBlacklistedAttributes(\"lang|[ovwxp]:\\w+\"); \n } \n\n if($this->_options['CleaningMethod']['attributes'] == \"blacklist\"){ \n if(!empty ($this->_attrib_blacklist)){ \n $this->removeBlacklistedAttributes($this->_attrib_blacklist); \n } \n } \n\n if($this->_options['Optimize']){ \n $repl = 1; \n while($repl){ \n $repl = 0; \n foreach($this->_cleanup_tags as $tag){ \n // Strip empty inline tags \n $this -> _html = preg_replace(\"/<($tag)[^>]*>[\\s]*([(&nbsp;)]*)[\\s]*<\\/($tag)>/i\",\"\\\\2\", $this -> _html,-1,$count); \n $repl += $count; \n\n // Merge inline tags \n $this -> _html = preg_replace(\"/<\\/($tag)[^>]*>[\\s]*([(&nbsp;)]*)[\\s]*<($tag)>/i\",\"\\\\2\", $this -> _html,-1,$count); \n $repl += $count; \n } \n } \n\n // Drop empty paragraph tags \n if($this->_options['DropEmptyParas']){ \n $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\\s]*[(&nbsp;)]*[\\s]*<\\/(p|h[1-6]{1})>/i',\"\\r\\n\", $this -> _html); \n } \n\n // Trim extra spaces only if tidy is not set to indent \n if(!$this->_tidy_config['indent']){ \n // Trim extra spaces between words \n $this -> _html = preg_replace('/([^<>])[\\s]+([^<>])/i',\"\\\\1 \\\\2\", $this -> _html); \n\n // Trim extra spaces before tags \n $this -> _html = preg_replace('/[\\n|\\r|\\r\\n|][\\n|\\r|\\r\\n|]+</i',\"<\", $this -> _html); \n } \n } \n\n if($this->_options['DropEmptyParas'] && !$this->_options['Optimize']){ \n $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\\s]*[(&nbsp;)]*[\\s]*<\\/(p|h[1-6]{1})>/i',\"\\r\\n\", $this -> _html); \n } \n\n if($this->_options['FillEmptyTableCells']) { \n $this -> _html = preg_replace(\"/<td([^>]*)>[\\s]*<\\/td>/i\", \"<td\\\\1>&nbsp;</td>\", $this -> _html); \n } \n\n if($this->_options['Compress']){ \n // Trim spaces after tags \n $this -> _html = preg_replace('/>[\\s]+/',\">\", $this -> _html); \n\n // Trim spaces before end tags \n $this -> _html = preg_replace('/[\\s]+<\\//',\"</\", $this -> _html); \n\n // Trim spaces before tags \n $this -> _html = preg_replace('/[\\s]+</',\"<\", $this -> _html); \n\n // Trim extra spaces between words \n $this -> _html = preg_replace('/([^<>])[\\s]+([^<>])/',\"\\\\1 \\\\2\", $this -> _html); \n } \n\n if($this->_options['UseTidy'] && !$this->_options['TidyBefore']){ \n $this->tidyClean(); \n } \n return $this->output(\"{$this->_html}\"); \n }", "function guy_strip_bad($str, $mode='') {\n global $guy_c;\n $html_allowed = array('a', 'b', 'i', 'p', 'ol', 'ul', 'li', 'blockquote', 'br', 'em', 'sup', 'sub');\n\t$html_allowed_regexp = join('|',$html_allowed);\n\t$html_allowed_striptags = '<'.join('><',$html_allowed).'>';\n\t$str = strip_tags($str,$html_allowed_striptags);\n\t$str = preg_replace_callback(\"/<($html_allowed_regexp)\\b(.*?)>/si\",'guy_attrcheck',$str);\n\t$str = preg_replace('/<\\/([^ \n>]+)[^>]*>/si',$guy_c['lt'].'/$1'.$guy_c['gt'],$str);\n\t$str = preg_replace('#^\\s+$#m','',$str);\n\t$str = safehtml($str);\n\treturn $str;\n}", "function non_DOM_stripme($opening_tag_string) {\r\n\t\tpreg_match_all('/' . $opening_tag_string . '/is', $this->code, $matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\t//print(\"matches[0][size][0]: \");var_dump($matches[0][$size][0]);\r\n\t\t\tpreg_match('/<(\\w+)/is', $matches[0][$size][0], $tagname_matches);\r\n\t\t\t$tagname = $tagname_matches[1];\r\n\t\t\t$OString = OM::getOString($this->code, '<' . $tagname, '</' . $tagname . '>', $matches[0][$size][1]);\r\n\t\t\t//print(\"strlen(matches[0][size][0]): \");var_dump(strlen($matches[0][$size][0]));\r\n\t\t\t$substr = substr($OString, strlen($matches[0][$size][0]), strlen($OString) - strlen($matches[0][$size][0]) - (strlen($tagname) + 3));\r\n\t\t\t//print(\"OString: \");var_dump($OString);\r\n\t\t\t//print(\"substr: \");var_dump($substr);\r\n\t\t\t//$this->code = str_replace($OString, $substr, $this->code);\r\n\t\t\t$this->code = substr($this->code, 0, $matches[0][$size][1]) . $substr . substr($this->code, $matches[0][$size][1] + strlen($OString));\r\n\t\t\t$size--;\r\n\t\t}\r\n\t}", "function sandbox_tag_ur_it($glue) {\n\t$current_tag = single_tag_title( '', '', false );\n\t$separator = \"\\n\";\n\t$tags = explode( $separator, get_the_tag_list( \"\", \"$separator\", \"\" ) );\n\n\tforeach ( $tags as $i => $str ) {\n\t\tif ( strstr( $str, \">$current_tag<\" ) ) {\n\t\t\tunset($tags[$i]);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( empty($tags) )\n\t\treturn false;\n\n\treturn trim(join( $glue, $tags ));\n}", "function testRemoveUnusedTagsEnabled() {\n\t\t$entry1 = $this->objFromFixture('TagFieldTest_BlogEntry', 'blogentry1');\n\t\t\n\t\t// should contain \"tag1\"\n\t\t$entry2 = $this->objFromFixture('TagFieldTest_BlogEntry', 'blogentry2');\n\t\t\n\t\t$field = new TagField('Tags', null, null, 'TagFieldTest_BlogEntry');\n\t\t$field->setValue('tag3');\n\t\t$field->saveInto($entry1);\n\t\t$entry1->write();\n\t\t\n\t\t$this->assertInstanceOf(\n\t\t\t'TagFieldTest_Tag', \n\t\t\tTagFieldTest_Tag::get()->filter('Title', 'tag1')->First(),\n\t\t\t'Removing a tag relation which is still present in other objects shouldnt remove the tag record'\n\t\t);\n\t\t$this->assertNull(\n\t\t\tTagFieldTest_Tag::get()->filter('Title', 'tag2')->First(),\n\t\t\t'If the only remaining relation of a tag record is removed, the tag should be removed completely'\n\t\t);\n\t}", "function real_strip_tags($str, $allowable_tags = \"\")\n{\n return strip_tags($str, $allowable_tags);\n}", "function lessie_process_html_tag(&$vars) {\r\n $el = &$vars['element'];\r\n\r\n // Remove type=\"...\" and CDATA prefix/suffix.\r\n unset($el['#attributes']['type'], $el['#value_prefix'], $el['#value_suffix']);\r\n\r\n // Remove media=\"all\" but leave others unaffected.\r\n if (isset($el['#attributes']['media']) && $el['#attributes']['media'] === 'all') {\r\n unset($el['#attributes']['media']);\r\n }\r\n}", "function tag_ur_it($glue) {\n\t $current_tag = single_tag_title( '', '', false );\n\t $separator = \"\\n\";\n\t $tags = explode( $separator, get_the_tag_list( \"\", \"$separator\", \"\" ) );\n\t foreach ( $tags as $i => $str ) {\n\t if ( strstr( $str, \">$current_tag<\" ) ) {\n\t unset($tags[$i]);\n\t break;\n\t }\n\t }\n\t if ( empty($tags) )\n\t return false;\n\n\t return trim(join( $glue, $tags ));\n\t}", "function tag_ur_it($glue) {\n\t $current_tag = single_tag_title( '', '', false );\n\t $separator = \"\\n\";\n\t $tags = explode( $separator, get_the_tag_list( \"\", \"$separator\", \"\" ) );\n\t foreach ( $tags as $i => $str ) {\n\t if ( strstr( $str, \">$current_tag<\" ) ) {\n\t unset($tags[$i]);\n\t break;\n\t }\n\t }\n\t if ( empty($tags) )\n\t return false;\n\n\t return trim(join( $glue, $tags ));\n\t}", "function strip_html_tags( $text )\n{\n\t// PHP's strip_tags() function will remove tags, but it\n\t// doesn't remove scripts, styles, and other unwanted\n\t// invisible text between tags. Also, as a prelude to\n\t// tokenizing the text, we need to insure that when\n\t// block-level tags (such as <p> or <div>) are removed,\n\t// neighboring words aren't joined.\n\t$text = preg_replace(\n\t\t\tarray(\n\t\t\t\t\t// Remove invisible content\n\t\t\t\t\t'@<head[^>]*?>.*?</head>@siu',\n\t\t\t\t\t'@<style[^>]*?>.*?</style>@siu',\n\t\t\t\t\t'@<script[^>]*?.*?</script>@siu',\n\t\t\t\t\t'@<object[^>]*?.*?</object>@siu',\n\t\t\t\t\t'@<embed[^>]*?.*?</embed>@siu',\n\t\t\t\t\t'@<applet[^>]*?.*?</applet>@siu',\n\t\t\t\t\t'@<noframes[^>]*?.*?</noframes>@siu',\n\t\t\t\t\t'@<noscript[^>]*?.*?</noscript>@siu',\n\t\t\t\t\t'@<noembed[^>]*?.*?</noembed>@siu',\n\t\t\t\t\t/*'@<input[^>]*?>@siu',*/\n\t\t\t\t\t'@<form[^>]*?.*?</form>@siu',\n\n\t\t\t\t\t// Add line breaks before & after blocks\n\t\t\t\t\t'@<((br)|(hr))>@iu',\n\t\t\t\t\t'@</?((address)|(blockquote)|(center)|(del))@iu',\n\t\t\t\t\t'@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n\t\t\t\t\t'@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n\t\t\t\t\t'@</?((table)|(th)|(td)|(caption))@iu',\n\t\t\t\t\t'@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n\t\t\t\t\t'@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n\t\t\t\t\t'@</?((frameset)|(frame)|(iframe))@iu',\n\t),\n\tarray(\n\t\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \",\n\t\" \", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n\t\"\\n\\$0\", \"\\n\\$0\",\n\t),\n\t$text );\n\n\t// remove empty lines\n\t$text = preg_replace(\"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\", \"\\n\", $text);\n\t// remove leading spaces\n\t$text = preg_replace(\"/\\n( )*/\", \"\\n\", $text);\n\n\t// Remove all remaining tags and comments and return.\n\treturn strip_tags( $text );\n}", "protected function strip_tags($string ){\n\t\treturn preg_replace('~\\s+~',' ',strip_tags($string));\n\t}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function remove($source) {\n\t\t$loopCounter=0;\n\t\t// provides nested-tag protection\n\t\twhile($source != $this->filterTags($source)) {\n\t\t\t$source = $this->filterTags($source);\n\t\t\t$loopCounter++;\n\t\t}\n\t\treturn $source;\n\t}", "function wp_list_categories_remove_title_attributes($output) {\n $output = preg_replace('` title=\"(.+)\"`', '', $output);\n return $output;\n}", "private static function removeUnallowedHTMLAttributes(string $html): string\n {\n $tidy = new tidy();\n\n $dom = new DOMDocument();\n\n // Normalizes the HTML which reduce the possibility of having an unexpected\n // exception in the DomDocument library because some bad HTML was found.\n // Once the HTML is normalized, we will parse it again.\n $html = $tidy->repairString($html, [\n 'output-xhtml' => true,\n 'show-body-only' => true,\n ], 'utf8');\n\n try {\n libxml_use_internal_errors(true);\n // Needs a XML encoding declaration to ensure is treated as UTF-8\n $dom->loadHTML('<?xml encoding=\"utf-8\" ?>'.$html);\n } catch (Exception $e) {\n return '';\n }\n\n $attributes = static::getAttributesNodes($dom);\n\n collect($attributes)\n ->filter(fn ($attribute) => static::isAttributeAllowedForTag($attribute))\n ->each(fn ($node) => $node->parentNode->removeAttribute($node->nodeName));\n\n return $tidy->repairString($dom->saveHTML(), [\n 'output-xhtml' => true,\n 'show-body-only' => true,\n ], 'utf8');\n }", "function removePartialTags($string) {\r\n\t\t$pos_close = strpos($string, \">\");\r\n\t\tif($pos_close != false) {\r\n\t\t\t$string = substr($string, $pos_close + 1);\r\n\t\t}\r\n\t\t$pos_open = strpos($string, \"<\");\r\n\t\tif($pos_open != false) {\r\n\t\t\t$string = substr($string, 0, $pos_open);\r\n\t\t}\r\n\t\t//print('removePartialTags cleaned string: ' . $string);\r\n\t\treturn $string;\r\n\t}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function cleanup_tags() {\n $sql = '\n DELETE FROM\n tags\n WHERE NOT EXISTS (\n SELECT NULL FROM tips_tags\n WHERE\n tags.id = tips_tags.tag_id\n )';\n \n return $this->prep_and_exec($sql);\n }", "function plugins_strip_tags($string) {\n\treturn strip_tags($string, '<p><strong><em><span><ul><li><ol><blockquote>');\n}", "public static function removeHtml($s)\n {\n $newLinesAfter = 'h1|h2|h3|h4|h5|h6|h7|h8';\n $newLineAfter = 'caption|div|li|p|tr';\n $removeContent = 'script|style|noframes|select|option|link';\n $spaceAfter = 'td|th';\n\n /**///prep the string\n $s = ' ' . preg_replace(\"/[\\\\r\\\\n]+/\", '', $s);\n\n //begin removal\n /**///remove comment blocks\n while(stripos($s,'<!--') > 0){\n $pos[1] = stripos($s,'<!--');\n $pos[2] = stripos($s,'-->', $pos[1]);\n $len[1] = $pos[2] - $pos[1] + 3;\n $x = substr($s,$pos[1],$len[1]);\n $s = str_replace($x,'',$s);\n }\n\n /**///remove tags with content between them\n if(strlen($removeContent) > 0){\n $e = explode('|', $removeContent);\n for($i=0;$i<count($e);$i++){\n while(stripos($s,'<' . $e[$i]) > 0){\n $len[1] = strlen('<' . $e[$i]);\n $pos[1] = stripos($s,'<' . $e[$i]);\n $pos[2] = stripos($s,$e[$i] . '>', $pos[1] + $len[1]);\n $len[2] = $pos[2] - $pos[1] + $len[1];\n $x = substr($s,$pos[1],$len[2]);\n $s = str_replace($x,'',$s);\n }\n }\n }\n\n foreach (explode('|', $newLinesAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \"\\n\\n\", $s);\n }\n foreach (explode('|', $newLineAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \"\\n\", $s);\n }\n foreach (explode('|', $spaceAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \" \", $s);\n }\n\n /**///remove remaining tags\n $start = 0;\n while(stripos($s,'<', $start) > 0){\n $pos[1] = stripos($s,'<', $start);\n $pos[2] = stripos($s,'>', $pos[1]);\n if (!$pos[2]) {\n //No closing tag! Skip this one\n $start = $pos[1]+1;\n } else {\n $len[1] = $pos[2] - $pos[1] + 1;\n $x = substr($s,$pos[1],$len[1]);\n $s = str_replace($x,'',$s);\n }\n }\n\n if (PHP_EOL != \"\\n\") {\n $s = str_replace(\"\\n\", PHP_EOL, $s);\n }\n return html_entity_decode(trim($s), ENT_QUOTES, 'cp1252');\n }", "function gwt_drupal_process_html_tag(&$variables) {\n $tag = &$variables['element'];\n\n if ($tag['#tag'] == 'style' || $tag['#tag'] == 'script') {\n // Remove redundant type attribute and CDATA comments.\n unset($tag['#attributes']['type'], $tag['#value_prefix'], $tag['#value_suffix']);\n\n // Remove media=\"all\" but leave others unaffected.\n if (isset($tag['#attributes']['media']) && $tag['#attributes']['media'] === 'all') {\n unset($tag['#attributes']['media']);\n }\n }\n}", "function closetags($html) {\n\t\tpreg_match_all('#<([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);\n\t\t$openedtags = $result[1]; #put all closed tags into an array\n\t\tpreg_match_all('#</([a-z]+)>#iU', $html, $result);\n\t\t$closedtags = $result[1];\n\t\t$len_opened = count($openedtags);\n\t\t# all tags are closed\n\t\tif (count($closedtags) == $len_opened) {\n\t\t\treturn $html;\n\t\t}\n\t\t\n\t\t$openedtags = array_reverse($openedtags);\n\t\t# close tags\n\t\tfor ($i=0; $i < $len_opened; $i++) {\n\t\t\tif (!in_array($openedtags[$i], $closedtags)){\n\t\t\t $html .= '</'.$openedtags[$i].'>';\n\t\t\t} else {\n\t\t\t unset($closedtags[array_search($openedtags[$i], $closedtags)]); }\n\t\t\t} \n\t\t\treturn $html;\n\t\t}", "function ks_style_remove( $tag ) {\n\treturn preg_replace( '~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag );\n}", "public static function spanTagCorrectlyRemovedWhenRmTagIfNoAttribIsConfiguredDataProvider() {}", "private function cleanTagArray($array)\n {\n $final = array();\n if (isset($array) && is_array($array)) {\n foreach ($array as $word) {\n $word = trim(strip_tags($word));\n if (!empty($word)) {\n $final[] = $word;\n }\n }\n }\n return $final;\n }", "public function stripSpecificTags($tags, $content)\n {\n foreach ($tags as $tag) {\n $content = preg_replace('/<\\\\/?' . $tag . '(.|\\\\s)*?>/', '', $content);\n }\n return $content;\n }", "function strip_all($str) {\n return safehtml(strip_tags($str));\n}", "function removeBlacklistedAttributes($attribs) \n { \n $this->_html = preg_replace('/[\\s]+('.$attribs.')=[\\s]*(\"[^\"]*\"|\\'[^\\']*\\')/i',\"\",$this->_html); \n $this->_html = preg_replace('/[\\s]+('.$attribs.')=[\\s]*[^ |^>]*/i',\"\",$this->_html); \n }", "public function strip_empty_tags( $content ) {\n\t\treturn preg_replace( '/<([a-z][\\w]*) ?><\\\\/\\\\1>/', '', $content );\n\t}", "function html5_style_remove( $tag ) {\n return preg_replace( '~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag );\n}", "private function remove_self_closing_tags() {\n\t\tadd_filter('get_avatar', [$this, 'remove_self_closing_tag']); // <img]/>\n\t\tadd_filter('comment_id_fields', [$this, 'remove_self_closing_tag']); // <input]/>\n\t\tadd_filter('post_thumbnail_html', [$this, 'remove_self_closing_tag']); // <img]/>\n\t}", "function stripRecursiveHTMLSection($string, $tag_name, $tag_start)\n{\n $open_tag = '<' . $tag_name;\n $close_tag = '</' . $tag_name . '>';\n $close_tag_length = strlen($close_tag);\n\n // Make sure the provided $tag_start argument matches the provided $tag_name argument\n if (strpos($tag_start, $open_tag) === 0) {\n // While tag_start is present, there is at least one remaining section to remove\n while (strpos($string, $tag_start) !== false) {\n // In order to locate the end of the section, we attempt each closing tag until we find the right one\n // We know we found the right one when the amount of \"<tag\" is the same as amount of \"</tag\"\n // When the attempted \"</tag\" is not the correct one, we increase $search_offset to skip it\n // and retry unless $max_recursion is reached (prevents infinite loop on malformed HTML)\n $max_recursion = 100;\n $section_to_remove = null;\n $section_start = strpos($string, $tag_start);\n $search_offset = $section_start;\n do {\n $max_recursion--;\n // Move on to the next occurrence of \"</tag\"\n $section_end = strpos($string, $close_tag, $search_offset);\n $search_offset = $section_end + $close_tag_length;\n // If the next \"</tag\" is the correct one, then this is the section we must remove:\n $section_to_remove = substr($string, $section_start, $section_end - $section_start + $close_tag_length);\n // Count amount of \"<tag\" and \"</tag\" in the section to remove\n $open_tag_count = substr_count($section_to_remove, $open_tag);\n $close_tag_count = substr_count($section_to_remove, $close_tag);\n } while ($open_tag_count > $close_tag_count && $max_recursion > 0);\n // We exited the loop, let's remove the section\n $string = str_replace($section_to_remove, '', $string);\n }\n }\n return $string;\n}", "function _get_non_wysiwyg_tags()\n{\n\t$ret=array('indent','del','ins','u','highlight','abbr','cite','samp','q','var','dfn','address','contents','include','concepts','concept','staff_note','menu','surround','tt','no_parse','overlay','random','pulse','ticker','shocker','jumping','sections','big_tabs','tabs','carousel','hide','tooltip','currency','if_in_group','flash','upload','exp_thumb','exp_ref','thumb','reference','snapback','post','topic','attachment');\n\treturn $ret;\n}", "function testRemoveTag_UsingCleanTags() {\n foreach ($this->photo->getTags() as $tag) {\n $this->photo->removeTag($tag);\n }\n $this->photo->addTags(array('something', 'another', '2004'));\n sleep(1);\n\n $this->photo->removeTag('another');\n\n $result = $this->photo->getTags();\n $this->assertEquals(array('something', '2004'), $result);\n }", "protected function stripHtmlTags($text)\n {\n $text = preg_replace(\n [\n // Remove invisible content\n /** @lang php */\n '@<head[^>]*?>.*?</head>@siu',\n /** @lang php */\n '@<style[^>]*?>.*?</style>@siu',\n /** @lang php */\n '@<script[^>]*?.*?</script>@siu',\n /** @lang php */\n '@<object[^>]*?.*?</object>@siu',\n /** @lang php */\n '@<embed[^>]*?.*?</embed>@siu',\n /** @lang php */\n '@<applet[^>]*?.*?</applet>@siu',\n /** @lang php */\n '@<noframes[^>]*?.*?</noframes>@siu',\n /** @lang php */\n '@<noscript[^>]*?.*?</noscript>@siu',\n /** @lang php */\n '@<noembed[^>]*?.*?</noembed>@siu',\n // Add line breaks before and after blocks\n '@</?((address)|(blockquote)|(center)|(del))@iu',\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n '@</?((table)|(th)|(td)|(caption))@iu',\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n '@</?((frameset)|(frame)|(iframe))@iu',\n ],\n [\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n \"\\n\\$0\", \"\\n\\$0\",\n ],\n $text\n );\n\n return strip_tags($text);\n }", "function clean_evil_tags( $t )\n {\n \t$t = preg_replace( \"/javascript/i\" , \"j&#097;v&#097;script\", $t );\n\t\t$t = preg_replace( \"/alert/i\" , \"&#097;lert\" , $t );\n\t\t$t = preg_replace( \"/about:/i\" , \"&#097;bout:\" , $t );\n\t\t$t = preg_replace( \"/onmouseover/i\", \"&#111;nmouseover\" , $t );\n\t\t$t = preg_replace( \"/onclick/i\" , \"&#111;nclick\" , $t );\n\t\t$t = preg_replace( \"/onload/i\" , \"&#111;nload\" , $t );\n\t\t$t = preg_replace( \"/onsubmit/i\" , \"&#111;nsubmit\" , $t );\n\t\t$t = preg_replace( \"/<body/i\" , \"&lt;body\" , $t );\n\t\t$t = preg_replace( \"/<html/i\" , \"&lt;html\" , $t );\n\t\t$t = preg_replace( \"/document\\./i\" , \"&#100;ocument.\" , $t );\n\t\t\n\t\treturn $t;\n }", "function clear_subtags()\n {\n $numtags = sizeof($this->tags);\n $keys = array_keys( $this->tags );\n foreach( $keys as $k ) {\n $this->tags[$k]->clear_subtags();\n unset($this->tags[$k]->parent);\n }\n\n # Clear the tags array\n $this->tags = array();\n unset( $this->curtag );\n }", "private static function remove_between_tags($y_html) {\n\t//--\n\treturn @preg_replace(\"'\".self::tag_remove_start().\".*?\".self::tag_remove_end().\"'si\", '&nbsp;', (string)$y_html); // insensitive\n\t//--\n}", "static function strip_html_tags($string){\n return preg_replace(array('/\\<(script)(.+)>/i', '/\\<(.+)(script)>/i', '/\\<(style)(.+)>/i', '/\\<(.+)(style)>/i'), '', $string);\n }", "function filter_ptags_on_images($content) {\n // do a regular expression replace...\n // find all p tags that have just\n // <p>maybe some white space<img all stuff up to /> then maybe whitespace </p>\n // replace it with just the image tag...\n return preg_replace('/<p>(\\s*)(<img .* \\/>)(\\s*)<\\/p>/iU', '\\2', $content);\n}", "function strip_html_tags( $text )\r\n{\r\n $text = preg_replace(\r\n array(\r\n // Remove invisible content\r\n '@<head[^>]*?>.*?</head>@siu',\r\n '@<style[^>]*?>.*?</style>@siu',\r\n '@<script[^>]*?.*?</script>@siu',\r\n '@<object[^>]*?.*?</object>@siu',\r\n '@<embed[^>]*?.*?</embed>@siu',\r\n '@<applet[^>]*?.*?</applet>@siu',\r\n '@<noframes[^>]*?.*?</noframes>@siu',\r\n '@<noscript[^>]*?.*?</noscript>@siu',\r\n '@<noembed[^>]*?.*?</noembed>@siu',\r\n // Add line breaks before and after blocks\r\n '@</?((address)|(blockquote)|(center)|(del))@iu',\r\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\r\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\r\n '@</?((table)|(th)|(td)|(caption))@iu',\r\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\r\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\r\n '@</?((frameset)|(frame)|(iframe))@iu',\r\n ),\r\n array(\r\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\r\n $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\",\r\n $nl.\"\\$0\", $nl.\"\\$0\",\r\n ),\r\n $text );\r\n return strip_tags( $text );\r\n}", "public function typoSearchTagsRemovesBodyContentOutsideMarkers() {}", "function regexcleanhtml($text){\n\t//get rid of unneeded spaces\n\t$text=regexspacecleaner($text);\n\t\n\t//lets get rid of weird spacing first so we can make simpler quearies later\n\t$regex_pattern=\"/<\\s/\"; //makes < followed by a space just < (e.g. slkj < slkj = slkj <slkj)\n\t$text = preg_replace($regex_pattern, \"<\", $text);\n\t$regex_pattern=\"/\\s>/\"; //makes > preceded by a space just > (e.g. slkj > slkj = slkj> slkj)\n\t$text = preg_replace($regex_pattern, \">\", $text);\n\t$regex_pattern=\"/<\\/\\s/\";\n\t$text = preg_replace($regex_pattern, \"</\", $text); //makes </ followed by a space just </ (e.g. slkj </ slkj = slkj </slkj)\n\t\n\treturn $text;\n}", "function cleanEvilTags($t){\r\n\t\t$t = preg_replace(\"/javascript/i\" , \"j&#097;v&#097;script\", $t);\r\n\t\t$t = preg_replace(\"/alert/i\" , \"&#097;lert\" , $t);\r\n\t\t$t = preg_replace(\"/about:/i\" , \"&#097;bout:\" , $t);\r\n\t\t$t = preg_replace(\"/onmouseover/i\", \"&#111;nmouseover\" , $t);\r\n\t\t$t = preg_replace(\"/onclick/i\" , \"&#111;nclick\" , $t);\r\n\t\t$t = preg_replace(\"/onload/i\" , \"&#111;nload\" , $t);\r\n\t\t$t = preg_replace(\"/onsubmit/i\" , \"&#111;nsubmit\" , $t);\r\n\t\t$t = preg_replace(\"/<body/i\" , \"&lt;body\" , $t);\r\n\t\t$t = preg_replace(\"/<html/i\" , \"&lt;html\" , $t);\r\n\t\t$t = preg_replace(\"/document\\./i\" , \"&#100;ocument.\" , $t);\r\n\t\treturn $t;\r\n\t}", "function close_tag($tag, $sample_html) {\n return preg_replace(\"!(<{$tag}(\\s[^>]*[^/>])?)>!si\",\"\\\\1/>\",$sample_html);\n}", "public function sanitize()\n {\n parent::sanitize();\n\n foreach ($this->_cleanData as $key => $value) {\n $this->_cleanData[$key] = strip_tags($value);\n }\n }", "public static function cleanInsideHtmlTags($str,$tags)\n\t{\n\t\tpreg_match_all('/<([^>]+)>/i',$tags,$allTags,PREG_PATTERN_ORDER);\n\t\tforeach($allTags[1] as $tag)\n\t\t{\n\t\t\t$str=preg_replace('/<'.$tag.' [^>]*>/i','<'.$tag.'>',$str);\n\t\t}\n\n\t\treturn $str;\n\t}", "function strip_word_doc( $html, $allowed_tags = '' )\n\t{\n\t\tmb_regex_encoding( 'UTF-8' );\n\n\t\t//replace MS special characters first\n\t\t$search = [\n\t\t\t'/&lsquo;/u',\n\t\t\t'/&rsquo;/u',\n\t\t\t'/&ldquo;/u',\n\t\t\t'/&rdquo;/u',\n\t\t\t'/&mdash;/u',\n\t\t];\n\t\t$replace = [\n\t\t\t'\\'',\n\t\t\t'\\'',\n\t\t\t'\"',\n\t\t\t'\"',\n\t\t\t'-',\n\t\t];\n\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t//make sure _all_ html entities are converted to the plain ascii equivalents - it appears\n\t\t//in some MS headers, some html entities are encoded and some aren't\n\t\t$html = html_entity_decode( $html, ENT_QUOTES, 'UTF-8' );\n\n\t\t//try to strip out any C style comments first, since these, embedded in html comments, seem to\n\t\t//prevent strip_tags from removing html comments (MS Word introduced combination)\n\t\tif ( mb_stripos( $html, '/*' ) !== FALSE )\n\t\t{\n\t\t\t$html = mb_eregi_replace( '#/\\*.*?\\*/#s', '', $html, 'm' );\n\t\t}\n\n\t\t//introduce a space into any arithmetic expressions that could be caught by strip_tags so that they won't be\n\t\t//'<1' becomes '< 1'(note: somewhat application specific)\n\t\t$html = preg_replace(\n\t\t\t[\n\t\t\t\t'/<([0-9]+)/',\n\t\t\t], [\n\t\t\t\t'< $1',\n\t\t\t], $html );\n\t\t$html = strip_tags( $html, $allowed_tags );\n\n\t\t//eliminate extraneous whitespace from start and end of line, or anywhere there are two or more spaces, convert it to one\n\t\t$html = preg_replace(\n\t\t\t[\n\t\t\t\t'/^\\s\\s+/',\n\t\t\t\t'/\\s\\s+$/',\n\t\t\t\t'/\\s\\s+/u',\n\t\t\t], [\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t' ',\n\t\t\t], $html );\n\n\t\t//strip out inline css and simplify style tags\n\t\t$search = [\n\t\t\t'#<(strong|b)[^>]*>(.*?)</(strong|b)>#isu',\n\t\t\t'#<(em|i)[^>]*>(.*?)</(em|i)>#isu',\n\t\t\t'#<u[^>]*>(.*?)</u>#isu',\n\t\t];\n\t\t$replace = [\n\t\t\t'<b>$2</b>',\n\t\t\t'<i>$2</i>',\n\t\t\t'<u>$1</u>',\n\t\t];\n\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t//on some of the ?newer MS Word exports, where you get conditionals of the form 'if gte mso 9', etc., it appears\n\t\t//that whatever is in one of the html comments prevents strip_tags from eradicating the html comment that contains\n\t\t//some MS Style Definitions - this last bit gets rid of any leftover comments */\n\t\t$num_matches = preg_match_all( \"/\\<!--/u\", $html, $matches );\n\t\tif ( $num_matches )\n\t\t{\n\t\t\t$html = preg_replace( '/\\<!--(.)*--\\>/isu', '', $html );\n\t\t}\n\n\t\treturn $html;\n\t}", "function strip_selected_article_tags($str, $tags = \"\", $stripContent = false)\n\t{\n\t\t$tags = \"<script>\";\n\t\treturn strip_selected_tags($str, $tags, $stripContent);\n\t}", "public function clearTags()\n\t{\n\t\t$this->tags = array();\n\t}", "protected function _sanitize_naughty_html($matches)\n\t{\n\t\tstatic $naughty_tags = array(\n\t\t\t'alert', 'area', 'prompt', 'confirm', 'applet', 'audio', 'basefont', 'base', 'behavior', 'bgsound',\n\t\t\t'blink', 'body', 'embed', 'expression', 'form', 'frameset', 'frame', 'head', 'html', 'ilayer',\n\t\t\t'iframe', 'input', 'button', 'select', 'isindex', 'layer', 'link', 'meta', 'keygen', 'object',\n\t\t\t'plaintext', 'style', 'script', 'textarea', 'title', 'math', 'video', 'svg', 'xml', 'xss'\n\t\t);\n\n\t\tstatic $evil_attributes = array(\n\t\t\t'on\\w+', 'style', 'xmlns', 'formaction', 'form', 'xlink:href', 'FSCommand', 'seekSegmentTime'\n\t\t);\n\n\t\t// First, escape unclosed tags\n\t\tif (empty($matches['closeTag']))\n\t\t{\n\t\t\treturn '&lt;'.$matches[1];\n\t\t}\n\t\t// Is the element that we caught naughty? If so, escape it\n\t\telseif (in_array(strtolower($matches['tagName']), $naughty_tags, TRUE))\n\t\t{\n\t\t\treturn '&lt;'.$matches[1].'&gt;';\n\t\t}\n\t\t// For other tags, see if their attributes are \"evil\" and strip those\n\t\telseif (isset($matches['attributes']))\n\t\t{\n\t\t\t// We'll store the already fitlered attributes here\n\t\t\t$attributes = array();\n\n\t\t\t// Attribute-catching pattern\n\t\t\t$attributes_pattern = '#'\n\t\t\t\t.'(?<name>[^\\s\\042\\047>/=]+)' // attribute characters\n\t\t\t\t// optional attribute-value\n\t\t\t\t.'(?:\\s*=(?<value>[^\\s\\042\\047=><`]+|\\s*\\042[^\\042]*\\042|\\s*\\047[^\\047]*\\047|\\s*(?U:[^\\s\\042\\047=><`]*)))' // attribute-value separator\n\t\t\t\t.'#i';\n\n\t\t\t// Blacklist pattern for evil attribute names\n\t\t\t$is_evil_pattern = '#^('.implode('|', $evil_attributes).')$#i';\n\n\t\t\t// Each iteration filters a single attribute\n\t\t\tdo\n\t\t\t{\n\t\t\t\t// Strip any non-alpha characters that may preceed an attribute.\n\t\t\t\t// Browsers often parse these incorrectly and that has been a\n\t\t\t\t// of numerous XSS issues we've had.\n\t\t\t\t$matches['attributes'] = preg_replace('#^[^a-z]+#i', '', $matches['attributes']);\n\n\t\t\t\tif ( ! preg_match($attributes_pattern, $matches['attributes'], $attribute, PREG_OFFSET_CAPTURE))\n\t\t\t\t{\n\t\t\t\t\t// No (valid) attribute found? Discard everything else inside the tag\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t// Is it indeed an \"evil\" attribute?\n\t\t\t\t\tpreg_match($is_evil_pattern, $attribute['name'][0])\n\t\t\t\t\t// Or does it have an equals sign, but no value and not quoted? Strip that too!\n\t\t\t\t\tOR (trim($attribute['value'][0]) === '')\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$attributes[] = 'xss=removed';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$attributes[] = $attribute[0][0];\n\t\t\t\t}\n\n\t\t\t\t$matches['attributes'] = substr($matches['attributes'], $attribute[0][1] + strlen($attribute[0][0]));\n\t\t\t}\n\t\t\twhile ($matches['attributes'] !== '');\n\n\t\t\t$attributes = empty($attributes)\n\t\t\t\t? ''\n\t\t\t\t: ' '.implode(' ', $attributes);\n\t\t\treturn '<'.$matches['slash'].$matches['tagName'].$attributes.'>';\n\t\t}\n\n\t\treturn $matches[0];\n\t}", "private function wpus_strip_tags($string, $remove_breaks = FALSE) {\n\t\t\t$string = preg_replace('/[\\r\\n\\t ]+/', ' ', $string);\n\n\t\t\t$string = preg_replace('@<(script|style)[^>]*?>.*?</\\\\1>@si', '', $string);\n\n\t\t\t$string = preg_replace('@ *</?\\s*(P|UL|OL|DL|BLOCKQUOTE)\\b[^>]*?> *@si', \"\\n\\n\", $string);\n\t\t\t$string = preg_replace('@ *<(BR|DIV|LI|DT|DD|TR|TD|H\\d)\\b[^>]*?> *@si', \"\\n\", $string);\n\t\t\t$string = preg_replace(\"@\\n\\n\\n+@si\", \"\\n\\n\", $string);\n\n\t\t\t$string = strip_tags($string);\n\n\t\t\tif($remove_breaks) {\n\t\t\t\t$string = preg_replace('/[\\r\\n\\t ]+/', ' ', $string);\n\t\t\t}\n\n\t\t\t// ...since we're pulling excerpts from the DB, some of the excerpts contain truncated HTML tags\n\t\t\t// that won't be picked up by strip_tags(). This removes any trailing HTML from the beginning\n\t\t\t// and end of the excerpt:\n\t\t\t$string = preg_replace('/.*>|<.*/', ' ', $string);\n\n\t\t\treturn trim($string);\n\t\t}", "function filterAttr($attrSet) {\t\n\t\t$newSet = array();\n\t\t// process attributes\n\t\tfor ($i = 0; $i <count($attrSet); $i++) {\n\t\t\t// skip blank spaces in tag\n\t\t\tif (!$attrSet[$i]) continue;\n\t\t\t// split into attr name and value\n\t\t\t$attrSubSet = explode('=', trim($attrSet[$i]));\n\t\t\tlist($attrSubSet[0]) = explode(' ', $attrSubSet[0]);\n\t\t\t// removes all \"non-regular\" attr names AND also attr blacklisted\n\t\t\t//////\n\t\t\t///// NEEDS FIX!!! eregi zu preg_match umgeschrieben... stimmt das noch??? ////\n\t\t\t/////\n\t\t\tif ((!preg_match(\"^[a-z]*$\",$attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on')))) \n\t\t\t\tcontinue;\n\t\t\t// xss attr value filtering\n\t\t\tif ($attrSubSet[1]) {\n\t\t\t\t// strips unicode, hex, etc\n\t\t\t\t$attrSubSet[1] = str_replace('&#', '', $attrSubSet[1]);\n\t\t\t\t// strip normal newline within attr value\n\t\t\t\t$attrSubSet[1] = preg_replace('/\\s+/', '', $attrSubSet[1]);\n\t\t\t\t// strip double quotes\n\t\t\t\t$attrSubSet[1] = str_replace('\"', '', $attrSubSet[1]);\n\t\t\t\t// [requested feature] convert single quotes from either side to doubles (Single quotes shouldn't be used to pad attr value)\n\t\t\t\tif ((substr($attrSubSet[1], 0, 1) == \"'\") && (substr($attrSubSet[1], (strlen($attrSubSet[1]) - 1), 1) == \"'\"))\n\t\t\t\t\t$attrSubSet[1] = substr($attrSubSet[1], 1, (strlen($attrSubSet[1]) - 2));\n\t\t\t\t// strip slashes\n\t\t\t\t$attrSubSet[1] = stripslashes($attrSubSet[1]);\n\t\t\t}\n\t\t\t// auto strip attr's with \"javascript:\n\t\t\tif (\t((strpos(strtolower($attrSubSet[1]), 'expression') !== false) &&\t(strtolower($attrSubSet[0]) == 'style')) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'javascript:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'behaviour:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'vbscript:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'mocha:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'livescript:') !== false) \n\t\t\t) continue;\n\n\t\t\t// if matches user defined array\n\t\t\t$attrFound = in_array(strtolower($attrSubSet[0]), $this->attrArray);\n\t\t\t// keep this attr on condition\n\t\t\tif ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) {\n\t\t\t\t// attr has value\n\t\t\t\tif ($attrSubSet[1]) $newSet[] = $attrSubSet[0] . '=\"' . $attrSubSet[1] . '\"';\n\t\t\t\t// attr has decimal zero as value\n\t\t\t\telse if ($attrSubSet[1] == \"0\") $newSet[] = $attrSubSet[0] . '=\"0\"';\n\t\t\t\t// reformat single attributes to XHTML\n\t\t\t\telse $newSet[] = $attrSubSet[0] . '=\"' . $attrSubSet[0] . '\"';\n\t\t\t}\t\n\t\t}\n\t\treturn $newSet;\n\t}", "function remove_html($content) {\r\n\t$content = strip_tags($content);\r\n return $content;\r\n}", "function string_restore_valid_html_tags( $p_string, $p_multiline = true ) \r\n{\r\n\t$t_html_valid_tags = config_get( $p_multiline ? 'html_valid_tags' : 'html_valid_tags_single_line' );\r\n\r\n\tif ( OFF === $t_html_valid_tags || is_blank( $t_html_valid_tags ) ) {\r\n\t\treturn $p_string;\r\n\t}\r\n\r\n\t$tags = explode( ',', $t_html_valid_tags );\r\n\tforeach ($tags as $key => $value) \r\n\t{ \r\n \tif ( !is_blank( $value ) ) {\r\n \t$tags[$key] = trim($value); \r\n }\r\n }\r\n $tags = implode( '|', $tags);\r\n\r\n\t$p_string = preg_replace( '/&lt;(' . $tags . ')\\s*&gt;/ui', '<\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/&lt;\\/(' . $tags . ')\\s*&gt;/ui', '</\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/&lt;(' . $tags . ')\\s*\\/&gt;/ui', '<\\\\1 />', $p_string );\r\n\r\n\r\n\treturn $p_string;\r\n}", "function fix_tags($html) {\n $result = \"\";\n $tag_stack = array();\n\n // these corrections can simplify the regexp used to parse tags\n // remove whitespaces before '/' and between '/' and '>' in autoclosing tags\n $html = preg_replace(\"#\\s*/\\s*>#is\",\"/>\",$html);\n // remove whitespaces between '<', '/' and first tag letter in closing tags\n $html = preg_replace(\"#<\\s*/\\s*#is\",\"</\",$html);\n // remove whitespaces between '<' and first tag letter \n $html = preg_replace(\"#<\\s+#is\",\"<\",$html);\n\n while (preg_match(\"#(.*?)(<([a-z\\d]+)[^>]*/>|<([a-z\\d]+)[^>]*(?<!/)>|</([a-z\\d]+)[^>]*>)#is\",$html,$matches)) {\n $result .= $matches[1];\n $html = substr($html, strlen($matches[0]));\n\n // Closing tag \n if (isset($matches[5])) { \n $tag = $matches[5];\n\n if ($tag == $tag_stack[0]) {\n // Matched the last opening tag (normal state) \n // Just pop opening tag from the stack\n array_shift($tag_stack);\n $result .= $matches[2];\n } elseif (array_search($tag, $tag_stack)) { \n // We'll never should close 'table' tag such way, so let's check if any 'tables' found on the stack\n $no_critical_tags = !array_search('table',$tag_stack);\n if (!$no_critical_tags) {\n $no_critical_tags = (array_search('table',$tag_stack) >= array_search($tag, $tag_stack));\n };\n\n if ($no_critical_tags) {\n // Corresponding opening tag exist on the stack (somewhere deep)\n // Note that we can forget about 0 value returned by array_search, becaus it is handled by previous 'if'\n \n // Insert a set of closing tags for all non-matching tags\n $i = 0;\n while ($tag_stack[$i] != $tag) {\n $result .= \"</{$tag_stack[$i]}> \";\n $i++;\n }; \n \n // close current tag\n $result .= \"</{$tag_stack[$i]}> \";\n // remove it from the stack\n array_splice($tag_stack, $i, 1);\n // if this tag is not \"critical\", reopen \"run-off\" tags\n $no_reopen_tags = array(\"tr\",\"td\",\"table\",\"marquee\",\"body\",\"html\");\n if (array_search($tag, $no_reopen_tags) === false) {\n while ($i > 0) {\n $i--;\n $result .= \"<{$tag_stack[$i]}> \";\n }; \n } else {\n array_splice($tag_stack, 0, $i);\n };\n };\n } else {\n // No such tag found on the stack, just remove it (do nothing in out case, as we have to explicitly \n // add things to result\n };\n } elseif (isset($matches[4])) {\n // Opening tag\n $tag = $matches[4];\n array_unshift($tag_stack, $tag);\n $result .= $matches[2];\n } else {\n // Autoclosing tag; do nothing specific\n $result .= $matches[2];\n };\n };\n\n // Close all tags left\n while (count($tag_stack) > 0) {\n $tag = array_shift($tag_stack);\n $result .= \"</\".$tag.\">\";\n }\n\n return $result;\n}", "function stringStripTags ($string) {\n $string = preg_replace(\"/<del[^>]*>.+<\\/del[^>]*>/isU\", '', $string);\n $string = preg_replace(\"/<script[^>]*>.+<\\/script[^>]*>/isU\", '', $string);\n $string = preg_replace(\"/<style[^>]*>.+<\\/style[^>]*>/isU\", '', $string);\n $string = str_replace('>', '> ', $string);\n $string = str_replace('<', ' <', $string);\n $string = strip_tags($string);\n $string = preg_replace(\"/\\s+/\", \" \", $string);\n $string = trim($string);\n return $string;\n}", "function testRemoveUnusedTagsDisabled() {\n\t\t$entry1 = $this->objFromFixture('TagFieldTest_BlogEntry', 'blogentry1');\n\t\t\n\t\t// should contain \"tag1\"\n\t\t$entry2 = $this->objFromFixture('TagFieldTest_BlogEntry', 'blogentry2');\n\t\t\n\t\t$field = new TagField('Tags', null, null, 'TagFieldTest_BlogEntry');\n\t\t$field->deleteUnusedTags = false;\n\t\t$field->setValue('tag3');\n\t\t$field->saveInto($entry1);\n\t\t$entry1->write();\n\t\t\n\t\t$q = defined('DB::USE_ANSI_SQL') ? '\"' : '`';\n\t\t$this->assertInstanceOf(\n\t\t\t'TagFieldTest_Tag', \n\t\t\tDataObject::get_one('TagFieldTest_Tag', \"{$q}TagFieldTest_Tag{$q}.{$q}Title{$q} = 'tag2'\"),\n\t\t\t'If the only remaining relation of a tag record is removed and $deleteUnusedTags is disabled, the tag record should be retained'\n\t\t);\n\t}", "function tidyClean() \n { \n if(!class_exists('tidy')){ \n if(function_exists('tidy_parse_string')){ \n tidy_set_encoding(\"{$this->_options[\"Encoding\"]}\"); \n foreach($this->_tidy_config as $k => $v) { \n tidy_setopt($k, $v); \n } \n tidy_parse_string($this->_html); \n tidy_clean_repair(); \n $this->_html = tidy_get_output(); \n } \n else { \n error_log(\"Tidy is not supported on this platform. Basic Cleaning is applied.\"); \n } \n } \n else { \n $tidy = new tidy; \n $tidy -> parseString($this->_html, $this->_tidy_config, \"{$this->_options[\"Encoding\"]}\"); \n $tidy -> cleanRepair(); \n $this -> html = $tidy; \n } \n }", "protected static function removeRedundantCloseTagElements(DOMDocument $ir)\n\t{\n\t\t$xpath = new DOMXPath($ir);\n\t\tforeach ($xpath->query('//closeTag') as $closeTag)\n\t\t{\n\t\t\t$id = $closeTag->getAttribute('id');\n\t\t\t$query = 'following-sibling::*/descendant-or-self::closeTag[@id=\"' . $id . '\"]';\n\t\t\tforeach ($xpath->query($query, $closeTag) as $dupe)\n\t\t\t{\n\t\t\t\t$dupe->parentNode->removeChild($dupe);\n\t\t\t}\n\t\t}\n\t}", "private function removeIrrelevantChildren(\\DOMNode $node)\n {\n if ($node->hasChildNodes()) {\n foreach ($node->childNodes as $child) {\n if (is_a($child, \\DOMText::class) && strlen(trim($child->wholeText)) === 0) {\n $node->removeChild($child);\n $this->removeIrrelevantChildren($node);\n }\n }\n }\n }", "function Clean($arr){\n foreach($arr as $key=>$value){\n $arr[$key] = strip_tags($value);\n }\n return $arr;\n}" ]
[ "0.69604933", "0.6890917", "0.6796782", "0.6753393", "0.66087747", "0.6589336", "0.6520447", "0.64103967", "0.64019275", "0.63829416", "0.62832236", "0.6215447", "0.6178315", "0.6178284", "0.61551803", "0.613178", "0.6112124", "0.61029345", "0.60825527", "0.6067436", "0.60167587", "0.6014719", "0.6002856", "0.5972044", "0.5970091", "0.5952768", "0.591928", "0.5913194", "0.5891076", "0.58736026", "0.587293", "0.58626825", "0.5845", "0.58189374", "0.58124775", "0.5724439", "0.572059", "0.5696345", "0.56835705", "0.5670129", "0.56021196", "0.55965334", "0.5582068", "0.556639", "0.556639", "0.5541613", "0.5526164", "0.5524566", "0.5524566", "0.5524566", "0.5522989", "0.5521804", "0.55042803", "0.5487719", "0.54828197", "0.5472887", "0.54692227", "0.54629576", "0.5455738", "0.5452702", "0.54400307", "0.5432357", "0.5426166", "0.5422667", "0.5419958", "0.5412859", "0.5399448", "0.53951794", "0.5387288", "0.5386473", "0.5386066", "0.53731555", "0.5362176", "0.5346023", "0.53335595", "0.5332725", "0.5331012", "0.53234386", "0.5318446", "0.53172666", "0.5314452", "0.53136665", "0.5306302", "0.5306091", "0.5305764", "0.53035504", "0.5295414", "0.5292568", "0.5290182", "0.5280372", "0.52725154", "0.5272064", "0.52700746", "0.5268121", "0.5265319", "0.5259454", "0.5252069", "0.52444935", "0.52360284", "0.52296954" ]
0.6011469
22
Replace tag attributes in an HTML string
public static function cleanTagsAttributes(string $string, array $include = null, array $exclude = []): string { $matches = self::matchTags($string); if (!$matches) { return $string; } $search = []; $replace = []; foreach ($matches as $match) { if ($include === null) { $attr = []; } else { $attr = self::parseAttributes($match[2]); $attr = ArrayTools::filterKeys($attr, $include, $exclude); } $ss = $match[0]; $single = str_ends_with($match[0], '/>') ? '/' : ''; $rr = '<' . strtolower($match[1]) . self::attributes($attr) . $single . '>'; if ($ss !== $rr) { $search[] = $ss; $replace[] = $rr; } } if (preg_match_all('#<\\\s*([A-Za-z][A-Za-z0-9]*)\s*>#i', $string, $matches)) { foreach ($matches as $match) { $ss = $match[0]; $rr = '<\\' . strtolower($match[1]) . '>'; if ($ss !== $rr) { $search[] = $ss; $replace[] = $rr; } } } if (count($search) === 0) { return $string; } return str_replace($search, $replace, $string); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function non_inline_attributes() {\r\n\t\t$this->code = preg_replace('/<span([^>]*) align=\"[^\"]*\"([^>]*)>/is', '<span$1$2>', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^>]*) style=\"([^\"]*)text-align\\s*:\\s*[^;]*;([^\"]*)\"([^>]*)>/is', '<span$1 style=\"$2$3\"$4>', $this->code);\r\n\t}", "public function moveHtmlAttributesToAdditionalArguments() {}", "function tag_attributes($attributes)\n{\n if (is_string($attributes)) {\n $toProcess['name'] = $attributes;\n $toProcess['id'] = $attributes;\n } else {\n //don't allow 'value' to be set specifically as an attribute (why = consistency)\n unset($attributes['value']);\n $toProcess = $attributes;\n }\n\n $attr = array();\n foreach ($toProcess as $key => $attribute) {\n // Reject weird attribute names (a little more restrictively than necessary)\n if (preg_match('/[^A-Za-z0-9_:.-]/', $key)) {\n continue;\n }\n if (is_string($attribute)) {\n $attr[$key] = $key . '=\"' . html_escape($attribute) . '\"';\n } elseif ($attribute === true) {\n $attr[$key] = $key;\n }\n }\n return join(' ', $attr);\n}", "function wp_replace_in_html_tags($haystack, $replace_pairs)\n {\n }", "function customTagReplace($html)\r\n\t{\r\n\t\t//ensure all tags can be found\r\n\t\t$html = str_replace(\"<IMG\",\"<img\",$html);\r\n\t\t$html = str_replace(\"SRC=\",\"src=\",$html);\r\n\t\t$html = str_replace(\"ALT=\",\"alt=\",$html);\r\n\t\t$html = str_replace(\"<SPAN\",\"<span\",$html);\r\n\r\n\t\t$html = replaceIMG($html); //CSS format img tags\r\n\t\t$html = youtubeEmbed($html); //custom include youtube embeds\r\n\t\t$html = apostrapheFix($html); //apostraphe fix for sql INSERT statements\r\n\t\treturn $html;\r\n\t}", "public function addAttributesToHtml($html)\n {\n $html = trim((string) $html);\n\n $attributes = array_merge($this->getRequiredAttributes(), $this->attributes());\n $attributesString = Html::attributes($attributes);\n\n return preg_replace('|<(.*?)>|', \"<$1$attributesString>\", $html, 1);\n }", "public function replaceAttributes($name, $value, $for, $content)\r\n\t{\r\n\t\t$content = str_replace('@' . $name . ' ' . $value, $for, $content);\r\n\t\t$content = str_replace('@' . $name . ':' . $value, $for, $content);\r\n\t\t$content = str_replace('@' . $name . ':\"' . $value . '\"', $for, $content);\r\n\t\treturn $content;\r\n\t}", "public function htmlAttr(string $str, bool $striptags = true): string\n\t{\n\t\t$str = html_entity_decode($str, ENT_QUOTES | ENT_HTML5, 'UTF-8');\n\t\tif($striptags) {\n\t\t\t$str = strip_tags($str);\n\t\t}\n\t\t$str = $this->typographicQuotationMarks($str);\n\t\t$str = $this->typographicApostropheMarks($str);\n\t\t$str = $this->formatSpaces($str);\n\t\treturn $str;\n\t}", "static function get_html_attributes( $attributes ) {\n $attr = '';\n foreach ( $attributes as $key => $value ) {\n if ( !is_null( $value ) ) {\n $attr .= \" data-$key='$value'\";\n }\n }\n return $attr;\n }", "function qa_sanitize_html_hook_tag($element, $attributes = null)\n{\n\tglobal $qa_sanitize_html_newwindow;\n\n\tif (!isset($attributes)) // it's a closing tag\n\t\treturn '</' . $element . '>';\n\n\tif ($element == 'param' && trim(strtolower(@$attributes['name'])) == 'allowscriptaccess')\n\t\t$attributes['name'] = 'allowscriptaccess_denied';\n\n\tif ($element == 'embed')\n\t\tunset($attributes['allowscriptaccess']);\n\n\tif ($element == 'a' && isset($attributes['href']) && $qa_sanitize_html_newwindow)\n\t\t$attributes['target'] = '_blank';\n\n\t$html = '<' . $element;\n\tforeach ($attributes as $key => $value)\n\t\t$html .= ' ' . $key . '=\"' . $value . '\"';\n\n\treturn $html . '>';\n}", "function util_getAttribute($in_haystack, $in_tag, $in_attr)\r\n{\r\n\t$attrs = util_innerString($in_haystack, \"<{$in_tag} \", '>', FALSE);\r\n\tif ($attrs) {\r\n\t\tif (substr($attrs, -1) == '/') {\r\n\t\t\t$attrs = substr($attrs, 0, -1);\r\n\t\t}\r\n\t}else {\r\n\t\treturn NULL;\r\n\t}\r\n\tforeach (explode(' ', util_whitespace($attrs)) as $candidate) {\r\n\t\t$attr = explode('=', $candidate, 2);\r\n\t\tif (count($attr) != 2) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif ($attr[0] == $in_attr) {\r\n\t\t\treturn substr($attr[1], 1, strlen($attr[1]) - 2);\r\n\t\t}\r\n\t}\r\n\treturn NULL;\r\n}", "function tag_attr($selector, $attr, $text = '', $source = false)\r\n{\r\n $t = tags_attr($selector, $attr, $text,$source);\r\n if ($t) $r = reset($t);\r\n else $r='';\r\n if (DEV)\r\n xlogc('tag_attr', $r, $selector, $attr, $source, $text);\r\n\r\n return $r;\r\n}", "function sanitize(\n $html,\n $tags_to_remove = ['script', 'iframe', 'input', 'form'],\n $attributes_to_keep = ['title', 'href', 'src'],\n $text_to_keep = []\n) {\n $htmlContent = str_get_html($html);\n\n foreach ($htmlContent->find('*') as $element) {\n if (in_array($element->tag, $text_to_keep)) {\n $element->outertext = $element->plaintext;\n } elseif (in_array($element->tag, $tags_to_remove)) {\n $element->outertext = '';\n } else {\n foreach ($element->getAllAttributes() as $attributeName => $attribute) {\n if (!in_array($attributeName, $attributes_to_keep)) {\n $element->removeAttribute($attributeName);\n }\n }\n }\n }\n\n return $htmlContent;\n}", "public function renderTagAttributes(){\n $row = '';\n foreach($this->tag_attributes as $key => $attribute)\n $row .= \"$key=\\\"$attribute\\\" \";\n return $row;\n }", "public function getHtmlAttributes();", "function wp_kses_attr($element, $attr, $allowed_html, $allowed_protocols)\n {\n }", "protected static function parse_html_attributes(nodes\\Tag $node) {\n\t\t\n\t\tif($node->content[0] == '(') {\n\t\t\t$html_attributes = static::extract_balanced($node, '(', ')');\n\t\t\t\n\t\t\tif($html_attributes === false) {\n\t\t\t\tstatic::$multiline = self::MULTILINE_HTML_ATTRIBUTES;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$attributes = array();\n\t\t\tforeach(static::quote_safe_explode(' ', $html_attributes) as $entry) {\n\t\t\t\t$parts = static::quote_safe_explode('=', $entry);\n\t\t\t\t\n\t\t\t\tif(count($parts) != 2)\n\t\t\t\t\t$node->exception('Parse error: bad html attribute syntax');\n\t\t\t\t\n\t\t\t\tif($parts[1][0] == '\"')\n\t\t\t\t $parts[1] = ruby\\InterpolatedString::compile($parts[1]);\n\t\t\t\t\n\t\t\t\t$attributes[$parts[0]] = $parts[1];\n\t\t\t}\n\t\t\t\n\t\t\tforeach($attributes as $attribute => $value)\n\t\t\t $node->attributes[] = array('\\'' . $attribute . '\\'', $value);\n\t\t\t\n\t\t\t$node->content = substr($node->content, strlen($html_attributes) + 2);\n\t\t}\n\t\t\n\t\tstatic::parse_ruby_attributes($node);\n\t\t\n\t}", "public function getHtmlAttributes() {}", "public function getHtmlAttributes() {}", "public static function attr($string, $strict = true) {\n if(static::noNeedToEscape($string)) return $string;\n if($strict === true) {\n return preg_replace_callback('/[^a-z0-9,\\.\\-_]/iSu', 'static::escapeAttrChar', $string);\n }\n return static::html($string);\n }", "protected function setAdditionalAttributes(array &$attributes, $html_tag) {\n switch ($html_tag) {\n case 'img':\n $attributes['style'][] = 'width:0;';\n $attributes['style'][] = 'height:0;';\n break;\n\n case 'iframe':\n $attributes['height'] = '1';\n $attributes['width'] = '1';\n $attributes['frameborder'] = '0';\n $attributes['scrolling'] = 'no';\n break;\n }\n }", "protected function registerUniversalTagAttributes() {}", "private function processAttrs(){\n\n\t\t$start = strlen($this->tag)+1;\n\t\t$temp = substr($this->raw,$start);\n\n\t\t//echo $temp . \"\\n\";\n\n\t\t$i=0;\n\t\tfor(; $i < strlen($temp); ){\n\t\t\tif($temp[$i] == '>') break;\n\t\t\t\t\n\t\t\t$pos = $this->skipWs($temp, $i);\n\t\t\t\t\n\t\t\t//echo \"should be r-{$temp[$pos]}\\n\";\n\t\t\t\t\n\t\t\t$pos2 = $this->skipToEqualOrWs($temp, $pos);\n\t\t\t\t\n\t\t\t//echo \"should be =-{$temp[$pos2]}\\n\";\n\t\t\t\t\n\t\t\t$attr = trim(substr($temp, $pos, $pos2 - $pos));\n\t\t\t\t\n\t\t\t//echo \"Got attribute-$attr\\n\";\n\t\t\t\t\n\t\t\tif(!empty($attr) && $pos2 < strlen($temp) && $temp[$pos2] == '='){\n\n\t\t\t\t//skip =\n\t\t\t\t$pos2++;\n\n\t\t\t\t$pos = $this->skipWs($temp, $pos2); //should be ' or \"\n\n\t\t\t\tif($temp[$pos] != '\"' && $temp[$pos] != \"'\"){\n\t\t\t\t\t//echo \"FAILED-{$temp[$pos]}\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$pos++; //skip the ' or \"\n\n\t\t\t\t$pos2 = $this->skipToQuote($temp, $pos, $temp[$pos-1]);\n\n\t\t\t\t$val = trim(substr($temp, $pos, $pos2-$pos),'\\'\"');\n\n\t\t\t\t$pos2++; //get past ' or \"\n\n\t\t\t\t$this->attributes[$attr] = $val;\n\n\t\t\t\t//echo \"$attr:$val\\n\";\n\t\t\t}\n\t\t\t$i = $pos2;\n\t\t}\n\t\t$this->textStart = $i+$start+1;\n\t}", "static function tagWithAttributeRegex ($tag, $attr, $value, $closing = true) {\n\t\treturn \":(\n\t\t(<($tag)\\s+[^>]*)\n\t\t($attr)=\n\t\t)\n\t\t(\n\t\t\t\\s*(\\\"|')\n\t\t\t((((?!\\\\6).)*\\s)*($value)(\\s((?!\\\\6).)*)*)\n\t\t\t\\\\6([^>]*>)\n\t\t|\n\t\t\t\\s*((?!/>)($value))\n\t\t\t([^>]*>)\n\t\t)\".($closing ? \"\n\t\t(((?!</($tag)>).)*)\n\t\t(</($tag)>)\n\t\t\" : \"\").\"\n\t\t:ix\";\n\t}", "function DOM_double_quotes_in_attributes() {\r\n\t\t$query = '//@*';\r\n\t\t$attributes = $this->xpath->query($query);\r\n\t\tforeach($attributes as $attribute) {\r\n\t\t\tif(strpos($attribute->nodeValue, '\"') !== false) {\r\n\t\t\t\t$attribute->nodeValue = str_replace('\"', '\\'', $attribute->nodeValue);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function removeBlacklistedAttributes($attribs) \n { \n $this->_html = preg_replace('/[\\s]+('.$attribs.')=[\\s]*(\"[^\"]*\"|\\'[^\\']*\\')/i',\"\",$this->_html); \n $this->_html = preg_replace('/[\\s]+('.$attribs.')=[\\s]*[^ |^>]*/i',\"\",$this->_html); \n }", "function string_restore_valid_html_tags( $p_string, $p_multiline = true ) \r\n{\r\n\t$t_html_valid_tags = config_get( $p_multiline ? 'html_valid_tags' : 'html_valid_tags_single_line' );\r\n\r\n\tif ( OFF === $t_html_valid_tags || is_blank( $t_html_valid_tags ) ) {\r\n\t\treturn $p_string;\r\n\t}\r\n\r\n\t$tags = explode( ',', $t_html_valid_tags );\r\n\tforeach ($tags as $key => $value) \r\n\t{ \r\n \tif ( !is_blank( $value ) ) {\r\n \t$tags[$key] = trim($value); \r\n }\r\n }\r\n $tags = implode( '|', $tags);\r\n\r\n\t$p_string = preg_replace( '/&lt;(' . $tags . ')\\s*&gt;/ui', '<\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/&lt;\\/(' . $tags . ')\\s*&gt;/ui', '</\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/&lt;(' . $tags . ')\\s*\\/&gt;/ui', '<\\\\1 />', $p_string );\r\n\r\n\r\n\treturn $p_string;\r\n}", "function e_attr($string)\n{\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "private static function removeUnallowedHTMLAttributes(string $html): string\n {\n $tidy = new tidy();\n\n $dom = new DOMDocument();\n\n // Normalizes the HTML which reduce the possibility of having an unexpected\n // exception in the DomDocument library because some bad HTML was found.\n // Once the HTML is normalized, we will parse it again.\n $html = $tidy->repairString($html, [\n 'output-xhtml' => true,\n 'show-body-only' => true,\n ], 'utf8');\n\n try {\n libxml_use_internal_errors(true);\n // Needs a XML encoding declaration to ensure is treated as UTF-8\n $dom->loadHTML('<?xml encoding=\"utf-8\" ?>'.$html);\n } catch (Exception $e) {\n return '';\n }\n\n $attributes = static::getAttributesNodes($dom);\n\n collect($attributes)\n ->filter(fn ($attribute) => static::isAttributeAllowedForTag($attribute))\n ->each(fn ($node) => $node->parentNode->removeAttribute($node->nodeName));\n\n return $tidy->repairString($dom->saveHTML(), [\n 'output-xhtml' => true,\n 'show-body-only' => true,\n ], 'utf8');\n }", "public static function renderAttributes($htmlOptions = array()) {\n static $specialAttributes = array(\n 'autofocus' => 1,\n 'autoplay' => 1,\n 'controls' => 1,\n 'declare' => 1,\n 'default' => 1,\n 'disabled' => 1,\n 'ismap' => 1,\n 'loop' => 1,\n 'muted' => 1,\n 'playsinline' => 1,\n 'webkit-playsinline' => 1,\n 'nohref' => 1,\n 'noresize' => 1,\n 'novalidate' => 1,\n 'open' => 1,\n 'reversed' => 1,\n 'scoped' => 1,\n 'seamless' => 1,\n 'selected' => 1,\n 'typemustmatch' => 1,\n 'lazyload' => 1,\n ), $specialAttributesNoValue = array(\n 'defer' => 1,\n 'async' => 1\n );\n\n if ($htmlOptions === array()) return '';\n\n $html = '';\n if (isset($htmlOptions['encode'])) {\n $raw = !$htmlOptions['encode'];\n unset($htmlOptions['encode']);\n } else\n $raw = false;\n\n foreach ($htmlOptions as $name => $value) {\n if (isset($specialAttributes[$name])) {\n if ($value) {\n $html .= ' ' . $name;\n if (self::$renderSpecialAttributesValue) $html .= '=\"' . $name . '\"';\n }\n } else if (isset($specialAttributesNoValue[$name])) {\n $html .= ' ' . $name;\n } else if ($value !== null) $html .= ' ' . $name . '=\"' . ($raw ? $value : self::encodeAttribute($value)) . '\"';\n }\n\n return $html;\n }", "function acf_esc_attrs($attrs)\n{\n}", "function wrapHtml($data = '', $tag, $attrs = null, $single_tag = false)\n{\n\t$ret = '<'.$tag;\n\tif (is_array($attrs) && !empty($attrs))\n\t{\n\t\t$ret .= ' ';\n\t\tforeach($attrs as $attr => $val)\n\t\t$ret .= $attr .'=\"'.$val .'\" ';\n\t}\n\t\n\tif ($single_tag)\n\t\t$ret .= ' />';\n\telse\n\t\t$ret .= '>'. $data. '</'.$tag.'>';\n\treturn $ret;\n}", "public function overlayUserdefinedHtmlAttributeValues() {}", "public function renderAttributes($htmlOptions) {\n\t\t$specialAttributes = array(\n\t\t\t'checked' => 1,\n\t\t\t'declare' => 1,\n\t\t\t'defer' => 1,\n\t\t\t'disabled' => 1,\n\t\t\t'ismap' => 1,\n\t\t\t'multiple' => 1,\n\t\t\t'nohref' => 1,\n\t\t\t'noresize' => 1,\n\t\t\t'readonly' => 1,\n\t\t\t'selected' => 1,\n\t\t);\n\n\t\tif ($htmlOptions === array())\n\t\t\treturn '';\n\t\t$html = '';\n\t\tif (isset($htmlOptions['encode'])) {\n\t\t\t$raw = !$htmlOptions['encode'];\n\t\t\tunset($htmlOptions['encode']);\n\t\t}\n\t\telse\n\t\t\t$raw = false;\n\n\n\t\tif ($raw) {\n\t\t\tforeach ($htmlOptions as $name => $value) {\n\t\t\t\tif (isset($specialAttributes[$name])) {\n\t\t\t\t\tif ($value)\n\t\t\t\t\t\t$html .= ' ' . $name . '=\"' . $name . '\"';\n\t\t\t\t}\n\t\t\t\telse if ($value !== null)\n\t\t\t\t\t$html .= ' ' . $name . '=\"' . $value . '\"';\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tforeach ($htmlOptions as $name => $value) {\n\n\t\t\t\tif (isset($specialAttributes[$name])) {\n\t\t\t\t\tif ($value)\n\t\t\t\t\t\t$html .= ' ' . $name . '=\"' . $name . '\"';\n\t\t\t\t}\n\t\t\t\telse if ($value !== null)\n\t\t\t\t\t$html .= ' ' . $name . '=\"' . self::encode($value) . '\"';\n\t\t\t}\n\t\t}\n\t\treturn $html;\n\t}", "private function miniTidyFixAttr($m)\n\t{\n\t\treturn $m[1].html::escapeHTML(html::decodeEntities($m[2])).$m[3];\n\t}", "public function setAttrs($attrs);", "function protectAttr($str,$name=false)\n\t{\n\t\tif ($name && !preg_match('/^[A-Za-z][A-Za-z0-9_:.-]*$/',$str)) {\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\treturn str_replace(array(\"'\",'\"'),array('&#039;','&quot;'),$str);\n\t}", "function _convert_attribute($match) {\n\t\treturn str_replace(array('>', '<', '\\\\'), array('&gt;', '&lt;', '\\\\\\\\'), $match [0]);\n\t}", "public function escapeHtmlAttr($string, $escapeSingleQuote = true)\n {\n\t\tif (!$string) return;\n return $this->_escaper->escapeHtmlAttr($string, $escapeSingleQuote);\n }", "public static function cleanTagsWithoutAttributes(array $tags, string $html): string {\n\t\t$empty_tags = implode('|', ArrayTools::preg_quote($tags, '|'));\n\t\treturn preg_replace('|<(' . $empty_tags . ')>([^<>]*)</\\1>|i', '$2', $html);\n\t}", "function change_tags($str){\r\n\r\n\t\t\t$str=str_replace('#ID#',$this->id,$str);\r\n\t\t\t$str=str_replace('#PAGE#',$this->page,$str);\r\n\t\t\t$str=str_replace('#ITEMS_PER_PAGE#',$this->items_per_page,$str);\r\n\t\t\t$str=str_replace('#TOTAL_ITEMS#',$this->total_items,$str);\r\n\r\n\t\t\treturn $str;\r\n\r\n\t}", "function strip_att_htmlN($string) \r\n {\r\n\t$desenho = array( '@');\r\n\t#Será retornado o seguinte no lugar delas, caso ache alguma palavra bloqueada\r\n\t$substituir_pore = array('');\r\n\t#Rodando a string e procurando pelas palavras proibidas\r\n\tfor($e=0;$e < sizeof($desenho); $e++) {\r\n\t\t\t$string = str_replace($desenho[$e], $substituir_pore[$e], $string);\r\n\t\t\t \r\n\t\t\t\r\n\t}\r\n\r\n\treturn $string; \r\n }", "function attributesToHtml($attributes) {\n $html='';\n if (is_array($attributes))\n foreach ($attributes as $attrName=>$attrValue) {\n $html.=' '.$attrName.'=\"'.$attrValue.'\"';\n } elseif(is_string($attributes))\n \t$html=$attributes;\n return $html;\n }", "public function setAttributes(array $attributes): HtmlElementInterface;", "public function overlayFixedHtmlAttributeValues() {}", "function tf_html_tag($tag, $attr = null, $end = null)\r\n {\r\n $inner = array($tag);\r\n if (isset($attr)) {\r\n foreach ($attr as $k => $v) {\r\n if (is_numeric($k)) {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($v), esc_attr($v));\r\n }\r\n else if ($v === true) {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($k), esc_attr($k));\r\n }\r\n else if ($v === false) {\r\n # ignore\r\n }\r\n else {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($k), esc_attr($v));\r\n }\r\n }\r\n }\r\n\r\n if ($end === true) {\r\n # close ELEMENT as HTML\r\n # <script></script>\r\n $body = '';\r\n $close = '</'.$tag.'>';\r\n }\r\n else if ($end === false) {\r\n # close ELEMENT as XML\r\n $inner[] = '/';\r\n $body = '';\r\n $close = '';\r\n }\r\n else {\r\n # if there is content close element, otherwise leave it open\r\n if (empty($end)) {\r\n $body = '';\r\n $close = '';\r\n }\r\n else {\r\n $body = strval($end);\r\n $close = '</'.$tag.'>';\r\n }\r\n }\r\n\r\n $open = '<'.implode(' ', $inner).'>';\r\n return $open.$body.$close;\r\n }", "function string_attribute( $p_string ) \r\n{\r\n\t$p_string = string_html_specialchars( $p_string );\r\n\r\n\treturn $p_string;\r\n}", "private function removeTagsWithMultiplication() {\n\t\t$special = array(\n\t\t\t// TagText-TagAttribut => Multiplikate\n\t\t\t'img-alt' => 3,\n\t\t\t'img-title' => 4,\n\t\t\t'a-title' => 5,\n\t\t\t'a' => 5,\n\t\t\t'h1' => 20,\n\t\t\t'h2' => 9,\n\t\t\t'h3' => 8,\n\t\t\t'h4' => 7,\n\t\t\t'h5' => 6,\n\t\t\t'h6' => 5,\n\t\t\t'b' => 4,\n\t\t\t'u' => 3,\n\t\t\t'i' => 2,\n\t\t\t'em' => 3,\n\t\t\t'strong' => 4,\n\t\t\t'cite' => 2,\n\t\t\t'blockquote' => 2\n\t\t);\n\t\tforeach ($special as $tag => $multis) {\n\t\t\tif (strpos($tag, '-') !== false) {\n\t\t\t\t$split = explode('-', $tag);\n\t\t\t\t$tag = $split[0];\n\t\t\t\t$attr = $split[1];\n\t\t\t\t$this->html = preg_replace('#<'.$tag.'[^>]*'.$attr.'=\"([^\"]*)\"[^>]*>#i', str_repeat(' $1 ', $multis), $this->html);\n\t\t\t} else {\n\t\t\t\t$this->html = preg_replace('#<'.$tag.'(>|\\s.*?>)(.*?)</'.$tag.'>#is', str_repeat(' $2 ', $multis), $this->html);\n\t\t\t}\n\t\t}\n\t\t$this->html = strip_tags($this->html);\n\t}", "function gwt_drupal_process_html(&$variables, $hook) {\n // Flatten out html_attributes.\n $variables['html_attributes'] = drupal_attributes($variables['html_attributes_array']);\n}", "public function html_format($string)\n\t\t{\n\t\t\t$string = str_ireplace(array_keys($this->bb_code_tags), array_values($this->bb_code_tags), $string);\n\t\t\t\n\t\t\tif(stripos($string, '[/url]') == true || stripos($string, '[/img]') == true || stripos($string, '[/image]') == true)\n\t\t\t{\n\t\t\t\tforeach($this->advanced_bb_code_tags as $match => $replacement) \n\t\t\t\t{\n\t\t\t\t\t$string = preg_replace($match, $replacement, $string);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n \t\t\treturn $string;\n\t\t}", "protected static function pre_processing ($tag, &$attributes) { }", "function remove_html_tag_news($data){\n\treturn preg_replace('/ style=\".*?\"/i', '$1', strip_tags($data, '<i><a><b><u><div><hr>'));\n}", "protected function buildHtmlAttrs($params)\n {\n $html_params = $params['html'];\n $html = '';\n\n foreach ($html_params as $key => $val) {\n $html .= \" {$key}=\\\"{$val}\\\"\";\n }\n\n return $html;\n }", "function _filter_xss_attributes($attr) {\n $attrarr = array();\n $mode = 0;\n $attrname = '';\n\n while (strlen($attr) != 0) {\n // Was the last operation successful?\n $working = 0;\n\n switch ($mode) {\n case 0:\n // Attribute name, href for instance.\n if (preg_match('/^([-a-zA-Z]+)/', $attr, $match)) {\n $attrname = strtolower($match[1]);\n $skip = ($attrname == 'style' || substr($attrname, 0, 2) == 'on');\n $working = $mode = 1;\n $attr = preg_replace('/^[-a-zA-Z]+/', '', $attr);\n }\n break;\n\n case 1:\n // Equals sign or valueless (\"selected\").\n if (preg_match('/^\\s*=\\s*/', $attr)) {\n $working = 1;\n $mode = 2;\n $attr = preg_replace('/^\\s*=\\s*/', '', $attr);\n break;\n }\n\n if (preg_match('/^\\s+/', $attr)) {\n $working = 1;\n $mode = 0;\n if (!$skip) {\n $attrarr[] = $attrname;\n }\n $attr = preg_replace('/^\\s+/', '', $attr);\n }\n break;\n\n case 2:\n // Attribute value, a URL after href= for instance.\n if (preg_match('/^\"([^\"]*)\"(\\s+|$)/', $attr, $match)) {\n $thisval = filter_xss_bad_protocol($match[1]);\n\n if (!$skip) {\n $attrarr[] = \"$attrname=\\\"$thisval\\\"\";\n }\n $working = 1;\n $mode = 0;\n $attr = preg_replace('/^\"[^\"]*\"(\\s+|$)/', '', $attr);\n break;\n }\n\n if (preg_match(\"/^'([^']*)'(\\s+|$)/\", $attr, $match)) {\n $thisval = filter_xss_bad_protocol($match[1]);\n\n if (!$skip) {\n $attrarr[] = \"$attrname='$thisval'\";\n }\n $working = 1;\n $mode = 0;\n $attr = preg_replace(\"/^'[^']*'(\\s+|$)/\", '', $attr);\n break;\n }\n\n if (preg_match(\"%^([^\\s\\\"']+)(\\s+|$)%\", $attr, $match)) {\n $thisval = filter_xss_bad_protocol($match[1]);\n\n if (!$skip) {\n $attrarr[] = \"$attrname=\\\"$thisval\\\"\";\n }\n $working = 1;\n $mode = 0;\n $attr = preg_replace(\"%^[^\\s\\\"']+(\\s+|$)%\", '', $attr);\n }\n break;\n }\n\n if ($working == 0) {\n // Not well formed; remove and try again.\n $attr = preg_replace('/\n ^\n (\n \"[^\"]*(\"|$) # - a string that starts with a double quote, up until the next double quote or the end of the string\n | # or\n \\'[^\\']*(\\'|$)| # - a string that starts with a quote, up until the next quote or the end of the string\n | # or\n \\S # - a non-whitespace character\n )* # any number of the above three\n \\s* # any number of whitespaces\n /x', '', $attr);\n $mode = 0;\n }\n }\n\n // The attribute list ends with a valueless attribute like \"selected\".\n if ($mode == 1 && !$skip) {\n $attrarr[] = $attrname;\n }\n return $attrarr;\n}", "public function setHtmlAttributeWildcards() {}", "public function html_attributes( $attributes = array(), $prefix = '' ) {\n\n\t\t// If empty return false\n\t\tif ( empty( $attributes ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$options = false;\n\t\tif( isset( $attributes['data-plugin-options'] ) ) {\n\t\t\t$options = $attributes['data-plugin-options'];\n\t\t\tunset( $attributes['data-plugin-options'] );\n\t\t}\n\n\t\t$out = '';\n\t\tforeach ( $attributes as $key => $value ) {\n\n\t\t\tif( ! $value ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$key = $prefix . $key;\n\n\t\t\tif( true === $value ) {\n\t\t\t\t$value = 'true';\n\t\t\t}\n\n\t\t\t$out .= sprintf( ' %s=\"%s\"', esc_html( $key ), esc_attr( $value ) );\n\t\t}\n\n\t\tif( $options ) {\n\t\t\t$out .= sprintf( ' data-plugin-options=\\'%s\\'', $options );\n\t\t}\n\n\t\treturn $out;\n\t}", "private function _convert_attribute($match)\n {\n return str_replace(array('>', '<', '\\\\'), array('&gt;', '&lt;', '\\\\\\\\'), $match[0]);\n }", "function render($atts = [], $content = null, $tag = '')\n {\n $atts = array_change_key_case((array) $atts, CASE_LOWER);\n\n $dom = new \\DOMDocument('1.0');\n $domElement = $dom->createElement($this->element);\n\n foreach ($atts as $attributeName => $attributeValue) {\n try {\n $domAttribute = $dom->createAttribute($attributeName);\n }\n catch (\\DOMException $ex) {\n continue;\n }\n $domAttribute->value = $attributeValue;\n $domElement->appendChild($domAttribute);\n }\n\n $dom->appendChild($domElement);\n $output = $dom->saveHTML();\n return $output;\n }", "private function _renderAttributes($attributes) {\n $html = \"\";\n if (count($attributes)) {\n foreach ($attributes as $attribute => $value) {\n $html .= \" {$attribute}=\\\"{$value}\\\" \";\n }\n }\n return trim($html);\n }", "protected function renderAttributes()\n {\n $html = '';\n $no_key = ['loading'];\n\n foreach ($this->attributes as $key => $value) {\n if ($value === null) {\n continue;\n }\n\n if (is_numeric($key)) {\n $key = $value;\n }\n if (is_array($value)) {\n $value = implode(' ', $value);\n }\n\n if (in_array($key, $no_key, true)) {\n $element = htmlentities($value, ENT_QUOTES, 'UTF-8', false);\n } else {\n $element = $key . '=\"' . htmlentities($value, ENT_QUOTES, 'UTF-8', false) . '\"';\n }\n\n $html .= ' ' . $element;\n }\n\n return $html;\n }", "private function HtmlAttributes($attributes)\r\n {\r\n $formatted = join(' ', array_map(function ($key) use ($attributes) {\r\n if (is_bool($attributes[$key])) {\r\n return $attributes[$key] ? $key : '';\r\n }\r\n return $key . '=\"' . $attributes[$key] . '\"';\r\n }, array_keys($attributes)));\r\n return $formatted;\r\n }", "function _twig_escape_html_attr_callback($matches)\n{\n /*\n * While HTML supports far more named entities, the lowest common denominator\n * has become HTML5's XML Serialisation which is restricted to the those named\n * entities that XML supports. Using HTML entities would result in this error:\n * XML Parsing Error: undefined entity\n */\n static $entityMap = array(\n 34 => 'quot', /* quotation mark */\n 38 => 'amp', /* ampersand */\n 60 => 'lt', /* less-than sign */\n 62 => 'gt', /* greater-than sign */\n );\n $chr = $matches[0];\n $ord = ord($chr);\n /**\n * The following replaces characters undefined in HTML with the\n * hex entity for the Unicode replacement character.\n */\n if (($ord <= 0x1f && $chr != \"\\t\" && $chr != \"\\n\" && $chr != \"\\r\") || ($ord >= 0x7f && $ord <= 0x9f)) {\n return '&#xFFFD;';\n }\n /**\n * Check if the current character to escape has a name entity we should\n * replace it with while grabbing the hex value of the character.\n */\n if (strlen($chr) == 1) {\n $hex = strtoupper(substr('00'.bin2hex($chr), -2));\n } else {\n $chr = twig_convert_encoding($chr, 'UTF-16BE', 'UTF-8');\n $hex = strtoupper(substr('0000'.bin2hex($chr), -4));\n }\n $int = hexdec($hex);\n if (array_key_exists($int, $entityMap)) {\n return sprintf('&%s;', $entityMap[$int]);\n }\n /**\n * Per OWASP recommendations, we'll use hex entities for any other\n * characters where a named entity does not exist.\n */\n return sprintf('&#x%s;', $hex);\n}", "function rewrapHTML($str) {\n $pattern = '~(^|>)([^<]+)~';\n return preg_replace_callback($pattern, array(&$this, 'rewrapHTMLCallback'), $str);\n }", "function prefix_tag_attribute($prefix, $key, $value)\r\n{\r\n $key = \"$prefix-$key\";\r\n return tag_attribute($key, $value);\r\n}", "function remove_img_attr ($html)\n{\n return preg_replace('/(width|height)=\"\\d+\"\\s/', \"\", $html);\n}", "function addAttributesToTag($tag, $attributes)\n {\n $filter = '(//' . $tag . ')';\n $elements = $this->xpath->query($filter);\n foreach ($elements as $index => $element) {\n $tag = $element->tagName;\n foreach ($attributes as $attr => $values) {\n foreach ($values as $value) {\n $element->setAttribute($attr, $value);\n }\n }\n }\n }", "public function testGetHtmlWithAttributes()\n {\n $option = new Option('foo', 'bar');\n\n self::assertSame('<option value=\"foo\" class=\"baz\" id=\"foo-bar\">bar</option>', $option->getHtml(['class' => 'baz', 'id' => 'foo-bar']));\n }", "function esc_attrs(array $attributes, $startWithSpace = true) {\n $pairs = [];\n foreach ($attributes as $name => $value) {\n if (is_int($name)) {\n $pairs[] = $value;\n } else {\n $pairs[] = $name.'=\"'.esc_attr($value).'\"';\n }\n }\n $prefix = !empty($pairs) && $startWithSpace ? ' ' : '';\n return $prefix.join(' ', $pairs);\n }", "public static function attributes($attrs) {\n\t\tif (empty($attrs))\n\t\t\treturn '';\n\n\t\tif (is_string($attrs))\n\t\t\treturn ' '.$attrs;\n\n\t\t$compiled = '';\n\t\tforeach ($attrs as $key => $val) {\n\t\t\t$compiled .= ' '.$key.'=\"'.$val.'\"';\n\t\t}\n\n\t\treturn $compiled;\n\t}", "function array_to_attrs($attrs)\n {\n $temp = array();\n foreach ($attrs as $name => $value) {\n $temp[] = $name . '=\"' . htmlspecialchars($value) . '\"';\n }\n return implode(' ', $temp);\n }", "private function _remove_evil_attributes($str, $is_image)\n {\n // All javascript event handlers (e.g. onload, onclick, onmouseover), style, and xmlns\n //$evil_attributes = array('on\\w*', 'style', 'xmlns', 'formaction');\n $evil_attributes = array('on\\w*', 'xmlns', 'formaction');\n\n if ($is_image === true)\n {\n /*\n * Adobe Photoshop puts XML metadata into JFIF images,\n * including namespacing, so we have to allow this for images.\n */\n unset($evil_attributes[array_search('xmlns', $evil_attributes)]);\n }\n\n do {\n $count = 0;\n $attribs = array();\n\n // find occurrences of illegal attribute strings with quotes (042 and 047 are octal quotes)\n preg_match_all('/('.implode('|', $evil_attributes).')\\s*=\\s*(\\042|\\047)([^\\\\2]*?)(\\\\2)/is', $str, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $attr)\n {\n $attribs[] = preg_quote($attr[0], '/');\n }\n\n // find occurrences of illegal attribute strings without quotes\n preg_match_all('/('.implode('|', $evil_attributes).')\\s*=\\s*([^\\s>]*)/is', $str, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $attr)\n {\n $attribs[] = preg_quote($attr[0], '/');\n }\n\n // replace illegal attribute strings that are inside an html tag\n if (count($attribs) > 0)\n {\n $str = preg_replace('/(<?)(\\/?[^><]+?)([^A-Za-z<>\\-])(.*?)('.implode('|', $attribs).')(.*?)([\\s><]?)([><]*)/i', '$1$2 $4$6$7$8', $str, -1, $count);\n }\n\n } while ($count);\n\n return $str;\n }", "function attributer($attributes){\n\t$output = '';\n\tforeach ($attributes as $attribute => $value) {\n\t \tif(is_array($value)){ //breaks down any array into a string\n\t \t\tswitch ($attribute) {\n\t \t\t\tcase 'class': \t$output .= 'class=\"'.implode(' ', $value).'\" '; break;\n\t \t\t\tcase 'onclick': $output .= $value.'()'; break;\n\t \t\t\tcase 'data': \tforeach ($value as $name=>$val) { $output .= 'data-'.$key.'= \"'.$val.'\" '; } break;\t \t\t\t\n\t \t\t\tdefault: \t\t$output .= $attribute.' '; break;\n\t \t\t}\t \t\t \n\t \t}\n\t \telse{ $output .= ' '.$attribute.'=\"'.$value.'\" ';\t} \t\n\t}\n\treturn $output;\n}", "protected function getHtmlAttributes($attributes) {\n\t\t$list = array();\n\t\tforeach ($attributes as $name=>$value) {\n\t\t\tif (!empty($value)) {\n\t\t\t\tif (is_scalar($value)) {\n\t\t\t\t\t$list[] = \"$name='\" . htmlentities($value, ENT_QUOTES, \"UTF-8\") . \"'\";\n\t\t\t\t} elseif (is_array($value)) {\n\t\t\t\t\t$list[] = $this->getHtmlAttributes($value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (count($list)>0) {\n\t\t\treturn \" \" . implode(\" \", $list);\n\t\t}\n\n\t\treturn \"\";\n\t}", "function style_tag_attribute($value)\r\n{\r\n if (is_array($value)) {\r\n $value = implode('', array_map_with_keys($value, function($value, $key){\r\n return \"$key:$value;\";\r\n }));\r\n }\r\n\r\n return tag_attribute('style', $value);\r\n}", "static function prepare_attr_value ($text) {\n\t\tif (is_array($text)) {\n\t\t\tforeach ($text as &$t) {\n\t\t\t\t$t = static::prepare_attr_value($t);\n\t\t\t}\n\t\t\treturn $text;\n\t\t}\n\t\treturn strtr(\n\t\t\t$text,\n\t\t\t[\n\t\t\t\t'&' => '&amp;',\n\t\t\t\t'\"' => '&quot;',\n\t\t\t\t'\\'' => '&apos;',\n\t\t\t\t'<' => '&lt;',\n\t\t\t\t'>' => '&gt;'\n\t\t\t]\n\t\t);\n\t}", "public function normalizeTags($attribute,$params)\n\t{\n\t\t$this->tags=Tag::array2string(array_unique(Tag::string2array($this->tags)));\n\t}", "public function normalizeTags($attribute,$params)\n\t{\n\t\t$this->tags=Tag::array2string(array_unique(Tag::string2array($this->tags)));\n\t}", "public function normalizeTags($attribute,$params)\n {\n $this->tags=VideoTag::array2string(array_unique(VideoTag::string2array($this->tags)));\n }", "private static function parseAttrs($attrs) {\n\t\t$string = '';\n\n\t\tif (is_string($attrs)) {\n\t\t\t$attrs = ['class' => $attrs];\n\t\t}\n\n\t\tforeach ($attrs as $key => $val) {\n\t\t\tif (is_int($key)) {\n\t\t\t\t$string .= ' '.$val;\n\t\t\t} else {\n\t\t\t\t$string .= ' '.$key.'=\"'.$val.'\"';\n\t\t\t}\n\t\t}\n\n\t\treturn $string;\n\t}", "function tags_attr($selector, $attr, $text = '', $source = false)\r\n{\r\n\r\n\r\n $result = array();\r\n $text = trim($text);\r\n foreach (get_noko($source)->get($selector)->toArray() as $tag)\r\n if (!$text or @in_array($text,$tag['#text']))\r\n if (!empty($tag[$attr])) $result[] = trim($tag[$attr]);\r\n $r = $result;\r\n\r\n if (DEV)\r\n xlogc('tags_attr', $r, $selector, $attr, $source, $text);\r\n\r\n return $r;\r\n}", "function pnq_prepare_attrs( $attrs ) {\t\n\t$prepared_attrs = '';\n\tif( isset( $attrs ) ) {\t\t\n\t\tforeach( $attrs as $attr_name => $attr_val ) {\n\t\t\t$prepared_attrs = $prepared_attrs . $attr_name . '=\"' . esc_attr( $attr_val ) . '\"';\n\t\t}\n\t}\t\n\treturn $prepared_attrs;\n}", "function open_tag($element, $attr){\n\t\n}", "private function replace_conditional_tag( $html, $original ) {\r\n\t\t$template_tag_position = strpos( $html, self::WP_ROCKET_CONDITIONAL );\r\n\r\n\t\treturn substr_replace(\r\n\t\t\t$html,\r\n\t\t\t$original,\r\n\t\t\t$template_tag_position,\r\n\t\t\tstrlen( self::WP_ROCKET_CONDITIONAL )\r\n\t\t);\r\n\t}", "function fixAttributes(&$template,$attribute) {\n\tif ( ! is_array($template[$attribute]) ) return;\n\tif ( $template[$attribute]['@attributes'] ) {\n\t\t$template[$attribute][0]['@attributes'] = $template[$attribute]['@attributes'];\n\t\tif ( $template[$attribute]['value'])\n\t\t\t$template[$attribute][0]['value'] = $template[$attribute]['value'];\n\n\t\tunset($template[$attribute]['@attributes']);\n\t\tunset($template[$attribute]['value']);\n\t}\n\n\tif ( $template[$attribute] ) {\n\t\tforeach ($template[$attribute] as $tempArray) {\n\t\t\t$tempArray2[] = $tempArray['value'] ? array('@attributes'=>$tempArray['@attributes'],'@value'=>$tempArray['value']) : array('@attributes'=>$tempArray['@attributes']);\n\t\t}\n\t\t$template[$attribute] = $tempArray2;\n\t}\n}", "public function normalizeTags($attribute,$params)\n\t{\n\t $this->tags=Tag::array2string(array_unique(Tag::string2array($this->tags)));\n\t}", "function attribute_escape($text)\n {\n }", "function safecss_filter_attr($css, $deprecated = '')\n {\n }", "public function escapeHtmlAttr($string, $escapeSingleQuote = true)\n {\n if ($escapeSingleQuote) {\n return $this->getEscaper()->escapeHtmlAttr((string) $string);\n }\n return htmlspecialchars((string)$string, ENT_COMPAT, 'UTF-8', false);\n }", "function tag_escape($tag_name)\n {\n }", "function extract_attrib_2($html) {\n\tpreg_match_all('/<a[^>]*\\>/', $html, $matcha); //匹配img标签\n\tforeach ($matcha[0] as $k => $vala) {\n\t\tpreg_match_all('/(href)=(\"[^\"]*\")/i', $vala, $matchesa);\n\t\t$zh = substr(trim($matchesa[2][0], '\"'), -3);\n\t\t// dd($zh,in_array($zh, ['png','jpg','peg','gif','bmp','et/']));\n\t\tif (in_array($zh, ['png', 'jpg', 'peg', 'gif', 'bmp'])) {\n\t\t\t$vala2 = str_insert($vala, 3, ' class=\"gallery-item-hook\"');\n\t\t\t$html = str_replace($vala, $vala2, $html);\n\t\t}\n\t\t// dd($val,$k,$matches[2][0]);\n\t\t// dd($matches);\n\t}\n\tpreg_match_all('/<img[^>]*\\>/', $html, $match); //匹配img标签\n\t// dd($match);\n\tforeach ($match[0] as $k => $val) {\n\t\tpreg_match_all('/(id|alt|title|src)=(\"[^\"]*\")/i', $val, $matches);\n\t\t$html = str_replace($val, '<a href=' . $matches[2][0] . ' class=\"gallery-item-hook\">' . $val . '</a>', $html);\n\t\t// dd($val, $k, $matches[2][0]);\n\t\t// dd($matches);\n\t}\n\treturn ['html' => $html];\n}", "function htmlButTags($str) {\n\t$caracteres = get_html_translation_table(HTML_ENTITIES);\n\t// Find out the \"tags\" entities\n\t$remover = get_html_translation_table(HTML_SPECIALCHARS);\n\t// Spit out the tags entities from the original table\n\t$caracteres = array_diff($caracteres, $remover);\n\t// Translate the string....\n\t$str = strtr($str, $caracteres);\n\t\n\t// now amps\n\t$str = preg_replace(\"/&(?![A-Za-z]{0,4}\\w{2,3};|#[0-9]{2,3};)/\",\"&amp;\" , $str);\n\t\n\treturn $str;\n}", "protected function generateHTML(array $attrs)\r\n {\r\n $html = '<span';\r\n\r\n foreach ($attrs as $key => $value) {\r\n $html .= ' ' . $key . '=\"' . $value . '\"';\r\n }\r\n\r\n $html .= '></span>';\r\n\r\n return $html;\r\n }", "public function testCustomAttribute() : void\n {\n $string = $this->basicSanitizer->sanitize('<img src=\"1.png\" data-src=\"1.png\">');\n $this->assertEquals('<img src=\"1.png\" data-src=\"1.png\">', $string);\n }", "public static function attributes($attrs)\n\t{\n\t\tif (empty($attrs))\n\t\t\treturn '';\n\n\t\tif (is_string($attrs))\n\t\t\treturn ' '.$attrs;\n\n\t\t$compiled = '';\n\t\tforeach($attrs as $key => $val)\n\t\t{\n\t\t\t$compiled .= ' '.$key.'=\"'.$val.'\"';\n\t\t}\n\n\t\treturn $compiled;\n\t}", "public static function mergeAttr(){\n\t\t$all_attr = func_get_args();\n\t\t$all_attr = array_filter($all_attr);\n\t\tforeach($all_attr as $x=>$attr){\n\t\t\tif(is_string($attr))parse_str($attr, $all_attr[$x]);\n\t\t}\n\t\treturn call_user_func_array('array_replace', $all_attr);\n\t}", "function initialize () {\n $this->set_openingtag(\"<A[attributes]>\");\n\t$this->set_closingtag(\"</A>\");\n }", "public function removeTagAttributes($tag)\n\t{\n\t\t$args = $this->argsArray(func_get_args());\n\t\tarray_shift($args);\n\t\t\n\t\tforeach ($args as $a) {\n\t\t\t$this->removed_tag_attrs[$tag][] = $a;\n\t\t}\n\t}", "public function openHtmlTag($tag, $attributes = '')\n {\n return '<'.$tag.(empty($attributes) ? '' : ' '.$attributes).($this->isSelfClosingTag($tag) ? '/>' : '>');\n }", "public function testReplaceTags()\n\t{\n\t\t$this->assertEquals('143',$this->obj->replace_tags('1{{2}}3', '', array(\"2\"=>\"4\")));\n\t\t$this->assertEquals('143',$this->obj->replace_tags('1{{args:2}}3', 'args', array(\"2\"=>\"4\")));\n\t\t$this->assertEquals('143$var',$this->obj->replace_tags('1{{args:2}}3$var', 'args', array(\"2\"=>\"4\")));\n\t}", "public function tag($attr = array()) {\n\n // don't return the tag if the url is not available\n if(!$this->result->url()) return false;\n\n return html::img($this->result->url(), array_merge(array(\n 'alt' => isset($this->options['alt']) ? $this->options['alt'] : ' ',\n 'class' => isset($this->options['class']) ? $this->options['class'] : null,\n ), $attr));\n\n }" ]
[ "0.6510681", "0.64560896", "0.6431701", "0.63907593", "0.6334694", "0.6184258", "0.61617935", "0.6134487", "0.61121345", "0.594832", "0.5942236", "0.5910045", "0.59010416", "0.5900244", "0.58947814", "0.5887625", "0.5885039", "0.585133", "0.585133", "0.58448493", "0.5837824", "0.58378196", "0.58164454", "0.5797961", "0.5788007", "0.5781884", "0.5736248", "0.5709827", "0.5674714", "0.5650499", "0.5645368", "0.5611355", "0.56069124", "0.5594279", "0.55863315", "0.55785644", "0.5554225", "0.55444854", "0.55382055", "0.5504604", "0.5500205", "0.549622", "0.5490743", "0.54844534", "0.54702693", "0.5468873", "0.5468788", "0.5462761", "0.54494566", "0.54482657", "0.54290164", "0.5421475", "0.5421217", "0.5381547", "0.5371355", "0.535287", "0.5318433", "0.5311653", "0.5304937", "0.5304088", "0.53018385", "0.5287552", "0.5282074", "0.52817744", "0.5280991", "0.5280613", "0.527199", "0.5265836", "0.5264114", "0.5259443", "0.5258103", "0.524948", "0.5239732", "0.5236806", "0.5234194", "0.52309924", "0.52309924", "0.523087", "0.52300376", "0.52278364", "0.5227743", "0.52187437", "0.52150005", "0.5206926", "0.51990145", "0.5192133", "0.5191488", "0.51903033", "0.5184836", "0.5184719", "0.5182251", "0.5180901", "0.5177212", "0.51730126", "0.5167232", "0.51670253", "0.5160632", "0.5159067", "0.5155798", "0.5154587" ]
0.5648693
30
Remove certain tags from an HTML string
public static function cleanTags(string $string, array $allowed_tags = null, array $remove_tags = []): string { if (is_array($allowed_tags)) { $allowed_tags = ArrayTools::changeValueCase($allowed_tags); } $remove_tags = ArrayTools::changeValueCase($remove_tags); $found_tags = self::parseTags($string); if (!$found_tags) { return $string; } $found_tags = array_keys($found_tags); foreach ($found_tags as $k) { $k = strtolower($k); if (is_array($allowed_tags) && !in_array($k, $allowed_tags)) { $string = self::removeTags($k, $string, false); } elseif (in_array($k, $remove_tags)) { $string = self::removeTags($k, $string, false); } } return $string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sanitize(\n $html,\n $tags_to_remove = ['script', 'iframe', 'input', 'form'],\n $attributes_to_keep = ['title', 'href', 'src'],\n $text_to_keep = []\n) {\n $htmlContent = str_get_html($html);\n\n foreach ($htmlContent->find('*') as $element) {\n if (in_array($element->tag, $text_to_keep)) {\n $element->outertext = $element->plaintext;\n } elseif (in_array($element->tag, $tags_to_remove)) {\n $element->outertext = '';\n } else {\n foreach ($element->getAllAttributes() as $attributeName => $attribute) {\n if (!in_array($attributeName, $attributes_to_keep)) {\n $element->removeAttribute($attributeName);\n }\n }\n }\n }\n\n return $htmlContent;\n}", "function strips_all_tags( $html )\n\t{\n\t\t$search = [\n\t\t\t'@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments including CDATA\n\t\t];\n\t\t$result = preg_replace( $search, '', $html );\n\n\t\treturn $result;\n\t}", "static function strip_html_tags($string){\n return preg_replace(array('/\\<(script)(.+)>/i', '/\\<(.+)(script)>/i', '/\\<(style)(.+)>/i', '/\\<(.+)(style)>/i'), '', $string);\n }", "function remove_html_tag_news($data){\n\treturn preg_replace('/ style=\".*?\"/i', '$1', strip_tags($data, '<i><a><b><u><div><hr>'));\n}", "function strip_html_tags($str){\n $str = preg_replace('/(<|>)\\1{2}/is', '', $str);\n $str = preg_replace(\n array(// Remove invisible content\n '@<head[^>]*?>.*?</head>@siu',\n '@<style[^>]*?>.*?</style>@siu',\n '@<script[^>]*?.*?</script>@siu',\n '@<noscript[^>]*?.*?</noscript>@siu',\n ),\n \"\", //replace above with nothing\n $str );\n $str = replaceWhitespace($str);\n $str = strip_tags($str);\n return $str;\n}", "function strip_only($str, $tags) {\n if(!is_array($tags)) {\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n foreach($tags as $tag) $str = preg_replace('#</?'.$tag.'[^>]*>#is', '', $str);\n return $str;\n}", "function filter_tags($string)\n{\n return preg_replace('/<[^>]*>/', ' ', $string);\n}", "function remove_tags( $html, $tags, $strip_content = FALSE )\n\t{\n\t\t$content = '';\n\t\tif ( ! is_array( $tags ) )\n\t\t{\n\t\t\t$tags = ( strpos( $html, '>' ) !== FALSE ? explode( '>', str_replace( '<', '', $tags ) ) : [ $tags ] );\n\t\t\tif ( end( $tags ) == '' )\n\t\t\t{\n\t\t\t\tarray_pop( $tags );\n\t\t\t}\n\t\t}\n\t\tforeach ( $tags as $tag )\n\t\t{\n\t\t\tif ( $strip_content )\n\t\t\t{\n\t\t\t\t$content = '(.+</' . $tag . '[^>]*>|)';\n\t\t\t}\n\n\t\t\t$html = preg_replace( '#</?' . $tag . '[^>]*>' . $content . '#is', '', $html );\n\t\t}\n\n\t\treturn $html;\n\t}", "function strips_tags( $html, $disallowed_tag = 'script|style|noframes|select|option', $allowed_tag = '' )\n\t{\n\t\t//prep the string\n\t\t$html = ' ' . $html;\n\n\t\t//initialize keep tag logic\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\t$k = explode( '|', $allowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '<' . $k[ $i ], '[{(' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '</' . $k[ $i ], '[{(/' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\t\t//begin removal\n\t\t//remove comment blocks\n\t\twhile ( stripos( $html, '<!--' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<!--' );\n\t\t\t$pos[ 2 ] = stripos( $html, '-->', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 3;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//remove tags with content between them\n\t\tif ( strlen( $disallowed_tag ) > 0 )\n\t\t{\n\t\t\t$e = explode( '|', $disallowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $e ); $i++ )\n\t\t\t{\n\t\t\t\twhile ( stripos( $html, '<' . $e[ $i ] ) > 0 )\n\t\t\t\t{\n\t\t\t\t\t$len[ 1 ] = strlen( '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 1 ] = stripos( $html, '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 2 ] = stripos( $html, $e[ $i ] . '>', $pos[ 1 ] + $len[ 1 ] );\n\t\t\t\t\t$len[ 2 ] = $pos[ 2 ] - $pos[ 1 ] + $len[ 1 ];\n\t\t\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 2 ] );\n\t\t\t\t\t$html = str_replace( $x, '', $html );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//remove remaining tags\n\t\twhile ( stripos( $html, '<' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<' );\n\t\t\t$pos[ 2 ] = stripos( $html, '>', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 1;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//finalize keep tag\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '[{(' . $k[ $i ], '<' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '[{(/' . $k[ $i ], '</' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\n\t\treturn trim( $html );\n\t}", "public static function cleanInsideHtmlTags($str,$tags)\n\t{\n\t\tpreg_match_all('/<([^>]+)>/i',$tags,$allTags,PREG_PATTERN_ORDER);\n\t\tforeach($allTags[1] as $tag)\n\t\t{\n\t\t\t$str=preg_replace('/<'.$tag.' [^>]*>/i','<'.$tag.'>',$str);\n\t\t}\n\n\t\treturn $str;\n\t}", "function wpmantis_strip_only($str, $tags, $stripContent = false)\n{\n $content = '';\n if(!is_array($tags)) {\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n foreach($tags as $tag) {\n if ($stripContent)\n $content = '(.+</'.$tag.'[^>]*>|)';\n $str = preg_replace('#</?'.$tag.'[^>]*>'.$content.'#is', '', $str);\n }\n return $str;\n}", "function strip_selected_tags($str, $tags = \"\", $stripContent = false)\n {\n preg_match_all(\"/<([^>]+)>/i\",$tags,$allTags,PREG_PATTERN_ORDER);\n foreach ($allTags[1] as $tag){\n if ($stripContent) {\n $str = preg_replace(\"/<\".$tag.\"[^>]*>.*<\\/\".$tag.\">/iU\",\"\",$str);\n }\n $str = preg_replace(\"/<\\/?\".$tag.\"[^>]*>/iU\",\"\",$str);\n }\n return $str;\n }", "function remove_html($content) {\r\n\t$content = strip_tags($content);\r\n return $content;\r\n}", "function clean_inside_tags($txt,$tags){\n\t\t\t$txt =removeemptytags($txt);\n\t\t\tpreg_match_all(\"/<([^>]+)>/i\",$tags,$allTags,PREG_PATTERN_ORDER);\n\t\t\n\t\t\tforeach ($allTags[1] as $tag){\n\t\t\t\t$txt = preg_replace(\"/<\".$tag.\"[^>]*>/i\",\"<\".$tag.\">\",$txt);\n\t\t\t}\n\t\t\treturn $txt;\n\t\t}", "function strip_htmltag($str, $all = TRUE)\n{\n\tglobal $_symbol_noexists;\n\tstatic $noexists_pattern;\n\n\tif (! isset($noexists_pattern))\n\t\t$noexists_pattern = '#<span class=\"noexists\">([^<]*)<a[^>]+>' .\n\t\t\tpreg_quote($_symbol_noexists, '#') . '</a></span>#';\n\n\t// Strip Dagnling-Link decoration (Tags and \"$_symbol_noexists\")\n\t$str = preg_replace($noexists_pattern, '$1', $str);\n\n\tif ($all) {\n\t\t// All other HTML tags\n\t\treturn preg_replace('#<[^>]+>#', '', $str);\n\t} else {\n\t\t// All other anchor-tags only\n\t\treturn preg_replace('#<a[^>]+>|</a>#i', '', $str);\n\t}\n}", "public static function stripHtml($string)\n {\n $strippedCss = preg_replace('/<style.*<\\/style>/s', '', $string);\n $strippedJs = preg_replace('/<script.*<\\/script>/s', '', $strippedCss);\n $removedOneLineTags = preg_replace(\"/<[^>\\n]*>/mu\", '', $strippedJs);\n $removedMultiLineTags = preg_replace(\"/<a [^>]*?>/s\", '', $removedOneLineTags);\n return $removedMultiLineTags;\n }", "function wp_strip_all_tags($text, $remove_breaks = \\false)\n {\n }", "function _cut_html($str) {\n $str=preg_replace(\"'<[\\/\\!]*?[^<>]*?>'si\",\"\",$str);\n return $str;\n }", "function filterHTMLTags( $text )\n{\n $text = preg_replace(\n array(\n // Remove invisible content\n '@<head[^>]*?>.*?</head>@siu',\n '@<style[^>]*?>.*?</style>@siu',\n '@<script[^>]*?.*?</script>@siu',\n '@<object[^>]*?.*?</object>@siu',\n '@<embed[^>]*?.*?</embed>@siu',\n '@<applet[^>]*?.*?</applet>@siu',\n '@<noframes[^>]*?.*?</noframes>@siu',\n '@<noscript[^>]*?.*?</noscript>@siu',\n '@<noembed[^>]*?.*?</noembed>@siu',\n // Add line breaks before and after blocks\n '@</?((address)|(blockquote)|(center)|(del))@iu',\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n '@</?((table)|(th)|(td)|(caption))@iu',\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n '@</?((frameset)|(frame)|(iframe))@iu',\n ),\n array(\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n \"\\n\\$0\", \"\\n\\$0\",\n ),\n $text );\n return strip_tags( $text );\n}", "public static function removeHtml($s)\n {\n $newLinesAfter = 'h1|h2|h3|h4|h5|h6|h7|h8';\n $newLineAfter = 'caption|div|li|p|tr';\n $removeContent = 'script|style|noframes|select|option|link';\n $spaceAfter = 'td|th';\n\n /**///prep the string\n $s = ' ' . preg_replace(\"/[\\\\r\\\\n]+/\", '', $s);\n\n //begin removal\n /**///remove comment blocks\n while(stripos($s,'<!--') > 0){\n $pos[1] = stripos($s,'<!--');\n $pos[2] = stripos($s,'-->', $pos[1]);\n $len[1] = $pos[2] - $pos[1] + 3;\n $x = substr($s,$pos[1],$len[1]);\n $s = str_replace($x,'',$s);\n }\n\n /**///remove tags with content between them\n if(strlen($removeContent) > 0){\n $e = explode('|', $removeContent);\n for($i=0;$i<count($e);$i++){\n while(stripos($s,'<' . $e[$i]) > 0){\n $len[1] = strlen('<' . $e[$i]);\n $pos[1] = stripos($s,'<' . $e[$i]);\n $pos[2] = stripos($s,$e[$i] . '>', $pos[1] + $len[1]);\n $len[2] = $pos[2] - $pos[1] + $len[1];\n $x = substr($s,$pos[1],$len[2]);\n $s = str_replace($x,'',$s);\n }\n }\n }\n\n foreach (explode('|', $newLinesAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \"\\n\\n\", $s);\n }\n foreach (explode('|', $newLineAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \"\\n\", $s);\n }\n foreach (explode('|', $spaceAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \" \", $s);\n }\n\n /**///remove remaining tags\n $start = 0;\n while(stripos($s,'<', $start) > 0){\n $pos[1] = stripos($s,'<', $start);\n $pos[2] = stripos($s,'>', $pos[1]);\n if (!$pos[2]) {\n //No closing tag! Skip this one\n $start = $pos[1]+1;\n } else {\n $len[1] = $pos[2] - $pos[1] + 1;\n $x = substr($s,$pos[1],$len[1]);\n $s = str_replace($x,'',$s);\n }\n }\n\n if (PHP_EOL != \"\\n\") {\n $s = str_replace(\"\\n\", PHP_EOL, $s);\n }\n return html_entity_decode(trim($s), ENT_QUOTES, 'cp1252');\n }", "function strip_html_tags( $text )\n{\n\t// PHP's strip_tags() function will remove tags, but it\n\t// doesn't remove scripts, styles, and other unwanted\n\t// invisible text between tags. Also, as a prelude to\n\t// tokenizing the text, we need to insure that when\n\t// block-level tags (such as <p> or <div>) are removed,\n\t// neighboring words aren't joined.\n\t$text = preg_replace(\n\t\t\tarray(\n\t\t\t\t\t// Remove invisible content\n\t\t\t\t\t'@<head[^>]*?>.*?</head>@siu',\n\t\t\t\t\t'@<style[^>]*?>.*?</style>@siu',\n\t\t\t\t\t'@<script[^>]*?.*?</script>@siu',\n\t\t\t\t\t'@<object[^>]*?.*?</object>@siu',\n\t\t\t\t\t'@<embed[^>]*?.*?</embed>@siu',\n\t\t\t\t\t'@<applet[^>]*?.*?</applet>@siu',\n\t\t\t\t\t'@<noframes[^>]*?.*?</noframes>@siu',\n\t\t\t\t\t'@<noscript[^>]*?.*?</noscript>@siu',\n\t\t\t\t\t'@<noembed[^>]*?.*?</noembed>@siu',\n\t\t\t\t\t/*'@<input[^>]*?>@siu',*/\n\t\t\t\t\t'@<form[^>]*?.*?</form>@siu',\n\n\t\t\t\t\t// Add line breaks before & after blocks\n\t\t\t\t\t'@<((br)|(hr))>@iu',\n\t\t\t\t\t'@</?((address)|(blockquote)|(center)|(del))@iu',\n\t\t\t\t\t'@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n\t\t\t\t\t'@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n\t\t\t\t\t'@</?((table)|(th)|(td)|(caption))@iu',\n\t\t\t\t\t'@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n\t\t\t\t\t'@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n\t\t\t\t\t'@</?((frameset)|(frame)|(iframe))@iu',\n\t),\n\tarray(\n\t\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \",\n\t\" \", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n\t\"\\n\\$0\", \"\\n\\$0\",\n\t),\n\t$text );\n\n\t// remove empty lines\n\t$text = preg_replace(\"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\", \"\\n\", $text);\n\t// remove leading spaces\n\t$text = preg_replace(\"/\\n( )*/\", \"\\n\", $text);\n\n\t// Remove all remaining tags and comments and return.\n\treturn strip_tags( $text );\n}", "function strip_only(&$str, $tags)\n{\n\tif(isset($str) && is_array($str))\n\t\treturn $str;\n if(!is_array($tags))\n\t{\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n\n\t$size = sizeof($tags);\n\t$keys = array_keys($tags);\n\tfor ($i=0; $i<$size; $i++)\n\t{\n\t\t$tag = $tags[$keys[$i]];\n\t\tif(isset($tag) && is_array($tag))\n\t\t\t$str = strip_only($str, $tag);\n\t\telse\n\t\t{\n\t\t\tif(stripos($str, $tag) !== false)\n\t\t\t\t$str = preg_replace('#</?'.$tag.'[^>]*>#is', '', $str);\n\t\t}\n\t}\n\treturn $str;\n}", "function sacar_html($str) {\r\n$allowed = \"<br>,<b>,<i>,<u>\";\r\nreturn strip_tags($str,$allowed);\r\n}", "public static function remove_html(string $str, string $allowable_tags = ''): string\n {\n return \\strip_tags($str, $allowable_tags);\n }", "public static function removeHtml($string)\n\t{\n\t\t$string=trim($string);\n\t\t$string= html_entity_decode($string);\n\t\t$string=strip_tags($string);\n\n\t\treturn $string;\n\t}", "protected function cleanHtml($html) {\n $chain = new Zend_Filter();\n\n if($this->isFilterTags){\n $chain->addFilter(new Zend_Filter_StripTags(self::$tags));\n }\n $chain->addFilter(new Zend_Filter_StringTrim());\n\n $html = $chain->filter($html);\n\n $tmp = $html;\n while (1) {\n // Try and replace an occurrence of javascript:\n $html = preg_replace('/(<[^>]*)javascript:([^>]*>)/i', '$1$2', $html);\n \n\n // If nothing changed this iteration then break the loop\n if ($html == $tmp)\n break;\n\n $tmp = $html;\n }\n\n return $html;\n }", "function plugins_strip_tags($string) {\n\treturn strip_tags($string, '<p><strong><em><span><ul><li><ol><blockquote>');\n}", "function strip_all_tags($content)\n{\n\t$content = preg_replace('/\\n/',' ',$content);\n\t$content = preg_replace('/<script.*<\\/script>/U',' ',$content);\n\t$content = preg_replace('/<style.*<\\/style>/U',' ',$content);\n\t$content = strip_tags($content);\n\treturn $content;\n}", "function strip_tags_content($text, $tags = '', $invert = false)\n{\n //removes <br> often found in google result text, which is not handled below\n $text = str_ireplace('<br>', '', $text);\n \n preg_match_all('/<(.+?)[\\s]*\\/?[\\s]*>/si', trim($tags), $tags);\n $tags = array_unique($tags[1]);\n \n if (is_array($tags) and count($tags) > 0) {\n //if invert is false, it will remove all tags except those passed a\n if ($invert == false) {\n return preg_replace('@<(?!(?:'. implode('|', $tags) .')\\b)(\\w+)\\b.*?>.*?</\\1>@si', '', $text);\n //if invert is true, it will remove only the tags passed to this function\n } else {\n return preg_replace('@<('. implode('|', $tags) .')\\b.*?>.*?</\\1>@si', '', $text);\n }\n //if no tags were passed to this function, simply remove all the tags\n } elseif ($invert == false) {\n return preg_replace('@<(\\w+)\\b.*?>.*?</\\1>@si', '', $text);\n }\n \n return $text;\n}", "function clean_html($html)\r\n{\r\n\t$html = preg_replace('/<script\\b[^>]*>(.*?)<\\/script>/is', \"\", $html);\r\n\t$html = preg_replace('/<style\\b[^>]*>(.*?)<\\/style>/is', \"\", $html);\r\n\t$html = preg_replace('/<link \\b[^>]*>(.*?)/is', \"\", $html);\r\n\r\n\treturn $html;\r\n}", "public function removeHTML($text){\n $text = html_entity_decode($text);\n\n\n // Alle Tags entfernen\n $text = strip_tags($text);\n\n $text = str_replace(\"&lt;br&gt;\", \"\", $text);\n $text = str_replace(\"&amp;lt;br&amp;gt;\", \"\", $text);\n\n\n return $text;\n }", "function strip_all($str) {\n return safehtml(strip_tags($str));\n}", "public static function cleanTagsWithoutAttributes(array $tags, string $html): string {\n\t\t$empty_tags = implode('|', ArrayTools::preg_quote($tags, '|'));\n\t\treturn preg_replace('|<(' . $empty_tags . ')>([^<>]*)</\\1>|i', '$2', $html);\n\t}", "public static function removeHTML(string $string): string\n {\n return html_entity_decode(strip_tags($string), ENT_QUOTES | ENT_HTML5, 'utf-8');\n }", "protected function stripHtmlTags($text)\n {\n $text = preg_replace(\n [\n // Remove invisible content\n /** @lang php */\n '@<head[^>]*?>.*?</head>@siu',\n /** @lang php */\n '@<style[^>]*?>.*?</style>@siu',\n /** @lang php */\n '@<script[^>]*?.*?</script>@siu',\n /** @lang php */\n '@<object[^>]*?.*?</object>@siu',\n /** @lang php */\n '@<embed[^>]*?.*?</embed>@siu',\n /** @lang php */\n '@<applet[^>]*?.*?</applet>@siu',\n /** @lang php */\n '@<noframes[^>]*?.*?</noframes>@siu',\n /** @lang php */\n '@<noscript[^>]*?.*?</noscript>@siu',\n /** @lang php */\n '@<noembed[^>]*?.*?</noembed>@siu',\n // Add line breaks before and after blocks\n '@</?((address)|(blockquote)|(center)|(del))@iu',\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n '@</?((table)|(th)|(td)|(caption))@iu',\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n '@</?((frameset)|(frame)|(iframe))@iu',\n ],\n [\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n \"\\n\\$0\", \"\\n\\$0\",\n ],\n $text\n );\n\n return strip_tags($text);\n }", "function htmlButTags($str) {\n\t$caracteres = get_html_translation_table(HTML_ENTITIES);\n\t// Find out the \"tags\" entities\n\t$remover = get_html_translation_table(HTML_SPECIALCHARS);\n\t// Spit out the tags entities from the original table\n\t$caracteres = array_diff($caracteres, $remover);\n\t// Translate the string....\n\t$str = strtr($str, $caracteres);\n\t\n\t// now amps\n\t$str = preg_replace(\"/&(?![A-Za-z]{0,4}\\w{2,3};|#[0-9]{2,3};)/\",\"&amp;\" , $str);\n\t\n\treturn $str;\n}", "function strip_html_tags( $text )\r\n{\r\n $text = preg_replace(\r\n array(\r\n // Remove invisible content\r\n '@<head[^>]*?>.*?</head>@siu',\r\n '@<style[^>]*?>.*?</style>@siu',\r\n '@<script[^>]*?.*?</script>@siu',\r\n '@<object[^>]*?.*?</object>@siu',\r\n '@<embed[^>]*?.*?</embed>@siu',\r\n '@<applet[^>]*?.*?</applet>@siu',\r\n '@<noframes[^>]*?.*?</noframes>@siu',\r\n '@<noscript[^>]*?.*?</noscript>@siu',\r\n '@<noembed[^>]*?.*?</noembed>@siu',\r\n // Add line breaks before and after blocks\r\n '@</?((address)|(blockquote)|(center)|(del))@iu',\r\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\r\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\r\n '@</?((table)|(th)|(td)|(caption))@iu',\r\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\r\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\r\n '@</?((frameset)|(frame)|(iframe))@iu',\r\n ),\r\n array(\r\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\r\n $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\",\r\n $nl.\"\\$0\", $nl.\"\\$0\",\r\n ),\r\n $text );\r\n return strip_tags( $text );\r\n}", "function stringStripTags ($string) {\n $string = preg_replace(\"/<del[^>]*>.+<\\/del[^>]*>/isU\", '', $string);\n $string = preg_replace(\"/<script[^>]*>.+<\\/script[^>]*>/isU\", '', $string);\n $string = preg_replace(\"/<style[^>]*>.+<\\/style[^>]*>/isU\", '', $string);\n $string = str_replace('>', '> ', $string);\n $string = str_replace('<', ' <', $string);\n $string = strip_tags($string);\n $string = preg_replace(\"/\\s+/\", \" \", $string);\n $string = trim($string);\n return $string;\n}", "function removePartialTags($string) {\r\n\t\t$pos_close = strpos($string, \">\");\r\n\t\tif($pos_close != false) {\r\n\t\t\t$string = substr($string, $pos_close + 1);\r\n\t\t}\r\n\t\t$pos_open = strpos($string, \"<\");\r\n\t\tif($pos_open != false) {\r\n\t\t\t$string = substr($string, 0, $pos_open);\r\n\t\t}\r\n\t\t//print('removePartialTags cleaned string: ' . $string);\r\n\t\treturn $string;\r\n\t}", "function mc_strip_tags() {\n\n\treturn apply_filters( 'mc_strip_tags', '<strong><em><i><b><span><br><a>' );\n}", "protected function strip_tags($string ){\n\t\treturn preg_replace('~\\s+~',' ',strip_tags($string));\n\t}", "protected function cleanHTML(string $html) : string\n {\n // $html = str_replace(\"\\n\", '', $html);\n for($i = 0; $i < 3; $i++) {\n $html = str_replace($this->prefixHTML, '', $html);\n $html = str_replace($this->postfixHTML, '', $html);\n $html = str_replace('<?xml version=\"1.0\" standalone=\"yes\"?>', '', $html);\n //remove white space\n $html = preg_replace('/\\s+/', ' ', $html);\n // $html = str_replace('> <', '><', $html);\n }\n\n return $html;\n }", "function non_DOM_deleteme($opening_tag_string) {\r\n\t\tpreg_match_all('/' . $opening_tag_string . '/is', $this->code, $matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\tpreg_match('/<(\\w+)/is', $matches[0][$size][0], $tagname_matches);\r\n\t\t\t$tagname = $tagname_matches[1];\r\n\t\t\t$OString = OM::getOString($this->code, '<' . $tagname, '</' . $tagname . '>', $matches[0][$size][1]);\r\n\t\t\t$this->code = substr($this->code, 0, $matches[0][$size][1]) . substr($this->code, $matches[0][$size][1] + strlen($OString));\r\n\t\t\t$size--;\r\n\t\t}\r\n\t}", "function remove_non_rss(string $html): string\n{\n $html = preg_replace('%<script.*?>.*?</script>%is', '', $html);\n $html = preg_replace('%<a href=\"#.*?>(.*?)</a>%is', '$1', $html);\n $html = preg_replace('%<a href=\"javascript.*?>(.*?)</a>%is', '$1', $html);\n return $html;\n}", "private static function removeUnallowedHTMLTags(string $html, array $allowedTags): string\n {\n $allowedTagsStr = '<'.implode('><', $allowedTags).'>';\n\n return strip_tags($html, $allowedTagsStr);\n }", "function remove_tags_intra_tags() {\r\n\t\t$ct_intra_tags = 0;\r\n\t\t$ct2 = -1;\r\n\t\twhile($ct2 != 0) {\r\n\t\t\t/*preg_match_all('/(<[^>]*)<[^<>]+?>/is', $this->code, $debug_matches);\r\n\t\t\tprint('$debug_matches: ');var_dump($debug_matches);*/\r\n\t\t\t$this->code = preg_replace('/(<(![^\\-][^<>]+|[^!<>]+))<[^<>]+?>/is', '$1', $this->code, -1, $ct2); // changed (2012-01-25)\r\n\t\t\t$ct_intra_tags += $ct2;\r\n\t\t}\r\n\t\t$this->logMsgIf(\"tags intra tags removed\", $ct_intra_tags);\r\n\t\t// we must also ignore the <head>!\r\n\t\t// the only tag that has content in the head that I can think of is <title>, so:\r\n\t\tpreg_match_all('/<title>(.*?)<\\/title>/is', $this->code, $title_matches);\r\n\t\tif(sizeof($title_matches[0]) > 1) {\r\n\t\t\tprint(\"Well, that's not good; found more than one (\" . sizeof($title_matches[0]) . \") &lt;title&gt; tags on this page!\");exit(0);\r\n\t\t}\r\n\t\tif(sizeof($title_matches[0]) === 0) {\r\n\t\t\t// nothing to do\r\n\t\t} else {\r\n\t\t\t$ct_title = 0;\r\n\t\t\t$initial_title_string = $title_string = $title_matches[0][0];\r\n\t\t\t$ct1 = -1;\r\n\t\t\r\n\t\t\twhile($ct1 != 0) {\r\n\t\t\t\t$title_string = preg_replace('/<title>(.*?)<[^<>]+?>(.*?)<\\/title>/is', '<title>$1$2</title>', $title_string, -1, $ct1);\r\n\t\t\t\t$ct_title += $ct1;\r\n\t\t\t}\r\n\t\t\t$this->code = str_replace($initial_title_string, $title_string, $this->code);\r\n\t\t}\r\n\t\t$this->logMsgIf(\"tags removed from title tag\", $ct_title);\r\n\t\t// this should only happen if something exists in both the acronyms and abbr files (erroneously) or if\r\n\t\t// an bbreviation is a substring of another abbreviation but we'll still clean it up\r\n\t\t//$this->code = preg_replace('/<(abbr|acronym) title=\"([^\"]*?)\"><(abbr|acronym) title=\"([^\"]*?)\">(.*?)<\\/(abbr|acronym)><\\/(abbr|acronym)>/is', '<$1 title=\"$2\">$4</$5>', $this->code, -1, $ct_redundant_acro);\r\n\t\t$ct_redundant_acro = 0;\r\n\t\t$array_tags = array('abbr', 'acronym');\r\n\t\t$tagNamesString = implode('|', $array_tags);\r\n\t\tforeach($array_tags as $tagName) {\r\n\t\t\t$OStrings = OM::getAllOStrings($this->code, '<' . $tagName, '</' . $tagName . '>');\r\n\t\t\t//var_dump($OStrings);exit(0);\r\n\t\t\t$counter = sizeof($OStrings) - 1;\r\n\t\t\twhile($counter >= 0) {\r\n\t\t\t\t$OString = $OStrings[$counter][0];\r\n\t\t\t\t$opening_tag = substr($OString, 0, strpos($OString, '>') + 1);\r\n\t\t\t\t$closing_tag = substr($OString, ReTidy::strpos_last($OString, '<'));\r\n\t\t\t\t$code_to_clean = substr($OString, strlen($opening_tag), strlen($OString) - strlen($opening_tag) - strlen($closing_tag));\r\n\t\t\t\t$needs_to_be_cleaned = false;\r\n\t\t\t\tforeach($array_tags as $tagName2) {\r\n\t\t\t\t\tif(strpos($code_to_clean, '<' . $tagName2) !== false) {\r\n\t\t\t\t\t\t$needs_to_be_cleaned = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif($needs_to_be_cleaned) {\r\n\t\t\t\t\t$offset = $OStrings[$counter][1];\r\n\t\t\t\t\t$code_to_clean = preg_replace('/<(' . $tagNamesString . ')[^<>]*?>/is', '', $code_to_clean);\r\n\t\t\t\t\t$code_to_clean = preg_replace('/<\\/(' . $tagNamesString . ')>/is', '', $code_to_clean);\r\n\t\t\t\t\t$new_OString = $opening_tag . $code_to_clean . $closing_tag;\r\n\t\t\t\t\t$this->code = substr($this->code, 0, $offset) . $new_OString . substr($this->code, $offset + strlen($OString));\r\n\t\t\t\t\t$ct_redundant_acro += 1;\r\n\t\t\t\t}\r\n\t\t\t\t$counter--;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->logMsgIf(\"redundant acronyms applications removed\", $ct_redundant_acro);\r\n\t}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "function string_restore_valid_html_tags( $p_string, $p_multiline = true ) \r\n{\r\n\t$t_html_valid_tags = config_get( $p_multiline ? 'html_valid_tags' : 'html_valid_tags_single_line' );\r\n\r\n\tif ( OFF === $t_html_valid_tags || is_blank( $t_html_valid_tags ) ) {\r\n\t\treturn $p_string;\r\n\t}\r\n\r\n\t$tags = explode( ',', $t_html_valid_tags );\r\n\tforeach ($tags as $key => $value) \r\n\t{ \r\n \tif ( !is_blank( $value ) ) {\r\n \t$tags[$key] = trim($value); \r\n }\r\n }\r\n $tags = implode( '|', $tags);\r\n\r\n\t$p_string = preg_replace( '/&lt;(' . $tags . ')\\s*&gt;/ui', '<\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/&lt;\\/(' . $tags . ')\\s*&gt;/ui', '</\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/&lt;(' . $tags . ')\\s*\\/&gt;/ui', '<\\\\1 />', $p_string );\r\n\r\n\r\n\treturn $p_string;\r\n}", "public static function stripHtml($string) {\n $string = strip_tags($string);\n $string = htmlspecialchars($string);\n return $string;\n }", "function non_DOM_stripme($opening_tag_string) {\r\n\t\tpreg_match_all('/' . $opening_tag_string . '/is', $this->code, $matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\t//print(\"matches[0][size][0]: \");var_dump($matches[0][$size][0]);\r\n\t\t\tpreg_match('/<(\\w+)/is', $matches[0][$size][0], $tagname_matches);\r\n\t\t\t$tagname = $tagname_matches[1];\r\n\t\t\t$OString = OM::getOString($this->code, '<' . $tagname, '</' . $tagname . '>', $matches[0][$size][1]);\r\n\t\t\t//print(\"strlen(matches[0][size][0]): \");var_dump(strlen($matches[0][$size][0]));\r\n\t\t\t$substr = substr($OString, strlen($matches[0][$size][0]), strlen($OString) - strlen($matches[0][$size][0]) - (strlen($tagname) + 3));\r\n\t\t\t//print(\"OString: \");var_dump($OString);\r\n\t\t\t//print(\"substr: \");var_dump($substr);\r\n\t\t\t//$this->code = str_replace($OString, $substr, $this->code);\r\n\t\t\t$this->code = substr($this->code, 0, $matches[0][$size][1]) . $substr . substr($this->code, $matches[0][$size][1] + strlen($OString));\r\n\t\t\t$size--;\r\n\t\t}\r\n\t}", "private static function removeUnallowedHTMLAttributes(string $html): string\n {\n $tidy = new tidy();\n\n $dom = new DOMDocument();\n\n // Normalizes the HTML which reduce the possibility of having an unexpected\n // exception in the DomDocument library because some bad HTML was found.\n // Once the HTML is normalized, we will parse it again.\n $html = $tidy->repairString($html, [\n 'output-xhtml' => true,\n 'show-body-only' => true,\n ], 'utf8');\n\n try {\n libxml_use_internal_errors(true);\n // Needs a XML encoding declaration to ensure is treated as UTF-8\n $dom->loadHTML('<?xml encoding=\"utf-8\" ?>'.$html);\n } catch (Exception $e) {\n return '';\n }\n\n $attributes = static::getAttributesNodes($dom);\n\n collect($attributes)\n ->filter(fn ($attribute) => static::isAttributeAllowedForTag($attribute))\n ->each(fn ($node) => $node->parentNode->removeAttribute($node->nodeName));\n\n return $tidy->repairString($dom->saveHTML(), [\n 'output-xhtml' => true,\n 'show-body-only' => true,\n ], 'utf8');\n }", "function removecomments_html($string) {\n\n //strpos of the opening tag\n $start_position = 0;\n\n //number of tags \"deep\" we are\n $current_count = 0;\n\n //go through the string and remove the tags:\n for ( $p = 0; $p < strlen($string); $p++ ) {\n //find opening tags\n if ( $string[$p] == \"<\" && $string[$p+1] == \"!\"\n && $string[$p+2] == \"-\" && $string[$p+3] == \"-\" )\n {\n $current_count++;\n if ( $current_count == 1 )\n {\n $start_position = $p;\n }\n }\n //find closing tags if applicable.\n if ( $current_count > 0 && $string[$p] == \"-\"\n && $string[$p+1] == \"-\" && $string[$p+2] == \">\")\n {\n $current_count--;\n if ( $current_count == 0 )\n {\n $p = $p + 3;\n $string = substr($string, 0, $start_position) . substr($string, $p);\n $start_position = 0;\n $p = 0;\n }\n }\n }\n\n //handle any uneven tags at the end.\n return substr($string, 0, (strpos($string, \"<!--\") == 0 ? strlen($string) : strpos($string, \"<!--\"))) . \"\\n\";\n }", "public abstract function cleanHTML($content);", "function real_strip_tags($str, $allowable_tags = \"\")\n{\n return strip_tags($str, $allowable_tags);\n}", "function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}", "public function removeAllTags() {}", "function cleanup($html, $options = null) \n { \n if(isset($options) && is_array($options)){ \n $this->setOptions($options); \n } \n $this->_html = \"{$html}\"; \n\n if($this->_options['UseTidy'] && $this->_options['TidyBefore']){ \n $this->tidyClean(); \n } \n\n // Remove escape slashes \n $this->_html = stripslashes($this -> _html); \n\n if($this->_options['CleaningMethod']['tags'] == \"whitelist\"){ \n // Trim everything before body tag, leaving possible body attributes \n if(preg_match(\"/<body/i\", \"{$this -> _html}\")){ \n $this -> html = stristr($this -> _html, \"<body\"); \n } \n\n // strip tags, still leaving attributes, second variable is allowed tags \n $this->_html = strip_tags($this->_html, $this->_tag_whitelist); \n } \n\n if($this->_options['RemoveStyles']){ \n // Remove class and style attributes \n $this->removeBlacklistedAttributes(\"class|style\"); \n } \n\n if($this->_options['IsWord']){ \n $this->removeBlacklistedAttributes(\"lang|[ovwxp]:\\w+\"); \n } \n\n if($this->_options['CleaningMethod']['attributes'] == \"blacklist\"){ \n if(!empty ($this->_attrib_blacklist)){ \n $this->removeBlacklistedAttributes($this->_attrib_blacklist); \n } \n } \n\n if($this->_options['Optimize']){ \n $repl = 1; \n while($repl){ \n $repl = 0; \n foreach($this->_cleanup_tags as $tag){ \n // Strip empty inline tags \n $this -> _html = preg_replace(\"/<($tag)[^>]*>[\\s]*([(&nbsp;)]*)[\\s]*<\\/($tag)>/i\",\"\\\\2\", $this -> _html,-1,$count); \n $repl += $count; \n\n // Merge inline tags \n $this -> _html = preg_replace(\"/<\\/($tag)[^>]*>[\\s]*([(&nbsp;)]*)[\\s]*<($tag)>/i\",\"\\\\2\", $this -> _html,-1,$count); \n $repl += $count; \n } \n } \n\n // Drop empty paragraph tags \n if($this->_options['DropEmptyParas']){ \n $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\\s]*[(&nbsp;)]*[\\s]*<\\/(p|h[1-6]{1})>/i',\"\\r\\n\", $this -> _html); \n } \n\n // Trim extra spaces only if tidy is not set to indent \n if(!$this->_tidy_config['indent']){ \n // Trim extra spaces between words \n $this -> _html = preg_replace('/([^<>])[\\s]+([^<>])/i',\"\\\\1 \\\\2\", $this -> _html); \n\n // Trim extra spaces before tags \n $this -> _html = preg_replace('/[\\n|\\r|\\r\\n|][\\n|\\r|\\r\\n|]+</i',\"<\", $this -> _html); \n } \n } \n\n if($this->_options['DropEmptyParas'] && !$this->_options['Optimize']){ \n $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\\s]*[(&nbsp;)]*[\\s]*<\\/(p|h[1-6]{1})>/i',\"\\r\\n\", $this -> _html); \n } \n\n if($this->_options['FillEmptyTableCells']) { \n $this -> _html = preg_replace(\"/<td([^>]*)>[\\s]*<\\/td>/i\", \"<td\\\\1>&nbsp;</td>\", $this -> _html); \n } \n\n if($this->_options['Compress']){ \n // Trim spaces after tags \n $this -> _html = preg_replace('/>[\\s]+/',\">\", $this -> _html); \n\n // Trim spaces before end tags \n $this -> _html = preg_replace('/[\\s]+<\\//',\"</\", $this -> _html); \n\n // Trim spaces before tags \n $this -> _html = preg_replace('/[\\s]+</',\"<\", $this -> _html); \n\n // Trim extra spaces between words \n $this -> _html = preg_replace('/([^<>])[\\s]+([^<>])/',\"\\\\1 \\\\2\", $this -> _html); \n } \n\n if($this->_options['UseTidy'] && !$this->_options['TidyBefore']){ \n $this->tidyClean(); \n } \n return $this->output(\"{$this->_html}\"); \n }", "private function wpus_strip_tags($string, $remove_breaks = FALSE) {\n\t\t\t$string = preg_replace('/[\\r\\n\\t ]+/', ' ', $string);\n\n\t\t\t$string = preg_replace('@<(script|style)[^>]*?>.*?</\\\\1>@si', '', $string);\n\n\t\t\t$string = preg_replace('@ *</?\\s*(P|UL|OL|DL|BLOCKQUOTE)\\b[^>]*?> *@si', \"\\n\\n\", $string);\n\t\t\t$string = preg_replace('@ *<(BR|DIV|LI|DT|DD|TR|TD|H\\d)\\b[^>]*?> *@si', \"\\n\", $string);\n\t\t\t$string = preg_replace(\"@\\n\\n\\n+@si\", \"\\n\\n\", $string);\n\n\t\t\t$string = strip_tags($string);\n\n\t\t\tif($remove_breaks) {\n\t\t\t\t$string = preg_replace('/[\\r\\n\\t ]+/', ' ', $string);\n\t\t\t}\n\n\t\t\t// ...since we're pulling excerpts from the DB, some of the excerpts contain truncated HTML tags\n\t\t\t// that won't be picked up by strip_tags(). This removes any trailing HTML from the beginning\n\t\t\t// and end of the excerpt:\n\t\t\t$string = preg_replace('/.*>|<.*/', ' ', $string);\n\n\t\t\treturn trim($string);\n\t\t}", "function html5_style_remove( $tag ) {\n return preg_replace( '~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag );\n}", "private static function remove_between_tags($y_html) {\n\t//--\n\treturn @preg_replace(\"'\".self::tag_remove_start().\".*?\".self::tag_remove_end().\"'si\", '&nbsp;', (string)$y_html); // insensitive\n\t//--\n}", "function strip_selected_article_tags($str, $tags = \"\", $stripContent = false)\n\t{\n\t\t$tags = \"<script>\";\n\t\treturn strip_selected_tags($str, $tags, $stripContent);\n\t}", "public static function strip_html($text) {\n $search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\\\s\\\\S]*?--[ \\\\t\\\\n\\\\r]*>@', // Strip multi-line comments including CDATA\n '@<[\\\\/\\\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@&nbsp;@', // Strip space\n '@\\s+@', // change wrap or break space\n );\n $text = preg_replace($search, ' ', $text);\n $text = strip_tags($text);\n $text = trim($text);\n return $text;\n }", "function untag($string, $tag) {\n\t$tmpval = array();\n\t$preg = \"|<$tag>(.*?)</$tag>|s\";\n\n\tpreg_match_all($preg, $string, $tags);\n\tforeach ($tags[1] as $tmpcont){\n\t\t$tmpval[] = $tmpcont;\n\t}\n\treturn $tmpval;\n}", "function mc_admin_strip_tags() {\n\n\treturn '<strong><em><i><b><span><a><code><pre>';\n}", "public function html_remove_shortcodes($html)\n {\n return preg_replace_callback('/\\[[^\\]]*\\]/', function ($match) {\n if (preg_match('/^\\[(image|sitetree\\_link,id|file\\_link,id)\\b/', $match[0])) {\n return $match[0];\n }\n return '';\n }, $html);\n }", "function noTag($temp){\n\t$data\t= strip_tags($temp, \"<img \");\n\t$data\t= strip_tags($temp, \"<table \");\n\t$data\t= strip_tags($temp, \"<font \");\n\t$data\t= strip_tags($temp, \"<span \");\t\n\t$data\t= strip_tags($temp, \"<p \");\t\t\n\treturn $data;\n}", "public static function cleanHTML($string)\n {\n $cleaned = $string;\n $cleaned = str_replace('<', '&lt;', $cleaned);\n $cleaned = str_replace('>', '&gt;', $cleaned);\n\n return $cleaned;\n }", "function fix_tags($html) {\n $result = \"\";\n $tag_stack = array();\n\n // these corrections can simplify the regexp used to parse tags\n // remove whitespaces before '/' and between '/' and '>' in autoclosing tags\n $html = preg_replace(\"#\\s*/\\s*>#is\",\"/>\",$html);\n // remove whitespaces between '<', '/' and first tag letter in closing tags\n $html = preg_replace(\"#<\\s*/\\s*#is\",\"</\",$html);\n // remove whitespaces between '<' and first tag letter \n $html = preg_replace(\"#<\\s+#is\",\"<\",$html);\n\n while (preg_match(\"#(.*?)(<([a-z\\d]+)[^>]*/>|<([a-z\\d]+)[^>]*(?<!/)>|</([a-z\\d]+)[^>]*>)#is\",$html,$matches)) {\n $result .= $matches[1];\n $html = substr($html, strlen($matches[0]));\n\n // Closing tag \n if (isset($matches[5])) { \n $tag = $matches[5];\n\n if ($tag == $tag_stack[0]) {\n // Matched the last opening tag (normal state) \n // Just pop opening tag from the stack\n array_shift($tag_stack);\n $result .= $matches[2];\n } elseif (array_search($tag, $tag_stack)) { \n // We'll never should close 'table' tag such way, so let's check if any 'tables' found on the stack\n $no_critical_tags = !array_search('table',$tag_stack);\n if (!$no_critical_tags) {\n $no_critical_tags = (array_search('table',$tag_stack) >= array_search($tag, $tag_stack));\n };\n\n if ($no_critical_tags) {\n // Corresponding opening tag exist on the stack (somewhere deep)\n // Note that we can forget about 0 value returned by array_search, becaus it is handled by previous 'if'\n \n // Insert a set of closing tags for all non-matching tags\n $i = 0;\n while ($tag_stack[$i] != $tag) {\n $result .= \"</{$tag_stack[$i]}> \";\n $i++;\n }; \n \n // close current tag\n $result .= \"</{$tag_stack[$i]}> \";\n // remove it from the stack\n array_splice($tag_stack, $i, 1);\n // if this tag is not \"critical\", reopen \"run-off\" tags\n $no_reopen_tags = array(\"tr\",\"td\",\"table\",\"marquee\",\"body\",\"html\");\n if (array_search($tag, $no_reopen_tags) === false) {\n while ($i > 0) {\n $i--;\n $result .= \"<{$tag_stack[$i]}> \";\n }; \n } else {\n array_splice($tag_stack, 0, $i);\n };\n };\n } else {\n // No such tag found on the stack, just remove it (do nothing in out case, as we have to explicitly \n // add things to result\n };\n } elseif (isset($matches[4])) {\n // Opening tag\n $tag = $matches[4];\n array_unshift($tag_stack, $tag);\n $result .= $matches[2];\n } else {\n // Autoclosing tag; do nothing specific\n $result .= $matches[2];\n };\n };\n\n // Close all tags left\n while (count($tag_stack) > 0) {\n $tag = array_shift($tag_stack);\n $result .= \"</\".$tag.\">\";\n }\n\n return $result;\n}", "function html_strip_unsafe($strData)\n\t\t{\n\t\t // Unsafe HTML tags/attributes that members may abuse\n\t\t $arrData=array(\n\t\t //'/<iframe(.*?)<\\/iframe>/is',\n\t\t '/<title(.*?)<\\/title>/is',\n\t\t '/<pre(.*?)<\\/pre>/is',\n\t\t '/<frame(.*?)<\\/frame>/is',\n\t\t '/<frameset(.*?)<\\/frameset>/is',\n\t\t //'/<object(.*?)<\\/object>/is',\n\t\t '/<script(.*?)<\\/script>/is',\n\t\t //'/<embed(.*?)<\\/embed>/is',\n\t\t '/<applet(.*?)<\\/applet>/is',\n\t\t '/<meta(.*?)>/is',\n\t\t '/<!doctype(.*?)>/is',\n\t\t '/<link(.*?)>/is',\n\t\t '/<body(.*?)>/is',\n\t\t '/<\\/body>/is',\n\t\t '/<head(.*?)>/is',\n\t\t '/<\\/head>/is',\n\t\t '/onload=\"(.*?)\"/is',\n\t\t '/onunload=\"(.*?)\"/is',\n\t\t '/onerror=\"(.*?)\"/is',\n\t\t '/onclick=\"(.*?)\"/is',\n\t\t '/onchange=\"(.*?)\"/is',\n\t\t '/onmouseover=\"(.*?)\"/is',\n\t\t '/autofocus=\"(.*?)\"/is',\n\t\t '/onfocus=\"(.*?)\"/is',\n\t\t '/<html(.*?)>/is',\n\t\t '/<\\/html>/is',\n\t\t );\n\t\t $strData = preg_replace($arrData, \"\", $strData);\n\t\t\t$strData = filter_var($strData, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);\n\n\t\t return $strData;\n\t\t}", "function manhattan_remove_tags( $content ) {\r\n\t\t$tags = array(\r\n\t\t\t'<p>[' => '[',\r\n\t\t\t']</p>' => ']'\r\n\t\t);\r\n\t\t\r\n\t\treturn strtr( $content, $tags );\r\n\t}", "public static function ok_tags($html){\n \treturn self::closetags(strip_tags($html, \"<b><strong><i><em>\"));\n }", "private static function cleanHtml(string $html, array $allowedTags): string\n {\n $html = static::removeUnallowedHTMLTags($html, array_keys(static::$validUserTagsAndAttributes));\n\n $html = static::removeUnallowedHTMLAttributes($html);\n\n $html = static::removeUnallowedHTMLTags($html, $allowedTags);\n\n return $html;\n }", "function stripHTMLTags( $content ) {\r\n \r\n $search = array (\"'<script[^>]*?>.*?</script>'si\", // Strip out javascript\r\n \"'<\\s*br\\s*(\\/)?>'i\", // Replace brs to spaces\r\n \"'<[\\/\\!]*?[^<>]*?>'si\", // Strip out html tags\r\n \"'([\\r\\n])[\\s]+'\", // Strip out white space\r\n \"'&(quot|#34);'i\", // Replace html entities\r\n \"'&(amp|#38);'i\",\r\n \"'&(lt|#60);'i\",\r\n \"'&(gt|#62);'i\",\r\n \"'&(nbsp|#160);'i\",\r\n \"'&(iexcl|#161);'i\",\r\n \"'&(cent|#162);'i\",\r\n \"'&(pound|#163);'i\",\r\n \"'&(copy|#169);'i\",\r\n \"'&#(\\d+);'\");\r\n \r\n $replace = array (\"\",\r\n \" \",\r\n \"\",\r\n \"\\\\1\",\r\n \"\\\"\",\r\n \"&\",\r\n \"<\",\r\n \">\",\r\n \" \",\r\n chr(161),\r\n chr(162),\r\n chr(163),\r\n chr(169),\r\n \"chr(\\\\1)\");\r\n \r\n $content = preg_replace ($search, $replace, $content);\r\n \r\n return $content;\r\n}", "private static function clearHTML($html)\n {\n return preg_replace(array(\n '/\\s+/',\n '/[\\t\\n\\r]+/',\n '/<!--.*?-->/s',\n '/>\\s*</',\n '/;\\s*(\\\"|\\')/',\n '/<\\/\\s+/',\n '/\\s+\\/>/',\n '/<\\s+/',\n '/\\s+>/'\n ), array(\n ' ',\n ' ',\n '',\n '><',\n '${1}',\n '</',\n '/>',\n '<',\n '>'\n ), $html);\n }", "function wp_replace_in_html_tags($haystack, $replace_pairs)\n {\n }", "function fett_process_html_tag(&$vars) {\n if (theme_get_setting('fett_html_tags')) {\n $el = &$vars['element'];\n\n // Remove type=\"...\" and CDATA prefix/suffix.\n unset($el['#attributes']['type'], $el['#value_prefix'], $el['#value_suffix']);\n\n // Remove media=\"all\" but leave others unaffected.\n if (isset($el['#attributes']['media']) && $el['#attributes']['media'] === 'all') {\n unset($el['#attributes']['media']);\n }\n }\n}", "function regexcleanhtml($text){\n\t//get rid of unneeded spaces\n\t$text=regexspacecleaner($text);\n\t\n\t//lets get rid of weird spacing first so we can make simpler quearies later\n\t$regex_pattern=\"/<\\s/\"; //makes < followed by a space just < (e.g. slkj < slkj = slkj <slkj)\n\t$text = preg_replace($regex_pattern, \"<\", $text);\n\t$regex_pattern=\"/\\s>/\"; //makes > preceded by a space just > (e.g. slkj > slkj = slkj> slkj)\n\t$text = preg_replace($regex_pattern, \">\", $text);\n\t$regex_pattern=\"/<\\/\\s/\";\n\t$text = preg_replace($regex_pattern, \"</\", $text); //makes </ followed by a space just </ (e.g. slkj </ slkj = slkj </slkj)\n\t\n\treturn $text;\n}", "function stripcleantohtml($s) {\n\t// Also strips any <html> tags it may encouter\n\t// Use: Anything that shouldn't contain html (pretty much everything that is not a textarea)\n\treturn htmlentities(trim(strip_tags(stripslashes($s))), ENT_NOQUOTES, \"UTF-8\");\n}", "public static function trim_html($string = '')\n\t\t{\n\t\t\t$whitespace = '&nbsp;|\\<br\\>|\\<br\\s*\\/\\>|\\<p\\>(?:&nbsp;)*\\<\\/p\\>';\n\t\t\treturn preg_replace('/^(?:'.$whitespace.')+|(?:'.$whitespace.')+$/', '', (string)$string);\n\t\t}", "function ind_delete_extra_tags($content) {\n\t//Delete the chapters tags, because we don't need them\n\t$search = \"@(?:<p>)*\\s*\\[chapters\\]\\s*(?:</p>)*@i\";\n\t$content = preg_replace($search, '', $content);\n\t\n\t//Delete the chapters tags, because we don't need them\n\t$search = \"@(?:<p>)*\\s*\\[chapters\\s*:\\s*(\\d+)(||,left|,right)\\]\\s*(?:</p>)*@i\";\n\t$content = preg_replace($search, '', $content);\n\n\treturn $content;\n}", "function guy_strip_bad($str, $mode='') {\n global $guy_c;\n $html_allowed = array('a', 'b', 'i', 'p', 'ol', 'ul', 'li', 'blockquote', 'br', 'em', 'sup', 'sub');\n\t$html_allowed_regexp = join('|',$html_allowed);\n\t$html_allowed_striptags = '<'.join('><',$html_allowed).'>';\n\t$str = strip_tags($str,$html_allowed_striptags);\n\t$str = preg_replace_callback(\"/<($html_allowed_regexp)\\b(.*?)>/si\",'guy_attrcheck',$str);\n\t$str = preg_replace('/<\\/([^ \n>]+)[^>]*>/si',$guy_c['lt'].'/$1'.$guy_c['gt'],$str);\n\t$str = preg_replace('#^\\s+$#m','',$str);\n\t$str = safehtml($str);\n\treturn $str;\n}", "function stripRecursiveHTMLSection($string, $tag_name, $tag_start)\n{\n $open_tag = '<' . $tag_name;\n $close_tag = '</' . $tag_name . '>';\n $close_tag_length = strlen($close_tag);\n\n // Make sure the provided $tag_start argument matches the provided $tag_name argument\n if (strpos($tag_start, $open_tag) === 0) {\n // While tag_start is present, there is at least one remaining section to remove\n while (strpos($string, $tag_start) !== false) {\n // In order to locate the end of the section, we attempt each closing tag until we find the right one\n // We know we found the right one when the amount of \"<tag\" is the same as amount of \"</tag\"\n // When the attempted \"</tag\" is not the correct one, we increase $search_offset to skip it\n // and retry unless $max_recursion is reached (prevents infinite loop on malformed HTML)\n $max_recursion = 100;\n $section_to_remove = null;\n $section_start = strpos($string, $tag_start);\n $search_offset = $section_start;\n do {\n $max_recursion--;\n // Move on to the next occurrence of \"</tag\"\n $section_end = strpos($string, $close_tag, $search_offset);\n $search_offset = $section_end + $close_tag_length;\n // If the next \"</tag\" is the correct one, then this is the section we must remove:\n $section_to_remove = substr($string, $section_start, $section_end - $section_start + $close_tag_length);\n // Count amount of \"<tag\" and \"</tag\" in the section to remove\n $open_tag_count = substr_count($section_to_remove, $open_tag);\n $close_tag_count = substr_count($section_to_remove, $close_tag);\n } while ($open_tag_count > $close_tag_count && $max_recursion > 0);\n // We exited the loop, let's remove the section\n $string = str_replace($section_to_remove, '', $string);\n }\n }\n return $string;\n}", "public static function fixHtmlTag($html) {\n // Check for <html tag.\n $open = (stripos($html, '<html') === FALSE) ? '<html>' : '';\n $close = (stripos($html, '</html') === FALSE) ? '</html>' : '';\n $html = \"{$open}{$html}{$close}\";\n\n if (stripos($html, '<html') === FALSE) {\n // There is no starting tag so add it.\n $html = \"<html>{$html}\";\n }\n // Check for </html> tag.\n if (stripos($html, '</html') === FALSE) {\n // There is no closing tag so add it.\n $html = \"{$html}</html>\";\n }\n\n return $html;\n }", "function clean_evil_tags( $t )\n {\n \t$t = preg_replace( \"/javascript/i\" , \"j&#097;v&#097;script\", $t );\n\t\t$t = preg_replace( \"/alert/i\" , \"&#097;lert\" , $t );\n\t\t$t = preg_replace( \"/about:/i\" , \"&#097;bout:\" , $t );\n\t\t$t = preg_replace( \"/onmouseover/i\", \"&#111;nmouseover\" , $t );\n\t\t$t = preg_replace( \"/onclick/i\" , \"&#111;nclick\" , $t );\n\t\t$t = preg_replace( \"/onload/i\" , \"&#111;nload\" , $t );\n\t\t$t = preg_replace( \"/onsubmit/i\" , \"&#111;nsubmit\" , $t );\n\t\t$t = preg_replace( \"/<body/i\" , \"&lt;body\" , $t );\n\t\t$t = preg_replace( \"/<html/i\" , \"&lt;html\" , $t );\n\t\t$t = preg_replace( \"/document\\./i\" , \"&#100;ocument.\" , $t );\n\t\t\n\t\treturn $t;\n }", "private function htmlFix() {\n // First, check if html is allowed\n if (!$this->allow_html) {\n $html = false;\n } elseif ($this->standard_html) {\n $html = true;\n } else {\n $html = false;\n }\n\n $newParseArray = array();\n while ($tag = array_shift($this->parseArray)) {\n switch ($tag) {\n case self::TAG_NOHTML_OPEN:\n case self::TAG_HTML_CLOSE:\n $html = false;\n break;\n case self::TAG_HTML_OPEN:\n case self::TAG_NOHTML_CLOSE:\n if ($this->allow_html) {\n $html = true;\n }\n break;\n\n default:\n if ($html) {\n if ($tag == self::BR_TAG) {\n $tag = \"\\n\";\n } // Really, no BR's in html code is wanted.\n $newParseArray[] = $tag;\n } else {\n $newParseArray[] = htmlspecialchars($tag);\n }\n }\n }\n $this->parseArray = $newParseArray;\n return true;\n }", "function ks_style_remove( $tag ) {\n\treturn preg_replace( '~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag );\n}", "function gwt_drupal_process_html_tag(&$variables) {\n $tag = &$variables['element'];\n\n if ($tag['#tag'] == 'style' || $tag['#tag'] == 'script') {\n // Remove redundant type attribute and CDATA comments.\n unset($tag['#attributes']['type'], $tag['#value_prefix'], $tag['#value_suffix']);\n\n // Remove media=\"all\" but leave others unaffected.\n if (isset($tag['#attributes']['media']) && $tag['#attributes']['media'] === 'all') {\n unset($tag['#attributes']['media']);\n }\n }\n}", "function strip_word_doc( $html, $allowed_tags = '' )\n\t{\n\t\tmb_regex_encoding( 'UTF-8' );\n\n\t\t//replace MS special characters first\n\t\t$search = [\n\t\t\t'/&lsquo;/u',\n\t\t\t'/&rsquo;/u',\n\t\t\t'/&ldquo;/u',\n\t\t\t'/&rdquo;/u',\n\t\t\t'/&mdash;/u',\n\t\t];\n\t\t$replace = [\n\t\t\t'\\'',\n\t\t\t'\\'',\n\t\t\t'\"',\n\t\t\t'\"',\n\t\t\t'-',\n\t\t];\n\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t//make sure _all_ html entities are converted to the plain ascii equivalents - it appears\n\t\t//in some MS headers, some html entities are encoded and some aren't\n\t\t$html = html_entity_decode( $html, ENT_QUOTES, 'UTF-8' );\n\n\t\t//try to strip out any C style comments first, since these, embedded in html comments, seem to\n\t\t//prevent strip_tags from removing html comments (MS Word introduced combination)\n\t\tif ( mb_stripos( $html, '/*' ) !== FALSE )\n\t\t{\n\t\t\t$html = mb_eregi_replace( '#/\\*.*?\\*/#s', '', $html, 'm' );\n\t\t}\n\n\t\t//introduce a space into any arithmetic expressions that could be caught by strip_tags so that they won't be\n\t\t//'<1' becomes '< 1'(note: somewhat application specific)\n\t\t$html = preg_replace(\n\t\t\t[\n\t\t\t\t'/<([0-9]+)/',\n\t\t\t], [\n\t\t\t\t'< $1',\n\t\t\t], $html );\n\t\t$html = strip_tags( $html, $allowed_tags );\n\n\t\t//eliminate extraneous whitespace from start and end of line, or anywhere there are two or more spaces, convert it to one\n\t\t$html = preg_replace(\n\t\t\t[\n\t\t\t\t'/^\\s\\s+/',\n\t\t\t\t'/\\s\\s+$/',\n\t\t\t\t'/\\s\\s+/u',\n\t\t\t], [\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t' ',\n\t\t\t], $html );\n\n\t\t//strip out inline css and simplify style tags\n\t\t$search = [\n\t\t\t'#<(strong|b)[^>]*>(.*?)</(strong|b)>#isu',\n\t\t\t'#<(em|i)[^>]*>(.*?)</(em|i)>#isu',\n\t\t\t'#<u[^>]*>(.*?)</u>#isu',\n\t\t];\n\t\t$replace = [\n\t\t\t'<b>$2</b>',\n\t\t\t'<i>$2</i>',\n\t\t\t'<u>$1</u>',\n\t\t];\n\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t//on some of the ?newer MS Word exports, where you get conditionals of the form 'if gte mso 9', etc., it appears\n\t\t//that whatever is in one of the html comments prevents strip_tags from eradicating the html comment that contains\n\t\t//some MS Style Definitions - this last bit gets rid of any leftover comments */\n\t\t$num_matches = preg_match_all( \"/\\<!--/u\", $html, $matches );\n\t\tif ( $num_matches )\n\t\t{\n\t\t\t$html = preg_replace( '/\\<!--(.)*--\\>/isu', '', $html );\n\t\t}\n\n\t\treturn $html;\n\t}", "public static function strip_tags( $string ) {\n\t\t$string = wp_kses( $string, array() );\n\t\treturn str_replace( '&amp;', '&', $string ); // undo damage done by wp_kses_normalize_entities()\n\t}", "public static function strip_tag_string($str)\n\t{\n\t\t$str = strip_tags($str);\n\t\t$str = trim($str);\n\t\treturn $str;\n\t}", "public function stripSpecificTags($tags, $content)\n {\n foreach ($tags as $tag) {\n $content = preg_replace('/<\\\\/?' . $tag . '(.|\\\\s)*?>/', '', $content);\n }\n return $content;\n }", "private function removeTagsWithMultiplication() {\n\t\t$special = array(\n\t\t\t// TagText-TagAttribut => Multiplikate\n\t\t\t'img-alt' => 3,\n\t\t\t'img-title' => 4,\n\t\t\t'a-title' => 5,\n\t\t\t'a' => 5,\n\t\t\t'h1' => 20,\n\t\t\t'h2' => 9,\n\t\t\t'h3' => 8,\n\t\t\t'h4' => 7,\n\t\t\t'h5' => 6,\n\t\t\t'h6' => 5,\n\t\t\t'b' => 4,\n\t\t\t'u' => 3,\n\t\t\t'i' => 2,\n\t\t\t'em' => 3,\n\t\t\t'strong' => 4,\n\t\t\t'cite' => 2,\n\t\t\t'blockquote' => 2\n\t\t);\n\t\tforeach ($special as $tag => $multis) {\n\t\t\tif (strpos($tag, '-') !== false) {\n\t\t\t\t$split = explode('-', $tag);\n\t\t\t\t$tag = $split[0];\n\t\t\t\t$attr = $split[1];\n\t\t\t\t$this->html = preg_replace('#<'.$tag.'[^>]*'.$attr.'=\"([^\"]*)\"[^>]*>#i', str_repeat(' $1 ', $multis), $this->html);\n\t\t\t} else {\n\t\t\t\t$this->html = preg_replace('#<'.$tag.'(>|\\s.*?>)(.*?)</'.$tag.'>#is', str_repeat(' $2 ', $multis), $this->html);\n\t\t\t}\n\t\t}\n\t\t$this->html = strip_tags($this->html);\n\t}", "function cleanEvilTags($t){\r\n\t\t$t = preg_replace(\"/javascript/i\" , \"j&#097;v&#097;script\", $t);\r\n\t\t$t = preg_replace(\"/alert/i\" , \"&#097;lert\" , $t);\r\n\t\t$t = preg_replace(\"/about:/i\" , \"&#097;bout:\" , $t);\r\n\t\t$t = preg_replace(\"/onmouseover/i\", \"&#111;nmouseover\" , $t);\r\n\t\t$t = preg_replace(\"/onclick/i\" , \"&#111;nclick\" , $t);\r\n\t\t$t = preg_replace(\"/onload/i\" , \"&#111;nload\" , $t);\r\n\t\t$t = preg_replace(\"/onsubmit/i\" , \"&#111;nsubmit\" , $t);\r\n\t\t$t = preg_replace(\"/<body/i\" , \"&lt;body\" , $t);\r\n\t\t$t = preg_replace(\"/<html/i\" , \"&lt;html\" , $t);\r\n\t\t$t = preg_replace(\"/document\\./i\" , \"&#100;ocument.\" , $t);\r\n\t\treturn $t;\r\n\t}", "function lessie_process_html_tag(&$vars) {\r\n $el = &$vars['element'];\r\n\r\n // Remove type=\"...\" and CDATA prefix/suffix.\r\n unset($el['#attributes']['type'], $el['#value_prefix'], $el['#value_suffix']);\r\n\r\n // Remove media=\"all\" but leave others unaffected.\r\n if (isset($el['#attributes']['media']) && $el['#attributes']['media'] === 'all') {\r\n unset($el['#attributes']['media']);\r\n }\r\n}", "public function style_remove($tag) {\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n }", "function clean_content($string) {\n $patterns = array(\n '#^\\s*</p>#',\n '#<p>\\s*$#',\n '#<p>(\\s|&nbsp;)*+(<br\\s*/*>)?(\\s|&nbsp;)*</p>#'\n );\n // $patterns = '#<p>(\\s|&nbsp;)*+(<br\\s*/*>)?(\\s|&nbsp;)*</p>#i';\n\n return preg_replace($patterns, '', $string);\n}", "function rewrapHTML($str) {\n $pattern = '~(^|>)([^<]+)~';\n return preg_replace_callback($pattern, array(&$this, 'rewrapHTMLCallback'), $str);\n }", "function strip_p( $html ) {\n $string = $html;\n $patterns = array();\n $patterns[0] = '/\\<p\\>/';\n $patterns[1] = '/\\<\\/p\\>/';\n $replacements = array();\n $replacements[0] = \"\";\n $replacements[1] = \"\";\n return preg_replace($patterns, $replacements, $string);\n }", "public static function close_tags($html){\n\n \t#put all opened tags into an array\n \tpreg_match_all(\"#<([a-z]+)( .*)?(?!/)>#iU\",$html,$result);\n \t$openedtags=$result[1];\n\n \t#put all closed tags into an array\n \tpreg_match_all(\"#</([a-z]+)>#iU\",$html,$result);\n \t$closedtags=$result[1];\n \t$len_opened = count($openedtags);\n\n \t#all tags are closed\n \tif(count($closedtags) == $len_opened){\n \t\treturn $html;\n \t}\n \t$openedtags = array_reverse($openedtags);\n\n \t#close tags\n \tfor($i=0;$i < $len_opened;$i++) {\n \t\tif (!in_array($openedtags[$i],$closedtags)){\n \t\t\t$html .= '</'.$openedtags[$i].'>';\n \t\t} else {\n \t\t\tunset($closedtags[array_search($openedtags[$i],$closedtags)]);\n \t\t}\n \t}\n \treturn $html;\n }" ]
[ "0.7702855", "0.7687814", "0.7651972", "0.7621255", "0.76178825", "0.7462482", "0.7444486", "0.73520255", "0.7351245", "0.72486967", "0.7241899", "0.7233726", "0.7208642", "0.7200628", "0.71803534", "0.71742386", "0.7149441", "0.71358544", "0.71317416", "0.70967954", "0.6995628", "0.69927776", "0.69732016", "0.6963068", "0.695922", "0.6958938", "0.69302285", "0.6901807", "0.68936604", "0.684442", "0.68377775", "0.6837288", "0.683334", "0.68324924", "0.68269837", "0.68143755", "0.68036854", "0.67241806", "0.6719569", "0.66763306", "0.6674211", "0.6649209", "0.6642296", "0.66235614", "0.66124344", "0.660698", "0.6594406", "0.6594406", "0.6594406", "0.6585521", "0.6581518", "0.6575453", "0.65672207", "0.65638125", "0.65566057", "0.65552324", "0.65516084", "0.653161", "0.6513864", "0.65066326", "0.6501605", "0.64639515", "0.6447912", "0.64379996", "0.6432138", "0.6429981", "0.6426275", "0.64255446", "0.6399594", "0.6394904", "0.6393412", "0.63647974", "0.6346662", "0.63355935", "0.6327297", "0.63054764", "0.62944853", "0.6275375", "0.6260589", "0.6253318", "0.62529767", "0.6252809", "0.6252236", "0.62430227", "0.623401", "0.6210859", "0.62101483", "0.61994153", "0.6182604", "0.6176079", "0.61680776", "0.6151288", "0.6121359", "0.6113835", "0.6108038", "0.60984486", "0.6089047", "0.6087916", "0.6067921", "0.60537535", "0.6049794" ]
0.0
-1
Is this an end tag?
public static function isEndTag(string $string): string|false { $string = trim($string); $match = false; if (preg_match('/<\/\s*(' . self::RE_TAG_NAME . ')\s*>/', $string, $match)) { return $match[1]; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isSelfClosingTag($tag)\n {\n return $tag === 'br' || $tag === 'img';\n }", "function end_tag() {\r\n\t\t$this->push_nodelist();\r\n\t\t\r\n\t}", "public function hasEnd(){\n return $this->_has(3);\n }", "public function hasEnd(){\n return $this->_has(3);\n }", "public function decideShortcodeEnd(\\Twig_Token $token)\n {\n return $token->test(array('end', \"end{$this->name}\"));\n }", "private function tag_close($tag)\r\n\t{\r\n\t\tif(!$this->current_tag instanceof SBBCodeParser_Document\r\n\t\t\t&& $tag !== $this->current_tag->tag())\r\n\t\t{\r\n\t\t\t$closing_tags = $this->bbcodes[$this->current_tag->tag()]->closing_tags();\r\n\r\n\t\t\tif(in_array($tag, $closing_tags) || in_array('/' . $tag, $closing_tags))\r\n\t\t\t\t$this->current_tag = $this->current_tag->parent();\r\n\t\t}\r\n\t\t\r\n\t\tif($this->current_tag instanceof SBBCodeParser_Document)\r\n\t\t\treturn false;\r\n\t\telse if($tag !== $this->current_tag->tag())\r\n\t\t{\r\n\t\t\t// check if this is a tag inside another tag like\r\n\t\t\t// [tag1] [tag2] [/tag1] [/tag2]\r\n\t\t\t$node = $this->current_tag->find_parent_by_tag($tag);\r\n\t\t\t\r\n\t\t\tif($node !== null)\r\n\t\t\t{\r\n\t\t\t\t$this->current_tag = $node->parent();\r\n\r\n\t\t\t\twhile(($node = $node->last_tag_node()) !== null)\r\n\t\t\t\t{\r\n\t\t\t\t\t$new_node = new SBBCodeParser_TagNode($node->tag(), $node->attributes());\r\n\t\t\t\t\t$this->current_tag->add_child($new_node);\r\n\t\t\t\t\t$this->current_tag = $new_node;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->current_tag = $this->current_tag->parent();\r\n\t\t\r\n\t\treturn true;\r\n\t}", "function endTag ($tag = NULL)\n\t{\n\t\t$html = $tag ? \"</$tag>\" : \"</$this->tag>\";\n\t\t$this -> tag = '';\n\n\t\treturn $html;\n\t}", "abstract protected function isEndToken(string $token) : bool;", "protected function _isAppropriateEndTagToken ($tag)\n\t{\n\t\t//An appropriate end tag token is an end tag token whose tag name\n\t\t//matches the tag name of the last start tag to have been emitted from\n\t\t//this tokenizer, if any. If no start tag has been emitted from this \n\t\t//tokenizer, then no end tag token is appropriate.\n\t\t$count = count($this->_startTags);\n\t\treturn $count && $this->_startTags[$count - 1] === $tag;\n\t}", "public function endTag($tag)\n {\n if ($this->region->equals(TagRegion::IN_HEAD()) && $tag->upperName() === Tag::HEAD) {\n $this->region = TagRegion::PRE_BODY();\n }\n\n /*\n * We ignore close body tags (</body) and instead insert them when their outer scope is closed (/html). This is\n * closer to how a browser parser works. The idea here is if other tags are found after the <body>, (ex: <div>)\n * which are only allowed in the <body>, we will effectively move them into the body section.\n */\n if ($tag->upperName() === Tag::BODY) {\n return;\n }\n\n /*\n * We look for tag.upperName() from the end. If we can find it, we pop everything from thereon off the stack. If\n * we can't find it, we don't bother with closing the tag, since it doesn't have a matching open tag, though in\n * practice the HtmlParser class will have already manufactured a start tag.\n */\n for ($index = count($this->stack) - 1; $index >= 0; $index--) {\n if ($this->stack[$index] === $tag->upperName()) {\n while (count($this->stack) > $index) {\n if ($this->stack[count($this->stack) - 1] === Tag::SVG) {\n $this->region = TagRegion::IN_BODY();\n }\n $this->handler->endTag(new ParsedTag(array_pop($this->stack)));\n }\n\n return;\n }\n }\n }", "public final function endTag() : string\n {\n return $this->name && !$this->isEmpty ? '</' . $this->name . '>' : '';\n }", "protected function ends()\n {\n static $re_all = '/^[\\h\\v]*$/';\n static $re_nnl = '/^[\\h]*$/';\n \n if ($this->data === null)\n return true;\n \n // if $tnl (track new lines) is true: use \\h, else: use \\h\\v\n return preg_match($this->tnl ? $re_nnl : $re_all, $this->data);\n }", "public function endConditionalHtmlTag() {\n return '</html>';\n }", "public function hasTag(){\n return $this->_has(1);\n }", "function End_Tag($parser, $tag)\r\n\t{\r\n\t\tif ($tag == 'AMP') return;\r\n\t\telse if ($tag == 'BOX')\r\n\t\t{\r\n\t\t\t$objc = &$this->GetCurrentObject();\r\n\t\t\t$objd = &$this->GetDestinationObject();\r\n\t\t\t$objd->out .= $objc->Get();\r\n\t\t\tarray_pop($this->objs);\r\n\t\t}\r\n\t\telse if ($tag == 'BR') return;\r\n\t\telse if ($tag == 'COPY') return;\r\n\t\telse if ($tag == 'DOCTYPE') return;\r\n\t\telse if ($tag == 'IMG') return;\r\n\t\telse if ($tag == 'INCLUDE') return;\r\n\t\telse if ($tag == 'INPUT') return;\r\n\t\telse if ($tag == 'LINK') return;\r\n\t\telse if ($tag == 'META') return;\r\n\t\telse if ($tag == 'NBSP') return;\r\n\t\telse if ($tag == 'NULL') return;\r\n\t\telse if ($tag == 'PRESENT')\r\n\t\t{\r\n\t\t\t$objc = &$this->GetCurrentObject();\r\n\t\t\t$objd = &$this->GetDestinationObject();\r\n\t\t\t$objd->out .= $objc->Get($this->data);\r\n\t\t\tarray_pop($this->objs);\r\n\t\t}\r\n\t\telse if ($tag == 'XFORM')\r\n\t\t{\r\n\t\t\t$objc = &$this->GetCurrentObject();\r\n\t\t\t$objd = &$this->GetDestinationObject();\r\n\t\t\t$objd->out .= $objc->Get();\r\n\t\t\tarray_pop($this->objs);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$obj = &$this->GetCurrentObject();\r\n\t\t\t$obj->out .= '</'.strtolower($tag).'>';\r\n\t\t}\r\n\t}", "function endTag($parser, $data){\n global $ind;\n if($data == \"WORD\"){\n $ind++;\n }\n}", "function endTag($parser, $element) {\r\n echo \"<br />\";\r\n}", "public function closeTag()\n {\n return '</span>';\n }", "private function hasHTMLTags()\n {\n return !(strcmp($this->content, strip_tags($this->content)) == 0);\n }", "public function is_tag_closer()\n {\n }", "function page_end() {\n\t\t$this->tag= \"</body></html>\";\n\t\treturn $this -> tag;\n\t}", "public function closing_tags()\r\n\t{\r\n\t\treturn $this->closing_tags;\r\n\t}", "public function getEndTags()\n {\n return $this->end_tags;\n }", "public function closeTag(): string\n {\n return $this->templateCloseTag;\n }", "public static function isSelfClosingTag(string $tag) : bool\n\t{\n\t\treturn isset(self::$selfClosingTags[$tag]);\n\t}", "public function getClosingTag() {\n return $this->closingTag;\n }", "function endElement($parser, $tag_name)\n {\n }", "public function eof(): bool\n {\n return $this->content->eof();\n }", "public function isClosingElementImplied($html);", "public function closingTag( $tagName )\n\t{\n\t\t$tagName = (string)$tagName;\n\n\t\tif ( $this->hasTag($tagName) and isset( $this->tags[ $tagName ]['hasClosingTag'] ) ) {\n\t\t return $this->tags[ $tagName ]['hasClosingTag'];\n\t\t}\n\n\t\treturn true;\n\t}", "public function ends()\n {\n return $this->endRepeat !== \"never\";\n }", "function CloseTag() {\n\t\tif (!empty($this->tag)) {\n\t\t\tfor ($in=0;$in<$this->indent; $in++) {\n\t\t\t\t$this->outputCode.=\"\";\n\t\t\t}\n\t\t\tif (!empty($this->tag))\n\t\t\t$this->outputCode.=\"</\".$this->tag.\">\";\n\t\t}\n\t\t//$this->outputCode.=\"\\n\";\n\t\t$this->indent--;\n\t}", "public final function __end() : bool {\n\t\t\treturn false;\n\t\t}", "public function eof() : bool {\n return !$this->append && ($this->offset >= $this->size);\n }", "protected function isEndToken(string $token) : bool\n {\n return ($token === '\"');\n }", "public function isAfterBody()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function isEOF() {\n\t\treturn $this->EOF;\n\t}", "public function endSpan()\n {\n $span = array_shift($this->stack);\n $this->context->setSpanId(empty($this->stack) ? null : $this->stack[0]->spanId());\n if ($span) {\n $span->setEnd();\n return true;\n }\n return false;\n }", "public static function tag_remove_end() {\n\t//--\n\treturn '<!-- PDF REMOVE END -->';\n\t//--\n}", "protected function eof() { \n\t\treturn !isset($this->lines[$this->cursor]); \n\t}", "public function hasTag(): bool;", "protected function end() {\n // must have space after it\n return 'END ';\n }", "private function end() {\n return $this->formats['end'];\n }", "protected static function parse_end(nodes\\Tag $node) {\n\t\t\n\t if($node->content[0] == '<') {\n\t $node->content = substr($node->content, 1);\n\t $node->trim_inner = true;\n\t }\n\t \n\t if($node->content[0] == '>') {\n\t $node->content = substr($node->content, 1);\n\t $node->trim_outer = true;\n\t $node->render_newline = false;\n\t if($node->previous_sibling())\n\t $node->previous_sibling()->render_newline = false;\n\t }\n\t\t\n\t\tif(in_array($node->tag_name, static::$parser->option('preserve')))\n\t\t\t$node->trim_inner = true;\n\t\t\n\t\tif($node->content[0] == '/') {\n\t\t\tif($node->content != '/')\n\t\t\t\t$node->exception('Parse error: self-closing tags cannot have content');\n\t\t\t\n\t\t\t$node->content = substr($node->content, 1);\n\t\t\t$node->self_closing = true;\n\t\t}\n\t\t\n\t\tif($node->content = trim($node->content)) {\n\t\t\t$text_node = new nodes\\Text();\n\t\t\t$text_node->set_from_parser(static::$parser);\n\t\t\t$text_node->root = $node->root;\n\t\t\t$text_node->parent = $node;\n\t\t\t$text_node->indent_level = 0;\n\t\t\t$text_node->content = $node->content;\n\t\t\tText::parse($text_node);\n\t\t\t\n\t\t\t$node->content = $text_node;\n\t\t}\n\t\t\n\t\tif($node->self_closing or $node->content)\n\t\t\tstatic::$parser->expect_indent(Parser::EXPECT_LESS | Parser::EXPECT_SAME);\n\t\t\n\t}", "public function closeTag()\n {\n return '</form> </div></div>';\n }", "public function is_tag($tag = '')\n {\n }", "function close_tag($tag, $pref, $nl)\n{\n tag($tag, 'close', $pref, $nl) ;\n}", "public static function countEndTags(string $tag, string $contents): int {\n\t\t$matches = [];\n\t\tif (preg_match_all('|</\\s*' . strtolower($tag) . '\\s*>|im', $contents, $matches, PREG_SET_ORDER)) {\n\t\t\treturn count($matches);\n\t\t}\n\t\treturn 0;\n\t}", "public function renderContentEnd()\n {\n echo CHtml::closeTag('div');\n }", "public function renderContentEnd()\n {\n echo CHtml::closeTag('div');\n }", "public function isBeforeBodyClose()\r\n\t{\r\n\t\treturn false;\r\n\t}", "function endElement($parser, $name)\n{\n}", "public function isClosingBrace() {\n return ($this->code === '}');\n }", "public function closeHtmlTag($tag)\n {\n return $this->isSelfClosingTag($tag) ? '' : '</'.$tag.'>';\n }", "public static function endAll(){\n\t\treturn self::end(count(self::$tag_log));\n\t}", "function close_tag($tag, $sample_html) {\n return preg_replace(\"!(<{$tag}(\\s[^>]*[^/>])?)>!si\",\"\\\\1/>\",$sample_html);\n}", "public function hasTagList()\n {\n return $this->tag !== null;\n }", "function getEndNode(){\n return $this->endNode;\n }", "public function isEnded()\n {\n return $this->ended_at > 0;\n }", "function tf_html_tag($tag, $attr = null, $end = null)\r\n {\r\n $inner = array($tag);\r\n if (isset($attr)) {\r\n foreach ($attr as $k => $v) {\r\n if (is_numeric($k)) {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($v), esc_attr($v));\r\n }\r\n else if ($v === true) {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($k), esc_attr($k));\r\n }\r\n else if ($v === false) {\r\n # ignore\r\n }\r\n else {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($k), esc_attr($v));\r\n }\r\n }\r\n }\r\n\r\n if ($end === true) {\r\n # close ELEMENT as HTML\r\n # <script></script>\r\n $body = '';\r\n $close = '</'.$tag.'>';\r\n }\r\n else if ($end === false) {\r\n # close ELEMENT as XML\r\n $inner[] = '/';\r\n $body = '';\r\n $close = '';\r\n }\r\n else {\r\n # if there is content close element, otherwise leave it open\r\n if (empty($end)) {\r\n $body = '';\r\n $close = '';\r\n }\r\n else {\r\n $body = strval($end);\r\n $close = '</'.$tag.'>';\r\n }\r\n }\r\n\r\n $open = '<'.implode(' ', $inner).'>';\r\n return $open.$body.$close;\r\n }", "public function closeTag($tag) {\n\t\treturn '</' . $tag . '>';\n\t}", "public function isClosingElementImplied($html)\n {\n return false;\n }", "public function stream_eof(): bool\n {\n return ($this->position >= strlen($this->content));\n }", "function isHTMLContent($c)\t{\n\t\t$c = trim($c);\n\t\t$first = strtolower(substr($c,0,6));\n\t\t$last = strtolower(substr($c,-7));\n\t\tif ($first.$last=='<html></html>')\treturn 1;\n\t}", "public function close() {\n\t\t\n\t\t// Render close tag\n\t\t\n\t\t$this->_post_render();\n\t\t\n\t\techo true === $this->options['render_tag'] ? $this->_render_tag( true ) : '';\n\t\t\n\t\techo $this->options['after'];\n\t\t\n\t}", "public function setEndTag($tag)\n {\n $this->endTag = $tag;\n }", "function _tag_holding_view($option = 'last')\n\t{\n\t\treturn is_array($this->_tag_holding) ? end($this->_tag_holding) : false;\n\t}", "public function eof(): bool;", "protected function _isStopper($tag)\n {\n $this->_checkTagDeclaration($this->_current->getName());\n\n if (!empty($this->_searchedStoppers[$tag])) {\n return true;\n }\n\n return false;\n }", "public function stream_eof()\n {\n return ($this->_pos >= strlen($this->_pointer));\n }", "public function end()\n\t\t{\n\t\t\t\\System\\Web\\HTTPResponse::write( '</span>' );\n\t\t}", "public function isClosingParenthesis() {\n return ($this->code === ')');\n }", "public static function end()\n\t{\n\t\treturn '\n\t\t</div>\n\t</div>\n</div>\n<!-- CE: End Pagination -->\n';\n\t}", "protected function has_tags(){\n\t\tif( ! empty( $this->tags ) ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function isLastChild(): bool\n {\n return $this->is_last_child;\n }", "private function endItem()\n\t{\n\t\tif($this->version == RSS2 || $this->version == RSS1)\n\t\t{\n\t\t\techo '</item>' . PHP_EOL; \n\t\t} \n\t\telse if($this->version == ATOM)\n\t\t{\n\t\t\techo \"</entry>\" . PHP_EOL;\n\t\t}\n\t}", "public function eof()\n {\n return $this->rendered;\n }", "protected function isLast($node)\n\t{\n\t\twhile (isset($node->nextSibling)) {\n\t\t\t$node = $node->nextSibling;\n\t\t\tif ($node->nodeType === XML_ELEMENT_NODE) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "protected function handlerEndTag($a_xml_parser, $a_name) \n\t{\n\t}", "public function renderEndTag($writer)\n\t{\n\t\tif($this->getGroupingText()!=='')\n\t\t\t$writer->renderEndTag();\n\t\tparent::renderEndTag($writer);\n\t}", "function close_html()\n{\n close_tag('html', '', true) ;\n}", "protected function _renderBodyEnd()\n\t{\n\t\treturn ''\n\t\t\t. \"\\n\" . Html::endTag( 'div' );\n\t}", "public function stream_eof() {\r\n\t\treturn $this->pos >= strlen($this->data);\r\n\t}", "public static function closeTag($tag) {\n\t\treturn '</' . $tag . '>';\n\t}", "public function is_endless() {\r\n\t\treturn 0 == $this->end_date;\r\n\t}", "static function close_tags($content) {\n $position = 0;\n $open_tags = array();\n $ignored_tags = array('br', 'hr', 'img');\n\n while (($position = strpos($content, '<', $position)) !== FALSE)\n {\n if (preg_match(\"|^<(/?)([a-z\\d]+)\\b[^>]*>|i\", substr($content, $position), $match))\n {\n $tag = strtolower($match[2]);\n if (in_array($tag, $ignored_tags) == FALSE)\n {\n //тег открыт\n if (isset($match[1]) AND $match[1] == '')\n {\n if (isset($open_tags[$tag]))\n $open_tags[$tag]++;\n else\n $open_tags[$tag] = 1;\n }\n //тег закрыт\n if (isset($match[1]) AND $match[1] == '/')\n {\n if (isset($open_tags[$tag]))\n $open_tags[$tag]--;\n }\n }\n $position += strlen($match[0]);\n }\n else\n $position++;\n }\n\n foreach ($open_tags as $tag => $count_not_closed) {\n $content .= str_repeat(\"</{$tag}>\", $count_not_closed);\n }\n\n return $content;\n }", "public function sectionEnd() {}", "public function sectionEnd() {}", "public function hasEndtime(){\n return $this->_has(8);\n }", "protected function theElementIsClosed($enclosingTag, $includedContent=null, $parseFullDoc=false)\n {\n return !$this->theElementIsOpen($enclosingTag, $includedContent, $parseFullDoc);\n }", "function hasBody() {\n\t\t$body = strip_tags($this->body, \"<img><a>\");\n\t\t$body = trim($body);\n\t\tif (empty($body)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function stream_eof()\r\n {\r\n return $this->_pos >= strlen($this->_data);\r\n }", "public function end($e)\n\t{\n\t\t$e = strtolower($e);\n\t\t\n\t\treturn '</' . $e . '>';\n\t}", "function _tag_close( $parser, $tag )\n {\n $this->curtag = &$this->curtag->parent;\n }", "protected function _isEndKey( $key )\n {\n $endReadingKey = $this->_options[self::OPT_END_READING_KEY];\n return ( 0 === strcmp( $key, $endReadingKey ) );\n }", "function closeUnclosedTags($unclosedString)\n\t\t{ \n\t\t\tpreg_match_all(\"/<([^\\/]\\w*)>/\", $closedString = $unclosedString, $tags); \n\t\t\t\n\t\t\tfor($i=count($tags[1])-1; $i>=0; $i--)\n\t\t\t{ \n\t\t\t\t$tag = $tags[1][$i];\n\t\t\t\t\n\t\t\t\tif(substr_count($closedString, \"</$tag>\") < substr_count($closedString, \"<$tag>\"))\n\t\t\t\t\t$closedString .= \"</$tag>\";\n\t\t\t}\n\t\t\t\n\t\t\treturn $closedString; \n\t\t}", "public function stream_eof()\n {\n $isEof = ($this->_pos >= strlen($this->_data));\n return $isEof;\n }", "public function exitRemainingTags()\n {\n while (count($this->stack) > 0) {\n $this->handler->endTag(\n new ParsedTag(array_pop($this->stack))\n );\n }\n }", "public function docBodyTagBegin() {}", "public function isEOF()\n {\n if ($this->chunkOffset === $this->numChunks - 1) {\n return $this->bufferOffset >= $this->expectedLastChunkSize;\n }\n\n return $this->chunkOffset >= $this->numChunks;\n }" ]
[ "0.7044281", "0.69920146", "0.69380814", "0.69380814", "0.6923909", "0.6865001", "0.6831585", "0.67903763", "0.6743985", "0.67231137", "0.6681599", "0.6671003", "0.6661171", "0.66099256", "0.6583321", "0.65670514", "0.656414", "0.65394676", "0.6536007", "0.6519413", "0.6517098", "0.65036905", "0.6470164", "0.6466441", "0.6441102", "0.6392723", "0.6308161", "0.62818617", "0.6261602", "0.6252403", "0.62213355", "0.6219071", "0.6207883", "0.61699384", "0.61499745", "0.6134851", "0.6123248", "0.611321", "0.6106808", "0.6085873", "0.60706824", "0.60704637", "0.6018972", "0.6007661", "0.5968394", "0.59658253", "0.5946548", "0.5932962", "0.58982027", "0.58982027", "0.58786786", "0.5875947", "0.5862844", "0.58583385", "0.58502144", "0.58283895", "0.58111054", "0.5805214", "0.580135", "0.5787321", "0.5783599", "0.57835823", "0.5777419", "0.57706946", "0.57684994", "0.57662845", "0.57455367", "0.5744232", "0.5741208", "0.5729079", "0.5724678", "0.5713306", "0.5713109", "0.57081205", "0.5704965", "0.57016075", "0.5699512", "0.5698537", "0.56920975", "0.5691862", "0.56838846", "0.5671129", "0.56657875", "0.56507087", "0.56343436", "0.56331307", "0.5619586", "0.5619586", "0.5618061", "0.5611645", "0.560634", "0.56039685", "0.5600998", "0.5599514", "0.55948675", "0.5593639", "0.55898136", "0.55889356", "0.55885285", "0.55876976" ]
0.708889
0
Count the number of end tags found in this string which match the tag supplied
public static function countEndTags(string $tag, string $contents): int { $matches = []; if (preg_match_all('|</\s*' . strtolower($tag) . '\s*>|im', $contents, $matches, PREG_SET_ORDER)) { return count($matches); } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function count_until_tag(string $string, string &$tagName, int &$nWords): int {\n\t\t$result = self::countUntilTag($string);\n\t\t$tagName = $result['tagMatch'];\n\t\t$nWords = $result['words'];\n\t\treturn $result['offset'] + $result['tagMatchLength'];\n\t}", "function endTag($parser, $data){\n global $ind;\n if($data == \"WORD\"){\n $ind++;\n }\n}", "protected function findEnd($str, $open, $end){\n\t\t$opens = 1;\n\t\t$ends = 0;\n\t\tfor($i=0; $i<strlen($str); $i++){\n\t\t\tif($str[$i]===$end )$ends++;\n\t\t\tif($opens==$ends)\n\t\t\t\tbreak;\n\t\t\tif($str[$i]===$open)$opens++;\n\t\t}\n\t\treturn $i;\n\t}", "public function getEndTags()\n {\n return $this->end_tags;\n }", "public static function getTotalTag()\n {\n $table = \"tag\";\n $condition = \"\";\n\n return Connection::getCountData($table, $condition);\n\n }", "public static function endAll(){\n\t\treturn self::end(count(self::$tag_log));\n\t}", "function countTags ($sheet, $records, $col) {\n\t\t$records += 2;\n\t\t$tagcount = 0;\n\t\tfor ($i = 2; $i < $records; $i++) {\n\t\t\t$temp = $sheet->getcell($col.$i);\n\t\t\tif ($temp == \"\") $tagcount += 1;\t\t\t\n\t\t}\n\t\t$tagcount = $records - 2 - $tagcount;\n\t\treturn $tagcount;\n\t}", "function _quail_server_count_nodes($html) {\n\treturn substr_count($html, '<');\n}", "function checkTagCount(array $openingTags, array $closingTags): bool\n{\n return count($openingTags) == count($closingTags);\n}", "public static function taggedStrLen($str)\n {\n return mb_strlen(preg_replace('/\n<[^>]*>/u', '', $str));\n }", "public function setEndTags($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->end_tags = $arr;\n\n return $this;\n }", "public function count($tag)\n {\n return $this->connection()->zcard($tag);\n }", "function closeUnclosedTags($unclosedString)\n\t\t{ \n\t\t\tpreg_match_all(\"/<([^\\/]\\w*)>/\", $closedString = $unclosedString, $tags); \n\t\t\t\n\t\t\tfor($i=count($tags[1])-1; $i>=0; $i--)\n\t\t\t{ \n\t\t\t\t$tag = $tags[1][$i];\n\t\t\t\t\n\t\t\t\tif(substr_count($closedString, \"</$tag>\") < substr_count($closedString, \"<$tag>\"))\n\t\t\t\t\t$closedString .= \"</$tag>\";\n\t\t\t}\n\t\t\t\n\t\t\treturn $closedString; \n\t\t}", "public function getCount()\r\n {\r\n\t\tif (defined(\"WITH_SPHINX_TAGS\") && WITH_SPHINX_TAGS)\r\n\t\t{\r\n\t\t\t$count = parent::getCount();\r\n\t\t} else {\r\n\t\t\t$count = $this->getGroupTagsCount() +\r\n\t\t\t\t$this->getMembersTagsCount() +\r\n\t\t\t\t$this->getDocumentsTagsCount() +\r\n\t\t\t\t$this->getEventsTagsCount() +\r\n\t\t\t\t$this->getPhotosTagsCount() +\r\n\t\t\t\t$this->getListsTagsCount();\r\n\t\t}\r\n return (int) $count;\r\n }", "public static function countUntilTag(string $string): array {\n\t\t$matches = [];\n\t\tif (!preg_match('/<(\\/?' . self::RE_TAG_NAME . ')' . self::RE_ATTRIBUTES . '(\\/?)>/', $string, $matches, PREG_OFFSET_CAPTURE)) {\n\t\t\treturn [];\n\t\t}\n\n\t\t//\t\tdump($matches);\n\t\t[$tagMatch, $offset] = array_shift($matches);\n\t\t[$tagName] = array_shift($matches);\n\t\t[$tagClose] = array_shift($matches);\n\n\t\t$tagContents = $tagName . $tagClose;\n\n\t\t$nWords = Text::countWords(substr($string, 0, $offset));\n\t\t$tagMatchLength = strlen($tagMatch);\n\t\treturn [\n\t\t\t'offset' => $offset, 'next' => $offset + $tagMatchLength, 'tagMatchLength' => $tagMatchLength,\n\t\t\t'tagMatch' => $tagMatch, 'words' => $nWords, 'tagContents' => $tagContents, 'tagName' => $tagName,\n\t\t];\n\t}", "public static function isEndTag(string $string): string|false {\n\t\t$string = trim($string);\n\t\t$match = false;\n\t\tif (preg_match('/<\\/\\s*(' . self::RE_TAG_NAME . ')\\s*>/', $string, $match)) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn false;\n\t}", "static function close_tags($content) {\n $position = 0;\n $open_tags = array();\n $ignored_tags = array('br', 'hr', 'img');\n\n while (($position = strpos($content, '<', $position)) !== FALSE)\n {\n if (preg_match(\"|^<(/?)([a-z\\d]+)\\b[^>]*>|i\", substr($content, $position), $match))\n {\n $tag = strtolower($match[2]);\n if (in_array($tag, $ignored_tags) == FALSE)\n {\n //тег открыт\n if (isset($match[1]) AND $match[1] == '')\n {\n if (isset($open_tags[$tag]))\n $open_tags[$tag]++;\n else\n $open_tags[$tag] = 1;\n }\n //тег закрыт\n if (isset($match[1]) AND $match[1] == '/')\n {\n if (isset($open_tags[$tag]))\n $open_tags[$tag]--;\n }\n }\n $position += strlen($match[0]);\n }\n else\n $position++;\n }\n\n foreach ($open_tags as $tag => $count_not_closed) {\n $content .= str_repeat(\"</{$tag}>\", $count_not_closed);\n }\n\n return $content;\n }", "public function get_tag_post_count($tag_slug)\r\n {\r\n $this->set_filter_query();\r\n $this->db->join('tags', 'posts.id = tags.post_id');\r\n $this->db->where('tags.tag_slug', $tag_slug);\r\n $query = $this->db->get('posts');\r\n return $query->num_rows();\r\n }", "function endTag ($tag = NULL)\n\t{\n\t\t$html = $tag ? \"</$tag>\" : \"</$this->tag>\";\n\t\t$this -> tag = '';\n\n\t\treturn $html;\n\t}", "function get_string_end_count($arrDisplay, $start) {\n // set our count\n $count = 0;\n \n // loop through teh array and add to our count\n for ($i = $start; $i < count($arrDisplay); $i++) {\n $count += strlen($arrDisplay[$i]);\n }\n \n // return the count\n return $count;\n }", "function tep_word_count($string, $needle) {\n\t$temp_array = split($needle, $string);\n\treturn sizeof($temp_array);\n}", "public function endTag($tag)\n {\n if ($this->region->equals(TagRegion::IN_HEAD()) && $tag->upperName() === Tag::HEAD) {\n $this->region = TagRegion::PRE_BODY();\n }\n\n /*\n * We ignore close body tags (</body) and instead insert them when their outer scope is closed (/html). This is\n * closer to how a browser parser works. The idea here is if other tags are found after the <body>, (ex: <div>)\n * which are only allowed in the <body>, we will effectively move them into the body section.\n */\n if ($tag->upperName() === Tag::BODY) {\n return;\n }\n\n /*\n * We look for tag.upperName() from the end. If we can find it, we pop everything from thereon off the stack. If\n * we can't find it, we don't bother with closing the tag, since it doesn't have a matching open tag, though in\n * practice the HtmlParser class will have already manufactured a start tag.\n */\n for ($index = count($this->stack) - 1; $index >= 0; $index--) {\n if ($this->stack[$index] === $tag->upperName()) {\n while (count($this->stack) > $index) {\n if ($this->stack[count($this->stack) - 1] === Tag::SVG) {\n $this->region = TagRegion::IN_BODY();\n }\n $this->handler->endTag(new ParsedTag(array_pop($this->stack)));\n }\n\n return;\n }\n }\n }", "protected function totalByTag($tag) {\n return $this->tag->bySlug($tag)\n ->articles()\n ->where('status_id', 1)\n ->count();\n }", "public function getTagsCount()\n {\n return count(get_the_tags($this->id));\n }", "public static function getValidOuterTagPositions($string, $tag)\n {\n $ret = false;\n if (preg_match_all('!(?:<' . $tag . '[^>]*>)|(?:</' . $tag . '>)!i', $string, $m, PREG_OFFSET_CAPTURE | PREG_PATTERN_ORDER)) {\n $nbTotalValidTags = 0;\n $ret = [];\n /**\n * - 0: index\n * - 1: type=open|close\n */\n $stack = [];\n $endTagLength = strlen($tag) + 3;\n foreach ($m[0] as $info) {\n list($tag, $pos) = $info;\n $type = ('</' === substr($tag, 0, 2)) ? 'close' : 'open';\n if ('open' === $type) {\n $stack[] = [$pos, $type];\n }\n else {\n $addToStack = true;\n $n = count($stack);\n if (isset($stack[$n - 1])) {\n $prevType = $stack[$n - 1][1];\n if ('open' === $prevType) {\n $prevPos = $stack[$n - 1][0];\n $addToStack = false;\n $ret[] = [\n $prevPos,\n $pos + $endTagLength,\n ];\n // remove the previous opening tag\n array_pop($stack);\n $nbTotalValidTags++;\n }\n }\n if (true === $addToStack) {\n $stack[] = [$pos, $type];\n }\n }\n }\n\n // now we need to filter out children, so that we only have outer tags left.\n // first let's sort by the opening tag index\n usort($ret, function ($a, $b) {\n return ($a[0] > $b[0]);\n });\n\n $parent = null;\n foreach ($ret as $k => $p) {\n $changeParent = true;\n if (null !== $parent) {\n if ($parent[0] < $p[0] && $parent[1] > $p[1]) {\n unset($ret[$k]);\n $changeParent = false;\n }\n }\n if (true === $changeParent) {\n $parent = $p;\n }\n }\n $ret = array_merge($ret);\n\n if ($nbTotalValidTags < 1) {\n $ret = false;\n }\n }\n return $ret;\n }", "public function count(): int\n {\n return count($this->delimiters);\n }", "function close_tag($tag, $sample_html) {\n return preg_replace(\"!(<{$tag}(\\s[^>]*[^/>])?)>!si\",\"\\\\1/>\",$sample_html);\n}", "#[\\ReturnTypeWillChange]\n public function count() {\n return mb_strlen($this->string);\n }", "public function closing_tags()\r\n\t{\r\n\t\treturn $this->closing_tags;\r\n\t}", "private function numberOfOpenElements($searchTag, $enclosingTag)\n {\n $pageElements = $this->pageElements;\n $elementIndex = count($pageElements) -1;\n $numOpenElems = 0;\n $searchLen = strlen($searchTag) + 2; // length of '<' plus tagname plus space\n $enclosingLen = strlen($enclosingTag) + 2; // length of '<' plus tagname plus space\n\n // Loop through the elements, last to first, tracking opening and closing spans.\n // Loop terminates when the enclosing tag is found--no open search tags should exist beyond there\n // --or when the beginning of the page element array is reached (see use case in comment block above).\n while ($elementIndex >= 0 && substr($pageElements[$elementIndex][0],0,$enclosingLen) != '<' . $enclosingTag . ' ')\n {\n // When getting the tag, add a space before the closing '>'. That way, '<span>' will get a space inside the tag,\n // We can then determine the tag name by finding the substring up to the first space.\n $tag = str_replace('>', ' >', $pageElements[$elementIndex][0]);\n\n if (substr($tag, 0, $searchLen) == '<' . $searchTag . ' ')\n {\n $numOpenElems++;\n }\n\n if (substr($tag, 0, $searchLen+1) == '</' . $searchTag . ' ')\n {\n $numOpenElems--;\n }\n\n $elementIndex--;\n }\n\n // If $numOpenElems < 0, it means there are unmatched *closing* elements, which is an error\n if ($numOpenElems < 0)\n {\n throw new Exception('You have an unmatched closing ' . $searchTag . ' on page ' . $this->pageNumber);\n }\n\n return $numOpenElems;\n }", "public function closeTag($tag) {\n\t\treturn '</' . $tag . '>';\n\t}", "protected function ends()\n {\n static $re_all = '/^[\\h\\v]*$/';\n static $re_nnl = '/^[\\h]*$/';\n \n if ($this->data === null)\n return true;\n \n // if $tnl (track new lines) is true: use \\h, else: use \\h\\v\n return preg_match($this->tnl ? $re_nnl : $re_all, $this->data);\n }", "private function tag_close($tag)\r\n\t{\r\n\t\tif(!$this->current_tag instanceof SBBCodeParser_Document\r\n\t\t\t&& $tag !== $this->current_tag->tag())\r\n\t\t{\r\n\t\t\t$closing_tags = $this->bbcodes[$this->current_tag->tag()]->closing_tags();\r\n\r\n\t\t\tif(in_array($tag, $closing_tags) || in_array('/' . $tag, $closing_tags))\r\n\t\t\t\t$this->current_tag = $this->current_tag->parent();\r\n\t\t}\r\n\t\t\r\n\t\tif($this->current_tag instanceof SBBCodeParser_Document)\r\n\t\t\treturn false;\r\n\t\telse if($tag !== $this->current_tag->tag())\r\n\t\t{\r\n\t\t\t// check if this is a tag inside another tag like\r\n\t\t\t// [tag1] [tag2] [/tag1] [/tag2]\r\n\t\t\t$node = $this->current_tag->find_parent_by_tag($tag);\r\n\t\t\t\r\n\t\t\tif($node !== null)\r\n\t\t\t{\r\n\t\t\t\t$this->current_tag = $node->parent();\r\n\r\n\t\t\t\twhile(($node = $node->last_tag_node()) !== null)\r\n\t\t\t\t{\r\n\t\t\t\t\t$new_node = new SBBCodeParser_TagNode($node->tag(), $node->attributes());\r\n\t\t\t\t\t$this->current_tag->add_child($new_node);\r\n\t\t\t\t\t$this->current_tag = $new_node;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->current_tag = $this->current_tag->parent();\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function extractMergeTagsPlaceHolders()\n {\n $pattern = '/' . preg_quote(static::TAG_PREFIX) .\n '((WAS' . preg_quote(static::TIME_DELIMITER) . ')?' .\n '(([A-Z0-9])' . '(' . preg_quote(static::CAPITAL_DELIMITER) . '|' .\n preg_quote(static::PROPERTY_DELIMITER) . ')?)+)' . // Not Coding Standard\n preg_quote(static::TAG_SUFFIX) .\n '/';\n // $this->mergeTags index 0 = with tag prefix and suffix, index 1 = without tag prefix and suffix\n $matchesCounts = preg_match_all($pattern, $this->content, $this->mergeTags);\n array_walk($this->mergeTags, 'static::resolveUniqueMergeTags');\n return $matchesCounts;\n }", "public function decideShortcodeEnd(\\Twig_Token $token)\n {\n return $token->test(array('end', \"end{$this->name}\"));\n }", "public static function closeTag($tag) {\n\t\treturn '</' . $tag . '>';\n\t}", "protected function _isAppropriateEndTagToken ($tag)\n\t{\n\t\t//An appropriate end tag token is an end tag token whose tag name\n\t\t//matches the tag name of the last start tag to have been emitted from\n\t\t//this tokenizer, if any. If no start tag has been emitted from this \n\t\t//tokenizer, then no end tag token is appropriate.\n\t\t$count = count($this->_startTags);\n\t\treturn $count && $this->_startTags[$count - 1] === $tag;\n\t}", "public function count()\n {\n return count($this->tokens);\n }", "public function countOccurences($haystack, $needle)\n {\n return substr_count($haystack, $needle);\n }", "function parse_tags($tags, &$open, &$close)\n{\n\t$len = mb_strlen($tags);\n\tif ($len === 0)\n\t\treturn false;\n\t$b = 0;\t// kazdy tag se muze na radku vyskytnout jen jednou\n\t$i = 0;\n\t$u = 0;\n\t$tt = 0;\n\t$sz = 0;\n\t$txt = 0;\n\twhile ($len !== 0)\n\t{\n\t\t$len = mb_strlen($tags);\n\t\tif ($len >= 4 && $b == 0 && mb_substr($tags, 0, 4) === \"bold\")\t// tag bold\n\t\t{\n\t\t\t$b++;\n\t\t\t$open = $open . \"<b>\";\n\t\t\t$close = \"</b>\" . $close;\n\t\t\tif ($len == 4)\t\t// tag je posledni\n\t\t\t\treturn true;\n\t\t\t$tags = mb_substr($tags, 4);\n\t\t\t$len = mb_strlen($tags);\n\t\t\t\n\t\t\tif (!remove_space($tags))\n\t\t\t\treturn false;\n\t\t}\n\t\telse if ($len >= 6 && $sz == 0 && mb_substr($tags, 0, 5) === \"size:\" && mb_substr($tags, 5, 1) >= \"1\" && mb_substr($tags, 5, 1) <= \"7\")\t// tag size\n\t\t{\n\t\t\t$sz++;\n\t\t\t$open = $open . \"<font size=\" . mb_substr($tags, 5, 1) . \">\";\n\t\t\t$close = \"</font>\" . $close;\n\t\t\tif ($len == 6)\t\t// tag je posledni\n\t\t\t\treturn true;\n\t\t\t$tags = mb_substr($tags, 6);\n\t\t\t$len = mb_strlen($tags);\n\t\t\t\n\t\t\tif (!remove_space($tags))\n\t\t\t\treturn false;\n\t\t}\n\t\telse if ($len >= 6 && $i == 0 && mb_substr($tags, 0, 6) === \"italic\")\t// tag italic\n\t\t{\n\t\t\t$i++;\n\t\t\t$open = $open . \"<i>\";\n\t\t\t$close = \"</i>\" . $close;\n\t\t\tif ($len == 6)\t\t// tag je posledni\n\t\t\t\treturn true;\n\t\t\t$tags = mb_substr($tags, 6);\n\t\t\t$len = mb_strlen($tags);\n\t\t\t\n\t\t\tif (!remove_space($tags))\n\t\t\t\treturn false;\n\t\t}\n\t\telse if ($len >= 8 && $tt == 0 && mb_substr($tags, 0, 8) === \"teletype\")\t// tag teletype\n\t\t{\n\t\t\t$tt++;\n\t\t\t$open = $open . \"<tt>\";\n\t\t\t$close = \"</tt>\" . $close;\n\t\t\tif ($len == 8)\t\t// tag je posledni\n\t\t\t\treturn true;\n\t\t\t$tags = mb_substr($tags, 8);\n\t\t\t$len = mb_strlen($tags);\n\t\t\t\n\t\t\tif (!remove_space($tags))\n\t\t\t\treturn false;\n\t\t}\n\t\telse if ($len >= 9 && $u == 0 && mb_substr($tags, 0, 9) === \"underline\")\t// tag underline\n\t\t{\n\t\t\t$u++;\n\t\t\t$open = $open . \"<u>\";\n\t\t\t$close = \"</u>\" . $close;\n\t\t\tif ($len == 9)\t\t// tag je posledni\n\t\t\t\treturn true;\n\t\t\t$tags = mb_substr($tags, 9);\n\t\t\t$len = mb_strlen($tags);\n\t\t\t\n\t\t\tif (!remove_space($tags))\n\t\t\t\treturn false;\n\t\t}\n\t\telse if ($len >= 12 && $txt == 0 && mb_substr($tags, 0, 6) === \"color:\")\t// tag color\n\t\t{\n\t\t\t$txt++;\n\t\t\tif (preg_match(\"~[a-fA-F0-9]{6}~\", mb_substr($tags, 6, 6)) === 0)\t// overeni formatu barvy\n\t\t\t{\n\t\t\t\tfwrite(STDERR, \"CHYBA: spatny format formatovaciho souboru!\\n\");\n\t\t\t\texit (4);\n\t\t\t}\n\t\t\t$open = $open . \"<font color=#\" . mb_substr($tags, 6, 6) . \">\";\n\t\t\t$close = \"</font>\" . $close;\n\t\t\tif ($len === 12)\t\t// tag je posledni\n\t\t\t\treturn true;\n\t\t\t$tags = mb_substr($tags, 12);\n\t\t\t$len = mb_strlen($tags);\n\t\t\t\n\t\t\tif (!remove_space($tags))\n\t\t\t\treturn false;\n\t\t}\n\t\telse\t// tag neodpovida zadne moznosti\n\t\t\treturn false;\n\t}\n}", "public static function closeTag($tag) {\n return '</' . $tag . '>';\n }", "abstract protected function isEndToken(string $token) : bool;", "protected function substr_count($haystack, $needle) // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n {\n if ($this->encoding !== 'ASCII') {\n return \\mb_substr_count($haystack, $needle);\n }\n\n return \\substr_count($haystack, $needle);\n }", "function getLength(?string $content = null): int\n{\n if (!isset($content)) {\n return 0;\n }\n return grapheme_strlen(strip_tags($content));\n}", "public function closeHtmlTag($tag)\n {\n return $this->isSelfClosingTag($tag) ? '' : '</'.$tag.'>';\n }", "public static function substr_count($haystack, $needle) {\n return substr_count($haystack, $needle);\n }", "function endElement($parser, $tag_name)\n {\n }", "public function count($substring = null) {\n if ($substring === null) {\n return mb_strlen($this->rawString, $this->charset);\n }\n else {\n return mb_substr_count($this->rawString, $substring, $this->charset);\n }\n }", "function count()\n {\n return $this->_matchesNum;\n }", "public static function substrCount($haystack, $needle, $offset = 0, $length = null)\n {\n if (! is_null($length)) {\n return substr_count($haystack, $needle, $offset, $length);\n }\n return substr_count($haystack, $needle, $offset);\n }", "public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }", "public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }", "public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }", "public function limit($text, $length = 100, $end = '…', $exact = true) {\n\t\tif (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n\t\t\treturn $text;\n\t\t}\n\t\t$totalLength = mb_strlen(strip_tags($end));\n\t\t$openTags = [];\n\t\t$truncate = '';\n\n\t\tpreg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);\n\t\tforeach ($tags as $tag) {\n\t\t\tif (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) {\n\t\t\t\tif (preg_match('/<[\\w]+[^>]*>/s', $tag[0])) {\n\t\t\t\t\tarray_unshift($openTags, $tag[2]);\n\t\t\t\t} elseif (preg_match('/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag)) {\n\t\t\t\t\t$pos = array_search($closeTag[1], $openTags);\n\t\t\t\t\tif ($pos !== false) {\n\t\t\t\t\t\tarray_splice($openTags, $pos, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$truncate .= $tag[1];\n\n\t\t\t$contentLength = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3]));\n\t\t\tif ($contentLength + $totalLength > $length) {\n\t\t\t\t$left = $length - $totalLength;\n\t\t\t\t$entitiesLength = 0;\n\t\t\t\tif (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE)) {\n\t\t\t\t\tforeach ($entities[0] as $entity) {\n\t\t\t\t\t\tif ($entity[1] + 1 - $entitiesLength <= $left) {\n\t\t\t\t\t\t\t$left--;\n\t\t\t\t\t\t\t$entitiesLength += mb_strlen($entity[0]);\n\t\t\t\t\t\t} else {\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\n\t\t\t\t$truncate .= mb_substr($tag[3], 0 , $left + $entitiesLength);\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t$truncate .= $tag[3];\n\t\t\t\t$totalLength += $contentLength;\n\t\t\t}\n\t\t\tif ($totalLength >= $length) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!$exact) {\n\t\t\t$spacepos = mb_strrpos($truncate, ' ');\n\t\t\t$truncateCheck = mb_substr($truncate, 0, $spacepos);\n\t\t\t$lastOpenTag = mb_strrpos($truncateCheck, '<');\n\t\t\t$lastCloseTag = mb_strrpos($truncateCheck, '>');\n\n\t\t\tif ($lastOpenTag > $lastCloseTag) {\n\t\t\t\tpreg_match_all('/<[\\w]+[^>]*>/s', $truncate, $lastTagMatches);\n\t\t\t\t$lastTag = array_pop($lastTagMatches[0]);\n\t\t\t\t$spacepos = mb_strrpos($truncate, $lastTag) + mb_strlen($lastTag);\n\t\t\t}\n\t\t\t$bits = mb_substr($truncate, $spacepos);\n\t\t\tpreg_match_all('/<\\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER);\n\n\t\t\tif (!empty($droppedTags)) {\n\t\t\t\tif (!empty($openTags)) {\n\t\t\t\t\tforeach ($droppedTags as $closingTag) {\n\t\t\t\t\t\tif (!in_array($closingTag[1], $openTags)) {\n\t\t\t\t\t\t\tarray_unshift($openTags, $closingTag[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tforeach ($droppedTags as $closingTag) {\n\t\t\t\t\t\tarray_push($openTags, $closingTag[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$truncate = mb_substr($truncate, 0, $spacepos);\n\t\t}\n\t\t$truncate .= $end;\n\n\t\tforeach ($openTags as $tag) {\n\t\t\t$truncate .= '</' . $tag . '>';\n\t\t}\n\t\treturn $truncate;\n\t}", "public function setEndTag($tag)\n {\n $this->endTag = $tag;\n }", "public function count() { \r\n\t\t\treturn $this->namedNodeMap->length;\r\n\t\t}", "protected function scanTag()\n {\n return $this->scanInput('/^((?:[a-z][a-z0-9]*))/', 'tag');\n }", "function get_a_href_count($file){\r\n $h1count = preg_match_all('/<(a.*) href=\\\"(.*?)\\\"(.*)<\\/a>/',$file,$patterns);\r\n return count($patterns[0]);\r\n}", "public function count(){\n try{\n $this->connect();\n $sql = \"SELECT tag_id FROM tags\";\n $statement = $this->db->prepare($sql);\n $statement->execute();\n $result = $statement->fetchAll(PDO::FETCH_ASSOC);\n $i=0;\n foreach ($result as $item){\n $i++;\n }\n return $i;\n }catch (\\PDOException $e){\n echo $e->getMessage();\n }\n }", "public function closeTag()\n {\n return '</span>';\n }", "private function _get_html_between( $attr, $value, $xml, $tag=null ) \r\n\t{\r\n\t\tif( is_null($tag) ){\r\n\t\t\t$tag = '\\w+';\r\n\t\t}else{\r\n\t\t\t$tag = preg_quote($tag);\r\n\t\t}\r\n\t\t$attr = preg_quote($attr);\r\n\t\t$value = preg_quote($value);\r\n\r\n\t\t//SEARCH TAG TARGET (IT WILL BREAK WITH FIRST CLOSE TAG)\r\n\t\t$tag_regex = \"/<(\".$tag.\")[^>]*\".$attr.\"\\s*=\\s*(['\\\"])\\[$value\\]\\\\2[^>]*>(.*?)(<\\/\\\\1>)/si\";\r\n\t\tpreg_match_all($tag_regex,\r\n\t\t\t\t\t $xml,\r\n\t\t\t\t\t $results,\r\n\t\t\t\t\t PREG_SET_ORDER);\r\n\t\t\t\t\t \r\n\t\tif(isset($results[0][1])){\r\n\t\t\t$check = count($results);\t// IF HAS MORE THAN ONE TAG MUST USE \\+w\r\n\t\t\tif($check == 1){\r\n\t\t\t\t$tag = $results[0][1];\t// SET IF ONE TAG NAME\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//GET CONTENT AGAIN WITH MULTI CLOSE TAG\r\n\t\t\t$multi_regex = '{<'.$tag.'[^>]*'.$attr.'=\"\\['.$value.'\\]\"[^>]*>((?:(?:(?!<'.$tag.'[^>]*>|<\\/'.$tag.'>).)++|<'.$tag.'[^>]*>(?1)<\\/'.$tag.'>)*)<\\/'.$tag.'>}si';\r\n\t\t\tpreg_match_all($multi_regex,\r\n\t\t\t\t\t\t $xml,\r\n\t\t\t\t\t\t $matches_result,\r\n\t\t\t\t\t\t PREG_SET_ORDER);\r\n\t\t\t/*\r\n\t\t\t// PREVIEW FOR TEST DATA NOT IN CONDITION\r\n\t\t\tif($check > 1){\r\n\t\t\t\techo '<h1>CHECK > 1 : </h1><pre>', htmlentities(print_r($results, true)),'</pre>';\r\n\t\t\t\techo '<h1>Result CHECK > 1 : TAG = '.$tag.'</h1>\r\n\t\t\t\t\t<pre>Pattern : <b>'.htmlentities($multi_regex).'</b><br/><br/>', htmlentities(print_r($matches_result, true)),'</pre>';\r\n\t\t\t}else{\r\n\t\t\t\techo '<h1>CHECK (1) : </h1><pre>', htmlentities(print_r($results, true)),'</pre>';\r\n\t\t\t\techo '<h1>Result CHECK (1) : TAG = '.$tag.'</h1>\r\n\t\t\t\t\t<pre>Pattern : <b>'.htmlentities($multi_regex).'</b><br/><br/>', htmlentities(print_r($matches_result, true)),'</pre>';\r\n\t\t\t}\r\n\t\t\t*/\r\n\t\t\t$results = $matches_result;\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n\t}", "function CloseTags($html) {\n\t$html = preg_replace('/<[^>]*$/', '', $html); // ending with fraction of open tag\n\t// put open tags into an array\n\tpreg_match_all('#<([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);\n\t$opentags = $result[1];\n\t// put all closed tags into an array\n\tpreg_match_all('#</([a-z]+)>#iU', $html, $result);\n\t$closetags = $result[1];\n\t$len_opened = count($opentags);\n\t// if all tags are closed, we can return\n\tif (count($closetags) == $len_opened) {\n\t\treturn $html;\n\t}\n\t// close tags in reverse order that they were opened\n\t$opentags = array_reverse($opentags);\n\t// self closing tags\n\t$sc = array('br', 'input', 'img', 'hr', 'meta', 'link');\n\t// ,'frame','iframe','param','area','base','basefont','col'\n\t// should not skip tags that can have content inside!\n\tfor ($i = 0; $i < $len_opened; $i++) {\n\t\t$ot = strtolower($opentags[$i]);\n\t\tif (!in_array($opentags[$i], $closetags) && !in_array($ot, $sc)) {\n\t\t\t$html .= '</' . $opentags[$i] . '>';\n\t\t} else {\n\t\t\tunset($closetags[array_search($opentags[$i], $closetags)]);\n\t\t}\n\t}\n\treturn $html;\n}", "function endTag($parser, $element) {\r\n echo \"<br />\";\r\n}", "protected static function parse_end(nodes\\Tag $node) {\n\t\t\n\t if($node->content[0] == '<') {\n\t $node->content = substr($node->content, 1);\n\t $node->trim_inner = true;\n\t }\n\t \n\t if($node->content[0] == '>') {\n\t $node->content = substr($node->content, 1);\n\t $node->trim_outer = true;\n\t $node->render_newline = false;\n\t if($node->previous_sibling())\n\t $node->previous_sibling()->render_newline = false;\n\t }\n\t\t\n\t\tif(in_array($node->tag_name, static::$parser->option('preserve')))\n\t\t\t$node->trim_inner = true;\n\t\t\n\t\tif($node->content[0] == '/') {\n\t\t\tif($node->content != '/')\n\t\t\t\t$node->exception('Parse error: self-closing tags cannot have content');\n\t\t\t\n\t\t\t$node->content = substr($node->content, 1);\n\t\t\t$node->self_closing = true;\n\t\t}\n\t\t\n\t\tif($node->content = trim($node->content)) {\n\t\t\t$text_node = new nodes\\Text();\n\t\t\t$text_node->set_from_parser(static::$parser);\n\t\t\t$text_node->root = $node->root;\n\t\t\t$text_node->parent = $node;\n\t\t\t$text_node->indent_level = 0;\n\t\t\t$text_node->content = $node->content;\n\t\t\tText::parse($text_node);\n\t\t\t\n\t\t\t$node->content = $text_node;\n\t\t}\n\t\t\n\t\tif($node->self_closing or $node->content)\n\t\t\tstatic::$parser->expect_indent(Parser::EXPECT_LESS | Parser::EXPECT_SAME);\n\t\t\n\t}", "function getTextBetweenTags($string, $tagname) {\n $pattern = \"/<$tagname ?.*>(.*)<\\/$tagname>/\";\n preg_match($pattern, $string, $matches);\n\n return $matches[1];\n}", "public function visitCharacterRangeEnd(IdmlCharacterRange $element, $depth = 0)\n {\n }", "public static function close_tags($html){\n\n \t#put all opened tags into an array\n \tpreg_match_all(\"#<([a-z]+)( .*)?(?!/)>#iU\",$html,$result);\n \t$openedtags=$result[1];\n\n \t#put all closed tags into an array\n \tpreg_match_all(\"#</([a-z]+)>#iU\",$html,$result);\n \t$closedtags=$result[1];\n \t$len_opened = count($openedtags);\n\n \t#all tags are closed\n \tif(count($closedtags) == $len_opened){\n \t\treturn $html;\n \t}\n \t$openedtags = array_reverse($openedtags);\n\n \t#close tags\n \tfor($i=0;$i < $len_opened;$i++) {\n \t\tif (!in_array($openedtags[$i],$closedtags)){\n \t\t\t$html .= '</'.$openedtags[$i].'>';\n \t\t} else {\n \t\t\tunset($closedtags[array_search($openedtags[$i],$closedtags)]);\n \t\t}\n \t}\n \treturn $html;\n }", "function CountNumPosts($search_string) {\n $sql = \"SELECT count(*) FROM \".GALLERY_POST_TABLE.\" T WHERE \".CreateSQLClauses($search_string).\";\";\n if (!sql_query_into($result, $sql, 1)) return -1; // Get 1 row containing the count.\n $row = $result->fetch_assoc();\n return $row['count(*)'];\n}", "function scrap_user_tl ($screen_name, $tags)\n{\n \n $pagina = get_CURL (\"https://twitter.com/\".$screen_name);\n $document = new DOMDocument;\n libxml_use_internal_errors(true);\n $document->loadHTML($pagina);\n $xpath = new DOMXPath($document);\n\n $tweets = $xpath->query(\"//p[@class='TweetTextSize TweetTextSize--16px js-tweet-text tweet-text']\");\n\n \n $cuenta = 0;\n\n foreach ($tweets as $tweet)\n {\n $string = $tweet->nodeValue;\n $largo = strlen ($string);\n foreach ($tags as $tag)\n {\n $posicion = strpos($string, $tag);\n if ($posicion)\n {\n $cuenta++;\n }\n }\n }\n \n \n return $cuenta;\n}", "public function endsWithReturnsTrueForMatchingLastPartDataProvider() {}", "function End_Tag($parser, $tag)\r\n\t{\r\n\t\tif ($tag == 'AMP') return;\r\n\t\telse if ($tag == 'BOX')\r\n\t\t{\r\n\t\t\t$objc = &$this->GetCurrentObject();\r\n\t\t\t$objd = &$this->GetDestinationObject();\r\n\t\t\t$objd->out .= $objc->Get();\r\n\t\t\tarray_pop($this->objs);\r\n\t\t}\r\n\t\telse if ($tag == 'BR') return;\r\n\t\telse if ($tag == 'COPY') return;\r\n\t\telse if ($tag == 'DOCTYPE') return;\r\n\t\telse if ($tag == 'IMG') return;\r\n\t\telse if ($tag == 'INCLUDE') return;\r\n\t\telse if ($tag == 'INPUT') return;\r\n\t\telse if ($tag == 'LINK') return;\r\n\t\telse if ($tag == 'META') return;\r\n\t\telse if ($tag == 'NBSP') return;\r\n\t\telse if ($tag == 'NULL') return;\r\n\t\telse if ($tag == 'PRESENT')\r\n\t\t{\r\n\t\t\t$objc = &$this->GetCurrentObject();\r\n\t\t\t$objd = &$this->GetDestinationObject();\r\n\t\t\t$objd->out .= $objc->Get($this->data);\r\n\t\t\tarray_pop($this->objs);\r\n\t\t}\r\n\t\telse if ($tag == 'XFORM')\r\n\t\t{\r\n\t\t\t$objc = &$this->GetCurrentObject();\r\n\t\t\t$objd = &$this->GetDestinationObject();\r\n\t\t\t$objd->out .= $objc->Get();\r\n\t\t\tarray_pop($this->objs);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$obj = &$this->GetCurrentObject();\r\n\t\t\t$obj->out .= '</'.strtolower($tag).'>';\r\n\t\t}\r\n\t}", "public function countBooks($tagId);", "public function countMatches($pat) {\r\n $num = preg_match_all($pat, $this->contents, $matches);\r\n //var_dump($matches); // debug patterns\r\n return $num;\r\n }", "public function getEnd(): int\n {\n return $this->end;\n }", "public function getTagObjectsSize() {\n if(isset($this->tags) && is_array($this->tags)) {\n return sizeof($this->tags);\n }\n return 0;\n }", "public static function subCount($haystack, $needle)\n {\n if (self::isMBString()) {\n return mb_substr_count($haystack, $needle, self::$encoding);\n } else {\n\n // @codeCoverageIgnoreStart\n return substr_count($haystack, $needle);\n // @codeCoverageIgnoreEnd\n }\n }", "public function isSelfClosingTag($tag)\n {\n return $tag === 'br' || $tag === 'img';\n }", "function getClosingTags(string $str): array\n{\n $closingTags = [];\n //update the pattern\n $pattern = \"/<\\/[A-Z]+>/\";\n preg_match_all($pattern, $str, $closingTags);\n $result = [];\n foreach ($closingTags as $cT) {\n foreach ($cT as $c) {\n $result[] = $c;\n }\n }\n return $result;\n}", "public function getTagsSize() {\n \t$user = GetUser();\n $query = \"SELECT COUNT(dct.tagid) AS tagsize FROM [|PREFIX|]dynamic_content_tags dct \";\n if (!$user->isAdmin()) {\n \t$query .= \" WHERE dct.ownerid = '{$user->Get('userid')}' \";\n }\n $result = $this->db->Query ( $query );\n if($row = $this->db->Fetch ( $result )) {\n return $row ['tagsize'];\n }\n return 0;\n }", "function route()\n\t{\n\t\tm2f_log::log(M2F_LOG_NORMAL, $this->class, 'countOCharacters_router', __LINE__, __FILE__); \n\t\treturn substr_count($this->message->body, 'o');\n\t}", "public function getGroupTagsCount()\r\n {\r\n $tmpGroup = new Warecorp_Group_Base();\r\n $EntityTypeId = $tmpGroup->EntityTypeId;\r\n $EntityTypeName = $tmpGroup->EntityTypeName;\r\n unset($tmpGroup);\r\n\r\n $group = Warecorp_Group_Factory::loadById($this->getGroupId());\r\n $members = $group->getMembers()->setAssocValue('zua.id')->returnAsAssoc()->getList();\r\n\r\n $query = $this->_db->select();\r\n $query->from(array('ztr' => 'zanby_tags__relations'), array());\r\n $query->joininner(array('ztd' => 'zanby_tags__dictionary'), 'ztr.tag_id = ztd.id', array(new Zend_Db_Expr('COUNT(DISTINCT ztd.id)')));\r\n\r\n if ( $this->getWhere() ) $query->where($this->getWhere());\r\n $query->where('entity_type_id = ?', $EntityTypeId);\r\n $query->where('entity_id = ?', $this->getGroupId());\r\n $query->where('ztr.status IN (?)', $this->getTagStatus());\r\n\r\n return $this->_db->fetchOne($query);\r\n }", "public function countMatches() : int\n {\n return sizeof($this->getMatches());\n }", "public function hasEnd(){\n return $this->_has(3);\n }", "public function hasEnd(){\n return $this->_has(3);\n }", "function everything_in_tags($string, $tagname)\n{\n $pattern = \"#<\\s*?$tagname\\b[^>]*>(.*?)</$tagname\\b[^>]*>#s\";\n preg_match($pattern, $string, $matches);\n return $matches[1];\n}", "public static function tag_remove_end() {\n\t//--\n\treturn '<!-- PDF REMOVE END -->';\n\t//--\n}", "protected function parseEnd()\n {\n return ($end = $this->matchChar(';')) ? $end : $this->peekChar('}');\n }", "public function countPages() {\n\t\t$splitContent = explode(\"<!-- pagebreak -->\", $this->content);\t\t\n\t\treturn count($splitContent);\n\t}", "public function endsWithReturnsFalseForNotMatchingLastPartDataProvider() {}", "protected function get_descendents_count()\n\t{\n\t\t$n = 0;\n\n\t\tforeach ($this->children as $child)\n\t\t{\n\t\t\t$n += 1 + $child->descendents_count;\n\t\t}\n\n\t\treturn $n;\n\t}", "function close_tag($tag, $pref, $nl)\n{\n tag($tag, 'close', $pref, $nl) ;\n}", "public function exitRemainingTags()\n {\n while (count($this->stack) > 0) {\n $this->handler->endTag(\n new ParsedTag(array_pop($this->stack))\n );\n }\n }", "public function getCount() {\n\treturn $this->parseQuery->getCount()->count;\n }", "public function getImageCount( $text )\n\t{\n\t\t$count = 0;\n\t\tpreg_match_all( '#<img([^>]+?)?>#i', $text, $matches );\n\t\t\n\t\tforeach( $matches[1] as $id => $match )\n\t\t{\n\t\t\tif ( ! stristr( $match, 'class=\"bbc_emoticon\"' ) )\n\t\t\t{\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $count;\n\t}", "function count_vowel($str)\n{\n\t$vowels = 0;\n\t$j = strlen($str);\n\tfor($i=0;$i<$j;$i++)\n\t{\n\t\tif(strstr('aeiouAEIOU',$str[$i]))\n\t\t{\n\t\t\t$vowels++;\n\t\t}\t\n\t}\n\treturn $vowels;\n}", "public function testCountPostByTags()\n {\n \n $this->call('Post', '/post', [\n 'title' => 'Php Unit test',\n 'body' => 'Php unit test body',\n 'tag' => 'phpunit,test'\n ]);\n \n $this->call('Get', '/post/count/phpunit,test');\n $this->seeHeader('content-type', 'application/json');\n $this->seeStatusCode(200);\n }", "public static function getFooterTags(): string {\n if (self::$tests) {\n return '';\n }\n\n return self::$footer['before'].self::$footer['after'].self::$footer['end'];\n }", "public function getEndLine(): int\n {\n return $this->node->getAttribute('endLine');\n }", "public final function endTag() : string\n {\n return $this->name && !$this->isEmpty ? '</' . $this->name . '>' : '';\n }", "function parseBody($tagname)\r\n\t{\r\n\t\t$output = '';\r\n\t\twhile ($this->reader->hasMoreInput())\r\n\t\t{\r\n\t\t\tif ($this->reader->matchesEndTag($tagname))\r\n\t\t\t{\r\n\t\t\t\treturn $output;\r\n\t\t\t}\r\n\r\n\t\t\t$output .= $this->parseElements();\r\n\t\t}\r\n\r\n\t\t// @todo throw error, never found end tag, where???\r\n\t}" ]
[ "0.6153505", "0.6100045", "0.5897448", "0.56500417", "0.5627371", "0.56252545", "0.5604992", "0.55921704", "0.5576082", "0.55704784", "0.5552491", "0.55463517", "0.55150074", "0.54925627", "0.5488568", "0.54668665", "0.54638547", "0.535061", "0.52996016", "0.5292882", "0.5276339", "0.52660775", "0.525877", "0.5234066", "0.5178955", "0.5163042", "0.5160951", "0.5138172", "0.5134345", "0.51285625", "0.5102588", "0.5101084", "0.5095579", "0.50934374", "0.5061333", "0.50488967", "0.5033838", "0.50140303", "0.50004226", "0.49815762", "0.49773115", "0.49736926", "0.49689847", "0.49583647", "0.49514297", "0.49416664", "0.49374795", "0.4914835", "0.4912629", "0.49022883", "0.4901405", "0.4901405", "0.4901405", "0.48967588", "0.48944262", "0.48894465", "0.48770353", "0.486679", "0.4862147", "0.4861212", "0.48557866", "0.48554283", "0.4843397", "0.48411292", "0.4826136", "0.48230705", "0.48224604", "0.48193634", "0.48137194", "0.48117176", "0.4809036", "0.47938436", "0.47925657", "0.47881928", "0.47829753", "0.47727752", "0.47697902", "0.4769357", "0.47571585", "0.47475517", "0.47468197", "0.47449267", "0.47446063", "0.47446063", "0.47407353", "0.47407073", "0.4727254", "0.4724298", "0.47167817", "0.4701515", "0.46990418", "0.46912664", "0.4669193", "0.4668582", "0.466484", "0.46519542", "0.46477196", "0.46434703", "0.46258292", "0.4625605" ]
0.802068
0
Count the offset until the tag indicated
public static function count_until_tag(string $string, string &$tagName, int &$nWords): int { $result = self::countUntilTag($string); $tagName = $result['tagMatch']; $nWords = $result['words']; return $result['offset'] + $result['tagMatchLength']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _findStartOffset() {}", "public function getStartOffset() {}", "function offset_pos(){\n\t // $this->count_uri();\n\n\t \tif(isset($this->uri_array['osp']))\n\t\t{\n\t \t\t//ops without and with offset page value\n\t \t\tif(count($this->uri_array['osp'])==1){\n\t \t\t\t$pos = $this->count_uri()+1;\n\t \t\t}else{\n\t\t\t\t$segment_array = $this->uri->segment_array();\n\t\t\t\t$pos = array_search(RAPYD_URI_OSP,$segment_array)+1;\n\t \t\t}\n\t \t}\n\n\t \t/*****************************************************************************\n\t \t * We take care of this case even if we have added it in explode_uri for more\n\t \t * security in URI reading\n\t \t *****************************************************************************/\n\t \telse{\n\t \t\t$pos = $this->count_uri()+2;\n\t \t}\n\t\treturn $pos;\n\t}", "function countTags ($sheet, $records, $col) {\n\t\t$records += 2;\n\t\t$tagcount = 0;\n\t\tfor ($i = 2; $i < $records; $i++) {\n\t\t\t$temp = $sheet->getcell($col.$i);\n\t\t\tif ($temp == \"\") $tagcount += 1;\t\t\t\n\t\t}\n\t\t$tagcount = $records - 2 - $tagcount;\n\t\treturn $tagcount;\n\t}", "public function getOffset(): int;", "protected function get_offset(): int\n\t{\n\t\treturn $this->start;\n\t}", "function endTag($parser, $data){\n global $ind;\n if($data == \"WORD\"){\n $ind++;\n }\n}", "public function preceding(int $offset): mixed;", "public function indexInTag() {\n if ($this->_m_indexInTag !== null)\n return $this->_m_indexInTag;\n $this->_m_indexInTag = ($this->tag() - 32);\n return $this->_m_indexInTag;\n }", "function getOffset() ;", "public function needsIncrementOffset();", "public function getOffset() {}", "public function getOffset() {}", "public function getOffset() {}", "public function getOffsetStart()\n\t{\n\t\treturn $this->start + 1;\n\t}", "public function getOffset();", "public function getOffset();", "public function getOffset();", "public function getElementCounter() {}", "function rd_kafka_offset_tail(int $cnt): int\n{\n\n}", "function get_pdf_offset($reference)\n{\n\t$offset = 0;\n\t\n\tif (preg_match('/[#|\\?]page=(?<offset>-?\\d+)$/', $reference->pdf, $m))\n\t{\n\t\t$offset = $m['offset'];\n\t}\n\t\n\treturn $offset;\n}", "private function getOffset()\n {\n $this->current_offset = null;\n \n $headers = $this->getHead();\n \n if (isset($headers['Offset']) === true) {\n $this->current_offset = $headers['Offset'];\n }\n \n return $this->current_offset;\n }", "public function getLength($atOffset = false) {}", "public function getOffset()\r\n {\r\n return ( $this->_pageno - 1 ) * $this->_size;\r\n }", "public function get_offset() {\n\t\treturn ( $this->step - 1 ) * $this->per_step;\n\t}", "public function getOffsetEnd()\n\t{\n\t\treturn $this->start + count($this->entities);\n\t}", "public function element_start_position(){\n return ($this->amount_per_page * $this->current_page) - $this->amount_per_page;\n }", "public static function countUntilTag(string $string): array {\n\t\t$matches = [];\n\t\tif (!preg_match('/<(\\/?' . self::RE_TAG_NAME . ')' . self::RE_ATTRIBUTES . '(\\/?)>/', $string, $matches, PREG_OFFSET_CAPTURE)) {\n\t\t\treturn [];\n\t\t}\n\n\t\t//\t\tdump($matches);\n\t\t[$tagMatch, $offset] = array_shift($matches);\n\t\t[$tagName] = array_shift($matches);\n\t\t[$tagClose] = array_shift($matches);\n\n\t\t$tagContents = $tagName . $tagClose;\n\n\t\t$nWords = Text::countWords(substr($string, 0, $offset));\n\t\t$tagMatchLength = strlen($tagMatch);\n\t\treturn [\n\t\t\t'offset' => $offset, 'next' => $offset + $tagMatchLength, 'tagMatchLength' => $tagMatchLength,\n\t\t\t'tagMatch' => $tagMatch, 'words' => $nWords, 'tagContents' => $tagContents, 'tagName' => $tagName,\n\t\t];\n\t}", "public function getLength($atOffset = false);", "private function tailOffset(): int\n {\n if ($this->count < self::BRANCH_FACTOR) {\n return 0;\n }\n\n return $this->count - count($this->tail);\n }", "public function get_offset()\n {\n }", "public function moveTagFromEndToTheMiddle() {}", "protected static function getLineNumbersStart($openingTag) {\n\t\t$start = 1;\n\t\tif (!empty($openingTag['attributes'][0])) {\n\t\t\t$start = intval($openingTag['attributes'][0]);\n\t\t\tif ($start < 1) $start = 1;\n\t\t}\n\t\t\n\t\treturn $start;\n\t}", "public function getOffset(): int\n {\n return $this->offset;\n }", "private function offset()\n {\n if(is_array($this->limite)): $this->limite=$this->limite['limite']; endif;\n\t$offset = ($this->paginaAtual() - 1) * $this->limite;\n\treturn $offset;\n }", "function renumberTagTableOffset($baseOffset) {\n $baseSize = 2 + count($this->tagTable) * (2+2+4+4);\n $extendOffset = $baseOffset + $baseSize;\n $extendSize = 0;\n foreach ($this->tagTable as $tag) {\n ;\n } \n //\n $this->baseOffset = $baseOffset;\n $this->baseSize = $baseSize;\n $this->extendOffset = $extendOffset;\n $this->baseSize = $baseSize;\n }", "private function findOffset()\n {\n $this->seek(0);\n\n $offset = 0;\n\n while (!$this->isEndOfFile()) {\n if (strtolower($this->read(1)) === self::$sequence[$offset]) {\n $offset++;\n } else {\n $offset = 0;\n }\n\n if (!isset(self::$sequence[$offset + 1])) {\n break;\n }\n }\n\n $this->seek(1, SEEK_CUR);\n\n if ($offset === (count(self::$sequence) - 1)) {\n $position = $this->getPosition();\n\n if (\"\\r\\n\" === $this->read(2)) {\n return $position + 2;\n }\n\n return $position;\n }\n\n return null;\n }", "private function getOffsetPaginacao()\n {\n if (!isset($this->filtros['pagina']) || !is_numeric($this->filtros['pagina'])) {\n return 0;\n }\n\n return (int)($this->filtros['pagina'] * $this->getLengthPaginacao()) - $this->getLengthPaginacao();\n }", "private function calculateOffset() {\n $this->offset = ($this->currentpage - 1) * $this->limit;\n }", "public function getStartIndex();", "public function offset(){\n\t\t//Page 1 has an offset of 0 (1-1) * 20\n\t\t//Page 2 has an offset of 20 (2-1) * 20\n\t\t//in other words, page 2 starts with item 21\n\t\treturn ($this->current_page - 1) * $this->per_page;\t\n\t}", "public static function countEndTags(string $tag, string $contents): int {\n\t\t$matches = [];\n\t\tif (preg_match_all('|</\\s*' . strtolower($tag) . '\\s*>|im', $contents, $matches, PREG_SET_ORDER)) {\n\t\t\treturn count($matches);\n\t\t}\n\t\treturn 0;\n\t}", "public function getOffset() { return $this->_offset; }", "function mOFFSET(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$OFFSET;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:191:3: ( 'offset' ) \n // Tokenizer11.g:192:3: 'offset' \n {\n $this->matchString(\"offset\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "protected final function getAfterOffset ($match) {\n\t\treturn $match[1] + strlen($match[0]);\n\t}", "function compareTagsByCount($current, $next) {\n\t\tif ($current['count'] == $next['count']) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn ($current['count'] < $next['count']) ? -1 : 1;\n\t}", "protected function getOffset(): int\n {\n return ($this->page - 1) * $this->limitPerPage;\n }", "protected function _seekTable($tag) {}", "public function getOffset() {\n return $this->offset;\n }", "public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }", "public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }", "public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }", "public function countNextSiblings();", "public function skip($offset = 0);", "protected function findRowEnd($offset)\n {\n return strpos($this->tempDocumentMainPart, '</w:tr>', $offset) + 7;\n }", "function incrementHeaderTags($totalHeaderTags = 20)\n {\n $filter = '(';\n for ($i = 1; $i <= $totalHeaderTags; $i++) {\n $filter .= '//h' . $i . '|';\n }\n $filter = trim($filter, '|') . ')';\n \n $elements = $this->xpath->query($filter);\n foreach ($elements as $index => $element) {\n $tag = $element->tagName;\n $tagValue = filter_var($tag, FILTER_SANITIZE_NUMBER_INT);\n $tagValue++;\n $tag = 'h'.$tagValue;\n $this->domRenameElement($element, $tag);\n }\n }", "function pushOffset() {\n log::trace(\"Path offset pushed\");\n $this->sectionOffset++;\n $this->pageOffset++;\n }", "public function element_end_position(){\n if($this->number_of_pages() == $this->current_page){\n return $this->total_amount - 1;\n }\n else{\n return $this->element_start_position() + $this->amount_per_page - 1;\n }\n }", "public function getOffset(): int\n {\n return $this->pageIndex * $this->pageSize;\n }", "public function getCoveredElements(): ?int;", "public function getOffset($value);", "public function getOffsets() {}", "public function countPrevSiblings();", "public function offsetClause(){\n try {\n // Sparql11query.g:171:3: ( OFFSET INTEGER ) \n // Sparql11query.g:172:3: OFFSET INTEGER \n {\n $this->match($this->input,$this->getToken('OFFSET'),self::$FOLLOW_OFFSET_in_offsetClause612); \n $this->match($this->input,$this->getToken('INTEGER'),self::$FOLLOW_INTEGER_in_offsetClause614); \n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function labelLength($pointer) {\r\n $oldPointer = $pointer;\r\n \r\n // See how many uncompressed bytes to next end of label/pointer\r\n while(($this->dnsResponse[$pointer] != chr(0)) &&\r\n (ord($this->dnsResponse[$pointer]) < 192)) {\r\n $pointer++;\r\n }\r\n // If pointer include next ocet as well\r\n if(ord($this->dnsResponse[$pointer]) >= 192) {\r\n $pointer++; \r\n }\r\n // Count the ocet we are reading\r\n $pointer++;\r\n return $pointer - $oldPointer;\r\n }", "public function nextLandmark()\n\t\t{\n\t\t\t#current location\n\t\t\t$count = 0;\n\t\t\tforeach ($this->_locations as $local) {\n\t\t\t\tif($this->_distance < $local->_distance)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $count;\n\t\t\t\t\t}\n\t\t\t\t\t$count +=1;\n\t\t\t\t}\n\t\t}", "public function getCount()\r\n {\r\n\t\tif (defined(\"WITH_SPHINX_TAGS\") && WITH_SPHINX_TAGS)\r\n\t\t{\r\n\t\t\t$count = parent::getCount();\r\n\t\t} else {\r\n\t\t\t$count = $this->getGroupTagsCount() +\r\n\t\t\t\t$this->getMembersTagsCount() +\r\n\t\t\t\t$this->getDocumentsTagsCount() +\r\n\t\t\t\t$this->getEventsTagsCount() +\r\n\t\t\t\t$this->getPhotosTagsCount() +\r\n\t\t\t\t$this->getListsTagsCount();\r\n\t\t}\r\n return (int) $count;\r\n }", "public function getDataOffset() : int{\n return $this->dataOffset;\n }", "private function _findRowEnd($offset)\n {\n $rowEnd = strpos($this->_documentXML, \"</w:tr>\", $offset) + 7;\n return $rowEnd;\n }", "protected function nodePositionFromStart($node, $byType = false): int\n\t{\n\t\t$i = 1;\n\t\t$tag = $node->tagName;\n\t\twhile (isset($node->previousSibling)) {\n\t\t\t$node = $node->previousSibling;\n\t\t\tif ($node->nodeType === XML_ELEMENT_NODE && ( ! $byType || $node->tagName === $tag)) {\n\t\t\t\t++$i;\n\t\t\t}\n\t\t}\n\n\t\treturn $i;\n\t}", "public function getNextTag($dump_type = 0 /*myFlvHandler::GET_NEXT_TAG_META*/)\n\t{\n\t\t$start_pos = $this->pos;\n\t\t$data = @fread($this->fh, 12);\n\t\tif (!strlen($data))\n\t\t\treturn null;\n\t\t\t\n\t\t$temp_data = $data[0].\"\\0\".substr($data,1, 3).$data[7].substr($data,4, 3).$data[11];\n\t\t\n\t\t$res = unpack(\"Ca/Nb/Nc/Cd\", $temp_data);\n\t\t$size = $res['b'] + self::TAG_WRAPPER_SIZE;\n\t\t\n\t\t$this->pos += $size;\n\t\t\n\t\tif ($dump_type == myFlvHandler::GET_NEXT_TAG_META)\n\t\t\t$data = null;\n\t\telse\n\t\t{\n\t\t\t$data = $data.fread($this->fh, $size - 12);\n\t\t\n\t\t\tif ($dump_type == myFlvHandler::GET_NEXT_TAG_DATA) // return actual tag\n\t\t\t\treturn $data;\n\t\t}\n\t\t\n\t\tfseek($this->fh, $this->pos, SEEK_SET);\n\t\t\n\t\t// type, size, timestamp, keyframe, start_pos, [data]\n\t\treturn array($res['a'], $size, $res['c'], ($res['d'] & 0xF0) == 0x10, $start_pos, $data);\n\t}", "public function count($tag)\n {\n return $this->connection()->zcard($tag);\n }", "function skip($count);", "public function count(){\n try{\n $this->connect();\n $sql = \"SELECT tag_id FROM tags\";\n $statement = $this->db->prepare($sql);\n $statement->execute();\n $result = $statement->fetchAll(PDO::FETCH_ASSOC);\n $i=0;\n foreach ($result as $item){\n $i++;\n }\n return $i;\n }catch (\\PDOException $e){\n echo $e->getMessage();\n }\n }", "public function getPageNumber();", "public function getPageNumber();", "function extract_count($data) {\n return ($data == NULL || is_int($data)) ? $data : current(current($data));\n }", "public function currentStartCount(){\n\t\t$multiplier = $this->paged- 1;\n\t\treturn $multiplier * $this->posts_per_page;\n\t}", "public function getCaptionOffset() {}", "abstract public function dataSeek(int $n = 0);", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getStart(): int;", "public function getOffset() {\n return ($this->getCurrentPage() - 1) * $this->getItemCountPerPage();\n }", "private function getOffset($limit='unset') \n { \n if ($limit != 'unset'){return ($this->getCurrentPage() - 1 ) * $this->getLimitPerPage($limit);}\n\t else {return ( $this->getCurrentPage() - 1 ) * $this->getLimitPerPage(); } \n \n }", "public function getOffset()\n {\n return ($this->number_of_items_per_page * $this->current_page) - $this->number_of_items_per_page;\n }", "public static function countOffset($page, $limit)\r\n\t{\r\n\t\tif($page < 1)\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn ($page-1) * $limit;\r\n\t}", "protected function getNextMarker(&$i, &$sofStartRead)\n\t{\n\t\t$this->skipStartPadding($i, $sofStartRead);\n\n\t\tdo {\n\t\t\tif ($i >= $this->dataLength)\n\t\t\t{\n\t\t\t\treturn self::JPEG_EOI_MARKER;\n\t\t\t}\n\t\t\t$marker = $this->data[$i];\n\t\t\t$i++;\n\t\t} while ($marker == self::SOF_START_MARKER);\n\n\t\treturn $marker;\n\t}", "public function getCaretOffset() {}", "function scrap_user_tl ($screen_name, $tags)\n{\n \n $pagina = get_CURL (\"https://twitter.com/\".$screen_name);\n $document = new DOMDocument;\n libxml_use_internal_errors(true);\n $document->loadHTML($pagina);\n $xpath = new DOMXPath($document);\n\n $tweets = $xpath->query(\"//p[@class='TweetTextSize TweetTextSize--16px js-tweet-text tweet-text']\");\n\n \n $cuenta = 0;\n\n foreach ($tweets as $tweet)\n {\n $string = $tweet->nodeValue;\n $largo = strlen ($string);\n foreach ($tags as $tag)\n {\n $posicion = strpos($string, $tag);\n if ($posicion)\n {\n $cuenta++;\n }\n }\n }\n \n \n return $cuenta;\n}", "private function getFileCount()\n {\n $this->seek($this->offset + 4);\n\n return $this->readLong();\n }", "public function getPageNumber() {}", "public function getPageNumber() {}", "public function get_offset(){\r\n return $this->$new_offset;\r\n }", "function getOffset() {\n return $this->offset;\n }" ]
[ "0.6571799", "0.63094324", "0.6212464", "0.5998826", "0.5920728", "0.5913247", "0.59104073", "0.5906511", "0.5826707", "0.5812679", "0.570277", "0.56299293", "0.56299293", "0.56299293", "0.5593855", "0.55527985", "0.55527985", "0.55527985", "0.55469865", "0.5542902", "0.55380917", "0.55290985", "0.54978764", "0.546553", "0.54619294", "0.54586166", "0.54544455", "0.5444689", "0.54257363", "0.54165214", "0.54152334", "0.5395376", "0.5381617", "0.5371242", "0.53691745", "0.5364285", "0.5348182", "0.5334337", "0.5310364", "0.5280294", "0.5265967", "0.5261192", "0.5258084", "0.52530116", "0.52171636", "0.5210333", "0.52099895", "0.52047485", "0.5203516", "0.5184717", "0.5184717", "0.5184717", "0.5173429", "0.5164588", "0.51626253", "0.51497024", "0.5144957", "0.51301026", "0.51252335", "0.5116153", "0.51139057", "0.51096135", "0.5108697", "0.50977427", "0.50970906", "0.50950813", "0.509005", "0.50781506", "0.5059183", "0.50587106", "0.5057506", "0.5054347", "0.5052835", "0.5045706", "0.5041507", "0.5041507", "0.5035105", "0.5031931", "0.5030759", "0.50279033", "0.50152975", "0.50152975", "0.50152975", "0.50152975", "0.50152975", "0.50152975", "0.50152975", "0.50106466", "0.50086683", "0.5007935", "0.5007894", "0.5007149", "0.49864674", "0.49856392", "0.49833447", "0.4973916", "0.49514696", "0.49514696", "0.4945432", "0.49354786" ]
0.60333896
3
Count the offset until the tag indicated. Returns the following attributes: int offset number of characters until the tag int tagMatchLength size of match int next offset + tagMatchLength offset to next section of HTML to parse string tagMatch matched tag int words words found until the tag string tagContents everything inside the of that tag
public static function countUntilTag(string $string): array { $matches = []; if (!preg_match('/<(\/?' . self::RE_TAG_NAME . ')' . self::RE_ATTRIBUTES . '(\/?)>/', $string, $matches, PREG_OFFSET_CAPTURE)) { return []; } // dump($matches); [$tagMatch, $offset] = array_shift($matches); [$tagName] = array_shift($matches); [$tagClose] = array_shift($matches); $tagContents = $tagName . $tagClose; $nWords = Text::countWords(substr($string, 0, $offset)); $tagMatchLength = strlen($tagMatch); return [ 'offset' => $offset, 'next' => $offset + $tagMatchLength, 'tagMatchLength' => $tagMatchLength, 'tagMatch' => $tagMatch, 'words' => $nWords, 'tagContents' => $tagContents, 'tagName' => $tagName, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function match(int $offset): ?array\n {\n $result = null;\n\n if (\n $offset < $this->length\n && preg_match('{<!--|<(/?)([\\w\\-:\\x80-\\xFF]+)|<[!?/]}', $this->html, $match, PREG_OFFSET_CAPTURE, $offset)\n ) {\n if ($match[0][0] === '<!--') {\n // comment\n $offset = $match[0][1] + 3;\n\n if (($end = strpos($this->html, '-->', $offset)) !== false) {\n $result = [\n 'type' => static::COMMENT,\n 'start' => $match[0][1],\n 'end' => $end + 3,\n ];\n }\n } elseif (isset($match[1])) {\n // opening or closing tag\n $offset = $match[0][1] + strlen($match[0][0]);\n [$attrs, $offset] = $this->matchAttributes($offset);\n preg_match('{\\s*/?>}A', $this->html, $endMatch, 0, $offset);\n\n $isClosingTag = $match[1][0] === '/';\n\n $result = [\n 'type' => $isClosingTag ? static::CLOSING_TAG : static::OPENING_TAG,\n 'start' => $match[0][1],\n 'end' => $offset + ($endMatch ? strlen($endMatch[0]) : 0),\n 'name' => $this->normalizeIdentifier($match[2][0]),\n ];\n\n if (!$isClosingTag) {\n $result['attrs'] = $attrs;\n }\n } else {\n // other\n $offset = $match[0][1] + 2;\n $end = strpos($this->html, '>', $offset);\n\n $result = $end !== false\n ? [\n 'type' => static::OTHER,\n 'symbol' => $match[0][0][1],\n 'start' => $match[0][1],\n 'end' => $end + 1,\n ]\n : [\n 'type' => static::INVALID,\n 'start' => $match[0][1],\n 'end' => $match[0][1] + 2,\n ];\n }\n }\n\n return $result;\n }", "public static function count_until_tag(string $string, string &$tagName, int &$nWords): int {\n\t\t$result = self::countUntilTag($string);\n\t\t$tagName = $result['tagMatch'];\n\t\t$nWords = $result['words'];\n\t\treturn $result['offset'] + $result['tagMatchLength'];\n\t}", "public function getNextMatch()\n {\n return new Xml\\Match\\Chunk($this->getXml('NextMatch'));\n }", "public function indexInTag() {\n if ($this->_m_indexInTag !== null)\n return $this->_m_indexInTag;\n $this->_m_indexInTag = ($this->tag() - 32);\n return $this->_m_indexInTag;\n }", "public static function countEndTags(string $tag, string $contents): int {\n\t\t$matches = [];\n\t\tif (preg_match_all('|</\\s*' . strtolower($tag) . '\\s*>|im', $contents, $matches, PREG_SET_ORDER)) {\n\t\t\treturn count($matches);\n\t\t}\n\t\treturn 0;\n\t}", "public static function substr(string $html, int $offset = 0, int $length = null): string {\n\t\t$matches = false;\n\t\tif (!preg_match_all('/(<[A-Za-z0-9:_]+\\s*[^>]*>|<\\/[A-Za-z0-9:_]+>)/', $html, $matches, PREG_OFFSET_CAPTURE)) {\n\t\t\t$length = $length === null ? strlen($html) : $length;\n\t\t\treturn substr($html, $offset, $length);\n\t\t}\n\t\t$stack = [];\n\t\t$text_offset = 0;\n\t\t$html_offset = 0;\n\t\t$result = '';\n\t\tforeach ($matches[0] as $match) {\n\t\t\t[$tag, $tag_offset] = $match;\n\t\t\tif ($tag_offset > $html_offset) {\n\t\t\t\t$add_chars = $tag_offset - $html_offset;\n\t\t\t\tif ($text_offset + $add_chars > $length) {\n\t\t\t\t\t$add_chars = $length - $text_offset;\n\t\t\t\t\t$result .= substr($html, $html_offset, $add_chars);\n\t\t\t\t\t// $html_offset += $add_chars;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t$result .= substr($html, $html_offset, $add_chars);\n\t\t\t\t\t$html_offset += $add_chars;\n\t\t\t\t\t$text_offset += $add_chars;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$html_offset += strlen($tag);\n\t\t\t$end_tag = self::isEndTag($tag);\n\t\t\tif ($end_tag) {\n\t\t\t\twhile (count($stack) > 0) {\n\t\t\t\t\t$stack_top = array_pop($stack);\n\t\t\t\t\tif ($stack_top === $end_tag) {\n\t\t\t\t\t\t$result .= $tag;\n\t\t\t\t\t\t$tag = false;\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result .= \"<$end_tag><!-- Inserted missing start tag --></$end_tag>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($tag) {\n\t\t\t\t\t$result .= \"<$end_tag><!-- Inserted missing start tag --></$end_tag>\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$result .= $tag;\n\t\t\t\t$tags = self::parseTags($tag);\n\t\t\t\tforeach (array_keys($tags) as $start_tag) {\n\t\t\t\t\t$stack[] = $start_tag;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twhile (count($stack) > 0) {\n\t\t\t$end_tag = array_pop($stack);\n\t\t\t$result .= \"</$end_tag>\";\n\t\t}\n\t\treturn $result;\n\t}", "private function _get_html_between( $attr, $value, $xml, $tag=null ) \r\n\t{\r\n\t\tif( is_null($tag) ){\r\n\t\t\t$tag = '\\w+';\r\n\t\t}else{\r\n\t\t\t$tag = preg_quote($tag);\r\n\t\t}\r\n\t\t$attr = preg_quote($attr);\r\n\t\t$value = preg_quote($value);\r\n\r\n\t\t//SEARCH TAG TARGET (IT WILL BREAK WITH FIRST CLOSE TAG)\r\n\t\t$tag_regex = \"/<(\".$tag.\")[^>]*\".$attr.\"\\s*=\\s*(['\\\"])\\[$value\\]\\\\2[^>]*>(.*?)(<\\/\\\\1>)/si\";\r\n\t\tpreg_match_all($tag_regex,\r\n\t\t\t\t\t $xml,\r\n\t\t\t\t\t $results,\r\n\t\t\t\t\t PREG_SET_ORDER);\r\n\t\t\t\t\t \r\n\t\tif(isset($results[0][1])){\r\n\t\t\t$check = count($results);\t// IF HAS MORE THAN ONE TAG MUST USE \\+w\r\n\t\t\tif($check == 1){\r\n\t\t\t\t$tag = $results[0][1];\t// SET IF ONE TAG NAME\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//GET CONTENT AGAIN WITH MULTI CLOSE TAG\r\n\t\t\t$multi_regex = '{<'.$tag.'[^>]*'.$attr.'=\"\\['.$value.'\\]\"[^>]*>((?:(?:(?!<'.$tag.'[^>]*>|<\\/'.$tag.'>).)++|<'.$tag.'[^>]*>(?1)<\\/'.$tag.'>)*)<\\/'.$tag.'>}si';\r\n\t\t\tpreg_match_all($multi_regex,\r\n\t\t\t\t\t\t $xml,\r\n\t\t\t\t\t\t $matches_result,\r\n\t\t\t\t\t\t PREG_SET_ORDER);\r\n\t\t\t/*\r\n\t\t\t// PREVIEW FOR TEST DATA NOT IN CONDITION\r\n\t\t\tif($check > 1){\r\n\t\t\t\techo '<h1>CHECK > 1 : </h1><pre>', htmlentities(print_r($results, true)),'</pre>';\r\n\t\t\t\techo '<h1>Result CHECK > 1 : TAG = '.$tag.'</h1>\r\n\t\t\t\t\t<pre>Pattern : <b>'.htmlentities($multi_regex).'</b><br/><br/>', htmlentities(print_r($matches_result, true)),'</pre>';\r\n\t\t\t}else{\r\n\t\t\t\techo '<h1>CHECK (1) : </h1><pre>', htmlentities(print_r($results, true)),'</pre>';\r\n\t\t\t\techo '<h1>Result CHECK (1) : TAG = '.$tag.'</h1>\r\n\t\t\t\t\t<pre>Pattern : <b>'.htmlentities($multi_regex).'</b><br/><br/>', htmlentities(print_r($matches_result, true)),'</pre>';\r\n\t\t\t}\r\n\t\t\t*/\r\n\t\t\t$results = $matches_result;\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n\t}", "public function extractMergeTagsPlaceHolders()\n {\n $pattern = '/' . preg_quote(static::TAG_PREFIX) .\n '((WAS' . preg_quote(static::TIME_DELIMITER) . ')?' .\n '(([A-Z0-9])' . '(' . preg_quote(static::CAPITAL_DELIMITER) . '|' .\n preg_quote(static::PROPERTY_DELIMITER) . ')?)+)' . // Not Coding Standard\n preg_quote(static::TAG_SUFFIX) .\n '/';\n // $this->mergeTags index 0 = with tag prefix and suffix, index 1 = without tag prefix and suffix\n $matchesCounts = preg_match_all($pattern, $this->content, $this->mergeTags);\n array_walk($this->mergeTags, 'static::resolveUniqueMergeTags');\n return $matchesCounts;\n }", "protected function _findStartOffset() {}", "public function getMatchOffset()\n {\n return $this->getOption('matchoffset');\n }", "function endTag($parser, $data){\n global $ind;\n if($data == \"WORD\"){\n $ind++;\n }\n}", "private function matchAttributes(int $offset): array\n {\n $attrs = [];\n\n while (\n $offset >= 0\n && $offset < $this->length\n && preg_match('{\\s*([^\\x00-\\x20\"\\'>/=]+)}A', $this->html, $match, 0, $offset)\n ) {\n $name = $match[1];\n $value = true;\n $offset += strlen($match[0]);\n\n // parse value\n if (preg_match('{\\s*=\\s*}A', $this->html, $match, 0, $offset)) {\n $offset += strlen($match[0]);\n\n if ($offset < $this->length) {\n if ($this->html[$offset] === '\"' || $this->html[$offset] === '\\'') {\n // quoted\n if (preg_match('{\"([^\"]*+)\"|\\'([^\\']*+)\\'}A', $this->html, $match, 0, $offset)) {\n $value = $match[2] ?? $match[1];\n $offset += strlen($match[0]);\n }\n } elseif (preg_match('{[^\\s\"\\'=<>`]++}A', $this->html, $match, 0, $offset)) {\n // unquoted\n $value = $match[0];\n $offset += strlen($match[0]);\n }\n }\n }\n\n $attrs[$this->normalizeIdentifier($name)] = $value;\n }\n\n return [$attrs, $offset];\n }", "public function getStartOffset() {}", "public function getTagPositions( $txt, $tag, $brackets=array('[',']') )\n\t{\n\t\t$close_tag = $brackets[0] . '/' . $tag . $brackets[1];\n\t\t$open_tag = $brackets[0] . $tag;\n\t\t$map = array();\n\t\t$iteration = 0;\n\t\n\t\t/* Pick through bit of code */\n\t\twhile( ( $curPos = stripos( $txt, $open_tag, $curPos ) ) !== false )\n\t\t{\n\t\t\tif ( $iteration > 1000 )\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t/* Make sure the next character is either ] = or a space */\n\t\t\t$nextChar = substr( $txt, $curPos + strlen( $tag ) + 1, 1 );\n\t\t\t\t\n\t\t\tif ( $nextChar != $brackets[1] && $nextChar != '=' && $nextChar != ' ' )\n\t\t\t{\n\t\t\t\tif ( $curPos > strlen($txt) )\n\t\t\t\t{\n\t\t\t\t\t$curPos\t= 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$curPos++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$map['openWithTag'][ $iteration ] = $curPos;\n\t\t\t$map['open'][ $iteration ] = $curPos + strlen( $open_tag );\n\t\t\t\t\n\t\t\t$new_pos = stripos( $txt, $brackets[1], $curPos ) ? stripos( $txt, $brackets[1], $curPos ) : $curPos + 1;\n\t\t\t\t\n\t\t\t/* Got an option, grab that */\n\t\t\t$_option = substr( $txt, $curPos + strlen($open_tag), (stripos( $txt, $brackets[1], $curPos ) - ($curPos + strlen($open_tag) )) );\n\t\t\t\n\t\t\t$map['open'][ $iteration ] += intval( strlen( $_option ) ) + 1;\n\t\t\t\n\t\t\t/* Got a closing tag? */\n\t\t\t$closingTagPos = stripos( $txt, $close_tag, $new_pos );\n\t\t\t\t\n\t\t\tif ( $closingTagPos !== false )\n\t\t\t{\n\t\t\t\t$map['close'][ $iteration ] = $closingTagPos;\n\t\t\t\t$map['closeWithTag'][ $iteration ] = $closingTagPos + strlen( $close_tag );\n\t\t\t\t\n\t\t\t\t/* What content do we believe we have between the opening and closing tags? */\n\t\t\t\t$_content = substr( $txt, ($curPos + strlen( $open_tag ) + strlen($_option) + 1), ($closingTagPos - ($curPos + strlen($open_tag) + strlen($_option) + 1)) );\n\n\t\t\t\t/* Did we have an opening tag in that mess? */\n\t\t\t\tif ( $_content && stristr( $_content, $open_tag ) )\n\t\t\t\t{\n\t\t\t\t\t/* How many opening tags did we find...probably just 1 */\n\t\t\t\t\t$count = substr_count( strtolower( $_content ), strtolower( $open_tag) );\n\n\t\t\t\t\t/* Found N opening tags in portion of text */\n\t\t\t\t\tif ( $count > 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t/* So now find Nth closing tag */\n\t\t\t\t\t\t$_nPos = $closingTagPos + strlen( $close_tag );\n\n\t\t\t\t\t\t/* While we have opening tags to inspect... */\n\t\t\t\t\t\twhile( $count > 0 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_closePos = stripos( $txt, $close_tag, $_nPos );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( $_closePos !== false )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$map['close'][ $iteration ] = $_closePos;\n\t\t\t\t\t\t\t\t$map['closeWithTag'][ $iteration ] = $_closePos + strlen( $close_tag );\n\n\t\t\t\t\t\t\t\t$_content\t= substr( $txt, ($curPos + strlen( $open_tag ) + strlen($_option) + 1), ($_closePos - ($curPos + strlen($open_tag) + strlen($_option) + 1)) );\n\t\t\t\t\t\t\t\t$count\t\t= substr_count( strtolower( $_content ), strtolower( $open_tag ) );\n\t\t\t\t\t\t\t\t$ccount\t\t= substr_count( strtolower( $_content ), strtolower( $close_tag ) );\n\n\t\t\t\t\t\t\t\tif( $count == $ccount )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$count\t= 0;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$_nPos = $_closePos + strlen( $close_tag );\n\t\n\t\t\t\t\t\t\t\tif ( $_nPos >= strlen( $txt ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$count == 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$count\t= 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t$iteration++;\n\t\t\t\t\n\t\t\t$curPos = $closingTagPos ? $closingTagPos : $curPos + 1;\n\t\n\t\t\tif ( $curPos > strlen($txt) )\n\t\t\t{\n\t\t\t\t$curPos\t= 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\n\t\treturn $map;\n\t}", "public function getLength($atOffset = false);", "function get_a_content($file){\r\n $h1count = preg_match_all(\"/(<a.*>)(\\w.*)(<.*>)/ismU\",$file,$patterns);\r\n return $patterns[2];\r\n}", "public function getLength($atOffset = false) {}", "function get_a_additionaltags($file){\r\n $h1count = preg_match_all('/<(a.*) href=\"(.*?)\"(.*)>(.*)(<\\/a>)/',$file,$patterns);\r\n return $patterns[3];\r\n}", "private function processAttrs(){\n\n\t\t$start = strlen($this->tag)+1;\n\t\t$temp = substr($this->raw,$start);\n\n\t\t//echo $temp . \"\\n\";\n\n\t\t$i=0;\n\t\tfor(; $i < strlen($temp); ){\n\t\t\tif($temp[$i] == '>') break;\n\t\t\t\t\n\t\t\t$pos = $this->skipWs($temp, $i);\n\t\t\t\t\n\t\t\t//echo \"should be r-{$temp[$pos]}\\n\";\n\t\t\t\t\n\t\t\t$pos2 = $this->skipToEqualOrWs($temp, $pos);\n\t\t\t\t\n\t\t\t//echo \"should be =-{$temp[$pos2]}\\n\";\n\t\t\t\t\n\t\t\t$attr = trim(substr($temp, $pos, $pos2 - $pos));\n\t\t\t\t\n\t\t\t//echo \"Got attribute-$attr\\n\";\n\t\t\t\t\n\t\t\tif(!empty($attr) && $pos2 < strlen($temp) && $temp[$pos2] == '='){\n\n\t\t\t\t//skip =\n\t\t\t\t$pos2++;\n\n\t\t\t\t$pos = $this->skipWs($temp, $pos2); //should be ' or \"\n\n\t\t\t\tif($temp[$pos] != '\"' && $temp[$pos] != \"'\"){\n\t\t\t\t\t//echo \"FAILED-{$temp[$pos]}\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$pos++; //skip the ' or \"\n\n\t\t\t\t$pos2 = $this->skipToQuote($temp, $pos, $temp[$pos-1]);\n\n\t\t\t\t$val = trim(substr($temp, $pos, $pos2-$pos),'\\'\"');\n\n\t\t\t\t$pos2++; //get past ' or \"\n\n\t\t\t\t$this->attributes[$attr] = $val;\n\n\t\t\t\t//echo \"$attr:$val\\n\";\n\t\t\t}\n\t\t\t$i = $pos2;\n\t\t}\n\t\t$this->textStart = $i+$start+1;\n\t}", "public function lenLiteralM1InTag() {\n if ($this->_m_lenLiteralM1InTag !== null)\n return $this->_m_lenLiteralM1InTag;\n if (!($this->isLenLiteralSeparate())) {\n $this->_m_lenLiteralM1InTag = ($this->tag() & 15);\n }\n return $this->_m_lenLiteralM1InTag;\n }", "function scrap_user_tl ($screen_name, $tags)\n{\n \n $pagina = get_CURL (\"https://twitter.com/\".$screen_name);\n $document = new DOMDocument;\n libxml_use_internal_errors(true);\n $document->loadHTML($pagina);\n $xpath = new DOMXPath($document);\n\n $tweets = $xpath->query(\"//p[@class='TweetTextSize TweetTextSize--16px js-tweet-text tweet-text']\");\n\n \n $cuenta = 0;\n\n foreach ($tweets as $tweet)\n {\n $string = $tweet->nodeValue;\n $largo = strlen ($string);\n foreach ($tags as $tag)\n {\n $posicion = strpos($string, $tag);\n if ($posicion)\n {\n $cuenta++;\n }\n }\n }\n \n \n return $cuenta;\n}", "protected static function getLineNumbersStart($openingTag) {\n\t\t$start = 1;\n\t\tif (!empty($openingTag['attributes'][0])) {\n\t\t\t$start = intval($openingTag['attributes'][0]);\n\t\t\tif ($start < 1) $start = 1;\n\t\t}\n\t\t\n\t\treturn $start;\n\t}", "private function numberOfOpenElements($searchTag, $enclosingTag)\n {\n $pageElements = $this->pageElements;\n $elementIndex = count($pageElements) -1;\n $numOpenElems = 0;\n $searchLen = strlen($searchTag) + 2; // length of '<' plus tagname plus space\n $enclosingLen = strlen($enclosingTag) + 2; // length of '<' plus tagname plus space\n\n // Loop through the elements, last to first, tracking opening and closing spans.\n // Loop terminates when the enclosing tag is found--no open search tags should exist beyond there\n // --or when the beginning of the page element array is reached (see use case in comment block above).\n while ($elementIndex >= 0 && substr($pageElements[$elementIndex][0],0,$enclosingLen) != '<' . $enclosingTag . ' ')\n {\n // When getting the tag, add a space before the closing '>'. That way, '<span>' will get a space inside the tag,\n // We can then determine the tag name by finding the substring up to the first space.\n $tag = str_replace('>', ' >', $pageElements[$elementIndex][0]);\n\n if (substr($tag, 0, $searchLen) == '<' . $searchTag . ' ')\n {\n $numOpenElems++;\n }\n\n if (substr($tag, 0, $searchLen+1) == '</' . $searchTag . ' ')\n {\n $numOpenElems--;\n }\n\n $elementIndex--;\n }\n\n // If $numOpenElems < 0, it means there are unmatched *closing* elements, which is an error\n if ($numOpenElems < 0)\n {\n throw new Exception('You have an unmatched closing ' . $searchTag . ' on page ' . $this->pageNumber);\n }\n\n return $numOpenElems;\n }", "function offset_pos(){\n\t // $this->count_uri();\n\n\t \tif(isset($this->uri_array['osp']))\n\t\t{\n\t \t\t//ops without and with offset page value\n\t \t\tif(count($this->uri_array['osp'])==1){\n\t \t\t\t$pos = $this->count_uri()+1;\n\t \t\t}else{\n\t\t\t\t$segment_array = $this->uri->segment_array();\n\t\t\t\t$pos = array_search(RAPYD_URI_OSP,$segment_array)+1;\n\t \t\t}\n\t \t}\n\n\t \t/*****************************************************************************\n\t \t * We take care of this case even if we have added it in explode_uri for more\n\t \t * security in URI reading\n\t \t *****************************************************************************/\n\t \telse{\n\t \t\t$pos = $this->count_uri()+2;\n\t \t}\n\t\treturn $pos;\n\t}", "protected final function getAfterOffset ($match) {\n\t\treturn $match[1] + strlen($match[0]);\n\t}", "public function getLastMatch()\n {\n return new Xml\\Match\\Chunk($this->getXml('LastMatch'));\n }", "function countTags ($sheet, $records, $col) {\n\t\t$records += 2;\n\t\t$tagcount = 0;\n\t\tfor ($i = 2; $i < $records; $i++) {\n\t\t\t$temp = $sheet->getcell($col.$i);\n\t\t\tif ($temp == \"\") $tagcount += 1;\t\t\t\n\t\t}\n\t\t$tagcount = $records - 2 - $tagcount;\n\t\treturn $tagcount;\n\t}", "private function findOffset()\n {\n $this->seek(0);\n\n $offset = 0;\n\n while (!$this->isEndOfFile()) {\n if (strtolower($this->read(1)) === self::$sequence[$offset]) {\n $offset++;\n } else {\n $offset = 0;\n }\n\n if (!isset(self::$sequence[$offset + 1])) {\n break;\n }\n }\n\n $this->seek(1, SEEK_CUR);\n\n if ($offset === (count(self::$sequence) - 1)) {\n $position = $this->getPosition();\n\n if (\"\\r\\n\" === $this->read(2)) {\n return $position + 2;\n }\n\n return $position;\n }\n\n return null;\n }", "function non_DOM_stripme($opening_tag_string) {\r\n\t\tpreg_match_all('/' . $opening_tag_string . '/is', $this->code, $matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\t//print(\"matches[0][size][0]: \");var_dump($matches[0][$size][0]);\r\n\t\t\tpreg_match('/<(\\w+)/is', $matches[0][$size][0], $tagname_matches);\r\n\t\t\t$tagname = $tagname_matches[1];\r\n\t\t\t$OString = OM::getOString($this->code, '<' . $tagname, '</' . $tagname . '>', $matches[0][$size][1]);\r\n\t\t\t//print(\"strlen(matches[0][size][0]): \");var_dump(strlen($matches[0][$size][0]));\r\n\t\t\t$substr = substr($OString, strlen($matches[0][$size][0]), strlen($OString) - strlen($matches[0][$size][0]) - (strlen($tagname) + 3));\r\n\t\t\t//print(\"OString: \");var_dump($OString);\r\n\t\t\t//print(\"substr: \");var_dump($substr);\r\n\t\t\t//$this->code = str_replace($OString, $substr, $this->code);\r\n\t\t\t$this->code = substr($this->code, 0, $matches[0][$size][1]) . $substr . substr($this->code, $matches[0][$size][1] + strlen($OString));\r\n\t\t\t$size--;\r\n\t\t}\r\n\t}", "public static function getValidOuterTagPositions($string, $tag)\n {\n $ret = false;\n if (preg_match_all('!(?:<' . $tag . '[^>]*>)|(?:</' . $tag . '>)!i', $string, $m, PREG_OFFSET_CAPTURE | PREG_PATTERN_ORDER)) {\n $nbTotalValidTags = 0;\n $ret = [];\n /**\n * - 0: index\n * - 1: type=open|close\n */\n $stack = [];\n $endTagLength = strlen($tag) + 3;\n foreach ($m[0] as $info) {\n list($tag, $pos) = $info;\n $type = ('</' === substr($tag, 0, 2)) ? 'close' : 'open';\n if ('open' === $type) {\n $stack[] = [$pos, $type];\n }\n else {\n $addToStack = true;\n $n = count($stack);\n if (isset($stack[$n - 1])) {\n $prevType = $stack[$n - 1][1];\n if ('open' === $prevType) {\n $prevPos = $stack[$n - 1][0];\n $addToStack = false;\n $ret[] = [\n $prevPos,\n $pos + $endTagLength,\n ];\n // remove the previous opening tag\n array_pop($stack);\n $nbTotalValidTags++;\n }\n }\n if (true === $addToStack) {\n $stack[] = [$pos, $type];\n }\n }\n }\n\n // now we need to filter out children, so that we only have outer tags left.\n // first let's sort by the opening tag index\n usort($ret, function ($a, $b) {\n return ($a[0] > $b[0]);\n });\n\n $parent = null;\n foreach ($ret as $k => $p) {\n $changeParent = true;\n if (null !== $parent) {\n if ($parent[0] < $p[0] && $parent[1] > $p[1]) {\n unset($ret[$k]);\n $changeParent = false;\n }\n }\n if (true === $changeParent) {\n $parent = $p;\n }\n }\n $ret = array_merge($ret);\n\n if ($nbTotalValidTags < 1) {\n $ret = false;\n }\n }\n return $ret;\n }", "function _quail_server_count_nodes($html) {\n\treturn substr_count($html, '<');\n}", "function get_pdf_offset($reference)\n{\n\t$offset = 0;\n\t\n\tif (preg_match('/[#|\\?]page=(?<offset>-?\\d+)$/', $reference->pdf, $m))\n\t{\n\t\t$offset = $m['offset'];\n\t}\n\t\n\treturn $offset;\n}", "protected function scanTag()\n {\n return $this->scanInput('/^((?:[a-z][a-z0-9]*))/', 'tag');\n }", "private function getOffset()\n {\n $this->current_offset = null;\n \n $headers = $this->getHead();\n \n if (isset($headers['Offset']) === true) {\n $this->current_offset = $headers['Offset'];\n }\n \n return $this->current_offset;\n }", "function get_meta_content($file){\r\n $h1count = preg_match_all('/(<meta)(.*=\"(.*)\").\\/>/ix',$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "public function getNextTag($dump_type = 0 /*myFlvHandler::GET_NEXT_TAG_META*/)\n\t{\n\t\t$start_pos = $this->pos;\n\t\t$data = @fread($this->fh, 12);\n\t\tif (!strlen($data))\n\t\t\treturn null;\n\t\t\t\n\t\t$temp_data = $data[0].\"\\0\".substr($data,1, 3).$data[7].substr($data,4, 3).$data[11];\n\t\t\n\t\t$res = unpack(\"Ca/Nb/Nc/Cd\", $temp_data);\n\t\t$size = $res['b'] + self::TAG_WRAPPER_SIZE;\n\t\t\n\t\t$this->pos += $size;\n\t\t\n\t\tif ($dump_type == myFlvHandler::GET_NEXT_TAG_META)\n\t\t\t$data = null;\n\t\telse\n\t\t{\n\t\t\t$data = $data.fread($this->fh, $size - 12);\n\t\t\n\t\t\tif ($dump_type == myFlvHandler::GET_NEXT_TAG_DATA) // return actual tag\n\t\t\t\treturn $data;\n\t\t}\n\t\t\n\t\tfseek($this->fh, $this->pos, SEEK_SET);\n\t\t\n\t\t// type, size, timestamp, keyframe, start_pos, [data]\n\t\treturn array($res['a'], $size, $res['c'], ($res['d'] & 0xF0) == 0x10, $start_pos, $data);\n\t}", "public function getCount()\r\n {\r\n\t\tif (defined(\"WITH_SPHINX_TAGS\") && WITH_SPHINX_TAGS)\r\n\t\t{\r\n\t\t\t$count = parent::getCount();\r\n\t\t} else {\r\n\t\t\t$count = $this->getGroupTagsCount() +\r\n\t\t\t\t$this->getMembersTagsCount() +\r\n\t\t\t\t$this->getDocumentsTagsCount() +\r\n\t\t\t\t$this->getEventsTagsCount() +\r\n\t\t\t\t$this->getPhotosTagsCount() +\r\n\t\t\t\t$this->getListsTagsCount();\r\n\t\t}\r\n return (int) $count;\r\n }", "function get_p($file){\r\n $h1tags = preg_match_all(\"/(<p.*>)(\\w.*)(<\\/p>)/ismU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "public function offsetClause(){\n try {\n // Sparql11query.g:171:3: ( OFFSET INTEGER ) \n // Sparql11query.g:172:3: OFFSET INTEGER \n {\n $this->match($this->input,$this->getToken('OFFSET'),self::$FOLLOW_OFFSET_in_offsetClause612); \n $this->match($this->input,$this->getToken('INTEGER'),self::$FOLLOW_INTEGER_in_offsetClause614); \n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function find($tag);", "public function getElementTextLength();", "protected function _parseDescTag() {}", "public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }", "public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }", "public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }", "public function moveTagFromEndToTheMiddle() {}", "public function element_start_position(){\n return ($this->amount_per_page * $this->current_page) - $this->amount_per_page;\n }", "function get_a_href_count($file){\r\n $h1count = preg_match_all('/<(a.*) href=\\\"(.*?)\\\"(.*)<\\/a>/',$file,$patterns);\r\n return count($patterns[0]);\r\n}", "protected function findRange($Tag, $Range, $Tag2 = NULL, $Clean = TRUE, $StartAt = 1)\n {\n $this->log(__LINE__, '[parser] findRange()', [$Tag, $Range, $Tag2, $Clean, $StartAt]);\n\n $Found = false;\n $Found2 = false;\n $Interates = 0;\n $Array = NULL;\n\n // If range null\n if (!$Range) { $Range = 9999; }\n\n // Search for element\n foreach($this->SourceCodeArray as $Line)\n {\n // Trim line\n $Line = trim($Line);\n\n // Search line, mark found\n if(stripos($Line, $Tag) !== false) { $Found = true; }\n if(stripos($Line, $Tag2) !== false) { $Found2 = true; }\n\n if ($Found)\n {\n // Iterate\n $Interates++;\n\n // Check if we reached the StartAt value\n if($Interates < $StartAt)\n {\n $Found = false;\n $Found2 = false;\n continue;\n }\n\n // If clean true, clean line!\n if ($Clean) { $Array[] = $this->Clean(strip_tags(html_entity_decode($Line))); } else { $Array[] = $Line; }\n\n // If iterate hits range, break.\n if ($Interates == $Range || $Found2) { break; }\n }\n }\n\n // Remove empty values\n $Array = isset($Array) ? array_values(array_filter($Array)) : NULL;\n\n // Return array, else false.\n if ($Array)\n return $Array;\n else\n return false;\n }", "protected function get_offset(): int\n\t{\n\t\treturn $this->start;\n\t}", "function get_h6($file){\r\n $h1tags = preg_match_all(\"/(<h6.*>)(\\w.*)(<\\/h6>)/ismU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "public function getOffset()\n {\n if (! isset($this->offset)) {\n $this->offset = (int)$this->getXPath($this->getDom())->query($this->getOffsetQuery())->item(0)->value;\n }\n return $this->offset;\n }", "private function processContent(){\n\t\t$this->textEnd = strpos($this->raw,\"</{$this->tag}\");\n\t\t$this->text = trim(substr($this->raw, $this->textStart, $this->textEnd - $this->textStart));\n\t}", "public function getExtractAttribute()\n {\n return substr(strip_tags($this->content), 0, 255);\n }", "function wordParser($record, $showAll, $currcharcount, $hideuntil): int\n{\n return word_parser($record, $showAll, $currcharcount, $hideuntil);\n}", "function get_h4($file){\r\n $h1tags = preg_match_all(\"/(<h4.*>)(\\w.*)(<\\/h4>)/ismU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "public function countMatches($pat) {\r\n $num = preg_match_all($pat, $this->contents, $matches);\r\n //var_dump($matches); // debug patterns\r\n return $num;\r\n }", "public function getOpeningTag() {\n return $this->openingTag;\n }", "function get_ul($file){\r\n $h1count = preg_match_all('/(<ul \\w*>)(.*)(<\\/ul>)/ismxU',$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "public function getAttributeCount();", "function getNodePositions() {\n if (!$this->prepared) {\n $this->__prepare($this->struct[0], true);\n $this->prepared = true;\n }\n \n $data = $this->__nodePosition($this->struct[0]['childs'][0], 0, 0, $this->struct[0]['childs'][0]['attrib']['NODEHEIGHT']);\n return $data;\n }", "function clean_redundant_sufficient_inline() {\r\n\t\t// dirty generator (word). the point is it cannot be done on <span>s since they are not inherently sufficient for a sort of styling (and perhaps that is why this was overlooked).\r\n\t\t// notice also that this only treats simple cases (tags without attributes) of which there may be a fair number.\r\n\t\t// this array is ordered so that tag names that are substrings of other tag names are done last (b)\r\n\t\t$sufficient_inlines = array('big', 'small', 'em', 'strong', 'sub', 'sup', 'strike', 'blink', 'i', 'b', 'u');\r\n\t\tforeach($sufficient_inlines as $sufficient_inline) {\r\n\t\t\t$opening_part = '<' . $sufficient_inline;\r\n\t\t\t$closing_part = '</' . $sufficient_inline . '>';\r\n\t\t\t$strlen_opening_part = strlen($opening_part);\r\n\t\t\t$strlen_closing_part = strlen($closing_part);\r\n\t\t\t$OStrings = OM::getAllOstrings($this->code, $opening_part, $closing_part);\r\n\t\t\t$index = sizeof($OStrings) - 1;\r\n\t\t\twhile($index > -1) {\r\n\t\t\t\t$OString = $OStrings[$index][0];\r\n\t\t\t\t//print('$OString: ');var_dump($OString);\r\n\t\t\t\tif($OString[strlen($opening_part)] !== ' ' && $OString[strlen($opening_part)] !== '>') { // then we are catching the wrong tag\r\n\t\t\t\t\t//print('wrong $OString: ');var_dump($OString);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$offset = $OStrings[$index][1];\r\n\t\t\t\t\t$initial_substr = $substr = substr($OString, $strlen_opening_part, strlen($OString) - $strlen_opening_part - $strlen_closing_part);\r\n\t\t\t\t\t$substr = str_replace('<' . $sufficient_inline . '>', '', $substr, $count1);\r\n\t\t\t\t\t$substr = str_replace($closing_part, '', $substr, $count2);\r\n\t\t\t\t\tif($count1 > 0 || $count2 > 0 && $count1 === $count2) {\r\n\t\t\t\t\t\t$cleaned_OString = $opening_part . $substr . $closing_part;\r\n\t\t\t\t\t\t//$this->code = substr($this->code, 0, $offset) . $cleaned_OString . substr($this->code, $offset + strlen($OString));\r\n\t\t\t\t\t\t$this->code = str_replace($OString, $cleaned_OString, $this->code);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$index--;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function extractMarkerLength($i)\n\t{\n\t\t// Extract length only\n\t\tlist(, $unpacked) = unpack(\"H*\", substr($this->data, $i, self::LONG_SIZE));\n\n\t\t// Get width and height from unpacked size info\n\t\t$markerLength = hexdec(substr($unpacked, 0, 4));\n\n\t\treturn $markerLength;\n\t}", "function get_h5($file){\r\n $h1tags = preg_match_all(\"/(<h5.*>)(\\w.*)(<\\/h5>)/ismU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "public function getOffsetStart()\n\t{\n\t\treturn $this->start + 1;\n\t}", "function parse_tags($tags, &$open, &$close)\n{\n\t$len = mb_strlen($tags);\n\tif ($len === 0)\n\t\treturn false;\n\t$b = 0;\t// kazdy tag se muze na radku vyskytnout jen jednou\n\t$i = 0;\n\t$u = 0;\n\t$tt = 0;\n\t$sz = 0;\n\t$txt = 0;\n\twhile ($len !== 0)\n\t{\n\t\t$len = mb_strlen($tags);\n\t\tif ($len >= 4 && $b == 0 && mb_substr($tags, 0, 4) === \"bold\")\t// tag bold\n\t\t{\n\t\t\t$b++;\n\t\t\t$open = $open . \"<b>\";\n\t\t\t$close = \"</b>\" . $close;\n\t\t\tif ($len == 4)\t\t// tag je posledni\n\t\t\t\treturn true;\n\t\t\t$tags = mb_substr($tags, 4);\n\t\t\t$len = mb_strlen($tags);\n\t\t\t\n\t\t\tif (!remove_space($tags))\n\t\t\t\treturn false;\n\t\t}\n\t\telse if ($len >= 6 && $sz == 0 && mb_substr($tags, 0, 5) === \"size:\" && mb_substr($tags, 5, 1) >= \"1\" && mb_substr($tags, 5, 1) <= \"7\")\t// tag size\n\t\t{\n\t\t\t$sz++;\n\t\t\t$open = $open . \"<font size=\" . mb_substr($tags, 5, 1) . \">\";\n\t\t\t$close = \"</font>\" . $close;\n\t\t\tif ($len == 6)\t\t// tag je posledni\n\t\t\t\treturn true;\n\t\t\t$tags = mb_substr($tags, 6);\n\t\t\t$len = mb_strlen($tags);\n\t\t\t\n\t\t\tif (!remove_space($tags))\n\t\t\t\treturn false;\n\t\t}\n\t\telse if ($len >= 6 && $i == 0 && mb_substr($tags, 0, 6) === \"italic\")\t// tag italic\n\t\t{\n\t\t\t$i++;\n\t\t\t$open = $open . \"<i>\";\n\t\t\t$close = \"</i>\" . $close;\n\t\t\tif ($len == 6)\t\t// tag je posledni\n\t\t\t\treturn true;\n\t\t\t$tags = mb_substr($tags, 6);\n\t\t\t$len = mb_strlen($tags);\n\t\t\t\n\t\t\tif (!remove_space($tags))\n\t\t\t\treturn false;\n\t\t}\n\t\telse if ($len >= 8 && $tt == 0 && mb_substr($tags, 0, 8) === \"teletype\")\t// tag teletype\n\t\t{\n\t\t\t$tt++;\n\t\t\t$open = $open . \"<tt>\";\n\t\t\t$close = \"</tt>\" . $close;\n\t\t\tif ($len == 8)\t\t// tag je posledni\n\t\t\t\treturn true;\n\t\t\t$tags = mb_substr($tags, 8);\n\t\t\t$len = mb_strlen($tags);\n\t\t\t\n\t\t\tif (!remove_space($tags))\n\t\t\t\treturn false;\n\t\t}\n\t\telse if ($len >= 9 && $u == 0 && mb_substr($tags, 0, 9) === \"underline\")\t// tag underline\n\t\t{\n\t\t\t$u++;\n\t\t\t$open = $open . \"<u>\";\n\t\t\t$close = \"</u>\" . $close;\n\t\t\tif ($len == 9)\t\t// tag je posledni\n\t\t\t\treturn true;\n\t\t\t$tags = mb_substr($tags, 9);\n\t\t\t$len = mb_strlen($tags);\n\t\t\t\n\t\t\tif (!remove_space($tags))\n\t\t\t\treturn false;\n\t\t}\n\t\telse if ($len >= 12 && $txt == 0 && mb_substr($tags, 0, 6) === \"color:\")\t// tag color\n\t\t{\n\t\t\t$txt++;\n\t\t\tif (preg_match(\"~[a-fA-F0-9]{6}~\", mb_substr($tags, 6, 6)) === 0)\t// overeni formatu barvy\n\t\t\t{\n\t\t\t\tfwrite(STDERR, \"CHYBA: spatny format formatovaciho souboru!\\n\");\n\t\t\t\texit (4);\n\t\t\t}\n\t\t\t$open = $open . \"<font color=#\" . mb_substr($tags, 6, 6) . \">\";\n\t\t\t$close = \"</font>\" . $close;\n\t\t\tif ($len === 12)\t\t// tag je posledni\n\t\t\t\treturn true;\n\t\t\t$tags = mb_substr($tags, 12);\n\t\t\t$len = mb_strlen($tags);\n\t\t\t\n\t\t\tif (!remove_space($tags))\n\t\t\t\treturn false;\n\t\t}\n\t\telse\t// tag neodpovida zadne moznosti\n\t\t\treturn false;\n\t}\n}", "public function count() { \r\n\t\t\treturn $this->namedNodeMap->length;\r\n\t\t}", "function util_textContent($in_haystack, $in_tag)\r\n{\r\n\t$innerstring = util_innerString($in_haystack, \"<{$in_tag} \", \"</{$in_tag}>\", FALSE);\r\n\tif ($innerstring) {\r\n\t\treturn substr($innerstring, (strpos($innerstring, '>') + 1));\r\n\t} else {\r\n\t\treturn util_innerString($in_haystack, \"<{$in_tag}>\", \"</{$in_tag}>\", FALSE);\r\n\t}\r\n}", "public function calculatePosition($text, $charactersCount);", "protected function scanAttributes()\n {\n if ($this->page[0] === '(' ) {\n $token = $this->takeToken('attributes', '');\n $token->attributes = array();\n //pass '('\n $this->next('ATTRIBUTE');\n\n do {\n $attr = $this->next('ATTRIBUTE');\n if ($attr[0] == '') {\n //TODO Error reporting\n return null;\n }\n $attr = array_values(preg_grep('/^.+$/', $attr));\n\n if (isset($attr[1]) && isset($attr[2])) {\n $token->attributes[$attr[1]] = $attr[2];\n } elseif (isset($attr[1]) && $attr[1] != ',' && $attr[1] != ')') {\n $token->attributes[$attr[1]] = '\"'.$attr[1].'\"';\n }\n } while ($attr[1] != ')');\n\n return $token;\n }\n }", "function split_inline() {\r\n\t\t// it is worth considering whether to split attributes from blocks also.\r\n\t\t// since inline tags are always in a block it may be unnecessary... because we do not need to worry about combining blocks.\r\n\t\t$array_replacesI = array();\r\n\t\t$entity = DTD::getInline();\r\n\t\t$entity = str_replace('img|', '', $entity); // exclude images...\r\n\t\t$entity = str_replace('br|', '', $entity); // exclude line breaks...\r\n\t\t//print('$entity: ');var_dump($entity);\r\n\t\t$arrayNonDTDInline = array('u', 'b', 'i', 'strike', 'blink');\r\n\t\t$entity .= \"|\" . implode(\"|\", $arrayNonDTDInline);\r\n\t\tpreg_match_all('/<(' . $entity . ')[\\s>]/is', $this->code, $inlineMatches, PREG_OFFSET_CAPTURE);\r\n\t\tforeach($inlineMatches[0] as $index => $value) {\r\n\t\t\t$tagName = $inlineMatches[1][$index][0];\r\n\t\t\t$offset = $value[1];\r\n\t\t\t$attributes_string = substr($this->code, $offset+strlen($tagName)+1, strpos($this->code, \">\", $offset)-($offset+strlen($tagName)+1));\r\n\t\t\t$opening_string = '<' . $tagName;\r\n\t\t\t$opening_string_with_attributes = '<' . $tagName . $attributes_string . '>';\r\n\t\t\t$closing_string = '</' . $tagName . '>';\r\n\t\t\t$objectString = OM::getOString($this->code, $opening_string, $closing_string, $offset);\r\n\t\t\tif($objectString === false) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach($array_replacesI as $index => $value) {\r\n\t\t\t\tif($value[0] === $objectString) {\r\n\t\t\t\t\tcontinue 2;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tpreg_match_all('/ [\\w:]+=\"[^\"]*\"/is', $attributes_string, $attribute_matches);\r\n\t\t\tif($tagName === \"span\") {\r\n\t\t\t\t$new_opening = '';\r\n\t\t\t\t$new_closing = '';\r\n\t\t\t\tforeach($attribute_matches[0] as $index2 => $value2) {\r\n\t\t\t\t\tif(strpos($value2, ' style=\"') === 0) { // in addition to splitting attributes, split the styles in this attribute\r\n\t\t\t\t\t\t$styles_string = substr($value2, 8, strlen($value2)-9);\r\n\t\t\t\t\t\t$styles_array = OM::explode_non_nested(\";\", $styles_string, \"{\", \"}\");\r\n\t\t\t\t\t\tforeach($styles_array as $style) {\r\n\t\t\t\t\t\t\tif(strlen($style) > 0) { // for the possible last ; in a style attribute.\r\n\t\t\t\t\t\t\t\t$new_opening .= '<span style=\"' . ReTidy::cleanStyle($style) . '\">';\r\n\t\t\t\t\t\t\t\t$new_closing = '</span>' . $new_closing;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t\t} elseif(strpos($value2, ' class=\"') === 0) { // in addition to splitting attributes, split the classes in this attribute\r\n\t\t\t\t\t\t$classes_string = trim(substr($value2, 8, strlen($value2)-9));\r\n\t\t\t\t\t\t$classes_array = explode(\" \", $classes_string);\r\n\t\t\t\t\t\tforeach($classes_array as $class) {\r\n\t\t\t\t\t\t\t$new_opening .= '<span class=\"' . $class . '\">';\r\n\t\t\t\t\t\t\t$new_closing = '</span>' . $new_closing;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$new_opening .= '<span' . $value2 . '>';\r\n\t\t\t\t\t\t$new_closing = '</span>' . $new_closing;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t// exclude <a> tags? except for styling. consider whether this is appropriate for all tags (because this function \r\n\t\t\t// may only be used in preparation for combine_inline.\r\n\t\t\telseif($tagName === \"a\") {\r\n\t\t\t\t$kept_attributes_string = \"\";\r\n\t\t\t\t$found_styling = false;\r\n\t\t\t\t$new_opening = '';\r\n\t\t\t\t$new_closing = '';\r\n\t\t\t\tforeach($attribute_matches[0] as $index2 => $value2) {\r\n\t\t\t\t\tif(strpos($value2, ' style=\"') === 0) { // in addition to splitting attributes, split the styles in this attribute\r\n\t\t\t\t\t\t$found_styling = true;\r\n\t\t\t\t\t\t$styles_string = substr($value2, 8, strlen($value2)-9);\r\n\t\t\t\t\t\t$styles_array = OM::explode_non_nested(\";\", $styles_string, \"{\", \"}\");\r\n\t\t\t\t\t\tforeach($styles_array as $style) {\r\n\t\t\t\t\t\t\tif(strlen($style) > 0) { // for the possible last ; in a style attribute.\r\n\t\t\t\t\t\t\t\t$new_opening .= '<span style=\"' . ReTidy::cleanStyle($style) . '\">';\r\n\t\t\t\t\t\t\t\t$new_closing = '</span>' . $new_closing;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t\t} elseif(strpos($value2, ' class=\"') === 0) { // in addition to splitting attributes, split the classes in this attribute\r\n\t\t\t\t\t\t$found_styling = true;\r\n\t\t\t\t\t\t$classes_string = trim(substr($value2, 8, strlen($value2)-9));\r\n\t\t\t\t\t\t$classes_array = explode(\" \", $classes_string);\r\n\t\t\t\t\t\tforeach($classes_array as $class) {\r\n\t\t\t\t\t\t\t$new_opening .= '<span class=\"' . $class . '\">';\r\n\t\t\t\t\t\t\t$new_closing = '</span>' . $new_closing;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$kept_attributes_string .= $value2;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(!$found_styling) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$new_opening = '<' . $tagName . $kept_attributes_string . '>' . $new_opening;\r\n\t\t\t\t\t$new_closing = $new_closing . '</' . $tagName . '>';\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$new_opening = '<' . $tagName . '>';\r\n\t\t\t\t$new_closing = '</' . $tagName . '>';\r\n\t\t\t\tforeach($attribute_matches[0] as $index2 => $value2) {\r\n\t\t\t\t\tif(strpos($value2, ' style=\"') === 0) { // in addition to splitting attributes, split the styles in this attribute\r\n\t\t\t\t\t\t$styles_string = substr($value2, 8, strlen($value2)-9);\r\n\t\t\t\t\t\t$styles_array = OM::explode_non_nested(\";\", $styles_string, \"{\", \"}\");\r\n\t\t\t\t\t\tforeach($styles_array as $style) {\r\n\t\t\t\t\t\t\tif(strlen($style) > 0) { // for the possible last ; in a style attribute.\r\n\t\t\t\t\t\t\t\t$new_opening .= '<span style=\"' . $style . '\">';\r\n\t\t\t\t\t\t\t\t$new_closing = '</span>' . $new_closing;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t\t} elseif(strpos($value2, ' class=\"') === 0) { // in addition to splitting attributes, split the classes in this attribute\r\n\t\t\t\t\t\t$classes_string = trim(substr($value2, 8, strlen($value2)-9));\r\n\t\t\t\t\t\t$classes_array = explode(\" \", $classes_string);\r\n\t\t\t\t\t\tforeach($classes_array as $class) {\r\n\t\t\t\t\t\t\t$new_opening .= '<span class=\"' . $class . '\">';\r\n\t\t\t\t\t\t\t$new_closing = '</span>' . $new_closing;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$new_opening .= '<span' . $value2 . '>';\r\n\t\t\t\t\t\t$new_closing = '</span>' . $new_closing;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t$replace_string = $new_opening . substr($objectString, strlen($opening_string_with_attributes), strlen($objectString)-strlen($opening_string_with_attributes)-strlen($closing_string)) . $new_closing;\r\n\t\t\t$array_replacesI[] = array($objectString, $replace_string);\r\n\t\t}\r\n\t\tusort($array_replacesI, \"sortByLengthOfFirst\");\r\n\t\t//print('$array_replacesI: ');var_dump($array_replacesI);\r\n\t\tforeach($array_replacesI as $index => $value) {\r\n\t\t\t$search = $value[0];\r\n\t\t\t$replace = $value[1];\r\n\t\t\t$this->code = str_replace($search, $replace, $this->code);\r\n\t\t}\r\n\t}", "function cstring_xmlGet($data, $tag){ \r\n $strTagStart = \"<\" . $tag . \">\";\r\n $strTagEnd = \"</\" . $tag . \">\";\r\n\r\n return cstring_getPartBetween($data, $strTagStart, $strTagEnd);\r\n}", "public static function getBalancedText($input, $startMark, $endMark, $offset = 0, $trim = false)\n {\n // Global file position. Used to search progressively through the file.\n // Modified by the offset.\n // echo \"<hr/>Balanced text for $input requested<hr/>\";\n if ($offset > strlen($input)) return false;\n if (strpos($input, $startMark, $offset) === false ||\n strpos($input, $endMark, $offset) === false ) return false;\n $position = strpos($input, $startMark, $offset);\n\n // Counter to keep track of nesting level.\n $level = 0;\n \n // These denote the starting points of the two most outer markers.\n $body_start = $body_end = $position;\n \n // Saves a lot of overhead.\n $input_len = strlen($input);\n \n $done = false;\n \n \n // echo \"Starting run-through.\" . PHP_EOL;\n while (!$done && $position < $input_len - 1)\n {\n // Find the starting position of a possible nesting point.\n $start = strpos($input, $startMark, $position);\n // Find the position of the next ending mark.\n $end = strpos($input, $endMark, $position);\n // if (!$start) echo \"No start found\" . PHP_EOL;\n // if (!$end) echo \"No end found\" . PHP_EOL;\n\n // Start tag is closer than end tag. Increase nesting.\n if ($start !== false && $start < $end)\n {\n $level++;\n // echo \"($position) Increasing level to $level\" . PHP_EOL;\n $position = $start + strlen($start);\n // echo \"($position) Fragment: \" . substr($input, $position-2, 5) . PHP_EOL;\n }\n else\n {\n // End tag is closer. Reduce level.\n $level--;\n // echo \"Decreasing level to $level\" . PHP_EOL;\n $position = $end + strlen($endMark);\n // echo \"($position) Fragment: \" . substr($input, $position-strlen($endMark), strlen($endMark)) . PHP_EOL;\n }\n \n // If we're at square one, we're done.\n if ($level <= 0)\n {\n // $new_marker = substr($input, $body_start, $position + strlen($endMark));\n // If we end up at level 0 again, we're done. Fully. Badam. Return the substring.\n $done = true;\n }\n }\n $ret = substr($input, $body_start, $position - $body_start);\n if ($trim)\n {\n $ret = substr($ret, strlen($startMark));\n $ret = substr($ret, 0, strlen($ret) - strlen($endMark));\n }\n return $ret;\n }", "public function countPages() {\n\t\t$splitContent = explode(\"<!-- pagebreak -->\", $this->content);\t\t\n\t\treturn count($splitContent);\n\t}", "function mOFFSET(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$OFFSET;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:191:3: ( 'offset' ) \n // Tokenizer11.g:192:3: 'offset' \n {\n $this->matchString(\"offset\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "function get_h2($file){\r\n $h1tags = preg_match_all(\"/(<h2.*>)(\\w.*)(<\\/h2>)/isxmU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "protected function _parseTagTable() {}", "static protected function _extractTagContents($tag, $data)\n\t{\n\t\t$tag = trim($tag, '<> ');\n\t\t\n\t\tif (false !== strpos($data, '<' . $tag . '>') and \n\t\t\tfalse !== strpos($data, '</' . $tag . '>'))\n\t\t{\n\t\t\t$data = strstr($data, '<' . $tag . '>');\n\t\t\t$end = strpos($data, '</' . $tag . '>');\n\t\t\t\n\t\t\treturn substr($data, strlen($tag) + 2, $end - (strlen($tag) + 2));\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "function getTextBetweenTags($string, $tagname) {\n $pattern = \"/<$tagname ?.*>(.*)<\\/$tagname>/\";\n preg_match($pattern, $string, $matches);\n\n return $matches[1];\n}", "public static function findStartCloseTag($html, $cursorOpen, $correct=0){\n $openTags = 1;\n $closeTags = 0; \n $autoCloseTags = array('img', 'input', 'br');\n $pattern = '/<(?:'.implode('|', $autoCloseTags).')[^>]*\\/>|<\\w+[^>]*>|<\\/\\w*>/i';\n $cursorClose = $cursorOpen + 1; // Ignore this tag because we consider this is an open found tag\n while($openTags > $closeTags + $correct){\n $htmlWindow = substr($html, $cursorClose);\n preg_match($pattern, $htmlWindow, $matches, PREG_OFFSET_CAPTURE);\n if(!empty($matches)){\n $cursorClose += $matches[0][1];\n $matchContent = $matches[0][0];\n $foundAutoCloseTags = false;\n foreach($autoCloseTags as $tag){\n if(strpos($matchContent, \"<$tag\") !== false){\n $foundAutoCloseTags = true;\n break;\n }\n }\n if(!$foundAutoCloseTags){\n if(strpos($matchContent, '</') !== false){\n $closeTags++;\n }else{\n $openTags++;\n }\n }\n $cursorClose += strlen($matchContent);\n if(self::getDebug()){\n print_r($matches);\n echo \"cursor = $cursorClose | closeTags = $closeTags | openTags = $openTags\\n\\n\";\n }\n }else{\n return false; // No more tag (open/close) but still can not find the close tag\n }\n }\n $cursorClose -= 1; // Step back to end close tag position\n return $cursorClose;\n }", "function extract_attrib_2($html) {\n\tpreg_match_all('/<a[^>]*\\>/', $html, $matcha); //匹配img标签\n\tforeach ($matcha[0] as $k => $vala) {\n\t\tpreg_match_all('/(href)=(\"[^\"]*\")/i', $vala, $matchesa);\n\t\t$zh = substr(trim($matchesa[2][0], '\"'), -3);\n\t\t// dd($zh,in_array($zh, ['png','jpg','peg','gif','bmp','et/']));\n\t\tif (in_array($zh, ['png', 'jpg', 'peg', 'gif', 'bmp'])) {\n\t\t\t$vala2 = str_insert($vala, 3, ' class=\"gallery-item-hook\"');\n\t\t\t$html = str_replace($vala, $vala2, $html);\n\t\t}\n\t\t// dd($val,$k,$matches[2][0]);\n\t\t// dd($matches);\n\t}\n\tpreg_match_all('/<img[^>]*\\>/', $html, $match); //匹配img标签\n\t// dd($match);\n\tforeach ($match[0] as $k => $val) {\n\t\tpreg_match_all('/(id|alt|title|src)=(\"[^\"]*\")/i', $val, $matches);\n\t\t$html = str_replace($val, '<a href=' . $matches[2][0] . ' class=\"gallery-item-hook\">' . $val . '</a>', $html);\n\t\t// dd($val, $k, $matches[2][0]);\n\t\t// dd($matches);\n\t}\n\treturn ['html' => $html];\n}", "public static function findStartOpenTag($html, $nearOpenTag){\n if($html[$nearOpenTag] == '<'){\n return $nearOpenTag;\n }else{\n return strrpos(substr($html, 0, $nearOpenTag), '<');\n }\n }", "public function getOffset();", "public function getOffset();", "public function getOffset();", "function get_h3($file){\r\n $h1tags = preg_match_all(\"/(<h3.*>)(\\w.*)(<\\/h3>)/ismU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "function getHeaderTags()\n {\n $filter = '(';\n for ($i = 1; $i <= 20; $i++) {\n $filter .= '//h' . $i . '|';\n }\n $filter = trim($filter, '|') . ')';\n \n $elements = $this->xpath->query($filter);\n $tags = [];\n foreach ($elements as $index => $element) {\n $level = filter_var($element->tagName, FILTER_SANITIZE_NUMBER_INT) - 1;\n $innerHtml = $this->DOMinnerHTML($element);\n \n $tags[$index]['header'] = $element->tagName;\n $tags[$index]['level'] = $level;\n $tags[$index]['name'] = trim(strip_tags($innerHtml));\n $tags[$index]['content'] = $innerHtml;\n $tags[$index]['toc'] = $this->getTOCFromTag($innerHtml);\n }\n return $tags;\n }", "public function getOffset() {}", "public function getOffset() {}", "public function getOffset() {}", "public function parse($html)\n {\n $html = ltrim($html);\n\n // Get token position.\n $positionArray = PagstractTokenizer::getPosition($html);\n $this->setLine($positionArray['line']);\n $this->setPosition($positionArray['position']);\n\n // Parse name.\n $this->name = $this->parseElementName($html);\n \n // Parse attributes.\n $remainingHtml = mb_substr($html, mb_strlen($this->name) + ($this->isClosing ? 2 : 1));\n \n while ( (mb_strpos($remainingHtml, '>') !== false) && \n (preg_match(\"/^\\s*[\\/]?>/\", $remainingHtml) === 0) ) {\n $remainingHtml = $this->parseAttribute($remainingHtml);\n }\n\n // Find position of end of tag.\n $posOfClosingBracket = mb_strpos($remainingHtml, '>');\n if ($posOfClosingBracket === false) {\n if ($this->getThrowOnError()) {\n throw new TokenizerException(\n 'Invalid element: missing closing bracket '.\n 'in line: '.$this->getLine().', position: '.$this->getPosition().''\n );\n }\n\n return '';\n }\n\n // Is self-closing?\n $posOfSelfClosingBracket = mb_strpos($remainingHtml, '/>');\n \n $remainingHtml = mb_substr($remainingHtml, $posOfClosingBracket + 1);\n \n if (($posOfSelfClosingBracket !== false) \n && ($posOfSelfClosingBracket == $posOfClosingBracket - 1) \n ) {\n // Self-closing element.\n return $remainingHtml;\n }\n\n \n // Lets close those closed-only elements that are left open.\n $closedOnlyElements = array(\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr'\n );\n if (array_search($this->name, $closedOnlyElements) !== false) {\n return $remainingHtml;\n }\n $nested = $this->nested();\n if (!$nested) { \n return $remainingHtml;\n }\n \n // Open element.\n return $this->parseContents($remainingHtml);\n }", "private function getMetadataSize()\n {\n $this->seek($this->offset + 18 + $this->getAliasSize());\n\n return $this->readLong();\n }", "function getOffset() ;", "function _info() {\n $inf = array();\n $ar = array();\n foreach($this->attribs as $i => $a) $ar[$i] = self::html_attr2str($a);\n $inf['attribs'] = $ar ;\n $inf['attrs'] = $attrs ;\n $inf['idx_attr'] = $this->idx_attr ;\n $inf['tag_idx'] = $this->tag_idx ;\n $inf['attr_idx'] = $this->attr_idx ;\n $inf['class_idx'] = $this->class_idx ;\n\n $lev = array();\n $nm = array();\n $st = array();\n $pb = -1; $pe = PHP_INT_MAX;\n $l = 0;\n foreach($this->ids as $b => $e) {\n if($pb < $b && $b < $pe) {\n $st[] = array($pb, $pe);\n list($pb, $pe) = array($b, $e);\n }\n else while($pe < $b && $st) {\n list($pb, $pe) = array_pop($st);\n }\n $nm[$b] = $this->tags[$b];\n $lev[$b] = count($st);\n }\n foreach($nm as $b => &$n) {\n $n = str_repeat(' -', $lev[$b]) . ' < ' . $n . ' ' . $this->get_attr_byId($b, NULL, true) . ' >';\n }\n $nm = implode(\"\\n\", $nm);\n $inf['struc'] = $nm;\n unset($lev, $st, $nm);\n return $inf;\n }", "function processFileAndGetHTML()\n {\n $this->incrementHeaderTags();\n $this->removeAttributesFromTag('img', ['height', 'width']);\n $tagAttributes = ['class' => ['img-responsive img-rounded']];\n $this->addAttributesToTag('img', $tagAttributes);\n $this->getWordSectionContents();\n return $this->processedHTML;\n }", "protected function find_tags(){\n\t\tpreg_match_all(\"/%(.+?)%/\", $this->default, $this->tags );\n\t}", "abstract public function getContents($offset, $length);", "function print_tag($mode,$tag,$xpath,$count) {\n global $doc_assessments, $xids;\n global $tags, $current_xid, $in_mathml;\n array_push($tags,$tag);\n if ($doc_assessments) $a = $doc_assessments->get_element_by_id($current_xid);\n\n // i:m represent the assessment values mask\n // i:cm represent the assessment values mask for descendants without a mask\n // i:a is the current assessed value\n // i:p post-id value\n print \"<$mode s='' id='$current_xid' i:post='\" . ($current_xid+$count)\n . \"' class='xmle' path='$xpath'\"\n . (sizeof($xids) > 0 ? \" i:p='\" . $xids[sizeof($xids)-1] . \"'\" : \"\")\n . ($a ? \" name='\" . $a->get_assessment_wta() . \"'\"\n . ($a->is_inferred() ? \" ii='yes'\" : \"\")\n . ($a->is_inconsistant() ? \" ic='yes'\" : \"\")\n . ($a->is_in_pool() ? \" ip='yes'\" : \"\")\n : \" name='U'\")\n . \">\";\n $xids[] = $current_xid;\n $current_xid++;\n// if ($mode == \"tr\") print \"<td class='xmlp'><span class='xml'>$tag</span></td>\"; else\n// if ($mode == \"tbody\") print \"<tr class='xmlp'><td class='xmlp'><span class='xml'>$tag</span></td></tr>\";\n// else print \"<span class='xml'>$tag</span>\\n\";\n\n}", "public function getOffset()\r\n {\r\n return ( $this->_pageno - 1 ) * $this->_size;\r\n }", "public function calculatePosition(string $text, int $charactersCount) : int;" ]
[ "0.5413764", "0.54076934", "0.5238103", "0.52197444", "0.51174706", "0.5096802", "0.5023371", "0.5011801", "0.49831337", "0.4967562", "0.4924539", "0.48801875", "0.4845485", "0.47762424", "0.47525552", "0.47509113", "0.47501096", "0.47448927", "0.4730054", "0.47147626", "0.4680571", "0.46665257", "0.46461946", "0.46100783", "0.4606527", "0.46026295", "0.45630988", "0.45558062", "0.45526457", "0.45356774", "0.4517987", "0.45140046", "0.45035502", "0.44982558", "0.449047", "0.44848973", "0.44670403", "0.44609562", "0.444844", "0.44432035", "0.44309568", "0.43955463", "0.4393144", "0.4393144", "0.4393144", "0.43901214", "0.43822056", "0.43764925", "0.43727013", "0.43701023", "0.4329579", "0.4318948", "0.4317908", "0.43022442", "0.43019107", "0.42938143", "0.42866737", "0.42801628", "0.42708722", "0.4268237", "0.42647517", "0.4264558", "0.4263936", "0.42621896", "0.4249117", "0.42434776", "0.42394584", "0.42380118", "0.42363405", "0.4229476", "0.42251277", "0.4224131", "0.42214507", "0.42198515", "0.421578", "0.42115238", "0.4196936", "0.41909844", "0.41905123", "0.41902712", "0.41892084", "0.41843018", "0.4183188", "0.4183188", "0.4183188", "0.4183099", "0.41749987", "0.41724512", "0.41724512", "0.41724512", "0.4170929", "0.41648766", "0.41557527", "0.41528758", "0.41520515", "0.41437733", "0.41381085", "0.4126652", "0.41260383", "0.41214854" ]
0.581585
0
Convert plain text into HTML which has links
public static function urlify(string $text, array $attributes = []): string { $links = self::extractLinks($text); $map = []; foreach ($links as $link) { $map[$link] = self::a($link, $attributes, $link); } $emails = self::extractEmails($text); foreach ($emails as $email) { $map[$email] = self::a('mailto:' . $email, $attributes, $email); } return strtr($text, $map); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function html($text) {\n\t\t// Sanitizing html text\n\t\t$text = Sanitize::html($text);\n\t\t// Adding <br />\n\t\t$text = nl2br($text);\n\t\t// Transform http:// into links\n\t\t$text = $this->convertLinks($text);\n\n\t\treturn $text;\n\t}", "function raw_urls_to_links($text){\n\t\t$text = \" $text \";\n\t\t$text = preg_replace('#(https?://[^\\s<>{}()]+[^\\s.,<>{}()])#i', '<a href=\"$1\" rel=\"nofollow\">$1</a>', $text);\n\t\t$text = preg_replace('#(\\s)([a-z0-9\\-]+(?:\\.[a-z0-9\\-\\~]+){2,}(?:/[^ <>{}()\\n\\r]*[^., <>{}()\\n\\r])?)#i', \n\t\t\t'$1<a href=\"http://$2\" rel=\"nofollow\">$2</a>', $text);\n\n\t\t$text = trim($text);\n\t\treturn $text;\n\t}", "public function format_text_to_links( $text ) {\r\n\t\tif( empty( $text ) ) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t $text = preg_replace( \"/(^|[\\n ])([\\w]*?)((ht|f)tp(s)?:\\/\\/[\\w]+[^ \\,\\\"\\n\\r\\t<]*)/is\", \"$1$2<a href=\\\"$3\\\" >$3</a>\", $text );\r\n\t $text = preg_replace( \"/(^|[\\n ])([\\w]*?)((www|ftp)\\.[^ \\,\\\"\\t\\n\\r<]*)/is\", \"$1$2<a href=\\\"http://$3\\\" >$3</a>\", $text );\r\n\t $text = preg_replace( \"/(^|[\\n ])([a-z0-9&\\-_\\.]+?)@([\\w\\-]+\\.([\\w\\-\\.]+)+)/i\", \"$1<a href=\\\"mailto:$2@$3\\\">$2@$3</a>\", $text );\r\n\t \r\n\t\treturn $text;\r\n\t}", "public static function text2link($text){\n \n\n // The Regular Expression filter\n\t\t $reg_wwwUrl = \"/(www)\\.[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\n $reg_httpUrl = \"/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\n // Check if there is a url in the text\n if(preg_match($reg_httpUrl, $text, $url)) {\n // make the urls hyper links\n $text = preg_replace($reg_httpUrl, '<a href=\"'.$url[0].'\" rel=\"nofollow\">'.$url[0].'</a>', $text);\n } else if(preg_match($reg_wwwUrl, $text, $url)){\n\t\t $text = preg_replace($reg_wwwUrl, '<a href=\"'.$url[0].'\" rel=\"nofollow\">'.$url[0].'</a>', $text);\n\t\t} // if no urls in the text just return the text\n return ($text);\n\t}", "public static function txt2html($txt) {\n\n\t//Kills double spaces and spaces inside tags.\n\t// while( !( strpos($txt,' ') === FALSE ) ) $txt = str_replace(' ',' ',$txt);\n if( !( strpos($txt,' ') === FALSE ) ) $txt = str_replace(' ',' ',$txt);\n\n\t$txt = str_replace(' >','>',$txt);\n\t$txt = str_replace('< ','<',$txt);\n\n\t//Transforms accents in html entities.\n\t$txt = utf8_decode($txt);\n\t$txt = htmlentities($txt);\n\n\t//We need some HTML entities back!\n\t$txt = str_replace('&quot;','\"',$txt);\n\t$txt = str_replace('&lt;','<',$txt);\n\t$txt = str_replace('&gt;','>',$txt);\n\t$txt = str_replace('&amp;','&',$txt);\n\t\n\t//Ajdusts links - anything starting with HTTP opens in a new window\n\t$txt = WA_String::stri_replace(\"<a href=\\\"http://\",\"<a target=\\\"_blank\\\" href=\\\"http://\",$txt);\n\t$txt = WA_String::stri_replace(\"<a href=http://\",\"<a target=\\\"_blank\\\" href=http://\",$txt);\n\n\t//Basic formatting\n\t$eol = ( strpos($txt,\"\\r\") === FALSE ) ? \"\\n\" : \"\\r\\n\";\n\t$html = '<p>'.str_replace(\"$eol$eol\",\"</p><p>\",$txt).'</p>';\n $html = str_replace(\"$eol\",\"<br />\\n\",$html);\n\t$html = str_replace(\"</p>\",\"</p>\\n\\n\",$html);\n\t$html = str_replace(\"<p></p>\",\"<p>&nbsp;</p>\",$html);\n\n\t//Wipes <br> after block tags (for when the user includes some html in the text).\n\t$wipebr = Array(\"table\",\"tr\",\"td\",\"blockquote\",\"ul\",\"ol\",\"li\");\n\n\tfor($x = 0; $x < count($wipebr); $x++) {\n \t $tag = $wipebr[$x];\n \t $html = WA_String::stri_replace(\"<$tag><br />\",\"<$tag>\",$html);\n \t $html = WA_String::stri_replace(\"</$tag><br />\",\"</$tag>\",$html);\n\t}\n\n\treturn $html;\n }", "public function formatLinks($text) {\n $text = preg_replace(\"/([\\w-?&;#~=\\.\\/]+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?))/i\",\"<a href=\\\"mailto:$1\\\">$1</a>\",$text);\n $text = str_replace(\"http://www.\",\"www.\",$text);\n $text = str_replace(\"www.\",\"http://www.\",$text);\n $text = preg_replace(\"/([\\w]+:\\/\\/[\\w-?&;#~=\\.\\/\\@]+[\\w\\/])/i\",\"<a href=\\\"$1\\\">$1</a>\", $text);\n return $text;\n }", "function admMarkupPlainText( $txt )\n{\n $html = $txt;\n\t$html = str_replace( \"<\", \"&lt;\", $html );\n\t$html = str_replace( \">\", \"&gt;\", $html );\n\n /* articles */\n\t$html = preg_replace( \"/\\\\[a([0-9]+)(\\\\s*'(.*?)')?\\\\s*\\\\]/\", \"<a href=\\\"/adm/article?article_id=\\\\1\\\">\\\\0</a>\", $html );\n\n /* journos */\n\t$html = preg_replace( \"/\\\\[j([0-9]+)(\\\\s*(.*?))?\\\\s*\\\\]/\", \"<a href=\\\"/adm/journo?journo_id=\\\\1\\\">\\\\0</a>\", $html );\n\n /* http:// */\n $html = preg_replace( \"%http://\\\\S+%\", \"<a href=\\\"\\\\0\\\">\\\\0</a>\", $html );\n\n\treturn $html;\n}", "function &makeClickable( &$text ) {\n $patterns = array( \"/(^|[^]_a-z0-9-=\\\"'\\/])([a-z]+?):\\/\\/([^, \\r\\n\\\"\\(\\)'<>]+)/i\", \"/(^|[^]_a-z0-9-=\\\"'\\/])www\\.([a-z0-9\\-]+)\\.([^, \\r\\n\\\"\\(\\)'<>]+)/i\", \"/(^|[^]_a-z0-9-=\\\"'\\/])ftp\\.([a-z0-9\\-]+)\\.([^, \\r\\n\\\"\\(\\)'<>]+)/i\", \"/(^|[^]_a-z0-9-=\\\"'\\/:\\.])([a-z0-9\\-_\\.]+?)@([^, \\r\\n\\\"\\(\\)'<>\\[\\]]+)/i\" );\n $replacements = array( \"\\\\1<a href=\\\"\\\\2://\\\\3\\\" target=\\\"_blank\\\">\\\\2://\\\\3</a>\", \"\\\\1<a href=\\\"http://www.\\\\2.\\\\3\\\" target=\\\"_blank\\\">www.\\\\2.\\\\3</a>\", \"\\\\1<a href=\\\"ftp://ftp.\\\\2.\\\\3\\\" target=\\\"_blank\\\">ftp.\\\\2.\\\\3</a>\", \"\\\\1<a href=\\\"mailto:\\\\2@\\\\3\\\">\\\\2@\\\\3</a>\" );\n $text = preg_replace( $patterns, $replacements, $text );\n return $text;\n }", "protected function add_links_to_text() {\n\t $this->text = str_replace( array( /*':', '/', */'%' ), array( /*'<wbr></wbr>:', '<wbr></wbr>/', */'<wbr></wbr>%' ), $this->text );\n\t $this->text = preg_replace( '~(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)~', '<a href=\"$1\" target=\"_blank\">$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+@([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/$1\" rel=\"nofollow\" target=\"_blank\">@$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+#([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/search?q=%23$1\" rel=\"nofollow\" target=\"_blank\">#$1</a>', $this->text );\n\t}", "function parseText($txt,$wrap){\n\t\t\t$txt = $this->TS_links_rte($txt, $wrap);\n\t\t\t//prepend relative paths with url\n\t\t\t$txt = $this->makeAbsolutePaths($txt);\n\t\t\t$txt = $this->cleanHTML($txt);\n\t\t\treturn $txt;\n\t\t\n\t}", "function link_souce($text){\n\n if(post::isValidURL($text)){\n $text = '<a href=\"'.$text.'\">'.$text.'</a>';\n } \n return $text;\n }", "function hyperlinkText($text) {\n\n\t\tif (!$text) return \"N/A\";\n\n\t\t//$text = displayBlank($text);\n\n \t//Not perfect but it works - please help improve it.\n $text=preg_replace('/([^(\\'|\")]((f|ht){1}tp(s?):\\/\\/)[-a-zA-Z0-9@:%_\\+.~#?&;\\/\\/=]+[^(\\'|\")])/','<a href=\"\\\\1\" target=\"_blank\">\\\\1</a>', $text);\n $text=preg_replace(\"/(^|[ \\\\n\\\\r\\\\t])([^('|\\\")]www\\.([a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+)(\\/[^\\/ \\\\n\\\\r]*)*[^('|\\\")])/\", '\\\\1<a href=\"http://\\\\2\" target=\"_blank\">\\\\2</a>', $text);\n $text=preg_replace(\"/(^|[ \\\\n\\\\r\\\\t])([^('|\\\")][_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,4}[^('|\\\")])/\",'\\\\1<a href=\"mailto:\\\\2\" target=\"_blank\">\\\\2</a>', $text);\n\n return $text;\n\t}", "private function make_clickable($text) {\r\n return preg_replace_callback(\r\n '#\\b(?<![href|src]=[\\'\"])https?://[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/))#', create_function(\r\n '$matches', 'return \"<a href=\\'{$matches[0]}\\'>{$matches[0]}</a>\";'\r\n ), $text\r\n );\r\n }", "public static function textTagUrls($text)\r\n {\r\n $reg_exUrl = \"/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\r\n\r\n\r\n // Check if there is a url in the text\r\n if(preg_match($reg_exUrl, $text, $url)) {\r\n // make the urls hyper links\r\n return preg_replace($reg_exUrl, '<a href=\"'.$url[0].'\" rel=\"nofollow\" target=\"_blank\">'.$url[0].'</a>', $text);\r\n } else {\r\n // if no urls in the text just return the text\r\n return $text;\r\n\r\n }\r\n }", "function linkify($text) {\n $matches = array(\n '/([A-Za-z]+:\\/\\/[A-Za-z0-9-_]+\\.[A-Za-z0-9-_:%&\\?\\/.=]+)/',\n '/(^|[^\\w])(#[\\d\\w\\-]+)/',\n '/(^|[^\\w])(@([\\d\\w\\-]+))/'\n );\n \n $replacements = array(\n '<a href=\"$1\">$1</a>',\n '$1<a href=\"http://search.twitter.com/search?q=$2\">$2</a>',\n '$1@<a href=\"http://twitter.com/$3\">$3</a>'\n );\n \n return preg_replace($matches, $replacements, $text);\n}", "function old_convert_urls_into_links(&$text) {\n $text = eregi_replace(\"([[:space:]]|^|\\(|\\[)([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])\",\n \"\\\\1<a href=\\\"\\\\2://\\\\3\\\\4\\\" target=\\\"_blank\\\">\\\\2://\\\\3\\\\4</a>\", $text);\n\n /// eg www.moodle.com\n $text = eregi_replace(\"([[:space:]]|^|\\(|\\[)www\\.([^[:space:]]*)([[:alnum:]#?/&=])\",\n \"\\\\1<a href=\\\"http://www.\\\\2\\\\3\\\" target=\\\"_blank\\\">www.\\\\2\\\\3</a>\", $text);\n }", "private function bbcode2html($text) {\r\n $search = array(\r\n '/\\[b\\](.*?)\\[\\/b\\]/is',\r\n '/\\[i\\](.*?)\\[\\/i\\]/is',\r\n '/\\[u\\](.*?)\\[\\/u\\]/is',\r\n '/\\[img\\](https?.*?)\\[\\/img\\]/is',\r\n '/\\[url\\](https?.*?)\\[\\/url\\]/is',\r\n '/\\[url=(https?.*?)\\](.*?)\\[\\/url\\]/is'\r\n );\r\n $replace = array(\r\n '<strong>$1</strong>',\r\n '<em>$1</em>',\r\n '<u>$1</u>',\r\n '<img src=\"$1\" />',\r\n '<a href=\"$1\">$1</a>',\r\n '<a href=\"$1\">$2</a>'\r\n );\r\n return preg_replace($search, $replace, $text);\r\n }", "function make_links_clickable($text)\r\n {\r\n return preg_replace('!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;//=]+)!i', '<a href=\"$1\" target=\"_blank\">$1</a>', $text);\r\n }", "public static function detect_links($text){\n// $dom->loadHTML($text);\n// $xPath = new \\DOMXPath($dom);\n// $texts = $xPath->query(\n// '/html/body//text()[\n// not(ancestor::a) and (\n// contains(.,\"http://\") or\n// contains(.,\"https://\") or\n// contains(.,\"ftp://\") )]'\n// );\n// foreach ($texts as $text) {\n// $fragment = $dom->createDocumentFragment();\n// $fragment->appendXML(\n// preg_replace(\n// \"~((?:http|https|ftp)://(?:\\S*?\\.\\S*?))(?=\\s|\\;|\\)|\\]|\\[|\\{|\\}|,|\\\"|'|:|\\<|$|\\.\\s)~ui\",\n// '<a href=\"$1\">$1</a>',\n// $text->data\n// )\n// );\n// $text->parentNode->replaceChild($fragment, $text);\n// }\n// return utf8_decode($dom->saveXML($dom->documentElement));\n// $m = \"~((?:http|https|ftp)://(?:\\S*?\\.\\S*?))(?=\\s|\\;|\\)|\\]|\\[|\\{|\\}|,|\\\"|'|:|\\<|$|\\.\\s)~ui\";\n// $r = '$1 <a href=\"$2\">$2</a>';\n// return preg_replace($m,$r,$text);\n return $text;\n\n }", "function markdown2html($text)\n{\n\t$text = html($text);\n\t\n\t// Convert plain-text formatting to HTML\n\t\n\t// strong emphasis\n\t$text = preg_replace('/__(.+?)__/s', '<strong>$1</strong>', $text);\n\t$text = preg_replace('/\\*\\*(.+?)\\*\\*/s', '<strong>$1</strong>', $text);\n\t\n\t// emphasis\n\t$text = preg_replace('/_([^_]+)_/', '<em>$1</em>', $text);\n\t$text = preg_replace('/\\*([^\\*]+)\\*/', '<em>$1</em>', $text);\n\t\n\t// Convert Windows (\\r\\n) to Unix (\\n)\n\t$text = str_replace(\"\\r\\n\", \"\\n\", $text);\n\t// Convert Macintosh (\\r) to Unix (\\n)\n\t$text = str_replace(\"\\r\", \"\\n\", $text);\n\t\n\t// Paragraphs\n $text = '<p>' . str_replace(\"\\n\\n\", '</p><p>', $text) . '</p>';\n\t// Line breaks\n\t$text = str_replace(\"\\n\", '<br>', $text);\n\t\n\t// Url links\n\t$text = preg_replace(\n\t\t\t'/\\[([^\\]]+)]\\(([-a-z0-9._~:\\/?#@!$&\\'()*+,;=%]+)\\)/i',\n\t\t\t'<a href=\"$2\">$1</a>', $text);\n\t\n\treturn $text;\n}", "public function makeClickable($text)\n {\n return preg_replace_callback(\n '#\\b(?<![href|src]=[\\'\"])https?://[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/))#',\n function ($matches) {\n return \"<a href=\\\"{$matches[0]}\\\">{$matches[0]}</a>\";\n },\n $text\n );\n }", "public static function makeLinksClickable(string $text): string {\n return preg_replace(\n '!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;//=]+)!i',\n '<a href=\"$1\" rel=\"nofollow\" target=\"_blank\">$1</a>',\n $text\n ) ?? '';\n }", "public function bbcode2html($text)\n {\n $search = [\n '/\\[b\\](.*?)\\[\\/b\\]/is',\n '/\\[i\\](.*?)\\[\\/i\\]/is',\n '/\\[u\\](.*?)\\[\\/u\\]/is',\n '/\\[img\\](https?.*?)\\[\\/img\\]/is',\n '/\\[url\\](https?.*?)\\[\\/url\\]/is',\n '/\\[url=(https?.*?)\\](.*?)\\[\\/url\\]/is'\n ];\n\n $replace = [\n '<strong>$1</strong>',\n '<em>$1</em>',\n '<u>$1</u>',\n '<img src=\"$1\" />',\n '<a href=\"$1\">$1</a>',\n '<a href=\"$1\">$2</a>'\n ];\n\n return preg_replace($search, $replace, $text);\n }", "public function processAutoLink(Text $text)\n {\n if (!$text->contains('<')) {\n return;\n }\n\n $text->replace('{<((?:https?|ftp):[^\\'\">\\s]+)>}', function (Text $w, Text $url) {\n $this->markdown->emit('escape.special_chars', [$url->replace('/(?<!\\\\\\\\)_/', '\\\\\\\\_')]);\n\n return $this->getRenderer()->renderLink($url, [\n 'href' => $url->getString()\n ]);\n });\n\n /** @noinspection PhpUnusedParameterInspection */\n $text->replace('{\n <\n (?:mailto:)?\n (\n [-.\\w]+\n \\@\n [-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]+\n )\n >\n }ix', function (Text $w, Text $address) {\n $address = \"mailto:\" . $address;\n\n $encode = array(\n function ($char) { return '&#' . ord($char) . ';'; },\n function ($char) { return '&#x' . dechex(ord($char)) . ';'; },\n function ($char) { return $char; }\n );\n\n $chars = new Collection(str_split($address));\n\n $chars->apply(function ($char) use ($encode) {\n if ($char == '@') {\n return $encode[rand(0, 1)]($char);\n } elseif ($char != ':') {\n $rand = rand(0, 100);\n $key = ($rand > 90) ? 2 : ($rand < 45 ? 0 : 1);\n\n return $encode[$key]($char);\n }\n\n return $char;\n });\n\n $address = $chars->join();\n $text = $chars->slice(7)->join();\n\n return $this->getRenderer()->renderLink($text, ['href' => $address]);\n });\n }", "function processWikitext($text, $links) {\n $result = $text;\n $differentLinkRegex=\"/\\[\\[([^\\|]*)\\|([^\\]]*)\\]\\]/\";\n $simpleLinkRegex=\"/\\[\\[([^\\]]*)\\\\]\\]/\";\n $differentLinkReplace = \"'<a href=http://nl.wikipedia.org/wiki/' . rawurlencode('$1') . '>$2</a>'\";\n $simpleLinkReplace = \"'<a href=http://nl.wikipedia.org/wiki/' . rawurlencode('$1') . '>$1</a>'\";\n if ( $links ) {\n\t$result = preg_replace($differentLinkRegex . \"e\", $differentLinkReplace, $result);\n\t$result = preg_replace($simpleLinkRegex . \"e\", $simpleLinkReplace, $result);\n\t$result = $result;\n } else {\n\t$result = preg_replace($differentLinkRegex, \"$2\", $result);\n\t$result = preg_replace($simpleLinkRegex, \"$1\", $result);\n }\n return $result;\n}", "static function hyperlink($text)\n\t\t{\n\t\t\tif (strpos($text, '<img src=\"http://')===false && strpos($text, '<a href=\"http://')===false)\n\t\t\t{ \n\t\t\t\t$text = preg_replace(\"/([a-zA-Z]+:\\/\\/)([a-z][a-z0-9\\.\\_\\-]*[a-z]{2,6})([a-zA-Z0-9\\/\\*\\-\\?\\&\\%\\=\\#\\_\\;\\,\\(\\)\\.]*)/i\", \"<a href=\\\"$1$2$3\\\" target=\\\"_blank\\\" rel=\\\"nofollow\\\">$2</a> \", $text);\n\t\t\t}\n\t\t\treturn $text;\n\t\t}", "function auto_link_text($text) {\n\t// Pattern from http://daringfireball.net/2010/07/improved_regex_for_matching_urls\n $pattern = \"#(?i)\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\\\".,<>?«»“”‘’]))#\";\n $callback = create_function('$matches', '\n $url = array_shift($matches);\n $url_parts = parse_url($url);\n\n $text = parse_url($url, PHP_URL_HOST) . parse_url($url, PHP_URL_PATH);\n $text = preg_replace(\"/^www./\", \"\", $text);\n\n $last = -(strlen(strrchr($text, \"/\"))) + 1;\n if ($last < 0) {\n $text = substr($text, 0, $last) . \"&hellip;\";\n }\n\n return sprintf(\\'<a href=\"%s\">%s</a>\\', $url, $text);\n ');\n\n return preg_replace_callback($pattern, $callback, $text);\n}", "function auto_link_text($text)\n{\n $pattern = '#\\b(([\\w-]+://?|www[.])[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/)))#';\n $callback = create_function('$matches', '\n $url = array_shift($matches);\n $url_parts = parse_url($url);\n\n $text = parse_url($url, PHP_URL_HOST) . parse_url($url, PHP_URL_PATH);\n $text = preg_replace(\"/^www./\", \"\", $text);\n\n $last = -(strlen(strrchr($text, \"/\"))) + 1;\n if ($last < 0) {\n $text = substr($text, 0, $last) . \"&hellip;\";\n }\n\n return sprintf(\\'<a rel=\"nofollow\" target=\"_blank\" href=\"%s\">%s</a>\\', $url, $text);\n ');\n\n return preg_replace_callback($pattern, $callback, $text);\n}", "private static function translateLinks($text)\n {\n return preg_replace_callback('/(?<=^|\\s)(https?:\\/\\/(?:www\\.|(?!www))[^\\s\\.]+\\.[^\\s\\]\\)\\\\\"\\'\\<]{2,})(?=$|\\s)/', function ($hit) {\n $url = $hit[0];\n return UrlOembed::getOEmbed($url) ? '[' . $url . '](oembed:' . $url . ')' : $url;\n }, $text);\n }", "public static function markUp($text, $link = true) {\n if ($link === true) {\n $link_search = '/\\[a\\](.*?)\\[\\/a\\]/i';\n if (preg_match_all($link_search, $text, $matches)) {\n foreach ($matches[1] as $match) {\n $match_decode = urldecode($match);\n $match_decode_url = $match_decode;\n $count_url = mb_strlen($match_decode);\n if ($count_url > 50) {\n $match_decode_url = mb_substr($match_decode_url, 0, 30) . '....' . mb_substr($match_decode_url, 30, 20);\n }\n $match_url = $match_decode;\n if (!preg_match(\"/http(|s):\\/\\//\", $match_decode)) {\n $match_url = 'http://' . $match_url;\n }\n $text = str_replace('[a]' . $match . '[/a]', '<a href=\"' . strip_tags($match_url) . '\" target=\"_blank\" class=\"hash\" rel=\"nofollow\">' . $match_decode_url . '</a>', $text);\n }\n }\n }\n\n $link_search = '/\\[img\\](.*?)\\[\\/img\\]/i';\n if (preg_match_all($link_search, $text, $matches)) {\n foreach ($matches[1] as $match) {\n $match_decode = urldecode($match);\n $text = str_replace('[img]' . $match . '[/img]', '<a href=\"' . getMedia(strip_tags($match_decode)) . '\" target=\"_blank\"><img style=\"width:300px;border-radius: 20px;\" src=\"' . getMedia(strip_tags($match_decode)) . '\"></a>', $text);\n }\n }\n return $text;\n }", "public function toHTML($text)\n {\n return \\Parsedown::instance()->text($text);\n }", "function urlsTolinks($text) {\r\n\t\r\n\t\t// Make long URLs into links\r\n\t\t// Regexp improved by Bruce.\r\n\t\t$linked_text = eregi_replace(\"([[:space:].,\\(\\[])([[:alnum:]]{3,})://([[:alnum:]_-]+\\.)([[:alnum:]_-]{2,}[[:alnum:]/&=#?_\\.-]*)\",\r\n\t\t\t\t\t\t \"\\\\1<a href=\\\"\\\\2://\\\\3\\\\4\\\" target=\\\"newpage\\\">\\\\2://\\\\3\\\\4</a>\", $text);\r\n\r\n\t // Make short urls into links\r\n\t\t$linked_text = eregi_replace(\"([[:space:],\\(\\[])www\\.([[:alnum:]_-]+\\.)([[:alnum:]_-]{2,}[[:alnum:]/&=#?_\\.-]*)\", \"\\\\1<a href=\\\"http://www.\\\\2\\\\3\\\" target=\\\"newpage\\\">www.\\\\2\\\\3</a>\", $linked_text);\r\n\t\t\t\t\t\t \r\n\t\treturn $linked_text;\r\n\t\t\t\t\t\t \r\n\t\t\t\r\n\t}", "private function processLink($text, $link) {\n $link = rtrim($link, '.');\n $pipe = explode('|', $text);\n\n if (mb_strlen($pipe[0]) !== mb_strlen($text)) {\n $pipe = explode('[', $pipe[0]);\n $linkText = $pipe[1];\n $search = '[' . $linkText . '|' . $link . ']';\n $replace = sprintf('<a href=\"%s\">%s</a>', $link, $linkText);\n } else {\n $search = $link;\n $replace = sprintf('<a href=\"%s\">%s</a>', $link, $link);\n }\n\n $this->writeRaw(str_replace($search, $replace, $text));\n\n return '';\n }", "function generate_text_for_html_display($text)\n{\n\t//Replace new\n\t$text = str_replace(\"\\n\", \"<br />\\n\", $text);\n\n\t//BBCode replacement array\n\t$bbcode = array(\n\t\t\"/\\[b\\](.*?)\\[\\/b\\]/is\" => '<span style=\"font-weight:bold;\">$1</span>',\n\t\t\"/\\[u\\](.*?)\\[\\/u\\]/is\" => '<span style=\"text-decoration:underline;\">$1</span>',\n\t\t\"/\\[color\\=(.*?)\\](.*?)\\[\\/color\\]/is\" => '<span style=\"color:$1;\">$2</span>',\n\t\t\"/\\[code\\](.*?)\\[\\/code\\]/is\" => '<pre style=\"padding-left:20px;\">$1</pre>',\n\t);\n\n\t//Replace BBCode\n\t$text = preg_replace(array_keys($bbcode), array_values($bbcode), $text);\n\t$text = preg_replace_callback('#\\[url(=(.*))?\\](.*)\\[/url\\]#iU', function ($ary) { return(validate_url($ary[2], $ary[3])); }, $text);\n\n\treturn $text;\n}", "function linkify($s) {\n\n Octopus::loadExternal('simplehtmldom');\n\n $s = '<p>' . $s . '</p>';\n $dom = str_get_html($s);\n $regex = '/(\\s|^|\\()(https?:\\/\\/[^\\s<]+?[^\\.])(\\.?(\\s|$|\\)))/ims';\n $regex2 = '/(\\s|^|\\()([^\\s<\\(\\.]+\\.[\\w]{2,}[^\\s<]*?)(\\.?(\\s|$|\\)))/ims';\n\n foreach ($dom->nodes as $el) {\n\n if ($el->tag == 'text') {\n if (count($el->nodes) == 0 && $el->parent->tag != 'a') {\n $el->innertext = preg_replace($regex, '$1<a href=\"$2\">$2</a>$3', $el->innertext);\n $el->innertext = preg_replace($regex2, '$1<a href=\"http://$2\">$2</a>$3', $el->innertext);\n }\n }\n\n }\n\n return substr($dom->save(), 3, -4);\n\n }", "function auto_link($text)\n{\n\n\n\t$url_re = '@(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)@';\n\t$url_replacement = \"<a href='$1' target='_blank'>$1</a>\";\n\n\treturn preg_replace($url_re, $url_replacement, $text);\n}", "function convert_to_links($msg){\r\n\t\t$final_message = preg_replace(array('/(?i)\\b((?:https?:\\/\\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:\\'\".,<>?«»“”‘’]))/', '/(^|[^a-z0-9_])@([a-z0-9_]+)/i', '/(^|[^a-z0-9_])#([a-z0-9_]+)/i'), array('<a href=\"$1\" target=\"_blank\">$1</a>', '$1<a href=\"\">@$2</a>', '$1<a href=\"index.php?hashtag=$2\">#$2</a>'), $msg);\r\n\t\treturn $final_message;\r\n\t}", "abstract public function convert_to_html();", "function hyperlink($text)\n{\n\t$text = ereg_replace(\"[a-zA-Z]+://([-]*[.]?[a-zA-Z0-9_/-?&%])*\", \"<a href=\\\"\\\\0\\\">\\\\0</a>\", $text);\n\t$text = ereg_replace(\"(^| )(www([-]*[.]?[a-zA-Z0-9_/-?&%])*)\", \"\\\\1<a href=\\\"http://\\\\2\\\">\\\\2</a>\", $text);\n\treturn $text;\n}", "public function linkAction() : object\n {\n $title = \"Markdown\";\n $text = file_get_contents(__DIR__ . \"/textfiles/clickable.txt\");\n // $filter = new MyTextFilter();\n\n // Deal with the action and return a response.\n $this->app->page->add(\"textfilter/clickable\", [\n \"text\" => $text,\n \"html\" => $this->filter->parse($text, [\"link\"])\n ], \"main\");\n return $this->app->page->render([ \"title\" => $title ]);\n }", "function toAscii($html) {\n // strip off most tags\n $html = strip_tags($html,'<a>');\n $to_replace = \"/<a[^>]*href=[\\\"\\']([^\\\"^']*)[\\\"\\'][^>]*>([^<]*)<\\/a>/i\";\n _links_init();\n $ascii = preg_replace_callback ($to_replace, '_links_add', $html);\n $ascii .= \"\\n\\n\" . _links_list();\n return strip_tags($ascii);\n}", "public static function parseLinks( $text ) {\n\t\t# Don't let this get flooded\n\t\t$max = 10;\n\t\t$count = 0;\n\n\t\t$linkList = '';\n\t\t# Normalize space characters\n\t\t$text = str_replace( array(\"\\r\",\"\\t\"), array(\"\\n\",\" \"), htmlspecialchars($text) );\n\t\t# Split out each line as a link\n\t\t$lines = explode( \"\\n\", $text );\n\t\tforeach( $lines as $line ) {\n\t\t\t$links = explode(\" \",$line,2);\n\t\t\t$link = $links[0];\n\t\t\t# Any explanation text is not part of the link...\n\t\t\t$extra = isset($links[1]) ? ' '.$links[1] : '';\n\t\t\tif( strpos($link,'.') ) {\n\t\t\t\t$link = ( strpos($link,'http://')===false ) ? 'http://'.$link : $link;\n\t\t\t\t$linkList .= \"<li><a href='$link'>$link</a>$extra</li>\\n\";\n\t\t\t}\n\t\t\t$count++;\n\t\t\tif( $count >= $max )\n\t\t\t\tbreak;\n\t\t}\n\t\tif( $linkList == '' ) {\n\t\t\t$linkList = wfMsgHtml( 'confirmaccount-none-p' );\n\t\t} else {\n\t\t\t$linkList = \"<ul>{$linkList}</ul>\";\n\t\t}\n\t\treturn $linkList;\n\t}", "public static function convertTextToHtml($text)\n\t{\n\t $htmltext = \\formslib\\Utility\\Security::escapeHtml($text);\n\t\t$htmltext = str_replace(\"\\r\", '', $htmltext);\n\t\t$htmltext = str_replace(\"\\n\", \"<br />\\n\", $htmltext);\n\t\treturn $htmltext;\n\t}", "function get_links_from_text($raw) {\r\n\t// via http://stackoverflow.com/a/5289151/2496685\r\n\t$reg_exUrl = \"(?i)\\b((?:https?:\\/\\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\\\".,<>?«»“”‘’]))\";\r\n\t$matches = array();\r\n\tpreg_match_all($reg_exUrl, $raw, $matches);\r\n\treturn $matches[0];\r\n}", "public static function popup_links($text) {\n\t\t// Right now it's a moderately dumb function, ideally it would detect whether\n\t\t// a target or rel attribute was already there and adjust its actions accordingly.\n\t\t$text = preg_replace('/<a (.+?)>/i', \"<a $1 target='_blank' rel='external'>\", $text);\n\t\treturn $text;\n\t}", "private static function getHtml(string $text): string\n {\n $markdown = static::normalizeHTMLAndMarkdown($text);\n\n $html = static::convertMarkdownToHtml($markdown);\n\n return $html;\n }", "public static function makeUrlClickable($text) {\n\t\treturn preg_replace('!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;//=]+)!i', '<a href=\"$1\" target=\"_blank\">$1</a>', $text);\n\t}", "function _hyperlinkUrls($text, $mode = '0', $trunc_before = '', $trunc_after = '...', $open_in_new_window = true) {\n\t\t$text = ' ' . $text . ' ';\n\t\t$new_win_txt = ($open_in_new_window) ? ' target=\"_blank\"' : '';\n\n\t\t# Hyperlink Class B domains\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-\\.]+)\\.(com|org|net|gov|edu|us|info|biz|ws|name|tv|eu|mobi)((?:/[^\\s{}\\(\\)\\[\\]]*[^\\.,\\s{}\\(\\)\\[\\]]?)?)#ie\", \"'$1<a href=\\\"http://$2.$3$4\\\" title=\\\"http://$2.$3$4\\\"$new_win_txt>' . $this->_truncateLink(\\\"$2.$3$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink anything with an explicit protocol\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])(([a-z]+?)://([A-Za-z_0-9\\-]+\\.([^\\s{}\\(\\)\\[\\]]+[^\\s,\\.\\;{}\\(\\)\\[\\]])))#ie\", \"'$1<a href=\\\"$2\\\" title=\\\"$2\\\"$new_win_txt>' . $this->_truncateLink(\\\"$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink e-mail addresses\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-_\\.]+?)@([^\\s,{}\\(\\)\\[\\]]+\\.[^\\s.,{}\\(\\)\\[\\]]+)#ie\", \"'$1<a href=\\\"mailto:$2@$3\\\" title=\\\"mailto:$2@$3\\\">' . $this->_truncateLink(\\\"$2@$3\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\treturn substr($text, 1, strlen($text) - 2);\n\t}", "function getlinkfromcontent($text)\n{\n$reg_exUrl = \"/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\n\n// The Text you want to filter for urls\n\n// Check if there is a url in the text\nif(preg_match($reg_exUrl, $text, $url)) {\n\n// make the urls hyper links\necho preg_replace($reg_exUrl, \"<a target='_new' href='\".$url[0].\"' target='_blank' style='color:#166cec;text-decoration:underline;'>\".$url[0].\"</a>\", $text);\n\n} else {\n\n// if no urls in the text just return the text\nreturn $text;\n\n}\n}", "function parseText($text) {\r\n\t\r\n\t\r\n\t\t$parsed_text = $this->urlsTolinks($text);\r\n\t\t\r\n\t\t//if no paragraph or break tags replace \\n with <br />\r\n\t\t\r\n\t\tif (!eregi('(<p|<br)', $parsed_text)) {\r\n\t\t\t\r\n\t\t\t$parsed_text = nl2br($parsed_text);\r\n\t\t\r\n \t\t} \r\n\t\t\r\n\t\t$parsed_text = $this->replaceMediaPlaceholders($parsed_text);\r\n\t\t$parsed_text = $this->replaceUserVariables($parsed_text);\r\n\t\t$parsed_text = $this->textoGif($parsed_text);\r\n\t\t//$parsed_text = $this->popuplinks($parsed_text);\r\n\t\t \t\t\r\n\t\treturn $parsed_text;\r\n\t\r\n\t}", "public static function parse($text, $options=array()) {\n\t\t$strip_images = static::option($options,'strip_images');\n\n\t\t//parse markdown\n\t\tif(static::option($options,'markdown')) {\n\t\t\t$markdown = new MarkdownExtra();\n\n\t\t\t$markdown->no_markup = !static::option($options, 'allow_html');\n\t\t\t$markdown->nl2br = static::option($options, 'nl2br');\n\n\t\t\t$text = $markdown->transform($text);\n\n\t\t\tif($strip_images) {\n\t\t\t\t$text = preg_replace(\"#<img .*?src=\\\"(.+?)\\\".*?/>#i\", \"$1\",$text);\n\t\t\t}\n\t\t} elseif(!static::option($options,'allow_html')) {\n\t\t\t// Markdown makes entities for us - we only need this if markdown option is OFF\n\t\t\t$text = htmlentities($text, ENT_QUOTES,'UTF-8' );\n\t\t}\n\n\t\t$detect_links = static::option($options, 'link_detection');\n\t\t$detect_images = static::option($options, 'image_detection') && !$strip_images;\n\n\t\t$text = static::parse_urls($text, $detect_links, $detect_images);\n\n\t\treturn $text;\n\t}", "function htmlout($text)\n{\n\techo html($text);\n}", "public static function linkify($text)\n\t{\n\t\treturn preg_replace(\"\n\t\t\t#((http|https|ftp)://(\\S*?\\.\\S*?))(\\s|\\;|\\)|\\]|\\[|\\{|\\}|,|\\\"|'|:|\\<|$|\\.\\s)#ie\",\n\t\t\t\"'<a href=\\\"$1\\\" target=\\\"_blank\\\">$3</a>$4'\",\n\t\t\t$text\n\t\t);\n\t}", "private function html($text) {\r\n return $text;\r\n }", "function hyperlink($text) {\n\n\n $regex = \"/(?#WebOrIP)((?#protocol)((http|https):\\/\\/)?(?#subDomain)(([a-zA-Z0-9]+\\.(?#domain)[a-zA-Z0-9\\-]+(?#TLD)(\\.[a-zA-Z]+){1,2})|(?#IPAddress)((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])))+(?#Port)(:[1-9][0-9]*)?)+(?#Path)((\\/((?#dirOrFileName)[a-zA-Z0-9_\\-\\%\\~\\+]+)?)*)?(?#extension)(\\.([a-zA-Z0-9_]+))?(?#parameters)(\\?([a-zA-Z0-9_\\-]+\\=[a-z-A-Z0-9_\\-\\%\\~\\+]+)?(?#additionalParameters)(\\&([a-zA-Z0-9_\\-]+\\=[a-z-A-Z0-9_\\-\\%\\~\\+]+)?)*)?/\";\n $text = preg_replace( $regex, \"<a href=\\\"http://$4\\\" style=\\\"font-weight: bold;\\\" target='_new'>$1</a>\", $text );\n\n/*\n // match protocol://address/path/\n $text = ereg_replace(\"[a-zA-Z]+://([.]?[a-zA-Z0-9_/-])*\", \"<a href=\\\"\\\\0\\\">\\\\0</a>\", $text);\n\n // match www.something\n $text = ereg_replace(\"(^| )(www([.]?[a-zA-Z0-9_/-])*)\", \"\\\\1<a href=\\\"http://\\\\2\\\">\\\\2</a>\", $text);\n*/\n return $text;\n }", "final protected function _textToHtml($text)\n\t{\n\t\treturn nl2br(str_replace(\"\\t\", '&nbsp;&nbsp;&nbsp;&nbsp;', htmlspecialchars($text)));\n\t}", "public function toHyperlink(?string $linkText = null): A;", "function processWikitext($wikilang, $text, $makelinks) {\r\n $result = $text;\r\n $differentLinkRegex=\"/\\[\\[([^\\|]*)\\|([^\\]]*)\\]\\]/\";\r\n $simpleLinkRegex=\"/\\[\\[([^\\]]*)\\\\]\\]/\";\r\n $wikiUrl = 'http://' . $wikilang . '.wikipedia.org/wiki/';\r\n $differentLinkReplace = \"'<a href=\\\"\" . $wikiUrl .\"' . rawurlencode('$1') . '\\\">$2</a>'\";\r\n $simpleLinkReplace = \"'<a href=\\\"\". $wikiUrl .\"' . rawurlencode('$1') . '\\\">$1</a>'\";\r\n if ( $makelinks ) {\r\n $result = preg_replace($differentLinkRegex . \"e\", $differentLinkReplace, $result);\r\n $result = preg_replace($simpleLinkRegex . \"e\", $simpleLinkReplace, $result);\r\n $result = $result;\r\n } else {\r\n $result = preg_replace($differentLinkRegex, \"$2\", $result);\r\n $result = preg_replace($simpleLinkRegex, \"$1\", $result);\r\n }\r\n return $result;\r\n}", "public function autoLinkUrls($text) {\n\t\t$placeholders = [];\n\t\t$replace = [];\n\n\t\t$insertPlaceholder = function($matches) use (&$placeholders) {\n\t\t\t$key = md5($matches[0]);\n\t\t\t$placeholders[$key] = $matches[0];\n\n\t\t\treturn $key;\n\t\t};\n\n\t\t$pattern = '#(?<!href=\"|src=\"|\">)((?:https?|ftp|nntp)://[a-z0-9.\\-:]+(?:/[^\\s]*)?)#i';\n\t\t$text = preg_replace_callback($pattern, $insertPlaceholder, $text);\n\n\t\t$pattern = '#(?<!href=\"|\">)(?<!\\b[[:punct:]])(?<!http://|https://|ftp://|nntp://)www.[^\\n\\%\\ <]+[^<\\n\\%\\,\\.\\ <](?<!\\))#i';\n\t\t$text = preg_replace_callback($pattern, $insertPlaceholder, $text);\n\n\t\tforeach ($placeholders as $hash => $url) {\n\t\t\t$link = $url;\n\n\t\t\tif (!preg_match('#^[a-z]+\\://#', $url)) {\n\t\t\t\t$url = 'http://' . $url;\n\t\t\t}\n\t\t\t$replace[$hash] = \"<a href=\\\"{$url}\\\">{$link}</a>\";\n\t\t}\n\t\treturn strtr($text, $replace);\n\t}", "public function makeClickableLinks()\n {\n $this->texte = trim(preg_replace(\n \"#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i\",\n \"$1$3</a>\",\n preg_replace_callback(\n '#([\\s>])((www|ftp)\\.[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches, 'http://');\n },\n preg_replace_callback(\n '#([\\s>])([\\w]+?://[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches);\n },\n ' '.$this->texte\n )\n )\n ));\n\n return $this;\n }", "function apri_in_nuova_scheda($text) {\n\t$return_url = str_replace('<a', '<a target=\"_blank\" title=\"Apri link su nuova scheda\"', $text);\n\treturn $return_url;\n}", "protected function pageParse( \n\t\tstring\t$text, \n\t\tarray\t&$links \n\t) : string {\n\t\t$text\t= \n\t\t\\strip_tags( \\nl2br( $text, false ), 'br' );\n\t\t\n\t\t$links\t= [];\n\t\t\n\t\t\\preg_match_all( self::WIKI_LINK_RX, $text, $m );\n\t\tif ( !empty( $m ) ) {\n\t\t\t$links = \n\t\t\t \\array_filter( \n\t\t\t\t$m, \n\t\t\t\tfunction( $k ) {\n\t\t\t\t\treturn \\is_string( $k );\n\t\t\t\t}, \\ARRAY_FILTER_USE_KEY \n\t\t\t);\n\t\t\t\n\t\t\t// Resort links\n\t\t\t$c = count( $m['term'] );\n\t\t\tfor ( $i = 0; $i < $c; $i++ ) {\n\t\t\t\t$links[] = \n\t\t\t\t[ $m['term'][$i] => $m['link'][$i] ];\n\t\t\t}\n\t\t}\n\t\t\n\t\t// TODO: Replace matches with HTML links\n\t\treturn $text;\n\t}", "function template_text_format($text)\n {\n // Remove Escape Character Slashes\n $text = trim(stripslashes($text));\n // Get rid of carriage returns\n $text = str_replace(\"\\r\",\"\",$text);\n // Strip out all html except simple text formatting\n $text = htmlentities($text);\n // Convert urls to hyperlinks\n $text = eregi_replace(\"((http://)|(https://).[^\\s]+)\\ \",\"<a href=\\\"\\\\0\\\">\\\\0</a>\",$text); \n\n if ($_SESSION['prefs']['disable_wrap'] != \"t\") {\n $lines = explode(\"\\n\",$text);\n $text = \"\";\n\n $wrap = preg_match(\"/[0-9]+/\",$_SESSION['prefs']['word_wrap']) ? $_SESSION['prefs']['word_wrap'] : 80;\n foreach ($lines as $key => $val) {\n if (empty($val)) {\n $text .= \"\\n\";\n } else {\n if (strlen($val) > $wrap) {\n $val = wordwrap($val,$wrap,\"\\n\",TRUE);\n }\n\n $text .= stripslashes($val).\"\\n\";\n }\n }\n \n $text = \"<pre>$text</pre>\";\n } else {\n // Replace newlines with <br />'s\n $text = str_replace(\"\\n\",\"<br />\",$text);\n }\n return $text;\n }", "function render_link($text, $url) {\n return \"<a href=\\\"$url\\\">$text</a>\";\n }", "public abstract function asHTML();", "public function html_text()\n {\n return $this->dispatch(\n new MarkdownToHtml(\n $this->wrappedObject->text\n )\n );\n }", "private static function normalizeHTMLAndMarkdown(string $text): string\n {\n $markdown = static::wrapBasicTagsInAParagraph($text);\n\n $markdown = static::wrapImagesTagsInAParagraph($markdown);\n\n $markdown = static::replaceLineBreaksInsideTagsForBr($markdown);\n\n return static::replaceParagraphsForMarkdown($markdown);\n }", "function bb2html($text)\n{\n $bbcode = array(\n \"[list]\", \"[*]\", \"[/list]\", \n \"[img]\", \"[/img]\", \n \"[b]\", \"[/b]\", \n \"[u]\", \"[/u]\", \n \"[i]\", \"[/i]\",\n '[color=\"', \"[/color]\",\n \"[size=\\\"\", \"[/size]\",\n '[url=\"', \"[/url]\",\n \"[mail=\\\"\", \"[/mail]\",\n \"[code]\", \"[/code]\",\n \"[quote]\", \"[/quote]\",\n '\"]');\n $htmlcode = array(\n \"<ul>\", \"<li>\", \"</ul>\", \n \"<img src=\\\"\", \"\\\">\", \n \"<b>\", \"</b>\", \n \"<u>\", \"</u>\", \n \"<i>\", \"</i>\",\n \"<span style=\\\"color:\", \"</span>\",\n \"<span style=\\\"font-size:\", \"</span>\",\n '<a target=\"_blank\" href=\"', \"</a>\",\n \"<a href=\\\"mailto:\", \"</a>\",\n \"<code>\", \"</code>\",\n \"<blockquote><i>\", \"</i></blockquote>\",\n '\">');\n $newtext = str_replace($bbcode, $htmlcode, $text);\n //$newtext = nl2br($newtext);//second pass\n return $newtext;\n}", "function _transformAreaMap($text)\n\t{\n\t\t$view_url = $this->parse->getRenderConf('xhtml', 'freelink', 'view_url');\n\t\t$new_url = $this->parse->getRenderConf('xhtml', 'freelink', 'new_url');\n\t\t$pageList = $this->parse->getRenderConf('Xhtml', 'Freelink', 'pages');\n\t\t\n\t\t// treat every line as a free-linked line, with the\n\t\t// exception that we don't use any text after the first\n\t\t// pipe character.\n\t\t$text = htmlspecialchars(trim($text));\n\t\t$lines = explode(\"\\n\", $text);\n\t\t\n\t\t$pagelines = array();\n\t\tforeach ($lines as $line) {\n\t\t\t\n\t\t\t// count number of spaces at the beginning of the line\n\t\t\t// and set the level based on the count\n\t\t\tpreg_match('/^( {0,})(.*)/', $line, $matches);\n\t\t\t$level = strlen($matches[1]);\n\t\t\t$spaces = str_pad('', $level);\n\t\t\t\n\t\t\t// trim off the depth-level spaces\n\t\t\t$line = trim($line);\n\t\t\t\n\t\t\t// skip blank lines\n\t\t\tif ($line == '') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// split the line into its 'page' and 'after' parts; the\n\t\t\t// 'after' is the part after the first pipe character on the\n\t\t\t// line (including the pipe character itself).\n\t\t\t$pos = strpos($line, '|');\n\t\t\tif ($pos === false) {\n\t\t\t\t$page = $line;\n\t\t\t\t$after = '';\n\t\t\t} else {\n\t\t\t\t$page = trim(substr($line, 0, $pos));\n\t\t\t\t$after = substr($line, $pos);\n\t\t\t}\n\t\t\t\n\t\t\t// make the proper link...\n\t\t\tif (in_array($page, $pageList)) {\n\t\t\t\t// page exists\n\t\t\t\t$link = sprintf($view_url, $page);\n\t\t\t\t$pagelines[] = \"$spaces<a href=\\\"$link\\\">$page</a> $after\";\n\t\t\t} else {\n\t\t\t\t// page does not exist\n\t\t\t\t$link = sprintf($new_url, $page);\n\t\t\t\t$pagelines[] = \"$spaces$page<a href=\\\"$link\\\">?</a> $after\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$html = \"<pre><code>\" . implode(\"\\n\", $pagelines) . \"</code></pre>\";\n\t\treturn $html;\n\t}", "function parseLinksOld($text)\n{\n\t// ADD LINE BREAKS\n\t$text = nl2br($text);\n\t\n\t/*\n\tthe counting method doesn't work - if there is, for example, a case with 1 instance of plain www and 3 instances of https://www,\n\tthen the count is < 0 and the www will not get replaced\n\t*/\n\t// COUNT THE NUMBER OF OCCURRENCES OF \"WWW\" WITHOUT A PRECEEDING \"HTTP\"\n\t$numWWW \t= substr_count ( $text, 'www.' );\n\t$numHTTPWWW = substr_count ( $text, '://www.' );\n\t$numHTTPSWWW = substr_count($text, 'https://www');\n\t$w = $numWWW - $numHTTPWWW - $numHTTPSWWW;\n\n\t// REPLACE ALL INSTANCES OF \"WWW\" WITH \"HTTP://WWW\" SO THAT PARSING FUNCTION WILL HANDLE ALL CASES\n\tif ($w > 0) { $text = str_replace ( 'www', 'http://www', $text, $w ); }\n\t\n\t// BEGIN PARSING\n\t$needle = 'http';\n\t$needleLength = strlen($needle);\n\t$needleCount = substr_count ( $text, $needle );\n\t\n\t// DECLARE ARRAYS FOR THE LINKS\n\t$needles = array();\n\t$tags = array();\n\t$hyperlinks = array();\n\n\t// LOOP THROUGH ALL LINKS AND PARSE THEM\n\tfor ( $i = 0; $i < $needleCount; $i++ )\n\t{\n\t\t// DETERMINE START POS OF LINK\n\t\t$needleStart = strpos($text, $needle, $needleStart + $needleLength );\n\n\t\t// DETERMINE ENDPOINT OF LINK - EITHER A SPACE OR LINE BREAK\n\t\t$distSpace \t= abs(stripos($text, ' ', $needleStart) - $needleStart); \n\t\t$distNL \t= abs(stripos($text, \"\\n\", $needleStart) - $needleStart); \n\t\t$distBR\t\t= abs(stripos($text, '<br>', $needleStart) - $needleStart);\n\t\tif ($distSpace <= $distNL) { $needleLength = $distSpace; } else { $needleLength = $distNL; } $needleLength += 0;\n\n\t\t// PARSE OUT THE LINK FROM BETWEEN THE START POS AND ENDPOINT\n\t\t$needleParsed = substr($text, $needleStart, $needleLength);\n\t\t$needleUntrimmed = $needleParsed;\n\n\t\t// TRIM EXTRA CHARACTERS ( periods or parentheses or <br> tags from end of string )\n\t\t$needleTrim1 = substr($needleParsed, 0, strlen($needleParsed)-1);\n\t\t$needleTrim2 = substr($needleParsed, 0, strlen($needleParsed)-2);\n\n\t\t$lastChar \t\t= substr($needleParsed, -1);\n\t\t$secondLastChar = substr($needleParsed, -2, 1);\n\n\t\tif ($lastChar == '.' or $lastChar == ',' or $lastChar == ')') \t\t\t\t\t\t{ $needleParsed = $needleTrim1; }\n\t\tif ($secondLastChar == '.' or $secondLastChar == ',' or $secondLastChar == ')') \t{ $needleParsed = $needleTrim2; }\n\n\t\t$needleTrimBR \t= substr($needleParsed, 0, strlen($needleParsed)-3);\n\t\tif ( substr_count ( $needleParsed, '<br') > 0 )\t\t\t\t\t\t\t\t\t\t{ $needleParsed = $needleTrimBR; }\n\n\t\t// THE LINK SHOULD NOW BE PROPERLY PARSED\t\n\n\t\t// CONSTRUCT THE <a> TAG\n\t\t$needleTag = '<a href = \"'.$needleParsed.'\" target = \"_blank\">'.$needleParsed.'</a>'; \n\t\t// COULD EVENTUALLY DEFINE A VALUE FOR HREF AND DISPLAY TEXT SEPARATELY?\n\n\t\t// UPDATE THE LINK ARRAYS\n\t\t$needles[$i] = $needleParsed;\n\t\t$tags[$i] = $needleTag;\n\t\t$hyperlinks[$i] = array($needleParsed, $needleTag);\n\t\t\n\t} // END FOR LOOP\n\n\t// REPLACE THE LINK TEXT WITH THE <a> TAGS (USING THE ARRAYS AS PARAMS IN THE STR REPLACE FUNCTION)\n\t$parsed = str_replace($needles, $tags, $text);\n\treturn $parsed;\n\n}", "public function autoLinkEmails($text) {\n\t\t$atom = '[a-z0-9!#$%&\\'*+\\/=?^_`{|}~-]';\n\t\t$regex = '/(' . $atom . '+(?:\\.' . $atom . '+)*@[a-z0-9-]+(?:\\.[a-z0-9-]+)+)/i';\n\n\t\t// Encodes an email address as a mailto link with each character\n\t\t// of the address encoded as either a decimal or hex entity, in\n\t\t// the hopes of foiling most address harvesting spam bots.\n\t\t//\n\t\t// Based upon the implementation as available in PHP Markdown.\n\t\t// Copyright (c) 2004-2008 Michel Fortin\n\t\t// Licensed under the 3-clause BSD license.\n\t\t$encode = function($addr) {\n\t\t\t$addr = \"mailto:{$addr}\";\n\t\t\t$chars = preg_split('/(?<!^)(?!$)/', $addr);\n\t\t\t$seed = (int) abs(crc32($addr) / strlen($addr)); # Deterministic seed.\n\n\t\t\tforeach ($chars as $key => $char) {\n\t\t\t\t$ord = ord($char);\n\t\t\t\t// Ignore non-ascii chars.\n\t\t\t\tif ($ord < 128) {\n\t\t\t\t\t$r = ($seed * (1 + $key)) % 100; // Pseudo-random function.\n\t\t\t\t\t// roughly 10% raw, 45% hex, 45% dec\n\t\t\t\t\t// '@' *must* be encoded. I insist.\n\t\t\t\t\tif ($r > 90 && $char != '@') /* do nothing */;\n\t\t\t\t\telse if ($r < 45) $chars[$key] = '&#x'.dechex($ord).';';\n\t\t\t\t\telse $chars[$key] = '&#'.$ord.';';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$addr = implode('', $chars);\n\t\t\t$text = implode('', array_slice($chars, 7)); // text without `mailto:`\n\n\t\t\treturn \"<a href=\\\"{$addr}\\\">{$text}</a>\";\n\t\t};\n\n\t\treturn preg_replace_callback($regex, function($matches) use ($encode) {\n\t\t\treturn $encode($matches[0]);\n\t\t}, $text);\n\t}", "function activate_links($txt){\r\n\t\t$txt = str_replace(' ',' ',$txt);\r\n\t\t$words = explode(' ',$txt);\r\n\t\t$ret = '';\r\n\t\tforeach($words as $word){\r\n\t\t\tif(strpos($word,'http://')===0) $word = '<a href=\"'.$word.'\" target=\"_blank\" google_event_tag=\"Home Page - Right Module 4|Click|Twitter Link\">'.$word.'</a>';\r\n\t\t\t$ret .= ' ' . $word;\r\n\t\t}\r\n\t\treturn trim($ret);\r\n\t}", "function tfnm_parse_link( $text, $url ){\n $start = strpos( $text, 'href=\"\"' );\n return substr_replace( $text, 'href=\"' . esc_url( $url ) . '\"', $start, strlen('href=\"\"') );\n}", "public function format_text( $text ) {\r\n\t\t$text = $this->format_text_to_links( $text );\r\n\t\t$text = $this->format_text_to_twitter( $text );\r\n\t\t\r\n\t\treturn $text;\r\n\t}", "public function prepareLinks($params) {\n\t\t\n\t\t$defaultParams = array(\n\t\t\t'text' => '',\n\t\t\t'queryString' => '',\n\t\t\t'separator' => '?',\n\t\t\t'type' => 'HTML'\n\t\t);\n\t\t\n\t\t$params = array_merge($defaultParams, $params);\n\t\t\n\t\t// nothing to substitute => return\n\t\tif (!$params['queryString']) {\n\t\t\treturn $params['text'];\n\t\t}\n\t\t\n\t\t// search in HTML or in text?\n\t\tswitch(strtolower($params['type'])) {\n\t\t\t\n\t\t\tcase 'text':\n\t\t\t\tpreg_match_all('/(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?/i', $params['text'], $match);\n\t\t\t\t$tagFragments = $match[0];\n\t\t\t\t$links = $match[0];\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\tcase 'html':\n\t\t\t\tpreg_match_all('/\\<a.*href\\=[\\'\"\\s]?([^\\'\"\\s]+)/i', $params['text'], $match);\n\t\t\t\t$tagFragments = $match[0];\n\t\t\t\t$links = $match[1];\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t\n\t\t$extendedFragments = array();\n\t\t\n\t\t// extend links\n\t\tforeach ($tagFragments as $key => $tagFragment) {\n\t\t\t\n\t\t\tif (strstr($links[$key], '?')) {\n\t\t\t\t$separator = '&';\n\t\t\t} else {\n\t\t\t\t$separator = $params['separator'];\n\t\t\t}\n\t\t\t\n\t\t\t$extendedFragments[$key] = str_ireplace($links[$key], $links[$key] . $separator . $params['queryString'], $tagFragment);\n\t\t}\n\t\t\n\t\t$text = $params['text'];\n\t\tforeach ($tagFragments as $key => $tagFragment) {\n\t\t\t$text = str_ireplace($tagFragment, $extendedFragments[$key], $text);\n\t\t}\n\t\t\n\t\treturn $text;\n\t\t\n\t}", "function postlink($text){\n\t\t\t\n\t\t$listlink=array();\n\t\t//die('a '.count($listlink));\n\t\t$text1=' '.str_replace('<br/>',' <br/> ',str_replace('<br />',' <br /> ',$text)).' ';\n\t\t//die($text1);\n\t\tif (stristr($text1,' http://www.')){$listlink[]=' http://www.';\t\t}\n\t\tif (stristr($text1,' https://www.')){$listlink[]=' https://www.';\t\t}\n\t\tif (stristr($text1,' www.')){$listlink[]=' www.';\t\t}\n\t\tif (stristr($text1,' http://')){$listlink[]=' http://';\t\t}\n\t\tif (stristr($text1,' ftp://')){$listlink[]=' ftp://';\t\t}\n\t\tif (stristr($text1,' https://')){$listlink[]=' https://';\t\t}\t\n\t\t\n\t\tfor($i=0;$i<count($listlink);$i++){\n\t\t$linkstart=$listlink[$i];\n\t\t\n\t\tif (stristr($text1,$linkstart)){$textlinker=stristr($text1,$linkstart);\t\t} else{$textlinker=\"\";\t}\n\t\t\n\t\t\t$postholder=str_replace($textlinker,'',$text1);\t\n\n\t\t\twhile ($textlinker!=\"\"){\n\t\t\t$picklink=' '.strtok($textlinker,' ');\n\t\t\t//die($picklink);\n\t\t\t$postholder=$postholder.' '.'<a title=\"Visit link\" target=\"_blank\" href=\"'.trim(str_replace('ftp://http://','ftp://',str_replace('https://http://','http://',str_replace('http://http://','http://',str_replace('www.','http://',strtolower($picklink)))))).'\"><span style=\"word-break:break-all\">'.trim($picklink).'</span></a>';\n\t\t\t$textlinker=str_replace($picklink,'',$textlinker);\n\t\t\t//die($textlinker);\n\t\t\tif (stristr($textlinker,$linkstart)){$postholder=$postholder.' '.str_replace(stristr($textlinker,$linkstart),'',$textlinker);\t$textlinker=stristr($textlinker,$linkstart); \t\t} else{$postholder=$postholder.' '.$textlinker;\t$textlinker=\"\";\t}\n\n\t\t\t\t\t}\t\t\n\t\t\t\t\t$text1=$postholder;\n\t\t\t\t}\n\t\t\t\t\treturn($text1);\n\t\t\t}", "function comment_links_in_new_tab($text) {\n$return = str_replace('<a', '<a target=\"_blank\"', $text);\nreturn $return;\n}", "static protected function bbcodeLinkParser($text, &$list)\n {\n $list['in'] = array_merge(\n $list['in'],\n array('`([^=\\]])((?:https?|ftp)://\\S+[[:alnum:]]/?)`si',\n\t '`([^=\\]])((?<!//)(www\\.\\S+[[:alnum:]]/?))`si',\n\t '`\\[url(?:\\=?)(.*?)\\](.*?)\\[/url\\]`is',\n\t '`\\[img(.*?)\\](.*?)\\[/img\\]`is',\n\t )); \n $list['out'] = array_merge(\n $list['out'],\n array('<a href=\"$2\">$2</a>',\n\t '<a href=\"http://$2\">$2</a>',\n\t '<a href=\"$1\">$2</a>',\n\t '<img $1 src=\"$2\" />',\n\t ));\n }", "public function mailto_makelinks($data, $conf)\n {\n // http-split\n $aTagParams = $this->getATagParams($conf);\n $textpieces = explode('mailto:', $data);\n $pieces = count($textpieces);\n $textstr = $textpieces[0];\n $tsfe = $this->getTypoScriptFrontendController();\n for ($i = 1; $i < $pieces; $i++) {\n $len = strcspn($textpieces[$i], chr(32) . TAB . CRLF);\n if (trim(substr($textstr, -1)) === '' && $len) {\n $lastChar = substr($textpieces[$i], $len - 1, 1);\n if (!preg_match('/[A-Za-z0-9]/', $lastChar)) {\n $len--;\n }\n $parts[0] = substr($textpieces[$i], 0, $len);\n $parts[1] = substr($textpieces[$i], $len);\n $linktxt = preg_replace('/\\\\?.*/', '', $parts[0]);\n list($mailToUrl, $linktxt) = $this->getMailTo($parts[0], $linktxt);\n $mailToUrl = $tsfe->spamProtectEmailAddresses === 'ascii' ? $mailToUrl : htmlspecialchars($mailToUrl);\n $res = '<a href=\"' . $mailToUrl . '\"' . $aTagParams . '>';\n $wrap = isset($conf['wrap.']) ? $this->stdWrap($conf['wrap'], $conf['wrap.']) : $conf['wrap'];\n if ((string)$conf['ATagBeforeWrap'] !== '') {\n $res = $res . $this->wrap($linktxt, $wrap) . '</a>';\n } else {\n $res = $this->wrap($res . $linktxt . '</a>', $wrap);\n }\n $textstr .= $res . $parts[1];\n } else {\n $textstr .= 'mailto:' . $textpieces[$i];\n }\n }\n return $textstr;\n }", "function drush_html_to_text($html, $allowed_tags = NULL) {\n $replacements = [\n '<hr>' => '------------------------------------------------------------------------------',\n '<li>' => ' * ',\n '<h1>' => '===== ',\n '</h1>' => ' =====',\n '<h2>' => '---- ',\n '</h2>' => ' ----',\n '<h3>' => '::: ',\n '</h3>' => ' :::',\n '<br/>' => \"\\n\",\n ];\n $text = str_replace(array_keys($replacements), array_values($replacements), $html);\n return html_entity_decode(preg_replace('/ *<[^>]*> */', ' ', $text));\n}", "function build_link($text, $page){\n\t$format = '<a href=\"%2$s\">%1$s</a>';\n\n\tprintf($format, $text, link_to($page, false));\n}", "public static function makeClickableLinks ($text, $addMailto = false, $replaceVisibleUrlWithText = false, $target = '_blank')\r\n\t{\r\n\t\t$delimiter = '!';\r\n\t\t$text = preg_replace ($delimiter . '(((ftp|http|https)://)[-a-zA-Z0-9@:%_\\+.~#?&//=;]+[-a-zA-Z0-9@:%_\\+~#?&//=]+)' . \"{$delimiter}i\", '<a' . ($target ? \" target=\\\"{$target}\\\"\" : '') . ' href=\"$1\">' . ($replaceVisibleUrlWithText ? $replaceVisibleUrlWithText : '$1') . '</a>', $text);\r\n\t\t$text = preg_replace ($delimiter . '([\\s()[{}])(www.[-a-zA-Z0-9@:%_\\+.~#?&//=;]+[-a-zA-Z0-9@:%_\\+~#?&//=]+)' . \"{$delimiter}i\", '$1<a' . ($target ? \" target=\\\"{$target}\\\"\" : '') . ' href=\"http://$2\">' . ($replaceVisibleUrlWithText ? $replaceVisibleUrlWithText : '$2') . '</a>', $text);\r\n\t\tif ($addMailto) {$text = preg_replace ($delimiter . '([_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,3})' . \"{$delimiter}i\", '<a href=\"mailto:$1\">$1</a>', $text);}\r\n\t\treturn $text;\r\n\t}", "function Link($text, $path, $options = array()) {\n // Merge in defaults.\n $options += array(\n 'attributes' => array(),\n 'html' => FALSE,\n );\n\n\n // Remove all HTML and PHP tags from a tooltip. For best performance, we act only\n // if a quick strpos() pre-check gave a suspicion (because strip_tags() is expensive).\n if (isset($options['attributes']['title']) && strpos($options['attributes']['title'], '<') !== FALSE) {\n $options['attributes']['title'] = strip_tags($options['attributes']['title']);\n }\n\n return '<a' . ( ($path) ? ' href=\"' . SITE_URL . '/' . $path . '\"' : '') . $this->SetAttributes($options['attributes']) . '>' . ($options['html'] ? $text : $this->CheckPlain($text)) . '</a>';\n }", "function makeHtmlUrls($text,$chr_limit = 30,$add = '...') {\n\t\t\n\t\t$end_firstpart = round(1/3*$chr_limit);\n\t\t$begin_secondpart = $chr_limit - $end_firstpart - strlen($add);\n\n\t\t/*\n\t\t\t* is greedy\t\t\t*? is lazy\n\t\t\t{2,} is greedy\t\t{2,}? is lazy\n\t\t*/\n\t\t\n\t\t// An url can be terminated by a dot, a whitespace, a tab, a linebreak, parenthesis, or the end of the string:\n\t\t$termination = '(\\.{2,}|\\. | |,|\\.<|<|\\n|\\.\\n|\\t|\\)|\\.$|$)';\n\n\t\t\n\t\t/* Search for urls starting with http:// */\n\t\t$pattern = '('.\n\t\t\t'https?:\\/{2}'. \t\t \t\t\t// 1) http://\n\t\t\t'[\\w\\.]{3,}?'. \t\t \t\t\t// 2) at least 2 \"word\" characters (alphanumeric plus \"_\") or dots\n\t\t\t'[\\/\\w\\-\\.\\?\\+\\&\\=\\#]*?'. \t\t\t// 3) matches the rest of the url\n\t\t\t')'.$termination;\n\t\t$text = preg_replace_callback(\n\t\t\t\"/$pattern/i\",\n\t\t\tfunction($matches) use ($chr_limit, $add, $end_firstpart, $begin_secondpart) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t'<a href=\"%s\" title=\"%s\" target=\"_blank\">%s</a>%s',\n\t\t\t\t\t$matches[1],\n\t\t\t\t\t$matches[1],\n\t\t\t\t\t((strlen($matches[1]) >= $chr_limit)\n\t\t\t\t\t\t? substr($matches[1], 0, $end_firstpart). $add . substr($matches[1], $begin_secondpart)\n\t\t\t\t\t\t: $matches[1]\n\t\t\t\t\t),\n\t\t\t\t\t$matches[2]\n\t\t\t\t);\n\t\t\t},\n\t\t\t$text\n\t\t);\n\n\t\t/* Search for urls starting with www. */\n\t\t$pattern = '( |\\t|\\n|^)'. \t\t\t// 0) prefixed by linebreak, whitespace or tab\n\t\t\t'(www\\.'. \t\t \t\t\t\t// 1) www.\n\t\t\t'[\\/\\w\\-\\.\\?\\+\\&\\=\\#]*?'. \t\t\t// 3) matches the rest of the url\n\t\t\t')'.$termination;\n\t\t$text = preg_replace_callback(\n\t\t\t\"/$pattern/i\",\n\t\t\tfunction($matches) use ($chr_limit, $add, $end_firstpart, $begin_secondpart) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t'%s<a href=\"http://%s\" title=\"http://%s\" target=\"_blank\">%s</a>%s',\n\t\t\t\t\t$matches[1],\n\t\t\t\t\t$matches[2],\n\t\t\t\t\t$matches[2],\n\t\t\t\t\t((strlen($matches[2]) >= $chr_limit)\n\t\t\t\t\t\t? substr($matches[2], 0, $end_firstpart). $add . substr($matches[2], $begin_secondpart)\n\t\t\t\t\t\t: $matches[2]\n\t\t\t\t\t),\n\t\t\t\t\t$matches[3]\n\t\t\t\t);\n\t\t\t},\n\t\t\t$text\n\t\t);\n\n\t\t/* Search for email addresses */\n\t\t$pattern = '([\\w\\.-]{3,}@([\\w]+\\.)+[a-z]{2,3})';\n\t\t$replacement = \"<a href=\\\"mailto:\\\\1\\\">\\\\1</a>\";\n\t\t$text = preg_replace(\"/$pattern/i\", $replacement, $text);\n\n \n\t\treturn $text;\n\t}", "public function getHtml(string $text) : string\n {\n $textAsHtml = htmlspecialchars($text, ENT_QUOTES);\n $textWithNewLines = nl2br($textAsHtml);\n\n $tokenized = $this->tokenizer->tokenize($textWithNewLines);\n $html = $this->bbCode->format($tokenized);\n\n return $html;\n }", "function linkify_tweet($tweet) {\n\n //Convert urls to <a> links\n $tweet = preg_replace(\"/([\\w]+\\:\\/\\/[\\w-?&;#~=\\.\\/\\@]+[\\w\\/])/\", \"<a target=\\\"_blank\\\" href=\\\"$1\\\">$1</a>\", $tweet);\n\n //Convert hashtags to twitter searches in <a> links\n $tweet = preg_replace(\"/#([A-Za-z0-9\\/\\.]*)/\", \"<a target=\\\"_new\\\" href=\\\"http://twitter.com/search?q=$1\\\">#$1</a>\", $tweet);\n\n //Convert attags to twitter profiles in <a> links\n $tweet = preg_replace(\"/@([A-Za-z0-9\\/\\.]*)/\", \"<a href=\\\"http://www.twitter.com/$1\\\">@$1</a>\", $tweet);\n\n return $tweet;\n\n}", "public static function makeHashTagClickable($text) {\n\t\treturn preg_replace('/\\B#(\\w*[a-zA-Z]+\\w*)/', '<a href=\"/?q=%23$1\">#$1</a>', $text);\n\t}", "function TS_links_rte($value,$wrap='')\t{\n\t\t$htmlParser = t3lib_div::makeInstance('t3lib_parsehtml_proc');\n\n\t\t$value = $htmlParser->TS_AtagToAbs($value);\n\t\t$wrap = explode('|',$wrap);\n\t\t\t// Split content by the TYPO3 pseudo tag \"<LINK>\":\n\t\t$blockSplit = $htmlParser->splitIntoBlock('link',$value,1);\n\t\tforeach($blockSplit as $k => $v)\t{\n\t\t\t$error = '';\n\t\t\tif ($k%2)\t{\t// block:\n\t\t\t\t$tagCode = t3lib_div::trimExplode(' ',trim(substr($htmlParser->getFirstTag($v),0,-1)),1);\n\t\t\t\t$link_param = $tagCode[1];\n\t\t\t\t$href = '';\n\t\t\t\t$siteUrl = $htmlParser->siteUrl();\n\t\t\t\t\t// Parsing the typolink data. This parsing is roughly done like in tslib_content->typolink()\n\t\t\t\tif(strstr($link_param,'@'))\t{\t\t// mailadr\n\t\t\t\t\t$href = 'mailto:'.eregi_replace('^mailto:','',$link_param);\n\t\t\t\t} elseif (substr($link_param,0,1)=='#') {\t// check if anchor\n\t\t\t\t\t$href = $siteUrl.$link_param;\n\t\t\t\t} else {\n\t\t\t\t\t$fileChar=intval(strpos($link_param, '/'));\n\t\t\t\t\t$urlChar=intval(strpos($link_param, '.'));\n\n\t\t\t\t\t\t// Detects if a file is found in site-root OR is a simulateStaticDocument.\n\t\t\t\t\tlist($rootFileDat) = explode('?',$link_param);\n\t\t\t\t\t$rFD_fI = pathinfo($rootFileDat);\n\t\t\t\t\tif (trim($rootFileDat) && !strstr($link_param,'/') && (@is_file(PATH_site.$rootFileDat) || t3lib_div::inList('php,html,htm',strtolower($rFD_fI['extension']))))\t{\n\t\t\t\t\t\t$href = $siteUrl.$link_param;\n\t\t\t\t\t} elseif($urlChar && (strstr($link_param,'//') || !$fileChar || $urlChar<$fileChar))\t{\t// url (external): If doubleSlash or if a '.' comes before a '/'.\n\t\t\t\t\t\tif (!ereg('^[a-z]*://',trim(strtolower($link_param))))\t{$scheme='http://';} else {$scheme='';}\n\t\t\t\t\t\t$href = $scheme.$link_param;\n\t\t\t\t\t} elseif($fileChar)\t{\t// file (internal)\n\t\t\t\t\t\t$href = $siteUrl.$link_param;\n\t\t\t\t\t} else {\t// integer or alias (alias is without slashes or periods or commas, that is 'nospace,alphanum_x,lower,unique' according to tables.php!!)\n\t\t\t\t\t\t$link_params_parts = explode('#',$link_param);\n\t\t\t\t\t\t$idPart = trim($link_params_parts[0]);\t\t// Link-data del\n\t\t\t\t\t\tif (!strcmp($idPart,''))\t{ $idPart=$htmlParser->recPid; }\t// If no id or alias is given, set it to class record pid\n\t\t\t\t\t\tif ($link_params_parts[1] && !$sectionMark)\t{\n\t\t\t\t\t\t\t$sectionMark = '#'.trim($link_params_parts[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Splitting the parameter by ',' and if the array counts more than 1 element it's a id/type/? pair\n\t\t\t\t\t\t$pairParts = t3lib_div::trimExplode(',',$idPart);\n\t\t\t\t\t\tif (count($pairParts)>1)\t{\n\t\t\t\t\t\t\t$idPart = $pairParts[0];\n\t\t\t\t\t\t\t// Type ? future support for?\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Checking if the id-parameter is an alias.\n\t\t\t\t\t\tif (!t3lib_div::testInt($idPart))\t{\n\t\t\t\t\t\t\tlist($idPartR) = t3lib_BEfunc::getRecordsByField('pages','alias',$idPart);\n\t\t\t\t\t\t\t$idPart = intval($idPartR['uid']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//$page = t3lib_BEfunc::getRecord('pages', $idPart);//this doesnt work at the moment...no page exist check\n\t\t\t\t\t\t//if (is_array($page))\t{\t// Page must exist...\n\t\t\t\t\t\t\t$href = $siteUrl.'?id='.$link_param;\n\t\t\t\t\t\t/*} else {\n\t\t\t\t\t\t\t#$href = '';\n\t\t\t\t\t\t\t$href = $siteUrl.'?id='.$link_param;\n\t\t\t\t\t\t\t$error = 'No page found: '.$idPart;\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// Setting the A-tag:\n\t\t\t\t$bTag = '<a href=\"'.htmlspecialchars($href).'\"'.($tagCode[2]&&$tagCode[2]!='-' ? ' target=\"'.htmlspecialchars($tagCode[2]).'\"' : '').'>'.$wrap[0];\n\t\t\t\t$eTag = $wrap[1].'</a>';\n\t\t\t\t$blockSplit[$k] = $bTag.$htmlParser->TS_links_rte($htmlParser->removeFirstAndLastTag($blockSplit[$k])).$eTag;\n\t\t\t}\n\t\t}\n\n\t\t\t// Return content:\n\t\treturn implode('',$blockSplit);\n\t}", "function markdownout($text)\n{\n\techo markdown2html($text);\n}", "protected function _toHtml() {\r\n\t\t$html = '';\r\n\t\t$link_options = self::getData('link_options');\r\n\r\n\t\tif(empty($link_options)) {\r\n\t\t\treturn $html;\r\n\t\t}\r\n\r\n\t\t$arr_options = explode(',', $link_options);\r\n\r\n\t\tif(is_array($arr_options) && count($arr_options)) {\r\n\t\t\tforeach($arr_options as $option) {\r\n\t\t\t\tSwitch ($option) {\r\n\t\t\t\t\tcase 'print':\r\n\t\t\t\t\t\t$html .= '<div><a href=\"javascript: window.print();\">Print</a></div>';;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'email':\r\n\t\t\t\t\t\t$html .= '<div><a href=\"mailto:[email protected]&subject=Inquiry\">Contact Us</a></div>';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $html;\r\n\t}", "private function processBody($text) {\n $text = $this->processImages($text);\n $text = $this->processLinks($text);\n return $text->html();\n }", "function make_link($string)\n {\n $string = ' ' . $string;\n $string = preg_replace_callback(\"#(^|[\\n ])([\\w]+?://.*?[^ \\\"\\n\\r\\t<]*)#is\", \"shorten_link\", $string);\n $string = preg_replace(\"#(^|[\\n ])((www|ftp)\\.[\\w\\-]+\\.[\\w\\-.\\~]+(?:/[^ \\\"\\t\\n\\r<]*)?)#is\", \"$1<a href=\\\"http://$2\\\">$2</a>\", $string);\n #$string = preg_replace(\"#(^|[\\n ])([a-z0-9&\\-_.]+?)@([\\w\\-]+\\.([\\w\\-\\.]+\\.)*[\\w]+)#i\", \"\\\\1<a href=\\\"mailto:\\\\2@\\\\3\\\">\\\\2@\\\\3</a>\", $string);\n $string = mb_substr($string, 1, mb_strlen($string, CHARSET), CHARSET);\n return $string;\n }", "function l($text, $url = '#', $htmlOptions = array())\n{\n return CHtml::link($text, $url, $htmlOptions);\n}", "function l($text,$url='#',$htmlOptions=array())\n{\n\treturn CHtml::link($text, $url, $htmlOptions);\n}", "function tPregLink ($content) \n{\n // FB::trace('tPregLink');\n $content = preg_replace(\n array('#([\\s>])([\\w]+?://[\\w\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is'\n , '#([\\s>])((www|ftp)\\.[\\w\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is'\n , '#([\\s>])([a-z0-9\\-_.]+)@([^,< \\n\\r]+)#i'\n )\n , \n array('$1<a href=\"$2\">$2</a>'\n , '$1<a href=\"http://$2\">$2</a>'\n , '$1<a href=\"mailto:$2@$3\">$2@$3</a>'\n )\n , $content\n );\n # this one is not in an array because we need it to run last, for cleanup of accidental links within links\n $content = preg_replace(\n \"#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i\"\n , \"$1$3</a>\"\n , $content\n );\n $content = preg_replace_callback(\n '/<a (.*?)href=\"(.*?)\\/\\/(.*?)\"(.*?)>(.*?)<\\/a>/i'\n , 'tPregLinkCallback'\n , $content\n );\n return trim($content);\n}", "public static function Links($Mixed) {\n if (!is_string($Mixed))\n return self::To($Mixed, 'Links');\n else {\n $Mixed = preg_replace_callback(\n \"/\n (?<!<a href=\\\")\n (?<!\\\")(?<!\\\">)\n ((?:https?|ftp):\\/\\/)\n ([\\@a-z0-9\\x21\\x23-\\x27\\x2a-\\x2e\\x3a\\x3b\\/;\\x3f-\\x7a\\x7e\\x3d]+)\n /msxi\",\n array('Gdn_Format', 'LinksCallback'),\n $Mixed);\n\n return $Mixed;\n }\n }", "protected function _trackLinks($text, $type){\n\n $matches = array();\n\n if ($type == 'html'){\n\n preg_match_all(\"/<a.*?href=[\\\"'](.*?)[\\\"'].*?>/is\", $text, $matches);\n\n } else {\n\n preg_match_all(\"/((?:https?:\\/\\/)(?:[a-zA-Z0-9\\_\\.\\-\\?\\/=]+)+)/is\", $text, $matches);\n\n }\n\n $source = $replace = array();\n $black_list = array('^#.*', '^mailto:.*', '\\[addgroup=[^\\]]+\\]', '\\[ungroup=[^\\]]+\\]', '^\\{%\\$');\n\n if (!empty($matches)){\n //unset($matches[0]);\n for ($i = 0; $i<count($matches[1]); $i++){\n // checking match in black list\n //if (in_array($matches[1][$i], $black_list)) continue;\n if (preg_match('/'.join('|', $black_list).'/is', $matches[1][$i])) continue;\n\n $source[$i] = $matches[0][$i];\n $replace[$i] = str_replace($matches[1][$i], $this->_trackLink($matches[1][$i]), $matches[0][$i]);\n }\n\n $text = str_replace($source, $replace, $text);\n }\n\n return $text;\n\n }", "public static function removeUrls($text){\n $text = preg_replace(\n \"#(^|[^\\\">])(https?://)([\\w]+[^ \\\"\\n\\r\\t< ]*)#\",\n \"\",\n $text\n );\n // ones without http.. starting with www or ftp..Replace urls with blank space\n $text = preg_replace(\n \"#(^|[\\n ])((www|ftp)\\.[^ \\\"\\t\\n\\r< ]*)#\",\n \"\",\n $text\n );\n\n return $text;\n }", "public function convertBBCodetoHTML($p_text)\n\t\t{\n //$p_text = preg_replace('`\\[EMAIL\\]([^\\[]*)\\[/EMAIL\\]`i','<a href=\"mailto:\\\\1\">\\\\1</a>',$p_text);\n //$p_text = preg_replace('`\\[EMAIL\\](.*?)\\[/EMAIL\\]`i','<a href=\"mailto:\\\\1\">\\\\1</a>',$p_text);\n // Information : Double [/email][/email] to avoid end of email area\n $p_text = preg_replace('`\\[email\\](.*?(\\[/email\\]\\[/email\\].*?)*)\\[/email\\](?!(\\[/email\\]))`ie','\"<a href=\\\"mailto:\".str_replace(\"[/email][/email]\",\"[/email]\",\"\\\\1\").\"\\\">\".str_replace(\"[/email][/email]\",\"[/email]\",\"\\\\1\").\"</a>\"',$p_text);\n\n //$p_text = preg_replace('`\\[b\\]([^\\[]*)\\[/b\\]`i','<b>\\\\1</b>',$p_text); // Generation 1 : First [ or ] encounter stop translation\n //$p_text = preg_replace('`\\[b\\](.*?)\\[/b\\]`i','<b>\\\\1</b>',$p_text); // Generation 2 : Can't bold string [/b]\n // Generation 3 : Information : Double [/b][/b] to avoid end of bold area\n $p_text = preg_replace('`\\[b\\](.*?(\\[/b\\]\\[/b\\].*?)*)\\[/b\\](?!(\\[/b\\]))`ie','\"<b>\".str_replace(\"[/b][/b]\",\"[/b]\",\"\\\\1\").\"</b>\"',$p_text);\n\n //$p_text = preg_replace('`\\[i\\]([^\\[]*)\\[/i\\]`i','<i>\\\\1</i>',$p_text);\n //$p_text = preg_replace('`\\[i\\](.*?)\\[/i\\]`i','<i>\\\\1</i>',$p_text);\n // Information : Double [/i][/i] to avoid end of italic area\n $p_text = preg_replace('`\\[i\\](.*?(\\[/i\\]\\[/i\\].*?)*)\\[/i\\](?!(\\[/i\\]))`ie','\"<i>\".str_replace(\"[/i][/i]\",\"[/i]\",\"\\\\1\").\"</i>\"',$p_text);\n\n //$p_text = preg_replace('`\\[u\\]([^\\[]*)\\[/u\\]`i','<u>\\\\1</u>',$p_text);\n //$p_text = preg_replace('`\\[u\\](.*?)\\[/u\\]`i','<u>\\\\1</u>',$p_text);\n // Information : Double [/u][/u] to avoid end of underline area\n $p_text = preg_replace('`\\[u\\](.*?(\\[/u\\]\\[/u\\].*?)*)\\[/u\\](?!(\\[/u\\]))`ie','\"<u>\".str_replace(\"[/u][/u]\",\"[/u]\",\"\\\\1\").\"</u>\"',$p_text);\n\n //$p_text = preg_replace('`\\[s\\]([^\\[]*)\\[/s\\]`i','<s>\\\\1</s>',$p_text);\n //$p_text = preg_replace('`\\[s\\](.*?)\\[/s\\]`i','<s>\\\\1</s>',$p_text);\n // Information : Double [/s][/s] to avoid end of stroke line area\n $p_text = preg_replace('`\\[s\\](.*?(\\[/s\\]\\[/s\\].*?)*)\\[/s\\](?!(\\[/s\\]))`ie','\"<s>\".str_replace(\"[/s][/s]\",\"[/s]\",\"\\\\1\").\"</s>\"',$p_text);\n\n //$p_text = preg_replace('`\\[center\\]([^\\[]*)\\[/center\\]`','<p style=\"text-align: center;\">\\\\1</p>',$p_text);\n //$p_text = preg_replace('`\\[center\\](.*?)\\[/center\\]`','<p style=\"text-align: center;\">\\\\1</p>',$p_text);\n // Information : Double [/center][/center] to avoid end of center line area\n $p_text = preg_replace('`\\[center\\](.*?(\\[/center\\]\\[/center\\].*?)*)\\[/center\\](?!(\\[/center\\]))`ie','\"<p style=\\\"text-align: center;\\\">\".str_replace(\"[/center][/center]\",\"[/center]\",\"\\\\1\").\"</p>\"',$p_text);\n\n //$p_text = preg_replace('`\\[left\\]([^\\[]*)\\[/left\\]`i','<p style=\"text-align: left;\">\\\\1</p>',$p_text);\n //$p_text = preg_replace('`\\[left\\](.*?)\\[/left\\]`i','<p style=\"text-align: left;\">\\\\1</p>',$p_text);\n // Information : Double [/left][/left] to avoid end of left line area\n $p_text = preg_replace('`\\[left\\](.*?(\\[/left\\]\\[/left\\].*?)*)\\[/left\\](?!(\\[/left\\]))`ie','\"<p style=\\\"text-align: left;\\\">\".str_replace(\"[/left][/left]\",\"[/left]\",\"\\\\1\").\"</p>\"',$p_text);\n\n //$p_text = preg_replace('`\\[right\\]([^\\[]*)\\[/right\\]`i','<p style=\"text-align: right;\">\\\\1</p>',$p_text);\n //$p_text = preg_replace('`\\[right\\](.*?)\\[/right\\]`i','<p style=\"text-align: right;\">\\\\1</p>',$p_text);\n // Information : Double [/right][/right] to avoid end of right line area\n $p_text = preg_replace('`\\[right\\](.*?(\\[/right\\]\\[/right\\].*?)*)\\[/right\\](?!(\\[/right\\]))`ie','\"<p style=\\\"text-align: right;\\\">\".str_replace(\"[/right][/right]\",\"[/right]\",\"\\\\1\").\"</p>\"',$p_text);\n\n //$p_text = preg_replace('`\\[img\\]([^\\[]*)\\[/img\\]`i','<img src=\"\\\\1\" />',$p_text);\n //$p_text = preg_replace('`\\[img\\](.*?)\\[/img\\]`i','<img src=\"\\\\1\" />',$p_text);\n // Information : Double [/img][/img] to avoid end of picture area\n $p_text = preg_replace('`\\[img\\](.*?(\\[/img\\]\\[/img\\].*?)*)\\[/img\\](?!(\\[/img\\]))`ie','\"<img src=\\\"\".str_replace(\"[/img][/img]\",\"[/img]\",\"\\\\1\").\"\\\" />\"',$p_text);\n\n //$p_text = preg_replace('`\\[color=([^[]*)\\]([^[]*)\\[/color\\]`i','<font color=\"\\\\1\">\\\\2</font>',$p_text);\n //$p_text = preg_replace('`\\[color=(.*?)\\](.*?)\\[/color\\]`i','<font color=\"\\\\1\">\\\\2</font>',$p_text);\n // Information : Double [/color][/color] to avoid end of color area\n $p_text = preg_replace('`\\[color=(.*?)\\](.*?(\\[/color\\]\\[/color\\].*?)*)\\[/color\\](?!(\\[/color\\]))`ie','\"<font color=\\\"\\\\1\\\">\".str_replace(\"[/color][/color]\",\"[/color]\",\"\\\\2\").\"</font>\"',$p_text);\n\n //$p_text = preg_replace('`\\[bg=([^[]*)\\]([^[]*)\\[/bg\\]`i','<font style=\"background-color: \\\\1;\">\\\\2</font>',$p_text);\n //$p_text = preg_replace('`\\[bg=(.*?)\\](.*?)\\[/bg\\]`i','<font style=\"background-color: \\\\1;\">\\\\2</font>',$p_text);\n // Information : Double [/bg][/bg] to avoid end of background color area\n $p_text = preg_replace('`\\[bg=(.*?)\\](.*?(\\[/bg\\]\\[/bg\\].*?)*)\\[/bg\\](?!(\\[/bg\\]))`ie','\"<font style=\\\"background-color:\\\\1;\\\">\".str_replace(\"[/bg][/bg]\",\"[/bg]\",\"\\\\2\").\"</font>\"',$p_text);\n\n //$p_text = preg_replace('`\\[size=([^[]*)\\]([^[]*)\\[/size\\]`i','<font size=\"\\\\1\">\\\\2</font>',$p_text);\n //$p_text = preg_replace('`\\[size=(.*?)\\](.*?)\\[/size\\]`i','<font size=\"\\\\1\">\\\\2</font>',$p_text);\n // Information : Double [/size][/size] to avoid end of font size area\n $p_text = preg_replace('`\\[size=(.*?)\\](.*?(\\[/size\\]\\[/size\\].*?)*)\\[/size\\](?!(\\[/size\\]))`ie','\"<font size=\\\"\\\\1\\\">\".str_replace(\"[/size][/size]\",\"[/size]\",\"\\\\2\").\"</font>\"',$p_text);\n\n //$p_text = preg_replace('`\\[font=([^[]*)\\]([^[]*)\\[/font\\]`i','<font face=\"\\\\1\">\\\\2</font>',$p_text);\n //$p_text = preg_replace('`\\[font=(.*?)\\](.*?)\\[/font\\]`i','<font face=\"\\\\1\">\\\\2</font>',$p_text);\n // Information : Double [/font][/font] to avoid end of font area\n $p_text = preg_replace('`\\[font=(.*?)\\](.*?(\\[/font\\]\\[/font\\].*?)*)\\[/font\\](?!(\\[/font\\]))`ie','\"<font face=\\\"\\\\1\\\">\".str_replace(\"[/font][/font]\",\"[/font]\",\"\\\\2\").\"</font>\"',$p_text);\n\n // Information : Double [/url][/url] to avoid end of URL area\n $p_text = preg_replace('`\\[url\\](.*?(\\[/url\\]\\[/url\\].*?)*)\\[/url\\](?!(\\[/url\\]))`ie','\"<a target=\\\"_blank\\\" href=\\\"\".str_replace(\"[/url][/url]\",\"[/url]\",\"\\\\1\").\"\\\">\".str_replace(\"[/url][/url]\",\"[/url]\",\"\\\\1\").\"</a>\"',$p_text);\n $p_text = preg_replace('`\\[url=(.*?)\\](.*?(\\[/url\\]\\[/url\\].*?)*)\\[/url\\](?!(\\[/url\\]))`ie','\"<a target=\\\"_blank\\\" href=\\\"\\\\1\\\">\".str_replace(\"[/url][/url]\",\"[/url]\",\"\\\\2\").\"</a>\"',$p_text);\n\n // Found a randomized string do not exists in string to convert\n $temp_str = '7634253332';while(stristr($p_text,$temp_str)){$temp_str = mt_rand();}\n $p_text = str_replace('[br][br]',$temp_str,$p_text);\n $p_text = preg_replace('`(?<!\\[br\\])\\[br\\](?!(\\[br\\]))`ie','str_replace(\"[br]\",\"<br>\",\"\\\\0\")',$p_text);\n $p_text = str_replace($temp_str,'[br]',$p_text);\n\n // Found a randomized string do not exists in string to convert\n $temp_str = '7634253332';while(stristr($p_text,$temp_str)){$temp_str = mt_rand();}\n $p_text = str_replace('[hr][hr]',$temp_str,$p_text);\n $p_text = preg_replace('`(?<!\\[hr\\])\\[hr\\](?!(\\[hr\\]))`ie','str_replace(\"[hr]\",\"<hr>\",\"\\\\0\")',$p_text);\n $p_text = str_replace($temp_str,'[hr]',$p_text);\n\n return $p_text;\n\t\t}", "public function toLink($text = NULL, $rel = 'canonical', array $options = []);" ]
[ "0.7424353", "0.74196863", "0.73233753", "0.72487515", "0.72218645", "0.71576583", "0.7053427", "0.7030001", "0.6968682", "0.69464844", "0.6935972", "0.6910453", "0.6807461", "0.6800984", "0.6783039", "0.6764277", "0.6759568", "0.6755375", "0.6754978", "0.6753664", "0.6751245", "0.6718936", "0.67054874", "0.6649658", "0.6632159", "0.66046774", "0.65922236", "0.65906525", "0.6569629", "0.65516776", "0.6516329", "0.6504984", "0.6496524", "0.6493039", "0.6475871", "0.6452235", "0.6436102", "0.64335203", "0.64109147", "0.6388871", "0.6371512", "0.63574225", "0.63565475", "0.6333272", "0.6288869", "0.62817454", "0.62788075", "0.6237501", "0.62368196", "0.61830145", "0.61803806", "0.6177581", "0.61563736", "0.6153107", "0.61384666", "0.6127189", "0.6126659", "0.61037904", "0.60985965", "0.6083685", "0.60739017", "0.60671264", "0.60340476", "0.6020993", "0.6013251", "0.5995766", "0.59883267", "0.5979059", "0.59693384", "0.59378725", "0.5927395", "0.5920945", "0.58943856", "0.58905554", "0.5879041", "0.5878827", "0.5876346", "0.58656114", "0.5860556", "0.5851533", "0.58466536", "0.5823641", "0.5806925", "0.5806695", "0.57968867", "0.5794218", "0.5781234", "0.57803804", "0.57734895", "0.5770638", "0.576191", "0.5748385", "0.5731045", "0.57275146", "0.57256454", "0.57190317", "0.57174814", "0.5711884", "0.5711326", "0.5696312" ]
0.6073695
61
Simplistic tool to make URLs absolute in HTML. Useful for formatting emails.
public static function make_absolute_urls(string $content, string $domain_prefix): string { $domain_prefix = rtrim($domain_prefix, '/'); $map = []; foreach (['href', 'src', ] as $attr) { foreach (['"', '\'', ] as $quote) { foreach (['/' => '', '.' => '/', ] as $prefix => $append) { $map[$attr . '=' . $quote . $prefix] = $attr . '=' . $quote . $domain_prefix . $append . $prefix; } } } return strtr($content, $map); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function absoluteURLs($html) {\n\t\t$html = str_replace('$CurrentPageURL', $_SERVER['REQUEST_URI'], $html);\n\t\treturn HTTP::urlRewriter($html, '(substr($URL,0,1) == \"/\") ? ( Director::protocolAndHost() . $URL ) : ( (ereg(\"^[A-Za-z]+:\", $URL)) ? $URL : Director::absoluteBaseURL() . $URL )' );\n\t}", "public function AbsoluteLinks()\n {\n return HTTP::absoluteURLs($this->forTemplate());\n }", "public function formatAsUrl() {\r\n $url_save_chars = array_merge(range('a','z'),range(0,9),['_','-']);\r\n \r\n $specials = array('ä','ü','ö','ß',' ','ç','é','â','ê','î','ô','û','à','è','ì','ò','ù','ë','ï','ü','&');\r\n $specials_replacements = array('ae','ue','oe','ss','_','c','e','a','e','i','o','u','a','e','i','o','u','e','i','u','');\r\n // make everything lowercase and replace umlaute and spaces\r\n $url_save_text = trim(str_replace($specials, $specials_replacements, mb_strtolower($this->text,'UTF-8')));\r\n // remove every invalid character thats left from text (replace with \"-\") \r\n for($i = 0; $i < strlen($url_save_text); $i++){\r\n if(!in_array($url_save_text[$i], $url_save_chars)){\r\n $url_save_text[$i] = \"-\";\r\n }\r\n } \r\n return $url_save_text;\r\n }", "function string_insert_hrefs( $p_string ) \r\n{\r\n\tif ( !config_get('html_make_links') ) {\r\n\t\treturn $p_string;\r\n\t}\r\n\r\n\t$t_change_quotes = false;\r\n\tif( ini_get_bool( 'magic_quotes_sybase' ) ) {\r\n\t\t$t_change_quotes = true;\r\n\t\tini_set( 'magic_quotes_sybase', false );\r\n\t}\r\n\r\n\t// Find any URL in a string and replace it by a clickable link\r\n\t$p_string = preg_replace( '/(([[:alpha:]][-+.[:alnum:]]*):\\/\\/(%[[:digit:]A-Fa-f]{2}|[-_.!~*\\';\\/?%^\\\\\\\\:@&={\\|}+$#\\(\\),\\[\\][:alnum:]])+)/se',\r\n \"'<a href=\\\"'.rtrim('\\\\1','.').'\\\">\\\\1</a> [<a href=\\\"'.rtrim('\\\\1','.').'\\\" target=\\\"_blank\\\">^</a>]'\", $p_string);\r\n \r\n\tif( $t_change_quotes ) {\r\n\t\tini_set( 'magic_quotes_sybase', true );\r\n\t}\r\n\r\n\t# Set up a simple subset of RFC 822 email address parsing\r\n\t# We don't allow domain literals or quoted strings\r\n\t# We also don't allow the & character in domains even though the RFC\r\n\t# appears to do so. This was to prevent &gt; etc from being included.\r\n\t# Note: we could use email_get_rfc822_regex() but it doesn't work well\r\n\t# when applied to data that has already had entities inserted.\r\n\t#\r\n\t# bpfennig: '@' doesn't accepted anymore\r\n\t# achumakov: characters 0x80-0xFF aren't acceptable, too\r\n\t$t_atom = '[^\\'@\\'](?:[^()<>@,;:\\\\\\\".\\[\\]\\000-\\037\\177-\\377 &]+)';\r\n\r\n\t# In order to avoid selecting URLs containing @ characters as email\r\n\t# addresses we limit our selection to addresses that are preceded by:\r\n\t# * the beginning of the string\r\n\t# * a &lt; entity (allowing '<[email protected]>')\r\n\t# * whitespace\r\n\t# * a : (allowing 'send email to:[email protected]')\r\n\t# * a \\n, \\r, or > (because newlines have been replaced with <br />\r\n\t# and > isn't valid in URLs anyway\r\n\t#\r\n\t# At the end of the string we allow the opposite:\r\n\t# * the end of the string\r\n\t# * a &gt; entity\r\n\t# * whitespace\r\n\t# * a , character (allowing 'email [email protected], or ...')\r\n\t# * a \\n, \\r, or <\r\n\r\n\t$p_string = preg_replace( '/(?<=^|&quot;|&lt;|[\\s\\:\\>\\n\\r])('.$t_atom.'(?:\\.'.$t_atom.')*\\@'.$t_atom.'(?:\\.'.$t_atom.')*)(?=$|&quot;|&gt;|[\\s\\,\\<\\n\\r])/s',\r\n\t\t\t\t\t\t\t'<a href=\"mailto:\\1\">\\1</a>', $p_string);\r\n\r\n\treturn $p_string;\r\n}", "function make_link($string)\n {\n $string = ' ' . $string;\n $string = preg_replace_callback(\"#(^|[\\n ])([\\w]+?://.*?[^ \\\"\\n\\r\\t<]*)#is\", \"shorten_link\", $string);\n $string = preg_replace(\"#(^|[\\n ])((www|ftp)\\.[\\w\\-]+\\.[\\w\\-.\\~]+(?:/[^ \\\"\\t\\n\\r<]*)?)#is\", \"$1<a href=\\\"http://$2\\\">$2</a>\", $string);\n #$string = preg_replace(\"#(^|[\\n ])([a-z0-9&\\-_.]+?)@([\\w\\-]+\\.([\\w\\-\\.]+\\.)*[\\w]+)#i\", \"\\\\1<a href=\\\"mailto:\\\\2@\\\\3\\\">\\\\2@\\\\3</a>\", $string);\n $string = mb_substr($string, 1, mb_strlen($string, CHARSET), CHARSET);\n return $string;\n }", "function substHREFsInHTML() {\n\t\tif (!is_array($this->theParts['html']['hrefs'])) return;\n\t\tforeach ($this->theParts['html']['hrefs'] as $urlId => $val) {\n\t\t\t\t// Form elements cannot use jumpurl!\n\t\t\tif ($this->jumperURL_prefix && ($val['tag'] != 'form') && ( !strstr( $val['ref'], 'mailto:' ))) {\n\t\t\t\tif ($this->jumperURL_useId) {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix . $urlId;\n\t\t\t\t} else {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix.t3lib_div::rawUrlEncodeFP($val['absRef']);\n\t\t\t\t}\n\t\t\t} elseif ( strstr( $val['ref'], 'mailto:' ) && $this->jumperURL_useMailto) {\n\t\t\t\tif ($this->jumperURL_useId) {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix . $urlId;\n\t\t\t\t} else {\n\t\t\t\t\t$substVal = $this->jumperURL_prefix.t3lib_div::rawUrlEncodeFP($val['absRef']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$substVal = $val['absRef'];\n\t\t\t}\n\t\t\t$this->theParts['html']['content'] = str_replace(\n\t\t\t\t$val['subst_str'],\n\t\t\t\t$val['quotes'] . $substVal . $val['quotes'],\n\t\t\t\t$this->theParts['html']['content']);\n\t\t}\n\t}", "function raw_urls_to_links($text){\n\t\t$text = \" $text \";\n\t\t$text = preg_replace('#(https?://[^\\s<>{}()]+[^\\s.,<>{}()])#i', '<a href=\"$1\" rel=\"nofollow\">$1</a>', $text);\n\t\t$text = preg_replace('#(\\s)([a-z0-9\\-]+(?:\\.[a-z0-9\\-\\~]+){2,}(?:/[^ <>{}()\\n\\r]*[^., <>{}()\\n\\r])?)#i', \n\t\t\t'$1<a href=\"http://$2\" rel=\"nofollow\">$2</a>', $text);\n\n\t\t$text = trim($text);\n\t\treturn $text;\n\t}", "function do_html_URL($url, $name)\r\n{\r\n?>\r\n <br><a href=\"<?=$url?>\"><?=$name?></a><br>\r\n<?\r\n}", "function do_html_URL($url, $name)\r\n{\r\n?>\r\n <br><a href=\"<?=$url?>\"><?=$name?></a><br>\r\n<?\r\n}", "function absolute_url($page, $url)\n{\n \n if (substr($page, 0, 7) !== APP_PROTOCOL . '://') return $url;\n\n $parse = parse_url($page);\n $root = $parse['scheme'] . '://' . $parse['host'];\n $p = strrpos(substr($parse, 7), '/');\n\n if ($p) {\n\n $base = substr($page, 0, $p + 8);\n\n } else {\n\n $base = \"$page/\";\n\n }\n\n if (substr($url, 0, 1) === '/') {\n\n $url = $root . $url;\n\n } elseif (substr($url, 0, 7) !== APP_PROTOCOL . '://') {\n\n $url = $base . $url;\n\n }\n\n $url_sanitized = sanitize_urls($url);\n\n return $url_sanitized;\n \n}", "public function formatLinks($text) {\n $text = preg_replace(\"/([\\w-?&;#~=\\.\\/]+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?))/i\",\"<a href=\\\"mailto:$1\\\">$1</a>\",$text);\n $text = str_replace(\"http://www.\",\"www.\",$text);\n $text = str_replace(\"www.\",\"http://www.\",$text);\n $text = preg_replace(\"/([\\w]+:\\/\\/[\\w-?&;#~=\\.\\/\\@]+[\\w\\/])/i\",\"<a href=\\\"$1\\\">$1</a>\", $text);\n return $text;\n }", "function makeHtmlUrls($text,$chr_limit = 30,$add = '...') {\n\t\t\n\t\t$end_firstpart = round(1/3*$chr_limit);\n\t\t$begin_secondpart = $chr_limit - $end_firstpart - strlen($add);\n\n\t\t/*\n\t\t\t* is greedy\t\t\t*? is lazy\n\t\t\t{2,} is greedy\t\t{2,}? is lazy\n\t\t*/\n\t\t\n\t\t// An url can be terminated by a dot, a whitespace, a tab, a linebreak, parenthesis, or the end of the string:\n\t\t$termination = '(\\.{2,}|\\. | |,|\\.<|<|\\n|\\.\\n|\\t|\\)|\\.$|$)';\n\n\t\t\n\t\t/* Search for urls starting with http:// */\n\t\t$pattern = '('.\n\t\t\t'https?:\\/{2}'. \t\t \t\t\t// 1) http://\n\t\t\t'[\\w\\.]{3,}?'. \t\t \t\t\t// 2) at least 2 \"word\" characters (alphanumeric plus \"_\") or dots\n\t\t\t'[\\/\\w\\-\\.\\?\\+\\&\\=\\#]*?'. \t\t\t// 3) matches the rest of the url\n\t\t\t')'.$termination;\n\t\t$text = preg_replace_callback(\n\t\t\t\"/$pattern/i\",\n\t\t\tfunction($matches) use ($chr_limit, $add, $end_firstpart, $begin_secondpart) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t'<a href=\"%s\" title=\"%s\" target=\"_blank\">%s</a>%s',\n\t\t\t\t\t$matches[1],\n\t\t\t\t\t$matches[1],\n\t\t\t\t\t((strlen($matches[1]) >= $chr_limit)\n\t\t\t\t\t\t? substr($matches[1], 0, $end_firstpart). $add . substr($matches[1], $begin_secondpart)\n\t\t\t\t\t\t: $matches[1]\n\t\t\t\t\t),\n\t\t\t\t\t$matches[2]\n\t\t\t\t);\n\t\t\t},\n\t\t\t$text\n\t\t);\n\n\t\t/* Search for urls starting with www. */\n\t\t$pattern = '( |\\t|\\n|^)'. \t\t\t// 0) prefixed by linebreak, whitespace or tab\n\t\t\t'(www\\.'. \t\t \t\t\t\t// 1) www.\n\t\t\t'[\\/\\w\\-\\.\\?\\+\\&\\=\\#]*?'. \t\t\t// 3) matches the rest of the url\n\t\t\t')'.$termination;\n\t\t$text = preg_replace_callback(\n\t\t\t\"/$pattern/i\",\n\t\t\tfunction($matches) use ($chr_limit, $add, $end_firstpart, $begin_secondpart) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t'%s<a href=\"http://%s\" title=\"http://%s\" target=\"_blank\">%s</a>%s',\n\t\t\t\t\t$matches[1],\n\t\t\t\t\t$matches[2],\n\t\t\t\t\t$matches[2],\n\t\t\t\t\t((strlen($matches[2]) >= $chr_limit)\n\t\t\t\t\t\t? substr($matches[2], 0, $end_firstpart). $add . substr($matches[2], $begin_secondpart)\n\t\t\t\t\t\t: $matches[2]\n\t\t\t\t\t),\n\t\t\t\t\t$matches[3]\n\t\t\t\t);\n\t\t\t},\n\t\t\t$text\n\t\t);\n\n\t\t/* Search for email addresses */\n\t\t$pattern = '([\\w\\.-]{3,}@([\\w]+\\.)+[a-z]{2,3})';\n\t\t$replacement = \"<a href=\\\"mailto:\\\\1\\\">\\\\1</a>\";\n\t\t$text = preg_replace(\"/$pattern/i\", $replacement, $text);\n\n \n\t\treturn $text;\n\t}", "function _hyperlinkUrls($text, $mode = '0', $trunc_before = '', $trunc_after = '...', $open_in_new_window = true) {\n\t\t$text = ' ' . $text . ' ';\n\t\t$new_win_txt = ($open_in_new_window) ? ' target=\"_blank\"' : '';\n\n\t\t# Hyperlink Class B domains\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-\\.]+)\\.(com|org|net|gov|edu|us|info|biz|ws|name|tv|eu|mobi)((?:/[^\\s{}\\(\\)\\[\\]]*[^\\.,\\s{}\\(\\)\\[\\]]?)?)#ie\", \"'$1<a href=\\\"http://$2.$3$4\\\" title=\\\"http://$2.$3$4\\\"$new_win_txt>' . $this->_truncateLink(\\\"$2.$3$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink anything with an explicit protocol\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])(([a-z]+?)://([A-Za-z_0-9\\-]+\\.([^\\s{}\\(\\)\\[\\]]+[^\\s,\\.\\;{}\\(\\)\\[\\]])))#ie\", \"'$1<a href=\\\"$2\\\" title=\\\"$2\\\"$new_win_txt>' . $this->_truncateLink(\\\"$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink e-mail addresses\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-_\\.]+?)@([^\\s,{}\\(\\)\\[\\]]+\\.[^\\s.,{}\\(\\)\\[\\]]+)#ie\", \"'$1<a href=\\\"mailto:$2@$3\\\" title=\\\"mailto:$2@$3\\\">' . $this->_truncateLink(\\\"$2@$3\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\treturn substr($text, 1, strlen($text) - 2);\n\t}", "public function url()\n\t{\n\t\tif( $this->modified === false ) return $this->url;\n\t\telse\n\t\t{\n\t\t\t$url = $this->generateString();\n\t\t\treturn htmlentities( $url );\n\t\t}\n\t}", "function old_convert_urls_into_links(&$text) {\n $text = eregi_replace(\"([[:space:]]|^|\\(|\\[)([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])\",\n \"\\\\1<a href=\\\"\\\\2://\\\\3\\\\4\\\" target=\\\"_blank\\\">\\\\2://\\\\3\\\\4</a>\", $text);\n\n /// eg www.moodle.com\n $text = eregi_replace(\"([[:space:]]|^|\\(|\\[)www\\.([^[:space:]]*)([[:alnum:]#?/&=])\",\n \"\\\\1<a href=\\\"http://www.\\\\2\\\\3\\\" target=\\\"_blank\\\">www.\\\\2\\\\3</a>\", $text);\n }", "function smarty_modifier_replace_urls($p_string)\n{\n // Images get added by the css after the fact.\n $host = \"([a-z\\d][-a-z\\d]*[a-z\\d]\\.)+[a-z][-a-z\\d]*[a-z]\";\n $port = \"(:\\d{1,})?\";\n $path = \"(\\/[^?<>\\#\\\"\\s]+)?\";\n $query = \"(\\?[^<>\\#\\\"\\s]+)?\";\n\n return preg_replace(\"#((ht|f)tps?:\\/\\/{$host}{$port}{$path}{$query})#i\", \"<a target='_blank' class='extLink' rel='nofollow' href='$1'>$1</a>\", $p_string);\n}", "function convert_to_links($msg){\r\n\t\t$final_message = preg_replace(array('/(?i)\\b((?:https?:\\/\\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:\\'\".,<>?«»“”‘’]))/', '/(^|[^a-z0-9_])@([a-z0-9_]+)/i', '/(^|[^a-z0-9_])#([a-z0-9_]+)/i'), array('<a href=\"$1\" target=\"_blank\">$1</a>', '$1<a href=\"\">@$2</a>', '$1<a href=\"index.php?hashtag=$2\">#$2</a>'), $msg);\r\n\t\treturn $final_message;\r\n\t}", "public function autoLinkUrls($text) {\n\t\t$placeholders = [];\n\t\t$replace = [];\n\n\t\t$insertPlaceholder = function($matches) use (&$placeholders) {\n\t\t\t$key = md5($matches[0]);\n\t\t\t$placeholders[$key] = $matches[0];\n\n\t\t\treturn $key;\n\t\t};\n\n\t\t$pattern = '#(?<!href=\"|src=\"|\">)((?:https?|ftp|nntp)://[a-z0-9.\\-:]+(?:/[^\\s]*)?)#i';\n\t\t$text = preg_replace_callback($pattern, $insertPlaceholder, $text);\n\n\t\t$pattern = '#(?<!href=\"|\">)(?<!\\b[[:punct:]])(?<!http://|https://|ftp://|nntp://)www.[^\\n\\%\\ <]+[^<\\n\\%\\,\\.\\ <](?<!\\))#i';\n\t\t$text = preg_replace_callback($pattern, $insertPlaceholder, $text);\n\n\t\tforeach ($placeholders as $hash => $url) {\n\t\t\t$link = $url;\n\n\t\t\tif (!preg_match('#^[a-z]+\\://#', $url)) {\n\t\t\t\t$url = 'http://' . $url;\n\t\t\t}\n\t\t\t$replace[$hash] = \"<a href=\\\"{$url}\\\">{$link}</a>\";\n\t\t}\n\t\treturn strtr($text, $replace);\n\t}", "function fixURL($url, $includeHREF ) {\n $properURL = \"\"; \n\tswitch( substr($url, 0, 4) )\n {\n\tcase \"http\":\n \t$properURL= $url;\n\t break;\n\tcase \"www.\":\n \t$properURL=\"http://\".$url;\n\t\tbreak;\n\tdefault:\n \t$properURL=\"http://www.\".$url;\n\t\tbreak;\n\t}\n\tif ( $includeHREF == true )\n\t{\n\t\t$properURL = \"<a href=\".$properURL.\">\".$properURL.\"</a>\";\n\t}\n\treturn $properURL; \n}", "function urlify($link, $disp, $color = '#0000FF', $bt_replace = true)\n{\n $link = htmlspecialchars($link, ENT_QUOTES);\n $disp = htmlspecialchars($disp, ENT_QUOTES);\n\n // replace backticks with html code to prevent errors\n if ($bt_replace === true) {\n $link = str_replace('`', '&#96;', $link);\n $disp = str_replace('`', '&#96;', $disp);\n }\n\n // return url\n return \"<a href='$link' target='_blank'><u><font color='$color'>$disp</font></u></a>\";\n}", "function urlify($link, $disp, $color = '#0000FF', $bt_replace = true)\n{\n $link = htmlspecialchars($link, ENT_QUOTES);\n $disp = htmlspecialchars($disp, ENT_QUOTES);\n\n // replace backticks with html code to prevent errors\n if ($bt_replace === true) {\n $link = str_replace('`', '&#96;', $link);\n $disp = str_replace('`', '&#96;', $disp);\n }\n\n // return url\n return \"<a href='$link' target='_blank'><u><font color='$color'>$disp</font></u></a>\";\n}", "function string_email_links( $p_string ) {\r\n\t$p_string = string_email( $p_string );\r\n return $p_string;\r\n}", "public function ___httpUrl() {\n\t\t$page = $this->pagefiles->getPage();\n\t\t$url = substr($page->httpUrl(), 0, -1 * strlen($page->url())); \n\t\treturn $url . $this->url(); \n\t}", "public function getUrl()\n\t{\n\t\treturn App\\Purifier::decodeHtml($this->get('linkto'));\n\t}", "function urlsTolinks($text) {\r\n\t\r\n\t\t// Make long URLs into links\r\n\t\t// Regexp improved by Bruce.\r\n\t\t$linked_text = eregi_replace(\"([[:space:].,\\(\\[])([[:alnum:]]{3,})://([[:alnum:]_-]+\\.)([[:alnum:]_-]{2,}[[:alnum:]/&=#?_\\.-]*)\",\r\n\t\t\t\t\t\t \"\\\\1<a href=\\\"\\\\2://\\\\3\\\\4\\\" target=\\\"newpage\\\">\\\\2://\\\\3\\\\4</a>\", $text);\r\n\r\n\t // Make short urls into links\r\n\t\t$linked_text = eregi_replace(\"([[:space:],\\(\\[])www\\.([[:alnum:]_-]+\\.)([[:alnum:]_-]{2,}[[:alnum:]/&=#?_\\.-]*)\", \"\\\\1<a href=\\\"http://www.\\\\2\\\\3\\\" target=\\\"newpage\\\">www.\\\\2\\\\3</a>\", $linked_text);\r\n\t\t\t\t\t\t \r\n\t\treturn $linked_text;\r\n\t\t\t\t\t\t \r\n\t\t\t\r\n\t}", "function autolink($string) {\n\t\t$string = preg_replace(\"/(([\\w\\.-]+))(@)([\\w\\.]+)\\b/i\", \"<a href=\\\"mailto:$0\\\">$0</a>\", $string);\n\t\t$string = preg_replace('#(http|https|ftp)://([^\\s]*)#', '<a href=\"\\\\1://\\\\2\" target=\"_blank\">\\\\1://\\\\2</a>', $string);\n\n\t\treturn $string;\n\t}", "function formatCurrentUrl() ;", "function formatString($string) {\n\t\tif(stripos($string, \"href=\") > -1 && !stripos($string, \"target\")) {\n\t\t\t$string = preg_replace('/href=\"(.+)\"/', 'href=\"$1\" target=\"_blank\"', $string);\n\t\t} else if(stripos($string, \"http://\") > -1) {\n\t\t\t$string = preg_replace('/(.+)/', '<a href=\"$1\" target=\"_blank\">$1</a>', $string);\n\t\t}\n\n\t\treturn $string;\n\t}", "function auto_link($str, $type = 'both', $popup = FALSE)\r\n\t{\r\n\t\t// Find and replace any URLs.\r\n\t\tif ($type !== 'email' && preg_match_all('#(\\w*://|www\\.)[^\\s()<>;]+\\w#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER))\r\n\t\t{\r\n\t\t\t// Set our target HTML if using popup links.\r\n\t\t\t$target = ($popup) ? ' target=\"_blank\"' : '';\r\n\r\n\t\t\t// We process the links in reverse order (last -> first) so that\r\n\t\t\t// the returned string offsets from preg_match_all() are not\r\n\t\t\t// moved as we add more HTML.\r\n\t\t\tforeach (array_reverse($matches) as $match)\r\n\t\t\t{\r\n\t\t\t\t// $match[0] is the matched string/link\r\n\t\t\t\t// $match[1] is either a protocol prefix or 'www.'\r\n\t\t\t\t//\r\n\t\t\t\t// With PREG_OFFSET_CAPTURE, both of the above is an array,\r\n\t\t\t\t// where the actual value is held in [0] and its offset at the [1] index.\r\n\t\t\t\t$a = '<a href=\"'.(strpos($match[1][0], '/') ? '' : 'http://').$match[0][0].'\"'.$target.'>'.$match[0][0].'</a>';\r\n\t\t\t\t$str = substr_replace($str, $a, $match[0][1], strlen($match[0][0]));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Find and replace any emails.\r\n\t\tif ($type !== 'url' && preg_match_all('#([\\w\\.\\-\\+]+@[a-z0-9\\-]+\\.[a-z0-9\\-\\.]+[^[:punct:]\\s])#i', $str, $matches, PREG_OFFSET_CAPTURE))\r\n\t\t{\r\n\t\t\tforeach (array_reverse($matches[0]) as $match)\r\n\t\t\t{\r\n\t\t\t\tif (filter_var($match[0], FILTER_VALIDATE_EMAIL) !== FALSE)\r\n\t\t\t\t{\r\n\t\t\t\t\t$str = substr_replace($str, safe_mailto($match[0]), $match[1], strlen($match[0]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $str;\r\n\t}", "function format_url($file_path)\n{\n $path_component = explode('/', $file_path);\n $path_component = array_map('rawurlencode', $path_component);\n\n return implode('/', $path_component);\n}", "function url_to_absolute($url) {\n\treturn str_replace(__CHV_BASE_URL__, __CHV_ROOT_DIR__, $url);\n}", "function auto_link_text($text) {\n\t// Pattern from http://daringfireball.net/2010/07/improved_regex_for_matching_urls\n $pattern = \"#(?i)\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\\\".,<>?«»“”‘’]))#\";\n $callback = create_function('$matches', '\n $url = array_shift($matches);\n $url_parts = parse_url($url);\n\n $text = parse_url($url, PHP_URL_HOST) . parse_url($url, PHP_URL_PATH);\n $text = preg_replace(\"/^www./\", \"\", $text);\n\n $last = -(strlen(strrchr($text, \"/\"))) + 1;\n if ($last < 0) {\n $text = substr($text, 0, $last) . \"&hellip;\";\n }\n\n return sprintf(\\'<a href=\"%s\">%s</a>\\', $url, $text);\n ');\n\n return preg_replace_callback($pattern, $callback, $text);\n}", "function __sfPageContentTask_rel2abs_replace($file,$url){\n if(preg_match(\"|^/|\",$url)) return $url;\n if(preg_match(\"|^#|\",$url)) return $url;\n if(preg_match(\"|^https?://|\",$url)) return $url;\n if(preg_match(\"|^mailto:|\",$url)) return $url;\n $abs = \"/\" . dirname($file).\"/\".$url;\n $abs = str_replace(\"/./\",\"/\",$abs);\n do{\n $abs = preg_replace(\"|/[^/]+/../|\",\"/\",$abs,-1,$c);\n }while($c);\n return $abs;\n}", "function aitch( $href, $absolute = FALSE ){\n\t\tif( $absolute )\n\t\t\treturn AitchRef::_site_url_absolute( $href );\n\t\telse\n\t\t\treturn AitchRef::_site_url( $href );\n\t}", "function linkify($text) {\n $matches = array(\n '/([A-Za-z]+:\\/\\/[A-Za-z0-9-_]+\\.[A-Za-z0-9-_:%&\\?\\/.=]+)/',\n '/(^|[^\\w])(#[\\d\\w\\-]+)/',\n '/(^|[^\\w])(@([\\d\\w\\-]+))/'\n );\n \n $replacements = array(\n '<a href=\"$1\">$1</a>',\n '$1<a href=\"http://search.twitter.com/search?q=$2\">$2</a>',\n '$1@<a href=\"http://twitter.com/$3\">$3</a>'\n );\n \n return preg_replace($matches, $replacements, $text);\n}", "public function urlAlias()\n {\n $useURLAlias =& $GLOBALS['eZContentObjectTreeNodeUseURLAlias'];\n $ini = eZINI::instance();\n $cleanURL = '';\n \n if ( !isset( $useURLAlias ) )\n {\n $useURLAlias = $ini->variable( 'URLTranslator', 'Translation' ) == 'enabled';\n }\n \n if ( $useURLAlias )\n {\n $aliases = eZURLAliasML::fetchByAction('module', 'topic/view/'.$this->attribute('id'));\n if (count($aliases))\n {\n $cleanURL = $this->forumNode()->urlAlias().'/'.$aliases[0]->attribute('text');\n }\n else\n {\n $cleanURL = 'topic/view/'.$this->attribute('id');\n } \n }\n else\n {\n $cleanURL = 'topic/view/'.$this->attribute('id');\n }\n \n return $cleanURL;\n }", "function esc_url($url) {\n\n if ('' == $url) {\n return $url;\n }\n\n $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\\|*\\'()\\\\x80-\\\\xff]|i', '', $url);\n\n $strip = array('%0d', '%0a', '%0D', '%0A');\n $url = (string) $url;\n\n $count = 1;\n while ($count) {\n $url = str_replace($strip, '', $url, $count);\n }\n\n $url = str_replace(';//', '://', $url);\n\n $url = htmlentities($url);\n\n $url = str_replace('&amp;', '&#038;', $url);\n $url = str_replace(\"'\", '&#039;', $url);\n\n if ($url[0] !== '/') {\n // We're only interested in relative links from $_SERVER['PHP_SELF']\n return '';\n } else {\n return $url;\n }\n }", "public static function absoluteURLs($html)\n {\n $html = str_replace('$CurrentPageURL', Controller::curr()->getRequest()->getURL(), $html);\n return HTTP::urlRewriter($html, function ($url) {\n //no need to rewrite, if uri has a protocol (determined here by existence of reserved URI character \":\")\n if (preg_match('/^\\w+:/', $url)) {\n return $url;\n }\n return Director::absoluteURL($url, true);\n });\n }", "public function to_url() {\n $post_data = $this->to_postdata();\n $out = $this->get_normalized_http_url();\n if ($post_data) {\n $out .= '?'.$post_data;\n }\n return $out;\n }", "function clean_urls($text) {\r\n\t$text = strip_tags(lowercase($text));\r\n\t$code_entities_match = array(' ?',' ','--','&quot;','!','@','#','$','%',\r\n '^','&','*','(',')','+','{','}','|',':','\"',\r\n '<','>','?','[',']','\\\\',';',\"'\",',','/',\r\n '*','+','~','`','=','.');\r\n\t$code_entities_replace = array('','-','-','','','','','','','','','','','',\r\n '','','','','','','','','','','','','');\r\n\t$text = str_replace($code_entities_match, $code_entities_replace, $text);\r\n\t$text = urlencode($text);\r\n\t$text = str_replace('--','-',$text);\r\n\t$text = rtrim($text, \"-\");\r\n\treturn $text;\r\n}", "function auto_link_text($text)\n{\n $pattern = '#\\b(([\\w-]+://?|www[.])[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/)))#';\n $callback = create_function('$matches', '\n $url = array_shift($matches);\n $url_parts = parse_url($url);\n\n $text = parse_url($url, PHP_URL_HOST) . parse_url($url, PHP_URL_PATH);\n $text = preg_replace(\"/^www./\", \"\", $text);\n\n $last = -(strlen(strrchr($text, \"/\"))) + 1;\n if ($last < 0) {\n $text = substr($text, 0, $last) . \"&hellip;\";\n }\n\n return sprintf(\\'<a rel=\"nofollow\" target=\"_blank\" href=\"%s\">%s</a>\\', $url, $text);\n ');\n\n return preg_replace_callback($pattern, $callback, $text);\n}", "function build_link($text, $page){\n\t$format = '<a href=\"%2$s\">%1$s</a>';\n\n\tprintf($format, $text, link_to($page, false));\n}", "protected function add_links_to_text() {\n\t $this->text = str_replace( array( /*':', '/', */'%' ), array( /*'<wbr></wbr>:', '<wbr></wbr>/', */'<wbr></wbr>%' ), $this->text );\n\t $this->text = preg_replace( '~(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)~', '<a href=\"$1\" target=\"_blank\">$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+@([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/$1\" rel=\"nofollow\" target=\"_blank\">@$1</a>', $this->text );\n\t $this->text = preg_replace( '~[\\s]+#([a-zA-Z0-9_]+)~', ' <a href=\"https://twitter.com/search?q=%23$1\" rel=\"nofollow\" target=\"_blank\">#$1</a>', $this->text );\n\t}", "function auto_link($text)\n{\n\n\n\t$url_re = '@(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)@';\n\t$url_replacement = \"<a href='$1' target='_blank'>$1</a>\";\n\n\treturn preg_replace($url_re, $url_replacement, $text);\n}", "function _formatLink($link) {\n //make sure the url is XHTML compliant (skip mailto)\n if(substr($link['url'], 0, 7) != 'mailto:') {\n $link['url'] = str_replace('&', '&amp;', $link['url']);\n $link['url'] = str_replace('&amp;amp;', '&amp;', $link['url']);\n }\n //remove double encodings in titles\n $link['title'] = str_replace('&amp;amp;', '&amp;', $link['title']);\n\n // be sure there are no bad chars in url or title\n // (we can't do this for name because it can contain an img tag)\n $link['url'] = strtr($link['url'], array('>' => '%3E', '<' => '%3C', '\"' => '%22'));\n $link['title'] = strtr($link['title'], array('>' => '&gt;', '<' => '&lt;', '\"' => '&quot;'));\n\n $ret = '';\n $ret .= $link['pre'];\n $ret .= '<a href=\"'.$link['url'].'\"';\n if(!empty($link['class'])) $ret .= ' class=\"'.$link['class'].'\"';\n if(!empty($link['target'])) $ret .= ' target=\"'.$link['target'].'\"';\n if(!empty($link['title'])) $ret .= ' title=\"'.$link['title'].'\"';\n if(!empty($link['style'])) $ret .= ' style=\"'.$link['style'].'\"';\n if(!empty($link['rel'])) $ret .= ' rel=\"'.trim($link['rel']).'\"';\n if(!empty($link['more'])) $ret .= ' '.$link['more'];\n $ret .= '>';\n $ret .= $link['name'];\n $ret .= '</a>';\n $ret .= $link['suf'];\n return $ret;\n }", "function urls_amigables($url) {\n\n$url = strtolower($url);\n\n//Rememplazamos caracteres especiales latinos\n\n$find = array('á', 'é', 'í', 'ó', 'ú', 'ñ');\n\n$repl = array('a', 'e', 'i', 'o', 'u', 'n');\n\n$url = str_replace ($find, $repl, $url);\n\n// Añaadimos los guiones\n\n$find = array(' ', '&', '\\r\\n', '\\n', '+'); \n$url = str_replace ($find, '-', $url);\n\n// Eliminamos y Reemplazamos demás caracteres especiales\n\n$find = array('/[^a-z0-9\\-<>]/', '/[\\-]+/', '/<[^>]*>/');\n\n$repl = array('', '-', '');\n\n$url = preg_replace ($find, $repl, $url);\n\nreturn $url;\n\n}", "function _xss_sanitization_esc_url( $url, $_context = 'display' ) {\n\n // URL protocols\n $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn');\n \n // Init\n $original_url = $url;\n \n // If blank, then no harm\n if ( '' == $url ) {\n return $url;\n }\n\n //Start cleaning\n $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\\|*\\'()\\\\x80-\\\\xff]|i', '', $url);\n \n $strip = array('%0d', '%0a', '%0D', '%0A');\n $url = wp_deep_replace($strip, $url);\n\n // Make sure its not a ;//\n $url = str_replace(';//', '://', $url);\n \n /* If the URL doesn't appear to contain a scheme, we\n * presume it needs http:// appended (unless a relative\n * link starting with /, # or ? or a php file).\n */\n if ( strpos($url, ':') === false && \n ! in_array( $url[0], array( '/', '#', '?' ) ) &&\n ! preg_match('/^[a-z0-9-]+?\\.php/i', $url) \n ){\n $url = 'http://' . $url;\n }\n\n // Replace ampersands and single quotes only when displaying.\n if ( 'display' == $_context ) {\n $url = kses_normalize_entities( $url );\n $url = str_replace( '&amp;', '&#038;', $url );\n $url = str_replace( \"'\", '&#039;', $url );\n }\n\n if ( kses_bad_protocol( $url, $protocols ) != $url ){\n return '';\n }\n\n return $url;\n}", "function &makeClickable( &$text ) {\n $patterns = array( \"/(^|[^]_a-z0-9-=\\\"'\\/])([a-z]+?):\\/\\/([^, \\r\\n\\\"\\(\\)'<>]+)/i\", \"/(^|[^]_a-z0-9-=\\\"'\\/])www\\.([a-z0-9\\-]+)\\.([^, \\r\\n\\\"\\(\\)'<>]+)/i\", \"/(^|[^]_a-z0-9-=\\\"'\\/])ftp\\.([a-z0-9\\-]+)\\.([^, \\r\\n\\\"\\(\\)'<>]+)/i\", \"/(^|[^]_a-z0-9-=\\\"'\\/:\\.])([a-z0-9\\-_\\.]+?)@([^, \\r\\n\\\"\\(\\)'<>\\[\\]]+)/i\" );\n $replacements = array( \"\\\\1<a href=\\\"\\\\2://\\\\3\\\" target=\\\"_blank\\\">\\\\2://\\\\3</a>\", \"\\\\1<a href=\\\"http://www.\\\\2.\\\\3\\\" target=\\\"_blank\\\">www.\\\\2.\\\\3</a>\", \"\\\\1<a href=\\\"ftp://ftp.\\\\2.\\\\3\\\" target=\\\"_blank\\\">ftp.\\\\2.\\\\3</a>\", \"\\\\1<a href=\\\"mailto:\\\\2@\\\\3\\\">\\\\2@\\\\3</a>\" );\n $text = preg_replace( $patterns, $replacements, $text );\n return $text;\n }", "function autolink($message) {\n\t$message = preg_replace('#([\\s|^])(www)#i', '$1http://$2', $message);\n\t$pattern = '#((http|https|ftp|telnet|news|gopher|file|wais):\\/\\/[^\\s]+)#i';\n\t$replacement = '<a href=\"$1\" target=\"_blank\">$1</a>';\n\t$message = preg_replace($pattern, $replacement, $message);\n\n\treturn $message;\n}", "function normalize($url) {\n\t\t//$result = preg_replace('%(?<!:/|[^/])/|(?<=&)&|&$|%', '', $url);\n\t\t$result=str_replace(array('://','//',':::'),array(':::','/','://'),$url);\n\t\treturn $result;\n\t}", "public function makeCleanURL($input) {\n\t\t\tif (strpos($input[1], \"://\") !== false) {\n\t\t\t\tfile_put_contents($this->copydir.md5($input[1]).\".\".$this->getExt($input[1]),file_get($input[1]));\n\t\t\t} else {\n\t\t\t\tcopy($this->getDirname($this->filename).\"/\".$input[1],$this->copydir.md5($input[1]).\".\".$this->getExt($input[1]));\n\t\t\t}\n\t\t\treturn \"url('\".$this->to.md5($input[1]).\".\".$this->getExt($input[1]).\"')\";\n\t\t}", "public function prepurl_for_display($args)\n {\n $url = $args['url'];\n if ($url != '') {\n if ($url == 'http://' || $url == 'http://http://' || $url == 'http:///') {\n $url = '';\n } elseif (strstr(\"http://\", $url)) {\n $url = \"http://\" . $url;\n }\n }\n return $url;\n }", "function qa_self_html()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\tglobal $qa_used_url_format;\n\n\treturn qa_path_html(qa_request(), $_GET, null, $qa_used_url_format);\n}", "function string_display_links( $p_string ) \r\n{\r\n\t$p_string = string_display( $p_string );\r\n\t$p_string = string_insert_hrefs( $p_string );\r\n\treturn $p_string;\r\n}", "function trlink($url)\n{\n // Check if the multi-language support is enabled\n if (!LocaleService::isMultilangEnabled()) {\n return $url;\n }\n\n // Parse the url\n $linkParts = parse_url($url);\n if ($linkParts === false) {\n return $url;\n }\n\n // It is an absolute url or there isn't no any path\n if (isset($linkParts['host']) || !isset($linkParts['path'])) {\n return $url;\n }\n\n // The link's path\n $linkPath = $linkParts['path'];\n\n // Get the current lang dir and the current page path\n $langDir = LocaleLinkService::getLangDir();\n $currentPath = LocaleLinkService::getPagePath();\n\n // Join the current path with the link path\n $resultUrl = '';\n if (substr($linkPath, 0, 1) === '/') {\n // An absolute path => Replace the current one\n $resultUrl = $linkPath;\n }\n else {\n // Relative paths => Merge with the current one\n // Note: the $currentPath is always absolute (start with '/') and it never\n // contains a trailing slash ('/')\n if ($currentPath === '/') {\n $resultUrl = '/' . $linkPath;\n }\n else {\n $resultUrl = dirname($currentPath) . '/' . $linkPath;\n }\n }\n \n // Using http_build_url\n // Available here without PECL: \n // // Join the current path with the link path\n // $resParts = [];\n // $linkParts['path'] = $currentPath;\n // http_build_url(\n // $linkParts, \n // array('path' => $linkPath),\n // HTTP_URL_JOIN_PATH,\n // $resParts\n // );\n // // Add the language dir\n // if (!empty($langDir)) {\n // $resParts['path'] = \"/{$langDir}\" . $resParts['path'];\n // }\n // return http_build_url($resParts);\n\n // Add the language dir\n if (!empty($langDir)) {\n $resultUrl = \"/{$langDir}\" . $resultUrl;\n }\n\n // Build the final url, preserving query string and fragment\n if (isset($linkParts['query'])) {\n $resultUrl .= '?' . $linkParts['query'];\n }\n if (isset($linkParts['fragment'])) {\n $resultUrl .= '#' . $linkParts['fragment'];\n }\n\n return $resultUrl;\n}", "public function autoLinkify($str)\n {\n return preg_replace_callback('/(?i)\\b((?:((?:ht|f)tps?:(?:\\/{1,3}|[a-z0-9%]))|[a-z0-9.\\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|Ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)\\/)(?:[^\\s()<>{}\\[\\]]+|\\([^\\s()]*?\\([^\\s()]+\\)[^\\s()]*?\\)|\\([^\\s]+?\\))+(?:\\([^\\s()]*?\\([^\\s()]+\\)[^\\s()]*?\\)|\\([^\\s]+?\\)|[^\\s`!()\\[\\]{};:\\'\".,<>?«»“”‘’])|(?:(?<!@)[a-z0-9]+(?:[.\\-][a-z0-9]+)*[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|Ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)\\b\\/?(?!@)))/i', \"self::processLinkify\", $str);\n }", "function mgl_instagram_format_link($str)\n{\n // Remove http:// and https:// from url\n $str = preg_replace('#^https?://#', '', $str);\n return $str;\n}", "function ozi_make_absolute_url($absolute, $relative) \r\n{\r\n\tif (empty($relative)) $relative=$absolute;\r\n $p = ozi_parse_url($relative);\r\n \r\n if(isset($p[\"scheme\"])) return $relative;\r\n $path = isset($p[\"path\"]) ? $p[\"path\"] : \"\";\r\n $path = dirname($path);\r\n extract(ozi_parse_url($absolute));\r\n if($relative{0} == '/') {\r\n $cparts = explode(\"/\", $relative);\r\n }\r\n else {\r\n $aparts = explode(\"/\", $path);\r\n \tif (count($aparts)>0) array_pop($aparts);\r\n $rparts = explode(\"/\", $relative);\r\n $cparts = array_merge($aparts, $rparts);\r\n foreach($cparts as $i => $part) {\r\n if($part == '.') $cparts[$i] = null;\r\n if($part == '..') {$cparts[$i - 1] = null;$cparts[$i] = null;}\r\n }\r\n }\r\n\t\r\n\t//Filter cparts, removing empty elements\r\n\t$res = array();\r\n\tforeach ($cparts as $v) if (strlen($v)>0) $res[] = $v;\r\n\t$cparts = $res;\r\n\r\n\t//##+kenfoo 14042007. Added proper handling of paths ending with a slash.\r\n\t//Earlier code dropped the final slash, causing problems with Facebook /inbox/.\r\n $n = strlen($relative);\r\n if ($n>0 && $relative[$n-1]=='/') $cparts[]='';\r\n \r\n $path = implode(\"/\", $cparts);\r\n $url = \"\";\r\n if(isset($scheme)) $url = \"$scheme://\";\r\n if(isset($user)) {\r\n $url .= \"$user\";\r\n if($pass) $url .= \":$pass\";\r\n $url .= \"@\";\r\n }\r\n if(isset($host)) {\r\n\t\t$url .= $host;\r\n\t if(isset($port)) $url .= \":$port\";\r\n\t\t$url .='/';\r\n\t}\r\n $url .= $path;\r\n return $url;\r\n\r\n}", "function generer_urls_canoniques(){\n\tinclude_spip('balise/url_');\n\n\tif (count($GLOBALS['contexte'])==0){\n\t\t$objet = 'sommaire';\n\t} elseif (isset($GLOBALS['contexte']['id_article'])) {\n\t\t$id_objet = $GLOBALS['contexte']['id_article'];\n\t\t$objet = 'article';\n\t} elseif (isset($GLOBALS['contexte']['id_rubrique'])) {\n\t\t$id_objet = $GLOBALS['contexte']['id_rubrique'];\n\t\t$objet = 'rubrique';\n\t}\n\n\tswitch ($objet) {\n\t\tcase 'sommaire':\n\t\t\t$flux .= '<link rel=\"canonical\" href=\"' . url_de_base() . '\" />';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$flux .= '<link rel=\"canonical\" href=\"' . url_de_base() . generer_url_entite($id_objet, $objet) . '\" />';\n\t\t\tbreak;\n\t}\n\n\treturn $flux;\n}", "function link_souce($text){\n\n if(post::isValidURL($text)){\n $text = '<a href=\"'.$text.'\">'.$text.'</a>';\n } \n return $text;\n }", "function linkify($s) {\n\n Octopus::loadExternal('simplehtmldom');\n\n $s = '<p>' . $s . '</p>';\n $dom = str_get_html($s);\n $regex = '/(\\s|^|\\()(https?:\\/\\/[^\\s<]+?[^\\.])(\\.?(\\s|$|\\)))/ims';\n $regex2 = '/(\\s|^|\\()([^\\s<\\(\\.]+\\.[\\w]{2,}[^\\s<]*?)(\\.?(\\s|$|\\)))/ims';\n\n foreach ($dom->nodes as $el) {\n\n if ($el->tag == 'text') {\n if (count($el->nodes) == 0 && $el->parent->tag != 'a') {\n $el->innertext = preg_replace($regex, '$1<a href=\"$2\">$2</a>$3', $el->innertext);\n $el->innertext = preg_replace($regex2, '$1<a href=\"http://$2\">$2</a>$3', $el->innertext);\n }\n }\n\n }\n\n return substr($dom->save(), 3, -4);\n\n }", "static function absolutePath($content){\n\t\t$find = array('http://','href=\"http://','href=\"/');\n\t\t$replace = array('style=\"color:#124f7d; text-decoration:none;\" http://','style=\"color:#124f7d; text-decoration:none;\" href=\"http://','style=\"color:#124f7d; text-decoration:none;\" href=\"http://archive.azcentral.com/');\n\t\t$search = str_replace($find,$replace,$content);\n\t\treturn $search;\n\t}", "function wac_create_link($string) {\n\t$url = '@(http)?(s)?(://)?(([a-zA-Z])([-\\w]+\\.)+([^\\s\\.]+[^\\s]*)+[^,.\\s])@';\n\treturn preg_replace($url, 'http$2://$4', $string);\n}", "function textToUrl($string) {\n //first replace % to %25\n $char = \"%\";\n $replace = \"$25\";\n $string = str_replace($char, $replace, $string);\n\n\n $entities = array('%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%23', '%5B', '%5D', '%20');\n $replacements = array('!', '*', \"'\", \"(\", \")\", \";\", \":\", \"@\", \"&\", \"=\", \"+\", \"$\", \",\", \"/\", \"?\", \"#\", \"[\", \"]\", \" \");\n return str_replace($replacements, $entities, urlencode($string));\n }", "public function setter_url_as_html ($value)\n {\n $url = $this->_url_for_value ($value);\n return $url->as_text();\n }", "function _shortenURL(&$ret){\n\t $links = explode('<a', $ret);\n\t $countlinks = count($links);\n\t for ($i = 0; $i < $countlinks; $i++){\n\t\t\t$link = $links[$i];\t\t\t\n\t\t\t$link = (preg_match('#(.*)(href=\")#is', $link)) ? '<a' . $link : $link;\n\t\n\t\t\t$begin = strpos($link, '>') + 1;\n\t\t\t$end = strpos($link, '<', $begin);\n\t\t\t$length = $end - $begin;\n\t\t\t$urlname = substr($link, $begin, $length);\n\n\t\t\t$chunked = (strlen($urlname) > 50 && preg_match('#^(http://|ftp://|www\\.)#is', $urlname)) ? substr_replace($urlname, '...', 30, -10) : $urlname;\n\t\t\t$ret = str_replace('>' . $urlname . '<', '>' . $chunked . '<', $ret); \n\t\n\t }\n\t}", "public function niceUrl()\n {\n return '/' . $this->recipe_id . '/' . $this->url;\n }", "function linkUrlsInTrustedHtml($html)\n{\n return \\Kwi\\UrlLinker::getInstance()->linkUrlsInTrustedHtml($html);\n}", "function linkfy($title) {\n $title = strip_tags($title);\n // Preserve escaped octets.\n $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);\n // Remove percent signs that are not part of an octet.\n $title = str_replace('%', '', $title);\n // Restore octets.\n $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);\n $title = remove_accents($title);\n if (seems_utf8($title)) {\n $title = utf8_uri_encode($title, 200);\n }\n\n $title = preg_replace('/&.+?;/', '', $title); // kill entities*/\n $title = preg_replace('/\\s+/', '-', $title);\n $title = preg_replace('|-+|', '-', $title);\n $title = trim($title, '-');\n return mb_strtolower($title, 'utf-8');\n}", "function _make_url_clickable_cb($matches)\n{\n\t$ret = '';\n\t$url = $matches[2];\n\t$url = clean_url($url);\n\tif ( empty($url) )\n\t\treturn $matches[0];\n\t// removed trailing [.,;:] from URL\n\tif ( in_array(substr($url, -1), array('.', ',', ';', ':')) === true ) {\n\t\t$ret = substr($url, -1);\n\t\t$url = substr($url, 0, strlen($url)-1);\n\t}\n\treturn $matches[1] . '<a href=\"'.$url.'\"'.COMMENT_NOFOLLOW.'>'.$url.'</a>' . $ret;\n}", "function absolute_url($options = array(), $route = null, $queryParams = array(),\n $reset = false, $encode = true\n) {\n $serverUrlHelper = new Zend_View_Helper_ServerUrl;\n $urlHelper = new Omeka_View_Helper_Url;\n return $serverUrlHelper->serverUrl()\n . $urlHelper->url($options, $route, $queryParams, $reset, $encode);\n}", "function make_url_absolute($base_url, $relative_url) {\n // Replace any spaces out of the relative url\n // Not doing a full urlencode here b/c encoding only the characters we want to encode gets complicated\n $relative_url = str_replace(' ', '%20', $relative_url);\n\n if (substr($relative_url, 0, 4) === 'http') {\n // In this case the URL is already absolute, so we just return it\n return $relative_url;\n } else {\n $base_url_scheme = parse_url($base_url, PHP_URL_SCHEME);\n $base_url_host = parse_url($base_url, PHP_URL_HOST);\n $base_url_path = substr(parse_url($base_url, PHP_URL_PATH), 0, strrpos(parse_url($base_url, PHP_URL_PATH), '/'));\n\n if (substr($relative_url, 0, 1) === '/') {\n return $base_url_scheme . '://' . $base_url_host . $relative_url;\n } else {\n return $base_url_scheme . '://' . $base_url_host . $base_url_path . '/' . $relative_url;\n }\n }\n}", "static public function link($url)\n {\n return Misc::UrlPrefix().$url;\n }", "public static function absolute_url($txt, $basePath) {\r\n\t$needles = array('href=\"', 'src=\"', 'url(\"', 'background=\"');\r\n\t$new_txt = '';\r\n\tif (substr($basePath, -1) != '/')\r\n\t $basePath .= '/';\r\n\t$new_base_url = $basePath;\r\n\t$base_url_parts = parse_url($basePath);\r\n\tforeach ($needles as $needle) {\r\n\t while ($pos = strpos($txt, $needle)) {\r\n\t\t$pos += strlen($needle);\r\n\t\tif (substr($txt, $pos, 7) != 'http://' && substr($txt, $pos, 8) != 'https://' && substr($txt, $pos, 6) != 'ftp://' && substr($txt, $pos, 9) != 'mailto://') {\r\n\t\t if (substr($txt, $pos, 1) == '/')\r\n\t\t\t$new_base_url = $base_url_parts['scheme'] . '://' . $base_url_parts['host'];\r\n\t\t $new_txt .= substr($txt, 0, $pos) . $new_base_url;\r\n\t\t} else {\r\n\t\t $new_txt .= substr($txt, 0, $pos);\r\n\t\t}\r\n\t\t$txt = substr($txt, $pos);\r\n\t }\r\n\t $txt = $new_txt . $txt;\r\n\t $new_txt = '';\r\n\t}\r\n\treturn $txt;\r\n }", "function changeRelativeAbsolute($string)\n{\n $data = preg_replace('#(href|src)=\"([^:\"]*)(\"|(?:(?:%20|\\s|\\+)[^\"]*\"))#', '$1=\"'.$_SESSION['site_sitehttp'].'/$2$3', $string);\n return $data;\n}", "function ywig_sanitize_url( $url ) {\n\t$output = esc_url_raw( $url );\n\treturn $output;\n}", "public function getContent() : string\n {\n return sprintf('<a href=\"%s\">%s</a>', $this->link, parent::getContent());\n }", "private function format_url($url) {\n\t\treturn (strpos($url, 'http') !== 0) ? 'https://' . $url : $url;\n\t}", "private function wrapURL($value){\n if( $value ){\n \t\t\treturn url($value);\n \t\t}\n\n \t\treturn \"\";\n }", "function make_links_clickable($text)\r\n {\r\n return preg_replace('!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;//=]+)!i', '<a href=\"$1\" target=\"_blank\">$1</a>', $text);\r\n }", "private function make_clickable_url($string){\n\t //The Regular Expression filter\n\t $reg_exUrl = \"/(?i)\\b((?:https?:\\/\\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\\\".,<>?«»“”‘’]))/\";\n\t \n\t // Check if there is a url in the text\n\t if(preg_match($reg_exUrl, $string, $url)) {\n\t \n\t if(strpos( $url[0], \":\" ) === false){\n\t $link = 'http://'.$url[0];\n\t }else{\n\t $link = $url[0];\n\t }\n\t \n\t // make the urls hyper links\n\t $string = preg_replace($reg_exUrl, '<a href=\"'.$link.'\" title=\"'.$url[0].'\" target=\"_blank\">'.$url[0].'</a>', $string);\n\t \n\t }\n\t \n\t return $string;\n\t}", "function hyperlink($text) {\n\n\n $regex = \"/(?#WebOrIP)((?#protocol)((http|https):\\/\\/)?(?#subDomain)(([a-zA-Z0-9]+\\.(?#domain)[a-zA-Z0-9\\-]+(?#TLD)(\\.[a-zA-Z]+){1,2})|(?#IPAddress)((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])))+(?#Port)(:[1-9][0-9]*)?)+(?#Path)((\\/((?#dirOrFileName)[a-zA-Z0-9_\\-\\%\\~\\+]+)?)*)?(?#extension)(\\.([a-zA-Z0-9_]+))?(?#parameters)(\\?([a-zA-Z0-9_\\-]+\\=[a-z-A-Z0-9_\\-\\%\\~\\+]+)?(?#additionalParameters)(\\&([a-zA-Z0-9_\\-]+\\=[a-z-A-Z0-9_\\-\\%\\~\\+]+)?)*)?/\";\n $text = preg_replace( $regex, \"<a href=\\\"http://$4\\\" style=\\\"font-weight: bold;\\\" target='_new'>$1</a>\", $text );\n\n/*\n // match protocol://address/path/\n $text = ereg_replace(\"[a-zA-Z]+://([.]?[a-zA-Z0-9_/-])*\", \"<a href=\\\"\\\\0\\\">\\\\0</a>\", $text);\n\n // match www.something\n $text = ereg_replace(\"(^| )(www([.]?[a-zA-Z0-9_/-])*)\", \"\\\\1<a href=\\\"http://\\\\2\\\">\\\\2</a>\", $text);\n*/\n return $text;\n }", "function esc_url( $url, $protocols = null, $_context = 'display' ) {\n\t$original_url = $url;\n\n\tif ( '' == $url )\n\t\treturn $url;\n\t$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\\|*\\'()\\\\x80-\\\\xff]|i', '', $url);\n\t$strip = array('%0d', '%0a', '%0D', '%0A');\n\t$url = _deep_replace($strip, $url);\n\t$url = str_replace(';//', '://', $url);\n\t/* If the URL doesn't appear to contain a scheme, we\n\t * presume it needs http:// appended (unless a relative\n\t * link starting with /, # or ? or a php file).\n\t */\n\tif ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&\n\t\t! preg_match('/^[a-z0-9-]+?\\.php/i', $url) )\n\t\t$url = 'http://' . $url;\n\n\t// Replace ampersands and single quotes only when displaying.\n\tif ( 'display' == $_context ) {\n\t\t$url = wp_kses_normalize_entities( $url );\n\t\t$url = str_replace( '&amp;', '&#038;', $url );\n\t\t$url = str_replace( \"'\", '&#039;', $url );\n\t}\n\n\tif ( '/' === $url[0] ) {\n\t\t$good_protocol_url = $url;\n\t} else {\n\t\tif ( ! is_array( $protocols ) )\n\t\t\t$protocols = wp_allowed_protocols();\n\t\t$good_protocol_url = wp_kses_bad_protocol( $url, $protocols );\n\t\tif ( strtolower( $good_protocol_url ) != strtolower( $url ) )\n\t\t\treturn '';\n\t}\n\n\t/**\n\t * Filter a string cleaned and escaped for output as a URL.\n\t *\n\t * @since 2.3.0\n\t *\n\t * @param string $good_protocol_url The cleaned URL to be returned.\n\t * @param string $original_url The URL prior to cleaning.\n\t * @param string $_context If 'display', replace ampersands and single quotes only.\n\t */\n\treturn apply_filters( 'clean_url', $good_protocol_url, $original_url, $_context );\n}", "function url ($link) {\r\n\treturn $link;\r\n}", "function labs_url_grabber() {\n\tif ( ! preg_match( '/<a\\s[^>]*?href=[\\'\"](.+?)[\\'\"]/is', get_the_content(), $matches ) )\n\t\treturn false;\n\n\treturn esc_url_raw( $matches[1] );\n}", "public static function makeLinks($string){\n\n\t\t/*** make sure there is an http:// on all URLs ***/\n\t\t$string = preg_replace(\"/([^\\w\\/])(www\\.[a-z0-9\\-]+\\.[a-z0-9\\-]+)/i\", \"$1http://$2\",$string);\n\t\t/*** make all URLs links ***/\n\t\t$string = preg_replace(\"/([\\w]+:\\/\\/[\\w-?&;#~=\\.\\/\\@]+[\\w\\/])/i\",\"<a target=\\\"_blank\\\" href=\\\"$1\\\">$1</a>\",$string);\n\t\t/*** make all emails hot links ***/\n\t\t$string = preg_replace(\"/([\\w-?&;#~=\\.\\/]+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?))/i\",\"<a href==\\\"mailto:$1\\\">$1</a>\",$string);\n\n\t\treturn $string;\n\t}", "public function url()\n\t{\n\t\treturn ($this->secure() ? 'https' : 'http') . '//' . $this->domainName() . $this->uri();\n\t}", "function tPregLink ($content) \n{\n // FB::trace('tPregLink');\n $content = preg_replace(\n array('#([\\s>])([\\w]+?://[\\w\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is'\n , '#([\\s>])((www|ftp)\\.[\\w\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is'\n , '#([\\s>])([a-z0-9\\-_.]+)@([^,< \\n\\r]+)#i'\n )\n , \n array('$1<a href=\"$2\">$2</a>'\n , '$1<a href=\"http://$2\">$2</a>'\n , '$1<a href=\"mailto:$2@$3\">$2@$3</a>'\n )\n , $content\n );\n # this one is not in an array because we need it to run last, for cleanup of accidental links within links\n $content = preg_replace(\n \"#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i\"\n , \"$1$3</a>\"\n , $content\n );\n $content = preg_replace_callback(\n '/<a (.*?)href=\"(.*?)\\/\\/(.*?)\"(.*?)>(.*?)<\\/a>/i'\n , 'tPregLinkCallback'\n , $content\n );\n return trim($content);\n}", "public function format_text_to_links( $text ) {\r\n\t\tif( empty( $text ) ) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t $text = preg_replace( \"/(^|[\\n ])([\\w]*?)((ht|f)tp(s)?:\\/\\/[\\w]+[^ \\,\\\"\\n\\r\\t<]*)/is\", \"$1$2<a href=\\\"$3\\\" >$3</a>\", $text );\r\n\t $text = preg_replace( \"/(^|[\\n ])([\\w]*?)((www|ftp)\\.[^ \\,\\\"\\t\\n\\r<]*)/is\", \"$1$2<a href=\\\"http://$3\\\" >$3</a>\", $text );\r\n\t $text = preg_replace( \"/(^|[\\n ])([a-z0-9&\\-_\\.]+?)@([\\w\\-]+\\.([\\w\\-\\.]+)+)/i\", \"$1<a href=\\\"mailto:$2@$3\\\">$2@$3</a>\", $text );\r\n\t \r\n\t\treturn $text;\r\n\t}", "function apri_in_nuova_scheda($text) {\n\t$return_url = str_replace('<a', '<a target=\"_blank\" title=\"Apri link su nuova scheda\"', $text);\n\treturn $return_url;\n}", "public function makeLinks() {\r\n $this->url = new Url(sprintf(\"/f-p%d.htm#%d\", $this->id, $this->id));\r\n $this->url->single = sprintf(\"/forums?mode=post.single&id=%d\", $this->id);\r\n $this->url->report = sprintf(\"/f-report-%d.htm\", $this->id);\r\n $this->url->reply = sprintf(\"/f-po-quote-%d.htm\", $this->id);\r\n $this->url->delete = sprintf(\"/f-po-delete-%d.htm\", $this->id);\r\n $this->url->edit = sprintf(\"/f-po-editpost-%d.htm\", $this->id);\r\n $this->url->replypm = sprintf(\"/messages/new/from/%d/\", $this->id);\r\n $this->url->iplookup = sprintf(\"/moderators?mode=ip.lookup&ip=%s\", $this->ip);\r\n $this->url->herring = sprintf(\"/f-herring-p-%d.htm\", $this->id);\r\n \r\n if ($this->thread->forum->id == 71) {\r\n $this->url->developers = sprintf(\"/%s/d/%s/%s\", \"developers\", $this->thread->url_slug, $this->url_slug);\r\n }\r\n \r\n return $this;\r\n }", "function fixUrl($str){\n return urlencode($str);\n}", "function url_amigable($url)\n {\n $url = strtolower($url);\n //Rememplazamos caracteres especiales latinos\n $find = array('á', 'é', 'í', 'ó', 'ú', 'ñ');\n $repl = array('a', 'e', 'i', 'o', 'u', 'n');\n $url = str_replace($find, $repl, $url);\n // Añaadimos los guiones\n $find = array(' ', '&', '\\r\\n', '\\n', '+');\n $url = str_replace($find, '-', $url);\n // Eliminamos y Reemplazamos demás caracteres especiales\n $find = array('/[^a-z0-9\\-<>]/', '/[\\-]+/', '/<[^>]*>/');\n $repl = array('', '-', '');\n $url = preg_replace($find, $repl, $url);\n\n return $url;\n }", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "function urlFormat($str) {\n // strip all the evil white spaces\n $str = preg_replace('/\\s*/', '', $str);\n // lowercase the string\n $str = strtolower($str);\n // encode the url to help fight the bad guys.. and maybe you..\n $str = urlencode($str);\n return $str;\n}" ]
[ "0.6771063", "0.6640493", "0.6540757", "0.65244406", "0.6461215", "0.64502406", "0.64234203", "0.6373596", "0.6373596", "0.6347827", "0.6319423", "0.6298491", "0.62962556", "0.6279269", "0.627378", "0.62690306", "0.6226952", "0.6217161", "0.6208363", "0.6198032", "0.6198032", "0.61517394", "0.6134609", "0.60745305", "0.6071993", "0.606614", "0.60405666", "0.6030404", "0.6018591", "0.601198", "0.6004676", "0.5995941", "0.5993309", "0.59848434", "0.5983616", "0.5967361", "0.59634894", "0.59460604", "0.5942228", "0.59265643", "0.59249705", "0.59238815", "0.5911996", "0.5906372", "0.5887827", "0.58871967", "0.5884015", "0.587919", "0.58727753", "0.5867153", "0.5865509", "0.58588254", "0.58459765", "0.5836667", "0.5826724", "0.5822787", "0.58224803", "0.5818231", "0.5812229", "0.580811", "0.58078337", "0.58035237", "0.58019507", "0.57977307", "0.5795986", "0.57912195", "0.5784897", "0.577426", "0.57684314", "0.5767039", "0.5760226", "0.57569665", "0.57428086", "0.57379866", "0.57325107", "0.5728772", "0.57251287", "0.5724948", "0.5721239", "0.5717283", "0.5716397", "0.5701936", "0.5701734", "0.5701508", "0.5696267", "0.5693872", "0.5691845", "0.5690858", "0.5682403", "0.5679336", "0.5675822", "0.5675592", "0.5668647", "0.5665339", "0.5665339", "0.5665339", "0.5665339", "0.5665339", "0.5665339", "0.5662995" ]
0.57842267
67
Handles conversion of HTML entities into text
public static function entities_replace(string $html): string { $html = strtr($html, ['&ldquo;' => '"', '&rdquo;' => '"', '&lsquo;' => '\'', '&rsquo;' => '\'', ]); return html_entity_decode($html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertHtmlEntities($str)\n{\n return htmlentities($str, ENT_QUOTES, \"UTF-8\");\n}", "public function htmlEntitiesToChars($str)\n {\n// if (mb_detect_encoding($str) == 'UTF-8'){\n// decode decimal HTML entities added by web browser\n $str = preg_replace('/&#\\d{2,5};/ue', \"\\$this->utf8_entity_decode('$0')\", $str);\n// decode hex HTML entities added by web browser\n $str = preg_replace('/&#x([a-fA-F0-7]{2,8});/ue', \"\\$this->utf8_entity_decode('&#'.hexdec('$1').';')\", $str ); \n// decode named characters\n $str = html_entity_decode($str, ENT_QUOTES, \"utf-8\");\n// echo $str.'<br />';\n// }\n return $str; \n }", "protected function toText()\n\t{\n\t\treturn html_entity_decode($this->toHtml());\n\t}", "function __($htmlText, $ent = 0) {\n if ( ! $ent ) $ent = ENT_COMPAT | ENT_HTML401;\n\n $matches = Array();\n $sep = '###HTMLTAG###';\n\n preg_match_all(\":</{0,1}[a-z]+[^>]*>:i\", $htmlText, $matches);\n\n $tmp = preg_replace(\":</{0,1}[a-z]+[^>]*>:i\", $sep, $htmlText);\n $tmp = explode($sep, $tmp);\n\n for ($i=0; $i<count($tmp); $i++)\n $tmp[$i] = htmlentities($tmp[$i], $ent, 'UTF-8', false);\n\n $tmp = join($sep, $tmp);\n\n for ($i=0; $i<count($matches[0]); $i++)\n $tmp = preg_replace(\":$sep:\", $matches[0][$i], $tmp, 1);\n\n return $tmp;\n}", "private static function entities($data)\n {\n return strtr($data, array(\n '<' => '&lt;',\n '>' => '&gt;',\n '\"' => '&quot;'\n ));\n }", "function htmlentities2($text)\n {\n }", "function secu_txt($text) {\n return htmlentities(strip_tags($text), ENT_QUOTES, 'UTF-8');\n}", "function wp_kses_normalize_entities( $string, $context = 'html' ) {\n $string = str_replace( '&', '&amp;', $string );\n \n // Change back the allowed entities in our list of allowed entities.\n if ( 'xml' === $context ) {\n $string = preg_replace_callback( '/&amp;([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_xml_named_entities', $string );\n } else {\n $string = preg_replace_callback( '/&amp;([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_named_entities', $string );\n }\n $string = preg_replace_callback( '/&amp;#(0*[0-9]{1,7});/', 'wp_kses_normalize_entities2', $string );\n $string = preg_replace_callback( '/&amp;#[Xx](0*[0-9A-Fa-f]{1,6});/', 'wp_kses_normalize_entities3', $string );\n \n return $string;\n}", "function _htmlentities($str) \n {\n $transtab=get_html_translation_table (HTML_ENTITIES,ENT_QUOTES);\n $transtab[chr(38)] = '&';\n return preg_replace(\"/&(?![A-Za-z]{0,4}\\w{2,3};|#[0-9]{2,5};)/\",\"&amp;\" , strtr($str, $transtab));\n }", "function decode_entities($text) {\n $text= html_entity_decode($text,ENT_QUOTES,\"ISO-8859-1\"); #NOTE: UTF-8 does not work!\n //$text= preg_replace_callback('/&#(\\d+);/',\"chr(\\\\1)\",$text); #decimal notation\n //$text= preg_replace_callback('/&#x([a-f0-9]+);/mei',\"chr(0x\\\\1)\",matches); #hex notation\n return $text;\n}", "function unconvertHTML($strInput)//Convert html special code to standart form\n{\n\t//$strInput = html_entity_decode($strInput);\n\t$strInput = str_replace('&quot;', '\"', $strInput);\n\t$strInput = str_replace(\"&#039;\", \"'\", $strInput);\n\treturn $strInput;\n}", "function _striptext($document)\n\t{\n\t\t\n\t\t// I didn't use preg eval (//e) since that is only available in PHP 4.0.\n\t\t// so, list your entities one by one here. I included some of the\n\t\t// more common ones.\n\t\t\t\t\t\t\t\t\n\t\t$search = array(\"'<script[^>]*?>.*?</script>'si\",\t// strip out javascript\n\t\t\t\t\t\t\"'<[\\/\\!]*?[^<>]*?>'si\",\t\t\t// strip out html tags\n\t\t\t\t\t\t\"'([\\r\\n])[\\s]+'\",\t\t\t\t\t// strip out white space\n\t\t\t\t\t\t\"'&(quot|#34|#034|#x22);'i\",\t\t// replace html entities\n\t\t\t\t\t\t\"'&(amp|#38|#038|#x26);'i\",\t\t\t// added hexadecimal values\n\t\t\t\t\t\t\"'&(lt|#60|#060|#x3c);'i\",\n\t\t\t\t\t\t\"'&(gt|#62|#062|#x3e);'i\",\n\t\t\t\t\t\t\"'&(nbsp|#160|#xa0);'i\",\n\t\t\t\t\t\t\"'&(iexcl|#161);'i\",\n\t\t\t\t\t\t\"'&(cent|#162);'i\",\n\t\t\t\t\t\t\"'&(pound|#163);'i\",\n\t\t\t\t\t\t\"'&(copy|#169);'i\",\n\t\t\t\t\t\t\"'&(reg|#174);'i\",\n\t\t\t\t\t\t\"'&(deg|#176);'i\",\n\t\t\t\t\t\t\"'&(#39|#039|#x27);'\",\n\t\t\t\t\t\t\"'&(euro|#8364);'i\",\t\t\t\t// europe\n\t\t\t\t\t\t\"'&a(uml|UML);'\",\t\t\t\t\t// german\n\t\t\t\t\t\t\"'&o(uml|UML);'\",\n\t\t\t\t\t\t\"'&u(uml|UML);'\",\n\t\t\t\t\t\t\"'&A(uml|UML);'\",\n\t\t\t\t\t\t\"'&O(uml|UML);'\",\n\t\t\t\t\t\t\"'&U(uml|UML);'\",\n\t\t\t\t\t\t\"'&szlig;'i\",\n\t\t\t\t\t\t);\n\t\t$replace = array(\t\"\",\n\t\t\t\t\t\t\t\"\",\n\t\t\t\t\t\t\t\"\\\\1\",\n\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\">\",\n\t\t\t\t\t\t\t\" \",\n\t\t\t\t\t\t\tchr(161),\n\t\t\t\t\t\t\tchr(162),\n\t\t\t\t\t\t\tchr(163),\n\t\t\t\t\t\t\tchr(169),\n\t\t\t\t\t\t\tchr(174),\n\t\t\t\t\t\t\tchr(176),\n\t\t\t\t\t\t\tchr(39),\n\t\t\t\t\t\t\tchr(128),\n\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\"Ä\",\n\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);\n\t\t\t\t\t\n\t\t$text = preg_replace($search,$replace,$document);\n\t\t\t\t\t\t\t\t\n\t\treturn $text;\n\t}", "function htmlToPlainText($str){\n $str = str_replace('&nbsp;', ' ', $str);\n $str = html_entity_decode($str, ENT_QUOTES | ENT_COMPAT , 'UTF-8');\n $str = html_entity_decode($str, ENT_HTML5, 'UTF-8');\n $str = html_entity_decode($str);\n $str = htmlspecialchars_decode($str);\n $str = strip_tags($str);\n \n return $str;\n }", "function entities($data, $strategy = 'html', $encoding = null)\n {\n return foil('escaper')->escape($data, $strategy, $encoding);\n }", "public function unescape($html) {\n return html_entity_decode($html);\n }", "public function testParseHtmlEntities()\n {\n $file = __DIR__ . '/data/encoding.txt';\n $full_message = file_get_contents($file);\n $this->assertNotEmpty($full_message);\n\n $structure = Mime_Helper::decode($full_message, true, true);\n $this->assertEquals(\n \"\\npöördumise töötaja.\\n<b>Võtame</b> töösse võimalusel.\\npöördumisele süsteemis\\n\\n\", $structure->body\n );\n }", "function xml_entities($text, $charset = 'UTF-8'){\n\t\t$xml_special_chars = array(\"&quot;\",\"&amp;\",\"&apos;\",\"&lt;\",\"&gt;\");\n $text = htmlentities($text, ENT_COMPAT, $charset, false);\n\n $xml_special_char_regex = \"(?\";\n foreach($xml_special_chars as $key => $value){\n $xml_special_char_regex .= \"(?!$value)\";\n }\n $xml_special_char_regex .= \")\";\n \n $pattern = \"/$xml_special_char_regex&([a-zA-Z0-9]+;)/\";\n return preg_replace($pattern, '&amp;${1}', $text);\n}", "private function _html_entity_decode($str, $charset='UTF-8')\r\n\t{\r\n\t\tif (stristr($str, '&') === FALSE) return $str;\r\n\t\t\t\r\n\t\t// The reason we are not using html_entity_decode() by itself is because\r\n\t\t// while it is not technically correct to leave out the semicolon\r\n\t\t// at the end of an entity most browsers will still interpret the entity\r\n\t\t// correctly. html_entity_decode() does not convert entities without\r\n\t\t// semicolons, so we are left with our own little solution here. Bummer.\r\n\t\r\n\t\tif (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8' OR version_compare(phpversion(), '5.0.0', '>=')))\r\n\t\t{\r\n\t\t\t$str = html_entity_decode($str, ENT_COMPAT, $charset);\r\n\t\t\t$str = preg_replace('~&#x([0-9a-f]{2,5})~ei', 'chr(hexdec(\"\\\\1\"))', $str);\r\n\t\t\treturn preg_replace('~&#([0-9]{2,4})~e', 'chr(\\\\1)', $str);\r\n\t\t}\r\n\t\t\r\n\t\t// Numeric Entities\r\n\t\t$str = preg_replace('~&#x([0-9a-f]{2,5});{0,1}~ei', 'chr(hexdec(\"\\\\1\"))', $str);\r\n\t\t$str = preg_replace('~&#([0-9]{2,4});{0,1}~e', 'chr(\\\\1)', $str);\r\n\t\r\n\t\t// Literal Entities - Slightly slow so we do another check\r\n\t\tif (stristr($str, '&') === FALSE)\r\n\t\t{\r\n\t\t\t$str = strtr($str, array_flip(get_html_translation_table(HTML_ENTITIES)));\r\n\t\t}\r\n\t\t\r\n\t\treturn $str;\r\n\t}", "function convert_invalid_entities($content)\n {\n }", "function safehtml($in) {\n return htmlentities($in,ENT_COMPAT,'UTF-8');\n}", "function _htmlEntities($message) {\n return nl2br(htmlentities($message, ENT_COMPAT, $this->_character_set));\n }", "function xml_entities($value) {\n\n return strtr(\n\n $value, \n\n array(\n\n \"<\" => \"&lt;\",\n\n \">\" => \"&gt;\",\n\n '\"' => \"&quot;\",\n\n \"'\" => \"&apos;\",\n\n \"&\" => \"&amp;\",\n\n )\n\n );\n\n}", "public function convertEntities($content)\n {\n $table = array_map('utf8_encode', array_flip(\n array_diff(\n get_html_translation_table(HTML_ENTITIES), \n get_html_translation_table(HTML_SPECIALCHARS)\n )\n ));\n return preg_replace('/&#[\\d\\w]+;/', '', strtr($content, $table));\n }", "function xmlentities ( $string ) { \n\treturn str_replace ( array ('&', '<', '>', '\"'), array ('&amp;', '&lt;', '&gt;', '&#34;' ), $string ); \n}", "function html($text)\n{\n\treturn htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\n}", "public function getText() {\n\t\treturn html_entity_decode($this->text);\n\t}", "function wp_specialchars_decode( $string, $quote_style = ENT_NOQUOTES ) {\n\t$string = (string) $string;\n\n\tif ( 0 === strlen( $string ) ) {\n\t\treturn '';\n\t}\n\n\t// Don't bother if there are no entities - saves a lot of processing\n\tif ( strpos( $string, '&' ) === false ) {\n\t\treturn $string;\n\t}\n\n\t// Match the previous behaviour of _wp_specialchars() when the $quote_style is not an accepted value\n\tif ( empty( $quote_style ) ) {\n\t\t$quote_style = ENT_NOQUOTES;\n\t} elseif ( !in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) {\n\t\t$quote_style = ENT_QUOTES;\n\t}\n\n\t// More complete than get_html_translation_table( HTML_SPECIALCHARS )\n\t$single = array( '&#039;' => '\\'', '&#x27;' => '\\'' );\n\t$single_preg = array( '/&#0*39;/' => '&#039;', '/&#x0*27;/i' => '&#x27;' );\n\t$double = array( '&quot;' => '\"', '&#034;' => '\"', '&#x22;' => '\"' );\n\t$double_preg = array( '/&#0*34;/' => '&#034;', '/&#x0*22;/i' => '&#x22;' );\n\t$others = array( '&lt;' => '<', '&#060;' => '<', '&gt;' => '>', '&#062;' => '>', '&amp;' => '&', '&#038;' => '&', '&#x26;' => '&' );\n\t$others_preg = array( '/&#0*60;/' => '&#060;', '/&#0*62;/' => '&#062;', '/&#0*38;/' => '&#038;', '/&#x0*26;/i' => '&#x26;' );\n\n\tif ( $quote_style === ENT_QUOTES ) {\n\t\t$translation = array_merge( $single, $double, $others );\n\t\t$translation_preg = array_merge( $single_preg, $double_preg, $others_preg );\n\t} elseif ( $quote_style === ENT_COMPAT || $quote_style === 'double' ) {\n\t\t$translation = array_merge( $double, $others );\n\t\t$translation_preg = array_merge( $double_preg, $others_preg );\n\t} elseif ( $quote_style === 'single' ) {\n\t\t$translation = array_merge( $single, $others );\n\t\t$translation_preg = array_merge( $single_preg, $others_preg );\n\t} elseif ( $quote_style === ENT_NOQUOTES ) {\n\t\t$translation = $others;\n\t\t$translation_preg = $others_preg;\n\t}\n\n\t// Remove zero padding on numeric entities\n\t$string = preg_replace( array_keys( $translation_preg ), array_values( $translation_preg ), $string );\n\n\t// Replace characters according to translation table\n\treturn strtr( $string, $translation );\n}", "function xmlentities($string)\n{\n return str_replace ( array ( '&', '\"', \"'\", '<', '>' ), array ( '&amp;' , '&quot;', '&apos;' , '&lt;' , '&gt;' ), $string );\n}", "function decode_entities($text)\n {\n $text = html_entity_decode($text, ENT_QUOTES, 'ISO-8859-1'); //UTF-8 does not work!\n $text = preg_replace('/&#(\\d+);/me', 'chr($1)', $text); //decimal notation\n $text = preg_replace('/&#x([a-f0-9]+);/mei', 'chr(0x$1)', $text); //hex notation\n $text = urldecode($text);\n return $text;\n }", "function convertHTML($strInput) //Convert to html special code\n{\n\t//$strInput = htmlspecialchars($strInput, ENT_QUOTES);\n\t$strInput = str_replace('\"', '&quot;', $strInput);\n\t$strInput = str_replace(\"'\", \"&#039;\", $strInput);\n\treturn $strInput;\n}", "function xmlEntities($str)\n{\n $xml = array('&#34;','&#38;','&#38;','&#60;','&#62;','&#160;','&#161;','&#162;','&#163;','&#164;','&#165;','&#166;','&#167;','&#168;','&#169;','&#170;','&#171;','&#172;','&#173;','&#174;','&#175;','&#176;','&#177;','&#178;','&#179;','&#180;','&#181;','&#182;','&#183;','&#184;','&#185;','&#186;','&#187;','&#188;','&#189;','&#190;','&#191;','&#192;','&#193;','&#194;','&#195;','&#196;','&#197;','&#198;','&#199;','&#200;','&#201;','&#202;','&#203;','&#204;','&#205;','&#206;','&#207;','&#208;','&#209;','&#210;','&#211;','&#212;','&#213;','&#214;','&#215;','&#216;','&#217;','&#218;','&#219;','&#220;','&#221;','&#222;','&#223;','&#224;','&#225;','&#226;','&#227;','&#228;','&#229;','&#230;','&#231;','&#232;','&#233;','&#234;','&#235;','&#236;','&#237;','&#238;','&#239;','&#240;','&#241;','&#242;','&#243;','&#244;','&#245;','&#246;','&#247;','&#248;','&#249;','&#250;','&#251;','&#252;','&#253;','&#254;','&#255;');\n $html = array('&quot;','&amp;','&amp;','&lt;','&gt;','&nbsp;','&iexcl;','&cent;','&pound;','&curren;','&yen;','&brvbar;','&sect;','&uml;','&copy;','&ordf;','&laquo;','&not;','&shy;','&reg;','&macr;','&deg;','&plusmn;','&sup2;','&sup3;','&acute;','&micro;','&para;','&middot;','&cedil;','&sup1;','&ordm;','&raquo;','&frac14;','&frac12;','&frac34;','&iquest;','&Agrave;','&Aacute;','&Acirc;','&Atilde;','&Auml;','&Aring;','&AElig;','&Ccedil;','&Egrave;','&Eacute;','&Ecirc;','&Euml;','&Igrave;','&Iacute;','&Icirc;','&Iuml;','&ETH;','&Ntilde;','&Ograve;','&Oacute;','&Ocirc;','&Otilde;','&Ouml;','&times;','&Oslash;','&Ugrave;','&Uacute;','&Ucirc;','&Uuml;','&Yacute;','&THORN;','&szlig;','&agrave;','&aacute;','&acirc;','&atilde;','&auml;','&aring;','&aelig;','&ccedil;','&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;','&icirc;','&iuml;','&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;','&otilde;','&ouml;','&divide;','&oslash;','&ugrave;','&uacute;','&ucirc;','&uuml;','&yacute;','&thorn;','&yuml;');\n $str = str_replace($html,$xml,$str);\n $str = str_ireplace($html,$xml,$str);\n return $str;\n}", "function _xmlEntities($string) {\n return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');\n }", "private function _html_entity_decode($str, $charset = 'UTF-8') {\n\t\tif (stristr($str, '&') === false) return $str;\n\n\t\t// The reason we are not using html_entity_decode() by itself is because\n\t\t// while it is not technically correct to leave out the semicolon\n\t\t// at the end of an entity most browsers will still interpret the entity\n\t\t// correctly. html_entity_decode() does not convert entities without\n\t\t// semicolons, so we are left with our own little solution here. Bummer.\n\n\t\tif (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8' or version_compare(phpversion(), '5.0.0', '>='))) {\n\t\t\t$str = html_entity_decode($str, ENT_COMPAT, $charset);\n\t\t\t$str = preg_replace('~&#x(0*[0-9a-f]{2,5})~ei', 'chr(hexdec(\"\\\\1\"))', $str);\n\n\t\t\treturn preg_replace('~&#([0-9]{2,4})~e', 'chr(\\\\1)', $str);\n\t\t}\n\n\t\t// Numeric Entities\n\t\t$str = preg_replace('~&#x(0*[0-9a-f]{2,5});{0,1}~ei', 'chr(hexdec(\"\\\\1\"))', $str);\n\t\t$str = preg_replace('~&#([0-9]{2,4});{0,1}~e', 'chr(\\\\1)', $str);\n\n\t\t// Literal Entities - Slightly slow so we do another check\n\t\tif (stristr($str, '&') === false) {\n\t\t\t$str = strtr($str, array_flip(get_html_translation_table(HTML_ENTITIES)));\n\t\t}\n\n\t\treturn $str;\n\t}", "private function dohtmlentities($string) {\r\n\r\n return htmlentities($string, ENT_QUOTES, \"UTF-8\");\r\n\r\n }", "function e($string){\n\n return htmlentities($string,'UTF-8', ENT_QUOTES,false);\n\n\n\n\n\n}", "public function escapeHtml($html) {\n\t\t//[roman] da es die schöne double_encode Sache bei htmlentities erst ab der PHP 5.2.3 gibt hier ein fieser Mist...\n\t\tif (version_compare(PHP_VERSION, '5.2.3', '>=')) {\n\t\t\t$html= htmlentities($html, ENT_QUOTES, 'UTF-8', FALSE);\n\t\t} else {\n\t\t\t$html= html_entity_decode($html, ENT_QUOTES, 'UTF-8');\n\t\t\t$html= htmlentities($html, ENT_QUOTES, 'UTF-8');\n\t\t}\n\t\treturn $html;\n\t}", "function entify($string) { \n /* used by /samuel/cv/, should leave tags as is and only convert chars */\n # echo \"<!-- $string -->\\n\";\n $from = array('/&/',\n '/å/', '/ä/', '/ö/',\n '/Å/', '/Ä/', '/Ö/',\n );\n $to = array('&amp;',\n '&aring;', '&auml;', '&ouml;',\n '&Aring;', '&Auml;', '&Ouml',\n );\n # echo \"<!-- $string -->\\n\";\n return preg_replace($from, $to, $string);\n }", "function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {\n if ( $double_encode ) {\n $string = @htmlspecialchars( $string, $quote_style, $charset );\n } else {\n // Decode &amp; into &\n $string = wp_specialchars_decode( $string, $quote_style );\n\n // Guarantee every &entity; is valid or re-encode the &\n $string = kses_normalize_entities( $string );\n\n // Now re-encode everything except &entity;\n $string = preg_split( '/(&#?x?[0-9a-z]+;)/i', $string, -1, PREG_SPLIT_DELIM_CAPTURE );\n\n for ( $i = 0; $i < count( $string ); $i += 2 )\n $string[$i ] = @htmlspecialchars( $string[$i], $quote_style, 'UTF-8' );\n\n $string = implode( '', $string );\n }\n\n return $string;\n\n}", "function makeAllEntities($str, $useNamedEntities = 0, $encoding = \"\") {\n if (is_array($str)) {\n foreach ($str as $s)\n $arrOutput[] = makeAllEntities($s,$encoding);\n return $arrOutput;\n }\n else if ($str !== \"\") {\n $str = makeUTF8($str,$encoding);\n if ($useNamedEntities)\n $str = mb_convert_encoding($str,\"HTML-ENTITIES\",\"UTF-8\");\n $str = makeTagEntities($str,$useNamedEntities);\n // Fix backslashes so they don't screw up following mb_ereg_replace\n // Single quotes are fixed by makeTagEntities() above\n $str = mb_ereg_replace('\\\\\\\\',\"&#92;\", $str);\n mb_regex_encoding(\"UTF-8\");\n $str = mb_ereg_replace(\"(?>(&(?:[a-z]{0,4}\\w{2,3};|#\\d{2,5};)))|(\\S+?)\",\n \"'\\\\1'.mb_encode_numericentity('\\\\2',array(0x0,0x2FFFF,0,0xFFFF),'UTF-8')\", $str, \"ime\");\n $str = correctIllegalEntities($str);\n return $str;\n }\n }", "function htmlSpecialChars( $text )\n\t{\n\t\t//return preg_replace(\"/&amp;/i\", '&', htmlspecialchars($text, ENT_QUOTES));\n\t\treturn preg_replace(array(\"/&amp;/i\", \"/&nbsp;/i\"), array('&', '&amp;nbsp;'), htmlspecialchars($text, ENT_QUOTES));\n\t}", "function makeAllEntities($str, $useNamedEntities = 0, $encoding = \"\") {\n if (is_array($str)) {\n foreach ($str as $s)\n $arrOutput[] = makeAllEntities($s,$encoding);\n return $arrOutput;\n }\n else if (!empty($str)) {\n $str = makeUTF8($str,$encoding);\n if ($useNamedEntities)\n $str = mb_convert_encoding($str,\"HTML-ENTITIES\",\"UTF-8\");\n $str = makeTagEntities($str,$useNamedEntities);\n // Fix backslashes so they don't screw up following mb_ereg_replace\n // Single quotes are fixed by makeTagEntities() above\n $str = mb_ereg_replace('\\\\\\\\',\"&#92;\", $str);\n mb_regex_encoding(\"UTF-8\");\n $str = mb_ereg_replace(\"(?>(&(?:[a-z]{0,4}\\w{2,3};|#\\d{2,5};)))|(\\S+?)\",\n \"'\\\\1'.mb_encode_numericentity('\\\\2',array(0x0,0x2FFFF,0,0xFFFF),'UTF-8')\", $str, \"ime\");\n $str = correctIllegalEntities($str);\n return $str;\n }\n }", "function unformatText ($text) {\n\treturn html_entity_decode (strip_tags ($text), ENT_COMPAT, 'UTF-8');\n}", "public function removeHTML($text){\n $text = html_entity_decode($text);\n\n\n // Alle Tags entfernen\n $text = strip_tags($text);\n\n $text = str_replace(\"&lt;br&gt;\", \"\", $text);\n $text = str_replace(\"&amp;lt;br&amp;gt;\", \"\", $text);\n\n\n return $text;\n }", "function wp_kses_normalize_entities2($matches)\n {\n }", "public static function txt2html($txt) {\n\n\t//Kills double spaces and spaces inside tags.\n\t// while( !( strpos($txt,' ') === FALSE ) ) $txt = str_replace(' ',' ',$txt);\n if( !( strpos($txt,' ') === FALSE ) ) $txt = str_replace(' ',' ',$txt);\n\n\t$txt = str_replace(' >','>',$txt);\n\t$txt = str_replace('< ','<',$txt);\n\n\t//Transforms accents in html entities.\n\t$txt = utf8_decode($txt);\n\t$txt = htmlentities($txt);\n\n\t//We need some HTML entities back!\n\t$txt = str_replace('&quot;','\"',$txt);\n\t$txt = str_replace('&lt;','<',$txt);\n\t$txt = str_replace('&gt;','>',$txt);\n\t$txt = str_replace('&amp;','&',$txt);\n\t\n\t//Ajdusts links - anything starting with HTTP opens in a new window\n\t$txt = WA_String::stri_replace(\"<a href=\\\"http://\",\"<a target=\\\"_blank\\\" href=\\\"http://\",$txt);\n\t$txt = WA_String::stri_replace(\"<a href=http://\",\"<a target=\\\"_blank\\\" href=http://\",$txt);\n\n\t//Basic formatting\n\t$eol = ( strpos($txt,\"\\r\") === FALSE ) ? \"\\n\" : \"\\r\\n\";\n\t$html = '<p>'.str_replace(\"$eol$eol\",\"</p><p>\",$txt).'</p>';\n $html = str_replace(\"$eol\",\"<br />\\n\",$html);\n\t$html = str_replace(\"</p>\",\"</p>\\n\\n\",$html);\n\t$html = str_replace(\"<p></p>\",\"<p>&nbsp;</p>\",$html);\n\n\t//Wipes <br> after block tags (for when the user includes some html in the text).\n\t$wipebr = Array(\"table\",\"tr\",\"td\",\"blockquote\",\"ul\",\"ol\",\"li\");\n\n\tfor($x = 0; $x < count($wipebr); $x++) {\n \t $tag = $wipebr[$x];\n \t $html = WA_String::stri_replace(\"<$tag><br />\",\"<$tag>\",$html);\n \t $html = WA_String::stri_replace(\"</$tag><br />\",\"</$tag>\",$html);\n\t}\n\n\treturn $html;\n }", "function atk_htmlentities($string, $quote_style=ENT_COMPAT, $charset=null)\n{\n\treturn atkString::htmlentities($string, $quote_style, $charset);\n}", "public static function entities($value) {\n\t\treturn htmlentities($value, ENT_QUOTES, Config::get('application.encoding'), false);\n\t}", "function utf8ToHtmlEntities($string) { \n\t /* avoid using 0xA0 (\\240) in ereg ranges. RH73 does not like that */ \n\t if (! ereg(\"[\\200-\\237]\", $string) and ! ereg(\"[\\241-\\377]\", $string)) { \n\t return $string; \n\t\t}\n\t // decode three byte unicode characters \n\t $string = preg_replace(\"/([\\340-\\357])([\\200-\\277])([\\200-\\277])/e\", \n\t \"'&#'.((ord('\\\\1')-224)*4096 + (ord('\\\\2')-128)*64 + (ord('\\\\3')-128)).';'\", \n\t $string); \n\n\t // decode two byte unicode characters \n\t $string = preg_replace(\"/([\\300-\\337])([\\200-\\277])/e\", \n\t \"'&#'.((ord('\\\\1')-192)*64+(ord('\\\\2')-128)).';'\", \n\t $string); \n\n\t return $string; \n\t}", "function escape($html) { return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\"); }", "public static function htmlentities($myHTML) {\n\t\t$translation_table=get_html_translation_table (HTML_ENTITIES,ENT_QUOTES);\n\t\t$translation_table[chr(38)] = '&';\n\t\treturn preg_replace(\"/&(?![A-Za-z]{0,4}\\w{2,3};|#[0-9]{2,3};)/\",\"&amp;\" , strtr($myHTML, $translation_table));\n\t}", "function clean($string) {\n return html_entity_decode($string);\n \n}", "abstract public function convert_to_html();", "public static function entities($value)\n {\n return htmlentities($value, ENT_QUOTES, 'UTF-8', false);\n }", "function text_tidy($txt = \"\") {\n \n \t$trans = get_html_translation_table(HTML_ENTITIES);\n \t$trans = array_flip($trans);\n \t\n \t$txt = strtr( $txt, $trans );\n \t\n \t$txt = preg_replace( \"/\\s{2}/\" , \"&nbsp; \" , $txt );\n \t$txt = preg_replace( \"/\\r/\" , \"\\n\" , $txt );\n \t$txt = preg_replace( \"/\\t/\" , \"&nbsp;&nbsp;\" , $txt );\n \t//$txt = preg_replace( \"/\\\\n/\" , \"&#92;n\" , $txt );\n \t\n \treturn $txt;\n }", "function atk_html_entity_decode($string, $quote_style=ENT_COMPAT, $charset=null)\n{\n\treturn atkString::html_entity_decode($string, $quote_style, $charset);\n}", "public function htmlspecial($text) {\n // First, use the php function to convert quotes to html entities:\n // This converts single quote to &#039;\n $tooltip = htmlspecialchars($text,ENT_QUOTES);\n // since the result is parsed again with xml_parser, and xml_parser\n // autoconverts (apparently) &#039; back to single quote,\n // and then generates a parse error if this single quote occurs\n // within an atribute value expresses as <x attr='y'> (i.e. y has a\n // single quote).\n // Because of this we change &#039; to &#8217; -- which xml_parser\n // apparently leaves unchanged, and generates no error.\n $tooltip = preg_replace('/&#039;/','&#8217;',$tooltip);\n return $tooltip;\n}", "function decode_entities( $matches ) {\n\t\t\tif ( function_exists( 'mb_convert_encoding' ) ) {\n\t\t\t\t$content = mb_convert_encoding( $matches[1], 'UTF-8', 'HTML-ENTITIES' );\n\t\t\t} else {\n\t\t\t\t$content = htmlspecialchars_decode( html_entity_decode( html_entity_decode( $matches[1], ENT_QUOTES | ENT_XML1, 'UTF-8' ) ) );\n\t\t\t}\n\t\t\treturn $content;\n\t\t}", "function txt_htmlspecialchars($t=\"\")\n\t{\n\t\t// Use forward look up to only convert & not &#123;\n\t\t$t = preg_replace(\"/&(?!#[0-9]+;)/s\", '&amp;', $t );\n\t\t$t = str_replace( \"<\", \"&lt;\" , $t );\n\t\t$t = str_replace( \">\", \"&gt;\" , $t );\n\t\t$t = str_replace( '\"', \"&quot;\", $t );\n\t\t$t = str_replace( \"'\", '&#039;', $t );\n\t\t\n\t\treturn $t; // A nice cup of?\n\t}", "function AbbcH2T($text)\r\n{\r\n\t// This function is taken from WMS/common.lib/h2t()\r\n\r\n\t$text = str_replace('&lt;', '<', $text);\r\n\t$text = str_replace('&gt;', '>', $text);\r\n\t$text = str_replace('&quot;', '\"', $text);\r\n\t$text = str_replace('&nbsp;', ' ', $text);\r\n\t$text = str_replace('&amp;', '&', $text);\r\n\treturn $text;\r\n}", "function wp_kses_decode_entities($content)\n {\n }", "function escp($text) {\r\n return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\r\n}", "protected function unhtmlentities($string)\n {\n // First let PHP do its job with UTF-8 and stuff\n $string = html_entity_decode($string, ENT_QUOTES, 'UTF-8');\n // Now shooting at the rest\n $string = preg_replace\n // Illegal multibyte, decimal, hexa entities\n (array('!&#(x)?([a-f0-9]{3,4});!i', '!&#(\\d+);!me', '!&#x([a-f0-9]+);!mei')\n ,array('', 'chr(\\1)', 'chr(0x\\1)')\n ,$string\n );\n // What's left, will be transferred on return\n $trans_tbl = array_merge\n (array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES))\n ,array('&gt;' => '>', '&lt;' => '<', '&amp;' => '&', '&quot;' => '\"', '&apos;' => \"'\")\n );\n return strtr($string, $trans_tbl);\n }", "function html($text) {\n\t\t// Sanitizing html text\n\t\t$text = Sanitize::html($text);\n\t\t// Adding <br />\n\t\t$text = nl2br($text);\n\t\t// Transform http:// into links\n\t\t$text = $this->convertLinks($text);\n\n\t\treturn $text;\n\t}", "function makeTagEntities($str, $useNamedEntities = 1) {\n // Note that we should use &apos; for the single quote, but IE doesn't like it\n $arrReplace = $useNamedEntities ? array('&#39;','&quot;','&lt;','&gt;') : array('&#39;','&#34;','&#60;','&#62;');\n return str_replace(array(\"'\",'\"','<','>'), $arrReplace, $str);\n }", "function makeTagEntities($str, $useNamedEntities = 1) {\n // Note that we should use &apos; for the single quote, but IE doesn't like it\n $arrReplace = $useNamedEntities ? array('&#39;','&quot;','&lt;','&gt;') : array('&#39;','&#34;','&#60;','&#62;');\n return str_replace(array(\"'\",'\"','<','>'), $arrReplace, $str);\n }", "function txt_bbcode($var) {\n\n $txt = utf8_encode(html_entity_decode($var));\n\n return $txt;\n}", "function s2_htmlencode($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "function wp_specialchars_decode($text, $quote_style = \\ENT_NOQUOTES)\n {\n }", "function h($text){\n\treturn htmlspecialchars($text, ENT_QUOTES, Yii::app()->charset);\n}", "protected function convertiTexte($texte)\n\t{\n\t\treturn htmlentities($texte, ENT_QUOTES, \"UTF-8\");\n\t}", "function prepare2eval($evalStr)\n// ****************************\n{\n return html_entity_decode($evalStr);\n}", "function wp_kses_normalize_entities3($matches)\n {\n }", "protected static function convertHtmlToText($content)\n {\n // Prevent styles to be included\n $content = preg_replace('/<style.*>([\\s\\S]*)<\\/style>/i', '', $content);\n // Convert html entities to strip them later on\n $content = html_entity_decode($content);\n // Convert new lines for relevant tags\n $content = str_ireplace(['<br />', '<br/>', '<br>', '<table>', '</table>'], \"\\r\\n\", $content);\n // Avoid lots of spaces\n $content = preg_replace('/[\\r\\n]+/', ' ', $content);\n // Replace links to keep them accessible\n $content = preg_replace('/<a[\\s\\S]*href=\"(.*?)\"[\\s\\S]*>(.*)<\\/a>/i', '$2 ($1)', $content);\n // Remove html tags\n $content = strip_tags($content);\n // Trim content so that it's nice\n $content = trim($content);\n return $content;\n }", "public static function htmlToText(string $html) : string\n {\n return \\html_entity_decode(\\strip_tags($html), \\ENT_QUOTES | \\ENT_HTML5, 'UTF-8');\n }", "function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}", "function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}", "function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}", "private function parseValue($value) {\n return htmlspecialchars(html_entity_decode($value));\n }", "function mysql_entities_fix_string($string){return htmlentities(mysql_fix_string($string));}", "public function getTextEntity();", "function string_html_entities( $p_string ) {\r\n\treturn htmlentities( $p_string, ENT_COMPAT, config_get('charset') );\r\n}", "function escape($html) {\n return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\");\n}", "public function entityDecode($str, $charset=null) {\n if(strpos($str, '&') === false)\n return $str;\n \n static $_entities;\n \n if(!isset($charset))\n $charset = $this->charset;\n \n $flag = ENT_COMPAT | ENT_HTML5;\n \n if(!isset($_entities))\n $_entities = array_map('strtolower', get_html_translation_table(HTML_ENTITIES, $flag, $charset));\n \n do {\n $str_compare = $str;\n \n // Decode standard entities, avoiding false positives\n if(preg_match_all('/&[a-z]{2,}(?![a-z;])/i', $str, $matches)) {\n $replace = [];\n $matches = array_unique(array_map('strtolower', $matches[0]));\n \n foreach($matches as &$match) {\n if(($char = array_search($match.';', $_entities, true)) !== false) {\n $replace[$match] = $char;\n }\n }\n \n $str = str_replace(array_keys($replace), array_values($replace), $str);\n }\n \n // Decode numeric & UTF16 two byte entities\n $str = html_entity_decode(\n preg_replace('/(&#(?:x0*[0-9a-f]{2,5}(?![0-9a-f;])|(?:0*\\d{2,4}(?![0-9;]))))/iS', '$1;', $str),\n $flag,\n $charset\n );\n }\n while($str_compare !== $str);\n \n return $str;\n }", "function tep_decode_specialchars($string){\n $string=str_replace('&gt;', '>', $string);\n $string=str_replace('&lt;', '<', $string);\n $string=str_replace('&#039;', \"'\", $string);\n $string=str_replace('&quot;', \"\\\"\", $string);\n $string=str_replace('&amp;', '&', $string);\n\n return $string;\n }", "function escape_html($string) {\n $text = htmlspecialchars($string);\n // $text = strip_tags($string);\n\n return $text;\n}", "function he($str) {\n\t\treturn htmlentities($str, ENT_QUOTES, \"UTF-8\");\n\t}", "function txt_UNhtmlspecialchars($t=\"\")\n\t{\n\t\t$t = str_replace( \"&amp;\" , \"&\", $t );\n\t\t$t = str_replace( \"&lt;\" , \"<\", $t );\n\t\t$t = str_replace( \"&gt;\" , \">\", $t );\n\t\t$t = str_replace( \"&quot;\", '\"', $t );\n\t\t$t = str_replace( \"&#039;\", \"'\", $t );\n\t\t\n\t\treturn $t;\n\t}", "public function htmlspecial($text) {\n // This converts single quote to &#039;\n $tooltip = htmlspecialchars($text,ENT_QUOTES);\n // since the result is parsed again with xml_parser, and xml_parser\n // autoconverts (apparently) &#039; back to single quote,\n // and then generates a parse error if this single quote occurs\n // within an atribute value expresses as <x attr='y'> (i.e. y has a\n // single quote).\n // Because of this we change &#039; to &#8217; -- which xml_parser\n // apparently leaves unchanged, and generates no error.\n $tooltip = preg_replace('/&#039;/','&#8217;',$tooltip);\n return $tooltip;\n}", "function htmlButTags($str) {\n\t$caracteres = get_html_translation_table(HTML_ENTITIES);\n\t// Find out the \"tags\" entities\n\t$remover = get_html_translation_table(HTML_SPECIALCHARS);\n\t// Spit out the tags entities from the original table\n\t$caracteres = array_diff($caracteres, $remover);\n\t// Translate the string....\n\t$str = strtr($str, $caracteres);\n\t\n\t// now amps\n\t$str = preg_replace(\"/&(?![A-Za-z]{0,4}\\w{2,3};|#[0-9]{2,3};)/\",\"&amp;\" , $str);\n\t\n\treturn $str;\n}", "function h($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8');\n}", "function mysql_entities_fix_string($data)\n {\n // Fix &entity\\n;\n $data = str_replace(array('&amp;','&lt;','&gt;'), array('&amp;amp;','&amp;lt;','&amp;gt;'), $data);\n $data = preg_replace('/(&#*\\w+)[\\x00-\\x20]+;/u', '$1;', $data);\n $data = preg_replace('/(&#x*[0-9A-F]+);*/iu', '$1;', $data);\n $data = html_entity_decode($data, ENT_COMPAT, 'UTF-8');\n\n // Remove any attribute starting with \"on\" or xmlns\n $data = preg_replace('#(<[^>]+?[\\x00-\\x20\"\\'])(?:on|xmlns)[^>]*+>#iu', '$1>', $data);\n\n // Remove javascript: and vbscript: protocols\n $data = preg_replace('#([a-z]*)[\\x00-\\x20]*=[\\x00-\\x20]*([`\\'\"]*)[\\x00-\\x20]*j[\\x00-\\x20]*a[\\x00-\\x20]*v[\\x00-\\x20]*a[\\x00-\\x20]*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:#iu', '$1=$2nojavascript...', $data);\n $data = preg_replace('#([a-z]*)[\\x00-\\x20]*=([\\'\"]*)[\\x00-\\x20]*v[\\x00-\\x20]*b[\\x00-\\x20]*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:#iu', '$1=$2novbscript...', $data);\n $data = preg_replace('#([a-z]*)[\\x00-\\x20]*=([\\'\"]*)[\\x00-\\x20]*-moz-binding[\\x00-\\x20]*:#u', '$1=$2nomozbinding...', $data);\n\n // Only works in IE: <span style=\"width: expression(alert('Ping!'));\"></span>\n $data = preg_replace('#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`\\'\"]*.*?expression[\\x00-\\x20]*\\([^>]*+>#i', '$1>', $data);\n $data = preg_replace('#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`\\'\"]*.*?behaviour[\\x00-\\x20]*\\([^>]*+>#i', '$1>', $data);\n $data = preg_replace('#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`\\'\"]*.*?s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:*[^>]*+>#iu', '$1>', $data);\n\n // Remove namespaced elements (we do not need them)\n $data = preg_replace('#</*\\w+:\\w[^>]*+>#i', '', $data);\n\n do\n {\n // Remove really unwanted tags\n $old_data = $data;\n $data = preg_replace('#</*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*+>#i', '', $data);\n }\n while ($old_data !== $data);\n $data = trim($data);\n $data = stripslashes($data);\n $data=htmlspecialchars($data);\n return $data;\n }", "public static function entityDecode($str, $charset = null)\n {\n if (strpos($str, '&') === false) {\n return $str;\n }\n\n static $entities;\n\n isset($charset) || $charset = self::$charset;\n $flag = version_compare(phpversion(), '5.4.0', '=')\n ? ENT_COMPAT | ENT_HTML5\n : ENT_COMPAT;\n\n do {\n $str_compare = $str;\n\n if (preg_match_all('/&[a-z]{2,}(?![a-z;])/i', $str, $matches)) {\n if (! isset($entities)) {\n $entities = array_map(\n 'strtolower',\n version_compare(phpversion(), '5.4.0', '=')\n ? get_html_translation_table(HTML_ENTITIES, $flag, $charset)\n : get_html_translation_table(HTML_ENTITIES, $flag)\n );\n\n if ($flag === ENT_COMPAT) {\n $entities[':'] = '&colon;';\n $entities['('] = '&lpar;';\n $entities[')'] = '&rpar;';\n $entities[\"\\n\"] = '&newline;';\n $entities[\"\\t\"] = '&tab;';\n }\n }\n\n $replace = [];\n $matches = array_unique(array_map('strtolower', $matches[0]));\n foreach ($matches as &$match) {\n if (($char = array_search($match.';', $entities, true)) !== false) {\n $replace[$match] = $char;\n }\n }\n\n $str = str_ireplace(array_keys($replace), array_values($replace), $str);\n }\n\n $str = html_entity_decode(\n preg_replace('/(&#(?:x0*[0-9a-f]{2,5}(?![0-9a-f;])|(?:0*\\d{2,4}(?![0-9;]))))/iS', '$1;', $str),\n $flag,\n $charset\n );\n } while ($str_compare !== $str);\n\n return $str;\n }", "protected function getHtmlEntitiesDecodeFunction()\n {\n $name = 'html_decode';\n\n return new TwigFunction($name, function ($text) {\n return strip_tags(html_entity_decode($text));\n });\n }", "function encode_desc(&$data)\n{\n $to_entities = get_html_translation_table(HTML_ENTITIES);\n\n $from_entities = array_flip($to_entities);\n\n $data = strtr($data,$from_entities);\n $data = strtr($data,$to_entities);\n\n return $data;\n}", "function decode_entities($text, $exclude = array()) {\n static $table;\n // We store named entities in a table for quick processing.\n if (!isset($table)) {\n // Get all named HTML entities.\n $table = array_flip(get_html_translation_table(HTML_ENTITIES));\n // PHP gives us ISO-8859-1 data, we need UTF-8.\n $table = array_map('utf8_encode', $table);\n // Add apostrophe (XML)\n $table['&apos;'] = \"'\";\n }\n $newtable = array_diff($table, $exclude);\n\n // Use a regexp to select all entities in one pass, to avoid decoding\n // double-escaped entities twice.\n return preg_replace('/&(#x?)?([A-Za-z0-9]+);/e', '_decode_entities(\"$1\", \"$2\", \"$0\", $newtable, $exclude)', $text);\n}", "function e($string)\n{\n return htmlentities($string, null, 'UTF-8');\n}", "function _transxml($text) {\n \n //first replace allready translated text to original symbols\n\t $preout = str_replace(\"&amp;\",\"&\",$text);\n\t $preout1 = str_replace(\"&lt;\",\"<\",$preout);\n\t $preout2 = str_replace(\"&gt;\",\">\",$preout1);\n\t $preout3 = str_replace(\"&apos;\",\"'\",$preout2); \t \t \n\t $preout4 = str_replace(\"&quot\",\"\\\"\",$preout3);\n\t \n\t //next set original symbols to its equal symbols\t \n\t $out4 = str_replace(\"\\\"\",\"&quot;\",$preout4);\n\t $out3 = str_replace(\"'\",\"&apos;\",$preout4);\n\t $out2 = str_replace(\">\",\"&gt;\",$preout4);\n\t $out1 = str_replace(\"<\",\"&lt;\",$preout4);\n\t $out = str_replace(\"&\",\"&amp;\",$preout4);\t \t \t \t \n\t \n\t return ($out);\n }", "function h($string, $quote_style = ENT_COMPAT, $charset = 'ISO-8859-1'){\n return htmlentities($string, $quote_style, $charset);\n }", "function wp_kses_js_entities($content)\n {\n }", "protected function convertChars2Entities($terms)\n {\n # TODO: NEEDS FUNCTIONALITY!\n\n return $terms;\n }" ]
[ "0.73409647", "0.696678", "0.6930696", "0.68446976", "0.6817168", "0.68137956", "0.67492324", "0.67257345", "0.66874295", "0.6684183", "0.6637746", "0.65723735", "0.6524394", "0.649234", "0.6491298", "0.6488665", "0.6455984", "0.64509594", "0.64386916", "0.6438417", "0.64123166", "0.6406703", "0.64018553", "0.63927007", "0.6392117", "0.6391999", "0.63835377", "0.6358313", "0.6340528", "0.6330392", "0.63271105", "0.63252", "0.63199055", "0.6318075", "0.63075995", "0.6292811", "0.6268431", "0.62480015", "0.6242964", "0.62376654", "0.62351227", "0.62333477", "0.6229126", "0.6224927", "0.6197067", "0.61969787", "0.6188073", "0.6186449", "0.61805254", "0.61591125", "0.614694", "0.6138408", "0.61261594", "0.6125471", "0.61157864", "0.6113016", "0.61088586", "0.6094839", "0.60944515", "0.60858214", "0.60761887", "0.6063261", "0.60624033", "0.6061357", "0.6061357", "0.606124", "0.60589534", "0.60550696", "0.6051317", "0.60476863", "0.60435593", "0.6024371", "0.60188264", "0.601193", "0.6011409", "0.6011409", "0.6009387", "0.6003645", "0.5999523", "0.5989913", "0.59891546", "0.598257", "0.598033", "0.5976515", "0.59723896", "0.5971928", "0.59670496", "0.59597224", "0.5946346", "0.594627", "0.5940449", "0.5939349", "0.593498", "0.5927679", "0.59274143", "0.5924485", "0.59163475", "0.58824015", "0.58811843", "0.5875121" ]
0.68901026
3
Wrapping mapping function (_W) Mapping function which understands tags better. To apply styles or links certain elements within an i18n phrase, use brackets to delineate tags to add to the phrase, as follows: HTML::wrap(__('This is [0:bold text] and this is [1:italic].'), '[]', '[italic]') = "This is bold text and this is italic." Supplying no positional information will replace values in order, e.g. HTML::wrap(__('This is [bold text] and this is [italic].'), '[]', '[italic]') = "This is bold text and this is italic." Positional indicators are delimited with a number and a colon after the opening bracket. It also handles nested brackets, however, the inner brackets is indexed before the outer brackets, e.g. HTML::wrap('[[a][b]]','[]','[]','[]') = "ab";
public static function wrap(string $phrase): string { $args = func_get_args(); array_shift($args); if (count($args) === 1 && is_array($args[0])) { $args = $args[0]; } $skip_s = []; $skip_r = []; $match = false; $global_match_index = 0; while (preg_match('/\[([0-9]+:)?([^\[\]]*)]/', $phrase, $match, PREG_OFFSET_CAPTURE)) { $match_len = strlen($match[0][0]); $match_off = $match[0][1]; $match_string = $match[2][0]; if ($match[1][1] < 0) { $index = $global_match_index; } else { $index = intval($match[1][0]); } $global_match_index++; $replace_value = $args[$index] ?? '[]'; [$left, $right] = explode('[]', $replace_value, 2) + [null, '', ]; if ($left === null) { $replace_value = '(*' . count($skip_s) . '*)'; $skip_s[] = $replace_value; $skip_r[] = $match[0][0]; } else { $replace_value = $left . $match_string . $right; } $phrase = substr($phrase, 0, $match_off) . $replace_value . substr($phrase, $match_off + $match_len); } if (count($skip_s) === 0) { return $phrase; } return str_replace($skip_s, $skip_r, $phrase); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderMeWithTagStyle($toRender, $toPattern, $repla) {\n //------------Don't forget to delimit-----w+\n $pattern = '/' . $toPattern . '(\\w+)/';\n //$pattern = '/[*' . $toPattern . '(.+?)+$]/';\n //$pattern = '/[*' . $toPattern . '(.+?)$]/';\n //preg_match($pattern, $toRender, $matches);\n $matches = array();\n preg_match_all($pattern, $toRender, $matches);\n //---------------\n $temp = '';\n foreach ($matches as $match) {\n //echo $match;\n //$regex = '~(:\\w+)~';\n if ($temp != $match[0]) {\n $toRender = str_replace($match[0], \"<strong style='box-shadow:2px 2px 2px #cdcdcd;border-top:1px solid gray;border-left:1px solid gray;color:blue;text-shadow:2px 2px 2px #cdcdcd;background:transparent;'>\" . $match[0] . \"</strong>\", $toRender);\n } else {\n continue;\n }\n $temp = $match[0];\n }\n //$toRender=str_replace($repla,\"<span style='box-shadow:2px 2px 2px #cdcdcd;border-top:1px solid gray;border-left:1px solid gray;color:blue;text-shadow:2px 2px 2px #cdcdcd;background:transparent;'>\".$repla.\"</span>\",$toRender);\n\n return $toRender;\n}", "function cs_span($texte, $attr='') { return \"<span $attr>$texte</span>\"; }", "function wp_replace_in_html_tags($haystack, $replace_pairs)\n {\n }", "function tagins($stuffing)\r\n{\r\n\treturn \"<\".$stuffing.\">\";\r\n}", "private function processWrapper($text, $formattingMarkup, $nodeTag, $markupLength = 1)\n {\n $formattedTextBegin = $this->lookAhead($text, $formattingMarkup);\n $beforeFormattedText = mb_substr($text, 0, $formattedTextBegin);\n $formattedTextEnd = $this->lookAhead(mb_substr($text, $formattedTextBegin + $markupLength), $formattingMarkup);\n $afterFormattedText = mb_substr(mb_substr($text, $formattedTextBegin + $markupLength), $formattedTextEnd + $markupLength);\n $formattedText = mb_substr($text, $formattedTextBegin + $markupLength, $formattedTextEnd);\n\n if ($beforeFormattedText !== '') {\n $this->text($beforeFormattedText);\n }\n\n $this->wrapInNode($nodeTag, function () use ($formattedText) {\n $this->processInline($formattedText);\n });\n\n if ($afterFormattedText !== '') {\n $this->text($afterFormattedText);\n }\n\n return '';\n }", "function tagins($stuffing) {\n return \"<\".$stuffing.\">\";\n }", "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}", "function htmlwrap($str, $width = 60, $break = \"\\n\", $nobreak = \"\") {\n\n\t // Split HTML content into an array delimited by < and >\n\t // The flags save the delimeters and remove empty variables\n\t $content = preg_split(\"/([<>])/\", $str, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\n\t // Transform protected element lists into arrays\n\t $nobreak = explode(\" \", strtolower($nobreak));\n\n\t // Variable setup\n\t $intag = false;\n\t $innbk = array();\n\t $drain = \"\";\n\n\t // List of characters it is \"safe\" to insert line-breaks at\n\t // It is not necessary to add < and > as they are automatically implied\n\t $lbrks = \"/?!%)-}]\\\\\\\"':;&\";\n\n\t // Is $str a UTF8 string?\n//\t $utf8 = (preg_match(\"/^([\\x09\\x0A\\x0D\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF]|\\xF0[\\x90-\\xBF][\\x80-\\xBF]{2}|[\\xF1-\\xF3][\\x80-\\xBF]{3}|\\xF4[\\x80-\\x8F][\\x80-\\xBF]{2})*$/\", $str)) ? \"u\" : \"\";\n\t // original utf8 problems seems to cause problems with very long text (forumposts)\n\t // replaced by a little simpler function call by fxstein 8-13-08\n\t $utf8 = (mb_detect_encoding($str . 'a' , 'UTF-8') == 'UTF-8') ? \"u\" : \"\";\n\n\t while (list(, $value) = each($content)) {\n\t switch ($value) {\n\n\t // If a < is encountered, set the \"in-tag\" flag\n\t case \"<\": $intag = true; break;\n\n\t // If a > is encountered, remove the flag\n\t case \">\": $intag = false; break;\n\n\t default:\n\n\t // If we are currently within a tag...\n\t if ($intag) {\n\n\t // Create a lowercase copy of this tag's contents\n\t $lvalue = strtolower($value);\n\n\t // If the first character is not a / then this is an opening tag\n\t if ($lvalue{0} != \"/\") {\n\n\t // Collect the tag name\n\t preg_match(\"/^(\\w*?)(\\s|$)/\", $lvalue, $t);\n\n\t // If this is a protected element, activate the associated protection flag\n\t if (in_array($t[1], $nobreak)) array_unshift($innbk, $t[1]);\n\n\t // Otherwise this is a closing tag\n\t } else {\n\n\t // If this is a closing tag for a protected element, unset the flag\n\t if (in_array(substr($lvalue, 1), $nobreak)) {\n\t reset($innbk);\n\t while (list($key, $tag) = each($innbk)) {\n\t if (substr($lvalue, 1) == $tag) {\n\t unset($innbk[$key]);\n\t break;\n\t }\n\t }\n\t $innbk = array_values($innbk);\n\t }\n\t }\n\n\t // Else if we're outside any tags...\n\t } else if ($value) {\n\n\t // If unprotected...\n\t if (!count($innbk)) {\n\n\t // Use the ACK (006) ASCII symbol to replace all HTML entities temporarily\n\t $value = str_replace(\"\\x06\", \"\", $value);\n\t preg_match_all(\"/&([a-z\\d]{2,7}|#\\d{2,5});/i\", $value, $ents);\n\t $value = preg_replace(\"/&([a-z\\d]{2,7}|#\\d{2,5});/i\", \"\\x06\", $value);\n\n\t // Enter the line-break loop\n\t do {\n\t $store = $value;\n\n\t // Find the first stretch of characters over the $width limit\n\t if (preg_match(\"/^(.*?\\s)?([^\\s]{\".$width.\"})(?!(\".preg_quote($break, \"/\").\"|\\s))(.*)$/s{$utf8}\", $value, $match)) {\n\n\t if (strlen($match[2])) {\n\t // Determine the last \"safe line-break\" character within this match\n\t for ($x = 0, $ledge = 0; $x < strlen($lbrks); $x++) $ledge = max($ledge, strrpos($match[2], $lbrks{$x}));\n\t if (!$ledge) $ledge = strlen($match[2]) - 1;\n\n\t // Insert the modified string\n\t $value = $match[1].substr($match[2], 0, $ledge + 1).$break.substr($match[2], $ledge + 1).$match[4];\n\t }\n\t }\n\n\t // Loop while overlimit strings are still being found\n\t } while ($store != $value);\n\n\t // Put captured HTML entities back into the string\n\t foreach ($ents[0] as $ent) $value = preg_replace(\"/\\x06/\", $ent, $value, 1);\n\t }\n\t }\n\t }\n\n\t // Send the modified segment down the drain\n\t $drain .= $value;\n\t }\n\n\t // Return contents of the drain\n\t return $drain;\n\t}", "private static function do_shortcodes_in_html_tags( $content, $tagnames ) {\n $trans = array(\n '&#91;' => '&#091;',\n '&#93;' => '&#093;',\n );\n $content = strtr( $content, $trans );\n $trans = array(\n '[' => '&#91;',\n ']' => '&#93;',\n );\n\n $pattern = self::get_shortcode_regex( $tagnames );\n $textarr = self::html_split( $content );\n\n foreach ( $textarr as &$element ) {\n if ( '' == $element || '<' !== $element[0] ) {\n continue;\n }\n\n $noopen = false === strpos( $element, '[' );\n $noclose = false === strpos( $element, ']' );\n if ( $noopen || $noclose ) {\n // This element does not contain shortcodes.\n if ( $noopen xor $noclose ) {\n // Need to encode stray [ or ] chars.\n $element = strtr( $element, $trans );\n }\n continue;\n }\n\n if ( $ignore_html || '<!--' === substr( $element, 0, 4 ) || '<![CDATA[' === substr( $element, 0, 9 ) ) {\n // Encode all [ and ] chars.\n $element = strtr( $element, $trans );\n continue;\n }\n\n $attributes = $this->kses_attr_parse( $element );\n if ( false === $attributes ) {\n // Some plugins are doing things like [name] <[email]>.\n if ( 1 === preg_match( '%^<\\s*\\[\\[?[^\\[\\]]+\\]%', $element ) ) {\n $element = preg_replace_callback( \"/$pattern/\", 'do_shortcode_tag', $element );\n }\n\n // Looks like we found some crazy unfiltered HTML. Skipping it for sanity.\n $element = strtr( $element, $trans );\n continue;\n }\n\n // Get element name\n $front = array_shift( $attributes );\n $back = array_pop( $attributes );\n $matches = array();\n preg_match( '%[a-zA-Z0-9]+%', $front, $matches );\n $elname = $matches[0];\n\n // Look for shortcodes in each attribute separately.\n foreach ( $attributes as &$attr ) {\n $open = strpos( $attr, '[' );\n $close = strpos( $attr, ']' );\n if ( false === $open || false === $close ) {\n continue; // Go to next attribute. Square braces will be escaped at end of loop.\n }\n $double = strpos( $attr, '\"' );\n $single = strpos( $attr, \"'\" );\n if ( ( false === $single || $open < $single ) && ( false === $double || $open < $double ) ) {\n // $attr like '[shortcode]' or 'name = [shortcode]' implies unfiltered_html.\n // In this specific situation we assume KSES did not run because the input\n // was written by an administrator, so we should avoid changing the output\n // and we do not need to run KSES here.\n $attr = preg_replace_callback( \"/$pattern/\", array($this, 'do_shortcode_tag'), $attr );\n } else {\n // $attr like 'name = \"[shortcode]\"' or \"name = '[shortcode]'\"\n // We do not know if $content was unfiltered. Assume KSES ran before shortcodes.\n $count = 0;\n $new_attr = preg_replace_callback( \"/$pattern/\", array($this, 'do_shortcode_tag'), $attr, -1, $count );\n if ( $count > 0 ) {\n // Sanitize the shortcode output using KSES.\n $new_attr = $this->kses_one_attr( $new_attr, $elname );\n if ( '' !== trim( $new_attr ) ) {\n // The shortcode is safe to use now.\n $attr = $new_attr;\n }\n }\n }\n }\n $element = $front . implode( '', $attributes ) . $back;\n\n // Now encode any remaining [ or ] chars.\n $element = strtr( $element, $trans );\n }\n\n $content = implode( '', $textarr );\n\n return $content;\n }", "protected static function wrap ($in, $data, $tag) {\n\t\t$data = static::smart_array_merge(is_array($in) ? $in : ['in' => $in], is_array($data) ? $data : []);\n\t\t$in = $attributes = '';\n\t\t$level = 1;\n\t\tif (isset($data['level'])) {\n\t\t\t$level = $data['level'];\n\t\t\tunset($data['level']);\n\t\t}\n\t\tstatic::pre_processing($tag, $data);\n\t\tif (!static::data_prepare($data, $tag, $in, $attributes)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (\n\t\t\t!$in &&\n\t\t\t$in !== 0 &&\n\t\t\t$in !== '0'\n\t\t) {\n\t\t\t$in = '';\n\t\t} elseif (\n\t\t\t$level &&\n\t\t\t(\n\t\t\t\tstrpos($in, \"\\n\") !== false ||\n\t\t\t\tstrpos($in, '<') !== false\n\t\t\t)\n\t\t) {\n\t\t\t$in = \"\\n\".static::level(\"$in\\n\", $level);\n\t\t}\n\t\treturn \"<$tag$attributes>$in</$tag>\".($level ? \"\\n\" : '');\n\t}", "static function wrap($original) {\n if (!function_exists('gettext')) return sprintf('<!--l10n-->%1$s', $original);\n return sprintf('<!--l10n-->%1$s', gettext($original));\n }", "function bbcodes($reactie) \n { \n \n // Vet, schuin, etc V\n $reactie = preg_replace(\"/\\[b\\](.+?)\\[\\/b\\]/is\",'<strong>\\1</strong>', $reactie);\n $reactie = preg_replace(\"/\\[i\\](.+?)\\[\\/i\\]/is\",'<em>\\1</em>', $reactie);\n $reactie = preg_replace(\"/\\[u\\](.+?)\\[\\/u\\]/is\",'<u>\\1</u>', $reactie);\n $reactie = preg_replace(\"/\\[s\\](.+?)\\[\\/s\\]/is\",'<s>\\1</s>', $reactie);\n\n\t//quote box.\t \n\t$reactie = preg_replace(\"/\\[quote\\](.+?)\\[\\/quote\\]/is\",'<br /><center><fieldset style=\"color: #000000; border: 1px solid #000000; width: 90%; text-align: left; padding: 5px;\">\n<legend style=\"color: #999999; font-weight: bold;\">Quote.</legend>\\1</fieldset></center><br />', $reactie);\n\t \t \n // Color, font & size V\n $reactie = preg_replace (\"#\\[color=(\\#[0-9A-F]{6}|[a-z\\-]+)\\](.*?)\\[/color\\]#si\", \"<font color=\\\"\\\\1\\\">\\\\2</font>\", $reactie);\n $reactie = preg_replace (\"/\\[font=(.*)\\](.*)\\[\\/font\\]/\", \"<font face=\\\"\\\\1\\\">\\\\2</font>\", $reactie);\n $reactie = preg_replace (\"/\\[size=(.*)\\](.*)\\[\\/size\\]/\", \"<font size=\\\"\\\\1\\\">\\\\2</font>\", $reactie);\n\t\n // Diversen V\n $reactie = str_replace (\"[left]\", \"<div align=left>\", $reactie);\n $reactie = str_replace (\"[/left]\", \"</div>\", $reactie);\n $reactie = str_replace (\"[center]\", \"<div align=\\\"center\\\">\", $reactie);\n $reactie = str_replace (\"[/center]\", \"</div>\", $reactie);\n $reactie = str_replace (\"[right]\", \"<div align=\\\"right\\\">\", $reactie);\n $reactie = str_replace (\"[/right]\", \"</div>\", $reactie);\n \n // Horizontale lijn V\n $reactie = str_replace (\"[hr]\",\"<hr color=\\\"#000000\\\" noshade />\",$reactie);\n \n // Lijst - Unorderd V\n $reactie = str_replace (\"[list]\",\"<ul>\",$reactie);\n $reactie = str_replace (\"[*]\",\"<li>\",$reactie);\n $reactie = str_replace (\"[/list]\",\"</li></ul>\",$reactie);\n \n\t// list orderd.\n\t\n\t$reactie = str_replace (\"[order]\",\"<ol>\",$reactie);\n $reactie = str_replace (\"[*]\",\"<li>\",$reactie);\n $reactie = str_replace (\"[/order]\",\"</li></ol>\",$reactie);\n\t \n return $reactie; \n }", "function rewrapHTMLCallback($match) {\n $width = 80;\n $break = '<span class=\"allowWrap\"> </span>';\n $words = preg_split('~(\\r\\n|\\n\\r|[\\r\\n\\s])~', $match[2]);\n $systemIncludePath = dirname(dirname(__FILE__));\n if (is_array($words)) {\n $result = '';\n foreach ($words as $word) {\n if (0 === strpos($word, PAPAYA_INCLUDE_PATH)) {\n $partWord = substr($word, strlen(PAPAYA_INCLUDE_PATH));\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>/'.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>/'.$partWord;\n }\n } elseif (isset($_SERVER['DOCUMENT_ROOT']) &&\n 0 === strpos($word, $_SERVER['DOCUMENT_ROOT'])) {\n $partWord = substr($word, strlen($_SERVER['DOCUMENT_ROOT']));\n if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') {\n $addSlash = '/';\n } else {\n $addSlash = '';\n }\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{DOCUMENT_ROOT}</em>'.$addSlash.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{DOCUMENT_ROOT}</em>'.$addSlash.$partWord;\n }\n } elseif (0 === strpos($word, $systemIncludePath)) {\n $partWord = substr($word, strlen($systemIncludePath));\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>'.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>'.$partWord;\n }\n } elseif (papaya_strings::strlen($word) > $width) {\n $result .= ' '.wordwrap($word, $width, $break, TRUE);\n } else {\n $result .= ' '.$word;\n }\n }\n return $match[1].substr($result, 1);\n } else {\n return $match[0];\n }\n }", "function lumen_fix_shortcodes($content){ \n $array = array (\n '<p>[' => '[', \n ']</p>' => ']', \n ']<br />' => ']'\n );\n\n $content = strtr($content, $array);\n return $content;\n}", "function processWikitext($wikilang, $text, $makelinks) {\r\n $result = $text;\r\n $differentLinkRegex=\"/\\[\\[([^\\|]*)\\|([^\\]]*)\\]\\]/\";\r\n $simpleLinkRegex=\"/\\[\\[([^\\]]*)\\\\]\\]/\";\r\n $wikiUrl = 'http://' . $wikilang . '.wikipedia.org/wiki/';\r\n $differentLinkReplace = \"'<a href=\\\"\" . $wikiUrl .\"' . rawurlencode('$1') . '\\\">$2</a>'\";\r\n $simpleLinkReplace = \"'<a href=\\\"\". $wikiUrl .\"' . rawurlencode('$1') . '\\\">$1</a>'\";\r\n if ( $makelinks ) {\r\n $result = preg_replace($differentLinkRegex . \"e\", $differentLinkReplace, $result);\r\n $result = preg_replace($simpleLinkRegex . \"e\", $simpleLinkReplace, $result);\r\n $result = $result;\r\n } else {\r\n $result = preg_replace($differentLinkRegex, \"$2\", $result);\r\n $result = preg_replace($simpleLinkRegex, \"$1\", $result);\r\n }\r\n return $result;\r\n}", "function italica($text){\r\n return \"<i>$text</i>\";\r\n }", "public function do_tags()\n\t{\n\t\tforeach ($this->values as $id => $block)\n\t\t{\n\t\t\tforeach ($block as $name => $replace)\n\t\t\t{\n\t\t\t\t$find = \"{:$name}\";\n\t\t\t\t$this->merged[$id] = str_replace($find, $replace, $this->merged[$id]);\n\t\t\t}\n\t\t}\n\n\t}", "public function typoSearchTagsHandlesMultipleMarkerPairs() {}", "protected static function applyHtmlTags($mixValue, $isArrayIndex = false)\n {\n\n if ($isArrayIndex) {\n $strHtmlTagsValue = '[\"<span class=\"literal\">' . $mixValue . '</span>\"]';\n $mixValue = '[\"' . $mixValue . '\"]';\n self::applyHtmlTagsToContext($mixValue, $strHtmlTagsValue);\n } else {\n $strVarType = gettype($mixValue);\n\n switch ($strVarType) {\n case 'string':\n $strHtmlTagsValue = '\"<span class=\"string\">' . htmlentities($mixValue) . '</span>\"';\n $mixValue = '\"' . $mixValue . '\"';\n self::applyHtmlTagsToContext($mixValue, $strHtmlTagsValue);\n break;\n\n case 'integer':\n $strHtmlTagsValue = 'int(<span class=\"number\">' . $mixValue . '</span>)';\n $mixValue = 'int(' . $mixValue . ')';\n self::applyHtmlTagsToContext($mixValue, $strHtmlTagsValue);\n break;\n\n case 'double':\n $strHtmlTagsValue = 'float(<span class=\"number\">' . $mixValue . '</span>)';\n $mixValue = 'float(' . $mixValue . ')';\n self::applyHtmlTagsToContext($mixValue, $strHtmlTagsValue);\n break;\n\n case 'boolean':\n if ($mixValue) {\n $mixValue = 'true';\n } else {\n $mixValue = 'false';\n }\n $strHtmlTagsValue = 'bool(<span class=\"boolean\">' . $mixValue . '</span>)';\n $mixValue = 'bool(' . $mixValue . ')';\n self::applyHtmlTagsToContext($mixValue, $strHtmlTagsValue);\n break;\n\n case 'array':\n # this can slow down your performance too, but still useful. Just comment it to increate your\n # performance\n array_walk_recursive($mixValue, function ($mixValue, $mixKey) {\n self::applyHtmlTags($mixKey, true);\n self::applyHtmlTags($mixValue);\n });\n break;\n\n case 'object':\n # not implemented because of segmentation fault. Will totally down your performance.\n break;\n\n default:\n break;\n }\n }\n\n return self::$strColorfulContext;\n }", "function wrapHTMLSpan($text, $additionalClasses = \"\") {\n\t\treturn '<span class=\"'.$additionalClasses.'\">'.$text.'</span>';\t\n}", "function apachesolr_add_tags_to_document(&$document, $text) {\r\n $tags_to_index = variable_get('apachesolr_tags_to_index', array(\r\n 'h1' => 'tags_h1',\r\n 'h2' => 'tags_h2_h3',\r\n 'h3' => 'tags_h2_h3',\r\n 'h4' => 'tags_h4_h5_h6',\r\n 'h5' => 'tags_h4_h5_h6',\r\n 'h6' => 'tags_h4_h5_h6',\r\n 'u' => 'tags_inline',\r\n 'b' => 'tags_inline',\r\n 'i' => 'tags_inline',\r\n 'strong' => 'tags_inline',\r\n 'em' => 'tags_inline',\r\n 'a' => 'tags_a'\r\n ));\r\n\r\n // Strip off all ignored tags.\r\n $text = strip_tags($text, '<'. implode('><', array_keys($tags_to_index)) .'>');\r\n\r\n preg_match_all('@<('. implode('|', array_keys($tags_to_index)) .')[^>]*>(.*)</\\1>@Ui', $text, $matches);\r\n foreach ($matches[1] as $key => $tag) {\r\n $tag = strtolower($tag);\r\n // We don't want to index links auto-generated by the url filter.\r\n if ($tag != 'a' || !preg_match('@(?:http://|https://|ftp://|mailto:|smb://|afp://|file://|gopher://|news://|ssl://|sslv2://|sslv3://|tls://|tcp://|udp://|www\\.)[a-zA-Z0-9]+@', $matches[2][$key])) {\r\n $document->{$tags_to_index[$tag]} .= ' '. $matches[2][$key];\r\n }\r\n }\r\n}", "protected function wrap(?string $message = null, int $wrapLength = self::LINE_LENGTH_MUST): array\n {\n if ($message === null || $message === '') {\n return [''];\n }\n $message = str_replace([\"\\r\\n\", \"\\r\"], \"\\n\", $message);\n $lines = explode(\"\\n\", $message);\n $formatted = [];\n $cut = ($wrapLength === static::LINE_LENGTH_MUST);\n\n foreach ($lines as $line) {\n if (empty($line) && $line !== '0') {\n $formatted[] = '';\n continue;\n }\n if (strlen($line) < $wrapLength) {\n $formatted[] = $line;\n continue;\n }\n if (!preg_match('/<[a-z]+.*>/i', $line)) {\n $formatted = array_merge(\n $formatted,\n explode(\"\\n\", Text::wordWrap($line, $wrapLength, \"\\n\", $cut))\n );\n continue;\n }\n\n $tagOpen = false;\n $tmpLine = $tag = '';\n $tmpLineLength = 0;\n for ($i = 0, $count = strlen($line); $i < $count; $i++) {\n $char = $line[$i];\n if ($tagOpen) {\n $tag .= $char;\n if ($char === '>') {\n $tagLength = strlen($tag);\n if ($tagLength + $tmpLineLength < $wrapLength) {\n $tmpLine .= $tag;\n $tmpLineLength += $tagLength;\n } else {\n if ($tmpLineLength > 0) {\n $formatted = array_merge(\n $formatted,\n explode(\"\\n\", Text::wordWrap(trim($tmpLine), $wrapLength, \"\\n\", $cut))\n );\n $tmpLine = '';\n $tmpLineLength = 0;\n }\n if ($tagLength > $wrapLength) {\n $formatted[] = $tag;\n } else {\n $tmpLine = $tag;\n $tmpLineLength = $tagLength;\n }\n }\n $tag = '';\n $tagOpen = false;\n }\n continue;\n }\n if ($char === '<') {\n $tagOpen = true;\n $tag = '<';\n continue;\n }\n if ($char === ' ' && $tmpLineLength >= $wrapLength) {\n $formatted[] = $tmpLine;\n $tmpLineLength = 0;\n continue;\n }\n $tmpLine .= $char;\n $tmpLineLength++;\n if ($tmpLineLength === $wrapLength) {\n $nextChar = $line[$i + 1] ?? '';\n if ($nextChar === ' ' || $nextChar === '<') {\n $formatted[] = trim($tmpLine);\n $tmpLine = '';\n $tmpLineLength = 0;\n if ($nextChar === ' ') {\n $i++;\n }\n } else {\n $lastSpace = strrpos($tmpLine, ' ');\n if ($lastSpace === false) {\n continue;\n }\n $formatted[] = trim(substr($tmpLine, 0, $lastSpace));\n $tmpLine = substr($tmpLine, $lastSpace + 1);\n\n $tmpLineLength = strlen($tmpLine);\n }\n }\n }\n if (!empty($tmpLine)) {\n $formatted[] = $tmpLine;\n }\n }\n $formatted[] = '';\n\n return $formatted;\n }", "function processWikitext($text, $links) {\n $result = $text;\n $differentLinkRegex=\"/\\[\\[([^\\|]*)\\|([^\\]]*)\\]\\]/\";\n $simpleLinkRegex=\"/\\[\\[([^\\]]*)\\\\]\\]/\";\n $differentLinkReplace = \"'<a href=http://nl.wikipedia.org/wiki/' . rawurlencode('$1') . '>$2</a>'\";\n $simpleLinkReplace = \"'<a href=http://nl.wikipedia.org/wiki/' . rawurlencode('$1') . '>$1</a>'\";\n if ( $links ) {\n\t$result = preg_replace($differentLinkRegex . \"e\", $differentLinkReplace, $result);\n\t$result = preg_replace($simpleLinkRegex . \"e\", $simpleLinkReplace, $result);\n\t$result = $result;\n } else {\n\t$result = preg_replace($differentLinkRegex, \"$2\", $result);\n\t$result = preg_replace($simpleLinkRegex, \"$1\", $result);\n }\n return $result;\n}", "function lorem_function($atts){\n\textract(shortcode_atts(array(\n\t\t'num' => 4\n\t\t),$atts));\n\t$retval = \"<p style='color:red;border:1px solid red'><strong>Dummy type needs replacing: </strong>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud execcaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est labor.</p>\";\n\t$lorem = \"<p style='color:red;border:1px solid red'>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud execcaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laboru</p>\";\n\t\n\tfor ($i = 0; $i < intval($atts['num']) - 1; $i++) {\n \t$retval = $retval . $lorem;\n\t}\n\n\treturn $retval;\n}", "function wrapHtml($data = '', $tag, $attrs = null, $single_tag = false)\n{\n\t$ret = '<'.$tag;\n\tif (is_array($attrs) && !empty($attrs))\n\t{\n\t\t$ret .= ' ';\n\t\tforeach($attrs as $attr => $val)\n\t\t$ret .= $attr .'=\"'.$val .'\" ';\n\t}\n\t\n\tif ($single_tag)\n\t\t$ret .= ' />';\n\telse\n\t\t$ret .= '>'. $data. '</'.$tag.'>';\n\treturn $ret;\n}", "public function _i18n_wrapper($input = '', $replace = [])\n {\n if ( ! strlen($input)) {\n return '';\n }\n $input = stripslashes(trim($input, '\"\\''));\n $args = [];\n // Complex case with substitutions\n if (preg_match('/(?P<text>.+?)[\"\\']{1},[\\s\\t]*%(?P<args>[a-z]+.+)$/ims', $input, $m)) {\n foreach (explode(';%', $m['args']) as $arg) {\n $attr_name = $attr_val = '';\n if (false !== strpos($arg, '=')) {\n list($attr_name, $attr_val) = explode('=', trim($arg));\n }\n $attr_name = trim(str_replace([\"'\", '\"'], '', $attr_name));\n $attr_val = trim(str_replace([\"'\", '\"'], '', $attr_val));\n $args['%' . $attr_name] = $attr_val;\n }\n $text_to_translate = $m['text'];\n } else {\n $text_to_translate = $input;\n }\n $output = t($text_to_translate, $args);\n // Do replacement of the template vars on the last stage\n // example: @replace1 will be got from $replace['replace1'] array item\n if (false !== strpos($output, '@') && ! empty($replace)) {\n $r = [];\n foreach ((array) $replace as $k => $v) {\n $r['@' . $k] = $v;\n }\n $output = str_replace(array_keys($r), array_values($r), $output);\n }\n return $output;\n }", "function render($text)\n{\n $styles = Config::styles();\n $names = implode('|', array_keys($styles));\n preg_match_all(\"#(\\[({$names})\\])#i\", $text, $matches);\n\n $replacements = $matches[1];\n $selections = $matches[2];\n\n if(!empty($replacements) && !empty($selections))\n {\n $replacements = array_unique($replacements);\n $selections = array_unique($selections);\n\n foreach($replacements as $index => $replacement)\n {\n $color = strtolower($selections[$index]);\n if(array_key_exists($color, $styles))\n $text = str_ireplace($replacement, $styles[$color], $text);\n }\n }\n echo $text;\n}", "function textObj($OA) {\n\n // echo 'wrap' before\n if(isset($OA['wrapB'])) echo $OA['wrapB'];\n \n // echo 'link' begin\n if (isset($OA['link'])) {\n \n // check for class\n if( isset($OA['class']) ) $class = ' class=\"'.$OA['class'].'\"';\n else $class = '';\n \n echo '<a'.$class.' href=\"'. $OA['link'] .'\"';\n if(isset($OA['linkT'])) echo ' target=\"'. $OA['linkT'] .'\"';\n echo '>';\n }\n \n // echo 'value'\n if(isset($OA['value'])) echo $OA['value']; \n\n // echo 'link' end\n if(isset($OA['link'])) echo '</a>';\n \n // echo 'wrap' after\n if(isset($OA['wrapA'])) echo $OA['wrapA'].\"\\n\"; \n}", "function smarty_compiler_L($tag_arg, &$smarty)\n{\n\tglobal $user;\n\t$tag_arg = preg_replace('/[^A-Z_]*/', '', $tag_arg);\n\tif (isset($user->lang[$tag_arg]))\n\t{\n\t\treturn \"?>{$user->lang[$tag_arg]}<?php\";\n\t}\n\telse\n\t{\n\t\treturn 'echo(isset($this->_tpl_vars[\\'L_' . $tag_arg . '\\']) ? $this->_tpl_vars[\\'L_' . $tag_arg . '\\'] : \\'{L ' . $tag_arg . '}\\');';\n\t}\n}", "function SEEDStd_ArrayExpand( $ra, $sTemplate, $bEnt = true )\r\n/************************************************************\r\n */\r\n{\r\n foreach( $ra as $k => $v ) {\r\n $sTemplate = str_replace( \"[[$k]]\", ($bEnt ? SEEDStd_HSC($v) : $v), $sTemplate );\r\n }\r\n// recursive expansions are not implemented\r\n return( $sTemplate );\r\n\r\n/*\r\n// isn't this the same thing as str_replace( \"[[$k]]\", ($bEnt ? ...), $sTemplate )\r\n\r\n\tforeach( $ra as $k => $v ) {\r\n\t\t// Also remember to repeat the whole process until no matches found, to allow recursive expansions\r\n\t\twhile( ($s1 = strpos( $sTemplate, \"[[$k]]\")) !== false ) {\r\n\t\t\t$sTemplate = substr( $sTemplate, 0, $s1 )\r\n\t\t\t.($bEnt ? htmlspecialchars($v,ENT_QUOTES) : $v)\r\n\t\t\t.substr( $sTemplate, $s1+strlen($k)+4 );\r\n\t\t}\r\n\t}\r\n*/\r\n\r\n\t/* Did not work for HTML templates that contained processing instructions with ]]\r\n\tfor(;;) {\r\n $s1 = strpos( $sTemplate, \"[[\" );\r\n $s2 = strpos( $sTemplate, \"]]\" );\r\n if( $s1 === false || $s2 === false ) break;\r\n $k = substr( $sTemplate, $s1 + 2, $s2 - $s1 - 2 );\r\n if( empty($k) ) break;\r\n\r\n $sTemplate = substr( $sTemplate, 0, $s1 )\r\n .($bEnt ? SEEDStd_HSC(@$ra[$k]) : @$ra[$k])\r\n .substr( $sTemplate, $s2+2 );\r\n\t}\r\n\t*/\r\n\r\n\treturn( $sTemplate );\r\n}", "function sc_wrap($atts, $content){\n\t\t$wrap_def = shortcode_atts(\n\t\t\tarray(\n\t\t\t\t'position' => 'center',\n\t\t\t\t'class' \t => 'txt-wrap'\n\t\t\t),\n\t\t\t$atts\n\t\t);\n\n\t\t$wrap_text = sprintf('<div class=\"'.$wrap_def['class'].'\" align=\"'.$wrap_def['position'].'\">'. $content .'</div>');\n\t\treturn do_shortcode($wrap_text);\n\n\t}", "protected function getKeywordsExample()\n {\n return '<p><b>' . __('Example') . '</b><p><p>[name][, {color} color][, {size} measurements||size][, {category}] <p>' . __('will be transformed into') . '<br>\n <p>CN Clogs Beach/Garden Clog, Blue color, 10 size, Shoes';\n }", "public function testReplaceTags()\n\t{\n\t\t$this->assertEquals('143',$this->obj->replace_tags('1{{2}}3', '', array(\"2\"=>\"4\")));\n\t\t$this->assertEquals('143',$this->obj->replace_tags('1{{args:2}}3', 'args', array(\"2\"=>\"4\")));\n\t\t$this->assertEquals('143$var',$this->obj->replace_tags('1{{args:2}}3$var', 'args', array(\"2\"=>\"4\")));\n\t}", "public function registerMarkupTags()\n {\n // Check the translate plugin is installed\n if (class_exists('RainLab\\Translate\\Behaviors\\TranslatableModel')) {\n return ['filters' => [\n 'cast_to_array' => [$this, 'castToArray']\n ]];\n }\n\n return [\n 'filters' => [\n '_' => ['Lang', 'get'],\n '__' => ['Lang', 'choice'],\n 'cast_to_array' => [$this, 'castToArray']\n ]\n ];\n }", "function dev_wrap_li( $entry ) {\n\n\tif ( is_array( $entry ) ) {\n\t\t$entry = dev_array_to_ul( $entry );\n\t}\n\n\t$entry = htmlentities( $entry );\n\n\treturn \"<li>$entry</li>\";\n}", "function html_wikir_render($str)\n{\n $regexps = array();\n $replacements = array();\n $refs = wikir_pages_references($str);\n foreach($refs as $ref)\n {\n $regexps[] = '/\\[\\['.preg_quote($ref).'\\]\\]/';\n \n $link = '<a href=\"';\n $link .= url_for($ref);\n $link .= '\">';\n $link .= h(str_replace('_', '\\_', $ref));\n $link .= '</a>';\n if(!WikirPage::exists($ref)) $link .= '<sup>(?)</sup>';\n $replacements[] = $link;\n }\n return Markdown(preg_replace($regexps, $replacements, $str));\n}", "function wpex_clean_shortcodes($content){ \n$array = array (\n '<p>[' => '[', \n ']</p>' => ']', \n ']<br />' => ']'\n);\n$content = strtr($content, $array);\nreturn $content;\n}", "function transform_text ($text, $settings) {\n foreach ($settings as $key => $value) {\n $text = str_replace(\"{{ $key }}\", $value, $text);\n }\n return $text;\n }", "function gtags_make_tags_for_group() {\n\tglobal $bp, $wpdb;\n\t\n\t$group_tags = gtags_get_group_tags();\n\t$items = explode( \",\", $group_tags );\n\t$output = '';\n\tforeach( $items as $item ) {\n\t\t$item = trim( strtolower( $item ) );\n\t\tif ($item=='') continue;\n\t\t$link = $bp->root_domain . '/projets/tag/' . urlencode( $item );\n\t\t$output .= ' <a class=\"etiquette highlight\" href=\"'.$link.'\" title=\"Voir tous les projets ayant pour mots-clés '.$item.'\">#'.$item.'</a> ';\n\t}\n\n\treturn apply_filters( 'gtags_make_tags_for_group', $output, $items );\n}", "function my_formatter($content)\n{\n $new_content = '';\n $pattern_full = '{(\\[raw\\].*?\\[/raw\\])}is';\n $pattern_contents = '{\\[raw\\](.*?)\\[/raw\\]}is';\n $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);\n\n foreach ($pieces as $piece) {\n if (preg_match($pattern_contents, $piece, $matches)) {\n $new_content .= $matches[1];\n } else {\n $new_content .= wptexturize(wpautop($piece));\n }\n }\n\n return $new_content;\n}", "public function markup(): string;", "function textblock_template_replace(&$textblock, $replace)\n{\n foreach ($replace as $key => $value) {\n $textblock['title'] = str_replace(\"%$key%\", $value, $textblock['title']);\n $textblock['text'] = str_replace(\"%$key%\", $value, $textblock['text']);\n }\n}", "function seminarcallback($things)\n{\n\t$thing = $things[1];\n\n\n\tstatic $oldIndentLevel = 0;\n\tstatic $indentClosers = array();\n\tstatic $br = 1;\n\n\tglobal $wakka;\n\n\t// convert HTML thingies\n\tif ($thing == \"<\")\n\t\treturn \"&lt;\";\n\telse if ($thing == \">\")\n\t\treturn \"&gt;\";\n\t// bold\n\telse if ($thing == \"**\")\n\t{\n\t\tstatic $bold = 0;\n\t\treturn (++$bold % 2 ? \"<strong>\" : \"</strong>\");\n\t}\n\t// italic\n\telse if ($thing == \"//\")\n\t{\n\t\tstatic $italic = 0;\n\t\treturn (++$italic % 2 ? \"<em>\" : \"</em>\");\n\t}\n\t// underlinue\n\telse if ($thing == \"__\")\n\t{\n\t\tstatic $underline = 0;\n\t\treturn (++$underline % 2 ? \"<u>\" : \"</u>\");\n\t}\n\t// monospace\n\telse if ($thing == \"##\")\n\t{\n\t\tstatic $monospace = 0;\n\t\treturn (++$monospace % 2 ? \"<tt>\" : \"</tt>\");\n\t}\n\t// notes\n\telse if ($thing == \"''\")\n\t{\n\t\tstatic $notes = 0;\n\t\treturn (++$notes % 2 ? \"<span class=\\\"notes\\\">\" : \"</span>\");\n\t}\n\t// urls\n\telse if (preg_match(\"/^([a-z]+:\\/\\/\\S+?)([^[:alnum:]^\\/])?$/\", $thing, $matches)) {\n\t\t$url = $matches[1];\n\t\t\n\t\treturn \"<a href=\\\"$url\\\">$url</a>\".$matches[2];\n\t}\n\t// headers\n\telse if (preg_match(\"/^======(.*)======$/s\", $thing, $matches))\n\t{\n\t\t$br = 0;\n\t\treturn \"<h1>\".$matches[1].\"</h1>\";\n\t}\n\telse if (preg_match(\"/^=====(.*)=====$/s\", $thing, $matches))\n\t{\n\t\t$br = 0;\n\t\treturn \"<h2>\".$matches[1].\"</h2>\";\n\t}\n\telse if (preg_match(\"/^====(.*)====$/s\", $thing, $matches))\n\t{\n\t\t$br = 0;\n\t\treturn \"<h3>\".$matches[1].\"</h3>\";\n\t}\n\telse if (preg_match(\"/^===(.*)===$/s\", $thing, $matches))\n\t{\n\t\t$br = 0;\n\t\treturn \"<h4>\".$matches[1].\"</h4>\";\n\t}\n\telse if (preg_match(\"/^==(.*)==$/s\", $thing, $matches))\n\t{\n\t\t$br = 0;\n\t\treturn \"<h5>\".$matches[1].\"</h5>\";\n\t}\n\t// separators\n\telse if ($thing == \"----\")\n\t{\n\t\t// TODO: This could probably be improved for situations where someone puts text on the same line as a separator.\n\t\t// Which is a stupid thing to do anyway! HAW HAW! Ahem.\n\t\t$br = 0;\n\t\treturn \"<hr noshade=\\\"noshade\\\" size=\\\"1\\\" />\";\n\t}\n\t// forced line breaks\n\telse if ($thing == \"---\")\n\t{\n\t\treturn \"<br />\";\n\t}\n\t// escaped text\n\telse if (preg_match(\"/^\\\"\\\"(.*)\\\"\\\"$/s\", $thing, $matches))\n\t{\n\t\treturn $matches[1];\n\t}\n\t// code text\n\telse if (preg_match(\"/^\\%\\%(.*)\\%\\%$/s\", $thing, $matches))\n\t{\n\t\t// check if a language has been specified\n\t\t$code = $matches[1];\n\t\tif (preg_match(\"/^\\((.+?)\\)(.*)$/s\", $code, $matches))\n\t\t{\n\t\t\tlist(, $language, $code) = $matches;\n\t\t}\n\t\tswitch ($language)\n\t\t{\n\t\tcase \"php\":\n\t\t\t$formatter = \"php\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$formatter = \"code\";\n\t\t}\n\n\t\t$output = \"<div class=\\\"code\\\">\";\n\t\t$output .= $wakka->Format(trim($code), $formatter);\n\t\t$output .= \"</div>\";\n\n\t\treturn $output;\n\t}\n\t// forced links\n\telse if (preg_match(\"/^\\[\\[(\\S*)(\\s+(.+))?\\]\\]$/\", $thing, $matches))\n\t{\n\t\tlist (, $url, , $text) = $matches;\n\t\tif ($url)\n\t\t{\n\t\t\tif (!$text) $text = $url;\n\t\t\treturn $wakka->Link($url, \"\", $text);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}\n\t// indented text\n\telse if (preg_match(\"/\\n(\\t+)(-|([0-9,a-z,A-Z]+)\\))?(\\n|$)/s\", $thing, $matches))\n\t{\n\t\t// new line\n\t\t$result .= ($br ? \"<br />\\n\" : \"\\n\");\n\n\t\t// we definitely want no line break in this one.\n\t\t$br = 0;\n\n\t\t// find out which indent type we want\n\t\t$newIndentType = $matches[2];\n\t\tif (!$newIndentType) { $opener = \"<div class=\\\"indent\\\">\"; $closer = \"</div>\"; $br = 1; }\n\t\telse if ($newIndentType == \"-\") { $opener = \"<ul><li>\"; $closer = \"</li></ul>\"; $li = 1; }\n\t\telse { $opener = \"<ol type=\\\"\".$newIndentType.\"\\\"><li>\"; $closer = \"</li></ol>\"; $li = 1; }\n\n\t\t// get new indent level\n\t\t$newIndentLevel = strlen($matches[1]);\n\t\tif ($newIndentLevel > $oldIndentLevel)\n\t\t{\n\t\t\tfor ($i = 0; $i < $newIndentLevel - $oldIndentLevel; $i++)\n\t\t\t{\n\t\t\t\t$result .= $opener;\n\t\t\t\tarray_push($indentClosers, $closer);\n\t\t\t}\n\t\t}\n\t\telse if ($newIndentLevel < $oldIndentLevel)\n\t\t{\n\t\t\tfor ($i = 0; $i < $oldIndentLevel - $newIndentLevel; $i++)\n\t\t\t{\n\t\t\t\t$result .= array_pop($indentClosers);\n\t\t\t}\n\t\t}\n\n\t\t$oldIndentLevel = $newIndentLevel;\n\n\t\tif ($li && !preg_match(\"/\".str_replace(\")\", \"\\)\", $opener).\"$/\", $result))\n\t\t{\n\t\t\t$result .= \"</li><li>\";\n\t\t}\n\n\t\treturn $result;\n\t}\n\t// new lines\n\telse if ($thing == \"\\n\")\n\t{\n\t\t// if we got here, there was no tab in the next line; this means that we can close all open indents.\n\t\t$c = count($indentClosers);\n\t\tfor ($i = 0; $i < $c; $i++)\n\t\t{\n\t\t\t$result .= array_pop($indentClosers);\n\t\t\t$br = 0;\n\t\t}\n\t\t$oldIndentLevel = 0;\n\n\t\t$result .= ($br ? \"<br />\\n\" : \"\\n\");\n\t\t$br = 1;\n\t\treturn $result;\n\t}\n\t// events\n\telse if (preg_match(\"/^\\{\\{(.*?)\\}\\}$/s\", $thing, $matches))\n\t{\n\t\tif ($matches[1])\n\t\t\treturn $wakka->Action($matches[1]);\n\t\telse\n\t\t\treturn \"{{}}\";\n\t}\n\t// interwiki links!\n\telse if (preg_match(\"/^[A-Z][A-Z,a-z]+[:]([A-Z,a-z,0-9]*)$/s\", $thing))\n\t{\n\t\t//TODO 링크도 처리하다.\n//\t\treturn $wakka->Link($thing);\n\t}\n\t// wakka links!\n\telse if (preg_match(\"/^[A-Z][a-z]+[A-Z,0-9][A-Z,a-z,0-9]*$/s\", $thing))\n\t{\n//\t\treturn $wakka->Link($thing);\n\t}\n\t// if we reach this point, it must have been an accident.\n\treturn $thing;\n}", "private function processTags()\n {\n $dollarNotationPattern = \"~\" . REGEX_DOLLAR_NOTATION . \"~i\";\n $simpleTagPattern = \"~\" . REGEX_SIMPLE_TAG_PATTERN . \"~i\";\n $bodyTagPattern = \"~\" . REGEX_BODY_TAG_PATTERN . \"~is\";\n \n $tags = array();\n preg_match_all($this->REGEX_COMBINED, $this->view, $tags, PREG_SET_ORDER);\n \n foreach($tags as $tag)\n { \n $result = \"\";\n \n $tag = $tag[0];\n \n if (strlen($tag) == 0) continue;\n \n if (preg_match($simpleTagPattern, $tag) || preg_match($bodyTagPattern, $tag))\n {\n $this->handleTag($tag);\n }\n else if (preg_match($dollarNotationPattern, $tag))\n {\n $this->logger->log(Logger::LOG_LEVEL_DEBUG, 'View: processTags', \"Found ExpLang [$tag]\");\n $result = $this->EL_Engine->parse($tag);\n }\n \n if (isset ($result))\n {\n $this->update($tag, $result);\n }\n }\n }", "function tagins($stuffing) {\n return \"<\".$stuffing.\">\".PHP_EOL;\n }", "private function parseComplexTags($text)\n {\n preg_match_all(\"/\\[([a-z0-9]+)(.*?)\\](.*?)\\[\\/\\\\1\\]/is\", $text, $matches);\n if (0 < count($matches[0])) {\n foreach ($matches[1] as $index => $match) {\n $replacement = null;\n $action = trim(strtolower($match));\n\n // if there is embed tags within the match we try to parse them\n if (false !== strpos($matches[3][$index], '[') && false !== strpos($matches[3][$index], ']')) {\n $replacement = $this->parseComplexTags($matches[3][$index]);\n\n // If we had a change\n if ($matches[3][$index] != $replacement) {\n $matches[3][$index] = $replacement;\n $text = str_replace($matches[0][$index], $replacement, $text);\n }\n }\n\n switch ($action) {\n case 'date':\n $text = str_replace($matches[0][$index], date('Y-m-d', strtotime($matches[3][$index])), $text);\n break;\n case 'div':\n case 'span':\n $text = str_replace($matches[0][$index], '<' . $action . $matches[2][$index] . '>' . $matches[3][$index] . '</' . $action . '>', $text);\n break;\n }\n }\n }\n\n return $text;\n }", "protected static function u_wrap ($data, $tag) {\n\t\t$in = $attributes = '';\n\t\tstatic::pre_processing($tag, $data);\n\t\tif (!static::data_prepare($data, $tag, $in, $attributes)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn \"<$tag$attributes>\".($in ? \" $in\" : '').\"\\n\";\n\t}", "function cs_safebalises($texte) {\r\n\t$texte = trim($texte);\r\n\t// ouvre/supprime la premiere balise trouvee fermee (attention aux modeles SPIP)\r\n\tif(preg_match(',^(.*)</([a-z]+)>,Ums', $texte, $m) && !preg_match(\",<$m[2][ >],\", $m[1])) \r\n\t\t$texte = strlen($m[1])?\"<$m[2]>$texte\":trim(substr($texte, strlen($m[2])+3));\r\n\t// referme/supprime la derniere balise laissee ouverte (attention aux modeles SPIP)\r\n\tif(preg_match(',^(.*)[ >]([a-z]+)<,Ums', $rev = strrev($texte), $m) && !preg_match(\",>$m[2]/<,\", $m[1])) \r\n\t\t$texte = strrev(strlen($m[1])?\">$m[2]/<$rev\":trim(substr($rev, strlen($m[2])+2)));\r\n\t// balises <p|span|div> a traiter\r\n\tforeach(array('span', 'div', 'p') as $b) {\r\n\t\t// ouvrante manquante\r\n\t\tif(($fin = strpos($texte, \"</$b>\")) !== false)\r\n\t\t\tif(!preg_match(\",<{$b}[ >],\", substr($texte, 0, $fin)))\r\n\t\t\t\t$texte = \"<$b>$texte\";\r\n\t\t// fermante manquante\r\n\t\t$texte = strrev($texte);\r\n\t\tif(preg_match(',[ >]'.strrev(\"<{$b}\").',', $texte, $reg)) {\r\n\t\t\t$fin = strpos(substr($texte, 0, $deb = strpos($texte, $reg[0])), strrev(\"</$b>\"));\r\n\t\t\tif($fin===false || $fin>$deb) $texte = strrev(\"</$b>\").$texte;\r\n\t\t}\r\n\t\t$texte = strrev($texte);\r\n\t}\r\n\treturn $texte;\r\n}", "function smarty_function_p_tag_this($params, &$smarty) \n{ \n if ($params['string']){\n\t\t$string = preg_replace_callback('#\\R+#', 'parseTagsRecursive', $params['string']); /* to be used to inject picures and or ads in the body. */\n $string = preg_replace('/\\n/', '', $string);\n $string = '<p>'.$string.'</p>';\n $result = $string;\n } else {$result = null;}\n\t\n if (isset($params['assign'])) {\n $smarty->assign($params['assign'], $result);\n } else {\n return $result;\n }\n}", "function ceto_fix_shortcodes($content){\n $array = array (\n '<p>[' => '[',\n ']</p>' => ']',\n ']<br />' => ']'\n );\n $content = strtr($content, $array);\n return $content;\n}", "function _parse($tags,$values,$text) {\n\t\tfor ($i = 0; $i<sizeof($tags); $i++) {\n\t\t\t\t$text = str_replace($tags[$i],$values[$i],$text);\n\t\t\t}\n\t\treturn $text;\n\t}", "public function render($tags);", "public function __invoke(array $params, \\Smarty_Internal_Template $smarty)\n {\n if (!isset($params['value'])) {\n return \"\";\n }\n $array = $params['value'];\n if (is_string($array)) {\n $array = \\Yana\\Files\\SML::decode($array);\n }\n $configuration = $this->_getDependencyContainer()->getTemplateConfiguration();\n $lDelim = $configuration['leftdelimiter'];\n assert(!empty($lDelim));\n $rDelim = $configuration['rightdelimiter'];\n assert(!empty($rDelim));\n if (is_array($array)) {\n $array = \\Yana\\Util\\Strings::htmlSpecialChars((string) \\Yana\\Files\\SML::encode($array));\n $replacement = '<span style=\"color: #35a;\">$1</span>$2<span style=\"color: #35a;\">$3</span>';\n\n $array = preg_replace('/(&lt;\\w[^&]*&gt;)(.*?)(&lt;\\/[^&]*&gt;)$/m', $replacement, $array);\n $replacement = '<span style=\"color: #607; font-weight: bold;\">$0</span>';\n $array = preg_replace('/&lt;[^&]+&gt;\\s*$/m', $replacement, $array);\n\n $pattern = '/' . preg_quote($lDelim, '/') . '\\$[\\w\\.\\-_]+' . preg_quote($rDelim, '/') . '/m';\n $array = preg_replace($pattern, '<span style=\"color: #080;\">$0</span>', $array);\n\n $array = preg_replace('/\\[\\/?[\\w\\=]+\\]/m', '<span style=\"color: #800;\">$0</span>', $array);\n $array = preg_replace('/&amp;\\w+;/m', '<span style=\"color: #880;\">$0</span>', $array);\n $array = \"<pre>{$array}</pre>\";\n }\n return (string) $array;\n }", "function bersihkan($string,$html=0,$tags=0,$quote=0) {\n if(is_array($string)) {\n foreach($string as $key => $val) {\n $string[$key] = bersihkan($val,$html,$tags,$quote);\n }\n $output = $string;\n }\n else {\n if($quote) {\n $output = str_replace(\"'\",\"\",$string);\n $output = str_replace('\"',\"\",$string);\n }\n else {\n $output = addslashes(trim($string));\n }\n \n if($tags==1) $output = strip_tags($output);\n if($html==1) $output = htmlspecialchars($output);\n }\n return $output;\n }", "function echo_term(\n $actcode, $showAll, $spanid, $hidetag, $currcharcount, $record, \n &$exprs = array()\n)\n{\n $actcode = (int)$record['Code'];\n if ($actcode > 1) {\n // A multiword, $actcode is the number of words composing it\n\t\tif (empty($exprs) || $exprs[sizeof($exprs)-1][1] != $record['TiText'])\n\t\t\t$exprs[] = array($actcode, $record['TiText'], $actcode);\n\n if (isset($record['WoID'])) {\n\n $attributes = array(\n\t\t\t\t'id' => $spanid,\n\t\t\t\t'class' => implode(\" \", [\n $hidetag, \"click\", \"mword\", ($showAll ? 'mwsty' : 'wsty'), \n \"order\" . $record['Ti2Order'],\n\t\t\t\t 'word' . $record['WoID'], 'status' . $record['WoStatus'], \n\t\t\t\t 'TERM' . strToClassName($record['TiTextLC'])]\n ),\n\t\t\t\t'data_pos' => $currcharcount,\n\t\t\t\t'data_order' => $record['Ti2Order'],\n\t\t\t\t'data_wid' => $record['WoID'],\n\t\t\t\t'data_trans' => tohtml(repl_tab_nl($record['WoTranslation']) . \n\t\t\t\tgetWordTagList($record['WoID'], ' ', 1, 0)),\n\t\t\t\t'data_rom' => tohtml($record['WoRomanization']),\n\t\t\t\t'data_status' => $record['WoStatus'],\n 'data_code' => $actcode,\n 'data_text' => tohtml($record['TiText'])\n );\n $span = '<span';\n foreach ($attributes as $attr_name => $val) {\n $span .= ' ' . $attr_name . '=\"' . $val . '\"';\n }\n $span .= '>'; \n if ($showAll) {\n $span .= $actcode;\n } else {\n $span .= tohtml($record['TiText']);\n }\n $span .= '</span>';\n echo $span;\n }\n } else {\n // Single word\n if (isset($record['WoID'])) {\n // Word found status 1-5|98|99\n\t\t\t$attributes = array(\n\t\t\t\t'id' => $spanid,\n\t\t\t\t'class' => implode(\" \", [\n $hidetag, \"click\", \"word\", \"wsty\", \"word\" . $record['WoID'],\n 'status' . $record['WoStatus'], \n 'TERM' . strToClassName($record['TiTextLC'])\n ]),\n\t\t\t\t'data_pos' => $currcharcount,\n\t\t\t\t'data_order' => $record['Ti2Order'],\n\t\t\t\t'data_wid' => $record['WoID'],\n\t\t\t\t'data_trans' => tohtml(repl_tab_nl($record['WoTranslation']) . \n\t\t\t\tgetWordTagList($record['WoID'], ' ', 1, 0)),\n\t\t\t\t'data_rom' => tohtml($record['WoRomanization']),\n\t\t\t\t'data_status' => $record['WoStatus']\n\t\t\t);\n } else {\n // Not registered word (status 0)\n\t\t\t$attributes = array(\n\t\t\t\t'id' => $spanid,\n\t\t\t\t'class' => implode(\" \", [\n $hidetag, \"click\", \"word\", \"wsty\", \"status0\", \n \"TERM\" . strToClassName($record['TiTextLC'])\n ]),\n\t\t\t\t'data_pos' => $currcharcount,\n\t\t\t\t'data_order' => $record['Ti2Order'],\n\t\t\t\t'data_trans' => '',\n\t\t\t\t'data_rom' => '',\n\t\t\t\t'data_status' => '0',\n\t\t\t\t'data_wid' => ''\n\t\t\t);\n }\n\t\tforeach ($exprs as $expr) {\n\t\t\t$attributes['data_mw' . $expr[0]] = tohtml($expr[1]);\n\t\t}\n $span = '<span';\n foreach ($attributes as $attr_name => $val) {\n $span .= ' ' . $attr_name . '=\"' . $val . '\"';\n\t\t}\n $span .= '>' . tohtml($record['TiText']) . '</span>';\n echo $span;\n\t\tfor ($i = sizeof($exprs) - 1; $i >= 0; $i--) {\n\t\t\t$exprs[$i][2]--;\n\t\t\tif ($exprs[$i][2] < 1) {\n\t\t\t\tunset($exprs[$i]);\n\t\t\t\t$exprs = array_values($exprs);\n\t\t\t}\n\t\t}\n }\n}", "function crumble_stdHLight($atts, $content = null) {\r\n\treturn '<span class=\"highlight\">' . do_shortcode ( $content ) . '</span>';\r\n}", "public function addTagToPostInTheMiddle() {}", "function wpwq_wrapper_add_type(){\r\n\tglobal $wpwq_wrapper_types;\r\n\t$wpwq_wrapper_types->add_type( array(\r\n\t\t'wpwq_wrapper' => array(\r\n\t\t\t'desc' => __('Following arguments will work with all wrappers.<br><br>\r\n\t\t\t\tExample: You want to strip all tags and shortcodes from the content and limit it to 55 characters? Paste this attribute in the [wrap_query] shortcode:<br>\r\n\t\t\t\twrapper_args=\\'{\"content_strip\":\"full\",\"content_limit\":\"55\"}\\'','wpwq'),\r\n\t\t\t'args' => array(\r\n\t\t\t\t'count_total' => array(\r\n\t\t\t\t\t'accepts' => 'int',\r\n\t\t\t\t\t'default' => '',\r\n\t\t\t\t\t'desc' => __('set by class','wpwq')\r\n\t\t\t\t\t),\r\n\t\t\t\t'content' => array(\r\n\t\t\t\t\t'accepts' => '\"none\"|\"excerpt\"|\"full\"',\r\n\t\t\t\t\t'default' => 'excerpt', \r\n\t\t\t\t\t'desc' => __('Whats the content?','wpwq')\r\n\t\t\t\t\t),\r\n\t\t\t\t'content_strip' => array(\r\n\t\t\t\t\t'accepts' => 'string|\"full\"',\r\n\t\t\t\t\t'default' => '\"shortcodes\"',\r\n\t\t\t\t\t'desc' => __('Accepts a string with comma seperated values: , \"none\", \"shortcodes\", \"style\", \"tags\".<br>\r\n\t\t\t\t\t\tOr a string with sinlge value \"full\" to strip all three.<br>\r\n\t\t\t\t\t\tNotice: Even when unstripped (\"none\"), the [wrap_query] shortcode will be stripped.','wpwq')\r\n\t\t\t\t\t),\r\n\t\t\t\t'content_limit' => array(\r\n\t\t\t\t\t'accepts' => 'false|int',\r\n\t\t\t\t\t'default' => 'false', \r\n\t\t\t\t\t'desc' => __('Number of characters in content. HTML tags will not be counted and the HTML Structure will be preserved.','wpwq')\r\n\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t)\r\n\t);\r\n}", "function template_text_format($text)\n {\n // Remove Escape Character Slashes\n $text = trim(stripslashes($text));\n // Get rid of carriage returns\n $text = str_replace(\"\\r\",\"\",$text);\n // Strip out all html except simple text formatting\n $text = htmlentities($text);\n // Convert urls to hyperlinks\n $text = eregi_replace(\"((http://)|(https://).[^\\s]+)\\ \",\"<a href=\\\"\\\\0\\\">\\\\0</a>\",$text); \n\n if ($_SESSION['prefs']['disable_wrap'] != \"t\") {\n $lines = explode(\"\\n\",$text);\n $text = \"\";\n\n $wrap = preg_match(\"/[0-9]+/\",$_SESSION['prefs']['word_wrap']) ? $_SESSION['prefs']['word_wrap'] : 80;\n foreach ($lines as $key => $val) {\n if (empty($val)) {\n $text .= \"\\n\";\n } else {\n if (strlen($val) > $wrap) {\n $val = wordwrap($val,$wrap,\"\\n\",TRUE);\n }\n\n $text .= stripslashes($val).\"\\n\";\n }\n }\n \n $text = \"<pre>$text</pre>\";\n } else {\n // Replace newlines with <br />'s\n $text = str_replace(\"\\n\",\"<br />\",$text);\n }\n return $text;\n }", "public static function html_tag_callback($matches)\n {\n $tagname = $matches[2];\n $tagname = preg_replace(array(\n '/:.*$/', // Microsoft's Smart Tags <st1:xxxx>\n '/[^a-z0-9_\\[\\]\\!?-]/i', // forbidden characters\n ), '', $tagname);\n\n // fix invalid closing tags - remove any attributes (#1489446)\n if ($matches[1] == '</') {\n $matches[3] = '';\n }\n\n return $matches[1] . $tagname . $matches[3];\n }", "function smarty_block_bracket($params, $content, &$smarty, &$repeat)\r\n{\r\n if(!$repeat)\r\n {\r\n if (isset($content)) \r\n {\r\n // do some intelligent translation thing here with $content\r\n return '{' . $content . '}';\r\n }\r\n }\r\n}", "function wrap_menu_imas() {\n \n // open the <ul>, set 'menu_class' and 'menu_id' values\n $wrap = '<ul id=\"%1$s\" class=\"%2$s nav navbar-nav\">';\n \n // get nav items as configured in /wp-admin/\n $wrap .= '%3$s';\n \n // close the <ul>\n $wrap .= '</ul>';\n // return the result\n return $wrap;\n}", "function tag($parts = [], $glue = \"\\n\") {\n foreach ($parts as $key => $part) {\n if (!is_array($part)) {\n $parts[$key] = [$part];\n }\n }\n\n $html = \"\";\n $it = new \\RecursiveIteratorIterator(new \\RecursiveArrayIterator($parts));\n\n foreach ($it as $key => $part) {\n $html .= $part . $glue;\n }\n\n return $html;\n}", "public function getOpenTagWrapper()\n {\n }", "function tagreplace_link($replace, $opentag, $tagoriginal, $closetag, $sign) {\n\n global $cfg, $defaults, $specialvars;\n\n $tagwert = $tagoriginal;\n // ------------------------------\n\n // tcpdf extra\n if ( $cfg[\"pdfc\"][\"state\"] == true ) {\n if ( !preg_match(\"/^http/\",$tagwert) ) {\n $tagwert = \"http://\".$_SERVER[\"SERVER_NAME\"].\"/\".$tagwert;\n }\n }\n\n if ( $sign == \"]\" ) {\n $ausgabewert = \"<a href=\\\"\".$tagwert.\"\\\" title=\\\"\".$tagwert.\"\\\">\".$tagwert.\"</a>\";\n $replace = str_replace($opentag.$tagoriginal.$closetag,$ausgabewert,$replace);\n } else {\n $tagwerte = explode(\"]\",$tagwert,2);\n $linkwerte = explode(\";\",$tagwerte[0]);\n $href = $linkwerte[0];\n if ( !isset($tagwerte[1]) ) {\n $beschriftung = $href;\n } else {\n $beschriftung = $tagwerte[1];\n }\n\n // ziel\n if ( isset($linkwerte[1]) ) {\n $target = \" target=\\\"\".$linkwerte[1].\"\\\"\";\n } else {\n $target = null;\n }\n\n // title-tag\n if ( isset($linkwerte[2]) ) {\n $title = $linkwerte[2];\n } else {\n if ( !isset($linkwerte[1]) ) $linkwerte[1] = null;\n if ( $linkwerte[1] == \"_blank\" ) {\n $title = \"Link in neuem Fenster: \".str_replace(\"http://\",\"\",$href);\n } elseif ( !strstr($beschriftung,\"<\") ) {\n $title = $beschriftung;\n } else {\n $title = null;\n }\n }\n\n // css-klasse\n $class = \" class=\\\"link_intern\";\n if ( preg_match(\"/^http/\",$href) ) { # automatik\n $class = \" class=\\\"link_extern\";\n } elseif ( preg_match(\"/^\".str_replace(\"/\",\"\\/\",$cfg[\"file\"][\"base\"][\"webdir\"]).\".*\\.([a-zA-Z]+)/\",$href,$match) ) {\n if ( $cfg[\"file\"][\"filetyp\"][$match[1]] != \"\" ) {\n $class = \" class=\\\"link_\".$cfg[\"file\"][\"filetyp\"][$match[1]];\n }\n }\n if ( isset($linkwerte[3]) ) { # oder manuell\n $class .= \" \".$linkwerte[3];\n }\n $class .= \"\\\"\";\n\n // id\n if ( isset($linkwerte[4]) ) {\n $id = \" id=\\\"\".$linkwerte[4].\"\\\"\";\n } else {\n $id = null;\n }\n\n if ( !isset($pic) ) $pic = null;\n $ausgabewert = $pic.\"<a href=\\\"\".$href.\"\\\"\".$id.$target.\" title=\\\"\".$title.\"\\\"\".$class.\">\".$beschriftung.\"</a>\";\n $replace = str_replace($opentag.$tagoriginal.$closetag,$ausgabewert,$replace);\n }\n\n // ------------------------------\n return $replace;\n }", "public function getShortcodeReplace();", "function code($texte)\r\n{\r\n//gras\r\n$texte = preg_replace('`\\[g\\](.+)\\[/g\\]`isU', '<strong>$1</strong>', $texte); \r\n//italique\r\n$texte = preg_replace('`\\[i\\](.+)\\[/i\\]`isU', '<em>$1</em>', $texte);\r\n//souligné\r\n$texte = preg_replace('`\\[s\\](.+)\\[/s\\]`isU', '<u>$1</u>', $texte);\r\n//lien\r\n$texte = preg_replace('#http://[a-z0-9._/-]+#i', '<a href=\"$0\">$0</a>', $texte);\r\n\r\n//On retourne la variable texte\r\nreturn $texte;\r\n}", "function formatos_layout($translation, $text, $context, $domain) {\n $names = array(\n 'Standard' => 'Texto',\n 'Aside' => 'Downloads',\n 'Gallery' => 'Menu categorização',\n 'Link' => 'Listagem de links',\n 'Image' => 'Listagem de revistas',\n );\n if ($context == 'Post format') {\n $translation = str_replace(array_keys($names), array_values($names), $text);\n }\n return $translation;\n}", "function sql_highlight(&$code)\n\n{\n\n $code = strtr($code, array('\"\"' => get_placeholder(9), \"''\" => get_placeholder(10)));\n\n $blocks = array(\n\n array(\n\n 'pattern' => \"#(['\\\"`])(\\\\\\\\\\\\\\\\|.*?([^\\\\\\\\]|[^\\\\\\\\](\\\\\\\\\\\\\\\\)+)|)\\\\1#se\",\n\n //'replacement' => 'parse_c_string(\\'$0\\', \\'sql\\', \\'|&quot;&quot;|\\\\\\'\\\\\\'\\')'\n\n //'pattern' => \"#(['\\\"])(.*?([^\\\\\\\\]|(\\\\\\\\\\\\\\\\)+)|)\\\\1#s\",\n\n 'prefix' => '<span class=\"sql_string\">', \n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => \"#/\\\\*(.*?)\\\\*/#s\",\n\n 'prefix' => '<span class=\"sql_blockcomment\">', \n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => \"#--(.*?)[\\n\\r]#\",\n\n 'prefix' => '<span class=\"sql_linecomment\">', \n\n 'suffix' => '</span>'\n\n ),\n\n );\n\n $secondaries = array(\n\n array(\n\n 'pattern' => '#(\\W|^)(\\.?[0-9][0-9a-zA-Z.]*)#i',\n\n 'replacement' => '<span class=\"sql_number\">$2</span>',\n\n 'keepprefix' => 1\n\n ),\n\n array(\n\n 'pattern' => '#([,\\[\\]\\{\\};=\\+\\-!%\\^&*\\(\\)<>|])#',\n\n 'prefix' => '<span class=\"sql_symbol\">',\n\n 'suffix' => '</span>'\n\n ),\n\n );\n\n \n\n $kw = array(\n\n array(\n\n 'prefix' => '<span '.get_placeholder(8).'=\"sql_keyword\">',\n\n 'suffix' => '</span>',\n\n 'keywords' => array('abs','absolute','access','acos','add','add_months','adddate','admin','after','aggregate','all','allocate','alter','and','any','app_name','are','array','as','asc','ascii','asin','assertion','at','atan','atn2','audit','authid','authorization','autonomous_transaction','avg','before','begin','benchmark','between','bfilename','bin','binary','binary_checksum','binary_integer','bit','bit_count','bit_and','bit_or','blob','body','boolean','both','breadth','bulk','by','call','cascade','cascaded','case','cast','catalog','ceil','ceiling','char','char_base','character','charindex','chartorowid','check','checksum','checksum_agg','chr','class','clob','close','cluster','coalesce','col_length','col_name','collate','collation','collect','column','comment','commit','completion','compress','concat','concat_ws','connect','connection','constant','constraint','constraints','constructorcreate','contains','containsable','continue','conv','convert','corr','corresponding','cos','cot','count','count_big','covar_pop','covar_samp','create','cross','cube','cume_dist','current','current_date','current_path','current_role','current_time','current_timestamp','current_user','currval','cursor','cycle','data','datalength','databasepropertyex','date','date_add','date_format','date_sub','dateadd','datediff','datename','datepart','day','db_id','db_name','deallocate','dec','declare','decimal','decode','default','deferrable','deferred','degrees','delete','dense_rank','depth','deref','desc','describe','descriptor','destroy','destructor','deterministic','diagnostics','dictionary','disconnect','difference','distinct','do','domain','double','drop','dump','dynamic','each','else','elsif','empth','encode','encrypt','end','end-exec','equals','escape','every','except','exception','exclusive','exec','execute','exists','exit','exp','export_set','extends','external','extract','false','fetch','first','first_value','file','float','floor','file_id','file_name','filegroup_id','filegroup_name','filegroupproperty','fileproperty','for','forall','foreign','format','formatmessage','found','freetexttable','from','from_days','fulltextcatalog','fulltextservice','function','general','get','get_lock','getdate','getansinull','getutcdate','global','go','goto','grant','greatest','group','grouping','having','heap','hex','hextoraw','host','host_id','host_name','hour','ident_incr','ident_seed','ident_current','identified','identity','if','ifnull','ignore','immediate','in','increment','index','index_col','indexproperty','indicator','initcap','initial','initialize','initially','inner','inout','input','insert','instr','instrb','int','integer','interface','intersect','interval','into','is','is_member','is_srvrolemember','is_null','is_numeric','isdate','isnull','isolation','iterate','java','join','key','lag','language','large','last','last_day','last_value','lateral','lcase','lead','leading','least','left','len','length','lengthb','less','level','like','limit','limited','ln','lpad','local','localtime','localtimestamp','locator','lock','log','log10','long','loop','lower','ltrim','make_ref','map','match','max','maxextents','mid','min','minus','minute','mlslabel','mod','mode','modifies','modify','module','month','months_between','names','national','natural','naturaln','nchar','nclob','new','new_time','newid','next','next_day','nextval','no','noaudit','nocompress','nocopy','none','not','nowait','null','nullif','number','number_base','numeric','nvl','nvl2','object','object_id','object_name','object_property','ocirowid','oct','of','off','offline','old','on','online','only','opaque','open','operator','operation','option','or','ord','order','ordinalityorganization','others','out','outer','output','package','pad','parameter','parameters','partial','partition','path','pctfree','percent_rank','pi','pls_integer','positive','positiven','postfix','pow','power','pragma','precision','prefix','preorder','prepare','preserve','primary','prior','private','privileges','procedure','public','radians','raise','rand','range','rank','ratio_to_export','raw','rawtohex','read','reads','real','record','recursive','ref','references','referencing','reftohex','relative','release','release_lock','rename','repeat','replace','resource','restrict','result','return','returns','reverse','revoke','right','rollback','rollup','round','routine','row','row_number','rowid','rowidtochar','rowlabel','rownum','rows','rowtype','rpad','rtrim','savepoint','schema','scroll','scope','search','second','section','seddev_samp','select','separate','sequence','session','session_user','set','sets','share','sign','sin','sinh','size','smallint','some','soundex','space','specific','specifictype','sql','sqlcode','sqlerrm','sqlexception','sqlstate','sqlwarning','sqrt','start','state','statement','static','std','stddev','stdev_pop','strcmp','structure','subdate','substr','substrb','substring','substring_index','subtype','successful','sum','synonym','sys_context','sys_guid','sysdate','system_user','table','tan','tanh','temporary','terminate','than','then','time','timestamp','timezone_abbr','timezone_minute','timezone_hour','timezone_region','to','to_char','to_date','to_days','to_number','to_single_byte','trailing','transaction','translate','translation','treat','trigger','trim','true','trunc','truncate','type','ucase','uid','under','union','unique','unknown','unnest','update','upper','usage','use','user','userenv','using','validate','value','values','var_pop','var_samp','varchar','varchar2','variable','variance','varying','view','vsize','when','whenever','where','with','without','while','with','work','write','year','zone')\n\n )\n\n );\n\n $code = generic_highlight($code, $blocks, $secondaries, array(), $kw);\n\n // put escapes back in\n\n return strtr($code, array(get_placeholder(9) => '<span class=\"sql_string\">&quot;&quot;</span>', get_placeholder(10) => '<span class=\"sql_string\">\\'\\'</span>'));\n\n}", "function translate_smiley($matches)\n {\n }", "function smarty_modifier_html_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false)\n{\n require_once SMARTY_PLUGINS_DIR.'modifier.truncate.php';\n\n if ($length == 0) {\n return '';\n }\n\n // strlen > $length\n if (!isset($string[$length])) {\n return $string;\n }\n\n // use original modifier when possible\n if (strpos($string, '<') === false) {\n return smarty_modifier_truncate($string, $length, $etc, $break_words, $middle);\n }\n\n // would it be short enough if we drop the tags from count?\n if (!isset(strip_tags($string)[$length])) {\n return $string;\n }\n\n // calculate the position to calculate the length and truncate using original function\n $parts = preg_split('#(<[^>]+>)#', $string, -1, PREG_SPLIT_OFFSET_CAPTURE | PREG_SPLIT_DELIM_CAPTURE);\n $reallength = 0;\n $taglength = 0;\n $lastpos = 0;\n foreach ($parts as $part) {\n $len = $part[1] - $lastpos;\n if (strpos($part[0], '<') === 0) {\n $reallength += $len;\n } else {\n $taglength += $len;\n }\n $lastpos = $part[1];\n\n if ($reallength >= $length) {\n $string = smarty_modifier_truncate($string, $length+$taglength, $etc, $break_words, $middle);\n break;\n }\n }\n\n // get all opening tags\n preg_match_all('#<([^/][^>]*)>#i', $string, $start_tags);\n $start_tags = $start_tags[1];\n\n // get all closing tags\n preg_match_all('#</([a-z]+)>#i', $string, $end_tags);\n $end_tags = $end_tags[1];\n\n // gather tags that need to be closed\n $need_close = [];\n foreach ($start_tags as $tag) {\n $pos = array_search($tag, $end_tags);\n if ($pos !== false) {\n unset($end_tags[$pos]);\n } else {\n $need_close[] = $tag;\n }\n } // foreach\n\n // close all remaining open tags in reverse order\n $need_close = array_reverse($need_close);\n foreach ($need_close as $tag) {\n $string .= '</'.$tag.'>';\n }\n\n return $string;\n}", "protected function do_shortcodes_in_html_tags($content, $ignore_html, $tagnames) { //-+\n\t\t// Normalize entities in unfiltered HTML before adding placeholders.\n\t\t$trans = array('&#91;' => '&#091;', '&#93;' => '&#093;');\n\t\t$content = strtr($content, $trans);\n\t\t$trans = array('[' => '&#91;', ']' => '&#93;');\n\t\n\t\t$pattern = $this->get_shortcode_regex($tagnames);\n\t\t$textarr = $this->wp_html_split($content);\n\t\n\t\tforeach ($textarr as &$element) {\n\t\t\tif ('' == $element || '<' !== $element[0]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t$noopen = false === strpos($element, '[');\n\t\t\t$noclose = false === strpos($element, ']');\n\t\t\tif ($noopen || $noclose) {\n\t\t\t\t// This element does not contain shortcodes.\n\t\t\t\tif ($noopen xor $noclose) {\n\t\t\t\t\t// Need to encode stray [ or ] chars.\n\t\t\t\t\t$element = strtr($element, $trans);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\tif ($ignore_html || '<!--' === substr($element, 0, 4) || '<![CDATA[' === substr($element, 0, 9)) {\n\t\t\t\t// Encode all [ and ] chars.\n\t\t\t\t$element = strtr($element, $trans);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t$attributes = $this->wp_kses_attr_parse($element);\n\t\t\tif (false === $attributes) {\n\t\t\t\t// Some plugins are doing things like [name] <[email]>.\n\t\t\t\tif (1 === preg_match('%^<\\s*\\[\\[?[^\\[\\]]+\\]%', $element)) {\n\t\t\t\t\t$element = preg_replace_callback(\"/$pattern/\", [$this, 'do_shortcode_tag'], $element);\n\t\t\t\t}\n\t\n\t\t\t\t// Looks like we found some crazy unfiltered HTML. Skipping it for sanity.\n\t\t\t\t$element = strtr($element, $trans);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t// Get element name\n\t\t\t$front = array_shift($attributes);\n\t\t\t$back = array_pop($attributes);\n\t\t\t$matches = array();\n\t\t\tpreg_match('%[a-zA-Z0-9]+%', $front, $matches);\n\t\t\t$elname = $matches[0];\n\t\n\t\t\t// Look for shortcodes in each attribute separately.\n\t\t\tforeach ($attributes as &$attr) {\n\t\t\t\t$open = strpos($attr, '[');\n\t\t\t\t$close = strpos($attr, ']');\n\t\t\t\tif (false === $open || false === $close) {\n\t\t\t\t\tcontinue; // Go to next attribute. Square braces will be escaped at end of loop.\n\t\t\t\t}\n\t\t\t\t$double = strpos($attr, '\"');\n\t\t\t\t$single = strpos($attr, \"'\");\n\t\t\t\tif ((false === $single || $open < $single) && (false === $double || $open < $double)) {\n\t\t\t\t\t// $attr like '[shortcode]' or 'name = [shortcode]' implies unfiltered_html.\n\t\t\t\t\t// In this specific situation we assume KSES did not run because the input\n\t\t\t\t\t// was written by an administrator, so we should avoid changing the output\n\t\t\t\t\t// and we do not need to run KSES here.\n\t\t\t\t\t$attr = preg_replace_callback(\"/$pattern/\", [$this, 'do_shortcode_tag'], $attr);\n\t\t\t\t} else {\n\t\t\t\t\t// $attr like 'name = \"[shortcode]\"' or \"name = '[shortcode]'\"\n\t\t\t\t\t// We do not know if $content was unfiltered. Assume KSES ran before shortcodes.\n\t\t\t\t\t$count = 0;\n\t\t\t\t\t$new_attr = preg_replace_callback(\"/$pattern/\", [$this, 'do_shortcode_tag'], $attr, -1, $count);\n\t\t\t\t\tif ($count > 0) {\n\t\t\t\t\t\t// Sanitize the shortcode output using KSES.\n//!!!\t\t\t\t\t\t$new_attr = wp_kses_one_attr($new_attr, $elname);\n\t\t\t\t\t\tif ('' !== trim($new_attr)) {\n\t\t\t\t\t\t\t// The shortcode is safe to use now.\n\t\t\t\t\t\t\t$attr = $new_attr;\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$element = $front . implode('', $attributes) . $back;\n\t\n\t\t\t// Now encode any remaining [ or ] chars.\n\t\t\t$element = strtr($element, $trans);\n\t\t}\n\t\n\t\t$content = implode('', $textarr);\n\t\n\t\treturn $content;\n\t}", "function replaceTag($tag, $paramstring) {\n # append a space to possible open tags; trim and strip html tags; \n # replace multiple spaces by one space; change a space between quotes to a tilde\n $paramstring = str_replace(\"<\", \" <\", $paramstring);\n $paramstring = str_replace(\", \", \",\", $paramstring);\n $paramstring = strip_tags(trim($paramstring));\n $paramstring = preg_replace(\"{[ \\t\\n\\r]+}\", ' ', $paramstring );\n\n # harder find-and-replace: find spaces between quotes: change them to tildes \n # the regexp can only change one space at a time: do it 10 times to be \"sure\" \n $pattern = \"/=\\\"([^\\\"]*)[ ]/\";\n $replacement = \"=\\\"$1~\";\n if ( preg_match( $pattern, $paramstring ) > 0 ) {\n for ( $i = 0; $i < 10; $i++ ) {\n $paramstring = preg_replace($pattern, $replacement, $paramstring); \n }\n }\n # echo \"<!-- \" . $paramstring . \"-->\"; \n\n $params = explode(\" \", trim($paramstring));\n $result = keyValueInterpreter($params);\n\n if ($tag == \"showall\") {\n navajoInclude($result);\n }\n if ($tag == \"showmessage\") {\n messageInclude($result);\n }\n if ($tag == \"showmethod\") {\n methodInclude($result);\n } \n if ($tag == \"//\") {\n echo \"<!-- \" . $paramstring . \"-->\";\n }\n if ($tag == \"element\") {\n propertyInclude($result);\n }\n if ($tag == \"label\") {\n descriptionInclude($result);\n }\n if ($tag == \"errors\") {\n errorMessageInclude($result);\n }\n if ($tag == \"table\") {\n tableInclude($result);\n }\n if ($tag == \"submit\") {\n submitInclude($result);\n }\n if ($tag == \"service\") {\n callService($result);\n }\n if ($tag == \"setvalue\") {\n valueInclude($result);\n }\n if ($tag == \"setusername\") {\n usernameInclude($result);\n }\n if ($tag == \"classsuffix\") {\n setClassSuffix($result);\n }\n print \"\\n\";\n}", "function yourls_esc_html__( $text, $domain = 'default' ) {\n\treturn yourls_esc_html( yourls_translate( $text, $domain ) );\n}", "public static function BBCode($Mixed) {\n if (!is_string($Mixed)) {\n return self::To($Mixed, 'BBCode');\n } else {\n // See if there is a custom BBCode formatter.\n $BBCodeFormatter = Gdn::Factory('BBCodeFormatter');\n if (is_object($BBCodeFormatter)) {\n $Result = $BBCodeFormatter->Format($Mixed);\n $Result = Gdn_Format::Links($Result);\n $Result = Gdn_Format::Mentions($Result);\n\n return $Result;\n }\n\n $Formatter = Gdn::Factory('HtmlFormatter');\n if (is_null($Formatter)) {\n return Gdn_Format::Display($Mixed);\n } else {\n\t\t\t\ttry {\n\t\t\t\t\t$Mixed2 = $Mixed;\n\t\t\t\t\t//$Mixed2 = str_replace(\"\\n\", '<br />', $Mixed2);\n\n $Mixed2 = preg_replace(\"#\\[b\\](.*?)\\[/b\\]#si\",'<b>\\\\1</b>',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[i\\](.*?)\\[/i\\]#si\",'<i>\\\\1</i>',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[u\\](.*?)\\[/u\\]#si\",'<u>\\\\1</u>',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[s\\](.*?)\\[/s\\]#si\",'<s>\\\\1</s>',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[quote=[\\\"']?(.*?)[\\\"']?\\](.*?)\\[/quote\\]#si\",'<p><cite>\\\\1</cite>:</p><blockquote>\\\\2</blockquote>',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[quote\\](.*?)\\[/quote\\]#si\",'<blockquote>\\\\1</blockquote>',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[cite\\](.*?)\\[/cite\\]#si\",'<blockquote>\\\\1</blockquote>',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[code\\](.*?)\\[/code\\]#si\",'<code>\\\\1</code>',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[hide\\](.*?)\\[/hide\\]#si\",'\\\\1',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[url\\]([^/]*?)\\[/url\\]#si\",'<a href=\"http://\\\\1\">\\\\1</a>',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[url\\](.*?)\\[/url\\]#si\",'\\\\1',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[url=[\\\"']?(.*?)[\\\"']?\\](.*?)\\[/url\\]#si\",'<a href=\"\\\\1\">\\\\2</a>',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[php\\](.*?)\\[/php\\]#si\",'<code>\\\\1</code>',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[mysql\\](.*?)\\[/mysql\\]#si\",'<code>\\\\1</code>',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[css\\](.*?)\\[/css\\]#si\",'<code>\\\\1</code>',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[img=[\\\"']?(.*?)[\\\"']?\\](.*?)\\[/img\\]#si\",'<img src=\"\\\\1\" alt=\"\\\\2\" />',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[img\\](.*?)\\[/img\\]#si\",'<img src=\"\\\\1\" border=\"0\" />',$Mixed2);\n $Mixed2 = str_ireplace(array('[indent]', '[/indent]'), array('<div class=\"Indent\">', '</div>'), $Mixed2);\n\n $Mixed2 = preg_replace(\"#\\[font=[\\\"']?(.*?)[\\\"']?\\]#i\",'<span style=\"font-family:\\\\1;\">',$Mixed2);\n $Mixed2 = preg_replace(\"#\\[color=[\\\"']?(.*?)[\\\"']?\\]#i\",'<span style=\"color:\\\\1\">',$Mixed2);\n $Mixed2 = str_ireplace(array(\"[/size]\", \"[/font]\", \"[/color]\"), \"</span>\", $Mixed2);\n\n $Mixed2 = preg_replace(\"#\\[size=[\\\"']?(.*?)[\\\"']?\\]#si\",'<font size=\"\\\\1\">',$Mixed2);\n $Mixed2 = str_ireplace('[/font]', '</font>', $Mixed2);\n\n $Mixed2 = preg_replace('#\\[/?left\\]#si', '', $Mixed2);\n $Mixed2 = Gdn_Format::Links($Mixed2);\n $Mixed2 = Gdn_Format::Mentions($Mixed2);\n\t\t\t\t\t$Result = Gdn_Format::Html($Mixed2);\n\t\t\t\t\treturn $Result;\n\t\t\t\t} catch(Exception $Ex) {\n\t\t\t\t\treturn self::Display($Mixed);\n\t\t\t\t}\n }\n }\n }", "public function provideBlockTagConversionTests() {\n $result = [\n [[\n 'descr' => \"[rule] produces a horizontal rule.\",\n 'bbcode' => \"This is a test of the [rule] emergency broadcasting system.\",\n 'html' => \"This is a test of the\\n<hr class=\\\"bbcode_rule\\\" />\\nemergency broadcasting system.\",\n ]],\n [[\n 'descr' => \"[br] is equivalent to a newline.\",\n 'bbcode' => \"This is a newline. [br] And here we are! \\n And more!\",\n 'html' => \"This is a newline.<br>\\nAnd here we are!<br>\\nAnd more!\",\n ]],\n [[\n 'descr' => \"[center]...[/center] should produce centered alignment.\",\n 'bbcode' => \"Not centered.[center]A [b]bold[/b] stone gathers no italics.[/center]Not centered.\",\n 'html' => \"Not centered.\\n\"\n . \"<div class=\\\"bbcode_center\\\" style=\\\"text-align:center\\\">\\n\"\n . \"A <b>bold</b> stone gathers no italics.\\n\"\n . \"</div>\\n\"\n . \"Not centered.\",\n ]],\n [[\n 'descr' => \"[left]...[/left] should produce left alignment.\",\n 'bbcode' => \"Not left.[left]A [b]bold[/b] stone gathers no italics.[/left]Not left.\",\n 'html' => \"Not left.\\n\"\n . \"<div class=\\\"bbcode_left\\\" style=\\\"text-align:left\\\">\\n\"\n . \"A <b>bold</b> stone gathers no italics.\\n\"\n . \"</div>\\n\"\n . \"Not left.\",\n ]],\n [[\n 'descr' => \"[right]...[/right] should produce right alignment.\",\n 'bbcode' => \"Not right.[right]A [b]bold[/b] stone gathers no italics.[/right]Not right.\",\n 'html' => \"Not right.\\n\"\n . \"<div class=\\\"bbcode_right\\\" style=\\\"text-align:right\\\">\\n\"\n . \"A <b>bold</b> stone gathers no italics.\\n\"\n . \"</div>\\n\"\n . \"Not right.\",\n ]],\n [[\n 'descr' => \"[indent]...[/indent] should produce indented content.\",\n 'bbcode' => \"Not indented.[indent]A [b]bold[/b] stone gathers no italics.[/indent]Not indented.\",\n 'html' => \"Not indented.\\n\"\n . \"<div class=\\\"bbcode_indent\\\" style=\\\"margin-left:4em\\\">\\n\"\n . \"A <b>bold</b> stone gathers no italics.\\n\"\n . \"</div>\\n\"\n . \"Not indented.\",\n ]],\n [[\n 'descr' => \"[code]...[/code] should reproduce its contents exactly as they're given.\",\n 'bbcode' => \"Not code.\"\n . \"[code]A [b]and[/b] & <woo>!\\n\\tAnd a ['hey'] and a [/nonny] and a ho ho ho![/code]\"\n . \"Also not code.\",\n 'html' => \"Not code.\"\n . \"\\n<div class=\\\"bbcode_code\\\">\\n\"\n . \"<div class=\\\"bbcode_code_head\\\">Code:</div>\\n\"\n . \"<div class=\\\"bbcode_code_body\\\" style=\\\"white-space:pre\\\">A [b]and[/b] &amp; &lt;woo&gt;!\\n\"\n . \"\\tAnd a ['hey'] and a [/nonny] and a ho ho ho!</div>\\n\"\n . \"</div>\\n\"\n . \"Also not code.\",\n ]],\n [[\n 'descr' => \"[code]...[/code] should reproduce PHP source code undamaged.\",\n 'bbcode' => \"Not code.\\n\"\n . \"[code]\\n\"\n . \"\\$foo['bar'] = 42;\\n\"\n . \"if (\\$foo[\\\"bar\\\"] < 42) \\$foo[] = 0;\\n\"\n . \"[/code]\\n\"\n . \"Also not code.\\n\",\n 'html' => \"Not code.\"\n . \"\\n<div class=\\\"bbcode_code\\\">\\n\"\n . \"<div class=\\\"bbcode_code_head\\\">Code:</div>\\n\"\n . \"<div class=\\\"bbcode_code_body\\\" style=\\\"white-space:pre\\\">\\$foo['bar'] = 42;\\n\"\n . \"if (\\$foo[&quot;bar&quot;] &lt; 42) \\$foo[] = 0;</div>\\n\"\n . \"</div>\\n\"\n . \"Also not code.<br>\\n\",\n ]],\n [[\n 'descr' => \"<code>...</code> should not misbehave in '<' tag marker mode.\",\n 'bbcode' => \"Not code.\"\n . \"<code>A <b>and</b> & <woo>!\\n\\tAnd a [hey] and a [/nonny] and a ho ho ho!</code>\"\n . \"Also not code.\",\n 'html' => \"Not code.\"\n . \"\\n<div class=\\\"bbcode_code\\\">\\n\"\n . \"<div class=\\\"bbcode_code_head\\\">Code:</div>\\n\"\n . \"<div class=\\\"bbcode_code_body\\\" style=\\\"white-space:pre\\\">A &lt;b&gt;and&lt;/b&gt; &amp; &lt;woo&gt;!\\n\"\n . \"\\tAnd a [hey] and a [/nonny] and a ho ho ho!</div>\\n\"\n . \"</div>\\n\"\n . \"Also not code.\",\n 'tag_marker' => '<',\n ]],\n [[\n 'descr' => \"[quote]...[/quote] should produce a plain quote.\",\n 'bbcode' => \"Outside the quote.\"\n . \"[quote]A [b]and[/b] & <woo>!\\n\\tAnd a [hey] and a [/nonny] and a ho ho ho![/quote]\"\n . \"Also outside the quote.\",\n 'html' => \"Outside the quote.\"\n . \"\\n<div class=\\\"bbcode_quote\\\">\\n\"\n . \"<div class=\\\"bbcode_quote_head\\\">Quote:</div>\\n\"\n . \"<div class=\\\"bbcode_quote_body\\\">A <b>and</b> &amp; &lt;woo&gt;!<br>\\n\"\n . \"And a [hey] and a [/nonny] and a ho ho ho!</div>\\n\"\n . \"</div>\\n\"\n . \"Also outside the quote.\",\n ]],\n [[\n 'descr' => \"Multiple nested [quote]...[/quote] tags should produce nested quotes.\",\n 'bbcode' => \"text0\\n[quote]\\n[quote]\\n[quote]text1[/quote]\\ntext2[/quote]\\ntext3[/quote]\\ntext4\",\n 'html' => \"text0\"\n . \"\\n<div class=\\\"bbcode_quote\\\">\\n\"\n . \"<div class=\\\"bbcode_quote_head\\\">Quote:</div>\\n\"\n . \"<div class=\\\"bbcode_quote_body\\\">\"\n . \"\\n<div class=\\\"bbcode_quote\\\">\\n\"\n . \"<div class=\\\"bbcode_quote_head\\\">Quote:</div>\\n\"\n . \"<div class=\\\"bbcode_quote_body\\\">\"\n . \"\\n<div class=\\\"bbcode_quote\\\">\\n\"\n . \"<div class=\\\"bbcode_quote_head\\\">Quote:</div>\\n\"\n . \"<div class=\\\"bbcode_quote_body\\\">\"\n . \"text1\"\n . \"</div>\\n\"\n . \"</div>\\n\"\n . \"text2\"\n . \"</div>\\n\"\n . \"</div>\\n\"\n . \"text3\"\n . \"</div>\\n\"\n . \"</div>\\n\"\n . \"text4\",\n ]],\n [[\n 'descr' => \"Multiple nested [quote]...[/quote] tags should produce nested quotes.\",\n 'bbcode' => \"[quote]\\n[quote]\\n[quote]text1[/quote]\\ntext2[/quote]\\ntext3[/quote]\\ntext4 :) text5 :o text6 :o\",\n 'html' => \"\\n<div class=\\\"bbcode_quote\\\">\\n\"\n . \"<div class=\\\"bbcode_quote_head\\\">Quote:</div>\\n\"\n . \"<div class=\\\"bbcode_quote_body\\\">\"\n . \"\\n<div class=\\\"bbcode_quote\\\">\\n\"\n . \"<div class=\\\"bbcode_quote_head\\\">Quote:</div>\\n\"\n . \"<div class=\\\"bbcode_quote_body\\\">\"\n . \"\\n<div class=\\\"bbcode_quote\\\">\\n\"\n . \"<div class=\\\"bbcode_quote_head\\\">Quote:</div>\\n\"\n . \"<div class=\\\"bbcode_quote_body\\\">\"\n . \"text1\"\n . \"</div>\\n\"\n . \"</div>\\n\"\n . \"text2\"\n . \"</div>\\n\"\n . \"</div>\\n\"\n . \"text3\"\n . \"</div>\\n\"\n . \"</div>\\n\"\n . \"text4 <img src=\\\"smileys/smile.gif\\\" alt=\\\":)\\\" title=\\\":)\\\" class=\\\"bbcode_smiley\\\" /> text5 :o text6 :o\",\n ]],\n [[\n 'descr' => \"[quote=John]...[/quote] should produce a quote from John.\",\n 'bbcode' => \"Outside the quote.\"\n . \"[quote=John]A [b]and[/b] & <woo>!\\n\\tAnd a [hey] and a [/nonny] and a ho ho ho![/quote]\"\n . \"Also outside the quote.\",\n 'html' => \"Outside the quote.\"\n . \"\\n<div class=\\\"bbcode_quote\\\">\\n\"\n . \"<div class=\\\"bbcode_quote_head\\\">John wrote:</div>\\n\"\n . \"<div class=\\\"bbcode_quote_body\\\">A <b>and</b> &amp; &lt;woo&gt;!<br>\\n\"\n . \"And a [hey] and a [/nonny] and a ho ho ho!</div>\\n\"\n . \"</div>\\n\"\n . \"Also outside the quote.\",\n ]],\n [[\n 'descr' => \"[quote=\\\"John Smith\\\"]...[/quote] should produce a quote from John Smith.\",\n 'bbcode' => \"Outside the quote.\"\n . \"[quote=\\\"John Smith\\\"]A [b]and[/b] & <woo>!\\n\\tAnd a [hey] and a [/nonny] and a ho ho ho![/quote]\"\n . \"Also outside the quote.\",\n 'html' => \"Outside the quote.\"\n . \"\\n<div class=\\\"bbcode_quote\\\">\\n\"\n . \"<div class=\\\"bbcode_quote_head\\\">John Smith wrote:</div>\\n\"\n . \"<div class=\\\"bbcode_quote_body\\\">A <b>and</b> &amp; &lt;woo&gt;!<br>\\n\"\n . \"And a [hey] and a [/nonny] and a ho ho ho!</div>\\n\"\n . \"</div>\\n\"\n . \"Also outside the quote.\",\n ]],\n [[\n 'descr' => \"[quote name= date= url=]...[/quote] should produce a detailed quote.\",\n 'bbcode' => \"Outside the quote.\"\n . \"[quote name=\\\"John Smith\\\" date=\\\"July 4, 1776\\\" url=\\\"http://www.constitution.gov\\\"]We hold these truths to be self-evident...[/quote]\"\n . \"Also outside the quote.\",\n 'html' => \"Outside the quote.\"\n . \"\\n<div class=\\\"bbcode_quote\\\">\\n\"\n . \"<div class=\\\"bbcode_quote_head\\\"><a href=\\\"http://www.constitution.gov\\\">John Smith wrote on July 4, 1776:</a></div>\\n\"\n . \"<div class=\\\"bbcode_quote_body\\\">We hold these truths to be self-evident...</div>\\n\"\n . \"</div>\\n\"\n . \"Also outside the quote.\",\n ]],\n [[\n 'descr' => \"[quote name= date= url=]...[/quote] should disallow bad URLs.\",\n 'bbcode' => \"Outside the quote.\"\n . \"[quote name=\\\"John Smith\\\" date=\\\"July 4, 1776\\\" url=\\\"javascript:alert()\\\"]We hold these truths to be self-evident...[/quote]\"\n . \"Also outside the quote.\",\n 'html' => \"Outside the quote.\"\n . \"\\n<div class=\\\"bbcode_quote\\\">\\n\"\n . \"<div class=\\\"bbcode_quote_head\\\">John Smith wrote on July 4, 1776:</div>\\n\"\n . \"<div class=\\\"bbcode_quote_body\\\">We hold these truths to be self-evident...</div>\\n\"\n . \"</div>\\n\"\n . \"Also outside the quote.\",\n ]],\n [[\n 'descr' => \"[quote=\\\"<script>javascript:alert()</script>\\\"] should not produce Javascript.\",\n 'bbcode' => \"Outside the quote.\"\n . \"[quote=\\\"<script>javascript:alert()</script>\\\"]A [b]and[/b] & <woo>!\\n\\tAnd a [hey] and a [/nonny] and a ho ho ho![/quote]\"\n . \"Also outside the quote.\",\n 'html' => \"Outside the quote.\"\n . \"\\n<div class=\\\"bbcode_quote\\\">\\n\"\n . \"<div class=\\\"bbcode_quote_head\\\">&lt;script&gt;javascript:alert()&lt;/script&gt; wrote:</div>\\n\"\n . \"<div class=\\\"bbcode_quote_body\\\">A <b>and</b> &amp; &lt;woo&gt;!<br>\\n\"\n . \"And a [hey] and a [/nonny] and a ho ho ho!</div>\\n\"\n . \"</div>\\n\"\n . \"Also outside the quote.\",\n ]],\n [[\n 'descr' => \"[columns] should produce columns.\",\n 'bbcode' => \"Before the columns.\"\n . \"[columns]This is a test.[nextcol]This is [b]beside[/b] it.[nextcol]This is [i]also[/i] beside it.[/columns]\"\n . \"After the columns.\",\n 'html' => \"Before the columns.\"\n . \"\\n<table class=\\\"bbcode_columns\\\"><tbody><tr><td class=\\\"bbcode_column bbcode_firstcolumn\\\">\\n\"\n . \"This is a test.\"\n . \"\\n</td><td class=\\\"bbcode_column\\\">\\n\"\n . \"This is <b>beside</b> it.\"\n . \"\\n</td><td class=\\\"bbcode_column\\\">\\n\"\n . \"This is <i>also</i> beside it.\"\n . \"\\n</td></tr></tbody></table>\\n\"\n . \"After the columns.\",\n ]],\n [[\n 'descr' => \"[nextcol] doesn't do anything outside a [columns] block.\",\n 'bbcode' => \"Here's some text.[nextcol]\\nHere's some more.\\n\",\n 'html' => \"Here's some text.[nextcol]<br>\\nHere's some more.<br>\\n\",\n ]],\n [[\n 'descr' => \"Bad column misuse doesn't break layouts.\",\n 'bbcode' => \"[center][columns]This is a test.[nextcol]This is also a [b]test[/b].[/center][/columns]\",\n 'html' => \"\\n<div class=\\\"bbcode_center\\\" style=\\\"text-align:center\\\">\\n\"\n . \"\\n<table class=\\\"bbcode_columns\\\"><tbody><tr><td class=\\\"bbcode_column bbcode_firstcolumn\\\">\\n\"\n . \"This is a test.\"\n . \"\\n</td><td class=\\\"bbcode_column\\\">\\n\"\n . \"This is also a <b>test</b>.\"\n . \"\\n</td></tr></tbody></table>\\n\"\n . \"\\n</div>\\n\",\n ]],\n ];\n return $result;\n }", "protected function do_shortcode_tag($m) { //+\n\t\t// allow [[foo]] syntax for escaping a tag\n\t\tif ($m[1] == '[' && $m[6] == ']') {\n\t\t\treturn substr($m[0], 1, -1);\n\t\t}\n\t\n\t\t$tag = $m[2];\n\t\t$attr = $this->shortcode_parse_atts($m[3]);\n\t\n\t\tif (! is_callable($this->arShortcodes[ $tag ])) {\n\t\t\t/* translators: %s: shortcode tag */\n\t\t\tthrow new \\Exception(sprintf('Attempting to parse a shortcode without a valid callback: %s', $tag));\n\t\t\treturn $m[0];\n\t\t}\n\t\n\t\t/**\n\t\t * Filters whether to call a shortcode callback.\n\t\t *\n\t\t * Passing a truthy value to the filter will effectively short-circuit the\n\t\t * shortcode generation process, returning that value instead.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param bool|string $return Short-circuit return value. Either false or the value to replace the shortcode with.\n\t\t * @param string $tag Shortcode name.\n\t\t * @param array|string $attr Shortcode attributes array or empty string.\n\t\t * @param array $m Regular expression match array.\n\t\t */\n\t\t /*\n!!!\t\t$return = apply_filters('pre_do_shortcode_tag', false, $tag, $attr, $m);\n\t\tif (false !== $return) {\n\t\t\treturn $return;\n\t\t}*/\n\t\n\t\t$content = isset($m[5]) ? $m[5] : null;\n\t\n\t\t$output = $m[1] . call_user_func($this->arShortcodes[ $tag ], $attr, $content, $tag) . $m[6];\n\t\n\t\t/**\n\t\t * Filters the output created by a shortcode callback.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param string $output Shortcode output.\n\t\t * @param string $tag Shortcode name.\n\t\t * @param array|string $attr Shortcode attributes array or empty string.\n\t\t * @param array $m Regular expression match array.\n\t\t */\n\t\t /*\n!!!\t\treturn apply_filters('do_shortcode_tag', $output, $tag, $attr, $m);*/\n\t\treturn $output;\n\t}", "function venus_structural_wrap( $output, $original_output ) {\n\n\tswitch ( $original_output ) {\n\t\tcase 'open':\n\t\t\t$output = '<div class=\"container\"><div class=\"row\">';\n\t\t\tbreak;\n\t\tcase 'close':\n\t\t\t$output = '</div></div>';\n\t\t\tbreak;\n\t}\n\n\treturn $output;\n}", "public function wrap($content, $wrap, $char = '|')\n\t{\n\t\tif ($wrap) {\n\t\t\t$wrapArr = explode($char, $wrap);\n\t\t\treturn trim($wrapArr[0]) . $content . trim($wrapArr[1]);\n\t\t} else return $content;\n\t}", "public function formatTags($tags=array()) {\n if (is_array($tags)) {\n foreach ($tags as $key => $tag) {\n $tag = strtolower($tag);\n $tags[$key] = preg_replace('/[\\W]+/', '_', $tag);\n }\n return $tags;\n }\n else return false;\n }", "function smarty_function_mtbloglanguage($args, &$ctx) {\n $real_lang = array('cz' => 'cs', 'dk' => 'da', 'jp' => 'ja', 'si' => 'sl');\n $blog = $ctx->stash('blog');\n $lang_tag = $blog->blog_language;\n if ($real_lang[$lang_tag]) {\n $lang_tag = $real_lang[$lang_tag];\n }\n if ($args['locale']) {\n $lang_tag = preg_replace('/^([A-Za-z][A-Za-z])([-_]([A-Za-z][A-Za-z]))?$/e', '\\'$1\\' . \"_\" . (\\'$3\\' ? strtoupper(\\'$3\\') : strtoupper(\\'$1\\'))', $lang_tag);\n } elseif ($args['ietf']) {\n # http://www.ietf.org/rfc/rfc3066.txt\n $lang_tag = preg_replace('/_/', '-', $lang_tag);\n }\n return $lang_tag;\n}", "private function _formatText($tag, $content)\n\t{\n\t\tif ( !array_key_exists($tag, $this->_formatRules) ) $tag = 'default';\n\t\t\n\t\t// search format rules array for 'list' format rule and save array key if found\n\t\tforeach ($this->_formatRules[$tag] as $key => $item) {\n\t\t\tif ( is_array($item) && array_key_exists('list', $item) ) {\n\t\t\t\t$listkey = $key;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// save $content to $text, imploding it to a string first if it's an array\n\t\t// for implode, use specified delimiter if found or default to ', '\n\t\tif (is_array($content)) {\n\t\t\tif ( (!isset($listkey)) || (empty($this->_formatRules[$tag][$listkey]['list'])) ) {\n\t\t\t\t$delimiter = ', ';\n\t\t\t} else {\n\t\t\t\t$delimiter = $this->_formatRules[$tag][$listkey]['list'];\n\t\t\t}\n\t\t\t$text = implode($delimiter, $content);\n\t\t} else {\n\t\t\t$text = $content;\n\t\t}\n\t\t\n\t\t// run though format rules in order\n\t\tif (in_array('no-format', $this->_formatRules[$tag])) {\n\t\t\treturn $text; // 'no-format' overrides all other text formatting\n\t\t} else {\n\t\t\tif (in_array('markdown', $this->_formatRules[$tag])) $text = Markdown($text);\n\t\t\tif (in_array('url', $this->_formatRules[$tag])) $text = MarkdownUrl($text);\n\t\t\tif (in_array('smart', $this->_formatRules[$tag])) $text = SmartyPants($text);\n\t\t\t$text = amputator($text);\n\t\t\tif (in_array('widows', $this->_formatRules[$tag])) {\n\t\t\t\tif(preg_match(\"/<p>(.*)<\\/p>/i\", $text)) {\n\t\t\t\t preg_match_all(\"/<p>(.*?)<\\/p>/i\", $text, $widowarr);\n\t\t\t\t $text = '';\n\t\t\t\t foreach ($widowarr[0] as $graf) {\n\t\t\t\t \t$text .= widont($graf);\n\t\t\t\t }\n\t\t\t\t} else {\n\t\t\t\t\t$text = widont($text);\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $text;\n\t\t}\n\n\t}", "public function getHTML() {\n\t $markup = '';\n\n\t // open tags as required \n\t if($this->isBolded) {\n\t // add strong tag\n\t $markup .= '<strong>'; \n\t }\n\t\tif($this->isItalics) {\n\t // add emphisis tag\n\t $markup .= '<em>'; \n\t } \n\t\tif($this->isStrikethrough) {\n\t // add ?? tag\n\t } \n\t\tif($this->isUnderlined) {\n\t // add span tag with text decoration for underline\n\t $markup .= '<span style=\"text-decoration: underline;\">';\n\t }\n\n // add span tag to define color\n $markup .= '<span style=\"color: #' . $this->colour . ';\">';\n \n // TODO: add logic so the style is reused for each\n \n\t\t// add the text \n $markup .= $this->text;\n\n // add close tag for colour applicatoin\n $markup .= '</span>';\n\n // close tags as required\n\t if($this->isBolded) {\n\t // add close strong tag\n\t $markup .= '</strong>'; \n\t }\n\t\tif($this->isItalics) {\n\t // add close emphisis tag\n\t $markup .= '</em>'; \n\t } \n\t\tif($this->isStrikethrough) {\n\t // add close ?? tag \n\t } \n\t\tif($this->isUnderlined) {\n\t // add close span tag\n\t $markup .= '</span>';\n\t }\n\n\t\treturn $markup;\n\t}", "function kalatheme_icon_default_settings(){\n return array(\n 'tag' => 'span'\n );\n}", "private static function _escapeTagChar($matches) {}", "function l($text,$echo=true)\n{\n\tglobal $translate;\n\tglobal $notrans;\n\tif (TRANSLATE_DEBUG)\n\t{\n\t\t/*\n\t\t// DEBUG\n\t\t*/\n\t\tif (isset($translate[$text])) \n\t\t\tif ($translate[$text]==\"=\")\t$trans='<span class=\\'igual\\'>'.$text.'</span>';\n\t\t\telse $trans='<span class=\\'translated\\'>'.$translate[$text].'</span>';\n\t\telse $trans=TRANSLATE_NO_TRANS.'<span class=\\'no-trans\\'>'.$text.'</span>';\n\t}\n\telse\n\t{\n\t\tif (isset($translate[$text])) \n\t\t{\n\t\t\tif ($translate[$text]==\"=\")\t$trans=$text;\n\t\t\telse $trans=$translate[$text];\n\t\t}\n\t\telse $trans=$text;\n\t}\n\t//echo \"---$text - \".(isset($translate[$text])?\"ok\":\"ko\").\" > \";\n\tif ($echo) echo $trans;\n\t\n\treturn ($trans);\n}", "function my_formatter( $content ) {\n\n\t\t$new_content = '';\n\t\t$pattern_full = '{(\\[raw\\].*?\\[/raw\\])}is';\n\t\t$pattern_contents = '{\\[raw\\](.*?)\\[/raw\\]}is';\n\t\t$pieces = preg_split( $pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE );\n\n\t\tforeach ( $pieces as $piece ) {\n\n\t\t\tif ( preg_match( $pattern_contents, $piece, $matches ) ) {\n\t\t\t\t$new_content .= $matches[1];\n\t\t\t} else {\n\t\t\t\t$new_content .= wptexturize( wpautop( $piece ) );\n\t\t\t}\n\n\t\t}\n\n\t\treturn $new_content;\n\n\t}", "public function lnParse($ln) {\n $html = FALSE;\n if (isset($ln[$this->indt])) {\n $ln_attrib_sym = $ln[$this->indt];\n if ($html = $this->lnAttribChk($ln, $ln_attrib_sym, TRUE)) {\n # Placeholder...\n } elseif ($ln[$this->indt] === self::HAML_ELE) {\n $ln = trim(substr_replace($ln, NULL, $this->indt, 1));\n $line_ws_pos = strpos($ln, ' '); # IDK if this is even needed at the moment...\n # This is temporary & uber hacky...\n $ln_ele_nme = $ln;\n\n $cur_attrib_str = $cur_attrib_nme = FALSE;\n if ($attrib_ar = $this->lnAttribParse($ln)) {\n $cur_attrib_sym = $attrib_ar['attrib_str'][0];\n $cur_attrib_nme = $this->haml_ele_attribs_ar[$cur_attrib_sym];\n $cur_attrib_val = ltrim(substr_replace($attrib_ar['attrib_str'], NULL, 0, 1));\n $cur_attrib_str = $cur_attrib_nme . '=\"' . $cur_attrib_val . '\"';\n $ln_ele_nme = ltrim(substr_replace($ln_ele_nme, NULL, stripos($ln_ele_nme, $cur_attrib_sym)));\n }\n if (in_array($ln_ele_nme, $this->haml_ele_autoclose_ar)) {\n $html .= '<' . $ln_ele_nme . ($cur_attrib_str? ' ' . $cur_attrib_str : NULL) . '>' . (self::EOL());\n } else {\n # The string one space after the detected element is the content wrapped inside...\n $html .= '<' . $ln_ele_nme . ($cur_attrib_str? ' ' . $cur_attrib_str : NULL) . '>' . '<' . $ln_ele_nme . '>' . (self::EOL());\n }\n }\n }\n return $html;\n }", "function enhance_wp_tag_cloud($content) {\r\n\treturn '<p align=\"center\">' . $content . '</p>';\r\n}", "function toHTML($array_name, $ident = 0, $mark=\"\"){\n static $s1;\n if (is_array($array_name)){\n $s1=$s1.'<ul class=\"level_'.$ident.'\">\n ';\n foreach ($array_name as $k => $v){\n if (is_array($v)){\n for ($i=0; $i < $ident; $i++){ $s1=$s1.$mark; }\n $s1=$s1.'<li class=\"level_'.$ident.'_'.$ident.'\">'.$k .'</li>'. \" \" . \"\n \";\n $this->toHTML($v, $ident + 1, $mark);\n // $s=$s.'AFTERM';\n }else{\n for ($i=0; $i < $ident; $i++){$s1=$s1.$mark; }\n $s1=$s1.'<li class=\"level_'.$ident.'_'.$ident.' \">'.$k . \"</li>\n \" . $v .\"\";\n }\n }\n $s1=$s1.'</ul>\n ';\n }else{\n $s1=$s1.\"Error = \" . $array_name;\n }\n return $s1;\n }", "function my_formatter($content) {\r\n\t$new_content = '';\r\n\t$pattern_full = '{(\\[noformat\\].*?\\[/noformat\\])}is';\r\n\t$pattern_contents = '{\\[noformat\\](.*?)\\[/noformat\\]}is';\r\n\t$pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);\r\n\tforeach ($pieces as $piece) {\r\n\t\tif (preg_match($pattern_contents, $piece, $matches)) {\r\n\t\t\t$new_content .= $matches[1];\r\n\t\t} else {\r\n\t\t\t$new_content .= wptexturize(wpautop($piece));\r\n\t\t}\r\n\t}\r\n\treturn $new_content;\r\n}", "function renderBalloonSpan( $input, $args ) {\n $text = $args['title'];\n\n # strip HTML from the text inside the <balloon> element,\n # except for image tags\n # remove tag contents first\n $input = preg_replace('/>[^<>]+</','><',$input);\n $input = strip_tags($input,'<img>');\n\n # be paranoid and remove any event handlers from image tags\n $input = preg_replace('/\\bon[^=]+=\\S+/i','',$input); \n\n # escape quotes in balloon caption\n $text = preg_replace('/\\\"/','\\\"',$text);\n $text = preg_replace('/\\'/',\"\\'\",$text);\n \n $link = isset($args['link']) ? $args['link'] : '';\n $target = isset($args['target']) ? $args['target'] : '';\n $sticky = isset($args['sticky']) ? $args['sticky'] : '0';\n $width = isset($args['width']) ? $args['width'] : '0';\n\n $event = isset($args['click']) && $args['click'] && !$link ? 'onclick' : 'onmouseover';\n $event = \"$event=\\\"balloon.showTooltip(event,'${text}',${sticky},${width})\\\"\";\n $event2 = ' ';\n\n if (preg_match('/onclick/',$event) && $args['hover']) {\n $event2 = \" onmouseover=\\\"balloon.showTooltip(event,'\" . $args['hover'] . \"',0,${width})\\\"\";\n }\n\n $has_style = isset($args['style']) && $args['style'];\n $style = \"style=\\\"\" . ($has_style ? $args['style'] . \";cursor:pointer\\\"\" : \"cursor:pointer\\\"\");\n $target = $target ? \"target=${target}\" : '';\n $output = \"<span ${event} ${event2} ${style}>${input}</span>\";\n \n if ($link) {\n $output = \"<a href=\\\"${link}\\\" ${target}>${output}</a>\";\n }\n \n return $output;\n}", "public function htmlizeTag($arrayInfo, $sizeRange)\n {\n $htmlizeTagFunction = $this->_htmlizeTagFunction;\n if (isset($htmlizeTagFunction) &&\n is_callable($htmlizeTagFunction)\n ) {\n // this cannot be written in one line or the PHP interpreter will puke\n // apparently, it's okay to have a function in a variable,\n // but it's not okay to have it in an instance-variable.\n return $htmlizeTagFunction($arrayInfo, $sizeRange);\n } else {\n return \"<span class='tag size{$sizeRange}'> &nbsp; {$arrayInfo['tag']} &nbsp; </span>\";\n }\n }", "protected function defaultTags()\n\t{\n\t\t//TODO: Terminar a referencia html\n\t\treturn array(\n\t\t\t'div' => array(\n\t\t\t\t'tagName' => 'div',\n\t\t\t\t'hasClosingTag' => true,\n\t\t\t),\n\t\t\t'p' => array(\n\t\t\t\t'tagName' => 'p',\n\t\t\t\t'hasClosingTag' => true,\n\t\t\t),\n\t\t\t'span' => array(\n\t\t\t\t'tagName' => 'span',\n\t\t\t\t'hasClosingTag' => true,\n\t\t\t),\n\t\t\t'input' => array(\n\t\t\t\t'tagName' => 'input',\n\t\t\t\t'hasClosingTag' => false,\n\t\t\t),\n\t\t);\n\t}", "function mft_facet_items_alter(&$build, &$settings) {\n if ($settings->facet == \"field_color_term\") {\n foreach($build as $key => $item) {\n $build[$key][\"#markup\"] = '<span class=\"facetcolor\"><span class=\"'.$item[\"#markup\"].'\"></span></span>'.$item[\"#markup\"];\n $build[$key][\"#html\"] = $item[\"#markup\"];\n }\n }\n}", "function kalatheme_icon_render_hooks() {\n $hooks['html_tag'] = array();\n return $hooks;\n}", "function build_callout($the_content)\r\n{\r\n global $starttag, $titletag, $closetag, $endtag;\r\n global $callout_options;\t\r\n\t\r\n\t$callout_style = $callout_options['callout_style'];\r\n $callout_title_style = $callout_options['callout_title_style'];\r\n $callout_body_style = $callout_options['callout_body_style'];\r\n\r\n\t$titlepos = strpos($the_content, $titletag, 0); \t// this could be false\r\n\t$closepos = strpos($the_content, $closetag, $titlepos); \t// this should not be false\r\n\tif ($closepos !== false)\r\n\t{\r\n\t\t$endpos = strpos($the_content, $endtag, $closepos);\r\n\t\tif (($titlepos !== false) && ($titlepos < $endpos))\r\n\t\t{\r\n\t\t\t$titlelen = $closepos - ($titlepos + strlen($titletag));\r\n\t\t\t$the_title = substr($the_content, $titlepos + strlen($titletag), $titlelen);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$the_title = 'No title';\r\n\t\t}\r\n\t\t$the_body = substr($the_content, $closepos + 1, $endpos - $closepos - 1);\r\n\r\n\t\t$the_callout = '<DIV style=\"'.$callout_style.'\"><DIV style=\"'.$callout_title_style.\r\n\t\t\t\t\t\t'\">'.$the_title.'</DIV><DIV style=\"'.$callout_body_style.\r\n\t\t\t\t\t\t'\">'.$the_body.'</DIV></DIV>';\r\n\r\n\t\treturn $the_callout;\r\n }\r\n\telse\t// error parsing tags.\r\n\t{\r\n\t\treturn $the_content;\r\n\t}\r\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}", "function ourInsideTpl($array, $content)\n {\n if (!isset($_COOKIE['char'])) { $array['char']['name'] = 'не выбран';} \n $content = str_replace(array(\"{TITLE}\", \"{USERNAME}\", \"{PROJECT}\", \"{VERSION}\", \"{CHAR}\"), array($array['title'], $array['username'], $array['system']['title_project'], $array['system']['version_cms'], $array['char']['name']), $content);\n foreach ($array['lang'] as $key => $value) {\n $content = str_replace(\n '{' . strtoupper($key) . '}',\n $value,\n $content\n );\n }\n echo $content;\n }", "function highlight()\n{\n // echo \"data coming from hooks\";\n // intercept output\n $CI =& get_instance();\n $data = $CI->output->get_output();\n // find the quote and make it an array of words!\n // substr(string,start,length) method // 16 is for p tag stuff\n $quote = substr($data, strpos($data, '<p class=\"lead\">') + 16,\n strpos($data, '</p>') - (strpos($data, '<p class=\"lead\">') + 16));\n // get all the required data into aaray form \n $newdata = explode(\" \", $quote);\n // create new array for updated quote\n $requiredoutput = array();\n // iterate all the words and add strong tag to them, if there is any capital word \n foreach($newdata as $word)\n {\n if( preg_match(\"/[A-Z]+/\", $word) )\n {\n $word = \"<strong>\" . $word . \"</strong>\";\n }\n $requiredoutput[] = $word;\n }\n // put everything together\n $newquote = implode(\" \", $requiredoutput);\n $newquote = '<p class=\"lead\">' . $newquote . '</p>';\n $data = preg_replace('#<p class=\"lead\">.+</p>#', $newquote, $data);\n // output the page!\n $CI->output->set_output($data);\n $CI->output->_display();\n}" ]
[ "0.57288617", "0.5676275", "0.5673082", "0.54835296", "0.54248565", "0.54012007", "0.52954406", "0.527651", "0.52524143", "0.52474016", "0.523681", "0.52093154", "0.5206952", "0.52026355", "0.5194488", "0.51902485", "0.5187484", "0.5160567", "0.5159896", "0.51455426", "0.5132069", "0.50966185", "0.5095667", "0.5086356", "0.5079397", "0.50738263", "0.5073766", "0.5064032", "0.50444764", "0.50352776", "0.5029682", "0.5028908", "0.5028739", "0.5014954", "0.4974509", "0.49717495", "0.49696586", "0.49543893", "0.49444258", "0.4929876", "0.49160898", "0.49042797", "0.48905057", "0.48893088", "0.48855126", "0.4883453", "0.48834136", "0.48703724", "0.48643857", "0.4856949", "0.48538348", "0.48531124", "0.4851201", "0.48464555", "0.48444998", "0.48219225", "0.48217565", "0.48147646", "0.48115906", "0.48115745", "0.48062542", "0.48039016", "0.47978196", "0.47876722", "0.47831905", "0.47812933", "0.47657153", "0.4762574", "0.47574595", "0.47472328", "0.47431847", "0.47416687", "0.4741431", "0.47333792", "0.47329563", "0.47326913", "0.473265", "0.47264037", "0.47244382", "0.47236434", "0.47231382", "0.47156626", "0.47145748", "0.4713743", "0.47123885", "0.47107634", "0.47029385", "0.46878153", "0.46836475", "0.46750152", "0.46673217", "0.46630314", "0.46630096", "0.46584818", "0.46536607", "0.46487278", "0.4642767", "0.4641021", "0.46400058", "0.46372873" ]
0.5390822
6
Retourne les structures du rapporteur sous forme de tableau(id, libelle)
public function getArrayRapporteurStructure() { $arrStructs=array(); foreach($this->rapporteurStructure as $structure){ $arrStructs[] = array('id'=>$structure->getId(), 'libelle'=>$structure->getLibelle()); } return $arrStructs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function &getListaLibri() {\n $libri = array();\n $query = \"select IdLibro, Titolo, Prezzo, NomeAutore, CognomeAutore, Genere from Libro\";\n \n $mysqli = Db::getInstance()->connectDb();\n if (!isset($mysqli)) {\n error_log(\"[getListaLibri] impossibile inizializzare il database\");\n $mysqli->close();\n return $libri;\n }\n $result = $mysqli->query($query);\n if ($mysqli->errno > 0) {\n error_log(\"[getListaLibri] impossibile eseguire la query\");\n $mysqli->close();\n return $libri;\n }\n\n while ($row = $result->fetch_array()) {\n $libri[] = self::creaLibriDaArray($row);\n }\n\n $mysqli->close();\n return $libri;\n }", "public static function getAll2(){\n\t\t$sql = \"select * from prueba\";\n\t\t$query = Executor::doit($sql);\n\t\treturn Model::many($query[0],new TemparioData());\n\t}", "public function listaLibros() {\n $consultaListaLibros = $this->db->select(\"SELECT * FROM libro \"\n . \"ORDER BY titulo\");\n return $consultaListaLibros;\n }", "function liste_array()\n {\n global $conf,$langs;\n\n $projets = array();\n\n $sql = \"SELECT rowid, libelle\";\n $sql.= \" FROM \".MAIN_DB_PREFIX.\"adherent_type\";\n $sql.= \" WHERE entity = \".$conf->entity;\n\n $resql=$this->db->query($sql);\n if ($resql)\n {\n $nump = $this->db->num_rows($resql);\n\n if ($nump)\n {\n $i = 0;\n while ($i < $nump)\n {\n $obj = $this->db->fetch_object($resql);\n\n $projets[$obj->rowid] = $langs->trans($obj->libelle);\n $i++;\n }\n }\n }\n else\n {\n print $this->db->error();\n }\n\n return $projets;\n }", "static function getAllVoitures(){\r\n $req = Model1::$pdo->query('SELECT * From voiture');\r\n $req->setFetchMode(PDO::FETCH_CLASS,\"ModelVoiture\");\r\n $tab_voit=$req->fetchall();\r\n return $tab_voit;\r\n }", "public function listar() {\r\n $this->conexao->conect(\"host=localhost dbname=postgres user=postgres password=123\");\r\n $aLivro= Array();\r\n $sSql = \"SELECT livcodigo,livnome,tbgenero.gencodigo,tblocalizacao.loccodigo FROM atividade.tblivro \"\r\n . \"INNER JOIN atividade.tbgenero ON tblivro.gencodigo = tbgenero.gencodigo \"\r\n . \"INNER JOIN atividade.tblocalizacao ON tblocalizacao.loccodigo = tblivro.loccodigo \";\r\n $oRes = $this->conexao->query($sSql);\r\n while($oLivroBanco = pg_fetch_assoc($oRes)){\r\n $oLivro = new Livro();\r\n $oGenero = new Genero();\r\n $oLocalizacao = new Localizacao();\r\n $oLivro->setLivcodigo($oLivroBanco['livcodigo']);\r\n $oLivro->setLivnome($oLivroBanco['livnome']);\r\n $oGenero->setGencodigo($oLivroBanco['gencodigo']);\r\n $oLocalizacao->setLoccodigo($oLivroBanco['loccodigo']);\r\n $oLivro->setGenero($oGenero);\r\n $oLivro->setLocalizacao($oLocalizacao);\r\n $aLivro[] = $oLivro;\r\n }\r\n $this->conexao->close();\r\n return $aLivro;\r\n }", "function listar2(){\n\t\t\n\t\t$sql = \"SELECT c.id, c.codigo, c.nombre from prd_pasos_producto a\n\t\tinner join prd_pasos_acciones_producto b on b.id_paso=a.id\n\t\tinner join app_productos c on c.id=a.id_producto\n\t\tgroup by a.id_producto;\";\n\n\t\treturn $this->queryArray($sql);\n\t}", "public static function findAll() {\n\n\t\t$c = Base::getConnection();\n\t\t$reponse = $c -> prepare(\"SELECT * FROM plats\");\n\t\t$dbres = $reponse -> execute();\n\n\t\twhile ($d = $reponse -> fetch(PDO::FETCH_BOTH)) {\n\n\t\t\t$cat = new plats();\n\t\t\t$cat -> id = $d['id'];\n\t\t\t$cat -> nom = $d['nom'];\n\t\t\t$cat -> description = $d['description'];\n\t\t\t$cat -> photo = $d['photo'];\n\t\t\t$cat -> prix = $d['prix'];\n\t\t\t$cat -> is_resto = $d['id_resto'];\n\n\t\t\t$tab[$cat -> id] = $cat;\n\n\t\t}\n\n\t\treturn $tab;\n\n\t}", "function courtjus_objets_in_rubrique($id_rubrique) {\n\t// On va compter le nombre d'objet présent dans la rubrique\n\t$tables = courtjus_trouver_objet_rubrique();\n\n\t// on va compter le nombre d'objet qu'il y a dans la rubrique.\n\t$objets_in_rubrique = array();\n\n\t// On boucle sur tout les table qui pourrait être ratacher à une rubrique\n\tforeach ($tables as $table) {\n\t\t// Simplification des variables. On a besoin du titre pour trouver le num titre\n\t\tlist($table, $titre) = $table;\n\t\t// L'objet\n\t\t$objet = table_objet($table);\n\t\t// l'identifiant de l'objet\n\t\t$champs_id = id_table_objet($table);\n\t\t// Le champ qui contient la date\n\t\t$champ_date = objet_info($objet, 'date');\n\n\t\t// Les champs qui seront utilisé pour la requête.\n\t\t$champs = array(\n\t\t\t$champs_id,\n\t\t\t$titre,\n\t\t\t// Convertir la date de l'objet en timestamp, cela permettra une comparaison rapide\n\t\t\t'UNIX_TIMESTAMP('.$champ_date.') AS '.$champ_date\n\t\t);\n\n\t\t// Le where\n\t\t$where = array(\n\t\t\t'id_rubrique='.intval($id_rubrique),\n\t\t\t'statut='.sql_quote('publie')\n\t\t);\n\n\t\t// Est-ce qu'il faut prendre en compte la langue ?\n\t\tinclude_spip('formulaires/configurer_multilinguisme');\n\t\tif (table_supporte_trad($table)) {\n\t\t\t$where[] = 'lang='.sql_quote($GLOBALS['spip_lang']);\n\t\t}\n\n\t\t// On récupère les objets de la rubrique.\n\t\t$objets_rubrique = sql_allfetsel($champs, $table, $where);\n\n\t\t// On boucle sur les objets à l'intérique de la rubrique.\n\t\tforeach ($objets_rubrique as $objet_rubrique) {\n\n\t\t\t$num_titre = recuperer_numero($objet_rubrique['titre']);\n\n\t\t\t// On créer le tableau contenant les données de l'objet\n\t\t\t$objets_in_rubrique[] = array(\n\t\t\t\t'id_objet' => $objet_rubrique[$champs_id],\n\t\t\t\t'objet' => $objet,\n\t\t\t\t'num_titre' => $num_titre,\n\t\t\t\t'date' => $objet_rubrique[$champ_date]\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $objets_in_rubrique;\n}", "function getAll(){\r\n $sql \t= \"select * from interpretacao \";\r\n\t\t$rs\t\t= Db::sql($sql, \"Interpretacao::getAll()\");\r\n $out \t= array();\r\n while ($r = mysql_fetch_assoc($rs)) {\r\n $out[] = new Interpretacao($r[\"int_id\"]);\r\n }\r\n return $out;\r\n\t}", "static function getAllProduit() {\n $rep = Model::$pdo->query('SELECT *\n\t\t\t\t\t\t\t\tFROM PRODUIT');\n $rep->setFetchMode(PDO::FETCH_CLASS, 'ModelProduit');\n $ans = $rep->fetchAll();\n return $ans;\n }", "public function getlist()\r\n {$trajet=array();\r\n\t try\r\n {\r\n $stmt = $this->_db->prepare(\"SELECT Num_Trajet,Type,Num_Ville1,Num_Ville2,Date_aller,Date_retour,Heure_aller\r\n\t\t ,Heure_retour,Prix,Nombre_place,ID_conducteur,Description FROM Trajet ORDER by Num_trajet\");\r\n\t\t $stmt->execute();\r\n\t\t \r\n\t\t while ($donnees = $stmt->fetch(PDO::FETCH_ASSOC))\r\n\t\t\t{\r\n\t\t\t\t$trajet[] = new Trajet(array('num_trajet'=>$donnees['Num_Trajet'],'type'=>$donnees['Type'],\r\n\t\t\t\t'num_ville1'=>$donnees['Num_Ville1'],'num_ville2'=>$donnees['Num_Ville2'],'date_aller'=>$donnees['Date_aller'],\r\n\t\t\t\t'date_retour'=>$donnees['Date_retour'],'heure_aller'=>$donnees['Heure_aller'],'heure_retour'=>$donnees['Heure_retour'],\r\n\t\t\t\t'prix'=>$donnees['Prix'],'nombre_place'=>$donnees['Nombre_place'],'id_conducteur'=>$donnees['ID_conducteur']\r\n\t\t\t\t,'description'=>$donnees['Description']));\r\n\t\t\t}\r\n\t\treturn $trajet;\r\n\r\n }\r\n catch(PDOException $e)\r\n {\r\n echo $e->getMessage();\r\n } \r\n\t }", "public function getall()\r\n {$trajet=array();\r\n\t try\r\n {\r\n $stmt = $this->_db->prepare(\"SELECT Num_Trajet,Type,Num_Ville1,Num_Ville2,Date_aller,Date_retour,Heure_aller\r\n\t\t ,Heure_retour,Prix,Nombre_place,ID_conducteur,Description FROM Trajet ORDER BY Num_Trajet DESC LIMIT 12\");\r\n\t\t $stmt->execute();\r\n\t\t \r\n\t\t while ($donnees = $stmt->fetch(PDO::FETCH_ASSOC))\r\n\t\t\t{\r\n\t\t\t\t$trajet[] = new Trajet(array('num_trajet'=>$donnees['Num_Trajet'],'type'=>$donnees['Type'],\r\n\t\t\t\t'num_ville1'=>$donnees['Num_Ville1'],'num_ville2'=>$donnees['Num_Ville2'],'date_aller'=>$donnees['Date_aller'],\r\n\t\t\t\t'date_retour'=>$donnees['Date_retour'],'heure_aller'=>$donnees['Heure_aller'],'heure_retour'=>$donnees['Heure_retour'],\r\n\t\t\t\t'prix'=>$donnees['Prix'],'nombre_place'=>$donnees['Nombre_place'],'id_conducteur'=>$donnees['ID_conducteur']\r\n\t\t\t\t,'description'=>$donnees['Description']));\r\n\t\t\t}\r\n\t\treturn $trajet;\r\n\r\n }\r\n catch(PDOException $e)\r\n {\r\n echo $e->getMessage();\r\n } \r\n\t }", "public function all(){\n\n $a= parent::bdd()->query(\"SELECT * FROM auteur\");\n $b= $a->fetchall(\\PDO::FETCH_OBJ);\n\n return $b;\n\n }", "public function DetallesComprasPorId()\n\t{\n\t\tif(base64_decode($_GET['tipoentrada'])==\"PRODUCTO\"){\n\n\t\t\tself::SetNames();\n\t\t\t$sql = \" SELECT * FROM detallecompras LEFT JOIN categorias ON detallecompras.categoria = categorias.codcategoria LEFT JOIN productos ON detallecompras.codproducto = productos.codproducto WHERE detallecompras.coddetallecompra = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"coddetallecompra\"])) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num==0)\n\t\t\t{\n\t\t\t\techo \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t} else {\n\n\t\t\t$sql = \" SELECT * FROM detallecompras LEFT JOIN ingredientes ON detallecompras.codproducto = ingredientes.codingrediente WHERE detallecompras.coddetallecompra = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"coddetallecompra\"])) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num==0)\n\t\t\t{\n\t\t\t\techo \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\n\t\t}\n\t}", "public function getLibelle();", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "public function getAllLivros(){\n $mysqli = new mysqli(\"127.0.0.1\", \"henryhiraki22\", \"\", \"trabalho\");\n $stmt = $mysqli->query(\"SELECT * FROM Livros\");\n $livro = [];\n for ($i = 0; $livros = $stmt->fetch_assoc(); $i++){\n $livro[$i] = new Livro($livros['id'],$livros['nome'], $livros['valor'],$livros['genero']);\n }\n return $livro;\n }", "public function get_ballot_list(){\n\n $this->db->from('ballot_list')->order_by('l_id','asc');\n $query = $this->db->get();\n $ballot_list = $query->result();\n\n $return_result = array();\n\n foreach ($ballot_list as $key => $value) {\n\n $this->db->from('ballot_map')->where('ballot_map.l_id' ,$value->{'l_id'});\n $this->db->join('ballot_type' , 'ballot_type.t_id=ballot_map.t_id');\n $query = $this->db->get();\n $ballot_type_result = $query->result();\n \n $t_id_array = array();\n foreach ($ballot_type_result as $key2 => $value2) {\n\n\n $tmp = new stdClass();\n $tmp->{'t_id'} = $value2->{'t_id'};\n $tmp->{'title1'} = $value2->{'title1'}; \n $tmp->{'type'} = $value2->{'type'};\n\n array_push($t_id_array , $tmp);\n }\n\n\n $tmp = new stdClass();\n $tmp->{'l_id'} = $value->{'l_id'};\n $tmp->{'name'} = $value->{'name'};\n $tmp->{'prefix'} = $value->{'prefix'};\n $tmp->{'t_arr'} = $t_id_array;\n \n array_push($return_result , $tmp);\n }\n\n\n return $return_result;\n }", "public function get_structure_table(){\n\t\t\t//Obtenemos la base de datos que debemos consultar\n\t\t\tif(empty($this->session->userdata['logged_in']['name_db']))\n\t\t\t\treturn false;\n\t\t\telse{\n\t\t\t\t//Accedemos a la base de datos correcta \n\t\t\t\t$this->personal_db = $this->load->database('personal', TRUE);\n\n\t\t\t\t$structure['comments'] = $this->personal_db->list_fields('comments');\n\t\t\t\t$structure['products'] = $this->personal_db->list_fields('products');\n\n\t\t\t\tif(!empty($structure['comments']) && !empty($structure['products'])){\n\t\t\t\t\treturn $structure;\n\t\t\t\t}else\n\t\t\t\t\treturn false;\t\t\t\n\t\t\t}\n\t\t}", "function getTablas() {\r\n $tablas['inventario_equipo']['id']='inventario_equipo';\r\n $tablas['inventario_equipo']['nombre']='Inventario (equipo)';\r\n\r\n $tablas['inventario_grupo']['id']='inventario_grupo';\r\n $tablas['inventario_grupo']['nombre']='Inventario (grupo)';\r\n\r\n $tablas['inventario_estado']['id']='inventario_estado';\r\n $tablas['inventario_estado']['nombre']='Inventario (estado)';\r\n\r\n $tablas['inventario_marca']['id']='inventario_marca';\r\n $tablas['inventario_marca']['nombre']='Inventario (marca)';\r\n\r\n $tablas['obligacion_clausula']['id']='obligacion_clausula';\r\n $tablas['obligacion_clausula']['nombre']='Obligacion (clausula)';\r\n\r\n $tablas['obligacion_componente']['id']='obligacion_componente';\r\n $tablas['obligacion_componente']['nombre']='Obligacion (componente)';\r\n\r\n $tablas['documento_tipo']['id']='documento_tipo';\r\n $tablas['documento_tipo']['nombre']='Documento (Tipo)';\r\n\r\n \t\t$tablas['documento_tema']['id']='documento_tema';\r\n \t\t$tablas['documento_tema']['nombre']='Documento (Tema)';\r\n\r\n \t\t$tablas['documento_subtema']['id']='documento_subtema';\r\n \t\t$tablas['documento_subtema']['nombre']='Documento (Subtema)';\r\n\r\n \t\t$tablas['documento_estado']['id']='documento_estado';\r\n \t\t$tablas['documento_estado']['nombre']='Documento (Estado)';\r\n\r\n \t\t$tablas['documento_estado_respuesta']['id']='documento_estado_respuesta';\r\n \t\t$tablas['documento_estado_respuesta']['nombre']='Documento (Estado Respuesta)';\r\n\r\n \t\t$tablas['documento_actor']['id']='documento_actor';\r\n \t\t$tablas['documento_actor']['nombre']='Documento (Responsables)';\r\n\r\n \t\t$tablas['documento_tipo_actor']['id']='documento_tipo_actor';\r\n \t\t$tablas['documento_tipo_actor']['nombre']='Documento (Tipo de Responsable)';\r\n\r\n \t\t$tablas['riesgo_probabilidad']['id']='riesgo_probabilidad';\r\n \t\t$tablas['riesgo_probabilidad']['nombre']='Riesgo (Probabilidad)';\r\n\r\n \t\t$tablas['riesgo_categoria']['id']='riesgo_categoria';\r\n \t\t$tablas['riesgo_categoria']['nombre']='Riesgo (Categoria)';\r\n\r\n \t\t$tablas['riesgo_impacto']['id']='riesgo_impacto';\r\n \t\t$tablas['riesgo_impacto']['nombre']='Riesgo (Impacto)';\r\n\r\n \t\t$tablas['compromiso_estado']['id']='compromiso_estado';\r\n \t\t$tablas['compromiso_estado']['nombre']='Compromisos (Estado)';\r\n\r\n \t\t$tablas['departamento']['id']='departamento';\r\n \t\t$tablas['departamento']['nombre']='Departamentos';\r\n\r\n \t\t$tablas['departamento_region']['id']='departamento_region';\r\n \t\t$tablas['departamento_region']['nombre']='Departamentos (Region)';\r\n\r\n \t\t$tablas['municipio']['id']='municipio';\r\n \t\t$tablas['municipio']['nombre']='Municipios';\r\n\r\n $tablas['operador']['id']='operador';\r\n\t $tablas['operador']['nombre']='Operador';\r\n\r\n asort($tablas);\r\n return $tablas;\r\n }", "public function getCommondata()\n {\n $select = $this->select()\n // ->setIntegrityCheck(false)\n ->from(array('album' => 'album'),array('Id','name_n'))\n ->join('album_det','album_det.Id = album.Id',array('album_det.Id'));\n // $result=$this->fetchAll($hhh);\n $result = $this->fetchAll($select);\n \n echo \"<pre>\";\n print_r($result);exit;\n return $result;\n\n }", "function getTablas() {\n $tablas['departamento']['id'] = 'departamento';\n $tablas['departamento']['nombre'] = 'Departamentos';\n\n $tablas['departamento_region']['id'] = 'departamento_region';\n $tablas['departamento_region']['nombre'] = 'Departamentos (Region)';\n\n $tablas['municipio']['id'] = 'municipio';\n $tablas['municipio']['nombre'] = 'Municipios';\n\n $tablas['operador']['id'] = 'operador';\n $tablas['operador']['nombre'] = 'Operador';\n\n $tablas['pais']['id'] = 'pais';\n $tablas['pais']['nombre'] = 'Paises';\n\n $tablas['ciudad']['id'] = 'ciudad';\n $tablas['ciudad']['nombre'] = 'Ciudades';\n\n $tablas['familias']['id'] = 'familias';\n $tablas['familias']['nombre'] = 'Familias';\n\n $tablas['monedas']['id'] = 'monedas';\n $tablas['monedas']['nombre'] = 'Monedas';\n\n $tablas['cuentas_financiero']['id'] = 'cuentas_financiero';\n $tablas['cuentas_financiero']['nombre'] = 'Cuentas';\n\n $tablas['cuentas_financiero_ut']['id'] = 'cuentas_financiero_ut';\n $tablas['cuentas_financiero_ut']['nombre'] = 'Cuentas UT';\n\n $tablas['cuentas_financiero_tipo']['id'] = 'cuentas_financiero_tipo';\n $tablas['cuentas_financiero_tipo']['nombre'] = 'Tipos de Cuentas';\n\n $tablas['extracto_movimiento']['id'] = 'extracto_movimiento';\n $tablas['extracto_movimiento']['nombre'] = 'Movimientos';\n\n $tablas['centropoblado']['id'] = 'centropoblado';\n $tablas['centropoblado']['nombre'] = 'Centros Poblados';\n\n $tablas['encuesta_tipo']['id'] = 'encuesta_tipo';\n $tablas['encuesta_tipo']['nombre'] = 'Tipo de Encuesta';\n\n $tablas['actividades_tipo']['id'] = 'actividades_tipo';\n $tablas['actividades_tipo']['nombre'] = 'Planes de Actividades';\n\n $tablas['tipohallazgo']['id'] = 'tipohallazgo';\n $tablas['tipohallazgo']['nombre'] = 'Tipo Hallazgo';\n\n asort($tablas);\n return $tablas;\n }", "public function getAll(){\n \n // 1. Establece la conexion con la base de datos y trae todos los generos\n $query = $this->getDb()->prepare(\" SELECT * FROM genero\");\n $query-> execute(); \n return $query->fetchAll(PDO::FETCH_OBJ);\n }", "function consultarDetalles (){\n\t\t$x = $this->pdo->prepare('SELECT * FROM detalles');\n\t\t$x->execute();\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "function GetPeliculasConGenero(){\n //$sentencia = $this->db->prepare(\"SELECT * FROM peliculas INNER JOIN genero ON peliculas.titulo = genero.nombre\");\n $sentenciasad = $this->db->prepare(\"SELECT peliculas.titulo, genero.nombre FROM peliculas INNER JOIN genero ON peliculas.id_genero = genero.id_genero\");\n $sentencias->executing();\n //print_r( $sentencia->fetchAll(PDO::FETCH_OBJ));// vemos que este cargado y con que \n return $sentencia->fetchAll(PDO::FETCH_OBJ);\n }", "function produitLoadFull($db,$id){\n $id = (int) $id;\n $req = \"SELECT P.idproduit, P.modele, LEFT(P.descriptif,300) AS modele, C.genre, I.legend, GROUP_CONCAT(I.legend SEPARATOR '|||') AS theimages_titre, GROUP_CONCAT(C.genre SEPARATOR '|||') AS genre\n FROM produits P \n LEFT JOIN produits_has_categorie PHC \n ON PHC.produits_id = P.idproduit\n LEFT JOIN images I \n ON I.idmage = produits_idproduit\nWHERE P.idproduit=$idproduit\nGROUP BY P.idproduit\n \";\n $recup = mysqli_query($db,$req);\n // si on a 1 résultat\n if(mysqli_num_rows($recup)){\n // on utilise le fetch all car il peut y avoir plus d'un résultat\n return mysqli_fetch_assoc($recup);\n }\n // no result\n return false;\n}", "public function listtrajet($info)\r\n{\r\n\t\r\n\t$trajets=array();\r\n\t try\r\n {\r\n $stmt = $this->_db->prepare(\"SELECT * FROM Trajet where ID_conducteur=:id\");\r\n\t\t $stmt->bindValue(\":id\",$info); \r\n\t\t $stmt->execute();\r\n\t\t while ($donnees = $stmt->fetch(PDO::FETCH_ASSOC))\r\n\t\t\t{\r\n\t\t\t\t$trajets[] = new Trajet($donnees);\r\n\t\t\t}\r\n\t\treturn $trajets;\r\n\r\n }\r\n catch(PDOException $e)\r\n {\r\n echo $e->getMessage();\r\n }\r\n}", "public function findBatiments($language) {\r\n $select = $this->_createSelectQuery();\r\n // batiment\r\n $select->field('id', $this->_tableName);\r\n $select->field('nom_' . $language, $this->_tableName, 'nom');\r\n $select->field('description_' . $language, $this->_tableName, 'description');\r\n $select->field('image', $this->_tableName);\r\n $select->field('niveau', $this->_tableName);\r\n $select->field('cout', $this->_tableName);\r\n $select->field('entretien', $this->_tableName);\r\n $select->field('duree_construction', $this->_tableName);\r\n $select->field('duree_recolte', $this->_tableName);\r\n $select->field('duree_hospitalisation', $this->_tableName);\r\n $select->field('cout_hospitalisation', $this->_tableName);\r\n $select->field('gain', $this->_tableName);\r\n $select->field('capacite', $this->_tableName);\r\n $select->field('visibilite', $this->_tableName);\r\n $select->field('id_prev', $this->_tableName);\r\n // Batiment Suivant\r\n $select->field('id', 'batiment_suivant', 'id_next');\r\n // type_batiment 1\r\n $select->field('id', 'type1_batiment', 'id_type1');\r\n $select->field('id_parent', 'type1_batiment', 'id_parent_type1');\r\n $select->field('nom_' . $language, 'type1_batiment', 'nom_type1');\r\n $select->field('is_unique', 'type1_batiment', 'is_unique_type1');\r\n // type_batiment 2\r\n $select->field('id', 'type2_batiment', 'id_type2');\r\n $select->field('id_parent', 'type2_batiment', 'id_parent_type2');\r\n $select->field('nom_' . $language, 'type2_batiment', 'nom_type2');\r\n $select->field('is_unique', 'type2_batiment', 'is_unique_type2');\r\n // From et jointures\r\n $select->from($this->_tableName);\r\n $select->innerJoin('type_batiment', array('batiment.id_type = type1_batiment.id'), 'type1_batiment');\r\n $select->leftJoin('type_batiment', array('type1_batiment.id_parent = type2_batiment.id'), 'type2_batiment');\r\n $select->leftJoin('batiment', array('batiment_suivant.id_prev = batiment.id'), 'batiment_suivant');\r\n // Ordre\r\n $select->order('batiment.niveau');\r\n\r\n return $this->_mapper->buildObjectsFromRows($this->_selectAll($select));\r\n }", "function getAll() {\n global $dbh, $schema;\n try {\n // using prepared statements will help protect you from SQL injection\n $stmt = $dbh->prepare(\"SELECT * FROM $schema.ingrediente\");\n $stmt->execute();\n // get array containing all of the result set rows \n $result = $stmt->fetchall(PDO::FETCH_ASSOC);\n return $result;\n }\n catch(PDOException $e) {\n $_SESSION[\"s_errors\"][\"generic\"][] = \"ERRO[16]: \".$e->getMessage();\n header(\"Location: ../../index.php\");\n die;\n }\n }", "public function getAllVisiteurs(){\r\n\t\t$req =\"select * from visiteur where comptable=0\";\r\n\t\t\r\n\t\t$res = PdoGsb::$monPdo->query($req);\r\n\t\t$lesVisiteurs =array();\r\n\t\t$laLigne = $res->fetch();\r\n\t\twhile($laLigne != null)\t{\r\n\t\t\t$selection = $laLigne['id'];\r\n $nom=$laLigne['nom'];\r\n $prenom=$laLigne['prenom'];\r\n\t\t\t$lesVisiteurs[\"$selection\"]=array(\r\n \"id\"=>\"$selection\",\r\n \"nom\"=>\"$nom\",\r\n \"prenom\"=>\"$prenom\"\r\n );\r\n\t\t\t$laLigne = $res->fetch(); \t\t\r\n\t\t}\r\n\t\treturn $lesVisiteurs;\r\n\t}", "public function get_libros()\n { \n $libros = Libro::orderBy('id', 'desc')->paginate(10);\n \n return $libros;\n }", "function getAll() {\n $this->getConnection();\n $request = \"SELECT P.ID_PRODUIT, P.DATE_CREATION, P.NOM, P.PRIX, P.DESCRIPTION, P.ID_CATEGORIE, P.IMAGE, C.NOM AS CATEGORIE \n FROM PRODUIT P INNER JOIN CATEGORIE C ON P.ID_CATEGORIE=C.ID_CATEGORIE\";\n $result = $this->select($request);\n return $result;\n }", "public function findall_motif() {\n $connexion = get_connexion();\n $sql = \"SELECT * FROM motif\";\n\n try {\n $sth = $connexion->prepare($sql);\n $sth->execute();\n $rows = $sth->fetchAll(PDO::FETCH_ASSOC);\n\n } \n catch (PDOException $e) {\n throw new Exception( \"<p>Erreur lors de la requête SQL : \" . $e->getMessage() . \"</p>\");\n }\n $array = array();\n foreach ($rows as $row) {\n $array[] = new DAO_Motif($row);\n }\n return $array;\n\n\n }", "public function getClasseNoms(){\n \n $db = $this->dbConnect();\n $classeNoms = $db->prepare(\n \"select id, libelle\n from classeNom\n where is_softDelete = 0\n order by id\"\n );\n\n $classeNoms->execute();\n return $classeNoms;\n }", "function GetMulti($table)\n {\n $dbr = DBs::getInstance();\n $q = \"SELECT `\".$table.\"`.*\n FROM `\".$table.\"`\n WHERE `\".$table.\"`.`name`!=''\n AND `\".$table.\"`.`lang_id`='\".$this->lang_id.\"'\n \";\n $res = $dbr->db_Query( $q );\n //echo '<br>$q='.$q.' $res='.$res.' $dbr->result='.$dbr->result;\n if ( !$res or !$dbr->result) return false;\n $rows = $dbr->db_GetNumRows();\n //echo '<br>rows='.$rows;\n $arr = array();\n for( $i = 0; $i < $rows; $i++ ){\n $row=$dbr->db_FetchAssoc();\n $arr[$row['cod']] = $row['name'];\n }\n return $arr;\n }", "public static function getAll() {\n $lesObjets = array();\n $requete = \"SELECT * FROM genre\";\n $stmt = Bdd::getPdo()->prepare($requete);\n $ok = $stmt->execute();\n if ($ok) {\n // Tant qu'il y a des enregistrements dans la table\n while ($enreg = $stmt->fetch(PDO::FETCH_ASSOC)) {\n //ajoute un nouveau genre au tableau\n $lesObjets[] = self::enregVersMetier($enreg);\n }\n }\n return $lesObjets;\n }", "public function modelFetchAll(){\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van, tra ket qua ve mot object\n\t\t\t$query = $conn->query(\"select * from phongban\");\n\t\t\t//tra ve tat ca cac ban ghi\n\t\t\treturn $query->fetchAll();\n\t\t}", "public function listar(){\n\n\t\t$data = $this->db->from($this->table)\n\t\t\t\t\t\t ->orderBy('id DESC')\n\t\t\t\t\t\t ->fetchAll();\n\t\tif(empty($data)){\n\t\t $respuesta = array('respuesta' => 0 );\n\t\t return $respuesta;\n\t\t}else{\n\t\t return $data;\n\t\t}\t\t\t\t \n\t// return $data = $this->db_pdo->query('select * from '.$this->table)\n\t//\t\t\t\t\t \t\t\t->fetchAll();\t\t\t\t \t\t\t\t\t\t \n\t}", "public function getAllProtypes(){\r\n\t\t//viet cau sql\r\n\t\t$sql =\"SELECT * FROM protypes\";\r\n\t\t//thuc thi cau truy van\r\n\t\t$obj = self::$conn->query($sql);\r\n\t\treturn $this->getData($obj);\r\n\t}", "function get_listado($filtro=array())\n\t{\n\t\t// Se establacen preferencias de filtro en $where \n\t\t$where = array();\n\t\tif (isset($filtro['dni'])) {\n\t\t\t$where[] = \"dni = \".quote($filtro['dni']);\n\t\t}\n\t\t$sql = \"SELECT\n\t\t\tt_lp.id_presentacion,\n\t\t\tt_lp.fecha,\n\t\t\tt_lp.dni,\n\t\t\tD.id_dep,\n\t\t\tD.depositario,\n\t\t\tt_lp.url_pdf,\n\t\t\tTD.tipo_doc,\n\t\t\tTD.descripcion,\n\t\t\tt_lp.copydoc\n\t\tFROM\n\t\t\tleg_presentaciones as t_lp\n\t\tLEFT JOIN leg_depositarios D ON D.id_dep = t_lp.id_dep\n\t\tLEFT JOIN leg_tipo_doc TD ON TD.tipo_doc = t_lp.id_tipo_doc\n\t\tORDER BY 1\";\n\t\tif (count($where)>0) {\n\t\t\t// Concatena a la sql las preferencias de filtro\n\t\t\t$sql = sql_concatenar_where($sql, $where);\n\t\t}\n\t\treturn toba::db('ledig')->consultar($sql);\n\t}", "public function &getListaInsegnamenti() {\n $insegnamenti = array();\n \n $query = \"select \n insegnamenti.id insegnamenti_id,\n insegnamenti.titolo insegnamenti_titolo,\n insegnamenti.cfu insegnamenti_cfu,\n insegnamenti.codice insegnamenti_codice,\n\n docenti.id docenti_id,\n docenti.nome docenti_nome,\n docenti.cognome docenti_cognome,\n docenti.email docenti_email,\n docenti.citta docenti_citta,\n docenti.cap docenti_cap,\n docenti.via docenti_via,\n docenti.provincia docenti_provincia,\n docenti.numero_civico docenti_numero_civico,\n docenti.ricevimento docenti_ricevimento,\n docenti.username docenti_username,\n docenti.password docenti_password,\n dipartimenti.id dipartimenti_id,\n dipartimenti.nome dipartimenti_nome,\n CdL.id CdL_id\n \n from insegnamenti\n join docenti on insegnamenti.docente_id = docenti.id \n join dipartimenti on docenti.dipartimento_id = dipartimenti.id \n join CdL on insegnamenti.cdl_id = CdL.id\";\n $mysqli = Db::getInstance()->connectDb();\n if (!isset($mysqli)) {\n error_log(\"[getListaInsegnamenti] impossibile inizializzare il database\");\n $mysqli->close();\n return $insegnamenti;\n }\n $result = $mysqli->query($query);\n if ($mysqli->errno > 0) {\n error_log(\"[getListaInsegnamenti] impossibile eseguire la query\");\n $mysqli->close();\n return $insegnamenti;\n }\n\n while ($row = $result->fetch_array()) {\n $insegnamenti[] = self::creaDaArray($row);\n }\n \n $mysqli->close();\n return $insegnamenti;\n \n }", "public function vistaXTablaModel($table){\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $table\"); //preparacion de la consulta SQL \n\t\t$stmt->execute(); //ejecucion de la consulta\n\t\treturn $stmt->fetchAll(); //se retorna en un array asociativo el resultado de la consulta\n\t\t$stmt->close();\n\n\t}", "function listExport($table, $attr)\n {\n if (in_array('categoria', $attr)) {\n $join_data = $this->f->leftJoin($table, \"categorias\", \"cod\", \"categoria\", \"titulo\");\n // Genero el atributo \"categorias.titulo\" con uan bandera de \"%\" que me servira mas abajo y lo cambio por el atrr categoria que me devolveria el cod.\n $replace = [array_search('categoria', $attr) => \"%\" . $join_data['show']];\n $attr = array_replace($attr, $replace);\n // guardo en un array el LEFT JOIN\n $join[] = $join_data['join'];\n }\n if (in_array('subcategoria', $attr)) {\n $join_data = $this->f->leftJoin($table, \"subcategorias\", \"cod\", \"subcategoria\", \"titulo\");\n $replace = [array_search('subcategoria', $attr) => \"%\" . $join_data['show']];\n $attr = array_replace($attr, $replace);\n $join[] = $join_data['join'];\n }\n\n // Genero en 1 string cada atributo que me va a traer con su respectiva tabla. Para no generar conflicto ambiguo en la base de datos\n\n $attr = implode(\" , \" . $table . \".\", $attr);\n if (!empty($join)) {\n $join = implode(\" \", $join);\n // Elimino la tabla principal con la bandera que puse antes de categoria y subcategoria, sino quedaria ej: \"productos.categorias.titulo\".\n $attr = str_replace(\"$table.%\", \"\", $attr);\n } else {\n $join = '';\n }\n\n $sql = \"SELECT $table.$attr FROM $table $join\";\n\n $var = $this->con->sqlReturn($sql);\n if ($var) {\n while ($row = mysqli_fetch_assoc($var)) {\n $array[] = [\"data\" => $row];\n }\n }\n return $array;\n }", "public function getCarStructureMYSQL(){\n $this->db->query('DESCRIBE '. CARS_TABLE);\n $result = $this->db->getAll();\n\n return $result;\n\n }", "public function getDerniersComptesRendus($id){\n\t\t$req = \"select R.RAP_DATE, P.PRA_NOM, P.PRA_PRENOM, P.PRA_NUM from praticien P,rapport_visite R where R.VIS_MATRICULE='\".$id.\"' and P.PRA_NUM=R.PRA_NUM LIMIT 0, 8;\";\n\t\t$rs = PdoGsb::$monPdo->query($req);\n\t\t\n\t\t//$ligne = $rs->fetch();\n\t\t//return $ligne;\n\t\treturn $rs;\n\t}", "public function getList2(){\r\n $listArticles =[]; ///on creer une liste vide ou ont mettra tous les articles\r\n\r\n\r\n //prepare une requete de type select\r\n $sql= 'SELECT id, ' \r\n .'titre, '\r\n .'texte, '\r\n .'publie, '\r\n .'DATE_FORMAT(date, \"%d/%m/%Y\")as date '\r\n .'FROM articles ';\r\n \r\n \r\n $req = $this->bdd->prepare($sql);\r\n\r\n//////execution de la requete avec attribution des valeurs\r\n$req->execute();\r\n\r\n/////on stocke les données obtenues dans un tableau\r\nwhile ($donnees = $req->fetch(PDO::FETCH_ASSOC)){///tant que il y a des article alors on boucle\r\n ////on cree des objets avec les données issue de la bdd\r\n $articles = new articles();\r\n $articles->hydrate($donnees);\r\n $listArticles[] = $articles;\r\n}\r\n///print_r2($listArticles)\r\nreturn $listArticles;\r\n\r\n\r\n}", "public function readAll(){\n\t\t\t$req = \"SELECT recette.idRec, recette.nom AS lib, descriptif, difficulte, prix, nbPersonnes, \n\t\t\t\t\tdureePreparation, dureeCuisson, dureeTotale, qteCalories, qteProteines, qteGlucides, qteLipides, \n\t\t\t\t\tutilisateur.nom AS utilNom, utilisateur.prenom AS utilprenom, illustration.adresse\n\t\t\t\t\tFROM recette \n\t\t\t\t\tINNER JOIN utilisateur\n\t\t\t\t\tON recette.idUtil = utilisateur.idUtil\n\t\t\t\t\tINNER JOIN illustration\n\t\t\t\t\tON recette.idRec = illustration.idRec\n\t\t\t\t\tORDER BY recette.nom ASC\";\n\t\t\t$curseur=$this->cx->query($req);\n\t\t\treturn $curseur;\n\t\t}", "public static function getAll(){\n\t\t$sql = \"select * from \".self::$tablename;\n\t\t$query = Executor::doit($sql);\n\t\treturn Model::many($query[0],new TemparioData());\n\t}", "function listeGroupes(){\n $groupes = array();\n $connexion = new Connexion();\n $query = 'SELECT * FROM GROUPE';\n $result = $connexion->query($query);\n foreach($result as $row){\n $groupes[] = array('id'=>$row['id'],'libelle'=>$row['libelle'],'nombre'=>$row['nombre']);\n }\n return $groupes;\n}", "function getAll() {\n $this->getConnection();\n $request = \"SELECT ID_GROUPE, DATE_CREATION, NOM, NIVEAU FROM GROUPE\";\n $result = $this->select($request);\n return $result;\n }", "public static function liste(){\r\n\t\t\t$sql = \"SELECT idEvenement, nomEvenement, description, dateHeure FROM evenement ORDER BY idEvenement DESC\";\r\n\t\t\t$stmt =\tDB::get_instance()->prepare($sql);\r\n\t\t\t$stmt->execute();\r\n\t\t\t$resul = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\treturn $resul;\r\n\r\n\t\t\t}", "function buscar_id($id_libro){\n\t\tinclude 'data_bd.inc';\n\t\tinclude 'databaseClass.php';\n\t\t//creo mi cadena de conexion\n\t\t$conexion = new DB($host, $user, $pass, $bd);\n\t\t//Creo mi conexión\n\t\t$status = $conexion->conectar();\n\t\t//En caso de que devuelva una falla\n\t\tif($status === FALSE){\n\t\t\tdie('No se pudo conectar');\n\t\t}\n\t\t//Creo mi query\n\t\t$consulta = \"SELECT\n\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\tlibro\n\t\t\t\tWHERE id_libro='$id_libro'\";\n\t\t//Ejecuto la consulta\n\t\t$resultado = $conexion -> ejecutarConsulta($consulta);\n\t\t//Si fue una falla\n\t\tif($conexion === FALSE){\n\t\t\t$conexion -> cerrar();\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t//Cierro la conexion\n\t\t$conexion -> cerrar();\n\t\tif($resultado == TRUE)\n\t\t{\n\t\t\trequire('libroClass.php');\n\t\t\t$libro = new Libro($resultado[0]['id_libro'], $resultado[0]['nombre_libro'], $resultado[0]['paginas_libro'], $resultado[0]['codigo_libro'], $resultado[0]['version_libro'], $resultado[0]['id_editorial'], $resultado[0]['id_estado_libro']);\n\t\t\t//Regreso los productos\n\t\t\treturn $libro;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}", "function getTagInfos($idPhotoTag){\r\n\t\t$connectService = new ConnectionBDD();\r\n\t\t$connect = $connectService->connect();\r\n\t\t$photoTag = new Data();\r\n\r\n\t\t$query = \"select DAYOFMONTH(DATE_MEDIA) as day, MONTH(DATE_MEDIA) as month, YEAR (DATE_MEDIA) as year,TYPE_PHOTO,COMMENTAIRE \"\r\n\t\t\t\t. \" from PhotoTag left join media on FK_ID_PHOTOS = ID_MEDIA where ID_PHOTO_TAG = \" . $idPhotoTag;\r\n\t\t$result = mysql_query($query);\r\n\r\n\t\tif(mysql_num_rows($result)!=1){return null;}\r\n\t\tif(mysql_result($result,0,\"day\")!=null){\r\n\t\t\t$photoTag->addInfo(\"date\",mysql_result($result,0,\"day\") . \" \" . getMonth(mysql_result($result,0,\"month\")) . \" \" . mysql_result($result,0,\"year\"));\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$photoTag->addInfo(\"date\",\"\");\r\n\t\t}\r\n\t\t$photoTag->addInfo(\"type\",mysql_result($result,0,\"TYPE_PHOTO\"));\r\n\t\t$photoTag->addInfo(\"commentaire\",mysql_result($result,0,\"COMMENTAIRE\"));\r\n\r\n\t\t$result = mysql_query(\"select * from PhotoTag_a_Personne, Utilisateur where FK_ID_PHOTO_TAG = \" . $idPhotoTag . \" and FK_ID_UTILISATEUR = id_user\");\r\n\t\t$personnes = \"\";\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($result) ; $i++){\r\n\t\t\t$personnes .= mysql_result($result,$i,\"nom\") . \" \" . mysql_result($result,$i,\"prenom\") . \", \";\r\n\t\t}\r\n\t\t$photoTag->addInfo(\"personnes\",$personnes);\r\n\r\n\t\t$result = mysql_query(\"select * from PhotoTag_a_Moto, Motos, Marques where IdMarque = marque and FK_ID_PHOTO_TAG = \" . $idPhotoTag . \" and FK_ID_MOTO = IdMoto\");\r\n\t\t$motos = \"\";\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($result) ; $i++){\r\n\t\t\t$motos = utf8_encode(mysql_result($result,$i,\"nommarque\") . \" \" . mysql_result($result,$i,\"motocmcube\") . \" \" . mysql_result($result,$i,\"nommoto\")) . \", \";\r\n\t\t\t}\r\n\t\t$photoTag->addInfo(\"motos\",$motos);\r\n\r\n\t\t$result = mysql_query(\"select * from PhotoTag_a_MotCle, MotCle where FK_ID_MOT_CLE = ID_MOT_CLE and FK_ID_PHOTO_TAG = \" . $idPhotoTag);\r\n\t\t$motsCles = \"\";\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($result) ; $i++){\r\n\t\t\t$motsCles .= mysql_result($result,$i,\"LIB_MOT_CLE\") . \", \";\r\n\t\t}\r\n\t\t$photoTag->addInfo(\"motsCles\",$motsCles);\r\n\r\n\t\t$lieux = \"\";\r\n\t\t$result = mysql_query(\"select * from PhotoTag_a_Lieu, Lieu where FK_ID_LIEU = ID_LIEU and FK_ID_PHOTO_TAG = \" . $idPhotoTag);\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($result) ; $i++){\r\n\t\t\t$lieux .= mysql_result($result,$i,\"LIB_LIEU\") . \", \";\r\n\t\t}\r\n\t\t$photoTag->addInfo(\"lieux\",$lieux);\r\n\r\n\t\tmysql_close();\r\n\t\treturn $photoTag;\r\n\t}", "function cextras_objets_valides(){\r\n\t$objets = array();\r\n\tforeach (array('article','auteur','breve','groupes_mot','mot','rubrique','site') as $objet) {\r\n\t\t$objets[$objet] = array(\r\n\t\t\t'table' => table_objet_sql($objet), \r\n\t\t\t'nom' => _T('cextras:table_'.$objet),\r\n\t\t);\r\n\t}\r\n\treturn $objets;\r\n}", "public function getAll()\n\t{\n\t\treturn $this->db->get('tabel_b')->result();\n\t}", "function getPlat(){\n //cration d'une connextion à la base de donnée\n $dbh = new PDO('mysql:host=localhost;dbname=resto_db_bwb', \"root\", \"\");\n //corp de la requete SQL du point de vue metier\n $request = \"SELECT * FROM plats\";\n //executon de la requete\n $statement = $dbh->query($request);\n //récupération du resultat de la requete\n $plats = $statement->fetchAll();\n return $plats;\n }", "public function structuresAutomatiques() {\n\t\t\t$this->Structurereferente = ClassRegistry::init( 'Structurereferente' );\n\n\t\t\t$results = $this->Structurereferente->find(\n\t\t\t\t'all',\n\t\t\t\tarray(\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'Structurereferente.typeorient_id',\n\t\t\t\t\t\t'( \"Structurereferente\".\"typeorient_id\" || \\'_\\' || \"Structurereferente\".\"id\" ) AS \"Structurereferente__id\"',\n\t\t\t\t\t\t'Canton.canton'\n\t\t\t\t\t),\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Structurereferente.typeorient_id' => Configure::read( 'Nonoriente66.notisemploi.typeorientId' )\n\t\t\t\t\t),\n\t\t\t\t\t'joins' => array(\n\t\t\t\t\t\t$this->Structurereferente->join( 'StructurereferenteZonegeographique' ),\n\t\t\t\t\t\t$this->Structurereferente->StructurereferenteZonegeographique->join( 'Zonegeographique' ),\n\t\t\t\t\t\t$this->Structurereferente->StructurereferenteZonegeographique->Zonegeographique->join( 'Canton' )\n\t\t\t\t\t),\n\t\t\t\t\t'contain' => false\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn Set::combine( $results, '{n}.Structurereferente.typeorient_id', '{n}.Structurereferente.id', '{n}.Canton.canton' );\n\t\t}", "public function obteterDatos($id_OrdenCompra){\n\t\t\techo '---'.$id_OrdenCompra.'---';\n\t\t\t$conexion = $this->conn;\n\t\t\t$sth = $conexion->prepare('SELECT id_OrdenCompra, nombre_OrdenCompra as nombre, fecha_registro ,prop.tipo_procedencia , rfc, telefono , email , direccion , tipop.tipo , nickname , password , url_image from '.$this->nombreTabla.' OrdenCompra , procendias_OrdenCompra prop, tipos tipop where estado = 1 and OrdenCompra.id_tipo_procedencia= prop.id_tipo_procedencia and OrdenCompra.id_tipo = tipop.id_tipo and id_OrdenCompra = :id_OrdenCompra', array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\t\n\t\t\t$sth->bindParam(':id_OrdenCompra', $id_OrdenCompra, PDO::PARAM_INT );\n\t\t\t$sth->execute();\n\t\t\t$row = $sth->fetch(PDO::FETCH_ASSOC);\n\t\t\treturn $row;\n\t\t}", "public function findAll() {\n $sql = \"select * from book order by book_id desc\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $livres = array();\n foreach ($result as $row) {\n $livreId = $row['book_id'];\n $livres[$livreId] = $this->buildDomainObject($row);\n }\n return $livres;\n }", "public function Enumerate()\r\n {\r\n $query = \"select a.*, b.name as subsector, c.name as sector from actividad_comercial a \r\n inner join subsector b on a.subsector_id = b.id \r\n inner join sector c on b.sector_id = c.id order by a.name asc, b.name asc, c.name asc $sql_add\";\r\n $this->Util()->DB()->setQuery($query);\r\n $result = $this->Util()->DB()->GetResult();\r\n $data[\"items\"] = $result;\r\n // $data[\"pages\"] = $pages;\r\n return $data;\r\n }", "function getLibellEcriture($id_libel_ecriture) { //Renvoie le libellé dun ecriture/op divers\n\tglobal $dbHandler,$global_id_agence;\n\t$db = $dbHandler->openConnection();\n\n\t$sql=\"SELECT traduction from ad_traductions where id_str = $id_libel_ecriture ;\";\n\t\n\t$result = $db->query($sql);\n\tif (DB :: isError($result)) {\n\t\t$dbHandler->closeConnection(false);\n\t\tsignalErreur(__FILE__, __LINE__, __FUNCTION__, $result->getMessage());\n\t}\n\t$dbHandler->closeConnection(true);\n\t$retour = $result->fetchrow();\n\treturn $retour[0];\n}", "public function listInmueble($var){\n \n $sql=\"SELECT a.identificador, a.nombre_inmueble ,e.nombre_t_inmueble ,d.nombre_distrito ,a.direccion ,a.numero ,a.superficie ,\n a.habitaciones ,a.baño ,a.cochera ,a.descripcion ,a.precio ,a.from_url ,a.fecha ,a.tipo ,b.id_operacion ,b.id_people ,\n c.nombre_t_operacion,f.id_contrato,f.identificador as id_contrato,g.tiempo ,f.contrato \n from inmueble as a inner join operacion as b on a.id_inmuebe=b.id_inmueble \n inner join tipo_operacion as c on b.tipo_operacion=c.id_t_operacion inner join distrito as d on a.id_distrito =d.id_distrito\n inner join tipo_inmueble as e on a.tipo_inmueble=e.id_tipo_inmueble inner join contrato as f on b.id_operacion=f.id_operacion\n inner join tipo_contrato as g on f.id_t_contrato=g.id_t_contrato where a.tipo =?\";\n $rs=$this->con->prepare($sql);\n $rs->execute(array($var));\n return $rs->fetchAll(PDO::FETCH_OBJ);\n }", "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 }", "public static function data()\n {\n return DB::table('detailgaji')\n ->join('potongan', 'detailgaji.kd_potongan', '=', 'potongan.kd_potongan')\n\t \n ->select('potongan.kd_potongan', 'detailgaji.id', 'detailgaji.nomor', 'detailgaji.jumlah')\n\n ->orderBy('detailgaji.nomor', 'asc')\n\t \n ->paginate(10);\n }", "protected abstract function getIListar();", "public function VerDetallesCompras()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM detallecompras LEFT JOIN categorias ON detallecompras.categoria = categorias.codcategoria WHERE detallecompras.codcompra = ?\";\t\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(base64_decode($_GET[\"codcompra\"])));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\n\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t{\n\t\t$this->p[]=$row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}", "public function libros()\n {\n return $this->hasMany('App\\Modelos\\Libro',\n 'id_publicador', 'id_usuario');\n }", "function getListClasse($bdd)\n\t{\n\t\t$res=$bdd->query(\"SELECT * FROM `classe` e\");\n\t\t\n\t\t?>\n\t\t<table class=\"table table-bordered\">\n <thead>\n <tr>\n <th>#ID</th>\n <th>Libelle</th>\n <th>Niveau</th>\n </tr>\n </thead>\n <tbody>\n\t\t<?php\n\t\twhile($var = $res->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t?>\n\t\t\t<tr>\n <td><?php echo $var['id']; ?></td>\n <td><?php echo $var['libelle']; ?></td>\n <td><?php echo $var['niveau']; ?></td>\n \n </tr>\n\t\t\t\t\t\t\t \n\t\t\t<?php\n\t\t}\n\t\t?></tbody></table><?php\n\t\t$bdd=null;\n\t}", "public function getList(){\r\n $listArticles =[]; ///on creer une liste vide ou ont mettra tous les articles\r\n\r\n\r\n //prepare une requete de type select\r\n $sql='SELECT * FROM articles';\r\n $req = $this->bdd->prepare($sql);\r\n\r\n//////execution de la requete avec attribution des valeurs\r\n$req->execute();\r\n\r\n/////on stocke les données obtenues dans un tableau\r\nwhile ($donnees = $req->fetch(PDO::FETCH_ASSOC)){///tant que il y a des article alors on boucle\r\n ////on cree des objets avec les données issue de la bdd\r\n $articles = new articles();\r\n $articles->hydrate($donnees);\r\n $listArticles[] = $articles;\r\n}\r\n///print_r2($listArticles)\r\nreturn $listArticles;\r\n\r\n}", "public final function findAll(){\n\n //Récupère la méthode de connection à la Base de donnée\n $dbc = Application::getInstance()->getDBConnection();\n\n //Variable où la requête est enregistrée\n $query = \"select * from Album\";\n\n //Requête en dur, prends la bdd et y exécute la requête\n $stmt = $dbc->query($query);\n\n /*Récupère tout les tuples de Album, et les transpose dans des instances de classe Album\n Et fini par enregistrer le résultat dans $results, FALSE est retourné s'ya erreur */\n $results = $stmt->fetchALL(PDO::FETCH_CLASS, 'Album');\n\n //Retourne le résultat de $results\n return $results;\n }", "function getAllByType($tipo) {\n global $dbh, $schema;\n try {\n // using prepared statements will help protect you from SQL injection\n $stmt = $dbh->prepare(\"SELECT * FROM $schema.ingrediente where tipo = :tipo\");\n $stmt->bindParam(':tipo', $tipo);\n\t $stmt->execute();\n // get array containing all of the result set rows \n $result = $stmt->fetchall(PDO::FETCH_ASSOC);\n return $result;\n }\n catch(PDOException $e) {\n $_SESSION[\"s_errors\"][\"generic\"][] = \"ERRO[18]: \".$e->getMessage();\n header(\"Location: ../../index.php\");\n die;\n }\n }", "function get_all_itens_laboratorio()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('itens_laboratorio')->result_array();\n }", "function get_all_prodi()\n {\n $this->db->join('jurusan', 'jurusan.id_jurusan = prodi.fk_id_jurusan');\n $this->db->order_by('id_prodi', 'desc');\n return $this->db->get('prodi')->result_array();\n }", "function recuperer_bsm_entier(){\n global $db;\n $sql = \"SELECT * FROM bsm \";\n $req = $db->prepare($sql);\n $req-> execute();\n $results = array();\n while($rows = $req->fetchObject()){\n $results[] = $rows;\n }\n return $results;\n}", "function getListModelo()\n{\n global $conn;\n /*\n *query da disciplina\n */\n $sqld = \"SELECT\n cat_id,\n cat_titulo\n\n FROM \".TABLE_PREFIX.\"_categoria\n WHERE cat_status=1 AND cat_area='Modelo'\n ORDER BY cat_titulo\";\n\n $disciplina = array();\n if(!$qryd = $conn->prepare($sqld))\n echo divAlert($conn->error, 'error');\n\n else {\n\n $qryd->execute();\n $qryd->bind_result($id, $titulo);\n\n while ($qryd->fetch())\n $disciplina[$id] = $titulo;\n\n $qryd->close();\n\n\n }\n\n return $disciplina;\n}", "function tabledata_Cadre_voirlestables ($serveur,$boolSPIP=false)\r\n{\r\n global $connect_statut, $spip_lang, $connect_id_auteur;\r\n\r\n $tables_extra = array();\r\n $tables_spip = array();\r\n $intNbExtra = 0 ;\r\n\r\n $sqlResultTables = sql_showbase('%');\r\n while ($tabNomTable = sql_fetch($sqlResultTables))\r\n {\r\n foreach ($tabNomTable as $key => $val)\r\n {\r\n if (preg_match('#^'.tabledata_table_prefix().'_#', $val))\r\n {\r\n $tables_spip[] = $val;\r\n }\r\n else\r\n {\r\n $tables_extra[] = $val;\r\n ++$intNbExtra ;\r\n }\r\n }\r\n }\r\n\r\n // affichage\r\n echo \"Choisir une table Extra parmis celle ci-dessous:\\n\";\r\n if ($intNbExtra<1)\r\n {\r\n echo \"Aucune table extra ne semble disponible.\";\r\n }\r\n else\r\n {\r\n echo tabledata_table_HTML ($tables_extra);\r\n }\r\n if ($boolSPIP)\r\n {\r\n echo \"<hr/>\";\r\n echo \"Les tables de SPIP :\\n\";\r\n echo tabledata_table_HTML ($tables_spip);\r\n }\r\n return;\r\n}", "public function tabel_data()\n {\n $tampil = $this->koneksi()->prepare(\"SELECT id FROM tb_users\");\n $tampil->execute();\n $tampil->setFetchMode(PDO::FETCH_ASSOC);\n if (count($tampil)>0){\n while ($data=$tampil->fetch(PDO::FETCH_ORI_NEXT)){\n $user_id_array [] = $data['id'];\n }\n }\n\n $tampil = $this->koneksi()->prepare(\"SELECT id FROM tb_lbb\");\n $tampil->execute();\n $tampil->setFetchMode(PDO::FETCH_ASSOC);\n if (count($tampil)>0){\n while ($data=$tampil->fetch(PDO::FETCH_ORI_NEXT)){\n $lbb_id_array [] = $data['id'];\n }\n }\n\n foreach ($user_id_array as $user_id){\n foreach ($lbb_id_array as $lbb_id){\n $rating = \"0\";\n $tampil = $this->koneksi()->prepare(\"SELECT rating FROM tb_rating WHERE user_id=:user_id AND lbb_id=:lbb_id\");\n $tampil->bindParam(':user_id', $user_id);\n $tampil->bindParam(':lbb_id', $lbb_id);\n $tampil->execute();\n $tampil->setFetchMode(PDO::FETCH_ASSOC);\n if (count($tampil)>0){\n while ($data=$tampil->fetch(PDO::FETCH_ORI_NEXT)){\n $rating = $data['rating'];\n }\n }\n $tabel_data [$user_id] [$lbb_id] = $rating;\n }\n }\n\n return $tabel_data;\n }", "public function allData()\n {\n return DB::table('tbl_laporankeluar')\n ->leftJoin('tbl_sales', 'tbl_sales.id_sales', '=', 'tbl_laporankeluar.id_sales')\n ->leftJoin('tbl_produk', 'tbl_produk.id_produk', '=', 'tbl_laporankeluar.id_produk')\n ->orderBy('id_laporan', 'desc')\n ->get();\n }", "function afficherProduits(){\n\t\t$sql=\"SElECT * From paniers \";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t\n }", "public function list_lend($id){\n\t\t\t//matriculas de los alumnos con idlibro \n\t\t\t//Obtener sus nombres\n\t\t\t$this->db->select('*');\n\t\t\t$this->db->from('prestamo');\n\t\t\t$this->db->join('estudiante','estudiante.matricula = prestamo.matricula');\n\t\t\t$this->db->where('prestamo.idlibro',$id);\n\t\t\t$query=$this->db->get();\n\n\t\t\treturn $query->result();\n\t\t}", "public function libros()\n {\n return $this->belongsToMany('App\\Modelos\\Libro', 'autor_libro', 'autor_id', 'libro_id');\n }", "Function getsqlproduit($id)\n{\n $query='SELECT PR.prix,PR.description,PR.titre as titre,PR.prix,PR.photo,PR.ref,PR.description,PR.idcat,CA.titre as cat_titre from produits PR, categories CA where PR.idcat=CA.idcat and pr.idpr='.$id.';';\n $result=selectTable($query);\n if($result==false){\n return false;\n }else{\n return $result[0];\n }\n // test si resultat est ok et gérer renvoi\n\n}", "public function obtenerTabla() {\n $builder = $this->db->table($this->table);\n $data = $builder->get()->getResult();\n $tabla = '';\n foreach($data as $item):\n $accion = '<div class=\\\"custom-control custom-radio\\\">';\n $accion .= '<input type=\\\"radio\\\" id=\\\"row-'.$item->tipoTelefonoId.'\\\" name=\\\"id\\\" class=\\\"custom-control-input radio-edit\\\" value=\\\"'.$item->tipoTelefonoId.'\\\">';\n $accion .= '<label class=\\\"custom-control-label\\\" for=\\\"row-'.$item->tipoTelefonoId.'\\\"> </label> </div>';\n $tabla .= '{\n \"concepto\" : \"'.$item->tipoTelefonoTipo.'\",\n \"acciones\" : \"'.$accion.'\"\n },';\n endforeach;\n $tabla = substr($tabla, 0, strlen($tabla) - 1);\n $result = '{\"data\" : ['. $tabla .']}';\n return $this->response->setStatusCode(200)->setBody($result);\n }", "function getRelaciones() {\r\n //arreglo relacion de tablas\r\n //---------------------------->DEPARTAMENTO(OPERADOR)\r\n //---------------------------->TEMA(TIPO)\r\n\t\t$relacion_tablas['documento_tema']['dti_id']['tabla']='documento_tipo';\r\n\t\t$relacion_tablas['documento_tema']['dti_id']['campo']='dti_id';\r\n\t\t$relacion_tablas['documento_tema']['dti_id']['remplazo']='dti_nombre';\r\n\t\t//---------------------------->TEMA(TIPO)\r\n\r\n\t\t//---------------------------->SUBTEMA(TEMA)\r\n\t\t$relacion_tablas['documento_subtema']['dot_id']['tabla']='documento_tema';\r\n\t\t$relacion_tablas['documento_subtema']['dot_id']['campo']='dot_id';\r\n\t\t$relacion_tablas['documento_subtema']['dot_id']['remplazo']='dot_nombre';\r\n //---------------------------->SUBTEMA(TEMA)\r\n\r\n //---------------------------->DOCUMENTO(OPERADOR)\r\n $relacion_tablas['documento_actor']['ope_id']['tabla']='operador';\r\n\t\t$relacion_tablas['documento_actor']['ope_id']['campo']='ope_id';\r\n\t\t$relacion_tablas['documento_actor']['ope_id']['remplazo']='ope_nombre';\r\n //---------------------------->DOCUMENTO(TIPO DE ACTOR)\r\n $relacion_tablas['documento_actor']['dta_id']['tabla']='documento_tipo_actor';\r\n\t\t$relacion_tablas['documento_actor']['dta_id']['campo']='dta_id';\r\n\t\t$relacion_tablas['documento_actor']['dta_id']['remplazo']='dta_nombre';\r\n //----------------------------<DOCUMENTO\r\n\r\n\t\t//---------------------------->DEPARTAMENTO(OPERADOR)\r\n\t\t$relacion_tablas['departamento']['ope_id']['tabla']='operador';\r\n\t\t$relacion_tablas['departamento']['ope_id']['campo']='ope_id';\r\n\t\t$relacion_tablas['departamento']['ope_id']['remplazo']='ope_nombre';\r\n\t\t//---------------------------->DEPARTAMENTO(OPERADOR)\r\n\r\n\t\t//---------------------------->DEPARTAMENTO(REGION)\r\n\t\t$relacion_tablas['departamento']['dpr_id']['tabla']='departamento_region';\r\n\t\t$relacion_tablas['departamento']['dpr_id']['campo']='dpr_id';\r\n\t\t$relacion_tablas['departamento']['dpr_id']['remplazo']='dpr_nombre';\r\n //---------------------------->DEPARTAMENTO(REGION)\r\n\r\n\t\t//---------------------------->MUNICIPIO(DEPARTAMENTO)\r\n\t\t$relacion_tablas['municipio']['dep_id']['tabla']='departamento';\r\n\t\t$relacion_tablas['municipio']['dep_id']['campo']='dep_id';\r\n\t\t$relacion_tablas['municipio']['dep_id']['remplazo']='dep_nombre';\r\n //---------------------------->MUNICIPIO(DEPARTAMENTO)\r\n\r\n return $relacion_tablas;\r\n }", "public static function getAll() {\n $lesObjets = array();\n $requete = \"SELECT * FROM Offre\";\n $stmt = Bdd::getPdo()->prepare($requete);\n $ok = $stmt->execute();\n if ($ok) {\n while ($enreg = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $lesObjets[] = self::enregVersMetier($enreg);\n }\n }\n return $lesObjets;\n }", "public static function vistasModel($tabla)\n\t{\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla\"); \n\t\t//Si la ejecucion de la consulta es exitosa se aocia el array conlos resultados para mostrar todas las categorias\n\t\tif($stmt->execute())\n\t\t{\n\t\t\treturn $stmt->fetchAll();\n\t\t}\n\t\t$stmt->close(); \n\t}", "public static function liste(){\n\t\t\t$sql=\"SELECT * from Genre\";\n\t\t\t$res=DB::get_instance()->prepare($sql);\n\t\t\t$res->execute();\n\t\t\t// gérer les erreurs éventuelles\n\t\t\tif($res->rowCount()==0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$p= $res->fetchAll();\n\t\t\treturn $p;\n\t\t\t\n\t\t}", "public function findAll(){\n //recupere le nom de la classe et le formate\n $table = strtolower(get_class($this));\n\n //Prepare la requete\n $query = \"SELECT * FROM $table\";\n $results = $this->conn->prepare($query);\n\n //Execution requete et stockage resultats dans une variable\n $results->execute();\n $resultats = $results->fetchAll(PDO::FETCH_ASSOC);\n return $resultats;\n }", "public function listado() {\n $sql = \"SELECT * FROM tiendas ORDER BY nombre ASC\";\n $data = ModeloConexion::ejecutar( $sql , DB_NAME ,DB_SELECT);\n $respuesta = array();\n for ( $i = 0; $i < $data['TOTAL']; $i++) {\n $rp = new stdClass();\n $rp->tienda_nombre = $data['LISTA'][$i]->nombre;\n $rp->latitud = $data['LISTA'][$i]->latitud;\n $rp->longitud = $data['LISTA'][$i]->longitud;\n $rp->tienda_id = $data['LISTA'][$i]->id;\n $respuesta[] = $rp;\n }\n \treturn $respuesta;\n }", "function get_list()\n {\n \tif($this->table_name === null)\n \t\treturn false;\n \t\n \t$select = \"{$this->table_name}.*\";\n $select .= \", deposito.no_rekening, nasabah.NAMA_NASABAH, nasabah.ALAMAT,\";\n \t\n\t\t// ADD YOUR SELECT FROM JOIN HERE <------------------------------------------------------\n\t\t// for example $select .= \", user_log.created_date, user_log.update_date\";\n\t\t\n \tif(!empty($this->relation))\n \t\tforeach($this->relation as $relation)\n \t\t{\n \t\t\tlist($field_name , $related_table , $related_field_title) = $relation;\n \t\t\t$unique_join_name = $this->_unique_join_name($field_name);\n \t\t\t$unique_field_name = $this->_unique_field_name($field_name);\n \t\t\t\n\t\t\t\tif(strstr($related_field_title,'{'))\n \t\t\t\t$select .= \", CONCAT('\".str_replace(array('{','}'),array(\"',COALESCE({$unique_join_name}.\",\", ''),'\"),str_replace(\"'\",\"\\\\'\",$related_field_title)).\"') as $unique_field_name\";\n \t\t\telse \t\t\t\n \t\t\t\t$select .= \", $unique_join_name.$related_field_title as $unique_field_name\";\n \t\t\t\n \t\t\tif($this->field_exists($related_field_title))\n \t\t\t\t$select .= \", {$this->table_name}.$related_field_title as '{$this->table_name}.$related_field_title'\";\n \t\t}\n \t\t\n \t$this->db->select($select, false);\n \t\n // ADD YOUR JOIN HERE for example: <------------------------------------------------------\n // $this->db->join('user_log','user_log.user_id = users.id');\n $this->db->join('nasabah','nasabah.NASABAH_ID = '.$this->table_name.'.NASABAH_ID');\n \t$results = $this->db->get($this->table_name)->result();\n \t\n \treturn $results;\n }", "function listar_conceptos_lab_por_producto($id_producto){\n\t\t$sql = \"SELECT \ta.id as id_lab_cpt_prd, a.id_producto, a.id_lab_concepto as id, a.lim_inf, a.lim_sup,\n\t\t\t\t\t\t\t\t\t\ta.referencia, b.parametro, b.is_numeric, c.descripcion as unidad\n\t\t\t\t\t\tFROM\t\tprd_lab_conceptos_productos a\n\t\t\t\t\t\t\t\t\t\tINNER JOIN prd_lab_conceptos b on a.id_lab_concepto = b.id\n\t\t\t\t\t\t\t\t\t\tINNER JOIN prd_lab_unidades c on b.unidad = c.id\n\t\t\t\t\t\tWHERE \tid_producto = \" . $id_producto . \"\n\t\t\t\t\t\tORDER BY a.id\";\n\n\t\treturn $this->queryArray($sql);\n\t}", "public function listarbiofinCE(){\n $stmt = $this->objPDO->prepare(\"SELECT b.id_biopsia,b.num_biopsia,b.fecha_ingreso,db.fecha_informe,(e.emp_nombres||' '||e.emp_appaterno||' '||e.emp_apmaterno) as medico,\n list(m.descr_muestra)as muestras from sisanatom.biopsia b \n inner join sisanatom.detalle_bioce db on b.id_biopsia=db.id_biopsia\n inner join sisanatom.muestras_biopsia mb on b.id_biopsia=mb.id_biopsia inner join empleados e on b.patologo_responsable=e.emp_id\n inner join sisanatom.muestra m on m.id_muestra=mb.id_muestrarem\n where b.estado_biopsia=3 and b.condicion_biopsia='A'\n group by b.id_biopsia,b.num_biopsia,b.fecha_ingreso,db.fecha_informe,medico\");\n $stmt->execute();\n $pacientes = $stmt->fetchAll(PDO::FETCH_OBJ);\n return $pacientes;\n }", "public function getLadas()\n {\n try {\n\n $conn = $this->makeConn->makeConnection();\n\n $res = $conn->query('select * from Ladas;');\n\n $array_result = [];\n\n foreach ($res->fetchAll() as $item) {\n array_push(\n $array_result,\n [\n 'lada' => $item['lada'],\n 'city' => $item['city'],\n 'state' => $item['state'],\n 'lada' => $item['lada'],\n 'id' => $item['id']\n ]\n );\n }\n\n echo json_encode($array_result);\n } catch (Exception $e) {\n echo 'Ocurrió un error al obtener las ladas';\n }\n }", "public function getCatalogue()\n {\n\n $json = file_get_contents($this->getBaseURL());\n\n if ($json !== null) {\n $data = json_decode($json, true);\n\n if (count($data) > 0) {\n\n // On enregistre les tableaux dans lesquels on va se \"promener\"\n $tabResults = $data['response']['docs'];\n\n if (count($tabResults) > 0) {\n\n // Pour chaque tableau (dans le tableau \"docs\"), on enregistre le Label, l'URI et les auteurs (nom/prenom)\n foreach ($tabResults as $key => $element) {\n $publication = new Publication($element['label_s'], $element['authFullName_s'], $element['uri_s'], $element['modifiedDate_s']);\n\n $this->addPublication($publication);\n }\n\n } else {\n echo MESSAGE_NO_RESULTS_AVAILABLE_ERROR;\n }\n } else {\n die(MESSAGE_NO_DATA_AVAILABLE_ERROR);\n }\n } else {\n die(MESSAGE_PROBLEM_WITH_URL_ERROR);\n }\n\n return $this->publications;\n\n }", "public function ComprasPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM (compras INNER JOIN proveedores ON compras.codproveedor = proveedores.codproveedor) INNER JOIN usuarios ON compras.codigo = usuarios.codigo LEFT JOIN mediospagos ON compras.formacompra = mediospagos.codmediopago WHERE compras.codcompra = ?\";\t\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codcompra\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function get_detail_lapak($idLapak) {\n $res = $this->db->query(\"SELECT * FROM pelapak INNER JOIN pasar ON pelapak.id_pasar=pasar.id_pasar WHERE id_pelapak IN ('$idLapak')\");\n if($res->num_rows() > 0){\n $data['data'] = $res->row();\n $data['message'] = \"Data Ditemukan\";\n $data['error'] = 200;\n }else{\n $data['message'] = \"Data tidak ada\";\n $data['code'] = 404;\n }\n \n print json_encode($data);\n }", "public function getAllOrang(){\n $this->db->query('SELECT * FROM ' . $this->table);\n return $this->db->resultSet();\n }" ]
[ "0.680435", "0.66138595", "0.6455577", "0.64256614", "0.636575", "0.63391405", "0.6275459", "0.61881405", "0.6144506", "0.6125668", "0.6115616", "0.6095873", "0.6091777", "0.6089776", "0.60856134", "0.6070764", "0.60647404", "0.60647404", "0.60647404", "0.6044766", "0.6030757", "0.6021487", "0.6004361", "0.60009384", "0.59807515", "0.59754527", "0.59736633", "0.5969591", "0.5962259", "0.5959965", "0.5945163", "0.59293455", "0.59254205", "0.59213984", "0.59176326", "0.59075564", "0.5905206", "0.5899842", "0.58986735", "0.5878687", "0.58736944", "0.58646965", "0.5847016", "0.5840695", "0.58115673", "0.58108974", "0.58066744", "0.58049655", "0.58020467", "0.58010346", "0.5794748", "0.57889336", "0.5787017", "0.5780438", "0.5774565", "0.5774541", "0.57738256", "0.5773134", "0.57658064", "0.5764375", "0.5762046", "0.57560766", "0.5754922", "0.57546407", "0.57381827", "0.57359546", "0.5732977", "0.5732503", "0.57318324", "0.57248247", "0.5722076", "0.571215", "0.57105273", "0.5709082", "0.5707749", "0.570447", "0.57019675", "0.56995636", "0.56993544", "0.5697578", "0.56884396", "0.5680992", "0.56738496", "0.5670931", "0.56678605", "0.5665645", "0.56644976", "0.5663183", "0.5660039", "0.56591433", "0.5657316", "0.56572974", "0.5652112", "0.56487244", "0.5648381", "0.56463623", "0.56423587", "0.56398463", "0.5636874", "0.5636093" ]
0.6596486
2
Check if is manager
public function isManager() { return $this->manager; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isManager()\n {\n if ($this->getAdaptor() == 'manager') {\n return true;\n }\n\n return false;\n }", "public function isManager(){\n if($this->role->name == 'Manager' && $this->is_active == 1){\n return true;\n }\n return false;\n }", "public function isManager()\n {\n return $this->hasRole('ROLE_MANAGER') && $this->getOrganization();\n }", "function isManager(){\n $reply = JAM_posadmin_here;\n return $reply;\n }", "function isPeopleManager() {\n if($this->is_people_manager === null) {\n if($this->isAdministrator()) {\n $this->is_people_manager = true;\n } else {\n $this->is_people_manager = $this->getSystemPermission('people_management');\n } // if\n } // if\n return $this->is_people_manager;\n }", "function isAddable(){\n return VM_manager_here;\n }", "function isProjectManager() {\n if($this->is_project_manager === null) {\n if($this->isAdministrator()) {\n $this->is_project_manager = true;\n } else {\n $this->is_project_manager = $this->getSystemPermission('project_management');\n } // if\n } // if\n return $this->is_project_manager;\n }", "public function is_admin(){\n\t\treturn $this->account_type == \"manager\";\n\t}", "public function testUserIsManager()\n {\n $user = User::factory()->create([\n 'role' => 'manager']);\n $userIsManager = $user->isManager();\n $this->assertTrue($userIsManager);\n }", "public function manager()\n {\n \treturn $this->hasOne(manager::class);\n }", "public function currentUserHasManagerAccess()\n {\n $user = Service::getCurrentUser();\n \n if (!$user) {\n return false;\n }\n \n if ($this->userManagesSite($user)) {\n return true;\n }\n \n if ($user->isAdmin()) {\n return true;\n }\n \n return false;\n }", "public function getManager() {\n return $this->manager;\n }", "public function isUserManager()\n\t{\n\t\treturn (Bn::getValue('user_type') == 'M');\n\t}", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function isMan()\n {\n $res = $this->getEntity()->isMan();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->isMan();\n\t\t}\n return $res;\n }", "static function isPressManager($pressId = -1) {\n\t\treturn Validation::isAuthorized(ROLE_ID_MANAGER, $pressId);\n\t}", "public function actingAsManager()\n {\n $user = User::where('email', UserTableSeeder::MANAGER_CREDENTIALS['email'])->firstOrFail();\n\n return $this->actingAs($user);\n }", "protected function getManager()\n {\n return $this->manager;\n }", "public function manager();", "public function getIsDemoManagerAttribute(): bool\n {\n if ($this->user !== null) {\n return $this->user->isDemoManager();\n }\n return true;\n }", "public function hasCurrentManagers()\n {\n return $this->currentManagers->isNotEmpty();\n }", "function isCompanyManager($company) {\n if($this->isAdministrator() || $this->isPeopleManager()) {\n return true;\n } // if\n\n return $this->getCompanyId() == $company->getId() && $this->getSystemPermission('manage_company_details');\n }", "public function checkForManager() {\n\t\t\t// if activated return version\n\t\t\tif ( defined( 'WPFCM_VERSION' ) ) {\n\t\t\t\treturn WPFCM_VERSION;\n\t\t\t}\n\n\t\t\t// if installed return true\n\t\t\tif ( is_dir( $this->wpfcm_path ) || is_link( $this->wpfcm_path ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "function is_manager($user)\n{\n return is_array($user->roles) && in_array('manager', $user->roles);\n}", "public function manager()\n {\n $user = Auth::user();\n\n if($user != null && $user->hasRole('manager')) {\n return view('manager');\n }else{\n return view('welcome');\n }\n }", "public function hasManager($manager)\n {\n return $this->currentManagers()->where('manager_id', $manager->id)->exists();\n }", "public function manager()\n {\n return $this->belongsTo('Fantasee\\Manager');\n }", "public function isHeadManager()\n {\n return UserHeadManager::find()->andWhere('id=' . $this->user_id)->exists();\n }", "public function getManager($name = null)\n {\n // TODO: Implement getManager() method.\n }", "public function getObjectManager() {}", "protected function getObjectManager() {}", "public function entity()\n {\n return Manager::class;\n }", "public function getObjectManager();", "public function getObjectManager();", "public function getManager()\n {\n return $this->hasOne(User::class, ['id' => 'manager_id']);\n }", "static function getManager123($a_sManager) {\n \n }", "public function getObjectManager(): mixed\n {\n return $this->objectManager;\n }", "public function manager() {\n return $this->hasMany('App\\Project', 'id_manager')\n ->where('status', '=', 'active');\n }", "function wieting_check_managers_action($object,$context) {\n\n $path = 'wieting/available/Managers/'.$object->nid;\n drupal_goto($path); // Invoke the available listing.\n\n return;\n}", "public static function manager(): string\n {\n $self = static::class;\n\n return $self . 'Manager';\n }", "protected function getObjectManager()\n {\n return $this->managerRegistry->getManager($this->managerName);\n }", "public function getManagers()\n {\n return $this->managers;\n }", "public function getObjectManager()\r\n {\r\n return $this->objectManager;\r\n }", "public function getManager() {\n return $this->em;\n }", "public function manager()\n\t{\n return $this->belongsTo('Manager');\n\t}", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getObjectManager() {\n\t\tif(($this->objectManager instanceof \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager) === false) {\n\t\t\t$this->objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Object\\ObjectManager::class);\n\t\t}\n\n\t\treturn $this->objectManager;\n\t}", "public function getObjectManager() {\n\t\tif(($this->objectManager instanceof \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager) === false) {\n\t\t\t$this->objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\t\t}\n\n\t\treturn $this->objectManager;\n\t}", "protected function ensureAuthManagerDefined()\n\t{\n\t\tif(($this->_authManager=Yii::app()->authManager)===null)\n\t\t{\n\t\t\t$message = \"Error: an authorization manager, named 'authManager' must be con-figured to use this command.\";\n\t\t\t$this->usageError($message);\n\t\t}\n\t}", "protected function getObjectManager()\n {\n return $this->objectManager;\n }", "protected function ensureAuthManagerDefined()\n\t{\n\t\tif(($this->_authManager=Yii::app()->authManager)===null)\n\t\t{\n\t\t $message = \"Error: an authorization manager, named 'authManager' must be con-figured to use this command.\";\n\t\t\t$this->usageError($message);\n\t\t}\n\t}", "protected function getObjectManager()\n {\n return $this->_objectManager;\n }", "public function isManager($userID, $lookupID = null)\n {\n // Make the query to retreive manager id associated with team:\n $q = \"SELECT id_user\n FROM teams\n WHERE id_team = {$this->id_team}\n LIMIT 1\";\n\n // Exeecute the query\n $result = $this->_dbObject->getOne($q);\n\n return ($result == $userID);\n }", "protected function _isAllowed()\r\n\t{\r\n\t\treturn Mage::getSingleton('admin/session')->isAllowed('system/tools/modulesmanager');\r\n\t}", "public function setManager( $manager )\n {\n $this->manager = $manager;\n }", "protected function ensureAuthManagerDefined() {\r\n if (($this->_authManager = Yii::app()->authManager) === null) {\r\n $message = \"Error: an authorization manager, named 'authManager' must be con-figured to use this command.\";\r\n $this->usageError($message);\r\n }\r\n }", "public function getModuleManager();", "public function isModerator()\n {\n }", "public function getIsAdministrator() {}", "public function getManager(): Gutenberg\n {\n return $this->manager;\n }", "public function manager(User $user, Project $project): bool\n {\n return $user->can('manage', $project);\n }", "public function manager(){\n return $this->belongsTo('App\\Modules\\User\\Models\\User', 'managed_by');\n }", "function isAdmin()\n\t{\n\t // if we've already worked this out, return it.\n\t\tif (isset($this->systemadmin)) {\n\t\t\treturn $this->systemadmin;\n\t\t}\n\t\t\n\t\t$admin = false;\n\t\t\n\t\tif ($this->group->systemadmin == 1) {\n\t\t $admin = true;\n\t\t}\n\t\t\n\t\t$this->systemadmin = $admin;\n\t\t\n\t\treturn $this->systemadmin;\n\t}", "public function getSharedManager();", "public function getManagerNames()\n {\n return ['default'];\n }", "private function getUserManager() {\n return $this->get('seip.user_manager');\n }", "public function getObjectManager(){\n return $this->entityManager;\n }", "protected function getModule_ManagerService()\n {\n return $this->services['module.manager'] = new \\phpbb\\module\\module_manager(${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['ext.manager']) ? $this->services['ext.manager'] : $this->getExt_ManagerService()) && false ?: '_'}, 'phpbb_modules', './../', 'php');\n }", "public function hasPackageManager() {}", "public function is_forum_manager($user)\n {\n $is_forum_manager = false;\n\n if ($user->is_teacher())\n {\n\n $course = $this->get_course();\n\n $is_forum_manager = ($course->get_titular_id() == $user->get_id());\n\n if (! $is_forum_manager)\n {\n $is_forum_manager = $course->is_course_admin($user);\n }\n }\n\n if (! $is_forum_manager)\n {\n $is_forum_manager = $this->is_allowed(WeblcmsRights::ADD_RIGHT, $this->publication);\n }\n\n return $is_forum_manager;\n }", "protected function getManager($manager)\n {\n switch ($manager) {\n case 'cms':\n return \\Winter\\User\\Classes\\AuthManager::instance();\n case 'backend':\n return \\Backend\\Classes\\AuthManager::instance();\n }\n\n throw new ApplicationException('Invalid manager provided. Must be either \"cms\" or \"backend\".');\n }", "public function testGetNodeTypesManager()\n {\n $this->assertSame($this->session->getNodeTypesManager(), $this->session->getNodeTypesManager());\n }", "public function getManagers()\n {\n // TODO: Implement getManagers() method.\n }", "private function createManagerDefinition()\n {\n $id = $this->getServiceId('manager');\n if (!$this->container->has($id)) {\n $this->container->setAlias($id, new Alias($this->getManagerServiceId()));\n }\n }", "function analogue()\n {\n return Manager::getInstance();\n }", "protected function managerIsRunning() : bool\n {\n global $argv;\n $cliOutput = [];\n exec('ps x | grep ' . $argv[0], $cliOutput);\n $processCount = 0;\n if (empty($cliOutput)) {\n return false;\n }\n foreach ($cliOutput as $line) {\n if (strpos($line, 'grep') !== false) {\n continue;\n }\n if (strpos($line, '/bin/sh') !== false) {\n continue;\n }\n $processCount++;\n }\n return ($processCount > 1) ? true : false;\n }", "public function isOwner();", "public function isMaster();", "protected function registerManager()\n {\n $this->app->singleton(\n 'tab',\n function () {\n new Manager();\n }\n );\n }", "public function isManaged(): bool\n {\n }", "public function isAdmin()\n {\n return $this->type == self::TYPE_ADMIN ;\n }", "public function getEventsManager() : ManagerInterface;", "public function isAdmin()\n\t{\n\t\t$this->reply(true);\n\t}", "public function getDatabaseManager(): DatabaseManager\n {\n return $this->manager;\n }", "public function getManagers()\n {\n return [$this->entityManager];\n }", "public function isAdmin(): bool\n {\n return $this->type() === self::ADMIN;\n }", "function isTicketter()\n {\n if($this->role != ROLE_ADMIN || $this->role != ROLE_MANAGER) { return true; }\n else {return false; }\n \n }", "public function getServiceManager()\n {\n return $this->sm;\n }", "public function isAdmin() {}", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function getObjectManager()\n {\n return $this->entityManager;\n }", "public function isModerator()\n {\n return in_array(Role::MODERATORS_SYSTEM_ROLE, $this->getRoleNamesForCurrentViewer());\n }", "function isAdmin()\n\t{\n\t\treturn $this->role == 3;\n\t}", "public function isOwner(){\n return (count($this->rooms()) > 0);\n }", "public function isAdmin()\n {\n return $this->role == 1;\n }" ]
[ "0.87303466", "0.83421856", "0.8306417", "0.79208356", "0.7351462", "0.7269674", "0.71739894", "0.71042764", "0.70206416", "0.69184846", "0.6856411", "0.68262416", "0.67852336", "0.6766466", "0.6766466", "0.6766466", "0.6750512", "0.67421764", "0.6709513", "0.66644585", "0.6626503", "0.65702283", "0.65387547", "0.64870286", "0.64496565", "0.6400422", "0.63660556", "0.6321527", "0.6314648", "0.6309024", "0.6224911", "0.6222022", "0.6190962", "0.61564565", "0.6152729", "0.6152729", "0.6113834", "0.61104095", "0.60930455", "0.60928506", "0.60655135", "0.6047686", "0.6040058", "0.6019329", "0.60139394", "0.60047597", "0.59991336", "0.59950054", "0.59950054", "0.59950054", "0.59950054", "0.5959219", "0.5958632", "0.5943624", "0.59424806", "0.59406966", "0.5932497", "0.5902063", "0.5880097", "0.58729184", "0.58273906", "0.5817459", "0.58067995", "0.5796199", "0.5792544", "0.5785658", "0.5778884", "0.5775598", "0.576715", "0.57624424", "0.57596034", "0.5714631", "0.57102364", "0.57098734", "0.57043535", "0.5687949", "0.56729877", "0.56554335", "0.5655192", "0.5650307", "0.56491184", "0.56400734", "0.5632148", "0.5629507", "0.56173456", "0.56154394", "0.5595075", "0.5593053", "0.55896753", "0.5573798", "0.557295", "0.55681324", "0.55634856", "0.55617124", "0.55492705", "0.554213", "0.553773", "0.55356", "0.5528659", "0.55282015" ]
0.8852006
0
echo "";var_dump("dmphu nhe");echo ""; exit;
function mail() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dump_die ($data){\n echo \"<pre>\";\n var_dump($data);\n echo \"</pre>\";\n die();\n}", "function bye($msg=null){\n print $msg . \"\\n\";\n exit;\n}", "function dd($output)\n {\n var_dump($output);\n die();\n }", "function dumpX($var)\n{\n dump($var);\n exit;\n}", "public function show()\n {\n echo 1;die;\n }", "public function test() {\n \t\n\t\tprint_r('hello stef');\n \t\n }", "function atk_var_dump($a, $d=\"\")\n{\n\tob_start();\n\tvar_dump($a);\n\t$data = ob_get_contents();\n\tatkdebug(\"vardump: \".($d!=\"\"?$d.\" = \":\"\").\"<pre>\".$data.\"</pre>\");\n\tob_end_clean();\n}", "function outTest($str){\n var_dump($str);\n}", "function dd($var) {\n echo '<pre>';\n var_dump($var);\n echo '</pre>';\n exit();\n}", "public function dig()\r\n\t{\r\n\t\techo \"Dug a hole \";\r\n\t}", "function toDie($msg) {\n $data = array(\"error\" => $msg);\n print_result($data);\n die();\n}", "public function dump($die = false);", "function dump($var)\n{\n echo '<br /><pre>';\n var_dump($var);\n echo'</pre><hr />';\n}", "public function test(){\n\t\techo \"i am in test\";\n\t}", "function debug($str) {\n\techo '<pre>';\n\tvar_dump($str);\n\techo '</pre>';\n\n}", "function printDefAndExit() {\n\techo json_encode([]);\n\texit;\n}", "public static function var_dumpp()\n {\n echo \"<pre>\";\n if(func_num_args()>0)\n foreach(func_get_args() as $argv)\n {\n var_dump($argv);\n }\n echo \"</pre>\";\n\n }", "function dd($data)\n{\n echo \"<pre>\";\n var_dump($data);\n echo \"</pre>\";\n die();\n}", "function prnx($s)\r\n{\r\n\tprn($s);\r\n\texit;\r\n}", "function grab_dump($var)\n{\n ob_start();\n var_dump($var);\n return ob_get_clean();\n}", "function pr($string, $isnull=false) {\n echo '<pre>';\n print_r($string);\n echo '</pre>';\n\n if($isnull)\n die('here');\n}", "function message_die($msg_text = \"\")\r\n{\r\n\tprint($msg_text);\r\n\texit;\r\n}", "function sdump($var)\n{\n ob_start();\n var_dump($var);\n $out = ob_get_contents();\n ob_end_clean();\n return $out;\n}", "function quick_dump($string)\n{\n $result='';$exa='';$cont=0;\n for ($i=0; $i<=strlen($string)-1; $i++)\n {\n if ((ord($string[$i]) <= 32 ) | (ord($string[$i]) > 126 ))\n {$result.=\" .\";}\n else\n {$result.=\" \".$string[$i];}\n if (strlen(dechex(ord($string[$i])))==2)\n {$exa.=\" \".dechex(ord($string[$i]));}\n else\n {$exa.=\" 0\".dechex(ord($string[$i]));}\n $cont++;if ($cont==15) {$cont=0; $result.=\"\\r\\n\"; $exa.=\"\\r\\n\";}\n }\n return $exa.\"\\r\\n\".$result;\n}", "function dumpAndDie ($value): void {\n\tvar_dump($value);\n\tdie();\n}", "function dd($parsed)\n{\n\t echo '<pre>';\n\t var_dump($parsed);\n\t echo '</pre>';\n die;\n}", "function vd($var) {\n\techo '<hr><pre>';\n\tvar_dump($var);\n\techo '</pre><hr>';\n}", "function stage_dump($dump)\n{\n if (is_array($dump) || is_object($dump)) {\n $message = '<pre>' . print_r($dump) . '</pre>';\n } else {\n $message = $dump;\n }\n\n wp_die($message);\n}", "function dd( $var ){\n echo \"<prev>\";\n die(print_r($var));//Finaliza la ejecucion\n}", "public function dieAction()\n {\n die(var_dump($this->getParam('hihi')));\n }", "function vardump($x)\r\n{\r\n\tob_start();\r\n\tvar_dump($x);\r\n\t$str = ob_get_clean();\r\n\treturn strip_tags($str);\r\n}", "final function what_is_good() {\n\t\t\techo \"Running is Good </br>\";\n\t\t}", "function print_debugger()\n\t{\n\t\t$output = str_replace(\"\\n\", \"<br/>\\n\", $this->debugger);\n\t\techo $output;\t\n\t}", "function ab(){\r\n\techo \"php\".\"<br>\";\r\n}", "function dbg ($x)\r\n{\r\n print_r ($x);\r\n exit;\r\n}", "function dump($content)\n {\n die(var_dump($content));\n exit;\n }", "function test(){\n echo 'sadasdasd';\n}", "function echoO()\n{\n echo 0;\n}", "public function practice1()\n {\n dump('This is the first example.');\n }", "function mvcshell_print($content)\n{\n die(\"Midgard MVC shell\\n\\n{$content}\\n\");\n}", "function debug( $data , $fim = false ){\n\techo '<pre style=\"display: block; text-align:left;\">';\n\tvar_dump($data);\n\techo '</pre>';\n\n\tif ($fim){\n\t\tdie();\n\t}\n}", "function died($error) {\necho \"Xảy ra lỗi!!! \";\necho \"<br /><br />\";\necho $error.\"<br /><br />\";\necho \"Hãy trở lại và sữa chữa các lỗi:<br /><br />\";\ndie();\n}", "public static function var_dump( $data )\n {\n // get the var_dump string by buffering the output\n ob_start();\n var_dump( $data );\n return ob_get_clean();\n }", "public function MyVarDump($var, $exit = true){\r\n\t\techo '<pre style=\"font-size:15px;\">';\r\n\t\t\tvar_dump($var);\r\n\t\techo '</pre>';\r\n\t\tif($exit){exit;}\r\n\t}", "private function debug($str){\n\n\t\techo $str.p;\n\n\t}", "function v($msg){\n var_dump($msg);\n}", "function test()\n{\n echo 'Hello' . PHP_EOL;\n return true;\n}", "final function whatIsGood() {\n echo \"Running is good <br>\";\n }", "function Err()\n{\n ob_end_clean();\n fprintf (STDERR, \"Chyba - Zadan spatny pocet argumentu, spatne typy operandu nebo vase instrukce neodpovida zadnemu regularnimu vyrazu!\\n\");\n exit(23);\n}", "function dump($var)\n{\n echo '<pre>';\n var_dump($var);\n echo '</pre>';\n}", "function debugMe($var, $die = true, $asString = false) {\n if($asString) {\n ob_start();\n var_dump($var);\n $deb_content = ob_get_contents();\n ob_end_clean();\n return $deb_content;\n }\n echo \"<pre>\";\n var_dump($var);\n echo \"</pre>\";\n if($die) {\n die();\n }\n}", "function testDebugDoNotShow() {\n Debug::$enable_show = false;\n ob_start();\n Debug::out('Testing, testing, 123');\n $output = ob_get_clean();\n $this->assertEqual('', $output);\n }", "public function mldump($var=\"No value given...\")\n {\n echo \"<pre>\";\n echo var_dump($var);\n echo \"</pre>\";\n }", "function var_dump_ret($mixed = null) {\r\n\t ob_start();\r\n\t var_dump($mixed);\r\n\t $content = ob_get_contents();\r\n\t ob_end_clean();\r\n\t return $content;\r\n\t}", "public function debugprint($variable,$desc=\"\",$exit=0) {\n\t}", "function p($p) {\n\tif ( $GLOBALS['debug'] === true ) {\n\t\techo $p.\"\\t<br>\\n\";\n\t}\n}", "public function mg_dump($arg){\n\t\t$debug = '<br /><br />Debug Output:<br /><pre>';\n\t\t$debug.= print_r($arg,true);\n\t\t$debug .= '</pre><br /><br />';\n\t\treturn $debug;\n\t}", "function debug($msg) {\n echo '<p><b>' . $msg . \"</b></p>\\n\";\n}", "function dd($var): void\n {\n call_user_func('dump', $var);\n die(1);\n }", "function dd($arg = \"\"){\n echo '<pre>';\n var_dump($arg);\n echo '</pre>';\n die();\n }", "function pied()\n\t{\n\t\techo \"\\t\".'</body>'.\"\\n\".'</html>';\n\t}", "abstract function doDump();", "function debugMsg($msg)\n {\n echo \"DEBUG MESSAGE: {$msg}<br>\\n\";\n }", "function dump ( $value )\n{\n if ( \\r8\\Env::request()->isCLI() ) {\n var_dump( $value );\n }\n else {\n echo \"<pre>\";\n var_dump( $value );\n echo \"</pre>\";\n }\n}", "function qa_debug($var)\n{\n\techo \"\\n\" . '<pre style=\"padding: 10px; background-color: #eee; color: #444; font-size: 11px; text-align: left\">';\n\techo $var === null ? 'NULL' : htmlspecialchars(print_r($var, true), ENT_COMPAT|ENT_SUBSTITUTE);\n\techo '</pre>' . \"\\n\";\n}", "function debugger(){\n $debug = 1;\n if($debug === 1) {\n header(\"Content-Type: text/html; charset=utf-8\");\n error_reporting(E_ALL);\n ini_set('display_errors', 1);\n }else{\n error_reporting( 0 );\n }\n}", "function defail($de=0)\n {\n ob_start(); $tn=dbug::trap(); dbug::trap('hush');\n if($de){error_reporting(0);};\n return $tn;\n }", "function kcd($var) {\n Debug::dump($var);\n}", "public function dress()\n {\n echo 'dresses suit'.PHP_EOL;\n }", "function print_msg($msg) {\n if ( php_sapi_name() == 'cli' ) {\n $msg = preg_replace('#<br\\s*/>#i', \"\\n\", $msg);\n $msg = preg_replace('#<h1>#i', '== ', $msg);\n $msg = preg_replace('#</h1>#i', ' ==', $msg);\n $msg = preg_replace('#<h2>#i', '=== ', $msg);\n $msg = preg_replace('#</h2>#i', ' ===', $msg);\n $msg = strip_tags($msg) . \"\\n\";\n }\n print $msg;\n}", "function app_debug($value, bool $die = null)\n{\n echo \"<pre>\";\n print_r($value);\n echo \"</pre>\";\n\n if ($die === true) die('<strong> End of debug </strong>');\n\n}", "function dd($data) {\r\n dump($data);\r\n die();\r\n}", "function debug_echo($line)\n{\n}", "function dd ($par) {\n\tdie($par);\n}", "function print_msg($msg) {\n if (php_sapi_name() == 'cli') {\n $msg = preg_replace('#<br\\s*>#i', \"\\n\", $msg);\n $msg = preg_replace('#<h1>#i', '== ', $msg);\n $msg = preg_replace('#</h1>#i', ' ==', $msg);\n $msg = preg_replace('#<h2>#i', '=== ', $msg);\n $msg = preg_replace('#</h2>#i', ' ===', $msg);\n $msg = strip_tags($msg) . \"\\n\";\n }\n print $msg;\n}", "public static function message($string) \n {\n echo $string;\n\t\texit;\n }", "function avoca_debug($var, $is_die = false)\n{\n echo '<pre>';\n print_r($var);\n echo '</pre>';\n\n if ($is_die) {\n die();\n }\n}", "function ffd_debug( $var = '' , $exit=false) {\r\n\r\n\techo '<pre style=\"/*display: none;*/\">';\r\n\t\tif( is_object($var) || is_array($var) )\r\n\t\t\tprint_r($var);\r\n\t\telse \r\n\t\t\tvar_dump($var);\r\n echo '</pre>';\r\n if( $exit )\r\n die();\r\n}", "function finalize($message) {\n echo $message;\n exit;\n }", "function report_error($msg) {\r\n print $msg;\r\n exit;\r\n}", "function pre_var_dump( $var ) {\n\techo '<pre>'.\"\\n\";\n\tvar_dump( $var );\n\techo '</pre>'.\"\\n\";\n}", "function chek_zadarma(){\n\tif (isset($_GET['zd_echo'])) exit($_GET['zd_echo']);\n}", "function dumper($error) {\n\n echo '<pre>';\n echo '<br />' . print_r($error) . '</pre><br />';\n echo '<hr>';\n}", "function bd($data) {\r\n bdump($data);\r\n}", "function died($error) {\n echo \"Na vjen keq, kodi ka gabime gjate dergimit. \"; \n echo \"Kto errore do te shfaqen me poshte.<br /><br />\"; \n echo $error.\"<br /><br />\"; \n echo \"Ju lutemi, shkoni prapa dhe provoni prape mbushni formen.<br /><br />\"; \n die(); \n }", "function ktd()\n {\n Helpers::die(Kint::trace());\n }", "function output_debug($str) {\n\techo date('Y-m-d H:i:s') . \": $str\\r\\n\";\n}", "function dnd($data){\r\n\r\n\techo \"<pre>\";\r\n\tvar_dump($data);\r\n\techo \"</pre>\";\r\n\tdie();\r\n}", "function log_dump($var, $header = false, $return = true){\n\t$ret = '';\n\tif ($header) $ret .= $header .':'; //As is and only explicitly given, without any magic\n\t$ret .= dump_utils::transformCorrect_print_r(print_r($var, true)).\"\\n\";\n\tif ($return) return $ret;\n\telse echo $ret;\n}", "function viewdump($data)\n {\n if (PLATFORM === 'development') {\n echo '<pre>';\n echo var_dump($data);\n echo '</pre>';\n exit();\n } else {\n return false;\n }\n }", "public function show(Answer $Answer)\n {\n echo \"bakhtawar123\";exit();\n //\n }", "function dd($var){\n\t\techo \"<pre>\";\n\t\tdie(print_r($var));\n\t}", "function dd($data, $data_name='$data') {\n $tmp_var = debug_backtrace(1);\n $caller = array_shift($tmp_var);\n\n error_reporting(-1);\n header('Content-Type: text/html; charset=utf-8');\n\n echo '<code>File: ' . $caller['file'] . ' / Line: ' . $caller['line'] . '</code>';\n echo '<pre>';\n echo $data_name . '=', PHP_EOL;\n VarDumper::dump($data, 10, true);\n echo '</pre>';\n\n die();\n}", "function err_dump( $obj )\n{\n ob_start();\n var_dump($obj);\n $tmp = ob_get_contents();\n ob_end_clean();\n error_log( $tmp );\n}", "public function print(){\n \t\techo 'hello';\n }", "function died($error) {\n \n echo \"Oeps, de volgende dingen zijn er fout gegaan!<br />\";\n echo $error.\"<br /><br />\";\n die(); \n }", "function debug($var, $die = false) {\n\techo \"<pre>\" . print_r($var, true) . \"</pre>\";\n\tif ($die) {\n\t\tdie;\n\t}\n}", "function emdebug($income_details = null, $debug_type = null){\n\tmdebug($income_details, $debug_type);\n\texit;\n}", "public static function ddump($variable) {\r\n\t\tif(Debug::enabled()) {\r\n\t\t\tif(func_num_args() >= 1) {\r\n\t\t\t\techo \"<pre>\";\r\n\t\t\t\t$args = func_get_args();\r\n\t\t\t\t\r\n\t\t\t\t$count = count($args);\r\n\t\t\t\tfor($x = 0; $x < $count; $x++) {\r\n\t\t\t\t\tvar_dump($args[$x]);\r\n\t\t\t\t}\r\n\t\t\t\techo Debug::getBackTrace('', 1, 'fdumped in');\r\n\t\t\t\techo \"\\n\\n\";\r\n\t\t\t\techo \"</pre>\"; \r\n\t\t\t}\r\n\t\t}\r\n\t\texit(-1);\r\n\t}", "function test($the_data)\n\t\t{\n\t\t\techo '<pre>';\n\t\t\tvar_dump($the_data);\n\t\t\techo '<pre/>';\n\t\t\texit;\n\t\t}", "function zdebug ($n,$v) {\n\t$x = 1;\n\tif ($x==1) {\n\t\techo \"<font color='green'>\".$n . \" = [\".$v.\"]</font><br>\"; \n\t}\n}" ]
[ "0.64805776", "0.62948716", "0.6242443", "0.6221724", "0.6205545", "0.6193746", "0.6191055", "0.6021101", "0.5986402", "0.59495384", "0.5914317", "0.5894492", "0.5883169", "0.5867237", "0.5860828", "0.5854786", "0.5846603", "0.57911915", "0.5789847", "0.5770173", "0.57395947", "0.57135", "0.57091296", "0.570466", "0.56836027", "0.56829476", "0.5680948", "0.56736666", "0.5670679", "0.56664896", "0.56658316", "0.5655352", "0.5653053", "0.5639283", "0.56297207", "0.56249183", "0.5613425", "0.56042624", "0.560072", "0.5599751", "0.5589559", "0.55756885", "0.55756617", "0.5575206", "0.55677634", "0.5559242", "0.55575156", "0.55551755", "0.55541915", "0.55464953", "0.5532386", "0.55278844", "0.5521586", "0.5516122", "0.5514148", "0.5508111", "0.55079454", "0.55039227", "0.5496548", "0.54929614", "0.54832125", "0.54762757", "0.54725105", "0.5463595", "0.54630715", "0.5461426", "0.5457823", "0.5451674", "0.54485303", "0.54477286", "0.5438273", "0.54335046", "0.5428325", "0.54267436", "0.5403446", "0.5403393", "0.53965175", "0.53954244", "0.5385415", "0.5381733", "0.5379567", "0.5377851", "0.53760135", "0.5368403", "0.53639036", "0.53554106", "0.53548336", "0.5351703", "0.5335138", "0.53336215", "0.5330983", "0.53174037", "0.5316398", "0.53096455", "0.5305964", "0.53038436", "0.53010947", "0.52973676", "0.5294534", "0.5288756", "0.52886176" ]
0.0
-1
Handle command with master process.
public abstract function handle(Connection $connection, ProcessManager $manager);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n #Comentei pq o supervisor fica subindo toda hora e o arquivo fica gigante\n #como já testei e vi que fucniona tá tranquilo\n// do {\n// \\Log::info(\"Command --- initial\");\n// } while (true);\n }", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n exec('/usr/bin/snmptrap -v 2c -c ' . env('HEARTBEAT_COMMUNITY') . ' 10.195.14.136 \"\" .1.3.6.1.4.1.35509.1.4.8');\n exec('/usr/bin/snmptrap -v 2c -c ' . env('HEARTBEAT_COMMUNITY') . ' 10.215.210.246 \"\" .1.3.6.1.4.1.35509.1.4.8');\n }", "public function handle()\n {\n $r = $this->sync->syncSubjectFromOracle();\n if (!$r) {\n Log::channel('syncsubject')->info(Carbon::now().' 会计科目同步失败');\n } else {\n Log::channel('syncsubject')->info(Carbon::now().' 会计科目同步成功');\n }\n\n }", "public function handle(AbstractCommand $command);", "public function handle()\n {\n $this->forlocal();\n // $this->forprodserver();\n }", "public function handle()\n {\n Log::warning('Disabled sms:receive command as it is unused and needs maintenance.');\n return;\n\n // Get last reply id from provider\n // TODO: Track provider ids separately. Also this is most likely provider\n // dependent\n $last_reply_id = $this->replies->getLastReplyId();\n\n $messages = $this->message_service->getMessages(['lastReceivedId' => $last_reply_id]);\n\n foreach ($messages as $message)\n {\n Log::info('[ReceiveSMS] Received SMS message from: ' . $message['from'] . \" with id: \" . $message['id']);\n\n if (!starts_with($message['from'], '+')) {\n $message['from'] = '+' . $message['from'];\n }\n\n $saved = $this->replies->save($from, $message['message'], $message['id']);\n\n // TODO:\n // send \"Response received\" from same number it was received on\n // log sms with relevant check_in_id\n\n if ($saved) {\n $this->message_service->sendResponseReceivedSMS($message['from']);\n }\n }\n }", "public function process(Message $command);", "public function handle()\n {\n $this->boot();\n\n // Do some pre-deploy checks\n SSH::preFlight($this, $this->stage, $this->branch);\n\n // Get the band-aid, we're going to patch some shit\n Deployer::doPatch($this->stage, $this->branch);\n\n // Done\n SSH::performLanding($this->stage);\n }", "public function handle() {\n \tif (Cache::has(\"DISCORD_BOT_RUNNING\")) {\n \t\tLog::info(\"Discord bot still running, not starting it again\");\n\t\t\treturn;\n\t\t}\n\t\tCache::put(\"DISCORD_BOT_RUNNING\", true, 1);\n\t\tLog::info(\"Starting Discord bot \");\n\t\t/** @var DiscordBot $discordController */\n\t\t$discordController = resolve('App\\Discord\\DiscordBot');\n\t\tLog::info(\"Created Discord Controller\");\n\t\ttry {\n\t\t\t$discordController->handle();\n\t\t}\n\t\tcatch (\\Exception $e) {\n\t\t\tCache::forget(\"DISCORD_BOT_RUNNING\");\n\t\t\tLog::error(\"Discord bot stops: \".$e);\n\t\t}\n\t\tLog::info(\"Discord bot running over\");\n\t\tCache::forget(\"DISCORD_BOT_RUNNING\");\n\n }", "public function handle()\n {\n //Check if has command argument included, if so, it will execute requesting function\n //depending on the argument is the number of requests to execute\n //4 (interview process number 4) \n //5 (interview process number 5) \n if($this->argument('processOption')=='4')\n $this->sendRequest('https://atomic.incfile.com/fakepost',1);\n else if($this->argument('processOption')=='5')\n $this->sendRequest('https://atomic.incfile.com/fakepost',100000);\n else\n $this->info('Argument required to execute request,(accepted only:4 or 5), example:\"php artisan request:fake 4\"');\n }", "public function handle()\n {\n $options = [\n 'process' => 0,\n ];\n $process = $this->choice('Which process?', [\n 'List user',\n 'List role',\n 'List permission',\n 'Change user\\'s password',\n 'Change E-mail address',\n ], $options['process']);\n\n switch ($process) {\n case 'List user':\n $this->listUser();\n break;\n case 'List role':\n $this->listRole();\n break;\n case 'List permission':\n $this->listPermission();\n break;\n case 'Change user\\'s password':\n $this->changeUserPassword();\n break;\n case 'Change E-mail address':\n $this->changeEmailAddress();\n break;\n }\n $this->continueOrStop();\n }", "public function handle()\n {\n // $cnt = $avRoom->load();\n // if ($cnt < 0)\n // {\n // return new CmdResp(ERR_SERVER, 'Server internal error');\n // }\n // if ($cnt === 0)\n // {\n // return new CmdResp(ERR_LIVE_NO_AV_ROOM_ID, 'The user doesn\\'t have av room id');\n // }\n $id = $this->record->save();\n if ($id < 0)\n {\n return new CmdResp(ERR_SERVER, 'Server internal error');\n }\n return new CmdResp(ERR_SUCCESS, '', array('id' => $id));\n }", "public function handle()\n {\n $this->process->mustRun();\n }", "public function handle()\n {\n $options = $this->gatherProcessingOptions();\n\n $this->registerLogWriters($options->connectionName);\n $this->listenForEvents();\n\n $nameResolver = new NameResolver(\n $this->getEvent($options->connectionName),\n $options->service\n );\n\n $consumer = (new ConsumerFactory($this->context, $this->laravel[AmqpTopic::class]))\n ->make($nameResolver);\n\n $processor = new MessageProcessor(\n $this->events,\n $this->exceptions,\n new JobsFactory($this->laravel, $this->context, $consumer),\n $options\n );\n\n (new Worker($consumer, $processor, $this->exceptions))->work($options);\n }", "public function handlerFor(Command $command);", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $host = config('signup.host');\n $username = config('signup.username');\n $password = config('signup.password');\n\n $this->mbox = imap_open($host, $username, $password);\n $this->process_new();\n $this->delete_old();\n }", "public function handle()\n\t{\n\t\t$this->info(\"matches started...\");\n\n\t\tif (true === $this->options()['insert'])\n\t\t\t$this->insert();\n\n\t\telseif (true === $this->options()['update'])\n\t\t\t$this->update();\n\n\t\telseif (true === $this->options()['offers'])\n\t\t\t$this->offers();\n\n\t\telse {\n\t\t\t$this->update();\n\t\t\t$this->insert();\n\t\t}\n\n\t\t$this->info(\"all matches completed\");\n\t}", "public function handle()\n {\n Log::info('Command check is que working called');\n event(new CheckIsQueWorkingEvent());\n Log::info('Command check is que working finished');\n }", "public function handle()\n {\n if ($this->hasOption('bootstrap')) {\n $this->call('cocoa:events-2016');\n }\n $this->call('cocoa:events');\n $this->call('cocoa:posts');\n }", "public function handle() {\n $this->call('publish');\n $this->call('migrate');\n }", "public function handle()\n {\n $business_name = $this->argument('business_name');\n if (empty($business_name)) {\n die('invalid business_name');\n }\n (new MainProcessController($business_name))->handle();\n }", "public function handle()\n {\n $job = new StartExportJob(1,20,'2016-01-01','2016-01-05');\n\n dispatch($job);\n $this->info(\"TestCommand complete\");\n }", "public function handle()\n {\n $server = new Server('0.0.0.0', 8192, SWOOLE_BASE, SWOOLE_SOCK_TCP);\n $server->set(['task_worker_num' => 1]);\n $this->tcpServer($server);\n $this->manageServer($server);\n $this->server = $server;\n $server->start();\n echo \"exit\" . PHP_EOL;\n }", "public function handle()\n {\n $runningOrders = Order::where('status', Order::STATUS_RUNNING)->get()->all();\n\n if (empty($runningOrders)) {\n echo \"No running orders\\n\";\n return;\n }\n\n $req = [];\n\n foreach($runningOrders as $order) {\n $req[] = $order->foreign_id;//add nakrutka ids to request\n }\n\n $response = resolve(NakrutkaService::class)->multiStatus($req);\n\n foreach($runningOrders as $order) {\n $foreign_id = $order->foreign_id;\n $foreign_status = $response->$foreign_id->status;\n echo \"order $order->id $order->uuid $foreign_id $order->status $foreign_status\\n\";\n\n if ($this->option('save')) {\n $order->updateData($response);\n }\n }\n\n // In progress - выполняется\n // Pending - ожидает\n // Processing -\n\n // Partial - частично выполнен. возврат.\n // Canceled - отменен\n // Completed - выполнен\n\n print_r($response);\n }", "public function handle()\n {\n if($this->option('movieid')){\n $this->handle_movie($this->option('movieid'));\n return;\n }\n if($this->option('magnetid')){\n $this->handle_magnet($this->option('magnetid'));\n return;\n }\n if($this->option('movie')==1){\n $movie404 = $this->option('movie404')*1;\n $moviemax = $this->option('moviemax')*1;\n $this->handle_all_movie($moviemax,$movie404);\n }\n if($this->option('page')*1 >0){\n $this->handle_all_page($this->option('page')*1,$this->option('genre'));\n }\n if($this->option('magpage')!== null){\n $this->handle_all_magnet($this->option('magpage')*1);\n }\n //php artisan avbook:javbus --movie=1 --page=10 --magpage=10 --movie404=1\n }", "public function handle()\n {\n echo \"pulling from repo..\\n\";\n $command = \"git pull\";\n \n $returnVar = NULL;\n $output = NULL;\n \n exec($command, $output, $returnVar);\n\n echo \"\\npulled\\n\";\n echo \"\\nrunning npm to build..\\n\";\n $command = \"npm run prod\";\n \n $returnVar = NULL;\n $output = NULL;\n \n echo exec($command, $output, $returnVar);\n echo \"\\nDone\";\n }", "public function handle()\n {\n $from = $this->ask('from?');\n $to = $this->ask('to?');\n $format = $this->ask('format?');\n $subject = $this->ask('subject?');\n $body = $this->ask('body?');\n\n if(is_string($this->ask('cc?'))){\n $cc = explode(',', $this->ask('cc?'));\n }\n\n if(is_array($this->ask('cc?'))){\n $cc = $this->ask('cc?');\n }\n\n $emailToSend = new EmailToSend(\n Uuid::uuid4(),\n $from,\n $to,\n $cc ?? [],\n $subject,\n $body,\n $format ?? 'text'\n );\n $job = (new StartProcessJob($emailToSend));\n\n dispatch($job);\n }", "public function handle()\n {\n\n // 加载所有Applications/*/start.php,以便启动所有服务\n foreach(glob('app/Gateways/start*.php') as $start_file)\n {\n require_once $start_file;\n }\n\n $opt = $this->argument('opt');\n $isDaemon = $this->option('d');\n global $argv;\n $argv[1] = $opt;\n if( TRUE == $isDaemon){\n $argv[2] = '-d';\n }\n\n\n \\Workerman\\Worker::$logFile = app_path().'/../storage/logs/workerman.log';\n \\Workerman\\Worker::runAll();\n }", "public function handle()\n {\n chdir($this->laravel->publicPath());\n // $this->line(\"<info>\\n\\nKick-Ass TELSTAR development server started at: \\n\\n HOST={$this->host()} \\n PORT={$this->port()}\\n\\n Command-click ==></info> http://{$this->host()}:{$this->port()}\");\n // $this->line(\"<info>\\n\\nKick-Ass TELSTAR development server started at: \\n\\n HOST={$this->host()} \\n PORT={$this->port()}\\n\\n Command-click</info> http://{$this->host()}:{$this->port()}<info> to serve in browser.</info>\");\n $this->line(\"<info>\\n\\nKick-Ass TELSTAR development server started at: \\n\\n HOST={$this->host()} \\n PORT={$this->port()}\\n\\n Command-click to serve --></info> http://{$this->host()}:{$this->port()}\");\n passthru($this->serverCommand());\n }", "public function handle()\n {\n $lessonProblems = $this->connectionOldDb->table('rsatlessonproblem')\n ->get();\n foreach ($lessonProblems as $lessonProblem) {\n $lesson = $this->connectionNewDb->table('read_lesson')->where('reference_id', $lessonProblem->rsatlessonid)->value('id');\n $problem = $this->connectionNewDb->table('read_problem')->where('reference_number', $lessonProblem->rsatproblemid)->value('id');\n $lessonSectionId = $this->connectionOldDb->table('rsatlessonsectiontype')->where('id', $lessonProblem->rsatlessonsectiontypeid)->value('id');\n $lessonSection = $this->connectionNewDb->table('read_lesson_section')->where('reference_id', $lessonSectionId)->value('id');\n $command = AddProblemToLesson::withData(\n LessonProblemId::generate()->toString(),\n LessonId::fromString($lesson)->toString(),\n ProblemId::fromString($problem)->toString(),\n LessonTypeId::fromString($lessonSection)->toString(),\n LessonProblemSequence::fromString((string)$lessonProblem->sequence)->toString(),\n LessonProblemPage::fromString($lessonProblem->page)->toString(),\n LessonProblemActive::fromString((string)$lessonProblem->invalid)->toString()\n );\n $this->commandBus->dispatch($command);\n }\n }", "public function handle()\n {\n $data = [];\n if($this->option('set')) $data['set']=$this->option('set');\n if($this->option('from')) $data['from']=$this->option('from');\n if($this->option('until')) $data['until']=$this->option('until');\n //$test = LaravelDspace::Harvest($data);\n $this->procesar($data);\n }", "public function handle()\n {\n $passageSubjects = $this->connectionOldDb\n ->table('rsatpassagetype')\n ->get();\n\n foreach ($passageSubjects as $passageSubject) {\n $command = AddPassageSubject::withData(\n PassageSubjectId::generate()->toString(),\n $passageSubject->label,\n $passageSubject->abbreviation,\n PassageSubjectActive::fromString($passageSubject->invalid)->toString()\n );\n $this->commandBus->dispatch($command);\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $this->initArgv();\n $this->matchEngine = new MatchEngine();\n\n self::$currency_match_ids = CurrencyMatch::where('open_transaction', 1)->get()\n ->pluck('id')->all();\n\n $this->worker = new Worker();\n $this->worker->count = count(self::$currency_match_ids);\n $this->worker->name = 'Match Engine Main';\n\n $this->bindEvent();\n\n $path = storage_path('/match_engine/');\n file_exists($path) || @mkdir($path);\n Worker::$pidFile = $path . 'match_engine.pid';;\n\n Worker::runAll();\n }", "public function handleCommand()\n {\n $this->info( \"当期版本: \". StarsPeaceProvider::STARS_PEACE_VERSION );\n }", "public function handle()\n {\n $this->getModule();\n }", "public function handle()\n {\n $this->events->fire('command.cacheconfig', $this);\n $this->events->fire('command.cacheroutes', $this);\n $this->events->fire('command.updatecache', $this);\n }", "public function handle()\n {\n echo 123;\n }", "public function handle()\n {\n // $res = bower_install();\n // $this->comment(var_export($res,TRUE));\n\n // $res = node_modules_install();\n // $this->comment(var_export($res,TRUE));\n\n $this->call('migrate');\n\n // $this->call('vendor:publish', ['--tag'=>'node_modules', '--force']);\n // $this->call('vendor:publish', ['--tag'=>'md-public', '--force']);\n $this->call('vendor:publish', ['--tag' => 'admin-assets', '--force']);\n // $this->call('vendor:publish', ['--tag'=>'vue-resources', '--force']);\n $this->call('vendor:publish', ['--tag' => 'stopwords', '--force']);\n\n // clean_directories();\n $this->call(\"admin:fix_exception\");\n $this->call(\"admin:fix_route\");\n }", "private function executeHandle() {\n // call hook function\n is_callable(config('hooks.onExecute')) && call_user_func(config('hooks.onExecute'), $this);\n // execute controller\n $this->router->executeController();\n }", "public function handle()\n {\n\n global $argv;\n $arg = $this->argument('action');\n $argv[1] = $argv[2];\n $argv[2] = isset($argv[3]) ? \"-{$argv[3]}\" : '';\n switch ($arg) {\n case 'start':\n $this->start();\n break;\n case 'stop':\n break;\n case 'restart':\n break;\n case 'reload':\n break;\n case 'status':\n break;\n case 'connections':\n break;\n }\n\n }", "public function handle()\n {\n\n //执行实时任务处理发放卡券操作\n //创建一个子进程\n $pid = pcntl_fork();\n\n if ($pid == -1) {\n throw new Exception('fork子进程失败');\n } elseif ($pid > 0) {\n //父进程退出,子进程变成孤儿进程被1号进程收养,进程脱离终端\n exit(0);\n }\n\n //创建一个新的会话,脱离终端控制,更改子进程为组长进程\n $sid = posix_setsid();\n if ($sid == -1) {\n throw new Exception('setsid fail');\n }\n\n //修改当前进程的工作目录,由于子进程会继承父进程的工作目录,修改工作目录以释放对父进程工作目录的占用。\n chdir('/');\n\n /**\n * 通过上一步,我们创建了一个新的会话组长,进程组长,且脱离了终端,但是会话组长可以申请重新打开一个终端,为了避免\n * 这种情况,我们再次创建一个子进程,并退出当前进程,这样运行的进程就不再是会话组长。\n */\n $pid = pcntl_fork();\n if ($pid == -1) {\n throw new Exception('fork子进程失败');\n } elseif ($pid > 0) {\n //再一次退出父进程,子进程成为最终的守护进程\n exit(0);\n }\n //由于守护进程用不到标准输入输出,关闭标准输入,输出,错误输出描述符\n fclose(STDIN);\n fclose(STDOUT);\n fclose(STDERR);\n\n while(true) {\n $cardInfo = Redis::rpop(QUEUE_UNIS);\n if ($cardInfo) {\n $param = json_decode($cardInfo, true);\n savelog('team_make', $param);\n $orderInfo = team11_order_mid::where('id', $param['oid'])->first();\n if (!$orderInfo) {\n continue;\n }\n if ($orderInfo['is_get'] == 1) {\n continue;\n }\n $activity = team11_activity::getOne($param['activity_id']);\n $ret1 = AntaAppClient::getTicketUnionid($param['unionid'], $activity['code'], $activity['code_type'], 1);\n $ret2 = AntaAppClient::getTicketUnionid($param['unionid'], $activity['free_code'], $activity['free_code_type'], empty($param['num'])?1:$param['num']);\n if ((isset($ret1['status']) && $ret1['status'] == 1) || (isset($ret2['status']) && $ret2['status'] == 1)) {\n //领取成功,修改状态\n team11_order_mid::where('id', $param['oid'])->update(['is_get'=>1]);\n team11_get_card::insert(['activity_id'=>$param['activity_id'], 'user_id'=>$param['uid'], 'result'=>json_encode([$ret1,$ret2], 320)]);\n } else {\n //领取失败,重新加入队列\n savelog('team_make_repeat', $cardInfo);\n Redis::lpush(QUEUE_UNIS, $cardInfo);\n }\n }\n }\n }", "public function handle()\n {\n $this->connectAmqp();\n\n //声明callback队列(exclusive置为true,只有此连接才能使用此queue,且连接断开之后自动删除之)\n list($this->callBackQueueName, ,) = $this->channel->queue_declare(\"\", false, false, true, false);\n\n //监听响应队列\n $this->channel->basic_consume($this->callBackQueueName, '', false, false, false, false, [$this, 'onResponse']);\n\n //rcp调用\n $n = $this->argument('n');\n $result = $this->callRpc($n);\n echo \" [.] Got \", $this->response, \". Rpc result: ${result}\\n\";\n\n $this->closeAmqp();\n }", "public function handle()\n {\n Helper::log(\"============================\");\n Helper::log(\"Start KiotViet Sync All Data Process\");\n $KvSyncProcessesFiles = scandir(app_path().'\\KvSync\\Processor'); \n foreach ($KvSyncProcessesFiles as $filename) {\n if($filename != '.'&&$filename != '..'){\n $className = '\\App\\KvSync\\Processor\\\\'.str_replace('.php','',$filename);\n Helper::log(\"Start Processor: $filename\");\n new $className();\n Helper::log(\"End Processor: $filename\");\n }\n }\n Helper::log(\"End KiotViet Sync Process\");\n Helper::log(\"============================\");\n return 0;\n }", "public function handle()\n {\n\n $commands = $this->commands;\n\n if(! empty($commands)) {\n \n foreach($commands as $command) {\n \n Artisan::call($command);\n \n }\n\n if($this->changeEnv) {\n \n $this->change_variable($this->value(), $this->escaped());\n\n }\n \n $this->success();\n \n }else {\n \n $this->warning();\n \n }\n\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }", "public function handle()\n {\n // populate a list with 10 random numbers (between 10 and 100)\n $ns = [];\n for($i = 0; $i < 10; $i++) {\n $ns[$i] = rand(10, 100);\n }\n\n // create a progress bar with 10 ticks\n $bar = $this->output->createProgressBar(10);\n\n $this->info(\"This will take some time.\");\n $this->comment(\"Please press ctrl-c or something...\");\n \n $bar->advance();\n\n // use the random numbers to sleep a bit (use usleep*1000 for ms in stead of sleep for seconds)\n foreach($ns as $n) {\n usleep($n * 1000);\n //sleep($n / 10);\n $bar->advance();\n } \n\n $bar->finish();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "abstract public function dispatch($command);", "public function handle()\n {\n $modules = [];\n\n foreach (Module::getCached() as $module) {\n $modules[$module['priority']] = $module['name'];\n }\n\n ksort($modules);\n foreach ($modules as $module) {\n Artisan::call(\"module:migrate $module\");\n $this->info(\"$module migrate finish!\");\n }\n\n Artisan::call('storage:link');\n $this->info('link finish!');\n }", "public function handle()\n {\n try {\n $this->process->mustRun();\n $this->process2->mustRun();\n\n $this->info('The backup has been proceed successfully.');\n }\n catch(ProcessFailedException $exception) {\n $this->info('The backup process has been failed');\n }\n }", "public function handle()\n {\n //$obj = new \\App\\Http\\Controllers\\Amqp\\SimpleController();\n $obj = new \\App\\Http\\Controllers\\Amqp\\WorkerController();\n //$obj = new \\App\\Http\\Controllers\\Amqp\\SubscribeController();\n //$obj = new \\App\\Http\\Controllers\\Amqp\\RouteController();\n //$obj = new \\App\\Http\\Controllers\\Amqp\\RopicController();\n $obj->receive();\n }", "public function handle()\n {\n\t\t// 发送服务到期后n天,到期前n天,开始后n天的短信\n \t$a=new AlidayuSendController();\n \t$a->send('after_service_start');\n \t$a->send('after_service_end');\n \t$a->send('before_service_end');\n \t$a->send('before_read_plan_end');\n \t$this->read_plan();\n \t$this->confirm_read_plan();\n \t$this->dell_expirated_discount();\n }", "public function handle()\n {\n // $process = new Process(['cd /git', '&&','git', 'rev-parse', 'HEAD']);\n $process = new Process('cd /git && git rev-parse HEAD');\n $process->run();\n\n // executes after the command finishes\n if (!$process->isSuccessful()) {\n $process = new Process('git rev-parse HEAD');\n $process->run();\n }\n\n Cache::forever('git_commit', $process->getOutput());\n\n $process = new Process('cd /git && git log -1 --pretty=format:%ct');\n\n $process->run();\n\n // executes after the command finishes\n if (!$process->isSuccessful()) {\n $process = new Process('git log -1 --pretty=format:%ct');\n $process->run();\n }\n\n \n\n Cache::forever('git_last_update', $process->getOutput());\n\n\n }", "public function handle()\n {\n $hashtag = '#tanyakata';\n\n $results = Twitter::search($hashtag, [\n 'q' => $hashtag,\n 'result_type' => 'mixed',\n 'count' => 100,\n ]);\n\n foreach ($results as $result) {\n dispatch(new ReplyQuestionJob($result));\n }\n }", "public function handle()\n {\n echo \"Running telegram messages listener...\\n\";\n\n\n while (true) {\n $offset = $this->getPreviousUpdateID();\n $this->processMessages($offset);\n sleep(1);\n }\n }", "public function work(Message $command)\n {\n $handler = $this->getHandler($command);\n $handler->handle($command);\n }", "public function handle()\n {\n // capture\n $closure = $this->argument('closure');\n\n // run\n \\Travis\\Fork::pickup($closure);\n }", "public function handle()\n { \n set_time_limit(0);\n\n $this->comment(\"\\r\\n|||||||||||| CallList Fix Proc Begin ||||||||||||\\r\\n\");\n $this->proc();\n $this->comment(\"\\r\\n|||||||||||| CallList Fix Proc Finish ||||||||||||\\r\\n\"); \n }", "public function handle()\n {\n //\n }", "public function handle()\n {\n //\n }", "public function handle()\n {\n //\n }", "public function handle()\n {\n dispatch(new generateMailBatch());\n $this->line('Tache programmé');\n }", "public function handle()\n\t{\n\t\trequire_once dirname(dirname(dirname(__DIR__))) . DS . 'models' . DS . 'Cart.php';\n\t\t$userId = \\Components\\Cart\\Models\\Cart::getCartUser($this->crtId);\n\n\t\t// Get number of points to add\n\t\tif (!empty($this->item['meta']['addPoints']) && is_numeric($this->item['meta']['addPoints']))\n\t\t{\n\t\t\t// Update points account\n\t\t\t$BTL = new \\Hubzero\\Bank\\Teller($userId);\n\t\t\t$BTL->deposit($this->item['meta']['addPoints'], 'PRO Membership Bonus', 'PRO', $this->item['info']->sId);\n\t\t}\n\t}", "public function handle()\n {\n $name = $this->argument('name');\n $format = $this->argument('format');\n $url = $this->argument('url');\n\n $repository = Repository::firstOrCreate([\n 'name' => $name,\n 'format' => $format,\n 'url' => $url,\n ]);\n\n $this->dispatch(new ApacheCrawlerJob($repository));\n\n // $job = new ApacheCrawlerJob($repository);\n\n // $job->handle(new \\Goutte\\Client);\n\n // dd($job);\n\n\t\t// $loader = Factory::make($format, $locale);\n\n // $output = $loader->read($path);\n\n\t\t// dd($output);\n\n }", "public function handle()\n {\n $headers = MailHeaderUpdate::where('disabled', 0)->orderby('last_header_update', 'asc')->limit(100)->get();\n if (!is_null($headers)) {\n foreach ($headers as $header) {\n $job = (new GetCharacterMailHeaders($header->character_id))\n ->delay(Carbon::now()->addSeconds(5));\n dispatch($job);\n }\n }\n }", "public function handle()\n {\n echo \"\\n\\nStart script\\n\\n\";\n $discount = new Discount;\n\n $totalCounts = $this->orderRepository->getAllRecordsCount();\n $orders = $this->orderRepository->getAllRecords();\n\n $i = 0;\n\n /** @var Order $order */\n foreach($orders as $order) {\n $i++;\n $percentage = intval(($i/$totalCounts) * 100);\n echo \"Process Order id: $order->id [ $percentage % ]\\n\";\n\n $this->calculateAndUpdateOrder($order, $discount);\n }\n\n echo \"\\n\\nStart script\\n\\n\";\n }", "public function handle()\n {\n $token = getenv('BOT_TOKEN');\n\n $telegram = new Api($token);\n $bot = $telegram->getMe();\n\n $this->info('All right');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n\t\t// still be tried again later\n\t\tUpdateYoutubeDlJob::dispatch()->delay(now()->addWeek());\n\n\t\t// and now try and update youtube-dl\n \t$process = new Process('/usr/local/bin/youtube-dl -U');\n\t\t$process->run();\n\t\tif (!$process->isSuccessful()) {\n\t\t throw new ProcessFailedException($process);\n\t\t}\n\t\t\\Log::info($process->getOutput());\n }", "public function handle()\n {\n $this->laravel->bind(RedisSubscribe::class,$this->handler);\n $instance = $this->laravel->make(RedisSubscribe::class);\n\n while(true) {\n $value = Redis::brpop($this->channel, 0);\n\n $channel = $value[0];\n $data = $value[1];\n\n $instance->reset();\n $instance->setData($channel,json_decode($data,true));\n $instance->handle();\n }\n }", "public function handle()\n {\n try {\n $providers = DB::table('providers')->get()->toArray();\n\n $this->_progressBar = $this->output->createProgressBar(count($providers));\n $this->_progressBar->setFormat('verbose');\n $this->_progressBar->setMaxSteps(count($providers));\n $this->_progressBar->setEmptyBarCharacter(' ');\n\n foreach($providers as $provider){\n DB::table('providers_monthlies')\n ->insert(\n [\n 'monthly' => $provider->monthly,\n 'providers_id' => $provider->id,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]\n );\n //avançando barra de status\n $this->_progressBar->advance();\n\n }\n\n //finalizando process bar\n $this->_progressBar->finish();\n\n\n }catch (\\Exception $ex){\n $this->error($ex->getMessage());\n }finally{\n //sempre executara\n $this->alert(\"Fim do processo :)\");\n }\n }", "public function handle()\n {\n $this->info('Process stored data');\n $baseUrl = \"https://reviewcongty.com\";\n $loop = 271;\n $totalLoopCompany = $this->output->createProgressBar($loop);\n $totalLoopCompany->start();\n for ($number = 1; $number <= $loop; $number++) {\n $strContent = $this->readFileContent($number);\n $this->handleCrawling($strContent, $baseUrl);\n $totalLoopCompany->advance();\n }\n $totalLoopCompany->finish();\n }", "public function handle()\n {\n $subFee = '';\n $company_data = array();\n $current_date = date('d');\n $simplify_email = Config::get('simplifya.admin_email');\n\n //last day of current month\n $last_day_this_month = date('t');\n\n if($current_date == 04) {\n $master_data = $this->master_data->all(array('*'));\n\n foreach($master_data as $data) {\n if($data->name == 'SUBSFEE') {\n $subFee = $data->value;\n }\n }\n $companies = $this->company->getAllActivateCompanies();\n $subscriptions = $this->masterSubscription->getMonthlySubscriptionFee();\n foreach($companies as $company) {\n foreach($subscriptions as $subscription) {\n if($company->entity_type == $subscription->entity_type_id) {\n $company_data[] = array('id' => $company->id, 'name' => $company->name, 'stripe_id' => $company->stripe_id, 'entity_type' => $company->entity_type, 'amount' => $subscription->amount);\n }\n }\n }\n $this->subscriptionHandler($company_data, $subFee);\n }\n }", "public function handle()\n {\n foreach ($this->config->get('cqrses.pre_rebuild_commands') as $preRebuildCommand) {\n if (is_array($preRebuildCommand)) {\n $this->call(key($preRebuildCommand), current($preRebuildCommand));\n } else {\n $this->call($preRebuildCommand);\n }\n }\n\n $this->call(\n 'smoothphp:project',\n [\n 'projections' => implode(',', $this->config->get('cqrses.rebuild_projections')),\n '--transactions' => $this->option('transactions'),\n ]\n );\n\n foreach ($this->config->get('cqrses.post_rebuild_commands') as $postRebuildCommand) {\n if (is_array($postRebuildCommand)) {\n $this->call(key($postRebuildCommand), current($postRebuildCommand));\n } else {\n $this->call($postRebuildCommand);\n }\n }\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $routes = $this->getRoutes();\n\n $this->clear($this->option('clear'));\n $this->setColumnCache($this->option('mysql'));\n $this->lang();\n $httpData['apis'] =$this->getApis($routes);\n $httpData['project'] = $this->getProject();\n $this->http($httpData);\n $this->info('结束');\n }", "public function handle()\n {\n $rand = rand(2, 6);\n sleep($rand);\n $result = $this->process();\n\n return $result;\n }", "public function handle()\n {\n $this->timestamp = time();\n\n $this->importCourses();\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n { // TODO - check if snapshot is returned\n\n $snapshot = $this->snapshotController->store(); \n $this->info($snapshot->textInfo);\n }", "public function handle()\n {\n echo \"el comando se esta ejecutando\";\n log::info(\"se ejecuto el comando\");\n }", "public function handle()\n {\n $tasks = Task::orderBy('id', 'desc')->limit(10)->get();\n\n foreach($tasks as $task) {\n $this->line(\"\");\n $this->info(\"========= $task->name =========\");\n $this->line(\"Status: $task->status\");\n $this->line(\"Exit Code: $task->exit_code\");\n $this->line(\"Playbook: $task->playbook\");\n $this->line(\"\");\n $this->line($task->output);\n $this->line(\"\");\n $this->line(\"Vars: \" . print_r($task->vars, true));\n $this->info(\"========= End $task->name =========\");\n }\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle()\n {\n \n // $user_info_instance = User_info::all();\n\n // foreach ($user_info_instance as $single_user) {\n \n // if ($single_user->mobile_no) {\n \n // SMS::to($single_user->mobile_no)\n // ->msg('Dear' . $single_user->membership_no . 'I wish you a happy birthday')->send();\n // }\n // }\n\n\n $user_account_instance = User_account::find(2);\n\n $user_account_instance->net_sonchoy += 200;\n\n $user_account_instance->save();\n\n\n\n\n $this->info('The happy birthday message was sent successfully');\n }", "public function handle()\n {\n //\n\t\t$this->Init();\n\t\t$this->Import();\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function process() {\n\t\ttry {\n\t\t\t$params = $this->arguments;\n\t\t\t$command = array_shift($params);\n\n\t\t\tif ($command === null)\n\t\t\t\t$this->help();\n\t\t\t\n\t\t\tif ($command == '--version' || $command == '-v')\n\t\t\t\t$command = 'version';\n\t\t\tif ($command == '--help' || $command == '-h')\n\t\t\t\t$command = 'help';\n\t\t\t\n\t\t\tif (!isset($this->commands[$command])) {\n\t\t\t\t$this->help('Invalid command '.$command);\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t$class = $this->commands[$command];\n\t\t\t$instance = new $class($this, $params);\n\t\t\t\n\t\t\treturn $instance->execute($this, $params);\n\t\t} catch (HelpException $e) {\n\t\t\t$this->showHelp($e->getMessage());\n\t\t}\n\t}", "public function handle() {\n $this->check_REF(); // Step 1\n $this->bedtools_analysis(); // Step 2\n $this->valid_intersection(); // Step 3\n $this->check_DB(); // Step 4 \n if (filesize($this->path_new_input) != 0) {\n $this->splice_site_distance(); // Step 5\n $this->setup_files(); // Step 6\n $this->L1_distance_processing(); // Step 7\n $this->ESEseq_processing(); // Step 8\n $this->RBP_processing(); // Step 9\n $this->results_processing(); // Step 10\n $this->database_entry(); // Step 11\n }\n \n $this->remove_directory($this->working_directory_path);\n\n $this->record_progress(\"Job complete!\");\n }", "public function handle()\n {\n $queue = $this->option('queue');\n $number = $this->argument('number') ? intval($this->argument('number')) : 30;\n $novels = Novel::continued()->orderBy('hot', 'desc')->take($number)->get();\n if($novels){\n foreach ($novels as $novel) {\n if($queue){\n dispatch(new SnatchUpdate($novel->id));\n } else {\n $snatch = new SnatchUpdate($novel->id);\n $snatch->handle();\n }\n }\n }\n }", "public function handle()\n {\n $client = new \\GuzzleHttp\\Client();\n $res = $client->post('http://backendtask.robustastudio.com/encode', [\n 'headers' => [\n 'Content-Type' => 'application/json',\n ],\n 'json' => [\n 'string' => $this->argument('string'),\n ]\n ]);\n\n $result = json_decode($res->getBody()->getContents(),true);\n $this -> info($result[\"string\"]);\n }", "public function handle()\n {\n Server::make()\n ->bind($this->option('address'), $this->option('port'))\n ->useQueue($this->option('connection'), $this->option('queue'))\n ->maxConnections($this->option('max', 0))\n ->password($this->option('key'))\n ->logger($this->getOutput())\n ->start();\n }", "public function handle()\n {\n $this->service->send();\n }", "public function handle()\n {\n try {\n \n $result = \\AtlasVG\\Helpers\\RemoteData::sync($this->argument('bid'));\n\n $total = $result['successful'] + $result['failed'];\n\n $this->info(\"Successfully synchronized {$result['successful']}/{$total} people.\");\n\n if ($result['failed']) {\n $this->error(\"Failed to synchronize {$result['failed']}/{$total} people. Check the logs for details.\");\n }\n\n } catch (\\Exception $e) {\n $this->error($e->getMessage());\n }\n }", "abstract public function run($command);", "public function handle()\n {\n $action=$this->argument('action');\n\n /*\n *行为 判断\n */\n\n switch($action){\n\n case \"start\":\n\n $this->start();\n\n break;\n\n case \"stop\":\n\n $this->stop();\n\n break;\n case \"restart\" :\n\n $this->restart();\n\n break;\n\n\n }\n\n }" ]
[ "0.6975492", "0.6949976", "0.6949976", "0.6621128", "0.6497215", "0.647377", "0.6436723", "0.6405593", "0.6360486", "0.6311645", "0.62663925", "0.625923", "0.6246015", "0.6243811", "0.6234491", "0.62284964", "0.6218355", "0.62181497", "0.6215085", "0.621293", "0.6212124", "0.62025905", "0.6184748", "0.6172708", "0.61708266", "0.616057", "0.6156961", "0.61468893", "0.6143415", "0.613687", "0.61336815", "0.6119962", "0.61071044", "0.61048967", "0.6093391", "0.60886604", "0.60819376", "0.6066516", "0.6066102", "0.605824", "0.60506606", "0.6048384", "0.60397816", "0.6033246", "0.60303795", "0.6027222", "0.602244", "0.60188067", "0.60186744", "0.6013759", "0.6013583", "0.60062927", "0.6000251", "0.59993744", "0.5997899", "0.5987494", "0.5986636", "0.5982416", "0.597255", "0.59672874", "0.595855", "0.5954325", "0.5954084", "0.59520036", "0.5946303", "0.5946303", "0.5946303", "0.5946162", "0.59456545", "0.5945089", "0.5941489", "0.5937035", "0.5924918", "0.5924719", "0.5920052", "0.5918848", "0.5918146", "0.59125984", "0.59108627", "0.5909725", "0.5909549", "0.5907392", "0.5902116", "0.59015375", "0.5894172", "0.58916813", "0.58912385", "0.589031", "0.5886753", "0.5885634", "0.58831704", "0.58762735", "0.58731204", "0.5870343", "0.5867639", "0.58660775", "0.58653015", "0.5859399", "0.58562577", "0.58558583", "0.58552843" ]
0.0
-1
Serialize command for send from bus.
public abstract function serialize();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "function networkSerialize() : string{\n\t\treturn \"\\x00\" . $this->ids . $this->data . $this->skyLight . $this->blockLight;\n\t}", "public function send() {}", "public function send() {}", "public function send() {}", "public function send() {}", "public function send() {}", "public function to_wire()\n {\n return json_encode($this->data);\n }", "abstract function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function serialize()\n {\n return serialize([\n $this->execute,\n $this->update\n ]);\n }", "abstract function doSend();", "public function toSerial() {\n\t\treturn serialize($this->toArray());\n\t}", "public function serialize(){ }", "final public function serialize(): string\n {\n return \\serialize($this);\n }", "public function serialize(): string\n {\n return $this->toRawString();\n }", "public function serialize()\n {\n return serialize([\n 'sessionId' => $this->sessionId,\n 'convAdminInfo' => $this->convAdminInfo,\n 'verifyResult' => $this->verifyResult,\n ]);\n }", "protected function send() {}", "public function serialize()\n {\n }", "public function serialize()\n {\n }", "public function serialize() \n {\n return serialize([\n 'boardingCardNumber'=>$this->boardingCardId,\n 'arrival'=>$this->arrival, \n 'departure'=>$this->departure, \n 'passenger'=>$this->passenger,\n 'reference'=>$this->reference,\n 'busNo'=>$this->busNo,\n 'platformNo'=>$this->platformNo\n ]);\n }", "public function serialize();", "public function serialize();", "public function serialize();", "public function __toString()\n {\n return sprintf(\n '%s:%s#%s(%s)',\n $this->queue,\n $this->class,\n $this->id,\n empty($this->data) ? '' : json_encode($this->data)\n );\n }", "public function serialize()\n {\n $nonce = $this->getNonce();\n\n return serialize([$this->id, $nonce, $this->parameters->serialize()]);\n }", "public function toString() : void\n {\n $out = serialize($this);\n \n }", "public function serialize()\n {\n $data = array();\n foreach( $this->toSerialize as $var ) { $data[ $var ] = $this->$var; }\n return serialize( $data );\n }", "public function serialize()\n {\n return serialize(array(\n $this->acl,\n $this->securityIdentity,\n $this->id,\n $this->mask,\n $this->isGranting,\n $this->strategy,\n $this->auditFailure,\n $this->auditSuccess,\n ));\n }", "public function binarySerialize();", "abstract public function serialize();", "abstract public function serialize();", "public function serialize()\n {\n return serialize([\n 'net_id' => $this->net_id,\n 'permissions' => $this->permissions,\n 'name' => $this->name,\n ]);\n }", "protected function sendCommand($command, $data = '')\n {\n fwrite($this->socket, pack('VV', $command, strlen($data)) . $data);\n return $this->receiveResponse();\n }", "public function send()\n {\n }", "public function send()\n {\n }", "public function send()\n {\n }", "public function __toString() {\n\t\t\treturn $this->builder->command()->__toString();\n\t\t}", "public function jsonSerialize() :mixed {\n return $this->getSendAt();\n }", "public function __toString()\n {\n $str = \"\\n---Remote Control---\\n\";\n for ($i=0; $i<=4; $i++) {\n $str .= \"\\nSlot[$i]\" . $this->onCommand[$i]->getName() . \" <===> \" . $this->offCommand[$i]->getName();\n }\n return $str;\n }", "function serialise(): string;", "public function send()\n {\n }", "public function SerializeObject () {\n return serialize ($this);\n }", "public function serialize(){\n return serialize([\n 'data' => $this->data,\n 'table' => $this->table,\n 'key' => $this->key,\n ]);\n }", "public function serialize(): string\n {\n return serialize($this->toArray());\n }", "public function serialize()\n {\n // TODO: Implement serialize() method.\n }", "private function sendCommand($command) {\n\t\t# Log the outbound message\n\t\tif($this->config['logging'] == 2) {\n\t\t\t$this->log(\"[SEND]: \".rtrim($command,\"\\r\\n\"));\n\t\t}\n\t\tif(substr($command,-4) != \"\\n\\r\") {\n\t\t\t$command = $command . \"\\n\\r\";\n\t\t}\n\t\t$writtenBytes = fwrite($this->socket, $command, strlen($command));\n\t\tif($writtenBytes < strlen($command)) {\n\t\t\tthrow new Exception(\"Attempted to write \".strlen($command).\" bytes, could only send {$writtenBytes} to socket\");\n\t\t}\n\t}", "public function client_send($data, $command = '')\n {\n }", "private function writeCommand($command)\n { \n fwrite($this->smtpConnection, $command);\n }", "public function serialize()\n {\n $result = array();\n\n foreach ($this->getKeys() as $k => $v) {\n $result[] = $k.': '.$v;\n }\n\n foreach ($this->getVariables() as $k => $v) {\n if (is_array($v)) {\n foreach ($v as $singleValue) {\n $result[] = $this->serializeVariable($k, $singleValue);\n }\n } else {\n $result[] = $this->serializeVariable($k, $v);\n }\n }\n\n return $this->finishMessage(implode(self::EOL, $result));\n }", "public function __toString(){\n // Registro JSon\n\t\treturn \"{\" \n\t\t . chr(34) . \"Id\" . chr(34) . \":\" . chr(34) . $this->getId() . chr(34) \n\t\t . \",\" . chr(34) . \"Cliente\" . chr(34) . \":\" . chr(34) . $this->getCliente() . chr(34) \n\t\t . \",\" . chr(34) . \"Mensaje\" . chr(34) . \":\" . chr(34) . $this->getMensaje() . chr(34) \n\t\t . \",\" . chr(34) . \"Autor\" . chr(34) . \":\" . chr(34) . $this->getAutor() . chr(34) \n\t\t . \"}\";\n \t\t}", "public function send()\n {\n print_r($this);\n }", "public function serialize()\n {\n $data = [\n 'uid' => $this->getIdentifier()\n ];\n return serialize($data);\n }", "public function send(object $query);", "public function __toString() : string\n {\n return 'Serial';\n }", "public function serialize()\n {\n // Interface for convenience.\n return serialize($this->__serialize());\n }", "function _Write($cmd, $s1='', $s2='') {\n\t\t$id = ++$this->_Id;\n\n\t\t// Put our packet together\n\t\t$data = pack(\"VV\",$id,$cmd).$s1.chr(0).$s2.chr(0);\n\n\t\t// Prefix the packet size\n\t\t$data = pack(\"V\",strlen($data)).$data;\n\n\t\t// Send packet\n\t\tfwrite($this->_Sock,$data,strlen($data));\n\n\t\t// In case we want it later we'll return the packet id\n\t\treturn $id;\n\t}", "public function __toString()\n {\n $commandString = $this->command;\n\n if (count($this->options)) {\n $options = [];\n foreach ($this->options as $opt => $val) {\n if ($val) {\n $options[] = \"--{$opt}={$val}\";\n } else {\n $options[] = \"--{$opt}\";\n }\n }\n $commandString .= ' ' . join(' ', $options);\n }\n\n if (count($this->flags)) {\n $commandString .= ' -' . join('', $this->flags);\n }\n\n $commandString .= ' ' . $this->argument;\n\n return trim($commandString);\n }", "public function sendCommand($cmd) {\n $this->log($cmd);\n $cmd .= \"\\r\\n\";\n fwrite($this->getConnection(), $cmd);\n }", "public function get_name_serialized() {\r\n\t\t$arr = array(\r\n\t\t\t$this->get_name()\r\n\t\t);\r\n\t\t$params = $this->serialize_params($this->get_params());\r\n\t\tif ($params) {\r\n\t\t\t$arr[] = $params;\r\n\t\t}\r\n\t\treturn implode(GYRO_COMMAND_SEP, $arr);\r\n\t}", "public function toBinary()\n {\n /**\n * @todo There is no documentation on the reserved data, but this is how it seems to act. May need to change this.\n */\n if (!$this->tsPropertyArray && !$this->dialInData) {\n $binary = $this->encodeReservedData('');\n } elseif ($this->tsPropertyArray && $this->dialInData) {\n $binary = $this->encodeReservedData(self::RESERVED_DATA_VALUE['NPS_RDS']);\n } elseif ($this->dialInData) {\n $binary = $this->encodeReservedData(self::RESERVED_DATA_VALUE['NPS']);\n } else {\n $binary = $this->encodeReservedData(self::RESERVED_DATA_VALUE['RDS']);\n }\n \n $binary .= $this->dialInData ? $this->dialInData->toBinary() : hex2bin(str_pad('', 52, '20'));\n if ($this->tsPropertyArray) {\n $binary .= $this->tsPropertyArray->toBinary();\n }\n\n return $binary.$this->postBinary;\n }", "public function sendCommand($array) {\n\t\t$cmd = 'iqrfapp \"' . str_replace('\"', '\\\\\"', Json::encode($array)) . '\"';\n\t\treturn $this->commandManager->send($cmd, true);\n\t}", "public function serialize()\n {\n return serialize(array(\n 'userId' => $this->user->getId(),\n 'communityId' => $this->community->getId(),\n 'privilegeCode' => $this->privilege->getCode(),\n )\n );\n\n }", "function getEncodedMessage(): string {\n return \\chr(static::COMMAND_ID).$this->rewrittenQuery;\n }", "public function serialize()\n {\n return serialize(array(\n \"id\"=>$this->getId()\n ));\n }", "public function serialize():String {\n\n\t\treturn json_encode($this->data);\n\n\t}", "protected function write()\n {\n $this->writeString($this->clientName);\n $this->writeString($this->clientVersion);\n $this->writeShort($this->protocolVersion);\n $this->writeString(''); // client id, unused.\n $this->writeString($this->database);\n $this->writeString($this->type);\n $this->writeString($this->username);\n $this->writeString($this->password);\n }", "function sendCommand($cmd) \n { \n \n $result = $this->write($cmd . \"\\r\\n\",strlen($cmd) + 2);\n if ($this->isError($result)) {\n return $result;\n }\n $response = $this->getReply();\n \n return $response;\n }", "public function serialize()\n {\n return serialize($this->toArray());\n }", "public function serialize()\n {\n return serialize(array(\n $this->id,\n $this->nombre,\n $this->password,\n ));\n }", "public function serialize()\r\n {\r\n $data = $this->toArray();\r\n\r\n return serialize($data);\r\n }", "public function serialize()\n {\n return \\json_encode([\n $this->id,\n $this->active,\n $this->username,\n $this->password,\n $this->places,\n $this->roles,\n $this->sharedPlaces\n ]);\n }", "public function serialize()\n {\n return serialize([$this->id]);\n }", "public function serial() : string;", "public function serialize()\n {\n return serialize([$this->id,$this->matric_number]);\n }", "public function __toString(): string\n {\n return serialize($this->toArray());\n }", "public function serialize()\n\t{\n\t\t// Load all of the inputs.\n\t\t$this->loadAllInputs();\n\n\t\t// Remove $_ENV and $_SERVER from the inputs.\n\t\t$inputs = $this->inputs;\n\t\tunset($inputs['env']);\n\t\tunset($inputs['server']);\n\n\t\t// Serialize the executable, args, options, data, and inputs.\n\t\treturn serialize(array($this->calledScript, $this->args, $this->filter, $this->data, $inputs));\n\t}", "public function send(){\n\t\t\n\t\t$database = new Database();\n\t\t$query = $database->selectOne('message_queues', array('id',\n\t\t\t\t\t\t\t\t\t 'is_executed','executed_at','message','cellphone'), \n\t\t\t\t\t\t\t\t\t ' is_executed=0 ');\n\t\t$exec = $database->query($query);\n\t\tif ($exec) {\n\t\t\t$record = $database->fetchArray($exec);\n\t\t\t$response = $this->sendMessage($database, $record);\n\n\t\t\treturn json_encode(array('status' => $response['status'], 'message' => $response['message']));\n\t\t}\n\n\t}", "protected function send($msg, ConnectionInterface $to){\n if(is_array($msg)){\n $msg = json_encode($msg);\n }\n $to->send($msg);\n }", "public function __toString()\n {\n $this->to = $this->_to;\n if (isset($this->_from)) {\n $this->from = $this->_from;\n }\n\n return $this->unescapeJSON(json_encode($this));\n }", "public function serialize()\n {\n return serialize(\n [\n $this->id,\n $this->username,\n $this->email,\n $this->password,\n $this->path,\n $this->roles,\n $this->phone,\n ]\n );\n }", "public function send(TransactionInterface $transaction);", "public function aim_send_raw($msg)\r\n\t{\r\n\t\t$msg = (strlen($msg) > 2044) ? substr($msg, 0, 2043) . \"\\0\" : $msg . \"\\0\";\r\n\t\t$message = pack(\"aCnna*\", '*', 2, $this->count, strlen($msg), $msg);\r\n\t\t$result = fwrite($this->resource, $message, strlen($message));\r\n\t\t$this->aim_debug($msg, AIM_SENT);\r\n\t\t$this->count++;\r\n\t\treturn $result;\r\n\t}" ]
[ "0.57507116", "0.57507116", "0.5749089", "0.5749089", "0.5749089", "0.5749089", "0.5749089", "0.5749089", "0.562368", "0.559865", "0.559865", "0.559865", "0.559865", "0.559865", "0.5597549", "0.5576567", "0.5532923", "0.5532923", "0.5532923", "0.5532923", "0.5532923", "0.5532923", "0.5532923", "0.5532923", "0.5532923", "0.5532923", "0.5532923", "0.5492098", "0.54748714", "0.54423946", "0.5426383", "0.5403942", "0.54026806", "0.5375588", "0.53725004", "0.53666645", "0.53666645", "0.5346593", "0.53412974", "0.53412974", "0.53412974", "0.53290254", "0.5298928", "0.52561444", "0.5241736", "0.5236868", "0.523672", "0.521662", "0.521662", "0.5202288", "0.52009755", "0.52007383", "0.52007383", "0.52007383", "0.52004427", "0.5188981", "0.5160612", "0.51410013", "0.5129482", "0.5129211", "0.51248693", "0.5124698", "0.5116248", "0.51161", "0.510468", "0.5097363", "0.50813156", "0.50657815", "0.5055338", "0.5051715", "0.5043873", "0.50410485", "0.50247806", "0.50171256", "0.501347", "0.49995524", "0.49903122", "0.49893954", "0.49884355", "0.4985927", "0.4978166", "0.4956499", "0.495109", "0.49504197", "0.49461386", "0.49268055", "0.49263686", "0.49108273", "0.48801973", "0.4874611", "0.48736796", "0.48703942", "0.4855335", "0.48548162", "0.4846216", "0.4842242", "0.4838191", "0.48381355", "0.48345453", "0.48343706" ]
0.5347338
37
Find and create control command.
public static function find($raw) { $data = @json_decode($raw, true) ?: []; if (!array_key_exists('cmd', $data)) { return false; } $commandClass = sprintf('PHPPM\\Control\\Commands\\%sCommand', ucfirst($data['cmd'])); if (class_exists($commandClass)) { return new $commandClass($data); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function getCommand();", "public function getCommand();", "public function getCommand() {}", "public function generateCommands();", "function control($command){\n\t\tglobal $jbArr;\n\t\t\n\t\tswitch ($command){\n\t\t case \"addwhere\":\n\t\t $_SESSION['jb-addtype'] = $_POST['addplat'];\n\t\t break;\n\t\t}\n\t}", "public function getCommand()\n {\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "abstract function command();", "abstract public function getCommandName();", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function addCommand($command);", "public function command(Command $command);", "public function getCommand(string $command);", "protected function buildCommandsIndex() {}", "public function addControl(sys_admin_Control $control, $name);", "private function registerControllerMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.controller', function ($app)\n {\n return new ControllerMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.controller');\n }", "public function getCommandText();", "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function generateCommand($singleCommandDefinition);", "public function nextCommand();", "protected function registerMakeConditionCommand()\n {\n $this->app->singleton('command.acl.make.condition', function ($app) {\n return $app[MakeConditionCommand::class];\n });\n\n $this->commands('command.acl.make.condition');\n }", "function makeCommandButton( $command, $text )\r\n{\r\n\treturn \"<button name=commandButton id=btn_$command onclick=\\\"\" .\r\n\t\t\"rows = document.getElementsByName( 'commandButton' ); \" .\r\n\t\t\"for (i=0; i<rows.length; i++) rows[i].disabled = true; \" .\r\n\t\t\"sendCommand( '\" . urlencode( $command ) . \"', '', true ); \" .\r\n\t\t\"return false;\" .\r\n\t\t\"\\\" style=\\\"\\\">$text</button>\";\r\n}", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "function newCommands($input){\n $output = dbcCmd(\"newCommands\\n\".$input);\n return str_replace(\"\\n\",\"\",$output[\"stdout\"]);\n}", "function cmdAdmin()\n\t{\n\t\t$cmd = $this->cmd;\n\n\t\tswitch ($this->cmd)\n\t\t{\n\t\t\tcase NULL:\n\t\t\tcase \"clientlist\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->displayClientList();\n\t\t\t\t$this->active_tab = \"clientlist\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"changepassword\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->changeMasterPassword();\n\t\t\t\t$this->active_tab = \"password\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"mastersettings\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->changeMasterSettings();\n\t\t\t\t$this->active_tab = \"basicsettings\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"determineToolsPath\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->determineToolsPath();\n\t\t\t\tbreak;\n\n\t\t\tcase \"changedefault\":\n\t\t\t\t$this->changeDefaultClient();\n\t\t\t\tbreak;\n\n\t\t\tcase \"newclient\":\n\t\t\t\t$this->cmd = \"selectdb\";\n\t\t\t\t$this->setDisplayMode(\"setup\");\n\t\t\t\t$this->setup->ini_client_exists = $this->setup->newClient();\n\t\t\t\t$this->selectDBType();\n\t\t\t\tbreak;\n\n\t\t\tcase \"selectdbtype\":\n\t\t\tcase \"displayIni\":\n\t\t\t\t$this->cmd = \"ini\";\n\t\t\t\t$this->setDisplayMode(\"setup\");\n\t\t\t\t//$this->setup->ini_client_exists = $this->setup->newClient($this->client_id);\n\t\t\t\t$this->displayIni();\n\t\t\t\tbreak;\n\n\t\t\tcase \"startup\":\n\t\t\t\t$this->setDisplayMode(\"setup\");\n\t\t\t\t$this->setup->ini_client_exists = $this->setup->newClient();\n\t\t\t\t$this->displayStartup();\n\t\t\t\tbreak;\n\n\t\t\tcase \"delete\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->displayDeleteConfirmation();\n\t\t\t\tbreak;\n\n\t\t\tcase \"togglelist\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->toggleClientList();\n\t\t\t\tbreak;\n\n\t\t\tcase \"preliminaries\":\n\t\t\t\t$this->setup->checkPreliminaries();\n\t\t\t\t$this->displayPreliminaries();\n\t\t\t\t$this->active_tab = \"preliminaries\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"updateBasicSettings\":\n\t\t\tcase \"performLogin\":\n\t\t\tcase \"performMLogin\":\n\t\t\t\t$this->$cmd();\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->cmdClient();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "abstract protected function getCommandResolver();", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "private function registerConsoleCommands()\n {\n // Console Commands\n }", "private function registerConsoleCommands()\n {\n // Console Commands\n }", "public function getCommandIdentifier() {}", "private function registerPolicyMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.policy', function ($app)\n {\n return new PolicyMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.policy');\n }", "public function command($value) {\n return $this->setProperty('command', $value);\n }", "private function get_command(){\n if (!isset($_POST['command'])) {\n die(\"No command received, no result\");\n }\n $this->command = $_POST['command'];\n }", "function defCmdT($idx, $title, $command, $has_filter = false, $header_size = 0) {\n\tglobal $commands;\n\t$title = htmlspecialchars($title, ENT_NOQUOTES);\n\t$commands[$idx] = array(\n\t\t'title' => $title,\n\t\t'command' => $command,\n\t\t'has_filter' => $has_filter,\n\t\t'header_size' => $header_size);\n}", "public function command(): string;", "public function getCommands();", "public function inflect(ICommand $command);", "public function lblComandoId_Create($strControlId = null) {\n\t\t\t$this->lblComandoId = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblComandoId->Name = QApplication::Translate('Comando');\n\t\t\t$this->lblComandoId->Text = ($this->objComandoRisco->Comando) ? $this->objComandoRisco->Comando->__toString() : null;\n\t\t\t$this->lblComandoId->Required = true;\n\t\t\treturn $this->lblComandoId;\n\t\t}", "private function command(){\n\n // $processAssets->run(function ($type, $buffer) {\n // $this->output->writeln(\n // $buffer\n // );\n // });\n\n $process = new Process(explode(' ', 'php '.$this->params->get('kernel.project_dir').'/bin/console ecommerce:indexservice:bootstrap --create-or-update-index-structure'), null, null, null, 900);\n\n $process->run(function ($type, $buffer) {\n $this->output->writeln(\n $buffer\n );\n });\n\n $process1 = new Process(explode(' ', 'php '.$this->params->get('kernel.project_dir').'/bin/console ecommerce:indexservice:bootstrap --update-index'), null, null, null, 900);\n\n $process1->run(function ($type, $buffer) {\n $this->output->writeln(\n $buffer\n );\n });\n }", "public function command()\n\t{\n\t\treturn $this->command;\n\t}", "public function command()\n\t{\n\t\treturn $this->command;\n\t}", "public function add(Command $command);", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "function getTextCommand($text, $simpleMoveLeft = false) {\n\n $cmd = self::SOH . self::REV . self::ADDR . self::STX . \"A\";\n //$savePath = \"A\";\n $cmd .= chr(0x0f) . \"ETAB\";\n $cmd .= chr(0x06);\n $cmd .= self::getDisplayModeBytes($simpleMoveLeft);\n //$colorSetting = self::getColorBytes('amber');\n $cmd .= chr(0x1a) . \"1\"; // 7x6, default\n $text = \"{jumpOutOut}{jumpOutIn}\" . $text;\n $cmd .= self::parseText($text);\n $cmd .= self::EOT_IN_ECHO;\n\n return $cmd;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function buildsCommands()\n {\n $client = ScaleEngineClient::factory(['apiSecret' => 'test']);\n $command = $client->getCommand('requestTicket');\n\n $this->assertInstanceOf('\\Guzzle\\Service\\Command\\CommandInterface', $command);\n }", "public function testSetGetCommand()\n {\n $string = uniqid('command-');\n $command = $this->createCommand($string);\n\n $subject = $this->createInstance();\n $_subject = $this->reflect($subject);\n\n $_subject->_setCommand($command);\n $result = $_subject->_getCommand();\n\n $this->assertEquals($command, $result, 'Assigned command is wrong');\n }", "public function predefinedCommand(Request $request, $id = null, $command)\n {\n // echo $command;\n // echo $id ; die;\n\n $command = Commands::where('commands.value', '=', $command)->first();\n\n if (!$command)\n abort(403);\n\n switch ($command->name) {\n case Commands::COMMAND_ACCOUNT_PAGE:\n if (!$id)\n abort(404);\n\n $account = Accounts::where('accounts.user_id', '=', Auth::user()->id)\n ->where('accounts.is_removed', '=', 0)\n ->leftJoin('account_verification_details', 'account_verification_details.account_id', '=', 'accounts.id')\n ->leftJoin('user_identity_verification_details', 'user_identity_verification_details.account_id', '=', 'accounts.id')\n ->orderBy('accounts.is_primary', 'DESC')\n ->orderBy('accounts.id', 'ASC')\n ->offset($id - 1)->limit($id)\n ->first();\n\n if (!$account)\n abort(404);\n\n return $this->accountPageCommand($request, $id, $account);\n break;\n case Commands::COMMAND_ARCHIVED_ACCOUNT_PAGE:\n if (!$id)\n abort(404);\n\n $account = Accounts::where('accounts.user_id', '=', Auth::user()->id)\n ->where('accounts.is_removed', '=', 1)\n ->leftJoin('account_verification_details', 'account_verification_details.account_id', '=', 'accounts.id')\n ->leftJoin('user_identity_verification_details', 'user_identity_verification_details.account_id', '=', 'accounts.id')\n ->orderBy('accounts.is_primary', 'DESC')\n ->orderBy('accounts.id', 'ASC')\n ->offset($id - 1)->limit($id)\n ->first();\n\n if (!$account)\n abort(404);\n\n return $this->archivedAccountPageCommand($request, $id, $account);\n break;\n case Commands::COMMAND_ARCHIVED_ACCOUNTS_PAGE:\n return $this->archivedAccountsPageCommand();\n break;\n }\n\n return abort(400);\n }", "private function registerConsoleCommands()\n {\n $this->commands(DB2Reader\\Commands\\SyncStructures::class);\n }", "function _cmd($id, $action)\n{\n\t$port = _getportbyid($id);\n\n\t$cmd = Config::$Linux \n\t\t? \"script/control.sh $action $port\"\n\t\t: \"script\\\\control.cmd $action $port\";\n $result = shell_exec($cmd);\n\n\t// result example:\n\tif ( (Config::$Linux && !strstr($result, 'Loaded: loaded')) // linux\n\t\t|| (!Config::$Linux && strstr($result, '[SC] ')) ) // windows\n\t{\n\t\tthrow new Exception($result);\t\t\t\n\t}\n\treturn $result;\n\t\n\t// STOP\n\t/*\n\tSERVICE_NAME: NFK_29995\n TYPE : 10 WIN32_OWN_PROCESS\n STATE : 1 STOPPED\n WIN32_EXIT_CODE : 0 (0x0)\n SERVICE_EXIT_CODE : 0 (0x0)\n CHECKPOINT : 0x0\n WAIT_HINT : 0x0\n\t*/\n\t// START\n\t/*\n\tSERVICE_NAME: NFK_29995\n TYPE : 10 WIN32_OWN_PROCESS\n STATE : 2 START_PENDING\n (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)\n WIN32_EXIT_CODE : 0 (0x0)\n SERVICE_EXIT_CODE : 0 (0x0)\n CHECKPOINT : 0x0\n WAIT_HINT : 0x7d0\n PID : 11016\n FLAGS :\n\t*/\n\t\n\t// STATUS\n\t// (Windows)\n\t/*\n\tSERVICE_NAME: NFK_29995\n TYPE : 10 WIN32_OWN_PROCESS\n STATE : 4 RUNNING\n (STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN)\n WIN32_EXIT_CODE : 0 (0x0)\n SERVICE_EXIT_CODE : 0 (0x0)\n CHECKPOINT : 0x0\n WAIT_HINT : 0x0\n\t*/\n\t// ACCESS DENIED\n\t/*\n\t[SC] OpenService: ®иЁЎЄ : 5: ЋвЄ § ­® ў ¤®бвгЇҐ.\n\tor\n\t[SC] StartService: OpenService FAILED 5: Access is denied.\n\tor\n\t[SC] EnumQueryServicesStatus:OpenService FAILED 5: Access is denied.\n\t*/\n\t// (Linux)\n\t/*\n\t● nfk.service - nfk\n\t Loaded: loaded (/etc/systemd/system/nfk.service; enabled)\n\t Active: active (running) since Fri 2019-05-10 04:00:43 MSK; 23h ago\n\t Main PID: 29007 (wine)\n\t CGroup: /system.slice/nfk.service\n\t\t\t ├─29007 /bin/sh -e /usr/bin/wine /usr/local/nfk/SERVER.exe +gowindow +nosound +nfkplanet +game server +exec serv...\n\t\t\t ├─29011 /usr/local/nfk/SERVER.exe +gowindow +nosound +nfkplanet +game server +exec server +dontsavecfg\n\t\t\t ├─29014 /usr/lib/i386-linux-gnu/wine/bin/wineserver\n\t\t\t ├─29020 C:\\windows\\system32\\services.exe\n\t\t\t ├─29024 C:\\windows\\system32\\winedevice.exe MountMgr\n\t\t\t ├─29031 C:\\windows\\system32\\plugplay.exe\n\t\t\t └─29041 C:\\windows\\system32\\explorer.exe /desktop\n\n\tWarning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.\n\t*/\n\t\n}", "protected function standardCommands()\n {\n return [\n AnyMakeCommand::class,\n TraitMakeCommand::class,\n ContractMakeCommand::class,\n InterfaceMakeCommand::class,\n ];\n }", "protected function callCommandMethod() {}", "public function command($m){}", "public function run($textCommand);", "public function getCmdType();", "public function testAddCommandPositive()\n {\n $this->calc->addCommand();\n }", "public function setControl($var)\n {\n GPBUtil::checkString($var, True);\n $this->control = $var;\n\n return $this;\n }", "public function setControl($var)\n {\n GPBUtil::checkString($var, True);\n $this->control = $var;\n\n return $this;\n }", "public function setControl($var)\n {\n GPBUtil::checkString($var, True);\n $this->control = $var;\n\n return $this;\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "function performCommand($cmd){\n switch ($cmd){\n // list all commands that need write permission here\n case \"editProperties\":\t\t\n case \"editQuiz\":\n case \"getPropertiesValues\":\n case \"updateProperties\":\n case \"initPropertiesForm\":\n case \"addQuestion\":\n case \"initAddQuestionForm\":\n case \"showQuestions\":\n case \"initQuestionTable\":\n case \"createQuestion\":\n case \"deleteQuestion\":\n case \"editQuestion\":\n case \"initQuestionEditForm\":\n case \"changeQuestion\":\n case \"addChoice\":\n case \"initAddChoiceForm\":\n case \"createChoice\":\n case \"deleteChoice\":\n case \"showChoices\":\n case \"initChoicesTable\":\n case \"editChoice\":\n case \"initChoiceForm\":\n case \"changeChoice\":\n case \"endCurrentRound\":\n case \"beginCurrentRound\":\n case \"info\":\n\n case \"addQuestionAndAnswers\":\n case \"initAddQuestionAndAnswersForm\":\n case \"createQuestionAndAnswers\":\n case \"showQuestionAndAnswers\":\n case \"initQuestionAndAnswersTable\":\n case \"deleteQuestionAndAnswers\":\n case \"editQuestionAndAnswers\":\n case \"initQuestionAndAnswersEditForm\":\n case \"changeQuestionAndAnswers\":\n case \"switchUp\":\n case \"switchDown\":\t\t\n\n case \"showResults\":\n case \"initResultsTable\":\n case \"showRoundResults\":\n case \"deleteRound\":\n case \"changeRoundStatus\":\n case \"exportResultData\":\n\n $this->checkPermission(\"write\");\n $this->$cmd();\n break;\n\n case \"showCurrentRound\":\t\t\t\n // list all commands that need read permission here\n \n //no commands so far\n \n $this->checkPermission(\"read\");\n $this->$cmd();\n break;\n }\n }", "public function txtCreateby_Create($strControlId = null) {\n\t\t\t$this->txtCreateby = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtCreateby->Name = QApplication::Translate('Createby');\n\t\t\t$this->txtCreateby->MaxLength = Docente::CreatebyMaxLength;\n\t\t\t$this->txtCreateby->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->txtCreateby->LinkedNode = QQN::Docente()->Createby;\n\t\t\t$this->txtCreateby->Text = $this->objDocente->Createby;\n\t\t\treturn $this->txtCreateby;\n\t\t}", "public function txtCreateby_Create($strControlId = null) {\n\t\t\t$this->txtCreateby = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtCreateby->Name = QApplication::Translate('Createby');\n\t\t\t$this->txtCreateby->MaxLength = Seccion::CreatebyMaxLength;\n\t\t\t$this->txtCreateby->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->txtCreateby->LinkedNode = QQN::Seccion()->Createby;\n\t\t\t$this->txtCreateby->Text = $this->objSeccion->Createby;\n\t\t\treturn $this->txtCreateby;\n\t\t}", "public static function getCommandName(): string\n {\n return 'make:domain:form';\n }", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function getCompositeCommand()\n {\n return \"{$this->getCompositeScriptPath()} {$this->getCompositeOptionsAsString()}\";\n }", "public function txtCreateby_Create($strControlId = null) {\n\t\t\t$this->txtCreateby = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtCreateby->Name = QApplication::Translate('Createby');\n\t\t\t$this->txtCreateby->MaxLength = ListaCurso::CreatebyMaxLength;\n\t\t\t$this->txtCreateby->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->txtCreateby->LinkedNode = QQN::ListaCurso()->Createby;\n\t\t\t$this->txtCreateby->Text = $this->objListaCurso->Createby;\n\t\t\treturn $this->txtCreateby;\n\t\t}", "public function txtMotorShort_Create($strControlId = null) {\n\t\t\t$this->txtMotorShort = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtMotorShort->Name = QApplication::Translate('Motor Short');\n\t\t\t$this->txtMotorShort->Text = $this->objFichas->MotorShort;\n\t\t\t$this->txtMotorShort->MaxLength = Fichas::MotorShortMaxLength;\n\t\t\treturn $this->txtMotorShort;\n\t\t}", "public function findCommand($name) {\n $query = $this->pdo->prepare('SELECT * FROM yubnub.commands WHERE lowercase_name = :lowercaseName');\n $query->bindValue(':lowercaseName', mb_strtolower($name), PDO::PARAM_STR);\n $query->execute();\n if ($query->rowCount() > 0) {\n $row = $query->fetch(PDO::FETCH_ASSOC);\n return $this->createCommand($row);\n }\n return null;\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function getCommandName(): string;", "public function command()\n {\n return $this->command;\n }", "static function getSubCommands();", "protected function registerCommands()\n\t{\n\t\t$this->addCommand(new Command\\Generate\\Generate);\n\t\t$this->addCommand(new Command\\Init\\Init);\n\t\t$this->addCommand(new Command\\Convert\\Convert);\n\t}", "public function getCommand() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"command\", NULL);\n\t}", "protected function handleCommands()\n {\n $controllerNames = ['ProductType','ProductCategory','ProductSubCategory','ProductListing','Brand','Material','Color','Style','ProductAttachment','Dashboard'];\n foreach ($controllerNames as $name){\n $controllerName = $name . 'Controller';\n //create controller\n if ($name != 'ProductAttachment' && $name != 'Dashboard'){\n $this->call('productmanagement:controller', ['name' => $controllerName]);\n }\n\n //create model\n if ($name != 'Dashboard') {\n $this->call('productmanagement:model', ['name' => $name]);\n }\n\n //create model\n if ($name != 'Dashboard' && $name != 'ProductAttachment') {\n $request = $name.'Request';\n $this->call('productmanagement:request', ['name' => $request]);\n }\n\n\n //Generate Views\n if ($name != 'ProductAttachment') {\n $this->call('productmanagement:views', ['name' => $name]);\n }\n }\n\n //Generate Routes\n $this->call('productmanagement:route');\n\n Artisan::call('vendor:publish', [\n '--tag' => 'migrations',\n ]);\n\n Artisan::call('vendor:publish', [\n '--tag' => 'public',\n ]);\n\n //Generate layout\n $this->call('productmanagement:views-partial',['name' => 'test']);\n\n }", "public static function CLI_getCommand(\\Console_CommandLine $parser) {\r\n //create command\r\n $command = $parser->addCommand(call_user_func(array(get_called_class(), 'CLI_commandName')), array(\r\n 'description' => call_user_func(array(get_called_class(), 'CLI_commandDescription'))\r\n ));\r\n\r\n //essentially self::getKeys(), but calling the overwriting getKeys function and not AbstractTable::getKeys()\r\n $keys = call_user_func(array(get_called_class(), 'getKeys'));\r\n //same with self::getSubCommands()\r\n $subcommands = call_user_func(array(get_called_class(), 'getSubCommands'));\r\n\r\n //add all subcommands\r\n foreach ($subcommands as $cmd) {\r\n self::processSubCommand($command, $cmd, $keys);\r\n }\r\n \r\n return $command;\r\n }", "protected function determineCommand()\n {\n if (mb_strlen($this->source) === 0) {\n $this->isInterrupted = true;\n\n return;\n }\n\n $this->command = mb_substr($this->source, 0, 1);\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n \n require base_path('routes/console.php');\n }", "public function handle(Command $command);", "public function handle(Command $command);", "public function _createCommands($btn,$rowPos)\n\t{\n\t\t$this->_setTemplateDefButtons(_html\\HtmlButton::_ACTION_ADD);\n\t\t$this->_setTemplateDefButtons(_html\\HtmlButton::_ACTION_UPDATE);\n\t\t$this->_setTemplateDefButtons(_html\\HtmlButton::_ACTION_DELETE);\n\t\t$this->_setTemplateDefButtons(_html\\HtmlButton::_ACTION_DELETE_MULTI_2);\n\t\t$this->_setTemplateDefButtons(_html\\HtmlButton::_ACTION_CLOSE);\n\t}", "protected function commands() {\n require base_path('routes/console.php');\n }", "function performCommand($cmd)\n\t{\n\t\tglobal $ilAccess, $ilTabs;\n\n\t\t$next_class = $this->ctrl->getNextClass($this);\n\t\tswitch($next_class)\n\t\t{\n\t\t\tcase 'ilmdeditorgui':\n\t\t\t\tglobal $ilErr;\n\t\t\t\tif(!$ilAccess->checkAccess('write','',$this->object->getRefId()))\n\t\t\t\t{\n\t\t\t\t\t$ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);\n\t\t\t\t}\n\t\t\t\tinclude_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';\n\t\t\t\t$md_gui = new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());\n\t\t\t\t$md_gui->addObserver($this->object,'MDUpdateListener','General');\n\t\t\t\t$ilTabs->setTabActive(\"meta_data\");\n\t\t\t\treturn $this->ctrl->forwardCommand($md_gui);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ilcommonactiondispatchergui':\n\t\t\t\trequire_once 'Services/Object/classes/class.ilCommonActionDispatcherGUI.php';\n\t\t\t\t$gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();\n\t\t\t\treturn $this->ctrl->forwardCommand($gui);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tswitch ($cmd)\n\t\t{\n\t\t\tcase \"editProperties\":\t\t// list all commands that need write permission here\n\t\t\tcase \"saveProperties\":\n\t\t\tcase \"addPair\":\n\t\t\tcase \"editPair\":\n\t\t\tcase \"savePair\":\n\t\t\tcase \"savePairNew\":\n\t\t\tcase \"deletePairs\":\n\t\t\tcase \"savePairClose\":\n\t\t\tcase \"importCSV\":\n\t\t\tcase \"copy\":\n\t\t\tcase \"move\":\n\t\t\tcase \"paste\":\n\t\t\tcase \"importPairs\":\n\t\t\tcase \"pairs\":\n\t\t\t\t$this->checkPermission(\"write\");\n\t\t\t\t$this->$cmd();\n\t\t\t\tbreak;\n\t\t\tcase \"gallery\":\t\t\t// list all commands that need read permission here\n\t\t\t\t$this->checkPermission(\"read\");\n\t\t\t\t$this->$cmd();\n\t\t\t\tbreak;\n\t\t}\n\t}", "abstract public function getCommand(string $name): string;", "protected function routingCommands()\n {\n return [\n ControllerMakeCommand::class,\n MiddlewareMakeCommand::class,\n ];\n }", "function getCommandClass()\r\n\t{\r\n\t\treturn ''; \t\r\n\t}", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }" ]
[ "0.6638124", "0.63800037", "0.62885934", "0.6281377", "0.61989665", "0.6044704", "0.58840877", "0.5823993", "0.57719284", "0.57213485", "0.57073474", "0.5648125", "0.56444454", "0.56128335", "0.56084883", "0.55366737", "0.553273", "0.5527969", "0.5511048", "0.54964226", "0.5476879", "0.5463509", "0.54575485", "0.5432476", "0.5373728", "0.5365651", "0.5360428", "0.53351504", "0.53297", "0.53270894", "0.5307519", "0.5301547", "0.5290183", "0.5290183", "0.52811915", "0.5274217", "0.52625704", "0.5252473", "0.5248899", "0.5246804", "0.52440387", "0.52433836", "0.52267694", "0.5218835", "0.52046365", "0.52046365", "0.51925087", "0.51842415", "0.5184165", "0.51838976", "0.5181427", "0.51763445", "0.5174957", "0.5160158", "0.51596445", "0.51581633", "0.5148463", "0.51459116", "0.5142654", "0.51355493", "0.51270044", "0.51210827", "0.51210827", "0.51210827", "0.51169884", "0.5110428", "0.50961643", "0.5091311", "0.50853693", "0.50815374", "0.50788826", "0.5076148", "0.507569", "0.50674134", "0.50673586", "0.5057807", "0.5056656", "0.5055585", "0.50551015", "0.5040303", "0.5032709", "0.50296456", "0.50174475", "0.5016805", "0.50133264", "0.5009948", "0.5009948", "0.50078064", "0.5006892", "0.500588", "0.5002312", "0.49943468", "0.49894226", "0.4988139", "0.4988139", "0.4988139", "0.4988139", "0.4988139", "0.4988139", "0.4988139", "0.4988139" ]
0.0
-1
Build command with arguments and serialize it for send from bus.
public static function build() { return call_user_func_array([(new static), 'serialize'], func_get_args()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function buildCommand() {\n $command = $this->getCommand();\n \n if (!is_array($this->args) || count($this->args) == 0) {\n return $command;\n }\n \n $argumentOrder = $this->getArgumentOrder();\n \n $argumentString = '';\n foreach ($argumentOrder as $argumentName) {\n $argumentString .= ' ' . $this->args[$argumentName];\n }\n \n return $command . $argumentString;\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "public function __toString()\n {\n $commandString = $this->command;\n\n if (count($this->options)) {\n $options = [];\n foreach ($this->options as $opt => $val) {\n if ($val) {\n $options[] = \"--{$opt}={$val}\";\n } else {\n $options[] = \"--{$opt}\";\n }\n }\n $commandString .= ' ' . join(' ', $options);\n }\n\n if (count($this->flags)) {\n $commandString .= ' -' . join('', $this->flags);\n }\n\n $commandString .= ' ' . $this->argument;\n\n return trim($commandString);\n }", "public function build($options)\n {\n $command = $this->path;\n\n if (isset($options['title'])) {\n $command .= \" /t:{$options['title']}\";\n }\n if (isset($options['image'])) {\n $command .= \" /i:{$options['image']}\";\n }\n if (isset($options['url'])) {\n $command .= \" /cu:{$options['url']}\";\n }\n if (isset($options['sticky']) && $options['sticky'] === true) {\n $command .= ' /s:true';\n }\n if (isset($options['message'])) {\n $command .= \" {$options['message']}\";\n }\n\n return $command;\n }", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "private function constructArguments()\r\n\t{\r\n\t\t$arguments = \"-q on \";\r\n\r\n\t\tif ($this->title)\r\n\t\t{\r\n\t\t\t$arguments.= \"-ti \\\"\" . $this->title . \"\\\" \";\r\n\t\t}\r\n\r\n\t\tif ($this->destdir)\r\n\t\t{\r\n\t\t\t$arguments.= \"-t \\\"\" . $this->destdir . \"\\\" \";\r\n\t\t}\r\n\r\n\t\tif ($this->sourcepath !== NULL)\r\n\t\t{\r\n\t\t\t$arguments.= \"-d \\\"\" . $this->sourcepath->__toString() . \"\\\" \";\r\n\t\t}\r\n\r\n\t\tif ($this->output)\r\n\t\t{\r\n\t\t\t$arguments.= \"-o \" . $this->output . \" \";\r\n\t\t}\r\n\r\n\t\tif ($this->linksource)\r\n\t\t{\r\n\t\t\t$arguments.= \"-s on \";\r\n\t\t}\r\n\r\n\t\tif ($this->parseprivate)\r\n\t\t{\r\n\t\t\t$arguments.= \"-pp on \";\r\n\t\t}\r\n\r\n\t\treturn $arguments;\r\n\t}", "protected function buildCliRequest()\n {\n global $argv;\n \n $args = $argv;\n $params = array();\n $route = '';\n \n foreach ($args as $arg) {\n if ($arg === $_SERVER['PHP_SELF']) {\n continue;\n }\n \n if (strpos($arg, '-') === 0) {\n list($key, $value) = $this->parseArgument($arg);\n \n $params[$key] = $value;\n } else {\n if ($route !== '') {\n $route .= ' ';\n }\n \n $route .= $arg;\n }\n }\n \n $base = $argv[0];\n \n $operatingSystem = $this->getOperatingSystem();\n \n return new CliRequest($route, $params, $base, 'en_US', $operatingSystem);\n }", "protected function buildCommand()\n { \n if (count($this->recipients) < 1)\n throw new InvalidStateException(\n 'Tried to send mail, but no recipients were set!');\n\n return sprintf($this->command, \n $this->recipients[count($this->recipients) - 1]['email']);\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "public function buildsCommands()\n {\n $client = ScaleEngineClient::factory(['apiSecret' => 'test']);\n $command = $client->getCommand('requestTicket');\n\n $this->assertInstanceOf('\\Guzzle\\Service\\Command\\CommandInterface', $command);\n }", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "public function buildCommand( $postArray )\n\t{\n\t\t$command = parent::buildCommand($postArray);\n\t\t\t\t\t\t\n\t\t$command = $this->addCommandFlag($command, \"no-keepstack\", \"no_keepstack\" );\n\n\t\t// if we are not testing an image, add the parellel flag\n\t\tif ( !($postArray['testimage']==\"on\") ) {\n\t\t\t$command = $this->addCommandFlag($command, \"parallel\", \"parallel\", \"on\" );\n\t\t}\n\t\t\n\t\t// remove params not needed in command\n\t\t$command = $this->removeCommandFlag($command, \"no_keepstack\" );\n\t\t\n\t\treturn $command;\n\t}", "function __construct(cliRequest $inRequest) {\r\n\t\tparent::__construct($inRequest, self::COMMAND);\r\n\t\t\r\n\t\t$this->setCommandHelp('Serialises the command line string, useful for updating strings in the database');\r\n\t\t$this->setCommandRequiresValue(true);\r\n\t}", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "public function __construct()\n\t{\n\t\t$array = $_SERVER['argv'];\n\t\t$this->command = $array[1];\n\t\tunset($array[0]);\n\t\tunset($array[1]);\n\t\tforeach ($array as $parameter) {\t\t\t\n\t\t\tif (strstr($parameter, '=')) {\n\t\t\t\t$explode = explode('=', $parameter);\n\t\t\t\t$this->parameters[str_replace('--', '', $explode[0])] = $explode[1];\n\t\t\t} else {\n\t\t\t\t$this->parameters[] = str_replace('--', '', $parameter);\n\t\t\t}\t\t\t\n\t\t}\n\t}", "protected function registerBuildCommand()\n {\n $this->app['command.torann.assets.build'] = $this->app->share(function($app)\n {\n return new BuildCommand($app['torann.assets'], $app['files'], $app['torann.manifest']);\n });\n }", "public function __toString() {\n\t\t\treturn $this->builder->command()->__toString();\n\t\t}", "public function buildCommand()\n {\n $command = $this->command . ' >> ' . $this->_output . ' 2>&1 &';\n\n return $this->_user ? 'sudo -u ' . $this->_user . ' ' . $command : $command;\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "protected function getDatabaseCommand() {\n\t\t// Prepare variables.\n\t\tglobal $databaseConfig;\n\t\t$command = array();\n\n\t\t// Provide the command required to run the interface.\n\t\tswitch ($databaseConfig['type']) {\n\t\t\tcase 'MySQLDatabase':\n\t\t\t\t$command[] = 'mysqldump';\n\t\t\t\tforeach (array(\n\t\t\t\t\t'server' => 'host',\n\t\t\t\t\t'port' => 'port',\n\t\t\t\t\t'username' => 'user',\n\t\t\t\t\t'password' => 'password',\n\t\t\t\t) as $config_key => $command_key) {\n\t\t\t\t\tif (array_key_exists($config_key, $databaseConfig)) {\n\t\t\t\t\t\t$command[] = sprintf('--%s=%s', $command_key, escapeshellarg($databaseConfig[$config_key]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$command[] = escapeshellarg($databaseConfig['database']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'PostgreSQLDatabase':\n\t\t\t\t$command[] = sprintf('PGPASSWORD=%s pg_dump', escapeshellarg($databaseConfig['password']));\n\t\t\t\tforeach (array(\n\t\t\t\t\t'server' => 'host',\n\t\t\t\t\t'port' => 'port',\n\t\t\t\t\t'username' => 'username',\n\t\t\t\t) as $config_key => $command_key) {\n\t\t\t\t\tif (array_key_exists('server', $databaseConfig)) {\n\t\t\t\t\t\t$command[] = sprintf('--%s=%s', $command_key, escapeshellarg($databaseConfig[$config_key]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$command[] = escapeshellarg($databaseConfig['database']);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// @todo Add in other database types.\n\t\t}\n\n\t\treturn implode(' ', $command);\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function testJsonSerializeShellBuilder(): void\n {\n $echo = ShellBuilder::command('echo')->addArgument('hello world');\n $grep = ShellBuilder::command('grep')->addShortOption('e', 'world');\n $builder = ShellBuilder::new()->add($echo)->pipe($grep);\n $this->assertJson(json_encode($builder));\n }", "public function getCommand() {}", "public function prepareCommand($command)\n {\n $encodedCommand = gzcompress(json_encode($command), 1);\n\n return hex2bin(str_pad(dechex(strlen($encodedCommand)), 8, '0', STR_PAD_LEFT)) . $encodedCommand;\n }", "private function get_command(){\n if (!isset($_POST['command'])) {\n die(\"No command received, no result\");\n }\n $this->command = $_POST['command'];\n }", "public function CLIAccesWithShortArgumentsBuildsCorrectRequest() {}", "public function __construct(array $arguments) {\t\t\n\t\tlist ($this->command, \n\t\t\t $this->arguments,\n\t\t\t $this->flags) = $this->parseArguments(array_slice($arguments, 1));\n\t\t\t\n\t\tif (is_null($this->command)) {\n\t\t\tif (in_array('--version', $this->flags)) {\n\t\t\t\techo 'This is Cobweb ' . Cobweb::VERSION;\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\t\n\t\t\t$this->fail('Specify a command to invoke');\n\t\t}\n\t\t\n\t\t$this->command = $this->loadCommand($this->command);\n\t}", "private function _prepareCommand() {\n\t\t$args = array(\n\t\t\tself::PDF_DPI => $this->getDpi(),\n\t\t\tself::PDF_GRAYSCALE => $this->getIsGrayscale(),\n\t\t\tself::PDF_HEADER_LEFT => null,\n\t\t\tself::PDF_HEADER_RIGHT => null,\n\t\t\tself::PDF_LOWQUALITY => $this->getIsLowQuality(),\n\t\t\tself::PDF_ORIENTATION => $this->getPageOrientation(),\n\t\t\tself::PDF_PAGE_SIZE => $this->getPageSize()\n\t\t);\n\t\t$args = array_filter($args, create_function('$v', 'return !(false === $v);'));\n\t\t$args = array_filter($args, create_function('$v', 'return !is_null($v);'));\n\n\t\t$options = array_keys($args);\n\n\t\tarray_walk($options, create_function('&$v,$k', '$v = $v . \" %s\";'));\n\t\treturn vsprintf($this->_command . ' ' . implode(' ', $options) . ' - - ', array_values($args));\n\t}", "private function build($method, $args) {\n\t\t\t$command = array();\n\t\t\t$command[] = '*' . (count($args) + 1);\n\t\t\t$command[] = '$' . strlen($method);\n\t\t\t$command[] = strtoupper($method);\n\t\t\tforeach ($args as $arg) {\n\t\t\t\t$command[] = '$' . strlen($arg);\n\t\t\t\t$command[] = $arg;\n\t\t\t}\n\t\t\treturn implode(self::CRLF, $command) . self::CRLF;\n\t\t}", "protected function buildCommand($binary, $input, $output, array $options = [])\n {\n $command = $binary;\n $escapedBinary = \\escapeshellarg($binary);\n if (\\is_executable($escapedBinary)) {\n $command = $escapedBinary;\n }\n\n foreach ($options as $key => $option) {\n if (null !== $option && false !== $option) {\n if (true === $option) {\n // Dont't put '--' if option is 'toc'.\n if ($key === 'toc') {\n $command .= ' ' . $key;\n } else {\n $command .= ' --' . $key;\n }\n } elseif (\\is_array($option)) {\n if ($this->isAssociativeArray($option)) {\n foreach ($option as $k => $v) {\n $command .= ' --' . $key . ' ' . \\escapeshellarg($k) . ' ' . \\escapeshellarg($v);\n }\n } else {\n foreach ($option as $v) {\n $command .= ' --' . $key . ' ' . \\escapeshellarg($v);\n }\n }\n } else {\n // Dont't add '--' if option is \"cover\" or \"toc\".\n if (\\in_array($key, ['toc', 'cover'])) {\n $command .= ' ' . $key . ' ' . \\escapeshellarg($option);\n } elseif (\\in_array($key, ['image-dpi', 'image-quality'])) {\n $command .= ' --' . $key . ' ' . (int) $option;\n } else {\n $command .= ' --' . $key . ' ' . \\escapeshellarg($option);\n }\n }\n }\n }\n\n if (\\is_array($input)) {\n foreach ($input as $i) {\n $command .= ' ' . \\escapeshellarg($i) . ' ';\n }\n $command .= \\escapeshellarg($output);\n } else {\n $command .= ' ' . \\escapeshellarg($input) . ' ' . \\escapeshellarg($output);\n }\n\n return $command;\n }", "public function __construct($command)\n {\n $this->command = $command;\n }", "public function command(Command $command);", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function build(): ExecuteSQLRequest\n\t{\n\t\t$instance = new ExecuteSQLRequest();\n\t\tif ($this->databaseId === null) {\n\t\t\tthrow new BuilderException('Property [databaseId] is required.');\n\t\t}\n\t\t$instance->databaseId = $this->databaseId;\n\t\tif ($this->query === null) {\n\t\t\tthrow new BuilderException('Property [query] is required.');\n\t\t}\n\t\t$instance->query = $this->query;\n\t\treturn $instance;\n\t}", "public function setFullCommand(){\n\t\t$workDir = $this->workDir;\n\t\t$command = QSUB.\" -N '\".$this->jobname.\"' -wd $workDir -q \".$this->queue;\n\t\tif ($this->cpu > 1)\n\t\t\t$command .= \" -l cpu=\". $this->cpu;\n\t\t$command .= \" \".$this->command;\n\t\t$this->fullcommand = $command;\n\t}", "protected function _generate() {\n\t\t\n\t\t// recuperation de l'executable\n\t\t$cmd = $this->getExecutable();\n\t\t\n\t\t// gestion des paramètres\n\t\tforeach ($this->getParam() as $param => $value) {$cmd .= ' --' . (!is_numeric($param) ? $param . '=' : '') . $value;}\n\t\t\n\t\t// connexion\n\t\tforeach (array('u ' => 'username', 'p' => 'password', 'dbname') as $prefix => $key) {\n\t\t\tif ($value = array_find($key, $this->getConfig())) {$cmd .= ' ' . (!is_numeric($prefix) ? '-' . $prefix : '') . $value;}\n\t\t\telse { \n\t\t\t\trequire_once 'Zend/Exception.php';\n\t\t\t\tthrow new Zend_Exception('Erreur paramètre de connexion : ' . $key);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//construction de l'url du fichier\n\t\tif (!strlen($this->getFile())) { $this->setFile($this->getDirectory() . '/mysqldump_' . array_find('dbname', $this->getConfig()) . '_' . time() .'.sql' . ($this->getCompress() ? '.bz2' : '')); }\n\t\t\n\t\t// ajoute la fonction pour la compression\n\t\t$cmd .= $this->getCompress() ? ' | bzip2 --stdout --quiet --best ' : '';\n\t\t\n\t\t// inscirption de l'url\n\t\t$cmd .= ' > ' . $this->getFile();\n\n\t\treturn $cmd;\n\t}", "public function execute()\n {\n if ($this->escape !== false) {\n $this->options = $this->escape($this->options);\n }\n $command = $this->builder->build($this->options);\n\n exec($command);\n }", "function buildDumpCommand( Array $origin ) {\n $command = \"mongodump\";\n\n if ( array_key_exists('host', $origin ) ) {\n $command .= sprintf(\" --host %s\", $origin['host']);\n }\n if ( array_key_exists('username', $origin ) ) {\n $command .= sprintf(\" --username %s\", $origin['username']);\n }\n if ( array_key_exists('password', $origin ) ) {\n $command .= sprintf(\" --password %s\", $origin['password']);\n }\n if ( array_key_exists('port', $origin ) ) {\n $command .= sprintf(\" --port %s\", $origin['port']);\n }\n if ( array_key_exists('database', $origin ) ) {\n $command .= sprintf(\" --db %s\", $origin['database']);\n }\n\n if ( array_key_exists('authentication-database', $origin ) ) {\n $command .= sprintf(\" --authenticationDatabase %s\", $origin['authentication-database']);\n }\n\n\n if ( array_key_exists('exclude-collection', $origin ) ) {\n $command .= sprintf(\" --excludeCollection %s\", $origin['exclude-collection']);\n }\n\n return $command;\n}", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function generateCommands();", "public function buildCommandLine($options=array()) {\n $command = 'git fast-import ';\n // Set the options for git fast-import\n foreach ($options as $key => $value) {\n // If the format is 'key' => 'value', output '--key=value', otherwise, output '--value'\n if (is_string($key)) {\n $command .= sprintf('--%s=%s ', $key, $value);\n } else {\n $command .= sprintf('--%s ', $value);\n }\n }\n\n return $command;\n }", "public function __toString()\n\t{\n\t\treturn $this->getCommandLine();\n\t}", "protected function defineCommandOptions(){}", "private function createCommandLineOptions()\n {\n $options = $this->options;\n\n $cmdOptions = [];\n\n // Metadata (all, exif, icc, xmp or none (default))\n // Comma-separated list of existing metadata to copy from input to output\n $cmdOptions[] = '-metadata ' . $options['metadata'];\n\n // preset. Appears first in the list as recommended in the docs\n if (!is_null($options['preset'])) {\n if ($options['preset'] != 'none') {\n $cmdOptions[] = '-preset ' . $options['preset'];\n }\n }\n\n // Size\n $addedSizeOption = false;\n if (!is_null($options['size-in-percentage'])) {\n $sizeSource = filesize($this->source);\n if ($sizeSource !== false) {\n $targetSize = floor($sizeSource * $options['size-in-percentage'] / 100);\n $cmdOptions[] = '-size ' . $targetSize;\n $addedSizeOption = true;\n }\n }\n\n // quality\n if (!$addedSizeOption) {\n $cmdOptions[] = '-q ' . $this->getCalculatedQuality();\n }\n\n // alpha-quality\n if ($this->options['alpha-quality'] !== 100) {\n $cmdOptions[] = '-alpha_q ' . escapeshellarg($this->options['alpha-quality']);\n }\n\n // Losless PNG conversion\n if ($options['encoding'] == 'lossless') {\n // No need to add -lossless when near-lossless is used\n if ($options['near-lossless'] === 100) {\n $cmdOptions[] = '-lossless';\n }\n }\n\n // Near-lossles\n if ($options['near-lossless'] !== 100) {\n // We only let near_lossless have effect when encoding is set to \"lossless\"\n // otherwise encoding=auto would not work as expected\n if ($options['encoding'] == 'lossless') {\n $cmdOptions[] ='-near_lossless ' . $options['near-lossless'];\n }\n }\n\n if ($options['auto-filter'] === true) {\n $cmdOptions[] = '-af';\n }\n\n // Built-in method option\n $cmdOptions[] = '-m ' . strval($options['method']);\n\n // Built-in low memory option\n if ($options['low-memory']) {\n $cmdOptions[] = '-low_memory';\n }\n\n // command-line-options\n if ($options['command-line-options']) {\n array_push(\n $cmdOptions,\n ...self::escapeShellArgOnCommandLineOptions($options['command-line-options'])\n );\n }\n\n // Source file\n $cmdOptions[] = escapeshellarg($this->source);\n\n // Output\n $cmdOptions[] = '-o ' . escapeshellarg($this->destination);\n\n // Redirect stderr to same place as stdout\n // https://www.brianstorti.com/understanding-shell-script-idiom-redirect/\n $cmdOptions[] = '2>&1';\n\n $commandOptions = implode(' ', $cmdOptions);\n $this->logLn('command line options:' . $commandOptions);\n\n return $commandOptions;\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "private function registerCommand(ContainerBuilder $container): self\n {\n $container->register('contentful.delivery.command.info', InfoCommand::class)\n ->addArgument(new Parameter('contentful.delivery.clients.info'))\n ->addTag('console.command', [\n 'command' => 'contentful:delivery:info',\n ])\n ;\n\n $container->register('contentful.delivery.command.debug', DebugCommand::class)\n ->addArgument(new TaggedIteratorArgument('contentful.delivery.client'))\n ->addArgument(new Parameter('contentful.delivery.clients.info'))\n ->addTag('console.command', [\n 'command' => 'contentful:delivery:debug',\n ])\n ;\n\n return $this;\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public function getCommand(): string\n {\n $port = $this->config->getPort();\n\n $java_bin = $this->config->getJavaBin();\n\n $jars = [];\n $classpaths = $this->config->getClasspaths();\n foreach ($classpaths as $classpath) {\n if (preg_match('/\\*\\.jar$/', $classpath)) {\n $directory = preg_replace('/\\*\\.jar$/', '', $classpath);\n $files = glob(\"$directory/*.jar\");\n //foreach ($files as $file) {\n foreach ($files as $file) {\n $jars[] = $file;\n }\n //}\n } else {\n $jars[] = $classpath;\n }\n }\n\n $jars[] = $this->config->getServerJar();\n $classpath = implode(':', $jars);\n $threads = $this->config->getThreads();\n\n $directives = ' -D' . implode(' -D', [\n 'php.java.bridge.daemon=\"false\"',\n \"php.java.bridge.threads=$threads\"\n ]);\n\n $command = sprintf(\n '%s -cp \"%s\" %s php.java.bridge.Standalone SERVLET:%d',\n $java_bin,\n $classpath,\n $directives,\n $port\n );\n\n return $command;\n }", "public static function escapeCommand(array $args, $meta = true)\n {\n $cmd = self::escape(array_shift($args), $meta, true);\n foreach ($args as $arg) {\n $cmd .= ' '.self::escape($arg, $meta);\n }\n\n return $cmd;\n }", "public function CLIAccesWithArgumentsWithAndWithoutValuesBuildsCorrectRequest() {}", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function generateCommand($singleCommandDefinition);", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "public function store(CommandRequest $request)\n {\n $validated = $request->validated();\n $command = Command::create($validated);\n return response($command, 200)\n ->header('Content-Type', 'text/plain');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function testEscapeArgSerialize()\n {\n \t$client = new RPC_Client_Exec('/bin/ls');\n \t$client->options->serialize = create_function('$arg', 'return \"{\" . (is_scalar($arg) ? $arg : join(\",\", $arg)) . \"}\";');\n \t\n \t$this->assertEquals(\"{Test}\", $client->escapeArg(\"Test\"));\n \t$this->assertEquals(\"{Te'st}\", $client->escapeArg(\"Te'st\"));\n \t$this->assertEquals(\"{a,b,c}\", $client->escapeArg(array('a', 'b', 'c')));\n \t$this->assertEquals(\"{localhost,3306,mydb}\", $client->escapeArg(array('host'=>'localhost', 'port'=>3306, 'db'=>'mydb')));\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "abstract protected function getCommand();", "public function testCommand()\n {\n $response = (new Command())->testCommand(Command::class);\n\n $this->assertInstanceOf(Builder::class, $response, 'A call to command() should dispatch an instance of the command and return a builder.');\n $this->assertInstanceOf(Command::class, $response->toBase(), 'The builder should wrap the command passed to command().');\n }", "public function __call($command, $arguments)\n {\n if (!isset($this->COMMANDS[$command])) {\n throw new InvalidArgumentException('MemoryStorage: Command \"' . $command . '\" not found');\n }\n \n $data = [];\n $query = ['controller' => 'memoryStorage', 'action' => $command];\n $getter = true;\n $options = ['httpParams' => [], 'query_parameters' => []];\n\n if (!isset($this->COMMANDS[$command]['getter']) || $this->COMMANDS[$command]['getter'] === false) {\n $getter = false;\n }\n\n if (isset($this->COMMANDS[$command]['required'])) {\n foreach ($this->COMMANDS[$command]['required'] as $key) {\n $value = array_shift($arguments);\n\n if ($value === null) {\n throw new InvalidArgumentException('MemoryStorage.' . $command . ': Missing parameter \"' . $key . '\"');\n }\n\n $this->assignParameter($data, $options, $getter, $key, $value);\n }\n }\n\n $argsLeft = count($arguments);\n\n if ($argsLeft > 1) {\n throw new InvalidArgumentException('MemoryStorage.' . $command . ': Too many parameters provided');\n }\n\n if ($argsLeft === 1 && !is_array($arguments[0])) {\n throw new InvalidArgumentException('MemoryStorage.' . $command . ': Invalid optional parameter (expected an associative array)');\n }\n\n if ($argsLeft === 1) {\n $options = array_merge($options, array_shift($arguments));\n\n if (isset($this->COMMANDS[$command]['opts'])) {\n if (is_array($this->COMMANDS[$command]['opts'])) {\n foreach ($this->COMMANDS[$command]['opts'] as $opt) {\n if (isset($options[$opt])) {\n $this->assignParameter($data, $options, $getter, $opt, $options[$opt]);\n unset($options[$opt]);\n }\n }\n }\n }\n }\n\n /*\n Options function mapper does not necessarily should be called\n whether options have been passed by the client or not\n */\n if (isset($this->COMMANDS[$command]['opts']) && is_callable([$this, $this->COMMANDS[$command]['opts']])) {\n $this->{$this->COMMANDS[$command]['opts']}($options);\n }\n\n $result = $this->kuzzle->query($query, $data, $options);\n\n if (isset($result['error'])) {\n return $result;\n }\n\n if (!isset($this->COMMANDS[$command]['mapResults'])) {\n return $result['result'];\n }\n\n return call_user_func([$this, $this->COMMANDS[$command]['mapResults']], $result['result']);\n }", "public function build() {}", "public function build() {}", "public function build() {}", "public function __construct()\n {\n if (3 == func_num_args()) {\n $this->command = func_get_arg(0);\n $this->environment = func_get_arg(1);\n $this->image = func_get_arg(2);\n }\n }", "abstract public function build();", "abstract public function build();", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function template() {\n\n\t\t$template = \"<?php \n\n/**\n *\n * PHP version 7.\n *\n * Generated with cli-builder gen.php\n *\n * Created: \" . date( 'm-d-Y' ) . \"\n *\n *\n * @author Your Name <email>\n * @copyright (c) \" . date( 'Y' ) . \"\n * @package $this->_namespace - {$this->_command_name}.php\n * @license\n * @version 0.0.1\n *\n */\n\n\";\n\t\tif ( ! empty( $this->_namespace ) ) {\n\t\t\t$template .= \"namespace cli_builder\\\\commands\\\\$this->_namespace;\";\n\t\t} else {\n\t\t\t$template .= \"namespace cli_builder\\\\commands;\";\n\t\t}\n\n\t\t$template .= \"\n\nuse cli_builder\\\\cli;\nuse cli_builder\\\\command\\\\builder;\nuse cli_builder\\command\\command;\nuse cli_builder\\\\command\\\\command_interface;\nuse cli_builder\\\\command\\\\receiver;\n\n/**\n * This concrete command calls \\\"print\\\" on the receiver, but an external.\n * invoker just knows that it can call \\\"execute\\\"\n */\nclass {$this->_command_name} extends command implements command_interface {\n\n\t\n\t/**\n\t * Each concrete command is built with different receivers.\n\t * There can be one, many or completely no receivers, but there can be other commands in the parameters.\n\t *\n\t * @param receiver \\$console\n\t * @param builder \\$builder\n\t * @param cli \\$cli\n\t */\n\tpublic function __construct( receiver \\$console, builder \\$builder, cli \\$cli ) {\n\t\tparent::__construct( \\$console, \\$builder, \\$cli );\n\t\t\n\t\t// Add the help lines.\n\t\t\\$this->_help_lines();\n\t\t\n\t\tif ( in_array( 'h', \\$this->_flags ) || isset( \\$this->_options['help'] ) ) {\n\t\t\t\\$this->help();\n\t\t\t\\$this->_help_request = true;\n\t\t} else {\n\t\t\t// Any setup you need.\n\t\t\t\n\t\t}\n\t}\n\n\n\t/**\n\t * Execute and output \\\"$this->_command_name\\\".\n\t *\n\t * @return mixed|void\n\t */\n\tpublic function execute() {\n\t\n\t\tif ( \\$this->_help_request ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get the args that were used in the command line input.\n\t\t\\$args = \\$this->_cli->get_args();\n\t\t\\$args = \\$this->_args;\n\t\t\n\t\t// Create the build directory tree. It will be 'build/' if \\$receiver->set_build_path() is not set in your root cli.php.\n\t\tif ( ! is_dir( \\$this->_command->build_path ) ) {\n\t\t\t\\$this->_builder->create_directory( \\$this->_command->build_path );\n\t\t}\n\n\t\t\\$this->_cli->pretty_dump( \\$args );\n\n\t\t\n\t\t// Will output all content sent to the write method at the end even if it was set in the beginning.\n\t\t\\$this->_command->write( __CLASS__ . ' completed run.' );\n\n\t\t// Adding completion of the command run to the log.\n\t\t\\$this->_command->log(__CLASS__ . ' completed run.');\n\t}\n\t\n\tprivate function _help_lines() {\n\t\t// Example\n\t\t//\\$this->add_help_line('-h, --help', 'Output this commands help info.');\n\n\t}\n\t\n\t/**\n\t * Help output for \\\"$this->_command_name\\\".\n\t *\n\t * @return string\n\t */\n\tpublic function help() {\n\t\n\t\t// You can comment this call out once you add help.\n\t\t// Outputs a reminder to add help.\n\t\tparent::help();\n\t\t\n\t\t//\\$help = \\$this->get_help();\n\n\t\t// Work with the array\n\t\t//print_r( \\$help );\n\t\t// Or output a table\n\t\t//\\$this->help_table();\n\t}\n}\n\";\n\n\t\treturn $template;\n\t}", "public function testOoCanOutputArgumentsWithValues()\n {\n $mainCommand = 'ls';\n $arguments = [new Command\\Argument('all', 'yes'), new Command\\Argument('list', 'of course')];\n $command = $this->createInstance($mainCommand);\n foreach ($arguments as $_argument) {\n $command->addArgument($_argument);\n }\n $this->assertEquals(sprintf('%1$s --all %2$s --list %3$s', $mainCommand, escapeshellarg('yes'), escapeshellarg('of course')), (string) $command, 'Must be able to output the command and argument string correctly');\n }", "public static function composeMsg (int $command, array $message) : string {\n\t\tif (!Command::isCommand ($command)) {\n\t\t\treturn Command::INVALID;\n\t\t}\n\t\treturn \"$command:\".json_encode ($message);\n\t}", "public function testOoCanOutputAllWithValues()\n {\n $mainCommand = 'composer';\n $command = $this->createInstance($mainCommand);\n\n $subCommands = [new Command\\Subcommand('update')];\n foreach ($subCommands as $_subCommand) {\n $command->addSubCommand($_subCommand);\n }\n \n $flags = [new Command\\Flag('n', 'trololo')];\n foreach ($flags as $_flag) {\n $command->addFlag($_flag);\n }\n\n $arguments = [new Command\\Argument('no-dev', 'lalala')];\n foreach ($arguments as $_argument) {\n $command->addArgument($_argument);\n }\n\n $parameters = [new Command\\Parameter('monolog/monolog')];\n foreach ($parameters as $_parameter) {\n $command->addParameter($_parameter);\n }\n\n $this->assertEquals(\n sprintf('%1$s update -n %3$s --no-dev %4$s %2$s', $mainCommand, escapeshellarg('monolog/monolog'), escapeshellarg('trololo'), escapeshellarg('lalala')),\n (string) $command,\n 'Must be able to output the command string correctly, including the sub command, flags, arguments, and parameters'\n );\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "protected function initializeCommandMethodArguments() {}", "public function provide(string $arg, bool $verbose = false, bool $recursive = false): Command\n {\n return new Command(__METHOD__, get_defined_vars());\n }", "public function __construct\n (\n array $input_parts\n )\n {\n if (count($input_parts) < 1 || count($input_parts) > 4) {\n throw new InvalidCommandException('Invalid number of parts for a command '.print_r($input_parts, true));\n }\n\n // Validate that all parts of the input has to be number\n foreach ($input_parts as $part) {\n if (!is_numeric($part)) {\n throw new InvalidCommandException('Command contains parts that are not numeric '.print_r($input_parts, true));\n }\n }\n\n // Get the value of the command number\n $potential_command_number = intval($input_parts[0]);\n\n // Make sure to validate the command number\n if (!$this->validateCommandNumber($potential_command_number)) {\n throw new InvalidCommandException('Invalid command number '.$potential_command_number);\n }\n\n // Store the command number\n $this->opcode = $potential_command_number;\n\n if ($this->opcode === self::COMMAND_HALT) {\n // It's a command to halt, nothing needed further\n return;\n } else {\n // It's either an add or multiply command\n if (count($input_parts) !== 4) {\n throw new InvalidCommandException('Not enough parts for command '.print_r($input_parts));\n }\n\n // Store the parts of the command\n $this->operant1 = intval($input_parts[1]);\n $this->operant2 = intval($input_parts[2]);\n $this->target_position = intval($input_parts[3]);\n }\n }", "public function command(string $commandClassname, array $arguments = []): Response\n\t{\n\t\t$method = new ReflectionMethod($commandClassname, 'create');\n\t\t$commandString = $method->invoke(null, $arguments);\n\t\tif ($this->debug) {\n\t\t\techo 'COMMAND STRING IS: ' . $commandString . PHP_EOL;\n\t\t}\n\t\t$tag = sprintf('%08d', $this->commandTag);\n\t\t$imapCommand = \"{$tag} {$commandString}\\r\\n\";\n\t\t$lines = [];\n\n\t\t$this->socket->write($imapCommand);\n\n\t\twhile ($line = $this->socket->read()) {\n\t\t\t$lines[] = $line;\n\t\t\tif (str_starts_with($line, $tag)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$this->lastResponse = new Response($tag, $lines);\n\t\t$this->commandTag++;\n\n\t\tif ($this->debug) {\n\t\t\tforeach ($lines as $line) {\n\t\t\t\techo $line . PHP_EOL;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->lastResponse;\n\t}", "public static function CLI_getCommand(\\Console_CommandLine $parser) {\r\n //create command\r\n $command = $parser->addCommand(call_user_func(array(get_called_class(), 'CLI_commandName')), array(\r\n 'description' => call_user_func(array(get_called_class(), 'CLI_commandDescription'))\r\n ));\r\n\r\n //essentially self::getKeys(), but calling the overwriting getKeys function and not AbstractTable::getKeys()\r\n $keys = call_user_func(array(get_called_class(), 'getKeys'));\r\n //same with self::getSubCommands()\r\n $subcommands = call_user_func(array(get_called_class(), 'getSubCommands'));\r\n\r\n //add all subcommands\r\n foreach ($subcommands as $cmd) {\r\n self::processSubCommand($command, $cmd, $keys);\r\n }\r\n \r\n return $command;\r\n }", "public function getCommand();", "public abstract function build();", "public abstract function build();", "public function toString()\n {\n return \"CommandLine\";\n }", "public function getCommand()\n {\n }", "public function buildCommands() : Collection\n {\n return collect((array) $this->get('build_commands', []));\n }", "protected function registerCommands()\n {\n $this->add(new Command\\BuildCommand());\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "abstract function build();", "protected function build()\n {\n $this->request = $this->client->createRequest(RequestInterface::POST, 'actions/u2i/conversion', null, $this->getAll());\n }", "protected function createCommandBuilder()\n {\n return new CFirebirdCommandBuilder($this);\n }", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "public function complexCommand($data, $commandTag, $tags) {\r\n $info = $this->buildArray($tags, $data);\r\n $command = $this->createCommand($commandTag);\r\n $command->appendChild($this->makeStructure($info));\r\n return $command;\r\n }", "public function buildArgs($options)\n {\n /**if (!empty($options['tests_path'])) {\n $this->tests_path = $options['tests_path'];\n }\n\n if (!empty($options['x_unit_file_path'])) {\n $this->x_unit_file_path = $options['x_unit_file_path'];\n }\n\n if (!empty($options['arguments'])) {\n $this->arguments= $options['arguments'];\n }*/\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "protected function buildFinalCommand( Command $command ) {\n\t\t$wrappers = $this->wrappers;\n\t\tusort( $wrappers, static function ( Wrapper $a, Wrapper $b ) {\n\t\t\treturn $a->getPriority() <=> $b->getPriority();\n\t\t} );\n\t\tforeach ( $wrappers as $wrapper ) {\n\t\t\t$wrapper->wrap( $command );\n\t\t}\n\n\t\tif ( $command->getIncludeStderr() ) {\n\t\t\t$command->unsafeCommand( $command->getCommandString() . ' 2>&1' );\n\t\t}\n\t}", "protected function makeCommand(): string\n {\n // make all required dirs and validate attributes\n parent::makeCommand();\n\n $path = app()->basePath() . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR;\n $fake = __DIR__ . DIRECTORY_SEPARATOR . 'log.txt';\n\n return \"{$path}fake.sh $fake 0.1\";\n }", "protected function build()\n {\n return 'INSERT'\n . $this->buildFlags()\n . $this->buildInto()\n . $this->buildValuesForInsert()\n . $this->buildReturning();\n }" ]
[ "0.71378326", "0.66368973", "0.64804363", "0.63345283", "0.59834695", "0.59090763", "0.58785033", "0.58448446", "0.57474583", "0.57109815", "0.5703746", "0.5587146", "0.55675906", "0.554257", "0.5539683", "0.5507162", "0.54456246", "0.53664273", "0.53636885", "0.5342467", "0.53376895", "0.5299037", "0.5284829", "0.52771664", "0.52456397", "0.524043", "0.52237016", "0.5221253", "0.5211692", "0.51895505", "0.51790553", "0.51641476", "0.51623183", "0.51556015", "0.5148123", "0.51459295", "0.51389414", "0.51364046", "0.5104616", "0.5101905", "0.5094728", "0.50768036", "0.5071243", "0.5064901", "0.5063125", "0.50543916", "0.50364715", "0.50218", "0.49995583", "0.49886292", "0.4985122", "0.49845278", "0.4983854", "0.49765524", "0.4974263", "0.49630347", "0.49608788", "0.4952224", "0.49513522", "0.49404374", "0.49399757", "0.49354374", "0.4930836", "0.49069408", "0.49006605", "0.49004272", "0.49004272", "0.4887684", "0.48869058", "0.48869058", "0.4885022", "0.487985", "0.48764452", "0.4872193", "0.48690727", "0.4865298", "0.48644647", "0.48608208", "0.48579425", "0.4854415", "0.4851805", "0.48484686", "0.48399848", "0.48399848", "0.4838132", "0.48318887", "0.48302573", "0.48257703", "0.48155588", "0.48060936", "0.48017904", "0.48006415", "0.47942513", "0.47923428", "0.47918385", "0.4790566", "0.4784693", "0.4780841", "0.47766992", "0.47688913" ]
0.5805697
8
Display a listing of the CardType. GET|HEAD /cardTypes
public function index() { $cardTypes = $this->cardTypeRepository->all(); return $this->sendResponse($cardTypes->toArray(), "CardTypes retrieved successfully"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n $cardtypes = CardType::all()->sortByDesc(\"id\");\n return view('backend.card_type.list',compact('cardtypes'));\n }", "protected function _get_card_types()\n\t{\n\t\treturn mod('card_type')->get_list(array('status' => 1));\n\t}", "public function index()\n {\n $card_types = CardType::orderBy('id')->paginate(10);\n return view('admin.card_types.index', compact('card_types'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AppBundle:Cardtype')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "function get_all_card_types()\n {\n $this->db->order_by('CardTypeID', 'desc');\n return $this->db->get('card_types')->result_array();\n }", "function get_all_types()\n {\n return $this->db->get('card_types')->result();\n }", "public function listAction ($type, $code = null, $page = 1)\n {\n $response = new Response();\n $response->setPublic();\n $response->setMaxAge($this->container->getParameter('short_cache'));\n \n $limit = 30;\n if ($page < 1)\n $page = 1;\n $start = ($page - 1) * $limit;\n \n $pagetitle = \"Decklists\";\n \n switch ($type) {\n case 'recent':\n $result = $this->recent($start, $limit);\n $pagetitle = \"Recent Decklists\";\n break;\n case 'halloffame':\n $result = $this->halloffame($start, $limit);\n $pagetitle = \"Hall of Fame\";\n break;\n case 'hottopics':\n $result = $this->hottopics($start, $limit);\n $pagetitle = \"Hot Topics\";\n break;\n case 'favorites':\n $response->setPrivate();\n $result = $this->favorites($start, $limit);\n $pagetitle = \"Favorite Decklists\";\n break;\n case 'mine':\n $response->setPrivate();\n if (! $this->getUser())\n {\n $result = array('decklists' => array(), 'count' => 0);\n }\n else\n {\n $result = $this->by_author($this->getUser()->getId(), $start, $limit);\n }\n $pagetitle = \"My Decklists\";\n break;\n case 'find':\n $result = $this->find($start, $limit);\n $pagetitle = \"Decklist search results\";\n break;\n case 'popular':\n default:\n $result = $this->popular($start, $limit);\n $pagetitle = \"Popular Decklists\";\n break;\n }\n \n $decklists = $result['decklists'];\n $maxcount = $result['count'];\n $count = count($decklists);\n \n $dbh = $this->get('doctrine')->getConnection();\n $factions = $dbh->executeQuery(\n \"SELECT\n\t\t\t\tf.name\" . ($this->getRequest()\n ->getLocale() == \"en\" ? '' : '_' . $this->getRequest()\n ->getLocale()) . \" name,\n\t\t\t\tf.code\n\t\t\t\tfrom faction f\n\t\t\t\torder by f.side_id asc, f.name asc\")\n ->fetchAll();\n \n $packs = $dbh->executeQuery(\n \"SELECT\n\t\t\t\tp.name\" . ($this->getRequest()\n ->getLocale() == \"en\" ? '' : '_' . $this->getRequest()\n ->getLocale()) . \" name,\n\t\t\t\tp.code\n\t\t\t\tfrom pack p\n\t\t\t\twhere p.released is not null\n\t\t\t\torder by p.released desc\n\t\t\t\tlimit 0,5\")\n ->fetchAll();\n \n // pagination : calcul de nbpages // currpage // prevpage // nextpage\n // à partir de $start, $limit, $count, $maxcount, $page\n \n $currpage = $page;\n $prevpage = max(1, $currpage - 1);\n $nbpages = min(10, ceil($maxcount / $limit));\n $nextpage = min($nbpages, $currpage + 1);\n \n $route = $this->getRequest()->get('_route');\n \n $params = $this->getRequest()->query->all();\n $params['type'] = $type;\n $params['code'] = $code;\n \n $pages = array();\n for ($page = 1; $page <= $nbpages; $page ++) {\n $pages[] = array(\n \"numero\" => $page,\n \"url\" => $this->generateUrl($route, $params + array(\n \"page\" => $page\n )),\n \"current\" => $page == $currpage\n );\n }\n \n return $this->render('NetrunnerdbBuilderBundle:Decklist:decklists.html.twig',\n array(\n 'pagetitle' => $pagetitle,\n 'locales' => $this->renderView('NetrunnerdbCardsBundle:Default:langs.html.twig'),\n 'decklists' => $decklists,\n 'packs' => $packs,\n 'factions' => $factions,\n 'url' => $this->getRequest()\n ->getRequestUri(),\n 'route' => $route,\n 'pages' => $pages,\n 'prevurl' => $currpage == 1 ? null : $this->generateUrl($route, $params + array(\n \"page\" => $prevpage\n )),\n 'nexturl' => $currpage == $nbpages ? null : $this->generateUrl($route, $params + array(\n \"page\" => $nextpage\n ))\n ), $response);\n \n }", "public function index()\n {\n $types = Type::all();\n return $this->showAll($types);\n }", "public function index()\n {\n $viewData = CancerType::view();\n return view('cancer_type.list', $viewData);\n }", "public function index()\n {\n $types = Type::all();\n\n return $this->showAll($types);\n }", "public function index()\n {\n $computerTypes = ComputerType::All();\n return view('catalogs.computerType.index',compact('computerTypes'));\n }", "public function index()\n {\n $types = $this->allResources($this->typeRepository);\n\n return TypeResource::collection($types);\n }", "protected function _getCardTypes()\n {\n return array(\n 'VI' => 'VIS',\n 'MC' => 'ECA',\n 'AE' => 'AMX'\n );\n }", "public function index()\n {\n return ClaimTypeResource::collection(ClaimType::orderBy('Claim_Type_Code','ASC'));\n }", "public function list_of($type)\n {\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $types = $em->getRepository('SandraPokemonBundle:Types')->findAll();\n\n return $this->render('types/index.html.twig', array(\n 'types' => $types,\n ));\n }", "public function index()\n {\n // $types = Type::get();\n $types = Type::select('id', 'name', 'sort')->get();\n\n // return response([\n // 'data' => $types,\n // ], Response::HTTP_OK);\n return new TypeCollection($types);\n }", "public static function getTypesList()\n {\n return ArrayHelper::map(Yii::$app->get('cms')->getPageTypes(), 'type', 'name');\n }", "protected function _listTypes()\n {\n global $config;\n $types = objects::types();\n\n $result = array();\n foreach ($types as $type) {\n $infos = objects::infos($type);\n $result[$type] = $infos['name'];\n }\n return $result;\n }", "public function index(CardRequest $request)\n {\n return $request->availableCards();\n }", "public function index()\n {\n $types = $this->typeRepository->all();\n return view('types.index', compact('types'));\n }", "function moduleOptions() {\n $sq = new sql;\n $txt = new Text($this->language, \"module_isic_card\");\n\n $list = array();\n $list[\"\"] = $txt->display(\"choose_card_type\");\n $res =& $this->db->query(\"SELECT * FROM `module_isic_card_type` ORDER BY `name`\");\n while ($data = $res->fetch_assoc()) {\n $list[$data[\"id\"]] = $data[\"name\"];\n }\n\n /*\n $list = array();\n $list[\"\"] = $txt->display(\"choose_form_type\");\n $list[1] = $txt->display(\"form_type1\");\n $list[2] = $txt->display(\"form_type2\");\n $list[3] = $txt->display(\"form_type3\");\n */\n // ####\n return array($txt->display(\"card_type\"), \"select\", $list);\n // name, type, list\n }", "public function index()\n {\n $account_types = $this->accountTypeRepository->all()->get();\n return response()->json($account_types);\n }", "public function index()\n {\n $types = RequestType::orderBy('id', 'desc')->paginate(10);\n return view('request.type.index', compact('types'));\n }", "public function index()\n {\n $deviceTypes = DeviceType::all();\n return view('devices.types.index', compact('deviceTypes'));\n }", "public function list() {\n foreach ($this->instance->registered_post_types as $key => $registered_post_type) {\n WP_CLI::line($registered_post_type->get_post_type());\n }\n }", "public function index() {\n\t\t\t$this->data[\"content\"] = $this->mongo_db->order_by(array(\"_id\"))->get(\"content_types\");\n\t\t\t$this->returndata();\n\t\t}", "public function index()\n {\n return view('admin.customer_types.index')\n ->with('customer_types', CustomerType::orderBy('type')->get());\n }", "public function actionCardIndex() {\n $searchModel = new UserCardSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $this->pageSize);\n $card_physical_id = [];\n $cardInfo = [];\n if ($dataProvider->getModels()) {\n// $card_physical_id = $dataProvider->query->asArray()->all();\n// $card_physical_id = array_column($all, 'card_id');\n foreach ($dataProvider->getModels() as $model) {\n $card_physical_id[] = $model->getAttributes();\n }\n }\n if ($card_physical_id) {\n try {\n $url = Yii::$app->request->getHostInfo() . Url::to(['@cardCenterCardInfoBySn']);\n $cardInfo = Common::curlPost($url, ['f_card_id' => $card_physical_id]);\n $cardInfo = $cardInfo ? json_decode($cardInfo, true) : '';\n } catch (Exception $exc) {\n $cardInfo = [];\n }\n }\n return $this->render('/card/index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'cardInfo' => $cardInfo,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $typeCharges = $em->getRepository('AppBundle:TypeCharge')->findAll();\n\n return $this->render('typecharge/index.html.twig', array(\n 'typeCharges' => $typeCharges,\n ));\n }", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function listAction()\n {\n $data = $this->getGiftcards();\n\n $cardCode = $this->getCollection(Giftcards::select('card_id', 'card_code')->orderBy('card_id', 'desc')->get(),\n 'card_code');\n\n return View::make(\"admin.dashboard.index_more\", array(\n \"lists\" => $data,\n \"scope\" => $this->scope,\n \"url\" => Request::url(),\n \"search_arr\" => ['card_code' => \"Card Code\", 'mail_from' => 'Mail From', 'mail_to' => 'Mail To'],\n \"search_key\" => isset($this->search_key) ? $this->search_key : '',\n \"search_by\" => isset($this->search_by) ? $this->search_by : '',\n \"cardCodeCollection\" => $cardCode\n ));\n }", "public function index()\n {\n //\n\t\t$types = Type::orderby('id', 'desc')->paginate(12);\n\t\treturn view('admin.type', ['types' => $types]);\n }", "public function index()\n {\n $baltypes = BalType::getAllBalType();\n return BalTypeResource::collection($baltypes);\n }", "public function getCardType()\n\t{\n\t\treturn 0;\n\t}", "public function index(Request $request)\n {\n try {\n $stripe = new \\Stripe\\StripeClient(config('stripe.stripe_key'));\n $stripe_customer_id = Auth::user()->stripe_customer_id;\n $cards = [];\n $paymentMethod = [];\n if(!$stripe_customer_id) {\n $customer = $stripe->customers->create([\n 'email' => Auth::user()->email,\n ]);\n\n $stripe_customer_id = $customer->id;\n\n $user = User::find(Auth::id());\n $user->stripe_customer_id = $stripe_customer_id;\n $user->save();\n }\n\n\t\t\tif($stripe_customer_id) {\n $paymentMethod = $stripe->paymentMethods->all([\n 'customer' => $stripe_customer_id,\n 'type' => 'card',\n ]);\n }\n\n $data['paymentMethod'] = $paymentMethod;\n $data['preferred_method'] = Auth::user()->payment_id;\n // $data['cards'] = $cards;\n return $this->respond([\n 'status' => 'success',\n 'status_code' => $this->getStatusCode(),\n 'message' => 'Get all cards.',\n 'data' => $data\n ]);\n } catch (Exception $e) {\n return $this->respondWithError($e->getMessage());\n }\n }", "public function index()\n {\n $usertypes = Usertype::paginate(5);\n \n return view('usertypes.index', compact('usertypes'));\n }", "public function get_types()\n {\n }", "function getTypeslist ()\r\n\t{\r\n\t\t$query = 'SELECT id, name'\r\n\t\t\t\t. ' FROM #__flexicontent_types'\r\n\t\t\t\t. ' WHERE published = 1'\r\n\t\t\t\t. ' ORDER BY name ASC'\r\n\t\t\t\t;\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$types = $this->_db->loadObjectList();\r\n\t\treturn $types;\r\n\t}", "public function listOsTypes(){\n\t\t$data = array (\n\t\t\t\t\"apiKey\" => $this->apiKey,\n\t\t\t\t\"command\" => \"listOsTypes\",\n\t\t\t\t\"response\" => \"json\"\n\t\t);\n\t\t$url = $this->getSignatureUrl ( $data );\n\t\treturn $this->curlGet ( $url );\n\t}", "public function index()\n {\n // get all the types\n $types = Type::orderBy('type')->get();\n\n // load the view and pass the types\n return view('types.index')->with('types', $types);\n }", "public function index(Request $request)\n {\n $types = Type::all();\n return view('Type.index')->with('types', $types);\n }", "public function index()\n {\n $title = 'Our Types';\n $types = Type::withCount('items')->get();\n\n return view('admin.types.index', compact('title','types'));\n }", "public function index()\n {\n $allTypes = DeviceTypes::all();\n return view('pages.pond.types.index', compact(['allTypes']));\n }", "public static function getCardTypes() {\n $ctyplist = array();\n foreach (array_keys(CreditCardValidator::$card_patterns) as $k => $v)\n $ctyplist[$v] = $v;\n return $ctyplist;\n }", "public function index()\n { \n $types = Type::paginate(8);\n return view('admin.type', compact('types'));\n }", "public function item_types()\n {\n $itemTypes = ItemTypes::where('status', 'active')->orderBy('idx')->get();\n return view('setup.item_types.index', compact('itemTypes'));\n }", "public function get_types()\n\t{\n\t\treturn $this->driver_query('type_list', FALSE);\n\t}", "public function index()\n {\n //\n $cards = Card::all();\n return $cards;\n }", "public function actionserviceTypeListing()\n\t{\n ob_start();\n Yii::app()->theme='back'; \n $res=ServiceTypes::model()->findAll();\n //echo \"<pre>\";print_r($res);die;\n $this->render('servicetypelisting',array('list'=>$res));\n\t}", "public function index()\n {\n $types = Type::all();\n\n return view('admin.type.index', [\n 'types' => $types\n ]);\n }", "public function index()\n {\n $productType = $this->productTypeService->productTypeRepository->getPaginated();\n\n return view('admin.product_type.list', compact('productType'));\n }", "public function index()\n {\n $campaignTypes = CampaignType::all();\n\n return $this->collectionResponse($campaignTypes, new CampaignTypeTransformer);\n }", "public function index()\n {\n $cards = Card::all();\n\n return view('card.card', compact('cards'));\n }", "public function CategoryListWithType(Request $request,$type)\n {\n $society_id = OauthToken::find($request->get('access_token'))->society()->first()->id;\n $results = Category::where('type', $type)\n ->where('society_id', $society_id)->get();\n return $this->presentor->make200Response('Successfully loaded.', $results);\n }", "public function index()\n {\n return $this->showAll(RequestType::all());\n }", "function listTypes($con)\n\t{\n\t\t$sql_type = \"SELECT typeID, typeName FROM savingtypes\";\n\t\t$result_type = $con->query($sql_type) or die(mysqli_error($con));\n\t\n\t\t$list_type = \"\";\n\t\twhile($rowy = mysqli_fetch_array($result_type))\n\t\t{\n\t\t\t$typeID = htmlspecialchars($rowy['typeID']);\n\t\t\t$typeName = htmlspecialchars($rowy['typeName']);\n\t\n\t\t\t$list_type .= \"<option value='$typeID'>$typeName</option>\";\n\t\t}\n\n\t\treturn $list_type;\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}", "private function resource_type_list() {\n\n\t\t$this->load_site_settings();\n\n\t\tif($this->res_list != false) {\n\t\t\treturn $this->res_list;\n\t\t}\n\n\t\tif(is_array($this->settings['eeck_resourcetypes'])) {\n\t\t\t$this->res_list = array();\n\n\t\t\tforeach($this->settings['eeck_resourcetypes'] as $res) {\n\t\t\t\t$this->res_list[] = $res['name'];\n\t\t\t}\n\t\t}\n\n\t\treturn $this->res_list;\n\t}", "public function show(TypesConges $typesConges)\n {\n //\n }", "protected function getTypes() {}", "public function getPageTypes() {}", "public function index()\n\t{\n\t\t// $product_types = $this->product_type->all();\n\t\t$product_types = ProductType::paginate(50);\n\n\t\treturn View::make('scaffolds.product_types.index', compact('product_types'));\n\t}", "function getCardList()\n {\n $txt = new Text($this->language, $this->translation_module_default);\n\n // sorting order of the query\n if (!$this->vars[\"sort\"]) {\n $sort_order = 'person_name';\n } else {\n $sort_order = $this->vars[\"sort\"];\n }\n\n if (!$this->vars[\"dir\"]) {\n $sort_dir = \"ASC\";\n } else {\n $sort_dir = $this->vars[\"dir\"];\n }\n\n // amount of records to query at once\n if (!$this->vars[\"start\"]) {\n $start_row = 0;\n } else {\n $start_row = $this->vars[\"start\"];\n }\n\n if (!$this->vars[\"limit\"]) {\n $max_rows = $this->maxresults;\n } else {\n $max_rows = $this->vars[\"limit\"];\n }\n\n $condition = array();\n if ($this->card_type_current) {\n $condition[] = \"`module_isic_card`.`type_id` = \" . $this->card_type_current;\n }\n // filter conditions\n foreach ($this->fieldData['filterview'] as $filter_data) {\n if ($this->vars[$filter_data['field']]) {\n switch ($filter_data['type']) {\n case 1: // textfield\n $condition[] = $filter_data['field'] . \" LIKE '%\" . mysql_escape_string($this->vars[$filter_data['field']]) . \"%'\";\n break;\n case 2: // combobox\n $condition[] = $filter_data['field'] . \" = \" . mysql_escape_string($this->vars[$filter_data['field']]);\n break;\n default :\n break;\n }\n }\n }\n\n $sql_condition = implode(\" AND \", $condition);\n if ($sql_condition) {\n $sql_condition = \"AND \" . $sql_condition;\n }\n\n $res =& $this->db->query(\"\n SELECT\n `module_isic_card`.*,\n IF(`module_isic_school`.`id`, `module_isic_school`.`name`, '') AS school_name,\n IF(`module_isic_card_kind`.`id`, `module_isic_card_kind`.`name`, '') AS card_kind_name,\n IF(`module_isic_bank`.`id`, `module_isic_bank`.`name`, '') AS bank_name,\n IF(`module_isic_card_type`.`id`, `module_isic_card_type`.`name`, '') AS card_type_name\n FROM\n `module_isic_card`\n LEFT JOIN\n `module_isic_school` ON `module_isic_card`.`school_id` = `module_isic_school`.`id`\n LEFT JOIN\n `module_isic_card_kind` ON `module_isic_card`.`kind_id` = `module_isic_card_kind`.`id`\n LEFT JOIN\n `module_isic_bank` ON `module_isic_card`.`bank_id` = `module_isic_bank`.`id`\n LEFT JOIN\n `module_isic_card_type` ON `module_isic_card`.`type_id` = `module_isic_card_type`.`id`\n WHERE\n `module_isic_card`.`school_id` IN (!@) AND\n `module_isic_card`.`type_id` IN (!@)\n ! \n ORDER BY ! ! \n LIMIT !, !\", \n $this->allowed_schools,\n $this->allowed_card_types,\n $sql_condition, \n $sort_order, \n $sort_dir, \n $start_row, \n $max_rows\n );\n//echo($this->db->show_query());\n $result = array();\n while ($data = $res->fetch_assoc()) {\n $t_pic = str_replace(\".jpg\", \"_thumb.jpg\", $data[\"pic\"]);\n if ($t_pic && file_exists(SITE_PATH . $t_pic)) {\n $data[\"pic\"] = \"<img src=\\\"\" . $t_pic . \"\\\">\";\n }\n $data[\"pic\"] .= \"<img src=\\\"img/tyhi.gif\\\" height=\\\"100\\\" width=\\\"1\\\">\";\n $data[\"person_birthday\"] = date(\"d/m/Y\", strtotime($data[\"person_birthday\"]));\n $data[\"expiration_date\"] = date(\"m/y\", strtotime($data[\"expiration_date\"]));\n $data[\"active\"] = $txt->display(\"active\" . $data[\"active\"]);\n $data[\"confirm_payment_collateral\"] = $this->isic_payment->getCardCollateralRequired($data[\"school_id\"], $data[\"type_id\"]) ? $txt->display(\"active\" . $data[\"confirm_payment_collateral\"]) : \"-\";\n $data[\"confirm_payment_cost\"] = $this->isic_payment->getCardCostRequired($data[\"school_id\"], $this->isic_common->getCardStatus($data[\"prev_card_id\"]), $data[\"type_id\"], $is_card_first) ? $txt->display(\"active\" . $data[\"confirm_payment_cost\"]) : \"-\";\n $result[] = $data;\n }\n\n $res =& $this->db->query(\"\n SELECT COUNT(*) AS total \n FROM \n `module_isic_card` \n WHERE\n `module_isic_card`.`school_id` IN (!@) AND\n `module_isic_card`.`type_id` IN (!@)\n ! \n \", \n $this->allowed_schools,\n $this->allowed_card_types,\n $sql_condition);\n if ($data = $res->fetch_assoc()) {\n $total = $data[\"total\"];\n }\n \n echo JsonEncoder::encode(array('total' => $total, 'rows' => $result));\n exit();\n }", "public function index(Request $request)\n {\n $this->typeRepository->pushCriteria(new RequestCriteria($request));\n $types = $this->typeRepository->all();\n\n return view('backend.types.index')\n ->with('types', $types);\n }", "public function newAction()\n {\n $entity = new Cardtype();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function getTodoTypeListAction(){\n /** @var Object_Todo $todo */\n $this->getDeviceSession()->getUserId();\n $todo = new Object_Todo();\n $this->_helper->json($todo->getClass()->getFieldDefinition('Todo_type'));\n }", "public function index()\n {\n $this->authorize('manage_site');\n\n $ctypes = Ctype::all();\n return view('ctype.index',compact('ctypes'));\n }", "public function index()\n {\n //$shiptypes = $this->shiptype->all();\n\n return $this->view('admin::shiptypes.index');\n }", "public function index()\n {\n $allType = \\App\\TypeTrucks::all();\n return view('types/index', compact('allType'));\n }", "public function getTypesList() {\n \t//maybe someday sorts them by course, student progress?\n \t$course_id = Auth::user()->course_id;\n Debugbar::info($course_id);\n $course = Course::find($course_id);\n Debugbar::info($course);\n $typesList = $course->questions;\n Debugbar::info($typesList);\n \treturn $typesList;\n }", "public function index()\n {\n if (! Gate::allows('operation_type_access')) {\n return abort(401);\n }\n\n\n if (request('show_deleted') == 1) {\n if (! Gate::allows('operation_type_delete')) {\n return abort(401);\n }\n $operation_types = OperationType::onlyTrashed()->get();\n } else {\n $operation_types = OperationType::all();\n }\n\n return view('admin.operation_types.index', compact('operation_types'));\n }", "public function index()\n {\n $item_types = Item_Type::all();\n return view('admin_panel.item_types.index',compact('item_types'));\n }", "public static function getTypes();", "public function show(types $types)\n {\n //\n }", "public function listAllType(){\n try {\n return $this->identityTypeGateway->getAllTypes();\n } catch (Exception $ex) {\n throw $ex;\n }catch (PDOException $e){\n throw $e;\n }\n }", "public static function setMediaType() {\r\n $result = array();\r\n if (lC_Default::setMediaType($_GET['type'], $_GET['size'])) {\r\n $result['rpcStatus'] = '1';\r\n }\r\n \r\n echo json_encode($result);\r\n }", "public function index()\n {\n $companytypes = Companytype::oldest('name')->get();\n return view('masters.companytypes.index', compact('companytypes'));\n }", "public function index()\n {\n $types=Trucktype::where('status',0)->orderBy('id','DESC')->get();\n return view('admin.truck.type.view',compact('types'));\n }", "protected function getSupportedCardTypes()\n {\n if ($this->isCreditCardActive()) {\n return Mage::getStoreConfig('payment/gene_braintree_creditcard/cctypes');\n }\n\n return [];\n }", "function get_card_type($CardTypeID)\n {\n return $this->db->get_where('card_types',array('CardTypeID'=>$CardTypeID))->row_array();\n }", "public function index(Request $request)\n {\n if ($request->type) {\n return response()->json(ArrangeableType::whereModel($request->type)->get());\n }\n\n return response()->json(ArrangeableType::all());\n }", "public function index(CarTypeDataTable $dataTable)\n {\n return $dataTable->render('admin.car_type.view');\n }", "public function getAllTypes(){\n return $this->find()->asArray()->orderBy('typeDesc ASC')->all();\n }", "public function getCcTypes() {\n\n\t\t$cc_types = new Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_Cardtype();\n\t\t$types = $cc_types->toOptionArray();\n\n $availableTypes = Mage::getModel('ccgateway/standard')->getConfigData('card_type');\n\n if ($availableTypes) {\n $availableTypes = explode(',', $availableTypes);\n\t\t\t$result = array(); \n\t\t\tforeach ($types as $val) { \n\t\t\t if (($key = array_search($val['value'], $availableTypes, TRUE))!==false) { \n\t\t\t\t $result[] = $val; \n\t\t\t\t unset($availableTypes[$key]); \n\t\t\t }\n\t\t\t}\n }\n\n return $result; \n }", "public function index()\n\t{\n\t\t$awardtypes = AwardType::paginate(8);\n\t\t\n\t\treturn view('admin.awardtypes.index', compact(\"awardtypes\"));\n\t}", "public function index(Request $request)\n {\n $types = CurationType::all();\n\n return $types;\n }", "public function search()\n {\n $account_types = $this->accountTypeRepository->all()->get();\n return response()->json($account_types);\n }", "public function index() {\n\t\t$limit = request()->get('limit', null);\n\n\t\t$includes = request()->get('include', '');\n\n\t\tif ($includes) {\n\t\t\t$this->repository->with(explode(',', $includes));\n\t\t}\n\n\t\t$this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n\n\t\t$typeCinemas = $this->repository->paginate($limit, $columns = ['*']);\n\n\t\treturn response()->json($typeCinemas);\n\t}", "public function index()\n {\n return view('paytype.index', \n [\n 'payTypes' => PayType::paginate(10),\n 'types' => Type::all()\n ]\n );\n }", "protected function list($type = null)\n {\n $faqs = $this->repository\n ->pushCriteria(app('Litepie\\Repository\\Criteria\\RequestCriteria'))\n ->scopeQuery(function($query){\n return $query->orderBy('id','DESC');\n })->paginate();\n\n\n return $this->response->title(trans('faq::faq.names'))\n ->view('faq::public.faq.index')\n ->data(compact('faqs'))\n ->output();\n }", "public function index()\n {\n $types = Type::all();\n\n return response()->json($types, 200, ['Content-Type' => 'application/json;charset=utf8'], JSON_UNESCAPED_UNICODE);\n }", "public function index(Request $request)\n {\n $types = types::all();\n if($request->has('search'))\n {\n $types = types::where('type_id','like',\"%{$request->search}%\")-> orWhere('type_name','like',\"%{ $request->search }%\")->get();\n }\n return view('types.index', compact('types'));\n }", "public function index()\n {\n $roomTypes = $this->roomType->getRoomTypes();\n return view('admin.room_types.list_room_type', ['roomTypes'=>$roomTypes]);\n }", "public function indexByTypeAction($type)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('StriideInventoryBundle:Item')->findByType($type);\n\n return $this->render('StriideInventoryBundle:Item:indexByType.html.twig', array(\n 'entities' => $entities,\n 'type' => $type\n ));\n }", "public function list()\n {\n return $this->getResult($this->client->get('linode/types'));\n }", "public function index()\n {\n return ProductType::all();\n }" ]
[ "0.8006593", "0.77714574", "0.7747189", "0.7200767", "0.6699193", "0.6673415", "0.6557275", "0.65284455", "0.65209764", "0.64769113", "0.6316018", "0.6305176", "0.6210645", "0.6209893", "0.6191733", "0.61816347", "0.61806655", "0.6175492", "0.61627316", "0.6161032", "0.6139601", "0.6113256", "0.60857004", "0.60592306", "0.6056454", "0.6055612", "0.60092676", "0.5994376", "0.5973645", "0.5962037", "0.59443516", "0.59443516", "0.59443516", "0.59443516", "0.5943441", "0.59434384", "0.5921173", "0.59029126", "0.58748484", "0.58713394", "0.58662474", "0.586149", "0.5852332", "0.58486474", "0.58469933", "0.58426785", "0.58289796", "0.5827003", "0.58178", "0.58134395", "0.5802573", "0.5802428", "0.5799989", "0.57932246", "0.5784654", "0.57731473", "0.5769091", "0.5755994", "0.5754953", "0.5753609", "0.5745554", "0.5744458", "0.57426983", "0.57403785", "0.5736048", "0.5728393", "0.572547", "0.5724556", "0.57083356", "0.5706586", "0.56990844", "0.56975186", "0.5685685", "0.5682242", "0.5664864", "0.56558174", "0.5653185", "0.56514573", "0.56493765", "0.5646411", "0.56459755", "0.56431353", "0.5642647", "0.5642243", "0.56418097", "0.5641744", "0.56377643", "0.5635483", "0.5630346", "0.56293947", "0.5619676", "0.561926", "0.5605318", "0.55965805", "0.5594237", "0.5590775", "0.5585858", "0.5585077", "0.557369", "0.5570208" ]
0.7995267
1
Show the form for creating a new CardType. GET|HEAD /cardTypes/create
public function create() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n $vehicle_types = VehicleType::all();\n return view('admin.card_types.create', compact('vehicle_types'));\n }", "public function newAction()\n {\n $entity = new Cardtype();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function createAction(Request $request)\n {\n $entity = new Cardtype();\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('cardtype_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n $formData = CancerType::create();\n return view('cancer_type.add', $formData);\n }", "public function create()\n {\n return view('types.create');\n }", "public function create()\n {\n return view('types.create');\n }", "public function create()\n {\n return view('types.create');\n }", "public function create()\n {\n return view('types.create');\n }", "public function create()\n {\n return view('backend.types.create');\n }", "public function create()\n {\n return view('catalogs.computerType.create');\n }", "public function create()\n {\n $model = new Type_cars();\n return view('modules.type.form', compact('model'));\n }", "public function create()\n {\n $types = Type::all();\n return view('admin.addtype');\n }", "public function create()\n {\n return view('payType.create', ['types' => Type::all()]);\n }", "public function create()\n {\n $title = \"Create New type for the Items\";\n return view('admin.types.create', compact('title'));\n }", "public function create()\n\t{\n\t\treturn view('admin.awardtypes.create');\n\t}", "public function create()\n {\n //\n return view('layouts.unit_types.form', ['type' => 'create']);\n }", "public function create()\n {\n return view('admin.type.create');\n }", "public function create()\n {\n return view('admin.truck.type.create');\n }", "public function create()\n\t{\n\t\treturn View::make('scaffolds.product_types.create');\n\t}", "public function actionCreate()\n {\n $model = new GiftcodeType();\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 {\n return view('admin/type/create');\n }", "public function create()\n {\n return view('beer.type.create');\n }", "public function create()\n\t{\n\t\tif ( $this->checkAccess( config('lex.acl.create') ) ) {\n\t\t\treturn view( config('lex.views.create') );\n\t\t}\n\n\t\treturn view( $this->unauthorized, ['message' => 'create new currency types'] );\n\t}", "public function create()\n {\n return view('admin.formtype.create', [\n 'form_type' => new FormType,\n 'colors' => Setting::colors()\n ]);\n }", "public function create(Request $request)\n {\n\t\tif( ! $request->ajax()){\n\t\t return view('backend.card_type.create');\n\t\t}else{\n return view('backend.card_type.modal.create');\n\t\t}\n }", "public function create()\n {\n return view('admin::appraisal.types.create');\n }", "public function create()\n\t{\n\t\treturn View::make('gametypes.create');\n\t}", "public function create()\n {\n return $this->view('admin::shiptypes.create');\n }", "public function createType()\n {\n\n return view('expense.type.create', compact(''));\n }", "public function create()\n {\n return view('request.type.create');\n }", "public function create()\n {\n return view('devices.types.create');\n }", "public function create()\n {\n return view('salery_types.create');\n }", "public function create()\n {\n $types = Core_custom_field_type::select('ID','name')->get();\n\n\n return view('common::backend.customfield.create' , compact('types'));\n }", "public function create()\n {\n return view('card.create',);\n }", "public function create()\n {\n return view('Type.create');\n }", "public function create()\n {\n return View::make('product_types.create');\n }", "public function create()\n {\n //\n return view('type');\n }", "public function create()\n {\n return view('product_type.create');\n }", "public function getCreate()\n {\n\n // Title\n $title = Lang::get('admin/types/title.create_a_new_type');\n\n // Show the page\n return View::make('admin/types/create', compact('title'));\n }", "public function create()\n {\n return view('service_type.create');\n }", "public function create()\n\t{\n\t\tif(!Auth::user()->hasPermission('createType')){\n\t\t\treturn redirect()->route('admin.getHome')->with('flash_message_error', '403! Không thể Create Type');\n\t\t}\n\t\t//\n\t\treturn view('admin.type.add');\n\t}", "public function create()\n {\n return view('masters.companytypes.create');\n }", "public function create()\n {\n return view('usertypes.create');\n }", "public function create()\n {\n $types = TypeComplaint::all(); //Get all types\n\n return view('complaints.create', compact('types'));\n }", "public function create($type_id)\n {\n\n return view('admin.brands.types.models.create',compact('type_id'));\n }", "public function create()\n {\n $this->authorize('family_cards.manage');\n\n return view('family_cards.create');\n }", "public function create()\n {\n return view('card.create');\n }", "public function newAction()\n {\n $typeSeance = new TypeSeance();\n\n $form = $this->createCreateForm($typeSeance);\n\n $pages = array();\n $pages['Types de Séance '] = \"movibe_backend_typeSeance\";\n $pages['Creation'] = \"\";\n $this->breadcrumb($pages);\n\n return $this->render('MovibeBackendBundle:TypeSeance:new.html.twig', array(\n 'typeSeance' => $typeSeance,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('tournamenttypes.create');\n\t}", "public function create()\n {\n return view('admin.master.expense_type.add');\n }", "public function createAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"vehicletypes\",\n \"action\" => \"index\"\n ));\n }\n\n $vehicletype = new Vehicletypes();\n\n $vehicletype->setName($this->request->getPost(\"name\"));\n\n if (!$vehicletype->save()) {\n foreach ($vehicletype->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"vehicletypes\",\n \"action\" => \"new\"\n ));\n }\n\n $this->flash->success(\"vehicletype was created successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"vehicletypes\",\n \"action\" => \"index\"\n ));\n\n }", "public function create()\n {\n return view('cards.create');\n }", "public function create()\n {\n return view('cards.create');\n }", "public function create()\n {\n return view('back.cards.create');\n }", "public function create()\n {\n $types = type::all();\n return view('dashboard.matrail.create', compact('types'));\n //\n }", "public function create()\n {\n //\n return view('admin.complainttype.create');\n }", "public function create()\n {\n return view('admin.product_types.create');\n }", "public function create()\n {\n if (! Gate::allows('operation_type_create')) {\n return abort(401);\n }\n return view('admin.operation_types.create');\n }", "private function createCreateForm(Cardtype $entity)\n {\n $form = $this->createForm(new CardtypeType(), $entity, array(\n 'action' => $this->generateUrl('cardtype_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function create()\n {\n return view('sporttypes.create');\n }", "public function create()\n {\n return view('manage.project-type.create');\n }", "public function create()\n\t{\n $types = ProductTypesController::getProductTypesList();\n\n\t\treturn view('orderTypes.create',compact('types'));\n\t}", "public function create()\n {\n return view('admin.typeField.create');\n }", "public function create()\n {\n //\n return view('studentType.create');\n }", "public function createAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"action\" => \"index\"\n ));\n }\n\n $itemsType = new ItemsType();\n\n $itemsType->code = $this->request->getPost(\"code\");\n $itemsType->name = $this->request->getPost(\"name\");\n \n\n if (!$itemsType->save()) {\n foreach ($itemsType->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"action\" => \"new\"\n ));\n }\n\n $this->flash->success(\"Items Type was created successfully\");\n\n return $this->dispatcher->forward(array(\n \"action\" => \"index\"\n ));\n\n }", "public function create()\n {\n $allTypes = $this->economicalActivityTypeRepository->getAllForDropdown();\n return view('economical_activity_types.create')\n ->with('allTypes', $allTypes);\n }", "public function create()\n {\n return view('admin.pages.company-type.create');\n }", "public function create()\n {\n return view('admin_panel.item_types.create');\n }", "public function create()\n {\n return view('admin.product_type.create');\n }", "public function create()\n {\n $DBType = Type::all();\n $DBPokemon = Pokemon::all();\n return view(\"pages.createType\", compact(\"DBType\", \"DBPokemon\"));\n }", "public function permit_type_add_form()\n {\n $this->load->view('common/header');\n $this->load->view('permit/permittype/create_form');\n $this->load->view('common/footer');\n }", "public function create()\n {\n return view('unit_type.create');\n }", "public function newAction()\n {\n //Add Resource\n $this->_addResource();\n\n //Add toolbar button\n $this->_toolbar->addSaveButton();\n $this->_toolbar->addCancelButton('index');\n\n $menu_items = MenuItems::find();\n $form = new MenuTypeForm();\n\n if ($this->request->isPost()) {\n $menuType = new MenuTypes();\n if ($form->isValid($_POST, $menuType)) {\n $this->saveMenuDetails($menuType);\n } else {\n $this->flashSession->error('gb_please_check_required_filed');\n }\n }\n\n $this->view->setVar('form', $form);\n $this->view->setVar('menu_items', $menu_items);\n }", "public function newAction() {\n\n $entity = $this->get('admin.helper.ClothingType')->createNew();\n $form = $this->createForm(new ClothingTypes('add',$entity), $entity);\n return $this->render('LoveThatFitAdminBundle:ClothingType:new.html.twig', array(\n 'form' => $form->createView()));\n }", "public function create()\n {\n $specification = Specification::all();\n return view('specification_types.create')->with(compact('specification'));\n }", "public function create()\n {\n $subjects = DB::table('subjects')->get();\n $card_types = DB::table('card_types')->get();\n $fields = DB::table('fields')->get();\n $grades = DB::table('grades')->get();\n $chapters = DB::table('chapters')->where('subject_id', 1)->get();\n $exercises = DB::table('exercises')->where('subject_id', 1)->get();\n $status = ['pubish' => 'Publie', 'private' => 'Prive'];\n $years = [];\n for ($i=0; $i < 20; $i++) {\n $years[] = $i + 1990;\n }\n return view('cards.cards_form')->with(compact(\n 'subjects', 'card_types', 'fields', 'grades', 'status', 'chapters', 'years', 'exercises'\n ));\n }", "public function create()\n {\n $powers = Power::orderBy('name')->get();\n $rarities = Rarity::orderBy('level')->get();\n $card = new Card;\n return view('admin.cards.create', compact('card', 'powers', 'rarities'));\n }", "public function create()\n {\n if (!checkRole(getUserGrade(1)))\n {\n prepareBlockUserMessage();\n return back();\n }\n\n $data['title'] = 'Create Industry Type';\n $data['active_class'] = 'industry_type';\n \n\n $data['subscribers'] = Subscriber::getSubscriberOptions();\n \n return view('admin.industry_type.create', $data);\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('mutual-fund-type.create');\n }", "public function create()\n {\n\n $types = Type::all();\n return view('warbands.create', ['types' => $types]);\n }", "public function create()\n {\n return view('user-type.create');\n }", "public function create()\n {\n // ตรวจสอบ permission\n ChkPerm('st-vehicle-type-create', 'setting/st-vehicle-type');\n\n return view('setting.st-vehicle-type.create');\n }", "public function create()\n\t{\n\t\treturn View::make('userCardio.create');\n\t}", "public function actionCreate()\r\n {\r\n $model = new Attributes();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n $typeFields = ArrayHelper::map(TypeFields::find()->asArray()->orderBy('name')->all(), 'id', 'name');\r\n\r\n return $this->render('create', [\r\n 'model' => $model,\r\n 'typeFields' => $typeFields\r\n ]);\r\n }\r\n }", "public function create($type){\n $this->setFormType($type);\n $this->setActionMethod($type);\n }", "public function create()\n {\n $categories = Category::all();\n $car_types = CarType::all();\n return view('admin.cars.add_new_car', compact('categories', 'car_types'));\n }", "public function create()\n {\n if (! Gate::allows('jobtype_create')) {\n return abort(401);\n }\n return view('jobtypes.create');\n }", "public function create(Request $request)\n {\n //$types = Type::all();\n $types =['' => 'Select a type'] + Type::pluck('name','id')->all();\n\n Log::info($request->backyard_id);\n \n return view('createPlantation')\n ->with(\"types\",$types)\n ->with(\"backyard\",$request->backyard_id);\n }", "public function create()\n {\n return view('admin.theloaisach.add-type-book');\n }", "public function create()\n {\n return view('admin.job_types.create');\n }", "public function create()\n {\n //\n return view('admin.nom.prefcontrtypes.create');\n }", "public function newAction()\n {\n $entity = new ObjectType();\n $form = $this->createCreateForm($entity);\n\n return $this->render('BrainstrapBundlesFrontBundle:Object/ObjectType:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function postCreate()\n {\n\n // Declare the rules for the form validation\n $rules = array(\n 'name' => 'required'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n // Check if the form validates with success\n if ($validator->passes())\n {\n // Get the inputs, with some exceptions\n $inputs = Input::except('csrf_token');\n\n $this->type->name = $inputs['name'];\n $this->type->save();\n\n // Was the type created?\n if ($this->type->id)\n {\n // Redirect to the new type page\n return Redirect::to('admin/types/' . $this->type->id . '/edit')->with('success', Lang::get('admin/types/messages.create.success'));\n }\n\n // Redirect to the new type page\n return Redirect::to('admin/types/create')->with('error', Lang::get('admin/types/messages.create.error'));\n\n // Redirect to the type create page\n return Redirect::to('admin/types/create')->withInput()->with('error', Lang::get('admin/types/messages.' . $error));\n }\n\n // Form validation failed\n return Redirect::to('admin/types/create')->withInput()->withErrors($validator);\n }", "public function create()\n {\n $type = Type::with('childrenType')->orderBy('short')->get();\n return view('admin.goods.goods_add',compact('type'));\n }", "public function create()\n {\n return view('admin.transactionType.create');\n }", "public function create()\n\t{\n\t\treturn View::make('banks.create');\n\t}", "public function actionCreate()\n {\n $model = new ListRegionType();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $getParams = Yii::$app->getRequest()->get();\n $model->generateDefaults($getParams);\n return $this->render('form', ['model' => $model]);\n }\n }", "public function create()\n {\n return view(\"feedtype.create\");\n }", "public function create()\n {\n return view(\"teacher.pages.exam-types.create\");\n }", "public function actionCreate()\n {\n $model = new DrpMaterialType();\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 }" ]
[ "0.77512854", "0.77071345", "0.7470313", "0.72935045", "0.7129155", "0.7129155", "0.7129155", "0.7129155", "0.7128335", "0.70886153", "0.70836544", "0.7079879", "0.7065928", "0.70650715", "0.699023", "0.6982837", "0.69462985", "0.6937143", "0.6933166", "0.692885", "0.6925652", "0.6923149", "0.6919979", "0.691723", "0.6906858", "0.68923014", "0.6871967", "0.6858738", "0.68573886", "0.6855002", "0.6849868", "0.6849686", "0.68482107", "0.6833656", "0.68155044", "0.6791956", "0.676955", "0.67658514", "0.6763193", "0.67596453", "0.67279285", "0.6713516", "0.67025524", "0.6697978", "0.668978", "0.6682243", "0.66732275", "0.6671751", "0.6669074", "0.6646056", "0.66419685", "0.6635994", "0.6635994", "0.66345596", "0.66342103", "0.66146195", "0.6602507", "0.6597432", "0.6595118", "0.6590617", "0.65803134", "0.6574477", "0.65612227", "0.6560753", "0.65584266", "0.65378714", "0.6534525", "0.6530815", "0.65295666", "0.65226156", "0.6510571", "0.64891165", "0.64888847", "0.64877856", "0.64868253", "0.64736843", "0.6472581", "0.6464653", "0.6459012", "0.6455656", "0.6450059", "0.6443721", "0.6438795", "0.6433826", "0.6430728", "0.64220166", "0.6416535", "0.6407713", "0.64054024", "0.640346", "0.6372736", "0.6356276", "0.6354781", "0.63482344", "0.63478714", "0.63357633", "0.6330874", "0.63166845", "0.63121", "0.6308961", "0.6292881" ]
0.0
-1
Store a newly created CardType in storage. POST /cardTypes
public function store(Request $request) { if(sizeof(CardType::$rules) > 0) $this->validateRequestOrFail($request, CardType::$rules); $input = $request->all(); $cardTypes = $this->cardTypeRepository->create($input); return $this->sendResponse($cardTypes->toArray(), "CardType saved successfully"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(Request $request)\n {\n $request->validate([\n 'type' => 'required|string|max:255|unique:card_types,type',\n ]);\n $input_prices = $request->except('_token', 'type');\n $card_type = CardType::create([\n 'type' => $request->type,\n ]);\n foreach(VehicleType::all() as $vehicle_type){\n Price::create([\n 'vehicle_type_id' => $vehicle_type->id,\n 'card_type_id' => $card_type->id,\n 'price' => $input_prices[$vehicle_type->id.'-price']*100,\n ]);\n }\n return redirect()->to(route('admin.card-types.index'))->with('success', 'Card type added successfully');\n }", "public function store()\n {\n $this->validate(request(), [\n 'name' => 'required|unique:lead_types,name',\n ]);\n\n Event::dispatch('settings.type.create.before');\n\n $type = $this->typeRepository->create(request()->all());\n\n Event::dispatch('settings.type.create.after', $type);\n\n return response([\n 'data' => new TypeResource($type),\n 'message' => __('admin::app.settings.types.create-success'),\n ]);\n }", "public function store(TypeRequest $request)\n {\n $type = Type::create($request->all());\n\n return $this->showOne($type, 'type creado correctamente');\n }", "public function store(TypeStoreRequest $request)\n {\n types::create([\n 'type_id' => $request->type_id,\n 'type_name' => $request->type_name,\n ]);\n return redirect()->route('types.index')->with('message','Type Added Successfully');\n }", "public function store(Request $request)\n {\t\n\t\t$validator = Validator::make($request->all(), [\n\t\t\t'card_type' => 'required|max:50',\n\t\t 'currency_id' => 'required'\n\t\t]);\n\t\t\n\t\tif ($validator->fails()) {\n\t\t\tif($request->ajax()){ \n\t\t\t return response()->json(['result'=>'error','message'=>$validator->errors()->all()]);\n\t\t\t}else{\n\t\t\t\treturn redirect()->route('card_types.create')\n\t\t\t\t\t\t\t->withErrors($validator)\n\t\t\t\t\t\t\t->withInput();\n\t\t\t}\t\t\t\n\t\t}\n\t\t\t\n\t \n\t\t\n $cardtype = new CardType();\n\t $cardtype->card_type = $request->input('card_type');\n\t $cardtype->currency_id = $request->input('currency_id');\n\t\n $cardtype->save();\n\n //Prefix Output\n $cardtype->currency_id = $cardtype->currency->name;\n \n\t\tif(! $request->ajax()){\n return redirect()->route('card_types.create')->with('success', _lang('Saved Sucessfully'));\n }else{\n\t\t return response()->json(['result'=>'success','action'=>'store','message'=>_lang('Saved Sucessfully'),'data'=>$cardtype]);\n\t\t}\n \n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'type' => 'required|max:255',\n ]);\n\n Type::create($request->all());\n return redirect()->route('types.index')\n ->with('success','Tipo di utente creato');\n }", "public function store(Request $request)\n {\n //get session token\n $this->token = session('token');\n \n //trello url to creates a new card\n $url = \"https://api.trello.com/1/cards?\".\n \"idList=$request->list&\".\n \"name=$request->name&\".\n \"key=$this->key&token=$this->token\";\n \n $client = new Client();\n $response = $client->post($url);\n \n //after creation this method return to card list\n return back();\n }", "public function storeType(Request $request)\n {\n $type = new ExpenseType();\n $type->name = $request->name;\n $type->save();\n Flash::success(trans('general.successfully_saved'));\n return redirect('expense/type/data');\n }", "public function store(Request $request)\n {\n $validationRules = $this->getValidationRules('Insert');\n $this->validate($request, $validationRules);\n\n $type = new Type;\n $type->type = $request->type;\n\n $type->save();\n\n $request->session()->flash('status', '<span>Success</span>: Type created.');\n return redirect()->route('types.index');\n }", "public function store(TypeRequest $request)\n {\n\n $createdType = $this->typeRepo->create($request->all());\n if ($createdType) {\n\n \\Session::flash('success', 'Apprasial order Type was successfully created!');\n\n return redirect()->route('admin.appraisal.appr-types.index');\n \n } else {\n\n \\Session::flash('error', 'Something was wrong!');\n\n return redirect()->route('admin.appraisal.appr-types.index');\n }\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => [\n 'required',\n 'max:50',\n Rule::unique('types', 'name'), // types 资料表中 name 栏位资料是唯一值\n ],\n 'sort' => 'nullable|integer',\n ]);\n\n if (!isset($request->sort)) {\n $max = Type::max('sort');\n $request['sort'] = $max + 1;\n }\n\n $type = Type::create($request->all());\n\n // return response([\n // 'data' => $type,\n // ], Response::HTTP_CREATED);\n return new TypeResource($type);\n }", "public function store(TypeRequest $request)\n {\n $validated = $request->validated();\n Type::create([\n 'title' => $validated['title']\n ]);\n\n return response()->json([\n 'message' => 'Успешно добавлено',\n ]);\n }", "public function store(Request $request)\n {\n //\n\t\t\t\t$id = Snumber::getLastNumber('n_preffered_contract_type');\n\n //Create a new prefcontrtypes\n\t\t\t\t$update = new N_prefcontrtype();\n $update = ['id'=>$id, 'name' => $request->name, 'old_code' => $request->old_code, 'is_active'=>$request->is_active];\n N_prefcontrtype::create($update);\n\n //registrationrequest::create($this->validatedData());\n\n return redirect()->route('nom.prefcontrtypes.index');;\n }", "public function store(TypeRequest $request)\n {\n $files = Input::file('image');\n $input = $request->all();\n $slug = $request->input('slug');\n $uniqueSlug = $this->buildUniqueSlug('type', $request->id, $slug);\n $path = base_path() . '/storage/app/type/';\n $newFolderPath = $this->buildNewFolderPath($path, $files->getClientOriginalName());\n // File::makeDirectory($newFolderPath[1], 0777, true, true);\n if($request->hasFile('image')){\n $image = $newFolderPath[0];\n }\n $data = ['title' => $input['name'], 'slug' => $uniqueSlug, 'description' => $input['description'], 'is_active' => $input['is_active'], 'image' => $image, 'created_at' => date('Y:m:d H:i:s')];\n if(DB::table('type')->insert($data)){\n $files->move($path,$newFolderPath[0]);\n }\n return redirect()->intended('admin/type');\n }", "public function store(CreateTypeRequest $request)\n {\n $input = $request->only('name');\n if($this->typeRepository->create($input)) {\n return redirect()->route('types.index');\n }\n return redirect()->back();\n\n }", "public function store(CreateTypeRequest $request)\n {\n $input = $request->all();\n\n $type = $this->typeRepository->create($input);\n\n Flash::success('Type saved successfully.');\n\n return redirect(route('backend.types.index'));\n }", "public function store(Request $request)\n {\n $attributes = $request->all();\n $this->productTypeService->add($attributes);\n\n return redirect()->route('type.create')->with('status', 'Новый тип товаров добавлен!');\n }", "public function store(Request $request)\n {\n //\n $request -> validate([\n 'name' => 'required'\n ]);\n\n Type::create($request->all());\n\n return redirect()->route('type')\n ->with('success','เพิ่มหมวดหมู่อัลบั้มสำเร็จ');\n }", "public function store(IntentTypeRequest $request) {\n $type = $this->service()->repo()->create($request->all());\n return $this->created($type);\n }", "public function store(Request $request)\n {\n $validationData = $request->validate([\n 'name' => 'required|unique:types|min:2',\n ]);\n\n Type::create([\n 'name' => $validationData['name'],\n 'slug' => Str::slug($validationData['name']),\n 'user_id' => Auth::id()\n ]);\n\n return redirect(\"admin/types\")->with(\"{$validationData['name']} type has been created successfully.\");\n }", "public function store(AccountTypeRequest $request)\n {\n $accountType = $this->accountTypeRepository->store();\n if ($accountType) return response()\n ->json(['success' => \"$accountType->name created successfully!\"]);\n }", "public function store() {\n //\n $car = new Car();\n $car->make = Input::get('make');\n $car->model = Input::get('model');\n $car->registration_num = Input::get('registration_num');\n $car->mileage = Input::get('mileage');\n $car->location_id = Input::get('location_id');\n $car->save();\n $car_type = $this->car->find($car->id);\n if (Input::has('type')) {\n foreach (Input::get('type') as $type => $val) {\n $car_type->type()->attach($val);\n }\n }\n return Redirect::route('admin.car.index');\n }", "public function store(Request $request)\n {\n //\n $request['StorageType_Id'] = $request->get('StorageTypes');\n unset($request['StorageTypes']);\n //echo '<pre>';\n //print_r($request->all());\n //echo '</pre>'; exit;\n StorageCategories::create($request->all());\n //return $priceCategories;\n return back();\n }", "public function store()\n {\n $data = request()->validate([\n 'name' => 'required|unique:cards',\n 'health' => ['required', 'integer', new Positive],\n 'damage' => ['required', 'integer', new Positive],\n 'rarity_id' => 'required',\n 'power_id' => 'required',\n 'image' => 'nullable'\n ]);\n\n $card = Card::create($data + ['user_id' => auth()->id()]);\n\n session()->flash('flash', 'The card has been added successfully!');\n\n if (request()->wantsJson()) {\n return response($card, 201);\n }\n\n return redirect(route('admin.cards.index'));\n }", "public function store(Request $request)\n {\n Validator::make($request->all(), [\n 'type' => 'required|unique:unit_types',\n\n ])->validate();\n\n UnitType::create([\n 'type' => $request->type,\n ]);\n\n return redirect()->route('unit_type.index')->with('success', 'Unit Type added!');\n }", "public function store(Request $request)\n {\n $fundTypes = Utils::getMainTypes();\n $request->validate([\n 'name' => 'required|unique:mutual_fund_type,name,NULL,id,is_trashed,NULL',\n 'main_type' => 'required|max:255|in:' . implode(',', array_keys($fundTypes)),\n ]);\n\n $user = MutualFundType::create([\n 'name' => $request['name'],\n 'main_type' => $request['main_type'],\n 'description' => $request['description'],\n 'status' => 1,\n ]);\n\n return redirect()->route('type.show', $user->id)\n ->with('success', 'Type created successfully.');\n }", "public function store(Request $request)\n {\n ComputerType::create($request->except('_token'));\n $message['type'] = 'success';\n $message['status'] = Lang::get('messages.success_computer_type');\n return redirect($this->menu)->with('message',$message);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'type' => 'required',\n ]);\n\n CustomerType::create($request->all());\n Session::flash('success', 'Customer type create successfully');\n return back();\n }", "public function createAction(Request $request)\n {\n $entity = new Cardtype();\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('cardtype_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function store(Request $request)\n {\n $request->validate([\n 'title' => 'required'\n ]);\n\n $input = $request->all();\n Type::create($input);\n\n Session::flash('message', 'You successfully create a type');\n\n return redirect()->route('admin.type.index');\n }", "public function store(CampaignTypeRequest $request)\n {\n $type = CampaignType::create($request->all());\n\n return $this->jsonResponse([\n 'message' => 'Successfully added a campaign type.',\n 'type' => $type,\n ], 201);\n }", "public function store(Request $request)\n {\n $cardId = $request->input('id');\n $card = $request->except('id');\n return response()->json(array('code'=>20000, 'card'=>$card, 'cardId'=>$cardId));\n $user = Helper::getCurrentUserByToken(Helper::getCurrentToken($request));\n $uuid = Str::random(32);\n $card['user_id'] = $user['id'];\n $card['uuid'] = $uuid;\n $handledCard = DB::table('giftcards')->updateOrInsert(['id'=>$cardId], $card);\n // $handledCard = Giftcard::create($card);\n return response()->json(array('code'=>20000, 'card'=>$handledCard));\n }", "public function store(Request $request)\n {\n $type = new TypeQues;\n $type->fill($request->all()); \n $type->save();\n return redirect()->back()->with('notify', 'Successfully');\n }", "public function store(TypeFormRequest $request)\n {\n $types = new Type();\n $types->typename = $request->get('typename');\n $mess = \"\";\n if($types->save())\n {\n $mess = (\"Thêm Thành Công\");\n }\n $types = Type::all();\n \n return view('admin.type', compact('types'))->with(('mess'), $mess);\n }", "public function store(Request $request)\n {\n $productType = ProductType::create($request->all());\n return redirect()->route('admin.product-types.index')->withSuccess('Запись успешно создана');\n }", "public function store(Request $request)\n {\n $typesAssets = new TypesAssets();\n $typesAssets->description = $request->description;\n $typesAssets->accounting_accounts_purchase = $request->accounting_accounts_purchase;\n $typesAssets->accounting_accounts_depreciation = $request->accounting_accounts_depreciation;\n $typesAssets->save();\n\n return redirect(\"/tipos-activos\");\n }", "public function store(AssetTypeFormRequest $request)\n\t{\n\t\t$data = $request->all();\n\t\t$status = 1;\n\n\t\t$assetTypesModel = new AssetTypesModel();\n\t\t$assetType = $assetTypesModel->createAssetType($data);\n\t\tif(empty($assetType)) {\n\t\t\t$status = 0;\n\t\t}\n\t\treturn new JsonResponse(['status' => $status, 'assetType' => $assetType]);\n\t}", "public function store(Request $request, ClassType $classType)\n {\n //\n }", "public function store(Request $request)\n {\n $request->validate([\n 'type_name' => 'required|string',\n ]);\n\n HouseType::create(['type_name' => title_case($request->type_name)]);\n\n alert()->success('A new type was created', 'Successfully');\n\n return redirect()->route('types.index');\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'barcode' => 'required|unique:peripherals',\n 'name' => 'required',\n 'location' => 'required',\n 'type' => 'required'\n ]);\n\n\n if($request->type == 'new'){\n $this->validate($request, [\n 'type_text' => 'required'\n ]);\n\n $type_id = Type::create([\n 'name' => $request->type_text\n ])->id;\n $request->merge([\n 'type_id' => $type_id,\n 'location_id' => $request->location\n ]);\n } else {\n $request->merge([\n 'type_id' => $request->type,\n 'location_id' => $request->location\n ]);\n }\n $request->merge([\n 'user_id' => user()->id\n ]);\n\n Peripheral::create($request->all());\n TmpPeripheral::where('user_id', user()->id)->delete();\n\n flash()->success('Success add peripheral.');\n return redirect()->route('peripheral.index');\n }", "public function store(CardsRequest $request)\n {\n Cards::create($request->all());\n session()->flash('mensagem', 'Atividade cadastrada com sucesso!');\n return redirect()->route('cards.index');\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required',\n ], [\n 'name.required' => 'ชื่อประเภทรถ ห้ามเป็นค่าว่าง',\n ]);\n\n $requestData = $request->all();\n\n StVehicleType::create($requestData);\n\n set_notify('success', 'บันทึกข้อมูลสำเร็จ');\n\n return redirect('setting/st-vehicle-type');\n }", "public function store(FamilyCardRequest $request)\n {\n $this->authorize('family_cards.manage');\n\n $request->merge([\n 'issued_on' => Carbon::parse($request->issued_on)->startOfDay(),\n ]);\n\n $familyCard = FamilyCard::create($request->all());\n $data = collect($request->all());\n\n $this->familyCardService->manageAlteration($data);\n $this->familyCardService->syncPatriarch($data, $familyCard);\n $this->familyCardService->syncMembers($data, $familyCard);\n\n alert()->success(trans('message.ctrl.family_cards.store'))->persistent(\"Close\");\n\n return redirect(route('family_cards.index'));\n }", "public function store(Request $request)\n {\n \n $typeField = new TypeField($request->all());\n $typeField -> save();\n\n return redirect()->route('Admin.TypeField.index');\n }", "public function store(Request $request)\n {\n $validator = request()->validate(\n [\n 'type' => 'required|in:visa,mastercard,cihvisa,cihmastercard',\n 'number' => 'required|numeric|min:0',\n 'expMonth' => 'required|numeric|between:1,12',\n 'expYear' => 'required|numeric|between:2018,2100', // TODO: make this dynamic\n ]);\n\n $creditCard = new CreditCard();\n $creditCard->type = Input::get('type');\n $creditCard->number = Input::get('number');\n $creditCard->expMonth = Input::get('expMonth');\n $creditCard->expYear = Input::get('expYear');\n $creditCard->user_id = Auth::id();\n \n $creditCard->save();\n \n return redirect('/profile');\n }", "public function store(Request $request)\n\t{\n\t\tif(!Auth::user()->hasPermission('createType')){\n\t\t\treturn redirect()->route('admin.getHome')->with('flash_message_error', '403! Không thể Create Type');\n\t\t}\n\t\t//\n\t\t//check null\n\t\tif($request->type_name == ''){\n\t\t\treturn redirect()->back()->withErrors('Chưa nhập tên thể loại')->withInput();\n\t\t}\n\t\t//check existss\n\t\t$check = FilmType::where('type_name', $request->type_name)->get();\n\t\tif(count($check) > 0){\n\t\t\treturn redirect()->back()->withErrors('Thất bại! Tên thể loại đã tồn tại')->withInput();\n\t\t}\n\t\t//\n\t\t$film_process = new FilmProcess();\n\t\t$film_type = new FilmType();\n\t\t$film_type->type_name = $request->type_name;\n\t\t$film_type->type_alias = $film_process->getNameAlias($request->type_name);\n\t\t$film_type->save();\n\t\t//forget cache\n\t\tif(Cache::has('film_type')){\n\t\t\tCache::forget('film_type');\n\t\t}\n\t\treturn redirect()->route('admin.type.index')->with(['flash_message' => 'Thành công! Thêm mới Type name '.$request->type_name]);\n\t}", "public function store(SporttypeRequest $request)\n {\n $sportstype = new Sporttype([\n 'name' => $request->get('name'),\n 'description' => $request->get('description')\n ]);\n $sportstype->save();\n return redirect('sporttypes')->with('message','Saved item !');\n }", "public function store(FeedTypesRequest $request)\n {\n \t\tCache::forget('feed_types');\n \t\t$feed_name = FeedTypes::where('name', '=', $request->name)->first();\n \t\tif ($feed_name === NULL) {\n \t\t // feed name doesn't exist\n \t\t $this->createFeedType($request);\n\n \t\t\tflash()->overlay(\"Feed type has been successfully created!\", \"H&H Farms\");\n\n \t\t\treturn redirect('feedtype');\n \t\t} else{\n\n \t\t\tflash()->overlay(\"Feed type has same name.\", \"H&H Farms\");\n \t\t\treturn redirect('feedtype/create');\n \t\t}\n\n }", "public function store(TypesRequest $request) {\n try {\n if ($request->ajax()) {\n $count_types = Types::where('name', $request['name'])->where('status', '1')->count();\n if ($count_types == 0) {\n $types = Types::orderBy('position', 'asc')->offset(0)->limit(100)->get();\n foreach ($types as $rs):\n $position = $rs->position + 1;\n $type = Types::find($rs->id);\n $type->fill([\n 'position' => $position,\n ]);\n $type->save();\n endforeach;\n \n $type=Types::create([\n 'position' => '0',\n 'name' => $request['name'],\n 'url' => $request['name'],\n 'name_en' => $request['name_en'],\n 'url_en' => $request['name_en'],\n 'status' => '1'\n ]);\n\n $this->audit('Registro de tipos de propiedad #' . $type->id);\n }\n return response()->json([\"msg\" => \"created\"]);\n }\n } catch (Exception $ex) {\n return false;\n }\n return false;\n }", "public function store(CreateRoadCardRequest $request)\n\t{\n $data = $request->all();\n unset($data['translations']);\n\t\t$roadcard = RoadCard::create($data);\n\n $this->createRoadCardTranslations($request, $roadcard);\n\n\t\treturn redirect()->route(config('quickadmin.route').'.roadcard.index');\n\t}", "public function store(Request $request)\n {\n DB::table('unit_types')->insert(['name' => $request->name, 'status' => 1]);\n return redirect(route('unit-type.index'));\n //\n }", "public function store(Request $request, FormType $form_type)\n {\n $form_type = $form_type->create($request->all());\n\n return redirect()->route('admin.form-type.index')->with('success', 'Form Type created');\n }", "public function store(StoreIncomeTypeRequest $request)\n {\n $this->incomeTypes->create($request->all());\n return redirect()->route('admin.configuration.incomeTypes.index')->withFlashSuccess(trans('alerts.backend.generals.created'));\n }", "public function store()\n\t{\n\t\t$depositType = DepositType::create(Input::all());\n\t\treturn Response::json($depositType);\n\t}", "public function store(Request $request)\n {\n $data = $this->validate(\\request(),\n [\n 'marka_type_id' => 'required',\n 'year' => 'required|numeric',\n ]);\n TypeModel::create($data);\n session()->flash('success', trans('messages.added_s'));\n return redirect( route('models.show',$request->marka_type_id));\n }", "public function store(StorageTypeRequest $request)\n {\n try {\n $this->service->addStorageType($request);\n return $this->Created('Successfully added new storage type');\n } catch (\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch (Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function store(ContactTypeRequest $request)\n {\n\n $contact = ContactMsgType::create($request->all());\n \n toast(__('back.ContactMsgType Added successfully'),'success');\n return redirect(route('system.contacttypes.index'));\n }", "public function store(CreateSpecification_typeRequest $request)\n {\n $input = $request->all();\n\n $specificationType = $this->specificationTypeRepository->create($input);\n\n Flash::success('Specification Type saved successfully.');\n\n return redirect(route('specificationTypes.index'));\n }", "public function store(Request $request)\n {\n\n if ($request->id == \"\") {\n $contactType = new ContactType;\n $contactType->clinic_id = $this->clinic_id;\n $contactTypeId = 'null';\n } else {\n $contactType = ContactType::find($request->id);\n $contactTypeId = $contactType->id;\n }\n\n $this->validate($request, [\n 'name' => 'required|unique:contact_types,name,' . $contactTypeId .\n ',id,is_billing,false,clinic_id,' . $this->clinic_id,\n ]);\n\n $contactType->name = $request->name;\n $contactType->save();\n\n return back();\n }", "public function store(Request $request)\n {\n $types = DeathType::create([\n 'name' => $request->get('name')\n ]);\n\n return redirect()->back();\n }", "public function store()\n {\n\n try {\n\n $storeRequest = new OrderTypeStoreRequest();\n $validator = Validator::make(request()->all(), $storeRequest->rules());\n\n if ($validator->fails()) {\n\n return $this->sendBadRequest('Validation Error.', $validator->errors()->toArray());\n }\n\n $item = $this->orderTypeService->create(request()->all());\n\n return $this->sendResponse($item->toArray());\n\n } catch (Exception $exception) {\n\n return $this->sendError('Server Error.', $exception);\n\n }\n }", "public function store(Request $request)\n {\n\n $card = $request -> all();\n Card::create($card);\n\n return redirect() -> action('CardController@indexEx');\n }", "public function store(UserTypeRequest $request)\n {\n $result = UserType::create($request->all());\n if ($result){\n return redirect('user-type')->with('success', 'User Type Added');\n }\n else{\n return back()->with('error','Failed to save!');\n }\n }", "public function store(Request $request)\n {\n $this->validate($request, \n [\n 'name' => 'required|max:50'\n ]);\n \n\n $usertype = new Usertype;\n $usertype->name = $request->name;\n $usertype->save();\n Session::flash('success', 'The record was successfully saved.');\n return redirect()->route('usertypes.index');\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|unique:type_beers|max:255'\n ],\n $this->messages);\n\n if ($validator->fails()) {\n return redirect(route('beer.types.create'))\n ->withErrors($validator)\n ->withInput();\n }\n\n TypeBeer::create($request->all());\n return redirect()->route('beer.types.index')->with('status', 'Тип пива добавлен!');\n }", "public function store()\n {\n $this->validate(request(), [\n 'code' => ['required', 'unique:attributes,code,NULL,NULL,entity_type,' . request('entity_type'), new Code],\n 'name' => 'required',\n 'type' => 'required',\n ]);\n\n Event::dispatch('settings.attribute.create.before');\n\n request()->request->add(['quick_add' => 1]);\n\n $attribute = $this->attributeRepository->create(request()->all());\n\n Event::dispatch('settings.attribute.create.after', $attribute);\n\n session()->flash('success', trans('admin::app.settings.attributes.create-success'));\n\n return redirect()->route('admin.settings.attributes.index');\n }", "public function store(AuditTypeRequest $request)\n\t{\n\t\t$auditType = new AuditType;\n $auditType->name = $request->name;\n $auditType->description = $request->description;\n $auditType->user_id = Auth::user()->id;\n\t}", "public function store(StoreOperationTypesRequest $request)\n {\n if (! Gate::allows('operation_type_create')) {\n return abort(401);\n }\n $operation_type = OperationType::create($request->all());\n\n\n\n return redirect()->route('admin.operation_types.index');\n }", "public function store(Request $request)\n {\n $rules = ['type_name' => 'required'];\n\n $messages = [\n 'type_name.required' => 'Type name is required!',\n ];\n\n $validator = Validator::make($request->all(), $rules, $messages);\n\n if ($validator->fails()) {\n \n return redirect()->back()->withErrors($validator)->withInput();\n \n }\n\n $report_type = new ReportType;\n\n $report_type->name = $request->type_name;\n $report_type->description = $request->description;\n\n $report_type->save();\n \n $request->session()->flash('success', 'Add Report type successful.');\n \n return redirect()->back()->withInput();\n }", "public function store(Request $request)\n {\n $date = $request->validate([\n 'name' => ['required', 'string', 'max:255']\n ]);\n Item_Type::create($date);\n return redirect()->route('item_type.index');\n }", "public function store(RoomTypesRequest $request)\n {\n RoomTypes::create($request->all());\n return redirect()->route('room-types.index')\n ->with('success', '¡Categoría creada correctamente!');\n }", "public function store(Request $request)\n {\n $data = $request->validate([\n 'manufacturer' => 'required|min:2',\n 'model' => 'required|min:2',\n 'stock_type' => ['required', Rule::in(ItemStockType::getValues())],\n ]);\n\n $type = ItemType::create($data);\n\n $type->loadMissing('stockBalances.location', 'instances.location');\n return response($type);\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$validation = Validator::make($input, Etype::$rules);\n\n\t\tif ($validation->passes())\n\t\t{\n\t\t\t$etype = new Etype();\n\t\t\t$etype->name = Input::get('name');\n\t\t\t$etype->type = Input::get('name');\n\t\t\t$etype->save();\n\n\t\t\tFlash::success('Expense type created');\n\t\t\treturn Redirect::route('etypes.index');\n\t\t}\n\t\tFlash::error('There were validation errors');\n\t\treturn Redirect::route('etypes.create')\n\t\t\t->withInput()\n\t\t\t->withErrors($validation);\n\n\t}", "public function store(Request $request)\n {\n\n $producttypes = new Producttypes;\n\n $producttypes->title = $request->title;\n $producttypes->description = $request->description;\n $producttypes->image = $request->image;\n $producttypes->category_id = $request->category_id;\n $producttypes->status = $request->status;\n $producttypes->slug = str_slug($request->title);\n $producttypes->save();\n\n return Fractal::item($producttypes, new ProducttypesTransformer);\n\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'type'=>'required' \n ]);\n\n //add to database\n $type =new Category;\n $type->name = $request->input('type');\n\n $type->save();\n \n Session::flash('success','Incident type added successfully');\n\n return redirect('/pages')->with('success');\n }", "public function store(Request $request)\n {\n $type=new Trucktype();\n $type->trucktype=$request->trucktype;\n $type->avg_criteria=$request->avg_criteria;\n // $type->ipaddress=$request->getClientIp();\n // $type->createdby=auth()->user()->id;\n\n $type->save();\n return redirect()->back()->with('message','Truck Type Add Successfully.');\n }", "public function saveType()\n {\n }", "public function store(Request $request)\n {\n $request->validate(\n [\n 'owner' => '',\n 'holder_name' => '',\n 'account_number' => 'required|max:16',\n 'iban' => '',\n 'cvv' => 'required|numeric',\n 'balance' => '',\n 'exp_month' => 'required',\n 'exp_year' => 'required',\n 'bank_name' => ''\n ]\n );\n\n $card = Card::create([\n 'owner' => Auth::id(),\n 'holder_name' => '',\n 'account_number' => str_replace(' ', '', $request->account_number),\n 'iban' => '',\n 'cvv' => $request->cvv,\n 'balance' => random_int(1, 10000),\n 'expiration' => $request->exp_month . ' / ' . $request->exp_year,\n 'bank_name' => ''\n ]);\n\n return redirect()->route('home');\n }", "public function store(CreateActivityTypeRequest $request)\n {\n $input = $request->all();\n $input['created_by'] = getLoggedInUserId();\n\n $this->activityTypeRepository->create($input);\n\n return $this->sendSuccess('Activity Type created successfully.');\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'type' => 'required|string|max:255'\n ]);\n // $model = Type_cars::create([\n // 'type' => $request['type']\n // ]);\n $model = new Type_cars();\n $model->type = $request['type'];\n $model->save();\n return $model;\n }", "public function store(Request $request)\n {\n DeviceTypesAlias::create($request->all());\n return response()->json(null, 200);\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Gametype::$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\tGametype::create($data);\n\n\t\treturn Redirect::route('gametypes.index');\n\t}", "public function store(Request $request)\n {\n if (!Auth::check() || !Auth::user()->hasRole('admin')) {\n return redirect()->back();\n }\n\n\n $input = $request->all();\n\n $validator = Validator::make($request->all(), [\n 'label' => 'string|min:3',\n 'description' => 'string|nullable'\n ]);\n\n // validate inputs\n if ($validator->fails()) {\n Session::flash('error', 'Kindly check your inputs and try again!');\n return redirect()->back()\n ->withErrors($validator->errors())\n ->withInput($request->all());\n } else {\n try {\n\n // store\n $input['name'] = isset($input['label']) ? Str::slug(Str::lower($input['label'])) : '';\n $media_type = MediaType::create($input);\n\n // redirect\n toast('success', 'Process Successful!');\n return redirect()->view('pages.media_type.index');\n } catch (\\Throwable $th) {\n Session::flash('error', 'Process failed!');\n return back()->withErrors($th->getMessage());\n }\n }\n }", "public function store(Request $request)\n {\n $create = ProductType::create($request->all());\n if($create)\n return redirect()->back()->with('success', 'Saved');\n return redirect()->back()->with('failed', 'Failed in saving data');\n }", "public function store(Request $request)\n\t{\n\t\t//dd($request);\n\t\t\n\t\t$image_name = $request->image->getClientOriginalName();\n\t\t$destination_path = public_path('/uploads');\t\t\n\t\t$image_path = \"/uploads/\" . $image_name;\t\t\n\t\t$request->image->move($destination_path, $image_name);\n\t\t\n\t\tAwardType::create([\n\t\t\t'name' => $request->name,\n\t\t\t'image' => $image_path,\n\t\t]);\n\t\t\n\t\treturn redirect('admin/awardtypes');\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n ]);\n\n Companytype::create($request->all());\n\n return redirect()->route('companytypes.index');\n }", "public function store(Request $request, Type $type)\n {\n $request = $request->all()['PropertyTypes'];\n \n if($type->create($request))\n {\n return response()->json(['success'=>'Property type created successfuly']);\n }\n else\n {\n return response()->json(['error'=>'Property type creation failed']);\n }\n }", "public function store(CreateEconomicalActivityTypeRequest $request)\n {\n $input = $request->all();\n\n $economicalActivityType = new EconomicalActivityType($input['names'], $input['internalCode']);\n\n $parentId = $request->get('parent');\n if (!empty($parentId)) {\n $parent = $this->economicalActivityTypeRepository->find($parentId);\n $economicalActivityType->setParent($parent);\n }\n /**\n * @var $dm DocumentManager\n */\n $dm = App::make(DocumentManager::class);\n $dm->persist($economicalActivityType);\n $dm->flush();\n\n Flash::success('Economical Activity Type saved successfully.');\n\n return redirect(route('economicalActivityTypes.index'));\n }", "public function store(Request $request)\n {\n //\n /*print_r($_POST);\n\n foreach ($request->get('types_id') as $type){\n echo \"<br>this type: \" . $type;\n }\n exit;*/\n $object = new ObjectProduct;\n\n $object->object_name = $request->get('object_name');\n $object->cost = $request->get('cost');\n $object->price = $request->get('price');\n $object->brands_id = $request->get('brands');\n $object->types_id = $request->get('types');\n $object->save();\n\n return redirect('/backend/objects');\n }", "public function store(Request $request)\n {\n $data = $request->validate([\n 'abbreviation' => 'string|required|unique:\\Modules\\ForestResources\\Entities\\PermitType,Abbreviation',\n 'name' => 'string'\n ]);\n\n PermitType::create([\n 'Abbreviation' => $data['abbreviation'],\n 'Name' => $data['name'] ?? null,\n 'User' => $this->JwtPayload('data.id')\n ]);\n\n return response()->json([\n 'message' => lang('created_successfully')\n ], 201);\n }", "public function store(Request $request)\n {\n $this->validate($request,['nametype'=>'required']);\n $posttype = new PostType(['nametype'=> $request->get('nametype'),'idparent' => $request->get('sel_idcategory')]);\n $posttype->save();\n return redirect()->route('admin.posttype.index')->with('success','data added');\n }", "public function store()\n\t{\n\t\t$exam_type = ExamType::create(Input::all());\n\t\treturn Response::json($exam_type);\n\t}", "public function store(Request $request)\n {\n $runType = request()->validate([\n 'name' => 'required|string|min:3',\n 'description' => 'required|string|min:5',\n ]);\n\n $runType = RunType::create($runType);\n\n return response()->json($runType, 201);\n }", "public function store(Request $request)\n {\n $request->validate([\n 'title'=>'required',\n 'description'=>'required',\n ]);\n\n $card = new Card([\n 'title' => $request->get('title'),\n 'description' => $request->get('description')\n ]);\n $card->save();\n }", "public function store(Request $request) {\n// echo json_encode($request->input());\n// exit();\n\n\n $this->validate($request, [\n 'category' => 'required|max:255|unique:tbl_file_category'\n ]);\n\n\n $formdata = array(\n 'category' => $request->input('category'),\n );\n\n $types = Tbl_file_category::create($formdata);\n if ($types->fc_id > 0) {\n return redirect('admin/filecategory')->with('success', 'Created Successfully...!');\n } else {\n return redirect('admin/filecategory')->with('error', 'Error occurred. Please try again...!');\n }\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$validation = Validator::make($input, ProductType::$rules);\n\n\t\tif ($validation->passes())\n\t\t{\n\t\t\t$this->product_type->create($input);\n\n\t\t\treturn Redirect::route('product_types.index');\n\t\t}\n\n\t\treturn Redirect::route('product_types.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(Request $request)\n {\n $post = new Type();\n $post->description = $request->description;\n $post->save();\n\n return Redirect::back()->with('msg', 'The Message');\n }", "public function store(Request $request)\n {\n $validation = $request->validate([\n \"name\" => \"required|min:2|max:50\",\n \"pokemon_id\" => \"max:10\"\n ]);\n $newEntry = new Type;\n $newEntry->name = $request->name;\n $newEntry->pokemon_id = $request->pokemon_id;\n $newEntry->save();\n return redirect(\"/\");\n }", "public function store(Request $request)\n {\n\n $json = json_encode($request->input('tipo'), true);\n $actividad = new actividad($request-> all());\n $actividad->tipo=$json;\n $actividad->save();\n \\Alert::success('', 'El actividad ha sido registrado con exito !')->persistent('Close');\n return redirect()->route('actividad.index');\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(), ['name' => 'required']);\n $validator->validate();\n\n DeviceType::create($request->all());\n\n return redirect()->route('admin.index');\n }" ]
[ "0.7074834", "0.6789455", "0.669491", "0.6688449", "0.6678124", "0.6568245", "0.655998", "0.6557673", "0.6553704", "0.6515364", "0.6511342", "0.65005344", "0.64749616", "0.6472927", "0.6472759", "0.64597344", "0.6441618", "0.6421215", "0.64115596", "0.6400473", "0.639833", "0.63934046", "0.6392281", "0.638169", "0.63519305", "0.6309242", "0.62608206", "0.62264585", "0.6207471", "0.62036324", "0.619594", "0.618441", "0.61842704", "0.6180572", "0.6179161", "0.6174655", "0.6165446", "0.6164693", "0.6151968", "0.6127788", "0.61218137", "0.61149955", "0.611005", "0.6097539", "0.6090375", "0.60898787", "0.6077122", "0.6076204", "0.6065172", "0.6059765", "0.605672", "0.603913", "0.6037675", "0.6036019", "0.6013137", "0.60009485", "0.5986113", "0.5981614", "0.59724116", "0.59709185", "0.5970335", "0.5968444", "0.5962983", "0.5955156", "0.5950657", "0.5949003", "0.5941048", "0.5934286", "0.59338725", "0.59324783", "0.5930171", "0.59300584", "0.59288037", "0.59260064", "0.5922777", "0.59156454", "0.5913351", "0.59085375", "0.5904213", "0.58915055", "0.5870834", "0.58620125", "0.5847173", "0.5847039", "0.58192104", "0.5816703", "0.58123076", "0.57916355", "0.57881767", "0.5786096", "0.57850134", "0.5782318", "0.5775222", "0.5770787", "0.57686543", "0.5759457", "0.5755745", "0.57540804", "0.5752325", "0.5743964" ]
0.73187214
0
Stock Report by date
public function stock_report_bydate($product_id) { $this->db->select(" SUM(d.quantity) as 'totalSalesQnty', SUM(b.quantity) as 'totalPurchaseQnty', (sum(b.quantity) - sum(d.quantity)) as stock "); $this->db->from('product_information a'); $this->db->join('product_purchase_details b','b.product_id = a.product_id','left'); $this->db->join('invoice_details d','d.product_id = a.product_id','left'); $this->db->join('product_purchase e','e.purchase_id = b.purchase_id','left'); $this->db->group_by('a.product_id'); $this->db->order_by('a.product_name','asc'); if(empty($product_id)) { $this->db->where(array('a.status'=>1)); } else { //Single product information $this->db->where('a.product_id',$product_id); } $query = $this->db->get(); return $query->row(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function stock_report_bydate($product_id,$date,$limit,$page)\n\t{\t\n\n\t\t$this->db->select(\"a.product_name,a.product_id,a.price,a.product_model,sum(b.sell) as 'totalSalesQnty',sum(b.Purchase) as 'totalPurchaseQnty'\");\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('stock_history b','b.product_id = a.product_id');\n\t\tif(empty($product_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1,'b.vdate <= ' => $date));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Single product information \n\t\t\t$this->db->where(array('a.status'=>1,'b.vdate <= ' => $date,'a.product_id'=>$product_id));\t\n\t\t}\n\t\t\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_id','desc');\n\t\t$this->db->limit($limit, $page);\n\t\t$query = $this->db->get();\n\n\t\t//$this->db->last_query(); //Testing purpose\n\t\treturn $query->result_array();\n\t}", "public function stock_report_bydate_pos($product_id)\n\t{\n\t\t$purchase = $this->db->select(\"SUM(quantity) as totalPurchaseQnty\")\n\t\t\t\t\t\t\t->from('product_purchase_details')\n\t\t\t\t\t\t\t->where('product_id',$product_id)\n\t\t\t\t\t\t\t->get()\n\t\t\t\t\t\t\t->row();\n\n\t\t$sales = $this->db->select(\"SUM(quantity) as totalSalesQnty\")\n\t\t\t\t\t\t->from('invoice_details')\n\t\t\t\t\t\t->where('product_id',$product_id)\n\t\t\t\t\t\t->get()\n\t\t\t\t\t\t->row();\n\n\t\treturn $stock = $purchase->totalPurchaseQnty - $sales->totalSalesQnty;\n\t}", "public function stock_report_bydate($product_id,$date,$limit,$page)\n\t{\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(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\tf.unit_name\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($product_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}\n\t\telse{\n\t\t\t//Single product information \n\t\t\t$this->db->where(array('a.status'=>1,'e.purchase_date <= ' => $date,'a.product_id'=>$product_id));\t\n\t\t}\n\n\t\t$this->db->limit($limit, $page);\n\t\t$query = $this->db->get();\n\n\t\treturn $query->result_array();\n\t}", "public function getStockGoods()\n {\n $reportStock = new ReportStock();\n return Collection::times(10)->map(function ($value) use ($reportStock) {\n $stock = $reportStock->getStockGoods(new Request([\n 'stock_date' => $date = Carbon::now()->subWeeks($value - 1)\n ]));\n\n return collect([\n 'date' => $date->toDateString(),\n 'stocks' => $stock->count()\n ]);\n });\n }", "public function getStock();", "public function stock_report_supplier_bydate($product_id,$supplier_id,$date,$perpage,$page){\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(b.quantity) as 'totalPrhcsCtn',\n\t\t\t\te.purchase_date as purchase_date,\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($supplier_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}else\n\t\t{\n\t\t\t$this->db->where('a.status',1);\n\t\t\t$this->db->where('e.purchase_date <=' ,$date);\n\t\t\t$this->db->where('a.supplier_id',$supplier_id);\t\n\t\t}\n\t\t$this->db->limit($perpage,$page);\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public static function stockReport()\n {\n $rawData = DB::table('rewards')\n ->selectRaw('COUNT(*) count, reward_providers.name, SUM(value) total_value, value')\n ->leftJoin('reward_providers', 'rewards.reward_provider_id', '=', 'reward_providers.id')\n ->whereNull('complaint_id')\n ->groupBy('reward_provider_id', 'value')\n ->get();\n\n return static::formatStockReportForTable($rawData);\n }", "public function stock_report_product_bydate($product_id,$supplier_id,$from_date,$to_date,$per_page,$page){\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(b.quantity) as 'totalPurchaseQnty',\n\t\t\t\te.purchase_date as date\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\t\t$this->db->limit($per_page,$page);\n\n\t\tif(empty($supplier_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}else{\n\t\t\t$this->db->where(\n\t\t\t\tarray(\n\t\t\t\t\t'a.status'=>1,\n\t\t\t\t\t'a.supplier_id'\t=>\t$supplier_id,\n\t\t\t\t\t'a.product_id'\t=>\t$product_id\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t$this->db->where('e.purchase_date >=', $from_date);\n\t\t\t$this->db->where('e.purchase_date <=', $to_date);\n\t\t}\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "function wc_marketplace_date() {\n global $wmp;\n $wmp->output_report_date();\n }", "public function getStockItem()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Stock Items (Linnworks API)');\n\t\t}", "private function trackerGrid() {\n\t\t\t\t\n\t\t$latestDays = filters\\timeFilter::getPeriodWithinRange(0, filters\\timeFilter::$daysTimeframe, $this->settingVars);\n\t\t\t\t\n\t\t$arr \t\t= array();\n\t\t$arrChart \t= array();\n\t\t$cols \t\t= array();\n\t\t\n\t\tif(isset($_REQUEST['PROMOTION']))\n\t\t{\n\t\t\tif($_REQUEST['PROMOTION'] == 'YES')\n\t\t\t{\n\t\t\t\t// filters\\timeFilter::prepareTyLyMydateRange($this->settingVars); //Total Weeks\n\t\t\t\t\n\t\t\t\t$qPart = '';\n\t\t\t\tif (isset($_REQUEST[\"FS\"]) && $_REQUEST[\"FS\"] != ''){\n\t\t\t\t\t$storeStock \t= $this->settingVars->dataArray['F18']['NAME'];\n\t\t\t\t\t$availInst \t\t= $this->settingVars->dataArray['F15']['NAME'];\n\t\t\t\t\t$depotService\t= $this->settingVars->dataArray['F14']['NAME'];\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$latestDay = filters\\timeFilter::getPeriodWithinRange(0, 1, $this->settingVars);\n\t\t\t\t\t\n\t\t\t\t\t//MAIN TABLE QUERY\t\t\t\n\t\t\t\t\t$query = \"SELECT \".$this->settingVars->maintable.\".skuID AS SKUID \" .\n\t\t\t\t\t\t\t\t\",sku AS SKU \" .\n\t\t\t\t\t\t\t\t\",\".$this->settingVars->dateField.\" AS MYDATES \" .\n\t\t\t\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectValue.\") AS SALES\" .\n\t\t\t\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectVolume.\") AS QTY\" .\n\t\t\t\t\t\t\t\t\",SUM($storeStock) AS STORESTOCK\".\n\t\t\t\t\t\t\t\t\",AVG($availInst) AS STOREINSTOCK\".\n\t\t\t\t\t\t\t\t\",AVG($depotService) AS DEPOTSERVICE\".\n\t\t\t\t\t\t\t\t\" FROM \" . $this->settingVars->tablename . $this->queryPart .\n\t\t\t\t\t\t\t\t\" AND (\" . filters\\timeFilter::$tyWeekRange . \" OR \" . filters\\timeFilter::$lyWeekRange . \") GROUP BY SKUID, SKU, MYDATES ORDER BY MYDATES ASC, SALES DESC\";\n\t\t\t\t\t//echo $query;exit;\n\t\t\t\t\t$result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\n\t\t\t\t\t\n\t\t\t\t\t$temp1\t= array();\n\t\t\t\t\t$temp2\t= array();\n\t\t\t\t\t$temp3\t= array();\n\t\t\t\t\t$temp4\t= array();\n\t\t\t\t\t$temp5\t= array();\n\t\t\t\t\t$latestDays = array_reverse($latestDays);\n\t\t\t\t\tforeach($latestDays as $lw)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif($key == 0)\n\t\t\t\t\t\t\t$cols[] \t= array('data'=>'L_'.str_replace(\"-\",\"\",$lw),'label'=>date(\"jS M Y\",strtotime($lw)));\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif (is_array($result) && !empty($result)) {\n\t\t\t\t\t\t\t$searchKey = array_search($lw,array_column($result,\"MYDATES\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($searchKey)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$value = $result[$searchKey];\n\t\t\t\t\t\t\t$temp1[\"L_\".str_replace(\"-\",\"\",$lw)]\t= (int)$value['SALES'];\n\t\t\t\t\t\t\t$temp2[\"L_\".str_replace(\"-\",\"\",$lw)]\t= (int)$value['QTY'];\n\t\t\t\t\t\t\t$temp3[\"L_\".str_replace(\"-\",\"\",$lw)]\t= (int)$value['STORESTOCK'];\n\t\t\t\t\t\t\t$account = $lw;\n\t\t\t\t\t\t\tif (in_array($account, filters\\timeFilter::$tyDaysRange)) { //$numberFrom AND $numberTo COMES HANDY HERE\n\t\t\t\t\t\t\t\t$temp4[\"L_\".str_replace(\"-\",\"\",$lw)] \t= number_format($value['STOREINSTOCK'],1, '.', '');\n\t\t\t\t\t\t\t\t$temp5[\"L_\".str_replace(\"-\",\"\",$lw)]\t= number_format($value['DEPOTSERVICE'],1, '.', '');\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$temp = array();\n\t\t\t\t\t\t\t$temp['MYDATE'] = $lw;\n\t\t\t\t\t\t\t$temp['QTY'] = (int)$value['QTY'];\n\t\t\t\t\t\t\t$temp['STORESTOCK'] = (int)$value['STORESTOCK'];\n\t\t\t\t\t\t\t$temp['STOREINSTOCK'] = number_format($value['STOREINSTOCK'],1, '.', '');\n\t\t\t\t\t\t\t$temp['DEPOTSERVICE'] = number_format($value['DEPOTSERVICE'],1, '.', '');\n\t\t\t\t\t\t\t$arrChart[] = $temp;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp1[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp2[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp3[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp4[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp5[\"L_\".str_replace(\"-\",\"\",$lw)] = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$temp = array();\n\t\t\t\t\t\t\t$temp['MYDATE'] = $lw;\n\t\t\t\t\t\t\t$temp['QTY'] = $temp['STORESTOCK'] = $temp['STOREINSTOCK'] = $temp['DEPOTSERVICE'] = 0;\n\t\t\t\t\t\t\t$arrChart[] = $temp;\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$temp1['label'] = \"SALES \".$this->settingVars->currencySign;\n\t\t\t\t\t$temp2['label'] = \"QTY\";\n\t\t\t\t\t$temp3['label'] = \"STORE STOCK\";\n\t\t\t\t\t$temp4['label'] = \"STORE INSTOCK %\";\n\t\t\t\t\t$temp5['label'] = \"DEPOT SERVICE %\";\n\t\t\t\t\t\n\t\t\t\t\t$arr[0]\t= $temp1;\t\t\t\t\n\t\t\t\t\t$arr[1]\t= $temp2;\t\t\t\t\n\t\t\t\t\t$arr[2]\t= $temp3;\t\t\t\t\n\t\t\t\t\t$arr[3]\t= $temp4;\t\t\t\t\n\t\t\t\t\t$arr[4]\t= $temp5;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfilters\\timeFilter::fetchPeriodWithinRange(0, filters\\timeFilter::$daysTimeframe, $this->settingVars); //To get $mydateRange\n\t\t\t\t\n\t\t\t\t$act = $_REQUEST['ACCOUNT'];\n\t\t\t\t$account = $this->settingVars->dataArray[$act]['NAME'];\n\t\t\t\t\n\t\t\t\t//asort($latestDays);\n\t\t\t\t\n\t\t\t\t$getLdates = array();\n\t\t\t\tforeach($latestDays as $date)\n\t\t\t\t{\t\t\t\n\t\t\t\t\t$getLdates[] = \"MAX((CASE WHEN \" . $this->settingVars->period . \"='\".$date.\"' THEN 1 ELSE 0 END)*$account) AS DATE\".str_replace(\"-\",\"\",$date);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$qPart = implode(\",\",$getLdates);\n\t\t\t\t\n\t\t\t\t//MAIN TABLE QUERY\n\t\t\t\t$query = \"SELECT \".$this->settingVars->maintable.\".skuID AS SKUID \" .\n\t\t\t\t\t\",sku AS SKU \" .\n\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectValue.\") AS SALES\" .\n\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectVolume.\") AS QTY,\" .\n\t\t\t\t\t$qPart.\n\t\t\t\t\t\" FROM \" . $this->settingVars->tablename . $this->queryPart .\n\t\t\t\t\t\" AND \" . filters\\timeFilter::$mydateRange . \" GROUP BY SKUID, SKU ORDER BY SALES DESC\";\n\t\t\t\t$result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\n\t\t\t\t\n\t\t\t\tif (is_array($result) && !empty($result)) {\n\t\t\t\t\tforeach ($result as $key => $value) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$temp \t\t\t\t= array();\n\t\t\t\t\t\t$temp['SKUID'] \t\t= $value['SKUID'];\n\t\t\t\t\t\t$temp['SKU'] \t\t= $value['SKU'];\n\t\t\t\t\t\t$temp['SALES'] \t\t= number_format($value['SALES'], 1, '.', '');\n\t\t\t\t\t\t$temp['QTY'] \t\t= number_format($value['QTY'], 1, '.', '');\n\t\t\t\t\t\tforeach($latestDays as $lw)\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($key == 0)\n\t\t\t\t\t\t\t\t$cols[] \t= array('data'=>'Tracker_L'.str_replace(\"-\",\"\",$lw),'label'=>date(\"jS M Y\",strtotime($lw)));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$temp['Tracker_L'.str_replace(\"-\",\"\",$lw)] \t= number_format($value['DATE'.str_replace(\"-\",\"\",$lw)], 1, '.', '');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$arr[] \t\t\t\t= $temp;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n $this->jsonOutput['TrackerGrid'] \t= $arr;\n $this->jsonOutput['TrackerChart'] \t= $arrChart;\n $this->jsonOutput['Tracker_L'] \t\t= $cols;\n }", "public function show_sales_review_date()\n {\n $query = $this->db->query(\"SELECT `date`,`product_id`,`type`,`weight`, SUM(`amount`) as amoun,SUM(`price`) as price FROM `sales` WHERE DATE(`date`)=CURDATE() GROUP BY `product_id`\");\n return $query->result();\n }", "function ppt_resources_get_usd_stocks($data)\n{\n// return $data;\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n//return entity_metadata_wrapper('field_collection_item', 18045);\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $reports = sum_records_per_field($entries_records, 'field_product', TRUE);\n return $reports;\n}", "function dailySales($year,$month){\n global $db;\n $sql = \"SELECT s.qty,\";\n $sql .= \" DATE_FORMAT(s.date, '%Y-%m-%e') AS date,p.name,\";\n $sql .= \"SUM(p.sale_price * s.qty) AS total_saleing_price\";\n $sql .= \" FROM sales s\";\n $sql .= \" LEFT JOIN products p ON s.product_id = p.id\";\n $sql .= \" WHERE DATE_FORMAT(s.date, '%Y-%m' ) = '{$year}-{$month}'\";\n $sql .= \" GROUP BY DATE_FORMAT( s.date, '%e' ),s.product_id\";\n return find_by_sql($sql);\n}", "public function retrieve_product_sales_report()\n\t{\n\t\t$today = date('Y-m-d');\n\t\t$this->db->select(\"a.*,b.product_name,b.product_model,c.date,c.total_amount,d.customer_name\");\n\t\t$this->db->from('invoice_details a');\n\t\t$this->db->join('product_information b','b.product_id = a.product_id');\n\t\t$this->db->join('invoice c','c.invoice_id = a.invoice_id');\n\t\t$this->db->join('customer_information d','d.customer_id = c.customer_id');\n\t\t$this->db->where('c.date',$today);\n\t\t$this->db->order_by('c.date','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "public function addData()\r\n {\r\n\r\n $this->datecreated = time();\r\n $sql = 'INSERT INTO ' . TABLE_PREFIX . 'stat_productstock (\r\n p_barcode,\r\n sd_value,\r\n sd_month,\r\n sd_year,\r\n day_1,\r\n day_2,\r\n day_3,\r\n day_4,\r\n day_5,\r\n day_6,\r\n day_7,\r\n day_8,\r\n day_9,\r\n day_10,\r\n day_11,\r\n day_12,\r\n day_13,\r\n day_14,\r\n day_15,\r\n day_16,\r\n day_17,\r\n day_18,\r\n day_19,\r\n day_20,\r\n day_21,\r\n day_22,\r\n day_23,\r\n day_24,\r\n day_25,\r\n day_26,\r\n day_27,\r\n day_28,\r\n day_29,\r\n day_30,\r\n day_31,\r\n sd_datecreated,\r\n sd_datemodified\r\n )\r\n VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';\r\n $rowCount = $this->db3->query($sql, array(\r\n (string)$this->pbarcode,\r\n (string)$this->value,\r\n (int)$this->month,\r\n (int)$this->year,\r\n (string)$this->day_1,\r\n (string)$this->day_2,\r\n (string)$this->day_3,\r\n (string)$this->day_4,\r\n (string)$this->day_5,\r\n (string)$this->day_6,\r\n (string)$this->day_7,\r\n (string)$this->day_8,\r\n (string)$this->day_9,\r\n (string)$this->day_10,\r\n (string)$this->day_11,\r\n (string)$this->day_12,\r\n (string)$this->day_13,\r\n (string)$this->day_14,\r\n (string)$this->day_15,\r\n (string)$this->day_16,\r\n (string)$this->day_17,\r\n (string)$this->day_18,\r\n (string)$this->day_19,\r\n (string)$this->day_20,\r\n (string)$this->day_21,\r\n (string)$this->day_22,\r\n (string)$this->day_23,\r\n (string)$this->day_24,\r\n (string)$this->day_25,\r\n (string)$this->day_26,\r\n (string)$this->day_27,\r\n (string)$this->day_28,\r\n (string)$this->day_29,\r\n (string)$this->day_30,\r\n (string)$this->day_31,\r\n (int)$this->datecreated,\r\n (int)$this->datemodified\r\n ))->rowCount();\r\n\r\n $this->id = $this->db3->lastInsertId();\r\n return $this->id;\r\n }", "protected function getDailySummary()\n {\n $strBuffer = '\n<fieldset class=\"tl_tbox\">\n<legend style=\"cursor: default;\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['24h_summary'] . '</legend>\n<div class=\"daily_summary\">';\n\n $arrAllowedProducts = \\Isotope\\Backend\\Product\\Permission::getAllowedIds();\n\n $objOrders = Database::getInstance()->prepare(\"\n SELECT\n c.id AS config_id,\n c.name AS config_name,\n c.currency,\n COUNT(DISTINCT o.id) AS total_orders,\n SUM(i.tax_free_price * i.quantity) AS total_sales,\n SUM(i.quantity) AS total_items\n FROM tl_iso_product_collection o\n LEFT JOIN tl_iso_product_collection_item i ON o.id=i.pid\n LEFT OUTER JOIN tl_iso_config c ON o.config_id=c.id\n WHERE o.type='order' AND o.order_status>0 AND o.locked>=?\n \" . Report::getProductProcedure('i', 'product_id') . \"\n \" . Report::getConfigProcedure('o', 'config_id') . \"\n GROUP BY config_id\n \")->execute(strtotime('-24 hours'));\n\n if (!$objOrders->numRows) {\n\n $strBuffer .= '\n<p class=\"tl_info\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['24h_empty'] . '</p>';\n\n } else {\n\n $i = -1;\n $strBuffer .= '\n<div class=\"tl_listing_container list_view\">\n <table class=\"tl_listing\">\n <tr>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['shop_config'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['currency'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['orders#'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['products#'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['sales#'] . '</th>\n </tr>';\n\n\n while ($objOrders->next())\n {\n $strBuffer .= '\n <tr class=\"row_' . ++$i . ($i%2 ? 'odd' : 'even') . '\">\n <td class=\"tl_file_list\">' . $objOrders->config_name . '</td>\n <td class=\"tl_file_list\">' . $objOrders->currency . '</td>\n <td class=\"tl_file_list\">' . $objOrders->total_orders . '</td>\n <td class=\"tl_file_list\">' . $objOrders->total_items . '</td>\n <td class=\"tl_file_list\">' . Isotope::formatPrice($objOrders->total_sales) . '</td>\n </tr>';\n }\n\n $strBuffer .= '\n </table>\n</div>';\n }\n\n\n $strBuffer .= '\n</div>\n</fieldset>';\n\n return $strBuffer;\n }", "public function table()\n {\n return \"stocks\";\n }", "public function create()\n {\n return view('log_stocks.create');\n }", "public function stock_report_variant_bydate($from_date,$to_date,$store_id,$perpage,$page){\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(b.quantity) as totalPrhcsCtn,\n\t\t\t\te.purchase_date as purchase_date,\n\t\t\t\tg.variant_name,\n\t\t\t\tg.variant_id,\n\t\t\t\th.store_name,\n\t\t\t\th.store_id,\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->group_by('g.variant_id');\n\t\t$this->db->group_by('h.store_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($from_date))\n\t\t{\n\t\t\t$this->db->where('a.status',1);\n\t\t}else\n\t\t{\n\t\t\t$this->db->where('a.status',1);\n\t\t\t$this->db->where('e.purchase_date >=', $from_date);\n\t\t\t$this->db->where('e.purchase_date <=', $to_date);\n\t\t\t$this->db->where('b.store_id',$store_id);\n\t\t}\n\t\t$this->db->limit($perpage,$page);\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function dailyReport()\n {\n return view('backend.invoice.daily-invoice-report');\n }", "public function prodreports()\n {\n //\n $productname = Input::get('productname');\n\t \t$start_date = Input::get('start_date');\n\t\t$end_date = Input::get('end_date');\n\t $product=m_product::where('product_name',$productname)->first();\n\t \n\t \t \n $lastWeek = Carbon::now()->startOfWeek();\n\t $nowdate = Carbon::now(); \n\t $contracts=t_contract::where('product_id',$product->id)\n\t ->where('pay_date','>',$start_date)\n\t ->where('pay_date','<=',$end_date)->get();\n\t if($contracts->count())\n\t {\n\t \t \n\t \t$filename=$product->product_id+time();\n\t \\Excel::create($filename, function($excel) use ($productname, $contracts) {\n $excel->sheet('New sheet', function($sheet) use ($productname, $contracts) {\n $sheet->loadView('pdreport') \n ->withProductname($productname)\n\t ->withContracts($contracts);\n\n });\n\n })->download('xls'); \n\t\t }\n\t else {\n\t\t\t\n\t\t\treturn Redirect::back()->withInput()->withErrors('本是时间段此产品下无合同产生');\n\t }\n\t \n\t \n\t \n \n }", "public function stock_history(){\n\t\treturn $stock_info = $this->db->select('*')\n\t\t ->from('store')\n\t\t ->where('isactive',1)\n\t\t ->get()\n\t\t ->result();\n\t}", "public function stock_report_variant_bydate_count($from_date,$to_date,$store_id)\n\t{\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(b.quantity) as 'totalPrhcsCtn',\n\t\t\t\te.purchase_date as purchase_date,\n\t\t\t\tg.variant_name,\n\t\t\t\tg.variant_id,\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->group_by('g.variant_id');\n\t\t$this->db->group_by('h.store_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($store_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}else\n\t\t{\n\t\t\t$this->db->where('a.status',1);\n\t\t\t$this->db->where('e.purchase_date >=', $from_date);\n\t\t\t$this->db->where('e.purchase_date <=', $to_date);\n\t\t\t$this->db->where('b.store_id',$store_id);\t\n\t\t}\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}", "function sales_report_day($date){\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);\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 index(){\n $data = $this->Excel_model->get_stocks();\n \n \n $template = 'Myexcel.csv';\n //set absolute path to directory with template files\n $templateDir = __DIR__ . \"/../controllers/\";\n \n //set config for report\n $config = array(\n 'template' => $template,\n 'templateDir' => $templateDir\n );\n \n \n //load template\n $R = new PHPReport($config);\n \n $R->load(array(\n 'NEWS_ID' => 'news_paper',\n 'repeat' => TRUE,\n 'data' => $data \n )\n );\n \n // define output directoy \n $output_file_dir = \"/tmp/\";\n \n \n $output_file_excel = $output_file_dir . \"Myexcel.csv\";\n //download excel sheet with data in /tmp folder\n $result = $R->render('excel', $output_file_excel);\n }", "public function actionIndex()\n {\n if(empty($ordersMonth)){\n $begin = new \\DateTime( date('Y-m-d h:i:s').' -3 weeks' );\n $end = new \\DateTime( date('Y-m-d h:i:s').' +1 day' );\n } else {\n $begin = new \\DateTime( date($ordersMonth.'-01 h:i:s') );\n $end = new \\DateTime( date($ordersMonth.'-t h:i:s'));\n }\n\n $interval = \\DateInterval::createFromDateString('1 day');\n $period = new \\DatePeriod($begin, $interval, $end);\n $orderStats = [];\n foreach ( $period as $dt ){\n $beginOfDay = $dt->setTime(0,0,1)->format( \"Y-m-d H:i:s\\n\" );\n $endOfDay = $dt->setTime(23,59,59)->format( \"Y-m-d H:i:s\\n\" );\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['all'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['done'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>5])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['cancelled'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>1])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['new'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>3])->sum('order_amount');\n }\n\n return $this->render('index', ['orderStats'=>$orderStats, 'begin'=>$begin->format( \"Y-m-d H:i:s\\n\" ), 'end'=>$end->format( \"Y-m-d H:i:s\\n\" )]);\n }", "public function stock_report_product_bydate_count($product_id,$supplier_id,$from_date,$to_date){\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(b.quantity) as 'totalPurchaseQnty',\n\t\t\t\te.purchase_date as date\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($supplier_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}else{\n\t\t\t$this->db->where(\n\t\t\t\tarray(\n\t\t\t\t\t'a.status'=>1,\n\t\t\t\t\t'a.supplier_id'\t=>\t$supplier_id,\n\t\t\t\t\t'a.product_id'\t=>\t$product_id\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t$this->db->where('e.purchase_date >=', $from_date);\n\t\t\t$this->db->where('e.purchase_date <=', $to_date);\n\t\t}\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}", "public function getBlock()\n\t{\n\t\t$chart = new \\IPS\\Helpers\\Chart;\n\t\t\n\t\t$chart->addHeader( \"Day\", 'date' );\n\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t{\n\t\t\t$chart->addHeader( $currency, 'number' );\n\t\t}\n\t\t\n\t\t$thirtyDaysAgo = \\IPS\\DateTime::create()->sub( new \\DateInterval('P30D') );\n\t\t\t\t\n\t\t$results = array();\n\t\tforeach( \\IPS\\Db::i()->select( \"t_currency, DATE_FORMAT( FROM_UNIXTIME( t_date ), '%e %c %Y' ) AS date, SUM(t_amount)-SUM(t_partial_refund) AS amount\", 'nexus_transactions', array( 't_date>? AND (t_status=? OR t_status=?)', $thirtyDaysAgo->getTimestamp(), \\IPS\\nexus\\Transaction::STATUS_PAID, \\IPS\\nexus\\Transaction::STATUS_PART_REFUNDED ), NULL, NULL, array( 't_currency', 'date' ) ) as $result )\n\t\t{\n\t\t\t$results[ $result['date'] ][ $result['t_currency'] ] = $result['amount'];\n\t\t}\n\t\t\t\t\n\t\t$monthAndYear = date( 'n' ) . ' ' . date( 'Y' );\n\t\tforeach ( range( 30, 0 ) as $daysAgo )\n\t\t{\n\t\t\t$datetime = new \\IPS\\DateTime;\n\t\t\t$datetime->setTime( 0, 0, 0 );\n\t\t\t$datetime->sub( new \\DateInterval( 'P' . $daysAgo . 'D' ) );\n\t\t\t$resultString = $datetime->format('j n Y');\n\t\t\t\n\t\t\tif ( isset( $results[ $resultString ] ) )\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\t\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\tif ( !isset( $results[ $resultString ][ $currency ] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = 0;\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$row[] = $results[ $resultString ][ $currency ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\t$row[] = 0;\n\t\t\t\t}\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $chart->render( 'LineChart' );\n\t}", "public function newstock()\n {\n for ($i=0; $i<=6; $i++) {\n for ($j=0; $j<=$i; $j++) {\n $stock[] = [$i,$j];\n }\n }\n $this->stock = $stock;\n }", "public function getData($id)\r\n {\r\n $id = (int)$id;\r\n $sql = 'SELECT * FROM ' . TABLE_PREFIX . 'stat_productstock sp\r\n WHERE sp.sd_id = ?';\r\n $row = $this->db3->query($sql, array($id))->fetch();\r\n\r\n $this->pbarcode = $row['p_barcode'];\r\n $this->id = $row['sd_id'];\r\n $this->value = $row['sd_value'];\r\n $this->month = $row['sd_month'];\r\n $this->year = $row['sd_year'];\r\n $this->day_1 = $row['day_1'];\r\n $this->day_2 = $row['day_2'];\r\n $this->day_3 = $row['day_3'];\r\n $this->day_4 = $row['day_4'];\r\n $this->day_5 = $row['day_5'];\r\n $this->day_6 = $row['day_6'];\r\n $this->day_7 = $row['day_7'];\r\n $this->day_8 = $row['day_8'];\r\n $this->day_9 = $row['day_9'];\r\n $this->day_10 = $row['day_10'];\r\n $this->day_11 = $row['day_11'];\r\n $this->day_12 = $row['day_12'];\r\n $this->day_13 = $row['day_13'];\r\n $this->day_14 = $row['day_14'];\r\n $this->day_15 = $row['day_15'];\r\n $this->day_16 = $row['day_16'];\r\n $this->day_17 = $row['day_17'];\r\n $this->day_18 = $row['day_18'];\r\n $this->day_19 = $row['day_19'];\r\n $this->day_20 = $row['day_20'];\r\n $this->day_21 = $row['day_21'];\r\n $this->day_22 = $row['day_22'];\r\n $this->day_23 = $row['day_23'];\r\n $this->day_24 = $row['day_24'];\r\n $this->day_25 = $row['day_25'];\r\n $this->day_26 = $row['day_26'];\r\n $this->day_27 = $row['day_27'];\r\n $this->day_28 = $row['day_28'];\r\n $this->day_29 = $row['day_29'];\r\n $this->day_30 = $row['day_30'];\r\n $this->day_31 = $row['day_31'];\r\n $this->datecreated = $row['sd_datecreated'];\r\n $this->datemodified = $row['sd_datemodified'];\r\n\r\n }", "public function run()\n {\n $linenstock = [\n \t[\n 'id' => '1',\n 'items' => 'Sheets (Dbl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '2',\n 'items' => 'Sheets (Sgl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '3',\n 'items' => 'Pillow case',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '4',\n 'items' => 'Bath towels',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '5',\n 'items' => 'Hand towels',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '6',\n 'items' => 'Face towels',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '7',\n 'items' => 'Bath mat',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '8',\n 'items' => 'Blankets (Dbl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '9',\n 'items' => 'Blankets (Sgl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '10',\n 'items' => 'Bed cover (Dbl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '11',\n 'items' => 'Bed cover(Sgl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ] \n ];\n Linenstock::insert($linenstock);\n }", "public function index(Request $request)\n {\n $title = 'Kartu Stok';\n $fromDate = Date('Y-m-01');\n $toDate = Date('Y-m-d H:i:s');\n if(!is_null($request->fromDate) && !is_null($request->toDate)) {\n $fromDate = $request->fromDate;\n $toDate = $request->toDate;\n if(strtotime($fromDate) > strtotime($toDate)) {\n $temp = $fromDate;\n $fromDate = $toDate;\n $toDate = $temp;\n }\n }\n if($request->outlet == 0) {\n $products = json_decode(Products::selectRaw('CONCAT(products.title, \" \", product_variation.title) as title')->addSelect('product_variation.product_variation_id')->addSelect('unit.name as unit')->addSelect('product_variation.stock as lastStock')->join('product_variation_relation', 'product_variation_relation.product_id', 'products.product_id')->join('product_variation', 'product_variation.product_variation_id','product_variation_relation.product_variation_id')->join('unit', 'unit.unit_id', 'products.unit')->get(), true);\n } else {\n $products = json_decode(Products::selectRaw('CONCAT(products.title, \" \", product_variation.title) as title')->addSelect('product_variation.product_variation_id')->addSelect('unit.name as unit')->addSelect('stock_outlet.stock as lastStock')->join('product_variation_relation', 'product_variation_relation.product_id', 'products.product_id')->join('product_variation', 'product_variation.product_variation_id','product_variation_relation.product_variation_id')->join('unit', 'unit.unit_id', 'products.unit')->join('stock_outlet', 'stock_outlet.product_variation_id', 'product_variation.product_variation_id')->where('stock_outlet.outlet_id', $request->outlet)->get(), true);\n }\n $options = []; $opnameTemp = [];\n foreach($products as $product) {\n if($request->outlet == 0) {\n $options[] = json_decode(StockCards::select('product_stock.quantity')->addSelect('type_stock.type_stock_id')->addSelect('type_stock.name as type')->addSelect('transfer_stock_outlet.byOutlet_id')->addSelect('product_variation.product_variation_id')->addSelect('transfer_stock_outlet.toOutlet_id')->join('transfer_stock_outlet', 'transfer_stock_outlet.transfer_stock_outlet_id', 'stock_cards.transfer_stock_outlet_id')->join('product_stock', 'product_stock.stock_card_id', 'stock_cards.stock_card_id')->join('type_stock', 'type_stock.type_stock_id', 'stock_cards.type_stock_id')->join('product_variation', 'product_variation.product_variation_id', 'product_stock.product_variation_id')->where('product_stock.product_variation_id', $product['product_variation_id'])->whereBetween('stock_cards.created_at', [$fromDate, $toDate . ' 23:59:59'])->orderBy('stock_cards.created_at', 'desc')->get(), true);\n } else {\n $options[] = json_decode(StockCards::select('product_stock.quantity')->addSelect('type_stock.type_stock_id')->addSelect('type_stock.name as type')->addSelect('transfer_stock_outlet.byOutlet_id')->addSelect('product_variation.product_variation_id')->addSelect('transfer_stock_outlet.toOutlet_id')->join('transfer_stock_outlet', 'transfer_stock_outlet.transfer_stock_outlet_id', 'stock_cards.transfer_stock_outlet_id')->join('product_stock', 'product_stock.stock_card_id', 'stock_cards.stock_card_id')->join('type_stock', 'type_stock.type_stock_id', 'stock_cards.type_stock_id')->join('product_variation', 'product_variation.product_variation_id', 'product_stock.product_variation_id')->where('product_stock.product_variation_id', $product['product_variation_id'])->whereBetween('stock_cards.created_at', [$fromDate, $toDate . ' 23:59:59'])->where(function($query) use ($request) { $query->where('transfer_stock_outlet.toOutlet_id', $request->outlet)->orWhere('transfer_stock_outlet.byOutlet_id', $request->outlet); })->orderBy('stock_cards.created_at', 'desc')->get(), true);\n }\n\n $opnameTemp[] = json_decode(StockOpname::select('product_opname.deviation')->addSelect('stock_opname_relation.product_variation_id')->addSelect('stock_opname.outlet_id')->join('stock_opname_relation', 'stock_opname_relation.stock_opname_id', 'stock_opname.stock_opname_id')->join('product_opname','product_opname.product_opname_id', 'stock_opname_relation.product_opname_id')->where('stock_opname_relation.product_variation_id', $product['product_variation_id'])->get(), true);\n }\n // dd($products, $options, $opnameTemp);\n\n $typeStock = TypeStock::select('type_stock_id')->addSelect('name')->get();\n for($i=0;$i < count($products); $i++) {\n $temp = ['in' => 0, 'out' => 0, 'transfer' => 0, 'opname' => 0];\n for($j=0;$j < count($options[$i]); $j++) {\n if(intval($options[$i][$j]['type_stock_id']) === 1) {\n $temp['in'] += $options[$i][$j]['quantity'];\n }\n if(intval($options[$i][$j]['type_stock_id']) === 2) {\n $temp['out'] += $options[$i][$j]['quantity'];\n }\n if(intval($options[$i][$j]['type_stock_id']) === 3) {\n if($request->outlet === 0) {\n $temp['transfer'] += 0;\n } else {\n if($options[$i][$j]['byOutlet_id'] == $request->outlet) {\n $temp['transfer'] += (intval($options[$i][$j]['quantity'])* -1);\n } else if($options[$i][$j]['toOutlet_id'] == $request->outlet) {\n $temp['transfer'] += (intval($options[$i][$j]['quantity']));\n } else {\n $temp['transfer'] += 0;\n }\n }\n }\n }\n for($j=0;$j < count($opnameTemp[$i]); $j++) {\n $temp['opname'] += $opnameTemp[$i][$j]['deviation'];\n }\n $products[$i]['option'] = $temp;\n }\n for($i=0;$i < count($products); $i++) {\n $temp = (($products[$i]['lastStock'] + ($products[$i]['option']['opname'] * -1) + ($products[$i]['option']['transfer'] * -1) - $products[$i]['option']['out'] - $products[$i]['option']['in']));\n $products[$i]['option']['first'] = ($temp > 0) ? $temp : 0;\n $products[$i]['option']['sales'] = 0;\n }\n // dd($products);\n $outlets = Outlet::select('outlet.name')->addSelect('outlet.outlet_id')->get();\n $categories = Category::select('category_id')->addSelect('title')->get();\n $toDate = (!is_null($request->toDate)) ? $toDate : Date('Y-m-d');\n $outletID = ($request->outlet) ? $request->outlet : 0;\n return view('StockCard', compact('title', 'fromDate', 'toDate', 'outlets', 'categories', 'products', 'outletID'));\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 index()\n {\n return view('admin.stock.stock');\n }", "public function index()\n {\n return Stock::get();\n }", "public function getquickReturnReport()\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 Return Date Orders';\n $parameter['orders'] = Order::where('to','=', $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 Return Date Orders.pdf');\n\t\t\n\t}", "function wc_marketplace_date2() {\n global $wmp;\n $wmp->output_report_date2();\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getSalesReport($month,$day,$year,$fromTime_hour,$fromTime_minutes,$fromTime_seconds,$toTime_hour,$toTime_minutes,$toTime_seconds,$username,$module) {\n\necho \"\n<style type='text/css'>\ntr:hover { background-color:yellow; color:black;}\na { text-decoration:none; color:black; }\n</style>\";\n\n$dateSelected = $month.\"_\".$day.\"_\".$year;\n$fromTimez = $fromTime_hour.\":\".$fromTime_minutes.\":\".$fromTime_seconds;\n$toTimez = $toTime_hour.\":\".$toTime_minutes.\":\".$toTime_seconds;\n\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT upper(pr.completeName) as completeName,pc.description,pc.sellingPrice,pc.quantity,pc.discount,pc.total,pc.cashUnpaid,pc.cashPaid,pc.chargeBy FROM patientRecord pr,registrationDetails rd,patientCharges pc WHERE pr.patientNo = rd.patientNo and rd.registrationNo = pc.registrationNo and pc.dateCharge = '$dateSelected' and (pc.timeCharge between '$fromTimez' and '$toTimez') and title='$module' group by pc.itemNo order by completeName asc \");\n\necho \"<table border=1 cellpadding=0 cellspacing=0>\";\necho \"<tr>\";\necho \"<th>&nbsp;Name&nbsp;</th>\";\necho \"<th>&nbsp;Description&nbsp;</th>\";\necho \"<th>&nbsp;Price&nbsp;</th>\";\necho \"<th>&nbsp;QTY&nbsp;</th>\";\necho \"<th>&nbsp;Disc&nbsp;</th>\";\necho \"<th>&nbsp;Total&nbsp;</th>\";\necho \"<th>&nbsp;Unpaid&nbsp;</th>\";\necho \"<th>&nbsp;Paid&nbsp;</th>\";\necho \"<th>&nbsp;Charge By&nbsp;</th>\";\necho \"</tr>\";\n$this->sales_total=0;\n$this->sales_unpaid=0;\n$this->sales_paid=0;\nwhile($row = mysqli_fetch_array($result))\n {\necho \"<tr>\";\necho \"<td>&nbsp;\".$row['completeName'].\"&nbsp;</td>\";\necho \"<td>&nbsp;\".$row['description'].\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['sellingPrice'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['quantity'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['discount'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['total'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['cashUnpaid'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['cashPaid'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".$row['chargeBy'].\"&nbsp;</td>\";\n$this->sales_total+=$row['total'];\n$this->sales_paid+=$row['cashPaid'];\n$this->sales_unpaid+=$row['cashUnpaid'];\necho \"</tr>\";\n }\necho \"</table>\";\necho \"<br>Total Sales:&nbsp;\".$this->sales_total;\necho \"<br>Total Unpaid:&nbsp;\".$this->sales_unpaid;\necho \"<br>Total Paid&nbsp;\".$this->sales_paid;\n\n}", "function quantizer_expenses_general_report($start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerGeneralExpenses($start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "public function index()\n {\n return JournalEntry::currentReport()->orderByDesc('created_at')->get();\n }", "public function orderReport()\n {\n // gunakan startofmonth utk mengambil tanggal 1\n $start = Carbon::now()->startOfMonth()->format('Y-m-d H:i:s');\n //endofmonth untuk mengambil tanggal terakhir dibulan yg berlaku saat ini\n $end = Carbon::now()->endOfMonth()->format('Y-m-d H:i:s');\n //jika user melakukan filter manual, maka parameter date akan terisi\n if(request()->date !=''){\n //maka formating tglnya berdasarkan filter user\n $date = explode(' - ',request()->date);\n $start = Carbon::parse($date[0])->format('Y-m-d'). ' 00:00:01';\n $end = Carbon::parse($date[1])->format('Y-m-d'). ' 23:59:59';\n }\n //dibuat query utk DB menggunakan wherebetween from tgl filter\n $orders = Order::with(['customer.district'])->whereBetween('created_at', [$start, $end])->get();\n return view('report.order',compact('orders'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $stocks = $em->getRepository('IschaBackOfficeBundle:Stock')->findAll();\n\n return $this->render('stock/index.html.twig', array(\n 'stocks' => $stocks,\n ));\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 show(Stock $stock)\n {\n //\n }", "public function show(Stock $stock)\n {\n //\n }", "public function show(Stock $stock)\n {\n //\n }", "public function index()\n {\n $sbus = Sbu::all();\n $items = Item::all();\n $report = null;\n return view('add-stock.index', compact('report','sbus','items'));\n }", "public function index(LogStockDataTable $logStockDataTable)\n {\n return $logStockDataTable->render('log_stocks.index');\n }", "function reportOpenedResultsPerDay($ReportCondition = '1')\r\n{\r\n return reportPerDBColoumn('ResultInfo', \"DATE_FORMAT(OpenedDate, '%y-%m-%d')\", $ReportCondition, '', 'OpenedDate ASC');\r\n}", "function get_acquisition_value(){\n\n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj = new vintage_has_acquire();\n //$columns = \"DATE_FORMAT(acquire_date,'%b') as Month\";\n $columns = \"DATE_FORMAT(tblAcquire.acquire_date,'%b') as month, sum(trelVintageHasAcquire.total_price) as total\";\n //$group = \" trelVintageHasAcquire.acquire_id \";\n $group = \" Month \";\n $where = \" tblAcquire.acquire_date BETWEEN '2014-01-01' AND '2014-12-31'\";\n $sort = \" acquire_date ASC \";\n $rst = $obj ->get_extended($where,$columns,$group, $sort);\n \n \n if(!$rst){\n $var_result['success']=false;\n $var_result['error']=\"acquisition report failed\";\n return $var_result;\n }\n\n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result;\n\n}", "public function show_buy_review_by_date($date_from,$date_to)\n {\n $query = $this->db->query(\"SELECT `date`,GROUP_CONCAT(`product_id`) as product_id, GROUP_CONCAT(`type`) as type,GROUP_CONCAT(`weight`) as weight, GROUP_CONCAT(`instock`) as instock ,GROUP_CONCAT(`paid`) as paid,GROUP_CONCAT(`due`) as due, GROUP_CONCAT(`price`) as price,SUM(`price`) as tp FROM `purchase` WHERE DATE(`date`) BETWEEN STR_TO_DATE('$date_from', '%Y-%m-%d') AND STR_TO_DATE('$date_to', '%Y-%m-%d') GROUP BY `date` \");\n return $query->result();\n }", "function test($firstDate, $secondDate, $dayOfWeek) {\r\n file_get_contents('https://jsonmock.hackerrank.com/api/stocks');\r\n\r\n $theResponse = file_get_contents('https://jsonmock.hackerrank.com/api/stocks'); \r\n \r\n $response = json_decode($theResponse,true);\r\n $total_pages = $response['total_pages'];\r\n $firstDay = strtotime($firstDate);\r\n $lastDay = strtotime($secondDate);\r\n $output = [];\r\n \r\n\r\n for($i = 1; $i <= $total_pages; $i++){\r\n $topPageResponse = json_decode(file_get_contents('https://jsonmock.hackerrank.com/api/stocks/?page='.$i.''), true);\r\n\r\n for($j = 0; $j < count($topPageResponse['data']); $j++){\r\n $foundDate = strtotime($topPageResponse['data'][$j]['date']);\r\n $dayOW = date(\"l\", strtotime($topPageResponse['data'][$j]['date']));\r\n if( $foundDate >= $firstDay && $foundDate <= $lastDay && $dayOW == $dayOfWeek){\r\n $output[] = ' '.$topPageResponse['data'][$j]['date'].' '\r\n .$topPageResponse['data'][$j]['open'] .' '\r\n .$topPageResponse['data'][$j]['close'] .'';\r\n }\r\n }\r\n\r\n }\r\n\r\n foreach($output as $item){\r\n echo \"$item\\r\\n\";\r\n };\r\n}", "private function getStatistik() {\n $SHOW_DAYS = 365;\n self::$today = new DateTime();\n $resultHtml = \"\";\n\n // Jetzt Berechnungen pro Budget:\n $budgets = Persistence::getInstances(\"BUD\", \"name\", false);\n $werte = array();\n $jahre = array();\n $budgetNames = array();\n $budgetAmount = array();\n foreach ($budgets as $budget) {\n $budgetName = $budget->getProperty(\"name\", \"unbekannt\");\n $budgetNames[\"\" . $budgetName] = \"$budgetName\";\n $budgetZeitraum = $budget->getProperty(\"zeitraum\", \"\") == \"\" ? \"\" : \" \" . $budget->getProperty(\"zeitraum\", \"\");\n $budgetAmount[\"\" . $budgetName] = $budget->getProperty(\"btotal\", \"\") . $budgetZeitraum;\n if (!isset($werte[\"$budgetName\"])) {\n $werte[\"$budgetName\"] = array();\n }\n $instances = Persistence::getInstances(\"ARB\", \"datum\", false, $budget->getId(), true);\n $resultData = array();\n foreach ($instances as $instance) {\n $h = $instance->getProperty(ARB::PROPERTY_STUNDEN, 0);\n $kaz = $instance->getProperty(ARB::PROPERTY_KAZ, 0);\n list($tag, $monat, $jahr) = explode(\".\", $instance->getProperty(ARB::PROPERTY_DATUM, \"01.01.1800\"));\n if ($jahr >= \"2017\") {\n $jahre[\"\" . $jahr] = \"\" . \"$jahr\";\n if (!isset($werte[\"$budgetName\"][\"\" . $jahr])) {\n $werte[\"$budgetName\"][\"\" . $jahr][\"Jahr\"] = 0;\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"] = array();\n }\n if (!isset($werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat])) {\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat] = 0;\n }\n $wert = $kaz != \"\" && $h != \"\" ? ($kaz > $h ? $kaz : $h) : ($kaz != \"\" ? $kaz : ($h != \"\" ? $h : 0));\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat] += $wert;\n $werte[\"$budgetName\"][\"\" . $jahr][\"Jahr\"] += $wert;\n }\n }\n }\n ksort($jahre);\n $monatWerte = array();\n $jahresWerte = array();\n foreach ($budgetNames as $budgetName) {\n $budgetWert[$budgetName] = array();\n foreach ($jahre as $jahr) {\n foreach (array(\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\") as $monat) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n if (!self::isOlder($jahr, $monat, $SHOW_DAYS)) {\n $monatWerte[$budgetName][$jahr . \"\"][\"\" . $monat] = 0;\n }\n }\n $jahresWerte[$budgetName][$jahr . \"\"] = 0;\n }\n }\n foreach ($werte as $budgetName => $jahrWerte) {\n foreach ($jahrWerte as $jahr => $jahrUndMonatWerte) {\n $jahresWerte[$budgetName][$jahr . \"\"] = $jahrUndMonatWerte[\"Jahr\"];\n foreach ($jahrUndMonatWerte[\"monate\"] as $monat => $wert) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n if (!self::isOlder($jahr, $monat, $SHOW_DAYS)) {\n $monatWerte[$budgetName][\"\" . $jahr][\"\" . $monat] = $wert;\n }\n }\n }\n }\n\n // Summen über alle ARB Instanzen berechnen (Budget unabhaengig, da ARB Instanzen\n // mehreren Budgets gleichzeitig zugeordnet sein koennen\n $monatSumme = array();\n $jahrSumme = array();\n foreach ($jahre as $jahr) {\n foreach (array(\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\") as $monat) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n $monatSumme[\"$jahr-$monat\"] = 0;\n }\n $jahrSumme[\"$jahr\"] = 0;\n }\n $arbInstances = Persistence::getInstances(\"ARB\", \"datum\", false, \"\", true);\n foreach ($arbInstances as $instance) {\n $h = $instance->getProperty(ARB::PROPERTY_STUNDEN, 0);\n list($tag, $monat, $jahr) = explode(\".\", $instance->getProperty(ARB::PROPERTY_DATUM, \"01.01.1800\"));\n if ($jahr >= 2017 && is_numeric($h)) {\n $jahrSumme[\"$jahr\"] += $h;\n $monatSumme[\"$jahr-$monat\"] += $h;\n }\n }\n\n // Darstellung:\n $table = \"<table>\";\n foreach ($monatWerte as $budgetName => $jahrWerte) {\n $table .= \"<tr><td>Budget</td><td style='width: 90px;'>Max</td>\";\n foreach ($jahrWerte as $jahr => $monate) {\n foreach ($monate as $monat => $wert) {\n $table .= \"<td>\" . $monat . \"/\" . ($jahr - 2000) . \"</td>\";\n }\n }\n foreach ($jahresWerte[$budgetName] as $jahr => $wert) {\n $table .= \"<td>$jahr</td>\";\n }\n break;\n }\n $table .= \"</tr>\";\n\n $trclass = \"odd\";\n foreach ($monatWerte as $budgetName => $jahrWerte) {\n $trclass = $trclass == \"odd\" ? \"even\" : \"odd\";\n $strong = \"\";\n foreach (array(\"#022\", \"#028\", \"#030\", \"#034\", \"#039\", \"400059\", \"412622\") as $s) {\n if (strpos($budgetName, $s) !== false) {\n $strong = \"strong\";\n }\n }\n $tr = \"<tr class='$trclass $strong'><td><span title='$budgetName'><span style='padding-right: 20px;'>\" . substr($budgetName, 0, 80) . \"</span></td>\";\n $tr .= \"<td>\" . $budgetAmount[\"\" . $budgetName] . \"</td>\";\n foreach ($jahrWerte as $jahr => $monate) {\n foreach ($monate as $monat => $wert) {\n // fuer unproduktive auch die % darstellen:\n $prozentm= (stripos($budgetName, \"unproduktiv\") !== false && $monatSumme[\"$jahr-$monat\"] > 0) ? round(($wert / $monatSumme[\"$jahr-$monat\"]) * 100, 0) . \"%\" : \"\";\n $title = \"$prozentm = $wert/\" . $monatSumme[\"$jahr-$monat\"] . \" h @ \";\n $title .= \"$jahr-$monat: $budgetName\";\n $tr .= \"<td title='$title' style='width: 60px;'>$wert<br><strong>$prozentm</strong></td>\";\n }\n }\n foreach ($jahresWerte[$budgetName] as $jahr => $wert) {\n // fuer unproduktive auch die % darstellen:\n $prozent = $jahrSumme[\"$jahr\"] > 0 ? round((($wert / $jahrSumme[\"$jahr\"]) * 100), 1) . \"%\" : \"\";\n $title = (stripos($budgetName, \"unproduktiv\") !== false ? \"$prozent = $wert/\" . $jahrSumme[\"$jahr\"] . \" h\" : \"\");\n $text = $title == \"\" ? \"\" : \"<br><strong>$prozent</strong>\";\n $tr .= \"<td title='$title' style='width: 80px;'>$wert$text</td>\";\n }\n $tr .= \"</tr>\";\n $table .= \"$tr\";\n }\n $table .= \"</table>\";\n\n return \"$table\";\n }", "public function index()\n {\n $carts= NursingCartRestock::all()->sortByDesc('created_at');\n return view('admin.pharmacy.stockcart', compact('carts'));\n\n }", "public function getSales($date){\n $totaSales = DB::select(\"select sum(amount) as amount from subscriptions where created_at like '\".$date->toDateString().\"%'\");\n return $totaSales[0]->amount;\n }", "function reports($biz_id,$table,$date,$sum) {\n\t\n\t\t$results = [];\n\t\t$resultsDB = \\DB::table($table)->where('biz_id', $biz_id);\n\n\t\tif(isset($_GET['client_id']) AND $_GET['client_id'] != 'all' AND $table != 'clients') {\n\t\t\t$resultsDB->where('client_id', $_GET['client_id']);\n\t\t}\n\t\t\n\t\tif(isset($_GET['currency'])) {\n\t\t\t$resultsDB->where('currency', $_GET['currency']);\n\t\t}\n\n\t\t$month = clone $resultsDB;\n\t\t$lastmonth = clone $resultsDB;\n\t\t$lastmonth2 = clone $resultsDB;\n\t\t$lastyear = clone $resultsDB;\n\t\t$year = clone $resultsDB;\n\t\t$dates_filtered = clone $resultsDB;\n\n\t\tif(!empty($_GET['date_from'])) {\n\t\t\t$dates_filtered->whereDate($date, '>', $_GET['date_from']);\n\t\t}\n\t\tif(!empty($_GET['date_to'])) {\n\t\t\t$dates_filtered->whereDate($date, '<', $_GET['date_to']);\n\t\t}\n\t\t$results['results'] = $dates_filtered->count();\n\t\t$results['results_sum'] = $dates_filtered->sum($sum);\n\n\t\t$month = $month->whereMonth($date, \\Carbon::now()->format('m'));\n\t\t$lastmonth = $lastmonth->whereMonth($date, \\Carbon::now()->firstOfMonth()->subMonth()->format('m'));\n\t\t$lastmonth2 = $lastmonth2->whereMonth($date, \\Carbon::now()->firstOfMonth()->subMonth(2)->format('m'));\n\t\t$year = $year->whereYear($date, \\Carbon::now()->format('Y'));\n\t\t$lastyear = $lastyear->whereYear($date, \\Carbon::now()->subYear()->format('Y'));\n\n\t\t$results['month'] = $month->count();\n\t\t$results['month_sum'] = $month->sum($sum);\n\t\t$results['lastmonth'] = $lastmonth->count();\n\t\t$results['lastmonth_sum'] = $lastmonth->sum($sum);\n\t\t$results['lastmonth2'] = $lastmonth2->count();\n\t\t$results['lastmonth2_sum'] = $lastmonth2->sum($sum);\n\t\t$results['year'] = $year->count();\n\t\t$results['year_sum'] = $year->sum($sum);\n\t\t$results['lastyear'] = $lastyear->count();\n\t\t$results['lastyear_sum'] = $lastyear->sum($sum);\n\t\t$results['total'] = $resultsDB->count();\n\t\t$results['total_sum'] = $resultsDB->sum($sum);\n\t\t\n \treturn $results;\n\t}", "public function getReportedDate();", "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 }", "public function getQuantite_stock()\r\n {\r\n return $this->quantite_stock;\r\n }", "function jx_pnh_getfranchiseordersbydate()\r\n\t{\r\n\t\t$data['stat'] = $this->input->post('stat');\r\n\t\t$data['fid'] = $this->input->post('fid');\r\n\t\t$data['st_ts'] = strtotime($this->input->post('ord_fil_from').' 00:00:00');\r\n\t\t$data['en_ts'] = strtotime($this->input->post('ord_fil_to').' 23:59:59');\r\n\t\t$this->load->view(\"admin/body/jx_pnh_franchiseorderlist\",$data);\r\n\t}", "public function stock_report($limit,$page)\n\t{\n\t\t//$today = date('Y-m-d');\n\t\t$this->db->select(\"a.product_name,a.product_id,a.cartoon_quantity,a.price,a.product_model,sum(b.quantity) as 'totalSalesQnty',(select sum(product_purchase_details.quantity) from product_purchase_details where product_id= `a`.`product_id`) as 'totalBuyQnty'\");\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('invoice_details b','b.product_id = a.product_id');\n\t\t$this->db->where(array('a.status'=>1,'b.status'=>1));\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_id','desc');\n\t\t$this->db->limit($limit, $page);\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "function weeklyQuotesAction(){\n\t\t\n\t\t\n\t\t$request=$this->_request->getParams();\n\t\t\n\t\t\n\t\t\t $quotecron_obj = new Ep_Quote_Cron();\n\t\t\t $quotes=$quotecron_obj->getweeklyquotes();\n\t\t\t $quoteDetails=array();\n\t\t\t $quoteslern=array();\n\t\t\t $quotesusertotal=array();\n\t\t\t $date7day = date('Y-m-d H:i:s',time()-(7*86400));\n\t\t\t\t\t\t$html=\"<table class='table-bordered table-hover'>\";\n\t\t\t\t\t\tif(count($quotes)>0){\n\t\t\t\t\t\t\t\t\t\t $quotetotal=0;\n\t\t\t\t\t\t\t\t\t\t $turnover=0;\n\t\t\t\t\t\t\t\t\t\t $signature=0;\n\t\t\t\t\t\t\t\t\t\t $i=0;\n\t\t\t\t\t\t\t\t\t\t $usertotal=1;\n\t\t\t\t\t\t\t\tforeach($quotes as $quotescheck){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(($quotescheck['created_at']>=$date7day && $quotescheck['created_at']<=date('Y-m-d') )&& ($quotescheck['sales_review']=='not_done' || $quotescheck['sales_review']=='challenged' || $quotescheck['sales_review']=='to_be_approve') ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quotetotal++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$turnover+=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$signature+=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['identifier']=$quotescheck['identifier'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$mrgin=explode('.',$quotescheck['sales_margin_percentage']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['company_name']=$quotescheck['company_name'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['bosalesuser']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['status']='Ongoing';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($quotescheck['seo_timeline']<time() && $quotescheck['seo_timeline']!='')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team= 'Seo ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telseif($quotescheck['tech_timeline']<time() && $quotescheck['tech_timeline']!='')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team= 'Tech ';\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telseif($quotescheck['prod_timeline']<time() && $quotescheck['prod_timeline']!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team= 'Prod ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['team']=$team;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($quotescheck['response_time']>time()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['notiontime']='Late No';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['notiontime']='Late Yes';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['quote_by']=$quotescheck['quote_by'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif($quotescheck['sales_review']=='closed' && $quotescheck['closed_reason']!='quote_permanently_lost' && $quotescheck['releaceraction']!=''){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quotetotal++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$turnover+=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$signature+=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['identifier']=$quotescheck['identifier'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$mrgin=explode('.',$quotescheck['sales_margin_percentage']);\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$quoteslern[$i]['company_name']=utf8_decode($quotescheck['company_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['status']='A relancer';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['team']='Relanc&#233;';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*$validate_date= new DateTime($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days= $validate_date->diff(new DateTime(date(\"Y-m-d H:i:s\")));*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days=dateDiff($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at'],date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['notiontime']='Quote sent '.$sent_days.' on days ago';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['comments']='closed on '.$quotescheck['releaceraction'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['quote_by']=$quotescheck['quote_by'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif($quotescheck['sales_review'] == 'validated' && $quotescheck['validateaction']!=\"\" ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quotetotal++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $turnover+=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $signature+=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['identifier']=$quotescheck['identifier'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $mrgin=explode('.',$quotescheck['sales_margin_percentage']);\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 $quoteslern[$i]['company_name']=utf8_decode($quotescheck['company_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['quote_by']=$quotescheck['quote_by'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['status']='Sent';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t /*$sent_days= $validate_date->diff(new DateTime(date(\"Y-m-d H:i:s\")));*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days=dateDiff($quotescheck['validateaction'], date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['notiontime']='Quote sent '.$sent_days.' on days ago';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['comments']='closed on '.$quotescheck['validateaction'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['team']='/';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif($quotescheck['sales_review'] == 'closed' && ($quotescheck['closed_reason']=='quote_permanently_lost' || $quotescheck['closeaction']!=\"\" || $quotescheck['close5dayaction']!=\"\" || $quotescheck['close20dayaction']!=\"\" || $quotescheck['close30dayaction']!=\"\") ){\n\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\t\t\t\t\t\t\t\t\t $mrgin=explode('.',$quotescheck['sales_margin_percentage']);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['identifier']=$quotescheck['identifier'];\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 $quoteslern[$i]['company_name']=utf8_decode($quotescheck['company_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['status']='Closed';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* $validate_date= new DateTime($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days= $validate_date->diff(new DateTime(date(\"Y-m-d H:i:s\")));*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days=dateDiff($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at'],date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['notiontime']='Quote sent '.$sent_days.' on days ago';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['comments']= $quotescheck['closed_comments'].'<br> closed on '.$quotescheck['closeaction'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['team']=$this->closedreason[$quotescheck['closed_reason']];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\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} // end foreach\n\t\t\t\t\t\t\t\t$quoteDetails['quotetotal']=$quotetotal;\n\t\t\t\t\t\t\t\t$quoteDetails['turnover']=$turnover;\n\t\t\t\t\t\t\t\t$quoteDetails['signature']=round($signature/$quotetotal);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $startdate = date('d',time()-(7*86400));\n\t\t\t\t\t\t\t\t\t $enddate= date('d-M-Y',strtotime(date('Y-m-d')));\n\t\t\t\t\t\t\t\t\t$statusdir =$_SERVER['DOCUMENT_ROOT'].\"/BO/quotes_weekly_report/\";\n\t\t\t\t\t\t\t\t\tif(!is_dir($statusdir))\n\t\t\t\t\t\t\t\t\tmkdir($statusdir,TRUE);\n\t\t\t\t\t\t\t\t\tchmod($statusdir,0777);\n\t\t\t\t\t\t\t\t\t$filename = $_SERVER['DOCUMENT_ROOT'].\"/BO/quotes_weekly_report/weekly-report-$startdate-to-$enddate.xlsx\";\n\t\t\t\t\t\t\t\t\t$htmltable = $this->QuotesTable($quoteDetails,$quoteslern);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//save excel file \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tchmod($filename,0777);\t\n\t\t\t\t\t\t\t\t\t$quoteDetails['startdate']=$startdate;\n\t\t\t\t\t\t\t\t\t$quoteDetails['enddate']=$enddate;\n\t\t\t\t\t\t\t\t\t$this->_view->weely_table_details=$quoteDetails;\n\t\t\t\t\t\t\t\t\t$this->_view->weely_table_quote=$quotes;\n\t\t\t\t\t\t\t\t\t$this->_view->filepath=$filename;\n\t\t\t\t\t\t\t\t\t$this->render('weekly-quotes');\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\tif($request['download']=='report'){\n\t\t\t\t\t\t\t\t\t$this->convertHtmltableToXlsx($htmltable,$filename,True);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->_redirect(\"/quote/download-document?type=weekly&filename=weekly-report-$startdate-to-$enddate.xlsx\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t } //end id\n\t\t\t\t\t\t\n\t\t\t \n\t\t\t}", "function ViewStockAdjustmentTransaction()\n {\n $sql=\"select * from INVT_T_STOCK_ADJ_HEAD \";\n return $this->db->query($sql, $return_object = TRUE)->result_array();\n }", "public function index()\n {\n// $vendors = Customer::get();\n// DB::enableQueryLog();\n\n\n $stock = DB::table('products as p')\n ->leftjoin('receive_details as r', 'p.id','=','r.product_id')\n ->select( DB::raw('p.id,p.name, sum(r.total_price) as r_total_price, sum(r.qty) as r_qty,\n (select sum(a.total_price) from sells_details as a where p.id=a.product_id) as s_total_price,\n (select sum(b.qty) from sells_details as b where p.id=b.product_id) as s_qty') )\n\n ->groupBy('p.id' )\n ->orderBy('p.id' )\n\n\n ->get();\n\n// dd(DB::getQueryLog());\n\n\n return view(\"admin.report.stock\", ['stocks' => $stock]);\n }", "function avisos_listado_stock()\n\t{\n\t\t$query=\"SELECT id,codigo from productos \";\n\t\t$result= mysql_query($query);\n\t\t?><TABLE border=\"1\">\n\t\t<TR>\n\t\t\t<TH>CODIGO</TH>\n\t\t\t<TH>COLOR</TH>\n\t\t\t<TH>TALLE</TH>\n\t\t\t<TH>CANTIDAD TOTAL</TH>\n\t\t\t<TH>STOCK BAJO MINIMO</TH>\n\n\t\t</TR>\n\t\t<? $contador = 0;\n\t\twhile ($row = mysql_fetch_assoc($result))\n\t\t{ //recorro todos los productos 1 por 1\n\t\t$contador++;\n\n\t\t\t// AHORA SE RECORRO LOS COLORES\n\t\t\t$query_color=\"SELECT * FROM colores\";\n\t\t\t$result_color= mysql_query($query_color);\n\t\t\twhile ($row_color = mysql_fetch_assoc($result_color))\n\t\t\t{\n\n\t\t\t\t$query_talle=\"SELECT * FROM talles\";\n\t\t\t\t$result_talle= mysql_query($query_talle);\n\t\t\t\twhile ($row_talle = mysql_fetch_assoc($result_talle))\n\t\t\t\t{\n\n\n\t\t\t\t\t$query_avisos=\"SELECT SUM(cantidad) AS cantidad_total, aviso_stock FROM productos AS P inner join productos_stock as PS ON PS.idProducto = P.codigo WHERE codigo = '\".$row[\"codigo\"]. \"' and idcolor = '\".$row_color[\"id\"]. \"' and idtalle = '\".$row_talle[\"id\"]. \"' group by codigo\";\n\t\t\t\t\t$result_avisos = mysql_query($query_avisos);\n\t\t\t\t\tif($row_avisos = mysql_fetch_assoc($result_avisos))\n\t\t\t\t\t{\n\t\t\t\t\t\t//if($row_avisos[\"cantidad_total\"] < $row_avisos[\"aviso_stock\"])\n\t\t\t\t\t\t//{\t\n\t\t\t\t\t\t//\tECHO \"<FONT SIZE=3 COLOR=blue>EL PRODUCTO <A HREF='http://localhost/control_stock/admin/productos/index.php?accion=detail&id=\".$row[\"id\"].\"'>\" . $row[\"codigo\"] . \"</a> COLOR : \".$row_color[\"nombre\"].\" TALLE : \".$row_talle[\"nombre\"].\" TIENE DE STOCK : \".$row_avisos[\"cantidad_total\"].\" </FONT><br>\";\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<TR class=\"<?=($contador%2==0? \"fila_par\":\"fila_impar\");?>\">\n\t\t\t\t\t\t\t<TD><A HREF='<?=ADMIN?>productos/index.php?accion=detail&id=<?=$row[\"id\"]?>'><?= $row[\"codigo\"];?></a></TD>\n\t\t\t\t\t\t\t<TD><?= $row_color[\"nombre\"];?></TD>\n\t\t\t\t\t\t\t<TD><?= $row_talle[\"nombre\"];?></TD>\n\t\t\t\t\t\t\t<TD><?= $row_avisos[\"cantidad_total\"];?></TD>\n\t\t\t\t\t\t\t<TD><?= $row_avisos[\"aviso_stock\"];?></TD>\n\t\t\t\t\t\t</TR>\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}//END WHILE TALLES\n\t\t\t}//END WHILE COLORES\n\t\t}//EN DWHILE PRODUCTOS\n\t\t?></TABLE><?\n\t}", "public function getStock()\n {\n return $this->Stock;\n }", "public function actionStock($ACCESS_GROUP,$PRODUCT_ID,$STORE_ID)\r\n {\r\n $model = new ProductStock();\r\n if ($model->load(Yii::$app->request->post())) {\r\n $models = Product::find()->where(['PRODUCT_ID'=>$PRODUCT_ID])->one();\r\n $model->PRODUCT_ID=$PRODUCT_ID;\r\n $model->ACCESS_GROUP=$ACCESS_GROUP;\r\n $model->STORE_ID=$STORE_ID;\r\n date_default_timezone_set('Asia/Jakarta');\r\n $model->INPUT_TIME=date('H:i:s');\r\n $model->INPUT_DATE=date('Y-m-d');\r\n if ($model->save(false)) {\r\n Yii::$app->session->setFlash('success', \"Penyimpanan Stock Produk <b>\".$models->PRODUCT_NM.\"</b> Berhasil\");\r\n return $this->redirect(['index-stock','productid'=>$PRODUCT_ID]);\r\n }\r\n }\r\n $productdetail = ProductSearch::find()->joinWith('store')->where(['store.ACCESS_GROUP'=>$ACCESS_GROUP,'PRODUCT_ID'=>$PRODUCT_ID,'store.STORE_ID'=>$STORE_ID])->one();\r\n \r\n return $this->renderAjax('_form_stock', [\r\n 'model' => $model,\r\n 'productdetail'=>$productdetail\r\n ]);\r\n }", "public function getStockContainer()\n {\n $reportStock = new ReportStock();\n return Collection::times(10)->map(function ($value) use ($reportStock) {\n $stock = $reportStock->getStockContainers(new Request([\n 'stock_date' => $date = Carbon::now()->subWeeks($value - 1)\n ]));\n\n $groupStock = $stock->groupBy('container_size')\n ->select('container_size')\n ->selectRaw('COUNT(container_size) AS total')\n ->get()\n ->mapWithKeys(function ($item) {\n return [$item->container_size => $item->total];\n });\n\n if (!$groupStock->has('20')) $groupStock[20] = 0;\n if (!$groupStock->has('40')) $groupStock[40] = 0;\n if (!$groupStock->has('45')) $groupStock[45] = 0;\n\n return collect([\n 'date' => $date->toDateString(),\n 'stocks' => $groupStock\n ]);\n });\n }", "public function index()\n {\n $now = Carbon::now();\n\n $place = $this->getPlace();\n\n $query1 = Order::query()\n ->where('place_id', $place->id)\n ->status('draft', '!=');\n\n $d1 = $now->copy();\n $res[] = [\n 'title' => 'Заказы сегодня:',\n 'dates' => [$d1->format('Y-m-d')],\n 'count' => (clone $query1)->whereDate('created_at', $d1)->count(),\n 'amount' => (clone $query1)->whereDate('created_at', $d1)->sum('amount'),\n ];\n $d1 = $now->copy()->addDays(-1);\n $res[] = [\n 'title' => 'Заказы вчера:',\n 'dates' => [$d1->format('Y-m-d')],\n 'count' => (clone $query1)->whereDate('created_at', $d1)->count(),\n 'amount' => (clone $query1)->whereDate('created_at', $d1)->sum('amount'),\n ];\n $d1 = $now->copy()->startOfWeek();\n $d2 = $now->copy()->endOfWeek();\n $res[] = [\n 'title' => 'За эту неделю:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n $d1 = $now->copy()->addDays(-7)->startOfWeek();\n $d2 = $now->copy()->addDays(-7)->endOfWeek();\n $res[] = [\n 'title' => 'За прошлую неделю:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n $d1 = $now->copy()->startOfMonth();\n $d2 = $now->copy()->endOfMonth();\n $res[] = [\n 'title' => 'За этот месяц:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n $d1 = $now->copy()->addMonths(-1)->startOfMonth();\n $d2 = $now->copy()->addMonths(-1)->endOfMonth();\n $res[] = [\n 'title' => 'За прошлый месяц:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n\n return [\n 'data' => $res\n ];\n }", "public function getSalesTransactions($stock){\n\n $this->db->select('*');\n $this->db->from('transactions t');\n $this->db->where('t.Stock', $stock);\n $query = $this->db->get();\n\n $item = [\n \"DateTime\" => \"N/A\",\n \"Player\" => \"N/A\",\n \"Stock\" => \"N/A\",\n \"Trans\" => \"N/A\",\n \"Quantity\" => \"N/A\"\n ];\n\n $resultset = array();\n\n array_push($resultset, $item);\n\n if($query->num_rows() != 0)\n {\n $resultset = $query->result_array();\n }\n\n return $resultset;\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 get_sales_man_daily_work_report($date){\n\t\t $this->db->select('empployee.e_id,empployee.e_emplouee_id,assign_work.w_d_id,assign_work.date')->from('assign_work');\n\t\t $this->db->join('empployee', 'empployee.e_id = assign_work.work_employee_id ', 'left');\n\t\t $this->db->order_by('empployee.role_id',8);\n\t\t $this->db->where('empployee.status',1);\n\t\t $this->db->where('assign_work.date',$date);\n\t\t $return=$this->db->get()->result_array();\n\t\t $work_details=$data_work='';\n\t\t foreach($return as $list){\n\t\t\t $emp_work=$this->get_employee_work_dailay_details($list['date'],$list['e_id'],$list['w_d_id']);\n\t\t\t $data[$list['e_id']]=$list;\n\t\t\t $data[$list['e_id']]['work']=isset($emp_work)?$emp_work:'';\n\t\t\t \n\t\t }\n\t\t if(!empty($data)){\n\t\t\t return $data;\n\t\t }\n\t}", "public function salesQuotesListAction()\n\t{\t\t\n\t\t$quote_obj=new Ep_Quote_Quotes();\n\t\t$listParams=$this->_request->getParams();\n\t\t$searchParams['client_id']=$listParams['client_id'];\n\n\t\t$quoteList=$quote_obj->getAllQuotesList($searchParams);\t\n\t\t\n\t\tif($quoteList)\n\t\t{\n\t\t\t$q=0;\n\t\t\t$total_turnover = $total_ongoing_turnover_euro = $total_ongoing_turnover_pound = $validated_turnover_euro = $validated_turnover_pound = $signed_turnover_euro = $signed_turnover_pound = 0;\n\t\t\t$ave_count=$relancer_turnover_pound=$relancer_turnover_euro=$in_day=0;\n\t\t\t$in_day=0;\n\t\t\tforeach ($quoteList as $quote) {\n\t\t\t\t\n\t\t\t\t$quoteList[$q]['tech_status']=$this->status_array[$quote['tec_review']];\n\t\t\t\t$quoteList[$q]['seo_status']=$this->status_array[$quote['seo_review']];\n\t\t\t\t$quoteList[$q]['prod_status']=$this->status_array[$quote['prod_review']];\n\t\t\t\t$quoteList[$q]['sales_status']=$this->status_array[$quote['sales_review']];\n\t\t\t\t$quoteList[$q]['category_name']=$this->getCategoryName($quote['category']);\n\t\t\t\t$quoteList[$q]['closed_reason_txt'] = $this->closedreason[$quote['closed_reason']];\n\t\t\t\tif($quote['tech_timeline'])\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$quoteList[$q]['tech_challenge_time']=strtotime($quote['tech_timeline']);\n\t\t\t\t}\t\n\t\t\t\tif($quote['seo_timeline'])\n\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['seo_challenge_time']=strtotime($quote['seo_timeline']);\n\t\t\t\t}\n\n\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote['quote_by']);\n\t\t\t\t\n\t\t\t\tif($quote['deleted_by'])\n\t\t\t\t{\n\t\t\t\t\t$deleted_user=$client_obj->getQuoteUserDetails($quote['deleted_by']);\n\t\t\t\t\t$quoteList[$q]['deleted_user'] = $deleted_user[0]['first_name'].' '.$deleted_user[0]['last_name'];\n\t\t\t\t}\n\n\t\t\t\t$quoteList[$q]['owner']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\n\t\t\t\t$prod_team=$quote['prod_review']!='auto_skipped' ? 'Prod ': '';\n\t\t\t\t$seo_team=$quote['seo_review']!='auto_skipped' ? 'Seo ': '';\n\t\t\t\t$tech_team=$quote['tec_review']!='auto_skipped' ? 'Tech ': '';\n\n\t\t\t\t$quoteList[$q]['team']=$prod_team.$seo_team.$tech_team;\n\n\t\t\t\tif(!$quoteList[$q]['team'])\n\t\t\t\t\t$quoteList[$q]['team']='only sales';\n\n\n\t\t\t\t//turnover calculations\n\t\t\t\t/*if($quote['sales_review']=='not_done' || $quote['sales_review']=='to_be_approve' )\n\t\t\t\t{\n\t\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t\t$total_ongoing_turnover_euro +=$quote['turnover'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$total_ongoing_turnover_pound +=$quote['turnover'];\n\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\tif($quote['sales_review']=='validated')\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$validated_turnover_euro += $quote['turnover']\t;\n\t\t\t\t\telse\n\t\t\t\t\t\t$validated_turnover_pound += $quote['turnover']\t;\n\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\tif($quote['sales_review']=='signed')\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$signed_turnover_euro += $quote['turnover'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$signed_turnover_pound += $quote['turnover'];\n\t\t\t\t}*/\n\t\t\t\t//turnover calculations\n\t\t\t\t\n\t\t\t\tif($quote['sales_review']=='not_done' || $quote['sales_review']=='to_be_approve' )\n\t\t\t\t{\n\t\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t\t$total_ongoing_turnover_euro +=$quote['turnover'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$total_ongoing_turnover_pound +=$quote['turnover'];\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\tif($quote['sales_review']=='signed')\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$signed_turnover_euro += $quote['turnover'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$signed_turnover_pound += $quote['turnover'];\n\n\t\t\t\t\t$existval= $quote_obj->checkcontractexist($quote['identifier']);\n\t\t\t\t\t\n\t\t\t\t\tif(count($existval[0]['quotecontractid'])>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteList[$q]['signed_exist']=1;\n\t\t\t\t\t\t$quoteList[$q]['signed_contract']=$existval[0]['contractname'];\n\t\t\t\t\t\t$quoteList[$q]['signed_contractid']=$existval[0]['quotecontractid'];\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$quoteList[$q]['signed_exist']=0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t \n\t\t\t\t//Mean Time Quotes signature \n\t\t\t\t\n\t\t\t\tif(($quote['sales_review']=='validated' || $quote['sales_review']=='signed') && $quote['signed_at']!='')\n\t\t\t\t{\n\t\t\t\t\t\t$quotes_log=new Ep_Quote_QuotesLog();\n\t\t\t\t\t\t$quotesAction=$quotes_log->getquoteslogvalid($quote['identifier'],'sales_validated_ontime');\n\t\t\t\t\t//print_r($quotesAction);\n\t\t\t\t\t\tif($quotesAction[0]['action_at']!=\"\"){\n\t\t\t\t\t\t\t$date_difference=strtotime($quote['signed_at'])-strtotime($quotesAction[0]['action_at']);\n\t\t\t\t\t\t\t$in_day+=$date_difference/(60 * 60 * 24);\n\t\t\t\t\t\t\t$ave_count++;\n\t\t\t\t\t\t }\n\t\t\t\t\t\n } \n \n //relancer Section\n if($quote['releaceraction']!=''){\n\t\t\t\t\t $quoteList[$q]['relance_actiondate']=date(\"Y-m-d\", strtotime(\"+1 month\", strtotime($quote['releaceraction'])));\n\t\t\t\t\t} \n\t\t\t\t\t \n if($quote['quotesvalidated']!=''){\n\t\t\t\t\t $quoteList[$q]['relance_validated']=date(\"Y-m-d\", strtotime(\"+5 days\", strtotime($quote['quotesvalidated'])));\n\t\t\t\t\t} \n \n\t\t\t\t\t\n\t\t\t\tif($quoteList[$q]['version']>1)\n\t\t\t\t{\n\t\t\t\t\t$versions = $quote_obj->getQuoteVersionDetails($quote['identifier']);\n\t\t\t\t\t$quoteList[$q]['version_dates'] = \"<table class='table quote-history table-striped'>\";\n\t\t\t\t\tforeach($versions as $version):\n\t\t\t\t\t$quoteList[$q]['version_dates'] .= '<tr><td>v'.$version['version'].' - '.date('d/m/Y',strtotime($version['created_at'])).\"</td></tr>\";\n\n\t\t\t\t\tendforeach;\n\t\t\t\t\t$quoteList[$q]['version_dates'] .= '</table>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t$quoteList[$q]['version_dates'] = \"\";\n\t\t\t\t\n\t\t\t\t//relancer turnover and flag\n\t\t\t\t\tif( (($quote['sales_review']=='closed' && (date(\"Y-m-d\") > $quoteList[$q]['relance_actiondate'] || $quote['boot_customer']!=\"\") ) \n\t\t\t\t\t ||\t(time() > $quoteList[$q]['sign_expire_timeline'] && $quote['sales_review']=='validated'))\n\t\t\t\t\t && $quote['closed_reason']!= 'quote_permanently_lost')\n\t\t\t\t\t {\n\t\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$relancer_turnover_euro+=$quote['turnover'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t$relancer_turnover_pound+=$quote['turnover'];\n\t\t\t\t\t\t$quoteList[$q]['relancer_status']=1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$quoteList[$q]['relancer_status']=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t//closed quotes flag\n\t\t\t\tif( ($quote['sales_review']=='closed' && date(\"Y-m-d\") <= $quoteList[$q]['relance_actiondate'] && $quote['boot_customer']==\"\")\n\t\t\t\t || $quote['closed_reason']=='quote_permanently_lost') \n\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['closed_status']=1;\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['closed_status']=0;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//validated turnover\n\t\t\t\tif($quote['sales_review']=='validated' && time() <= $quoteList[$q]['sign_expire_timeline'])\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$validated_turnover_euro += $quote['turnover']\t;\n\t\t\t\t\telse\n\t\t\t\t\t\t$validated_turnover_pound += $quote['turnover']\t;\n\t\t\t\t\n\t\t\t\t$quoteList[$q]['validated_status']=1;\n\t\t\t\t\tif($quote['is_new_quote']==1)\n\t\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['new_quote']=1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t$quoteList[$q]['new_quote']=0;\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$quoteList[$q]['validated_status']=0;\n\t\t\t\t\tif($quote['is_new_quote']==1)\n\t\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['new_quote']=1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t$quoteList[$q]['new_quote']=0;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$q++;\n\t\t\t}\n\t\t\t$meantime_sign_days=round(abs($in_day)/$ave_count,0);\n\t\t\t//echo \"<pre>\";print_r($quoteList);exit;\n\t\t\t$this->_view->quote_list=$quoteList;\n\t\t\t$this->_view->total_ongoing_turnover_euro = $total_ongoing_turnover_euro;\n\t\t\t$this->_view->total_ongoing_turnover_pound = $total_ongoing_turnover_pound;\n\t\t\t$this->_view->validated_turnover_euro = $validated_turnover_euro;\n\t\t\t$this->_view->validated_turnover_pound = $validated_turnover_pound;\n\t\t\t$this->_view->signed_turnover_euro = $signed_turnover_euro;\n\t\t\t$this->_view->signed_turnover_pound = $signed_turnover_pound;\n\t\t\t$this->_view->relancer_turnover_euro=$relancer_turnover_euro;\n\t\t\t$this->_view->relancer_turnover_pound=$relancer_turnover_pound;\n\t\t\t$this->_view->day_difference=$meantime_sign_days;\n\n\t\t}\t\n\t\t$this->_view->quote_sent_timeline=$this->configval[\"quote_sent_timeline\"];\n\t\t$this->_view->prod_timeline=$this->configval[\"prod_timeline\"];\n\n\t\t$this->_view->techManager_holiday=$this->configval[\"tech_manager_holiday\"];\n\t\t$this->_view->seoManager_holiday=$this->configval[\"seo_manager_holiday\"];\n\n\t\t//echo \"<pre>\";print_r($quoteList);exit;\n\t\t$this->_view->closedreasons = $this->closedreason;\n\t\t$this->render('sales-quotes-list');\n\n\t\tif($listParams['file_download']=='yes' && $listParams['quote_id'])\n\t\t\theader( \"refresh:1;url=/quote/download-quote-xls?quote_id=\".$listParams['quote_id']);\n\t}", "function getDailyReport($date = null)\n{\n//SELECT COUNT(0)\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `invoice_count`,\n//`b`.`tran_date` AS `tran_date`,(\n//SELECT COUNT(`0_debtor_trans_details`.`id`)\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND\n//(`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_service_count`,(\n//SELECT SUM((`0_debtor_trans`.`ov_amount` + `0_debtor_trans`.`ov_gst`))\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_invoice_amount`,(\n//SELECT SUM(`0_debtor_trans`.`alloc`)\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_amount_recieved`,(\n//SELECT (SUM((`0_debtor_trans`.`ov_amount` + `0_debtor_trans`.`ov_gst`)) - SUM(`0_debtor_trans`.`alloc`))\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `pending_amount`,(\n//SELECT (SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`unit_price`)) -\n//SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`discount_amount`)))\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND (`0_debtor_trans`.`type` = 10) AND\n//(`0_debtor_trans`.`tran_date` = '$date'))) AS `total_service_charge`,(\n//SELECT SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`user_commission`))\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND (`0_debtor_trans`.`type` = 10) AND\n//(`0_debtor_trans`.`tran_date` = '$date'))) AS `total_commission`,(\n//SELECT SUM(ABS(`0_gl_trans`.`amount`))\n//FROM `0_gl_trans`\n//WHERE ((`0_gl_trans`.`type` = 12) AND (`0_gl_trans`.`account` = 1200) AND\n//(`b`.`tran_date` = '$date'))) AS `total_collection`\n//FROM ((`0_debtor_trans` `a`\n//JOIN `0_gl_trans` `b` ON((`a`.`trans_no` = `b`.`type_no`)))\n//JOIN `0_debtor_trans_details` `c` ON((`a`.`trans_no` = `c`.`debtor_trans_no`)))\n//WHERE ((`c`.`debtor_trans_type` = 10) AND (`a`.`type` = 10)) and `b`.`tran_date` = '$date'\n//GROUP BY `b`.`tran_date`\n//ORDER BY `b`.`tran_date`\";\n//\n//// if ($date) {\n//// $sql .= \" and tran_date='$date' \";\n//// }\n////\n//// $sql .= \" order by tran_date desc LIMIT 10\";\n//\n//\n//// print_r($sql); die;\n//\n// $result = db_query($sql, \"Transactions could not be calculated\");\n//\n// $table_html = \"\";\n//\n// $i = 0;\n//\n// while ($myrow = db_fetch($result)) {\n//\n// $class = 'class=\"oddrow\"';\n// if ($i % 2 == 0)\n// $class = 'class=\"evenrow\"';\n//\n// $table_html .= \"<tr $class>\";\n// $table_html .= \"<td>\" . $myrow['tran_date'] . \"</td>\";\n// $table_html .= \"<td style='text-align: center'>\" . $myrow['invoice_count'] . \"</td>\";\n// $table_html .= \"<td style='text-align: center'>\" . $myrow['total_service_count'] . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_service_charge'], user_price_dec()) . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_invoice_amount'], user_price_dec()) . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_collection'], user_price_dec()) . \"</td>\";\n// $table_html .= \"</tr>\";\n// $i++;\n// }\n// return $table_html;\n\n}", "public function ctrreports()\n {\n //\n $productname = Input::get('productname');\n\t \t$start_date = Input::get('start_date');\n\t\t$end_date = Input::get('end_date');\n\t $product=m_product::where('product_name',$productname)->first();\n\t \n\t \t \n $contracts=t_contract::where('product_id',$product->id)\n\t ->where('pay_date','>',$start_date)\n\t ->where('pay_date','<=',$end_date)->get();\n\t\t$productname='本周'.$productname;\t\t\t\t \n\t if($contracts->count())\n\t {\n\t \t \n\t \t$filename=$product->product_name . time();\n\t \\Excel::create($filename, function($excel) use ($productname, $contracts) {\n $excel->sheet('New sheet', function($sheet) use ($productname, $contracts) {\n $sheet->loadView('ctrreports') \n ->withProductname($productname)\n\t ->withContracts($contracts);\n\n });\n\n })->download('xls'); \n\t\t }\n\t else {\n\t\t\t\n\t\t\treturn Redirect::back()->withInput()->withErrors('本时间段此产品下无合同产生');\n\t }\n\t \n\t \n\t \n \n }", "public function getDailyStatistics()\n {\n $date = new \\DateTime();\n $date = $date->format('Y-m-d');\n\n $builder = $this->createQueryBuilder(\"a\");\n\n $builder\n ->where('a.date = :date')\n ->setParameter('date', $date);\n\n $result = $builder->getQuery()->getOneOrNullResult();\n\n return $result;\n }", "public function historics_reports()\n {\n set_time_limit(3000000);\n $params = Request::all();\n $conditions = [];\n if(!empty($params['type_transaction'])){\n $conditions['type_transaction'] = $params['type_transaction'];\n }\n if(!empty($params['date_operation'])){\n $conditions['date_operation'] = $params['date_operation'];\n }\n if(count($params) > 1){\n $accounts_historical = AccountsHistorical::where($conditions)->orderBy('id','DESC')->get();\n } else {\n $accounts_historical = AccountsHistorical::orderBy('id','DESC')->get();\n }\n $pdf = PDF::loadView('reports.historics',compact('accounts_historical'))->setOrientation('landscape')->setOption('encoding', 'utf-8')->setOption('footer-center', 'Página [page] de [topage]');\n return $pdf->stream('reports.pdf');\n }", "public function getProductStocks($product_id)\n {\n\n $store_ids = Store::where('company_id',Auth::id())->pluck('id');\n\n $stocks = Stock::with(['store','product'])->where('product_id',$product_id)->whereIn('store_id',$store_ids)->orderBy('id','desc')->get();\n\n\n return Datatables::of($stocks)\n ->addColumn('created_at', function ($stock) {\n return date('d-m-Y h:i a', strtotime($stock->created_at));\n })\n ->addColumn('store_name', function ($stock) {\n return $stock->store->name;\n })\n ->addColumn('product_name', function ($stock) {\n return $stock->product->name;\n })\n ->addColumn('stock_type', function ($stock) {\n if($stock->stock_type==1)\n return \"IN\";\n elseif($stock->stock_type==2)\n return \"OUT\";\n })\n ->addColumn('origin', function ($stock) {\n switch ($stock->origin) {\n case 1:\n return \"Add Product\";\n break;\n case 2:\n return \"Update Product\";\n break;\n case 3:\n return \"Sale\";\n break;\n case 4:\n return \"Sale Return\";\n break;\n case 5:\n return \"Adjustment\";\n break;\n default:\n return \"Add Product\";\n }\n })\n ->editColumn('id', 'ID: {{$id}}')\n ->rawColumns(['store_name', 'product_name'])\n ->make(true);\n\n }", "public function stock_report_single_item($product_id){\n\t\t$this->db->select(\"a.product_name,a.cartoon_quantity,a.price,a.product_model,sum(b.quantity) as 'totalSalesQnty',sum(c.quantity) as 'totalBuyQnty'\");\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('invoice_details b','b.product_id = a.product_id');\n\t\t$this->db->join('product_purchase_details c','c.product_id = a.product_id');\n\t\t$this->db->where(array('a.product_id'=>$product_id,'a.status'=>1,'b.status'=>1));\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_id','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "function get_acquisition_qty_by_country(){\n \n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj = new vintage_has_acquire();\n //$columns = \"DATE_FORMAT(acquire_date,'%b') as Month\";\n $columns = \" tblcountry.country, sum(trelVintageHasAcquire.qty) as qty\";\n //$group = \" trelVintageHasAcquire.acquire_id \";\n $group = \" tblcountry.country \";\n //$where = \" tblAcquire.acquire_date BETWEEN '2014-01-01' AND '2014-12-31'\";\n $sort = \" qty DESC \";\n $limit = '12';\n $rst = $obj ->get_extended($where,$columns,$group, $sort, $limit);\n \n \n if(!$rst){\n $var_result['success']=false;\n $var_result['error']=\"get_acquisition_qty_by_country() failed\";\n return $var_result;\n }\n\n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result;\n \n}", "public function index()\n\t{\n\t\t$data['item']=$this->Inventory_stock_model->getItem();\n\t\t$data['location']=$this->Inventory_stock_model->getLocation();\n\t\t$data['warehouse']=$this->Inventory_stock_model->getInventory();\n\t\t$data['total']=$this->Inventory_stock_model->total();\n\n\t\t$this->load->view('reports/inventory_stock_hand',$data);\t\n\t}", "public function stock_report_single_item($product_id){\n\t\t$this->db->select(\"a.product_name,a.price,a.product_model,sum(b.quantity) as 'totalSalesQnty',sum(c.quantity) as 'totalBuyQnty'\");\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('invoice_details b','b.product_id = a.product_id');\n\t\t$this->db->join('product_purchase_details c','c.product_id = a.product_id');\n\t\t$this->db->where(array('a.product_id'=>$product_id,'a.status'=>1,'b.status'=>1));\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_id','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function stock() {\n \n if ($this->session->userdata('validated')) {\n \n if ($this->MRecurso->validaRecurso(2)){\n\n /*Consulta Modelo para obtener listado de Productos creados*/\n $listProducts = $this->MProduct->list_products();\n /*Consulta Modelo para obtener listado de Grupos creados*/\n $listGroups = $this->MService->list_group_service();\n /*Retorna a la vista con los datos obtenidos*/\n $info['list_products'] = $listProducts;\n $info['list_groups'] = $listGroups;\n $this->load->view('products/stock',$info);\n \n } else {\n \n show_404();\n \n }\n \n } else {\n \n $this->load->view('login');\n \n }\n \n }", "public function actionIndex()\n {\n $searchModel = new StockSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function run() {\n try {\n $todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);\n \n $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('preorder_calender', array('date' => true, 'to' => $todayDate));\n $emailContent = '';\n $emailContent .= $todayDate.\"\\n\";\n echo 'Preorder-InStock process started @ '.$todayDate.' :'.\"\\n\\n\";\n echo 'Name'.\"\\t\".'SKU'.\"\\n\\n\";\n\n // Write into CSV\n $io = new Varien_Io_File();\n $path = Mage::getBaseDir('var') . DS . 'export' . DS;\n $name = md5(microtime());\n $file = $path . DS . $name . '.csv';\n $io->setAllowCreateFolders(true);\n $io->open(array('path' => $path));\n $io->streamOpen($file, 'w+');\n $io->streamLock(true);\n\n $header = array(\"Name\",\"SKU\");\n $io->streamWriteCsv($header);\n\n foreach ($products as $product) {\n $product->load();\n $data = array();\n $data[] = $product->getName();\n $data[] = $product->getSku();\n $io->streamWriteCsv($data);\n $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product->getId());\n $stock->setData('is_in_stock', 1);\n $stock->save();\n\n $product->setData('preorder_calender', null);\n $product->setData('custom_stock_status', 14);\n\n $product->save();\n $output = $product->getName().\"\\t\".$product->getSku();\n echo $output.\"\\n\";\n }\n\n // Send email with configuration in System > Configuration > Preoder Instock Updates > Receivers\n $emailTemplate = Mage::getModel('core/email_template')\n ->loadDefault('preoder_stock_email');\n\n $emailTemplate->setSenderName('Milan Direct Administrator');\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email'));\n $emailTemplate->setTemplateSubject('Preorder-InStock process started @ '.$todayDate);\n\n $emailTemplateVariables = array();\n $emailTemplateVariables['message'] = 'Preorder-InStock process finished with '.$products->count().' updated';\n $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);\n\n // Add attachment\n $emailTemplate->getMail()->createAttachment(\n file_get_contents($file),\n Zend_Mime::TYPE_OCTETSTREAM,\n Zend_Mime::DISPOSITION_ATTACHMENT,\n Zend_Mime::ENCODING_BASE64,\n 'preorder_stock_report.csv'\n );\n\n $names = array();\n $receivers = explode(\",\", Mage::getStoreConfig('notification/general/email'));\n\n foreach($receivers as $receiver)\n {\n $names[] = 'Milan Direct Staff';\n }\n\n $emailTemplate->send($receivers,$names, $emailTemplateVariables);\n\n echo 'Preorder-InStock process finished with '.$products->count().' updated'.\"\\n\";\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::log($e->getMessage(), 1, 'preorder_instock.log');\n }\n }", "public function productStocks($product_id)\n {\n $product_id = Hashids::decode($product_id)[0];\n\n $product = Product::find($product_id);\n\n return view('company.products.stock_history', compact('product'));\n }", "public function packing_station_tanker_report_abstract_print()\n\t{\t\t\n $loose_oil=$this->Common_model->get_data('loose_oil',array('status'=>1));\n $loose_oil_id=array_column($loose_oil,'loose_oil_id');\n $packing_material=$this->Common_model->get_data('packing_material',array('status'=>1));\n $packing_material_id=array_column($packing_material,'pm_id');\n $free_gift=$this->Common_model->get_data('free_gift',array('status'=>1));\n $free_gift_id=array_column($free_gift,'free_gift_id');\n $plant_id=$this->session->userdata('ses_plant_id');\n $submit=$this->input->post('search_sales', TRUE);\n $from_date=date('Y-m-d', strtotime($this->input->post('start_date',TRUE)));\n $to_date=date('Y-m-d', strtotime($this->input->post('end_date',TRUE)));\n if($submit!='')\n {\n \t$oil_results = array();\n \t$pm_results = array();\n \t$fg_results = array();\n \tforeach($loose_oil_id as $key=>$value)\n\t {\n\t \t$oil_results[$value]['loose_oil_name'] = $this->Common_model->get_value('loose_oil',array('loose_oil_id'=>$value),'name');\n\t \t$oil_results[$value]['sub_products']=$this->Packing_station_m->oil_reports($value,$from_date,$to_date);\n\t }\n\t foreach($packing_material_id as $key=>$value)\n\t {\n\t \t$pm_results[$value]['pm_name'] = $this->Common_model->get_value('packing_material',array('pm_id'=>$value),'name');\n\t \t$pm_results[$value]['sub_products']=$this->Packing_station_m->pm_reports($value,$from_date,$to_date);\n\t }\n\t foreach($free_gift_id as $key=>$value)\n\t {\n\t \t$fg_results[$value]['fg_name'] = $this->Common_model->get_value('free_gift',array('free_gift_id'=>$value),'name');\n\t \t$fg_results[$value]['sub_products']=$this->Packing_station_m->fg_reports($value,$from_date,$to_date);\n\t }\n // For emplty Truck Entry Results\n\n $empty_truck_results=$this->Packing_station_m->get_empty_truck_reports($from_date,$to_date);\n $invoice_details = array();\n foreach($empty_truck_results as $key => $value)\n {\n $tanker_id[$key]['tanker_id']=$value['tanker_id'];\n $weight_result[$key]=array();\n foreach($tanker_id as $key1=>$value1)\n {\n \n $invoice_details[$key1]=$this->Packing_station_m->get_empty_truck_invoice_details($value1);\n $invoice_id_arr = $invoice_details[$key1][0]['invoice_ids'];\n if($invoice_id_arr!='')\n {\n $single_invoice_id = $invoice_details[$key1][0]['single'];\n $result = $this->Packing_station_m->get_party_name($single_invoice_id);\n $invoice =explode(',', $invoice_id_arr);\n $total_weight = 0;\n foreach ($invoice as $key2 => $value2) \n {\n $inv_products = $this->Packing_station_m->get_invoice_products($value2);\n $sum_of_qty = 0;\n $t_pm_weight = 0;\n $t_gross = 0;\n foreach($inv_products as $keys3 =>$values3)\n { \n $sum_of_qty = $sum_of_qty + $values3['qty_in_kg'];\n $t_pm_weight = $t_pm_weight + $values3['pm_weight'];\n $t_gross = $sum_of_qty + $t_pm_weight ; \n }\n $total_weight+=$t_gross; \n\n }\n }\n else\n {\n $total_weight = '';\n }\n \n \n $invoice_details[$key1][0]['weight'] = $total_weight;\n $invoice_details[$key1][0]['agency_name']=$result;\n }\n \n \n }\n /*echo \"<pre>\";\n print_r($invoice_details); exit();*/\n $data['invoice_details']=$invoice_details;\n\t $data['oil_results']=$oil_results;\n\t $data['pm_results']=$pm_results;\n\t $data['fg_results']=$fg_results;\n\t $data['from_date']=$from_date;\n\t $data['to_date']=$to_date;\n }\n \n $data['packing_station_name']=$this->Common_model->get_value('plant',array('plant_id'=>$plant_id),'name');\n //$oil_tanker=$this->Packing_station_m->oil_reports($loose_oil_id);\n //echo \"<pre>\"; print_r($product_results); exit;\n $this->load->view('packing_station/packing_station_tanker_report_abstract_print',$data);\n\t}", "function sum_records_per_field($entries_records, $field_name, $is_stocks = FALSE)\n{\n\n $reports = [];\n\n foreach ($entries_records as $entry => $records) {\n\n $entry_loaded = node_load($entry);\n $entry_loaded_wrapper = entity_metadata_wrapper('node', $entry_loaded);\n\n // Getting the name of the indication or the product.\n $indication_or_product = $entry_loaded_wrapper->{$field_name}->value();\n if (isset($indication_or_product->name)) {\n $name = $indication_or_product->name;\n } else {\n $name = $indication_or_product[0]->name;\n }\n // If the indication is not init yet so create new array of monthes for it.\n if (!isset($reports[$name])) {\n $reports[$name] = [];\n $months = [\n 'December', 'January', 'February', 'March', 'April', 'May', 'June',\n 'July', 'August', 'September', 'October', 'November'\n ];\n foreach ($months as $month) {\n $zeros = [0, 0];\n if (!$is_stocks) {\n array_push($zeros, 0);\n }\n $reports[$name][$month] = $zeros;\n }\n }\n\n $records_loaded = entity_load(\"entry_month_record\", $records);\n\n foreach ($records_loaded as $id => $record) {\n $record_loaded_wrapper = entity_metadata_wrapper('entry_month_record', $record);\n $timestamp = $record_loaded_wrapper->field_entry_date->value();\n $date = getdate($timestamp);\n $month = $date['month'];\n if ($is_stocks) {\n if (!isset($reports[$name][$month][2])){\n array_push($reports[$name][$month], 0);\n }\n $reports[$name][$month][0] += $record_loaded_wrapper->field_stocks->value();\n $reports[$name][$month][1] += $record_loaded_wrapper->field_consumption->value();\n $usd_consumption = get_usd_consumption_per_record_id($id,'consumption');\n $reports[$name][$month][2] += (int)$usd_consumption;\n $usd_stocks = get_usd_consumption_per_record_id($id,'stocks');\n $reports[$name][$month][3] += (int)$usd_stocks;\n } else {\n $reports[$name][$month][0] += $record_loaded_wrapper->field_current_month_total->value();\n $reports[$name][$month][1] += $record_loaded_wrapper->field_current_month_new->value();\n $reports[$name][$month][2] += $record_loaded_wrapper->field_current_month_dropped->value();\n $reports[$name][$month][3] += $record_loaded_wrapper->field_current_month_dropped->value();\n }\n }\n }\n foreach ($reports as $product_name => $months){\n foreach ($months as $index => $month) {\n if (count($month) == 4) {\n if (isset($month[2])) {\n $reports[$product_name][$index][2] = number_format($month[2], 0, '','')+0;\n }\n if (isset($month[3])) {\n $reports[$product_name][$index][3] = number_format($month[3], 0, '','')+0;\n }\n }\n }\n }\n return $reports;\n}", "public function index()\n {\n $this->data->setDate(date('d-M-y'));\n $this->callView();\n\n }", "public function index()\n {\n $title = 'Dashboard - Stock';\n $stocks = StockDetail::all();\n return view('stock.index')->with(compact('stocks','title'));\n\n }", "function get_espacio_stocks_pdf()\n\t{\n\t\t$u = new Espacio_stock();\n\t\t$sql=\"select c.*, e.tag as estatus from cespacio_stocks as c left join estatus_general as e on e.id=c.estatus_general_id order by c.razon_social\";\n\t\t//Buscar en la base de datos\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function index()\n {\n $reactifs = Reactif::limit(5)->get();\n $vaccins = Vaccin::limit(5)->get();\n $echantillons = Echantillon::limit(5)->get();\n $substances = Substancespures::limit(5)->get();\n return view('stocks.index', compact('reactifs', 'vaccins', 'echantillons', 'substances'));\n }", "public function export($id)\n {\n \\App\\Configuration::updateValue('EXPORT_DECIMAL_SEPARATOR', ',');\n \n/* $stockcount = $this->stockcount\n ->with('stockcountlines')\n ->with('stockcountlines.product')\n ->findOrFail($id);\n*/\n\n $stockcount = $this->stockcount->with('warehouse')->findOrFail($id);\n $lines = $this->stockcountline\n ->select('stock_count_lines.*', 'products.id', 'products.reference', 'products.name')\n// ->with('product')\n ->where('stock_count_id', $id)\n ->join('products', 'products.id', '=', 'stock_count_lines.product_id') // Get field to order by\n ->orderBy('products.reference', 'asc')\n ->get();\n\n // Initialize the array which will be passed into the Excel generator.\n $data = []; \n\n // Define the Excel spreadsheet headers\n $data[] = [ 'product_id', 'reference', 'NOMBRE', 'quantity', 'cost_price', 'cost_average', 'last_purchase_price', 'stock_count_id', 'stock_count_NAME' ];\n // removed: , 'cost_price',\n\n // Convert each member of the returned collection into an array,\n // and append it to the payments array.\n foreach ($lines as $line) {\n // $data[] = $line->toArray();\n $data[] = [\n 'product_id' => $line->product_id,\n 'reference' => $line->reference,\n 'NOMBRE' => $line->name,\n 'quantity' => (float) $line->quantity,\n 'cost_price' => (float) $line->cost_price,\n 'cost_average' => (float) $line->cost_average,\n 'last_purchase_price' => (float) $line->last_purchase_price,\n 'stock_count_id' => $id,\n 'stock_count_NAME' => $stockcount->name,\n ];\n }\n\n $sheetName = $stockcount->warehouse->alias.' - '.$stockcount->warehouse->name;\n\n // Generate and return the spreadsheet\n Excel::create('Stock_Count_'.$id.'_'.$stockcount->warehouse->alias, function($excel) use ($id, $sheetName, $data) {\n\n // Set the spreadsheet title, creator, and description\n // $excel->setTitle('Payments');\n // $excel->setCreator('Laravel')->setCompany('WJ Gilmore, LLC');\n // $excel->setDescription('Stock Count file');\n\n // Build the spreadsheet, passing in the data array\n $excel->sheet($sheetName, function($sheet) use ($data) {\n $sheet->fromArray($data, null, 'A1', false, false);\n });\n\n })->download('xlsx');\n\n // https://www.youtube.com/watch?v=LWLN4p7Cn4E\n // https://www.youtube.com/watch?v=s-ZeszfCoEs\n }" ]
[ "0.6673559", "0.6611976", "0.64913917", "0.64118993", "0.6398449", "0.6045573", "0.5989129", "0.591034", "0.58747214", "0.5857466", "0.58574414", "0.58536905", "0.58112884", "0.58108544", "0.5806175", "0.58037215", "0.5803577", "0.5778431", "0.57490826", "0.57190955", "0.5718372", "0.5697307", "0.5688901", "0.56859416", "0.56542236", "0.5641097", "0.5631501", "0.5630337", "0.56092453", "0.5592164", "0.5592078", "0.55877954", "0.5585255", "0.5582556", "0.5577082", "0.55762935", "0.5572633", "0.5568294", "0.55680376", "0.55680376", "0.5564073", "0.555916", "0.55544543", "0.55446106", "0.5531871", "0.5526492", "0.5526492", "0.5526492", "0.5526492", "0.5526492", "0.55140316", "0.55140316", "0.55140316", "0.55133545", "0.55128354", "0.5508224", "0.5499976", "0.5495672", "0.549393", "0.5485364", "0.5482711", "0.546529", "0.5456339", "0.54556805", "0.5446717", "0.5445294", "0.54397774", "0.54388076", "0.542714", "0.5426116", "0.5425484", "0.5422915", "0.54199684", "0.5418402", "0.54112905", "0.54097754", "0.5406269", "0.54031295", "0.5394503", "0.5387043", "0.5351223", "0.5348797", "0.534617", "0.53433233", "0.5339618", "0.53383106", "0.5328824", "0.53277993", "0.5324728", "0.5320712", "0.5315613", "0.5313203", "0.5310033", "0.53076047", "0.5303179", "0.5302504", "0.52968585", "0.5296184", "0.5285955", "0.5278039" ]
0.6725458
0
Stock Report by date
public function stock_report_bydate_pos($product_id) { $purchase = $this->db->select("SUM(quantity) as totalPurchaseQnty") ->from('product_purchase_details') ->where('product_id',$product_id) ->get() ->row(); $sales = $this->db->select("SUM(quantity) as totalSalesQnty") ->from('invoice_details') ->where('product_id',$product_id) ->get() ->row(); return $stock = $purchase->totalPurchaseQnty - $sales->totalSalesQnty; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function stock_report_bydate($product_id)\n\t{\n\t\t$this->db->select(\"\n\t\t\t\tSUM(d.quantity) as 'totalSalesQnty',\n\t\t\t\tSUM(b.quantity) as 'totalPurchaseQnty',\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_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->order_by('a.product_name','asc');\n\n\t\tif(empty($product_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Single product information \n\t\t\t$this->db->where('a.product_id',$product_id);\t\n\t\t}\n\t\t$query = $this->db->get();\n\n\t\treturn $query->row();\n\t}", "public function stock_report_bydate($product_id,$date,$limit,$page)\n\t{\t\n\n\t\t$this->db->select(\"a.product_name,a.product_id,a.price,a.product_model,sum(b.sell) as 'totalSalesQnty',sum(b.Purchase) as 'totalPurchaseQnty'\");\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('stock_history b','b.product_id = a.product_id');\n\t\tif(empty($product_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1,'b.vdate <= ' => $date));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Single product information \n\t\t\t$this->db->where(array('a.status'=>1,'b.vdate <= ' => $date,'a.product_id'=>$product_id));\t\n\t\t}\n\t\t\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_id','desc');\n\t\t$this->db->limit($limit, $page);\n\t\t$query = $this->db->get();\n\n\t\t//$this->db->last_query(); //Testing purpose\n\t\treturn $query->result_array();\n\t}", "public function stock_report_bydate($product_id,$date,$limit,$page)\n\t{\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(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\tf.unit_name\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($product_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}\n\t\telse{\n\t\t\t//Single product information \n\t\t\t$this->db->where(array('a.status'=>1,'e.purchase_date <= ' => $date,'a.product_id'=>$product_id));\t\n\t\t}\n\n\t\t$this->db->limit($limit, $page);\n\t\t$query = $this->db->get();\n\n\t\treturn $query->result_array();\n\t}", "public function getStockGoods()\n {\n $reportStock = new ReportStock();\n return Collection::times(10)->map(function ($value) use ($reportStock) {\n $stock = $reportStock->getStockGoods(new Request([\n 'stock_date' => $date = Carbon::now()->subWeeks($value - 1)\n ]));\n\n return collect([\n 'date' => $date->toDateString(),\n 'stocks' => $stock->count()\n ]);\n });\n }", "public function getStock();", "public function stock_report_supplier_bydate($product_id,$supplier_id,$date,$perpage,$page){\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(b.quantity) as 'totalPrhcsCtn',\n\t\t\t\te.purchase_date as purchase_date,\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($supplier_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}else\n\t\t{\n\t\t\t$this->db->where('a.status',1);\n\t\t\t$this->db->where('e.purchase_date <=' ,$date);\n\t\t\t$this->db->where('a.supplier_id',$supplier_id);\t\n\t\t}\n\t\t$this->db->limit($perpage,$page);\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public static function stockReport()\n {\n $rawData = DB::table('rewards')\n ->selectRaw('COUNT(*) count, reward_providers.name, SUM(value) total_value, value')\n ->leftJoin('reward_providers', 'rewards.reward_provider_id', '=', 'reward_providers.id')\n ->whereNull('complaint_id')\n ->groupBy('reward_provider_id', 'value')\n ->get();\n\n return static::formatStockReportForTable($rawData);\n }", "public function stock_report_product_bydate($product_id,$supplier_id,$from_date,$to_date,$per_page,$page){\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(b.quantity) as 'totalPurchaseQnty',\n\t\t\t\te.purchase_date as date\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\t\t$this->db->limit($per_page,$page);\n\n\t\tif(empty($supplier_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}else{\n\t\t\t$this->db->where(\n\t\t\t\tarray(\n\t\t\t\t\t'a.status'=>1,\n\t\t\t\t\t'a.supplier_id'\t=>\t$supplier_id,\n\t\t\t\t\t'a.product_id'\t=>\t$product_id\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t$this->db->where('e.purchase_date >=', $from_date);\n\t\t\t$this->db->where('e.purchase_date <=', $to_date);\n\t\t}\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "function wc_marketplace_date() {\n global $wmp;\n $wmp->output_report_date();\n }", "public function getStockItem()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Stock Items (Linnworks API)');\n\t\t}", "private function trackerGrid() {\n\t\t\t\t\n\t\t$latestDays = filters\\timeFilter::getPeriodWithinRange(0, filters\\timeFilter::$daysTimeframe, $this->settingVars);\n\t\t\t\t\n\t\t$arr \t\t= array();\n\t\t$arrChart \t= array();\n\t\t$cols \t\t= array();\n\t\t\n\t\tif(isset($_REQUEST['PROMOTION']))\n\t\t{\n\t\t\tif($_REQUEST['PROMOTION'] == 'YES')\n\t\t\t{\n\t\t\t\t// filters\\timeFilter::prepareTyLyMydateRange($this->settingVars); //Total Weeks\n\t\t\t\t\n\t\t\t\t$qPart = '';\n\t\t\t\tif (isset($_REQUEST[\"FS\"]) && $_REQUEST[\"FS\"] != ''){\n\t\t\t\t\t$storeStock \t= $this->settingVars->dataArray['F18']['NAME'];\n\t\t\t\t\t$availInst \t\t= $this->settingVars->dataArray['F15']['NAME'];\n\t\t\t\t\t$depotService\t= $this->settingVars->dataArray['F14']['NAME'];\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$latestDay = filters\\timeFilter::getPeriodWithinRange(0, 1, $this->settingVars);\n\t\t\t\t\t\n\t\t\t\t\t//MAIN TABLE QUERY\t\t\t\n\t\t\t\t\t$query = \"SELECT \".$this->settingVars->maintable.\".skuID AS SKUID \" .\n\t\t\t\t\t\t\t\t\",sku AS SKU \" .\n\t\t\t\t\t\t\t\t\",\".$this->settingVars->dateField.\" AS MYDATES \" .\n\t\t\t\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectValue.\") AS SALES\" .\n\t\t\t\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectVolume.\") AS QTY\" .\n\t\t\t\t\t\t\t\t\",SUM($storeStock) AS STORESTOCK\".\n\t\t\t\t\t\t\t\t\",AVG($availInst) AS STOREINSTOCK\".\n\t\t\t\t\t\t\t\t\",AVG($depotService) AS DEPOTSERVICE\".\n\t\t\t\t\t\t\t\t\" FROM \" . $this->settingVars->tablename . $this->queryPart .\n\t\t\t\t\t\t\t\t\" AND (\" . filters\\timeFilter::$tyWeekRange . \" OR \" . filters\\timeFilter::$lyWeekRange . \") GROUP BY SKUID, SKU, MYDATES ORDER BY MYDATES ASC, SALES DESC\";\n\t\t\t\t\t//echo $query;exit;\n\t\t\t\t\t$result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\n\t\t\t\t\t\n\t\t\t\t\t$temp1\t= array();\n\t\t\t\t\t$temp2\t= array();\n\t\t\t\t\t$temp3\t= array();\n\t\t\t\t\t$temp4\t= array();\n\t\t\t\t\t$temp5\t= array();\n\t\t\t\t\t$latestDays = array_reverse($latestDays);\n\t\t\t\t\tforeach($latestDays as $lw)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif($key == 0)\n\t\t\t\t\t\t\t$cols[] \t= array('data'=>'L_'.str_replace(\"-\",\"\",$lw),'label'=>date(\"jS M Y\",strtotime($lw)));\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif (is_array($result) && !empty($result)) {\n\t\t\t\t\t\t\t$searchKey = array_search($lw,array_column($result,\"MYDATES\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($searchKey)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$value = $result[$searchKey];\n\t\t\t\t\t\t\t$temp1[\"L_\".str_replace(\"-\",\"\",$lw)]\t= (int)$value['SALES'];\n\t\t\t\t\t\t\t$temp2[\"L_\".str_replace(\"-\",\"\",$lw)]\t= (int)$value['QTY'];\n\t\t\t\t\t\t\t$temp3[\"L_\".str_replace(\"-\",\"\",$lw)]\t= (int)$value['STORESTOCK'];\n\t\t\t\t\t\t\t$account = $lw;\n\t\t\t\t\t\t\tif (in_array($account, filters\\timeFilter::$tyDaysRange)) { //$numberFrom AND $numberTo COMES HANDY HERE\n\t\t\t\t\t\t\t\t$temp4[\"L_\".str_replace(\"-\",\"\",$lw)] \t= number_format($value['STOREINSTOCK'],1, '.', '');\n\t\t\t\t\t\t\t\t$temp5[\"L_\".str_replace(\"-\",\"\",$lw)]\t= number_format($value['DEPOTSERVICE'],1, '.', '');\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$temp = array();\n\t\t\t\t\t\t\t$temp['MYDATE'] = $lw;\n\t\t\t\t\t\t\t$temp['QTY'] = (int)$value['QTY'];\n\t\t\t\t\t\t\t$temp['STORESTOCK'] = (int)$value['STORESTOCK'];\n\t\t\t\t\t\t\t$temp['STOREINSTOCK'] = number_format($value['STOREINSTOCK'],1, '.', '');\n\t\t\t\t\t\t\t$temp['DEPOTSERVICE'] = number_format($value['DEPOTSERVICE'],1, '.', '');\n\t\t\t\t\t\t\t$arrChart[] = $temp;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp1[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp2[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp3[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp4[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp5[\"L_\".str_replace(\"-\",\"\",$lw)] = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$temp = array();\n\t\t\t\t\t\t\t$temp['MYDATE'] = $lw;\n\t\t\t\t\t\t\t$temp['QTY'] = $temp['STORESTOCK'] = $temp['STOREINSTOCK'] = $temp['DEPOTSERVICE'] = 0;\n\t\t\t\t\t\t\t$arrChart[] = $temp;\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$temp1['label'] = \"SALES \".$this->settingVars->currencySign;\n\t\t\t\t\t$temp2['label'] = \"QTY\";\n\t\t\t\t\t$temp3['label'] = \"STORE STOCK\";\n\t\t\t\t\t$temp4['label'] = \"STORE INSTOCK %\";\n\t\t\t\t\t$temp5['label'] = \"DEPOT SERVICE %\";\n\t\t\t\t\t\n\t\t\t\t\t$arr[0]\t= $temp1;\t\t\t\t\n\t\t\t\t\t$arr[1]\t= $temp2;\t\t\t\t\n\t\t\t\t\t$arr[2]\t= $temp3;\t\t\t\t\n\t\t\t\t\t$arr[3]\t= $temp4;\t\t\t\t\n\t\t\t\t\t$arr[4]\t= $temp5;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfilters\\timeFilter::fetchPeriodWithinRange(0, filters\\timeFilter::$daysTimeframe, $this->settingVars); //To get $mydateRange\n\t\t\t\t\n\t\t\t\t$act = $_REQUEST['ACCOUNT'];\n\t\t\t\t$account = $this->settingVars->dataArray[$act]['NAME'];\n\t\t\t\t\n\t\t\t\t//asort($latestDays);\n\t\t\t\t\n\t\t\t\t$getLdates = array();\n\t\t\t\tforeach($latestDays as $date)\n\t\t\t\t{\t\t\t\n\t\t\t\t\t$getLdates[] = \"MAX((CASE WHEN \" . $this->settingVars->period . \"='\".$date.\"' THEN 1 ELSE 0 END)*$account) AS DATE\".str_replace(\"-\",\"\",$date);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$qPart = implode(\",\",$getLdates);\n\t\t\t\t\n\t\t\t\t//MAIN TABLE QUERY\n\t\t\t\t$query = \"SELECT \".$this->settingVars->maintable.\".skuID AS SKUID \" .\n\t\t\t\t\t\",sku AS SKU \" .\n\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectValue.\") AS SALES\" .\n\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectVolume.\") AS QTY,\" .\n\t\t\t\t\t$qPart.\n\t\t\t\t\t\" FROM \" . $this->settingVars->tablename . $this->queryPart .\n\t\t\t\t\t\" AND \" . filters\\timeFilter::$mydateRange . \" GROUP BY SKUID, SKU ORDER BY SALES DESC\";\n\t\t\t\t$result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\n\t\t\t\t\n\t\t\t\tif (is_array($result) && !empty($result)) {\n\t\t\t\t\tforeach ($result as $key => $value) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$temp \t\t\t\t= array();\n\t\t\t\t\t\t$temp['SKUID'] \t\t= $value['SKUID'];\n\t\t\t\t\t\t$temp['SKU'] \t\t= $value['SKU'];\n\t\t\t\t\t\t$temp['SALES'] \t\t= number_format($value['SALES'], 1, '.', '');\n\t\t\t\t\t\t$temp['QTY'] \t\t= number_format($value['QTY'], 1, '.', '');\n\t\t\t\t\t\tforeach($latestDays as $lw)\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($key == 0)\n\t\t\t\t\t\t\t\t$cols[] \t= array('data'=>'Tracker_L'.str_replace(\"-\",\"\",$lw),'label'=>date(\"jS M Y\",strtotime($lw)));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$temp['Tracker_L'.str_replace(\"-\",\"\",$lw)] \t= number_format($value['DATE'.str_replace(\"-\",\"\",$lw)], 1, '.', '');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$arr[] \t\t\t\t= $temp;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n $this->jsonOutput['TrackerGrid'] \t= $arr;\n $this->jsonOutput['TrackerChart'] \t= $arrChart;\n $this->jsonOutput['Tracker_L'] \t\t= $cols;\n }", "public function show_sales_review_date()\n {\n $query = $this->db->query(\"SELECT `date`,`product_id`,`type`,`weight`, SUM(`amount`) as amoun,SUM(`price`) as price FROM `sales` WHERE DATE(`date`)=CURDATE() GROUP BY `product_id`\");\n return $query->result();\n }", "function ppt_resources_get_usd_stocks($data)\n{\n// return $data;\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n//return entity_metadata_wrapper('field_collection_item', 18045);\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $reports = sum_records_per_field($entries_records, 'field_product', TRUE);\n return $reports;\n}", "function dailySales($year,$month){\n global $db;\n $sql = \"SELECT s.qty,\";\n $sql .= \" DATE_FORMAT(s.date, '%Y-%m-%e') AS date,p.name,\";\n $sql .= \"SUM(p.sale_price * s.qty) AS total_saleing_price\";\n $sql .= \" FROM sales s\";\n $sql .= \" LEFT JOIN products p ON s.product_id = p.id\";\n $sql .= \" WHERE DATE_FORMAT(s.date, '%Y-%m' ) = '{$year}-{$month}'\";\n $sql .= \" GROUP BY DATE_FORMAT( s.date, '%e' ),s.product_id\";\n return find_by_sql($sql);\n}", "public function retrieve_product_sales_report()\n\t{\n\t\t$today = date('Y-m-d');\n\t\t$this->db->select(\"a.*,b.product_name,b.product_model,c.date,c.total_amount,d.customer_name\");\n\t\t$this->db->from('invoice_details a');\n\t\t$this->db->join('product_information b','b.product_id = a.product_id');\n\t\t$this->db->join('invoice c','c.invoice_id = a.invoice_id');\n\t\t$this->db->join('customer_information d','d.customer_id = c.customer_id');\n\t\t$this->db->where('c.date',$today);\n\t\t$this->db->order_by('c.date','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "public function addData()\r\n {\r\n\r\n $this->datecreated = time();\r\n $sql = 'INSERT INTO ' . TABLE_PREFIX . 'stat_productstock (\r\n p_barcode,\r\n sd_value,\r\n sd_month,\r\n sd_year,\r\n day_1,\r\n day_2,\r\n day_3,\r\n day_4,\r\n day_5,\r\n day_6,\r\n day_7,\r\n day_8,\r\n day_9,\r\n day_10,\r\n day_11,\r\n day_12,\r\n day_13,\r\n day_14,\r\n day_15,\r\n day_16,\r\n day_17,\r\n day_18,\r\n day_19,\r\n day_20,\r\n day_21,\r\n day_22,\r\n day_23,\r\n day_24,\r\n day_25,\r\n day_26,\r\n day_27,\r\n day_28,\r\n day_29,\r\n day_30,\r\n day_31,\r\n sd_datecreated,\r\n sd_datemodified\r\n )\r\n VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';\r\n $rowCount = $this->db3->query($sql, array(\r\n (string)$this->pbarcode,\r\n (string)$this->value,\r\n (int)$this->month,\r\n (int)$this->year,\r\n (string)$this->day_1,\r\n (string)$this->day_2,\r\n (string)$this->day_3,\r\n (string)$this->day_4,\r\n (string)$this->day_5,\r\n (string)$this->day_6,\r\n (string)$this->day_7,\r\n (string)$this->day_8,\r\n (string)$this->day_9,\r\n (string)$this->day_10,\r\n (string)$this->day_11,\r\n (string)$this->day_12,\r\n (string)$this->day_13,\r\n (string)$this->day_14,\r\n (string)$this->day_15,\r\n (string)$this->day_16,\r\n (string)$this->day_17,\r\n (string)$this->day_18,\r\n (string)$this->day_19,\r\n (string)$this->day_20,\r\n (string)$this->day_21,\r\n (string)$this->day_22,\r\n (string)$this->day_23,\r\n (string)$this->day_24,\r\n (string)$this->day_25,\r\n (string)$this->day_26,\r\n (string)$this->day_27,\r\n (string)$this->day_28,\r\n (string)$this->day_29,\r\n (string)$this->day_30,\r\n (string)$this->day_31,\r\n (int)$this->datecreated,\r\n (int)$this->datemodified\r\n ))->rowCount();\r\n\r\n $this->id = $this->db3->lastInsertId();\r\n return $this->id;\r\n }", "protected function getDailySummary()\n {\n $strBuffer = '\n<fieldset class=\"tl_tbox\">\n<legend style=\"cursor: default;\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['24h_summary'] . '</legend>\n<div class=\"daily_summary\">';\n\n $arrAllowedProducts = \\Isotope\\Backend\\Product\\Permission::getAllowedIds();\n\n $objOrders = Database::getInstance()->prepare(\"\n SELECT\n c.id AS config_id,\n c.name AS config_name,\n c.currency,\n COUNT(DISTINCT o.id) AS total_orders,\n SUM(i.tax_free_price * i.quantity) AS total_sales,\n SUM(i.quantity) AS total_items\n FROM tl_iso_product_collection o\n LEFT JOIN tl_iso_product_collection_item i ON o.id=i.pid\n LEFT OUTER JOIN tl_iso_config c ON o.config_id=c.id\n WHERE o.type='order' AND o.order_status>0 AND o.locked>=?\n \" . Report::getProductProcedure('i', 'product_id') . \"\n \" . Report::getConfigProcedure('o', 'config_id') . \"\n GROUP BY config_id\n \")->execute(strtotime('-24 hours'));\n\n if (!$objOrders->numRows) {\n\n $strBuffer .= '\n<p class=\"tl_info\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['24h_empty'] . '</p>';\n\n } else {\n\n $i = -1;\n $strBuffer .= '\n<div class=\"tl_listing_container list_view\">\n <table class=\"tl_listing\">\n <tr>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['shop_config'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['currency'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['orders#'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['products#'] . '</th>\n <th class=\"tl_folder_tlist\">' . $GLOBALS['TL_LANG']['ISO_REPORT']['sales#'] . '</th>\n </tr>';\n\n\n while ($objOrders->next())\n {\n $strBuffer .= '\n <tr class=\"row_' . ++$i . ($i%2 ? 'odd' : 'even') . '\">\n <td class=\"tl_file_list\">' . $objOrders->config_name . '</td>\n <td class=\"tl_file_list\">' . $objOrders->currency . '</td>\n <td class=\"tl_file_list\">' . $objOrders->total_orders . '</td>\n <td class=\"tl_file_list\">' . $objOrders->total_items . '</td>\n <td class=\"tl_file_list\">' . Isotope::formatPrice($objOrders->total_sales) . '</td>\n </tr>';\n }\n\n $strBuffer .= '\n </table>\n</div>';\n }\n\n\n $strBuffer .= '\n</div>\n</fieldset>';\n\n return $strBuffer;\n }", "public function table()\n {\n return \"stocks\";\n }", "public function create()\n {\n return view('log_stocks.create');\n }", "public function stock_report_variant_bydate($from_date,$to_date,$store_id,$perpage,$page){\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(b.quantity) as totalPrhcsCtn,\n\t\t\t\te.purchase_date as purchase_date,\n\t\t\t\tg.variant_name,\n\t\t\t\tg.variant_id,\n\t\t\t\th.store_name,\n\t\t\t\th.store_id,\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->group_by('g.variant_id');\n\t\t$this->db->group_by('h.store_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($from_date))\n\t\t{\n\t\t\t$this->db->where('a.status',1);\n\t\t}else\n\t\t{\n\t\t\t$this->db->where('a.status',1);\n\t\t\t$this->db->where('e.purchase_date >=', $from_date);\n\t\t\t$this->db->where('e.purchase_date <=', $to_date);\n\t\t\t$this->db->where('b.store_id',$store_id);\n\t\t}\n\t\t$this->db->limit($perpage,$page);\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function dailyReport()\n {\n return view('backend.invoice.daily-invoice-report');\n }", "public function prodreports()\n {\n //\n $productname = Input::get('productname');\n\t \t$start_date = Input::get('start_date');\n\t\t$end_date = Input::get('end_date');\n\t $product=m_product::where('product_name',$productname)->first();\n\t \n\t \t \n $lastWeek = Carbon::now()->startOfWeek();\n\t $nowdate = Carbon::now(); \n\t $contracts=t_contract::where('product_id',$product->id)\n\t ->where('pay_date','>',$start_date)\n\t ->where('pay_date','<=',$end_date)->get();\n\t if($contracts->count())\n\t {\n\t \t \n\t \t$filename=$product->product_id+time();\n\t \\Excel::create($filename, function($excel) use ($productname, $contracts) {\n $excel->sheet('New sheet', function($sheet) use ($productname, $contracts) {\n $sheet->loadView('pdreport') \n ->withProductname($productname)\n\t ->withContracts($contracts);\n\n });\n\n })->download('xls'); \n\t\t }\n\t else {\n\t\t\t\n\t\t\treturn Redirect::back()->withInput()->withErrors('本是时间段此产品下无合同产生');\n\t }\n\t \n\t \n\t \n \n }", "public function stock_history(){\n\t\treturn $stock_info = $this->db->select('*')\n\t\t ->from('store')\n\t\t ->where('isactive',1)\n\t\t ->get()\n\t\t ->result();\n\t}", "public function stock_report_variant_bydate_count($from_date,$to_date,$store_id)\n\t{\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(b.quantity) as 'totalPrhcsCtn',\n\t\t\t\te.purchase_date as purchase_date,\n\t\t\t\tg.variant_name,\n\t\t\t\tg.variant_id,\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->group_by('g.variant_id');\n\t\t$this->db->group_by('h.store_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($store_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}else\n\t\t{\n\t\t\t$this->db->where('a.status',1);\n\t\t\t$this->db->where('e.purchase_date >=', $from_date);\n\t\t\t$this->db->where('e.purchase_date <=', $to_date);\n\t\t\t$this->db->where('b.store_id',$store_id);\t\n\t\t}\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}", "function sales_report_day($date){\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);\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 index(){\n $data = $this->Excel_model->get_stocks();\n \n \n $template = 'Myexcel.csv';\n //set absolute path to directory with template files\n $templateDir = __DIR__ . \"/../controllers/\";\n \n //set config for report\n $config = array(\n 'template' => $template,\n 'templateDir' => $templateDir\n );\n \n \n //load template\n $R = new PHPReport($config);\n \n $R->load(array(\n 'NEWS_ID' => 'news_paper',\n 'repeat' => TRUE,\n 'data' => $data \n )\n );\n \n // define output directoy \n $output_file_dir = \"/tmp/\";\n \n \n $output_file_excel = $output_file_dir . \"Myexcel.csv\";\n //download excel sheet with data in /tmp folder\n $result = $R->render('excel', $output_file_excel);\n }", "public function actionIndex()\n {\n if(empty($ordersMonth)){\n $begin = new \\DateTime( date('Y-m-d h:i:s').' -3 weeks' );\n $end = new \\DateTime( date('Y-m-d h:i:s').' +1 day' );\n } else {\n $begin = new \\DateTime( date($ordersMonth.'-01 h:i:s') );\n $end = new \\DateTime( date($ordersMonth.'-t h:i:s'));\n }\n\n $interval = \\DateInterval::createFromDateString('1 day');\n $period = new \\DatePeriod($begin, $interval, $end);\n $orderStats = [];\n foreach ( $period as $dt ){\n $beginOfDay = $dt->setTime(0,0,1)->format( \"Y-m-d H:i:s\\n\" );\n $endOfDay = $dt->setTime(23,59,59)->format( \"Y-m-d H:i:s\\n\" );\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['all'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['done'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>5])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['cancelled'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>1])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['new'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>3])->sum('order_amount');\n }\n\n return $this->render('index', ['orderStats'=>$orderStats, 'begin'=>$begin->format( \"Y-m-d H:i:s\\n\" ), 'end'=>$end->format( \"Y-m-d H:i:s\\n\" )]);\n }", "public function stock_report_product_bydate_count($product_id,$supplier_id,$from_date,$to_date){\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(b.quantity) as 'totalPurchaseQnty',\n\t\t\t\te.purchase_date as date\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($supplier_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}else{\n\t\t\t$this->db->where(\n\t\t\t\tarray(\n\t\t\t\t\t'a.status'=>1,\n\t\t\t\t\t'a.supplier_id'\t=>\t$supplier_id,\n\t\t\t\t\t'a.product_id'\t=>\t$product_id\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t$this->db->where('e.purchase_date >=', $from_date);\n\t\t\t$this->db->where('e.purchase_date <=', $to_date);\n\t\t}\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}", "public function getBlock()\n\t{\n\t\t$chart = new \\IPS\\Helpers\\Chart;\n\t\t\n\t\t$chart->addHeader( \"Day\", 'date' );\n\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t{\n\t\t\t$chart->addHeader( $currency, 'number' );\n\t\t}\n\t\t\n\t\t$thirtyDaysAgo = \\IPS\\DateTime::create()->sub( new \\DateInterval('P30D') );\n\t\t\t\t\n\t\t$results = array();\n\t\tforeach( \\IPS\\Db::i()->select( \"t_currency, DATE_FORMAT( FROM_UNIXTIME( t_date ), '%e %c %Y' ) AS date, SUM(t_amount)-SUM(t_partial_refund) AS amount\", 'nexus_transactions', array( 't_date>? AND (t_status=? OR t_status=?)', $thirtyDaysAgo->getTimestamp(), \\IPS\\nexus\\Transaction::STATUS_PAID, \\IPS\\nexus\\Transaction::STATUS_PART_REFUNDED ), NULL, NULL, array( 't_currency', 'date' ) ) as $result )\n\t\t{\n\t\t\t$results[ $result['date'] ][ $result['t_currency'] ] = $result['amount'];\n\t\t}\n\t\t\t\t\n\t\t$monthAndYear = date( 'n' ) . ' ' . date( 'Y' );\n\t\tforeach ( range( 30, 0 ) as $daysAgo )\n\t\t{\n\t\t\t$datetime = new \\IPS\\DateTime;\n\t\t\t$datetime->setTime( 0, 0, 0 );\n\t\t\t$datetime->sub( new \\DateInterval( 'P' . $daysAgo . 'D' ) );\n\t\t\t$resultString = $datetime->format('j n Y');\n\t\t\t\n\t\t\tif ( isset( $results[ $resultString ] ) )\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\t\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\tif ( !isset( $results[ $resultString ][ $currency ] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = 0;\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$row[] = $results[ $resultString ][ $currency ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\t$row[] = 0;\n\t\t\t\t}\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $chart->render( 'LineChart' );\n\t}", "public function newstock()\n {\n for ($i=0; $i<=6; $i++) {\n for ($j=0; $j<=$i; $j++) {\n $stock[] = [$i,$j];\n }\n }\n $this->stock = $stock;\n }", "public function getData($id)\r\n {\r\n $id = (int)$id;\r\n $sql = 'SELECT * FROM ' . TABLE_PREFIX . 'stat_productstock sp\r\n WHERE sp.sd_id = ?';\r\n $row = $this->db3->query($sql, array($id))->fetch();\r\n\r\n $this->pbarcode = $row['p_barcode'];\r\n $this->id = $row['sd_id'];\r\n $this->value = $row['sd_value'];\r\n $this->month = $row['sd_month'];\r\n $this->year = $row['sd_year'];\r\n $this->day_1 = $row['day_1'];\r\n $this->day_2 = $row['day_2'];\r\n $this->day_3 = $row['day_3'];\r\n $this->day_4 = $row['day_4'];\r\n $this->day_5 = $row['day_5'];\r\n $this->day_6 = $row['day_6'];\r\n $this->day_7 = $row['day_7'];\r\n $this->day_8 = $row['day_8'];\r\n $this->day_9 = $row['day_9'];\r\n $this->day_10 = $row['day_10'];\r\n $this->day_11 = $row['day_11'];\r\n $this->day_12 = $row['day_12'];\r\n $this->day_13 = $row['day_13'];\r\n $this->day_14 = $row['day_14'];\r\n $this->day_15 = $row['day_15'];\r\n $this->day_16 = $row['day_16'];\r\n $this->day_17 = $row['day_17'];\r\n $this->day_18 = $row['day_18'];\r\n $this->day_19 = $row['day_19'];\r\n $this->day_20 = $row['day_20'];\r\n $this->day_21 = $row['day_21'];\r\n $this->day_22 = $row['day_22'];\r\n $this->day_23 = $row['day_23'];\r\n $this->day_24 = $row['day_24'];\r\n $this->day_25 = $row['day_25'];\r\n $this->day_26 = $row['day_26'];\r\n $this->day_27 = $row['day_27'];\r\n $this->day_28 = $row['day_28'];\r\n $this->day_29 = $row['day_29'];\r\n $this->day_30 = $row['day_30'];\r\n $this->day_31 = $row['day_31'];\r\n $this->datecreated = $row['sd_datecreated'];\r\n $this->datemodified = $row['sd_datemodified'];\r\n\r\n }", "public function run()\n {\n $linenstock = [\n \t[\n 'id' => '1',\n 'items' => 'Sheets (Dbl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '2',\n 'items' => 'Sheets (Sgl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '3',\n 'items' => 'Pillow case',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '4',\n 'items' => 'Bath towels',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '5',\n 'items' => 'Hand towels',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '6',\n 'items' => 'Face towels',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '7',\n 'items' => 'Bath mat',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '8',\n 'items' => 'Blankets (Dbl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '9',\n 'items' => 'Blankets (Sgl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '10',\n 'items' => 'Bed cover (Dbl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ],\n [\n 'id' => '11',\n 'items' => 'Bed cover(Sgl)',\n 'stock' => '',\n 'new' => '',\n 'total1' => '',\n 'less' => '',\n 'total2' => '',\n 'actual' => '',\n 'discrepancies' => '',\n ] \n ];\n Linenstock::insert($linenstock);\n }", "public function index(Request $request)\n {\n $title = 'Kartu Stok';\n $fromDate = Date('Y-m-01');\n $toDate = Date('Y-m-d H:i:s');\n if(!is_null($request->fromDate) && !is_null($request->toDate)) {\n $fromDate = $request->fromDate;\n $toDate = $request->toDate;\n if(strtotime($fromDate) > strtotime($toDate)) {\n $temp = $fromDate;\n $fromDate = $toDate;\n $toDate = $temp;\n }\n }\n if($request->outlet == 0) {\n $products = json_decode(Products::selectRaw('CONCAT(products.title, \" \", product_variation.title) as title')->addSelect('product_variation.product_variation_id')->addSelect('unit.name as unit')->addSelect('product_variation.stock as lastStock')->join('product_variation_relation', 'product_variation_relation.product_id', 'products.product_id')->join('product_variation', 'product_variation.product_variation_id','product_variation_relation.product_variation_id')->join('unit', 'unit.unit_id', 'products.unit')->get(), true);\n } else {\n $products = json_decode(Products::selectRaw('CONCAT(products.title, \" \", product_variation.title) as title')->addSelect('product_variation.product_variation_id')->addSelect('unit.name as unit')->addSelect('stock_outlet.stock as lastStock')->join('product_variation_relation', 'product_variation_relation.product_id', 'products.product_id')->join('product_variation', 'product_variation.product_variation_id','product_variation_relation.product_variation_id')->join('unit', 'unit.unit_id', 'products.unit')->join('stock_outlet', 'stock_outlet.product_variation_id', 'product_variation.product_variation_id')->where('stock_outlet.outlet_id', $request->outlet)->get(), true);\n }\n $options = []; $opnameTemp = [];\n foreach($products as $product) {\n if($request->outlet == 0) {\n $options[] = json_decode(StockCards::select('product_stock.quantity')->addSelect('type_stock.type_stock_id')->addSelect('type_stock.name as type')->addSelect('transfer_stock_outlet.byOutlet_id')->addSelect('product_variation.product_variation_id')->addSelect('transfer_stock_outlet.toOutlet_id')->join('transfer_stock_outlet', 'transfer_stock_outlet.transfer_stock_outlet_id', 'stock_cards.transfer_stock_outlet_id')->join('product_stock', 'product_stock.stock_card_id', 'stock_cards.stock_card_id')->join('type_stock', 'type_stock.type_stock_id', 'stock_cards.type_stock_id')->join('product_variation', 'product_variation.product_variation_id', 'product_stock.product_variation_id')->where('product_stock.product_variation_id', $product['product_variation_id'])->whereBetween('stock_cards.created_at', [$fromDate, $toDate . ' 23:59:59'])->orderBy('stock_cards.created_at', 'desc')->get(), true);\n } else {\n $options[] = json_decode(StockCards::select('product_stock.quantity')->addSelect('type_stock.type_stock_id')->addSelect('type_stock.name as type')->addSelect('transfer_stock_outlet.byOutlet_id')->addSelect('product_variation.product_variation_id')->addSelect('transfer_stock_outlet.toOutlet_id')->join('transfer_stock_outlet', 'transfer_stock_outlet.transfer_stock_outlet_id', 'stock_cards.transfer_stock_outlet_id')->join('product_stock', 'product_stock.stock_card_id', 'stock_cards.stock_card_id')->join('type_stock', 'type_stock.type_stock_id', 'stock_cards.type_stock_id')->join('product_variation', 'product_variation.product_variation_id', 'product_stock.product_variation_id')->where('product_stock.product_variation_id', $product['product_variation_id'])->whereBetween('stock_cards.created_at', [$fromDate, $toDate . ' 23:59:59'])->where(function($query) use ($request) { $query->where('transfer_stock_outlet.toOutlet_id', $request->outlet)->orWhere('transfer_stock_outlet.byOutlet_id', $request->outlet); })->orderBy('stock_cards.created_at', 'desc')->get(), true);\n }\n\n $opnameTemp[] = json_decode(StockOpname::select('product_opname.deviation')->addSelect('stock_opname_relation.product_variation_id')->addSelect('stock_opname.outlet_id')->join('stock_opname_relation', 'stock_opname_relation.stock_opname_id', 'stock_opname.stock_opname_id')->join('product_opname','product_opname.product_opname_id', 'stock_opname_relation.product_opname_id')->where('stock_opname_relation.product_variation_id', $product['product_variation_id'])->get(), true);\n }\n // dd($products, $options, $opnameTemp);\n\n $typeStock = TypeStock::select('type_stock_id')->addSelect('name')->get();\n for($i=0;$i < count($products); $i++) {\n $temp = ['in' => 0, 'out' => 0, 'transfer' => 0, 'opname' => 0];\n for($j=0;$j < count($options[$i]); $j++) {\n if(intval($options[$i][$j]['type_stock_id']) === 1) {\n $temp['in'] += $options[$i][$j]['quantity'];\n }\n if(intval($options[$i][$j]['type_stock_id']) === 2) {\n $temp['out'] += $options[$i][$j]['quantity'];\n }\n if(intval($options[$i][$j]['type_stock_id']) === 3) {\n if($request->outlet === 0) {\n $temp['transfer'] += 0;\n } else {\n if($options[$i][$j]['byOutlet_id'] == $request->outlet) {\n $temp['transfer'] += (intval($options[$i][$j]['quantity'])* -1);\n } else if($options[$i][$j]['toOutlet_id'] == $request->outlet) {\n $temp['transfer'] += (intval($options[$i][$j]['quantity']));\n } else {\n $temp['transfer'] += 0;\n }\n }\n }\n }\n for($j=0;$j < count($opnameTemp[$i]); $j++) {\n $temp['opname'] += $opnameTemp[$i][$j]['deviation'];\n }\n $products[$i]['option'] = $temp;\n }\n for($i=0;$i < count($products); $i++) {\n $temp = (($products[$i]['lastStock'] + ($products[$i]['option']['opname'] * -1) + ($products[$i]['option']['transfer'] * -1) - $products[$i]['option']['out'] - $products[$i]['option']['in']));\n $products[$i]['option']['first'] = ($temp > 0) ? $temp : 0;\n $products[$i]['option']['sales'] = 0;\n }\n // dd($products);\n $outlets = Outlet::select('outlet.name')->addSelect('outlet.outlet_id')->get();\n $categories = Category::select('category_id')->addSelect('title')->get();\n $toDate = (!is_null($request->toDate)) ? $toDate : Date('Y-m-d');\n $outletID = ($request->outlet) ? $request->outlet : 0;\n return view('StockCard', compact('title', 'fromDate', 'toDate', 'outlets', 'categories', 'products', 'outletID'));\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 index()\n {\n return view('admin.stock.stock');\n }", "public function index()\n {\n return Stock::get();\n }", "public function getquickReturnReport()\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 Return Date Orders';\n $parameter['orders'] = Order::where('to','=', $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 Return Date Orders.pdf');\n\t\t\n\t}", "function wc_marketplace_date2() {\n global $wmp;\n $wmp->output_report_date2();\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getSalesReport($month,$day,$year,$fromTime_hour,$fromTime_minutes,$fromTime_seconds,$toTime_hour,$toTime_minutes,$toTime_seconds,$username,$module) {\n\necho \"\n<style type='text/css'>\ntr:hover { background-color:yellow; color:black;}\na { text-decoration:none; color:black; }\n</style>\";\n\n$dateSelected = $month.\"_\".$day.\"_\".$year;\n$fromTimez = $fromTime_hour.\":\".$fromTime_minutes.\":\".$fromTime_seconds;\n$toTimez = $toTime_hour.\":\".$toTime_minutes.\":\".$toTime_seconds;\n\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT upper(pr.completeName) as completeName,pc.description,pc.sellingPrice,pc.quantity,pc.discount,pc.total,pc.cashUnpaid,pc.cashPaid,pc.chargeBy FROM patientRecord pr,registrationDetails rd,patientCharges pc WHERE pr.patientNo = rd.patientNo and rd.registrationNo = pc.registrationNo and pc.dateCharge = '$dateSelected' and (pc.timeCharge between '$fromTimez' and '$toTimez') and title='$module' group by pc.itemNo order by completeName asc \");\n\necho \"<table border=1 cellpadding=0 cellspacing=0>\";\necho \"<tr>\";\necho \"<th>&nbsp;Name&nbsp;</th>\";\necho \"<th>&nbsp;Description&nbsp;</th>\";\necho \"<th>&nbsp;Price&nbsp;</th>\";\necho \"<th>&nbsp;QTY&nbsp;</th>\";\necho \"<th>&nbsp;Disc&nbsp;</th>\";\necho \"<th>&nbsp;Total&nbsp;</th>\";\necho \"<th>&nbsp;Unpaid&nbsp;</th>\";\necho \"<th>&nbsp;Paid&nbsp;</th>\";\necho \"<th>&nbsp;Charge By&nbsp;</th>\";\necho \"</tr>\";\n$this->sales_total=0;\n$this->sales_unpaid=0;\n$this->sales_paid=0;\nwhile($row = mysqli_fetch_array($result))\n {\necho \"<tr>\";\necho \"<td>&nbsp;\".$row['completeName'].\"&nbsp;</td>\";\necho \"<td>&nbsp;\".$row['description'].\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['sellingPrice'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['quantity'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['discount'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['total'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['cashUnpaid'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['cashPaid'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".$row['chargeBy'].\"&nbsp;</td>\";\n$this->sales_total+=$row['total'];\n$this->sales_paid+=$row['cashPaid'];\n$this->sales_unpaid+=$row['cashUnpaid'];\necho \"</tr>\";\n }\necho \"</table>\";\necho \"<br>Total Sales:&nbsp;\".$this->sales_total;\necho \"<br>Total Unpaid:&nbsp;\".$this->sales_unpaid;\necho \"<br>Total Paid&nbsp;\".$this->sales_paid;\n\n}", "function quantizer_expenses_general_report($start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerGeneralExpenses($start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "public function index()\n {\n return JournalEntry::currentReport()->orderByDesc('created_at')->get();\n }", "public function orderReport()\n {\n // gunakan startofmonth utk mengambil tanggal 1\n $start = Carbon::now()->startOfMonth()->format('Y-m-d H:i:s');\n //endofmonth untuk mengambil tanggal terakhir dibulan yg berlaku saat ini\n $end = Carbon::now()->endOfMonth()->format('Y-m-d H:i:s');\n //jika user melakukan filter manual, maka parameter date akan terisi\n if(request()->date !=''){\n //maka formating tglnya berdasarkan filter user\n $date = explode(' - ',request()->date);\n $start = Carbon::parse($date[0])->format('Y-m-d'). ' 00:00:01';\n $end = Carbon::parse($date[1])->format('Y-m-d'). ' 23:59:59';\n }\n //dibuat query utk DB menggunakan wherebetween from tgl filter\n $orders = Order::with(['customer.district'])->whereBetween('created_at', [$start, $end])->get();\n return view('report.order',compact('orders'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $stocks = $em->getRepository('IschaBackOfficeBundle:Stock')->findAll();\n\n return $this->render('stock/index.html.twig', array(\n 'stocks' => $stocks,\n ));\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 show(Stock $stock)\n {\n //\n }", "public function show(Stock $stock)\n {\n //\n }", "public function show(Stock $stock)\n {\n //\n }", "public function index()\n {\n $sbus = Sbu::all();\n $items = Item::all();\n $report = null;\n return view('add-stock.index', compact('report','sbus','items'));\n }", "public function index(LogStockDataTable $logStockDataTable)\n {\n return $logStockDataTable->render('log_stocks.index');\n }", "function reportOpenedResultsPerDay($ReportCondition = '1')\r\n{\r\n return reportPerDBColoumn('ResultInfo', \"DATE_FORMAT(OpenedDate, '%y-%m-%d')\", $ReportCondition, '', 'OpenedDate ASC');\r\n}", "function get_acquisition_value(){\n\n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj = new vintage_has_acquire();\n //$columns = \"DATE_FORMAT(acquire_date,'%b') as Month\";\n $columns = \"DATE_FORMAT(tblAcquire.acquire_date,'%b') as month, sum(trelVintageHasAcquire.total_price) as total\";\n //$group = \" trelVintageHasAcquire.acquire_id \";\n $group = \" Month \";\n $where = \" tblAcquire.acquire_date BETWEEN '2014-01-01' AND '2014-12-31'\";\n $sort = \" acquire_date ASC \";\n $rst = $obj ->get_extended($where,$columns,$group, $sort);\n \n \n if(!$rst){\n $var_result['success']=false;\n $var_result['error']=\"acquisition report failed\";\n return $var_result;\n }\n\n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result;\n\n}", "public function show_buy_review_by_date($date_from,$date_to)\n {\n $query = $this->db->query(\"SELECT `date`,GROUP_CONCAT(`product_id`) as product_id, GROUP_CONCAT(`type`) as type,GROUP_CONCAT(`weight`) as weight, GROUP_CONCAT(`instock`) as instock ,GROUP_CONCAT(`paid`) as paid,GROUP_CONCAT(`due`) as due, GROUP_CONCAT(`price`) as price,SUM(`price`) as tp FROM `purchase` WHERE DATE(`date`) BETWEEN STR_TO_DATE('$date_from', '%Y-%m-%d') AND STR_TO_DATE('$date_to', '%Y-%m-%d') GROUP BY `date` \");\n return $query->result();\n }", "function test($firstDate, $secondDate, $dayOfWeek) {\r\n file_get_contents('https://jsonmock.hackerrank.com/api/stocks');\r\n\r\n $theResponse = file_get_contents('https://jsonmock.hackerrank.com/api/stocks'); \r\n \r\n $response = json_decode($theResponse,true);\r\n $total_pages = $response['total_pages'];\r\n $firstDay = strtotime($firstDate);\r\n $lastDay = strtotime($secondDate);\r\n $output = [];\r\n \r\n\r\n for($i = 1; $i <= $total_pages; $i++){\r\n $topPageResponse = json_decode(file_get_contents('https://jsonmock.hackerrank.com/api/stocks/?page='.$i.''), true);\r\n\r\n for($j = 0; $j < count($topPageResponse['data']); $j++){\r\n $foundDate = strtotime($topPageResponse['data'][$j]['date']);\r\n $dayOW = date(\"l\", strtotime($topPageResponse['data'][$j]['date']));\r\n if( $foundDate >= $firstDay && $foundDate <= $lastDay && $dayOW == $dayOfWeek){\r\n $output[] = ' '.$topPageResponse['data'][$j]['date'].' '\r\n .$topPageResponse['data'][$j]['open'] .' '\r\n .$topPageResponse['data'][$j]['close'] .'';\r\n }\r\n }\r\n\r\n }\r\n\r\n foreach($output as $item){\r\n echo \"$item\\r\\n\";\r\n };\r\n}", "private function getStatistik() {\n $SHOW_DAYS = 365;\n self::$today = new DateTime();\n $resultHtml = \"\";\n\n // Jetzt Berechnungen pro Budget:\n $budgets = Persistence::getInstances(\"BUD\", \"name\", false);\n $werte = array();\n $jahre = array();\n $budgetNames = array();\n $budgetAmount = array();\n foreach ($budgets as $budget) {\n $budgetName = $budget->getProperty(\"name\", \"unbekannt\");\n $budgetNames[\"\" . $budgetName] = \"$budgetName\";\n $budgetZeitraum = $budget->getProperty(\"zeitraum\", \"\") == \"\" ? \"\" : \" \" . $budget->getProperty(\"zeitraum\", \"\");\n $budgetAmount[\"\" . $budgetName] = $budget->getProperty(\"btotal\", \"\") . $budgetZeitraum;\n if (!isset($werte[\"$budgetName\"])) {\n $werte[\"$budgetName\"] = array();\n }\n $instances = Persistence::getInstances(\"ARB\", \"datum\", false, $budget->getId(), true);\n $resultData = array();\n foreach ($instances as $instance) {\n $h = $instance->getProperty(ARB::PROPERTY_STUNDEN, 0);\n $kaz = $instance->getProperty(ARB::PROPERTY_KAZ, 0);\n list($tag, $monat, $jahr) = explode(\".\", $instance->getProperty(ARB::PROPERTY_DATUM, \"01.01.1800\"));\n if ($jahr >= \"2017\") {\n $jahre[\"\" . $jahr] = \"\" . \"$jahr\";\n if (!isset($werte[\"$budgetName\"][\"\" . $jahr])) {\n $werte[\"$budgetName\"][\"\" . $jahr][\"Jahr\"] = 0;\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"] = array();\n }\n if (!isset($werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat])) {\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat] = 0;\n }\n $wert = $kaz != \"\" && $h != \"\" ? ($kaz > $h ? $kaz : $h) : ($kaz != \"\" ? $kaz : ($h != \"\" ? $h : 0));\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat] += $wert;\n $werte[\"$budgetName\"][\"\" . $jahr][\"Jahr\"] += $wert;\n }\n }\n }\n ksort($jahre);\n $monatWerte = array();\n $jahresWerte = array();\n foreach ($budgetNames as $budgetName) {\n $budgetWert[$budgetName] = array();\n foreach ($jahre as $jahr) {\n foreach (array(\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\") as $monat) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n if (!self::isOlder($jahr, $monat, $SHOW_DAYS)) {\n $monatWerte[$budgetName][$jahr . \"\"][\"\" . $monat] = 0;\n }\n }\n $jahresWerte[$budgetName][$jahr . \"\"] = 0;\n }\n }\n foreach ($werte as $budgetName => $jahrWerte) {\n foreach ($jahrWerte as $jahr => $jahrUndMonatWerte) {\n $jahresWerte[$budgetName][$jahr . \"\"] = $jahrUndMonatWerte[\"Jahr\"];\n foreach ($jahrUndMonatWerte[\"monate\"] as $monat => $wert) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n if (!self::isOlder($jahr, $monat, $SHOW_DAYS)) {\n $monatWerte[$budgetName][\"\" . $jahr][\"\" . $monat] = $wert;\n }\n }\n }\n }\n\n // Summen über alle ARB Instanzen berechnen (Budget unabhaengig, da ARB Instanzen\n // mehreren Budgets gleichzeitig zugeordnet sein koennen\n $monatSumme = array();\n $jahrSumme = array();\n foreach ($jahre as $jahr) {\n foreach (array(\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\") as $monat) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n $monatSumme[\"$jahr-$monat\"] = 0;\n }\n $jahrSumme[\"$jahr\"] = 0;\n }\n $arbInstances = Persistence::getInstances(\"ARB\", \"datum\", false, \"\", true);\n foreach ($arbInstances as $instance) {\n $h = $instance->getProperty(ARB::PROPERTY_STUNDEN, 0);\n list($tag, $monat, $jahr) = explode(\".\", $instance->getProperty(ARB::PROPERTY_DATUM, \"01.01.1800\"));\n if ($jahr >= 2017 && is_numeric($h)) {\n $jahrSumme[\"$jahr\"] += $h;\n $monatSumme[\"$jahr-$monat\"] += $h;\n }\n }\n\n // Darstellung:\n $table = \"<table>\";\n foreach ($monatWerte as $budgetName => $jahrWerte) {\n $table .= \"<tr><td>Budget</td><td style='width: 90px;'>Max</td>\";\n foreach ($jahrWerte as $jahr => $monate) {\n foreach ($monate as $monat => $wert) {\n $table .= \"<td>\" . $monat . \"/\" . ($jahr - 2000) . \"</td>\";\n }\n }\n foreach ($jahresWerte[$budgetName] as $jahr => $wert) {\n $table .= \"<td>$jahr</td>\";\n }\n break;\n }\n $table .= \"</tr>\";\n\n $trclass = \"odd\";\n foreach ($monatWerte as $budgetName => $jahrWerte) {\n $trclass = $trclass == \"odd\" ? \"even\" : \"odd\";\n $strong = \"\";\n foreach (array(\"#022\", \"#028\", \"#030\", \"#034\", \"#039\", \"400059\", \"412622\") as $s) {\n if (strpos($budgetName, $s) !== false) {\n $strong = \"strong\";\n }\n }\n $tr = \"<tr class='$trclass $strong'><td><span title='$budgetName'><span style='padding-right: 20px;'>\" . substr($budgetName, 0, 80) . \"</span></td>\";\n $tr .= \"<td>\" . $budgetAmount[\"\" . $budgetName] . \"</td>\";\n foreach ($jahrWerte as $jahr => $monate) {\n foreach ($monate as $monat => $wert) {\n // fuer unproduktive auch die % darstellen:\n $prozentm= (stripos($budgetName, \"unproduktiv\") !== false && $monatSumme[\"$jahr-$monat\"] > 0) ? round(($wert / $monatSumme[\"$jahr-$monat\"]) * 100, 0) . \"%\" : \"\";\n $title = \"$prozentm = $wert/\" . $monatSumme[\"$jahr-$monat\"] . \" h @ \";\n $title .= \"$jahr-$monat: $budgetName\";\n $tr .= \"<td title='$title' style='width: 60px;'>$wert<br><strong>$prozentm</strong></td>\";\n }\n }\n foreach ($jahresWerte[$budgetName] as $jahr => $wert) {\n // fuer unproduktive auch die % darstellen:\n $prozent = $jahrSumme[\"$jahr\"] > 0 ? round((($wert / $jahrSumme[\"$jahr\"]) * 100), 1) . \"%\" : \"\";\n $title = (stripos($budgetName, \"unproduktiv\") !== false ? \"$prozent = $wert/\" . $jahrSumme[\"$jahr\"] . \" h\" : \"\");\n $text = $title == \"\" ? \"\" : \"<br><strong>$prozent</strong>\";\n $tr .= \"<td title='$title' style='width: 80px;'>$wert$text</td>\";\n }\n $tr .= \"</tr>\";\n $table .= \"$tr\";\n }\n $table .= \"</table>\";\n\n return \"$table\";\n }", "public function index()\n {\n $carts= NursingCartRestock::all()->sortByDesc('created_at');\n return view('admin.pharmacy.stockcart', compact('carts'));\n\n }", "public function getSales($date){\n $totaSales = DB::select(\"select sum(amount) as amount from subscriptions where created_at like '\".$date->toDateString().\"%'\");\n return $totaSales[0]->amount;\n }", "function reports($biz_id,$table,$date,$sum) {\n\t\n\t\t$results = [];\n\t\t$resultsDB = \\DB::table($table)->where('biz_id', $biz_id);\n\n\t\tif(isset($_GET['client_id']) AND $_GET['client_id'] != 'all' AND $table != 'clients') {\n\t\t\t$resultsDB->where('client_id', $_GET['client_id']);\n\t\t}\n\t\t\n\t\tif(isset($_GET['currency'])) {\n\t\t\t$resultsDB->where('currency', $_GET['currency']);\n\t\t}\n\n\t\t$month = clone $resultsDB;\n\t\t$lastmonth = clone $resultsDB;\n\t\t$lastmonth2 = clone $resultsDB;\n\t\t$lastyear = clone $resultsDB;\n\t\t$year = clone $resultsDB;\n\t\t$dates_filtered = clone $resultsDB;\n\n\t\tif(!empty($_GET['date_from'])) {\n\t\t\t$dates_filtered->whereDate($date, '>', $_GET['date_from']);\n\t\t}\n\t\tif(!empty($_GET['date_to'])) {\n\t\t\t$dates_filtered->whereDate($date, '<', $_GET['date_to']);\n\t\t}\n\t\t$results['results'] = $dates_filtered->count();\n\t\t$results['results_sum'] = $dates_filtered->sum($sum);\n\n\t\t$month = $month->whereMonth($date, \\Carbon::now()->format('m'));\n\t\t$lastmonth = $lastmonth->whereMonth($date, \\Carbon::now()->firstOfMonth()->subMonth()->format('m'));\n\t\t$lastmonth2 = $lastmonth2->whereMonth($date, \\Carbon::now()->firstOfMonth()->subMonth(2)->format('m'));\n\t\t$year = $year->whereYear($date, \\Carbon::now()->format('Y'));\n\t\t$lastyear = $lastyear->whereYear($date, \\Carbon::now()->subYear()->format('Y'));\n\n\t\t$results['month'] = $month->count();\n\t\t$results['month_sum'] = $month->sum($sum);\n\t\t$results['lastmonth'] = $lastmonth->count();\n\t\t$results['lastmonth_sum'] = $lastmonth->sum($sum);\n\t\t$results['lastmonth2'] = $lastmonth2->count();\n\t\t$results['lastmonth2_sum'] = $lastmonth2->sum($sum);\n\t\t$results['year'] = $year->count();\n\t\t$results['year_sum'] = $year->sum($sum);\n\t\t$results['lastyear'] = $lastyear->count();\n\t\t$results['lastyear_sum'] = $lastyear->sum($sum);\n\t\t$results['total'] = $resultsDB->count();\n\t\t$results['total_sum'] = $resultsDB->sum($sum);\n\t\t\n \treturn $results;\n\t}", "public function getReportedDate();", "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 }", "public function getQuantite_stock()\r\n {\r\n return $this->quantite_stock;\r\n }", "function jx_pnh_getfranchiseordersbydate()\r\n\t{\r\n\t\t$data['stat'] = $this->input->post('stat');\r\n\t\t$data['fid'] = $this->input->post('fid');\r\n\t\t$data['st_ts'] = strtotime($this->input->post('ord_fil_from').' 00:00:00');\r\n\t\t$data['en_ts'] = strtotime($this->input->post('ord_fil_to').' 23:59:59');\r\n\t\t$this->load->view(\"admin/body/jx_pnh_franchiseorderlist\",$data);\r\n\t}", "public function stock_report($limit,$page)\n\t{\n\t\t//$today = date('Y-m-d');\n\t\t$this->db->select(\"a.product_name,a.product_id,a.cartoon_quantity,a.price,a.product_model,sum(b.quantity) as 'totalSalesQnty',(select sum(product_purchase_details.quantity) from product_purchase_details where product_id= `a`.`product_id`) as 'totalBuyQnty'\");\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('invoice_details b','b.product_id = a.product_id');\n\t\t$this->db->where(array('a.status'=>1,'b.status'=>1));\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_id','desc');\n\t\t$this->db->limit($limit, $page);\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "function weeklyQuotesAction(){\n\t\t\n\t\t\n\t\t$request=$this->_request->getParams();\n\t\t\n\t\t\n\t\t\t $quotecron_obj = new Ep_Quote_Cron();\n\t\t\t $quotes=$quotecron_obj->getweeklyquotes();\n\t\t\t $quoteDetails=array();\n\t\t\t $quoteslern=array();\n\t\t\t $quotesusertotal=array();\n\t\t\t $date7day = date('Y-m-d H:i:s',time()-(7*86400));\n\t\t\t\t\t\t$html=\"<table class='table-bordered table-hover'>\";\n\t\t\t\t\t\tif(count($quotes)>0){\n\t\t\t\t\t\t\t\t\t\t $quotetotal=0;\n\t\t\t\t\t\t\t\t\t\t $turnover=0;\n\t\t\t\t\t\t\t\t\t\t $signature=0;\n\t\t\t\t\t\t\t\t\t\t $i=0;\n\t\t\t\t\t\t\t\t\t\t $usertotal=1;\n\t\t\t\t\t\t\t\tforeach($quotes as $quotescheck){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(($quotescheck['created_at']>=$date7day && $quotescheck['created_at']<=date('Y-m-d') )&& ($quotescheck['sales_review']=='not_done' || $quotescheck['sales_review']=='challenged' || $quotescheck['sales_review']=='to_be_approve') ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quotetotal++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$turnover+=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$signature+=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['identifier']=$quotescheck['identifier'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$mrgin=explode('.',$quotescheck['sales_margin_percentage']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['company_name']=$quotescheck['company_name'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['bosalesuser']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['status']='Ongoing';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($quotescheck['seo_timeline']<time() && $quotescheck['seo_timeline']!='')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team= 'Seo ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telseif($quotescheck['tech_timeline']<time() && $quotescheck['tech_timeline']!='')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team= 'Tech ';\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telseif($quotescheck['prod_timeline']<time() && $quotescheck['prod_timeline']!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team= 'Prod ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['team']=$team;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($quotescheck['response_time']>time()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['notiontime']='Late No';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['notiontime']='Late Yes';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['quote_by']=$quotescheck['quote_by'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif($quotescheck['sales_review']=='closed' && $quotescheck['closed_reason']!='quote_permanently_lost' && $quotescheck['releaceraction']!=''){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quotetotal++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$turnover+=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$signature+=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['identifier']=$quotescheck['identifier'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$mrgin=explode('.',$quotescheck['sales_margin_percentage']);\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$quoteslern[$i]['company_name']=utf8_decode($quotescheck['company_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['status']='A relancer';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['team']='Relanc&#233;';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*$validate_date= new DateTime($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days= $validate_date->diff(new DateTime(date(\"Y-m-d H:i:s\")));*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days=dateDiff($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at'],date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['notiontime']='Quote sent '.$sent_days.' on days ago';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['comments']='closed on '.$quotescheck['releaceraction'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['quote_by']=$quotescheck['quote_by'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif($quotescheck['sales_review'] == 'validated' && $quotescheck['validateaction']!=\"\" ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quotetotal++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $turnover+=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $signature+=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['identifier']=$quotescheck['identifier'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $mrgin=explode('.',$quotescheck['sales_margin_percentage']);\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 $quoteslern[$i]['company_name']=utf8_decode($quotescheck['company_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['quote_by']=$quotescheck['quote_by'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['status']='Sent';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t /*$sent_days= $validate_date->diff(new DateTime(date(\"Y-m-d H:i:s\")));*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days=dateDiff($quotescheck['validateaction'], date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['notiontime']='Quote sent '.$sent_days.' on days ago';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['comments']='closed on '.$quotescheck['validateaction'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['team']='/';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif($quotescheck['sales_review'] == 'closed' && ($quotescheck['closed_reason']=='quote_permanently_lost' || $quotescheck['closeaction']!=\"\" || $quotescheck['close5dayaction']!=\"\" || $quotescheck['close20dayaction']!=\"\" || $quotescheck['close30dayaction']!=\"\") ){\n\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\t\t\t\t\t\t\t\t\t $mrgin=explode('.',$quotescheck['sales_margin_percentage']);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['identifier']=$quotescheck['identifier'];\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 $quoteslern[$i]['company_name']=utf8_decode($quotescheck['company_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['status']='Closed';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* $validate_date= new DateTime($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days= $validate_date->diff(new DateTime(date(\"Y-m-d H:i:s\")));*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days=dateDiff($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at'],date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['notiontime']='Quote sent '.$sent_days.' on days ago';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['comments']= $quotescheck['closed_comments'].'<br> closed on '.$quotescheck['closeaction'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['team']=$this->closedreason[$quotescheck['closed_reason']];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\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} // end foreach\n\t\t\t\t\t\t\t\t$quoteDetails['quotetotal']=$quotetotal;\n\t\t\t\t\t\t\t\t$quoteDetails['turnover']=$turnover;\n\t\t\t\t\t\t\t\t$quoteDetails['signature']=round($signature/$quotetotal);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $startdate = date('d',time()-(7*86400));\n\t\t\t\t\t\t\t\t\t $enddate= date('d-M-Y',strtotime(date('Y-m-d')));\n\t\t\t\t\t\t\t\t\t$statusdir =$_SERVER['DOCUMENT_ROOT'].\"/BO/quotes_weekly_report/\";\n\t\t\t\t\t\t\t\t\tif(!is_dir($statusdir))\n\t\t\t\t\t\t\t\t\tmkdir($statusdir,TRUE);\n\t\t\t\t\t\t\t\t\tchmod($statusdir,0777);\n\t\t\t\t\t\t\t\t\t$filename = $_SERVER['DOCUMENT_ROOT'].\"/BO/quotes_weekly_report/weekly-report-$startdate-to-$enddate.xlsx\";\n\t\t\t\t\t\t\t\t\t$htmltable = $this->QuotesTable($quoteDetails,$quoteslern);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//save excel file \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tchmod($filename,0777);\t\n\t\t\t\t\t\t\t\t\t$quoteDetails['startdate']=$startdate;\n\t\t\t\t\t\t\t\t\t$quoteDetails['enddate']=$enddate;\n\t\t\t\t\t\t\t\t\t$this->_view->weely_table_details=$quoteDetails;\n\t\t\t\t\t\t\t\t\t$this->_view->weely_table_quote=$quotes;\n\t\t\t\t\t\t\t\t\t$this->_view->filepath=$filename;\n\t\t\t\t\t\t\t\t\t$this->render('weekly-quotes');\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\tif($request['download']=='report'){\n\t\t\t\t\t\t\t\t\t$this->convertHtmltableToXlsx($htmltable,$filename,True);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->_redirect(\"/quote/download-document?type=weekly&filename=weekly-report-$startdate-to-$enddate.xlsx\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t } //end id\n\t\t\t\t\t\t\n\t\t\t \n\t\t\t}", "function ViewStockAdjustmentTransaction()\n {\n $sql=\"select * from INVT_T_STOCK_ADJ_HEAD \";\n return $this->db->query($sql, $return_object = TRUE)->result_array();\n }", "public function index()\n {\n// $vendors = Customer::get();\n// DB::enableQueryLog();\n\n\n $stock = DB::table('products as p')\n ->leftjoin('receive_details as r', 'p.id','=','r.product_id')\n ->select( DB::raw('p.id,p.name, sum(r.total_price) as r_total_price, sum(r.qty) as r_qty,\n (select sum(a.total_price) from sells_details as a where p.id=a.product_id) as s_total_price,\n (select sum(b.qty) from sells_details as b where p.id=b.product_id) as s_qty') )\n\n ->groupBy('p.id' )\n ->orderBy('p.id' )\n\n\n ->get();\n\n// dd(DB::getQueryLog());\n\n\n return view(\"admin.report.stock\", ['stocks' => $stock]);\n }", "function avisos_listado_stock()\n\t{\n\t\t$query=\"SELECT id,codigo from productos \";\n\t\t$result= mysql_query($query);\n\t\t?><TABLE border=\"1\">\n\t\t<TR>\n\t\t\t<TH>CODIGO</TH>\n\t\t\t<TH>COLOR</TH>\n\t\t\t<TH>TALLE</TH>\n\t\t\t<TH>CANTIDAD TOTAL</TH>\n\t\t\t<TH>STOCK BAJO MINIMO</TH>\n\n\t\t</TR>\n\t\t<? $contador = 0;\n\t\twhile ($row = mysql_fetch_assoc($result))\n\t\t{ //recorro todos los productos 1 por 1\n\t\t$contador++;\n\n\t\t\t// AHORA SE RECORRO LOS COLORES\n\t\t\t$query_color=\"SELECT * FROM colores\";\n\t\t\t$result_color= mysql_query($query_color);\n\t\t\twhile ($row_color = mysql_fetch_assoc($result_color))\n\t\t\t{\n\n\t\t\t\t$query_talle=\"SELECT * FROM talles\";\n\t\t\t\t$result_talle= mysql_query($query_talle);\n\t\t\t\twhile ($row_talle = mysql_fetch_assoc($result_talle))\n\t\t\t\t{\n\n\n\t\t\t\t\t$query_avisos=\"SELECT SUM(cantidad) AS cantidad_total, aviso_stock FROM productos AS P inner join productos_stock as PS ON PS.idProducto = P.codigo WHERE codigo = '\".$row[\"codigo\"]. \"' and idcolor = '\".$row_color[\"id\"]. \"' and idtalle = '\".$row_talle[\"id\"]. \"' group by codigo\";\n\t\t\t\t\t$result_avisos = mysql_query($query_avisos);\n\t\t\t\t\tif($row_avisos = mysql_fetch_assoc($result_avisos))\n\t\t\t\t\t{\n\t\t\t\t\t\t//if($row_avisos[\"cantidad_total\"] < $row_avisos[\"aviso_stock\"])\n\t\t\t\t\t\t//{\t\n\t\t\t\t\t\t//\tECHO \"<FONT SIZE=3 COLOR=blue>EL PRODUCTO <A HREF='http://localhost/control_stock/admin/productos/index.php?accion=detail&id=\".$row[\"id\"].\"'>\" . $row[\"codigo\"] . \"</a> COLOR : \".$row_color[\"nombre\"].\" TALLE : \".$row_talle[\"nombre\"].\" TIENE DE STOCK : \".$row_avisos[\"cantidad_total\"].\" </FONT><br>\";\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<TR class=\"<?=($contador%2==0? \"fila_par\":\"fila_impar\");?>\">\n\t\t\t\t\t\t\t<TD><A HREF='<?=ADMIN?>productos/index.php?accion=detail&id=<?=$row[\"id\"]?>'><?= $row[\"codigo\"];?></a></TD>\n\t\t\t\t\t\t\t<TD><?= $row_color[\"nombre\"];?></TD>\n\t\t\t\t\t\t\t<TD><?= $row_talle[\"nombre\"];?></TD>\n\t\t\t\t\t\t\t<TD><?= $row_avisos[\"cantidad_total\"];?></TD>\n\t\t\t\t\t\t\t<TD><?= $row_avisos[\"aviso_stock\"];?></TD>\n\t\t\t\t\t\t</TR>\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}//END WHILE TALLES\n\t\t\t}//END WHILE COLORES\n\t\t}//EN DWHILE PRODUCTOS\n\t\t?></TABLE><?\n\t}", "public function getStock()\n {\n return $this->Stock;\n }", "public function actionStock($ACCESS_GROUP,$PRODUCT_ID,$STORE_ID)\r\n {\r\n $model = new ProductStock();\r\n if ($model->load(Yii::$app->request->post())) {\r\n $models = Product::find()->where(['PRODUCT_ID'=>$PRODUCT_ID])->one();\r\n $model->PRODUCT_ID=$PRODUCT_ID;\r\n $model->ACCESS_GROUP=$ACCESS_GROUP;\r\n $model->STORE_ID=$STORE_ID;\r\n date_default_timezone_set('Asia/Jakarta');\r\n $model->INPUT_TIME=date('H:i:s');\r\n $model->INPUT_DATE=date('Y-m-d');\r\n if ($model->save(false)) {\r\n Yii::$app->session->setFlash('success', \"Penyimpanan Stock Produk <b>\".$models->PRODUCT_NM.\"</b> Berhasil\");\r\n return $this->redirect(['index-stock','productid'=>$PRODUCT_ID]);\r\n }\r\n }\r\n $productdetail = ProductSearch::find()->joinWith('store')->where(['store.ACCESS_GROUP'=>$ACCESS_GROUP,'PRODUCT_ID'=>$PRODUCT_ID,'store.STORE_ID'=>$STORE_ID])->one();\r\n \r\n return $this->renderAjax('_form_stock', [\r\n 'model' => $model,\r\n 'productdetail'=>$productdetail\r\n ]);\r\n }", "public function getStockContainer()\n {\n $reportStock = new ReportStock();\n return Collection::times(10)->map(function ($value) use ($reportStock) {\n $stock = $reportStock->getStockContainers(new Request([\n 'stock_date' => $date = Carbon::now()->subWeeks($value - 1)\n ]));\n\n $groupStock = $stock->groupBy('container_size')\n ->select('container_size')\n ->selectRaw('COUNT(container_size) AS total')\n ->get()\n ->mapWithKeys(function ($item) {\n return [$item->container_size => $item->total];\n });\n\n if (!$groupStock->has('20')) $groupStock[20] = 0;\n if (!$groupStock->has('40')) $groupStock[40] = 0;\n if (!$groupStock->has('45')) $groupStock[45] = 0;\n\n return collect([\n 'date' => $date->toDateString(),\n 'stocks' => $groupStock\n ]);\n });\n }", "public function index()\n {\n $now = Carbon::now();\n\n $place = $this->getPlace();\n\n $query1 = Order::query()\n ->where('place_id', $place->id)\n ->status('draft', '!=');\n\n $d1 = $now->copy();\n $res[] = [\n 'title' => 'Заказы сегодня:',\n 'dates' => [$d1->format('Y-m-d')],\n 'count' => (clone $query1)->whereDate('created_at', $d1)->count(),\n 'amount' => (clone $query1)->whereDate('created_at', $d1)->sum('amount'),\n ];\n $d1 = $now->copy()->addDays(-1);\n $res[] = [\n 'title' => 'Заказы вчера:',\n 'dates' => [$d1->format('Y-m-d')],\n 'count' => (clone $query1)->whereDate('created_at', $d1)->count(),\n 'amount' => (clone $query1)->whereDate('created_at', $d1)->sum('amount'),\n ];\n $d1 = $now->copy()->startOfWeek();\n $d2 = $now->copy()->endOfWeek();\n $res[] = [\n 'title' => 'За эту неделю:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n $d1 = $now->copy()->addDays(-7)->startOfWeek();\n $d2 = $now->copy()->addDays(-7)->endOfWeek();\n $res[] = [\n 'title' => 'За прошлую неделю:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n $d1 = $now->copy()->startOfMonth();\n $d2 = $now->copy()->endOfMonth();\n $res[] = [\n 'title' => 'За этот месяц:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n $d1 = $now->copy()->addMonths(-1)->startOfMonth();\n $d2 = $now->copy()->addMonths(-1)->endOfMonth();\n $res[] = [\n 'title' => 'За прошлый месяц:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n\n return [\n 'data' => $res\n ];\n }", "public function getSalesTransactions($stock){\n\n $this->db->select('*');\n $this->db->from('transactions t');\n $this->db->where('t.Stock', $stock);\n $query = $this->db->get();\n\n $item = [\n \"DateTime\" => \"N/A\",\n \"Player\" => \"N/A\",\n \"Stock\" => \"N/A\",\n \"Trans\" => \"N/A\",\n \"Quantity\" => \"N/A\"\n ];\n\n $resultset = array();\n\n array_push($resultset, $item);\n\n if($query->num_rows() != 0)\n {\n $resultset = $query->result_array();\n }\n\n return $resultset;\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 get_sales_man_daily_work_report($date){\n\t\t $this->db->select('empployee.e_id,empployee.e_emplouee_id,assign_work.w_d_id,assign_work.date')->from('assign_work');\n\t\t $this->db->join('empployee', 'empployee.e_id = assign_work.work_employee_id ', 'left');\n\t\t $this->db->order_by('empployee.role_id',8);\n\t\t $this->db->where('empployee.status',1);\n\t\t $this->db->where('assign_work.date',$date);\n\t\t $return=$this->db->get()->result_array();\n\t\t $work_details=$data_work='';\n\t\t foreach($return as $list){\n\t\t\t $emp_work=$this->get_employee_work_dailay_details($list['date'],$list['e_id'],$list['w_d_id']);\n\t\t\t $data[$list['e_id']]=$list;\n\t\t\t $data[$list['e_id']]['work']=isset($emp_work)?$emp_work:'';\n\t\t\t \n\t\t }\n\t\t if(!empty($data)){\n\t\t\t return $data;\n\t\t }\n\t}", "public function salesQuotesListAction()\n\t{\t\t\n\t\t$quote_obj=new Ep_Quote_Quotes();\n\t\t$listParams=$this->_request->getParams();\n\t\t$searchParams['client_id']=$listParams['client_id'];\n\n\t\t$quoteList=$quote_obj->getAllQuotesList($searchParams);\t\n\t\t\n\t\tif($quoteList)\n\t\t{\n\t\t\t$q=0;\n\t\t\t$total_turnover = $total_ongoing_turnover_euro = $total_ongoing_turnover_pound = $validated_turnover_euro = $validated_turnover_pound = $signed_turnover_euro = $signed_turnover_pound = 0;\n\t\t\t$ave_count=$relancer_turnover_pound=$relancer_turnover_euro=$in_day=0;\n\t\t\t$in_day=0;\n\t\t\tforeach ($quoteList as $quote) {\n\t\t\t\t\n\t\t\t\t$quoteList[$q]['tech_status']=$this->status_array[$quote['tec_review']];\n\t\t\t\t$quoteList[$q]['seo_status']=$this->status_array[$quote['seo_review']];\n\t\t\t\t$quoteList[$q]['prod_status']=$this->status_array[$quote['prod_review']];\n\t\t\t\t$quoteList[$q]['sales_status']=$this->status_array[$quote['sales_review']];\n\t\t\t\t$quoteList[$q]['category_name']=$this->getCategoryName($quote['category']);\n\t\t\t\t$quoteList[$q]['closed_reason_txt'] = $this->closedreason[$quote['closed_reason']];\n\t\t\t\tif($quote['tech_timeline'])\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$quoteList[$q]['tech_challenge_time']=strtotime($quote['tech_timeline']);\n\t\t\t\t}\t\n\t\t\t\tif($quote['seo_timeline'])\n\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['seo_challenge_time']=strtotime($quote['seo_timeline']);\n\t\t\t\t}\n\n\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote['quote_by']);\n\t\t\t\t\n\t\t\t\tif($quote['deleted_by'])\n\t\t\t\t{\n\t\t\t\t\t$deleted_user=$client_obj->getQuoteUserDetails($quote['deleted_by']);\n\t\t\t\t\t$quoteList[$q]['deleted_user'] = $deleted_user[0]['first_name'].' '.$deleted_user[0]['last_name'];\n\t\t\t\t}\n\n\t\t\t\t$quoteList[$q]['owner']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\n\t\t\t\t$prod_team=$quote['prod_review']!='auto_skipped' ? 'Prod ': '';\n\t\t\t\t$seo_team=$quote['seo_review']!='auto_skipped' ? 'Seo ': '';\n\t\t\t\t$tech_team=$quote['tec_review']!='auto_skipped' ? 'Tech ': '';\n\n\t\t\t\t$quoteList[$q]['team']=$prod_team.$seo_team.$tech_team;\n\n\t\t\t\tif(!$quoteList[$q]['team'])\n\t\t\t\t\t$quoteList[$q]['team']='only sales';\n\n\n\t\t\t\t//turnover calculations\n\t\t\t\t/*if($quote['sales_review']=='not_done' || $quote['sales_review']=='to_be_approve' )\n\t\t\t\t{\n\t\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t\t$total_ongoing_turnover_euro +=$quote['turnover'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$total_ongoing_turnover_pound +=$quote['turnover'];\n\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\tif($quote['sales_review']=='validated')\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$validated_turnover_euro += $quote['turnover']\t;\n\t\t\t\t\telse\n\t\t\t\t\t\t$validated_turnover_pound += $quote['turnover']\t;\n\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\tif($quote['sales_review']=='signed')\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$signed_turnover_euro += $quote['turnover'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$signed_turnover_pound += $quote['turnover'];\n\t\t\t\t}*/\n\t\t\t\t//turnover calculations\n\t\t\t\t\n\t\t\t\tif($quote['sales_review']=='not_done' || $quote['sales_review']=='to_be_approve' )\n\t\t\t\t{\n\t\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t\t$total_ongoing_turnover_euro +=$quote['turnover'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$total_ongoing_turnover_pound +=$quote['turnover'];\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\tif($quote['sales_review']=='signed')\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$signed_turnover_euro += $quote['turnover'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$signed_turnover_pound += $quote['turnover'];\n\n\t\t\t\t\t$existval= $quote_obj->checkcontractexist($quote['identifier']);\n\t\t\t\t\t\n\t\t\t\t\tif(count($existval[0]['quotecontractid'])>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteList[$q]['signed_exist']=1;\n\t\t\t\t\t\t$quoteList[$q]['signed_contract']=$existval[0]['contractname'];\n\t\t\t\t\t\t$quoteList[$q]['signed_contractid']=$existval[0]['quotecontractid'];\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$quoteList[$q]['signed_exist']=0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t \n\t\t\t\t//Mean Time Quotes signature \n\t\t\t\t\n\t\t\t\tif(($quote['sales_review']=='validated' || $quote['sales_review']=='signed') && $quote['signed_at']!='')\n\t\t\t\t{\n\t\t\t\t\t\t$quotes_log=new Ep_Quote_QuotesLog();\n\t\t\t\t\t\t$quotesAction=$quotes_log->getquoteslogvalid($quote['identifier'],'sales_validated_ontime');\n\t\t\t\t\t//print_r($quotesAction);\n\t\t\t\t\t\tif($quotesAction[0]['action_at']!=\"\"){\n\t\t\t\t\t\t\t$date_difference=strtotime($quote['signed_at'])-strtotime($quotesAction[0]['action_at']);\n\t\t\t\t\t\t\t$in_day+=$date_difference/(60 * 60 * 24);\n\t\t\t\t\t\t\t$ave_count++;\n\t\t\t\t\t\t }\n\t\t\t\t\t\n } \n \n //relancer Section\n if($quote['releaceraction']!=''){\n\t\t\t\t\t $quoteList[$q]['relance_actiondate']=date(\"Y-m-d\", strtotime(\"+1 month\", strtotime($quote['releaceraction'])));\n\t\t\t\t\t} \n\t\t\t\t\t \n if($quote['quotesvalidated']!=''){\n\t\t\t\t\t $quoteList[$q]['relance_validated']=date(\"Y-m-d\", strtotime(\"+5 days\", strtotime($quote['quotesvalidated'])));\n\t\t\t\t\t} \n \n\t\t\t\t\t\n\t\t\t\tif($quoteList[$q]['version']>1)\n\t\t\t\t{\n\t\t\t\t\t$versions = $quote_obj->getQuoteVersionDetails($quote['identifier']);\n\t\t\t\t\t$quoteList[$q]['version_dates'] = \"<table class='table quote-history table-striped'>\";\n\t\t\t\t\tforeach($versions as $version):\n\t\t\t\t\t$quoteList[$q]['version_dates'] .= '<tr><td>v'.$version['version'].' - '.date('d/m/Y',strtotime($version['created_at'])).\"</td></tr>\";\n\n\t\t\t\t\tendforeach;\n\t\t\t\t\t$quoteList[$q]['version_dates'] .= '</table>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t$quoteList[$q]['version_dates'] = \"\";\n\t\t\t\t\n\t\t\t\t//relancer turnover and flag\n\t\t\t\t\tif( (($quote['sales_review']=='closed' && (date(\"Y-m-d\") > $quoteList[$q]['relance_actiondate'] || $quote['boot_customer']!=\"\") ) \n\t\t\t\t\t ||\t(time() > $quoteList[$q]['sign_expire_timeline'] && $quote['sales_review']=='validated'))\n\t\t\t\t\t && $quote['closed_reason']!= 'quote_permanently_lost')\n\t\t\t\t\t {\n\t\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$relancer_turnover_euro+=$quote['turnover'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t$relancer_turnover_pound+=$quote['turnover'];\n\t\t\t\t\t\t$quoteList[$q]['relancer_status']=1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$quoteList[$q]['relancer_status']=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t//closed quotes flag\n\t\t\t\tif( ($quote['sales_review']=='closed' && date(\"Y-m-d\") <= $quoteList[$q]['relance_actiondate'] && $quote['boot_customer']==\"\")\n\t\t\t\t || $quote['closed_reason']=='quote_permanently_lost') \n\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['closed_status']=1;\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['closed_status']=0;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//validated turnover\n\t\t\t\tif($quote['sales_review']=='validated' && time() <= $quoteList[$q]['sign_expire_timeline'])\n\t\t\t\t{\n\t\t\t\t\tif($quote['sales_suggested_currency']=='euro')\n\t\t\t\t\t\t$validated_turnover_euro += $quote['turnover']\t;\n\t\t\t\t\telse\n\t\t\t\t\t\t$validated_turnover_pound += $quote['turnover']\t;\n\t\t\t\t\n\t\t\t\t$quoteList[$q]['validated_status']=1;\n\t\t\t\t\tif($quote['is_new_quote']==1)\n\t\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['new_quote']=1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t$quoteList[$q]['new_quote']=0;\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$quoteList[$q]['validated_status']=0;\n\t\t\t\t\tif($quote['is_new_quote']==1)\n\t\t\t\t\t{\n\t\t\t\t\t$quoteList[$q]['new_quote']=1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t$quoteList[$q]['new_quote']=0;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$q++;\n\t\t\t}\n\t\t\t$meantime_sign_days=round(abs($in_day)/$ave_count,0);\n\t\t\t//echo \"<pre>\";print_r($quoteList);exit;\n\t\t\t$this->_view->quote_list=$quoteList;\n\t\t\t$this->_view->total_ongoing_turnover_euro = $total_ongoing_turnover_euro;\n\t\t\t$this->_view->total_ongoing_turnover_pound = $total_ongoing_turnover_pound;\n\t\t\t$this->_view->validated_turnover_euro = $validated_turnover_euro;\n\t\t\t$this->_view->validated_turnover_pound = $validated_turnover_pound;\n\t\t\t$this->_view->signed_turnover_euro = $signed_turnover_euro;\n\t\t\t$this->_view->signed_turnover_pound = $signed_turnover_pound;\n\t\t\t$this->_view->relancer_turnover_euro=$relancer_turnover_euro;\n\t\t\t$this->_view->relancer_turnover_pound=$relancer_turnover_pound;\n\t\t\t$this->_view->day_difference=$meantime_sign_days;\n\n\t\t}\t\n\t\t$this->_view->quote_sent_timeline=$this->configval[\"quote_sent_timeline\"];\n\t\t$this->_view->prod_timeline=$this->configval[\"prod_timeline\"];\n\n\t\t$this->_view->techManager_holiday=$this->configval[\"tech_manager_holiday\"];\n\t\t$this->_view->seoManager_holiday=$this->configval[\"seo_manager_holiday\"];\n\n\t\t//echo \"<pre>\";print_r($quoteList);exit;\n\t\t$this->_view->closedreasons = $this->closedreason;\n\t\t$this->render('sales-quotes-list');\n\n\t\tif($listParams['file_download']=='yes' && $listParams['quote_id'])\n\t\t\theader( \"refresh:1;url=/quote/download-quote-xls?quote_id=\".$listParams['quote_id']);\n\t}", "function getDailyReport($date = null)\n{\n//SELECT COUNT(0)\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `invoice_count`,\n//`b`.`tran_date` AS `tran_date`,(\n//SELECT COUNT(`0_debtor_trans_details`.`id`)\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND\n//(`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_service_count`,(\n//SELECT SUM((`0_debtor_trans`.`ov_amount` + `0_debtor_trans`.`ov_gst`))\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_invoice_amount`,(\n//SELECT SUM(`0_debtor_trans`.`alloc`)\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_amount_recieved`,(\n//SELECT (SUM((`0_debtor_trans`.`ov_amount` + `0_debtor_trans`.`ov_gst`)) - SUM(`0_debtor_trans`.`alloc`))\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `pending_amount`,(\n//SELECT (SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`unit_price`)) -\n//SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`discount_amount`)))\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND (`0_debtor_trans`.`type` = 10) AND\n//(`0_debtor_trans`.`tran_date` = '$date'))) AS `total_service_charge`,(\n//SELECT SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`user_commission`))\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND (`0_debtor_trans`.`type` = 10) AND\n//(`0_debtor_trans`.`tran_date` = '$date'))) AS `total_commission`,(\n//SELECT SUM(ABS(`0_gl_trans`.`amount`))\n//FROM `0_gl_trans`\n//WHERE ((`0_gl_trans`.`type` = 12) AND (`0_gl_trans`.`account` = 1200) AND\n//(`b`.`tran_date` = '$date'))) AS `total_collection`\n//FROM ((`0_debtor_trans` `a`\n//JOIN `0_gl_trans` `b` ON((`a`.`trans_no` = `b`.`type_no`)))\n//JOIN `0_debtor_trans_details` `c` ON((`a`.`trans_no` = `c`.`debtor_trans_no`)))\n//WHERE ((`c`.`debtor_trans_type` = 10) AND (`a`.`type` = 10)) and `b`.`tran_date` = '$date'\n//GROUP BY `b`.`tran_date`\n//ORDER BY `b`.`tran_date`\";\n//\n//// if ($date) {\n//// $sql .= \" and tran_date='$date' \";\n//// }\n////\n//// $sql .= \" order by tran_date desc LIMIT 10\";\n//\n//\n//// print_r($sql); die;\n//\n// $result = db_query($sql, \"Transactions could not be calculated\");\n//\n// $table_html = \"\";\n//\n// $i = 0;\n//\n// while ($myrow = db_fetch($result)) {\n//\n// $class = 'class=\"oddrow\"';\n// if ($i % 2 == 0)\n// $class = 'class=\"evenrow\"';\n//\n// $table_html .= \"<tr $class>\";\n// $table_html .= \"<td>\" . $myrow['tran_date'] . \"</td>\";\n// $table_html .= \"<td style='text-align: center'>\" . $myrow['invoice_count'] . \"</td>\";\n// $table_html .= \"<td style='text-align: center'>\" . $myrow['total_service_count'] . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_service_charge'], user_price_dec()) . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_invoice_amount'], user_price_dec()) . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_collection'], user_price_dec()) . \"</td>\";\n// $table_html .= \"</tr>\";\n// $i++;\n// }\n// return $table_html;\n\n}", "public function ctrreports()\n {\n //\n $productname = Input::get('productname');\n\t \t$start_date = Input::get('start_date');\n\t\t$end_date = Input::get('end_date');\n\t $product=m_product::where('product_name',$productname)->first();\n\t \n\t \t \n $contracts=t_contract::where('product_id',$product->id)\n\t ->where('pay_date','>',$start_date)\n\t ->where('pay_date','<=',$end_date)->get();\n\t\t$productname='本周'.$productname;\t\t\t\t \n\t if($contracts->count())\n\t {\n\t \t \n\t \t$filename=$product->product_name . time();\n\t \\Excel::create($filename, function($excel) use ($productname, $contracts) {\n $excel->sheet('New sheet', function($sheet) use ($productname, $contracts) {\n $sheet->loadView('ctrreports') \n ->withProductname($productname)\n\t ->withContracts($contracts);\n\n });\n\n })->download('xls'); \n\t\t }\n\t else {\n\t\t\t\n\t\t\treturn Redirect::back()->withInput()->withErrors('本时间段此产品下无合同产生');\n\t }\n\t \n\t \n\t \n \n }", "public function getDailyStatistics()\n {\n $date = new \\DateTime();\n $date = $date->format('Y-m-d');\n\n $builder = $this->createQueryBuilder(\"a\");\n\n $builder\n ->where('a.date = :date')\n ->setParameter('date', $date);\n\n $result = $builder->getQuery()->getOneOrNullResult();\n\n return $result;\n }", "public function historics_reports()\n {\n set_time_limit(3000000);\n $params = Request::all();\n $conditions = [];\n if(!empty($params['type_transaction'])){\n $conditions['type_transaction'] = $params['type_transaction'];\n }\n if(!empty($params['date_operation'])){\n $conditions['date_operation'] = $params['date_operation'];\n }\n if(count($params) > 1){\n $accounts_historical = AccountsHistorical::where($conditions)->orderBy('id','DESC')->get();\n } else {\n $accounts_historical = AccountsHistorical::orderBy('id','DESC')->get();\n }\n $pdf = PDF::loadView('reports.historics',compact('accounts_historical'))->setOrientation('landscape')->setOption('encoding', 'utf-8')->setOption('footer-center', 'Página [page] de [topage]');\n return $pdf->stream('reports.pdf');\n }", "public function getProductStocks($product_id)\n {\n\n $store_ids = Store::where('company_id',Auth::id())->pluck('id');\n\n $stocks = Stock::with(['store','product'])->where('product_id',$product_id)->whereIn('store_id',$store_ids)->orderBy('id','desc')->get();\n\n\n return Datatables::of($stocks)\n ->addColumn('created_at', function ($stock) {\n return date('d-m-Y h:i a', strtotime($stock->created_at));\n })\n ->addColumn('store_name', function ($stock) {\n return $stock->store->name;\n })\n ->addColumn('product_name', function ($stock) {\n return $stock->product->name;\n })\n ->addColumn('stock_type', function ($stock) {\n if($stock->stock_type==1)\n return \"IN\";\n elseif($stock->stock_type==2)\n return \"OUT\";\n })\n ->addColumn('origin', function ($stock) {\n switch ($stock->origin) {\n case 1:\n return \"Add Product\";\n break;\n case 2:\n return \"Update Product\";\n break;\n case 3:\n return \"Sale\";\n break;\n case 4:\n return \"Sale Return\";\n break;\n case 5:\n return \"Adjustment\";\n break;\n default:\n return \"Add Product\";\n }\n })\n ->editColumn('id', 'ID: {{$id}}')\n ->rawColumns(['store_name', 'product_name'])\n ->make(true);\n\n }", "public function stock_report_single_item($product_id){\n\t\t$this->db->select(\"a.product_name,a.cartoon_quantity,a.price,a.product_model,sum(b.quantity) as 'totalSalesQnty',sum(c.quantity) as 'totalBuyQnty'\");\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('invoice_details b','b.product_id = a.product_id');\n\t\t$this->db->join('product_purchase_details c','c.product_id = a.product_id');\n\t\t$this->db->where(array('a.product_id'=>$product_id,'a.status'=>1,'b.status'=>1));\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_id','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "function get_acquisition_qty_by_country(){\n \n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj = new vintage_has_acquire();\n //$columns = \"DATE_FORMAT(acquire_date,'%b') as Month\";\n $columns = \" tblcountry.country, sum(trelVintageHasAcquire.qty) as qty\";\n //$group = \" trelVintageHasAcquire.acquire_id \";\n $group = \" tblcountry.country \";\n //$where = \" tblAcquire.acquire_date BETWEEN '2014-01-01' AND '2014-12-31'\";\n $sort = \" qty DESC \";\n $limit = '12';\n $rst = $obj ->get_extended($where,$columns,$group, $sort, $limit);\n \n \n if(!$rst){\n $var_result['success']=false;\n $var_result['error']=\"get_acquisition_qty_by_country() failed\";\n return $var_result;\n }\n\n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result;\n \n}", "public function index()\n\t{\n\t\t$data['item']=$this->Inventory_stock_model->getItem();\n\t\t$data['location']=$this->Inventory_stock_model->getLocation();\n\t\t$data['warehouse']=$this->Inventory_stock_model->getInventory();\n\t\t$data['total']=$this->Inventory_stock_model->total();\n\n\t\t$this->load->view('reports/inventory_stock_hand',$data);\t\n\t}", "public function stock_report_single_item($product_id){\n\t\t$this->db->select(\"a.product_name,a.price,a.product_model,sum(b.quantity) as 'totalSalesQnty',sum(c.quantity) as 'totalBuyQnty'\");\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('invoice_details b','b.product_id = a.product_id');\n\t\t$this->db->join('product_purchase_details c','c.product_id = a.product_id');\n\t\t$this->db->where(array('a.product_id'=>$product_id,'a.status'=>1,'b.status'=>1));\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_id','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function stock() {\n \n if ($this->session->userdata('validated')) {\n \n if ($this->MRecurso->validaRecurso(2)){\n\n /*Consulta Modelo para obtener listado de Productos creados*/\n $listProducts = $this->MProduct->list_products();\n /*Consulta Modelo para obtener listado de Grupos creados*/\n $listGroups = $this->MService->list_group_service();\n /*Retorna a la vista con los datos obtenidos*/\n $info['list_products'] = $listProducts;\n $info['list_groups'] = $listGroups;\n $this->load->view('products/stock',$info);\n \n } else {\n \n show_404();\n \n }\n \n } else {\n \n $this->load->view('login');\n \n }\n \n }", "public function actionIndex()\n {\n $searchModel = new StockSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function run() {\n try {\n $todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);\n \n $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('preorder_calender', array('date' => true, 'to' => $todayDate));\n $emailContent = '';\n $emailContent .= $todayDate.\"\\n\";\n echo 'Preorder-InStock process started @ '.$todayDate.' :'.\"\\n\\n\";\n echo 'Name'.\"\\t\".'SKU'.\"\\n\\n\";\n\n // Write into CSV\n $io = new Varien_Io_File();\n $path = Mage::getBaseDir('var') . DS . 'export' . DS;\n $name = md5(microtime());\n $file = $path . DS . $name . '.csv';\n $io->setAllowCreateFolders(true);\n $io->open(array('path' => $path));\n $io->streamOpen($file, 'w+');\n $io->streamLock(true);\n\n $header = array(\"Name\",\"SKU\");\n $io->streamWriteCsv($header);\n\n foreach ($products as $product) {\n $product->load();\n $data = array();\n $data[] = $product->getName();\n $data[] = $product->getSku();\n $io->streamWriteCsv($data);\n $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product->getId());\n $stock->setData('is_in_stock', 1);\n $stock->save();\n\n $product->setData('preorder_calender', null);\n $product->setData('custom_stock_status', 14);\n\n $product->save();\n $output = $product->getName().\"\\t\".$product->getSku();\n echo $output.\"\\n\";\n }\n\n // Send email with configuration in System > Configuration > Preoder Instock Updates > Receivers\n $emailTemplate = Mage::getModel('core/email_template')\n ->loadDefault('preoder_stock_email');\n\n $emailTemplate->setSenderName('Milan Direct Administrator');\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email'));\n $emailTemplate->setTemplateSubject('Preorder-InStock process started @ '.$todayDate);\n\n $emailTemplateVariables = array();\n $emailTemplateVariables['message'] = 'Preorder-InStock process finished with '.$products->count().' updated';\n $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);\n\n // Add attachment\n $emailTemplate->getMail()->createAttachment(\n file_get_contents($file),\n Zend_Mime::TYPE_OCTETSTREAM,\n Zend_Mime::DISPOSITION_ATTACHMENT,\n Zend_Mime::ENCODING_BASE64,\n 'preorder_stock_report.csv'\n );\n\n $names = array();\n $receivers = explode(\",\", Mage::getStoreConfig('notification/general/email'));\n\n foreach($receivers as $receiver)\n {\n $names[] = 'Milan Direct Staff';\n }\n\n $emailTemplate->send($receivers,$names, $emailTemplateVariables);\n\n echo 'Preorder-InStock process finished with '.$products->count().' updated'.\"\\n\";\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::log($e->getMessage(), 1, 'preorder_instock.log');\n }\n }", "public function productStocks($product_id)\n {\n $product_id = Hashids::decode($product_id)[0];\n\n $product = Product::find($product_id);\n\n return view('company.products.stock_history', compact('product'));\n }", "public function packing_station_tanker_report_abstract_print()\n\t{\t\t\n $loose_oil=$this->Common_model->get_data('loose_oil',array('status'=>1));\n $loose_oil_id=array_column($loose_oil,'loose_oil_id');\n $packing_material=$this->Common_model->get_data('packing_material',array('status'=>1));\n $packing_material_id=array_column($packing_material,'pm_id');\n $free_gift=$this->Common_model->get_data('free_gift',array('status'=>1));\n $free_gift_id=array_column($free_gift,'free_gift_id');\n $plant_id=$this->session->userdata('ses_plant_id');\n $submit=$this->input->post('search_sales', TRUE);\n $from_date=date('Y-m-d', strtotime($this->input->post('start_date',TRUE)));\n $to_date=date('Y-m-d', strtotime($this->input->post('end_date',TRUE)));\n if($submit!='')\n {\n \t$oil_results = array();\n \t$pm_results = array();\n \t$fg_results = array();\n \tforeach($loose_oil_id as $key=>$value)\n\t {\n\t \t$oil_results[$value]['loose_oil_name'] = $this->Common_model->get_value('loose_oil',array('loose_oil_id'=>$value),'name');\n\t \t$oil_results[$value]['sub_products']=$this->Packing_station_m->oil_reports($value,$from_date,$to_date);\n\t }\n\t foreach($packing_material_id as $key=>$value)\n\t {\n\t \t$pm_results[$value]['pm_name'] = $this->Common_model->get_value('packing_material',array('pm_id'=>$value),'name');\n\t \t$pm_results[$value]['sub_products']=$this->Packing_station_m->pm_reports($value,$from_date,$to_date);\n\t }\n\t foreach($free_gift_id as $key=>$value)\n\t {\n\t \t$fg_results[$value]['fg_name'] = $this->Common_model->get_value('free_gift',array('free_gift_id'=>$value),'name');\n\t \t$fg_results[$value]['sub_products']=$this->Packing_station_m->fg_reports($value,$from_date,$to_date);\n\t }\n // For emplty Truck Entry Results\n\n $empty_truck_results=$this->Packing_station_m->get_empty_truck_reports($from_date,$to_date);\n $invoice_details = array();\n foreach($empty_truck_results as $key => $value)\n {\n $tanker_id[$key]['tanker_id']=$value['tanker_id'];\n $weight_result[$key]=array();\n foreach($tanker_id as $key1=>$value1)\n {\n \n $invoice_details[$key1]=$this->Packing_station_m->get_empty_truck_invoice_details($value1);\n $invoice_id_arr = $invoice_details[$key1][0]['invoice_ids'];\n if($invoice_id_arr!='')\n {\n $single_invoice_id = $invoice_details[$key1][0]['single'];\n $result = $this->Packing_station_m->get_party_name($single_invoice_id);\n $invoice =explode(',', $invoice_id_arr);\n $total_weight = 0;\n foreach ($invoice as $key2 => $value2) \n {\n $inv_products = $this->Packing_station_m->get_invoice_products($value2);\n $sum_of_qty = 0;\n $t_pm_weight = 0;\n $t_gross = 0;\n foreach($inv_products as $keys3 =>$values3)\n { \n $sum_of_qty = $sum_of_qty + $values3['qty_in_kg'];\n $t_pm_weight = $t_pm_weight + $values3['pm_weight'];\n $t_gross = $sum_of_qty + $t_pm_weight ; \n }\n $total_weight+=$t_gross; \n\n }\n }\n else\n {\n $total_weight = '';\n }\n \n \n $invoice_details[$key1][0]['weight'] = $total_weight;\n $invoice_details[$key1][0]['agency_name']=$result;\n }\n \n \n }\n /*echo \"<pre>\";\n print_r($invoice_details); exit();*/\n $data['invoice_details']=$invoice_details;\n\t $data['oil_results']=$oil_results;\n\t $data['pm_results']=$pm_results;\n\t $data['fg_results']=$fg_results;\n\t $data['from_date']=$from_date;\n\t $data['to_date']=$to_date;\n }\n \n $data['packing_station_name']=$this->Common_model->get_value('plant',array('plant_id'=>$plant_id),'name');\n //$oil_tanker=$this->Packing_station_m->oil_reports($loose_oil_id);\n //echo \"<pre>\"; print_r($product_results); exit;\n $this->load->view('packing_station/packing_station_tanker_report_abstract_print',$data);\n\t}", "function sum_records_per_field($entries_records, $field_name, $is_stocks = FALSE)\n{\n\n $reports = [];\n\n foreach ($entries_records as $entry => $records) {\n\n $entry_loaded = node_load($entry);\n $entry_loaded_wrapper = entity_metadata_wrapper('node', $entry_loaded);\n\n // Getting the name of the indication or the product.\n $indication_or_product = $entry_loaded_wrapper->{$field_name}->value();\n if (isset($indication_or_product->name)) {\n $name = $indication_or_product->name;\n } else {\n $name = $indication_or_product[0]->name;\n }\n // If the indication is not init yet so create new array of monthes for it.\n if (!isset($reports[$name])) {\n $reports[$name] = [];\n $months = [\n 'December', 'January', 'February', 'March', 'April', 'May', 'June',\n 'July', 'August', 'September', 'October', 'November'\n ];\n foreach ($months as $month) {\n $zeros = [0, 0];\n if (!$is_stocks) {\n array_push($zeros, 0);\n }\n $reports[$name][$month] = $zeros;\n }\n }\n\n $records_loaded = entity_load(\"entry_month_record\", $records);\n\n foreach ($records_loaded as $id => $record) {\n $record_loaded_wrapper = entity_metadata_wrapper('entry_month_record', $record);\n $timestamp = $record_loaded_wrapper->field_entry_date->value();\n $date = getdate($timestamp);\n $month = $date['month'];\n if ($is_stocks) {\n if (!isset($reports[$name][$month][2])){\n array_push($reports[$name][$month], 0);\n }\n $reports[$name][$month][0] += $record_loaded_wrapper->field_stocks->value();\n $reports[$name][$month][1] += $record_loaded_wrapper->field_consumption->value();\n $usd_consumption = get_usd_consumption_per_record_id($id,'consumption');\n $reports[$name][$month][2] += (int)$usd_consumption;\n $usd_stocks = get_usd_consumption_per_record_id($id,'stocks');\n $reports[$name][$month][3] += (int)$usd_stocks;\n } else {\n $reports[$name][$month][0] += $record_loaded_wrapper->field_current_month_total->value();\n $reports[$name][$month][1] += $record_loaded_wrapper->field_current_month_new->value();\n $reports[$name][$month][2] += $record_loaded_wrapper->field_current_month_dropped->value();\n $reports[$name][$month][3] += $record_loaded_wrapper->field_current_month_dropped->value();\n }\n }\n }\n foreach ($reports as $product_name => $months){\n foreach ($months as $index => $month) {\n if (count($month) == 4) {\n if (isset($month[2])) {\n $reports[$product_name][$index][2] = number_format($month[2], 0, '','')+0;\n }\n if (isset($month[3])) {\n $reports[$product_name][$index][3] = number_format($month[3], 0, '','')+0;\n }\n }\n }\n }\n return $reports;\n}", "public function index()\n {\n $this->data->setDate(date('d-M-y'));\n $this->callView();\n\n }", "public function index()\n {\n $title = 'Dashboard - Stock';\n $stocks = StockDetail::all();\n return view('stock.index')->with(compact('stocks','title'));\n\n }", "function get_espacio_stocks_pdf()\n\t{\n\t\t$u = new Espacio_stock();\n\t\t$sql=\"select c.*, e.tag as estatus from cespacio_stocks as c left join estatus_general as e on e.id=c.estatus_general_id order by c.razon_social\";\n\t\t//Buscar en la base de datos\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function index()\n {\n $reactifs = Reactif::limit(5)->get();\n $vaccins = Vaccin::limit(5)->get();\n $echantillons = Echantillon::limit(5)->get();\n $substances = Substancespures::limit(5)->get();\n return view('stocks.index', compact('reactifs', 'vaccins', 'echantillons', 'substances'));\n }", "public function export($id)\n {\n \\App\\Configuration::updateValue('EXPORT_DECIMAL_SEPARATOR', ',');\n \n/* $stockcount = $this->stockcount\n ->with('stockcountlines')\n ->with('stockcountlines.product')\n ->findOrFail($id);\n*/\n\n $stockcount = $this->stockcount->with('warehouse')->findOrFail($id);\n $lines = $this->stockcountline\n ->select('stock_count_lines.*', 'products.id', 'products.reference', 'products.name')\n// ->with('product')\n ->where('stock_count_id', $id)\n ->join('products', 'products.id', '=', 'stock_count_lines.product_id') // Get field to order by\n ->orderBy('products.reference', 'asc')\n ->get();\n\n // Initialize the array which will be passed into the Excel generator.\n $data = []; \n\n // Define the Excel spreadsheet headers\n $data[] = [ 'product_id', 'reference', 'NOMBRE', 'quantity', 'cost_price', 'cost_average', 'last_purchase_price', 'stock_count_id', 'stock_count_NAME' ];\n // removed: , 'cost_price',\n\n // Convert each member of the returned collection into an array,\n // and append it to the payments array.\n foreach ($lines as $line) {\n // $data[] = $line->toArray();\n $data[] = [\n 'product_id' => $line->product_id,\n 'reference' => $line->reference,\n 'NOMBRE' => $line->name,\n 'quantity' => (float) $line->quantity,\n 'cost_price' => (float) $line->cost_price,\n 'cost_average' => (float) $line->cost_average,\n 'last_purchase_price' => (float) $line->last_purchase_price,\n 'stock_count_id' => $id,\n 'stock_count_NAME' => $stockcount->name,\n ];\n }\n\n $sheetName = $stockcount->warehouse->alias.' - '.$stockcount->warehouse->name;\n\n // Generate and return the spreadsheet\n Excel::create('Stock_Count_'.$id.'_'.$stockcount->warehouse->alias, function($excel) use ($id, $sheetName, $data) {\n\n // Set the spreadsheet title, creator, and description\n // $excel->setTitle('Payments');\n // $excel->setCreator('Laravel')->setCompany('WJ Gilmore, LLC');\n // $excel->setDescription('Stock Count file');\n\n // Build the spreadsheet, passing in the data array\n $excel->sheet($sheetName, function($sheet) use ($data) {\n $sheet->fromArray($data, null, 'A1', false, false);\n });\n\n })->download('xlsx');\n\n // https://www.youtube.com/watch?v=LWLN4p7Cn4E\n // https://www.youtube.com/watch?v=s-ZeszfCoEs\n }" ]
[ "0.6725458", "0.6673559", "0.64913917", "0.64118993", "0.6398449", "0.6045573", "0.5989129", "0.591034", "0.58747214", "0.5857466", "0.58574414", "0.58536905", "0.58112884", "0.58108544", "0.5806175", "0.58037215", "0.5803577", "0.5778431", "0.57490826", "0.57190955", "0.5718372", "0.5697307", "0.5688901", "0.56859416", "0.56542236", "0.5641097", "0.5631501", "0.5630337", "0.56092453", "0.5592164", "0.5592078", "0.55877954", "0.5585255", "0.5582556", "0.5577082", "0.55762935", "0.5572633", "0.5568294", "0.55680376", "0.55680376", "0.5564073", "0.555916", "0.55544543", "0.55446106", "0.5531871", "0.5526492", "0.5526492", "0.5526492", "0.5526492", "0.5526492", "0.55140316", "0.55140316", "0.55140316", "0.55133545", "0.55128354", "0.5508224", "0.5499976", "0.5495672", "0.549393", "0.5485364", "0.5482711", "0.546529", "0.5456339", "0.54556805", "0.5446717", "0.5445294", "0.54397774", "0.54388076", "0.542714", "0.5426116", "0.5425484", "0.5422915", "0.54199684", "0.5418402", "0.54112905", "0.54097754", "0.5406269", "0.54031295", "0.5394503", "0.5387043", "0.5351223", "0.5348797", "0.534617", "0.53433233", "0.5339618", "0.53383106", "0.5328824", "0.53277993", "0.5324728", "0.5320712", "0.5315613", "0.5313203", "0.5310033", "0.53076047", "0.5303179", "0.5302504", "0.52968585", "0.5296184", "0.5285955", "0.5278039" ]
0.6611976
2
Get Supplier rate of a product
public function supplier_rate($product_id) { $this->db->select('supplier_price'); $this->db->from('product_information'); $this->db->where(array('product_id' => $product_id)); $query = $this->db->get(); return $query->result_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStoreToOrderRate();", "public function getShippingRate();", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\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 rate()\n {\n return $this->rate;\n }", "public function rate()\n {\n return $this->rate;\n }", "public function getRate() {\n return $this->rate;\n }", "public function product_sales_supplier_rate($product_id=null,$startdate=null,$enddate=null)\n\t{\n\t\tif($startdate==null){$startdate= date('Y-m-d',strtotime('-30 days'));}\n\t\tif($enddate==null){$enddate= date('Y-m-d');}\n\t\t$product_id_input=$this->input->post('product_id');\n\t\tif(!empty($product_id_input))\n\t\t\t{\n\t\t\t\t$product_id=$this->input->post('product_id');\n\t\t\t\t$startdate=$this->input->post('from_date');\n\t\t\t\t$enddate=$this->input->post('to_date');\n\t\t\t}\n\t\t\n\t\t$this->product_id=$product_id;\n\t\t\n\t\t$CI =& get_instance();\n\t\t$this->auth->check_admin_auth();\n\t\t$CI->load->library('lproduct');\t\n $content = $CI->lproduct->product_sales_supplier_rate($product_id,$startdate,$enddate);\n\t\t$this->template->full_admin_html_view($content);\n\t}", "function getDiscountFor($product) {\n\t\treturn 30;\n\t}", "function tep_get_productPrice($product_id){\n\tif ($product_id){\n\t\tglobal $languages_id,$pf;\n\t\t$product_query = tep_db_query(\"select p.products_id,p.products_price,products_discount from \" . TABLE_PRODUCTS . \" p where p.products_id=\".(int)$product_id );\n\t\tif (tep_db_num_rows($product_query)) {\n\t\t\t$product = tep_db_fetch_array($product_query);\n\t\t\t$product_price = $product['products_price'];\n\t\t\t$rata = $product['products_discount'] > 0 ? number_format((1/(1-$product['products_discount']/100)),2,'.','') : PRODUCTS_RATE;//( $product['products_discount'] > 0 )? number_format( (1 - ($product['products_discount'] / 100)) , 2) : PRODUCTS_RATE;\n\t\t\t//$retail_price = $product['products_price'] * PRODUCTS_RATE;// * $rata;//\n\t\t\t//echo $rata;\n\t\t\t$pf -> loadProduct($product['products_id'],$languages_id);\n\t\t\t$result = array();\n\t\t\t$result['rsPrice'] = $pf -> getRetailSinglePrice($rata);\n\t\t\t$result['sPrice'] = $pf -> getSinglePrice();\n\t\t\treturn $result;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}else{\n\t\treturn false;\n\t}\n}", "public function getStoreToBaseRate();", "public function getProductPrice()\n {\n }", "public function getPrice(): float;", "public function getPrice(): float;", "public function getTaxRate();", "public function getSupplier()\n {\n return $this->supplier;\n }", "public function getExternalTaxRate();", "public function getExchangeRate();", "public function product_sales_supplier_rate($product_id = null, $startdate = null, $enddate = null) {\n\n if ($startdate == null) {\n\n $startdate = date('Y-m-d', strtotime('-30 days'));\n\n }\n\n if ($enddate == null) {\n\n $enddate = date('Y-m-d');\n\n }\n\n $product_id_input = $this->input->post('product_id');\n\n if (!empty($product_id_input)) {\n\n $product_id = $this->input->post('product_id');\n\n $startdate = $this->input->post('from_date');\n\n $enddate = $this->input->post('to_date');\n\n }\n\n\n\n $this->product_id = $product_id;\n\n\n\n $CI = & get_instance();\n\n $this->auth->check_admin_auth();\n\n $CI->load->library('lproduct');\n\n $content = $CI->lproduct->product_sales_supplier_rate($product_id, $startdate, $enddate);\n\n $this->template->full_admin_html_view($content);\n\n }", "public function getSupplier() {\n return $this->supplier;\n }", "public function getDiscountRate(){\n return $this->getParameter('discount_rate');\n }", "protected function _getFullRateInfo()\n {\n $rates = Mage::getModel('tax/sales_order_tax')->getCollection()->loadByOrder($this->getOrder())->toArray();\n $fullInfo = Mage::getSingleton('tax/calculation')->reproduceProcess($rates['items']);\n return $fullInfo;\n }", "public function rateProduct(Request $request)\n {\n\n // Create a new empty Rating collection.\n $rating = new Rating;\n\n // Populate the \"rating\" collection with the values,\n // got from the user-submitted form.\n $rating->rating_product = $request->product;\n $rating->rating_rate = $request->userRating;\n\n // Save the \"rating\" collection to database.\n $rating->save();\n\n\n // Get all ratings records for the required product.\n $newRating = Rating::select('rating_rate')->where('rating_product', $request->product)->get();\n\n // Get the average rating of the required product, \n // and format it with two decimal places.\n $averageRating = $newRating->average('rating_rate');\n $formattedRating = number_format($averageRating, 2);\n\n return response()->json($formattedRating);\n }", "public function getRate(Currency $currency);", "function getExchangeRate($currency);", "function get_list_product_rating() {\n\n global $product;\n\n if ( ! wc_review_ratings_enabled() ) {\n \treturn;\n }\n\n echo wc_get_rating_html( $product->get_average_rating() ); // WordPress.XSS.EscapeOutput.OutputNotEscaped.\n\n }", "public function getAmountRate()\n {\n return $this->amountRate;\n }", "public function getRate()\n {\n $ratesData = $this->getDataFromSource();\n\n if (!$ratesData) {\n return null;\n }\n\n $rateElements = $ratesData->xpath('/source/organizations/organization/currencies/c[@id=\"USD\"]');\n\n $rateSourcesCount = count($rateElements);\n\n if (!$rateSourcesCount) {\n return null;\n }\n\n $sumRate = 0;\n\n foreach ($rateElements as $rateSource) {\n $sumRate += (float)$rateSource->attributes()->ar;\n }\n\n return $sumRate / $rateSourcesCount;\n }", "public static function getratingItem()\n {\n \n $value=DB::table('product_rating')->join('users','users.id','product_rating.user_id')->join('product','product.product_id','product_rating.product_id')->orderBy('product_rating.rate_id', 'desc')->get(); \n return $value;\n\t\n }", "public function getBaseToOrderRate();", "public function getRating();", "public function getRating();", "public function getCurrentPrice() : float;", "function tep_get_tax_rate_value($class_id) {\n return tep_get_tax_rate($class_id, -1, -1);\n }", "public function getRateQualifier()\n {\n return $this->rateQualifier;\n }", "public function getRates()\n {\n return $this->_rates;\n }", "function getDeliveryCharges($product_id = null, $seller_id = null, $condition_id = null) {\n\t\tif(empty($product_id) && is_null($seller_id) ){\n\t\t}\n\t\tApp::import('Model','ProductSeller');\n\t\t$this->ProductSeller = & new ProductSeller();\n\t\t$prodSellerInfo = $this->ProductSeller->find('first', array('conditions'=>array('ProductSeller.product_id'=>$product_id ,'ProductSeller.seller_id'=>$seller_id , 'ProductSeller.condition_id'=>$condition_id ),'fields'=>array('ProductSeller.standard_delivery_price')));\n\t\t//pr($prodSellerInfo);\n\t\tif(is_array($prodSellerInfo)){\n\t\t\treturn $prodSellerInfo['ProductSeller']['standard_delivery_price'];\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getRate()\n {\n return $this->hasOne(PaymentRate::class, ['id' => 'rate_id']);\n }", "public function rating()\n {\n $rating = Review::where('product_id', $this->id)->avg('rating');\n if ($rating) {\n $rating = (float)$rating;\n $rating = round($rating, 2);\n } else {\n $rating = 0;\n }\n return $rating;\n }", "public function getProdSaleRateByReff($pid, $reffId){\n\t \t$this->db->select('COP.order_rate');\n\t\t$this->db->from('client_order_prodcts AS COP');\n\t\t$this->db->where(\"COP.order_pid\",$pid);\n\t\t$this->db->where(\"COP.id\",$reffId);\n\t\t$this->db->limit(1);\n\t\t\n\t\t$query_prod_rate = $this->db->get();\n\t\t//echo $this->db->last_query();die;\n\t\tif($query_prod_rate->num_rows()>0){\n\t\t\treturn $query_prod_rate->result_array();\n\t\t}else{\n\t\t\treturn array();\n\t\t}\n\t }", "public function getPrice(){ return $this->price_rur; }", "public function getProductPrice(){\n return $this->product_price;\n }", "function sale_price() {\n\t\treturn $this->_apptivo_sale_price;\n\t}", "public function getCurrentCurrencyRate() {\r\n\t\treturn $this->_storeManager->getStore()->getCurrentCurrencyRate();\r\n\t}", "public function getCurrentCurrencyPriceOfSellerProduct()\n {\n $sp_id = $this->sp_id;\n $user_helper = new UserHelper;\n $to_curr_id = $user_helper-> getCurrentUserChoiceCurrencyId();\n $price = $this->getPriceOfSellerProduct($sp_id);\n $from_curr_id = $this->getCurrentPriceObjectOfSellerProduct($sp_id)->curr_id;\n $currency_helper = new CurrencyHelper;\n return $currency_helper->currencyConvert($from_curr_id,$to_curr_id,$price);\n }", "function get_tax_base_rate() {\n\t\t\n\t\tif ( $this->is_taxable() && get_option('woocommerce_calc_taxes')=='yes') :\n\t\t\t\n\t\t\t$_tax = &new woocommerce_tax();\n\t\t\t$rate = $_tax->get_shop_base_rate( $this->data['tax_class'] );\n\t\t\t\n\t\t\treturn $rate;\n\t\t\t\n\t\tendif;\n\t\t\n\t}", "function getPurchasePrice($id, $supplier_id = null) {\n \n $result = $this->Product->getShortDet($id);\n\n $this->loadModel('Productsupplier');\n $this->Productsupplier->recursive = -1;\n $condition['product_id'] = $id;\n $condition['status'] = 'yes';\n if($supplier_id) {\n $condition['supplier_id'] = $supplier_id;\n }\n $supplierPrice = $this->Productsupplier->find('first', array('conditions' => $condition, 'fields' => array('price')));\n if($supplierPrice && $supplierPrice['Productsupplier']['price']) {\n $result['price'] = $supplierPrice['Productsupplier']['price'];\n }\n \n echo json_encode($result);\n exit;\n }", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice()\n {\n return 0.2;\n }", "public function cost()\n {\n return $this->getPrice();\n }", "public function getPrice() : float\n {\n return $this->get('price', 'products');\n }", "public static function get_commission_rate( $product_id )\n\t{\n\n\t\t$commission = 0; \n\n\t\t$parent = get_post_ancestors( $product_id );\n\t\tif ( $parent ) $product_id = $parent[ 0 ];\n\n\t\t$vendor_id = TGS_Function_Vendors::get_vendor_from_product( $product_id );\n\n\t\t$product_commission = get_post_meta( $product_id, 'pv_commission_rate', true );\n\t\t$vendor_commission = TGS_Function_Vendors::get_default_commission( $vendor_id );\n\t\t$default_commission = TGS_Vendors::$pv_options->get_option( 'default_commission' );\n\n\t\tif ( $product_commission != '' && $product_commission !== false ) {\n\t\t\t$commission = $product_commission;\n\t\t}\n\n\t\telse if ( $vendor_commission != '' && $vendor_commission !== false ) {\n\t\t\t$commission = $vendor_commission;\n\t\t}\n\n\t\telse if ( $default_commission != '' && $default_commission !== false ) {\n\t\t\t$commission = $default_commission;\n\t\t}\n\n\t\treturn apply_filters( 'tgs_commission_rate_percent', $commission, $product_id );\n\t}", "public function getProduct() {\n\t\t// if this is just a model made on our end, we might not the serialized product yet\n\t\t// alternatively: newer BillForward may omit serialized product and necessitate a fetch\n\t\tif (!$this->product) {\n\t\t\tif (!$this->productID) {\n\t\t\t\tthrow new Bf_PreconditionFailedException(\"This Bf_ProductRatePlan has neither a 'product' specified, nor a 'productID' by which to obtain said product.\");\n\t\t\t}\n\t\t\t$this->product = Bf_Product::getByID($this->productID);\n\t\t}\n\t\treturn $this->product;\n\t}", "public function getProduct();", "public function cost()\n {\n return $this->price;\n }", "public function getRate(): ?float\n {\n return $this->rate;\n }", "public function GetRates()\n\t{\n\t\treturn $this->rates;\n\t}", "public function getMyPriceForSKU($request);", "public function getExchangeRate()\n {\n return $this->exchange_rate;\n }", "public function getExchangeRate()\n\t{\n\t\treturn $this->exchangeRate; \n\n\t}", "protected function getTax(Mage_Catalog_Model_Product $product){\n $taxRate = array();\n\n if(empty($this->taxCollection[$product->getTaxClassId()])){\n $taxCollection = Mage::getModel('tax/calculation')->getCollection()\n ->addFieldToFilter('product_tax_class_id', array('eq' => $product->getTaxClassId()));\n\n foreach($taxCollection as $taxes){\n $tax = Mage::getSingleton('tax/calculation')->getRatesByCustomerAndProductTaxClasses($taxes['customer_tax_class_id'], $product->getTaxClassId());\n foreach($tax as $taxRule){\n $this->taxCollection[$product->getTaxClassId()][] = $taxRule['country'] . ':' . $taxRule['state'] . ':' . $taxRule['value'] . ':y';\n // Use data as array key so there is not duplicate data\n $taxRate[$taxRule['country'].$taxRule['state'].$taxRule['postcode'].$taxRule['product_class']] = $taxRule['country'] . ':' . $taxRule['state'] . ':' . $taxRule['value'] . ':y';\n }\n }\n } else {\n foreach($this->taxCollection[$product->getTaxClassId()] as $taxRule){\n $taxRate[] = $taxRule;\n }\n }\n\n return implode(',', $taxRate);\n }", "public static function getRates() {\n $result = self::get(self::getPath('rates'));\n \n Return $result;\n }", "public function getDollarPrice(): float;", "function ppt_resources_get_consumptions_stocks_per_product($data)\n{\n if (!isset($data['year']) || (!isset($data['uid']))) {\n return services_error('Year or UID are not defined!', 500);\n }\n\n global $user;\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid']) && !empty($data['uid'])) {\n $uid = $data['uid'];\n } else {\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n } else {\n $is_rep = FALSE;\n if (is_rep($user)) {\n $is_rep = TRUE;\n }\n $reps = ppt_resources_get_sales_manager_reps($uid, $countries, $is_rep);\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $consumptions = sum_records_per_field_grouped_by_account($entries_records, 'field_product');\n\n return $consumptions;\n}", "public function getRating(){\r\n\t\treturn $this->rating;\r\n\t}", "public function getPrice(): string;", "function discount_rate($discount_rate=null)\n {\n if (isset($discount_rate)) $this->discount_rate = $discount_rate;\n return $this->discount_rate;\n }", "public function resolvePrice();", "public function getPrice() {\n }", "public function getPrice()\n {\n return parent::getPrice();\n }", "function customerDiscount()\r\n\t{\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT Wert FROM \" . PREFIX . \"_modul_shop_kundenrabatte WHERE GruppenId = '\".UGROUP.\"' LIMIT 1\");\r\n\t\t$row = $sql->fetchrow();\r\n\t\t$sql->close();\r\n\t\tif(is_object($row))\r\n\t\t\treturn $row->Wert;\r\n\t}", "public function getBestPrice() {\n\t\ttry {\n\t\t\treturn Mage::getSingleton ( 'meinpaket/service_productData_requestService' )->requestBestPrices ();\n\t\t} catch ( Exception $e ) {\n\t\t\tMage::logException ( $e );\n\t\t}\n\t\treturn null;\n\t}", "public function getExchangeRate()\n {\n return $this->exchangeRate;\n }", "public function getExchangeRate()\n {\n return $this->exchangeRate;\n }", "public function getExchangeRate()\n {\n return $this->exchangeRate;\n }", "function get_product_price($field_product_id){\r\n\r\n $this->load->model('logistics_model');\r\n $result = $this->logistics_model->get_product_price($field_product_id);\r\n $value = $result->price;\r\n echo $value;\r\n }", "public function getPricing() {\r\n\t\t\treturn $this->_pricing;\r\n\t\t}", "public function getPriceModel()\n {\n return Mage::getSingleton('catalog/product_type')->priceFactory($this->getTypeId());\n }", "public function GetRating(){\n\t\treturn $this->rating;\n\t}", "public function getPriceProduct()\n {\n return $this->priceProduct;\n }", "function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n global $customer_zone_id, $customer_country_id;\n\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n if (!tep_session_is_registered('customer_id')) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n } else {\n $country_id = $customer_country_id;\n $zone_id = $customer_zone_id;\n }\n }\n\n $tax_query = tep_db_query(\"select SUM(tax_rate) as tax_rate from \" . TABLE_TAX_RATES . \" tr left join \" . TABLE_ZONES_TO_GEO_ZONES . \" za ON tr.tax_zone_id = za.geo_zone_id left join \" . TABLE_GEO_ZONES . \" tz ON tz.geo_zone_id = tr.tax_zone_id WHERE (za.zone_country_id IS NULL OR za.zone_country_id = '0' OR za.zone_country_id = '\" . $country_id . \"') AND (za.zone_id IS NULL OR za.zone_id = '0' OR za.zone_id = '\" . $zone_id . \"') AND tr.tax_class_id = '\" . $class_id . \"' GROUP BY tr.tax_priority\");\n if (tep_db_num_rows($tax_query)) {\n $tax_multiplier = 0;\n while ($tax = tep_db_fetch_array($tax_query)) {\n $tax_multiplier += $tax['tax_rate'];\n }\n return $tax_multiplier;\n } else {\n return 0;\n }\n}", "function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n\n \n//Eversun mod for sppc and qty price breaks\n// global $customer_zone_id, $customer_country_id;\n global $customer_zone_id, $customer_country_id, $sppc_customer_group_tax_exempt;\n\n if(!tep_session_is_registered('sppc_customer_group_tax_exempt')) {\n $customer_group_tax_exempt = '0';\n } else {\n $customer_group_tax_exempt = $sppc_customer_group_tax_exempt;\n }\n\n if ($customer_group_tax_exempt == '1') {\n return 0;\n }\n//Eversun mod end for sppc and qty price breaks\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n if (!tep_session_is_registered('customer_id')) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n } else {\n $country_id = $customer_country_id;\n $zone_id = $customer_zone_id;\n }\n }\n\n $tax_query = tep_db_query(\"select sum(tax_rate) as tax_rate from \" . TABLE_TAX_RATES . \" tr left join \" . TABLE_ZONES_TO_GEO_ZONES . \" za on (tr.tax_zone_id = za.geo_zone_id) left join \" . TABLE_GEO_ZONES . \" tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '\" . (int)$country_id . \"') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '\" . (int)$zone_id . \"') and tr.tax_class_id = '\" . (int)$class_id . \"' group by tr.tax_priority\");\n if (tep_db_num_rows($tax_query)) {echo \"}}}}{{{{{\";\n $tax_multiplier = 1.0;\n while ($tax = tep_db_fetch_array($tax_query)) {\n $tax_multiplier *= 1.0 + ($tax['tax_rate'] / 100);\n }\n return ($tax_multiplier - 1.0) * 100;\n } else {\n return 0;\n }\n }", "public function Fetch_price(){\n\n $ProductID = $this->input->post('p_id');\n $result = $this->db-> query(\"select * from Product where ProductID = '$ProductID'\")->row();\n $max_sell_price = $result->Price;\n $min_sell_price = $result->MinPrice;\n $max_discount_price = $max_sell_price - $min_sell_price ;\n\n echo $max_sell_price.\",\".$min_sell_price.\",\".$max_discount_price;\n }", "public function getRate(): ?string\n {\n return $this->rate;\n }", "public function getRate(): ?string\n {\n return $this->rate;\n }", "public function getProductPrice()\n {\n return $this->getPrice(!sfConfig::get('app_tax_display_prices_with_tax', false));\n }", "function get_product_price($product_id)\n {\n $price = $this->get_type_name_by_id('product', $product_id, 'sale_price');\n $discount = $this->get_type_name_by_id('product', $product_id, 'discount');\n $discount_type = $this->get_type_name_by_id('product', $product_id, 'discount_type');\n if ($discount_type == 'amount') {\n $number = ($price - $discount);\n }\n if ($discount_type == 'percent') {\n $number = ($price - ($discount * $price / 100));\n }\n return number_format((float) $number, 2, '.', '');\n }", "public function getProductPrice()\n {\n $currentProduct = Mage::registry('current_product');\n\n //seria melhor usar uma constante nativa, mas nao encontrei.\n if ('configurable' == $currentProduct->getTypeId()) {\n return $currentProduct->getFinalPrice();\n }\n\n if ('bundle' == $currentProduct->getTypeId()) {\n $_priceModel = $currentProduct->getPriceModel();\n list($_minimalPriceTax, $_maximalPriceTax) = $_priceModel->getTotalPrices($currentProduct, null, null, false);\n\n return $_minimalPriceTax;\n }\n\n if ('grouped' == $currentProduct->getTypeId()) {\n $regularPrice = 0;\n $usedProds = $currentProduct->getTypeInstance(true)->getAssociatedProducts($currentProduct); \n foreach ($usedProds as $child) {\n if ($child->getId() != $currentProduct->getId()) {\n $regularPrice += $child->getPrice();\n }\n }\n return $regularPrice;\n }\n\n return $currentProduct->getFinalPrice();\n }", "public function getPrice()\n {\n return $this->get(self::_PRICE);\n }", "public function getProductPrice()\n {\n $currentProduct = $this->_registry->registry('current_product');\n \n //qual preco retornar? o base ou o special???\n //o ideal seria usar constante nativa, mas nao encontrei.\n if ('configurable' == $currentProduct->getTypeId()) {\n return $currentProduct->getPriceInfo()->getPrice('regular_price')->getMinRegularAmount()->getValue();\n }\n\n if ('bundle' == $currentProduct->getTypeId()) {\n return $currentProduct->getPriceInfo()->getPrice('regular_price')->getMinimalPrice()->getValue();\n }\n\n if ('grouped' == $currentProduct->getTypeId()) {\n $regularPrice = 0;\n $usedProds = $currentProduct->getTypeInstance(true)->getAssociatedProducts($currentProduct); \n foreach ($usedProds as $child) {\n if ($child->getId() != $currentProduct->getId()) {\n $regularPrice += $child->getPrice();\n }\n }\n return $regularPrice;\n }\n\n return $currentProduct->getFinalPrice();\n }", "function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n global $customer_zone_id, $customer_country_id;\n\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n }\n\n $Qtax = Registry::get('Db')->prepare('select sum(tax_rate) as tax_rate from :table_tax_rates tr left join :table_zones_to_geo_zones za on tr.tax_zone_id = za.geo_zone_id left join :table_geo_zones tz on tz.geo_zone_id = tr.tax_zone_id where (za.zone_country_id IS NULL OR za.zone_country_id = \"0\" OR za.zone_country_id = :zone_country_id) AND (za.zone_id IS NULL OR za.zone_id = \"0\" OR za.zone_id = :zone_id) AND tr.tax_class_id = :tax_class_id group by tr.tax_priority');\n $Qtax->bindInt(':zone_country_id', (int)$country_id);\n $Qtax->bindInt(':zone_id', (int)$zone_id);\n $Qtax->bindInt(':tax_class_id', (int)$class_id);\n $Qtax->execute();\n\n if ($Qtax->fetch() !== false) {\n $tax_multiplier = 0;\n\n do {\n $tax_multiplier += $Qtax->value('tax_rate');\n } while ($Qtax->fetch());\n\n return $tax_multiplier;\n } else {\n return 0;\n }\n }", "function getRating()\n {\n return $this->rating;\n }", "public function rate()\n {\n\n }" ]
[ "0.6822923", "0.662737", "0.6521704", "0.6521704", "0.6521704", "0.6521704", "0.6521704", "0.6475667", "0.64574236", "0.64574236", "0.64202267", "0.6369425", "0.6317291", "0.6304636", "0.6234579", "0.6218331", "0.6202683", "0.6202683", "0.6196469", "0.6195779", "0.6173822", "0.6173407", "0.6161715", "0.61556166", "0.61307967", "0.6115434", "0.6112736", "0.610308", "0.61003137", "0.6084681", "0.6079705", "0.607831", "0.6052935", "0.6039358", "0.60330176", "0.60330176", "0.60325426", "0.6005549", "0.60006887", "0.5998239", "0.5976591", "0.5916511", "0.58949757", "0.58760315", "0.5861502", "0.5858822", "0.58501774", "0.5844288", "0.58397174", "0.582723", "0.58225447", "0.58161557", "0.58161557", "0.58161557", "0.58161557", "0.5809124", "0.5806369", "0.57776034", "0.5768626", "0.5760153", "0.57589287", "0.5758844", "0.5750309", "0.57483435", "0.5744317", "0.5739058", "0.57174563", "0.5714357", "0.5714027", "0.5707278", "0.5700595", "0.56888735", "0.5688062", "0.568638", "0.56816137", "0.56813085", "0.56806076", "0.5673301", "0.56623983", "0.566063", "0.566063", "0.566063", "0.56554824", "0.5646044", "0.5644129", "0.5643707", "0.56416965", "0.5640087", "0.56341165", "0.56259644", "0.5623409", "0.5623409", "0.5618666", "0.56173897", "0.56168044", "0.5615046", "0.5613193", "0.5612975", "0.561293", "0.56083363" ]
0.7799357
0
Retrieve invoice Edit Data
public function retrieve_invoice_editdata($invoice_id) { $this->db->select(' a.*, b.customer_name, c.*, c.product_id, d.product_name, d.product_model, e.unit_short_name as unit, '); $this->db->from('invoice a'); $this->db->join('customer_information b','b.customer_id = a.customer_id'); $this->db->join('invoice_details c','c.invoice_id = a.invoice_id'); $this->db->join('product_information d','d.product_id = c.product_id'); $this->db->join('unit e','e.unit_id = d.unit','left'); $this->db->where('a.invoice_id',$invoice_id); $query = $this->db->get(); if ($query->num_rows() > 0) { return $query->result_array(); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function edit() {\n $this->wireframe->hidePrintButton();\n \n if($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n if(!$this->active_invoice->canEdit($this->logged_user)) {\n $this->response->forbidden();\n } // if\n\n $invoice_data = $this->request->post('invoice');\n if(!is_array($invoice_data)) {\n $invoice_data = array(\n 'number' => $this->active_invoice->getNumber(),\n 'due_on' => $this->active_invoice->getDueOn(),\n 'issued_on' => $this->active_invoice->getIssuedOn(),\n 'currency_id' => $this->active_invoice->getCurrencyId(),\n 'purchase_order_number' => $this->active_invoice->getPurchaseOrderNumber(),\n 'private_note' => $this->active_invoice->getPrivateNote(),\n 'company_id' => $this->active_invoice->getCompanyId(),\n 'company_address' => $this->active_invoice->getCompanyAddress(),\n 'project_id' => $this->active_invoice->getProjectId(),\n 'note' => $this->active_invoice->getNote(),\n 'language_id' => $this->active_invoice->getLanguageId(),\n 'payment_type' => $this->active_invoice->getAllowPayments(),\n 'second_tax_is_compound' => $this->active_invoice->getSecondTaxIsCompound()\n );\n if(is_foreachable($this->active_invoice->getItems())) {\n $invoice_data['items'] = array();\n foreach($this->active_invoice->getItems() as $item) {\n $invoice_data['items'][] = array(\n 'id'\t\t\t\t\t => $item->getId(),\n 'description' => $item->getDescription(),\n 'unit_cost' => $item->getUnitCost(),\n 'quantity' => $item->getQuantity(),\n 'first_tax_rate_id' => $item->getFirstTaxRateId(),\n 'second_tax_rate_id' => $item->getSecondTaxRateId(),\n 'total' => $item->getTotal(),\n 'subtotal' => $item->getSubtotal(),\n 'time_record_ids' => $item->getTimeRecordIds(),\n );\n } // foreach\n } // if\n } // if\n \n $this->response->assign('invoice_data', $invoice_data);\n $this->response->assign(Invoices::getSettingsForInvoiceForm($this->active_invoice));\n \n if ($this->request->isSubmitted()) {\n \tif (!$this->request->isAsyncCall()) {\n \t\t$this->response->badRequest();\n \t} // if\n \t\n \ttry {\n if (!is_foreachable($invoice_data['items'])) {\n throw new ValidationErrors(lang('At least one invoice item is required'));\n } // if\n\n \t\tDB::beginWork('Editing Invoice');\n\n \t\t$this->active_invoice->setAttributes($invoice_data);\n\n if ($this->active_invoice->getSecondTaxIsEnabled()) {\n $this->active_invoice->setSecondTaxIsCompound(array_var($invoice_data, 'second_tax_is_compound', false));\n } // if\n\n $this->active_invoice->setItems($invoice_data['items']);\n \t\t\n \t\tif ($this->active_invoice->isIssued()) {\n \t\t $issued_on = isset($invoice_data['issued_on']) ? new DateValue($invoice_data['issued_on']) : new DateValue();\n \t\t $this->active_invoice->setIssuedOn($issued_on);\n \t\t} //if\n\n \t\t\n \t\t$this->active_invoice->save();\n \n// TODO: resolve the issue when dialog has to be redirected to the notification page\n// $this->flash->success('\":number\" has been updated', array('number' => $this->active_invoice->getName()));\n// if ($this->active_invoice->isIssued()) {\n// $this->response->redirectTo('invoice_notify', array('invoice_id' => $this->active_invoice->getId()));\n// } else {\n// $this->response->redirectToUrl($this->active_invoice->getViewUrl()); \n// } // if\n\n \t\tDB::commit('Invoice Edited');\n\n\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t'as' => 'invoice', \n 'detailed' => true,\n ));\n \n \t} catch (Exception $e) {\n \t\tDB::rollback('Invoice Editing Failed');\n \t\t$this->response->exception($e);\n \t} // try\n \t\n } // if\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoices $invoice)\n {\n //\n }", "public function edit(InvoicesDetails $invoicesDetails)\n {\n //\n }", "public function edit(Invoices $invoices)\n {\n //\n }", "public function edit(Invoice $invoice) {\n\n\t\t// $return['invoices'] = \\App\\Invoice::all();\n\t\t// return view('/invoices/editform', $return);\n\t}", "public function editInvoice($id){ \n $invoice = WlgCorporationInvoice::find($id);\n\n $invoiceForms = WlgCorporationInvoice::where('if_id', $id)->get()->toArray();\n return view('edit-wlg-corportaion-invoice', compact('invoice', 'invoiceForms'));\n }", "public function edit(ImportInvoice $importInvoice)\n {\n //\n }", "public function editAction() {\n\t\t$form = $this->getForm ( '/admin/invoices/process' );\n\t\t\n\t\t$id = $this->getRequest ()->getParam ( 'id' );\n\t\t\n\t\tif (! empty ( $id ) && is_numeric ( $id )) {\n\t\t\t$rs = $this->invoices->find ( $id )->toArray ();\n\t\t\tif (! empty ( $rs )) {\n\t\t\t\t$rs ['invoice_date'] = Shineisp_Commons_Utilities::formatDateOut ( $rs ['invoice_date'] );\n\t\t\t\t\n\t\t\t\t$parent = Customers::find ( $rs ['customer_id'] );\n\t\t\t\t\n\t\t\t\t//if customer comes from reseller\n\t\t\t\tif ($parent ['parent_id']) {\n\t\t\t\t\t$rs ['customer_parent_id'] = $parent ['parent_id'];\n\t\t\t\t} else {\n\t\t\t\t\t$rs ['customer_parent_id'] = $rs ['customer_id'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Create the buttons in the edit form\r\n\t\t\t\t$this->view->buttons = array(\r\n\t\t\t\t\t\tarray(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\tarray(\"url\" => \"/admin/invoices/confirm/id/$id\", \"label\" => $this->translator->translate('Delete'), \"params\" => array('css' => null)),\r\n\t\t\t\t\t\tarray(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\tarray(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)),\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t// Check if the order has been invoiced\r\n\t\t\t\t$this->view->buttons[] = array(\"url\" => \"/admin/orders/sendinvoice/id/$id\", \"label\" => $this->translator->translate('Email invoice'), \"params\" => array('css' => null));\n\t\t\t\t$this->view->buttons[] = array(\"url\" => \"/admin/invoices/print/id/$id\", \"label\" => $this->translator->translate('Print invoice'), \"params\" => array('css' => null));\n\t\t\t\t$this->view->buttons[] = array(\"url\" => \"/admin/invoices/confirmoverwrite/id/$id\", \"label\" => $this->translator->translate('Overwrite invoice'), \"params\" => array('css' => null));\r\n\t\t\t\t$this->view->buttons[] = array(\"url\" => \"/admin/orders/edit/id/\".$rs ['order_id'], \"label\" => $this->translator->translate('Order'), \"params\" => array('css' => null));\r\n\t\t\t\t\n\t\t\t\t$form->populate ( $rs );\n\t\t\t}\n\t\t}\n\t\t$this->view->title = $this->translator->translate(\"Invoice Edit\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can edit the selected order.\");\n\t\t\n\t\t$this->view->mex = urldecode ( $this->getRequest ()->getParam ( 'mex' ) );\n\t\t$this->view->mexstatus = $this->getRequest ()->getParam ( 'status' );\n\t\t\n\t\t$this->view->form = $form;\n\t\t$this->render ( 'applicantform' );\n\t}", "public function edit($id)\n{\n$invoice = invoice::where('invoice_number', $id)->first();\n$invoice_details = invoice_details::where('invoice_number', $id)->get();\n$invoice_attachment = invoice_attachment::where('invoice_number', $id)->get();\nreturn view('invoice.details', ['details' => $invoice_details, 'attachment' => $invoice_attachment, 'invoice' =>\n$invoice]);\n}", "public function edit($orderNo)\n {\n $data = [];\n $data['menu'] = 'sales';\n if (isset($_GET['type']) && $_GET['type'] == 'project') {\n $data['menu'] = 'project';\n }\n $data['sub_menu'] = 'sales/direct-invoice';\n $data['page_title'] = __('Edit Invoice');\n $data['url'] = 'invoice/list';\n\n\t\t$data['invoiceData'] = SaleOrder::with(['customer:id'])->find($orderNo);\n if (empty($data['invoiceData'])) {\n \\Session::flash('fail', __('The data you are trying to access is not found.'));\n return redirect()->back();\n }\n if (!empty($data['invoiceData']->project_id)) {\n $data['project_id'] = $data['invoiceData']->project_id;\n $data['projects'] = Project::all();\n }\n $data['customerData'] = Customer::with(['currency:id,name,symbol', 'CustomerBranch'])->find($data['invoiceData']->customer_id);\n $data['currencySymbol'] = $data['customerData']->currency->symbol;\n\n foreach ($data['invoiceData']->saleOrderDetails as $key => $value) {\n if ($data['invoiceData']->has_tax == 1 && $value->quantity > 0 ) {\n $value->taxList = (new SaleTax)->getSaleTaxes($value->id);\n }\n }\n\n $data['files'] = (new File)->getFiles('Direct Invoice', $orderNo);\n if (!empty($data['files'])) {\n $data['filePath'] = \"public/uploads/invoice_order\";\n foreach ($data['files'] as $key => $value) {\n $value->icon = getFileIcon($value->file_name);\n $explodes = explode(\"_\", $value->file_name);\n $value->originalName = implode(\"_\", array_slice($explodes, 1, count($explodes) - 1));\n }\n }\n\n $data['locations'] = Location::getAll()->where('is_active', 1);\n $data['currencies'] = Currency::getAll();\n $data['paymentTerms'] = PaymentTerm::getAll();\n $data['taxTypeList'] = TaxType::getAll();\n $data['currencies'] = Currency::getAll();\n $data['countries'] = Country::getAll();\n $data['default_currency'] = Preference::getAll()->where('field', 'dflt_currency_id')->where('category', 'company')->first();\n $data['default_currency_symbol'] = Currency::find($data['default_currency']->value);\n\n $data['taxes'] = json_encode($data['taxTypeList']);\n\n $taxOptions = '';\n $selectStart = \"<select name='item_tax[]' class='inputTax form-control bootstrap-select selectpicker' multiple>\";\n $selectEnd = \"</select>\";\n $selectStartCustom = \"<select class='inputTax form-control bootstrap-select selectpicker' multiple name='custom_item_tax[1][]'>\";\n $selectEndCustom = \"</select>\";\n $taxHiddenField=\"\";\n foreach ($data['taxTypeList'] as $key => $value) {\n $taxHiddenField.=\"<input type='hidden' class='itemTaxAmount itemTaxAmount-\".$value->id.\"'>\";\n $taxOptions .= \"<option title='\" . $value->tax_rate . \"%' value='\" . $value->id . \"' taxrate='\" . $value->tax_rate . \"'>\" . $value->name . '(' . $value->tax_rate . ')' . \"</option>\";\n }\n $data['tax_type'] = $selectStart . $taxOptions . $selectEnd;\n $data['custom_tax_type'] = $selectStartCustom . $taxOptions . $selectEndCustom.$taxHiddenField;\n $data['tax_type_custom'] = $selectStartCustom . $taxOptions . $selectEndCustom.$taxHiddenField;\n $preference = Preference::getAll()->pluck('value', 'field')->toArray();\n $data['decimal_digits'] = $preference['decimal_digits'];\n $data['thousand_separator'] = $preference['thousand_separator'];\n $data['symbol_position'] = $preference['symbol_position'];\n $data['exchange_rate_decimal_digits'] = $preference['exchange_rate_decimal_digits'];\n\n return view('admin.invoice.edit', $data);\n }", "function detail($InvoiceId)\n { \n // check if the invoice exists before trying to edit it\n $data['invoice'] = $this->Invoice_model->get_invoice($InvoiceId);\n $data['invoicedetail']=$this->GenricModel->singlequery('select distinct i.InvoiceId,i.BillNo,i.SupplierName,i.SupplierNumber,i.SupplierAddress,i.PurchaseDate,i.PurchaseDateBS,i.Description,id.TAmount,id.Item,id.Quantity,id.Price,id.Amount from invoice i join invoicedetail id on id.InvoiceId=i.InvoiceId where i.InvoiceId='.$InvoiceId);\n\t\t$data['item']=$this->GenricModel->query('select * from invoicedetail where InvoiceId='.$InvoiceId);\n\t\t\n\t\t//var_dump($data['item']);die;\n if(isset($data['invoice']['InvoiceId']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t'BillNo' => $this->input->post('BillNo'),\n\t\t\t\t'PurchaseDate' => $this->input->post('PurchaseDate'),\n\t\t\t\t'PurchaseDateBS' => $this->input->post('PurchaseDateBS'),\n\t\t\t\t'SupplierName' => $this->input->post('SupplierName'),\n\t\t\t\t'SupplierNumber' => $this->input->post('SupplierNumber'),\n\t\t\t\t'SupplierAddress' => $this->input->post('SupplierAddress'),\n\t\t\t\t'Description' => $this->input->post('Description'),\n\t\t\t\t\n );\n $this->Invoice_model->update_invoice($InvoiceId,$params); \n redirect('invoice/index');\n }\n else\n {\n\t\t\t\t $userid = $this->session->userdata('userid');\n\t\t\t\t$data['users'] = $this->User_model->get_user($userid);\n $data['_view'] = 'invoice/detail';\n $this->load->view('layouts/main1',$data);\n }\n }\n else\n show_error('The invoice you are trying to edit does not exist.');\n }", "public function edit()\n {\n\t$this->log(\"edit function\");\n\n \t// Check whether client is logged in\n // $logged_in = false;\n // if ($this->isLoggedIn()) {\n // $logged_in = true;\n // }\n\n // Get custom fields from Client controller => save\n \t$client_custom_fields = $this->Clients->getCustomFieldValues(1);\n return $this->set('client_custom_fields', $client_custom_fields);\n }", "public function edit_invoice($invoice_id = \"\") {\n $data = [];\n $this->db->where('id', $invoice_id);\n $this->db->update('invoice', $data);\n $this->session->set_flashdata('flash_message', get_phrase('invoice_update_successfully'));\n }", "public function edit($id)\n {\n $productinvoices = ProductInvoice::findOrFail($id);\n $invoices = Invoice::findOrFail($id);\n return view('invoices.edit', compact(['invoices','productinvoices']));\n }", "public function editQuotationInvoice($id){\n $invoice = WlgCorporationInvoice::find($id);\n\n $invoiceForms = WlgCorporationInvoice::where('if_id', $id)->get()->toArray();\n return view('edit-wlg-corportaion-invoice', compact('invoice', 'invoiceForms'));\n }", "public function getInvoiceData(){\n return $this->getParameter('invoice_data');\n }", "public function edit(Invoice $invoice)\n\t{\n\t\t// Database Queries\n\t\t$contracts = Contract::with(['tenant', 'asset'])->notEnded()->get();\n\n\t\t// Config/Constants.php 'Queries'\n\t\t// Changes need to be made in the constants.php file AND on the DB\n\t\t$statuses = Config::get('constants.statuses');\n\t\t$priorities = Config::get('constants.priorities');\n\n\t\treturn view('invoices.edit', compact('invoice', 'contracts', 'statuses', 'priorities'));\n\t}", "function edit($InvoiceId)\n { \n // check if the invoice exists before trying to edit it\n $data['invoice'] = $this->Invoice_model->get_invoice($InvoiceId);\n \n if(isset($data['invoice']['InvoiceId']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t'BillNo' => $this->input->post('BillNo'),\n\t\t\t\t'PurchaseDate' => $this->input->post('PurchaseDate'),\n\t\t\t\t'PurchaseDateBS' => $this->input->post('PurchaseDateBS'),\n\t\t\t\t'SupplierName' => $this->input->post('SupplierName'),\n\t\t\t\t'SupplierNumber' => $this->input->post('SupplierNumber'),\n\t\t\t\t'SupplierAddress' => $this->input->post('SupplierAddress'),\n\t\t\t\t'Description' => $this->input->post('Description'),\n\t\t\t\t\n );\n $this->Invoice_model->update_invoice($InvoiceId,$params); \n redirect('invoice/index');\n }\n else\n {\n\t\t\t\t $userid = $this->session->userdata('userid');\n\t\t\t\t$data['users'] = $this->User_model->get_user($userid);\n $data['_view'] = 'invoice/edit';\n $this->load->view('layouts/main1',$data);\n }\n }\n else\n show_error('The invoice you are trying to edit does not exist.');\n }", "public function getInvoiceModel(){}", "public function single_invoice($id=FALSE,$edit_id=FALSE){\n\t\n\tif($edit_id){\n\t$result\t= $this->db->get_where('invoice', array('id'=>$edit_id));\n\t}else{\n\t\t$result\t= $this->db->get_where('invoice', array('id'=>$id));\n\t}\n\treturn $result->row();\n}", "public function edit($id)\n {\n $page_title = 'Invoice';\n $page_description = 'Edit invoice';\n $invoice = Invoice::find($id);\n $project = Project::where('project_number', '=', $invoice->project_id);\n $customer = Customer::where('customer_number', '=', $invoice->customer_id);\n $customer_invoice = DB::table('invoices')\n ->leftJoin('projects', 'projects.project_number', '=', 'invoices.project_id')\n ->leftJoin('customers', 'customers.customer_number', '=', 'invoices.customer_id')\n ->where('invoice_id', '=', $id)\n ->first();\n return view('invoice.edit', compact('customer_invoice', 'invoice', 'page_title', 'page_description'));\n }", "public function edit()\n {\n // $setting = Setting::findOrFail($id);\n\n // return view('invoice.edit');\n }", "public function editInvoiceProForma($id){\n $invoice = WlgCorporationInvoice::find($id);\n\n $invoiceForms = WlgCorporationInvoice::where('if_id', $id)->get()->toArray();\n return view('edit-wlg-corportaion-invoice', compact('invoice', 'invoiceForms'));\n }", "public function getEdit()\n {\n $members= Member::all();\n $invoiceproducts = InvoiceProduct::where('invoice_group_id', '=', InvoiceGroup::getCurrentMonth()->id)->get();\n return view('fiscus.edit')->with('members', $members)\n ->with('products', $invoiceproducts);\n }", "public function editCommercialInvoice($id){\n $invoice = WlgCorporationInvoice::find($id);\n\n $invoiceForms = WlgCorporationInvoice::where('if_id', $id)->get()->toArray();\n return view('edit-wlg-corportaion-invoice', compact('invoice', 'invoiceForms'));\n }", "public function edit(CustomerInvoiceEmail $customerInvoiceEmail)\n {\n //\n }", "public function edit($id)\n {\n //\n $invoice = Invoice::findOrFail($id);\n return view('finance.invoice.edit', compact('invoice'));\n }", "public function getInvoiceData()\n {\n return Mage::getSingleton('core/session')->getData(\"invoice\");\n }", "public function edit($id)\n {\n $branchId=Auth::user()->fk_branch_id;\n $companyId=Auth::user()->fk_company_id;\n $getInvoiceData=InventorySalesPaymentHistory::leftJoin('inventory_clients','inventory_payment_history.fk_client_id','=','inventory_clients.id')\n ->select('inventory_payment_history.*','inventory_clients.client_name','inventory_clients.mobile_no','inventory_clients.address','inventory_clients.email_id','inventory_clients.company_name','inventory_clients.client_id')\n ->where('inventory_payment_history.id',$id)\n ->first();\n if($getInvoiceData==null){\n return redirect()->back()->with('error',\"Invoice ($id) is not found!\");\n }\n $getProductData = InventorySalesPaymentHistoryItem::\n leftJoin('inventory_product_sales','inventory_payment_history_item.fk_sales_id','=','inventory_product_sales.id')\n ->where('fk_payment_id',$getInvoiceData->id)\n ->select('inventory_payment_history_item.*','inventory_product_sales.total_amount','inventory_product_sales.invoice_id')\n ->get();\n $account=AccountSetting::where('account_status',1)->pluck('account_name','id');\n $method=PaymentMethod::where('method_status',1)->pluck('method_name','id');\n $receiver = User::where('status',1)->where(['fk_branch_id'=>$branchId,'fk_company_id'=>$companyId])->pluck('name','id');\n return view('pos.sales.payment.edit', compact('getInvoiceData','getProductData','account','method','receiver'));\n }", "public function editInvoice($order_id)\n {\n $submitted = Request::get('submitted');\n if ($submitted) {\n } else {\n $order = Invoice::where('id', '=', $order_id)->get();\n $order_details =[];\n \n return view('common.edit_invoice')\n ->with('order', $order[0])\n ->with('order_details', $order_details);\n\n // return view('common.edit_invoice')->with('order', $order)->with('order_details', $order_details)->with('before_image',$before_image);\n }\n }", "public function edit($id)\n {\n $invoice = $this->getInvoice($id);\n\n// return $invoice;\n\n return view('examples.vueinvoices.edit', compact('invoice'));\n }", "public function edit($id)\n {\n\n $invObj = Invoice::where('id', $id)->first();\n\n $invItems = Invoice_item::where('invoice_id', $id)->get();\n $branch = Branch::where('id', $invObj->branch_id)->first();\n $stocks = Stock::where('branch_id', $invObj->branch_id)->get();\n $persons = Person::where('person_type_id', 101)->get();\n $currencies = Currency::get();\n $paytypes = Sales_invoice_pay_type::get();\n $orders = Order::where('id', $invObj->order_id)->first();\n $saleCodes = Representative::where('rep_type_id', 100)->where('branch_id', $invObj->branch_id)->get();\n $MarktCodes = Representative::where('rep_type_id', 101)->where('branch_id', $invObj->branch_id)->get();\n $currencyRate = Currency::where('id', $invObj->currency_id)->first();\n $saleName = Representative::where('id', $invObj->sales_rep_id)->first();\n $marketName = Representative::where('id', $invObj->marketing_rep_id)->first();\n $stockName = Stock::where('id', $invObj->stock_id)->first();\n $orderItems = [];\n\n return view($this->viewName . 'edit', compact('invObj', 'invItems', 'currencyRate', 'saleName', 'marketName', 'stockName', 'stocks', 'persons', 'orders', 'branch', 'orderItems', 'saleCodes', 'MarktCodes', 'paytypes', 'currencies'));\n }", "public function edit($id)\n {\n $companies = Company::all();//->pluck('name', 'id');\n $invoice = Invoice::find($id);\n\n if (!$invoice) {\n Session::flash('message_danger', 'Factura no encontrada');\n return redirect()->back()->withInput();\n }\n\n $lastNumber = $invoice->number;\n $authorizations = Authorization::openForInvoices();\n\n $extra = Authorization::checkIfExists($invoice->authorization_code);\n if ($extra) {\n $authorizations->push($extra);\n }\n\n return view('invoice.edit', compact('companies', 'lastNumber', 'authorizations', 'invoice'));\n }", "public function edit($id)\n {\n return view('invoices.create')\n ->with('invoiceid', $id);\n }", "public function edit($id)\n {\n $customer = array();\n $data = PurchaseOrder::find($id);\n $SupplierDetail = DB::table('zenrolle_purcahse')->join('zenrolle_suppliers','zenrolle_purcahse.supplier','=','zenrolle_suppliers.id')\n ->select('zenrolle_suppliers.name','zenrolle_suppliers.address','zenrolle_suppliers.city','zenrolle_suppliers.country','zenrolle_suppliers.phone','zenrolle_suppliers.email','zenrolle_suppliers.region','zenrolle_purcahse.invoice_no','zenrolle_purcahse.reference_no','zenrolle_purcahse.order_date','zenrolle_purcahse.due_date','zenrolle_purcahse.id','zenrolle_purcahse.subtotal','zenrolle_purcahse.total','zenrolle_purcahse.total_discount','zenrolle_purcahse.status','zenrolle_purcahse.total_tax','zenrolle_purcahse.shipping')\n ->where('zenrolle_purcahse.id',$id)->get();\n $invoice = PurchaseItem::where('pid',$id)->get();\n $customer['invoice'] = $invoice; \n \n $data->due_balance = $data->total - $data->payment_made;\n return view('purchasing.purchase_order.preview',compact('data','SupplierDetail','invoice'));\n }", "public function actionPreviewInvoice() {\n // Get assets path\n $assetsPath = $this->getAssetsPath();\n // Attach script files\n Yii::app()->clientScript->registerScriptFile($assetsPath . '/js/billingDashboard/billing_dashboard.js');\n Yii::app()->clientScript->registerScriptFile($assetsPath . '/js/billingDashboard/event_handlers.js');\n Yii::app()->clientScript->registerScriptFile($assetsPath . '/js/billingDashboard/checkbox_column_helper.js');\n Yii::app()->clientScript->registerScriptFile($assetsPath . '/js/billingDashboard/invoice.js');\n // Set javascript data\n $this->setJavascriptData();\n \n // Page size modifier\n if(isset($_GET['pageSize'])) {\n Yii::app()->user->setState('pageSize', (int)$_GET['pageSize']);\n unset($_GET['pageSize']);\n }\n \n // Get data provider\n $data = $this->getData();\n if($data === false || empty($data)) {\n // Redirect back to dashboard page with flag of no selection\n $this->redirect($this->createUrl('billingDashboard/index', array('no-selection' => 1,)));\n }\n \n // Make data provider\n $dataProvider = new CArrayDataProvider($data, array(\n 'pagination' => array(\n 'pageSize' => Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']),\n ),\n ));\n \n // Render preview page\n $this->render('invoice_grid', array(\n // Send general data\n 'pageTitle' => 'Invoice Preview',\n 'clientName' => $data[0]->project->getClientName(),\n // Data providers\n 'dataProvider' => $dataProvider,\n ));\n }", "public function processAction() {\n\t\t$form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$request = $this->getRequest ();\n\t\t$attachment = $form->getElement ( 'attachments' );\n\t\t\n\t\t// Check if we have a POST request\n\t\tif (! $request->isPost ()) {\n\t\t\treturn $this->_helper->redirector ( 'list', 'invoices', 'admin' );\n\t\t}\n\t\t\n\t\t// Create the buttons in the edit form\r\n\t\t$this->view->buttons = array(\r\n\t\t\t\tarray(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\tarray(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\tarray(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)),\r\n\t\t);\n\t\t\n\t\tif ($form->isValid ( $request->getPost () )) {\n\t\t\t// Get the id \n\t\t\t$id = $this->getRequest ()->getParam ( 'invoice_id' );\n\t\t\t\n\t\t\t// Set the new values\n\t\t\tif (is_numeric ( $id )) {\n\t\t\t\t$this->invoices = Doctrine::getTable ( 'Invoices' )->find ( $id );\n\t\t\t}\n\t\t\t\n\t\t\t// Get the values posted\n\t\t\t$params = $form->getValues ();\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t$this->invoices->invoice_date = Shineisp_Commons_Utilities::formatDateIn ( $params ['invoice_date'] );\n\t\t\t\t$this->invoices->number = $params ['number'];\n\t\t\t\t$this->invoices->order_id = $params ['order_id'];\n\t\t\t\t$this->invoices->note = $params ['note'];\n\t\t\t\t\n\t\t\t\t// Save the data\n\t\t\t\t$this->invoices->save ();\n\t\t\t\t$id = is_numeric ( $id ) ? $id : $this->invoices->getIncremented ();\n\n\t\t\t\t// Update formatted_number\n\t\t\t\tif ( $this->invoices->formatted_number != $params ['formatted_number'] || empty($this->invoices->formatted_number) ) {\n\t\t\t\t\t$this->invoices->formatted_number = !empty($params ['formatted_number']) ? $params ['formatted_number'] : Invoices::generateNumber($id);\t\n\t\t\t\t\t$this->invoices->save();\n\t\t\t\t}\n\t\t\t\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t$this->_helper->redirector ( 'list', 'invoices', 'admin', array ('mex' => $this->translator->translate ( 'The invoice cannot be created. Please check all your input data and try again.' ), 'status' => 'danger' ) );\n\t\t\t}\n\t\t\t\n\t\t\t$this->_helper->redirector ( 'edit', 'invoices', 'admin', array ('id' => $id, 'mex' => $this->translator->translate ( 'The task requested has been executed successfully.' ), 'status' => 'success' ) );\n\t\t} else {\n\t\t\t$this->view->form = $form;\n\t\t\t$this->view->title = $this->translator->translate(\"Invoice Edit\");\n\t\t\t$this->view->description = $this->translator->translate(\"Here you can edit the selected invoice.\");\n\t\t\treturn $this->render ( 'applicantform' );\n\t\t}\n\t}", "public function edit($id)\n {\n $invoice=Invoice::find($id);\n\t\treturn view('invoice.edit',compact('invoice','id'));\n }", "public function edit($id)\n {\n return view('admin::sales.invoices.edit', [\n 'invoice' => Invoice::find($id),\n 'customers' => Contact::asCustomers()\n ]);\n }", "public function edit($id)\n\t{\n\t\t$invoice = Invoice::findOrFail($id);\n\n\t\treturn view('invoices.edit', compact('invoice'));\n\t}", "public function edit(Receipt $receipt)\n {\n //\n }", "public function edit($id)\n {\n //\n\t\t$Invoice=Invoice::find($id);\n\t\treturn view('invoice.edit',compact('Invoice'));\n }", "public function edit($id)\n {\n\n $invoices = invoices::where('id', $id)->first();\n $details = invoices_details::where('id_Invoice', $id)->get();\n $attachments = invoice_attachments::where('invoice_id', $id)->get();\n return view('invoices.invoices_details', ['invoices' => $invoices, 'details' => $details, 'attachments' => $attachments]);\n }", "public function edit()\n {\n // $logged_in = false;\n // if ($this->isLoggedIn()) {\n // $logged_in = true;\n // }\n \t$client_custom_fields = $this->Clients->getCustomFieldValues(1);\n return $this->set('client_custom_fields', $client_custom_fields);\n\n }", "public function edit($id)\n {\n if (! Gate::allows('invoice_edit')) {\n return prepareBlockUserMessage();\n }\n \n $invoice = Invoice::findOrFail($id);\n\n if ( ! empty( $invoice->project_id ) ) {\n $customers = \\App\\Contact::whereHas(\"contact_type\",\n function ($query) {\n $query->where('id', CONTACT_CLIENT_TYPE);\n })->get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n } else {\n $customers = \\App\\Contact::whereHas(\"contact_type\",\n function ($query) {\n $query->where('id', CUSTOMERS_TYPE);\n })->get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n }\n $sales_agent = \\App\\Contact::whereHas(\"contact_type\",\n function ($query) {\n $query->where('id', CONTACT_SALE_AGENT);\n })->get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n $currencies = \\App\\Currency::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $taxes = \\App\\Tax::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $discounts = \\App\\Discount::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $enum_status = Invoice::$enum_status;\n $enum_discounts_format = Invoice::$enum_discounts_format;\n $enum_tax_format = Invoice::$enum_tax_format;\n \n \n\n return view('admin.invoices.edit', compact('invoice', 'enum_status','sales_agent', 'customers', 'currencies', 'taxes', 'discounts', 'enum_discounts_format', 'enum_tax_format'));\n }", "public function edit($id)\n\t{\n\t\t\n\t\t$infoRetail = DB::table('vwretailinvoice')->where('retail_invoice_id',$id)->first();\n\t\t$infoRetailDetail =DB::table('vwretailinvoicedetails')->where('retail_invoice_id',$id)->get();\n\t\t\n\t\t$mD = DB::table('vwretailinvoicedetails')->where('retail_invoice_id',$id)->avg('member_discount');\n\n\t\t$memberDiscount = $mD*100;\n\n\t\t$grossAmount = 0;\n\t\t$iDiscountPrice = 0;\n\t\tforeach($infoRetailDetail as $sub) {\n\t\t\t$grossAmount += ($sub->unit_price * $sub->quantity);\n\n\t\t\t$itemGross = $sub->unit_price * $sub->quantity;\n\t\t\t\n\t\t\t$iDiscountPrice += ($itemGross * $sub->discount);\n\t\t}\n\n\t\t$mDiscountPrice = $grossAmount * $mD;\n\n\t\t$totalDiscount = $mDiscountPrice + $iDiscountPrice;\n\t\t\n\t\t$invoiceAmount = $grossAmount - ($mDiscountPrice + $iDiscountPrice);\n\n\t\t$netSales = $invoiceAmount / 1.12;\n\n\t\t$outputTax = $netSales * 0.12;\n\n\t\t$branch = DB::table('fiametta_warehouse.tbl_branch')\n\t\t\t->where('branch_id',$infoRetail->branch_id)\n\t\t\t->first();\n\n\t\t$contact = Contact::where('contact_id',$infoRetail->contact_id)->first();\n\n\t\treturn View::make('invoice.edit')\n\t\t->with('id',$id)\n\t\t->with('branch',$branch)\n\t\t->with('contact',$contact)\n\t\t->with('memberDiscount',$memberDiscount)\n\t\t->with('details',$infoRetailDetail)\n\t\t->with('grossAmount',$grossAmount)\n\t\t->with('totalDiscount',$totalDiscount)\n\t\t->with('invoiceAmount',$invoiceAmount)\n\t\t->with('netSales',$netSales)\n\t\t->with('outputTax',$outputTax)\n\t\t->with('retail',$infoRetail);\n\t}", "public function edit($id)\n\t{\t\n\t\t\n\t\t$customer = Customer::where('user_id',Auth::user()->id)->findOrFail($id);// -------------------------------------------------only logged in user\t\t\t\n\n\t\t$invoices = DB::table('invoices')->where('customer_id', $id)->orderBy('id','desc')->get();\n\n\t\t// return var_dump($customer);\n\n\t\treturn View::make('customers.edit')->withCustomer($customer)->withInvoices($invoices);\n\t}", "public function manage_invoice_invoice_id()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->load->library('linvoice');\n $invoice_no = $this->input->post('invoice_no');\n $data =$this->linvoice->invoice_list_invoice_no($invoice_no);\n\t\t$data['content'] = $this->load->view('dashboard_pharmacist/invoice/invoice',$data,true);\n\t\t$this->load->view('dashboard_pharmacist/main_wrapper',$data);\n\t}", "public function editInvoice($id)\n {\n $user = auth()->user();\n $datosFactura = DB::table('quotes')\n ->select('quotes.account_id', 'quotes.created_by_id', 'quotes.id as quoteId', 'quotes.quote_date',\n 'accounts.name as accountName','users.name as userName','quotes.stage_id',\n 'quotes.invoice_date',\n 'accounts.document_number','document_types.name as documenttype')\n ->join('accounts', 'accounts.id', '=', 'quotes.account_id')\n ->join('document_types', 'document_types.id', '=', 'accounts.document_type_id')\n ->join('users', 'users.id', '=', 'quotes.created_by_id')\n ->where('users.organization_id', $user->organization_id)\n ->where('quotes.id', $id)->first();\n $files = DB::table('quotes')\n ->select('quote_files.name', 'quote_files.id')\n ->join('quote_files', 'quote_files.quote_id', '=', 'quotes.id')\n ->join('users', 'users.id', '=', 'quotes.created_by_id')\n ->where('quotes.id', $id)\n ->where('users.organization_id', $user->organization_id)->get();\n $invoice_date = $datosFactura->invoice_date !== null ? $datosFactura->invoice_date : date(\"Y-m-d\");\n return view('quote.editInvoice',compact('datosFactura','id','invoice_date','files'));\n }", "public function getInvoicesDataTable($codigoInvoices='')\n {//var_dump($_POST);exit;\n echo ($this->invm->ShowInvoicesTable($codigoInvoices));\n }", "public function edit( $id)\n {\n $invoice=$this->invoice->getDetail($id);\n $data=compact('invoice');\n return view('invoice.edit',$data);\n\n }", "public function edit($id)\n {\n if (! Gate::allows('invoice_edit')) {\n return abort(401);\n }\n \n $users = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $projects = \\App\\Project::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $expense_types = \\App\\ExpenseType::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $meetings = \\App\\Meeting::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $contingencies = \\App\\Contingency::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $providers = \\App\\Provider::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $service_types = \\App\\ServiceType::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $pms = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $finances = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n $invoice = Invoice::findOrFail($id);\n\n return view('admin.invoices.edit', compact('invoice', 'users', 'projects', 'expense_types', 'meetings', 'contingencies', 'providers', 'service_types', 'pms', 'finances'));\n }", "public function edit(Request $request, $id)\n {\n $data = Purchase::where(['id'=>$id])->get();\n \n $result['purchase_date'] = $data[0]->purchase_date;\n $result['invoice_no'] = $data[0]->invoice_no;\n\t\t$result['company_name'] = $data[0]->company_name;\n\t\t$result['total_amount'] = $data[0]->total_amount;\n $result['purchase_id'] = $data[0]->id;\n return view('admin.purchase.edit', $result);\n }", "public function getEdit()\n\t{\n\t}", "public function show(Invoices $invoice)\n {\n return $invoice;\n }", "public function invoice_id(){\n return parent::get_fk_object(\"invoice_id\");\n }", "public function invoice($id = '')\r\n {\r\n if (!has_permission('invoices', '', 'view') && !has_permission('invoices', '', 'view_own')) {\r\n access_denied('invoices');\r\n }\r\n if ($this->input->post()) {\r\n $invoice_data = $this->input->post(NULL, FALSE);\r\n if ($id == '') {\r\n if (!has_permission('invoices', '', 'create')) {\r\n access_denied('invoices');\r\n }\r\n $id = $this->invoices_model->add($invoice_data);\r\n if ($id) {\r\n set_alert('success', _l('added_successfuly', _l('invoice')));\r\n redirect(admin_url('invoices/list_invoices/' . $id));\r\n }\r\n } else {\r\n if (!has_permission('invoices', '', 'edit')) {\r\n access_denied('invoices');\r\n }\r\n $success = $this->invoices_model->update($invoice_data, $id);\r\n if ($success) {\r\n set_alert('success', _l('updated_successfuly', _l('invoice')));\r\n }\r\n redirect(admin_url('invoices/list_invoices/' . $id));\r\n }\r\n }\r\n if ($id == '') {\r\n $title = _l('create_new_invoice');\r\n $data['billable_tasks'] = array();\r\n } else {\r\n $invoice = $this->invoices_model->get($id);\r\n\r\n if (!$invoice || (!has_permission('invoices', '', 'view') && $invoice->addedfrom != get_staff_user_id())) {\r\n blank_page(_l('invoice_not_found'), 'danger');\r\n }\r\n\r\n $data['invoices_to_merge'] = $this->invoices_model->check_for_merge_invoice($invoice->clientid, $invoice->id);\r\n $data['expenses_to_bill'] = $this->invoices_model->get_expenses_to_bill($invoice->clientid);\r\n $data['invoice_recurring_invoices'] = $this->invoices_model->get_invoice_recuring_invoices($id);\r\n\r\n $data['invoice'] = $invoice;\r\n $data['edit'] = true;\r\n $data['billable_tasks'] = $this->tasks_model->get_billable_tasks($invoice->clientid);\r\n $title = _l('edit', _l('invoice_lowercase')) . ' - ' . format_invoice_number($invoice->id);\r\n }\r\n if ($this->input->get('customer_id')) {\r\n $data['customer_id'] = $this->input->get('customer_id');\r\n $data['do_not_auto_toggle'] = true;\r\n }\r\n\r\n $this->load->model('payment_modes_model');\r\n $data['payment_modes'] = $this->payment_modes_model->get('', array(\r\n 'expenses_only !=' => 1\r\n ));\r\n $this->load->model('taxes_model');\r\n $data['taxes'] = $this->taxes_model->get();\r\n $this->load->model('invoice_items_model');\r\n $data['items'] = $this->invoice_items_model->get_grouped();\r\n $data['items_groups'] = $this->invoice_items_model->get_groups();\r\n\r\n $this->load->model('currencies_model');\r\n $data['currencies'] = $this->currencies_model->get();\r\n\r\n $where_clients = 'tblclients.active=1';\r\n\r\n if (!has_permission('customers', '', 'view')) {\r\n $where_clients .= ' AND tblclients.userid IN (SELECT customer_id FROM tblcustomeradmins WHERE staff_id=' . get_staff_user_id() . ')';\r\n }\r\n\r\n $data['clients'] = $this->clients_model->get('', $where_clients);\r\n if ($id != '') {\r\n if (total_rows('tblclients', array(\r\n 'active' => 0,\r\n 'userid' => $data['invoice']->clientid\r\n )) > 0 || (total_rows('tblcustomeradmins', array(\r\n 'staff_id' => get_staff_user_id(),\r\n 'customer_id' => $data['invoice']->clientid\r\n )) == 0 && !has_permission('customers', '', 'view'))) {\r\n $data['clients'][] = $this->clients_model->get($data['invoice']->clientid, array(), 'row_array');\r\n }\r\n }\r\n\r\n $data['projects'] = array();\r\n if ($id != '' || isset($data['customer_id'])) {\r\n\r\n $where = '';\r\n $where_customer_id = (isset($data['customer_id']) ? $data['customer_id'] : $invoice->clientid);\r\n $where .= 'clientid=' . $where_customer_id;\r\n\r\n if (!has_permission('projects', '', 'view')) {\r\n $where .= ' AND id IN (SELECT project_id FROM tblprojectmembers WHERE staff_id=' . get_staff_user_id() . ')';\r\n }\r\n\r\n $data['projects'] = $this->projects_model->get('', $where);\r\n\r\n if ($id != '' && $data['invoice']->project_id != 0) {\r\n if (total_rows('tblprojectmembers', array(\r\n 'staff_id' => get_staff_user_id(),\r\n 'project_id' => $data['invoice']->project_id\r\n )) == 0 && !has_permission('projects', '', 'view')) {\r\n $this->db->where('id', $data['invoice']->project_id);\r\n $data['projects'][] = $this->db->get('tblprojects')->row_array();\r\n }\r\n }\r\n }\r\n\r\n $data['staff'] = $this->staff_model->get('', 1);\r\n $data['title'] = $title;\r\n $data['bodyclass'] = 'invoice';\r\n $data['accounting_assets'] = true;\r\n $this->load->view('admin/invoices/invoice', $data);\r\n }", "public function edit($id)\n {\n if (Auth::user()->role == User::ROLE_SUPERADMIN || Auth::user()->role == User::ROLE_ADMIN) {\n $invoicelist = InvoiceLists::findOrFail($id);\n if (Auth::user()->role == User::ROLE_SUPERADMIN || Auth::user()->role == User::ROLE_ADMIN) {\n $purchaseorderlists = PurchaseOrderLists::pluck('purchase_order_list_code', 'id')\n ->prepend('Choose Purchase Order', '');\n }else{\n $purchaseorderlists = PurchaseOrderLists::where('quote_sales_person_id', Auth::user()->id)\n ->pluck('purchase_order_list_code', 'id')\n ->prepend('Choose Purchase Order', '');\n }\n return view('admin.invoice.edit', compact('invoicelist', 'purchaseorderlists'));\n }else{\n Alert::info('No Access !', 'Attention !');\n return redirect('admin/invoice-list');\n }\n }", "public function invoice($id = '')\n {\n if (!get_permission('invoice', 'is_view')) {\n access_denied();\n }\n\n $this->data['student_id'] = $id;\n $this->data['invoice'] = $this->fees_model->getInvoiceStatus($id);\n $this->data['basic'] = $this->fees_model->getInvoiceBasic($id);\n $this->data['title'] = translate('invoice_history');\n $this->data['main_menu'] = 'fees';\n $this->data['sub_page'] = 'fees/collect';\n $this->load->view('layout/index', $this->data);\n }", "public function pos_invoice_inserted_data($invoice_id)\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_admin_auth();\n\t\t$CI->load->library('linvoice');\n\t\t$content = $CI->linvoice->pos_invoice_html_data($invoice_id);\t\t\n\t\t$this->template->full_admin_html_view($content);\n\t}", "public function edit(Incidencia $incidencia)\n {\n //\n }", "public function edit(Incidencia $incidencia)\n {\n //\n }", "public function edit(incidencia $incidencia)\n {\n //\n }", "public function edit($id)\n {\n $items=Item::latest()->get();\n $invoiceItem=InvoiceItem::find($id);\n return view(\"invoiceitem.edit\",compact(\"items\",\"invoiceItem\"));\n }", "public function getInvoiceID(){\n return $this->InvoiceID;\n }", "public function getInvoice($invoiceId);", "public function actionEdit()\n\t{\n\t\t$field = $this->_getFieldOrError($this->_input->filterSingle('field_id', XenForo_Input::STRING));\n\t\treturn $this->_getFieldAddEditResponse($field);\n\t}", "public function edit($id)\n {\n if(!Sentinel::inRole('main')){\n //Flash::error('invoice not found');\n return redirect('invoices');\n //return;\n }\n\n $members = $this->invoiceRepository->membersNames();\n $invoice = $this->invoiceRepository->findWithoutFail($id);\n\n if (empty($invoice)) {\n Flash::error('invoice not found');\n\n return redirect(route('invoices.index'));\n }\n\n return view('invoices.edit')->with('invoice', $invoice)->with(['members' => $members]);\n }", "public function edit($id)\n {\n $invoice = InvoicePayable::with([\n 'Rcv.Detailrcv','Rcv','Jenistransaksi','Detailinvoice'\n ])->find($id);\n\n $jenis_transaksi = Jenistransaksi::all();\n $pegawai = Pegawai::all();\n $rcv = Rcv::all();\n\n $id = InvoicePayable::getId();\n foreach($id as $value);\n $idlama = $value->id_payable_invoice;\n $idbaru = $idlama + 1;\n $blt = date('y-m');\n\n $kode_invoice = 'INVC-'.$blt.'/'.$idbaru;\n\n return view('pages.accounting.payable.invoice.create', compact('invoice','jenis_transaksi','pegawai','kode_invoice','rcv'));\n }", "public function edit($id_cliente){}", "public function edit($id)\n {\n if(!in_array(Auth::user()->role,['Admin']))\n return view('home')->with('message','You are not authorized for the page you tried to visit');\n $customers = Customer::all();\n $invoice = Invoice::find($id);\n return view('invoice.edit', compact('customers','invoice'));\n //\n }", "public function edit($id)\n {\n return view('invoice::edit', $this->service->edit($id));\n }", "public function edit(APInvoiceAlls $aPInvoiceAlls)\n {\n //\n }", "public function edit($id)\n {\n $prod = Inventario::find($id);\n\n $prov = Proveedor::lists('proveedor', 'id');\n $rec[\"SI\"]=\"SI\";\n $rec[\"NO\"]=\"NO\";\n $status[\"Activo\"]=\"Activo\";\n $status[\"Baja\"]=\"Baja\";\n $porcentaje[\"15\"]=\"15\";\n $porcentaje[\"20\"]=\"20\";\n $porcentaje[\"25\"]=\"25\";\n $porcentaje[\"30\"]=\"30\";\n $porcentaje[\"35\"]=\"35\";\n $porcentaje[\"40\"]=\"40\";\n $porcentaje[\"45\"]=\"45\";\n $porcentaje[\"50\"]=\"50\";\n return view('inventario.edit',['prod'=>$prod],compact('prov','porcentaje','rec','status'));\n }", "public function edit(Company $company, InvoiceItem $invoiceItem)\n {\n //\n }", "public function edit($id)\n {\n $invoicesDetails = InvoicesModel::find($id);\n\n return View::make('crm.invoices.edit')\n ->with('invoices', $invoicesDetails);\n }", "function edit_prodInv($data)\n {\n $sql = \"select * from product where ProdID = \" . $data . \" limit 1\";\n $query = $this->db->query($sql);\n return $query->result();\n }", "public function update($shoppingcartInvoice);", "public function edit(Insumo $insumo)\n {\n //\n }", "public function invoice_inserted_data($invoice_id)\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->load->library('linvoice');\n\t\t$data = $CI->linvoice->invoice_html_data($invoice_id);\t\t\n\t\t$data['content'] = $this->load->view('dashboard_pharmacist/invoice/invoice_html',$data,true);\n\t\t$this->load->view('dashboard_pharmacist/main_wrapper',$data);\n\t}", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function edit(Request $request, $id)\n {\n //\n $purchaseInvoices = PurchaseInvoice::with('items')->find($id);\n return view('invoices-edit', compact('purchaseInvoices'));\n }", "public function findInvoiceId() {\n\t\treturn $this->request->getFiltered('ok_invoice'); \n\t}", "public function show(invoices_details $invoices_details)\n {\n //\n }", "public function invoice($param1 = \"\", $param2 = \"\") {\n // For creating new invoice\n if ($param1 == 'single') {\n $response = $this->crud_model->create_single_invoice();\n echo $response;\n }\n\n // For creating new mass invoice\n if ($param1 == 'mass') {\n $response = $this->crud_model->create_mass_invoice();\n echo $response;\n }\n\n // For editing invoice\n if ($param1 == 'update') {\n $response = $this->crud_model->update_invoice($param2);\n echo $response;\n }\n\n // For deleting invoice\n if ($param1 == 'delete') {\n $response = $this->crud_model->delete_invoice($param2);\n echo $response;\n }\n\n // Get the list of student. Here param2 defines classId\n if ($param1 == 'student') {\n $page_data['enrolments'] = $this->user_model->get_student_details_by_id('class', $param2);\n $this->load->view('backend/admin/student/dropdown', $page_data);\n }\n\n // showing the list of invoices\n if ($param1 == 'invoice') {\n $page_data['invoice_id'] = $param2;\n $page_data['folder_name'] = 'invoice';\n $page_data['page_name'] = 'invoice';\n $page_data['page_title'] = 'invoice';\n $this->load->view('backend/index', $page_data);\n }\n\n // showing the list of invoices\n if ($param1 == 'list') {\n $date = explode('-', $this->input->get('date'));\n $page_data['date_from'] = strtotime($date[0].' 00:00:00');\n $page_data['date_to'] = strtotime($date[1].' 23:59:59');\n $page_data['selected_class'] = htmlspecialchars($this->input->get('selectedClass'));\n $page_data['selected_status'] = htmlspecialchars($this->input->get('selectedStatus'));\n $this->load->view('backend/admin/invoice/list', $page_data);\n }\n // showing the index file\n if(empty($param1)){\n $page_data['folder_name'] = 'invoice';\n $page_data['page_title'] = 'invoice';\n $first_day_of_month = \"1 \".date(\"M\").\" \".date(\"Y\").' 00:00:00';\n $last_day_of_month = date(\"t\").\" \".date(\"M\").\" \".date(\"Y\").' 23:59:59';\n $page_data['date_from'] = strtotime($first_day_of_month);\n $page_data['date_to'] = strtotime($last_day_of_month);\n $page_data['selected_class'] = 'all';\n $page_data['selected_status'] = 'all';\n $this->load->view('backend/index', $page_data);\n }\n }", "public function obj_edit($id)\n {\n$usuario=\\Auth::user();\n$usuari=\\Auth::user();\n$usuar=\\Auth::user();\n\n $line=Lineas::all();\n $pro=$usuari->Proyectos();\n$inve=$usuar->Investigaciones();\n$inv=proyectos::find($id);\n $obj=coment::find($id);\n\n\n$tou=User::orderBy('nombres', 'asc')->get();\n$inves=TipoInvestigaciones::all();\n return view(\"formularios.edit_newob\") \n ->with(\"line\",$line)\n\n ->with('inves',$inves)\n ->with('pro',$pro)\n ->with('inv',$inv)\n ->with('inve',$inve)\n ->with('obj',$obj)\n\n ->with(\"usuario\",$usuario)\n ->with(\"tou\",$tou);\n\n\n\n }", "public function getEdit($id)\n\t{\n\t\t//\n\t}", "public function edit(Company $company, OldInvoiceItem $oldInvoiceItem)\n {\n //\n }", "public function edit(vehiclereport $vehiclereport)\n {\n // \n }", "public function edit()\n {\n return $this->get();\n }" ]
[ "0.8050768", "0.7603052", "0.7603052", "0.7603052", "0.7603052", "0.7603052", "0.7603052", "0.7603052", "0.7603052", "0.7603052", "0.7603052", "0.75916755", "0.7423876", "0.73912007", "0.7252808", "0.7238448", "0.7218335", "0.7190803", "0.71209985", "0.7103935", "0.7052401", "0.6864239", "0.685163", "0.68480563", "0.6841085", "0.68409485", "0.68368906", "0.6828797", "0.6822187", "0.68069017", "0.67459714", "0.67269766", "0.6721102", "0.67109257", "0.66898566", "0.6682393", "0.667099", "0.66526103", "0.66494685", "0.6615918", "0.65889937", "0.65858775", "0.6578863", "0.65765053", "0.65623075", "0.6562012", "0.655576", "0.6550178", "0.65418696", "0.6535712", "0.65329474", "0.65085614", "0.649758", "0.6494619", "0.6482237", "0.64811885", "0.6477001", "0.6470861", "0.64683026", "0.6468143", "0.646811", "0.6463715", "0.6457398", "0.6453463", "0.6441794", "0.643908", "0.64360595", "0.643219", "0.64303803", "0.6427852", "0.6419967", "0.6419967", "0.6395761", "0.63793546", "0.6376932", "0.6369336", "0.63670653", "0.636065", "0.6358887", "0.635238", "0.6349717", "0.634395", "0.631277", "0.6288974", "0.62771136", "0.62727714", "0.6271436", "0.6263802", "0.6261629", "0.62607133", "0.6257651", "0.625762", "0.62534344", "0.6250799", "0.6249814", "0.6240285", "0.623914", "0.62300557", "0.622721", "0.620955" ]
0.7054629
20
Retrieve company Edit Data
public function retrieve_company() { $this->db->select('*'); $this->db->from('company_information'); $this->db->limit('1'); $query = $this->db->get(); if ($query->num_rows() > 0) { return $query->result_array(); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function companyedit() {\r\n $company = $this->model->getCompany($_GET['id']);\r\n $contragentTypes = $this->model->getContragentTypes();\r\n\r\n return $this->view('company/companyedit', array('company' => $company, 'contragentType' => $contragentTypes));\r\n }", "public function edit(Company $company)\n {\n //\n }", "public function edit(Company $company)\n {\n //\n }", "public function edit(Company $company)\n {\n //\n }", "public function edit(Company $company)\n {\n //\n }", "public function edit(Company $company)\n {\n //\n }", "function showCompany() {\n\t\t\t\t\t$company = Partner::find_by_name(params(0));\n\n\t\t\t\t\t$editForm = new h2o('views/editCompany.html');\n\t\t\t\t\techo $editForm->render(compact('company'));\n\t\t\t\t}", "public function edit_vehicle_companies(){\n\t\t$parameters['where'] = array('company_id !=' => 0);\n\t\t$parameters['select'] = '*';\n\t\t$data['companies'] = $this->MY_Model->getRows('company',$parameters);\n\t\techo json_encode($data);\n\t\t// print_r($data);\n\t}", "public function actionGetCompanyInfo()\n {\n if (Yii::app()->request->isAjaxRequest && isset($_POST['comId'])) {\n $comId = intval($_POST['comId']);\n if ($comId > 0) {\n $company = Companies::model()->with('adreses', 'client')->findByPk($comId);\n $client = $company->client;\n $adress = $company->adreses[0];\n\n $condition = UsersClientList::getClientAdminCondition($client->Client_ID);\n $clientAdmins = UsersClientList::model()->find($condition);\n\n $adminPerson = '';\n if ($clientAdmins) {\n $clientAdmin = Users::model()->with('person')->findByPk($clientAdmins->User_ID);\n $adminPerson = $clientAdmin->person;\n }\n\n $lastDocument = W9::getCompanyW9Doc($client->Client_ID);\n\n $this->renderPartial('company_info_block', array(\n 'company' => $company,\n 'adress' => $adress,\n 'adminPerson' => $adminPerson,\n 'lastDocument' => $lastDocument,\n ));\n }\n }\n }", "function editCompany() {\n\t\t\t\t\tif ($_POST['updateDelete'] == 'update') {\n\n\t\t\t\t\t\t/* params(0) represents the apprentice name passed in via the URL */\n\t\t\t\t\t\t$company = Partner::find_by_name(params(0));\n\t\t\t\t\t\t\n\t\t\t\t\t\t$company->update_attributes(array('name'\t\t => $_POST['inputName'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t 'city'\t\t => $_POST['inputCity'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'unix_linux'\t => $_POST['inputUnixLinux'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'sql'\t\t\t => $_POST['inputSql'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'git'\t\t\t => $_POST['inputGit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'wordpress'\t => $_POST['inputWordpress'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'drupal'\t\t => $_POST['inputDrupal'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'python'\t\t => $_POST['inputPython'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'svn'\t\t\t => $_POST['inputSVN'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'objective_c'\t => $_POST['inputObjectiveC'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'ruby_rails'\t => $_POST['inputRuby'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'c_plusplus'\t => $_POST['inputCPlusPlus'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'dot_net'\t\t => $_POST['inputNet'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'php'\t\t\t => $_POST['inputPHP'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'html_css'\t => $_POST['inputHtmlCss'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'java'\t\t => $_POST['inputJava'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'javascript'\t => $_POST['inputJavascript'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'comments'\t => $_POST['inputComments'])\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if ($_POST['updateDelete'] == 'delete') {\n\t\t\t\t\t\t$company = Partner::find_by_name(params(0));\n\t\t\t\t\t\t$company->delete();\n\t\t\t\t\t}\n\n\t\t\t\t\t$success = new h2o('views/happySuccess.html');\n\t\t\t\t\techo $success->render();\n\t\t\t\t}", "function getEditUrl() {\n return assemble_url('people_company_edit', array('company_id' => $this->getId())); \n }", "public function edit(Company $company)\n {\n return view('project.CompUpdt')->with('company', $company)->with('companies', Company::all())->with('users', User::orderBy('name', 'ASC')->get());\n }", "public function DataCompany()\n\t{\n\t\tif ($this->uri->segment(4) == 'view') {\n\t\t\t$id = $this->uri->segment(3);\n\t\t\t$tampil = $this->MSudi->GetDataWhere('tbl_company', 'id', $id)->row();\n\t\t\t$data['detail']['id'] = $tampil->id;\n\t\t\t$data['detail']['nama_company'] = $tampil->nama_company;\n\t\t\t$data['content'] = 'VFormUpdateCompany';\n\t\t} else {\n\t\t\t$data['DataCompany'] = $this->MSudi->GetData('tbl_company');\n\t\t\t$data['content'] = 'VCompany';\n\t\t}\n\t\t$this->load->view('welcome_message', $data);\n\t}", "public function editCompany($id_company){\n\n $company = DB::table('users')\n ->join('company', 'users.id_company', '=', 'company.id_company')\n ->where('users.id_company', '=', $id_company)\n ->where('users.role', '=', 2)\n ->select('*')\n ->get();\n return view('company.edit',compact('company'));\n\n }", "public function edit(companies $company)\n {\n\t\treturn view ('companies.edit',compact('company'));\n\t\t\n //\n }", "public function edit($id)\n {\n return json_encode(Company::find($id));\n }", "public function edit($id)\n {\n $com_info = AboutCompany::find($id); \n return view('admin.home.aboutCompany.company_info_edit',['com_info'=>$com_info]);\n }", "public function edit(Companie $companie)\n {\n //\n }", "public function edit()\n {\n $company = auth()->user()->company;\n\n return view('app.company.edit', compact('company'));\n }", "public function edit(Company $company)\n {\n $profession = Profession::all();\n $rubric = Rubric::all();\n $city = City::all();\n return view('company.edit',['city'=>$city, 'rubric'=>$rubric, 'profession'=> $profession, 'company' => $company]);\n\n }", "public function edit()\n {\n if (auth()->user()->status_aktif == 1) {//mencegah user yg sudah didak aktif mengakses page ini\n $master_companys = Master_Company::OrderBy('nama_company')->get()->first();\n\n if ($master_companys == null) {\n //menampilkan data ke halaman create\n return view('Master.Company.Create.index', compact('master_companys'));\n } else {\n //menampilkan data ke halaman create\n return view('Master.Company.Edit.index', compact('master_companys'));\n } \n }else{\n return view('Dashboard.blank');//menampilkan ke halaman blokir user\n } \n }", "public function edit(Corporate $corporate)\n {\n //\n }", "public function edit($id)\n\t{\n\t\tif (auth()->user()->cannot('company.edit')){\n\t\t\treturn response(\"\", 403);\n\t\t}\n\t\t$data = Companies::where(\"COMPANY_ID\", $id)->first();\n\t\t$direktur = DB::table(\"direktur\")->where(\"COMPANY_ID\", $id)->orderBy(\"NAMA\")->get();\n\t\t$komisaris = DB::table(\"komisaris\")->where(\"COMPANY_ID\", $id)->orderBy(\"NAMA\")->get();\n\t\treturn response()->view('companies.form', [\"data\" => $data, \n\t\t\t\t\t\t\t\t\"direktur\" => $direktur, \"komisaris\" => $komisaris,\n\t\t\t\t\t\t\t\t\"action\" => 'edit']);\n\t}", "public function edit(Company $company)\n {\n $accountans = User::get();\n return Inertia::render('Company/Edit',[\n 'company' => $company,\n 'accountants' => $accountans\n ]);\n }", "public function companyPageForEdit($id)\n {\n $company = Company::find($id);\n return view('admin.editCompany')->with('company',$company);\n }", "public function actionGetCompanyInfo()\n {\n if (Yii::app()->request->isAjaxRequest && isset($_POST['type'])) {\n if ($_POST['type'] != '') {\n $show = false;\n $view_name = 'users_to_approve_company';\n $companyInfo = array();\n $id = intval($_POST['userId']);\n\n // get user to approve\n $usersToApprove = UsersToApprove::model()->with('client', 'user')->findByPk($id);\n $client = $usersToApprove->client;\n $user = $usersToApprove->user;\n\n // get company info\n $company = $client->company;\n $adreses = $company->adreses;\n $adress = $adreses[0];\n if ($company && $adress) {\n $show = true;\n\n if ($usersToApprove->New_Client == UsersToApprove::NEW_CLIENT) {\n $companyInfo['add_text'] = 'Wants to add new company:';\n } else {\n $companyInfo['add_text'] = 'Wants to join existing company:';\n }\n\n $companyInfo['name'] = $company->Company_Name;\n $companyInfo['fed_id'] = $company->Company_Fed_ID;\n $companyInfo['adr'] = $adress->Address1;\n $companyInfo['city'] = $adress->City;\n $companyInfo['state'] = $adress->State;\n $companyInfo['zip'] = $adress->ZIP;\n\n $companyInfo['client_admins'] = '';\n $companyInfo['come_from'] = '';\n $companyInfo['client_active'] = 'Client is not active now';\n $companyInfo['company_activated'] = \"This company will be automatically activated after user approval\";\n\n // check existing of client-admins of company\n if ($usersToApprove->New_Client == UsersToApprove::OLD_CLIENT && !UsersClientList::checkClientForAdmins($client->Client_ID)) {\n $companyInfo['client_admins'] = \"This company doesn't have Client Admin\";\n if ($user->User_Pwd == md5('temp100')) {\n $companyInfo['come_from'] = 'User came from registration form';\n } else {\n $companyInfo['come_from'] = 'User was previously in the system and asks for being added to the company by \"Request to join company\"';\n }\n }\n\n $view_name = 'users_to_approve_company';\n }\n\n if ( $usersToApprove->client->Client_Type === '2' ){\n //single user without company\n $show = true;\n $companyInfo['add_text'] = 'Single user without company';\n\n $companyInfo['name'] = 'not defined';\n $companyInfo['fed_id'] ='not defined';\n $companyInfo['adr'] = 'not defined';\n $companyInfo['city'] = 'not defined';\n $companyInfo['state'] = 'not defined';\n $companyInfo['zip'] = 'not defined';\n\n $companyInfo['client_admins'] = '';\n $companyInfo['come_from'] = '';\n $companyInfo['client_active'] = 'This is a single user without company';\n $companyInfo['company_activated'] = \"This company will be automatically activated after user approval\";\n\n\n\n if ($user->User_Pwd == md5('temp100')) {\n $companyInfo['come_from'] = 'User came from registration form';\n } else {\n $companyInfo['come_from'] = 'User was previously in the system and asks for being added to the company by \"Request to join company\"';\n }\n $view_name = 'users_to_approve_without_company';\n }\n\n\n $this->renderPartial($view_name , array(\n 'show' => $show,\n 'companyInfo' => $companyInfo,\n 'new_client' => $usersToApprove->New_Client,\n 'active_client' => $client->Client_Status,\n ));\n }\n die;\n }\n }", "public function edit_datacompany($id_company)\n {\n\n if (\n $this->session->userdata('level') == 'SuperAdmin' ||\n $this->session->userdata('level') == 'HRD'\n ) {\n $this->form_validation->set_rules('company', 'company', 'required');\n $this->form_validation->set_rules('address', 'address', 'required');\n $this->form_validation->set_rules('tlp', 'tlp', 'required');\n\n if ($this->form_validation->run() == FALSE) {\n $data = array(\n 'title' => 'Edit Data',\n 'company' => $this->Master->detail_datacompany($id_company),\n 'isi' => 'master/v_edit_company'\n );\n $this->load->view('template/v_wrapper', $data, FALSE);\n } else {\n $data = array(\n 'id_company' => $id_company,\n 'company' => $this->input->post('company'),\n 'address' => $this->input->post('address'),\n 'tlp' => $this->input->post('tlp'),\n );\n $this->Master->update_company($data);\n\n $this->session->set_flashdata('pesan', 'Data Berhasil Diedit !!!');\n redirect('C_Master/company');\n }\n } else {\n $this->load->view('blocked');\n }\n }", "public function edit($company)\n {\n \n if(is_numeric($company)){\n $companyitem = Company::findorFail($company);\n return new CompanyApiResource($companyitem);\n }\n else{\n return response()->json([\n 'error' => 'Enter a valid id',\n ]);\n } \n }", "public function edit()\n {\n\t$this->log(\"edit function\");\n\n \t// Check whether client is logged in\n // $logged_in = false;\n // if ($this->isLoggedIn()) {\n // $logged_in = true;\n // }\n\n // Get custom fields from Client controller => save\n \t$client_custom_fields = $this->Clients->getCustomFieldValues(1);\n return $this->set('client_custom_fields', $client_custom_fields);\n }", "public function test_edit_valid()\n {\n $company = $this->qComp();\n\n $user = User::first(); // Get admin user to use in request\n\n $companyData = ['name' => 'editTitle', 'email' => '[email protected]', 'website'=>'http://website.com'];\n\n $response = $this->actingAs($user) // send as admin\n ->from(\"/companies/$company->id/edit\") // send from edit page\n ->patch(\"/companies/$company->id/\",$companyData); // send patch request with data defined above\n \n $this->assertDatabaseHas('companies', $companyData); // check data was changed in database\n }", "function get_company_detail($id) {\n return get_view_data_where('org_detail', $id);\n}", "public function edit($id)\n {\n $company = TruckCompany::where('id',$id)->first();\n return [$company];\n }", "public function edit($id)\n {\n if (Auth::user()->can('Edit-Company')) \n {\n $companyData=Company::findOrFail($id);\n $setModal=1;\n $company=Company::orderBy('created_at','desc')->get();\n return view('Company.index',compact('company','setModal','companyData'));\n }\n else{\n abort(500);\n } //\n }", "public function companyDetails()\n {\n \tif(Yii::$app->request->isAjax){\n \t\t\n\t \t/*Model Dev*/\n\t \t$account = new ymoAccountSettings;\n\t \t\n\t \t$company = new $account->company;\n\t $company->scenario = 'updateCompany';\n\t \t\n\t \t\\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n\t \t\n\t \tif ($company->load(Yii::$app->request->post())) {\n\t \t\n\t \t\t$company->attributes = $company->load(Yii::$app->request->post());\n\t \t\n\t\t \tif($company->updateCompany())\n\t\t \t{\n\t\t \t\n\t\t\t \treturn [\n\t\t\t \t\t'name' => 'success',\n\t\t\t \t\t'message' => 'Successfull.',\n\t\t\t \t\t'content' => Yii::$app->controller->render('@common/errors/popup',[\n\t\t\t\t\t\t\t'custom' => Yii::$app->controller->renderPartial('@popups/company-details-done'),\n\t\t\t \t\t]),\n\t\t\t \t\t'status' => 200,\n\t\t\t \t];\n\t\t \t\n\t\t \t}else{\n\t\t \t\treturn [\n\t\t \t\t\t'name' => 'validationError',\n\t\t \t\t\t'message' => 'Validation fix errors.',\n\t\t \t\t\t'errors' => $company->getErrors(),\n\t\t \t\t\t'content' => Yii::$app->controller->render('@common/errors/popup',[\n\t\t \t\t\t\t'id' => 'form-company-details',\n\t\t \t\t\t\t'header' => Yii::t('app','Validation errors!'),\n\t\t \t\t\t\t'body' => Html::errorSummary($company,['class'=>'error-summary']),\n\t\t \t\t\t]),\n\t\t \t\t\t'status' => 500,\n\t\t \t\t];\n\t\t \t}\n\t \t}\n\t }else{\n \tthrow new NotFoundHttpException(Yii::t('yii', 'You are not allowed to perform this action.'));\n }\n }", "public function edit($id) {\n $company = CompanyModel::find((int) $id);\n if (!$company)\n return redirect('/admin/company')->withErrors(\"找不到该公司!\");\n\n foreach (array_keys($this->fields) as $field) {\n if ($field != 'content') {\n $data[$field] = old($field, $company->$field);\n }\n }\n $detail = CompanyDetailModel::find((int) $id);\n if ($detail) {\n $data['content'] = htmlspecialchars_decode($detail['content']);\n } else {\n $data['content'] = \"暂无\";\n }\n $logo = PictureModel::where('xid', '=', $id)->where('block', '=', 1)->where('type', '=', 1)->first();\n $data['logo'] = $logo;\n $data['regionlist'] = RegionModel::where('grade', '=', 2)->get()->toArray();\n $data['typeAll'] = CateModel::where('pid', '=', 8)->get()->toArray();\n if ($company['province']) {\n $data['citylist'] = RegionModel::where('pid', '=', $company['province'])->get()->toArray();\n }\n $data['id'] = (int) $id;\n return view('admin.company.edit', $data);\n }", "public function companyrecord() {\r\n\r\n if (isset($_GET['id'])) {\r\n $preview = $this->model->companyPreview($_GET['id']);\r\n }\r\n return $this->view('/company/companyrecord', $preview);\r\n }", "public function edit(Company $company)\n {\n // dd($company);\n return view('company.edit', compact('company'));\n }", "public function edit_updates($id_company_update)\n\t{\n\t\t//$data['active'] = 2;\n\n\t\t$id_company = $this->session->userdata('id_company');\n\t\t$data['company_update'] = $this->CompanyUpdatesModel->edit($id_company, $id_company_update);\n\n\t\t$this->load->view('skin/front_end/header_company_page_topbar');\n\t\t$this->load->view('skin/front_end/navbar_company_page', $data);\n\t\t$this->load->view('content_front_end/company_updates_page_edit', $data);\n\t\t$this->load->view('skin/front_end/footer_company_page');\n\t}", "public function detail_updates($id_company_update)\n\t{\n\t\t// check user's auth\n\t\t$id_company = $this->session->userdata('id_company');\n\t\tif ($id_company == \"\") {\n\t\t\tredirect( site_url('AccountCompany') );\n\t\t}\n\n\t\t//$data['active'] = 2;\n\n\t\t$id_company = $this->session->userdata('id_company');\n\t\t$data['company_update'] = $this->CompanyUpdatesModel->edit($id_company, $id_company_update);\n\n\t\t$company_name = $this->session->userdata('company_name');\n\t\t$data['company_name'] = $company_name;\n\n\t\t$this->load->view('skin/front_end/header_company_page_topbar');\n\t\t$this->load->view('skin/front_end/navbar_company_page', $data);\n\t\t$this->load->view('content_front_end/company_updates_page_detail', $data);\n\t\t$this->load->view('skin/front_end/footer_company_page');\n\t}", "public function index()\n {\n $company = TruckCompany::select(array('id','company_trading_name','created_at','contact_email'));\n return \\Datatables::of($company)\n ->addColumn('actions','<a class=\"btn btn-xs btn-alt\" data-toggle=\"modal\" onClick=\"launchUpdateCompanyModal({{$id}});\" data-target=\".modalEditCompany\">Edit</a>\n\t\t\t\t\t\t\t\t\t\t\t<a class=\"btn btn-xs btn-alt\" data-toggle=\"modal\">Suspend</a>\n\t\t\t\t\t\t\t\t\t\t\t<a class=\"btn btn-xs btn-alt\" data-toggle=\"modal\">Print Permit</a>\t\t\n\t\t\t\t\t\t\t')\n\n ->make(true);\n }", "function get_contacts_by_company($id) {\n return get_view_data_where('org_contact_list', $id);\n}", "public function editAction() {\n $model = new Application_Model_Compromisso();\n //busco no banco o quem eu quero editar\n $comp = $model->find($this->_getParam('id'));\n // renderiso uma view com os dados\n $this->view->assign(\"compromisso\", $comp);\n }", "public function edit($id)\n {\n return view('admin.edit-company',['id'=>$id]);\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function edit($id)\n { \n $company = Company::where(\"id\", $id)->first();\n $company_categories = CompanyCategory::all();\n return view('company.edit')->with(['company'=>$company, 'company_categories'=>$company_categories]);\n }", "public function edit($id)\n {\n\n $companies_cat = companycategory::all();\n\n\n $company = $this\n ->companyRepository\n ->findWithoutFail($id);\n\n if (empty($company))\n {\n Flash::error('Company not found');\n\n return redirect(route('mainCompanies.index'));\n }\n\n return view('admin.companies.edit_companies' , \n ['company' => $company, 'companies_cat' => $companies_cat ]) ;\n }", "public function edit(Company $company)\n {\n //\n return view('admin.companies.edit',compact('company'));\n }", "public function edit(Company $company)\n {\n $company = Company::where('id', $company->id)->first();\n return view('Admin.pages.company.edit')->with('company',$company);\n }", "function edit($programmes_id)\n { \n // check if the programmes_and_company exists before trying to edit it\n $data['programmes_and_company'] = $this->Programmes_and_company_model->get_programmes_and_company($programmes_id);\n \n if(isset($data['programmes_and_company']['programmes_id']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n );\n\n $this->Programmes_and_company_model->update_programmes_and_company($programmes_id,$params); \n redirect('programmes_and_company/index');\n }\n else\n {\n $data['_view'] = 'programmes_and_company/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The programmes_and_company you are trying to edit does not exist.');\n }", "public function edit(Company $company, $id)\n {\n $company = Company::find($id);\n return response()->json($company, 200);\n }", "public function edit()\n {\n // $logged_in = false;\n // if ($this->isLoggedIn()) {\n // $logged_in = true;\n // }\n \t$client_custom_fields = $this->Clients->getCustomFieldValues(1);\n return $this->set('client_custom_fields', $client_custom_fields);\n\n }", "public function edit($id)\n {\n $data['company'] = Companies::findOrFail($id);\n return view('companies.edit-company',$data);\n }", "public function edit(Comida $comida)\n {\n //\n }", "public function changeCompany()\r\n\t{\t\t\t\r\n\t\t$data = array('company_name' => $this->input->post('company_name'));\t\r\n\t\t\t\t//die('update');\r\n\t\t$where = array('id' => $this->session->userdata('emp_id'));\t\t\t\t\r\n\t\t$iStatus = $this->My_model->updateRecord('lang_company',$data,$where);\r\n\t\techo $iStatus;\t\t\r\n\t}", "public function edit(Company $company)\n {\n return view('company.edit',['company' => $company]);\n }", "public function edit($id)\n {\n $cmp = MainCompany::where('ID_No', $id)->first();\n\n $id = ActivityTypes::where('Name_Ar','=',null)->orWhere('Name_Ar','=','')->pluck('ID_No');\n DB::table('activitytypes')->where('Name_En',null)->where('Name_En',null)->orWhere('Name_Ar','=','')->delete();\n $acts = ActivityTypes::get(['Actvty_No', 'Name_'.ucfirst(session('lang'))]);\n $crncy = AstCurncy::get(['Curncy_No', 'Curncy_Nm'.ucfirst(session('lang'))]);\n\n return view('admin.companies.create',['title'=> trans('admin.company_fixed_data'), 'cmp' => $cmp, 'acts' => $acts, 'crncy' => $crncy]);\n }", "public function getEditlink(){\n return sprintf(\"<a href=\\\"/administration_company_edit/index/companyid/%s\\\">%s</a>\", $this->getId(), $this->getName()); \n }", "public function show(Company $company)\n {\n\n }", "public function getCompany() {}", "public function edit($id)\n {\n if (! Gate::allows('company_edit')) {\n return abort(401);\n }\n \n $vivode_ids = \\App\\Vivodeship::get()->pluck('name', 'id');\n\n $trades_ids = \\App\\Trade::get()->pluck('name', 'id');\n\n $nomiyear_ids = \\App\\Year::get()->pluck('name', 'id');\n\n $users = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n $company = Company::findOrFail($id);\n\n return view('admin.companies.edit', compact('company', 'vivode_ids', 'trades_ids', 'nomiyear_ids', 'users'));\n }", "public function getCompany();", "public function edit(Company $company)\n {\n $this->authorize('update', $company);\n return view('companies.edit', compact('company'));\n }", "public function viewAction() {\n $id = $this->getRequest()->getParam('id', null);\n if(!is_null($id)) {\n $company = Default_Model_Company::read($id);\n if(count($company) > 0) {\n $this->view->assign('company', $company);\n } else {\n $this->_redirect($this->view->actions['index']);\n } \n }\n }", "public function getEdit(Request $request, $id) {\n /* code for check roles and redirect it on index method of current controller if has not access */\n if (($return = UserRoles::hasAccess('demon', $request)) !== true) {\n return redirect()->action($return);\n }\n /* end permission code */\n\n $company_data = Company::find($id);\n if (empty($company_data)) {\n $msg_status = 'error';\n $message = \"Invalid Request URL\";\n $request->session()->flash($msg_status, $message);\n return redirect()->action('CompanyController@getIndex');\n }\n $users = User::getUserDropDownList();\n $view = view('company.edit', ['company_data' => $company_data, 'users' => $users]);\n return $view;\n }", "public function test_edit_nameonly_valid()\n {\n $company = $this->qComp();\n\n $user = User::first(); // Get admin user to use in request\n\n $companyData = ['name' => 'editTitle', 'email' => null, 'website'=>null];\n\n $response = $this->actingAs($user) // send as admin\n ->from(\"/companies/$company->id/edit\") // send from edit page\n ->patch(\"/companies/$company->id/\",$companyData); // send patch request with data defined above\n \n $this->assertDatabaseHas('companies', $companyData); // check data was changed in database\n }", "public function get_edit(){\n\t\tif (Auth::check()){\n\t\t\t$customer_id = Auth::user()->customer_id;\n\n\t\t\t$customer_types = array('' => 'Select One','Buyer'=>'Buyer','Vendor'=>'Vendor');\n\n\t\t\t$countries = array('' => 'Select One') + \n\t\t\t\tCountry::lists('country_name', 'country_id');\n\n\t\t\t$titles = array('' => 'Select One','Mr.'=>'Mr.','Mrs.'=>'Mrs.','Ms.'=>'Ms.','Miss'=>'Miss','Master'=>'Master',\n\t\t\t\t'Rev.'=>'Rev. (Reverend)','Fr.'=>'Fr. (Father)','Dr.'=>'Dr. (Doctor)','Atty.'=>'Atty. (Attorney)',\n\t\t\t\t'Prof.'=>'Prof. (Professor)','Hon.'=>'Hon. (Honorable)','Pres.'=>'Pres. (President)',\n\t\t\t\t'Gov.'=>'Gov. (Governor)','Coach'=>'Coach','Ofc.'=>'Ofc. (Officer)');\n\n\t\t\t$this->layout->content = View::make('frontend.customers.edit')\n\t\t\t\t->with('title', 'Edit Customer')\n\t\t\t\t->with('customer', Customer::find($customer_id))\n\t\t\t\t->with('customer_type',$customer_types)\n\t\t\t\t->with('customer_countryId', $countries)\n\t\t\t\t->with('customer_title', $titles);\n\t\t}\n\t}", "public function show(Company $company)\n {\n //\n }", "public function show(Company $company)\n {\n //\n }", "public function show(Company $company)\n {\n //\n }", "public function show(Company $company)\n {\n //\n }", "public function show(Company $company)\n {\n //\n }", "public function show(Company $company)\n {\n //\n }", "public function show(Company $company)\n {\n //\n }", "public function edit()\n\t{\n\t\t\n\t\t$sql = SqlQuery::getInstance();\n\t\t\n\t\t$tbl = new AbTable(\"SELECT u.first_name, u.last_name, u.zip, c.* FROM IBO_camp c JOIN user u ON u.id = c.user_id\",array('user_id'));\n\t\t\n\t\treturn $tbl->getHtml();\n\t\t\n\t\t\n\t}", "private function editar_get()\n {\n $item = $this->ObtenModelPostId();\n\t\t$lModel = new CicloModel(); \n \n //Pasamos a la vista toda la información que se desea representar\n\t\t$data['TituloPagina'] = \"Editar un grupo\";\n\t\t$data[\"Model\"] = $item;\n\t\t$data[\"ComboCiclos\"] = $lModel->ObtenerTodos();\n \n //Finalmente presentamos nuestra plantilla\n\t\theader (\"content-type: application/json; charset=utf-8\");\n $this->view->show($this->_Nombre.\"/editar.php\", $data);\n\t}", "public function edit(Company $company)\n {\n return view('companies.edit')\n ->with('company', $company)\n ->with('categories', Category::all())\n ->with('countries', Country::all());\n }", "public function edit($id)\n {\n // get the company\n $company = Company::find($id);\n $companyProfile = CompanyProfile::where('company_id', '=', $id)->first();\n $user = $report = User::where('company_id', '=', $id)\n ->where('role_id', '=', User::COMPANY_ADMIN)->first();\n\n return view('admin.companies.edit')->with(\n [\n 'company' => $company,\n 'companyProfile' => $companyProfile,\n 'user' => $user\n ]\n );\n }", "function get_companies_list() {\n return get_view_data('org_list');\n}", "public function edit(Companies $companies,$id)\n {\n $companies = Companies::where('id',$id)->first();\n return view('companies.edit',compact('companies'));\n }", "public function edit($id)\n {\n $company = Company::find($id);\n return view('dashboard.company_edit',[\n \"title\" => \"Edit Company\",\n \"active\" => \"company\"\n ], compact('company'));\n }", "public function edit($id)\n {\n\n\n $employee = Employee::find($id)->with('company')->first();;\n \n $companies = Company::all();\n return view('admin.employee.edit',compact('employee','companies',$employee,$companies));\n }", "public function get_company() \n {\n return $this->company;\n }", "public function edit($id)\n {\n $companycontacts = Company_has_contact::where('id', $id)->get();\n $companies = Company::where('id', $id)->get();\n return view('backend.company_contact.edit', compact('companycontacts','companies'));\n }", "public function edit($company_number)\n {\n $company = TblCompany::find($company_number);\n return view('company.edit',compact('company'));\n }", "public function update_data_company() {\t\t\n\t\t$data['active'] = 1;\n\n\t\t$id_company = $this->input->post('id_company');\n\n\t\t$data['company_type']= $this->get_company_type();\n\t\t$data['bidang_usaha']= $this->get_business_field();\n\n\t\t//if($this->session->userdata('admin_logged_in'))\n\t\t//{\n\t\t\t$this->load->model('company_member_models/CompanyOverviewModel');\n\t\t\t$this->load->library('form_validation');\n\n\t\t\t$edit = $this->input->post('save');\n\n\t\t\tif (isset($_POST['save']))\n\t\t\t{\n\t\t\t\t$id_company = $this->input->post('id_company');\n\n\t\t\t\t$this->form_validation->set_rules('company_name', 'Nama Company', 'required');\n\t\t\t\t$this->form_validation->set_rules('company_description', 'Deskripsi Company', 'required');\n\t\t\t\t$this->form_validation->set_rules('company_address', 'Address Company', 'required');\n\t\t\t\t$this->form_validation->set_rules('company_industries', 'Industries Company', 'required');\n\t\t\t\t$this->form_validation->set_rules('company_website', 'Website Company', 'required');\n\t\t\t\t$this->form_validation->set_rules('company_type', 'Type Company', 'required');\n\t\t\t\t$this->form_validation->set_rules('company_email', 'Email Company', 'required');\n\t\t\t\t$this->form_validation->set_rules('company_year', 'Year Company', 'required');\n\t\t\t\t$this->form_validation->set_rules('company_specialties[]', 'Company Specialties', 'required');\n\n\t\t\t\t// convert array to string\n\t\t\t\t$data_company_specialties = $this->input->post('company_specialties[]');\n\t\t\t\t$company_specialties = implode(\",\", $data_company_specialties);\n\n\t\t\t\t$data_company=array(\n\t\t\t\t\t\t\t\t'company_name'=>$this->input->post('company_name'),\n\t\t\t\t\t\t\t\t'company_description'=>$this->input->post('company_description'),\n\t\t\t\t\t\t\t\t'company_address'=>$this->input->post('company_address'),\n\t\t\t\t\t\t\t\t'company_industries'=>$this->input->post('company_industries'),\n\t\t\t\t\t\t\t\t'company_website'=>$this->input->post('company_website'),\n\t\t\t\t\t\t\t\t'company_type'=>$this->input->post('company_type'),\n\t\t\t\t\t\t\t\t'company_email'=>$this->input->post('company_email'),\n\t\t\t\t\t\t\t\t'company_year'=>$this->input->post('company_year'),\n\t\t\t\t\t\t\t\t'company_specialties'=>$company_specialties,\n\t\t\t\t\t\t\t\t'company_address'=>$this->input->post('company_address')\n\t\t\t\t\t\t\t\t);\n\t\t\t\t$data['dataCompany'] = $data_company;\n\n\t\t\t\t//value id_koridor berisi beberapa data, sehingga dilakukan split dengan explode\n\t\t\t\tif (($this->form_validation->run() == TRUE))\n\t\t\t\t{\n\t\t\t\t\t$this->db->update('company', $data_company, array('id_company'=>$id_company));\n\t\t\t\t\t$this->session->set_flashdata('msg_berhasil', 'Data Company Member berhasil diperbaharui');\n\t\t\t\t\tredirect('CompanyMember/overview_page');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('msg_gagal', 'Data Company Member gagal diperbaharui');\n\t\t\t\t\t$this->update_data_company($id_company);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$id_company = $this->session->userdata('id_company');\n\t\t\t\t\n\t\t\t\t$this->load->model('company_member_models/CompanyOverviewModel');\n\t\t\t\t$data['company'] = $this->CompanyOverviewModel->get_data_company_by_id($id_company)->row();\n\n\t\t\t\t$data_company=array(\n\t\t\t\t\t\t\t\t'id_company'=>$data['company']->id_company,\n\t\t\t\t\t\t\t\t'company_name'=>$data['company']->company_name,\n\t\t\t\t\t\t\t\t'company_email'=>$data['company']->company_email,\n\t\t\t\t\t\t\t\t'company_telepon'=>$data['company']->company_telepon,\n\t\t\t\t\t\t\t\t'company_website'=>$data['company']->company_website,\n\t\t\t\t\t\t\t\t'company_address'=>$data['company']->company_address,\n\t\t\t\t\t\t\t\t'company_industries'=>$data['company']->company_industries,\n\t\t\t\t\t\t\t\t'company_type'=>$data['company']->company_type,\n\t\t\t\t\t\t\t\t'company_specialties'=>$data['company']->company_specialties,\n\t\t\t\t\t\t\t\t'company_year'=>$data['company']->company_year,\n\t\t\t\t\t\t\t\t'company_description'=>$data['company']->company_description,\n\t\t\t\t\t\t\t\t'company_cover'=>$data['company']->company_cover,\n\t\t\t\t\t\t\t\t'company_logo'=>$data['company']->company_logo,\n\t\t\t\t\t\t\t\t'company_date_join'=>$data['company']->company_date_join\n\t\t\t\t\t\t\t\t);\n\t\t\t\t$data['dataCompany'] = $data_company;\n\t\t\t}\n\n\t\t\t$data['idCompany'] = $id_company;\n\t\t\t$this->load->view('skin/front_end/header_company_page_topbar');\n\t\t\t$this->load->view('skin/front_end/navbar_company_page', $data);\n\t\t\t$this->load->view('content_front_end/company_overview_page', $data);\n\t\t\t$this->load->view('skin/front_end/footer_company_page');\n\t\t//} \n\t\t//else\n\t\t//{\n\t\t\t//redirect(site_url('Account'));\n\t\t//}\n\t}", "public function edit(Company $company, OldInvoiceItem $oldInvoiceItem)\n {\n //\n }", "public function edit(Companies $company)\n {\n return view('companies.edit',[\n 'company' => $company\n ]);\n }", "public function edit($id)\n {\n $data = Shipping_Company::find($id);\n $list_status = $this->get_list_status();\n $list_grade = $this->get_list_shipping_company_grade();\n $list_region = $this->get_list_region();\n $list_shipping_company = Shipping_Company::orderBy('name')->lists('name', 'Id')->all();\n if($data){ \n return View::make('shipping_company.edit')->with('data', $data)->with('list_status', $list_status)->with('list_grade', $list_grade)->with('list_region', $list_region)->with('list_shipping_company', $list_shipping_company);\n } else {\n return Redirect::action('Shipping_CompanyController@index');\n }\n }", "public function edit(Company $company)\n {\n $company = Company::find($company->id);\n $categories = CompanyCategory::all();\n $provinces = Province::all();\n\n return view('company.edit', compact('company', 'provinces', 'categories'));\n }", "public function getEdit()\n\t{\n\t}", "public function edit($id)\n {\n $companyRepo = $this->companyRepository;\n $company = $companyRepo->model->find($id);\n $timings = $this->timingRepository->timings;\n $cities = $companyRepo->cities;\n return view('admin.module.company.edit',compact('company','timings','cities'));\n }", "public function edit($id)\n {\n $Companies = DB::table('companies')\n ->where('companies.id', '=', \"$id\")\n ->select('companies.*')\n ->get();\n\n return response()->json([\n 'data' => $Companies ? $Companies : null,\n 'message' => $Companies?'Successfully Received' : 'Error',\n ], 200);\n }", "public function actionGetEmptyCompanyInfo()\n {\n if (Yii::app()->request->isAjaxRequest && isset($_POST['companyId'])) {\n $companyId = intval($_POST['companyId']);\n if ($companyId > 0) {\n $company = Companies::model()->with('adreses')->findByPk($companyId);\n $addresses = $company->adreses;\n $address = $addresses[0];\n\n $this->renderPartial('empty_company_info' , array(\n 'company' => $company,\n 'address' => $address,\n ));\n }\n }\n }", "public function edit(Company $company)\n {\n $company = Company::find($company)->first();\n return view('company.edit',compact('company'));\n }", "public function edit($id)\n {\n $companies = Company::all();\n $data = Document::findOrFail($id);\n return view('backend.document.edit', compact('data','companies'));\n }", "public function edit($user_id=null) {\n //getting the active companies \n $company_name = CompanyInformation::where('status',1)->pluck('company_name','company_id');\n \t$users = User::where('user_id',$user_id)->first();\n \t$user_details = UserDetails::where('user_id',$user_id)->first();\n \treturn view('admin.user.create',['users'=>$users,'user_details'=>$user_details,'company_name'=>$company_name]);\n }", "public function edit($id)\n {\n $company = Company::where(\"id\",$id)->orWhere(\"email\", $id)->first();\n return view(\"/company/editbiodata\", compact('company'));\n }", "public function actionIndex()\n\t{\t\t\n\t$model=new Company('search');\n\t\t$model->unsetAttributes(); // clear any default values\n\t\tif(isset($_GET['Company']))\n\t\t\t$model->attributes=$_GET['Company'];\n\n\t\t$this->render('managecompany',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function populateCompanies(){\n $list = $this->company->get_companies();\n $data = array();\n foreach ($list as $company) {\n $row = array();\n $row[] = '<td class=\"min-width nowrap\"><input type=\"checkbox\" value=\"'.$company->companyID.'\"></td>';\n $row[] = \"#\".$company->companyID;\n $row[] = $company->name;\n $row[] = $company->contactName;\n $row[] = $company->contactMobile;\n $row[] = '<a href=\"mailto:'.$company->contactEmail.'\">'.$company->contactEmail.'</a>';\n\t\t\t$row[] ='<p><span class=\"btn btn-xs btn-secondary fa fa-edit\" onclick=\"updateClick('.$company->companyID.');\"></span> <a href=\"/admin/company/detail/'.$this->encrypt->encode($company->companyID).'\"><span class=\"btn btn-xs fa fa-eye\"></span></a></p>';\n\t\t\t\n array_push($data, $row);\n }\n \n $output = array(\n\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\"recordsTotal\" => $this->company->count_all(),\n\t\t\t\"recordsFiltered\" => $this->company->count_filtered(),\n\t\t\t\"data\" => $data,\n\t\t);\n echo json_encode($output);\n }", "public function company_edit() {\n add_submenu_page(\n 'companies',\n \"Add New Company\", // page title\n \"Add New Company\", // menu title\n 'manage_options', // capability\n 'companies_edit', // menu_slug,\n [ $this, 'company_edit_page' ]\n );\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SiteSavalizeBundle:Company')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Company entity.');\n }\n\n $editForm = $this->createForm(new CompanyType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('SiteSavalizeBundle:Company:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }" ]
[ "0.8079655", "0.76925296", "0.76925296", "0.76925296", "0.76925296", "0.76925296", "0.7447546", "0.74428105", "0.7371149", "0.73032147", "0.71465385", "0.7109031", "0.7096516", "0.70388436", "0.69281536", "0.6900483", "0.68406135", "0.6832966", "0.6808973", "0.67827827", "0.6756931", "0.6755543", "0.670939", "0.66558117", "0.6647209", "0.66375816", "0.663742", "0.6598687", "0.65783423", "0.65730375", "0.657273", "0.6566574", "0.6552666", "0.6545021", "0.65354997", "0.65335953", "0.65126", "0.6488316", "0.64875567", "0.6472998", "0.6467986", "0.64474386", "0.64462125", "0.6440336", "0.6435341", "0.64171714", "0.64117473", "0.6406064", "0.6385846", "0.6385214", "0.6380495", "0.6344949", "0.6314852", "0.63148475", "0.63120186", "0.63115394", "0.63069206", "0.6304583", "0.6301792", "0.6298115", "0.62979794", "0.6276867", "0.62684053", "0.6264784", "0.6262543", "0.6244865", "0.6240761", "0.6240761", "0.6240761", "0.6240761", "0.6240761", "0.6240761", "0.6240761", "0.6240233", "0.62112653", "0.61930436", "0.6188835", "0.6182647", "0.6169811", "0.6156397", "0.6151588", "0.61468875", "0.61419874", "0.61405236", "0.6125846", "0.6124024", "0.61187726", "0.61168355", "0.6107681", "0.6096718", "0.6095428", "0.6094892", "0.6091265", "0.6085487", "0.6085288", "0.60851914", "0.608106", "0.6077435", "0.6070851", "0.6059871", "0.60583484" ]
0.0
-1
GET TOTAL PURCHASE PRODUCT
public function get_total_purchase_item($product_id) { $this->db->select('SUM(quantity) as total_purchase'); $this->db->from('product_purchase_details'); $this->db->where('product_id',$product_id); $query = $this->db->get(); if ($query->num_rows() > 0) { return $query->result_array(); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTotal()\n {\n return $this->getQty() * $this->getProduct()->getPrice();\n }", "public function m_totalPurchaseProduct($data){\n\n $query = $this->db->query(\"SELECT id_compra,numeroOrden,producto,cantidad,productos.almacen FROM compra INNER JOIN productos ON compra.producto = productos.id_producto\n\nWHERE numeroOrden = '\".$data['noOrden'].\"'\");\n\n return $query->result_array();\n\n }", "function get_sum_purchases($order_id){\r\n\tglobal $dbc;\r\n\t\r\n\t$query = 'SELECT COUNT(*) AS total '.\r\n\t\t\t 'FROM order_merch_item '.\r\n\t\t\t 'WHERE order_id = \\''. $order_id .'\\' '.\r\n\t\t\t 'AND purch_merch_id IS NOT NULL ;';\r\n\t\r\n\t$result = mysqli_query($dbc, $query);\r\n\tif(!$result){\r\n\t\tdie('Error - '. mysqli_errno($dbc));\r\n\t}\r\n\telse{\r\n\t\t$row = mysqli_fetch_object($result);\r\n\t\treturn $row->total;\r\n\t}\r\n\t\r\n}", "function get_deals_subtotal( $_deals, $quantity ) {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$price \t\t\t= $_deals->get_sale();\n\t\t\t\t\t\t\t\n $row_price \t\t= $price * $quantity;\n $return = cmdeals_price( $row_price );\n\t\t\t\n\t\t\treturn $return; \n\t\t\t\n\t\t}", "public function getProductsCostTotal()\n {\n return $this->getProducts()->sum('price');\n }", "public function get_total_items(){\n\t \t$total = 0;\n\t \t//Si no esta vacio va sumando la cantidad de articulos\n\t \tif(!empty($this->cart)){\n\t \t\tforeach ($this->cart as $linea){\n\t\t\t\t\t$total += $linea['amount'];\n\t\t\t\t}\n\t \t}\n\t \techo $total;\n\t }", "public function getTotalPrice()\n {\n // use format_currency to get correct decimals and avoid rounding errors\n return $this->getQuantity() * format_currency($this->getProductPrice(),null, true);\n// return $this->getQuantity() * format_currency($this->getNetPrice(),null, true);\n }", "function getPriceTotal()\n{\n\t$total = \\Cart::instance('shopping')->total();\n\n return $total;\n}", "public function getPurchaseGrandTotal() {\n return $this->purchaseGrandtotal; \n }", "public function get_total_sales_item($product_id)\n\t{\n\t\t$this->db->select('SUM(quantity) as total_sale');\n\t\t$this->db->from('invoice_details');\n\t\t$this->db->where('product_id',$product_id);\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\treturn false;\n\t}", "function getTotalPrice(){\n \treturn $this->myCart->total();\n }", "public function providerNormalPurchases()\r\n\t{\r\n\t\t$appleProduct = $this->getAppleProduct();\r\n\t\t$lightProduct = $this->getLightProduct();\r\n\t\t$starshipProduct = $this->getStarshipProduct();\r\n\r\n\t\treturn array(\r\n\t\t\tarray(\r\n\t\t\t\t2.0 * self::PRODUCT_APPLE_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($appleProduct, 2.0),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t5 * self::PRODUCT_LIGHT_PRICE + 1.0 * self::PRODUCT_APPLE_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($lightProduct, 5),\r\n\t\t\t\t\tnew ProductToPurchase($appleProduct, 1.0),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t1 * self::PRODUCT_STARSHIP_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($starshipProduct, 1),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t);\r\n\t}", "public function total()\n {\n // $this->line_items\n $total_price = 0;\n foreach ($this->line_items as $key => $value) {\n $total_price = $total_price + $value->product->price_amount;\n }\n // dd();\n return $total_price;\n }", "public function getTotalProducts()\n {\n $resource = $this->_productFactory->create()->getResource();\n \n $connection = $resource->getConnection();\n $select = $connection->select();\n $select->from(\n $resource->getTable('catalog_product_entity'),\n ['total_product' => 'count( entity_id )']\n )->where(\n 'vendor_id = :vendor_id'\n );\n $bind = ['vendor_id' => $this->getVendor()->getId()];\n \n $total = $connection->fetchOne($select, $bind);\n return $total;\n }", "public function getProductPurchaseDetail($colname='',$whrValue='',$type=''){\r\n if($colname != ''){\r\n if($type == 'proddownload'){\r\n $this->CI->db->select('SUM('.$colname.') AS prodcnt');\r\n $this->CI->db->from('ts_purchaserecord');\r\n $this->CI->db->where($whrValue);\r\n $rs=$this->CI->db->get();\r\n $res = $rs->result_array();\r\n return (($res[0]['prodcnt']!='') ? $res[0]['prodcnt'] : '0') ;\r\n\t\t\t}\r\n\t\t\telse if($type == 'prodpurchase'){\r\n $res = $this->CI->DatabaseModel->access_database('ts_purchaserecord','select','',$whrValue);\r\n return (!empty($res) ? count($res) : '0') ;\r\n\t\t\t}\r\n }\r\n else {\r\n return '0';\r\n }\r\n die();\r\n\t}", "public function total()\n {\n \treturn $this->price()*$this->quantity;\n }", "function total( $params ) {\n\t\textract( $params );\n\n\t\t// Should zcarriage be in the items or not? If $zcarriage='NO' exclude the zcarriage from the total cost\n\t\t$zcarriage = !empty( $zcarriage ) && $zcarriage == 'NO' ? \" AND sku<>'zcarriage'\" : '';\n\n\t\t// The pu already contains vat\n\t\t$res = $this->db->query( \"SELECT SUM(ci.qty*ci.pu) price FROM cart_items ci INNER JOIN cart c ON c.id=ci.cart_id WHERE cart_id='\".$cart_id.\"' AND user='\".$user_no.\"' AND qty>0\".$zcarriage )->row_array();\n\t\treturn $res[ 'price' ];\n\t}", "private function total()\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t$total = 0;\n\t\t//\tSumando el precio de cada producto.\n\t\tforeach($cart as $item){\n\t\t\t$total += $item->precio * $item->cantidad;\n\t\t}\n\t\treturn $total;\n\t}", "public function ctrMostrarTotalProducto(){\n\n\n\n\t$tabla = 'productos';\n\n\n\n\t$respuesta = ModeloProducto::mdlMostrarTotalProducto($tabla);\n\n\n\n\treturn $respuesta;\n\n\n\n\t}", "public function individual_products_total() {\n\n foreach($this->remaining_category_price as $remaining_category_prices){\n $this->individual_products_total += $remaining_category_prices['price'];\n }\n\n }", "public function gettotalbuy()\n {\n $query = $this->db->query(\"SELECT SUM(`price`) as total FROM `purchase` WHERE DATE(`date`)=CURDATE()\");\n return $query->result();\n\n }", "function totalSale()\r\n {\r\n //$strSQLQuery = \"SELECT SUM(TotalPrice) as OrderTotal FROM e_orders WHERE PaymentStatus=1 AND OrderStatus='Completed'\";\r\n $strSQLQuery = \"SELECT SUM((CASE when Currency='USD' then TotalPrice \r\n \t\telse TotalPrice/CurrencyValue\r\n\tEND )) as OrderTotal FROM e_orders WHERE (PaymentStatus='1' OR OrderType in('Amazon','Ebay')) AND OrderStatus in ('Completed', 'Shipped','Unshipped') \";\r\n $arrayRow = $this->query($strSQLQuery, 1);\r\n return $arrayRow[0]['OrderTotal'];\r\n }", "public function total_items()\n {\n $total_items = 0;\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n foreach ($items as $key)\n {\n $total_items =+ ($total_items + $key['qty']);\n }\n return $total_items;\n }\n }", "function get_total() {\n\t\t\treturn cmdeals_price($this->total);\n\t\t}", "public function subtotal()\n\t{\n\t\tif(count($this->cart) > 0)\n\t\t{\n\t\t\t$products = \\Model_Products::build();\n\t\t\tforeach($this->cart as $key => $item)\n\t\t\t{\n\t\t\t\t$products->or_where('ProductID', $key);\n\t\t\t}\n\t\t\t$products->selector('Product_Price, ProductID');\n\n\t\t\t$prices = $products->execute();\n\n\t\t\t$subtotal = 0;\n\n\t\t\tforeach($prices as $price)\n\t\t\t{\n\t\t\t\t$subtotal += (int)$price->Product_Price*$this->cart[$price->ProductID];\n\t\t\t}\n\t\t\t\n\t\t\treturn $subtotal;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function penjualan_product()\n\t{\n\t\t$sql = \"SELECT product_name, SUM(qty) as count FROM detail_order GROUP BY product_name\";\n\n // $queryRec = $this->db->query($sql,array($tanggal,$jam,$daerah,$daerah));\n $queryRec = $this->db->query($sql)->result_array();\n return $queryRec;\n\t}", "function get_product_for_purchase($input_product_id , $total_number)\n\t{\n\t\t$product_info\t=\t$this->db->get_where('product' , array(\n\t\t\t\t\t\t\t\t'product_id' => $input_product_id\n\t\t\t\t\t\t\t))->row();\n\n\t\techo '<tr id=\"entry_row_' . $total_number . '\">\n\t\t\t\t<td id=\"serial_' . $total_number . '\">' . $total_number . '</td>\n\t\t\t\t<td>' . $product_info->serial_number . '</td>\n\t\t\t\t<td>' . $product_info->name . '\n\t\t\t\t\t<input type=\"hidden\" name=\"product_id[]\" value=\"' . $product_info->product_id . '\"\n\t\t\t\t\t\tid=\"single_entry_product_id_' . $total_number . '\">\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"number\" name=\"quantity[]\" value=\"1\" min=\"1\"\n\t\t\t\t\t\tid=\"single_entry_quantity_' . $total_number . '\"\n\t\t\t\t\t\t\tonkeyup=\"calculate_single_entry_sum(' . $total_number . ')\"\n\t\t\t\t\t\t\t\tonclick=\"calculate_single_entry_sum(' . $total_number . ')\">\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"number\" name=\"purchase_price[]\" value=\"' . $product_info->purchase_price . '\" min=\"1\"\n\t\t\t\t\t\tid=\"single_entry_purchase_price_' . $total_number . '\"\n\t\t\t\t\t\t\tonkeyup=\"calculate_single_entry_sum(' . $total_number . ')\"\n\t\t\t\t\t\t\t\tonclick=\"calculate_single_entry_sum(' . $total_number . ')\">\n\t\t\t\t</td>\n\t\t\t\t<td id=\"single_entry_total_' . $total_number . '\">' . $product_info->purchase_price . '</td>\n\t\t\t\t<td>\n\t\t\t\t\t<i class=\"fa fa-trash\" onclick=\"delete_row(' . $total_number . ')\"\n\t\t\t\t\t\tid=\"delete_button_' . $total_number . '\" style=\"cursor: pointer;\"></i>\n\t\t\t\t</td>\n\t\t\t</tr>';\n\t}", "function get_cart_total() {\n\t\t\tif (!$this->prices_include_tax) :\n\t\t\t\treturn cmdeals_price($this->cart_contents_total);\n\t\t\telse :\n\t\t\t\treturn cmdeals_price($this->cart_contents_total + $this->tax_total);\n\t\t\tendif;\n\t\t}", "public function getProductQuantity()\n {\n }", "function btce_get_active_order_total($key, $secret) {\n $orders = btce_active_orders($key, $secret);\n $_total = 0;\n foreach ($orders->return as $order) {\n if ($order->type == 'sell') {\n $_total += $order->amount;\n }\n }\n return $_total;\n}", "function priceCart(){\n\t\t$sum = 0;\n\t\tforeach ($this->articulos as $bookid => $book) {\n\t\t\t$sum += $book['precio']*$book['cantidad'];\n\t\t}\n\t\treturn $sum;\n\t}", "public function listar_productos_resumen_carrito_precio_total() {\n \n try {\n $sql = \"\n select \n sum(i.total_venta) as precio_total,\n e.redondeo\n from \n al_producto p inner join al_inventario i\n on\n p.id_producto = i.id_producto inner join pedido e\n on\n i.id_pedido = e.id_pedido \n where\n e.id_cliente = '$_SESSION[cliente_id]' and e.estado is null; \n \";\n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n return $resultado;\n } catch (Exception $exc) {\n throw $exc;\n }\n }", "public function getTotalPrice() {\n return $this->getQuantity()*$this->getPrice();\n }", "public function calcTotal()\n {\n\n $productBusinessService = new ProductBusinessService();\n\n // create an array to hold all subtotals\n $subtotals_array = array();\n $this->total_price = 0;\n\n foreach ($this->items as $item => $qty) {\n\n // get the price of the product from the database\n $product = $productBusinessService->getProductByID($item);\n\n // calculate the total (price * quantity)\n $product_subtotal = $product->getPrice() * $qty;\n\n // add that subtotal to the subtotal array\n $subtotals_array = $subtotals_array + array($item => $product_subtotal);\n\n // add the item subtotal to the cart total\n $this->total_price += $product_subtotal;\n }\n\n // set the subtotals array\n $this->subtotals = $subtotals_array;\n }", "public function amount()\n {\n return $this->products()->select('price')->get()->sum(function ($product) {\n return $product->price;\n });\n }", "public function getTotalPrice();", "public function getTotalPrice();", "public function getPurchaseSubTotal() {\n return $this->purchaseSubtotal; \n }", "public function getSubtotal()\n {\n $price = 0;\n\n foreach ($this->order_configurations as $config) {\n $products = EntityUtils::getRepository(\"Product\")->getProducts($config->configuration, true);\n foreach ($products as $product) {\n $price += $product->getDiscountedPrice($this->program->id) * $config->quantity;\n }\n }\n\n return number_format($price, 2, \".\", \",\");\n }", "public function purchases()\n\t{\n\t\t$EE =& get_instance();\n\n\t\tif(!$member_id = $EE->TMPL->fetch_param(\"member_id\"))\n\t\t\t$member_id = $EE->session->userdata['member_id'];\n\n\t\t$query = $EE->db->query(\"SELECT p.purchase_id as purchase_id,\n\t\t\tp.member_id as member_id,\n\t\t\tp.purchase_id as purchase_id,\n\t\t\tp.item_id as item_id,\n\t\t\tp.txn_id as txn_id,\n\t\t\tp.purchase_date as purchase_date,\n\t\t\tp.note as purchase_note,\n\t\t\tp.item_cost as item_cost,\n\t\t\tt.title as title,\n\t\t\tt.url_title as url_title,\n\t\t\tt.entry_id as entry_id\n\t\tFROM `exp_simple_commerce_purchases` as p\n\t\tLEFT JOIN `exp_simple_commerce_items` as i ON p.item_id = i.item_id\n\t\tLEFT JOIN `exp_channel_titles` as t ON i.entry_id = t.entry_id\n\t\tLEFT JOIN `exp_members` as m ON p.member_id = m.member_id\n\t\tLEFT JOIN `exp_channel_data` as d ON i.entry_id = d.entry_id\n\t\tWHERE p.member_id = '{$member_id}'\n\t\tORDER BY p.purchase_id DESC\");\n\n\t\tif($query->num_rows == 0)\n\t\t{\n\t\t\treturn $EE->TMPL->parse_variables_row($EE->TMPL->tagdata, array(\"no_purchases\" => TRUE));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $query->result_array();\n\t\t\tforeach ($result as $key => $value)\n\t\t\t{\n\t\t\t\t$result[$key][\"license_key\"] = sprintf('%03d', $value[\"item_id\"])\n\t\t\t\t\t. sprintf('%05d', $value[\"member_id\"])\n\t\t\t\t\t. sprintf('%05d', $value[\"purchase_id\"])\n\t\t\t\t\t. sprintf('%02d', 1)\n\t\t\t\t\t. $value[\"purchase_date\"];\n\t\t\t}\n\t\t\treturn $EE->TMPL->parse_variables($EE->TMPL->tagdata, $result);\n\t\t}\n\t}", "function getSubTotal()\n {\n return $this->_cart->getQuote()->getSubtotal();\n }", "public static function totalItem(){\n if(Auth::check()){\n $cart = cart::Where('user_id', Auth::id() )\n ->Where('order_id',NULL)\n ->get();\n }\n else{\n $cart = cart::Where('ip_address', request()->ip() )\n ->Where('order_id',NULL)\n ->get();\n }\n $totalItem=0;\n foreach ($cart as $value) {\n $totalItem += $value->product_quantity;\n }\n return $totalItem;\n\n}", "public function get_products_in_purchase_of_costumer() {\n $query = $this->db->query(\"select products_in_order_of_costumers.order_number_fk, products_in_order_of_costumers.product_code_fk, products_in_order_of_costumers.quantity, products_in_order_of_costumers.price_per_unit, products.image, products.model from products inner join products_in_order_of_costumers on products_in_order_of_costumers.product_code_fk = products.product_code ORDER BY(products_in_order_of_costumers.order_number_fk)\");\n if ($query) {\n return $query->result_array();\n }\n return false;\n }", "function inventory_total($inventory) {\n $inventory_total = 0;\n foreach ($inventory as $product_id => $quantity) {\n $inventory_total += $quantity;\n }\n return $inventory_total;\n}", "function total_items($cart){\n $items = 0;\n if(is_array($cart)){\n foreach($cart as $isbn => $qty){\n $items += $qty;\n }\n }\n return $items;\n }", "public function getCartTotal()\n {\n }", "public function getSubTotalProperty()\n {\n $subtotal = Money::MXN(0);\n\n foreach ($this->shoppingCart as $product) {\n $quantity = $product->pivot->quantity;\n $subtotal = $subtotal->add($product->price->multiply($quantity));\n }\n\n return $subtotal;\n }", "function getCartTotal(){\n\t\t$totalCost = 0;\n\t\t$cartInfo = $this->getCart();\n\t\t$cartInfoSize = sizeof($cartInfo);\n\t\t$cartInfoSize--;\n\t\tfor($i=0; $i<=$cartInfoSize; $i++) {\n\t\t\t$totalCost = $totalCost + $cartInfo[$i][\"price\"];\n\t\t}\n\n\t\treturn $totalCost;\t\n\t}", "function current_purchases() {\n\tglobal $wpdb;\n\n\t$current_user = wp_get_current_user();\n\n\tif ( !($current_user instanceof \\WP_User) )\n\t\treturn [];\n\n\treturn $wpdb->get_col(\n\t\t$wpdb->prepare(\n\t\t\t'SELECT order_id FROM ' . $wpdb->prefix . 'digimember_user_product WHERE user_id = %d',\n\t\t\t$current_user->ID\n\t\t)\n\t);\n}", "private function getPurchases()\n {\n try {\n $items = [];\n $collection = $this->checkoutSession->getLastRealOrder()->getAllVisibleItems();\n $store = $this->storeManager->getStore();\n foreach ($collection as $product) {\n $formatted_price = $product->getRowTotal() - $product->getDiscountAmount() + $product->getTaxAmount();\n $prod = [\n 'item_id' => $product->getProductId(),\n 'quantity' => $product->getQtyOrdered(),\n 'price' => $product->getPrice(),\n 'properties' => [\n 'formatted_price' => $formatted_price,\n 'sku' => $product->getSku(),\n 'tax_amount' => $product->getTaxAmount(),\n 'currency' => $this->environment->getCurrencyCode(),\n 'current_crcy' => $store->getCurrentCurrencyCode(),\n 'lang' => $store->getCode()\n ]\n ];\n $items[] = $prod;\n }\n\n return $items;\n } catch (\\Exception $exception) {\n $this->logger\n ->critical(\n \"Observer/Purchase->getPurchases() Exception: \",\n [\n get_class($exception),\n $exception->getMessage(),\n $exception->getCode()\n ]\n );\n return [];\n }\n }", "private function _generateProductsData(){\n \n $products = $this->context->cart->getProducts();\n $pagseguro_items = array();\n \n $cont = 1;\n \n foreach ($products as $product) {\n \n $pagSeguro_item = new PagSeguroItem();\n $pagSeguro_item->setId($cont++);\n $pagSeguro_item->setDescription(Tools::truncate($product['name'], 255));\n $pagSeguro_item->setQuantity($product['quantity']);\n $pagSeguro_item->setAmount($product['price_wt']);\n $pagSeguro_item->setWeight($product['weight'] * 1000); // defines weight in gramas\n \n if ($product['additional_shipping_cost'] > 0)\n $pagSeguro_item->setShippingCost($product['additional_shipping_cost']);\n \n array_push($pagseguro_items, $pagSeguro_item);\n }\n \n return $pagseguro_items;\n }", "function total_items($cart){\n\t\t$items = 0;\n\t\tif(is_array($cart)){\n\t\t\tforeach($cart as $isbn => $qty){\n\t\t\t\t$items += $qty;\n\t\t\t}\n\t\t}\n\t\treturn $items;\n\t}", "public function getTotalQtyOrdered();", "function total_sale($product_id, $field = 'qty')\n {\n $return = 0;\n $sales = $this->db->get('sale')->result_array();\n foreach ($sales as $row) {\n if ($a = $this->product_in_sale($row['sale_id'], $product_id, $field)) {\n $return += $a;\n }\n }\n return $return;\n }", "public function purchasedBooks()\n { \n return $this->orders();\n }", "function total_price(){\n\t$total=0;\n\tglobal $conn;\n\t$ip = getIp();\n\t$sql = \"SELECT * FROM cart where ip_add='$ip'\";\n\t$result = $conn->query($sql);\n\twhile($row=$result->fetch_assoc()){\n\t\t$pro_id= $row[\"p_id\"];\n\t\t$pro_price= \"SELECT * FROM products where product_id='$pro_id' AND stock='0'\";\n\t\t$result2 = $conn->query($pro_price);\n\t\twhile($row2=$result2->fetch_assoc()){\n\t\t\t$product_price= array($row2[\"product_price\"]);\n\t\t\t$values = array_sum($product_price);\n\t\t\t$total +=$values;\n\t\t\t}\n\t}\n\techo number_format($total) ;\n}", "public function getPurchaseProdPrice() {\n return $this->purchaseProdPrice;\n }", "public function providerDiscountPurchases()\r\n\t{\r\n\t\t$appleProduct = $this->getAppleProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\t\t$lightProduct = $this->getLightProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\t\t$starshipProduct = $this->getStarshipProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\r\n\t\treturn array(\r\n\t\t\tarray(\r\n\t\t\t\t7.0 * self::PRODUCT_APPLE_DISCOUNT_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($appleProduct, 7.0),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t5 * self::PRODUCT_LIGHT_PRICE + 8.0 * self::PRODUCT_APPLE_DISCOUNT_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($lightProduct, 5),\r\n\t\t\t\t\tnew ProductToPurchase($appleProduct, 8.0),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t4 * self::PRODUCT_STARSHIP_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($starshipProduct, 6)\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t);\r\n\t}", "function get_order_total(){\n\t$cart = $_SESSION['custCart_ID']; // the SESSION and COOKIE customer cart items array\n\t$max=count($_SESSION[$cart]);\n\t$sum=0;\n\tfor($i=0;$i<$max;$i++){\n\t\t$pid=$_SESSION[$cart][$i]['bookid'];\n\t\t$q=$_SESSION[$cart][$i]['qty'];\n\t\t$price=get_price($pid);\n\t\t$sum+=$price*$q;\n\t}\n\treturn $sum;\n}", "public function get_total()\n\t{\n\t\treturn $this->EE->cartthrob->cart->total();\n\t}", "public function itemTotal(): float;", "public function getProductTotals($json) {\n\n $arr = json_decode($json );\n $isSuccess = $arr->info;\n $result = array();\n\n if ($isSuccess==\"SUCCESS\") {\n $data = $arr->data;\n foreach($data as $key => $value){\n if ($key=='PurchaseOrderProduct') {\n $purchaseOrderProduct = $value;\n foreach($purchaseOrderProduct as $purchaseOrderProductValue){\n $product = new Product($purchaseOrderProductValue);\n $productTotals = $product->getProductTotal();\n $product_type_id = $product->getProductTypeId();\n $result[$product_type_id] = isset($result[$product_type_id]) ? \n $result[$product_type_id] + $productTotal : $productTotals;\n }\n }\n }\n\n return $result;\n } \n }", "function getAmount($product)\n{\n\tinclude 'setup.php';\n\n\t$stocks = getStocks();\n\tif($stocks == -1)\n\t\treturn -1;\n\telse\n\t{\n\t\tif(isset($stocks[$product][instock]))\n\t\t\treturn $stocks[$product][instock];\n\t\telse\n\t\t\treturn 0;\n\t}\n}", "function getPurchases($db) {\n $qres;\n try {\n $qres = $db->purchases_get_all();\n } catch (FPDB_Exception $e) {\n die($e->getMessage());\n }\n return $qres;\n }", "function total_price($cart){\n $price = 0.0;\n if(is_array($cart)){\n foreach($cart as $isbn => $qty){\n $bookprice = getbookprice($isbn);\n if($bookprice){\n $price += $bookprice * $qty;\n }\n }\n }\n return $price;\n }", "public function test_total_products_quantity()\n {\n $order1 = \\App\\Order::find(1);\n $order2 = \\App\\Order::find(2);\n\n $this->assertEquals(9, $this->orders_service->getTotalProductsQuantity($order1));\n $this->assertEquals(3, $this->orders_service->getTotalProductsQuantity($order1, true));\n $this->assertEquals(0, $this->orders_service->getTotalProductsQuantity($order2, false));\n $this->assertEquals(0, $this->orders_service->getTotalProductsQuantity($order2, true));\n }", "public function total()\n {\n $total = 0;\n foreach($this->_data as &$product) {\n $total += ($product['price'] * $product['quantity']);\n }\n\n return $total;\n }", "public function getProduct();", "function total_price($cart){\n\t\t$price = 0.0;\n\t\tif(is_array($cart)){\n\t\t \tforeach($cart as $isbn => $qty){\n\t\t \t\t$medicineprice = getmedicineprice($isbn);\n\t\t \t\tif($medicineprice){\n\t\t \t\t\t$price += $medicineprice * $qty;\n\t\t \t\t}\n\t\t \t}\n\t\t}\n\t\treturn $price;\n\t}", "public function getQty();", "public function getQty();", "public static function getOrderedProductsQuantity(): string\n {\n $query = new Query();\n $total = $query->select([\n 'COUNT(*) as total'\n ])\n ->from(['sale_items'])\n ->where([\n 'customer_auth_id' => Yii::$app->user->identity->id,\n 'sale_id' => 0\n ])\n ->scalar();\n\n return $total;\n }", "public function getTotalPaid();", "function total_price() {\n\t\n\t $ip_add = getRealIpAddr();\n\t\t\n\t\tglobal $db;\n\t\t\n\t\t$total=0;\n\t\t\n\t\t$sel_price = \"select * from cart where ip_add='$ip_add'\";\n\t\t\n\t\t$run_price = mysqli_query($db, $sel_price);\n\t\t\n\t\twhile ($record= mysqli_fetch_array($run_price)){\n\t\t\t\n\t\t\t$pro_id = $record['p_id'];\n\t\t\t\n\t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n\t\t\t\n\t\t\t$run_pro_price = mysqli_query($db,$pro_price);\n\t\t\t\n\t\t\twhile($p_price=mysqli_fetch_array($run_pro_price)){\n\t\t\t\t\n\t\t\t\t$product_price = array($p_price['product_price']);\n\t\t\t\t\n\t\t\t\t$values = array_sum($product_price);\n\t\t\t\t\n\t\t\t\t$total += $values;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\techo \"Rs\" . $total;\n\t\n}", "function totalPrice() {\n\n $total = 0;\n\n global $con;\n\n $ip = getIp();\n\n $run_price = mysqli_query($con,\"SELECT * FROM cart WHERE ip_add = '$ip'\");\n\n while($row_pro_price = mysqli_fetch_array($run_price)) {\n\n $pro_id = $row_pro_price['p_id'];\n $pro_qty = $row_pro_price['qty'];\n\n $run_pro_price2 = mysqli_query($con,\"SELECT * FROM products WHERE product_id = '$pro_id'\");\n\n while($row_pro_price2 = mysqli_fetch_array($run_pro_price2)) {\n\n $pro_price = array($row_pro_price2['product_price']);\n\n $pro_price_single = $row_pro_price2['product_price'];\n\n $pro_price_values = array_sum($pro_price);\n\n\n $total += $pro_price_values;\n\n if($pro_qty > 1) {\n $pro_price_single_all = $pro_price_single * $pro_qty;\n $total = $total + $pro_price_single_all - $pro_price_single;\n }\n\n\n }\n\n }\n echo \"$\" . $total;\n }", "public function get_total_cost()\n\t{\n\t\t$num = '0.00';\n\t\tif (isset($_SESSION['cart']))\n\t\t{\n\t\t\t#if there are items to display \n\t\t\t\n\t\t\t#get product ids\n\t\t\t$ids = $this->get_ids();\n\t\t\t\n\t\t\t#get product prices\n\t\t\tglobal $Products;\n\t\t\t$prices = $Products->get_prices($ids);\n\t\t\t\n\t\t\t#loop throih adding the cost of each item and timesing it by the number of item in the cart. \n\t\t\tif($prices != NULL)\n\t\t\t{\n\t\t\t\tforeach($prices as $price)\n\t\t\t\t{\n\t\t\t\t\t$num += doubleval($price['price'] * $_SESSION['cart'][$price['id']]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $num;\n\t}", "private function update_total_of_cart() {\n\t\t// Get products\n\t\t$products = $this->get_current_products();\n\n\t\t// Loop through and add subtotals\n\t\t$total = 0;\n\t\tforeach ($products as $product) {\n\t\t\t$total += $product[\"subtotal\"];\n\t\t}\n\n\t\t// Check if promo code attached and delete if total drops below minimum amount\n\t\tif ($this->does_cart_already_have_promo_code() == true) {\n\t\t\t// Yes, it does, check to see if still above minimum amount\n\t\t\t$promo_code = $this->promo_code;\n\t\t\tif ($promo_code->code_type == 2) {\n\t\t\t\tif ($total < $promo_code->minimum_amount) {\n\t\t\t\t\t$this->remove_promo_code();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update and save\n\t\t$this->cart_total = $total;\n\t\t$this->save();\n\t}", "public static function getTotalProductCount() {\n Db_Actions::DbSelect(\"SELECT COUNT(id) FROM cscart_products\");\n }", "public function totalRecount()\n {\n $products = $this->products;\n $newTotal = 0;\n foreach ($products as $product) {\n if ($product->removed) {\n continue;\n }\n $newTotal += $product->count * $product->price;\n }\n $this->total = $newTotal;\n $this->save();\n }", "public function total(){\n return $this->cart_contents['cart_total'];\n }", "public function purchase_items()\n\t{\n\t\t$products = DB::table('products')->select('id as value', 'product_name as label')->where('category_id', 2)->orderBy('id', 'desc')->get();\n\t\t$str = json_encode($products);\n\t\t$str = preg_replace('/\"([^\"]+)\"\\s*:\\s*/', '$1:', $str);\n\t\techo $str;\n\t}", "public function delete_product_purchase()\n\t{\n\t\tif(empty($this->request->data['id_cliente']) || empty($this->request->data['produto_id']))\n\t\t{\n\t\t\t$this->Return = false;\n\t\t\t$this->Message = 'Informar produto e codigo do cliente';\n\t\t\t$this->EncodeReturn();\t\n\t\t}\n\n\t\t$CartSession = json_decode(base64_decode($this->request->data['carrinho']), 1);\n\n\t\t$i = 0;\t\t\t\t\n\t\tforeach ($CartSession['item'] as $item) \n\t\t{\n\t\t\tif($item['Produto']['id'] == $this->request->data['produto_id'] && $i == $this->request->data['indice'])\n\t\t\t{\n\t\t\t\tunset($CartSession['item'][$i]);\t\t\t\t\n\t\t\t}\n\n\t\t\t$i++;\n\t\t}\t\t\n\n\t\tsort($CartSession['item']);\t\n\n\t\t##realiza soma de valores\n\t\t$this->CountPurchase($CartSession);\t\n\t\t$this->EncodeReturn();\t\n\t}", "public function total_items()\n\t{\n\t\treturn array_get($this->cart_contents, $this->cart_name . '.total_items', 0);\n\t}", "public function getBaseTotalQtyOrdered();", "public function getTotalPrice()\n\t{\n\t\t$total = 0.0;\n\n\t\tforeach ($this->items as $item)\n\t\t{\n $total += $item->getPrice() + $item->getExtrasPrice();\n }\n\n\t\treturn $total;\n\t}", "public static function getTotalValueOfOrder()\n {\n \ttry\n \t{\n\t \t$storage = My_Zend_Globals::getStorage();\n\t \n\t \t$table = self::_TABLE_PRODUCT_ORDER_DETAIL;\n\t \n\t \t//Query data from database\n\t \t$select = $storage->select()\n\t\t\t\t\t \t->from($table,'sum(amount_total)')\n\t\t\t\t\t \t->where('order_status = ?', 2);\n\t \t \n\t \t$total = $storage->fetchCol($select);\n\t \t \n\t \t$total = intval($total['total']);\n\t \t\n\t \treturn $total;\n \t}\n \tcatch(Exception $e)\n \t{\n \t\treturn false;\n \t}\t \t\n }", "static function getRestaurantReservationRevenue($id)\n {\n //lay ra cac san pham trong mot bar reservation\n $product_items =RestaurantTotalReportDB::get_reservation_product($id);\n //System::debug($product_items);\n $total_discount = 0;\n\t\t$total_price = 0;\n $product_for_report = array();\n $product_for_report['product']['original_price'] = 0;\n $product_for_report['product']['real_price'] = 0;\n $product_for_report['is_processed']['real_price'] = 0;\n $product_for_report['is_processed']['original_price'] = 0;\n $product_for_report['service']['real_price'] = 0;\n $product_for_report['service']['original_price'] = 0;\n foreach($product_items as $key=>$value)\n\t\t{\n\t\t\tif($value['is_processed'] == 1 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['is_processed']['original_price'] += $value['original_price'];\n $product_for_report['is_processed']['real_price'] += $ttl-$discnt;\n\t\t\t}\n if($value['is_processed'] == 0 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['product']['original_price'] += $value['original_price'];\n $product_for_report['product']['real_price'] += $ttl-$discnt;\t\n\t\t\t}\n if($value['type'] == 'SERVICE')\n {\n $ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['service']['original_price'] += $value['original_price'];\n $product_for_report['service']['real_price'] += $ttl-$discnt;\t\n }\n\t\t}\n return $product_for_report;\n }", "public function getProductQuantityMap() {\n $output = array();\n $products = $this->getFieldItems('commerce_product');\n $quantity = $this->getEntity()->quantity;\n foreach ($products as $product) {\n $product_id = $product['product_id'];\n if (array_key_exists($product_id, $output)) {\n $output[$product_id] += $quantity;\n }\n else {\n $output[$product_id] = $quantity;\n }\n }\n\n return $output;\n }", "public function getSubtotalInvoiced();", "public function getOrderBaseGrandTotal(){\n return $this->_getData(self::ORDER_BASE_GRAND_TOTAL);\n }", "public function calculateTotalAmount()\n {\n\n $total = 0;\n $base_currency_total = 0;\n $items_in_bag = Session::get('items');\n\n if (!empty($items_in_bag)) {\n foreach ($items_in_bag as $item) {\n $priceAccessoiresMust = 0;\n $priceAccessoires = 0;\n if (!empty($item['orderItemAccessories'])) {\n foreach ($item['orderItemAccessories'] as $orderItemAccessorie) {\n if (Session::get('cur_currency') === 'USD') {\n if(!empty($orderItemAccessorie['must_purchase']) && $orderItemAccessorie['must_purchase'] == 1) {\n $priceAccessoiresMust = $priceAccessoiresMust + $item['quantity'] * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }else{\n $priceAccessoires = $priceAccessoires + 1 * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }\n } else {\n if(!empty($orderItemAccessorie['must_purchase']) && $orderItemAccessorie['must_purchase'] == 1) {\n $priceAccessoiresMust = $priceAccessoiresMust + $item['quantity'] * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }else{\n $priceAccessoires = $priceAccessoires + 1 * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }\n }\n }\n }\n\n if (Session::get('cur_currency') === 'USD') {\n $price = $item['quantity'] * ($item['price'] * Session::get('amount_per_unit'));\n } else {\n $price = $item['quantity'] * $item['price'];\n }\n\n $base_currency_total = $base_currency_total + ($item['price'] * $item['quantity']) + $priceAccessoiresMust + $priceAccessoires;\n $total = round($total + $price + $priceAccessoiresMust + $priceAccessoires, 2);\n\n }\n }\n\n Session::put('total', $total);\n Session::put('bc_currency_total', $base_currency_total);\n return $total;\n }", "public function getActiveCartProducts();", "function getUpdateItem($product_id){\n\tglobal $conn;\n\t$ip = getIp();\n\t$get_qty =mysqli_query($conn, \"SELECT * FROM `cart` WHERE `ip_add`='$ip' AND `p_id`='$product_id'\");\n\t$row_qty=mysqli_fetch_array($get_qty);\n\t$quantity= $row_qty[\"qty\"];\t\n\n\t$get_price =mysqli_query($conn, \"SELECT * FROM `products` WHERE `product_id`='$product_id' AND `stock`='0'\");\n\t$row_price = mysqli_fetch_array($get_price);\n\t$price= $row_price[\"product_price\"];\n\n\t//get the subtotal\n\t$sub_total=$price * $quantity;\n\n\treturn $sub_total;\n}", "public function purchases() {\n\t\t\n\t\tglobal $con;\n\t\treturn $con->query(\"\n\t\t\tSELECT * FROM purchases\n\t\t\tJOIN `products` \n\t\t\t\tON products.product_id = purchases.purchase_product \n\t\t\tWHERE purchase_user = $this->user_id\n\t\t\t\tAND purchase_is_payed = FALSE;\n\t\t\");\n\t}", "public function get_total()\n {\n }", "public function test_quantity_by_product()\n {\n $order1 = \\App\\Order::find(1);\n $product5 = \\App\\Product::find(5);\n $product7 = \\App\\Product::find(7);\n $product8 = \\App\\Product::find(8);\n $product20 = \\App\\Product::find(20);\n\n $this->assertEquals(4, $this->orders_service->getQuantityByProduct($order1, $product5));\n $this->assertEquals(2, $this->orders_service->getQuantityByProduct($order1, $product7));\n $this->assertEquals(2, $this->orders_service->getQuantityByProduct($order1, $product8));\n $this->assertEquals(1, $this->orders_service->getQuantityByProduct($order1, $product20));\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 }", "function totalPrice(){\n $ip_add=getRealIpAddr();\n global $db;\n $total = 0;\n $sel_price = \"SELECT * FROM cart where ip_add = '$ip_add'\";\n $run_price = mysqli_query($db, $sel_price);\n while ($record = mysqli_fetch_array($run_price)) {\n $pro_id = $record['p_id'];\n $pro_price = \"SELECT * FROM products where product_id = '$pro_id'\";\n $run_pro_price = mysqli_query($db, $pro_price);\n while ($p_price = mysqli_fetch_array($run_pro_price)) {\n $product_price = array($p_price['product_price']);\n $values = array_sum($product_price);\n $total += $values;\n }\n }\n echo \"$\" . $total;\n}", "function getTotalPayment($id_purchase) {\n $data = $this->db\n ->select('sum(payment_total) as total_paid')\n ->where('id_purchase',$id_purchase)\n ->order_by('payment_date','desc')\n ->get('purchase_payment')\n ->row_array();\n if ($data) {\n return $data['total_paid'];\n } else {\n return 0;\n }\n }", "public function getTotal();" ]
[ "0.6669449", "0.654195", "0.6533189", "0.6500371", "0.64325404", "0.64245236", "0.64158654", "0.64075726", "0.6381002", "0.63485855", "0.6347958", "0.634005", "0.63303983", "0.63242084", "0.632249", "0.63179594", "0.62856454", "0.6283074", "0.62247974", "0.62199867", "0.6202818", "0.6192586", "0.61388344", "0.6138341", "0.610871", "0.61070526", "0.60795385", "0.6071683", "0.6071405", "0.60623986", "0.60546064", "0.6051273", "0.60480005", "0.6042708", "0.6041766", "0.6033652", "0.6033652", "0.6033391", "0.6030357", "0.6027998", "0.6018485", "0.60127676", "0.5995718", "0.59848464", "0.59692055", "0.5968085", "0.5966557", "0.59644085", "0.5962969", "0.5961639", "0.5957711", "0.5948617", "0.5945731", "0.59312505", "0.592334", "0.59226686", "0.59193206", "0.5916245", "0.59119564", "0.5904657", "0.5898385", "0.58956337", "0.5888414", "0.5878405", "0.58730555", "0.58719724", "0.5860789", "0.58575916", "0.58574724", "0.58537954", "0.58537954", "0.5842228", "0.5823107", "0.5817999", "0.58139396", "0.58117807", "0.58079064", "0.5801634", "0.5800916", "0.5798095", "0.57940143", "0.57808095", "0.57753193", "0.57728255", "0.5766475", "0.57642096", "0.57598233", "0.57596976", "0.5756145", "0.5755313", "0.57547134", "0.575428", "0.5753771", "0.57526416", "0.57523566", "0.5751586", "0.5751088", "0.57509804", "0.57504654", "0.574695" ]
0.69654757
0
GET TOTAL SALES PRODUCT
public function get_total_sales_item($product_id) { $this->db->select('SUM(quantity) as total_sale'); $this->db->from('invoice_details'); $this->db->where('product_id',$product_id); $query = $this->db->get(); if ($query->num_rows() > 0) { return $query->result_array(); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ctrMostrarTotalProducto(){\n\n\n\n\t$tabla = 'productos';\n\n\n\n\t$respuesta = ModeloProducto::mdlMostrarTotalProducto($tabla);\n\n\n\n\treturn $respuesta;\n\n\n\n\t}", "private function total()\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t$total = 0;\n\t\t//\tSumando el precio de cada producto.\n\t\tforeach($cart as $item){\n\t\t\t$total += $item->precio * $item->cantidad;\n\t\t}\n\t\treturn $total;\n\t}", "public function getTotal()\n {\n return $this->getQty() * $this->getProduct()->getPrice();\n }", "static public function ctrShowSumSales(){\n\n\t\t\t$tabla = \"productos\";\n\n\t\t\t$respuesta = ModelProducts::mdlShowSumSales($tabla);\n\n\t\t\treturn $respuesta;\n\n\n\t\t}", "public function TotalSale() {\n\treturn $this->nTotSale;\n }", "function totalSale()\r\n {\r\n //$strSQLQuery = \"SELECT SUM(TotalPrice) as OrderTotal FROM e_orders WHERE PaymentStatus=1 AND OrderStatus='Completed'\";\r\n $strSQLQuery = \"SELECT SUM((CASE when Currency='USD' then TotalPrice \r\n \t\telse TotalPrice/CurrencyValue\r\n\tEND )) as OrderTotal FROM e_orders WHERE (PaymentStatus='1' OR OrderType in('Amazon','Ebay')) AND OrderStatus in ('Completed', 'Shipped','Unshipped') \";\r\n $arrayRow = $this->query($strSQLQuery, 1);\r\n return $arrayRow[0]['OrderTotal'];\r\n }", "public function get_total_items(){\n\t \t$total = 0;\n\t \t//Si no esta vacio va sumando la cantidad de articulos\n\t \tif(!empty($this->cart)){\n\t \t\tforeach ($this->cart as $linea){\n\t\t\t\t\t$total += $linea['amount'];\n\t\t\t\t}\n\t \t}\n\t \techo $total;\n\t }", "public function getTotalProducts()\n {\n $resource = $this->_productFactory->create()->getResource();\n \n $connection = $resource->getConnection();\n $select = $connection->select();\n $select->from(\n $resource->getTable('catalog_product_entity'),\n ['total_product' => 'count( entity_id )']\n )->where(\n 'vendor_id = :vendor_id'\n );\n $bind = ['vendor_id' => $this->getVendor()->getId()];\n \n $total = $connection->fetchOne($select, $bind);\n return $total;\n }", "public function listar_productos_resumen_carrito_precio_total() {\n \n try {\n $sql = \"\n select \n sum(i.total_venta) as precio_total,\n e.redondeo\n from \n al_producto p inner join al_inventario i\n on\n p.id_producto = i.id_producto inner join pedido e\n on\n i.id_pedido = e.id_pedido \n where\n e.id_cliente = '$_SESSION[cliente_id]' and e.estado is null; \n \";\n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n return $resultado;\n } catch (Exception $exc) {\n throw $exc;\n }\n }", "function total_sale($product_id, $field = 'qty')\n {\n $return = 0;\n $sales = $this->db->get('sale')->result_array();\n foreach ($sales as $row) {\n if ($a = $this->product_in_sale($row['sale_id'], $product_id, $field)) {\n $return += $a;\n }\n }\n return $return;\n }", "public function calcTotal()\n {\n\n $productBusinessService = new ProductBusinessService();\n\n // create an array to hold all subtotals\n $subtotals_array = array();\n $this->total_price = 0;\n\n foreach ($this->items as $item => $qty) {\n\n // get the price of the product from the database\n $product = $productBusinessService->getProductByID($item);\n\n // calculate the total (price * quantity)\n $product_subtotal = $product->getPrice() * $qty;\n\n // add that subtotal to the subtotal array\n $subtotals_array = $subtotals_array + array($item => $product_subtotal);\n\n // add the item subtotal to the cart total\n $this->total_price += $product_subtotal;\n }\n\n // set the subtotals array\n $this->subtotals = $subtotals_array;\n }", "function getPriceTotal()\n{\n\t$total = \\Cart::instance('shopping')->total();\n\n return $total;\n}", "public function total()\n {\n \treturn $this->price()*$this->quantity;\n }", "public function getTotal(){\n $cantidad = $this->cantidad;\n\t\treturn $this->productos\n\t\t\t\t\t\t->map(function($prod){return $prod->precio;})\n\t\t\t\t\t\t->reduce(function($acum, $elem)use($cantidad){\n return $acum + ($elem * $cantidad);\n });\n\t}", "public function individual_products_total() {\n\n foreach($this->remaining_category_price as $remaining_category_prices){\n $this->individual_products_total += $remaining_category_prices['price'];\n }\n\n }", "public function getProductsCostTotal()\n {\n return $this->getProducts()->sum('price');\n }", "public function subtotal()\n\t{\n\t\tif(count($this->cart) > 0)\n\t\t{\n\t\t\t$products = \\Model_Products::build();\n\t\t\tforeach($this->cart as $key => $item)\n\t\t\t{\n\t\t\t\t$products->or_where('ProductID', $key);\n\t\t\t}\n\t\t\t$products->selector('Product_Price, ProductID');\n\n\t\t\t$prices = $products->execute();\n\n\t\t\t$subtotal = 0;\n\n\t\t\tforeach($prices as $price)\n\t\t\t{\n\t\t\t\t$subtotal += (int)$price->Product_Price*$this->cart[$price->ProductID];\n\t\t\t}\n\t\t\t\n\t\t\treturn $subtotal;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function listar_productos_resumen_totales_2() {\n \n try {\n $sql = \"\n select \n \tDISTINCT e.cantidad_productos as num_producto,\n e.gravado,\n e.exonerado,\n e.inafecto,\n e.igv,\n e.redondeo,\n e.subtotal,\n e.importe_total\n FROM \n \tal_inventario a inner join pedido e \n ON \n \ta.id_pedido = e.id_pedido\n where\n e.id_cliente = '$_SESSION[cliente_id]' and e.estado is null;\n \";\n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n return $resultado;\n } catch (Exception $exc) {\n throw $exc;\n }\n }", "public function total()\n {\n // $this->line_items\n $total_price = 0;\n foreach ($this->line_items as $key => $value) {\n $total_price = $total_price + $value->product->price_amount;\n }\n // dd();\n return $total_price;\n }", "function getTotalPrice(){\n \treturn $this->myCart->total();\n }", "public function getTotal();", "public function getTotal();", "function calculerTotal () {\n\t $total = 0;\n\t \n\t foreach ($this->lignes as $lp) {\n\t $prod = $lp->prod;\n\t $prixLigne = $prod->prix * $lp->qte ;\n\t $total = $total + $prixLigne ;\n\t }\n\t \n\t return $total;\n\t }", "function get_deals_subtotal( $_deals, $quantity ) {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$price \t\t\t= $_deals->get_sale();\n\t\t\t\t\t\t\t\n $row_price \t\t= $price * $quantity;\n $return = cmdeals_price( $row_price );\n\t\t\t\n\t\t\treturn $return; \n\t\t\t\n\t\t}", "public function getTotalPrice()\n {\n // use format_currency to get correct decimals and avoid rounding errors\n return $this->getQuantity() * format_currency($this->getProductPrice(),null, true);\n// return $this->getQuantity() * format_currency($this->getNetPrice(),null, true);\n }", "public function todaysSalesTotal()\n {\n \n //get todays Date\n $fromDate = Mage::helper('magemobapp')->getTodaysDate();\n \n $storeId = Mage::getModel('magemobapp/storeinfo')->getStoreId();\n \n $collection = Mage::getResourceModel('sales/order_collection')->addAttributeToFilter('created_at', array(\n 'from' => $fromDate\n ));\n \n if ($storeId != 0) {\n $collection->addAttributeToFilter('store_id', $storeId); //fill store\n }\n //$collection;\n \n $collection->addAttributeToSelect('base_grand_total')->addAttributeToSelect('base_total_refunded')->addAttributeToSelect('base_total_paid');\n\n \n $data = $collection->getData();\n $total = 0;\n foreach ($data as $eachData) {\n if (isset($eachData['status']) && $eachData['status'] == 'complete') {\n if ($eachData['base_total_refunded'] == '') {\n $total += (float) $eachData['base_total_paid'];\n } else {\n $total += (float) $eachData['base_total_paid'] - (float) $eachData['base_total_refunded'];\n }\n } else {\n $total += (float) $eachData['base_grand_total'];\n }\n }\n return Mage::helper('core')->currency($total, true, false);\n }", "public function getTotalsOfRecords($total_sold_product)\n {\n $this->_totalSoldProduct = $this->_totalSoldProduct + $total_sold_product['master_tbl_total_sold'];\n $this->_totalApparelTax = $this->_totalApparelTax + $total_sold_product['tax_tbl_apparel_total'];\n $this->_totalMusicTax = $this->_totalMusicTax + $total_sold_product['tax_tbl_music_total'];\n $this->_totalOtherTax = $this->_totalOtherTax + $total_sold_product['tax_tbl_other_total'];\n $this->_totalOfTax = $this->_totalOfTax + $total_sold_product['tax_tbl_total_tax'];\n }", "public function total()\n {\n $total = 0;\n foreach($this->_data as &$product) {\n $total += ($product['price'] * $product['quantity']);\n }\n\n return $total;\n }", "public function get_total()\n {\n }", "function priceCart(){\n\t\t$sum = 0;\n\t\tforeach ($this->articulos as $bookid => $book) {\n\t\t\t$sum += $book['precio']*$book['cantidad'];\n\t\t}\n\t\treturn $sum;\n\t}", "function get_total() {\n\t\t\treturn cmdeals_price($this->total);\n\t\t}", "public function total_items()\n {\n $total_items = 0;\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n foreach ($items as $key)\n {\n $total_items =+ ($total_items + $key['qty']);\n }\n return $total_items;\n }\n }", "function get_cart_total() {\n\t\t\tif (!$this->prices_include_tax) :\n\t\t\t\treturn cmdeals_price($this->cart_contents_total);\n\t\t\telse :\n\t\t\t\treturn cmdeals_price($this->cart_contents_total + $this->tax_total);\n\t\t\tendif;\n\t\t}", "public function getTotal()\n {\n $cart = $this->getContent();\n\n $sum = array_reduce($cart->all(), function ($a, ItemCollection $item) {\n return $a += $item->getPrice(false);\n }, 0);\n\n return Helpers::formatValue(floatval($sum), $this->config['format_numbers'], $this->config);\n }", "public function getTotal() {\n return $this->get(self::TOTAL);\n }", "public function getTotal()\n {\n return $this->totalCalculator->getCartTotal($this->cart);\n }", "public function getCartTotal()\n {\n }", "public function get_total()\n\t{\n\t\treturn $this->EE->cartthrob->cart->total();\n\t}", "function db_sale_total_it($sale_id, $type)\n {\n $carted = json_decode($this->db->get_where('sale', array(\n 'sale_id' => $sale_id\n ))->row()->product_details, true);\n $ret = 0;\n if (count($carted) > 0) {\n foreach ($carted as $items) {\n $ret += $items[$type] * $items['qty'];\n }\n return $ret;\n } else {\n return false;\n }\n }", "public function getTotalPrice();", "public function getTotalPrice();", "public function subtotal();", "public function m_totalPurchaseProduct($data){\n\n $query = $this->db->query(\"SELECT id_compra,numeroOrden,producto,cantidad,productos.almacen FROM compra INNER JOIN productos ON compra.producto = productos.id_producto\n\nWHERE numeroOrden = '\".$data['noOrden'].\"'\");\n\n return $query->result_array();\n\n }", "public function getSubTotalProperty()\n {\n $subtotal = Money::MXN(0);\n\n foreach ($this->shoppingCart as $product) {\n $quantity = $product->pivot->quantity;\n $subtotal = $subtotal->add($product->price->multiply($quantity));\n }\n\n return $subtotal;\n }", "public function itemTotal(): float;", "public function get_total(){\n $total = 0;\n \n // récupert tous les articles de la commande\n $articles = $this->get_all_articles();\n \n // parcourt ces articles\n foreach($articles as $a){\n $price = $a->get_price(true);\n \n // puis calcul le prix\n $total += $a->nb * $price;\n }\n \n return $total;\n }", "public function getSubtotal()\n {\n $price = 0;\n\n foreach ($this->order_configurations as $config) {\n $products = EntityUtils::getRepository(\"Product\")->getProducts($config->configuration, true);\n foreach ($products as $product) {\n $price += $product->getDiscountedPrice($this->program->id) * $config->quantity;\n }\n }\n\n return number_format($price, 2, \".\", \",\");\n }", "public function getGrandTotal();", "public function initTotal()\n {\n // Return val.\n $temp = 0;\n // Add cone price.\n $temp += $this->coneType['price'];\n // Add all scoops of ice cream.\n foreach ($this->scoops as $scoop) {\n $temp += $scoop['price'];\n }\n // Return total item cost.\n return $temp;\n }", "public function total_sales()\n {\n $product = DB::table('users')\n ->join('order_lists', 'users.id', '=', 'order_lists.user_id')\n ->join('order_details', 'order_lists.id', '=', 'order_details.order_list_id')\n ->join('payment_details', 'order_details.payment_details_id', '=', 'payment_details.id')\n ->join('products', 'order_lists.item_id', '=', 'products.id')\n ->select( 'order_lists.type', 'order_lists.quentity', 'products.title', 'order_lists.total_price', 'payment_details.created_at') \n ->where('order_lists.type', '=', 'product')\n ->latest();\n \n $pet = DB::table('users')\n ->join('order_lists', 'users.id', '=', 'order_lists.user_id')\n ->join('order_details', 'order_lists.id', '=', 'order_details.order_list_id')\n ->join('payment_details', 'order_details.payment_details_id', '=', 'payment_details.id')\n ->join('pets', 'order_lists.item_id', '=', 'pets.id')\n ->select( 'order_lists.type', 'order_lists.quentity', 'pets.title','order_lists.total_price', 'payment_details.created_at') \n ->where('order_lists.type', '=', 'pet')\n ->union($product)\n ->latest()\n ->get();\n\n return $pet;\n }", "protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }", "public function getSubtotal();", "public function getTotal()\n {\n return $this->getAmount() * $this->getPrice();\n }", "public function dinero(){\n $query = $this->db->query(\"SELECT SUM(price) AS total FROM property_unity WHERE property_id=1 AND status=1\");\n return $query->row();\n }", "public function gettotal()\n {\n $query = $this->db->query(\"SELECT SUM(`price`) as total FROM `sales` WHERE DATE(`date`)=CURDATE()\");\n return $query->result();\n\n }", "public function total();", "public function total();", "public function total();", "public function getTotal() \n {\n $tax = $this->getTax(); \n return $this->_subtotal + $tax; \n }", "public function totalProducto() {\n\t\t$cantidad = $this->input->post('c');\n\t\t$precio = $this->input->post('p');\n\t\t$descuento = $this->input->post('d');\n\t\t$sub = ($precio * $cantidad);\n\t\t$des = ($sub * ($descuento/100));\n\t\t$total_facturacompra = $sub - $des;\n\t\t$data = array(\n\t\t\t'total_facturacompra' => $total_facturacompra, /*subtotal*/\n\t\t\t'des' => $des, /*descuento*/\n\t\t\t'sub' => $sub /*subtoral_sin_desc*/\n\t\t);\n\t\techo json_encode($data);\n\t}", "function total_price($cart){\n\t\t$price = 0.0;\n\t\tif(is_array($cart)){\n\t\t \tforeach($cart as $isbn => $qty){\n\t\t \t\t$medicineprice = getmedicineprice($isbn);\n\t\t \t\tif($medicineprice){\n\t\t \t\t\t$price += $medicineprice * $qty;\n\t\t \t\t}\n\t\t \t}\n\t\t}\n\t\treturn $price;\n\t}", "public function getTotal()\n {\n return $this->service()->getTotalOfOrder();\n }", "public function subtotal()\n {\n return $this->getCartSessionCollection()->map(function($item, $key) {\n return $item['price'] * $item['quantity'];\n })->reduce(function($carry, $item) {\n return $carry + $item;\n });\n }", "public function getTotalPrice() {\n return $this->getQuantity()*$this->getPrice();\n }", "public function obtenerTotalProductos($productos,$cantidad){\n\t\t$total = 0;\n\t\tfor ($i = 0; $i < count($productos); $i++) {\n\t\t\t$this->db->where('idProducto',$productos[$i]);\n\t\t\t$precio = $this->db->get('productos');\n\t\t\tif($precio -> num_rows() > 0) {\n\t\t\t\tforeach ($precio->result() as $producto){\n\t\t\t\t\t$mul = $producto->precio_publico * $cantidad[$i]; \n\t\t\t\t}\n\t\t\t\t$total = $total + $mul;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} \n\t\treturn $total;\n\t}", "public function total(){\n return $this->cart_contents['cart_total'];\n }", "public function calculateTotal() {\n $result = 0;\n\n if(isset($_SESSION['user']['basket']))\n foreach ($_SESSION['user']['basket'] as $item)\n $result += $item['product']['price']*$item['quantity'];\n\n return $result;\n }", "function total_price($cart){\n $price = 0.0;\n if(is_array($cart)){\n foreach($cart as $isbn => $qty){\n $bookprice = getbookprice($isbn);\n if($bookprice){\n $price += $bookprice * $qty;\n }\n }\n }\n return $price;\n }", "function inventory_total($inventory) {\n $inventory_total = 0;\n foreach ($inventory as $product_id => $quantity) {\n $inventory_total += $quantity;\n }\n return $inventory_total;\n}", "function sale_price() {\n\t\treturn $this->_apptivo_sale_price;\n\t}", "public function getProductsSalesTaxTotal()\n {\n $salesTaxTotal = 0.0;\n\n foreach ($this->getProducts() as $product) {\n $salesTaxTotal += (new ProductFunctions($product))->getSalesTaxCost();\n }\n\n return $salesTaxTotal;\n }", "public function getTotalAttribute() {\n return $this->products()->get(['price', 'amount'])->sum(function($product) {\n return $product->price * $product->amount;\n });\n }", "public function total()\n\t{\n\t\treturn array_get($this->cart_contents, $this->cart_name . '.cart_total', 0);\n\t}", "public function totaliza_pedido()\r\n {\r\n\r\n $valor_desconto = 0;\r\n $valor_pedido = 0;\r\n $valor_ipi = 0;\r\n $valor_total = 0;\r\n $desconto = $this->mgt_pedido_cliente_desconto->Text;\r\n $frete = $this->mgt_pedido_valor_frete->Text;\r\n\r\n if($desconto < 0)\r\n {\r\n $desconto = 0;\r\n }\r\n\r\n if($frete < 0)\r\n {\r\n $frete = 0;\r\n }\r\n\r\n $this->mgt_pedido_valor_desconto->Text = '0.00';\r\n $this->mgt_pedido_valor_pedido->Text = '0.00';\r\n $this->mgt_pedido_valor_ipi->Text = '0.00';\r\n $this->mgt_pedido_valor_total->Text = '0.00';\r\n\r\n $Comando_SQL = \"select * from mgt_cotacoes_produtos where mgt_cotacao_produto_numero_cotacao = '\" . trim($this->mgt_pedido_numero->Text) . \"' order by mgt_cotacao_produto_numero\";\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Close();\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->SQL = $Comando_SQL;\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Open();\r\n\r\n if((GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->EOF) != 1)\r\n {\r\n while((GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->EOF) != 1)\r\n {\r\n $valor_ipi = $valor_ipi + GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Fields['mgt_cotacao_produto_valor_ipi'];\r\n $valor_pedido = $valor_pedido + GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Fields['mgt_cotacao_produto_valor_total'];\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Next();\r\n }\r\n }\r\n\r\n if($desconto > 0)\r\n {\r\n $valor_desconto = (($valor_pedido * $desconto) / 100);\r\n }\r\n else\r\n {\r\n $valor_desconto = 0;\r\n }\r\n\r\n $valor_total = ((($valor_pedido + $valor_ipi) + $frete) - $valor_desconto);\r\n\r\n $this->mgt_pedido_valor_desconto->Text = number_format($valor_desconto, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_pedido->Text = number_format($valor_pedido, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_ipi->Text = number_format($valor_ipi, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_total->Text = number_format($valor_total, \"2\", \".\", \"\");\r\n }", "public function prixtotal(){\r\n\t\t\t\trequire(\"connexiondatabase.php\");\r\n\t\t/*on fait ici une somme des différent object commandé et on reourne*/\r\n\t\t$prixtotal=0;\r\n\t\t//on recupere les id des produis sélectionner pour faire la requette\r\n\t\t$ids = array_keys($_SESSION['panier']);\r\n\t\tif (empty($ids)) {//si les id sont vide, \r\n\t\t\t$produits=array(); // \r\n\t\t}else{\r\n\r\n\t\t$produits = $connexion->prepare('SELECT id, prix FROM produits WHERE id IN ('.implode(',' ,$ids).')');\r\n\t\t$produits->execute();\r\n\t\t}\r\n\r\n\t\twhile ($produit=$produits->fetch(PDO::FETCH_OBJ)){\r\n\t\t\t$prixtotal +=$produit->prix*$_SESSION['panier'][$produit->id];\r\n\t\t}\r\n\t\treturn $prixtotal;\r\n\t}", "public static function getTotalProductCount() {\n Db_Actions::DbSelect(\"SELECT COUNT(id) FROM cscart_products\");\n }", "function getTotalPrice()\n {\n $total = 0;\n foreach ($_SESSION['cart'] as $key => $value) {\n $total += $_SESSION['cart'][$key]['total'];\n }\n return $total;\n }", "public function getTotalPrice()\n {\n return @$this->attributes[\"valor_notafiscal\"];\n }", "public function getProductTotals($json) {\n\n $arr = json_decode($json );\n $isSuccess = $arr->info;\n $result = array();\n\n if ($isSuccess==\"SUCCESS\") {\n $data = $arr->data;\n foreach($data as $key => $value){\n if ($key=='PurchaseOrderProduct') {\n $purchaseOrderProduct = $value;\n foreach($purchaseOrderProduct as $purchaseOrderProductValue){\n $product = new Product($purchaseOrderProductValue);\n $productTotals = $product->getProductTotal();\n $product_type_id = $product->getProductTypeId();\n $result[$product_type_id] = isset($result[$product_type_id]) ? \n $result[$product_type_id] + $productTotal : $productTotals;\n }\n }\n }\n\n return $result;\n } \n }", "function total_items($cart){\n $items = 0;\n if(is_array($cart)){\n foreach($cart as $isbn => $qty){\n $items += $qty;\n }\n }\n return $items;\n }", "public function penjualan_product()\n\t{\n\t\t$sql = \"SELECT product_name, SUM(qty) as count FROM detail_order GROUP BY product_name\";\n\n // $queryRec = $this->db->query($sql,array($tanggal,$jam,$daerah,$daerah));\n $queryRec = $this->db->query($sql)->result_array();\n return $queryRec;\n\t}", "public function getGrandTotal()\n {\n if (!isset($this->grandTotal)) {\n $this->getProducts();\n }\n\n return $this->grandTotal;\n }", "public static function getCartTotal(){\n $totalAmount=0;\n $cart = self::getCartContent();\n foreach ($cart as $key => $value) {\n if(is_numeric($value['amount']))\n $totalAmount += $value['amount'];\n }\n return $totalAmount;\n }", "function getTotal()\n\t{\n\t\treturn $this->_total;\n\t}", "function total_items($cart){\n\t\t$items = 0;\n\t\tif(is_array($cart)){\n\t\t\tforeach($cart as $isbn => $qty){\n\t\t\t\t$items += $qty;\n\t\t\t}\n\t\t}\n\t\treturn $items;\n\t}", "function getCartTotal(){\n\t\t$totalCost = 0;\n\t\t$cartInfo = $this->getCart();\n\t\t$cartInfoSize = sizeof($cartInfo);\n\t\t$cartInfoSize--;\n\t\tfor($i=0; $i<=$cartInfoSize; $i++) {\n\t\t\t$totalCost = $totalCost + $cartInfo[$i][\"price\"];\n\t\t}\n\n\t\treturn $totalCost;\t\n\t}", "public function getTotal(){\n\t\treturn $this->_total;\n\t}", "public static function searchTotal()\n\t{\n\t\t$total = self::all()->total();\n\t\treturn $total;\n\t}", "public function getSaleData($product_id) {\n\t\t$sql = \"SELECT SUM(seller_net_amt) AS seller_total\r\n\t\t\t\tFROM \" . DB_PREFIX . \"order_product op\r\n\t\t\t\tINNER JOIN `\" . DB_PREFIX . \"ms_order_product_data` mopd\r\n\t\t\t\t\tON (op.product_id = mopd.product_id)\r\n\t\t\t\tWHERE op.product_id = \" . ( int ) $product_id . \"\r\n\t\t\t\tGROUP BY order_product_id\";\n\t\t\n\t\t$res = $this->db->query ( $sql );\n\t\treturn $res->num_rows ? $res->row : FALSE;\n\t}", "private function _calculateTotalsOut()\n {\n $prodSql = new SqlStatement();\n $prodSql->select()\n ->distinct()\n ->from(array('p' => 'product'), array('p.*'));\n \n if ($this->subCategory) \n {\n $prodSql->innerJoin(array('p2c' => 'product_to_category'), 'p.product_id = p2c.product_id')\n ->innerJoin(array('cp' => 'category_path'), 'cp.category_id = p2c.category_id')\n ->where('cp.path_id = ?', array($this->subCategory));\n }\n elseif ($this->topCategory) \n {\n $prodSql->innerJoin(array('p2c' => 'product_to_category'), 'p.product_id = p2c.product_id')\n ->where('p2c.category_id = ?', array($this->topCategory));\n }\n \n $searchConditions = $this->_prepareSearchConditions();\n if (count($searchConditions)) {\n $prodSql->innerJoin(array('pd' => 'product_description'), 'pd.product_id = p.product_id')\n ->multipleWhere($searchConditions, 'OR');\n }\n \n if ($this->conditions->price) {\n $prodSql->leftJoin(array('pd2' => 'product_discount'), 'pd2.product_id = p.product_id', array('discount' => 'MIN(pd2.price)'))\n ->leftJoin(array('ps' => 'product_special'), 'ps.product_id = p.product_id', array('special' => 'MIN(ps.price)'))\n ->where(\"(pd2.product_id IS NULL OR (\n pd2.quantity = '1'\n AND (pd2.date_start = '0000-00-00' OR pd2.date_start < NOW())\n AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())\n AND pd2.customer_group_id = '{$this->customerGroupId}') )\")\n ->where(\"(ps.product_id IS NULL OR (\n (ps.date_end = '0000-00-00' OR ps.date_end > NOW())\n AND (ps.date_start = '0000-00-00' OR ps.date_start < NOW())\n AND ps.customer_group_id = '{$this->customerGroupId}' ) )\")\n ->group(array('p.product_id'));\n \n if ($this->config->get('config_tax')) {\n $prodSql->select(array('fixed_tax', 'percent_tax'))\n ->leftJoin(array('tr1' => $this->subquery->fixedTax), 'tr1.tax_class_id = p.tax_class_id')\n ->leftJoin(array('tr2' => $this->subquery->percentTax), 'tr2.tax_class_id = p.tax_class_id');\n } else {\n $prodSql->select(array('fixed_tax' => '0', 'percent_tax' => '0'));\n }\n if ($this->conditions->price->min) {\n $prodSql->having(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $prodSql->having(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n \n if ($this->conditions->rating) {\n $prodSql->innerJoin(array('r1' => 'review'), 'r1.product_id = p.product_id', array('total' => 'AVG(rating)'))\n ->where(\"r1.status = '1'\")\n ->having('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')')\n ->group(array('p.product_id'));\n } \n\n if ($this->conditions->price || $this->conditions->rating) {\n $exclude = new SqlStatement();\n $exclude->select()->from(array('p' => self::RESULTS_TABLE));\n if ($this->conditions->price) {\n if ($this->conditions->price->min) {\n $exclude->where(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $exclude->where(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n\n if ($this->conditions->rating) {\n $exclude->where('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')');\n }\n } else {\n $exclude = self::RESULTS_TABLE;\n }\n \n \n $inStock = (int)self::$IN_STOCK_STATUS;\n \n $sql = new SqlStatement();\n $sql->select(array(\n 'id' => \"af.group_id\", \n 'val' => \"IF (af.type = 'STOCK_STATUS' AND p.quantity > 0, {$inStock}, af.value)\", \n 'type' => 'af.type',\n ))\n ->from(array('af' => self::FILTERS_TABLE))\n ->innerJoin(array('p' => $prodSql), 'af.product_id = p.product_id')\n ->innerJoin(array('p2s' => 'product_to_store'), 'p.product_id = p2s.product_id')\n ->leftJoin(array('exclude' => $exclude), 'af.product_id = exclude.product_id')\n ->where('exclude.product_id IS NULL')\n ->where('p2s.store_id = ?', (int)$this->config->get('config_store_id'))\n ->where(\"p.status = '1'\")\n ->where('p.date_available <= NOW()')\n ->group(array('af.product_id', 'af.type', 'af.group_id', 'af.value'));\n \n if (count($this->aggregate)) {\n $con = array();\n foreach ($this->aggregate as $type => $group) {\n foreach ($group as $groupId => $values) {\n $a = strtolower(substr($type, 0, 1)) . $groupId;\n $sql->innerJoin(array($a => self::FILTERS_TABLE), 'p.product_id = ' . $a . '.product_id')\n ->where($a . '.type = ?', array($type))\n ->where($a . '.group_id = ?', array($groupId));\n // the following mess in conditions is caused by a need \n // of handling the correct stock status \"In stock\".\n if ($type !== 'STOCK_STATUS') {\n $where = \"$a.value IN (\" . implode(', ', $values) . \")\";\n } else {\n $where = array();\n foreach ($values as $val) {\n $where[] = \"($a.value = {$val}\" . ($val != $inStock ? ' AND p.quantity = 0' : ' OR p.quantity > 0') . \")\";\n }\n $where = \"(\" . implode(' OR ', $where) . \")\";\n }\n $sql->where(\"({$where} OR af.aggregate_filter_id = $a.aggregate_filter_id)\");\n }\n $con[] = \"(af.type = '$type' AND af.group_id IN (\" . implode(',', array_keys($group)) . \"))\";\n }\n $sql->multipleWhere($con);\n }\n \n \n if ( self::$HIDE_OUT_OF_STOCK ) {\n $sql->leftJoin(array('pov' => 'product_option_value'), 'af.product_id = pov.product_id AND af.value = pov.option_value_id AND af.type = \"OPTION\"')\n ->leftJoin(array('pov1' => 'product_option_value'), 'p.product_id = pov1.product_id');\n $vals = array();\n if (isset($this->aggregate['OPTION'])) {\n foreach ($this->aggregate['OPTION'] as $values) {\n $vals = array_merge($vals, $values);\n }\n }\n $or = array(\n '(pov1.quantity IS NULL AND p.quantity > 0)',\n 'pov.quantity > 0'\n );\n if (count($vals)) {\n $or[] = '(pov1.quantity > 0 AND pov1.option_value_id IN (' . implode(',', $vals) . '))';\n } else {\n $or[] = '(pov1.quantity > 0 AND af.type != \"OPTION\")';\n }\n $sql->where('(' . implode(' OR ', $or) . ')');\n }\n \n $groupSql = new SqlStatement();\n $groupSql->select(array('id', 'val', 'c' => 'COUNT(*)', 'type'))\n ->from(array('tt' => $sql))\n ->group(array('type', 'id', 'val'));\n \n $res = $this->db->query($groupSql);\n\n return $res->rows;\n }", "public function get_total_cost()\n\t{\n\t\t$num = '0.00';\n\t\tif (isset($_SESSION['cart']))\n\t\t{\n\t\t\t#if there are items to display \n\t\t\t\n\t\t\t#get product ids\n\t\t\t$ids = $this->get_ids();\n\t\t\t\n\t\t\t#get product prices\n\t\t\tglobal $Products;\n\t\t\t$prices = $Products->get_prices($ids);\n\t\t\t\n\t\t\t#loop throih adding the cost of each item and timesing it by the number of item in the cart. \n\t\t\tif($prices != NULL)\n\t\t\t{\n\t\t\t\tforeach($prices as $price)\n\t\t\t\t{\n\t\t\t\t\t$num += doubleval($price['price'] * $_SESSION['cart'][$price['id']]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $num;\n\t}", "public static function getTotalValueOfOrderDashboard()\n {\n \ttry\n \t{\n\t \t$storage = My_Zend_Globals::getStorage();\n\t \n\t \t$table = self::_TABLE_PRODUCT_ORDER_DETAIL;\n\t \n\t \t//Query data from database\n\t \t$select = $storage->select()\n\t\t\t\t\t \t->from($table,'sum(amount_total)')\n\t\t\t\t\t \t->where('order_status = ?', 0);\n\t \t \n\t \t$total = $storage->fetchCol($select);\n\t \t \n\t \t$total = intval($total['total']);\n\t \t\n\t \treturn $total;\n \t}\n \tcatch(Exception $e)\n \t{\n \t\treturn false;\n \t}\t \t\n }", "public static function getTotalValueOfOrder()\n {\n \ttry\n \t{\n\t \t$storage = My_Zend_Globals::getStorage();\n\t \n\t \t$table = self::_TABLE_PRODUCT_ORDER_DETAIL;\n\t \n\t \t//Query data from database\n\t \t$select = $storage->select()\n\t\t\t\t\t \t->from($table,'sum(amount_total)')\n\t\t\t\t\t \t->where('order_status = ?', 2);\n\t \t \n\t \t$total = $storage->fetchCol($select);\n\t \t \n\t \t$total = intval($total['total']);\n\t \t\n\t \treturn $total;\n \t}\n \tcatch(Exception $e)\n \t{\n \t\treturn false;\n \t}\t \t\n }", "public function getTotal(){\n $total=0;\n\n foreach ( $this->getOrderLines() as $ol){\n $total += $ol->getSubTotal();\n }\n \n return $total;\n }", "public function GetSaldoTotalProveedores()\n {\n \t\n \n \t// No mostrar Insumos a contabilizar, exite otro procedimiento para tratarlas\n \t// Insumos a contabilizar\n \t$CONST_InsumosAContabilizarId = 5;\n \t\n \t$q\t=\tDoctrine_Query::create()\n \t->from('Proveedor c')\n \t->innerJoin('c.FacturasCompra f')\n \t->andWhere('f.TipoGastoId <> ?', $CONST_InsumosAContabilizarId)\n \t->groupBy('c.Id');\n //echo $q->getSqlQuery();\n \t$cli\t=\t$q->execute();\n \t$total=0;\n \tforeach ($cli as $c)\n \t{\n \t\t\t$saldoActual\t=\t$c->GetSaldo();\n \t\t\t$c->SaldoActual\t=\t$saldoActual;\n \t\t\t$c->save();\n\t\t\t\t\t// sumar saldo total de cada cliente\n \t\t\t$total\t+= $saldoActual;\n \t}\n \n \treturn $total;\n }", "public function getBaseGrandTotal();", "protected function getProductTotalQuantity(): float\n\t{\n\t\treturn (float)($this->getProductRow()['QUANTITY'] ?? 0.0);\n\t}", "public function get_total_purchase_item($product_id)\n\t{\n\t\t$this->db->select('SUM(quantity) as total_purchase');\n\t\t$this->db->from('product_purchase_details');\n\t\t$this->db->where('product_id',$product_id);\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\treturn false;\n\t}", "public function amount()\n {\n return $this->products()->select('price')->get()->sum(function ($product) {\n return $product->price;\n });\n }", "function sizeCart(){\n\t\t//return array_sum($this->articulos);\n\t\t$sum = 0;\n\t\tforeach ($this->articulos as $bookid => $book) {\n\t\t\t$cantidad = $book['cantidad'];\n\t\t\t$sum += $cantidad;\n\t\t}\n\t\t\n\t\treturn $sum;\n\t}" ]
[ "0.7015559", "0.69444984", "0.69252384", "0.69064814", "0.6878917", "0.678077", "0.67783475", "0.6761116", "0.6756227", "0.6721177", "0.6697802", "0.66496426", "0.6631772", "0.6604196", "0.6598614", "0.6558374", "0.6550037", "0.65467703", "0.6525937", "0.64947677", "0.64840776", "0.64840776", "0.64795685", "0.64769125", "0.6472819", "0.64579475", "0.6402868", "0.63881975", "0.63855016", "0.637739", "0.63621575", "0.6358479", "0.6348551", "0.6348153", "0.6342821", "0.63343066", "0.6331068", "0.63242173", "0.63179904", "0.63089955", "0.63089955", "0.63035834", "0.62878484", "0.6277214", "0.6269008", "0.62681776", "0.6267286", "0.62293154", "0.6214892", "0.6212503", "0.6212095", "0.6201747", "0.6199242", "0.6194017", "0.6186802", "0.61660844", "0.61660844", "0.61660844", "0.6163943", "0.6156316", "0.6148893", "0.6142284", "0.61416346", "0.6141491", "0.613757", "0.61360776", "0.6099141", "0.6097214", "0.60937566", "0.60819983", "0.6070178", "0.60618526", "0.6054525", "0.6053886", "0.60528815", "0.6050514", "0.60465467", "0.6046185", "0.6044358", "0.6040997", "0.60359806", "0.60329634", "0.6032073", "0.60262305", "0.6024474", "0.6010304", "0.6003433", "0.598731", "0.59805226", "0.59800345", "0.5973471", "0.5972851", "0.5969919", "0.5961418", "0.5954349", "0.5953533", "0.5951034", "0.59480864", "0.59473485", "0.5947224" ]
0.6968383
1
This function is used to Generate Key
public function generator($lenth) { $number=array("1","2","3","4","5","6","7","8","9"); for($i=0; $i<$lenth; $i++) { $rand_value=rand(0,8); $rand_number=$number["$rand_value"]; if(empty($con)) { $con=$rand_number; } else { $con="$con"."$rand_number";} } return $con; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function generateKey();", "public static function generateKey(){\n $key = '';\n // [0-9a-z]\n for ($i=0;$i<32;$i++){\n $key .= chr(rand(48, 90));\n }\n self::$_key = $key;\n }", "public static function generateKey()\n\t{\n\t\tToxusEncryption::$_key = Defuse\\Crypto\\Crypto::createNewRandomKey();\n\t\treturn ToxusEncryption::$_key;\n\t}", "function generate_key()\n\t{\n\t\treturn $this->key_prefix . md5( $this->key_prefix . microtime() . uniqid() . 'teamps' );\n\t}", "public function createKey()\n {\n return md5('Our-Calculator') . (time() + 60);\n }", "public function generateKey()\n\t{\n\t\treturn substr(md5(uniqid(mt_rand(), true)), 0, 3) . substr(md5(uniqid(mt_rand(), true)), 0, 2);\n\t}", "function GenerateKey() {\n // deterministic; see base.js.\n return rand();\n}", "function generateKey()\n\t{\n\t\treturn ( rand(1, 25) );\n\t}", "private function _generateActivationKey()\n {\n $key = Utils::getRandomKey(32);\n return $key;\n }", "private function _generate_key(){\n $salt = base_convert(bin2hex($this->CI->security->get_random_bytes(64)), 16, 36);\n \n // If an error occurred, then fall back to the previous method\n if ($salt === FALSE){\n $salt = hash('sha256', time() . mt_rand());\n }\n \n $new_key = substr($salt, 0, config_item('rest_key_length'));\n while ($this->_key_exists($new_key));\n\n return $new_key;\n }", "abstract public function createSecretKey();", "protected function generateEncryptionKeyIfNeeded() {}", "public function generateAuthKey() {\n $this->llaveAutenticacion = Yii::$app->security->generateRandomString();\n }", "private function generateKey(): string\n\t{\n\t\t// `+` and `/` are replaced by `-` and `_`, resp.\n\t\t// The other characters (a-z, A-Z, 0-9) are legal within an URL.\n\t\t// As the number of bytes is divisible by 3, no trailing `=` occurs.\n\t\treturn strtr(base64_encode(random_bytes(3 * self::RANDOM_ID_LENGTH / 4)), '+/', '-_');\n\t}", "public function generateAuthKey() {\n\t\t$this->txt_auth_key = Yii::$app->security->generateRandomString ();\n\t}", "function generate_token()\n {\n $this->load->helper('security');\n $res = do_hash(time().mt_rand());\n $new_key = substr($res,0,config_item('rest_key_length'));\n return $new_key;\n }", "protected function _generateKey()\n {\n $key = '';\n ksort($this->_keyData); //so that the order of the array doesn't matter in the key that is generated.\n foreach ($this->_keyData as $i => $val) {\n //\"clean\" the data some\n if (is_numeric($val)) {\n $val = (float)$val;\n //force it to be 4 decimal places every single time, and use thousands\n //seperator, just because we can and we need all numbers to be uniform\n //so they look the same even after getting sent to the database and coming back again.\n $val = number_format($val, 4, '.', ',');\n } else {\n $val = trim($val);\n }\n //NOTE: May need to do further \"cleaning\" to ensure value always stays\n //the same even after getting sent to and from the DB... if so do that\n //cleaning here, NOT outside of this class... we need 1 solution in 1\n //place, not 20 different solutions...\n\n $key = \"$i:_:{$key}:_:$val\";\n }\n //If debug enabled, show what the key is before hash, so we can troubleshoot\n //problems caused by the key changing when trying to decrypt.\n if (self::DEBUG) {\n trigger_error('DEBUG CRYPT: Key used before hash=' . $key);\n }\n $this->_keyString = sha1($key);\n }", "public function generateAuthKey() {\n $this->auth_key = Yii::$app->security->generateRandomString(32);\n }", "private function generateRandomKey()\n {\n return substr(base_convert(sha1(uniqid(mt_rand(), true)), 16, 36), 0, 8);\n }", "public static function createKey() {\r\n $MIN = 100000;\r\n $MAX = 922337203685477580;\r\n return mt_rand($MIN,$MAX);\r\n }", "private function _generate_enckey()\n {\n // encrypt user id and email so that nobody gets the user information\n $this->_user->enc_key = $this->encryption->encrypt($this->_user->id . '-' . $this->_user->email_address);\n\n // use codeigniters string helper to generate random key\n $string = random_string('alnum', 16);\n\n // encrypt it again just for nothing and then return the key.\n return $this->encryption->encrypt($string);\n }", "public static function generateNewAuthKey()\r\n {\r\n return Yii::$app->security->generateRandomString();\r\n }", "public function generateKey()\n {\n do\n {\n $salt = sha1(time() . mt_rand());\n $newKey = substr($salt, 0, 40);\n } // Already in the DB? Fail. Try again\n while ($this->keyExists($newKey));\n\n return $newKey;\n }", "private function genRandomKey()\n {\n return strtoupper(str_random(32));\n }", "public function randomKey();", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->getSecurity()->generateRandomString();\n }", "public function generateAuthKey()\n\t{\n\t\t$this->auth_key = Yii::$app->security->generateRandomString();\n\t}", "public function generateAuthKey()\n\t{\n\t\t$this->auth_key = Yii::$app->security->generateRandomString();\n\t}", "function generate_key()\n{\n $pool = \"qwertzupasdfghkyxcvbnm\";\n $pool .= \"23456789\";\n $pool .= \"WERTZUPLKJHGFDSAYXCVBNM\";\n srand ((double)microtime()*1000000);\n for($index = 0; $index < 10; $index++)\n {\n $akti .= substr($pool,(rand()%(strlen ($pool))), 1);\n }\n return $akti;\n}", "public function generateAuthKey()\n {\n // default length=32\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\r\n {\r\n $this->auth_key = Yii::$app->getSecurity()->generateRandomString();\r\n }", "public function generateAuthKey(){\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->salt = OldDi::GetString(8);\n }", "protected function createSecretKey()\n\t{\n\t\treturn random_string('unique');\n\t}", "public function generateAuthKey()\n {\n $this->token = Yii::$app->security->generateRandomString(32);\n }", "function generate_key(): string\n{\n $keyset = \"0123456789ABCDEF\";\n do {\n $key = \"\";\n for ($i = 0; $i < 16; $i++) {\n $key .= substr($keyset, rand(0, strlen($keyset)-1), 1);\n }\n } while (substr($key, 0, 1) == \"0\");\n return $key;\n}", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\r\n {\r\n $this->auth_key = Yii::$app->security->generateRandomString();\r\n }", "public function generateAuthKey()\r\n {\r\n $this->auth_key = Yii::$app->security->generateRandomString();\r\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey() {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey() {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey() {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey() {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n return Yii::$app->security->generateRandomString();\n }", "private function generateApiKey(){\n\n return md5(uniqid(rand(), true));\n\n }", "public static function generateKey()\n {\n do {\n $salt = sha1(time() . mt_rand());\n $newKey = substr($salt, 0, 40);\n } // Already in the DB? Fail. Try again\n while (self::keyExists($newKey));\n\n return $newKey;\n }", "function key_gen($str=''){\n\treturn str_replace('=','',base64_encode(md5($str)));\n}", "protected function getRandomKey()\n {\n return Str::random(32);\n }", "public function generateAuthKey()\n {\n $this->auth_key = (new Security)->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = UsniAdaptor::app()->security->generateRandomString();\n }", "public static function generateKey () {\n $session = bin2hex(random_bytes(16));\n if (static::count([ 'key' => $session ]) == 1) {\n return static::generateSession();\n }\n return $session;\n }", "public function generateAuthKey()\n {\n $this->authKey = Yii::$app->getSecurity()->generateRandomKey();\n }", "public function generateAuthKey()\n {\n $this->authKey = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->authKey = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->authKey = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->AuthKey = Yii::$app->security->generateRandomString();\n }", "private function generateApiKey()\n {\n return md5(uniqid(rand(), true));\n }", "private function generateApiKey()\n {\n return md5(uniqid(rand(), true));\n }", "public function generateAuthKey() {\n $this->employer_auth_key = Yii::$app->security->generateRandomString();\n }", "public static function generateKey()\n {\n return openssl_digest(php_uname() . \"-\" . $_SERVER[\"REMOTE_ADDR\"], 'MD5', true);\n }", "public function generateAuthKey()\n {\n $this->auth_key = Security::generateRandomKey();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Security::generateRandomKey();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Security::generateRandomKey();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Security::generateRandomKey();\n }", "public function generateAuthKey(): void\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $security = new Security();\n $this->auth_key = $security->generateRandomKey();\n }", "public function generateAuthKey() {\n $this->auth_key = Security::generateRandomKey();\n }", "public function GenerateKey()\n // Generates a 22 character salt.\n {\n $this->_SALT = \"$\";\n for($i = 0; $i < 22; $i ++)\n $this->_SALT = $this->_SALT . $this->_CHARSET[mt_rand(0, 63)];\n return $this->_SALT;\n }", "private function generateApiKey() {\n return md5(uniqid(rand(), true));\n }" ]
[ "0.9017884", "0.8389013", "0.8196144", "0.8190681", "0.81611687", "0.8160369", "0.81117964", "0.8029669", "0.80217284", "0.79481924", "0.790202", "0.7835827", "0.7789329", "0.77827156", "0.77658886", "0.776351", "0.7762743", "0.77533644", "0.7742257", "0.77214", "0.7713544", "0.7708521", "0.770346", "0.77019984", "0.76802737", "0.7678295", "0.7677894", "0.7677894", "0.7677086", "0.76755553", "0.7675125", "0.7669251", "0.7666632", "0.76610386", "0.76601565", "0.76549613", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.7652593", "0.76485026", "0.76485026", "0.7648176", "0.76437026", "0.76437026", "0.76437026", "0.76437026", "0.76315296", "0.7629454", "0.76275134", "0.76162666", "0.7604553", "0.75907105", "0.75716275", "0.75706106", "0.7552929", "0.75505996", "0.7547312", "0.7547312", "0.7547312", "0.7536862", "0.7533315", "0.7533315", "0.752892", "0.7517156", "0.75000715", "0.75000715", "0.75000715", "0.75000715", "0.7491304", "0.74871504", "0.74791604", "0.7473854", "0.7469023" ]
0.0
-1
get Product List for pos invoice page
public function product_list() { $query=$this->db->select(' a.product_id,a.product_name,a.price,a.image_thumb,a.variants,a.product_model, c.category_name,c.category_id ') ->from('product_information a') ->join('product_category c','c.category_id = a.category_id','left') ->group_by('a.product_id') ->order_by('a.product_name','asc') ->get(); if ($query->num_rows() > 0) { return $query->result(); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _generateProductsData(){\n \n $products = $this->context->cart->getProducts();\n $pagseguro_items = array();\n \n $cont = 1;\n \n foreach ($products as $product) {\n \n $pagSeguro_item = new PagSeguroItem();\n $pagSeguro_item->setId($cont++);\n $pagSeguro_item->setDescription(Tools::truncate($product['name'], 255));\n $pagSeguro_item->setQuantity($product['quantity']);\n $pagSeguro_item->setAmount($product['price_wt']);\n $pagSeguro_item->setWeight($product['weight'] * 1000); // defines weight in gramas\n \n if ($product['additional_shipping_cost'] > 0)\n $pagSeguro_item->setShippingCost($product['additional_shipping_cost']);\n \n array_push($pagseguro_items, $pagSeguro_item);\n }\n \n return $pagseguro_items;\n }", "public function getProductInfosList(){\n return $this->_get(1);\n }", "public function listProductPage(){\n\t\t\t$sql = \"SELECT * FROM products\";\n\t\t\t$listProductPage = mysqli_query($this->connect(),$sql);\n\t\t\treturn $listProductPage;\n\t\t}", "public function index()\n {\n return $this->productService->getProducts();\n }", "function listProductView() {\n\n\n\n\t$query = \"SELECT * FROM invoice_item\";\n\t$result = mysql_query($query);\n\t$rows = array();\n\twhile($row = mysql_fetch_assoc($result)) {\n\t\t$rows[] = array(\n\t\t\t'invoice_id' => htmlspecialchars($row['invoice_id']), \n\t\t\t'invoice_item_id' => htmlspecialchars($row['invoice_item_id']),\n\t\t\t'service_type' => htmlspecialchars($row['service_type']),\n\t\t\t'service_range' => htmlspecialchars($row['service_range']),\n\t\t\t'price' => htmlspecialchars($row['price']),\n\t\t\t'value' => htmlspecialchars($row['value']),\n\t\t\t'vat' => htmlspecialchars($row['vat']),\n // 'product_pdv_percent' => htmlspecialchars($row['product_pdv_percent']),\n\t\t\t'vat_value' => htmlspecialchars($row['vat_value']),\n\t\t\t'rebate' => htmlspecialchars($row['rebate']),\n\t\t\t'total_value' => htmlspecialchars($row['total_value']),\n\n\n\t\t\t);\n\t}\n\n\n\t\t//akcije i forma\n\t$customer_id = $_GET['customer_id'];\n\t$invoice_id = $_GET['invoice_id'];\n\t$action = \"invoice_item.php?view=list&action=add&customer_id=$customer_id&invoice_id=$invoice_id\";\n\tinclude(\"invoice_item_form.php\");\n\n}", "public function getProductList(){\n\n $productModel = new ProductModel();\n $products = $productModel->getProductList();\n $this->JsonCall($products);\n }", "public function products()\n {\n //$products = $api->getAllProducts();\n //var_dump($products);\n // TODO save products to database\n }", "function getFeatureProducts(){\n \n $itemonpage = !empty($_GET['per_page'])?$_GET['per_page']:3;\n $page = !empty($_GET['page'])?$_GET['page']:1;\n $offset= ($page-1)*$itemonpage;\n\n $numberPage = ceil(30/$itemonpage);\n \n $sql = self::$connection->prepare(\"SELECT * FROM products limit \".$itemonpage.\" offset \".$offset);\n \n $sql->execute();//return an object\n $items = array();\n $items = $sql->get_result()->fetch_all(MYSQLI_ASSOC);\n include \"link.php\";\n return $items; //return an array\n }", "public function index()\n {\n $products = ['Produto 1', 'Produto 2', 'Produto 3'];\n \n return $products;\n }", "public function all_products()\n\t{\n\t\t$data['product_list']=$this->tbl_product->get_all_product();\n\t\t$data['page']='All Products';\n\t\t$view = 'Admin/collection/admin_all_product_list';\n\t\techo Modules::run('Template/admin_template', $view, $data);\t\n\t}", "function products(){\n\t\tif(isset($_POST['Controller']) && $_POST['Controller'] == \"AddToCart\" && isset($_POST['qty']) && isset($_POST['id']) && isset($_POST['price']) ){\n\t\t\t$this->addToCart();\n\t\t\treturn;\n\t\t}\n\t\t$myBuff = ''; // Buffer holding HTML from our templates \n\t\t$PString = ''; // Empty string to hold our pagination\n\t\ttry {\n\t\t\tif(isset($_GET['id'])){\n\t\t\t\tif($contBuff=$this->LoadTemplate($this->rp.$this->TEMPPath.$this->TEMP['pLarge'])){\n\t\t\t\t\t$programs = new SoapClient($this->HTTP.$this->URLS['programs']); // Initiate our SOAP client\n\t\t\t\t\t\n\t\t\t\t\t$wrapper = new stdClass;\n\t\t\t\t\t$wrapper->id = new SoapVar( $_GET['id'] , XSD_STRING, \"string\"); // Set our Start date\n\t\t\t\t\t\n\t\t\t\t\t$res = $programs->Get($wrapper); // Retrieve active programs from our SOAP client\n\t\t\t\t\t//var_dump($rows);\n\t\t\t\t\t$info=&$res->GetResult;\n\t\t\t\t\t\n\t\t\t\t\t$SDate=date(\"M j, Y\",strtotime($info->NITA_StartDate)); // format our program start date\n\t\t\t\t\t$EDate=date(\"M j, Y\",strtotime($info->NITA_EndDate)); // format our program end date\n\t\t\t\t\t$Facility=array();\n\t\t\t\t\tif(!is_null($info->NITA_FacilityName)) $Facility[]=$info->NITA_FacilityName;\n\t\t\t\t\tif(!is_null($info->NITA_FacilityAddr1)) $Facility[]=$info->NITA_FacilityAddr1;\n\t\t\t\t\tif(!is_null($info->NITA_FacilityAddr2)) $Facility[]=$info->NITA_FacilityAddr2;\n\t\t\t\t\tif(!is_null($info->NITA_FacilityAddr3)) $Facility[]=$info->NITA_FacilityAddr3;\n\t\t\t\t\tif(!is_null($info->NITA_FacilityAddr4)) $Facility[]=$info->NITA_FacilityAddr4;\n\t\t\t\t\tif(!is_null($info->NITA_FacilityCity) && !is_null($info->NITA_FacilityState) && !is_null($info->NITA_FacilityZip) )\n\t\t\t\t\t\t\t$Facility[]= (!is_null($info->NITA_FacilityCity)?$info->NITA_FacilityCity.', ':'').\n\t\t\t\t\t\t\t\t\t\t\t\t\t (!is_null($info->NITA_FacilityState)?$info->NITA_FacilityState.' ':'').\n\t\t\t\t\t\t\t\t\t\t\t\t\t (!is_null($info->NITA_FacilityZip)?$info->NITA_FacilityZip:'');\n\t\t\t\t\t\n\t\t\t\t\t$CLE=array();\n\t\t\t\t\tif(!is_null($info->Nita_50MinuteCredits)) $CLE[]=\"50 Minute Credits: \".$info->Nita_50MinuteCredits;\n\t\t\t\t\tif(!is_null($info->Nita_60MinuteCredits)) $CLE[]=\"60 Minute Credits: \".$info->Nita_60MinuteCredits;\n\t\t\t\t\tif(count($CLE)==0) $CLE[]=\"No CLE Credits\";\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$this->HTML.=$this->processCodes($contBuff,array('ID'\t\t\t\t=> $this->ckNULL($info->NITA_ProgramId),\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 'Name'\t\t\t=> $this->ckNULL($info->NITA_Title),\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 'Desc'\t\t\t=> $this->ckNULL($info->NITA_Description),\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 'SKU'\t\t\t=> $info->NITA_name,\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 'SDate'\t\t=> $SDate,\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 'EDate'\t\t=> $EDate,\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 'Avail'\t\t=> 'Open to Registration',\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 'Fac'\t\t\t=> '<p>'.implode(\"<br />\",$Facility).'</p>',\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 'CLE'\t\t\t=> '<p>'.implode(\"<br />\",$CLE).'</p>',\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 'Price'\t\t=> '$'.number_format($this->ckNULL($info->NITA_TuitionPriceStandard),2,'.',','),\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 'PriceInt'\t=> $this->ckNULL($info->NITA_TuitionPriceStandard),\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 'Attr'\t\t\t=> '',\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 'AddCart'\t=> $_SERVER['PHP_SELF'],\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 'URL'\t\t\t=> $this->Files['prodDet'].'?id='.$info->NITA_ProgramId,\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 ));\n\t\t\t\t} else throw new FatalError('Cannot open template '.$this->TEMP['pLarge']);\n\t\t\t} else { // If we have not selected a program to look at provide a list of programs.\n\t\t\t\t$programs = new SoapClient($this->HTTP.$this->URLS['programs']); // Initiate our SOAP client\n\t\t\t\t// var_dump($programs->__getFunctions() ); // Dumps the active function from our client\n\t\t\t\t$wrapper = new stdClass;\n\t\t\t\t$wrapper->startDate = new SoapVar( date(\"c\") , XSD_DATETIME, \"dateTime\"); // Set our Start date\n\t\t\t\t$wrapper->endDate = new SoapVar( date(\"c\",mktime(0,0,0,date(\"m\"),date(\"d\"),date(\"Y\")+5 ) ), XSD_DATETIME, \"dateTime\"); // Drop an end date a year out\n\t\n\t\t\t\t$rows = $programs->GetActivePrograms($wrapper); // Retrieve active programs from our SOAP client\n\t\t\t\tif(isset($_GET['s'])) $this->SKey=explode(',',$_GET['s']);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif($contBuff=$this->LoadTemplate($this->rp.$this->TEMPPath.$this->TEMP['pListCont'])){ // Get our product list template from the server\n\t\t\t\t\t$contBuff=$this->processCodes($contBuff, array(\t'SortTitle'\t\t=>$_SERVER['PHP_SELF'].'?s=Name,'.(($this->SKey[0]=='Name' && $this->SKey[1]=='ASC')?'DESC':'ASC'),\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'SortDate'\t\t=>$_SERVER['PHP_SELF'].'?s=Date,'.(($this->SKey[0]=='Date' && $this->SKey[1]=='ASC')?'DESC':'ASC'),\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'SortLoc'\t\t\t=>$_SERVER['PHP_SELF'].'?s=Location,'.(($this->SKey[0]=='Location' && $this->SKey[1]=='ASC')?'DESC':'ASC'),\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'SortPrice'\t\t=>$_SERVER['PHP_SELF'].'?s=Price,'.(($this->SKey[0]=='Price' && $this->SKey[1]=='ASC')?'DESC':'ASC')\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)); // Drop our sorting links into the product list\n\t\t\t\t\t//var_dump($rows);\n\t\t\t\t\t$programs=&$rows->GetActiveProgramsResult->ProgramModel;// Set our list of programs to an array for easier use\t\t\t\t\n\t\t\t\t\t$Sorting=array();// Our Sorting header\n\t\t\t\t\tif( is_array($this->SArray[$this->SKey[0]]) ) foreach($this->SArray[$this->SKey[0]] as $Sort) $Sorting[$Sort]=$this->SKey[1];\n\t\t\t\t\telse $Sorting[$this->SArray[$this->SKey[0]]]=$this->SKey[1];\n\t\t\t\t\t\n\t\t\t\t\t$this->ObjectSorter($programs, $Sorting); // Sort our array of objects based on an object property\n\t\t\t\t\t\n\t\t\t\t\tif($itemBuff=$this->LoadTemplate($this->rp.$this->TEMPPath.$this->TEMP['pList'])){// Get Item templace from the server\n\t\t\t\t\t\tif(intval($this->Limit)>0){ \n\t\t\t\t\t\t\tif(isset($_GET['p'])) $this->Page=intval($_GET['p']);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->TotalRows = count($programs); // Total number of products in the database\n\t\t\t\t\t\t\t$this->TotalPages = ceil($this->TotalRows/$this->Limit)-1;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$PString=$this->Pagination(); // Get our pagination string from our class function\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$programs = array_slice($programs, ($this->Page*$this->Limit), $this->Limit); // Get the programs on our selected page\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach ($programs as $row){ // For each program set the appropriate data to our hooks\n\t\t\t\t\t\t\t$SDate=date(\"M j, Y\",strtotime($row->NITA_StartDate)); // format our program start date\n\t\t\t\t\t\t\t$EDate=date(\"M j, Y\",strtotime($row->NITA_EndDate)); // format our program end date\n\t\t\t\t\t\t\t$myBuff.=$this->processCodes($itemBuff,array('ID'=>\t\t\t\t$this->ckNULL($row->NITA_ProgramId\t\t\t),\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 'Name'=>\t\t\t$this->ckNULL($row->NITA_Title\t\t\t\t\t),\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 'SDate'=>\t\t$SDate,\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 'EDate'=>\t\t$EDate,\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 'City'=>\t\t\t$this->ckNULL($row->NITA_FacilityCity\t\t),\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 'State'=>\t\t$this->ckNULL($row->NITA_FacilityState\t),\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 'Price'=>\t\t'$'.number_format($this->ckNULL($row->NITA_TuitionPriceStandard),2,'.',','),\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 'PriceInt'=>\t$this->ckNULL($row->NITA_TuitionPriceStandard),\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 'AddCart'=>\t$_SERVER['PHP_SELF'],\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 'URL'=>\t\t\t$this->Files['prodDet'].'?id='.$this->ckNULL($row->NITA_ProgramId)\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 ));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($programs);\n\t\t\t\t\t} else throw new FatalError('Cannot open template '.$this->TEMP['pList']);\n\t\t\t\t\t$this->HTML.=str_replace(\"[List]\", $myBuff, $contBuff); // Place our products into our template\n\t\t\t\t} else throw new FatalError('Cannot open template '.$this->TEMP['pListCont']);\n\t\t\t}\n\t\t\t$this->HTML=$PString.$this->HTML.$PString;\n\t\t} catch (FatalError $e) {\n\t\t\t$this->NitaERROR(102, $e->getMessage()); // Coding fault 102\n\t\t} catch (SoapFault $fault) {\n\t\t\t//echo '<pre>';\n\t\t\t//var_dump($fault);\n\t\t\t//echo '</pre>';\n\t\t\t$this->NitaERROR(101, $fault->faultcode.\", \".$fault->faultstring); // SOAP fault 101, error to our SOAP connection\n\t\t} catch (Exception $e) {\n\t\t\t$this->NitaERROR(103, $e->getMessage()); // Catch all error 103\n\t\t}\n\t}", "public function index()\n {\n //\n return ProductoResource::collection(Producto::paginate(15));\n }", "public static function loadProductsView()\n {\n $ret = array();\n $sql = \"select * from products ORDER BY NView DESC limit 0,10\";\n $list = DataProviderMain::execQuery($sql);\n\n while ($row = mysqli_fetch_array($list)) {\n $proId = $row[\"ProID\"];\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $catId = $row[\"CatID\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n $classify = $row[\"Classify\"];\n\n $p = new Products($proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $classify);\n array_push($ret, $p);\n }\n\n return $ret;\n }", "public function getProducts() {\n\t\treturn $this->requester->request('GET', $this->url);\n\t}", "public function index() {\n\t\treturn $this->product->all();\n\t}", "public function GetAllProduct(){\r\n\t\r\n\t\t\t$m_product = new m_product();\r\n\t\t\t$CatFlowingPro = $m_product->GetAll();\r\n\t\t\r\n\t\t\r\n\t\t\t//view\r\n\t\t\tinclude(\"view/layout/header.php\");\r\n\t\t\tinclude(\"view/layout/menu.php\");\r\n\t\t\tinclude(\"view/category/cat_detail.php\");\r\n\t\t\tinclude(\"view/layout/footer.php\");\r\n\t\t}", "public function index()\n\t{\n\t\t$products = $this->product->all();\n\t\t\n\t\treturn $products;\n\t}", "protected function get_product_reference_list () {\n global $_ud_license_updater;\n //echo \"<pre>\"; print_r( $_ud_license_updater ); echo \"</pre>\"; die();\n $response = array();\n if( \n isset( $_ud_license_updater[ $this->slug ] ) \n && is_callable( array( $_ud_license_updater[ $this->slug ], 'get_products' ) ) \n ) {\n $response = $_ud_license_updater[ $this->slug ]->get_products();\n }\n return $response;\n }", "public function retrieve_product_data_inv()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$product_id = $this->input->post('product_id');\n\t\t$product_info = $CI->Invoices->get_total_product_invoic($product_id);\n\t\techo json_encode($product_info);\n\t}", "public function productsAction()\n {\n $this->_initCoursedoc();\n $this->loadLayout();\n $this->getLayout()->getBlock('coursedoc.edit.tab.product')\n ->setCoursedocProducts($this->getRequest()->getPost('coursedoc_products', null));\n $this->renderLayout();\n }", "private function showProductsById()\n { \n $productNum1 = $this->productDao->getById(1);\n $productNum9 = $this->productDao->getById(9);\n \n echo PHP_EOL;\n echo 'Product with id 1: ' . PHP_EOL; print_r($productNum1);\n echo 'Product with id 9: ' . PHP_EOL; print_r($productNum9);\n }", "public function index()\n {\n return ProductResource::collection(Product::paginate(15));\n }", "public function getProductList()\n {\n $output = $this->product->getProuductList();\n return $output;\n }", "public function getProduct();", "public function getProducts() {\n\t\t$baseUrl = 'https://'.$this->apiKey.':'.$this->password.'@'.$this->domain.'.myshopify.com';\n\t\t$request = '/admin/products.json';\n\t\t$method = 'GET';\n\n\t\t$result = $this->curl($baseUrl.$request, $method);\n\n\t\t$products = array();\n\t\tforeach($result->products as $shopify) {\n\t\t\tforeach($shopify->variants as $variant) {\n\t\t\t\t// need to make a class Product in this folder?\n\t\t\t\t$product = new stdClass;\n\t\t\t\t$product->id \t\t= $shopify->id;\n\t\t\t\t$product->sku \t\t= $variant->sku;\n\t\t\t\t$product->name \t\t= $shopify->title;\n\t\t\t\t$product->price \t= $variant->price;\n\t\t\t\t$product->quantity \t= $variant->inventory_quantity;\t\n\t\t\t\tarray_push($products, $product);\n\t\t\t}\n\t\t}\n\n\t\treturn $products;\n\t}", "public function all_products()\n\t{\n\t\t$data['product_list']=$this->tbl_product->get_all_product();\n\t\t$data['page']='All Products';\n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\t$view = 'admin/collection/admin_all_product_list';\n\t\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t\t}else{\n\n\t\t}\n\t\t\n\t}", "public function getProducts(){\r\n\t\t$query = \"Select * from products\";\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($query);\r\n\t}", "public function getProducts()\n {\n return $this->products;\n }", "public function getProductos(){\n\t\n\treturn $this->productos;\n\t}", "public function getProductList()\n {\n return $this->_call('catalog_product.list', '');\n }", "private function exportProducts(){\n Product::initStore($this->store_settings->store_name, config('shopify.api_key'), $this->store_settings->access_token);\n $products_count = Product::count();\n $products_per_page = 250;\n $number_of_pages = ceil($products_count/$products_per_page);\n $all_products = [];\n $products = [];\n //to init start time\n ShopifyApiThrottle::init();\n for( $page = 1; $page <= $number_of_pages; $page++ ){\n //wait for some time so it doesn't reach throttle point\n if( $page > 1 ){ ShopifyApiThrottle::wait(); }\n\n $products = Product::all([\n 'limit' => $products_per_page,\n 'page' => $page\n ]);\n if($products)\n $all_products = array_merge($all_products, $products);\n //to re-init start time\n ShopifyApiThrottle::init();\n }\n return $all_products;\n }", "public function actionProductdetail()\n {\n $route = 'merchant.getProduct';\n $request = new getProductRequest();\n $request->setCustomerId($this->customer_id);\n $request->setAuthToken($this->auth_token);\n $request->setWholesalerId(33);\n $request->appendProductIds(4678);\n $result = Proxy::sendRequest($route, $request);\n $header = $result->getHeader();\n $body = getProductResponse::parseFromString($result->getPackageBody());\n return $this->render('index',[\n 'request' => $request->toArray(),\n 'route' => $route,\n 'header' => $header,\n 'body' => $body\n ]);\n }", "public function index()\n {\n return Producto::all();\n \n }", "function products_get() {\n\n $products = $this->api_model->get_products();\n\n if(isset($products))\n {\n $this->response(array('status' => 'success', 'message' => $products));\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => 'The specified product could not be found'), REST_CONTROLLER::HTTP_NOT_FOUND);\n }\n\n\t}", "public function index()\n {\n if(Auth::user()->isSubContractorPrime()) {\n Request::merge(['for_sub_id' => Auth::id()]);\n }\n\n $input = Request::all();\n $products = $this->repo->getProducts($input);\n\n // // exclude srs products for mobile app\n // if (config('srs_disabled_for_mobile') && ($supplier = Supplier::srsSupplier())) {\n // \t$products = $products->where('supplier_id', '<>', $supplier->id);\n // }\n\n $limit = isset($input['limit']) ? $input['limit'] : config('jp.pagination_limit');\n\n if (!$limit) {\n return ApiResponse::success($this->response->collection($products->get(), new FinancialProductsTransformer));\n }\n\n $products = $products->paginate($limit);\n\n return ApiResponse::success($this->response->paginatedCollection($products, new FinancialProductsTransformer));\n }", "public function getProductsBySearch()\n {\n $collection = new AjaxModel();\n $productList = $collection->getProducts($_POST['name']);\n foreach ($productList as $item) {\n //colon delimiter for each cell, bar delimiter for each row\n echo $item[0].\":\".$item[1].\":\".$item[2].\":\".$item[3].\":\".$item[4].\"|\";\n }\n }", "public function getProducts($limit){\n \t$p = array(\n 'title' => 'Spinning Top',\n 'shortdesc' => 'Hours of fun await with this colorful spinning top. Includes flashing colored lights.',\n 'price' => '3.99',\n 'quantity' => $limit\n );\n return $p;\n }", "public function index()\n\t{\n\t\t$products = $this->product->getProductList();\n\t\treturn $this->response([\"data\" => $products], 200); \n\t}", "public function getActiveCartProducts();", "public function Products(): ?PaginatedList\n {\n //get the list first, so that everything is calculated\n $list = $this->getProductList();\n\n $this->addSecondaryTitle();\n\n $this->cachingRelatedJavascript();\n\n return $this->paginateList($list);\n }", "public function index()\n {\n return Product::latest()->paginate(15);\n }", "public function index()\n {\n return view('pharmacy.inventory.product.index', [\n 'products' => Product::with('manufacturer', 'category')\n ->orderByDesc('id')\n ->where('company_id', company_id())\n ->paginate(),\n 'categories' => Category::where('status',1)\n ->where('company_id', company_id())\n ->get(),\n ]);\n }", "public function index() {\r\n $this->set('response', array('Products' => $this->Paginate('Product')));\r\n }", "public function products()\n {\n $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');\n\n $repository = $this->getDoctrine()\n ->getRepository(Produit::class);\n\n $produits = $repository->findBy([],['nom' => 'ASC']);\n\n return $this->render('front/produits.html.twig', [\n 'produits' => $produits]);\n }", "public function getDocumentProducts(): array\r\n {\r\n return $this->document['products'] ?? [];\r\n }", "public function GetProducts() {\n \n //set up the query\n $this->sql = \"SELECT *\n FROM products\";\n \n //execute the query\n $this->RunBasicQuery();\n }", "function show_cart_product($pro){\r\n\t\t\treturn $this->select(\"*\",\"items\",\"pro_id in($pro) order by pro_id desc\");\r\n\t\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public static function getAllSellPro()\n {\n return DB::table(static::$table)\n ->select('sell_product.*')\n ->where('is_deleted', ACTIVE)\n ->where('display', 0)\n ->where('display_top', 1)\n ->paginate(LIMIT_ITEM_PAGE); \n }", "function getProducts() {\n\techo \"Getting Products </br>\";\n\t$response = getRequest('/api/product');\n\tprintInfo($response);\n}", "protected function getProducts()\r\n {\r\n $category = new Category((int)Configuration::get('FIELD_FEATUREDPSL_CAT'), (int)Context::getContext()->language->id);\r\n\r\n $searchProvider = new CategoryProductSearchProvider(\r\n $this->context->getTranslator(),\r\n $category\r\n );\r\n\r\n $context = new ProductSearchContext($this->context);\r\n\r\n $query = new ProductSearchQuery();\r\n\r\n $nProducts = (int)Configuration::get('FIELD_FEATUREDPSL_NBR');\r\n if ($nProducts < 0) {\r\n $nProducts = 12;\r\n }\r\n\r\n $query\r\n ->setResultsPerPage($nProducts)\r\n ->setPage(1)\r\n ;\r\n $query->setSortOrder(new SortOrder('product', 'position', 'asc'));\r\n $result = $searchProvider->runQuery(\r\n $context,\r\n $query\r\n );\r\n\r\n $assembler = new ProductAssembler($this->context);\r\n\r\n $presenterFactory = new ProductPresenterFactory($this->context);\r\n $presentationSettings = $presenterFactory->getPresentationSettings();\r\n $presenter = new ProductListingPresenter(\r\n new ImageRetriever(\r\n $this->context->link\r\n ),\r\n $this->context->link,\r\n new PriceFormatter(),\r\n new ProductColorsRetriever(),\r\n $this->context->getTranslator()\r\n );\r\n\r\n $products_for_template = [];\r\n\t\t$products_features=$result->getProducts();\r\n\t\tif(is_array($products_features)){\r\n\t\t\tforeach ($products_features as $rawProduct) {\r\n\t\t\t\t$products_for_template[] = $presenter->present(\r\n\t\t\t\t\t$presentationSettings,\r\n\t\t\t\t\t$assembler->assembleProduct($rawProduct),\r\n\t\t\t\t\t$this->context->language\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n return $products_for_template;\r\n }", "function getProducts()\n {\n // Check the registry to see if our Tienda class has been overridden\n if ( !class_exists('Tienda') ) \n JLoader::register( \"Tienda\", JPATH_ADMINISTRATOR.\"/components/com_tienda/defines.php\" );\n \n // load the config class\n Tienda::load( 'Tienda', 'defines' );\n \n JTable::addIncludePath( JPATH_ADMINISTRATOR.'/components/com_tienda/tables' );\n \tJModel::addIncludePath( JPATH_ADMINISTRATOR.'/components/com_tienda/models' );\n\n \t$user = JFactory::getUser();\n \t\n // get the model\n \t$model = JModel::getInstance( 'OrderItems', 'TiendaModel' );\n $model->setState( 'limit', $this->params->get( 'max_number', '5') );\n $model->setState( 'filter_userid', $user->id );\n $model->setState( 'order', 'created_date' );\n $model->setState( 'direction', 'DESC' );\n \n $query = $model->getQuery();\n $query->select( \"MAX(o.order_id) AS order_id\" );\n $query->select( \"MAX(o.created_date) AS created_date\" );\n \n if ($this->params->get('display_downloads_only'))\n {\n $query->join('LEFT', '#__tienda_productfiles AS files ON tbl.product_id = files.product_id');\n $query->where( \"files.productfile_id IS NOT NULL\" );\n }\n \n $query->group('tbl.product_id');\n $model->setQuery( $query );\n \n $router = Tienda::getClass('TiendaHelperRoute', 'helpers.route');\n $product = Tienda::getClass('TiendaHelperProduct', 'helpers.product');\n \tif ($items = $model->getList())\n \t{\n \t foreach ($items as $item)\n \t {\n \t $category = null;\n if ($categories = $product->getCategories( $item->product_id ))\n {\n $category = $categories[0];\n } \n \t $item->link = $router->product( $item->product_id, $category ); \n \t }\n \t}\n \t\n \treturn $items;\n }", "public function index()\n {\n return $this->productRepository->getAll();\n }", "public function showProducts()\n {\n /** @var ProductFinder $productFinder */\n $productFinder = PersistenceFactory::createFinder(Product::class);\n /** @var array $products */\n\n $criteria = isset($this->request->getGet()['criteria']) ? $this->request->getGet()['criteria'] : 'title';\n $order = isset($this->request->getGet()['order']) ? $this->request->getGet()['order'] : '';\n $search = isset($this->request->getGet()['search']) ? $this->request->getGet()['search'] : null;\n $products = $productFinder->findBy($criteria, $order, $search);\n $renderer = new HomePageRenderer();\n $renderer->render($products);\n }", "public function getProducts() \n {\n return $this->_products;\n }", "public function index(Product $product)\n {\n return $this->product->getAllProducts();\n }", "public function getProducts()\n {\n return $this->products;\n }", "public function getProducts()\n {\n return $this->products;\n }", "public function getProducts()\n {\n return $this->products;\n }", "public function getProducts()\n {\n return $this->products;\n }", "public function index()\n {\n return product_client::all();\n }", "function getProducts($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product.json' , $params ),true);\n\t}", "public function getProducts(){\n\t\t$products = Product::all();\n\t\treturn view('admin-product-view')->with('products', $products);\n\t}", "public function products() {\n return $this->hasMany(Product::class, 'invoice_id', 'id');\n }", "public function Mostrar_Producto(){\r\n\r\n\t\t\t$sql=$this->db->query(\"CALL SP_M_TABLA_PRODUCTO\");\r\n\t\t\twhile($filas=$sql->fetch(PDO::FETCH_ASSOC)){\r\n\t\t\t\t$this->productos[]=$filas;\r\n\t\t\t}\r\n\t\t\treturn $this->productos;\r\n\t\t}", "public function products($params)\r\n {\r\n \t$_query = array('page' => isset($params['page']) ? $params['page'] : 1);\r\n\r\n return $this->curl_execute($method = 'products', $_query);\r\n }", "public function getProducts(Request $request){\n $products = Product::getProductsReference($request);\n return json_encode($products->get());\n }", "public function index()\n {\n $productinvoices = ProductInvoice::orderBy('created_at', 'desc')->paginate(10);\n $invoices = Invoice::orderBy('created_at', 'desc')->paginate(10);\n return view('invoices.index', compact(['invoices','productinvoices']));\n }", "public function index()\n {\n return Product::latest()->paginate(20);\n }", "static function productList( $CustomID, $Email )\n {\n $db = eZDB::instance();\n $CustomID =(int) $CustomID;\n $Email = $db->escapeString( $Email );\n if ( $Email == false )\n {\n $productArray = $db->arrayQuery( \"SELECT ezproductcollection_item.*, ignore_vat, currency_code FROM ezorder, ezproductcollection_item, ezproductcollection\n WHERE ezproductcollection.id=ezproductcollection_item.productcollection_id\n AND ezproductcollection_item.productcollection_id=ezorder.productcollection_id\n AND user_id='$CustomID'\n AND is_archived='0'\n AND is_temporary='0'\n ORDER BY contentobject_id, currency_code\" );\n }\n else\n {\n $productArray = $db->arrayQuery( \"SELECT ezproductcollection_item.*, ignore_vat, currency_code FROM ezorder, ezproductcollection_item, ezproductcollection\n WHERE ezproductcollection.id=ezproductcollection_item.productcollection_id\n AND ezproductcollection_item.productcollection_id=ezorder.productcollection_id\n AND user_id='$CustomID'\n AND is_archived='0'\n AND is_temporary='0'\n AND email='$Email'\n ORDER BY contentobject_id, currency_code\" );\n }\n $currentContentObjectID = 0;\n $productItemArray = array();\n $productObject = null;\n $itemCount = 0;\n $name = false;\n $productInfo = array();\n\n foreach( $productArray as $productItem )\n {\n $itemCount++;\n $contentObjectID = $productItem['contentobject_id'];\n if ( $productObject == null )\n {\n if ( $contentObjectID != 0 )\n {\n $productObject = eZContentObject::fetch( $contentObjectID );\n }\n else\n {\n $productObject = null;\n $name = $productItem['name'];\n }\n $currentContentObjectID = $contentObjectID;\n }\n if ( $currentContentObjectID != $contentObjectID && $itemCount != 1 )\n {\n $productItemArray[] = array( 'name' => $name,\n 'product' => $productObject,\n 'product_info' => $productInfo );\n unset( $productObject );\n $productInfo = array();\n $name = $productItem['name'];\n $currentContentObjectID = $contentObjectID;\n if ( $contentObjectID != 0 )\n {\n $productObject = eZContentObject::fetch( $currentContentObjectID );\n }\n else\n {\n $productObject = null;\n }\n }\n\n $currencyCode = $productItem['currency_code'];\n if ( $currencyCode == '' )\n {\n $currencyCode = eZOrder::fetchLocaleCurrencyCode();\n }\n\n if ( !isset( $productInfo[$currencyCode] ) )\n {\n $productInfo[$currencyCode] = array( 'sum_count' => 0,\n 'sum_ex_vat' => 0,\n 'sum_inc_vat' => 0 );\n }\n\n if ( $productItem['ignore_vat'] == true )\n {\n $vatValue = 0;\n }\n else\n {\n $vatValue = $productItem['vat_value'];\n }\n\n $price = $productItem['price'];\n\n if ( $productItem['is_vat_inc'] )\n {\n $priceExVAT = $price / ( 100 + $vatValue ) * 100;\n $priceIncVAT = $price;\n }\n else\n {\n $priceExVAT = $price;\n $priceIncVAT = $price * ( 100 + $vatValue ) / 100;\n }\n\n $count = $productItem['item_count'];\n $realPricePercent = ( 100 - $productItem['discount'] ) / 100;\n\n $productInfo[$currencyCode]['sum_count'] += $count;\n $productInfo[$currencyCode]['sum_ex_vat'] += round( $count * $priceExVAT * $realPricePercent, 2 );\n $productInfo[$currencyCode]['sum_inc_vat'] += round( $count * $priceIncVAT * $realPricePercent, 2 );\n }\n if ( count( $productArray ) != 0 )\n {\n $productItemArray[] = array( 'name' => $name,\n 'product' => $productObject,\n 'product_info' => $productInfo );\n }\n return $productItemArray;\n }", "public function listarProductos()\n {\n $crudProducto = new crudProducto(); //metodo para hacer la peticion de modelo producto\n return $crudProducto->listarProductos(); //retornar los valores del metodo listar productos\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function can_return_a_collection_of_paginated_products()\n {\n $product1 = $this->create('Product');\n $product2 = $this->create('Product');\n $product3 = $this->create('Product');\n\n $response = $this->actingAs($this->create('User', [], false), 'api')->json('GET', '/api/products');\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => ['id','name','slug','price','created_at']\n ],\n\n 'links' => ['first', 'last', 'prev', 'next'],\n 'meta' => [\n 'current_page', 'last_page', 'from', 'to', 'path', 'per_page', 'total'\n ]\n ]);\n }", "public function getProducts() {\n\n $dbData = new DBData();\n $array_products = [];\n foreach ($this->items as $item) {\n $array_products[] = $dbData->getProductDetails($item['id']);\n }\n return $array_products;\n }", "function getProductBasics() {\n $db = acmeConnect();\n $sql = 'SELECT invName, invId FROM inventory ORDER BY invName ASC';\n $stmt = $db->prepare($sql);\n $stmt->execute();\n $products = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $products;\n }", "public function index()\n {\n return Product::orderBy('id','desc')->paginate(15);\n }", "public function index()\n {\n return ProductCollection::collection(Product::paginate(5));\n }", "public function actionIndex()\n\t{\n\t\tif (!isset(Yii::app()->session['productPageSize']))\n\t\t\tYii::app()->session['productPageSize'] = Product::PAGE_SIZE;\n\n\t\t$criteria = new CDBCriteria();\n\t\t$criteria->compare('status',true);\n\t\t$criteria->order = \"order_view desc, id desc\";\n\n\t\t$count = Product::model()->count($criteria);\n\t\t$pages = new CPagination($count);\n\t\t$pages->setPageSize(Yii::app()->session['productPageSize']);\n\t\t$item_count = ceil($count/Yii::app()->session['productPageSize']);\n\t\t$pages->applyLimit($criteria);\n\n\t\t$list_product = Product::model()->findAll($criteria);\n\n\t\t$this->iPhoenixRender('index',array(\n\t\t\t'list_product'=>$list_product,\n\t\t\t'item_count' => $item_count,\n\t\t\t'pages' => $pages,\n\t\t\t'page_size' => 1,\n\t\t\t'count' => $count\n\t\t));\n\t}", "public function listProducts()\n \t{\n \t\t$data = LemonService::listProducts();\n\n \t\treturn View::make('displayProducts')->with('data',$data);\n\n\n\n \t}", "public function getList()\n {\n $data = array();\n\n $block = $this->_getViewedBlock();\n\n /* @var $_collection Mage_Reports_Model_Resource_Product_Index_Collection_Abstract */\n $_collection = $block->getItemsCollection();\n\n if (!$_collection->getSize()) {\n $data['message'] = Mage::helper('japi')->__('No products found.');\n }\n\n foreach ($_collection as $item) {\n /* @var $item Mage_Catalog_Model_Product */\n if ($item->getId()) {\n $ids[] = $item->getId();\n }\n }\n\n if (!empty($ids)) {\n /* @var $helper Jmango360_Japi_Helper_Product */\n $helper = Mage::helper('japi/product');\n $data['products'][] = $helper->convertProductIdsToApiResponse($ids);\n }\n\n return $data;\n }", "public function index()\n {\n $products = Product::all();\n return $products;\n }", "public function list(): Response\n {\n /* Récupération des produits */\n // Récupération du repository\n $repository = $this->getDoctrine()->getRepository(Product::class);\n // Récupération des enregistrements\n $products = $repository->findAll();\n\n // Envoi des produits à la vue\n return $this->render(\"products/list.html.twig\", compact('products'));\n /*\n * Forme équivalente\n return $this->render(\"products/list.html.twig\", [\n \"products\" => $products\n ]);\n */\n }", "public function view_list_byproduct(){\n\t\t$emailaddress = App\\User::get_email();\n\t\t$view_data = array(\n\t\t\t\"email\" => $emailaddress,\n\t\t);\n\t\treturn view(mProvider::$view_prefix.mProvider::$view_prefix_priv.'stock_product', $view_data);\n\t}", "public function index()\n {\n return Product::orderedBy('title')->get();\n }", "public function index()\n {\n $prods = Product::paginate(15);\n return view('product', compact('prods'));\n }", "public function listProducts()\n {\n try{\n $products = Product::all();\n return $this->sendResponse($products->toArray(), 'Products retrieved successfully.');\n }\n catch(\\Exception $ex){\n return $this->sendError('Something went wrong.', ['error' => $ex->getMessage()], 201); \n }\n }", "public static function productLists()\n {\n array_push(self::$products, \n [\n CART::ID => self::$id,\n CART::NAME => self::$name,\n CART::PRICE => self::$price,\n CART::QUANTITY => self::$quantity\n ]);\n }", "public function index(ProductRequest $request)\n {\n return $this->repository\n ->setPresenter(\\Ebuy\\Product\\Repositories\\Presenter\\ProductPresenter::class)\n ->paginate();\n }", "public function index()\n {\n return ProdutoResource::collection(Produto::paginate(25));\n }", "public function products(Request $request)\n {\n $user = $request->user();\n $currentCompany = $user->currentCompany();\n\n $products = Product::findByCompany($currentCompany->id)\n ->select('id', 'name AS text', 'price')\n ->where('hide', false)\n ->with('taxes')\n ->get();\n \n return response()->json($products);\n }", "function get_producto_numeracion_list($offset, $per_page)\n\t{\n\t\t$ef = new Producto_numeracion();\n\t\t$sql=\"select ef.*, e.razon_social as empresa, te.tag as tipo_espacio from producto_numeracion as ef left join empresas as e on e.id=ef.empresas_id left join tipos_espacios as te on te.id=ef.tipo_espacio_id limit $per_page offset $offset\";\n\t\t//Buscar en la base de datos\n\t\t//die($sql);\n\t\t$ef->query($sql);\n\t\tif($ef->c_rows > 0){\n\t\t\treturn $ef;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getCollectionProducts()\n {\n\t\treturn \"hi\";\n }", "function showAllProducts()\n\t{\n\t\tinclude('classes/Lib/Paging.php');\n\t\t\n\t\t$pagesize=25;\n\t \tif(isset($_GET['page']))\n\t\t{\n\t\t \n\t\t\t$start = trim($_GET['page']-1) * $pagesize;\n\t\t\t$end = $pagesize;\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$start = 0;\n\t\t\t$end = $pagesize;\n\t\t}\n\t\t\n\t\t$total = 0;\n\t\t$sql = \"SELECT \t* FROM products_table \";\n\t\t\n\t\t$query = new Bin_Query();\n\t\t\n\t\tif($query->executeQuery($sql))\n\t\t{\n\t\t\t$total = ceil($query->totrows/ $pagesize);\n\t\t\t\t\n\t\t\t$tmp = new Lib_Paging('classic',array('totalpages'=>$total, 'length'=>10),'pagination');\n\t\t\t\n\t\t\t$this->data['paging'] = $tmp->output;\n\t\t\t$this->data['prev'] =$tmp->prev;\n\t\t\t$this->data['next'] = $tmp->next;\t\n\t\t\t\n\t\t\t$sql = \"SELECT \t* FROM products_table LIMIT $start,$end \";\n\t\t\t\n\t\t\t$query = new Bin_Query();\n\t\t\t\n\t\t\tif($query->executeQuery($sql))\n\t\t\t\t\n\t\t\t\treturn Display_DManageProducts::showAllProducts($query->records,1,$this->data['paging'],$this->data['prev'],$this->data['next'],$start);\n\t\t\t\t\n\t\t}\t\n\t\telse\n\t\t{\n\t\t\treturn '<div class=\"exc_msgbox\">No Products Found! Please Click Product Entry Link to Add Products!</div>';\n\t\t}\t\n\t}", "public function index()\n {\n return Products::all();\n }", "public function index()\n {\n $products = Product::orderBy('name','ASC')\n ->get()\n ->pluck('name','id');\n\n $customers = Customer::orderBy('name','ASC')\n ->get()\n ->pluck('name','id');\n\n $invoice_data = Product_Out::all();\n return view('sales.index', compact('products','customers', 'invoice_data'));\n }", "public function index_get()\n {\n $product_data = $this->Product_model->getAllProducts();\n\t\t$this->response([\n\t\t\t'status' => true,\n\t\t\t'message' => 'Product List Successfully',\n\t\t\t'data' => $product_data,\n\t\t], Restserver\\Libraries\\REST_Controller_Definitions::HTTP_CREATED); // CREATED (201) being the HTTP response code\n\t\texit;\n\t}", "public function getProductList()\n {\n return $this->with('images','manufacturer', 'category')->get();\n }", "public function getAllList(){\n $collection = new Db\\Collection($this->getProductTable());\n return $collection->load();\n }", "public function index()\n {\n Log::info(\"Produtos listados\");\n $produtos = Produto::paginate(10);\n return ProdutoResource::collection($produtos);\n\n }", "public function getProducts()\n {\n return $this->_products;\n }", "public function getItems()\n\t{\n\t\t// Connect db\n\t\t\t$db\t\t\t\t\t\t\t\t\t= $this->getDbo();\n\t\t\t$query\t\t\t\t\t\t\t\t= $db->getQuery(true);\n\t\t\t$user\t\t\t\t \t\t\t\t= & JFactory::getUser();\n\n\t\t$query->select('tm.*');\n\t\t$query->from('#__jereverseauction_products AS tm');\n\t\t$query->where('tm.user_id = '.$user->id);\n\t\t$db->setQuery($query);\n\t\t$product\t\t\t\t\t\t\t\t\t= $db->loadObjectList();\n\n\t\tif ($error = $db->getErrorMsg()) {\n\t\t\tthrow new Exception($error);\n\t\t}\n\t\tif( empty($user->id) ) {\n\t\t\tJError::raiseNotice(404, JText::_('COM_JEREVERSE_AUCTION_ERROR_PLEASE_LOGIN'));\n\t\t}else if( empty($product) ) {\n\t\t\tJError::raiseNotice(404, JText::_('COM_JEREVERSE_AUCTION_ERROR_PRODUCTS_NOT_FOUND'));\n\t\t} else {\n\t\t\t$query->where('tm.published = 1 || tm.published = 0');\n\t\t\t$query->order('tm.id');\n\n\t\t\t// Join over the categories.\n\t\t\t$query->select( 'cat.title AS category_title' );\n\t\t\t$query->join( 'LEFT', '#__categories AS cat ON cat.id = tm.catid' );\n\n\t\t\t$query->select( 'com.id as comm_id' );\n\t\t\t$query->join( 'LEFT', '#__jereverseauction_commission AS com ON com.prod_id = tm.id' );\n\n\t\t\t$products\t\t\t\t\t\t\t\t= $db->loadObjectList();\n\n\t\t\tif( empty( $products )) {\n\t\t\t\tJError::raiseNotice(404, JText::_('COM_JEREVERSE_AUCTION_ERROR_PRODUCTS_NOT_PUBLISHED'));\n\t\t\t}\n\n\t\t\t$this->_total\t\t\t\t\t\t= count($products);\n\n\t\t\tif ($this->getState('limit') > 0) {\n\t\t\t\t$this->_data\t\t\t\t\t= array_splice($products, $this->getState('limitstart'), $this->getState('limit'));\n\t\t\t} else {\n\t\t\t\t$this->_data\t\t\t\t\t= $products;\n\t\t\t}\n\n\t\t\treturn $this->_data;\n\t\t}\n\t}" ]
[ "0.7090006", "0.70180386", "0.70119447", "0.6843399", "0.677041", "0.67395526", "0.6701655", "0.67001", "0.6697406", "0.6585714", "0.65792453", "0.65592134", "0.654061", "0.65305257", "0.6523669", "0.6523021", "0.6500217", "0.647885", "0.6465213", "0.6464189", "0.64565456", "0.6441996", "0.6430608", "0.64204556", "0.6410966", "0.6406126", "0.640564", "0.64011335", "0.63732797", "0.63710654", "0.6368995", "0.63582927", "0.6357379", "0.63557124", "0.63494617", "0.63211375", "0.63156164", "0.6314541", "0.63131505", "0.63102466", "0.6306007", "0.63004285", "0.62870455", "0.62851614", "0.6276362", "0.62754965", "0.6266746", "0.6266406", "0.6262447", "0.6262189", "0.6250863", "0.624589", "0.6245012", "0.624423", "0.62430674", "0.6243034", "0.624288", "0.624288", "0.624288", "0.624288", "0.62401474", "0.6239912", "0.62398", "0.62385076", "0.6236719", "0.6231747", "0.62303764", "0.62294084", "0.6227981", "0.6223338", "0.6220169", "0.6219318", "0.6216463", "0.62121207", "0.6208826", "0.6204554", "0.61987734", "0.6186021", "0.61834574", "0.61777073", "0.61755425", "0.6171565", "0.61699194", "0.61671793", "0.6166333", "0.6161032", "0.61607313", "0.6151189", "0.6148747", "0.61458635", "0.6145099", "0.61440223", "0.6143288", "0.614164", "0.6137413", "0.6137062", "0.6135602", "0.61296046", "0.6128398", "0.6127571", "0.6124691" ]
0.0
-1
Validate that for the given resource, no two collections reference the same file
protected static function validateNoDuplicateFileReferences(IResource $resource) { $collections = $resource->getCollections(); // seen files mapped as file => collection name $seenFiles = []; foreach($collections as $collection) { $collectionName = $collection->getName(); $collectionFiles = $collection->getTemplates(); foreach($collectionFiles as $file) { if(array_key_exists($file, $seenFiles)) { $firstReference = $seenFiles[$file]; $secondReference = $collectionName; throw new DuplicateFileReferenceException("Duplicate reference for file ${file}: first found in ${firstReference}, found again in ${secondReference}"); } $seenFiles[$file] = $collectionName; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCanNotBeManyIncludedResourcesWithEqualIdentifiers()\n {\n $apple = new ResourceObject('apples', '1');\n $apple->setAttribute('color', 'red');\n $doc = Document::fromIdentifier($apple->toIdentifier());\n $doc->setIncluded($apple, $apple);\n $this->assertJson(json_encode($doc));\n }", "public function cleanupDuplicateFalCollectionReferencesCommand() {\n\t\t$this->headerMessage(LocalizationUtility::translate('cleanupDuplicateFalCollectionReferencesCommand', 'dam_falmigration'));\n\t\t$references = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(\n\t\t\t'uid, uid_local, uid_foreign, COUNT(uid) AS amountOfRows',\n\t\t\t'sys_file_reference',\n\t\t\t'tablenames=\"sys_file_collection\" AND fieldname=\"files\" AND deleted=0',\n\t\t\t'uid_foreign, uid_local', // ROLLUP\n\t\t\t'uid_foreign, uid_local'\n\t\t);\n\t\t$this->infoMessage('Found ' . count($references) . ' references to sys_file_collection');\n\t\t$affectedRecords = 0;\n\t\tforeach ($references as $ref) {\n\t\t\t// this reference has duplicates\n\t\t\tif ($ref['amountOfRows'] > 1) {\n\t\t\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t\t\t'sys_file_reference',\n\t\t\t\t\t'uid != ' . $ref['uid'] . ' AND tablenames=\"sys_file_collection\" AND fieldname=\"files\" AND deleted=0 AND uid_local=' . $ref['uid_local'] . ' AND uid_foreign=' . $ref['uid_foreign']\n\t\t\t\t);\n\t\t\t\t$affectedRecords++;\n\t\t\t}\n\t\t}\n\t\t$this->successMessage('Cleaned up ' . $affectedRecords . ' duplicates of references');\n\t}", "private function isValidNewResourceInput(\r\n\t\t\t$wp) {\r\n\t\t$this->logger->writeLOG( \"isValidNewResourceInput - start\");\r\n\t\t\t// both full and snippet files present, not empty and no upload errors\r\n\t\tif ($_FILES [\"file1\"] [\"size\"] == 0) {\r\n\t\t\tFraxionErrorPageImpl::clientError ( \"Full version file is empty\",\"\", $this->logger );\r\n\t\t}\r\n\t\tif ($_FILES [\"file2\"] [\"size\"] == 0) {\r\n\t\t\tFraxionErrorPageImpl::clientError ( \"Snippet version file is empty\",\"\", $this->logger );\r\n\t\t}\r\n\t\tif ($_FILES [\"file1\"] [\"error\"] > 0) {\r\n\t\t\tFraxionErrorPageImpl::clientError ( \"Error with full version file\",\"Code:\" . $_FILES [\"file1\"] [\"error\"], \r\n\t\t\t\t\t$this->logger );\r\n\t\t}\r\n\t\tif ($_FILES [\"file2\"] [\"error\"] > 0) {\r\n\t\t\tFraxionErrorPageImpl::clientError ( \"Error with snippet version file\",\"Code:\" . $_FILES [\"file2\"] [\"error\"], \r\n\t\t\t\t\t$this->logger );\r\n\t\t}\r\n\t\t// both files have same extension\r\n\t\t$f1name = $_FILES[\"file1\"][\"name\"];\r\n\t\t$fullVersExtension = end( explode( \".\", $f1name ) );\r\n\t\tif (empty ( $fullVersExtension )) {\r\n\t\t\tFraxionErrorPageImpl::clientError (\r\n\t\t\t\t\t\"Missing Extension\",\r\n\t\t\t\t\t\"File name \" . $_FILES[\"file1\"][\"name\"] . \" has no file type extension (e.g. JPEG).\", \r\n\t\t\t\t\t$this->logger );\r\n\t\t}\r\n\t\t$f2name = $_FILES[\"file2\"][\"name\"];\r\n\t\t$snipVersExtension = end( explode( \".\", $f2name ) );\r\n\t\tif (empty ( $snipVersExtension )) {\r\n\t\t\tFraxionErrorPageImpl::clientError (\r\n\t\t\t\t\t\"Missing Extension\",\r\n\t\t\t\t\t\"File name \" . $_FILES[\"file2\"][\"name\"] . \" has no file type extension (e.g. JPEG).\", \r\n\t\t\t\t\t$this->logger );\r\n\t\t}\r\n\t\tif ($fullVersExtension != $snipVersExtension) {\r\n\t\t\tFraxionErrorPageImpl::clientError (\r\n\t\t\t\t\t\"Extensions Dont Match\", \r\n\t\t\t\t\t\"Snippet and full version file type extensions do not match (\" . $fullVersExtension . \" and \" . $snipVersExtension . \")\", \r\n\t\t\t\t\t$this->logger );\r\n\t\t}\r\n\t\t$extensionToConvert = $fullVersExtension;\r\n\t\t$fileMimeType = null;\r\n\t\tforeach ( wp_get_mime_types () as $exts => $mime ) {\r\n\t\t\tif (preg_match ( '!^(' . $exts . ')$!i', $extensionToConvert )) {\r\n\t\t\t\t$fileMimeType = $mime;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($fileMimeType == null) {\r\n\t\t\tFraxionErrorPageImpl::clientError ( \"Unknown Type\", \"File type \" . $fullVersExtension . \" not recognised \", $this->logger );\r\n\t\t}\r\n\t\t$mimeAllowed = false;\r\n\t\t$allowedMimes = get_allowed_mime_types ();\r\n\t\tforeach ( $allowedMimes as $type => $mime ) {\r\n\t\t\tif ($mime == $fileMimeType) {\r\n\t\t\t\t$mimeAllowed = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (! $mimeAllowed) {\r\n\t\t\tFraxionErrorPageImpl::clientError ( \"Illegal File Type\", \"File type \" . $fullVersExtension . \" not allowed in upload.\", \r\n\t\t\t\t\t$this->logger );\r\n\t\t}\r\n\t\t\r\n\t\t// both files fit max upload size\r\n\t\t// ????????????\r\n\t\t$this->fraxionResourceService->ensureDataBaseTable ( $wp );\r\n\t\t\r\n\t\t// build friendly name\r\n\t\t$newResName = self::getNewResourceName ( $wp );\r\n\t\t// check friendly name does not exist for a resource in database\r\n\t\tif ($this->fraxionResourceService->isResourceNameInUse ( $newResName )) {\r\n\t\t\tFraxionErrorPageImpl::clientError ( \"Duplicate Name\", 'The resource ' . $newResName . ' is already in the database.', $this->logger );\r\n\t\t}\r\n\t\t$this->logger->writeLOG( \"isValidNewResourceInput - end - true\");\r\n\t\treturn true;\r\n\t}", "public function checkRefDuplication() {\n $refArray = array();\n foreach ($this->elementData as $data) {\n $value = trim($data['ref']);\n if ($value) {\n array_push($refArray, $value);\n }\n }\n\n $refError = array_diff_assoc($refArray, array_unique($refArray));\n foreach ($refError as $key => $value) {\n $this->error[$key+1][]['message'] = 'Internal Reference duplication. Please check your CSV file.';\n }\n }", "function isValidCollection($collectionName) {\r\n\t\tglobal $member, $DIR_MEDIA;\r\n\r\n\t\t// allow creating new private directory\r\n\t\tif (preg_match('#^[0-9]+[/\\\\\\\\]?$#',$collectionName))\r\n\t\t\treturn ((int)$member->getID() == (int)$collectionName);\r\n\r\n\t\t// avoid directory traversal\r\n\t\t// note that preg_replace() is requred to remove the last \"/\" or \"\\\" if exists\r\n\t\t$media = realpath($DIR_MEDIA);\r\n\t\t$media = preg_replace('#[/\\\\\\\\]+$#','',$media);\r\n\t\t$collectionDir = realpath( $DIR_MEDIA . $collectionName );\r\n\t\t$collectionDir = preg_replace('#[/\\\\\\\\]+$#','',$collectionDir);\r\n\t\tif (strpos($collectionDir,$media)!==0 || $collectionDir == $media) return false;\r\n\r\n\t\t// private collections only accept uploads from their owners\r\n\t\t// The \"+1\" of \"strlen($media)+1\" corresponds to \"/\" or \"\\\".\r\n\t\t$collectionName=substr($collectionDir,strlen($media)+1);\r\n\t\t$firstdir = strtok($collectionName,\"/\\\\\");\r\n/*\t\tif (preg_match('/^[0-9]+$/',$collectionName))\r\n\t\t\treturn ((int)$member->getID() == (int)$collectionName);*/\r\n\t\tif (preg_match('/^[0-9]+$/',$firstdir))\r\n\t\t\treturn ((int)$member->getID() == (int)$firstdir);\r\n\t\t\t\r\n\t\t// other collections should exists and be writable\r\n\t\treturn (@is_dir($collectionDir) && @is_writable($collectionDir));\r\n\t}", "function checkForFiles( &$errors, &$warnings, &$resources, &$uploadsMap, &$lang ) {\n // global $mediaPath;\n $valid = 0;\n foreach( $resources as $row => $res ) {\n $filename = $res->getFilename();\n\t $tmp = checkFile( basename( $filename ), $uploadsMap );\n\t if ( $tmp === 2 ){\n\t $valid = $tmp;\n\t if( !array_key_exists( $row, $errors)) $errors[$row] = Array();\n\t if( $filename === '' ) array_push( $errors[$row], 'In Zeile ' . $row . ': Dateifeld ist leer.');\n\t else array_push( $errors[$row], sprintf($lang['xlsimport_error_file_not_found'], $row, $filename)); \n\t }\n }\n return $valid;\n}", "public function isReferencingCollection(): bool;", "protected function checkUniqueness(Collection $collection)\n {\n return $collection->unique(static function ($resource) {\n return implode('', $resource->getResourceIdentifier());\n });\n }", "function resourceValidator( &$errors, &$warnings, &$resources, &$lang ){\n $valid = 0;\n foreach( $resources as $row => $res ){\n $rid = $res->resourceId();\n if( $rid == 0 ){\n $valid = 2;\n array_push( $errors, sprintf( $lang['xlsimport_error_resource_not_found'], $row ) );\n }\n\n if( $res->getType() == 0 ) {\n $valid = 2;\n array_push( $errors, sprintf( $lang['xlsimport_error_resource_type_unknown'], $row, $res->getTypeName() ) );\n }\n }\n return $valid;\n}", "protected function checkUrlKeyDuplicates()\n {\n $resource = $this->getResource();\n foreach ($this->urlKeys as $storeId => $urlKeys) {\n $urlKeyDuplicates = $this->_connection->fetchAssoc(\n $this->_connection->select()->from(\n ['url_rewrite' => $resource->getTable('url_rewrite')],\n ['request_path', 'store_id']\n )->joinLeft(\n ['cpe' => $resource->getTable('catalog_product_entity')],\n \"cpe.entity_id = url_rewrite.entity_id\"\n )->where('request_path IN (?)', array_keys($urlKeys))\n ->where('store_id IN (?)', $storeId)\n ->where('cpe.sku not in (?)', array_values($urlKeys))\n );\n foreach ($urlKeyDuplicates as $entityData) {\n $rowNum = $this->rowNumbers[$entityData['store_id']][$entityData['request_path']];\n $message = sprintf(\n $this->retrieveMessageTemplate(ValidatorInterface::ERROR_DUPLICATE_URL_KEY),\n $entityData['request_path'],\n $entityData['sku']\n );\n $this->addRowError(ValidatorInterface::ERROR_DUPLICATE_URL_KEY, $rowNum, 'url_key', $message);\n }\n }\n }", "abstract protected function check_resources(Modulistica_resources $resources);", "public function testGetResource()\n {\n $directory = $directory = sys_get_temp_dir();\n $fileResource = $this->getFileResource($directory);\n $resource = new MaterializedResource($fileResource, $directory);\n $this->assertEquals($fileResource, $resource->getResource());\n }", "public function testResolveContentToUpdateCollectionItemsWithoutDuplicatesFromCache(): void\n {\n /** @var \\PostmanGenerator\\CollectionGenerator $generator1 */\n [$generator1] = $this->getRestaurantCollection();\n $generator1->generate();\n\n /** @var \\PostmanGenerator\\CollectionGenerator $generator2 */\n [$generator2] = $this->getRestaurantCollection();\n $generator2->add('Restaurant');\n $generator2->add('Restaurant');\n $generator2->add('Managers');\n $generator2->generate();\n\n $items = $generator2->getCollection()->getItem();\n\n self::assertCount(2, $items);\n self::assertEquals('Restaurant', $items[0]->toArray()['name']);\n self::assertEquals('Managers', $items[1]->toArray()['name']);\n\n $generator2->generate();\n }", "public function validate_file_id($file_id)\r\n\t{\t\r\n\t\t$sid=null;\r\n\t\tif(array_key_exists('sid',$this->form_validation->validation_data)){\r\n\t\t\t$sid=$this->form_validation->validation_data['sid'];\r\n\t\t}\r\n\r\n\t\t//list of all existing FileIDs\r\n\t\t$files=$this->list_fileid($sid);\r\n\r\n\t\tif(in_array($file_id,$files)){\r\n\t\t\t$this->form_validation->set_message(__FUNCTION__, 'FILE_ID already exists. The FILE_ID should be unique.' );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "public function getFileConsistency()\r\n {\r\n if (empty($this->file) && empty($this->file2)) {\r\n return false;\r\n } else if (empty($this->file)) {\r\n return $this->file2Consistency;\r\n } else if (empty($this->file2)) {\r\n return $this->file1Consistency;\r\n } else {\r\n return $this->file1Consistency && $this->file2Consistency;\r\n }\r\n }", "protected static function isCollectionReference($data)\n {\n if (isset($data['ids']) && isset($data['type']))\n {\n if (count($data) === 2) return true;\n return isset($data['href']) && count($data) === 3;\n }\n return false;\n }", "private function isResourceValid()\n {\n if (strpos($this->resourceToImport, 'www.freebase.com') === false)\n return false;\n\n return true;\n }", "function fileIsValid($fname, $schema, $db) {\n\tglobal $maxFileAgeInDays;\n\n\t// valid if exists\n\tif (!file_exists($fname)) {\n\t\techo \"INVALID_FILE_NOT_EXIST: $fname\\r\\n\";\n\t\treturn false;\n\t}\n\n\t// valid if not too old\n\t$age = dayOld($fname);\n\tif ($age >= $maxFileAgeInDays) {\n\t\techo \"INVALID_FILE_TOO_OLD: $fname, $age day-old\\r\\n\";\n\t\treturn false;\n\t}\n\n\t// all else being equal, check for db\n\tif (isFileAlreadyImported($fname, $schema, $db)) {\n\t\techo \"INVALID_FILE_ALREADY_IMPORTED: $fname\\r\\n\";\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "function checkForDuplicateUnique(){\n $_ufields_arr = explode(\",\", $this->listSettings->GetItem(\"MAIN\", \"UNIQUE_FIELDS\"));\n $check_fields = true;\n for ($i = 0; $i < sizeof($_ufields_arr); $i ++) {\n list ($_field[$i], $_value[$i]) = explode(\"=\", $_ufields_arr[$i]);\n if (strlen($_value[$i])) {\n $check_fields = false;\n $_query_arr[$_field[$i]] = $_value[$i];\n if ($this->_data[$_field[$i]] == $_value[$i]) {\n $check_fields = true;\n }\n }\n else {\n $_query_arr[$_field[$i]] = $this->_data[$_field[$i]];\n }\n }\n if ($check_fields) {\n $_data = $this->Storage->GetByFields($_query_arr, null);\n }\n else {\n $_data = array();\n }\n if (! empty($_data)) {\n if (($this->item_id != $_data[$this->key_field])) {\n if ($this->Kernel->Errors->HasItem($this->library_ID, \"RECORD_EXISTS\")) {\n $_error_section = $this->library_ID;\n }\n else {\n $_error_section = \"GlobalErrors\";\n }\n $this->validator->SetCustomError($_ufields_arr, \"RECORD_EXISTS\", $_error_section);\n }\n }\n }", "public function testPostOrPutIdvalidIdRequestError()\n {\n $document = new File();\n\n // document\n $shouldFailArray = [\n 'fail-not-equal-0' => ['file-id', 'request-id'],\n 'fail-not-equal-1' => ['' , 'request-id'],\n 'fail-not-equal-2' => ['file-id', '']\n ];\n\n foreach ($shouldFailArray as $name => $values) {\n $document->setId($values[0]);\n $requestId = $values[1];\n\n $method = $this->getPrivateClassMethod(get_class($this->fileManager), 'validIdRequest');\n $result = $method->invokeArgs($this->fileManager, [$document, $requestId]);\n\n $this->assertFalse($result, $name);\n }\n }", "public function testGetWithSameOption()\n {\n $result = CollectionRegistry::get('Users', ['className' => __NAMESPACE__ . '\\MyUsersCollection']);\n $result2 = CollectionRegistry::get('Users', ['className' => __NAMESPACE__ . '\\MyUsersCollection']);\n $this->assertEquals($result, $result2);\n }", "public function testResourceFile()\n {\n $file = new ResourceFile('123', 'test.txt');\n $this->field->saveFile($file);\n\n $path = $this->field->getUploadTo();\n $this->assertEquals(sprintf('foo/FileModel/%s', date('Y-m-d')), $path);\n $this->assertEquals('123', file_get_contents(__DIR__.'/temp/'.$path.'/test.txt'));\n }", "public function testCreateInvalidFile()\n {\n new MaterializedResource(new GenericResource('file_not_found.txt'), '/probably/not/a/directory');\n }", "public function testDocumentTypeKeyUniqueConstraint()\n {\n Shopware()->Plugins()->Backend()->Auth()->setNoAuth();\n\n $firstTestDocumentType = [\n 'id' => 0,\n 'name' => 'Test document 1',\n 'key' => 'test_document',\n 'template' => 'index.tpl',\n 'numbers' => 'user',\n 'left' => 2,\n 'right' => 3,\n 'top' => 4,\n 'bottom' => 5,\n 'pageBreak' => 6,\n 'elements' => [],\n ];\n\n $this->Request()->setPost($firstTestDocumentType);\n $response = $this->dispatch('backend/Config/saveValues?_repositoryClass=document');\n\n static::assertEquals(true, json_decode($response->getBody(), true)['success']);\n\n // Try to add another document type with the same document type\n $secondTestDocumentType = [\n 'id' => 0,\n 'name' => 'Test document 2',\n 'key' => 'test_document',\n 'template' => 'index.tpl',\n 'numbers' => 'user',\n 'left' => 2,\n 'right' => 3,\n 'top' => 4,\n 'bottom' => 5,\n 'pageBreak' => 6,\n 'elements' => [],\n ];\n\n $this->Request()->setPost($secondTestDocumentType);\n $response = $this->dispatch('backend/Config/saveValues?_repositoryClass=document');\n\n static::assertEquals(false, json_decode($response->getBody(), true)['success']);\n\n $this->resetContainer();\n\n Shopware()->Db()->query('DELETE FROM `s_core_documents` WHERE `key`=\"test_document\";');\n }", "public function testInvalidNamesForResourceAttributesId()\n {\n $this->document->addToData($resource = $this->schemaFactory->createResourceObject($this->getSchema(\n 'people',\n '123',\n ['firstName' => 'John', 'id' => 'whatever'], // <-- 'id' is a reserved word and cannot be used\n new Link('selfUrl'),\n [LinkInterface::SELF => new Link('selfUrl')], // links for resource\n ['some' => 'meta']\n ), new stdClass(), true));\n }", "function check_if_new($new_photo, $old_photos) {\n foreach ($old_photos as $oldie) {\n if ($oldie->guid == $new_photo['url_m']) {\n //The photo is already in the database!\n return False;\n }\n }\n return True;\n}", "public function testConstructFileAlreadyExists()\n {\n file_put_contents($this->file, null);\n\n $SerializedArray = new SerializedArray($this->file);\n $this->assertEquals($this->file, $this->getProperty($SerializedArray, 'file'));\n }", "public function rules()\n {\n return [\n [['file_1_0', 'file_1_1', 'file_1_2', 'file_1_3', 'file_1_4'],\n 'file',\n 'extensions' => FileType::fileExtensions($this->parentCollection->file_1_mimeType),\n 'maxSize' => ($this->parentCollection->file_1_maxSize ?: 0) * 1024 * 1024\n ],\n\n [['file_2_0', 'file_2_1', 'file_2_2', 'file_2_3', 'file_2_4'],\n 'file',\n 'extensions' => FileType::fileExtensions($this->parentCollection->file_2_mimeType),\n 'maxSize' => ($this->parentCollection->file_2_maxSize ?: 0) * 1024 * 1024\n ],\n\n [['collection_id'], 'required'],\n [['collection_id', 'sort', 'created_at', 'updated_at'], 'integer'],\n [['content_0', 'content_1', 'content_2', 'content_3', 'content_4'], 'string'],\n [['slug', 'name_0', 'name_1', 'name_2', 'name_3', 'name_4', 'meta_title_0', 'meta_des_0', 'meta_keyword_0', 'meta_title_1', 'meta_keyword_1', 'meta_des_1', 'meta_title_2', 'meta_des_2', 'meta_keyword_2', 'meta_title_3', 'meta_des_3', 'meta_keyword_3', 'meta_title_4', 'meta_des_4', 'meta_keyword_4'], 'string', 'max' => 255],\n\n [['slug'], 'unique'],\n [['slug'], 'afzalroq\\cms\\validators\\SlugValidator'],\n\n [['collection_id'], 'exist', 'skipOnError' => true, 'targetClass' => Collections::class, 'targetAttribute' => ['collection_id' => 'id']],\n [['text_1_0', 'text_1_1', 'text_1_2', 'text_1_3', 'text_1_4',\n 'text_2_0', 'text_2_1', 'text_2_2', 'text_2_3', 'text_2_4',\n 'text_3_0', 'text_3_1', 'text_3_2', 'text_3_3', 'text_3_4',\n 'text_4_0', 'text_4_1', 'text_4_2', 'text_4_3', 'text_4_4'\n ], 'string'],\n ];\n }", "function check_duplicate_for_upload($data){\n\t\t//return false;\n\t\treturn $this->find(\"first\",array('conditions' => \"prefix ='\".$data['JurisdictionUpload']['prefix'].\"'\"));\t\n\t}", "public function testCollectionHasNoRealId()\n {\n $client = static::createRestclient();\n $client->request('GET', '/schema/testcase/requiredhash/collection');\n\n $response = $client->getResponse();\n\n $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());\n $this->assertStringNotContainsString('realId', $response->getContent());\n }", "public function deleteDuplicateResourceRelations($resourceID) {\n $query = \"UPDATE related_resource set is_deleted = 't' WHERE resource_id = $1\n AND id NOT IN (\n SELECT *\n FROM (\n SELECT MAX(id)\n FROM related_resource\n WHERE resource_id = $1\n GROUP BY ic_id, version, arcrole, role, resource_version\n ) rrs\n )\";\n\n $result = $this->sdb->query($query, array( $resourceID ));\n\n return true;\n }", "public static function _validate_update(Model $acl_resource, Input\\Collection $input, $includeEmpty) {\n\n // parent_id\n $input->validate('parent_id', 'int', true)\n ->requireDigit(0, 4294967295)\n ->callback(function(Input\\Input $parent_id) use ($acl_resource) {\n if ($parent_id->getVal()) {\n try {\n $parent_resource = \\Neoform\\Acl\\Resource\\Model::fromPk($parent_id->getVal());\n $parent_id->setData('model', $parent_resource);\n\n // Check if we're attempting to add a resource to itself\n if ($parent_resource->id === $acl_resource->id) {\n $parent_id->setErrors('cannot move a resource into itself');\n return;\n }\n\n foreach ($parent_resource->ancestors() as $ancestor) {\n if ($acl_resource->id === $ancestor->id) {\n $parent_id->setErrors('cannot move a resource into a child of itself');\n return;\n }\n }\n\n } catch (\\Neoform\\Acl\\Resource\\Exception $e) {\n $parent_id->setErrors($e->getMessage());\n }\n }\n });\n\n // name\n $input->validate('name', 'string', !$includeEmpty)\n ->requireLength(1, 32)\n ->matchRegex('`^([0-9a-z\\._\\-]*)$`i', 'must only contain: a-z 0-9 .-_')\n ->callback(function(Input\\Input $name) use ($acl_resource, $input) {\n $id_arr = Dao::get()->by_parent_name($input->parent_id->getVal(), $name->getVal());\n if (is_array($id_arr) && $id_arr && (int) current($id_arr) !== $acl_resource->id) {\n $name->setErrors('already in use');\n }\n });\n }", "public function validateFields($data=NULL, $subset=FALSE){\n if($subset!==FALSE && $subset!=ProjectKeys::VAL_DEFAULTSUBSET){\n return parent::validateFields($data, $subset);\n }\n\n if ($data) {\n $id = $this->getId();\n $path_continguts = WikiGlobalConfig::getConf('datadir').\"/\".str_replace(\":\", \"/\", $id);\n\n $nousDocuments = is_array($data['documents']) ? $data['documents'] : json_decode($data['documents'], true);\n if (!empty($nousDocuments)) {\n usort($nousDocuments, 'self::cmpForSort'); //ordenamos el array por el campo 'id'\n\n $dataProject = $this->getCurrentDataProject();\n $vellsDocuments = is_array($dataProject['documents']) ? $dataProject['documents'] : json_decode($dataProject['documents'], true);\n usort($vellsDocuments, 'self::cmpForSort'); //ordenamos el array por el campo 'id'\n\n foreach ($nousDocuments as $k => $doc) {\n if ($doc['id'] == $vellsDocuments[$k]['id']) {\n //comprovem si s'ha modificat el nom d'un fitxer\n if ($doc['nom'] !== $vellsDocuments[$k]['nom']) {\n $this->renamePage($id, $path_continguts, $vellsDocuments[$k]['nom'], $doc['nom']);\n }\n }elseif ($doc['id'] > $vellsDocuments[$k]['id'] && $vellsDocuments[$k]) {\n // busca el id actual en todo el array de $vellsDocuments\n $rowid = array_search($doc['id'], array_column($vellsDocuments, 'id'));\n if ($rowid !== false && $doc['nom'] !== $vellsDocuments[$rowid]['nom']) {\n $this->renamePage($id, $path_continguts, $vellsDocuments[$rowid]['nom'], $doc['nom']);\n }\n }else {\n //S'ha afegit un nou fitxer, és a dir, una nova fila a la taula\n if (!file_exists(\"$path_continguts/{$doc['nom']}.txt\")) {\n $this->createPageFromTemplate(\"$id:{$doc['nom']}\", NULL, $this->getRawProjectTemplate(), \"create page\");\n }\n }\n }\n }\n\n if (!empty($vellsDocuments)) {\n //En el cas que s'hagin eliminat files de la taula de documents\n foreach ($vellsDocuments as $doc) {\n if (!empty($nousDocuments)) {\n $rowid = array_search($doc['id'], array_column($nousDocuments, 'id'));\n $rownom = array_search($doc['nom'], array_column($nousDocuments, 'nom'));\n }\n if ($rowid === false && $rownom === false) {\n $this->createPageFromTemplate(\"$id:{$doc['nom']}\", NULL, NULL, \"remove page\");\n }\n }\n }\n }\n else {\n throw new Exception(\"Aquí passa alguna cosa rara\");\n }\n }", "public function check_duplicate()\n {\n }", "public function hasResourceName(){\n return $this->_has(1);\n }", "public function hasResourceName(){\n return $this->_has(1);\n }", "public function hasResourceName(){\n return $this->_has(1);\n }", "function _wp_check_existing_file_names($filename, $files)\n {\n }", "public static function isCollectionFile(string $path): bool\n {\n $path = static::normalizePath($path);\n return !empty($path = trim($path))\n && str_ends_with($path, '.postman_collection.json')\n && file_exists($path)\n && is_readable($path)\n && ($json = json_decode(file_get_contents($path), true))\n && json_last_error() === JSON_ERROR_NONE\n && isset($json['collection']['info']['name']);\n }", "abstract protected function validateFile() : object;", "public function testFileRefs() {}", "function _check_attachment_count()\n{\n\tif ((get_forum_type()=='ocf') && (function_exists('get_member')))\n\t{\n\t\trequire_code('ocf_groups');\n\t\trequire_lang('ocf');\n\t\trequire_lang('comcode');\n\t\t$max_attachments_per_post=ocf_get_member_best_group_property(get_member(),'max_attachments_per_post');\n\n\t\t$may_have_one=false;\n\t\tforeach($_POST as $key=>$value)\n\t\t{\n\t\t\tif (is_string($key) && preg_match('#^hidFileID\\_#i',$key)!=0)\n\t\t\t{\n\t\t\t\trequire_code('uploads');\n\t\t\t\t$may_have_one=is_swf_upload();\n\t\t\t}\n\t\t}\n\t\tif ($may_have_one)\n\t\t{\n\t\t\trequire_code('uploads');\n\t\t\tis_swf_upload(true);\n\t\t}\n\t\tforeach (array_keys($_FILES) as $name)\n\t\t{\n\t\t\tif ((substr($name,0,4)=='file') && (is_numeric(substr($name,4)) && ($_FILES[$name]['tmp_name']!='')))\n\t\t\t{\n\t\t\t\t$max_attachments_per_post--;\n\t\t\t}\n\t\t}\n\n\t\tif ($max_attachments_per_post<0) warn_exit(do_lang_tempcode('TOO_MANY_ATTACHMENTS'));\n\t}\n}", "public function checkIntegrity();", "public function resourceExists($resource);", "function _wp_check_alternate_file_names($filenames, $dir, $files)\n {\n }", "public function check_files()\n {\n }", "private function compareFiles($fileA, $fileB)\n {\n if (sha1($fileA) === sha1($fileB)) {\n return true;\n }\n\n return false;\n }", "protected function validateFileContents() {\n\t\tif (!$this->fileName) {\n\t\t\tthrow new \\LogicException(\"Missing file's path. Looks like severe internal error.\");\n\t\t}\n\t\t$this->validateFilePath($this->fileName);\n\t\tif (!$this->sha1hash) {\n\t\t\tthrow new \\LogicException(\"Missing file's SHA1 hash. Looks like severe internal error.\");\n\t\t}\n\t\tif ($this->sha1hash !== sha1_file($this->fileName)) {\n\t\t\tthrow new IOException(\"The file on disk has changed and this \" . get_class($this) . \" class instance is no longer valid for use. Please create fresh instance.\");\n\t\t}\n\t\treturn true;\n\t}", "public function testResource()\r\n {\r\n $s = new XML_Serializer();\r\n $s->serialize(fopen(__FILE__, 'r'));\r\n $this->assertRegExp('/<resource>Resource id #[0-9]+<\\/resource>/', $s->getSerializedData());\r\n }", "public function isCreateResource();", "public function testCollection2()\n {\n\n $this->dispatch($this->_getFacetLink('collection', 'Collection 2'));\n\n $coll1Link = $this->_getFacetLink('collection', 'Collection 1');\n $coll2Link = $this->_getFacetLink('collection', 'Collection 2');\n\n // Should remove the `Collection 1` facet link.\n $this->_assertNotFacetLink($coll1Link);\n $this->_assertFacetLink($coll2Link, 'Collection 2');\n\n // Should list items in `Collection 2`.\n $this->_assertNotResultLink(record_url($this->item1));\n $this->_assertNotResultLink(record_url($this->item2));\n $this->_assertResultLink(record_url($this->item3), 'Item 3');\n $this->_assertResultLink(record_url($this->item4), 'Item 4');\n\n }", "public function check(Resource $resource);", "public function checkConvertionComplete()\r\n\t{\r\n\t\treturn (!file_exists($this->referenceFile) || @filesize($this->referenceFile) == 0);\r\n\t}", "public function testIfResourceTypesAreNoDeeplyMerged(): void\n {\n $this->container->loadFromExtension($this->extensionAlias, [\n 'connector' => [\n 'resourceTypes' => [\n 'Custom' => [\n 'name' => 'Custom',\n 'backend' => 'default'\n ]\n ]\n ]\n ]);\n\n $this->container->compile();\n\n $connectorConfig = $this->container->getParameter('ckfinder.connector.config');\n\n $expected = [\n 'Custom' => [\n 'name' => 'Custom',\n 'backend' => 'default'\n ]\n ];\n\n $this->assertEquals($expected, $connectorConfig['resourceTypes']);\n\n $connector = $this->container->get('ckfinder.connector');\n\n $this->assertEquals(['Custom'], $connector['config']->getResourceTypes());\n }", "function verifyDeletion($filename, $target_file)\n{\n // Check if file exists\n if (!file_exists($target_file))\n {\n echo \"File not found.<br>\";\n return false;\n }\n\n // check if file in list\n $list = read_file_list();\n\n if(!in_array($filename, $list)) {\n echo \"Not an image.<br>\";\n return false;\n }\n \n return true;\n}", "public function testResourceHasKey()\n {\n $this->assertTrue($this->resource->has('books'),\n 'has() does not return true if param is set');\n $this->assertFalse($this->resource->has('dwarfs'),\n 'has() does not return false if param is not set');\n $this->assertTrue($this->resource->hasRecursive('books/0/title'),\n 'hasRecursive() does not return true if param is set');\n $this->assertTrue($this->resource->hasRecursive('books/0'),\n 'hasRecursive() does not return true if param is set and not at the and of the path');\n $this->assertFalse($this->resource->hasRecursive('books/0/soldCount'),\n 'hasRecursive() does not return false if param is not set');\n $this->assertFalse($this->resource->hasRecursive('dwarfs/0/gimli'),\n 'hasRecursive() does not return false if param is not set and not at the end of a valid path');\n }", "public function testInvalidNamesForResourceAttributesType()\n {\n $this->document->addToData($resource = $this->schemaFactory->createResourceObject($this->getSchema(\n 'people',\n '123',\n ['firstName' => 'John', 'type' => 'whatever'], // <-- 'type' is a reserved word and cannot be used\n new Link('selfUrl'),\n [LinkInterface::SELF => new Link('selfUrl')], // links for resource\n ['some' => 'meta']\n ), new stdClass(), true));\n }", "public function validateStoryTitleUniqueness()\n {\n $dupes = [];\n\n foreach ($this->storyToTitleMappings as $storyTitle => $files) {\n if (count($files) > 1) {\n $dupes[$storyTitle] = \"'\" . implode(\"', '\", $files) . \"'\";\n }\n }\n if (!empty($dupes)) {\n $message = \"Story and Title annotation pairs must be unique:\\n\\n\";\n foreach ($dupes as $storyTitle => $tests) {\n $storyTitleArray = explode(\"/\", $storyTitle);\n $story = $storyTitleArray[0];\n $title = $storyTitleArray[1];\n $message .= \"Story: '{$story}' Title: '{$title}' in Tests {$tests}\\n\\n\";\n }\n throw new XmlException($message);\n }\n }", "public function testAlreadyLoadedFileWillNotBeLoadedTwice()\n {\n $this->translator->load();\n $this->assertArrayHasKey('test_message', $this->translator->all());\n $this->translator->load();\n $this->assertTrue($this->translator->hasBeenLoaded('en'));\n }", "public function testFileInfoValidInput()\n {\n // need a review with two files, one deleted\n $this->createChangeWithDelete();\n\n // dispatch to create a review (verify it worked)\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost(new Parameters(array('change' => 2)));\n $this->dispatch('/review/add');\n $this->assertResponseStatusCode(200);\n $this->assertTrue($this->getResult()->getVariable('isValid'));\n\n // review needs a version for file-info to work, process queue to make one\n $this->resetApplication();\n $this->getRequest()->getQuery()->set('debug', 1)->set('retire', 1);\n $this->dispatch('/queue/worker');\n\n // above should create review id 3 and two files\n // now try to set the read status of a file\n $this->resetApplication();\n $file = '//depot/main/foo/test.txt';\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost(new Parameters(array('user' => 'nonadmin', 'read' => 1)));\n $this->dispatch('/reviews/3/v1/files/' . ltrim($file, '/'));\n\n $this->assertResponseStatusCode(200);\n $this->assertSame(\n $this->getResult()->getVariable('readBy'),\n array('nonadmin' => array('version' => 1, 'digest' => '613D3B9C91E9445ABAECA02F2342E5A6'))\n );\n\n // ensure record was truly written\n $fileInfo = FileInfo::fetch(FileInfo::composeId(3, $file), $this->p4);\n $this->assertTrue($fileInfo->isReadBy('nonadmin', 1, '613D3B9C91E9445ABAECA02F2342E5A6'));\n\n // now try to clear read status\n $this->resetApplication();\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost(new Parameters(array('user' => 'nonadmin', 'read' => 0)));\n $this->dispatch('/reviews/3/v1/files/' . ltrim($file, '/'));\n\n $this->assertResponseStatusCode(200);\n $this->assertSame(\n $this->getResult()->getVariable('readBy'),\n array()\n );\n\n // ensure record was truly written\n $fileInfo = FileInfo::fetch(FileInfo::composeId(3, $file), $this->p4);\n $this->assertFalse($fileInfo->isReadBy('nonadmin', 1, '613D3B9C91E9445ABAECA02F2342E5A6'));\n\n // now try to set the read status on the deleted file\n $this->resetApplication();\n $file = '//depot/main/foo/delete.txt';\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost(new Parameters(array('user' => 'nonadmin', 'read' => 1)));\n $this->dispatch('/reviews/3/v1/files/' . ltrim($file, '/'));\n\n $this->assertResponseStatusCode(200);\n $this->assertSame(\n $this->getResult()->getVariable('readBy'),\n array('nonadmin' => array('version' => 1, 'digest' => null))\n );\n\n // ensure record was truly written\n $fileInfo = FileInfo::fetch(FileInfo::composeId(3, $file), $this->p4);\n $this->assertTrue($fileInfo->isReadBy('nonadmin', 1, ''));\n }", "function checkForSameFile($filepath, $object)\r\n {\r\n global $DB;\r\n\r\n $filenamematch = '';\r\n\r\n $files = scandir($filepath);\r\n\r\n $type = '';\r\n $tableInfo = '';\r\n switch (get_class($object))\r\n {\r\n case \"ExportDefinition\":\r\n $type = \"definition\";\r\n $tableInfo = $DB->get_record(\"msm_table_collection\", array(\"tablename\" => \"msm_def\"));\r\n break;\r\n case \"ExportTheorem\":\r\n $type = \"theorem\";\r\n $tableInfo = $DB->get_record(\"msm_table_collection\", array(\"tablename\" => \"msm_theorem\"));\r\n break;\r\n case \"ExportComment\":\r\n $type = \"comment\";\r\n $tableInfo = $DB->get_record(\"msm_table_collection\", array(\"tablename\" => \"msm_comment\"));\r\n break;\r\n }\r\n\r\n foreach ($files as $file)\r\n {\r\n if (!empty($object->caption))\r\n {\r\n $captionTrim = preg_replace(\"/\\s+/\", '', $object->caption);\r\n $captionmod = preg_replace(\"/[\\/|\\\\|\\.|,]/\", '', $captionTrim);\r\n\r\n $filenamematch = $captionmod . \"-$type\";\r\n }\r\n else if (!empty($object->type))\r\n {\r\n $filenamematch = $object->type . \"-$type\";\r\n }\r\n\r\n if (!empty($filenamematch))\r\n {\r\n if (strpos($file, $filenamematch) !== false)\r\n {\r\n $fileInfo = explode(\".\", $file);\r\n $filenameInfo = explode(\"-\", $fileInfo[0]);\r\n $filecompid = $filenameInfo[sizeof($filenameInfo) - 1];\r\n\r\n $existingFileRecord = $DB->get_record(\"msm_compositor\", array(\"id\" => $filecompid));\r\n\r\n if (($existingFileRecord->table_id == $tableInfo->id) && ($existingFileRecord->unit_id == $object->id))\r\n {\r\n return $filecompid;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }", "protected function validateOwner()\n {\n $value = $this->owner->getValue();\n if (!isset($value['error']) || UPLOAD_ERR_NO_FILE == $value['error']) {\n return true;\n }\n $mime = $this->getConfig();\n return is_array($mime)? in_array($value['type'], $mime):\n $value['type'] == $mime;\n }", "public function is_equal(filesystem $other) {\n return count($this->ino_inodes_local) == count($other->ino_inodes_local) &&\n count($this->uuid_inodes_local) == count($other->uuid_inodes_local) &&\n $this->ino_counter == $other->ino_counter &&\n $this->replica->state == $other->replica->state;\n }", "public function validateMultiple()\n {\n if (is_array($this->name)) {\n for ($i = 0; $i < count($this->name); $i++) {\n $this->name[$i] = strtolower($this->name[$i]);\n $name = explode(\".\", $this->name[$i]);\n // image name\n $this->name[$i] = sha1($name[0] . time() . rand());\n // image extension\n $this->ext[$i] = array_values(array_slice($name, -1))[0];\n\n if (!in_array($this->ext[$i], $this->extensions)) {\n $this->uploadErrors[] = \"error File type not allowed\";\n }\n if ($this->size[$i] > 50000000) {\n $this->uploadErrors[] = \"Image File is too large\";\n }\n if ($this->errors[$i] > 0) {\n $this->uploadErrors[] = \"error uploading File\";\n }\n $this->image[$i] = $this->name[$i] . \".\" . $this->ext[$i];\n\n }\n }\n }", "function _duplicate_files()\n\t{\n\t\tif (count($this->attachments) == 0)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t/** -------------------------------------\n\t\t/** Check the paths\n\t\t/** -------------------------------------*/\n\n\t\tif ($this->upload_path == '')\n\t\t{\n\t\t\treturn ee()->lang->line('unable_to_recieve_attach');\n\t\t}\n\n\t\tif ( ! @is_dir($this->upload_path) OR ! is_really_writable($this->upload_path))\n\t\t{\n\t\t\treturn ee()->lang->line('unable_to_recieve_attach');\n\t\t}\n\n\t\t/** -------------------------------------\n\t\t/** Fetch the size of all attachments\n\t\t/** -------------------------------------*/\n\t\tif ($this->attach_total != '0')\n\t\t{\n\t\t\t$query = ee()->db->query(\"SELECT SUM(attachment_size) AS total FROM exp_message_attachments WHERE is_temp != 'y'\");\n\n\t\t\tif ($query->row('total') != NULL)\n\t\t\t{\n\t\t\t\t$total = $query->row('total') ;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$total = 0;\n\t\t\t}\n\t\t}\n\n\n\t\t/** -------------------------------------\n\t\t/** Get Attachment Data\n\t\t/** -------------------------------------*/\n\n \t\t$results = ee()->db->query(\"SELECT attachment_name, attachment_size,\n \t\t\t\t\t\t\t\tattachment_location, attachment_extension\n \t\t\t\t\t\t\t\tFROM exp_message_attachments\n \t\t\t\t\t\t\t\tWHERE attachment_id IN ('\".implode(\"','\", $this->attachments).\"')\");\n\n \t\tif ($query->num_rows() == 0)\n \t\t{\n \t\t\treturn TRUE;\n \t\t}\n\n \t\t$this->attachments = array();\n\n \t\tforeach($results->result_array() as $row)\n \t\t{\n \t\t\tif ( ! file_exists($row['attachment_location']))\n \t\t\t{\n \t\t\t\tcontinue;\n \t\t\t}\n\n \t\t\t/** -------------------------------------\n\t\t\t/** Check Against Max\n\t\t\t/** -------------------------------------*/\n\t\t\tif ($this->attach_total != '0')\n\t\t\t{\n\t\t\t\tif (ceil($total + $row['attachment_size']) > ($this->attach_total * 1000))\n\t\t\t\t{\n\t\t\t\t\treturn ee()->lang->line('too_many_attachments');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/** -------------------------------------\n\t\t\t/** Duplicate File\n\t\t\t/** -------------------------------------*/\n\n\t\t\t$filehash = ee()->functions->random('alnum', 20);\n\n\t\t\t$new_name = $filehash.$row['attachment_extension'];\n\n\t\t\t$new_location = $this->upload_path.$new_name;\n\n\t\t\tif (@copy($row['attachment_location'], $new_location))\n\t\t\t{\n\t\t\t\tchmod($new_location, FILE_WRITE_MODE);\n\t\t\t}\n\n\t\t\t/** -------------------------------------\n\t\t\t/** Insert into Database\n\t\t\t/** -------------------------------------*/\n\n\t\t\t$this->temp_message_id = ee()->functions->random('nozero', 10);\n\n\t \t\t$data = array(\n\t \t\t\t\t\t\t'sender_id'\t\t\t\t=> $this->member_id,\n\t \t\t\t\t\t\t'message_id'\t\t\t=> $this->temp_message_id,\n\t \t\t\t\t\t\t'attachment_name'\t\t=> $row['attachment_name'],\n\t \t\t\t\t\t\t'attachment_hash'\t\t=> $filehash,\n\t \t\t\t\t\t\t'attachment_extension' => $row['attachment_extension'],\n\t \t\t\t\t\t\t'attachment_location'\t=> $new_location,\n\t \t\t\t\t\t\t'attachment_date'\t\t=> ee()->localize->now,\n\t \t\t\t\t\t\t'attachment_size'\t\t=> $row['attachment_size']\n\t \t\t\t\t\t);\n\n\t\t\tee()->db->query(ee()->db->insert_string('exp_message_attachments', $data));\n\t\t\t$attach_id = ee()->db->insert_id();\n\n\n\t\t\t/** -------------------------------------\n\t\t\t/** Change file name with attach ID\n\t\t\t/** -------------------------------------*/\n\n\t\t\t// For convenience we use the attachment ID number as the prefix for all files.\n\t\t\t// That way they will be easier to manager.\n\n\t\t\t// OK, whatever you say, Rick. -Paul\n\n\t\t\tif (file_exists($new_location))\n\t\t\t{\n\t\t\t\t$final_name = $attach_id.'_'.$filehash;\n\t\t\t\t$final_path = $this->upload_path.$final_name.$row['attachment_extension'];\n\n\t\t\t\tif (rename($new_location, $final_path))\n\t\t\t\t{\n\t\t\t\t\tchmod($final_path, FILE_WRITE_MODE);\n\t\t\t\t}\n\n\t\t\t\tee()->db->query(\"UPDATE exp_message_attachments\n\t\t\t\t\t\t\tSET attachment_hash = '{$final_name}', attachment_location = '{$final_path}'\n\t\t\t\t\t\t\tWHERE attachment_id = '{$attach_id}'\");\n\t\t\t}\n\n\t\t\t/** -------------------------------------\n\t\t\t/** Load Attachment into array\n\t\t\t/** -------------------------------------*/\n\n\t\t\t$this->attachments[] = $attach_id;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "private function contains_resource( array $request_snippet ) {\n\t\tforeach ( $request_snippet as $part ) {\n\t\t\tif ( is_resource( $part ) === true || ( is_array( $part ) && $this->contains_resource( $part ) ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function testSameTimeDifferentResources()\n {\n $booking = factory(Booking::class)->create();\n $availableRule = new Available($booking->start_time, $booking->end_time);\n\n $this->assertTrue($availableRule->passes('resource_id', factory(Resource::class)->create()->id));\n }", "function testIsUriAliasDuplicated()\n {\n\n $this->assertTrue($this->da->isUriAliasDuplicated('my_alias', $sectionId = null));\n $this->assertTrue($this->da->isUriAliasDuplicated('my_alias', $sectionId = 32));//non-existant id\n }", "public function canMergeTwoCollection()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = $this->getMock('ATM_Config_Comment', array(), array('comment'));\n $this->object->append($object0);\n $collection = new ATM_Config_Collection(array($object1, $object0));\n $this->object->merge($collection);\n $this->assertEquals($object0, $this->object[0]);\n $this->assertEquals($object1, $this->object[1]);\n $this->assertEquals($object0, $this->object[2]);\n }", "public function testCollection1()\n {\n\n $this->dispatch($this->_getFacetLink('collection', 'Collection 1'));\n\n $coll1Link = $this->_getFacetLink('collection', 'Collection 1');\n $coll2Link = $this->_getFacetLink('collection', 'Collection 2');\n\n // Should remove the `Collection 2` facet link.\n $this->_assertFacetLink($coll1Link, 'Collection 1');\n $this->_assertNotFacetLink($coll2Link);\n\n // Should list items in `Collection 1`.\n $this->_assertResultLink(record_url($this->item1), 'Item 1');\n $this->_assertResultLink(record_url($this->item2), 'Item 2');\n $this->_assertNotResultLink(record_url($this->item3));\n $this->_assertNotResultLink(record_url($this->item4));\n\n }", "private function validateFilenameAndSetIfAbsent()\n {\n if (!isset($this->filename) || $this->filename == '') {\n $this->filename = $this->generateRandomFilename();\n }\n }", "private function isValidStaticTypeFile(): bool\n {\n return $this->oHttpRequest->getExists('t') &&\n in_array($this->oHttpRequest->get('t'), self::ASSET_FILES_ACCEPTED, true);\n }", "public function isSingleResource($contact);", "public function testFieldSubset()\n {\n $user = factory(User::class)->make();\n $serializer = new ResourceSerializer($user, ['users' => 'name']);\n $resource = $serializer->toBaseResourceObject();\n\n $this->assertArrayHasKey('name', $resource['attributes']);\n $this->assertArrayNotHasKey('email', $resource['attributes']);\n }", "protected function removeSysFileReferenceRecordsFromImportDataWithRelationToMissingFile() {}", "public function testCollectionsOne()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function resolveCopy() {\r\n\t\tif($this->status == self::CONFLICT && $this->numFiles == 1) {\r\n\t\t\t$this->status = self::MISSING;\t\t\t\r\n\t\t}\r\n\t}", "public function valid()\n \t{\n $handle = $this->getHandle(); \n while (!isset($handle->current) || $handle->current == '.' || $handle->current == '..') $handle->current = readdir($handle->resource);\n \n return $handle->current !== false;\n \t}", "public function isDeleteResource();", "public function isUpdateResource();", "function filesystemValidator( &$errors, &$warnings , &$conflictsMap ) {\n $valid = 0;\n foreach( $conflictsMap as $key => $value ){\n $valid = 2;\n $errors[ $key ] = $value;\n }\n return $valid;\n}", "function SetOtherObjectClient($Resource) {\n\t\t\t$this->ObjClientSide = $Resource;\n\t\t\tif (is_uploaded_file($this->GetFileTempName())) {\n\t\t\t\t$this->SetReplaceMode(0);\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$this->RollbackUpload();\n\t\t\t\tdie('El cambio de recurso es erroneo: se ha procedido al rollback de todas las operaciones');\n\t\t\t}\n\t\t}", "private function _checkExist()\n {\n if (!($validation = IO::required($this->data, ['videoLink']))['valid']) {\n throw new InvalidParameterException($validation['message']);\n }\n\n $resource = new Resource($this->data);\n\n $sql = \"SELECT COUNT(*) FROM `resource` WHERE `video_link` = :video_link\";\n\n $stmt = $this->pdo->prepare($sql);\n\n $stmt->execute(['video_link' => $resource->getVideoLink()]);\n\n return $stmt->fetchColumn() != 0;\n }", "public function testCreateSameDocException()\n {\n if (! $this->_url) $this->markTestSkipped(\"Test requires a CouchDb server set up - see TestConfiguration.php\");\n $db = $this->_setupDb();\n \n $doc = $db->create(array('a' => 1), 'mydoc');\n \n try { \n $doc = $db->create(array('a' => 1), 'mydoc');\n $this->_teardownDb();\n $this->fail(\"Expected Sopha_Db_Exception was not thrown\");\n } catch (Sopha_Db_Exception $e) {\n $this->_teardownDb();\n $this->assertEquals(409, $e->getCode(), \"HTTP error code is expected to be 412\");\n }\n }", "public function isFileOperationAllowed() {}", "function files_are_equal($a, $b)\n{\n if(filesize($a) !== filesize($b))\n return 0;\n\n // Check if content is different\n $ah = fopen($a, 'rb');\n $bh = fopen($b, 'rb');\n\n $result = 1;\n while(!feof($ah))\n {\n if(fread($ah, 8192) != fread($bh, 8192))\n {\n $result = 0;\n break;\n }\n }\n\n fclose($ah);\n fclose($bh);\n\n return $result;\n}", "public function validateFile()\n {\n $totalChunks = $this->getTotalChunks();\n $totalChunksSize = 0;\n\n for ($i = $totalChunks; $i >= 1; $i--) {\n $file = $this->getChunkPath($i);\n if (!file_exists($file)) {\n return false;\n }\n $totalChunksSize += filesize($file);\n }\n\n return $this->getTotalSize() == $totalChunksSize;\n }", "public function testFileInfoInvalidInput()\n {\n // need a review with at least one file\n $this->createChange();\n\n // dispatch to create a review (verify it worked)\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost(new Parameters(array('change' => 1)));\n $this->dispatch('/review/add');\n $this->assertResponseStatusCode(200);\n $this->assertTrue($this->getResult()->getVariable('isValid'));\n\n // review needs a version for file-info to work, process queue to make one\n $this->resetApplication();\n $this->getRequest()->getQuery()->set('debug', 1)->set('retire', 1);\n $this->dispatch('/queue/worker');\n\n // try with a bad review id in url (should 404)\n $file = '//depot/main/foo/test.txt';\n $this->resetApplication();\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost(new Parameters(array('user' => 'nonadmin', 'read' => 1)));\n $this->dispatch('/reviews/123/v1/files/' . ltrim($file, '/'));\n $this->assertResponseStatusCode(404);\n\n // invalid version\n $this->resetApplication();\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost(new Parameters(array('user' => 'nonadmin', 'read' => 1)));\n $this->dispatch('/reviews/2/v2/files/' . ltrim($file, '/'));\n $this->assertResponseStatusCode(404);\n\n // no file\n $this->resetApplication();\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost(new Parameters(array('user' => 'nonadmin', 'read' => 1)));\n $this->dispatch('/reviews/2/v1/files/');\n $this->assertResponseStatusCode(404);\n\n // invalid file\n $this->resetApplication();\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost(new Parameters(array('user' => 'nonadmin', 'read' => 1)));\n $this->dispatch('/reviews/2/v1/files/woozle/wobble');\n $this->assertResponseStatusCode(404);\n\n // mismatched user\n $this->resetApplication();\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost(new Parameters(array('user' => 'baduser', 'read' => 1)));\n $this->dispatch('/reviews/2/v1/files/' . ltrim($file, '/'));\n $this->assertResponseStatusCode(400);\n\n // invalid read value\n $this->resetApplication();\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost(new Parameters(array('user' => 'baduser', 'read' => 123)));\n $this->dispatch('/reviews/2/v1/files/' . ltrim($file, '/'));\n $this->assertResponseStatusCode(400);\n }", "public function beforeValidate() {\n\n //(optional) Generate a random name for our file to work on preventing\n // malicious users from determining / deleting other users' files\n if ($this->secureFileNames) {\n $this->filename = sha1(Yii::app()->user->id . microtime() . $this->name);\n $this->filename .= \".\" . $this->file->getExtensionName();\n }\n\n return parent::beforeValidate();\n }", "public function rules()\n {\n /** @var User $user */\n $user = Auth::user();\n\n return [\n 'name' => 'required_if:document|unique:documents,id,user_id,'.$user->id, // document name must be unique for the user\n 'document' => 'sometimes|file|max:100000' // document must be a file and max size is 10M\n ];\n }", "public function testGetFilesWithErrors()\n {\n $this->_mockXMLHandler\n ->expects($this->once())\n ->method('loadXML')\n ->with($this->equalTo(self::$_cbXMLFile))\n ->will($this->returnValue(simplexml_load_file(self::$_cbXMLFile)));\n \n $this->_mockXMLHandler\n ->expects($this->atLeastOnce())\n ->method('countItems')\n ->will($this->returnValue(rand(1,100)));\n \n $files = $this->_cbErrorHandler->getFilesWithErrors(self::$_cbXMLFile);\n \n $this->assertTrue(5 === count($files[0]));\n $this->assertEquals($this->_fileName, $files[0]['complete']);\n }", "public function isValid($resource = null)\r\n {\r\n if ($resource === null) {\r\n $resource = $this->_resource;\r\n } \r\n return is_resource($resource);\r\n }", "function checkResource() {\n if (is_resource($this->_handler) && (get_resource_type($this->_handler) == 'stream')) {\n \treturn true;\n }\n return false;\n }", "public function testTemplateFollowsCanonicalName()\n {\n $errors = [];\n $warnings = [];\n foreach (self::$templates as $file => $templates) {\n foreach ($templates as $templatePair) {\n if (!preg_match('/[A-Za-z0-9]_[A-Za-z0-9]+\\:\\:[A-Za-z0-9\\\\_\\-\\.]+/', $templatePair['file'])) {\n if (!isset($errors[$file])) {\n $errors[$file] = [];\n }\n $errors[$file][] = $templatePair['file'];\n } else {\n if (isset(self::$blockVirtualTypes[$templatePair['class']])) {\n $warnings[$file][] = $templatePair;\n }\n }\n }\n }\n if (count($errors) > 0) {\n $message = 'Failed to assert that the template reference follows the canonical format '\n . 'Vendor' . '_' . 'Module::path/to/template.phtml. Following files haven\\'t pass verification:'\n . PHP_EOL;\n foreach ($errors as $file => $wrongTemplates) {\n $message .= $file . ':' . PHP_EOL;\n $message .= '- ' . implode(PHP_EOL . '- ', $wrongTemplates) . PHP_EOL;\n }\n $this->fail($message);\n }\n }", "public function testCreateDataCollectionFailsForDuplicateBrowserEntries(): void\n {\n $this->expectException(DuplicateDataException::class);\n $this->expectExceptionMessage('it was tried to add browser \"chrome\", but this was already added before');\n\n $this->object->createDataCollection(\n __DIR__ . '/../../../fixtures/duplicate-browser-entries',\n );\n }", "public function validateTestCaseIdTitleUniqueness()\n {\n $dupes = [];\n foreach ($this->testCaseToTitleMappings as $newTitle => $files) {\n if (count($files) > 1) {\n $dupes[$newTitle] = \"'\" . implode(\"', '\", $files) . \"'\";\n }\n }\n if (!empty($dupes)) {\n $message = \"TestCaseId and Title pairs must be unique:\\n\\n\";\n foreach ($dupes as $newTitle => $tests) {\n $testCaseTitleArray = explode(\": \", $newTitle);\n $testCaseId = $testCaseTitleArray[0];\n $title = $testCaseTitleArray[1];\n $message .= \"TestCaseId: '{$testCaseId}' Title: '{$title}' in Tests {$tests}\\n\\n\";\n }\n throw new XmlException($message);\n }\n }", "public function testCreateDataCollectionFailsForDuplicateDeviceEntries(): void\n {\n $this->expectException(DuplicateDataException::class);\n $this->expectExceptionMessage('it was tried to add device \"unknown\", but this was already added before');\n\n $this->object->createDataCollection(\n __DIR__ . '/../../../fixtures/duplicate-device-entries',\n );\n }", "public function check_suspect_duplicate_file($data, &$error_message)\r\n\t{\r\n\t\t$error_list = $this->interface_customer_fulfillment_import_service->get_list_of_interface_record_in_suspect_mode($data);\r\n\r\n\t\tforeach ($error_list as $data)\r\n\t\t{\r\n\t\t\t$error_message .= \"Err with order_number = \" . $data->get_order_number() . \" & ext_sku = \" . $data->get_ext_sku() . \", record probably processed before with trans_id=\" . $data->get_trans_id() . \"\\n\";\r\n\t\t}\r\n\r\n\t\treturn $error_list;\r\n\t}", "public function validateMultiDelete()\n {\n return true;\n }", "function alreadyHas($file) {\n $res = false;\n if (strlen($this->id) && !is_numeric($this->id)) {\n if (in_array($this->id, $file->listFeatures())) {\n $res = $file->getFeature($this->id);\n } else $res = false;\n }\n else {\n foreach ($file->getFeatures() as $f) {\n if ($this->isMe($f)) {\n $res = $f;\n break;\n }\n }\n }\n return $res;\n }" ]
[ "0.580311", "0.5745797", "0.56992567", "0.5488943", "0.5420338", "0.5297465", "0.5290393", "0.5257269", "0.5236538", "0.51356614", "0.50844944", "0.50570256", "0.5002455", "0.50001", "0.49946678", "0.4963443", "0.49577194", "0.4929965", "0.49214226", "0.49202245", "0.49069595", "0.490654", "0.48929805", "0.48792553", "0.48445097", "0.48432842", "0.4838534", "0.48178336", "0.4816978", "0.4810106", "0.4793725", "0.47935107", "0.47758183", "0.47747388", "0.4754093", "0.4754093", "0.4754093", "0.47537", "0.47404283", "0.47312582", "0.47304153", "0.47303247", "0.47255304", "0.47163126", "0.47079447", "0.4705767", "0.4702247", "0.4697419", "0.46894583", "0.4687009", "0.46847382", "0.46824542", "0.46765044", "0.4669478", "0.46420982", "0.46340007", "0.46270424", "0.46237233", "0.4623565", "0.46187034", "0.46098322", "0.46094742", "0.4609474", "0.4607218", "0.4592266", "0.4586265", "0.45828846", "0.4578843", "0.45781788", "0.45742488", "0.45706388", "0.45663744", "0.4561525", "0.45513418", "0.45481637", "0.45452353", "0.45362964", "0.45357382", "0.45327345", "0.4531708", "0.4530656", "0.45264843", "0.45248705", "0.45238614", "0.45226237", "0.45157126", "0.45108432", "0.45065916", "0.45009476", "0.44970712", "0.44919905", "0.4490464", "0.44885656", "0.44872925", "0.44858524", "0.44855973", "0.44780943", "0.44766897", "0.4468586", "0.4459489" ]
0.74956924
0
Check that a value is a valid social security number format
public function isValid($value) { return (preg_match(self::REGEX, $value, $match) && $match[1] > 0 && $match[2] > 0 && $match[3] > 0 // No all zeros in digit group && $match[1] != 666 // No Number of the Beast && $match[1] <= 899); // Highest area number }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function validateNumber(): bool;", "protected function validateNumber($value) {\n if (preg_match(\"/^\\-?[0-9\\ ]+[\\.|\\,]?[0-9]*$/\", $value))\n return true;\n $this->setError(t(\"Invalid number\"));\n return false;\n }", "function idFormat($value){\n \n if(!preg_match(VALID_INT_FORMAT,$value)){\n return false;\n }\n \n return true;\n\n}", "public function validate(string $number): bool;", "public function validate()\n {\n // get the value; remove spaces, dashes, and dots\n $value = str_replace([' ', '-', '.'], '', (string) $this->getValue());\n\n // is it composed only of digits?\n if (! ctype_digit($value)) {\n return false;\n }\n\n // luhn mod-10 algorithm: https://gist.github.com/1287893\n $sumTable = [\n [0,1,2,3,4,5,6,7,8,9],\n [0,2,4,6,8,1,3,5,7,9],\n ];\n\n $sum = 0;\n $flip = 0;\n\n for ($i = strlen($value) - 1; $i >= 0; $i--) {\n $sum += $sumTable[$flip++ & 0x1][$value[$i]];\n }\n return $sum % 10 === 0;\n }", "public function isValid($value)\n\t{\t\t\n \t$value = str_replace(',', '.', $value);\n \t\n\t if(is_numeric($value) && !empty($value)) {\n return true;\n\t }\n\t\t\n\t echo \"value numerique\" . $value;exit;\n\t \n\t $this->_error( self::INVALID_SYNTAX );\n\t\treturn false;\n\t}", "protected function validateNumber($value){\n\t\treturn is_numeric($value);\n\t}", "function fn_validate_cc_number($number, $show_error = false)\n{\n if (empty($number)) {\n return false;\n }\n\n $number = str_replace(array('-',' '), '', $number);\n\n if (preg_match('/^([?0-9]{13,19}|[?*\\d]+)$/', $number)) {\n return true;\n } elseif ($show_error) {\n fn_set_notification('E', __('error'), __('text_not_valid_cc_number', array(\n '[cc_number]' => $number\n )));\n }\n\n return false;\n}", "public function numbers_only($value)\n{\n //return preg_match('/^([0-9]+)$/', $value);\n return ctype_digit(strval($value));\n}", "function isValidNumber($variable){\n\t\tif(preg_replace(\"/^(\\+|\\-)?[0-9]+$/\", '', $variable) !== '')\n\t\t\treturn false;\n\t\treturn true;\n\t}", "public function valid_cc_number($number)\n\t{\n\t\t// is the number in the correct format?\n\t\t$valid_format = FALSE;\n\t\tif(ereg(\"^5[1-5][0-9]{14}$\", $number)) // mastercard\n\t\t{\n\t\t\t$valid_format = TRUE;\n\t\t}\n\t\telseif(ereg(\"^4[0-9]{12}([0-9]{3})?$\", $number)) // visa\n\t\t{\n\t\t\t$valid_format = TRUE;\n\t\t}\n\t\t// will add others as needed\n\t\n\t\t// is the number valid?\n\t\t$card_number = strrev($number);\n\t\t$num_sum = 0;\n\t\t\n\t\tfor($i=0; $i < strlen($card_number); $i++)\n\t\t{\n\t\t\t$current_num = substr($card_number, $i, 1);\n\t\t\t\n\t\t\t// double every second digit\n\t\t\tif($i%2 == 1)\n\t\t\t{\n\t\t\t\t$current_num *= 2;\n\t\t\t}\n\t\t\t\n\t\t\t// add digits of 2-digit numbers together\n\t\t\tif($current_num > 9)\n\t\t\t{\n\t\t\t\t$first_num = $current_num % 10;\n\t\t\t\t$second_num = ($current_num - $first_num) / 10;\n\t\t\t\t$current_num = $first_num + $second_num;\n\t\t\t}\n\t\t\t\n\t\t\t$num_sum += $current_num;\n\t\t}\n\t\t\n\t\t// if the total has no remainder it's OK\n\t\t$pass_check = ($num_sum % 10 == 0);\n\t\t\n\t\tif($valid_format && $pass_check)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "private function test_number($value)\r\n {\r\n $value = str_replace(',', '.', $value);\r\n return is_numeric($value);\r\n }", "public function isValid($number);", "function is_valid_bank_card_number($number)\n{\n if (is_null($number) || strlen($number) < 16 || strlen($number) > 19)\n {\n return false;\n }\n $pattern = \"/^\\d{16,19}$/\";\n return (preg_match($pattern, $number) == 1);\n}", "function is_valid_ssn($ssn)\n{\n if(is_null($ssn) || strlen($ssn) != 18)\n {\n return false;\n }\n $pattern = \"/^[1-8][0-7]\\d{4}(19|20)\\d{2}(0[1-9]|1(0|1|2))(0[1-9]|(1|2)\\d|3(0|1))\\d{3}(\\d|x)$/i\";\n return preg_match($pattern, $ssn) == 1;\n}", "public function validate($value)\n {\n $value = preg_replace('/[^\\d]/', '', (string) $value);\n if (strlen($value) != 11 ) {\n return false;\n }\n $acumulado = 0;\n $digits = str_split($value);\n\n // obtain digit\n $digit = array_pop($digits);\n\n for ($i=0; $i < count($digits); $i++ ) {\n $acumulado += $digits[9-$i] * (2 + ($i % 6 ));\n }\n $verif = 11 - ( $acumulado % 11 );\n $verif = $verif == 11? 0 : $verif;\n\n return $digit == $verif;\n }", "function input_number_is_valid( $number ) {\n\t\treturn ( is_numeric( $number ) && $number > 0 );\n\t}", "protected function _isValidNotation($number) {\n $invalidNotations = array(\"00310\", \"0310\", \"310\", \"31\");\n foreach($invalidNotations as $invalid) {\n if( strpos( substr( $number, 0, 6 ), $invalid ) !== false ) {\n $valid = substr($invalid, 0, -1);\n if (substr($valid, 0, 2) == '31') { \n $valid = \"00\" . $valid;\n }\n if (substr($valid, 0, 2) == '03') { \n $valid = \"0\" . $valid;\n }\n if ($valid == '3'){ \n $valid = \"0\" . $valid . \"1\";\n }\n $number = str_replace($invalid, $valid, $number);\n }\n }\n return $number;\n }", "function validate_phone($phone)\n{\n $filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);\n // Check the lenght of number\n // This can be customized if you want phone number from a specific country\n if (strlen($filtered_phone_number) != 12) {\n return false;\n } else {\n return true;\n }\n}", "function validaAlfaNum ($Cad) {\n// prueba si la entrada es una cadena alfanumerica\nreturn preg_match(\"/^[a-z 0-9]*$/i\", $Cad );\n}", "static function isANumber($value) {\n // check whether the integer value has the same length like the entered string\n return is_numeric($value) && strlen(intval($value)) == strlen($value);\n }", "function tc_sanitize_number( $value) {\r\n $value = esc_attr( $value); // clean input\r\n $value = (int) $value; // Force the value into integer type.\r\n return ( 0 < $value ) ? $value : null;\r\n }", "public function check()\n {\n return ctype_digit($this->value);\n }", "public function testValidateStringNumber(): void\n {\n $this->assertFalse($this->validate('1'));\n }", "function validate_phone($input) {\n // Possible formats: (408) 375-2798, 408-375-2798, 408 375 2798, 4083752798, 408.375.2798\n\n if(preg_match(\"/^[(]?[0-9]{3}[)]?[.\\s-]?[0-9]{3}[.\\s-]?[0-9]{4}$/\",$input)){\n return true;\n }\n \n return false;\n}", "function isValidSSN($ssn) {\n if (!preg_match(\"/\\b(((20)((0[0-9])|(1[0-8])))|(([1][^0-8])\\d{2}))((0[1-9])|1[0-2])((0[1-9])|(1[0-9])|(2[0-9])|(3[0-1]))[-]?\\d{4}?\\b/\", $ssn)) {\n return false;\n } else {\n $year = substr($ssn, 0, 4);\n $month = substr($ssn, 4, 2);\n $date = substr($ssn, 6, 2);\n\n return checkdate($month, $date, $year);\n }\n}", "protected function isValidCommonNotation($value){\n\t\treturn preg_match('/^-?\\d+(\\.\\d+)?$/', $value);\n\t}", "public function isValid($value)\r\n {\r\n $response = parent::isValid($value);\r\n if (!$response)\r\n {\r\n $this->_messages =\r\n array(self::INVALID => \"El valor debe ser un número entero\");\r\n }\r\n return $response;\r\n }", "private static function validate_number(&$phone)\n\t{\n\t\tif (substr($phone, 0, 1) == '+') {\n\t\t\t$phone = substr($phone, 1);\n\t\t}\n\n\n\t\tif (is_numeric($phone)) {\n\n\t\t\t// test if there's a 1 prepended.\n\t\t\tif (strlen($phone) === 11 && $phone[0] == 1) {\n\t\t\t\t//pop 1 off. \n\t\t\t\t$phone = substr($phone, 1);\n\t\t\t\treturn true;\n\n\t\t\t} elseif (strlen($phone) === 10) {\n\t\t\t\t// it's a 10 digit number... I guess that works.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// is invalid if no return by here. \n\t\treturn false;\n\t}", "function formIsCreditNumber( $number ) { \r\n \r\n $tmp = $number; \r\n $number = preg_replace( \"/[^0-9]/\", \"\", $tmp ); \r\n\r\n if ( preg_match( \"/[^\\d\\s]/\", $number ) ) return 0; \r\n if ( strlen($number) < 13 && 0+$number ) return 0; \r\n\r\n for ($i = 0; $i < strlen($number) - 1; $i++) { \r\n $weight = substr($number, -1 * ($i + 2), 1) * (2 - ($i % 2)); \r\n $sum += (($weight < 10) ? $weight : ($weight - 9)); \r\n } \r\n\r\n if ( substr($number, -1) == (10 - $sum % 10) % 10 ) return $number; \r\n return $number; \r\n}", "function checkPhoneNumberPattern($value): string\r\n{\r\n if (is_numeric($value) && strlen($value) === 10) {\r\n return 'this is a correct phone number';\r\n } else {\r\n return 'this is NOT a correct phone number';\r\n }\r\n}", "public static function _number($value, $field) {\n\t\treturn (bool)preg_match('/^-?[0-9]+(\\.[0-9]+)?$/', $value);\n\t}", "function phone_validation($num)\n{\n return preg_match(\"/^[0-9]+$/\", $num);\n}", "private function hasNumber(): bool\n {\n if (1 == preg_match('/\\d/', $this->password)) {\n return true;\n }\n array_push($this->errorMessages, \"Number missing.\");\n return false;\n }", "function sNumber( $value )\r\n\t\t{\r\n\t\t\t#return filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT); // float\r\n\t\t\treturn filter_var( $value, FILTER_SANITIZE_NUMBER_INT ); # int\r\n\t\t\t\r\n\t\t}", "function validateNumber ( $validatedValue, $stringName ) {\n\tif ( !is_numeric ( $validatedValue ) ) {\n\t\techo \"<script>alert('$stringName should be a number!!!!')</script>\";\n\t\texit ();\n\t} else if ( $validatedValue < 0 ) {\n\t\techo \"<script>alert('$stringName should be greater or equal 0!!!!')</script>\";\n\t\texit ();\n\t}\n}", "function isLegalPhoneNum($test)\n{\n\tif(preg_match(\"/^\\([0-9]{3}\\) [0-9]{4}-[0-9]{4}$/\", $test))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "function validate_phone_format($phone) {\n if (preg_match('/^[+]?([\\d]{0,3})?[\\(\\.\\-\\s]?([\\d]{3})[\\)\\.\\-\\s]*([\\d]{3})[\\.\\-\\s]?([\\d]{4})$/',$phone, $number)) {\n \t$number = $number[2] . '-' . $number[3] . '-' . $number[4];\n\t\treturn $number;\n } else return FALSE;\n}", "private function verifyByLuhnAlgorithm($number){ }", "function vUSPhone( $phoneNo )\r\n\t\t{\r\n\t\t\t# Checks if number has dashes\r\n\t\t\tif( strpos( $phoneNo,'-' ) )\r\n\t\t\t\treturn preg_match('/\\(?\\d{3}\\)?[-\\s.]?\\d{3}[-\\s.]\\d{4}/x', $phoneNo);\r\n\t\t\t\t\r\n\t\t\t# Checks if number has periods\r\n\t\t\telseif( strpos( $phoneNo,'.' ) )\r\n\t\t\t\treturn preg_match('/\\(?\\d{3}\\)?[.]?\\d{3}[.]\\d{4}/x', $phoneNo);\r\n\t\t\t\r\n\t\t\t# Validate just numbers\t\r\n\t\t\telse\r\n\t\t\t\treturn preg_match('/\\(?\\d{3}\\)?\\d{3}\\d{4}/x', $phoneNo);\r\n\t\t\t\r\n\t\t}", "function checkNum($number) {\n if($number>50) {\n throw new Exception(\" Tavë Kosi has been known for 90 years in Albanian cuisine.\");\n }\n return true;\n}", "public static function validate_numeric_integer_or_decimal_values($val) { // {{{SYNC-DETECT-PURE-NUMERIC-INT-OR-DECIMAL-VALUES}}}\n\t//--\n\t$val = (string) $val; // do not use TRIM as it may strip out null or weird characters that may inject security issues if not trimmed outside (MUST VALIDATE THE REAL STRING !!!)\n\t//--\n\t$regex_decimal = (string) self::regex_stringvalidation_expression('number-decimal', 'full');\n\t//--\n\tif(((string)$val != '') AND (is_numeric($val)) AND (preg_match((string)$regex_decimal, (string)$val))) { // detect numbers: 0..9 - .\n\t\treturn true; // VALID\n\t} else {\n\t\treturn false; // NOT VALID\n\t} //end if else\n\t//--\n}", "function secMinFormat ($value){\n \n if(!preg_match(VALID_SEC_MIN_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "function validPhone($phone)\r\n {\r\n return strlen((string)$phone) == 10 && is_numeric($phone);\r\n }", "function validate_phone_number($phone)\n\t\t{\n\t\t\t// Allow +, - and . in phone number\n\t\t\t$filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);\n\t\t\t// Remove \"-\" from number\n\t\t\t$phone_to_check = str_replace(\"-\", \"\", $filtered_phone_number);\n\t\t\t// Check the lenght of number\n\t\t\t// This can be customized if you want phone number from a specific country\n\t\t\tif (strlen($phone_to_check) < 9 || strlen($phone_to_check) > 14) {\n\t\t\treturn false;\n\t\t\t} else {\n\t\t\treturn true;\n\t\t\t}\n\t\t}", "function checkValidLine_Y6051($acct){\r\n\t\t\tif( strlen($acct)==9 && is_numeric($acct) ){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t}", "public function validate($value)\n {\n return is_numeric($value);\n }", "function strNumValid($val = '',$type = 's', $min_len = 0) {\r\n if(!empty($val)) {\r\n\t\tif(strlen($val)>=$min_len) {\r\n\t\t\tif($type == 'n' && ctype_digit($val)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse if($type == 's' && is_string($val) && !ctype_digit($val)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse return false;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function sanitize_numbers($value)\n{\n return filter_var($value, FILTER_SANITIZE_NUMBER_INT);\n}", "function isValid($value = null)\n {\n if(is_numeric($value)){\n return true;\n }\n\n $this->errorFound();\n\n return false;\n }", "function buzzer_sms_number_validate($element, &$form_state, $form) {\n if ($number = twilio_validate_number($element['#value'], TRUE)) {\n $form_state['values']['buzzer_sms_number'] = $number;\n }\n else {\n form_error($element, t('You must enter a valid 10 digit phone number'));\n }\n}", "protected function isValidValue($value): bool\n\t{\n\t\treturn is_numeric($value) === true;\n\t}", "public static function validate_number($number){\r\n if(!preg_match('/^[0-9]*$/', $number)) return FALSE;\r\n return TRUE;\r\n }", "function validarFlotante ($Cad) {\n// prueba si la entrada es un numero de punto flotante, con un signo opcional\nreturn preg_match(\"/^-?([0-9])+([\\.|,]([0-9])*)?$/\", $Cad );\n}", "private function validate_isrc($value)\n\t{\n\t\tif (strlen(trim($value)) == 12) {\n\t\t\treturn 1; /* valid */\n\t\t}\n\t\telse {\n\t\t\treturn 0; /* invalid */\n\t\t}\n\t}", "public function validateNumberValue($value)\n {\n if (null === $this->delimiter) {\n $parts = str_split($value);\n } else {\n $parts = explode($this->delimiter, $value);\n }\n\n foreach ($parts as $numberSymbol) {\n if (!$this->containsSymbol($numberSymbol)) {\n throw new NumberParseException($value, $numberSymbol);\n }\n }\n\n return true;\n }", "function isValidPhoneNumber(string $phoneNumber): bool{\n return !!preg_match('#\\(\\d{3}\\) \\d{3}-\\d{4}#', $phoneNumber);\n}", "function validateAmount($amount)\n{ \n return is_numeric($amount) && $amount > 0;\n}", "static public function is_num($value) {\n\t\treturn preg_match(\"/^-?[0-9]+\\.?[0-9]*$/\",$value);\n\t}", "protected function validateDigits($value){\n\t\treturn filter_var($value, FILTER_VALIDATE_INT) !== false;\n\t}", "public static function ValidateOrganizationNumber($strNum) {\n\t\t\tswitch (QApplication::$CountryCode) {\n\t\t\t\tcase 'se':\n\t\t\t\t\tif ( preg_match('/^(16)??[0-9]{2}[2-9][0-9]{3}-?[0-9]{4}$/', $strNum) && \n\t\t\t\t\t\t ( $strNum{6} == '-' ? Math::Modulo10Validate(substr($strNum, 0, 6) . substr($strNum, 7)) : Math::Modulo10Validate($strNum) ))\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "function validate($phoneNumber)\n {\n // Let's fix issue of V2: we remove spaces for validation.\n $phoneNumber = str_replace(' ', '', $phoneNumber);\n\n return strlen($phoneNumber) == 10 && is_numeric($phoneNumber);\n }", "function IsNumberType($type)\n{\n\tif($type==20 || $type==14 || $type==5 || $type==10 || $type==6 \n\t|| $type==3 || $type==131 || $type==4 || $type==2 || $type==16\n\t|| $type==21 || $type==19 || $type==18 || $type==17 || $type==139\n\t|| $type==11)\n\t\treturn true;\n\treturn false;\n}", "public function sanitizeNumber($data){\n $data = filter_var($data, FILTER_SANITIZE_NUMBER_INT);\n return $data;\n }", "protected function validateCardNumber($params) {\n\t\t$cardNumber = $params['sg_CardNumber'];\n\n\t\tif ($cardNumber <> $this->cleanCardNumber($cardNumber)) {\n\t\t\tthrow new CardNumberException(\"Card number is not pre-processed\");\n\t\t}\n\n\t\t$cardLength = strlen($cardNumber); \n\n\t\tif ($cardLength < SafechargeConstants::CARD_NUMBER_MIN_LENGTH) {\n\t\t\tthrow new CardNumberException(\"Card number is too short\");\n\t\t}\n\n\t\tif ($cardLength > SafechargeConstants::CARD_NUMBER_MAX_LENGTH) {\n\t\t\tthrow new CardNumberException(\"Card number is too long\");\n\t\t}\n\n\t\t/* Credit card LUHN checker - coded '05 shaman - www.planzero.org *\n\t\t * This code has been released into the public domain, however please *\n\t\t * give credit to the original author where possible. */\n\t\t$parity = $cardLength % 2;\n\t\t$sum = 0;\n\t\tfor ($i = 0; $i < $cardLength; $i++) { \n\t\t\t$digit = $cardNumber[$i];\n\t\t\tif ($i % 2 == $parity) $digit = $digit * 2; \n\t\t\tif ($digit > 9) $digit = $digit - 9; \n\t\t\t$sum = $sum + $digit;\n\t\t}\n\t\t$valid = ($sum % 10 == 0) ? true : false; \n\n\t\tif (!$valid) {\n\t\t\tthrow new CardNumberException(\"Invalid checksum\");\n\t\t}\n\t}", "public static function validateNationalIdNumber($input)\n {\n $input = trim($input);\n $prepared_input = preg_replace(\"^\\\\s^\", \"\", $input);\n if ((preg_match(\"[^\\\\d{2}-?\\\\d{6,7}-?[A-Za-z]{1}-?\\\\d{2}$]\", $prepared_input) == FALSE) || strlen($prepared_input) < 12 || strlen($prepared_input) > 16) {\n return FALSE;\n } else {\n return TRUE;\n }\n }", "private function checkPhone($data) {\n\t\t$data = trim(str_replace(\" \", \"\", $data)); // Remove spaces: \"+1 (212) 555 1337\" ->\"+1(212)5551337\"\n\t\tif(substr($data,0,1)==\"+\") {$data = substr($data,1);} // Remove plus: \"1(212)5551337\"\n\t\t$data = str_replace(\"(\",\"\",$data);\t\t// Remove start parenthesis: \"1212)5551337\"\n\t\t$data = str_replace(\")\",\"\",$data);\t\t// Remove end parenthesis: \"12125551337\"\n\t\tif(is_numeric($data)) {return true;}\t// If it is numeric now, it is a valid phone number\n\t\treturn false;\n\t}", "function isnumincorrect($str = null){\n if ($str) {\n if (strlen($str)==13) \n if (($str[0]==\"+\") && ($str[1]==6) && ($str[2]==3) && ($str[3]==9)){\n echo \"is valid<br>\";\n return false;\n }else{\n echo \"input is Incorrect Number or Incorrect Format<br>\";\n return true;\n }else{\n echo \"input is Incorrect format<br>\";\n return true;\n }\n }\n}", "function comprobarTelefono($telefono){\r\n if(!preg_match(\"/^[0-9]{9}$/\", $telefono)){\r\n return false;\r\n }\r\n return true;\r\n}", "function ssn($ssn)\n {\n if (!preg_match(\"/^\\d{9}$/\", $ssn)) return false;\n\n $weights = array(3, 7);\n $sum = 0;\n for ($i = 0; $i<8; $i++) {\n $sum += $weights[$i % 2] * intval(substr($ssn, $i, 1));\n }\n return substr($ssn, 8, 1) == ($sum % 10);\n }", "public static function validInput($number)\r\n {\r\n return is_string($number) || is_int($number);\r\n }", "public function testSsn() {\n $this->assertEquals('998-29-3841', Format::ssn('998293841'));\n }", "function gradiLatFormat ($value){\n \n if(!preg_match(VALID_GRADI_LAT_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "function sexFormat ($value){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match(VALID_SEX_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "function validateNatural($value){\n if(!preg_match('/^[0-9]{1,}$/', $value)){\n return false; \n }\n else{\n return true; \n } \n}", "public static function isValueValid($value) : bool\n {\n if (! is_float($value)) {\n return false;\n }\n \n if ($value < -90. || $value > 90.) {\n return false;\n }\n \n // $digits = explode(\".\", (string)(float)$value);\n // var_dump($digits[1] ?? '');\n \n return true;\n }", "function isNumber($value){\n \n if (!preg_match('/^[0-9]+(\\\\.[0-9]+)?$/', $value)){\n \n header(\"Location: ..\\Graduate_form.html?error=\"); \n \n }else{\n return $value; \n }\n}", "function validate_phone_number($phone)\n{\n // $filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);\n // Remove \"-\" and \"+\" from number\n $bad = array(\" \", \"-\", \"+\");\n $phone_to_check = str_replace($bad, \"\", $phone);\n\n // echo $phone_to_check.\"<br>\";\n // Check the lenght of number\n // This can be customized if you want phone number from a specific country\n // $regex = '/^[0-9]+$/';\n if (!filter_var($phone_to_check, FILTER_VALIDATE_INT)) {\n // echo('stringfdssssssssss');\n // die;\n return array('valid' => false, \"msg\" => \"must contain digits 0-9 only.\");\n } elseif (strlen($phone_to_check) < 10 || strlen($phone_to_check) > 14) {\n return array('valid' => false, \"msg\" => \"must be between 10 and 14 digits.\");\n } else {\n return array('valid' => true, \"msg\" => \"\");\n }\n}", "function checkPhoneNumber($telefono): bool {\n return is_string($telefono) and preg_match(\"/^([+][0-9]{1,3})?[0-9]{4,13}$/\", $telefono);\n}", "public function testValidateNumber(): void\n {\n $this->assertTrue($this->validate(1));\n }", "public static function isValid($value) : bool {\n\t\t\treturn (is_string($value) && preg_match('/^([a-zA-Z]){4}([a-zA-Z]){2}([0-9a-zA-Z]){2}([0-9a-zA-Z]{3})?$/', $value));\n\t\t}", "function phoneNum($value) {\n\t$reg = \"/^\\([1-9]\\d{2}\\)\\s?\\d{3}\\-\\d{4}$/\";\n\treturn preg_match($reg,$value);\n}", "static public function is_signed($value) {\n\t\treturn !preg_match(\"/[^0-9]/\",$value);\n\t}", "private function validate()\n {\n if (! is_numeric($this->number)) {\n throw new \\InvalidArgumentException(\"Invalid numeric value provided ($this->number).\");\n }\n }", "function validaEnteroConSigno ($Cad) {\n// prueba si la entrada es un entero, con un signo opcional\nreturn preg_match(\"/^-?([0-9])+$/\", $Cad );\n}", "function validarnumero($numero){ \nif($numero=='0'){\n\t\n}else{\n\tif(is_numeric($numero)) {\n //si es un numero no dice nada\n } else {\n return TRUE;\n }\n}\n \n}", "public function testRegistrationValuesContainNumbers(): void { }", "public function is_number($num){\t\t\n\t\tif(!empty($num)){\n\t\t\tif(!ctype_digit($num)){\n\t\t\t\treturn true;\n\t\t\t}\n \t}\n }", "function valid_gsm_no($mobile,$formating=0)\n//Check whether a given no. is valid gsm no. or not.\n{\n\tif($formating)\n\t{\n\t\tif(strlen($mobile)==10)\n\t\t\t$mobile='91'.$mobile;\n\t}\n\tif( strlen($mobile)!=12 || !(ctype_digit($mobile)) )\n\t\treturn 0;\n\telse\n\t{\n\t\tif((substr($mobile,2,2)=='94' or substr($mobile,2,2)=='96' or substr($mobile,2,2)=='97' or substr($mobile,2,2)=='98' or substr($mobile,2,2)=='99'))\n return 1;\n\t}\n\treturn 0;\n}", "function gradiLngFormat ($value){\n \n if(!preg_match(VALID_GRADI_LNG_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "function isNum($s){return is_numeric($s) ? true : false;}", "function validate_is_number($field_input, array &$field): bool\n{\n if (!is_numeric($field_input)) {\n $field['error'] = 'Type in integer';\n return false;\n }\n return true;\n}", "function nickFormat ($value){\n \n if(!preg_match(VALID_NICK_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "protected function validatePhone(string $identifier, mixed $value): bool\n {\n $invalid = ['+', '-', '_', '.', '(', ')'];\n $filtered = filter_var($value, FILTER_SANITIZE_NUMBER_INT);\n\n foreach($invalid as $character){\n $filtered = str_replace($character, '', $filtered);\n }\n\n return strlen($filtered) > 7 && strlen($filtered) < 14;\n }", "function bankAccountNumber($number, $dashes = false)\n {\n $dash = $dashes ? \"-\" : \"\";\n if (!preg_match(\"/^\\d{8}\".$dash.\"\\d{8}(\".$dash.\"\\d{8})?$/\", $number)) {\n return false;\n }\n $number = preg_replace(\"/-|0{8}$/\", \"\", $number);\n $len = strlen($number);\n\n return \n Validate_HU::_checkCDV(substr($number, 0, 8)) &&\n (($len == 16 && Validate_HU::_checkCDV(substr($number, 8, 8))) ||\n ($len == 24 && Validate_HU::_checkCDV(substr($number, 8, 16))));\n }", "function mycheck_phone( $string ) {\n if ( preg_match( '/^[+]?([\\d]{0,3})?[\\(\\.\\-\\s]?([\\d]{3})[\\)\\.\\-\\s]*([\\d]{3})[\\.\\-\\s]?([\\d]{4})$/', $string ) ) {\n return TRUE;\n } else {\n return FALSE;\n }\n}", "function NeedQuotesNumeric($type)\n{\n if($type == 203 || $type == 8 || $type == 129 || $type == 130 || \n\t\t$type == 7 || $type == 133 || $type == 134 || $type == 135 ||\n\t\t$type == 201 || $type == 205 || $type == 200 || $type == 202 || $type==72 || $type==13)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function valid_number($num) {\r\nif(empty($num) || !is_numeric($num))\r\n return false ; \r\nelse {\r\n $num = intval($num) ; \r\n\tif($num <= 0) \r\n\t\treturn false ;\r\n }\r\n return true ; \r\n}", "function validPhone($phone)\n {\n //phone number should not be empty and can contain only numbers\n return !empty($phone) && filter_var($phone,FILTER_SANITIZE_NUMBER_INT);\n }", "function validateNumeric($string){\n\n\tif(preg_match(\"/^[0-9]{1,6}$/\",$string)){\n\n\t\t\treturn true;\n\t}\n\telse{\n\n\t\treturn false;\n\t}\n\n}", "public function testFormat($chaine)\n {\n if (preg_match(\"#[0-9]{10}$#\", $chaine)) {\n return true;\n } else {\n return false;\n }\n }" ]
[ "0.6689423", "0.6681912", "0.6621274", "0.6613025", "0.6588595", "0.65344244", "0.64867073", "0.6485015", "0.64309436", "0.6422654", "0.6421177", "0.6415176", "0.6403601", "0.6402164", "0.638611", "0.6364938", "0.631045", "0.6274892", "0.625382", "0.62535036", "0.6248594", "0.62437844", "0.62086457", "0.61858976", "0.61849004", "0.615657", "0.61443067", "0.6138625", "0.6137387", "0.6135345", "0.612609", "0.6110345", "0.61048824", "0.6102416", "0.6098729", "0.6097732", "0.6092865", "0.6081143", "0.6076397", "0.6062931", "0.60548073", "0.60362744", "0.6034151", "0.6013983", "0.6006471", "0.60045236", "0.59984016", "0.5992531", "0.59897405", "0.59847194", "0.5975845", "0.5970457", "0.5970153", "0.5966195", "0.5954244", "0.59212625", "0.59145194", "0.5891927", "0.5890696", "0.588109", "0.5875985", "0.5873148", "0.5872853", "0.58724326", "0.5868825", "0.5865585", "0.58526057", "0.58405215", "0.583553", "0.58353496", "0.5834629", "0.58339316", "0.58310163", "0.58298194", "0.5825965", "0.5824228", "0.5813338", "0.58073324", "0.5806243", "0.58061993", "0.5805247", "0.57987994", "0.5777331", "0.57720876", "0.57583755", "0.5739989", "0.5736918", "0.5731156", "0.5727863", "0.5717688", "0.57094926", "0.57078093", "0.57074773", "0.5707209", "0.570649", "0.5691935", "0.5686999", "0.5686531", "0.5685642", "0.5677829", "0.5668329" ]
0.0
-1
======== public functions ========= / to construct object of the class
public function __construct() { // Register the Destructor to be called // This is needed in case of Abnormal termination of script caused by FATAL error // in which case, the object destructor is not called register_shutdown_function(array(&$this, "__destruct")); return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function construct()\n\t\t{\n\t\t}", "function _construct() {\n \t\n\t\t\n\t}", "function _construct(){ }", "public function construct() {\n\n }", "function __constructor(){}", "public function fn_construct_class() {\n\t}", "protected function construct(){\n\n }", "function __construct() ;", "public function _construct()\n\t{\n\n\t}", "private function __construct()\t{}", "function __construct(){\n\t\t// nowt much...\n\t}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "protected abstract function __construct();", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "final private function __construct() {}", "final private function __construct() {}", "public function __CONSTRUCT(){\n\t}", "private function __construct() { \n\t\t\n\n\t}", "final private function __construct() {\n\t\t\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private final function __construct() {}", "private function __construct() {\r\n\t\r\n\t}" ]
[ "0.8545809", "0.85284656", "0.8475179", "0.8348304", "0.8105496", "0.8029864", "0.80029976", "0.7986517", "0.79752797", "0.7912979", "0.79049337", "0.78876925", "0.78876925", "0.78876925", "0.78876925", "0.78876925", "0.78876925", "0.78729856", "0.7871186", "0.7871186", "0.7871186", "0.7871186", "0.7871186", "0.7871186", "0.7871186", "0.7871186", "0.7871186", "0.7871186", "0.7871186", "0.7871186", "0.7871186", "0.7871186", "0.7871186", "0.7871186", "0.7871186", "0.7862128", "0.7862128", "0.7859699", "0.78570443", "0.78565216", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.78332806", "0.7832267", "0.7832267", "0.7832054", "0.7828428", "0.782514" ]
0.0
-1
/ to unset/release/destroy varibales/resources/objects used by the class
public function __destruct() { // debug trace on function entry if( $this->vDebugTraceFlag == 1 ) tlibphp_debug_trace_func ( __METHOD__."<BR>\n" ); // return call status as VOID return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __destruct()\n {\n $vars = get_object_vars($this);\n if (is_array($vars)) {\n foreach ($vars as $key => $val) {\n $this->$key = null;\n }\n }\n\n parent::__destruct();\n }", "protected function __del__() { }", "public function __destruct()\n\t{\n\t\t$this->db = null;\n\t\t$this->cat_data = false;\n\t\t$this->settings = null;\n\t}", "function __destruct() {\n if ($this->var) {\n com_release($this->var);\n $this->var= NULL;\n }\n }", "protected function tear_down()\n {\n unset($this->_object, $this->_view);\n }", "function destructor()\n\t{\n\t\tunset($Resources,$FileName,$FileType,$FileSize,$NumRes,$FileVersion,$Description,$DataOffset);\n\t}", "public function __destruct()\n {\n unset($this->vars);\n }", "function __destruct(){\n unset($this->charset);\n foreach (get_object_vars($this) as $prop => $val) {\n if ($prop != null) {\n unset($this->{$prop});\n }\n }\n }", "public function __destruct() {\n\t\t\tparent::__destruct();\n\t\t\tunset($this->resource);\n\t\t\tunset($this->methods);\n\t\t\tunset($this->name);\n\t\t}", "function __destroy() {\n }", "public function __destruct()\n\t{\n\t\tunset($this -> arrNewData);\n\t\tunset($this -> arrOldData);\n\t\tunset($this -> isCheckModify);\n\t\tunset($this -> tableName);\n\t\tunset($this -> databaseName);\n\t\t\t\n\t}", "public function __destruct() {\n\t\t\tparent::__destruct();\n\t\t\tunset($this->metadata);\n\t\t\tunset($this->models);\n\t\t\tunset($this->translators);\n\t\t}", "public function __destruct(){unset($this);}", "function __destruct(){}", "public function __destruct(){}", "public function __destruct(){}", "public function __destruct(){}", "Function __destruct(){\n\t\t$this->unload();\n\t}", "function __destruct() {\r\n\t}", "function __destruct() {\r\n\t}", "public function __destruct() {\n\t\t\tparent::__destruct();\n\t\t\tunset($this->info);\n\t\t\tunset($this->name);\n\t\t\tunset($this->value);\n\t\t}", "function __destruct() {\r\n $this->Initialize();\r\n }", "public function __destruct() {\n\t\tforeach ($this as $index => $value) unset($this->$index);\n\t}", "function destroy()\n\t{\n\t\t$this->_tpldata = array('.' => array(0 => array()));\n\t\t$this->vars = &$this->_tpldata['.'][0];\n\t\t$this->xs_started = 0;\n\t}", "private function _destruct()\r\n {\r\n $this->table = null;\r\n $this->select = null;\r\n $this->fields = null;\r\n $this->where = null;\r\n $this->ar_where = null;\r\n }", "function __destruct(){\n\n\t}", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "function __destruct() {\r\n\t\t//\r\n\t}", "public function __destruct()\n {\n foreach ($this as $key => $value) {\n unset($this->$key);\n }\n }", "function __destruct() {}", "function __destruct() {}", "public function __destruct() {\n unset($this->_pidManager);\n unset($this->_pidFile);\n unset($this->_ipc);\n unset($this->_tasks);\n }", "function __destruct(){\n\t}", "function __destruct()\n {\n unset($this->parent);\n unset($this->sz);\n }", "function __destruct()\n {\n }", "function __destruct()\n {\n }", "function __destruct()\n {\n }", "function __destruct() {\n }", "function __destruct() {\n }", "function __destruct() {\n }", "function __destruct(){\n\n }", "public function __destruct()\n {\n $this->clear();\n }", "public function __destruct()\n {\n $this->clear();\n }", "private function __destruct() {}", "public function __destruct(){\n\t\tunset($this->user);\n\t\tunset($this->gid);\n\t}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "public function __destruct() {}", "function __destruct()\r\t{\r\t}", "public function __destruct(){ }", "public function __destruct()\n {\n $this->console('init BaseRepository __destruct');\n $this->recycleResource();\n }", "function __destruct() {\n\n }", "public function __destruct() {\n\t\t$this->clean();\n\t}", "public function __destruct()\n {\n unset($this->idDetalleOrden);\n unset($this->valorInventario);\n unset($this->valorVenta);\n unset($this->cantidad);\n unset($this->idOrden);\n unset($this->idProducto);\n unset($this->estado);\n unset($this->fechaCreacion);\n unset($this->fechaModificacion);\n unset($this->idUsuarioCreacion);\n unset($this->idUsuarioModificacion);\n unset($this->conn);\n }", "public function __destruct() {\n\t\t\tparent::__destruct();\n\t\t\tunset($this->data);\n\t\t\tunset($this->file);\n\t\t\tunset($this->image);\n\t\t\tunset($this->uri);\n\t\t}", "public function __destruct() {\n\t\tunset ( $this );\n\t}", "function __destruct(){\n }", "public function __destruct() { }", "public function __destruct() { }", "public function __destruct() { }", "function __destruct()\n\t{\n\t\t// If has data to cache\n\t\tif($this->language != NULL && $this->cache_time > 0)\n\t\t{\n\t\t\t$codeigniter =& get_instance();\n\t\t\t// If cache not available then create cache from data\n\t\t\t$cache = $codeigniter->cache->file->get(md5($this->language).'.Settings');\n\t\t\tif($cache == FALSE)\n\t\t\t{\n\t\t\t\t$codeigniter->benchmark->mark('Model\\Data\\Settings_class___destruct_start');\n\t\t\t\t$codeigniter->cache->file->save(md5($this->language).'.Settings', serialize($this), $this->cache_time);\n\t\t\t\t$codeigniter->benchmark->mark('Model\\Data\\Settings_class___destruct_end');\n\t\t\t}\n\t\t}\n \t}", "public function __destruct();", "public function __destruct();", "public function __destruct()\n\t{\n\t\t$this->tree = false;\n\t\t$this->current_category = false;\n\t\t$this->tree_steped_item = false;\n\t\t$this->tree_items = 0;\n\t\t$this->walk_step = 0;\n\t\t$this->parent_data = false;\n\t}", "function __destruct()\n\t{\n\t\t\n\t\t\n\t}", "public function __destruct() {\n\t\t\n\t}", "public function tear_down() {\n\t\t$this->registry = null;\n\n\t\tparent::tear_down();\n\t}", "function __destruct()\n {\n }", "function __destruct()\n {\n }", "function __destruct()\n {\n }", "public function __destruct() {\r\n\t}", "public function __destruct() {\n\n\t}", "abstract protected function _destroy();", "public function __destruct() {\r\n unset( $this );\r\n }", "function __destruct()\n {\n \n }", "public function __destruct() {\n\t\t$this->user->delete();\n\t\t$this->user2->delete();\n\t\t$this->apikey->delete();\n\t\telgg_set_ignore_access($this->ia);\n\t\t// all __destruct() code should go above here\n\t\tparent::__destruct();\n\t}", "public function __destruct() {\n\t\t\tparent::__destruct();\n\t\t\tunset($this->after);\n\t\t\tunset($this->before);\n\t\t\tunset($this->builder);\n\t\t\tunset($this->data_source);\n\t\t}", "public function __destruct() {\n\t}", "public function __destruct() {\n\t}", "function destroy() ;", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }" ]
[ "0.7043474", "0.69609374", "0.6888887", "0.68639", "0.68632275", "0.68291247", "0.6774428", "0.67690074", "0.6729918", "0.6715911", "0.6659202", "0.664933", "0.663845", "0.66308254", "0.66252923", "0.66252923", "0.66252923", "0.6601448", "0.6581345", "0.6581345", "0.65788496", "0.6574035", "0.6559126", "0.6554498", "0.65479904", "0.6547294", "0.6532018", "0.6532018", "0.6532018", "0.6529579", "0.65223145", "0.65101475", "0.65101475", "0.6497846", "0.6493839", "0.648238", "0.6474692", "0.6474692", "0.6474692", "0.64684886", "0.64684886", "0.64684886", "0.64674777", "0.6461079", "0.6461079", "0.6455412", "0.64532584", "0.6447828", "0.6447828", "0.6447734", "0.6447734", "0.6447734", "0.6447734", "0.6447734", "0.6447734", "0.6447734", "0.6447734", "0.6447734", "0.6447734", "0.6447734", "0.6447734", "0.6447734", "0.6447734", "0.6447092", "0.64470166", "0.64453214", "0.6438657", "0.643749", "0.64338756", "0.6430644", "0.64302105", "0.6429814", "0.64256173", "0.6406165", "0.6406165", "0.6406165", "0.6395136", "0.63903934", "0.63903934", "0.63841265", "0.63824993", "0.6381335", "0.6380578", "0.6378734", "0.6378734", "0.6378734", "0.6372626", "0.63664544", "0.63663024", "0.63558614", "0.63529104", "0.6352125", "0.6348566", "0.6341665", "0.6341665", "0.6339914", "0.63263154", "0.63263154", "0.63263154", "0.63263154", "0.63263154" ]
0.0
-1
/ to initialize varibales/acquire resources/contruct & initialize objects required by the class
public function Initialize($pDbConn = 0, $pDebugTraceFlag = 0, $pCHCInstituteListStruct=null) { // debug trace on function entry if( $pDebugTraceFlag == 1 ) tlibphp_debug_trace_func ( __METHOD__."<BR>\n" ); $this->vDebugTraceFlag = $pDebugTraceFlag; $this->vDbConn = $pDbConn; $this->vResult = ''; $this->vRow = ''; $this->vCHCInstituteListStructObj = $pCHCInstituteListStruct; // return call status as success return 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function _init();", "abstract protected function _init();", "abstract public function init();", "public function _init() {}", "public function _init(){}", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract function init();", "abstract protected function initialize();", "abstract protected function initialize();", "abstract protected function initialize();", "abstract protected function initialize();", "abstract protected function initialize();", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n $this->staticDataConfigObj = new StaticDataConfig();\n \n }", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n $this->staticDataConfigObj = new StaticDataConfig();\n \n }", "abstract public function initialize();", "protected function initializeObject() {}", "abstract function initialize();", "protected abstract function init();", "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 initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n\n // Init dateTimeLibObj library object\n $this->dateTimeLibObj = new DateTimeLib();\n\n // Init StaticDataConfig model object\n $this->staticDataObj = new StaticDataConfig();\n }", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n\n // Init dateTimeLibObj library object\n $this->dateTimeLibObj = new DateTimeLib();\n\n // Init StaticDataConfig model object\n $this->staticDataObj = new StaticDataConfig();\n }", "final private function __construct()\n {\n \t$this->init();\n }", "public function early_init(){\n\t\t$this->db = new EMPS_MongoDB;\n\t\t$this->mdb = $this->mongodb->mdb;\n\t\t\n\t\t$this->p = new EMPS_Properties;\t\n\n\t\tif(!$this->fast){\n\t\t\t$this->auth = new EMPS_Auth;\t\t\t\n\t\t}\n\t}", "public static function init() {\n\n\t\t$class = new self();\n\t\t$class->setup();\n\n\t}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init(){}", "public function init(){}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n\n // Init General staticData Model Object\n $this->staticDataObj = new StaticData();\n }", "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}", "function __construct()\n\t{\n\t\t//$this->PaypalAdaptivePayments = Paypaladaptive::initialize();\n\t\t$this->paypal_transaction = Paypaladaptive::initializePaypalTransaction();\n\t\t$this->shop_order_obj = Webshoporder::initialize();\n\t\t$this->invoice_obj = Webshoporder::initializeInvoice();\n\t\t$this->product_obj = Products::initialize();\n\t\t$this->common_invoice_obj = Products::initializeCommonInvoice();\n\t\t$this->manage_credits_obj = Products::initializeManageCredits();\n\t}", "public function initialize(): void\n { \n $this->user = new User();\n $this->user->setDb($this->di->get(\"dbqb\"));\n $this->post = new Post();\n $this->post->setDb($this->di->get(\"dbqb\"));\n $this->topic = new Topic();\n $this->topic->setDb($this->di->get(\"dbqb\"));\n $this->tag2topic = new Tag2Topic();\n $this->tag2topic->setDb($this->di->get(\"dbqb\"));\n $this->gravatar = new Gravatar();\n $this->page = $this->di->get(\"page\");\n $this->session = $this->di->get(\"session\");\n $this->vote = new Vote();\n $this->vote->setDb($this->di->get(\"dbqb\"));\n $this->vote2topic = new Vote2Topic();\n $this->vote2topic->setDb($this->di->get(\"dbqb\"));\n }", "abstract protected function _init( );", "public abstract function initialise();", "abstract protected function _initialize();", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n\n // Init DateTime library object\n $this->dateTimeLibObj = new DateTimeLib();\n }", "protected function _init()\n {\n }", "public static function init()\n {\n self::$FOO = new self('FOO', 10);\n self::$BAR = new self('BAR', 20);\n }", "protected function _init()\r\n\t{\r\n\t}", "function _initialize()\n {\n\n //initalize Loader\n $auto_load=array(\"io\",\"segment\",\"router\");\n \n foreach($auto_load as $library)\n {\n $this->$library=& load_class($library);\n }\n //load loader class\n $this->load =& load_class('Loader');\n \n //call auto load from config file\n $this->load->_auto_load();\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 _init()\n {\n }", "function _construct() {\n \t\n\t\t\n\t}", "function __construct()\n\t{\n\t\t// within the class.\n\t\t(object)$this->db = new dbHelper();\n\t\t(object)$this->user = new User();\n\t\t(object)$this->patient = new Patient();\n\t\t(object)$this->enc = new Encounter();\n\t\treturn;\n\t}", "public function init()\n {\n $this->_Users = new Users();\n $this->_VotsTaula = new VotsTaula();\n $this->_Categories = new Categories();\n $this->_NoticiaTaula = new NoticiaTaula();\n $this->_ComentarisTaula = new ComentarisTaula();\n $this->_NoticiesFavoritas = new NoticiesFavoritas();\n $this->_Seguidors = new Seguidors();\n $this->_Contactar = new Contactar();\n $this->_Notificaciones = new Notificaciones();\n\n }", "public function __construct()\n {\n // Setup internal data arrays\n self::internals();\n }", "public function _init() {\r\n\r\n }", "public function _init_obj()\n {\n // dummy\n }", "public function __init(){}", "public function initialize() {\n\n $this->users = new \\Anax\\Users\\User();\n $this->users->setDI($this->di);\n $this->users->setTablePrefix('iproducer_');\n\n $this->comments = new \\Anax\\Comment\\Comment();\n $this->comments->setDI($this->di);\n $this->comments->setTablePrefix('iproducer_');\n\n $this->tags = new \\Anax\\Tags\\AssignTags();\n $this->tags->setDI($this->di);\n $this->tags->setTablePrefix('iproducer_');\n\n $this->assignTags = new \\Anax\\Tags\\AssignTags();\n $this->assignTags->setDI($this->di);\n $this->assignTags->setTablePrefix('iproducer_');\n\n $this->commentanswer = new \\Anax\\Comment\\CommentAnswer();\n $this->commentanswer->setDI($this->di);\n $this->commentanswer->setTablePrefix('iproducer_');\n }", "private function init() {\n // Set environment variables MUST BE DONE IN THIS ORDER!\n self::initDefaultFormValues(); // Assign default values to forms\n self::initTablePriorityHash();\n self::initTableTypePriorityHash();\n self::initTableHash(); // assign tables.\n self::initTableColumnsHash(); // assign hash with column details.\n #self::initSurveyHash(); // Assign Surveys TODO Place this back in when surveys are merged.\n self::initAstroFilterHash(); // Assign Filters\n self::initQualityFlags(); // assign hash with column details for all quality flag tables.\n }", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n }", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n }", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n }" ]
[ "0.7500184", "0.7500184", "0.7468289", "0.74601597", "0.7437136", "0.743282", "0.743282", "0.743282", "0.743282", "0.743282", "0.743282", "0.7430563", "0.74061453", "0.74061453", "0.74061453", "0.74061453", "0.74061453", "0.74032974", "0.74032974", "0.73860496", "0.7358536", "0.7356568", "0.7355632", "0.731319", "0.7306448", "0.7306448", "0.7306448", "0.7306448", "0.7306448", "0.7306448", "0.7306448", "0.7306448", "0.7306448", "0.7306097", "0.7306097", "0.7306097", "0.7274304", "0.7274304", "0.7240539", "0.72242934", "0.7219306", "0.72096765", "0.72096765", "0.72096765", "0.72096765", "0.72096765", "0.72083795", "0.72083795", "0.72083795", "0.72083795", "0.72083795", "0.72083795", "0.72083795", "0.72083795", "0.72083795", "0.72083795", "0.72083795", "0.72083795", "0.72083795", "0.72083795", "0.72083795", "0.7204818", "0.7204818", "0.71900696", "0.71900696", "0.71900696", "0.71900696", "0.71900696", "0.71900696", "0.71900177", "0.71900177", "0.71900177", "0.71900177", "0.7189788", "0.7189788", "0.7162074", "0.7152542", "0.7149772", "0.71366435", "0.71232146", "0.7115563", "0.71152", "0.70977795", "0.7094874", "0.7093117", "0.7054961", "0.7051351", "0.7047679", "0.70411205", "0.70364386", "0.70297945", "0.7027793", "0.7016648", "0.7015728", "0.6999661", "0.6993497", "0.6976419", "0.6971096", "0.69704014", "0.69704014", "0.69704014" ]
0.0
-1
/ Load TP category log date.
public function HCInstituteListData() { $sql="SELECT HID.INSTITUTE_NAME INSTITUTE_NAME, HID.RANKING RANKING, HIAD.ADDRESS_LINE1 ADDRESS_LINE1, HIAD.ADDRESS_LINE2 ADDRESS_LINE2, HIAD.PIN_CODE PIN_CODE, HCM.CITY_NAME CITY_NAME FROM TEST.INSTITUTE_DTL HID LEFT JOIN TEST.INSTITUTE_ADDRESS_DTL HIAD ON HIAD.INSTITUTE_DTL__ID = HID.ID LEFT JOIN TEST.CITY_MST HCM ON HCM.ID=HIAD.CITY_MST__ID "; $this->vResult = mysqli_query($this->vDbConn,$sql); while($this->vRow = mysqli_fetch_assoc($this->vResult)){ $this->vCHCInstituteListStructObj->vInstituteList[] = $this->vRow; } return ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index($log_date = NULL){\n // print_r(log_message('info','se ingresa dato al log'));\n //var_dump($this->session->userdata('NameUser'));\n $log_date = \"2019-02-15\";\n $this->load->library('log_library');\n if ($log_date == NULL)\n {\n // default: today\n $log_date = date('Y-m-d');\n }\n $data['cols'] = $this->log_library->get_file('log-'. $log_date . '.php');\n $data['log_date'] = $log_date;\n\t$this->load->view('log_view', $data);\n }", "abstract public function load_logger();", "private function _init_date()\n\t{\n\t\t$this->date->init($this->EE->TMPL->fetch_param('date'));\n\t\t$this->_log(sprintf(\"Working date set to %s %s\", $this->date->date(), $this->date->time()));\n\t}", "protected function _initLog()\n {\n }", "function CDFLog()\n\t{\n\t\t// ** Aktivierung der Logfunktionalitaet **\n\t\t// ########################################\n\t\t$this->m_enable = true;\n\t\t// ########################################\n\t\tif ($this->m_enable)\n\t\t{\t\t\t\n\t\t\t// Basispfad der Logdateien\n\t\t\t$this->m_base = \"./\";\n\t\t\t// Unterordner der Logdateien\n\t\t\t$this->m_sub = \"Logfiles/\";\n\t\t\t// Dateiname der Logdatei: YYYY_MM_DD_PHP.log\n\t\t\t$this->m_fileNameTemplate = \"20%02u_%02u_%02u_PHP.log\";\n\t\t\t// Die Verwaltungsroutine fuer die automatische Loeschung\n\t\t\t// Aelterer Dateien geht davon aus, dass der Dateiname\n\t\t\t// mit dem Datumsstempel beginnt.\n\t\t\t$this->m_fileNameTemplateMatch = \"^20[0-9]{2}_[0-9]{2}_[0-9]{2}_PHP.log\";\n\t\t\t// Aktuellen Dateiname der Logdatei erstellen\n\t\t\t$t = time();\n\t\t\t$ltm = localtime($t, 1);\n\t\t\t$this->m_fileName = sprintf($this->m_fileNameTemplate, \n\t\t\t\t$ltm[\"tm_year\"] % 100, $ltm[\"tm_mon\"] + 1, $ltm[\"tm_mday\"]);\n\t\t\t// Loeschen von Dateien die aelter sind als m_eraseFilesCount Logtage\n\t\t\t$this->m_eraseFilesEnable = true;\n\t\t\t// Anzahl zu haltender Logdateien (in Tagen)\n\t\t\t$this->m_eraseFilesCount = 5;\n\t\t\t// Zeichenfolge fuer einen Zeilenumbruch\n\t\t\t$this->m_crLf = \"\\r\\n\";\n\t\t\t// Automatische Einfuegung eines Zeitstempels vor jedem Logeintrag\n\t\t\t$this->m_withTimestamp = true;\n\t\t\t// Pruefen ob der Logpfad existiert.\n\t\t\tif (!is_dir($this->m_base . $this->m_sub))\n\t\t\t{\t\n\t\t\t\tif (!mkdir($this->m_base . $this->m_sub))\n\t\t\t\t{\n\t\t\t\t\t// Logsystem wegen Fehlschlag abstellen\n\t\t\t\t\t$this->m_enable = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Pruefung fuer eraseFile durchfuehren\n\t\t\t$this->logCheckOnWorkDate();\n\t\t}\n\t}", "public function load_calendar_datetime()\n\t{\n\t\tif ( ! class_exists('Calendar_datetime'))\n\t\t{\n\t\t\trequire_once CALENDAR_PATH.'calendar.datetime.php';\n\t\t}\n\n\t\tif (! isset($this->CDT))\n\t\t{\n\t\t\t$this->CDT = new Calendar_datetime();\n\t\t\t$this->first_day_of_week = $this->get_first_day_of_week();\n\t\t}\n\t}", "protected function _load_cdt()\n\t{\n\t\tif ( ! class_exists('Calendar'))\n\t\t{\n\t\t\trequire_once CALENDAR_PATH.'mod.calendar.php';\n\t\t}\n\n\t\tif ( ! class_exists('Calendar_datetime'))\n\t\t{\n\t\t\trequire_once CALENDAR_PATH.'calendar.datetime.php';\n\t\t}\n\n\t\tif ($this->CDT === FALSE)\n\t\t{\n\t\t\t$this->CDT = new Calendar_datetime;\n\t\t}\n\t}", "public function load()\n {\n parent::load();\n\n // appointments are not to the second, so remove the :00 at the end of the datetime field\n $this->datetime = substr( $this->datetime, 0, -3 );\n }", "public function from_recurly_log( $title, $data ){\n\n\t\t//$where = WP_PLUGIN_DIR . '/haven-recurly/logs/from-recurly.log';\n\t\t$where = '/home/cabotwealth.com/logs/from-recurly.log';\n\n\t\t$when = date('Y-m-d H:i:s');\n\t\tif( is_array( $data ) || is_object( $data ) ){\n\t\t\terror_log(\"[{$when}] {$title}: \" . print_r( $data, 1 ) . \"\\n\",3, $where );\n\t\t} else {\n\t\t\terror_log(\"[{$when}] {$title}: {$data}\" . \"\\n\",3, $where );\n\t\t}\n\n\t}", "public function read_log($dt_date=null,$i_user_id=null)\r\n {\r\n try{\r\n $ret_=array();\r\n /**\r\n * Optional date value found then \r\n * Search all XML data for that date and list it\r\n */\r\n if($dt_date && !$i_user_id)\r\n {\r\n $s_log_file=date(\"Y-M\",strtotime($dt_date)).\".bin\";///saved as binary file. ex- 2010-Sep \r\n if(file_exists($this->log_path.$s_log_file))\r\n { \r\n $ret_=$this->read_logxml($this->log_path.$s_log_file,array(\"dt_log\"=>$dt_date));\r\n }\r\n }\r\n else{\r\n ////Get all files in the log directory///\r\n if ($handle = opendir($this->log_path)) \r\n { \r\n $tmp=array();\r\n /* This is the correct way to loop over the directory. */ \r\n while (false !== ($s_log_file = readdir($handle))) \r\n { \r\n if ($s_log_file != \".\" && $s_log_file != \"..\" && $s_log_file != \"index.html\") \r\n { \r\n //echo \"$s_log_file\\n\"; \r\n if($i_user_id)\r\n {\r\n $tmp=$this->read_logxml($this->log_path.$s_log_file,array(\"user_id\"=>$i_user_id)); \r\n $ret_=array_merge($ret_,$tmp);\r\n }\r\n else\r\n {\r\n $tmp=$this->read_logxml($this->log_path.$s_log_file);\r\n $ret_=array_merge($ret_,$tmp);\r\n }\r\n } \r\n \r\n }///end while \r\n\r\n closedir($handle); \r\n } \r\n ////end Get all files in the log directory///\r\n }///end else\r\n unset($dt_date,$i_user_id,$tmp,$handle,$s_log_file);\r\n return $ret_;\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "public function cleanLog($date);", "private function _consolideDate(){\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}", "public function getDate(){\n\t\treturn $this->laDate;\n\t}", "protected function dt(){\n return date('Y-m-d\\TH:i:s');\n }", "protected function loadLogs()\n {\n $whereExpr = \"\";\n if (isset($this->filter['action']) && !is_array($this->filter['action'])) {\n $whereExpr .= \" AND `action` = \" . $this->filter['action'];\n } else if (isset($this->filter['action']) && is_array($this->filter['action'])) {\n $whereExpr .= \" ( \";\n foreach ($this->filter['action'] as $index => $action) {\n $whereExpr .= ($index) ? \" OR \" : \"\";\n $whereExpr .= \" action = '$action' \";\n }\n $whereExpr .= \" ) \";\n }\n\n $whereExpr = ($whereExpr != '') ? $whereExpr : ' 1 ';\n\n $query = \"SELECT \"\n . \" * \"\n . \" FROM \"\n . \" tf_log \"\n . \" WHERE \"\n . $whereExpr\n . \" ORDER BY \"\n . \" time \";\n\n $statement = $this->db->prepare($query);\n $statement->execute();\n\n while ($data = $statement->fetch()) {\n $this->logs[$data['cid']] = new Log($data);\n }\n\n return $this;\n }", "function setup_meta_dates() {\n\t\t\tglobal $post, $wpdb;\n\t\t\t$post_id = $post->ID;\n\t\t\t$_IPCDateCount = get_post_meta($post_id, \"_IPCDateCount\", true);\n\t\t\tif(empty($_IPCDateCount))\n\t\t\t\t$_IPCDateCount = 1;\n\t\t\t\t\t\t\n\t\t\t$the_post = get_post($post_id);\n\t\t\t\n\t\t\tinclude(dirname(__FILE__).'/views/ipc-meta-box-meta-data.php');\n\t\t}", "function __construct() {\n $this->day = strtolower(date('l')); // monday, tuesday ....\n //$this->day = 'monday';\n //$this->day = $url;\n \n $ltime = localtime();\n $this->time = ($ltime[2] * 60 * 60) + ($ltime[1] * 60) + $ltime[0]; // seconds past in day\n $ltime = null;\n \n //$utc = new DateTime(NULL, new DateTimeZone('UTC'));\n //$utc->setDate(1985, 1, 22);\n //$this->UTCday = $utc->getTimestamp();\n }", "public function getDataWithTypeDate() {}", "public function &get($category = null)\n\t{\n\t\t$log = [];\n\t\tif(!is_null($category) && isset(self::$__log[$category]))\n\t\t{\n\t\t\t$log = self::$__log[$category];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach(self::$__log as $k => $v)\n\t\t\t{\n\t\t\t\tforeach($v as $k2 => $v2)\n\t\t\t\t{\n\t\t\t\t\t$log[$k2] = $v2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tksort($log);\n\t\t}\n\n\t\treturn $log;\n\t}", "public function touchCategory($pid)\n\t{\n\t\t$tname=$this->tablename('catalog_category_entity');\n\t\t$this->update(\"UPDATE $tname SET updated_at=? WHERE entity_id=?\",array(strftime(\"%Y-%m-%d %H:%M:%S\"),$pid));\n\t}", "private function _setDate(){\n\t\tif($this->_year>=1970&&$this->_year<=2038){\n\t\t\t$this->_day = date('d', $this->_timestamp);\n\t\t\t$this->_month = date('m', $this->_timestamp);\n\t\t\t$this->_year = date('Y', $this->_timestamp);\n\t\t} else {\n\t\t\t$dateParts = self::_getDateParts($this->_timestamp, true);\n\t\t\t$this->_day = sprintf('%02s', $dateParts['mday']);\n\t\t\t$this->_month = sprintf('%02s', $dateParts['mon']);\n\t\t\t$this->_year = $dateParts['year'];\n\t\t}\n\t\t$this->_date = $this->_year.'-'.$this->_month.'-'.$this->_day;\n\t}", "function _Log($path = '', $threshold = '', $date_fmt = '')\n\t{\t\n\t\t$this->log_path = ($path != '') ? $path : BASEPATH.'logs/';\n\n\t\tif ( ! is_dir($this->log_path) OR ! is_writable($this->log_path))\n\t\t{\n\t\t\t$this->_enabled = FALSE;\n\t\t}\n\t\t\n\t\tif (is_numeric($threshold))\n\t\t{\n\t\t\t$this->_threshold = $threshold;\n\t\t}\n\t\t\t\n\t\tif ($date_fmt != '')\n\t\t{\n\t\t\t$this->_date_fmt = $date_fmt;\n\t\t}\n\t}", "private function load_variables() : void {\n\t\t$this->today = new \\DateTime( 'NOW' );\n\t\t$this->start_date = new \\DateTime( FTW_START_DATE );\n\t\t$this->completion_date = new \\DateTime( FTW_COMPLETION_DATE );\n\t}", "function action_date_title()\n{\n\treturn time();\n}", "function read_date_time( $package_dir )\n{\n\t//debug_print( \"package dir: $package_dir\" );\n\t\n\t$package_name = strrchr( $package_dir, '/' );\n\t//debug_print( \"package name: $package_name\" );\n\n\t// get the last 15 bytes which mean YYYYMMDD_HHMMSS\n\t$date_time = substr( $package_dir, -15, 15 );\n\n\t$year = substr( $date_time, 0, 4 );\n\t$month = substr( $date_time, 4, 2 );\n\t$date = substr( $date_time, 6, 2 );\n\t$hour = substr( $date_time, 9, 2 );\n\t$minute = substr( $date_time, 11, 2 );\n\t$second = substr( $date_time, 13, 2 );\n\n\t$formated_time =\"$year.$month.$date $hour:$minute:$second\";\n\n\treturn $formated_time;\n}", "function before_insert()\r\n\t{\r\n\t\t$this->reviewed_at = date(SQL_DATETIME_FORMAT);\r\n\t}", "private function readLogConfig(){\n\n\t\t$_config = ConfigUtil::getInstance();\n\n\t\t$this->_log_enabled = $_config->isLogEnabled();\n\t\t$this->_log_level = $_config->getLogLevel();\n\t\t$this->_log_file_path = $_config->getLogFilePath();\n\t\n\t}", "public function setArticle_date($t)\n {\n if(is_string($t))\n $this->_article_date = $t;\n }", "function publishLog() {\n\t\t$id = $this->current_log;\t\t\n\t\t$res = $this->query(\"SELECT event_id FROM $this->table_log WHERE id=$id\");\n\t\t$row = $res->fetch_assoc();\n\t\t$cal_id = explode(\",\",$row['event_id']);\n\t\t$calEvent = $this->calendar_instance->getEventDetails($row['event_id']);\n\t\t$topic = $calEvent['caption'];\n\t\t$year = $calEvent['year'];\n\t\t$slug = $calEvent['slug'];\n\t\t$url = $this->generateCoolURL(\"/$year/$slug\");\n\t\t$this->addToActivityLog(\"publiserte logg fra <a href=\\\"$url\\\">$topic</a>.\",false,\"major\");\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->load->helper(\"date\");\n }", "public function discoverNewestLogTime() {\n//\t\tdebug(date('F 1, Y', time()) . ' + 1 month -1 day');\n\t\t$this->report['endLimit'] = strtotime(date('F 1, Y', time()) . ' + 1 month -1 day');\n\t}", "public function __construct(){\n\t\t\tparent::__construct();\n\n\t\t\t$this->_name = 'Multilingual Publish Date';\n\t\t\t$this->_driver = ExtensionManager::create('multilingual_publish_date');\n\t\t}", "public static function readLog($num, $date)\n {\n $logger = new AddressSdkLog();/*by wantao:调用方比如thinkphp(天使盒子)那边调用的时候有个同名的Log类,导致重定义错误,所以对sdk的类名称加前缀AddressSdkLog,以避免以后类似问题,其他类命名会慢慢边做边修改*/\n $logger->readLog($num, $date);\n }", "function log_language_data()\r\n\t{\r\n\t\treturn $log_language_data;\r\n\t}", "public function __construct(){\n // Call the CI_Model constructor\n parent::__construct();\n $this->load->helper(\"date\");\n }", "private static function _load() {\n $kategorier = Yaml::parse( file_get_contents( UKMrapporter::getPluginPath() .'rapporter/kategorier.yml') );\n foreach( $kategorier as $id => $kategori_data ) {\n $kategori = new Kategori( $id, $kategori_data );\n static::$data[ $kategori->getId() ] = $kategori;\n }\n }", "public function import_Categories(){\n\n \t\t\tExcel::import(new ComponentsImport,'/imports/categories_main.csv');\n return 200;\n\n \t}", "public static function initSysLog() {}", "public function firstlog()\n\t{\n\t\t$this->load->view('newlog');\n\t}", "function print_logs($date)\n {\n $json_content = json_decode(file_get_contents(\"src/logs/$date/log.json\"), true);\n\n foreach ($json_content as $item)\n {\n \n format_ip_html($item[\"ip\"], $item[\"time\"]);\n }\n }", "public function getDateImport()\n {\n return $this->date_import;\n }", "public function initPostDailyStatss()\n\t{\n\t\t$this->collPostDailyStatss = array();\n\t}", "public function loadLastRunTime()\n\t{\n\t\t$date = null;\n\t\t$filepath = $this->buildFilePath();\n\t\tif (file_exists($filepath)) {\n\t\t\t$date = file_get_contents($filepath);\n\t\t\t$date = DateTime::createFromFormat(self::DATETIME_FORMAT, $date);\n\t\t}\n\n\t\treturn $date ?: null;\n\t}", "public function __construct()\n {\n parent::__construct();\n \\Log::useDailyFiles(storage_path().'/logs/cron123.log');\n\n\t\t$this->logger = \\Log::getMonolog();\n\n\t\t\n }", "function loadActivity(){\n\t\t\t$this->articleEvents->add( $this->db->getUserActivity($this->getName()) ,true );\t\t\t\n\t\t}", "public static function GetLog($type)\n \t{\n \t\t//Ouverture du fichier\n\t\t$Name =$type.date('dmY');\n\t\t$Directory =\"Log\\\\\".$type.\"\\\\\";\n\n\t\t$File=$Directory.$Name.\".JLog\";\n\t\t$Log = \"\";\n\n\t\tif (!file_exists($File) || !$fp = fopen($File,\"r\"))\n\t\t{\n\t\t\techo \"--Echec de l'ouverture du fichier\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile(!feof($fp))\n\t\t\t{\n\t\t\t\t$Ligne = fgets($fp,255);\n\t\t\t\t$Log .= $Ligne;\n\t\t\t}\n\n\t\tfclose($fp); // On ferme le fichier\n\t\treturn $Log;\n\t\t}\n \t}", "function closeLogs(){\n\t\t\t$fecha = date('Y-m-d H:i:s');\n\t\t\t\n\t\t}", "public function __construct() {\n\n $language = ee()->TMPL->fetch_param('language') ?? 'de';\n $format = ee()->TMPL->fetch_param('format');\n $date = ee()->TMPL->tagdata;\n\n\n if (! is_numeric($date)) {\n $date = strtotime($date);\n }\n\n if (isset($language)) {\n setlocale(LC_ALL, $language);\n }\n\n $date = ee()->localize->format_date($format, $date);\n\n $this->return_data = $this->getFullMonthByLocale($date, $language);\n }", "public function logData() {\n\t\t/* Implement in subclasses */\n\t}", "protected function getLogEntries() {}", "function article_date() {\n if($created = Registry::prop('article', 'created')) {\n return $created->format('jS F, Y');\n }\n}", "protected function getTimeTracker() {}", "private function set_log_type () {\n\t\t# check settings\n\t\t$this->log_type = $this->settings->log;\n\t}", "public function get_logs()\n {\n }", "function __construct()\n {\n $this->tablename = 'opt_ctk_log';\n $this->sql_orderby = 'tgl_ctk desc';\n\t\t\n $this->fieldlist = array('nm_file', 'tgl_ctk', 'userid');\n $this->fieldlist['nm_file'] = array('pkey' => 'y');\n\t\t \n\t\t\t\t\n }", "public function column_date($post)\n {\n }", "public function column_date($post)\n {\n }", "protected function initializeTimeTracker() {}", "function __construct()\n {\n parent::__construct();\n $this->load->database();\n $this->load->helper('date');\n }", "function __construct()\n {\n parent::__construct();\n $this->load->database();\n $this->load->helper('date');\n }", "function datum_nu() {\n\t\t//\n\t\t$datestring \t\t\t\t= \"%d-%m-%Y\" ; \n\t\t$time \t\t\t\t\t\t= time();\t\t\t\n\t\t\n\t\treturn date($datestring, $time);\n\t\t//-----/\n\t}", "function datum($db_date) {\r\n return strftime('%d.%m.%Y', strtotime($db_date));\r\n }", "public function getDate();", "public function getDate();", "function getCurrentTimeLog()\n\t{\n\t\treturn $this->Current_TimeLog;\n\t}", "public function stdWrap_dateDataProvider() {}", "function getData()\n {\n return $this->date;\n }", "function show_log()\n\t{\n\t\t$options = array();\n\t\tif($this->input->get_post(\"kTeach\")){\n\t\t\t$options[\"kTeach\"] = $this->input->get_post(\"kTeach\");\n\t\t}\n\n\t\tif($this->input->get_post(\"username\")){\n\t\t\t$options[\"username\"] = $this->input->get_post(\"username\");\n\t\t}\n\n\t\tif($this->input->get_post(\"action\")){\n\t\t\t$options[\"action\"] = $this->input->get_post(\"action\");\n\t\t}\n\n\t\tif($this->input->get_post(\"time_start\") && $this->input->get_post(\"time_end\")){\n\t\t\t$time_start = $this->input->get_post(\"time_start\");\n\t\t\t$time_end = $this->input->get_post(\"time_end\");\n\t\t\t$time_end .= \" 23:59:59\";// make the end time the end of the same day\n\t\t\t$options[\"date_range\"][\"time_start\"] = $time_start;\n\t\t\t$options[\"date_range\"][\"time_end\"] = $time_end;\n\t\t}\n\n\t\t$data[\"header\"] = array(\"username\",\"timestamp\",\"action\");\n\t\t$data[\"logs\"] = $this->auth_model->get_log($options);\n\t\t$data[\"options\"] = $options;\n\t\t$data[\"target\"] = \"admin/log\";\n\t\t$data[\"title\"] = \"User Log\";\n\t\t$this->load->view(\"page/index\",$data);\n\t}", "function logBegin($format)\n\t{\n\t\t// Log aktiv?\n\t\tif (!$this->m_enable)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\t// Uhrzeit des Logeintrages\n\t\t$t = time();\n\t\t//m_clockBegin = clock();\n\t\t$ltm = localtime($t, 1);\n\t\t\n\t\t// Mit fuehrendem Zeitstring?\n\t\tif ($this->m_withTimestamp)\n\t\t{\t\n\t\t\t$timeString = sprintf(\"%02u:%02u:%02u\\t\", $ltm[\"tm_hour\"], $ltm[\"tm_min\"], $ltm[\"tm_sec\"]);\n\t\t}\n\t\t/*\n\t\t// Dateiname der Logdatei\n\t\t$fileName = sprintf($this->m_fileNameTemplate, \n\t\t\t$ltm[\"tm_year\"] % 100, $ltm[\"tm_mon\"] + 1, $ltm[\"tm_mday\"]);\n\t\t// Pruefen ob sich der Name geandert hat.\n\t\tif (strcmp($fileName, $this->m_fileName) != 0)\n\t\t{\n\t\t\t// Dateiname hat sich geaendert.\n\t\t\t$this->m_fileName = $fileName;\n\t\t\t$this->logCheck(); // Eventuell die aelteste Logdatei loeschen.\n\t\t}\n\t\t*/\n\t\t// Alle Argumente als Parameter aufbereiten\n\t\t$args = func_get_args();\n\t\t// Erstes Element ist Formatstring, diesen entfernen\n\t\tarray_shift($args);\n\t\t// Logzeile aufbauen und halten\n\t\t$this->m_row = vsprintf($timeString . $format, $args);\n\n\t\treturn 1;\n\t}", "function actionParse( $date, $logs ) {\n\t\tglobal $content;\n\t\t\n\t\tif( strlen( $date ) == 5 ) {\n\t\t\t$parseddate = '0' . substr( $date, 0, 1 ) . '/' . substr( $date, 1 );\n\t\t}\n\t\telse {\n\t\t\t$parseddate = substr( $date, 0, 2 ) . '/' . substr( $date, 2 );\n\t\t}\n\t\t\n\t\t$ret = $content->get_config_vars( 'duringdate', $parseddate );\n\t\t\n\t\t$ret .= \"<ul>\";\n\t\t\n\t\tforeach( $logs as $type => $count ) {\n\t\t\tswitch( $type ) {\n\t\t\t\tcase 'modify':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphmodify', $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'protect':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphprotect', $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'unprotect':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphunprotect', $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'move':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphmove' . $type, $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'move_redir':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphmoveredir' . $type, $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'move_prot':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphmoveprot' . $type, $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'delete':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphdelete' . $type, $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'restore':\n\t\t\t\t\t$ret .= \"<li>\" . $content->get_config_vars( 'linegraphundelete' . $type, $count ) . \"</li>\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$ret .= \"</ul>\";\n\t\t\n\t\treturn htmlentities( $ret );\n\t\n\t}", "function getLog(){\n\t\t$limit = 50; \n\t\treturn iterator_to_array( $this->db->log->find()->limit($limit)->sort(array(\"logDate\" => -1 )) );\n\t//db.log.find().limit(5).sort({\"encuesta.fechaCaptura\":-1}).pretty()\n\t}", "private function logEntriesInDateRange() {\n\t\t// loop the discovered files\t\t\n\t\tforeach ($this->report['files'] as $file) {\n\t\t\t$handle = @fopen($file, \"r\");\n\t\t\tif ($handle) {\n\t\t\t\twhile (($buffer = fgets($handle, 4096)) !== false) {\n\t\t\t\t\t$this->Log->parseLogLine($buffer);\n\t\t\t\t\t// is it an log entry for the customer of interest?\n\t\t\t\t\tif ($this->Log->logLine['customer'] == $this->report['customer']) {\n\t\t\t\t\t\t// if the log entry is in the specific date range, save it\n\t\t\t\t\t\tif ($this->Log->meta['datetime'] >= $this->report['firstTime'] && $this->Log->meta['datetime'] <= $this->report['finalTime']) {\n\t\t\t\t\t\t\t$this->report['items'][$this->Log->logLine['id']]['Activity'][] = array_merge($this->Log->meta, $this->Log->logLine);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\t\t\t\tif (!feof($handle)) {\n\t\t\t\t\techo \"Error: unexpected fgets() fail\\n<br />\";\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n\t\t\t}\n\t\t}\n\t}", "public function process_access_log(){\n $this->load->model('rest_model');\n $today = date(\"Y-m-d\");\n $access_log_folder = $this->config->item('admin_access_log_path');\n $record_log_file = $access_log_folder . 'api_access_log.txt';\n if (!is_file($record_log_file)) {\n $fp = fopen($record_log_file, 'a+');\n chmod($record_log_file, 0777);\n $end_date = date(\"Y-m-d\", strtotime(\"-15 day\", strtotime($today)));\n } else {\n $db_end_date = end(explode('~~', file_get_contents($record_log_file)));\n }\n if ($end_date < $today) {\n while (strtotime($end_date) < strtotime($today)) {\n $end_date = date(\"Y-m-d\", strtotime(\"+1 day\", strtotime($end_date)));\n $date_arr[] = $end_date;\n }\n $log_data = $this->get_access_log($date_arr);\n if(!empty($log_data[$today])){\n $deletion = $this->rest_model->deleteAccessLog($today);\n }\n foreach ($date_arr as $date_log) {\n if (!empty($log_data[$date_log])) {\n $insertion = $this->rest_model->insertAccessLog($log_data[$date_log]);\n }\n }\n }\n $log_date = date(\"Y-m-d\", strtotime(\"-1 day\", strtotime($today)));\n file_put_contents($sql_file, \"$end_date~~$log_date\");\n echo 1;\n $this->skip_template_view();\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 getDateDebut();", "public function __construct() {\n\t\t$view_event = ( isset( \\REALTY_BLOC_LOG::$option['view_event'] ) ? \\REALTY_BLOC_LOG::$option['view_event'] : array() );\n\n\t\t// Property Page view log\n\t\tif ( isset( $view_event['property'] ) and $view_event['property'] == \"on\" ) {\n\t\t\tadd_action( 'rb_page_view_property_log', array( $this, 'save_property' ), 10, 5 );\n\t\t}\n\n\t\t// building Page View log\n\t\tif ( isset( $view_event['building'] ) and $view_event['building'] == \"on\" ) {\n\t\t\tadd_action( 'rb_page_view_building_log', array( $this, 'save_building' ), 10, 5 );\n\t\t}\n\t}", "function logTime($dir_root,$script_name,$begin,$end) {\n $file = fopen($dir_root . 'log/tempsChargement.log','a');\n $temps = $end - $begin;\n fputs($file,date('Y-m-d H:i:s') . \" - Chargement de la page '\". basename($script_name) . \"' en : $temps ms.\\n\"); \n fclose($file);\n}", "public function __construct($date)\n {\n $date = $this->getDate($date);\n $this->mediawiki = intval($date->format(\"YmdHis\"));\n $this->readable = $date->format(\"d F Y\");\n }", "function __construct(){\n\t\tparent::__construct();\n\t\t$this->load->model('Model_userLog');\n\t }", "public function log_activity() {\n \n \n $CI =& get_instance();\n $CI->load->library('audit_trail');\n // Start off with the session stuff we know\n $data = array();\n $data['user_id'] = $CI->session->userdata('user_id');\n \n // Next up, we want to know what page we're on, use the router class\n $data['section'] = $CI->router->class;\n $data['action'] = $CI->router->method;\n \n // Lastly, we need to know when this is happening\n $data['when'] = date('Y-m-d G:i:s');\n \n // We don't need it, but we'll log the URI just in case\n $data['uri'] = uri_string();\n $path = realpath(APPPATH);\n // And write it to the database\n if($CI->router->method!='checkPortal' && $CI->router->method!='getAttendanceUpdates' && $CI->router->method!='getAverageDailyAttendance'):\n $CI->audit_trail->lfile($path.'/modules/logs/'.$CI->session->userdata('user_id').'.txt');\n $CI->audit_trail->lwrite($CI->session->userdata('name').' access '.$CI->router->method.' through '. uri_string().'.' , 'TRACE');\n endif;\n }", "private function _loadCategories()\n {\n try {\n $this->_categories = Doctrine_Core::getTable('Category')->findAll(Doctrine_Core::HYDRATE_ARRAY);\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }", "function metabox_date_time($post){\n\t\tglobal $postmec;\n\t\tinclude $postmec->get_postmec_dir() . 'metaboxes/event_start_end_defining.php';\n\t}", "public function campaignStatus() {\r\n $curtm = date('Y-m-d H:i:s');\r\n $todaydate = date(\"d/m/Y\", strtotime($curtm));\r\n }", "public function __construct($date)\n {\n $this->date = $date;\n }", "function launchlogs_init() {\n}", "public function getPrepareAt()\n {\n return Mage::app()->loadCache('log_visitor_online_prepare_at');\n }", "function __construct() {\n parent::__construct();\n $this->load->model('soporte_categorias_model');\n date_default_timezone_set('America/Mexico_City');\n }", "function wLogRead($path,$param) {\n \n $fp = fopen ($path.\"/\".$param.\".log\", \"a+\");// Un nouveau fichier créé chaque jour\n $ligne = fgetcsv($fp, 1024);\n fclose ($fp);\n\n return $ligne[0];\n \n}", "public function __construct(){\n\t\t$this->logged_in_date_time = time();\n\t}", "protected function loadMetaData() {}", "function newLog($log, $date)\r\n{\r\n\t// Find the age threshold for deleting old logs\r\n\t$minage = time() - LACE_ARCHIVE_DAYS * 86400;\r\n\r\n\t// Delete logs that are too old\r\n\t$handle = opendir(LACE_LOGDIR);\r\n\twhile ($file = readdir($handle))\r\n\t{\r\n\t\tif($file == '.' || $file == '..')\r\n\t\t\tcontinue;\r\n\r\n\t\t// Filenames are in MMDDYYYY.dat format\r\n\t\t$newfile = str_replace('.dat', '', $file);\r\n\t\t$filedate = strtotime(substr($newfile, 0, 2).\"/\".substr($newfile, 2, 2).\"/\".substr($newfile, 4, 4));\r\n\r\n\t\t// Delete\r\n\t\tif ($filedate < $minage)\r\n\t\t\tunlink(LACE_LOGDIR.$file);\r\n\t}\r\n\tclosedir($handle);\r\n\r\n\t// Write the new log file\r\n\t$filename = date('mdY', $date).'.dat';\r\n $log = implode(\"\\n\", array_map('trim',$log)).\"\\n\";\r\n $handle = fopen(LACE_LOGDIR.$filename, 'a');\r\n fwrite($handle, $log);\r\n fclose($handle);\r\n // return an empty array, signifying\r\n // that the main logfile is empty\r\n \treturn array();\r\n}", "public function __construct()\n {\n parent::__construct();\n $this->load->model('M_tas_workstatus', 'mws');\n $this->load->model('Da_workstatus', 'dws');\n $this->load->helper('mydate_helper.php');\n Set_Time_Zone();\n }", "function PrintDate($article_id)\n\t{\n\t\t$path = DATE_FILE;\n\t\tif (file_exists(ARTICLE . $article_id) == true){\n\t\t\tinclude_once('file.php');\n\t\t\t$date = readLine($path, $article_id);\n\t\t\techo $date;\n\t\t}\n\t}", "public function showLastByDateForLastCategory()//pokazuje wszystkie fotki sprzed miesiaca\n {\n $con = $this->connectDb();\n //pokazuje fotki ze wszystkich kategorii\n $q = $con->query(\"SELECT * FROM `photos` LEFT JOIN `category` ON photos.`category` = category.`c_id` WHERE category.`c_visibility` = '1' AND photos.`p_visibility` = '1' AND DATE(photos.`add_data`) > DATE_SUB(CURRENT_DATE, INTERVAL \".$this->interval.\") ORDER BY photos.`p_id` \".$this->order.\" \");/*zwraca false jesli tablica nie istnieje*/\n $q = $q->fetchAll(PDO::FETCH_ASSOC);\n return $q;\n\t}", "function article_time() {\n if($created = Registry::prop('article', 'created_at')) {\n return $created->getTimestamp();\n }\n}", "function ___action () {\r\n\r\n // first, get all news items (for sorting and such)\r\n $all = $this->db->query ( array (\r\n 'select' => 'id,type1,label,m_p_date,m_p_who',\r\n 'type' => __NEWS,\r\n 'sort_by' => 'm_p_date DESC',\r\n 'return' => 'topics'\r\n ) ) ;\r\n\r\n $all_dates = array () ;\r\n\r\n foreach ( $all as $idx => $item )\r\n if ( isset ( $item['m_p_date'] ) )\r\n $all_dates[$item['id']] = $item['m_p_date'] ;\r\n\r\n\r\n\r\n\r\n\r\n // Get the view facets of the archive\r\n $year = $this->glob->breakdown->id ;\r\n $month = $this->glob->breakdown->selector ;\r\n $week = $this->glob->breakdown->specific ;\r\n $day = $this->glob->breakdown->atom ;\r\n \r\n \r\n $view = 'all' ;\r\n $path = array ( 'news' => 'News', 'news/archive' => 'Archive' ) ;\r\n\r\n $from = date( XS_DATE, mktime ( 0, 0, 0, 1, 1, 2000 ) ) ;\r\n\r\n // observe DATE limit!! When PHP (and your computer system) support yearly\r\n // numbers over 2030, change this value to something nice and high!!!!!!!!\r\n $to = date( XS_DATE, mktime ( 0, 0, 0, 0, 0, 2030 ) ) ;\r\n \r\n \r\n if ( $year != '' ) {\r\n\r\n // yearly view\r\n $view = 'year' ;\r\n\r\n $from = date( XS_DATE, mktime ( 0, 0, 0, 1, 1, $year ) ) ;\r\n $to = date( XS_DATE, mktime ( 0, 0, 0, 13, 0, $year ) ) ;\r\n\r\n // Let's create an array that will be our breadcrumb\r\n $path['news/archive/'.$year] = $year ;\r\n\r\n } \r\n \r\n if ( $month != '' ) {\r\n\r\n // monthly view\r\n $view = 'month' ;\r\n\r\n $from = date( XS_DATE, mktime ( 0, 0, 0, $month, 1, $year ) ) ;\r\n $to = date( XS_DATE, mktime ( 0, 0, 0, $month + 1, 0, $year ) ) ;\r\n\r\n // Let's create an array that will be our breadcrumb\r\n $path[\"news/archive/$year/$month\"] = $month ;\r\n\r\n } \r\n \r\n if ( $week != '' ) {\r\n\r\n // weekly view\r\n $view = 'week' ;\r\n\r\n $from = date( XS_DATE, mktime ( 0, 0, 0, $month, 1, $year ) ) ;\r\n $to = date( XS_DATE, mktime ( 0, 0, 0, $month + 1, 0, $year ) ) ;\r\n\r\n // Let's create an array that will be our breadcrumb\r\n $path[\"news/archive/$year/$month/$week\"] = $week ;\r\n\r\n } \r\n \r\n if ( $day != '' ) {\r\n\r\n // daily view\r\n $view = 'day' ;\r\n\r\n $from = date( XS_DATE, mktime ( 0, 0, 0, $month, $day, $year ) ) ;\r\n $to = date( XS_DATE, mktime ( 23, 59, 59, $month, $day, $year ) ) ;\r\n\r\n // Let's create an array that will be our breadcrumb\r\n $path[\"news/archive/$year/$month/$day\"] = $day ;\r\n\r\n } \r\n \r\n $this->glob->stack->add ( 'xs_facets', $path ) ;\r\n\r\n\r\n $result = $this->db->query ( array (\r\n 'select' => 'id,type1,label,m_p_date,m_p_who',\r\n 'type' => __NEWS,\r\n 'sort_by' => 'm_p_date DESC',\r\n 'between' => \"m_p_date BETWEEN CAST('$from' as DATETIME) AND CAST('$to' as DATETIME)\",\r\n 'return' => 'topics'\r\n ) ) ;\r\n\r\n\r\n $index = array () ;\r\n\r\n foreach ( $result as $idx => $item ) {\r\n if ( isset ( $item['m_p_date'] ) ) {\r\n $d = new DateTime( $item['m_p_date'] ) ;\r\n switch ( $view ) {\r\n case 'all': $index[$d->format('Y')] = $item['label'] ; break ;\r\n case 'year': $index[$d->format('Y')][$d->format('m')][$d->format('W')][$d->format('d')] = $item['label'] ; break ;\r\n case 'month': $index[$d->format('Y')][$d->format('m')][$d->format('W')][$d->format('d')][$item['id']] = $item['label'] ; break ;\r\n case 'week': $index[$d->format('Y')][$d->format('m')][$d->format('W')][$d->format('d')][$item['id']] = $item['label'] ; break ;\r\n case 'day': $index[$d->format('Y')][$d->format('m')][$d->format('W')][$d->format('d')][$item['id']] = $item['label'] ; break ;\r\n }\r\n \r\n }\r\n }\r\n\r\n switch ( $view ) {\r\n case 'week':\r\n case 'day':\r\n $this->glob->stack->add ( 'xs_news', $result ) ;\r\n break ;\r\n default: break ;\r\n }\r\n\r\n $this->log ( 'READ', '['.$this->glob->request->q.']' ) ;\r\n $this->glob->stack->add ( 'xs_news_archive', $index ) ;\r\n\r\n }", "function SetInitialDate ($date)\r\n {\r\n if ($date)\r\n {\r\n $this->_dti = $date; \r\n }\r\n }", "public function getDispatchDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->dispatchDate;\r\n\t}", "function read_Categories() {\n\n\t\tglobal $myCategories;\n\t\tglobal $gesamt;\n\t\t\n\t\t$i = 0;\n\t\t\n\t\tforeach ($myCategories as $catInfo):\n\t\t\n\t\t$test=$myCategories->category[$i]['typ'];\n\t\t\n\t\tarray_push($gesamt, $test);\n\t\t\n\t\t$i++;\n\t\tendforeach;\t\n\t\t\n\t}", "public function populateDefaults(){\n\t\tparent::populateDefaults();\n\t\t\n\t\t$this->setField('Date', date('Y-m-d H:i:s', strtotime('now')));\n\t}", "function read_log($logDir)\n {\n $logArray = array();\n $filePath = $logDir.$_POST['channel'].\"_log.log\";\n echo \"File read from: $filePath <br>\";\n if (($handle = fopen($filePath, \"r\")) !== FALSE) \n {\n $headers = fgetcsv($handle, 1000, \",\");\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) \n {\n $logArray[]=array_combine($headers, $data);\n }\n echo \"There are \".sizeof($logArray).\" entries in the \".$_POST['channel'].\" log.<br>\";\n fclose($handle);\n }\n return $logArray;\n }" ]
[ "0.5843965", "0.53210676", "0.52958804", "0.51055026", "0.50952405", "0.50866675", "0.50654703", "0.5021907", "0.49633083", "0.49614096", "0.4911697", "0.49067274", "0.48724407", "0.48673436", "0.48669273", "0.4842863", "0.48310772", "0.48222232", "0.48164505", "0.47864208", "0.4782769", "0.47809035", "0.47765064", "0.47621304", "0.4752978", "0.47191605", "0.4702654", "0.46979997", "0.46901664", "0.46840128", "0.46791974", "0.46791124", "0.46707156", "0.46624908", "0.465438", "0.46518886", "0.4644593", "0.46422547", "0.4632885", "0.4628958", "0.46259582", "0.46246594", "0.46089476", "0.4606874", "0.46042952", "0.4600138", "0.4593437", "0.45919028", "0.4588821", "0.45856518", "0.45834494", "0.45829824", "0.4559426", "0.45544332", "0.4553189", "0.45527926", "0.45510605", "0.4543668", "0.45432335", "0.45432335", "0.45334816", "0.45245296", "0.45214695", "0.45214695", "0.4518072", "0.4514381", "0.45100442", "0.45077676", "0.45074302", "0.44979912", "0.44890833", "0.44778165", "0.44578406", "0.4455307", "0.4451084", "0.44473776", "0.44451565", "0.44435063", "0.4443439", "0.44422752", "0.44410616", "0.44392103", "0.4438668", "0.44326156", "0.4429004", "0.4424315", "0.44218338", "0.44216308", "0.44211304", "0.44209042", "0.44201082", "0.44032043", "0.4402627", "0.44009134", "0.43976638", "0.4392824", "0.43912873", "0.4388805", "0.43838617", "0.43832558", "0.43809447" ]
0.0
-1
Serverside rendering of the `core/calendar` block.
function render_block_core_calendar( $attributes ) { global $monthnum, $year; // Calendar shouldn't be rendered // when there are no published posts on the site. if ( ! block_core_calendar_has_published_posts() ) { if ( is_user_logged_in() ) { return '<div>' . __( 'The calendar block is hidden because there are no published posts.' ) . '</div>'; } return ''; } $previous_monthnum = $monthnum; $previous_year = $year; if ( isset( $attributes['month'] ) && isset( $attributes['year'] ) ) { $permalink_structure = get_option( 'permalink_structure' ); if ( str_contains( $permalink_structure, '%monthnum%' ) && str_contains( $permalink_structure, '%year%' ) ) { // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited $monthnum = $attributes['month']; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited $year = $attributes['year']; } } $color_block_styles = array(); // Text color. $preset_text_color = array_key_exists( 'textColor', $attributes ) ? "var:preset|color|{$attributes['textColor']}" : null; $custom_text_color = _wp_array_get( $attributes, array( 'style', 'color', 'text' ), null ); $color_block_styles['text'] = $preset_text_color ? $preset_text_color : $custom_text_color; // Background Color. $preset_background_color = array_key_exists( 'backgroundColor', $attributes ) ? "var:preset|color|{$attributes['backgroundColor']}" : null; $custom_background_color = _wp_array_get( $attributes, array( 'style', 'color', 'background' ), null ); $color_block_styles['background'] = $preset_background_color ? $preset_background_color : $custom_background_color; // Generate color styles and classes. $styles = wp_style_engine_get_styles( array( 'color' => $color_block_styles ), array( 'convert_vars_to_classnames' => true ) ); $inline_styles = empty( $styles['css'] ) ? '' : sprintf( ' style="%s"', esc_attr( $styles['css'] ) ); $classnames = empty( $styles['classnames'] ) ? '' : ' ' . esc_attr( $styles['classnames'] ); if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { $classnames .= ' has-link-color'; } // Apply color classes and styles to the calendar. $calendar = str_replace( '<table', '<table' . $inline_styles, get_calendar( true, false ) ); $calendar = str_replace( 'class="wp-calendar-table', 'class="wp-calendar-table' . $classnames, $calendar ); $wrapper_attributes = get_block_wrapper_attributes(); $output = sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, $calendar ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited $monthnum = $previous_monthnum; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited $year = $previous_year; return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function calendar()\n {\n $this->template->set('global_setting', $this->global_setting);\n $this->template->set('page', 'calendar');\n $this->template->set_theme('default_theme');\n $this->template->set_layout('frontend')\n ->title($this->global_setting['site_title'] . ' | Calendar')\n ->set_partial('header', 'partials/header')\n ->set_partial('footer', 'partials/footer');\n $this->template->build('frontpages/calendar');\n }", "function render_block_core_calendar($attributes)\n {\n }", "public function render()\n {\n $this->prepareVars();\n return $this->makePartial('calendar');\n }", "public function render() {\n Openbizx::$app->getClientProxy()->includeCalendarScripts();\n\n $format = $this->dateFormat ? $this->dateFormat : \"%Y-%m-%d\";\n\n $sHTML = parent::render();\n\n $showTime = 'false';\n //$image = \"<img src=\\\"\".Openbizx::$app->getImageUrl().\"/calendar.gif\\\" border=0 title=\\\"Select date...\\\" align='top' hspace='2'>\";\n $sHTML .= \"<a class=\\\"date_picker\\\" href=\\\"javascript: void(0);\\\" onclick=\\\"return showCalendar('$this->objectName','$format',$showTime,true);\\\"></a>\";\n return $sHTML;\n }", "function register_block_core_calendar() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/calendar',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_calendar',\n\t\t)\n\t);\n}", "function register_block_core_calendar()\n {\n }", "function DisplayCalendarOfEvents()\r\n\t{\r\n\t\tglobal $_SETTINGS;\r\n\t\techo \"<div id='calendar'></div>\";\t\r\n\t}", "function portal_dashboard_calendar_widget() {\n\n\techo portal_output_project_calendar();\n\n}", "function portal_return_calendar_template() {\n\treturn portal_template_hierarchy( 'dashboard/components/calendar/index.php' );\n}", "public function render()\r\n\t{\r\n\t\t$days = 1;\r\n\t\t$this->redirect = isset($this->redirect) ? $this->redirect: $this->getURL() ;\r\n\t\t$this->set_date();\r\n\t\t$total_days = cal_days_in_month(CAL_GREGORIAN, $this->month, $this->year);\r\n\t\t$first_spaces = date(\"w\", mktime(0, 0, 0, $this->month, 1, $this->year));\r\n\t\t$currentday = $this->UID('day');\r\n\r\n\t\tif (isset($this->inForm))\r\n\t\t{\r\n\t\t\t$CObjID = $this->UID('calendar');\r\n\t\t\t$DateString = ($this->Value()) ? '\",\"'.$this->Value() : '';\r\n\t\t\t$this->output = '<script language=\"javascript\">'.\"\\n\".'var '.$CObjID.' = new Calendar(\"'.$this->ID.$DateString.'\");'.\"\\n\"\r\n\t\t\t.$CObjID.'.currentDateStyle = \"'.$this->currentDateStyle.'\";'.\"\\n\"\r\n\t\t\t.$CObjID.'.selectedDateStyle = \"'.$this->selectedDateStyle.'\";'.\"\\n\"\r\n\t\t\t.$CObjID.'.normalDateStyle = \"'.$this->normalDateStyle.'\";'.\"\\n\"\r\n\t\t\t.$CObjID.'.setStyles();'.\"\\n\"\r\n\t\t\t.'</script>'.\"\\n\"\r\n\t\t\t.'<input type=\"hidden\" id=\"'.$CObjID.'\" name=\"'.$CObjID.'\" value=\"'.$this->Value().'\"/>'.\"\\n\";\r\n\t\t}\r\n\t\telse $this->output = '';\r\n\r\n\t\t$NavUrls = $this->url_params($this->UID('year'),$this->UID('month'),$this->UID('day'),array_keys($this->add_params_sel));\r\n\r\n\t\t$this->output.= '<table class=\"calendar\"><tr><td class=\"'.$this->navigateStyle.'\"><a id=\"'.$this->UID('navigateback').'\" class=\"'.$this->navigateStyle.'\" href=\"'.$this->getURL().\r\n\t\t\t'?'.$this->add_params_sel().'&'.$this->UID('month').'='.($this->month-1).'&'.$this->UID('year').'='.$this->year.$NavUrls.'\"><</a>\r\n\t\t </td><td id=\"'.$this->UID('Month').'\" colspan=\"5\" class=\"'.$this->monthStyle.'\">'.$this->RUS_MONTHS[date(\"n\", mktime(0, 0, 0, $this->month, 1, $this->year))-1].'&nbsp;'.$this->year.'\r\n\t\t </td><td class=\"'.$this->navigateStyle.'\"><a id=\"'.$this->UID('navigatenext').'\" class=\"'.$this->navigateStyle.'\" href=\"'.$this->getURL().'?'.$this->add_params_sel().'&'.$this->UID('month').'='.($this->month+1).'&'.$this->UID('year').'='.$this->year.$NavUrls.'\">></a>\r\n\t\t </td></tr><tr class=\"'.$this->daysOfTheWeekStyle.'\"><td>Ïí</td><td>Âò</td><td>Ñð</td><td>×ò</td><td>Ïò</td><td>Ñá</td><td>Âñ</td></tr>';\r\n\r\n \tfor ($Week=0;$Week<6;$Week++)\r\n \t{\r\n \t$this->output.= '<tr>';\r\n\r\n\t\t\t\tfor ($Day=0;$Day<7;$Day++)\r\n \t{\r\n\r\n\t\t\t\t\t$days++;\r\n\t\t\t\t\t$dDay = $days - $first_spaces;\r\n\t\t\t\t\t$norm_style = ($this->isDayAvailable($dDay))?$this->availDateStyle:$this->normalDateStyle;\r\n\t\t\t\t\t\r\n//\t\t\t\t\techo('dDay='.$dDay.'<br/>avail dates:');\r\n//\t\t\t\t\tforeach($this->availDates as $date)\r\n//\t\t\t\t\t\techo(date('d/m/Y',$date).'<br/>');\r\n\r\n\t\t\t\t\t$CellID = $this->UID('item['.$days.']');\r\n\r\n\t\t\t\t\tif ($days > $first_spaces && ($dDay) < $total_days + 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$LinkID = $this->UID('hlink['.$days.']');\r\n\t\t\t\t\t\t$currentSelectedDay = '<td id=\"'.$CellID.'\" class=\"'.$this->selectedDateStyle.'\"><a id=\"'.$LinkID.'\" class=\"'.$this->selectedDateStyle.'\"';\r\n\t\t\t\t\t\t$CurrentDate = isset($_REQUEST[$currentday]) ? $_REQUEST[$currentday]: '';\r\n\r\n\t\t\t\t\t\tif ($CurrentDate == $dDay)\t$this->output.= $currentSelectedDay;\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$this->output.='<td id=\"'.$CellID.'\" class=';\r\n\t\t\t\t\t\t\t$this->output.= ($dDay==date(\"j\") && $this->year==date(\"Y\") && $this->month==date(\"n\")) ?\r\n\t\t\t\t\t\t\t\t'\"'.$this->currentDateStyle.'\"><a id=\"'.$LinkID.'\" class=\"'.$this->currentDateStyle.'\"' :\r\n\t\t\t\t\t\t\t\t'\"'.$norm_style.'\"><a id=\"'.$LinkID.'\" class=\"'.$this->normalDateStyle.'\"';\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif($this->isDayAvailable($dDay))\r\n\t\t\t\t\t\t\t$this->output.= 'href=\"'.$this->redirect.'?'.$this->add_params_day().'&'.$currentday.'='.$dDay.$this->url_params($currentday,array_keys($this->add_params_day)).'\">'.$dDay.'</a></td>';\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$this->output.= '>'.$dDay.'</a></td>';\r\n\r\n\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$this->output.='<td id=\"'.$CellID.'\" class=\"'.$this->normalDateStyle.'\"></td>'.\"\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$this->output.=\"</tr>\";\r\n \t}\r\n\r\n\t\t$this->output.= '</table>';\r\n\r\n\t\treturn $this->output;\r\n\t}", "public function calendar()\n {\n return view('pages.calendar');\n }", "public function index()\n {\n $this->view('calendar');\n }", "public function calendar()\n {\n return view('calendar');\n }", "public function getCalendarPage();", "function academic_calendar(){\n $data['content_page']='admin/academic_calendar';\n $this->load->view('common/base_template',$data);\n }", "public function ownerCombinedCal()\n {\n // Restricted access\n if ( ! $this->ownerLoggedIn() )\n {\n $this->restricted();\n return;\n }\n\n require_once('views/OwnerCombinedCalView.class.php');\n $site = new SiteContainer($this->db);\n $page = new OwnerCombinedCalView();\n \n $site->printHeader();\n $site->printNav(\"owner\");\n $site->printCombinedCalFooter();\n $page->printHtml();\n $page->printCalendar(); \n\n }", "public function actionEvents()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('events');\n\t}", "public function calendarIndex()\n {\n return view('calendar');\n }", "function output_calendar() // Generating calendar HTML content\r\n\t{\r\n\t\t# Apparently, it's not possible to dereference $this->callback()\r\n\t\t$cb = $this->callback;\r\n\r\n\t\t# Preliminary calculations\r\n\t\t$t = getdate(strtotime($this->date));\r\n\t\t$today = $t[\"mday\"];\r\n\t\t$year = $t[\"year\"];\r\n\t\t$month = $t[\"mon\"];\r\n\t\t# Get first day of the month (monday = 0)\r\n\t\t$first_wday = ((int) date(\"w\", mktime(0, 0, 0, $month, 1, $year))+6)%7;\r\n\t\t# Last day of the month\r\n\t\t$last_mday = (int) date(\"d\", mktime(0, 0, 0, $month+1, 0, $year));\r\n\r\n\t\t# Anchor\r\n\t\t//$this->content[].=\"<a name=\\\"calendar\\\">\";\r\n\r\n\t\t# Table\r\n\t\t$this->content[].=\"<table width=\\\"100%\\\" align=\\\"center\\\" cellpadding=\\\"0\\\" cellspacing=\\\"2\\\" class=\\\"calendar\\\">\\n\";\r\n\r\n\t\t# Table head\r\n\t\t$this->content[].=\"<tr><td colspan=\\\"7\\\" class=\\\"calendar_header\\\">{$this->month_name[$month - 1]}&nbsp;&nbsp;&nbsp;{$t['year']}</td></tr>\\n<tr>\\n\";\r\n\t\tfor ($j = 0;$j <= 6;$j++) {\r\n\t\t\t$this->content[].=\"<th class=\\\"calendar_title\\\">\";\r\n\t\t\t$this->content[].=\"{$this->day_name[$j]}\";\r\n\t\t\t$this->content[].=\"</th>\\n\";\r\n\t\t}\r\n\t\t$this->content[].=\"</tr>\\n\";\r\n\r\n\t\t// Day row\r\n\t\t// A month is displayed on 6 rows\r\n\t\t// except for a 28 days month starting on Monday\r\n\t\tif (($last_mday == 28) and ($first_wday == 0))\r\n\t\t$jmax = 27;\r\n\t\telse\r\n\t\t$jmax = 41;\r\n\r\n\t\tfor ($j = 0;$j <= $jmax;$j++) {\r\n\t\t\t# Start new row on Monday\r\n\t\t\tif ($j % 7 == 0)\r\n\t\t\t$this->content[].=\"<tr>\\n\";\r\n\r\n\t\t\t// Title colour for current day and checking week end days\r\n\r\n\t\t\tif (($j == $today+$first_wday-1) and ($j % 7 == 6)) // if today and weekend day\r\n\t\t\t$this->content[].=\"<td class=\\\"calendar_title_we\\\">\";\r\n\r\n\t\t\tif (($j % 7 == 6) and ($j != $today+$first_wday-1)) // if weekend day and not today\r\n\t\t\t$this->content[].=\"<td class=\\\"calendar_day_we\\\">\";\r\n\r\n\r\n\t\t\tif (($j == $today+$first_wday-1) and ($j % 7 != 6)) // if today and not weekend day\r\n\t\t\t$this->content[].=\"<td class=\\\"calendar_title\\\">\";\r\n\r\n\t\t\tif (($j % 7 != 6) and ($j != $today+$first_wday-1)) // if not today and not weekend day\r\n\t\t\t$this->content[].=\"<td class=\\\"calendar_day\\\">\";\r\n\r\n\t\t\tif (($j<$first_wday) or ($j>=$last_mday + $first_wday)) {\r\n\r\n\t\t\t\t# Empty boxes\r\n\t\t\t\t$this->content[].=\"&nbsp;\";\r\n\t\t\t} else {\r\n\t\t\t\tif (isset($cb))\r\n\t\t\t\techo $cb(mktime(0, 0, 0, $month, $j - $first_wday + 1, $year));\r\n\t\t\t\t$this->content[].=date($this->date_format, mktime(0, 0, 0, $month, $j - $first_wday + 1, $year));\r\n\t\t\t\tif (isset($cb))\r\n\t\t\t\t$this->content[].=\"</a>\\n\";\r\n\t\t\t}\r\n\t\t\t$this->content[].=\"</td>\\n\";\r\n\r\n\t\t\t# End of row on Sunday\r\n\t\t\tif ($j % 7 == 6)\r\n\t\t\t$this->content[].=\"</tr>\\n\";\r\n\t\t}\r\n\t\t$this->content[].=\"</table>\\n\";\r\n\t}", "public function index()\n {\n return view('Shift::calendar.index');\n }", "public function getOutput()\n\t{\n\t\tif( ! IPSLib::appIsInstalled( 'calendar' ) )\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t/* Load language */\n\t\t$this->registry->class_localization->loadLanguageFile( array( 'public_calendar' ), 'calendar' );\n\n\t\t/* Load calendar library */\n\t\t$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'calendar' ) .'/modules_public/calendar/view.php', 'public_calendar_calendar_view' );\n\t\t$cal = new $classToLoad();\n\t\t$cal->makeRegistryShortcuts( $this->registry );\n\t\t\n\t\tif( !$cal->initCalendar( true ) )\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t/* Return calendar */\n\t\treturn \"<div id='hook_calendar' class='calendar_wrap'>\". $cal->getMiniCalendar( date('n'), date('Y') ) . '</div><br />';\n\t}", "public function render(): void {\r\n $pages = MJKGTAPI::pages();\r\n $wp_cron = get_option('cron');\r\n\r\n $this->render_css();\r\n\r\n printf('<div class=\"wrap\">');\r\n $this->output_intro();\r\n printf('<div id=\"%s\">', self::id_main);\r\n $this->output_sections($pages, $wp_cron);\r\n printf('</div></div>');\r\n }", "public function run()\n {\n if (!addon_installed('calendar')) {\n return new Tempcode();\n }\n\n require_lang('calendar');\n\n $bits = new Tempcode();\n if (get_option('calendar_show_stats_count_events') == '1') {\n $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'bf4ae0b77a8ee8bef42adb8d7beb3884', 'KEY' => do_lang_tempcode('EVENTS'), 'VALUE' => integer_format($GLOBALS['SITE_DB']->query_select_value('calendar_events', 'COUNT(*)')))));\n }\n if (get_option('calendar_show_stats_count_events_this_week') == '1') {\n require_code('calendar');\n $events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), $GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 7));\n $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '315d49be79dddfe1019c02939d308632', 'KEY' => do_lang_tempcode('EVENTS_THIS_WEEK'), 'VALUE' => integer_format(count($events)))));\n }\n if (get_option('calendar_show_stats_count_events_this_month') == '1') {\n require_code('calendar');\n $events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), $GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 31));\n $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'c3a3ad0d6ae8e4f98ac3a5d0ceabc841', 'KEY' => do_lang_tempcode('EVENTS_THIS_MONTH'), 'VALUE' => integer_format(count($events)))));\n }\n if (get_option('calendar_show_stats_count_events_this_year') == '1') {\n require_code('calendar');\n $events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), $GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 365));\n $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'f77394adef0febff55cbfc288f979408', 'KEY' => do_lang_tempcode('EVENTS_THIS_YEAR'), 'VALUE' => integer_format(count($events)))));\n }\n\n if ($bits->is_empty_shell()) {\n return new Tempcode();\n }\n\n $section = do_template('BLOCK_SIDE_STATS_SECTION', array('_GUID' => 'ff9667093f093bec44a7be5e97bf183c', 'SECTION' => do_lang_tempcode('CALENDAR'), 'CONTENT' => $bits));\n\n return $section;\n }", "public function render()\n {\n $result = array();\n\n if ($this->hasSources())\n {\n $visibleSources = 0;\n\n $result[] = '<div class=\"panel panel-default table-calendar-legend\">';\n $result[] = '<div class=\"panel-heading\">';\n $result[] = '<h4 class=\"panel-title\">' . Translation::get('Legend') . '</h4>';\n $result[] = '</div>';\n $result[] = '<ul class=\"list-group\">';\n\n $sources = $this->getSources();\n\n sort($sources);\n\n foreach ($sources as $source)\n {\n $sourceClasses = $this->getSourceClasses($source);\n\n if ($this->getDataProvider()->supportsVisibility())\n {\n $isSourceVisible = $this->getDataProvider()->isSourceVisible($source);\n $eventClasses = ! $isSourceVisible ? ' event-container-source-faded' : '';\n }\n else\n {\n\n $eventClasses = '';\n }\n\n $result[] = '<li class=\"list-group-item\">';\n $result[] = '<div class=\"event-source' . $eventClasses . '\" data-source-key=\"' .\n $this->addSource($source) . '\" data-source=\"' . $source . '\">';\n $result[] = '<span class=\"event-container ' . $sourceClasses . '\"></span>';\n $result[] = $source;\n $result[] = '</div>';\n $result[] = '</li>';\n\n if ($this->getDataProvider()->supportsVisibility())\n {\n if ($isSourceVisible)\n {\n $visibleSources ++;\n }\n }\n }\n\n $result[] = '</ul>';\n $result[] = '</div>';\n\n if ($this->getDataProvider()->supportsVisibility())\n {\n $result[] = '<script type=\"text/javascript\">';\n $result[] = 'var calendarVisibilityContext = ' .\n json_encode($this->getDataProvider()->getVisibilityContext()) . ';';\n $result[] = '</script>';\n\n $result[] = ResourceManager::getInstance()->get_resource_html(\n Path::getInstance()->getJavascriptPath(__NAMESPACE__, true) . 'Highlight.js');\n\n if ($visibleSources == 0)\n {\n $notificationMessageManager = new NotificationMessageManager();\n $notificationMessageManager->addMessage(\n new NotificationMessage(\n Translation::get('AllEventSourcesHidden'),\n NotificationMessage::TYPE_WARNING));\n }\n }\n }\n\n return implode(PHP_EOL, $result);\n }", "function event_grid_view() {\n\tsp_calendar_grid();\n}", "protected function renderCalendarView($model)\n {\n $events = $model->getFullCalendarEvents();\n\n if (empty($events))\n echo RRuleForm::t($this->emptyDateTimesText);\n else\n {\n $widget = $this->createRRuleForm();\n $widget->render($this->getCalendarView(), array('events' => $events));\n }\n }", "function view_ical()\n\t{\n\t\t\n\t\tif (!JRequest::getVar('format') == 'raw') {\n\t\t\t$this->setRedirect(JURI::root(false).'administrator/index.php?option=com_pbbooking&controller=manage&task=view_ical&id='.JRequest::getInt('id').'&format=raw');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$view=$this->getView('manage','raw');\n\t\t$view->setLayout('ics_view');\n\t\t\n\t\t$db = JFactory::getDbo();\n\n\t\t$db->setQuery('select * from #__pbbooking_events where id='.$db->escape((int)JRequest::getInt('id')));\t\t\n\t\t$view->event = $db->loadObject();\n\t\t\n\t\t$view->display();\n\t}", "public function index()\n {\n return view('calendar.calendar');\n }", "public function render() {\n echo \"BEGIN:VCALENDAR\\r\\n\";\n echo \"VERSION:2.0\\r\\n\";\n echo \"PRODID:-//X2Engine//NONSGML X2 Calendar//EN\\r\\n\";\n \n if (is_array($this->_actions)) {\n $actionsPrinted = array();\n $users = array();\n foreach($this->_actions as $action) {\n // skip events showing up more than once (i.e. combined cal)\n if(!($action instanceof Actions) || !empty($actionsPrinted[$action->id])) \n continue;\n // Render a VEVENT for each action\n echo \"BEGIN:VEVENT\\r\\n\";\n // Treat the first assignee as the one to use for generating the \"organizer\" \n // and all of the assignees for the unique ID field\n $assignees = $action->getAssignees();\n if(!empty($assignees)) {\n $first = reset($assignees);\n echo \"UID:\".$action->assignedTo.\"-\".$action->id.\"@\".$_SERVER['SERVER_NAME'].\"\\r\\n\";\n \n if (!empty($first) && !array_key_exists($first, $users)) {\n // cache user emails\n $user = User::model()->findByAttributes(array('username'=>$first));\n $users[$first] = array(\n 'name'=>$user->name, \n 'email'=>$user->emailAddress,\n 'timeZone'=>$user->profile->timeZone\n );\n }\n $tz = $users[$first]['timeZone'];\n echo \"ORGANIZER;CN=\\\"\".$users[$first]['name'].\"\\\":mailto:\".$users[$first]['email'].\"\\r\\n\";\n } else {\n // Default app timezone (which is actually stored as the column default value)\n $tz = Profile::model()->tableSchema->columns['timeZone']->defaultValue;\n echo \"UID:Anyone-{$action->id}@{$_SERVER['SERVER_NAME']}\\r\\n\";\n }\n $start = new DateTime();\n $end = new DateTime();\n $tzOb = new DateTimeZone($tz);\n $start->setTimestamp($action->dueDate);\n $end->setTimestamp($action->completeDate);\n $start->setTimezone($tzOb);\n $end->setTimezone($tzOb);\n echo \"DTSTART;TZID=$tz:\".$start->format('Ymd\\THis').\"\\r\\n\";\n echo \"DTEND;TZID=$tz:\".$end->format('Ymd\\THis').\"\\r\\n\";\n echo \"SUMMARY:\".self::escapeText($action->actionText->text).\"\\r\\n\";\n echo \"END:VEVENT\\r\\n\";\n $actionsPrinted[$action->id] = true;\n }\n }\n\n echo \"END:VCALENDAR\\r\\n\";\n }", "public function render()\n {\n switch ($this->form) {\n case 'v':\n case 'vertical':\n return view('components.forms.date-vertical');\n break;\n default:\n return view('components.forms.date');\n break;\n }\n }", "function rst_manage_seats_moncalender()\n{\n require_once('inc/inc.fullcalendar.php');\n}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $events = $em->getRepository('MALrmBundle:CalendarEvent')->findAll();\n\n\n return $this->render('MALrmBundle:event:index.html.twig', array(\n 'events' => $events,\n ));\n }", "function index() {\r\n $this->view->render('worldclock/index');\r\n }", "function display_day()\n{\n global $phpcid, $phpc_cal, $phpc_script, $phpcdb, $day, $month, $year;\n\n\t$monthname = month_name($month);\n\n $results = $phpcdb->get_occurrences_by_date($phpcid, $year, $month, $day);\n\n\t$have_events = false;\n\n\t$html_table = tag('table', attributes('class=\"phpc-main\"'),\n\t\t\ttag('caption', \"$day $monthname $year\"),\n\t\t\ttag('thead',\n\t\t\t\ttag('tr',\n\t\t\t\t\ttag('th', __('Title')),\n\t\t\t\t\ttag('th', __('Time')),\n\t\t\t\t\ttag('th', __('Description'))\n\t\t\t\t )));\n\tif($phpc_cal->can_modify()) {\n\t\t$html_table->add(tag('tfoot',\n\t\t\t\t\ttag('tr',\n\t\t\t\t\t\ttag('td',\n\t\t\t\t\t\t\tattributes('colspan=\"4\"'),\n\t\t\t\t\t\t\tcreate_hidden('action', 'event_delete'),\n\t\t\t\t\t\t\tcreate_hidden('day', $day),\n\t\t\t\t\t\t\tcreate_hidden('month', $month),\n\t\t\t\t\t\t\tcreate_hidden('year', $year),\n\t\t\t\t\t\t\tcreate_submit(__('Delete Selected'))))));\n\t}\n\n\t$html_body = tag('tbody');\n\n\twhile($row = $results->fetch_assoc()) {\n\t\n\t\t$event = new PhpcOccurrence($row);\n\n\t\tif(!$event->can_read())\n\t\t\tcontinue;\n\n\t\t$have_events = true;\n\n\t\t$eid = $event->get_eid();\n\t\t$oid = $event->get_oid();\n\n\t\t$html_subject = tag('td');\n\n\t\tif($event->can_modify()) {\n\t\t\t$html_subject->add(create_checkbox('eid[]',\n\t\t\t\t\t\t$eid));\n\t\t}\n\n\t\t$html_subject->add(create_occurrence_link(tag('strong',\n\t\t\t\t\t\t$event->get_subject()),\n\t\t\t\t\t'display_event', $oid));\n\n\t\tif($event->can_modify()) {\n\t\t\t$html_subject->add(\" (\");\n\t\t\t$html_subject->add(create_event_link(\n\t\t\t\t\t\t__('Modify'), 'event_form',\n\t\t\t\t\t\t$eid));\n\t\t\t$html_subject->add(')');\n\t\t}\n\n\t\t$html_body->add(tag('tr',\n\t\t\t\t\t$html_subject,\n\t\t\t\t\ttag('td', $event->get_time_span_string()),\n\t\t\t\t\ttag('td', attributes('class=\"phpc-desc\"'), $event->get_desc())));\n\t}\n\n\t$html_table->add($html_body);\n\n\tif($phpc_cal->can_modify()) {\n\t\t$output = tag('form',\n\t\t\t\tattributes(\"action=\\\"$phpc_script\\\"\"),\n\t\t\t\t$html_table);\n\t} else {\n\t\t$output = $html_table;\n\t}\n\n\tif(!$have_events)\n\t\t$output = tag('h2', __('No events on this day.'));\n\n\treturn tag('', create_day_menu(), $output);\n}", "public function index()\n {\n $title = translate('📆');\n return view('backend.'.Auth::user()->role.'.event_calendar.index', compact('title'));\n }", "public function RenderHtmlTemplateInvoiceRunEventsView()\n\t{\n\t\treturn $this->RenderHtmlTemplateInvoiceRunEvents(HTML_CONTEXT_VIEW);\n\t}", "public function index()\n {\n\n return view('webapp-layouts.calendar.agenda');\n }", "public function hideStartDay()\n\t{\n\t\treturn '\n <script>\n var enableStartDay = function() {\n var e1 = $(\"ctrl_news_startDay\").getParent(\"div\");\n var e2 = $(\"ctrl_news_order\").getParent(\"div\");\n if ($(\"ctrl_news_format\").value == \"news_day\") {\n e1.setStyle(\"display\", \"block\");\n e2.setStyle(\"display\", \"none\");\n\t } else {\n e1.setStyle(\"display\", \"none\");\n e2.setStyle(\"display\", \"block\");\n\t }\n };\n window.addEvent(\"domready\", function() {\n if ($(\"ctrl_news_startDay\")) {\n enableStartDay();\n $(\"ctrl_news_format\").addEvent(\"change\", enableStartDay);\n }\n });\n </script>';\n\t}", "function events(){\n if(!$this->session->userdata('logged_in') || $this->session->userdata('role') != 'student'):\n redirect('/');\n endif;\n\n $data = array(\n 'events' => $this->admin_model->browse(array('module' => 'events'))\n );\n //load content\n $this->template->content->view('/students/content/events', $data);\n\n //add js file\n $this->template->publish('layouts/app');\n }", "public function index()\n {\n $events = [];\n $data = Event::all();\n if($data->count()) {\n foreach ($data as $key => $value) {\n $events[] = Calendar::event(\n $value->title,\n true,\n new \\DateTime($value->start_date),\n new \\DateTime($value->end_date.' +1 day'),\n null,\n // Add color and link on event\n [\n 'color' => '#0fc',\n 'url' => 'pass here url and any route',\n ]\n );\n }\n }\n $calendar = Calendar::addEvents($events);\n return view('calender.calender', compact('calendar')); \n }", "public function render()\r\n\t{\r\n\t\tif( $this->_layout && file_exists($this->_layout) )\r\n\t\t{\r\n\t\t\t$this->_layout = apply_filters( 'tp_event_meta_box_layout', $this->_layout, $this->_id );\r\n\t\t\tdo_action( 'tp_event_before_metabox', $this->_id );\r\n\t\t\trequire_once $this->_layout;\r\n\t\t\tdo_action( 'tp_event_after_metabox', $this->_id );\r\n\t\t}\r\n\t}", "public function render() {\n\t\techo '<div id=\"neve-dashboard\"></div>';\n\t}", "public function eventSchedule()\n {\n $speakerName = array(\n \"daniela-pitta\"\n ,\"helena-saminez\"\n ,\"galvao-abbott\"\n ,\"bruno-porkaria\"\n ,\"atmos-maciel\"\n ,\"evaldo-barbosa\"\n ,\"fabio-soares\"\n ,\"nanderson-castro\"\n ,\"ricardo-coelho\"\n ,\"willian-mano\"\n ,\"romulo-martins\"\n ,\"alisson-gomes\"\n ,\"henrique-monteiro\"\n ,\"paulo-coelho\"\n );\n\n return $this->app['twig']->render('/when/when.twig',\n [\n 'link_when' => 'quando'\n ,'link_who' => '/quem'\n ,'speakerName' => $speakerName\n ]\n );\n }", "function render_block_core_post_date($attributes, $content, $block)\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 = '### EVENT CALENDAR ###';\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\treturn parent::generate();\n\t}", "public function embed()\n {\n global $page_output, $registry;\n\n /* First, determine the type of view we are asking for */\n $view = $this->vars->view;\n\n /* The DOM container to put the HTML in on the remote site */\n $container = $this->vars->container;\n\n /* The share_name of the calendar to display */\n $calendar = $this->vars->calendar;\n\n /* Deault to showing only 1 month when we have a choice */\n $count_month = $this->vars->get('months', 1);\n\n /* Default to no limit for the number of events */\n $max_events = $this->vars->get('maxevents', 0);\n\n /* Default to one week */\n $count_days = $this->vars->get('days', 7);\n\n if ($this->vars->css == 'none') {\n $nocss = true;\n }\n\n /* Build the block parameters */\n $params = array(\n 'calendar' => $calendar,\n 'maxevents' => $max_events,\n 'months' => $count_month,\n 'days' => $count_days\n );\n\n /* Call the Horde_Block api to get the calendar HTML */\n $title = $registry->call('horde/blockTitle', array('kronolith', $view, $params));\n $results = $registry->call('horde/blockContent', array('kronolith', $view, $params));\n\n /* Some needed paths */\n $js_path = $registry->get('jsuri', 'kronolith');\n\n /* Local js */\n $jsurl = Horde::url($js_path . '/embed.js', true);\n\n /* Horde's js */\n $hjs_path = $registry->get('jsuri', 'horde');\n $hjsurl = Horde::url($hjs_path . '/tooltips.js', true);\n $pturl = Horde::url($hjs_path . '/prototype.js', true);\n\n /* CSS */\n if (empty($nocss)) {\n $page_output->addThemeStylesheet('embed.css');\n\n Horde::startBuffer();\n $page_output->includeStylesheetFiles(array('nobase' => true), true);\n $css = Horde::endBuffer();\n } else {\n $css = '';\n }\n\n /* Escape the text and put together the javascript to send back */\n $container = Horde_Serialize::serialize($container, Horde_Serialize::JSON);\n $results = Horde_Serialize::serialize('<div class=\"kronolith_embedded\"><div class=\"title\">' . $title . '</div>' . $results . '</div>', Horde_Serialize::JSON);\n\n $js = <<<EOT\nif (typeof kronolith == 'undefined') {\n if (typeof Prototype == 'undefined') {\n document.write('<script type=\"text/javascript\" src=\"$pturl\"></script>');\n }\n if (typeof Horde_ToolTips == 'undefined') {\n Horde_ToolTips_Autoload = false;\n document.write('<script type=\"text/javascript\" src=\"$hjsurl\"></script>');\n }\n kronolith = new Object();\n kronolithNodes = new Array();\n document.write('<script type=\"text/javascript\" src=\"$jsurl\"></script>');\n document.write('$css');\n}\nkronolithNodes[kronolithNodes.length] = $container;\nkronolith[$container] = $results;\nEOT;\n\n return new Horde_Core_Ajax_Response_Raw($js, 'text/javascript');\n }", "public function show() {\n $year = null;\n \n $month = null;\n \n if(null==$year&&isset($_GET['year'])){\n \n $year = $_GET['year'];\n \n }else if(null==$year){\n \n $year = date(\"Y\",time()); \n \n } \n \n if(null==$month&&isset($_GET['month'])){\n \n $month = $_GET['month'];\n \n }else if(null==$month){\n \n $month = date(\"m\",time());\n \n } \n \n $this->thisYear=$year;\n \n $this->thisMonth=$month;\n \n $this->daysInMonth=$this->_daysInMonth($month,$year); \n \n $content='<div id=\"calendar\">'.\n\t\t\t\t\t\"<img src = 'img/manadensbabe/$month.jpg'>\".\n\t\t\t\t\t\n '<div class=\"box\">'.\n $this->_createNavi().\n '</div>'.\n '<div class=\"box-content\">'.\n '<ul class=\"label\">'.$this->_createCalender().'</ul>'; \n $content.='<div class=\"clear\"></div>'; \n $content.='<ul class=\"dates\">'; \n \n $weeksInMonth = $this->_weeksInMonth($month,$year);\n \n for( $i=0; $i<$weeksInMonth; $i++ ){\n \n for($j=1;$j<=7;$j++){\n $content.=$this->_showDay($i*7+$j);\n }\n }\n \n $content.='</ul>';\n \n $content.='<div class=\"clear\"></div>'; \n \n $content.='</div>';\n \n $content.='</div>';\n return $content; \n }", "function display($cacheable=false,$options=array())\n {\t\n \tPbdebug::log_msg('Calling display method in front end','com_pbbooking'); \t\n \t//load up the view\n \t$view = $this->getView('PBBooking','html');\n \t$view->setLayout('calendar');\n \t\n \t//populate needed data into the view.\n \t$db = JFactory::getDBO();\n \t\n \t$db->setQuery(\"select * from #__pbbooking_config\");\n \t$view->config = $db->loadObject();\n\t\t$view->calendar_message = $view->config->calendar_message;\n\t\t$view->now = date_create(\"now\",new DateTimeZone(PBBOOKING_TIMEZONE));\n\t echo($view->now->format(\"Y-m-d H:i:sP\"));\t\n \t//am I passing a selected date from the view, either in the heading or in the body?\n\t\tif (JRequest::getVar('dateparam')) {\n\t\t\t$view->dateparam = date_create(JRequest::getVar('dateparam'),new DateTimeZone(PBBOOKING_TIMEZONE));\n\t\t} else {\n\t\t\t$view->dateparam = date_create(\"now\",new DateTimeZone(PBBOOKING_TIMEZONE));\n\t\t}\n\n\t\t$config =JFactory::getConfig();\n \t$view->dateparam->setTimezone(new DateTimezone($config->get('offset')));\n\t\t\n\t\t//parse a valid cal from the database\t\t\n\t\tif ($view->config->consolidated_view == 0) {\n\t\t\t$db->setQuery(\"select * from #__pbbooking_cals\");\n\t\t\t$cals = $db->loadObjectList();\n\t\t\tforeach ($cals as $cal) {\n\t\t\t\t$new_cal = new calendar();\n\t\t\t\t$new_cal->loadCalendarFromDbase(array($cal->id));\n\t\t\t\t$new_cal->cal_id = $cal->id;\n\t\t\t\t$new_cal->name = $cal->name;\n\t\t\t\t$view->cals[]=$new_cal;\n\t\t\t}\n\t\t} else {\n\t\t\t$db->setQuery(\"select id from #__pbbooking_cals\");\n\t\t\t$cals = $db->loadResultArray();\n\t\t\t$view->cal = new calendar();\n\t\t\t$view->cal->loadCalendarFromDbase($cals);\t\n\t\t}\n\t\t\n\t\t//a hack for block same say...\n\t\tif ($view->config->block_same_day == 1 && date_create(\"now\",new DateTimeZone(PBBOOKING_TIMEZONE))->format(\"z\") == $view->dateparam->format(\"z\") ) {\n\t\t\t$view->dateparam->modify(\"+1 day\");\n\t\t}\n\t\t\n \t//display the view.\n \t$view->display();\t\t\t\n }", "public function cal_indexAction()\n {\n $startDate = date(\"Y-m-d\") ;\n $endDate = date(\"Y-m-d\", mktime(0,0,0,date(\"m\"),date(\"d\"),date(\"Y\")+1));\n $em = $this->getDoctrine()->getManager();\n $dql1 = \"SELECT c.title,c.date,c.time,c.description FROM EnglishCalendarBundle:Calendar c WHERE c.date >= ?1 and c.date < ?2 ORDER BY c.date ASC\";\n $calendar = $em->createQuery($dql1)->setParameter('1',$startDate)->setParameter('2',$endDate)->getResult();\n return $this->render('EnglishHomeBundle:Default:cal_index.html.twig', array('calendar' => $calendar,));\n\n }", "public function index()\n {\n return view('calendario_main');\n }", "public function RenderHtmlTemplateInvoiceRunEventsManage()\n\t{\n\t\tAuthenticatedUser()->CheckAuth();\n\t\tAuthenticatedUser()->PermissionOrDie(PERMISSION_ADMIN);\n\n\t\t$this->_manage();\n\n\t\t// Render the CustomerGroupDetails HtmlTemplate for Viewing\n\t\tAjax()->RenderHtmlTemplate(\"InvoicerunEvent\", HTML_CONTEXT_DEFAULT, DBO()->Container->Id->Value);\n\n\t\treturn TRUE;\n\t}", "function render_block_core_comment_date($attributes, $content, $block)\n {\n }", "public function show(Calendar $calendar)\n {\n //\n }", "public function show(Calendar $calendar)\n {\n //\n }", "function icalendar_render_events( $url = '', $args = array() ) {\n\t$ical = new iCalendarReader();\n\treturn $ical->render( $url, $args );\n}", "public function index()\n {\n $this->render('example', [\"currentDate\" => date('Y-m-d')]);\n }", "function wp_print_community_events_markup()\n {\n }", "function generate_category_content()\n {\n global $conf, $page;\n\n $view_type = $page['chronology_view'];\n if ($view_type==CAL_VIEW_CALENDAR)\n {\n global $template;\n $tpl_var = array();\n if ( count($page['chronology_date'])==0 )\n {//case A: no year given - display all years+months\n if ($this->build_global_calendar($tpl_var))\n {\n $template->assign('chronology_calendar', $tpl_var);\n return true;\n }\n }\n\n if ( count($page['chronology_date'])==1 )\n {//case B: year given - display all days in given year\n if ($this->build_year_calendar($tpl_var))\n {\n $template->assign('chronology_calendar', $tpl_var);\n $this->build_nav_bar(CYEAR); // years\n return true;\n }\n }\n\n if ( count($page['chronology_date'])==2 )\n {//case C: year+month given - display a nice month calendar\n if ( $this->build_month_calendar($tpl_var) )\n {\n $template->assign('chronology_calendar', $tpl_var);\n }\n $this->build_next_prev();\n return true;\n }\n }\n\n if ($view_type==CAL_VIEW_LIST or count($page['chronology_date'])==3)\n {\n if ( count($page['chronology_date'])==0 )\n {\n $this->build_nav_bar(CYEAR); // years\n }\n if ( count($page['chronology_date'])==1)\n {\n $this->build_nav_bar(CMONTH); // month\n }\n if ( count($page['chronology_date'])==2 )\n {\n $day_labels = range( 1, $this->get_all_days_in_month(\n $page['chronology_date'][CYEAR] ,$page['chronology_date'][CMONTH] ) );\n array_unshift($day_labels, 0);\n unset( $day_labels[0] );\n $this->build_nav_bar( CDAY, $day_labels ); // days\n }\n $this->build_next_prev();\n }\n return false;\n }", "public function actionCalendar()\n {\n // Get current ID of logined user\n $userId = Yii::$app->user->getId() ?: '1000';\n $profile = (new UsersProfile())->getProfile();\n\n // Fill array keyes with [1, .., date(\"t\")].\n // date(\"t\") - count of days in current month\n $calendar = array_fill_keys(range(1, date(\"t\")), []);\n $model = new TaskQuery(Task::class);\n\n foreach ($model->getByCurrentMonth($userId)->all() as $task) {\n // Get current $task->date and create new DateTime object\n // $date->format(\"j\") -- Day of the month: 1, 2, .., 31\n // Fill array $calender with $task objects\n $date = \\DateTime::createFromFormat(\"Y-m-d H:i:s\", $task->deadline);\n $calendar[$date->format(\"j\")][] = $task;\n }\n\n return $this->render('calendar', \\compact('calendar', 'profile'));\n }", "function get_calendar($initial = \\true, $display = \\true)\n {\n }", "public static function icalendar() {\r\n $ical = \"BEGIN:VCALENDAR\".PHP_EOL;\r\n $ical .= \"VERSION:2.0\".PHP_EOL;\r\n\r\n $show_personal_bak = Calendar_Events::$calsettings->show_personal;\r\n $show_course_bak = Calendar_Events::$calsettings->show_course;\r\n $show_deadline_bak = Calendar_Events::$calsettings->show_deadline;\r\n $show_admin_bak = Calendar_Events::$calsettings->show_admin;\r\n Calendar_Events::set_calendar_settings(1,1,1,1);\r\n Calendar_Events::get_calendar_settings();\r\n $eventlist = Calendar_Events::get_calendar_events();\r\n Calendar_Events::set_calendar_settings($show_personal_bak,$show_course_bak,$show_deadline_bak,$show_admin_bak);\r\n Calendar_Events::get_calendar_settings();\r\n\r\n $events = array();\r\n foreach ($eventlist as $event) {\r\n $ical .= \"BEGIN:VEVENT\".PHP_EOL;\r\n $startdatetime = new DateTime($event->start);\r\n $ical .= \"DTSTART:\".$startdatetime->format(\"Ymd\\THis\").PHP_EOL;\r\n $duration = new DateTime($event->duration);\r\n $ical .= \"DURATION:\".$duration->format(\"\\P\\TH\\Hi\\Ms\\S\").PHP_EOL;\r\n $ical .= \"SUMMARY:[\".strtoupper($event->event_group).\"] \".$event->title.PHP_EOL;\r\n $ical .= \"DESCRIPTION:\".canonicalize_whitespace(strip_tags($event->content)).PHP_EOL;\r\n if ($event->event_group == 'deadline')\r\n {\r\n $ical .= \"BEGIN:VALARM\".PHP_EOL;\r\n $ical .= \"TRIGGER:-PT24H\".PHP_EOL;\r\n $ical .= \"DURATION:PT10H\".PHP_EOL;\r\n $ical .= \"ACTION:DISPLAY\".PHP_EOL;\r\n $ical .= \"DESCRIPTION:DEADLINE REMINDER for \".canonicalize_whitespace(strip_tags($event->title)).PHP_EOL;\r\n $ical .= \"END:VALARM\".PHP_EOL;\r\n }\r\n $ical .= \"END:VEVENT\".PHP_EOL;\r\n }\r\n $ical .= \"END:VCALENDAR\".PHP_EOL;\r\n return $ical;\r\n }", "function calendar()\n{\n /*\n $groups = getAllEvents();\n $fieldsToConvert = [\"name\", \"description\", \"context\", \"status\"];\n $groups = specialCharsConvertFromAnArray($groups, $fieldsToConvert);\n displaydebug($groups);\n */\n require_once \"view/calendar.php\";\n}", "public function calendario() {\n $datos['titulo'] = 'Calendario';\n $this->load->view('calendar/calendar_view',$datos);\n }", "public function render()\n {\n /** @var License[] $licenses */\n $licenses = $this->data['licenses'];\n $days = $this->data['days'];\n $this->getSharedView('Header')->render();\n $this->getSharedView('TopBar')->render();\n $this->getSharedView('SideBar')->render(); ?>\n<div class=\"container-fluid\">\n <div class=\"page-head bg-main\">\n <h1><i class=\"fa fa-fw fa-key\"></i> Expired licenses within the last <?php echo $days ?> days</h1>\n </div>\n <div class=\"table-responsive\">\n <table class=\"table table-condensed table-bordered table-hover\">\n <thead class=\"bg-main\">\n <tr>\n <th>#</th>\n <th>License ID</th>\n <th>License Serial</th>\n <th>License Client</th>\n <th>License Invoice</th>\n <th>License Product</th>\n <th>License Type</th>\n <th>License Expire</th>\n </tr>\n </thead>\n <tbody>\n <?php $i = 0; foreach ($licenses as $license): ?>\n <tr>\n <td><?php echo ++$i; ?></td>\n <td><?php echo $license->id; ?></td>\n <td><a href=\"<?php $this->publicPath() ?>Licenses/Show/<?php echo $license->id; ?>\"><?php echo $license->serial; ?></a></td>\n <td><a href=\"<?php $this->publicPath() ?>Clients/Show/<?php echo $license->client->id; ?>\"><?php echo $license->client->name; ?></a></td>\n <td><?php echo $license->invoice == null ? '' : str_pad($license->invoice->id,8,'0',STR_PAD_LEFT) ?></td>\n <td><a href=\"<?php $this->publicPath() ?>Products/Show/<?php echo $license->product->id; ?>\"><?php echo $license->product->name; ?></a></td>\n <td><?php echo $license->type->name; ?></td>\n <td><?php echo $this->formatSqlDateTime($license->expire, 'Y-m-d H:i:s', 'd/m/Y') ?></td>\n </tr>\n <?php endforeach; ?>\n </tbody>\n </table>\n </div>\n <div class=\"row\">\n <div class=\"panel\">\n <div class=\"panel-footer text-right\">\n <a href=\"<?php $this->publicPath() ?>Reports\" class=\"btn btn-link hidden-xs\">Reports</a>\n <a href=\"<?php $this->publicPath() ?>Reports\" class=\"btn btn-link btn-block visible-xs\">Reports</a>\n </div>\n </div>\n </div>\n</div>\n<?php\n $this->getSharedView('Footer')->render();\n }", "public function render()\n {\n return view('bs-component::form.field-template', ['field' => 'bs-component::form.field.datepicker']);\n }", "function draw_calendar($month,$year, $day=1){\n /* draw table */\n $draw_calendar_time_start = microtime(true);\n $get_xml_start_time = microtime(true);\n \n $calendar = '';\n $xml = autoCache(\"get_event_xml\", array());\n\n $after_xml_time_start = microtime(true);\n $classes = array(\n 1 => 'sun',\n 2 => 'mon',\n 3 => 'tue',\n 4 => 'wed',\n 5 => 'thu',\n 6 => 'fri',\n 7 => 'sat',\n );\n /* days and weeks vars now ... */\n $running_day = date('w',mktime(0,0,0,$month,1,$year));\n $days_in_month = date('t',mktime(0,0,0,$month,1,$year));\n $days_in_this_week = 1;\n $day_counter = 0;\n /* row for week one */\n $calendar.= '<ul class=\"calendar-row\">';\n /* print previous month days until the first of the current month */\n for($x = 0; $x < $running_day; $x++) {\n //Go in the past $x many days in the past\n $back = ($running_day - $x);\n $back = '-' . ($back) . ' days';\n $last_month_date = date('j', strtotime($back, strtotime($year . '-' . $month . '-01')));\n $calendar .= '<li class=\"' . $classes[$days_in_this_week] . ' event not-current\"><span>' . $last_month_date . '</span></li>';\n $days_in_this_week++;\n }\n\n $twig = makeTwigEnviron('/code/events/twig');\n $twig->getExtension('Twig_Extension_Core')->setTimezone('America/Chicago');\n $calendar .= $twig->render('calendar_rest.html',array(\n 'running_day' => $running_day,\n 'days_in_month' => $days_in_month,\n 'days_in_this_week' => $days_in_this_week,\n 'day_counter' => $day_counter,\n 'classes' => $classes,\n 'xml' => $xml,\n 'year' => $year,\n 'month' => $month));\n\n /* all done, return result */\n $draw_calendar_time_end = microtime(true);\n\n $draw_calendar_time = $draw_calendar_time_end - $draw_calendar_time_start;\n $after_xml_time = $draw_calendar_time_end - $after_xml_time_start;\n error_log(\"After XML draw_calendar in $after_xml_time seconds\\n\", 3, '/tmp/calendar.log');\n error_log(\"Full draw_calendar in $draw_calendar_time seconds\\n\", 3, '/tmp/calendar.log');\n return $calendar;\n}", "public function show()\n {\n $template = $this->getTemplate();\n\n $template->addCss('group', $this->getType());\n \n $this->decorateElement($template, 'dateStart');\n $this->decorateElement($template, 'dateEnd');\n\n $template->setAttr('dateStart', 'name', $this->getName() . 'Start');\n $template->setAttr('dateEnd', 'name', $this->getName() . 'End');\n $template->setAttr('dateStart', 'id', $this->getId().'Start');\n $template->setAttr('dateEnd', 'id', $this->getId().'End');\n\n // Set the field value\n $value = $this->getValue();\n if (is_array($value)) {\n if (!empty($value[$this->getName() . 'Start']))\n $template->setAttr('dateStart', 'value', $value[$this->getName() . 'Start']);\n if (!empty($value[$this->getName() . 'End']))\n $template->setAttr('dateEnd', 'value', $value[$this->getName() . 'End']);\n }\n\n return $template;\n }", "public function index()\n {\n return view('mystudio.calendar.index', [\n 'calendars' => Calendar::all(),\n ]);\n }", "public function home()\n {\n //var_dump($date);\n return $this->render('home.html.twig');\n }", "function show_calendar_events()\n\t{\n\t\t$stats_html = \"\";\n\t\t\n\t\tif ($this->ipsclass->vars['show_birthdays'] or $this->ipsclass->vars['show_calendar'] )\n\t\t{\n\t\t\t$a = explode( ',', gmdate( 'Y,n,j,G,i,s', time() + $this->ipsclass->get_time_offset() ) );\n\t\t\n\t\t\t$day = $a[2];\n\t\t\t$month = $a[1];\n\t\t\t$year = $a[0];\n\t\t\t\n\t\t\t$birthstring = \"\";\n\t\t\t$count = 0;\n\t\t\t$users = array();\n\t\t\t\n\t\t\tif ( $this->ipsclass->vars['show_birthdays'] )\n\t\t\t{\n\t\t\t\tif ( is_array($this->ipsclass->cache['birthdays']) AND count( $this->ipsclass->cache['birthdays'] ) )\n\t\t\t\t{\n\t\t\t\t\tforeach( $this->ipsclass->cache['birthdays'] as $u )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $u['bday_day'] == $day and $u['bday_month'] == $month )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$users[] = $u;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if( $day == 28 && $month == 2 && !date(\"L\") )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( $u['bday_day'] == \"29\" and $u['bday_month'] == $month )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$users[] = $u;\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\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Spin and print...\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\tforeach ( $users as $user )\n\t\t\t\t{\n\t\t\t\t\t$birthstring .= \"<a href='{$this->ipsclass->base_url}showuser={$user['id']}'>{$user['members_display_name']}</a>\";\n\t\t\t\t\t\n\t\t\t\t\tif ($user['bday_year'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$pyear = $year - $user['bday_year'];\n\t\t\t\t\t\t$birthstring .= \"(<b>$pyear</b>)\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$birthstring .= $this->sep_char.\"\\n\";\n\t\t\t\t\t\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Fix up string...\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$birthstring = preg_replace( \"/\".$this->sep_char.\"$/\", \"\", trim($birthstring) );\n\t\t\t\t\n\t\t\t\t$lang = $this->ipsclass->lang['no_birth_users'];\n\t\t\t\t\n\t\t\t\tif ($count > 0)\n\t\t\t\t{\n\t\t\t\t\t$lang = ($count > 1) ? $this->ipsclass->lang['birth_users'] : $this->ipsclass->lang['birth_user'];\n\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->birthdays( $birthstring, $count, $lang );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$count = \"\";\n\t\t\t\t\t\n\t\t\t\t\tif ( ! $this->ipsclass->vars['autohide_bday'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->birthdays( $birthstring, $count, $lang );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Are we viewing the calendar?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ($this->ipsclass->vars['show_calendar'])\n\t\t{\n\t\t\t$this->ipsclass->vars['calendar_limit'] = intval($this->ipsclass->vars['calendar_limit']) < 2 ? 1 : intval($this->ipsclass->vars['calendar_limit']);\n\t\t\t\n\t\t\t$our_unix = gmmktime( 0, 0, 0, $month, $day, $year);\n\t\t\t$max_date = $our_unix + ($this->ipsclass->vars['calendar_limit'] * 86400);\n\t\t\t$events = array();\n\t\t\t$show_events = array();\n\t\t\t\n\t\t\tif( $this->ipsclass->member['org_perm_id'] )\n\t\t\t{\n\t\t\t\t$member_permission_groups = explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->member['org_perm_id'] ) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member_permission_groups = explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->member['g_perm_id'] ) );\n\t\t\t\t\n\t\t\t\tif( isset($this->ipsclass->member['mgroup_others']) AND $this->ipsclass->member['mgroup_others'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->member['mgroup_others'] = $this->ipsclass->clean_perm_string($this->ipsclass->member['mgroup_others']);\n\t\t\t\t\t\n\t\t\t\t\t$mgroup_others = explode( \",\", $this->ipsclass->member['mgroup_others'] );\n\t\t\t\t\t\n\t\t\t\t\tif( count($mgroup_others) )\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach( $mgroup_others as $mgroup )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( $mgroup )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$member_permission_groups = array_merge( $member_permission_groups, explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->cache['group_cache'][$mgroup]['g_perm_id'] ) ) );\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\n\t\t\tif ( is_array($this->ipsclass->cache['calendar']) AND count( $this->ipsclass->cache['calendar'] ) )\n\t\t\t{\n\t\t\t\tforeach( $this->ipsclass->cache['calendar'] as $u )\n\t\t\t\t{\n\t\t\t\t\t$set_offset = 0;\n\n\t\t\t\t\tif( $u['event_timeset'] && !($u['event_recurring'] == 0 AND $u['event_unix_to']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$set_offset = isset($this->ipsclass->member['time_offset']) ? $this->ipsclass->member['time_offset'] * 3600 : 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$u['_unix_from'] = $u['event_unix_from'] - $set_offset;\n\t\t\t\t\t$u['_unix_to'] = $u['event_unix_to'] - $set_offset;\n\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Private?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['event_private'] == 1 and $this->ipsclass->member['id'] != $u['event_member_id'] )\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Got perms?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['event_perms'] != \"*\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_perms = explode( \",\", $this->ipsclass->clean_perm_string( $u['event_perms'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$check = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( count($event_perms) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach( $event_perms as $mgroup_perm )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( in_array( $mgroup_perm, $member_permission_groups ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$check = 1;\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\tif( !$check )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Got calendar perms?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['_perm_read'] != \"*\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$read_perms = explode( \",\", $this->ipsclass->clean_perm_string( $u['_perm_read'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$check = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( count($read_perms) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach( $read_perms as $mgroup_perm )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( in_array( $mgroup_perm, $member_permission_groups ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$check = 1;\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\tif( !$check )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// In range?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t\tif ( $u['event_recurring'] == 0 AND ( ( $u['event_unix_to'] >= $our_unix AND $u['event_unix_from'] <= $max_date )\n\t\t\t\t\t\tOR ( $u['event_unix_to'] == 0 AND $u['event_unix_from'] >= $our_unix AND $u['event_unix_from'] <= $max_date ) ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$u['event_activetime'] = $u['_unix_from'];\n\t\t\t\t\t\t$events[ str_pad( $u['event_unix_from'].$u['event_id'], 15, \"0\" ) ] = $u;\n\t\t\t\t\t}\n\t\t\t\t\telseif( $u['event_recurring'] > 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$cust_range_s = $u['event_unix_from'];\n\n\t\t\t\t\t\twhile( $cust_range_s < $u['event_unix_to'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( $cust_range_s >= $our_unix AND $cust_range_s <= $max_date )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$u['event_activetime'] = $cust_range_s;\n\t\t\t\t\t\t\t\t$events[ str_pad( $cust_range_s.$u['event_id'], 15, \"0\" ) ] = $u;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif( $u['event_recurring'] == \"1\" )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 604800;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif ( $u['event_recurring'] == \"2\" )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 18144000;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 31536000;\n\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}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Print...\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tksort($events);\n\t\t\t\n\t\t\tforeach( $events as $event )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Recurring?\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\t$c_time = '';\n\t\t\t\t$c_time = gmdate( 'j-F-y', $event['event_activetime'] );\n\t\t\t\t\n\t\t\t\t$show_events[] = \"<a href='{$this->ipsclass->base_url}act=calendar&amp;code=showevent&amp;calendar_id={$event['event_calendar_id']}&amp;event_id={$event['event_id']}' title='$c_time'>\".$event['event_title'].\"</a>\";\n\t\t\t}\n\t\t\t\n\t\t\t$this->ipsclass->lang['calender_f_title'] = sprintf( $this->ipsclass->lang['calender_f_title'], $this->ipsclass->vars['calendar_limit'] );\n\t\t\t\n\t\t\tif ( count($show_events) > 0 )\n\t\t\t{\n\t\t\t\t$event_string = implode( $this->sep_char.' ', $show_events );\n\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->calendar_events( $event_string );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( ! $this->ipsclass->vars['autohide_calendar'] )\n\t\t\t\t{\n\t\t\t\t\t$event_string = $this->ipsclass->lang['no_calendar_events'];\n\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->calendar_events( $event_string );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn $stats_html;\n\t\n\t}", "public function index()\n {\n $calendar_events = CalendarEvent::all();\n\n return view('calendar::calendar_events.index', compact('calendar_events'));\n }", "public function index() {\n \tif(!$this->user)\n \t\n \t{\n \t\t\n \t\t echo \"Members only. <a href='/users/login'>Login</a>\";\n \n \t\t # Return will force this method to exit here so the rest of the code won't be executed and the profile view won't be displayed.\n \t\t return false;\n\t\n\t }\n\t \t\t\n\t\t# Any method that loads a view will commonly start with this\n\t\t# First, set the content of the template with a view file\n\t\t\t$this->template->content = View::instance('v_calendar');\n\t\t# Now set the <title> tag\n\t\t\t$this->template->title = \"Event Calendar of \".$this->user->first_name;\t\t\n\t\n\t\t# If this view needs any JS or CSS files, \n\t\t# add their paths to this array so they will get loaded in the head\n\t\t\t$client_files = Array(\n\t\t\t\t\t\t\"\"\n\t );\n\t \n\t \t$this->template->client_files = Utils::load_client_files($client_files); \n\t \t\t\n\t\t# Render the view\n\t\t\techo $this->template;\n\n\t}", "function GetEventsJsForCalendar($frontend=true)\r\n\t{\r\n\t\tglobal $_SETTINS;\r\n\r\n\t\t// SELECT EVENTS\r\n\t\t$select = \t\"SELECT * FROM events \".\r\n\t\t\t\t\t\"WHERE events.active='1' \".\r\n\t\t\t\t\t\"\".$_SETTINGS['demosqland'].\" \".\r\n\t\t\t\t\t\"ORDER BY events.date DESC \";\r\n\t\t$result = doQuery($select);\t\t\t\r\n\t\t$num = mysql_num_rows($result);\r\n\t\t$i = 0;\r\n\t\twhile($i<$num){\r\n\t\t\t$row = mysql_fetch_array($result);\r\n\t\t\tif($i != 0){ $js .= \",\"; }\r\n\t\t\t$js .= \t\"{\";\r\n\t\t\t\r\n\t\t\t\t// TITLE CHECK\r\n\t\t\t\t$js .= \"title: '\".$row['title'].\"',\";\r\n\t\t\t\t$js .= \"description: '\".$row['description'].\"',\";\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// GET FORMAT AND EXPLODE DATE\r\n\t\t\t\t$start_date = TimestampIntoDate($row['date']);\r\n\t\t\t\t$end_date = TimestampIntoDate($row['end_date']);\r\n\t\t\t\t$startArray = explode(\"/\",$start_date);\r\n\t\t\t\t$endArray = explode(\"/\",$end_date);\t\t\r\n\t\t\t\t$sy = $startArray[2];\r\n\t\t\t\t$sm = $startArray[0];\r\n\t\t\t\t$sd = $startArray[1];\t\t\t\r\n\t\t\t\t$ey = $endArray[2];\r\n\t\t\t\t$em = $endArray[0];\r\n\t\t\t\t$ed = $endArray[1];\r\n\t\t\t\t\r\n\t\t\t\t$js .= \"start: new Date(\".$sy.\", \".$sm.\"-1, \".$sd.\"),\";\r\n\t\t\t\t\r\n\t\t\t\tif($_POST['end_date'] == \"0000-00-00 00:00:00\" || $_POST['end_date'] == \"\"){\r\n\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$js .= \"end: new Date(\".$ey.\", \".$em.\"-1, \".$ed.\"),\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif($frontend == true){\t\t\t\r\n\t\t\t\t\t$js .= \"url: 'http://\".$_SETTINGS['website'].$_SETTINGS['events_page_clean_url'].\"/'\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$js .= \"url: 'http://\".$_SETTINGS['website'].$_SETTINGS['events_page_clean_url'].\"/'\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t$js .= \"}\";\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\t\r\n\t\t$js .=\t\"\";\r\n\t\treturn $js;\r\n\t\t\r\n\t\t/*\r\n\t\t{\r\n\t\t\ttitle: 'All Day Event',\r\n\t\t\tstart: new Date(y, m, 1)\r\n\t\t},\r\n\t\t{\r\n\t\t\ttitle: 'Long Event',\r\n\t\t\tstart: new Date(y, m, d-5),\r\n\t\t\tend: new Date(y, m, d-2)\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: 999,\r\n\t\t\ttitle: 'Repeating Event',\r\n\t\t\tstart: new Date(y, m, d-3, 16, 0),\r\n\t\t\tallDay: false\r\n\t\t},\r\n\t\t{\r\n\t\t\tid: 999,\r\n\t\t\ttitle: 'Repeating Event',\r\n\t\t\tstart: new Date(y, m, d+4, 16, 0),\r\n\t\t\tallDay: false\r\n\t\t},\r\n\t\t{\r\n\t\t\ttitle: 'Meeting',\r\n\t\t\tstart: new Date(y, m, d, 10, 30),\r\n\t\t\tallDay: false\r\n\t\t},\r\n\t\t{\r\n\t\t\ttitle: 'Lunch',\r\n\t\t\tstart: new Date(y, m, d, 12, 0),\r\n\t\t\tend: new Date(y, m, d, 14, 0),\r\n\t\t\tallDay: false\r\n\t\t},\r\n\t\t{\r\n\t\t\ttitle: 'Birthday Party',\r\n\t\t\tstart: new Date(y, m, d+1, 19, 0),\r\n\t\t\tend: new Date(y, m, d+1, 22, 30),\r\n\t\t\tallDay: false\r\n\t\t},\r\n\t\t{\r\n\t\t\ttitle: 'Click for Google',\r\n\t\t\tstart: new Date(y, m, 28),\r\n\t\t\tend: new Date(y, m, 29),\r\n\t\t\turl: 'http://google.com/'\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t}", "public function getCalendar() {\n return $this->calendar;\n }", "protected function build_calendar()\n\t{\n\t\t//ee()->TMPL->log_item('Calendar: Building calendar output');\n\n\t\t$disable\t= array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$this->CDT->reset();\n\t\t$today_ymd\t= $this->CDT->ymd;\n\n\t\t// -------------------------------------\n\t\t// Set dynamic=\"off\", lest Channel get uppity and try\n\t\t// to think that it's in charge here.\n\t\t// -------------------------------------\n\n\t\t//default off.\n\t\tif ( $this->check_yes( ee()->TMPL->fetch_param('dynamic') ) )\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'yes';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'no';\n\t\t}\n\n\t\tif (isset(ee()->TMPL->tagparams['category']))\n\t\t{\n\t\t\t$this->convert_category_titles();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Collect important bits of tagdata\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Collecting tagdata');\n\n\t\t$output_at\t= '';\n\t\t$tagdata\t= ee()->TMPL->tagdata;\n\t\t$each_year\t= $each_month = $each_week = $each_day = $each_hour = $each_event = '';\n\t\t$hash_event\t= 'd38bf16a9a74c63fa5eb6d1ac082d539'.\"\\n\";\n\t\t$hash_hour\t= 'fe16402ccfad7e120a7ca3a31df3a019'.\"\\n\";\n\t\t$hash_day\t= '2aa2a1a0724182b1d876232c137a6d4f'.\"\\n\";\n\t\t$hash_week\t= 'b657210371b3e2a6f955ef6a404689de'.\"\\n\";\n\t\t$hash_month\t= 'd03207661c36a3bfd43b9dd239e41676'.\"\\n\";\n\t\t$hash_year\t= '97a92770ab082652cf662bdacc311dff'.\"\\n\";\n\n\t\t//--------------------------------------------\n\t\t//\tremove pagination before we start\n\t\t//--------------------------------------------\n\n\t\t//has tags?\n\t\tif (preg_match(\n\t\t\t\t\"/\" . LD . \"calendar_paginate\" . RD .\n\t\t\t\t\t\"(.+?)\" .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . \"calendar_paginate\" . RD . \"/s\",\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\t$tagdata \t\t\t\t\t\t= str_replace( $match[0], '', $tagdata );\n\t\t}\n\t\t//prefix comes first\n\t\telse if (preg_match(\n\t\t\t\t\"/\" . LD . \"paginate\" . RD .\n\t\t\t\t\t\"(.+?)\" .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . \"paginate\" . RD . \"/s\",\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\t$tagdata \t\t\t\t\t\t= str_replace( $match[0], '', $tagdata );\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Replace days of the week first, cuz they're easy\n\t\t// -------------------------------------\n\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_day_of_week']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/' . LD . 'display_each_day_of_week' . RD .\n\t\t\t\t\t'(.*?)' .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . 'display_each_day_of_week' . RD . '/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$dow_output\t\t= '';\n\t\t\t\t$vars\t\t\t= array();\n\t\t\t\t$current_dow\t= $this->CDT->day_of_week;\n\n\t\t\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\n\t\t\t\tif ($this->CDT->day_of_week != $this->first_day_of_week)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day(\n\t\t\t\t\t\t$this->first_day_of_week - $this->CDT->day_of_week\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tfor ($i = 0; $i < 7; $i++)\n\t\t\t\t{\n\t\t\t\t\tif ($i > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->add_day();\n\t\t\t\t\t}\n\n\t\t\t\t\t$vars['conditional'] = array(\n\t\t\t\t\t\t'day_of_week_is_weekend'\t=> (\n\t\t\t\t\t\t\t$this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t$this->CDT->day_of_week == 6\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'day_of_week_is_current'\t=> (\n\t\t\t\t\t\t\t$this->CDT->day_of_week == $current_dow\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t'day_of_week'\t\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'l'),\n\t\t\t\t\t\t'day_of_week_one'\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'b'),\n\t\t\t\t\t\t'day_of_week_short'\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'D'),\n\t\t\t\t\t\t'day_of_week_N'\t\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'N'),\n\t\t\t\t\t\t'day_of_week_number'\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'w')\n\t\t\t\t\t);\n\n\t\t\t\t\t$dow_output .= $this->swap_vars($vars, $match[1]);\n\t\t\t\t}\n\t\t\t\t$tagdata = str_replace($match[0], $dow_output, $tagdata);\n\t\t\t}\n\t\t}\n\n\t\t$tagdata = trim($tagdata).\"\\n\";\n\n\t\t// -------------------------------------\n\t\t// Now the rest\n\t\t// -------------------------------------\n\n\t\tif (isset(ee()->TMPL->var_pair['events']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'events'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'events'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_event \t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_event, $tagdata);\n\t\t\t\tee()->TMPL->tagdata = $each_event;\n\t\t\t\t$output_at \t\t\t= 'event';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_hour']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_hour'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_hour'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_hour \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_hour, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'hour';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_day']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_day'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_day'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_day \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_day, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'day';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_week']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_week'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_week'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_week \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_week, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'week';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_month']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_month'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_month'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_month \t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_month, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'month';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_year']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_year'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_year'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_year \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_year, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'year';\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If there aren't any display_each_X var pairs, default to event\n\t\t// -------------------------------------\n\n\t\tif ($output_at == '')\n\t\t{\n\t\t\t$each_event \t= $tagdata;\n\t\t\t$tagdata \t\t= $hash_event;\n\t\t\t$output_at \t\t= 'event';\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Set the default date to the start of our range\n\t\t// -------------------------------------\n\n\t\t$start_blank = (\n\t\t\t$this->P->value('date_range_start') === FALSE AND\n\t\t\t$this->P->value('date_range_end') === FALSE\n\t\t);\n\n\t\t$start\t= $this->CDT->change_datetime(\n\t\t\t$this->P->value('date_range_start', 'year'),\n\t\t\t$this->P->value('date_range_start', 'month'),\n\t\t\t$this->P->value('date_range_start', 'day'),\n\t\t\t$this->P->value('date_range_start', 'hour'),\n\t\t\t$this->P->value('date_range_start', 'minute')\n\t\t);\n\n\t\t$end\t= $this->CDT->change_datetime(\n\t\t\t$this->P->value('date_range_end', 'year'),\n\t\t\t$this->P->value('date_range_end', 'month'),\n\t\t\t$this->P->value('date_range_end', 'day'),\n\t\t\t($start_blank ? '23' : $this->P->value('date_range_end', 'hour')),\n\t\t\t($start_blank ? '59' : $this->P->value('date_range_end', 'minute'))\n\t\t);\n\n\t\t$current_period_start\t= $start;\n\t\t$current_period_end\t\t= $end;\n\n\t\t$this->CDT->set_default($start);\n\t\t$this->CDT->reset();\n\n\t\t// -------------------------------------\n\t\t// If we are \"padding\" short weeks, modify our dates\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('pad_short_weeks') === TRUE)\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// Adjust the start date backward to the first day of the week, if necessary\n\t\t\t// -------------------------------------\n\n\t\t\t$old_end = $end;\n\n\t\t\tif ($start['day_of_week'] != $this->first_day_of_week)\n\t\t\t{\n\t\t\t\t$offset = ($start['day_of_week'] > $this->first_day_of_week) ?\n\t\t\t\t\t$start['day_of_week'] - $this->first_day_of_week :\n\t\t\t\t\t7 - ($this->first_day_of_week - $start['day_of_week']);\n\n\t\t\t\t$start \t= $this->CDT->add_day(-$offset);\n\t\t\t\t$this->CDT->reset();\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Adjust the end date forward to the last day of the week, if necessary\n\t\t\t// -------------------------------------\n\n\t\t\t$last_dow = ($this->first_day_of_week > 0) ? $this->first_day_of_week - 1 : 6;\n\n\t\t\tif ($end['day_of_week'] != $last_dow)\n\t\t\t{\n\t\t\t\t$this->CDT->change_ymd($end['ymd']);\n\t\t\t\t$offset = ($end['day_of_week'] > $last_dow) ?\n\t\t\t\t\t7 - ($end['day_of_week'] - $last_dow) :\n\t\t\t\t\t$last_dow - $end['day_of_week'];\n\n\t\t\t\t$end \t= $this->CDT->add_day($offset);\n\t\t\t\t$this->CDT->reset();\n\t\t\t}\n\n\t\t\t$end['time']\t= $old_end['time'];\n\t\t\t$end['hour']\t= $old_end['hour'];\n\t\t\t$end['minute']\t= $old_end['minute'];\n\n\t\t\t$this->CDT->set_default($start);\n\t\t\t$this->P->set('date_range_start', $start);\n\t\t\t$this->P->set('date_range_end', $end);\n\t\t}\n\n\t\t//ee()->TMPL->log_item('Calendar: Date range start: '. $this->P->value('date_range_start', 'ymd'));\n\n\t\t//ee()->TMPL->log_item('Calendar: Date range end: '. $this->P->value('date_range_end', 'ymd'));\n\n\t\t// -------------------------------------\n\t\t// Let's go fetch some events\n\t\t// -------------------------------------\n\n\t\t/*$category = FALSE;\n\n\t\tif (isset(ee()->TMPL) AND\n\t\t\t is_object(ee()->TMPL) AND\n\t\t\t ee()->TMPL->fetch_param('category') !== FALSE AND\n\t\t\t ee()->TMPL->fetch_param('category') != ''\n\t\t)\n\t\t{\n\t\t\t$category = ee()->TMPL->fetch_param('category');\n\n\t\t\tunset(ee()->TMPL->tagparams['category']);\n\t\t}*/\n\n\t\t$ids \t\t\t= $this->data->fetch_event_ids($this->P /*, $category*/);\n\n\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Fetching events. ' . count( $ids ) . ' events were found.');\n\n\t\t$entry_data \t= array();\n\t\t$events \t\t= array();\n\n\t\t// -------------------------------------\n\t\t// No events? You really need to work on your social calendar...\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// If they used a no_results tag, let 'em have it\n\t\t\t// -------------------------------------\n\n\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() No results, going home');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() No results, but staying around for the show');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// We only care about this stuff if:\n\t\t\t// \t* there's an {event}{/event} tag pair\n\t\t\t// \t* thar be one or more xxx_has_events variables\n\t\t\t// -------------------------------------\n\n\t\t\tif ($each_event != '' OR strpos(ee()->TMPL->tagdata, '_event_total') !== FALSE)\n\t\t\t{\n\t\t\t\twhile (TRUE)\n\t\t\t\t{\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Firing up the ol Channel Module to try and process ' . count( $ids ) . ' events.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Fetch occurrence info\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$occurrence_ids = $this->data->fetch_occurrence_entry_ids($ids);\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() ' . count( $occurrence_ids ) . ' occurrences were found.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If the entry_id of the occurrence doesn't match the entry_id\n\t\t\t\t\t// of the entry, we need to fetch the occurrence data separately\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($occurrence_ids as $id => $data)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($data as $oid => $o_entry_id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($id != $o_entry_id)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ids[$o_entry_id] = $id; //$o_entry_id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare tagdata for Calendar-specific variable pairs, which\n\t\t\t\t\t// we will process later.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->var_single['entry_id'] = 'entry_id';\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare tagdata for Calendar-specific date variables, which\n\t\t\t\t\t// we will process later.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$var_dates = array(\n\t\t\t\t\t\t'event_start_date' \t=> FALSE,\n\t\t\t\t\t\t'event_start_time' \t=> FALSE,\n\t\t\t\t\t\t'event_end_date' \t=> FALSE,\n\t\t\t\t\t\t'event_end_time' \t=> FALSE\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach (ee()->TMPL->var_single as $k => $v)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (($pos = strpos($k, ' format')) !== FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$name = substr($k, 0, $pos);\n\n\t\t\t\t\t\t\tif (array_key_exists($name, $var_dates))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$var_dates[$name][$k] \t\t= $v;\n\t\t\t\t\t\t\t\tee()->TMPL->var_single[$k] \t= $k;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tInvoke Channel class\n\t\t\t\t\t//\t----------------------------------------\n\n\t\t\t\t\tif ( ! class_exists('Channel') )\n\t\t\t\t\t{\n\t\t\t\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel = new Channel();\n\n\t\t\t\t\t//need to remove limit here so huge amounts of events work\n\t\t\t\t\t$channel->limit = 1000000;\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare parameters\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagparams['entry_id'] = implode('|', array_keys($ids));\n\n\t\t\t\t\tif ($this->P->value('enable') != FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_array($this->P->value('enable')))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tee()->TMPL->tagparams['disable'] = implode('|', array_diff($disable, $this->P->value('enable')));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tee()->TMPL->tagparams['disable'] = implode('|', array_diff($disable, array($this->P->value('enable'))));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tee()->TMPL->tagparams['disable'] = implode('|', $disable);\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Pre-process related data\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data( ee()->TMPL->tagdata );\n\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t\t\t\t{\n\t\t\t\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\t\t\t\t$each_event\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tee()->TMPL->var_single \t= array_merge( ee()->TMPL->var_single, ee()->TMPL->related_markers );\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Execute needed methods\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$channel->fetch_custom_channel_fields();\n\n\t\t\t\t\t$channel->fetch_custom_member_fields();\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Pagination Tags Parsed Out\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\t$channel = $this->fetch_pagination_data($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Querification\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//for some reason without this in EE 2.8.x\n\t\t\t\t\t//pagination has some sort of dynamic detection\n\t\t\t\t\t//that it didn't in EE 2.7 and below and hoses our\n\t\t\t\t\t//pagination setup because we are doing it\n\t\t\t\t\t//manually later as this is just data gathering\n\t\t\t\t\t//for events.\n\t\t\t\t\tif (\n\t\t\t\t\t\tversion_compare($this->ee_version, '2.8.0', '>=') &&\n\t\t\t\t\t\tisset($channel->pagination)\n\t\t\t\t\t)\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->pagination->paginate = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->build_sql_query();\n\n\t\t\t\t\tif ($channel->sql == '')\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Channel query empty');\n\n\t\t\t\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->no_results();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\t\t\t\tif ($channel->query->num_rows == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Channel Module returned no results');\n\n\t\t\t\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->no_results();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\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//ee()->TMPL->log_item('Calendar:build_calendar() Channel module found ' . $channel->query->num_rows . ' results.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Trim IDs and build events\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$new_ids = array();\n\n\t\t\t\t\tforeach ($channel->query->result as $k => $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_ids[$row['entry_id']] = $ids[$row['entry_id']];\n\t\t\t\t\t}\n\n\t\t\t\t\t$event_data = $this->data->fetch_all_event_data($new_ids);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Turn these IDs into events\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$events = array();\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Beginning event creation process.');\n\n\t\t\t\t\tif ( ! class_exists('Calendar_event'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire_once CALENDAR_PATH.'calendar.event.php';\n\t\t\t\t\t}\n\n\t\t\t\t\t$calendars = array();\n\n\t\t\t\t\tforeach ($event_data as $k => $edata)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp = new Calendar_event(\n\t\t\t\t\t\t\t$edata,\n\t\t\t\t\t\t\t$this->P->params['date_range_start']['value'],\n\t\t\t\t\t\t\t$this->P->params['date_range_end']['value']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( ! empty($temp->dates))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp->prepare_for_output();\n\t\t\t\t\t\t\t$events[$edata['entry_id']] = $temp;\n\t\t\t\t\t\t\t$calendars[$events[$edata['entry_id']]->default_data['calendar_id']] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Event creation resulted in the creation of ' . count( $events ) . ' events.');\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Event creation process finished.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Leaving so soon?\n\t\t\t\t\t// There's no point in continuing if we're just interested\n\t\t\t\t\t// in whether or not there are events on this day.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event == '')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (array_keys($events) as $id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$entry_data[$id] = $id;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Skipping further channel module processing because $each_event variable was empty string. ' . count( $entry_data ) . ' events were found and logged into the $entry_data array.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Nor should we stay around if there's nothing to process\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\telseif (empty($calendars))\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Skipping further channel module processing because there were no calendars connected to the events found.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Fetch information about the calendars\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$calendars = $this->data->fetch_calendar_data_by_id(array_keys($calendars));\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare the tagdata that will be parsed by the channel module\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$blargle = '3138ad2081984be5dea40e593fd61f87';\n\t\t\t\t\t$bleegle = '6f8de301e6e6f2cd80ad99aa3a765b31';\n\t\t\t\t\t//ee()->TMPL->tagdata = $blargle . '[' . LD . \"entry_id\" . RD . ']' . $each_event . $bleegle;\n\t\t\t\t\tee()->TMPL->tagdata = $blargle .\n\t\t\t\t\t\t'[' . LD . \"entry_id\" . RD . ']' .\n\t\t\t\t\t\tee()->TMPL->tagdata .\n\t\t\t\t\t\t$bleegle;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prep variable aliases\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$variables = array(\n\t\t\t\t\t\t'title'\t\t\t=> 'event_title',\n\t\t\t\t\t\t'url_title'\t\t=> 'event_url_title',\n\t\t\t\t\t\t'entry_id'\t\t=> 'event_id',\n\t\t\t\t\t\t'author_id'\t\t=> 'event_author_id',\n\t\t\t\t\t\t'author'\t\t=> 'event_author',\n\t\t\t\t\t\t'status'\t\t=> 'event_status'\n\t\t\t\t\t);\n\n\t\t\t\t\t//custom variables with the letters 'url' are borked in\n\t\t\t\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t\t\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t{\n\t\t\t\t\t\t$variables['url_title'] = 'event_borked_title';\n\n\t\t\t\t\t\tee()->TMPL->var_single['event_borked_title'] = 'event_borked_title';\n\n\t\t\t\t\t\tunset(ee()->TMPL->var_single['event_url_title']);\n\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tee()->TMPL->var_single['event_calendar_borked_title'] = 'event_calendar_borked_title';\n\n\t\t\t\t\t\tunset(ee()->TMPL->var_single['event_calendar_url_title']);\n\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Typography\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\tee()->load->library('typography');\n\t\t\t\t\tee()->typography->initialize();\n\t\t\t\t\tee()->typography->convert_curly = FALSE;\n\n\t\t\t\t\t$channel->fetch_categories();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Add variables to the query result\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($channel->query->result as $k => $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entry_id = $row['entry_id'];\n\n\t\t\t\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ? $row['screen_name'] : $row['username'];\n\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() We\\'re in the channel query result loop. Entry id is ' . $entry_id );\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Skip this result if the event data doesn't exist\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif (! isset($events[$ids[$entry_id]]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($channel->query->result[$k]);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$channel->query->result[$k]['edited_occurrence'] \t= FALSE;\n\t\t\t\t\t\t$channel->query->result[$k]['event_parent_id']\t\t= ($ids[$entry_id] == $entry_id) ? 0 : $ids[$entry_id];\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// If this entry_id is not in the $events array, this is an edited occurrence\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif (! isset($events[$entry_id]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Add this info to the $events array\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$events[$entry_id] = clone $events[$ids[$entry_id]];\n\n\t\t\t\t\t\t\t$channel->query->result[$k]['edited_occurrence'] = TRUE;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Correct the info\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\tforeach ($events[$entry_id]->occurrences as $ymd => $times)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($times as $time => $data)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($data['entry_id'] != $entry_id)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tunset($events[$entry_id]->occurrences[$ymd][$time], $events[$entry_id]->dates[$ymd][$time]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tunset($events[$data['event_id']]->occurrences[$ymd][$time], $events[$data['event_id']]->dates[$ymd][$time]);\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\n\t\t\t\t\t\t\t// NOTE: Requires PHP >= 5.1.0\n\t\t\t\t\t\t\t$events[$entry_id]->dates = array_intersect_key($events[$entry_id]->dates, $events[$entry_id]->occurrences);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Alias\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tforeach ($variables as $old => $new)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($old == 'title')\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$old]\t= ee()->typography->parse_type(\n\t\t\t\t\t\t\t\t\t$channel->query->result[$k][$old],\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'text_format' \t=> 'lite',\n\t\t\t\t\t\t\t\t\t\t'html_format' \t=> 'none',\n\t\t\t\t\t\t\t\t\t\t'auto_links' \t=> 'n',\n\t\t\t\t\t\t\t\t\t\t'allow_img_url' => 'no'\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$channel->query->result[$k][$new]\t= $channel->query->result[$k][$old];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$new]\t= $channel->query->result[$k][$old];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Calendar variables\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tforeach ($calendars[$events[$entry_id]->default_data['calendar_id']] as $key => $val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->query->result[$k][$key] = $val;\n\n\t\t\t\t\t\t\tif ($key == 'calendar_url_title' AND\n\t\t\t\t\t\t\t\tversion_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_calendar_borked_title'] = $val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = $val;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tRedeclare\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tWe will reassign the $channel->query->result with our\n\t\t\t\t\t//\treordered array of values. Thank you PHP for being so fast with array loops.\n\t\t\t\t\t//\t----------------------------------------\n\n\t\t\t\t\t$super_temp_fake = $channel->query->result_array = $channel->query->result;\n\n\t\t\t\t\t$channel->fetch_categories();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Handle {title} and {event_title} differently\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagdata\t= str_replace(\n\t\t\t\t\t\tLD . 'title' . RD,\n\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . LD . 'entry_id' . RD,\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\tee()->TMPL->tagdata\t= str_replace(\n\t\t\t\t\t\tLD . 'event_title' . RD,\n\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . LD . 'entry_id' . RD,\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Remove \"ignore\" prefixes\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t'calendar_ignore_',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Parse Weblog stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Parsing Weblog stuff');\n\n\t\t\t\t\t$channel->parse_channel_entries();\n\n\t\t\t\t\tforeach ($super_temp_fake as $k => $data)\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->return_data = str_replace(\n\t\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . $data['entry_id'],\n\t\t\t\t\t\t\t$super_temp_fake[$k]['title'],\n\t\t\t\t\t\t\t$channel->return_data\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Related entries\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries');\n\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->parse_related_entries();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Collect the parsed data for use later\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tpreg_match_all('/' . $blargle . '\\[(\\d+)\\](.*?)' . $bleegle . '/s', $channel->return_data, $matches);\n\t\t\t\t\tforeach ($matches[0] as $k => $match)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entry_data[$matches[1][$k]] = $matches[2][$k];\n\t\t\t\t\t}\n\n\t\t\t\t\tunset($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Stop the insanity!\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Channel module stuff done');\n\n\t\t// -------------------------------------\n\t\t// Build the calendar\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Starting to build the calendar');\n\n\t\t$start_year\t\t= $start['year'];\n\t\t$start_month\t= $start['month'];\n\t\t$start_day\t\t= $start['day'];\n\t\t$end_year\t\t= $end['year'];\n\t\t$end_month\t\t= $end['month'];\n\t\t$end_day\t\t= $end['day'];\n\t\t$w\t\t\t\t= 0;\n\n\t\t$this->CDT->reset();\n\n\t\tif ($this->P->value('pad_short_weeks') === TRUE)\n\t\t{\n\t\t\t$week_counter = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$week_counter = ($this->CDT->day_of_week >= $this->first_day_of_week) ?\n\t\t\t\t\t\t\t\t$this->CDT->day_of_week - $this->first_day_of_week :\n\t\t\t\t\t\t\t\t7 + $this->CDT->day_of_week - $this->first_day_of_week;\n\t\t}\n\n\t\t$output = '';\n\t\t$week_temp = $month_temp = $year_temp = '';\n\t\t$day_count = 0;\n\n\t\t$next_CDT = $prev_CDT = $start;\n\n\t\t$all_day = array();\n\t\t$event_array = array();\n\n\t\t// -------------------------------------\n\t\t// Prepare the events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Preparing events');\n\n\t\tforeach ($events as $id => $event)\n\t\t{\n\t\t\t//prevent missing entry data from attempting to display and causing errors\n\t\t\tif ( ! isset($entry_data[$event->default_data['entry_id']]))\n\t\t\t{\n\t\t\t\tunset($events[$id]);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (empty($event->dates))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($event->dates as $ymd => $items)\n\t\t\t{\n\t\t\t\tforeach ($items as $time => $ddata)\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// It was over before it started\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['end_date']['ymd'].$ddata['end_date']['time'] <\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') .\n\t\t\t\t\t\t$this->P->value('date_range_start', 'time'))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// ...or the inverse\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['date']['ymd'].$ddata['date']['time'] >\n\t\t\t\t\t\t $this->P->value('date_range_end', 'ymd') .\n\t\t\t\t\t\t $this->P->value('time_range_end', 'time'))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If the start date of the event is less than the first\n\t\t\t\t\t// day of the calendar, we've got ourselves a hangover.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['date']['ymd'] < $this->P->value('date_range_start', 'ymd'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_array[$this->P->value('date_range_start', 'ymd')]['all_day'][$id]\t= $id;\n\t\t\t\t\t\t$events[$id]->dates[$this->P->value('date_range_start', 'ymd')]\t\t\t\t= $events[$id]->dates[$ymd];\n\t\t\t\t\t}\n\t\t\t\t\telseif ($ddata['all_day'] === TRUE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_array[$ymd]['all_day'][$id] = $id;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($ddata['multi_day'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$event_array[$ymd]['all_day'][$id] = $id;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$start_hour\t= str_pad($ddata['date']['hour'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$start_min\t= str_pad($ddata['date']['minute'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$end_hour\t= str_pad($ddata['end_date']['hour'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$end_min\t= str_pad($ddata['end_date']['minute'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$event_array[$ymd][$start_hour][$start_min][$end_hour][$end_min][$id] = $id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t\t// -------------------------------------\n\t\t\t// Aliases\n\t\t\t// -------------------------------------\n\n\t\t\t$events[$id]->default_data['first_date']\t= $events[$id]->default_data['start_date'];\n\t\t}\n\n\t\t$this->CDT->reset();\n\n\t\t// -------------------------------------\n\t\t// Prune the event array, if there's an event limit.\n\t\t// NOTE: apply_event_limit() also sorts the array for us.\n\t\t// -------------------------------------\n\n\t\t//--------------------------------------------\n\t\t//\tcount all events for tag and pagination\n\t\t//--------------------------------------------\n\n\t\t$this->event_timeframe_total = $this->count_event_results($event_array);\n\n\t\t//--------------------------------------------\n\t\t//\tpagination\n\t\t//--------------------------------------------\n\n\t\t$this->paginate = FALSE;\n\n\t\tif ($this->P->value('event_limit') > 0 AND\n\t\t\t$this->event_timeframe_total > $this->P->value('event_limit'))\n\t\t{\n\t\t\t//get pagination info\n\t\t\t$pagination_data = $this->universal_pagination(array(\n\t\t\t\t'total_results'\t\t\t=> $this->event_timeframe_total,\n\t\t\t\t//had to remove this jazz before so it didn't get iterated over\n\t\t\t\t'tagdata'\t\t\t\t=> $tagdata . $this->paginate_tagpair_data,\n\t\t\t\t'limit'\t\t\t\t\t=> $this->P->value('event_limit'),\n\t\t\t\t'uri_string'\t\t\t=> ee()->uri->uri_string,\n\t\t\t\t'paginate_prefix'\t\t=> 'calendar_'\n\t\t\t));\n\n\t\t\t// -------------------------------------------\n\t\t\t// 'calendar_events_create_pagination' hook.\n\t\t\t// - Let devs maniuplate the pagination display\n\n\t\t\tif (ee()->extensions->active_hook('calendar_build_calendar_create_pagination') === TRUE)\n\t\t\t{\n\t\t\t\t$pagination_data = ee()->extensions->call(\n\t\t\t\t\t'calendar_build_calendar_create_pagination',\n\t\t\t\t\t$this,\n\t\t\t\t\t$pagination_data\n\t\t\t\t);\n\t\t\t}\n\t\t\t//\n\t\t\t// -------------------------------------------\n\n\t\t\t//if we paginated, sort the data\n\t\t\tif ($pagination_data['paginate'] === TRUE)\n\t\t\t{\n\t\t\t\t$this->paginate\t\t\t= $pagination_data['paginate'];\n\t\t\t\t$this->page_next\t\t= $pagination_data['page_next'];\n\t\t\t\t$this->page_previous\t= $pagination_data['page_previous'];\n\t\t\t\t$this->p_page\t\t\t= $pagination_data['pagination_page'];\n\t\t\t\t$this->current_page \t= $pagination_data['current_page'];\n\t\t\t\t$this->pager \t\t\t= $pagination_data['pagination_links'];\n\t\t\t\t$this->basepath\t\t\t= $pagination_data['base_url'];\n\t\t\t\t$this->total_pages\t\t= $pagination_data['total_pages'];\n\t\t\t\t$this->paginate_data\t= $pagination_data['paginate_tagpair_data'];\n\t\t\t\t$this->page_count\t\t= $pagination_data['page_count'];\n\t\t\t\t//$tagdata\t\t\t\t= $pagination_data['tagdata'];\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tevent limiter\n\t\t//--------------------------------------------\n\n\t\t$offset = (\n\t\t\tee()->TMPL->fetch_param('event_offset') ?\n\t\t\t\tee()->TMPL->fetch_param('event_offset') :\n\t\t\t\t0\n\t\t);\n\n\t\t$page \t= (($this->current_page -1) * $this->P->value('event_limit'));\n\n\t\tif ($page > 0)\n\t\t{\n\t\t\t$offset += $page;\n\t\t}\n\n\t\t$event_array = $this->apply_event_limit(\n\t\t\t$event_array,\n\t\t\t$this->P->value('event_limit'),\n\t\t\t$offset\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Loopage\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Beginning date loops');\n\n\t\t$week_event_count\t= 0;\n\t\t$event_count\t\t= 0;\n\t\t$year_tick\t\t\t= 0;\n\t\t$month_tick\t\t\t= 0;\n\n\t\tfor ($y = $start_year; $y <= $end_year; $y++)\n\t\t{\n\t\t\t$year_event_count = 0;\n\n\t\t\t//blank out\n\t\t\t$this->counted['year'] = array();\n\n\t\t\t$mx = ($y == $start_year) ? $start_month : 1;\n\t\t\t$my = ($y == $end_year) ? $end_month : 12;\n\n\t\t\t$year_ymd_cache = $this->CDT->ymd;\n\n\n\t\t\tfor ($m = $mx; $m <= $my; $m++)\n\t\t\t{\n\t\t\t\t$month_ymd_cache \t= $this->CDT->ymd;\n\n\n\t\t\t\t$month_event_count = 0;\n\n\t\t\t\t//blank out\n\t\t\t\t$this->counted['month'] = array();\n\n\t\t\t\t$dx = ($y == $start_year AND $m == $start_month) ?\n\t\t\t\t\t\t$start_day :\n\t\t\t\t\t\t1;\n\n\t\t\t\t$dy = ($y == $end_year AND $m == $end_month) ?\n\t\t\t\t\t\t$end_day :\n\t\t\t\t\t\t$this->CDT->days_in_month($m, $y);\n\n\t\t\t\tfor ($d = $dx; $d <= $dy; $d++)\n\t\t\t\t{\n\t\t\t\t\t$day_ymd_cache \t= $this->CDT->ymd;\n\t\t\t\t\t$day_tick\t\t= 0;\n\n\t\t\t\t\t$this->CDT->change_date($y, $m, $d);\n\t\t\t\t\t$this->CDT->set_default($this->CDT->date_array());\n\n\t\t\t\t\t$ymd = $this->CDT->ymd;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare counts and totals, also\n\t\t\t\t\t// altered later in the loop in some cases\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$day_event_count = 0;\n\t\t\t\t\t$day_event_total = 0;\n\n\t\t\t\t\t//blank out\n\t\t\t\t\t$this->counted['day'] = array();\n\n\t\t\t\t\tif (! isset($event_array[$ymd])) $event_array[$ymd] = array();\n\n\t\t\t\t\t$day_event_total\t= $this->count_events(\n\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t$event_array,\n\t\t\t\t\t\t$all_day,\n\t\t\t\t\t\t'day',\n\t\t\t\t\t\t$events\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Start events for the day\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Beginning ' . $ymd . count( $event_array[$ymd] ) . ' events for this day.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// This looks a little goofy, but it\n\t\t\t\t\t// prevents extra years/months\n\t\t\t\t\t// showing up thanks to padded weeks\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$day_count++;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Week stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($week_counter % 7 == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//blank out\n\t\t\t\t\t\t$this->counted['week'] = array();\n\n\t\t\t\t\t\t$w = str_pad($this->CDT->week_number, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t}\n\n\t\t\t\t\t$week_counter++;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \"next\" stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$next_y = ($m == 12 AND $d == 31) ? $y+1 : $y;\n\t\t\t\t\t$next_m = ($d == $this->CDT->days_in_month()) ? $m + 1 : $m;\n\t\t\t\t\t$next_w = ($week_counter % 7 == 0) ? $w + 1 : $w;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Yodelers of Mass Destruction\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$find\t\t\t= '';\n\t\t\t\t\t$replace\t\t= '';\n\t\t\t\t\t$hour_events\t= array();\n\t\t\t\t\t$last_day\t\t= (\n\t\t\t\t\t\t$y == $end_year AND\n\t\t\t\t\t\t$m == $end_month AND\n\t\t\t\t\t\t$d == $end_day\n\t\t\t\t\t) ? TRUE : FALSE;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Remove \"all day\" stragglers\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($all_day as $i => $stuff)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($ymd > $stuff['end_ymd'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($all_day[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each event\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \t$each_event contains the formatting\n\t\t\t\t\t// \tto use for displaying the contents\n\t\t\t\t\t// \tof an event on a given day in the calendar.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_output = '';\n\n\t\t\t\t\t\tif ( ! empty($event_array[$ymd]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($event_array[$ymd] as $start_hour => $sh_data)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hour_event_count\t= 0;\n\t\t\t\t\t\t\t\t$hour_event_total\t= count($sh_data);\n\n\t\t\t\t\t\t\t\tif ($start_hour == 'all_day')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$prev_index = 0;\n\t\t\t\t\t\t\t\t\t$index = 0;\n\n\t\t\t\t\t\t\t\t\tforeach ($sh_data as $i => $id)\n\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// Multi-day events get one time key, regular\n\t\t\t\t\t\t\t\t\t\t// all day events get another\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\t$time_key = '00002400';\n\n\t\t\t\t\t\t\t\t\t\tif ( ! isset( $events[$id]->dates[$ymd][$time_key]))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//so in some rare situations this\n\t\t\t\t\t\t\t\t\t\t\t//can come to us without being reset?\n\t\t\t\t\t\t\t\t\t\t\t//I hate moving pointers :p\n\t\t\t\t\t\t\t\t\t\t\treset($events[$id]->dates[$ymd]);\n\n\t\t\t\t\t\t\t\t\t\t\t$time_key = key($events[$id]->dates[$ymd]);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars($id, $events[$id], $ymd, $time_key);\n\n\t\t\t\t\t\t\t\t\t\t$vars['conditional']['event_all_day']\t= TRUE;\n\n\t\t\t\t\t\t\t\t\t\t$vars['single']\t+= array(\n\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t\t=> $this->create_count_hash('event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t\t=> $this->create_count_hash('year_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t\t=> $this->create_count_hash('month_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t\t=> $this->create_count_hash('week_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t\t=> $this->create_count_hash('day_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t\t=> $this->create_count_hash('hour_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'all_day_event_index_difference' => $index - $prev_index,\n\t\t\t\t\t\t\t\t\t\t\t'all_day_event_index'\t\t=> $index++,\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_minutes'\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['minutes'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['minutes'],\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_hours'\t\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['hours'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['hours'],\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_days'\t\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['days'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['days']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t'event_count'\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'month_event_count' \t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t// If we're outputting at the event level, then we have\n\t\t\t\t\t\t\t\t\t\t// to spit out the all day stuff here.\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\tif ($output_at == 'event')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$event_output .= $this->swap_vars($vars, $output_data);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t//shortcut\n\t\t\t\t\t\t\t\t\t\t$evtk =& $events[$id]->dates[$ymd][$time_key];\n\n\t\t\t\t\t\t\t\t\t\t$array = array(\n\t\t\t\t\t\t\t\t\t\t\t'output'\t\t\t\t\t=> $output_data,\n\t\t\t\t\t\t\t\t\t\t\t'vars'\t\t\t\t\t\t=> $vars,\n\t\t\t\t\t\t\t\t\t\t\t'first_day'\t\t\t\t\t=> $evtk['date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'last_day'\t\t\t\t\t=> $evtk['end_date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'start_ymd'\t\t\t\t\t=> $evtk['date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'end_ymd'\t\t\t\t\t=> $evtk['end_date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'time'\t\t\t\t\t\t=> $time_key,\n\t\t\t\t\t\t\t\t\t\t\t'id'\t\t\t\t\t\t=> $id,\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_minutes'\t=> $evtk['duration']['minutes'],\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_hours'\t\t=> $evtk['duration']['hours'],\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_days'\t\t=> $evtk['duration']['days']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t//unset($event_array[$ymd]['all_day'][$id]);\n\n\t\t\t\t\t\t\t\t\t\t$count\t\t= (empty($all_day)) ? 0 : max(array_keys($all_day));\n\t\t\t\t\t\t\t\t\t\t$inserted\t= FALSE;\n\t\t\t\t\t\t\t\t\t\t$prev_index\t= $index + 1;\n\n\t\t\t\t\t\t\t\t\t\tif (! in_array($array, $all_day))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tfor ($i = 0; $i <= $count; $i++)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t\t\t// Find a spot for this event\n\t\t\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (! isset($all_day[$i]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$all_day[$i] = $array;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$inserted = TRUE;\n\t\t\t\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\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tif ($inserted === FALSE)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$all_day[$i] = $array;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tksort($all_day);\n\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ($each_hour != '')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$hour_events[$start_hour] = $sh_data;\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{\n\t\t\t\t\t\t\t\t\tforeach ($sh_data as $start_minute => $sm_data)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($sm_data as $end_hour => $eh_data)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tforeach ($eh_data as $end_minute => $event_ids)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($event_ids as $id)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (isset($entry_data[$id]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_hour\t= str_pad($start_hour, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_min\t= str_pad($start_min, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_hour\t= str_pad($end_hour, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_min\t= str_pad($end_min, 2, 0, STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$time_key = $start_hour.$start_minute.$end_hour.$end_minute;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( ! isset($events[$id]->dates[$ymd][$time_key]))\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\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_hour . $start_minute . $end_hour . $end_minute\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_minutes']\t= $events[$id]->dates[$ymd][$time_key]['duration']['minutes'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_hours']\t\t= $events[$id]->dates[$ymd][$time_key]['duration']['hours'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_days']\t\t= $events[$id]->dates[$ymd][$time_key]['duration']['days'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_count']\t\t\t\t= $this->create_count_hash('event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['year_event_count']\t\t\t= $this->create_count_hash('year_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['month_event_count']\t\t= $this->create_count_hash('month_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['week_event_count']\t\t\t= $this->create_count_hash('week_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_count']\t\t\t= $this->create_count_hash('day_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_count']\t\t\t= $this->create_count_hash('hour_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_total']\t\t\t= $day_event_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_total']\t\t\t= $hour_event_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['all_day_event_index']\t\t= 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['all_day_event_index_difference'] = 0;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$event_output .= $this->swap_vars($vars, $output_data);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//parse day event counts\n\t\t\t\t\t\t\t$event_output = $this->parse_count_hashes('hour_event_count', $event_output);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$find = $hash_event;\n\t\t\t\t\t\t$replace = $event_output;\n\n\t\t\t\t\t\tif ($output_at == 'event')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If $each_event is empty, $all_day never gets filled. Let's fix that.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event == '' AND isset($event_array[$ymd]['all_day']))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($event_array[$ymd]['all_day'] as $id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$time_key\t\t\t= (! isset( $events[$id]->dates[$ymd]['00002400'])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey($events[$id]->dates[$ymd]) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t'00002400';\n\n\t\t\t\t\t\t\t$data['end_ymd']\t= $events[$id]->dates[$ymd][$time_key]['end_date']['ymd'];\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// This stuff can be gibberish since it'll never show, but we\n\t\t\t\t\t\t\t// provide it because other parts of the code expect it to exist\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$data['time']\t\t= '';\n\t\t\t\t\t\t\t$data['vars']\t\t= array();\n\t\t\t\t\t\t\t$data['first_day']\t= FALSE;\n\t\t\t\t\t\t\t$data['last_day']\t= FALSE;\n\t\t\t\t\t\t\t$data['output']\t\t= '';\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Add the all day event\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$all_day[]\t\t\t= $data;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$all_day_event_total\t= count($all_day);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \"All day\" output\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$all_day_output = '';\n\n\t\t\t\t\tif ( ! empty($all_day))\n\t\t\t\t\t{\n\t\t\t\t\t\t$prev_index = 0;\n\t\t\t\t\t\t$hour_event_count = 0;\n\n\t\t\t\t\t\tforeach ($all_day as $all_day_data)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$time_key\t= $all_day_data['time'];\n\t\t\t\t\t\t\t$vars\t\t= $all_day_data['vars'];\n\t\t\t\t\t\t\t$vars['single']['event_first_day']\t= ($ymd == $all_day_data['first_day']) ? TRUE : FALSE;\n\t\t\t\t\t\t\t$vars['single']['event_last_day']\t= ($ymd == $all_day_data['last_day']) ? TRUE : FALSE;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Process all day variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$all_day_output\t.= $this->swap_vars($vars, $all_day_data['output']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each hour\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_hour != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$hour_output = '';\n\t\t\t\t\t\t$hour_temp = '';\n\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hour_output = $all_day_output;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ($i = 0; $i < 24; $i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hour_temp\t\t\t= '';\n\t\t\t\t\t\t\t$hour_count\t\t\t= 0;\n\t\t\t\t\t\t\t$hour_event_count\t= 0;\n\t\t\t\t\t\t\t$h\t\t\t\t\t= str_pad($i, 2, '0', STR_PAD_LEFT);\n\t\t\t\t\t\t\t//$this->cdt_format_date_string($this->CDT->datetime_array(), 'H');\n\t\t\t\t\t\t\t$minute\t\t\t\t= '00';\n\t\t\t\t\t\t\t//$this->cdt_format_date_string($this->CDT->datetime_array(), 'i');\n\n\t\t\t\t\t\t\tif (isset($hour_events[$h]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($hour_events[$h] as $start_minute => $sm_data)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach ($sm_data as $end_hour => $eh_data)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($eh_data as $end_minute => $event_ids)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$hour_count += count($event_ids);\n\n\t\t\t\t\t\t\t\t\t\t\tforeach ($event_ids as $id)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (isset($entry_data[$id]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$h . $start_minute . $end_hour . $end_minute\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_count']\t\t\t= $this->create_count_hash('event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_count']\t\t= $this->create_count_hash('hour_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['year_event_count']\t\t= $this->create_count_hash('year_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['month_event_count']\t= $this->create_count_hash('month_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['week_event_count']\t\t= $this->create_count_hash('week_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_count']\t\t= $this->create_count_hash('day_event_count');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_temp .= $this->swap_vars($vars, $output_data);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$hour_temp = str_replace($find, $hour_temp, $each_hour);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hour_temp = str_replace($find, $replace, $each_hour);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\t\t\t\t\t\t\t$total_events = $hour_count;\n\t\t\t\t\t\t\t$this->CDT->change_time($i, 0);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'time'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t=> $this->CDT->datetime_array()\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'hour'\t\t\t\t=> $h,\n\t\t\t\t\t\t\t\t'minute'\t\t\t=> $minute,\n\t\t\t\t\t\t\t\t'time'\t\t\t\t=> $h.':'.$minute,\n\t\t\t\t\t\t\t\t'hour_event_total' \t=> $total_events\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$hour_output .= $this->swap_vars($vars, $hour_temp);\n\n\t\t\t\t\t\t\t//parse day event counts\n\t\t\t\t\t\t\t$hour_output = $this->parse_count_hashes('hour_event_count', $hour_output);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$find = $hash_hour;\n\t\t\t\t\t\t$replace = $hour_output;\n\n\t\t\t\t\t\tif ($output_at == 'hour')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\n\t\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Outputting hour data for '.$ymd);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each day\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//var_dump($this->CDT->ymd . ' OUTSIDE DAY');\n\n\t\t\t\t\tif ($each_day != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$prefix = $suffix = '';\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Prep day variables\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY');\n\n\t\t\t\t\t\t$day_output = str_replace($find, $replace, $each_day);\n\n\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(1);\n\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-2);\n\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY 2');\n\n\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t$vars['conditional'] = array(\n\t\t\t\t\t\t\t'day_is_today'\t\t\t=> ($today_ymd == $ymd) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_is_weekend'\t\t=> ($this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week == 6) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_is_weekday'\t\t=> ($this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week == 6) ? FALSE : TRUE,\n\t\t\t\t\t\t\t'day_in_current_month'\t=> ($this->CDT->month == $current_period_start['month']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_in_previous_month'\t=> ($this->CDT->month < $current_period_start['month'] OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->year < $current_period_start['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_in_next_month'\t\t=> ($this->CDT->month > $current_period_start['month'] OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->year > $current_period_start['year']) ? TRUE : FALSE\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t'day'\t\t\t\t\t=> $d,\n\t\t\t\t\t\t\t'prev_day'\t\t\t\t=> $prev_CDT['day'],\n\t\t\t\t\t\t\t'next_day'\t\t\t\t=> $next_CDT['day'],\n\t\t\t\t\t\t\t'day_event_total'\t\t=> $day_event_total,\n\t\t\t\t\t\t\t'all_day_event_total'\t=> $all_day_event_total\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t'day' \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t'prev_day' \t=> $prev_CDT,\n\t\t\t\t\t\t\t'next_day'\t=> $next_CDT\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$day_output = $this->parse_count_hashes('day_event_count', $this->swap_vars($vars, $day_output));\n\n\n\t\t\t\t\t\t$find = $hash_day;\n\t\t\t\t\t\t$replace = $prefix.$day_output.$suffix;\n\n\t\t\t\t\t\tif ($output_at == 'day')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting day data for '.$ymd);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY 3');\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each week\n\t\t\t\t\t// -------------------------------------\n\n//var_dump($this->CDT->ymd . ' OUTSIDE WEEK');\n\n\t\t\t\t\tif ($each_week != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($w != $next_w OR\n\t\t\t\t\t\t\t($each_month != '' AND\n\t\t\t\t\t\t\t\t(($m != $next_m OR $last_day === TRUE) AND\n\t\t\t\t\t\t\t\t\t($ymd >= $current_period_start['ymd'] AND\n\t\t\t\t\t\t\t\t\t\t(\t($last_day === TRUE AND $ymd == $current_period_end['ymd']) OR\n\t\t\t\t\t\t\t\t\t\t($ymd != $current_period_end['ymd']))))) OR\n\t\t\t\t\t\t\t$last_day === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' WEEK');\n\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$week_output = str_replace($find, $week_temp, $each_week);\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep week variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$offset = ($this->CDT->day_of_week > $this->first_day_of_week) ?\n\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week - $this->first_day_of_week :\n\t\t\t\t\t\t\t\t\t\t7 - ($this->first_day_of_week - $this->CDT->day_of_week);\n\n\t\t\t\t\t\t\t$this->CDT->add_day(-$offset);\n\t\t\t\t\t\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(7);\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-14);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' WEEK 2');\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this week\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$week_event_total \t= 0;\n\n\t\t\t\t\t\t\t//$week_count_id\t\t= 'week_event_total_' . uniqid();\n\n\t\t\t\t\t\t\tif (strpos($each_week, 'week_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->add_day(6);\n\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$week_event_total += $this->count_events($k, $event_array, $all_day, 'week', $events);\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\t$vars = array();\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'week'\t\t\t\t=> $w,\n\t\t\t\t\t\t\t\t'prev_week'\t\t\t=> $prev_CDT['week_number'],\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT['week_number'],\n\t\t\t\t\t\t\t\t'week_event_total' \t=> $week_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'week' \t\t \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date' \t\t \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_week' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_week'\t \t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$week_output = $this->parse_count_hashes('week_event_count', $this->swap_vars($vars, $week_output));\n\n\t\t\t\t\t\t\t$find = $hash_week;\n\t\t\t\t\t\t\t$replace = $week_output;\n\t\t\t\t\t\t\t$week_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'week')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t$week_event_count = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($end['day'] == $d AND\n\t\t\t\t\t\t\t\t$end['month'] == $m AND\n\t\t\t\t\t\t\t\t$d == $this->CDT->days_in_month($m, $y) AND\n\t\t\t\t\t\t\t\t$this->P->value('pad_short_weeks') === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$week_output = str_replace($find, $week_temp, $each_week);\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep week variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$this->CDT->add_day(-6);\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(7);\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-14);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this week\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$week_event_total = 0;\n\n\t\t\t\t\t\t\tif (strpos($each_week, 'week_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->add_day(6);\n\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$week_event_total += $this->count_events($k, $event_array, $all_day, 'week', $events);\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\t$vars = array();\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'week'\t\t\t\t=> $w,\n\t\t\t\t\t\t\t\t'prev_week'\t\t\t=> $prev_CDT['week_number'],\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT['week_number'],\n\t\t\t\t\t\t\t\t'week_event_total' \t=> $week_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'week' \t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_week' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$week_output = $this->parse_count_hashes('week_event_count', $this->swap_vars($vars, $week_output));\n\n\t\t\t\t\t\t\t$find \t\t= $hash_week;\n\t\t\t\t\t\t\t$replace \t= $week_output;\n\t\t\t\t\t\t\t$week_temp \t= '';\n\n\t\t\t\t\t\t\tif ($output_at == 'week')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting week data for '.$ymd);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t$week_event_count = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each month\n\t\t\t\t\t// -------------------------------------\n\n//var_dump($this->CDT->ymd . ' OUTSIDE MONTH');\n\n\t\t\t\t\tif ($each_month != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (($m != $next_m OR $last_day === TRUE) AND\n\t\t\t\t\t\t\t(\t$ymd >= $current_period_start['ymd'] AND\n\t\t\t\t\t\t\t\t(\t($last_day === TRUE AND $ymd == $current_period_end['ymd']) OR\n\t\t\t\t\t\t\t\t\t($ymd != $current_period_end['ymd'])\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$month_temp .= $replace;\n\t\t\t\t\t\t\t$month_output = str_replace($find, $month_temp, $each_month);\n\n\t\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t\t//\treset and add month because\n\t\t\t\t\t\t\t//\tthis gets 'off' some places\n\t\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t\t$this->CDT->set_default($current_period_start);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t//first month is correct\n\t\t\t\t\t\t\tif ($month_tick > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->CDT->add_month($month_tick);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$month_tick++;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep month variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t//add a month\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_month();\n\n\t\t\t\t\t\t\t//subtract 2\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_month(-2);\n\n\t\t\t\t\t\t\t//add 1, now we are back where we started!\n\t\t\t\t\t\t\t$this->CDT->add_month();\n\t\t\t\t\t\t\t$this->CDT->change_date($this->CDT->year, $this->CDT->month, 1);\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' MONTH 2');\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this month\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$month_event_total = 0;\n\n\t\t\t\t\t\t\tif (strpos($each_month, 'month_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year.str_pad($this->CDT->month, 2, '0', STR_PAD_LEFT).'01';\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year.str_pad($this->CDT->month, 2, '0', STR_PAD_LEFT).$this->CDT->days_in_month();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$month_event_total += $this->count_events($k, $event_array, $all_day, 'month', $events);\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\t//$vars['conditional'] = array( 'day_in_current_month' => TRUE );\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'month'\t\t\t\t=> $m,\n\t\t\t\t\t\t\t\t'prev_month'\t\t=> $prev_CDT['month'],\n\t\t\t\t\t\t\t\t'next_month'\t\t=> $next_CDT['month'],\n\t\t\t\t\t\t\t\t'month_event_total' => $month_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'month' \t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_month' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_month'\t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$month_output \t= $this->parse_count_hashes(\n\t\t\t\t\t\t\t\t'month_event_count',\n\t\t\t\t\t\t\t\t$this->swap_vars($vars, $month_output)\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$replace \t\t= $month_output;\n\n\t\t\t\t\t\t\t$find = $hash_month;\n\t\t\t\t\t\t\t$month_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'month')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting month data for '.$ymd);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$month_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each year\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_year != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($y != $next_y OR $last_day === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if ($last_day !== TRUE)\n\t\t\t\t\t\t\tif ($last_day == TRUE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$year_temp .= $replace;\n\n\t\t\t\t\t\t\t\t$year_output = str_replace($find, $year_temp, $each_year);\n\n\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t// Calculate the number of events this year\n\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t$year_event_total = 0;\n\n\t\t\t\t\t\t\t\tif (strpos(ee()->TMPL->tagdata, 'year_event_total') !== FALSE)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$low\t= $this->CDT->year.'0101';\n\t\t\t\t\t\t\t\t\t$high\t= $this->CDT->year.'1231';\n\t\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$year_event_total += $this->count_events($k, $event_array, array(), 'year', $events);\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// -------------------------------------\n\t\t\t\t\t\t\t\t// Prep year variables\n\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t$this->CDT->set_default($current_period_start);\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t\tif ($year_tick > 1)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->CDT->add_year($year_tick);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$year_tick++;\n\n\t\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_year(1);\n\t\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_year(-2);\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t\t$vars['conditional']\t\t= array(\n\t\t\t\t\t\t\t\t\t'year_is_leap_year'\t=> $this->CDT->is_leap_year()\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$vars['single']\t\t\t\t= array(\n\t\t\t\t\t\t\t\t\t'year'\t\t\t\t=> $y,\n\t\t\t\t\t\t\t\t\t'prev_year'\t\t\t=> $prev_CDT['year'],\n\t\t\t\t\t\t\t\t\t'next_year'\t\t\t=> $next_CDT['year'],\n\t\t\t\t\t\t\t\t\t'year_event_total'\t=> $year_event_total\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$vars['date']\t\t\t\t= array(\n\t\t\t\t\t\t\t\t\t'year' \t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t\t'prev_year' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t\t'next_year' \t\t=> $next_CDT\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$year_output = $this->parse_count_hashes(\n\t\t\t\t\t\t\t\t\t'year_event_count',\n\t\t\t\t\t\t\t\t\t$this->swap_vars($vars, $year_output)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$replace = $year_output;\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//$replace = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$find = $hash_year;\n\t\t\t\t\t\t\t$year_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'year')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting year data for '.$ymd);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$year_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//parse day event counts\n\t\t\t\t\t//$output = $this->parse_count_hashes('day_event_count', $output);\n\n\t\t\t\t\t//parse week event counts\n\t\t\t\t\t//$output = $this->parse_count_hashes('week_event_count', $output);\n\t\t\t\t}\n\n\t\t\t\t//parse month event counts\n\t\t\t\t//$output = $this->parse_count_hashes('month_event_count', $output);\n\t\t\t}\n\n\t\t\t//parse year event count\n\t\t\t//$output = $this->parse_count_hashes('year_event_count', $output);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\trunning all of these again in case\n\t\t//\tthe didn't fire. This means we\n\t\t//\tare in a straight event loop in\n\t\t//\tcal and it's probably errorsome :/\n\t\t// -------------------------------------\n\n\t\t//parse hour event counts\n\t\t$output = $this->parse_count_hashes('hour_event_count', $output);\n\n\t\t//parse day event counts\n\t\t$output = $this->parse_count_hashes('day_event_count', $output);\n\n\t\t//parse week event counts\n\t\t$output = $this->parse_count_hashes('week_event_count', $output);\n\n\t\t//parse month event counts\n\t\t$output = $this->parse_count_hashes('month_event_count', $output);\n\n\t\t//parse year event count\n\t\t$output = $this->parse_count_hashes('year_event_count', $output);\n\n\t\t//parse year event count\n\t\t$output = $this->parse_count_hashes('event_count', $output);\n\n\t\t$output = $this->swap_vars(array('single'=>array('event_total' => $event_count)), $output);\n\n\t\t$hash = 'hash_'.$output_at;\n\n\t\t$tagdata = isset($$hash) ? str_replace($$hash, $output, $tagdata) : $output;\n\n\t\t$tagdata = $this->parse_pagination($tagdata);\n\n\t\t//ee()->TMPL->log_item('Calendar: All done!');\n\n\t\t// -------------------------------------\n\t\t//\tsetting everything back thats not parsed\n\t\t//\tin case people were writing it in plain text\n\t\t// -------------------------------------\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\n\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tthis shouldn't ever be needed, but here we are\n\t\t//--------------------------------------------\n\n\t\tif (trim($tagdata) === '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\treturn $tagdata;\n\t}", "protected function getCalendarView()\n {\n return !empty($_GET['calview']) ? $_GET['calview'] : 'fullcalendar';\n }", "public function index()\n\t{\n\t\t// Fetch calendars\n\t\t$calendars = $this->calendars->getAllCalendars();\n\n\t\t// Output\n\t\t$this->display($this->load->view('calendar/list', ['calendars' => $calendars], TRUE));\n\t}", "function RenderHtmlTemplateInvoiceRunEvents($context)\n\t{\n\t\t// Check user authorization and permissions\n\t\tAuthenticatedUser()->CheckAuth();\n\t\tAuthenticatedUser()->PermissionOrDie(PERMISSION_ADMIN);\n\n\t\t// Breadcrumb menu\n\t\tBreadCrumb()->Employee_Console();\n\t\tBreadCrumb()->ManageInvoiceRunEvents();\n\t\tBreadCrumb()->SetCurrentPage(\"Invoice Run Events\");\n\n\t\t// Load the events for the invoice run\n\t\tDBO()->InvoiceRun->Load();\n\n\t\tDBL()->automatic_invoice_action_config->SetColumns(array('id', 'days_from_invoice', 'automatic_invoice_action_id'));\n\t\tDBL()->automatic_invoice_action_config->OrderBy(\"days_from_invoice, automatic_invoice_action_id\");\n\t\tDBL()->automatic_invoice_action_config->Load('can_schedule = 1 AND customer_group_id ' . (DBO()->InvoiceRun->customer_group_id->Value ? (' = ' . DBO()->InvoiceRun->customer_group_id->Value) : ' IS NULL'));\n\n\t\t$strWhere = \"invoice_run_id = \" . DBO()->InvoiceRun->Id->Value;\n\t\tDBL()->automatic_invoice_run_event->SetColumns(array('id', 'scheduled_datetime', 'actioned_datetime', 'automatic_invoice_action_id'));\n\t\tDBL()->automatic_invoice_run_event->Load($strWhere);\n\n\t\t// All required data has been retrieved from the database so now load the page template\n\t\tAjax()->RenderHtmlTemplate(\"InvoicerunEvent\", $context, DBO()->Container->Id->Value);\n\n\t\treturn TRUE;\n\t}", "function show_next_calendar(){ \n \t\t\t$this->gen_contents['region_search'] \t= $_POST['region'];\n \t\t\t$this->gen_contents['subregion_search'] = $_POST['subregion'];\n $this->gen_contents['course_search'] = $_POST['course'];\n if($this->gen_contents['course_search']=='5'){\n $this->gen_contents['chp_search'] = $_POST['chp'];\n }\n $this->gen_contents[\"chp_list\"] = $this->config->item('chapter_list');\n $this->gen_contents[\"crse_color\"] = $this->config->item('course_color');\n \t\t\t// we call _date function to get all the details of calendar n its event\n\t\t\t$this->gen_contents = array_merge($this->gen_contents,$this->_date($_POST['timeid'],$_POST['course'],$_POST['region'],$_POST['subregion']));\n\t\t\t\n\t\t\t$this->load->view('user/career_event/schedule_calendar',$this->gen_contents);\n \t\t}", "public function showAction(CalendarEvent $event)\n {\n $deleteForm = $this->createDeleteForm($event);\n\n return $this->render('MALrmBundle:event:show.html.twig', array(\n 'event' => $event,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function create()\n {\n\n return view('webapp-layouts.calendar.create');\n }", "public function eventsAction()\n {\n $events = $this->manager->getRepository('Event\\Doctrine\\Orm\\Event')->findBy(array(), array('date' => 'ASC'));\n\n return $this->renderView('events', array(\n 'title' => 'Zusammenfassung der Grillveranstaltungen',\n 'events' => $events,\n 'meals' => $this->createMealsList($events),\n ));\n }", "function day() {\n if($this->request->get('year') && $this->request->get('month') && $this->request->get('day')) {\n $day = new DateValue($this->request->get('year') . '-' . $this->request->get('month') . '-' . $this->request->get('day'));\n } else {\n $day = DateValue::now();\n } // if\n \n $this->wireframe->addBreadCrumb($day->getYear() . ' / ' . $day->getMonth(), Calendar::getProjectMonthUrl($this->active_project, $day->getYear(), $day->getMonth()));\n $objects = Calendar::getProjectDayData($this->logged_user, $this->active_project, $day);\n \n \t$this->smarty->assign(array(\n 'day' => $day,\n 'objects' => $objects,\n ));\n }", "function ShowCalendar()\n{\n\t$str1=\"select value1 from options where name='calendar'\";\n\t$result=mysql_query($str1) or\n\t\tdie(mysql_error());\n\t$row=mysql_fetch_array($result);\n\tif ($row['value1']==1)\n\t{\n echo(\"<tr><td height='154' valign='top'><table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='#F0F8FF'>\");\n echo(\"<tr><td bgcolor='\");\n\t echo(background());\n\t echo(\"' class='leftmenumainitem' width='216' valign='top'>\");\n\t\techo(\"<img src='image/point.jpg' />&nbsp;&nbsp;\");\n\t\techo(getPara('calendar','value2'));\n\t\techo(\" </td></tr>\");\n echo(\"<tr><td height='132' align='center' valign='middle'><div align='center'>\");\n echo(\"<script language='javascript'>calendar();</script>\");\n echo(\"</div></td></tr></table></td></tr>\");\n\t}\n\n\tmysql_free_result($result);\n}", "public function drawHTML()\n\t{\n\t\t$this->calWeekDays .= \"<table border=\\\"1\\\">\\n\";\n\t\t$this->makeCalendarTitle();\n\t\t$this->makeCalendarHead();\n\t\t$this->makeDayHeadings();\n\t\t$this->calWeekDays .= \"\\t<tr>\\n\";\n\t\t$this->startMonthSpacers();\n\t\t$this->makeHTMLIterator();\n\t\t$this->endMonthSpacers();\n\t\t$this->calWeekDays .= \"\\t</tr>\\n\";\n\t\t$this->calWeekDays .= \"</table>\\n\";\n\t\t\n\t\techo $this->calWeekDays;\n\t}", "public function actionIndex()\r\n {\r\n $events = Events::find()->all();\r\n\t\t$tasks = [];\r\n\t\tforeach ($events as $eve) {\r\n\t\t $event = new \\yii2fullcalendar\\models\\Event();\r\n\t\t $event->id = $eve->id;\r\n\t\t $event->title = $eve->title;\r\n\t\t $event->start = $eve->date_created;\r\n\t\t $tasks[] = $event;\t\t\r\n\t\t}\r\n\t\t\r\n return $this->render('index', [\r\n 'events' => $tasks,\r\n ]);\r\n }", "public function buildCalendarScripts(){\n\t\tob_start();?>\n \t<script>\n\t\t\t\t\n\t\t\t\t//on calendar cell click \n\t\t\t\t$(document).on('click', '.calendar_cell', function(e){\n\t\t\t\t\tif( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n\t\t\t\t\t\tvar fullDate = $(this).attr('id');\n\t\t\t\t\t\t\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t url:'<?php echo $this->ajax_file; ?>',\n\t\t\t\t\t\t data:{action:'get_events', date: fullDate},\n\t\t\t\t\t\t async:false,\n\t\t\t\t\t\t success:function(data, textStatus, jqXHR) {\n\t\t\t\t\t\t\t if (data) {\n\t\t\t\t\t\t\t\t $('#day_events').replaceWith(data);\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t }\n\t\t\t\t\t\t});\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//on view as calendar click\n\t\t\t\t$(document).on('click', '.view_as_calendar', function(e){\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t url:'<?php echo $this->ajax_file; ?>',\n\t\t\t\t\t data:{action:'get_calendar'},\n\t\t\t\t\t async:false,\n\t\t\t\t\t success:function(data, textStatus, jqXHR) {\n\t\t\t\t\t\t if (data) {\n\t\t\t\t\t\t\t $('#events_calendar').replaceWith(data);\n\t\t\t\t\t\t }\n\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//on view as list click\n\t\t\t\t$(document).on('click', '.view_as_list', function(e){\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t url:'<?php echo $this->ajax_file; ?>',\n\t\t\t\t\t data:{action:'get_calendar_list'},\n\t\t\t\t\t async:false,\n\t\t\t\t\t success:function(data, textStatus, jqXHR) {\n\t\t\t\t\t\t if (data) {\n\t\t\t\t\t\t\t $('#day_events').html('');\n\t\t\t\t\t\t\t $('#events_calendar').replaceWith(data);\n\t\t\t\t\t\t }\n\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//on previous month link click\n\t\t\t\t$(document).on('click', '.prev_month_link', function(e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\n\t\t\t\t\tgetCalendar('previous');\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//on next month link click\n\t\t\t\t$(document).on('click', '.next_month_link', function(e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\n\t\t\t\t\tgetCalendar('next');\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tfunction getCalendar(direction){\n\t\t\t\t\t$('.loading').show();\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t url:'<?php echo $this->ajax_file; ?>',\n\t\t\t\t\t data:{action:'get_month',direction: direction},\n\t\t\t\t\t async:false,\n\t\t\t\t\t success:function(data, textStatus, jqXHR) {\n\t\t\t\t\t\t if (data) {\n\t\t\t\t\t\t\t $('.loading').delay( 800 ).hide();\n\t\t\t\t\t\t\t $('#day_events').html('');\n\t\t\t\t\t\t\t $('#events_calendar').replaceWith(data);\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t});\t\n\t\t\t\t}\n </script>\n <?php\n\t\treturn ob_get_clean();\n\t}", "function toICS() {\r\n require_once BPSP_PLUGIN_DIR . '/schedules/iCalcreator.class.php';\r\n global $bp;\r\n define( 'ICAL_LANG', get_bloginfo( 'language' ) );\r\n \r\n $cal = new vcalendar();\r\n $cal->setConfig( 'unique_id', str_replace( 'http://', '', get_bloginfo( 'siteurl' ) ) );\r\n $cal->setConfig( 'filename', $bp->groups->current_group->slug );\r\n $cal->setProperty( 'X-WR-CALNAME', __( 'Calendar for: ', 'bpsp' ) . $bp->groups->current_group->name );\r\n $cal->setProperty( 'X-WR-CALDESC', $bp->groups->current_group->description );\r\n $cal->setProperty( 'X-WR-TIMEZONE', get_option('timezone_string') );\r\n \r\n $schedules = $this->has_schedules();\r\n $assignments = BPSP_Assignments::has_assignments();\r\n $entries = array_merge( $assignments, $schedules );\r\n foreach ( $entries as $entry ) {\r\n setup_postdata( $entry );\r\n \r\n $e = new vevent();\r\n \r\n if( $entry->post_type == \"schedule\" )\r\n $date = getdate( strtotime( $entry->start_date ) );\r\n elseif( $entry->post_type == \"assignment\" )\r\n $date = getdate( strtotime( $entry->post_date ) );\r\n $dtstart['year'] = $date['year'];\r\n $dtstart['month'] = $date['mon'];\r\n $dtstart['day'] = $date['mday'];\r\n $dtstart['hour'] = $date['hours'];\r\n $dtstart['min'] = $date['minutes'];\r\n $dtstart['sec'] = $date['seconds'];\r\n $e->setProperty( 'dtstart', $dtstart );\r\n \r\n $e->setProperty( 'description', get_the_content() . \"\\n\\n\" . $entry->permalink );\r\n \r\n if( !empty( $entry->location ) )\r\n $e->setProperty( 'location', $entry->location );\r\n \r\n if( $entry->post_type == \"assignment\" )\r\n $entry->end_date = $entry->due_date; // make assignments compatible with schedule parser\r\n \r\n if( !empty( $entry->end_date ) ) {\r\n $date = getdate( strtotime( $entry->end_date ) );\r\n $dtend['year'] = $date['year'];\r\n $dtend['month'] = $date['mon'];\r\n $dtend['day'] = $date['mday'];\r\n $dtend['hour'] = $date['hours'];\r\n $dtend['min'] = $date['minutes'];\r\n $dtend['sec'] = $date['seconds'];\r\n $e->setProperty( 'dtend', $dtend );\r\n } else\r\n $e->setProperty( 'duration', 0, 1, 0 ); // Assume it's an one day event\r\n \r\n $e->setProperty( 'summary', get_the_title( $entry->ID ) );\r\n $e->setProperty( 'status', 'CONFIRMED' );\r\n \r\n $cal->setComponent( $e );\r\n }\r\n \r\n header(\"HTTP/1.1 200 OK\");\r\n die( $cal->returnCalendar() );\r\n }", "public function dayview()\n\t{\n\t\t$input = JFactory::getApplication()->input;\n\t\t$db = JFactory::getDbo();\n\t\t$view = $this->getView('pbbooking','html');\n\n\t\t$dateparam = $input->get('dateparam',date_create(\"now\",new DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM),'string');\n\t\t$view->dateparam = date_create($dateparam,new DateTimezone(PBBOOKING_TIMEZONE));\n\t\t$cals = $db->setQuery('select * from #__pbbooking_cals')->loadObjectList();\n\t\t$config = $db->setQuery('select * from #__pbbooking_config')->loadObject();\n\t\t$opening_hours = json_decode($config->trading_hours,true);\n\t\t$start_time_arr = str_split($opening_hours[(int)$view->dateparam->format('w')]['open_time'],2);\n\t\t$end_time_arr = str_split($opening_hours[(int)$view->dateparam->format('w')]['close_time'],2);\n\n\t\t$view->cals = array();\n\t\t$view->opening_hours = $opening_hours[(int)$view->dateparam->format('w')];\n\t\t$view->day_dt_start = date_create($dateparam,new DateTimezone(PBBOOKING_TIMEZONE));\n\t\t$view->day_dt_end = date_create($dateparam,new DateTimezone(PBBOOKING_TIMEZONE));\n\t\t$view->day_dt_start->setTime($start_time_arr[0],$start_time_arr[1],0);\n\t\t$view->day_dt_end->setTime($end_time_arr[0],$end_time_arr[1],0);\n\t\t$view->config = $config;\n\n\t\t//step back one time slot on $view->day_dt_end\n\t\t$view->dt_last_slot = clone $view->day_dt_end;\n\t\t$view->dt_last_slot->modify('- '.$config->time_increment.' minutes');\n\n\t\tforeach ($cals as $i=>$cal) {\n\t\t\t$view->cals[$i] = new Calendar();\n\t\t\t$view->cals[$i]->loadCalendarFromDbase(array($cal->id)); \n\t\t}\n\n\t\t$view->setLayout('dayview');\n\t\t$view->display();\n\t\t\n\t}", "function ca_design_system_custom_wp_block_pattern_agenda()\n{\n\n if (!function_exists('register_block_pattern')) {\n // Gutenberg is not active.\n return;\n }\n\n /**\n * Register Block Pattern\n */\n register_block_pattern(\n 'ca-design-system/agenda',\n array(\n 'title' => __('Agenda', 'ca-design-system'),\n 'description' => __('Agenda layout', 'Block pattern description', 'ca-design-system'),\n 'content' => '<!-- wp:columns -->\n <div class=\"wp-block-columns has-2-columns\">\n <!-- wp:column {\"width\":\"66.66%\"} -->\n <div id=\"main-content\" class=\"wp-block-column\" style=\"flex-basis:66.66%\">\n \n </div>\n <!-- /wp:column -->\n\n <!-- wp:column {\"width\":\"33.33%\"} -->\n <div class=\"wp-block-column\" style=\"flex-basis:33.33%\">\n\n </div>\n <!-- /wp:column --> \n </div><!-- /wp:columns -->',\n \"categories\" => array('ca-design-system'),\n )\n );\n}", "public function getRender(){\n /*\n * adiciona os listeners de comportamento padrão do componente\n */\n \n //ação que executa ao clicar sobre algum evento, abre a tela com as informações carregadas\n $sFuncao = \"eventWindow.show(record, el);\";\n $this->addListener(self::EVENTO_CLICK,$sFuncao,\"view, record, el\");\n \n //ação que ocorre ao clicar sobre os grids (dia, semana, mês)\n $sFuncao = \"eventWindow.show({\"\n .\"StartDate: date,\"\n .\"IsAllDay: allDay\"\n .\"}, el);\";\n $this->addListener(self::EVENTO_DAY_CLICK,$sFuncao,\"view, date, allDay, el\");\n \n //ação que ocorre ao redimensionar (aumentar ou reduzir) o tempo de um evento\n $sFuncaoUpdate = \"var calendarEventStore = Ext.ComponentQuery.query('#\".$this->getId().\"-calendar')[0].eventStore;\"\n .\"calendarEventStore.sync({\"\n .\"callback: function(batch, operation){\"\n .\"var result = batch.operations[0].request.scope.reader.jsonData['success'];\"\n .\"if(!result){\"\n .\"calendarEventStore.rejectChanges();\"\n .\"}\"\n .\"}\"\n .\"});\";\n $this->addListener(self::EVENTO_RESIZE,$sFuncaoUpdate,\"view, record\");\n \n //ação que ocorre ao mover um evento na tela\n $this->addListener(self::EVENTO_MOVE,$sFuncaoUpdate,\"view, record\");\n \n //ação que ocorre ao iniciar a movimentação dos elementos na tela\n $sFuncao = \"if(eventWindow && eventWindow.isVisible()){\"\n .\"eventWindow.hide();\"\n .\"}\";\n $this->addListener(self::EVENTO_DRAG,$sFuncao,\"view\");\n \n //ação que ocorre após selecionar várias linhas no grid (permite criar novo eventos por intervalos)\n $sFuncao = \"eventWindow.show(dates);\"\n .\"eventWindow.on('hide', onComplete, this, {single:true});\";\n $this->addListener(self::EVENTO_RANGE,$sFuncao,\"window, dates, onComplete\");\n \n /*\n * eventos que podem ser implementados no componente\n */\n //$this->addListener(self::EVENTO_OVER,\"\",\"view, record, el\");\n //$this->addListener(self::EVENTO_OUT,\"\",\"view, record, el\");\n //$this->addListener(self::EVENTO_ADD,$sFuncao,\"form, record\");\n //$this->addListener(self::EVENTO_UPDATE,$sFuncao,\"form, record\");\n //$this->addListener(self::EVENTO_DELETE,$sFuncao,\"window, record\");\n //$this->addListener(self::EVENTO_CANCEL,\"\",\"form, record\");\n //$this->addListener(self::EVENTO_VIEW_CHANGE,$sFuncao,\"panel, view, info\");\n \n $aRender = array(\n \"xtype\" => 'calendarpanel',\n \"itemId\" => $this->getId().\"-calendar\",\n \"calendarStore\" => $this->getRenderStoreTipoEvento(),\n \"eventStore\" => $this->getRenderStoreEvento(),\n \"activeItem\" => $this->getPerspectiva(),\n \"showNavBar\" => $this->getMostraBarraPerspectivas(),\n \"showDayView\" => $this->getMostraPerspectivaDia(),\n \"showWeekView\" => $this->getMostraPerspectivaSemana(),\n \"showMonthView\" => $this->getMostraPerspectivaMes(),\n \"showTime\" => $this->getMostraHora(),\n \"monthViewCfg\" => $this->getConfiguracaoMes(),\n \"eventIncrement\" => $this->getDuracaoEvento(),\n \"viewStartHour\" => $this->getHoraInicial(),\n \"viewStartMinute\" => $this->getMinutoInicial(),\n \"viewEndHour\" => $this->getHoraFinal(),\n \"viewEndMinute\" => $this->getMinutoFinal(),\n \"viewConfig\" => $this->getConfiguracao(),\n \"listeners\" => $this->getListeners()\n );\n \n $sRender = \"Ext.create('Ext.panel.Panel', {\"\n .\"layout: 'border',\"\n .\"border: true,\"\n .\"items: [{\"\n .\"xtype: 'panel',\"\n .\"itemId: '\".$this->getId().\"-region-west',\"\n .\"region: 'west',\"\n .\"title: 'Calendário',\"\n .\"collapsible: true,\"\n .\"split: true,\"\n .\"width: 220,\"\n .\"maxWidth: 220,\"\n .\"layoutConfig: {\"\n .\"fill: false,\"\n .\"animate: true\"\n .\"},\"\n .\"padding: '3',\"\n .\"bodyStyle:{\"\n .\"backgroundColor: '#157fcc'\"\n .\"},\"\n .\"items: [{\"\n .\"xtype: 'datepicker',\"\n .\"itemId: '\".$this->getId().\"-picker',\"\n .\"cls: 'ext-cal-nav-picker',\"\n .\"listeners: {\"\n .\"'select': {\"\n .\"fn: function(dp, dt){\"\n .\"Ext.ComponentQuery.query('#\".$this->getId().\"-calendar')[0].setStartDate(dt);\"\n .\"},\"\n .\"scope: this\"\n .\"}\"\n .\"}\"\n .\"},{\"\n .$this->getListaAgenda()\n .\"}]\"\n .\"},{\"\n .\"region: 'center',\"\n .\"itemId: '\".$this->getId().\"-region-center',\"\n .\"style:{\"\n .\"border: '3px solid #5A91D2',\"\n .\"borderLeft: 'none'\"\n .\"},\"\n .Base::getRender($aRender)\n .\"}]\"\n .\"})\";\n \n return Base::addObj($sRender,$this->getRenderTo()).$this->getTelaManutencao();\n }", "function displayLatestEvents()\n\t{\n\t\t$viewname = $this->getTheme();\n\n\t\t$cfg = JEVConfig::getInstance();\n\n\t\t// override global start now setting so that timelimit plugin can use it!\n\t\t$compparams = ComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t$startnow = $compparams->get(\"startnow\", 0);\n\t\t$compparams->set(\"startnow\", $this->modparams->get(\"startnow\", 0));\n\t\t$this->getLatestEventsData();\n\t\t$compparams->set(\"startnow\", $startnow);\n\n\t\t$content = \"\";\n\n\t\t$k = 0;\n\t\tif (isset($this->eventsByRelDay) && count($this->eventsByRelDay))\n\t\t{\n\t\t\t$content .= $this->getModuleHeader('<table class=\"mod_events_latest_table jevbootstrap\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">');\n\n\t\t\t// Now to display these events, we just start at the smallest index of the $this->eventsByRelDay array\n\t\t\t// and work our way up.\n\n\t\t\t$firstTime = true;\n\n\t\t\t// initialize name of com_jevents module and task defined to view\n\t\t\t// event detail. Note that these could change in future com_event\n\t\t\t// component revisions!! Note that the '$this->itemId' can be left out in\n\t\t\t// the link parameters for event details below since the event.php\n\t\t\t// component handler will fetch its own id from the db menu table\n\t\t\t// anyways as far as I understand it.\n\n\t\t\t$this->processFormatString();\n\n\t\t\tforeach ($this->eventsByRelDay as $relDay => $daysEvents)\n\t\t\t{\n\n\t\t\t\treset($daysEvents);\n\n\t\t\t\t// get all of the events for this day\n\t\t\t\tforeach ($daysEvents as $dayEvent)\n\t\t\t\t{\n\n\t\t\t\t\tif ($this->processTemplate($content, $dayEvent))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$eventcontent = \"\";\n\n\t\t\t\t\t// generate output according custom string\n\t\t\t\t\tforeach ($this->splitCustomFormat as $condtoken)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif (isset($condtoken['cond']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($condtoken['cond'] == 'a' && !$dayEvent->alldayevent())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == '!a' && $dayEvent->alldayevent())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == 'e' && !($dayEvent->noendtime() || $dayEvent->alldayevent()))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == '!e' && ($dayEvent->noendtime() || $dayEvent->alldayevent()))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == '!m' && $dayEvent->getUnixStartDate() != $dayEvent->getUnixEndDate())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == 'm' && $dayEvent->getUnixStartDate() == $dayEvent->getUnixEndDate())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach ($condtoken['data'] as $token)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($match);\n\t\t\t\t\t\t\tunset($dateParm);\n\t\t\t\t\t\t\t$dateParm = \"\";\n\t\t\t\t\t\t\t$match = '';\n\t\t\t\t\t\t\tif (is_array($token))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$match = $token['keyword'];\n\t\t\t\t\t\t\t\t$dateParm = isset($token['dateParm']) ? trim($token['dateParm']) : \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (strpos($token, '${') !== false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$match = $token;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$eventcontent .= $token;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->processMatch($eventcontent, $match, $dayEvent, $dateParm, $relDay);\n\t\t\t\t\t\t} // end of foreach\n\t\t\t\t\t} // end of foreach\n\n\t\t\t\t\tif ($firstTime)\n\t\t\t\t\t\t$eventrow = '<tr class=\"jevrow' . $k . '\"><td class=\"mod_events_latest_first\">%s' . \"</td></tr>\\n\";\n\t\t\t\t\telse\n\t\t\t\t\t\t$eventrow = '<tr class=\"jevrow' . $k . '\"><td class=\"mod_events_latest\">%s' . \"</td></tr>\\n\";\n\n\t\t\t\t\t$templaterow = $this->modparams->get(\"modlatest_templaterow\") ? $this->modparams->get(\"modlatest_templaterow\") : $eventrow;\n\t\t\t\t\t$content .= str_replace(\"%s\", $eventcontent, $templaterow);\n\n\t\t\t\t\t$firstTime = false;\n\t\t\t\t} // end of foreach\n\t\t\t\t$k++;\n\t\t\t\t$k %= 2;\n\t\t\t} // end of foreach\n\t\t\t$content .= $this->getModuleFooter(\"</table>\\n\");\n\t\t}\n\t\telse if ($this->modparams->get(\"modlatest_NoEvents\", 1))\n\t\t{\n\t\t\t$content .= $this->modparams->get(\"modlatest_templatetop\") || $this->modparams->get(\"modlatest_templatetop\") ? $this->modparams->get(\"modlatest_templatetop\") : '<table class=\"mod_events_latest_table jevbootstrap\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">';\n\t\t\t$templaterow = $this->modparams->get(\"modlatest_templaterow\") ? $this->modparams->get(\"modlatest_templaterow\") : '<tr><td class=\"mod_events_latest_noevents\">%s</td></tr>' . \"\\n\";\n\t\t\t$content .= str_replace(\"%s\", Text::_('JEV_NO_EVENTS'), $templaterow);\n\t\t\t$content .= $this->modparams->get(\"modlatest_templatebottom\") ? $this->modparams->get(\"modlatest_templatebottom\") : \"</table>\\n\";\n\t\t}\n\n\t\t$callink_HTML = '<div class=\"mod_events_latest_callink\">'\n\t\t\t. $this->getCalendarLink()\n\t\t\t. '</div>';\n\n\t\tif ($this->linkToCal == 1)\n\t\t\t$content = $callink_HTML . $content;\n\t\tif ($this->linkToCal == 2)\n\t\t\t$content .= $callink_HTML;\n\n\t\tif ($this->displayRSS)\n\t\t{\n\t\t\t$rssimg = Uri::root() . \"media/system/images/livemarks.png\";\n\t\t\t$callink_HTML = '<div class=\"mod_events_latest_rsslink\">'\n\t\t\t\t. '<a href=\"' . $this->rsslink . '\" title=\"' . Text::_(\"RSS_FEED\") . '\" target=\"_blank\">'\n\t\t\t\t. '<img src=\"' . $rssimg . '\" alt=\"' . Text::_(\"RSS_FEED\") . '\" />'\n\t\t\t\t. Text::_(\"SUBSCRIBE_TO_RSS_FEED\")\n\t\t\t\t. '</a>'\n\t\t\t\t. '</div>';\n\t\t\t$content .= $callink_HTML;\n\t\t}\n\n\t\tif ($this->modparams->get(\"contentplugins\", 0))\n\t\t{\n\t\t\t$eventdata = new stdClass();\n\t\t\t$eventdata->text = $content;\n\t\t\tFactory::getApplication()->triggerEvent('onContentPrepare', array('com_jevents', &$eventdata, &$this->modparams, 0));\n\t\t\t$content = $eventdata->text;\n\t\t}\n\n\t\treturn $content;\n\n\t}", "public function actionIndex()\n {\n $searchModel = new CalendarSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function calendario(){\n return view('layouts.calendario')->with('encabezado','layouts.encabezadojefe');\n }", "public function generate($year = NULL, $month = NULL, $events = array(), $uriPath = 'calendar/show/', $templatePath = 'calendar/') {\n // Set month and year\n if (is_null($year))\n $year = date(\"Y\", time());\n\n if (is_null($month))\n $month = date(\"m\", time());\n\n\n $this->_selected_year = $year;\n $this->_selected_month = $month;\n\n $header = self::generate_header($uriPath);\n $body = self::generate_body($events);\n\n\n $data = array_merge($header, $body);\n\n return $this->CI->load->view($templatePath.'calendar_template_view', $data);\n }", "private function makeDayEventListHTML()\n\t{\n\t\t$showtext = \"\";\n\t\tforeach($this->eventItems as $item) {\n\t\t\tif($item['date'] == $this->curYear.'-'.$this->curMonth.'-'.$this->dayOfMonth) {\n\t\t\t\t$category = (strlen($item['cat']) > 0 ? 'Category: '.$item['cat'].' - ' : '');\n\t\t\t\t$outevents[$n]['category'] = $item['cat'];\n\t\t\t\t\n\t\t\t\tif($item['stdurl']) {\n\t\t\t\t\t$href = '<a href=\"'.$item['url'].'?id='.$item['id'].'\" title=\"'.$category.$item['desc'].'\">'.$item['text'].'</a>';\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'].'?id='.$item['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$href = (strlen($item['url']) > 0 ? '<a href=\"'.$item['url'].'\" title=\"'.$category.$item['desc'].'\">'.$item['text'].'</a>' : $item['text']);\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$style = (strlen($item['catcolor']) > 0 ? ' style=\"background-color:#'.str_replace('#','',$item['catcolor']).';\" ' : ' style=\"background-color:#eeeeee;\" ');\n\t\t\t\t\n\t\t\t\t$showtext .= \"\\n\\t\\t\\t<div class=\\\"dayContent\\\"\".$style.\">\".$href.\"</div>\\n\\t\\t\";\n\t\t\t\t\n\t\t\t\t$outevents[$n]['summary'] = $item['text'];\n\t\t\t\t$outevents[$n]['description'] = $item['desc'];\n\t\t\t\t$outevents[$n]['categorycolor'] = (strlen($item['catcolor']) > 0 ? str_replace('#','',$item['catcolor']) : '#eeeeee');\n\t\t\t}\n\t\t\t$n++;\n\t\t}\n\t\treturn $showtext;\n\t}", "public function show(EventCalendar $eventCalendar)\n {\n //\n }", "public function create()\n {\n return view('Backend.Calendar.create');\n }", "function wfCalendarDisplay($paramstring, $params = array(), $parser)\n{\n global $wgRequest;\n global $wgTitle, $wgUser;\n global $wgRestrictCalendarTo, $wgCalendarDisableRedirects;\n global $wgCalendarForceNamespace, $wgCalendarDateFormat;\n\n wfCalendarRefresh();\n\n $parser->disableCache();\n $userMode = 'month';\n\n $calendar = new WikiCalendar();\n\n // set path\n $params['path'] = str_replace(\"\\\\\", \"/\", dirname(__FILE__));\n\n // normal calendar...\n $params['title'] = $wgTitle;\n $calendar->paramstring = $paramstring;\n $calendar->config($params);\n $title = $params['title']->getPrefixedText();\n $name = $params['name'];\n\n // if the calendar isn't in a namespace(s) specificed in $wgCalendarForceNamespace, return a warning\n // this can be a string or an array\n if (isset($wgCalendarForceNamespace))\n {\n $ns = $wgCalendarForceNamespace;\n if (!is_array($ns))\n $ns = array($ns);\n if (!in_array($calendar->namespace, $ns) && !isset($params[\"fullsubscribe\"]))\n return CalendarCommon::translate('invalid_namespace') . '<b>'.implode(', ', $ns).'</b>';\n }\n // finished special conditions\n\n $p = 'cal'.crc32(\"$title $name\");\n $v = $wgRequest->getVal($p);\n if ($v)\n {\n list($year, $month, $day, $mode) = explode('-', $v, 4);\n $calendar->setYear(0+$year);\n $calendar->setMonth(0+$month);\n $calendar->setDay(0+$day);\n if (wfCalendarIsValidMode($mode))\n {\n $userMode = $mode;\n }\n }\n else\n {\n // defaults from the <calendar /> parameters; must restart browser to enable\n if (isset($params['week']))\n $userMode = 'week';\n if (isset($params['year']))\n $userMode = 'year';\n }\n\n if (isset($params['useeventlist']))\n $userMode = 'events';\n if (isset($params['date']) && strtolower($params['date']) != 'off')\n $userMode = 'day';\n if (isset($params['simplemonth']))\n $userMode = 'simplemonth';\n\n if (($ical = $wgRequest->getText('ical')) &&\n ($title = Title::newFromText($ical, NS_FILE)) &&\n ($img = wfLocalFile($title)))\n {\n $calendar->load_iCal($img->getFullPath());\n // refresh the calendar's newly added events\n $calendar->invalidateCache = true;\n }\n\n $render = $calendar->renderCalendar($userMode);\n\n // purge main calendar before displaying the calendar\n if ($calendar->invalidateCache)\n {\n $article = new Article(Title::newFromText($title));\n $article->purge();\n header(\"Location: \" . $wikiRoot . $title);\n }\n\n return $render;\n}", "public function index()\n {\n (new Calendar())->getOutDays();\n $user = Auth::user();\n $year = $_GET['year'] ?? Carbon::now()->year;\n $data = array(\n \"hours\" => array(1, 2, 3, 4, 5, 6),\n \"date\" => Carbon::now('Europe/Paris'),\n \"categories\" => Category::all(),\n \"calendar\" => (new Calendar())->show(),\n \"navi\" => (new Calendar())->navigation(),\n \"counts\" => array(\n 'f' => Helpers::getCounter('f', $year, $user),\n 'cp' => Helpers::getCounter('cp', $year, $user),\n 'r' => Helpers::getCounter('r', $year, $user),\n 'am' => Helpers::getCounter('am', $year, $user),\n 'cs' => Helpers::getCounter('cs', $year, $user),\n 'a' => Helpers::getCounter('a', $year, $user),\n ),\n \"days\" => Helpers::getNumberRange(1, 31),\n \"months\" => Helpers::getNumberRange(1, 12),\n \"years\" => Helpers::getNumberRange(2015, 2030),\n );\n\n return view('pages.wcalendar.index', compact('data'));\n }" ]
[ "0.7868035", "0.7584257", "0.74829024", "0.7348144", "0.71865946", "0.7084642", "0.7071293", "0.6928249", "0.6878954", "0.6874387", "0.6786436", "0.6680422", "0.6600298", "0.6530445", "0.6496328", "0.64496005", "0.6421507", "0.63922626", "0.630482", "0.6170835", "0.61464334", "0.61416674", "0.61164963", "0.611066", "0.6110012", "0.61017245", "0.6087412", "0.6068227", "0.6048136", "0.60267264", "0.60020167", "0.6000644", "0.5997599", "0.59777945", "0.5958024", "0.59565026", "0.59496135", "0.5844656", "0.5844456", "0.58403236", "0.5839374", "0.58181894", "0.5810589", "0.5809679", "0.5809466", "0.57976705", "0.5793457", "0.5783598", "0.5766125", "0.57646614", "0.5739546", "0.57297224", "0.57151353", "0.57151353", "0.57136625", "0.57088196", "0.56985414", "0.56781536", "0.5663971", "0.5649359", "0.564237", "0.5639061", "0.5636533", "0.56360453", "0.56345403", "0.5634136", "0.5633009", "0.5609278", "0.5599268", "0.5597919", "0.55941135", "0.55922854", "0.55859935", "0.55837566", "0.5574325", "0.55696213", "0.55587626", "0.5552618", "0.5549143", "0.55488604", "0.5546176", "0.5545575", "0.5542665", "0.5542286", "0.5538241", "0.553821", "0.5535952", "0.5531194", "0.5529617", "0.5529193", "0.55272937", "0.552563", "0.55249393", "0.5515412", "0.5514004", "0.5513629", "0.5493319", "0.54916376", "0.5491247", "0.5477385" ]
0.73272
4
Registers the `core/calendar` block on server.
function register_block_core_calendar() { register_block_type_from_metadata( __DIR__ . '/calendar', array( 'render_callback' => 'render_block_core_calendar', ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register_block_core_calendar()\n {\n }", "public function calendar()\n {\n $this->template->set('global_setting', $this->global_setting);\n $this->template->set('page', 'calendar');\n $this->template->set_theme('default_theme');\n $this->template->set_layout('frontend')\n ->title($this->global_setting['site_title'] . ' | Calendar')\n ->set_partial('header', 'partials/header')\n ->set_partial('footer', 'partials/footer');\n $this->template->build('frontpages/calendar');\n }", "function render_block_core_calendar($attributes)\n {\n }", "function ticketmaster_register_block() {\n\n\tif ( ! function_exists( 'register_block_type' ) ) {\n\t\t// Gutenberg is not active.\n\t\treturn;\n\t}\n\n\twp_register_script(\n\t\t'ticketmaster',\n\t\tplugins_url( 'build/index.js', __FILE__ ),\n\t\tarray( 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components'),\n\t\tfilemtime( plugin_dir_path( __FILE__ ) . 'block.js' )\n\t);\n\n register_block_type('ticketmaster/event-listing', [\n 'editor_script' => 'ticketmaster',\n 'attributes' => [\n 'term' => [\n 'type' => 'string',\n 'default' => 'Concert'\n ],\n 'size' => [\n 'type' => 'number',\n 'default' => 8\n ],\n ],\n 'render_callback' => render_nova_directive('EventListing'),\n ]);\n}", "function register_calendar() {\n\t\t\n\t\t/* Calendar */\n\t\t$calendar_tax_labels = array(\t\t\t\n\t\t\t'name'\t\t\t\t\t\t=> 'Calendars',\n\t\t\t'singular_name'\t\t\t\t=> 'Calendar',\n\t\t\t'search_items'\t\t\t\t=> 'Search Calendars',\n\t\t\t'popular_items'\t\t\t\t=> 'Popular Calendars',\n\t\t\t'all_items'\t\t\t\t\t=> 'All Calendars',\n\t\t\t'edit_item'\t\t\t\t\t=> 'Edit Calendar',\n\t\t\t'update_item'\t\t\t\t=> 'Update Calendar',\n\t\t\t'add_new_item'\t\t\t\t=> 'Add New Calendar',\n\t\t\t'new_item_name'\t\t\t\t=> 'New Calendar Name',\n\t\t\t'menu_name'\t\t\t\t\t=> 'Calendars',\n\t\t\t'separate_items_with_commas'=> 'Separate calendars with commas',\n\t\t\t'choose_from_most_used'\t\t=> 'Choose from the most used calendars',\n\t\t);\n\t\t\n\t\t$calendar_tax_caps = array(\n\t\t\t'manage_terms'\t\t\t\t=> 'manage_categories',\n\t\t\t'edit_terms'\t\t\t\t=> 'manage_categories',\n\t\t\t'delete_terms'\t\t\t\t=> 'manage_categories',\n\t\t\t'assign_terms'\t\t\t\t=> 'edit_posts'\n\t\t);\n\t\t\n\t\t$calendar_tax_args = array(\n\t\t\t'labels'\t\t\t\t\t=> $calendar_tax_labels,\n\t\t\t'public'\t\t\t\t\t=> true,\n\t\t\t'show_ui'\t\t\t\t\t=> true,\n\t\t\t'show_in_nav_menus'\t\t\t=> false,\n\t\t\t'show_tagcloud'\t\t\t\t=> false,\n\t\t\t'hierarchical'\t\t\t\t=> true,\n\t\t\t'rewrite'\t\t\t\t\t=> array( 'slug' => 'calendar' ),\n\t\t\t'capabilities' \t \t\t=> $calendar_tax_caps,\n\t\t);\n\n\t\t/* Register the Calendar post taxonomy! */\n\t\tregister_taxonomy( 'calendar', 'event', $calendar_tax_args );\n\t}", "function rst_manage_seats_moncalender()\n{\n require_once('inc/inc.fullcalendar.php');\n}", "function register_block_core_file()\n {\n }", "function register_block_core_post_date()\n {\n }", "function render_block_core_calendar( $attributes ) {\n\tglobal $monthnum, $year;\n\n\t// Calendar shouldn't be rendered\n\t// when there are no published posts on the site.\n\tif ( ! block_core_calendar_has_published_posts() ) {\n\t\tif ( is_user_logged_in() ) {\n\t\t\treturn '<div>' . __( 'The calendar block is hidden because there are no published posts.' ) . '</div>';\n\t\t}\n\t\treturn '';\n\t}\n\n\t$previous_monthnum = $monthnum;\n\t$previous_year = $year;\n\n\tif ( isset( $attributes['month'] ) && isset( $attributes['year'] ) ) {\n\t\t$permalink_structure = get_option( 'permalink_structure' );\n\t\tif (\n\t\t\tstr_contains( $permalink_structure, '%monthnum%' ) &&\n\t\t\tstr_contains( $permalink_structure, '%year%' )\n\t\t) {\n\t\t\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited\n\t\t\t$monthnum = $attributes['month'];\n\t\t\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited\n\t\t\t$year = $attributes['year'];\n\t\t}\n\t}\n\n\t$color_block_styles = array();\n\n\t// Text color.\n\t$preset_text_color = array_key_exists( 'textColor', $attributes ) ? \"var:preset|color|{$attributes['textColor']}\" : null;\n\t$custom_text_color = _wp_array_get( $attributes, array( 'style', 'color', 'text' ), null );\n\t$color_block_styles['text'] = $preset_text_color ? $preset_text_color : $custom_text_color;\n\n\t// Background Color.\n\t$preset_background_color = array_key_exists( 'backgroundColor', $attributes ) ? \"var:preset|color|{$attributes['backgroundColor']}\" : null;\n\t$custom_background_color = _wp_array_get( $attributes, array( 'style', 'color', 'background' ), null );\n\t$color_block_styles['background'] = $preset_background_color ? $preset_background_color : $custom_background_color;\n\n\t// Generate color styles and classes.\n\t$styles = wp_style_engine_get_styles( array( 'color' => $color_block_styles ), array( 'convert_vars_to_classnames' => true ) );\n\t$inline_styles = empty( $styles['css'] ) ? '' : sprintf( ' style=\"%s\"', esc_attr( $styles['css'] ) );\n\t$classnames = empty( $styles['classnames'] ) ? '' : ' ' . esc_attr( $styles['classnames'] );\n\tif ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) {\n\t\t$classnames .= ' has-link-color';\n\t}\n\t// Apply color classes and styles to the calendar.\n\t$calendar = str_replace( '<table', '<table' . $inline_styles, get_calendar( true, false ) );\n\t$calendar = str_replace( 'class=\"wp-calendar-table', 'class=\"wp-calendar-table' . $classnames, $calendar );\n\n\t$wrapper_attributes = get_block_wrapper_attributes();\n\t$output = sprintf(\n\t\t'<div %1$s>%2$s</div>',\n\t\t$wrapper_attributes,\n\t\t$calendar\n\t);\n\n\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited\n\t$monthnum = $previous_monthnum;\n\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited\n\t$year = $previous_year;\n\n\treturn $output;\n}", "function register_block_core_block()\n {\n }", "protected function register(): void\n {\n if (function_exists('acf_register_block')) {\n acf_register_block_type(array(\n 'name' => $this->id,\n 'title' => $this->title,\n 'description' => $this->description,\n 'render_callback' => [$this, 'render'],\n 'category' => 'layout',\n 'icon' => 'screenoptions',\n 'keywords' => [$this->id, 'zkd'],\n 'supports' => ['anchor' => true]\n ));\n }\n }", "function register_block() {\n\tBlocks::jetpack_register_block(\n\t\tBLOCK_NAME,\n\t\tarray( 'render_callback' => __NAMESPACE__ . '\\load_assets' )\n\t);\n}", "function register_block_core_template_part()\n {\n }", "function _register_core_block_patterns_and_categories()\n {\n }", "function register_block_core_rss()\n {\n }", "public function register_blocks() {\n\t\t}", "public function register ()\n {\n\n add_action( 'enqueue_block_editor_assets', array ( $this , 'mtk_enqueueBlockEditorFiles' ) );\n add_action( 'enqueue_block_assets ', array ( $this , 'mtk_enqueueBlockFiles' ) );\n $this->registerBlock();\n }", "function register_blocks() {\n\trequire_once DKOO_BLOCKS_PATH . 'blocks/background-video/index.php';\n\tBackgroundVideo\\register_block();\n}", "function register_block_core_comment_date()\n {\n }", "function ca_design_system_custom_wp_block_pattern_agenda()\n{\n\n if (!function_exists('register_block_pattern')) {\n // Gutenberg is not active.\n return;\n }\n\n /**\n * Register Block Pattern\n */\n register_block_pattern(\n 'ca-design-system/agenda',\n array(\n 'title' => __('Agenda', 'ca-design-system'),\n 'description' => __('Agenda layout', 'Block pattern description', 'ca-design-system'),\n 'content' => '<!-- wp:columns -->\n <div class=\"wp-block-columns has-2-columns\">\n <!-- wp:column {\"width\":\"66.66%\"} -->\n <div id=\"main-content\" class=\"wp-block-column\" style=\"flex-basis:66.66%\">\n \n </div>\n <!-- /wp:column -->\n\n <!-- wp:column {\"width\":\"33.33%\"} -->\n <div class=\"wp-block-column\" style=\"flex-basis:33.33%\">\n\n </div>\n <!-- /wp:column --> \n </div><!-- /wp:columns -->',\n \"categories\" => array('ca-design-system'),\n )\n );\n}", "function init() {\n\t\\add_action(\n\t\t'rest_api_init',\n\t\t__NAMESPACE__ . '\\register_rest_routes'\n\t);\n\t\\add_action(\n\t\t'enqueue_block_editor_assets',\n\t\t__NAMESPACE__ . '\\sc_enqueue_block_editor_assets'\n\t);\n}", "protected function registerLabCore(){\n $location = Yii::app()->assetManager->publish(Yii::getPathOfAlias('labScript').'/lab/assets/js/LAB.min.js');\n $this->cs->registerScriptFile($location, self::POS_END);\n }", "public function registerBlock()\n {\n register_block_type( 'mtk-plugin/cptshortcode' , array (\n 'editor_script' => 'mtk_cptshortcode_editor',\n 'editor_style' => 'mtk_cptshortcode_editor',\n 'style' => 'mtk_cptshortcode',\n ) );\n\n }", "function plugin_autoinstall_calendarv2($pi_name)\n{\n $pi_name = 'calendarv2';\n $pi_display_name = 'calendarv2';\n $pi_admin = $pi_display_name . ' Admin';\n $pi_moderator = $pi_display_name . 'Moderator';\n\n $info = array(\n 'pi_name' => $pi_name,\n 'pi_display_name' => $pi_display_name,\n 'pi_version' => '0.1',\n 'pi_gl_version' => '1.6.0',\n 'pi_homepage' => 'www.geeklog.net'\n );\n\n $groups = array(\n $pi_admin => 'Users in this group can administer the '\n . $pi_display_name . ' plugin',\n $pi_moderator => 'Users in this group can moderate site wide events'\n );\n\n $features = array(\n $pi_name . '.admin' => 'Full access to ' . $pi_display_name . ' plugin'\n );\n\n $mappings = array(\n $pi_name . '.admin' => array($pi_admin)\n );\n\n $tables = array(\n 'c2_calendars',\n 'c2_events',\n 'c2_submission',\n 'c2_recurring_events',\n 'c2_recurring_specification'\n );\n\n $inst_parms = array(\n 'info' => $info,\n 'groups' => $groups,\n 'features' => $features,\n 'mappings' => $mappings,\n 'tables' => $tables\n );\n\n return $inst_parms;\n}", "function ___init () { if ( isset ( $this->glob->config['website']['time-zone'] ) )\r\n $this->glob->date = new DateTime ( null, new DateTimeZone ( $this->glob->config['website']['time-zone'] ) ) ;\r\n else // No? Just use the server's time-zone\r\n $this->glob->date = new DateTime ( null ) ;\r\n\r\n $this->_register_resource ( XS_MODULE, '_api/modules/datetime' ) ;\r\n \r\n }", "public function register_cpt_blocks() {\n /* Include CPT creation file */\n //include_once( ILIO_BLOCKS_INCLUDES_DIR . '/blockss.post-type.php' );\n }", "public function register() {\n\n if ( ! function_exists( 'register_block_type' ) ) {\n return;\n }\n\n register_block_type( 'minervakb/' . $this->ID, array(\n 'attributes' => $this->get_block_attributes(),\n 'render_callback' => array($this, 'wrapped_render')\n ));\n }", "function register_block_core_shortcode()\n {\n }", "function register_block_core_categories()\n {\n }", "function register_block_core_pattern()\n {\n }", "public static function initialize_calendar(){\n \n $event_array[] = array();\n $schedules = \\App\\Event::get();\n if(!empty($schedules)){\n foreach($schedules as $schedule){\n $event_array[] = array(\n 'id' => uniqid(),\n 'title' => $schedule->description,\n 'start' => date('Y-m-d', strtotime($schedule->event_date)),\n 'end' => date('Y-m-d', strtotime($schedule->event_date)),\n 'color' => \"lightblue\",\n \"textEscape\"=> 'false' ,\n 'textColor' => 'black',\n );\n }\n return $get_schedule = json_encode($event_array);\n }\n }", "function register_block_core_widget_group()\n {\n }", "public function run()\n {\n if (!addon_installed('calendar')) {\n return new Tempcode();\n }\n\n require_lang('calendar');\n\n $bits = new Tempcode();\n if (get_option('calendar_show_stats_count_events') == '1') {\n $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'bf4ae0b77a8ee8bef42adb8d7beb3884', 'KEY' => do_lang_tempcode('EVENTS'), 'VALUE' => integer_format($GLOBALS['SITE_DB']->query_select_value('calendar_events', 'COUNT(*)')))));\n }\n if (get_option('calendar_show_stats_count_events_this_week') == '1') {\n require_code('calendar');\n $events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), $GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 7));\n $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '315d49be79dddfe1019c02939d308632', 'KEY' => do_lang_tempcode('EVENTS_THIS_WEEK'), 'VALUE' => integer_format(count($events)))));\n }\n if (get_option('calendar_show_stats_count_events_this_month') == '1') {\n require_code('calendar');\n $events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), $GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 31));\n $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'c3a3ad0d6ae8e4f98ac3a5d0ceabc841', 'KEY' => do_lang_tempcode('EVENTS_THIS_MONTH'), 'VALUE' => integer_format(count($events)))));\n }\n if (get_option('calendar_show_stats_count_events_this_year') == '1') {\n require_code('calendar');\n $events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), $GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 365));\n $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'f77394adef0febff55cbfc288f979408', 'KEY' => do_lang_tempcode('EVENTS_THIS_YEAR'), 'VALUE' => integer_format(count($events)))));\n }\n\n if ($bits->is_empty_shell()) {\n return new Tempcode();\n }\n\n $section = do_template('BLOCK_SIDE_STATS_SECTION', array('_GUID' => 'ff9667093f093bec44a7be5e97bf183c', 'SECTION' => do_lang_tempcode('CALENDAR'), 'CONTENT' => $bits));\n\n return $section;\n }", "function DisplayCalendarOfEvents()\r\n\t{\r\n\t\tglobal $_SETTINGS;\r\n\t\techo \"<div id='calendar'></div>\";\t\r\n\t}", "function create_block_react_app_block_init() {\n\tregister_block_type( __DIR__ );\n}", "public function register()\n {\n //footer loading static blocks\n view()->composer('frontend.partials.footer-main', function($view)\n {\n $view->with([\n 'footerLeft' => StaticBlock::getStaticBlock(StaticBlock::FOOTER_LEFT),\n 'footerRight' => StaticBlock::getStaticBlock(StaticBlock::FOOTER_RIGHT),\n 'footerCenter' => StaticBlock::getStaticBlock(StaticBlock::FOOTER_CENTER),\n ]);\n });\n\n view()->composer('frontend.partials.header', function($view)\n {\n $view->with([\n 'topLeftHeader' => StaticBlock::getStaticBlock(StaticBlock::HEADER_LEFT),\n 'topRightHeader' => StaticBlock::getStaticBlock(StaticBlock::HEADER_RIGHT),\n 'topCenterHeader' => StaticBlock::getStaticBlock(StaticBlock::HEADER_CENTER),\n 'mainHeader' => StaticBlock::getStaticBlock(StaticBlock::HEADER_MAIN),\n ]);\n });\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 register_block_core_image()\n {\n }", "public static function register_blocks()\n {\n if (function_exists('acf_register_block_type')):\n\n acf_register_block_type(array(\n 'name' => 'hero',\n 'title' => __('Hero'),\n 'render_template' => 'template-parts/blocks/hero/hero.php',\n 'category' => 'custom-blocks',\n 'icon' => 'admin-site',\n 'keywords' => array('hero', 'carousel'),\n 'supports' => array(\n 'align' => false,\n ),\n ));\n\n endif;\n }", "function register_block( $name ) {\n\t\n\t\t\tacf_register_block( array(\n\t\t\t\t'name' => str_replace('-', ' ', $name),\n\t\t\t\t'title' => __( str_replace('-', ' ', ucwords( $name, '-' )), 'genlite' ),\n\t\t\t\t'description' => __( str_replace('-', ' ', ucwords( $name, '-' )) . ' block.', 'genlite' ),\n\t\t\t\t'render_callback' => function( $block, $content = '', $is_preview = false ) {\n\t\t\t\t\t$context = Timber::context();\n\t\t\t\t\n\t\t\t\t\t// Store block values.\n\t\t\t\t\t$context['block'] = $block;\n\t\t\t\t\n\t\t\t\t\t// Store field values.\n\t\t\t\t\t$context['fields'] = get_fields();\n\t\t\t\t\n\t\t\t\t\t// Store $is_preview value.\n\t\t\t\t\t$context['is_preview'] = $is_preview;\n\n\t\t\t\t\t// Render the block.\n\t\t\t\t\tTimber::render( 'templates/blocks/' . str_replace(' ', '-', strtolower( $block['title'] )) . '.twig', $context );\n\t\t\t\t},\n\t\t\t\t'category' => 'genlite-blocks',\n\t\t\t\t'icon' => '',\n\t\t\t\t'keywords' => array( $name ),\n\t\t\t\t'mode' \t\t\t => 'edit'\n\t\t\t) );\t\n\t\t}", "function cs_calender_enqueue_scripts() {\n wp_enqueue_script('calender_js', get_template_directory_uri() . '/scripts/frontend/fullcalendar.min.js', '', '', TRUE);\n\t wp_enqueue_style('fullcalendar_css', get_template_directory_uri() . '/css/fullcalendar.css');\n}", "public function register_blocks() {\n\t\tif ( function_exists( 'register_block_type' ) ) {\n\t\t\tregister_block_type(\n\t\t\t\t\"civil/{$this->slug}\",\n\t\t\t\t[\n\t\t\t\t\t'editor_script' => 'block-js-' . $this->slug,\n\t\t\t\t\t'render_callback' => function( array $attributes ) {\n\t\t\t\t\t\treturn $this->render_block_data( $attributes );\n\t\t\t\t\t},\n\t\t\t\t\t'attributes' => [\n\t\t\t\t\t\t'title' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Title', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'cta_text' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Description', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'cta_button_text' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Button', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'newsletter' => [\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'newsletter_list' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function registerBlocks(): void\n\t{\n\t\tforeach (Components::getBlocks() as $block) {\n\t\t\t$this->registerBlock($block);\n\t\t}\n\t}", "function register_block_core_cover()\n {\n }", "function ajarRegisterBlock() {\n\n //Archivo php generado del builds\n $assets = include_once get_template_directory().'/blocks/build/index.asset.php';\n\n wp_register_script(\n 'ajar-block', // handle del script\n get_template_directory_uri().'/blocks/build/index.js', //url del directorio\n $assets['dependencies'], //all dep\n $assets['version'] // cada build cambia la version, para evitaas conflictos de cache\n );\n\n register_block_type(\n 'ajar/basic',\n array(\n 'editor_script' => 'ajar-block', //copiar el script ya registrado\n 'attributes' => array( //repetimos los attr del block de index.js\n 'content' => array(\n 'type' => \"string\",\n 'default' => 'Hello World'\n ),\n 'mediaURL' => array(\n \"type\" => 'string'\n ),\n 'mediaAlt' => array(\n \"type\" => 'string'\n ),\n ),\n 'render_callback' => 'ajarRenderDinamycBlock' //funcion para generar el SSR(server side render)\n )\n );\n}", "public function getCalendarPage();", "public function ownerCombinedCal()\n {\n // Restricted access\n if ( ! $this->ownerLoggedIn() )\n {\n $this->restricted();\n return;\n }\n\n require_once('views/OwnerCombinedCalView.class.php');\n $site = new SiteContainer($this->db);\n $page = new OwnerCombinedCalView();\n \n $site->printHeader();\n $site->printNav(\"owner\");\n $site->printCombinedCalFooter();\n $page->printHtml();\n $page->printCalendar(); \n\n }", "protected function registerPlugin()\n {\n $id = $this->options['id'];\n $view = $this->getView();\n\n /** @var \\yii\\web\\AssetBundle $assetClass */\n $assets = CoreAsset::register($view);\n\n //by default we load the jui theme, but if you like you can set the theme to false and nothing gets loaded....\n if($this->theme == true)\n {\n ThemeAsset::register($view);\n }\n\t\n\tif (array_key_exists('defaultView',$this->clientOptions) && ($this->clientOptions['defaultView'] == 'timelineDay' || $this->clientOptions['defaultView'] == 'timelineWeek' || $this->clientOptions['defaultView'] == 'timelineMonth' || $this->clientOptions['defaultView'] == 'agendaDay'))\n {\n SchedulerAsset::register($view);\n } \n\n if (isset($this->options['lang']))\n {\n $assets->language = $this->options['lang'];\n }\n\n if ($this->googleCalendar)\n {\n $assets->googleCalendar = $this->googleCalendar;\n }\n\n $js = array();\n\n if($this->ajaxEvents != NULL){\n $this->clientOptions['events'] = $this->ajaxEvents;\n }\n\t \n\tif(!is_null($this->contentHeight) && !isset($this->clientOptions['contentHeight']))\n {\n $this->clientOptions['contentHeight'] = $this->contentHeight;\n }\n\n if(isset($this->customButtons) && !isset($this->clientOptions['customButtons']))\n {\n $this->clientOptions['customButtons'] = $this->customButtons;\n }\n\n if(is_array($this->header) && isset($this->clientOptions['header']))\n {\n $this->clientOptions['header'] = array_merge($this->header,$this->clientOptions['header']);\n } else {\n $this->clientOptions['header'] = $this->header;\n }\n\n\t\tif(isset($this->defaultView) && !isset($this->clientOptions['defaultView']))\n {\n $this->clientOptions['defaultView'] = $this->defaultView;\n }\n\n // clear existing calendar display before rendering new fullcalendar instance\n // this step is important when using the fullcalendar widget with pjax\n $js[] = \"var calendar_sch = jQuery('#$id');\"; // take backup of loading container\n $js[] = \"var loading_container = jQuery('#$id .fc-loading');\"; // take backup of loading container\n $js[] = \"calendar_sch.empty().append(loading_container);\"; // remove/empty the calendar container and append loading container bakup\n\n $cleanOptions = $this->getClientOptions();\n $js[] = \"calendar_sch.fullCalendar($cleanOptions);\";\n\n /**\n * Loads events separately from the calendar creation. Uncomment if you need this functionality.\n *\n * lets check if we have an event for the calendar...\n * if(is_array($this->events))\n * {\n * foreach($this->events AS $event)\n * {\n * $jsonEvent = Json::encode($event);\n * $isSticky = $this->stickyEvents;\n * $js[] = \"jQuery('#$id').fullCalendar('renderEvent',$jsonEvent,$isSticky);\";\n * }\n * }\n */\n\n $view->registerJs(implode(\"\\n\", $js),View::POS_READY);\n }", "function academic_calendar(){\n $data['content_page']='admin/academic_calendar';\n $this->load->view('common/base_template',$data);\n }", "function register_block_core_search()\n {\n }", "function portal_return_calendar_template() {\n\treturn portal_template_hierarchy( 'dashboard/components/calendar/index.php' );\n}", "function register_block_core_page_list() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/page-list',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_page_list',\n\t\t)\n\t);\n}", "function events(){\n if(!$this->session->userdata('logged_in') || $this->session->userdata('role') != 'student'):\n redirect('/');\n endif;\n\n $data = array(\n 'events' => $this->admin_model->browse(array('module' => 'events'))\n );\n //load content\n $this->template->content->view('/students/content/events', $data);\n\n //add js file\n $this->template->publish('layouts/app');\n }", "function register_block_core_gallery()\n {\n }", "function register_block_core_legacy_widget()\n {\n }", "protected function register_assets() {\n\n\t\t// Register block script for backend/editor.\n\t\t\\wp_register_script(\n\t\t\t'tcc-layout-engine',\n\t\t\tplugins_url( '/dist/blocks.build.js', __FILE__ ),\n\t\t\tarray( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ),\n\t\t\tfilemtime( plugin_dir_path( __FILE__ ) . 'dist/blocks.build.js' ),\n\t\t\ttrue\n\t\t);\n\n\t\t// Register block editor styles for backend/editor.\n\t\t\\wp_register_style(\n\t\t\t'tcc-layout-engine',\n\t\t\tplugins_url( 'dist/blocks.editor.build.css', __FILE__ ),\n\t\t\tarray( 'wp-edit-blocks' ),\n\t\t\tfilemtime( plugin_dir_path( __FILE__ ) . 'dist/blocks.editor.build.css' )\n\t\t);\n\n\t}", "function register_service_box()\n{\n register_widget( 'CtaWidget' );\n}", "public function registerCalendar($param)\n {\n $res = array(\n 'status' => 'ng',\n 'msg' => '',\n 'data' => array()\n );\n\n if ($this->crud($param)) {\n $param['date'] = substr($param['date'], 0, 12);\n $res = $this->displayCalendar($param);\n }\n\n return $res;\n }", "function register_dynamic_block() {\n if (!function_exists('register_block_type')) {\n return;\n }\n\n // Hook server side rendering into render callback\n // Make sure name matches registerBlockType in ./index.js\n register_block_type('davidyeiser-detailer/book-details', array(\n 'render_callback' => __NAMESPACE__ . '\\render_dynamic_block'\n ));\n}", "function portal_dashboard_calendar_widget() {\n\n\techo portal_output_project_calendar();\n\n}", "function RegisterBlock($block, $block_impl, $cacheable=true, $cache_attrs=null)\n {\n $this->_smarty->register_block($block, $block_impl, $cacheable, $cache_attrs);\n }", "public function index()\n {\n $this->view('calendar');\n }", "function EventReg_listblock_init()\n{\n // Security\n pnSecAddSchema('EventReg:Listblock:', 'Block title:Block Id:Type Id');\n}", "function register_events() {\n\n\t\t// Labels for the backend Event publisher\n\t\t$event_labels = array(\n\t\t\t'name'\t\t\t\t\t=> 'Events',\n\t\t\t'singular_name'\t\t\t=> 'Event',\n\t\t\t'add_new'\t\t\t\t=> 'New Event',\n\t\t\t'add_new_item'\t\t\t=> 'Schedule Event',\n\t\t\t'edit_item'\t\t\t\t=> 'Edit Event',\n\t\t\t'new_item'\t\t\t\t=> 'New Event',\n\t\t\t'view_item'\t\t\t\t=> 'View Event',\n\t\t\t'search_items'\t\t\t=> 'Search Events',\n\t\t\t'not_found'\t\t\t\t=> 'No events found',\n\t\t\t'not_found_in_trash'\t=> 'No events found in Trash', \n\t\t\t'parent_item_colon'\t\t=> '',\n\t\t\t'menu_name'\t\t\t\t=> 'Events',\n\t\t);\n\t\t\n\t\t$event_capabilities = array(\n\t\t\t'edit_post'\t\t\t\t=> 'edit_post',\n\t\t\t'edit_posts'\t\t\t=> 'edit_posts',\n\t\t\t'edit_others_posts'\t\t=> 'edit_others_posts',\n\t\t\t'publish_posts'\t\t\t=> 'publish_posts',\n\t\t\t'read_post'\t\t\t\t=> 'read_post',\n\t\t\t'read_private_posts'\t=> 'read_private_posts',\n\t\t\t'delete_post'\t\t\t=> 'delete_post'\n\t\t);\t\t\t\n\t\t\t\n\t\t// Construct the arguments for our custom slide post type\n\t\t$event_args = array(\n\t\t\t'labels'\t\t\t\t=> $event_labels,\n\t\t\t'description'\t\t\t=> 'Scheduled calendar events',\n\t\t\t'public'\t\t\t\t=> true,\n\t\t\t'publicly_queryable'\t=> true,\n\t\t\t'exclude_from_search'\t=> true,\n\t\t\t'show_ui'\t\t\t\t=> true,\n\t\t\t'show_in_menu'\t\t\t=> true,\n\t\t\t'show_in_nav_menus'\t\t=> false,\n\t\t\t'menu_icon'\t\t\t\t=> THEME_URI . '/images/icons/calendar-icon-20.png',\n\t\t\t'capabilities'\t\t\t=> $event_capabilities,\n\t\t\t'map_meta_cap'\t\t\t=> true,\n\t\t\t'hierarchical'\t\t\t=> false,\n\t\t\t'supports'\t\t\t\t=> array( 'title', 'editor', 'thumbnail' ),\n\t\t\t'taxonomies'\t\t\t=> array( 'calendar' , 'occurence' ),\n\t\t\t'has_archive'\t\t\t=> false,\n\t\t\t'rewrite'\t\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t'slug' \t=> 'event',\n\t\t\t\t\t\t\t\t\t\t'feeds'\t=> false,\n\t\t\t\t\t\t\t\t\t\t'pages'\t=> false,\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t'query_var'\t\t\t\t=> true,\n\t\t\t'can_export'\t\t\t=> true,\n\t\t);\n\n\t\t\n\t\t// Register the Event post type!\n\t\tregister_post_type( 'event', $event_args );\n\t}", "protected function register_blocks() {\n\n\t\t\\register_block_type(\n\t\t\t'tcc/column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t\t\\register_block_type(\n\t\t\t'tcc/layout-1-column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t\t\\register_block_type(\n\t\t\t'tcc/layout-2-column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t\t\\register_block_type(\n\t\t\t'tcc/layout-3-column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t\t\\register_block_type(\n\t\t\t'tcc/layout-4-column',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'tcc-layout-engine',\n\t\t\t\t'editor_style' => 'tcc-layout-engine',\n\t\t\t)\n\t\t);\n\n\t}", "function tnp_register_block($dir) {\n return TNP_Composer::register_block($dir);\n}", "function block_eventsengine_register($plugin) {\n global $DB;\n $DB->delete_records('block_eventsengine_actions', ['plugin' => $plugin]);\n $DB->delete_records('block_eventsengine_events', ['plugin' => $plugin]);\n $eventsengines = [];\n $eventsactions = [];\n if (block_eventsengine_load_for_plugin($plugin, $eventsengines, $eventsactions)) {\n foreach ($eventsactions as $action => $actiondata) {\n $DB->insert_record('block_eventsengine_actions', (object)['plugin' => $plugin, 'action' => $action,\n 'context' => $actiondata['context']]);\n }\n foreach ($eventsengines as $event => $engines) {\n foreach ($engines as $enginekey => $engine) {\n $DB->insert_record('block_eventsengine_events', (object)['plugin' => $plugin, 'event' => $event,\n 'engine' => $enginekey, 'context' => $engine['context']]);\n // Note: Developer MUST manually ensure all required events are observed to call ...\n // Function blocks/eventsengine/lib.php::block_eventsengine_handler in plugin's db/events.php .\n }\n }\n }\n}", "public function createACFBlock()\n {\n if (function_exists('acf_register_block_type')) {\n acf_register_block_type(\n array(\n 'name' => 'acfBlock',\n 'title' => __('ACF Block'),\n 'description' => __('A custom block that incorporates ACF fields.'),\n 'render_callback' => array($this, 'renderACFBlock'),\n 'category' => 'widgets',\n 'icon' => array('background' => '#ecf6f6', 'src' => 'email'),\n 'keywords' => array('example', 'acf'),\n 'mode' => 'edit'\n )\n );\n }\n }", "public function addCalendarNode(CalendarInterface $node)\n {\n $bag = $this->getOrCreateCalendarBag();\n\n return $bag->addCalendarNode($node);\n }", "public static function _register()\n {\n self::assignElements([\n 'Type' => ['type' => 'MarkUpMarkDownEventTypeCodeType', 'enum' => true, 'xmlns' => self::XMLNS],\n 'Time' => [],\n 'Reason' => []\n ], parent::NAME);\n\n self::assignAttributes([]);\n }", "function register_block_core_page_list()\n {\n }", "function register_block_core_site_tagline()\n {\n }", "function register_block() {\n\n\t// Define our assets.\n\t$editor_script = 'build/index.js';\n\t$editor_style = 'build/index.css';\n\t$frontend_style = 'build/style-index.css';\n\t$frontend_script = 'build/frontend.js';\n\n\t// Verify we have an editor script.\n\tif ( ! file_exists( plugin_dir_path( __FILE__ ) . $editor_script ) ) {\n\t\twp_die( esc_html__( 'Whoops! You need to run `npm run build` for the WDS Block Starter first.', 'wdsbs' ) );\n\t}\n\n\t// Autoload dependencies and version.\n\t$asset_file = require plugin_dir_path( __FILE__ ) . 'build/index.asset.php';\n\n\t// Register editor script.\n\twp_register_script(\n\t\t'wdsbs-editor-script',\n\t\tplugins_url( $editor_script, __FILE__ ),\n\t\t$asset_file['dependencies'],\n\t\t$asset_file['version'],\n\t\ttrue\n\t);\n\n\t// Register editor style.\n\tif ( file_exists( plugin_dir_path( __FILE__ ) . $editor_style ) ) {\n\t\twp_register_style(\n\t\t\t'wdsbs-editor-style',\n\t\t\tplugins_url( $editor_style, __FILE__ ),\n\t\t\t[ 'wp-edit-blocks' ],\n\t\t\tfilemtime( plugin_dir_path( __FILE__ ) . $editor_style )\n\t\t);\n\t}\n\n\t// Register frontend style.\n\tif ( file_exists( plugin_dir_path( __FILE__ ) . $frontend_style ) ) {\n\t\twp_register_style(\n\t\t\t'wdsbs-style',\n\t\t\tplugins_url( $frontend_style, __FILE__ ),\n\t\t\t[],\n\t\t\tfilemtime( plugin_dir_path( __FILE__ ) . $frontend_style )\n\t\t);\n\t}\n\n\t// Register block with WordPress.\n\tregister_block_type( 'wdsbs/rich-text-demo', array(\n\t\t'editor_script' => 'wdsbs-editor-script',\n\t\t'editor_style' => 'wdsbs-editor-style',\n\t\t'style' => 'wdsbs-style',\n\t) );\n\n\t// Register frontend script.\n\tif ( file_exists( plugin_dir_path( __FILE__ ) . $frontend_script ) ) {\n\t\twp_enqueue_script(\n\t\t\t'wdsbs-frontend-script',\n\t\t\tplugins_url( $frontend_script, __FILE__ ),\n\t\t\t$asset_file['dependencies'],\n\t\t\t$asset_file['version'],\n\t\t\ttrue\n\t\t);\n\t}\n}", "function msdlab_add_homepage_callout_sidebars(){\n genesis_register_sidebar(array(\n 'name' => 'Homepage Callout',\n 'description' => 'Homepage call to action',\n 'id' => 'homepage-callout'\n ));\n}", "function register_block_core_gallery() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/gallery',\n\t\tarray(\n\t\t\t'render_callback' => function ( $attributes, $content ) {\n\t\t\t\treturn $content;\n\t\t\t},\n\t\t)\n\t);\n}", "function wp_enqueue_registered_block_scripts_and_styles()\n {\n }", "function hookRegisterStyles() {\n\t \tif (!is_admin() && get_option('fse_load_fc_libs') == true) {\n\t \t\t// Check if user has its own CSS file in the theme folder\n\t \t\t$custcss = get_template_directory().'/fullcalendar.css';\n\t \t\tif (file_exists($custcss))\n\t \t\t$css = get_bloginfo('template_url').'/fullcalendar.css';\n\t \t\telse\n\t \t\t$css = self::$plugin_css_url.'fullcalendar.css';\n\t \t\twp_enqueue_style('fullcalendar', $css);\n\t \t}\n\t }", "function addCalendar($calendar) {\n return $this->databaseInsertRecord(\n $this->tableCalendars,\n 'calendar_id',\n $calendar\n );\n }", "function register_block_core_post_content()\n {\n }", "function phpbits_register_breadcrumbs_block() {\n\t// Return early if this function does not exist.\n\tif ( ! function_exists( 'register_block_type' ) ) {\n\t\treturn;\n\t}\n\n\t// Load attributes from block.json.\n\tob_start();\n\tinclude BREADCRUMBSBLOCK_PLUGIN_DIR . 'src/blocks/breadcrumbs/block.json';\n\t$metadata = json_decode( ob_get_clean(), true );\n\tregister_block_type(\n\t\t$metadata['name'],\n\t\tarray(\n\t\t\t'editor_script' => 'breadcrumbs-block-editor',\n\t\t\t'editor_style' => 'breadcrumbs-block-editor-css',\n\t\t\t'style' => 'breadcrumbs-block-frontend',\n\t\t\t'attributes' => $metadata['attributes'],\n\t\t\t'render_callback' => 'phpbits_render_breadcrumbs_block',\n\t\t)\n\t);\n}", "private function init_calendarArea()\n {\n\n // Init area\n $this->pObj->objCal->area_init();\n\n // Reinit class vars $conf and $conf_view\n $this->conf = $this->pObj->conf;\n $this->conf_view = $this->conf[ 'views.' ][ $this->view . '.' ][ $this->mode . '.' ];\n // Reinit class vars $conf and $conf_view\n\n return;\n }", "public function register()\r\n {\r\n $this->registerBlock('l', array('Nine_View_Register_Translation', 'translate'));\r\n }", "function rs_load_widget()\n{\n\tregister_widget('rs_Widget_Agenda');\n}", "public function registerClientScript()\n {\n Yii::app()->clientScript->registerPackage('bootstrap-box');\n Yii::app()->bootstrap->registerAssetCss('bootstrap-box.css');\n }", "function enqueue_fullcalendar() {\n wp_enqueue_style ( 'fullcalendar-main-style', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/core/main.css' );\n wp_enqueue_style ( 'fullcalendar-daygrid-style', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/daygrid/main.css' );\n wp_enqueue_style ( 'fullcalendar-timegrid-style', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/timegrid/main.css' );\n wp_enqueue_style ( 'fullcalendar-list-style', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/list/main.css' );\n\n wp_enqueue_script ( 'fullcalendar-main-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/core/main.js' );\n wp_enqueue_script ( 'fullcalendar-interaction-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/interaction/main.js' );\n wp_enqueue_script ( 'fullcalendar-daygrid-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/daygrid/main.js' );\n wp_enqueue_script ( 'fullcalendar-timegrid-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/timegrid/main.js' );\n wp_enqueue_script ( 'fullcalendar-list-script', get_stylesheet_directory_uri() . '/lib/fullcalendar-4.3.1/packages/list/main.js' );\n}", "function register(){\n echo Template::instance()->render('gatorLock/register.php');\n}", "function register_block_core_heading()\n {\n }", "public function __construct()\n {\n\n $calendarConfigurations = [\n [\n 'calendar_id' => 1,\n 'user_pid' => 118,\n ],\n ];\n\n // Base Configuration\n // load this in your composer configuration: sabre/dav ~3.1.0\n\n // .htaccess configuration\n // RewriteRule ^CalDav/ /index.php?eID=CalDav [L]\n\n // require_once(ExtensionManagementUtility::extPath('calendarize', 'Resources/External/vendor/autoload.php'));\n\n // check Cal Dav infrastructure\n $this->checkEnvironment();\n }", "function register_block_core_site_logo()\n {\n }", "public static function register()\n\t{\n\t\tRichText_AdminModule::register();\n//\t\tRichText_FrontModule::register();\n\t}", "function setup_starter_register_custom_blocks() {\n\n $blocks = array(\n 'feature' => array(\n 'name' => 'feature_pull_block',\n 'title' => __('Feature Pull Block'),\n 'render_template' => plugin_dir_path( __FILE__ ).'../blocks/block-feature-pull-setup-starter.php',\n 'category' => 'setup_starter',\n 'icon' => 'list-view',\n 'mode' => 'edit',\n 'keywords' => array( 'feature', 'highlight', 'pull' ),\n ),\n \n ); //echo $blocks[ 'feature']['render_template'];\n /*\n 'logs' => array(\n 'name' => 'log',\n 'title' => __('Log'),\n 'render_template' => 'partials/blocks/block-log-setup-starter.php',\n 'category' => 'setup_starter',\n 'icon' => 'list-view',\n 'mode' => 'edit',\n 'keywords' => array( 'update', 'log' ),\n ),\n */\n\n // Bail out if function doesn’t exist or no blocks available to register.\n if ( !function_exists( 'acf_register_block_type' ) && !$blocks ) {\n return;\n }\n \n // this loop is broken, how do we register multiple blocks in one go?\n // Register all available blocks.\n foreach ($blocks as $block) {\n acf_register_block_type( $block );\n }\n \n}", "public function registerSchedule($schedule)\n {\n }", "function register_dynamic_block_action() {\n\n\twp_register_script(\n\t\t'my-first-dynamic-gutenberg-block-script',\n\t\tplugins_url( 'myblock.js', __FILE__ ),\n\t\tarray( 'wp-blocks', 'wp-element' ),\n\t\ttrue\n\t);\n\n\tregister_block_type(\n\t\t'my-first-dynamic-gutenberg-block/latest-post',\n\t\tarray(\n\t\t\t'editor_script' => 'my-first-dynamic-gutenberg-block-script',\n\t\t\t'render_callback' => 'my_plugin_render_block_latest_post',\n\t\t)\n\t);\n\n}", "public function actionEvents()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('events');\n\t}", "public function calendars()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Convert calendar_name to calendar_id\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('calendar_id') == '' AND\n\t\t\t$this->P->value('calendar_name') != '')\n\t\t{\n\t\t\t$ids = $this->data->get_calendar_id_from_name(\n\t\t\t\t$this->P->value('calendar_name'),\n\t\t\t\tNULL,\n\t\t\t\t$this->P->params['calendar_name']['details']['not']\n\t\t\t);\n\n\t\t\tif ( empty( $ids ) )\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar: No results for\n\t\t\t\t//calendar name provided, bailing');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Determine which calendars this user has permission to view\n\t\t// and modify the parameters accordingly.\n\t\t// -------------------------------------\n\n\t\t// TODO\n\n\t\t// -------------------------------------\n\t\t// Fetch the basics\n\t\t// -------------------------------------\n\n\t\t$data = $this->data->fetch_calendars_basics(\n\t\t\t$this->P->value('site_id'),\n\t\t\t$this->P->value('calendar_id'),\n\t\t\t$this->P->params['calendar_id']['details']['not']\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// If no data, then give 'em no_results\n\t\t// -------------------------------------\n\n\t\tif (($total_results = count($data)) == 0)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Ensure date_range_start <= date_range_end\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE AND\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\tif ($this->P->value('date_range_start', 'ymd') > $this->P->value('date_range_end', 'ymd'))\n\t\t\t{\n\t\t\t\t$temp = $this->P->params['date_range_start']['value'];\n\t\t\t\t$this->P->set('date_range_start', $this->P->params['date_range_end']['value']);\n\t\t\t\t$this->P->set('date_range_end', $temp);\n\t\t\t\tunset($temp);\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// This will come in handy later\n\t\t// -------------------------------------\n\n\t\t$calendar_array = array();\n\t\tforeach ($data as $k => $arr)\n\t\t{\n\t\t\t$calendar_array[] = $arr['calendar_id'];\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Date range params? Then we need to do a lot more work.\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE OR\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: Calculating date ranges');\n\t\t\t$min = ($this->P->value('date_range_start') !== FALSE) ?\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') :\n\t\t\t\t\t\t0;\n\n\t\t\t$max = ($this->P->value('date_range_end') !== FALSE) ?\n\t\t\t\t$this->P->value('date_range_end', 'ymd') :\n\t\t\t\t0;\n\n\t\t\t$calendar_array = $this->data->fetch_calendars_with_events_in_date_range(\n\t\t\t\t$min,\n\t\t\t\t$max,\n\t\t\t\t$calendar_array,\n\t\t\t\t$this->P->value('status')\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// No calendars? No results.\n\t\t// -------------------------------------\n\n\t\tif (empty($calendar_array))\n\t\t{\n//ee()->TMPL->log_item('Calendar: No calendars, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tInvoke Channel class\n\t\t//\t----------------------------------------\n\n\t\tif ( ! class_exists('Channel') )\n\t\t{\n\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t}\n\n\t\t$channel = new Channel();\n\n\t\t//need to remove limit here so huge amounts of events work\n\t\t$channel->limit = 1000000;\n\n\t\t// --------------------------------------------\n\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t// -------------------------------------\n\t\t// Prepare parameters\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->tagparams['entry_id'] = implode('|', $calendar_array);\n\t\tee()->TMPL->tagparams['channel'] = CALENDAR_CALENDARS_CHANNEL_NAME;\n\n\t\t// -------------------------------------\n\t\t// Pre-process related data\n\t\t// -------------------------------------\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\n\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t\tee()->TMPL->var_single = array_merge(\n\t\t\t\tee()->TMPL->var_single,\n\t\t\t\tee()->TMPL->related_markers\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Execute needed methods\n\t\t// -------------------------------------\n\n\t\t$channel->fetch_custom_channel_fields();\n\n\t\t$channel->fetch_custom_member_fields();\n\n\t\t// --------------------------------------------\n\t\t// Pagination Tags Parsed Out\n\t\t// --------------------------------------------\n\n\t\t$this->fetch_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Querification\n\t\t// -------------------------------------\n\n\t\t$channel->build_sql_query();\n\n\t\tif ($channel->sql == '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\tif ($channel->query->num_rows() == 0)\n\t\t{\n//ee()->TMPL->log_item('Calendar: Channel module says no results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_calendars_channel_query' hook.\n\t\t// - Do something with the channel query\n\n\t\tif (ee()->extensions->active_hook('calendar_calendars_channel_query') === TRUE)\n\t\t{\n\t\t\t$channel->query = ee()->extensions->call('calendar_calendars_channel_query', $channel->query, $calendar_array);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\t\t// -------------------------------------\n\t\t// Inject Calendar-specific variables\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Adding Calendar variables');\n\n\t\t$aliases = array(\n\t\t\t'title'\t\t\t=> 'calendar_title',\n\t\t\t'url_title'\t\t=> 'calendar_url_title',\n\t\t\t'entry_id'\t\t=> 'calendar_id',\n\t\t\t'author_id'\t\t=> 'calendar_author_id',\n\t\t\t'author'\t\t=> 'calendar_author',\n\t\t\t'status'\t\t=> 'calendar_status'\n\t\t);\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$aliases['url_title'] = 'calendar_borked_title';\n\n\t\t\tee()->TMPL->var_single['calendar_borked_title'] = 'calendar_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['calendar_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ?\n\t\t\t\t\t\t\t\t\t\t$row['screen_name'] : $row['username'];\n\n\t\t\tforeach ($aliases as $old => $new)\n\t\t\t{\n\t\t\t\t$channel->query->result[$k][$new] = $channel->query->result[$k][$old];\n\t\t\t}\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tRedeclare\n\t\t//\t----------------------------------------\n\t\t//\tWe will reassign the $channel->query->result with our\n\t\t//\treordered array of values.\n\t\t//\t----------------------------------------\n\n\t\t$channel->query->result_array = $channel->query->result;\n\n\t\t// --------------------------------------------\n\t\t// Typography\n\t\t// --------------------------------------------\n\n\t\tee()->load->library('typography');\n\t\tee()->typography->initialize();\n\t\tee()->typography->convert_curly = FALSE;\n\n\t\t$channel->fetch_categories();\n\n\t\t// -------------------------------------\n\t\t// Parse\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing, via channel module');\n\n\n\n\t\t$channel->parse_channel_entries();\n\n\t\t// -------------------------------------\n\t\t// Paginate\n\t\t// -------------------------------------\n\n\t\t$channel = $this->add_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Related entries\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries, via Weblog module');\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_related_entries();\n\t\t\t}\n\n\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\t$tagdata = $channel->return_data;\n\n\t\t//ee()->TMPL->log_item('Calendar: Done!');\n\n\t\t//on the off chance someone just wrote the word\n\t\t//'calendar_url_title', we should fix that before\n\t\t//output. (See above calendar_url_title fix)\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\treturn $tagdata;\n\n\t}", "public function setSections() {\n\t\t\t$schedules\t=\tarray();\n \t$wp_get_schedules\t=\tfunction_exists( 'wp_get_schedules' ) ? wp_get_schedules() : null;\n \tif( is_array( $wp_get_schedules ) && !empty( $wp_get_schedules ) ){\n \t\tforeach ($wp_get_schedules as $key=>$value) {\n \t\t\t$schedules[ $key ]\t=\t$value['display'];\n \t\t}\n \t}\n\n\t\t\t$this->sections[] \t=\tarray(\n\t\t\t\t'title'\t=>\t__('General','neat'),\n\t\t\t\t'icon'\t=>\t'el-icon-cogs',\n\t\t\t\t'desc'\t=>\tnull,\n\t\t\t\t'fields'\t=>\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'homepage',\n\t\t\t\t\t\t'type' => 'callback',\n\t\t\t\t\t\t'title' => __('Homepage', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Setup the Homepage.', 'neat'),\n\t\t\t\t\t\t'callback' => 'neat_homepage_callback'\n\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'logo',\n\t\t\t\t\t\t'type' => 'callback',\n\t\t\t\t\t\t'title' => __('Logo', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Upload your logo.', 'neat'),\n\t\t\t\t\t\t'callback' => 'neat_logo_callback'\n\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'\t=>\t'favicon',\n\t\t\t\t\t\t'type'\t=>\t'media',\n\t\t\t\t\t\t'url' => true,\n 'subtitle' => __('Upload any media using the WordPress native uploader', 'neat'),\t\t\t\t\n\t\t\t\t\t\t'title'\t=>\t__('Favicon','neat')\n\t\t\t\t\t),\n array(\n 'id' => 'custom_css',\n 'type' => 'ace_editor',\n 'title' => __('Custom CSS', 'neat'),\n 'subtitle' => __('Paste your CSS code here, no style tag.', 'neat'),\n 'mode' => 'css',\n 'theme' => 'monokai'\n ),\t\n array(\n 'id' => 'custom_js',\n 'type' => 'ace_editor',\n 'title' => __('Custom JS', 'neat'),\n 'subtitle' => __('Paste your JS code here, no script tag, eg: alert(\\'hello world\\');', 'neat'),\n 'mode' => 'javascript',\n 'theme' => 'chrome'\n )\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t$this->sections[] \t=\tarray(\n\t\t\t\t'title'\t=>\t__('Blog','neat'),\n\t\t\t\t'icon'\t=>\t'el-icon-cogs',\n\t\t\t\t'desc'\t=>\tnull,\n\t\t\t\t'fields'\t=>\tarray(\n\t\t\t\t\t\t/**\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'blogpage',\n\t\t\t\t\t\t\t'type' => 'callback',\n\t\t\t\t\t\t\t'title' => __('Blog page', 'neat'),\n\t\t\t\t\t\t\t'subtitle' => __('Setup the blog page.', 'neat'),\n\t\t\t\t\t\t\t'callback' => 'neat_blogpage_callback'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t**/\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'bloglayout',\n\t\t\t\t\t\t\t'type' => 'image_select',\n\t\t\t\t\t\t\t'compiler' => true,\n\t\t\t\t\t\t\t'title' => __('Blog Layout', 'neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('Choose the Blog page layout.','neat'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'r_sidebar' => array('alt' => __('Right Sidebar','neat'), 'img' => ReduxFramework::$_url . 'assets/img/2cr.png'),\n\t\t\t\t\t\t\t\t\t'l_sidebar' => array('alt' => __('Left Sidebar','neat'), 'img' => ReduxFramework::$_url . 'assets/img/2cl.png'),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => 'r_sidebar'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'exclude_page_search',\n\t\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t\t'title' => __('Excluding Page Search', 'neat'),\n\t\t\t\t\t\t\t'subtitle' => __('Do not display the Page in search result page.', 'neat'),\n\t\t\t\t\t\t\t'default' => '1'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'include_video_homepage',\n\t\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t\t'title' => __('Including Video Format in Homepage', 'neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('I only want to retrieve the Videos Post Format in Homepage.','neat'),\n\t\t\t\t\t\t\t'default' => '0'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'exclude_video_blogpage',\n\t\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t\t'title' => __('Excluding Video Format in Blog Page', 'neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('Do not retrieve the the Videos Post Format in Blog page.','neat'),\n\t\t\t\t\t\t\t'default' => '0'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'appid',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('AppID', 'neat'),\n\t\t\t\t\t\t\t'subtitle' => 'Facebook AppID',\n\t\t\t\t\t\t\t'description'\t=> sprintf( __('Get a key %s.', 'neat'), '<a target=\"_blank\" href=\"https://developers.facebook.com\">HERE</a>')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'comment',\n\t\t\t\t\t\t\t'type' => 'button_set',\n\t\t\t\t\t\t\t'title'\t=>\t__('Comment','neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('Choose the Comment System.','neat'),\n\t\t\t\t\t\t\t'description'\t=>\t__('If you use the Comment plugin (Disqus, facebook ... etc), You have to choose \"Default\".','neat'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'default'\t\t=>\t\t__('Default','neat'),\n\t\t\t\t\t\t\t\t'facebook'\t\t=>\t\t__('Facebook','neat'),\n\t\t\t\t\t\t\t\t'both'\t\t\t=>\t\t__('Both','neat')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => 'default'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'info-warning-both',\n\t\t\t\t\t\t\t'type' => 'info',\n\t\t\t\t\t\t\t'style' => 'warning',\n\t\t\t\t\t\t\t//'title' => __('Warning.', 'neat'),\n\t\t\t\t\t\t\t'desc' => __('The total comment number = default + facebook numner.','neat'),\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"=\", 'both'),\n\t\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'info-warning',\n\t\t\t\t\t\t\t'type' => 'info',\n\t\t\t\t\t\t\t'style' => 'warning',\n\t\t\t\t\t\t\t//'title' => __('Warning.', 'neat'),\n\t\t\t\t\t\t\t'desc' => sprintf( __('If you use the Facebook Comment system, You have to setup the %s in one time, If you change the Permalink, All the exists comments will be lost.','neat') , '<a href=\"'.admin_url( 'options-permalink.php' ).'\">Permalink</a>' ),\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\t\t\t\n\t\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'data-colorscheme',\n\t\t\t\t\t\t\t'type' => 'button_set',\n\t\t\t\t\t\t\t'title' => __('Comment Style', 'neat'),\n\t\t\t\t\t\t\t'description'\t=>\t__('The color scheme used by the plugin. Can be \"light\" or \"dark\".','neat'),\n\t\t\t\t\t\t\t'options'\t=>\tarray(\n\t\t\t\t\t\t\t\t'light'\t=>\t__('Light','neat'),\n\t\t\t\t\t\t\t\t'dark'\t=>\t__('Dark','neat')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => 'light',\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\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\tarray(\n\t\t\t\t\t\t\t'id' => 'data-numposts',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Number of Posts', 'neat'),\n\t\t\t\t\t\t\t'description'\t=>\t__('The number of comments to show by default. The minimum value is 1.','neat'),\n\t\t\t\t\t\t\t'default'\t=>\t10,\n\t\t\t\t\t\t\t'validate' => 'comma_numeric',\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'data-orderby',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Order by', 'neat'),\n\t\t\t\t\t\t\t'description'\t=>\tsprintf( __('The order to use when displaying comments. Can be \"social\", \"reverse_time\", or \"time\". The different order types are explained %s','neat') , '<a target=\"_blank\" href=\"https://developers.facebook.com/docs/plugins/comments#faqorder\">in the FAQ</a>' ),\n\t\t\t\t\t\t\t'options'\t=>\tarray(\n\t\t\t\t\t\t\t\t'social'\t\t=>\t__('Social','neat'),\n\t\t\t\t\t\t\t\t'reverse_time'\t=>\t__('Reverse Time','neat'),\n\t\t\t\t\t\t\t\t'time'\t\t\t=>\t__('Time','neat')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default'\t=>\t'social',\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\n\t\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'facebooklang',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Language', 'neat'),\n\t\t\t\t\t\t\t'options'\t=>\tarray(\n\t\t\t\t\t\t\t\t'af_ZA'\t\t\t=>\t\t'Afrikaans',\n\t\t\t\t\t\t\t\t'ar_AR'\t\t\t=>\t\t'Arabic',\n\t\t\t\t\t\t\t\t'az_AZ'\t\t\t=>\t\t'Azerbaijani',\n\t\t\t\t\t\t\t\t'be_BY'\t\t\t=>\t\t'Belarusian',\n\t\t\t\t\t\t\t\t'bg_BG'\t\t\t=>\t\t'Bulgarian',\n\t\t\t\t\t\t\t\t'bn_IN'\t\t\t=>\t\t'Bengali',\n\t\t\t\t\t\t\t\t'bs_BA'\t\t\t=>\t\t'Bosnian',\n\t\t\t\t\t\t\t\t'ca_ES'\t\t\t=>\t\t'Catalan',\n\t\t\t\t\t\t\t\t'cs_CZ'\t\t\t=>\t\t'Czech',\n\t\t\t\t\t\t\t\t'cy_GB'\t\t\t=>\t\t'Welsh',\n\t\t\t\t\t\t\t\t'da_DK'\t\t\t=>\t\t'Danish',\n\t\t\t\t\t\t\t\t'de_DE'\t\t\t=>\t\t'German',\n\t\t\t\t\t\t\t\t'el_GR'\t\t\t=>\t\t'Greek',\n\t\t\t\t\t\t\t\t'en_GB'\t\t\t=>\t\t'English (UK)',\t\n\t\t\t\t\t\t\t\t'en_PI'\t\t\t=>\t\t'English (Pirate)',\n\t\t\t\t\t\t\t\t'en_UD'\t\t\t=>\t\t'English (Upside Down)',\n\t\t\t\t\t\t\t\t'en_US'\t\t\t=>\t\t'English (US)',\n\t\t\t\t\t\t\t\t'eo_EO'\t\t\t=>\t\t'Esperanto',\n\t\t\t\t\t\t\t\t'es_ES'\t\t\t=>\t\t'Spanish (Spain)',\n\t\t\t\t\t\t\t\t'es_LA'\t\t\t=>\t\t'Spanish',\n\t\t\t\t\t\t\t\t'et_EE'\t\t\t=>\t\t'Estonian',\n\t\t\t\t\t\t\t\t'eu_ES'\t\t\t=>\t\t'Basque',\n\t\t\t\t\t\t\t\t'fa_IR'\t\t\t=>\t\t'Persian',\n\t\t\t\t\t\t\t\t'fb_LT'\t\t\t=>\t\t'Leet Speak',\n\t\t\t\t\t\t\t\t'fi_FI'\t\t\t=>\t\t'Finnish',\n\t\t\t\t\t\t\t\t'fo_FO'\t\t\t=>\t\t'Faroese',\n\t\t\t\t\t\t\t\t'fr_CA'\t\t\t=>\t\t'French (Canada)',\n\t\t\t\t\t\t\t\t'fr_FR'\t\t\t=>\t\t'French (France)',\n\t\t\t\t\t\t\t\t'fy_NL'\t\t\t=>\t\t'Frisian',\n\t\t\t\t\t\t\t\t'ga_IE'\t\t\t=>\t\t'Irish',\n\t\t\t\t\t\t\t\t'gl_ES'\t\t\t=>\t\t'Galician',\n\t\t\t\t\t\t\t\t'he_IL'\t\t\t=>\t\t'Hebrew',\n\t\t\t\t\t\t\t\t'hi_IN'\t\t\t=>\t\t'Hindi',\n\t\t\t\t\t\t\t\t'hr_HR'\t\t\t=>\t\t'Croatian',\n\t\t\t\t\t\t\t\t'hu_HU'\t\t\t=>\t\t'Hungarian',\n\t\t\t\t\t\t\t\t'hy_AM'\t\t\t=>\t\t'Armenian',\n\t\t\t\t\t\t\t\t'id_ID'\t\t\t=>\t\t'Indonesian',\n\t\t\t\t\t\t\t\t'is_IS'\t\t\t=>\t\t'Icelandic',\n\t\t\t\t\t\t\t\t'it_IT'\t\t\t=>\t\t'Italian',\n\t\t\t\t\t\t\t\t'ja_JP'\t\t\t=>\t\t'Japanese',\n\t\t\t\t\t\t\t\t'ka_GE'\t\t\t=>\t\t'Georgian',\n\t\t\t\t\t\t\t\t'km_KH'\t\t\t=>\t\t'Khmer',\n\t\t\t\t\t\t\t\t'ko_KR'\t\t\t=>\t\t'Korean',\n\t\t\t\t\t\t\t\t'ku_TR'\t\t\t=>\t\t'Kurdish',\n\t\t\t\t\t\t\t\t'la_VA'\t\t\t=>\t\t'Latin',\n\t\t\t\t\t\t\t\t'lt_LT'\t\t\t=>\t\t'Lithuanian',\n\t\t\t\t\t\t\t\t'lv_LV'\t\t\t=>\t\t'Latvian',\n\t\t\t\t\t\t\t\t'mk_MK'\t\t\t=>\t\t'Macedonian',\n\t\t\t\t\t\t\t\t'ml_IN'\t\t\t=>\t\t'Malayalam',\n\t\t\t\t\t\t\t\t'ms_MY'\t\t\t=>\t\t'Malay',\n\t\t\t\t\t\t\t\t'nb_NO'\t\t\t=>\t\t'Norwegian (bokmal)',\n\t\t\t\t\t\t\t\t'ne_NP'\t\t\t=>\t\t'Nepali',\n\t\t\t\t\t\t\t\t'nl_NL'\t\t\t=>\t\t'Dutch',\n\t\t\t\t\t\t\t\t'nn_NO'\t\t\t=>\t\t'Norwegian (nynorsk)',\n\t\t\t\t\t\t\t\t'pa_IN'\t\t\t=>\t\t'Punjabi',\n\t\t\t\t\t\t\t\t'pl_PL'\t\t\t=>\t\t'Polish',\n\t\t\t\t\t\t\t\t'ps_AF'\t\t\t=>\t\t'Pashto',\n\t\t\t\t\t\t\t\t'pt_BR'\t\t\t=>\t\t'Portuguese (Brazil)',\n\t\t\t\t\t\t\t\t'pt_PT'\t\t\t=>\t\t'Portuguese (Portugal)',\n\t\t\t\t\t\t\t\t'ro_RO'\t\t\t=>\t\t'Romanian',\n\t\t\t\t\t\t\t\t'ru_RU'\t\t\t=>\t\t'Russian',\n\t\t\t\t\t\t\t\t'sk_SK'\t\t\t=>\t\t'Slovak',\n\t\t\t\t\t\t\t\t'sl_SI'\t\t\t=>\t\t'Slovenian',\n\t\t\t\t\t\t\t\t'sq_AL'\t\t\t=>\t\t'Albanian',\n\t\t\t\t\t\t\t\t'sr_RS'\t\t\t=>\t\t'Serbian',\n\t\t\t\t\t\t\t\t'sv_SE'\t\t\t=>\t\t'Swedish',\n\t\t\t\t\t\t\t\t'sw_KE'\t\t\t=>\t\t'Swahili',\n\t\t\t\t\t\t\t\t'ta_IN'\t\t\t=>\t\t'Tamil',\n\t\t\t\t\t\t\t\t'te_IN'\t\t\t=>\t\t'Telugu',\n\t\t\t\t\t\t\t\t'th_TH'\t\t\t=>\t\t'Thai',\n\t\t\t\t\t\t\t\t'tl_PH'\t\t\t=>\t\t'Filipino',\n\t\t\t\t\t\t\t\t'tr_TR'\t\t\t=>\t\t'Turkish',\n\t\t\t\t\t\t\t\t'uk_UA'\t\t\t=>\t\t'Ukrainian',\n\t\t\t\t\t\t\t\t'vi_VN'\t\t\t=>\t\t'Vietnamese',\n\t\t\t\t\t\t\t\t'zh_CN'\t\t\t=>\t\t'Simplified Chinese (China)',\n\t\t\t\t\t\t\t\t'zh_HK'\t\t\t=>\t\t'Traditional Chinese (Hong Kong)',\n\t\t\t\t\t\t\t\t'zh_TW'\t\t\t=>\t\t'Traditional Chinese (Taiwan)'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default'\t=>\t'en_US',\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'counter_up_interval',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Scheduling Intervals', 'neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('Scheduling the updating Counter intervals.','neat'),\n\t\t\t\t\t\t\t'description'\t=>\t__('Leave blank for real time.','neat'),\n\t\t\t\t\t\t\t'options'\t\t=>\t$schedules,\n\t\t\t\t\t\t\t'default'\t=>\t'15m'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\n\t\t\t$this->sections[]\t=\tarray(\n\t\t\t\t'title'\t=>\t__('Submit','neat'),\n\t\t\t\t'icon' => 'el-icon-upload',\n\t\t\t\t'desc' => __('<p class=\"description\">Neat support the post submission at Fronend through Contact Form 7 Form.</p>', 'neat'),\n\t\t\t\t'fields'\t=>\tarray(\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'cf7id',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Contact Form 7 ID', 'neat'),\n\t\t\t\t\t\t'description'\t=>\tsprintf( __('Enter the form ID for Post Submission, %s','neat'), '<a href=\"'.admin_url( 'admin.php?page=wpcf7' ).'\">Where is it?</a>' ),\n\t\t\t\t\t\t'validate' => 'comma_numeric'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'post_status',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'title' => __('Post Status', 'neat'),\n\t\t\t\t\t\t'description'\t=>\t__('Set the post status for the post, which is submitted through the Contact Form 7 at Frontend.','neat'),\n\t\t\t\t\t\t'options'\t=>\tarray(\n\t\t\t\t\t\t\t'pending'\t=>\t__('Pending','neat'),\n\t\t\t\t\t\t\t'publish'\t=>\t__('publish','neat')\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default'\t=>\t'pending'\n\t\t\t\t\t),\n\t\t\t\t\t/**\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'user_roles',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'title' => __('Who can submit the post?', 'neat'),\n\t\t\t\t\t\t'data' => 'roles',\n\t\t\t\t\t\t'description'\t=>\t__('Choose the User roles, all users of this roles can submit the post through Frontend, Leave blank for Guest (all posts is submitted by guest will be assigned to Admin).','neat'),\n\t\t\t\t\t\t'multi' => true,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'limit_posts_amount',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Posts amount/day', 'neat'),\n\t\t\t\t\t\t'description'\t=>\t__( 'Limit the posts per day for the User (This function won\\'t work if Guest post is activated), 0 is un-limit.','neat' ),\n\t\t\t\t\t\t'validate' => 'comma_numeric',\n\t\t\t\t\t\t'default'\t=>\t5\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'role_not_limit',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'title' => __('Roles is not limited', 'neat'),\n\t\t\t\t\t\t'data' => 'roles',\n\t\t\t\t\t\t'description'\t=>\t__('Don\\'t apply the limit post for this roles.','neat'),\n\t\t\t\t\t\t'multi' => true,\n\t\t\t\t\t),\n\t\t\t\t\t**/\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'response',\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'title' => __('Auto Response', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Send the message through email to the User after submitted.', 'neat'),\n\t\t\t\t\t\t'default' => 0\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'response_name',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Sender\\'s name', 'neat'),\n\t\t\t\t\t\t'default'\t=>\tget_bloginfo( 'name' ),\n\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t'required' => array('response', \"=\", 1),\n\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'response_email',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Sender\\'s email', 'neat'),\n\t\t\t\t\t\t'default'\t=>\tget_bloginfo( 'admin_email' ),\n\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t'required' => array('response', \"=\", 1),\n\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'response_subject',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Response Subject', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('The subject of the email', 'neat'),\n\t\t\t\t\t\t'description'\t=>\tsprintf( __('<strong>Tags support:</strong><br/><code>[user]</code>: Username/Display Name of User.<br/><code>[sitename]</code>: Your site name (%s)<br/><code>[site_desc]</code>: Your Site description (%s)','neat'), get_bloginfo('name'), get_bloginfo('description') ),\n\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t'required' => array('response', \"=\", 1),\t\t\t\t\t\t\t\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'response_content',\n\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t'title' => __('Response Content', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('The Content of the email', 'neat'),\n\t\t\t\t\t\t'description'\t=>\tsprintf( __('<strong>Tags support:</strong><br/><code>[user]</code>: Username/Display Name of User.<br/><code>[sitename]</code>: Your site name (%s)<br/><code>[site_desc]</code>: Your Site description (%s)<br/><code>[post_link]</code>: The post link (working for the Publish post).','neat'), get_bloginfo('name'), get_bloginfo('description') ),\n\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t'required' => array('response', \"=\", 1)\t\t\t\t\n\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t)\n\t\t\t);\t\t\t\n\t\t\t\n\t\t\t$this->sections[]\t=\tarray(\n\t\t\t\t'title'\t=>\t__('Styling','neat'),\n\t\t\t\t'icon' => 'el-icon-website',\n\t\t\t\t'fields'\t=>\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'main-style',\n\t\t\t\t\t\t'type' => 'image_select',\n\t\t\t\t\t\t'compiler' => true,\n\t\t\t\t\t\t'title' => __('Main Style', 'neat'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'main' => array('alt' => __('Default','neat') , 'img' => NEAT_THEME_URI . '/assets/img/default.png' ),\n\t\t\t\t\t\t\t'main-blue' => array('alt' => __('Blue style','neat') , 'img' => NEAT_THEME_URI . '/assets/img/blue.png' ),\n\t\t\t\t\t\t\t'main-red' => array('alt' => __('Red style','neat') , 'img' => NEAT_THEME_URI . '/assets/img/red.png' ),\n\t\t\t\t\t\t\t'main-dark' => array('alt' => __('Dark style','neat') , 'img' => NEAT_THEME_URI . '/assets/img/dark.png' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => 'main'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'background',\n\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t'output' => array('body'),\n\t\t\t\t\t\t'title' => __('Body Background', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Body background with image, color, etc.', 'neat'),\n\t\t\t\t\t\t'default' => '#FFFFFF',\n\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'header-background',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Header Background Color', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a background color for the Header (default: #ffffff).', 'neat'),\n\t\t\t\t\t\t'default' => '#ffffff',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'menu-color',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Menu Color', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a color for the Menu (default: #b3b3b3).', 'neat'),\n\t\t\t\t\t\t'default' => '#b3b3b3',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'menu-hover-color',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Menu Hover Color', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a color for the Menu Hover (default: #2ecc71).', 'neat'),\n\t\t\t\t\t\t'default' => '#2ecc71',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'footer-background',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Footer Background', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a background color for the Footer (default: #ffffff).', 'neat'),\n\t\t\t\t\t\t'default' => '#ffffff',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'footer-color',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Footer Color', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a color for the Footer Text (default: #bfbfbf).', 'neat'),\n\t\t\t\t\t\t'default' => '#bfbfbf',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t)\n\t\t\t);\t\t\t\n\t\t\t\n\t\t\t//footer\n\t\t\t$footer_field = array();\n\t\t\t$footer_field[] = array(\n\t\t\t\t'id'\t=>\t'footer_text',\n\t\t\t\t'title'\t=>\t__('Copyright Text','neat'),\n\t\t\t\t'type'\t=>\t'textarea',\n\t\t\t\t'default'\t=>\tsprintf( __('Copyright © 2014 <a href=\"%s\">Neat</a> - All Rights Reserved.','neat'), home_url() ),\n\t\t\t\t'desc'\t=>\t__('HTML is allowed in here.','neat')\n\t\t\t);\n\t\t\t$socials = neat_option_socials();\n\t\t\tif( is_array( $socials ) ){\n\t\t\t\tforeach ( $socials as $key=>$value) {\n\t\t\t\t\t$footer_field[] = array(\n\t\t\t\t\t\t'id'\t=>\t'footer_social_' . $key,\n\t\t\t\t\t\t'title'\t=>\t$value['name'],\n\t\t\t\t\t\t'type'\t=>\t'text',\n\t\t\t\t\t\t'placeholder'\t=>\t'http://',\n\t\t\t\t\t\t'desc'\t=>\tsprintf( __('Put the %s profile/page link here.','neat') , $value['name'] )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->sections[]\t=\tarray(\n\t\t\t\t'title'\t=>\t__('Footer','neat'),\n\t\t\t\t'icon'\t=>\t'el-icon-cogs',\n\t\t\t\t'fields'\t=>\t$footer_field\n\t\t\t);\n\t\t\t\t\t\t\t\n }", "function register_embed_block() {\n\t$fem_options = get_option( FEM_PREFIX . 'options' );\n\tregister_block_type(\n\t\t'fedora-embed/fedora-embed',\n\t\t[\n\t\t\t'render_callback' => __NAMESPACE__ . '\\render_fedora_embed_block',\n\t\t\t'attributes' => [\n\t\t\t\t'baseURL' => [\n\t\t\t\t\t'default' => $fem_options['base_url'],\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t],\n\t\t\t\t'searchValues' => [\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'type' => 'string', // JSON encoded string.\n\t\t\t\t],\n\t\t\t],\n\t\t]\n\t);\n}", "function register_block_core_post_template()\n {\n }", "public function mtk_enqueueBlockEditorFiles()\n {\n $handle = 'mtk_cptshortcode_editor';\n $src = $this->plugin_url . 'assets/gut_cptshortcode.js';\n $deps = array( 'wp-blocks' , 'wp-element') ;\n wp_register_script( $handle , $src , $deps );\n\n /* Register global block css - backend only */\n $handle = 'mtk_cptshortcode_editor';\n $src = $this->plugin_url . 'assets/gut_cptshortcode_editor.css';\n $deps = array( 'wp-edit-blocks') ;\n $ver = filemtime( $this->plugin_path . 'assets/gut_cptshortcode_editor.css' );\n wp_register_style( $handle, $src, $deps, $ver );\n }", "public function register()\n {\n // maybe something, one day\n }" ]
[ "0.85205954", "0.657037", "0.6336243", "0.61945", "0.6067849", "0.588502", "0.57776314", "0.576", "0.57515514", "0.56840575", "0.5670311", "0.5653882", "0.5611701", "0.5578838", "0.5560635", "0.5559", "0.55524904", "0.5475226", "0.5474373", "0.54522383", "0.541001", "0.5396611", "0.53881025", "0.5300776", "0.5294516", "0.52874756", "0.5274388", "0.52740616", "0.5260863", "0.52529675", "0.52378666", "0.5218059", "0.521146", "0.5207428", "0.51905555", "0.5179025", "0.5157774", "0.51508397", "0.51367307", "0.51300406", "0.5123989", "0.5118258", "0.51091725", "0.5089409", "0.5066177", "0.5026159", "0.5007269", "0.4999599", "0.4982222", "0.49818712", "0.4976287", "0.49743676", "0.497132", "0.496759", "0.4944002", "0.49303102", "0.49289852", "0.49273962", "0.49198735", "0.49037272", "0.49001497", "0.4895193", "0.48942667", "0.48872158", "0.4885654", "0.48844025", "0.4881335", "0.48769692", "0.48613653", "0.48595408", "0.4859403", "0.48500365", "0.48452953", "0.4833257", "0.48243934", "0.48235852", "0.48073766", "0.48027113", "0.47883537", "0.47802112", "0.47712657", "0.477123", "0.47710878", "0.47693312", "0.47672266", "0.47625658", "0.47503287", "0.47468674", "0.47325677", "0.4709446", "0.47093937", "0.47060186", "0.46975183", "0.46964613", "0.46963838", "0.46926403", "0.46857712", "0.46686694", "0.4665101", "0.46640167" ]
0.83817387
1
Returns whether or not there are any published posts. Used to hide the calendar block when there are no published posts. This compensates for a known Core bug:
function block_core_calendar_has_published_posts() { // Multisite already has an option that stores the count of the published posts. // Let's use that for multisites. if ( is_multisite() ) { return 0 < (int) get_option( 'post_count' ); } // On single sites we try our own cached option first. $has_published_posts = get_option( 'wp_calendar_block_has_published_posts', null ); if ( null !== $has_published_posts ) { return (bool) $has_published_posts; } // No cache hit, let's update the cache and return the cached value. return block_core_calendar_update_has_published_posts(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function block_core_calendar_has_published_posts()\n {\n }", "public function isPublished()\n {\n return $this->postID > 0;\n }", "function block_core_calendar_update_has_published_posts() {\n\tglobal $wpdb;\n\t$has_published_posts = (bool) $wpdb->get_var( \"SELECT 1 as test FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1\" );\n\tupdate_option( 'wp_calendar_block_has_published_posts', $has_published_posts );\n\treturn $has_published_posts;\n}", "function block_core_calendar_update_has_published_posts()\n {\n }", "public function hasPublished() {\n return $this->_has(6);\n }", "public function isPublished()\n {\n # code...\n return !is_null($this->published_at) && $this->published_at < today();\n }", "public function hasPublished() {\n return $this->_has(14);\n }", "function isPublished() {\n\t\tif ($this->status == 'published') {\n\t\t\t$now = time();\n\t\t\tif ($this->datePublish <= $now) {\n\t\t\t\tif ($this->dateUnpublish > $now || $this->dateUnpublish == null) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function isPublished(){\n\t\tif($this->isPublished == 1){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function has_published_pages()\n {\n }", "public function hasPublishedTag() {\n return $this->_has(1);\n }", "public function isPublished()\n {\n return $this->published_at->lte(Carbon::now());\n }", "public function isPublished()\n {\n return ($this->published == 1);\n }", "public function isPublished()\n\t{\n\t\tif (!$this->arrData['published'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telseif ($this->arrData['start'] > 0 && $this->arrData['start'] > time())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telseif ($this->arrData['stop'] > 0 && $this->arrData['stop'] < time())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function isPublished()\n {\n if (\n $this->getStatus() === PageStatus::PUBLISHED ||\n ($this->getStatus() === PageStatus::SCHEDULED &&\n $this->getPublishedAt() < new \\DateTime())\n ) {\n return true;\n } else {\n return false;\n }\n }", "public function isPublished()\n {\n return $this->publish_status == Status::PUBLISHED;\n }", "public function isPublishedField()\n {\n return $this->get('check_publish') == 1;\n }", "public function isPubliclyAvailable() {\n $id = $this->getID();\n $the_post = $this->find('first', array(\n 'conditions' => array(\n 'Post.id' => $id,\n ),\n 'fields' => array(\n 'Post.enabled',\n 'Post.published',\n ),\n 'recursive' => -1,\n 'callbacks' => false,\n ));\n\n $invalid_post = empty($the_post);\n\n// Don't try to process any more logic unless we know the Post even exists.\n if ($invalid_post) {\n return false;\n }\n\n $disabled_post = $the_post['Post']['enabled'] === false;\n $unpublished_post = new DateTime($the_post['Post']['published']) > new DateTime();\n\n if ($disabled_post || $unpublished_post) {\n return false;\n }\n else {\n return true;\n }\n }", "function has_posts() {\n\tif(($posts = IoC::resolve('posts')) === false) {\n\t\t$params['sortby'] = 'id';\n\t\t$params['sortmode'] = 'desc';\n\t\t\n\t\t$posts = Posts::list_all($params);\n\t\tIoC::instance('posts', $posts, true);\n\t}\n\t\n\treturn $posts->length() > 0;\n}", "public function isPublished()\n {\n if(!strcmp($this->getStatus(), 'approved')) {\n return true;\n }\n\n return false;\n }", "public function isPublished(): bool\n {\n $publishedStatus = ['publish'];\n\n return in_array($this->status, $publishedStatus);\n }", "public function has_remaining_posts() {\n\t\treturn $this->has_remaining_posts;\n\t}", "public function isPublished()\n {\n return $this->status == static::PUBLISHED;\n }", "public function isPublished()\n\t{\n\t\treturn ($this->get('published') == self::STATE_PUBLISHED);\n\t}", "public function isPublished()\n {\n if ($this->getStatus() === self::PUBLISHED) {\n return true;\n }\n\n if ($this->getStatus() === self::SCHEDULED) {\n return $this->getPublishedAt() <= new \\DateTime();\n }\n\n return false;\n }", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished()\n {\n return $this->attribute('state') == self::STATUS_PUBLISHED;\n }", "public function justPublished()\n {\n\n return $this->created_at->gt(Carbon::now()->subMinute());\n }", "public function publishedStatus()\n {\n if ( !$this->owner->getScheduledStatus() && !$this->owner->getExpiredStatus() ) {\n return true;\n }\n\n return false;\n }", "public function getPublishedPosts(){\n $query = \"SELECT * FROM `posts` WHERE `published`='1';\";\n $result = $this->executeQuery($query);\n $result = $result->fetchAll();\n\n if($result != null && count($result)>0){\n return $result;\n } else {\n return null;\n }\n }", "public function getIsPublished()\n\t{\n\t\treturn $this->is_published;\n\t}", "protected function isPublished()\n\t{\n\t\tif($this->blnIsPublished !== null)\n\t\t{\n\t\t\treturn $this->blnIsPublished;\n\t\t}\n\t\t\n\t\tif($this->blnParentView)\n\t\t{\n\t\t\t$strQuery = 'SELECT published FROM ' . $GLOBALS['TL_DCA'][$this->strTable]['config']['ptable'] . ' WHERE id=' . $this->intId;\t\t\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$strQuery \t= 'SELECT published FROM ' . $GLOBALS['TL_DCA'][$this->strTable]['config']['ptable'] \n\t\t\t\t\t\t. ' WHERE id=(SELECT pid FROM ' . $this->strTable . ' WHERE id=' . $this->intId . ')';\n\t\t}\n\n\t\t$this->blnIsPublished = (bool) $this->Database->query($strQuery)->published;\n\t\treturn $this->blnIsPublished;\n\t}", "function exa_is_published_today( $post ) {\n\t$post = get_post($post);\n\t$postTime = get_post_time('U',true);\n\t$today = strtotime('midnight',current_time('timestamp'));\n\treturn ($postTime >= $today);\n}", "public function hasPosts()\n\t{\n\t\tif ($this->hasData('post_count')) {\n\t\t\treturn $this->getPostCount() > 0;\n\t\t}\n\n\t\treturn $this->getPostCollection()->count() > 0;\n\t}", "public function getAllPublishedPosts() \n\t{\n $q = \"SELECT * FROM in_posts WHERE publish_flag = 1 ORDER BY publish_time DESC\";\n $ps = $this->execute($q);\n $result = $this->getDataRowsAsObjects($ps, 'Post');\n return $result;\n }", "protected function hasAccessOnPublished()\n\t{\n\t\treturn $this->User->hasAccess($GLOBALS['TL_DCA'][$this->strTable]['config']['ptable'] . '::published', 'alexf');\t\t\n\t}", "function ridizain_has_featured_posts() {\r\n\treturn ! is_paged() && (bool) ridizain_get_featured_posts();\r\n}", "public function shouldBePublished()\n {\n return $this->publish;\n }", "public function all_post() {\n return false;\n }", "public function all_post() {\n return false;\n }", "public function hasPosts() {\n\t\t$sql = \"SELECT \tCOUNT(*) AS count\n\t\t\tFROM \twbb\".WBB_N.\"_post\n\t\t\tWHERE \tthreadID = \".$this->threadID;\n\t\t$result = WCF::getDB()->getFirstRow($sql);\n\t\treturn $result['count'];\n\t}", "public function getIsUnPublishScheduled()\n {\n /** @var DBDatetime $unpublish */\n $unpublish = $this->owner->dbObject('UnPublishOnDate');\n\n if ($unpublish->InFuture()) {\n return true;\n }\n\n if ((int) $this->owner->UnPublishJobID !== 0) {\n return true;\n }\n\n return false;\n }", "protected function hasPublishedVersion(): bool {\n $revision = $this->getCurrentRevision();\n if (NULL === $revision) {\n return FALSE;\n }\n\n return $revision->isPublished();\n }", "public function getIsPublishScheduled()\n {\n /** @var DBDatetime $publishTime */\n $publishTime = $this->owner->dbObject('PublishOnDate');\n\n if ($publishTime->InFuture()) {\n return true;\n }\n\n if ((int) $this->owner->PublishJobID !== 0) {\n return true;\n }\n\n return false;\n }", "function getPublishedPostsOnly() {\n\tglobal $conn;\n\t$sql = \"SELECT * FROM posts WHERE published=true order by created_at DESC LIMIT 3\";\n\t$result = mysqli_query($conn, $sql);\n\n\t// fetch all posts as an associative array called $posts\n\t$posts = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\t$final_posts = array();\n\tforeach ($posts as $post) {\n\t\t$post['topic'] = getPostTopic($post['id']); \n\t\tarray_push($final_posts, $post);\n\t}\n\treturn $final_posts;\n}", "private function requested_post_is_valid(){\n return (get_post_type((int) $_GET['post_id']) === $this->post_type && get_post_status((int) $_GET['post_id']) === 'publish');\n }", "function areThereStickyPosts()\r\n{\r\n\t$sticky = get_option('sticky_posts');\r\n\t// check if there are any\r\n\treturn !empty($sticky) ? true : false;\r\n}", "function is_paginated_post(): bool\n{\n\tglobal $multipage;\n\treturn $multipage !== 0;\n}", "public function testRandomPostsUnpublished() {\n // create posts, some of them unpublished (note that there is seeded post with id=1)\n $posts = [];\n $posts[0] = $this->createPost(0, TRUE);\n $posts[1] = $this->createPost(1, FALSE);\n $posts[2] = $this->createPost(2, TRUE);\n $posts[3] = $this->createPost(3, FALSE);\n\n\n // get random posts of same quantity\n $random_posts = $this->createRandomPostsComponent();\n $generated_posts = $random_posts->posts();\n\n // ensure there are no unpublished posts in the array\n $ids = $generated_posts->pluck('id');\n self::assertTrue(in_array($posts[0]->id, $ids->all()), 'Published post is in generated array');\n self::assertFalse(in_array($posts[1]->id, $ids->all()), 'Unpublished post is not in generated array');\n self::assertFalse(in_array($posts[3]->id, $ids->all()), 'Unpublished post is not in generated array');\n }", "protected function canBeRepublished(): bool {\n $revision = $this->nodeRevisionManager->loadLatestPublishedRevision($this->node());\n if (NULL === $revision) {\n return FALSE;\n }\n\n return !$this->node()->isPublished();\n }", "function is_posts_page() {\r\n global $wp_query;\r\n return $wp_query->is_posts_page ? true : false;\r\n }", "function block_core_calendar_update_has_published_post_on_delete( $post_id ) {\n\t\t$post = get_post( $post_id );\n\n\t\tif ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {\n\t\t\treturn;\n\t\t}\n\n\t\tblock_core_calendar_update_has_published_posts();\n\t}", "public function hasDrafts(): bool\n {\n return $this->drafts()->count() > 0;\n }", "function check_upcoming_is_post_upcoming(){\n $this->loop_through_upcoming_posts(array($this, 'is_post_upcoming'));\n }", "function is_post_publicly_viewable($post = \\null)\n {\n }", "function check_all_is_post_upcoming(){\n $this->loop_through_all(array($this, 'is_post_upcoming'));\n }", "function twentyfourteen_has_featured_posts() {\n\treturn ! is_paged() && (bool) twentyfourteen_get_featured_posts();\n}", "function twentyfourteen_has_featured_posts() {\n\treturn ! is_paged() && (bool) twentyfourteen_get_featured_posts();\n}", "public static function published()\n {\n // return self::where('published',1)->get();\n return self::where('published',true);\n }", "public function getAllPublished();", "public function todayPosts(){\n return $this->getModel()->latest('published_at')->published()->today()->count();\n }", "public function getPublished() {\n\t\treturn $this->published;\n\t}", "private function have_notices() {\n\n\t\t$args = apply_filters( 'bbp_notices_query_args', array(\n\t\t\t'post_type' => 'bbp_notice',\n\t\t\t'nopaging' => true,\n\t\t\t'post_status' => 'publish'\n\t\t) );\n\n\t\treturn get_posts( $args );\n\t}", "function unpublish() {\n\t\tif (! $this->id) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->saveField('is_published', 0);\n\t}", "public function hasPubDate(): bool\n {\n return null !== $this->pubDate;\n }", "function author_count_post() {\n if(get_the_author_posts() != 0) {\n echo get_the_author_posts();\n } else {\n echo '<span> no publish posts yet </span>';\n }\n}", "public function isActive()\n {\n return $this->isPublished();\n }", "static function any_content_object_is_published($object_ids)\r\n {\r\n return PersonalMessengerDataManager :: get_instance()->any_content_object_is_published($object_ids);\r\n }", "public function have_posts() {\r\n\t\treturn $this->query->have_posts();\r\n\t}", "public static function published()\n {\n return self::where('published', '=', true)->orderBy('published_at', 'DESC')->get();\n }", "static function content_object_is_published($object_id)\r\n {\r\n return PersonalMessengerDataManager :: get_instance()->content_object_is_published($object_id);\r\n }", "static function any_content_object_is_published($object_ids)\r\n {\r\n return ProfilerDataManager :: get_instance()->any_content_object_is_published($object_ids);\r\n }", "function lalita_is_posts_page() {\n\t\treturn ( is_home() || is_archive() || is_tax() ) ? true : false;\n\t}", "static function content_object_is_published($object_id)\r\n {\r\n return ProfilerDataManager :: get_instance()->content_object_is_published($object_id);\r\n }", "public function is_container_viewable( $args ) {\n\n\t\t\t// Published, all can see.\n\t\t\tif ( 'published' === $args['status'] || '' === $args['status'] ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// If is author, can also see.\n\t\t\tif ( is_user_logged_in() && current_user_can( 'publish_posts' ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Set to hide.\n\t\t\tif ( 'draft' === $args['status'] ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Set to show until or after.\n\t\t\t$time_check = strtotime( $args['publish_date'] );\n\t\t\t$wp_local_time = current_time( 'timestamp' );\n\t\t\tif ( '' !== $args['publish_date'] && $time_check ) {\n\t\t\t\tif ( 'published_until' === $args['status'] ) {\n\t\t\t\t\treturn $wp_local_time < $time_check;\n\t\t\t\t}\n\t\t\t\tif ( 'publish_after' === $args['status'] ) {\n\t\t\t\t\treturn $wp_local_time > $time_check;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Any incorrect set-up default to show.\n\t\t\treturn true;\n\t\t}", "public function pages_awaiting_publishing()\n {\n if(isset($this->pages_awaiting_publishing)) return $this->pages_awaiting_publishing;\n $this->pages_awaiting_publishing = 0;\n \n $events_to_publish = array();\n $result = $this->mysqli_slave->query(\"SELECT he.resource_id, max(he.id) max FROM harvest_events he GROUP BY he.resource_id\");\n while($result && $row=$result->fetch_assoc())\n {\n $harvest_event = new HarvestEvent($row['max']);\n if(!$harvest_event->published_at) $events_to_publish[] = $harvest_event->id;\n }\n \n $result = $this->mysqli_slave->query(\"SELECT COUNT(DISTINCT(tc.id)) count FROM harvest_events_hierarchy_entries hehe JOIN hierarchy_entries he ON (hehe.hierarchy_entry_id=he.id) JOIN taxon_concepts tc ON (he.taxon_concept_id=tc.id) WHERE hehe.harvest_event_id IN (\".implode($events_to_publish, \",\").\") AND tc.published=0 AND tc.vetted_id=\". Vetted::find(\"trusted\"));\n if($result && $row=$result->fetch_assoc()) $this->pages_awaiting_publishing = $row['count'];\n return $this->pages_awaiting_publishing;\n }", "function show_posts_nav() {\n\tglobal $wp_query;\n\treturn ($wp_query->max_num_pages > 1);\n}", "public function hasNewPosts()\n {\n if ($this->last_post == null) return false;\n\n $last_access = session('last_access_time');\n if (!$last_access || !($last_access instanceof Carbon)) $last_access = Carbon::now()->addDays(1);\n\n $thread_read = session('thread_persistance_data');\n if ($thread_read && is_array($thread_read) && array_key_exists($this->id, $thread_read)) {\n $read = $thread_read[$this->id];\n if ($read instanceof Carbon && $read > $last_access) $last_access = $read;\n }\n\n return $this->last_post->updated_at > $last_access;\n }", "public function isInAuthorPost()\n {\n return $this->object->isInAuthorPost();\n }", "function get_unpublished_post_statuses() {\n $status = [ 'draft', 'pending', 'auto-draft'/*, 'future' */ ];\n\n /**\n * Filter the unpublished post statuses.\n *\n * @param array $status List of non-public post statuses.\n */\n return apply_filters( 'unpublished_post_statuses', $status );\n }", "public function is_posts_page() {\n return ( is_home() && 'page' == get_option( 'show_on_front' ) );\n }", "function check_and_publish_future_post($post)\n {\n }", "public function isActive()\n {\n return $this->is_published;\n }", "public function getPosts($id)\n {\n $event = Events::findOrFail($id);\n if(count($event) > 0){\n\n $event_post = $event->posts;\n if(isset($event_post) && $event_post->count() > 0){\n\n return true;\n\n }else{\n\n return false;\n }\n }\n }", "public function hasPublishedfileid()\n {\n return $this->publishedfileid !== null;\n }", "public static function published()\n {\n return (new static )->newQueryWithoutScope(new ContentPublishingScope())->published();\n }", "function xgb_check_post_count($post_id) {\n\tglobal $wpdb;\n\t\n\t$post = get_post($post_id);\n\t$author_id = $post->post_author;\n\t$user_info = get_userdata(get_current_user_id());\n\t\n\t\t$published_post_count = $wpdb->get_var(\"SELECT COUNT(ID) FROM wp_posts WHERE post_status='publish' AND post_type='post' AND post_author=$author_id\");\n\t\tif($published_post_count > $GLOBALS['live_article_limit'] ) {\n\t\t\t$wpdb->query(\"UPDATE wp_posts SET post_status='pending' WHERE ID=$post_id\");\n\t\t\t// Set the transient for admin notice\n\t\t\tset_transient( get_current_user_id().'publisherror', $GLOBALS['live_article_limit'] ); \n\t\t}\n}", "public function isMainPost()\n\t{\n\t\t$topic = ForumTopic::with(['messages' => function($q) {\n\t\t\t$q->orderBy('created_at','asc');\n\t\t}])->find($this->topic_id);\n\n\t\tif($topic->messages[0]->id == $this->id) return true;\n\n\t\treturn false;\n\n\t}" ]
[ "0.8337035", "0.82862324", "0.8159969", "0.7968392", "0.7810972", "0.7656198", "0.7612611", "0.7586487", "0.74971926", "0.7481633", "0.7423328", "0.74053067", "0.7374402", "0.7343217", "0.7279256", "0.72571737", "0.7216251", "0.720999", "0.7206806", "0.7197219", "0.7145267", "0.70967907", "0.7076972", "0.7070332", "0.70393246", "0.7039035", "0.7039035", "0.7039035", "0.7039035", "0.7039035", "0.7039035", "0.7039035", "0.7039035", "0.7039035", "0.7039035", "0.7039035", "0.7039035", "0.7039035", "0.7011357", "0.700874", "0.697208", "0.692974", "0.69086254", "0.6885927", "0.685557", "0.684555", "0.6817705", "0.6787147", "0.67339146", "0.66961503", "0.66637653", "0.66637653", "0.66401523", "0.6603679", "0.65823036", "0.6543195", "0.651567", "0.6498392", "0.645057", "0.6429304", "0.63942224", "0.6375085", "0.6357143", "0.6354311", "0.6347163", "0.63320404", "0.6307302", "0.6293185", "0.6283941", "0.6283941", "0.6275005", "0.62723047", "0.62599885", "0.62322825", "0.6203009", "0.61897904", "0.61775494", "0.61691487", "0.6163881", "0.6159567", "0.61519074", "0.61467695", "0.61319673", "0.6127951", "0.61260676", "0.61046225", "0.6100164", "0.6093493", "0.60840213", "0.60666096", "0.6065222", "0.60635537", "0.60592383", "0.6051213", "0.6046072", "0.6045631", "0.604387", "0.6032939", "0.60241896", "0.6015357" ]
0.8156727
3
Queries the database for any published post and saves a flag whether any published post exists or not.
function block_core_calendar_update_has_published_posts() { global $wpdb; $has_published_posts = (bool) $wpdb->get_var( "SELECT 1 as test FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1" ); update_option( 'wp_calendar_block_has_published_posts', $has_published_posts ); return $has_published_posts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isPublished()\n {\n return $this->postID > 0;\n }", "public function exists()\n {\n if (get_post($this->id)) {\n return true;\n }\n\n return false;\n }", "function block_core_calendar_update_has_published_posts()\n {\n }", "function check_and_publish_future_post($post)\n {\n }", "function xgb_check_post_count($post_id) {\n\tglobal $wpdb;\n\t\n\t$post = get_post($post_id);\n\t$author_id = $post->post_author;\n\t$user_info = get_userdata(get_current_user_id());\n\t\n\t\t$published_post_count = $wpdb->get_var(\"SELECT COUNT(ID) FROM wp_posts WHERE post_status='publish' AND post_type='post' AND post_author=$author_id\");\n\t\tif($published_post_count > $GLOBALS['live_article_limit'] ) {\n\t\t\t$wpdb->query(\"UPDATE wp_posts SET post_status='pending' WHERE ID=$post_id\");\n\t\t\t// Set the transient for admin notice\n\t\t\tset_transient( get_current_user_id().'publisherror', $GLOBALS['live_article_limit'] ); \n\t\t}\n}", "public function isPubliclyAvailable() {\n $id = $this->getID();\n $the_post = $this->find('first', array(\n 'conditions' => array(\n 'Post.id' => $id,\n ),\n 'fields' => array(\n 'Post.enabled',\n 'Post.published',\n ),\n 'recursive' => -1,\n 'callbacks' => false,\n ));\n\n $invalid_post = empty($the_post);\n\n// Don't try to process any more logic unless we know the Post even exists.\n if ($invalid_post) {\n return false;\n }\n\n $disabled_post = $the_post['Post']['enabled'] === false;\n $unpublished_post = new DateTime($the_post['Post']['published']) > new DateTime();\n\n if ($disabled_post || $unpublished_post) {\n return false;\n }\n else {\n return true;\n }\n }", "function block_core_calendar_has_published_posts()\n {\n }", "function publish() {\n\t\tif (! $this->id) {\n\t\t\treturn false;\n\t\t}\n\t\t/* This method formerly updated the published_date, but that was removed in \n\t\t * favor of giving manual control of the published_date to the author\n\t\t * $this->saveField('published_date', date('Y-m-d', time()).' 00:00:00') */\n\t\treturn $this->saveField('is_published', 1);\n\t}", "public function hasPublished() {\n return $this->_has(6);\n }", "public function has_published_pages()\n {\n }", "public function future_to_published($post) {\n\t\t\n\t\tdefine(\"WPU_JUST_POSTED_{$postID}\", TRUE);\n\t\t$this->handle_new_post($post->ID, $post, true);\n\t}", "public function publishPost($POST) {\r\n\t\t$sql = 'UPDATE `posts` SET `post_status` = :post_status\r\n\t\t\t\tWHERE `ID` = :ID AND `post_author` = :post_author LIMIT 1';\r\n\t\t$sth = $this->db->prepare($sql);\r\n\r\n\t\t$ret = $sth->execute(array('ID' => $POST['id'],\r\n\t\t\t\t\t\t\t\t 'post_author' => $GLOBALS['user']['id'],\r\n\t\t\t\t\t\t\t\t 'post_status' => 'publish'));\r\n\r\n\t\tif ($ret) {\r\n\t\t\t$this->putMsg('Successfully published');\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "function exists() {\n\t\tif ( !$this->postID )\n\t\t\treturn false;\n\t\t\t\n\t\t$sql = \"SELECT post_id FROM $this->cacheTable WHERE post_id = \" . $this->db->escape( $this->postID ) . \"\";\n\t\t\n\t\t$results = $this->db->get_results( $sql );\n\t\t\n\t\tif ( $results[0] )\n\t\t\treturn true;\n\t\t\t\n\t\treturn false;\n\t\t\n\t}", "function block_core_calendar_update_has_published_post_on_delete( $post_id ) {\n\t\t$post = get_post( $post_id );\n\n\t\tif ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {\n\t\t\treturn;\n\t\t}\n\n\t\tblock_core_calendar_update_has_published_posts();\n\t}", "public function publish() {\n if($this->exists) {\n $post = Post::create($this->getDraftData());\n $this->delete();\n return $post;\n }\n }", "public function exists_in_posts_table() {\r\n\t\treturn ! empty( $this->db_id );\r\n\t}", "function block_core_calendar_has_published_posts() {\n\t// Multisite already has an option that stores the count of the published posts.\n\t// Let's use that for multisites.\n\tif ( is_multisite() ) {\n\t\treturn 0 < (int) get_option( 'post_count' );\n\t}\n\n\t// On single sites we try our own cached option first.\n\t$has_published_posts = get_option( 'wp_calendar_block_has_published_posts', null );\n\tif ( null !== $has_published_posts ) {\n\t\treturn (bool) $has_published_posts;\n\t}\n\n\t// No cache hit, let's update the cache and return the cached value.\n\treturn block_core_calendar_update_has_published_posts();\n}", "public function handleFutureToPublish($post) {\n if (\"publish\" == $post->post_status) {\n $this->indexPost($post->ID);\n }\n }", "function postExists($id){\n return (getSingleValue(\"SELECT COUNT(`id`) FROM `public_forums_posts` WHERE `deleted` = '0' AND `id` = '\" . escape(intval($id)) . \"'\") >= 1);\n }", "function isPublished() {\n\t\tif ($this->status == 'published') {\n\t\t\t$now = time();\n\t\t\tif ($this->datePublish <= $now) {\n\t\t\t\tif ($this->dateUnpublish > $now || $this->dateUnpublish == null) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function has_posts() {\n\tif(($posts = IoC::resolve('posts')) === false) {\n\t\t$params['sortby'] = 'id';\n\t\t$params['sortmode'] = 'desc';\n\t\t\n\t\t$posts = Posts::list_all($params);\n\t\tIoC::instance('posts', $posts, true);\n\t}\n\t\n\treturn $posts->length() > 0;\n}", "private function requested_post_is_valid(){\n return (get_post_type((int) $_GET['post_id']) === $this->post_type && get_post_status((int) $_GET['post_id']) === 'publish');\n }", "public function getPublishedPosts(){\n $query = \"SELECT * FROM `posts` WHERE `published`='1';\";\n $result = $this->executeQuery($query);\n $result = $result->fetchAll();\n\n if($result != null && count($result)>0){\n return $result;\n } else {\n return null;\n }\n }", "public function hasPublished() {\n return $this->_has(14);\n }", "function unpublish() {\n\t\tif (! $this->id) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->saveField('is_published', 0);\n\t}", "public function hasPublishedTag() {\n return $this->_has(1);\n }", "public function publish(Post $post)\n\t{\n\t\t$q = \"UPDATE in_posts \";\n\t\t$q .= \"SET publish_flag=1, read_length=:read_length, publish_time=Now() WHERE id=:post_id\";\n\t\t$vars = array(\n\t\t\t':read_length'=>$post->read_length,\n\t\t\t':post_id'=>$post->id\n\t\t);\n\t\t//$this->logger->logInfo($q);\n\t\t$ps = $this->execute($q, $vars);\n\t}", "function post_exists($title, $content = '', $date = '', $type = '', $status = '')\n {\n }", "public function isPublished(): bool\n {\n $publishedStatus = ['publish'];\n\n return in_array($this->status, $publishedStatus);\n }", "public function isPublishedField()\n {\n return $this->get('check_publish') == 1;\n }", "public function getAllPublishedPosts() \n\t{\n $q = \"SELECT * FROM in_posts WHERE publish_flag = 1 ORDER BY publish_time DESC\";\n $ps = $this->execute($q);\n $result = $this->getDataRowsAsObjects($ps, 'Post');\n return $result;\n }", "public function isPublished()\n {\n return $this->publish_status == Status::PUBLISHED;\n }", "function published_posts($id)\n { \n\t\t$this->db->select('post_author');\n\t\t$this->db->from($this->tabla);\n\t\t$this->db->where('post_author',$id);\n\t\t$this->db->where('post_status like \"publish\"');\n\t\treturn $this->db->count_all_results();\n }", "public function isPublished()\n {\n return ($this->published == 1);\n }", "function exa_is_published_today( $post ) {\n\t$post = get_post($post);\n\t$postTime = get_post_time('U',true);\n\t$today = strtotime('midnight',current_time('timestamp'));\n\treturn ($postTime >= $today);\n}", "function isPublished(){\n\t\tif($this->isPublished == 1){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isPublished()\n {\n # code...\n return !is_null($this->published_at) && $this->published_at < today();\n }", "abstract public function exists($blogPostId);", "function block_core_calendar_update_has_published_post_on_delete($post_id)\n {\n }", "protected function isPublished()\n\t{\n\t\tif($this->blnIsPublished !== null)\n\t\t{\n\t\t\treturn $this->blnIsPublished;\n\t\t}\n\t\t\n\t\tif($this->blnParentView)\n\t\t{\n\t\t\t$strQuery = 'SELECT published FROM ' . $GLOBALS['TL_DCA'][$this->strTable]['config']['ptable'] . ' WHERE id=' . $this->intId;\t\t\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$strQuery \t= 'SELECT published FROM ' . $GLOBALS['TL_DCA'][$this->strTable]['config']['ptable'] \n\t\t\t\t\t\t. ' WHERE id=(SELECT pid FROM ' . $this->strTable . ' WHERE id=' . $this->intId . ')';\n\t\t}\n\n\t\t$this->blnIsPublished = (bool) $this->Database->query($strQuery)->published;\n\t\treturn $this->blnIsPublished;\n\t}", "public function isPublished()\n {\n if(!strcmp($this->getStatus(), 'approved')) {\n return true;\n }\n\n return false;\n }", "protected function _publish_status()\n\t{\n\t\t//$fields = $this->fields();\n\t\t$fields = $fields = array_keys($this->table_info()); // used to prevent an additional query that the fields() method would create\n\n\t\tif (in_array('published', $fields))\n\t\t{\n\t\t\tif (in_array('published', $this->boolean_fields))\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.published' => 1));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.published' => 'yes'));\n\t\t\t}\n\t\t}\n\n\t\tif (in_array('active', $fields))\n\t\t{\n\t\t\tif (in_array('active', $this->boolean_fields))\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.active' => 1));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.active' => 'yes'));\n\t\t\t}\n\t\t}\n\n\t\tif (in_array('publish_date', $fields))\n\t\t{\n\t\t\t$this->db->where(array($this->table_name.'.publish_date <=' => datetime_now()));\n\t\t}\n\t}", "public function isPublished()\n {\n return $this->status == static::PUBLISHED;\n }", "public function all_post() {\n return false;\n }", "public function all_post() {\n return false;\n }", "public function isPublished()\n {\n if (\n $this->getStatus() === PageStatus::PUBLISHED ||\n ($this->getStatus() === PageStatus::SCHEDULED &&\n $this->getPublishedAt() < new \\DateTime())\n ) {\n return true;\n } else {\n return false;\n }\n }", "public function exists_in_feeds_posts_table() {\r\n\t\tglobal $wpdb;\r\n\t\t$table_name = $wpdb->prefix . CTF_FEEDS_POSTS_TABLE;\r\n\t\t$db_id = $this->db_id;\r\n\t\t$results = $wpdb->get_results( $wpdb->prepare( \"SELECT feed_id FROM $table_name WHERE id = %s AND feed_id = %s LIMIT 1\", $db_id, $this->feed_id ), ARRAY_A );\r\n\t\treturn isset( $results[0]['feed_id'] );\r\n\t}", "protected function hasAccessOnPublished()\n\t{\n\t\treturn $this->User->hasAccess($GLOBALS['TL_DCA'][$this->strTable]['config']['ptable'] . '::published', 'alexf');\t\t\n\t}", "public function hasPost(string $name): bool {}", "protected function hasPublishedVersion(): bool {\n $revision = $this->getCurrentRevision();\n if (NULL === $revision) {\n return FALSE;\n }\n\n return $revision->isPublished();\n }", "public function draft_publish()\n\t{\n\t\t$where = array(\n\t\t\t'parent_entry_id' => $this->settings['entry_id'],\n\t\t\t'parent_is_draft' => 0\n\t\t);\n\t\t$this->EE->db->where($where)->delete('playa_relationships');\n\n\t\t$where['parent_is_draft'] = 1;\n\t\t$update = array('parent_is_draft' => 0);\n\t\t$this->EE->db->where($where)->update('playa_relationships', $update);\n\n\t\treturn;\n\t}", "public static function published()\n {\n // return self::where('published',1)->get();\n return self::where('published',true);\n }", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function hasPosts() {\n\t\t$sql = \"SELECT \tCOUNT(*) AS count\n\t\t\tFROM \twbb\".WBB_N.\"_post\n\t\t\tWHERE \tthreadID = \".$this->threadID;\n\t\t$result = WCF::getDB()->getFirstRow($sql);\n\t\treturn $result['count'];\n\t}", "public function isPublished()\n\t{\n\t\treturn ($this->get('published') == self::STATE_PUBLISHED);\n\t}", "function getPublicPost() {\n return getAll(\"SELECT * FROM posting WHERE status= 'public'\");\n}", "public function publishedStatus()\n {\n if ( !$this->owner->getScheduledStatus() && !$this->owner->getExpiredStatus() ) {\n return true;\n }\n\n return false;\n }", "public function hasNewPosts()\n {\n if ($this->last_post == null) return false;\n\n $last_access = session('last_access_time');\n if (!$last_access || !($last_access instanceof Carbon)) $last_access = Carbon::now()->addDays(1);\n\n $thread_read = session('thread_persistance_data');\n if ($thread_read && is_array($thread_read) && array_key_exists($this->id, $thread_read)) {\n $read = $thread_read[$this->id];\n if ($read instanceof Carbon && $read > $last_access) $last_access = $read;\n }\n\n return $this->last_post->updated_at > $last_access;\n }", "public function isPublished()\n {\n return $this->attribute('state') == self::STATUS_PUBLISHED;\n }", "private function runPost()\n {\n $numDraftPost = (int) $this->ask('How many records do you want to create for the draft posts table?');\n $numPublicPost = (int) $this->ask('How many records do you want to create for the public posts table?');\n\n $sum = (int) ($numDraftPost + $numPublicPost);\n\n for ($i = 0; $i < $sum; $i++) {\n factory(Post::class)->create(\n [\n 'publication_status' => ($i < $numDraftPost) ? 'draft' : 'public',\n ]\n );\n }\n }", "public function isPublished()\n {\n return $this->published_at->lte(Carbon::now());\n }", "public function is_post_upcoming($post_id = false) {\n $post_id = (!empty($post_id)) ? $post_id : get_the_ID();\n //In order to do this check we need both a post, and an archive date field\n if (empty($post_id) || empty($this->dates['archive'])) {\n return;\n }\n //Get the archived date\n $archive_date = get_post_meta($post_id, $this->dates['archive']);\n \n //Get todays date to compare against\n $today = date('Ymd');\n \n //If we do not have an info in the archive_date post meta, stop\n if (empty($archive_date)) {\n return;\n }\n \n //Update the archive based on the inequalitys\n $post_meta_value = (intval($today) < intval($archive_date[0])) ? \"Upcoming\" : \"Past\";\n update_post_meta($post_id, '_is_upcoming', intval($today) < intval($archive_date[0]));\n //This post meta field is specifically for facets.\n //TODO: Could just be the only one?\n update_post_meta($post_id, '_event_upcoming_label', $post_meta_value);\n }", "function check_all_is_post_upcoming(){\n $this->loop_through_all(array($this, 'is_post_upcoming'));\n }", "public function publish(Post $post){\n $this->posts()->save($post);\n }", "public static function postWithIdExists($id)\n\t{\n\t\treturn sizeof(Utils::wpdbQuery(\"SELECT ID FROM _tbl_posts WHERE ID=%d\",$id)) > 0;\n\t}", "public function publish(Post $post)\n {\n $post->updated_at = null;\n\n $post->published = true;\n\n $query = DB::table('threads')\n ->where('id', $post->thread_id)\n ->update(['lastpost_uid' => $post->user_id, 'lastpost_date' => $post->created_at]);\n\n $post->save();\n\n return back();\n }", "public function hasPosts()\n\t{\n\t\tif ($this->hasData('post_count')) {\n\t\t\treturn $this->getPostCount() > 0;\n\t\t}\n\n\t\treturn $this->getPostCollection()->count() > 0;\n\t}", "public function isPublished()\n {\n if ($this->getStatus() === self::PUBLISHED) {\n return true;\n }\n\n if ($this->getStatus() === self::SCHEDULED) {\n return $this->getPublishedAt() <= new \\DateTime();\n }\n\n return false;\n }", "public function getPosts($id)\n {\n $event = Events::findOrFail($id);\n if(count($event) > 0){\n\n $event_post = $event->posts;\n if(isset($event_post) && $event_post->count() > 0){\n\n return true;\n\n }else{\n\n return false;\n }\n }\n }", "function check_upcoming_is_post_upcoming(){\n $this->loop_through_upcoming_posts(array($this, 'is_post_upcoming'));\n }", "public function testRandomPostsUnpublished() {\n // create posts, some of them unpublished (note that there is seeded post with id=1)\n $posts = [];\n $posts[0] = $this->createPost(0, TRUE);\n $posts[1] = $this->createPost(1, FALSE);\n $posts[2] = $this->createPost(2, TRUE);\n $posts[3] = $this->createPost(3, FALSE);\n\n\n // get random posts of same quantity\n $random_posts = $this->createRandomPostsComponent();\n $generated_posts = $random_posts->posts();\n\n // ensure there are no unpublished posts in the array\n $ids = $generated_posts->pluck('id');\n self::assertTrue(in_array($posts[0]->id, $ids->all()), 'Published post is in generated array');\n self::assertFalse(in_array($posts[1]->id, $ids->all()), 'Unpublished post is not in generated array');\n self::assertFalse(in_array($posts[3]->id, $ids->all()), 'Unpublished post is not in generated array');\n }", "public function unPublish($post_id)\n\t{\n\t\t$q = \"UPDATE in_posts \";\n\t\t$q .= \"SET publish_flag=0 WHERE id=:post_id\";\n\t\t$vars = array(\n\t\t\t':post_id'=>$post_id\n\t\t);\n\t\t//$this->logger->logInfo($q);\n\t\t$ps = $this->execute($q, $vars);\n\t}", "protected function maybeCheckPostExistsInDatabase($post_id)\n {\n if (!isset($this->config['checkExistence']) or false == $this->config['checkExistence']) {\n return;\n }\n $tableName = $this->grabPrefixedTableNameFor('posts');\n if (!$this->grabFromDatabase($tableName, 'ID', array('ID' => $post_id))) {\n throw new \\RuntimeException(\"A post with an id of $post_id does not exist\", 1);\n }\n }", "public function havePostInDatabase($ID,\n array $data = array())\n {\n $post = Post::makePost($ID, $this->config['url'], $data);\n $tableName = $this->grabPrefixedTableNameFor('posts');\n $this->haveInDatabase($tableName, $post);\n }", "public function isPublished()\n\t{\n\t\tif (!$this->arrData['published'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telseif ($this->arrData['start'] > 0 && $this->arrData['start'] > time())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telseif ($this->arrData['stop'] > 0 && $this->arrData['stop'] < time())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function products_could_be_queried_with_published_status()\n {\n $publishedProductQty = random_int(1, 10);\n factory(Product::class, $publishedProductQty)\n ->states('published')\n ->create();\n\n $unpublishedProductQty = random_int(1, 10);\n factory(Product::class, $unpublishedProductQty)\n ->states('unpublished')\n ->create();\n\n //status\n //act + assert\n $queryResult = $this->productFilter->getList(['published' => true]);\n $this->assertCount($publishedProductQty, $queryResult);\n\n //act + assert\n $queryResult = $this->productFilter->getList(['published' => false]);\n $this->assertCount($unpublishedProductQty, $queryResult);\n }", "static function content_object_is_published($object_id)\r\n {\r\n return PersonalMessengerDataManager :: get_instance()->content_object_is_published($object_id);\r\n }", "public function publish(Post $p)\n {\n if ($p->status === 'draft') {\n $p->status = 'published';\n $p->save();\n }\n\n return $p;\n }", "function post_count() {\n global $wpdb;\n return $wpdb->get_var(\"SELECT count(id)\n FROM $wpdb->posts\n WHERE post_type = 'post'\n AND post_status = 'publish'\");\n}", "public function pages_awaiting_publishing()\n {\n if(isset($this->pages_awaiting_publishing)) return $this->pages_awaiting_publishing;\n $this->pages_awaiting_publishing = 0;\n \n $events_to_publish = array();\n $result = $this->mysqli_slave->query(\"SELECT he.resource_id, max(he.id) max FROM harvest_events he GROUP BY he.resource_id\");\n while($result && $row=$result->fetch_assoc())\n {\n $harvest_event = new HarvestEvent($row['max']);\n if(!$harvest_event->published_at) $events_to_publish[] = $harvest_event->id;\n }\n \n $result = $this->mysqli_slave->query(\"SELECT COUNT(DISTINCT(tc.id)) count FROM harvest_events_hierarchy_entries hehe JOIN hierarchy_entries he ON (hehe.hierarchy_entry_id=he.id) JOIN taxon_concepts tc ON (he.taxon_concept_id=tc.id) WHERE hehe.harvest_event_id IN (\".implode($events_to_publish, \",\").\") AND tc.published=0 AND tc.vetted_id=\". Vetted::find(\"trusted\"));\n if($result && $row=$result->fetch_assoc()) $this->pages_awaiting_publishing = $row['count'];\n return $this->pages_awaiting_publishing;\n }", "public function openPost(Request $request){\n\n $post = Post::find($request['id']);\n\n if(!HasSeenPost::where('user_id', auth()->user()->id)->where('post_id', $post->id)->exists()){\n $hasSeenPost = new HasSeenPost();\n $hasSeenPost->user_id = auth()->user()->id;\n $hasSeenPost->post_id = $post->id;\n $hasSeenPost->save();\n }\n\n\n }", "public function unpublish_expired_posts() {\n $expired_posts = $this->get_expired_posts();\n foreach ( $expired_posts as $expired_post ) {\n // Only automatically unpublish if the corresponding option is enabled for this post\n if ( $expired_post->bbx_best_before_unpublish_when_expired ) {\n // Set post to draft\n wp_update_post(\n array(\n 'ID' => $expired_post->ID,\n 'post_status' => 'draft'\n )\n );\n }\n }\n }", "public static function published()\n {\n return (new static )->newQueryWithoutScope(new ContentPublishingScope())->published();\n }", "public static function postWithTitleExists($title,$post_type)\n\t{\n\t\treturn count(Utils::wpdbQuery(\"Select ID from _tbl_posts WHERE post_title=%s and post_status='published' and post_type=%s\",$title,$post_type)) > 0;\n\t}", "public function postPublish(Post $post)\n {\n $this->postRepository->postPublished($post);\n return redirect(config('blog.prefix', 'admin/blog') . '/' . 'post');\n }", "function documentIsPublished($iDocumentID) {\n\t\tglobal $default;\n\t\t$sQuery = \"SELECT id FROM $default->web_documents_table WHERE document_id = ? AND status_id = 2\";/*ok*/\n $aParams = array($iDocumentID);\n\t\t$sql = $default->db;\n\t\t$sql->query(array($sQuery, $aParams));\n\t\tif ($sql->next_record()) {\n\t\t\treturn true;;\n\t\t}\n\t\treturn false;\n\t}", "public function onNewPost(PostEvent $event): bool\n {\n $user = $event->user;\n $badges = Badge::where('type', 'onNewPost')->get();\n\n $collection = $badges->filter(function ($badge) use ($user) {\n return $badge->rule <= $user->discuss_post_count;\n });\n\n $result = $user->badges()->syncWithoutDetaching($collection);\n\n return $this->sendNotifications($result, $badges, $user);\n }", "static function any_content_object_is_published($object_ids)\r\n {\r\n return PersonalMessengerDataManager :: get_instance()->any_content_object_is_published($object_ids);\r\n }" ]
[ "0.7314679", "0.69616866", "0.6937698", "0.67566526", "0.67335445", "0.66820747", "0.6677275", "0.6634054", "0.66263545", "0.6624386", "0.6617863", "0.6604181", "0.65734166", "0.6549202", "0.65190005", "0.65065455", "0.6502604", "0.64556044", "0.6451244", "0.6451075", "0.6440384", "0.6408998", "0.63903147", "0.6385165", "0.6369136", "0.6319721", "0.63071823", "0.6304103", "0.62854224", "0.62538636", "0.62043023", "0.62038654", "0.62033075", "0.62002146", "0.61953455", "0.6161134", "0.6132657", "0.6125235", "0.6119991", "0.6109621", "0.60774034", "0.6065086", "0.6053491", "0.6035844", "0.6035844", "0.6035615", "0.6034402", "0.60222566", "0.6018027", "0.6007144", "0.5995258", "0.59853137", "0.59831744", "0.59831744", "0.59831744", "0.59831744", "0.59831744", "0.59831744", "0.59831744", "0.59831744", "0.59831744", "0.59831744", "0.59831744", "0.59831744", "0.59831744", "0.5980009", "0.5970212", "0.5949278", "0.59391123", "0.5924487", "0.5922948", "0.5892151", "0.5886848", "0.58588165", "0.5843236", "0.5842185", "0.58403265", "0.58292395", "0.58142424", "0.57819676", "0.5779314", "0.5763606", "0.57612383", "0.57339317", "0.5733114", "0.5729259", "0.57201177", "0.5715978", "0.5711907", "0.57057935", "0.566531", "0.5657243", "0.5654996", "0.56532043", "0.5639983", "0.5633835", "0.5621562", "0.5618263", "0.561603", "0.5615418" ]
0.68885237
3
Handler for updating the has published posts flag when a post is deleted.
function block_core_calendar_update_has_published_post_on_delete( $post_id ) { $post = get_post( $post_id ); if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) { return; } block_core_calendar_update_has_published_posts(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function block_core_calendar_update_has_published_post_on_delete($post_id)\n {\n }", "function _update_posts_count_on_delete( $post_id ) {\n\t$post = get_post( $post_id );\n\n\tif ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {\n\t\treturn;\n\t}\n\n\tupdate_posts_count();\n}", "public function onAfterDelete() {\n\t\tparent::onAfterDelete();\n\n\t\tif($this->isPublished()) {\n\t\t\t$this->doUnpublish();\n\t\t}\n\t}", "function _update_posts_count_on_delete($post_id, $post)\n {\n }", "public function deleted(Post $post)\n {\n $post->recordActivity('deleted');\n }", "public function hard_delete()\n\t{\n\t\tif (!$this->topic->topic_posts)\n\t\t{\n\t\t\tif (!$this->topic->load($this->topic_id))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Update the postcount for the topic\n\t\t$this->update_topic_postcount(true);\n\n\t\t// Set the visibility appropriately if no posts are visibile to the public/authors\n\t\t$flags = count::get_flags(access::PUBLIC_LEVEL);\n\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t{\n\t\t\t// There are no posts visible to the public, change it to authors level access\n\t\t\t$this->topic->topic_access = access::AUTHOR_LEVEL;\n\n\t\t\t$flags = count::get_flags(access::AUTHOR_LEVEL);\n\t\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t\t{\n\t\t\t\t// There are no posts visible to authors, change it to teams level access\n\t\t\t\t$this->topic->topic_access = access::TEAM_LEVEL;\n\t\t\t}\n\t\t}\n\n\t\t// Sync the first topic post if required\n\t\tif ($this->post_id == $this->topic->topic_first_post_id)\n\t\t{\n\t\t\t$this->topic->sync_first_post($this->post_id);\n\t\t}\n\n\t\t// Sync the last topic post if required\n\t\tif ($this->post_id == $this->topic->topic_last_post_id)\n\t\t{\n\t\t\t$this->topic->sync_last_post($this->post_id);\n\t\t}\n\n\t\t// Submit the topic to store the updated information\n\t\t$this->topic->submit();\n\n\t\t// Remove from the search index\n\t\t$this->search_manager->delete($this->post_type, $this->post_id);\n\n\t\t// @todo remove attachments and other things\n\n\t\t// Remove any attention items\n\t\t$sql = 'DELETE FROM ' . TITANIA_ATTENTION_TABLE . '\n\t\t\tWHERE attention_object_type = ' . ext::TITANIA_POST . '\n\t\t\t\tAND attention_object_id = ' . $this->post_id;\n\t\tphpbb::$db->sql_query($sql);\n\n\t\t// Decrement the user's postcount if we must\n\t\tif (!$this->post_deleted && $this->post_approved && in_array($this->post_type, titania::$config->increment_postcount))\n\t\t{\n\t\t\tphpbb::update_user_postcount($this->post_user_id, '-');\n\t\t}\n\n\t\t$this->forum_queue_hard_delete();\n\n\t\t// Initiate self-destruct mode\n\t\tparent::delete();\n\n\t\t// Update topics posted table\n\t\t$this->topic->update_posted_status('remove', $this->post_user_id);\n\n\t\t// Check if the topic is empty\n\t\t$flags = count::get_flags(access::TEAM_LEVEL, true, true);\n\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t{\n\t\t\t$this->topic->delete();\n\t\t}\n\t}", "public function deleted_post($post_id)\n {\n }", "public function unPublish($post_id)\n\t{\n\t\t$q = \"UPDATE in_posts \";\n\t\t$q .= \"SET publish_flag=0 WHERE id=:post_id\";\n\t\t$vars = array(\n\t\t\t':post_id'=>$post_id\n\t\t);\n\t\t//$this->logger->logInfo($q);\n\t\t$ps = $this->execute($q, $vars);\n\t}", "function tiny_cache_post_transition( $new_status, $old_status, $post ) {\n\n // Post unpublished or published.\n if ( $old_status !== $new_status\n && ( 'publish' === $old_status || 'publish' === $new_status )\n ) {\n tiny_cache_delete_the_content( $post->ID );\n }\n}", "public function forceDeleted(Post $post)\n {\n }", "public function soft_delete($reason = '')\n\t{\n\t\tif ($this->post_deleted)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$this->post_deleted = titania::$time;\n\t\t$this->post_delete_user = phpbb::$user->data['user_id'];\n\t\t$this->post_edit_reason = $reason;\n\n\t\t// Update the postcount for the topic\n\t\t$this->update_topic_postcount();\n\n\t\t// Set the visibility appropriately if no posts are visibile to the public/authors\n\t\t$flags = count::get_flags(access::PUBLIC_LEVEL);\n\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t{\n\t\t\t// There are no posts visible to the public, change it to authors level access\n\t\t\t$this->topic->topic_access = access::AUTHOR_LEVEL;\n\n\t\t\t$flags = count::get_flags(access::AUTHOR_LEVEL);\n\t\t\tif (count::from_db($this->topic->topic_posts, $flags) <= 0)\n\t\t\t{\n\t\t\t\t// There are no posts visible to authors, change it to teams level access\n\t\t\t\t$this->topic->topic_access = access::TEAM_LEVEL;\n\t\t\t}\n\t\t}\n\n\t\t// Sync the first topic post if required\n\t\tif ($this->post_id == $this->topic->topic_first_post_id)\n\t\t{\n\t\t\t$this->topic->sync_first_post($this->post_id);\n\t\t}\n\n\t\t// Sync the last topic post if required\n\t\tif ($this->post_id == $this->topic->topic_last_post_id)\n\t\t{\n\t\t\t$this->topic->sync_last_post($this->post_id);\n\t\t}\n\n\t\t// Submit the topic to store the updated information\n\t\t$this->topic->submit();\n\n\t\tparent::submit();\n\n\t\t// Update topics posted table\n\t\t$this->topic->update_posted_status('remove', $this->post_user_id);\n\n\t\t// Decrement the user's postcount if we must\n\t\tif ($this->post_approved && in_array($this->post_type, titania::$config->increment_postcount))\n\t\t{\n\t\t\tphpbb::update_user_postcount($this->post_user_id, '-');\n\t\t}\n\t}", "function soft_delete_posts()\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($this->soft_delete['p']))\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'post_deleted'\t\t\t=> $user->data['user_id'],\r\n\t\t\t\t'post_deleted_time'\t\t=> time(),\r\n\t\t\t);\r\n\t\t\t$sql = 'UPDATE ' . POSTS_TABLE . '\r\n\t\t\t\tSET ' . $db->sql_build_array('UPDATE', $sql_data) . '\r\n\t\t\t\t\tWHERE ' . $db->sql_in_set('post_id', $this->soft_delete['p']);\r\n\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\t// Update the search index to remove any posts we have soft deleted\r\n\t\t\t$this->update_search_index($this->soft_delete['p'], true);\r\n\r\n\t\t\tforeach ($this->soft_delete['p'] as $id)\r\n\t\t\t{\r\n\t\t\t\t$topic_id = intval($this->post_data[$id]['topic_id']);\r\n\t\t\t\t$forum_id = intval($this->post_data[$id]['forum_id']);\r\n\r\n\t\t\t\t// Update the first/last topic info if we must\r\n\t\t\t\tif (($this->topic_data[$topic_id]['topic_first_post_id'] == $id && $this->topic_data[$topic_id]['topic_last_post_id'] == $id) || ($this->topic_data[$topic_id]['topic_deleted_reply_count'] == ($this->topic_data[$topic_id]['topic_replies_real'])))\r\n\t\t\t\t{\r\n\t\t\t\t\t// Since we are deleting the only post left we shall soft delete the topic\r\n\t\t\t\t\t$this->soft_delete['t'][] = $topic_id;\r\n\r\n\t\t\t\t\tif ($this->topic_data[$topic_id]['topic_poster'] != $user->data['user_id'])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tadd_log('mod', $forum_id, $topic_id, 'LOG_SOFT_DELETE_TOPIC', $this->topic_data[$topic_id]['topic_title']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// Update the first or last post if we have to.\r\n\t\t\t\t\tif ($this->topic_data[$topic_id]['topic_first_post_id'] == $id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->update_first_post_topic($topic_id);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($this->topic_data[$topic_id]['topic_last_post_id'] == $id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->update_last_post_topic($topic_id);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ($this->post_data[$id]['poster_id'] != $user->data['user_id'])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tadd_log('mod', $forum_id, $topic_id, 'LOG_SOFT_DELETE_POST', $this->post_data[$id]['post_subject']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Fix post reported\r\n\t\t\t\tif ($this->post_data[$id]['post_reported'])\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql = 'UPDATE ' . POSTS_TABLE . '\r\n\t\t\t\t\t\tSET post_reported = 0\r\n\t\t\t\t\t\t\tWHERE post_id = ' . $id;\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\t\t\t$this->post_data[$id]['post_reported'] = 0;\r\n\r\n\t\t\t\t\t$some_reported = false;\r\n\t\t\t\t\t$sql = 'SELECT post_reported FROM ' . POSTS_TABLE . '\r\n\t\t\t\t\t\tWHERE topic_id = ' . $topic_id;\r\n\t\t\t\t\t$result = $db->sql_query($sql);\r\n\t\t\t\t\twhile ($row = $db->sql_fetchrow($result))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($row['post_reported'])\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$some_reported = true;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$db->sql_freeresult($result);\r\n\r\n\t\t\t\t\t// If none of the posts in this topic are reported anymore, reset it for the topic\r\n\t\t\t\t\tif (!$some_reported)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\t\t\t\tSET topic_reported = 0\r\n\t\t\t\t\t\t\t\tWHERE topic_id = ' . $topic_id;\r\n\t\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Update the deleted reply count for the topic\r\n\t\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\t\tSET topic_deleted_reply_count = topic_deleted_reply_count + 1\r\n\t\t\t\t\t\tWHERE topic_id = ' . $topic_id;\r\n\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t$this->topic_data[$topic_id]['topic_deleted_reply_count']++;\r\n\r\n\t\t\t\t// Update the deleted reply count for the shadow topics\r\n\t\t\t\tif (array_key_exists($topic_id, $this->shadow_topic_ids))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\t\t\tSET topic_deleted_reply_count = topic_deleted_reply_count + 1\r\n\t\t\t\t\t\t\tWHERE topic_id = ' . intval($this->shadow_topic_ids[$topic_id]);\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t\t$this->topic_data[$this->shadow_topic_ids[$topic_id]]['topic_deleted_reply_count']++;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If the topic is a global announcement, do not attempt to do any updates to forums\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_type'] != POST_GLOBAL)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Update the deleted reply count for the forum\r\n\t\t\t\t\t$sql = 'UPDATE ' . FORUMS_TABLE . '\r\n\t\t\t\t\t\tSET forum_deleted_reply_count = forum_deleted_reply_count + 1\r\n\t\t\t\t\t\t\tWHERE forum_id = ' . $forum_id;\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t\t$this->forum_data[$forum_id]['forum_deleted_reply_count']++;\r\n\r\n\t\t\t\t\t// Update the last post info for the forum if we must\r\n\t\t\t\t\tif ($this->forum_data[$forum_id]['forum_last_post_id'] == $id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->update_last_post_forum($forum_id);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (array_key_exists($topic_id, $this->shadow_topic_ids))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($this->forum_data[$this->topic_data[$this->shadow_topic_ids[$topic_id]]['forum_id']]['forum_last_post_id'] == $id)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->update_last_post_forum($this->topic_data[$this->shadow_topic_ids[$topic_id]]['forum_id']);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Soft delete the topics\r\n\t\t\t$this->soft_delete_topics();\r\n\t\t}\r\n\t}", "public function forceDeleted(Post $post)\n {\n //\n }", "public function forceDeleted(Post $post)\n {\n //\n }", "function rssmi_delete_feed_post_admin()\n{\n rssmi_delete_posts_admin();\n}", "function block_core_calendar_update_has_published_posts()\n {\n }", "public function handle_deletion_cache( $post_id ) {\n\t\tif ( get_post_status( $post_id ) !== 'publish' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::$cache_trigger_url = get_permalink( $post_id );\n\t\tself::$status_before = 'publish';\n\t\tself::$status_after = 'delete';\n\t\tself::$suppress_notification = true;\n\t\tself::$which_cloudflare_method = __METHOD__;\n\n\t\tself::purge_cloudflare_cache();\n\t}", "public function postUnpublish(Post $post)\n {\n $this->postRepository->postUnpublished($post);\n return redirect(config('blog.prefix', 'admin/blog') . '/' . 'post');\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "public function deleted(Post $post)\n {\n //\n $this->postElasticSearch->deleteDoc($post->id);\n }", "public function handleFutureToPublish($post) {\n if (\"publish\" == $post->post_status) {\n $this->indexPost($post->ID);\n }\n }", "function unpublish() {\n\t\tif (! $this->id) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->saveField('is_published', 0);\n\t}", "public function unpublish_content() {\n\t\tglobal $_wp_post_type_features;\n\n\t\t$post_types = array();\n\t\tforeach ( $_wp_post_type_features as $post_type => $features ) {\n\t\t\tif ( ! empty( $features[ self::$supports_key ] ) ) {\n\t\t\t\t$post_types[] = $post_type;\n\t\t\t}\n\t\t}\n\n\t\t$args = array(\n\t\t\t'fields' => 'ids',\n\t\t\t'post_type' => $post_types,\n\t\t\t'post_status' => 'any',\n\t\t\t'posts_per_page' => 40,\n\t\t\t'meta_query' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'meta_key' => self::$post_meta_key,\n\t\t\t\t\t'meta_value' => current_time( 'timestamp' ),\n\t\t\t\t\t'compare' => '<',\n\t\t\t\t\t'type' => 'NUMERIC',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'meta_key' => self::$post_meta_key,\n\t\t\t\t\t'meta_value' => current_time( 'timestamp' ),\n\t\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$query = new WP_Query( $args );\n\n\t\tif ( $query->have_posts() ) {\n\t\t\tforeach ( $query->posts as $post_id ) {\n\t\t\t\twp_trash_post( $post_id );\n\t\t\t}\n\t\t} else {\n\t\t\t// There are no posts scheduled to unpublish, we can safely remove the old cron.\n\t\t\twp_clear_scheduled_hook( self::$deprecated_cron_key );\n\t\t}\n\t}", "function _update_blog_date_on_post_delete( $post_id ) {\n\t$post = get_post( $post_id );\n\n\t$post_type_obj = get_post_type_object( $post->post_type );\n\tif ( ! $post_type_obj || ! $post_type_obj->public ) {\n\t\treturn;\n\t}\n\n\tif ( 'publish' != $post->post_status ) {\n\t\treturn;\n\t}\n\n\twpmu_update_blogs_date();\n}", "public function purge_post_data() {\n\n if ( current_user_can( 'delete_posts' ) )\n add_action( 'delete_post', array( $this, 'purge_post' ) );\n\n }", "function wp_idolondemand_delete_post()\n{\n}", "public function delete($post_id) {\n //get user id.\n if (!isset($user_id)) {\n $user_id = $this->Session->read('Auth.User.id');\n }\n //check if is any\n $conditions = array('id' => $post_id, 'uid' => $user_id);\n if ($this->SocialPosts->hasAny($conditions)) {\n $delete_update['SocialPosts']['id'] = $post_id;\n $delete_update['SocialPosts']['deleted'] = 1;\n //remove post from everywhere \n if ($this->SocialPosts->save($delete_update)) {\n //check if any scheduled\n $cond = array('post_id' => $post_id);\n if ($this->SocialScheduled->hasAny($cond)) {\n $delete = array('post_id' => $post_id);\n //remove scheduled\n $this->SocialScheduled->deleteAll($delete);\n }\n $this->Session->setFlash(__(\"Post Succesfully Removed.\"), 'cake-success');\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__(\"Something Went Wrong! Please try again later.\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n } else {\n //hmmm somebody sending http requests trying to delete posts?!\n $this->Session->setFlash(__(\"You are not authorized to perform this operation!\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n }", "public function delete() {\n\t\t$query = new WP_Query( array(\n\t\t\t'name' => $this->params['post_name'],\n\t\t\t'post_type' => $this->params['post_type']\n\t\t) );\n\n\t\t$post = array_shift( $query->posts );\n\n\t\t// die('<pre>'.var_export($post,true).'</pre>');\n\n\t\tif ( $post ) {\n\t\t\t$current_action = $this->get_current_action();\n\t\t\t$this->action_results[ 'status' ] = 'success';\n\t\t\t$this->action_results[ 'messages' ][ $post->post_type ][ $post->ID ][ 'note' ] = __( 'The information has been deleted', 'kickpress' );\n\t\t\t$this->action_results[ 'data' ][ 'post_id' ] = $post->ID;\n\n\t\t\twp_trash_post( $post->ID );\n\t\t}\n\t}", "function undelete_posts()\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($this->undelete['p']))\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'post_deleted'\t\t\t=> 0,\r\n\t\t\t\t'post_deleted_time'\t\t=> 0,\r\n\t\t\t);\r\n\t\t\t$sql = 'UPDATE ' . POSTS_TABLE . '\r\n\t\t\t\tSET ' . $db->sql_build_array('UPDATE', $sql_data) . '\r\n\t\t\t\t\tWHERE ' . $db->sql_in_set('post_id', $this->undelete['p']);\r\n\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\t// Add the post info to the search index since we are undeleting it\r\n\t\t\t$this->update_search_index($this->undelete['p'], false);\r\n\r\n\t\t\tforeach ($this->undelete['p'] as $id)\r\n\t\t\t{\r\n\t\t\t\t$topic_id = intval($this->post_data[$id]['topic_id']);\r\n\t\t\t\t$forum_id = intval($this->post_data[$id]['forum_id']);\r\n\r\n\t\t\t\t// Update the first/last topic info if we must\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_deleted'] != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Since the topic was deleted, undelete it\r\n\t\t\t\t\t$this->undelete['t'][] = $topic_id;\r\n\r\n\t\t\t\t\tif ($this->topic_data[$topic_id]['topic_poster'] != $user->data['user_id'])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tadd_log('mod', $forum_id, $topic_id, 'LOG_UNDELETE_TOPIC', $this->topic_data[$topic_id]['topic_title']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($this->post_data[$id]['poster_id'] != $user->data['user_id'])\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tadd_log('mod', $forum_id, $topic_id, 'LOG_UNDELETE_POST', $this->post_data[$id]['post_subject']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_first_post_id'] > $id)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->update_first_post_topic($topic_id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_last_post_id'] < $id)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->update_last_post_topic($topic_id);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\t\tSET topic_deleted_reply_count = topic_deleted_reply_count - 1\r\n\t\t\t\t\t\tWHERE topic_id = ' . $topic_id;\r\n\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t$this->topic_data[$topic_id]['topic_deleted_reply_count']--;\r\n\r\n\t\t\t\t// If there is a shadow topic, we will update it too.\r\n\t\t\t\tif (array_key_exists($topic_id, $this->shadow_topic_ids))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\t\t\tSET topic_deleted_reply_count = topic_deleted_reply_count - 1\r\n\t\t\t\t\t\t\tWHERE topic_id = ' . intval($this->shadow_topic_ids[$topic_id]);\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\t\t\t$this->topic_data[$this->shadow_topic_ids[$topic_id]]['topic_deleted_reply_count']--;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If the topic is a global announcement, do not attempt to do any updates to forums\r\n\t\t\t\tif ($this->topic_data[$topic_id]['topic_type'] != POST_GLOBAL)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Update the last post info for the forum if we must\r\n\t\t\t\t\tif ($this->forum_data[$forum_id]['forum_last_post_id'] < $id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->update_last_post_forum($forum_id);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (array_key_exists($topic_id, $this->shadow_topic_ids))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($this->forum_data[$this->topic_data[$this->shadow_topic_ids[$topic_id]]['forum_id']]['forum_last_post_id'] == $id)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->update_last_post_forum($this->topic_data[$this->shadow_topic_ids[$topic_id]]['forum_id']);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$sql = 'UPDATE ' . FORUMS_TABLE . '\r\n\t\t\t\t\t\tSET forum_deleted_reply_count = forum_deleted_reply_count - 1\r\n\t\t\t\t\t\t\tWHERE forum_id = ' . $forum_id;\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t\t$this->forum_data[$forum_id]['forum_deleted_reply_count']--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Undelete the topics\r\n\t\t\t$this->undelete_topics();\r\n\t\t}\r\n\t}", "public function kiwip_action_delete_revisions(){\n\t\tglobal $wpdb;\n\n\t\t$this->delete_revision = $wpdb->query('DELETE FROM wp_posts WHERE post_type = \"revision\";');\n\n\t\tadd_action('admin_notices', array(&$this, 'kiwip_action_delete_revisions_adm_msg'));\n\t\t$updated_option = array('delete_revisions' => 0);\n\t\tupdate_option('Kiwip', $updated_option);\n\t\t$this->options['delete_revisions'] == 0;\n\t}", "public function isDeleted() {}", "public function isDeleted() {}", "public function pre_schedule_delete_content( $post_id ) {\n\t\t$delete_pushed_posts = !empty( $this->push_syndicate_settings[ 'delete_pushed_posts' ] ) ? $this->push_syndicate_settings[ 'delete_pushed_posts' ] : 'off' ;\n\t\tif( $delete_pushed_posts != 'on' )\n\t\t\treturn;\n\n\t\tif( !$this->current_user_can_syndicate() )\n\t\t\treturn;\n\n\t\tdo_action( 'syn_schedule_delete_content', $post_id );\n\t}", "public function unpublish_expired_posts() {\n $expired_posts = $this->get_expired_posts();\n foreach ( $expired_posts as $expired_post ) {\n // Only automatically unpublish if the corresponding option is enabled for this post\n if ( $expired_post->bbx_best_before_unpublish_when_expired ) {\n // Set post to draft\n wp_update_post(\n array(\n 'ID' => $expired_post->ID,\n 'post_status' => 'draft'\n )\n );\n }\n }\n }", "function xgb_check_post_count($post_id) {\n\tglobal $wpdb;\n\t\n\t$post = get_post($post_id);\n\t$author_id = $post->post_author;\n\t$user_info = get_userdata(get_current_user_id());\n\t\n\t\t$published_post_count = $wpdb->get_var(\"SELECT COUNT(ID) FROM wp_posts WHERE post_status='publish' AND post_type='post' AND post_author=$author_id\");\n\t\tif($published_post_count > $GLOBALS['live_article_limit'] ) {\n\t\t\t$wpdb->query(\"UPDATE wp_posts SET post_status='pending' WHERE ID=$post_id\");\n\t\t\t// Set the transient for admin notice\n\t\t\tset_transient( get_current_user_id().'publisherror', $GLOBALS['live_article_limit'] ); \n\t\t}\n}", "function my_callback_delete_post( $result ) {\n\twp_delete_post( $result->ID, true );\n}", "public function get_deleted_posts() {\n\t\treturn $this->deleted_posts;\n\t}", "public function handleTransitionPostStatus($newStatus, $oldStatus, $post)\n {\n if (\"publish\" == $oldStatus && \"publish\" != $newStatus) {\n $this->deletePost($post->ID);\n }\n }", "public function deleteAction() {\n\t\t// if($post->delete()) {\n\t\t// \tSession::message([\"Post <strong>$post->name</strong> deleted!\" , \"success\"]);\n\t\t// \tredirect_to('/posts/index');\n\t\t// } else {\n\t\t// \tSession::message([\"Error saving! \" . $error->get_errors() , \"success\"]);\n\t\t// }\n\t}", "public function destroy(Post $post)\n {\n $post->delete();\n return ['message'=>'Deleted successfully'];\n }", "function user_can_delete_post($user_id, $post_id, $blog_id = 1)\n {\n }", "protected function check_delete_permission($post)\n {\n }", "protected function _postDelete()\n\t{\n\t}", "function _update_blog_date_on_post_delete($post_id)\n {\n }", "public function deleted(Post $post)\n {\n Category::where('id', $post->category)\n ->where('num', '>', 0)->decrement('num');\n Tag::whereIn('id', explode(',', $post->tags))\n ->where('num', '>', 0)->decrement('num');\n Archive::where('month', $post->archive)->where('num', '>', 0)->decrement('num');\n Archive::where('num', 0)->forceDelete();\n }", "function iron_delete_post ( $post_id ) {\n\tglobal $wpdb;\n\n\tif ( $post = $wpdb->get_row($wpdb->prepare(\"SELECT * FROM $wpdb->posts WHERE ID = %d\", $post_id)) )\n\t{\n\t\tif ( 'page' == $post->post_type) {\n\t\t\t// if the page is defined in option page_on_front or post_for_posts,\n\t\t\t// adjust the corresponding options\n\t\t\tif ( get_iron_option('page_for_albums') == $post_id ) {\n\t\t\t\treset_iron_option('page_for_albums');\n\t\t\t}\n\t\t\tif ( get_iron_option('page_for_events') == $post_id ) {\n\t\t\t\treset_iron_option('page_for_events');\n\t\t\t}\n\t\t\tif ( get_iron_option('page_for_videos') == $post_id ) {\n\t\t\t\treset_iron_option('page_for_videos');\n\t\t\t}\n\t\t\tif ( get_iron_option('page_for_photos') == $post_id ) {\n\t\t\t\treset_iron_option('page_for_photos');\n\t\t\t}\n\t\t}\n\t}\n}", "public function deleteAction() {\n\n //GET POST SUBJECT\n $post = Engine_Api::_()->core()->getSubject('sitereview_post');\n\n //GET LISTING SUBJECT\n $sitereview = $post->getParent('sitereview_listing');\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n if (!$sitereview->isOwner($viewer) && !$post->isOwner($viewer)) {\n return $this->_helper->requireAuth->forward();\n }\n\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, null, \"view_listtype_$sitereview->listingtype_id\")->isValid())\n return;\n\n //MAKE FORM\n $this->view->form = $form = new Sitereview_Form_Post_Delete();\n\n //CHECK METHOD\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n //FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n //PROCESS\n $table = Engine_Api::_()->getDbTable('posts', 'sitereview');\n $db = $table->getAdapter();\n $db->beginTransaction();\n $topic_id = $post->topic_id;\n try {\n $post->delete();\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n //GET TOPIC\n $topic = Engine_Api::_()->getItem('sitereview_topic', $topic_id);\n\n $href = ( null == $topic ? $sitereview->getHref() : $topic->getHref() );\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'closeSmoothbox' => true,\n 'parentRedirect' => $href,\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Post deleted.')),\n ));\n }", "protected function onDelete() {\n\t\tif (!$this->post = $this->loadPost()) {\n\t\t\treturn null;\n\t\t}\n\t\t$this->post->delete();\n\t\t// $this->onRun();\n\t\treturn Redirect(Request::url());\n\t}", "public function isDeleted();", "public function isDeleted();", "public function handleRestUpdatePost($post)\n {\n if (\"publish\" == $post->post_status) {\n $this->indexPost($post->ID);\n }\n }", "public function deletePosts($postIds) {\n if (empty($postIds) || ! is_array($postIds)) {\n Template::set_message('No ha seleccionado ningún registro para eliminar.', 'error');\n return false;\n }\n\n // Only allow users with the correct permission to delete posts\n $this->auth->restrict('Bonfire.Blog.Delete');\n\n // Track any failures while deleting the selected posts.\n $failed = 0;\n foreach ($postIds as $postId) {\n $result = $this->post_model->delete($postId);\n if (! $result) {\n ++$failed;\n }\n }\n\n $result = false;\n if ($failed) {\n Template::set_message(\"Hubo un problema al eliminar {$failed} publicacion(es): {$this->post_model->error}\", 'error');\n } else {\n Template::set_message(count($postIds) . ' publicacion(es) eliminada(s)', 'success');\n $result = true;\n }\n\n // if any tickets were deleted, log the activity.\n if ((count($postIds) - $failed) > 0) {\n log_activity(\n $this->auth->user_id(),\n 'eliminó ' . count($postIds) . ' publicacion(es) : ' . $this->input->ip_address(),\n 'blog'\n );\n }\n\n return $result;\n }", "public function publishPost($POST) {\r\n\t\t$sql = 'UPDATE `posts` SET `post_status` = :post_status\r\n\t\t\t\tWHERE `ID` = :ID AND `post_author` = :post_author LIMIT 1';\r\n\t\t$sth = $this->db->prepare($sql);\r\n\r\n\t\t$ret = $sth->execute(array('ID' => $POST['id'],\r\n\t\t\t\t\t\t\t\t 'post_author' => $GLOBALS['user']['id'],\r\n\t\t\t\t\t\t\t\t 'post_status' => 'publish'));\r\n\r\n\t\tif ($ret) {\r\n\t\t\t$this->putMsg('Successfully published');\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "public function destroy(post $post)\n {\n //\n }", "public function update_topic_postcount($hard_delete = false)\n\t{\n\t\t// shouldn't need to load through load() to delete it...\n\t\tif ($hard_delete && empty($this->sql_data))\n\t\t{\n\t\t\t$this->sql_data = $this->__get_array();\n\t\t}\n\n\t\tif ($this->post_id && empty($this->sql_data))\n\t\t{\n\t\t\tthrow new exception('Modifying a post requires you load it through the load() function (we require the original information).');\n\t\t}\n\n\t\t// Get the current count\n\t\t$to_db = count::from_db($this->topic->topic_posts, false);\n\n\t\t// Revert the old count from this post\n\t\tif ($this->post_id)\n\t\t{\n\t\t\tif ($this->sql_data['post_deleted'] != 0)\n\t\t\t{\n\t\t\t\t$to_db['deleted']--;\n\t\t\t}\n\t\t\telse if (!$this->sql_data['post_approved'])\n\t\t\t{\n\t\t\t\t$to_db['unapproved']--;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tswitch ($this->sql_data['post_access'])\n\t\t\t\t{\n\t\t\t\t\tcase access::PUBLIC_LEVEL :\n\t\t\t\t\t\t$to_db['public']--;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase access::AUTHOR_LEVEL :\n\t\t\t\t\t\t$to_db['authors']--;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase access::TEAM_LEVEL :\n\t\t\t\t\t\t$to_db['teams']--;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Then recount those options for this post if we are not hard deleting it.\n\t\tif (!$hard_delete)\n\t\t{\n\t\t\tif ($this->post_deleted != 0)\n\t\t\t{\n\t\t\t\t$to_db['deleted']++;\n\t\t\t}\n\t\t\telse if (!$this->post_approved)\n\t\t\t{\n\t\t\t\t$to_db['unapproved']++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tswitch ($this->post_access)\n\t\t\t\t{\n\t\t\t\t\tcase access::PUBLIC_LEVEL :\n\t\t\t\t\t\t$to_db['public']++;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase access::AUTHOR_LEVEL :\n\t\t\t\t\t\t$to_db['authors']++;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase access::TEAM_LEVEL :\n\t\t\t\t\t\t$to_db['teams']++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update the field on the topic\n\t\t$this->topic->topic_posts = count::to_db($to_db);\n\t}", "protected function onDeleted()\n {\n return true;\n }", "private function deletePost() {\n\t\tif( !isset($_SESSION['id']) ) {\n\t\t\treturn;\n\t\t}\n\t\t// Make sure the user owns this post\n\t\t$postID = $this->dbc->real_escape_string($_GET['postid']);\n\t\t$userID = $_SESSION['id'];\n\t\t$privilege = $_SESSION['privilege'];\n\t\t\n\t\t// If the user is not an admin\n\t\tif( $privilege != 'admin' ) {\n\t\t\t$sql .= \" AND user_id = $userID\";\n\t\t}\n\t\t// Run this query\n\t\t$result = $this->dbc->query($sql);\n\t\t// If the query failed\n\t\t// Either post doesn't exist, or you don't own the post\n\t\tif( !$result || $result->num_rows == 0 ) {\n\t\t\treturn;\n\t\t}\n\t\t$result = $result->fetch_assoc();\n\t\t\n\t\t// Prepare the SQL\n\t\t$sql = \"DELETE FROM posts\n\t\t\t\tWHERE id = $postID\";\n\t\t// Run the query\n\t\t$this->dbc->query($sql);\n\t\t// Redirect the user back to blog\n\t\t// This post is dead :(\n\t\theader('Location: index.php?page=blog');\n\t\tdie();\n\t}", "function deleteProjectPosts()\n\t\t{\n\t\t\t$this->load->model('User_model');\n\t\t\t$postID = $_POST[\"postID\"];\n\t\t\t\n\t\t\t$query = $this->User_model->DeleteProjectPostModel($postID);\n\t\t\tif($query)\n\t\t\t{\n\t\t\t\techo 'deleted';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 'not deleted';\n\t\t\t}\n\t\t}", "public function forceDeleted(BlogPost $modelsBlogPost)\n {\n //\n }", "function block_core_calendar_update_has_published_posts() {\n\tglobal $wpdb;\n\t$has_published_posts = (bool) $wpdb->get_var( \"SELECT 1 as test FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1\" );\n\tupdate_option( 'wp_calendar_block_has_published_posts', $has_published_posts );\n\treturn $has_published_posts;\n}", "protected function postDelete() {\n\t\treturn true;\n\t}", "protected function _afterDelete()\r\n {\r\n $this->updatePostCommentCount();\r\n parent::_afterDelete();\r\n\r\n }", "public function destroy(Post $post)\n {\n if($post->delete()) \n { \n return back()->with('success','Post was deleted');\n } \n else \n { \n return back()->with('error','there was a problem with deleting');\n }\n }", "public function untrashed_post($post_id)\n {\n }", "public function draft_publish()\n\t{\n\t\t$where = array(\n\t\t\t'parent_entry_id' => $this->settings['entry_id'],\n\t\t\t'parent_is_draft' => 0\n\t\t);\n\t\t$this->EE->db->where($where)->delete('playa_relationships');\n\n\t\t$where['parent_is_draft'] = 1;\n\t\t$update = array('parent_is_draft' => 0);\n\t\t$this->EE->db->where($where)->update('playa_relationships', $update);\n\n\t\treturn;\n\t}", "function wpachievements_wordpress_post_del($pid){\r\n if( !empty($pid) ){\r\n $pdata = get_post($pid);\r\n if( $pdata->post_author && $pdata->post_status == 'trash' && $pdata->post_type == 'post' ){\r\n $type='post_remove'; $uid=$pdata->post_author; $postid=$pid;\r\n if( !function_exists(WPACHIEVEMENTS_CUBEPOINTS) && !function_exists(WPACHIEVEMENTS_MYCRED) ){\r\n if(function_exists('is_multisite') && is_multisite()){\r\n $points = (int)get_blog_option(1, 'wpachievements_post_points');\r\n } else{\r\n $points = (int)get_option('wpachievements_post_points');\r\n }\r\n }\r\n if(empty($points)){$points=0;}\r\n wpachievements_new_activity($type, $uid, $postid, -$points);\r\n }\r\n }\r\n }", "public function destroy(Post $post)\n {\n if (! Gate::allows('admin-post', $post)) {\n abort(403);\n }\n\n $post->delete();\n\n return redirect()->route('dashboard')->with('success', 'Votre post a bien été supprimé');\n }", "public function deleted(BlogPost $blogPost)\n\t{\n\t\t//\n\t}", "public function toggle_published() {\n $will_be_published = !$this->post->is_published();\n $this->post->toggle_published();\n redirect(\n '/backend/posts/edit',\n ['notice' => $will_be_published ? 'Published' : 'Unpublished'],\n ['id' => $this->post->id]\n );\n }", "public static function action_before_delete_post( $post_id ) {\n\t\t$post = get_post( $post_id );\n\t\tself::purge_post_with_related( $post );\n\t}", "public function deleteActionPost(): object\n {\n // Connects to db\n $this->app->db->connect();\n\n $contentId = getPost(\"contentId\");\n\n if (!is_numeric($contentId)) {\n return $this->app->response->redirect(\"admin\");\n }\n\n if (hasKeyPost(\"doDelete\")) {\n $contentId = getPost(\"contentId\");\n\n // Executes SQL statement\n $this->admin->deleteBlogpost($contentId);\n\n // Redirects\n return $this->app->response->redirect(\"admin\");\n }\n }", "public function destroy(Request $request, Post $post)\n {\n try {\n $post->update(['updated_by' => Auth::user()->id]);\n $post->delete();\n }catch (\\Exception $exception){\n dd($exception->getMessage());\n }\n\n Session::flash('danger', 'پست مورد نظر با موفقیت پاک شد');\n\n if($request->header('referer') == URL::to('/posts/drafts')) {\n return redirect(route('posts.draft'));\n }\n\n return redirect(route('posts.index'));\n }", "public function doUnpublish() {\n\t\tif($this->Fields()) {\n\t\t\tforeach($this->Fields() as $field) {\n\t\t\t\t$field->doDeleteFromStage('Live');\n\t\t\t}\n\t\t}\n\t\t\n\t\tparent::doUnpublish();\n\t}", "function post_action_handler($post_id) {\n\t\tif ( current_filter() == 'delete_post' )\n\t\t\treturn $this->add_ping( 'db', array( 'post' => $post_id ), 'delete_post' );\n\t\treturn $this->add_ping( 'db', array( 'post' => $post_id ), 'edit_post' );\n\t}", "public function delete($post_id = NULL) {\n\t\t\n\t\t# Sanitize by ensuring $post_id is numeric \n\t\tif (is_numeric($post_id)) {\n\t\t\t\n\t\t\t# Ensure post to be deleted matches on post_id AND user_id of current user\n\t\t\t# to prevent users from altering URL to delete other people's posts\n\t\t\t$where_condition = \"WHERE\n\t\t\t\tuser_id = \".$this->user->user_id.\"\n\t\t\t\tAND post_id = \".$post_id;\n\t\t\t\t\n\t\t\tDB::instance(DB_NAME)->delete(\"posts\", $where_condition);\n\t\t\t\n\t\t\tRouter::redirect('/posts/stream/yours');\n\t\t}\n\t\telse {\n\t\t\tRouter::redirect('/posts/stream/yours');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "public function destroy(Post $post)\n {\n $post->delete();\n\n if (Auth::user()->admin && Auth::id() !== $post->user_id) {\n // if Post was deleted by an admin user, send notification to User who posted post\n $post->user->notify(new PostDeletedByAdmin());\n }\n\n return redirect()\n ->route('home')\n ->with('message', 'Post deleted.');\n }", "public function unpublish($id)\n\t{\n\t\t$data = array(\n\t\t\t\t\t\t'status' => 0\n\t\t\t\t\t );\n\n\t\t$result = $this->common_model->UpdateDB('blog_post',array('id' => $id),$data);\n\n\t\tif ($result) \n\t\t{\n\t\t\tset_flashdata('success','Post Status Changed to Unpublish');\n\t\t\tredirect('blog/posts/manage_posts','refresh');\n\t\t} \n\t}", "public function destroy(Post $post) {\n $this -> authorize('delete', $post); // this will throw an exception and render out status code 403\n $post -> delete();\n\n return back();\n }", "public function destroy($post_id)\n {\n\n }", "public function delete_post()\n\t{\n\t\t$this->form_validation->set_rules('PredraftContestID', 'PredraftContestID', 'trim|required|callback_validatePredraftContestID');\n\t\t$this->form_validation->validation($this); /* Run validation */\t\n\n\t\t/* Delete predraft contest Data */\n\t\tif($this->PredraftContest_model->deleteDraft($this->SessionUserID, $this->Post['PredraftContestID'])){\n\t\t\t$this->Return['Message'] =\t\"Draft deleted successfully.\"; \n\t\t}else{\n\t\t\t$this->Return['ResponseCode'] \t=\t500;\n\t\t\t$this->Return['Message'] \t=\t\"An error occurred, please try again later.\";\n\t\t}\n\t}", "public function destroy()\n {\n $posts = Post::where('published', 0)->get();\n\n foreach ($posts as $post) {\n $post->subscriptions->each(function ($subscription) {\n $subscription->delete();\n });\n }\n\n return redirect(route('admin.subscription.index'));\n }", "function wp_delete_post($postid = 0, $force_delete = \\false)\n {\n }", "function wp_delete_auto_drafts()\n {\n }", "function block_core_calendar_update_has_published_post_on_transition_post_status( $new_status, $old_status, $post ) {\n\t\tif ( $new_status === $old_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'post' !== get_post_type( $post ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'publish' !== $new_status && 'publish' !== $old_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tblock_core_calendar_update_has_published_posts();\n\t}", "public function destroy(Post $post)\n {\n //se hace referencia al Policy asociado al User\n $this->authorize('author', $post);\n\n $post->delete();\n return redirect()->route('admin.posts.index')->with('info', 'El Post se elimino con exito'); \n }", "public function destroy(Post $post) {\n //\n }", "public function onAfterUnpublish() {\n $this->doDeleteDocumentIfInSearch();\n }", "function deletePost($postId){\n global $conn;\n\n $sql = \"UPDATE `post` SET `deleted`= 1 WHERE `postId`= '$postId'\";\n mysqli_query($conn, $sql);\n}", "function wp_delete_post_revision($revision)\n {\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }" ]
[ "0.773004", "0.682745", "0.6758581", "0.6699654", "0.667032", "0.66587025", "0.6580085", "0.650539", "0.6482737", "0.6432054", "0.64120334", "0.6399164", "0.63894546", "0.63894546", "0.63547784", "0.62989587", "0.62572336", "0.61983925", "0.61899203", "0.6188232", "0.6187405", "0.6183923", "0.61667264", "0.6112356", "0.6107628", "0.6097938", "0.60798144", "0.6044259", "0.60423064", "0.6038652", "0.6027241", "0.60103077", "0.6010252", "0.60081255", "0.59984094", "0.5998177", "0.5994579", "0.599066", "0.5983341", "0.5982824", "0.59819275", "0.59811836", "0.5969374", "0.59451103", "0.5925512", "0.59227777", "0.5898985", "0.58989507", "0.58868617", "0.5879384", "0.5879384", "0.58787817", "0.58760595", "0.5873478", "0.5870671", "0.5866761", "0.58664227", "0.5866225", "0.58642507", "0.58551335", "0.58516914", "0.58458596", "0.5841723", "0.58324045", "0.5827232", "0.582716", "0.5819849", "0.5813621", "0.5807739", "0.57996434", "0.57929593", "0.57876265", "0.5778593", "0.5762037", "0.5759328", "0.5757814", "0.5752587", "0.57480663", "0.574685", "0.57405365", "0.57310236", "0.5728569", "0.5723155", "0.57155484", "0.57150847", "0.57146555", "0.571311", "0.5712809", "0.5700106", "0.5698663", "0.56961906", "0.56961906", "0.56961906", "0.56961906", "0.56961906", "0.56961906", "0.56961906", "0.56961906", "0.56961906", "0.56961906" ]
0.75024563
1
Handler for updating the has published posts flag when a post status changes.
function block_core_calendar_update_has_published_post_on_transition_post_status( $new_status, $old_status, $post ) { if ( $new_status === $old_status ) { return; } if ( 'post' !== get_post_type( $post ) ) { return; } if ( 'publish' !== $new_status && 'publish' !== $old_status ) { return; } block_core_calendar_update_has_published_posts(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function block_core_calendar_update_has_published_post_on_transition_post_status($new_status, $old_status, $post)\n {\n }", "function block_core_calendar_update_has_published_posts()\n {\n }", "public function publishPost($POST) {\r\n\t\t$sql = 'UPDATE `posts` SET `post_status` = :post_status\r\n\t\t\t\tWHERE `ID` = :ID AND `post_author` = :post_author LIMIT 1';\r\n\t\t$sth = $this->db->prepare($sql);\r\n\r\n\t\t$ret = $sth->execute(array('ID' => $POST['id'],\r\n\t\t\t\t\t\t\t\t 'post_author' => $GLOBALS['user']['id'],\r\n\t\t\t\t\t\t\t\t 'post_status' => 'publish'));\r\n\r\n\t\tif ($ret) {\r\n\t\t\t$this->putMsg('Successfully published');\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "function _update_posts_count_on_transition_post_status( $new_status, $old_status, $post = null ) {\n\tif ( $new_status === $old_status ) {\n\t\treturn;\n\t}\n\n\tif ( 'post' !== get_post_type( $post ) ) {\n\t\treturn;\n\t}\n\n\tif ( 'publish' !== $new_status && 'publish' !== $old_status ) {\n\t\treturn;\n\t}\n\n\tupdate_posts_count();\n}", "function _update_blog_date_on_post_publish( $new_status, $old_status, $post ) {\n\t$post_type_obj = get_post_type_object( $post->post_type );\n\tif ( ! $post_type_obj || ! $post_type_obj->public ) {\n\t\treturn;\n\t}\n\n\tif ( 'publish' != $new_status && 'publish' != $old_status ) {\n\t\treturn;\n\t}\n\n\t// Post was freshly published, published post was saved, or published post was unpublished.\n\n\twpmu_update_blogs_date();\n}", "public function handleFutureToPublish($post) {\n if (\"publish\" == $post->post_status) {\n $this->indexPost($post->ID);\n }\n }", "function _update_blog_date_on_post_publish($new_status, $old_status, $post)\n {\n }", "function block_core_calendar_update_has_published_posts() {\n\tglobal $wpdb;\n\t$has_published_posts = (bool) $wpdb->get_var( \"SELECT 1 as test FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1\" );\n\tupdate_option( 'wp_calendar_block_has_published_posts', $has_published_posts );\n\treturn $has_published_posts;\n}", "function _update_posts_count_on_transition_post_status($new_status, $old_status, $post = \\null)\n {\n }", "public function acfPostObjectStatus($args, $field, $post_id)\n {\n $args['post_status'] = 'publish';\n return $args;\n }", "protected function _publish_status()\n\t{\n\t\t//$fields = $this->fields();\n\t\t$fields = $fields = array_keys($this->table_info()); // used to prevent an additional query that the fields() method would create\n\n\t\tif (in_array('published', $fields))\n\t\t{\n\t\t\tif (in_array('published', $this->boolean_fields))\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.published' => 1));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.published' => 'yes'));\n\t\t\t}\n\t\t}\n\n\t\tif (in_array('active', $fields))\n\t\t{\n\t\t\tif (in_array('active', $this->boolean_fields))\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.active' => 1));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where(array($this->table_name.'.active' => 'yes'));\n\t\t\t}\n\t\t}\n\n\t\tif (in_array('publish_date', $fields))\n\t\t{\n\t\t\t$this->db->where(array($this->table_name.'.publish_date <=' => datetime_now()));\n\t\t}\n\t}", "public function handleRestUpdatePost($post)\n {\n if (\"publish\" == $post->post_status) {\n $this->indexPost($post->ID);\n }\n }", "public function publish(Post $post)\n\t{\n\t\t$q = \"UPDATE in_posts \";\n\t\t$q .= \"SET publish_flag=1, read_length=:read_length, publish_time=Now() WHERE id=:post_id\";\n\t\t$vars = array(\n\t\t\t':read_length'=>$post->read_length,\n\t\t\t':post_id'=>$post->id\n\t\t);\n\t\t//$this->logger->logInfo($q);\n\t\t$ps = $this->execute($q, $vars);\n\t}", "public function postHandler($new_status, $old_status, $post)\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$post_title = $post->post_title;\n\n\t\t\t$thing = $thingdom->getThing($this->thingName, $this->thingType);\n\n\t\t\tif($post->post_type == 'post' && $this->settings['posts'] == 1 && ($new_status == 'publish' && $old_status != 'publish')) {\n\t\t\t\t$thing->feed('new_post', \"New post published: {$post_title}\");\n\t\t\t} else if($post->post_type == 'page' && $this->settings['pages'] == 1 && ($new_status == 'publish' && $old_status != 'publish')) {\n\t\t\t\t$thing->feed('new_page', \"New page published: {$post_title}\");\n\t\t\t} else if($post->post_type == 'post' && $this->settings['posts_update'] == 1 && ($new_status == 'publish' && $old_status == 'publish')) {\n\t\t\t\t$thing->feed('update_post', \"Post Updated: {$post_title}\");\n\t\t\t} else if($post->post_type == 'page' && $this->settings['pages_update'] == 1 && ($new_status == 'publish' && $old_status == 'publish')) {\n\t\t\t\t$thing->feed('update_page', \"Page Updated: {$post_title}\");\n\t\t\t}\n\t\t}", "public function maybe_notify_new_published_post( $new_status, $old_status, $post ) {\n\t\tif ( 'publish' != $new_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $old_status == $new_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $this->is_post_notifiable( $post, 'publish' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->notify_blog_post( $post, 'new' );\n\t}", "public function future_to_published($post) {\n\t\t\n\t\tdefine(\"WPU_JUST_POSTED_{$postID}\", TRUE);\n\t\t$this->handle_new_post($post->ID, $post, true);\n\t}", "public function isPublished()\n {\n return $this->postID > 0;\n }", "function block_core_calendar_update_has_published_post_on_delete( $post_id ) {\n\t\t$post = get_post( $post_id );\n\n\t\tif ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {\n\t\t\treturn;\n\t\t}\n\n\t\tblock_core_calendar_update_has_published_posts();\n\t}", "function block_core_calendar_has_published_posts()\n {\n }", "function check_and_publish_future_post($post)\n {\n }", "public function register_post_status() {\n\t\tif ( ! isset( $this->slug ) ) {\n\n\t\t\treturn;\n\t\t} elseif ( ! isset( $this->args ) ) {\n\t\t\t$this->args = $this->create_args();\n\t\t}\n\t\t$this->init();\n\t}", "function tiny_cache_post_transition( $new_status, $old_status, $post ) {\n\n // Post unpublished or published.\n if ( $old_status !== $new_status\n && ( 'publish' === $old_status || 'publish' === $new_status )\n ) {\n tiny_cache_delete_the_content( $post->ID );\n }\n}", "public function publish($id)\n\t{\n\t\t$data = array(\n\t\t\t\t\t\t'status' => 1\n\t\t\t\t\t );\n\n\t\t$result = $this->common_model->UpdateDB('blog_post',array('id' => $id),$data);\n\n\t\tif ($result) \n\t\t{\n\t\t\tset_flashdata('success','Post Status Changed to Publish');\n\t\t\tredirect('blog/posts/manage_posts','refresh');\n\t\t} \n\t}", "public function isPublished(): bool\n {\n $publishedStatus = ['publish'];\n\n return in_array($this->status, $publishedStatus);\n }", "public function publishedStatus()\n {\n if ( !$this->owner->getScheduledStatus() && !$this->owner->getExpiredStatus() ) {\n return true;\n }\n\n return false;\n }", "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}", "function xgb_check_post_count($post_id) {\n\tglobal $wpdb;\n\t\n\t$post = get_post($post_id);\n\t$author_id = $post->post_author;\n\t$user_info = get_userdata(get_current_user_id());\n\t\n\t\t$published_post_count = $wpdb->get_var(\"SELECT COUNT(ID) FROM wp_posts WHERE post_status='publish' AND post_type='post' AND post_author=$author_id\");\n\t\tif($published_post_count > $GLOBALS['live_article_limit'] ) {\n\t\t\t$wpdb->query(\"UPDATE wp_posts SET post_status='pending' WHERE ID=$post_id\");\n\t\t\t// Set the transient for admin notice\n\t\t\tset_transient( get_current_user_id().'publisherror', $GLOBALS['live_article_limit'] ); \n\t\t}\n}", "public function update_is_upcoming($post_id){\n global $post;\n if ($post->post_type == $this->slug) {\n $this->is_post_upcoming($post_id);\n }\n }", "public function toggle_published() {\n $will_be_published = !$this->post->is_published();\n $this->post->toggle_published();\n redirect(\n '/backend/posts/edit',\n ['notice' => $will_be_published ? 'Published' : 'Unpublished'],\n ['id' => $this->post->id]\n );\n }", "function block_core_calendar_update_has_published_post_on_delete($post_id)\n {\n }", "function _publish_post_hook($post_id)\n {\n }", "function _transition_post_status($new_status, $old_status, $post)\n {\n }", "function publish() {\n\t\tif (! $this->id) {\n\t\t\treturn false;\n\t\t}\n\t\t/* This method formerly updated the published_date, but that was removed in \n\t\t * favor of giving manual control of the published_date to the author\n\t\t * $this->saveField('published_date', date('Y-m-d', time()).' 00:00:00') */\n\t\treturn $this->saveField('is_published', 1);\n\t}", "public function post_publish()\n\t{\n\t\t$this->get_publish();\n\t}", "public function isPublished()\n {\n return $this->publish_status == Status::PUBLISHED;\n }", "function is_post_status_viewable($post_status)\n {\n }", "public function unPublish($post_id)\n\t{\n\t\t$q = \"UPDATE in_posts \";\n\t\t$q .= \"SET publish_flag=0 WHERE id=:post_id\";\n\t\t$vars = array(\n\t\t\t':post_id'=>$post_id\n\t\t);\n\t\t//$this->logger->logInfo($q);\n\t\t$ps = $this->execute($q, $vars);\n\t}", "public static function action_transition_post_status( $new_status, $old_status, $post ) {\n\t\tif ( 'publish' !== $new_status && 'publish' !== $old_status ) {\n\t\t\treturn;\n\t\t}\n\t\tself::purge_post_with_related( $post );\n\t}", "function _sf_send_user_publish_note($new_status, $old_status, $post) {\n\t\tif($post->post_type == 'spot') {\n\t\t\t\n\t\t\t$user = get_user_by('id', $post->post_author);\n\t\t\t\n\t\t\t//// IF THIS POST IS BEING PUBLISHED AND THE AUTHOR IS A SUBMITTER\n\t\t\tif($old_status != 'publish' && $new_status == 'publish' && isset($user->caps['submitter'])) {\n\t\t\t\t\n\t\t\t\t//// SENDS AN EMAIL SAYING HIS POST HAS BEEN SUBMITTED\n\t\t\t\t$message = sprintf2(__(\"Dear %user,\n\t\t\t\t\nThis is to inform you that your submission %title at %site_name has been approved and it is now published.\n\nYou can view it here at %link\n\nKind regards,\nthe %site_name team.\", 'btoa'), array(\n\t\t\t\n\t\t\t\t\t'user' => $user->display_name,\n\t\t\t\t\t'title' => $post->post_title,\n\t\t\t\t\t'site_name' => get_bloginfo('name'),\n\t\t\t\t\t'link' => get_permalink($post->ID),\n\t\t\t\t\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\t$subject = sprintf2(__('Submission approved at %site_name', 'btoa'), array('site_name' => get_bloginfo('name')));\n\t\t\t\t\n\t\t\t\t$headers = \"From: \".get_bloginfo('name').\" <\".get_option('admin_email').\">\";\n\t\t\t\t\n\t\t\t\twp_mail($user->user_email, $subject, $message, $headers);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t///// IF ITS A SPOT\n\t\t\tif($post->post_type == 'spot') {\n\t\t\t\t\n\t\t\t\tif(ddp('future_notification') == 'on' && $old_status != 'publish' && $new_status == 'publish') {\n\t\t\t\t\t\n\t\t\t\t\t//// ALSO CHECKS FOR USER NOTIFICATIONS FOR MATCHING CRITERIA\n\t\t\t\t\tif(function_exists('_sf_check_for_user_notifications_matching_spot')) { _sf_check_for_user_notifications_matching_spot($post->ID); }\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//// IF ITS BEING PUBLISHED AND WE HAVE AN EXPIRY DATE SET\n\t\t\t\tif($old_status != 'publish' && $new_status == 'publish' && ddp('submission_days') != '' && ddp('submission_days') != '0') {\n\t\t\t\t\t\n\t\t\t\t\t//// SETS UP OUR CRON JOB TO PUT IT BACK TO PENDING IN X AMOUNT OF DAYS\n\t\t\t\t\t_sf_set_spot_expiry_date($post);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//// IF ITS BEING PUBLISHED AND WE HAVE AN EXPIRY DATE SET FOR OUR FEATURED SUBMISSION - AND ITS INDEED FEATURED\n\t\t\t\tif($old_status != 'publish' && $new_status == 'publish' && ddp('price_featured_days') != '' && ddp('price_featured_days') != '0' && get_post_meta($post->ID, 'featured', true) == 'on') {\n\t\t\t\t\t\n\t\t\t\t\t//// SETS UP OUR CRON JOB TO PUT IT BACK TO NORMAL SUBMISSION AFTER X DAYS\n\t\t\t\t\t_sf_set_spot_expiry_date_featured($post);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "public function isPublished()\n {\n return $this->status == static::PUBLISHED;\n }", "public function isPublishedField()\n {\n return $this->get('check_publish') == 1;\n }", "public function isPublished()\n {\n if(!strcmp($this->getStatus(), 'approved')) {\n return true;\n }\n\n return false;\n }", "public function handleTransitionPostStatus($newStatus, $oldStatus, $post)\n {\n if (\"publish\" == $oldStatus && \"publish\" != $newStatus) {\n $this->deletePost($post->ID);\n }\n }", "public function publish(Post $post)\n {\n $post->updated_at = null;\n\n $post->published = true;\n\n $query = DB::table('threads')\n ->where('id', $post->thread_id)\n ->update(['lastpost_uid' => $post->user_id, 'lastpost_date' => $post->created_at]);\n\n $post->save();\n\n return back();\n }", "function change_post_status($post_obj, $new_status) {\n global $wpdb;\n if (!(get_post_status($post_obj->ID) == $new_status)) {\n $old_status = \"new\";\n if (isset($post_obj->post_status)) {\n $old_status = $post_obj->post_status;\n }\n $wpdb->update($wpdb->posts, array('post_status' => $new_status), array('ID' => $post_obj->ID));\n $post_obj->post_status = $new_status;\n wp_transition_post_status($new_status, $old_status, $post_obj);\n }\n }", "function isPublished() {\n\t\tif ($this->status == 'published') {\n\t\t\t$now = time();\n\t\t\tif ($this->datePublish <= $now) {\n\t\t\t\tif ($this->dateUnpublish > $now || $this->dateUnpublish == null) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function onPostShowing(Post $post)\n {\n $user = auth()->user();\n if (!isAdmin($user)) {\n $post->increment('view_count');\n }\n if (auth()->check()) {\n $unreadNotifications = $user->unreadNotifications;\n foreach ($unreadNotifications as $notifications) {\n $comment = $notifications->data;\n if ($comment['commentable_type'] == 'App\\Model\\Post' && $comment['commentable_id'] == $post->id) {\n $notifications->markAsRead();\n }\n }\n }\n }", "public function status() { return $this->post->post_status; }", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function set_publish_status( $publish_status, $banner_settings ) {\n\t\t$this->publish_status = $publish_status;\n\t\tif ( 'Published' === $publish_status ) {\n\t\t\t$this->last_published = gmdate( 'Y-m-d H:i:s' );\n\t\t} else {\n\t\t\t$this->last_published = $banner_settings['lastPublished'] ? $banner_settings['lastPublished'] : '';\n\t\t}\n\t}", "function register_post_status()\n {\n }", "public function on_all_status_transitions( $new_status, $old_status, $post ){\n\t\tif ( $new_status != $old_status ) {\n\t\t\tif( $new_status == 'pending' ) {\n\t\t\t\t$result = $this->post_to_discord( 'Pending: ' . $post->post_title . ' -- ' . get_edit_post_link( $post->ID, '&' ) );\n\t\t\t}\n\t\t}\n\t}", "public function onPostShowing(Post $post)\n {\n $user = auth()->user();\n if (!isAdmin($user)) {\n $post->increment('view_count');\n }\n\n if (auth()->check()) {\n $unreadNotifications = $user->unreadNotifications;\n foreach ($unreadNotifications as $notifications) {\n $comment = $notifications->data;\n if ($comment['commentable_type'] == 'App\\Post' && $comment['commentable_id'] == $post->id) {\n $notifications->markAsRead();\n }\n }\n }\n }", "private function requested_post_is_valid(){\n return (get_post_type((int) $_GET['post_id']) === $this->post_type && get_post_status((int) $_GET['post_id']) === 'publish');\n }", "function notify_post($post_id) {\n\n if( ( $_POST['post_status'] == 'publish' ) && ( $_POST['original_post_status'] != 'publish' ) && ( $_POST['post_type'] == 'events' ) ) {\n\n send_event_email($post_id);\n\n }\n\n}", "public function isPublished()\n {\n return ($this->published == 1);\n }", "public function has_published_pages()\n {\n }", "function block_core_calendar_has_published_posts() {\n\t// Multisite already has an option that stores the count of the published posts.\n\t// Let's use that for multisites.\n\tif ( is_multisite() ) {\n\t\treturn 0 < (int) get_option( 'post_count' );\n\t}\n\n\t// On single sites we try our own cached option first.\n\t$has_published_posts = get_option( 'wp_calendar_block_has_published_posts', null );\n\tif ( null !== $has_published_posts ) {\n\t\treturn (bool) $has_published_posts;\n\t}\n\n\t// No cache hit, let's update the cache and return the cached value.\n\treturn block_core_calendar_update_has_published_posts();\n}", "public function action_post_update_status( $post, $oldvalue, $newvalue )\n\t{\n\t\tif ( is_null( $oldvalue ) ) return;\n\t\tif ( $newvalue == Post::status( 'published' ) && $post->content_type == Post::type('entry') && $newvalue != $oldvalue ) {\n\t\t\tif ( Options::get( 'statusnet__post_status' ) == '1' ) {\n\t\t\t\t$user = User::get_by_id( $post->user_id );\n\t\t\t\tif ( ! empty( $user->info->statusnet_name ) && ! empty( $user->info->statusnet_pass ) ) {\n\t\t\t\t\t$name = $user->info->statusnet_name;\n\t\t\t\t\t$pw = $user->info->statusnet_pass;\n\t\t\t\t} else {\n\t\t\t\t\t$name = Options::get( 'statusnet__username' );\n\t\t\t\t\t$pw = Options::get( 'statusnet__password' );\n\t\t\t\t}\n\t\t\t\t$svcurl = 'http://' . Options::get('statusnet__svc') . '/api/statuses/update.xml';\n\t\t\t\t$this->post_status( $svcurl, Options::get( 'statusnet__prefix' ) . $post->title . ' ' . $post->permalink, $name, $pw );\n\t\t\t}\n\t\t}\n\t}", "function isPublished(){\n\t\tif($this->isPublished == 1){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function publish(){\n $status = $_POST['status'];\n $id = $_POST['id'];\n $field = $_POST['field'];\n $table = $_POST['table'];\n if($status == 0){\n $pub = 1;\n }else{\n $pub = 0;\n }\n $vdata['published'] = $pub;\n $this->db->update($table, $vdata, array($field => $id));\n\n echo icon_active(\"'$table'\",\"'$field'\",$id,$pub);\n }", "function taxonomy_post_update_handle_publishing_status_addition_in_views(&$sandbox = NULL) {\n // If Views is not installed, there is nothing to do.\n if (!\\Drupal::moduleHandler()->moduleExists('views')) {\n return;\n }\n\n $definition_update_manager = \\Drupal::entityDefinitionUpdateManager();\n $entity_type = $definition_update_manager->getEntityType('taxonomy_term');\n $published_key = $entity_type->getKey('published');\n\n $status_filter = [\n 'id' => 'status',\n 'table' => 'taxonomy_term_field_data',\n 'field' => $published_key,\n 'relationship' => 'none',\n 'group_type' => 'group',\n 'admin_label' => '',\n 'operator' => '=',\n 'value' => '1',\n 'group' => 1,\n 'exposed' => FALSE,\n 'expose' => [\n 'operator_id' => '',\n 'label' => '',\n 'description' => '',\n 'use_operator' => FALSE,\n 'operator' => '',\n 'identifier' => '',\n 'required' => FALSE,\n 'remember' => FALSE,\n 'multiple' => FALSE,\n 'remember_roles' => [\n 'authenticated' => 'authenticated',\n 'anonymous' => '0',\n 'administrator' => '0',\n ],\n ],\n 'is_grouped' => FALSE,\n 'group_info' => [\n 'label' => '',\n 'description' => '',\n 'identifier' => '',\n 'optional' => TRUE,\n 'widget' => 'select',\n 'multiple' => FALSE,\n 'remember' => FALSE,\n 'default_group' => 'All',\n 'default_group_multiple' => [],\n 'group_items' => [],\n ],\n 'entity_type' => 'taxonomy_term',\n 'entity_field' => $published_key,\n 'plugin_id' => 'boolean',\n ];\n\n \\Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'view', function ($view) use ($published_key, $status_filter) {\n /** @var \\Drupal\\views\\ViewEntityInterface $view */\n // Only alter taxonomy term views.\n if ($view->get('base_table') !== 'taxonomy_term_field_data') {\n return FALSE;\n }\n\n $displays = $view->get('display');\n foreach ($displays as $display_name => &$display) {\n // Update any existing 'content_translation_status fields.\n $fields = isset($display['display_options']['fields']) ? $display['display_options']['fields'] : [];\n foreach ($fields as $id => $field) {\n if (isset($field['field']) && $field['field'] == 'content_translation_status') {\n $fields[$id]['field'] = $published_key;\n }\n }\n $display['display_options']['fields'] = $fields;\n\n // Update any existing 'content_translation_status sorts.\n $sorts = isset($display['display_options']['sorts']) ? $display['display_options']['sorts'] : [];\n foreach ($sorts as $id => $sort) {\n if (isset($sort['field']) && $sort['field'] == 'content_translation_status') {\n $sorts[$id]['field'] = $published_key;\n }\n }\n $display['display_options']['sorts'] = $sorts;\n\n // Update any existing 'content_translation_status' filters or add a new\n // one if necessary.\n $filters = isset($display['display_options']['filters']) ? $display['display_options']['filters'] : [];\n $has_status_filter = FALSE;\n foreach ($filters as $id => $filter) {\n if (isset($filter['field']) && $filter['field'] == 'content_translation_status') {\n $filters[$id]['field'] = $published_key;\n $has_status_filter = TRUE;\n }\n }\n\n if (!$has_status_filter) {\n $status_filter['id'] = ViewExecutable::generateHandlerId($published_key, $filters);\n $filters[$status_filter['id']] = $status_filter;\n }\n $display['display_options']['filters'] = $filters;\n }\n $view->set('display', $displays);\n\n return TRUE;\n });\n}", "public function update_post_publication_date( LaterPay_Core_Event $event ) {\n list( $status_after_update, $status_before_update, $post ) = $event->get_arguments() + array( '', '', '' );\n\n // skip on insufficient permission\n if ( ! $this->has_permission( $post->ID ) ) {\n return;\n }\n\n // only update publication date of posts with dynamic pricing\n if ( LaterPay_Helper_Pricing::get_post_price_type( $post->ID ) !== LaterPay_Helper_Pricing::TYPE_INDIVIDUAL_DYNAMIC_PRICE ) {\n return;\n }\n\n // don't update publication date of already published posts\n if ( $status_before_update === LaterPay_Helper_Pricing::STATUS_POST_PUBLISHED ) {\n return;\n }\n\n // don't update publication date of unpublished posts\n if ( $status_after_update !== LaterPay_Helper_Pricing::STATUS_POST_PUBLISHED ) {\n return;\n }\n\n LaterPay_Helper_Pricing::reset_post_publication_date( $post );\n }", "public function onNewPost(PostEvent $event): bool\n {\n $user = $event->user;\n $badges = Badge::where('type', 'onNewPost')->get();\n\n $collection = $badges->filter(function ($badge) use ($user) {\n return $badge->rule <= $user->discuss_post_count;\n });\n\n $result = $user->badges()->syncWithoutDetaching($collection);\n\n return $this->sendNotifications($result, $badges, $user);\n }", "public function hasPublished() {\n return $this->_has(6);\n }", "public function isPublished()\n\t{\n\t\treturn ($this->get('published') == self::STATE_PUBLISHED);\n\t}", "function FWP_Post_Status_init() {\n\t// Check\n\tif ( ! defined( 'FACETWP_VERSION' ) || version_compare( FACETWP_VERSION, '3.0.0', '<' ) ) {\n\t\tadd_action( 'admin_notices', 'FWP_Post_Status_notice' );\n\n\t\treturn;\n\t}\n\n\tFWP_Post_Status();\n}", "function _update_term_count_on_transition_post_status($new_status, $old_status, $post)\n {\n }", "function set_public_status(){\n\t\t\t\tif (get_option( 'blog_public' ) == 0 ){\n\t\t\t\t\tupdate_option('blog_public', 1);\n\t\t\t\t}\n\t\t\t}", "public function isPublished()\n {\n return $this->attribute('state') == self::STATUS_PUBLISHED;\n }", "function set_public_status(){\n\t\t\t\tif (get_option( 'blog_public' ) == 1 ){\n\t\t\t\t\tupdate_option('blog_public', 0);\n\t\t\t\t}\n\t\t\t}", "function published_posts($id)\n { \n\t\t$this->db->select('post_author');\n\t\t$this->db->from($this->tabla);\n\t\t$this->db->where('post_author',$id);\n\t\t$this->db->where('post_status like \"publish\"');\n\t\treturn $this->db->count_all_results();\n }", "public function postUpdate(LifecycleEventArgs $args): void\n {\n // Get the object and make sure it is what we need.\n $object = $args->getObject();\n if (!$object instanceof PublishableInterface) {\n return;\n }\n\n // Get the changeset from the unit of work.\n $uow = $args->getObjectManager()->getUnitOfWork();\n $changeset = $uow->getEntityChangeset($object);\n\n // If the published state changed fire the published event.\n if (isset($changeset['published'])\n && false === $changeset['published'][0]\n && true === $changeset['published'][1]) {\n $event = new EntityPublishedEvent($object);\n $this->event_dispatcher->dispatch(EntityPublishedEvent::NAME, $event);\n }\n }", "private function publishToggle(Request $request){\n\t\t$class ='\\App\\\\'.$request->class;\n\t\t$data = $class::find($request->id);\n\t\t$data->published = !$data->published;\n\t\t$data->save();\n\t}", "public function publish(Post $post){\n $this->posts()->save($post);\n }", "public function action_sync_on_transition( $new_status, $old_status, $post ) {\n\t\tglobal $importer;\n\n\t\t// If we have an importer we must be doing an import - let's abort\n\t\tif ( ! empty( $importer ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'publish' !== $new_status && 'publish' !== $old_status ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ! current_user_can( 'edit_post', $post->ID ) || 'revision' === get_post_type( $post->ID ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Our post was published, but is no longer, so let's remove it from the Elasticsearch index\n\t\tif ( 'publish' !== $new_status ) {\n\t\t\t$this->action_delete_post( $post->ID );\n\t\t} else {\n\t\t\t$post_type = get_post_type( $post->ID );\n\n\t\t\t$indexable_post_types = ep_get_indexable_post_types();\n\n\t\t\tif ( in_array( $post_type, $indexable_post_types ) ) {\n\n\t\t\t\tdo_action( 'ep_sync_on_transition', $post->ID );\n\n\t\t\t\t$this->sync_post( $post->ID );\n\t\t\t}\n\t\t}\n\t}", "public function onPostShowing(Post $post)\n {\n $is_viewed_already=(bool) View::where('user_id', \\Auth::id())\n ->where('post_id', $this->id)\n ->first();\n\n $user = auth()->user();\n if($is_viewed_already == false){\n \\Auth::user()->views()->attach($post->id);\n }\n \n /* $unreadNotifications = $user->unreadNotifications;\n foreach ($unreadNotifications as $notifications) {\n $comment = $notifications->data;\n if ($comment['commentable_type'] == 'App\\Post' && $comment['commentable_id'] == $post->id) {\n $notifications->markAsRead();\n }\n }*/\n }", "public function draft_publish()\n\t{\n\t\t$where = array(\n\t\t\t'parent_entry_id' => $this->settings['entry_id'],\n\t\t\t'parent_is_draft' => 0\n\t\t);\n\t\t$this->EE->db->where($where)->delete('playa_relationships');\n\n\t\t$where['parent_is_draft'] = 1;\n\t\t$update = array('parent_is_draft' => 0);\n\t\t$this->EE->db->where($where)->update('playa_relationships', $update);\n\n\t\treturn;\n\t}", "function _wp_keep_alive_customize_changeset_dependent_auto_drafts($new_status, $old_status, $post)\n {\n }", "function unpublish() {\n\t\tif (! $this->id) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->saveField('is_published', 0);\n\t}", "private function publishUnpublishSchedule($status, $date_published)\n {\n if(isset($_POST[\"selection\"]) && !empty($_POST[\"selection\"]))\n {\n //if user wants to schedule, get date\n if($date_published==Story::STATUS_SCHEDULE)\n {\n $date_published=$_POST[\"Story\"][\"date_published\"];\n if(empty($date_published))\n {\n Yii::$app->session->setFlash('danger', Yii::t('app', 'Select the date'));\n return $this->goBack();\n }\n\n }\n\n $selection=$_POST[\"selection\"]; //it is checkbox array and value is \"id\" in Story\n foreach ($selection as $key=>$IDstory)\n {\n $story=Story::findOne($IDstory);\n if($date_published==NULL)//unpublish story but leave last date_published\n $date_published=$story->date_published;\n\n $story->status = $status;\n $story->date_published = $date_published;\n $story->date_modified = date(\"Y-m-d H:i:s\"); //this is necesary because of cache dependancy so cache can change\n $story->save(false, ['status', 'date_published', 'date_modified']);\n }\n Yii::$app->session->setFlash('success', Yii::t('app', 'Everything went fine'));\n }\n else\n Yii::$app->session->setFlash('danger', Yii::t('app', 'Something was wrong'));\n\n return $this->goBack();\n }", "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 putStatus($id) {\n $post = Post::find($id);\n\n if ($post->status == 'publish') $post->status = 'unpublish';\n else $post->status = 'publish';\n\n $post->save();\n\n return response()->json([\n 'html' => view('dashboard.partials.post.show', compact('post'))->render(),\n 'message' => 'Statut de conférence modifié',\n 'id' => $post->id\n ]);\n }", "function publish( $parent_id = null, $post_status = null ) {\n\n\t\tglobal $wpdb;\n\t\tglobal $src_hash;\n\n\t\t// Add parent ID if specified\n\t\tif( $parent_id ) {\n\t\t\t$this->post[ 'post_parent' ] = $parent_id;\n\t\t}\n\t\t\n\t\t$this->post[ 'post_status' ] = $post_status ? $post_status : 'publish';\n\n\t\t// Create post\n\t\t$new_id = wp_insert_post( $this->post );\n\t\tif( ! $new_id ) {\n\t\t\tdie( 'Failed to insert post.' );\n\t\t}\n\n\t\t// Add template if specified\n\t\tif( 'page' == $this->post['post_type'] && $this->post_template ) {\n\t\t\tupdate_post_meta( $new_id, '_wp_page_template', $this->post_template );\n\t\t}\n\n\t\t// Add subsite root if specified\n\t\tif( $this->is_subsite_root ) {\n\t\t\tupdate_post_meta( $new_id, 'subsite_root', 1 );\n\t\t}\n\n\t\t// ACF gives every modular page a 'modules' key that corresponds to a list\n\t\t// of included modules types (or in ACF terms, layouts) in the order they\n\t\t// appear on the page.\n\t\tupdate_post_meta( $new_id, 'modules', $this->module_list );\n\t\tupdate_post_meta( $new_id, '_modules', 'field_524b16d70ce72' );\n\n\t\t// Loop through the modules, adding postmeta in the same format ACF would.\n\t\tforeach( $this->modules as $index=>$module ) {\n\n\t\t\t// Do any necessary setup (i.e. download images)\n\t\t\t$module->before_publish( $new_id );\n\n\t\t\t// Fetch postmeta for module\n\t\t\t$postmeta_rows = $module->get_postmeta_rows( $index );\n\n\t\t\t// Update in database\n\t\t\tforeach( $postmeta_rows as $key => $value ) {\n\t\t\t\tupdate_post_meta( $new_id, $key, $value );\n\t\t\t}\n\n\t\t}\n\n\t\tif( ! empty( $this->featured_image ) ) {\n\n\t\t\t// Get media ID\n\t\t\tif( $this->featured_image instanceof I2M_Module__image ){\n\t\t\t\t$thumbnail_id = $this->featured_image->get_media_id();\n\t\t\t}\n\t\t\telse if( $this->featured_image instanceof I2M_Module__slideshow ){\n\t\t\t\t$thumbnail_id = $this->featured_image->get_media_id( $this->featured_image_slide );\n\t\t\t}\n\n\t\t\t// Set\n\t\t\tif( $thumbnail_id ){\n\t\t\t\tupdate_post_meta( $new_id, '_thumbnail_id', $thumbnail_id );\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo \"Error: Failed to update featured image for post \" . $new_id . \".<br />\";\n\t\t\t}\n\t\t}\n\n\t\t// Loop through and publish children\n\t\tforeach( $this->children as $child ) {\n\t\t\t$child->publish( $new_id );\n\t\t}\n\n\t\treturn $new_id;\n\n\t}", "function get_post_status($post = \\null)\n {\n }", "function wp_publish_post($post)\n {\n }", "public function hasPublished() {\n return $this->_has(14);\n }", "public function update_post( $new_status, $old_status, $post )\n\t{\n\t\tif ( $post->post_type !== 'newsletter' || $old_status !== 'draft' || $new_status !== 'publish' || $post->post_date_gmt !== $post->post_modified_gmt ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$revisions = wp_get_post_revisions( $post->ID );\n\n\t\t$oldest = NULL;\n\n\t\tforeach ( $revisions as $revision ) {\n\t\t\t$oldest = $revision->ID;\n\t\t}\n\n\t\t$previousdate = get_the_date( 'Y-m-d H:i:s', $oldest );\n\n\t\twp_update_post(\n\t\t\tarray (\n\t\t\t\t'ID' => $post->ID,\n\t\t\t\t'post_date' => $previousdate,\n\t\t\t\t'post_date_gmt' => get_gmt_from_date( $previousdate )\n\t\t\t)\n\t\t);\n\t}" ]
[ "0.7367959", "0.7366401", "0.7286351", "0.71697634", "0.70735866", "0.7056721", "0.7048828", "0.68865246", "0.68777025", "0.67644525", "0.67183703", "0.6718179", "0.6715238", "0.6680298", "0.6623053", "0.65785986", "0.65652233", "0.6553843", "0.65230256", "0.6519419", "0.64961535", "0.6440678", "0.64242816", "0.6373232", "0.63716644", "0.63643634", "0.6363091", "0.6343411", "0.63196766", "0.6310344", "0.626337", "0.6224217", "0.6220076", "0.62158865", "0.6214608", "0.6203497", "0.6191508", "0.618931", "0.61855984", "0.6176118", "0.6174292", "0.6170605", "0.6152815", "0.61114174", "0.6098796", "0.6092743", "0.6088815", "0.60844904", "0.6083448", "0.6083448", "0.6083448", "0.6083448", "0.6083448", "0.6083448", "0.6083448", "0.6083448", "0.6083448", "0.6083448", "0.6083448", "0.6083448", "0.6083448", "0.6071447", "0.6066741", "0.60516953", "0.60473055", "0.6037119", "0.6021781", "0.59955233", "0.59790534", "0.59458315", "0.5942501", "0.59366393", "0.5926392", "0.59169084", "0.59167624", "0.59146017", "0.590343", "0.5873513", "0.5869827", "0.5868005", "0.58629644", "0.5856871", "0.58533394", "0.5851695", "0.58349085", "0.5825434", "0.58057535", "0.57983446", "0.5788435", "0.5784352", "0.57818687", "0.5781313", "0.5778755", "0.5764964", "0.5761925", "0.5747659", "0.57326776", "0.5726862", "0.5726214", "0.5714855" ]
0.732811
2
This command can be used to obtain all the invoices for a particular client or in a particular status. Parameters: none Optional Parameters: userid the client ID to retrieve invoices for status the status to filter for, Paid, Unpaid, Cancelled, etc... This field can also be set to Overdue to provide overdue invoices. limitstart the offset number to start at when returning matches (default = 0) limitnum the number of records to return (default = 25) See:
public function whmcs_get_invoices($params = array()) { $params['action'] = 'GetInvoices'; // return Whmcs_base::send_request($params); $load = new Whmcs_base(); return $load->send_request($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getInvoices(User $user);", "function invoices ($user_id) {\n global $sql;\n return $sql->sql_select_array_query(\"SELECT * FROM `invoice` WHERE user_id = '{$user_id}' ORDER BY invoice_date DESC\");\n }", "public function invoices() {\t\t\r\n\t\t\r\n $user = $this->session->userdata('user');\r\n if ($user['UserType'] == 'TYPE_CLI' && empty($user['AccountantAccess'])) {\r\n //setRedirect(site_url());\r\n } else {\r\n if (isset($_GET['clientID'])) {\r\n checkUserAccess(array('TYPE_ACC', 'TYPE_CLI'));\r\n } else {\r\n checkUserAccess(array('TYPE_CLI'));\r\n }\r\n }\r\n\t\t\r\n\t\t$page = ($this->uri->segment(2)) ? $this->uri->segment(2) : 0;\r\n $user = $this->session->userdata('user');\t\r\n\t\t$VATYear = $this->session->userdata('VATYear');\r\n\t\t$quaters = vatQuaters($user['Params']['VATQuaters']);\r\n\t\t\t\t\r\n /* \tGet the customer list of the company. */\r\n $data['users'] = $this->clients->getUserList();\r\n\r\n $items = $this->clients->getInvoiceList(INVOICE_PAGINATION_LIMIT, $page);\r\n $data['Invoices'] = $items;\r\n //pr($data['Invoices']);\r\n $PaidVatQuarters = $this->clients->getPaidVatQuarters();\r\n\t\t$VATitems = $this->clients->getAllInvoices();\r\n $vat_listing = $this->clients->getVatType();\r\n\t\t\r\n $data['EXPitems'] = false;\r\n if($vat_listing->Type != 'flat') {\r\n $this->load->model('clients/expense');\r\n $EXPitems = $this->expense->getAllExpenses();\r\n $data['EXPitems'] = $EXPitems;\r\n }\r\n //echo '<pre>';print_r($PaidVatQuarters);echo '</pre>';die();\r\n\t\t//echo '<pre>';print_r($VATitems);echo '</pre>';//die();\r\n $data['VATitems'] = $VATitems;\r\n $data['PaidVatQuarters'] = $PaidVatQuarters;\r\n\r\n $total = $this->clients->totalInvoices();\t\t\r\n $data['pagination'] = $this->getPagination('invoices', INVOICE_PAGINATION_LIMIT, $total);\r\n if ($data['users'] == FALSE) {\r\n $data['users'] = array('0' => 'No users');\r\n }\r\n\r\n $data['vat_listing'] = $vat_listing;\r\n $data['page'] = 'invoices';\r\n $data['title'] = 'Cashman | Invoices';\r\n $this->load->view('client/invoices/default', $data);\r\n }", "public function getExistingInvoicesForClientCase($client_id, $client_case_id, $display_type)\n {\n if($display_type=='Itemized') {\n\t\t$sql = \"SELECT id, created_date FROM tbl_invoice_final WHERE client_id = $client_id AND client_case_id = $client_case_id AND display_by = 1 AND is_closed=0 ORDER BY id DESC\";\n }\n else {\n $sql = \"SELECT id, created_date FROM tbl_invoice_final WHERE client_id = $client_id AND client_case_id = 0 AND display_by = 2 AND is_closed=0 ORDER BY id DESC\";\n }\n\n \n $invoice_data = InvoiceFinal::findBySql($sql)->all();\n\n \t\t return $invoice_data;\n\t }", "public function get_user_invoices($member_id, $limit = NULL)\n\t{\n\t\t$this->db->select('invoice.*, invoice_status.invoice_status_name');\n\t\t$this->db->where('invoice.invoice_status = invoice_status.invoice_status_id AND invoice.member_id = '.$member_id);\n\t\t$this->db->order_by('created', 'DESC');\n\t\tif($limit != NULL)\n\t\t{\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t$query = $this->db->get('invoice, invoice_status');\n\t\t\n\t\treturn $query;\n\t}", "public function list_invoices($id = false, $clientid = false)\r\n {\r\n\r\n if (!has_permission('invoices', '', 'view') && !has_permission('invoices', '', 'view_own')) {\r\n access_denied('invoices');\r\n }\r\n $this->load->model('payment_modes_model');\r\n $data['payment_modes'] = $this->payment_modes_model->get('', array(), true);\r\n if ($this->input->is_ajax_request()) {\r\n $this->perfex_base->get_table_data('invoices', array(\r\n 'id' => $id,\r\n 'clientid' => $clientid,\r\n 'data' => $data\r\n ));\r\n }\r\n $data['invoiceid'] = '';\r\n if (is_numeric($id)) {\r\n $data['invoiceid'] = $id;\r\n }\r\n $data['title'] = _l('invoices');\r\n $data['invoices_years'] = $this->invoices_model->get_invoices_years();\r\n $data['invoices_sale_agents'] = $this->invoices_model->get_sale_agents();\r\n $data['invoices_statuses'] = $this->invoices_model->get_statuses();\r\n $data['bodyclass'] = 'invoices_total_manual';\r\n $this->load->view('admin/invoices/manage', $data);\r\n }", "function ciniki_sapos_customerInvoices($ciniki, $tnid, $customer_id, $limit=0) {\n //\n // Get the time information for tenant and user\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $tnid);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_timezone = $rc['settings']['intl-default-timezone'];\n $intl_currency_fmt = numfmt_create($rc['settings']['intl-default-locale'], NumberFormatter::CURRENCY);\n $intl_currency = $rc['settings']['intl-default-currency'];\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');\n $date_format = ciniki_users_dateFormat($ciniki);\n $php_date_format = ciniki_users_dateFormat($ciniki, 'php');\n\n //\n // Load the status maps for the text description of each status\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'sapos', 'private', 'maps');\n $rc = ciniki_sapos_maps($ciniki);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $maps = $rc['maps'];\n\n //\n // Get the invoices for a customer\n //\n $strsql = \"SELECT ciniki_sapos_invoices.id, \"\n . \"ciniki_customers.display_name AS customer_name, \"\n . \"ciniki_sapos_invoices.invoice_number, \"\n . \"ciniki_sapos_invoices.invoice_date, \"\n . \"ciniki_sapos_invoices.status, \"\n . \"ciniki_sapos_invoices.status AS status_text, \"\n . \"ciniki_sapos_invoices.total_amount \"\n . \"FROM ciniki_sapos_invoices \"\n . \"LEFT JOIN ciniki_customers ON (ciniki_sapos_invoices.customer_id = ciniki_customers.id \"\n . \"AND ciniki_customers.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \") \"\n . \"WHERE ciniki_sapos_invoices.customer_id = '\" . ciniki_core_dbQuote($ciniki, $customer_id) . \"' \"\n . \"AND ciniki_sapos_invoices.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"ORDER BY ciniki_sapos_invoices.invoice_date DESC \"\n . \"\";\n if( $limit > 0 ) {\n $strsql .= \"LIMIT $limit \";\n }\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.sapos', array(\n array('container'=>'invoices', 'fname'=>'id', 'name'=>'invoice',\n 'fields'=>array('id', 'customer_name', 'invoice_number', 'invoice_date',\n 'status', 'status_text', 'total_amount'),\n 'maps'=>array('status_text'=>$maps['invoice']['status']),\n 'utctotz'=>array('invoice_date'=>array('timezone'=>$intl_timezone, 'format'=>$php_date_format))), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['invoices']) ) {\n return array('stat'=>'ok', 'invoices'=>array());\n }\n $invoices = $rc['invoices'];\n\n foreach($invoices as $iid => $invoice) {\n $invoices[$iid]['invoice']['total_amount_display'] = numfmt_format_currency(\n $intl_currency_fmt, $invoices[$iid]['invoice']['total_amount'], $intl_currency);\n }\n\n return array('stat'=>'ok', 'invoices'=>$invoices);\n}", "public function get_invoices( $page ) {\n \n // Check if the session exists and if the login user is admin\n $this->check_session($this->user_role, 1);\n\n // Check if data was submitted\n if ($this->input->post()) {\n \n // Add form validation\n $this->form_validation->set_rules('user', 'User', 'trim');\n $this->form_validation->set_rules('from_date', 'From Date', 'trim');\n $this->form_validation->set_rules('to_date', 'To Date', 'trim');\n \n // Get data\n $user = $this->input->post('user');\n $from_date = $this->input->post('from_date');\n $to_date = $this->input->post('to_date');\n \n // Check form validation\n if ( $this->form_validation->run() != false ) {\n \n $page --;\n $limit = 10;\n \n // Set default user_id\n $user_id = 0;\n \n // Verify if user exists\n if ( $user ) {\n \n // Get user by search\n $response = $this->invoice->get_user_by_username_or_email( $user );\n \n if ( $response ) {\n \n $user_id = $response[0]->user_id;\n \n } else {\n \n // Stop running the script\n exit();\n \n }\n \n }\n \n // Set date from\n $date_from = 0;\n \n // Verify if $from_date is not empty\n if ( $from_date ) {\n \n $date_from = $from_date;\n \n }\n \n // Set date to\n $date_to = 0;\n \n // Verify if $to_date is not empty\n if ( $to_date ) {\n \n $date_to = $to_date;\n \n } \n \n // Now get total number of invoices\n $total = $this->invoice->get_invoices( $page * $limit, $limit, $user_id, $date_from, $date_to, false );\n \n // Now get all invoices\n $invoices = $this->invoice->get_invoices( $page * $limit, $limit, $user_id, $date_from, $date_to, true );\n \n if ( $invoices ) {\n \n echo json_encode(['invoices' => $invoices, 'total' => $total]);\n \n }\n \n }\n \n }\n \n }", "public function invoice_list( $customer_id = NULL, $count = 10, $offset = 0 ) {\r\n\t\t$params['count'] = $count;\r\n\t\t$params['offset'] = $offset;\r\n\t\tif( $customer_id )\r\n\t\t\t$params['customer'] = $customer_id;\r\n\t\t$vars = http_build_query( $params, NULL, '&' );\r\n\t\t\r\n\t\treturn $this->_send_request( 'invoices?'.$vars );\r\n\t}", "public function get_one_invoice($client_id, $invoices, $type)\r\n {\r\n \r\n $exclude = '';\r\n \r\n if ($invoices != NULL) {\r\n array_walk($invoices, create_function('&$item, $key', '$item = \"\\'{$item}\\'\";'));\r\n $invoices = implode(',', $invoices);\r\n $exclude = \" and invoice_number not in ($invoices)\";\r\n } \r\n \r\n if ($type == 'received') {\r\n $sql = \"SELECT * FROM invoice WHERE client_id = {$client_id} AND paid = FALSE \r\n AND state in (0, 1 , 9) and total_amount > 0 AND type = 0 $exclude ORDER BY invoice_time ASC LIMIT 1\";\r\n } else {\r\n $sql = \"SELECT * FROM invoice WHERE client_id = {$client_id} AND paid = FALSE\r\n AND state = 0 AND type = 3 and total_amount > 0 $exclude ORDER BY invoice_time ASC LIMIT 1\";\r\n }\r\n \r\n $data = $this->query($sql);\r\n return $data;\r\n }", "public static function getInvoiceById($invoice_id, $offset, $limit){\n $criteria = new CDbCriteria;\n $sql = 'SELECT * FROM `reader_invoice`\n WHERE `Reader_id` = (\n SELECT `Reader_id` FROM `reader_invoice`\n WHERE `Invoice_id` = '.$invoice_id.'\n )\n AND `Earning_type` = (\n SELECT `Earning_type` FROM `reader_invoice`\n WHERE `Invoice_id` = '.$invoice_id.'\n )\n AND `reader_status` = 0 LIMIT :offset, :limit';\n $connection=Yii::app()->db;\n $command = $connection->createCommand($sql);\n $command->bindValue(':offset', $offset);\n $command->bindValue(':limit', $limit);\n\n return $command->query();\n\n }", "public function readClientInvoices($id) {\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 $sql = \"SELECT * FROM invoice WHERE clientid = '{$id}'\";\r\n $invoices = Invoice::find_by_sql($sql);\r\n if (!$invoices) {\r\n throw new RestException(400, \"no invoices\");\r\n }\r\n return $invoices;\r\n }", "function invoiceList($argWhere = '', $argLimit = '') {\n\n $varWhere = \" 1 \" . $argWhere;\n $varWhere = str_replace('fkWholesalerID','tbl_logisticinvoice.fkWholesalerID',$varWhere);\n \n //echo $varWhere = '1 AND tbl_logisticinvoice.fkWholesalerID IN (5,120,36,154,85,119,122,125,132,143,133,126,131,148)';\n if ($argLimit) {\n $varLimit = \" LIMIT \" . $argLimit;\n }\n\n $varQuery = \"SELECT * FROM \" . TABLE_LOGISTICINVOICE . \" \"\n . \" LEFT JOIN tbl_order_items ON fkOrderitemID = pkOrderItemID \"\n . \" LEFT JOIN tbl_admin ON AdminCountry = AdminPortalID WHERE \" . $varWhere . \" GROUP BY tbl_logisticinvoice.fkSubOrderID ORDER BY pkInvoiceID DESC \" . $varLimit;\n $arrRes = $this->getArrayResult($varQuery);\n //pre($arrRes);\n return $arrRes;\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 get_invoices( ) {\n\n $invoiceArray = $this->mockinvoice_model->get_invoices( $this->input->post( 'jobId' ) );\n\n if ( !empty( $invoiceArray ) ) {\n $invoiceHTML = create_invoice_html( $invoiceArray );\n // Push the HTML for the invoice tables onto the array being returned\n $invoiceArray[] = array( 'mockInvoiceId' => '', 'readyToInvoice' => '', 'archived' => '', 'invoiceHTML' => $invoiceHTML );\n }\n\n // Send back the timesheet settings as JSON.\n $this->json_library->print_array_json( $invoiceArray );\n }", "public function getInvoices($options = array())\n {\n return $this->getListe(\"invoices\", $options);\n }", "public function index(Request $request)\n {\n $search_command = $request->get('search');\n $page_title = 'Invoice';\n $page_description = 'Invoice listing';\n $customers = Customer::all();\n $cust = $request->has('search_by_customer') ? $request->input('search_by_customer') : null;\n $status = $request->has('search_by_status') ? $request->input('search_by_status') : null;\n $date_s = $request->has('search_by_start_date') ? $request->input('search_by_start_date') : null;\n $date_e = $request->has('search_by_end_date') ? $request->input('search_by_end_date') : null;\n $lookupcustomers = array();\n foreach ($customers as $k => $v) {\n $lookupcustomers[$v->customer_number] = $v->customer_name;\n }\n\n $invoice_number = Invoice::max('invoice_number');\n $custom_invoice_number = CustomInvoice::max('custom_invoice_number');\n if($invoice_number == null){\n $invoice_number = \"INV101\";\n \n }else{\n $invoice_number = (int)(substr($invoice_number,3));\n $invoice_number = $invoice_number + 1;\n $invoice_number = \"INV\".$invoice_number;\n }\n if($custom_invoice_number == null){\n $custom_invoice_number = \"CINV1001\";\n \n }else{\n $custom_invoice_number = (int)(substr($custom_invoice_number, 4));\n $custom_invoice_number = $custom_invoice_number + 1;\n $custom_invoice_number = \"CINV\".$custom_invoice_number;\n }\n if($search_command == 'command_search') {\n $prepareSearch = new SearchParamInvoice;\n $prepareSearch->fill($request->all());\n\n $qry = $this->invoiceManager::getBaseQuery();\n $preparedSearch = SearchParamInvoice::prepareSearch($qry, $prepareSearch->toArray());\n $invoices = $preparedSearch->get();\n } else {\n $invoices = DB::table('invoices')\n ->leftJoin('customers', 'customers.customer_number', '=', 'invoices.customer_id')\n ->leftJoin('projects', 'projects.project_number', '=', 'invoices.project_id')\n ->where('invoice_status', '=', 'Open')\n ->get();\n }\n\n return view('invoice.index', compact('invoices', 'page_title', 'page_description', 'invoice_number', 'custom_invoice_number', 'lookupcustomers','cust','date_s','date_e','status'));\n }", "public function getInvoicestomergeForClientCase($client_id, $client_case_id, $display_type, $invoice_id)\n {\n if($display_type==1) {\n\t\t$sql = \"SELECT id, created_date FROM tbl_invoice_final WHERE client_id = $client_id AND client_case_id = $client_case_id AND display_by = 1 AND is_closed=0 AND id != $invoice_id ORDER BY id DESC\";\n }\n else {\n $sql = \"SELECT id, created_date FROM tbl_invoice_final WHERE client_id = $client_id AND client_case_id = 0 AND display_by = 2 AND is_closed=0 AND id != $invoice_id ORDER BY id DESC\";\n }\n\n \n $invoice_data = InvoiceFinal::findBySql($sql)->all();\n\n \t\t return $invoice_data;\n\t }", "function InfGetInvoices($inf_contact_id, $pay_status = 0) {\n\t$object_type = \"Invoice\";\n\t$class_name = \"Infusionsoft_\" . $object_type;\n\t$object = new $class_name();\n\t$objects = Infusionsoft_DataService::query(new $class_name(), array('ContactId' => $inf_contact_id, 'PayStatus' => $pay_status));\n\n $invoices_array = array();\n foreach ($objects as $i => $object) {\n\t\t// Give it a userful index, ie, inf_invoice_id\n\t\t$array = $object->toArray();\n $invoices_array[$array['Id']] = $array;\n }\n\treturn $invoices_array; \n}", "static function getInvoices($searchParams, &$totalResults) {\n\t\t\n\t\t\tif (!isset($searchParams['limit'])) {\n\t\t\t\t$searchParams['limit'] = 0;\n\t\t\t}\n\t\t\tif (!isset($searchParams['offset'])) {\n\t\t\t\t$searchParams['offset'] = 0;\n\t\t\t}\n\t\t\t\n\t\t\t$whereConditions = \"\";\n\t\t\t\n\t\t\t\n\t\t\tif ((isset($searchParams['invoiceDateFrom'])) && ($searchParams['invoiceDateFrom'] != '')) {\n\t\t\t\t$whereConditions .= \" AND i.invoice_date >= '\" . DMDatabase::escape($searchParams['invoiceDateFrom']) . \"'\";\n\t\t\t}\n\t\t\tif ((isset($searchParams['invoiceDateTo'])) && ($searchParams['invoiceDateTo'] != '')) {\n\t\t\t\t$whereConditions .= \" AND i.invoice_date <= '\" . DMDatabase::escape($searchParams['invoiceDateTo']) . \"'\";\n\t\t\t}\n\t\t\tif ((isset($searchParams['invoice_archived'])) && ($searchParams['invoice_archived'] > -1)) {\n\t\t\t\t$whereConditions .= ' AND i.invoice_archived = ' . (int) $searchParams['invoice_archived'];\n\t\t\t}\n\t\t\t\n\t\t\t$myQuery = \"\n\t\t\t\tSELECT SQL_CALC_FOUND_ROWS i.*\n\t\t\t\tFROM fh_invoice AS i\n\t\t\t\tWHERE 1 = 1\n\t\t\t\t$whereConditions\n\t\t\t\tORDER BY i.invoice_date DESC, i.invoice_code DESC\n\t\t\t\";\n\t\t\t\n\t\t\t$results = DMDatabase::loadObjectList($myQuery, $searchParams['offset'], $searchParams['limit']);\n\t\t\t\n\t\t\t$totalResults = DMDatabase::loadResult(\"SELECT FOUND_ROWS();\");\n\t\t\t\n\t\t\treturn $results;\n\t\t\t\n\t\t}", "public function browseInvoices(Request $request) {\n if ($request->expectsJson()) {\n $params = $request->params;\n $params['page'] = intval($params['page']);\n $params['service_period'] = date('Y-m-d', strtotime($params['service_period']));\n\n $id = !is_null($request->id) ? $request->id : null; \n /*\n * I have created a helper to receive API data \n * @params will contain 'page_id' to define on which page we are\n * 'start_date' and 'end_date' to get data for certain period.\n * ID - to view one specific invoice.\n */\n $invoices = Helper::apiData($id, $params);\n\n return response()->json(json_decode($invoices));\n }\n }", "public function readAllInvoices() {\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\r\n $sql = \"SELECT * FROM invoice WHERE traderid = '{$this->getTraderID($auth)}'\";\r\n $invoices = Invoice::find_by_sql($sql);\r\n if (!$invoices) {\r\n throw new RestException(400, \"no invoices\");\r\n }\r\n return $invoices;\r\n }", "public function get_invoice_list()\n {\n return $this->db->select('sr_no, invoice_no, round_off_total, invoice_date, bakery_name,bakery_address, bakery_area, bakery_city')->order_by('sr_no','desc')\n ->from('insider_bill')->join('customers', 'customers.id = insider_bill.customer_id')->get();\n }", "public function getInvoices() {\n $result = ChargeBee_Invoice::invoicesForSubscription($this->user->subscription_id, array(\"limit\" => 20));\n\n return $result;\n }", "public function invoices(Request $request)\n {\n $user = $request->user();\n $currentCompany = $user->currentCompany();\n \n $invoices = Invoice::findByCompany($currentCompany->id)\n ->findByCustomer($request->customer_id)\n ->unpaid()\n ->where('due_amount', '>', 0)\n ->select('id', 'invoice_number AS text', 'due_amount')\n ->get();\n\n return response()->json($invoices);\n }", "public function getOverdueInvoicesList(InvoiceListingFilter $filter): Collection;", "public function obtenerInvoices($SQLOptions = [])\n {\n $count = false;\n $sort = false;\n $limit = false;\n $joins = false;\n $conditions = false;\n\n if (true === is_array($SQLOptions)) {\n $count = true === isset($SQLOptions['count']) && true === $SQLOptions['count'];\n if (true === isset($SQLOptions['sort'])) {\n $sort = $SQLOptions['sort'];\n }\n if (true === isset($SQLOptions['limit'])) {\n $limit = $SQLOptions['limit'];\n }\n if (true === isset($SQLOptions['unpaid'])) {\n $joins = \" LEFT OUTER JOIN \" . TABLE_TRANSACTION . \" paypal using(custom)\"\n . \" INNER JOIN agd_data.empresa empresa using (uid_empresa)\";\n $conditions = \" AND ((empresa.is_enterprise = 0\"\n . \" AND empresa.activo_corporacion = 0\"\n . \" AND empresa.corporation IS NULL\"\n . \" AND paypal.uid_paypal IS NULL AND sent_date > '\" . invoice::DATE_CREDIT_MEMO . \"'\"\n . \") OR empresa.is_enterprise = 1\"\n . \" OR empresa.activo_corporacion = 1\"\n . \" OR empresa.corporation IS NOT NULL\"\n . \" OR paypal.uid_paypal IS NOT NULL\"\n . \")\";\n }\n }\n\n $field = $count ? \"count(uid_invoice)\" : \"uid_invoice\";\n\n $sql = \"SELECT {$field} FROM \" . TABLE_INVOICE;\n\n if (true === is_string($joins)) {\n $sql .= \" {$joins}\";\n }\n\n $sql .= \" WHERE uid_empresa = {$this->getUID()}\n AND sent_date IS NOT NULL\";\n\n if (true === is_string($conditions)) {\n $sql .= \" {$conditions}\";\n }\n\n if ($sort) {\n $sql .= \" ORDER BY {$sort}\";\n }\n\n if ($limit) {\n $sql .= \" LIMIT {$limit[0]}, {$limit[1]}\";\n }\n\n if ($count) {\n return $this->db->query($sql, 0, 0);\n }\n\n $invoices = $this->db->query($sql, \"*\", 0, \"invoice\");\n if ($invoices) return new ArrayObjectList($invoices);\n\n return new ArrayObjectList();\n }", "public function invoices(Invoice $invoice)\n {\n $range = explode('-', $this->request->range);\n $start_date = date('Y-m-d', strtotime($range[0]));\n $end_date = date('Y-m-d', strtotime($range[1]));\n $this->request->request->add(['date_range' => [$start_date, $end_date]]);\n $invoices = $invoice->apply($this->request->except(['range']))->with(['company:id,name'])->get();\n $html = view('analytics::_ajax._invoices', compact('invoices'))->render();\n\n return response()->json(['status' => 'success', 'html' => $html, 'message' => 'Processed successfully'], 200);\n }", "public function index($id = false)\r\n {\r\n $this->list_invoices($id);\r\n }", "public function getInvoices(Request $request)\n {\n $account_balance = $this->recurlyService->getAccountBalance($request->user());\n $past_due = 0;\n $user_identifier = Auth::user()->user_identifier;\n $recurlyInvoices = $this->recurlyService->getInvoicesForAccount($user_identifier);\n\n $invoices = [];\n foreach($recurlyInvoices as $invoice) {\n if ($invoice->state != 'collected' && $invoice->state != 'failed') {\n $past_due = $past_due + $invoice->total_in_cents;\n }\n $invoices[$invoice->invoice_number]['invoice_number'] = $invoice->invoice_number;\n $count = count($invoice->line_items);\n $invoices[$invoice->invoice_number]['description'] = isset($invoice->line_items[$count-1]) ? $invoice->line_items[$count-1]->description : null;\n if (is_null($invoices[$invoice->invoice_number]['description'])) $invoices[$invoice->invoice_number]['description'] = $invoice->line_items[0]->description;\n if ($invoice->subscription) {\n $href = $invoice->subscription->getHref();\n $subscription_id = substr($href, strrpos($href, '/')+1);\n $invoices[$invoice->invoice_number]['subscription_id'] = $subscription_id;\n } else {\n $invoices[$invoice->invoice_number]['subscription_id'] = '';\n }\n $invoices[$invoice->invoice_number]['created_at'] = $invoice->created_at ? $invoice->created_at->format('M d Y') : null;\n $invoices[$invoice->invoice_number]['closed_at'] = $invoice->closed_at ? $invoice->closed_at->format('M d Y') : null;\n $invoices[$invoice->invoice_number]['state'] = $invoice->state;\n $invoices[$invoice->invoice_number]['total_in_cents'] = number_format($invoice->total_in_cents / 100, 2, '.', '');\n $invoices[$invoice->invoice_number]['value'] = $invoice->total_in_cents;\n }\n $credit_value = $account_balance + $past_due;\n $selected_uuid = $request->get('uuid');\n return view('billing.invoices', ['invoices'=>$invoices, 'selected_uuid'=>$selected_uuid, 'credit_value'=>$credit_value/100, 'past_due'=>$past_due]);\n }", "function bpGetInvoice($invoiceId, $apiKey=false) {\r\n\t\r\n}", "public function get_invoice($invoice_id)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->where('invoice.member_id = member.member_id AND invoice.invoice_status = invoice_status.invoice_status_id AND invoice.invoice_id = '.$invoice_id);\n\t\t$query = $this->db->get('invoice, invoice_status, member');\n\t\t\n\t\treturn $query;\n\t}", "function invoiceReport($status=\"\")\n {\n $condition = \"\";\n if(!empty($status) && !$this->rAllDate)\n {\n $condition = \" AND {$this->props->tbl_invoices}.`due_date` >= '\".$this->utils->quoteSmart($this->rFromDate).\"' AND {$this->props->tbl_invoices}.`due_date` <= '\".$this->utils->quoteSmart($this->rToDate).\"' AND {$this->props->tbl_invoices}.`status` = '\".$this->utils->quoteSmart($status).\"'\";\n }\n elseif(!empty($status) && $this->rAllDate)\n {\n $condition = \" AND {$this->props->tbl_invoices}.`status` = '\".$this->utils->quoteSmart($status).\"'\";\n }\n elseif(!$this->rAllDate)\n {\n $condition = \" AND {$this->props->tbl_invoices}.`due_date` >= '\".$this->utils->quoteSmart($this->rFromDate).\"' AND {$this->props->tbl_invoices}.`due_date` <= '\".$this->utils->quoteSmart($this->rToDate).\"'\";\n }\n $sql = \"SELECT * FROM {$this->props->tbl_invoices} \" .\n \"LEFT JOIN {$this->props->tbl_orders_invoices} ON {$this->props->tbl_orders_invoices}.invoice_id = {$this->props->tbl_invoices}.invoice_no \" .\n \"LEFT JOIN {$this->props->tbl_orders} ON {$this->props->tbl_orders_invoices}.order_id = {$this->props->tbl_orders} .sub_id \" .\n \"LEFT JOIN {$this->props->tbl_customers_orders} ON {$this->props->tbl_customers_orders}.order_id = {$this->props->tbl_orders_invoices}.order_id \" .\n \"LEFT JOIN {$this->props->tbl_customers} ON {$this->props->tbl_customers_orders}.customer_id = {$this->props->tbl_customers}.id \" .\n \"WHERE {$this->props->tbl_invoices}.`status`!='Deleted'\".$condition;\n $data = array();\n $temp = $this->dbL->executeSELECT($sql);\n foreach($temp as $k=>$inv)\n {\n foreach($this->rColumns as $c)\n {\n $data[$k][$c] = $inv[$c];\n }\n }\n return $data;\n }", "public function getInvoice($invoiceId);", "public function getDraftInvoicesList(InvoiceListingFilter $filter): Collection;", "public function invoices($id = null)\n {\n $project = $this->project->findOrFail($id);\n $this->authorize('invoices', $project);\n $invoices = new InvoicesResource($project->invoices()->orderBy('id', 'desc')->paginate(20));\n if ($this->request->has('json')) {\n $data['invoices'] = $invoices;\n return view('projects::_ajax._invoices')->with($data);\n }\n return response($invoices, Response::HTTP_OK);\n }", "public function retrieveallinvoices(Request $request)\n {\n $invoices = Invoice::latest()->get();\n\n return InvoicesResource::collection($invoices);\n }", "public function getAllInvoicesList(InvoiceListingFilter $filter): Builder;", "public function invoicesStatement(array $params = [])\n {\n $this->setParams($params)->sendApiRequest('GET', 'accounts/invoices');\n\n return $this->fetchResponse();\n }", "public static function getPendingInvoices($reader_id){\n $sql = 'SELECT t1.*,SUM(`Total`) as amount\n FROM\n (\n SELECT inv.*\n FROM `reader_invoice` as inv\n WHERE `reader_status` = 0\n and `Reader_id`= '.$reader_id.'\n ORDER BY `Year` DESC, `Month` DESC, `Period` DESC\n )\n t1\n GROUP BY `Earning_type`';\n $connection=Yii::app()->db;\n $command=$connection->createCommand($sql);\n $invoices = $command->query();\n\n return $invoices;\n }", "public function getLatestInvoices()\r\n {\r\n if ($this->userId != Null) {\r\n $em = $this->entityManager;\r\n $criteria = array(\r\n 'user' => $this->userId\r\n );\r\n $order = array(\r\n 'id' => 'DESC'\r\n );\r\n $limit = 50;\r\n \r\n $transact = $em->getRepository('Transactions\\Entity\\InvoiceUser')->findBy($criteria, $order, $limit);\r\n return $transact;\r\n }\r\n }", "public function whmcs_get_invoice($params = array()) {\n\t\t$params['action'] = 'GetInvoice';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "public function fetchAllInvoices($limit, $offset, $keyword = null, $sortdatafield = null, $sortorder = null) {\n\t\ttry{\n\t\t\t$select = new \\Zend\\Db\\Sql\\Select();\n\t\t\t\n\t\t\t$sm = $this->_serviceManager;\n\t\t\t\n\t\t\t$adapter = $sm->get('Zend\\Db\\Adapter\\Adapter');\n\t\t\t\n\t\t\t$resultSetPrototype = new HydratingResultSet();\n\t\t\t\n\t\t\t$config = $sm->get('Config');\n\t\t\t\n\t\t\t$tableGateway = new TableGateway($config[\"dbPrefix\"] . 'invoice', $adapter, null, $resultSetPrototype);\n\t\t\t\n\t\t\t$customer_name = new \\Zend\\Db\\Sql\\Expression(\n\t\t\t\t'CONCAT(t3.first_name, \\' \\', t3.last_name)'\n\t\t\t);\n\t\n\t\t\t$select->from(array('t1' => 'de_invoice'))\n\t\t\t\t\t->join(array('t2' => 'de_opportunities'), new \\Zend\\Db\\Sql\\Expression('t2.id = t1.opp_id '), array(\"opp_name\" => \"opportunity_name\"), 'left')\n\t\t\t\t\t->join(array('t3' => 'de_customers'), new \\Zend\\Db\\Sql\\Expression('t3.id = t2.user_id '), array(\"customer_name\" => $customer_name, \"email\"), 'left')\n\t\t\t\t\t->where(\"t1.status != 'DELETED' AND t1.invoice_id IS NOT NULL\");\n\t\t\t\n\t\t\tif(!empty($keyword)){\n\t\t\t\t$where = new \\Zend\\Db\\Sql\\Where();\n\t\t\t\t$where->NEST->addPredicates(array(\n\t\t\t\t\t\tnew \\Zend\\Db\\Sql\\Predicate\\Like('t1.invoice_number', \"%$keyword%\"),\n\t\t\t\t\t\tnew \\Zend\\Db\\Sql\\Predicate\\Like('t3.first_name', \"%$keyword%\"),\n\t\t\t\t\t\tnew \\Zend\\Db\\Sql\\Predicate\\Like('t3.last_name', \"%$keyword%\"),\n\t\t\t\t\t), 'OR'\n\t\t\t\t)->UNNEST;\n\t\t\t\t/*$where->addPredicates(array(\n\t\t\t\t\tnew \\Zend\\Db\\Sql\\Predicate\\Like('u.first_name', \"%$keyword%\"),\n\t\t\t\t));*/\n\t\t\t\t$select->where($where);\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($sortdatafield) && !empty($sortorder)){\n\t\t\t\tif($sortdatafield == 'invoice_number')\n\t\t\t\t\t$select->order(\"t1.invoice_number $sortorder\");\n\t\t\t\telseif($sortdatafield == 'created_date')\n\t\t\t\t\t$select->order(\"t1.created_date $sortorder\");\n\t\t\t\telseif($sortdatafield == 'customer_name')\n\t\t\t\t\t$select->order(\"t3.first_name $sortorder\");\n\t\t\t\telseif($sortdatafield == 'email')\n\t\t\t\t\t$select->order(\"t3.email $sortorder\");\n\t\t\t} else {\n\t\t\t\t$select->order('t1.id DESC');\n\t\t\t}\n\t\t\n\t\t\t$statement = $adapter->createStatement();\t\t\t\n\t\t\t$select->prepareStatement($adapter, $statement);\n\t\t\t$resultSet = new \\Zend\\Db\\ResultSet\\ResultSet();\n\t\t\t$resultSet->initialize($statement->execute());\n\t\t\t\n\t\t\t$select->limit($limit);\n\t\t\t$select->offset($offset);\n\t\t\t\n\t\t\t$statement = $adapter->createStatement();\n\t\t\t$select->prepareStatement($adapter, $statement);\n\t\t\t$resultSetLimit = new \\Zend\\Db\\ResultSet\\ResultSet();\n\t\t\t$resultSetLimit->initialize($statement->execute());\n\t\t\t\n\t\t\t$result['TotalRows'] = count($resultSet);\n\t\t\t$result['Rows'] = $resultSetLimit->toArray();\n\t\t\t\n\t\t\treturn $result;\n\t\t}catch(\\Exception $e){echo $e->getMessage ();\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n\t}", "public function browse()\n {\n require_code('templates_donext');\n return do_next_manager(get_screen_title('INVOICES'), comcode_lang_string('DOC_ECOMMERCE'),\n array(\n array('menu/_generic_admin/add_one', array('_SELF', array('type' => 'add'), '_SELF'), do_lang('CREATE_INVOICE')),\n array('menu/adminzone/audit/ecommerce/outstanding_invoices', array('_SELF', array('type' => 'outstanding'), '_SELF'), do_lang('OUTSTANDING_INVOICES')),\n array('menu/adminzone/audit/ecommerce/undelivered_invoices', array('_SELF', array('type' => 'undelivered'), '_SELF'), do_lang('UNDELIVERED_INVOICES')),\n ),\n do_lang('INVOICES')\n );\n }", "public function show(Invoices $invoice)\n {\n return $invoice;\n }", "public function getVendorPayableInvoices(Request $request, $vendor_id)\n {\n //Set Sort by & Sort by Column\n $sortBy = Helper::setSortByValue($request);\n\n //Set Per Page Record\n $per_page = Helper::setPerPage($request);\n\n $payable = PayableInvoice::where(VENDOR_ID,$vendor_id);\n return $this->response->paginator($payable->orderBy($sortBy['column'], $sortBy['order'])->paginate($per_page), new PayableInvoiceTransformer());\n }", "public function invoiceitem_list( $customer_id = FALSE, $count = 10, $offset = 0 ) {\r\n\t\t$params['count'] = $count;\r\n\t\t$params['offset'] = $offset;\r\n\t\tif( $customer_id )\r\n\t\t\t$params['customer'] = $customer_id;\r\n\t\t$vars = http_build_query( $params, NULL, '&' );\r\n\t\t\r\n\t\treturn $this->_send_request( 'invoiceitems?'.$vars );\r\n\t}", "public function invoices_by_status_1()\n {\n\n $invoices = Invoice::where(\"value_status\", 1)->orderBy('id', 'desc')->get();\n return view('admin.invoices.index', compact('invoices'));\n\n }", "public function index(Request $request)\n {\n $user = Auth::getUser();\n\n $patientId = $user->client()->Id;\n $agencyId = $user->client()->AgencyId;\n $unpaid = (int) $request->get('unpaid');\n\n $invoices = Api::request('BillingService\\ClientInvoices', compact('patientId', 'agencyId', 'unpaid'));\n\n return response()->json($invoices);\n }", "public function GetByPaginated($offset, $limit, $userId);", "public function getInvoices(array $params) : array {\n\n $query = $this->validateGetInvoices($params);\n\n if (array_key_exists('supplierId', $params) && count($params['supplierId']) > 0){\n foreach ($params['supplierId'] as $supplier){\n $query .= \"&supplierId=\".$supplier;\n }\n }\n\n $invoices = $this->request('/resto/api/documents/export/incomingInvoice', $this->key, 'GET', [], $query);\n\n $invoiceList = new SimpleXMLElement($invoices);\n $i = 0;\n foreach ($invoiceList->document as $inv){\n $this->invoices[] = new InvoiceObject(\n strval($inv->id),\n strval($inv->transportInvoiceNumber),\n strval($inv->incomingDate),\n strval($inv->supplier),\n strval($inv->defaultStore),\n strval($inv->dateIncoming),\n strval($inv->documentNumber),\n strval($inv->incomingDocumentNumber),\n strval($inv->conception),\n strval($inv->status),\n strval($inv->distributionAlgorithm)\n );\n\n foreach ($inv->items->item as $item) {\n $this->invoices[$i]->items[] = new InvoiceItemObject(\n strval($item->product),\n strval($item->productArticle),\n strval($item->supplierProduct),\n strval($item->supplierProductArticle),\n floatval($item->amount),\n strval($item->amountUnit),\n floatval($item->actualAmount),\n strval($item->store),\n strval($item->code),\n floatval($item->price),\n floatval($item->priceWithoutVat),\n floatval($item->sum),\n floatval($item->vatPercent),\n floatval($item->vatSum),\n floatval($item->discountSum),\n strval($item->num)\n );\n }\n\n\n $i++;\n }\n\n return $this->invoices;\n\n }", "public function index(SearchInvoice $request): ResourceCollection\n {\n return $this->doList($request);\n }", "function getDetailAllInvoice($account_id_local,$DbConnection)\n{\n $query = \"SELECT * FROM invoice USE INDEX(inve_aid_status) WHERE account_id='$account_id_local' AND status=1\";\t\n $result = mysql_query($query,$DbConnection);\n while($row = mysql_fetch_object($result))\n {\n /*$sno = $row->sno;\n $vehicle_no = $row->vehicle_no;\n $customer_code = $row->customer_code;\n $customer_name = $row->customer_name;\n $invoice_no = $row->invoice_no;\n $invoice_amount = $row->invoice_amount;\n $email_id = $row->email_id;\n $remarks = $row->remarks;\n $driver_name = $row->driver_name;\n $driver_phone_no = $row->driver_phone_no;\n $target_time = $row->target_time;\t\t\n $tracking_no = $row->tracking_no;\t\t\n $status = $row->status;*/\t\t\n $data[]=array('sno'=>$row->sno,'vehicle_no'=>$row->vehicle_no,'customer_code'=>$row->customer_code,'customer_name'=>$row->customer_name,'invoice_no'=>$row->invoice_no,'invoice_amount'=>$row->invoice_amount,'email_id'=>$row->email_id,'remarks'=>$row->remarks,'driver_name'=>$row->driver_name,'driver_phone_no'=>$row->driver_phone_no,'target_time'=>$row->target_time,'tracking_no'=>$row->tracking_no,'status'=>$row->status);\n }\t\t\t\t\n}", "function listClients($offset,$limit){\n\t\t$returnString = array();\n\t\t$sql = \"SELECT * FROM Client ORDER BY Client_ID ASC LIMIT $offset, $limit\";\n\t\t$data_p = mysql_query($sql);\n\t\tprint \"<table class=\\\"clients\\\"><tr><td>Client ID</td><td>Name</td><td>License Number</td><td>Policy Number</td></tr>\";\n\t\twhile($info = mysql_fetch_array( $data_p )){\n\t\t\tprint \"<tr><td><a href='client.php?action=update&client=\".$info['Client_ID'].\"'>\".$info['Client_ID'].\"</a></td><td>\";\n\t\t\tprint $info['FName'].\" \".$info['MName'].\" \".$info['LName'].\"</td><td>\";\n\t\t\tprint $info['License_No'].\"</td><td>\";\n\t\t\tprint \"<a href='policy.php?action=update&policy=\".$info['Policy_No'].\"&type=\";\n\t\t\tif($info['Company'] == 0 || $info['Company'] == null) { // Private Policy if true\n\t\t\t\tprint \"1'>P\".$info['Policy_No'].\"</a></td>\";\n\t\t\t} else { // Company Policy since false\n\t\t\t\tprint \"0'>C\".$info['Policy_No'].\"</a></td>\";\n\t\t\t}\n\t\t\t$this->printOptions($info['Client_ID']);\n\t\t\tprint \"</tr>\";\n\t\t}\n\t\tprint \"</table>\";\n\t}", "public function getAllInvoicesFromWebSerice() {\n $response = $this->_XeroOAuth->request('GET', $this->_XeroOAuth->url('Invoices', 'core'), array());\n if ($this->_XeroOAuth->response['code'] == 200) {\n $invoices = $this->_XeroOAuth->parseResponse($this->_XeroOAuth->response['response'], $this->_XeroOAuth->response['format']);\n return $invoices;\n } else {\n \\De\\Log::logApplicationInfo ( \"Caught Exception: \" . urldecode($response['response']) . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\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 selected_invoice($id=FALSE){\n\t\n\t$result\t= $this->db->get_where('invoice', array('client_id'=>$id));\n\treturn $result->result();\n}", "public function getRecentInvoices(int $limit = 5): array\n {\n $qb = $this->createQueryBuilder('i');\n\n $qb\n ->innerJoin('i.client', 'c')\n ->orderBy('i.created', Criteria::DESC)\n ->setMaxResults($limit);\n\n return $qb->getQuery()->getResult();\n }", "public function getInvoices()\n {\n $users = User::where('role_id', '=', 2)->lists('id')->toArray();\n $invoices = Invoice::whereIn('user_id', $users);\n\n return Datatables::of($invoices)\n ->editColumn('id', function ($invoice) {\n return '<a href=\"' . url('admin/invoices/' . $invoice->id) . '\">' . $invoice->id . '</a>';\n })\n ->addColumn('member_id', function ($invoice) {\n return $invoice->user->id;\n })\n ->editColumn('created_at', function ($invoice) {\n return Carbon::parse($invoice->created_at)->format('d-M-Y');\n })\n ->addColumn('due_date', function ($invoice) {\n if ($invoice->status == 'paid') {\n return 'Paid';\n }\n\n $formattedDueDate = Carbon::parse(explode(' ', $invoice->due_date)[0]);\n $formattedNowDate = Carbon::parse(explode(' ', Carbon::now())[0]);\n\n if ($formattedDueDate->eq($formattedNowDate))\n return 'Today';\n else if ($formattedDueDate->lt($formattedNowDate))\n return Carbon::parse($invoice->due_date)->diffForHumans();\n\n return Carbon::parse($invoice->due_date)->format('d-M-Y');\n })\n ->editColumn('total', function ($invoice) {\n return '$' . number_format($invoice->total, 2);\n })->addColumn('store_code', function ($invoice) {\n return isset($invoice->store_payment->code) ? $invoice->store_payment->code : '-';\n })\n ->editColumn('status', function ($invoice) {\n if ($invoice->status == 'paid') {\n return '<div class=\"invoice-stat-col\" style=\"color:#c12036;\">' .\n '<i class=\"check-icon\" aria-hidden=\"true\"></i>' .\n '<span>Paid</span>' .\n '</div>';\n } else if ($invoice->status == 'pending') {\n return '<div class=\"invoice-stat-col\" style=\"color:#d98800;\">' .\n '<i class=\"fa fa-clock-o\" aria-hidden=\"true\"></i>' .\n '<span>Pending approval</span>' .\n '</div>';\n } else if ($invoice->status == 'draft') {\n return '<div class=\"invoice-stat-col\" style=\"color:#0081d9;\">' .\n '<i class=\"fa fa-clipboard\" aria-hidden=\"true\"></i>' .\n '<span>Draft</span>' .\n '</div>';\n }\n\n return '<div class=\"invoice-stat-col\">' .\n '<i class=\"x-icon\" aria-hidden=\"true\"></i>' .\n '<span>Unpaid</span>' .\n '</div>';\n })\n ->addColumn('action', function ($invoice) {\n if ($invoice->status == 'draft')\n return '<a class=\"btn btn-primary\" href=\"' .\n url('admin/invoices/' . $invoice->id . '/send-invoice') .\n '\">Send Invoice</a>';\n\n if ($invoice->status == 'pending') {\n $btns = '<a class=\"btn btn-outline\" href=\"' .\n url('admin/invoices/' . $invoice->id . '/mark-as-payed') .\n '\">Mark as paid</a>';\n return $btns;\n }\n\n\n return '';\n })\n ->make(true);\n }", "public function clients($limit,$start,$is_deleted) \n\t{\n\t\t$sql = \"SELECT * FROM news_tbl WHERE is_deleted=0 ORDER BY news_id DESC LIMIT $start,$limit\";\n\t\t$val = $this->db->query($sql);\n\t\tif($val->num_rows() > 0) \n\t\t{\n\t\t\treturn $val->result_array();\n\t\t}\t\n\t\t\n\t}", "public function getUnpaidInvoicesList(InvoiceListingFilter $filter): Collection;", "public function invoice()\n\t{\n\t\t$tableName = 'master_invoice';\n\t\t$condition = array('send_status' => SENT);\n\t\t$result['invoice'] = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t$result['count'] = ($result['invoice'] != 0) ? count($result['invoice']) : 0;\n\n\t\t$this->load->view('london/layout/header');\n\t\t$this->load->view('london/layout/sidenavbar', $result);\n\t\t$this->load->view('london/pages/invoice', $result);\n\t\t$this->load->view('london/layout/footer');\n\t}", "function InfGetInvoice($inf_contact_id, $inf_invoice_id) {\n\t$object_type = \"Invoice\";\n\t$class_name = \"Infusionsoft_\" . $object_type;\n\t$object = new $class_name();\n\t$objects = Infusionsoft_DataService::query(new $class_name(), array('ContactId' => $inf_contact_id, 'Id' => $inf_invoice_id));\n\n $invoice_details = false;\n foreach ($objects as $i => $object) {\n\t\t$array = $object->toArray();\n $invoice_details = $array;\n }\n\treturn $invoice_details;\n}", "public function getAllInvoices($stardate,$enddate,$firm_id){\n\t \t $this->db->select(\"OSC.*, OC.invoice_no, OC.order_id, CO.order_number, C.comp_name, U.first_name, U.last_name\");\n\t\t\t$this->db->from(\"order_challan_shipping AS OSC\");\n\t\t\t$this->db->join('order_challan AS OC', 'OC.challan_no = OSC.challan_no');\t\n\t\t\t$this->db->join('client_orders AS CO', 'CO.order_id = OC.order_id');\n\t\t\t$this->db->join('clients AS C', 'CO.comp_id = C.comp_id');\n\t\t\t$this->db->join('users AS U', 'CO.uid = U.uid');\n\t\t\t\n\t\t\tif($firm_id > 0){\n\t\t\t\t$this->db->where(\"CO.invoice_firm \",$firm_id);\n\t\t\t}\n\t\t\tif($enddate != '' && $stardate !=''){\n\t\t\t\t$this->db->where(\"OC.chalan_date >=\",$stardate); \n\t\t\t\t$this->db->where(\"OC.chalan_date <=\",$enddate);\n\t\t\t}\n\t\t\t\n\t\t\t//$this->db->where(\"OC.invoice_no <>\",\"0\");\n\t\t\t$this->db->group_by('OC.challan_no');\t\t\t\n\t\t\t$this->db->order_by('OSC.account_confirmed ASC');\n\t\t\t$query_all_invoices = $this->db->get();\n\t\t\t/// echo $this->db->last_query();die;\n\t\t\tif($query_all_invoices->num_rows()>0)\n\t\t\t{\n\t\t\t\treturn $query_all_invoices->result_array();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t }", "public function view_invoice(){\n $search = $_POST['search']['value'];\n // $limit = $_POST['length'];\n // $start = $_POST['start'];\n $status = $this->input->post('status_bayar');\n $order_index = $_POST['order'][0]['column'];\n $order_field = $_POST['columns'][$order_index]['data'];\n $order_ascdesc = $_POST['order'][0]['dir'];\n $sql_total = $this->model_home->count_all_invoice($status);\n $sql_data = $this->model_home->filter_invoice($search,$order_field, $order_ascdesc,$status);\n $sql_filter = $this->model_home->count_filter_invoice($search,$status);\n $callback = array(\n 'draw' => $_POST['draw'],\n 'recordsTotal' => $sql_total,\n 'recordsFiltered' => $sql_filter,\n 'data' => $sql_data\n );\n\n header('Content-Type: application/json');\n echo json_encode($callback);\n }", "public function getCollections($idInvoice = 0){\n\t\t#variable de respuesta\n\t\t$response = array('status' => 'Succes');\n\t\tif($this->uri->segment(3)){\n\t\t\t$this->Query_ = 'SELECT * FROM \tcobro WHERE id_factura = ' . $idInvoice;\n\t\t}else{\n\t\t\t$this->Query_ = 'SELECT \n\t\t\t\t\tcob.id_cobro,\n\t\t\t\t\tcob.fecha,\n\t\t\t\t\tcob.id_factura,\n\t\t\t\t\tfac.id_factura,\n\t\t\t\t\ttrt.id_tratamiento,\n\t\t\t\t\tcli.nombres,\n\t\t\t\t\tcob.tipo,\n\t\t\t\t\tcob.nro_deposito,\n\t\t\t\t\tcob.valor\n\t\t\t\t\tFROM cobro AS cob\n\t\t\t\t\tLEFT JOIN factura as fac USING(id_factura)\n\t\t\t\t\tLEFT JOIN tratamiento as trt USING(id_tratamiento)\n\t\t\t\t\tLEFT JOIN cliente as cli using(id_cliente)';\n\t\t}\n\t\t#ejecutamos la consulta\n\t\t$this->Result_ = $this->db->query($this->Query_);\n\t\tif($this->Result_->num_rows() > 0){\n\t\t\t$response['msg'] = '3002';\n\t\t\t$response['data'] = $this->Result_->resul_array();\n\t\t}else{\n\t\t\tif($idInvoice != 0){\n\t\t\t\t$response['msg'] = '2001';\n\t\t\t}else{\n\t\t\t\t$response['msg'] = '2002';\n\t\t\t}\n\t\t}\n\t\t#envio de respuesta\n\t\t$this->rest->_responseHttp($response, $this->CodeHttp_);\n\t}", "public function invoices()\n {\n //\n $invoices = Invoice::orderBy('updated_at','DESC')->get();\n return view('reports.invoice',['invoices'=>$invoices]);\n }", "function displayInvoices($custId) {\n $sql = \"SELECT * FROM invoices \n WHERE customer_id = $custId\n \";\n \n $result = mysqli_query($GLOBALS[\"con\"], $sql);\n if ($result) {\n $rows = array();\n while ($row = mysqli_fetch_assoc($result)) {\n $rows[] = $row;\n }\n echo json_encode($rows);\n } \n \n }", "public function invoices()\n {\n $user = auth()->user();\n $facturas = DB::table('quotes')\n ->select('quotes.account_id', 'quotes.created_by_id', 'quotes.id as quoteId', 'quotes.quote_date',\n DB::raw(\"upper(quotes.quote_number) AS quote_number\"),\n 'quotes.invoice_date','quotes.stage_id',\n 'accounts.name as accountName','users.name as userName','stages.name as stageName',\n 'accounts.document_number','document_types.name as documenttype')\n ->join('accounts', 'accounts.id', '=', 'quotes.account_id')\n ->join('document_types', 'document_types.id', '=', 'accounts.document_type_id')\n ->join('stages', 'stages.id', '=', 'quotes.stage_id')\n ->join('users', 'users.id', '=', 'quotes.created_by_id')\n ->whereIn('quotes.stage_id', array(3,4))\n ->where('users.organization_id', $user->organization_id)\n ->orderByRaw('quotes.updated_at DESC')\n ->paginate(10);\n return view('quote.invoices',compact('facturas'));\n }", "public function invoice_list()\n {\n if (!get_permission('invoice', 'is_view')) {\n access_denied();\n }\n\n $branchID = $this->application_model->get_branch_id();\n if ($this->input->post('search')) {\n $this->data['class_id'] = $this->input->post('class_id');\n $this->data['section_id'] = $this->input->post('section_id');\n $this->data['invoicelist'] = $this->fees_model->getInvoiceList($this->data['class_id'], $this->data['section_id'], $branchID);\n }\n $this->data['branch_id'] = $branchID;\n $this->data['title'] = translate('payments_history');\n $this->data['sub_page'] = 'fees/invoice_list';\n $this->data['main_menu'] = 'fees';\n $this->load->view('layout/index', $this->data);\n }", "public function retrieveIncidentsResponse($client, $options = array())\n {\n $defaults = array(\n 'status' => null,\n 'sort_by' => 'DESC'\n );\n $options = array_merge($defaults, $options);\n extract($options);\n\n $incidentQuery = new IncidentQuery();\n $incidentQuery->setSortBy($sort_by);\n if (isset($status))\n {\n $incidentQuery->setStatus($status);\n }\n\n $incidentQueryResponse = $client->callService($incidentQuery);\n\n return $incidentQueryResponse;\n }", "public function invoice_list() {\n //$this->output->enable_profiler(TRUE);\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $payment_status = $this->input->get('payment_status');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $company_id = $this->input->get('company_id');\n if (!empty($_GET)) {\n $totalrows = $this->reportsModel->get_all_invoice_count($tenant_id, $payment_status, $start_date, $end_date, $company_id);\n $records_per_page = RECORDS_PER_PAGE;\n $baseurl = base_url() . 'reports_finance/invoice_list/';\n $pageno = ($this->uri->segment(3)) ? $this->uri->segment(3) : 1;\n $offset = ($pageno * $records_per_page);\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'ei.inv_date';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_all_invoice($tenant_id, $records_per_page, $offset, $field, $order_by, $payment_status, $start_date, $end_date, $company_id);\n $tabledata_count = count($tabledata);\n for ($i = 0; $i < $tabledata_count; $i++) {\n if ($tabledata[$i]->enrolment_mode === 'COMPSPON') {\n $tabledata[$i]->payment_status = $this->reportsModel->check_not_part_paid($tabledata[$i]->pymnt_due_id);\n }\n }\n $data['tabledata'] = $tabledata;\n $data['sort_order'] = $order_by;\n }\n $data['controllerurl'] = 'reports_finance/invoice_list/';\n $this->load->helper('pagination');\n $data['sort_link'] = $sort_link = \"payment_status=\" . $this->input->get('payment_status') . \"&start_date=\" . $this->input->get('start_date') . \"&end_date=\" . $this->input->get('end_date') . \"&company_id=\" . $this->input->get('company_id') . \"&company_name=\" . $this->input->get('company_name');\n $data['pagination'] = get_pagination($records_per_page, $pageno, $baseurl, $totalrows, $field, $order_by . '&' . $sort_link);\n $data['page_title'] = 'Accounting Reports - List and Search Invoice';\n $data['main_content'] = 'reports/invoice_list';\n $this->load->view('layout', $data);\n }", "public function get($id) {\n return Invoices::find($id);\n }", "static function getPaymentInvoiceHistory($invoice_id = null, $show_acknowledged = FALSE) {\n global $wpdb;\n if($invoice_id != null && !is_numeric($invoice_id)) {\n // probably not the cleanest way to avoid SQL injection...\n throw new DatabaseException(\"Ha! Nice try. Stop passing me junk. INV ID: \" . $invoice_id);\n }\n $where_clause = $invoice_id == null ? \"WHERE 1 = 1\" : \"WHERE id = $invoice_id\";\n $where_clause .= $show_acknowledged ? \"\" : \" AND acknowledged_date IS NULL\";\n $invoice_rs = $wpdb->get_results(\n \"SELECT i.id AS `invoice_id`, i.recipient_name, i.email AS `recipient_email`, \n i.payment_description, i.payment_amount AS `payment_requested`, i.lookup_key, i.acknowledged_date\n FROM wp_invoice i \n $where_clause\n ORDER BY i.id DESC\n LIMIT 100\" );\n \n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n // all transactions for those invoices matched above\n $transaction_rs = $wpdb->get_results(\n \"SELECT * FROM (\n SELECT tx.id AS `txn_id`, tx.invoice_id, tx.first_name, tx.last_name, tx.email, tx.vendor_tx_code, tx.payment_amount,\n txa.id AS `txn_auth_id`, txa.auth_status, txa.auth_status_detail, txa.card_type, txa.last_4_digits, txa.processed_date, txa.created_date\n FROM wp_sagepay_transaction tx\n INNER JOIN (SELECT id FROM wp_invoice $where_clause ORDER BY id DESC LIMIT 100) i ON (i.id = tx.invoice_id) \n LEFT OUTER JOIN wp_sagepay_tx_auth txa ON txa.vendor_tx_code = tx.vendor_tx_code\n UNION ALL \n SELECT NULL AS `txn_id`, invoice_id, first_name, last_name, email, vendor_tx_code, payment_amount, NULL as txn_auth_id, auth_status, auth_status_detail, card_type, last_4_digits, processed_date, created_date\n FROM wp_stripe_transaction tx\n INNER JOIN (SELECT id FROM wp_invoice $where_clause ORDER BY id DESC LIMIT 100) i ON (i.id = tx.invoice_id)\n ) x\n ORDER BY processed_date DESC\" );\n \n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n $notes_rs = $wpdb->get_results(\n \"SELECT n.invoice_id, n.notes AS `note_text`, n.created_date\n FROM wp_invoice_notes n\n INNER JOIN (SELECT id FROM wp_invoice $where_clause ORDER BY id DESC LIMIT 100) i ON (i.id = n.invoice_id) \n ORDER BY n.id\" );\n \n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n \n foreach( $invoice_rs as $inv ) {\n foreach( $transaction_rs as $txn ) {\n // push transaction onto invoice if matched\n if( $txn->invoice_id === $inv->invoice_id ) {\n if( ! isset( $inv->transactions )) {\n $inv->transactions = array();\n }\n $inv->transactions[] = $txn;\n }\n }\n foreach( $notes_rs as $note ) {\n if( $inv->invoice_id === $note->invoice_id ) {\n if( ! isset( $inv->notes )) {\n $inv->notes = array();\n }\n $inv->notes[] = $note;\n }\n }\n }\n return $invoice_rs;\n }", "public function show(Invoices $invoices)\n {\n //\n }", "public function GetByPaginated($offset, $limit);", "public function select_installment_invoices()\r\n {\r\n /*\r\n $this->db->select(\"invoice.*,cost.*\");\r\n $this->db->from(\"invoice\");\r\n $this->db->join('cost','invoice.installment_id=cost.id');\r\n $this->db->where(\"invoice.invoice_of\",\"1\"); //2 means installment\r\n $this->db->order_by(\"invoice.id\",\"desc\");\r\n $result = $this->db->get();\r\n */\r\n\r\n $this->db->select(\"*\");\r\n $this->db->select(\"user.name as user_name\");\r\n $this->db->select(\"invoice.id as invoice_id\");\r\n $this->db->select(\"user.family_name as user_surname\");\r\n $this->db->from(\"invoice\");\r\n $this->db->join('user', \"invoice.user_id = user.id\",\"left\");\r\n $this->db->order_by(\"invoice.id\",\"desc\");\r\n $result = $this->db->get();\r\n\r\n\r\n\r\n if ($result->num_rows()) {\r\n \r\n return $result->result_array();\r\n } else {\r\n return array();\r\n }\r\n }", "public function actionIndex($type=null,$start_date=null,$end_date=null,$uid=null)\n\t{\n\t\t$searchModel = new AccountInvoiceSearch();\n\n\n\t\t\n\t\tif($type):\n\t\t\tif(preg_match('/out/', $type)){\n\t\t\t\t$type = 'out_invoice';\n\t\t\t}else{\n\t\t\t\t$type = 'in_invoice';\n\t\t\t}\n\t\t\t$searchModel->type = $type;\n\t\tendif;\n\t\t\n\n\t\tif($start_date && $end_date){\n\t\t\t$searchModel->date_invoice = $start_date.' To '.$end_date;\n\t\t}\n\n\t\tif($uid){\n\t\t\t$searchModel->user_id=(int)$uid;\n\t\t}\n\n\t\t// $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\t$dataProvider = $searchModel->search();\n\t\tif($searchModel->load(Yii::$app->request->queryParams) && $searchModel->validate()){\n\t\t\t$dataProvider = $searchModel->search();\n\t\t}\n\t\t// var_dump(Yii::$app->request->queryParams);\n\t\t\n\t\t$paymentData = $searchModel->searchPaymentStatus();\n\t\t\n\n\t\t$pie=[\n\t\t\t'series'=>[]\n\t\t];\n\t\tforeach($paymentData as $payment):\n\t\t\t$pie['series'][] = [\n\t\t\t\t'name'=>$payment['status'],\n\t\t\t\t'y'=>floatval($payment['subtotal']),\n\t\t\t\t'color'=>($payment['status']=='Canceled' ? '#DC3912':($payment['status']=='Paid'?'#109618':'#3366CC')),\n\t\t\t\t'drilldown'=>str_replace(' ', '', strtolower($payment['status'])).'drill'\n\t\t\t];\n\t\t\t// prepare drill down\n\t\t\t$listStatus = $searchModel->searchPaymentStatus(true,$payment['status']);\n\t\t\t$drill = [];\n\t\t\tforeach($listStatus as $status):\n\t\t\t\t$drill[] = [\n\t\t\t\t\t'name'=>$status['name'],\n\t\t\t\t\t'y'=>floatval($status['subtotal']),\n\t\t\t\t];\n\t\t\tendforeach;\n\t\t\t$pie['drilldown'][]=[\n\t\t\t\t'id'=>str_replace(' ', '', strtolower($payment['status'])).'drill',\n\t\t\t\t'name'=>$payment['status'],\n\t\t\t\t'type'=>'pie',\n\t\t\t\t'data'=>$drill\n\t\t\t];\n\t\tendforeach;\n\t\t// var_dump($pie);\n\t\treturn $this->render('index', [\n\t\t\t'searchModel' => $searchModel,\n\t\t\t'dataProvider' => $dataProvider,\n\t\t\t'pie'=>$pie,\n\t\t]);\n\t}", "public function getPendingInvoices(){\n\t \t $this->db->select(\"OSC.*, OC.invoice_no, OC.order_id, CO.order_number\");\n\t\t\t$this->db->from(\"order_challan_shipping AS OSC\");\n\t\t\t$this->db->join('order_challan AS OC', 'OC.challan_no = OSC.challan_no');\t\n\t\t\t$this->db->join('client_orders AS CO', 'CO.order_id = OC.order_id');\t\n\t\t\t$this->db->where(\"OSC.account_confirmed\",\"0\");\n\t\t\t$this->db->where(\"OC.invoice_no <>\",\"0\");\n\t\t\t$this->db->group_by('OC.challan_no');\t\t\t\n\t\t\t$this->db->order_by('OSC.id DESC');\n\t\t\t$query_pending_invoices = $this->db->get();\n\t\t\t//echo $this->db->last_query();die;\n\t\t\tif($query_pending_invoices->num_rows()>0)\n\t\t\t{\n\t\t\t\treturn $query_pending_invoices->result_array();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t }", "public function get_all_invoice($table, $where, $per_page, $page)\n\t{\n\t\t//retrieve all invoice\n\t\t$this->db->from($table);\n\t\t$this->db->select('invoice.*, invoice.invoice_status_id AS status,member.member_first_name AS first_name, member.member_surname AS other_names, invoice_status.invoice_status_name');\n\t\t$this->db->where($where);\n\t\t$this->db->order_by('invoice.created, invoice.invoice_number');\n\t\t$query = $this->db->get('', $per_page, $page);\n\t\t\n\t\treturn $query;\n\t}", "public function searchInvoice($id, Request $request)\n {\n $search = $request->term;\n\n $invoices = CustomerInvoice::select('id', 'document_reference', 'total_tax_incl')\n ->where(function($query) use ($search)\n {\n $query->where ( 'id', 'LIKE', '%'.$search.'%' );\n $query->orWhere( 'document_reference', 'LIKE', '%'.$search.'%' );\n })\n ->where('customer_id', $request->input('customer_id'))\n ->where('currency_id', $request->input('currency_id'))\n ->where('status', 'closed')\n ->where('total_tax_incl', '>', 0.0)\n// ->toSql();\n ->get( intval(Configuration::get('DEF_ITEMS_PERAJAX')) );\n\n\n// dd($products);\n\n return response( $invoices );\n }", "public function getInvoice(string $id): Invoice;", "public function index()\n {\n \n $search['date'] = request('date') ? request('date') : Carbon::now()->toDateString();\n $search['medic'] = request('medic') ? request('medic') : '';\n $search['q'] = request('q');\n\n\n $office = auth()->user()->clinicsAssistants->first();\n $medics = $this->medicRepo->findAllByOffice($office->id);\n\n \n $invoices = Invoice::where('office_id', $office->id)->whereDate('created_at', $search['date']);\n if ($search['q']) {\n $facturas = $invoices->where('client_name', 'like', '%' . $search['q'] . '%');\n }\n\n\n if (is_blank($search['medic'])) {\n $invoices = $invoices->orderBy('created_at', 'DESC')->paginate(20);\n $totalInvoicesAmount = $invoices->sum('total');\n } else {\n $invoices = $invoices->where('user_id', $search['medic'])->orderBy('created_at', 'DESC')->paginate(20);\n $totalInvoicesAmount = $invoices->where('user_id', $search['medic'])->sum('total');\n }\n\n return view('assistant.invoices.index', compact('medics', 'office' , 'invoices', 'totalInvoicesAmount', 'search'));\n\n \n }", "public function getJobInvoices(RequestClass $request)\n {\n $jobToken = getJobToken($request);\n try{\n $job = $this->jobRepo->getByShareToken($jobToken);\n $input = Request::all();\n\n if($job->isMultiJob() && ine($input, 'project_id')) {\n $job = Job::where('id', $input['project_id'])->where('parent_id', $job->id)->firstOrFail();\n }\n $invoices = $job->invoices;\n $response = $this->response->collection($invoices, new JobInvoiceTransformer);\n \n return ApiResponse::success($response);\n } catch(ModelNotFoundException $e){\n return ApiResponse::errorNotFound('Project Not Found.');\n } catch(\\Exception $e){\n return ApiResponse::errorInternal(trans('response.error.internal'), $e);\n }\n }", "function viewInvoice($argID, $varPortalFilter) {\n $varID = \" FromUserType in('super-admin','user-admin') AND ToUserType = 'customer' AND pkInvoiceID ='\" . $argID . \"' \" . $varPortalFilter;\n $arrClms = array(\n 'pkInvoiceID',\n 'fkOrderID',\n 'CustomerName',\n 'CustomerEmail',\n 'Amount',\n 'InvoiceDetails',\n 'OrderDateAdded',\n 'InvoiceDateAdded'\n );\n $varTable = TABLE_INVOICE;\n $arrData = $this->select($varTable, $arrClms, $varID);\n // pre($arrData);\n return $arrData;\n }", "public function invoice($id = '')\n {\n if (!get_permission('invoice', 'is_view')) {\n access_denied();\n }\n\n $this->data['student_id'] = $id;\n $this->data['invoice'] = $this->fees_model->getInvoiceStatus($id);\n $this->data['basic'] = $this->fees_model->getInvoiceBasic($id);\n $this->data['title'] = translate('invoice_history');\n $this->data['main_menu'] = 'fees';\n $this->data['sub_page'] = 'fees/collect';\n $this->load->view('layout/index', $this->data);\n }", "function get_all_incident(mysqli $conn, $offset){\n\t \t\n\t//Variable à utiliser pour le clause limit de la requête\n\t$limit = PARAM_TOTAL_RECORD_PER_PAGE;\n\t$tab_incidents = [];\n\t\n\t\t$sql = \"SELECT \n\t\t\t\ti.id_incident as id, \n\t\t\t\tc.ref_commande as ref_com,\n\t\t\t\tt.nom_transporteur as trans_nom, \n\t\t\t\tt.ref_transporteur as trans_ref, \n\t\t\t\ta.nom_admin as admin_nom,\n\t\t\t\tDATE_FORMAT(a.date_admin, '%d/%m/%Y') as admin_date, \n\t\t\t\ti.statut_gestion as stat_gest,\n\t\t\t\ti.dossier_transporteur as doss_trans, \n\t\t\t\ti.statut_remboursement as stat_remb, \n\t\t\t\ti.doc_gestion as pdf, \n\t\t\t\ti.statut_document as stat_doc, \n\t\t\t\ti.statut_scanner as stat_scan, \n\t\t\t\ti.statut_mail as stat_mail, \n\t\t\t\tDATE_FORMAT(i.date_remboursement, '%d/%m/%Y') as date_remb, \n\t\t\t\ti.montant_remboursement as mt_remb,\n\t\t\t\tt.id_transporteur as id_trans \n\t\t\t\tFROM `incident` as i \n\t\t\t\tINNER JOIN commande as c \n\t\t\t\tON i.id_comm = c.id_commandes \n\t\t\t\tINNER JOIN admin as a \n\t\t\t\tON i.id_adm = a.id_admin \n\t\t\t\tINNER JOIN transporteur as t \n\t\t\t\tON c.id_trans = t.id_transporteur\t\t\t\t\n\t\t\t\";\n\t\t\t\n\t\t\t\n\t\t\t/*Les clauses where peuvent être à utiliser*/\n\t\t\t$cas = 1;\n\t\t\tif(isset($_GET['state-ge']) and $_GET['state-ge']==0){\t\t\t\n\t\t\t\t/*cas 1 par defaut\n\t\t\t\t* n'affiche que les incidents pas géré\n\t\t\t\t* on filtre par le champ statut_gestion\n\t\t\t\t*\n\t\t\t\t* statut_gestion = 0\n\t\t\t\t*/\n\t\t\t\t$statut_gestion = 0;\n\t\t\t\t$where = \" WHERE statut_gestion = ? \";\n\t\t\t\t$sql .= $where;\n\t\t\t $cas = 1;\n\t\t\t\t\n\t\t\t}elseif(!isset($_GET['state-ge']) and !isset($_GET['state-re'])){\t\t\t\n\t\t\t\t/*cas 2 \n\t\t\t\t* on affiche tous\n\t\t\t\t* pas de filtre par champ\n\t\t\t\t*\n\t\t\t\t$where = \"\";\n\t\t\t\t*/\n\t\t\t\t$where = \"\";\n\t\t\t\t$sql .= $where;\n\t\t\t $cas = 2;\n\t\t\t\t\n\t\t\t}elseif((isset($_GET['state-ge']) and $_GET['state-ge']==1) and ((isset($_GET['state-re']) and $_GET['state-re']==0))){\t\t\t\n\t\t\t\t/*cas 3 \n\t\t\t\t* n'affiche que les incidents géré mais encore en attente de remboursement\n\t\t\t\t* on filtre par les champs statut_gestion et statut_remboursement\n\t\t\t\t*\n\t\t\t\t* statut_gestion = 1\n\t\t\t\t* statut_remboursement = 0\n\t\t\t\t$where = \"WHERE statut_gestion = ? AND statut_remboursement = ?\";\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t$where = \"WHERE statut_gestion = ? AND statut_remboursement = ?\";\n\t\t\t\t$statut_gestion = 1;\n\t\t\t\t$statut_remboursement = 0;\n\t\t\t\t$sql .= $where;\n\t\t\t $cas = 3;\n\t\t\t\t\n\t\t\t}elseif(isset($_GET['state-re']) and $_GET['state-re']==1){\t\t\t\n\t\t\t\t/*cas 4 \n\t\t\t\t* n'affiche que les incidents géré et rembourser\n\t\t\t\t* on filtre avec le champ statut_remboursement\n\t\t\t\t*\n\t\t\t\t* statut_remboursement = 1\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t$statut_remboursement = 1;\n\t\t\t\t$where = \" WHERE statut_remboursement = ? \";\n\t\t\t\t$sql .= $where;\n\t\t\t $cas = 4;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t/*Le clause order by à utiliser*/\n\t\t\t$order_by = \" ORDER BY id\";\n\t\t\t$sql .= $order_by;\n\t\t\t\n\t\t\t/*Le clause limit à utiliser*/\n\t\t\t\n\t\t\t$lim = \" LIMIT ?, ?\";\n\t\t\t\n\t\t\t/*le SQL finale avec la clause limit*/\n\t\t\t$sql .= $lim;\n\t\n\tif ($stmt = mysqli_prepare($conn, $sql)) {\n\t\t/* Lecture des marqueurs */\n\t\tswitch($cas){\n\t\t\tcase 1:\n\t\t\t//Cas 1 on filtre avec le champ statut_gestion\n\t\t\tmysqli_stmt_bind_param($stmt, 'ddd', $statut_gestion ,$offset, $limit);\n\t\t\tbreak;\n\t\t\tcase 2:\t\t\n\t\t\t//Cas 2 pas de filtre\n\t\t\tmysqli_stmt_bind_param($stmt, 'dd', $offset, $limit);\n\t\t\tbreak;\n\t\t\tcase 3:\t\t\n\t\t\t//Cas 3 on filtre avec les champs statut_gestion et statut_remboursement\n\t\t\tmysqli_stmt_bind_param($stmt, 'dddd', $statut_gestion, $statut_remboursement, $offset, $limit);\n\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t//Cas 4 on affiche que les incident rembourser\t\t\t\n\t\t\tmysqli_stmt_bind_param($stmt, 'ddd', $statut_remboursement, $offset, $limit);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t/*Execution */\n\t\tif(mysqli_stmt_execute($stmt)){\n\t\t\t$result = mysqli_stmt_get_result($stmt);\n\t\t\t$i = 0;\n\t\t\twhile ($row = mysqli_fetch_assoc($result))\n\t\t\t{\n\t\t\t\t$tab_incidents[$i] = $row;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $tab_incidents;\t\t\n\t\t}else{\n\t\t\techo \"Error: \" . $sql . \"<br>\" . mysqli_stmt_error($stmt);\n\t\t}\t\t\n\t}else {\n\t\tprintf(\"Erreur - SQLSTATE %s.\\n\", mysqli_sqlstate($conn));\n\t}\n}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t// Force model to only show invoices for current business\n\t\t$criteria->alias = 'Invoice';\n\t\t$criteria->select = 'Invoice.*';\n\t\t$criteria->join='LEFT JOIN Client ON Client.id=Invoice.clientId';\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('clientId',$this->clientId);\n\n\t\t$criteria->compare('invoiceDate',$this->invoiceDate,true);\n\n\t\t$criteria->compare('dueDate',$this->dueDate,true);\n\n\t\t$criteria->compare('invoiceTotal',$this->invoiceTotal,true);\n\n\t\t$criteria->compare('clientNotes',$this->clientNotes,true);\n\n\t\t$criteria->compare('invoiceNotes',$this->invoiceNotes,true);\n\n\t\t$criteria->compare('status',$this->status);\n\n\t\t$criteria->compare('active',$this->active);\n\n\t\t$criteria->compare('created',$this->created,true);\n\n\t\t$criteria->compare('lastModified',$this->lastModified,true);\n\n\t\t$criteria->compare('lastUpdatedBy',$this->lastUpdatedBy);\n\t\t\n\t\t$criteria->order = \"Invoice.id DESC\";\n\n\t\t$criteria->condition='Client.businessId='. Yii::app()->userInfo->business;\n\t\t\treturn new CActiveDataProvider('Invoice', array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array('pageSize'=>20),\n\t\t\t\n\t\t));\n\t}", "public function getInvoices($partner_id, $state = null, $direction = null, $type = null)\n {\n $model = 'account.invoice';\n\n $context = array();\n\n $invoice_type = '{direction}_{type}';\n\n if (! isset($direction) || ($direction != 'in' && $direction != 'out')) {\n $direction = '%';\n }\n $invoice_type = str_replace('{direction}', $direction, $invoice_type);\n\n if ( ! isset($type) || ($type != 'invoice' && $type != 'refund')) {\n $type = '%';\n }\n $invoice_type = str_replace('{type}', $type, $invoice_type);\n\n if (isset($partner_id)) $context[] = array('partner_id', '=', (int)$partner_id);\n\n if (isset($state)) $context[] = array('state', '=', strtolower($state));\n\n // type is:\n // 'out_invoice' (Invoice), 'out_refund' (Refund),\n // 'in_invoice' (Supplier Invoice), 'in_refund' (Supplier Refund).\n $context[] = array('type', 'like', $invoice_type);\n\n // Get all the partner invoice IDs.\n $ids = $this->search($model, $context);\n\n // Now get the invoices.\n if (!empty($ids)) {\n $invoices = $this->read($model, $ids);\n } else {\n $invoices = array();\n }\n\n return $invoices;\n }", "public function fetchAll(string $status, ?int $from = null, ?int $to = null): array\n {\n $this->invoiceId = null;\n\n return parent::restGetPages('tickets',\n $from,\n $to,\n ['companies', $this->client->getCompanyId(), 'tickets', $status],\n ['api_key' => $this->client->getApiKey()]);\n }", "public function index()\n {\n $user = Auth::user();\n $business = $user->business;\n $outgoingInvoices = $business->outgoingInvoices()->with('invoiceItems')->where('status','draft')->orderBy('created_at', 'desc')->paginate(16);\n return response()->json(\n $outgoingInvoices,\n 200\n );\n }", "public function invoiceStatus(Request $request)\n {\n $response = BilldeskHmac::invoiceGet($request->invoice_no);\n }", "public function getInvoices(?GetInvoices $getInvoices = null): array\n {\n $params = $getInvoices ? $getInvoices->toArray() : [];\n $out = $this->request('getInvoices', ['query' => $params]);\n\n if (!isset($out['result']['items'])) {\n return [];\n }\n\n return array_map(static function($item) {\n return new Invoice($item);\n }, $out['result']['items']);\n }", "function cicleinscription_get_report_inscriptions($page = 0, $perpage = 0, $username = null, $organid = null, $courseid = null, $cicleinscriptionid, $sort = \"u.firstname ASC\"){\n\tglobal $DB;\n\n\t$limitsql = '';\n\t$page = (int) $page;\n\t$perpage = (int) $perpage;\n\n\t# Iniciando paginacao\n\tif($page || $perpage){\n\t\tif ($page < 0) {\n\t\t\t$page = 0;\n\t\t}else if ($perpage < 1) {\n\t\t\t$perpage = ITEMS_PER_PAGE;\n\t\t}\n\t\t$limitsql = \" LIMIT $perpage\" . \" OFFSET \" . $page * $perpage;\n\t}\n\n\t// validando filtro\n\t$andfilter = false;\n\t$arrayfilter = array($cicleinscriptionid);\n\n\tif($username){\n\t$andfilter = 'AND ci.username = ?';\n\t\tarray_push($arrayfilter, $username);\n\t}\n\tif ($courseid){\n\t$andfilter .= 'AND ci.course_prematriculationid = ?';\n\t\tarray_push($arrayfilter, $courseid);\n\t}\n\tif ($organid){\n\t$andfilter .= 'AND ci.organid = ?';\n\t\tarray_push($arrayfilter, $organid);\n\t}\n\n\t// recupera itens cadastrados\n\t$rs = $DB->get_recordset_sql(\"\n\tSELECT Concat(u.firstname, ' ', u.lastname) as userfullname,\n\t o.name as organ,\n\t c.fullname as course,\n\t u.city as city,\n\t u.id as userid\n\tFROM\n\t {ci_prematriculation} AS ci\n\tINNER JOIN\n\t {user} u\n\t ON ci.username = u.username\n\tINNER JOIN\n\t\t{ci_organ} o\n\tON ci.organid = o.id\n\tINNER JOIN\n\t\t{course} c\n\tON ci.course_prematriculationid = c.id\n\tWHERE\n\t ci.cicleinscriptionid = ?\n\tAND ci.status_prematriculationid = 1\n\t{$andfilter}\n\tORDER BY {$sort} {$limitsql}\",\n\t$arrayfilter);\n\n\treturn $rs;\n}", "public function find_officer()\n { \n $query = get_post('q');\n $where = 'deletedAt IS NULL' .\n 'AND (MabuhayID LIKE \"' . $query . '%\" OR CONCAT(FirstName, \" \", LastName) LIKE \"' . $query . '%\")' .\n 'AND AccountTypeID IN(2,3)';\n $users = $this->mgovdb->getRecords('UserAccountInformation', $where);\n $items = array();\n foreach ($users as $user) {\n $items[] = array(\n 'id' => $user['id'],\n 'firstname' => $user['FirstName'],\n 'lastname' => $user['LastName'],\n 'fullname' => $user['FirstName'] . ' ' . $user['LastName'],\n 'mabuhayID' => $user['MabuhayID'],\n 'email' => $user['EmailAddress'],\n 'contact' => $user['ContactNumber'],\n 'gender' => lookup('gender', $user['GenderID']),\n 'address' => array_values(array_reverse(lookup_address($user))),\n 'photo' => photo_filename($user['Photo']),\n 'actype' => lookup('account_type', $user['AccountTypeID']),\n 'aclevel' => lookup_db('UserAccountLevel', 'LevelName', $user['AccountLevelID'])\n );\n }\n response_json($items);\n }", "function m_displayInvoiceList()\n\t{\n\t\t#QUERY ORDER TABLE\n\t\t$this->obDb->query = \"SELECT iOrderid_PK,iInvoice,tmOrderDate,iOrderStatus FROM \".ORDERS.\" WHERE\t iCustomerid_FK= '\".$_SESSION['userid'].\"' ORDER BY tmOrderDate DESC\";\n\t\t$rsOrders = $this->obDb->fetchQuery();\n\t\tif($this->obDb->record_count>0)\n\t\t{\n\t\t\tfor($i=0;$i<$this->obDb->record_count;$i++)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_STATUS\",\"Incomplete\");\n\t\t\t\tif($rsOrders[$i]->iOrderStatus==1){\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_STATUS\",\"Complete\");\n\t\t\t\t}\n\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ORDERDATE\", $this->libFunc->dateFormat2($rsOrders[$i]->tmOrderDate));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_INVOICE\", $this->libFunc->m_displayContent($rsOrders[$i]->iInvoice));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_DETAILS_LINK\", $this->libFunc->m_safeUrl(SITE_SAFEURL.\"ecom/index.php?action=checkout.receipt&mode=\".$rsOrders[$i]->iOrderid_PK));\n\n\t\t\t\t$this->ObTpl->parse(\"orderlist_blk\",\"TPL_ORDERLIST_BLK\",true);\n\t\t\t}\n\t\t\t$this->ObTpl->parse(\"orderlistmain_blk\",\"TPL_ORDERLISTMAIN_BLK\");\n\t\t}\n\t}", "function enhanced_invoice($order_id, $end = 0){\n $order = $this->order_model->get($order_id);\n $order_type = $this->order_model->get_order_type($order->order_type);\n $od = $this->order_details_model->get_order_details($order_id, true);\n\n $inv = array();\n $total = 0;\n foreach ($od as $key) {\n $inv[$key->id]['name'] = $key->arabic;\n $inv[$key->id]['eng'] = $key->eng;\n $inv[$key->id]['price'] = $key->price;\n $inv[$key->id]['qty'] = $key->quantity;\n $inv[$key->id]['total_line'] = $key->quantity*$key->price;\n $total += $inv[$key->id]['total_line'];\n }\n //$items_table = to_table($inv);\n\n $this->load->helper('orders');\n $s = get_service($order->order_type);\n\n $service = get_service_value($total, $s);\n $grand_total = $total+$service;\n \n $this->data['grand_total'] = $grand_total;\n $this->data['service_value'] = ($service)? $service : 0;\n $this->data['ratio'] = $s;\n $this->data['total'] = $total;\n $this->data['table'] = $this->order_model->get_table($order->customer_id);\n $this->data['order'] = $order;\n $this->data['order_type'] = $order_type;\n $this->data['items_table'] = $inv ;\n\n $this->check_order($order_type, $this->data);\n\n\n $invID = str_pad($order->id, 5, '0', STR_PAD_LEFT); \n\n$header = $this->load->view('app/orders/invoice/header',$this->data, true);\n$items = $this->load->view('app/orders/invoice/items', $this->data, true);\n$footer = $this->load->view('app/orders/invoice/footer',$this->data, true);\n\n $od = $this->order_details_model->get_count($order_id);\n\n\n $format = $this->get_pdf_format($od);\n\n $this->load->library('pdf', array(\n 'format'=>$format, \n 'title'=>'Club21 Cafe & Restaurant', \n 'string'=>'Invoice Details', \n 'footer'=>false\n ));\n //$this->pdf->lib_setTitle('Invoice Details');\n $this->pdf->lib_Cell(0, 10, \"$od lines [ $format ] $order_type->name\", 1, 1, 'C');\n\n $y_head = $this->pdf->lib_getY();\n $this->pdf->lib_writeHTMLCell(0, 0, 0, $y_head, $header, 1, 0, false, true, '', true);\n $y_items = $y_head + $this->pdf->lib_getLastH();\n $this->pdf->lib_writeHTMLCell(0, 0, 0, $y_items, $items, 0, 0, false, true, '', true);\n $y_foot = $y_items + $this->pdf->lib_getLastH();\n $this->pdf->lib_writeHTMLCell(0, 0, 0, $y_foot, $footer, 0, 0, false, true, '', true);\n\n\n $this->pdf->lib_output(APPPATH .\"invoice/inv_$invID.pdf\");\n $this->pdf_image(APPPATH .\"invoice/inv_$invID.pdf\"); \n $this->load->library('ReceiptPrint'); \n $this->receiptprint->connect('192.168.0.110', 9100);//any ip and port \n $this->receiptprint->print_image(APPPATH .\"invoice/inv_$invID.pdf.$this->ext\"); \n//unlink(APPPATH .\"invoice/inv_$invID.pdf.$this->ext\");\n if($end == 1 )\n $this->end($order_id, $grand_total);\n $this->edit_order($order->id);\n\n }", "public function get_invoice_items($invoice_id)\n\t{\n\t\t$this->db->select('invoice_item.*');\n\t\t$this->db->where('invoice_item.invoice_id = '.$invoice_id);\n\t\t$query = $this->db->get('invoice_item');\n\t\t\n\t\treturn $query;\n\t}", "public function getflatInvoice() {\r\n $result = $this->clients->flatInvoice();\r\n\r\n foreach ($result as $key => $value) {\r\n $clientId = $this->clients->getClientId($value->CustomerCompanyID);\r\n $result[$key]->ClientId = $clientId;\r\n }\r\n\r\n foreach ($result as $key => $value) {\r\n $getTaxdetails = $this->clients->getVatfaltType($value->ClientId);\r\n $PercentRateAfterEndDate = $getTaxdetails->PercentRateAfterEndDate;\r\n $StartDate = $getTaxdetails->StartDate;\r\n $EndDate = $getTaxdetails->EndDate;\r\n $PercentRate = $getTaxdetails->PercentRate;\r\n\r\n $result[$key]->Type = $Type;\r\n $result[$key]->PercentRateAfterEndDate = $PercentRateAfterEndDate;\r\n $result[$key]->StartDate = $StartDate;\r\n $result[$key]->EndDate = $EndDate;\r\n $result[$key]->PercentRate = $PercentRate;\r\n }\r\n foreach ($result as $key => $vat_listing) {\r\n $FlatRate = '';\r\n $NetSales = '';\r\n if (empty($vat_listing->Type) && empty($vat_listing->PercentRateAfterEndDate) && empty($vat_listing->PercentRate)) {\r\n $var = array('FlatRate' => 0, 'NetSales' => $vat_listing->InvoiceTotal);\r\n } else {\r\n if ($vat_listing->InvoiceTotal != 0 && $vat_listing->PaidOn != '') {\r\n if (strtotime($vat_listing->PaidOn) <= strtotime($vat_listing->EndDate)) {\r\n $flateRate = ($vat_listing->InvoiceTotal * $vat_listing->PercentRateAfterEndDate) / 100;\r\n } else {\r\n $flateRate = ($vat_listing->InvoiceTotal * $vat_listing->PercentRate) / 100;\r\n }\r\n $FlatRate = $flateRate;\r\n } else {\r\n $FlatRate = '0.00';\r\n }\r\n if ($vat_listing->InvoiceTotal != 0) {\r\n $NetSales = (($vat_listing->InvoiceTotal - $FlatRate));\r\n } else {\r\n $NetSales = '0.00';\r\n }\r\n $var = array('FlatRate' => trim($FlatRate), 'NetSales' => trim($NetSales));\r\n }\r\n $response = $this->clients->updateFlatandnetsales($vat_listing->InvoiceID, $var);\r\n echo $response . \"<br/>\";\r\n }\r\n }", "public function getInvoicesDataTable($codigoInvoices='')\n {//var_dump($_POST);exit;\n echo ($this->invm->ShowInvoicesTable($codigoInvoices));\n }" ]
[ "0.70171547", "0.6737925", "0.65411234", "0.6535485", "0.65344656", "0.6527238", "0.64166236", "0.638292", "0.6378124", "0.63144255", "0.62796354", "0.6273689", "0.61783254", "0.6092846", "0.60784084", "0.59767044", "0.59664977", "0.59593934", "0.59463686", "0.59462917", "0.5916577", "0.59010816", "0.58979297", "0.58894503", "0.5875124", "0.58577627", "0.58560807", "0.58551496", "0.5843616", "0.5819639", "0.5793261", "0.5735399", "0.57260275", "0.57240236", "0.5705342", "0.570486", "0.57015365", "0.5667298", "0.56518656", "0.56278473", "0.5621071", "0.5581793", "0.5575661", "0.5572707", "0.5545441", "0.5545034", "0.55306655", "0.5514775", "0.5512823", "0.55118185", "0.55071133", "0.5505355", "0.55052924", "0.5492414", "0.54844105", "0.54832065", "0.5482839", "0.5468838", "0.54627764", "0.54621935", "0.5452213", "0.54459673", "0.5444077", "0.5437328", "0.5437318", "0.54340434", "0.5396243", "0.5392282", "0.53760684", "0.53758883", "0.53754884", "0.534482", "0.53433156", "0.533593", "0.5331781", "0.53257155", "0.5324732", "0.53186697", "0.53176576", "0.5303066", "0.5301551", "0.52985895", "0.5297614", "0.52946234", "0.5286652", "0.5278034", "0.52571416", "0.5255763", "0.5253792", "0.5252984", "0.5248136", "0.52390206", "0.52277565", "0.52258724", "0.5221973", "0.52094924", "0.51861656", "0.51806164", "0.5177871", "0.5176313" ]
0.63191724
9
This command is used to obtain an invoice for a client. Parameters: invoiceid should be the invoice id you wish to retrieve Optional Parameters: none See:
public function whmcs_get_invoice($params = array()) { $params['action'] = 'GetInvoice'; // return Whmcs_base::send_request($params); $load = new Whmcs_base(); return $load->send_request($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getInvoice($invoiceId);", "public function getInvoice($invoice_id)\n {\n return $this->remote->select()->from('invoice')->where('id', '=', $invoice_id)->fetch();\n }", "public function invoice_info( $invoice_id ) {\r\n\t\treturn $this->_send_request( 'invoices/'.$invoice_id );\r\n\t}", "public function get_invoice( $invoice_id ) {\n \n // Check if the session exists and if the login user is admin\n $this->check_session($this->user_role, 1);\n \n // Get invoice details\n $invoice = $this->invoice->get_invoice( $invoice_id ); \n \n // Verify if invoice exists\n if ( $invoice ) {\n \n echo json_encode(['transaction_id' => $invoice[0]->transaction_id,\n 'invoice_date' => $this->get_invoice_time($invoice[0]->invoice_date),\n 'from_period' => $this->get_invoice_time($invoice[0]->from_period),\n 'to_period' => $this->get_invoice_time($invoice[0]->to_period),\n 'invoice_title' => $this->get_invoice_placeholders($invoice[0]->invoice_title, ['username' => $invoice[0]->username]),\n 'invoice_text' => $this->get_invoice_placeholders($invoice[0]->invoice_text, ['username' => $invoice[0]->username]),\n 'invoice_amount' => $invoice[0]->amount . ' ' . $invoice[0]->currency,\n 'invoice_taxes' => $invoice[0]->taxes . ' %',\n 'invoice_total' => $invoice[0]->total . ' ' . $invoice[0]->currency,\n 'plan_name' => $invoice[0]->plan_name]);\n \n }\n \n }", "public function getInvoice(string $id): Invoice;", "function bpGetInvoice($invoiceId, $apiKey=false) {\r\n\t\r\n}", "public function get_invoice($invoice_id)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->where('invoice.member_id = member.member_id AND invoice.invoice_status = invoice_status.invoice_status_id AND invoice.invoice_id = '.$invoice_id);\n\t\t$query = $this->db->get('invoice, invoice_status, member');\n\t\t\n\t\treturn $query;\n\t}", "public function get($invoiceId)\n {\n $fullResult = $this->client->call(\n 'crm.invoice.get',\n array('id' => $invoiceId)\n );\n return $fullResult;\n }", "public function readClientInvoices($id) {\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 $sql = \"SELECT * FROM invoice WHERE clientid = '{$id}'\";\r\n $invoices = Invoice::find_by_sql($sql);\r\n if (!$invoices) {\r\n throw new RestException(400, \"no invoices\");\r\n }\r\n return $invoices;\r\n }", "public function getInvoice($id)\n {\n $responseString = $this->apiCall('GET', 'invoices/'.$id);\n try\n {\n $responseObject = $this->parseResponse($responseString);\n return $responseObject->Invoice;\n }\n catch(Exception $e)\n {\n echo 'Can`t parse API response: '.$e->getMessage;\n return false;\n }\n }", "public function selected_invoice($id=FALSE){\n\t\n\t$result\t= $this->db->get_where('invoice', array('client_id'=>$id));\n\treturn $result->result();\n}", "public function get_one_invoice($client_id, $invoices, $type)\r\n {\r\n \r\n $exclude = '';\r\n \r\n if ($invoices != NULL) {\r\n array_walk($invoices, create_function('&$item, $key', '$item = \"\\'{$item}\\'\";'));\r\n $invoices = implode(',', $invoices);\r\n $exclude = \" and invoice_number not in ($invoices)\";\r\n } \r\n \r\n if ($type == 'received') {\r\n $sql = \"SELECT * FROM invoice WHERE client_id = {$client_id} AND paid = FALSE \r\n AND state in (0, 1 , 9) and total_amount > 0 AND type = 0 $exclude ORDER BY invoice_time ASC LIMIT 1\";\r\n } else {\r\n $sql = \"SELECT * FROM invoice WHERE client_id = {$client_id} AND paid = FALSE\r\n AND state = 0 AND type = 3 and total_amount > 0 $exclude ORDER BY invoice_time ASC LIMIT 1\";\r\n }\r\n \r\n $data = $this->query($sql);\r\n return $data;\r\n }", "public function show(Invoices $invoice)\n {\n return $invoice;\n }", "public function readInvoice($id) {\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 $invoice = Invoice::find_by_id($id);\r\n if (!$invoice) {\r\n throw new RestException(400, \"no such invoice\");\r\n }\r\n return $invoice;\r\n }", "public function actionInvoice($id){\n $invoice = Yii::$app->user->identity->getInvoices()\n ->where(['invoice_id' => (int) $id])->one();\n\n if(!$invoice) die(\"Invoice not found\");\n\n return $this->renderPartial('invoice', [\n 'invoice' => $invoice\n ]);\n }", "public function print_invoice( $invoice_id ) {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Get invoice details\n $invoice = $this->invoice->get_invoice( $invoice_id ); \n \n // Verify if invoice exists\n if ( $invoice ) {\n \n if ( $invoice[0]->user_id === $this->user_id ) {\n \n // Get the invoice logo\n $invoice_logo = get_option( 'main-logo' );\n\n if ( get_option( 'invoice-logo' ) ) {\n\n $invoice_logo = get_option( 'invoice-logo' );\n\n }\n\n // Get the invoice billing period text\n $billing_period = 'Billing Period';\n\n if ( get_option( 'invoice-billing-period' ) ) {\n\n $billing_period = get_option( 'invoice-billing-period' );\n\n } \n\n // Get the invoice transaction id\n $transaction_id = 'Transaction ID';\n\n if ( get_option( 'invoice-transaction-id' ) ) {\n\n $transaction_id = get_option( 'invoice-transaction-id' );\n\n } \n\n // Get the invoice date format\n $date_format = 'dd-mm-yyyy';\n\n if ( get_option( 'invoice-date-format' ) ) {\n\n $date_format = get_option( 'invoice-date-format' );\n\n }\n\n // Get the invoice hello text\n $hello_text = 'Hello [username]';\n\n if ( get_option( 'invoice-hello-text' ) ) {\n\n $hello_text = get_option( 'invoice-hello-text' );\n\n }\n\n // Get the invoice message\n $message = 'Thanks for using using our services.';\n\n if ( get_option( 'invoice-message' ) ) {\n\n $message = get_option( 'invoice-message' );\n\n }\n\n // Get the invoice date word\n $date = 'Date';\n\n if ( get_option( 'invoice-date' ) ) {\n\n $date = get_option( 'invoice-date' );\n\n }\n\n // Get the invoice description word\n $description = 'Description';\n\n if ( get_option( 'invoice-description' ) ) {\n\n $description = get_option( 'invoice-description' );\n\n } \n\n // Get the invoice description text\n $description_text = 'Upgrade Payment';\n\n if ( get_option( 'invoice-description-text' ) ) {\n\n $description_text = get_option( 'invoice-description-text' );\n\n } \n\n // Get the invoice amount word\n $amount = 'Amount';\n\n if ( get_option( 'invoice-amount' ) ) {\n\n $amount = get_option( 'invoice-amount' );\n\n } \n\n // Get the invoice amount word\n $taxes = 'Taxes';\n\n if ( get_option( 'invoice-taxes' ) ) {\n\n $taxes = get_option( 'invoice-taxes' );\n\n } \n\n // Get the invoice taxes value\n $taxes_value = '';\n\n if ( get_option( 'invoice-taxes-value' ) ) {\n\n $taxes_value = get_option( 'invoice-taxes-value' );\n\n } \n\n // Get the invoice total word\n $total = 'Total';\n\n if ( get_option( 'invoice-total' ) ) {\n\n $total = get_option( 'invoice-total' );\n\n }\n\n // Get the no reply message\n $no_reply = 'Please do not reply to this email. This mailbox is not monitored and you will not receive a response. For assistance, please contact us to [email protected].';\n\n if ( get_option( 'invoice-no-reply' ) ) {\n\n $no_reply = get_option( 'invoice-no-reply' );\n\n } \n \n echo '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"1000px\">\n <tbody><tr><td align=\"center\" width=\"600\" valign=\"top\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tbody>\n <tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"#ffffff\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin-bottom:10px;\" width=\"100%\">\n <tbody><tr valign=\"bottom\"> \n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n <td align=\"left\" height=\"64\">\n <img alt=\"logo\" class=\"invoice-logo\" src=\"' . $invoice_logo . '\">\n </td> \n <td width=\"40\" align=\"center\" valign=\"top\">&nbsp;</td>\n <td align=\"right\">\n <span style=\"padding-top:15px;padding-bottom:10px;font:italic 12px;color:#757575;line-height:15px;\">\n <span style=\"display:inline;\">\n <span class=\"invoice-billing-period\">' . $billing_period . '</span> <strong><span class=\"invoice-date-format billing-period-from\">' . $this->get_invoice_time($invoice[0]->from_period) . '</span> to <span class=\"invoice-date-format billing-period-to\">' . $this->get_invoice_time($invoice[0]->to_period) . '</span></strong>\n </span>\n <span style=\"display:inline;\">\n <br>\n <span class=\"invoice-transaction-id\">' . $transaction_id . '</span>: <strong class=\"transaction-id\">' . $invoice[0]->transaction_id . '</strong>\n </span>\n </span>\n </td>\n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n </tr>\n </tbody>\n </table>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"padding-bottom:10px;padding-top:10px;margin-bottom:20px;\" width=\"100%\">\n <tbody><tr valign=\"bottom\"> \n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n <td valign=\"top\" style=\"font-family:Calibri, Trebuchet, Arial, sans serif;font-size:15px;line-height:22px;color:#333333;\" class=\"yiv1811948700ppsans\">\n <p>\n </p><div style=\"margin-top:30px;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;\"><span style=\"color:#333333;font-weight:bold;font-family:arial, helvetica, sans-serif; margin-left: 2px;\" class=\"invoice-hello-text\">' . $this->get_invoice_placeholders($hello_text, array('username' => $invoice[0]->username) ) . ' </span><table><tbody><tr><td valign=\"top\" class=\"invoice-message\">' . $this->get_invoice_placeholders($message, array('username' => $invoice[0]->username) ) . '</td><td></td></tr></tbody></table><br><div style=\"margin-top:5px;\">\n <br><div class=\"yiv1811948700mpi_image\" style=\"margin:auto;clear:both;\">\n </div>\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"clear:both;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;margin-top:20px;\" width=\"100%\">\n <tbody>\n <tr>\n <td style=\"text-align:left;border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color:#333333;\" class=\"invoice-date\" width=\"10%\">' . $date . '</td>\n <td style=\"border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color:#333333;\" width=\"80%\" class=\"invoice-description\">' . $description . '</td>\n <td style=\"text-align:right;border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color:#333333;\" width=\"10%\" class=\"amount\">' . $amount . '</td>\n </tr>\n <tr>\n <td style=\"padding:10px;\" width=\"80%\">\n <span class=\"invoice-description-text\">' . $description_text . '</span>\n <br>\n\n <span style=\"display:inline;font-style: italic;color: #888888;\" class=\"invoice-plan-name\">' . $invoice[0]->plan_name . '</span>\n </td>\n <td style=\"text-align:right;padding:10px;\" width=\"10%\"></td>\n <td style=\"text-align:right;padding:10px;\" width=\"10%\" class=\"invoice-amount\">' . $invoice[0]->amount . ' ' . $invoice[0]->currency . '</td>\n </tr>\n </tbody>\n </table>\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-top:1px solid #ccc;border-bottom:1px solid #ccc;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;margin-bottom:10px;\" width=\"100%\">\n <tbody>\n <tr>\n <td>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;margin-top:10px;\">\n <tbody>\n <tr class=\"taxes-area\" style=\"display: none;\">\n <td style=\"width:80%;text-align:right;padding:0 10px 10px 0;\" class=\"invoice-taxes\">' . $taxes . '</td>\n <td style=\"width:20%;text-align:right;padding:0 10px 10px 0;\">\n <span style=\"display:inline;\" class=\"invoice-taxes-value\">' . $taxes_value . ' %</span>\n\n </td>\n </tr>\n <tr>\n <td style=\"width:80%;text-align:right;padding:0 10px 10px 0;\">\n <span style=\"color:#333333;font-weight:bold;\" class=\"invoice-total\">' . $total . '</span>\n </td>\n <td style=\"width:20%;text-align:right;padding:0 10px 10px 0;\" class=\"invoice-total-value\">' . $invoice[0]->total . ' ' . $invoice[0]->currency . '</td>\n </tr>\n </tbody></table>\n </td>\n </tr>\n\n </tbody></table>\n <span style=\"font-size:11px;color:#333;\" class=\"invoice-no-reply\">' . $no_reply . '</span></div>\n <span style=\"font-weight:bold;color:#444;\">\n </span>\n <span>\n </span>\n </div></td>\n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n </tr>\n </tbody>\n </table>\n <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>\n </td>\n </tr>\n </tbody>\n </table> \n </td>\n </tr>\n </tbody>\n </table>';\n \n exit();\n \n }\n \n }\n \n show_404();\n \n }", "function get_invoice_by_id ( $id )\n {\n if (!is_int($id))\n {\n throw new TypeError('$id should be an integer');\n }\n\n $invoice = $this->dsQuery ('Invoice',1,0, array (\n 'Id' => $id\n ), array (\n 'ContactId',\n 'DateCreated',\n 'InvoiceTotal',\n 'PayStatus',\n 'RefundStatus',\n 'Description',\n 'ProductSold'\n ));\n\n if (is_array($invoice))\n {\n return $invoice[0];\n }\n\n else return $invoice;\n }", "function InfGetInvoice($inf_contact_id, $inf_invoice_id) {\n\t$object_type = \"Invoice\";\n\t$class_name = \"Infusionsoft_\" . $object_type;\n\t$object = new $class_name();\n\t$objects = Infusionsoft_DataService::query(new $class_name(), array('ContactId' => $inf_contact_id, 'Id' => $inf_invoice_id));\n\n $invoice_details = false;\n foreach ($objects as $i => $object) {\n\t\t$array = $object->toArray();\n $invoice_details = $array;\n }\n\treturn $invoice_details;\n}", "public function list_invoices($id = false, $clientid = false)\r\n {\r\n\r\n if (!has_permission('invoices', '', 'view') && !has_permission('invoices', '', 'view_own')) {\r\n access_denied('invoices');\r\n }\r\n $this->load->model('payment_modes_model');\r\n $data['payment_modes'] = $this->payment_modes_model->get('', array(), true);\r\n if ($this->input->is_ajax_request()) {\r\n $this->perfex_base->get_table_data('invoices', array(\r\n 'id' => $id,\r\n 'clientid' => $clientid,\r\n 'data' => $data\r\n ));\r\n }\r\n $data['invoiceid'] = '';\r\n if (is_numeric($id)) {\r\n $data['invoiceid'] = $id;\r\n }\r\n $data['title'] = _l('invoices');\r\n $data['invoices_years'] = $this->invoices_model->get_invoices_years();\r\n $data['invoices_sale_agents'] = $this->invoices_model->get_sale_agents();\r\n $data['invoices_statuses'] = $this->invoices_model->get_statuses();\r\n $data['bodyclass'] = 'invoices_total_manual';\r\n $this->load->view('admin/invoices/manage', $data);\r\n }", "public function get($id) {\n return Invoices::find($id);\n }", "public function show(Invoice $invoice)\n {\n return $invoice;\n }", "private function getInvoice($id = null)\n {\n if (!$id) {\n\n $default_data = [\n 'customer_id' => null,\n 'invoice_number' => null,\n 'po_number' => null,\n 'invoice_date' => null,\n 'payment_due' => null,\n 'publish_status' => PublishStatus::DRAFT,\n 'published_at' => null,\n ];\n\n $invoice = $this->invoice\n ->fill($default_data)\n ->load('invoiceItems');\n\n }\n else {\n\n $invoice = $this->invoice\n ->with('invoiceItems')\n ->findOrFail($id);\n\n }\n\n return $invoice;\n }", "function get_invoice($args) {\r\n if (is_numeric($args)) {\r\n $invoice_id = $args;\r\n } else {\r\n extract(wp_parse_args($args, $defaults), EXTR_SKIP);\r\n $defaults = array('invoice_id' => '', 'return_class' => false);\r\n }\r\n $invoice = new WPI_Invoice();\r\n $invoice->load_invoice(\"id=$invoice_id\");\r\n\r\n if (!empty($invoice->error) && $invoice->error) {\r\n return sprintf(__(\"Invoice %s not found.\", WPI), $invoice_id);\r\n }\r\n\r\n if (!empty($return_class) && $return_class) {\r\n return $invoice;\r\n }\r\n\r\n return $invoice->data;\r\n}", "public function getInvoice($_ID)\n {\n return $this->getUnique(\"invoices\", $_ID);\n }", "public function getInvoiceById($invoiceNumber) {\n $response = $this->_XeroOAuth->request('GET', $this->_XeroOAuth->url('Invoice/' . $invoiceNumber, 'core'), array());\n\t\t\n if ($this->_XeroOAuth->response['code'] == 200) {\n $invoices = $this->_XeroOAuth->parseResponse($this->_XeroOAuth->response['response'], $this->_XeroOAuth->response['format']);\n return $invoices;\n } else {\n \\De\\Log::logApplicationInfo ( \"Caught Exception: \" . urldecode($response['response']) . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n }\n }", "public function retrieveInvoiceItem($invoiceItemId)\n {\n $segments = \"/invoiceitems/{$invoiceItemId}\";\n\n return $this->createRequest($segments);\n }", "public function invoiceitem_info( $invoiceitem_id ) {\r\n\t\treturn $this->_send_request( 'invoiceitems/'.$invoiceitem_id );\r\n\t}", "public function invoice($id = null)\n {\n UserModel::authentication();\n\n //get the session user\n $user = UserModel::user();\n\n //get the user's invoice\n $invoice = InvoiceModel::invoice($id);\n\n $this->View->Render('dashboard/invoice', ['invoice' => $invoice, 'user' => $user]);\n }", "public function findInvoiceId() {\n\t\treturn $this->request->getFiltered('ok_invoice'); \n\t}", "public function getInvoiceID(){\n return $this->InvoiceID;\n }", "public function single_invoice($id=FALSE,$edit_id=FALSE){\n\t\n\tif($edit_id){\n\t$result\t= $this->db->get_where('invoice', array('id'=>$edit_id));\n\t}else{\n\t\t$result\t= $this->db->get_where('invoice', array('id'=>$id));\n\t}\n\treturn $result->row();\n}", "public function invoice_id(){\n return parent::get_fk_object(\"invoice_id\");\n }", "public function invoice($id = '')\n {\n if (!get_permission('invoice', 'is_view')) {\n access_denied();\n }\n\n $this->data['student_id'] = $id;\n $this->data['invoice'] = $this->fees_model->getInvoiceStatus($id);\n $this->data['basic'] = $this->fees_model->getInvoiceBasic($id);\n $this->data['title'] = translate('invoice_history');\n $this->data['main_menu'] = 'fees';\n $this->data['sub_page'] = 'fees/collect';\n $this->load->view('layout/index', $this->data);\n }", "public function getInvoice()\n {\n\n $CfdiId = 'ab9PC44sxbs2LUYaGCTm-g2';\n\n $params = [\n 'type' => 'issued',\n ];\n\n $result = $this->facturama->get('Cfdi/' . $CfdiId, $params);\n return $result;\n }", "public function getInvoiceNumber();", "function loadInvoice($invoiceId) {\n\t\t\n\t\t\t$invoiceId = (int) $invoiceId;\n\t\t\t\n\t\t\t$myQuery = \"\n\t\t\t\tSELECT *\n\t\t\t\tFROM fh_invoice\n\t\t\t\tWHERE invoice_id = $invoiceId\n\t\t\t\";\n\t\t\t\n\t\t\t$myInvoice = DMDatabase::loadObject($myQuery);\n\t\t\t\n\t\t\t$myQuery = \"\n\t\t\t\tSELECT ir.*, s.name AS stock_name\n\t\t\t\tFROM fh_invoice_row AS ir\n\t\t\t\tLEFT JOIN fh_stock AS s ON (ir.stock_id = s.stock_id)\n\t\t\t\tWHERE ir.invoice_id = $invoiceId\n\t\t\t\";\n\t\t\t\n\t\t\t$myInvoice->rows = DMDatabase::loadObjectList($myQuery);\n\t\t\t\n\t\t\treturn $myInvoice;\n\t\t\t\n\t\t}", "public function show(Invoice $invoice)\n {\n //\n }", "public function show(Invoice $invoice)\n {\n //\n }", "public function show(Invoice $invoice)\n {\n //\n }", "public function retrieve_invoice_editdata($invoice_id)\n\t{\n\t\t$this->db->select('\n\t\t\t\ta.*,\n\t\t\t\tb.customer_name,\n\t\t\t\tc.*,\n\t\t\t\tc.product_id,\n\t\t\t\td.product_name,\n\t\t\t\td.product_model,\n\t\t\t\te.unit_short_name as unit,\n\t\t\t');\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('customer_information b','b.customer_id = a.customer_id');\n\t\t$this->db->join('invoice_details c','c.invoice_id = a.invoice_id');\n\t\t$this->db->join('product_information d','d.product_id = c.product_id');\n\t\t$this->db->join('unit e','e.unit_id = d.unit','left');\n\t\t$this->db->where('a.invoice_id',$invoice_id);\n\t\t$query = $this->db->get();\n\n\t\tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\treturn false;\n\t}", "function invoices ($user_id) {\n global $sql;\n return $sql->sql_select_array_query(\"SELECT * FROM `invoice` WHERE user_id = '{$user_id}' ORDER BY invoice_date DESC\");\n }", "public function getInvoiceID()\n {\n return $this->invoiceID;\n }", "public static function getInvoiceById($invoice_id, $offset, $limit){\n $criteria = new CDbCriteria;\n $sql = 'SELECT * FROM `reader_invoice`\n WHERE `Reader_id` = (\n SELECT `Reader_id` FROM `reader_invoice`\n WHERE `Invoice_id` = '.$invoice_id.'\n )\n AND `Earning_type` = (\n SELECT `Earning_type` FROM `reader_invoice`\n WHERE `Invoice_id` = '.$invoice_id.'\n )\n AND `reader_status` = 0 LIMIT :offset, :limit';\n $connection=Yii::app()->db;\n $command = $connection->createCommand($sql);\n $command->bindValue(':offset', $offset);\n $command->bindValue(':limit', $limit);\n\n return $command->query();\n\n }", "public function invoice($id)\n {\n $order = $this->orderRepository->findWithoutFail($id);\n\n if (empty($order)) {\n Flash::error('Order not found');\n\n return redirect(route('orders.index'));\n }\n \n $price = ($order->reason=='fire')?150:(($order->position=='regular')?150:250);\n\n if(empty($order->sb_number)){\n\t $invoice = Invoice::make()\n\t\t ->addItem($order->candidate->user->first_name.' '.$order->candidate->user->last_name,$price,1)\n\t\t ->logo(asset('assets/img/[email protected]'))\n\t\t ->number($order->id)\n\t\t ->tax(19)\n\t\t ->customer([\n\t\t\t 'name' => $order->company->name,\n\t\t\t 'phone' => $order->company->phone,\n\t\t\t 'address' => $order->company->address,\n\t\t\t 'reg_com' => $order->company->reg_com,\n\t\t\t 'vat_code' => $order->company->vat_code,\n\t\t ])\n\t\t ->show('invoice');\n }else{\n\t $smartBill = new SmartBillCloudRestClientClass('[email protected]','af3930ccb2c9a7c3e0b24d538f648837');\n\n\t $pdf = $smartBill->PDFInvoice(\"RO30184266\",$order->sb_name,str_pad($order->sb_number, 4, \"0\", STR_PAD_LEFT));\n\n\t return response($pdf,200,array('Content-Type' => 'application/pdf', 'Content-Disposition' => 'inline; filename=\"invoice.pdf\"'));\n }\n }", "public function invoice($id = '')\r\n {\r\n if (!has_permission('invoices', '', 'view') && !has_permission('invoices', '', 'view_own')) {\r\n access_denied('invoices');\r\n }\r\n if ($this->input->post()) {\r\n $invoice_data = $this->input->post(NULL, FALSE);\r\n if ($id == '') {\r\n if (!has_permission('invoices', '', 'create')) {\r\n access_denied('invoices');\r\n }\r\n $id = $this->invoices_model->add($invoice_data);\r\n if ($id) {\r\n set_alert('success', _l('added_successfuly', _l('invoice')));\r\n redirect(admin_url('invoices/list_invoices/' . $id));\r\n }\r\n } else {\r\n if (!has_permission('invoices', '', 'edit')) {\r\n access_denied('invoices');\r\n }\r\n $success = $this->invoices_model->update($invoice_data, $id);\r\n if ($success) {\r\n set_alert('success', _l('updated_successfuly', _l('invoice')));\r\n }\r\n redirect(admin_url('invoices/list_invoices/' . $id));\r\n }\r\n }\r\n if ($id == '') {\r\n $title = _l('create_new_invoice');\r\n $data['billable_tasks'] = array();\r\n } else {\r\n $invoice = $this->invoices_model->get($id);\r\n\r\n if (!$invoice || (!has_permission('invoices', '', 'view') && $invoice->addedfrom != get_staff_user_id())) {\r\n blank_page(_l('invoice_not_found'), 'danger');\r\n }\r\n\r\n $data['invoices_to_merge'] = $this->invoices_model->check_for_merge_invoice($invoice->clientid, $invoice->id);\r\n $data['expenses_to_bill'] = $this->invoices_model->get_expenses_to_bill($invoice->clientid);\r\n $data['invoice_recurring_invoices'] = $this->invoices_model->get_invoice_recuring_invoices($id);\r\n\r\n $data['invoice'] = $invoice;\r\n $data['edit'] = true;\r\n $data['billable_tasks'] = $this->tasks_model->get_billable_tasks($invoice->clientid);\r\n $title = _l('edit', _l('invoice_lowercase')) . ' - ' . format_invoice_number($invoice->id);\r\n }\r\n if ($this->input->get('customer_id')) {\r\n $data['customer_id'] = $this->input->get('customer_id');\r\n $data['do_not_auto_toggle'] = true;\r\n }\r\n\r\n $this->load->model('payment_modes_model');\r\n $data['payment_modes'] = $this->payment_modes_model->get('', array(\r\n 'expenses_only !=' => 1\r\n ));\r\n $this->load->model('taxes_model');\r\n $data['taxes'] = $this->taxes_model->get();\r\n $this->load->model('invoice_items_model');\r\n $data['items'] = $this->invoice_items_model->get_grouped();\r\n $data['items_groups'] = $this->invoice_items_model->get_groups();\r\n\r\n $this->load->model('currencies_model');\r\n $data['currencies'] = $this->currencies_model->get();\r\n\r\n $where_clients = 'tblclients.active=1';\r\n\r\n if (!has_permission('customers', '', 'view')) {\r\n $where_clients .= ' AND tblclients.userid IN (SELECT customer_id FROM tblcustomeradmins WHERE staff_id=' . get_staff_user_id() . ')';\r\n }\r\n\r\n $data['clients'] = $this->clients_model->get('', $where_clients);\r\n if ($id != '') {\r\n if (total_rows('tblclients', array(\r\n 'active' => 0,\r\n 'userid' => $data['invoice']->clientid\r\n )) > 0 || (total_rows('tblcustomeradmins', array(\r\n 'staff_id' => get_staff_user_id(),\r\n 'customer_id' => $data['invoice']->clientid\r\n )) == 0 && !has_permission('customers', '', 'view'))) {\r\n $data['clients'][] = $this->clients_model->get($data['invoice']->clientid, array(), 'row_array');\r\n }\r\n }\r\n\r\n $data['projects'] = array();\r\n if ($id != '' || isset($data['customer_id'])) {\r\n\r\n $where = '';\r\n $where_customer_id = (isset($data['customer_id']) ? $data['customer_id'] : $invoice->clientid);\r\n $where .= 'clientid=' . $where_customer_id;\r\n\r\n if (!has_permission('projects', '', 'view')) {\r\n $where .= ' AND id IN (SELECT project_id FROM tblprojectmembers WHERE staff_id=' . get_staff_user_id() . ')';\r\n }\r\n\r\n $data['projects'] = $this->projects_model->get('', $where);\r\n\r\n if ($id != '' && $data['invoice']->project_id != 0) {\r\n if (total_rows('tblprojectmembers', array(\r\n 'staff_id' => get_staff_user_id(),\r\n 'project_id' => $data['invoice']->project_id\r\n )) == 0 && !has_permission('projects', '', 'view')) {\r\n $this->db->where('id', $data['invoice']->project_id);\r\n $data['projects'][] = $this->db->get('tblprojects')->row_array();\r\n }\r\n }\r\n }\r\n\r\n $data['staff'] = $this->staff_model->get('', 1);\r\n $data['title'] = $title;\r\n $data['bodyclass'] = 'invoice';\r\n $data['accounting_assets'] = true;\r\n $this->load->view('admin/invoices/invoice', $data);\r\n }", "public function get_detail_client($client_id=0){\n\t\t$this->setMainTable('mmi_client');\n\t\treturn $this->find('client_id='.intval($client_id));\n\t}", "public function whmcs_get_invoices($params = array()) {\n\t\t$params['action'] = 'GetInvoices';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "public function invoice($order_id)\n\t{\n\t\t$check = DB::select(\"SELECT COUNT(*) as count FROM orders WHERE id = '\".$order_id.\"' AND customer = '\".customer('id').\"' LIMIT 1\")[0];\n\t\tif ($check->count == 0){\n\t\t\tabort(404);\n\t\t}\n\t\t$order = DB::select(\"SELECT * FROM orders WHERE id = '\".$order_id.\"'\")[0];\n\t\t$header = $this->header(translate('Invoice'),false,true);\n\t\t$fields = DB::select(\"SELECT name,code FROM fields ORDER BY id ASC\");\n\t\t$footer = $this->footer();\n\t\treturn view('invoice')->with(compact('header','order','fields','footer'));\n\t}", "public function delete_invoice( $invoice_id ) {\n \n // Check if the session exists and if the login user is admin\n $this->check_session($this->user_role, 1);\n \n // Get invoice details\n $invoice = $this->invoice->delete_invoice( $invoice_id ); \n \n // Verify if invoice exists\n if ( $invoice ) {\n \n echo json_encode(1);\n \n }\n \n }", "public function get_invoice_items($invoice_id)\n\t{\n\t\t$this->db->select('invoice_item.*');\n\t\t$this->db->where('invoice_item.invoice_id = '.$invoice_id);\n\t\t$query = $this->db->get('invoice_item');\n\t\t\n\t\treturn $query;\n\t}", "public function getInvoice(RouteMatchInterface $route_match, $invoice_number) {\n $entity_type_id = $this->config('recurly.settings')->get('recurly_entity_type');\n $entity = $route_match->getParameter($entity_type_id);\n\n $entity_type = $entity->getEntityType()->getLowercaseLabel();\n $account = recurly_account_load(['entity_type' => $entity_type, 'entity_id' => $entity->id()]);\n\n // Load the invoice.\n try {\n $invoice = \\Recurly_Invoice::get($invoice_number);\n }\n catch (\\Recurly_NotFoundError $e) {\n drupal_set_message($this->t('Invoice not found'));\n throw new NotFoundHttpException();\n }\n\n // Load the invoice account.\n $invoice_account = $invoice->account->get();\n\n // Ensure that the user account is the same as the invoice account.\n if (empty($account) || $invoice_account->account_code !== $account->account_code) {\n throw new NotFoundHttpException();\n }\n\n // @TODO\n // drupal_set_title() has been removed. There are now a few ways to set the\n // title dynamically, depending on the situation.\n //\n // @see https://www.drupal.org/node/2067859\n // drupal_set_title(t('Invoice #@number', [\n // '@number' => $invoice->invoice_number]));\n if ($invoice->state != 'collected') {\n $url = recurly_url('update_billing', ['entity' => $entity]);\n if ($url) {\n $error_message = $this->t('This invoice is past due! Please <a href=\":url\">update your billing information</a>.', [':url' => $url->toString()]);\n }\n else {\n $error_message = $this->t('This invoice is past due! Please contact an administrator to update your billing information.');\n }\n }\n\n return [\n '#theme' => 'recurly_invoice',\n '#attached' => [\n 'library' => [\n 'recurly/recurly.invoice',\n ],\n ],\n '#invoice' => $invoice,\n '#invoice_account' => $invoice_account,\n '#entity_type' => $entity_type,\n '#entity' => $entity,\n '#error_message' => isset($error_message) ? $error_message : NULL,\n ];\n }", "public function invoice(){\n\t\treturn Hash::make(\"12345\");\n\t\t$inv = Invoice::where('id','1')->first();\n\t\tprint_r($inv->json);\n\t\treturn 0;\n\t}", "public function find($invoiceId): array\n {\n return Billingo::get(\"invoices/{$invoiceId}\");\n }", "public function getInvoiceID()\n {\n return $this->_invoiceID;\n }", "public function getInvoiceModel(){}", "public function getInvoiceOrder();", "public function get(string $id)\n {\n $response = $this->client->request('get', \"customer_invoices/{$id}\");\n\n return json_decode($response->getBody()->getContents(), true);\n }", "public function get_invoices( ) {\n\n $invoiceArray = $this->mockinvoice_model->get_invoices( $this->input->post( 'jobId' ) );\n\n if ( !empty( $invoiceArray ) ) {\n $invoiceHTML = create_invoice_html( $invoiceArray );\n // Push the HTML for the invoice tables onto the array being returned\n $invoiceArray[] = array( 'mockInvoiceId' => '', 'readyToInvoice' => '', 'archived' => '', 'invoiceHTML' => $invoiceHTML );\n }\n\n // Send back the timesheet settings as JSON.\n $this->json_library->print_array_json( $invoiceArray );\n }", "public function send_invoice( $invoice_id ) {\n \n // Check if the session exists and if the login user is admin\n $this->check_session($this->user_role, 1);\n \n // Load the function send_invoice\n if ( sends_invoice($invoice_id) ) {\n \n echo json_encode(1);\n \n }\n \n }", "public function get_invoice()\n\t{\t\t\n\t\t$invoiceid = Input::get('invoiceid');\n\t\t$invoice_job = DB::table('tbl_invoices')->where('invoice_number','=',$invoiceid)->first();\n\t\tif(!empty($invoice_job))\n\t\t{\n\t\t\t$ser_id=$invoice_job->customer_id;\n\t\t\t$grand_total=$invoice_job->grand_total;\n\t\t\t$paid_amount=$invoice_job->paid_amount;\n\t\t\t$total=$grand_total - $paid_amount ;\n\t\t\treturn array($ser_id, $total);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 01;\n\t\t}\n\t}", "public function viewCampaignInvoiceAction()\n {\n $id = $this->request->query->get('id');\n $easyadmin = $this->request->attributes->get('easyadmin');\n $entity = $easyadmin['item'];\n\n return $this->render('easy_admin/Campaign/viewInvoice.html.twig', array(\n 'entity' => $entity\n ));\n }", "public function getDetails($id)\n {\n $invoice = Invoice::find($id);\n $invoice->load('lines');\n $invoice->load('user');\n $invoice->load('documentosReferencia');\n\n return $invoice;\n }", "public function invoice($id)\n {\n $orders = Order::with('customer', 'payment', 'shipping', 'order_items')->findOrFail($id);\n $order_info = OrderInfo::with('product')->select('id', 'order_id', 'product_id', 'product_name', 'product_price', 'product_qty')->where('order_id', $id)->get();\n\n return view('backend.order.invoice', compact('orders', 'order_info'));\n }", "public function getInvoice()\n {\n return $this->_coreRegistry->registry('current_invoice');\n }", "public function fetchTransactionInvoice( $invoiceId )\n\t\t{\n\t\t\tif ( is_numeric( $invoiceId ) ) {\n\t\t\t\t$where = \"`invoice_id` = $invoiceId\";\n\t\t\t\treturn $this->_tableTransactions->fetchRow(\n\t\t\t\t\t$this->_tableTransactions->select()\n\t\t\t\t\t\t->from( $this->_tableTransactions->info( 'name' ), '*' )\n\t\t\t\t\t\t->where( $where )\n\t\t\t\t\t\t->limit( 1 )\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public function getExistingInvoicesForClientCase($client_id, $client_case_id, $display_type)\n {\n if($display_type=='Itemized') {\n\t\t$sql = \"SELECT id, created_date FROM tbl_invoice_final WHERE client_id = $client_id AND client_case_id = $client_case_id AND display_by = 1 AND is_closed=0 ORDER BY id DESC\";\n }\n else {\n $sql = \"SELECT id, created_date FROM tbl_invoice_final WHERE client_id = $client_id AND client_case_id = 0 AND display_by = 2 AND is_closed=0 ORDER BY id DESC\";\n }\n\n \n $invoice_data = InvoiceFinal::findBySql($sql)->all();\n\n \t\t return $invoice_data;\n\t }", "public function get_paid_invoice($is_json = 0) {\n $matches = array();\n $query_string = htmlspecialchars($_POST['q'], ENT_QUOTES, 'UTF-8');\n $result = $this->classTraineeModel->get_paid_indi_company_invoice($this->tenant_id, $query_string);\n if ($result) {\n foreach ($result as $row) {\n if ($row->inv_type == 'INVINDV') {\n $name = '(Name: ' . $row->first_name . ' ' . $row->last_name . ', Taxcode: ' . $row->tax_code . ')';\n } else {\n $name = '(Name: ' . $row->company_name . ', Taxcode: ' . $row->comp_regist_num . ')';\n }\n $matches[] = array(\n 'key' => $row->invoice_id,\n 'label' => $row->invoice_id . $name,\n 'value' => $row->invoice_id,\n );\n }\n }\n if (!empty($is_json)) {\n return $matches;\n } else {\n echo json_encode($matches);\n exit();\n }\n }", "public function invoices($id = null)\n {\n $project = $this->project->findOrFail($id);\n $this->authorize('invoices', $project);\n $invoices = new InvoicesResource($project->invoices()->orderBy('id', 'desc')->paginate(20));\n if ($this->request->has('json')) {\n $data['invoices'] = $invoices;\n return view('projects::_ajax._invoices')->with($data);\n }\n return response($invoices, Response::HTTP_OK);\n }", "public function show( int $invoiceId, int $messageId ) {\n\t\treturn $this->get( '/invoices/' . rawurlencode( $invoiceId ) . '/payments/' . rawurlencode( $messageId ) );\n\t}", "public function delete_client_invoice($delete_id){\n\t\n\t$this->db->where('client_id', $delete_id);\n\t\t\n\treturn $this->db->delete('invoice');\n\t\n}", "function ras_invoice_view_invoice_item($invoice_item) {\n return 'This is an invoice item - ID: ' . $invoice_item->invoice_item_id;\n}", "public function getInvoiceLines($invoice_id)\n {\n return $this->remote->select()->from('invoiceentry')->where('invoiceid', '=', $invoice_id)->fetchAll();\n }", "public function setInvoiceID($id)\n {\n $this->_invoiceID = $id;\n return $this;\n }", "public function get_invoice_data_ajax($id)\r\n {\r\n if (!has_permission('invoices', '', 'view') && !has_permission('invoices', '', 'view_own')) {\r\n echo _l('access_denied');\r\n die;\r\n }\r\n if (!$id) {\r\n die('No invoice found');\r\n }\r\n $invoice = $this->invoices_model->get($id);\r\n\r\n if (!$invoice || (!has_permission('invoices', '', 'view') && $invoice->addedfrom != get_staff_user_id())) {\r\n echo _l('invoice_not_found');\r\n die;\r\n }\r\n $invoice->date = _d($invoice->date);\r\n $invoice->duedate = _d($invoice->duedate);\r\n $template_name = 'invoice-send-to-client';\r\n if ($invoice->sent == 1) {\r\n $template_name = 'invoice-already-send';\r\n }\r\n\r\n $template_name = do_action('after_invoice_sent_template_statement', $template_name);\r\n\r\n $contact = $this->clients_model->get_contact(get_primary_contact_user_id($invoice->clientid));\r\n $email = '';\r\n if ($contact) {\r\n $email = $contact->email;\r\n }\r\n\r\n $data['template'] = get_email_template_for_sending($template_name, $email);\r\n\r\n $data['invoices_to_merge'] = $this->invoices_model->check_for_merge_invoice($invoice->clientid, $id);\r\n $data['template_name'] = $template_name;\r\n // Check for recorded payments\r\n $this->load->model('payments_model');\r\n $data['members'] = $this->staff_model->get('', 1);\r\n $data['contacts'] = $this->clients_model->get_contacts($invoice->clientid);\r\n $data['payments'] = $this->payments_model->get_invoice_payments($id);\r\n $data['activity'] = $this->invoices_model->get_invoice_activity($id);\r\n\r\n $data['invoice_recurring_invoices'] = $this->invoices_model->get_invoice_recuring_invoices($id);\r\n\r\n $data['invoice'] = $invoice;\r\n $this->load->view('admin/invoices/invoice_preview_template', $data);\r\n }", "public function print_invoice() {\n $userid = $this->input->post('userId');\n $data = $this->get_pdf_data($userid);\n $data['user_org'] = $this->payments_model->get_user_org_details($userid);\n $data['invoice'] = $this->payments_model->get_invoice_details($data['clsid'], $data['crsid'], $userid);\n $data['meta_data'] = $this->meta_data;\n return generate_invoice($data);\n }", "public function getInvoiceNumber(){\n return $this->getParameter('invoice_number');\n }", "public function index($id = false)\r\n {\r\n $this->list_invoices($id);\r\n }", "public function show($id)\n {\n $invoice = Invoice::findOrFail($id);\n return response()->json($invoice);\n }", "public function edit(Invoice $invoice)\n\t{\n\t\t// Database Queries\n\t\t$contracts = Contract::with(['tenant', 'asset'])->notEnded()->get();\n\n\t\t// Config/Constants.php 'Queries'\n\t\t// Changes need to be made in the constants.php file AND on the DB\n\t\t$statuses = Config::get('constants.statuses');\n\t\t$priorities = Config::get('constants.priorities');\n\n\t\treturn view('invoices.edit', compact('invoice', 'contracts', 'statuses', 'priorities'));\n\t}", "public function edit(Invoices $invoice)\n {\n //\n }", "function wpi_invoice_lookup($args = '') {\r\n return wp_invoice_lookup($args);\r\n}", "public function getInvoiceNumber()\n {\n return $this->invoice_number;\n }", "public function checkInvoice($id)\n {\n $url = $this->server_root . str_replace(\"[id]\", $id, $this->api_uri_check_payment);\n $nonce = round(microtime(true) * 1000);\n $message = $nonce . $url;\n $private_key = Mage::helper('core')->decrypt($this->getConfiguration(\"private_key\"));\n $hash = hash_hmac(\"sha256\", $message, $private_key, false);\n $http_client = $this->getHTTPClient();\n $http_client->setHeaders($this->getHeaders($nonce, $hash));\n $http_client->setMethod(\"GET\")->setUri($url);\n try {\n $body = $http_client->request()->getBody();\n $data = json_decode($body, true);\n Mage::getSingleton('core/session')->setData('check_invoice', $data);\n return $data;\n } catch (Exception $exc) {\n $this->log($exc->getMessage(), $id);\n $this->log(\"EXCEPTION:\" . json_encode($exc), $id);\n Mage::throwException(\n Mage::helper('bitcoin')->__(\n \"We're sorry, an error has occurred while completing your request. Please refresh the page to try again. If the error persists, please send us an email at [email protected]\\n\" . $exc->getMessage()\n )\n );\n }\n return false;\n }", "public function show($id)\n {\n\t\treturn PaymentLineItems::where('invoice_id', $id)->get()->toArray();\n\t}", "public function viewOrderInvoiceAction()\n {\n $id = $this->request->query->get('id');\n $easyadmin = $this->request->attributes->get('easyadmin');\n $entity = $easyadmin['item'];\n\n $html = $this->renderView('easy_admin/Order/viewInvoice.html.twig', array(\n 'entity' => $entity\n ));\n\n return new Response(\n $this->get('knp_snappy.pdf')->getOutputFromHtml($html),\n 200,\n array(\n 'Content-Type' => 'application/pdf',\n 'Content-Disposition' => 'attachment; filename=\"' . $entity->getClient()->getFirstname() . '.pdf\"'\n )\n );\n }", "function invoiceDetail($invoiceId)\n {\n $this->company_db->select(\"*\");\n $this->company_db->from('invoice_header_payment');\n $this->company_db->where('invoice_id',$invoiceId);\n $query = $this->company_db->get();\n if($query->num_rows() >= 1){\n return $query->result_array();\n }else{\n return array();\n }\n }", "public function show($id)\n {\n $invoice = Invoice::findOrFail($id);\n if($invoice->status!='draft'){\n return response(402);\n }\n $invoice->invoiceLines = InvoiceItems::where('invoice_id', $id)->get();\n foreach ($invoice->invoiceLines as $invoiceLine) {\n $invoiceLine->sec = $invoiceLine->quantity * 60;\n $invoiceLine->running=false;\n\n //TODO Format date\n $invoiceLine->formattedTime =\"00:00:00\" ; \n }\n $invoice->user_email = $invoice->draft_email;\n \n return response()->json(\n [\n 'invoice' => $invoice,\n ],\n 200\n );\n }", "public function edit_invoice($invoice_id = \"\") {\n $data = [];\n $this->db->where('id', $invoice_id);\n $this->db->update('invoice', $data);\n $this->session->set_flashdata('flash_message', get_phrase('invoice_update_successfully'));\n }", "public function show(Invoices $invoices)\n {\n //\n }", "public function getCollections($idInvoice = 0){\n\t\t#variable de respuesta\n\t\t$response = array('status' => 'Succes');\n\t\tif($this->uri->segment(3)){\n\t\t\t$this->Query_ = 'SELECT * FROM \tcobro WHERE id_factura = ' . $idInvoice;\n\t\t}else{\n\t\t\t$this->Query_ = 'SELECT \n\t\t\t\t\tcob.id_cobro,\n\t\t\t\t\tcob.fecha,\n\t\t\t\t\tcob.id_factura,\n\t\t\t\t\tfac.id_factura,\n\t\t\t\t\ttrt.id_tratamiento,\n\t\t\t\t\tcli.nombres,\n\t\t\t\t\tcob.tipo,\n\t\t\t\t\tcob.nro_deposito,\n\t\t\t\t\tcob.valor\n\t\t\t\t\tFROM cobro AS cob\n\t\t\t\t\tLEFT JOIN factura as fac USING(id_factura)\n\t\t\t\t\tLEFT JOIN tratamiento as trt USING(id_tratamiento)\n\t\t\t\t\tLEFT JOIN cliente as cli using(id_cliente)';\n\t\t}\n\t\t#ejecutamos la consulta\n\t\t$this->Result_ = $this->db->query($this->Query_);\n\t\tif($this->Result_->num_rows() > 0){\n\t\t\t$response['msg'] = '3002';\n\t\t\t$response['data'] = $this->Result_->resul_array();\n\t\t}else{\n\t\t\tif($idInvoice != 0){\n\t\t\t\t$response['msg'] = '2001';\n\t\t\t}else{\n\t\t\t\t$response['msg'] = '2002';\n\t\t\t}\n\t\t}\n\t\t#envio de respuesta\n\t\t$this->rest->_responseHttp($response, $this->CodeHttp_);\n\t}", "public function show($id)\n {\n $invoice = Invoice::with('details', 'details.item', 'client')->find($id);\n if (!$invoice) {\n $closure = [\n 'message' => 'Invoice not found !'\n ];\n return response()->json($closure, 404); \n }\n $closure = [\n 'data' => $invoice\n ];\n return response()->json($closure, 200);\n }", "function viewInvoice($argID, $varPortalFilter) {\n $varID = \" FromUserType in('super-admin','user-admin') AND ToUserType = 'customer' AND pkInvoiceID ='\" . $argID . \"' \" . $varPortalFilter;\n $arrClms = array(\n 'pkInvoiceID',\n 'fkOrderID',\n 'CustomerName',\n 'CustomerEmail',\n 'Amount',\n 'InvoiceDetails',\n 'OrderDateAdded',\n 'InvoiceDateAdded'\n );\n $varTable = TABLE_INVOICE;\n $arrData = $this->select($varTable, $arrClms, $varID);\n // pre($arrData);\n return $arrData;\n }", "public function show($id)\n {\n $returnData = Invoice::find($id);\n foreach ($returnData->invoiceItems as $key => $value) {\n $value->return_qty = 0;\n }\n \n return $returnData;\n }", "public function getInvoicestomergeForClientCase($client_id, $client_case_id, $display_type, $invoice_id)\n {\n if($display_type==1) {\n\t\t$sql = \"SELECT id, created_date FROM tbl_invoice_final WHERE client_id = $client_id AND client_case_id = $client_case_id AND display_by = 1 AND is_closed=0 AND id != $invoice_id ORDER BY id DESC\";\n }\n else {\n $sql = \"SELECT id, created_date FROM tbl_invoice_final WHERE client_id = $client_id AND client_case_id = 0 AND display_by = 2 AND is_closed=0 AND id != $invoice_id ORDER BY id DESC\";\n }\n\n \n $invoice_data = InvoiceFinal::findBySql($sql)->all();\n\n \t\t return $invoice_data;\n\t }", "public function getInvoices(User $user);", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }" ]
[ "0.7854324", "0.7548646", "0.7358585", "0.73137087", "0.71643883", "0.70777", "0.68753266", "0.6853473", "0.6829568", "0.67195904", "0.669921", "0.6686736", "0.6637078", "0.65963215", "0.65792054", "0.65765613", "0.65560067", "0.6522328", "0.65116876", "0.6456902", "0.64259326", "0.64141536", "0.63949245", "0.6276593", "0.6270897", "0.6260814", "0.62596965", "0.6237196", "0.61944336", "0.61926925", "0.6183031", "0.61787134", "0.61754113", "0.6175212", "0.6171159", "0.6147987", "0.60906863", "0.60906863", "0.60906863", "0.6080865", "0.6069746", "0.60453504", "0.6042335", "0.6038928", "0.60330194", "0.6031112", "0.5998518", "0.5982782", "0.5967192", "0.5950423", "0.59330475", "0.5931109", "0.59207714", "0.5908499", "0.5873031", "0.58707535", "0.5869021", "0.5866874", "0.5863555", "0.5855931", "0.5850715", "0.58484125", "0.5829983", "0.5814227", "0.5810231", "0.5809055", "0.57983506", "0.57967466", "0.57927334", "0.57821226", "0.5777631", "0.57754034", "0.5772389", "0.57682425", "0.5759392", "0.57576543", "0.57574224", "0.57413113", "0.5741292", "0.5728343", "0.5728093", "0.57238644", "0.5720917", "0.57147217", "0.5710151", "0.5698029", "0.5695477", "0.56929183", "0.5685722", "0.5684481", "0.5682267", "0.56764144", "0.56736356", "0.5666222", "0.5650922", "0.5639656", "0.5639656", "0.5639656", "0.5639656", "0.5639656" ]
0.66622555
12
This command is used to create a new invoice for a client. Parameters: userid should contain the user id of the client you wish to create the invoice for date the date the invoice is created in the format YYYYMMDD duedate the date the invoice is due in the format YYYYMMDD paymentmethod the payment method for the invoice eg. banktransfer itemdescription1 item 1 description itemamount1 item 1 amount itemtaxed1 set to true if item 1 should be taxed Optional Parameters: taxrate the rate of tax that should be charged taxrate2 the 2nd rate of tax that should be charged notes any additional notes the invoice should display to the customer sendinvoice set to true to send the "Invoice Created" email to the customer autoapplycredit pass as true to auto apply any available credit from the clients credit balance itemdescription2 item 2 description itemamount2 item 2 amount itemtaxed2 set to true if item 2 should be taxed etc... (maximum 10) See:
public function whmcs_create_invoice($params = array()) { $params['action'] = 'CreateInvoice'; // return Whmcs_base::send_request($params); $load = new Whmcs_base(); return $load->send_request($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createInvoice()\r\n {\r\n }", "public function createinvoiceAction() {\n\t\t$request = Zend_Controller_Front::getInstance ()->getRequest ();\n\t\tif (is_numeric ( $request->id )) {\n\t\t\t$invoiceID = Invoices::Create ( $request->id );\n\t\t\tif (is_numeric ( $invoiceID )) {\n\t\t\t\tInvoices::setInvoice ( $request->id, $invoiceID );\n\t\t\t\t$this->_helper->redirector ( 'edit', 'invoices', 'admin', array ('id' => $request->id, 'mex' => $this->translator->translate ( 'The task requested has been executed successfully.' ), 'status' => 'success' ) );\n\t\t\t} else {\n\t\t\t\t$this->_helper->redirector ( 'edit', 'invoices', 'admin', array ('id' => $request->id, 'mex' => $this->translator->translate ( 'An invoice already exists for this order.' ), 'status' => 'danger' ) );\n\t\t\t}\n\t\t}\n\t}", "public function createInvoice(Invoice $invoice): Invoice;", "public function actionCreate()\n\t{\n\t\t$model=new ClientInvoice;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ClientInvoice']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ClientInvoice'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "function create_invoice ($invoice) {\n global $sql;\n return $sql->sql_insert('invoice', $invoice);\n }", "public function makeInvoice ($transaction_code, $myCart, $ea_user_id, $billing_name_last, $billing_name_first) {\n \n \n // create record with name\n $errorCode = 0;\n\t\t$errorMessage = \"\";\n \n if (!empty($transaction_code)) {\n \n try {\n \n //$billing_name_last = addslashes($billing[\"billing_name_last\"]);\n //$billing_name_first = addslashes($billing[\"billing_name_first\"]);\n \n // create invoice\n $query = \"INSERT INTO ea_invoice\n SET ea_user_id = '$ea_user_id',\n transaction_code = '$transaction_code',\n billing_name_last = '$billing_name_last',\n billing_name_first = '$billing_name_first',\n process_date = NOW() \";\n //print(\"$query\\n\");\n $this->dbo->query($query);\n $invoice_id = $this->dbo->lastInsertId(); \n \n $data[\"insert_query\"] = $query;\n \n \n // add items to invoice\n $x = 1;\n foreach ($myCart as $key=>$value) {\n $avg_price = $this->getPrice($key);\n \n $query = \"INSERT INTO ea_item\n SET ea_invoice_id = '$invoice_id',\n ea_product_id = '$key',\n quantity = '$value',\n avg_price = '$avg_price',\n order_me = '$x' \";\n //print(\"$query\\n\");\n $this->dbo->query($query);\n ++$x;\n }\n \n // send email\n $this->sendInvoice($invoice_id);\n \n // return id\n } catch (PDOException $e) {\n $errorCode = -1;\n $errorMessage = \"PDOException for createAccount.\";\n }\t\n \n } else {\n $errorCode = 1;\n\t\t\t$errorMessage = \"No Username.\";\n }\n \n $error[\"id\"] = $errorCode;\n\t\t$error[\"message\"] = $errorMessage;\n\t\t\n\t\t$data[\"error\"] = $error;\n\t\t\n\t\t$data[\"invoice_id\"] = $invoice_id;\n $data[\"query\"] = $query;\n\n // send email\n \n $data = json_encode($data);\n \n\t\treturn $data;\n \n \n }", "function create($user, $notrigger = 0) {\n global $conf, $langs;\n $error = 0;\n\n // Clean parameters\n if (isset($this->datec))\n $this->datec = trim($this->datec);\n if (isset($this->number))\n $this->number = trim($this->number);\n if (isset($this->label))\n $this->label = trim($this->label);\n if (isset($this->fk_author))\n $this->fk_author = trim($this->fk_author);\n if (isset($this->fk_source))\n $this->fk_source = trim($this->fk_source);\n if (isset($this->sourcetype))\n $this->sourcetype = trim($this->sourcetype);\n if (isset($this->url))\n $this->url = trim($this->url);\n if (isset($this->fk_fiscal_year))\n $this->fk_fiscal_year = trim($this->fk_fiscal_year);\n\n if ($this->datevalid(($this->datec)) == -1) {\n return -1;\n }\n // Check parameters\n // Put here code to add control on parameters values\n // Insert request\n $sql = \"INSERT INTO \" . MAIN_DB_PREFIX . \"iconta_accountingtransaction(\";\n\n $sql.= \"label,\";\n $sql.= \"entity,\";\n $sql.= \"number,\";\n $sql.= \"datec,\";\n $sql.= \"fk_author,\";\n $sql.= \"fk_source,\";\n $sql.= \"sourcetype,\";\n $sql.= \"url,\";\n $sql.= \"fk_fiscal_year\";\n\n\n $sql.= \") VALUES (\";\n\n $sql.= \" \" . (!isset($this->label) ? 'NULL' : \"'\" . $this->db->escape($this->label) . \"'\") . \",\";\n $sql.= \" \" . (!isset($this->entity) ? '0' : \"'\" . $this->entity . \"'\") . \",\";\n $sql.= \" \" . (!isset($this->number) ? 'NULL' : \"'\" . $this->db->escape($this->number) . \"'\") . \",\";\n $sql.= \" \" . (!isset($this->datec) || dol_strlen($this->datec) == 0 ? 'NULL' : $this->db->idate($this->datec)) . \",\";\n $sql.= \" \" . (!isset($this->fk_author) ? \"'\" . $this->db->escape($user->id) . \"'\" : \"'\" . $this->db->escape($user->id) . \"'\") . \",\";\n $sql.= \" \" . (!isset($this->fk_source) ? 'NULL' : \"'\" . $this->fk_source . \"'\") . \",\";\n $sql.= \" \" . (!isset($this->sourcetype) ? 'NULL' : \"'\" . $this->db->escape($this->sourcetype) . \"'\") . \",\";\n $sql.= \" \" . (!isset($this->url) ? 'NULL' : \"'\" . $this->db->escape($this->url) . \"'\") . \",\";\n $sql.= \" \" . (!isset($this->fk_fiscal_year) ? 'NULL' : \"'\" . $this->db->escape($this->fk_fiscal_year) . \"'\") . \"\";\n\n $sql.= \")\";\n //echo $sql;\n $this->db->begin();\n\n dol_syslog(get_class($this) . \"::create sql=\" . $sql, LOG_DEBUG);\n $resql = $this->db->query($sql);\n if (!$resql) {\n $error++;\n $this->errors[] = \"Error \" . $this->db->lasterror();\n }\n\n if (!$error) {\n $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . \"iconta_accountingtransaction\");\n\n if (!$notrigger) {\n // Uncomment this and change MYOBJECT to your own tag if you\n // want this action call a trigger.\n //// Call triggers\n //include_once(DOL_DOCUMENT_ROOT . \"/core/class/interfaces.class.php\");\n //$interface=new Interfaces($this->db);\n //$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);\n //if ($result < 0) { $error++; $this->errors=$interface->errors; }\n //// End call triggers\n }\n }\n\n // Commit or rollback\n if ($error) {\n foreach ($this->errors as $errmsg) {\n dol_syslog(get_class($this) . \"::create \" . $errmsg, LOG_ERR);\n $this->error.=($this->error ? ', ' . $errmsg : $errmsg);\n }\n $this->db->rollback();\n return -1 * $error;\n } else {\n $this->db->commit();\n return $this->id;\n }\n }", "function billing_userpanel_payment_invoiceCreate(){\n\tif(!$uid = $_SESSION['uid']){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(!$cost = intval($_REQUEST['cost'])){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(!$method = $_REQUEST['method']){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(substr($method, 0, 6)=='manual'){\n\t\treturn billing_userpanel_payment_offline();\n\t} else if(!function_exists('billing_userpanel_payment_'.$method)){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else {\n\t\t$order_id = $_REQUEST['order_id'];\n\t\tif($order_id){\n\t\t\tif(!$rs = dbq(\" SELECT COUNT(*) FROM `billing_invoice` WHERE `order_id`='$order_id' \")){\n\t\t\t\te(\"billing_userpanel_payment_invoiceCreate - \".__LINE__);\n\t\t\t} else if(dbn($rs)==0){\n\t\t\t\t;// its new, we need to insert it\n\t\t\t} else if(!$rw = dbf($rs)){\n\t\t\t\te(\"billing_userpanel_payment_invoiceCreate - \".__LINE__);\n\t\t\t} else {\n\t\t\t\t$invoiceId = $rw['id'];\n\t\t\t}\n\t\t}\n\t\tif($invoiceId){\n\t\t\t;// it already inserted\n\t\t} else if(!dbq(\" INSERT INTO `billing_invoice` (`uid`,`order_id`,`cost`,`method`) VALUES ('$uid','$order_id','$cost','$method') \")){\n\t\t\te(__LINE__.\" : \".__FILE__.\" \".dbe());\n\t\t} else {\n\t\t\t$invoiceId = dbi();\n\t\t}\n\t\tcall_user_func('billing_userpanel_payment_'.$method, $invoiceId);\n\t}\n}", "public function add_invoice()\n\t{\n\t\t$invoice_number = $this->create_invoice_number();\n\t\t\n\t\t$data = array(\n\t\t\t\t'invoice_number'=>$invoice_number,\n\t\t\t\t'user_id'=>$this->input->post('user_id'),\n\t\t\t\t'payment_method'=>$this->input->post('payment_method'),\n\t\t\t\t'invoice_status'=>1,\n\t\t\t\t'invoice_instructions'=>$this->input->post('invoice_instructions'),\n\t\t\t\t'created'=>date('Y-m-d H:i:s'),\n\t\t\t\t'created_by'=>$this->session->userdata('user_id'),\n\t\t\t\t'modified_by'=>$this->session->userdata('user_id')\n\t\t\t);\n\t\t\t\n\t\tif($this->db->insert('invoice', $data))\n\t\t{\n\t\t\treturn $this->db->insert_id();\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function brokerSetupInvoice()\r\n {\r\n $em = $this->entityManager;\r\n $invoiceEntity = $this->invoiceEntity;\r\n $invoiceEntity->setUserId($this->userId);\r\n $invoiceEntity->setGeneratedOn(new \\DateTime());\r\n $invoiceEntity->setAmount($this->amount);\r\n $invoiceEntity->setStatus($em->find('Transactions\\Entity\\InvoiceStatus', UNPAID)); // Paid and Unpaid // set it as unpaid\r\n $invoiceEntity->setInvoiceCategory($em->find('Transactions\\Entity\\InvoiceCategory', 2)); // This is Broker SetUp Invoice\r\n $invoiceEntity->setCurrency($em->find('Settings\\Entity\\Currency', 1)); // tis is set to Naira\r\n try {} catch (\\Exception $e) {\r\n echo 'Invoice generation error';\r\n }\r\n }", "public function newInvoice($options = array(), $draft = false)\n {\n if ($draft) {\n $parameters = array('type_doc' => 'draft');\n } else {\n $parameters = array();\n }\n\n return $this->newItem(\"invoice\", \"invoices\", $options, $parameters);\n }", "function addReceipt($user_id, $email, $name, $student_id, $products, $comments, $society_id) {\r\n\t\t\t$sql = \"INSERT INTO `receipts` (user_id, cust_email, name, student_id, products, comments, society_id) VALUES('%s', '%s', '%s', '%s', '%s', '%s', '%s')\";\r\n\t\t\treturn $this->query($sql, $user_id, $email, $name, $student_id, $products, $comments, $society_id);\r\n\t\t}", "public function create(User $user, $notrigger = false)\n\t{\n\t\t$idpayment = $this->createCommon($user, $notrigger);\n\n\t\treturn $idpayment;\n\t}", "public function createInvoice($quote)\n {\n $this->clearSessionData();\n if (get_class($quote) == \"Mage_Sales_Model_Quote\") {\n $array_key = \"quoteId\";\n $currency_code_key = \"quote_currency_code\";\n } else {\n $array_key = \"orderId\";\n $currency_code_key = \"order_currency_code\";\n }\n $base_price = $quote->getData(\"grand_total\");\n $base_ccy = $quote->getData($currency_code_key);\n $quote_id = $quote->getData(\"entity_id\");\n\n /// create the ipn url based on the site configuration\n if(Mage::helper(\"bitcoin\")->doesTheStoreHasSSL()){\n $ipnUrl = Mage::getUrl(\"bitcoin/index/ipn\", array(\"_secure\" => true, \"id\" => base64_encode($quote_id)));\n }else{\n $ipnUrl = Mage::getUrl(\"bitcoin/index/ipn\", array(\"_secure\" => false, \"id\" => base64_encode($quote_id)));\n }\n $this->log( \"GENERATED IPN URL : \" . $ipnUrl);\n $http_client = $this->getHTTPClient();\n $yellow_payment_data = array(\n \"base_price\" => $base_price, /// Set to 0.30 for testing\n \"base_ccy\" => $base_ccy, /// Set to \"USD\" for testing\n \"callback\" => $ipnUrl\n );\n $post_body = json_encode($yellow_payment_data);\n $nonce = round(microtime(true) * 1000);\n $url = $this->server_root . $this->api_uri_create_invoice;\n $message = $nonce . $url . $post_body;\n $private_key = Mage::helper('core')->decrypt($this->getConfiguration(\"private_key\"));\n $hash = hash_hmac(\"sha256\", $message, $private_key, false);\n\n $http_client->setHeaders($this->getHeaders($nonce, $hash));\n $http_client->setMethod(\"POST\")\n ->setUri($url);\n $http_client->setRawData($post_body);\n try {\n $response = $http_client->request();\n if ($response->getStatus() == \"200\") {\n $body = $response->getBody();\n $data = json_decode($body, true);\n $this->log(\"Response: \" . $response, $data[\"id\"]);\n /* save the invoice in the database */\n $invoice_data = array(\n $array_key => $quote_id,\n \"invoice_id\" => $data[\"id\"],\n \"url\" => $data[\"url\"],\n \"status\" => $data[\"status\"],\n \"address\" => $data[\"address\"],\n \"invoice_price\" => $data[\"invoice_price\"],\n \"invoice_ccy\" => $data[\"invoice_ccy\"],\n \"server_time\" => $data[\"server_time\"],\n \"expiration_time\" => $data[\"expiration\"],\n \"raw_body\" => $yellow_payment_data,\n \"base_price\" => $yellow_payment_data[\"base_price\"],\n \"base_ccy\" => $yellow_payment_data[\"base_ccy\"],\n \"hash\" => $hash\n );\n /// replace https with http on the invoice url in case the store doesn't have ssl certificate\n $helper = Mage::helper(\"bitcoin\");\n if(!$helper->doesTheStoreHasSSL())\n {\n $invoice_data[\"url\"] = $helper->replaceHttps($data[\"url\"]);\n $data[\"url\"] = $helper->replaceHttps($data[\"url\"]);\n }\n\n Mage::getModel(\"bitcoin/ipn\")->saveInvoice($invoice_data);\n /* end saving invoice */\n Mage::getSingleton('core/session')->setData('invoice', $data);\n Mage::getSingleton('core/session')->setData('has_invoice', true);\n return $data;\n } else {\n Mage::throwException($response->getBody());\n $this->log(\"Error code response received: {$response->getStatus()}\", $array_key . \":\" . $quote_id);\n $this->log(\"Response body:\" . json_encode($response->getBody()), $array_key . \":\" . $quote_id);\n return false;\n }\n } catch (Exception $exc) {\n $this->log($exc->getMessage(), $array_key . \":\" . $quote_id);\n $this->log(\"EXCEPTION: \" . json_encode($exc), $array_key . \":\" . $quote_id);\n Mage::throwException(\n Mage::helper('bitcoin')->__(\n \"{$exc->getMessage()}\\n We're sorry, an error has occurred while completing your request. Please refresh the page to try again. If the error persists, please send us an email at [email protected]\"\n )\n );\n }\n }", "function create($user, $notrigger=0)\n {\n \tglobal $conf, $langs;\n\t\t$error=0;\n\n\t\t// Clean parameters\n\n\t\tif (isset($this->fk_commande)) $this->fk_commande=trim($this->fk_commande);\n\t\tif (isset($this->fk_product)) $this->fk_product=trim($this->fk_product);\n\t\tif (isset($this->fk_commandefourndet)) $this->fk_commandefourndet=trim($this->fk_commandefourndet);\n\t\tif (isset($this->qty)) $this->qty=trim($this->qty);\n\t\tif (isset($this->fk_entrepot)) $this->fk_entrepot=trim($this->fk_entrepot);\n\t\tif (isset($this->fk_user)) $this->fk_user=trim($this->fk_user);\n\t\tif (isset($this->comment)) $this->comment=trim($this->comment);\n\t\tif (isset($this->status)) $this->status=trim($this->status);\n\t\tif (isset($this->batch)) $this->batch=trim($this->batch);\n\n\t\t// Check parameters\n\t\t// Put here code to add control on parameters values\n\n // Insert request\n\t\t$sql = \"INSERT INTO \".MAIN_DB_PREFIX.$this->table_element.\"(\";\n\t\t$sql.= \"fk_commande,\";\n\t\t$sql.= \"fk_product,\";\n\t\t$sql.= \"fk_commandefourndet,\";\n\t\t$sql.= \"qty,\";\n\t\t//$sql.= \"fk_entrepot,\";\n\t\t$sql.= \"fk_user,\";\n\t\t$sql.= \"datec,\";\n\t\t$sql.= \"comment,\";\n\t\t$sql.= \"status,\";\n\t\t$sql.= \"batch,\";\n\t\t$sql.= \"eatby,\";\n\t\t$sql.= \"sellby\";\n $sql.= \") VALUES (\";\n\t\t$sql.= \" \".(! isset($this->fk_commande)?'NULL':\"'\".$this->db->escape($this->fk_commande).\"'\").\",\";\n\t\t$sql.= \" \".(! isset($this->fk_product)?'NULL':\"'\".$this->db->escape($this->fk_product).\"'\").\",\";\n\t\t$sql.= \" \".(! isset($this->fk_commandefourndet)?'NULL':\"'\".$this->db->escape($this->fk_commandefourndet).\"'\").\",\";\n\t\t$sql.= \" \".(! isset($this->qty)?'NULL':\"'\".$this->db->escape($this->qty).\"'\").\",\";\n\t\t//$sql.= \" \".(! isset($this->fk_entrepot)?'NULL':\"'\".$this->db->escape($this->fk_entrepot).\"'\").\",\";\n\t\t$sql.= \" \".(! isset($this->fk_user)?'NULL':\"'\".$this->db->escape($this->fk_user).\"'\").\",\";\n\t\t$sql.= \" \".(! isset($this->datec) || dol_strlen($this->datec)==0?'NULL':\"'\".$this->db->idate($this->datec).\"'\").\",\";\n\t\t$sql.= \" \".(! isset($this->comment)?'NULL':\"'\".$this->db->escape($this->comment).\"'\").\",\";\n\t\t$sql.= \" \".(! isset($this->status)?'NULL':\"'\".$this->db->escape($this->status).\"'\").\",\";\n\t\t$sql.= \" \".(! isset($this->batch)?'NULL':\"'\".$this->db->escape($this->batch).\"'\").\",\";\n\t\t$sql.= \" \".(! isset($this->eatby) || dol_strlen($this->eatby)==0?'NULL':\"'\".$this->db->idate($this->eatby).\"'\").\",\";\n\t\t$sql.= \" \".(! isset($this->sellby) || dol_strlen($this->sellby)==0?'NULL':\"'\".$this->db->idate($this->sellby).\"'\").\"\";\n\t\t$sql.= \")\";\n\n\t\t$this->db->begin();\n\n\t \tdol_syslog(__METHOD__, LOG_DEBUG);\n $resql=$this->db->query($sql);\n \tif (! $resql) { $error++; $this->errors[]=\"Error \".$this->db->lasterror(); }\n\n\t\tif (! $error)\n {\n $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);\n\n\t\t\tif (! $notrigger)\n\t\t\t{\n\t // Uncomment this and change MYOBJECT to your own tag if you\n\t // want this action calls a trigger.\n\n\t //// Call triggers\n\t //$result=$this->call_trigger('MYOBJECT_CREATE',$user);\n\t //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}\n\t //// End call triggers\n\t\t\t}\n }\n\n // Commit or rollback\n if ($error)\n\t\t{\n\t\t\tforeach($this->errors as $errmsg)\n\t\t\t{\n\t dol_syslog(__METHOD__.\" \".$errmsg, LOG_ERR);\n\t $this->error.=($this->error?', '.$errmsg:$errmsg);\n\t\t\t}\n\t\t\t$this->db->rollback();\n\t\t\treturn -1*$error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->db->commit();\n return $this->id;\n\t\t}\n }", "public function create()\n {\n if (! Gate::allows('invoice_create')) {\n return abort(401);\n }\n \n $users = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $projects = \\App\\Project::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $expense_types = \\App\\ExpenseType::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $meetings = \\App\\Meeting::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $contingencies = \\App\\Contingency::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $providers = \\App\\Provider::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $service_types = \\App\\ServiceType::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $pms = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $finances = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n return view('admin.invoices.create', compact('users', 'projects', 'expense_types', 'meetings', 'contingencies', 'providers', 'service_types', 'pms', 'finances'));\n }", "public function create()\n {\n if (! Gate::allows('invoice_create')) {\n return prepareBlockUserMessage();\n }\n \n $customers = \\App\\Contact::whereHas(\"contact_type\",\n function ($query) {\n $query->where('id', CUSTOMERS_TYPE);\n })->get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n $sales_agent = \\App\\Contact::whereHas(\"contact_type\",\n function ($query) {\n $query->where('id', CONTACT_SALE_AGENT);\n })->get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n $currencies = \\App\\Currency::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $taxes = \\App\\Tax::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $discounts = \\App\\Discount::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $enum_status = Invoice::$enum_status;\n $enum_discounts_format = Invoice::$enum_discounts_format;\n $enum_tax_format = Invoice::$enum_tax_format;\n \n return view('admin.invoices.create', compact('enum_status', 'customers', 'sales_agent','currencies', 'taxes', 'discounts', 'enum_discounts_format', 'enum_tax_format'));\n }", "public function createProfessionalInvoice(Request $request)\n { \n $user = User::where('email', $request->input('email'))->first();\n if(!$user){\n\n $validator = Validator::make($request->all(), [\n 'firstname' => 'required|string|max:255',\n 'lastname' => 'required|string|max:255',\n 'phone'=>'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users'\n ]);\n\n if ($validator->fails()){\n return redirect()->back()->withErrors($validator)->withInput();\n } \n\n $user = User::create([\n 'firstname' => $request->input('firstname'),\n 'lastname' => $request->input('lastname'),\n 'phone' => $request->input('phone'),\n 'email' => $request->input('email'),\n 'password' => bcrypt('123456'),\n 'user_type' => 'personal',\n 'account_balance' => 0.00, \n ]);\n }\n\n $invoice = new Invoice();\n $invoice->sender_id = Auth::user()->id;\n $invoice->recipient_id = $user->id;\n $invoice->invoice_no = Keygen::numeric(6)->generate();\n $invoice->note = $request->input('note');\n $invoice->secret_key = str_random(8);//md5(microtime())\n $invoice->amount = $request->input('amount');\n $invoice->invoice_type = 'one-off';\n $invoice->offline_ref_code = Keygen::numeric(15)->generate();\n\n if ($request->hasFile('photo')) {\n $randomKey = sha1(time() . microtime());\n $extension = $request->file('photo')->getClientOriginalExtension();\n $fileName = $randomKey . '.' . $extension;\n\n $destinationPath = public_path() . '/images/uploads/invoices/';\n // Check if the folder exists on upload, create it if it doesn't\n if (!is_dir(public_path('/images/uploads/invoices/'))) {\n $this->fs->makeDirectory(public_path('/images/uploads/invoices/'), 0777, true);\n }\n //Move the photo to a temporary path\n $upload_success = $request->file('photo')->move($destinationPath, $fileName);\n \n if ($upload_success) {\n $invoice->photo = $fileName;\n }\n }\n $invoice->save();\n \n return redirect()->route('invoice.show.single', ['invoice'=>$invoice->uuid]);\n }", "public function createInvoice($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\r\n $invoice = new Invoice();\r\n\r\n $invoice->invoicedate = (isset($data->invoicedate) && $this->validMySQLDate($data->invoicedate)) ? $data->invoicedate : date('Y-m-d');\r\n if (isset($data->amount)) {\r\n $invoice->amount = $data->amount;\r\n } else {\r\n throw new RestException(400, \"amount not specified\");\r\n }\r\n $invoice->vatamount = isset($data->vatamount) ? $data->vatamount : 0;\r\n $invoice->paymenttype = isset($data->paymenttype) ? $data->paymenttype : 'cash';\r\n $invoice->chequenumber = isset($data->chequenumber) ? $data->chequenumber : 0;\r\n if (isset($data->clientid)) {\r\n $invoice->clientid = $data->clientid;\r\n } else {\r\n throw new RestException(400, \"clientid not specified\");\r\n }\r\n if (isset($data->productid)) {\r\n if(!Product::find_by_id($data->productid)) {\r\n throw new RestException(400, \"product doesn't exist\");\r\n }\r\n $invoice->productid = $data->productid;\r\n } else {\r\n throw new RestException(400, \"productid not specified\");\r\n }\r\n//return $invoice;\r\n $result = $invoice->save();\r\n if ($result) {\r\n return $invoice;\r\n } else {\r\n throw new RestException(400, \"Unknown error - Invoice not created\");\r\n }\r\n }", "public function createCart($user_id){\n\n date_default_timezone_set('Asia/Colombo');\n $creation_date_time = date('Y-m-d H:i:s');\n\n $data = [\n 'User_ID' => $user_id,\n 'CreationDateTime' => $creation_date_time\n ];\n\n $cart_id = $this->InsertAndReturnID(\"cart\", $data);\n if(!$cart_id){\n return false;\n }else{\n return $cart_id;\n }\n }", "public function createAction(Request $request)\n {\n $entity = new Invoice();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n $user = $this->container->get('security.context')->getToken()->getUser();\n\n $data = $this->get('request')->request->all();\n $data = $data['invoice_line'];\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $entity->setCreatedBy($user);\n foreach ($data['description'] as $key => $description) {\n $line = new InvoiceLine();\n $line->setInvoice($entity);\n $line->setDescription($data['description'][$key]);\n $line->setUnitPrice($data['unitPrice'][$key]);\n $line->setQuantity($data['quantity'][$key]);\n $em->persist($line);\n }\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('invoice_show', array('id' => $entity->getId())));\n }\n\n return $this->render('AcmeInvoiceBundle:Invoice:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function setInvoiceData($params) {\n\t\t$this->_create_invoice = true;\n\t\t$vars['IsCreateInvoice'] = \"true\";\n\t\t$vars[\"InvoiceHead.CustName\"] = isset($params['CustName']) ? $params['CustName'] : \"Israel Israeli\"; // customer name\n\t $vars[\"InvoiceHead.SendByEmail\"] = isset($params['SendByEmail']) ? $params['SendByEmail'] : \"true\"; // will the invoice be send by email to the customer\n\t $vars[\"InvoiceHead.Language\"] = isset($params['Language']) ? $params['Language'] : \"he\"; // he or en only\n\t $vars[\"InvoiceHead.Email\"] = $params['Email'];\n\t \n\t // products info \n\t $i=1;\n\t foreach ($params['Items'] as $item) {\n\t\t $vars[\"InvoiceLines\".$i.\".Description\"] = $item['Description'];\n\t\t $vars[\"InvoiceLines\".$i.\".Price\"] = $item['Price'];\n\t\t $vars[\"InvoiceLines\".$i.\".Quantity\"] = $item['Quantity'];\n\t\t\t$i++;\n\t }\n\t $this->_invoice = $vars;\n\t}", "public function invoice($id = '')\r\n {\r\n if (!has_permission('invoices', '', 'view') && !has_permission('invoices', '', 'view_own')) {\r\n access_denied('invoices');\r\n }\r\n if ($this->input->post()) {\r\n $invoice_data = $this->input->post(NULL, FALSE);\r\n if ($id == '') {\r\n if (!has_permission('invoices', '', 'create')) {\r\n access_denied('invoices');\r\n }\r\n $id = $this->invoices_model->add($invoice_data);\r\n if ($id) {\r\n set_alert('success', _l('added_successfuly', _l('invoice')));\r\n redirect(admin_url('invoices/list_invoices/' . $id));\r\n }\r\n } else {\r\n if (!has_permission('invoices', '', 'edit')) {\r\n access_denied('invoices');\r\n }\r\n $success = $this->invoices_model->update($invoice_data, $id);\r\n if ($success) {\r\n set_alert('success', _l('updated_successfuly', _l('invoice')));\r\n }\r\n redirect(admin_url('invoices/list_invoices/' . $id));\r\n }\r\n }\r\n if ($id == '') {\r\n $title = _l('create_new_invoice');\r\n $data['billable_tasks'] = array();\r\n } else {\r\n $invoice = $this->invoices_model->get($id);\r\n\r\n if (!$invoice || (!has_permission('invoices', '', 'view') && $invoice->addedfrom != get_staff_user_id())) {\r\n blank_page(_l('invoice_not_found'), 'danger');\r\n }\r\n\r\n $data['invoices_to_merge'] = $this->invoices_model->check_for_merge_invoice($invoice->clientid, $invoice->id);\r\n $data['expenses_to_bill'] = $this->invoices_model->get_expenses_to_bill($invoice->clientid);\r\n $data['invoice_recurring_invoices'] = $this->invoices_model->get_invoice_recuring_invoices($id);\r\n\r\n $data['invoice'] = $invoice;\r\n $data['edit'] = true;\r\n $data['billable_tasks'] = $this->tasks_model->get_billable_tasks($invoice->clientid);\r\n $title = _l('edit', _l('invoice_lowercase')) . ' - ' . format_invoice_number($invoice->id);\r\n }\r\n if ($this->input->get('customer_id')) {\r\n $data['customer_id'] = $this->input->get('customer_id');\r\n $data['do_not_auto_toggle'] = true;\r\n }\r\n\r\n $this->load->model('payment_modes_model');\r\n $data['payment_modes'] = $this->payment_modes_model->get('', array(\r\n 'expenses_only !=' => 1\r\n ));\r\n $this->load->model('taxes_model');\r\n $data['taxes'] = $this->taxes_model->get();\r\n $this->load->model('invoice_items_model');\r\n $data['items'] = $this->invoice_items_model->get_grouped();\r\n $data['items_groups'] = $this->invoice_items_model->get_groups();\r\n\r\n $this->load->model('currencies_model');\r\n $data['currencies'] = $this->currencies_model->get();\r\n\r\n $where_clients = 'tblclients.active=1';\r\n\r\n if (!has_permission('customers', '', 'view')) {\r\n $where_clients .= ' AND tblclients.userid IN (SELECT customer_id FROM tblcustomeradmins WHERE staff_id=' . get_staff_user_id() . ')';\r\n }\r\n\r\n $data['clients'] = $this->clients_model->get('', $where_clients);\r\n if ($id != '') {\r\n if (total_rows('tblclients', array(\r\n 'active' => 0,\r\n 'userid' => $data['invoice']->clientid\r\n )) > 0 || (total_rows('tblcustomeradmins', array(\r\n 'staff_id' => get_staff_user_id(),\r\n 'customer_id' => $data['invoice']->clientid\r\n )) == 0 && !has_permission('customers', '', 'view'))) {\r\n $data['clients'][] = $this->clients_model->get($data['invoice']->clientid, array(), 'row_array');\r\n }\r\n }\r\n\r\n $data['projects'] = array();\r\n if ($id != '' || isset($data['customer_id'])) {\r\n\r\n $where = '';\r\n $where_customer_id = (isset($data['customer_id']) ? $data['customer_id'] : $invoice->clientid);\r\n $where .= 'clientid=' . $where_customer_id;\r\n\r\n if (!has_permission('projects', '', 'view')) {\r\n $where .= ' AND id IN (SELECT project_id FROM tblprojectmembers WHERE staff_id=' . get_staff_user_id() . ')';\r\n }\r\n\r\n $data['projects'] = $this->projects_model->get('', $where);\r\n\r\n if ($id != '' && $data['invoice']->project_id != 0) {\r\n if (total_rows('tblprojectmembers', array(\r\n 'staff_id' => get_staff_user_id(),\r\n 'project_id' => $data['invoice']->project_id\r\n )) == 0 && !has_permission('projects', '', 'view')) {\r\n $this->db->where('id', $data['invoice']->project_id);\r\n $data['projects'][] = $this->db->get('tblprojects')->row_array();\r\n }\r\n }\r\n }\r\n\r\n $data['staff'] = $this->staff_model->get('', 1);\r\n $data['title'] = $title;\r\n $data['bodyclass'] = 'invoice';\r\n $data['accounting_assets'] = true;\r\n $this->load->view('admin/invoices/invoice', $data);\r\n }", "public function addNewCommercialInvoice(Request $request, $id){ \n $ids = Auth::user()->id;\n $user = User::find($ids);\n\n $firstName = $user->first_name;\n $lastName = $user->last_name;\n\n $name = $firstName.\" \".$lastName;\n\n $addNewInvoice = new WlgCorporationInvoice([\n 'user_id'=>$user->id,\n 'if_id'=>$id,\n 'number_of_goods'=>$request->get('no'),\n 'description_of_goods'=>$request->get('descGoods'),\n 'qty'=>$request->get('qty'),\n 'unit_price'=>$request->get('unitPrice'),\n 'total_amount'=>$request->get('totalAmount'),\n 'created_by'=>$name,\n ]);\n\n $addNewInvoice->save();\n Session::flash('successAdd', 'Successfully added');\n\n return redirect()->route('editCommercialInvoiceWlg', ['id'=>$id]);\n }", "public function createBasicInvoice(Request $request)\n { \n $user = User::where('email', $request->input('email'))->first();\n \n if(!$user){ \n\n $validator = Validator::make($request->all(), [\n 'firstname' => 'required|string|max:255',\n 'lastname' => 'required|string|max:255',\n 'phone'=>'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users'\n ]);\n\n if ($validator->fails()) {\n return redirect()->back()->withErrors($validator)->withInput();\n } \n\n $user = User::create([\n 'firstname' => $request->input('firstname'),\n 'lastname' => $request->input('lastname'),\n 'phone' => $request->input('phone'),\n 'email' => $request->input('email'),\n 'password' => bcrypt('123456'),\n 'user_type' => 'personal',\n 'account_balance' => 0.00, \n ]);\n }\n\n $invoice = new Invoice();\n $invoice->sender_id = Auth::user()->id;\n $invoice->invoice_no = Keygen::numeric(6)->generate();\n $invoice->note = $request->input('note');\n $invoice->secret_key = str_random(8);//md5(microtime())\n $invoice->recipient_id = $user->id;\n $invoice->amount = $request->input('amount');\n $invoice->invoice_type = 'basic';\n $invoice->offline_ref_code = Keygen::numeric(15)->generate();\n\n if ($request->hasFile('photo')) {\n $randomKey = sha1(time() . microtime());\n $extension = $request->file('photo')->getClientOriginalExtension();\n $fileName = $randomKey . '.' . $extension;\n\n $destinationPath = public_path() . '/images/uploads/invoices/';\n // Check if the folder exists on upload, create it if it doesn't\n if (!is_dir(public_path('/images/uploads/invoices/'))) {\n $this->fs->makeDirectory(public_path('/images/uploads/invoices/'), 0777, true);\n }\n //Move the photo to a temporary path\n $upload_success = $request->file('photo')->move($destinationPath, $fileName);\n \n if ($upload_success) {\n $invoice->photo = $fileName;\n }\n }\n\n $invoice->save();\n \n return redirect()->route('invoice.show.preview', ['invoice'=>$invoice->uuid]);\n }", "public function invoiceCreate(Request $request)\n {\n $invoice_request = $invoice_data = $request->all();\n\n $response = BilldeskHmac::invoiceCreate($invoice_request);\n }", "public function _add()\n {\n $type_code = post_param_string('type_code');\n $object = find_product($type_code);\n\n $amount = post_param_string('amount', '');\n if ($amount == '') {\n $products = $object->get_products(false, $type_code);\n $amount = $products[$type_code][1];\n if ($amount == '?') {\n warn_exit(do_lang_tempcode('INVOICE_REQUIRED_AMOUNT'));\n }\n }\n\n $to = post_param_string('to');\n $member_id = $GLOBALS['FORUM_DRIVER']->get_member_from_username($to);\n if (is_null($member_id)) {\n warn_exit(do_lang_tempcode('_MEMBER_NO_EXIST', escape_html($to)));\n }\n\n $id = $GLOBALS['SITE_DB']->query_insert('invoices', array(\n 'i_type_code' => $type_code,\n 'i_member_id' => $member_id,\n 'i_state' => 'new',\n 'i_amount' => $amount,\n 'i_special' => post_param_string('special'),\n 'i_time' => time(),\n 'i_note' => post_param_string('note')\n ), true);\n\n log_it('CREATE_INVOICE', strval($id), $type_code);\n\n send_invoice_notification($member_id, $id);\n\n $url = build_url(array('page' => '_SELF', 'type' => 'outstanding'), '_SELF');\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }", "public function create($user_id = null)\n\t{\n\t\tif($user_id){\n\t\t\t$insert_data = array(\n\t\t\t'item_type_id' \t\t=> $this->input->post('itemtype'),\n\t\t\t'item_name' \t\t=> trim(ucwords($this->input->post('itemname'))),\n\t\t\t'created_At'\t\t=> strtotime(\"now\"),\n\t\t\t'lastupdated_date'\t=> strtotime(\"now\"),\n\t\t\t'lastupdated_by'\t=> $user_id,\n\t\t);\n\n\t\t$status = $this->db->insert('items', $insert_data);\n\n\t\t\tif($status === true){\n\t\t\t\t//update inventory_history\n\t\t\t\t$item_id = $this->db->insert_id();\n\t\t\t\tif($item_id != 0){\n\t\t\t\t\t$update_data = array(\n\t\t\t\t\t\t'history_type' \t\t=> \"Create\",\n\t\t\t\t\t\t'items_id'\t\t\t=> $item_id,\n\t\t\t\t\t\t'quantity_old'\t\t=> \"0\",\n\t\t\t\t\t\t'quantity_new'\t\t=> \"0\",\n\t\t\t\t\t\t'quantity_summary'\t=> \"Create\",\n\t\t\t\t\t\t'old_update_date'\t=>strtotime(\"now\"),\n\t\t\t\t\t\t'old_updateby'\t\t=>$user_id,\n\t\t\t\t\t\t'new_update_date'\t=>strtotime(\"now\"),\n\t\t\t\t\t\t'new_updateby'\t\t=>$user_id,\n\t\t\t\t\t);\n\n\t\t\t\t\t$query = $this->db->insert('inventory_history', $update_data);\n\n\t\t\t\t\treturn ($query === true ? true : false);\n\t\t\t\t}\n\t\t\treturn false;\n\t\t\t} return false;\n\t\t}\n\t}", "public function addNewInvoice(Request $request, $id){\n $ids = Auth::user()->id;\n $user = User::find($ids);\n\n $firstName = $user->first_name;\n $lastName = $user->last_name;\n\n $name = $firstName.\" \".$lastName;\n\n $addNewInvoice = new WlgCorporationInvoice([\n 'user_id'=>$user->id,\n 'if_id'=>$id,\n 'number_of_goods'=>$request->get('no'),\n 'description_of_goods'=>$request->get('descGoods'),\n 'qty'=>$request->get('qty'),\n 'unit_price'=>$request->get('unitPrice'),\n 'total_amount'=>$request->get('totalAmount'),\n 'created_by'=>$name,\n ]);\n\n $addNewInvoice->save();\n Session::flash('successAdd', 'Successfully added');\n\n return redirect()->route('editInvoiceWlg', ['id'=>$id]);\n\n }", "function addCrediInvoice($totalAmount, $grantAmount, $InterestRate, $DailyEqualPayment, $Days, $PaidAmount, $Settled, $Debitors_idDebitors, $CollectionArea_idCollectionArea, $userid, $loan_type) {\n\n\n\n $Date = date(\"Y-m-d\");\n\n $sql = \"INSERT INTO credit_invoice (TotalAmount,GrantAmount,InterestRate,DailyEqualPayment,Days,PaidAmount,Settled,DateTime,Debitors_idDebitors,CollectionArea_idCollectionArea,Status,user_idUser,`type`) \"\n\n . \"VALUES ($totalAmount,$grantAmount, '$InterestRate', '$DailyEqualPayment', '$Days','$PaidAmount','$Settled','$Date','$Debitors_idDebitors','$CollectionArea_idCollectionArea', '0',$userid,'$loan_type')\";\n\n\n\n if (mysqli_query($this->con, $sql)) {\n\n $last_id = $this->con->insert_id;\n\n return $last_id;\n\n// return \"true\";\n\n } else {\n\n// return 'error:' . mysqli_error($this->con);\n\n return \"false\";\n\n }\n\n }", "public function createInvoice(OrderInterface $order = NULL, array $options = []);", "public function actionCreateInvoice() {\n // Create Record with Pending status, the status will turn to Ready as\n // soon as all jobs are retrieved, marked as send, and the invoice\n // is uploaded to S3. The record is being auto created if an instance \n // oh InvoiceHistoryB is not provided to method getInstance()\n $invoiceComponent = InvoiceComponent::getInstance();\n \n // Get data provider\n $data = $this->getData();\n if($data === false || empty($data)) {\n // Redirect back to dashboard page with flag of no selection\n $this->redirect($this->createUrl('billingDashboard/index', array('no-selection' => 1,)));\n }\n \n // Make data provider\n $dataProvider = new CArrayDataProvider($data, array(\n 'pagination' => array(\n 'pageSize' => Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']),\n ),\n ));\n // Update file name to include client name\n $invoiceComponent->setClientData($data[0]->project->client);\n \n // Export to xlsx document.\n $gridViewExcelWriter = $this->widget('GridViewExcelWriter', array(\n 'dataProvider' => $dataProvider,\n 'clearDollarSign' => false,\n 'title' => 'EExcelWriter',\n 'stream' => false,\n 'fileName' => 'invoice-exported-at.' . date('d.m.Y', time()) . '.xlsx',\n 'columns' => require(YiiBase::getPathOfAlias('billing.views.invoice._invoice_grid_columns').'.php'),\n ));\n // Upload the file to S3\n if($invoiceComponent->save($gridViewExcelWriter->getTempFileContent())) {\n // Mark invoice as ready\n $invoiceComponent->markInvoiceAsReady();\n \n // Contains all project ids\n $projectIds = array();\n // Mark project children items as sent\n foreach($data as $item) {\n // Collect project ids\n $projectIds[$item->project_id] = $item->project_id;\n // Item is either ProjectJobB or ProjectExtraServiceB\n $item->markAsSent();\n }\n // Mark all those projects as sent\n ProjectB::model()->manageInvoiceStatus($projectIds);\n \n // Redirect back to dashboard page with flag of no selection\n $this->redirect($this->createUrl('billingDashboard/index', array(\n 'activeTab' => 'Invoice_History',\n )));\n }\n }", "public function create($user, $notrigger = 0)\n {\n global $langs,$conf,$hookmanager;\n\n $this->db->begin();\n\n\t\t$error=0;\n $now=dol_now();\n\n // Clean parameters\n if (empty($this->source)) $this->source = 0;\n\n\t\t// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)\n\t\tif (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);\n\t\telse $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);\n\t\tif (empty($this->fk_multicurrency))\n\t\t{\n\t\t\t$this->multicurrency_code = $conf->currency;\n\t\t\t$this->fk_multicurrency = 0;\n\t\t\t$this->multicurrency_tx = 1;\n\t\t}\n\n // We set order into draft status\n $this->brouillon = 1;\n\n $sql = \"INSERT INTO \".MAIN_DB_PREFIX.\"commande_fournisseur (\";\n $sql.= \"ref\";\n $sql.= \", ref_supplier\";\n $sql.= \", note_private\";\n $sql.= \", note_public\";\n $sql.= \", entity\";\n $sql.= \", fk_soc\";\n $sql.= \", fk_projet\";\n $sql.= \", date_creation\";\n\t\t$sql.= \", date_livraison\";\n $sql.= \", fk_user_author\";\n $sql.= \", fk_statut\";\n $sql.= \", source\";\n $sql.= \", model_pdf\";\n $sql.= \", fk_mode_reglement\";\n\t\t$sql.= \", fk_cond_reglement\";\n $sql.= \", fk_account\";\n\t\t$sql.= \", fk_incoterms, location_incoterms\";\n $sql.= \", fk_multicurrency\";\n $sql.= \", multicurrency_code\";\n $sql.= \", multicurrency_tx\";\n $sql.= \") \";\n $sql.= \" VALUES (\";\n $sql.= \"''\";\n $sql.= \", '\".$this->db->escape($this->ref_supplier).\"'\";\n $sql.= \", '\".$this->db->escape($this->note_private).\"'\";\n $sql.= \", '\".$this->db->escape($this->note_public).\"'\";\n $sql.= \", \".$conf->entity;\n $sql.= \", \".$this->socid;\n $sql.= \", \".($this->fk_project > 0 ? $this->fk_project : \"null\");\n $sql.= \", '\".$this->db->idate($now).\"'\";\n\t\t$sql.= \", \".($this->date_livraison?\"'\".$this->db->idate($this->date_livraison).\"'\":\"null\");\n $sql.= \", \".$user->id;\n $sql.= \", \".self::STATUS_DRAFT;\n $sql.= \", \".$this->db->escape($this->source);\n $sql.= \", '\".$conf->global->COMMANDE_SUPPLIER_ADDON_PDF.\"'\";\n $sql.= \", \".($this->mode_reglement_id > 0 ? $this->mode_reglement_id : 'null');\n $sql.= \", \".($this->cond_reglement_id > 0 ? $this->cond_reglement_id : 'null');\n $sql.= \", \".($this->fk_account>0?$this->fk_account:'NULL');\n $sql.= \", \".(int) $this->fk_incoterms;\n $sql.= \", '\".$this->db->escape($this->location_incoterms).\"'\";\n\t\t$sql.= \", \".(int) $this->fk_multicurrency;\n\t\t$sql.= \", '\".$this->db->escape($this->multicurrency_code).\"'\";\n\t\t$sql.= \", \".(double) $this->multicurrency_tx;\n $sql.= \")\";\n\n dol_syslog(get_class($this).\"::create\", LOG_DEBUG);\n if ($this->db->query($sql))\n {\n $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.\"commande_fournisseur\");\n\n\t\t\tif ($this->id) {\n\t\t\t\t$num=count($this->lines);\n\n\t // insert products details into database\n\t for ($i=0;$i<$num;$i++)\n\t {\n\n\t $this->special_code = $this->lines[$i]->special_code; // TODO : remove this in 9.0 and add special_code param to addline()\n\n $result = $this->addline( // This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set\n\t $this->lines[$i]->desc,\n\t $this->lines[$i]->subprice,\n\t $this->lines[$i]->qty,\n\t $this->lines[$i]->tva_tx,\n\t $this->lines[$i]->localtax1_tx,\n\t $this->lines[$i]->localtax2_tx,\n\t $this->lines[$i]->fk_product,\n\t 0,\n\t $this->lines[$i]->ref_fourn, // $this->lines[$i]->ref_fourn comes from field ref into table of lines. Value may ba a ref that does not exists anymore, so we first try with value of product\n\t $this->lines[$i]->remise_percent,\n\t 'HT',\n\t 0,\n\t $this->lines[$i]->product_type,\n\t $this->lines[$i]->info_bits,\n false,\n\t $this->lines[$i]->date_start,\n $this->lines[$i]->date_end,\n 0,\n $this->lines[$i]->fk_unit\n\t );\n\t if ($result < 0)\n\t {\n\t dol_syslog(get_class($this).\"::create \".$this->error, LOG_WARNING);\t// do not use dol_print_error here as it may be a functionnal error\n\t $this->db->rollback();\n\t return -1;\n\t }\n\t }\n\n\t $sql = \"UPDATE \".MAIN_DB_PREFIX.\"commande_fournisseur\";\n\t $sql.= \" SET ref='(PROV\".$this->id.\")'\";\n\t $sql.= \" WHERE rowid=\".$this->id;\n\t dol_syslog(get_class($this).\"::create\", LOG_DEBUG);\n\t if ($this->db->query($sql))\n\t {\n\t\t\t\t\t// Add link with price request and supplier order\n\t\t\t\t\tif ($this->id)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ref=\"(PROV\".$this->id.\")\";\n\n\t\t\t\t\t\tif (! empty($this->linkedObjectsIds) && empty($this->linked_objects))\t// To use new linkedObjectsIds instead of old linked_objects\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->linked_objects = $this->linkedObjectsIds;\t// TODO Replace linked_objects with linkedObjectsIds\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Add object linked\n\t\t\t\t\t\tif (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach($this->linked_objects as $origin => $tmp_origin_id)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t if (is_array($tmp_origin_id)) // New behaviour, if linked_object can have several links per type, so is something like array('contract'=>array(id1, id2, ...))\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t foreach($tmp_origin_id as $origin_id)\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t $ret = $this->add_object_linked($origin, $origin_id);\n\t\t\t\t\t\t\t if (! $ret)\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t dol_print_error($this->db);\n\t\t\t\t\t\t\t $error++;\n\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 else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1))\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t $origin_id = $tmp_origin_id;\n\t\t\t\t\t\t\t\t\t$ret = $this->add_object_linked($origin, $origin_id);\n\t\t\t\t\t\t\t\t\tif (! $ret)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tdol_print_error($this->db);\n\t\t\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t if (! $error)\n {\n \t$result=$this->insertExtraFields();\n\t if ($result < 0) $error++;\n }\n\n\t\t\t\t\tif (! $error && ! $notrigger)\n\t {\n\t\t\t\t\t\t// Call trigger\n\t\t\t\t\t\t$result=$this->call_trigger('ORDER_SUPPLIER_CREATE', $user);\n\t\t\t\t\t\tif ($result < 0)\n\t {\n\t $this->db->rollback();\n\t return -1;\n\t }\n\t\t\t\t\t\t// End call triggers\n\t }\n\n\t $this->db->commit();\n\t return $this->id;\n\t }\n\t else\n\t {\n\t $this->error=$this->db->lasterror();\n\t $this->db->rollback();\n\t return -2;\n\t }\n }\n }\n else\n {\n $this->error=$this->db->lasterror();\n $this->db->rollback();\n return -1;\n }\n }", "public function invoiceitem_create( $customer_id, $amount, $desc ) {\r\n\t\t$params = array(\r\n\t\t\t'customer' => $customer_id,\r\n\t\t\t'amount' => $amount,\r\n\t\t\t'currency' => 'usd',\r\n\t\t\t'description' => $desc\r\n\t\t);\r\n\t\t\r\n\t\treturn $this->_send_request( 'invoiceitems', $params, STRIPE_METHOD_POST );\r\n\t}", "public function createInvoice(CreateInvoice $createInvoice): Invoice\n {\n $out = $this->request('createInvoice', ['query' => $createInvoice->toArray()]);\n return new Invoice($out['result']);\n }", "public function createMilestoneInvoice(Request $request)\n { \n $user = User::where('email', $request->input('email'))->first();\n if(!$user){\n $validator = Validator::make($request->all(), [\n 'firstname' => 'required|string|max:255',\n 'lastname' => 'required|string|max:255',\n 'phone'=>'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users'\n ]);\n\n if ($validator->fails()) {\n return redirect()->back()->withErrors($validator)->withInput();\n } \n $user = User::create([\n 'firstname' => $request->input('firstname'),\n 'lastname' => $request->input('lastname'),\n 'phone' => $request->input('phone'),\n 'email' => $request->input('email'),\n 'password' => bcrypt('123456'),\n 'user_type' => 'personal',\n 'account_balance' => 0.00, \n ]);\n }\n\n $invoice = new Invoice();\n $invoice->sender_id = Auth::user()->id;\n $invoice->recipient_id = $user->id;\n $invoice->invoice_no = Keygen::numeric(6)->generate();\n $invoice->note = $request->input('note');\n $invoice->secret_key = str_random(8);//md5(microtime())\n $invoice->amount = $request->input('amount');\n $invoice->invoice_type = 'milestone';\n $invoice->offline_ref_code = Keygen::numeric(15)->generate();\n\n if ($request->hasFile('photo')) {\n $randomKey = sha1(time() . microtime());\n $extension = $request->file('photo')->getClientOriginalExtension();\n $fileName = $randomKey . '.' . $extension;\n\n $destinationPath = public_path() . '/images/uploads/invoices/';\n // Check if the folder exists on upload, create it if it doesn't\n if (!is_dir(public_path('/images/uploads/invoices/'))) {\n $this->fs->makeDirectory(public_path('/images/uploads/invoices/'), 0777, true);\n }\n //Move the photo to a temporary path\n $upload_success = $request->file('photo')->move($destinationPath, $fileName);\n \n if ($upload_success) {\n $invoice->photo = $fileName;\n }\n }\n $invoice->save();\n \n // Session::flash('flash_message', 'Invoice successfully created!');\n return redirect()->route('invoice.show.set-milestones', ['invoice'=>$invoice->uuid]);\n }", "public function createInvoicePdf(): void\n {\n if (is_null($this->invoice)){\n throw new \\InvalidArgumentException(\"You forgot to pass the invoice\");\n }\n\n if ($this->invoice->getType() == Invoice::RECHARGE) {\n $this->rechargeInvoice->createInvoicePdf($this->invoice);\n }\n\n if ($this->invoice->getType() == Invoice::WALLET) {\n $this->walletInvoice->createInvoicePdf($this->invoice);\n }\n\n // if the missing invoice is complementary or additional\n if ($this->invoice->getType() == Invoice::ADDITIONAL) {\n $this->additionalInvoice->createInvoicePdf($this->invoice);\n }\n\n // if the missing invoice is monthly and for an agency or a network\n if ($this->invoice->getType() == Invoice::MONTHLY_PER_ORGANIZATION) {\n $this->organizationMonthly->createInvoicePdf($this->invoice);\n }\n\n // if the missing invoice is monthly and for a single user\n if ($this->invoice->getType() == Invoice::MONTHLY_PER_USER) {\n $this->userMonthlyInvoice->createInvoicePdf($this->invoice);\n }\n\n // if the missing invoice is ordinary\n if ($this->invoice->getType() == Invoice::ORDINARY) {\n $this->ordinaryInvoice->createInvoicePdf($this->invoice);\n }\n }", "public function __construct(User $user, $invoices)\n {\n $this->user = $user;\n $this->invoices = $invoices;\n }", "public static function create($body)\n\t{\n\t\t$returned = \\QuickFile\\Request::_sendData($body, '/invoice/create');\n\t\treturn $returned->Invoice_Create->Body;\n\t}", "function payment($userid = 0, $invoiceid = 0, $invoicetype = 'subscription', $amount = 0, $method = 'account', $gateway = '', $gatewaytxn = '', $isrefund = false, $originalgatewaytxn = '', $silentmode = false)\n {\n global $ilance, $show, $phrase, $page_title, $area_title, $ilconfig, $ilpage;\n\t\t$selectextrafields = '';\n\n ($apihook = $ilance->api('process_debit_payment_start')) ? eval($apihook) : false;\n \n // #### INSTANT PAYMENT NOTIFICATION HANDLER ###########################\n if ($method == 'ipn')\n {\n $sql = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, isenhancementfee, transactionid, projectid\" . $selectextrafields. \"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"',\n paymethod = '\" . $ilance->db->escape_string($gateway) . \"',\n custommessage = '\" . $ilance->db->escape_string($gatewaytxn) . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n if ($res_invoice['isif'] == '1')\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '1' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '0' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" , featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n }\n else if ($res_invoice['isenhancementfee'] == '1')\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isifpaid', $res_invoice['projectid']) == '1' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isifpaid', $res_invoice['projectid']) == '0' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n } \n else if ($res_invoice['isfvf'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['isescrowfee'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n \n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_ipn_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND orderid = '\" . $res_invoice['buynowid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n $resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC);\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => fetch_user('username', intval($userid)),\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n $ilance->email->send();\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->send();\n return true;\n }\n return false;\n }\n // #### ONLINE ACCOUNT HANDLER #########################################\n else if ($method == 'account')\n {\n $sql_balance = $ilance->db->query(\"\n\t\t\t\tSELECT available_balance, total_balance\n\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\tWHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_balance) > 0)\n {\n $res_balance = $ilance->db->fetch_array($sql_balance, DB_ASSOC);\n if ($res_balance['available_balance'] >= $amount)\n {\n $avail_balance = $res_balance['available_balance'];\n $total_balance = $res_balance['total_balance'];\n $avail_balance_after = ($avail_balance - $amount);\n $total_balance_after = ($total_balance - $amount);\n $sql_invoice = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, transactionid, isenhancementfee\" . $selectextrafields .\"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_invoice) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql_invoice, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND invoicetype = '\" . $ilance->db->escape_string($invoicetype) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"users\n SET available_balance = '\" . $ilance->db->escape_string($avail_balance_after) . \"',\n total_balance = '\" . $ilance->db->escape_string($total_balance_after) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($res_invoice['isif'])\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isenhancementfeepaid, enhancementfeeinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isenhancementfeepaid'] == '1' AND $res['enhancementfeeinvoiceid'] != '0') OR ($res['isenhancementfeepaid'] == '0' AND $res['enhancementfeeinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isenhancementfee'])\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isifpaid, ifinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isifpaid'] == '1' AND $res['ifinvoiceid'] != '0') OR ($res['isifpaid'] == '0' AND $res['ifinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isfvf'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n if ($res_invoice['isescrowfee'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_account_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT orderid, escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n while ($resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC))\n {\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => $_SESSION['ilancedata']['user']['username'],\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n $ilance->email->mail = $_SESSION['ilancedata']['user']['email'];\n $ilance->email->slng = $_SESSION['ilancedata']['user']['slng'];\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n if ($silentmode)\n {\n return true;\n }\n $area_title = '{_invoice_payment_complete_menu}';\n $page_title = SITE_NAME . ' - {_invoice_payment_complete_menu}';\n print_notice('{_invoice_payment_complete}', '{_your_invoice_has_been_paid_in_full}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n $page_title = SITE_NAME . ' - {_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n print_notice('{_invoice_error}', '{_were_sorry_this_invoice_does_not_exist}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_funds_not_available}';\n $page_title = SITE_NAME . ' - {_funds_not_available}';\n print_notice('{_invoice_payment_warning_insufficient_funds}', '{_were_sorry_this_invoice_can_not_be_paid_due_to_insufficient_funds}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n }\n return false;\n }", "public function actionCreate()\n\t{\n\t\t$model = new AccountInvoice();\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t} else {\n\t\t\treturn $this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}", "public function create_new_invoice($cust_fullname,$user_id,$theme_name,$color_combo,$cust_mobileno,$cust_alternate_mobileno,$cust_emailId,$event_address,$event_pincode,$event_location,$event_landmark,$event_id,$subcat_id,$venue_type,$eventDate,$eventTime,$concept_type,$notes_or_Remarks,$transportation_Rate,$Tax_percentage,$Advance,$Total,$event_Details,$name_on_board,$special_notes){\n//\n// .\" event_address, event_pincode, event_location, event_landmark, event_id,subcat_id,venue_type,eventDate,eventTime,concept_type,notes_or_Remarks,transportation_Rate,Tax_percentage,Advance,Total,Status,event_Details) \"\n//\n// .\" VALUES ('\".$cust_fullname.\"',$user_id,'\".$theme_name.\"','\".$color_combo.\"','\".$cust_mobileno.\"','\".$cust_alternate_mobileno.\"','\".$cust_emailId.\"','\".$event_address.\"','\".$event_pincode.\"','\".$event_location.\"','\".$event_landmark.\"',$event_id,$subcat_id,'\".$venue_type.\"','\".$eventDate.\"','\".$eventTime.\"','\".$concept_type.\"','\".$notes_or_Remarks.\"',\".$transportation_Rate.\",\".$transportation_Rate.\",$Tax_percentage,$Advance,$Total,'Upcoming Event','\".$event_Details.\"')\";\n\n $strInsertQry=\"INSERT INTO sidhus_invoice (cust_fullname,event_Details,user_id, theme_name, color_combo, cust_mobileno, cust_alternate_mobileno, cust_emailId, \"\n\n .\" event_address, event_pincode, event_location, event_landmark, event_id,subcat_id,venue_type,eventDate,eventTime,concept_type,notes_or_Remarks,transportation_Rate,Tax_percentage,Advance,Total,Status,name_on_board,special_notes) \"\n\n .\" VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n\n $stmt = $this->con->prepare($strInsertQry);\n$status='Upcoming Event';\n $stmt->bind_param(\"ssisssssssssissssssiiiisss\",$cust_fullname,$event_Details,$user_id, $theme_name,$color_combo,$cust_mobileno,$cust_alternate_mobileno,$cust_emailId,$event_address,$event_pincode,$event_location,$event_landmark,$event_id,$subcat_id,$venue_type,$eventDate,$eventTime,$concept_type,$notes_or_Remarks,$transportation_Rate,$Tax_percentage,$Advance,$Total,$status,$name_on_board,$special_notes);\n\n $result = $stmt->execute();\n $stmt->close();\n\n if($result) {\n\n $sql = \"SELECT invoice_no FROM sidhus_invoice WHERE invoice_no = LAST_INSERT_ID()\";\n\n $result = $this->con->query($sql);\n\n $this->con->close();\n\n if ($result->num_rows > 0)\n\n return $result->fetch_assoc()[\"invoice_no\"];\n\n else\n\n return false;\n\n }\n\n else\n\n return false;\n\n\n\n }", "public function createStd(User $user, $notrigger = false, $mode = '')\n {\n\t\tglobal $conf, $langs;\n\n $langs->loadLangs(array(\"accountancy\", \"bills\", \"compta\"));\n\n\t\tdol_syslog(__METHOD__, LOG_DEBUG);\n\n\t\t$error = 0;\n\n\t\t// Clean parameters\n\t\tif (isset($this->doc_type)) {\n\t\t\t$this->doc_type = trim($this->doc_type);\n\t\t}\n\t\tif (isset($this->doc_ref)) {\n\t\t\t$this->doc_ref = trim($this->doc_ref);\n\t\t}\n\t\tif (isset($this->fk_doc)) {\n\t\t\t$this->fk_doc = (int) $this->fk_doc;\n\t\t}\n\t\tif (isset($this->fk_docdet)) {\n\t\t\t$this->fk_docdet = (int) $this->fk_docdet;\n\t\t}\n\t\tif (isset($this->thirdparty_code)) {\n\t\t\t$this->thirdparty_code = trim($this->thirdparty_code);\n\t\t}\n\t\tif (isset($this->subledger_account)) {\n\t\t\t$this->subledger_account = trim($this->subledger_account);\n\t\t}\n\t\tif (isset($this->subledger_label)) {\n\t\t\t$this->subledger_label = trim($this->subledger_label);\n\t\t}\n\t\tif (isset($this->numero_compte)) {\n\t\t\t$this->numero_compte = trim($this->numero_compte);\n\t\t}\n\t\tif (isset($this->label_compte)) {\n\t\t\t$this->label_compte = trim($this->label_compte);\n\t\t}\n\t\tif (isset($this->label_operation)) {\n\t\t\t$this->label_operation = trim($this->label_operation);\n\t\t}\n\t\tif (isset($this->debit)) {\n\t\t\t$this->debit = trim($this->debit);\n\t\t}\n\t\tif (isset($this->credit)) {\n\t\t\t$this->credit = trim($this->credit);\n\t\t}\n\t\tif (isset($this->montant)) {\n\t\t\t$this->montant = trim($this->montant);\n\t\t}\n\t\tif (isset($this->sens)) {\n\t\t\t$this->sens = trim($this->sens);\n\t\t}\n\t\tif (isset($this->import_key)) {\n\t\t\t$this->import_key = trim($this->import_key);\n\t\t}\n\t\tif (isset($this->code_journal)) {\n\t\t\t$this->code_journal = trim($this->code_journal);\n\t\t}\n\t\tif (isset($this->journal_label)) {\n\t\t\t$this->journal_label = trim($this->journal_label);\n\t\t}\n\t\tif (isset($this->piece_num)) {\n\t\t\t$this->piece_num = trim($this->piece_num);\n\t\t}\n\t\tif (empty($this->debit)) $this->debit = 0;\n\t\tif (empty($this->credit)) $this->credit = 0;\n\n\t\t$this->debit = price2num($this->debit, 'MT');\n\t\t$this->credit = price2num($this->credit, 'MT');\n\n\t\t$now = dol_now();\n\n\t\t// Check parameters\n $this->journal_label = $langs->trans($this->journal_label);\n\n\t\t// Insert request\n\t\t$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . $mode.' (';\n\t\t$sql .= 'doc_date,';\n\t\t$sql .= 'date_lim_reglement,';\n\t\t$sql .= 'doc_type,';\n\t\t$sql .= 'doc_ref,';\n\t\t$sql .= 'fk_doc,';\n\t\t$sql .= 'fk_docdet,';\n\t\t$sql .= 'thirdparty_code,';\n\t\t$sql .= 'subledger_account,';\n\t\t$sql .= 'subledger_label,';\n\t\t$sql .= 'numero_compte,';\n\t\t$sql .= 'label_compte,';\n\t\t$sql .= 'label_operation,';\n\t\t$sql .= 'debit,';\n\t\t$sql .= 'credit,';\n\t\t$sql .= 'montant,';\n\t\t$sql .= 'sens,';\n\t\t$sql .= 'fk_user_author,';\n\t\t$sql .= 'date_creation,';\n\t\t$sql .= 'code_journal,';\n\t\t$sql .= 'journal_label,';\n\t\t$sql .= 'piece_num,';\n\t\t$sql .= 'entity';\n\t\t$sql .= ') VALUES (';\n\t\t$sql .= ' ' . (! isset($this->doc_date) || dol_strlen($this->doc_date) == 0 ? 'NULL' : \"'\".$this->db->idate($this->doc_date).\"'\") . ',';\n\t\t$sql .= ' ' . (! isset($this->date_lim_reglement) || dol_strlen($this->date_lim_reglement) == 0 ? 'NULL' : \"'\" . $this->db->idate($this->date_lim_reglement) . \"'\") . ',';\n\t\t$sql .= ' ' . (! isset($this->doc_type) ? 'NULL' : \"'\" . $this->db->escape($this->doc_type) . \"'\") . ',';\n\t\t$sql .= ' ' . (! isset($this->doc_ref) ? 'NULL' : \"'\" . $this->db->escape($this->doc_ref) . \"'\") . ',';\n\t\t$sql .= ' ' . (empty($this->fk_doc) ? '0' : $this->fk_doc) . ',';\n\t\t$sql .= ' ' . (empty($this->fk_docdet) ? '0' : $this->fk_docdet) . ',';\n\t\t$sql .= ' ' . (! isset($this->thirdparty_code) ? 'NULL' : \"'\" . $this->db->escape($this->thirdparty_code) . \"'\") . ',';\n\t\t$sql .= ' ' . (! isset($this->subledger_account) ? 'NULL' : \"'\" . $this->db->escape($this->subledger_account) . \"'\") . ',';\n\t\t$sql .= ' ' . (! isset($this->subledger_label) ? 'NULL' : \"'\" . $this->db->escape($this->subledger_label) . \"'\") . ',';\n\t\t$sql .= ' ' . (! isset($this->numero_compte) ? 'NULL' : \"'\" . $this->db->escape($this->numero_compte) . \"'\") . ',';\n\t\t$sql .= ' ' . (! isset($this->label_compte) ? 'NULL' : \"'\" . $this->db->escape($this->label_compte) . \"'\") . ',';\n\t\t$sql .= ' ' . (! isset($this->label_operation) ? 'NULL' : \"'\" . $this->db->escape($this->label_operation) . \"'\") . ',';\n\t\t$sql .= ' ' . (! isset($this->debit) ? 'NULL' : $this->debit ). ',';\n\t\t$sql .= ' ' . (! isset($this->credit) ? 'NULL' : $this->credit ). ',';\n\t\t$sql .= ' ' . (! isset($this->montant) ? 'NULL' : $this->montant ). ',';\n\t\t$sql .= ' ' . (! isset($this->sens) ? 'NULL' : \"'\" . $this->db->escape($this->sens) . \"'\") . ',';\n\t\t$sql .= ' ' . $user->id . ',';\n\t\t$sql .= ' ' . \"'\".$this->db->idate($now).\"',\";\n\t\t$sql .= ' ' . (empty($this->code_journal) ? 'NULL' : \"'\" . $this->db->escape($this->code_journal) . \"'\") . ',';\n\t\t$sql .= ' ' . (empty($this->journal_label) ? 'NULL' : \"'\" . $this->db->escape($this->journal_label) . \"'\") . ',';\n\t\t$sql .= ' ' . (empty($this->piece_num) ? 'NULL' : $this->db->escape($this->piece_num)).',';\n\t\t$sql .= ' ' . (! isset($this->entity) ? $conf->entity : $this->entity);\n\t\t$sql .= ')';\n\n\t\t$this->db->begin();\n\n\t\t$resql = $this->db->query($sql);\n\t\tif (! $resql) {\n\t\t\t$error ++;\n\t\t\t$this->errors[] = 'Error ' . $this->db->lasterror();\n\t\t\tdol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);\n\t\t}\n\n\t\tif (! $error) {\n\t\t\t$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element . $mode);\n\n\t\t\t// Uncomment this and change MYOBJECT to your own tag if you\n\t\t\t// want this action to call a trigger.\n\t\t\t//if (! $notrigger) {\n\n\t\t\t// // Call triggers\n\t\t\t// $result=$this->call_trigger('MYOBJECT_CREATE',$user);\n\t\t\t// if ($result < 0) $error++;\n\t\t\t// // End call triggers\n\t\t\t//}\n\t\t}\n\n\t\t// Commit or rollback\n\t\tif ($error) {\n\t\t\t$this->db->rollback();\n\n\t\t\treturn - 1 * $error;\n\t\t} else {\n\t\t\t$this->db->commit();\n\n\t\t\treturn $this->id;\n\t\t}\n\t}", "function createVirtualAccount($useridnumber, $username, $userid)\n\t{\n\t\t$rel_url = \"virtual_accounts\";\n\t\t$post = array(\n\t\t\t\t\t\t'receivers' => array('types' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'bank_account'\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),\n\t\t\t\t\t\t'description' \t => $username,\n\t\t\t\t\t\t'notes' \t\t => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'idnumber' => $useridnumber,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'id'\t => $userid,\n\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t );\n\t\t$virtualAccount = $this->postDataToServerUsingCurl( $post, $rel_url );\n\t\treturn $virtualAccount;\n\t}", "public function create($id) //pasamos el id del cliente\n {\n \n }", "public static function createNew(): Invoice {\n return new Invoice();\n }", "public function create(User $user, $notrigger = false)\n {\n\t\tglobal $conf, $langs;\n\n\t\tdol_syslog(__METHOD__, LOG_DEBUG);\n\n\t\t$error = 0;\n\n\t\t// Clean parameters\n\t\tif (isset($this->doc_type)) {\n\t\t\t$this->doc_type = trim($this->doc_type);\n\t\t}\n\t\tif (isset($this->doc_ref)) {\n\t\t\t$this->doc_ref = trim($this->doc_ref);\n\t\t}\n\t\tif (isset($this->fk_doc)) {\n\t\t\t$this->fk_doc = (int) $this->fk_doc;\n\t\t}\n\t\tif (isset($this->fk_docdet)) {\n\t\t\t$this->fk_docdet = (int) $this->fk_docdet;\n\t\t}\n\t\tif (isset($this->thirdparty_code)) {\n\t\t\t$this->thirdparty_code = trim($this->thirdparty_code);\n\t\t}\n\t\tif (isset($this->subledger_account)) {\n\t\t\t$this->subledger_account = trim($this->subledger_account);\n\t\t}\n\t\tif (isset($this->subledger_label)) {\n\t\t\t$this->subledger_label = trim($this->subledger_label);\n\t\t}\n\t\tif (isset($this->numero_compte)) {\n\t\t\t$this->numero_compte = trim($this->numero_compte);\n\t\t}\n\t\tif (isset($this->label_compte)) {\n\t\t\t$this->label_compte = trim($this->label_compte);\n\t\t}\n\t\tif (isset($this->label_operation)) {\n\t\t\t$this->label_operation = trim($this->label_operation);\n\t\t}\n\t\tif (isset($this->debit)) {\n\t\t\t$this->debit = trim($this->debit);\n\t\t}\n\t\tif (isset($this->credit)) {\n\t\t\t$this->credit = trim($this->credit);\n\t\t}\n\t\tif (isset($this->montant)) {\n\t\t\t$this->montant = trim($this->montant);\n\t\t}\n\t\tif (isset($this->sens)) {\n\t\t\t$this->sens = trim($this->sens);\n\t\t}\n\t\tif (isset($this->import_key)) {\n\t\t\t$this->import_key = trim($this->import_key);\n\t\t}\n\t\tif (isset($this->code_journal)) {\n\t\t\t$this->code_journal = trim($this->code_journal);\n\t\t}\n\t\tif (isset($this->journal_label)) {\n\t\t\t$this->journal_label = trim($this->journal_label);\n\t\t}\n\t\tif (isset($this->piece_num)) {\n\t\t\t$this->piece_num = trim($this->piece_num);\n\t\t}\n\t\tif (empty($this->debit)) $this->debit = 0;\n\t\tif (empty($this->credit)) $this->credit = 0;\n\n\t\t// Check parameters\n\t\tif (($this->numero_compte == \"\") || $this->numero_compte == '-1' || $this->numero_compte == 'NotDefined')\n\t\t{\n\t\t\t$langs->loadLangs(array(\"errors\"));\n\t\t\tif (in_array($this->doc_type, array('bank', 'expense_report')))\n\t\t\t{\n\t\t\t\t$this->errors[]=$langs->trans('ErrorFieldAccountNotDefinedForBankLine', $this->fk_docdet, $this->doc_type);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//$this->errors[]=$langs->trans('ErrorFieldAccountNotDefinedForInvoiceLine', $this->doc_ref, $this->label_compte);\n\t\t\t\t$mesg=$this->doc_ref.', '.$langs->trans(\"AccountAccounting\").': '.$this->numero_compte;\n\t\t\t\tif ($this->subledger_account && $this->subledger_account != $this->numero_compte)\n\t\t\t\t{\n\t\t\t\t\t$mesg.=', '.$langs->trans(\"SubledgerAccount\").': '.$this->subledger_account;\n\t\t\t\t}\n\t\t\t\t$this->errors[]=$langs->trans('ErrorFieldAccountNotDefinedForLine', $mesg);\n\t\t\t}\n\n\t\t\treturn -1;\n\t\t}\n\n\t\t$this->db->begin();\n\n\t\t$this->piece_num = 0;\n\n\t\t// First check if line not yet already in bookkeeping.\n\t\t// Note that we must include doc_type - fk_doc - numero_compte - label to be sure to have unicity of line (we may have several lines\n\t\t// with same doc_type, fk_doc, numero_compte for 1 invoice line when using localtaxes with same account)\n\t\t// WARNING: This is not reliable, label may have been modified. This is just a small protection.\n\t\t// The page to make journalization make the test on couple doc_type - fk_doc only.\n\t\t$sql = \"SELECT count(*) as nb\";\n\t\t$sql .= \" FROM \" . MAIN_DB_PREFIX . $this->table_element;\n\t\t$sql .= \" WHERE doc_type = '\" . $this->db->escape($this->doc_type) . \"'\";\n\t\t$sql .= \" AND fk_doc = \" . $this->fk_doc;\n\t\t//$sql .= \" AND fk_docdet = \" . $this->fk_docdet;\t\t\t\t\t// This field can be 0 if record is for several lines\n\t\t$sql .= \" AND numero_compte = '\" . $this->db->escape($this->numero_compte) . \"'\";\n\t\t$sql .= \" AND label_operation = '\" . $this->db->escape($this->label_operation) . \"'\";\n\t\t$sql .= \" AND entity IN (\" . getEntity('accountancy') . \")\";\n\n\t\t$resql = $this->db->query($sql);\n\n\t\tif ($resql) {\n\t\t\t$row = $this->db->fetch_object($resql);\n\t\t\tif ($row->nb == 0)\n\t\t\t{\n\t\t\t\t// Determine piece_num\n\t\t\t\t$sqlnum = \"SELECT piece_num\";\n\t\t\t\t$sqlnum .= \" FROM \" . MAIN_DB_PREFIX . $this->table_element;\n\t\t\t\t$sqlnum .= \" WHERE doc_type = '\" . $this->db->escape($this->doc_type) . \"'\";\t\t// For example doc_type = 'bank'\n\t\t\t\t$sqlnum .= \" AND fk_docdet = \" . $this->db->escape($this->fk_docdet);\t\t\t\t// fk_docdet is rowid into llx_bank or llx_facturedet or llx_facturefourndet, or ...\n\t\t\t\t$sqlnum .= \" AND doc_ref = '\" . $this->db->escape($this->doc_ref) . \"'\";\t\t\t// ref of source object\n\t\t\t\t$sqlnum .= \" AND entity IN (\" . getEntity('accountancy') . \")\";\n\n\t\t\t\tdol_syslog(get_class($this) . \":: create sqlnum=\" . $sqlnum, LOG_DEBUG);\n\t\t\t\t$resqlnum = $this->db->query($sqlnum);\n\t\t\t\tif ($resqlnum) {\n\t\t\t\t\t$objnum = $this->db->fetch_object($resqlnum);\n\t\t\t\t\t$this->piece_num = $objnum->piece_num;\n\t\t\t\t}\n\t\t\t\tdol_syslog(get_class($this) . \":: create this->piece_num=\" . $this->piece_num, LOG_DEBUG);\n\t\t\t\tif (empty($this->piece_num)) {\n\t\t\t\t\t$sqlnum = \"SELECT MAX(piece_num)+1 as maxpiecenum\";\n\t\t\t\t\t$sqlnum .= \" FROM \" . MAIN_DB_PREFIX . $this->table_element;\n\t\t\t\t\t$sqlnum .= \" WHERE entity IN (\" . getEntity('accountancy') . \")\";\n\n\t\t\t\t\tdol_syslog(get_class($this) . \":: create sqlnum=\" . $sqlnum, LOG_DEBUG);\n\t\t\t\t\t$resqlnum = $this->db->query($sqlnum);\n\t\t\t\t\tif ($resqlnum) {\n\t\t\t\t\t\t$objnum = $this->db->fetch_object($resqlnum);\n\t\t\t\t\t\t$this->piece_num = $objnum->maxpiecenum;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdol_syslog(get_class($this) . \":: create this->piece_num=\" . $this->piece_num, LOG_DEBUG);\n\t\t\t\tif (empty($this->piece_num)) {\n\t\t\t\t\t$this->piece_num = 1;\n\t\t\t\t}\n\n\t\t\t\t$now = dol_now();\n\n\t\t\t\t$sql = \"INSERT INTO \" . MAIN_DB_PREFIX . $this->table_element . \" (\";\n\t\t\t\t$sql .= \"doc_date\";\n\t\t\t\t$sql .= \", date_lim_reglement\";\n\t\t\t\t$sql .= \", doc_type\";\n\t\t\t\t$sql .= \", doc_ref\";\n\t\t\t\t$sql .= \", fk_doc\";\n\t\t\t\t$sql .= \", fk_docdet\";\n\t\t\t\t$sql .= \", thirdparty_code\";\n\t\t\t\t$sql .= \", subledger_account\";\n\t\t\t\t$sql .= \", subledger_label\";\n\t\t\t\t$sql .= \", numero_compte\";\n\t\t\t\t$sql .= \", label_compte\";\n\t\t\t\t$sql .= \", label_operation\";\n\t\t\t\t$sql .= \", debit\";\n\t\t\t\t$sql .= \", credit\";\n\t\t\t\t$sql .= \", montant\";\n\t\t\t\t$sql .= \", sens\";\n\t\t\t\t$sql .= \", fk_user_author\";\n\t\t\t\t$sql .= \", date_creation\";\n\t\t\t\t$sql .= \", code_journal\";\n\t\t\t\t$sql .= \", journal_label\";\n\t\t\t\t$sql .= \", piece_num\";\n\t\t\t\t$sql .= ', entity';\n\t\t\t\t$sql .= \") VALUES (\";\n\t\t\t\t$sql .= \"'\".$this->db->idate($this->doc_date).\"'\";\n\t\t\t\t$sql .= \", \".(! isset($this->date_lim_reglement) || dol_strlen($this->date_lim_reglement) == 0 ? 'NULL' : \"'\".$this->db->idate($this->date_lim_reglement).\"'\");\n\t\t\t\t$sql .= \",'\" . $this->db->escape($this->doc_type) . \"'\";\n\t\t\t\t$sql .= \",'\" . $this->db->escape($this->doc_ref) . \"'\";\n\t\t\t\t$sql .= \",\" . $this->fk_doc;\n\t\t\t\t$sql .= \",\" . $this->fk_docdet;\n\t\t\t\t$sql .= \",'\" . $this->db->escape($this->thirdparty_code) . \"'\";\n\t\t\t\t$sql .= \",'\" . $this->db->escape($this->subledger_account) . \"'\";\n\t\t\t\t$sql .= \",'\" . $this->db->escape($this->subledger_label) . \"'\";\n\t\t\t\t$sql .= \",'\" . $this->db->escape($this->numero_compte) . \"'\";\n\t\t\t\t$sql .= \",'\" . $this->db->escape($this->label_compte) . \"'\";\n\t\t\t\t$sql .= \",'\" . $this->db->escape($this->label_operation) . \"'\";\n\t\t\t\t$sql .= \",\" . $this->debit;\n\t\t\t\t$sql .= \",\" . $this->credit;\n\t\t\t\t$sql .= \",\" . $this->montant;\n\t\t\t\t$sql .= \",'\" . $this->db->escape($this->sens) . \"'\";\n\t\t\t\t$sql .= \",'\" . $this->db->escape($this->fk_user_author) . \"'\";\n\t\t\t\t$sql .= \",'\".$this->db->idate($now).\"'\";\n\t\t\t\t$sql .= \",'\" . $this->db->escape($this->code_journal) . \"'\";\n\t\t\t\t$sql .= \",'\" . $this->db->escape($this->journal_label) . \"'\";\n\t\t\t\t$sql .= \",\" . $this->db->escape($this->piece_num);\n\t\t\t\t$sql .= \", \" . (! isset($this->entity) ? $conf->entity : $this->entity);\n\t\t\t\t$sql .= \")\";\n\n\t\t\t\tdol_syslog(get_class($this) . \":: create sql=\" . $sql, LOG_DEBUG);\n\t\t\t\t$resql = $this->db->query($sql);\n\t\t\t\tif ($resql) {\n\t\t\t\t\t$id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);\n\n\t\t\t\t\tif ($id > 0) {\n\t\t\t\t\t\t$this->id = $id;\n\t\t\t\t\t\t$result = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result = -2;\n\t\t\t\t\t\t$error ++;\n\t\t\t\t\t\t$this->errors[] = 'Error Create Error ' . $result . ' lecture ID';\n\t\t\t\t\t\tdol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$result = -1;\n\t\t\t\t\t$error ++;\n\t\t\t\t\t$this->errors[] = 'Error ' . $this->db->lasterror();\n\t\t\t\t\tdol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);\n\t\t\t\t}\n\t\t\t} else {\t// Already exists\n\t\t\t\t$result = -3;\n\t\t\t\t$error++;\n\t\t\t\t$this->error='BookkeepingRecordAlreadyExists';\n\t\t\t\tdol_syslog(__METHOD__ . ' ' . $this->error, LOG_WARNING);\n\t\t\t}\n\t\t} else {\n\t\t\t$result = -5;\n\t\t\t$error ++;\n\t\t\t$this->errors[] = 'Error ' . $this->db->lasterror();\n\t\t\tdol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);\n\t\t}\n\n\t\t// Uncomment this and change MYOBJECT to your own tag if you\n\t\t// want this action to call a trigger.\n\t\t//if (! $error && ! $notrigger) {\n\n\t\t// // Call triggers\n\t\t// $result=$this->call_trigger('MYOBJECT_CREATE',$user);\n\t\t// if ($result < 0) $error++;\n\t\t// // End call triggers\n\t\t//}\n\n\t\t// Commit or rollback\n\t\tif ($error) {\n\t\t\t$this->db->rollback();\n\t\t\treturn -1 * $error;\n\t\t} else {\n\t\t\t$this->db->commit();\n\t\t\treturn $result;\n\t\t}\n\t}", "public function addNewInvoiceProForma(Request $request, $id){\n $ids = Auth::user()->id;\n $user = User::find($ids);\n\n $firstName = $user->first_name;\n $lastName = $user->last_name;\n\n $name = $firstName.\" \".$lastName;\n\n $addNewInvoice = new WlgCorporationInvoice([\n 'user_id'=>$user->id,\n 'if_id'=>$id,\n 'number_of_goods'=>$request->get('no'),\n 'description_of_goods'=>$request->get('descGoods'),\n 'qty'=>$request->get('qty'),\n 'unit_price'=>$request->get('unitPrice'),\n 'total_amount'=>$request->get('totalAmount'),\n 'created_by'=>$name,\n ]);\n\n $addNewInvoice->save();\n Session::flash('successAdd', 'Successfully added');\n\n return redirect()->route('editInvoiceProForma', ['id'=>$id]);\n\n }", "public function create()\n {\n $data = [];\n $data['menu'] = 'sales';\n if (isset($_GET['type']) && $_GET['type'] == 'project') {\n if (!(Project::where('id', $_GET['project_id'])->exists())) {\n abort(404);\n }\n if (!empty($_GET['customer_id'])) {\n if (!(Customer::where('id', $_GET['customer_id'])->exists()) || (!(Project::where('id', $_GET['project_id'])->exists()) && !(Customer::where('id', $_GET['customer_id'])->exists()))) {\n abort(404);\n }\n }\n $data['menu'] = 'project';\n $data['project_id'] = $_GET['project_id'];\n $data['customer_id'] = $_GET['customer_id'];\n $data['projects'] = Project::all();\n }\n $data['sub_menu'] = 'sales/direct-invoice';\n $data['page_title'] = __('Create Invoice');\n $data['url'] = 'invoice/list';\n\n $data['customerData'] = Customer::with(['currency:id,name,symbol'])->where(['is_active' => 1])->get();\n\n $data['countries'] = Country::getAll();\n $data['currencies'] = Currency::getAll();\n $data['paymentTerms'] = PaymentTerm::getAll();\n $data['locations'] = Location::getAll()->where('is_active', 1);\n $data['salesType'] = SaleType::select('sale_type', 'id')->get();\n\n $invoice_count = SaleOrder::where('transaction_type', 'SALESINVOICE')->count();\n\n if ($invoice_count > 0) {\n $invoiceReference = SaleOrder::where('transaction_type', 'SALESINVOICE')\n ->latest('id')\n ->first(['reference']);\n $ref = explode(\"-\", $invoiceReference->reference);\n $data['invoice_count'] = (int)$ref[1];\n } else {\n $data['invoice_count'] = 0;\n }\n\n $taxTypeList = TaxType::getAll();\n $data['taxes'] = json_encode($taxTypeList);\n $taxOptions = '';\n $selectStart = \"<select name='item_tax[]' class='inputTax form-control bootstrap-select selectpicker' multiple>\";\n $selectEnd = \"</select>\";\n\n $selectStartCustom = \"<select class='inputTax form-control bootstrap-select selectpicker' multiple name='custom_item_tax[1][]'>\";\n $selectEndCustom = \"</select>\";\n $taxHiddenField = \"\";\n\n foreach ($taxTypeList as $key => $value) {\n $taxHiddenField.=\"<input type='hidden' class='itemTaxAmount itemTaxAmount-\".$value->id.\"'>\";\n $taxOptions .= \"<option title='\" . $value->tax_rate . \"%' value='\" . $value->id . \"' taxrate='\" . $value->tax_rate . \"'>\" . $value->name . '(' . $value->tax_rate . ')' . \"</option>\";\n }\n $data['tax_type'] = $selectStart . $taxOptions . $selectEnd;\n $data['custom_tax_type'] = $selectStartCustom . $taxOptions . $selectEndCustom . $taxHiddenField;\n $data['projects'] = Project::where('customer_id', '!=', 0)->get();\n $preference = Preference::getAll()->pluck('value', 'field')->toArray();\n $data['exchange_rate_decimal_digits'] = $preference['exchange_rate_decimal_digits'];\n\n return view('admin.invoice.add', $data);\n }", "public function create()\n\t{\n /*if(!in_array('viewProduct', $this->permission)) {\n redirect('dashboard', 'refresh');\n }*/\n\n $this->data['vendor'] = $this->model_products->getVendorData();\n $this->data['products'] = $this->model_products->getProductData();\n\n\t\t$this->render_template('invoice/create', $this->data);\t\n\t}", "public function invoiceAction() {\n $this->chekcingForMarketplaceSellerOrNot ();\n /**\n * Get order Id\n * @var unknown\n */\n $orderId = $this->getRequest ()->getParam ( 'id' );\n /**\n * Getting order product ids\n */\n $orderPrdouctIds = Mage::helper ( 'marketplace/vieworder' )->getOrderProductIds ( Mage::getSingleton ( 'customer/session' )->getId (), $orderId );\n /**\n * Getting cancel order items\n */\n $cancelOrderItemProductIds = Mage::helper ( 'marketplace/vieworder' )->cancelOrderItemProductIds ( Mage::getSingleton ( 'customer/session' )->getId (), $orderId );\n\n /**\n * Getting the sonfiguration for order manage.\n */\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n /**\n * Check whether product id count is greater than one\n */\n if (count ( $orderPrdouctIds ) >= 1 && $orderStatusFlag == 1) {\n $order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n $itemsarray = $itemsArr = array ();\n /**\n * prepare invoice items\n */\n foreach ( $order->getAllItems () as $item ) {\n $qty = 0;\n /**\n * Prepare invoice qtys\n */\n $itemProductId = $item->getProductId ();\n $itemId = $item->getItemId ();\n /**\n * check whether item is in array\n */\n if (in_array ( $itemProductId, $orderPrdouctIds ) && ! in_array ( $itemProductId, $cancelOrderItemProductIds )) {\n $itemsArr [] = $itemId;\n /**\n * Qty ordered for that item\n */\n $qty = $item->getQtyOrdered () - $item->getQtyInvoiced ();\n }\n $itemsarray [$itemId] = $qty;\n }\n\n try {\n /**\n * Create invoice\n */\n if ($order->canInvoice ()) {\n /**\n * Generate invoice for shippment.\n */\n Mage::getModel ( 'sales/order_invoice_api' )->create ( $order->getIncrementId (), $itemsarray, '', 1, 1 );\n\t\t Mage::getModel ( 'marketplace/order' )->updateSellerOrderItemsBasedOnSellerItems ( $itemsArr, $orderId, 1 );\n\t\t $order->setStatus('processing');\n\t\t $order->save();\n /**\n * add success message\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( 'The invoice has been created.' ) );\n }\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n }\n } else {\n /**\n * Checkk the permission for generate invoice.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/manage' );\n return false;\n }\n }", "public function actionCreate()\n {\n $model = new Invoice();\n $model->loadDefaultValues();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } elseif (Yii::$app->request->isAjax) {\n return $this->renderAjax('create', [\n 'model' => $model\n ]);\n } else {\n return $this->render('create', [\n 'model' => $model\n ]);\n }\n }", "public function createInvoice()\n {\n $class = $this->class;\n\n return new $class;\n }", "public function create($user, $hierarchy, $amount, $gift = null) {\n //set parameters\n if ($gift) {\n $this->setDescroption('Canje de regalo');\n } else {\n $this->setDescroption('Ha hecho caja');\n }\n\n $this->setUserId($user->getId());\n if ($amount != null) {\n $this->setCash($amount);\n }\n if ($gift != null) {\n $this->setGift($gift);\n }\n $this->setCreatedAt(date('Y-m-d H:i:s'));\n $this->setHierarchy($hierarchy);\n //insert record to db\n $this->save();\n }", "public function createInvoice()\n {\n //seccion para registrar certificaos relacionados con un RFC \n /* $params = [ \n 'Rfc' => 'AAA010101AAA',\n 'Certificate' => 'MIIF+TCCA+GgAwIBAgIUMzAwMDEwMDAwMDAzMDAwMjM3MDEwDQYJKoZIhvcNAQELBQAwggFmMSAwHgYDVQQDDBdBLkMuIDIgZGUgcHJ1ZWJhcyg0MDk2KTEvMC0GA1UECgwmU2VydmljaW8gZGUgQWRtaW5pc3RyYWNpw7NuIFRyaWJ1dGFyaWExODA2BgNVBAsML0FkbWluaXN0cmFjacOzbiBkZSBTZWd1cmlkYWQgZGUgbGEgSW5mb3JtYWNpw7NuMSkwJwYJKoZIhvcNAQkBFhphc2lzbmV0QHBydWViYXMuc2F0LmdvYi5teDEmMCQGA1UECQwdQXYuIEhpZGFsZ28gNzcsIENvbC4gR3VlcnJlcm8xDjAMBgNVBBEMBTA2MzAwMQswCQYDVQQGEwJNWDEZMBcGA1UECAwQRGlzdHJpdG8gRmVkZXJhbDESMBAGA1UEBwwJQ295b2Fjw6FuMRUwEwYDVQQtEwxTQVQ5NzA3MDFOTjMxITAfBgkqhkiG9w0BCQIMElJlc3BvbnNhYmxlOiBBQ0RNQTAeFw0xNzA1MTgwMzU0NTFaFw0yMTA1MTgwMzU0NTFaMIHlMSkwJwYDVQQDEyBBQ0NFTSBTRVJWSUNJT1MgRU1QUkVTQVJJQUxFUyBTQzEpMCcGA1UEKRMgQUNDRU0gU0VSVklDSU9TIEVNUFJFU0FSSUFMRVMgU0MxKTAnBgNVBAoTIEFDQ0VNIFNFUlZJQ0lPUyBFTVBSRVNBUklBTEVTIFNDMSUwIwYDVQQtExxBQUEwMTAxMDFBQUEgLyBIRUdUNzYxMDAzNFMyMR4wHAYDVQQFExUgLyBIRUdUNzYxMDAzTURGUk5OMDkxGzAZBgNVBAsUEkNTRDEwX0FBQTAxMDEwMUFBQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAIiV+76Q7p9i5Bj4G1YuYuPtf/cO/dyNX19o6y57CiKcgGYEqPqb88cJ/IPPyFPIFtBdxYJmqikxMwxDHTIsolI0GMvqEO1BsokcDOL4UfMZt7NmYaH1P8Nj/fO5xn0b1qSnSfQHGdPLMgXsLPhaR69HREsVEIowEMM5ucoNArSNzel4XJU8X/dnoumZvaOyCdvEC076NzB3UJA53ZD1xvvPEedUfAfj2eaUCQJYPnToyf7TAOGzzGkX5EGcjxC3YfcXGwG2eNdbSbxSiADPx6QACgslCu1vzmCzwQAmfeHWQvirpZccJyD/8shd7z7fv5A/G0g3aDloM5AXwA3nDVsCAwEAAaMdMBswDAYDVR0TAQH/BAIwADALBgNVHQ8EBAMCBsAwDQYJKoZIhvcNAQELBQADggIBAJepSmoMRmasH1IyLe68oM6+Qpm/kXjwQw8ALMkhHTI3XmxjUVqpJ6k9zZQfwyTLc2UZIo8jdO4WH3bcRBDcYOkciW3KxhKAbLgJPHAieVOyObXViET0ktLL6xeDHnf5Au4LOi0m01E8IPFbxYKb+RU1xpOKqJuRHH5dfRBg4HV8y+OTa5lVZil+sAhwdyXFsPf9FqN1SNn9EuKjYc9+lkRiGcHPNb1ZAtDsaQdGzoAbR+Z6m9FdZB/XU+Huls+ePdkw1t2/37AJZkYqr3wVNKrrpQkax9DrnFT8E+7xKXLcbpw3YOYBoENj2+NuMn29sn3U97wKlpyn/GeMwbkCmOGBAMtK9O6+wRrcEmu9Js68asHd5JQSzA39BRAUjb/9aefmWTb6DNm22IUUSSOT9MK5yWGncdWxKrNtMvx7OyYlYV2/qG4p/rMlj6nZcIpwONhyLUwxr74kO0Jo3zus81t9S/J91jumiwyNVqJZ77vmAy6lQnr8Og9/YaIzDH5L/byJQJquDKEmLvuya4sQ2iJj+p282RNpBscO/iyma8T+bZjG2CFYUTwGtOEZ2aLqApJ4cCBW7Ip569B+g7mgG8fdij6E1OlJ8Y3+ovBMak8LtnFVxsfthdWOK+AU2hWGU88rfZkLJ0RJn8oAq/6ri0iJNCKym/mc9g0JpNw+asMM',\n 'PrivateKey' => 'MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIAgEAAoIBAQACAggAMBQGCCqGSIb3DQMHBAgwggS9AgEAMASCBMh4EHl7aNSCaMDA1VlRoXCZ5UUmqErAbucRBAKNQXH8tz2zJ7hdZaOZx7PEfMiWh5Nh6e8G8kxY+GW4YCSbLxslkhBtfTR6v5JYv3vhgH7XzMCwJPOfX6gxeeCYZ4HTdDNAyBVCjTbJpqbo778ri33o+I4yx7zgMqA3mzVE61re6MPrGXh1YT/K9zZeEdmwvXQfPs9VnioKUhiswoMcJ3kc3FxGLrEAsjQqv/ZVOHPY3NrbcfpQUyprsCKv3rRdxkIRdMPY4eiA720mffzvDqyzeQ8xfwHTE8Xjunja4KXvW/mV7ItTH0vRXHc3HJQ0dNnyawXmbC1FiYbCVdswoYuVQmslvq3QEXUGwP3KYfxQzKatnU7nprkmsipPqPBqDrzqc6NSN/8rxIc5zTAL4bFul+CEKz9VybwdavgewEy7u3fPnKPN+y4HilNgmlbtS7seWpbIgVPA+woG2Ph5hsgREXZCjGKSRuI77/FLcI5CMrZR+FvbnaqG+gXDBTz2lWhK9pmWlVawT2pvfiHOLzYRf2YyuVbJ79D2EgbUKyp3kCQ6fddMzspPhD/pvLQizExeyIxImb/kQXs2mmtDnyFIsj4Hcn5wCcs+SDIj+FJnwRiKB6YfdzjIig/ZMfpgMpl0u69LX649uL318o+Hy3d5t3wxgSkTaJ5McKhWyh9x9vlHZhYyM6HArBNfP9cGF86M3GwAMHAiJQl9UevyKe6rlvAIDlop6l3M02m5hHUXUpPjz4j7inFXZzvSv0tFoSbEqGgno0Pa+0gWHqRwBEGLGEwHVfyEy+Of8g4+0jzo0jNPIcurA5xRh9HSRSAd3kdEhx75eeVL7lBdLjRUkbtRtg7nelSjqAX7tQZK6Awp5C/17W96+f/vtjB+Y+ZgrSUjnQDADnZCnapIrzHgE3ZanhGAtnMMl+o4aLd1+74inG4jht/GJB60raSQfYrDrM3kBs0oyfpbEk5TI8ISzRlRmejv+mqpTogJaAqhnLP7rAli3d4pRhUjbACn/xQSFKxl2OURdmnMlvlbb6pleXviJHRxzPPQ25NVdWvmCYWrDfAZYn8X1sABOdyrth38BfmAVsyyPATYFB+5cXuNIZkPz1swz3859iZWTn5JRfPEAGICu5G6w6nrgOLYM9UqOPmxofzEdiEPafLQ5orMxdSWF6+3mD2Yw/VP+B43B/oYehgfrYjBUJt2D04VU/v8XK1ZUVgX/Co0odcdcszAP+ljQ7UVhW+uxVMd2sEprwepPPjYT3HvdI6RBB94yYBWfkoCSo/jsrrRpw2DVEyvoDp/hOXKyt8Y/8UGLCxJUhhv5fEiezYnlUAmwAGjgZfzfAErx0gkQFBgNKglEA7jz0Dqc2Z92pGVGTyPtXqRsqX3IYX5WsZVUoJim0wI7+LNmKpu147ePC0G4Sf4AGoZyPWVXq2SZSPpN261pIKSoLEDeA8WIKj2U5JG2DMMYokV0bZ1TsabrwHvwsp3muLnaP8L+n2fBplbhAEE2buBXvsATixMGu57ZI5WKFLnHn4KIBrZzALCtGehfFbCsdf1nBR6aAt+BpWhhZki54fZTurgMr6zuC5hAaP4rExW+LCc3upHMW7R9DcHWaZuZIfwnVDImnAQ9UOsz+A=',\n 'PrivateKeyPassword' => '12345678a'\n ];\n $lstNameIds = $this->facturama->post('api-lite/csds', $params ); */\n\n\n $params = [\n \"Issuer\" => [\n \"FiscalRegime\" => \"601\",\n \"Rfc\" => \"AAA010101AAA\",\n \"Name\" => \"EXPRESION EN SOFTWARE\"\n ],\n \"Receiver\" => [\n \"Name\" => \"Entidad receptora\",\n \"CfdiUse\" => \"P01\",\n \"Rfc\" => \"AAA010101AAA\"\n ],\n //agregado NO \n 'Folio' => '102',\n \"CfdiType\" => \"I\",\n \"NameId\" => \"1\",\n \"ExpeditionPlace\" => \"12345\",\n \"PaymentForm\" => \"03\",\n \"PaymentMethod\" => \"PUE\",\n \"Currency\" => \"MXN\",\n \"Date\" => \"2021-01-19T09:51:39\",\n \"Items\" => [\n [\n \"Quantity\" => \"100\",\n \"ProductCode\" => \"84111506\",\n \"UnitCode\" => \"E48\",\n \"Unit\" => \"Unidad de servicio\",\n \"Description\" => \" API folios adicionales\",\n \"IdentificationNumber\" => \"23\",\n \"UnitPrice\" => \"0.50\",\n \"Subtotal\" => \"50.00\",\n \"Discount\" => \"10\",\n \"DiscountVal\" => \"10\",\n \"Taxes\" => [\n [\n \"Name\" => \"IVA\",\n \"Rate\" => \"0.16\",\n \"Total\" => \"6.4\",\n \"Base\" => \"40\",\n \"IsRetention\" => \"false\"\n ]\n ],\n \"Total\" => \"46.40\"\n ],\n [\n \"Quantity\" => \"1\",\n \"ProductCode\" => \"84111506\",\n \"UnitCode\" => \"E48\",\n \"Unit\" => \"Unidad de servicio\",\n \"Description\" => \" API Implementación \",\n \"IdentificationNumber\" => \"21\",\n \"UnitPrice\" => \"6000.00\",\n \"Subtotal\" => \"6000.00\",\n \"Taxes\" => [\n [\n \"Name\" => \"IVA\",\n \"Rate\" => \"0.16\",\n \"Total\" => \"960\",\n \"Base\" => \"6000\",\n \"IsRetention\" => \"false\"\n ]\n ],\n \"Total\" => \"6960.00\"\n ]\n ]\n ];\n\n // $result = $this->facturama->post('2/cfdis', $params);\n // api-lite\n $result = $this->facturama->post('api-lite/2/cfdis', $params);\n return $result;\n }", "public function createNewRequest()\n { \n return $this->clientManager->createNewRequest('user');\n }", "public function create_invoice()\r\n\t{\r\n\t\textract($_POST); //print_r($_POST);\r\n\t\t\r\n\t\t$max_id = $this->My_model->select_max_id()->INVOICE_NO+1; \r\n\t\t//var_dump( $max_id); \r\n\t\t$invoice_data = array(\r\n\t\t\t\t\t\t\t\t'INVOICE_NO' => \t$max_id,\r\n\t\t\t\t\t\t\t\t'INVOICE_DATE' => \t date('Y-m-d'),\r\n\t\t\t\t\t\t\t\t'STUDENT_ID' => \t$student_id,\r\n\t\t\t\t\t\t\t\t'DUE_DATE'\t\t=> \tdate(\"Y-m-d\",strtotime($due_date))\r\n\t\t\t\t\t\t\t\t); //print_r($invoice_data); die;\r\n\t\t$data = $this->My_model->insert_data('invoice',$invoice_data);\r\n\t\tfor($i=0; $i<=count($charge_id)-1; $i++)\r\n\t\t{\r\n\t\t\t$invoice_log = array(\r\n\t\t\t\t\t\t\t\t'INVOICE_NO' \t=> \t\t$max_id,\r\n\t\t\t\t\t\t\t\t'CHARGE_ID'\t\t=> \t\t$charge_id[$i],\r\n\t\t\t\t\t\t\t\t'INVOICE_DATE' \t=> \t\tdate('Y-m-d'),\r\n\t\t\t\t\t\t\t\t'DUE_DATE'\t\t=> \tdate(\"Y-m-d\",strtotime($due_date))\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t$this->My_model->insert_data('invoice_log',$invoice_log);\r\n\t\t}\r\n\t\tif($data == true)\r\n\t\t{\r\n\t\t$this->session->set_flashdata('msg','<div class=\"alert alert-dark alert-success\">Invoice Generated Sucessfully</div>');\r\n\t\tredirect('Welcome');\r\n\t\t}\r\n\t}", "public function generateInvoice( Request $request ) {\n\t\t$doAction = URLHelpers::decodeGetParam($request->get('do_action'));\n\t\t$transId = URLHelpers::decodeGetParam($request->get('trans_id'));\n\t\t$userId = URLHelpers::decodeGetParam($request->get('user_id'));\n\t\t$isSend = URLHelpers::decodeGetParam($request->get('is_send'));\n\t\t$backOfficeLoggedUser = $request->get('user')['user_id'];\n\n\t\t$apiURL = ($doAction == 'generate_buyer_invoice') ? 'checkout/buyer/invoice' : 'checkout/seller/invoice';\n\n\t\t$result = [];\n\t\t// Parameters required by the public API\n\t\ttry {\n\t\t\t$parameters = [\n\t\t\t\t'user_id' => $userId,\n\t\t\t\t'transaction_id' => $transId,\n\t\t\t\t'is_send' => $isSend,\n\t\t\t\t'backoff_user' => $backOfficeLoggedUser,\n\t\t\t];\n\n\t\t\t// Calling Public API\n\t\t\t$responseAPI = GeneralHelpers::callAPI($apiURL, 'POST', $parameters);\n\n\t\t\tif ( $responseAPI->getStatusCode() == 200 ) {\n\t\t\t\t$response = GuzzleHttp\\json_decode($responseAPI->getBody());\n\n\t\t\t\t// If response code is 200, status is 1 and data changed is 1 set the status as 1 i.e, changed\n\t\t\t\tif ( $response->status == 1 && $response->data->generated == 1 ) {\n\t\t\t\t\t$result['status'] = 1;\n\n\t\t\t\t\t// make log to track time and user\n\t\t\t\t\tDBLog::save(LOG_MODULE_COURSE_ORDER_SUMMARY, $transId, $doAction, $request->getRequestUri(), $backOfficeLoggedUser, $parameters);\n\t\t\t\t}\n\n\t\t\t\treturn $this->sendResponse($result, 200);\n\t\t\t}\n\t\t} catch ( ClientException $e ) {\n\t\t\tLog::error($e->getResponse()->getBody(), $e->getTrace());\n\n\t\t\treturn $this->sendResponse(GuzzleHttp\\json_decode($e->getResponse()->getBody()), 400);\n\t\t}\n\t}", "public function addNewQuotation(Request $request, $id){\n $ids = Auth::user()->id;\n $user = User::find($ids);\n\n $firstName = $user->first_name;\n $lastName = $user->last_name;\n\n $name = $firstName.\" \".$lastName;\n\n $addNewInvoice = new WlgCorporationInvoice([\n 'user_id'=>$user->id,\n 'if_id'=>$id,\n 'number_of_goods'=>$request->get('no'),\n 'description_of_goods'=>$request->get('descGoods'),\n 'qty'=>$request->get('qty'),\n 'unit_price'=>$request->get('unitPrice'),\n 'total_amount'=>$request->get('totalAmount'),\n 'created_by'=>$name,\n ]);\n\n $addNewInvoice->save();\n Session::flash('successAdd', 'Successfully added');\n\n return redirect()->route('editQuotationInvoiceWlg', ['id'=>$id]);\n\n }", "public function createInvoice($projectId = ''){\r\n if($projectId!=''){\r\n \t $this->load->helper('ExactOnline/vendor/autoload');\r\n \t\t$this->load->model('Vtigerexactonline_model');\r\n \t\t$this->load->model('Exactonline_model');\r\n \t\t$this->load->model('Projects_model');\r\n \t\t// get all projects having erp system afas with mailchimp.\r\n $projects = $this->db->get_where('projects', array('id' => $projectId))->result_array();\r\n if(!empty($projects)){\r\n \tforeach ($projects as $p_key => $p_value) {\r\n $projectId = $p_value['id'];\r\n if($this->Projects_model->getValue('cms', $projectId)!='vtiger')\r\n continue;\r\n $lastExecution = $this->Projects_model->getValue('invoice_export_last_execution', $projectId);\r\n $customersInterval = $this->Projects_model->getValue('orders_interval', $projectId);\r\n $enabled = $this->Projects_model->getValue('orders_enabled', $projectId);\r\n $import_option = $this->Projects_model->getValue('vtiger_import_option', $projectId)?$this->Projects_model->getValue('vtiger_import_option', $projectId):'';\r\n // check if the last execution time is satisfy the time checking.\r\n if($import_option == 'invoices' && $enabled == '1' && ($lastExecution == '' || ($lastExecution + ($customersInterval * 60) <= time()))){\r\n //reset last execution time\r\n $this->Projects_model->saveValue('invoice_export_last_execution', time(), $projectId);\r\n // get the offset and amount to import customers. \r\n $currentOrdersOffset = $this->Projects_model->getValue('invoice_export_vtiger_offset', $projectId) ? $this->Projects_model->getValue('invoice_export_vtiger_offset', $projectId) : '';\r\n $ordersAmount= $this->Projects_model->getValue('orders_amount', $projectId) ? $this->Projects_model->getValue('orders_amount', $projectId) : 10;\r\n $invoiceId \t= isset($_GET['invoiceId'])?$_GET['invoiceId']:null; \r\n //--------------- make exact connection ----------------------------------//\r\n \t\t\t\t\t$this->Exactonline_model->setData(\r\n \t\t\t\t\t\tarray(\r\n \t\t\t\t\t\t\t'projectId' => $projectId,\r\n \t\t\t\t\t\t\t'redirectUrl' => $this->Projects_model->getValue('exactonline_redirect_url', $projectId),\r\n \t\t\t\t\t\t\t'clientId' => $this->Projects_model->getValue('exactonline_client_id', $projectId),\r\n \t\t\t\t\t\t\t'clientSecret' => $this->Projects_model->getValue('exactonline_secret_key', $projectId),\r\n \t\t\t\t\t\t)\r\n \t\t\t\t\t);\r\n \t\t\t\t\t$connection = $this->Exactonline_model->makeConnection($projectId);\r\n \t\t\t\t\t// get invoice from exactonline\r\n \t\t\t\t\t$getVtigerInvoice = $this->Vtigerexactonline_model->getVtigerInvoice($projectId, $currentOrdersOffset , $ordersAmount);\r\n \t\t\t\t\tif(!empty($getVtigerInvoice)){\r\n \t\t\t\t\t\tforeach ($getVtigerInvoice as $inv_key => $inv_value) {\r\n \t\t\t\t\t\t\t$getRequestedInvoice = $this->Vtigerexactonline_model->getRequestedInvoice($projectId, $inv_value['id']);\r\n \t\t\t\t\t\t\tif($getRequestedInvoice){\r\n $currentOrdersOffset = $currentOrdersOffset + count($getVtigerInvoice);\r\n $this->Projects_model->saveValue('invoice_export_vtiger_offset', $currentOrdersOffset, $projectId);\r\n $totalInvoiceImportSuccess = $this->Projects_model->getValue('total_invoice_import_success', $projectId)?$this->Projects_model->getValue('total_invoice_import_success', $projectId):0;\r\n $totalInvoiceImportError = $this->Projects_model->getValue('total_invoice_import_error', $projectId)?$this->Projects_model->getValue('total_invoice_import_error', $projectId):0;\r\n \t\t\t\t\t\t\t\t// import invoice in exactonline\r\n \t\t\t\t\t\t\t\t$sendInvoice = $this->Vtigerexactonline_model->importInvoicesToExact($connection, $projectId, $getRequestedInvoice);\r\n if($sendInvoice['status']==2){\r\n continue;\r\n } else if($sendInvoice['status']==0){\r\n $totalInvoiceImportError++;\r\n } else{\r\n $totalInvoiceImportSuccess++;\r\n }\r\n $this->Projects_model->saveValue('total_invoice_import_success', $totalInvoiceImportSuccess, $projectId);\r\n $this->Projects_model->saveValue('total_invoice_import_error', $totalInvoiceImportError, $projectId);\r\n \t\t\t\t\t\t\t\tproject_error_log($projectId, 'importInvoices',$sendInvoice['message']);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else{\r\n $this->Projects_model->saveValue('invoice_export_vtiger_offset', null, $projectId);\r\n \t\t\t\t\t} \r\n }\r\n }\r\n } \r\n }\r\n $this->updateInvoicesToVtiger();\r\n\t}", "public function create(User $user)\n {\n if ($user->can('create client payment detail')) {\n return true;\n }\n }", "public function create()\n {\n //\n\t\treturn view('invoice.create');\n }", "public function whmcs_add_invoice_payment($params = array()) {\n\t\t$params['action'] = 'AddInvoicePayment';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "function add_invoices($params){\n $this->company_db->insert('tbl_invoice_header', $params);\n return $this->company_db->insert_id();\n }", "public function invoiceCreated($invoice)\n\t{\n\n\t}", "function add_invoice_items($params){\n return $this->company_db->insert_batch('tbl_invoice_item', $params);\n }", "public function createClient($dni){\n $idPeople=$this->getIdPeople($dni);\n /**param::::\n * 1->null auto increment\n */\n\n $var=0; // var autoincrement\n $ruc=\"\";\n $idClient=$this->generateIdClient();\n $sql=\"INSERT INTO client VALUES(?,?,?,?)\";\n $rs=$this->con->prepare($sql);\n $rs->execute(array($var,$idClient->id,$idPeople->id_people,$ruc));\n }", "public function sendInvoice() {\n\n $account_invoice_ids = $this->_client->search(\"account.invoice\",\n [\n [\"state\", \"=\", \"open\"],\n [\"type\", \"=\", \"out_invoice\"],\n [\"journal_id\", \"=\", 15],\n [\"sent\", \"=\", False]\n ]);\n\n foreach ($account_invoice_ids as $account_invoice_id) {\n\n $result = $this->_client->execute(\"email.template\", \"send_mail\",\n [\n 4, // Template invio\n $account_invoice_id,\n True\n ]);\n\n if (isset($result[\"faultCode\"])) {\n Util::printError(\"AccountInvoice.sendInvoice\", $result[\"faultString\"]);\n }\n\n $data = [\n \"sent\" => true\n ];\n\n $result = $this->_client->write(\"account.invoice\", $account_invoice_id, $data);\n\n if (isset($result[\"faultCode\"])) {\n Util::printError(\"AccountInvoice.sendInvoice\", $result[\"faultString\"]);\n }\n\n }\n\n }", "public function create()\n {\n JavaScript::put('invoice_id',(int)$this->service->getLastInsertId()+1);\n return view('admin.invoice.add',[\n 'invoice_id'=>((int)$this->service->getLastInsertId()+1),\n 'taxes' => Tax::all(),\n ]);\n }", "function addInvoice() {\n $stmt = $GLOBALS['con']->prepare(\"INSERT INTO invoices (customer_id, amount_due, invoice_due_date, service_id, service_name, fully_paid)\n VALUES (?, ?, ?, ?, ?, ?);\");\n $stmt->bind_param(\"ssssss\", $custId, $amountDue, $invoiceDate, $serviceId, $serviceName, $paid);\n\n\n $custId = validateInput('invoiceCustId', 'post');\n $invoiceDate = validateInput('invoiceDate', 'post');\n list($serviceId, $serviceName) = explode(\":\", validateInput('service', 'post')); // 'service id : service name'\n $paid = validateInput('fullyPaid', 'post'); // 1 === 'no' : 2 === yes'\n $amountDue = '';\n\n // Get the price of the service\n $sql = \"SELECT price FROM services WHERE id = $serviceId\";\n $result = mysqli_query($GLOBALS['con'], $sql);\n if ($result) {\n $amountDue = mysqli_fetch_assoc($result); \n $amountDue = $amountDue['price'];\n }\n\n $stmt->execute();\n $stmt->close(); \n }", "public function create()\n {\n\n return view('invoices.create')\n ->with('couriers', Courier::all())\n ->with('invoiceid', false);\n // return view('invoices.create');\n }", "public function addItem($invoice_id) {\n\t\t$quantity = Request::input('quantity');\n\t\t$item_id = Request::input('item_id');\n\n\t\t$initSelect = DB::select('SELECT * \n\t\t\tFROM invoice_item\n\t\t\tWHERE item_id = :item_id\n\t\t\tAND invoice_id = :invoice_id',\n\t\t\tarray(\n\t\t\t\t':item_id' => $item_id,\n\t\t\t\t':invoice_id' => $invoice_id));\n\n\t\tif ($initSelect) {\n\t\t\t$previousQTY = $initSelect[0]->quantity;\n\t\t\t$sql = DB::update( \"UPDATE invoice_item \n\t\t\t\t\tSET quantity= :quantity\n\t\t\t\t\tWHERE item_id = :item_id\n\t\t\t\t\tAND invoice_id = :invoice_id\",\n\t\t\t\tarray(\n\t\t\t\t\t':item_id' => $item_id,\n\t\t\t\t\t':invoice_id' => $invoice_id,\n\t\t\t\t\t':quantity' => ($quantity + $previousQTY)));\n\t\t} else {\n\t\t\techo 'insert new . . . . ';\n\t\t\t$sql = DB::insert(\n\t\t\t\t\t'INSERT INTO invoice_item ( `invoice_id`, `item_id`, `quantity`) \n\t\t\t\t\tVALUES ( :invoice_id, :item_id, :quantity)',\n\t\t\t\tarray(\n\t\t\t\t\t':invoice_id' => $invoice_id,\n\t\t\t\t\t':item_id' => $item_id,\n\t\t\t\t\t':quantity' => $quantity));\n\t\t}\n\n\t\treturn redirect('invoices/details/' . $invoice_id);\n\t}", "public function create(UserInterface $user);", "public function store(StoreInvoicesRequest $request)\n {\n\n \n if (! Gate::allows('invoice_create')) {\n return prepareBlockUserMessage();\n }\n\n $products_details = getProductDetails( $request );\n\n $tax_format = $request->tax_format;\n $discount_format = $request->discount_format;\n\n $products_details['discount_format'] = $discount_format;\n $products_details['tax_format'] = $tax_format;\n \n // These are product values.\n $grand_total = ! empty( $products_details['grand_total'] ) ? $products_details['grand_total'] : 0;\n $products_amount = ! empty( $products_details['products_amount'] ) ? $products_details['products_amount'] : 0;\n $total_tax = ! empty( $products_details['total_tax'] ) ? $products_details['total_tax'] : 0;\n $total_discount = ! empty( $products_details['total_discount'] ) ? $products_details['total_discount'] : 0;\n\n // Calculation of Cart Tax.\n $tax_id = $request->tax_id;\n $cart_tax = 0; \n if ( $tax_id > 0 ) {\n $invoice = new Invoice();\n $invoice->setTaxIdAttribute( $tax_id );\n $tax = $invoice->tax()->first();\n \n $rate = 0;\n $rate_type = 'percent';\n if ( $tax ) {\n $rate = $tax->rate;\n $rate_type = $tax->rate_type;\n }\n\n if ( $rate > 0 ) {\n if ( 'before_tax' === $tax_format ) {\n if ( 'percent' === $rate_type ) {\n $cart_tax = ( $products_amount * $rate) / 100;\n } else {\n $cart_tax = $rate;\n } \n } else {\n $new_amount = $products_amount + $total_tax;\n if ( 'percent' === $rate_type ) {\n $cart_tax = ( $new_amount * $rate) / 100;\n } else {\n $cart_tax = $rate;\n }\n }\n } \n }\n\n // Let us calculate Cart Discount\n $cart_discount = 0;\n $discount_id = $request->discount_id;\n if ( $discount_id > 0 ) {\n $invoice = new Invoice();\n $invoice->setDiscountIdAttribute( $discount_id );\n $discount = $invoice->discount()->first();\n \n $rate = 0;\n $rate_type = 'percent';\n if ( $discount ) {\n $rate = $discount->discount;\n $rate_type = $discount->discount_type;\n }\n if ( $rate > 0 ) {\n if ( 'before_tax' === $discount_format ) {\n if ( 'percent' === $rate_type ) {\n $cart_discount = ( $products_amount * $rate) / 100;\n } else {\n $cart_discount = $rate;\n } \n } else {\n $new_amount = $products_amount + $total_tax;\n if ( 'percent' === $rate_type ) {\n $cart_discount = ( $new_amount * $rate) / 100;\n } else {\n $cart_discount = $rate;\n }\n }\n } \n }\n $products_details['cart_tax'] = $cart_tax;\n $products_details['cart_discount'] = $cart_discount;\n $amount_payable = $grand_total + $cart_tax - $cart_discount;\n $products_details['amount_payable'] = $amount_payable;\n\n // if there are transactions for this customer. Currency selection may disable, so we need to get it from customer profile.\n $currency_id = $request->currency_id;\n if ( empty( $currency_id ) ) {\n $currency_id = getDefaultCurrency( 'id', $request->customer_id );\n }\n // If products module disabled! lets take amount from user input!!\n if ( empty( $amount_payable ) && $request->has('amount') ) {\n $amount_payable = $request->amount;\n }\n $addtional = array(\n 'products' => json_encode( $products_details ),\n 'amount' => $amount_payable,\n 'currency_id' => $currency_id,\n );\n\n $invoice_no = $request->invoice_no;\n if ( empty( $invoice_no ) ) {\n $invoice_no = getNextNumber();\n }\n \n $addtional['invoice_no'] = $invoice_no;\n\n $addtional['slug'] = md5(microtime() . rand());\n\n $addtional['created_by_id'] = Auth::User()->id;\n\n $request->request->add( $addtional ); //add additonal / Changed values to the request object.\n\n $date_set = getCurrentDateFormat();\n\n $additional = array( \n 'invoice_date' => ! empty( $request->invoice_date ) ? Carbon::createFromFormat($date_set, $request->invoice_date)->format('Y-m-d') : NULL,\n 'invoice_due_date' => ! empty( $request->invoice_due_date ) ? Carbon::createFromFormat($date_set, $request->invoice_due_date)->format('Y-m-d') : NULL,\n );\n $additional['invoice_number_format'] = getSetting( 'invoice-number-format', 'invoice-settings', 'numberbased' );\n $additional['invoice_number_separator'] = getSetting( 'invoice-number-separator', 'invoice-settings', '-' );\n $additional['invoice_number_length'] = getSetting( 'invoice-number-length', 'invoice-settings', '0' );\n $request->request->add( $additional );\n\n if ( isDemo() ) {\n return prepareBlockUserMessage( 'info', 'crud_disabled' );\n }\n\n $invoice = Invoice::create($request->all());\n\n $products_sync = ! empty( $products_details['products_sync'] ) ? $products_details['products_sync'] : array();\n $invoice->invoice_products()->sync( $products_sync );\n\n $this->insertHistory( array('id' => $invoice->id, 'comments' => 'invoice-created', 'operation_type' => 'crud' ) );\n\n $invoice->allowed_paymodes()->sync(array_filter((array)$request->input('allowed_paymodes')));\n\n $customer = $invoice->customer()->first();\n if ( ! empty( $request->btnsavesend ) && $customer && 'Published' === $invoice->status ) {\n // Notification to user\n $logo = getSetting( 'site_logo', 'site_settings' );\n\n $templatedata = array(\n 'client_name' => $customer->name,\n 'content' => 'Invoice has been created',\n 'invoice_url' => route( 'admin.invoices.preview', [ 'slug' => $invoice->slug ] ),\n 'invoice_no' => $invoice->invoicenumberdisplay,\n 'invoice_amount' => digiCurrency($invoice->amount,$invoice->currency_id),\n 'invoice_date' => digiDate( $invoice->invoice_date ),\n 'invoice_due_date' => digiDate( $invoice->invoice_due_date ),\n 'title' => $invoice->title,\n 'address' => $invoice->address,\n 'reference' => $invoice->reference,\n 'invoice_notes' => $invoice->invoice_notes,\n 'customer_id' => $invoice->customer_id,\n 'currency_id' => $invoice->currency_id,\n 'tax_id' => $invoice->tax_id,\n 'discount_id' => $invoice->discount_id,\n 'paymentstatus' => $invoice->paymentstatus,\n 'created_by_id' => $invoice->created_by_id,\n\n\n 'site_address' => getSetting( 'site_address', 'site_settings'),\n 'site_phone' => getSetting( 'site_phone', 'site_settings'),\n 'site_email' => getSetting( 'contact_email', 'site_settings'), \n 'site_title' => getSetting( 'site_title', 'site_settings'),\n 'logo' => asset( 'uploads/settings/' . $logo ),\n 'date' => digiTodayDate(),\n 'site_url' => env('APP_URL'),\n );\n\n if ( $invoice->customer->name ) {\n $templatedata['customer_id'] = $invoice->customer->name;\n }\n \n if ( $invoice->currency->name ) {\n $templatedata['currency_id'] = $invoice->currency->name;\n }\n \n if ( $invoice->tax->name ) {\n $templatedata['tax_id'] = $invoice->tax->name;\n }\n \n if ( $invoice->discount->name ) {\n $data['discount_id'] = $invoice->discount->name;\n }\n\n $total_paid = \\Modules\\InvoicePayments\\Entities\\InvoicePayment::where('invoice_id', '=', $invoice->id)->where('payment_status', 'Success')->sum('amount');\n $amount_due = $invoice->amount - $total_paid; \n\n if( $amount_due ){\n $data['amount_due'] = $amount_due;\n } \n \n $createduser = \\App\\User::find( $invoice->created_by_id );\n if ( $createduser ) {\n $data['created_by_id'] = $createduser->name;\n }\n\n $data = [\n \"action\" => \"Created\",\n \"crud_name\" => \"User\",\n 'template' => 'invoice-created',\n 'model' => 'App\\Invoices',\n 'data' => $templatedata,\n ];\n $customer->notify(new QA_EmailNotification($data));\n\n $this->insertHistory( array('id' => $invoice->id, 'comments' => 'invoice-created', 'operation_type' => 'email' ) );\n }\n\n flashMessage( 'success', 'create');\n\n if ( ! empty( $request->btnsavemanage ) ) {\n return redirect( 'admin/invoices/' . $invoice->id );\n } else {\n return redirect()->route('admin.invoices.index');\n }\n }", "public function create_unsigned_contract()\n {\n $contract_id = factory(Contract::class, 'testing_unsigned_legal')->create([\n 'value' => $value = self::$faker->numberBetween(5000, 100000),\n 'start_date' => '',\n 'end_date' => '',\n 'participants' => $participants = rand(12, 20),\n 'payments' => $payments = rand(0, 12),\n 'client_id' => $client_id = factory(Legal::class, 'accept_meeting')->create()->client_id\n ])->id;\n for ($i = 1; $i <= $participants; $i++) {\n $participant_id = factory(Participant::class)->create()->id;\n factory(ContractParticipant::class)->create([\n 'contract_id' => $contract_id,\n 'participant_id' => $participant_id\n ]);\n }\n for ($i = 1; $i <= $payments; $i++) {\n $payment_id = factory(Payment::class)->create([\n 'value_euro' => $value_euro = round($value/$payments),\n 'pay_date' => date('Y-m-d', strtotime(\"+\".$i.\" month\")),\n 'contract_id' => $contract_id\n ])->id;\n factory(Invoice::class)->create([\n 'value_euro' => $value_euro,\n 'paid_date' => date('Y-m-d', strtotime(\"+\".$i.\" month\")),\n 'payment_id' => $payment_id,\n 'contract_id' => $contract_id,\n 'client_id' => $client_id\n ]);\n }\n }", "public function store(Request $req)\n {\n // return $req->input();\n\n $inv = new Invoice();\n $inv->business_id = \\business()->id;\n\n $contact = Contact::find($req->contact_id);\n\n $inv->contact_id = $contact->id;\n $inv->contact_name = $contact->name; //Contact::find($req->customer_id)->name;\n $inv->contact_email = $contact->email;\n $inv->contact_tax_number = $contact->tax_number;\n $inv->contact_phone = $contact->phone;\n $inv->contact_address = $contact->address;\n\n $inv->currency_code = $req->currency_code;\n $inv->currency_rate = 78;\n\n $inv->invoice_number = $req->invoice_number;\n $inv->order_number = $req->order_number;\n $inv->status = 'pending';\n $inv->invoiced_at = $req->invoice_date;\n $inv->due_at = $req->due_date;\n\n $inv->subtotal_amount = $req->subtotal_amount;\n $inv->discount_percent = $req->discount_percent;\n $inv->discount_amount = $req->discount_amount;\n $inv->total_tax_amt = $req->total_tax_amt;\n $inv->round_up = $req->round_up;\n $inv->total_amount = $req->total_amount;\n\n\n $inv->notes = $req->notes;\n $inv->footer = $req->footer;\n\n $inv->category_id = $req->category_id;\n $inv->save();\n\n // Invoice Items\n foreach($req->items as $item){\n $invItem = new InvoiceItem();\n $invItem->business_id = business()->id;\n $invItem->invoice_id = $inv->id;\n $invItem->item_id = $item['id'];\n $invItem->name = $item['name'];\n $invItem->quantity = $item['quantity'];\n $invItem->price = $item['price'];\n $invItem->taxprcnt = $item['taxprcnt'];\n $invItem->taxamt = $item['taxamt'];\n $invItem->total = $item['total'];\n $invItem->save();\n }\n // Invoice History\n $invHis = new InvoiceHistory();\n $invHis->business_id = business()->id;\n $invHis->invoice_id = $inv->id;\n $invHis->status_code = 'pending';\n $invHis->notify = 0;\n $invHis->description = 'Invoice No:'.$req->invoice_number.' is created...';\n $invHis->save();\n\n $req->session()->flash('status', 'Invoice Created..');\n\n return redirect()->route('admin.invoices.show', $inv->id);\n }", "public function print_invoice() {\n $userid = $this->input->post('userId');\n $data = $this->get_pdf_data($userid);\n $data['user_org'] = $this->payments_model->get_user_org_details($userid);\n $data['invoice'] = $this->payments_model->get_invoice_details($data['clsid'], $data['crsid'], $userid);\n $data['meta_data'] = $this->meta_data;\n return generate_invoice($data);\n }", "public static function addClient($client) {\n \n $sql = \"INSERT INTO clients VALUES(NULL\";\n $sql .= \", \" . $client->userGroupId;\n $sql .= \", \" . quote($client->uid);\n $sql .= \", \" . quote($client->lastName, true);\n $sql .= \", \" . quote($client->firstName, true);\n $sql .= \", \" . quote($client->sex);\n $sql .= \", \" . quoteDate($client->birth);\n $sql .= \", \" . quote($client->img);\n $sql .= \", \" . now(); // date_created\n $sql .= \", \" . toBoolInt($client->active);\n $sql .= \", \" . quote($client->cdata1, true);\n $sql .= \", \" . quote($client->cdata2, true);\n $sql .= \", \" . quote($client->cdata3, true);\n $sql .= \", \" . quote($client->cdata4, true);\n $sql .= \", \" . quote($client->cdata5, true);\n $sql .= \", \" . quote($client->cdata6, true);\n $sql .= \", NULL\"; \n $sql .= \", NULL\";\n $sql .= \", \" . quote($client->notes, true);\n $sql .= \", NULL\"; // date_updated\n $sql .= \")\";\n $id = insert($sql);\n \n return $id;\n }", "public function add_to_cart($userid,$articulo, $cantidad){\n\t\t$this->cila_model->set_carrito($userid, $articulo, $cantidad);\n\t\treturn 'Ok';\n\t}", "public function create()\n {\n $clients = Client::all();\n return view('importinvoice.create', compact('clients'));\n }", "public function store(Request $request)\n {\n \n $user = Auth::user();\n $business = $user->business;\n\n // $validator = Validator::make($request->all(), [\n // 'invoice_number' => 'required|numeric|integer',\n // 'invoice_date' => 'required|date',\n // 'due_date' => 'required|date|after:invoice_date',\n // 'currency' => 'in:eur,gbp,usd',\n // 'note' => 'nullable|string|max:1000',\n // ]);\n // if ($validator->fails()) {\n // return response()->json(['error' => 'Unauthorised - Validation failed', 'messages' => $validator->errors()], 422);\n // }\n\n //Create an Invoice\n $invoice = new Invoice;\n $latestInvoice = $business->outgoingInvoices()->orderBy('invoice_number', 'desc')->first();\n if (isset($latestInvoice)) {\n $invoice->invoice_number= $latestInvoice->invoice_number + 1;\n } else {\n $invoice->invoice_number=0;\n }\n $invoice->invoice_date = date('Y-m-d');\n $invoice->due_date = date('Y-m-d', strtotime(\"+1 day\"));\n $invoice->currency = 'eur';\n $invoice->status = 'draft';\n $invoice->draft_email = $request->user_email;\n $invoice->user_id = null;\n $invoice->business_id = $business->id;\n\n //Calculate total cost + adjust for stripe\n $invoice->total_cost = 0;\n foreach ($request->invoiceLines as $line) {\n $invoice->total_cost += $line['cost'] * ceil($line['sec'] / 60) * 100;\n }\n $invoice->save();\n\n //Attach each product as invoice item\n foreach ($request->invoiceLines as $line) {\n $invoiceItem = new InvoiceItems([\n 'name' => $line['name'],\n 'description' => $line['description'],\n 'cost' => $line['cost'] * 100,\n 'quantity' => ceil($line['sec'] / 60),\n 'sub_total' => $line['cost'] * ceil($line['sec'] / 60) * 100\n ]);\n if (isset($line['rate_unit'])) {\n $invoiceItem->rate_unit = $line['rate_unit'];\n }\n $invoice->invoiceItems()->save($invoiceItem);\n }\n return response()->json(200);\n }", "public function create()\n {\n if (Auth::user()->role == User::ROLE_SUPERADMIN || Auth::user()->role == User::ROLE_ADMIN) {\n if (Auth::user()->role == User::ROLE_SUPERADMIN || Auth::user()->role == User::ROLE_ADMIN) {\n $purchaseorderlists = PurchaseOrderLists::pluck('purchase_order_list_code', 'id')\n ->prepend('Choose Purchase Order', '');\n }else {\n $purchaseorderlists = PurchaseOrderLists::where('quote_sales_person_id', Auth::user()->id)\n ->pluck('purchase_order_list_code', 'id')\n ->prepend('Choose Purchase Order', '');\n }\n return view('admin.invoice.create', compact('invoice', 'purchaseorderlists'));\n }else{\n Alert::info('No Access !', 'Attention !');\n return redirect('admin/invoice-list');\n }\n }", "function manage_invoice($param1 = '', $param2 = '', $param3 = '')\n\t{\n\t\tif ($this->session->userdata('reception_login') != 1)\n\t\t\tredirect(base_url() . 'index.php?login', 'refresh');\n\t\t\n\t\tif ($param1 == 'create') {\n\t\t\n\t\t\t$data['patient_id'] = $this->input->post('patient_id');\n\t\t\t$data['invoice_number'] = $this->input->post('invoice_no');\n\t\t\t$data['doctor_id'] = $this->input->post('doctor_id');\n\t\t\t/*$data['service_id'] = $this->input->post('service_id');*/\n\t\t\t$data['diagnostictype_id'] = $this->input->post('diagnostictype_id'); //category name\n\t\t\t$data['selected_services'] = $this->input->post('selected_services'); //service name\n\t\t\t$data['refferedby'] = $this->input->post('refferedby');\n\t\t\t$data['med_card_no'] = $this->input->post('med_card_no');\n\t\t\t$data['totalamount'] = $this->input->post('totalamount');\n\t\t\t$data['discountamount'] = $this->input->post('discountamount');\n\t\t\t$data['discount'] = $this->input->post('discount');\n\t\t\t$data['recievedamount'] = $this->input->post('recievedamount');\n\t\t\t$data['dueamount'] = $this->input->post('dueamount');\n\t\t\t$data['careof'] = $this->input->post('careof');\n\t\t\t$data['createdby'] = $this->input->post('createdby');\n\t\t\t$data['creation_timestamp'] = strtotime(date('Y-m-d') . ' ' . date('H:i:s'));\n\t\t\t$data['creation_time'] = date('Y-m-d H:i', time());\n\t\t\t$data['approved']=0;\n\t\t\tif($data['discount']>=10)\n\t\t\t{\n\t\t\t\t$data['need_approval']=1; //\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{$data['need_approval']=0;} //\n\t\t\t\n\t\t\t//if ( $this->input->post('discount') > 100 )\n\t\t\tif($data['discount']>=100)\n\t\t\t{\n\t\t\t\tredirect(base_url() . 'index.php?reception/manage_invoice', 'refresh');\n\t\t\t\treturn;\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->db->insert('invoice', $data);\n\t\t\t$this->session->set_flashdata('flash_message', get_phrase('invoice_created'));\n\t\t\theader('location: application/helpers/viewreceipt.php?r='.$this->input->post('invoice_no'));\n\t\t\tredirect(base_url() . 'index.php?reception/manage_invoice', 'refresh');\n\t\t}\n\t\tif ($param1 == 'edit' && $param2 == 'do_update') {\n\t\t\t$data['patient_id'] = $this->input->post('patient_id');\n\t\t\t$data['doctor_id'] = $this->input->post('doctor_id');\n\t\t\t/*$data['service_id'] = $this->input->post('service_id');*/\n\t\t\t$data['diagnostictype_id'] = $this->input->post('diagnostictype_id'); //category name\n\t\t\t$data['selected_services'] = $this->input->post('selected_services'); //service name\n\t\t\t$data['refferedby'] = $this->input->post('refferedby');\n\t\t\t$data['med_card_no'] = $this->input->post('med_card_no');\n\t\t\t$data['totalamount'] = $this->input->post('totalamount');\n\t\t\t$data['discountamount'] = $this->input->post('discountamount');\n\t\t\t$data['discount'] = $this->input->post('discount');\n\t\t\t$data['recievedamount'] = $this->input->post('recievedamount');\n\t\t\t$data['dueamount'] = $this->input->post('dueamount');\n\t\t\t$data['careof'] = $this->input->post('careof');\n\t\t\t$data['createdby'] = $this->input->post('createdby');\n\t\t\t$data['creation_timestamp'] = strtotime(date('Y-m-d') . ' ' . date('H:i:s'));\n\t\t\t\n\t\t\t$this->db->where('invoice_id', $param3);\n\t\t\t$this->db->update('invoice', $data);\n\t\t\t$this->session->set_flashdata('flash_message', get_phrase('invoice_updated'));\n\t\t\t\n\t\t\tredirect(base_url() . 'index.php?reception/manage_invoice', 'refresh');\n\t\t} else if ($param1 == 'edit') {\n\t\t\t$page_data['edit_profile'] = $this->db->get_where('invoice', array(\n\t\t\t\t'invoice_id' => $param2\n\t\t\t))->result_array();\n\t\t}\n\t\tif ($param1 == 'delete') {\n\t\t\t$this->db->where('invoice_id', $param2);\n\t\t\t$this->db->delete('invoice');\n\t\t\t$this->session->set_flashdata('flash_message', get_phrase('invoice_deleted'));\n\t\t\tredirect(base_url() . 'index.php?reception/manage_invoice', 'refresh');\n\t\t}\n\t\t$page_data['page_name'] = 'manage_invoice';\n\t\t$page_data['page_title'] = get_phrase('manage_invoice');\n\t\t$this->db->order_by('creation_timestamp', 'desc');\n\t\t$page_data['invoices'] = $this->db->get('invoice')->result_array();\n\t\t\n\t\t$this->load->view('index', $page_data);\n\t}", "public function create(Request $request): View\n {\n $clientId = $request->input('client', null);\n $projectId = $request->input('project', null);\n\n $project = null;\n $client = null;\n $projects = $request->user()->projectsForMenu();\n\n if ($projectId) {\n $project = $request->user()->project($projectId)->with('client')->firstOrFail();\n $client = $project->client;\n $projects = $request->user()->projectsForMenu($client->getKey());\n }\n\n if ($clientId) {\n $project = null;\n $client = $request->user()->client($clientId)->firstOrFail();\n $projects = $request->user()->projectsForMenu($client->getKey());\n }\n\n $invoice = new Invoice();\n $invoice->project_id = $projectId;\n\n $viewVars = [\n 'pageTitle' => 'New Invoice',\n 'projects' => $projects,\n 'client' => $client,\n 'model' => $invoice,\n 'submission_route' => 'invoice.store',\n 'submission_method' => 'POST',\n ];\n\n return view('invoice.form', $viewVars);\n }", "public function new($id_user)\n {\n $car = new Car([\n 'id_user' => $id_user\n ]);\n $car->save();\n DB::table('charges')->where('id_user', $id_user)->delete();\n return redirect()->route('catalogs.index');\n }", "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 createTicket($invoice_id, $method)\n\t{\n\t\t$model \t\t = new Tickets;\n\t\t$customerModel = new Customers;\n\t\t$custInfo = $customerModel->find('pk_customer_id = '.Yii::app()->user->pk_customer_id);\n\t\t\n \t\t$url = Yii::app()->getBaseUrl(true).'/index.php/ticket/create/';\n\t\t$department = 3; // customer support\n\t\t$priority = 4; // urgent\n\t\t$subject = \"Pay By Phone request using \".$method;\n\t\t$message = Yii::app()->user->fullname .\" has created you a Pay By Phone request using \".$method . ' for invoice No: '.$invoice_id;\n \t\t \n # Setting remaining Important Fields\n\t\t$attach_id = 0; \n\t\t$model->fk_customer_id = Yii::app()->user->pk_customer_id;\n\t\t$model->mname\t\t = Yii::app()->user->id; \n\t\t$model->email\t\t = Yii::app()->user->customer_email;\n\t\t$model->ipadd\t\t = $_SERVER['REMOTE_ADDR'];\n \t\t$model->date\t\t = time();\n\t\t$model->did = 3;\n\t\t$model->dname = \"Customer support\";\t\n\t\t$model->subject = $subject;\t\t\n\t\t$model->priority = $priority;\n\t\t$model->message = $message;\n\t\tif( $model->save() )\n\t\t{\n\t\t\t\t# ================================================================\n\t\t\t\t# Create customer in Members Table of the Trellis database as well\n\t\t\t\t# ================================================================\n\t\t\t\t$model->saveInTrellis();\n\t\t\t\t$model->updateMemId(); // Update Member ID in Tickets\n \t\t\t\t# 1 Send Email to Support\n\t\t\t\t$model->sendEmail(\"[email protected]\",$model->subject, $model->message, 'Support');\n\t\t\t\t$body = \"A Pay By Phone request using \".$method.\" for invoice No: \".$invoice_id.\" has been placed successfully \n\t\t\t\tby \".Yii::app()->user->fullname.\". We'll call \".$custInfo->phone.\" shortly to collect payment information. \";\n\t\t\t\t\t\t \n\t\t\t\t# 2 To creator\n\t\t\t\t$model->sendEmail( Yii::app()->user->customer_email, $model->subject, $body, \"Customer\");\n\t\t\t\t\n\t\t\t\t# 3 Email to Parent Customer\n \t\t\t\t\n\t\t\t\tif( Yii::app()->user->parent_id > 0)\n\t\t\t\t{\n\t\t\t\t\t$ParentInfo = $customerModel->find(\"pk_customer_id = \".Yii::app()->user->parent_id); \n \t\t\t\t\t$model->sendEmail( $ParentInfo->email, $model->subject, $body, \"Customer\");\n\t\t\t\t}\n\t \t\t \n \t\t\t}\t\t \n\t}", "public function __construct($userid, $itemid) {\r\n $this->userid = $userid;\r\n $this->itemid = $itemid;\r\n $this->extra = array();\r\n }", "function addnewPayment($cid, $Amount, $AdditionalAmount, $days, $userid) {\n\n $Date = date(\"Y-m-d H:i\");\n\n $sql = \"INSERT INTO invoice_payments (Amount,AdditionalAmount,DateTime,Credit_Invoice_idCredit_Invoice,User_idUser,PayFor,Status) \"\n\n . \"VALUES ($Amount,$AdditionalAmount,'$Date',$cid,$userid,$days,'1')\";\n\n\n\n if (mysqli_query($this->con, $sql)) {\n\n// return 'error:' . mysqli_error($this->con);\n\n return true;\n\n } else {\n\n// return 'error:' . mysqli_error($this->con);\n\n return false;\n\n }\n\n }", "public function create(array $data, bool $create_customer = false, bool $create_products = false)\n {\n $response = $this->client->request('post', \"customer_invoices\", [\n 'json' => [\n 'create_customer' => $create_customer,\n 'create_products' => $create_products,\n 'invoice' => $data\n ]\n ]);\n\n return json_decode($response->getBody()->getContents(), true);\n }", "public function generateAndSetInvoiceNumber();", "public function invoices() {\t\t\r\n\t\t\r\n $user = $this->session->userdata('user');\r\n if ($user['UserType'] == 'TYPE_CLI' && empty($user['AccountantAccess'])) {\r\n //setRedirect(site_url());\r\n } else {\r\n if (isset($_GET['clientID'])) {\r\n checkUserAccess(array('TYPE_ACC', 'TYPE_CLI'));\r\n } else {\r\n checkUserAccess(array('TYPE_CLI'));\r\n }\r\n }\r\n\t\t\r\n\t\t$page = ($this->uri->segment(2)) ? $this->uri->segment(2) : 0;\r\n $user = $this->session->userdata('user');\t\r\n\t\t$VATYear = $this->session->userdata('VATYear');\r\n\t\t$quaters = vatQuaters($user['Params']['VATQuaters']);\r\n\t\t\t\t\r\n /* \tGet the customer list of the company. */\r\n $data['users'] = $this->clients->getUserList();\r\n\r\n $items = $this->clients->getInvoiceList(INVOICE_PAGINATION_LIMIT, $page);\r\n $data['Invoices'] = $items;\r\n //pr($data['Invoices']);\r\n $PaidVatQuarters = $this->clients->getPaidVatQuarters();\r\n\t\t$VATitems = $this->clients->getAllInvoices();\r\n $vat_listing = $this->clients->getVatType();\r\n\t\t\r\n $data['EXPitems'] = false;\r\n if($vat_listing->Type != 'flat') {\r\n $this->load->model('clients/expense');\r\n $EXPitems = $this->expense->getAllExpenses();\r\n $data['EXPitems'] = $EXPitems;\r\n }\r\n //echo '<pre>';print_r($PaidVatQuarters);echo '</pre>';die();\r\n\t\t//echo '<pre>';print_r($VATitems);echo '</pre>';//die();\r\n $data['VATitems'] = $VATitems;\r\n $data['PaidVatQuarters'] = $PaidVatQuarters;\r\n\r\n $total = $this->clients->totalInvoices();\t\t\r\n $data['pagination'] = $this->getPagination('invoices', INVOICE_PAGINATION_LIMIT, $total);\r\n if ($data['users'] == FALSE) {\r\n $data['users'] = array('0' => 'No users');\r\n }\r\n\r\n $data['vat_listing'] = $vat_listing;\r\n $data['page'] = 'invoices';\r\n $data['title'] = 'Cashman | Invoices';\r\n $this->load->view('client/invoices/default', $data);\r\n }", "public function subscribe($subscriber, $startDateTime = null, $createInvoice = true, $user = null) {\n\t\tif ($this->isNewRecord) throw new \\Exception('Subscription package is not yet saved. ');\n\t\t\t\n\t\tif ($subscriber instanceof User) {\n\t\t\t$user = $subscriber;\n\t\t\tif (!$user->id) throw new \\Exception('User is not an valid user. ');\n\t\n\t\t\t$billTo = $user;\n\t\t} else if ($subscriber instanceof Organization || $subscriber instanceof OldOrganizationClass) {\n\t\t\t$organization = $subscriber;\n\t\t\tif (!$organization->id) throw new \\Exception('Organization is not an valid organization. ');\n\t\t\t$billTo = $organization;\n\t\t} else {\n\t\t\tthrow new \\Exception('Subscriber must be instance of either User or Organization. ');\n\t\t}\n\t\t\n\t\t$items = SubscriptionPackageItem::findAll(['package_id' => $this->id]);\n\t\t\n\t\t$transaction = Yii::$app->db->beginTransaction();\n\t\t\n\t\ttry {\n\t\t\tif ($createInvoice) {\n\t\t\t\tif (!isset($user->profile->contact)) throw new \\Exception('Cannot issue invoice to user (user ID: '.$user->id.') without default contact info. ');\n\n\t\t\t\t$invoice = Invoice::createFromBillableItem($this, $billTo);\n\t\t\t}\n\t\t\t\n\t\t\t$bundle = new SubscriptionBundle;\n\t\t\t$bundle->attributes = $this->attributes;\n\t\t\t$bundle->invoice_id = isset($invoice) ? $invoice->id : null;\n\t\t\t$bundle->package_id = $this->id;\n\t\t\t$bundle->organization_id = isset($organization) ? $organization->id : null;\n\t\t\tif (!$bundle->save()) throw new \\Exception('Failed to create bundle. '.print_r($bundle->errors, 1));\n\t\t\t\n\t\t\tforeach ($items as $item) {\n\t\t\t\t\n\t\t\t\t$subscription = new Subscription;\n\t\t\t\t$subscription->bundle_id = $bundle->id;\n\t\t\t\t\n\t\t\t\t$subscription->attributes = [\n\t\t\t\t\t'subscription_identity' => $item->subscription_identity,\n\t\t\t\t\t'price' => $this->price,\n\t\t\t\t\t'purchased_unit' => $item->unit,\n\t\t\t\t\t'used_unit' => 0,\n\t\t\t\t\t'content_valid_period' => $item->content_valid_period,\n\t\t\t\t\t'content_valid_period_type' => $item->content_valid_period_type,\n\t\t\t\t\t'invoice_id' => isset($invoice) ? $invoice->id : null,\n\t\t\t\t\t'priority' => $item->priority,\n\t\t\t\t];\n\t\t\t\tif (isset($user)) $subscription->owned_by = $user->id;\n\t\t\t\t\n\t\t\t\t$subscription->package_id = $this->id;\n\t\t\t\t$subscription->owned_by = isset($user) ? $user->id : null;\n\t\t\t\t$subscription->setExpireAt($item->valid_period, $item->valid_period_type, true, $startDateTime);\n\t\t\t\t\n\t\t\t\tif (!$subscription->save()) throw new \\Exception('Failed to create subscription. '.print_r($subscription->errors, 1));\n\t\t\t}\n\t\t\t\n\t\t\t$transaction->commit();\n\t\t\t\n\t\t\treturn $bundle;\n\t\t} catch (\\Exception $ex) {\n\t\t\t$transaction->rollback();\n\t\t\tthrow $ex;\n\t\t}\n\t}", "public function create($user)\n\t{\n\t\tglobal $conf, $langs;\n\t\t$error = 0;\n\n\t\t// Clean parameters\n\t\tif (isset($this->ref_article)) {\n\t\t\t$this->ref_article = trim($this->ref_article);\n\t\t}\n\t\tif (isset($this->libelle_article)) {\n\t\t\t$this->libelle_article = trim($this->libelle_article);\n\t\t}\n\t\tif (isset($this->qty)) {\n\t\t\t$this->qty = trim($this->qty);\n\t\t}\n\t\tif (isset($this->pu_ttc)) {\n\t\t\t$this->pu_ttc = trim($this->pu_ttc);\n\t\t}\n\t\tif (isset($this->montant_ligne)) {\n\t\t\t$this->montant_ligne = trim($this->montant_ligne);\n\t\t}\n\t\tif (isset($this->tva)) {\n\t\t\t$this->tva = trim($this->tva);\n\t\t}\n\t\tif (isset($this->N_fact)) {\n\t\t\t$this->N_fact = trim($this->N_fact);\n\t\t}\n\n\t\t// Check parameters\n\t\t// Put here code to add control on parameters values\n\t\t// Insert request\n\t\t$sql = \"INSERT INTO \" . MAIN_DB_PREFIX . \"a3sys_facturedets(\";\n\t\t$sql.= \" ref_article,\";\n\t\t$sql.= \" libelle_article,\";\n\t\t$sql.= \" qty,\";\n\t\t$sql.= \" pu_ttc,\";\n\t\t$sql.= \" montant_ligne,\";\n\t\t$sql.= \" tva,\";\n\t\t$sql.= \" N_fact\";\n\t\t$sql.= \") VALUES (\";\n\t\t$sql.= \" \" . $this->db->escape($this->ref_article) . \",\";\n\t\t$sql.= \" '\" . $this->db->escape($this->libelle_article) . \"',\";\n\t\t$sql.= \" \" . $this->db->escape($this->qty) . \",\";\n\t\t$sql.= \" \" . $this->db->escape($this->pu_ttc) . \",\";\n\t\t$sql.= \" \" . $this->db->escape($this->montant_ligne) . \",\";\n\t\t$sql.= \" \" . $this->db->escape($this->tva) . \",\";\n\t\t$sql.= \" \" . $this->db->escape($this->N_fact) . \"\";\n\t\t$sql.= \")\";\n\t\t$this->db->begin();\n\n\t\tdol_syslog(get_class($this) . \"::create \", LOG_DEBUG);\n\t\t$resql = $this->db->query($sql);\n\t\tif (! $resql) {\n\t\t\t$error ++;\n\t\t\t$this->errors[] = \"Error \" . $this->db->lasterror();\n\t\t}\n\n\t\t// Commit or rollback\n\t\tif ($error) {\n\t\t\tforeach ($this->errors as $errmsg) {\n\t\t\t\tdol_syslog(__METHOD__ . \" \" . $errmsg, LOG_ERR);\n\t\t\t\t$this->error.=($this->error ? ', ' . $errmsg : $errmsg);\n\t\t\t}\n\t\t\t$this->db->rollback();\n\n\t\t\treturn -1 * $error;\n\t\t} else {\n\t\t\t$this->db->commit();\n\n\t\t\treturn $this->id;\n\t\t}\n\t}", "public function create()\n\t{\n\t\treturn view('invoices.create');\n\t}", "public function create()\n {\n $page_title = 'Invoice';\n $page_description = 'Make Invoice';\n return view('invoice.create', compact('page_title', 'page_description'));\n }", "public function add($invoiceId = 0) {\n require_once(MODEL . \"master/company.php\");\n require_once(MODEL . \"master/project.php\");\n require_once(MODEL . \"master/creditor.php\");\n require_once(MODEL . \"common/trx_type.php\");\n require_once(MODEL . \"common/ap_invoice_type.php\");\n require_once(MODEL . \"master/activity.php\");\n require_once(MODEL . \"master/department.php\");\n require_once(MODEL . \"master/units.php\");\n require_once(MODEL . \"tax/taxtype.php\");\n $loader = null;\n $invoice = new Invoice();\n if ($invoiceId > 0 ) {\n $invoice = $invoice->LoadById($invoiceId);\n if ($invoice == null) {\n $this->persistence->SaveState(\"error\", \"Maaf Data Invoice dimaksud tidak ada pada database. Mungkin sudah dihapus!\");\n redirect_url(\"ap.invoice\");\n }\n if ($invoice->PaidAmount > 0) {\n $this->persistence->SaveState(\"error\", sprintf(\"Maaf Invoice No. %s sudah terbayap. Tidak boleh diubah lagi..\", $invoice->InvoiceNo));\n redirect_url(\"ap.invoice\");\n }\n if ($invoice->InvoiceStatus == 1) {\n $this->persistence->SaveState(\"error\", sprintf(\"Maaf Invoice No. %s sudah di-Approve- Tidak boleh diubah lagi..\", $invoice->InvoiceNo));\n redirect_url(\"ap.invoice\");\n }\n if ($invoice->InvoiceStatus == 2) {\n $this->persistence->SaveState(\"error\", sprintf(\"Maaf Invoice No. %s sudah di-Posting- Tidak boleh diubah lagi..\", $invoice->InvoiceNo));\n redirect_url(\"ap.invoice\");\n }\n if ($invoice->InvoiceStatus == 3) {\n $this->persistence->SaveState(\"error\", sprintf(\"Maaf Invoice No. %s sudah di-Void- Tidak boleh diubah lagi..\", $invoice->InvoiceNo));\n redirect_url(\"ap.invoice\");\n }\n if ($invoice->CreatebyId <> \\AclManager::GetInstance()->GetCurrentUser()->Id && $this->userLevel == 1){\n $this->persistence->SaveState(\"error\", sprintf(\"Maaf Anda tidak boleh mengubah data ini!\",$invoice->InvoiceNo));\n redirect_url(\"ap.invoice\");\n }\n }\n // load details\n $invoice->LoadDetails();\n //load data cabang\n $loader = new \\Project();\n if ($this->userLevel < 5) {\n $project = $loader->LoadAllowedProject($this->userProjectIds);\n }else{\n $project = $loader->LoadByEntityId($this->userCompanyId);\n }\n //load creditor\n $loader = new \\Creditor();\n $creditors = $loader->LoadByEntity($this->userCompanyId);\n //load dept\n $loader = new \\Department();\n $depts = $loader->LoadByEntityId($this->userCompanyId);\n //load units\n $loader = new \\Units();\n $units = $loader->LoadAll($this->userCompanyId);\n //load activity\n $loader = new \\Activity();\n $activitys = $loader->LoadByEntityId($this->userCompanyId);\n //load trxtype\n $loader = new \\TrxType();\n $trxtypes = $loader->LoadByModuleId($this->userCompanyId,2);\n //load trxtype\n $loader = new \\ApInvoiceType();\n $invtype = $loader->LoadByEntity($this->userCompanyId);\n //load taxtype\n $loader = new \\TaxType();\n $taxtype = $loader->LoadByMode($this->userCompanyId,1);\n $this->Set(\"taxtypes\", $taxtype);\n //kirim ke view\n $this->Set(\"userLevel\", $this->userLevel);\n $this->Set(\"userCompId\", $this->userCompanyId);\n $this->Set(\"projects\", $project);\n $this->Set(\"trxtypes\", $trxtypes);\n $this->Set(\"invtypes\", $invtype);\n $this->Set(\"creditors\", $creditors);\n $this->Set(\"depts\", $depts);\n $this->Set(\"units\", $units);\n $this->Set(\"activitys\", $activitys);\n $this->Set(\"invoice\", $invoice);\n $acl = \\AclManager::GetInstance();\n $this->Set(\"acl\", $acl);\n $this->Set(\"itemsCount\", $this->InvoiceItemsCount($invoiceId));\n }", "public function createOrder($user_id, $total, $shipping_price)\n {\n $this->user_id = $user_id;\n $this->total = $total;\n $this->shipping_price = $shipping_price;\n $this->save();\n }", "public function create_new_invoice()\n\t{\n\t\tif(isset($this->session->isactive)){\n\n\t\t\t$grnumber = $this->input->post('grnumber');\n\t\t\t$class = $this->input->post('class');\n\t\t\t$division = $this->input->post('division');\n\t\t\t// Storing termwise total amount got from input values\n\t\t\t$term_one_total = 0;\n\t\t\t$term_two_total = 0;\n\n\t\t\t// Storing term one fees values into fees table as well for invoice table\n\t\t\t// (particulars) and updating term one total value\n\t\t\tif($this->input->post('june')){\n\t\t\t\t$term_one_values['june'] = trim($this->input->post('june'),' ');\n\t\t\t\t$particulars['june'] = trim($this->input->post('june'),' ');\n\t\t\t\t$term_one_total = $term_one_total + trim($this->input->post('june'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('july')){\n\t\t\t\t$term_one_values['july'] = trim($this->input->post('july'),' ');\n\t\t\t\t$particulars['july'] = trim($this->input->post('july'),' ');\n\t\t\t\t$term_one_total = $term_one_total + trim($this->input->post('july'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('august')){\n\t\t\t\t$term_one_values['august'] = trim($this->input->post('august'),' ');\n\t\t\t\t$particulars['august'] = trim($this->input->post('august'),' ');\n\t\t\t\t$term_one_total = $term_one_total + trim($this->input->post('august'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('september')){\n\t\t\t\t$term_one_values['september'] = trim($this->input->post('september'),' ');\n\t\t\t\t$particulars['september'] = trim($this->input->post('september'),' ');\n\t\t\t\t$term_one_total = $term_one_total + trim($this->input->post('september'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('october')){\n\t\t\t\t$term_one_values['october'] = trim($this->input->post('october'),' ');\n\t\t\t\t$particulars['october'] = trim($this->input->post('october'),' ');\n\t\t\t\t$term_one_total = $term_one_total + trim($this->input->post('october'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('november')){\n\t\t\t\t$term_one_values['november'] = trim($this->input->post('november'),' ');\n\t\t\t\t$particulars['november'] = trim($this->input->post('november'),' ');\n\t\t\t\t$term_one_total = $term_one_total + trim($this->input->post('november'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('term_one')){\n\t\t\t\t$term_one_values['term'] = trim($this->input->post('term_one'),' ');\n\t\t\t\t$particulars['term_one'] = trim($this->input->post('term_one'),' ');\n\t\t\t\t$term_one_total = $term_one_total + trim($this->input->post('term_one'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('activity_one')){\n\t\t\t\t$term_one_values['activity'] = trim($this->input->post('activity_one'),' ');\n\t\t\t\t$particulars['activity_one'] = trim($this->input->post('activity_one'),' ');\n\t\t\t\t$term_one_total = $term_one_total + trim($this->input->post('activity_one'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('computer_one')){\n\t\t\t\t$term_one_values['computer'] = trim($this->input->post('computer_one'),' ');\n\t\t\t\t$particulars['computer_one'] = trim($this->input->post('computer_one'),' ');\n\t\t\t\t$term_one_total = $term_one_total + trim($this->input->post('computer_one'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('elearning_one')){\n\t\t\t\t$term_one_values['elearning'] = trim($this->input->post('elearning_one'),' ');\n\t\t\t\t$particulars['elearning_one'] = trim($this->input->post('elearning_one'),' ');\n\t\t\t\t$term_one_total = $term_one_total + trim($this->input->post('elearning_one'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('sport_one')){\n\t\t\t\t$term_one_values['sport'] = trim($this->input->post('sport_one'),' ');\n\t\t\t\t$particulars['sport_one'] = trim($this->input->post('sport_one'),' ');\n\t\t\t\t$term_one_total = $term_one_total + trim($this->input->post('sport_one'),' ');\n\t\t\t}\n\t\t\t// updated term one total = current input total + old total from db\n\t\t\t$term_one_values['total'] = $term_one_total + trim($this->input->post('total_one'),' ');\n\n\t\t\t// Storing term two fees values into fees table as well for invoice table\n\t\t\t// (particulars) and updating term two total value\n\t\t\tif($this->input->post('december')){\n\t\t\t\t$term_two_values['december'] = trim($this->input->post('december'),' ');\n\t\t\t\t$particulars['december'] = trim($this->input->post('december'),' ');\n\t\t\t\t$term_two_total = $term_two_total + trim($this->input->post('december'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('january')){\n\t\t\t\t$term_two_values['january'] = trim($this->input->post('january'),' ');\n\t\t\t\t$particulars['january'] = trim($this->input->post('january'),' ');\n\t\t\t\t$term_two_total = $term_two_total + trim($this->input->post('january'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('february')){\n\t\t\t\t$term_two_values['february'] = trim($this->input->post('february'),' ');\n\t\t\t\t$particulars['february'] = trim($this->input->post('february'),' ');\n\t\t\t\t$term_two_total = $term_two_total + trim($this->input->post('february'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('march')){\n\t\t\t\t$term_two_values['march'] = trim($this->input->post('march'),' ');\n\t\t\t\t$particulars['march'] = trim($this->input->post('march'),' ');\n\t\t\t\t$term_two_total = $term_two_total + trim($this->input->post('march'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('april')){\n\t\t\t\t$term_two_values['april'] = trim($this->input->post('april'),' ');\n\t\t\t\t$particulars['april'] = trim($this->input->post('april'),' ');\n\t\t\t\t$term_two_total = $term_two_total + trim($this->input->post('april'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('may')){\n\t\t\t\t$term_two_values['may'] = trim($this->input->post('may'),' ');\n\t\t\t\t$particulars['may'] = trim($this->input->post('may'),' ');\n\t\t\t\t$term_two_total = $term_two_total + trim($this->input->post('may'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('term_two')){\n\t\t\t\t$term_two_values['term'] = trim($this->input->post('term_two'),' ');\n\t\t\t\t$particulars['term_two'] = trim($this->input->post('term_two'),' ');\n\t\t\t\t$term_two_total = $term_two_total + trim($this->input->post('term_two'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('activity_two')){\n\t\t\t\t$term_two_values['activity'] = trim($this->input->post('activity_two'),' ');\n\t\t\t\t$particulars['activity_two'] = trim($this->input->post('activity_two'),' ');\n\t\t\t\t$term_two_total = $term_two_total + trim($this->input->post('activity_two'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('computer_two')){\n\t\t\t\t$term_two_values['computer'] = trim($this->input->post('computer_two'),' ');\n\t\t\t\t$particulars['computer_two'] = trim($this->input->post('computer_two'),' ');\n\t\t\t\t$term_two_total = $term_two_total + trim($this->input->post('computer_two'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('elearning_two')){\n\t\t\t\t$term_two_values['elearning'] = trim($this->input->post('elearning_two'),' ');\n\t\t\t\t$particulars['elearning_two'] = trim($this->input->post('elearning_two'),' ');\n\t\t\t\t$term_two_total = $term_two_total + trim($this->input->post('elearning_two'),' ');\n\t\t\t}\n\t\t\tif($this->input->post('sport_two')){\n\t\t\t\t$term_two_values['sport'] = trim($this->input->post('sport_two'),' ');\n\t\t\t\t$particulars['sport_two'] = trim($this->input->post('sport_two'),' ');\n\t\t\t\t$term_two_total = $term_two_total + trim($this->input->post('sport_two'),' ');\n\t\t\t}\n\t\t\t// updated term two total = current input total + old total from db\n\t\t\t$term_two_values['total'] = $term_two_total + trim($this->input->post('total_two'),' ');\n\n\t\t\t// Checking if any fees amount is entered or not\n\t\t\tif($term_one_total || $term_two_total){\n\t\t\t\t// Updating student fees data\n\t\t\t\t$this->load->model('fees_model');\n\t\t\t\t$this->fees_model->update_fees_term_one($grnumber,$class,$division,$term_one_values);\n\t\t\t\t$this->fees_model->update_fees_term_two($grnumber,$class,$division,$term_two_values);\n\n\t\t\t\t// creating invoice\n\t\t\t\t$invoice_values = array(\n\t\t\t\t\t'id' => '0',\n\t\t\t\t\t'gr_number' => $grnumber,\n\t\t\t\t\t'class' => $class,\n\t\t\t\t\t'division' => $division,\n\t\t\t\t\t'date' => date('Y-m-d'),\n\t\t\t\t\t'particulars' => implode(' ',array_keys($particulars)),\n\t\t\t\t\t'amount' => implode(' ',$particulars),\n\t\t\t\t\t'grand_total' => $term_one_total + $term_two_total,\n\t\t\t\t\t'fees_help' => trim($this->input->post('fees_help'),' '),\n\t\t\t\t\t'comment' => trim($this->input->post('comment'),' ')\n\t\t\t\t);\n\n\t\t\t\t$this->load->model('invoice_model');\n\t\t\t\tif($this->invoice_model->add_invoice($invoice_values)){\n\t\t\t\t\t// Creating transaction\n\t\t\t\t\t$transaction_values = array(\n\t\t\t\t\t\t'id' => '0',\n\t\t\t\t\t\t'type' => 'Income',\n\t\t\t\t\t\t'is_of' => 'Fees Payment',\n\t\t\t\t\t\t'date' => date('Y-m-d'),\n\t\t\t\t\t\t'amount' => $term_one_total + $term_two_total,\n\t\t\t\t\t\t'payment_mode' => 'Cash'\n\t\t\t\t\t);\n\n\t\t\t\t\t$this->load->model('transaction_model');\n\t\t\t\t\t$this->transaction_model->add_transaction($transaction_values);\n\n\t\t\t\t\t$this->input->set_cookie('message_code','1',1);\n\t\t\t\t\t$id = $this->invoice_model->get_invoice_id();\n\t\t\t\t\tredirect('invoice/print_invoice/'.$id[0]['id']);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->input->set_cookie('message_code','4',1);\n\t\t\t\t\tredirect('invoice/show_fees/'.$grnumber.'/'.$class.'/'.$division);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->input->set_cookie('message_code','3',1);\n\t\t\t\tredirect('invoice/show_fees/'.$grnumber.'/'.$class.'/'.$division);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tredirect('login');\n\t\t}\n\t}", "public function _create($refid, $invoice, $charges=array(), $payments=array())\n {\n\n return false;\n\n\n if($res = $this->is_billtrac_exists($invoice->InvoiceNumber_EMD))\n {\n //already created\n $this->error(\"billtrac ticket # $res already exists for EMD invoice # \" . $invoice->InvoiceNumber_EMD);\n\n //update so\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n DB::table($this->keytable)->where('emd_invoice_number',$invoice->InvoiceNumber_EMD)->update(array( 'todo'=>'done','ext_key'=>$res));\n }\n\n return false;\n }\n\n /**\n * inserting\n * - summary\n * - carrier\n * - emdId\n * - type\n * - claim\n * - location\n * - mail date\n * - bill amount\n * - ptrac id\n */\n\n\n try{\n\n\n $time = $changetime = time() * 1000000;\n\n DB::connection('billtrac')->getPdo()->beginTransaction();\n\n //create base ticket\n $invoice->Invoice_Comment = trim($invoice->Invoice_Comment);\n\n if(empty($invoice->Invoice_Comment))\n {\n $type = 'new';\n }\n else\n {\n $type = addslashes($invoice->Invoice_Comment);\n }\n\n $dos_first=false;\n $dos = array();\n\n if($cpts = DB::connection('emds')->table('VIEW_API_InvoiceCPT')->where('Invoice_ID', $invoice->Invoice_ID)->get())\n {\n foreach($cpts as $line)\n {\n if(!$dos_first)\n {\n $dos_first = $line->sdos;\n }\n $dos[$line->sdos] = 1;\n }\n $dos = 'DOS: ' . implode(', ', array_keys($dos));\n\n }\n\n $data = array(\n 'type'=>$type,\n 'time'=>$time,\n 'changetime'=>$changetime,\n 'priority'=>'normal',\n 'status'=>'new',\n 'summary'=>addslashes($invoice->PatientName),\n 'reporter'=>'emdimport',\n 'description'=>$dos,\n 'owner'=> $this->assign_ownerbyalpha(strtolower(substr($invoice->PatientName,0,1)))\n );\n\n if($owner = $this->assign_ownerbyinsurance(strtolower($invoice->InsuranceCompName)))\n {\n $data['owner'] = $owner;\n }\n\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n DB::connection('billtrac')->table('ticket')->insert( $data );\n }\n else\n {\n $this->info(\"dry insert: \\n\" . print_r($data, true));\n }\n\n $id = DB::connection('billtrac')->getPdo()->lastInsertId();\n\n $this->info(\"created ticket number $id\");\n\n $emdimage = false;\n\n $respmt = DB::connection('emds')->select(\"select * from VIEW_API_PaymentIndex where Invoice_ID = '\" . $invoice->Invoice_ID . \"'AND (CheckImage <> '0000000000' or EOBImage <> '0000000000')\");\n\n foreach($respmt as $r)\n {\n $emdimage = true;\n }\n\n $importMap = array(\n 'billdate'=>$invoice->InvoiceCreatedAt,\n 'emdstatus'=>$invoice->InvoiceStatus_Code,\n 'maildate'=>$invoice->InvoiceCreatedAt,\n 'dosdate'=>$dos_first,\n 'billamount'=>number_format($invoice->InvoiceTotal,2),\n 'duedate'=>date_create_from_format('m-d-Y', $invoice->InvoiceCreatedAt)->modify('+17 day')->format('m-d-Y'),\n 'paidamount'=>number_format($invoice->PaymentTotal,2),\n 'location'=>$this->translateLocation($invoice->Organization_Name),\n 'carrier'=>addslashes($invoice->InsuranceCompName),\n 'claimnumber'=>$invoice->Case_ClaimNumber,\n 'step'=>'new',\n 'emdinvoicenumber'=>$invoice->InvoiceNumber_EMD,\n 'ptracnumber'=>'EMD:'.$invoice->InvoiceNumber_EMD\n );\n\n if($emdimage)\n {\n $importMap['emdimage'] = 1;\n }\n\n foreach($importMap as $key=>$value)\n {\n $data = array(\n 'ticket'=>$id,\n 'name'=>$key,\n 'value'=>$value\n );\n\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n DB::connection('billtrac')->table('ticket_custom')->insert( $data );\n }\n else\n {\n $this->info(\"dry insert: \\n\" . print_r($data, true));\n }\n }\n\n DB::connection('billtrac')->getPdo()->commit();\n\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n return DB::table($this->keytable)->where('id',$refid)->update(array( 'todo'=>'done', 'ext_key'=>$id));\n }\n else\n {\n return false;\n }\n\n }catch (Exception $e)\n {\n DB::connection('billtrac')->getPdo()->rollBack();\n throw new Exception($e->getMessage());\n }\n }" ]
[ "0.62431175", "0.6120787", "0.6041523", "0.593639", "0.5877455", "0.5750187", "0.5670991", "0.5654277", "0.55962294", "0.5554885", "0.5551387", "0.5549434", "0.55465764", "0.5504757", "0.5488674", "0.54754746", "0.54611015", "0.5378579", "0.5369627", "0.53639406", "0.5345843", "0.5328408", "0.5325066", "0.5310803", "0.5305721", "0.5305442", "0.5303375", "0.5302763", "0.5281893", "0.5273108", "0.5266751", "0.52598447", "0.525682", "0.5250967", "0.524868", "0.52315664", "0.5199621", "0.519952", "0.5190825", "0.5187577", "0.5183757", "0.51835364", "0.5182465", "0.5181267", "0.51808274", "0.5180182", "0.5177932", "0.5161366", "0.51355624", "0.5129676", "0.5112711", "0.5106724", "0.51045567", "0.50996566", "0.50929", "0.5090831", "0.5077204", "0.50734484", "0.5073319", "0.5067418", "0.5045542", "0.5040459", "0.50286394", "0.50139344", "0.50084704", "0.5005757", "0.50017214", "0.4992869", "0.49918824", "0.49892795", "0.49776566", "0.49751642", "0.4971056", "0.4969127", "0.4964838", "0.49646342", "0.4961716", "0.49483377", "0.4947131", "0.4943406", "0.49389172", "0.49374866", "0.49300972", "0.49266863", "0.49228543", "0.49177375", "0.49077266", "0.49052012", "0.48947763", "0.48908332", "0.4890466", "0.48871514", "0.48866534", "0.48815462", "0.48809245", "0.4878841", "0.4873019", "0.48676792", "0.4866033", "0.48651144" ]
0.627072
0
This command is used to update an invoice in the system. Parameters: invoiceid The ID of the invoice to update Optional Parameters: itemdescription Array of existing line item descriptions to update. Line ID from database needed itemamount and itemtaxed should be passed when updating the description itemamount Array of existing line item amounts to update itemtaxed Array of existing line items taxed or not newitemdescription Array of new line item descriptipons to add newitemamount Array of new line item amounts newitemtaxed Array of new line items taxed or not date date of invoice format yyyymmdd duedate duedate of invoice format yyyymmdd datepaid date invoice was paid format yyyymmdd status status of invoice. Unpaid, Paid, Cancelled, Collection, Refunded paymentmethod payment method of invoice eg paypal, banktransfer notes invoice notes See:
public function whmcs_update_invoice($params = array()) { $params['action'] = 'UpdateInvoice'; // return Whmcs_base::send_request($params); $load = new Whmcs_base(); return $load->send_request($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function invoiceitem_update( $invoiceitem_id, $amount, $desc = FALSE ) {\r\n\t\t$params['amount'] = $amount;\r\n\t\t$params['currency'] = 'usd';\r\n\t\tif( $desc ) $params['description'] = $desc;\r\n\t\t\r\n\t\treturn $this->_send_request( 'invoiceitems/'.$invoiceitem_id, $params, STRIPE_METHOD_POST );\r\n\t}", "public function update(Request $request, $id)\n {\n $business = Auth::user()->business;\n\n // $validator = Validator::make($request->all(), [\n // 'invoice_number' => 'required|numeric|integer',\n // 'invoice_date' => 'required|date',\n // 'due_date' => 'required|date|after:invoice_date',\n // 'currency' => 'in:eur,gbp,usd',\n // 'note' => 'nullable|string|max:1000',\n // ]);\n // if ($validator->fails()) {\n // return response()->json(['error' => 'Unauthorised - Validation failed', 'messages' => $validator->errors()], 422);\n // }\n\n //Update an invoice\n $invoice = Invoice::findOrFail($id);\n $invoice->draft_email = $request->user_email;\n $invoice->total_cost = 0;\n foreach ($request->invoiceLines as $line) {\n $invoice->total_cost += $line['cost'] * ceil($line['sec'] / 60) * 100;\n }\n $invoice->save(); // save it to the database.\n //PROBABLY NOT WORKING\n //Attach each product as invoice item\n foreach ($request->invoiceLines as $line) {\n $invoiceItem = new InvoiceItems([\n 'name' => $line['name'],\n 'description' => $line['description'],\n 'cost' => $line['cost'] * 100,\n 'quantity' => ceil($line['sec'] / 60),\n 'sub_total' => $line['cost'] * ceil($line['sec'] / 60) * 100\n ]);\n if (isset($line['rate_unit'])) {\n $invoiceItem->rate_unit = $line['rate_unit'];\n }\n $invoice->invoiceItems()->save($invoiceItem);\n }\n //Redirect to a specified route with flash message.\n return response(200);\n }", "public function edit_invoice($invoice_id = \"\") {\n $data = [];\n $this->db->where('id', $invoice_id);\n $this->db->update('invoice', $data);\n $this->session->set_flashdata('flash_message', get_phrase('invoice_update_successfully'));\n }", "public function update(Request $request, $id)\n {\n \n //INVOICE\n $invoice = Invoice::find($id);\n $invoice->customer_name = $request->customer_name;\n $invoice->sum_for_paying = $request->sum_for_paying;\n $invoice->invoice_closed = true;\n $invoice->closing_date = $request->closing_date;\n $invoice->save();\n\n //INVOICE ITEM(s)\n $invoiceitems = $request->input(['invoiceitems']);\n $invoiceitems = $request->invoiceitems;\n foreach ($invoiceitems as $invoiceitemx) {\n $invoiceitem = Invoiceitem::find($invoiceitemx['id']);//this gives the id, it works\n $invoiceitem->returned = $invoiceitemx['returned'];\n $invoiceitem->time_on_field = $invoiceitemx['time_on_field'];\n $invoiceitem->to_pay = $invoiceitemx['to_pay'];\n $invoiceitem->invoice_line_closed = true;\n $invoiceitem->save();\n }\n\n //SET TOOLS TO ONSTOCK AGAIN\n\n\n return $invoice;\n }", "public function update($shoppingcartInvoice);", "public function _update_invoice($invoice_id)\n\t{\n\t\t$invoice_number = $this->create_invoice_number();\n\t\t\n\t\t$data = array(\n\t\t\t\t'user_id'=>$this->input->post('user_id'),\n\t\t\t\t'payment_method'=>$this->input->post('payment_method'),\n\t\t\t\t'invoice_status'=>1,\n\t\t\t\t'invoice_instructions'=>$this->input->post('invoice_instructions'),\n\t\t\t\t'modified_by'=>$this->session->userdata('user_id')\n\t\t\t);\n\t\t\n\t\t$this->db->where('invoice_id', $invoice_id);\n\t\tif($this->db->update('invoice', $data))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function update(Update $request ,$payableinvoice_id)\n {\n $input_data = $request->only('id','date','invoice_number','vendor_id',\n 'notes', 'subtotal', 'pst', 'gst', 'total', 'override_gst',\n 'override_pst', 'posted','posted_date');\n \n $input_data['posted_date']=$request->posted == '1' ? date('Y-m-d H:i:s') : NULL;\n PayableInvoice::where('id',$request->id)->update($input_data);\n $this->payableInvoiceRepository->updatePayableItem($request->all());\n $this->payableInvoiceRepository->deletePayableItem($request->all());\n return $this->response->array([STATUS => 200, MESSAGE => 'Details has been saved.']);\n }", "public function update(UpdateInvoicesRequest $request, $id)\n {\n if (! Gate::allows('invoice_edit')) {\n return prepareBlockUserMessage();\n }\n $invoice = Invoice::findOrFail($id);\n // dd( $request->all() );\n $products_details = getProductDetails( $request );\n\n $tax_format = $request->tax_format;\n $discount_format = $request->discount_format;\n\n $products_details['discount_format'] = $discount_format;\n $products_details['tax_format'] = $tax_format;\n \n // These are product values.\n $grand_total = ! empty( $products_details['grand_total'] ) ? $products_details['grand_total'] : 0;\n $products_amount = ! empty( $products_details['products_amount'] ) ? $products_details['products_amount'] : 0;\n $total_tax = ! empty( $products_details['total_tax'] ) ? $products_details['total_tax'] : 0;\n $total_discount = ! empty( $products_details['total_discount'] ) ? $products_details['total_discount'] : 0;\n\n // Calculation of Cart Tax.\n $tax_id = $request->tax_id;\n $cart_tax = 0; \n if ( $tax_id > 0 ) { \n $invoice->setTaxIdAttribute( $tax_id );\n $tax = $invoice->tax()->first();\n $rate = 0;\n $rate_type = 'percent';\n if ( $tax ) {\n $rate = $tax->rate;\n $rate_type = $tax->rate_type;\n }\n $products_details['cart_tax_rate'] = $rate;\n $products_details['cart_tax_rate_type'] = $rate_type;\n\n if ( $rate > 0 ) {\n if ( 'before_tax' === $tax_format ) {\n if ( 'percent' === $rate_type ) {\n $cart_tax = ( $products_amount * $rate) / 100;\n } else {\n $cart_tax = $rate;\n } \n } else {\n $new_amount = $products_amount + $total_tax;\n if ( 'percent' === $rate_type ) {\n $cart_tax = ( $new_amount * $rate) / 100;\n } else {\n $cart_tax = $rate;\n }\n }\n } \n }\n\n // Let us calculate Cart Discount\n $cart_discount = 0;\n $discount_id = $request->discount_id;\n if ( $discount_id > 0 ) {\n $invoice->setDiscountIdAttribute( $discount_id );\n $discount = $invoice->discount()->first();\n\n $rate = 0;\n $rate_type = 'percent';\n if ( $discount ) {\n $rate = $discount->discount;\n $rate_type = $discount->discount_type;\n }\n $products_details['cart_discount_rate'] = $rate;\n $products_details['cart_discount_rate_type'] = $rate_type;\n if ( $rate > 0 ) {\n if ( 'before_tax' === $tax_format ) {\n if ( 'percent' === $rate_type ) {\n $cart_discount = ( $products_amount * $rate) / 100;\n } else {\n $cart_discount = $rate;\n } \n } else {\n $new_amount = $products_amount + $total_tax;\n if ( 'percent' === $rate_type ) {\n $cart_discount = ( $new_amount * $rate) / 100;\n } else {\n $cart_discount = $rate;\n }\n }\n } \n }\n\n $products_details['cart_tax'] = $cart_tax;\n $products_details['cart_discount'] = $cart_discount;\n $amount_payable = $grand_total + $cart_tax - $cart_discount;\n $products_details['amount_payable'] = $amount_payable;\n\n // if there are transactions for this customer. Currency selection may disable, so we need to get it from customer profile.\n $currency_id = $request->currency_id;\n if ( empty( $currency_id ) ) {\n $currency_id = getDefaultCurrency( 'id', $request->customer_id );\n }\n\n // If products module disabled! lets take amount from user input!!\n if ( empty( $amount_payable ) && $request->has('amount') ) {\n $amount_payable = $request->amount;\n }\n\n $addtional = array(\n 'products' => json_encode( $products_details ),\n 'amount' => $amount_payable,\n 'currency_id' => $currency_id,\n );\n\n $invoice_no = $request->invoice_no;\n if ( empty( $invoice_no ) ) {\n $invoice_no = getNextNumber();\n }\n \n $addtional['invoice_no'] = $invoice_no;\n\n $request->request->add( $addtional ); //add additonal / Changed values to the request object.\n\n $date_set = getCurrentDateFormat();\n\n $additional = array( \n 'invoice_date' => ! empty( $request->invoice_date ) ? Carbon::createFromFormat($date_set, $request->invoice_date)->format('Y-m-d') : NULL,\n 'invoice_due_date' => ! empty( $request->invoice_due_date ) ? Carbon::createFromFormat($date_set, $request->invoice_due_date)->format('Y-m-d') : NULL,\n ); \n $request->request->add( $additional ); \n\n if ( isDemo() ) {\n return prepareBlockUserMessage( 'info', 'crud_disabled' );\n } \n\n\n $invoice->update($request->all());\n\n \n\n $products_sync = ! empty( $products_details['products_sync'] ) ? $products_details['products_sync'] : array();\n $invoice->invoice_products()->sync( $products_sync );\n\n $products_sync = ! empty( $products_details['products_sync_tasks'] ) ? $products_details['products_sync_tasks'] : array();\n $invoice->invoice_products_tasks()->sync( $products_sync );\n\n $products_sync = ! empty( $products_details['products_sync_expenses'] ) ? $products_details['products_sync_expenses'] : array();\n $invoice->invoice_products_expenses()->sync( $products_sync );\n\n $this->insertHistory( array('id' => $invoice->id, 'comments' => 'invoice-updated', 'operation_type' => 'crud' ) );\n\n $invoice->allowed_paymodes()->sync(array_filter((array)$request->input('allowed_paymodes')));\n\n $invoice->update_invoice_status( $invoice->id );\n\n $customer = $invoice->customer()->first();\n if ( ! empty( $request->btnsavesend ) && $customer && 'Published' === $invoice->status ) {\n // Notification to user\n $logo = getSetting( 'site_logo', 'site_settings' );\n $templatedata = array(\n 'client_name' => $customer->name,\n 'content' => 'Invoice has been created',\n 'invoice_url' => route( 'admin.invoices.preview', [ 'slug' => $invoice->slug ] ),\n 'invoice_no' => $invoice->invoice_no,\n 'invoice_date' => digiDate( $invoice->invoice_date ),\n 'invoice_amount' => digiCurrency($invoice->amount,$invoice->currency_id),\n 'invoice_due_date' => digiDate( $invoice->invoice_due_date ),\n 'title' => $invoice->title,\n 'address' => $invoice->address,\n 'reference' => $invoice->reference,\n 'invoice_notes' => $invoice->invoice_notes,\n 'customer_id' => $invoice->customer_id,\n 'currency_id' => $invoice->currency_id,\n 'tax_id' => $invoice->tax_id,\n 'discount_id' => $invoice->discount_id,\n 'paymentstatus' => $invoice->paymentstatus,\n 'created_by_id' => $invoice->created_by_id,\n 'products' => productshtml( $invoice->id ),\n\n 'site_address' => getSetting( 'site_address', 'site_settings'),\n 'site_phone' => getSetting( 'site_phone', 'site_settings'),\n 'site_email' => getSetting( 'contact_email', 'site_settings'), \n 'site_title' => getSetting( 'site_title', 'site_settings'),\n 'logo' => asset( 'uploads/settings/' . $logo ),\n 'date' => digiTodayDate(),\n 'site_url' => env('APP_URL'),\n );\n\n if ( $invoice->customer->name ) {\n $templatedata['customer_id'] = $invoice->customer->name;\n }\n \n if ( $invoice->currency->name ) {\n $templatedata['currency_id'] = $invoice->currency->name;\n }\n \n if ( $invoice->tax->name ) {\n $templatedata['tax_id'] = $invoice->tax->name;\n }\n \n if ( $invoice->discount->name ) {\n $data['discount_id'] = $invoice->discount->name;\n }\n \n $createduser = \\App\\User::find( $invoice->created_by_id );\n if ( $createduser ) {\n $data['created_by_id'] = $createduser->name;\n }\n\n $data = [\n \"action\" => \"Created\",\n \"crud_name\" => \"User\",\n 'template' => 'invoice-created',\n 'model' => 'App\\Invoices',\n 'data' => $templatedata,\n ];\n $customer->notify(new QA_EmailNotification($data));\n\n $this->insertHistory( array('id' => $invoice->id, 'comments' => 'invoice-updated', 'operation_type' => 'email' ) );\n }\n\n flashMessage( 'success', 'update');\n\n if ( ! empty( $request->btnsavemanage ) ) {\n return redirect( 'admin/invoices/' . $invoice->id );\n } else {\n return redirect()->route('admin.invoices.index');\n }\n }", "function ciniki_sapos_invoiceUpdatePrices($ciniki, $tnid, $invoice_id, $args) {\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashIDQuery');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'sapos', 'private', 'itemCalcAmount');\n\n //\n // Get the items from the invoice that have an object defined\n //\n $strsql = \"SELECT id, object, object_id, price_id, quantity, \"\n . \"unit_amount, unit_discount_amount, unit_discount_percentage, unit_preorder_amount \"\n . \"FROM ciniki_sapos_invoice_items \"\n . \"WHERE invoice_id = '\" . ciniki_core_dbQuote($ciniki, $invoice_id) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['rows']) ) {\n // No items to update\n return array('stat'=>'ok');\n }\n $items = $rc['rows'];\n\n //\n // Update the item prices\n //\n foreach($items as $item) {\n //\n // Get the new price for the object\n //\n if( $item['object'] != '' && $item['object_id'] != '' ) {\n list($pkg,$mod,$obj) = explode('.', $item['object']);\n $rc = ciniki_core_loadMethod($ciniki, $pkg, $mod, 'sapos', 'itemLookup');\n if( $rc['stat'] == 'ok' ) {\n $fn = $rc['function_call'];\n $rc = $fn($ciniki, $tnid, array(\n 'object'=>$item['object'],\n 'object_id'=>$item['object_id'],\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['item']) ) {\n if( $rc['item']['price_id'] != $item['price_id'] ) {\n $update_args['price_id'] = $rc['item']['price_id'];\n }\n if( $rc['item']['unit_amount'] != $item['unit_amount'] ) {\n $update_args['unit_amount'] = $rc['item']['unit_amount'];\n }\n if( $rc['item']['unit_discount_amount'] > 0\n && $rc['item']['unit_discount_amount'] != $item['unit_discount_amount'] ) {\n $update_args['unit_discount_amount'] = $rc['item']['unit_discount_amount'];\n }\n if( $rc['item']['unit_discount_percentage'] > 0 \n && $rc['item']['unit_discount_percentage'] != $item['unit_discount_percentage'] ) {\n $update_args['unit_discount_percentage'] = $rc['item']['unit_discount_percentage'];\n }\n if( $rc['item']['unit_preorder_amount'] > 0 \n && $rc['item']['unit_preorder_amount'] != $item['unit_preorder_amount'] ) {\n $update_args['unit_preorder_amount'] = $rc['item']['unit_preorder_amount'];\n }\n }\n }\n }\n\n //\n // Calculate new item totals\n //\n $rc = ciniki_sapos_itemCalcAmount($ciniki, array(\n 'quantity'=>$item['quantity'],\n 'unit_amount'=>(isset($update_args['unit_amount'])?$update_args['unit_amount']:$item['unit_amount']),\n 'unit_discount_amount'=>(isset($update_args['unit_discount_amount'])?$update_args['unit_discount_amount']:$item['unit_discount_amount']),\n 'unit_discount_percentage'=>(isset($update_args['unit_discount_percentage'])?$update_args['unit_discount_percentage']:$item['unit_discount_percentage']),\n 'unit_preorder_amount'=>(isset($update_args['unit_preorder_amount'])?$update_args['unit_preorder_amount']:$item['unit_preorder_amount']),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $update_args['subtotal_amount'] = $rc['subtotal'];\n $update_args['discount_amount'] = $rc['discount'];\n $update_args['total_amount'] = $rc['total'];\n\n //\n // Update the item \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n $rc = ciniki_core_objectUpdate($ciniki, $tnid, 'ciniki.sapos.invoice_item', \n $item['id'], $update_args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.sapos');\n return $rc;\n }\n }\n\n\n\n return array('stat'=>'ok');\n}", "public function update(Request $request, $id)\n {\n DB::beginTransaction();\n try {\n $request->validate([\n \"invoice_number\"=>\"required\",\n \"item_id\"=>\"required\",\n \"quantity\"=>\"required\"\n ]);\n\n $invoice_item=InvoiceItem::find($id);\n $invoice=Invoice::where(\"invoice_number\",$request->invoice_number)->first();\n if(!$invoice){\n return back()->with(\"success\",\"This invoice number does not exits\");\n }\n $invoice_item->invoice_id=$invoice->id;\n $invoice_item->item_id=$request->item_id;\n $invoice_item->quantity=$request->quantity;\n $item=Item::find($request->item_id)->first();\n $invoice_item->price=$item->sale_price;\n $invoice_item->total=($invoice_item->price)*($invoice_item->quantity);\n $invoice_item->save();\n $amount=InvoiceItem::where(\"invoice_id\",$invoice_item->invoice_id)->count();\n $invoice=Invoice::find($invoice_item->invoice_id);\n $invoice->amount=$amount;\n $total=InvoiceItem::where(\"invoice_id\",$invoice_item->invoice_id)->sum(\"total\");\n if($invoice->currency==\"riel\"){\n $total=$total*4100;\n }\n $invoice->total=$total;\n $invoice->save();\n DB::commit();\n return back()->with(\"success\",\"The data has been updated\");\n }catch (\\Exception $e){\n report($e);\n DB::rollback();\n return back()->with(\"success\",\"The data cannot insert\");\n }\n }", "public function updateInvoiceDetail($pid, $iid, $qty, $selling_price, $total)\n {\n }", "public function update(Request $req, $id)\n {\n $inv = Invoice::find($id);\n $inv->business_id = \\business()->id;\n\n $contact = Contact::find($req->contact_id);\n\n $inv->contact_id = $contact->id;\n $inv->contact_name = $contact->name; //Contact::find($req->customer_id)->name;\n $inv->contact_email = $contact->email;\n $inv->contact_tax_number = $contact->tax_number;\n $inv->contact_phone = $contact->phone;\n $inv->contact_address = $contact->address;\n\n $inv->currency_code = $req->currency_code;\n $inv->currency_rate = 78;\n\n // Invoice\n $inv->invoice_number = $req->invoice_number;\n $inv->order_number = $req->order_number;\n $inv->status = 'pending';\n $inv->invoiced_at = $req->invoice_date;\n $inv->due_at = $req->due_date;\n\n $inv->subtotal_amount = $req->subtotal_amount;\n $inv->discount_percent = $req->discount_percent;\n $inv->discount_amount = $req->discount_amount;\n $inv->total_tax_amt = $req->total_tax_amt;\n $inv->round_up = $req->round_up;\n $inv->total_amount = $req->total_amount;\n\n\n $inv->notes = $req->notes;\n $inv->footer = $req->footer;\n\n $inv->category_id = $req->category_id;\n $inv->save();\n\n // Invoice Items\n // foreach($req->items as $item){\n // $invItem = new InvoiceItem();\n // $invItem->business_id = business()->id;\n // $invItem->invoice_id = $inv->id;\n // $invItem->item_id = $item['id'];\n // $invItem->name = $item['name'];\n // $invItem->quantity = $item['quantity'];\n // $invItem->price = $item['price'];\n // $invItem->taxprcnt = $item['taxprcnt'];\n // $invItem->taxamt = $item['taxamt'];\n // $invItem->total = $item['total'];\n // $invItem->save();\n // }\n // Invoice History\n $invHis = new InvoiceHistory();\n $invHis->business_id = business()->id;\n $invHis->invoice_id = $inv->id;\n $invHis->status_code = 'pending';\n $invHis->notify = 0;\n $invHis->description = 'Invoice No:'.$req->invoice_number.' is created...';\n $invHis->save();\n\n $req->session()->flash('status', 'Invoice Created..');\n\n return redirect()->route('admin.invoices.show', $inv->id);\n }", "function update_invoices($id,$params)\n {\n $this->company_db->where('id',$id);\n $this->company_db->update('tbl_invoice_header',$params);\n }", "public function update( InvoiceRequest $request, Invoice $invoice ) {\n\t\t$invoice->update( $request->except( 'option_id', 'section_id', 'quantity', 'remove' ) );\n\n\t\tInvoiceItem::where( 'invoice_id', $invoice->id )->delete();\n\t\tif ( !empty( $request->get( 'option_id' ) ) ) {\n\t\t\tforeach ( $request->get( 'option_id' ) as $key => $option_id ) {\n\t\t\t\tInvoiceItem::create( [\n\t\t\t\t\t'option_id' => $option_id,\n\t\t\t\t\t'invoice_id' => $invoice->id,\n\t\t\t\t\t'quantity' => $request->get( 'quantity' )[ $key ]\n\t\t\t\t] );\n\t\t\t}\n\t\t}\n\n\t\treturn redirect( '/invoice' );\n\t}", "public function updateInvoice($data) {\r\n //get authorisation from headers\r\n $headers = getallheaders();\r\n $auth = $headers[\"Authorization\"];\r\n\r\n //check authorization\r\n $role = $this->authenticate($auth);\r\n if ($role !== 'trader') {\r\n throw new RestException(401, \"Unauthorized\");\r\n }\r\n if ($data->id) {\r\n $invoice = Invoice::find_by_id($data->id);\r\n } else {\r\n throw new RestException(400, \"id not received\");\r\n }\r\n if (!$invoice) {\r\n throw new RestException(400, \"no such invoice\");\r\n }\r\n if (isset($data->invoicedate) && $this->validMySQLDate($data->invoicedate)) {\r\n $invoice->invoicedate = $data->invoicedate;\r\n }\r\n if (isset($data->amount)) {\r\n $invoice->amount = $data->amount;\r\n }\r\n if (isset($data->vatamount)) {\r\n $invoice->vatamount = $data->vatamount;\r\n }\r\n if (isset($data->paymenttype)) {\r\n $invoice->paymenttype = $data->paymenttype;\r\n }\r\n if (isset($data->chequenumber)) {\r\n $invoice->chequenumber = $data->chequenumber;\r\n }\r\n// if (isset($data->clientid)) {\r\n// $invoice->clientid = $data->clientid;\r\n// }\r\n// if (isset($data->productid)) {\r\n// $invoice->productid = $data->productid;\r\n// }\r\n// if (isset($data->traderid)) {\r\n// $invoice->traderid = $data->traderid;\r\n// }\r\n\r\n $invoice->save();\r\n return $invoice;\r\n }", "public function update(Request $request, Company $company, InvoiceItem $invoiceItem)\n {\n //\n }", "public function update(Request $request, Invoice $invoice) {\n\t\t//\n\t}", "public function update($id, UpdateinvoiceRequest $request)\n {\n if(!Sentinel::inRole('main')){\n //Flash::error('invoice not found');\n return redirect('invoices');\n //return;\n }\n $invoice = $this->invoiceRepository->findWithoutFail($id);\n if (empty($invoice)) {\n Flash::error('invoice not found');\n\n return redirect(route('invoices.index'));\n }\n\n $invoice = $this->invoiceRepository->update($request->all(), $id);\n\n Flash::success('invoice updated successfully.');\n\n return redirect(route('invoices.index'));\n }", "public function edit(Invoices $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n // return \"in update\";\n $previous_status = $invoice->invoicestatus->status;\n\n // updating the invoice\n $data = $request->only([\n 'customer_id', 'invoicestatus_id',\n 'amount', 'courier_id', 'subtotal', 'date',\n 'payment', 'discount', 'notes'\n ]);\n $invoice->update($data);\n\n // store temp invoice record data\n $records = array();\n foreach ($invoice->rows as $row) {\n // products quantity are back at database\n\n $product = Product::find($row['products_id']);\n $product->update([\"quantity\" => $product->quantity + $row->quantity]);\n }\n foreach ($request->rows as $row) {\n // updating the product\n\n $product = Product::find($row['id']);\n\n //return ($request->rows[$i][\"id\"]);\n // $priv_quantity = InvoiceRecord::where([\n // \"invoice_id\" => $invoice->id,\n // \"products_id\" => $product->id,\n // ])->select('quantity')->first();\n // adding privious quantity with product quantity and subtracting\n // requested invoice quantity\n\n // decresing the product quanityt from the product inventory\n $product->update([\"quantity\" => $product->quantity - $row[\"quantity\"]]);\n\n array_push($records, [\n \"products_id\" => $row[\"id\"],\n \"invoice_id\" => $invoice->id,\n \"quantity\" => $row[\"quantity\"],\n \"name\" => $row[\"name\"],\n \"price\" => $row['price'],\n \"selling_price\" => $row[\"selling_price\"],\n ]);\n }\n\n // if status changed then do necessary steps\n $status = InvoiceStatus::find($data['invoicestatus_id'])->first()->status;\n $this->status_handler($status, $invoice->id, $previous_status);\n\n // deleting all the previous invoice records\n InvoiceRecord::where(\"invoice_id\", $invoice->id)->delete();\n\n // creating the new records\n foreach ($records as $record) {\n InvoiceRecord::create($record);\n }\n }", "public function update($id)\n\t{\n\t\t$input = Input::all();\n\t\t\n\t\t$bid = Invoice::where('retail_invoice_id',$id)->pluck('branch_id');\n\t\t\n\t\t $rules = [\n\t\t //'memberDiscount' => 'required|numeric|between:0,100',\n\t\t 'invoiceDate' => 'required',\n\t\t 'invoiceNumber' => 'required|integer|unique:tbl_retail_invoice,invoice_number,'.$id.',retail_invoice_id,branch_id,'.$bid.',invoice_status,D',\n\t\t 'invoiceStatus' => 'required|in:D,C'\n\t\t];\n\n\t\t$validator = Validator::make($input, $rules);\n\n\t\t if($validator->passes()) {\n\n\t\t $discountMem = 0 ;\n\n\t\t \tInvoice::where('retail_invoice_id',$id)\n\t\t \t\t->update([\n\t\t \t\t\t'invoice_date'=> $input['invoiceDate'],\n\t\t \t\t\t'invoice_number' => $input['invoiceNumber'],\n\t\t \t\t\t'invoice_status' =>$input['invoiceStatus']\n\t\t \t\t\t]);\n\n\t\t \tInvoiceDetails::where('retail_invoice_id',$id)\n\t\t \t\t->update([\n\t\t \t\t\t'member_discount' => $discountMem\n\t\t \t\t\t]);\n\n\n\t\t $pass = '<ul class=\"alert alert-success\"><li>Successfully edited Invoice # <b>'.$id.'</b>!</li></ul>';\n\t\t return $pass;\n\t\t } else {\n\t\t \t$errors = $validator->messages();\n\t\t\t$err = '<ul class=\"alert alert-error\">';\n\t\t\t foreach ($errors->all() as $error) {\n\t\t\t $err .= '<li>'.$error.'</li>';\n\t\t\t }\n\t\t\t $err .= '</ul>';\n\n\t\t return $err;\n\t\t }\n\t}", "public function actionUpdateInvoice($id)\n {\n $this->checkPrivilege();\n $model = $this->findModel($id);\n $invoice = Invoice::findOne(['id_peneliti' => $model->id]);\n $modelsBahan = $model->rekapitulasiBahan;\n\n if ($invoice->load(Yii::$app->request->post())) {\n\n $oldIDs = ArrayHelper::map($modelsBahan, 'id', 'id');\n $modelsBahan = Model::createMultiple(RekapitulasiBahan::classname(), $modelsBahan);\n Model::loadMultiple($modelsBahan, Yii::$app->request->post());\n $deletedIDs = array_diff($oldIDs, array_filter(ArrayHelper::map($modelsBahan, 'id', 'id')));\n $invoice->total_biaya=0;\n $invoice->save();\n // validate all models\n $valid = $invoice->validate();\n $valid = Model::validateMultiple($modelsBahan) && $valid;\n\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if ($flag = $invoice->save(false)) {\n if (!empty($deletedIDs)) {\n RekapitulasiBahan::deleteAll(['id' => $deletedIDs]);\n }\n foreach ($modelsBahan as $modelBahan) {\n $modelBahan->id_peneliti = $model->id;\n $invoice->total_biaya += $modelBahan->harga;\n if (! ($flag = $modelBahan->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n }\n if ($flag) {\n $invoice->save();\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n }\n\n return $this->render('updateInvoice', [\n 'model' => $model,\n 'invoice' => $invoice,\n 'modelsBahan' => (empty($modelsBahan)) ? [new RekapitulasiBahan] : $modelsBahan,\n ]);\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Company $company, InvoiceItem $invoiceItem)\n {\n //\n }", "public function updateInvoiceItem($invoiceItemId, array $attributes = array())\n {\n $segments = \"/invoiceitems/{$invoiceItemId}\";\n\n return $this->createRequest($segments, \"post\", $attributes);\n }", "public function editItem($id,$item)\n\t{\n $this->db->trans_start();\n\t\t$this->db->where('id',$id);\n\t\t$this->db->update('item',$item);\n $this->db->trans_complete();\n\t}", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Company $company, OldInvoiceItem $oldInvoiceItem)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $invoice = Invoice::find($id);\n $invoice->invoice_gst_rate = $request->invoice_gst_rate;\n $invoice->invoice_reference = $request->invoice_reference;\n $invoice->invoice_comments = $request->invoice_comments;\n $invoice->invoice_date = $request->invoice_date;\n $invoice->invoice_billing_address = $request->invoice_billing_address;\n $invoice->invoice_copy_type = $request->invoice_copy_type;\n $invoice->invoice_final_cost = $request->project_estimate_cost;\n $invoice->invoice_grand_total = $request->invoice_grand_total;\n $invoice->save();\n\n Session::flash('updated', 'Invoice updated successfully');\n return redirect()->route('invoice.index');\n\n }", "public function update($id)\n {\n $update = 'added new price';\n $v = Validator::make(Input::all(),\n [\n 'finalproductdescription' => 'required',\n 'finalpriceperperson' => 'required',\n 'member' => 'min:1'\n\n ]\n );\n\n if (!$v->passes()) {\n return Response::json(['errors' => $v->errors()]);\n } else {\n $invoiceproduct = InvoiceProduct::find($id);\n\n if (Input::has('isupdate')) {\n $update = 'updated';\n $invoiceproductprice = InvoiceProductPrice::find(Input::get('isupdate'));\n if ($invoiceproductprice->exists) {\n $invoiceproductprice->price = Input::get('finalpriceperperson');\n $invoiceproductprice->description = Input::get('finalproductdescription');\n $invoiceproductprice->save();\n\n DB::table('invoice_lines')->where('invoice_product_price_id', '=', $invoiceproductprice->id)->delete();\n } else {\n return Response::json(['errors' => 'Could not find Product price']);\n }\n } else {\n $invoiceproductprice = new InvoiceProductPrice();\n $invoiceproductprice->invoice_product_id = $invoiceproduct->id;\n $invoiceproductprice->price = Input::get('finalpriceperperson');\n $invoiceproductprice->description = Input::get('finalproductdescription');\n $invoiceproductprice->save();\n }\n\n if (Input::has('member')) {\n $i = 0;\n foreach (Input::get('member') as $m) {\n $invoiceline = new InvoiceLine();\n $invoiceline->invoice_product_price_id = $invoiceproductprice->id;\n $invoiceline->member_id = $m;\n $invoiceline->save();\n if ($invoiceline->exists) {\n $i++;\n }\n }\n }\n\n return Response::json(['success' => true, 'message' => $invoiceproduct->name . ' Successfully ' . $update . ', '\n . $invoiceproductprice->price . ' per person.'\n . $i . ' Total persons' ]);\n }\n }", "public function update(UpdateInvoiceRequest $request, $id)\n {\n if ($request->get('multiple_codes') == null) {\n Session::flash('message_danger', 'Falta al menos un código de autorización por llenar');\n return redirect()->back()->withInput();\n }\n\n foreach ($request->get('multiple_codes') as $key => $value) {\n if ($request->get('multiple_days')[$key] == \"\") {\n Session::flash('message_danger', 'Falta al menos un campo de días por llenar');\n return redirect()->back()->withInput();\n }\n if ($request->get('multiple_totals')[$key] == \"\") {\n Session::flash('message_danger', 'Falta al menos un campo de total por llenar');\n return redirect()->back()->withInput();\n }\n if ($value == \"\") {\n Session::flash('message_danger', 'Falta al menos un campo de autorización por llenar');\n return redirect()->back()->withInput();\n }\n }\n Invoice::updateRecord($request, $id);\n\n Session::flash('message', 'Factura actualizada exitosamente');\n return redirect()->route('invoice.index');\n }", "public static function updateInventory($form, $purchaseInvoice)\n {\n foreach ($purchaseInvoice->items as $item) {\n if ($item->quantity > 0) {\n $options = [];\n if ($item->item->require_expiry_date) {\n $options['expiry_date'] = $item->purchaseReceiveItem->expiry_date;\n }\n if ($item->item->require_production_number) {\n $options['production_number'] = $item->purchaseReceiveItem->production_number;\n }\n\n $options['quantity_reference'] = $item->quantity;\n $options['unit_reference'] = $item->unit;\n $options['converter_reference'] = $item->converter;\n InventoryHelper::increase($form, $item->purchaseReceive->warehouse, $item->item, $item->quantity, $item->unit, $item->converter, $options);\n }\n }\n }", "public function update(Invoices $invoice, UpdateInvoicesRequest $request)\n {\n $data = $request->all();\n $data['rows'] = json_encode($request->rows);\n $invoice->fill($data);\n\n $this->invoice->save($invoice, $data);\n\n return $this->redirectResponse($request, __('alerts.backend.invoices.updated'));\n }", "public function update_cart($invoice_item_id, $quantity)\n\t{\n\t\t$data = array(\n\t\t\t\t\t'quantity'=>$quantity\n\t\t\t\t);\n\t\t\t\t\n\t\t$this->db->where('invoice_item_id = '.$invoice_item_id);\n\t\tif($this->db->update('invoice_item', $data))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function update(Request $request, $id)\n\t{\n $validator = Validator::make($request->all(), [\n 'valor' => 'required',\n 'data' => 'required',\n 'descricao' => 'required',\n ]);\n\n if ($validator->fails()) {\n return redirect()->back()\n ->withErrors($validator)\n ->withInput();\n }\n\n\t\t$invoice = Invoice::findOrFail($id);\n\n\t\t$invoice->valor = $request->input(\"valor\");\n $invoice->data = Carbon::createFromFormat('d/m/Y', $request->input(\"data\"));\n $invoice->descricao = $request->input(\"descricao\");\n\n\t\t$invoice->save();\n\n\t\treturn redirect()->route('invoices.index')->with('message', 'Item updated successfully.');\n\t}", "public function edit(Company $company, OldInvoiceItem $oldInvoiceItem)\n {\n //\n }", "public function update(Request $request, invoices_details $invoices_details)\n {\n //\n }", "public function update(Request $request, $id_payable_invoice)\n {\n $invoice = InvoicePayable::findOrFail($id_payable_invoice);\n $invoice->kode_invoice = $request->kode_invoice;\n $invoice->id_pegawai = $request['id_pegawai'] = Auth::user()->pegawai->id_pegawai;\n $invoice->tanggal_invoice = $request->tanggal_invoice;\n $invoice->tenggat_invoice = $request->tenggat_invoice;\n $invoice->deskripsi_invoice = $request->deskripsi_invoice;\n $invoice->total_pembayaran = $request->total_pembayaran;\n\n $invoice->status_prf ='Belum diBuat';\n $invoice->status_jurnal ='Belum diPosting'; \n $invoice->save();\n \n $invoice->Detailinvoice()->sync($request->sparepart);\n return $request;\n }", "public function update(ItemRequest $request, $id)\n\t{\n $batch_arr = Input::get('batch_arr');\n\t\t\t$count = count($batch_arr['batch_no']);\n\t // process inventory\n\t\t\t$tempTotalQuantity=0;\n\t if($count != 0)\n\t\t\t{\n\t\t\t\tfor ($i=0; $i < $count ; $i++) {\n \t\t\tif ($batch_arr['batch_no'][$i] != '') {\n \t\t\t\t$inventories = Inventory::where('item_id', $id)->where('batch_no',$batch_arr['batch_no'][$i])->get();\n\t\t\t\t\t\tif($inventories->isEmpty()){\n\n\t\t \t\t\t$newInventory = new Inventory;\n\t\t \t\t\t$newInventory->batch_no = $batch_arr['batch_no'][$i];\n\t\t\t\t\t\t\t$newInventory->item_id = $id;\n\t\t\t\t\t\t\t$newInventory->user_id = Auth::user()->id;\n\t\t\t\t\t\t\t$newInventory->in_out_qty = $batch_arr['quantity'][$i];\n\t\t\t\t\t\t\t$tempTotalQuantity += $batch_arr['quantity'][$i];\n\t\t\t\t\t\t\t$newInventory->expiry_date = $batch_arr['expiry'][$i];\n\t\t\t\t\t\t\t$newInventory->remarks = 'Manual Edit of Quantity';\n\t\t\t\t\t\t\t$newInventory->save();\n\n\t\t \t\t}\n\t\t \t\telse\n\t\t \t\t{\n\t\t\t\t\t\t\tforeach ($inventories as $index => $inventory) {\n\t\t\t\t\t\t\t\t$inventory->batch_no = $batch_arr['batch_no'][$i];\n\t\t\t\t\t\t\t\t$inventory->item_id = $id;\n\t\t\t\t\t\t\t\t$inventory->user_id = Auth::user()->id;\n\t\t\t\t\t\t\t\t$inventory->in_out_qty = $batch_arr['quantity'][$i];\n\t\t\t\t\t\t\t\t$tempTotalQuantity += $batch_arr['quantity'][$i];\n\t\t\t\t\t\t\t\t$inventory->expiry_date = $batch_arr['expiry'][$i];\n\t\t\t\t\t\t\t\t$inventory->remarks = 'Manual Edit of Quantity';\n\t\t\t\t\t\t\t\t$inventory->save();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n $items = Item::find($id);\n $items->item_code = Input::get('item_code');\n $items->item_name = Input::get('item_name');\n $items->size = Input::get('size');\n $items->description = Input::get('description');\n $items->cost_price = Input::get('cost_price');\n $items->selling_price = Input::get('selling_price');\n $items->quantity = $tempTotalQuantity;\n $items->save();\n // process avatar\n $image = $request->file('avatar');\n\t\t\tif(!empty($image)) {\n\t\t\t\t$avatarName = 'item' . $id . '.' . \n\t\t\t\t$request->file('avatar')->getClientOriginalExtension();\n\n\t\t\t\t$request->file('avatar')->move(\n\t\t\t\tbase_path() . '/public/images/items/', $avatarName\n\t\t\t\t);\n\t\t\t\t$img = Image::make(base_path() . '/public/images/items/' . $avatarName);\n\t\t\t\t$img->resize(100, null, function ($constraint) {\n\t\t\t\t\t$constraint->aspectRatio();\n\t\t\t\t});\n\t\t\t\t$img->save();\n\t\t\t\t$itemAvatar = Item::find($id);\n\t\t\t\t$itemAvatar->avatar = $avatarName;\n\t $itemAvatar->save();\n \t}\n Session::flash('message', 'You have successfully updated item');\n return Redirect::to('items');\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $old_invoice_id = $model->invoice_id;\n\n $invoicesList = Invoice::getSelfInvoicesWithoutPaymentDropDown(Yii::$app->user->identity);\n $invoicesList[$model->invoice_id] = $model->invoice->invoice_number;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->addFlash('success', Yii::t('auth', 'Сhanges saved successfully '));\n\n if (Invoice::setStatus($old_invoice_id, Invoice::STATUS_NOT_PAID) &&\n Invoice::setStatus($model->invoice_id, Invoice::STATUS_PAID) &&\n $old_invoice_id!=$model->invoice_id) {\n Yii::$app->session->addFlash('success',\n Yii::t(\n 'auth', 'You have successfully payed another Invoice № ' .\n $model->invoice->invoice_number . \", and all changes saved\")\n );\n Yii::$app->session->addFlash(\n 'success', Yii::t('auth', 'You have successfully deactivate Invoice № ' .\n Invoice::findOne($old_invoice_id)->invoice_number )\n );\n }\n ;\n return $this->redirect(['index']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'paymentMethodList' => Payment::PAYMENT_METHODS_ARRAY,\n 'invoicesList' => $invoicesList,\n 'createFrom' => false\n ]);\n }\n }", "public function updateInvoice($id, $invoiceArray)\n {\n $responseString = $this->apiCall('PUT', 'invoices/'.$id, json_encode($invoiceArray));\n try\n {\n $responseObject = $this->parseResponse($responseString);\n return $responseObject->Invoice;\n }\n catch(Exception $e)\n {\n echo 'Can`t parse API response: '.$e->getMessage;\n return false;\n }\n }", "public function update(InvoiceRequest $request, Invoice $invoice)\n\t{\n\t\t// Validate Data from Form\n\t\t$validData = $request->validated();\n\n\t\t// Fill Data and Save Invoice\n\t\t$invoice->fill($validData);\n\t\t$invoice->save();\n\n\t\t// Set Notifications\n\t\tif (!$invoice->save()) {\n\t\t\t// if not saved\n\t\t\ttoastr()->error('An error has occurred. If it persists, contact the manager.');\n\t\t} else {\n\t\t\t// if edited\n\t\t\ttoastr()->success('The invoice was edited successfully!', 'Abigail Says...');\n\t\t}\n\n\t\t// Redirect\n\t\treturn redirect()->route('invoices.show', $invoice);\n\t}", "public static function updateItem($conn, $id, $sku, $title, $price, $quantity=\"1\", $taxable=\"0\", $tangible=\"0\", $available=\"0\", $listed=\"0\", $description=\"\", $notes =\"\")\n\t{\n\t\t// add the item entry\n\t\t$st = <<<sql\n\t\t\tupdate Items \n\t\t\tset\n\t\t\t\tsku = :sku,\n\t\t\t\ttitle = :title,\n\t\t\t\tprice = :price,\n\t\t\t\tquantity = :quantity,\n\t\t\t\ttaxable = :taxable,\n\t\t\t\ttangible = :tangible,\n\t\t\t\tavailable = :available,\n\t\t\t\tlisted = :listed,\n\t\t\t\tdescription = :description,\n\t\t\t\tnotes = :notes\n\t\t\twhere id = :id\n\t\tsql;\n\t\t\n\t\t// start transaction\n\t\t$conn->beginTransaction();\n\t\t\n\t\t$q = $conn->prepare($st);\n\t\t$q->execute([\n\t\t\t':id' => $id,\n\t\t\t':sku' => $sku,\n\t\t\t':title' => $title,\n\t\t\t':price' => $price,\n\t\t\t':quantity' => $quantity,\n\t\t\t':taxable' => $taxable,\n\t\t\t':tangible' => $tangible,\n\t\t\t':available' => $available,\n\t\t\t':listed' => $listed,\n\t\t\t':description' => $description,\n\t\t\t':notes' => $notes,\n\t\t\t]);\n\t\t\n\t\t// get last ID entered and commit\n\t\t$id = $conn->query(\"select last_insert_id() as id from items\");\n\t\t$output = ($id->fetch())['id'];\n\t\t//die();\n\t\t$conn->commit();\n\t\t\n\t\treturn (int)$output;\n\t}", "public static function updateInvoiceById($id, $status, $rsa){\n $model = self::model()->findByPk($id);\n $model->reader_status = $status;\n $model->reader_supposed_amount = $rsa;\n $model->save();\n }", "public function update(Request $request, $id)\n {\n Product::where('invoice_id', $id)->delete();\n\n $sum_amount = 0;\n foreach ($request->amount as $key => $value) {\n $sum_amount += $value;\n }\n \n\n if($request->is_paid == '1'){\n $is_paid = 1;\n }else{\n $is_paid = 0;\n }\n\n\n $invoice = Invoice::findOrFail($id);\n $invoice->total_amount = $sum_amount;\n if(!isset($request->autometic_email_day)){\n $invoice->autometic_email_day = $invoice->autometic_email_day;\n }else{\n $invoice->autometic_email_day = $request->autometic_email_day;\n }\n \n $invoice->invoice_email = $request->invoice_email;\n $invoice->is_paid = $is_paid;\n $invoice->save();\n\n $customer = Customer::where('id', $invoice->user_id)->first();\n $customer->days = $request->autometic_email_day;\n $customer->invoice_email = $request->invoice_email;\n $customer->save();\n\n foreach ($request->product_name as $key => $value) {\n $product = new Product;\n $product->invoice_id = $invoice->id;\n $product->user_id = $invoice->user_id;\n $product->product_name = $value;\n $product->description = $request->description[$key];\n $product->amount = $request->amount[$key];\n $product->save();\n\n }\n\n return redirect('home')->with('success', 'Product Updated!');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request,[\n\t\t'invoice_number'=>'required',\n\t\t'service_code'=>'required',\n\t\t'car_number'=>'required',\n\t\t'mobile'=>'required',\n\t\t'price'=>'required'\n\t\t]);\n\t\t$invoice=Invoice::find($id);\n\t\t$invoice->invoice_number=$request->get('invoice_number');\n\t\t$invoice->service_code=$request->get('service_code');\n\t\t$invoice->car_number=$request->get('car_number');\n\t\t$invoice->mobile=$request->get('mobile');\n\t\t$invoice->price=$request->get('price');\n\t\t$invoice->save();\n\t\treturn redirect()->route('invoice.index')->with('success','Data Updated');\n }", "public function update(Request $request, Invoices $invoices)\n {\n //\n }", "public function update_by_mock_invoice_id() {\n\n if ( isset( $_POST[ 'mockInvoiceId' ] ) ) {\n $mockInvoiceId = $this->input->post( 'mockInvoiceId' );\n unset( $_POST['mockInvoiceId'] );\n\n // Set any empty values to null\n array_replace_empty_with_null( $_POST );\n\n $updatedId = $this->mockinvoice_model->save( $_POST, $mockInvoiceId );\n }\n // Error handling - return some JSON if update successful\n if ( $updatedId ) {\n // Send back the POST details as JSON\n $this->json_library->print_array_json_unless_empty( $_POST );\n }\n }", "function edit() {\n $this->wireframe->hidePrintButton();\n \n if($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n if(!$this->active_invoice->canEdit($this->logged_user)) {\n $this->response->forbidden();\n } // if\n\n $invoice_data = $this->request->post('invoice');\n if(!is_array($invoice_data)) {\n $invoice_data = array(\n 'number' => $this->active_invoice->getNumber(),\n 'due_on' => $this->active_invoice->getDueOn(),\n 'issued_on' => $this->active_invoice->getIssuedOn(),\n 'currency_id' => $this->active_invoice->getCurrencyId(),\n 'purchase_order_number' => $this->active_invoice->getPurchaseOrderNumber(),\n 'private_note' => $this->active_invoice->getPrivateNote(),\n 'company_id' => $this->active_invoice->getCompanyId(),\n 'company_address' => $this->active_invoice->getCompanyAddress(),\n 'project_id' => $this->active_invoice->getProjectId(),\n 'note' => $this->active_invoice->getNote(),\n 'language_id' => $this->active_invoice->getLanguageId(),\n 'payment_type' => $this->active_invoice->getAllowPayments(),\n 'second_tax_is_compound' => $this->active_invoice->getSecondTaxIsCompound()\n );\n if(is_foreachable($this->active_invoice->getItems())) {\n $invoice_data['items'] = array();\n foreach($this->active_invoice->getItems() as $item) {\n $invoice_data['items'][] = array(\n 'id'\t\t\t\t\t => $item->getId(),\n 'description' => $item->getDescription(),\n 'unit_cost' => $item->getUnitCost(),\n 'quantity' => $item->getQuantity(),\n 'first_tax_rate_id' => $item->getFirstTaxRateId(),\n 'second_tax_rate_id' => $item->getSecondTaxRateId(),\n 'total' => $item->getTotal(),\n 'subtotal' => $item->getSubtotal(),\n 'time_record_ids' => $item->getTimeRecordIds(),\n );\n } // foreach\n } // if\n } // if\n \n $this->response->assign('invoice_data', $invoice_data);\n $this->response->assign(Invoices::getSettingsForInvoiceForm($this->active_invoice));\n \n if ($this->request->isSubmitted()) {\n \tif (!$this->request->isAsyncCall()) {\n \t\t$this->response->badRequest();\n \t} // if\n \t\n \ttry {\n if (!is_foreachable($invoice_data['items'])) {\n throw new ValidationErrors(lang('At least one invoice item is required'));\n } // if\n\n \t\tDB::beginWork('Editing Invoice');\n\n \t\t$this->active_invoice->setAttributes($invoice_data);\n\n if ($this->active_invoice->getSecondTaxIsEnabled()) {\n $this->active_invoice->setSecondTaxIsCompound(array_var($invoice_data, 'second_tax_is_compound', false));\n } // if\n\n $this->active_invoice->setItems($invoice_data['items']);\n \t\t\n \t\tif ($this->active_invoice->isIssued()) {\n \t\t $issued_on = isset($invoice_data['issued_on']) ? new DateValue($invoice_data['issued_on']) : new DateValue();\n \t\t $this->active_invoice->setIssuedOn($issued_on);\n \t\t} //if\n\n \t\t\n \t\t$this->active_invoice->save();\n \n// TODO: resolve the issue when dialog has to be redirected to the notification page\n// $this->flash->success('\":number\" has been updated', array('number' => $this->active_invoice->getName()));\n// if ($this->active_invoice->isIssued()) {\n// $this->response->redirectTo('invoice_notify', array('invoice_id' => $this->active_invoice->getId()));\n// } else {\n// $this->response->redirectToUrl($this->active_invoice->getViewUrl()); \n// } // if\n\n \t\tDB::commit('Invoice Edited');\n\n\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t'as' => 'invoice', \n 'detailed' => true,\n ));\n \n \t} catch (Exception $e) {\n \t\tDB::rollback('Invoice Editing Failed');\n \t\t$this->response->exception($e);\n \t} // try\n \t\n } // if\n }", "public function edit(Invoices $invoices)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n $request->validate([\n 'kode'=>'required',\n 'harga'=> 'required|integer',\n ]);\n $purchaseInvoices = PurchaseInvoice::find($id);\n $purchaseInvoices->kode = $request->get('kode');\n $purchaseInvoices->harga = $request->get('harga');\n $purchaseInvoices->save();\n return redirect('/invoices')->with('success', 'Invoice has been updated');\n }", "function updateItem($idItem, $name, $amount, $unitPrice, $salesPrice, $parAmount){\n global $db;\n \n $stmt=$db->prepare(\"UPDATE inventory SET name = :name, amount = :amount, unitPrice = :unitPrice, salesPrice = :salesPrice, parAmount = :parAmount WHERE idItem = :idItem\");\n \n $binds = array(\n \":name\" => $name,\n \":unitPrice\" => $unitPrice,\n \":salesPrice\" => $salesPrice,\n \":parAmount\" => $parAmount,\n \":amount\" => $amount,\n \":idItem\" => $idItem\n );\n \n $result=false;\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $result=true;\n }\n return $result;\n }", "public function update_inventory() {\n\t\t$rowIndex = $_POST['row_index'];\n\t\t$values=array(\"brand_id\"=>$_POST['brand_list_id'],\"product_id\"=>$_POST['product_list_id'],\"item_name\"=>$_POST['item_name'],\"entry_date\"=>$_POST['purchase_date'],\"buy_price\"=>$_POST['product_buy_price'],\"sell_price\"=>$_POST['product_sell_price'],\"quantity\"=>$_POST['item_qty'],\"update_by\"=>isset($_SESSION['user_id']));\n\t\t$where =array(\"id\"=>$_POST['inv_item_id']);\n\t\tif($this->update(\"inventory\",$values,$where)) {\t\t\t\n\t\t\techo '{\"inventoryItemList\":{\"updateFlag\":true,\"rowIndex\":'.$rowIndex.'}}';\n\t\t}\n\t\telse\n\t\t\techo 'Error while updating';\n\t}", "public function InvoiceUpdate(Request $request) {\n try\n {\n $InvoiceSelections = DB::table('hdpos_invoice')\n ->leftJoin('items', DB::raw('hdpos_invoice.itemid::integer'), '=', 'items.id' )\n ->where('invoicenumber', (string)$request->invoiceNumber)\n ->select('items.id','items.bnumber','hdpos_invoice.spotdiscountchkbox','hdpos_invoice.discountchkbox','items.itemname','items.openstock','items.minstock','items.isactive','items.notforsale','items.ispurchased','items.online','items.categoryname','items.subcategoryname','items.desc','items.featured_image','items.mrp','items.disc1','items.disc2','items.discvalue','items.finalprice','items.createdby','items.modifiedby','items.created_at','items.updated_at','hdpos_invoice.id','hdpos_invoice.invoicenumber','hdpos_invoice.itemid','hdpos_invoice.amount','hdpos_invoice.quantity','hdpos_invoice.discount','hdpos_invoice.spotdiscountpercent','hdpos_invoice.spotdiscountamount','hdpos_invoice.status','hdpos_invoice.createdby','hdpos_invoice.modifiedby','hdpos_invoice.created_at','hdpos_invoice.updated_at','hdpos_invoice.invoicedate')\n ->orderBy('items.id', 'DESC')\n ->get();\n\n return response()->json($InvoiceSelections);\n }\n catch(\\Exception $Exe)\n {\n return $Exe-> getMessage();\n }\n }", "public function contract($id = ''){\n\t\t\n\t\tif ($this->input->post('paiement')) {\n\t\t\t\n\t\t\t$medals = $this->input->post('medals_id');\n\t\t\t$method = $this->input->post('method');\n\t\t\t$date = $this->input->post('date_paid');\n\t\t\t\n\t\t\t$this->db->where('number', $medals);\n\t\t\t$this->db->set('date_paid', $date);\n\t\t\t$this->db->set('method', $method);\n\t\t\t$this->db->update('tblcontracts');\n\t\t\t//print_r($this->input->post());\n\t\t\t\n\t\t\t$this->db->where('id', 2);\n\t\t\t$item = $this->db->get('tblinvoiceitemslist')->row();\n\t\t\t\n\t\t\t$data['clientid'] = $this->input->post('clientid');\n\t\t\t$data['date'] = $date;\n\t\t\t$data['duedate'] = date('Y-m-d', strtotime(\"+30 days\"));\n\t\t\t$data['currency'] = \"2\";\n\t\t\t$data['clientnote'] = \"\";\n\t\t\t$data['adminnote'] = \"\";\n\t\t\t$data['terms'] = \"\";\n\t\t\t$data['discount_percent'] = \"0\";\n\t\t\t$data['discount_total'] = \"0\";\n\t\t\t$data['adjustment'] = \"0.00\";\n\t\t\t$data['subtotal'] = $item->rate;\n\t\t\t$data['total'] = $data['subtotal'];\n\t\t\t$data['allowed_payment_modes'] = 'a:6:{i:0;s:1:\"1\";i:1;s:1:\"2\";i:2;s:1:\"3\";i:3;s:1:\"4\";i:4;s:6:\"paypal\";i:5;s:6:\"stripe\";}';\n\t\t\t$data['discount_type'] = \"\";\n\t\t\t$data['recurring'] = \"18\";\n\t\t\t$data['number'] = $medals;\n\t\t\t$data['hash'] = md5(rand() . microtime());\n\t\t\t$data['status'] = 2;\n\t\t\t\n\t\t\t$data['newitems'] = Array ( 'item' => Array ( '2' => Array ( 'quantity' => Array ( 0 => 1 ) ) ) );\n\t\t\t\n\t\t\t$items = $data['newitems'];\n\t\t\t\n\t\t\tunset($data['newitems']);\n\t\t\t\n\t\t\t$this->db->insert('tblinvoices', $data);\n\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t$invoice_id = $insert_id;\n\t\t\tif ($insert_id) {\n\t\t\t\t$this->db->where('name', 'next_invoice_number');\n\t\t\t\t$this->db->set('value', 'value+1', FALSE);\n\t\t\t\t$this->db->update('tbloptions');\n\t\t\t\tif (count($items) > 0) {\n\t\t\t\t\tforeach ($items['item'] as $itemid => $quantity) {\n\t\t\t\t\t\t$this->db->insert('tblinvoiceitems', array(\n\t\t\t\t\t\t\t'invoiceid' => $insert_id,\n\t\t\t\t\t\t\t'itemid' => $itemid,\n\t\t\t\t\t\t\t'qty' => $quantity['quantity'][0]\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$this->db->where('number', $medals);\n $this->db->delete('tblnotused');\n\t\t\t\t\n\t\t\t\t$data_payment['invoiceid'] = $insert_id;\n\t\t\t\t$data_payment['amount'] = $data['subtotal'];\n\t\t\t\t$data_payment['paymentmode'] = 1;\n\t\t\t\t$data_payment['date'] = $date;\n\t\t\t\t$data_payment['daterecorded'] = $date;\n\t\t\t\t$data_payment['addedfrom'] = 1;\n\t\t\t\t\n\t\t\t\t$this->db->insert('tblinvoicepaymentrecords', $data_payment);\n\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\t\n\t\t\t\tif ($insert_id) {\n\t\t\t\t\t\n\t\t\t\t\t//$invoice = $this->invoices_model->get($invoice_id);\n\t\t\t\t\t//$invoice_number = format_invoice_number($invoice->number);\n\t\t\t\t\t//$pdf = invoice_pdf($invoice);\n\t\t\t //\n\t\t\t\t\t//$pdf->Output($invoice_number . '.pdf');\n\t\t\t\t\t\n\t\t\t\t\tredirect(admin_url('contracts/recherche?number='.$medals.'&openinvoice=1&invoice_id='.$invoice_id));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tif ($this->input->post('search_client')) {\n\t\t\t$this->db->like('phonenumber', $this->input->post('search_client'));\n\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\tif ($client) {\n\t\t\t\t$data = json_encode((array)$client);\n\t\t\t\techo $data;\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t$client = array('no_found'=>'no_found');\n\t\t\t\t$data = json_encode((array)$client);\n\t\t\t\techo $data;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif(!has_permission('manageContracts')){\n\t\t\taccess_denied('manageContracts');\n\t\t}\n\n\t\tif($this->input->post()){\n\t\t\t$this->load->helper('perfex_upload');\n\t\t\t\n\t\t\tif($id == ''){\n\t\t\t\t\n\t\t\t\tif (!empty($this->input->post('userid'))) {\n\t\t\t\t\t$cliendid = $this->input->post('userid');\n\t\t\t\t\n\t\t\t\t\t$this->db->where('userid', $cliendid);\n\t\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t} else {\n\t\t\t\t\t$phone = $this->input->post('phonenumber');\n\t\t\t\t\n\t\t\t\t\t$this->db->where('phonenumber', $phone);\n\t\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//print_r($client);\n\t\t\t\t\n\t\t\t\tif (empty($client)) {\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name']);\n\t\t\t\t\tunset($_POST['race']);\n\t\t\t\t\tunset($_POST['color']);\n\t\t\t\t\tunset($_POST['remarque']);\n\t\t\t\t\tunset($_POST['number']);\n\t\t\t\t\tunset($_POST['datecreated']);\n\t\t\t\t\tunset($_POST['userid']);\n\t\t\t\t\tunset($_POST['attachment']);\n\t\t\t\t\tunset($_POST['sexe']);\n\t\t\t\t\tunset($_POST['method']);\n\t\t\t\t\tunset($_POST['rfid']);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$user_id = $this->clients_model->add($_POST);\n\t\t\t\t\t$_POST['client'] = $user_id;\n\t\t\t\t} else {\n\t\t\t\t\t$_POST['client'] = $client->userid;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$medals = $this->input->post('number');\n\t\t\t\t$method = $this->input->post('method');\n\t\t\t\t$date = date('Y-m-d');\n\t\t\t\t\n\t\t\t\t$this->db->where('number', $medals);\n\t\t\t\t$this->db->set('date_paid', $date);\n\t\t\t\t$this->db->set('method', $method);\n\t\t\t\t$this->db->update('tblcontracts');\n\t\t\t\t//print_r($this->input->post());\n\t\t\t\t\n\t\t\t\t$this->load->model('invoice_items_model');\n\t\t\t\t$items = $this->invoice_items_model->get();\n\t\t\t\t\n\t\t\t\t//print_r($items);\n\t\t\t\t\n\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t$villes = explode(',',$item['description']);\n\t\t\t\t\tif ($villes[0] == 'Médaille') {\n\t\t\t\t\t\t$ville = $villes[1];\n\t\t\t\t\t\tif ($client->city == $ville) {\n\t\t\t\t\t\t\t$item_id = $item['itemid'];\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\tif ($item_id) {\n\t\t\t\t\t$item_select = $item_id;\n\t\t\t\t} else {\n\t\t\t\t\t$item_select = 2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tunset($item);\n\t\t\t\t\n\t\t\t\t$this->db->where('id', $item_select);\n\t\t\t\t$item = $this->db->get('tblinvoiceitemslist')->row();\n\t\t\t\t\n\t\t\t\t$data['clientid'] = $_POST['client'];\n\t\t\t\t$data['date'] = $date;\n\t\t\t\t$data['duedate'] = date('Y-m-d', strtotime(\"+30 days\"));\n\t\t\t\t$data['currency'] = \"2\";\n\t\t\t\t$data['clientnote'] = \"\";\n\t\t\t\t$data['adminnote'] = \"\";\n\t\t\t\t$data['terms'] = \"\";\n\t\t\t\t$data['discount_percent'] = \"0\";\n\t\t\t\t$data['discount_total'] = \"0\";\n\t\t\t\t$data['adjustment'] = \"0.00\";\n\t\t\t\t$data['subtotal'] = $item->rate;\n\t\t\t\t$data['total'] = $data['subtotal'];\n\t\t\t\t$data['allowed_payment_modes'] = 'a:6:{i:0;s:1:\"1\";i:1;s:1:\"2\";i:2;s:1:\"3\";i:3;s:1:\"4\";i:4;s:6:\"paypal\";i:5;s:6:\"stripe\";}';\n\t\t\t\t$data['discount_type'] = \"\";\n\t\t\t\t$data['recurring'] = \"18\";\n\t\t\t\t$data['number'] = $medals;\n\t\t\t\t$data['hash'] = md5(rand() . microtime());\n\t\t\t\t$data['status'] = 2;\n\t\t\t\t\n\t\t\t\tif ($_POST['animal_name2']) {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 2 ) ) ) );\n\t\t\t\t} else if ($_POST['animal_name3']) {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 3 ) ) ) );\n\t\t\t\t} else {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 1 ) ) ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$items = $data['newitems'];\n\t\t\t\t\n\t\t\t\tunset($data['newitems']);\n\t\t\t\t\n\t\t\t\t$this->db->insert('tblinvoices', $data);\n\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\tif ($insert_id) {\n\t\t\t\t\t$this->db->where('name', 'next_invoice_number');\n\t\t\t\t\t$this->db->set('value', 'value+1', FALSE);\n\t\t\t\t\t$this->db->update('tbloptions');\n\t\t\t\t\tif (count($items) > 0) {\n\t\t\t\t\t\tforeach ($items['item'] as $itemid => $quantity) {\n\t\t\t\t\t\t\t$this->db->insert('tblinvoiceitems', array(\n\t\t\t\t\t\t\t\t'invoiceid' => $insert_id,\n\t\t\t\t\t\t\t\t'itemid' => $itemid,\n\t\t\t\t\t\t\t\t'qty' => $quantity['quantity'][0]\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->db->where('number', $medals);\n\t\t\t\t\t$this->db->delete('tblnotused');\n\t\t\t\t\t\n\t\t\t\t\t$data_payment['invoiceid'] = $insert_id;\n\t\t\t\t\t$data_payment['amount'] = $data['subtotal'];\n\t\t\t\t\t$data_payment['paymentmode'] = 1;\n\t\t\t\t\t$data_payment['date'] = $date;\n\t\t\t\t\t$data_payment['daterecorded'] = $date;\n\t\t\t\t\t$data_payment['addedfrom'] = 1;\n\t\t\t\t\t\n\t\t\t\t\t$this->db->insert('tblinvoicepaymentrecords', $data_payment);\n\t\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$POST_data = $_POST;\n\t\t\t\t\n\t\t\t\t//print_r($this->input->post());\n\t\t\t\tunset($POST_data['firstname']);\n\t\t\t\tunset($POST_data['lastname']);\n\t\t\t\tunset($POST_data['email']);\n\t\t\t\tunset($POST_data['phonenumber']);\n\t\t\t\tunset($POST_data['phone_other']);\n\t\t\t\tunset($POST_data['no_civique']);\n\t\t\t\tunset($POST_data['address']);\n\t\t\t\tunset($POST_data['app']);\n\t\t\t\tunset($POST_data['city']);\n\t\t\t\tunset($POST_data['state']);\n\t\t\t\tunset($POST_data['zip']);\n\t\t\t\tunset($POST_data['password']);\n\t\t\t\tunset($POST_data['userid']);\n\n\t\t\t\t\n\t\t\t\tif ($_POST['animal_name2']) {\n\t\t\t\t\t\n\t\t\t\t\t$POST_data2['animal_name'] = $_POST['animal_name2'];\n\t\t\t\t\t$POST_data2['race'] = $_POST['race2'];\n\t\t\t\t\t$POST_data2['color'] = $_POST['color2'];\n\t\t\t\t\t$POST_data2['remarque'] = $_POST['remarque2'];\n\t\t\t\t\t$POST_data2['number'] = $_POST['number2'];\n\t\t\t\t\t$POST_data2['attachment'] = $_POST['attachment2'];\n\t\t\t\t\t$POST_data2['sexe'] = $_POST['sexe2'];\n\t\t\t\t\t$POST_data2['method'] = $_POST['method2'];\n\t\t\t\t\t$POST_data2['rfid'] = $_POST['rfid2'];\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name2']);\n\t\t\t\t\tunset($_POST['race2']);\n\t\t\t\t\tunset($_POST['color2']);\n\t\t\t\t\tunset($_POST['remarque2']);\n\t\t\t\t\tunset($_POST['number2']);\n\t\t\t\t\tunset($_POST['attachment2']);\n\t\t\t\t\tunset($_POST['sexe2']);\n\t\t\t\t\tunset($_POST['method2']);\n\t\t\t\t\tunset($_POST['rfid2']);\n\t\t\t\t\t\n\t\t\t\t\t$POST_data2['date_paid'] = $date;\n\t\t\t\t\t$POST_data2['method'] = $method;\n\t\t\t\t\t\n\t\t\t\t\t$id = $this->contracts_model->add($POST_data2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tunset($POST_data['animal_name2']);\n\t\t\t\t\tunset($POST_data['race2']);\n\t\t\t\t\tunset($POST_data['color2']);\n\t\t\t\t\tunset($POST_data['remarque2']);\n\t\t\t\t\tunset($POST_data['number2']);\n\t\t\t\t\tunset($POST_data['attachment2']);\n\t\t\t\t\tunset($POST_data['sexe2']);\n\t\t\t\t\tunset($POST_data['method2']);\n\t\t\t\t\tunset($POST_data['rfid2']);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif ($_POST['animal_name3']) {\n\t\t\t\t\t\n\t\t\t\t\t$POST_data3['animal_name'] = $_POST['animal_name3'];\n\t\t\t\t\t$POST_data3['race'] = $_POST['race3'];\n\t\t\t\t\t$POST_data3['color'] = $_POST['color3'];\n\t\t\t\t\t$POST_data3['remarque'] = $_POST['remarque3'];\n\t\t\t\t\t$POST_data3['number'] = $_POST['number3'];\n\t\t\t\t\t$POST_data3['attachment'] = $_POST['attachment3'];\n\t\t\t\t\t$POST_data3['sexe'] = $_POST['sexe3'];\n\t\t\t\t\t$POST_data3['method'] = $_POST['method3'];\n\t\t\t\t\t$POST_data3['rfid'] = $_POST['rfid3'];\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name3']);\n\t\t\t\t\tunset($_POST['race3']);\n\t\t\t\t\tunset($_POST['color3']);\n\t\t\t\t\tunset($_POST['remarque3']);\n\t\t\t\t\tunset($_POST['number3']);\n\t\t\t\t\tunset($_POST['attachment3']);\n\t\t\t\t\tunset($_POST['sexe3']);\n\t\t\t\t\tunset($_POST['method3']);\n\t\t\t\t\tunset($_POST['rfid3']);\n\t\t\t\t\t\n\t\t\t\t\t$POST_data3['date_paid'] = $date;\n\t\t\t\t\t$POST_data3['method'] = $method;\n\t\t\t\t\t\n\t\t\t\t\t$id = $this->contracts_model->add($POST_data3);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tunset($POST_data['animal_name3']);\n\t\t\t\t\tunset($POST_data['race3']);\n\t\t\t\t\tunset($POST_data['color3']);\n\t\t\t\t\tunset($POST_data['remarque3']);\n\t\t\t\t\tunset($POST_data['number3']);\n\t\t\t\t\tunset($POST_data['attachment3']);\n\t\t\t\t\tunset($POST_data['sexe3']);\n\t\t\t\t\tunset($POST_data['method3']);\n\t\t\t\t\tunset($POST_data['rfid3']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$POST_data['date_paid'] = $date;\n\t\t\t\t$POST_data['method'] = $method;\n\t\t\t\t\n\t\t\t\t$id = $this->contracts_model->add($POST_data);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($id){\n\t\t\t\t\thandle_contract_attachment($id);\n\t\t\t\t\tset_alert('success', _l('added_successfuly',_l('contract')));\n\t\t\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//echo 'sa';\n\t\t\t\tunset($_POST['firstname']);\n\t\t\t\tunset($_POST['lastname']);\n\t\t\t\tunset($_POST['email']);\n\t\t\t\tunset($_POST['phonenumber']);\n\t\t\t\tunset($_POST['phone_other']);\n\t\t\t\tunset($_POST['no_civique']);\n\t\t\t\tunset($_POST['address']);\n\t\t\t\tunset($_POST['app']);\n\t\t\t\tunset($_POST['city']);\n\t\t\t\tunset($_POST['state']);\n\t\t\t\tunset($_POST['zip']);\n\t\t\t\tunset($_POST['password']);\n\t\t\t\tunset($_POST['userid']);\n\t\t\t\tunset($_POST['animal_name2']);\n\t\t\t\tunset($_POST['race2']);\n\t\t\t\tunset($_POST['color2']);\n\t\t\t\tunset($_POST['remarque2']);\n\t\t\t\tunset($_POST['number2']);\n\t\t\t\tunset($_POST['attachment2']);\n\t\t\t\tunset($_POST['sexe2']);\n\t\t\t\tunset($_POST['method2']);\n\t\t\t\tunset($_POST['rfid2']);\n\t\t\t\tunset($_POST['animal_name3']);\n\t\t\t\tunset($_POST['race3']);\n\t\t\t\tunset($_POST['color3']);\n\t\t\t\tunset($_POST['remarque3']);\n\t\t\t\tunset($_POST['number3']);\n\t\t\t\tunset($_POST['attachment3']);\n\t\t\t\tunset($_POST['sexe3']);\n\t\t\t\tunset($_POST['method3']);\n\t\t\t\tunset($_POST['rfid3']);\n\t\t\t\t\n\t\t\t\t$contract_id = $_POST['edit'];\n\t\t\t\tunset($_POST['edit']);\n\t\t\t\t\n\t\t\t\t//print_r($_POST);\n\t\t\t\t\n\t\t\t\t$this->db->where('userid', $cliendid);\n\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t\n\t\t\t\t$_POST['number'];\n\t\t\t\t\n\t\t\t\t$success = $this->contracts_model->update($_POST, $contract_id);\n\n\t\t\t\tif($success){\n\t\t\t\t\tset_alert('success', _l('updated_successfuly',_l('contract')));\n\t\t\t\t} else {\n\t\t\t\t\tset_alert('warning', 'Numéro déjà utilisé');\n\t\t\t\t}\n\n\t\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t}\n\t\t}\n\n\t\tif($id == ''){\n\t\t\t$title = 'Ajouter nouvelle médaille';\n\t\t} else {\n\t\t\t$data['attachment'] = $this->contracts_model->get_contract_attachment($id);\n\t\t\t$data['contract'] = $this->contracts_model->get($id);\n\t\t\t$this->load->model('payment_modes_model');\n\t\t\t$data['payment_modes'] = $this->payment_modes_model->get();\n\t\t\t$client_id = $data['contract']->client;\n\t\t\t$data['client'] = $this->clients_model->get($client_id);\n\t\t\tif(!$data['contract']){\n\t\t\t\tblank_page(_l('contract_not_found'));\n\t\t\t}\n\t\t\t$title = _l('edit',_l('contract_lowercase'));\n\t\t}\n\t\t\n\t\t$this->load->model('payment_modes_model');\n $data['payment_modes'] = $this->payment_modes_model->get();\n\n\t\t$data['types'] = $this->contracts_model->get_contract_types();\n\t\t$this->load->model('clients_model');\n\t\t$data['clients'] = $this->clients_model->get();\n\t\t$data['title'] = $title;\n\t\t$this->load->view('admin/contracts/contract',$data);\n\t}", "public function update_invoice()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (!empty($_POST)) {\n\t\t\t\t$invoiceNumber = $this->input->post('invoiceNumber');\n\t\t\t\t$tableName = 'master_invoice';\n\t\t\t\t$condition = array('invoice_number' => validateInput($invoiceNumber));\n\t\t\t\t$result = $this->CustomModel->getWhere($tableName, $condition);\n\t\t\t\t$timestamp = date(\"Y-m-d H:i:s\");\n\n\t\t\t\tif ($result > 0) {\n\t\t\t\t\tjson_encode(array('messages' => 'Invoice already exist', 'type' => 'worning'));\n\t\t\t\t} else {\n\t\t\t\t\tif (!empty($_POST)) {\n\t\t\t\t\t\t$productlist = $this->input->post('products');\n\t\t\t\t\t\t$doi = $this->input->post('dateOfinvoice');\n\t\t\t\t\t\t$date = yymmdd($doi);\n\t\t\t\t\t\t$rows = array();\n\t\t\t\t\t\tfor ($i = 0; $i < count($productlist); $i++) {\n\n\t\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t\t'invoice_number' => validateInput($this->input->post('invoiceNumber')),\n\t\t\t\t\t\t\t\t'invoice_date' => $date,\n\t\t\t\t\t\t\t\t'item_code' => validateInput($productlist[$i]['producCode']),\n\t\t\t\t\t\t\t\t'item_description' => validateInput($productlist[$i]['producDetails']),\n\t\t\t\t\t\t\t\t'closing_stock' => $productlist[$i]['productQuantity'],\n\t\t\t\t\t\t\t\t'qty' => $productlist[$i]['productQuantity'],\n\t\t\t\t\t\t\t\t'rate' => $productlist[$i]['productRate'],\n\t\t\t\t\t\t\t\t'amount' => $productlist[$i]['productAmount'],\n\t\t\t\t\t\t\t\t'update_by' => $_SESSION['userInfo']['username'],\n\t\t\t\t\t\t\t\t'last_updated' => $timestamp\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tarray_push($rows, $data);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// print_r($rows);\n\n\t\t\t\t\t\t$tablename = 'london_stock';\n\t\t\t\t\t\t$result = $this->CustomModel->insertBatch($tablename, $rows);\n\t\t\t\t\t\t// print_r($result);\n\t\t\t\t\t\tif ($result > 0) {\n\t\t\t\t\t\t\techo json_encode(array('messages' => 'Invoice submited successfully', 'type' => 'success'));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo json_encode(array('messages' => 'Something went worng please contact IT', 'type' => 'error'));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function updateInvoiceAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CoreShopBundle:Order')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Order entity.');\n }\n\n $editForm = $this->createForm(new OrderInvoiceType(), $entity);\n $request = $this->getRequest();\n $editForm->bind($request);\n\n if ($editForm->isValid()) {\n $entity->setInvoicedAt(new \\DateTime());\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('order'));\n }\n\n return $this->render('CoreShopBundle:Order:editinvoice.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n ));\n }", "public function update(Request $request, InvoicesDetails $invoicesDetails)\n {\n //\n }", "function edit($InvoiceId)\n { \n // check if the invoice exists before trying to edit it\n $data['invoice'] = $this->Invoice_model->get_invoice($InvoiceId);\n \n if(isset($data['invoice']['InvoiceId']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t'BillNo' => $this->input->post('BillNo'),\n\t\t\t\t'PurchaseDate' => $this->input->post('PurchaseDate'),\n\t\t\t\t'PurchaseDateBS' => $this->input->post('PurchaseDateBS'),\n\t\t\t\t'SupplierName' => $this->input->post('SupplierName'),\n\t\t\t\t'SupplierNumber' => $this->input->post('SupplierNumber'),\n\t\t\t\t'SupplierAddress' => $this->input->post('SupplierAddress'),\n\t\t\t\t'Description' => $this->input->post('Description'),\n\t\t\t\t\n );\n $this->Invoice_model->update_invoice($InvoiceId,$params); \n redirect('invoice/index');\n }\n else\n {\n\t\t\t\t $userid = $this->session->userdata('userid');\n\t\t\t\t$data['users'] = $this->User_model->get_user($userid);\n $data['_view'] = 'invoice/edit';\n $this->load->view('layouts/main1',$data);\n }\n }\n else\n show_error('The invoice you are trying to edit does not exist.');\n }", "public function update(UpdateInvoicesRequest $request, $id)\n {\n if (! Gate::allows('invoice_edit')) {\n return abort(401);\n }\n $request = $this->saveFiles($request);\n $invoice = Invoice::findOrFail($id);\n $invoice->update($request->all());\n\n\n $media = [];\n foreach ($request->input('files_id', []) as $index => $id) {\n $model = config('medialibrary.media_model');\n $file = $model::find($id);\n $file->model_id = $invoice->id;\n $file->save();\n $media[] = $file->toArray();\n }\n $invoice->updateMedia($media, 'files');\n\n\n return redirect()->route('admin.invoices.index');\n }", "public function update(Request $request, Invoice $invoice)\n {\n // dd($request->all());\n\n $rules = [\n 'invoice_number' => 'nullable',\n 'invoice_date' => 'required|string',\n 'due_date' => 'required|string',\n 'section_id' => 'required|integer',\n 'product' => 'required|string',\n 'amount_collection' => 'required|regex:/^\\d+(\\.\\d{1,2})?$/',\n 'amount_commission' => 'required|regex:/^\\d+(\\.\\d{1,2})?$/',\n 'discount' => 'nullable|regex:/^\\d+(\\.\\d{1,2})?$/',\n 'rat_vat' => 'required|integer',\n 'value_vat' => 'required|regex:/^\\d+(\\.\\d{1,2})?$/',\n 'total' => 'required|regex:/^\\d+(\\.\\d{1,2})?$/',\n \"payment_date\" => 'nullable|string',\n 'note' => 'nullable|string|max:500',\n ];\n\n $niceNames = [\n 'invoice_number' => 'رقم الفاتورة',\n 'invoice_date' => 'تاريخ الفاتورة',\n 'due_date' => 'تاريخ الاستحقاق',\n 'section_id' => 'القسم',\n 'product' => 'المنتج',\n 'amount_collection' => 'مبلغ التحصيل',\n 'amount_commission' => 'مبلغ العمولة',\n 'discount' => 'الخصم',\n 'rat_vat' => 'نسبة ضريبة القيمة المضافة',\n 'value_vat' => 'قيمة ضريبة القيمة المضافة',\n 'total' => 'الاجمالي شامل الضريبة',\n 'payment_date' => 'تاريخ الدفع',\n 'note' => 'الملاحظات',\n ];\n\n $data = $this->validate($request, $rules, [], $niceNames);\n\n // Exception of the invoice number because I created a file with that number in the attachments Storage\n // not change the number\n Arr::except($data, ['invoice_number']);\n\n // invoice_status() return status from helper file\n $stats = $request->value_status;\n $data[\"status\"] = invoice_status()[$stats];\n $data[\"value_status\"] = $stats;\n\n // update invoice\n $invoice->fill($data)->save();\n\n // update invoice details table\n // history invoice details table (invoices_details)\n $details = new InvoiceDetails();\n $details->id_invoice = $invoice->id;\n $details->invoice_number = $invoice->invoice_number;\n $details->product = $invoice->product;\n $details->section_id = $invoice->section_id;\n $details->status = $data['status'];\n $details->value_status = $data['value_status'];\n $details->note = $invoice->note;\n $details->user = auth()->user()->name;\n $details->payment_date = $invoice->payment_date;\n $details->save();\n\n // add notification in the dashboard\n // show notification for all users has permission to show notifications\n // not show notification for user added update invoice\n\n $users = User::where('id', \"!=\", auth()->user()->id)->get();\n $details = [\n \"invoice_id\" => $invoice->id,\n \"archive_url\"=>null,\n \"added_by\" => auth()->user()->name,\n \"msg\" => 'قام <span class=\"badge badge-pill badge-info\">' . auth()->user()->name . '</span> بتعديل فاتورة',\n ];\n Notification::send($users, new add_invoice_notification($details));\n\n $request->session()->flash('msgSuccess', \"تم تعديل الفاتورة بنجاح\");\n return redirect(adminUrl(\"invoices/\" . $invoice->id));\n\n }", "public function update(UpdateInvoicesRequest $request, $id)\n {\n if (! Gate::allows('invoice_edit')) {\n return abort(401);\n }\n $invoice = Invoice::findOrFail($id);\n $invoice->update($request->all());\n\n return redirect()->route('invoices.index');\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ClientInvoice']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ClientInvoice'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function updateItem(ItemRequest $request,$id)\n {\n \n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $modelline = \\backend\\models\\Purchaseorderline::find()->where(['purchase_order_id'=>$id])->all();\n if ($model->load(Yii::$app->request->post())) {\n $prodid = Yii::$app->request->post('product_id');\n $qty = Yii::$app->request->post('qty');\n $price = Yii::$app->request->post('price');\n $lineamt = Yii::$app->request->post('line_amount');\n\n $model->purchase_date = strtotime($model->purchase_date);\n if($model->save()){\n \\backend\\models\\Purchaseorderline::deleteAll(['purchase_order_id'=>$id]);\n if(count($prodid)>0){\n for($i=0;$i<=count($prodid)-1;$i++){\n $modelline = new \\backend\\models\\Purchaseorderline();\n $modelline->purchase_order_id = $model->id;\n $modelline->product_id = $prodid[$i];\n $modelline->qty = $qty[$i];\n $modelline->price = $price[$i];\n $modelline->line_amount=$lineamt[$i];\n $modelline->save(false);\n }\n }\n $this->updateAmount($id);\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('update', [\n 'model' => $model,\n 'modelline' => $modelline,\n ]);\n }", "public function addItem($invoice_id) {\n\t\t$quantity = Request::input('quantity');\n\t\t$item_id = Request::input('item_id');\n\n\t\t$initSelect = DB::select('SELECT * \n\t\t\tFROM invoice_item\n\t\t\tWHERE item_id = :item_id\n\t\t\tAND invoice_id = :invoice_id',\n\t\t\tarray(\n\t\t\t\t':item_id' => $item_id,\n\t\t\t\t':invoice_id' => $invoice_id));\n\n\t\tif ($initSelect) {\n\t\t\t$previousQTY = $initSelect[0]->quantity;\n\t\t\t$sql = DB::update( \"UPDATE invoice_item \n\t\t\t\t\tSET quantity= :quantity\n\t\t\t\t\tWHERE item_id = :item_id\n\t\t\t\t\tAND invoice_id = :invoice_id\",\n\t\t\t\tarray(\n\t\t\t\t\t':item_id' => $item_id,\n\t\t\t\t\t':invoice_id' => $invoice_id,\n\t\t\t\t\t':quantity' => ($quantity + $previousQTY)));\n\t\t} else {\n\t\t\techo 'insert new . . . . ';\n\t\t\t$sql = DB::insert(\n\t\t\t\t\t'INSERT INTO invoice_item ( `invoice_id`, `item_id`, `quantity`) \n\t\t\t\t\tVALUES ( :invoice_id, :item_id, :quantity)',\n\t\t\t\tarray(\n\t\t\t\t\t':invoice_id' => $invoice_id,\n\t\t\t\t\t':item_id' => $item_id,\n\t\t\t\t\t':quantity' => $quantity));\n\t\t}\n\n\t\treturn redirect('invoices/details/' . $invoice_id);\n\t}", "public function update(Request $request, $id)\n {\n $input = $request->all();\n\n $validator = Validator::make($input, [\n 'invoices_no' => 'required',\n /*'dot' => 'required|before_or_equal:'.date('Y-m-d')],[\n 'dot.before_or_equal' => 'Please set the date to today or before'*/\n ]);\n\n if ($validator->fails())\n { //dd($validator);\n return redirect('bpenb/'.$id.'/edit')->withInput()->withErrors($validator); }\n else\n {\n $inv = Bpenb::findOrFail($id);\n $inv->invoices_no = $input['invoices_no'];\n $inv->bank = $input['bank'];\n $inv->pay_from = $input['pay_from'];\n $inv->given_by = $input['given_by'];\n $inv->dot = $input['dot'];\n $inv->nominal = $input['nominals'];\n $inv->user_id = $input['user_id'];\n $inv->aiw = $input['aiw'];\n $inv->memo = $input['memo'];\n $inv->save();\n\n if($input['iddet'] != 0 && $input['iddet'] != \"\") {\n $iddet = explode(\"|\", $input['iddet'], -1);\n foreach ($iddet as $i) {\n BpenbDetail::where('id',$i)->update(['id_bpenb' => $inv->id]);\n }\n }\n\n if($request->submitbutton == 'saveprint') {\n //DB::table('invoices')->where('invoices_no',$input['invoices_no'])->update(['status' => 'p']);\n $invid = Bpenb::where('id',$inv->id)->value('id');\n return view('bpenb.print',compact('invid'));\n }\n\n Session::flash('flash_message','Bank In Transaction updated');\n return redirect('bpenb');\n }\n }", "public function edit(InvoicesDetails $invoicesDetails)\n {\n //\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n $criteria=new CDbCriteria;\n $criteria->condition='invoice_id=:invoice_id';\n $criteria->params=array(':invoice_id'=>$id);\n\n $products = InvoicesProducts::model()->findAll($criteria);\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['ChecksInvoices']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ChecksInvoices'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('index'));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n 'products'=>$products,\n\t\t));\n\t}", "public function update(Request $request, $id)\n {\n\n $Item =Payments::find($id);\n\n $Item->employee_id = $request->input('employee_id');\n $Item->pension_fund_id = $request->input('pension_fund_id');\n $Item->amount = $request->input('amount');\n $Item->internal_receipt_number = $request->input('internal_receipt_number');\n $Item->pension_receipt_number = $request->input('pension_receipt_number');\n $Item->pension_payment_date = $request->input('internal_payment_date');\n\n $Item->save();\n }", "public function update(Invoices $model, UpdateInvoice $request): JsonResponse\n {\n return $this->doUpdate($model, $request);\n }", "public function updateItem( $id, $preparedItem ) {\n\t}", "public function update(UpdateInvoiceRequest $request, $id)\n {\n $invoice = $this->invoice\n ->with('invoiceItems')\n ->findOrFail($id);\n\n $invoice->update($request->get('invoice'));\n\n // set invoice items\n\n $this->syncInvoiceItems($invoice, $request);\n\n // sync deleted items\n\n $this->syncDeletedItems($invoice, $request);\n\n // set status\n\n $this->setInvoiceStatus($invoice, $request);\n\n // do something if form is SUBMITTED instead of SAVE\n\n $this->doSomethingIfSubmit($invoice, $request);\n\n $invoice->refresh();\n\n return new InvoiceResource($invoice);\n }", "public function updateItem($itemid, $itemcode, $itemname, $itemtype, $prices, $pricem, $pricel, $image, $itemsettings){\n\t\tglobal $db;\n\t\t$sql = \"SELECT * FROM `\".TBL_ITEMS.\"` WHERE `itemid` = '$itemid'\";\n\t\t$record = $db->query_first($sql);\t\n\t\tif($record)\t{ \n\t\t\t$data['itemcode']= $itemcode ;\n\t\t\t$data['itemname']= $itemname ;\n\t\t\t$data['itemtype']= $itemtype ;\n\t\t\t$data['prices']= $prices ;\n\t\t\t$data['pricem']= $pricem ;\n\t\t\t$data['pricel']= $pricel ;\n\t\t\t$data['image']= $image ;\n\t\t\t$data['itemsettings']= $itemsettings ;\t\t\t\n\t\t\t$db->update(TBL_ITEMS, $data, \"`itemid` = $itemid\");\n\t\t\t$message['text'] = __('Item Updated successfully');\n\t\t\treturn $message;\n\t\t\t}\n\t\telse\n\t\t\treturn addNewItem( $itemcode, $itemname, $itemtype, $prices, $pricem, $pricel, $image, $itemsettings);\t\t\n\t}", "public function update(Request $request, $id)\n {\n //\n $invoice = Invoice::findOrFail($id);\n $invoice->update($request->all());\n return redirect('finance/invoice');\n }", "public function updateInventory(){\n//\t\t$this->ddd($this->request->data);\n\t\t\textract($this->request->data);\n\t\t\t$customerUserId = $this->Item->discoverCustomerUserId($itemId);\n\t\t\t//this->request->data contains\n\t\t\t//array(\n\t\t\t//\t'pullQty' => '1',\n\t\t\t//\t'itemId' => '90',\n\t\t\t//\t'rowId' => '52d08471-8838-4330-b765-00ed47139427',\n\t\t\t//\t'onHand' => 'undefined',\n\t\t\t//\t'mode' => 'pull'\n\t\t\t//)\n\t\t\t//setup return array\n\t\t\t$returnArray['rowId'] = '#row-'. $rowId;\n\n\t\t\t//update the orderItem pull status, conditionally\n\t\t\tif ($mode == 'pull') {\n\t\t\t\t$onHand = $this->updateKitInventory();\n\t\t\t\t$pullFlag = ($pullQty > 0) ? 0 : 1;\n\t\t\t\t$this->Item->OrderItem->id = $rowId;\n\t\t\t\t$this->Item->OrderItem->saveField('pulled', $pullFlag);\n\t\t\t\t$orderNumber = $this->Item->OrderItem->pullOrderNumber($rowId);\n\t\t\t} else {\n\t\t\t\t$pullFlag = ($pullQty < 0) ? 0 : 1;\n\t\t\t\t$this->Item->ReplenishmentItem->id = $rowId;\n\t\t\t\t$this->Item->ReplenishmentItem->saveField('pulled', $pullFlag);\n\t\t\t\t$orderNumber = $this->Item->ReplenishmentItem->pullOrderNumber($rowId);\n\t\t\t}\n\t\t\t//validate the inventory change and handle onHand changes\n\t\t\t$success = $this->validateInventoryChange($itemId, $pullQty, $onHand);\n\n\t\t\t//if validation succeeds, proceed ($this->itemRecord set by validate method)\n\t\t\tif ($success) {\n\t\t\t\t$origQty = $this->itemRecord['Item']['quantity'];\n\n\t\t\t\t$this->itemRecord['Item']['quantity'] = $newQty = $this->calculateItemQuantity($this->request->data);\n\n//\t\t$this->ddd($this->itemRecord, 'itemRecord');\n//\t\tdie;\n\n\t\t\t\tif ($this->Item->save($this->itemRecord)) {\n\t\t\t\t\t$returnArray['item'] = $this->itemRecord;\n\t\t\t\t} else {\n\t\t\t\t\t$returnArray['item'] = false;\n\t\t\t\t}\n\t\t\t\t$itemId = $this->itemRecord['Item']['id'];\n//\t\t\t\t$itemName = $this->itemRecord['Item']['name'];\n\t\t\t\t\n\t\t\t\t$this->Log->create('adjustment');\n\t\t\t\t$this->Log\n\t\t\t\t\t->set('customer', $customerUserId)\n\t\t\t\t\t->set('id', $itemId)\n\t\t\t\t\t->set('name', $this->itemRecord['Item']['name'])\n\t\t\t\t\t->set('from', $origQty)\n\t\t\t\t\t->set('to', $newQty)\n\t\t\t\t\t->set('change', $newQty-$origQty)\n\t\t\t\t\t->set('number', $orderNumber)\n\t\t\t\t\t->set('by', $this->Item->OrderItem->Order->User->discoverName($this->Auth->user('id')));\n\t\t\t\t$this->Log->toString();\n\t\t\t\tCakeLog::write('inventory', $this->Log->logLineOut);\n//\t\t\t\tCakeLog::write('inventory', \"[$customerUserId] Inventory adjustment of id:$itemId::$itemName from $origQty to $newQty ($pullQty) by \" . $this->Item->OrderItem->Order->User->discoverName($this->Auth->user('id')));\n\n\t\t\t\tif ($mode = 'replenishment') {\n\t\t\t\t\tarray_merge($returnArray, $this->Item->manageUncommitted($itemId));\n\t\t\t\t\tarray_merge($returnArray, $this->Item->managePendingQty($itemId));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$returnArray['item'] = false;\n\t\t\t}\n\t\t\t$returnArray['error'] = $this->error;\n $this->autoRender = false;\n\t\t\techo json_encode($returnArray);\n }", "public function invoice($id = '')\r\n {\r\n if (!has_permission('invoices', '', 'view') && !has_permission('invoices', '', 'view_own')) {\r\n access_denied('invoices');\r\n }\r\n if ($this->input->post()) {\r\n $invoice_data = $this->input->post(NULL, FALSE);\r\n if ($id == '') {\r\n if (!has_permission('invoices', '', 'create')) {\r\n access_denied('invoices');\r\n }\r\n $id = $this->invoices_model->add($invoice_data);\r\n if ($id) {\r\n set_alert('success', _l('added_successfuly', _l('invoice')));\r\n redirect(admin_url('invoices/list_invoices/' . $id));\r\n }\r\n } else {\r\n if (!has_permission('invoices', '', 'edit')) {\r\n access_denied('invoices');\r\n }\r\n $success = $this->invoices_model->update($invoice_data, $id);\r\n if ($success) {\r\n set_alert('success', _l('updated_successfuly', _l('invoice')));\r\n }\r\n redirect(admin_url('invoices/list_invoices/' . $id));\r\n }\r\n }\r\n if ($id == '') {\r\n $title = _l('create_new_invoice');\r\n $data['billable_tasks'] = array();\r\n } else {\r\n $invoice = $this->invoices_model->get($id);\r\n\r\n if (!$invoice || (!has_permission('invoices', '', 'view') && $invoice->addedfrom != get_staff_user_id())) {\r\n blank_page(_l('invoice_not_found'), 'danger');\r\n }\r\n\r\n $data['invoices_to_merge'] = $this->invoices_model->check_for_merge_invoice($invoice->clientid, $invoice->id);\r\n $data['expenses_to_bill'] = $this->invoices_model->get_expenses_to_bill($invoice->clientid);\r\n $data['invoice_recurring_invoices'] = $this->invoices_model->get_invoice_recuring_invoices($id);\r\n\r\n $data['invoice'] = $invoice;\r\n $data['edit'] = true;\r\n $data['billable_tasks'] = $this->tasks_model->get_billable_tasks($invoice->clientid);\r\n $title = _l('edit', _l('invoice_lowercase')) . ' - ' . format_invoice_number($invoice->id);\r\n }\r\n if ($this->input->get('customer_id')) {\r\n $data['customer_id'] = $this->input->get('customer_id');\r\n $data['do_not_auto_toggle'] = true;\r\n }\r\n\r\n $this->load->model('payment_modes_model');\r\n $data['payment_modes'] = $this->payment_modes_model->get('', array(\r\n 'expenses_only !=' => 1\r\n ));\r\n $this->load->model('taxes_model');\r\n $data['taxes'] = $this->taxes_model->get();\r\n $this->load->model('invoice_items_model');\r\n $data['items'] = $this->invoice_items_model->get_grouped();\r\n $data['items_groups'] = $this->invoice_items_model->get_groups();\r\n\r\n $this->load->model('currencies_model');\r\n $data['currencies'] = $this->currencies_model->get();\r\n\r\n $where_clients = 'tblclients.active=1';\r\n\r\n if (!has_permission('customers', '', 'view')) {\r\n $where_clients .= ' AND tblclients.userid IN (SELECT customer_id FROM tblcustomeradmins WHERE staff_id=' . get_staff_user_id() . ')';\r\n }\r\n\r\n $data['clients'] = $this->clients_model->get('', $where_clients);\r\n if ($id != '') {\r\n if (total_rows('tblclients', array(\r\n 'active' => 0,\r\n 'userid' => $data['invoice']->clientid\r\n )) > 0 || (total_rows('tblcustomeradmins', array(\r\n 'staff_id' => get_staff_user_id(),\r\n 'customer_id' => $data['invoice']->clientid\r\n )) == 0 && !has_permission('customers', '', 'view'))) {\r\n $data['clients'][] = $this->clients_model->get($data['invoice']->clientid, array(), 'row_array');\r\n }\r\n }\r\n\r\n $data['projects'] = array();\r\n if ($id != '' || isset($data['customer_id'])) {\r\n\r\n $where = '';\r\n $where_customer_id = (isset($data['customer_id']) ? $data['customer_id'] : $invoice->clientid);\r\n $where .= 'clientid=' . $where_customer_id;\r\n\r\n if (!has_permission('projects', '', 'view')) {\r\n $where .= ' AND id IN (SELECT project_id FROM tblprojectmembers WHERE staff_id=' . get_staff_user_id() . ')';\r\n }\r\n\r\n $data['projects'] = $this->projects_model->get('', $where);\r\n\r\n if ($id != '' && $data['invoice']->project_id != 0) {\r\n if (total_rows('tblprojectmembers', array(\r\n 'staff_id' => get_staff_user_id(),\r\n 'project_id' => $data['invoice']->project_id\r\n )) == 0 && !has_permission('projects', '', 'view')) {\r\n $this->db->where('id', $data['invoice']->project_id);\r\n $data['projects'][] = $this->db->get('tblprojects')->row_array();\r\n }\r\n }\r\n }\r\n\r\n $data['staff'] = $this->staff_model->get('', 1);\r\n $data['title'] = $title;\r\n $data['bodyclass'] = 'invoice';\r\n $data['accounting_assets'] = true;\r\n $this->load->view('admin/invoices/invoice', $data);\r\n }", "public function copyMemoInvoiceItem($invoice_item_id, $new_invoice_id) {\r\n\t\t$this->db->from('invoice_items');\r\n\t\t$this->db->where('invoice_item_id', $invoice_item_id);\r\n\t\t$item = array();\r\n\t\t$query = $this->db->get();\r\n\t\tif($query->num_rows() > 0) {\r\n\t\t\tforeach($query->result_array() as $row) {\r\n\t\t\t\t$item = $row; //get all data\r\n\t\t\t}\r\n\t\t\tunset($item['invoice_item_id']); //remove invoice_item_id, causes index expection\r\n\t\t\t$item['item_status'] = 0; //make status 0=normal\r\n\t\t\t$item['invoice_id'] = $new_invoice_id; //update invoice_id to reflect the new invoice id\r\n\t\t\t$new_invoice_item_id = $this->db->insert('invoice_items', $item);\r\n\t\t}\r\n\t\t\r\n\t\treturn $new_invoice_item_id; //int\r\n\t}", "public function edit(ImportInvoice $importInvoice)\n {\n //\n }", "public function updateItem($_id) {\n\t}", "public function update($cartItemId)\n {\n // exit('thre');\n // echo \"<pre>\"; print_r($_REQUEST); exit('outt');\n // echo \"<pre>\"; print_r($cartItemId); exit('out');\n Cart::updateQuantity(decrypt($cartItemId), request('qty'));\n\n try {\n resolve(Pipeline::class)\n ->send(Cart::coupon())\n ->through($this->checkers)\n ->thenReturn();\n } catch (MinimumSpendException | MaximumSpendException $e) {\n Cart::removeOldCoupon();\n }\n\n // Cart\n\n if($_REQUEST['_method'] == 'put' && isset($_REQUEST['advance_options']) ){\n\n // echo \"<pre>\"; print_r($_REQUEST); exit('thy');\n\n Cart::remove(decrypt($_REQUEST['cart_item_id'])); //self::destory($_REQUEST['cart_item_id'], 'update');\n\n // advance_options\n $_REQUEST['advance_options']['product_id'] = $_REQUEST['product_id'];\n\n $res = Cart::store($_REQUEST['product_id'], 1,[], $_REQUEST['advance_options']);\n\n }\n\n return back()->withSuccess(trans('cart::messages.quantity_updated'));\n }", "public function update(Request $request, $id)\n {\n $po = Purchaseorder::findOrFail($id);\n if(Input::get(\"vat\")==1){\n $vat = SetValue::where('id','=',11)->where('status','=',1)->value('value');\n $po->vat = $vat;\n }else{\n $po->vat =0;\n }\n if(Input::get(\"diposit\")!=''){\n $po->diposit = Input::get(\"diposit\");\n }else{\n $po->diposit =0;\n }\n if(Input::get(\"rate\")!=''){\n $po->rate= Input::get(\"rate\");\n }else{\n $po->rate=0;\n }\n $po->printedBy = Auth::user()->id; \n $po->save();\n return redirect()->route('invoicePO.index');\n }", "public function update(Request $request, $id)\n {\n\n\n\n request()->validate([\n\n 'year' => 'required',\n 'number' => 'required',\n 'parts' => 'required',\n 'object' => 'required',\n 'kindofservice' => 'required',\n 'source' => 'required',\n 'signature' => 'required|date_format:d/m/Y',\n 'validity' => 'required|date_format:d/m/Y',\n 'value' => 'required', \n 'notify' => 'required' \n\n ]);\n\n $dataForm = $request->all();\n\n\n $dataForm['signature'] = Carbon::createFromFormat('d/m/Y', $dataForm['signature']);\n\n\n\n $dataForm['validity'] = Carbon::createFromFormat('d/m/Y', $dataForm['validity']);\n\n $contract = Contract::find($id);\n \n $update = $contract->update($dataForm);\n \n if($update)\n return redirect()->route('contracts.index');\n else \n return redirect()->route('contracts.edit',$id)\n ->with(['errors' => 'não foi possivel atualizar o item']);\n }", "function update_itinerary($pid) {\n $i_trip_name = $_POST['trip_name'];\n $i_region_name = $_POST['region_name'];\n $i_price_include = $_POST['price_include'];\n $i_price_exclude = $_POST['price_exclude'];\n $i_equipment = $_POST['equipment'];\n $i_itinerary_detail = $_POST['itinerary_detail'];\n $i_faqs = $_POST['faqs'];\n $i_highlight = $_POST['highlight'];\n $i_video_link = $_POST['video_link'];\n $sql = \"UPDATE itinerary SET trip_id='$i_trip_name',region_id='$i_region_name',price_include='$i_price_include',price_exclude='$i_price_exclude',equipment='$i_equipment',itinerary_detail='$i_itinerary_detail',faqs='$i_faqs',\n\t\t\thighlight='$i_highlight',video_link='$i_video_link' WHERE id='$pid'\";\n $this->mysqli->query($sql);\n if ($this->mysqli->error) {\n echo $this->mysqli->error;\n } else {\n echo \"<script type='text/javascript'>alert('Itinerary updated successfully')</script>\";\n }\n }" ]
[ "0.70268726", "0.6774345", "0.6762693", "0.6693968", "0.6677161", "0.66056716", "0.65358084", "0.65308124", "0.6510503", "0.64811516", "0.64772123", "0.6472973", "0.63481575", "0.6290634", "0.6236428", "0.6216566", "0.6215559", "0.6207837", "0.61924034", "0.6183036", "0.61649865", "0.615542", "0.61387986", "0.61387986", "0.61387986", "0.61387986", "0.61387986", "0.61387986", "0.61387986", "0.61387986", "0.61387986", "0.61387986", "0.61380947", "0.61241597", "0.6105689", "0.6082507", "0.6082507", "0.6082507", "0.6082507", "0.6082507", "0.6082507", "0.6082507", "0.6082507", "0.60632944", "0.6026382", "0.6007769", "0.59861255", "0.5976344", "0.5969551", "0.59601796", "0.59533054", "0.5926146", "0.58991647", "0.58962786", "0.5894972", "0.5879051", "0.58740973", "0.5871907", "0.58717906", "0.58613276", "0.58542484", "0.5845639", "0.5840355", "0.5829967", "0.5827924", "0.580636", "0.57660794", "0.57634395", "0.5760959", "0.57471555", "0.57434875", "0.57416326", "0.5741591", "0.57335186", "0.57076514", "0.57075316", "0.5702994", "0.56945527", "0.5691647", "0.565623", "0.56445795", "0.56089216", "0.56064343", "0.5594422", "0.5588122", "0.55777454", "0.5575966", "0.5572486", "0.5557842", "0.55478585", "0.55331135", "0.55310917", "0.553004", "0.5528378", "0.55266404", "0.55256754", "0.55246353", "0.55221826", "0.5520478", "0.5520263" ]
0.65201837
8
This command is used to add a payment to an invoice. Parameters: nvoiceid should contact the ID number of the invoice to add the payment to transid should contain the transaction number for the payment gateway should contain the gateway used in system name format, eg. paypal, authorize, etc... Optional Parameters: amount should contact the amount paid, can be left blank to take full amount of invoice fees if set defines how much fees were involved in the transaction noemail set to true to not send an email for the invoice payment date if set defines the date the payment was made Format: YYYYMMDD HH:mm:ss See:
public function whmcs_add_invoice_payment($params = array()) { $params['action'] = 'AddInvoicePayment'; // return Whmcs_base::send_request($params); $load = new Whmcs_base(); return $load->send_request($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function addInvoice($money, $options)\n {\n $this->post['amount'] = $this->amount($money / 100);\n $this->post['currency'] = self::$default_currency;\n $this->post['description'] = $options['description'];\n }", "public function _add()\n {\n $type_code = post_param_string('type_code');\n $object = find_product($type_code);\n\n $amount = post_param_string('amount', '');\n if ($amount == '') {\n $products = $object->get_products(false, $type_code);\n $amount = $products[$type_code][1];\n if ($amount == '?') {\n warn_exit(do_lang_tempcode('INVOICE_REQUIRED_AMOUNT'));\n }\n }\n\n $to = post_param_string('to');\n $member_id = $GLOBALS['FORUM_DRIVER']->get_member_from_username($to);\n if (is_null($member_id)) {\n warn_exit(do_lang_tempcode('_MEMBER_NO_EXIST', escape_html($to)));\n }\n\n $id = $GLOBALS['SITE_DB']->query_insert('invoices', array(\n 'i_type_code' => $type_code,\n 'i_member_id' => $member_id,\n 'i_state' => 'new',\n 'i_amount' => $amount,\n 'i_special' => post_param_string('special'),\n 'i_time' => time(),\n 'i_note' => post_param_string('note')\n ), true);\n\n log_it('CREATE_INVOICE', strval($id), $type_code);\n\n send_invoice_notification($member_id, $id);\n\n $url = build_url(array('page' => '_SELF', 'type' => 'outstanding'), '_SELF');\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }", "public function sendInvoice(string|int $chat_id, int $amount, string $description, string $currency = \"IRR\");", "public function createPayment()\n\t{\n\n\t}", "function payment($userid = 0, $invoiceid = 0, $invoicetype = 'subscription', $amount = 0, $method = 'account', $gateway = '', $gatewaytxn = '', $isrefund = false, $originalgatewaytxn = '', $silentmode = false)\n {\n global $ilance, $show, $phrase, $page_title, $area_title, $ilconfig, $ilpage;\n\t\t$selectextrafields = '';\n\n ($apihook = $ilance->api('process_debit_payment_start')) ? eval($apihook) : false;\n \n // #### INSTANT PAYMENT NOTIFICATION HANDLER ###########################\n if ($method == 'ipn')\n {\n $sql = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, isenhancementfee, transactionid, projectid\" . $selectextrafields. \"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"',\n paymethod = '\" . $ilance->db->escape_string($gateway) . \"',\n custommessage = '\" . $ilance->db->escape_string($gatewaytxn) . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n if ($res_invoice['isif'] == '1')\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '1' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '0' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" , featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n }\n else if ($res_invoice['isenhancementfee'] == '1')\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isifpaid', $res_invoice['projectid']) == '1' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isifpaid', $res_invoice['projectid']) == '0' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n } \n else if ($res_invoice['isfvf'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['isescrowfee'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n \n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_ipn_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND orderid = '\" . $res_invoice['buynowid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n $resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC);\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => fetch_user('username', intval($userid)),\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n $ilance->email->send();\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->send();\n return true;\n }\n return false;\n }\n // #### ONLINE ACCOUNT HANDLER #########################################\n else if ($method == 'account')\n {\n $sql_balance = $ilance->db->query(\"\n\t\t\t\tSELECT available_balance, total_balance\n\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\tWHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_balance) > 0)\n {\n $res_balance = $ilance->db->fetch_array($sql_balance, DB_ASSOC);\n if ($res_balance['available_balance'] >= $amount)\n {\n $avail_balance = $res_balance['available_balance'];\n $total_balance = $res_balance['total_balance'];\n $avail_balance_after = ($avail_balance - $amount);\n $total_balance_after = ($total_balance - $amount);\n $sql_invoice = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, transactionid, isenhancementfee\" . $selectextrafields .\"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_invoice) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql_invoice, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND invoicetype = '\" . $ilance->db->escape_string($invoicetype) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"users\n SET available_balance = '\" . $ilance->db->escape_string($avail_balance_after) . \"',\n total_balance = '\" . $ilance->db->escape_string($total_balance_after) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($res_invoice['isif'])\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isenhancementfeepaid, enhancementfeeinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isenhancementfeepaid'] == '1' AND $res['enhancementfeeinvoiceid'] != '0') OR ($res['isenhancementfeepaid'] == '0' AND $res['enhancementfeeinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isenhancementfee'])\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isifpaid, ifinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isifpaid'] == '1' AND $res['ifinvoiceid'] != '0') OR ($res['isifpaid'] == '0' AND $res['ifinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isfvf'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n if ($res_invoice['isescrowfee'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_account_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT orderid, escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n while ($resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC))\n {\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => $_SESSION['ilancedata']['user']['username'],\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n $ilance->email->mail = $_SESSION['ilancedata']['user']['email'];\n $ilance->email->slng = $_SESSION['ilancedata']['user']['slng'];\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n if ($silentmode)\n {\n return true;\n }\n $area_title = '{_invoice_payment_complete_menu}';\n $page_title = SITE_NAME . ' - {_invoice_payment_complete_menu}';\n print_notice('{_invoice_payment_complete}', '{_your_invoice_has_been_paid_in_full}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n $page_title = SITE_NAME . ' - {_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n print_notice('{_invoice_error}', '{_were_sorry_this_invoice_does_not_exist}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_funds_not_available}';\n $page_title = SITE_NAME . ' - {_funds_not_available}';\n print_notice('{_invoice_payment_warning_insufficient_funds}', '{_were_sorry_this_invoice_can_not_be_paid_due_to_insufficient_funds}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n }\n return false;\n }", "function add_payment_pr($data){\n\t\tif($this->check_money($data['Clientpayment']['amount'])){\n\t\t\t\t$this->do_pr_invoice($data);\n\t\t}\n\t}", "public function AddTransaction($options = array()){\n if( !isset($options['currency1']) ){\n $options['currency1'] = $options['currency'];\n }\n if( !isset($options['currency2']) ){\n $options['currency2'] = $options['currency1'];\n }\n\n return $this->api->CreateComplexTransaction(\n $options['amount'],\n $options['currency1'],\n $options['currency2'],\n $options['buyer_email'],\n $options['address'],\n $options['buyer_name'],\n $options['item_name'],\n $options['item_number'],\n $options['invoice'],\n $options['custom'],\n $options['ipn_url']\n );\n }", "public function add_invoice()\n\t{\n\t\t$invoice_number = $this->create_invoice_number();\n\t\t\n\t\t$data = array(\n\t\t\t\t'invoice_number'=>$invoice_number,\n\t\t\t\t'user_id'=>$this->input->post('user_id'),\n\t\t\t\t'payment_method'=>$this->input->post('payment_method'),\n\t\t\t\t'invoice_status'=>1,\n\t\t\t\t'invoice_instructions'=>$this->input->post('invoice_instructions'),\n\t\t\t\t'created'=>date('Y-m-d H:i:s'),\n\t\t\t\t'created_by'=>$this->session->userdata('user_id'),\n\t\t\t\t'modified_by'=>$this->session->userdata('user_id')\n\t\t\t);\n\t\t\t\n\t\tif($this->db->insert('invoice', $data))\n\t\t{\n\t\t\treturn $this->db->insert_id();\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function insert_payment($amount_paid, $or_number, $date_paid, $vID, $iID)\r\n\t{\r\n\t\t$this->my_session_start();\r\n\t\t$id = $_SESSION['admin_logged_in'];\r\n\t\t$status = 2;\r\n\t\t$sql = \"INSERT INTO tbl_payment(amount_paid, or_number, date_paid, violation_id, vehicle_id, accounting_officer)\r\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?);\r\n\t\t\";\r\n\t\t$sql2= \"UPDATE tbl_violations\r\n\t\t\t\tSET status = ?\r\n\t\t\t\tWHERE violation_id = ?;\r\n\t\t\";\r\n\t\t$this->Begin();\r\n\t\t \t$this->insertRow($sql, [$amount_paid, $or_number, $date_paid, $vID, $iID, $id]);\r\n\t\t \t$this->updateRow($sql2, [$status, $vID]);\r\n\t\t$this->Commit();\r\n\t \treturn true;\r\n\t}", "function pay() {\n if($this->active_invoice->isLoaded()) {\n\n if($this->request->isSubmitted()) {\n try {\n $payment_data = $this->request->post('payment');\n $payment_gateway_id = $this->request->post('payment_gateway_id');\n\n $payment_data['payment_gateway_id'] = $payment_gateway_id;\n\n $payer_email = $payment_data['payer_email'];\n if($payer_email && is_valid_email($payer_email)) {\n $payer = Users::findByEmail($payer_email);\n if(!$payer instanceof User) {\n $payer = new AnonymousUser($payer_email, $payer_email);\n } //if\n } //if\n\n if(!$payer instanceof IUser) {\n throw new Error('Please enter valid Email address');\n } //if\n\n $this->response->assign(array(\n 'payment_data'\t=> $payment_data,\n ));\n\n $cc_number = trim($payment_data['credit_card_number']);\n if($cc_number) {\n $response = is_valid_cc($cc_number);\n if($response !== true) {\n throw new Error($response);\n }//if\n }//if\n\n $payment_data['amount'] = str_replace(\",\",\"\",$payment_data['amount']);\n\n if(!is_numeric($payment_data['amount'])) {\n throw new Error('Total amount must be numeric value');\n }//if\n\n //check if this payment can proceed\n $this->active_invoice->payments()->canMarkAsPaid($payment_data['amount']);\n\n DB::beginWork('Creating new payment @ ' . __CLASS__);\n\n if($payment_gateway_id && $payment_gateway_id > 0) {\n $active_payment_gateway = PaymentGateways::findById($payment_gateway_id);\n if(!$active_payment_gateway instanceof PaymentGateway) {\n $this->response->notFound();\n }//if\n } else {\n throw new Error('Please select preferred payment option');\n }//if\n\n //if this method exists, please check is all necessery extension loaded\n if(method_exists($active_payment_gateway, 'checkEnvironment')) {\n $active_payment_gateway->checkEnvironment();\n }//if\n\n $active_payment = $active_payment_gateway->makePayment($payment_data, $this->active_invoice->getCurrency(), $this->active_invoice);\n\n if(!$active_payment->getIsError() && $active_payment instanceof Payment) {\n\n $active_payment->setIsPublic(true);\n $active_payment->setCreatedBy($payer);\n $active_payment->setParent($this->active_invoice);\n $active_payment->setAttributes($payment_data);\n $active_payment->setStatus(Payment::STATUS_PAID);\n $active_payment->setCurrencyId($this->active_invoice->getCurrency()->getId());\n\n //if we do express checkout\n if($active_payment instanceof PaypalExpressCheckoutPayment) {\n $active_payment->setStatus(Payment::STATUS_PENDING);\n $active_payment->setReason(Payment::REASON_OTHER);\n $active_payment->setReasonText(lang('Waiting response from paypal express checkout'));\n } //if\n\n $active_payment->save();\n\n //TO-Do check this\n $this->active_invoice->payments()->changeStatus($payer, $active_payment, $payment_data);\n $this->active_invoice->activityLogs()->logPayment($payer);\n\n // Notify if not gagged\n if(!($active_payment instanceof PaypalExpressCheckoutPayment) && !$this->active_invoice->payments()->isGagged()) {\n AngieApplication::notifications()\n ->notifyAbout(PAYMENTS_FRAMEWORK . '/new_payment', $this->active_invoice)\n ->setPayment($active_payment)\n ->sendToFinancialManagers();\n }//if\n\n if($payer instanceof IUser && !$payer->isFinancialManager()) {\n AngieApplication::notifications()\n ->notifyAbout(PAYMENTS_FRAMEWORK . '/new_payment_to_payer', $this->active_invoice)\n ->setPayment($active_payment)\n ->sendToUsers($payer);\n }//if\n\n $this->active_invoice->payments()->paymentMade($active_payment);\n\n DB::commit('Payment created @ ' . __CLASS__);\n if($active_payment instanceof PaypalExpressCheckoutPayment) {\n $this->response->redirectToUrl($active_payment->getRedirectUrl());\n } //if\n } else {\n throw new Error($active_payment->getErrorMessage());\n } //if\n\n $this->response->assign(array(\n 'active_object'\t=> $this->active_invoice,\n ));\n } catch (Exception $e) {\n DB::rollback('Failed to make payment @ ' . __CLASS__);\n $this->response->assign('errors', $e);\n }//try\n } //if\n } else {\n $this->response->notFound();\n } // if\n }", "public function createinvoiceAction() {\n\t\t$request = Zend_Controller_Front::getInstance ()->getRequest ();\n\t\tif (is_numeric ( $request->id )) {\n\t\t\t$invoiceID = Invoices::Create ( $request->id );\n\t\t\tif (is_numeric ( $invoiceID )) {\n\t\t\t\tInvoices::setInvoice ( $request->id, $invoiceID );\n\t\t\t\t$this->_helper->redirector ( 'edit', 'invoices', 'admin', array ('id' => $request->id, 'mex' => $this->translator->translate ( 'The task requested has been executed successfully.' ), 'status' => 'success' ) );\n\t\t\t} else {\n\t\t\t\t$this->_helper->redirector ( 'edit', 'invoices', 'admin', array ('id' => $request->id, 'mex' => $this->translator->translate ( 'An invoice already exists for this order.' ), 'status' => 'danger' ) );\n\t\t\t}\n\t\t}\n\t}", "function addPayment($data) {\n\tglobal $db;\n\n\tif (is_array($data)) {\n\t\t$stmt = $db->prepare('INSERT INTO `payments` (txnid, payment_amount, estado, itemid, createdtime) VALUES(?, ?, ?, ?, ?)');\n\t\t$stmt->bind_param(\n\t\t\t'sdsss',\n\t\t\t$data['txn_id'],\n\t\t\t$data['payment_amount'],\n\t\t\t$data['estado'],\n\t\t\t$data['item_number'],\n\t\t\tdate('Y-m-d H:i:s')\n\t\t);\n\t\t$stmt->execute();\n\t\t$stmt->close();\n\n\t\treturn $db->insert_id;\n\t}\n\n\treturn false;\n}", "function create_invoice ($invoice) {\n global $sql;\n return $sql->sql_insert('invoice', $invoice);\n }", "function addInvoice() {\n $stmt = $GLOBALS['con']->prepare(\"INSERT INTO invoices (customer_id, amount_due, invoice_due_date, service_id, service_name, fully_paid)\n VALUES (?, ?, ?, ?, ?, ?);\");\n $stmt->bind_param(\"ssssss\", $custId, $amountDue, $invoiceDate, $serviceId, $serviceName, $paid);\n\n\n $custId = validateInput('invoiceCustId', 'post');\n $invoiceDate = validateInput('invoiceDate', 'post');\n list($serviceId, $serviceName) = explode(\":\", validateInput('service', 'post')); // 'service id : service name'\n $paid = validateInput('fullyPaid', 'post'); // 1 === 'no' : 2 === yes'\n $amountDue = '';\n\n // Get the price of the service\n $sql = \"SELECT price FROM services WHERE id = $serviceId\";\n $result = mysqli_query($GLOBALS['con'], $sql);\n if ($result) {\n $amountDue = mysqli_fetch_assoc($result); \n $amountDue = $amountDue['price'];\n }\n\n $stmt->execute();\n $stmt->close(); \n }", "public function createInvoice()\r\n {\r\n }", "function take_cash_payment($invoice_id = '', $param2 = '')\n\t{\n\t\tif ($this->session->userdata('reception_login') != 1)\n\t\t\tredirect(base_url() . 'index.php?login', 'refresh');\n\t\t\n\t\t$data['payment_type'] = $this->input->post('payment_type');\n\t\t$data['transaction_id'] = rand(100000, 1000000);\n\t\t$data['invoice_id'] = $this->input->post('invoice_id');\n\t\t$data['patient_id'] = $this->input->post('patient_id');\n\t\t$data['method'] = $this->input->post('method');\n\t\t$data['description'] = $this->input->post('description');\n\t\t$data['amount'] = $this->input->post('amount');\n\t\t$data['timestamp'] = strtotime(date('Y-m-d') . ' ' . date('H:i:s'));\n\t\t\n\t\t$this->db->insert('payment', $data);\n\t\t\n\t\t$this->db->where('invoice_id', $this->input->post('invoice_id'));\n\t\t$this->db->update('invoice', array(\n\t\t\t'status' => 'paid'\n\t\t));\n\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_created'));\n\t\tredirect(base_url() . 'index.php?reception/manage_invoice', 'refresh');\n\t\t\n\t}", "function take_cash_payment($invoice_id = '', $param2 = '')\n\t{\n\t\tif ($this->session->userdata('reception_login') != 1)\n\t\t\tredirect(base_url() . 'index.php?login', 'refresh');\n\t\t\n\t\t$data['payment_type'] = $this->input->post('payment_type');\n\t\t$data['transaction_id'] = rand(100000, 1000000);\n\t\t$data['invoice_id'] = $this->input->post('invoice_id');\n\t\t$data['patient_id'] = $this->input->post('patient_id');\n\t\t$data['method'] = $this->input->post('method');\n\t\t$data['description'] = $this->input->post('description');\n\t\t$data['amount'] = $this->input->post('amount');\n\t\t$data['timestamp'] = strtotime(date('Y-m-d') . ' ' . date('H:i:s'));\n\t\t\n\t\t$this->db->insert('payment', $data);\n\t\t\n\t\t$this->db->where('invoice_id', $this->input->post('invoice_id'));\n\t\t$this->db->update('invoice', array(\n\t\t\t'status' => 'paid'\n\t\t));\n\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_created'));\n\t\tredirect(base_url() . 'index.php?reception/manage_invoice', 'refresh');\n\t\t\n\t}", "public function paymentWithStripe(Request $request, $invoiceId)\n {\n $invoice = Invoice::findOrFail($invoiceId);\n\n $tokenObject = $request->get('token');\n $token = $tokenObject['id'];\n $email = $tokenObject['email'];\n\n if($invoice->recurring == 'no')\n {\n try {\n $customer = Customer::create(array(\n 'email' => $email,\n 'source' => $token\n ));\n\n $charge = Charge::create(array(\n 'customer' => $customer->id,\n 'amount' => $invoice->total*100,\n 'currency' => $invoice->currency->currency_code\n ));\n\n } catch (\\Exception $ex) {\n \\Session::put('error','Some error occur, sorry for inconvenient');\n return Reply::redirect(route('client.invoices.show', $invoice->id), 'Payment fail');\n }\n\n $payment = new Payment();\n $payment->project_id = $invoice->project_id;\n $payment->currency_id = $invoice->currency_id;\n $payment->amount = $invoice->total;\n $payment->gateway = 'Stripe';\n $payment->transaction_id = $charge->id;\n $payment->paid_on = Carbon::now();\n $payment->status = 'complete';\n $payment->save();\n\n } else {\n\n\n $plan = Plan::create(array(\n \"name\" => 'Payment for invoice #'. $invoice->invoice_number,\n \"id\" => 'plan-'.$invoice->id.'-'.str_random('10'),\n \"interval\" => $invoice->billing_frequency,\n \"interval_count\" => $invoice->billing_interval,\n \"currency\" => $invoice->currency->currency_code,\n \"amount\" => $invoice->total*100,\n \"metadata\" => [\n \"invoice_id\" => $invoice->id\n ],\n ));\n\n try {\n\n $customer = Customer::create(array(\n 'email' => $email,\n 'source' => $token\n ));\n\n $subscription = Subscription::create(array(\n \"customer\" => $customer->id,\n \"items\" => array(\n array(\n \"plan\" => $plan->id,\n ),\n ),\n \"metadata\" => [\n \"invoice_id\" => $invoice->id\n ],\n ));\n\n } catch (\\Exception $ex) {\n \\Session::put('error','Some error occur, sorry for inconvenient');\n return Reply::redirect(route('client.invoices.show', $invoice->id), 'Payment fail');\n }\n\n // Save details in database\n $payment = new Payment();\n $payment->project_id = $invoice->project_id;\n $payment->currency_id = $invoice->currency_id;\n $payment->amount = $invoice->total;\n $payment->gateway = 'Stripe';\n $payment->plan_id = $plan->id;\n $payment->transaction_id = $subscription->id;\n $payment->paid_on = Carbon::now();\n $payment->status = 'complete';\n $payment->save();\n }\n\n $invoice->status = 'paid';\n $invoice->save();\n\n \\Session::put('success','Payment success');\n return Reply::redirect(route('client.invoices.show', $invoice->id), 'Payment success');\n }", "public function record_payment()\r\n {\r\n if (!has_permission('payments', '', 'create')) {\r\n access_denied('Record Payment');\r\n }\r\n if ($this->input->post()) {\r\n $this->load->model('payments_model');\r\n $id = $this->payments_model->process_payment($this->input->post(), '');\r\n if ($id) {\r\n set_alert('success', _l('invoice_payment_recorded'));\r\n redirect(admin_url('payments/payment/' . $id));\r\n } else {\r\n set_alert('danger', _l('invoice_payment_record_failed'));\r\n }\r\n redirect(admin_url('invoices/list_invoices/' . $this->input->post('invoiceid')));\r\n }\r\n }", "public function payment($id)\n {\n\n\n }", "function do_pr_invoice($data){\n\t$client_id=$data['Clientpayment']['client_id'];\n\t$amount=$data['Clientpayment']['amount'];\n\t$invoice_number=$data['Clientpayment']['invoice_number'];\n \t$list=$this->query(\"select invoice_id, total_amount from invoice where invoice_number='$invoice_number' limit 1;\");\n \t$invoice_amount=isset($list[0][0]['total_amount'])?$list[0][0]['total_amount']:0;\n \t#付清\n \tif($invoice_amount<$amount){\n\t\t\t$this->paid_true_invoice($data,$invoice_amount);\n \t}\n \tif($invoice_amount<$amount)\n \t{\n \t#未付清\n\t\t$this->paid_false_invoice($data,$invoice_number,$invoice_amount);\n \t}\n\t \tif($invoice_amount==$amount)\n \t{\n \t\n \t#刚刚付清\n \t$this->do_pay_for_invoice($data);\n\t$this->query(\"update invoice set paid=true,pay_amount=pay_amount::numeric+$invoice_amount where invoice_number='$invoice_number'\");\n \t\n \t}\n \t$this->commit();\n\t}", "function billing_userpanel_payment_invoiceCreate(){\n\tif(!$uid = $_SESSION['uid']){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(!$cost = intval($_REQUEST['cost'])){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(!$method = $_REQUEST['method']){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(substr($method, 0, 6)=='manual'){\n\t\treturn billing_userpanel_payment_offline();\n\t} else if(!function_exists('billing_userpanel_payment_'.$method)){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else {\n\t\t$order_id = $_REQUEST['order_id'];\n\t\tif($order_id){\n\t\t\tif(!$rs = dbq(\" SELECT COUNT(*) FROM `billing_invoice` WHERE `order_id`='$order_id' \")){\n\t\t\t\te(\"billing_userpanel_payment_invoiceCreate - \".__LINE__);\n\t\t\t} else if(dbn($rs)==0){\n\t\t\t\t;// its new, we need to insert it\n\t\t\t} else if(!$rw = dbf($rs)){\n\t\t\t\te(\"billing_userpanel_payment_invoiceCreate - \".__LINE__);\n\t\t\t} else {\n\t\t\t\t$invoiceId = $rw['id'];\n\t\t\t}\n\t\t}\n\t\tif($invoiceId){\n\t\t\t;// it already inserted\n\t\t} else if(!dbq(\" INSERT INTO `billing_invoice` (`uid`,`order_id`,`cost`,`method`) VALUES ('$uid','$order_id','$cost','$method') \")){\n\t\t\te(__LINE__.\" : \".__FILE__.\" \".dbe());\n\t\t} else {\n\t\t\t$invoiceId = dbi();\n\t\t}\n\t\tcall_user_func('billing_userpanel_payment_'.$method, $invoiceId);\n\t}\n}", "public function generate_Payment_Express_form( $order_id ) {\n\t\t\tglobal $woocommerce;\n\n\t\t\t$order = new WC_Order( $order_id );\n\t\t\t$billing_name = $order->billing_first_name.\" \".$order->billing_last_name;\n\t\t\t$shipping_name = explode(' ', $order->shipping_method);\n\t\t\t$request = new PxPayRequest();\n\n\t\t\t$http_host = getenv(\"HTTP_HOST\");\n\t\t\t$request_uri = getenv(\"SCRIPT_NAME\");\n\t\t\t$server_url = \"http://$http_host\";\n\n\t\t\tif ( method_exists( $woocommerce, 'api_request_url' ) ) {\n\t\t\t\t$script_url = $woocommerce->api_request_url( 'WC_Gateway_Payment_Express' );\n\t\t\t} else {\n\t\t\t\t$script_url = $this->get_return_url();\n\t\t\t}\n\n\t\t\t$currency = get_option('woocommerce_currency');\n\n\t\t\t//$MerchantRef = home_url();\n\t\t\t//$MerchantRef.= \" # \".$order->order_key;\n $MerchantRef = $this->site_name . ' - Order # ' . $order->id ;\n if ( strlen( $MerchantRef ) > 64 ) {\n $MerchantRef = substr( $this->site_name , 0 , max( 50 - strlen( $order->id ) , 0 ) ) . '... - Order # ' . $order->id ;\n if ( strlen( $MerchantRef ) > 64 ) {\n $MerchantRef = 'Order # ' . substr( $order->id , 0 , 53 ) . '...' ;\n }\n }\n\n\t\t\t$txndata1 = \"Order number : \". $order->id;\n\t\t\t//Generate a unique identifier for the transaction\n\t\t\t$TxnId = uniqid(\"ID\");\n\n\t\t\t//Set PxPay properties\n\t\t\t$request->setMerchantReference($MerchantRef);\n\t\t\t$request->setAmountInput($order->order_total);\n\t\t\t$request->setTxnData1($txndata1);\n\t\t\t$request->setTxnData2(htmlentities($billing_name));\n\t\t\t$request->setTxnData3($order->billing_email);\n\t\t\t$request->setTxnType(\"Purchase\");\n\t\t\t$request->setCurrencyInput($currency);\n\t\t\t$request->setEmailAddress($order->billing_email);\n\t\t\t$request->setUrlFail($script_url); // can be a dedicated failure page\n\t\t\t$request->setUrlSuccess($script_url); // can be a dedicated success page\n\t\t\t$request->setTxnId($TxnId);\n\n\t\t\t//Call makeRequest function to obtain input XML\n\t\t\t$request_string = $this->pxpay->makeRequest($request);\n\n\t\t\t//Obtain output XML\n\t\t\t$response = new MifMessage($request_string);\n\n\t\t\t//Parse output XML\n\t\t\t$url = $response->get_element_text(\"URI\");\n\t\t\t$valid = $response->get_attribute(\"valid\");\n\n\t\t\t$dps_adr = $url;\n$dps_adr = (strstr($url, '&request=')) ? $url : str_replace('request=', '&request=', $url);\n\t\t\treturn '<form action=\"'.esc_url( $dps_adr ).'\" method=\"post\" id=\"dps_payment_form\">\n\t\t\t\t<input type=\"submit\" class=\"button-alt\" id=\"submit_Payment_Express_payment_form\" value=\"'.__('Pay via Credit Card', 'woothemes').'\" /> \n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\tjQuery(function(){\n\t\t\t\t\t\tjQuery(\"body\").block({\n\t\t\t\t\t\t\t\tmessage: \"Thank you for your order. We are now redirecting you to Payment Express to make payment.\",\n\t\t\t\t\t\t\t\toverlayCSS:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbackground: \"#fff\",\n\t\t\t\t\t\t\t\t\topacity: 0.6\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tcss: {\n\t\t\t\t\t\t\t padding: 20,\n\t\t\t\t\t\t\t textAlign: \"center\",\n\t\t\t\t\t\t\t color: \"#555\",\n\t\t\t\t\t\t\t border: \"3px solid #aaa\",\n\t\t\t\t\t\t\t backgroundColor:\"#fff\",\n\t\t\t\t\t\t\t cursor: \"wait\",\n\t\t\t\t\t\t\t lineHeight:\t\t\"32px\"\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t});\n\t\t\t\t\t\t/*jQuery(\"body\").block(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmessage: \"<img src=\\\"'.esc_url( $woocommerce->plugin_url() ).'/assets/images/ajax-loader.gif\\\" alt=\\\"Redirecting...\\\" style=\\\"float:left; margin-right: 10px;\\\" />'.__('Thank you for your order. We are now redirecting you to Payment Express to make payment.', 'woothemes').'\",\n\t\t\t\t\t\t\t\toverlayCSS:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbackground: \"#fff\",\n\t\t\t\t\t\t\t\t\topacity: 0.6\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tcss: {\n\t\t\t\t\t\t\t padding: 20,\n\t\t\t\t\t\t\t textAlign: \"center\",\n\t\t\t\t\t\t\t color: \"#555\",\n\t\t\t\t\t\t\t border: \"3px solid #aaa\",\n\t\t\t\t\t\t\t backgroundColor:\"#fff\",\n\t\t\t\t\t\t\t cursor: \"wait\",\n\t\t\t\t\t\t\t lineHeight:\t\t\"32px\"\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t});*/\n\t\t\t\t\t\tjQuery(\"#submit_Payment_Express_payment_form\").click();\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t</form>';\n\n\t\t}", "function __addsaldo()\n\t{\n\t\n\t\t$type='in';\n\t\t$paytype=trim($_POST['paytype']);\n\t\tif(strtolower($paytype) == 'faktura')\n\t\t{\n\t\t\t/*if(trim($this->session->userdata['customer']['email']) == '')\n\t\t\t{\n\t\t\t\t$result = array(\"status\"=>'error','message'=>\n'Your email is empty. Please enter your email address');\n\t\t\t\techo json_encode($result);exit;\n\t\t\t}*/\n\t\t}\n\t\t\n\t\t$amount=$_POST['amount'];\n\t\t$customer=$this->session->userdata['customer']['id'];\n\t\tif(strtolower($paytype) == 'kort')\n\t\t{\n\t\t\t$in_type='visa';\n\t\t\t$in_status='paid';\n\t\t\t\n\t\t\t\n\t\t\n\t\t}\n\t\telse if(strtolower($paytype) == 'kontant')\n\t\t{\n\t\t\t$in_type='cash';\n\t\t\t$in_status='paid';\n\t\t}\n\t\telse if(strtolower($paytype) == 'gavekort')\n\t\t{\n\t\t\t$in_type='gift_card';\n\t\t\t$in_status='paid';\n\t\t\t$giftcard=$_POST['amount'];\n\t\t\t\n\t\t\t$giftstatus=$this->payments_model->validateGiftcard($giftcard,$customer);\t\n\t\t\tif($giftstatus)\n\t\t\t{\n\t\t\t\tif($giftstatus['status'] == 'proceed')\n\t\t\t\t{\n\t\t\t\t\t$amount=$giftstatus['amount'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$amount=0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$amount=0;\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$in_type='invoice';\n\t\t\t$in_status='pending';\n\t\t}\n\t\t\n\t\n\t\t$regtime=date('Y-m-d H:i:s');\n\t\t$paymentarray=array(\n\t\t'type'=>$type,\n\t\t'in_type'=>$in_type,\n\t\t'in_status'=>$in_status,\n\t\t'customer'=>$customer,\n\t\t'amount'=>$amount,\n\t\t'regtime'=>$regtime,\n\t\t\n\t\t);\n\t\tif(strtolower($paytype) == 'gavekort')\n\t\t{\n\t\t\t$paymentarray['gift_card']=intval($giftstatus['id']);\n\t\t}\n\t\t\n\t\t$saldoid=$this->payments_model->addCustomerPayment($paymentarray,1);\n\t\t$result = $this->payments_model->updateCustomerBalance($customer,$amount,$in_status,'credit','1','1');\n\t\t\n\t\trequire(APPPATH .'third_party/Mobile_Detect.php');\n $detect = new Mobile_Detect;\n $device=($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');\n\t\tif($device == 'tablet' || $device == 'phone')\n\t\t{\n\t\t\tif(strtolower($paytype) == 'kort')\n\t\t\t{\n\t\t\t\t$payload=array(\n\t\t\t\t\t\"data\"=>array(\"title\"=>\"Saldo Payment\",\n\t\t\t\t\t\t\t\t\"message\"=>\"Saldo Payment Notification.\",\n\t\t\t\t\t\t\t\t\"priority\"=>\"high\",\n\t\t\t\t\t\t\t\t\t\"content_available\"=>\"true\", \n\t\t\t\t\t\t\t\t\t\"sound\"=>\"default\", \n\t\t\t\t\t\t\t\t\t\"icon\"=>\"default\"),\n\t\t\t\t\t\"to\"=>$this->session->userdata['gcmid'], \n\t\t\t\t\t\"type\"=>'saldo', \n\t\t\t\t\t\"id\"=>$saldoid,\n\t\t\t\t\t\"amount\"=>$amount,\n\t\t\t\t\t\"customer\"=>$customer);\n\t\t\t\t\t\n\t\t\t\t\t$server_key=$this->session->userdata['server_key'];\n\t\t\t\t\t//Send Puhs notification for saldo payment\n\t\t\t\t\t$pushstatus=send_fcm($server_key,$payload);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t$data = $this->payments_model->getAccountBalance($customer);\n\t\t$pendingsaldo = $data['pending'];\n\t\t$paidsaldo = $data['paid'];\n\t\t\t\n\t\tif(intval($pendingsaldo) > 0)\n\t\t{\t\n\t\t\t$amount= formatcurrency($paidsaldo).' ('.formatcurrency($pendingsaldo).')';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$amount= formatcurrency($paidsaldo);\n\t\t}\n\t\t\n\t\t$saldocolor='';\n\t\tif($paidsaldo < 0)\n\t\t{\n\t\t\t$saldocolor='style=\"color:red;\"';\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t$result = array(\"status\"=>'success','saldoid'=>$saldoid,\"amount\"=>$amount,'message'=>\n'Customer payment has been credited','saldocolor'=>$saldocolor);\n\t\techo json_encode($result);exit;\n\t}", "public function takePayment($id, \\Bkademy\\Webpos\\Api\\Data\\Checkout\\PaymentInterface $payment)\n {\n $order = $this->orderRepository->get($id);\n $additional_information = [];\n if($payment){\n $methodData = $payment->getMethodData();\n foreach ($methodData as $item){\n $orderPayment = $this->_orderPaymentFactory->create();\n $orderPayment->setData([\n 'order_id' => $order->getId(),\n 'real_amount' => $item[PaymentItem::KEY_REAL_AMOUNT],\n 'base_real_amount' => $item[PaymentItem::KEY_BASE_REAL_AMOUNT],\n 'payment_amount' => $item[PaymentItem::KEY_AMOUNT],\n 'base_payment_amount' => $item[PaymentItem::KEY_BASE_AMOUNT],\n 'method' => $item[PaymentItem::KEY_CODE],\n 'method_title' => $item[PaymentItem::KEY_TITLE],\n 'shift_id' => $item[PaymentItem::KEY_SHIFT_ID],\n 'reference_number' => $item[PaymentItem::KEY_REFERENCE_NUMBER]\n ]);\n $order->setBaseTotalPaid($order->getBaseTotalPaid() + $item[PaymentItem::KEY_BASE_AMOUNT]);\n $order->setTotalPaid($order->getTotalPaid() + $item[PaymentItem::KEY_AMOUNT]);\n $additional_information[] = $item->getAmount().' : '.$item->getTitle();\n try {\n $orderPayment->save();\n } catch (\\Exception $e) {\n $this->logger->critical($e);\n }\n }\n \n }\n try {\n $order->getPayment()\n //->setData($payment[PaymentItem::KEY_CODE].'_ref_no',$payment[PaymentItem::KEY_REAL_AMOUNT])\n ->setData('additional_information',$additional_information)\n ->setData('method','multipaymentforpos')\n ->save();\n if($order->getBaseTotalPaid()-$order->getBaseGrandTotal()>0){\n $order->setWebposBaseChange($order->getBaseTotalPaid()-$order->getBaseGrandTotal());\n $order->setWebposChange($order->getTotalPaid()-$order->getGrandTotal());\n }\n $order->save();\n } catch (\\Exception $e) {\n $this->logger->critical($e);\n }\n return $this->orderRepository->get($id);\n }", "function AddRegoPayment(){\n\t\t$json = $_POST['json'];\n\t\t$id = $_POST['id'];\n\n\t\t//set the header\n\t\theader('Content-Type: application/json');\n\t\t$r = new RESPONSE(0);\n\n\t\t//validate data\n\t\tif (trim($json) == \"\" || is_numeric($id) == false){\n\t\t\t$r->message = 'no data to process.';\n\t\t\techo $r->toJSON();\n\t\t\treturn false;\n\t\t}\n\t\t\t//create the database\n\t\t\t$database = createDb();\n\n\t\t\t//decode the JSON\n\t\t\t$ob = json_decode($json, true);\n\n\t\t\t//make sure there is an amount to add\n\t\t\tif (is_numeric($ob['amount']) == false){\n\t\t\t\t$r->message = 'No value to update.';\n\t\t\t\techo $r->toJSON();\n\t\t\t\treturn false;\t\t\t\t\n\t\t\t}\n\n\t\t\t//check to see the balance\n\t\t\t$total = $database->sum(\"MainContact\", \"Fee\", [\n\t\t\t\t\"AND\" => [\n\t\t\t\t\t\"MainContactId\" =>\t$id,\n\t\t\t\t\t\"Cancelled\" \t=>\tfalse]\n\t\t\t\t]);\n\t\t\t\n\t\t\t$total2 = $database->sum(\"Registrant\", \"Fee\", [\n\t\t\t\t\"AND\" => [\n\t\t\t\t\t\"MainContactId\" =>\t$id,\n\t\t\t\t\t\"Cancelled\" \t=>\tfalse]\n\t\t\t\t]);\n\n\n\t\t\t$payments = $database->sum(\"Payment\", \"PaidAmount\", [\n\t\t\t\t\t\"MainContactId\" =>\t$id\n\t\t\t\t]);\n\n\t\t\t//the balance calculation\n\t\t\t$outstanding = ($total + $total2 - $payments);\n\n\t\t\t//we proceed only if the amount is less than the balance\n\t\t\tif ( $ob['amount'] > $outstanding ){\n\t\t\t\t$r->message = 'This amount: ' . $ob['amount'] . ' is greater than the outstanding amount: ' . $outstanding;\n\t\t\t\techo $r->toJSON();\n\t\t\t\treturn false;\n\t\t\t}\n\n\n\n\t\t\t//do insert if allowed\n\t\t\t$database->insert(\"Payment\", [\n\t\t\t\t\"PaidAmount\" => $ob['amount'],\n\t\t\t\t\"Notes\" \t\t=> $ob['comments'],\n\t\t\t\t\"PaidDate\" =>\tstrtotime($ob['date']),\n\t\t\t\t\"MainContactId\" =>\t$id\n\t\t\t]);\n\n\t\t\t//set the status for success\n\t\t\t$r->status = 1;\n\t\t\n\n\n\n\t\t//return json\n\t\techo $r->toJSON();\t\t\n\n\t}", "public function addDonation($amount, $card){\r\n $stmt = $this->DB->prepare(\"INSERT INTO transactions VALUES(NULL, 'DONATION', NULL,NULL,NULL,:card,now(),'PROCESSED');\");\r\n $stmt->bindParam(\"card\",$card);\r\n $stmt->execute();\r\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 sendPayment($transactionID, $transactionDesc, $data) {\n //init SOAP client\n if(DEPLOYED) {\n $payID = '2272';\n $payPass = 'sM%4D$3i2Tq';\n $url = 'https://api.integrapay.com.au/basic/PayLinkService.svc?WSDL';\n } else {\n $payID = '1131';\n $payPass = '6i?B}Tg7k*5';\n $url ='https://apitest.integrapay.com.au/basic/PayLinkService.svc?WSDL';\n }\n\n $client = new SoapClient($url, array(\"trace\" => 1, \"exception\" => 0));\n\n $programTitle = 'LuckyBuys';\n //Set variables\n $args = array('username' => $payID,\n 'password' => $payPass,\n 'transactionID' => uniqid() . '_' . $transactionID,\n 'transactionDescription' => $transactionDesc,\n 'creditCardNumber' => $data['cc_num'],\n 'creditCardExpiryDate' => $data['cc_exp_year'] . $data['cc_exp_mon'],\n 'creditCardCcv' => $data['cc_cvc'],\n 'creditCardName' => $data['cc_name'],\n 'transactionAmountInCents' => $data['amount'],\n 'payerFirstName' => $data['firstname'],\n 'payerLasttName' => $data['lastname'],\n 'payerAddressLine1' => $data['street1'],\n 'payerAddressLine2' => $data['street2'],\n 'payerAddressSuburb' => $data['suburb'],\n 'payerAddressState' => $data['state'],\n 'payerAddressPostCode' => $data['postcode'],\n 'payerAddressCountry' => $data['country'],\n 'payerMobile' => $data['mobile'],\n 'payerExtraInfo' => $data['email'],\n 'auditUsername' => $programTitle.' Website'\n );\n\n //DO NOT PRINT PAYMENT DETAILS TO LOG IN LIVE SYSTEM\n //This would mean credit card detaisl were stored on our server, which is\n //not allowed unless you are PCI compliant.\n //debugln(\"sending to $url\");\n //debugln($args);\n\n $retry = false;\n $attempt = 3;\n try {\n //Send payment\n do {\n $output = $client->ImmediateCreditCardTransactionFullPayerInfo($args);\n $resID = $output->resultID;\n if($resID === 'R') {\n sleep(10 + rand(0, 10));\n $retry = ($attempt++ < 3);\n }\n } while ($retry);\n\n } catch (Exception $e) {\n $retVal = 'Sorry, there was an error processing your payment: <br>'.strstr($e->getMessage(), 'Parameter name', true);\n return array('status' => 'Failure', 'message' => $retVal);\n }\n\n if($output->resultRejectionTypeID === 0) {\n $retVal = $output->resultBankReceiptID;\n return array('status' => 'Success', 'message' => $retVal);\n } else {\n $retVal = 'There was an error processing payment:<br>'.$output->resultDescription;\n return array('status' => 'Failure', 'message' => $retVal);\n }\n }", "private function createPayPalInvoice($order)\n {\n $body = [\n 'merchant_info' => [\n 'email' => '[email protected]',\n 'first_name' => 'Jakob',\n 'last_name' => 'Johansson',\n 'business_name' => 'Woo'\n ],\n 'shipping_info' => [\n 'first_name' => $order->get_shipping_first_name(),\n 'last_name' => $order->get_shipping_last_name(),\n 'address' => [\n 'line1' => $order->get_shipping_address_1(),\n 'city' => $order->get_shipping_city(),\n 'state' => $order->get_shipping_state(),\n ]\n ],\n 'shipping_cost' => [\n 'amount' => [\n 'currency' => $order->get_currency(),\n 'value' => $order->get_total()\n ]\n ]\n ];\n\n $response = wp_remote_retrieve_body(wp_remote_post($this->invoiceUrl, [\n 'method' => 'POST',\n 'headers' => [\n 'Authorization' => 'Bearer ' . $this->getAccessToken(),\n 'Content-Type' => 'application/json'\n ],\n 'body' => json_encode($body)\n ]));\n\n $response = json_decode($response, true);\n\n update_post_meta($order->get_id(), 'paypal_invoice_id', $response['id']);\n }", "public function send(Invoice $invoice): void {\n }", "public function paymentScreen( \\IPS\\nexus\\Invoice $invoice, \\IPS\\nexus\\Money $amount, \\IPS\\Member $member = NULL, $recurrings = array() )\n\t{\n\t\t\\IPS\\Output::i()->jsFiles = array_merge( \\IPS\\Output::i()->jsFiles, \\IPS\\Output::i()->js( 'global_gateways.js', 'nexus', 'global' ) );\n\t\t\n\t\t$return = array();\n\t\t$settings = json_decode( $this->settings, TRUE );\n\t\t\n\t\t/* Accepted types */\n\t\tif( $settings['processor'] )\n\t\t{\n\t\t\t$types = array();\n\t\t\t\n\t\t\tif ( in_array( $settings['processor'], array( 1, 2, 3, 4, 5, 6, 7 ) ) )\n\t\t\t{\n\t\t\t\t$types[] = \\IPS\\nexus\\CreditCard::TYPE_AMERICAN_EXPRESS;\n\t\t\t\t$types[] = \\IPS\\nexus\\CreditCard::TYPE_DINERS_CLUB;\n\t\t\t\t$types[] = \\IPS\\nexus\\CreditCard::TYPE_DISCOVER;\n\t\t\t\t$types[] = \\IPS\\nexus\\CreditCard::TYPE_JCB;\n\t\t\t}\n\t\t\telseif ( in_array( $settings['processor'], array( 9, 13 ) ) )\n\t\t\t{\n\t\t\t\t$types[] = \\IPS\\nexus\\CreditCard::TYPE_JCB;\n\t\t\t}\n\t\t\t\n\t\t\t$types[] = \\IPS\\nexus\\CreditCard::TYPE_MASTERCARD;\n\t\t\t$types[] = \\IPS\\nexus\\CreditCard::TYPE_VISA;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$types = array( \\IPS\\nexus\\CreditCard::TYPE_AMERICAN_EXPRESS, \\IPS\\nexus\\CreditCard::TYPE_DINERS_CLUB, \\IPS\\nexus\\CreditCard::TYPE_DISCOVER, \\IPS\\nexus\\CreditCard::TYPE_JCB, \\IPS\\nexus\\CreditCard::TYPE_MASTERCARD, \\IPS\\nexus\\CreditCard::TYPE_VISA );\n\t\t}\n\t\t$options = array( 'types' => $types, 'member' => $member );\n\t\t\n\t\t/* If we're using DPM, we include all that data in here */\n\t\tif ( $settings['method'] == 'DPM' )\n\t\t{\n\t\t\t$timestamp = time();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$options['jsRequired']\t= TRUE;\n\t\t\t$options['names']\t\t= FALSE;\n\t\t\t$options['attr']\t\t= array(\n\t\t\t\t'data-controller'\t=> 'nexus.global.gateways.authorizenet',\n\t\t\t\t'data-id'\t\t\t=> $this->id,\n\t\t\t\t'class'\t\t\t\t=> 'ipsHide',\n\t\t\t\t'data-url'\t\t\t=> \\IPS\\NEXUS_TEST_GATEWAYS ? 'https://test.authorize.net/gateway/transact.dll' : 'https://secure.authorize.net/gateway/transact.dll',\n\t\t\t\t'data-fields'\t\t=> json_encode( array(\n\t\t\t\t\t'x_login'\t\t\t=> $settings['login'],\n\t\t\t\t\t'x_version'\t\t\t=> '3.1',\n\t\t\t\t\t'x_type'\t\t\t=> 'AUTH_ONLY',\n\t\t\t\t\t'x_method'\t\t\t=> 'CC',\n\t\t\t\t\t'x_amount'\t\t\t=> (string) $amount->amount,\n\t\t\t\t\t'x_currency_code'\t=> $amount->currency,\n\t\t\t\t\t'x_fp_hash'\t\t\t=> hash_hmac( 'md5', \"{$settings['login']}^{$invoice->id}^{$timestamp}^{$amount->amount}^{$amount->currency}\", $settings['tran_key'] ),\n\t\t\t\t\t'x_fp_sequence'\t\t=> $invoice->id,\n\t\t\t\t\t'x_fp_timestamp'\t=> $timestamp,\n\t\t\t\t\t'x_invoice_num'\t\t=> $invoice->id,\n\t\t\t\t\t'x_first_name'\t\t=> $invoice->member->cm_first_name,\n\t\t\t\t\t'x_last_name'\t\t=> $invoice->member->cm_last_name,\n\t\t\t\t\t'x_address'\t\t\t=> $invoice->billaddress ? implode( ', ', $invoice->billaddress->addressLines ) : '',\n\t\t\t\t\t'x_city'\t\t\t=> $invoice->billaddress ? $invoice->billaddress->city : '',\n\t\t\t\t\t'x_state'\t\t\t=> $invoice->billaddress ? $invoice->billaddress->region : '',\n\t\t\t\t\t'x_zip'\t\t\t\t=> $invoice->billaddress ? $invoice->billaddress->postalCode : '',\n\t\t\t\t\t'x_country'\t\t\t=> $invoice->billaddress ? $invoice->billaddress->country : '',\n\t\t\t\t\t'x_phone'\t\t\t=> $invoice->member->cm_phone,\n\t\t\t\t\t'x_email'\t\t\t=> $invoice->member->email,\n\t\t\t\t\t'x_email_customer'\t=> 'FALSE',\n\t\t\t\t\t'x_cust_id'\t\t\t=> $invoice->member->member_id,\n\t\t\t\t\t'x_customer_ip'\t\t=> \\IPS\\Request::i()->ipAddress(),\n\t\t\t\t\t'x_relay_response'\t=> 'TRUE',\n\t\t\t\t\t'x_relay_url'\t\t=> \\IPS\\Settings::i()->base_url . 'applications/nexus/interface/gateways/authorize.php',\n\t\t\t\t) )\n\t\t\t);\n\t\t\t\n\t\t}\n\t\t\n\t\t/* If we're using AIM, we might be able to save */\n\t\telseif ( $this->canStoreCards() and \\IPS\\Member::loggedIn()->member_id )\n\t\t{\n\t\t\t$options['save'] = $this;\n\t\t\t$options['member'] = $invoice->member;\n\t\t}\n\t\t\n\t\t/* And then return the card field */\n\t\t$return['card'] = new \\IPS\\nexus\\Form\\CreditCard( $this->id . '_card', NULL, FALSE, $options );\n\t\treturn $return;\n\t}", "public function create( int $invoiceId, array $parameters ) {\n\t\tif ( ! isset( $parameters['amount'] ) ) {\n\t\t\tthrow new \\Required\\Harvest\\Exception\\MissingArgumentException( 'amount' );\n\t\t}\n\n\t\tif ( ! \\is_float( $parameters['amount'] ) || empty( $parameters['amount'] ) ) {\n\t\t\tthrow new \\Required\\Harvest\\Exception\\InvalidArgumentException( 'The \"amount\" parameter must be a non-empty decimal.' );\n\t\t}\n\n\t\treturn $this->post( '/invoices/' . rawurlencode( $invoiceId ) . '/payments', $parameters );\n\t}", "function insert_transaction($subscriptionid = 0, $projectid = 0, $buynowid = 0, $user_id = 0, $p2b_user_id = 0, $storeid = 0, $orderid = 0, $description = '', $amount, $paid, $status, $invoicetype, $paymethod, $createdate, $duedate, $paiddate, $custommessage, $archive, $ispurchaseorder = 0, $returnid = 0, $transactionidx = '', $isdeposit = 0, $iswithdraw = 0, $dontprocesstax = 0)\n {\n global $ilance, $ilconfig;\n $subscriptionid = isset($subscriptionid) ? intval($subscriptionid) : '0';\n $projectid = isset($projectid) ? intval($projectid) : '0';\n $buynowid = isset($buynowid) ? intval($buynowid) : '0';\n $user_id = isset($user_id) ? intval($user_id) : '0';\n $p2b_user_id = isset($p2b_user_id) ? intval($p2b_user_id) : '0';\n $storeid = isset($storeid) ? intval($storeid) : '0';\n $orderid = isset($orderid) ? intval($orderid) : '0';\n $description = isset($description) ? $description : 'No transaction description provided';\n $amount = isset($amount) ? $amount : '0.00';\n $paid = isset($paid) ? $paid : '0.00';\n $status = isset($status) ? $status : 'unpaid';\n $invoicetype = isset($invoicetype) ? $invoicetype : 'debit';\n $paymethod = isset($paymethod) ? $paymethod : 'account';\n $ipaddress = IPADDRESS;\n $referer = REFERRER;\n $createdate = DATETIME24H;\n $duedate = isset($duedate) ? $duedate : DATETIME24H;\n $paiddate = isset($paiddate) ? $paiddate : '';\n $custommessage = isset($custommessage) ? $custommessage : 'No memo or administrative comments';\n $archive = isset($archive) ? intval($archive) : '0';\n $ispurchaseorder = isset($ispurchaseorder) ? $ispurchaseorder : '0';\n // withdraw and deposit related transactions\n $iswithdraw \t = isset($iswithdraw) \t ? intval($iswithdraw) : '0';\n $isdeposit \t = isset($isdeposit) \t ? intval($isdeposit) : '0';\n $totalamount = '0.00';\n $transactionid = (isset($transactionidx) AND !empty($transactionidx)) ? $transactionidx : $ilance->accounting_payment->construct_transaction_id();\n $currencyid = $this->currencyid == '0' ? $ilconfig['globalserverlocale_defaultcurrency'] : $this->currencyid;\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"invoices\n (invoiceid, currency_id, subscriptionid, projectid, buynowid, user_id, p2b_user_id, storeid, orderid, description, amount, paid, totalamount, status, paymethod, ipaddress, referer, createdate, duedate, paiddate, custommessage, transactionid, archive, ispurchaseorder, isdeposit, iswithdraw)\n VALUES(\n NULL,\n '\" . intval($currencyid) . \"',\n '\" . intval($subscriptionid) . \"',\n '\" . intval($projectid) . \"',\n '\" . intval($buynowid) . \"',\n '\" . intval($user_id) . \"',\n '\" . intval($p2b_user_id) . \"',\n '\" . intval($storeid) . \"',\n '\" . intval($orderid) . \"',\n '\" . $ilance->db->escape_string($description) . \"',\n '\" . $ilance->db->escape_string($amount) . \"',\n '\" . $ilance->db->escape_string($paid) . \"',\n '\" . $ilance->db->escape_string($totalamount) . \"',\n '\" . $ilance->db->escape_string($status) . \"',\n '\" . $ilance->db->escape_string($paymethod) . \"',\n '\" . $ilance->db->escape_string($ipaddress) . \"',\n '\" . $ilance->db->escape_string($referer) . \"',\n '\" . $ilance->db->escape_string($createdate) . \"',\n '\" . $ilance->db->escape_string($duedate) . \"',\n '\" . $ilance->db->escape_string($paiddate) . \"',\n '\" . $ilance->db->escape_string($custommessage) . \"',\n '\" . $ilance->db->escape_string($transactionid) . \"',\n '\" . $ilance->db->escape_string($archive) . \"',\n '\" . intval($ispurchaseorder) . \"',\n '\" . intval($isdeposit) . \"',\n '\" . intval($iswithdraw) . \"')\n \", 0, null, __FILE__, __LINE__); \n // fetch new last invoice id\n $invoiceid = $ilance->db->insert_id();\n \n // do we skip the taxation support for this transaction?\n // we do this in some situations where the tax needs to be applied before the txn is created\n // for situations like escrow fees that we must already know how much to charge the customer for taxes\n // if we don't do this then the txn may have double taxes added to the overall amount\n // and situations like this usually mean that an unpaid transaction is being created (and tax) is\n // auto-applied\n \n // taxation support: is user taxable for this invoice type?\n // this code block will run if a transaction being created is unpaid waiting for payment from the customer\n if ($ilance->tax->is_taxable($user_id, $invoicetype) AND isset($dontprocesstax) AND $dontprocesstax == 0)\n {\n // fetch tax amount to charge for this invoice type\n $taxamount = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 0);\n // fetch total amount to hold within the \"totalamount\" field\n $totalamount = ($amount + $taxamount);\n // fetch tax bit to display when outputing tax infos\n $taxinfo = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 1);\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\" . $totalamount . \"',\";\n }\n // member is taxable for this invoice type\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET istaxable = '1',\n $extra\n totalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\n taxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\n taxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else\n {\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\".$totalamount.\"',\";\n }\n // customer not taxable > update totalamount value\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET totalamount = '\" . sprintf(\"%01.2f\", $amount) . \"',\n $extra\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n } \n if (isset($returnid) AND $returnid > 0)\n {\n return intval($invoiceid);\n }\n }", "private function createPaymentRequest()\n {\n $helper = Mage::helper('pagseguro');\n\n // Get references that stored in the database\n $reference = $helper->getStoreReference();\n\n $paymentRequest = new PagSeguroPaymentRequest();\n $paymentRequest->setCurrency(PagSeguroCurrencies::getIsoCodeByName(self::REAL));\n $paymentRequest->setReference($reference . $this->order->getId()); //Order ID\n $paymentRequest->setShipping($this->getShippingInformation()); //Shipping\n $paymentRequest->setSender($this->getSenderInformation()); //Sender\n $paymentRequest->setItems($this->getItensInformation()); //Itens\n $paymentRequest->setShippingType(SHIPPING_TYPE);\n $paymentRequest->setShippingCost(number_format($this->order->getShippingAmount(), 2, '.', ''));\n $paymentRequest->setNotificationURL($this->getNotificationURL());\n $helper->getDiscount($paymentRequest);\n\n //Define Redirect Url\n $redirectUrl = $this->getRedirectUrl();\n\n if (!empty($redirectUrl) and $redirectUrl != null) {\n $paymentRequest->setRedirectURL($redirectUrl);\n } else {\n $paymentRequest->setRedirectURL(Mage::getUrl() . 'checkout/onepage/success/');\n }\n\n //Define Extra Amount Information\n $paymentRequest->setExtraAmount($this->extraAmount());\n\n try {\n $paymentUrl = $paymentRequest->register($this->getCredentialsInformation());\n } catch (PagSeguroServiceException $ex) {\n Mage::log($ex->getMessage());\n $this->redirectUrl(Mage::getUrl() . 'checkout/onepage');\n }\n\n return $paymentUrl;\n }", "static function CreateManualPayment($arrPayment) {\r\n $DB = &\\ADODB_Connection_Manager::GetConnection('customer');\r\n $intCustomerID = $arrPayment['intCustomerID'];\r\n $decPaymentAmount = $arrPayment['decAmount'];\r\n $objCustomer = new ClsBllCustomer();\r\n $rslt = $objCustomer->LoadByID($intCustomerID);\r\n // 0. Check if no customer id is found with given id.\r\n if(!$rslt){\r\n return -1;\r\n }\r\n $arrInvoiceTotalDueAnount = $objCustomer->arrInvoiceTotalDueAnount;\r\n $decTotalDueAmount = $objCustomer->decTotalDueAmount;\r\n $intNumberOfDueInvoices = $objCustomer->intNumberOfDueInvoices;\r\n // 1. Check if no invoices are open for this customer.\r\n if(!$intNumberOfDueInvoices){\r\n return -2;\r\n }\r\n // 2. Check if remaining amount is less than payment amount.\r\n if ($decTotalDueAmount < $decPaymentAmount) {\r\n return -3;\r\n }\r\n $DB->StartTrans();\r\n // 3. Add payment in inv-payment table\r\n $objPayment = new self();\r\n $objPayment->intPaymentMethodID = $arrPayment['intPaymentMethodID'];\r\n $objPayment->intCustomerID = $arrPayment['intCustomerID'];\r\n $objPayment->intPaymentNumber = ClsBllPayment::getNextSearialNumber();\r\n $objPayment->strReference = $arrPayment['strReference'];\r\n $objPayment->dtDate = date('Y-m-d', strtotime($arrPayment['dtDate']));\r\n $objPayment->decAmount = $arrPayment['decAmount'];\r\n $objPayment->intCreatedByUserID = $arrPayment['intCreatedByUserID'];\r\n $rslt = $objPayment->Save();\r\n if($rslt){\r\n $intPaymentID = $objPayment->intID;\r\n }else{ \r\n return $DB->CompleteTrans(false);\r\n } \r\n // 4. Assign payment to invoices and stop when payment amount is = 0 or invoices are done!\r\n foreach($arrInvoiceTotalDueAnount as $intInvoiceID => $decDueAmount){\r\n $objInvoice = new ClsBllInvoice();\r\n $objInvoice->LoadByID($intInvoiceID);\r\n $rslt = $objInvoice->AddPayment($decPaymentAmount, $intPaymentID);\r\n if (!$rslt) {\r\n // Operation failed\r\n return $DB->CompleteTrans(false);\r\n }\r\n if ($decPaymentAmount === 0) {\r\n // No remaining amount for more invoice-payment records\r\n break;\r\n }\r\n }\r\n\r\n $rslt = $DB->CompleteTrans();\r\n if ($rslt) {\r\n return $objPayment;\r\n } else {\r\n return false;\r\n }\r\n }", "public function processPayment();", "public function insert($shoppingcartInvoice);", "public function contract($id = ''){\n\t\t\n\t\tif ($this->input->post('paiement')) {\n\t\t\t\n\t\t\t$medals = $this->input->post('medals_id');\n\t\t\t$method = $this->input->post('method');\n\t\t\t$date = $this->input->post('date_paid');\n\t\t\t\n\t\t\t$this->db->where('number', $medals);\n\t\t\t$this->db->set('date_paid', $date);\n\t\t\t$this->db->set('method', $method);\n\t\t\t$this->db->update('tblcontracts');\n\t\t\t//print_r($this->input->post());\n\t\t\t\n\t\t\t$this->db->where('id', 2);\n\t\t\t$item = $this->db->get('tblinvoiceitemslist')->row();\n\t\t\t\n\t\t\t$data['clientid'] = $this->input->post('clientid');\n\t\t\t$data['date'] = $date;\n\t\t\t$data['duedate'] = date('Y-m-d', strtotime(\"+30 days\"));\n\t\t\t$data['currency'] = \"2\";\n\t\t\t$data['clientnote'] = \"\";\n\t\t\t$data['adminnote'] = \"\";\n\t\t\t$data['terms'] = \"\";\n\t\t\t$data['discount_percent'] = \"0\";\n\t\t\t$data['discount_total'] = \"0\";\n\t\t\t$data['adjustment'] = \"0.00\";\n\t\t\t$data['subtotal'] = $item->rate;\n\t\t\t$data['total'] = $data['subtotal'];\n\t\t\t$data['allowed_payment_modes'] = 'a:6:{i:0;s:1:\"1\";i:1;s:1:\"2\";i:2;s:1:\"3\";i:3;s:1:\"4\";i:4;s:6:\"paypal\";i:5;s:6:\"stripe\";}';\n\t\t\t$data['discount_type'] = \"\";\n\t\t\t$data['recurring'] = \"18\";\n\t\t\t$data['number'] = $medals;\n\t\t\t$data['hash'] = md5(rand() . microtime());\n\t\t\t$data['status'] = 2;\n\t\t\t\n\t\t\t$data['newitems'] = Array ( 'item' => Array ( '2' => Array ( 'quantity' => Array ( 0 => 1 ) ) ) );\n\t\t\t\n\t\t\t$items = $data['newitems'];\n\t\t\t\n\t\t\tunset($data['newitems']);\n\t\t\t\n\t\t\t$this->db->insert('tblinvoices', $data);\n\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t$invoice_id = $insert_id;\n\t\t\tif ($insert_id) {\n\t\t\t\t$this->db->where('name', 'next_invoice_number');\n\t\t\t\t$this->db->set('value', 'value+1', FALSE);\n\t\t\t\t$this->db->update('tbloptions');\n\t\t\t\tif (count($items) > 0) {\n\t\t\t\t\tforeach ($items['item'] as $itemid => $quantity) {\n\t\t\t\t\t\t$this->db->insert('tblinvoiceitems', array(\n\t\t\t\t\t\t\t'invoiceid' => $insert_id,\n\t\t\t\t\t\t\t'itemid' => $itemid,\n\t\t\t\t\t\t\t'qty' => $quantity['quantity'][0]\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$this->db->where('number', $medals);\n $this->db->delete('tblnotused');\n\t\t\t\t\n\t\t\t\t$data_payment['invoiceid'] = $insert_id;\n\t\t\t\t$data_payment['amount'] = $data['subtotal'];\n\t\t\t\t$data_payment['paymentmode'] = 1;\n\t\t\t\t$data_payment['date'] = $date;\n\t\t\t\t$data_payment['daterecorded'] = $date;\n\t\t\t\t$data_payment['addedfrom'] = 1;\n\t\t\t\t\n\t\t\t\t$this->db->insert('tblinvoicepaymentrecords', $data_payment);\n\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\t\n\t\t\t\tif ($insert_id) {\n\t\t\t\t\t\n\t\t\t\t\t//$invoice = $this->invoices_model->get($invoice_id);\n\t\t\t\t\t//$invoice_number = format_invoice_number($invoice->number);\n\t\t\t\t\t//$pdf = invoice_pdf($invoice);\n\t\t\t //\n\t\t\t\t\t//$pdf->Output($invoice_number . '.pdf');\n\t\t\t\t\t\n\t\t\t\t\tredirect(admin_url('contracts/recherche?number='.$medals.'&openinvoice=1&invoice_id='.$invoice_id));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tif ($this->input->post('search_client')) {\n\t\t\t$this->db->like('phonenumber', $this->input->post('search_client'));\n\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\tif ($client) {\n\t\t\t\t$data = json_encode((array)$client);\n\t\t\t\techo $data;\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t$client = array('no_found'=>'no_found');\n\t\t\t\t$data = json_encode((array)$client);\n\t\t\t\techo $data;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif(!has_permission('manageContracts')){\n\t\t\taccess_denied('manageContracts');\n\t\t}\n\n\t\tif($this->input->post()){\n\t\t\t$this->load->helper('perfex_upload');\n\t\t\t\n\t\t\tif($id == ''){\n\t\t\t\t\n\t\t\t\tif (!empty($this->input->post('userid'))) {\n\t\t\t\t\t$cliendid = $this->input->post('userid');\n\t\t\t\t\n\t\t\t\t\t$this->db->where('userid', $cliendid);\n\t\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t} else {\n\t\t\t\t\t$phone = $this->input->post('phonenumber');\n\t\t\t\t\n\t\t\t\t\t$this->db->where('phonenumber', $phone);\n\t\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//print_r($client);\n\t\t\t\t\n\t\t\t\tif (empty($client)) {\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name']);\n\t\t\t\t\tunset($_POST['race']);\n\t\t\t\t\tunset($_POST['color']);\n\t\t\t\t\tunset($_POST['remarque']);\n\t\t\t\t\tunset($_POST['number']);\n\t\t\t\t\tunset($_POST['datecreated']);\n\t\t\t\t\tunset($_POST['userid']);\n\t\t\t\t\tunset($_POST['attachment']);\n\t\t\t\t\tunset($_POST['sexe']);\n\t\t\t\t\tunset($_POST['method']);\n\t\t\t\t\tunset($_POST['rfid']);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$user_id = $this->clients_model->add($_POST);\n\t\t\t\t\t$_POST['client'] = $user_id;\n\t\t\t\t} else {\n\t\t\t\t\t$_POST['client'] = $client->userid;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$medals = $this->input->post('number');\n\t\t\t\t$method = $this->input->post('method');\n\t\t\t\t$date = date('Y-m-d');\n\t\t\t\t\n\t\t\t\t$this->db->where('number', $medals);\n\t\t\t\t$this->db->set('date_paid', $date);\n\t\t\t\t$this->db->set('method', $method);\n\t\t\t\t$this->db->update('tblcontracts');\n\t\t\t\t//print_r($this->input->post());\n\t\t\t\t\n\t\t\t\t$this->load->model('invoice_items_model');\n\t\t\t\t$items = $this->invoice_items_model->get();\n\t\t\t\t\n\t\t\t\t//print_r($items);\n\t\t\t\t\n\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t$villes = explode(',',$item['description']);\n\t\t\t\t\tif ($villes[0] == 'Médaille') {\n\t\t\t\t\t\t$ville = $villes[1];\n\t\t\t\t\t\tif ($client->city == $ville) {\n\t\t\t\t\t\t\t$item_id = $item['itemid'];\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\tif ($item_id) {\n\t\t\t\t\t$item_select = $item_id;\n\t\t\t\t} else {\n\t\t\t\t\t$item_select = 2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tunset($item);\n\t\t\t\t\n\t\t\t\t$this->db->where('id', $item_select);\n\t\t\t\t$item = $this->db->get('tblinvoiceitemslist')->row();\n\t\t\t\t\n\t\t\t\t$data['clientid'] = $_POST['client'];\n\t\t\t\t$data['date'] = $date;\n\t\t\t\t$data['duedate'] = date('Y-m-d', strtotime(\"+30 days\"));\n\t\t\t\t$data['currency'] = \"2\";\n\t\t\t\t$data['clientnote'] = \"\";\n\t\t\t\t$data['adminnote'] = \"\";\n\t\t\t\t$data['terms'] = \"\";\n\t\t\t\t$data['discount_percent'] = \"0\";\n\t\t\t\t$data['discount_total'] = \"0\";\n\t\t\t\t$data['adjustment'] = \"0.00\";\n\t\t\t\t$data['subtotal'] = $item->rate;\n\t\t\t\t$data['total'] = $data['subtotal'];\n\t\t\t\t$data['allowed_payment_modes'] = 'a:6:{i:0;s:1:\"1\";i:1;s:1:\"2\";i:2;s:1:\"3\";i:3;s:1:\"4\";i:4;s:6:\"paypal\";i:5;s:6:\"stripe\";}';\n\t\t\t\t$data['discount_type'] = \"\";\n\t\t\t\t$data['recurring'] = \"18\";\n\t\t\t\t$data['number'] = $medals;\n\t\t\t\t$data['hash'] = md5(rand() . microtime());\n\t\t\t\t$data['status'] = 2;\n\t\t\t\t\n\t\t\t\tif ($_POST['animal_name2']) {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 2 ) ) ) );\n\t\t\t\t} else if ($_POST['animal_name3']) {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 3 ) ) ) );\n\t\t\t\t} else {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 1 ) ) ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$items = $data['newitems'];\n\t\t\t\t\n\t\t\t\tunset($data['newitems']);\n\t\t\t\t\n\t\t\t\t$this->db->insert('tblinvoices', $data);\n\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\tif ($insert_id) {\n\t\t\t\t\t$this->db->where('name', 'next_invoice_number');\n\t\t\t\t\t$this->db->set('value', 'value+1', FALSE);\n\t\t\t\t\t$this->db->update('tbloptions');\n\t\t\t\t\tif (count($items) > 0) {\n\t\t\t\t\t\tforeach ($items['item'] as $itemid => $quantity) {\n\t\t\t\t\t\t\t$this->db->insert('tblinvoiceitems', array(\n\t\t\t\t\t\t\t\t'invoiceid' => $insert_id,\n\t\t\t\t\t\t\t\t'itemid' => $itemid,\n\t\t\t\t\t\t\t\t'qty' => $quantity['quantity'][0]\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->db->where('number', $medals);\n\t\t\t\t\t$this->db->delete('tblnotused');\n\t\t\t\t\t\n\t\t\t\t\t$data_payment['invoiceid'] = $insert_id;\n\t\t\t\t\t$data_payment['amount'] = $data['subtotal'];\n\t\t\t\t\t$data_payment['paymentmode'] = 1;\n\t\t\t\t\t$data_payment['date'] = $date;\n\t\t\t\t\t$data_payment['daterecorded'] = $date;\n\t\t\t\t\t$data_payment['addedfrom'] = 1;\n\t\t\t\t\t\n\t\t\t\t\t$this->db->insert('tblinvoicepaymentrecords', $data_payment);\n\t\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$POST_data = $_POST;\n\t\t\t\t\n\t\t\t\t//print_r($this->input->post());\n\t\t\t\tunset($POST_data['firstname']);\n\t\t\t\tunset($POST_data['lastname']);\n\t\t\t\tunset($POST_data['email']);\n\t\t\t\tunset($POST_data['phonenumber']);\n\t\t\t\tunset($POST_data['phone_other']);\n\t\t\t\tunset($POST_data['no_civique']);\n\t\t\t\tunset($POST_data['address']);\n\t\t\t\tunset($POST_data['app']);\n\t\t\t\tunset($POST_data['city']);\n\t\t\t\tunset($POST_data['state']);\n\t\t\t\tunset($POST_data['zip']);\n\t\t\t\tunset($POST_data['password']);\n\t\t\t\tunset($POST_data['userid']);\n\n\t\t\t\t\n\t\t\t\tif ($_POST['animal_name2']) {\n\t\t\t\t\t\n\t\t\t\t\t$POST_data2['animal_name'] = $_POST['animal_name2'];\n\t\t\t\t\t$POST_data2['race'] = $_POST['race2'];\n\t\t\t\t\t$POST_data2['color'] = $_POST['color2'];\n\t\t\t\t\t$POST_data2['remarque'] = $_POST['remarque2'];\n\t\t\t\t\t$POST_data2['number'] = $_POST['number2'];\n\t\t\t\t\t$POST_data2['attachment'] = $_POST['attachment2'];\n\t\t\t\t\t$POST_data2['sexe'] = $_POST['sexe2'];\n\t\t\t\t\t$POST_data2['method'] = $_POST['method2'];\n\t\t\t\t\t$POST_data2['rfid'] = $_POST['rfid2'];\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name2']);\n\t\t\t\t\tunset($_POST['race2']);\n\t\t\t\t\tunset($_POST['color2']);\n\t\t\t\t\tunset($_POST['remarque2']);\n\t\t\t\t\tunset($_POST['number2']);\n\t\t\t\t\tunset($_POST['attachment2']);\n\t\t\t\t\tunset($_POST['sexe2']);\n\t\t\t\t\tunset($_POST['method2']);\n\t\t\t\t\tunset($_POST['rfid2']);\n\t\t\t\t\t\n\t\t\t\t\t$POST_data2['date_paid'] = $date;\n\t\t\t\t\t$POST_data2['method'] = $method;\n\t\t\t\t\t\n\t\t\t\t\t$id = $this->contracts_model->add($POST_data2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tunset($POST_data['animal_name2']);\n\t\t\t\t\tunset($POST_data['race2']);\n\t\t\t\t\tunset($POST_data['color2']);\n\t\t\t\t\tunset($POST_data['remarque2']);\n\t\t\t\t\tunset($POST_data['number2']);\n\t\t\t\t\tunset($POST_data['attachment2']);\n\t\t\t\t\tunset($POST_data['sexe2']);\n\t\t\t\t\tunset($POST_data['method2']);\n\t\t\t\t\tunset($POST_data['rfid2']);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif ($_POST['animal_name3']) {\n\t\t\t\t\t\n\t\t\t\t\t$POST_data3['animal_name'] = $_POST['animal_name3'];\n\t\t\t\t\t$POST_data3['race'] = $_POST['race3'];\n\t\t\t\t\t$POST_data3['color'] = $_POST['color3'];\n\t\t\t\t\t$POST_data3['remarque'] = $_POST['remarque3'];\n\t\t\t\t\t$POST_data3['number'] = $_POST['number3'];\n\t\t\t\t\t$POST_data3['attachment'] = $_POST['attachment3'];\n\t\t\t\t\t$POST_data3['sexe'] = $_POST['sexe3'];\n\t\t\t\t\t$POST_data3['method'] = $_POST['method3'];\n\t\t\t\t\t$POST_data3['rfid'] = $_POST['rfid3'];\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name3']);\n\t\t\t\t\tunset($_POST['race3']);\n\t\t\t\t\tunset($_POST['color3']);\n\t\t\t\t\tunset($_POST['remarque3']);\n\t\t\t\t\tunset($_POST['number3']);\n\t\t\t\t\tunset($_POST['attachment3']);\n\t\t\t\t\tunset($_POST['sexe3']);\n\t\t\t\t\tunset($_POST['method3']);\n\t\t\t\t\tunset($_POST['rfid3']);\n\t\t\t\t\t\n\t\t\t\t\t$POST_data3['date_paid'] = $date;\n\t\t\t\t\t$POST_data3['method'] = $method;\n\t\t\t\t\t\n\t\t\t\t\t$id = $this->contracts_model->add($POST_data3);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tunset($POST_data['animal_name3']);\n\t\t\t\t\tunset($POST_data['race3']);\n\t\t\t\t\tunset($POST_data['color3']);\n\t\t\t\t\tunset($POST_data['remarque3']);\n\t\t\t\t\tunset($POST_data['number3']);\n\t\t\t\t\tunset($POST_data['attachment3']);\n\t\t\t\t\tunset($POST_data['sexe3']);\n\t\t\t\t\tunset($POST_data['method3']);\n\t\t\t\t\tunset($POST_data['rfid3']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$POST_data['date_paid'] = $date;\n\t\t\t\t$POST_data['method'] = $method;\n\t\t\t\t\n\t\t\t\t$id = $this->contracts_model->add($POST_data);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($id){\n\t\t\t\t\thandle_contract_attachment($id);\n\t\t\t\t\tset_alert('success', _l('added_successfuly',_l('contract')));\n\t\t\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//echo 'sa';\n\t\t\t\tunset($_POST['firstname']);\n\t\t\t\tunset($_POST['lastname']);\n\t\t\t\tunset($_POST['email']);\n\t\t\t\tunset($_POST['phonenumber']);\n\t\t\t\tunset($_POST['phone_other']);\n\t\t\t\tunset($_POST['no_civique']);\n\t\t\t\tunset($_POST['address']);\n\t\t\t\tunset($_POST['app']);\n\t\t\t\tunset($_POST['city']);\n\t\t\t\tunset($_POST['state']);\n\t\t\t\tunset($_POST['zip']);\n\t\t\t\tunset($_POST['password']);\n\t\t\t\tunset($_POST['userid']);\n\t\t\t\tunset($_POST['animal_name2']);\n\t\t\t\tunset($_POST['race2']);\n\t\t\t\tunset($_POST['color2']);\n\t\t\t\tunset($_POST['remarque2']);\n\t\t\t\tunset($_POST['number2']);\n\t\t\t\tunset($_POST['attachment2']);\n\t\t\t\tunset($_POST['sexe2']);\n\t\t\t\tunset($_POST['method2']);\n\t\t\t\tunset($_POST['rfid2']);\n\t\t\t\tunset($_POST['animal_name3']);\n\t\t\t\tunset($_POST['race3']);\n\t\t\t\tunset($_POST['color3']);\n\t\t\t\tunset($_POST['remarque3']);\n\t\t\t\tunset($_POST['number3']);\n\t\t\t\tunset($_POST['attachment3']);\n\t\t\t\tunset($_POST['sexe3']);\n\t\t\t\tunset($_POST['method3']);\n\t\t\t\tunset($_POST['rfid3']);\n\t\t\t\t\n\t\t\t\t$contract_id = $_POST['edit'];\n\t\t\t\tunset($_POST['edit']);\n\t\t\t\t\n\t\t\t\t//print_r($_POST);\n\t\t\t\t\n\t\t\t\t$this->db->where('userid', $cliendid);\n\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t\n\t\t\t\t$_POST['number'];\n\t\t\t\t\n\t\t\t\t$success = $this->contracts_model->update($_POST, $contract_id);\n\n\t\t\t\tif($success){\n\t\t\t\t\tset_alert('success', _l('updated_successfuly',_l('contract')));\n\t\t\t\t} else {\n\t\t\t\t\tset_alert('warning', 'Numéro déjà utilisé');\n\t\t\t\t}\n\n\t\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t}\n\t\t}\n\n\t\tif($id == ''){\n\t\t\t$title = 'Ajouter nouvelle médaille';\n\t\t} else {\n\t\t\t$data['attachment'] = $this->contracts_model->get_contract_attachment($id);\n\t\t\t$data['contract'] = $this->contracts_model->get($id);\n\t\t\t$this->load->model('payment_modes_model');\n\t\t\t$data['payment_modes'] = $this->payment_modes_model->get();\n\t\t\t$client_id = $data['contract']->client;\n\t\t\t$data['client'] = $this->clients_model->get($client_id);\n\t\t\tif(!$data['contract']){\n\t\t\t\tblank_page(_l('contract_not_found'));\n\t\t\t}\n\t\t\t$title = _l('edit',_l('contract_lowercase'));\n\t\t}\n\t\t\n\t\t$this->load->model('payment_modes_model');\n $data['payment_modes'] = $this->payment_modes_model->get();\n\n\t\t$data['types'] = $this->contracts_model->get_contract_types();\n\t\t$this->load->model('clients_model');\n\t\t$data['clients'] = $this->clients_model->get();\n\t\t$data['title'] = $title;\n\t\t$this->load->view('admin/contracts/contract',$data);\n\t}", "function svbk_rcp_email_new_payment( $payment_id, $args ) {\n\n\tglobal $rcp_options;\n\t\n\t/**\n\t * @var RCP_Payments $rcp_payments_db\n\t */\n\tglobal $rcp_payments_db;\n\t\n\t$rcp_payment = $rcp_payments_db->get_payment( $payment_id );\n\t$member = new RCP_Member( $rcp_payment->user_id );\t\n\n\t$template = isset($rcp_options['mandrill_template_admin_new_payment']) ? $rcp_options['mandrill_template_admin_new_payment'] : '';\n\n\t$admin_emails = ! empty( $rcp_options['admin_notice_emails'] ) ? $rcp_options['admin_notice_emails'] : get_option('admin_email');\n\t$admin_emails = apply_filters( 'rcp_admin_notice_emails', explode( ',', $admin_emails ) );\n\t$admin_emails = array_map( 'sanitize_email', $admin_emails );\n\n\t$emails = new RCP_Mandrill_Emails;\n\t$emails->member_id = $member->ID;\n\t$emails->payment_id = $payment_id;\n\n\t$site_name = stripslashes_deep( html_entity_decode( get_bloginfo( 'name' ), ENT_COMPAT, 'UTF-8' ) );\n\n\t$admin_subject = sprintf( __( 'New manual payment on %s', 'rcp' ), $site_name );\n\n\tif( $template && $emails->sendTemplate($template, $admin_emails, $admin_subject ) ){\n\t\trcp_log( sprintf( '[Mandrill Emails] New Pending Payment email sent to admin(s) regarding payment #%d. Template: %s', $payment_id, $template ) );\n\t} else {\n\t\trcp_log( sprintf( '[Mandrill Emails] New Pending payment email not sent to admin(s) - template %s is empty or invalid.', ucwords( $status ), $template ) );\n\t}\n\n}", "public function VendorPayment($dt, $nm, $bn, $br, $amt, $rem)\n{\n include 'db.php';\n $stmt = \"INSERT INTO `gmc_approvals`.`accounts_vp` (\n `vp_dt` ,\n `vp_name` ,\n `vp_billno` ,\n `vp_billref` ,\n `vp_amt` ,\n `vp_note` ,\n `vp_ceo_approv` ,\n `vp_hod_approv` ,\n `vp_director_approv`\n )\n VALUES (\n '$dt', '$nm', '$bn', '$br', '$amt', '$rem', 'FALSE', 'FALSE', 'FALSE'\n )\";\n if ($dbcon->exec($stmt)) {\n header(\"Location: ../acc-vendorpay.html?update=req_true\");\n } else {\n header(\"Location: ../acc-vendorpay.html?update=req_false\");\n }\n}", "public function record_subscription_payment() { }", "public function add()\n {\n require_code('form_templates');\n\n $to = get_param_string('to', '');\n\n $products = find_all_products();\n $list = new Tempcode();\n foreach ($products as $type_code => $details) {\n if ($details[0] == PRODUCT_INVOICE) {\n $text = do_lang_tempcode('CUSTOM_PRODUCT_' . $type_code);\n if ($details[1] != '?') {\n $text->attach(escape_html(' (' . $details[1] . ' ' . get_option('currency') . ')'));\n }\n $list->attach(form_input_list_entry($type_code, false, $text));\n }\n }\n if ($list->is_empty()) {\n inform_exit(do_lang_tempcode('NOTHING_TO_INVOICE_FOR'));\n }\n $fields = new Tempcode();\n $fields->attach(form_input_list(do_lang_tempcode('PRODUCT'), '', 'type_code', $list));\n $fields->attach(form_input_username(do_lang_tempcode('USERNAME'), do_lang_tempcode('DESCRIPTION_INVOICE_FOR'), 'to', $to, true));\n $fields->attach(form_input_float(do_lang_tempcode('AMOUNT'), do_lang_tempcode('INVOICE_AMOUNT_TEXT', escape_html(get_option('currency'))), 'amount', null, false));\n $fields->attach(form_input_line(do_lang_tempcode('INVOICE_SPECIAL'), do_lang_tempcode('DESCRIPTION_INVOICE_SPECIAL'), 'special', '', false));\n $fields->attach(form_input_text(do_lang_tempcode('NOTE'), do_lang_tempcode('DESCRIPTION_INVOICE_NOTE'), 'note', '', false));\n\n $post_url = build_url(array('page' => '_SELF', 'type' => '_add'), '_SELF');\n $submit_name = do_lang_tempcode('CREATE_INVOICE');\n\n return do_template('FORM_SCREEN', array('_GUID' => 'b8a08145bd1262c277e00a1151d6383e', 'HIDDEN' => '', 'TITLE' => $this->title, 'URL' => $post_url, 'FIELDS' => $fields, 'SUBMIT_ICON' => 'buttons__proceed', 'SUBMIT_NAME' => $submit_name, 'TEXT' => do_lang_tempcode('DESCRIPTION_INVOICE_PAGE'), 'SUPPORT_AUTOSAVE' => true));\n }", "public function makePayment() {\n\t\tLoggerRegistry::debug('CustomerModule::makePayment()');\n\t\t// TODO Payment gateway integration\n\t}", "public function createTransferPayment(Request $request);", "public function sendInvoice(Mage_Sales_Model_Order $order)\n {\n if($this->_logging){\n Mage::log('in sendInvoice', null, $this->_logfile);\n }\n $payment = $order->getPayment();\n $paymentInstance = $payment->getMethodInstance();\n $order->setActionFlag(Mage_Sales_Model_Order::ACTION_FLAG_INVOICE, true);\n // check if it is possible to invoice!\n if ($order->canInvoice()){\n if($this->_logging){\n Mage::log('sendInvoice sending invoice for '.$paymentInstance->getCode(), null, $this->_logfile);\n }\n try {\n // Initialize new magento invoice\n $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();\n // Set magento transaction id which returned from capayable\n $invoice->setTransactionId($payment->getLastTransId());\n // Allow payment capture and register new magento transaction\n $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);\n\n // TODO: get following to work\n //$invoice->addComment('U betaald via Achteraf betalen.', true, true);\n //$invoice->getOrder()->setCustomerNoteNotify(true);\n\n // Register invoice and apply it to order, order items etc.\n $invoice->register();\n\n $transaction = Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder());\n\n // Commit changes or rollback if error has occurred\n $transaction->save();\n\n /**\n * Register invoice with Capayable\n */\n $isApiInvoiceAccepted = $paymentInstance->processApiInvoice($invoice);\n if($this->_logging) {\n Mage::log('sendInvoice isApiInvoiceAccepted:', null, $this->_logfile);\n Mage::log($isApiInvoiceAccepted, null, $this->_logfile);\n }\n //if ($isApiInvoiceAccepted) {\n $invoice->getOrder()->setIsInProcess(true);\n $invoice->getOrder()->addStatusHistoryComment(\n 'Invoice created and email send', true\n );\n $invoice->sendEmail(true, '');\n $order->save();\n// } else {\n// $this->_getSession()->addError(Mage::helper('capayable')->__('Failed to send the invoice.'));\n// }\n } catch (Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n Mage::logException($e);\n }\n } else {\n Mage::log('sendInvoice: could not send invoice, invoice already sent.', null, $this->_logfile);\n }\n }", "abstract public function pay(int $orderID, $amount);", "public function invoice($id = '')\r\n {\r\n if (!has_permission('invoices', '', 'view') && !has_permission('invoices', '', 'view_own')) {\r\n access_denied('invoices');\r\n }\r\n if ($this->input->post()) {\r\n $invoice_data = $this->input->post(NULL, FALSE);\r\n if ($id == '') {\r\n if (!has_permission('invoices', '', 'create')) {\r\n access_denied('invoices');\r\n }\r\n $id = $this->invoices_model->add($invoice_data);\r\n if ($id) {\r\n set_alert('success', _l('added_successfuly', _l('invoice')));\r\n redirect(admin_url('invoices/list_invoices/' . $id));\r\n }\r\n } else {\r\n if (!has_permission('invoices', '', 'edit')) {\r\n access_denied('invoices');\r\n }\r\n $success = $this->invoices_model->update($invoice_data, $id);\r\n if ($success) {\r\n set_alert('success', _l('updated_successfuly', _l('invoice')));\r\n }\r\n redirect(admin_url('invoices/list_invoices/' . $id));\r\n }\r\n }\r\n if ($id == '') {\r\n $title = _l('create_new_invoice');\r\n $data['billable_tasks'] = array();\r\n } else {\r\n $invoice = $this->invoices_model->get($id);\r\n\r\n if (!$invoice || (!has_permission('invoices', '', 'view') && $invoice->addedfrom != get_staff_user_id())) {\r\n blank_page(_l('invoice_not_found'), 'danger');\r\n }\r\n\r\n $data['invoices_to_merge'] = $this->invoices_model->check_for_merge_invoice($invoice->clientid, $invoice->id);\r\n $data['expenses_to_bill'] = $this->invoices_model->get_expenses_to_bill($invoice->clientid);\r\n $data['invoice_recurring_invoices'] = $this->invoices_model->get_invoice_recuring_invoices($id);\r\n\r\n $data['invoice'] = $invoice;\r\n $data['edit'] = true;\r\n $data['billable_tasks'] = $this->tasks_model->get_billable_tasks($invoice->clientid);\r\n $title = _l('edit', _l('invoice_lowercase')) . ' - ' . format_invoice_number($invoice->id);\r\n }\r\n if ($this->input->get('customer_id')) {\r\n $data['customer_id'] = $this->input->get('customer_id');\r\n $data['do_not_auto_toggle'] = true;\r\n }\r\n\r\n $this->load->model('payment_modes_model');\r\n $data['payment_modes'] = $this->payment_modes_model->get('', array(\r\n 'expenses_only !=' => 1\r\n ));\r\n $this->load->model('taxes_model');\r\n $data['taxes'] = $this->taxes_model->get();\r\n $this->load->model('invoice_items_model');\r\n $data['items'] = $this->invoice_items_model->get_grouped();\r\n $data['items_groups'] = $this->invoice_items_model->get_groups();\r\n\r\n $this->load->model('currencies_model');\r\n $data['currencies'] = $this->currencies_model->get();\r\n\r\n $where_clients = 'tblclients.active=1';\r\n\r\n if (!has_permission('customers', '', 'view')) {\r\n $where_clients .= ' AND tblclients.userid IN (SELECT customer_id FROM tblcustomeradmins WHERE staff_id=' . get_staff_user_id() . ')';\r\n }\r\n\r\n $data['clients'] = $this->clients_model->get('', $where_clients);\r\n if ($id != '') {\r\n if (total_rows('tblclients', array(\r\n 'active' => 0,\r\n 'userid' => $data['invoice']->clientid\r\n )) > 0 || (total_rows('tblcustomeradmins', array(\r\n 'staff_id' => get_staff_user_id(),\r\n 'customer_id' => $data['invoice']->clientid\r\n )) == 0 && !has_permission('customers', '', 'view'))) {\r\n $data['clients'][] = $this->clients_model->get($data['invoice']->clientid, array(), 'row_array');\r\n }\r\n }\r\n\r\n $data['projects'] = array();\r\n if ($id != '' || isset($data['customer_id'])) {\r\n\r\n $where = '';\r\n $where_customer_id = (isset($data['customer_id']) ? $data['customer_id'] : $invoice->clientid);\r\n $where .= 'clientid=' . $where_customer_id;\r\n\r\n if (!has_permission('projects', '', 'view')) {\r\n $where .= ' AND id IN (SELECT project_id FROM tblprojectmembers WHERE staff_id=' . get_staff_user_id() . ')';\r\n }\r\n\r\n $data['projects'] = $this->projects_model->get('', $where);\r\n\r\n if ($id != '' && $data['invoice']->project_id != 0) {\r\n if (total_rows('tblprojectmembers', array(\r\n 'staff_id' => get_staff_user_id(),\r\n 'project_id' => $data['invoice']->project_id\r\n )) == 0 && !has_permission('projects', '', 'view')) {\r\n $this->db->where('id', $data['invoice']->project_id);\r\n $data['projects'][] = $this->db->get('tblprojects')->row_array();\r\n }\r\n }\r\n }\r\n\r\n $data['staff'] = $this->staff_model->get('', 1);\r\n $data['title'] = $title;\r\n $data['bodyclass'] = 'invoice';\r\n $data['accounting_assets'] = true;\r\n $this->load->view('admin/invoices/invoice', $data);\r\n }", "public function updateInvoice($task = NULL) {\r\n //echo '<pre>'; print_r($this->input->post()); die();\r\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\r\n if (!empty($_POST['delinvoiceId']) && $_POST['delinvoiceId'] != 0 && $_POST['delinvoiceId'] != NULL) {\r\n $response = $this->clients->delinvoiceItem($_POST['delinvoiceId']);\r\n if ($response) {\r\n if ($this->input->post('status') == 3) {\r\n $this->clients->deletetbDetails($_POST['delinvoiceId'], 'INVOICE');\r\n }\r\n }\r\n }\r\n $this->load->model('clients');\r\n $_POST['task'] = safe($this->encrypt->decode($_POST['task']));\r\n $task = $_POST['task'];\r\n //echo '<pre>';print_r($_POST);echo '</pre>';die;\r\n if ($_POST['task'] == 'copy' || $_POST['task'] == 'CreateCopy') {\r\n $_POST['description'] = array_filter($_POST['editDescription']);\r\n $_POST['quantity'] = array_filter($_POST['editQuantity']);\r\n $_POST['unitprice'] = array_filter($_POST['editUnitprice']);\r\n $_POST['vat'] = array_filter($_POST['editVat']);\r\n $_POST['customerName'] = safe($_POST['editName']);\r\n $_POST['customerAddress'] = '';\r\n $_POST['invoiceDate'] = safe($_POST['editInvoiceDate']);\r\n $_POST['customer'] = $this->clients->getUserID($this->encrypt->decode($_POST['eInvoiceID']));\r\n $_POST['task'] = ($_POST['task'] == 'CreateCopy') ? 'create' : '';\r\n\r\n $result = $this->clients->createInvoice($_POST);\r\n if ($result) {\r\n if ($_POST['task'] == 'copy') {\r\n $json['msg'] = 'Successfully created the ' . $result . ' invoice';\r\n } else {\r\n $json['msg'] = 'Successfully created the invoice ' . $result;\r\n }\r\n exit;\r\n } else {\r\n $json['msg'] = 'UNEXPECED ERROR OCCURED, PLEASE TRY AGAIN LATER';\r\n }\r\n } else {\r\n $result = $this->clients->updateInvoice($_POST);\r\n if ($result) {\r\n if ($task == 'update') {\r\n $json['msg'] = sprintf($this->lang->line('CLIENT_INVOICE_UPDATE_SUCCESS'), $result);\r\n } else {\r\n $json['msg'] = sprintf($this->lang->line('CLIENT_INVOICE_CREATE_SUCCESS'), $result);\r\n }\r\n } else {\r\n $json['msg'] = 'UNEXPECED ERROR OCCURED, PLEASE TRY AGAIN LATER';\r\n }\r\n }\r\n echo json_encode($json);\r\n die;\r\n } else {\r\n show_404();\r\n }\r\n }", "private function _generateInvoice()\n {\n $order = $this->_getOrder();\n if ($order->canInvoice()) {\n $invoice = $order->prepareInvoice();\n\n $invoice->register();\n Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder())\n ->save();\n \n $invoice->pay()->save();\n\n $order->save();\n\n $invoice->sendEmail(\n (boolean) Mage::getStoreConfig(\n 'payment/paymentnetwork_pnsofortueberweisung/send_mail', \n Mage::app()->getStore()->getStoreId()\n ), ''\n );\n }\n }", "public function ajax_make_invoice() {\n $post_id = (int)$_POST['post_id'];\n $ifpaid = self::extract_ifpaid_tag(get_post_field('post_content', $post_id));\n if (!$ifpaid) return status_header(404);\n\n $invoice = $this->charge->invoice([\n 'currency' => $ifpaid->currency,\n 'amount' => $ifpaid->amount,\n 'description' => get_bloginfo('name') . ': pay to continue reading ' . get_the_title($post_id),\n 'metadata' => [ 'source' => 'wordpress-lightning-publisher', 'post_id' => $post_id, 'url' => get_permalink($post_id) ]\n ]);\n\n wp_send_json($invoice->id, 201);\n }", "public function bookPayment($invoiceDocNo, $amount, $discount=0, $restOk = false, $date='', $additionalNote='', $fromCreditAmount=0) {\n trace('[METHOD] '.__METHOD__);\n \n $date = tx_ptgsaaccounting_div::convertDateToMySqlFormat($date);\n trace($additionalNote,0,'$additionalNote'); \n $note = $additionalNote != '' ? $invoiceDocNo . ' ' . $additionalNote : $invoiceDocNo;\n if ($date == '') {\n throw new tx_pttools_exception('Wrong DateFormat', 3, 'Date '.$date.' has no valid Format. Allowed Formats are \\'Y-m-d\\' \\'d.m.Y\\' \\'d.m.y\\'');\n }\n $invoiceDocUpdateFieldsArr = array(); \n $paymentUpdateFieldsArr = array(); \n \n $gsaAccountingTransactionAccessorObj = tx_ptgsaaccounting_gsaTransactionAccessor::getInstance();\n $gsaShopTransactionAccessorObj = tx_ptgsashop_gsaTransactionAccessor::getInstance();\n $invoiceDocFieldsArr = $gsaShopTransactionAccessorObj->selectTransactionDocumentData($invoiceDocNo); // get complete transaction document data\n \n trace($amount,0,'$amount');\n trace($discount,0,'$discount');\n\n // get related customer object, set booking data\n $customerObj = new tx_ptgsauserreg_customer($invoiceDocFieldsArr['ADRINR']);\n \n // update the related customer's transaction volume (\"Umsatz\"): ADRESSE.KUMSATZ, KUNDE.UMSATZ, KUNDE.SALDO, KUNDE.LETZTERUMSATZ\n $customerObj->registerTransactionPayment($amount, $discount); \n\n $invoiceDocFieldsArr['BEZSUMME'] += (double)$amount;\n $invoiceDocFieldsArr['SKONTOBETRAG'] += (double)$discount;\n\n $invoiceDocUpdateFieldsArr['BEZSUMME'] = $invoiceDocFieldsArr['BEZSUMME'];\n $invoiceDocUpdateFieldsArr['SKONTOBETRAG'] = $invoiceDocFieldsArr['SKONTOBETRAG'];\n $invoiceDocUpdateFieldsArr['LETZTERUSER'] = 'Online-Shop Bezahlgenerator'; // data type: varchar(30)\n $invoiceDocUpdateFieldsArr['LETZTERUSERDATE'] = date('Y-m-d H:i:s');\n \n $payed = $invoiceDocFieldsArr['BEZSUMME'] + $invoiceDocFieldsArr['GUTSUMME'] + $invoiceDocFieldsArr['SKONTOBETRAG'];\n trace($payed,0,'payed');\n if ($restOk || (bcsub($payed,$invoiceDocFieldsArr['ENDPRB'],$this->precision) )>=0) {\n trace('Auftrag Ok');\n $invoiceDocUpdateFieldsArr['RESTOK'] = 1; \n $invoiceDocUpdateFieldsArr['AUFTRAGOK'] = 1; \n }\n $gsaShopTransactionAccessorObj->updateTransactionDocument($invoiceDocNo, $invoiceDocUpdateFieldsArr);\n \n /*\n * Example XML Part from GSAUFTRAG Tabelle ZAHLUNG TODO: Delete if it works \n <ZAHLUNG>\n <NUMMER>11</NUMMER>\n <AUFINR>2049</AUFINR>\n <OPNUMMER>50000061</OPNUMMER>\n <BETRAG>40.2100</BETRAG>\n <DATUM>2007-08-28</DATUM>\n <BEMERKUNG>RE-200708/00090</BEMERKUNG>\n <BANK>Volksbank</BANK> aus configArray\n <FIBUKTO>1800</FIBUKTO> aus configArray \n <EURO>1</EURO>\n <AUSGUTSCHRIFTEN>0.0000</AUSGUTSCHRIFTEN> TODO: whats that\n </ZAHLUNG>\n */\n $gsaTextfileDataAccessor = tx_ptgsasocket_textfileDataAccessor::getInstance();\n $paymentUpdateFieldsArr['NUMMER'] = 0; // will be overwritten/set by insertPayment()\n $paymentUpdateFieldsArr['OPNUMMER'] = 0; // will be overwritten/set by insertPayment()\n $paymentUpdateFieldsArr['BETRAG'] = (double)$amount;\n $paymentUpdateFieldsArr['DATUM'] = $date;\n $paymentUpdateFieldsArr['AUFINR'] = $invoiceDocFieldsArr['NUMMER'];\n $paymentUpdateFieldsArr['BEMERKUNG'] = $note;\n $paymentUpdateFieldsArr['BANK'] = $this->classConfigArr['shopOperatorBankName'];\n $paymentUpdateFieldsArr['EURO'] = '1';\n $paymentUpdateFieldsArr['AUSGUTSCHRIFTEN'] = $fromCreditAmount;\n if ($this->classConfigArr['shopOperatorFinanceAccount']) {\n $paymentUpdateFieldsArr['FIBUKTO'] = $this->classConfigArr['shopOperatorFinanceAccount'];\n }\n trace($paymentUpdateFieldsArr,0,'$paymentUpdateFieldsArr'); //TODO: whats that\n $gsaAccountingTransactionAccessorObj->insertPayment($paymentUpdateFieldsArr);\n }", "public function createInvoice(Invoice $invoice): Invoice;", "public function actionCreate()\n {\n $model = new Payment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n if(Invoice::setStatus($model->invoice_id, Invoice::STATUS_PAID) ) {\n Yii::$app->session->addFlash(\n 'success', Yii::t('auth', 'You have successfully payed Invoice № '\n . $model->invoice->invoice_number . ' by Payment № '\n . $model->id)\n );\n } else {\n Yii::$app->session->addFlash(\n 'error',\n Yii::t('auth', 'Sorry, but something went wrong, Invoice №'.\n $model->invoice->invoice_number . ' not payed')\n );\n }\n\n $this->redirect('index');\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'invoicesList' => Invoice::getSelfInvoicesWithoutPaymentDropDown(Yii::$app->user->identity),\n 'paymentMethodList' => Payment::PAYMENT_METHODS_ARRAY,\n 'createFrom' => false\n ]);\n }\n }", "function invoice($param1 = '', $param2 = '', $param3 = '')\n {\n \n if ($param1 == 'create') {\n \n $data['student_id'] = $this->input->post('student_id');\n $data['title'] = $this->input->post('title');\n $data['description'] = $this->input->post('description');\n $data['amount'] = $this->input->post('amount');\n $data['amount_paid'] = $this->input->post('amount_paid');\n $data['due'] = $data['amount'] - $data['amount_paid'];\n $data['status'] = $this->input->post('status');\n $data['creation_timestamp'] = date(\"d-m-Y\", strtotime($this->input->post('date')));\n \n $this->db->insert('invoice', $data);\n $invoice_id = $this->db->insert_id();\n\n $data2['invoice_id'] = $invoice_id;\n $data2['student_id'] = $this->input->post('student_id');\n $data2['title'] = $this->input->post('title');\n $data2['description'] = $this->input->post('description');\n $data2['payment_type'] = 'Fee';\n $data2['method'] = $this->input->post('method');\n $data2['amount'] = $this->input->post('amount_paid');\n $data2['timestamp'] = date(\"d-m-Y\", strtotime($this->input->post('date')));\n \n $this->db->insert('payment' , $data2);\n\n // $this->session->set_flashdata('flash_message' , get_phrase('data_added_successfully'));\n echo \"addeed\";\n redirect(base_url() . 'admin/invoice', 'refresh');\n }\n $page_data['page'] = 'Admin/payment';\n // $page_data['page_title'] = get_phrase('manage_invoice/payment');\n $this->db->order_by('creation_timestamp', 'desc');\n $page_data['invoices'] = $this->db->get('invoice')->result_array();\n $this->load->view('common/template', $page_data);\n }", "function makeReceipt($money, $source_id, $destin_id, $payment_type, $pdo){\n\t\t\n\t\t/**********NOTIFY SYSTEM***********/\n\t\t//Notify shipment service\n\t\tif($payment_type==0) {\n\t\t\t//Send notification that shipping fee has been payed and process tracking number\n\t\t\t\n\t\t}\n\t\t//Notify advertising\n\t\telseif($payment_type==1) {\n\t\t\t//Send notification of the payment completed start advertising product\n\t\t\t\n\t\t}\n\t\t//Notify auction entrance\n\t\telseif($payment_type==2 || $payment_type==4) {\n\t\t\t//Send notification that entrance payment has been made and user can start bidding\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t/**********GENERATE RECEIPT(INSERT INTO DATABASE TABLE)**********/\n\t\tif($payment_type==0) {\n\t\t\t//fetch information from database tables\n\t\t\t //fetch buyer name from customer table\n\t\t\t\t$stmt = $pdo->prepare(\"SELECT user_name from customer where user_id=:userId\");\n\t\t\t\t$stmt->execute([\"userId\"=>$source_id]);\n\t\t\t\t$buyer = $stmt->fetchAll();\n\t\t\t //fecth item name, price, quantity and seller's user_id\n\t\t\t\t$stmt = $pdo->prepare(\"SELECT item_name, price, quantity, user_id from items where item_id=:itemId\");\n\t\t\t\t$stmt->execute([\"itemId\"=>$destin_id]);\n\t\t\t\t$item = $stmt->fetchAll();\n\t\t\t //from above seller user_id fetch seller_name\n\t\t\t\t$stmt = $pdo->prepare(\"SELECT user_name from customer where user_id=:userId\");\n\t\t\t\t$stmt->execute([\"userId\"=>$item[0][\"user_id\"]]);\n\t\t\t\t$seller = $stmt->fetchAll();\n\t\t\t //fetch shipment fee, tracking number and arrival date from shpping\n\t\t\t\t$stmt = $pdo->prepare(\"SELECT shipping_price, tracking_number, arrival_date from shipping where item_id=:itemId\");\n\t\t\t\t$stmt->execute([\"itemId\"=>$destin_id]);\n\t\t\t\t$ship = $stmt->fetchAll();\n\t\t\t//insert values into database table of buyer_reciept\n\t\t\t\t$stmt = $pdo->prepare(\"INSERT INTO buyer_receipt( item_id, item_name, item_cost, item_quantity, \n\t\t\t\t\t\t\t\t\tseller_name, seller_address, user_id, buyer_name, buyer_address, \n\t\t\t\t\t\t\t\t\tshipment_arrival, tracking_number, shipment_fee, total_price) \n\t\t\t\t\t\t\t\t\tVALUES(':item_id',':item_name',:item_cost,:item_quantity,\n\t\t\t\t\t\t\t\t\t':seller_name',':seller_address',':user_id',':buyer_name', ':buyer_address', \n\t\t\t\t\t\t\t\t\t:tracking_number, :shipment_fee, :total_price)\");\n\t\t\t\t$stmt->execute([\"item_id\" =>$destin_id, \"item_name\"=>$item[0][\"item_name\"], \"item_cost\"=>$item[0][\"price\"],\n\t\t\t\t\t\t\t\t\"item_quantity\"=>$item[0][\"quantity\"],\"seller_name\"=>$seller[0][\"user_name\"],\"seller_address\"=>\"seller place\",\n\t\t\t\t\t\t\t\t\"user_id\"=>$source_id,\"buyer_name\"=>$buyer[0][\"user_name\"],\"buyer_address\"=>\"buyer place\",\"tracking_number\"=>$ship[0][\"tracking_number\"],\n\t\t\t\t\t\t\t\t\"shipment_fee\"=>$ship[0][\"shipping_price\"],\"total_price\"=>$money]);\n\t\t\t//insert values into database table of seller_reciept\n\t\t\t\t$stmt = $pdo->prepare(\"INSERT INTO seller_receipt( item_id, item_name, item_cost, item_quantity, \n\t\t\t\t\t\t\t\t\ttime_of_purchase, seller_name, seller_address, user_id, buyer_name, buyer_address)\n\t\t\t\t\t\t\t\t\tVALUES(':item_id',':item_name',:item_cost,:item_quantity,null,\n\t\t\t\t\t\t\t\t\t':seller_name',':seller_address',':user_id',':buyer_name', ':buyer_address')\");\n\t\t\t\t$stmt->execute([\"item_id\" =>$destin_id, \"item_name\"=>$item[0][\"item_name\"], \"item_cost\"=>$item[0][\"price\"],\n\t\t\t\t\t\t\t\t\"item_quantity\"=>$item[0][\"quantity\"],\"seller_name\"=>$seller[0][\"user_name\"],\"seller_address\"=>\"seller place\",\n\t\t\t\t\t\t\t\t\"user_id\"=>$item[0][\"user_id\"],\"buyer_name\"=>$buyer[0][\"user_name\"],\"buyer_address\"=>\"buyer place\"]);\n\t\t}\n\t\t\n\t\t\n\t}", "static function insertPaymentInvoice($name, $email, $amount, $description, $notes, $lookupKey) {\n global $wpdb;\n if (false === $wpdb->insert(\"wp_invoice\", array(\n 'recipient_name' => $name,\n 'email' => $email,\n 'payment_amount' => $amount,\n 'payment_description' => $description,\n 'lookup_key' => $lookupKey),\n array( '%s', '%s', '%f', '%s', '%s'))) {\n error_log($wpdb->last_error . \" executing sql: \" . $wpdb->last_query);\n throw new DatabaseException($wpdb->last_error);\n }\n\n $inv_id = $wpdb->insert_id;\n if (false === $wpdb->insert(\"wp_invoice_notes\",\n array('invoice_id' => $inv_id, 'notes' => $notes),\n array( '%d', '%s'))) {\n error_log($wpdb->last_error . \" executing sql: \" . $wpdb->last_query);\n throw new DatabaseException($wpdb->last_error);\n }\n }", "public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}", "public function createOrder($accessToken){\n $url = \"https://api.sandbox.paypal.com/v2/checkout/orders\";\n \n /* Call Headers */\n $paymentHeaders = array(\"Content-Type: application/json\", \"Authorization: Bearer \".$accessToken);\n \n\t/* Generates Random Invoice Number */\n\t$randNo= (string)rand(10000,20000);\n \n /* Fill payload with transaction info */\n\n\t\t\t$postfields = '{}';\n $postfieldsArr = json_decode($postfields, true);\n $postfieldsArr['intent'] = \"CAPTURE\";\n \t$postfieldsArr['application_context']['shipping_preference'] = \"SET_PROVIDED_ADDRESS\";\n \t$postfieldsArr['application_context']['user_action'] = \"PAY_NOW\";\n \t\n \t$postfieldsArr['purchase_units'][0]['description'] = \"PayPalPizza\";\n \t$postfieldsArr['purchase_units'][0]['invoice_id'] = \"INV-PayPalPizza-\" . $randNo;\n \t$postfieldsArr['purchase_units'][0]['amount']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['value'] = $_POST['total_amt'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['value'] = $_POST['total_amt'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['recipient_name']= $_POST['shipping_recipient_name'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['phone']= $_POST['shipping_phone'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_1']= $_POST['shipping_line1'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_2']= $_POST['shipping_line2'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_2']= $_POST['shipping_city'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_1']= $_POST['shipping_state'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['postal_code']= $_POST['shipping_postal_code'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['country_code']= $_POST['shipping_country_code'];\n \n for($a = 0; $a < $_POST['itemnum']; $a++){\n $postfieldsArr['purchase_units'][0]['items'][$a]['name'] = $_POST[('itemname'. $a )];\n $postfieldsArr['purchase_units'][0]['items'][$a]['description'] = $_POST[('itemname'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['sku'] = $_POST[('itemsku'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['currency_code'] = $_POST['currency']; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['value'] = $_POST[('itemprice'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['quantity'] = $_POST[('itemamount'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['category'] = \"PHYSICAL_GOODS\";\n }\n \n $postfields = json_encode($postfieldsArr);\n \n/* Call Orders API */\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $paymentHeaders);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_POST, true);\n $run = curl_exec($ch);\n curl_close($ch);\n/* Call Orders API */\n\n echo $run;\n }", "public function whmcs_create_invoice($params = array()) {\n\t\t$params['action'] = 'CreateInvoice';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "public function pos_invoice(){\n\t\t\n\t\tredirect('dashboard_pharmacist/invoice/Cinvoice');\n\t\t\n\t\t$CI =& get_instance();\n\t\t$CI->load->library('linvoice');\n\t\t$content = $CI->linvoice->pos_invoice_add_form();\n\t\t$this->template->full_admin_html_view($content);\n\t}", "public function pay_post($uuid='') {\n\n $counselor = $this->User->load_payable($uuid);\n if($counselor) {\n $this->load->model('Payout');\n $this->load->helper('notification');\n\n if($counselor->amount>0) {\n \\Stripe\\Stripe::setApiKey($this->config->item('stripe_private_key'));\n try {\n\n $transfer = \\Stripe\\Transfer::create(\n array( \"amount\" => $counselor->amount*100,\n \"currency\" => \"usd\",\n \"destination\" => $counselor->stripe_customer_id,\n \"description\" => \"Transfer for \".$counselor->firstname.\" \".$counselor->lastname\n )\n );\n\n $this->Payout->add($transfer, $counselor->id);\n notify_payment($counselor->id, $transfer);\n\n json_success('Your payment has been submitted successfully as <b>transaction number '.$transfer['id'].'</b>!');\n } catch (Exception $e) {\n log_message('info', '[Transfer] Stripe_Transfer::create Exception: ' . $e->getMessage());\n $error = sprintf('There was a problem processing the transfer. The error returned from the authorizing gateway was \\'%s\\'', $e->getMessage());\n json_error($error);\n }\n }\n }\n }", "function pay($refNumber, $amount, $currency, $transactionID = \"\", $locale = \"en\") {\n\t\t\t\n\t\t\tif (empty($refNumber) || empty($amount) || empty($currency)) {\n\t\t\t\techo \"[ERROR] refNumber, amount and currency is REQUIRED\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userAddress)) {\n\t\t\t\techo \"[ERROR] Please set userAddress\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userCity)) {\n\t\t\t\techo \"[ERROR] Please set userCity\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userEmail)) {\n\t\t\t\techo \"[ERROR] Please set userEmail\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userFirstName)) {\n\t\t\t\techo \"[ERROR] Please set userFirstName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userLastName)) {\n\t\t\t\techo \"[ERROR] Please set userLastName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\n\t\t\tif (empty($transactionID)) {\n\t\t\t\t$transactionID = uniqid();\n\t\t\t}\n\t\t\t\n\t\t\t$url = \"https://testsecureacceptance.cybersource.com/pay\";\n\t\t\tif($this->isLive) {\n\t\t\t\t$url = \"https://secureacceptance.cybersource.com/pay\";\n\t\t\t}\n\t\t\t\n\t\t\t$arr = array(\n\t\t\t\t'access_key' => $this->accessKey,\n\t\t\t\t'profile_id' => $this->profileID,\n\t\t\t\t'locale' => $locale,\n\t\t\t\t'transaction_uuid' => $transactionID,\n\t\t\t\t'signed_field_names' => $this->signVariables,\n\t\t\t\t'unsigned_field_names' => $this->unsign,\n\t\t\t\t'signed_date_time' => gmdate(\"Y-m-d\\TH:i:s\\Z\"),\n\t\t\t\t'transaction_type' => \"sale\",\n\t\t\t\t'reference_number' => $refNumber,\n\t\t\t\t'auth_trans_ref_no' => $refNumber,\n\t\t\t\t'merchant_descriptor' => \"Pixil\",\n\t\t\t\t'amount' => $amount,\n\t\t\t\t'currency' => strtoupper($currency),\n\t\t\t\t'bill_to_address_city' => $this->userCity,\n\t\t\t\t'bill_to_address_country' => $this->userCountry,\n\t\t\t\t'bill_to_email' => $this->userEmail,\n\t\t\t\t'bill_to_address_line1' => $this->userAddress,\n\t\t\t\t'bill_to_forename' => $this->userFirstName,\n\t\t\t\t'bill_to_surname' => $this->userLastName,\n\t\t\t\t'bill_to_address_line2' => \"\",\n\t\t\t\t'bill_to_address_state' => \"\",\n\t\t\t\t'bill_to_address_postal_code' => \"\",\n\t\t\t\t'bill_to_phone' => \"\"\n\t\t\t);\n\t\t\t\n\t\t\tif (!empty($this->mdd1)) {\n\t\t\t\t$arr['merchant_defined_data1'] = $this->mdd1;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data1\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd2)) {\n\t\t\t\t$arr['merchant_defined_data2'] = $this->mdd2;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data2\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd3)) {\n\t\t\t\t$arr['merchant_defined_data3'] = $this->mdd3;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data3\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd4)) {\n\t\t\t\t$arr['merchant_defined_data4'] = $this->mdd4;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data4\";\n\t\t\t}\n\t\t\t\n\t\t\t$signature = $this->sign($arr);\n\t\t\t\n\t\t\t$html = \"<html><head></head><body><form action='$url' method='post'/>\"; \n\t\t\tforeach($arr as $key => $value) {\n\t\t\t\t$html .= \"<input type='hidden' name='$key' value='$value' />\";\n\t\t\t}\n\t\t\t\n\t\t\t$html .= \"<input type='hidden' name='signature' value='$signature' />\";\n\t\t\t\n\t\t\t$html .= \"</form>\";\n\t\t\t$html .= \"<script type='text/javascript'>\";\n\t\t\t$html .= \"setTimeout(function() { document.forms[0].submit(); }, 2000);\";\n\t\t\t$html .= \"</script>\";\n\t\t\t$html .= \"</body>\";\n\t\t\techo $html;\n\t\t}", "function invoice($student_id = '' , $param1 = '', $param2 = '', $param3 = '')\n\t\t{\n\t\t\t//if($this->session->userdata('parent_login')!=1)redirect(base_url() , 'refresh');\n\t\t\tif ($param1 == 'make_payment') {\n\t\t\t\t$invoice_id = $this->input->post('invoice_id');\n\t\t\t\t$system_settings = $this->db->get_where('settings', array(\n 'type' => 'paypal_email'\n\t\t\t\t))->row();\n\t\t\t\t$invoice_details = $this->db->get_where('invoice', array(\n 'invoice_id' => $invoice_id\n\t\t\t\t))->row();\n\t\t\t\t\n\t\t\t\t/****TRANSFERRING USER TO PAYPAL TERMINAL****/\n\t\t\t\t$this->paypal->add_field('rm', 2);\n\t\t\t\t$this->paypal->add_field('no_note', 0);\n\t\t\t\t$this->paypal->add_field('item_name', $invoice_details->title);\n\t\t\t\t$this->paypal->add_field('amount', $invoice_details->amount);\n\t\t\t\t$this->paypal->add_field('custom', $invoice_details->invoice_id);\n\t\t\t\t$this->paypal->add_field('business', $system_settings->description);\n\t\t\t\t$this->paypal->add_field('notify_url', base_url() . 'index.php?parents/invoice/paypal_ipn');\n\t\t\t\t$this->paypal->add_field('cancel_return', base_url() . 'index.php?parents/invoice/paypal_cancel');\n\t\t\t\t$this->paypal->add_field('return', base_url() . 'index.php?parents/invoice/paypal_success');\n\t\t\t\t\n\t\t\t\t$this->paypal->submit_paypal_post();\n\t\t\t\t// submit the fields to paypal\n\t\t\t}\n\t\t\tif ($param1 == 'paypal_ipn') {\n\t\t\t\tif ($this->paypal->validate_ipn() == true) {\n\t\t\t\t\t$ipn_response = '';\n\t\t\t\t\tforeach ($_POST as $key => $value) {\n\t\t\t\t\t\t$value = urlencode(stripslashes($value));\n\t\t\t\t\t\t$ipn_response .= \"\\n$key=$value\";\n\t\t\t\t\t}\n\t\t\t\t\t$data['payment_details'] = $ipn_response;\n\t\t\t\t\t$data['payment_timestamp'] = strtotime(date(\"m/d/Y\"));\n\t\t\t\t\t$data['payment_method'] = 'paypal';\n\t\t\t\t\t$data['status'] = 'paid';\n\t\t\t\t\t$invoice_id = $_POST['custom'];\n\t\t\t\t\t$this->db->where('invoice_id', $invoice_id);\n\t\t\t\t\t$this->db->update('invoice', $data);\n\t\t\t\t\t\n\t\t\t\t\t$data2['method']='paypal';\n\t\t\t\t\t$data2['invoice_id']=$_POST['custom'];\n\t\t\t\t\t$data2['timestamp']=strtotime(date(\"m/d/Y\"));\n\t\t\t\t\t$data2['payment_type']='income';\n\t\t\t\t\t$data2['title']=$this->db->get_where('invoice' , array('invoice_id' => $data2['invoice_id']))->row()->title;\n\t\t\t\t\t$data2['description']=$this->db->get_where('invoice' , array('invoice_id' => $data2['invoice_id']))->row()->description;\n\t\t\t\t\t$data2['student_id']=$this->db->get_where('invoice' , array('invoice_id' => $data2['invoice_id']))->row()->student_id;\n\t\t\t\t\t$data2['amount']=$this->db->get_where('invoice' , array('invoice_id' => $data2['invoice_id']))->row()->amount;\n\t\t\t\t\t$this->db->insert('payment' , $data2);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($param1 == 'paypal_cancel') {\n\t\t\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_cancelled'));\n\t\t\t\tredirect(base_url() . 'index.php?parents/invoice/' . $student_id, 'refresh');\n\t\t\t}\n\t\t\tif ($param1 == 'paypal_success') {\n\t\t\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_successfull'));\n\t\t\t\tredirect(base_url() . 'index.php?parents/invoice/' . $student_id, 'refresh');\n\t\t\t}\n\t\t\t$parent_profile = $this->db->get_where('parent', array(\n 'parent_id' => $this->session->userdata('parent_id')\n\t\t\t))->row();\n\t\t\t$page_data['student_id'] = $student_id;\n\t\t\t$page_data['page_name'] = 'invoice';\n\t\t\t$page_data['page_title'] = get_phrase('manage_invoice/payment');\n\t\t\t$this->load->view('backend/index', $page_data);\n\t\t}", "public function payment(){\n\n\t}", "public function add($invoiceId = 0) {\n require_once(MODEL . \"master/company.php\");\n require_once(MODEL . \"master/project.php\");\n require_once(MODEL . \"master/creditor.php\");\n require_once(MODEL . \"common/trx_type.php\");\n require_once(MODEL . \"common/ap_invoice_type.php\");\n require_once(MODEL . \"master/activity.php\");\n require_once(MODEL . \"master/department.php\");\n require_once(MODEL . \"master/units.php\");\n require_once(MODEL . \"tax/taxtype.php\");\n $loader = null;\n $invoice = new Invoice();\n if ($invoiceId > 0 ) {\n $invoice = $invoice->LoadById($invoiceId);\n if ($invoice == null) {\n $this->persistence->SaveState(\"error\", \"Maaf Data Invoice dimaksud tidak ada pada database. Mungkin sudah dihapus!\");\n redirect_url(\"ap.invoice\");\n }\n if ($invoice->PaidAmount > 0) {\n $this->persistence->SaveState(\"error\", sprintf(\"Maaf Invoice No. %s sudah terbayap. Tidak boleh diubah lagi..\", $invoice->InvoiceNo));\n redirect_url(\"ap.invoice\");\n }\n if ($invoice->InvoiceStatus == 1) {\n $this->persistence->SaveState(\"error\", sprintf(\"Maaf Invoice No. %s sudah di-Approve- Tidak boleh diubah lagi..\", $invoice->InvoiceNo));\n redirect_url(\"ap.invoice\");\n }\n if ($invoice->InvoiceStatus == 2) {\n $this->persistence->SaveState(\"error\", sprintf(\"Maaf Invoice No. %s sudah di-Posting- Tidak boleh diubah lagi..\", $invoice->InvoiceNo));\n redirect_url(\"ap.invoice\");\n }\n if ($invoice->InvoiceStatus == 3) {\n $this->persistence->SaveState(\"error\", sprintf(\"Maaf Invoice No. %s sudah di-Void- Tidak boleh diubah lagi..\", $invoice->InvoiceNo));\n redirect_url(\"ap.invoice\");\n }\n if ($invoice->CreatebyId <> \\AclManager::GetInstance()->GetCurrentUser()->Id && $this->userLevel == 1){\n $this->persistence->SaveState(\"error\", sprintf(\"Maaf Anda tidak boleh mengubah data ini!\",$invoice->InvoiceNo));\n redirect_url(\"ap.invoice\");\n }\n }\n // load details\n $invoice->LoadDetails();\n //load data cabang\n $loader = new \\Project();\n if ($this->userLevel < 5) {\n $project = $loader->LoadAllowedProject($this->userProjectIds);\n }else{\n $project = $loader->LoadByEntityId($this->userCompanyId);\n }\n //load creditor\n $loader = new \\Creditor();\n $creditors = $loader->LoadByEntity($this->userCompanyId);\n //load dept\n $loader = new \\Department();\n $depts = $loader->LoadByEntityId($this->userCompanyId);\n //load units\n $loader = new \\Units();\n $units = $loader->LoadAll($this->userCompanyId);\n //load activity\n $loader = new \\Activity();\n $activitys = $loader->LoadByEntityId($this->userCompanyId);\n //load trxtype\n $loader = new \\TrxType();\n $trxtypes = $loader->LoadByModuleId($this->userCompanyId,2);\n //load trxtype\n $loader = new \\ApInvoiceType();\n $invtype = $loader->LoadByEntity($this->userCompanyId);\n //load taxtype\n $loader = new \\TaxType();\n $taxtype = $loader->LoadByMode($this->userCompanyId,1);\n $this->Set(\"taxtypes\", $taxtype);\n //kirim ke view\n $this->Set(\"userLevel\", $this->userLevel);\n $this->Set(\"userCompId\", $this->userCompanyId);\n $this->Set(\"projects\", $project);\n $this->Set(\"trxtypes\", $trxtypes);\n $this->Set(\"invtypes\", $invtype);\n $this->Set(\"creditors\", $creditors);\n $this->Set(\"depts\", $depts);\n $this->Set(\"units\", $units);\n $this->Set(\"activitys\", $activitys);\n $this->Set(\"invoice\", $invoice);\n $acl = \\AclManager::GetInstance();\n $this->Set(\"acl\", $acl);\n $this->Set(\"itemsCount\", $this->InvoiceItemsCount($invoiceId));\n }", "private function add_transaction_info($post)\n {\n global $woocommerce;\n $orderId = $post['x_invoice_num'];\n $order = new WC_Order($orderId);\n $message = __('Server Paysto payment system return data in post: ', 'woocommerce') .\n print_r($post, true);\n $order->add_order_note($message);\n return;\n }", "public function storePayment($payments, $invoice_id) {\n $invoice = Invoice::find($invoice_id);\n $invoice->payment()->delete();\n collect($payments)->each(function($val) use($invoice){\n if(($val['price'] ?? 0) > 0) {\n $invoicePayment = new InvoicePayment();\n $invoicePayment->invoice_id = $invoice->id;\n $invoicePayment->method = $val['method'];\n $invoicePayment->price = $val['price'];\n $invoicePayment->description = $val['description'] ?? null;\n $invoicePayment->save();\n }\n });\n }", "public function _makepayment($Invoice_Id, $AmountPaid, $AmountDue, $PaymentType, $ClientName )\r\n {\r\n try\r\n {\r\n $mysql = \"INSERT INTO payments (Payment_Id, Payment_Amount_Paid, Payment_Amount_Due, Payment_Type, Payment_Invoice_Id, Payment_Client_Id, Payment_Status) VALUES (NULL, $AmountPaid, $AmountDue, $PaymentType, $Invoice_Id, $ClientName, NULL)\";\r\n\r\n //Execute the query\r\n $result = $this->db->ExecuteQuery($mysql);\r\n\r\n //Return the values\r\n return ($result);\r\n }\r\n catch(Exception $e)\r\n {\r\n echo \"Couldn't Complete the payment\";\r\n }\r\n }", "public function sendInvoice() {\n\n $account_invoice_ids = $this->_client->search(\"account.invoice\",\n [\n [\"state\", \"=\", \"open\"],\n [\"type\", \"=\", \"out_invoice\"],\n [\"journal_id\", \"=\", 15],\n [\"sent\", \"=\", False]\n ]);\n\n foreach ($account_invoice_ids as $account_invoice_id) {\n\n $result = $this->_client->execute(\"email.template\", \"send_mail\",\n [\n 4, // Template invio\n $account_invoice_id,\n True\n ]);\n\n if (isset($result[\"faultCode\"])) {\n Util::printError(\"AccountInvoice.sendInvoice\", $result[\"faultString\"]);\n }\n\n $data = [\n \"sent\" => true\n ];\n\n $result = $this->_client->write(\"account.invoice\", $account_invoice_id, $data);\n\n if (isset($result[\"faultCode\"])) {\n Util::printError(\"AccountInvoice.sendInvoice\", $result[\"faultString\"]);\n }\n\n }\n\n }", "function Payment ($Amt, $glt, $ref, $cur, $leg, $id, $tipocambio, $conversion, $tag){\n\t\t$this->Amount =$Amt;\n\t\t$this->gltemp = $glt;\n\t\t$this->reference = $ref;\n\t\t$this->currency = $cur;\n\t\t$this->legalname = $leg;\n\t\t$this->ID = $id;\n\t\t$this->tipocambio = $tipocambio;\n\t\t$this->conversion = $conversion;\n\t\t$this->tag = $tag;\n\t}", "public function sendMileStoneInvoiceToClient($project_id, $project_payment){\n \n\t\t\t$logedInuser = Auth::user();\n $project = Project::where('id',$project_id)->where('user_id', $logedInuser->id)->first();\n\t $admincomission = $this->comission->getComission();\n\t $pdf =$this->project->returnClientInvoicePdf($project, $project_payment, $admincomission);\n\t \n $email = $logedInuser->email;\n $client_name = $logedInuser->first_name;\n\n $data[\"email\"]= $email;\n $data[\"subject\"]='Milestone Invoice';\n $data[\"client_name\"]=$client_name;\n try{\n \\Mail::send('EmailTemplate.milestone-invoice', $data, function($message)use($data,$pdf) {\n $message->to($data[\"email\"], $data[\"client_name\"])\n ->subject($data[\"subject\"])\n ->attachData($pdf->output(), \"Invoice.pdf\");\n });\n }catch(\\Exception $exception){\n // \n }\n }", "function genInvoice($order_id)\n {\n\n //CHECK AND GENERATE INVOICE\n $conf = $this->BL->conf;\n\n $temp = $this->BL->orders->get(\"WHERE `orders`.sub_id=\".intval($order_id));\n $order = $temp[0];\n\n $temp = $this->BL->orders->recurring_data($order_id, 0, \"SELECT\");\n $next_due_date = $temp['rec_next_date'];\n\n $order['bill_cycle'] = (empty ($order['bill_cycle']) || empty ($order['product_id']))?12:$order['bill_cycle'];\n $cycle_name = $this->props->cycles[$order['bill_cycle']];\n $desc = $order['product_id'] . \"-\" . $order['domain_name'] . \"-\" . $next_due_date;\n\n // Use the first invoice for this order and domain to generate a template.\n $temp = $this->BL->invoices->get(\"WHERE `invoices`.desc = '\" . $this->utils->quoteSmart($order['product_id'] . \"-\" . $order['domain_name']) . \"' AND `orders`.domain_name='\".$this->utils->quoteSmart($order['domain_name']).\"' AND `orders`.product_id=\".intval($order['product_id']));\n $start_invoice = $temp[0];\n $this->REQUEST['pay_text'] = \"\";\n $echo = \"\";\n\n\n //GET DOMAIN REGISTRATION PRICE\n $dom_array = explode(\".\", $order['domain_name'], 2);\n $sld = $dom_array[0];\n $tld = $dom_array[1];\n $tld_amount = 0;\n if ($order['dom_reg_type'] == 1)\n {\n $tld_data = $this->BL->tlds->find(array(\"WHERE `dom_ext`='\".$this->utils->quoteSmart($tld).\"'\"));\n $month_diff = $this->utils->count_months($order['sign_date'], $next_due_date);\n $division = $month_diff / ($order['dom_reg_year'] * 12);\n if ($order['dom_reg_year'] * 12 == $month_diff || $division == floor($division))\n {\n $echo .= \"RENEW DOMAIN, \";\n foreach ($tld_data as $t)\n {\n if ($order['dom_reg_year'] == $t['dom_period'])\n {\n $tld_amount = $t['dom_price'];\n }\n }\n }\n }\n //GET SUB-DOMAIN PRICE\n elseif ($order['dom_reg_type'] == 2)\n {\n $subdomain_data = $this->BL->subdomains->find(array(\"WHERE `maindomain`='\".$this->utils->quoteSmart($tld).\"'\"));\n $subdomain_cycle = $this->BL->subdomains->getCycles($subdomain_data[0]['main_id']);\n $echo .= \"RENEW SUB DOMAIN, \";\n $tld_amount = $subdomain_cycle[$cycle_name];\n }\n else\n {\n $tld_amount = 0;\n }\n if ($tld_amount > 0)\n {\n $this->REQUEST['pay_text'] .= $order['domain_name'] . \" => <b>\" . $this->BL->toCurrency($tld_amount,null,1);\n $this->REQUEST['pay_text'] .= \"</b><br>\";\n }\n $this->REQUEST['tld_fee'] = $tld_amount;\n\n\n //GET PRODUCT PRICE\n $cycle_amount = 0;\n $product_cycles = $this->BL->products->getCycles($order['product_id']);\n $cycle_amount = $product_cycles[$cycle_name];\n if ($cycle_amount > 0)\n {\n $this->REQUEST['pay_text'] .= $this->BL->getFriendlyName($order['product_id']) . \" => <b>\" . $this->BL->toCurrency($cycle_amount,null,1);\n $this->REQUEST['pay_text'] .= \"</b><br>\";\n }\n $this->REQUEST['cycle_fee']= $cycle_amount;\n\n\n //GET ADDON PRICE\n $pay_text1 = \"\";\n $order_addons = $this->BL->orders->getAddons($order_id);\n $inv_addon_fee = \"<&>\";\n $addon_amount = 0;\n foreach ($order_addons as $order_addon)\n {\n $addon_data = $this->BL->addons->getByKey($order_addon['addon_id']);\n $addon_cycles = $this->BL->addons->getCycles($order_addon['addon_id']);\n if (isset($addon_data['addon_name']))\n {\n $inv_addon_fee .= $addon_data['addon_name'] . \">0.00>\" . $this->utils->toFloat($addon_cycles[$cycle_name]) . \"<&>\";\n $addon_amount = $addon_amount + $addon_cycles[$cycle_name];\n $pay_text1 .= $addon_data['addon_name'] . \" => <b>\" . $this->BL->toCurrency($addon_cycles[$cycle_name],null,1);\n $pay_text1 .= \"</b><br>\";\n }\n }\n if ($addon_amount > 0)\n {\n $this->REQUEST['addon_fee'] = $inv_addon_fee;\n $this->REQUEST['pay_text'] .= $pay_text1;\n }\n\n //GET DISCOUNTS\n $this->REQUEST['inv_tld_disc'] = 0;\n $this->REQUEST['inv_plan_disc'] = 0;\n $this->REQUEST['inv_addon_disc']= 0;\n if ($conf['include_sp_rec'] == 1)\n {\n $this->REQUEST['inv_tld_disc'] = $start_invoice['inv_tld_disc'];\n $this->REQUEST['inv_plan_disc'] = $start_invoice['inv_plan_disc'];\n $this->REQUEST['inv_addon_disc']= $start_invoice['inv_addon_disc'];\n }\n\n //calculate subtotal\n $this->REQUEST['other_amount']= 0;\n $this->REQUEST['other_amount']= $this->REQUEST['other_amount'] + ($this->REQUEST['tld_fee'] * ($this->REQUEST['inv_tld_disc'] / 100));\n $this->REQUEST['other_amount']= $this->REQUEST['other_amount'] + ($this->REQUEST['cycle_fee'] * ($this->REQUEST['inv_plan_disc'] / 100));\n $this->REQUEST['other_amount']= $this->REQUEST['other_amount'] + ($addon_amount * ($this->REQUEST['inv_addon_disc'] / 100));\n $this->REQUEST['net_amount'] = $this->REQUEST['tld_fee'] + $this->REQUEST['cycle_fee'] + $addon_amount - $this->REQUEST['other_amount'];\n $this->REQUEST['desc'] = $desc;\n $temp = explode(\"-\",$next_due_date,3);\n $invoices = $this->BL->invoices->find(array(\"WHERE `desc` LIKE '\" . $this->utils->quoteSmart($order['product_id'] . \"-\" . $order['domain_name'] . \"-\" . trim($temp[0]) . \"-\" . trim($temp[1]) . \"-%\").\"'\"));\n if (count($invoices))\n {\n $order['credit'] = $invoices[0]['debit_credit_amount'];\n $order['credit_desc']= $invoices[0]['debit_credit_reason'];\n $order['credit_type']= 0;\n if ($invoices[0]['debit_credit'] == $this->props->lang['credit'])\n {\n $order['credit_type']= 1;\n }\n }\n\n //Count credit\n if ($order['credit'] > 0)\n {\n //negetive credit\n if ($order['credit_type'] == 0)\n {\n $this->REQUEST['net_amount'] = $this->REQUEST['net_amount'] + $order['credit'];\n $this->REQUEST['pay_text'] .= $this->props->lang['and'] . \" \" . $this->props->lang['debit'] . \" = <b>\" . $this->utils->toFloat($order['credit']);\n $this->REQUEST['pay_text'] .= \"</b> \" . $this->props->lang['reason'] . \" : <b>\" . $order['credit_desc'] . \"<b>\";\n $credit_balance = 0;\n $this->REQUEST['debit_credit'] = $this->props->lang['debit'];\n $this->REQUEST['debit_credit_amount']= $order['credit'];\n $this->REQUEST['credit_desc'] = $order['credit_desc'];\n }\n else\n {\n if ($this->REQUEST['net_amount'] > $order['credit'])\n {\n $this->REQUEST['net_amount']= $this->REQUEST['net_amount'] - $order['credit'];\n $credit_balance = 0;\n $this->REQUEST['debit_credit'] = $this->props->lang['credit'];\n $this->REQUEST['debit_credit_amount']= $order['credit'];\n $this->REQUEST['credit_desc'] = $order['credit_desc'];\n }\n else\n {\n $credit_balance = $order['credit'] - $this->REQUEST['net_amount'];\n $this->REQUEST['debit_credit'] = $this->props->lang['credit'];\n $this->REQUEST['debit_credit_amount']= $this->REQUEST['net_amount'];\n $this->REQUEST['net_amount'] = 0;\n $this->REQUEST['credit_desc'] = $order['credit_desc'];\n }\n $this->REQUEST['pay_text'] .= $this->props->lang['and'] . \" \" . $this->props->lang['credit'] . \" = <b>\" . $this->BL->toCurrency($order['credit'],null,1);\n $this->REQUEST['pay_text'] .= \"</b> \" . $this->props->lang['reason'] . \" : <b>\" . $order['credit_desc'] . \"<b>\";\n }\n $data = array();\n $data['id'] = $order['id'];\n if($credit_balance)\n {\n $data['credit'] = $credit_balance;\n }\n else\n {\n $data['credit'] = 0;\n $data['credit_type'] = '';\n $data['credit_desc'] = '';\n }\n $this->BL->customers->update($data);\n }\n\n //calculate tax\n //get tax data\n $tax_string = null;\n $total_tax_amount = 0;\n foreach ($this->calculateTax($this->REQUEST['net_amount'], $this->BL->getCustomerFieldValue(\"country\",$order['id']), $this->BL->getCustomerFieldValue(\"state\",$order['id'])) as $r_k => $r_v)\n {\n ${ $r_k }= $r_v;\n }\n $this->REQUEST['tax_percent'] = $tax_string;\n $this->REQUEST['tax_amount'] = $total_tax_amount;\n $this->REQUEST['gross_amount'] = $this->REQUEST['net_amount'] + $this->REQUEST['tax_amount'];\n $this->REQUEST['status'] = $this->props->invoice_status[0];\n $this->REQUEST['order_id'] = $order_id;\n $this->REQUEST['due_date'] = $next_due_date;\n\n // Set status if specified (otherwise we use the default)\n if (isset ($this->REQUEST['force_status']))\n {\n $this->REQUEST['status'] = $this->REQUEST['force_status'];\n }\n $echo .= $this->REQUEST['desc'] . \"<br />\";\n\n // If the invoice doesn't exist, create it.\n $this->REQUEST['invoice_no'] = 0;\n if (!count($invoices))\n {\n $this->REQUEST['invoice_no'] = $this->BL->invoices->add($this->REQUEST['order_id']);\n }\n // Otherwise, if the invoice already exists, but the status is 'Upcoming', update it.\n elseif ($invoices[0]['status'] == $this->props->invoice_status[5])\n {\n $this->REQUEST['invoice_no'] = $invoices[0]['invoice_no'];\n $this->BL->invoices->update($this->REQUEST);\n }\n\n // Set new due date if an invoice was created or updated\n if (!empty ($this->REQUEST['invoice_no']) || (count($invoices)))\n {\n $echo .= \"Updated due date.\\n\";\n $this->BL->recurring_data($this->REQUEST['order_id'], 0, \"UPDATE\", $this->REQUEST['due_date']);\n }\n\n // Email invoice if configured to do so, and if the invoice was created, and it is \"Pending\"\n if ($conf['en_automail'] && $this->REQUEST['status']==$this->props->invoice_status[0])\n {\n $this->mailInvoice($this->REQUEST['invoice_no']);\n }\n return $echo;\n }", "public function actionAddpayment() {\n\n $paymentmodel = new Payment();\n $paymentmodel->price = Yii::$app->request->post('price');\n $paymentmodel->id_orders = Yii::$app->request->post('id_orders');\n $paymentmodel->card_number = Yii::$app->request->post('card_number');\n $paymentmodel->expiration_year = Yii::$app->request->post('expiration_year');\n $paymentmodel->expiration_month = Yii::$app->request->post('expiration_month');\n $paymentmodel->cvcode = Yii::$app->request->post('cvcode');\n\n if(!$paymentmodel->validate()){\n \\Yii::$app->response->statusCode=409;\n return $paymentmodel->getErrors();\n }\n\n $paymentmodel->save();\n\n $last_payment = Payment::find()->orderBy(['id'=>SORT_DESC])->one();\n\n return [\"payment\"=>$last_payment];\n\n }", "protected function addOrder($data) {\n\t\n\t\t$this->db->query(\"INSERT INTO `\" . DB_PREFIX . \"order` SET invoice_prefix = '\" . $this->db->escape($data['invoice_prefix']) . \"', store_id = '\" . (int)$data['store_id'] . \"', store_name = '\" . $this->db->escape($data['store_name']) . \"', store_url = '\" . $this->db->escape($data['store_url']) . \"', customer_id = '\" . (int)$data['customer_id'] . \"', customer_group_id = '\" . (int)$data['customer_group_id'] . \"', firstname = '\" . $this->db->escape($data['firstname']) . \"', lastname = '\" . $this->db->escape($data['lastname']) . \"', email = '\" . $this->db->escape($data['email']) . \"', telephone = '\" . $this->db->escape($data['telephone']) . \"', fax = '\" . $this->db->escape($data['fax']) . \"', custom_field = '\" . $this->db->escape(isset($data['custom_field']) ? serialize($data['custom_field']) : '') . \"', payment_firstname = '\" . $this->db->escape($data['payment_firstname']) . \"', payment_lastname = '\" . $this->db->escape($data['payment_lastname']) . \"', payment_company = '\" . $this->db->escape($data['payment_company']) . \"', payment_address_1 = '\" . $this->db->escape($data['payment_address_1']) . \"', payment_address_2 = '\" . $this->db->escape($data['payment_address_2']) . \"', payment_city = '\" . $this->db->escape($data['payment_city']) . \"', payment_postcode = '\" . $this->db->escape($data['payment_postcode']) . \"', payment_country = '\" . $this->db->escape($data['payment_country']) . \"', payment_country_id = '\" . (int)$data['payment_country_id'] . \"', payment_zone = '\" . $this->db->escape($data['payment_zone']) . \"', payment_zone_id = '\" . (int)$data['payment_zone_id'] . \"', payment_address_format = '\" . $this->db->escape($data['payment_address_format']) . \"', payment_custom_field = '\" . $this->db->escape(isset($data['payment_custom_field']) ? serialize($data['payment_custom_field']) : '') . \"', payment_method = '\" . $this->db->escape($data['payment_method']) . \"', payment_code = '\" . $this->db->escape($data['payment_code']) . \"', shipping_firstname = '\" . $this->db->escape($data['shipping_firstname']) . \"', shipping_lastname = '\" . $this->db->escape($data['shipping_lastname']) . \"', shipping_company = '\" . $this->db->escape($data['shipping_company']) . \"', shipping_address_1 = '\" . $this->db->escape($data['shipping_address_1']) . \"', shipping_address_2 = '\" . $this->db->escape($data['shipping_address_2']) . \"', shipping_city = '\" . $this->db->escape($data['shipping_city']) . \"', shipping_postcode = '\" . $this->db->escape($data['shipping_postcode']) . \"', shipping_country = '\" . $this->db->escape($data['shipping_country']) . \"', shipping_country_id = '\" . (int)$data['shipping_country_id'] . \"', shipping_zone = '\" . $this->db->escape($data['shipping_zone']) . \"', shipping_zone_id = '\" . (int)$data['shipping_zone_id'] . \"', shipping_address_format = '\" . $this->db->escape($data['shipping_address_format']) . \"', shipping_custom_field = '\" . $this->db->escape(isset($data['shipping_custom_field']) ? serialize($data['shipping_custom_field']) : '') . \"', shipping_method = '\" . $this->db->escape($data['shipping_method']) . \"', shipping_code = '\" . $this->db->escape($data['shipping_code']) . \"', comment = '\" . $this->db->escape($data['comment']) . \"', total = '\" . (float)$data['total'] . \"', affiliate_id = '\" . (int)$data['affiliate_id'] . \"', commission = '\" . (float)$data['commission'] . \"', marketing_id = '\" . (int)$data['marketing_id'] . \"', tracking = '\" . $this->db->escape($data['tracking']) . \"', language_id = '\" . (int)$data['language_id'] . \"', currency_id = '\" . (int)$data['currency_id'] . \"', currency_code = '\" . $this->db->escape($data['currency_code']) . \"', currency_value = '\" . (float)$data['currency_value'] . \"', ip = '\" . $this->db->escape($data['ip']) . \"', forwarded_ip = '\" . $this->db->escape($data['forwarded_ip']) . \"', user_agent = '\" . $this->db->escape($data['user_agent']) . \"', accept_language = '\" . $this->db->escape($data['accept_language']) . \"', date_added = NOW(), date_modified = NOW()\");\n\n\t\t$order_id = $this->db->getLastId();\n\n\t\t// Products\n\t\tif (isset($data['products'])) {\n\t\t\tforeach ($data['products'] as $product) {\n\t\t\t\t$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"order_product SET order_id = '\" . (int)$order_id . \"', product_id = '\" . (int)$product['product_id'] . \"', name = '\" . $this->db->escape($product['name']) . \"', model = '\" . $this->db->escape($product['model']) . \"', quantity = '\" . (int)$product['quantity'] . \"', price = '\" . (float)$product['price'] . \"', total = '\" . (float)$product['total'] . \"', tax = '\" . (float)$product['tax'] . \"', reward = '\" . (int)$product['reward'] . \"'\");\n\t\n\t\t\t\t$order_product_id = $this->db->getLastId();\n\t\n\t\t\t\tforeach ($product['option'] as $option) {\n\t\t\t\t\t$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"order_option SET order_id = '\" . (int)$order_id . \"', order_product_id = '\" . (int)$order_product_id . \"', product_option_id = '\" . (int)$option['product_option_id'] . \"', product_option_value_id = '\" . (int)$option['product_option_value_id'] . \"', name = '\" . $this->db->escape($option['name']) . \"', `value` = '\" . $this->db->escape($option['value']) . \"', `type` = '\" . $this->db->escape($option['type']) . \"'\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Gift Voucher\n\t\t // don't need gift voucher\n\t\t\n\t\t// Totals\n\t\tif (isset($data['totals'])) {\n\t\t\tforeach ($data['totals'] as $total) {\n\t\t\t\t$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"order_total SET order_id = '\" . (int)$order_id . \"', code = '\" . $this->db->escape($total['code']) . \"', title = '\" . $this->db->escape($total['title']) . \"', `value` = '\" . (float)$total['value'] . \"', sort_order = '\" . (int)$total['sort_order'] . \"'\");\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $order_id;\n\t}", "function mailPaymentReceipt($invoice_no,$payment_date=\"\",$payment_amount=0)\n {\n $data_array = array();\n $cycle = $this->props->cycles;\n $temp = $this->BL->invoices->get(\"WHERE `invoice_no`=\".intval($invoice_no));\n $invoice = $temp[0];\n $data_array1= $this->BL->mailWelcome($invoice['order_id'],true);\n $data_array2= $this->BL->invoices->mailInvoice($invoice_no, true, true);\n $data_array = array_merge($data_array1,$data_array2);\n if(empty($payment_date))\n {\n $payment_date = date('Y-m-d');\n }\n if(empty($payment_amount))\n {\n $payment_amount = $invoice['gross_amount'];\n }\n\n if(empty($payment_amount) || empty($invoice_no) || !count($invoice))\n return false;\n\n $reciept_template = $this->BL->emails->getByKey(3);\n $subject = $this->BL->conf['company_name'] . \" \" . $this->props->lang['payment_confirmation'];\n $body = $this->utils->entity_decode($this->utils->htmlspecialchars_decode($reciept_template['email_text']));\n if(!empty($reciept_template['email_subject']))\n {\n $subject = $this->utils->entity_decode($this->utils->htmlspecialchars_decode($reciept_template['email_subject']));\n }\n foreach($invoice as $key=>$data)\n {\n $data_array[$key] = $data;\n }\n $data_array['payment_date'] = $this->BL->fDate($payment_date);\n $data_array['amount_paid'] = $this->BL->toCurrency($payment_amount, null, 1);\n $data_array['due_date'] = $this->BL->fDate($invoice['due_date']);\n $data_array['invoice_no'] = $this->BL->conf['invoice_prefix'] . $invoice['invoice_no'] . $this->BL->conf['invoice_suffix'];\n $data_array['company_email']= $this->BL->conf['comp_email'];\n $data_array['company_name'] = $this->BL->conf['company_name'];\n $data_array['company_address']= $this->BL->conf['company_address'];\n $data_array['description'] = $this->BL->getFriendlyDesc($invoice['desc'],$invoice['sub_id'],$invoice['domain_name']);\n\n $body = $this->BL->etp->parseEmail($data_array,$body);\n $subject= $this->BL->etp->parseEmail($data_array,$subject);\n\n $this->BL->notice_to = $invoice['email'];\n $this->BL->msg = $body;\n $this->BL->ALPmail->AddAddress($invoice['email'], $this->BL->getCustomerFieldValue(\"name\",$invoice['id']));\n $this->BL->ALPmail->AddCC($this->BL->conf['comp_email'], $this->BL->conf['company_name']);\n $this->BL->ALPmail->Subject = $subject;\n $this->BL->ALPmail->Body = $body;\n $return = $this->BL->ALPmail->sendMail();\n $this->BL->runCS('A_PP',$invoice['sub_id'], $invoice['invoice_no']);\n return $return;\n }", "public function sendInvoice ($invoice_id) {\n \t\t\n \t\t// \n \t\t$to = \"ray#netmarks.ca\";\n\t\t$from = '[email protected]'; \n\t\t$fromName = 'Ray Gubala'; \n \n\t\t$subject = \"EasyGroceries Order\"; \n\t\t$message = \"hello\";\n\t\t\n\t\t// in the message add the items line by line based on invoice_id\n\t\t$message .= \"\";\n\t\t\n\t\t// end message\n\t\t$message .= \"\";\n\t\t\n\t\t\n\t\t$headers = \"MIME-Version: 1.0\" . \"\\r\\n\"; \n\t\t$headers .= \"Content-type:text/html;charset=UTF-8\" . \"\\r\\n\"; \n \n\t\t// Additional headers \n\t\t$headers .= 'From: '.$fromName.'<'.$from.'>' . \"\\r\\n\";\n\t\t\n\t\t/*\n\t\t$headers = 'From: [email protected]' . \"\\r\\n\" .\n\t\t\t'Reply-To: [email protected]' . \"\\r\\n\" .\n\t\t\t'X-Mailer: PHP/' . phpversion();\n\t\t*/\n\t\t\n\t\tmail($to, $subject, $message, $headers);\n\n \t}", "public function CreateInvoiceAndRedirect($payment)\n {\n $order = $payment->getOrder();\n if (is_array($this->createInvoice($order))) {\n $payment->setIsTransactionPending(true); // status will be PAYMENT_REVIEW instead of PROCESSING\n //$orderId = $order->getIncrementId();\n //$invoiceId = Mage::getModel('sales/order_invoice_api')->create($orderId, array());\n return $this;\n } else {\n $this->log(\"An error occurred during invoice creation: \" . __LINE__);\n Mage::throwException(\n Mage::helper('bitcoin')->__(\n \"We're sorry, an error has occurred while completing your request. Please refresh the page to try again. If the error persists, please send us an email at [email protected]\"\n )\n );\n }\n }", "public function pay_action ()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$order_id = $_GET['osc_order_id'];\n\n\t\t\t$payment = self::get_api()->payments->create(array(\n\t\t\t\t\"amount\" => $this->get_order_total($order_id),\n\t\t\t\t\"method\" => isset($_GET['method']) ? $_GET['method'] : NULL,\n\t\t\t\t\"description\" => MODULE_PAYMENT_MOLLIE_PAYMENT_DESCRIPTION . \" \" . $order_id,\n\t\t\t\t\"redirectUrl\" => $this->get_return_url($order_id),\n\t\t\t\t\"metadata\" => array(\"order_id\" => $order_id),\n\t\t\t\t\"webhookUrl\" => $this->get_webhook_url($order_id),\n\t\t\t\t\"issuer\" => !empty($_GET['issuer']) ? $_GET['issuer'] : NULL\n\t\t\t));\n\n\t\t\t$this->log($payment->id, $payment->status, $order_id);\n\n\t\t\theader(\"Location: \" . $payment->getPaymentUrl());\n\t\t}\n\t\tcatch (Mollie_API_Exception $e)\n\t\t{\n\t\t\techo \"API call failed: \" . htmlspecialchars($e->getMessage());\n\t\t}\n\t}", "public function processApiInvoice($invoice)\n {\n if($this->_logging){\n Mage::log('In processApiInvoice (Postpayment)', null, $this->_logfile);\n }\n $order = $invoice->getOrder();\n // Request model, data model, product line model, total line model\n $v2RqstMdl = new Tritacv2_Model_InvoiceRequestV2Model();\n $v2DataMdl = new Tritacv2_Model_InvoicePdfDataModel();\n $v2ProdMdlArray = $this->getProductLines($order);\n $v2TtlMdlArray = $this->getOrderTotals($order);\n $shopName = Mage::app()->getStore()->getFrontendName();\n $v2DataMdl->setShopName($shopName);\n $v2DataMdl->setDescription('');\n $v2DataMdl->setProductLines($v2ProdMdlArray);\n $v2DataMdl->setTotalLines($v2TtlMdlArray);\n // finally fill request model:\n $v2RqstMdl->setTransactionNumber($invoice->getTransactionId());\n $v2RqstMdl->setInvoiceNumber($invoice->getIncrementId());\n $objDateTime = new DateTime('NOW');\n $v2RqstMdl->setInvoiceDate($objDateTime);\n $v2RqstMdl->setInvoiceAmount(Mage::helper('capayable')->convertToCents($invoice->getGrandTotal()));\n $v2RqstMdl->setInvoiceDescription(Mage::helper('capayable')->__('Order').' '.$order->getIncrementId());\n $v2RqstMdl->setInvoicePdfSubmitType('INCLUDED_DATA');\n $v2RqstMdl->setCultureCode('nl-NL');\n $v2RqstMdl->setInvoicePdfData($v2DataMdl);\n try {\n $publicKey = Mage::getStoreConfig('payment/capayable/public_key');\n $apiConfig = new Tritacv2_Configuration();\n $apiConfig->setApiKey('apikey', $publicKey); // test key 'f2d2a2aee085bfcde02d3b50e30a7394efcd49e5'\n //$apiConfig->setHost('https://capayable-api-acc.tritac.com');\n if($this->_logging) {\n Mage::log('In processApiInvoice (Postpayment) dit is url ' . $this->_url, null, $this->_logfile);\n }\n $apiConfig->setHost($this->_url);\n $apiClient = new Tritacv2_ApiClient($apiConfig);\n $invoiceApi = new Tritacv2_Api_InvoiceApi($apiClient);\n $result = $invoiceApi->invoiceV2Post($v2RqstMdl);\n if($this->_logging) {\n Mage::log('In checkCredit (Postpayment) result : ', null, $this->_logfile);\n Mage::log($result, null, $this->_logfile);\n }\n if($result->getIsAccepted() == true || $result->getIsAccepted() == 1) {\n return true;\n } else {\n return false;\n }\n } catch (Exception $e) {\n Mage::log('Exception when calling creditCheckApi->creditCheckV2Post: '. $e->getMessage(), null, $this->_logfile);\n }\n\n //return $response['IsAccepted'];\n }", "function addnewPayment($cid, $Amount, $AdditionalAmount, $days, $userid) {\n\n $Date = date(\"Y-m-d H:i\");\n\n $sql = \"INSERT INTO invoice_payments (Amount,AdditionalAmount,DateTime,Credit_Invoice_idCredit_Invoice,User_idUser,PayFor,Status) \"\n\n . \"VALUES ($Amount,$AdditionalAmount,'$Date',$cid,$userid,$days,'1')\";\n\n\n\n if (mysqli_query($this->con, $sql)) {\n\n// return 'error:' . mysqli_error($this->con);\n\n return true;\n\n } else {\n\n// return 'error:' . mysqli_error($this->con);\n\n return false;\n\n }\n\n }", "public function _create($refid, $invoice, $charges=array(), $payments=array())\n {\n\n return false;\n\n\n if($res = $this->is_billtrac_exists($invoice->InvoiceNumber_EMD))\n {\n //already created\n $this->error(\"billtrac ticket # $res already exists for EMD invoice # \" . $invoice->InvoiceNumber_EMD);\n\n //update so\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n DB::table($this->keytable)->where('emd_invoice_number',$invoice->InvoiceNumber_EMD)->update(array( 'todo'=>'done','ext_key'=>$res));\n }\n\n return false;\n }\n\n /**\n * inserting\n * - summary\n * - carrier\n * - emdId\n * - type\n * - claim\n * - location\n * - mail date\n * - bill amount\n * - ptrac id\n */\n\n\n try{\n\n\n $time = $changetime = time() * 1000000;\n\n DB::connection('billtrac')->getPdo()->beginTransaction();\n\n //create base ticket\n $invoice->Invoice_Comment = trim($invoice->Invoice_Comment);\n\n if(empty($invoice->Invoice_Comment))\n {\n $type = 'new';\n }\n else\n {\n $type = addslashes($invoice->Invoice_Comment);\n }\n\n $dos_first=false;\n $dos = array();\n\n if($cpts = DB::connection('emds')->table('VIEW_API_InvoiceCPT')->where('Invoice_ID', $invoice->Invoice_ID)->get())\n {\n foreach($cpts as $line)\n {\n if(!$dos_first)\n {\n $dos_first = $line->sdos;\n }\n $dos[$line->sdos] = 1;\n }\n $dos = 'DOS: ' . implode(', ', array_keys($dos));\n\n }\n\n $data = array(\n 'type'=>$type,\n 'time'=>$time,\n 'changetime'=>$changetime,\n 'priority'=>'normal',\n 'status'=>'new',\n 'summary'=>addslashes($invoice->PatientName),\n 'reporter'=>'emdimport',\n 'description'=>$dos,\n 'owner'=> $this->assign_ownerbyalpha(strtolower(substr($invoice->PatientName,0,1)))\n );\n\n if($owner = $this->assign_ownerbyinsurance(strtolower($invoice->InsuranceCompName)))\n {\n $data['owner'] = $owner;\n }\n\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n DB::connection('billtrac')->table('ticket')->insert( $data );\n }\n else\n {\n $this->info(\"dry insert: \\n\" . print_r($data, true));\n }\n\n $id = DB::connection('billtrac')->getPdo()->lastInsertId();\n\n $this->info(\"created ticket number $id\");\n\n $emdimage = false;\n\n $respmt = DB::connection('emds')->select(\"select * from VIEW_API_PaymentIndex where Invoice_ID = '\" . $invoice->Invoice_ID . \"'AND (CheckImage <> '0000000000' or EOBImage <> '0000000000')\");\n\n foreach($respmt as $r)\n {\n $emdimage = true;\n }\n\n $importMap = array(\n 'billdate'=>$invoice->InvoiceCreatedAt,\n 'emdstatus'=>$invoice->InvoiceStatus_Code,\n 'maildate'=>$invoice->InvoiceCreatedAt,\n 'dosdate'=>$dos_first,\n 'billamount'=>number_format($invoice->InvoiceTotal,2),\n 'duedate'=>date_create_from_format('m-d-Y', $invoice->InvoiceCreatedAt)->modify('+17 day')->format('m-d-Y'),\n 'paidamount'=>number_format($invoice->PaymentTotal,2),\n 'location'=>$this->translateLocation($invoice->Organization_Name),\n 'carrier'=>addslashes($invoice->InsuranceCompName),\n 'claimnumber'=>$invoice->Case_ClaimNumber,\n 'step'=>'new',\n 'emdinvoicenumber'=>$invoice->InvoiceNumber_EMD,\n 'ptracnumber'=>'EMD:'.$invoice->InvoiceNumber_EMD\n );\n\n if($emdimage)\n {\n $importMap['emdimage'] = 1;\n }\n\n foreach($importMap as $key=>$value)\n {\n $data = array(\n 'ticket'=>$id,\n 'name'=>$key,\n 'value'=>$value\n );\n\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n DB::connection('billtrac')->table('ticket_custom')->insert( $data );\n }\n else\n {\n $this->info(\"dry insert: \\n\" . print_r($data, true));\n }\n }\n\n DB::connection('billtrac')->getPdo()->commit();\n\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n return DB::table($this->keytable)->where('id',$refid)->update(array( 'todo'=>'done', 'ext_key'=>$id));\n }\n else\n {\n return false;\n }\n\n }catch (Exception $e)\n {\n DB::connection('billtrac')->getPdo()->rollBack();\n throw new Exception($e->getMessage());\n }\n }", "function view_invoice($param1 = '', $param2 = '', $param3 = '')\n\t{\n\t\t//if($this->session->userdata('patient_login')!=1)redirect(base_url().'index.php?login' , 'refresh');\n\t\tif ($param1 == 'make_payment') {\n\t\t\t$invoice_id = $this->input->post('invoice_id');\n\t\t\t$system_settings = $this->db->get_where('settings', array(\n\t\t\t\t'type' => 'paypal_email'\n\t\t\t))->row();\n\t\t\t$invoice_details = $this->db->get_where('invoice', array(\n\t\t\t\t'invoice_id' => $invoice_id\n\t\t\t))->row();\n\t\t\t\n\t\t\t/****TRANSFERRING USER TO PAYPAL TERMINAL****/\n\t\t\t$this->paypal->add_field('rm', 2);\n\t\t\t$this->paypal->add_field('no_note', 0);\n\t\t\t$this->paypal->add_field('item_name', $invoice_details->title);\n\t\t\t$this->paypal->add_field('amount', $invoice_details->amount);\n\t\t\t$this->paypal->add_field('custom', $invoice_details->invoice_id);\n\t\t\t$this->paypal->add_field('business', $system_settings->description);\n\t\t\t$this->paypal->add_field('notify_url', base_url() . 'index.php?patient/view_invoice/paypal_ipn');\n\t\t\t$this->paypal->add_field('cancel_return', base_url() . 'index.php?patient/view_invoice/paypal_cancel');\n\t\t\t$this->paypal->add_field('return', base_url() . 'index.php?patient/view_invoice/paypal_success');\n\t\t\t\n\t\t\t$this->paypal->submit_paypal_post();\n\t\t\t// submit the fields to paypal\n\t\t}\n\t\tif ($param1 == 'paypal_ipn') {\n\t\t\tif ($this->paypal->validate_ipn() == true) {\n\t\t\t\t$ipn_response = '';\n\t\t\t\tforeach ($_POST as $key => $value) {\n\t\t\t\t\t$value = urlencode(stripslashes($value));\n\t\t\t\t\t$ipn_response .= \"\\n$key=$value\";\n\t\t\t\t}\n\t\t\t\t$invoice_id = $_POST['custom'];\n\t\t\t\t$data['status'] = 'paid';\n\t\t\t\t$this->db->where('invoice_id', $invoice_id);\n\t\t\t\t$this->db->update('invoice', $data);\n\t\t\t\t\n\t\t\t\t$data2['transaction_id'] = rand(10000, 100000);\n\t\t\t\t$data2['invoice_id'] = $invoice_id;\n\t\t\t\t$data2['patient_id'] = $this->crud_model->get_type_name_by_id('invoice', $invoice_id, 'patient_id');\n\t\t\t\t$data2['payment_method'] = 'paypal';\n\t\t\t\t$data2['description'] = $ipn_response;\n\t\t\t\t$data2['amount'] = $this->crud_model->get_type_name_by_id('invoice', $invoice_id, 'amount');\n\t\t\t\t$data2['timestamp'] = strtotime(date(\"m/d/Y\"));\n\t\t\t\t\n\t\t\t\t$this->db->insert('payment', $data2);\n\t\t\t}\n\t\t}\n\t\tif ($param1 == 'paypal_cancel') {\n\t\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_cancelled'));\n\t\t\tredirect(base_url() . 'index.php?patient/view_invoice/', 'refresh');\n\t\t}\n\t\tif ($param1 == 'paypal_success') {\n\t\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_successfull'));\n\t\t\tredirect(base_url() . 'index.php?patient/view_invoice/', 'refresh');\n\t\t}\n\t\t\n\t\t$page_data['page_name'] = 'view_invoice';\n\t\t$page_data['page_title'] = get_phrase('view_invoice');\n\t\t$page_data['invoices'] = $this->db->get_where('invoice', array(\n\t\t\t'patient_id' => $this->session->userdata('patient_id')\n\t\t))->result_array();\n\t\t$this->load->view('index', $page_data);\n\t}", "public function addItem($invoice_id) {\n\t\t$quantity = Request::input('quantity');\n\t\t$item_id = Request::input('item_id');\n\n\t\t$initSelect = DB::select('SELECT * \n\t\t\tFROM invoice_item\n\t\t\tWHERE item_id = :item_id\n\t\t\tAND invoice_id = :invoice_id',\n\t\t\tarray(\n\t\t\t\t':item_id' => $item_id,\n\t\t\t\t':invoice_id' => $invoice_id));\n\n\t\tif ($initSelect) {\n\t\t\t$previousQTY = $initSelect[0]->quantity;\n\t\t\t$sql = DB::update( \"UPDATE invoice_item \n\t\t\t\t\tSET quantity= :quantity\n\t\t\t\t\tWHERE item_id = :item_id\n\t\t\t\t\tAND invoice_id = :invoice_id\",\n\t\t\t\tarray(\n\t\t\t\t\t':item_id' => $item_id,\n\t\t\t\t\t':invoice_id' => $invoice_id,\n\t\t\t\t\t':quantity' => ($quantity + $previousQTY)));\n\t\t} else {\n\t\t\techo 'insert new . . . . ';\n\t\t\t$sql = DB::insert(\n\t\t\t\t\t'INSERT INTO invoice_item ( `invoice_id`, `item_id`, `quantity`) \n\t\t\t\t\tVALUES ( :invoice_id, :item_id, :quantity)',\n\t\t\t\tarray(\n\t\t\t\t\t':invoice_id' => $invoice_id,\n\t\t\t\t\t':item_id' => $item_id,\n\t\t\t\t\t':quantity' => $quantity));\n\t\t}\n\n\t\treturn redirect('invoices/details/' . $invoice_id);\n\t}", "public function addNewQuotation(Request $request, $id){\n $ids = Auth::user()->id;\n $user = User::find($ids);\n\n $firstName = $user->first_name;\n $lastName = $user->last_name;\n\n $name = $firstName.\" \".$lastName;\n\n $addNewInvoice = new WlgCorporationInvoice([\n 'user_id'=>$user->id,\n 'if_id'=>$id,\n 'number_of_goods'=>$request->get('no'),\n 'description_of_goods'=>$request->get('descGoods'),\n 'qty'=>$request->get('qty'),\n 'unit_price'=>$request->get('unitPrice'),\n 'total_amount'=>$request->get('totalAmount'),\n 'created_by'=>$name,\n ]);\n\n $addNewInvoice->save();\n Session::flash('successAdd', 'Successfully added');\n\n return redirect()->route('editQuotationInvoiceWlg', ['id'=>$id]);\n\n }", "public function addPayment($listingId, $type, $duration, $amount, $token, $discount = null)\r\n\t{\r\n\t\t// Type to feature level magic number mapping\r\n\t\t$featureLevels = array(\r\n\t\t\t'regular' => 0,\r\n\t\t\t'featured' => 1,\r\n\t\t\t'newsletter' => 2\r\n\t\t);\r\n\r\n\t\t// Add payment\r\n\t\t$query = 'INSERT INTO marketplacePayments\r\n\t\t\tSET marketID = '.(int)$listingId.',\r\n\t\t\t\tmarketFeatured = '.(int)$featureLevels[$type].',\r\n\t\t\t\tmppDuration = '.(int)$duration.',\r\n\t\t\t\tmppAmount = '.(float)$amount.',\r\n\t\t\t\tmppToken = \"'.Database::escape($token).'\",\r\n\t\t\t\tmppDiscount = \"'.Database::escape($discount).'\",\r\n\t\t\t\tstartDate = NOW(),\r\n\t\t\t\tendDate = DATE_ADD(NOW(), INTERVAL '.$duration.' MONTH),\r\n\t\t\t\tpaid = 1';\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$this->_db->query();\r\n\t\treturn $this->_db->getInsertID();\r\n\t}", "public function addTransactionId($id_order, $id_transaction)\r\n\t{\r\n\t\tif (version_compare(_PS_VERSION_, '1.5', '>='))\r\n\t\t{\r\n\t\t\t$new_order = new Order((int)$id_order);\r\n\t\t\tif (Validate::isLoadedObject($new_order))\r\n\t\t\t{\r\n\t\t\t\t$payment = $new_order->getOrderPaymentCollection();\r\n\t\t\t\tif (isset($payment[0]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$payment[0]->transaction_id = pSQL($id_transaction);\r\n\t\t\t\t\t$payment[0]->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function addCrediInvoice($totalAmount, $grantAmount, $InterestRate, $DailyEqualPayment, $Days, $PaidAmount, $Settled, $Debitors_idDebitors, $CollectionArea_idCollectionArea, $userid, $loan_type) {\n\n\n\n $Date = date(\"Y-m-d\");\n\n $sql = \"INSERT INTO credit_invoice (TotalAmount,GrantAmount,InterestRate,DailyEqualPayment,Days,PaidAmount,Settled,DateTime,Debitors_idDebitors,CollectionArea_idCollectionArea,Status,user_idUser,`type`) \"\n\n . \"VALUES ($totalAmount,$grantAmount, '$InterestRate', '$DailyEqualPayment', '$Days','$PaidAmount','$Settled','$Date','$Debitors_idDebitors','$CollectionArea_idCollectionArea', '0',$userid,'$loan_type')\";\n\n\n\n if (mysqli_query($this->con, $sql)) {\n\n $last_id = $this->con->insert_id;\n\n return $last_id;\n\n// return \"true\";\n\n } else {\n\n// return 'error:' . mysqli_error($this->con);\n\n return \"false\";\n\n }\n\n }", "public function process_payment() {\n\n\n global $admin_settings;\n\n check_ajax_referer( 'kp-korapay-pay-nonce', 'kp_sec_code' );\n\n $tx_ref = $_POST['reference'];\n $status = $_POST['status'];\n $secret_key = $admin_settings->get_option_value( 'secret_key' );\n $amount=$_POST['amount'];\n $args = array(\n 'post_type' => 'payment_list',\n 'post_status' => 'publish',\n 'post_title' => $tx_ref,\n );\n\n $payment_record_id = wp_insert_post( $args, true );\n\n if ( ! is_wp_error( $payment_record_id )) {\n\n $post_meta = array(\n '_kp_korapay_payment_amount' => 'NGN'.' '.$_POST['amount'],\n '_kp_korapay_payment_fullname' => $_POST['first_name'].' '.$_POST['last_name'],\n '_kp_korapay_payment_customer' => $_POST['email'],\n '_kp_korapay_payment_status' => $status,\n '_kp_korapay_payment_tx_ref' => $tx_ref,\n );\n\n $this->_add_post_meta( $payment_record_id, $post_meta );\n\n }\n $redirect_url_key = $status === 'success' ? 'success_redirect_url' : 'failed_redirect_url';\n\n echo json_encode( array( 'status' => $status, 'redirect_url' => $admin_settings->get_option_value( $redirect_url_key ) ) );\n\n die();\n\n }", "function presta_paybox_call_directplus_dist($id_transaction, $transaction_hash, $refabonne, $ppps, $config = null){\n\tinclude_spip('inc/bank');\n\t\n\tif (!$config){\n\t\t$config = bank_config(\"paybox\", true);\n\t}\n\t$config['mode'] .= \"_dplus\"; // pour les logs\n\t$mode = $config['mode'];\n\n\tif (!$row = sql_fetsel(\"*\", \"spip_transactions\", \"id_transaction=\" . intval($id_transaction) . \" AND transaction_hash=\" . sql_quote($transaction_hash))){\n\t\tspip_log(\"Transaction inconnue $id_transaction/$transaction_hash\", $mode . _LOG_ERREUR);\n\t\treturn array(0, false);\n\t}\n\n\t// securite : eviter de faire payer plusieurs fois une meme transaction si bug en amont\n\tif ($row['statut']=='ok'){\n\t\tspip_log(\"Transaction $id_transaction/$transaction_hash deja reglee\", $mode . _LOG_INFO_IMPORTANTE);\n\t\treturn array($id_transaction, true);\n\t}\n\n\t// On peut maintenant connaître la devise et ses infos\n\t$devise = $row['devise'];\n\t$devise_info = bank_devise_info($devise);\n\tif (!$devise_info) {\n\t\tspip_log(\"Transaction #$id_transaction : la devise $devise n’est pas connue\", $mode . _LOG_ERREUR);\n\t\treturn array(0, false);\n\t}\n\n\tif (!$row['id_auteur']\n\t\tAND isset($GLOBALS['visiteur_session']['id_auteur'])\n\t\tAND $GLOBALS['visiteur_session']['id_auteur']){\n\t\tsql_updateq(\"spip_transactions\", array(\"id_auteur\" => $row['id_auteur'] = $GLOBALS['visiteur_session']['id_auteur']), \"id_transaction=\" . intval($id_transaction));\n\t}\n\n\t// recuperer l'email\n\t$mail = sql_getfetsel('email', \"spip_auteurs\", 'id_auteur=' . intval($row['id_auteur']));\n\n\t// passage en centimes et formattage sur 10 chiffres\n\t$montant = bank_formatter_montant_selon_fraction($row['montant'], $devise_info['fraction'], 10);\n\n\t//\t\tAffectation des parametres obligatoires\n\t$parm = array('VERSION' => '00104', 'SITE' => $config['PBX_SITE'], 'RANG' => $config['PBX_RANG'], 'IDENTIFIANT' => '');\n\n\t// cas de PBX_RANG : paybox fournit 001 mais il faut envoyer 01 au serveur\n\t$parm['RANG'] = str_pad(intval($parm['RANG']), 2, '0', STR_PAD_LEFT);\n\n\t$parm['CLE'] = $config['DIRECT_PLUS_CLE'];\n\t$parm['DATEQ'] = date('dmYHis');\n\t$parm['TYPE'] = _PAYBOX_DIRECTPLUS_AUTHDEBIT_ABONNE;\n\t$parm['DEVISE'] = (string)$devise_info['code_num'];\n\t$parm['REFERENCE'] = intval($id_transaction);\n\t$parm['ARCHIVAGE'] = intval($id_transaction);\n\t$parm['DIFFERE'] = '000';\n\t$parm['NUMAPPEL'] = '';\n\t$parm['NUMTRANS'] = '';\n\t$parm['AUTORISATION'] = '';\n\t$parm['MONTANT'] = $montant;\n\n\t$parm['REFABONNE'] = $refabonne;\n\n\t$ppps = explode(' ', $ppps);\n\t$parm['PORTEUR'] = str_pad($ppps[0], 19, ' ', STR_PAD_RIGHT); // NO CB\n\t$parm['DATEVAL'] = substr($ppps[1], 2) . substr($ppps[1], 0, 2); // VAL CB\n\t$parm['CVV'] = $ppps[2]; // CCV CB\n\n\n\tinclude_spip('inc/distant');\n\n\t// numero de question incremental\n\t// dans spip_meta\n\t// on recommence si collision par concurence...\n\t$maxtry = 5;\n\tdo {\n\t\t$num_question = intval(sql_getfetsel(\"valeur\", \"spip_meta\", \"nom=\" . sql_quote('payboxnumquestion')));\n\t\t$num_question++;\n\t\tecrire_meta('payboxnumquestion', $num_question);\n\n\t\t$parm['NUMQUESTION'] = $num_question;\n\t\t#var_dump($parm);\n\n\t\t// requete en POST sur PAYBOX DIRECT PLUS\n\t\t$url = paybox_url_directplus($config);\n\t\t$options = array(\n\t\t\t'taille_max' => 1048576,\n\t\t\t'datas' => $parm,\n\t\t);\n\t\t$res = recuperer_url($url, $options);\n\t\tif (!$res or empty($res['page'])) {\n\t\t\tspip_log(\"paybox_call_directplus: Echec appel de recuperer_url sur $url avec \".json_encode($parm), $mode . _LOG_ERREUR);\n\t\t\t$r = array();\n\t\t}\n\t\telse {\n\t\t\tparse_str($res['page'], $r);\n\t\t}\n\n\t\tif (!empty($r)) {\n\t\t\tif ($r['CODEREPONSE']=='00005'){\n\t\t\t\tspip_log(\"paybox_call_directplus: Collision Reponse : \".json_encode($res), $mode . _LOG_INFO_IMPORTANTE);\n\t\t\t\t// hum\n\t\t\t\tsleep(1);\n\t\t\t} else {\n\t\t\t\tspip_log(\"paybox_call_directplus: Reponse : \".json_encode($res), $mode . _LOG_DEBUG);\n\t\t\t}\n\t\t}\n\n\t} while ((empty($r) or $r['CODEREPONSE']=='00005') AND $maxtry-->0);\n\n\tif (empty($r)) {\n\t\treturn '';\n\t}\n\t#var_dump($r);\n\t/*\n\t * array(10) {\n [\"NUMTRANS\"]=>\n string(10) \"0000617104\"\n [\"NUMAPPEL\"]=>\n string(10) \"0000981593\"\n [\"NUMQUESTION\"]=>\n string(10) \"0000095720\"\n [\"SITE\"]=>\n string(7) \"1999888\"\n [\"RANG\"]=>\n string(2) \"99\"\n [\"AUTORISATION\"]=>\n string(6) \"XXXXXX\"\n [\"CODEREPONSE\"]=>\n string(5) \"00000\"\n [\"COMMENTAIRE\"]=>\n string(27) \"Demande trait?e avec succ?s\"\n [\"REFABONNE\"]=>\n string(5) \"95720\"\n [\"PORTEUR\"]=>\n string(19) \"SLDLrcsLMPC \"\n\t}\n\t*/\n\n\t// renommons en coherence avec Paybox System\n\t$response = array(\n\t\t'id_transaction' => $id_transaction,\n\t\t'erreur' => $r['CODEREPONSE'],\n\t\t'auth' => $r['AUTORISATION'],\n\t\t'trans' => $r['NUMTRANS'],\n\t\t'montant' => $parm['MONTANT'],\n\t\t'abo' => $r['REFABONNE'],\n\t\t'valid' => $ppps[1],\n\t);\n\n\t$call_response = charger_fonction('response', 'presta/paybox/call');\n\treturn $call_response($config, $response);\n}", "public function payInvoice(){\n $data = axios();\n if( ($data['payTotal'] > 0) && $data['payInvoice'] != 0):\n $response = $this->credits->addPayInvoice($data);\n echo json_encode($response); \n endif; \n }", "public function invoiceitem_create( $customer_id, $amount, $desc ) {\r\n\t\t$params = array(\r\n\t\t\t'customer' => $customer_id,\r\n\t\t\t'amount' => $amount,\r\n\t\t\t'currency' => 'usd',\r\n\t\t\t'description' => $desc\r\n\t\t);\r\n\t\t\r\n\t\treturn $this->_send_request( 'invoiceitems', $params, STRIPE_METHOD_POST );\r\n\t}", "public function processPayment(InvoiceInterface $invoice);", "function addTransaction() {\nrequire(\"/home/course/cda540/u05/public_html/project/dbguest.php\");\n\n//It will import all variables such as $host , $user, $pass and $db\n\n//mysqli_connect() is to connect the database\n$link = mysqli_connect($host, $user, $pass, $db);\n\n//Check the connection. Give error message if any error\nif (!$link) die(\"Couldn't connect to MySQL\");\n\n\n//mysqli_select_db() is used to select the database\nmysqli_select_db($link, $db)\n or die(\"Couldn't open $db: \".mysqli_error($link));\n\n$result_cusID=(int)$_POST['customerID'];\n\n$string_itemID=$_POST['items'];\n\n$string_itemsPrice = $_POST['itemsPrice'];\n\n$result_itemID = explode(\"\\n\",$string_itemID);\n\n$result_itemPrice = explode(\"\\n\",$string_itemsPrice);\n\n$itemIDs = implode (\",\" , $result_itemID);\n\n$result_customer=mysqli_query($link,\"SELECT * FROM CUSTOMER where _id=$result_cusID\");\n\n$result_itemIDs = mysqli_query($link,\"SELECT * FROM ITEM where _id IN ('$itemIDs')\");\n\n$totalpurchaseprice = 0;\n\nforeach($result_itemPrice as $itemprice)\n{\n $totalpurchaseprice = $totalpurchaseprice+$itemprice;\n}\n\n\nif ((mysqli_num_rows($result_customer)>0)&& (mysqli_num_rows($result_itemIDs)>0))\n{\n \n $result_trans=mysqli_query($link, \"INSERT INTO TRANSACTION (discouncode,transactiondate,totalpurchaseprice,customerId) VALUES(70,now(),'$totalpurchaseprice','$result_cusID')\");\n \n $result_no=mysqli_query($link,\"SELECT transactionNumber FROM TRANSACTION ORDER BY customerId DESC LIMIT 1\");\n $obj = mysqli_fetch_object($result_no);\n $transno= $obj-> transactionNumber;\n \n foreach ($result_itemID as $itemID)\n {\n $result_transdetails=mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES('$transno','$itemID')\"); \n }\n\necho '<span style=\"color:#008000;text-align:center;\">Success!!! Customer ID Found and added a new transaction...</span>';\n\n\n}\n\nelse\n{\necho '<span style=\"color:#FF0000;text-align:center;\">Sorry!!! Unable to add a new transaction (Check Customers and Items)...</span>';\n}\n\n//$string_itemID=$_POST['items'];\n\n//$result_itemID = explode(\"\\n\",$string_itemID);\n\n//$j=1;\n\n//foreach ($result_itemID as $item_val)\n//{\n//echo \"$item_val <br>\";\n//$item_intval=int(\"$item_val\");\n\n//Working\n//$result_trans=mysqli_query($link, \"INSERT INTO TRANSACTION (discouncode,transactiondate,totalpurchaseprice,customerId) VALUES(70,'2019jun21',13.14,1)\");\n//$result_no=mysqli_query($link,\"SELECT transactionNumber FROM TRANSACTION ORDER BY customerId DESC LIMIT 1\");\n\n//$value = mysql_fetch_object($result_no);\n//$transno = $value->transactionNumber;\n//echo \"$transno\";\n//$result_transdetails=mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES(5,1)\");\n//$j=$j+1;\n//}\n\n\n//mysqli_query will execute the query and stores into $result\n\n//mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES('$result')\");\n//Close the connection\nmysqli_close($link);\n\n}", "public function add()\n {\n if(isloggedIn())\n {\n //if login\n if($_SERVER['REQUEST_METHOD']=='POST')//if click submit in form in (view/ payment/add)\n {\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n $data = [\n 'payments' => $this->paymentModel->allPayment(getUsername()),//to sho ein table\n 'username' => getUsername(),//fun in helper dir in session\n 'visaNum' => trim($_POST['visa']),\n 'pin' => trim($_POST['pin']) ,\n 'money' => trim($_POST['money']) ,\n 'visaNum_err' => '',\n 'pin_err' => '',\n 'money_err' => '',\n ];\n //validate visa Num\n if (empty($data['visaNum'])) {\n //if input visa num empty\n $data['visaNum_err'] = \"The VISA Number field can't be empty\";\n } elseif (strlen($data['visaNum']) != 16) {\n //visa num should be 16\n $data['visaNum_err'] = 'The VISA Number must be from 16 number';\n }\n elseif ($this->paymentModel->getPymentByNum($data['visaNum']))\n {\n //visa num unique if found\n $data['visaNum_err'] = 'The VISA Number is already exists';\n }\n\n //validate Pin\n if (empty($data['pin'])) {\n $data['pin_err'] = 'The PIN field can\\'t be empty';\n } elseif ($data['pin'] <= 0) {\n $data['pin_err'] = 'The PIN can\\'t be less then or equal 0';\n }\n\n\n //validate money\n if (empty($data['money'])) {\n $data['money_err'] = \"The PIN field can't be empty\";\n } elseif ($data['money'] <= 0 && $data['money'] >= 10000000) {\n $data['money_err'] = 'The PIN can\\'t be less then or equal 0';\n }\n\n if ( empty($data['visaNum_err']) && empty($data['pin_err']) && empty($data['money_err']) ) {\n //if not found error\n if($this->paymentModel->addPayment($data)){\n //if added in data base successful\n flash('error', 'Done', 'alert alert-success');\n redirect('payment/add');\n } else {\n //if no added successful\n flash('error', 'some thing went error', 'alert alert-danger');\n redirect('pages');\n }\n } else {\n $this->view('payment/add', $data);//sent data to view with error\n }\n }\n else\n {\n //if click in nav bar in payment\n $data = [\n 'payments' => $this->paymentModel->allPayment(getUsername()),//if have data will show in table\n 'username' => getUsername(),\n 'visaNum' => '',\n 'pin' => '',\n 'money' => '',\n 'visaNum_err' => '',\n 'pin_err' => '',\n 'money_err' => '',\n ];\n $this->view('payment/add',$data);//sent data to view\n }\n\n }\n else\n {\n //if not login\n flash('error', 'Sorry, You need to login first', 'alert alert-danger');\n redirect('pages');\n }\n }", "public function pay();", "public function beginTransaction($amount,$currency,$returnURL,$cancelURL,$ipn){\r\n\t\t$request = \r\n\t\t\t\"&USER=\".urlencode($this->_user).\r\n\t\t\t\"&PWD=\".urlencode($this->_pass).\t\t\t\r\n\t\t\t\"&SIGNATURE=\".urlencode($this->_sign).\r\n\t\t\t\"&METHOD=\".urlencode(PayPal_Methods::BEGIN).\r\n\t\t\t\"&VERSION=\".urlencode(PayPal_Version::VERSION).\r\n\t\t\t\"&PAYMENTREQUEST_0_PAYMENTACTION=Sale\".\r\n\t\t\t\"&PAYMENTREQUEST_0_AMT=\".urlencode((number_format($amount,2))).\r\n\t\t\t\"&PAYMENTREQUEST_0_CURRENCYCODE=\".urlencode($currency).\r\n\t\t\t\"&RETURNURL=\".urlencode($returnURL).\r\n\t\t\t\"&CANCELURL=\".urlencode($cancelURL).\r\n\t\t\t\"&PAYMENTREQUEST_0_NOTIFYURL=\".urlencode($ipn);\r\n\t\t\t//\"&LOCALECODE=ES\";\r\n\t\tforeach ( $this->_requestDetails as $items )\r\n\t\t\tforeach ( array_keys($items) as $item )\r\n\t\t\t\t$request.=\"&$item=\".urlencode(utf8_encode($items[$item]));\r\n\t\t\r\n\t\t$textplain = $this->execute($request);\r\n\t\tif (!$textplain)\r\n\t\t\tthrow new Exception(PayPal_Methods::BEGIN.\" failed: \".curl_error($this->_CURL));\r\n\t\t\r\n\t\t$response = array(); /** la respuesta la pasamos a un array para buscar por valores */\r\n\t\tforeach (explode(\"&\", $textplain) as $value) {\r\n\t\t\t$tmpAr = explode(\"=\", $value);\r\n\t\t\tif(sizeof($tmpAr) > 1)\r\n\t\t\t\t$response[$tmpAr[0]] = urldecode($tmpAr[1]);\r\n\t\t}\r\n\t\t\r\n\t\t$fp = fopen('logs/setExpressCheckout.txt', 'w');\r\n\t\tforeach ($response as $key=>$value)\r\n\t\t\tfwrite($fp, \"$key=$value\\n\\r\");\r\n\t\tfclose($fp);\r\n\t\t\r\n\t\tif ( strtoupper($response['ACK'])==\"SUCCESS\" || strtoupper($response['ACK'])==\"SUCCESSWITHWARNING\" )\r\n\t\t\treturn $response['TOKEN'];\r\n\t\telse\r\n\t\t\tthrow new Exception(\"Error: ACK=\".$response['ACK']);\r\n\t}", "public function capture(Varien_Object $payment, $amount) {\n\t\t\tif($this->getDebug())\n\t\t\t{\n\t\t\t\t$writer = new Zend_Log_Writer_Stream($this->getLogPath());\n\t\t\t\t$logger = new Zend_Log($writer);\n\t\t\t\t$logger->info(\"entering capture()\");\n\t\t\t}\n\t\t\t$this->setAmount($amount)->setPayment($payment);\n\t\t\t\n\t\t$orderTable = Mage::getSingleton('core/resource')->getTableName('sales_flat_order'); \n\t\t$orderInvoiceTable = Mage::getSingleton('core/resource')->getTableName('sales_flat_invoice'); \n\t\t$orderno = $payment->getOrder()->getIncrementId();\n\t\t\n\t\t$sql = \"SELECT * FROM $orderInvoiceTable p, $orderTable q WHERE q.increment_id ='\".$orderno.\"' AND q.entity_id=p.order_id AND p.increment_id>'' ORDER BY p.entity_id desc LIMIT 1;\";\n\t\t$sqlResult = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchRow($sql);\n\t\t\n\t\t\t$invoiceId = $sqlResult['increment_id'];\n\t\t\tif($this->getDebug()) { $logger->info(\"lastinvoice: $invoiceId\"); }\n\t\t\t\n\t\t\tif(!$invoiceId) { $gatewayResponse = $this->_call($payment,'capture', $amount);\n\t\t\t} else { $gatewayResponse = $this->_call($payment,'captureonly', $amount); }\n\t\t\t\n\t\t\tif($this->getDebug()) { $logger->info(var_export($gatewayResponse, TRUE)); }\n\t\t\t\n\t\t\tif($gatewayResponse['Status']['transno']=='0') {\n\t\t\t\t$gatewayResponse = $this->_call($payment,'captureonly', $amount);\n\t\t\t\tif($this->getDebug()) { $logger->info(var_export($gatewayResponse, TRUE)); }\n\t\t\t}\n\t\t\tif($gatewayResponse === false)\n\t\t\t{\n\t\t\t\t$errorResult = $this->getError();\n\t\t\t\tif (isset($errorResult['message'])) {\n\t\t\t\t\t$message = Mage::helper('acimpro')->__('There has been an error processing your payment.') . $errorResult['message'];\n\t\t\t\t} else {\n\t\t\t\t\t$message = Mage::helper('acimpro')->__('There has been an error processing your payment. Please try later.');\n\t\t\t\t}\n\t\t\t\tMage::throwException($message);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/*if the transaction is successfulyl approved then set payment status*/\n\t\t\t\tif ($gatewayResponse['Status']['statusCode'] == \"Ok\")\n\t\t\t\t{\n\t\t\t\t\t/* If there is an error processing the credit card */\n\t\t\t\t\tif($gatewayResponse['Status']['code'] == \"I00001\")\n\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\t$payment->setIsTransactionClosed(0);\n\t\t\t\t\t\t$payment->setTransactionId($gatewayResponse['Status']['transno']);\n\t\t\t\t\t\t$payment->setLastTransId($gatewayResponse['Status']['transno'])\n\t\t\t\t\t\t\t\t->setCcApproval($gatewayResponse['Status']['code'])\n\t\t\t\t\t\t\t\t->setCcTransId($gatewayResponse['Status']['transno'])\n\t\t\t\t\t\t\t\t->setCcAvsStatus($gatewayResponse['Status']['statusCode'])\n\t\t\t\t\t\t\t\t->setCcCidStatus($gatewayResponse['Status']['statusCode']);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t/* Save customer \"payment profile id\" and \"cusotmer profile Id\" in database and on next order customer can checkout by selecting that card*/\n\t\t\t\t\t\t$params = Mage::app()->getRequest()->getParams(); \n\t\t\t\t\t\t \n\n\t\t\t\t\t\tif(isset($params['placecard']) && $params['placecard'] == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$resource = Mage::getSingleton('core/resource');\n\t\t\t\t\t\t\t$read= $resource->getConnection('core_read');\n\t\t\t\t\t\t\t$moreccTable = $resource->getTableName('morecc');\n\t\t\t\t\t\t\t$customerEmail = $payment->getOrder()->getCustomerEmail();\n\t\t\t\t\t\t\t$billingAddress = $payment->getOrder()->getBillingAddress();\n\t\t\t\t\t\t\t$customerId = $payment->getOrder()->getCustomerId();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!isset($customerEmail) && $customerEmail == \"\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$customerEmail = $billingAddress['email'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!isset($customerId) && $customerId == \"\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$customerId = $payment->getOrder()->getCustomerId();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*$select = $read->select()\n\t\t\t\t\t\t\t\t\t->from($moreccTable,array('morecc_id','email','number','profile_id','pay_id'))\n\t\t\t\t\t\t\t\t\t->where('email=?',$customerEmail) ;*/\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$select = \"Select * from \".$moreccTable.\" where cus_id='\".$customerId.\"' and pay_id = '\".$gatewayResponse['Status']['PaymentProfileID'].\"'\";\n\n\t\t\t\t\t\t\t$morecc = $read->fetchRow($select); \n\n\t\t\t\t\t\t\tif(!is_array($morecc))\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$customerProfileId = $gatewayResponse['Status']['CustomerProfileID'];\n\t\t\t\t\t\t\t\t$customerPayProfileId = $gatewayResponse['Status']['PaymentProfileID'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$name = $billingAddress['firstname'] .' '. $billingAddress['lastname'] ; \n\t\t\t\t\t\t\t\t$ccNumber = $payment->getCcNumber();\n\t\t\t\t\t\t\t\t$cardType = $payment->getCcType();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$cardExprMonth = $payment->getCcExpMonth();\n\t\t\t\t\t\t\t\t$cardExprYear = $payment->getCcExpYear();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$newCard = \"XXXX-XXXX-XXXX-\" . substr($ccNumber,-4,4);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$model = Mage::getModel('morecc/morecc');\n\t\t\t\t\t\t\t\t$model->setCreatedTime(now());\n\t\t\t\t\t\t\t\t$model->setEmail($customerEmail);\n\t\t\t\t\t\t\t\t$model->setCusId($customerId);\n\t\t\t\t\t\t\t\t$model->setName($name);\n\t\t\t\t\t\t\t\t$model->setNumber($newCard);\n\t\t\t\t\t\t\t\t$model->setCardType($cardType);\n\t\t\t\t\t\t\t\t$model->setExprMonth($cardExprMonth);\n\t\t\t\t\t\t\t\t$model->setExprYear($cardExprYear);\n\t\t\t\t\t\t\t\t$model->setProfileId($customerProfileId);\n\t\t\t\t\t\t\t\t$model->setPayId($customerPayProfileId);\n\t\t\t\t\t\t\t\t$model->setShipId($gatewayResponse['Status']['shippingAddressId']);\n\t\t\t\t\t\t\t\t$model->save();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/* Save customer \"payment profile id\" and \"cusotmer profile Id\" */\n\t\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\tMage::throwException(\"Authorize.net Gateway Error : \" . $gatewayResponse['Status']['code'] . \": \" . $gatewayResponse['Status']['statusDescription']);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "function svbk_rcp_email_user_on_manual_payment( $member, $payment_id, $gateway ) {\n\n\tglobal $rcp_options;\n\n\t$user_info = get_userdata( $member->id );\n\t$template = isset($rcp_options['mandrill_template_user_manual_payment']) ? $rcp_options['mandrill_template_user_manual_payment'] : '';\n\n\t$emails = new RCP_Mandrill_Emails;\n\t$emails->member_id = $member->ID;\n\t$emails->payment_id = $payment_id;\n\n\t$site_name = stripslashes_deep( html_entity_decode( get_bloginfo( 'name' ), ENT_COMPAT, 'UTF-8' ) );\n\t$admin_subject = sprintf( __( 'New manual payment on %s', 'rcp' ), $site_name );\n\n\tif( $template && $emails->sendTemplate($template, $user_info->user_email, $admin_subject ) ){\n\t\trcp_log( sprintf( '[Mandrill Emails] New Manual Payment email sent to user regarding payment #%d. Template: %s', $payment_id, $template ) );\n\n\t} else {\n\t\trcp_log( sprintf( '[Mandrill Emails] New Manual payment email not sent to user - template %s is empty or invalid.', ucwords( $status ), $template ) );\n\n\t\t$admin_message = __( 'Hello', 'rcp' ) . \"\\n\\n\" . $member->display_name . ' (' . $member->user_login . ') ' . __( 'you just submitted a manual payment on', 'rcp' ) . ' ' . $site_name . \".\\n\\n\" . __( 'Subscription:', 'rcp' ) . ': ' . $member->get_subscription_name() . \"\\n\\n\";\n\t\t$admin_message .= empty($rcp_options['manual_payment_instructions']) ? '' : ($rcp_options['manual_payment_instructions'] . \"\\n\\n\") ;\n\t\t$admin_message = apply_filters( 'rcp_before_user_email_manual_payment_thanks', $admin_message, $member->ID );\n\t\t$admin_message .= __( 'Thank you', 'rcp' );\t\t\n\t\t\n\t\t$emails->send( $user_info->user_email, $admin_subject, $admin_message );\n\t}\n\n}", "public function createExpressCheckoutOrder($tid){}" ]
[ "0.6275588", "0.6158984", "0.60097563", "0.580461", "0.5773559", "0.5767235", "0.5749239", "0.5673512", "0.56638914", "0.5619304", "0.5570909", "0.55623055", "0.55480385", "0.55438316", "0.55218756", "0.5521502", "0.5521502", "0.55105996", "0.5490935", "0.5490658", "0.5448747", "0.54413664", "0.54269445", "0.5425353", "0.5421542", "0.5411381", "0.5390769", "0.5388626", "0.5381492", "0.5355979", "0.53519595", "0.5332852", "0.5304952", "0.5298837", "0.52691317", "0.5268475", "0.52651525", "0.526085", "0.525879", "0.5254436", "0.52541035", "0.5252841", "0.52435404", "0.5242939", "0.5241768", "0.52278876", "0.52270174", "0.52257985", "0.5224676", "0.52197295", "0.5212557", "0.5204725", "0.52035683", "0.51777554", "0.5177244", "0.5172389", "0.5166247", "0.5152154", "0.5151712", "0.5151621", "0.5149881", "0.514508", "0.51425207", "0.5142232", "0.51416385", "0.5139209", "0.51285803", "0.51231706", "0.51167786", "0.5109297", "0.51013213", "0.5101249", "0.50963694", "0.5077934", "0.5074828", "0.5064434", "0.5062854", "0.5062593", "0.5060536", "0.5054952", "0.5054873", "0.50547606", "0.5042581", "0.5030954", "0.5024805", "0.50242245", "0.5021056", "0.5020064", "0.5019707", "0.501655", "0.50161207", "0.500255", "0.50010186", "0.49999383", "0.4994467", "0.49935508", "0.4987093", "0.498623", "0.49855", "0.49836138" ]
0.6357757
0
This command is used to attempt to capture payment when an invoice is set to a merchant gateway module Parameters: invoiceid the ID of the invoice the capture is to be attempted for Optional Parameters: cvv can be used to pass the cards verification value in the payment request See:
public function whmcs_capture_payment($params = array()) { $params['action'] = 'CapturePayment'; // return Whmcs_base::send_request($params); $load = new Whmcs_base(); return $load->send_request($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _doCapt($oID, $amt = 0, $currency = 'USD') {\r\n global $db, $messageStack;\r\n\r\n //@TODO: Read current order status and determine best status to set this to\r\n $new_order_status = MODULE_PAYMENT_AUTHORIZENET_ECHECK_ORDER_STATUS_ID;\r\n if ($new_order_status == 0) $new_order_status = 1;\r\n\r\n $proceedToCapture = true;\r\n $captureNote = strip_tags(zen_db_input($_POST['captnote']));\r\n if (isset($_POST['captconfirm']) && $_POST['captconfirm'] == 'on') {\r\n } else {\r\n $messageStack->add_session(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_CAPTURE_CONFIRM_ERROR, 'error');\r\n $proceedToCapture = false;\r\n }\r\n if (isset($_POST['btndocapture']) && $_POST['btndocapture'] == MODULE_PAYMENT_AUTHORIZENET_ECHECK_ENTRY_CAPTURE_BUTTON_TEXT) {\r\n $captureAmt = (float)$_POST['captamt'];\r\n/*\r\n if ($captureAmt == 0) {\r\n $messageStack->add_session(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_INVALID_CAPTURE_AMOUNT, 'error');\r\n $proceedToCapture = false;\r\n }\r\n*/\r\n }\r\n if (isset($_POST['captauthid']) && trim($_POST['captauthid']) != '') {\r\n // okay to proceed\r\n } else {\r\n $messageStack->add_session(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_TRANS_ID_REQUIRED_ERROR, 'error');\r\n $proceedToCapture = false;\r\n }\r\n /**\r\n * Submit capture request to Authorize.net\r\n */\r\n if ($proceedToCapture) {\r\n // Populate an array that contains all of the data to be sent to Authorize.net\r\n unset($submit_data);\r\n $submit_data = array(\r\n 'x_type' => 'PRIOR_AUTH_CAPTURE',\r\n 'x_amount' => number_format($captureAmt, 2),\r\n 'x_trans_id' => strip_tags(trim($_POST['captauthid'])),\r\n// 'x_invoice_num' => $new_order_id,\r\n// 'x_po_num' => $order->info['po_number'],\r\n// 'x_freight' => $order->info['shipping_cost'],\r\n// 'x_tax_exempt' => 'FALSE', /* 'TRUE' or 'FALSE' */\r\n// 'x_tax' => $order->info['tax'],\r\n );\r\n\r\n $response = $this->_sendRequest($submit_data);\r\n $response_code = $response[0];\r\n $response_text = $response[3];\r\n $response_alert = $response_text . ($this->commError == '' ? '' : ' Communications Error - Please notify webmaster.');\r\n $this->reportable_submit_data['Note'] = $captureNote;\r\n $this->_debugActions($response);\r\n\r\n if ($response_code != '1' || ($response[0]==1 && $response[2] == 311) ) {\r\n $messageStack->add_session($response_alert, 'error');\r\n } else {\r\n // Success, so save the results\r\n $sql_data_array = array('orders_id' => (int)$oID,\r\n 'orders_status_id' => (int)$new_order_status,\r\n 'date_added' => 'now()',\r\n 'comments' => 'FUNDS COLLECTED. Auth Code: ' . $response[4] . \"\\n\" . 'Trans ID: ' . $response[6] . \"\\n\" . ' Amount: ' . ($response[9] == 0.00 ? 'Full Amount' : $response[9]) . \"\\n\" . 'Time: ' . date('Y-m-D h:i:s') . \"\\n\" . $captureNote,\r\n 'customer_notified' => 0\r\n );\r\n zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\r\n $db->Execute(\"update \" . TABLE_ORDERS . \"\r\n set orders_status = '\" . (int)$new_order_status . \"'\r\n where orders_id = '\" . (int)$oID . \"'\");\r\n $messageStack->add_session(sprintf(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_CAPT_INITIATED, ($response[9] == 0.00 ? 'Full Amount' : $response[9]), $response[6], $response[4]), 'success');\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public function acceptCapture($order, $params)\n {\n $arrInfo = array();\n Mage::register('ops_auto_capture', true);\n $forceFullInvoice = false;\n $payId = $params['PAYID'];\n try {\n if ($payId) {\n $transaction = Mage::helper(\"ops/directlink\")->getPaymentTransaction(\n $order,\n $payId,\n Netresearch_OPS_Model_Payment_Abstract::OPS_CAPTURE_TRANSACTION_TYPE\n );\n if ($transaction) {\n $arrInfoSerialized = $transaction->getAdditionalInformation();\n $arrInfo = unserialize($arrInfoSerialized['arrInfo']);\n if (array_key_exists('type', $arrInfo) && $arrInfo['type'] == 'full') {\n $forceFullInvoice = true;\n }\n }\n }\n } catch (Mage_Core_Exception $e) {\n //If no transaction was found create a full invoice if possible\n $forceFullInvoice = true;\n $transaction = null;\n }\n\n if ($forceFullInvoice === true) {\n if (!$order->getInvoiceCollection()->getSize()) {\n $invoice = $order->prepareInvoice();\n $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);\n $comment = Mage::helper(\"ops\")->__(\"Capture process complete\");\n } else {\n Mage::throwException(\n Mage::helper('ops')->__('The capture has already been invoiced.')\n );\n }\n } else {\n $invoice = Mage::getModel('sales/service_order', $order)\n ->prepareInvoice($arrInfo['items']);\n if (!$invoice->getTotalQty()) {\n Mage::throwException(\n Mage::helper('ops')->__('Cannot create an invoice without products.')\n );\n }\n $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);\n $comment = Mage::helper(\"ops\")->__(\"Capture process complete\");\n }\n\n if (is_object($invoice)) {\n $invoice->register();\n $transactionSave = Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder());\n $shipment = false;\n if (isset($transaction)\n && array_key_exists('do_shipment', $arrInfo)\n && $arrInfo['do_shipment']\n ) {\n $shipment = $this->_prepareShipment($invoice, $arrInfo);\n if ($shipment) {\n $shipment->setEmailSent($invoice->getEmailSent());\n $transactionSave->addObject($shipment);\n }\n }\n\n $transactionSave->save();\n\n //Send E-Mail and Comment\n $sendEMail = false;\n $sendEMailWithComment = false;\n if (isset($arrInfo['send_email'])) $sendEMail = true;\n if (isset($arrInfo['comment_customer_notify'])) $sendEMailWithComment = true;\n $comment = array_key_exists('comment_text', $arrInfo) ? $arrInfo['comment_text'] : '';\n\n $invoice->addComment($comment, $sendEMailWithComment);\n if ($sendEMail) {\n $invoice->sendEmail(true, $comment);\n $invoice->setEmailSent(true);\n }\n $invoice->save();\n\n Mage::helper(\"ops/directlink\")->closePaymentTransaction(\n $order,\n $params,\n Netresearch_OPS_Model_Payment_Abstract::OPS_CAPTURE_TRANSACTION_TYPE,\n Mage::helper('ops')->__(\n 'Invoice \"%s\" was created automatically. Ingenico Payment Services Status: %s.',\n $invoice->getIncrementId(),\n Mage::helper('ops')->getStatusText($params['STATUS'])\n ),\n $sendEMail\n );\n Mage::helper('ops')->log(sprintf(\"Invoice created for order: %s\", $order->getIncrementId()));\n }\n $order->save();\n $eventData = array('data_object' => $order, 'order' => $order);\n Mage::dispatchEvent('ops_sales_order_save_commit_after', $eventData);\n }", "public function quickbooksms_capture_payment($params)\n\t{\n\t\t$this->_api_method = 'CustomerCreditCardCaptureRq';\n\t\t$this->_request = $this->_build_request($params);\t\t\t\n\t\treturn $this->_handle_query();\n\t}", "public function processApiInvoice($invoice)\n {\n if($this->_logging){\n Mage::log('In processApiInvoice (Postpayment)', null, $this->_logfile);\n }\n $order = $invoice->getOrder();\n // Request model, data model, product line model, total line model\n $v2RqstMdl = new Tritacv2_Model_InvoiceRequestV2Model();\n $v2DataMdl = new Tritacv2_Model_InvoicePdfDataModel();\n $v2ProdMdlArray = $this->getProductLines($order);\n $v2TtlMdlArray = $this->getOrderTotals($order);\n $shopName = Mage::app()->getStore()->getFrontendName();\n $v2DataMdl->setShopName($shopName);\n $v2DataMdl->setDescription('');\n $v2DataMdl->setProductLines($v2ProdMdlArray);\n $v2DataMdl->setTotalLines($v2TtlMdlArray);\n // finally fill request model:\n $v2RqstMdl->setTransactionNumber($invoice->getTransactionId());\n $v2RqstMdl->setInvoiceNumber($invoice->getIncrementId());\n $objDateTime = new DateTime('NOW');\n $v2RqstMdl->setInvoiceDate($objDateTime);\n $v2RqstMdl->setInvoiceAmount(Mage::helper('capayable')->convertToCents($invoice->getGrandTotal()));\n $v2RqstMdl->setInvoiceDescription(Mage::helper('capayable')->__('Order').' '.$order->getIncrementId());\n $v2RqstMdl->setInvoicePdfSubmitType('INCLUDED_DATA');\n $v2RqstMdl->setCultureCode('nl-NL');\n $v2RqstMdl->setInvoicePdfData($v2DataMdl);\n try {\n $publicKey = Mage::getStoreConfig('payment/capayable/public_key');\n $apiConfig = new Tritacv2_Configuration();\n $apiConfig->setApiKey('apikey', $publicKey); // test key 'f2d2a2aee085bfcde02d3b50e30a7394efcd49e5'\n //$apiConfig->setHost('https://capayable-api-acc.tritac.com');\n if($this->_logging) {\n Mage::log('In processApiInvoice (Postpayment) dit is url ' . $this->_url, null, $this->_logfile);\n }\n $apiConfig->setHost($this->_url);\n $apiClient = new Tritacv2_ApiClient($apiConfig);\n $invoiceApi = new Tritacv2_Api_InvoiceApi($apiClient);\n $result = $invoiceApi->invoiceV2Post($v2RqstMdl);\n if($this->_logging) {\n Mage::log('In checkCredit (Postpayment) result : ', null, $this->_logfile);\n Mage::log($result, null, $this->_logfile);\n }\n if($result->getIsAccepted() == true || $result->getIsAccepted() == 1) {\n return true;\n } else {\n return false;\n }\n } catch (Exception $e) {\n Mage::log('Exception when calling creditCheckApi->creditCheckV2Post: '. $e->getMessage(), null, $this->_logfile);\n }\n\n //return $response['IsAccepted'];\n }", "public function capture($orderId, $amount, $invoice = null)\n {\n $data['captured_amount'] = Mage::helper('klarna_kco/checkout')->toApiFloat($amount);\n\n /**\n * Get items for capture\n */\n if ($invoice instanceof Mage_Sales_Model_Order_Invoice) {\n $orderItems = $this->_getGenerator()\n ->setObject($invoice)\n ->collectOrderLines()\n ->getOrderLines();\n\n if ($orderItems) {\n $data['order_lines'] = $orderItems;\n }\n }\n\n /**\n * Set shipping delay for capture\n *\n * Change this setting when items will not be shipped for x amount of days after capture.\n *\n * For instance, you capture on Friday but won't ship until Monday. A 3 day shipping delay would be set.\n */\n $shippingDelayObject = new Varien_Object(\n array(\n 'shipping_delay' => 0\n )\n );\n\n Mage::dispatchEvent(\n 'kco_capture_shipping_delay', array(\n 'shipping_delay_object' => $shippingDelayObject\n )\n );\n\n if ($shippingDelayObject->getShippingDelay()) {\n $data['shipping_delay'] = $shippingDelayObject->getShippingDelay();\n }\n\n $response = $this->_getOrderManagementApi()->captureOrder($orderId, $data);\n\n /**\n * If a capture fails, attempt to extend the auth and attempt capture again.\n * This work in certain cases that cannot be detected via api calls\n */\n if (!$response->getIsSuccessful() && !$this->_isRecursiveCall) {\n $extendResponse = $this->_getOrderManagementApi()->extendAuthorization($orderId);\n\n if ($extendResponse->getIsSuccessful()) {\n $this->_isRecursiveCall = true;\n $response = $this->capture($orderId, $amount);\n $this->_isRecursiveCall = false;\n\n return $response;\n }\n }\n\n if ($response->getIsSuccessful()) {\n $captureId = $this->_getOrderManagementApi()\n ->getLocationResourceId($response->getResponseObject()->getHeader('Location'));\n\n if ($captureId) {\n $captureDetails = $this->_getOrderManagementApi()->getCapture($orderId, $captureId);\n\n if ($captureDetails->getKlarnaReference()) {\n $captureDetails->setTransactionId($captureDetails->getKlarnaReference());\n\n return $captureDetails;\n }\n }\n }\n\n return $response;\n }", "public function bluepay_capture_payment($params)\n\t{\n\t\t$this->_api_method = 'CAPTURE';\n\t\t$this->_request = $this->_build_request($params);\t\t\t\n\t\treturn $this->_handle_query();\n\t}", "public function capture($referenceId, $transactionId, $amount, array $invoiceAmounts = null)\n {\n// This method is unsupported\n $this->Input->setErrors($this->getCommonError(static::UNSUPPORTED));\n }", "public function capture($reference_id, $transaction_id, $amount, array $invoice_amounts=null) {\n\t\t\n\t\t$this->Input->setErrors($this->getCommonError(\"unsupported\"));\n\t}", "function InfUpdateCreditCardCVV($inf_card_id, $CVV2) {\n\n\t$credit_card = new Infusionsoft_CreditCard();\n\t$credit_card->Id = $inf_card_id;\n\t$credit_card->CVV2 = $CVV2;\n\treturn $credit_card->save(); // Update Card in Infusionsoft\n}", "public function do_payment ($request) {\n\t\t $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n\t\t $merchantAuthentication->setName(config('services.authorize.login'));\n\t\t $merchantAuthentication->setTransactionKey(config('services.authorize.key'));\n\t\t $refId = 'ref'.time();\n\t\t// Create the payment data for a credit card\n\t\t $creditCard = new AnetAPI\\CreditCardType();\n\t\t $creditCard->setCardNumber($request->credit_card_number);\n\t\t $expiry = $request->credit_card_year . '-' . $request->credit_card_month;\n\t\t // dd($expiry);\n\t\t // $creditCard->setExpirationDate( \"2038-12\");\n\t\t $creditCard->setExpirationDate($expiry);\n\t\t $paymentOne = new AnetAPI\\PaymentType();\n\t\t $paymentOne->setCreditCard($creditCard);\n\t\t// Create a transaction\n\t\t $transactionRequestType = new AnetAPI\\TransactionRequestType();\n\t\t $transactionRequestType->setTransactionType(\"authCaptureTransaction\");\n\t\t $transactionRequestType->setAmount($request->transaction_total_cost);\n\t\t $transactionRequestType->setPayment($paymentOne);\n\t\t $request = new AnetAPI\\CreateTransactionRequest();\n\t\t $request->setMerchantAuthentication($merchantAuthentication);\n\t\t $request->setRefId( $refId);\n\t\t $request->setTransactionRequest($transactionRequestType);\n\t\t $controller = new AnetController\\CreateTransactionController($request);\n\t\t $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\t\t/*if ($response != null){\n\t\t\t$tresponse = $response->getTransactionResponse();\n\t\t\tif (($tresponse != null) && ($tresponse->getResponseCode()==\"1\")){\n\t\t\t\techo \"Charge Credit Card AUTH CODE : \" . $tresponse->getAuthCode() . \"\\n\";\n\t\t\t\techo \"Charge Credit Card TRANS ID : \" . $tresponse->getTransId() . \"\\n\";\n\t\t\t} else {\n\t\t\t\techo \"Charge Credit Card ERROR : Invalid response\\n\";\n\t\t\t}\n\t\t} else {\n\t\t\techo \"Charge Credit Card Null response returned\";\n\t\t}*/\n\t\treturn $response;\n\t}", "public function void_invoice() \n {\n \n $tenant_id = $this->tenant_id;\n\n $logged_in_user_id = $this->user->user_id;\n $invoice_id = $this->input->post('invoice_id');\n $pymnt_due_id = $this->input->post('pymnt_due_id');\n \n $status = $this->classtraineemodel->void_invoice($tenant_id, $logged_in_user_id,$invoice_id, $pymnt_due_id);\n if ($status) \n {\n \n $this->session->set_flashdata(\"success\", \"Successfully invoice is voided '\" . $invoice_id . \"'\");\n } \n else \n {\n $this->session->set_flashdata(\"error\", \"We were not able to voide invoice. Please try again later.\");\n }\n \n redirect(\"accounting/generate_invoice\");\n }", "public function vod_invoice(Request $request) {\n\n try {\n\n $currency = Setting::get('currency');\n\n if($this->device_type == DEVICE_WEB) {\n\n $video_details = VodVideo::where('unique_id', $request->video_id)->first();\n\n $video_id = $video_details ? $video_details->id : 0;\n\n $request->request->replace(['video_id' => $video_id]);\n }\n\n $validator = Validator::make(\n $request->all(), array(\n 'video_id'=>'required|exists:vod_videos,id,status, '.VOD_APPROVED_BY_USER.',admin_status,'.VOD_APPROVED_BY_ADMIN.',publish_status,'.VIDEO_PUBLISHED.',is_pay_per_view,'.PPV_ENABLED,\n ));\n\n if ($validator->fails()) {\n // Error messages added in response for debugging\n $error_messages = implode(',',$validator->messages()->all());\n\n throw new Exception($error_messages, 101); \n\n } else {\n\n $model = VodVideo::select('user_id as id', 'id as vod_id', 'unique_id',\n 'title', 'description', 'amount', \n 'image', 'type_of_user', 'type_of_subscription',\n DB::raw('DATE_FORMAT(vod_videos.created_at , \"%e %b %y\") as date'),\n DB::raw(\"'$currency' as currency\"))\n ->where('id',$request->video_id)->first();\n \n if ($model) {\n\n $type_of_user = \"\";\n\n if ($model->type_of_user == NORMAL_USER) {\n\n $type_of_user = tr('normal_users');\n\n } else if($model->type_of_user == PAID_USER) {\n\n $type_of_user = tr('paid_users');\n\n } else if($model->type_of_user == BOTH_USERS) {\n\n $type_of_user = tr('both_users');\n }\n\n $type_of_subscription = \"\";\n \n if ($model->type_of_subscription == ONE_TIME_PAYMENT) {\n\n $type_of_subscription = tr('one_time_payment');\n\n } else if($model->type_of_subscription == RECURRING_PAYMENT) {\n\n $type_of_subscription = tr('recurring_payment');\n\n }\n\n $model['type_of_user'] = $type_of_user;\n\n $model['type_of_subscription'] = $type_of_subscription;\n \n $response_array = ['success'=>true, 'data'=>$model];\n\n } else {\n\n throw new Exception(tr('no_vod_video_found'));\n\n }\n\n }\n\n return $response_array;\n\n } catch(Exception $e) {\n\n $message = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success'=>false, 'error_messages'=>$message, 'error_code'=>$code];\n\n return $response_array;\n }\n \n }", "public static function capture_credit_card_authorization( $order_id ) {\n\t\t$order = new WC_Order( $order_id );\n\n\t\tswitch ($order->get_payment_method()) {\n\t\t\tcase \"globalpayments_heartland\":\n\t\t\t\t$gateway = new HeartlandGateway();\n\t\t\t\tbreak;\n\t\t\tcase \"globalpayments_transit\":\n\t\t\t\t$gateway = new TransitGateway();\n\t\t\t\tbreak;\n\t\t\tcase \"globalpayments_genius\":\n\t\t\t\t$gateway = new GeniusGateway();\n\t\t\t\tbreak;\n\t\t\tcase \"globalpayments_gpapi\":\n\t\t\t\t$gateway = new GpApiGateway();\n\t\t\t\tbreak;\n\t\t};\n\n\t\t$request = $gateway->prepare_request( self::TXN_TYPE_CAPTURE, $order );\n\n\t\ttry {\n\t\t\t$response = $gateway->submit_request( $request );\n\n\t\t\tif ( \"00\" === $response->responseCode && \"Success\" === $response->responseMessage\n\t\t\t\t|| 'SUCCESS' === $response->responseCode && \"CAPTURED\" === $response->responseMessage ) {\n\t\t\t\t$order->add_order_note(\n\t\t\t\t\t\"Transaction captured. Transaction ID for the capture: \" . $response->transactionReference->transactionId\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $response;\n\t\t} catch ( Exception $e ) {\n\t\t\twp_die(\n\t\t\t\t$e->getMessage(),\n\t\t\t\t'',\n\t\t\t\tarray(\n\t\t\t\t\t'back_link' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "public function capture(Varien_Object $payment, $amount) {\r\n\t\tif( $this->_debug ) Mage::log('capture()', null, 'authnetcim.log');\r\n\t\r\n\t\t$post = Mage::app()->getRequest()->getParam('payment');\r\n\t\t$profile_id = 0;\r\n\t\t\r\n\t\tif( !empty($post['payment_id']) && empty($post['cc_number']) ) {\r\n\t\t\t$profile_id = intval( $post['payment_id'] );\r\n\t\t\t\r\n\t\t\t$payment->getOrder()->setExtCustomerId( $profile_id )->save();\r\n\t\t}\r\n\t\t\r\n\t\t$trans_id = explode( ':', $payment->getOrder()->getExtOrderId() );\r\n\t\t$type = !empty($trans_id[1]) ? 'profileTransPriorAuthCapture' : 'profileTransAuthCapture';\r\n\t\t\r\n\t\t// Set 'save card' checkbox if checked\r\n\t\tif( ( isset( $post['save_card'] ) && $post['save_card'] == 1 ) || $profile_id > 0 || !empty( $trans_id[1] ) ) {\r\n\t\t\t$payment->setSaveCard( true );\r\n\t\t}\r\n\t\t\r\n\t\t// Handle partial-invoice with expired auth\r\n\t\tif( $type == 'profileTransPriorAuthCapture' && $payment->getOrder()->getTotalPaid() > 0 ) {\r\n\t\t\t$type = 'profileTransCaptureOnly';\r\n\t\t}\r\n\t\t\r\n\t\t// Grab the invoice in case partial invoicing\r\n\t\t$invoice = Mage::registry('current_invoice');\r\n\t\tif( !is_null( $invoice ) ) {\r\n\t\t\t$this->_invoice = $invoice;\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->bill( $payment, $amount, $type );\r\n\t}", "function payment($userid = 0, $invoiceid = 0, $invoicetype = 'subscription', $amount = 0, $method = 'account', $gateway = '', $gatewaytxn = '', $isrefund = false, $originalgatewaytxn = '', $silentmode = false)\n {\n global $ilance, $show, $phrase, $page_title, $area_title, $ilconfig, $ilpage;\n\t\t$selectextrafields = '';\n\n ($apihook = $ilance->api('process_debit_payment_start')) ? eval($apihook) : false;\n \n // #### INSTANT PAYMENT NOTIFICATION HANDLER ###########################\n if ($method == 'ipn')\n {\n $sql = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, isenhancementfee, transactionid, projectid\" . $selectextrafields. \"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"',\n paymethod = '\" . $ilance->db->escape_string($gateway) . \"',\n custommessage = '\" . $ilance->db->escape_string($gatewaytxn) . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n if ($res_invoice['isif'] == '1')\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '1' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '0' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" , featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n }\n else if ($res_invoice['isenhancementfee'] == '1')\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isifpaid', $res_invoice['projectid']) == '1' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isifpaid', $res_invoice['projectid']) == '0' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n } \n else if ($res_invoice['isfvf'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['isescrowfee'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n \n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_ipn_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND orderid = '\" . $res_invoice['buynowid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n $resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC);\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => fetch_user('username', intval($userid)),\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n $ilance->email->send();\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->send();\n return true;\n }\n return false;\n }\n // #### ONLINE ACCOUNT HANDLER #########################################\n else if ($method == 'account')\n {\n $sql_balance = $ilance->db->query(\"\n\t\t\t\tSELECT available_balance, total_balance\n\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\tWHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_balance) > 0)\n {\n $res_balance = $ilance->db->fetch_array($sql_balance, DB_ASSOC);\n if ($res_balance['available_balance'] >= $amount)\n {\n $avail_balance = $res_balance['available_balance'];\n $total_balance = $res_balance['total_balance'];\n $avail_balance_after = ($avail_balance - $amount);\n $total_balance_after = ($total_balance - $amount);\n $sql_invoice = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, transactionid, isenhancementfee\" . $selectextrafields .\"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_invoice) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql_invoice, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND invoicetype = '\" . $ilance->db->escape_string($invoicetype) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"users\n SET available_balance = '\" . $ilance->db->escape_string($avail_balance_after) . \"',\n total_balance = '\" . $ilance->db->escape_string($total_balance_after) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($res_invoice['isif'])\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isenhancementfeepaid, enhancementfeeinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isenhancementfeepaid'] == '1' AND $res['enhancementfeeinvoiceid'] != '0') OR ($res['isenhancementfeepaid'] == '0' AND $res['enhancementfeeinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isenhancementfee'])\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isifpaid, ifinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isifpaid'] == '1' AND $res['ifinvoiceid'] != '0') OR ($res['isifpaid'] == '0' AND $res['ifinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isfvf'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n if ($res_invoice['isescrowfee'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_account_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT orderid, escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n while ($resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC))\n {\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => $_SESSION['ilancedata']['user']['username'],\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n $ilance->email->mail = $_SESSION['ilancedata']['user']['email'];\n $ilance->email->slng = $_SESSION['ilancedata']['user']['slng'];\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n if ($silentmode)\n {\n return true;\n }\n $area_title = '{_invoice_payment_complete_menu}';\n $page_title = SITE_NAME . ' - {_invoice_payment_complete_menu}';\n print_notice('{_invoice_payment_complete}', '{_your_invoice_has_been_paid_in_full}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n $page_title = SITE_NAME . ' - {_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n print_notice('{_invoice_error}', '{_were_sorry_this_invoice_does_not_exist}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_funds_not_available}';\n $page_title = SITE_NAME . ' - {_funds_not_available}';\n print_notice('{_invoice_payment_warning_insufficient_funds}', '{_were_sorry_this_invoice_can_not_be_paid_due_to_insufficient_funds}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n }\n return false;\n }", "public function createInvoice()\n {\n //seccion para registrar certificaos relacionados con un RFC \n /* $params = [ \n 'Rfc' => 'AAA010101AAA',\n 'Certificate' => 'MIIF+TCCA+GgAwIBAgIUMzAwMDEwMDAwMDAzMDAwMjM3MDEwDQYJKoZIhvcNAQELBQAwggFmMSAwHgYDVQQDDBdBLkMuIDIgZGUgcHJ1ZWJhcyg0MDk2KTEvMC0GA1UECgwmU2VydmljaW8gZGUgQWRtaW5pc3RyYWNpw7NuIFRyaWJ1dGFyaWExODA2BgNVBAsML0FkbWluaXN0cmFjacOzbiBkZSBTZWd1cmlkYWQgZGUgbGEgSW5mb3JtYWNpw7NuMSkwJwYJKoZIhvcNAQkBFhphc2lzbmV0QHBydWViYXMuc2F0LmdvYi5teDEmMCQGA1UECQwdQXYuIEhpZGFsZ28gNzcsIENvbC4gR3VlcnJlcm8xDjAMBgNVBBEMBTA2MzAwMQswCQYDVQQGEwJNWDEZMBcGA1UECAwQRGlzdHJpdG8gRmVkZXJhbDESMBAGA1UEBwwJQ295b2Fjw6FuMRUwEwYDVQQtEwxTQVQ5NzA3MDFOTjMxITAfBgkqhkiG9w0BCQIMElJlc3BvbnNhYmxlOiBBQ0RNQTAeFw0xNzA1MTgwMzU0NTFaFw0yMTA1MTgwMzU0NTFaMIHlMSkwJwYDVQQDEyBBQ0NFTSBTRVJWSUNJT1MgRU1QUkVTQVJJQUxFUyBTQzEpMCcGA1UEKRMgQUNDRU0gU0VSVklDSU9TIEVNUFJFU0FSSUFMRVMgU0MxKTAnBgNVBAoTIEFDQ0VNIFNFUlZJQ0lPUyBFTVBSRVNBUklBTEVTIFNDMSUwIwYDVQQtExxBQUEwMTAxMDFBQUEgLyBIRUdUNzYxMDAzNFMyMR4wHAYDVQQFExUgLyBIRUdUNzYxMDAzTURGUk5OMDkxGzAZBgNVBAsUEkNTRDEwX0FBQTAxMDEwMUFBQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAIiV+76Q7p9i5Bj4G1YuYuPtf/cO/dyNX19o6y57CiKcgGYEqPqb88cJ/IPPyFPIFtBdxYJmqikxMwxDHTIsolI0GMvqEO1BsokcDOL4UfMZt7NmYaH1P8Nj/fO5xn0b1qSnSfQHGdPLMgXsLPhaR69HREsVEIowEMM5ucoNArSNzel4XJU8X/dnoumZvaOyCdvEC076NzB3UJA53ZD1xvvPEedUfAfj2eaUCQJYPnToyf7TAOGzzGkX5EGcjxC3YfcXGwG2eNdbSbxSiADPx6QACgslCu1vzmCzwQAmfeHWQvirpZccJyD/8shd7z7fv5A/G0g3aDloM5AXwA3nDVsCAwEAAaMdMBswDAYDVR0TAQH/BAIwADALBgNVHQ8EBAMCBsAwDQYJKoZIhvcNAQELBQADggIBAJepSmoMRmasH1IyLe68oM6+Qpm/kXjwQw8ALMkhHTI3XmxjUVqpJ6k9zZQfwyTLc2UZIo8jdO4WH3bcRBDcYOkciW3KxhKAbLgJPHAieVOyObXViET0ktLL6xeDHnf5Au4LOi0m01E8IPFbxYKb+RU1xpOKqJuRHH5dfRBg4HV8y+OTa5lVZil+sAhwdyXFsPf9FqN1SNn9EuKjYc9+lkRiGcHPNb1ZAtDsaQdGzoAbR+Z6m9FdZB/XU+Huls+ePdkw1t2/37AJZkYqr3wVNKrrpQkax9DrnFT8E+7xKXLcbpw3YOYBoENj2+NuMn29sn3U97wKlpyn/GeMwbkCmOGBAMtK9O6+wRrcEmu9Js68asHd5JQSzA39BRAUjb/9aefmWTb6DNm22IUUSSOT9MK5yWGncdWxKrNtMvx7OyYlYV2/qG4p/rMlj6nZcIpwONhyLUwxr74kO0Jo3zus81t9S/J91jumiwyNVqJZ77vmAy6lQnr8Og9/YaIzDH5L/byJQJquDKEmLvuya4sQ2iJj+p282RNpBscO/iyma8T+bZjG2CFYUTwGtOEZ2aLqApJ4cCBW7Ip569B+g7mgG8fdij6E1OlJ8Y3+ovBMak8LtnFVxsfthdWOK+AU2hWGU88rfZkLJ0RJn8oAq/6ri0iJNCKym/mc9g0JpNw+asMM',\n 'PrivateKey' => 'MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIAgEAAoIBAQACAggAMBQGCCqGSIb3DQMHBAgwggS9AgEAMASCBMh4EHl7aNSCaMDA1VlRoXCZ5UUmqErAbucRBAKNQXH8tz2zJ7hdZaOZx7PEfMiWh5Nh6e8G8kxY+GW4YCSbLxslkhBtfTR6v5JYv3vhgH7XzMCwJPOfX6gxeeCYZ4HTdDNAyBVCjTbJpqbo778ri33o+I4yx7zgMqA3mzVE61re6MPrGXh1YT/K9zZeEdmwvXQfPs9VnioKUhiswoMcJ3kc3FxGLrEAsjQqv/ZVOHPY3NrbcfpQUyprsCKv3rRdxkIRdMPY4eiA720mffzvDqyzeQ8xfwHTE8Xjunja4KXvW/mV7ItTH0vRXHc3HJQ0dNnyawXmbC1FiYbCVdswoYuVQmslvq3QEXUGwP3KYfxQzKatnU7nprkmsipPqPBqDrzqc6NSN/8rxIc5zTAL4bFul+CEKz9VybwdavgewEy7u3fPnKPN+y4HilNgmlbtS7seWpbIgVPA+woG2Ph5hsgREXZCjGKSRuI77/FLcI5CMrZR+FvbnaqG+gXDBTz2lWhK9pmWlVawT2pvfiHOLzYRf2YyuVbJ79D2EgbUKyp3kCQ6fddMzspPhD/pvLQizExeyIxImb/kQXs2mmtDnyFIsj4Hcn5wCcs+SDIj+FJnwRiKB6YfdzjIig/ZMfpgMpl0u69LX649uL318o+Hy3d5t3wxgSkTaJ5McKhWyh9x9vlHZhYyM6HArBNfP9cGF86M3GwAMHAiJQl9UevyKe6rlvAIDlop6l3M02m5hHUXUpPjz4j7inFXZzvSv0tFoSbEqGgno0Pa+0gWHqRwBEGLGEwHVfyEy+Of8g4+0jzo0jNPIcurA5xRh9HSRSAd3kdEhx75eeVL7lBdLjRUkbtRtg7nelSjqAX7tQZK6Awp5C/17W96+f/vtjB+Y+ZgrSUjnQDADnZCnapIrzHgE3ZanhGAtnMMl+o4aLd1+74inG4jht/GJB60raSQfYrDrM3kBs0oyfpbEk5TI8ISzRlRmejv+mqpTogJaAqhnLP7rAli3d4pRhUjbACn/xQSFKxl2OURdmnMlvlbb6pleXviJHRxzPPQ25NVdWvmCYWrDfAZYn8X1sABOdyrth38BfmAVsyyPATYFB+5cXuNIZkPz1swz3859iZWTn5JRfPEAGICu5G6w6nrgOLYM9UqOPmxofzEdiEPafLQ5orMxdSWF6+3mD2Yw/VP+B43B/oYehgfrYjBUJt2D04VU/v8XK1ZUVgX/Co0odcdcszAP+ljQ7UVhW+uxVMd2sEprwepPPjYT3HvdI6RBB94yYBWfkoCSo/jsrrRpw2DVEyvoDp/hOXKyt8Y/8UGLCxJUhhv5fEiezYnlUAmwAGjgZfzfAErx0gkQFBgNKglEA7jz0Dqc2Z92pGVGTyPtXqRsqX3IYX5WsZVUoJim0wI7+LNmKpu147ePC0G4Sf4AGoZyPWVXq2SZSPpN261pIKSoLEDeA8WIKj2U5JG2DMMYokV0bZ1TsabrwHvwsp3muLnaP8L+n2fBplbhAEE2buBXvsATixMGu57ZI5WKFLnHn4KIBrZzALCtGehfFbCsdf1nBR6aAt+BpWhhZki54fZTurgMr6zuC5hAaP4rExW+LCc3upHMW7R9DcHWaZuZIfwnVDImnAQ9UOsz+A=',\n 'PrivateKeyPassword' => '12345678a'\n ];\n $lstNameIds = $this->facturama->post('api-lite/csds', $params ); */\n\n\n $params = [\n \"Issuer\" => [\n \"FiscalRegime\" => \"601\",\n \"Rfc\" => \"AAA010101AAA\",\n \"Name\" => \"EXPRESION EN SOFTWARE\"\n ],\n \"Receiver\" => [\n \"Name\" => \"Entidad receptora\",\n \"CfdiUse\" => \"P01\",\n \"Rfc\" => \"AAA010101AAA\"\n ],\n //agregado NO \n 'Folio' => '102',\n \"CfdiType\" => \"I\",\n \"NameId\" => \"1\",\n \"ExpeditionPlace\" => \"12345\",\n \"PaymentForm\" => \"03\",\n \"PaymentMethod\" => \"PUE\",\n \"Currency\" => \"MXN\",\n \"Date\" => \"2021-01-19T09:51:39\",\n \"Items\" => [\n [\n \"Quantity\" => \"100\",\n \"ProductCode\" => \"84111506\",\n \"UnitCode\" => \"E48\",\n \"Unit\" => \"Unidad de servicio\",\n \"Description\" => \" API folios adicionales\",\n \"IdentificationNumber\" => \"23\",\n \"UnitPrice\" => \"0.50\",\n \"Subtotal\" => \"50.00\",\n \"Discount\" => \"10\",\n \"DiscountVal\" => \"10\",\n \"Taxes\" => [\n [\n \"Name\" => \"IVA\",\n \"Rate\" => \"0.16\",\n \"Total\" => \"6.4\",\n \"Base\" => \"40\",\n \"IsRetention\" => \"false\"\n ]\n ],\n \"Total\" => \"46.40\"\n ],\n [\n \"Quantity\" => \"1\",\n \"ProductCode\" => \"84111506\",\n \"UnitCode\" => \"E48\",\n \"Unit\" => \"Unidad de servicio\",\n \"Description\" => \" API Implementación \",\n \"IdentificationNumber\" => \"21\",\n \"UnitPrice\" => \"6000.00\",\n \"Subtotal\" => \"6000.00\",\n \"Taxes\" => [\n [\n \"Name\" => \"IVA\",\n \"Rate\" => \"0.16\",\n \"Total\" => \"960\",\n \"Base\" => \"6000\",\n \"IsRetention\" => \"false\"\n ]\n ],\n \"Total\" => \"6960.00\"\n ]\n ]\n ];\n\n // $result = $this->facturama->post('2/cfdis', $params);\n // api-lite\n $result = $this->facturama->post('api-lite/2/cfdis', $params);\n return $result;\n }", "function take_cash_payment($invoice_id = '', $param2 = '')\n\t{\n\t\tif ($this->session->userdata('reception_login') != 1)\n\t\t\tredirect(base_url() . 'index.php?login', 'refresh');\n\t\t\n\t\t$data['payment_type'] = $this->input->post('payment_type');\n\t\t$data['transaction_id'] = rand(100000, 1000000);\n\t\t$data['invoice_id'] = $this->input->post('invoice_id');\n\t\t$data['patient_id'] = $this->input->post('patient_id');\n\t\t$data['method'] = $this->input->post('method');\n\t\t$data['description'] = $this->input->post('description');\n\t\t$data['amount'] = $this->input->post('amount');\n\t\t$data['timestamp'] = strtotime(date('Y-m-d') . ' ' . date('H:i:s'));\n\t\t\n\t\t$this->db->insert('payment', $data);\n\t\t\n\t\t$this->db->where('invoice_id', $this->input->post('invoice_id'));\n\t\t$this->db->update('invoice', array(\n\t\t\t'status' => 'paid'\n\t\t));\n\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_created'));\n\t\tredirect(base_url() . 'index.php?reception/manage_invoice', 'refresh');\n\t\t\n\t}", "function take_cash_payment($invoice_id = '', $param2 = '')\n\t{\n\t\tif ($this->session->userdata('reception_login') != 1)\n\t\t\tredirect(base_url() . 'index.php?login', 'refresh');\n\t\t\n\t\t$data['payment_type'] = $this->input->post('payment_type');\n\t\t$data['transaction_id'] = rand(100000, 1000000);\n\t\t$data['invoice_id'] = $this->input->post('invoice_id');\n\t\t$data['patient_id'] = $this->input->post('patient_id');\n\t\t$data['method'] = $this->input->post('method');\n\t\t$data['description'] = $this->input->post('description');\n\t\t$data['amount'] = $this->input->post('amount');\n\t\t$data['timestamp'] = strtotime(date('Y-m-d') . ' ' . date('H:i:s'));\n\t\t\n\t\t$this->db->insert('payment', $data);\n\t\t\n\t\t$this->db->where('invoice_id', $this->input->post('invoice_id'));\n\t\t$this->db->update('invoice', array(\n\t\t\t'status' => 'paid'\n\t\t));\n\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_created'));\n\t\tredirect(base_url() . 'index.php?reception/manage_invoice', 'refresh');\n\t\t\n\t}", "public function actionPaynow()\n\t{ \n\t // Duration is for subscription\n\t\t$duration = Yii::app()->request->getParam(\"duration\", \"0\");\n\t\t// subscription or pre-authorization\n\t\t$type = Yii::app()->request->getParam(\"type\", \"0\");\n\t\t \n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t \n\t\t$invoiceModel = new Invoices;\n\t $payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n\t\t// Sandbox\n\t\tGoCardless::$environment = 'sandbox';\n\t\t\n\t\t// Config vars\n\t\t$account_details = array(\n\t\t 'app_id' => 'HXC009A5B8B2AX6A0C6HY4950B0JXM1Y8HEGZB9Q6CD51TDG1RR34BTG6N6H1PVK',\n\t\t 'app_secret' => 'V7MTFFF67K4SEH0AWWTHEEXWRKK7JQ4MJ0QWTZ3EP0YMG65XG9S1TCA77R2PMDYC',\n\t\t 'merchant_id' => '07N2GAPV0D',\n\t\t 'access_token' => '0T6JYNA5B1S6H2DWWA6SJ43CBTG7QVMSZR79Z1ENTWZWK59Z8616H5GWBHDDTX02'\n\t\t);\n\t\t\n\t\t// Fail nicely if no account details set\n\t\tif ( ! $account_details['app_id'] && ! $account_details['app_secret']) {\n\t\t echo '<p>First sign up to <a href=\"http://gocardless.com\">GoCardless</a> and\n\t\tcopy your sandbox API credentials from the \\'Developer\\' tab into the top of\n\t\tthis script.</p>';\n\t\t exit();\n\t\t}\n\t\t\n\t\t// Initialize GoCardless\n\t\tGoCardless::set_account_details($account_details);\n\t\t\n\t\tif (isset($_GET['resource_id']) && isset($_GET['resource_type'])) {\n\t\t // Get vars found so let's try confirming payment\n\t\t\n\t\t $confirm_params = array(\n\t\t\t'resource_id' => $_GET['resource_id'],\n\t\t\t'resource_type' => $_GET['resource_type'],\n\t\t\t'resource_uri' => $_GET['resource_uri'],\n\t\t\t'signature' => $_GET['signature']\n\t\t );\n\t\t \n\t\t // State is optional\n\t\t if (isset($_GET['state'])) {\n\t\t\t$confirm_params['state'] = $_GET['state'];\n\t\t }\n\t\t\n\t\t $confirmed_resource = GoCardless::confirm_resource($confirm_params);\n\t \n\t\t if( isset($confirmed_resource->id)) { // Successfull\n\t\t \n\t\t\t$invoiceId = $_SESSION['invoice_id']; \n\t\t \n\t\t\t// Set to paid\n\t\t $invoiceModel->updateGocardlessPayment( $confirmed_resource, $_SESSION['invoice_id']); \n\t\t\t$this->sendInvoice( $invoiceId );\n \t\t\t$this->render(\"paynow\");\n\t\t\t unset($_SESSION['invoice_id']);\n\t\t }\n\t\t else {\n\t\t \t$this->redirect(array(\"invoice/index/\".$_SESSION['invoice_id']));\n\t\t \t\n\t\t }exit;\n\t\t}\n\t\t\n /*************** *****************\n\t\t Payments Arrays \n\t\t *********************************/\t\n\t\t\t// Onetime Payment\n\t\t\tif($duration == 0) \n\t\t\t{\n\t\t\t\t$payment_details = array(\n\t\t\t\t 'amount' => $payment[0]['payment_amount'],\n\t\t\t\t 'name' => 'Invoice Payment'\n\t\t\t\t \n\t\t\t\t);\n\t\t\t\t\n\t\t\t $payment_url = GoCardless::new_bill_url($payment_details);\n\t\t\t}\n\t\t\t//Need a subscription\n\t\t\telseif($duration > 0 && $type == 'subscription') \n\t\t\t{\n\t\t\t\t$payment_details = array(\n\t\t\t\t 'amount' => $payment[0]['payment_amount'],\n\t\t\t\t 'interval_length' => $duration, \n\t\t\t\t 'interval_unit' => 'month',\n\t\t\t\t 'name' => 'Monthly Subscription',\n\t\t\t\t);\n\t\t\t\t$payment_url = GoCardless::new_subscription_url($payment_details);\n\t\t\t}\n\t\t\t//Need a Pre Authorization\n\t\t\telseif($duration > 0 && $type == 'authorization') \n\t\t\t{\n\t\t\t\t# - Amount Taken from Customer\n\t\t\t\t$authorization_amount = Yii::app()->request->getParam('amount','0');\n\t\t\t\tif($authorization_amount >= $payment[0]['payment_amount'])\n\t\t\t\t\t$amount = $authorization_amount;\n\t\t\t\telse\n\t\t\t\t\t$amount = $payment[0]['payment_amount'];\n\t\t\t\t\t\n\t\t\t\t$payment_details = array(\n\t\t\t\t 'max_amount' => $amount,\n\t\t\t\t 'interval_length' => $duration, \n\t\t\t\t 'interval_unit' => 'month',\n\t\t\t\t 'name' => 'Pre-Authorization',\n\t\t\t\t);\n\t\t\t\t$payment_url = GoCardless::new_pre_authorization_url($payment_details);\n\t\t\t}\t\n\t\t\t\t# - Redirecting it to Payment Gateway - GoCardless\n\t\t\t\t$this->redirect( $payment_url );\n\t\t}\n\t\t\n\t}", "public function print_invoice( $invoice_id ) {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Get invoice details\n $invoice = $this->invoice->get_invoice( $invoice_id ); \n \n // Verify if invoice exists\n if ( $invoice ) {\n \n if ( $invoice[0]->user_id === $this->user_id ) {\n \n // Get the invoice logo\n $invoice_logo = get_option( 'main-logo' );\n\n if ( get_option( 'invoice-logo' ) ) {\n\n $invoice_logo = get_option( 'invoice-logo' );\n\n }\n\n // Get the invoice billing period text\n $billing_period = 'Billing Period';\n\n if ( get_option( 'invoice-billing-period' ) ) {\n\n $billing_period = get_option( 'invoice-billing-period' );\n\n } \n\n // Get the invoice transaction id\n $transaction_id = 'Transaction ID';\n\n if ( get_option( 'invoice-transaction-id' ) ) {\n\n $transaction_id = get_option( 'invoice-transaction-id' );\n\n } \n\n // Get the invoice date format\n $date_format = 'dd-mm-yyyy';\n\n if ( get_option( 'invoice-date-format' ) ) {\n\n $date_format = get_option( 'invoice-date-format' );\n\n }\n\n // Get the invoice hello text\n $hello_text = 'Hello [username]';\n\n if ( get_option( 'invoice-hello-text' ) ) {\n\n $hello_text = get_option( 'invoice-hello-text' );\n\n }\n\n // Get the invoice message\n $message = 'Thanks for using using our services.';\n\n if ( get_option( 'invoice-message' ) ) {\n\n $message = get_option( 'invoice-message' );\n\n }\n\n // Get the invoice date word\n $date = 'Date';\n\n if ( get_option( 'invoice-date' ) ) {\n\n $date = get_option( 'invoice-date' );\n\n }\n\n // Get the invoice description word\n $description = 'Description';\n\n if ( get_option( 'invoice-description' ) ) {\n\n $description = get_option( 'invoice-description' );\n\n } \n\n // Get the invoice description text\n $description_text = 'Upgrade Payment';\n\n if ( get_option( 'invoice-description-text' ) ) {\n\n $description_text = get_option( 'invoice-description-text' );\n\n } \n\n // Get the invoice amount word\n $amount = 'Amount';\n\n if ( get_option( 'invoice-amount' ) ) {\n\n $amount = get_option( 'invoice-amount' );\n\n } \n\n // Get the invoice amount word\n $taxes = 'Taxes';\n\n if ( get_option( 'invoice-taxes' ) ) {\n\n $taxes = get_option( 'invoice-taxes' );\n\n } \n\n // Get the invoice taxes value\n $taxes_value = '';\n\n if ( get_option( 'invoice-taxes-value' ) ) {\n\n $taxes_value = get_option( 'invoice-taxes-value' );\n\n } \n\n // Get the invoice total word\n $total = 'Total';\n\n if ( get_option( 'invoice-total' ) ) {\n\n $total = get_option( 'invoice-total' );\n\n }\n\n // Get the no reply message\n $no_reply = 'Please do not reply to this email. This mailbox is not monitored and you will not receive a response. For assistance, please contact us to [email protected].';\n\n if ( get_option( 'invoice-no-reply' ) ) {\n\n $no_reply = get_option( 'invoice-no-reply' );\n\n } \n \n echo '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"1000px\">\n <tbody><tr><td align=\"center\" width=\"600\" valign=\"top\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tbody>\n <tr>\n <td align=\"center\" valign=\"top\" bgcolor=\"#ffffff\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin-bottom:10px;\" width=\"100%\">\n <tbody><tr valign=\"bottom\"> \n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n <td align=\"left\" height=\"64\">\n <img alt=\"logo\" class=\"invoice-logo\" src=\"' . $invoice_logo . '\">\n </td> \n <td width=\"40\" align=\"center\" valign=\"top\">&nbsp;</td>\n <td align=\"right\">\n <span style=\"padding-top:15px;padding-bottom:10px;font:italic 12px;color:#757575;line-height:15px;\">\n <span style=\"display:inline;\">\n <span class=\"invoice-billing-period\">' . $billing_period . '</span> <strong><span class=\"invoice-date-format billing-period-from\">' . $this->get_invoice_time($invoice[0]->from_period) . '</span> to <span class=\"invoice-date-format billing-period-to\">' . $this->get_invoice_time($invoice[0]->to_period) . '</span></strong>\n </span>\n <span style=\"display:inline;\">\n <br>\n <span class=\"invoice-transaction-id\">' . $transaction_id . '</span>: <strong class=\"transaction-id\">' . $invoice[0]->transaction_id . '</strong>\n </span>\n </span>\n </td>\n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n </tr>\n </tbody>\n </table>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"padding-bottom:10px;padding-top:10px;margin-bottom:20px;\" width=\"100%\">\n <tbody><tr valign=\"bottom\"> \n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n <td valign=\"top\" style=\"font-family:Calibri, Trebuchet, Arial, sans serif;font-size:15px;line-height:22px;color:#333333;\" class=\"yiv1811948700ppsans\">\n <p>\n </p><div style=\"margin-top:30px;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;\"><span style=\"color:#333333;font-weight:bold;font-family:arial, helvetica, sans-serif; margin-left: 2px;\" class=\"invoice-hello-text\">' . $this->get_invoice_placeholders($hello_text, array('username' => $invoice[0]->username) ) . ' </span><table><tbody><tr><td valign=\"top\" class=\"invoice-message\">' . $this->get_invoice_placeholders($message, array('username' => $invoice[0]->username) ) . '</td><td></td></tr></tbody></table><br><div style=\"margin-top:5px;\">\n <br><div class=\"yiv1811948700mpi_image\" style=\"margin:auto;clear:both;\">\n </div>\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"clear:both;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;margin-top:20px;\" width=\"100%\">\n <tbody>\n <tr>\n <td style=\"text-align:left;border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color:#333333;\" class=\"invoice-date\" width=\"10%\">' . $date . '</td>\n <td style=\"border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color:#333333;\" width=\"80%\" class=\"invoice-description\">' . $description . '</td>\n <td style=\"text-align:right;border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color:#333333;\" width=\"10%\" class=\"amount\">' . $amount . '</td>\n </tr>\n <tr>\n <td style=\"padding:10px;\" width=\"80%\">\n <span class=\"invoice-description-text\">' . $description_text . '</span>\n <br>\n\n <span style=\"display:inline;font-style: italic;color: #888888;\" class=\"invoice-plan-name\">' . $invoice[0]->plan_name . '</span>\n </td>\n <td style=\"text-align:right;padding:10px;\" width=\"10%\"></td>\n <td style=\"text-align:right;padding:10px;\" width=\"10%\" class=\"invoice-amount\">' . $invoice[0]->amount . ' ' . $invoice[0]->currency . '</td>\n </tr>\n </tbody>\n </table>\n <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-top:1px solid #ccc;border-bottom:1px solid #ccc;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;margin-bottom:10px;\" width=\"100%\">\n <tbody>\n <tr>\n <td>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;color:#333;font-family:arial, helvetica, sans-serif;font-size:12px;margin-top:10px;\">\n <tbody>\n <tr class=\"taxes-area\" style=\"display: none;\">\n <td style=\"width:80%;text-align:right;padding:0 10px 10px 0;\" class=\"invoice-taxes\">' . $taxes . '</td>\n <td style=\"width:20%;text-align:right;padding:0 10px 10px 0;\">\n <span style=\"display:inline;\" class=\"invoice-taxes-value\">' . $taxes_value . ' %</span>\n\n </td>\n </tr>\n <tr>\n <td style=\"width:80%;text-align:right;padding:0 10px 10px 0;\">\n <span style=\"color:#333333;font-weight:bold;\" class=\"invoice-total\">' . $total . '</span>\n </td>\n <td style=\"width:20%;text-align:right;padding:0 10px 10px 0;\" class=\"invoice-total-value\">' . $invoice[0]->total . ' ' . $invoice[0]->currency . '</td>\n </tr>\n </tbody></table>\n </td>\n </tr>\n\n </tbody></table>\n <span style=\"font-size:11px;color:#333;\" class=\"invoice-no-reply\">' . $no_reply . '</span></div>\n <span style=\"font-weight:bold;color:#444;\">\n </span>\n <span>\n </span>\n </div></td>\n <td width=\"20\" align=\"center\" valign=\"top\">&nbsp;</td>\n </tr>\n </tbody>\n </table>\n <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>\n </td>\n </tr>\n </tbody>\n </table> \n </td>\n </tr>\n </tbody>\n </table>';\n \n exit();\n \n }\n \n }\n \n show_404();\n \n }", "public function processPayment() {\n\n\t\t//create the GTPayConnector instance\n\t\t$gtpayConnector = new GTPayConnector();\n\n\t\t//create the VpcConfig instance\n\t\t$vpcConfig = new VpcConfig();\n\n\t\t//get the vpc xml object\n\t\t$vpcXMLConf = \"\";\n\t\t$vpcXMLConf = $vpcConfig->loadVpcConfig();\n\n\t\t// confirm that the configurations of vpc were loaded;\n\t\tif($vpcXMLConf == null) {\n\n\t\t\t//go to the error interface\n\t\t\t$data['error_msg'] = \"Could not Load the Virtual Payment client Details\";\n\t\t\t$data['page_titile'] = \"xxOnline shoe | error\";\n\t\t\t$data['responseData'] = \"\";\n\n\t\t\t$this->load->view(\"error-page\", $data);\n\t\t\t$this->load->view(\"partials/footer\");\n\t\t\treturn;\n\t\t}\n\n\t\t//get the vpc details\n\t\t$vpcUrl = $vpcConfig->getVpcURL($vpcXMLConf);\n\t\t$vpcSalt = $vpcConfig->getVpvSalt($vpcXMLConf);\n\t\t$vpcSaltType = $vpcConfig->getVpcSaltType($vpcXMLConf);\n\t\t$marchantcode = $vpcConfig->getCustomerCode($vpcXMLConf);\n\n\t\t//the transaction log\n\t\t$transactionLog = array();\n\n\t\t// set the salt\n\t\t$gtpayConnector->setSalt($vpcSalt);\n\n\t\t//remove the data that you dont need to send to the payment client\n\t\tunset($_POST['shoeimage']);\n\t\tunset($_POST['submit']);\n\t\t// add the customer code to the post data\n\t\t$_POST['gtp_CustomerCode'] = $marchantcode;\n\n\t\t//sort the post data before encrypting\n\t\tksort($_POST);\n\n\t\t//add the Virtual Payment Client post data to the transaction data\n\t\tforeach ($_POST as $key => $value) {\n\t\t\t\n\t\t\tif(strlen($value) > 0) {\n\t\t\t\t$gtpayConnector->addTransactionFields($key, $value);\n\n\t\t\t\t// add the post data to the transactionLog\n\t\t\t\t$transactionLog[$key] = $value;\n\t\t\t}\n\t\t}\n\t\t//get the date and time when the payment request is made\n\t\t$date = new DateTime();\n\t\t$date->setTimeZone(new DateTimeZone('UTC'));\n\t\t$transactionDate = $date->format('Y-m-d\\TH-i-s\\Z');\n\n\t\t//add the date of the transaction\n\t\t$transactionLog[\"transactDate\"] = $transactionDate;\n\n\t\t//log the trasaction on your database\n\t\t$this->transactions->logTransaction($transactionLog);\n\n\t\t// set the salt type\n\t\t$gtpayConnector->setSaltType($vpcSaltType);\n\n\t\t// make oneway hash of the Transaction and add it to the digital order\n\t\t$transactionHash = $gtpayConnector->hashAllTransactionData();\n\n\t\t$gtpayConnector->addTransactionFields(\"gtp_TransDate\", $transactionDate);\n\t\t$gtpayConnector->addTransactionFields(\"gtp_SecureHash\", $transactionHash);\n\t\t$gtpayConnector->addTransactionFields(\"gtp_SecureHashType\", $vpcSaltType);\n\n\t\t//obtain the redirection url\n\t\t$vpcUrl = $gtpayConnector->getDigitalOrderURL($vpcUrl);\n\n\t\t// send the payment request\n\t\theader(\"Location: \".$vpcUrl);\n\t}", "function ExecutePayment ($ccardno,$exp_m,$exp_y,$cvv2,$total) {\n\n if (strlen($exp_y)!=2) $exp_y=substr($exp_y,-2);\n if (strlen($exp_m)!=2) $exp_m=str_repeat(\"0\",(2-strlen($exp_m))).$exp_m;\n\n $data=\"DATA=<?xml version=\\\"1.0\\\" encoding=\\\"ISO-8859-9\\\"?>\n<CC5Request>\n<Name>\".VP_FORTIS_NAME.\"</Name>\n<Password>\".VP_FORTIS_PASSWORD.\"</Password>\n<ClientId>\".VP_FORTIS_CLIENTID.\"</ClientId>\n<IPAddress>\".$_SERVER['REMOTE_ADDR'].\"</IPAddress>\n<Email></Email>\n<Mode>\".VP_FORTIS_MODE.\"</Mode>\n<OrderId></OrderId>\n<GroupId></GroupId>\n<TransId></TransId>\n<UserId></UserId>\n<Type>\".VP_FORTIS_TYPE.\"</Type>\n<Number>$ccardno</Number>\n<Expires>$exp_m/$exp_y</Expires>\n<Cvv2Val>$cvv2</Cvv2Val>\n<Total>$total</Total>\n<Currency>\".VP_FORTIS_CURRENCY.\"</Currency>\n<Taksit></Taksit>\n<BillTo>\n<Name></Name>\n<Street1></Street1>\n<Street2></Street2>\n<Street3></Street3>\n<City></City>\n<StateProv></StateProv>\n<PostalCode></PostalCode>\n<Country></Country>\n<Company></Company>\n<TelVoice></TelVoice>\n</BillTo>\n<ShipTo>\n<Name></Name>\n<Street1></Street1>\n<Street2></Street2>\n<Street3></Street3>\n<City></City>\n<StateProv></StateProv>\n<PostalCode></PostalCode>\n<Country></Country>\n</ShipTo>\n<Extra></Extra>\n</CC5Request>\";\n\n\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_URL, VP_FORTIS_URL);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 90);\n $result = curl_exec($ch);\n curl_close($ch);\n\n\n $response_tag=\"Response\";\n $posf = strpos ( $result, (\"<\" . $response_tag . \">\") );\n $posl = strpos ( $result, (\"</\" . $response_tag . \">\") ) ;\n $posf = $posf+ strlen($response_tag) +2 ;\n $Response = substr ( $result, $posf, $posl - $posf) ;\n\n $response_tag=\"OrderId\";\n $posf = strpos ( $result, (\"<\" . $response_tag . \">\") );\n $posl = strpos ( $result, (\"</\" . $response_tag . \">\") ) ;\n $posf = $posf+ strlen($response_tag) +2 ;\n $OrderId = substr ( $result, $posf , $posl - $posf ) ;\n\n $response_tag=\"AuthCode\";\n $posf = strpos ( $result, \"<\" . $response_tag . \">\" );\n $posl = strpos ( $result, \"</\" . $response_tag . \">\" ) ;\n $posf = $posf+ strlen($response_tag) +2 ;\n $AuthCode = substr ( $result, $posf , $posl - $posf ) ;\n\n $response_tag=\"TransId\";\n $posf = strpos ( $result, \"<\" . $response_tag . \">\" );\n $posl = strpos ( $result, \"</\" . $response_tag . \">\" ) ;\n $posf = $posf+ strlen($response_tag) +2 ;\n $TransId = substr ( $result, $posf , $posl - $posf ) ;\n\n if ($Response==\"Approved\") {\n return array(\"response\"=>true,\"order_id\"=>$OrderId,\"auth_id\"=>$AuthCode,\"trans_id\"=>$TransId);\n }\n else {\n return array(\"response\"=>false);\n }\n}", "function view_invoice($param1 = '', $param2 = '', $param3 = '')\n\t{\n\t\t//if($this->session->userdata('patient_login')!=1)redirect(base_url().'index.php?login' , 'refresh');\n\t\tif ($param1 == 'make_payment') {\n\t\t\t$invoice_id = $this->input->post('invoice_id');\n\t\t\t$system_settings = $this->db->get_where('settings', array(\n\t\t\t\t'type' => 'paypal_email'\n\t\t\t))->row();\n\t\t\t$invoice_details = $this->db->get_where('invoice', array(\n\t\t\t\t'invoice_id' => $invoice_id\n\t\t\t))->row();\n\t\t\t\n\t\t\t/****TRANSFERRING USER TO PAYPAL TERMINAL****/\n\t\t\t$this->paypal->add_field('rm', 2);\n\t\t\t$this->paypal->add_field('no_note', 0);\n\t\t\t$this->paypal->add_field('item_name', $invoice_details->title);\n\t\t\t$this->paypal->add_field('amount', $invoice_details->amount);\n\t\t\t$this->paypal->add_field('custom', $invoice_details->invoice_id);\n\t\t\t$this->paypal->add_field('business', $system_settings->description);\n\t\t\t$this->paypal->add_field('notify_url', base_url() . 'index.php?patient/view_invoice/paypal_ipn');\n\t\t\t$this->paypal->add_field('cancel_return', base_url() . 'index.php?patient/view_invoice/paypal_cancel');\n\t\t\t$this->paypal->add_field('return', base_url() . 'index.php?patient/view_invoice/paypal_success');\n\t\t\t\n\t\t\t$this->paypal->submit_paypal_post();\n\t\t\t// submit the fields to paypal\n\t\t}\n\t\tif ($param1 == 'paypal_ipn') {\n\t\t\tif ($this->paypal->validate_ipn() == true) {\n\t\t\t\t$ipn_response = '';\n\t\t\t\tforeach ($_POST as $key => $value) {\n\t\t\t\t\t$value = urlencode(stripslashes($value));\n\t\t\t\t\t$ipn_response .= \"\\n$key=$value\";\n\t\t\t\t}\n\t\t\t\t$invoice_id = $_POST['custom'];\n\t\t\t\t$data['status'] = 'paid';\n\t\t\t\t$this->db->where('invoice_id', $invoice_id);\n\t\t\t\t$this->db->update('invoice', $data);\n\t\t\t\t\n\t\t\t\t$data2['transaction_id'] = rand(10000, 100000);\n\t\t\t\t$data2['invoice_id'] = $invoice_id;\n\t\t\t\t$data2['patient_id'] = $this->crud_model->get_type_name_by_id('invoice', $invoice_id, 'patient_id');\n\t\t\t\t$data2['payment_method'] = 'paypal';\n\t\t\t\t$data2['description'] = $ipn_response;\n\t\t\t\t$data2['amount'] = $this->crud_model->get_type_name_by_id('invoice', $invoice_id, 'amount');\n\t\t\t\t$data2['timestamp'] = strtotime(date(\"m/d/Y\"));\n\t\t\t\t\n\t\t\t\t$this->db->insert('payment', $data2);\n\t\t\t}\n\t\t}\n\t\tif ($param1 == 'paypal_cancel') {\n\t\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_cancelled'));\n\t\t\tredirect(base_url() . 'index.php?patient/view_invoice/', 'refresh');\n\t\t}\n\t\tif ($param1 == 'paypal_success') {\n\t\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_successfull'));\n\t\t\tredirect(base_url() . 'index.php?patient/view_invoice/', 'refresh');\n\t\t}\n\t\t\n\t\t$page_data['page_name'] = 'view_invoice';\n\t\t$page_data['page_title'] = get_phrase('view_invoice');\n\t\t$page_data['invoices'] = $this->db->get_where('invoice', array(\n\t\t\t'patient_id' => $this->session->userdata('patient_id')\n\t\t))->result_array();\n\t\t$this->load->view('index', $page_data);\n\t}", "public function setCVV($cvv = '') {\n $security = array(\n 'x_card_code'=>$cvv,\n );\n $this->NVP = array_merge($this->NVP, $security); \n }", "public function doCapturePayment(Eway_Rapid31_Model_Response $response)\n {\n $this->setTransactionId($response->getTransactionID());\n $this->setMethod(Eway_Rapid31_Model_Config::METHOD_PROCESS_PAYMENT);\n\n $response = $this->_doRapidAPI('CapturePayment');\n return $response;\n }", "public function paymentWithStripe(Request $request, $invoiceId)\n {\n $invoice = Invoice::findOrFail($invoiceId);\n\n $tokenObject = $request->get('token');\n $token = $tokenObject['id'];\n $email = $tokenObject['email'];\n\n if($invoice->recurring == 'no')\n {\n try {\n $customer = Customer::create(array(\n 'email' => $email,\n 'source' => $token\n ));\n\n $charge = Charge::create(array(\n 'customer' => $customer->id,\n 'amount' => $invoice->total*100,\n 'currency' => $invoice->currency->currency_code\n ));\n\n } catch (\\Exception $ex) {\n \\Session::put('error','Some error occur, sorry for inconvenient');\n return Reply::redirect(route('client.invoices.show', $invoice->id), 'Payment fail');\n }\n\n $payment = new Payment();\n $payment->project_id = $invoice->project_id;\n $payment->currency_id = $invoice->currency_id;\n $payment->amount = $invoice->total;\n $payment->gateway = 'Stripe';\n $payment->transaction_id = $charge->id;\n $payment->paid_on = Carbon::now();\n $payment->status = 'complete';\n $payment->save();\n\n } else {\n\n\n $plan = Plan::create(array(\n \"name\" => 'Payment for invoice #'. $invoice->invoice_number,\n \"id\" => 'plan-'.$invoice->id.'-'.str_random('10'),\n \"interval\" => $invoice->billing_frequency,\n \"interval_count\" => $invoice->billing_interval,\n \"currency\" => $invoice->currency->currency_code,\n \"amount\" => $invoice->total*100,\n \"metadata\" => [\n \"invoice_id\" => $invoice->id\n ],\n ));\n\n try {\n\n $customer = Customer::create(array(\n 'email' => $email,\n 'source' => $token\n ));\n\n $subscription = Subscription::create(array(\n \"customer\" => $customer->id,\n \"items\" => array(\n array(\n \"plan\" => $plan->id,\n ),\n ),\n \"metadata\" => [\n \"invoice_id\" => $invoice->id\n ],\n ));\n\n } catch (\\Exception $ex) {\n \\Session::put('error','Some error occur, sorry for inconvenient');\n return Reply::redirect(route('client.invoices.show', $invoice->id), 'Payment fail');\n }\n\n // Save details in database\n $payment = new Payment();\n $payment->project_id = $invoice->project_id;\n $payment->currency_id = $invoice->currency_id;\n $payment->amount = $invoice->total;\n $payment->gateway = 'Stripe';\n $payment->plan_id = $plan->id;\n $payment->transaction_id = $subscription->id;\n $payment->paid_on = Carbon::now();\n $payment->status = 'complete';\n $payment->save();\n }\n\n $invoice->status = 'paid';\n $invoice->save();\n\n \\Session::put('success','Payment success');\n return Reply::redirect(route('client.invoices.show', $invoice->id), 'Payment success');\n }", "public function createPaymentUsingSavedCard($ccppid, $cout) {\n // This sample code demonstrates how you can process a \n // Payment using a previously stored credit card token.\n // API used: /v1/payments/payment\n /** @var CreditCard $card */\n //$card = require __DIR__ . '/../vault/CreateCreditCard.php';\n\n // ### Credit card token\n // Saved credit card id from a previous call to\n // CreateCreditCard.php\n $creditCardToken = new CreditCardToken();\n //$creditCardToken->setCreditCardId($card->getId());\n $creditCardToken->setCreditCardId($ccppid);\n\n // ### FundingInstrument\n // A resource representing a Payer's funding instrument.\n // For stored credit card payments, set the CreditCardToken\n // field on this object.\n $fi = new FundingInstrument();\n $fi->setCreditCardToken($creditCardToken);\n // ### Payer\n // A resource representing a Payer that funds a payment\n // For stored credit card payments, set payment method\n // to 'credit_card'.\n $payer = new Payer();\n $payer->setPaymentMethod(\"credit_card\")\n ->setFundingInstruments(array($fi));\n // ### Amount\n // Lets you specify a payment amount.\n // You can also specify additional details\n // such as shipping, tax.\n $amount = new Amount();\n $amount->setCurrency(\"EUR\");\n $amount->setTotal($cout);\n // ### Transaction\n // A transaction defines the contract of a\n // payment - what is the payment for and who\n // is fulfilling it. \n $transaction = new Transaction();\n $transaction->setAmount($amount);\n $transaction->setDescription(\"This is the payment description.\");\n // ### Payment\n // A Payment Resource; create one using\n // the above types and intent set to 'sale'\n $payment = new Payment();\n $payment->setIntent(\"sale\")\n ->setPayer($payer)\n ->setTransactions(array($transaction));\n \n // ###Create Payment\n // Create a payment by calling the 'create' method\n // passing it a valid apiContext.\n // (See bootstrap.php for more on `ApiContext`)\n // The return object contains the state.\n try {\n $resultat = $payment->create($this->apiContext);\n } catch (\\Paypal\\Exception\\PPConnectionException $pce) {\n print_r( json_decode($pce->getData()) );\n }\n $statut = $resultat->getState();\n\n return $statut;\n }", "function bpGetInvoice($invoiceId, $apiKey=false) {\r\n\t\r\n}", "public function processPayment(InvoiceInterface $invoice);", "public function capture($url, $orderUUID, $amount, $isPartialCapture);", "public function sendInvoice(Mage_Sales_Model_Order $order)\n {\n if($this->_logging){\n Mage::log('in sendInvoice', null, $this->_logfile);\n }\n $payment = $order->getPayment();\n $paymentInstance = $payment->getMethodInstance();\n $order->setActionFlag(Mage_Sales_Model_Order::ACTION_FLAG_INVOICE, true);\n // check if it is possible to invoice!\n if ($order->canInvoice()){\n if($this->_logging){\n Mage::log('sendInvoice sending invoice for '.$paymentInstance->getCode(), null, $this->_logfile);\n }\n try {\n // Initialize new magento invoice\n $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();\n // Set magento transaction id which returned from capayable\n $invoice->setTransactionId($payment->getLastTransId());\n // Allow payment capture and register new magento transaction\n $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);\n\n // TODO: get following to work\n //$invoice->addComment('U betaald via Achteraf betalen.', true, true);\n //$invoice->getOrder()->setCustomerNoteNotify(true);\n\n // Register invoice and apply it to order, order items etc.\n $invoice->register();\n\n $transaction = Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder());\n\n // Commit changes or rollback if error has occurred\n $transaction->save();\n\n /**\n * Register invoice with Capayable\n */\n $isApiInvoiceAccepted = $paymentInstance->processApiInvoice($invoice);\n if($this->_logging) {\n Mage::log('sendInvoice isApiInvoiceAccepted:', null, $this->_logfile);\n Mage::log($isApiInvoiceAccepted, null, $this->_logfile);\n }\n //if ($isApiInvoiceAccepted) {\n $invoice->getOrder()->setIsInProcess(true);\n $invoice->getOrder()->addStatusHistoryComment(\n 'Invoice created and email send', true\n );\n $invoice->sendEmail(true, '');\n $order->save();\n// } else {\n// $this->_getSession()->addError(Mage::helper('capayable')->__('Failed to send the invoice.'));\n// }\n } catch (Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n Mage::logException($e);\n }\n } else {\n Mage::log('sendInvoice: could not send invoice, invoice already sent.', null, $this->_logfile);\n }\n }", "public function chargeCreditCard(Request $request)\n {\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(config('services.authorize.login'));\n $merchantAuthentication->setTransactionKey(config('services.authorize.key'));\n $refId = 'ref'.time();\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($request->cnumber);\n // $creditCard->setExpirationDate( \"2038-12\");\n $expiry = $request->card_expiry_year . '-' . $request->card_expiry_month;\n $creditCard->setExpirationDate($expiry);\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n // Create a transaction\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType(\"authCaptureTransaction\");\n $transactionRequestType->setAmount($request->camount);\n $transactionRequestType->setPayment($paymentOne);\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId( $refId);\n $request->setTransactionRequest($transactionRequestType);\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") )\n {\n $tresponse = $response->getTransactionResponse();\n\n echo \"SUCCESS: transaction ID : \" . $tresponse->getTransId() . \"\\n\";\n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n }\n // else\n // {\n // echo \"Charge Credit Card Null response returned\";\n // }\n // dd($tresponse);\n// return redirect('/');\n }", "public function capture(Varien_Object $payment, $amount) {\n\t\t\tif($this->getDebug())\n\t\t\t{\n\t\t\t\t$writer = new Zend_Log_Writer_Stream($this->getLogPath());\n\t\t\t\t$logger = new Zend_Log($writer);\n\t\t\t\t$logger->info(\"entering capture()\");\n\t\t\t}\n\t\t\t$this->setAmount($amount)->setPayment($payment);\n\t\t\t\n\t\t$orderTable = Mage::getSingleton('core/resource')->getTableName('sales_flat_order'); \n\t\t$orderInvoiceTable = Mage::getSingleton('core/resource')->getTableName('sales_flat_invoice'); \n\t\t$orderno = $payment->getOrder()->getIncrementId();\n\t\t\n\t\t$sql = \"SELECT * FROM $orderInvoiceTable p, $orderTable q WHERE q.increment_id ='\".$orderno.\"' AND q.entity_id=p.order_id AND p.increment_id>'' ORDER BY p.entity_id desc LIMIT 1;\";\n\t\t$sqlResult = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchRow($sql);\n\t\t\n\t\t\t$invoiceId = $sqlResult['increment_id'];\n\t\t\tif($this->getDebug()) { $logger->info(\"lastinvoice: $invoiceId\"); }\n\t\t\t\n\t\t\tif(!$invoiceId) { $gatewayResponse = $this->_call($payment,'capture', $amount);\n\t\t\t} else { $gatewayResponse = $this->_call($payment,'captureonly', $amount); }\n\t\t\t\n\t\t\tif($this->getDebug()) { $logger->info(var_export($gatewayResponse, TRUE)); }\n\t\t\t\n\t\t\tif($gatewayResponse['Status']['transno']=='0') {\n\t\t\t\t$gatewayResponse = $this->_call($payment,'captureonly', $amount);\n\t\t\t\tif($this->getDebug()) { $logger->info(var_export($gatewayResponse, TRUE)); }\n\t\t\t}\n\t\t\tif($gatewayResponse === false)\n\t\t\t{\n\t\t\t\t$errorResult = $this->getError();\n\t\t\t\tif (isset($errorResult['message'])) {\n\t\t\t\t\t$message = Mage::helper('acimpro')->__('There has been an error processing your payment.') . $errorResult['message'];\n\t\t\t\t} else {\n\t\t\t\t\t$message = Mage::helper('acimpro')->__('There has been an error processing your payment. Please try later.');\n\t\t\t\t}\n\t\t\t\tMage::throwException($message);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/*if the transaction is successfulyl approved then set payment status*/\n\t\t\t\tif ($gatewayResponse['Status']['statusCode'] == \"Ok\")\n\t\t\t\t{\n\t\t\t\t\t/* If there is an error processing the credit card */\n\t\t\t\t\tif($gatewayResponse['Status']['code'] == \"I00001\")\n\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\t$payment->setIsTransactionClosed(0);\n\t\t\t\t\t\t$payment->setTransactionId($gatewayResponse['Status']['transno']);\n\t\t\t\t\t\t$payment->setLastTransId($gatewayResponse['Status']['transno'])\n\t\t\t\t\t\t\t\t->setCcApproval($gatewayResponse['Status']['code'])\n\t\t\t\t\t\t\t\t->setCcTransId($gatewayResponse['Status']['transno'])\n\t\t\t\t\t\t\t\t->setCcAvsStatus($gatewayResponse['Status']['statusCode'])\n\t\t\t\t\t\t\t\t->setCcCidStatus($gatewayResponse['Status']['statusCode']);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t/* Save customer \"payment profile id\" and \"cusotmer profile Id\" in database and on next order customer can checkout by selecting that card*/\n\t\t\t\t\t\t$params = Mage::app()->getRequest()->getParams(); \n\t\t\t\t\t\t \n\n\t\t\t\t\t\tif(isset($params['placecard']) && $params['placecard'] == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$resource = Mage::getSingleton('core/resource');\n\t\t\t\t\t\t\t$read= $resource->getConnection('core_read');\n\t\t\t\t\t\t\t$moreccTable = $resource->getTableName('morecc');\n\t\t\t\t\t\t\t$customerEmail = $payment->getOrder()->getCustomerEmail();\n\t\t\t\t\t\t\t$billingAddress = $payment->getOrder()->getBillingAddress();\n\t\t\t\t\t\t\t$customerId = $payment->getOrder()->getCustomerId();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!isset($customerEmail) && $customerEmail == \"\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$customerEmail = $billingAddress['email'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!isset($customerId) && $customerId == \"\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$customerId = $payment->getOrder()->getCustomerId();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*$select = $read->select()\n\t\t\t\t\t\t\t\t\t->from($moreccTable,array('morecc_id','email','number','profile_id','pay_id'))\n\t\t\t\t\t\t\t\t\t->where('email=?',$customerEmail) ;*/\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$select = \"Select * from \".$moreccTable.\" where cus_id='\".$customerId.\"' and pay_id = '\".$gatewayResponse['Status']['PaymentProfileID'].\"'\";\n\n\t\t\t\t\t\t\t$morecc = $read->fetchRow($select); \n\n\t\t\t\t\t\t\tif(!is_array($morecc))\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$customerProfileId = $gatewayResponse['Status']['CustomerProfileID'];\n\t\t\t\t\t\t\t\t$customerPayProfileId = $gatewayResponse['Status']['PaymentProfileID'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$name = $billingAddress['firstname'] .' '. $billingAddress['lastname'] ; \n\t\t\t\t\t\t\t\t$ccNumber = $payment->getCcNumber();\n\t\t\t\t\t\t\t\t$cardType = $payment->getCcType();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$cardExprMonth = $payment->getCcExpMonth();\n\t\t\t\t\t\t\t\t$cardExprYear = $payment->getCcExpYear();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$newCard = \"XXXX-XXXX-XXXX-\" . substr($ccNumber,-4,4);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$model = Mage::getModel('morecc/morecc');\n\t\t\t\t\t\t\t\t$model->setCreatedTime(now());\n\t\t\t\t\t\t\t\t$model->setEmail($customerEmail);\n\t\t\t\t\t\t\t\t$model->setCusId($customerId);\n\t\t\t\t\t\t\t\t$model->setName($name);\n\t\t\t\t\t\t\t\t$model->setNumber($newCard);\n\t\t\t\t\t\t\t\t$model->setCardType($cardType);\n\t\t\t\t\t\t\t\t$model->setExprMonth($cardExprMonth);\n\t\t\t\t\t\t\t\t$model->setExprYear($cardExprYear);\n\t\t\t\t\t\t\t\t$model->setProfileId($customerProfileId);\n\t\t\t\t\t\t\t\t$model->setPayId($customerPayProfileId);\n\t\t\t\t\t\t\t\t$model->setShipId($gatewayResponse['Status']['shippingAddressId']);\n\t\t\t\t\t\t\t\t$model->save();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/* Save customer \"payment profile id\" and \"cusotmer profile Id\" */\n\t\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\tMage::throwException(\"Authorize.net Gateway Error : \" . $gatewayResponse['Status']['code'] . \": \" . $gatewayResponse['Status']['statusDescription']);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "function woocommerce_stripe_capture_payment( $order_id ) {\n\t\t$order = new WC_Order( $order_id );\n\n\t\tif ( $order->payment_method == 'stripe' ) {\n\t\t\t$charge = get_post_meta( $order_id, '_stripe_charge_id', true );\n\t\t\t$captured = get_post_meta( $order_id, '_stripe_charge_captured', true );\n\n\t\t\tif ( $charge && $captured == 'no' ) {\n\t\t\t\t$stripe = new WC_Gateway_Stripe();\n\n\t\t\t\t$result = $stripe->stripe_request( array(\n\t\t\t\t\t'amount' => $order->order_total * 100\n\t\t\t\t), 'charges/' . $charge . '/capture' );\n\n\t\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\t\t$order->add_order_note( __( 'Unable to capture charge!', 'wc_stripe' ) . ' ' . $result->get_error_message() );\n\t\t\t\t} else {\n\t\t\t\t\t$order->add_order_note( sprintf( __('Stripe charge complete (Charge ID: %s)', 'wc_stripe' ), $result->id ) );\n\t\t\t\t\tupdate_post_meta( $order->id, '_stripe_charge_captured', 'yes' );\n\n\t\t\t\t\t// Store other data such as fees\n\t\t\t\t\tupdate_post_meta( $order->id, 'Stripe Payment ID', $result->id );\n\t\t\t\t\tupdate_post_meta( $order->id, 'Stripe Fee', number_format( $result->fee / 100, 2, '.', '' ) );\n\t\t\t\t\tupdate_post_meta( $order->id, 'Net Revenue From Stripe', ( $order->order_total - number_format( $result->fee / 100, 2, '.', '' ) ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function captureInvoice(Varien_Object $payment)\n {\n\n\n $transaction = Mage::getModel('sales/order_payment_transaction')->getCollection()\n ->addAttributeToFilter('order_id', array('eq' => $payment->getOrder()->getEntityId()))->getLastItem();\n $addData = $transaction->getAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS);\n $transaction_id = $addData['transID'];\n\n\n if(empty($transaction_id)){\n $transaction_id = Mage::getSingleton('core/session')->getTransactionID();\n\n }\n if (empty($transaction_id)) {\n Mage::helper('paynovapayment')->log(\"Error. Missing transaction ID from order and cannot do capture.\");\n Mage::throwException(Mage::helper('paynovapayment')->__('Error. Missing transaction ID.'));\n }\n\n\n $invoice = $payment->getCurrentInvoice();\n $transInformation = $payment->getTransaction($transaction_id)->getAdditionalInformation();\n\n\n\n $order_id = $transInformation['raw_details_info']['order_id'];\n $order_number = $transInformation['raw_details_info']['order_number'];\n\n $order = Mage::getModel('sales/order');\n\n $order->loadByIncrementId($order_number);\n\n $res['orderId'] = $order_id;\n $res['transactionId'] = $transaction_id;\n $res['totalAmount'] = $invoice->getGrandTotal();\n $res['invoiceId'] = $transaction_id;\n\n $items = $invoice->getAllItems();\n\n\n $itemcount= count($items);\n $data = array();\n $i=0;\n $linenumber=1;\n\n $unitMeasure = Mage::getStoreConfig('paynovapayment/advanced_settings/product_unit');\n if (empty($unitMeasure)){\n $unitMeasure = \"pcs\";\n }\n $shippingname = Mage::getStoreConfig('paynovapayment/advanced_settings/shipping_name');\n if (empty($shippingname)){\n $shippingname = \"Shipping\";\n }\n $shippingsku = Mage::getStoreConfig('paynovapayment/advanced_settings/shipping_sku');\n if (empty($shippingsku)){\n $shippingsku = \"Shipping\";\n }\n\n foreach ($items as $itemId => $item)\n {\n\n $orderItem = $item->getOrderItem();\n\n $product = Mage::helper('catalog/product')->getProduct($item->getSku(), Mage::app()->getStore()->getId(), 'sku');\n $productUrl = Mage::getUrl($product->getUrlPath());\n $description = $product->getShortDescription();\n if (empty($description)){\n $description = $orderItem->getName();\n }\n $itemtype = $orderItem->getProductType();\n\n\n $lineqty = intval($item->getQty());\n // if product has parent - get parent qty\n\n\n if ($item->getParentItemID() AND $item->getParentItemID()>0){\n $parentQuoteItem = Mage::getModel(\"sales/quote_item\")->load($item->getParentItemID());\n $parentqty = intval($parentQuoteItem->getQty());\n $lineqty = $lineqty * $parentqty;\n }\n\n\n $lineprice = $orderItem->getPrice();\n $linetax = $orderItem->getTaxPercent();\n $unitAmountExcludingTax = $orderItem->getPrice();\n $linetaxamount = ($lineqty*$lineprice)*($linetax/100);\n $linetotalamount = $lineqty*$unitAmountExcludingTax+$linetaxamount;\n\n\n // If item has discount\n if ($orderItem->getDiscountAmount() AND $orderItem->getDiscountAmount()>0 )\n {\n $linediscountamount = $orderItem->getDiscountAmount();\n $itemdiscount = $linediscountamount/$lineqty;\n $unitAmountExcludingTax = $lineprice-$itemdiscount;\n $linetaxamount = ($lineqty*$unitAmountExcludingTax)*($linetax/100);\n $total1 = $lineqty*$unitAmountExcludingTax;\n $linetotalamount = $total1+$linetaxamount;\n $linetax1 = $lineqty*$unitAmountExcludingTax;\n $linetax2 = $linetax/100;\n $linetaxamount = $linetax1*$linetax2;\n }\n\n $res['lineItems'][$itemId]['id'] = $linenumber;\n $res['lineItems'][$itemId]['articleNumber'] = substr($orderItem->getSku(),0,50);\n $res['lineItems'][$itemId]['name'] = $item->getName();\n $res['lineItems'][$itemId]['quantity'] = $lineqty;\n $res['lineItems'][$itemId]['unitMeasure'] = $unitMeasure;\n $res['lineItems'][$itemId]['description'] = $description;\n $res['lineItems'][$itemId]['productUrl'] = $productUrl;\n\n\n if ($itemtype ==\"bundle\") {\n $res['lineItems'][$itemId]['unitAmountExcludingTax'] =0;\n $res['lineItems'][$itemId]['taxPercent'] = 0;\n $res['lineItems'][$itemId]['totalLineTaxAmount'] = 0;\n $res['lineItems'][$itemId]['totalLineAmount'] = 0;\n } else {\n $res['lineItems'][$itemId]['unitAmountExcludingTax'] = round($unitAmountExcludingTax,2);\n $res['lineItems'][$itemId]['taxPercent'] = round($linetax,2);\n $res['lineItems'][$itemId]['totalLineTaxAmount'] = round($linetaxamount,2);\n $res['lineItems'][$itemId]['totalLineAmount'] = round($linetotalamount,2);\n }\n\n $i++;\n $linenumber++;\n }\n if ($order->getShippingAmount() AND $order->getShippingAmount()>0) {\n $quoteid = $order->getQuoteId();\n $quote = Mage::getModel('sales/quote')->load($quoteid);\n $itemId++;\n $res['lineItems'][$itemId]['id'] = $linenumber;\n $res['lineItems'][$itemId]['articleNumber'] = substr($shippingsku,0,50);\n $res['lineItems'][$itemId]['name'] = $shippingname;\n $res['lineItems'][$itemId]['quantity'] = 1;\n $res['lineItems'][$itemId]['unitMeasure'] = $unitMeasure;\n $res['lineItems'][$itemId]['unitAmountExcludingTax'] = round($order->getShippingAmount(),2);\n $res['lineItems'][$itemId]['taxPercent'] = Mage::helper('paynovapayment')->getShippingTaxPercentFromQuote($quote);\n $res['lineItems'][$itemId]['totalLineTaxAmount'] = round($order->getShippingTaxAmount(),2);\n $res['lineItems'][$itemId]['totalLineAmount'] = round($order->getShippingInclTax(),2);\n $res['lineItems'][$itemId]['description'] = $description;\n $res['lineItems'][$itemId]['productUrl'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);;\n }\n\n\n\n $output=$this->setCurlCall($res, '/orders/'.$order_id.'/transactions/'.$transaction_id.'/finalize/'.$res['totalAmount']);\n\n\n $order->save();\n\n $status = $output->status;\n if($status->statusKey == 'PAYMENT_COMPLETED'){\n\n $status->isSuccess = true;\n $output->transactionId = 'Order has been finalized';\n\n }\n\n if($status->isSuccess){\n\n $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING);\n\n $order->save();\n\n $payment->setStatus(self::STATUS_APPROVED)\n ->setTransactionId($output->transactionId)\n ->setIsTransactionClosed(0);\n return $status->isSuccess;\n\n }else{\n\n $error=$status->statusMessage;\n\n\n $order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,\n Mage::helper('paynovapayment')->__($error)\n );\n $order->save();\n\n Mage::throwException(\"$error\");\n\n $this->_redirect('checkout/onepage');\n\n }\n\n }", "public function capture(Varien_Object $payment, $amount)\n {\n // disallow Ingenico Payment Services online capture if amount is zero\n if ($amount < 0.01) {\n return parent::capture($payment, $amount);\n }\n\n if (true === Mage::registry('ops_auto_capture')) {\n Mage::unregister('ops_auto_capture');\n return parent::capture($payment, $amount);\n }\n\n $orderId = $payment->getOrder()->getId();\n $arrInfo = Mage::helper('ops/order_capture')->prepareOperation($payment, $amount);\n $storeId = $payment->getOrder()->getStoreId();\n\n if ($this->isRedirectNoticed($orderId)) {\n return $this;\n }\n try {\n $requestParams = $this->getBackendOperationParameterModel()->getParameterFor(\n self::OPS_CAPTURE_TRANSACTION_TYPE,\n $this,\n $payment,\n $amount,\n $arrInfo\n );\n $response = Mage::getSingleton('ops/api_directlink')->performRequest(\n $requestParams,\n Mage::getModel('ops/config')->getDirectLinkGatewayPath($storeId),\n $storeId\n );\n Mage::helper('ops/payment')->saveOpsStatusToPayment($payment, $response);\n\n if ($response['STATUS'] == self::OPS_PAYMENT_PROCESSING ||\n $response['STATUS'] == self::OPS_PAYMENT_UNCERTAIN ||\n $response['STATUS'] == self::OPS_PAYMENT_IN_PROGRESS\n ) {\n Mage::helper('ops/directlink')->directLinkTransact(\n Mage::getSingleton(\"sales/order\")->loadByIncrementId($payment->getOrder()->getIncrementId()),\n $response['PAYID'],\n $response['PAYIDSUB'],\n $arrInfo,\n self::OPS_CAPTURE_TRANSACTION_TYPE,\n $this->getHelper()->__('Start Ingenico Payment Services %s capture request',$arrInfo['type']));\n $order = Mage::getModel('sales/order')->load($orderId); //Reload order to avoid wrong status\n $order->addStatusHistoryComment(\n Mage::helper('ops')->__(\n 'Invoice will be created automatically as soon as Ingenico Payment Services sends an acknowledgement. Ingenico Payment Services status: %s.',\n Mage::helper('ops')->getStatusText($response['STATUS'])\n )\n );\n $order->save();\n $this->getHelper()->redirectNoticed(\n $orderId,\n $this->getHelper()->__(\n 'Invoice will be created automatically as soon as Ingenico Payment Services sends an acknowledgement. Ingenico Payment Services status: %s.',\n Mage::helper('ops')->getStatusText($response['STATUS'])\n )\n );\n return $this;\n }\n elseif ($response['STATUS'] == self::OPS_PAYMENT_PROCESSED_MERCHANT || $response['STATUS'] == self::OPS_PAYMENT_REQUESTED) {\n return parent::capture($payment, $amount);\n } else{\n Mage::throwException(\n $this->getHelper()->__(\n 'The Invoice was not created. Ingenico Payment Services status: %s.',\n Mage::helper('ops')->getStatusText($response['STATUS'])\n )\n );\n }\n }\n catch (Exception $e){\n Mage::getModel('ops/status_update')->updateStatusFor($payment->getOrder());\n Mage::helper('ops')->log(\"Exception in capture request:\".$e->getMessage());\n throw new Mage_Core_Exception($e->getMessage());\n }\n }", "public function processCapture($id_transaction_stripe, $amount)\n\t{\n\t\t\n\t\t/* If 1.4 and no backward, then leave */\n\t\tif (!$this->backward)\n\t\t\treturn;\n\n\t\tinclude_once(dirname(__FILE__).'/lib/Stripe.php');\n\t\t\\Stripe\\Stripe::setApiKey(Configuration::get('STRIPE_MODE') ? Configuration::get('STRIPE_PRIVATE_KEY_LIVE') : Configuration::get('STRIPE_PRIVATE_KEY_TEST'));\n\n\t\t/* Try to process the capture and catch any error message */\n\t\ttry\n\t\t{\n\t\t\t$charge = \\Stripe\\Charge::retrieve($id_transaction_stripe);\n\t\t\t$result_json = $charge->capture(array('amount' => $amount * 100));\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\n\t\t\t$this->_errors['stripe_capture_error'] = $e->getMessage();\n\t\t\tif (class_exists('Logger'))\n\t\t\t\tLogger::addLog($this->l('Stripe - Capture transaction failed').' '.$e->getMessage(), 1, null, 'Cart', (int)$this->context->cart->id, true);\n\t\t}\n\t\t\n\t\tif(!isset($this->_errors['stripe_capture_error']) && $result_json->captured==true){\n\t\t $query = 'UPDATE ' . _DB_PREFIX_ . 'stripepro_transaction SET `status` = \\'paid\\', `amount` = ' . $amount . ' WHERE `id_transaction` = \\''. pSQL($id_transaction_stripe).'\\'';\n\t\t if(!Db::getInstance()->Execute($query))\n\t\t\treturn false;\n\t\t }\n\t\t\n\t\treturn true;\n\t}", "public function execute()\n {\n if (!empty($_GET[\"responseid\"]) && !empty($_GET[\"requestid\"])) {\n $order_id = base64_decode($_GET[\"requestid\"]);\n $response_id = base64_decode($_GET[\"responseid\"]);\n\n $mode = $this->_paymentMethod->getMerchantConfig('modes');\n\n if ($mode == 'Test') {\n $mid = $this->_paymentMethod->getMerchantConfig('test_mid');\n $mkey = $this->_paymentMethod->getMerchantConfig('test_mkey');\n $client = new SoapClient(\"https://testpti.payserv.net/Paygate/ccservice.asmx?WSDL\");\n } elseif ($mode == 'Live') {\n $mid = $this->_paymentMethod->getMerchantConfig('live_mid');\n $mkey = $this->_paymentMethod->getMerchantConfig('live_mkey');\n $client = new SoapClient(\"https://ptipaygate.paynamics.net/ccservice/ccservice.asmx?WSDL\");\n }\n\n $request_id = '';\n $length = 8;\n $characters = '0123456789';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $request_id .= $characters[rand(0, $charactersLength - 1)];\n }\n\n $merchantid = $mid;\n $requestid = $request_id;\n $org_trxid = $response_id;\n $org_trxid2 = \"\";\n $cert = $mkey;\n $data = $merchantid . $requestid . $org_trxid . $org_trxid2;\n $data = utf8_encode($data . $cert);\n\n // create signature\n $sign = hash(\"sha512\", $data);\n\n $params = array(\"merchantid\" => $merchantid,\n \"request_id\" => $requestid,\n \"org_trxid\" => $org_trxid,\n \"org_trxid2\" => $org_trxid2,\n \"signature\" => $sign);\n\n $result = $client->query($params);\n $response_code = $result->queryResult->txns->ServiceResponse->responseStatus->response_code;\n $response_message = $result->queryResult->txns->ServiceResponse->responseStatus->response_message;\n\n switch ($response_code) {\n case 'GR001':\n case 'GR002':\n case 'GR033':\n $this->getResponse()->setRedirect(\n $this->_getUrl('checkout/onepage/success')\n );\n break;\n default:\n $this->messageManager->addErrorMessage(\n __($response_message)\n );\n /** @var \\Magento\\Framework\\Controller\\Result\\Redirect $resultRedirect */\n $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);\n return $resultRedirect->setPath('checkout/cart');\n break;\n }\n\n// $this->getResponse()->setRedirect(\n// $this->_getUrl('checkout/onepage/success')\n// );\n }\n }", "function view_voucher($demand_id)\n {\n }", "public function acceptFromPoAction()\r\n {\r\n $request = $this->getRequest();\r\n if ($request->getHeader('Referer') == null) {\r\n return $this->redirect()->toRoute('access_denied');\r\n }\r\n\r\n $id = (int) $this->params()->fromQuery('target_id');\r\n $token = $this->params()->fromQuery('token');\r\n\r\n /**@var \\Application\\Repository\\FinVendorInvoiceRepository $res ;*/\r\n $res = $this->doctrineEM->getRepository('Application\\Entity\\FinVendorInvoice');\r\n $rows_tmp = $res->getAPInvoiceTmp($id, $token);\r\n\r\n if ($rows_tmp !== null) {\r\n\r\n /**@var \\Application\\Entity\\FinVendorInvoice $target ;*/\r\n $target = null;\r\n\r\n if (count($rows_tmp) > 0) {\r\n $row_1 = $rows_tmp[0];\r\n if ($row_1 instanceof FinVendorInvoiceRowTmp) {\r\n $target = $row_1->getInvoice();\r\n }\r\n\r\n if ($target == null) {\r\n return $this->redirect()->toRoute('access_denied');\r\n }\r\n\r\n $n = 0;\r\n foreach ($rows_tmp as $r) {\r\n\r\n /**@var \\Application\\Entity\\FinVendorInvoiceRowTmp $r ;*/\r\n\r\n $n ++;\r\n $ap_row = new FinVendorInvoiceRow();\r\n $ap_row->setIsActive(1);\r\n $ap_row->setRowNumber($n);\r\n $ap_row->setRowIndentifer($target->getSysNumber() . \"-$n\");\r\n\r\n $ap_row->setCurrentState($target->getCurrentState());\r\n $ap_row->setInvoice($target);\r\n $ap_row->setPoRow($r->getPoRow());\r\n $ap_row->setPrRow($r->getPrRow());\r\n $ap_row->setItem($r->getItem());\r\n\r\n $ap_row->setQuantity($r->getQuantity());\r\n $ap_row->setUnit($r->getUnit());\r\n $ap_row->setUnitPrice($r->getUnitPrice());\r\n\r\n $netAmount = $r->getQuantity() * $r->getUnitPrice();\r\n\r\n $taxRate = (int) $r->getTaxRate();\r\n $ap_row->setTaxRate($taxRate);\r\n\r\n $taxAmount = $netAmount * $taxRate;\r\n $grossAmount = $netAmount + $taxAmount;\r\n\r\n $ap_row->setNetAmount($netAmount);\r\n $ap_row->setGrossAmount($grossAmount);\r\n\r\n $u = $this->doctrineEM->getRepository('Application\\Entity\\MlaUsers')->findOneBy(array(\r\n \"email\" => $this->identity()\r\n ));\r\n\r\n $ap_row->setCreatedBy($u);\r\n $ap_row->setCreatedOn(new \\DateTime());\r\n $ap_row->setToken(Rand::getString(10, \\Application\\Model\\Constants::CHAR_LIST, true) . \"_\" . Rand::getString(21, \\Application\\Model\\Constants::CHAR_LIST, true));\r\n $ap_row->setRemarks($r->getRemarks());\r\n\r\n $this->doctrineEM->persist($ap_row);\r\n\r\n $r->setCurrentState(\"ACCEPTED\");\r\n $r->setIsActive(0);\r\n $this->doctrineEM->persist($r);\r\n\r\n $gr_entity = new NmtInventoryTrx();\r\n $gr_entity->setVendor($target->getVendor());\r\n $gr_entity->setFlow('IN');\r\n $gr_entity->setInvoiceRow($ap_row);\r\n $gr_entity->setItem($r->getItem());\r\n $gr_entity->setPrRow($r->getPrRow());\r\n $gr_entity->setQuantity($r->getQuantity());\r\n $gr_entity->setVendorItemCode($r->getVendorItemCode());\r\n $gr_entity->setVendorItemUnit($r->getUnit());\r\n $gr_entity->setVendorUnitPrice($r->getUnitPrice());\r\n $gr_entity->setTrxDate($target->getGrDate());\r\n $gr_entity->setCurrency($target->getCurrency());\r\n $gr_entity->setRemarks(\"GR of Invoice \" . $target->getInvoiceNo());\r\n $gr_entity->setWh($target->getWarehouse());\r\n $gr_entity->setCreatedBy($u);\r\n $gr_entity->setCreatedOn(new \\DateTime());\r\n $gr_entity->setToken(Rand::getString(10, \\Application\\Model\\Constants::CHAR_LIST, true) . \"_\" . Rand::getString(21, \\Application\\Model\\Constants::CHAR_LIST, true));\r\n $gr_entity->setChecksum(Rand::getString(32, \\Application\\Model\\Constants::CHAR_LIST, true));\r\n\r\n $gr_entity->setTaxRate($r->getTaxRate());\r\n\r\n $gr_entity->setCurrentState($target->getCurrentState());\r\n\r\n if ($target->getCurrentState() == \"finalInvoice\") {\r\n $gr_entity->setIsActive(1);\r\n } else {\r\n $gr_entity->setIsActive(0);\r\n }\r\n\r\n $this->doctrineEM->persist($gr_entity);\r\n $this->doctrineEM->flush();\r\n }\r\n }\r\n\r\n $this->doctrineEM->flush();\r\n\r\n /*\r\n * $redirectUrl = \"/finance/v-invoice/copy-from-po1?token=\" . $target>getToken() . \"&entity_id=\" . $entity->getId();\r\n */\r\n $redirectUrl = \"/finance/v-invoice/list\";\r\n return $this->redirect()->toUrl($redirectUrl);\r\n\r\n /*\r\n * return new ViewModel(array(\r\n * 'target' => $target,\r\n * ));\r\n */\r\n }\r\n return $this->redirect()->toRoute('access_denied');\r\n }", "public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}", "function chargeCreditCard()\n{\n\t \n\t$insert_id = $this->session->userdata('recent_reg_id');\n\t$current_login_user = $this->common_front_model->get_session_data();\n\t$inputData=$this->input->post();\n\n\t//print_r($current_login_user);\n\n\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\"9zyp7U9TTQ\");\n $merchantAuthentication->setTransactionKey(\"8hFVee23p993GVVa\");\n \n // Set the transaction's refId\n $refId = $current_login_user['matri_id'].'-' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($inputData['card_number']);\n $creditCard->setExpirationDate($inputData['year'].\"-\".$inputData['month']);\n $creditCard->setCardCode($inputData['cvv']);\n\n // Add the payment data to a paymentType object\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n // Create order information\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber($refId);\n $order->setDescription(\"Membership Renewal-\".$inputData['plan_name']);\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($inputData['name_on_card']);\n // $customerAddress->setLastName($current_login_user['lastname']);\n // $customerAddress->setCompany($current_login_user['username']);\n //$customerAddress->setAddress(\"14 Main Street\");\n // $customerAddress->setCity(\"Pecan Springs\");\n //$customerAddress->setState(\"TX\");\n // $customerAddress->setZip(\"44628\");\n // $customerAddress->setCountry(\"USA\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId($current_login_user['matri_id']);\n $customerData->setEmail($current_login_user['email']);\n\n // Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"60\");\n\n // Add some merchant defined fields. These fields won't be stored with the transaction,\n // but will be echoed back in the response.\n $merchantDefinedField1 = new AnetAPI\\UserFieldType();\n $merchantDefinedField1->setName(\"customerLoyaltyNum\");\n $merchantDefinedField1->setValue(\"1128836273\");\n\n $merchantDefinedField2 = new AnetAPI\\UserFieldType();\n $merchantDefinedField2->setName(\"favoriteColor\");\n $merchantDefinedField2->setValue(\"blue\");\n\n // Create a TransactionRequestType object and add the previous objects to it\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType(\"authCaptureTransaction\");\n $transactionRequestType->setAmount($inputData['plan_amount']);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n $transactionRequestType->addToUserFields($merchantDefinedField1);\n $transactionRequestType->addToUserFields($merchantDefinedField2);\n\n // Assemble the complete transaction request\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setTransactionRequest($transactionRequestType);\n\t//print_r($request);\n // Create the controller and get the response\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n \n\n if ($response != null) {\n // Check to see if the API request was successfully received and acted upon\n if ($response->getMessages()->getResultCode() == \"Ok\") {\n // Since the API request was successful, look for a transaction response\n // and parse it to display the results of authorizing the card\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getMessages() != null) {\n //echo \" Successfully created transaction with Transaction ID: \" . $tresponse->getTransId() . \"\\n\";\n // echo \" Transaction Response Code: \" . $tresponse->getResponseCode() . \"\\n\";\n // echo \" Message Code: \" . $tresponse->getMessages()[0]->getCode() . \"\\n\";\n // echo \" Auth Code: \" . $tresponse->getAuthCode() . \"\\n\";\n\t\t\t\t//echo \" Description: \" . $tresponse->getMessages()[0]->getDescription() . \"\\n\";\n\t\t\t\t//$this->data['status']=\"Successfully created transaction with Transaction ID: \" . $tresponse->getTransId() . \"\\n\";\n\t\t\t\t//$status=\"success\";\n\t\t\t\t$this->payment_status(\"authorize\");\n\t\t\t\treturn true;\n\t\t\t\t\n } else {\n //echo \"Transaction Failed \\n\";\n if ($tresponse->getErrors() != null) {\n // echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n\t\t\t\t\t//echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t\n\t\t\t\t\t$this->data['status']=\" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n }\n }\n // Or, print errors if the API request wasn't successful\n } else {\n // echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getErrors() != null) {\n // echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n\t\t\t\t//echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\n\t\t\t\t $this->data['status']=\" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n\n } else {\n // echo \" Error Code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n\t\t\t//\techo \" Error Message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n\t\t\t\t\n\t\t\t\t $this->data['status']=\" Error Message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n }\n }\n } else {\n echo \"No response returned \\n\";\n }\n\n\t//return $response;\n\t\n\t\t\t\t$this->common_model->front_load_header('Payment Success');\n\t\t\t\tif($status=='success'){\n\t\t\t\t\t$this->load->view('front_end/payment_success',$this->data);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->load->view('front_end/payment_fail',$this->data);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->common_model->front_load_footer();\n}", "public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "function processPayment() {\n \n if ($this->creditPayment != 0.00){\n$fieldParse = new parseGatewayFields(); \n$fieldParse-> setCardName($this->cardName);\n$fieldParse-> setAchName($this->accountName);\n$fieldParse-> setCardType($this->cardType);\n$fieldParse-> setAccountType($this->accountType);\n$fieldParse-> setCardExpDate($this->cardYear);\n$fieldParse-> parsePaymentFields();\n\n //reassign vars for CS Credit Cards\n$ccFirstName = $fieldParse-> getCredtCardFirstName();\n$ccLastName = $fieldParse-> getCredtCardLastName();\n$ccCardType = $fieldParse-> getCardType();\n$ccCardYear = $fieldParse-> getCardYear(); \n$ccCardMonth = $this->cardMonth;\n$ccCardNumber = $this->cardNumber;\n$ccCardCvv = $this->cardCvv;\n\n\n \n$club_id = $_SESSION['location_id'];\n \n$dbMain = $this->dbconnect();\n\n\n$stmt = $dbMain->prepare(\"SELECT MIN(club_id) FROM club_info WHERE club_name != ''\");//>=\n$stmt->execute(); \n$stmt->store_result(); \n$stmt->bind_result($club_id); \n$stmt->fetch();\n$stmt->close();\n \n$stmt = $dbMain ->prepare(\"SELECT gateway_id, passwordfd FROM billing_gateway_fields WHERE club_id= '$club_id'\");\n$stmt->execute(); \n$stmt->store_result(); \n$stmt->bind_result($userName, $password);\n$stmt->fetch();\n$stmt->close();\n \n$amount = $this->creditPayment;\n \n //credit\"\";//\n$ccnumber = $ccCardNumber;//\"4111111111111111\";\n$ccexp = \"$this->cardMonth$this->cardYear\";//\"1010\";\n$cvv = \"$this->cardCvv\";\n //==================\n$reference = \"CMP Balance\";\n$vaultFunction = \"\";//'add_customer';//'add_customer' or 'update_customer'\n$orderId = \"$this->contractKey\";\n$merchField1 = \"$reference $this->contractKey\";\n$payTypeFlag = \"creditcard\";//\"creditcard\"; // '' or 'check'\nif(isset($_SESSION['track1'])){\n $track1 = $_SESSION['track1'];\n}else{\n $track1 = \"\";\n}\nif(isset($_SESSION['track2'])){\n $track2 = $_SESSION['track2'];\n}else{\n $track2 = \"\";\n}\n\n \n$gw = new gwapi;\n$gw->setLogin(\"$userName\", \"$password\");\n$r = $gw->doSale($amount, $ccnumber, $ccexp, $cvv, $payTypeFlag, $orderId, $merchField1, $track1, $track2, $ccFirstName, $ccLastName);\n$ccAuthDecision = $gw->responses['responsetext'];\n$vaultId = $gw->responses['customer_vault_id'];\n$authCode = $gw->responses['authcode']; \n$transactionId = $gw->responses['transactionid'];\n$ccAuthReasonCode = $gw->responses['response_code'];\n//echo \"fubar $ccAuthReasonCode\";\n // exit;\n\n if($ccAuthReasonCode != 100) {\n \n $this->paymentStatus = \"$ccAuthDecision: $ccAuthDecision\";\n //$this->transactionId = $ccAuthReasonCode; \n }else{ \n $_SESSION['cc_request_id'] = $authCode;\n $this->paymentStatus = 1;\n //$this->transactionId = $ccAuthRequestId;\n }\n }\n if ($this->creditPayment == 0.00){\n $this->paymentStatus = 1;\n }\n}", "public function checkInvoiceStatus($id)\n {\n $data = $this->checkInvoice($id);\n if (!is_array($data)) {\n Mage::throwException(\n Mage::helper('bitcoin')->__(\n \"We're sorry, an error has occurred while completing your request. Please refresh the page to try again. If the error persists, please send us an email at [email protected]\\n line: \" . __LINE__\n )\n );\n }\n $order = $this->getOrder();\n switch ($data[\"status\"]) {\n case $data[\"status\"] == \"new\":\n $this->log(\"Status page accessed for a new invoice.\", $id);\n $this->log(\"Nothing to do. Redirecting back to the payment page.\", $id);\n break;\n case $data[\"status\"] == \"paid\" :\n $commentHistory = $order->addStatusHistoryComment(\n \"Payment confirmed. Invoice Id: \" . $data[\"id\"],\n $this->getSuccessStatus()\n );\n $commentHistory->setIsVisibleOnFront(1);\n $order->sendNewOrderEmail();\n $order->save();\n Mage::getResourceModel(\"bitcoin/ipn\")->MarkAsPaid($id);\n /* create an invoice */\n $invoiceModel = Mage::getModel('sales/order_invoice_api');\n $invoice_id = $invoiceModel->create($order->getIncrementId(), array());\n $invoiceModel->capture($invoice_id);\n break;\n case $data[\"status\"] == \"authorizing\":\n $commentHistory = $order->addStatusHistoryComment(\n \"Authorizing payment. This typically takes 10 minutes. Invoice Id: {$data['id']}\",\n Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW\n );\n $commentHistory->setIsVisibleOnFront(1);\n $order->save();\n Mage::getResourceModel(\"bitcoin/ipn\")->MarkAsAuthorizing($id);\n break;\n case $data[\"status\"] == \"refund_owed\" :\n $order->setState(Mage_Sales_Model_Order::STATE_NEW);\n $this->log(\"refund_owed order\", $id);\n Mage::getResourceModel(\"bitcoin/ipn\")->MarkAsRefundOwed($id);\n $message = \"The bitcoin payment invoice received an incorrect payment. To request a refund please contact [email protected] and include your \".$order->getIncrementId().\" order number as well as the invoice id \" . $data['id'];\n $commentHistory = $order->addStatusHistoryComment(\n $message,\n $this->getFailedStatus()\n );\n $commentHistory->setIsVisibleOnFront(1);\n $order->save();\n break;\n case $data[\"status\"] == \"refund_requested\" :\n $order->setState(Mage_Sales_Model_Order::STATE_NEW);\n if (!$order->canCancel()) {\n $this->log(\"Unable to cancel order. Order #\" . $order->getIncrementId(), $id);\n } else {\n $this->log(\"refund_requested order\", $id);\n Mage::getResourceModel(\"bitcoin/ipn\")->MarkAsRefundRequested($id);\n $commentHistory = $order->addStatusHistoryComment(\n \"Your request for a refund has been received! We'll be in touch soon. In the mean time, you can reach us at [email protected]\",\n $this->getFailedStatus()\n );\n $commentHistory->setIsVisibleOnFront(1);\n $order->cancel();\n $order->save();\n $this->log(\"Order cancelled. Order #\" . $order->getIncrementId(), $id);\n }\n break;\n case $data[\"status\"] === \"failed\":\n case $data[\"status\"] === \"expired\":\n $order->setState(Mage_Sales_Model_Order::STATE_NEW);\n if (!$order->canCancel()) {\n $this->log(\"Unable to cancel order. Order #\" . $order->getIncrementId(), $id);\n } else {\n $this->log(\"Order expired : \" . $order->getIncrementId(), $id);\n Mage::getResourceModel(\"bitcoin/ipn\")->MarkAsExpired($id);\n $commentHistory = $order->addStatusHistoryComment(\n \"The bitcoin payment invoice has expired, please place your order again to receive a new invoice.\",\n $this->getFailedStatus()\n );\n $commentHistory->setIsVisibleOnFront(1);\n $order->cancel();\n $order->save();\n $this->log(\"Order cancelled. Order #\" . $order->getIncrementId(), $id);\n }\n break;\n default:\n return false;\n break;\n }\n return $data[\"status\"];\n }", "public function displayCardCvv($card_id)\n {\n\t\tif(!$card_id){\n\t\t\tthrow new Exception\\IsNullOrInvalid(\"Error Processing Request - Null/Invalid Card Id\");\n\t\t}\n\n\t\t$url = \"/cards/{$card_id}/secure-data/cvv2\";\n\n\t\treturn $this->sendRequest('get', $url);\n }", "function do_pr_invoice($data){\n\t$client_id=$data['Clientpayment']['client_id'];\n\t$amount=$data['Clientpayment']['amount'];\n\t$invoice_number=$data['Clientpayment']['invoice_number'];\n \t$list=$this->query(\"select invoice_id, total_amount from invoice where invoice_number='$invoice_number' limit 1;\");\n \t$invoice_amount=isset($list[0][0]['total_amount'])?$list[0][0]['total_amount']:0;\n \t#付清\n \tif($invoice_amount<$amount){\n\t\t\t$this->paid_true_invoice($data,$invoice_amount);\n \t}\n \tif($invoice_amount<$amount)\n \t{\n \t#未付清\n\t\t$this->paid_false_invoice($data,$invoice_number,$invoice_amount);\n \t}\n\t \tif($invoice_amount==$amount)\n \t{\n \t\n \t#刚刚付清\n \t$this->do_pay_for_invoice($data);\n\t$this->query(\"update invoice set paid=true,pay_amount=pay_amount::numeric+$invoice_amount where invoice_number='$invoice_number'\");\n \t\n \t}\n \t$this->commit();\n\t}", "private function _captureAuthorizedPayment(Varien_Object $payment)\r\n {\r\n \t$error = false;\r\n \t$session = Mage::getSingleton('checkout/session');\r\n \t\r\n \ttry\r\n \t{\r\n \t\t// set the COLLECTION variable to true\r\n \t\t$session->setIsCollectionCrossReferenceTransaction(true);\r\n \t\t\r\n\t \t$invoice = $payment->getOrder()->prepareInvoice();\r\n\t $invoice->register();\r\n\t \r\n\t if ($this->_canCapture)\r\n\t {\r\n\t $invoice->capture();\r\n\t }\r\n\t\r\n\t $payment->getOrder()->addRelatedObject($invoice);\r\n\t \t$payment->setCreatedInvoice($invoice);\r\n \t}\r\n \tcatch(Exception $exc)\r\n \t{\r\n \t\t$error = \"Couldn't capture pre-authorized payment. Message: \".$exc->getMessage();\r\n \t\tMage::log($exc->getMessage());\r\n \t}\r\n \t\r\n \t// remove the COLLECTION session variable once finished the COLLECTION attempt\r\n \t$session->setIsCollectionCrossReferenceTransaction(null);\r\n \t\r\n \treturn $error;\r\n }", "public function generate_invoice() {\n $clsid = $this->input->post('cls');\n $crsid = $this->input->post('crs');\n $userid = $this->input->post('usr');\n $invoice_id = $this->input->post('invoice');\n $status = $this->input->post('status');\n $this->load->helper('common_helper');\n \n $paid_details = $this->payments_model->get_invoice_paid_details($invoice_id);\n $paid_arr = array();\n $paid_rcd_till_date = 0;\n foreach ($paid_details as $row) \n {\n $paid_rcd_till_date = $row->amount_recd + $paid_rcd_till_date;\n }\n $total_paid = $paid_rcd_till_date;\n $refund_details = $this->payments_model->get_refund_paid_details($invoice_id);\n $refund_amount = 0;\n foreach ($refund_details as $k => $row) \n {\n $refund_amount = $refund_amount + $row->amount_refund;\n }\n $paid_paid_till_date = $paid_rcd_till_date - $refund_amount;\n \n \n $ack_data = $this->payments_model->get_acknowledgement_data($clsid, $crsid, $userid);\n $invoice = $this->payments_model->get_invoice_details($clsid, $crsid, $userid);\n $user_org = $this->payments_model->get_user_org_details($userid);\n $invoice_amount=$invoice['total_inv_amount'];\n $invoice_amount_temp=$invoice['total_inv_amount'];\n if($status==\"PAID\"){\n \n $sfc_amount= $this->payments_model->get_sfc_details($invoice_id);\n $invoice_amount=$sfc_amount['amount_recd'];\n $invoice_amount1=$sfc_amount['amount_recd'];\n $invoice_amount=$invoice['total_inv_amount']-$sfc_amount['sfc_claimed'];\n if($sfc_amount['sfc_claimed']>0){\n $mop=explode('_',$sfc_amount['mode_of_pymnt']);\n \n }\n \n }\n //$outstanding_amount=$invoice_amount_temp-$invoice_amount1;\n $outstanding_amount=$invoice_amount_temp-$paid_paid_till_date;\n $tanant = $this->payments_model->get_tanant();\n $date = date('M d Y', strtotime($invoice['inv_date']));\n $logourl = base_url() . 'logos/' . $this->session->userdata(public_tenant_details)->Logo;\n $startdate = date('M d Y, l', strtotime($ack_data[class_start_datetime])) . ' @ ' . date(''\n . 'h:i A', strtotime($ack_data[class_start_datetime]));\n $after_discount = $invoice['class_fees'] - $invoice['total_inv_discnt'];\n $after_gst = $after_discount + $invoice['total_gst'];\n $Url = base_url() . 'payments/print_invoice';\n $gender = ($ack_data['gender'] == 'MALE') ? 'Mr. ' : 'Ms. ';\n //added by sankar\n $gst_label = 'GST Not Applicable';\n $gst_prelabel = 'GST OFF';\n if (!empty($invoice['gst_rule'])) {\n $gst_label = 'GST ON, ' . $this->meta_data[$invoice['gst_rule']];\n $gst_prelabel = 'GST (' . number_format($invoice['gst_rate'], 2, '.', '') . '%)';\n }\n \n //code ends here\n\n echo ' <form action=\"' . $Url . '\" method=\"post\"><p><a class=\"close-modal \" rel=\"modal:close\" href=\"#close-modal\">Close</a>\n <h2 class=\"sub_panel_heading_style\">Invoice \n <!-- commended by sankar <span class=\"label label-default push_right\"><a href=\"#export\" rel=\"modal:open\" class=\"small_text1\">Print/ Export to PDF</a></span>-->\n </h2>\n <div class=\"col-lg-6\">\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n <tr>\n <td align=\"left\"><img src=\"' . $logourl . '\" border=\"0\" /></td>\n </tr>\n <tr>\n <td class=\"td_heading\" align=\"left\">' . $tanant[tenant_address] . ' </br>' .\n $tanant[tenant_city] . ' ' . get_catname_by_parm($tanant[tenant_state]) . ' ' . get_catname_by_parm($tanant[tenant_country]) . '</br>\n Tel:' . $tanant[tenant_contact_num] . ' <br>\n ' . $tanant[tenant_email_id] . ' </td>\n </tr>\n\n </table>\n\n </div>\n <div class=\"col-lg-6\">\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n <tr>\n <td colspan=\"2\"><font style=\"font-size:18px; font-weight:bold;\">' . $tanant['invoice_name'] . '</font></td>\n </tr>\n <tr>\n <td colspan=\"2\"><strong>' . $tanant['invoice_name'] . ' No. </strong> ' . date('Y') . '' . $invoice['invoice_id'] . '<br><strong>' . $tanant['invoice_name'] . ' Date</strong>: ' . $date . '<br><br></td>\n </tr>\n <tr>\n <td colspan=\"2\"><strong><u>Individual Details:</u></strong></td>\n </tr>\n \n <tr>\n <td class=\"td_heading\">Address:</td>\n <td>' . $user_org[personal_address_bldg] . '</br>\n ' . $user_org[personal_address_city] . ' '\n . $this->meta_data[$user_org[personal_address_state]] . ' '\n . $this->meta_data[$user_org[personal_address_country]] . '</td>\n </tr>\n <tr>\n <td class=\"td_heading\">Contact No:</td>\n <td>' . $user_org[contact_number] . '</td>\n </tr>\n <tr>\n <td class=\"td_heading\">Attention:</td>\n <td>' .$gender. $user_org[first_name] . ' ' . $user_org[last_name] . '</td>\n </tr>\n </table>\n\n </div>\n\n <div style=\"clear:both;\"></div>\n <br>\n <div class=\"table-responsive\">\n <table class=\"table table-striped\">\n <thead>\n <tr>\n <th class=\"th_header\">Description</th>\n <th class=\"th_header\">Unit Price</th>\n <th class=\"th_header\">Total</th>\n \n </tr>\n </thead>\n <tbody>\n <tr>\n <td>' . $ack_data['crse_name'] . ', ' . $invoice['class_name'] . '</td>\n <td>$' . number_format($invoice['class_fees'], 2, '.', '') . '</td>\n <td>$' . number_format($invoice['class_fees'], 2, '.', '') . '</td>\n \n </tr>\n \n <tr>\n <td>' . $this->meta_data[$invoice['discount_type']] . ' Discount @ ' . number_format($invoice['discount_rate'], 2, '.', '') . '%</td>\n <td>$' . number_format($invoice['total_inv_discnt'], 2, '.', '') . '</td>\n <td>$' . number_format($invoice['total_inv_discnt'], 2, '.', '') . '</td>\n \n </tr>\n\n <tr>\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">After Discounts</td>\n <td>$' . number_format($after_discount, 2, '.', '') . '</td>\n </tr>\n\n <tr>\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">' . $gst_prelabel . '</td>\n <td>$' . number_format($invoice['total_gst'], 2, '.', '') . '</td>\n \n </tr>\n\n <tr>\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">' . $gst_label . '</td>\n <td>$' . number_format($after_gst, 2, '.', '') . '</td>\n \n </tr>\n <tr>\n <td>Subsidy :</td>\n <td>$' . number_format($invoice[total_inv_subsdy], 2, '.', '') . '</td>\n <td>$' . number_format($invoice[total_inv_subsdy], 2, '.', '') . '</td>\n \n </tr>\n <tr>\n <td>Skills Future Credit :</td>\n <td></td>\n <td>$' .number_format($sfc_amount['sfc_claimed'],2,'.','').'</td>\n </tr>\n \n <tr class=\"info\">\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">Invoice Amount</td>\n <td>$' . number_format($invoice_amount, 2, '.', '') . '</td>\n \n </tr>\n </tbody>\n </table>\n </div>\n <br>\n <div class=\"table-responsive\">\n <div>\n <table class=\"table table-striped\">\n <thead>\n <tr>\n <th colspan=\"9\">Particulars of Participants</th>\n </tr>\n <tr>\n <th width=\"16%\" class=\"th_header\">Name</th>\n <th width=\"13%\" class=\"th_header\">Tax Code</th>\n <th width=\"9%\" class=\"th_header\">TG# </th>\n <th width=\"10%\" class=\"th_header\">Subsidy</th>\n <th width=\"12%\" class=\"th_header\">Discount</th>\n <th width=\"13%\" class=\"th_header\">GST Amount</th>\n <th width=\"13%\" class=\"th_header\">SFC('.$mop[1].') Amount</th>\n <th width=\"16%\" class=\"th_header\">Unit Fee(GST Applicable)</th>\n <th width=\"11%\" class=\"th_header\">Remarks </th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>' .$gender. $user_org[first_name] . ' ' . $user_org[last_name] . '</td>\n <td>' . $user_org[tax_code] . '</td>\n <td>' . $invoice[tg_number] . '</td>\n <td>$' . number_format($invoice[total_inv_subsdy], 2, '.', '') . '</td>\n <td>$' . number_format($invoice[total_inv_discnt], 2, '.', '') . '</td>\n <td>$' . number_format($invoice[total_gst], 2, '.', '') . '</td>\n <td>$' . number_format($sfc_amount['sfc_claimed'],2,'.','').'</td>\n <td>$' . number_format($invoice_amount, 2, '.', '') . '</td>\n <td>'. $invoice['payment_status'].'</td> \n <input type=\"hidden\" value=\"' . $clsid . '\" name=\"classId\"/>\n <input type=\"hidden\" value=\"' . $crsid . '\" name=\"courseId\"/> \n <input type=\"hidden\" value=\"' . $userid . '\" name=\"userId\"/>\n </tr>\n <tr>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n \n <td colspan=\"2\">OUT STANDING AMOUNT</td>\n <td>$' . number_format($outstanding_amount, 2, '.', '') . '</td>\n <td></td> \n \n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div style=\"clear:both;\"></div>\n <br>\n <p class=\"red\">This is a computer generated invoice. No signature is required- ' . $tanant['tenant_name'] . ' Administrator.</p>\n <div style=\"color:red;\">' . html_entity_decode($tanant['invoice_footer_text']) . '</div>\n <div style=\"clear:both;\"></div><br>\n <span style=\"float:right;\">\n<!-- <button class=\"btn btn-primary\" type=\"submit\">Print</button></form><br><br>-->\n ';\n }", "public function PaymentCredit()\n {\n\n $condition = array('id' => $this->checkLogin('U'));\n $userDetails = $this->checkout_model->get_all_details(USERS, $condition);\n $currency_code = $this->input->post('currencycode');\n\t\t\t$user_currencycode = $this->input->post('user_currencycode');\n if ($this->input->post('creditvalue') == 'authorize') {\n $Auth_Details = unserialize(API_LOGINID);\n $Auth_Setting_Details = unserialize($Auth_Details['settings']);\n error_reporting(-1);\n define(\"AUTHORIZENET_API_LOGIN_ID\", $Auth_Setting_Details['merchantcode']);\n define(\"AUTHORIZENET_TRANSACTION_KEY\", $Auth_Setting_Details['merchantkey']);\n define(\"API_MODE\", $Auth_Setting_Details['mode']);\n if (API_MODE == 'sandbox') {\n define(\"AUTHORIZENET_SANDBOX\", true);\n } else {\n define(\"AUTHORIZENET_SANDBOX\", false);\n }\n \n define(\"TEST_REQUEST\", \"FALSE\");\n require_once './authorize/autoload.php';\n\n $transaction = new AuthorizeNetAIM;\n $transaction->setSandbox(AUTHORIZENET_SANDBOX);\n\n\t\t\t\t$payable_amount = currency_conversion($this->input->post('user_currencycode'), 'USD', $this->input->post('total_price'),$this->input->post('currency_cron_id'));\n //echo $payable_amount;exit();\n $transaction->setFields(array('amount' => $payable_amount, 'card_num' => $this->input->post('cardNumber'), 'exp_date' => $this->input->post('CCExpMonth') . '/' . $this->input->post('CCExpYear'), 'first_name' => $userDetails->row()->firstname, 'last_name' => $userDetails->row()->lastname, 'address' => $this->input->post('address'), 'city' => $this->input->post('city'), 'state' => $this->input->post('state'), 'country' => $userDetails->row()->country, 'phone' => $userDetails->row()->phone_no, 'email' => $userDetails->row()->email, 'card_code' => $this->input->post('creditCardIdentifier'),));\n\n $response = $transaction->authorizeAndCapture();\n //print_r($response);exit();\n\n // echo $this->input->post('total_price');exit();\n if ($response->approved != '') {\n $product_id = $this->input->post('booking_rental_id');\n $product = $this->checkout_model->get_all_details(PRODUCT, array('id' => $product_id));\n $totalAmnt = $this->input->post('total_price');\n $enquiryid = $this->input->post('enquiryid');\n $loginUserId = $this->checkLogin('U');\n // echo $totalAmnt;exit();\n if ($this->session->userdata('randomNo') != '') {\n $delete = 'delete from ' . PAYMENT . ' where dealCodeNumber = \"' . $this->session->userdata('randomNo') . '\" and user_id = \"' . $loginUserId . '\" ';\n $this->checkout_model->ExecuteQuery($delete, 'delete');\n $dealCodeNumber = $this->session->userdata('randomNo');\n } else {\n $dealCodeNumber = mt_rand();\t\n }\n $insertIds = array();\n $now = date(\"Y-m-d H:i:s\");\n $paymentArr = array('product_id' => $product_id, 'sell_id' => $product->row()->user_id, 'price' => $totalAmnt, 'indtotal' => $product->row()->price, 'sumtotal' => $totalAmnt, 'user_id' => $loginUserId, 'created' => $now, 'dealCodeNumber' => $dealCodeNumber, 'status' => 'Paid', 'shipping_status' => 'Pending', 'total' => $totalAmnt, 'EnquiryId' => $enquiryid, 'inserttime' => NOW(), 'currency_code' => $user_currencycode);\n /* referal user commission payment starts */\n $referred_user = $this->checkout_model->get_all_details(USERS, array('id' => $loginUserId));\n $refered_user = $referred_user->row()->referId;\n $user_booked = $this->checkout_model->get_all_details(PAYMENT, array('user_id' => $loginUserId, 'status' => 'Paid'));\n if ($user_booked->num_rows() == 0) {\n $totalAmount = $totalAmnt;\n $currencyCode = $currency_code;\n $book_commission_query = 'SELECT * FROM ' . INVITE . ' WHERE email = \"'.$userDetails->row()->email.'\"';\n $book_commission = $this->checkout_model->ExecuteQuery($book_commission_query);\n if ($book_commission->num_rows() > 0) {\n // if ($book_commission->row()->promotion_type == 'flat') {\n // $referal_commission = round($totalAmount - $book_commission->row()->commission_percentage, 2);\n // } else {\n // $commission = round(($book_commission->row()->commission_percentage / 100), 2);\n // $referal_commission = ($totalAmount * $commission);\n // }\n $commission = round(($book_commission->row()->commission_persent / 100), 2);\n $referal_commission = ($totalAmount * $commission);\n if ($currencyCode != 'USD') {\n // ,$this->input->post('currency_cron_id')\n $referal_commission = convertCurrency($currencyCode, 'USD', $referal_commission);\n }\n $referred_userData = $this->checkout_model->get_all_details(USERS, array('id' => $refered_user));\n $existAmount = $referred_userData->row()->referalAmount;\n $exit_totalReferalAmount = $referred_userData->row()->totalReferalAmount;\n $existAmountCurrenctCode = $referred_userData->row()->referalAmount_currency;\n if ($existAmountCurrenctCode != 'USD') {\n $existAmount = convertCurrency($existAmountCurrenctCode, 'USD', $existAmount);\n $exit_totalReferalAmount = convertCurrency($existAmountCurrenctCode, 'USD', $exit_totalReferalAmount);\n }\n $tot_commission = $existAmount + $referal_commission;\n $new_totalReferalAmount = $exit_totalReferalAmount + $referal_commission;\n $inputArr_ref = array('totalReferalAmount' => $new_totalReferalAmount, 'referalAmount' => $tot_commission, 'referalAmount_currency' => 'USD');\n $this->checkout_model->update_details(USERS, $inputArr_ref, array('id' => $refered_user));\n }\n }\n $this->checkout_model->simple_insert(PAYMENT, $paymentArr);\n $insertIds[] = $this->db->insert_id();\n $paymtdata = array('randomNo' => $dealCodeNumber, 'randomIds' => $insertIds);\n $this->session->set_userdata($paymtdata, $currency_code);\n $this->product_model->edit_rentalbooking(array('booking_status' => 'Booked'), array('id' => $enquiryid));\n $lastFeatureInsertId = $this->session->userdata('randomNo');\n\t\t\t\t\t\n redirect('order/success/' . $loginUserId . '/' . $lastFeatureInsertId . '/' . $response->transaction_id);\n } else {\n // echo $this->input->post('total_price');exit();\n $this->session->set_userdata('payment_error', $response->response_reason_text);\n redirect('order/failure');\n }\n }\n }", "public function test_receive_capture()\n {\n\n $payumService = m::spy('Recca0120\\LaravelPayum\\Service\\PayumService');\n $token = uniqid();\n\n /*\n |------------------------------------------------------------\n | Act\n |------------------------------------------------------------\n */\n\n $payumService\n ->shouldReceive('receiveCapture')->with($token)->andReturn($token);\n\n $controller = new PaymentController();\n\n /*\n |------------------------------------------------------------\n | Assert\n |------------------------------------------------------------\n */\n\n $controller->receiveCapture($payumService, $token);\n $payumService->shouldHaveReceived('receiveCapture')->with($token)->once();\n }", "public function acceptPayment($receipt)\n\t{\n\t}", "function hid() {\n // we don't need to set StoreCard to true if the card hasn't expired and also\n // we need to set the HPP to use the stored card instead of asking for a new one and\n // we probably just go ahead and charge the stored card, and only use HPP if the stored card\n // fails and we mark the stored card inactive or delete it on failure and just go with the new one on the transaction\n // results\n\n $StoreCard = (isset($_REQUEST['StoreCard']) && $_REQUEST['StoreCard'] == 'true') ? true : false;\n\n $invoiceId = $_REQUEST['id'];\n\n $this->load->library('protectpayapi');\n\n $invoice = Invoice::find($invoiceId);\n\n $applicationEnv = ENVIRONMENT;\n\n\n $parsedAccountUrlPrefix = $_SESSION['accountUrlPrefix'];\n\n $databaseName = $parsedAccountUrlPrefix . '_' . ENVIRONMENT;\n\n /** @var CI_DB_mysql_driver $primaryDatabase */\n $primaryDatabase = $this->load->database('primary', TRUE);\n\n $params = [\n 'primaryDatabase' => $primaryDatabase,\n ];\n $this->load->library('account', $params);\n\n $params = [\n 'databaseName' => $databaseName,\n 'primaryDatabase' => $primaryDatabase];\n\n $this->load->library('propay_api', $params);\n\n $invoiceUser = InvoiceHasUser::find('all',array('conditions' => array('invoice_id=?',$invoiceId)));\n if (count($invoiceUser) > 0) {\n $user = User::find($invoiceUser[0]->user_id);\n $signedUp = $this->propay_api->isSignedUp($parsedAccountUrlPrefix, $user->username);\n\t $merchantProfileId = ($this->account->isInvoiceCryptoPayment($invoiceId, $parsedAccountUrlPrefix, $user->username) != false) ? PROTECT_PAY_MERCHANT_PROFILE_ID : $signedUp->ProfileId;\n } else {\n $signedUp = $this->propay_api->isSignedUp($parsedAccountUrlPrefix, $parsedAccountUrlPrefix);\n\t $merchantProfileId = ($this->account->isInvoiceCryptoPayment($invoiceId, $parsedAccountUrlPrefix) != false) ? PROTECT_PAY_MERCHANT_PROFILE_ID : $signedUp->ProfileId;\n }\n\n $data = [\n \"Amount\" => (int) ($invoice->outstanding * 100), //convert to cents\n \"AuthOnly\" => false,\n \"AvsRequirementType\" => 3,\n \"CardHolderNameRequirementType\" => 2,\n \"CssUrl\" => \"https://spera-\" . $applicationEnv . \".s3-us-west-2.amazonaws.com/pmi.css\",\n \"CurrencyCode\" => \"USD\",\n \"InvoiceNumber\" => $invoiceId,\n \"MerchantProfileId\" => $merchantProfileId,\n \"OnlyStoreCardOnSuccessfulProcess\" => $StoreCard,\n \"PayerAccountId\" => PROTECT_PAY_PAYER_ACCOUNT_ID,\n \"ProcessCard\" => true,\n \"Protected\" => false,\n \"SecurityCodeRequirementType\" => 1,\n \"StoreCard\" => $StoreCard,\n ];\n\n if ($_REQUEST['paymentType'] == 'card') {\n $data[\"PaymentTypeId\"] = \"0\";\n } else if ($_REQUEST['paymentType'] == 'ach') {\n $data[\"PaymentTypeId\"] = \"1\";\n }\n\n $result = $this->protectpayapi\n ->setApiBaseUrl(PROTECT_PAY_API_BASE_URL)\n ->setBillerId(PROTECT_PAY_BILLER_ID)\n ->setAuthToken(PROTECT_PAY_AUTH_TOKEN)\n ->setHostedTransactionData($data)\n ->createHostedTransaction()\n ->getCreatedHostedTransactionInfo();\n $responseObject = json_decode($result);\n\n if ( $responseObject ) {\n $_SESSION['paymentType'] = $_REQUEST['paymentType'];\n $_SESSION['HostedTransactionIdentifier'] = $responseObject->HostedTransactionIdentifier;\n\t $_SESSION['merchantProfileId'] = $merchantProfileId;\n }\n header('Content-Type: application/json');\n echo json_encode([\n 'response'=>$responseObject,\n 'success' => true,\n 'message' => 'Hosted Transaction Identifier Created Successfully.',\n 'HostedTransactionIdentifier' => $_SESSION['HostedTransactionIdentifier']\n ]);\n\n die();\n }", "public function send_invoice( $invoice_id ) {\n \n // Check if the session exists and if the login user is admin\n $this->check_session($this->user_role, 1);\n \n // Load the function send_invoice\n if ( sends_invoice($invoice_id) ) {\n \n echo json_encode(1);\n \n }\n \n }", "protected function doCapturePayment() {\n throw new \\Exception('Child classes must override this method to support payment capture.');\n }", "public function getPaymentStatus($contract_id)\r\n {\r\n $contract = Contract::find($contract_id);\r\n $project = Project::find($contract->project_id);\r\n $client = Lead::find($project->lead_id);\r\n // Get the payment ID before session clear\r\n $payment_id = Session::get('paypal_payment_id');\r\n\r\n // clear the session payment ID\r\n Session::forget('paypal_payment_id');\r\n\r\n if (!Input::get('PayerID') ||! Input::get('token'))\r\n {\r\n return view('omi.payment.index',array('project'=>$project,'contract'=>$contract,'client'=>$client,'error'=>'Payment failed'));\r\n }\r\n $payment = Payment::get($payment_id, $this->_api_context);\r\n\r\n // PaymentExecution object includes information necessary\r\n // to execute a PayPal account payment.\r\n // The payer_id is added to the request query parameters\r\n // when the user is redirected from paypal back to your site\r\n $execution = new PaymentExecution();\r\n $execution->setPayerId(Input::get('PayerID'));\r\n\r\n //Execute the payment\r\n $result = $payment->execute($execution, $this->_api_context);\r\n\r\n if ($result->getState() == 'approved')\r\n {\r\n $amount = number_format($payment->getTransactions()[0]->getAmount()->total,2, \".\",\"\");\r\n $payment_transaction = new PaymentTransaction();\r\n $payment_transaction->contract_id = $contract->id;\r\n $payment_transaction->amount = $amount;\r\n $payment_transaction->source = \"PAYPAL\";\r\n $payment_transaction->details = $result->getState();\r\n $payment_transaction->numPayments = 1;\r\n $payment_transaction->approved =1;\r\n $payment_transaction->status =\"approved\";\r\n $payment_transaction->subscriptionId =$payment_id;\r\n $payment_transaction->ip = $_SERVER['REMOTE_ADDR'];\r\n $payment_transaction->save();\r\n\r\n $contract->paid += $amount;\r\n $contract->paidDate = new \\DateTime();\r\n $contract->readed = 0;\r\n $contract->consultant_id = $project->consultant_id;\r\n\r\n //contracts IGUP should be credited to the consultant that sold the IMG\r\n if($contract->type==\"IGUP\" && $project->contractIMG() != \"\"){\r\n $contract->consultant_id = $project->contractIMG()->consultant_id;\r\n }\r\n\r\n $contract->save();\r\n\r\n //send sms to consultant.\r\n PlivoHelper::consultantSmsOutPerPayment($project->consultant_id,$project->id,$amount);\r\n\r\n //Create Transaction\r\n Transaction::createTransaction($project->consultant_id, $client->id, '', 'PAYMENT-MADE-CLIENT', '', $project->id, $client->email, '', 'SYSTEM', $client->phone, $amount);\r\n\r\n //Generate contract and sold report if contract is paid full and signed and Send Emails\r\n if($contract->type==\"PPA\")\r\n {\r\n //PPA Client Services\r\n $clientS = Consultant::where('usr','clientservices')->first();\r\n if($clientS!=null){\r\n $msgInbox = \"PPA Payment received.\\r\\n\";\r\n $msgInbox .= date(\"m-d-Y H:i:s\").\"\\r\\n\";\r\n $msgInbox .= \"File #:\".$project->lead->fileno.\"\\r\\n\";\r\n $msgInbox .= \"Pin #:\".$project->id.\"\\r\\n\";\r\n $msgInbox .= \"Client: \".$project->lead->fname.\" \".$project->lead->lname.\"\\r\\n\";\r\n $msgInbox .= \"Amount: \".$amount.\"\\r\\n\";\r\n $msgInbox .= \"PPA Paid To Date: \".$contract->paid.\"\\r\\n\";\r\n Inbox::createInbox($client->id,$clientS->id,$msgInbox,\"PAYMENT\",\"CLIENT\");\r\n }\r\n //END\r\n\r\n\r\n $msgInbox = \"PPA Payment made By Client.\\r\\n\";\r\n $msgInbox .= date(\"m-d-Y H:i:s\").\"\\r\\n\";\r\n $msgInbox .= \"File #:\".$project->lead->fileno.\"\\r\\n\";\r\n $msgInbox .= \"Pin: \".$project->id.\"\\r\\n\";\r\n $msgInbox .= \"Client: \".$project->lead->fname.\" \".$project->lead->lname.\"\\r\\n\";\r\n $msgInbox .= \"Amount: \".$amount.\"\\r\\n\";\r\n $msgInbox .= \"Type: \".$contract->type.\"\\r\\n\";\r\n Inbox::createInbox($project->lead->id, $project->consultant_id, $msgInbox, 'PAYMENT', 'CLIENT');\r\n\r\n //Send Email to George, ALain and Me\r\n $url = url(\"sendPaymentNotificationToAdminDocusign?ID=\".$contract->id);\r\n ToolsFunctions::curl($url);\r\n //Send Email to client\r\n $url = url(\"sendPaymentNotificationToClient?ID=\".$contract->id);\r\n ToolsFunctions::curl($url);\r\n return view('omi.payment.success',array('project'=>$project,'contract'=>$contract,'client'=>$client,'complete'=>0));\r\n }\r\n if($contract->type!=\"PPA\" && $contract->price>$contract->paid && strlen($contract->signed)>0){\r\n\r\n //send sms to consultant.\r\n PlivoHelper::consultantSmsOutPerPayment(16,$project->id,$amount);\r\n\r\n if($contract->type==\"IGUP\")\r\n {\r\n $projectP = $project->getProjectProduction();\r\n if($projectP!=null)\r\n {\r\n $projectP->contractType = 'IGUP';\r\n $projectP->completed = 0;\r\n $projectP->letterofengagement = 0;\r\n $projectP->save();\r\n }\r\n }\r\n\r\n if($contract->iigUpgrade == 1){\r\n $msg = \"IIG UPGRADE PAYMENT RECEIVED.\\r\\n\";\r\n $msg .= date(\"m-d-Y H:i:s\").\"\\r\\n\";\r\n $msg .= \"File #:\".$project->lead->fileno.\"\\r\\n\";\r\n $msg .= \"Pin: \".$project->id.\"\\r\\n\";\r\n $msg .= \"Amount: \".$contract->iigUpgradePrice.\"\\r\\n\";\r\n $msg .= \"Plan: \".($contract->iigUpgradePrice == 100 || $contract->iigUpgradePrice == 200)?'GOLD':'PLATINUM'.\"\\r\\n\";\r\n $msg .= \"Client: \".$project->lead->fname.\" \".$project->lead->lname.\"\\r\\n\";\r\n Inbox::createInbox($project->lead->id, 30, $msg, 'PAYMENT', 'PRODUCTION');\r\n\r\n if($contract->iigUpgradePrice == 330 || $contract->iigUpgradePrice == 230 || $contract->iigUpgradePrice == 300 || $contract->iigUpgradePrice == 500){\r\n $projectProd = ProjectProduction::where(array('project_id'=>$project->id,'typeVendor'=>'production'))->first();\r\n if($projectProd != null && $projectProd->sendDate != \"0000-00-00 00:00:00\"){\r\n $projectPW = ProjectProduction::where(array('project_id'=>$project->id,'typeVendor'=>'writer'))->first();\r\n if($projectPW != null){\r\n $projectPW->completed = 0;\r\n $projectPW->save();\r\n }\r\n $projectPD2 = ProjectProduction::where(array('project_id'=>$project->id,'typeVendor'=>'2D'))->first();\r\n if($projectPD2==null)\r\n {\r\n $designer2d = Consultant::where('rol','LIKE','%2D%')->first();\r\n $projectPD2 = new ProjectProduction();\r\n $projectPD2->project_id = $projectProd->project_id;\r\n $projectPD2->fileno = $projectProd->fileno;\r\n $projectPD2->typeVendor = '2D';\r\n $projectPD2->consultant_id = $designer2d->id;\r\n $projectPD2->contractType = $projectProd->contractType;\r\n $projectPD2->designer_id = $projectProd->designer_id;\r\n $projectPD2->designer2d_id = $designer2d->id;\r\n $projectPD2->writer_id = $projectProd->writer_id;\r\n $projectPD2->university_id = $projectProd->university_id;\r\n $projectPD2->attorney_id = $projectProd->attorney_id;\r\n $projectPD2->sendDate = date(\"Y-m-d H:i:s\");\r\n $projectPD2->save();\r\n\r\n $projectProd->designer2d_id = $designer2d->id;\r\n $projectProd->save();\r\n\r\n $msgInbox2d = \"NEW FILES AVAILABLE.\\r\\n\";\r\n $msgInbox2d .= date(\"m-d-Y H:i:s\").\"\\r\\n\";\r\n $msgInbox2d .= \"Files #:\".$projectProd->fileno;\r\n Inbox::createInbox($projectProd->consultant_id, $projectPD2->designer2d_id, $msgInbox2d, 'PRODUCTION', 'PRODUCTION');\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n $msgInbox = \"INVENTOR PAID.PLEASE NOTIFY ALAIN.\\r\\n\";\r\n $msgInbox .= date(\"m-d-Y H:i:s\").\"\\r\\n\";\r\n $msgInbox .= \"File #:\".$project->lead->fileno.\"\\r\\n\";\r\n $msgInbox .= \"Pin: \".$project->id.\"\\r\\n\";\r\n $msgInbox .= \"Client: \".$project->lead->fname.\" \".$project->lead->lname.\"\\r\\n\";\r\n $msgInbox .= \"Amount: \".$amount.\"\\r\\n\";\r\n $msgInbox .= \"Type: \".$contract->type.\"\\r\\n\";\r\n Inbox::createInbox($project->lead->id, $project->consultant_id, $msgInbox, 'PAYMENT', 'CLIENT');\r\n\r\n CreateContractSignedHelper::generateSoldReport ($contract);\r\n\r\n //Send Email to George, ALain and Me\r\n $url = url(\"sendPaymentNotificationToAdminDocusign?ID=\".$contract->id);\r\n ToolsFunctions::curl($url);\r\n //Send Email to client\r\n $url = url(\"sendPaymentNotificationToClient?ID=\".$contract->id);\r\n ToolsFunctions::curl($url);\r\n\r\n return view('omi.payment.success',array('project'=>$project,'contract'=>$contract,'client'=>$this->client,'complete'=>1));\r\n }\r\n if($contract->price<=$contract->paid && strlen($contract->signed)>0)\r\n {\r\n if($contract->type==\"IGUP\")\r\n {\r\n $projectP = $project->getProjectProduction();\r\n if($projectP!=null)\r\n {\r\n $projectP->contractType = 'IGUP';\r\n $projectP->completed = 0;\r\n $projectP->save();\r\n }\r\n }\r\n\r\n //when someone upgrade from IIG to IIG: notify production and if is to platinum package send back to writer for press release and create row for 2D\r\n if($contract->iigUpgrade == 1){\r\n $msg = \"IIG UPGRADE PAYMENT RECEIVED.\\r\\n\";\r\n $msg .= date(\"m-d-Y H:i:s\").\"\\r\\n\";\r\n $msg .= \"File #:\".$project->lead->fileno.\"\\r\\n\";\r\n $msg .= \"Pin: \".$project->id.\"\\r\\n\";\r\n $msg .= \"Amount: \".$contract->iigUpgradePrice.\"\\r\\n\";\r\n $msg .= \"Plan: \".($contract->iigUpgradePrice == 100 || $contract->iigUpgradePrice == 200)?'GOLD':'PLATINUM'.\"\\r\\n\";\r\n $msg .= \"Client: \".$project->lead->fname.\" \".$project->lead->lname.\"\\r\\n\";\r\n Inbox::createInbox($project->lead->id, 30, $msg, 'PAYMENT', 'PRODUCTION');\r\n\r\n if($contract->iigUpgradePrice == 330 || $contract->iigUpgradePrice == 230 || $contract->iigUpgradePrice == 300 || $contract->iigUpgradePrice == 500){\r\n $projectProd = ProjectProduction::where(array('project_id'=>$project->id,'typeVendor'=>'production'))->first();\r\n if($projectProd != null && $projectProd->sendDate != \"0000-00-00 00:00:00\"){\r\n $projectPW = ProjectProduction::where(array('project_id'=>$project->id,'typeVendor'=>'writer'))->first();\r\n if($projectPW != null){\r\n $projectPW->completed = 0;\r\n $projectPW->save();\r\n }\r\n $projectPD2 = ProjectProduction::where(array('project_id'=>$project->id,'typeVendor'=>'2D'))->first();\r\n if($projectPD2==null)\r\n {\r\n $designer2d = Consultant::where('rol','LIKE','%2D%')->first();\r\n $projectPD2 = new ProjectProduction();\r\n $projectPD2->project_id = $projectProd->project_id;\r\n $projectPD2->fileno = $projectProd->fileno;\r\n $projectPD2->typeVendor = '2D';\r\n $projectPD2->consultant_id = $designer2d->id;\r\n $projectPD2->contractType = $projectProd->contractType;\r\n $projectPD2->designer_id = $projectProd->designer_id;\r\n $projectPD2->designer2d_id = $designer2d->id;\r\n $projectPD2->writer_id = $projectProd->writer_id;\r\n $projectPD2->university_id = $projectProd->university_id;\r\n $projectPD2->attorney_id = $projectProd->attorney_id;\r\n $projectPD2->sendDate = date(\"Y-m-d H:i:s\");\r\n $projectPD2->save();\r\n\r\n $projectProd->designer2d_id = $designer2d->id;\r\n $projectProd->save();\r\n\r\n $msgInbox2d = \"NEW FILES AVAILABLE.\\r\\n\";\r\n $msgInbox2d .= date(\"m-d-Y H:i:s\").\"\\r\\n\";\r\n $msgInbox2d .= \"Files #:\".$projectProd->fileno;\r\n Inbox::createInbox($projectProd->consultant_id, $projectPD2->designer2d_id, $msgInbox2d, 'PRODUCTION', 'PRODUCTION');\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n $msgInbox = \"INVENTOR PAID IN FULL CONTRACT SIGNED.\\r\\n\";\r\n $msgInbox .= date(\"m-d-Y H:i:s\").\"\\r\\n\";\r\n $msgInbox .= \"File #:\".$project->lead->fileno.\"\\r\\n\";\r\n $msgInbox .= \"Pin: \".$project->id.\"\\r\\n\";\r\n $msgInbox .= \"Client: \".$project->lead->fname.\" \".$project->lead->lname.\"\\r\\n\";\r\n $msgInbox .= \"Amount: \".$amount.\"\\r\\n\";\r\n $msgInbox .= \"Type: \".$contract->type.\"\\r\\n\";\r\n Inbox::createInbox($project->lead->id, $project->consultant_id, $msgInbox, 'PAYMENT', 'CLIENT');\r\n\r\n CreateContractSignedHelper::generateSoldReport ($contract);\r\n //Send Email to George, ALain and Me\r\n $url = url(\"sendPaymentNotificationToAdminDocusign?ID=\".$contract->id);\r\n ToolsFunctions::curl($url);\r\n //Send Email to client\r\n $url = url(\"sendPaymentNotificationToClient?ID=\".$contract->id);\r\n ToolsFunctions::curl($url);\r\n return view('omi.payment.success',array('project'=>$project,'contract'=>$contract,'client'=>$client,'complete'=>1));\r\n }\r\n else if($contract->price<=$contract->paid)\r\n {\r\n $msgInbox = \"INVENTOR PAID IN FULL - CONTRACT NOT SIGNED.\\r\\n\";\r\n $msgInbox .= date(\"m-d-Y H:i:s\").\"\\r\\n\";\r\n $msgInbox .= \"File #:\".$project->lead->fileno.\"\\r\\n\";\r\n $msgInbox .= \"Pin: \".$project->id.\"\\r\\n\";\r\n $msgInbox .= \"Client: \".$project->lead->fname.\" \".$project->lead->lname.\"\\r\\n\";\r\n $msgInbox .= \"Amount: \".$amount.\"\\r\\n\";\r\n $msgInbox .= \"Type: \".$contract->type.\"\\r\\n\";\r\n Inbox::createInbox($project->lead->id, $project->consultant_id, $msgInbox, 'PAYMENT', 'CLIENT');\r\n\r\n //send the different price of the plans\r\n $prices = PpaPricesPlan::where('plan1', 'like',$contract->price)->orWhere('plan2', 'like',$contract->price)->orWhere('plan3', 'like',$contract->price)->first();\r\n return view('omi.launch.sign',array('prices'=>$prices,'client'=>$client,'project'=>$project,'contract'=>$contract,'from'=>'sign'));\r\n }\r\n else\r\n {\r\n $msgInbox = \"INVENTOR PARTIAL PAYMENT.\\r\\n\";\r\n $msgInbox .= date(\"m-d-Y H:i:s\").\"\\r\\n\";\r\n $msgInbox .= \"File #:\".$project->lead->fileno.\"\\r\\n\";\r\n $msgInbox .= \"Pin: \".$project->id.\"\\r\\n\";\r\n $msgInbox .= \"Client: \".$project->lead->fname.\" \".$project->lead->lname.\"\\r\\n\";\r\n $msgInbox .= \"Amount: \".$amount.\"\\r\\n\";\r\n $msgInbox .= \"Type: \".$contract->type.\"\\r\\n\";\r\n Inbox::createInbox($project->lead->id, $project->consultant_id, $msgInbox, 'PAYMENT', 'CLIENT');\r\n return view('omi.payment.success',array('project'=>$project,'contract'=>$contract,'client'=>$client,'complete'=>0));\r\n }\r\n }\r\n return view('omi.payment.index',array('project'=>$project,'contract'=>$contract,'client'=>$client,'error'=>\"Payment Failed.\"));\r\n\r\n }", "public static function captureTransaction($transactionId, $paymentMode = 'CPT', $comment = null)\n {\n $instance = self::getInstance();\n $transaction = self::getTransactionInformations($transactionId);\n $transactionTime = self::getTimestampFromPaylineDate($transaction['transaction']['date']);\n\n $params = array(\n 'version' => self::API_VERSION,\n 'transactionID' => $transactionId,\n 'payment' => array(\n 'amount' => $transaction['payment']['amount'],\n 'currency' => $transaction['payment']['currency'],\n 'mode' => $paymentMode,\n 'contractNumber' => $transaction['payment']['contractNumber'],\n ),\n 'sequenceNumber' => null,\n 'comment' => $comment,\n );\n\n if (time() >= strtotime('+7 day', $transactionTime)) {\n // Do re-autorization\n $params['payment']['action'] = 101;\n $params['order'] = $transaction['order'];\n $result = $instance->doReAuthorization($params);\n } else {\n // Do capture\n $params['payment']['action'] = 201;\n $result = $instance->doCapture($params);\n }\n\n return $result;\n }", "function getfaircoin_trigger_purchase_receipt( $payment_id ) {\r\n remove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999, 1 );\r\n\t// Make sure we don't send a purchase receipt while editing a payment\r\n\tif ( isset( $_POST['edd-action'] ) && 'edit_payment' == $_POST['edd-action'] )\r\n\t\treturn;\r\n\r\n $gateway = edd_get_payment_gateway( $payment_id );\r\n if( $gateway == 'paypal'){\r\n // Send email with secure download link\r\n edd_email_purchase_receipt( $payment_id );\r\n } else {\r\n return;\r\n }\r\n}", "public function reject_invoice()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (isset($_POST)) {\n\t\t\t\t$id = base64_decode($_POST['id']);\n\t\t\t\t$remark = validateInput($_POST['reason']);\n\t\t\t\tif ($remark != '' && $remark != null) {\n\t\t\t\t\t$tableName = 'master_invoice';\n\t\t\t\t\t$condition = array('send_status' => SENT, 'id' => $id);\n\t\t\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t\t\t\tif ($result > 0) {\n\t\t\t\t\t\t$data = array('send_status' => REJECTED, 'reject_reason' => $remark);\n\t\t\t\t\t\t$res = $this->CustomModel->update_table($tableName, $condition, $data);\n\t\t\t\t\t\tif ($res > 0) {\n\t\t\t\t\t\t\techo $response = json_encode(array('message' => 'Success! Invoices rejected', 'type' => 'success'), true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo $response = json_encode(array('message' => 'Error! Opps... Contact IT', 'type' => 'error'), true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo $response = json_encode(array('message' => 'Error! Reject reason is required..', 'type' => 'danger'), true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo $response = json_encode(array('message' => 'Error! Opps... Something went wrong, contact IT', 'type' => 'danger'), true);\n\t\t\t}\n\t\t}\n\t}", "public function execute() {\n\n $id = trim((string)$this->getRequest()->getParam('transId', NULL));\n $refId = (int)trim((string)$this->getRequest()->getParam('refId', NULL));\n\n if (!$id || !$refId) {\n http_response_code(400);\n die('Invalid response');\n }\n\n $service = $this->config->getComGateService();\n try {\n $status = $service->getStatus($id);\n }\n catch(\\Exception $e) {\n $status = false;\n }\n\n if (!$status) {\n http_response_code(400);\n die('Malformed response');\n }\n\n $order_id = (int)@$status['refId'];\n $order = $this->getOrder($order_id);\n if (!$order->getId()) {\n http_response_code(400);\n\n //trigger_error('No Order [' . $order_id . ']');\n die('No Order');\n }\n\n $response = $this->createResponse();\n\n if (!in_array($order->getStatus() , array(\n \\Magento\\Sales\\Model\\Order::STATE_NEW,\n \\Magento\\Sales\\Model\\Order::STATE_HOLDED,\n \\Magento\\Sales\\Model\\Order::STATE_PENDING_PAYMENT,\n \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW\n ))) {\n\n $response->setHttpResponseCode(200);\n return $response;\n }\n\n if (!empty($status['code'])) {\n http_response_code(400);\n die('Payment error');\n }\n\n if (($status['price'] != round($order->getGrandTotal() * 100)) || ($status['curr'] != $order->getOrderCurrency()->getCurrencyCode())) {\n http_response_code(400);\n die('Payment sum or currency mismatch');\n }\n\n $invoice = $order->getInvoiceCollection()->getFirstItem();\n $payment = $order->getPayment();\n\n if (($status['status'] == 'CANCELLED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_HOLDED)) {\n\n $payment->getMethodInstance()->cancel($payment);\n\n $order->addStatusHistoryComment('ComGate (notification): Payment failed');\n $order->save();\n }\n else if (($status['status'] == 'PAID') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PROCESSING)) {\n \n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->capture();\n\n $order->addStatusHistoryComment('ComGate (notification): Payment success');\n $order->save();\n }\n else if (($status['status'] == 'AUTHORIZED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW)) {\n\n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->getMethodInstance()->authorize($payment, $order->getGrandTotal());\n\n $order->addStatusHistoryComment('ComGate (notification): Payment authorized');\n $order->save();\n }\n\n $response->setHttpResponseCode(200);\n return $response;\n }", "public function realInvoice()\n {\n $invoice = Invoice::first();\n\n if (!$invoice) {\n return response()->json([\n 'error' => 'Please run php artisan db:seed to fake some invoices.'\n ]);\n }\n\n $response = Simulate::request($invoice->amount)\n ->from(254708374149)\n ->usingReference($invoice->number)\n ->setCommand(CUSTOMER_PAYBILL_ONLINE)\n ->push();\n\n return response()->json([\n 'response' => $response,\n 'next' => 'Please check your ngrok endpoints and validate that BOTH the validate and confirm endpoint will be called. Also check the Transactions table.'\n ]);\n }", "public function accept_invoice()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (isset($_POST)) {\n\t\t\t\t$id = base64_decode($_POST['id']);\n\t\t\t\t// print_r($id);\n\t\t\t\t$tableName = 'master_invoice';\n\t\t\t\t$timestamp = date(\"Y-m-d H:i:s\");\n\t\t\t\tif (isset($id)) {\n\t\t\t\t\t$status = array('send_status' => ACCEPT);\n\t\t\t\t\t$condition = array('id' => $id);\n\t\t\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition); // Checking row into the data base\n\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'invoice_number' => $result[0]['invoice_number'],\n\t\t\t\t\t\t'item_code' => $result[0]['product_code'],\n\t\t\t\t\t\t'invoice_date' => $result[0]['doi'],\n\t\t\t\t\t\t'item_description' => $result[0]['product_description'],\n\t\t\t\t\t\t'qty' => $result[0]['product_qty'],\n\t\t\t\t\t\t'closing_stock' => $result[0]['product_qty'],\n\t\t\t\t\t\t'amount' => $result[0]['product_amount'],\n\t\t\t\t\t\t'rate' => $result[0]['product_rate'],\n\t\t\t\t\t\t'update_by' => $_SESSION['userInfo']['username'],\n\t\t\t\t\t\t'last_updated' => $timestamp\n\t\t\t\t\t);\n\n\t\t\t\t\t$tablename = 'london_stock';\n\t\t\t\t\t$inr_data = $this->CustomModel->insertInto($tablename, $data);\n\n\t\t\t\t\tif ($inr_data > 0) {\n\t\t\t\t\t\t$res = $this->CustomModel->update_table($tableName, $condition, $status); //Updating the accept status \n\t\t\t\t\t\techo json_encode(array('message' => 'Invoice accepted and stock updated successfuly', 'type' => 'success'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo json_encode(array('message' => 'Something went worng please contact IT', 'type' => 'danger'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function quickbooksms_authorize_payment($params)\n\t{\n\t\t$this->_api_method = 'CustomerCreditCardAuthRq';\n\t\t$this->_request = $this->_build_request($params);\t\t\t\n\t\treturn $this->_handle_query();\n\t}", "public function stripeInvoice($invoiceId)\n {\n $pdf_link = $this->stripePlan->getInvoicePDF($invoiceId);\n return redirect($pdf_link);\n }", "public function acceptPayment($invoice)\n {\n $order = Order::with(['payment'])->where('invoice', $invoice)->first();\n //UBAH STATUS DI TABLE PAYMENTS MELALUI ORDER YANG TERKAIT\n $order->payment()->update(['status' => 1]);\n //UBAH STATUS ORDER MENJADI PROSES\n $order->update(['status' => 2]);\n //REDIRECT KE HALAMAN YANG SAMA.\n return redirect(route('orders.view', $order->invoice));\n }", "public function export_generate_invoice($id) {\n if (empty($id)) {\n //return show_404();\n // above is commented & below code is added by shubhranshu for 404 issue while payment not required\n $this->session->set_flashdata('error', 'Oops! Invoice is not available since payment is not required!');\n redirect(\"accounting/generate_invoice/\");\n }\n $result = $this->get_payid_details($id, 1);\n //print_r($result);exit;\n $this->load->helper('pdf_reports_helper');\n $tenant_id = $this->tenant_id;\n if($tenant_id =='T17'){\n generate_pdf_invoice_everest($result);\n }else{\n generate_pdf_invoice($result);\n }\n \n }", "public function sendMileStoneInvoiceToClient($project_id, $project_payment){\n \n\t\t\t$logedInuser = Auth::user();\n $project = Project::where('id',$project_id)->where('user_id', $logedInuser->id)->first();\n\t $admincomission = $this->comission->getComission();\n\t $pdf =$this->project->returnClientInvoicePdf($project, $project_payment, $admincomission);\n\t \n $email = $logedInuser->email;\n $client_name = $logedInuser->first_name;\n\n $data[\"email\"]= $email;\n $data[\"subject\"]='Milestone Invoice';\n $data[\"client_name\"]=$client_name;\n try{\n \\Mail::send('EmailTemplate.milestone-invoice', $data, function($message)use($data,$pdf) {\n $message->to($data[\"email\"], $data[\"client_name\"])\n ->subject($data[\"subject\"])\n ->attachData($pdf->output(), \"Invoice.pdf\");\n });\n }catch(\\Exception $exception){\n // \n }\n }", "public function paymentScreen( \\IPS\\nexus\\Invoice $invoice, \\IPS\\nexus\\Money $amount, \\IPS\\Member $member = NULL, $recurrings = array() )\n\t{\n\t\t\\IPS\\Output::i()->jsFiles = array_merge( \\IPS\\Output::i()->jsFiles, \\IPS\\Output::i()->js( 'global_gateways.js', 'nexus', 'global' ) );\n\t\t\n\t\t$return = array();\n\t\t$settings = json_decode( $this->settings, TRUE );\n\t\t\n\t\t/* Accepted types */\n\t\tif( $settings['processor'] )\n\t\t{\n\t\t\t$types = array();\n\t\t\t\n\t\t\tif ( in_array( $settings['processor'], array( 1, 2, 3, 4, 5, 6, 7 ) ) )\n\t\t\t{\n\t\t\t\t$types[] = \\IPS\\nexus\\CreditCard::TYPE_AMERICAN_EXPRESS;\n\t\t\t\t$types[] = \\IPS\\nexus\\CreditCard::TYPE_DINERS_CLUB;\n\t\t\t\t$types[] = \\IPS\\nexus\\CreditCard::TYPE_DISCOVER;\n\t\t\t\t$types[] = \\IPS\\nexus\\CreditCard::TYPE_JCB;\n\t\t\t}\n\t\t\telseif ( in_array( $settings['processor'], array( 9, 13 ) ) )\n\t\t\t{\n\t\t\t\t$types[] = \\IPS\\nexus\\CreditCard::TYPE_JCB;\n\t\t\t}\n\t\t\t\n\t\t\t$types[] = \\IPS\\nexus\\CreditCard::TYPE_MASTERCARD;\n\t\t\t$types[] = \\IPS\\nexus\\CreditCard::TYPE_VISA;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$types = array( \\IPS\\nexus\\CreditCard::TYPE_AMERICAN_EXPRESS, \\IPS\\nexus\\CreditCard::TYPE_DINERS_CLUB, \\IPS\\nexus\\CreditCard::TYPE_DISCOVER, \\IPS\\nexus\\CreditCard::TYPE_JCB, \\IPS\\nexus\\CreditCard::TYPE_MASTERCARD, \\IPS\\nexus\\CreditCard::TYPE_VISA );\n\t\t}\n\t\t$options = array( 'types' => $types, 'member' => $member );\n\t\t\n\t\t/* If we're using DPM, we include all that data in here */\n\t\tif ( $settings['method'] == 'DPM' )\n\t\t{\n\t\t\t$timestamp = time();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$options['jsRequired']\t= TRUE;\n\t\t\t$options['names']\t\t= FALSE;\n\t\t\t$options['attr']\t\t= array(\n\t\t\t\t'data-controller'\t=> 'nexus.global.gateways.authorizenet',\n\t\t\t\t'data-id'\t\t\t=> $this->id,\n\t\t\t\t'class'\t\t\t\t=> 'ipsHide',\n\t\t\t\t'data-url'\t\t\t=> \\IPS\\NEXUS_TEST_GATEWAYS ? 'https://test.authorize.net/gateway/transact.dll' : 'https://secure.authorize.net/gateway/transact.dll',\n\t\t\t\t'data-fields'\t\t=> json_encode( array(\n\t\t\t\t\t'x_login'\t\t\t=> $settings['login'],\n\t\t\t\t\t'x_version'\t\t\t=> '3.1',\n\t\t\t\t\t'x_type'\t\t\t=> 'AUTH_ONLY',\n\t\t\t\t\t'x_method'\t\t\t=> 'CC',\n\t\t\t\t\t'x_amount'\t\t\t=> (string) $amount->amount,\n\t\t\t\t\t'x_currency_code'\t=> $amount->currency,\n\t\t\t\t\t'x_fp_hash'\t\t\t=> hash_hmac( 'md5', \"{$settings['login']}^{$invoice->id}^{$timestamp}^{$amount->amount}^{$amount->currency}\", $settings['tran_key'] ),\n\t\t\t\t\t'x_fp_sequence'\t\t=> $invoice->id,\n\t\t\t\t\t'x_fp_timestamp'\t=> $timestamp,\n\t\t\t\t\t'x_invoice_num'\t\t=> $invoice->id,\n\t\t\t\t\t'x_first_name'\t\t=> $invoice->member->cm_first_name,\n\t\t\t\t\t'x_last_name'\t\t=> $invoice->member->cm_last_name,\n\t\t\t\t\t'x_address'\t\t\t=> $invoice->billaddress ? implode( ', ', $invoice->billaddress->addressLines ) : '',\n\t\t\t\t\t'x_city'\t\t\t=> $invoice->billaddress ? $invoice->billaddress->city : '',\n\t\t\t\t\t'x_state'\t\t\t=> $invoice->billaddress ? $invoice->billaddress->region : '',\n\t\t\t\t\t'x_zip'\t\t\t\t=> $invoice->billaddress ? $invoice->billaddress->postalCode : '',\n\t\t\t\t\t'x_country'\t\t\t=> $invoice->billaddress ? $invoice->billaddress->country : '',\n\t\t\t\t\t'x_phone'\t\t\t=> $invoice->member->cm_phone,\n\t\t\t\t\t'x_email'\t\t\t=> $invoice->member->email,\n\t\t\t\t\t'x_email_customer'\t=> 'FALSE',\n\t\t\t\t\t'x_cust_id'\t\t\t=> $invoice->member->member_id,\n\t\t\t\t\t'x_customer_ip'\t\t=> \\IPS\\Request::i()->ipAddress(),\n\t\t\t\t\t'x_relay_response'\t=> 'TRUE',\n\t\t\t\t\t'x_relay_url'\t\t=> \\IPS\\Settings::i()->base_url . 'applications/nexus/interface/gateways/authorize.php',\n\t\t\t\t) )\n\t\t\t);\n\t\t\t\n\t\t}\n\t\t\n\t\t/* If we're using AIM, we might be able to save */\n\t\telseif ( $this->canStoreCards() and \\IPS\\Member::loggedIn()->member_id )\n\t\t{\n\t\t\t$options['save'] = $this;\n\t\t\t$options['member'] = $invoice->member;\n\t\t}\n\t\t\n\t\t/* And then return the card field */\n\t\t$return['card'] = new \\IPS\\nexus\\Form\\CreditCard( $this->id . '_card', NULL, FALSE, $options );\n\t\treturn $return;\n\t}", "public static function continue_payment_after_creditcard($order_id)\n {\n $obj = new ReciptController;\n $Recipt = Recipt::whereId($order_id)->where('is_init_for_card_payment','1')->latest()->first();\n $ShoppingCart = ShoppingCart::where( 'member_id', $Recipt->member_id )->get();\n $discount = $obj->get_discount($Recipt->member_id);\n\n return $obj->continue_checkout($Recipt,$ShoppingCart,$discount);\n }", "public function capture($transactionId, $orderId, $description, array $options = array())\n {\n $params = $options;\n\n $params['IDENTIFIER'] = $this->identifier;\n $params['OPERATIONTYPE'] = 'capture';\n $params['VERSION'] = self::API_VERSION;\n $params['DESCRIPTION'] = $description;\n $params['TRANSACTIONID'] = $transactionId;\n $params['ORDERID'] = $orderId;\n\n $params['HASH'] = $this->hash($params);\n\n return $this->requests($this->getDirectLinkUrls(), $params);\n }", "public function authorizeCapture($transaction)\n {\n \n $return = array(\n 'authorized' => 0,\n 'authorization_code' => '',\n 'transaction_id' => '',\n 'message' => ''\n );\n\n $products = array(); \n\n !is_object($transaction) ? $transaction = (object) $transaction : false;\n\n !empty($transaction->transaction_mode) ? $this->setServer($transaction->transaction_mode) : false; \n !empty($transaction->transaction_id) ? $id = $transaction->transaction_id : $id = $this->login;\n !empty($transaction->transaction_pw) ? $pw = $transaction->transaction_pw : $pw = $this->password;\n\n $this->payment->cc_number = $this->scrubVar($this->payment->cc_number);\n\n if($transacton['exception']) { \n \n $aEntry = array(\n 'id' => $transaction->item_id,\n 'name' => $transaction->item_name,\n 'desc' => $transaction->item_desc,\n 'qty' => $transaction->item_qty,\n 'price' => $transaction->amount,\n 'taxable' => $transaction->item_taxable\n ); \n $products[] = \"x_line_item=\".urlencode( implode( '<|>', $aEntry)) . '&'; \n\n $this->cart->total = $transaction->amount;\n\n } else {\n\n if (is_array($this->cart->items)) {\n $amount = 0;\n $nLoop = 0;\n foreach ($this->cart->items AS $cKey => $aItem ) { \n $aItem = (array) $aItem; \n $itemPrice = ($aItem['price'] + $aItem['setupfee'] + $aItem['handle_charge'] + $aItem['gift_charge']);\n if ( $nLoop < 30 ) { \n $nLoop++;\n $aEntry = array(\n 'id' => 'item'.$nLoop,\n 'name' => substr(trim($aItem['sku']), 0, 28 ),\n 'desc' => substr( $aItem['title'].' '.strip_tags( $aItem['attribute_text'] ), 0, 254 ),\n 'qty' => $aItem['qty'],\n 'price' => $itemPrice,\n 'taxable' => $aItem['taxable']\n ); \n $products[] = \"x_line_item=\".urlencode( implode( '<|>', $aEntry)) . '&'; \n\n }\n $amount += ($aItem['qty'] * $itemPrice); \n } \n\n $this->cart->amount = $amount;\n\n if ($this->cart->promotional_discount > 0) {\n $products = array();\n \n $aEntry = array(\n 'id' => 'item1',\n 'name' => 'DISCOUNT',\n 'desc' => 'Complex/Discounted transaction - ' . number_format($this->cart->promotional_discount,2),\n 'qty' => 1,\n 'price' => $this->cart->amount,\n 'taxable' => 1\n ); \n $products[] = \"x_line_item=\".urlencode( implode( '<|>', $aEntry)) . '&'; \n \n } \n\n $this->cart->total = (\n ($this->cart->amount + $this->cart->taxes + $this->cart->handle_charge + $this->cart->ship_charge) - \n $this->cart->promotional_discount);\n\n } else { \n \n $aEntry = array(\n 'id' => 'item1',\n 'name' => 'SIMPLE',\n 'desc' => 'NO ITEM INFORMATION PASSED',\n 'qty' => 1,\n 'price' => $this->cart->amount,\n 'taxable' => 1\n ); \n $products[] = \"x_line_item=\".urlencode( implode( '<|>', $aEntry)) . '&'; \n\n $this->cart->total = (\n ($this->cart->amount + $this->cart->taxes + $this->cart->handle_charge + $this->cart->ship_charge) - \n $this->cart->promotional_amount);\n } \n\n } \n\n empty($this->cart->amount) ? $this->cart->amount = '0.00' : $this->cart->amount = $this->scrubVar($this->cart->amount, 'MONEY');\n empty($this->cart->taxes) ? $this->cart->taxes = '0.00' : $this->cart->taxes = $this->scrubVar($this->cart->taxes, 'MONEY');\n empty($this->cart->handle_charge) ? $this->cart->handle_charge = '0.00' : $this->cart->handle_charge = $this->scrubVar($this->cart->handle_charge, 'MONEY');\n empty($this->cart->ship_charge) ? $this->cart->ship_charge = '0.00' : $this->cart->ship_charge = $this->scrubVar($this->cart->ship_charge, 'MONEY');\n // empty($this->cart->gift_charge) ? $this->cart->gift_charge = '0.00' : $this->cart->gift_charge = $this->scrubVar($this->cart->gift_charge, 'MONEY');\n\n $aAuthorizeNet = array (\n \"x_login\" => $id,\n \"x_version\" => \"3.1\",\n \"x_test_request\" => $cType,\n \"x_delim_char\" => \"|\",\n \"x_delim_data\" => \"TRUE\",\n \"x_url\" => \"FALSE\",\n \"x_type\" => \"AUTH_CAPTURE\",\n \"x_method\" => \"CC\",\n \"x_tran_key\" => $pw, // \n \"x_invoice_num\" => $this->cart->session,\n \"x_relay_response\" => \"FALSE\",\n \"x_card_num\" => $transaction->payment['cc_number'],\n \"x_card_code\" => $transaction->payment['cc_cvv2'],\n \"x_exp_date\" => $transaction->payment['cc_exp_month'] . $transaction->payment['cc_exp_year'],\n \"x_description\" => $transaction->journal,\n \"x_tax\" => \"Taxes|\" . $this->scrubVar($this->cart->taxes),\n \"x_freight\" => \"Freight<|>\" . strip_tags( stripslashes($this->cart->ship_carrier) . '/handling' ) . \"<|>\" . ($this->cart->ship_charge + $this->cart->handle_charge),\n \"x_amount\" => $this->scrubVar($this->cart->total),\n \"x_company\" => $this->cart->bill_company,\n \"x_first_name\" => $this->cart->bill_name_first,\n \"x_last_name\" => $this->cart->bill_name_last,\n \"x_address\" => $this->cart->bill_address_1,\n \"x_city\" => $this->cart->bill_address_city,\n \"x_state\" => $this->cart->bill_address_state, \n \"x_zip\" => $this->cart->bill_address_postal_code,\n \"x_country\" => $this->cart->bill_country_iso_3166,\n \"x_phone\" => $this->cart->bill_address_phone,\n \"x_fax\" => $this->cart->bill_address_altphone, \n \"x_email\" => $this->cart->bill_email,\n \"x_ship_to_first_name\" => $this->cart->ship_name_first,\n \"x_ship_to_last_name\" => $this->cart->ship_name_last,\n \"x_ship_to_address\" => $this->cart->ship_address_1,\n \"x_ship_to_city\" => $this->cart->ship_address_city,\n \"x_ship_to_state\" => $this->cart->ship_address_state,\n \"x_ship_to_zip\" => $this->cart->ship_address_postal_code,\n \"x_ship_to_country\" => $this->cart->ship_country_iso_3166,\n \"x_customer_ip\" => $_SERVER['REMOTE_ADDR']\n ); \n\n $query = http_build_query($aAuthorizeNet, '', '&') . '&' . implode($products); \n\n $http = $this->curl($this->server, $query, array(), 'POST');\n\n empty($http->response) ? $response = array() : $response = explode('|', trim($http->response));\n\n ($response[0] == 4) ? $response[0] = 1 : false; \n\n $return['amount'] = $this->scrubVar($this->cart->total);\n $return['authorized'] = $response[0];\n $return['authorization_code'] = $response[4];\n $return['transaction_type'] = 'AUTH_CAPTURE';\n $return['transaction_id'] = $response[6];\n $return['message'] = '[' . strtoupper(substr($id, -4)) . ':' . $response[2] . '] [' . substr($transaction->payment['cc_number'], -4) . ']' . $response[3];\n ($this->debug) ? $return['query'] = $query : false;\n ($this->debug) ? $return['response'] = json_encode($http->response) : false;\n\n return (object) $return;\n \n }", "public function actionPaymentcard()\n\t{ \n\t\t\n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t\t$invoiceModel = new Invoices;\n\t\t\t$payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n\t\t\t# Add 2% of the total in the invoice total for creditcard only\n\t\t\t$twoPercentAmount = ($payment[0]['payment_amount'] * 2)/100;\n\t\t\t$payment[0]['payment_amount'] += round($twoPercentAmount, 2);\n\t\t\t$this->render(\"cardForm\", array(\"payment\"=>$payment));\n \t\t}\n\t\t\n\t}", "protected function _captureAuthorized(Varien_Object $payment, $amount)\n {\n // Has the payment already been authorized?\n if ($payment->getCcTransId()) {\n // Convert the capture amount to the correct currency\n $captureAmount = $this->_getWrapper()->getCaptureAmount($payment->getOrder(), $amount);\n // Check to see if the transaction has already been captured\n $lastTransactionId = $payment->getLastTransId();\n if ($lastTransactionId) {\n try {\n $this->_getWrapper()->init($payment->getOrder()->getStoreId());\n $transaction = Braintree\\Transaction::find($lastTransactionId);\n // Has the transaction already been settled? or submitted for the settlement?\n // Also treat settling transaction as being process. Case #828048\n if (isset($transaction->id) &&\n (\n $transaction->status == Braintree\\Transaction::SUBMITTED_FOR_SETTLEMENT ||\n $transaction->status == Braintree\\Transaction::SETTLED ||\n $transaction->status == Braintree\\Transaction::SETTLING\n )\n ) {\n // Do the capture amounts match?\n if ($captureAmount == $transaction->amount) {\n // We can just approve the invoice\n $this->_updateKountStatus($payment, 'A');\n $payment->setStatus(self::STATUS_APPROVED);\n return $this;\n }\n }\n } catch (Exception $e) {\n // Unable to load transaction, so process as below\n }\n }\n // Has the authorization already been settled? Partial invoicing\n if ($this->authorizationUsed($payment)) {\n // Set the token as false\n $token = false;\n // Was the original payment created with a token?\n if ($additionalInfoToken = $payment->getAdditionalInformation('token')) {\n try {\n // Init the environment\n $this->_getWrapper()->init($payment->getOrder()->getStoreId());\n // Attempt to find the token\n Braintree\\PaymentMethod::find($additionalInfoToken);\n // Set the token if a success\n $token = $additionalInfoToken;\n } catch (Exception $e) {\n $token = false;\n }\n }\n // If we managed to find a token use that for the capture\n if ($token) {\n // Stop processing the rest of the method\n // We pass $amount instead of $captureAmount as the authorize function contains the conversion\n $this->_authorize($payment, $amount, true, $token);\n return $this;\n } else {\n // Attempt to clone the transaction\n $result = $this->_getWrapper()->init(\n $payment->getOrder()->getStoreId()\n )->cloneTransaction($lastTransactionId, $captureAmount);\n }\n } else {\n // Init the environment\n $result = $this->_getWrapper()->init(\n $payment->getOrder()->getStoreId()\n )->submitForSettlement($payment->getCcTransId(), $captureAmount);\n // Log the result\n Gene_Braintree_Model_Debug::log(array('capture:submitForSettlement' => $result));\n }\n if ($result->success) {\n $this->_updateKountStatus($payment, 'A');\n $this->_processSuccessResult($payment, $result, $amount);\n } elseif ($result->errors->deepSize() > 0) {\n // Clean up\n Gene_Braintree_Model_Wrapper_Braintree::cleanUp();\n Mage::throwException($this->_getWrapper()->parseErrors($result->errors->deepAll()));\n } else {\n // Clean up\n Gene_Braintree_Model_Wrapper_Braintree::cleanUp();\n Mage::throwException(\n $result->transaction->processorSettlementResponseCode.':\n '.$result->transaction->processorSettlementResponseText\n );\n }\n } else {\n // Otherwise we need to do an auth & capture at once\n $this->_authorize($payment, $amount, true);\n }\n return $this;\n }", "public function verify()\n {\n /**\n * Make a signature temporary\n * Note: each paid has it's own specific signature\n */\n $signature = $this->generate_signature(\n $this->merchant_id,\n $this->bank_receipt,\n $this->invoice_number\n );\n \n // Make proper array of token params\n $params = [\n 'SaleConf_req' => [\n 'MID' => $this->enc($this->merchant_id),\n 'CRN' => $this->enc($this->invoice_number),\n 'TRN' => $this->enc($this->bank_receipt),\n 'SIGNATURE' => base64_encode($signature),\n ],\n ];\n \n // Send params to bank to get token\n $result = $this->call($this->transaction_reference_wsdl, 'sendConfirmation', $params);\n\n if ($result['RESCODE'] == -1)\n throw new BankException('امضا دیچیتال نا معتبر است', -1);\n elseif ($result['RESCODE'] == -2)\n throw new BankException('آدرس IP پذیرنده نا معتبر است', -2);\n elseif (!in_array($result['RESCODE'], [0, 101]))\n throw new BankException(null, $result['RESCODE']); // خطاهای تعریف شده دیگر\n\n\n $data = $result['RESCODE'] . $result['REPETETIVE'] . $result['AMOUNT'] . $result['DATE'] . $result['TIME'] . $result['TRN'] . $result['STAN'];\n\n // State whether signature is okay or not\n $verify_result = openssl_verify($data, base64_decode($result['SIGNATURE']), $this->key_resource);\n\n if ($verify_result == 0)\n throw new BankException('خطای امضای دیجیتال');\n elseif ($verify_result != 1)\n throw new BankException('عدم تطبیق امضا دیجیتال بانک');\n\n /**\n * Result Webservice Array\n * if you need special design for your website, please modify following codes\n */\n if (!empty($result['RESCODE'])) {\n // success\n if (($result['RESCODE'] == '00') && ($result['successful'] == true)) {\n return new SaderatResult(\n true, // success\n $this->getInvoiceNumber(),\n $this->getBankReceiptNumber(),\n false // repetitive\n );\n } // cancel\n elseif ($result['RESCODE'] == 101) {\n throw new RepetitiveException(\n $this->getInvoiceNumber(),\n $this->getBankReceiptNumber()\n );\n } // cancel\n elseif ($result['RESCODE'] == 200) {\n throw new BankException('تراکنش توسط کاربر کنسل شده است');\n } // cancel\n elseif ($result['RESCODE'] == 107) {\n throw new BankException(null, 107);\n } // other problem\n elseif (!empty($result['description']))\n throw new BankException($result['description']);\n\n } else\n throw new BankException('درخواست نامعتبر است');\n\n }", "function invoice($student_id = '' , $param1 = '', $param2 = '', $param3 = '')\n\t\t{\n\t\t\t//if($this->session->userdata('parent_login')!=1)redirect(base_url() , 'refresh');\n\t\t\tif ($param1 == 'make_payment') {\n\t\t\t\t$invoice_id = $this->input->post('invoice_id');\n\t\t\t\t$system_settings = $this->db->get_where('settings', array(\n 'type' => 'paypal_email'\n\t\t\t\t))->row();\n\t\t\t\t$invoice_details = $this->db->get_where('invoice', array(\n 'invoice_id' => $invoice_id\n\t\t\t\t))->row();\n\t\t\t\t\n\t\t\t\t/****TRANSFERRING USER TO PAYPAL TERMINAL****/\n\t\t\t\t$this->paypal->add_field('rm', 2);\n\t\t\t\t$this->paypal->add_field('no_note', 0);\n\t\t\t\t$this->paypal->add_field('item_name', $invoice_details->title);\n\t\t\t\t$this->paypal->add_field('amount', $invoice_details->amount);\n\t\t\t\t$this->paypal->add_field('custom', $invoice_details->invoice_id);\n\t\t\t\t$this->paypal->add_field('business', $system_settings->description);\n\t\t\t\t$this->paypal->add_field('notify_url', base_url() . 'index.php?parents/invoice/paypal_ipn');\n\t\t\t\t$this->paypal->add_field('cancel_return', base_url() . 'index.php?parents/invoice/paypal_cancel');\n\t\t\t\t$this->paypal->add_field('return', base_url() . 'index.php?parents/invoice/paypal_success');\n\t\t\t\t\n\t\t\t\t$this->paypal->submit_paypal_post();\n\t\t\t\t// submit the fields to paypal\n\t\t\t}\n\t\t\tif ($param1 == 'paypal_ipn') {\n\t\t\t\tif ($this->paypal->validate_ipn() == true) {\n\t\t\t\t\t$ipn_response = '';\n\t\t\t\t\tforeach ($_POST as $key => $value) {\n\t\t\t\t\t\t$value = urlencode(stripslashes($value));\n\t\t\t\t\t\t$ipn_response .= \"\\n$key=$value\";\n\t\t\t\t\t}\n\t\t\t\t\t$data['payment_details'] = $ipn_response;\n\t\t\t\t\t$data['payment_timestamp'] = strtotime(date(\"m/d/Y\"));\n\t\t\t\t\t$data['payment_method'] = 'paypal';\n\t\t\t\t\t$data['status'] = 'paid';\n\t\t\t\t\t$invoice_id = $_POST['custom'];\n\t\t\t\t\t$this->db->where('invoice_id', $invoice_id);\n\t\t\t\t\t$this->db->update('invoice', $data);\n\t\t\t\t\t\n\t\t\t\t\t$data2['method']='paypal';\n\t\t\t\t\t$data2['invoice_id']=$_POST['custom'];\n\t\t\t\t\t$data2['timestamp']=strtotime(date(\"m/d/Y\"));\n\t\t\t\t\t$data2['payment_type']='income';\n\t\t\t\t\t$data2['title']=$this->db->get_where('invoice' , array('invoice_id' => $data2['invoice_id']))->row()->title;\n\t\t\t\t\t$data2['description']=$this->db->get_where('invoice' , array('invoice_id' => $data2['invoice_id']))->row()->description;\n\t\t\t\t\t$data2['student_id']=$this->db->get_where('invoice' , array('invoice_id' => $data2['invoice_id']))->row()->student_id;\n\t\t\t\t\t$data2['amount']=$this->db->get_where('invoice' , array('invoice_id' => $data2['invoice_id']))->row()->amount;\n\t\t\t\t\t$this->db->insert('payment' , $data2);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($param1 == 'paypal_cancel') {\n\t\t\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_cancelled'));\n\t\t\t\tredirect(base_url() . 'index.php?parents/invoice/' . $student_id, 'refresh');\n\t\t\t}\n\t\t\tif ($param1 == 'paypal_success') {\n\t\t\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_successfull'));\n\t\t\t\tredirect(base_url() . 'index.php?parents/invoice/' . $student_id, 'refresh');\n\t\t\t}\n\t\t\t$parent_profile = $this->db->get_where('parent', array(\n 'parent_id' => $this->session->userdata('parent_id')\n\t\t\t))->row();\n\t\t\t$page_data['student_id'] = $student_id;\n\t\t\t$page_data['page_name'] = 'invoice';\n\t\t\t$page_data['page_title'] = get_phrase('manage_invoice/payment');\n\t\t\t$this->load->view('backend/index', $page_data);\n\t\t}", "public function sendInvoice( $invoice_id )\n\t{\n\t\t$invoiceModel = new Invoices;\n\t\t$customerModel = new Customers;\n\t\t$invoice = $invoiceModel->find(\"pk_invoice_id = \".$invoice_id);\n\t\t$customer = $customerModel->find('pk_customer_id = '.$invoice->fk_customer_id);\n\t\t\n \t\t$body = \"<p> Thank You for your payment made for purchase of \".$invoice->invoice_description.\". \n\t\t \t\t\t Please find attached fully paid invoice No.<b>\".$invoice_id .\"</b>. </p> \n\t\t \t\t\t <p> You have paid <b> &pound;\". $invoice->invoice_total.\"</b> through Direct Debit on \".date(\"d/m/Y H:i:s\").\".</p>\";\t\t\t \n \t\t # Email Template\n\t\t// $template = $template = $this->renderPartial(\"mail_register\", null, true);\n\t\t $template = file_get_contents(Yii::app()->getBaseUrl(true).\"/email_template/email_template.html\");\n\t\t $template = str_replace(\"#from_name#\", $customer->firstname.' '. $customer->lastname, $template); \n\t\t $template = str_replace(\"#message#\", $body, $template);\n\t\t \n\t\t \n\t\t # ======================================================================= \n\t\t # Send PDF file in attachment \n\t\t # =======================================================================\n\t\t $email_message = $template;\n\t\t $file = \"downloads/invoice_\".$invoice_id.\".pdf\";\n\t\t $invoicef = file_get_contents(Yii::app()->getBaseUrl(true).'/index.php/invoice/viewpdf/id/'.$invoice_id);\n \t\t $ftp = fopen($file, \"w\");\n\t\t fwrite($ftp, $invoicef);\n\t\t fclose($ftp); \n\t\t \n\t\t$from_name='Centrica IT';\n \t$from_mail='[email protected]';\n \t$replyto='[email protected]';\n \t$filename= basename($file);\n \n \t$file_size = filesize($file);\n \t$handle = fopen($file, \"r\");\n \t$content = fread($handle, $file_size);\n \tfclose($handle);\n \t$content = chunk_split(base64_encode($content));\n \t$uid = md5(uniqid(time()));\n\t\t$name = basename($file);\n\t\t$header = \"From: \".$from_name.\" <\".$from_mail.\">\\r\\n\";\n\t\t$header .= \"Reply-To: \".$replyto.\"\\r\\n\";\n\t\t$header .= \"MIME-Version: 1.0\\r\\n\";\n\t\t$header .= \"Content-Type: multipart/mixed; boundary=\\\"\".$uid.\"\\\"\\r\\n\\r\\n\";\n\t\t$header .= \"This is a multi-part message in MIME format.\\r\\n\";\n\t\t$header .= \"--\".$uid.\"\\r\\n\";\n\t\t$header .= \"Content-type:text/html; charset=iso-8859-1\\r\\n\";\n\t\t$header .= \"Content-Transfer-Encoding: 7bit\\r\\n\\r\\n\";\n\t\t$header .= $email_message.\"\\r\\n\\r\\n\";\n\t\t$header .= \"--\".$uid.\"\\r\\n\";\n\t\t$header .= \"Content-Type: application/octet-stream; name=\\\"\".$filename.\"\\\"\\r\\n\"; // use different content types here\n\t\t$header .= \"Content-Transfer-Encoding: base64\\r\\n\";\n\t\t$header .= \"Content-Disposition: attachment; filename=\\\"\".$filename.\"\\\"\\r\\n\\r\\n\";\n\t\t$header .= $content.\"\\r\\n\\r\\n\";\n\t\t$header .= \"--\".$uid.\"--\";\n\t\t \n\t\t \n\t\t //$name='=?UTF-8?B?'.base64_encode(\"Centrica-IT\").'?=';\n\t\t $subject='=?UTF-8?B?'.base64_encode('Your payment with Centrica IT Successfully Completed').'?=';\n\t\t #. 1. Email to current user\n\t\t @mail($customer->email, $subject, $email_message, $header, \"-f [email protected]\");\n\t\t \n\t\t #. 2. Email to Admin user\n\t\t if($customer->parent_id > 0) \n\t\t {\n\t\t \t$customer2 = $customerModel->find('pk_customer_id = '.$customer->parent_id);\n\t\t\t$template = file_get_contents(Yii::app()->getBaseUrl(true).\"/email_template/email_template.html\"); \n\t\t \t$template = str_replace(\"#from_name#\",$customer2->firstname.' '. $customer2->lastname, $template); \n\t\t\t$body = \"<p> Thank You for payment made for purchase of \".$invoice->invoice_description.\" by \".\n\t\t\t$customer->firstname .' '.$customer->lastname.'. \n\t\t \t\t\t Please find attached fully paid invoice No.<b>'.$invoice_id .'</b>. </p> \n\t\t \t\t\t <p> You have paid <b> &pound;'. $invoice->invoice_total.\"</b> through Direct Debit on \".date(\"d/m/Y H:i:s\").\".</p>\";\n\t\t\t\t\t \n\t\t \t$template = str_replace(\"#message#\", $body, $template);\n \t @mail($customer2->email, $subject, $email_message, $header, \"-f [email protected]\");\n \t\t }\n\t\t \n\t\t # 3. Email to Support \n\t\t $template = file_get_contents(Yii::app()->getBaseUrl(true).\"/email_template/email_template.html\"); \n\t\t $template = str_replace(\"#from_name#\",\"Support\", $template); \n\t\t # 3. send to support personal\n\t\t $body = \"<p> A new payment has been made for purchase of \".$invoice->invoice_description.\". \n\t\t \t\t\t Please find attached fully paid invoice No.<b>\".$invoice_id .\"</b>. </p> \n\t\t \t\t\t <p> \".$customer->firstname .' '.$customer->lastname.\" has paid <b> &pound;\". $invoice->invoice_total.\"</b> through Credit Card on \".date(\"d/m/Y H:i:s\").\". Other details are as follows:</p>\";\n\t\t $body .= '<p> Username: '.$customer->username.'</p>\n\t\t\t\t\t\t<p> Email: '.$customer->email.'</p>\n\t\t\t\t\t\t<p> Telephone: '.$customer->phone.'</p>';\t\n\t\t\t\t\t\t \n\t\t $template = str_replace(\"#message#\", $body, $template);\n\t\t @mail('[email protected]', \"A new successful payment made\", $email_message, $header, \"-f [email protected]\");\n\t\t\n\t}", "public function display_billing_invoice()\n\t{\n\t\t$table_contact_select = '\n\t\t\t<tr>\n\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t<td>'.$this->ml_client_contact_select($this->account->client_id).'</td>\n\t\t\t</tr>\n\t\t';\n\n\t\t?>\n\t\t<h2>Invoice PDF</h2>\n\n\t\t<div id=\"invoice_data\">\n\t\t\t<?php $this->print_payment_form('none', $table_contact_select);?>\n\t\t</div>\n\n\t\t<div id=\"invoice_edit\">\n\t\t\t<div>\n\t\t\t\t<label>Client:</label><input type=\"text\" name=\"pdf_client\" value=\"<?= $this->account->name ?>\"><br/>\n\t\t\t\t<label>Contact Name:</label><input type=\"text\" name=\"pdf_contact\"><br/>\n\t\t\t\t<label>Inv Date:</label><input type=\"text\" name=\"pdf_date\" class=\"date_input\" value=\"<?php echo date(util::DATE);?>\"><br/>\n\t\t\t\t<label>Inv Number:</label><input type=\"text\" name=\"pdf_invoice_num\"><br/>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div>\n\t\t\t\t<label>Address 1:</label><input type=\"text\" name=\"pdf_address_1\"><br/>\n\t\t\t\t<label>Address 2:</label><input type=\"text\" name=\"pdf_address_2\"><br/>\n\t\t\t\t<label>Address 3:</label><input type=\"text\" name=\"pdf_address_3\"><br/>\n\t\t\t</div>\n\t\t\t\n\t\t\t<?= $this->print_pdf_wpro_phone() ?>\n\n\t\t\t<div id=\"pdf_charges\" ejo>\n\t\t\t\t<label>Charges</label>\n\t\t\t\t<table>\n\t\t\t\t\t<tr><th>Amount</th><th>Description</th></tr>\n\t\t\t\t</table>\n\t\t\t\t<input type=\"button\" id=\"pdf_add_charge\" value=\"Add Charge\">\n\t\t\t</div>\n\n\t\t\t<div>\n\t\t\t\t<label>Notes</label><br/>\n\t\t\t\t<input type=\"text\" name=\"pdf_notes\">\n\t\t\t</div>\n\n\t\t\t<input type=\"hidden\" name=\"pdf_type\" value=\"invoice\">\n\t\t\t<input type=\"submit\" a0=\"action_gen_pdf\" value=\"Generate Invoice\">\n\t\t</div>\n\t\t\n\t\t<div class=\"clear\"></div>\n\t\t<?php\n\t}", "public function actionPaymentdebitcard()\n\t{ \n\t\t\n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t\t$invoiceModel = new Invoices;\n\t\t\t$payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n \t\t\t$this->render(\"cardForm\", array(\"payment\"=>$payment));\n \t\t}\n\t\t\n\t}", "public function testDeleteInvoice() {\n\t\t$randomInvoice = rand();\n\n\t\t$tokenizer = new Token($_SESSION['accessToken']);\n\n\t\t$tokenizer->ip('173.49.87.94')\n\t\t\t\t->expirationMonth(12)\n\t\t\t\t->expirationYear(30)\n\t\t\t\t->cardNumber('4321000000001119')\n\t\t\t\t->cvv('333')\n\t\t\t\t->cardType('VS')\n\t\t\t\t->name('John Smith')\n\t\t\t\t->zip('65000')\n\t\t\t\t->address('65 Main Street')\n\t\t\t\t->post();\n\n\t\t$transaction = new Transaction($_SESSION['accessToken']);\n\n\t\t$transaction->total(100)\n\t\t\t\t->clerk('1')\n\t\t\t\t->invoiceNumber($randomInvoice)\n\t\t\t\t->tokenValue($tokenizer->getToken())\n\t\t\t\t->purchaseCard(array(\n\t\t\t\t\t'customerReference' => 412348,\n\t\t\t\t\t'destinationPostalCode' => 19134,\n\t\t\t\t\t'productDescriptors' => array('rent')\n\t\t\t\t))\n\t\t\t\t->sale();\n\n\t\t$output = $transaction->output();\n\n\t\t// Laravel Logging\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__ . ': CARD AND TRANSACTION CREATION');\n\t\tLog::debug(\n\t\t\tjson_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'Request' => $transaction->request(),\n\t\t\t\t\t'Output' => $output\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t// Deleting an invoice requires the transaction be sent in the header\n\t\t$transaction = new Transaction($_SESSION['accessToken']);\n\n\t\t$transaction->deleteInvoice($randomInvoice);\n\n\t\t$result = $transaction->output();\n\n\t\t// Laravel Logging\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__);\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__ . ' INVOICE: ' . $_SESSION['invoiceForTest5']);\n\t\tLog::debug(\n\t\t\tjson_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'Request' => $transaction->request(),\n\t\t\t\t\t'Output' => $result\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\n\t\t$this->assertNotNull($result);\n\n\t}", "public function capture(Varien_Object $payment, $amount)\n {\n parent::capture($payment, $amount);\n\n /* @var Mage_Sales_Model_Order_Invoice $invoice */\n $invoice = Mage::registry('postfinancecheckout_payment_capture_invoice');\n\n if ($invoice->getPostfinancecheckoutCapturePending()) {\n Mage::throwException(\n $this->getHelper()->__(\n 'The capture has already been requested but could not be completed yet. The invoice will be updated, as soon as the capture is done.'));\n }\n\n /* @var PostFinanceCheckout_Payment_Model_Service_Transaction $transactionService */\n $transactionService = Mage::getSingleton('postfinancecheckout_payment/service_transaction');\n try {\n $transaction = $transactionService->getTransaction(\n $payment->getOrder()\n ->getPostfinancecheckoutSpaceId(),\n $payment->getOrder()\n ->getPostfinancecheckoutTransactionId());\n if (! ($transaction instanceof \\PostFinanceCheckout\\Sdk\\Model\\Transaction)) {\n Mage::throwException($this->getHelper()->__('The transaction linked to the order could not be loaded.'));\n }\n } catch (Exception $e) {\n Mage::throwException($this->getHelper()->__('The transaction linked to the order could not be loaded.'));\n }\n\n if ($transaction->getState() == TransactionState::AUTHORIZED) {\n if ($invoice->getId()) {\n $this->complete($payment, $invoice, $amount);\n } else {\n $invoice->setPostfinancecheckoutPaymentNeedsCapture(true);\n }\n } else {\n Mage::throwException($this->getHelper()->__('The invoice cannot be captured manually.'));\n }\n\n return $this;\n }", "public function processPayment();", "public static function getCreditCardForm($order, $amount, $fp_sequence, $relay_response_url, $api_login_id, $transaction_key, $data = null, $test_mode = false, $prefill = true)\n {\n $time = time();\n $fp = self::getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $time);\n $sim = new AuthorizeNetSIM_Form(\n array(\n 'x_amount' => $amount,\n 'x_fp_sequence' => $fp_sequence,\n 'x_fp_hash' => $fp,\n 'x_fp_timestamp' => $time,\n 'x_relay_response'=> \"TRUE\",\n 'x_relay_url' => $relay_response_url,\n 'x_login' => $api_login_id,\n 'x_order' => $order,\n //'x_test_request' => true,\n )\n );\n $hidden_fields = $sim->getHiddenFieldString();\n $post_url = ($test_mode ? self::SANDBOX_URL : self::LIVE_URL);\n $billing_address = (!empty($data['user'])) ? '<div class=\"row\"><label style=\"margin-left:30px; color:#ff8500\">BILLING ADDRESS</label><input type=\"checkbox\" style=\"margin-right:5px;\" id=\"billing\">Use my contact Address here</div>' : \"\"; //BILLING ADDRESS\n $exp_m = '';\n for($i = 1; $i<=12; $i++){\n $j = ($i < 10) ? \"0\".$i : $i;\n $exp_m .= \"<option value='{$j}'>{$j}</option>\";\n } \n\n $Y = date(\"Y\");\n $exp_y = '';\n for($i = $Y; $i < $Y+11; $i++){\n $val = substr($i, -2);\n $exp_y .= \"<option value='{$val}'>{$i}</option>\";\n }\n /*\n<div class=\"row\">\n <label style=\"float:left; margin-left: 30.4%;margin-bottom: 6px;\">Exp.</label>\n <div class=\"date form_datetime b_date\" data-date=\"'.date(\"Y-m-d\").'\" data-date-format=\"mm/dd\" data-link-field=\"dtp_input1\">\n <input size=\"16\" type=\"text\" name=\"x_exp_date\" class=\"form-control1 form-control-bus date_input input-sm\" style=\"width:22%\" value=\"04/17\" readonly>\n <span class=\"add-on\" style=\"float:left;\"><i class=\"icon-th\"></i></span>\n <input type=\"hidden\" id=\"dtp_input1\" value=\"\" />\n </div>\n </div>\n */\n\n \n $form = '\n <div class=\"row payment\" style=\"width:100%;margin:0 auto;text-align:center\"><form method=\"post\" action=\"'.$post_url.'\">\n '.$hidden_fields.'\n <div class=\"row\" style=\"margin-left: -60px;\">\n <label>Card type</label>\n <select name=\"card_type\">\n <option value=\"Visa\">Visa</option>\n <option value=\"American Express\">American Express</option>\n <option value=\"Diners Club\">Diners Club</option>\n <option value=\"Discover\">Discover</option>\n <option value=\"MasterCard\">MasterCard</option>\n <option value=\"UATP Card\">UATP Card</option>\n </select>\n </div>\n <div class=\"row\">\n <label>Card Number</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" autocomplete=\"off\" size=\"25\" title=\"Card num\" data-toggle=\"popover\" data-content=\"Please enter your card number\" data-type=\"number\" name=\"x_card_num\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label style=\"float:left; margin-left: 30.4%;margin-bottom: 6px;\">Exp.</label>\n <select name=\"exp_m\" style=\"float:left\">'.$exp_m.'</select>\n <select name=\"exp_y\" style=\"float:left\">'.$exp_y.'</select>\n <input type=\"hidden\" name=\"x_exp_date\" value=\"\">\n </div>\n <div class=\"row\">\n <label style=\"margin-left: 20px;\">CCV</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" data-type=\"number\" autocomplete=\"off\" name=\"x_card_code\" value=\"\"></input>&nbsp;&nbsp;<a class=\"glyphicon glyphicon-question-sign\" data-toggle=\"modal\" data-target=\"#myModal\">\n</a>\n </div>\n <div class=\"row\">\n <label>First Name</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"first name\" name=\"x_first_name\" data-content=\"John\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>Last Name</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"last name\" name=\"x_last_name\" data-content=\"Doe\" value=\"\"></input>\n </div>'.$billing_address.'\n <div class=\"row\">\n <label>Steet Address</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"address\" name=\"x_address\" data-content=\"123 Main Street\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label></label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"address2\" name=\"x_address2\" data-content=\"123 Main Street\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>City</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"city\" name=\"x_city\" data-content=\"Boston\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>State</label>\n <select class=\"text required form-control2 input-sm bfh-states\" id=\"state\" name=\"x_state\" data-country=\"country\"></select>\n </div>\n <div class=\"row\">\n <label>Zip Code</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"zip\" data-type=\"number\" name=\"x_zip\" data-content=\"02142\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>Country</label>\n <select id=\"country\" name=\"x_country\" class=\"text required form-control2 input-sm bfh-countries\" data-country=\"US\"></select>\n </div>\n <div class=\"row\">\n <div class=\"col-md-12\">\n <label style=\"text-align:center; color:red; margin:0 auto\">amount: $'.$amount.'</label>\n </div>\n </div>\n <div class=\"row\" style=\"text-align:center\">\n<button type=\"button\" id=\"btn-pay\" class=\"noprint btn btn-primary \">Payment</button>\n </div>\n </form></div>';\n return $form;\n }", "function storeCardPayment($agent_id,$month,$amount){\n\n // if(request()->status == 0){\n $reference = request()->reference;\n $user = User::where([['userable_id', $agent_id],['role_id', env('AGENT')]] )\n ->first();\n\n $invoice = env('IRS_CODE').date('Ymd').$user->userable_id.random_int(0,9).strtotime(date('Ymdhsi',time()));\n\n $remittance = Remittance::create([\n 'agent_id'=> $agent_id,\n 'lga_id'=> $user->lga_id,\n 'amount'=> $amount,\n 'month'=> $month,\n 'payment_type'=> 'card',\n 'transaction_reference' => $reference,\n 'invoice'=> $invoice,\n 'mac_id'=> request()->ip()\n ]);\n\n\n\n\n // }\n // else if(request()->status == 1){\n\n\n DB::beginTransaction();\n try {\n\n $remits = Remittance::where('transaction_reference', request()->reference )->firstorFail();\n\n if($remits->status == 'success' )\n return redirect( env('APP_URL').'/home#/remittance')->with('message', request()->reference.' has successfully paid!');\n\n\n\n//\n// $remit->update([\n// 'status' => 'success',\n// 'mac_id'=> request()->ip()\n// ]);\n\n $res = '';\n $curl = curl_init();\n\n $reference= request()->reference;\n $type='card';\n $string = $reference.$type; //concatenate these values\n $mac = env('MAC_KEY');\n $hash = hash_hmac('sha512',$string,$mac, false);\n $token = env('MONETA_TOKEN');\n\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => env('MONETA_URL').\"/transaction/verify/card/\".$reference.\"?hash=\".$hash,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => array(\n \"Authorization: Bearer $token\",\n \"Accept: application/json\"\n ),\n ));\n\n $response = curl_exec($curl);\n\n $err = curl_error($curl);\n curl_close($curl);\n\n if ($err) {\n return 'CRITICAL ERROR OCCURED!.';\n\n }\n\n $result = json_decode($response, true);\n\n if( array_key_exists('data',$result)){\n\n\n if($result['data']['status'] == 'success'){\n\n $payment_date = $result['data']['paid_at'];\n\n $bank = $result['authorization']['bank'];\n\n\n $unremitObj = UnremittedCash::where([['agent_id', $remits->agent_id],['month',$remits->month]]);\n\n $unremitObj->decrement('amount', $amount);\n\n $unremit = $unremitObj->first();\n\n // $remittance->update(['invoice_id'=>$unremit->invoice_id]);\n\n $remits->status = 'success';\n $remits->mac_id = request()->ip();\n $remits->timestamps = false;\n $remits->bank = $bank;\n $remits->updated_at = date(\"Y-m-d H:i:s\", strtotime($payment_date));\n $remits->invoice_id = $unremit->invoice_id;\n $res = $remits->save();\n\n // set invoice id of unremitted to empty\n $unremitObj->update(['invoice_id'=>'']);\n\n\n }\n\n }\n DB::commit();\n\n return redirect( env('APP_URL').'/home#/remittance')->with('message', request()->reference.' has successfully paid!');\n\n //return 'success';\n// if($res)\n// return 'success';\n// else\n// return 'failed';\n\n }\n catch(\\Exception $ex){\n\n if (isset($ex->errorInfo[2])) {\n $msg = $ex->errorInfo[2];\n } else {\n $msg = $ex->getMessage();\n }\n\n // rollback operation for failure\n DB::rollback();\n\n // return $msg;\n return response()->json([\n 'status' => 'error',\n 'data' => $msg\n ]);\n\n }\n\n\n\n\n // }*/\n\n\n }", "public function capture(Varien_Object $payment, $amount)\n {\n if (!$this->canCapture()) {\n Mage::throwException(Mage::helper('payment')->__('Capture action is not available.'));\n }\n\n\t$order = $payment->getOrder();\n $notCapturable = 1;\n\n if ($order->hasInvoices()) {\n $oInvoiceCollection = $order->getInvoiceCollection();\n foreach ($oInvoiceCollection as $oInvoice) {\n if( $oInvoice->getRequestedCaptureCase() != Mage_Sales_Model_Order_Invoice::NOT_CAPTURE && $oInvoice->getState() != Mage_Sales_Model_Order_Invoice::STATE_CANCELED && $oInvoice->getState() != Mage_Sales_Model_Order_Invoice::STATE_PAID )\n {\n $notCapturable = 0;\n break;\n }\n }\n\n if( $notCapturable )\n {\n return $this;\n }\n }\n\n // confirm funds\n $this->_api->doConfirm($payment, $amount);\n return $this;\n }", "public function export_company_generate_invoice($id) \n {\n $tenant_id = $this->tenant_id;\n \n if (empty($id)) \n {\n return show_404();\n }\n// $result = $this->classtraineemodel->get_enroll_invoice($id);\n \n $result = $this->classtraineemodel->get_company_enroll_invoice($id);\n //added by pritam to generate previous invoice number\n $result->previous_inv_id = $this->classtraineemodel->get_enroll_prev_invoice($result->invoice_id);\n \n //sk st\n $discount = $this->classtraineemodel->get_discount($result->pymnt_due_id);\n $result->discount_label = $discount->discount_type;\n $result->discount_rate = $discount->discount_rate;\n //sk ed\n \n //\n $result->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_state), ', ');\n $result->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_country), ', ');\n $result->inv_year = date('Y', strtotime($result->inv_date));\n $result->inv_date = date('d/m/Y', strtotime($result->inv_date));\n $result->discount_label = rtrim($this->course->get_metadata_on_parameter_id($result->discount_type), ', ');\n if ($result->total_gst) {\n $result->gst_label = 'GST ON, ' . rtrim($this->course->get_metadata_on_parameter_id($result->gst_rule), ', ');\n } else {\n $result->gst_label = 'GST OFF';\n }\n $course_manager = $this->course->get_managers($courses->crse_manager);\n $length = stripos($course_manager, ', ');\n $result->course_manager = (!empty($length)) ? substr($course_manager, 0, $length) : $course_manager;\n if ($result->company_id[0] == 'T') {\n $result->company_name = $result->tenant_name;\n $result->company_details->comp_state = $result->tenant_state;\n $result->company_details->comp_cntry = $result->tenant_country;\n $result->company_details->comp_phone = $result->tenant_contact_num;\n $result->company_details->comp_address = $result->tenant_address;\n \n $company_person = $this->company->get_company_user($result->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $result->company_id);\n $result->company_details = $company_details[0];\n $result->company_details->comp_state = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_state), ', ');\n $result->company_details->comp_cntry = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_cntry), ', ');\n\n $result->company_name = $company_details[0]->company_name;\n \n $company_person = $this->company->get_company_user($this->tenant_id, $result->company_id);//skm1\n $result->company_person_name = $company_person[0]->first_name;//skm2\n \n }\n\n $result->total_inv_discnt = round($result->total_inv_discnt, 2);\n $result->total_unit_fees = round($result->total_unit_fees, 2);\n $result->total_inv_subsdy = round($result->total_inv_subsdy, 2);\n $result->gst_rate = round($result->gst_rate, 2);\n\n $result->indi_disc_total = ($result->class_fees * ($result->discount_rate / 100));\n\n $feesdue = $result->total_unit_fees - $result->total_inv_discnt;\n $result->payment_due_details = $this->classtraineemodel->get_company_payment_due_details($id);\n \n $company_received = $this->classtraineemodel->company_payment_recd($result->invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = round($v->amount_recd,2);\n }\n $company_refunded = $this->classtraineemodel->company_payment_refund($result->invoice_id);\n $user_refund = array();\n foreach ($company_refunded as $k => $v) {\n $user_refund[$v->user_id] = round($v->refund_amount,2);\n }\n foreach($result->payment_due_details as $key=>$val)\n {\n $received = empty($user_paid[$val->user_id]) ? 0 : $user_paid[$val->user_id];\n $refunded = empty($user_refund[$val->user_id]) ? 0 : $user_refund[$val->user_id];\n $inv_amt+=$val->total_amount_due;\n $received_amt+=$received;\n $refunded_amt+=$refunded;\n if((($val->total_amount_due + $refunded) - $received) <= 0)\n {\n $payment_label = 'PAID';\n }\n else\n { \n \n if($received > 0 && $val->payment_status == 'PARTPAID')\n {\n $payment_label = 'PART PAID';\n \n }else if($refunded > 0)\n { \n $payment_label = 'REFUNDED'; \n } \n else\n { \n if($received == 0)\n {\n $payment_label = 'NOT PAID';\n }\n else if($received > 0)\n {\n $payment_label = 'PART PAID';\n }\n }\n }\n $result->payment_due_details[$key]->payment_label = $payment_label;\n }\n \n $payable_amount=$inv_amt-$received_amt; \n $result->payble_amount=$inv_amt+$refunded_amt-$received_amt;\n\n $this->load->helper('pdf_reports_helper');\n if($tenant_id =='T17'){\n generate_company_pdf_invoice_everest($result);\n }else{\n generate_company_pdf_invoice_all($result);\n }\n \n }", "public function quickbooksms_void_payment($params)\n\t{\n\t\t$this->_api_method = 'CustomerCreditCardTxnVoidRq';\n\t\t$this->_request = $this->_build_request($params);\t\t\t\n\t\treturn $this->_handle_query();\t\n\t}", "public function invoiceAction() {\n $this->chekcingForMarketplaceSellerOrNot ();\n /**\n * Get order Id\n * @var unknown\n */\n $orderId = $this->getRequest ()->getParam ( 'id' );\n /**\n * Getting order product ids\n */\n $orderPrdouctIds = Mage::helper ( 'marketplace/vieworder' )->getOrderProductIds ( Mage::getSingleton ( 'customer/session' )->getId (), $orderId );\n /**\n * Getting cancel order items\n */\n $cancelOrderItemProductIds = Mage::helper ( 'marketplace/vieworder' )->cancelOrderItemProductIds ( Mage::getSingleton ( 'customer/session' )->getId (), $orderId );\n\n /**\n * Getting the sonfiguration for order manage.\n */\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n /**\n * Check whether product id count is greater than one\n */\n if (count ( $orderPrdouctIds ) >= 1 && $orderStatusFlag == 1) {\n $order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n $itemsarray = $itemsArr = array ();\n /**\n * prepare invoice items\n */\n foreach ( $order->getAllItems () as $item ) {\n $qty = 0;\n /**\n * Prepare invoice qtys\n */\n $itemProductId = $item->getProductId ();\n $itemId = $item->getItemId ();\n /**\n * check whether item is in array\n */\n if (in_array ( $itemProductId, $orderPrdouctIds ) && ! in_array ( $itemProductId, $cancelOrderItemProductIds )) {\n $itemsArr [] = $itemId;\n /**\n * Qty ordered for that item\n */\n $qty = $item->getQtyOrdered () - $item->getQtyInvoiced ();\n }\n $itemsarray [$itemId] = $qty;\n }\n\n try {\n /**\n * Create invoice\n */\n if ($order->canInvoice ()) {\n /**\n * Generate invoice for shippment.\n */\n Mage::getModel ( 'sales/order_invoice_api' )->create ( $order->getIncrementId (), $itemsarray, '', 1, 1 );\n\t\t Mage::getModel ( 'marketplace/order' )->updateSellerOrderItemsBasedOnSellerItems ( $itemsArr, $orderId, 1 );\n\t\t $order->setStatus('processing');\n\t\t $order->save();\n /**\n * add success message\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( 'The invoice has been created.' ) );\n }\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n }\n } else {\n /**\n * Checkk the permission for generate invoice.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/manage' );\n return false;\n }\n }", "function initializeParams(){\n $vpcURL = $_POST[\"virtualPaymentClientURL\"];\n // This is the title for display\n $title = $_POST[\"Title\"];\n\n // Remove the Virtual Payment Client URL from the parameter hash as we\n // do not want to send these fields to the Virtual Payment Client.\n unset($_POST[\"virtualPaymentClientURL\"]);\n unset($_POST[\"SubButL\"]);\n unset($_POST[\"Title\"]);\n\n // create a variable to hold the POST data information and capture it\n $postData = \"\";\n\n $ampersand = \"\";\n foreach($_POST as $key => $value) {\n // create the POST data input leaving out any fields that have no value\n if (strlen($value) > 0) {\n $postData .= $ampersand . urlencode($key) . '=' . urlencode($value);\n $ampersand = \"&\";\n }\n }\n\n // Get a HTTPS connection to VPC Gateway and do transaction\n // turn on output buffering to stop response going to browser\n ob_start();\n\n // initialise Client URL object\n $ch = curl_init();\n\n // set the URL of the VPC\n curl_setopt ($ch, CURLOPT_URL, $vpcURL);\n curl_setopt ($ch, CURLOPT_POST, 1);\n curl_setopt ($ch, CURLOPT_POSTFIELDS, $postData);\n\n // (optional) set the proxy IP address and port\n // curl_setopt ($ch, CURLOPT_PROXY, \"YOUR_PROXY:PORT\");\n\n // (optional) certificate validation\n // trusted certificate file\n //curl_setopt($ch, CURLOPT_CAINFO, \"c:/temp/ca-bundle.crt\");\n\n //turn on/off cert validation\n // 0 = don't verify peer, 1 = do verify\n curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\n // 0 = don't verify hostname, 1 = check for existence of hostame, 2 = verify\n //curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\n // connect\n curl_exec ($ch);\n\n // get response\n $response = ob_get_contents();\n\n // turn output buffering off.\n ob_end_clean();\n\n // set up message paramter for error outputs\n $message = \"\";\n\n // serach if $response contains html error code\n if(strchr($response,\"<html>\") || strchr($response,\"<html>\")) {;\n $message = $response;\n } else {\n // check for errors from curl\n if (curl_error($ch))\n $message = \"curl_errno=\". curl_errno($ch) . \"<br/>\" . curl_error($ch);\n }\n\n // close client URL\n curl_close ($ch);\n\n // Extract the available receipt fields from the VPC Response\n // If not present then let the value be equal to 'No Value Returned'\n $map = array();\n\n // process response if no errors\n if (strlen($message) == 0) {\n $pairArray = split(\"&\", $response);\n foreach ($pairArray as $pair) {\n $param = split(\"=\", $pair);\n $map[urldecode($param[0])] = urldecode($param[1]);\n }\n $message = null2unknown($map, \"vpc_Message\");\n }\n\n // Standard Receipt Data\n # merchTxnRef not always returned in response if no receipt so get input\n $merchTxnRef = $vpc_MerchTxnRef;\n\n $amount = null2unknown($map, \"vpc_Amount\");\n $locale = null2unknown($map, \"vpc_Locale\");\n $batchNo = null2unknown($map, \"vpc_BatchNo\");\n $command = null2unknown($map, \"vpc_Command\");\n $version = null2unknown($map, \"vpc_Version\");\n $cardType = null2unknown($map, \"vpc_Card\");\n $orderInfo = null2unknown($map, \"vpc_OrderInfo\");\n $receiptNo = null2unknown($map, \"vpc_ReceiptNo\");\n $merchantID = null2unknown($map, \"vpc_Merchant\");\n $authorizeID = null2unknown($map, \"vpc_AuthorizeId\");\n $transactionNr = null2unknown($map, \"vpc_TransactionNo\");\n $acqResponseCode = null2unknown($map, \"vpc_AcqResponseCode\");\n $txnResponseCode = null2unknown($map, \"vpc_TxnResponseCode\");\n\n // CSC Receipt Data\n $cscResultCode = null2unknown($map, \"vpc_CSCResultCode\");\n $cscACQRespCode = null2unknown($map, \"vpc_AcqCSCRespCode\");\n\n // AVS Receipt Data\n $avsResultCode = null2unknown($map, \"vpc_AVSResultCode\");\n $vACQAVSRespCode = null2unknown($map, \"vpc_AcqAVSRespCode\");\n $avs_City = null2unknown($map, \"vpc_AVS_City\");\n $avs_Country = null2unknown($map, \"vpc_AVS_Country\");\n $avs_Street01 = null2unknown($map, \"vpc_AVS_Street01\");\n $avs_PostCode = null2unknown($map, \"vpc_AVS_PostCode\");\n $avs_StateProv = null2unknown($map, \"vpc_AVS_StateProv\");\n $avsRequestCode = null2unknown($map, \"vpc_AVSRequestCode\");\n\n /*********************\n * END OF MAIN PROGRAM\n *********************/\n\n // FINISH TRANSACTION - Process the VPC Response Data\n // =====================================================\n // For the purposes of demonstration, we simply display the Result fields on a\n // web page.\n\n // Show 'Error' in title if an error condition\n $errorTxt = \"\";\n // Show the display page as an error page\n if ($txnResponseCode == \"7\" || $txnResponseCode != \"No Value Returned\") {\n $errorTxt = \"Error \";\n }\n\n // *******************\n // END OF MAIN PROGRAM\n // *******************\n\n // FINISH TRANSACTION - Process the VPC Response Data\n // =====================================================\n // For the purposes of demonstration, we simply display the Result fields on a\n // web page.\n\n // Show 'Error' in title if an error condition\n $errorTxt = \"\";\n\n // Show this page as an error page if vpc_TxnResponseCode equals '7'\n if ($txnResponseCode == \"7\" || $txnResponseCode == \"No Value Returned\") {\n $errorTxt = \"Error \";\n }\n}", "public function pysVoid(Varien_Object $payment)\r\n {\r\n $error = false;\r\n $szTransactionType = \"VOID\";\r\n $orderStatus = \"pys_voided\";\r\n $arAdditionalInformationArray;\r\n \r\n // attempt a VOID and accordingly to the last saved transaction id (CrossReference) set the new message \r\n $szLastTransId = $payment->getLastTransId();\r\n $transaction = $payment->getTransaction($szLastTransId);\r\n $szMagentoTxnType = $transaction->getTxnType();\r\n $szMessage = \"Payment voided\";\r\n \r\n if($szMagentoTxnType == \"capture\")\r\n {\r\n \t$szMessage = \"Payment voided\";\r\n }\r\n else if($szMagentoTxnType == \"authorization\")\r\n {\r\n \t$szMessage = \"PreAuthorization voided\";\r\n }\r\n else if($szMagentoTxnType == \"refund\")\r\n {\r\n \t$szMessage = \"Refund voided\";\r\n }\r\n else \r\n {\r\n \t// general message\r\n \t$szMessage = \"Payment voided\";\r\n }\r\n \r\n $error = $this->_runCrossReferenceTransaction($payment, $szTransactionType);\r\n\r\n if ($error === false)\r\n {\r\n \t$order = $payment->getOrder();\r\n \t$invoices = $order->getInvoiceCollection();\r\n \t$payment = $order->getPayment();\r\n \t$arAdditionalInformationArray = $payment->getAdditionalInformation();\r\n \t\r\n \t$arAdditionalInformationArray[\"Voided\"] = 1;\r\n \t$payment->setAdditionalInformation($arAdditionalInformationArray);\r\n \t$payment->save();\r\n \t\r\n \t// cancel the invoices\r\n \tforeach ($invoices as $invoice)\r\n \t{\r\n \t\t$invoice->cancel();\r\n \t\t$invoice->save();\r\n \t}\r\n \t\r\n \t// udpate the order\r\n \t$order->setActionBy($payment->getLggdInAdminUname())\r\n\t\t \t->setActionDate(date('Y-m-d H:i:s'))\r\n\t\t ->setVoided(1)\r\n\t\t ->setState('canceled', $orderStatus, $szMessage, false);\r\n\t\t\t$order->save();\r\n\t\t\t\r\n\t\t\t$result = \"0\";\r\n }\r\n else\r\n {\r\n \t\t$result = $error;\r\n }\r\n\r\n return $result;\r\n }", "public function payment(Request $request)\n {\n $invoice = Invoice::findByUid($request->invoice);\n \n // Get Stripe Service\n $stripe = new Stripe($invoice->company);\n \n // Make the Payment Request\n $response = $stripe->purchase([\n 'amount' => $stripe->formatAmount($invoice->due_amount),\n 'currency' => $invoice->currency_code,\n 'paymentMethod' => $request->paymentMethodId,\n 'description' => 'Invoice ' . $invoice->invoice_number, \n 'returnUrl' => $stripe->getReturnUrl($invoice),\n 'confirm' => true,\n ]);\n\n // If payment was successful then save payment and return user to success page\n if ($response->isSuccessful()) {\n // Create and Save Payment to Database\n $payment = $this->savePayment($invoice, 'Stripe', $response->getPaymentIntentReference());\n \n session()->flash('alert-success', __('messages.payment_successful', ['payment_number' => $payment->payment_number]));\n return redirect()->route('customer_portal.invoices.details', [\n 'customer' => $request->customer, \n 'invoice' => $request->invoice\n ]);\n } \n // If stripe needs additional redirect like 3d secure then redirect the customer\n elseif ($response->isRedirect()) {\n $response->redirect();\n }\n \n // Something else happend, go back to invoice details\n session()->flash('alert-danger', $response->getMessage());\n return redirect()->route('customer_portal.invoices.details', [\n 'customer' => $request->customer, \n 'invoice' => $request->invoice\n ]);\n }", "function print_result()\n{\n global $pxpay;\n \n $enc_hex = $_REQUEST[\"result\"];\n #getResponse method in PxPay object returns PxPayResponse object\n #which encapsulates all the response data\n $rsp = $pxpay->getResponse($enc_hex);\n \n \n # the following are the fields available in the PxPayResponse object\n $Success = $rsp->getSuccess(); # =1 when request succeeds\n $AmountSettlement = $rsp->getAmountSettlement();\n $AuthCode = $rsp->getAuthCode(); # from bank\n $CardName = $rsp->getCardName(); # e.g. \"Visa\"\n $CardNumber = $rsp->getCardNumber(); # Truncated card number\n $DateExpiry = $rsp->getDateExpiry(); # in mmyy format\n $DpsBillingId = $rsp->getDpsBillingId();\n $BillingId \t = $rsp->getBillingId();\n $CardHolderName = $rsp->getCardHolderName();\n $DpsTxnRef\t = $rsp->getDpsTxnRef();\n $TxnType = $rsp->getTxnType();\n $TxnData1 = $rsp->getTxnData1();\n $TxnData2 = $rsp->getTxnData2();\n $TxnData3 = $rsp->getTxnData3();\n $CurrencySettlement= $rsp->getCurrencySettlement();\n $ClientInfo = $rsp->getClientInfo(); # The IP address of the user who submitted the transaction\n $TxnId = $rsp->getTxnId();\n $CurrencyInput = $rsp->getCurrencyInput();\n $EmailAddress = $rsp->getEmailAddress();\n $MerchantReference = $rsp->getMerchantReference();\n $ResponseText\t\t = $rsp->getResponseText();\n $TxnMac = $rsp->getTxnMac(); # An indication as to the uniqueness of a card used in relation to others\n $RecurringMode = $rsp->getRecurringMode();\n \n \n if ($rsp->getSuccess() == \"1\")\n {\n $result = \"The transaction was approved.\";\n \n\t\t# Sending invoices/updating order status within database etc.\n \n if (!isProcessed($TxnId))\n {\n \n \n }\n \n }\n else\n {\n $result = \"The transaction was declined.\";\n }\n print <<<HTMLEOF\n <html>\n <head>\n <title>Payment Express PxPay transaction result</title>\n </head>\n <body>\n <h1>Payment Express PxPay transaction result</h1>\n <p>$result</p>\n <table border=1>\n\t<tr><th>Name</th>\t\t\t\t<th>Value</th> </tr>\n\t<tr><td>Success</td>\t\t\t<td>$Success</td></tr>\n\t<tr><td>TxnType</td>\t\t\t<td>$TxnType</td></tr>\n\t<tr><td>CurrencyInput</td>\t\t<td>$CurrencyInput</td></tr>\n\t<tr><td>MerchantReference</td>\t<td>$MerchantReference</td></tr>\n\t<tr><td>TxnData1</td>\t\t\t<td>$TxnData1</td></tr>\n\t<tr><td>TxnData2</td>\t\t\t<td>$TxnData2</td></tr>\n\t<tr><td>TxnData3</td>\t\t\t<td>$TxnData3</td></tr>\n\t<tr><td>AuthCode</td>\t\t\t<td>$AuthCode</td></tr>\n\t<tr><td>CardName</td>\t\t\t<td>$CardName</td></tr>\n\t<tr><td>CardHolderName</td>\t\t<td>$CardHolderName</td></tr>\n\t<tr><td>CardNumber</td>\t\t\t<td>$CardNumber</td></tr>\n\t<tr><td>DateExpiry</td>\t\t\t<td>$DateExpiry</td></tr>\n\t<tr><td>ClientInfo</td>\t\t\t<td>$ClientInfo</td></tr>\n\t<tr><td>TxnId</td>\t\t\t\t<td>$TxnId</td></tr>\n\t<tr><td>EmailAddress</td>\t\t<td>$EmailAddress</td></tr>\n\t<tr><td>DpsTxnRef</td>\t\t\t<td>$DpsTxnRef</td></tr>\n\t<tr><td>BillingId</td>\t\t\t<td>$BillingId</td></tr>\n\t<tr><td>DpsBillingId</td>\t\t<td>$DpsBillingId</td></tr>\n\t<tr><td>AmountSettlement</td>\t<td>$AmountSettlement</td></tr>\n\t<tr><td>CurrencySettlement</td>\t<td>$CurrencySettlement</td></tr>\n\t<tr><td>TxnMac</td>\t\t\t\t<td>$TxnMac</td></tr>\n <tr><td>ResponseText</td>\t\t<td>$ResponseText</td></tr>\n <tr><td>RecurringMode</td>\t\t<td>$RecurringMode</td></tr>\n </table>\n </body>\n </html>\nHTMLEOF;\n}", "public function invoice_info( $invoice_id ) {\r\n\t\treturn $this->_send_request( 'invoices/'.$invoice_id );\r\n\t}", "public function testBuildCreditCardAVSOnly()\n {\n $config = new SinglePayConfig();\n $config->setServiceConfig(self::$testConfig);\n\n $card = new Card();\n $card->setName('TEST')\n ->setNumber('8696969')\n ->setExpiryMonth('09')\n ->setExpiryYear('18')\n ->setCvv('200');\n\n $order = new Order();\n $order->setAmount('10.00')\n ->setCustomerNo('1990');\n\n $billingAddress = new Address();\n $billingAddress->setName('TEST')\n ->setAddress1('Test address 1')\n ->setAddress2('Test address 2')\n ->setCity('Test City')\n ->setState('Test State')\n ->setZipcode('Test Zipcode')\n ->setEmail('Test Email')\n ->setPhone('112212121212');\n\n $shippingAddress = new Address();\n\n $data = new SinglePayData();\n $data->setOrder($order)\n ->setCard($card)\n ->setBillingAddress($billingAddress)\n ->setShippingAddress($shippingAddress);\n\n $creditCardAVSOnly = ExpressFactory::buildCreditCardAVSOnly($config, $data);\n $this->assertInstanceOf('\\SinglePay\\PaymentService\\Element\\Express\\Method\\CreditCardAVSOnly', $creditCardAVSOnly);\n $this->assertInstanceOf('\\SinglePay\\PaymentService\\Element\\Express\\Type\\Address', $creditCardAVSOnly->address);\n }", "protected function _capture_payment_paypal_pro( $order ) {\n\t\t\t$paypalpro = new WC_Gateway_PayPal_Pro();\n\n\t\t\t$txn_id = $this->_get_transaction_id( version_compare( WC_VERSION, '3.0', '<' ) ? $order->id : $order->get_id() );\n\t\t\t$url = $paypalpro->testmode ? $paypalpro->testurl : $paypalpro->liveurl;\n\n\t\t\t$post_data = array(\n\t\t\t\t'VERSION' => $paypalpro->api_version,\n\t\t\t\t'SIGNATURE' => $paypalpro->api_signature,\n\t\t\t\t'USER' => $paypalpro->api_username,\n\t\t\t\t'PWD' => $paypalpro->api_password,\n\t\t\t\t'METHOD' => 'DoCapture',\n\t\t\t\t'AUTHORIZATIONID' => $txn_id,\n\t\t\t\t'AMT' => $order->get_total(),\n\t\t\t\t'CURRENCYCODE' => ( version_compare( WC_VERSION, '3.0', '<' ) ? $order->get_order_currency() : $order->get_currency() ),\n\t\t\t\t'COMPLETETYPE' => 'Complete',\n\t\t\t);\n\n\t\t\tif ( $paypalpro->soft_descriptor ) {\n\t\t\t\t$post_data['SOFTDESCRIPTOR'] = $paypalpro->soft_descriptor;\n\t\t\t}\n\n\t\t\t$paypalpro->log( 'Capture payment request: ' . print_r( $post_data, true ) );\n\n\t\t\t$response = wp_remote_post( $url, array(\n\t\t\t\t'method' => 'POST',\n\t\t\t\t'headers' => array(\n\t\t\t\t\t'PAYPAL-NVP' => 'Y',\n\t\t\t\t),\n\t\t\t\t'body' => $post_data,\n\t\t\t\t'timeout' => 70,\n\t\t\t\t'user-agent' => 'WooCommerce',\n\t\t\t\t'httpversion' => '1.1',\n\t\t\t));\n\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\t$order->add_order_note( __( 'Unable to capture charge!', 'woocommerce-gateway-paypal-pro' ) . ' ' . $response->get_error_message() );\n\t\t\t\t$paypalpro->log( 'Error: ' . $response->get_error_message() );\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tparse_str( $response['body'], $parsed_response );\n\n\t\t\t$paypalpro->log( 'Parsed response: ' . print_r( $parsed_response, true ) );\n\n\t\t\tswitch ( strtolower( $parsed_response['ACK'] ) ) {\n\t\t\t\tcase 'success':\n\t\t\t\tcase 'successwithwarning':\n\t\t\t\t\t$this->_capture_payment_paypal_pro_success( $order, $parsed_response );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'failure':\n\t\t\t\tdefault:\n\t\t\t\t\t$this->_capture_payment_paypal_pro_failed( $order, $parsed_response );\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "function InfDeleteCreditCard($inf_card_id) {\n\t$object_type = \"Product\";\n\t$class_name = \"Infusionsoft_\" . $object_type;\n\t$object = new $class_name();\n\t$res = Infusionsoft_ProductService::deactivateCreditCard($inf_card_id);\n\t\n\treturn $res;\n}", "public function cancelApproval(InvoiceInterface $invoice): void;", "public function creditCardPayment()\n {\n }", "function charge_v2_vtweb_payment( $order_id )\n {\n global $woocommerce;\n $order_items = array();\n\n $order = new WC_Order( $order_id ); \n $veritrans = new Veritrans();\n\n $veritrans->api_version = 2;\n $veritrans->environment = ($this->environment == 'production' ? Veritrans::ENVIRONMENT_PRODUCTION : Veritrans::ENVIRONMENT_DEVELOPMENT);\n $veritrans->payment_type = ($this->select_veritrans_payment == 'veritrans_direct' ? Veritrans::VT_DIRECT : Veritrans::VT_WEB);\n if ($veritrans->environment == Veritrans::ENVIRONMENT_PRODUCTION)\n {\n $veritrans->server_key = $this->server_key_v2_production;\n } else\n {\n $veritrans->server_key = $this->server_key_v2_sandbox;\n }\n if ($this->enable_3d_secure == 'yes')\n $veritrans->enable_3d_secure = TRUE;\n \n $veritrans->order_id = $order_id;\n\n if ($_POST['ship_to_different_address'])\n {\n $veritrans->required_shipping_address = 1;\n $veritrans->billing_different_with_shipping = 1;\n $veritrans->shipping_first_name = $_POST['shipping_first_name'];\n $veritrans->shipping_last_name = $_POST['shipping_last_name'];\n $veritrans->shipping_address1 = $_POST['shipping_address_1'];\n $veritrans->shipping_address2 = $_POST['shipping_address_2'];\n $veritrans->shipping_city = $_POST['shipping_city'];\n $veritrans->shipping_country_code = $_POST['shipping_country'];\n $veritrans->shipping_phone = $_POST['billing_phone'];\n $veritrans->shipping_postal_code = $_POST['shipping_postcode'];\n } else\n {\n $veritrans->required_shipping_address = 1;\n $veritrans->billing_different_with_shipping = 0;\n }\n\n $veritrans->first_name = $_POST['billing_first_name'];\n $veritrans->last_name = $_POST['billing_last_name'];\n $veritrans->address1 = $_POST['billing_address_1'];\n $veritrans->address2 = $_POST['billing_address_2'];\n $veritrans->city = $_POST['billing_city'];\n $veritrans->country_code = $_POST['billing_country'];\n $veritrans->postal_code = $_POST['billing_postcode'];\n $veritrans->phone = $_POST['billing_phone'];\n $veritrans->email = $_POST['billing_email'];\n\n // Populate Items\n $items = array();\n\n if( sizeof( $order->get_items() ) > 0 ) {\n foreach( $order->get_items() as $item ) {\n if ( $item['qty'] ) {\n $product = $order->get_product_from_item( $item );\n\n $veritrans_item = array();\n\n $veritrans_item['item_id'] = $item['product_id'];\n $veritrans_item['item_name1'] = $item['name'];\n $veritrans_item['item_name2'] = $item['name'];\n $veritrans_item['price'] = $order->get_item_subtotal( $item, false );\n $veritrans_item['quantity'] = $item['qty'];\n\n $items[] = $veritrans_item;\n }\n }\n }\n\n // Shipping fee\n if( $order->get_total_shipping() > 0 ) {\n $items[] = array(\n 'item_id' => 'shippingfee',\n 'item_name1' => 'Shipping Fee',\n 'item_name2' => 'Shipping Fee',\n 'price' => $order->get_total_shipping(),\n 'quantity' => 1,\n );\n }\n\n // Tax\n if( $order->get_total_tax() > 0 ) {\n $items[] = array(\n 'item_id' => 'taxfee',\n 'item_name1' => 'Tax',\n 'item_name2' => 'Tax',\n 'price' => $order->get_total_tax(),\n 'quantity' => 1,\n );\n }\n\n // Fees\n if ( sizeof( $order->get_fees() ) > 0 ) {\n $fees = $order->get_fees();\n for ( $i = 0; $i < count($fees); $i++ ) {\n $items[] = array(\n 'item_id' => 'itemfee' . $i,\n 'item_name1' => 'Fee ' . $i,\n 'item_name2' => 'Fee ' . $i,\n 'price' => $item['line_total'],\n 'quantity' => 1,\n ); \n }\n }\n\n // sift through the entire item to ensure that currency conversion is applied\n if (get_woocommerce_currency() != 'IDR')\n {\n foreach ($items as &$item) {\n $item['price'] = $item['price'] * $this->to_idr_rate;\n }\n }\n\n $veritrans->items = $items;\n $veritrans->force_sanitization = TRUE;\n\n $charge_result = $veritrans->getTokens();\n \n // If wp_remote_post failed\n if( $veritrans->error ) {\n throw new Exception( $veritrans->error );\n } else {\n header('Location:' . $charge_result['redirect_url']);\n exit;\n // $result = json_decode( wp_remote_retrieve_body( $vtweb ), true );\n\n // // check result\n // if( !empty($result['token_merchant']) ) {\n // // No error\n\n // if ( ! empty( $result['token_browser'] ) )\n // update_post_meta( $order->id, '_token_browser', $result['token_browser'] );\n // if ( ! empty( $result['token_merchant'] ) )\n // update_post_meta( $order->id, '_token_merchant', $result['token_merchant'] ); \n // }\n\n // else {\n // // Veritrans doesn't return tokens\n // $error_str = '';\n // foreach( $result['errors'] as $error_name => $error_message ) {\n // $error_str .= \"<br><strong>{$error_name}</strong>: {$error_message}\\n\";\n // }\n // throw new Exception( $error_str );\n // }\n }\n }", "function ras_invoice_view_invoice_item($invoice_item) {\n return 'This is an invoice item - ID: ' . $invoice_item->invoice_item_id;\n}", "public function setCvv($cvv)\n {\n if (!Validation::validateCardDetails($this->creditCardNo, $this->expiryMonth, $this->expiryYear, $cvv)) {\n throw new \\InvalidArgumentException(\"Invalid CVV number\");\n }\n $this->cvv = $cvv;\n return $this;\n }" ]
[ "0.6311083", "0.5891329", "0.5836351", "0.5625984", "0.55789125", "0.5550932", "0.55446655", "0.55256635", "0.5502811", "0.5426349", "0.53792167", "0.5217016", "0.5210063", "0.51768696", "0.51056033", "0.50885445", "0.5087918", "0.5087918", "0.50864136", "0.5068353", "0.50659287", "0.50625294", "0.5050456", "0.5050315", "0.5041487", "0.50362206", "0.502059", "0.5018768", "0.49966797", "0.49935168", "0.49766645", "0.49734017", "0.4954653", "0.4949615", "0.49467158", "0.49395427", "0.49326155", "0.49312198", "0.49053484", "0.48998588", "0.48989534", "0.4874963", "0.48612353", "0.4856831", "0.48499197", "0.48396617", "0.48359558", "0.48329946", "0.48131204", "0.48109534", "0.4802762", "0.48000038", "0.4794631", "0.4794618", "0.4788256", "0.4787101", "0.4784077", "0.47819984", "0.4778511", "0.4774768", "0.47723997", "0.47696978", "0.47663623", "0.47657657", "0.47564307", "0.47528145", "0.47502983", "0.47433636", "0.47426915", "0.4722372", "0.4712971", "0.4711412", "0.47049156", "0.4696817", "0.46880805", "0.46838996", "0.46835503", "0.46768922", "0.46759915", "0.46757475", "0.46703392", "0.46699762", "0.46669233", "0.46621087", "0.4662064", "0.4661528", "0.46585128", "0.46574184", "0.46537688", "0.46519265", "0.4651824", "0.4651518", "0.46506768", "0.4645309", "0.4644516", "0.46434197", "0.46408355", "0.46312684", "0.462868", "0.4625001" ]
0.5356843
11
This command is used to apply credit from a clients credit balance to an invoice within WHMCS. Parameters: invoiceid the ID to apply the credit to amount the amount of credit to apply (must be less than or equal to clients available credit balance) Amount can also be passed as "full" to pay the invoice with credit (will only work when credit balance is sufficient) Optional Parameters: cvv can be used to pass the cards verification value in the payment request See:
public function whmcs_apply_credit($params = array()) { $params['action'] = 'ApplyCredit'; // return Whmcs_base::send_request($params); $load = new Whmcs_base(); return $load->send_request($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}", "function InfUpdateCreditCardCVV($inf_card_id, $CVV2) {\n\n\t$credit_card = new Infusionsoft_CreditCard();\n\t$credit_card->Id = $inf_card_id;\n\t$credit_card->CVV2 = $CVV2;\n\treturn $credit_card->save(); // Update Card in Infusionsoft\n}", "function ciniki_poma_accountApplyCredit(&$ciniki, $tnid, $args) {\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'orderUpdateStatusBalance');\n\n //\n // Load tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $tnid);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_timezone = $rc['settings']['intl-default-timezone'];\n\n //\n // Load the last entry in the customer ledger\n //\n $strsql = \"SELECT id, balance \"\n . \"FROM ciniki_poma_customer_ledgers \"\n . \"WHERE customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"ORDER BY transaction_date DESC \"\n . \"LIMIT 1 \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'entry');\n if( $rc['stat'] != 'ok') {\n return $rc;\n }\n if( !isset($rc['entry']) ) {\n $balance = 0;\n } else {\n $balance = $rc['entry']['balance'];\n }\n\n //\n // Apply the credit to the balance\n //\n $new_balance = bcadd($balance, $args['customer_amount'], 6);\n $credit_balance = $args['customer_amount'];\n\n //\n // Load any unpaid invoices\n //\n $strsql = \"SELECT ciniki_poma_orders.id, \"\n . \"ciniki_poma_orders.total_amount, \"\n . \"ciniki_poma_orders.balance_amount \"\n . \"FROM ciniki_poma_orders \"\n . \"WHERE ciniki_poma_orders.customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND ciniki_poma_orders.payment_status > 0 \"\n . \"AND ciniki_poma_orders.payment_status < 50 \"\n . \"AND ciniki_poma_orders.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'invoice');\n if( $rc['stat'] != 'ok') {\n return $rc;\n }\n if( isset($rc['rows']) ) {\n $unpaid_orders = $rc['rows'];\n //\n // Check if orders will get payment amounts\n //\n foreach($unpaid_orders as $oid => $order) {\n //\n // Skip any orders that might be screwed up with a negative balance\n //\n if( $order['balance_amount'] < 0 ) { \n continue;\n }\n if( $order['balance_amount'] < $credit_balance ) {\n $unpaid_orders[$oid]['payment_amount'] = $order['balance_amount'];\n $credit_balance = bcsub($credit_balance, $order['balance_amount'], 6);\n } else {\n $unpaid_orders[$oid]['payment_amount'] = $credit_balance;\n $credit_balance = 0;\n }\n if( $credit_balance <= 0 ) {\n break;\n }\n }\n }\n\n //\n // Add the ledger entry\n //\n $args['balance'] = $new_balance;\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.customerledger', $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $entry_id = $rc['id'];\n\n //\n // Apply credit to invoice if open unpaid invoices\n //\n if( isset($unpaid_orders) ) {\n foreach($unpaid_orders as $order) {\n if( isset($order['payment_amount']) && $order['payment_amount'] > 0 ) {\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.orderpayment', array(\n 'order_id'=>$order['id'],\n 'ledger_id'=>$entry_id,\n 'payment_type'=>$args['transaction_type'],\n 'amount'=>$order['payment_amount'],\n ), 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rc = ciniki_poma_orderUpdateStatusBalance($ciniki, $tnid, $order['id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n }\n }\n \n return array('stat'=>'ok', 'id'=>$entry_id);\n}", "public function setCreditCard($card_id, $num, $cvv, $date)\n {\n $this->cardid = $card_id;\n $this->creditcard_number = $num;\n $this->cvv = $cvv;\n $this->validation_date = $date;\n }", "function requestCashPointsPayment($conn, $userID, $cpAmount, $referenceID, $reason = '') {\n if(!is_numeric($userID) || !isset($conn) || !is_numeric($cpAmount) || !isset($referenceID))\n terminatePage('Request CP > parameter invalid.');\n\n $balance = checkCashPoints($conn, $userID);\n $transactionId = -1;\n if($balance <= 0 || $cpAmount <= 0 || $balance < $cpAmount)\n terminatePage(\"Error1\");\n\n $insert_row = $conn->query(\"INSERT INTO cashtable_transactiontable\n (amount, userid, referenceid, reasonid, reason) VALUES\n ($cpAmount, $userID, '$referenceID', 2, '$reason')\n \");\n\n if(!$insert_row)\n terminatePage(' ('. $conn->errno .') '. $conn->error);\n\n $transactionId = $conn->insert_id;\n\n $result = $conn->query(\"SELECT vt.id AS cpID, vt.cashpointbalance AS cpBalance \n FROM cashpoint_usertable AS ut INNER JOIN cashpoint_vaulttable AS vt \n WHERE vt.id = ut.cashpointId AND ut.userId = $userID AND ut.enabled = true AND vt.cashpointbalance = ut.availableBalance\n AND ut.availableBalance > 0 AND vt.datetimeexpiry > now();\");\n\n if ($result->num_rows <= 0)\n terminatePage(\"Error2\");\n\n $remainingBalance = $cpAmount;\n\n while($row = $result->fetch_assoc()) {\n $cpID = $row['cpID'];\n $cpBalance = $row['cpBalance'];\n\n $balanceToSubtract = 0.00;\n if($cpBalance >= $remainingBalance)\n $balanceToSubtract = $remainingBalance;\n else\n $balanceToSubtract = $cpBalance;\n\n $remainingBalance = $remainingBalance - $balanceToSubtract;\n\n $insert_row = $conn->query(\"INSERT INTO cashpoint_exchangetable\n (transactionId, cashpointId, amount) VALUES\n ($transactionId, $cpID, $balanceToSubtract)\n \");\n\n if(!$insert_row)\n terminatePage(' ('. $conn->errno .') '. $conn->error);\n\n if(!$conn->query(\"UPDATE cashpoint_usertable \n SET floatingBalance = floatingBalance + $balanceToSubtract, availableBalance = availableBalance - $balanceToSubtract \n WHERE `userid` = '$userID' AND cashpointId = '$cpID'\"))\n terminatePage(' ('. $conn->errno .') '. $conn->error);\n\n if(!$conn->query(\"UPDATE cashpoint_vaulttable \n SET cashpointbalance = cashpointbalance - $balanceToSubtract \n WHERE id = '$cpID'\"))\n terminatePage(' ('. $conn->errno .') '. $conn->error);\n\n if($remainingBalance <= 0)\n break;\n }\n\n $balance = checkCashPoints($conn, $userID);\n if($balance < 0)\n terminatePage(\"Error3\");\n\n return $transactionId;\n}", "public function add_chips_to_client($client_id,$balance)\n {\n $sql=\"UPDATE clients SET client_balance=client_balance+$balance where client_id=$client_id\";\n return $this->db->query($sql);\n }", "public function setCvv($cvv)\n {\n if (!Validation::validateCardDetails($this->creditCardNo, $this->expiryMonth, $this->expiryYear, $cvv)) {\n throw new \\InvalidArgumentException(\"Invalid CVV number\");\n }\n $this->cvv = $cvv;\n return $this;\n }", "public function contract($id = ''){\n\t\t\n\t\tif ($this->input->post('paiement')) {\n\t\t\t\n\t\t\t$medals = $this->input->post('medals_id');\n\t\t\t$method = $this->input->post('method');\n\t\t\t$date = $this->input->post('date_paid');\n\t\t\t\n\t\t\t$this->db->where('number', $medals);\n\t\t\t$this->db->set('date_paid', $date);\n\t\t\t$this->db->set('method', $method);\n\t\t\t$this->db->update('tblcontracts');\n\t\t\t//print_r($this->input->post());\n\t\t\t\n\t\t\t$this->db->where('id', 2);\n\t\t\t$item = $this->db->get('tblinvoiceitemslist')->row();\n\t\t\t\n\t\t\t$data['clientid'] = $this->input->post('clientid');\n\t\t\t$data['date'] = $date;\n\t\t\t$data['duedate'] = date('Y-m-d', strtotime(\"+30 days\"));\n\t\t\t$data['currency'] = \"2\";\n\t\t\t$data['clientnote'] = \"\";\n\t\t\t$data['adminnote'] = \"\";\n\t\t\t$data['terms'] = \"\";\n\t\t\t$data['discount_percent'] = \"0\";\n\t\t\t$data['discount_total'] = \"0\";\n\t\t\t$data['adjustment'] = \"0.00\";\n\t\t\t$data['subtotal'] = $item->rate;\n\t\t\t$data['total'] = $data['subtotal'];\n\t\t\t$data['allowed_payment_modes'] = 'a:6:{i:0;s:1:\"1\";i:1;s:1:\"2\";i:2;s:1:\"3\";i:3;s:1:\"4\";i:4;s:6:\"paypal\";i:5;s:6:\"stripe\";}';\n\t\t\t$data['discount_type'] = \"\";\n\t\t\t$data['recurring'] = \"18\";\n\t\t\t$data['number'] = $medals;\n\t\t\t$data['hash'] = md5(rand() . microtime());\n\t\t\t$data['status'] = 2;\n\t\t\t\n\t\t\t$data['newitems'] = Array ( 'item' => Array ( '2' => Array ( 'quantity' => Array ( 0 => 1 ) ) ) );\n\t\t\t\n\t\t\t$items = $data['newitems'];\n\t\t\t\n\t\t\tunset($data['newitems']);\n\t\t\t\n\t\t\t$this->db->insert('tblinvoices', $data);\n\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t$invoice_id = $insert_id;\n\t\t\tif ($insert_id) {\n\t\t\t\t$this->db->where('name', 'next_invoice_number');\n\t\t\t\t$this->db->set('value', 'value+1', FALSE);\n\t\t\t\t$this->db->update('tbloptions');\n\t\t\t\tif (count($items) > 0) {\n\t\t\t\t\tforeach ($items['item'] as $itemid => $quantity) {\n\t\t\t\t\t\t$this->db->insert('tblinvoiceitems', array(\n\t\t\t\t\t\t\t'invoiceid' => $insert_id,\n\t\t\t\t\t\t\t'itemid' => $itemid,\n\t\t\t\t\t\t\t'qty' => $quantity['quantity'][0]\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$this->db->where('number', $medals);\n $this->db->delete('tblnotused');\n\t\t\t\t\n\t\t\t\t$data_payment['invoiceid'] = $insert_id;\n\t\t\t\t$data_payment['amount'] = $data['subtotal'];\n\t\t\t\t$data_payment['paymentmode'] = 1;\n\t\t\t\t$data_payment['date'] = $date;\n\t\t\t\t$data_payment['daterecorded'] = $date;\n\t\t\t\t$data_payment['addedfrom'] = 1;\n\t\t\t\t\n\t\t\t\t$this->db->insert('tblinvoicepaymentrecords', $data_payment);\n\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\t\n\t\t\t\tif ($insert_id) {\n\t\t\t\t\t\n\t\t\t\t\t//$invoice = $this->invoices_model->get($invoice_id);\n\t\t\t\t\t//$invoice_number = format_invoice_number($invoice->number);\n\t\t\t\t\t//$pdf = invoice_pdf($invoice);\n\t\t\t //\n\t\t\t\t\t//$pdf->Output($invoice_number . '.pdf');\n\t\t\t\t\t\n\t\t\t\t\tredirect(admin_url('contracts/recherche?number='.$medals.'&openinvoice=1&invoice_id='.$invoice_id));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tif ($this->input->post('search_client')) {\n\t\t\t$this->db->like('phonenumber', $this->input->post('search_client'));\n\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\tif ($client) {\n\t\t\t\t$data = json_encode((array)$client);\n\t\t\t\techo $data;\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t$client = array('no_found'=>'no_found');\n\t\t\t\t$data = json_encode((array)$client);\n\t\t\t\techo $data;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif(!has_permission('manageContracts')){\n\t\t\taccess_denied('manageContracts');\n\t\t}\n\n\t\tif($this->input->post()){\n\t\t\t$this->load->helper('perfex_upload');\n\t\t\t\n\t\t\tif($id == ''){\n\t\t\t\t\n\t\t\t\tif (!empty($this->input->post('userid'))) {\n\t\t\t\t\t$cliendid = $this->input->post('userid');\n\t\t\t\t\n\t\t\t\t\t$this->db->where('userid', $cliendid);\n\t\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t} else {\n\t\t\t\t\t$phone = $this->input->post('phonenumber');\n\t\t\t\t\n\t\t\t\t\t$this->db->where('phonenumber', $phone);\n\t\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//print_r($client);\n\t\t\t\t\n\t\t\t\tif (empty($client)) {\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name']);\n\t\t\t\t\tunset($_POST['race']);\n\t\t\t\t\tunset($_POST['color']);\n\t\t\t\t\tunset($_POST['remarque']);\n\t\t\t\t\tunset($_POST['number']);\n\t\t\t\t\tunset($_POST['datecreated']);\n\t\t\t\t\tunset($_POST['userid']);\n\t\t\t\t\tunset($_POST['attachment']);\n\t\t\t\t\tunset($_POST['sexe']);\n\t\t\t\t\tunset($_POST['method']);\n\t\t\t\t\tunset($_POST['rfid']);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$user_id = $this->clients_model->add($_POST);\n\t\t\t\t\t$_POST['client'] = $user_id;\n\t\t\t\t} else {\n\t\t\t\t\t$_POST['client'] = $client->userid;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$medals = $this->input->post('number');\n\t\t\t\t$method = $this->input->post('method');\n\t\t\t\t$date = date('Y-m-d');\n\t\t\t\t\n\t\t\t\t$this->db->where('number', $medals);\n\t\t\t\t$this->db->set('date_paid', $date);\n\t\t\t\t$this->db->set('method', $method);\n\t\t\t\t$this->db->update('tblcontracts');\n\t\t\t\t//print_r($this->input->post());\n\t\t\t\t\n\t\t\t\t$this->load->model('invoice_items_model');\n\t\t\t\t$items = $this->invoice_items_model->get();\n\t\t\t\t\n\t\t\t\t//print_r($items);\n\t\t\t\t\n\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t$villes = explode(',',$item['description']);\n\t\t\t\t\tif ($villes[0] == 'Médaille') {\n\t\t\t\t\t\t$ville = $villes[1];\n\t\t\t\t\t\tif ($client->city == $ville) {\n\t\t\t\t\t\t\t$item_id = $item['itemid'];\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\tif ($item_id) {\n\t\t\t\t\t$item_select = $item_id;\n\t\t\t\t} else {\n\t\t\t\t\t$item_select = 2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tunset($item);\n\t\t\t\t\n\t\t\t\t$this->db->where('id', $item_select);\n\t\t\t\t$item = $this->db->get('tblinvoiceitemslist')->row();\n\t\t\t\t\n\t\t\t\t$data['clientid'] = $_POST['client'];\n\t\t\t\t$data['date'] = $date;\n\t\t\t\t$data['duedate'] = date('Y-m-d', strtotime(\"+30 days\"));\n\t\t\t\t$data['currency'] = \"2\";\n\t\t\t\t$data['clientnote'] = \"\";\n\t\t\t\t$data['adminnote'] = \"\";\n\t\t\t\t$data['terms'] = \"\";\n\t\t\t\t$data['discount_percent'] = \"0\";\n\t\t\t\t$data['discount_total'] = \"0\";\n\t\t\t\t$data['adjustment'] = \"0.00\";\n\t\t\t\t$data['subtotal'] = $item->rate;\n\t\t\t\t$data['total'] = $data['subtotal'];\n\t\t\t\t$data['allowed_payment_modes'] = 'a:6:{i:0;s:1:\"1\";i:1;s:1:\"2\";i:2;s:1:\"3\";i:3;s:1:\"4\";i:4;s:6:\"paypal\";i:5;s:6:\"stripe\";}';\n\t\t\t\t$data['discount_type'] = \"\";\n\t\t\t\t$data['recurring'] = \"18\";\n\t\t\t\t$data['number'] = $medals;\n\t\t\t\t$data['hash'] = md5(rand() . microtime());\n\t\t\t\t$data['status'] = 2;\n\t\t\t\t\n\t\t\t\tif ($_POST['animal_name2']) {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 2 ) ) ) );\n\t\t\t\t} else if ($_POST['animal_name3']) {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 3 ) ) ) );\n\t\t\t\t} else {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 1 ) ) ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$items = $data['newitems'];\n\t\t\t\t\n\t\t\t\tunset($data['newitems']);\n\t\t\t\t\n\t\t\t\t$this->db->insert('tblinvoices', $data);\n\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\tif ($insert_id) {\n\t\t\t\t\t$this->db->where('name', 'next_invoice_number');\n\t\t\t\t\t$this->db->set('value', 'value+1', FALSE);\n\t\t\t\t\t$this->db->update('tbloptions');\n\t\t\t\t\tif (count($items) > 0) {\n\t\t\t\t\t\tforeach ($items['item'] as $itemid => $quantity) {\n\t\t\t\t\t\t\t$this->db->insert('tblinvoiceitems', array(\n\t\t\t\t\t\t\t\t'invoiceid' => $insert_id,\n\t\t\t\t\t\t\t\t'itemid' => $itemid,\n\t\t\t\t\t\t\t\t'qty' => $quantity['quantity'][0]\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->db->where('number', $medals);\n\t\t\t\t\t$this->db->delete('tblnotused');\n\t\t\t\t\t\n\t\t\t\t\t$data_payment['invoiceid'] = $insert_id;\n\t\t\t\t\t$data_payment['amount'] = $data['subtotal'];\n\t\t\t\t\t$data_payment['paymentmode'] = 1;\n\t\t\t\t\t$data_payment['date'] = $date;\n\t\t\t\t\t$data_payment['daterecorded'] = $date;\n\t\t\t\t\t$data_payment['addedfrom'] = 1;\n\t\t\t\t\t\n\t\t\t\t\t$this->db->insert('tblinvoicepaymentrecords', $data_payment);\n\t\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$POST_data = $_POST;\n\t\t\t\t\n\t\t\t\t//print_r($this->input->post());\n\t\t\t\tunset($POST_data['firstname']);\n\t\t\t\tunset($POST_data['lastname']);\n\t\t\t\tunset($POST_data['email']);\n\t\t\t\tunset($POST_data['phonenumber']);\n\t\t\t\tunset($POST_data['phone_other']);\n\t\t\t\tunset($POST_data['no_civique']);\n\t\t\t\tunset($POST_data['address']);\n\t\t\t\tunset($POST_data['app']);\n\t\t\t\tunset($POST_data['city']);\n\t\t\t\tunset($POST_data['state']);\n\t\t\t\tunset($POST_data['zip']);\n\t\t\t\tunset($POST_data['password']);\n\t\t\t\tunset($POST_data['userid']);\n\n\t\t\t\t\n\t\t\t\tif ($_POST['animal_name2']) {\n\t\t\t\t\t\n\t\t\t\t\t$POST_data2['animal_name'] = $_POST['animal_name2'];\n\t\t\t\t\t$POST_data2['race'] = $_POST['race2'];\n\t\t\t\t\t$POST_data2['color'] = $_POST['color2'];\n\t\t\t\t\t$POST_data2['remarque'] = $_POST['remarque2'];\n\t\t\t\t\t$POST_data2['number'] = $_POST['number2'];\n\t\t\t\t\t$POST_data2['attachment'] = $_POST['attachment2'];\n\t\t\t\t\t$POST_data2['sexe'] = $_POST['sexe2'];\n\t\t\t\t\t$POST_data2['method'] = $_POST['method2'];\n\t\t\t\t\t$POST_data2['rfid'] = $_POST['rfid2'];\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name2']);\n\t\t\t\t\tunset($_POST['race2']);\n\t\t\t\t\tunset($_POST['color2']);\n\t\t\t\t\tunset($_POST['remarque2']);\n\t\t\t\t\tunset($_POST['number2']);\n\t\t\t\t\tunset($_POST['attachment2']);\n\t\t\t\t\tunset($_POST['sexe2']);\n\t\t\t\t\tunset($_POST['method2']);\n\t\t\t\t\tunset($_POST['rfid2']);\n\t\t\t\t\t\n\t\t\t\t\t$POST_data2['date_paid'] = $date;\n\t\t\t\t\t$POST_data2['method'] = $method;\n\t\t\t\t\t\n\t\t\t\t\t$id = $this->contracts_model->add($POST_data2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tunset($POST_data['animal_name2']);\n\t\t\t\t\tunset($POST_data['race2']);\n\t\t\t\t\tunset($POST_data['color2']);\n\t\t\t\t\tunset($POST_data['remarque2']);\n\t\t\t\t\tunset($POST_data['number2']);\n\t\t\t\t\tunset($POST_data['attachment2']);\n\t\t\t\t\tunset($POST_data['sexe2']);\n\t\t\t\t\tunset($POST_data['method2']);\n\t\t\t\t\tunset($POST_data['rfid2']);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif ($_POST['animal_name3']) {\n\t\t\t\t\t\n\t\t\t\t\t$POST_data3['animal_name'] = $_POST['animal_name3'];\n\t\t\t\t\t$POST_data3['race'] = $_POST['race3'];\n\t\t\t\t\t$POST_data3['color'] = $_POST['color3'];\n\t\t\t\t\t$POST_data3['remarque'] = $_POST['remarque3'];\n\t\t\t\t\t$POST_data3['number'] = $_POST['number3'];\n\t\t\t\t\t$POST_data3['attachment'] = $_POST['attachment3'];\n\t\t\t\t\t$POST_data3['sexe'] = $_POST['sexe3'];\n\t\t\t\t\t$POST_data3['method'] = $_POST['method3'];\n\t\t\t\t\t$POST_data3['rfid'] = $_POST['rfid3'];\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name3']);\n\t\t\t\t\tunset($_POST['race3']);\n\t\t\t\t\tunset($_POST['color3']);\n\t\t\t\t\tunset($_POST['remarque3']);\n\t\t\t\t\tunset($_POST['number3']);\n\t\t\t\t\tunset($_POST['attachment3']);\n\t\t\t\t\tunset($_POST['sexe3']);\n\t\t\t\t\tunset($_POST['method3']);\n\t\t\t\t\tunset($_POST['rfid3']);\n\t\t\t\t\t\n\t\t\t\t\t$POST_data3['date_paid'] = $date;\n\t\t\t\t\t$POST_data3['method'] = $method;\n\t\t\t\t\t\n\t\t\t\t\t$id = $this->contracts_model->add($POST_data3);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tunset($POST_data['animal_name3']);\n\t\t\t\t\tunset($POST_data['race3']);\n\t\t\t\t\tunset($POST_data['color3']);\n\t\t\t\t\tunset($POST_data['remarque3']);\n\t\t\t\t\tunset($POST_data['number3']);\n\t\t\t\t\tunset($POST_data['attachment3']);\n\t\t\t\t\tunset($POST_data['sexe3']);\n\t\t\t\t\tunset($POST_data['method3']);\n\t\t\t\t\tunset($POST_data['rfid3']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$POST_data['date_paid'] = $date;\n\t\t\t\t$POST_data['method'] = $method;\n\t\t\t\t\n\t\t\t\t$id = $this->contracts_model->add($POST_data);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($id){\n\t\t\t\t\thandle_contract_attachment($id);\n\t\t\t\t\tset_alert('success', _l('added_successfuly',_l('contract')));\n\t\t\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//echo 'sa';\n\t\t\t\tunset($_POST['firstname']);\n\t\t\t\tunset($_POST['lastname']);\n\t\t\t\tunset($_POST['email']);\n\t\t\t\tunset($_POST['phonenumber']);\n\t\t\t\tunset($_POST['phone_other']);\n\t\t\t\tunset($_POST['no_civique']);\n\t\t\t\tunset($_POST['address']);\n\t\t\t\tunset($_POST['app']);\n\t\t\t\tunset($_POST['city']);\n\t\t\t\tunset($_POST['state']);\n\t\t\t\tunset($_POST['zip']);\n\t\t\t\tunset($_POST['password']);\n\t\t\t\tunset($_POST['userid']);\n\t\t\t\tunset($_POST['animal_name2']);\n\t\t\t\tunset($_POST['race2']);\n\t\t\t\tunset($_POST['color2']);\n\t\t\t\tunset($_POST['remarque2']);\n\t\t\t\tunset($_POST['number2']);\n\t\t\t\tunset($_POST['attachment2']);\n\t\t\t\tunset($_POST['sexe2']);\n\t\t\t\tunset($_POST['method2']);\n\t\t\t\tunset($_POST['rfid2']);\n\t\t\t\tunset($_POST['animal_name3']);\n\t\t\t\tunset($_POST['race3']);\n\t\t\t\tunset($_POST['color3']);\n\t\t\t\tunset($_POST['remarque3']);\n\t\t\t\tunset($_POST['number3']);\n\t\t\t\tunset($_POST['attachment3']);\n\t\t\t\tunset($_POST['sexe3']);\n\t\t\t\tunset($_POST['method3']);\n\t\t\t\tunset($_POST['rfid3']);\n\t\t\t\t\n\t\t\t\t$contract_id = $_POST['edit'];\n\t\t\t\tunset($_POST['edit']);\n\t\t\t\t\n\t\t\t\t//print_r($_POST);\n\t\t\t\t\n\t\t\t\t$this->db->where('userid', $cliendid);\n\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t\n\t\t\t\t$_POST['number'];\n\t\t\t\t\n\t\t\t\t$success = $this->contracts_model->update($_POST, $contract_id);\n\n\t\t\t\tif($success){\n\t\t\t\t\tset_alert('success', _l('updated_successfuly',_l('contract')));\n\t\t\t\t} else {\n\t\t\t\t\tset_alert('warning', 'Numéro déjà utilisé');\n\t\t\t\t}\n\n\t\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t}\n\t\t}\n\n\t\tif($id == ''){\n\t\t\t$title = 'Ajouter nouvelle médaille';\n\t\t} else {\n\t\t\t$data['attachment'] = $this->contracts_model->get_contract_attachment($id);\n\t\t\t$data['contract'] = $this->contracts_model->get($id);\n\t\t\t$this->load->model('payment_modes_model');\n\t\t\t$data['payment_modes'] = $this->payment_modes_model->get();\n\t\t\t$client_id = $data['contract']->client;\n\t\t\t$data['client'] = $this->clients_model->get($client_id);\n\t\t\tif(!$data['contract']){\n\t\t\t\tblank_page(_l('contract_not_found'));\n\t\t\t}\n\t\t\t$title = _l('edit',_l('contract_lowercase'));\n\t\t}\n\t\t\n\t\t$this->load->model('payment_modes_model');\n $data['payment_modes'] = $this->payment_modes_model->get();\n\n\t\t$data['types'] = $this->contracts_model->get_contract_types();\n\t\t$this->load->model('clients_model');\n\t\t$data['clients'] = $this->clients_model->get();\n\t\t$data['title'] = $title;\n\t\t$this->load->view('admin/contracts/contract',$data);\n\t}", "public function editCustomerCreditCard($data) {\n\t\t$soapclient = new SoapClient($this->pci);\n\n\t\t$params = [\n\t\t\t\t'DigitalKey' => $this->digitalKey,\n\t\t\t\t'EziDebitCustomerID' => $data['eziDebitCID'],\n\t\t\t\t'YourSystemReference' => $data['systemRef'],\n\t\t\t\t'NameOnCreditCard' => $data['cardName'],\n\t\t\t\t'CreditCardNumber' => $data['cardNumber'],\n\t\t\t\t'CreditCardExpiryYear' => $data['cardExpiryYear'],\n\t\t\t\t'CreditCardExpiryMonth' => $data['cardExpiryMonth'],\n\t\t\t\t'Reactivate' => $data['reactivate'],\n\t\t\t\t'Username' => $data['username']\n\t\t];\n\n\t\treturn $soapclient->editCustomerCreditCard($params);\n\t}", "function InfAddCreditCard($inf_contact_id, $CardNumber, $ExpirationMonth, $ExpirationYear, $CVV2, $BillName, $BillAddress1, $BillCity, $BillState, $BillZip, $BillCountry) {\n\n\t$credit_card = new Infusionsoft_CreditCard();\n\t$credit_card->ContactId = $inf_contact_id;\n\t$credit_card->CardNumber = $CardNumber;\n\t$credit_card->CVV2 = $CVV2;\n\t$credit_card->CardType = WriteCardType($CardNumber);\n#\t$credit_card->Status = 3; //0: Unknown, 1: Invalid, 2: Deleted, 3: Valid/Good, 4: Inactive\n\t$credit_card->ExpirationMonth = $ExpirationMonth;\n\t$credit_card->ExpirationYear = $ExpirationYear;\n\t$credit_card->BillName = $BillName;\n\t$credit_card->BillAddress1 = $BillAddress1;\n\t$credit_card->BillCity = $BillCity;\n\t$credit_card->BillState = $BillState;\n\t$credit_card->BillZip = $BillZip;\n\t$credit_card->BillCountry = $BillCountry;\n\t\n\t# Return card id\n\treturn $credit_card->save();\n}", "public function update(Request $request, Contract $avtocredit)\n {\n $request->validate(array_merge(\n Borrower::$validate,\n Client::$validate,\n Contract::$validate,\n ContractLeasingAutocredit::$validate,\n [\n 'policies.*.name' => 'required',\n 'policies.*.series' => 'required',\n 'policies.*.date_of_issue' => 'required',\n 'policies.*.insurance_sum' => ['required', 'numeric', 'min:0'],\n 'policies.*.franchise' => ['required', 'numeric', 'min:0'],\n\n 'policies.*.policy_leasing_autocredit.issue_year' => 'required',\n 'policies.*.policy_leasing_autocredit.brand' => 'required',\n 'policies.*.policy_leasing_autocredit.model' => 'required',\n 'policies.*.policy_leasing_autocredit.government_number' => 'required',\n 'policies.*.policy_leasing_autocredit.techpassport_number' => 'required',\n 'policies.*.policy_leasing_autocredit.engine_number' => 'required',\n 'policies.*.policy_leasing_autocredit.carcase_number' => 'required',\n 'policies.*.policy_leasing_autocredit.insurance_value' => ['required', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ae_additional_insured_sum' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ac_terrorist_attack_for_car' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ac_terrorist_attack_for_human' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ac_terrorist_attack_evacuation' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ec_vehicle_death_recovery_sum' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ec_vehicle_death_recovery_premium' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ec_vehicle_death_recovery_franchise' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ec_civil_liability_sum' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ec_civil_liability_premium' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ec_driver_sum_for_person' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ec_driver_premium' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ec_passenger_sum_for_person' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ec_passenger_premium' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ec_general_limit_sum_for_person' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ec_general_limit_premium' => ['nullable', 'numeric', 'min:0'],\n 'policies.*.policy_leasing_autocredit.ec_general_limit_responsibility' => ['nullable', 'numeric', 'min:0'],\n\n 'tranches.*.sum' => ['required', 'numeric', 'min:0'],\n 'tranches.*.from' => 'required',\n ]\n ));\n\n $contract = $avtocredit;\n\n $borrower = $contract->borrower;\n $borrower->fill($request['borrower']);\n $borrower->save();\n\n $client = $contract->client;\n $client->fill($request['client']);\n $client->save();\n\n $contract_leasing_autocredit = $contract->contract_model;\n $contract_leasing_autocredit->fill($request['contract_leasing_autocredit']);\n $contract_leasing_autocredit->save();\n\n $contract->fill($request['contract']);\n $contract->save();\n\n if ($request['policies']) {\n $policies_ids = [];\n\n foreach($request['policies'] as $policy_data) {\n $policy = Policy::where('contract_id', '=', $contract->id)\n ->where('name', '=', $policy_data['name'])\n ->where('series', '=', $policy_data['series'])\n ->get()\n ->first();\n\n if ($policy) {\n $policy_leasing_autocredit = $policy->policy_model;\n $policy_leasing_autocredit->fill($policy_data['policy_leasing_autocredit']);\n $policy_leasing_autocredit->save();\n\n unset($policy_data['policy_leasing_autocredit']);\n\n $policy->fill($policy_data);\n $policy->save();\n } else {\n $policy = Policy::where('name', '=', $policy_data['name'])\n ->where('series', '=', $policy_data['series'])\n ->get()\n ->first();\n\n if ($policy) {\n $policy_leasing_autocredit = PolicyLeasingAutocredit::create($policy_data['policy_leasing_autocredit']);\n\n unset($policy_data['policy_leasing_autocredit']);\n\n $policy_data['contract_id'] = $contract->id;\n $policy_data['model_type'] = PolicyLeasingAutocredit::class;\n $policy_data['model_id'] = $policy_leasing_autocredit->id;\n\n $policy->fill($policy_data);\n $policy->save();\n }\n }\n\n $policies_ids[] = $policy->id;\n }\n\n $policies = Policy::where('contract_id', '=', $contract->id)\n ->whereNotIn('id', $policies_ids)\n ->get();\n foreach($policies as /* @var $policy Policy */ $policy) {\n $policy->delete();\n }\n }\n\n if ($request['tranches']) {\n $tranche_ids = [];\n\n foreach($request['tranches'] as $tranche_data) {\n $tranche = Tranche::where('contract_id', '=', $contract->id)\n ->where('from', '=', $tranche_data['from'])\n ->get()\n ->first();\n\n if ($tranche) {\n if ($tranche->sum != $tranche_data['sum']) {\n $tranche->sum = $tranche_data['sum'];\n $tranche->save();\n }\n } else {\n $tranche = $contract->tranches()->create($tranche_data);\n }\n\n $tranche_ids[] = $tranche->id;\n }\n\n Tranche::where('contract_id', '=', $contract->id)\n ->whereNotIn('id', $tranche_ids)\n ->delete();\n }\n\n $contract_files = [];\n if (isset($request['files'])) {\n foreach($request['files'] as $type => $file) {\n if ($old_file = $contract->getFile($type)) {\n $old_file->delete();\n }\n\n $contract_files[] = [\n 'type' => $type,\n 'original_name' => $file->getClientOriginalName(),\n 'path' => Storage::putFile('public/contract', $file),\n ];\n }\n }\n\n $contract->files()->createMany($contract_files);\n\n return redirect()->route('contracts.index')\n ->with('success', 'Успешно произведено изменение контракта');\n }", "function update_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no'; \n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"creditcards \n SET creditcard_number = '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n creditcard_type = '\" . mb_strtolower($form['type']) . \"',\n date_updated = '\" . DATETIME24H . \"',\n creditcard_expiry = '\" . $form['expmon'] . $form['expyear'] . \"',\n cvv2 = '\" . $ilance->db->escape_string($form['cvv2']) . \"',\n name_on_card = '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n phone_of_cardowner = '\" . $ilance->db->escape_string($form['phone']) . \"',\n email_of_cardowner = '\" . $ilance->db->escape_string($form['email']) . \"',\n card_billing_address1 = '\" . $ilance->db->escape_string($form['address1']) . \"',\n card_billing_address2 = '\" . $ilance->db->escape_string($form['address2']) . \"',\n card_city = '\" . $ilance->db->escape_string($form['city']) . \"',\n card_state = '\" . $ilance->db->escape_string($form['state']) . \"',\n card_postalzip = '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n card_country = '\" . $ilance->db->escape_string($form['countryid']) . \"',\n authorized = '\" . $ilance->db->escape_string($form['authorized']) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n AND cc_id = '\" . $ilance->db->escape_string($form['cc_id']) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_updated_creditcard');\t\t\n $ilance->email->set(array(\n '{{member}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n return true;\n }", "function update_customer_balance($customer_id){\n\t\t$customer_id = sanitize($customer_id);\n\n\t\tmysqli_query_(\"UPDATE customers set `total_cash_in`=(SELECT sum(cash_in) FROM transactions WHERE customer_id='$customer_id'), `total_cash_out`=(SELECT sum(cash_out) FROM transactions WHERE customer_id='$customer_id'),`current_ksh_balance`=(SELECT sum(cash_in) FROM transactions WHERE customer_id='$customer_id') - (SELECT sum(cash_out) FROM transactions WHERE customer_id='$customer_id'),\n\n\t\t`total_dollar_in`=(SELECT sum(dollar_in) FROM transactions WHERE customer_id='$customer_id'), `total_dollar_out`=(SELECT sum(dollar_out) FROM transactions WHERE customer_id='$customer_id'),`current_dollar_balance`=(SELECT sum(dollar_in) FROM transactions WHERE customer_id='$customer_id') - (SELECT sum(dollar_out) FROM transactions WHERE customer_id='$customer_id') where customer_id='$customer_id' \");\n\n}", "public function subtract_chips_from_client($client_id,$balance)\n {\n $sql=\"UPDATE clients SET client_balance=client_balance-$balance where client_id=$client_id\";\n return $this->db->query($sql);\n }", "function InfUpdateCreditCard($inf_card_id, $CardNumber='', $ExpirationMonth, $ExpirationYear, $NameOnCard, $BillAddress1, $BillCity, $BillState, $BillZip, $BillCountry) {\n\n\t$credit_card = new Infusionsoft_CreditCard();\n\t$credit_card->Id = $inf_card_id;\n\tif ($CreditCard<>\"\") {\n\t\t$credit_card->CardNumber = $CardNumber;\n\t}\n\t$credit_card->ExpirationMonth = $ExpirationMonth;\n\t$credit_card->ExpirationYear = $ExpirationYear;\n\t$credit_card->NameOnCard = $NameOnCard;\n\t$credit_card->BillAddress1 = $BillAddress1;\n\t$credit_card->BillCity = $BillCity;\n\t$credit_card->BillState = $BillState;\n\t$credit_card->BillZip = $BillZip;\n\t$credit_card->BillCountry = $BillCountry;\n\treturn $credit_card->save(); // Update Card in Infusionsoft\n}", "public function setCvv($cvv)\n {\n $this->cvv = $cvv;\n return $this;\n }", "function addCredit($credit, $id) { // user_charge.php, user_charge_package_10.php\r\n\r\n\tglobal $mysqli,$db_table_prefix; \r\n\r\n\t\t$stmt = $mysqli->prepare(\"UPDATE \".$db_table_prefix.\"user_credits\r\n\r\n\t\t\tSET\r\n\r\n\t\t\tcredits = credits + ?\r\n\r\n\t\t\tWHERE\r\n\r\n\t\t\tuser_id = ?\r\n\t\t\t\r\n\t\t\tAND credits >= 0\");\r\n\r\n\t$stmt->bind_param(\"ii\", $credit, $id);\r\n\r\n\t$result = $stmt->execute();\r\n\r\n\t$stmt->close();\t\r\n\r\n\treturn $result;\r\n\r\n}", "function openstack_change_funds($invoiceid, $substract=False) {\n $items = Capsule::table('tblinvoiceitems')->where('invoiceid', '=', $invoiceid)->get();\n\n // Retrieve the invoice total paid.\n // If this invoice was not fully paid, we do not substract from Fleio.\n // There is no other way to prevent subtracting from Fleio when cancelling an invoice and marking it unpaid afterwards\n try {\n $balance = Capsule::table('tblaccounts as ta')\n ->where('ta.invoiceid', '=', $invoiceid)\n ->join('tblinvoices as ti', 'ta.invoiceid', '=', 'ti.id')\n ->select(Capsule::raw('SUM(ta.amountin)-SUM(ta.amountout)-ti.total as balance'))\n ->value('balance');\n } catch (Exception $e) {\n logActivity($e->getMessage());\n $balance = false;\n } \n $cost_by_service = array();\n $promo_by_service = array();\n foreach($items as $item) {\n # NOTE(tomo): Check if relid is set and not an empty string\n if (($item->relid == '') || !isset($item->relid)) {\n continue;\n }\n if ($item->type == 'PromoHosting') {\n # NOTE(tomo): Do nothing with $promo_by_service. Just don't add it\n # to the final amount to avoid incorrect credit addition in Fleio\n if (isset($promo_by_service[$item->relid])) {\n $promo_by_service[$item->relid] += $item->amount;\n } else {\n $promo_by_service[$item->relid] = $item->amount;\n }\n } else {\n if (isset($cost_by_service[$item->relid])) {\n $cost_by_service[$item->relid] += $item->amount;\n } else {\n $cost_by_service[$item->relid] = $item->amount;\n }\n }\n }\n\n foreach($items as $item) {\n if (($item->type != 'Hosting') || !isset($cost_by_service[$item->relid])) {\n continue;\n }\n # We now know that relid is a Hosting package (not a Domain for example)\n $service = FleioUtils::getServiceById($item->relid);\n if ($service->servertype == 'fleio') {\n # NOTE(tomo): Make sure the service is active. If it's not active and we don't handle this, the credit is lost.\n # NOTE(tomo): We currently handle this in the add/remove credit methods.\n $clientCurrency = getCurrency($item->userid);\n $defaultCurrency = getCurrency();\n $clientAmount = $cost_by_service[$item->relid]; // Amount + Setup and/or other related prices in client's currency\n # NOTE(tomo): Fleio needs to use the WHMCS default currency\n $amount = convertCurrency($clientAmount, 1, $clientCurrency['id']); // Amount in default currency.\n if ($amount == 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid . ' with cost equal to 0 from Invoice ID: ' . $invoiceid);\n continue;\n }\n if ($substract && $balance != false && $balance >= 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid .' from Invoice ID: ' . $invoiceid . ' with status Unpaid but fully paid');\n continue;\n }\n $fl = Fleio::fromServiceId($item->relid);\n if ($substract) {\n $msg_format = \"Fleio: removing credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n } else {\n $msg_format = \"Fleio: adding credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n }\n $msg = sprintf($msg_format, $item->userid, $amount, $defaultCurrency[\"code\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n logActivity($msg);\n # TODO(tomo): We use the userid which can be a contact ?\n try {\n $addCredit = (!$subtract); // Add credit or subtract, boolean\n $response = $fl->clientChangeCredit($addCredit, $amount, $defaultCurrency[\"code\"], $clientCurrency[\"rate\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n } catch (FlApiException $e) {\n logActivity(\"Unable to update the client credit in Fleio: \" . $e->getMessage()); \n return;\n }\n logActivity(\"Fleio: successfully changed client credit with \".$amount.\" \".$defaultCurrency[\"code\"]. \" for Fleio client id: \".$response['client'].\". New Fleio balance: \".$response['credit_balance'].\" \".$defaultCurrency[\"code\"]); \n }\n }\n}", "public function setCredit($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->credit !== $v || $v === 0) {\n\t\t\t$this->credit = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::CREDIT;\n\t\t}\n\n\t\treturn $this;\n\t}", "protected function pingTreeTargetBuyerSetConcurrencyCapRequest($id, $request, $accountid)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling pingTreeTargetBuyerSetConcurrencyCap'\n );\n }\n // verify the required parameter 'request' is set\n if ($request === null || (is_array($request) && count($request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $request when calling pingTreeTargetBuyerSetConcurrencyCap'\n );\n }\n // verify the required parameter 'accountid' is set\n if ($accountid === null || (is_array($accountid) && count($accountid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accountid when calling pingTreeTargetBuyerSetConcurrencyCap'\n );\n }\n\n $resourcePath = '/{accountid}/pingtreetargets/{id}/BuyerSetConcurrencyCap';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($accountid !== null) {\n $resourcePath = str_replace(\n '{' . 'accountid' . '}',\n ObjectSerializer::toPathValue($accountid),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($request)) {\n $_tempBody = $request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function PaymentCredit()\n {\n\n $condition = array('id' => $this->checkLogin('U'));\n $userDetails = $this->checkout_model->get_all_details(USERS, $condition);\n $currency_code = $this->input->post('currencycode');\n\t\t\t$user_currencycode = $this->input->post('user_currencycode');\n if ($this->input->post('creditvalue') == 'authorize') {\n $Auth_Details = unserialize(API_LOGINID);\n $Auth_Setting_Details = unserialize($Auth_Details['settings']);\n error_reporting(-1);\n define(\"AUTHORIZENET_API_LOGIN_ID\", $Auth_Setting_Details['merchantcode']);\n define(\"AUTHORIZENET_TRANSACTION_KEY\", $Auth_Setting_Details['merchantkey']);\n define(\"API_MODE\", $Auth_Setting_Details['mode']);\n if (API_MODE == 'sandbox') {\n define(\"AUTHORIZENET_SANDBOX\", true);\n } else {\n define(\"AUTHORIZENET_SANDBOX\", false);\n }\n \n define(\"TEST_REQUEST\", \"FALSE\");\n require_once './authorize/autoload.php';\n\n $transaction = new AuthorizeNetAIM;\n $transaction->setSandbox(AUTHORIZENET_SANDBOX);\n\n\t\t\t\t$payable_amount = currency_conversion($this->input->post('user_currencycode'), 'USD', $this->input->post('total_price'),$this->input->post('currency_cron_id'));\n //echo $payable_amount;exit();\n $transaction->setFields(array('amount' => $payable_amount, 'card_num' => $this->input->post('cardNumber'), 'exp_date' => $this->input->post('CCExpMonth') . '/' . $this->input->post('CCExpYear'), 'first_name' => $userDetails->row()->firstname, 'last_name' => $userDetails->row()->lastname, 'address' => $this->input->post('address'), 'city' => $this->input->post('city'), 'state' => $this->input->post('state'), 'country' => $userDetails->row()->country, 'phone' => $userDetails->row()->phone_no, 'email' => $userDetails->row()->email, 'card_code' => $this->input->post('creditCardIdentifier'),));\n\n $response = $transaction->authorizeAndCapture();\n //print_r($response);exit();\n\n // echo $this->input->post('total_price');exit();\n if ($response->approved != '') {\n $product_id = $this->input->post('booking_rental_id');\n $product = $this->checkout_model->get_all_details(PRODUCT, array('id' => $product_id));\n $totalAmnt = $this->input->post('total_price');\n $enquiryid = $this->input->post('enquiryid');\n $loginUserId = $this->checkLogin('U');\n // echo $totalAmnt;exit();\n if ($this->session->userdata('randomNo') != '') {\n $delete = 'delete from ' . PAYMENT . ' where dealCodeNumber = \"' . $this->session->userdata('randomNo') . '\" and user_id = \"' . $loginUserId . '\" ';\n $this->checkout_model->ExecuteQuery($delete, 'delete');\n $dealCodeNumber = $this->session->userdata('randomNo');\n } else {\n $dealCodeNumber = mt_rand();\t\n }\n $insertIds = array();\n $now = date(\"Y-m-d H:i:s\");\n $paymentArr = array('product_id' => $product_id, 'sell_id' => $product->row()->user_id, 'price' => $totalAmnt, 'indtotal' => $product->row()->price, 'sumtotal' => $totalAmnt, 'user_id' => $loginUserId, 'created' => $now, 'dealCodeNumber' => $dealCodeNumber, 'status' => 'Paid', 'shipping_status' => 'Pending', 'total' => $totalAmnt, 'EnquiryId' => $enquiryid, 'inserttime' => NOW(), 'currency_code' => $user_currencycode);\n /* referal user commission payment starts */\n $referred_user = $this->checkout_model->get_all_details(USERS, array('id' => $loginUserId));\n $refered_user = $referred_user->row()->referId;\n $user_booked = $this->checkout_model->get_all_details(PAYMENT, array('user_id' => $loginUserId, 'status' => 'Paid'));\n if ($user_booked->num_rows() == 0) {\n $totalAmount = $totalAmnt;\n $currencyCode = $currency_code;\n $book_commission_query = 'SELECT * FROM ' . INVITE . ' WHERE email = \"'.$userDetails->row()->email.'\"';\n $book_commission = $this->checkout_model->ExecuteQuery($book_commission_query);\n if ($book_commission->num_rows() > 0) {\n // if ($book_commission->row()->promotion_type == 'flat') {\n // $referal_commission = round($totalAmount - $book_commission->row()->commission_percentage, 2);\n // } else {\n // $commission = round(($book_commission->row()->commission_percentage / 100), 2);\n // $referal_commission = ($totalAmount * $commission);\n // }\n $commission = round(($book_commission->row()->commission_persent / 100), 2);\n $referal_commission = ($totalAmount * $commission);\n if ($currencyCode != 'USD') {\n // ,$this->input->post('currency_cron_id')\n $referal_commission = convertCurrency($currencyCode, 'USD', $referal_commission);\n }\n $referred_userData = $this->checkout_model->get_all_details(USERS, array('id' => $refered_user));\n $existAmount = $referred_userData->row()->referalAmount;\n $exit_totalReferalAmount = $referred_userData->row()->totalReferalAmount;\n $existAmountCurrenctCode = $referred_userData->row()->referalAmount_currency;\n if ($existAmountCurrenctCode != 'USD') {\n $existAmount = convertCurrency($existAmountCurrenctCode, 'USD', $existAmount);\n $exit_totalReferalAmount = convertCurrency($existAmountCurrenctCode, 'USD', $exit_totalReferalAmount);\n }\n $tot_commission = $existAmount + $referal_commission;\n $new_totalReferalAmount = $exit_totalReferalAmount + $referal_commission;\n $inputArr_ref = array('totalReferalAmount' => $new_totalReferalAmount, 'referalAmount' => $tot_commission, 'referalAmount_currency' => 'USD');\n $this->checkout_model->update_details(USERS, $inputArr_ref, array('id' => $refered_user));\n }\n }\n $this->checkout_model->simple_insert(PAYMENT, $paymentArr);\n $insertIds[] = $this->db->insert_id();\n $paymtdata = array('randomNo' => $dealCodeNumber, 'randomIds' => $insertIds);\n $this->session->set_userdata($paymtdata, $currency_code);\n $this->product_model->edit_rentalbooking(array('booking_status' => 'Booked'), array('id' => $enquiryid));\n $lastFeatureInsertId = $this->session->userdata('randomNo');\n\t\t\t\t\t\n redirect('order/success/' . $loginUserId . '/' . $lastFeatureInsertId . '/' . $response->transaction_id);\n } else {\n // echo $this->input->post('total_price');exit();\n $this->session->set_userdata('payment_error', $response->response_reason_text);\n redirect('order/failure');\n }\n }\n }", "public function credit ($number)\n {\n $req = new FortieRequest();\n $req->method('PUT');\n $req->path($this->basePath)->path($number)->path('credit');\n\n return $this->send($req->build());\n }", "function EditDeposit($companyid) {\r\n $conn = conn();\r\n $sql = \"UPDATE `deposit` SET `CompanyId`='$this->CompanyId',`DepositAmount`='$this->DepositAmount',`PreviousBalance`='$this->PreviousBalance',\r\n `CurrentBalance`='$this->CurrentBalance',`Comments`='$this->Comments',`RecEntered`=NOW(),RecEnteredBy='$this->ReEnteredBy' WHERE `CompanyId`='$companyid'\";\r\n if ($conn->exec($sql)) {\r\n $this->auditok = 1;\r\n } else {\r\n $this->auditok = 0;\r\n }\r\n $conn = NULL;\r\n }", "public function testRefundOnlineWithGiftCardAccountByInvoice(): void\n {\n $codes = [];\n $qty = 0;\n $order = $this->getOrder();\n $orderItems = $order->getItems();\n\n /** @var Pool $poolResourceModel */\n $poolResourceModel = $this->objectManager->get(Pool::class);\n $poolResourceModel->saveCode('fixture_code_1');\n $poolResourceModel->saveCode('fixture_code_2');\n\n $invoiceItems = $order->getInvoiceCollection()\n ->getItems();\n /** @var Invoice $invoice */\n $invoice = array_pop($invoiceItems);\n /** @var CreditmemoFactory $creditmemoFactory */\n $creditmemoFactory = $this->objectManager->get(CreditmemoFactory::class);\n /** @var Creditmemo $creditmemo */\n $creditmemo = $creditmemoFactory->createByInvoice($invoice, $order->getData());\n $creditmemo->setOrder($order);\n $creditmemo->setState(Creditmemo::STATE_REFUNDED);\n $creditmemo->setIncrementId(self::ORDER_INCREMENT_ID);\n\n foreach ($creditmemo->getItems() as $creditMemoItem) {\n $orderItem = $orderItems[$creditMemoItem->getOrderItemId()];\n if ($orderItem->getProductOptionByCode('giftcard_created_codes')) {\n $codes = $orderItem->getProductOptionByCode('giftcard_created_codes');\n $qty = abs((int)$creditMemoItem->getQty());\n }\n }\n\n $giftCardAccounts = $this->getGiftCardAccount($codes);\n $creditmemoManagement = $this->objectManager->get(CreditmemoManagementInterface::class);\n $creditmemoManagement->refund($creditmemo);\n\n $existsGiftCardAccounts = $this->getGiftCardAccount($codes);\n\n self::assertEquals(count($giftCardAccounts) - $qty, count($existsGiftCardAccounts));\n }", "public function setCcv($ccv)\n {\n $this->cvv = $ccv;\n return $this;\n }", "public function update(Request $request, $id)\n {\n $updateClient = Customer::findOrFail($id);\n $previousblc = DB::table('zenrolle_customers')->select('balance')->where('id',$id)->pluck('balance')->first();\n $currentBlnce = new Customer();\n $currentBlnce = $request->input('balance');\n $total = $previousblc+$currentBlnce;\n Customer::where('id',$id)->update([\n 'balance' => $total,\n ]);\n return redirect('/client')->withsuccess('message','Your Account has been Successfully Recharge!');\n }", "protected function updateCash()\n\t{\n\t\tforeach($this->amount as $line => $amount)\n\t\t{\n\t\t\tif(isset($this->maxFare[$line]) && $this->maxFare[$line])\n\t\t\t{\n\t\t\t\t$mcoCash = new Application_Model_DbTable_McoCash();\n\t\t\t\t$mcoCashNew = $mcoCash->createRow();\n\t\t\t\t$mcoCashNew->mco_id = $this->mcoId;\n\t\t\t\t$mcoCashNew->line = $line;\n\t\t\t\t$mcoCashNew->type = 'DNH';\n\t\t\t\t$mcoCashNew->amount = ($amount - $this->amountCash[$line]);\n\t\t\t\t$mcoCashNew->value = $this->maxFare[$line];\n\t\t\t\t$mcoCashNew->diff = 0;\n\t\t\t\t$mcoCashNew->save();\n\t\t\t}\n\t\t}\t\n\t}", "public function sentCreditRequest(BankCreditRequest $request) : BankCreditResponse\n {\n $yrequest = new YBankCreditApprove();\n $yrequest->setCredit($request->getAmount());\n $yrequest->setName($request->getCustomer());\n\n $sender = new YBankCreditSender();\n $sender->sendCreditForValidate($yrequest,$this);\n\n do {\n \\Thread.sleep(10000);\n echo \"YBank petición en espera...\";\n } while ($yresponse == null);\n\n $response = new BankCreditResponse();\n $response->setApproved($this->yresponse->getApproved() == \"Y\" ? true:false);\n\n return $response;\n }", "function discountvoucherpurchase_civicrm_postProcess($formName, &$form ) {\n if($formName == 'CRM_Contribute_Form_Contribution_Confirm' && isset($form->_id) && $form->_id == 24){\n $params = array(\n 'code' => $form->_params['contactID'] . '-' . $form->_params['contributionID'],\n 'description' => 'gift from ' . $form->_params['email-5'],\n 'amount' => 100,\n 'amount_type' => 1,\n 'count_max' => 1,\n 'memberships'=> array(7,22),\n 'version' => 3,\n 'multi_valued' => array('memberships' => 1),\n );\n $code = civicrm_api('DiscountCode', 'create', $params);\n }\n}", "public function authorize($money, CreditCard $creditcard, $options = array())\n {\n $this->required_options('order_id', $options);\n\n $this->post['Amount'] = $this->amount($money);\n $this->addInvoice($money, $creditcard, $options);\n $this->addCreditcard($creditcard);\n $this->addAddress($options);\n $this->addCustomerData($options);\n\n return $this->commit('authorization', $money);\n }", "function chargeCreditCard($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n $creditCard->setCardCode($peram[3]);//////////////////////--- card code 123\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n $order = new AnetAPI\\OrderType();\n $order->setDescription(\"Monthly Payment\");\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($fname);\n $customerAddress->setLastName($lname);\n $customerAddress->setCompany(\"\");\n $customerAddress->setAddress(\"\");\n $customerAddress->setCity(\"\");\n $customerAddress->setState(\"\");\n $customerAddress->setZip(\"\");\n $customerAddress->setCountry(\"\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId(\"\"); // Customer ID \n $customerData->setEmail(\"\");\n\n //Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"600\");\n\n // Create a TransactionRequestType object\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType( \"authCaptureTransaction\"); \n $transactionRequestType->setAmount($peram[0]);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId( $refId);\n $request->setTransactionRequest( $transactionRequestType);\n\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n\n if ($response != null)\n {\n if($response->getMessages()->getResultCode() == 'Ok')\n {\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getMessages() != null) \n {\n\t\t\t$res_code = $tresponse->getResponseCode();\n\t\t\t$auth_code = $tresponse->getAuthCode();\n\t\t\t$trans_code = $tresponse->getTransId();\n\t\t\t$gcode = $tresponse->getMessages()[0]->getCode();\n\t\t\t$res_des = $tresponse->getMessages()[0]->getDescription();\n \n\t\t /* echo \" Transaction Response Code : \" . $res_code . \"\\n\";\n echo \" Successfully created an authCapture transaction with Auth Code : \" . $auth_code . \"\\n\";\n echo \" Transaction ID : \" . $trans_code . \"\\n\";\n echo \" Code : \" . $ccode . \"\\n\"; \n echo \" Description : \" . $res_des . \"\\n\";*/\n\t\t \n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your payment has been processed</h2>';\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<p>Your credit card has been charged <span style=\"color:#6dcd62; font-size:28px\">$'.$oncepaid.'</span></p>';\n\t\techo '<p>you have been hired your perfect cNanny successfully.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\n\n\t\t //---------------------------------------------------\n\t\t\n\t\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => base64_encode($peram[3]),\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => '-',\n\t\t\t'res_code' => $res_code,\n\t\t\t'auth_code' => $auth_code,\n\t\t\t'trans_code' => $trans_code,\n\t\t\t'gcode' => $gcode,\n\t\t\t'res_des' => $res_des,\n\t\t));\t\n\t\t\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n\t\t //------------------------------------------------------\n\t\t \n }\n else\n {\n echo \"Transaction Failed \\n\";\n if($tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n }\n }\n else\n {\n echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n \n if($tresponse != null && $tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n else\n {\n echo \" Error code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n echo \" Error message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n }\n } \n }\n else\n {\n echo \"No response returned \\n\";\n }\n\n return $response;\n }", "public function addCreditCard($customer_id, $body)\n {\n \n // verify the required parameter 'customer_id' is set\n if ($customer_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $customer_id when calling addCreditCard');\n }\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $body when calling addCreditCard');\n }\n \n // parse inputs\n $resourcePath = \"/customer/{customer_id}/credit_card\";\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n $method = \"POST\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n // path params\n if ($customer_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"customer_id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($customer_id),\n $resourcePath\n );\n }\n \n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } else if (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n \n \n // make the API Call\n try\n {\n list($response, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, $method,\n $queryParams, $httpBody,\n $headerParams, '\\Tpaga\\Model\\CreditCard'\n );\n \n if (!$response) {\n return null;\n }\n\n return $this->apiClient->getSerializer()->deserialize($response, '\\Tpaga\\Model\\CreditCard', $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 201:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\CreditCard', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 422:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\ApiError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n \n return null;\n \n }", "public function update_user_balance($user_id)\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$form_field = 'user_balance_'.$user_id;\n\t\t\tif($this->input->post($form_field))\n\t\t\t{\n\t\t\t\t$user_data['credit'] = $this->input->post($form_field);\n\t\t\t\t$this->load->model('user_profiles', 'up');\n\t\t\t\t$this->up->update($user_id, $user_data);\n\t\t\t}\n\t\t\tredirect('/admin/user_list','refresh');\n\t\t}", "function commerce_braintree_creditcard_edit_form_submit($form, &$form_state) {\n $sub = commerce_braintree_subscription_local_get(array('sid' => $form_state['values']['sid']), FALSE);\n $token = $sub['token'];\n $commerce_customer_address = $form_state['values']['commerce_customer_address']['und'][0];\n //billing address\n $billing_address['firstName'] = isset($commerce_customer_address['first_name']) ? $commerce_customer_address['first_name'] : '';\n $billing_address['lastName'] = isset($commerce_customer_address['last_name']) ? $commerce_customer_address['last_name'] : '';\n $billing_address['company'] = isset($commerce_customer_address['organisation_name']) ? $commerce_customer_address['organisation_name'] : '';\n $billing_address['streetAddress'] = isset($commerce_customer_address['thoroughfare']) ? $commerce_customer_address['thoroughfare'] : '';\n $billing_address['extendedAddress'] = isset($commerce_customer_address['premise']) ? $commerce_customer_address['premise'] : '';\n $billing_address['locality'] = isset($commerce_customer_address['locality']) ? $commerce_customer_address['locality'] : '';\n $billing_address['region'] = isset($commerce_customer_address['administrative_area']) ? $commerce_customer_address['administrative_area'] : '';\n $billing_address['postalCode'] = isset($commerce_customer_address['postal_code']) ? $commerce_customer_address['postal_code'] : '';\n $billing_address['countryCodeAlpha2'] = isset($commerce_customer_address['country']) ? $commerce_customer_address['country'] : '';\n \n //creditcard\n $creditcard['cardholderName'] = $form_state['values']['ca_cardholder_name'];\n $creditcard['number'] = $form_state['values']['credit_card']['number'];\n $creditcard['cvv'] = $form_state['values']['credit_card']['code'];\n $creditcard['expirationDate'] = $form_state['values']['credit_card']['exp_month'];\n $creditcard['expirationDate'] .= '/' . $form_state['values']['credit_card']['exp_year'];\n $creditcard['billingAddress'] = $billing_address;\n $creditcard['options'] = array('verifyCard' => TRUE);\n $creditcard['billingAddress']['options'] = array('updateExisting' => TRUE);\n \n $card = commerce_braintree_credit_card_update($creditcard, $token);\n if ($card->success) {\n drupal_set_message(t('Updated Successfull.'));\n return;\n }\n drupal_set_message(t('There are error. @errors', array('@errors' => commerce_braintree_get_errors($card))), 'error');\n}", "public function test_rechargeWithCreditCard_providerAcceptsCharge_returnResultTrueAndIncreaseUploadedAmountWithFeeCharge()\n {\n $amount = new Money(1000, new Currency('EUR'));\n $this->exerciseRechargeWithCreditCard(51000, true, $amount);\n }", "function remove_creditcard($ccid = 0, $userid = 0)\n {\n global $ilance, $ilconfig, $ilpage, $phrase;\n $ilance->db->query(\"\n DELETE FROM \" . DB_PREFIX . \"creditcards\n WHERE cc_id = '\" . intval($ccid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n // change paymethod to online account\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n\t\t$ilance->email->get('member_removed_creditcard');\t\t\n\t\t$ilance->email->set(array(\n\t\t\t'{{member}}' => fetch_user('username', intval($userid)),\n\t\t));\n\t\t$ilance->email->send();\n return true;\n }", "public function completePayment($CardNo,$Month,$Year,$Cvv){\n\t\t $var=$this->isvalidCard($CardNo,$Month,$Year,$Cvv);\n\t\t \n\t\t $var2=0;\n\t\t if($var == $var2){\n\t\t\t$stmt = $this->con->prepare(\"SELECT account_number FROM Customer_debitcard WHERE debit_card_number=?;\");\n\t\t\t$stmt->bind_param(\"s\", $CardNo);\t//Pull account number\n\t\t\t\n\t\t\t\n\t\t\t$stmt->execute();\n\t\t\t$result = $stmt->get_result(); //storing sql_result object\n\t\t $rows = mysqli_fetch_array($result); //converting to array\n\t\t\t$accountnumber=$rows[0]; //selecting first object of array\n\t\t\n\t\t\t$stmt = $this->con->prepare(\"SELECT balance FROM `Account` WHERE account_number =?;\");\n\t\n\t\t\t\t$stmt->bind_param(\"s\", $accountnumber);\t//Pull account balance\n\t\t\t\t$stmt->execute();\n\t\t\t$result = $stmt->get_result(); //storing sql_result object\n\t\t\t$rows = mysqli_fetch_array($result); //converting to array\n\t\t\t$balance= $rows[0]; //selecting first object of array\n\t\t \n\t\t\t\t\tif($balance>1999) //checking balance limit\n\t\t\t\t\t{\n\t\t\t\t\t$temp=$balance;\n\t\t\t\t\t$temp=$temp-999; //reducing customer balance\n\t\t\t\t\t$stmt = $this->con->prepare(\"UPDATE `Account` SET `balance` = ? WHERE `Account`.`account_number` \t\t\t\t\t\t= ?; \");\n\t\t\t\t\t$stmt->bind_param(\"ss\", $temp,$accountnumber);\n\t\t\t\t\t$stmt1 = $this->con->prepare(\"UPDATE `Account` SET `balance` = (balance+999) WHERE `Account`.`account_number` = '0-1-3333-3333-3333';\"); \n\t\t\t\t\t//adding balance into company account\n\t\t\t\t\n\t\t\t\t\tif($stmt->execute() && $stmt1->execute()){\n\t\t\t\t\treturn 1; //successful\n\t\t\t\t\t}else{\n\t\t\t\t\treturn 2; //unsuccessful\n\t\t\t\t\t}\n\t\t\t\t\t}\telse {return 3;}\n\t}\n\t\n\t else{\n\n\t\t\t\treturn 0; //invalid card\n\t \t}\n\n\t}", "public function edit(CreditCard $creditCard)\n {\n //\n }", "function take_cash_payment($invoice_id = '', $param2 = '')\n\t{\n\t\tif ($this->session->userdata('reception_login') != 1)\n\t\t\tredirect(base_url() . 'index.php?login', 'refresh');\n\t\t\n\t\t$data['payment_type'] = $this->input->post('payment_type');\n\t\t$data['transaction_id'] = rand(100000, 1000000);\n\t\t$data['invoice_id'] = $this->input->post('invoice_id');\n\t\t$data['patient_id'] = $this->input->post('patient_id');\n\t\t$data['method'] = $this->input->post('method');\n\t\t$data['description'] = $this->input->post('description');\n\t\t$data['amount'] = $this->input->post('amount');\n\t\t$data['timestamp'] = strtotime(date('Y-m-d') . ' ' . date('H:i:s'));\n\t\t\n\t\t$this->db->insert('payment', $data);\n\t\t\n\t\t$this->db->where('invoice_id', $this->input->post('invoice_id'));\n\t\t$this->db->update('invoice', array(\n\t\t\t'status' => 'paid'\n\t\t));\n\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_created'));\n\t\tredirect(base_url() . 'index.php?reception/manage_invoice', 'refresh');\n\t\t\n\t}", "function take_cash_payment($invoice_id = '', $param2 = '')\n\t{\n\t\tif ($this->session->userdata('reception_login') != 1)\n\t\t\tredirect(base_url() . 'index.php?login', 'refresh');\n\t\t\n\t\t$data['payment_type'] = $this->input->post('payment_type');\n\t\t$data['transaction_id'] = rand(100000, 1000000);\n\t\t$data['invoice_id'] = $this->input->post('invoice_id');\n\t\t$data['patient_id'] = $this->input->post('patient_id');\n\t\t$data['method'] = $this->input->post('method');\n\t\t$data['description'] = $this->input->post('description');\n\t\t$data['amount'] = $this->input->post('amount');\n\t\t$data['timestamp'] = strtotime(date('Y-m-d') . ' ' . date('H:i:s'));\n\t\t\n\t\t$this->db->insert('payment', $data);\n\t\t\n\t\t$this->db->where('invoice_id', $this->input->post('invoice_id'));\n\t\t$this->db->update('invoice', array(\n\t\t\t'status' => 'paid'\n\t\t));\n\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_created'));\n\t\tredirect(base_url() . 'index.php?reception/manage_invoice', 'refresh');\n\t\t\n\t}", "public function setCVV($cvv = '') {\n $security = array(\n 'x_card_code'=>$cvv,\n );\n $this->NVP = array_merge($this->NVP, $security); \n }", "public function processApiInvoice($invoice)\n {\n if($this->_logging){\n Mage::log('In processApiInvoice (Postpayment)', null, $this->_logfile);\n }\n $order = $invoice->getOrder();\n // Request model, data model, product line model, total line model\n $v2RqstMdl = new Tritacv2_Model_InvoiceRequestV2Model();\n $v2DataMdl = new Tritacv2_Model_InvoicePdfDataModel();\n $v2ProdMdlArray = $this->getProductLines($order);\n $v2TtlMdlArray = $this->getOrderTotals($order);\n $shopName = Mage::app()->getStore()->getFrontendName();\n $v2DataMdl->setShopName($shopName);\n $v2DataMdl->setDescription('');\n $v2DataMdl->setProductLines($v2ProdMdlArray);\n $v2DataMdl->setTotalLines($v2TtlMdlArray);\n // finally fill request model:\n $v2RqstMdl->setTransactionNumber($invoice->getTransactionId());\n $v2RqstMdl->setInvoiceNumber($invoice->getIncrementId());\n $objDateTime = new DateTime('NOW');\n $v2RqstMdl->setInvoiceDate($objDateTime);\n $v2RqstMdl->setInvoiceAmount(Mage::helper('capayable')->convertToCents($invoice->getGrandTotal()));\n $v2RqstMdl->setInvoiceDescription(Mage::helper('capayable')->__('Order').' '.$order->getIncrementId());\n $v2RqstMdl->setInvoicePdfSubmitType('INCLUDED_DATA');\n $v2RqstMdl->setCultureCode('nl-NL');\n $v2RqstMdl->setInvoicePdfData($v2DataMdl);\n try {\n $publicKey = Mage::getStoreConfig('payment/capayable/public_key');\n $apiConfig = new Tritacv2_Configuration();\n $apiConfig->setApiKey('apikey', $publicKey); // test key 'f2d2a2aee085bfcde02d3b50e30a7394efcd49e5'\n //$apiConfig->setHost('https://capayable-api-acc.tritac.com');\n if($this->_logging) {\n Mage::log('In processApiInvoice (Postpayment) dit is url ' . $this->_url, null, $this->_logfile);\n }\n $apiConfig->setHost($this->_url);\n $apiClient = new Tritacv2_ApiClient($apiConfig);\n $invoiceApi = new Tritacv2_Api_InvoiceApi($apiClient);\n $result = $invoiceApi->invoiceV2Post($v2RqstMdl);\n if($this->_logging) {\n Mage::log('In checkCredit (Postpayment) result : ', null, $this->_logfile);\n Mage::log($result, null, $this->_logfile);\n }\n if($result->getIsAccepted() == true || $result->getIsAccepted() == 1) {\n return true;\n } else {\n return false;\n }\n } catch (Exception $e) {\n Mage::log('Exception when calling creditCheckApi->creditCheckV2Post: '. $e->getMessage(), null, $this->_logfile);\n }\n\n //return $response['IsAccepted'];\n }", "function olc_gv_account_update($customer_id, $gv_id) {\n\t$customer_gv_query = olc_db_query(SELECT.\"amount\".SQL_FROM . TABLE_COUPON_GV_CUSTOMER .\n\tSQL_WHERE.\"customer_id = '\" . $customer_id . APOS);\n\t$coupon_gv_query = olc_db_query(SELECT.\"coupon_amount\".SQL_FROM . TABLE_COUPONS . SQL_WHERE.\"coupon_id = '\" . $gv_id . APOS);\n\t$coupon_gv = olc_db_fetch_array($coupon_gv_query);\n\tif (olc_db_num_rows($customer_gv_query) > 0) {\n\t\t$customer_gv = olc_db_fetch_array($customer_gv_query);\n\t\t$new_gv_amount = $customer_gv['amount'] + $coupon_gv['coupon_amount'];\n\t\t$gv_query = olc_db_query(SQL_UPDATE . TABLE_COUPON_GV_CUSTOMER . \" set amount = '\" . $new_gv_amount .\n\t\t\"' where customer_id = '\" . $customer_id . APOS);\n\t} else {\n\t\t$gv_query = olc_db_query(INSERT_INTO . TABLE_COUPON_GV_CUSTOMER .\n\t\t\" (customer_id, amount) values ('\" . $customer_id . \"', '\" . $coupon_gv['coupon_amount'] . \"')\");\n\t}\n}", "function chargeCreditCard()\n{\n\t \n\t$insert_id = $this->session->userdata('recent_reg_id');\n\t$current_login_user = $this->common_front_model->get_session_data();\n\t$inputData=$this->input->post();\n\n\t//print_r($current_login_user);\n\n\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\"9zyp7U9TTQ\");\n $merchantAuthentication->setTransactionKey(\"8hFVee23p993GVVa\");\n \n // Set the transaction's refId\n $refId = $current_login_user['matri_id'].'-' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($inputData['card_number']);\n $creditCard->setExpirationDate($inputData['year'].\"-\".$inputData['month']);\n $creditCard->setCardCode($inputData['cvv']);\n\n // Add the payment data to a paymentType object\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n // Create order information\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber($refId);\n $order->setDescription(\"Membership Renewal-\".$inputData['plan_name']);\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($inputData['name_on_card']);\n // $customerAddress->setLastName($current_login_user['lastname']);\n // $customerAddress->setCompany($current_login_user['username']);\n //$customerAddress->setAddress(\"14 Main Street\");\n // $customerAddress->setCity(\"Pecan Springs\");\n //$customerAddress->setState(\"TX\");\n // $customerAddress->setZip(\"44628\");\n // $customerAddress->setCountry(\"USA\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId($current_login_user['matri_id']);\n $customerData->setEmail($current_login_user['email']);\n\n // Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"60\");\n\n // Add some merchant defined fields. These fields won't be stored with the transaction,\n // but will be echoed back in the response.\n $merchantDefinedField1 = new AnetAPI\\UserFieldType();\n $merchantDefinedField1->setName(\"customerLoyaltyNum\");\n $merchantDefinedField1->setValue(\"1128836273\");\n\n $merchantDefinedField2 = new AnetAPI\\UserFieldType();\n $merchantDefinedField2->setName(\"favoriteColor\");\n $merchantDefinedField2->setValue(\"blue\");\n\n // Create a TransactionRequestType object and add the previous objects to it\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType(\"authCaptureTransaction\");\n $transactionRequestType->setAmount($inputData['plan_amount']);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n $transactionRequestType->addToUserFields($merchantDefinedField1);\n $transactionRequestType->addToUserFields($merchantDefinedField2);\n\n // Assemble the complete transaction request\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setTransactionRequest($transactionRequestType);\n\t//print_r($request);\n // Create the controller and get the response\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n \n\n if ($response != null) {\n // Check to see if the API request was successfully received and acted upon\n if ($response->getMessages()->getResultCode() == \"Ok\") {\n // Since the API request was successful, look for a transaction response\n // and parse it to display the results of authorizing the card\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getMessages() != null) {\n //echo \" Successfully created transaction with Transaction ID: \" . $tresponse->getTransId() . \"\\n\";\n // echo \" Transaction Response Code: \" . $tresponse->getResponseCode() . \"\\n\";\n // echo \" Message Code: \" . $tresponse->getMessages()[0]->getCode() . \"\\n\";\n // echo \" Auth Code: \" . $tresponse->getAuthCode() . \"\\n\";\n\t\t\t\t//echo \" Description: \" . $tresponse->getMessages()[0]->getDescription() . \"\\n\";\n\t\t\t\t//$this->data['status']=\"Successfully created transaction with Transaction ID: \" . $tresponse->getTransId() . \"\\n\";\n\t\t\t\t//$status=\"success\";\n\t\t\t\t$this->payment_status(\"authorize\");\n\t\t\t\treturn true;\n\t\t\t\t\n } else {\n //echo \"Transaction Failed \\n\";\n if ($tresponse->getErrors() != null) {\n // echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n\t\t\t\t\t//echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t\n\t\t\t\t\t$this->data['status']=\" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n }\n }\n // Or, print errors if the API request wasn't successful\n } else {\n // echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getErrors() != null) {\n // echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n\t\t\t\t//echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\n\t\t\t\t $this->data['status']=\" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n\n } else {\n // echo \" Error Code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n\t\t\t//\techo \" Error Message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n\t\t\t\t\n\t\t\t\t $this->data['status']=\" Error Message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n }\n }\n } else {\n echo \"No response returned \\n\";\n }\n\n\t//return $response;\n\t\n\t\t\t\t$this->common_model->front_load_header('Payment Success');\n\t\t\t\tif($status=='success'){\n\t\t\t\t\t$this->load->view('front_end/payment_success',$this->data);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->load->view('front_end/payment_fail',$this->data);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->common_model->front_load_footer();\n}", "public function test_rechargeWithCreditCard_providerAcceptsCharge_returnResultTrueAndIncreaseUploadedAmountInWallet()\n {\n $amount = new Money(2000, new Currency('EUR'));\n $this->exerciseRechargeWithCreditCard(52000, true, $amount);\n }", "public function updateBankerCredit()\n {\n $user = User::whereHas(\"roles\", function($q){$q->where(\"name\", \"Banker\");})->first();\n\n $total = Credit::where('credit_type', 0)->sum('value');\n $user->free_credits = $total;\n $total = Credit::where('credit_type', 1)->sum('value');\n $user->paid_credits = $total;\n $user->save();\n }", "public function setCreditCard($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->credit_card !== $v) {\n\t\t\t$this->credit_card = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::CREDIT_CARD;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function ProcessUpdateCreditCardForm($result, $value, $form, $field)\r\n\t{\r\n\t\tif($field->type == 'creditcard')\r\n\t\t{\r\n\t\t\t// Get the user id to send to stripe\r\n\t\t\t$customer_id = $this->GetUser();\r\n\r\n\t\t\t$response = json_decode(str_replace('\\\\\"', '\"', $_POST['stripe_response']));\r\n\r\n\t\t\ttry {\r\n\t\t\t\t$this->Stripe->UpdateCustomerCreditCard($customer_id, $response);\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\t$err = $e->getJsonBody();\r\n\t\t\t\t$err = $err['error'];\r\n\r\n\t\t\t\t$result['is_valid'] = false;\r\n\t\t\t\t$result['message'] = $err['message'];\r\n\t\t\t}\t\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $result;\r\n\t}", "public function creditCard($amount)\n {\n if ($this->isValidCard)\n $this->balance -= $this->parseAmount($amount);\n }", "public function actionPaymentcard()\n\t{ \n\t\t\n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t\t$invoiceModel = new Invoices;\n\t\t\t$payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n\t\t\t# Add 2% of the total in the invoice total for creditcard only\n\t\t\t$twoPercentAmount = ($payment[0]['payment_amount'] * 2)/100;\n\t\t\t$payment[0]['payment_amount'] += round($twoPercentAmount, 2);\n\t\t\t$this->render(\"cardForm\", array(\"payment\"=>$payment));\n \t\t}\n\t\t\n\t}", "public function edit(Cv $cv)\n {\n //\n }", "public function update($id)\n\t{\n\t\t$input = Input::all();\n\t\t\n\t\t$bid = Invoice::where('retail_invoice_id',$id)->pluck('branch_id');\n\t\t\n\t\t $rules = [\n\t\t //'memberDiscount' => 'required|numeric|between:0,100',\n\t\t 'invoiceDate' => 'required',\n\t\t 'invoiceNumber' => 'required|integer|unique:tbl_retail_invoice,invoice_number,'.$id.',retail_invoice_id,branch_id,'.$bid.',invoice_status,D',\n\t\t 'invoiceStatus' => 'required|in:D,C'\n\t\t];\n\n\t\t$validator = Validator::make($input, $rules);\n\n\t\t if($validator->passes()) {\n\n\t\t $discountMem = 0 ;\n\n\t\t \tInvoice::where('retail_invoice_id',$id)\n\t\t \t\t->update([\n\t\t \t\t\t'invoice_date'=> $input['invoiceDate'],\n\t\t \t\t\t'invoice_number' => $input['invoiceNumber'],\n\t\t \t\t\t'invoice_status' =>$input['invoiceStatus']\n\t\t \t\t\t]);\n\n\t\t \tInvoiceDetails::where('retail_invoice_id',$id)\n\t\t \t\t->update([\n\t\t \t\t\t'member_discount' => $discountMem\n\t\t \t\t\t]);\n\n\n\t\t $pass = '<ul class=\"alert alert-success\"><li>Successfully edited Invoice # <b>'.$id.'</b>!</li></ul>';\n\t\t return $pass;\n\t\t } else {\n\t\t \t$errors = $validator->messages();\n\t\t\t$err = '<ul class=\"alert alert-error\">';\n\t\t\t foreach ($errors->all() as $error) {\n\t\t\t $err .= '<li>'.$error.'</li>';\n\t\t\t }\n\t\t\t $err .= '</ul>';\n\n\t\t return $err;\n\t\t }\n\t}", "public function setDiscountInvoiced($discountInvoiced);", "function refundAmountCancelContest($CronID)\n {\n /* Get Contest Data */\n $ContestData = $this->db->query('SELECT C.ContestID,C.EntryFee FROM sports_contest C, tbl_entity E WHERE E.EntityID = C.ContestID AND C.IsRefund = \"No\" AND C.LeagueType = \"Dfs\" AND E.StatusID = 3 AND C.EntryFee > 0');\n if ($ContestData->num_rows() > 0) {\n foreach ($ContestData->result_array() as $Value) {\n\n /* Get Joined Contest Users */\n $JoinedContestsUsers = $this->db->query('SELECT UserID,UserTeamID FROM sports_contest_join WHERE ContestID = ' . $Value['ContestID'] . ' AND IsRefund = \"No\" ');\n if ($JoinedContestsUsers->num_rows() == 0) {\n\n /* Update Contest Refund Status Yes */\n $this->db->where('ContestID', $Value['ContestID']);\n $this->db->limit(1);\n $this->db->update('sports_contest', array('IsRefund' => \"Yes\"));\n continue;\n }\n\n foreach ($JoinedContestsUsers->result_array() as $JoinValue) {\n\n /* Get Wallet Details */\n $WalletQuery = $this->db->query('SELECT WalletAmount,WinningAmount,CashBonus FROM tbl_users_wallet WHERE UserID = ' . $JoinValue['UserID'] . ' AND EntityID = ' . $Value['ContestID'] . ' AND UserTeamID = ' . $JoinValue['UserTeamID'] . ' AND Narration = \"Cancel Contest\" LIMIT 1');\n if ($WalletQuery->num_rows() > 0) {\n\n /* Update Join Contest Refund Status Yes */\n $this->db->where(array('ContestID' => $Value['ContestID'], 'UserTeamID' => $JoinValue['UserTeamID'], 'UserID' => $JoinValue['UserID']));\n $this->db->limit(1);\n $this->db->update('sports_contest_join', array('IsRefund' => \"Yes\", 'ModifiedDate' => date('Y-m-d H:i:s')));\n continue;\n }\n\n /* Get Join Contest Wallet Details */\n $WalletDetails = $this->db->query('SELECT WalletAmount,WinningAmount,CashBonus FROM tbl_users_wallet WHERE Narration = \"Join Contest\" AND UserTeamID = ' . $JoinValue['UserTeamID'] . ' AND EntityID = ' . $Value['ContestID'] . ' AND UserID = ' . $JoinValue['UserID'] . ' LIMIT 1')->row_array();\n\n /* Refund User Amount */\n $InsertData = array(\n \"Amount\" => $WalletDetails['WalletAmount'] + $WalletDetails['WinningAmount'] + $WalletDetails['CashBonus'],\n \"WalletAmount\" => $WalletDetails['WalletAmount'],\n \"WinningAmount\" => $WalletDetails['WinningAmount'],\n \"CashBonus\" => $WalletDetails['CashBonus'],\n \"TransactionType\" => 'Cr',\n \"EntityID\" => $Value['ContestID'],\n \"UserTeamID\" => $JoinValue['UserTeamID'],\n \"Narration\" => 'Cancel Contest',\n \"EntryDate\" => date(\"Y-m-d H:i:s\")\n );\n $this->Users_model->addToWallet($InsertData, $JoinValue['UserID'], 5);\n\n /* Update Join Contest Refund Status Yes */\n $this->db->where(array('ContestID' => $Value['ContestID'], 'UserTeamID' => $JoinValue['UserTeamID'], 'UserID' => $JoinValue['UserID']));\n $this->db->limit(1);\n $this->db->update('sports_contest_join', array('IsRefund' => \"Yes\", 'ModifiedDate' => date('Y-m-d H:i:s')));\n\n /* Send Refund Notification */\n $this->Notification_model->addNotification('refund', 'Contest Cancelled Refund', $JoinValue['UserID'], $JoinValue['UserID'], $Value['ContestID'], 'Your ' . DEFAULT_CURRENCY . $InsertData['Amount'] . ' has been refunded.');\n }\n }\n }\n }", "public function edit($id)\n\t{\n\t\t$this->is_allowed('amuco_credit_insurance_update');\n\n\t\t$this->data['amuco_credit_insurance'] = $this->model_amuco_credit_insurance->find($id);\n\n\t\t$this->template->title('Amuco Credit Insurance Update');\n\t\t$this->render('backend/standart/administrator/amuco_credit_insurance/amuco_credit_insurance_update', $this->data);\n\t}", "public function setAuditCost($audit_id) {\n\t \t//Update the audit database with the amount of the audit cost\n\t \tif($result = $this->db->query(sprintf('\n\t\t\tUPDATE `%1$s`.`audit`\n\t\t\tSET `audit_cost` = \"%3$s\"\n\t\t\tWHERE `audit_id` = %2$d;\n\t\t',\n\t\t\tDB_PREFIX.'audit',\n\t\t\t$this->db->escape_string($audit_id),\n\t\t\t$this->getAuditCost($audit_id)\n\t\t)))\n\t\t\n\t\treturn;\n\t}", "public static function continue_payment_after_creditcard($order_id)\n {\n $obj = new ReciptController;\n $Recipt = Recipt::whereId($order_id)->where('is_init_for_card_payment','1')->latest()->first();\n $ShoppingCart = ShoppingCart::where( 'member_id', $Recipt->member_id )->get();\n $discount = $obj->get_discount($Recipt->member_id);\n\n return $obj->continue_checkout($Recipt,$ShoppingCart,$discount);\n }", "private function updateBalance()\n {\n if (!auth()->user()->hasRole('admin')) {\n auth()->user()->update([\n 'credit' => auth()->user()->credit - $this->totalCost()\n ]);\n }\n }", "public function updateCreditWithAmountCard(User $user, $credits)\n {\n if ($credits == 0) {\n return true;\n }\n try {\n $amount = $this->getAmountByCredit($credits);\n $user->charge($amount);\n $user->increment('credit', $credits);\n\n return true;\n } catch (\\Exception $exception) {\n \\Log::error($exception->getMessage());\n throw new ChargeException();\n }\n\n }", "function _doCapt($oID, $amt = 0, $currency = 'USD') {\r\n global $db, $messageStack;\r\n\r\n //@TODO: Read current order status and determine best status to set this to\r\n $new_order_status = MODULE_PAYMENT_AUTHORIZENET_ECHECK_ORDER_STATUS_ID;\r\n if ($new_order_status == 0) $new_order_status = 1;\r\n\r\n $proceedToCapture = true;\r\n $captureNote = strip_tags(zen_db_input($_POST['captnote']));\r\n if (isset($_POST['captconfirm']) && $_POST['captconfirm'] == 'on') {\r\n } else {\r\n $messageStack->add_session(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_CAPTURE_CONFIRM_ERROR, 'error');\r\n $proceedToCapture = false;\r\n }\r\n if (isset($_POST['btndocapture']) && $_POST['btndocapture'] == MODULE_PAYMENT_AUTHORIZENET_ECHECK_ENTRY_CAPTURE_BUTTON_TEXT) {\r\n $captureAmt = (float)$_POST['captamt'];\r\n/*\r\n if ($captureAmt == 0) {\r\n $messageStack->add_session(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_INVALID_CAPTURE_AMOUNT, 'error');\r\n $proceedToCapture = false;\r\n }\r\n*/\r\n }\r\n if (isset($_POST['captauthid']) && trim($_POST['captauthid']) != '') {\r\n // okay to proceed\r\n } else {\r\n $messageStack->add_session(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_TRANS_ID_REQUIRED_ERROR, 'error');\r\n $proceedToCapture = false;\r\n }\r\n /**\r\n * Submit capture request to Authorize.net\r\n */\r\n if ($proceedToCapture) {\r\n // Populate an array that contains all of the data to be sent to Authorize.net\r\n unset($submit_data);\r\n $submit_data = array(\r\n 'x_type' => 'PRIOR_AUTH_CAPTURE',\r\n 'x_amount' => number_format($captureAmt, 2),\r\n 'x_trans_id' => strip_tags(trim($_POST['captauthid'])),\r\n// 'x_invoice_num' => $new_order_id,\r\n// 'x_po_num' => $order->info['po_number'],\r\n// 'x_freight' => $order->info['shipping_cost'],\r\n// 'x_tax_exempt' => 'FALSE', /* 'TRUE' or 'FALSE' */\r\n// 'x_tax' => $order->info['tax'],\r\n );\r\n\r\n $response = $this->_sendRequest($submit_data);\r\n $response_code = $response[0];\r\n $response_text = $response[3];\r\n $response_alert = $response_text . ($this->commError == '' ? '' : ' Communications Error - Please notify webmaster.');\r\n $this->reportable_submit_data['Note'] = $captureNote;\r\n $this->_debugActions($response);\r\n\r\n if ($response_code != '1' || ($response[0]==1 && $response[2] == 311) ) {\r\n $messageStack->add_session($response_alert, 'error');\r\n } else {\r\n // Success, so save the results\r\n $sql_data_array = array('orders_id' => (int)$oID,\r\n 'orders_status_id' => (int)$new_order_status,\r\n 'date_added' => 'now()',\r\n 'comments' => 'FUNDS COLLECTED. Auth Code: ' . $response[4] . \"\\n\" . 'Trans ID: ' . $response[6] . \"\\n\" . ' Amount: ' . ($response[9] == 0.00 ? 'Full Amount' : $response[9]) . \"\\n\" . 'Time: ' . date('Y-m-D h:i:s') . \"\\n\" . $captureNote,\r\n 'customer_notified' => 0\r\n );\r\n zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\r\n $db->Execute(\"update \" . TABLE_ORDERS . \"\r\n set orders_status = '\" . (int)$new_order_status . \"'\r\n where orders_id = '\" . (int)$oID . \"'\");\r\n $messageStack->add_session(sprintf(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_CAPT_INITIATED, ($response[9] == 0.00 ? 'Full Amount' : $response[9]), $response[6], $response[4]), 'success');\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public function createPaymentUsingSavedCard($ccppid, $cout) {\n // This sample code demonstrates how you can process a \n // Payment using a previously stored credit card token.\n // API used: /v1/payments/payment\n /** @var CreditCard $card */\n //$card = require __DIR__ . '/../vault/CreateCreditCard.php';\n\n // ### Credit card token\n // Saved credit card id from a previous call to\n // CreateCreditCard.php\n $creditCardToken = new CreditCardToken();\n //$creditCardToken->setCreditCardId($card->getId());\n $creditCardToken->setCreditCardId($ccppid);\n\n // ### FundingInstrument\n // A resource representing a Payer's funding instrument.\n // For stored credit card payments, set the CreditCardToken\n // field on this object.\n $fi = new FundingInstrument();\n $fi->setCreditCardToken($creditCardToken);\n // ### Payer\n // A resource representing a Payer that funds a payment\n // For stored credit card payments, set payment method\n // to 'credit_card'.\n $payer = new Payer();\n $payer->setPaymentMethod(\"credit_card\")\n ->setFundingInstruments(array($fi));\n // ### Amount\n // Lets you specify a payment amount.\n // You can also specify additional details\n // such as shipping, tax.\n $amount = new Amount();\n $amount->setCurrency(\"EUR\");\n $amount->setTotal($cout);\n // ### Transaction\n // A transaction defines the contract of a\n // payment - what is the payment for and who\n // is fulfilling it. \n $transaction = new Transaction();\n $transaction->setAmount($amount);\n $transaction->setDescription(\"This is the payment description.\");\n // ### Payment\n // A Payment Resource; create one using\n // the above types and intent set to 'sale'\n $payment = new Payment();\n $payment->setIntent(\"sale\")\n ->setPayer($payer)\n ->setTransactions(array($transaction));\n \n // ###Create Payment\n // Create a payment by calling the 'create' method\n // passing it a valid apiContext.\n // (See bootstrap.php for more on `ApiContext`)\n // The return object contains the state.\n try {\n $resultat = $payment->create($this->apiContext);\n } catch (\\Paypal\\Exception\\PPConnectionException $pce) {\n print_r( json_decode($pce->getData()) );\n }\n $statut = $resultat->getState();\n\n return $statut;\n }", "public function authorize(Varien_Object $payment, $amount) {\n if($this->_logging){\n Mage::log('In authorize (Postpayment)', null, $this->_logfile);\n }\n if ($amount <= 0) {\n Mage::throwException(Mage::helper('capayable')->__('The amount due must be greater than 0.'));\n }\n\n // Convert amount to cents\n $amount = Mage::helper('capayable')->convertToCents($amount);\n $order = $payment->getOrder();\n\n // Load saved capayable customer if exists. Otherwise load empty model.\n $capayableCustomer = Mage::getModel('capayable/customer')->loadByEmail($order->getCustomerEmail());\n\n // Throw exception if capayable can't provide customer credit\n $result = $this->checkCredit($capayableCustomer, $amount, true);\n if(!$result->getIsAccepted()) {\n throw new Mage_Payment_Model_Info_Exception(\n Mage::helper('capayable')->__('The payment was refused by Capayable') . \": \" .\n Mage::helper('capayable')->__($result->getRefuseReason()) . \" \" .\n Mage::helper('capayable')->__('For additional information contact Capayable on +31 40 - 259 5072.')\n );\n }\n\n $order->setState(\n Mage::helper('capayable')->getOrderStatus($order->getStore()),\n true,\n Mage::helper('capayable')->__('Order is authorized by Capayable with transaction ID %s',$result->getTransactionNumber()),\n null,\n false);\n\n // Set magento transaction id which returned from capayable\n $payment->setLastTransId($result->getTransactionNumber());\n\n return $this;\n }", "public function addCredits($observer)\n{ \n\n$creditmemo = $observer->getCreditmemo();\n//Mage::log($creditmemo);\n//Mage::log($creditmemo->getBaseGrandTotal());\n $order = $creditmemo->getOrder();\n//Mage::log($order);\n$store_id = $order->getStoreId();\n$website_id = Mage::getModel('core/store')->load($store_id)->getWebsiteId();\n$website = Mage::app()->getWebsite($website_id); \n//Mage::log( $website->getName());\n$sName = Mage::app()->getStore($store_id)->getName();\n//Mage::log( $sid);\n//Mage::log(Mage::getSingleton('adminhtml/session')->getTotal()['status']);\n\n\nif (Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig())\n{\n // Deduct the credits which are gained at the time of invoice\n\n $credits = array(); \n $currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n $nowdate = date('Y-m-d H:m:s', $currentTimestamp);\n $credits['c_id'] = $order->getCustomerId();\n $credits['order_id'] = $order->getIncrementId();\n $credits['website1'] = 'Main Website';\n $credits['store_view'] = $sName;\n $credits['action_date'] = $nowdate;\n $credits['action'] = \"Deducted\";\n $credits['customer_notification_status'] = 'Notified';\n $credits['state'] = 1; \n //$credits['custom_msg'] = 'By admin : Deducted the Credits of the Order ' . $credits['order_id'] ;\n\n foreach ($creditmemo->getAllItems() as $item) {\n $orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n $data = $orderItem->getData();\n\n //Mage::log($data);\n $credits['action_credits'] = - ($data[0]['credits'] * $item->getQty());\n\n $collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$order->getCustomerId())->addFieldToFilter('website1','Main Website')->getLastItem();\n\n $totalcredits = $collection->getTotalCredits();\n $credits['total_credits'] = $totalcredits + $credits['action_credits'] ;\n $credits['custom_msg'] = \"By User:For Return The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n $credits['item_id'] = $item->getOrderItemId();\n $table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n $table1->setData($credits);\n try{\n if($credits['action_credits'] != 0)\n $table1->save();\n }catch(Exception $e){\n Mage::log($e);\n }\n }\n\n// End Deduct the credits which are gained at the time of invoice\n\n}\n//end\n$status = array();\n$status = Mage::getSingleton('adminhtml/session')->getTotal(); \nif($status['status'] == 1)\n { \n\n $val = array(); \n \n \n $val['c_id'] = $order->getCustomerId();\n \n $val['order_id'] = $order->getIncrementId();\n \n $val['website1'] = $website->getName();\n \n $val['store_view'] = $sName;\n \n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$val['c_id'])->addFieldToFilter('website1',$val['website1'])->getLastItem();\n $currentCurrencyRefund1 = array();\n $currentCurrencyRefund1 = Mage::getSingleton('adminhtml/session')->getTotal();\n $currentCurrencyRefund = $currentCurrencyRefund1['credits'];\n/*------------------------Convert Current currency(refunded amount is current currency) to credit points-------------- */\n$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n$baseCurrency;\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseCurrency = $currentCurrencyRefund/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseCurrency = $currentCurrencyRefund;\n }\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\nif(isset($array2)){\n$refundCredits = round(($array2['credits'] * $baseCurrency) / $array2['basevalue']); \n}\nelse{\n$refundCredits = round($baseCurrency);\n}\n/*---------------------end------------------ */\n $val['action_credits'] = $refundCredits;\n $val['total_credits'] = $collection->getTotalCredits() + $refundCredits;\n $val['action_date'] = $nowdate; \n $val['action'] = \"Refunded\";\n $val['custom_msg'] = 'By admin : return product by customer to the order ' . $val['order_id'] ;\n $val['customer_notification_status'] = 'Notified'; \n $val['state'] = 0;\n//Mage::getSingleton('adminhtml/session')->unsTotal();\n$model = Mage::getSingleton('kartparadigm_storecredit/creditinfo');\n//Mage::log($creditmemo->getDiscountAmount());\n//Mage::log($creditmemo->getDiscountDescription());\n//checking \nif($creditmemo->getDiscountDescription() == \"Store Credits\"){\n$total = $creditmemo->getGrandTotal() - ($creditmemo->getDiscountAmount());\n}\nelse{\n$total = $creditmemo->getGrandTotal();\n}\n$model->setData($val);\ntry{\nif($total >= $currentCurrencyRefund){\nif( $currentCurrencyRefund > 0)\n{\n\n$model->save();\n\n}\n}\nelse{\n\nMage::getSingleton('adminhtml/session')->setErr('true');\n\n}\n\n} catch(Mage_Core_Exception $e){\n//Mage::log($e);\n}\n\n}\n}", "public function getClientAccountAndBalance($client_id) {\n $stmt = $this->conn->stmt_init ();\n $stmt->prepare ( \"call getClientAccountAndBalance (?)\" );\n $stmt->bind_param ( 'i', $client_id );\n $stmt->execute ();\n \n return $stmt->get_result ();\n }", "function processPayment() {\n \n if ($this->creditPayment != 0.00){\n$fieldParse = new parseGatewayFields(); \n$fieldParse-> setCardName($this->cardName);\n$fieldParse-> setAchName($this->accountName);\n$fieldParse-> setCardType($this->cardType);\n$fieldParse-> setAccountType($this->accountType);\n$fieldParse-> setCardExpDate($this->cardYear);\n$fieldParse-> parsePaymentFields();\n\n //reassign vars for CS Credit Cards\n$ccFirstName = $fieldParse-> getCredtCardFirstName();\n$ccLastName = $fieldParse-> getCredtCardLastName();\n$ccCardType = $fieldParse-> getCardType();\n$ccCardYear = $fieldParse-> getCardYear(); \n$ccCardMonth = $this->cardMonth;\n$ccCardNumber = $this->cardNumber;\n$ccCardCvv = $this->cardCvv;\n\n\n \n$club_id = $_SESSION['location_id'];\n \n$dbMain = $this->dbconnect();\n\n\n$stmt = $dbMain->prepare(\"SELECT MIN(club_id) FROM club_info WHERE club_name != ''\");//>=\n$stmt->execute(); \n$stmt->store_result(); \n$stmt->bind_result($club_id); \n$stmt->fetch();\n$stmt->close();\n \n$stmt = $dbMain ->prepare(\"SELECT gateway_id, passwordfd FROM billing_gateway_fields WHERE club_id= '$club_id'\");\n$stmt->execute(); \n$stmt->store_result(); \n$stmt->bind_result($userName, $password);\n$stmt->fetch();\n$stmt->close();\n \n$amount = $this->creditPayment;\n \n //credit\"\";//\n$ccnumber = $ccCardNumber;//\"4111111111111111\";\n$ccexp = \"$this->cardMonth$this->cardYear\";//\"1010\";\n$cvv = \"$this->cardCvv\";\n //==================\n$reference = \"CMP Balance\";\n$vaultFunction = \"\";//'add_customer';//'add_customer' or 'update_customer'\n$orderId = \"$this->contractKey\";\n$merchField1 = \"$reference $this->contractKey\";\n$payTypeFlag = \"creditcard\";//\"creditcard\"; // '' or 'check'\nif(isset($_SESSION['track1'])){\n $track1 = $_SESSION['track1'];\n}else{\n $track1 = \"\";\n}\nif(isset($_SESSION['track2'])){\n $track2 = $_SESSION['track2'];\n}else{\n $track2 = \"\";\n}\n\n \n$gw = new gwapi;\n$gw->setLogin(\"$userName\", \"$password\");\n$r = $gw->doSale($amount, $ccnumber, $ccexp, $cvv, $payTypeFlag, $orderId, $merchField1, $track1, $track2, $ccFirstName, $ccLastName);\n$ccAuthDecision = $gw->responses['responsetext'];\n$vaultId = $gw->responses['customer_vault_id'];\n$authCode = $gw->responses['authcode']; \n$transactionId = $gw->responses['transactionid'];\n$ccAuthReasonCode = $gw->responses['response_code'];\n//echo \"fubar $ccAuthReasonCode\";\n // exit;\n\n if($ccAuthReasonCode != 100) {\n \n $this->paymentStatus = \"$ccAuthDecision: $ccAuthDecision\";\n //$this->transactionId = $ccAuthReasonCode; \n }else{ \n $_SESSION['cc_request_id'] = $authCode;\n $this->paymentStatus = 1;\n //$this->transactionId = $ccAuthRequestId;\n }\n }\n if ($this->creditPayment == 0.00){\n $this->paymentStatus = 1;\n }\n}", "function do_pr_invoice($data){\n\t$client_id=$data['Clientpayment']['client_id'];\n\t$amount=$data['Clientpayment']['amount'];\n\t$invoice_number=$data['Clientpayment']['invoice_number'];\n \t$list=$this->query(\"select invoice_id, total_amount from invoice where invoice_number='$invoice_number' limit 1;\");\n \t$invoice_amount=isset($list[0][0]['total_amount'])?$list[0][0]['total_amount']:0;\n \t#付清\n \tif($invoice_amount<$amount){\n\t\t\t$this->paid_true_invoice($data,$invoice_amount);\n \t}\n \tif($invoice_amount<$amount)\n \t{\n \t#未付清\n\t\t$this->paid_false_invoice($data,$invoice_number,$invoice_amount);\n \t}\n\t \tif($invoice_amount==$amount)\n \t{\n \t\n \t#刚刚付清\n \t$this->do_pay_for_invoice($data);\n\t$this->query(\"update invoice set paid=true,pay_amount=pay_amount::numeric+$invoice_amount where invoice_number='$invoice_number'\");\n \t\n \t}\n \t$this->commit();\n\t}", "function insert_Creditcard_Transaction($details)\n{\n extract($details);\n\n include(\"db_new.php\");\n //$conn = db_connect();\n $mdate = date('Y-m-d H:i:s');\n $success = 0;\n\n if (DEBUG == 1) echo 'action:'.$action.'<br>';\n\n $purpose = addslashes($txPurpose);\n\n if ($txDate)\n $txDate = date('Y-m-d', strtotime($txDate));\n\n if ($action == \"EDIT\") {\n\n $sql = \"update visa_transaction set transaction_date ='$txDate', amount = $txAmount,\n purpose = '$purpose', visa_id = $creditcard, status = '$status',\n\t\t\t lastmodifieddate = '$mdate' where transaction_id = $id\";\n\n if (DEBUG==1) echo $sql.'<br>';\n\n $msg = 'Record successfully Updated.';\n\n\tif ($con->query($sql) === TRUE) {\n\t\t$msg = \"Credit Card Transaction '$id' successfully Updated.\";\n\t} else {\n\t\t$con->close();\n\t\treturn $id.'@SQL error:UPDATE@0';\n\t}\n /*$result = mysql_query($query, $conn) or die('counter UPDATE error: '.mysql_errno().', '.mysql_error());\n\tif (!$result) return $id.'@SQL error:UPDATE@0';\n $msg = \"Credit Card Transaction '$id' successfully Updated.\";\n*/\n $success = 1;\n\n }\n\n if ($action == \"SAVE\") {\n\n\n $sql = \"insert into visa_transaction(transaction_date, amount,\n purpose, visa_id, status, lastmodifieddate)\n VALUES('$txDate', $txAmount,'$purpose', $creditcard,\n '$status', '$mdate')\";\n\n if (DEBUG==1) echo $sql.'<br>';\n\n\t if ($con->query($sql) === TRUE) {\n\t\t $msg = \"Credit Card Transaction #'$id' successfully Inserted.\";\n\t } else {\n\t\t $con->close();\n\t\t return $id.'@SQL error:UPDATE@0';\n\t }\n\t //$result = mysql_query($query, $conn) or die('counter INSERT error: '.mysql_errno().', '.mysql_error());\n\t $id = mysqli_insert_id();\n\t //echo \"id=\".$id;\n\t //if (!$result) return $id.'@SQL error:INSERT@0';\n //$msg = \"Credit Card Transaction #'$id' successfully Inserted.\";\n\n $success = 1;\n }\n $con->close();\n return $id.'@'.$msg.'@'.$success;\n}", "public function credit(FinancialTransactionInterface $transaction, $retry);", "public function credit(RequestInterface $request);", "public function updateCredits($amount)\n {\n return $this->credit()->update(['amount' => $amount]);\n }", "public function chargeCreditCard(Request $request)\n {\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(config('services.authorize.login'));\n $merchantAuthentication->setTransactionKey(config('services.authorize.key'));\n $refId = 'ref'.time();\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($request->cnumber);\n // $creditCard->setExpirationDate( \"2038-12\");\n $expiry = $request->card_expiry_year . '-' . $request->card_expiry_month;\n $creditCard->setExpirationDate($expiry);\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n // Create a transaction\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType(\"authCaptureTransaction\");\n $transactionRequestType->setAmount($request->camount);\n $transactionRequestType->setPayment($paymentOne);\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId( $refId);\n $request->setTransactionRequest($transactionRequestType);\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") )\n {\n $tresponse = $response->getTransactionResponse();\n\n echo \"SUCCESS: transaction ID : \" . $tresponse->getTransId() . \"\\n\";\n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n }\n // else\n // {\n // echo \"Charge Credit Card Null response returned\";\n // }\n // dd($tresponse);\n// return redirect('/');\n }", "public function run()\n {\n $this->checkoutOnepage->getVaultPaymentBlock()->saveCreditCard(\n $this->payment['method'],\n $this->creditCardSave\n );\n }", "public function test_rechargeWithCreditCard_providerAcceptsCharge_returnResultTrueAndIncreaseUploadedAmountWithoutFeeCharge()\n {\n $amount = new Money(12000, new Currency('EUR'));\n $this->exerciseRechargeWithCreditCard(62000, true, $amount);\n }", "public function queryEligibleCreditsToMatch(PaymentTransaction $invoice);", "public function copy_commissions($id){\n\t\tpermittedArea();\n\n\t\t//Get Decision who in online?\n\t\t$user = loggedInUserData();\n\t\t$userID = $user['user_id'];\n\t\tif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['main_account'] = $this->db->get_where('acct_categories', ['category_type' => 'main']);\n\t\t\t$data['sub_account'] = $this->db->get_where('acct_categories', ['category_type' => 'sub']);\n\t\t\t\n\t\t\t$where_array = array ('type'=>'role_name', 'active'=>'1');\n\t\t\t$data['roles']\t\t = $this->db->get_where('role', $where_array);\n\t\t\t\t\n\t\t\t$data['commissions'] = singleDbTableRow($id,'commissions');\n\t\t}\n\t\t\n\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'copy_commissions') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('commission', 'Commission Percentage', 'required|trim'); \n\t\t\t$this->form_validation->set_rules('benefits', 'Benefits Percentage', 'required|trim'); \n\t\t\t$this->form_validation->set_rules('sender_profit', 'Sender Profit Percentage', 'required|trim'); \n\t\t\t$this->form_validation->set_rules('receiver_profit', 'Receiver Profit Percentage', 'required|trim'); \n\t\t\t$this->form_validation->set_rules('sender_deduction', 'Sender Deduction Percentage', 'required|trim'); \n\t\t\t$this->form_validation->set_rules('receiver_deduction', 'Receiver Deduction Percentage', 'required|trim'); \n\t\t\t$this->form_validation->set_rules('points_mode', 'Points mode', 'required|trim'); \n\t\t\t$this->form_validation->set_rules('remarks', 'Transaction Remarks', 'required|trim'); \t\t\n\t\t\t\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->Comissions_rpt_model->copy_commissions($id);\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Transactions Commissions Details \n\t\t\t\t\tcopied Successfully...!!!');\n\t\t\t\t\t//redirect($_SERVER['HTTP_REFERER']);\n\t\t\t\t\tredirect(base_url('Comissions_rpt/Comissions_report_list'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttheme('copy_commissions', $data);\n\t}", "public function edit(Contract $avtocredit)\n {\n $contract = $avtocredit;\n\n return view('products.credit.avtocredit.form', [\n 'block' => false,\n 'borrower' => $contract->borrower,\n 'client' => $contract->client,\n 'contract' => $contract,\n 'contract_leasing_autocredit' => $contract->contract_model,\n ]);\n }", "static function acknowledgeInvoice($invoice_id) {\n global $wpdb;\n $returnval = $wpdb->update(\n \"wp_invoice\",\n array( 'acknowledged_date' => current_time('mysql', 1) ),\n array( 'id' => $invoice_id ) );\n \n if(false === $returnval) {\n throw new DatabaseException(\"Error occurred during UPDATE\");\n }\n }", "public function sendInvoice( $invoice_id )\n\t{\n\t\t$invoiceModel = new Invoices;\n\t\t$customerModel = new Customers;\n\t\t$invoice = $invoiceModel->find(\"pk_invoice_id = \".$invoice_id);\n\t\t$customer = $customerModel->find('pk_customer_id = '.$invoice->fk_customer_id);\n\t\t\n \t\t$body = \"<p> Thank You for your payment made for purchase of \".$invoice->invoice_description.\". \n\t\t \t\t\t Please find attached fully paid invoice No.<b>\".$invoice_id .\"</b>. </p> \n\t\t \t\t\t <p> You have paid <b> &pound;\". $invoice->invoice_total.\"</b> through Direct Debit on \".date(\"d/m/Y H:i:s\").\".</p>\";\t\t\t \n \t\t # Email Template\n\t\t// $template = $template = $this->renderPartial(\"mail_register\", null, true);\n\t\t $template = file_get_contents(Yii::app()->getBaseUrl(true).\"/email_template/email_template.html\");\n\t\t $template = str_replace(\"#from_name#\", $customer->firstname.' '. $customer->lastname, $template); \n\t\t $template = str_replace(\"#message#\", $body, $template);\n\t\t \n\t\t \n\t\t # ======================================================================= \n\t\t # Send PDF file in attachment \n\t\t # =======================================================================\n\t\t $email_message = $template;\n\t\t $file = \"downloads/invoice_\".$invoice_id.\".pdf\";\n\t\t $invoicef = file_get_contents(Yii::app()->getBaseUrl(true).'/index.php/invoice/viewpdf/id/'.$invoice_id);\n \t\t $ftp = fopen($file, \"w\");\n\t\t fwrite($ftp, $invoicef);\n\t\t fclose($ftp); \n\t\t \n\t\t$from_name='Centrica IT';\n \t$from_mail='[email protected]';\n \t$replyto='[email protected]';\n \t$filename= basename($file);\n \n \t$file_size = filesize($file);\n \t$handle = fopen($file, \"r\");\n \t$content = fread($handle, $file_size);\n \tfclose($handle);\n \t$content = chunk_split(base64_encode($content));\n \t$uid = md5(uniqid(time()));\n\t\t$name = basename($file);\n\t\t$header = \"From: \".$from_name.\" <\".$from_mail.\">\\r\\n\";\n\t\t$header .= \"Reply-To: \".$replyto.\"\\r\\n\";\n\t\t$header .= \"MIME-Version: 1.0\\r\\n\";\n\t\t$header .= \"Content-Type: multipart/mixed; boundary=\\\"\".$uid.\"\\\"\\r\\n\\r\\n\";\n\t\t$header .= \"This is a multi-part message in MIME format.\\r\\n\";\n\t\t$header .= \"--\".$uid.\"\\r\\n\";\n\t\t$header .= \"Content-type:text/html; charset=iso-8859-1\\r\\n\";\n\t\t$header .= \"Content-Transfer-Encoding: 7bit\\r\\n\\r\\n\";\n\t\t$header .= $email_message.\"\\r\\n\\r\\n\";\n\t\t$header .= \"--\".$uid.\"\\r\\n\";\n\t\t$header .= \"Content-Type: application/octet-stream; name=\\\"\".$filename.\"\\\"\\r\\n\"; // use different content types here\n\t\t$header .= \"Content-Transfer-Encoding: base64\\r\\n\";\n\t\t$header .= \"Content-Disposition: attachment; filename=\\\"\".$filename.\"\\\"\\r\\n\\r\\n\";\n\t\t$header .= $content.\"\\r\\n\\r\\n\";\n\t\t$header .= \"--\".$uid.\"--\";\n\t\t \n\t\t \n\t\t //$name='=?UTF-8?B?'.base64_encode(\"Centrica-IT\").'?=';\n\t\t $subject='=?UTF-8?B?'.base64_encode('Your payment with Centrica IT Successfully Completed').'?=';\n\t\t #. 1. Email to current user\n\t\t @mail($customer->email, $subject, $email_message, $header, \"-f [email protected]\");\n\t\t \n\t\t #. 2. Email to Admin user\n\t\t if($customer->parent_id > 0) \n\t\t {\n\t\t \t$customer2 = $customerModel->find('pk_customer_id = '.$customer->parent_id);\n\t\t\t$template = file_get_contents(Yii::app()->getBaseUrl(true).\"/email_template/email_template.html\"); \n\t\t \t$template = str_replace(\"#from_name#\",$customer2->firstname.' '. $customer2->lastname, $template); \n\t\t\t$body = \"<p> Thank You for payment made for purchase of \".$invoice->invoice_description.\" by \".\n\t\t\t$customer->firstname .' '.$customer->lastname.'. \n\t\t \t\t\t Please find attached fully paid invoice No.<b>'.$invoice_id .'</b>. </p> \n\t\t \t\t\t <p> You have paid <b> &pound;'. $invoice->invoice_total.\"</b> through Direct Debit on \".date(\"d/m/Y H:i:s\").\".</p>\";\n\t\t\t\t\t \n\t\t \t$template = str_replace(\"#message#\", $body, $template);\n \t @mail($customer2->email, $subject, $email_message, $header, \"-f [email protected]\");\n \t\t }\n\t\t \n\t\t # 3. Email to Support \n\t\t $template = file_get_contents(Yii::app()->getBaseUrl(true).\"/email_template/email_template.html\"); \n\t\t $template = str_replace(\"#from_name#\",\"Support\", $template); \n\t\t # 3. send to support personal\n\t\t $body = \"<p> A new payment has been made for purchase of \".$invoice->invoice_description.\". \n\t\t \t\t\t Please find attached fully paid invoice No.<b>\".$invoice_id .\"</b>. </p> \n\t\t \t\t\t <p> \".$customer->firstname .' '.$customer->lastname.\" has paid <b> &pound;\". $invoice->invoice_total.\"</b> through Credit Card on \".date(\"d/m/Y H:i:s\").\". Other details are as follows:</p>\";\n\t\t $body .= '<p> Username: '.$customer->username.'</p>\n\t\t\t\t\t\t<p> Email: '.$customer->email.'</p>\n\t\t\t\t\t\t<p> Telephone: '.$customer->phone.'</p>';\t\n\t\t\t\t\t\t \n\t\t $template = str_replace(\"#message#\", $body, $template);\n\t\t @mail('[email protected]', \"A new successful payment made\", $email_message, $header, \"-f [email protected]\");\n\t\t\n\t}", "public function pay_credit() {\r\n //var_dump($_POST);\r\n $agent_id = $this->input->post('hddn_agent_id');\r\n $amount = (float)$this->input->post('txt_amount_paid');\r\n $cheque_no = $this->input->post('txt_cheque_no');\r\n \r\n //retrieve purchases\r\n $fields = array(\r\n 'id AS purchase_id','total_paid',\r\n 'ROUND((total_amount-(total_amount*discount/100))-total_paid,2)AS purchase_credit'\r\n );\r\n $criteria = \"agent_id = '{$agent_id}' AND purchase_status = 'completed' AND ROUND(total_amount-(total_amount*discount/100),2) > total_paid\";\r\n $order_by = \"id ASC\";\r\n $purchases = $this->purchase_model->get_purchases($fields,$criteria,'','',$order_by);\r\n //var_dump($purchases);\r\n \r\n //prepare data sets\r\n $data_set_agent = array(\r\n 'credit_amount' => (float)$this->input->post('hddn_credit_amount') - $amount\r\n );\r\n $data_set_financial = array(\r\n 'trans_category' => 'credit',\r\n 'description' => \"Pay credit : \" . $this->input->post('hddn_agent_name'),\r\n 'amount' => $amount,\r\n 'creditor_debtor_id' => $agent_id,\r\n 'income' => FALSE,\r\n 'date_made' => get_cur_date_time(),\r\n 'user_made' => $this->session->userdata('user_id'),\r\n );\r\n if($cheque_no !='') {\r\n $data_set_financial['cheque_no'] = $cheque_no;\r\n $data_set_financial['trans_status'] = 'pending';\r\n }\r\n $data_set_purchases = array();\r\n $data_set_payments = array();\r\n //process purchases\r\n $i = 0;\r\n while($i < count($purchases) && $amount > 0.00) {\r\n $purchase_credit = $purchases[$i]['purchase_credit'];\r\n $amount_paid = 0.00;\r\n if($purchase_credit > $amount) {\r\n $amount_paid = $amount;\r\n $amount = 0.00;\r\n } else {\r\n $amount_paid = $purchase_credit;\r\n $amount -= $amount_paid;\r\n }\r\n array_push($data_set_purchases,array(\r\n 'id' => $purchases[$i]['purchase_id'],\r\n 'total_paid' => $purchases[$i]['total_paid'] + $amount_paid\r\n ));\r\n array_push($data_set_payments,array(\r\n 'trans_id' => null,\r\n 'sales_purchase_id' => $purchases[$i]['purchase_id'],\r\n 'amount' => $amount_paid\r\n ));\r\n $i++;\r\n }//while\r\n //var_dump($data_set_agent);var_dump($data_set_financial);\r\n //var_dump($data_set_purchases);var_dump($data_set_payments);\r\n \r\n $this->db->trans_start();\r\n //insert financial\r\n $trans_id = $this->financial_model->add_transaction($data_set_financial);\r\n \r\n //insert trans id in to payments\r\n for($i = 0; $i < count($data_set_payments); $i++) {\r\n $data_set_payments[$i]['trans_id'] = $trans_id ;\r\n }\r\n //insert payments\r\n $this->payment_model->add_payments($data_set_payments);\r\n \r\n //update purchases\r\n $criteria = 'id';\r\n $this->purchase_model->update_purchases($data_set_purchases,$criteria);\r\n \r\n //update agent\r\n $criteria = array('id' => $agent_id);\r\n $this->agent_model->update_agent($data_set_agent,$criteria);\r\n \r\n $this->db->trans_complete();\r\n \r\n $query_status = $this->db->trans_status();\r\n if($query_status) {\r\n\r\n //insert system log entry\r\n $description = \"Pay credit:\" . $this->input->post('hddn_agent_name');\r\n $this->application->write_log('financial', $description);\r\n \r\n //prepare notifications\r\n $notification = array(\r\n 'is_notification'\t\t=> TRUE,\r\n 'notification_type'\t\t=> 'success',\r\n 'notification_description' => \"The credit is added successfully.\"\r\n );\r\n\r\n } else {\r\n $notification = array(\r\n 'is_notification'\t\t=> TRUE,\r\n 'notification_type'\t\t=> 'error',\r\n 'notification_description' => 'Error terminated adding the credit.'\r\n );\r\n }\r\n $this->session->set_flashdata($notification);\r\n redirect('financial/creditors_debtors');\r\n \r\n }", "function accountwithdrawal()\n\t\t\t{\n\t\t\t\techo\"<h3>You are withdrawing from main account</h3>\";\n\t\t\t\techo\"<br/><hr/>\";\n\t\t\t\techo\"<form action='industrynemurabinik' method='post' style=''>\";\n\t\t\t\techo\"Given to:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' name='nameofperson' placeholder='enter name of person assigned' size='32' required='required'/><br/><br/>\";\n\t\t\t\techo\"enter amount<input type='text' name='amount' placeholder='enter amount to withdraw' size='32' required='required'/><br/><br/>\";\n\t\t\t\t\n\t\t\t\t$vote=mysqli_query($con,\"select * from voteheads where termit='one'\");\n\t\t\t\techo\"amount use: <select name='votehead' style='width:39%;'>\";\n\t\t\t\twhile($head=mysqli_fetch_array($vote))\n\t\t\t\t{\n\t\t\t\t\techo\"<option>\".$head['name'].\"</option>\";\n\t\t\t\t}\n\t\t\t\techo\"<option>other</option>\";\n\t\t\t\techo\"</select><br/><br/>\";\n\t\t\t\techo\"<input type='submit' value='withdraw cash'/>\";\n\t\t\t\techo\"</form>\";\n\t\t\t\t//end of making payments\n\t\t\t}", "function cc_submit($form, $course)\n {\n global $CFG, $USER, $SESSION;\n require_once('authorizenetlib.php');\n\n prevent_double_paid($course);\n\n $useripno = getremoteaddr();\n $curcost = get_course_cost($course);\n $exp_date = sprintf(\"%02d\", $form->ccexpiremm) . $form->ccexpireyyyy;\n\n // NEW CC ORDER\n $timenow = time();\n $order = new stdClass();\n $order->paymentmethod = AN_METHOD_CC;\n $order->refundinfo = substr($form->cc, -4);\n $order->ccname = $form->firstname . \" \" . $form->lastname;\n $order->courseid = $course->id;\n $order->userid = $USER->id;\n $order->status = AN_STATUS_NONE; // it will be changed...\n $order->settletime = 0; // cron changes this.\n $order->transid = 0; // Transaction Id\n $order->timecreated = $timenow;\n $order->amount = $curcost['cost'];\n $order->currency = $curcost['currency'];\n $order->id = insert_record(\"enrol_authorize\", $order);\n if (!$order->id) {\n email_to_admin(\"Error while trying to insert new data\", $order);\n return \"Insert record error. Admin has been notified!\";\n }\n\n $extra = new stdClass();\n $extra->x_card_num = $form->cc;\n $extra->x_card_code = $form->cvv;\n $extra->x_exp_date = $exp_date;\n $extra->x_currency_code = $curcost['currency'];\n $extra->x_amount = $curcost['cost'];\n $extra->x_first_name = $form->firstname;\n $extra->x_last_name = $form->lastname;\n $extra->x_country = $form->cccountry;\n $extra->x_address = $form->ccaddress;\n $extra->x_state = $form->ccstate;\n $extra->x_city = $form->cccity;\n $extra->x_zip = $form->cczip;\n\n $extra->x_invoice_num = $order->id;\n $extra->x_description = $course->shortname;\n\n $extra->x_cust_id = $USER->id;\n $extra->x_email = $USER->email;\n $extra->x_customer_ip = $useripno;\n $extra->x_email_customer = empty($CFG->enrol_mailstudents) ? 'FALSE' : 'TRUE';\n $extra->x_phone = '';\n $extra->x_fax = '';\n\n $revieworder = false;\n $action = AN_ACTION_AUTH_CAPTURE;\n\n if (!empty($CFG->an_authcode) && !empty($form->ccauthcode)) {\n $action = AN_ACTION_CAPTURE_ONLY;\n $extra->x_auth_code = $form->ccauthcode;\n }\n elseif (!empty($CFG->an_review)) {\n $revieworder = true;\n $action = AN_ACTION_AUTH_ONLY;\n }\n\n $message = '';\n if (AN_APPROVED != authorize_action($order, $message, $extra, $action, $form->cctype)) {\n email_to_admin($message, $order);\n return $message;\n }\n\n $SESSION->ccpaid = 1; // security check: don't duplicate payment\n if ($order->transid == 0) { // TEST MODE\n if ($revieworder) {\n redirect($CFG->wwwroot, get_string(\"reviewnotify\", \"enrol_authorize\"), '30');\n }\n else {\n enrol_into_course($course, $USER, 'authorize');\n redirect(\"$CFG->wwwroot/course/view.php?id=$course->id\");\n }\n return;\n }\n\n if ($revieworder) { // review enabled, inform payment managers and redirect the user who have paid to main page.\n $a = new stdClass;\n $a->url = \"$CFG->wwwroot/enrol/authorize/index.php?order=$order->id\";\n $a->orderid = $order->id;\n $a->transid = $order->transid;\n $a->amount = \"$order->currency $order->amount\";\n $a->expireon = userdate(authorize_getsettletime($timenow + (30 * 3600 * 24)));\n $a->captureon = userdate(authorize_getsettletime($timenow + (intval($CFG->an_capture_day) * 3600 * 24)));\n $a->course = $course->fullname;\n $a->user = fullname($USER);\n $a->acstatus = ($CFG->an_capture_day > 0) ? get_string('yes') : get_string('no');\n $emailmessage = get_string('adminneworder', 'enrol_authorize', $a);\n $a = new stdClass;\n $a->course = $course->shortname;\n $a->orderid = $order->id;\n $emailsubject = get_string('adminnewordersubject', 'enrol_authorize', $a);\n $context = get_context_instance(CONTEXT_COURSE, $course->id);\n if (($paymentmanagers = get_users_by_capability($context, 'enrol/authorize:managepayments'))) {\n foreach ($paymentmanagers as $paymentmanager) {\n email_to_user($paymentmanager, $USER, $emailsubject, $emailmessage);\n }\n }\n redirect($CFG->wwwroot, get_string(\"reviewnotify\", \"enrol_authorize\"), '30');\n return;\n }\n\n // Credit card captured, ENROL student now...\n if (enrol_into_course($course, $USER, 'authorize')) {\n if (!empty($CFG->enrol_mailstudents)) {\n send_welcome_messages($order->id);\n }\n if (!empty($CFG->enrol_mailteachers)) {\n $context = get_context_instance(CONTEXT_COURSE, $course->id);\n $paymentmanagers = get_users_by_capability($context, 'enrol/authorize:managepayments', '', '', '0', '1');\n $paymentmanager = array_shift($paymentmanagers);\n $a = new stdClass;\n $a->course = \"$course->fullname\";\n $a->user = fullname($USER);\n email_to_user($paymentmanager,\n $USER,\n get_string(\"enrolmentnew\", '', format_string($course->shortname)),\n get_string('enrolmentnewuser', '', $a));\n }\n if (!empty($CFG->enrol_mailadmins)) {\n $a = new stdClass;\n $a->course = \"$course->fullname\";\n $a->user = fullname($USER);\n $admins = get_admins();\n foreach ($admins as $admin) {\n email_to_user($admin,\n $USER,\n get_string(\"enrolmentnew\", '', format_string($course->shortname)),\n get_string('enrolmentnewuser', '', $a));\n }\n }\n } else {\n email_to_admin(\"Error while trying to enrol \" . fullname($USER) . \" in '$course->fullname'\", $order);\n }\n\n if ($SESSION->wantsurl) {\n $destination = $SESSION->wantsurl; unset($SESSION->wantsurl);\n } else {\n $destination = \"$CFG->wwwroot/course/view.php?id=$course->id\";\n }\n load_all_capabilities();\n redirect($destination, get_string('paymentthanks', 'moodle', $course->fullname), 10);\n }", "function updateSavingsBalance($db_link, $cust_id){\n\t\t$sql_savbal_upd = \"UPDATE savbalance SET savbal_balance = (SELECT SUM(sav_amount) FROM savings WHERE cust_id = $cust_id) WHERE cust_id = $cust_id\";\n\t\t$query_savbal_upd = mysqli_query($db_link, $sql_savbal_upd);\n\t\tcheckSQL($db_link, $query_savbal_upd, $db_link);\n\t}", "public function setCreditClient(?float $creditClient): Centralisateur {\n $this->creditClient = $creditClient;\n return $this;\n }", "function debit($total, $creditCard)\n {\n }", "public function refund()\n\t{\n\t\trequirePermission(\"canRefund\");\n\n\t\t$id = intval($this->input->get(\"id\"));\n\t\t$costDp = intval($this->input->get(\"costDp\"));\n\t\t$accountId = intval($this->input->get(\"accountId\"));\n\t\t\n\t\tif(!$id || !is_numeric($id))\n\t\t{\n\t\t\tdie();\n\t\t}\n\n\t\tif ($costDp != \"Free\") {\n\t\t\tif(!$costDp || !is_numeric($costDp))\n\t\t\t{\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\n\t\tif(!$accountId || !is_numeric($accountId))\n\t\t{\n\t\t\tdie();\n\t\t}\n\n\t\tif ($costDp != \"Free\") {\n\t\t\tif ($costDp > 0) {\n\t\t\t\t$userDp = intval($this->recup_model->getDp($accountId));\n\t\t\t\tif(!$userDp || !is_numeric($userDp))\n\t\t\t\t{\n\t\t\t\t\tdie(\"Problème lors de l'acquisition des users dps.\");\n\t\t\t\t}\n\t\t\t\t$this->internal_user_model->setDp($accountId, $userDp+$costDp);\n\t\t\t}\n\t\t}\n\t\t$this->recup_model->editEtat($this->realms->getRealm(1)->getCharacters()->getConnection(), $id, 8);\n\t}", "public function checkCredit(Tritac_Capayable_Model_Customer $_customer, $amount, $isFinal = false)\n {\n if($this->_logging){\n Mage::log('In checkCredit (Postpayment)', null, $this->_logfile);\n }\n\n $v2Model = new Tritacv2_Model_CreditCheckRequestV2Model();\n\n $v2Model->setLastName($_customer->getCustomerLastname());\n $v2Model->setInitials($_customer->getCustomerMiddlename());\n\n $gender = self::UNKNOWN;\n if($_customer->getCustomerGender() == 1) {\n $gender = self::MALE;\n }elseif($_customer->getCustomerGender() == 2) {\n $gender = self::FEMALE;\n }\n $v2Model->setGender($gender);\n\n $v2Model->setBirthDate($_customer->getCustomerDob());\n $v2Model->setStreetName($_customer->getStreet());\n $v2Model->setHouseNumber($_customer->getHouseNumber());\n $v2Model->setHouseNumberSuffix($_customer->getHouseSuffix());\n $v2Model->setZipCode($_customer->getPostcode());\n $v2Model->setCity($_customer->getCity());\n $v2Model->setCountryCode($_customer->getCountryId());\n\n // different shipping address?\n $v2Model->setHasDifferentShippingAddress(false);\n try {\n $quote = Mage::getModel('checkout/session')->getQuote();\n if(isset($quote)) {\n $shippingData = $quote->getShippingAddress()->getData();\n $billingData = $quote->getBillingAddress()->getData();\n if(isset($shippingData) && isset($billingData)) {\n if(isset($shippingData['postcode']) && isset($shippingData['street']) && isset($billingData['street'])) {\n // okay, is there any difference then it would most certainly be in street\n if($shippingData['street'] == $billingData['street']) {\n // no diff so skip\n } else {\n $shpPostcode = $shippingData['postcode'];\n $shpStreet = $shippingData['street'];\n $city = $shippingData['city'];\n $countryId = $shippingData['country_id'];\n $street = '';\n $houseNr = '';\n $housenrSfx = '';\n $strData = explode(\"\\n\", $shpStreet);\n if (count($strData) == 3) {\n $street = $strData[0];\n $houseNr = $strData[1];\n $housenrSfx = $strData[2];\n } elseif(count($strData) == 2) {\n $street = $strData[0];\n $pattern = '#^([0-9]{1,5})([a-z0-9 \\-/]{0,})$#i';\n preg_match($pattern, $strData[1], $houseNumbers);\n $houseNr = $houseNumbers[1];\n $housenrSfx = (isset($houseNumbers[2])) ? $houseNumbers[2] : '';\n } elseif(count($strData) == 1 && strlen($shpStreet) > 0) {\n $pattern = '#^([a-z0-9 [:punct:]\\']*) ([0-9]{1,5})([a-z0-9 \\-/]{0,})$#i';\n preg_match($pattern, $shpStreet, $addressParts);\n if(count($addressParts) > 1) {\n $street = $addressParts[1];\n $houseNr = $addressParts[2];\n $housenrSfx = (isset($addressParts[3])) ? $addressParts[3] : '';\n }\n }\n if($this->_logging) {\n Mage::log('street is now ' . $street, null, $this->_logfile);\n Mage::log('housenr is now ' . $houseNr, null, $this->_logfile);\n Mage::log('housesfx is now ' . $housenrSfx, null, $this->_logfile);\n }\n $v2Model->setHasDifferentShippingAddress(true);\n $v2Model->setShippingStreetName($street);\n $v2Model->setShippingHouseNumber($houseNr);\n $v2Model->setShippingHouseNumberSuffix($housenrSfx);\n $v2Model->setShippingZipCode($shpPostcode);\n $v2Model->setShippingCity($city);\n $v2Model->setShippingCountryCode($countryId);\n }\n }\n }\n }\n } catch (Exception $e) {\n Mage::log('Exception when trying to get ShippingAddress: ' . $e->getMessage(), null, $this->_logfile);\n }\n\n $v2Model->setPhoneNumber($_customer->getTelephone());\n $v2Model->setFaxNumber($_customer->getFax());\n $v2Model->setEmailAddress($_customer->getCustomerEmail());\n\n $v2Model->setIsCorporation((bool)$_customer->getIsCorporation());\n $v2Model->setCorporationName($_customer->getCorporationName());\n $v2Model->setCocNumber($_customer->getCocNumber());\n\n // Set to true in case of a small business / freelancer / independent contractor etc (zzp/eenmanszaak)\n $v2Model->setIsSoleProprietor((bool)$_customer->getIsSoleProprietor());\n\n $v2Model->setIsFinal($isFinal);\n $v2Model->setClaimAmount($amount);\n $v2Model->setIsInThreeInstallments(false);\n\n //apparently they want IP address now\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n $v2Model->setIpAddress($ip);\n\n try {\n $publicKey = Mage::getStoreConfig('payment/capayable/public_key');\n $apiConfig = new Tritacv2_Configuration();\n $apiConfig->setApiKey('apikey', $publicKey);\n if($this->_logging) {\n Mage::log('In checkCredit (Postpayment) dit is url ' . $this->_url, null, $this->_logfile);\n }\n $apiConfig->setHost($this->_url);\n $apiClient = new Tritacv2_ApiClient($apiConfig);\n $creditCheckApi = new Tritacv2_Api_CreditCheckApi($apiClient);\n $result = $creditCheckApi->creditCheckV2Post($v2Model);\n if($this->_logging) {\n Mage::log('In checkCredit (Postpayment) result : ', null, $this->_logfile);\n Mage::log($result, null, $this->_logfile);\n }\n return $result;\n } catch (Exception $e) {\n Mage::log('Exception when calling creditCheckApi->creditCheckV2Post: '. $e->getMessage(), null, $this->_logfile);\n }\n }", "public function update(Request $request, CreditCard $creditCard)\n {\n //\n }", "public static function addCreditCard($inLicenseId, $inStripeCustomerId, $inStripeCCToken, $inCaller){\n $myArray = array(\n 'Reason' => \"\",\n 'Result' => 0\n );\n\n //Verify inputs\n if(!validate::tryParseInt($inLicenseId)){\n $myArray['Reason'] = \"Invalid input\";\n $errorMessage = $myArray['Reason'].\" for LicenseId \".(string)$inLicenseId.\".\";\n util_errorlogging::LogBrowserError(3, $errorMessage, __METHOD__, __FILE__);\n return $myArray;\n }\n if(!validate::isNotNullOrEmpty_String(trim($inStripeCustomerId))){\n $myArray['Reason'] = \"Invalid input\";\n $errorMessage = $myArray['Reason'].\" for StripeCustomerId \".$inStripeCustomerId.\".\";\n util_errorlogging::LogBrowserError(3, $errorMessage, __METHOD__, __FILE__);\n return $myArray;\n }\n if(!validate::isNotNullOrEmpty_String(trim($inStripeCCToken))){\n $myArray['Reason'] = \"Invalid input\";\n $errorMessage = $myArray['Reason'].\" for StripeCreditCardId \".$inStripeCCToken.\".\";\n util_errorlogging::LogBrowserError(3, $errorMessage, __METHOD__, __FILE__);\n return $myArray;\n }\n if(!account::verifyLicenseExistsById($inLicenseId)){\n $myArray['Reason'] = \"License does not exist for user.\";\n $errorMessage = $myArray['Reason'].\" LicenseID was \".(string)$inLicenseId.\".\";\n util_errorlogging::LogBrowserError(3, $errorMessage, __METHOD__, __FILE__);\n return $myArray;\n }\n\n $myLicense = account::getLicenseById($inLicenseId);\n if(!validate::isNotNullOrEmpty_String($myLicense[0]->StripeCreditCardId)){\n $addCreditCardResponse = stripe_charger::addCreditCard($inStripeCustomerId, $inStripeCCToken);\n\n if($addCreditCardResponse['Result']){\n $myArray['Reason'] = $addCreditCardResponse['Reason'];\n //$customerArray = stripe_charger::getCustomerArrayFromStripeCustomerObject($addCreditCardResponse['Customer']);\n $cardArray = stripe_charger::getCardArrayFromStripeCustomerObject($addCreditCardResponse['Customer']);\n\n $updateResult = account::updateLicenseForCreditCardAddition($inLicenseId, $cardArray['id'], $cardArray['type'], $cardArray['last4'], util_datetime::getDateStringToDateTime($cardArray['exp_month'].\"/1/\".$cardArray['exp_year']), $inCaller);\n\n if($updateResult){\n $myArray['Result'] = 1;\n $ValuesArray = array(\n 'SystemNotes' => \"Credit card added.\",\n 'UserNotes' => \"-None Entered-\"\n );\n account::insertIntoLicenseTransactionHistory($inLicenseId, enum_LicenseTransactionType::Changed, $ValuesArray, $inCaller);\n }\n else{\n $myArray['Reason'] .= \" However, credit card data was not added to our system for LicenseId \".(string)$inLicenseId.\". StripeCardID was \".$cardArray['id'];\n $errorMessage = $myArray['Reason'].\" . Called by \".$inCaller;\n util_errorlogging::LogGeneralError(enum_LogType::Normal, $errorMessage, __METHOD__, __FILE__);\n }\n }\n else{\n $myArray['Reason'] = \"Error adding credit card.\";\n if($addCreditCardResponse['StripeException'] != null){\n $errorMessage = \"Error adding credit card. Stripe threw an exception. Message: \".$addCreditCardResponse['Reason'].\" . Called by \".$inCaller;\n }\n else{\n $errorMessage = \"Error adding credit card. The removal was not completed. Message: \".$addCreditCardResponse['Reason'].\" . Called by \".$inCaller;\n }\n util_errorlogging::LogGeneralError(enum_LogType::Normal, $errorMessage, __METHOD__, __FILE__);\n }\n }\n else{\n $myArray['Reason'] = \"There is a credit card on file already.\";\n }\n\n return $myArray;\n }", "public function whmcs_add_credit($params = array()) {\n\t\t$params['action'] = 'AddCredit';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "function update_user_credits_by_amount($id_user='', $amount=''){\t\n\t\ttry{\n\t\t\t$this->db->set('credits','credits+'.$amount, FALSE);\n\t\t\t$this->db->where('id', $id_user);\n\t\t\t$result = $this->db->update('user');\n\t\t\tif($this->db->affected_rows()>0){\n\t\t\t\treturn TRUE;\n\t\t\t}else{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}catch(Exception $e){\n\t\t\tlog_message('debug','Error en la función update_user_credits_by_amount');\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function addInvoice() {\n $stmt = $GLOBALS['con']->prepare(\"INSERT INTO invoices (customer_id, amount_due, invoice_due_date, service_id, service_name, fully_paid)\n VALUES (?, ?, ?, ?, ?, ?);\");\n $stmt->bind_param(\"ssssss\", $custId, $amountDue, $invoiceDate, $serviceId, $serviceName, $paid);\n\n\n $custId = validateInput('invoiceCustId', 'post');\n $invoiceDate = validateInput('invoiceDate', 'post');\n list($serviceId, $serviceName) = explode(\":\", validateInput('service', 'post')); // 'service id : service name'\n $paid = validateInput('fullyPaid', 'post'); // 1 === 'no' : 2 === yes'\n $amountDue = '';\n\n // Get the price of the service\n $sql = \"SELECT price FROM services WHERE id = $serviceId\";\n $result = mysqli_query($GLOBALS['con'], $sql);\n if ($result) {\n $amountDue = mysqli_fetch_assoc($result); \n $amountDue = $amountDue['price'];\n }\n\n $stmt->execute();\n $stmt->close(); \n }", "public function set_credits_discountamount($observer)\n {\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//Mage::log(Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig() . \" configuration settings \");\n//Mage::log($array2);\n $session = Mage::getSingleton('checkout/session');\n if(Mage::helper('customer')->isLoggedIn()) {\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n $customer_group=Mage::getModel('customer/group')->load(Mage::getSingleton('customer/session')->getCustomerGroupId())->getCustomerGroupCode();\n}\n \n$val1 = Mage::getSingleton('adminhtml/session')->getValue();\nif(isset($val1))\n{\n$amt1 = array();\n$amt1 = Mage::getSingleton('checkout/session')->getCredits();\n$amt = $amt1['totalCredits'];\n$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();\n}\nelse{\n$amt1 = array();\n $quote = Mage::getModel('checkout/cart')->getQuote();\n$amt1 = Mage::getSingleton('checkout/session')->getCredits();\n$amt = $amt1['discountCredits'];\n}\n $isvirtual=0;\n foreach($quote->getAllItems() as $item){\n if($item->getIsVirtual()==1) {\n $isvirtual=1;\n }\n if(Mage::getModel('catalog/product')->load($item->getProductId())->getTypeId()=='customproduct'){\n $isvirtual=1;\n }\n }\n$total=$quote->getGrandTotal(); \n\n$subTotal = $quote->getSubtotal();\n//Mage::log($quote->getGrandTotal().\"this is grand total store credit\");\n//Mage::log($quote->getSubtotal().\"this is sub total\");\n\n if (!Mage::helper('kartparadigm_storecredit')->getTaxEnabled()){\n$tax = $quote->getShippingAddress()->getData('tax_amount');\n}\n if(!Mage::helper('kartparadigm_storecredit')->getIsShippingEnabled()){\n$shippingPrice = $quote->getShippingAddress()->getShippingAmount();\n}\n$totalCredits1 = array();\n$totalCredits1 = Mage::getSingleton('checkout/session')->getCredits();\n$totalCredits = $totalCredits1['totalCredits'];\n\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); \n//echo $expirydate;\n//echo $nowdate;\n$balance;\n//echo $amt;\n$amt2;\n $amt1;\n \n\nif(isset($amt)){\n/*---------------------Calculating Default Currency Value----------------------- */\n$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\n $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n if ($baseCurrencyCode != $currentCurrencyCode) {\n $amt2 = Mage::helper('directory')->currencyConvert($amt1, $baseCurrencyCode, $currentCurrencyCode);\n }\n else{\n $amt2 = $amt1; \n }\n // $amt2 = Mage::helper('core')->currency($amt1, true, false);\n//Mage::log($amt1.\" = amount = \".$amt2 );\n//----------------------------------------------------------------\nif($total > $amt2) {\nif(($total - $tax - $shippingPrice) > $amt2){\n$discountAmount = $amt2;\n$balance = $totalCredits - $amt;\n}else{\n $discountAmount = $subTotal;\n$points = round(($discountAmount * $amt)/$amt2);\n//Mage::log($points.\"Conver Points\");\n$balance = $totalCredits - $points;\n}\n}\nelse {\n$discountAmount = $total - $tax - $shippingPrice;\n$points = round(($discountAmount * $amt)/$amt2);\n//Mage::log($points.\"Conver Points\");\n$balance = $totalCredits - $points;\n}\nMage::getSingleton('core/session')->setBalance($balance);\n\nMage::getSingleton('checkout/session')->setDiscount($totalCredits - $balance);\n$msg = \"Current Credits In Your Account : \" . $balance;\nMage::getSingleton('core/session')->setCredits($msg);\n if ($discountAmount > 0) {\n\n\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseDiscount = $discountAmount/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseDiscount = $discountAmount;\n } \n $total = $quote->getBaseSubtotal();\n $data1 = $quote->getData();\n // Mage::log($data1['entity_id'].\"quote id\");\n $quote->setSubtotal(0);\n $quote->setBaseSubtotal(0);\n $quote->setSubtotalWithDiscount(0);\n $quote->setBaseSubtotalWithDiscount(0);\n $quote->setGrandTotal(0);\n $quote->setBaseGrandTotal(0);\n $canAddItems = $quote->isVirtual() ? ('billing') : ('shipping');\n foreach($quote->getAllAddresses() as $address) {\n $data = $address->getData();\n $address->setSubtotal(0);\n $address->setBaseSubtotal(0);\n $address->setGrandTotal(0);\n $address->setBaseGrandTotal(0);\n $address->collectTotals();\n $quote->setSubtotal((float)$quote->getSubtotal() + $address->getSubtotal());\n $quote->setBaseSubtotal((float)$quote->getBaseSubtotal() + $address->getBaseSubtotal());\n $quote->setSubtotalWithDiscount((float)$quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount());\n $quote->setBaseSubtotalWithDiscount((float)$quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount());\n $quote->setGrandTotal((float)$quote->getGrandTotal() + $address->getGrandTotal());\n $quote->setBaseGrandTotal((float)$quote->getBaseGrandTotal() + $address->getBaseGrandTotal());\n $quote->setEntityId($data1['entity_id'])->save();\n $quote->setSubtotalWithDiscount($quote->getSubtotal() - $discountAmount)->setBaseSubtotalWithDiscount($quote->getBaseSubtotal() - $baseDiscount)->setEntityId($data1['entity_id'])->save();\n if ($address->getAddressType() == $canAddItems) {\n $address->setSubtotalWithDiscount((float)$data['subtotal_with_discount'] - $discountAmount);\n $address->setGrandTotal((float)$data['grand_total'] - $discountAmount);\n $address->setBaseSubtotalWithDiscount((float)$data['base_subtotal_with_discount'] - $baseDiscount);\n $address->setBaseGrandTotal((float)$data['base_grand_total'] - $baseDiscount);\n if ($data['discount_description']) {\n $address->setDiscountAmount(($data['discount_amount'] - $discountAmount));\n $address->setDiscountDescription($data['discount_description'] . ', Store Credits');\n $address->setBaseDiscountAmount(($data['base_discount_amount'] - $baseDiscount));\n }\n else {\n $address->setDiscountAmount(-($discountAmount));\n $address->setDiscountDescription('Store Credits');\n $address->setBaseDiscountAmount(-($baseDiscount));\n }\n $address->setAddressId($data['address_id'])->save();\n }\n }\n foreach($quote->getAllItems() as $item) {\n\n // We apply discount amount based on the ratio between the GrandTotal and the RowTotal\n $rat = $item->getPriceInclTax() / $quote->getSubtotal();\n $rat1 = $item->getBasePriceInclTax() / $quote->getBaseSubtotal();\n $ratdisc = $discountAmount * $rat;\n $ratdisc1 = $baseDiscount * $rat1;\n//Mage::log($item->getDiscountAmount().\"include tax\".$item->getBaseDiscountAmount());\n // Mage::log($item->getDiscountAmount().\"discount storecredit\");\n$idata = $item->getData();\n Mage::log($item->getDiscountAmount().\"discount amount credit\");\n $item->setDiscountAmount(($item->getDiscountAmount() + $ratdisc) * $item->getQty());\n $item->setBaseDiscountAmount(($item->getBaseDiscountAmount() + $ratdisc1) * $item->getQty())->save();\n }\n }else if($totalCredits == 0){\n\n$msg = \"Sorry You Have No Credits In Your Account\";\nMage::getSingleton('core/session')->setCredits($msg);\n}\n \n \n } \n }", "public function edit_save($id)\n\t{\n\t\tif (!$this->is_allowed('amuco_credit_insurance_update', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$this->form_validation->set_rules('customer_id', 'Customer Id', 'trim|required|max_length[10]');\n\t\t$this->form_validation->set_rules('raiting', 'Raiting', 'trim|required');\n\t\t$this->form_validation->set_rules('credit_ever_denied', 'Credit Ever Denied', 'trim|required');\n\t\t$this->form_validation->set_rules('available_credit', 'Available Credit', 'trim|required');\n\t\t$this->form_validation->set_rules('insured_credit', 'Insured Credit', 'trim|required');\n\t\t$this->form_validation->set_rules('own_risk', 'Own Risk', 'trim|required');\n\t\t$this->form_validation->set_rules('highest_ever_insured', 'Highest Ever Insured', 'trim|required');\n\t\t$this->form_validation->set_rules('request_increase_status', 'Request Increase Status', 'trim|max_length[20]');\n\t\t\n\t\tif ($this->form_validation->run()) {\n\t\t\n\t\t\t$save_data = [\n\t\t\t\t'customer_id' => $this->input->post('customer_id'),\n\t\t\t\t'raiting' => $this->input->post('raiting'),\n\t\t\t\t'credit_ever_denied' => $this->input->post('credit_ever_denied'),\n\t\t\t\t'available_credit' => $this->input->post('available_credit'),\n\t\t\t\t'insured_credit' => $this->input->post('insured_credit'),\n\t\t\t\t'own_risk' => $this->input->post('own_risk'),\n\t\t\t\t'highest_ever_insured' => $this->input->post('highest_ever_insured'),\n\t\t\t\t'request_increase_status' => $this->input->post('request_increase_status'),\n\t\t\t\t'mount_increase' => $this->input->post('mount_increase'),\n\t\t\t\t'last_increased_requested' => $this->input->post('last_increased_requested'),\n\t\t\t\t'date_last_increased_requested' => $this->input->post('date_last_increased_requested'),\n\t\t\t\t'date_updated' => date(\"Y-m-d H:i:s\"),\n\t\t\t];\n\n\t\t\t\t\t\t$data_output=$this->model_amuco_credit_insurance->find($id);\n\t\t $save_amuco_credit_insurance = $this->model_amuco_credit_insurance->change($id, $save_data);\n\n\t\t\tif ($save_amuco_credit_insurance) {\n\t\t\t\t$save_data_tracer=array_merge($save_data,['id'=>$id]);\n\t\t\t\t$this->insert_logs($save_data_tracer,'updated',$data_output);\n\t\t\t\n\t\t\t\tif ($this->input->post('save_type') == 'stay') {\n\t\t\t\t\t$this->data['success'] = true;\n\t\t\t\t\t$this->data['id'] \t = $id;\n\t\t\t\t\t$this->data['message'] = cclang('success_update_data_stay', [\n\t\t\t\t\t\tanchor('administrator/amuco_credit_insurance', ' Go back to list')\n\t\t\t\t\t]);\n\t\t\t\t} else {\n\t\t\t\t\tset_message(\n\t\t\t\t\t\tcclang('success_update_data_redirect', [\n\t\t\t\t\t]), 'success');\n\n \t\t$this->data['success'] = true;\n\t\t\t\t\t$this->data['redirect'] = base_url('administrator/amuco_credit_insurance');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->input->post('save_type') == 'stay') {\n\t\t\t\t\t$this->data['success'] = false;\n\t\t\t\t\t$this->data['message'] = cclang('data_not_change');\n\t\t\t\t} else {\n \t\t$this->data['success'] = false;\n \t\t$this->data['message'] = cclang('data_not_change');\n\t\t\t\t\t$this->data['redirect'] = base_url('administrator/amuco_credit_insurance');\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$this->data['success'] = false;\n\t\t\t$this->data['message'] = 'Opss validation failed';\n\t\t\t$this->data['errors'] = $this->form_validation->error_array();\n\t\t}\n\n\t\techo json_encode($this->data);\n\t\texit;\n\t}", "function payCheq($connection,$cheq_ref){\r\n\r\n //pay cheque\r\n $sql = \"SELECT accno ,debit,cheqto,cheq_amount FROM _transactionshistory WHERE check_ref=:cheq_ref AND cheqpaid=0 \";\r\n $stmt = $connection->prepare($sql);\r\n $stmt->execute(array(':cheq_ref'=>$cheq_ref));\r\n $row = $stmt->fetch();\r\n // echo $row['debit'];\r\n if($row['cheq_amount']>0){\r\n //deduct drawer amount debited + charges and update balance\r\n try {\r\n\r\n $connection->beginTransaction();\r\n //balance before debit and charges\r\n $balance = Services::getforAccountsBalance($connection,$row['accno']);\r\n $payee_sql = \"UPDATE _accounts SET balance= :balance WHERE accno = :account\";\r\n $charges = Services::charges($row['cheq_amount']);\r\n $stmt = $connection->prepare($payee_sql);\r\n $stmt->execute(array(':balance'=>$balance-$row['cheq_amount']-$charges,':account'=>$row['accno']));\r\n\r\n //get account to pay to\r\n $payee_balSQL = \"SELECT balance FROM _accounts WHERE accno=:payee_acc\";\r\n $statement_p = $connection->prepare($payee_balSQL);\r\n\r\n $statement_p->execute(array(':payee_acc'=>$row['cheqto']));\r\n $payee_bal = $statement_p->fetch();\r\n\r\n //update payee account balance\r\n $update_accounts = \"UPDATE _accounts SET balance=:bala WHERE accno=:acc\";\r\n $up_stmt = $connection->prepare($update_accounts);\r\n $new_bal = $payee_bal['balance']+$row['cheq_amount'];\r\n $up_stmt->execute(array(':bala'=>$new_bal,':acc'=>$row['cheqto']));\r\n\r\n //record the transaction history\r\n $history_sql = \"INSERT INTO _transactionshistory (accno,date,debit,credit,check_ref,cancelled_cheque,balance) VALUES(:accno,:date,:debit,:credit,:check_ref,:cancelled,:balance)\";\r\n $history_stmt = $connection->prepare($history_sql);\r\n $history_stmt->execute(array(':accno'=>$row['cheqto'],':date'=>date(\"Y/m/d\"),':debit'=>0,':credit'=>$row['cheq_amount'],\r\n ':check_ref'=>$cheq_ref,':cancelled'=>1,':balance'=>$new_bal));\r\n\r\n //record drawer transaction details for drawer\r\n $history_sql2 = \"INSERT INTO _transactionshistory (accno,date,debit,credit,check_ref,charges,cancelled_cheque,balance) VALUES(:accno,:date,:debit,:credit,:check_ref,:charges,:cancelled,:balance)\";\r\n $history_stmt2 = $connection->prepare($history_sql2);\r\n $history_stmt2->execute(array(':accno'=>$row['accno'],':date'=>date(\"Y/m/d\"),':debit'=>$row['cheq_amount'],':credit'=>0,\r\n ':check_ref'=>$cheq_ref,':charges'=>$charges,':cancelled'=>1,':balance'=>$balance-$row['cheq_amount']-$charges));\r\n\r\n\r\n //mark cheque as paid\r\n $t_sql = \"UPDATE _transactionshistory SET cheqpaid=1 WHERE check_ref=:cheq_ref\";\r\n $t_stmt = $connection->prepare($t_sql);\r\n $t_stmt->execute(array(':cheq_ref'=>$cheq_ref));\r\n // if($payee_sql->rowCount()<1 && $up_stmt->rowCount()<1 && $history_stmt->rowCount()<1 && $up_stmt->rowCount()<1){\r\n // $connection->rollBack();\r\n // return false;\r\n // }\r\n $connection->commit();\r\n\r\n return true;\r\n\r\n } catch (Exception $e) {\r\n $connection->rollBack();\r\n //echo \"Failed: \" . $e->getMessage();\r\n return false;\r\n }\r\n }\r\n\r\n return false;\r\n }", "function charge_credit_card() {\n\nif ( is_user_logged_in() ) {\n\t\n\t require 'vendor/autoload.php';\n\n define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n \n ///////////////////////------- FUNCTION CANCEL SUBSCRIPTION --------////////////////////////////\n \n function cancelSubscription($subscriptionId) {\n\t // require 'vendor/autoload.php';\n // define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n\t global $wpdb;\n\t \n\t $current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\n // Common Set Up for API Credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n $request = new AnetAPI\\ARBCancelSubscriptionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscriptionId($subscriptionId);\n\n $controller = new AnetController\\ARBCancelSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n $successMessages = $response->getMessages()->getMessage();\n //echo \"SUCCESS : \" . $successMessages[0]->getCode() . \" \" .$successMessages[0]->getText() . \"\\n\";\n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your request has been processed</h2>';\n\t\techo '<p>You have been unsubscribe successfully</p>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<p>Your credit card will not be automatically debited $'.$monthpaid.' a month.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\n\t\t$wpdb->update( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'status' => 'Inactive',\t// string\n\t\t\t\t), \n\t\t\t\tarray( 'subscribe' => $subscriptionId ), \n\t\t\t\tarray( \n\t\t\t\t\t'%s',\t// value1\n\t\t\t\t), \n\t\t\t\tarray( '%d' ) \n\t\t\t);\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\t\n \n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n \n }\n\n return $response;\n\n }\n \n///////////////////------------- SUBSCRIPTION USERS -----------------/////////////////////\n function createSubscription($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$intervalLength = $peram[0];\n\t//------------------------------------\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\t\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Subscription Type Info\n $subscription = new AnetAPI\\ARBSubscriptionType();\n $subscription->setName(\"Cnanny Monthly Subscription\");\n\n $interval = new AnetAPI\\PaymentScheduleType\\IntervalAType();\n $interval->setLength($intervalLength);\n $interval->setUnit(\"days\");\n\n $paymentSchedule = new AnetAPI\\PaymentScheduleType();\n $paymentSchedule->setInterval($interval);\n $paymentSchedule->setStartDate(new DateTime(date('Y-m-d')));\n $paymentSchedule->setTotalOccurrences(\"12\");\n $paymentSchedule->setTrialOccurrences(\"10\");\n\n $subscription->setPaymentSchedule($paymentSchedule);\n $subscription->setAmount($peram[0]);\n $subscription->setTrialAmount(\"0.00\");\n \n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n\n $payment = new AnetAPI\\PaymentType();\n $payment->setCreditCard($creditCard);\n $subscription->setPayment($payment);\n\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(\"1234354\"); \n $order->setDescription(\"Cnanny Monthly Subscription\"); \n $subscription->setOrder($order); \n \n $billTo = new AnetAPI\\NameAndAddressType();\n $billTo->setFirstName($fname);\n $billTo->setLastName($lname);\n\n $subscription->setBillTo($billTo);\n\n $request = new AnetAPI\\ARBCreateSubscriptionRequest();\n $request->setmerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscription($subscription);\n $controller = new AnetController\\ARBCreateSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") )\n {\n\t\t//$response->getSubscriptionId()\n\t\techo '<h2 class=\"page-heading\">Thank you! Your payment has been processed</h2>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<div class=\"clearfix charged\"><span>Your credit card has been charged <span class=\"text-green\">$'.$monthpaid.'</span></span><br />';\n\t\t\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<div class=\"clearfix charged\">\n\t\t\t\t\t\t\t<p>Your credit card will be automatically debited $'.$monthpaid.' a month until you hire a cNanny or <a href=\"'.site_url().'/subscription-cancellation\" class=\"text-black text-underline\">cancel your subscription</a>.</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\tWhen you hire your perfect cNanny, you will be charged a one-time placement fee of $'.$oncepaid.' only after she accepts the offer.\n\t\t\t\t\t\t\t\tYour monthly subscription will then be automatically cancelled.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$subscrId = $response->getSubscriptionId();\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$ins = $wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => '',\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => $subscrId,\n\t\t\t'res_code' => '-',\n\t\t\t'auth_code' => '-',\n\t\t\t'trans_code' => '-',\n\t\t\t'gcode' => '-',\n\t\t\t'res_des' => 'Success',\n\t\t));\t\n\t\t$paymentsuccess = 1;\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n\t\t$paymentsuccess = 1;\n }\n\n return $paymentsuccess;\n }\n ///////////////////------------- ONCE PAID USERS -----------------/////////////////////\n function chargeCreditCard($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n $creditCard->setCardCode($peram[3]);//////////////////////--- card code 123\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n $order = new AnetAPI\\OrderType();\n $order->setDescription(\"Monthly Payment\");\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($fname);\n $customerAddress->setLastName($lname);\n $customerAddress->setCompany(\"\");\n $customerAddress->setAddress(\"\");\n $customerAddress->setCity(\"\");\n $customerAddress->setState(\"\");\n $customerAddress->setZip(\"\");\n $customerAddress->setCountry(\"\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId(\"\"); // Customer ID \n $customerData->setEmail(\"\");\n\n //Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"600\");\n\n // Create a TransactionRequestType object\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType( \"authCaptureTransaction\"); \n $transactionRequestType->setAmount($peram[0]);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId( $refId);\n $request->setTransactionRequest( $transactionRequestType);\n\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n\n if ($response != null)\n {\n if($response->getMessages()->getResultCode() == 'Ok')\n {\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getMessages() != null) \n {\n\t\t\t$res_code = $tresponse->getResponseCode();\n\t\t\t$auth_code = $tresponse->getAuthCode();\n\t\t\t$trans_code = $tresponse->getTransId();\n\t\t\t$gcode = $tresponse->getMessages()[0]->getCode();\n\t\t\t$res_des = $tresponse->getMessages()[0]->getDescription();\n \n\t\t /* echo \" Transaction Response Code : \" . $res_code . \"\\n\";\n echo \" Successfully created an authCapture transaction with Auth Code : \" . $auth_code . \"\\n\";\n echo \" Transaction ID : \" . $trans_code . \"\\n\";\n echo \" Code : \" . $ccode . \"\\n\"; \n echo \" Description : \" . $res_des . \"\\n\";*/\n\t\t \n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your payment has been processed</h2>';\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<p>Your credit card has been charged <span style=\"color:#6dcd62; font-size:28px\">$'.$oncepaid.'</span></p>';\n\t\techo '<p>you have been hired your perfect cNanny successfully.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\n\n\t\t //---------------------------------------------------\n\t\t\n\t\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => base64_encode($peram[3]),\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => '-',\n\t\t\t'res_code' => $res_code,\n\t\t\t'auth_code' => $auth_code,\n\t\t\t'trans_code' => $trans_code,\n\t\t\t'gcode' => $gcode,\n\t\t\t'res_des' => $res_des,\n\t\t));\t\n\t\t\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n\t\t //------------------------------------------------------\n\t\t \n }\n else\n {\n echo \"Transaction Failed \\n\";\n if($tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n }\n }\n else\n {\n echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n \n if($tresponse != null && $tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n else\n {\n echo \" Error code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n echo \" Error message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n }\n } \n }\n else\n {\n echo \"No response returned \\n\";\n }\n\n return $response;\n }\n \n ///////////////////////////////--------- FUNCTION END -----------/////////////////////////////////// \nif(!empty($_POST['amount'])) {\n $payment_type = $_POST['payment_type'];\n $card = $_POST['card'];\n $mn = $_POST['mn'];\n $yr = $_POST['yr'];\n $exp = $mn.''.$yr;\n $code = $_POST['code'];\n $fullname = $_POST['fullname'];\n $interval = 30; // 30 days interval\n // monthly subscription $75 (run on authorize live mode only)\n if(isset($payment_type) && $payment_type == \"monthly\") {\n\t $monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t \t $amount = $monthpaid;\n \t\t$peramaters = array($amount,$card,$exp,$code,$fullname,$interval);\n \t$ret = createSubscription($peramaters);\n\t\t\n\t\t//print_r($ret); exit(0);\n \t } \n else { \n // cancel monthly subscription first\n global $wpdb;\n \t$current_user = wp_get_current_user();\n\t$user_id = $current_user->ID;\n \t$table_name = $wpdb->prefix . 'payment'; \n\t$subscribe = $wpdb->get_var( \"SELECT subscribe FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe != '-' order by id desc\" );\n\t\tif($subscribe > 0)\n\t\tcancelSubscription($subscribe);\n // pay once $1500 (run on both authorize live and test mode)\n $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n \t\t$amount = $oncepaid;\n\t \t$peramaters = array($amount,$card,$exp,$code,$fullname);\n \t\tchargeCreditCard($peramaters);\n \t\t}\n\n}\n/////////////////////////////////////////////////////////////////////////\n\nif(isset($_GET['subid']) && $_GET['subid'] > 0) { \n \n\t$subid = $_GET['subid'];\n\tcancelSubscription($subid); \n}\n\n\n\n\n/* global $wpdb;\n $table_name = $wpdb->prefix . 'payment';\n $sql = \"DROP TABLE IF EXISTS $table_name\";\n $wpdb->query($sql);\t*/\n\t\n$current_user = wp_get_current_user();\n$username = $current_user->user_login;\n$user_email = $current_user->user_email;\n$user_firstname = $current_user->user_firstname;\n$user_lastname = $current_user->user_lastname;\n$user_id = $current_user->ID;\n$thefullname = $user_firstname?$user_firstname.' '.$user_lastname:'';\t\n ?>\n <style>\n\t #sjkfrm input[type=text] {\n\t\t border:solid 1px #666666;\n\t\tborder-radius: 15px;\n\t\tborder: 2px solid #666666;\n\t\tpadding: 5px; \n\t\theight: 50px; \n\t\t }\n\t.form-control{\n\t\tborder: 2px solid #999 !important;\n\t\tborder-radius: 8px;\n\t\theight:40px !important;\n\t\twidth: 70%;\n\t\t}\n\t.thimg{\n\t\twidth: 70%;\n\t\t}\t\n\t@media only screen and (max-width: 700px) {\n\t\t.form-control{\n\t\t\twidth: 100%;\n\t\t}\n\t\t.thimg{\n\t\twidth: 100%;\n\t\t}\n\t\t}\t\n\t.selbx{\n\t\tborder: 2px solid #999 !important;\n\t\theight:40px !important;\n\t\t}\t \n\t.sbmt{\n\t\tbackground-color:#6dcd62;\n\t\tcolor:#FFF;\n\t\tpadding:12px 35px;\n\t\tborder-radius: 8px;\n\t\tborder: none 0px;\n\t\tmargin-bottom: 20px;\n\t\t}\n\t.sbmt:hover{\n\t\tbackground-color:#090;\n\t\t}\t\n </style>\n <?php \n /* global $wpdb;\n $table_name = $wpdb->prefix . 'payment';\n $oncePaid = $wpdb->get_var( \"SELECT amount FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe == '-' order by id desc\" );\n echo $oncePaid; exit(0);\n if($oncePaid == 1000) {\n\t ?>\n <h2 style=\"color:#7066ce\">You have already paid $1500 for perfect cNanny</h2><br />\n <p>You have already paid $1500 for perfect cNanny. so you need not to be subscribed again</p>\n <?php\n\t $disp = 'style=\"display:none\"';\n\t } else {\n\t$disp = 'style=\"display:block\"';\t \n\t}*/\n ?> \n<form action=\"\" id=\"jkfrm\" method=\"post\" enctype=\"multipart/form-data\" name=\"payment\" autocomplete=\"off\" onsubmit=\"check_exp()\" <?php //echo $disp; ?>>\n\t<style type=\"text/css\">\n #checkout_card_number {\n background-image: url('<?php echo WP_PLUGIN_URL; ?>/authorizejk/cards.png');\n background-position: 3px 3px;\n background-size: 40px 252px; /* 89 x 560 */\n background-repeat: no-repeat;\n padding-left: 48px !important;\n }\n\tlabel span {\n\t\tfont-size:12px;\n\t\tfont-weight:600 !important;\n\t\tcolor:#666 !important;\n\t\t}\n\t/*input.pw {\n -webkit-text-security: disc;\n\t}*/\n\t\n\t\n\t\n\n\n#username,\n#pw {\n display: inline-block;\n width: 150px;\n background: #FFF;\n \tborder: 2px solid #999 !important;\n border-radius: 8px;\n height: 40px !important;\n\tline-height: 40px;\n padding: 0px 5px;\n letter-spacing: 2px;\n\toverflow:hidden;\n}\n#pw {\n -webkit-text-security: disc;\n\t\n}\n\n\n </style>\n <?php\n\t global $wpdb;\n $table_name = $wpdb->prefix . 'payment'; \n\t$subscribe = $wpdb->get_var( \"SELECT subscribe FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe != '-' order by id desc\" );\n\t?>\n <!--<h2 style=\"color:#6dcd62; font-weight:bold;\">$75/month</h2><br />-->\n <?php if(!empty($subscribe)) { \n\tif(empty($ret)) {\n\t\twp_redirect(site_url().'/already-subscribe'); exit(0);\n\t}\n\t?>\n\n <small>Don't worry, you can <a href=\"?subid=<?php echo $subscribe; ?>\" onclick=\"return confirm('Are you sure that you want to cancel monthly subscription from Cnanny?')\">cancel</a> at any time</small><br />\n \n <?php $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500; ?>\n <input type=\"radio\" name=\"payment_type\" value=\"yearly\" checked=\"checked\" style=\"clear:both\" /> <label style=\"margin-top:20px;\"> Pay Once $<?php echo $oncepaid; ?> for hiring perfect cNanny</label>\n <?php } else { ?>\n <?php $monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75; ?>\n <br />\n <input type=\"radio\" name=\"payment_type\" value=\"monthly\" checked=\"checked\" /> <label> Monthly Subscribe $<?php echo $monthpaid; ?></label>\n <?php } ?>\n <br /><br />\n <img src=\"<?php echo WP_PLUGIN_URL; ?>/authorizejk/cclogos.gif\" class=\"thimg\" /><br /><br />\n <label style=\"\">Full Name <span>(as it appears on your card)</span></label> <input type=\"text\" name=\"fullname\" maxlength=\"80\" required=\"required\" class=\"input-text form-control validate-alpha required\" placeholder=\"\" autocomplete=\"off\" value=\"<?php echo $thefullname; ?>\" />\n <input type=\"hidden\" name=\"amount\" value=\"<?php echo $monthpaid; ?>\" /><br />\n <label>Card Number <span>(no dashes or spaces)</span></label><input id=\"checkout_card_number\" name=\"card\" required=\"required\" class=\"input-text form-control validate-creditcard required\" type=\"text\" maxlength=\"16\" data-stripe=\"number\" placeholder=\"\" autocomplete=\"off\"><br />\n <script type=\"text/javascript\">\n\t$ = jQuery.noConflict();\n var $cardinput = $('#checkout_card_number');\n $('#checkout_card_number').validateCreditCard(function(result)\n {\t\t\n //console.log(result);\n if (result.card_type != null)\n {\t\t\t\t\n switch (result.card_type.name)\n {\n case \"visa\":\n $cardinput.css('background-position', '3px -34px');\n $cardinput.addClass('card_visa');\n break;\n \n case \"visa_electron\":\n $cardinput.css('background-position', '3px -72px');\n $cardinput.addClass('card_visa_electron');\n break;\n \n case \"mastercard\":\n $cardinput.css('background-position', '3px -110px');\n $cardinput.addClass('card_mastercard');\n break;\n \n case \"maestro\":\n $cardinput.css('background-position', '3px -148px');\n $cardinput.addClass('card_maestro');\n break;\n \n case \"discover\":\n $cardinput.css('background-position', '3px -186px');\n $cardinput.addClass('card_discover');\n break;\n \n case \"amex\":\n $cardinput.css('background-position', '3px -223px');\n $cardinput.addClass('card_amex');\n break;\n \n default:\n $cardinput.css('background-position', '3px 3px');\n break;\t\t\t\t\t\n }\n } else {\n $cardinput.css('background-position', '3px 3px');\n }\n \n // Check for valid card numbere - only show validation checks for invalid Luhn when length is correct so as not to confuse user as they type.\n if (result.length_valid || $cardinput.val().length > 16)\n {\n if (result.luhn_valid) {\n $cardinput.parent().removeClass('has-error').addClass('has-success');\n } else {\n $cardinput.parent().removeClass('has-success').addClass('has-error');\n }\n } else {\n $cardinput.parent().removeClass('has-success').removeClass('has-error');\n }\n });\n\t//------------------------------------------------------\n\tfunction check_exp() {\n\tvar yr = document.getElementById(\"yrt\").value;\t\n\tvar currentTime = new Date();\n\tvar curr_month = currentTime.getMonth() + 1;\n\tvar theyear = <?php echo date('y'); ?>;\n\tif(yr == theyear) {\n\t\tvar mnt = document.getElementById(\"mnt\").value;\n\t\tif(mnt < curr_month) {\n\t\t\talert('Please select a valid Expiry Date');\n\t\t\t}\n\t}\n\t\n}\n\nfunction set_type() { //\n\tvar pw = $('#pw').text();\n\tdocument.getElementById(\"code\").value = pw;\n\t//alert(pw);\n\t}\n \n </script>\n \n <label>Expiry Date</label><br />\n <select name=\"mn\" class=\"selbx required\" id=\"mnt\" required>\n <option value=\"\">Select Month</option>\n <option value=\"01\">January</option>\n <option value=\"02\">February</option>\n <option value=\"03\">March</option>\n <option value=\"04\">April</option>\n <option value=\"05\">May</option>\n <option value=\"06\">June</option>\n <option value=\"07\">July</option>\n <option value=\"08\">August</option>\n <option value=\"09\">September</option>\n <option value=\"10\">October</option>\n <option value=\"11\">November</option>\n <option value=\"12\">December</option>\n </select>\n <select name=\"yr\" class=\"selbx required\" id=\"yrt\" required onchange=\"check_exp()\">\n <option value=\"\">Select Year</option>\n \n\n <?php \n $y = date('y');\n for($i=1;$i<=12;$i++) {\n ?>\n <option value=\"<?php echo $y; ?>\"><?php echo '20'.$y; ?></option>\n <?php $y++; } ?>\n </select>\n <br />\n <input type=\"text\" name=\"card_number\" value=\"0000 0000 0000 0000\" style=\"display:none\" /><br />\n \n <?php\n if (strlen(strstr($_SERVER['HTTP_USER_AGENT'], 'Firefox')) > 0) { // Firefox\n ?>\n\t <label>Security Code <span>(3 digits on the back / Amex - 4 digits on the front)</span></label> <input type=\"password\" id=\"codeff\" name=\"code\" maxlength=\"4\" class=\"pw input-text form-control validate-digits required\" placeholder=\"\" required=\"required\" value=\"\" style=\"width:150px;\" autocomplete=\"off\" /><br />\n\t<?php\n} else { // other browsers\n ?>\n <label>Security Code <span>(3 digits on the back / Amex - 4 digits on the front)</span></label> <input type=\"hidden\" id=\"code\" name=\"code\" maxlength=\"4\" class=\"pw input-text form-control validate-digits required\" placeholder=\"\" required=\"required\" value=\"\" style=\"width:150px;\" autocomplete=\"off\" /> <br /><div contenteditable id=\"pw\"></div><br /><br />\n <?php\n}\n ?> \n\n\n \n\n \n \n <?php if(!empty($subscribe)) { \n\t\n\t $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500; ?>\n <strong id=\"st\">You will be charged $<?php echo $oncepaid; ?> for hiring perfect cNanny</strong><br /><br />\n <?php } else { \n\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t?>\n <strong id=\"st\">You will be charged $<?php echo $monthpaid; ?> every month</strong><br /><br />\n <?php } ?>\n \n <!-- prevent auto save in browser-->\n <div style=\"display:none\">\n <input type=\"text\" name=\"cardinfo\" id=\"txtUserName\" value=\"0000 0000 0000 0000\"/>\n\t<input type=\"text\" name=\"txtPass\" id=\"txtPass\" value=\"9999999999\"/>\n </div>\n \n \n <input type=\"submit\" class=\"sbmt\" value=\"Pay Now\" onclick=\"set_type();\" /><br />\n <strong>Don't want to pay right now?</strong> <a href=\"<?php echo site_url(); ?>/parent-search\">Continue browsing</a><br />\n <strong>Questions?</strong> <a href=\"<?php echo site_url(); ?>/contact-us\">Contact us</a>\n <script>document.addEventListener('contextmenu', event => event.preventDefault());\n payment.setAttribute( \"autocomplete\", \"off\" ); payment.code.setAttribute( \"autocomplete\", \"off\" );\n\thideFrm(); //hide form and show success massage\n </script>\n</form><br />\n<script>\nhideFrm(); //hide form and show success massage\n</script>\n <?php\n\t} else {\n\t\twp_redirect('login');\n\t\t}\n}", "function setCodcvv($codcvv)\n {\n $this->codcvv = $codcvv;\n }", "public function invoice($id = '')\r\n {\r\n if (!has_permission('invoices', '', 'view') && !has_permission('invoices', '', 'view_own')) {\r\n access_denied('invoices');\r\n }\r\n if ($this->input->post()) {\r\n $invoice_data = $this->input->post(NULL, FALSE);\r\n if ($id == '') {\r\n if (!has_permission('invoices', '', 'create')) {\r\n access_denied('invoices');\r\n }\r\n $id = $this->invoices_model->add($invoice_data);\r\n if ($id) {\r\n set_alert('success', _l('added_successfuly', _l('invoice')));\r\n redirect(admin_url('invoices/list_invoices/' . $id));\r\n }\r\n } else {\r\n if (!has_permission('invoices', '', 'edit')) {\r\n access_denied('invoices');\r\n }\r\n $success = $this->invoices_model->update($invoice_data, $id);\r\n if ($success) {\r\n set_alert('success', _l('updated_successfuly', _l('invoice')));\r\n }\r\n redirect(admin_url('invoices/list_invoices/' . $id));\r\n }\r\n }\r\n if ($id == '') {\r\n $title = _l('create_new_invoice');\r\n $data['billable_tasks'] = array();\r\n } else {\r\n $invoice = $this->invoices_model->get($id);\r\n\r\n if (!$invoice || (!has_permission('invoices', '', 'view') && $invoice->addedfrom != get_staff_user_id())) {\r\n blank_page(_l('invoice_not_found'), 'danger');\r\n }\r\n\r\n $data['invoices_to_merge'] = $this->invoices_model->check_for_merge_invoice($invoice->clientid, $invoice->id);\r\n $data['expenses_to_bill'] = $this->invoices_model->get_expenses_to_bill($invoice->clientid);\r\n $data['invoice_recurring_invoices'] = $this->invoices_model->get_invoice_recuring_invoices($id);\r\n\r\n $data['invoice'] = $invoice;\r\n $data['edit'] = true;\r\n $data['billable_tasks'] = $this->tasks_model->get_billable_tasks($invoice->clientid);\r\n $title = _l('edit', _l('invoice_lowercase')) . ' - ' . format_invoice_number($invoice->id);\r\n }\r\n if ($this->input->get('customer_id')) {\r\n $data['customer_id'] = $this->input->get('customer_id');\r\n $data['do_not_auto_toggle'] = true;\r\n }\r\n\r\n $this->load->model('payment_modes_model');\r\n $data['payment_modes'] = $this->payment_modes_model->get('', array(\r\n 'expenses_only !=' => 1\r\n ));\r\n $this->load->model('taxes_model');\r\n $data['taxes'] = $this->taxes_model->get();\r\n $this->load->model('invoice_items_model');\r\n $data['items'] = $this->invoice_items_model->get_grouped();\r\n $data['items_groups'] = $this->invoice_items_model->get_groups();\r\n\r\n $this->load->model('currencies_model');\r\n $data['currencies'] = $this->currencies_model->get();\r\n\r\n $where_clients = 'tblclients.active=1';\r\n\r\n if (!has_permission('customers', '', 'view')) {\r\n $where_clients .= ' AND tblclients.userid IN (SELECT customer_id FROM tblcustomeradmins WHERE staff_id=' . get_staff_user_id() . ')';\r\n }\r\n\r\n $data['clients'] = $this->clients_model->get('', $where_clients);\r\n if ($id != '') {\r\n if (total_rows('tblclients', array(\r\n 'active' => 0,\r\n 'userid' => $data['invoice']->clientid\r\n )) > 0 || (total_rows('tblcustomeradmins', array(\r\n 'staff_id' => get_staff_user_id(),\r\n 'customer_id' => $data['invoice']->clientid\r\n )) == 0 && !has_permission('customers', '', 'view'))) {\r\n $data['clients'][] = $this->clients_model->get($data['invoice']->clientid, array(), 'row_array');\r\n }\r\n }\r\n\r\n $data['projects'] = array();\r\n if ($id != '' || isset($data['customer_id'])) {\r\n\r\n $where = '';\r\n $where_customer_id = (isset($data['customer_id']) ? $data['customer_id'] : $invoice->clientid);\r\n $where .= 'clientid=' . $where_customer_id;\r\n\r\n if (!has_permission('projects', '', 'view')) {\r\n $where .= ' AND id IN (SELECT project_id FROM tblprojectmembers WHERE staff_id=' . get_staff_user_id() . ')';\r\n }\r\n\r\n $data['projects'] = $this->projects_model->get('', $where);\r\n\r\n if ($id != '' && $data['invoice']->project_id != 0) {\r\n if (total_rows('tblprojectmembers', array(\r\n 'staff_id' => get_staff_user_id(),\r\n 'project_id' => $data['invoice']->project_id\r\n )) == 0 && !has_permission('projects', '', 'view')) {\r\n $this->db->where('id', $data['invoice']->project_id);\r\n $data['projects'][] = $this->db->get('tblprojects')->row_array();\r\n }\r\n }\r\n }\r\n\r\n $data['staff'] = $this->staff_model->get('', 1);\r\n $data['title'] = $title;\r\n $data['bodyclass'] = 'invoice';\r\n $data['accounting_assets'] = true;\r\n $this->load->view('admin/invoices/invoice', $data);\r\n }", "function recharge_from_wallet_with_card(){\n\t\t\t$coupon_id=$_REQUEST['coupon_id'];\n\t\t\t$coupon_amount=$_REQUEST['coupon_amount'];\n\t\t\t$recharge_user_id = $_REQUEST['recharge_user_id'];\n\t\t\t$card_no=$_REQUEST['card_number'];\n\t\t\t$cvv_no=$_REQUEST['cvv_no'];\n\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t//$recharge_transaction_id=$_POST['recharge_transaction_id'];\n\t\t\t$recharge_category_id = $_REQUEST['recharge_category_id']; //1- Mobile,2-DTH\n\t\t\t$operator_id = $_REQUEST['operator_id'];\n\t\t\t$rec_number=$_REQUEST['recharge_number'];\n\t\t\t$recharge_number = country_code.$_REQUEST['recharge_number'];\n\t\t\t$recharge_amount = $_REQUEST['recharge_amount'];\n\t\t\t$wallet_type = 2; // 1- Credit, 2-Debit\n\t\t\t$recharge_status = 1;\n\t\t\t$wt_category='2';// 1-Add money,2-Recharge\n\t\t\t$wallet_category='4'; // 4- Cashback\n\t\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\t\t\tif(!empty($recharge_user_id) && !empty($operator_id)&& !empty($recharge_number)&& !empty($recharge_amount))\n\t\t{\n\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $recharge_user_id);\n\t\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t\t$wallet_used_amount = $records['0']['wallet_amount'];\n\t\t\t\t$reffer_status = $records['0']['reffer_amount_status'];\n\t\t\t\t$reffer_user_id = $records['0']['reffer_user_id'];\n\t\t\t\t$card_deduct_amount=$recharge_amount-$wallet_amount;\n\t\t\t\t\n\t\t\t\t$admin=$this->conn->get_all_records('admin');\n\t\t\t\t$admin_wallet = $admin['0']['admin_wallet'];\n\t\t\n\t\t\t$recharge = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,user_wallet_rec_amount,user_card_card_rec_amount', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $recharge_amount . '\",\"' . $wt_category . '\",\"' .$transaction_id . '\",\"' . $wt_desc . '\",\"' .$wallet_amount . '\",\"' . $card_deduct_amount . '\"');\n\t\t\t\t\t\t\n\t\t\t\tif($recharge){\n\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('recharge','recharge_transaction_id,recharge_user_id, rechage_category,operator_id,rechage_type,recharge_number,recharge_amount,recharge_date,recharge_status','\"'.$transaction_id . '\",\"' . $recharge_user_id . '\",\"' . $recharge_category_id . '\",\"' . $operator_id . '\",\"' . $recharge_type_id . '\",\"' . $recharge_number . '\",\"' . $recharge_amount . '\",\"' . $current_date . '\",\"' . $recharge_status . '\"');\n\t\t\t\t\t\n\t\t\t\t\t\t\t//reffer amount when user first recharge then beifits add in frnd wallet\n\t\t\t\t\tif($reffer_status=='2'){\n\t\t\t\t\t\t$frnd_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $reffer_user_id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t\t\t\t\t\t\t$user11_id = $frnd_records['0']['user_id'];\n\t\t\t\t\t\t\t\t\t\t$reffer_code_database = $frnd_records['0']['user_refferal_code'];\n\t\t\t\t\t\t\t\t\t\t\t$wallet = $frnd_records['0']['wallet_amount'];\n\t\t\t\t\t\t\t\t\t\t\t$frnd_number = $frnd_records['0']['user_contact_no'];\n\t\t\t\t\t\t\t\t\t\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\t\t\t\t\t\t\t\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t\t\t\t$wt_type=2; // credit in frnd acconnt\n\t\t\t\t\t\t\t\t\t\t\t$refferamount=$refferal_amount; // reffer amount\n\t\t\t\t\t\t\t\t\t\t\t$wt_category=9; // refferal amount recieved in wallet\n\t\t\t\t\t\t\t\t\t\t\t$wt_desc=\"Refferal amount add in your wallet using by \".substr($mobile,4);\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$add_reffer_money = $this -> conn -> insertnewrecords('refferal_records','refferal_user_id,refferal_frnd_id,refferal_amount,refferal_date', '\"' . $recharge_user_id . '\",\"' . $user11_id . '\",\"' . $refferamount . '\",\"' . $current_date . '\"');\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user11_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $refferamount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $frnd_number . '\"');\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// modify wallet of frnd using reffer code///\n\t\t\t\t\t\t$data_frnd['wallet_amount']=$wallet+$refferal_amount;\n\t\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user11_id, $data_frnd);\n\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// Cahnge user status when refeer amount add in frnd wallet\n\t\t\t\t\t\t\t\t\t\t\t$data12['reffer_amount_status']=1;\n\t\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$recharge_user_id, $data12);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$cashback_record_id=$recharge_number;\n\t\t\t\tif(!empty($coupon_id)){\n\t\t\t\t\t\n\t\t\t\t\t$coupon_apply = $this -> conn -> insertnewrecords('coupon_details','coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $recharge_user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\t\tif(!empty($coupon_apply)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $coupon_amount . '\",\"' . $wallet_category . '\",\"' .$transaction_id . '\",\"' . $w_desc . '\",\"' . $cashback_record_id . '\"');\n\t\t\t\t\t\n\t\t\t\t\t// wallet amont set zero \n\t\t\t\t\t$wallet_amount=0;\t\t\n\t\t\t\t\t$user_wallet=$wallet_amount+$coupon_amount;\n\t\t\t\t\t$data['wallet_amount']=$user_wallet;\n\t\t\t\t\t\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$recharge_user_id, $data);\n\t\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$wallet_amount=0;\t\t\n\t\t\t\t\t$user_wallet=$wallet_amount+$coupon_amount;\n\t\t\t\t\t$data['wallet_amount']=$user_wallet;\n\t\t\t\t\t\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$recharge_user_id, $data);\n\t\t\t\t}\n\t\t\t\t\t// Admin wallet update\n\t\t\t\t\t$admin_update_wallet=$admin_wallet+$recharge_amount;\n\t\t\t\t\t$data_admin['admin_wallet']=$admin_update_wallet;\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('admin', 'admin_id',1, $data_admin);\n\t\t\t\t\t$post = array(\"status\" => \"true\",'message'=>\"Recharge Successfully\", \"recharge_id\" => $recharge,'recharge_number'=>$rec_number,'recharge_amount'=>$recharge_amount,'wallet_used_amount'=>$wallet_used_amount,'card_used_amount'=>$card_deduct_amount,'wallet_amount'=>$wallet_amount,'recharge_date'=>$current_date,'transaction_id'=>$transaction_id);\n\t\t\t\t}else{\n\t\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Recharge failed\");\n\t\t\t\t}\n\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"Missing parameter\",'recharge_user_id'=>$recharge_user_id,'recharge_category_id'=>$recharge_category_id,'operator_id'=>$operator_id,'recharge_type_id'=>$recharge_type_id,'recharge_number'=>$recharge_number,'recharge_amount'=>$recharge_amount);\n\t\t}\n\t\techo $this -> json($post);\n\t\t\t\n\t\t\t\n\t\t\t\n}", "public function edit(Invoice $invoice)\n\t{\n\t\t// Database Queries\n\t\t$contracts = Contract::with(['tenant', 'asset'])->notEnded()->get();\n\n\t\t// Config/Constants.php 'Queries'\n\t\t// Changes need to be made in the constants.php file AND on the DB\n\t\t$statuses = Config::get('constants.statuses');\n\t\t$priorities = Config::get('constants.priorities');\n\n\t\treturn view('invoices.edit', compact('invoice', 'contracts', 'statuses', 'priorities'));\n\t}", "public function accountantApproved( $id );" ]
[ "0.65179265", "0.59493154", "0.5614886", "0.54753965", "0.5434809", "0.5278258", "0.52728987", "0.51560026", "0.5145161", "0.51052094", "0.5090813", "0.50867015", "0.5053317", "0.50228125", "0.50062656", "0.5004653", "0.49184623", "0.49109846", "0.48649925", "0.4858687", "0.4853912", "0.48308423", "0.48275214", "0.48268926", "0.4821502", "0.48191634", "0.48094845", "0.4775388", "0.47665846", "0.47655717", "0.47600263", "0.47466508", "0.47396454", "0.47327805", "0.472107", "0.4714497", "0.4704913", "0.47022527", "0.4694362", "0.4694362", "0.46794194", "0.46729422", "0.4647393", "0.46400213", "0.4628054", "0.46251556", "0.46075112", "0.46052858", "0.45967945", "0.45908895", "0.45900962", "0.45729578", "0.45710292", "0.45683324", "0.4560161", "0.45525396", "0.45453689", "0.45398194", "0.45377985", "0.4536696", "0.45169523", "0.45165035", "0.45162892", "0.45158252", "0.45149973", "0.45086533", "0.45063567", "0.45063186", "0.4505722", "0.44988546", "0.44976288", "0.44965386", "0.4494934", "0.44894662", "0.44821897", "0.4476232", "0.44754687", "0.44744062", "0.44570476", "0.44523472", "0.44517666", "0.445064", "0.44476795", "0.44316143", "0.44304588", "0.44260627", "0.44251394", "0.4424521", "0.442326", "0.4422398", "0.44218627", "0.44165084", "0.44151962", "0.44122186", "0.43961325", "0.43960914", "0.4395524", "0.43921155", "0.43918028", "0.43916127" ]
0.51491773
8
This command is used to add a new billable item to the system. Parameters: clientid the User ID to assign the charge to description the description to be shown to a customer when invoiced hours number of hours/quantity (not required for single quantities) amount the total amount to invoice for invoiceaction noinvoice, nextcron, nextinvoice, duedate, recur Optional Parameters: duedate date the invoice should be due (only required for duedate & recur invoice actions) recur frequency to recur 1,2,3,etc... recurcycle Days, Weeks, Months or Years recurfor number of times to repeat See:
public function whmcs_add_billable_item($params = array()) { $params['action'] = 'AddBillableItem'; // return Whmcs_base::send_request($params); $load = new Whmcs_base(); return $load->send_request($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_item()\n {\n $request = new Types\\AddItemRequestType();\n\n // An user token is required when using the Trading service.\n $request->RequesterCredentials = new Types\\CustomSecurityHeaderType();\n $request->RequesterCredentials->eBayAuthToken = $this->config->item('authToken');\n\n\n // Begin creating the auction item.\n $item = new Types\\ItemType();\n\n $item->DispatchTimeMax = 3;\n /**\n * We want a single quantity auction.\n * Otherwise known as a Chinese auction.\n */\n $item->ListingType = Enums\\ListingTypeCodeType::C_CHINESE;\n $item->Quantity = 1;\n\n $item->ProductListingDetails = new Types\\ProductListingDetailsType();\n $item->ProductListingDetails->ISBN = $ISBN;\n $item->ProductListingDetails->UPC = $UPC;\n $item->ProductListingDetails->EAN = $EAN;\n\n $item->ProductListingDetails->BrandMPN = new DTS\\eBaySDK\\Trading\\Types\\BrandMPNType();\n $item->ProductListingDetails->BrandMPN->Brand = '';\n $item->ProductListingDetails->BrandMPN->MPN = '';\n\n $item->ListingDuration = Enums\\ListingDurationCodeType::C_DAYS_7;\n\n }", "public function addItem($invoice_id) {\n\t\t$quantity = Request::input('quantity');\n\t\t$item_id = Request::input('item_id');\n\n\t\t$initSelect = DB::select('SELECT * \n\t\t\tFROM invoice_item\n\t\t\tWHERE item_id = :item_id\n\t\t\tAND invoice_id = :invoice_id',\n\t\t\tarray(\n\t\t\t\t':item_id' => $item_id,\n\t\t\t\t':invoice_id' => $invoice_id));\n\n\t\tif ($initSelect) {\n\t\t\t$previousQTY = $initSelect[0]->quantity;\n\t\t\t$sql = DB::update( \"UPDATE invoice_item \n\t\t\t\t\tSET quantity= :quantity\n\t\t\t\t\tWHERE item_id = :item_id\n\t\t\t\t\tAND invoice_id = :invoice_id\",\n\t\t\t\tarray(\n\t\t\t\t\t':item_id' => $item_id,\n\t\t\t\t\t':invoice_id' => $invoice_id,\n\t\t\t\t\t':quantity' => ($quantity + $previousQTY)));\n\t\t} else {\n\t\t\techo 'insert new . . . . ';\n\t\t\t$sql = DB::insert(\n\t\t\t\t\t'INSERT INTO invoice_item ( `invoice_id`, `item_id`, `quantity`) \n\t\t\t\t\tVALUES ( :invoice_id, :item_id, :quantity)',\n\t\t\t\tarray(\n\t\t\t\t\t':invoice_id' => $invoice_id,\n\t\t\t\t\t':item_id' => $item_id,\n\t\t\t\t\t':quantity' => $quantity));\n\t\t}\n\n\t\treturn redirect('invoices/details/' . $invoice_id);\n\t}", "public function add_item($boat_id, $item, $type) {\n $data = array(\n 'BOAT_ID' => $boat_id,\n 'CL_DES' => $item,\n 'TYPE' => $type,\n 'CHECKED' => false\n );\n $this->db->insert('CL', $data);\n }", "public function createNewItem();", "function add_invoice_items($params){\n return $this->company_db->insert_batch('tbl_invoice_item', $params);\n }", "public function createItem (Item $item) {\n $this->itemsDB->create($item);\n $item->setId($this->retrieveLastItemId());\n }", "public function additem()\r\n {\r\n $shipping = array( 'ShippingServiceOptions' => array(\r\n\r\n 'ShippingService' => 'UPSGround',\r\n 'ShippingServiceCost' => 0.0,\r\n 'ShippingServiceAdditionalCost' => 0.0,\r\n 'ShippingServicePriority' => 1,\r\n 'ExpeditedService' => false,\r\n\r\n\r\n ),\r\n 'ShippingType' => 'Flat',\r\n );\r\n\r\n $returnPolicy = array(\r\n 'ReturnsAcceptedOption' => 'ReturnsAccepted',\r\n 'RefundOption' => 'MoneyBack',\r\n 'ReturnsWithinOption' => 'Days_30',\r\n 'Description ' =>'If you are not satisfied, return the item for refund.',\r\n 'ShippingCostPaidByOption' => 'Buyer',\r\n );\r\n\r\n $item = array(\r\n 'PrimaryCategory' => array('CategoryID' => 111422), // ok\r\n 'Title' => 'Miechu nowy',\r\n 'Description' => 'Testowy opis',\r\n 'StartPrice' => 100, //\r\n 'BuyItNowPrice' => 500,//\r\n 'ReservePrice' => 400,//\r\n 'Country' => 'US',//\r\n 'Currency' => 'USD',//\r\n 'ListingDuration' => 'Days_7',//\r\n 'PictureDetails' => 'dummy',//\r\n 'Site' => 'US',//\r\n 'Location' => 'San Jose',//\r\n 'PaymentMethods' => 'PayPal',//\r\n 'PayPalEmailAddress' => '[email protected]',//\r\n 'ShippingDetails' => $shipping,//\r\n 'DispatchTimeMax' => 3,//\r\n 'ConditionID' => 1000,//\r\n 'ReturnPolicy' => $returnPolicy,//\r\n\r\n );\r\n\r\n $params = array(\r\n 'Version' => 831,\r\n 'Item' => $item\r\n\r\n\r\n\r\n\r\n\r\n );\r\n $method = 'addItem';\r\n\r\n try{\r\n\r\n $resp = debay::sendRequest($method,$params);\r\n\r\n $this->load->model('ebay/debay');\r\n\r\n\r\n }\r\n catch(Exception $e)\r\n {\r\n echo $e->getMessage();\r\n }\r\n }", "public function _add()\n {\n $type_code = post_param_string('type_code');\n $object = find_product($type_code);\n\n $amount = post_param_string('amount', '');\n if ($amount == '') {\n $products = $object->get_products(false, $type_code);\n $amount = $products[$type_code][1];\n if ($amount == '?') {\n warn_exit(do_lang_tempcode('INVOICE_REQUIRED_AMOUNT'));\n }\n }\n\n $to = post_param_string('to');\n $member_id = $GLOBALS['FORUM_DRIVER']->get_member_from_username($to);\n if (is_null($member_id)) {\n warn_exit(do_lang_tempcode('_MEMBER_NO_EXIST', escape_html($to)));\n }\n\n $id = $GLOBALS['SITE_DB']->query_insert('invoices', array(\n 'i_type_code' => $type_code,\n 'i_member_id' => $member_id,\n 'i_state' => 'new',\n 'i_amount' => $amount,\n 'i_special' => post_param_string('special'),\n 'i_time' => time(),\n 'i_note' => post_param_string('note')\n ), true);\n\n log_it('CREATE_INVOICE', strval($id), $type_code);\n\n send_invoice_notification($member_id, $id);\n\n $url = build_url(array('page' => '_SELF', 'type' => 'outstanding'), '_SELF');\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }", "public function action_create_item($id = NULL)\n {\n if ($id === NULL)\n {\n $id = $this->request->param('id');\n }\n\n $this->action_edit_item(FALSE, $id);\n }", "function add()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tlogout_invalid_user($this);\n\t\t\n\t\t# user has posted the new bid information\n\t\tif(!empty($_POST)){\n\t\t\t# Upload the file before you proceed with the rest of the process\n\t\t\t$fileUrls = upload_many_files($_FILES, 'document__fileurl', 'document_', 'pdf,doc,docx');\n\t\t\t$_POST['documents'] = !empty($fileUrls)? $fileUrls: array();\n\t\t\t$result = $this->_bid->add($_POST);\n\t\t\t\n\t\t\tif(!$result['boolean']) echo \"ERROR: The bid could not be added. \".$result['reason'];\n\t\t}\n\t\t# just coming to the form\n\t\telse {\n\t\t\t# if the tender notice id is provided\n\t\t\tif(!empty($data['t'])){\n\t\t\t\t$this->load->model('_tender');\n\t\t\t\t$data['tender'] = $this->_tender->details($data['t']);\n\t\t\t}\n\t\t\tif(!empty($data['d'])) $data['bid'] = $this->_bid->details(array('bid_id'=>$data['d']));\n\t\t\telse if(!empty($data['t'])) $data['bid'] = $this->_bid->details(array('tender_id'=>$data['t']));\n\t\t\t\n\t\t\t$this->load->view('bids/new_bid', $data);\n\t\t}\n\t}", "public function invoiceitem_create( $customer_id, $amount, $desc ) {\r\n\t\t$params = array(\r\n\t\t\t'customer' => $customer_id,\r\n\t\t\t'amount' => $amount,\r\n\t\t\t'currency' => 'usd',\r\n\t\t\t'description' => $desc\r\n\t\t);\r\n\t\t\r\n\t\treturn $this->_send_request( 'invoiceitems', $params, STRIPE_METHOD_POST );\r\n\t}", "public function addItem($item_id, $item_type) {\n $this->apiCall('items.json', 'POST', array('pio_iid' => $item_id, 'pio_itypes' => $item_type));\n }", "public function createItem( $preparedItem ) {\n\t}", "public function addItem(tx_ptgsashop_orderWrapper $itemObj, $id=0) {\n \n parent::addItem($itemObj, $id);\n \n }", "public function add_bill_item($action, $bill_id, $particular, $qnt = NULL, $amt = NULL, $mrp = NULL, $item_id = NULL, $tax_amount = NULL,$tax_id = NULL) {\r\n\r\n\t\t$data['bill_id'] = $bill_id;\r\n\r\n\t\t$data['particular'] = $particular;\r\n\r\n\t\t$data['quantity'] = $qnt;\r\n\r\n\t\t$data['amount'] = $amt;\r\n\r\n\t\t$data['mrp'] = $mrp;\r\n\r\n\t\t$data['type'] = $action;\r\n\r\n\t\t$data['item_id'] = $item_id;\r\n\r\n\t\t$data['clinic_code'] = $this->session->userdata('clinic_code');\r\n\r\n\t\t$data['tax_amount'] = $tax_amount;\r\n\r\n\t\t$data['tax_id'] = $tax_id;\r\n\r\n\r\n\r\n\t\tif ($item_id != NULL){\r\n\r\n\t\t\t$query = $this->db->get_where('bill_detail', array('bill_id ' => $bill_id, 'item_id ' => $item_id));\r\n\r\n\t\t\tif ($query->num_rows() > 0){\r\n\r\n\t\t\t\t$bill_detail = $query->row_array();\r\n\r\n\t\t\t\t$data['quantity'] = $qnt + $bill_detail['quantity'];\r\n\r\n\t\t\t\t$data['amount'] = $amt + $bill_detail['amount'];\r\n\r\n\t\t\t\t$data['sync_status'] = 0;\r\n\r\n\t\t\t\t$this->db->update('bill_detail', $data,array('bill_id ' => $bill_id, 'item_id ' => $item_id));\r\n\r\n\t\t\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t$this->db->insert('bill_detail', $data);\r\n\r\n\t\t\t\t$bill_detail_id = $this->db->insert_id();\r\n\r\n\t\t\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$this->db->insert('bill_detail', $data);\r\n\r\n\t\t\t$bill_detail_id = $this->db->insert_id();\r\n\r\n\t\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\t\t}\r\n\r\n\t\tif($action == \"tax\"){\r\n\r\n\t\t\t$total_amount = 0;\r\n\r\n\t\t\t$tax_amount = $amt;\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$total_amount = $amt;\r\n\r\n\t\t}\r\n\r\n\r\n\r\n $sql = \"update \" . $this->db->dbprefix('bill') . \" set sync_status = 0,total_amount = total_amount + ? where bill_id = ?;\";\r\n\r\n $this->db->query($sql, array($total_amount, $bill_id));\r\n\r\n\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\r\n\r\n\t\t$total_tax_amount=$tax_amount;\r\n\r\n\t\t$sql = \"update \" . $this->db->dbprefix('bill') . \" set sync_status = 0,tax_amount = tax_amount + ? where bill_id = ?;\";\r\n\r\n $this->db->query($sql, array($total_tax_amount, $bill_id));\r\n\r\n\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\r\n\t\t//Due Amount \r\n\t\t/*$due_amount = $total_amount + $tax_amount;\r\n\r\n\t\t$sql = \"update \" . $this->db->dbprefix('bill') . \" set sync_status = 0,due_amount = due_amount + ? where bill_id = ?;\";\r\n\r\n $this->db->query($sql, array($due_amount, $bill_id));\r\n\r\n\t\t//echo $this->db->last_query().\"<br/>\";*/\r\n\t\treturn $bill_detail_id;\r\n\r\n }", "public static function addItem($conn, $sku, $title, $price, $quantity=\"1\", $taxable=\"0\", $tangible=\"0\", $available=\"0\", $listed=\"0\", $description=\"\", $notes =\"\")\n\t{\n\t\t// add the item entry\n\t\t$st = <<<sql\n\t\t\tinsert into Items (sku, title, price, quantity, taxable, tangible, available, listed, description, notes)\n\t\t\tvalues (:sku, :title, :price, :quantity, :taxable, :tangible, :available, :listed, :description, :notes);\n\t\tsql;\n\t\t\n\t\t// start transaction\n\t\t$conn->beginTransaction();\n\t\t\n\t\t$q = $conn->prepare($st);\n\t\t$q->execute([\n\t\t\t':sku' => $sku,\n\t\t\t':title' => $title,\n\t\t\t':price' => $price,\n\t\t\t':quantity' => $quantity,\n\t\t\t':taxable' => $taxable,\n\t\t\t':tangible' => $tangible,\n\t\t\t':available' => $available,\n\t\t\t':listed' => $listed,\n\t\t\t':description' => $description,\n\t\t\t':notes' => $notes,\n\t\t\t]);\n\t\t\n\t\t// get last ID entered and commit\n\t\t$id = $conn->query(\"select last_insert_id() as id from items\");\n\t\t$output = ($id->fetch())['id'];\n\t\t//die();\n\t\t$conn->commit();\n\t\t\n\t\treturn (int)$output;\n\t}", "public function addBid($itemid, $buserid, $bidamount)\n {\n $itemid = mysql_real_escape_string( $itemid);\n $buserid = mysql_real_escape_string( $buserid);\n $biddate = date('Y-m-d');\n $bidtime = time('H:i:s');\n $bidamount = mysql_real_escape_string($bidamount);\n $sql=\"INSERT INTO bid VALUES( $itemid, $buserid,$biddate, $bidtime, $bidamount)\";\n $result=mysql_query($sql);\n return $result;\n \n }", "public function add($item, $id = null);", "abstract public function add_item();", "public function _create($refid, $invoice, $charges=array(), $payments=array())\n {\n\n return false;\n\n\n if($res = $this->is_billtrac_exists($invoice->InvoiceNumber_EMD))\n {\n //already created\n $this->error(\"billtrac ticket # $res already exists for EMD invoice # \" . $invoice->InvoiceNumber_EMD);\n\n //update so\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n DB::table($this->keytable)->where('emd_invoice_number',$invoice->InvoiceNumber_EMD)->update(array( 'todo'=>'done','ext_key'=>$res));\n }\n\n return false;\n }\n\n /**\n * inserting\n * - summary\n * - carrier\n * - emdId\n * - type\n * - claim\n * - location\n * - mail date\n * - bill amount\n * - ptrac id\n */\n\n\n try{\n\n\n $time = $changetime = time() * 1000000;\n\n DB::connection('billtrac')->getPdo()->beginTransaction();\n\n //create base ticket\n $invoice->Invoice_Comment = trim($invoice->Invoice_Comment);\n\n if(empty($invoice->Invoice_Comment))\n {\n $type = 'new';\n }\n else\n {\n $type = addslashes($invoice->Invoice_Comment);\n }\n\n $dos_first=false;\n $dos = array();\n\n if($cpts = DB::connection('emds')->table('VIEW_API_InvoiceCPT')->where('Invoice_ID', $invoice->Invoice_ID)->get())\n {\n foreach($cpts as $line)\n {\n if(!$dos_first)\n {\n $dos_first = $line->sdos;\n }\n $dos[$line->sdos] = 1;\n }\n $dos = 'DOS: ' . implode(', ', array_keys($dos));\n\n }\n\n $data = array(\n 'type'=>$type,\n 'time'=>$time,\n 'changetime'=>$changetime,\n 'priority'=>'normal',\n 'status'=>'new',\n 'summary'=>addslashes($invoice->PatientName),\n 'reporter'=>'emdimport',\n 'description'=>$dos,\n 'owner'=> $this->assign_ownerbyalpha(strtolower(substr($invoice->PatientName,0,1)))\n );\n\n if($owner = $this->assign_ownerbyinsurance(strtolower($invoice->InsuranceCompName)))\n {\n $data['owner'] = $owner;\n }\n\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n DB::connection('billtrac')->table('ticket')->insert( $data );\n }\n else\n {\n $this->info(\"dry insert: \\n\" . print_r($data, true));\n }\n\n $id = DB::connection('billtrac')->getPdo()->lastInsertId();\n\n $this->info(\"created ticket number $id\");\n\n $emdimage = false;\n\n $respmt = DB::connection('emds')->select(\"select * from VIEW_API_PaymentIndex where Invoice_ID = '\" . $invoice->Invoice_ID . \"'AND (CheckImage <> '0000000000' or EOBImage <> '0000000000')\");\n\n foreach($respmt as $r)\n {\n $emdimage = true;\n }\n\n $importMap = array(\n 'billdate'=>$invoice->InvoiceCreatedAt,\n 'emdstatus'=>$invoice->InvoiceStatus_Code,\n 'maildate'=>$invoice->InvoiceCreatedAt,\n 'dosdate'=>$dos_first,\n 'billamount'=>number_format($invoice->InvoiceTotal,2),\n 'duedate'=>date_create_from_format('m-d-Y', $invoice->InvoiceCreatedAt)->modify('+17 day')->format('m-d-Y'),\n 'paidamount'=>number_format($invoice->PaymentTotal,2),\n 'location'=>$this->translateLocation($invoice->Organization_Name),\n 'carrier'=>addslashes($invoice->InsuranceCompName),\n 'claimnumber'=>$invoice->Case_ClaimNumber,\n 'step'=>'new',\n 'emdinvoicenumber'=>$invoice->InvoiceNumber_EMD,\n 'ptracnumber'=>'EMD:'.$invoice->InvoiceNumber_EMD\n );\n\n if($emdimage)\n {\n $importMap['emdimage'] = 1;\n }\n\n foreach($importMap as $key=>$value)\n {\n $data = array(\n 'ticket'=>$id,\n 'name'=>$key,\n 'value'=>$value\n );\n\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n DB::connection('billtrac')->table('ticket_custom')->insert( $data );\n }\n else\n {\n $this->info(\"dry insert: \\n\" . print_r($data, true));\n }\n }\n\n DB::connection('billtrac')->getPdo()->commit();\n\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n return DB::table($this->keytable)->where('id',$refid)->update(array( 'todo'=>'done', 'ext_key'=>$id));\n }\n else\n {\n return false;\n }\n\n }catch (Exception $e)\n {\n DB::connection('billtrac')->getPdo()->rollBack();\n throw new Exception($e->getMessage());\n }\n }", "public function createBudget($user_id, $name) {\n\t\t$budget = new Budget();\n\t\t$dbh = Database::getPdo();\n\t\t\ttry {\n\t\t\t\t$created = date(\"Y-m-d H:i:s\");\n\t\t\t\t$sql = \"INSERT INTO \" . self::DB_TABLE . \" (user_id, name, created) VALUES (:user_id, :name, :created)\";\n\t\t\t\t$stmt = $dbh->prepare($sql);\n\t\t\t\t$stmt->bindParam(':user_id', $user_id, PDO::PARAM_INT);\n\t\t\t\t$stmt->bindParam(':name', $name, PDO::PARAM_STR,45);\n\t\t\t\t$stmt->bindParam(':created', $created);\n\t\t\t\t$stmt->execute();\n\t\t\t\t$return = $stmt->rowCount();\n\t\t\t\tif ($return == 1) {\n\t\t\t\t\theader('Location:/dashboard');\n\t\t\t\t} elseif ($return != 1) {\n\t\t\t\t\techo 'Could not create budget.';\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (PDOException $e) {\n\t\t\t\techo 'Unable to create budget: ' . $e->getMessage();\n\t\t\t}\n\t\t}", "public function addNonCombatItem() {\n\t\t\t// Declare classes\n\t\t\t$RepItem\t\t\t= new RepItem();\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t\t= false;\n\t\t\t$id_type\t\t\t= (isset($_POST['id_type'])) ? trim($_POST['id_type']) : false;\n\t\t\t$int_level\t\t\t= (isset($_POST['int_level'])) ? trim($_POST['int_level']) : false;\n\t\t\t$int_bonus_start\t= (isset($_POST['int_bonus_start'])) ? trim($_POST['int_bonus_start']) : false;\n\t\t\t$int_bonus_end\t\t= (isset($_POST['int_bonus_end'])) ? trim($_POST['int_bonus_end']) : false;\n\t\t\t$vc_name\t\t\t= (isset($_POST['vc_name'])) ? trim($_POST['vc_name']) : false;\n\t\t\t// If values were sent\n\t\t\tif (($id_type !== false) && ($int_level !== false) && ($int_bonus_start !== false) && ($int_bonus_end !== false) && ($vc_name !== false)) {\n\t\t\t\t// Save Item and prepare return\n\t\t\t\t$return\t= ($RepItem->insertNonCombatItem($id_type, $int_level, $int_bonus_start, $int_bonus_end, $vc_name)) ? 'ok' : false;\n\t\t\t}\n\t\t\t// Return\n\t\t\techo $return;\n \t\t}", "function add() {\n if($this->request->isAsyncCall() || ($this->request->isApiCall() && $this->request->isSubmitted()) || true) {\n if(Invoices::canAdd($this->logged_user)) {\n $default_currency = Currencies::getDefault();\n \n if(!($default_currency instanceof Currency)) {\n $this->response->notFound();\n } // if\n\n $invoice_data = $this->request->post('invoice');\n \n if(!is_array($invoice_data)) {\n $duplicate_invoice_id = $this->request->getId('duplicate_invoice_id');\n \n // Duplicate an existing invoice\n if($duplicate_invoice_id) {\n $duplicate_invoice = Invoices::findById($duplicate_invoice_id);\n if($duplicate_invoice instanceof Invoice) {\n $invoice_data = array(\n 'company_id' => $duplicate_invoice->getCompanyId(),\n 'company_address' => $duplicate_invoice->getCompanyAddress(),\n 'private_note' => $duplicate_invoice->getPrivateNote(),\n 'status' => INVOICE_STATUS_DRAFT,\n 'project_id' => $duplicate_invoice->getProjectId(),\n 'note' => $duplicate_invoice->getNote(),\n 'currency_id' => $duplicate_invoice->getCurrencyId(),\n 'payment_type' => $duplicate_invoice->getAllowPayments(),\n 'second_tax_is_compound' => $duplicate_invoice->getSecondTaxIsCompound(),\n 'language_id' => $duplicate_invoice->getLanguageId()\n );\n \n if(is_foreachable($duplicate_invoice->getItems())) {\n $invoice_data['items'] = array();\n foreach($duplicate_invoice->getItems() as $item) {\n $invoice_data['items'][] = array(\n 'description' => $item->getDescription(),\n 'unit_cost' => $item->getUnitCost(),\n 'quantity' => $item->getQuantity(),\n 'first_tax_rate_id' => $item->getFirstTaxRateId(),\n 'second_tax_rate_id' => $item->getSecondTaxRateId(),\n 'total' => $item->getTotal(),\n 'subtotal' => $item->getSubtotal(),\n );\n } // foreach\n } // if\n } // if\n } // if\n \n // Blank invoice\n if(!is_array($invoice_data)) {\n $invoice_data = array(\n 'due_on' => null,\n 'currency_id' => $default_currency->getId(),\n 'time_record_ids' => null,\n 'payment_type' => -1,\n 'second_tax_is_compound' => $this->active_invoice->getSecondTaxIsCompound()\n );\n } // if\n } // if\n\n $this->response->assign('invoice_data', $invoice_data);\n $this->response->assign(Invoices::getSettingsForInvoiceForm($this->active_invoice));\n \n if($this->request->isSubmitted()) {\n \ttry {\n \tDB::beginWork('Creating a new invoice @ ' . __CLASS__);\n\n if (!is_foreachable($invoice_data['items'])) {\n throw new Error(lang('Invoice items data is not valid. All descriptions are required and there need to be at least one unit with cost set per item!'));\n } // if\n\n \t$this->active_invoice->setAttributes($invoice_data);\n \t $this->active_invoice->setCreatedBy($this->logged_user);\n\n if ($this->active_invoice->getSecondTaxIsEnabled()) {\n $this->active_invoice->setSecondTaxIsCompound(array_var($invoice_data, 'second_tax_is_compound', false));\n } // if\n\n $this->active_invoice->setItems($invoice_data['items']);\n $this->active_invoice->setState(STATE_VISIBLE);\n $this->active_invoice->save();\n\n \t DB::commit('Invoice created @ ' . __CLASS__);\n \t \n $this->response->respondWithData($this->active_invoice, array(\n \t'as' => 'invoice', \n 'detailed' => true,\n ));\n \t \n \t} catch (Exception $e) {\n \t DB::rollback('Failed to create invoice @ ' . __CLASS__);\n \t\t$this->response->exception($e);\n \t} // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "public function addCombatItem() {\n\t\t\t// Declare classes\n\t\t\t$RepItem\t\t= new RepItem();\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t$id_field\t\t= (isset($_POST['id_field'])) ? trim($_POST['id_field']) : false;\n\t\t\t$id_type\t\t= (isset($_POST['id_type'])) ? trim($_POST['id_type']) : false;\n\t\t\t$int_level\t\t= (isset($_POST['int_level'])) ? trim($_POST['int_level']) : '0';\n\t\t\t$me_min\t\t\t= (isset($_POST['me_min'])) ? trim($_POST['me_min']) : '0';\n\t\t\t$me_max\t\t\t= (isset($_POST['me_max'])) ? trim($_POST['me_max']) : '0';\n\t\t\t$magic_me\t\t= (isset($_POST['magic_me'])) ? trim($_POST['magic_me']) : '0';\n\t\t\t$ds\t\t\t\t= (isset($_POST['ds'])) ? trim($_POST['ds']) : '0';\n\t\t\t$magic_ds\t\t= (isset($_POST['magic_ds'])) ? trim($_POST['magic_ds']) : '0';\n\t\t\t$time\t\t\t= (isset($_POST['time'])) ? trim($_POST['time']) : '0';\n\t\t\t$vc_wearable\t= (isset($_POST['vc_wearable'])) ? trim($_POST['vc_wearable']) : false;\n\t\t\t$vc_name\t\t= (isset($_POST['vc_name'])) ? trim($_POST['vc_name']) : false;\n\t\t\t// If values were sent\n\t\t\tif (($id_field) && ($id_type) && ($vc_name)) {\n\t\t\t\t// Save Item and prepare return\n\t\t\t\t$return\t= ($RepItem->insertCombatItem($id_field, $id_type, $int_level, $me_min, $me_max, $magic_me, $ds, $magic_ds, $time, $vc_wearable, $vc_name)) ? 'ok' : false;\n\t\t\t}\n\t\t\t// Return\n\t\t\techo $return;\n \t\t}", "public function addItem($item_id,$quantity=1,$price_tier_id = null,$employee_id = null,$user_id = null,$discount_amount=0,$discount_type = '%')\n {\n $models = Item::model()->getItemPriceTierWS($item_id, null);\n $trans_mode=Yii::app()->receivingCart->getMode();\n $supplier_id=Yii::app()->receivingCart->getSupplier();\n if (empty($models)) {\n $models = Item::model()->getItemPriceTierItemNumWS($item_id, null);\n\n foreach ($models as $model) {\n $item_id=$model[\"id\"];\n $item_number=$models['item_number'];\n $cost_price=$models['cost_price'];\n //$supplier_id = $models['supplier_id'];\n }\n }\n\n $cmd = Yii::app()->db->createCommand(\"select func_recv_order_add(:item_id,:item_number,:quantity,:price_tier_id,:cost_price,:supplier_id,:employee_id,:user_id,:discount_amount,:discount_type,:trans_mode) from dual\");\n\n $cmd->bindParam(':item_id' , $item_id);\n $cmd->bindParam(':item_number' ,$item_number);\n $cmd->bindParam(':quantity',$quantity);\n $cmd->bindParam(':price_tier_id',$price_tier_id);\n $cmd->bindParam(':cost_price',$cost_price);\n $cmd->bindParam(':supplier_id',$supplier_id);\n $cmd->bindParam(':employee_id',$employee_id);\n $cmd->bindParam(':user_id',$user_id);\n $cmd->bindParam(':discount_amount',$discount_amount);\n $cmd->bindParam(':discount_type',$discount_type);\n $cmd->bindParam(':trans_mode',$trans_mode);\n $results=$cmd->queryAll();\n\n foreach($results as $result)\n foreach ($result as $k=>$value)\n\n return $value;\n }", "public function addBed($item, $id){\n\n $storedItem = ['qty' => 0, 'productPrice' => $item->productPrice, 'item' => $item];\n if($this->items){\n if(array_key_exists($id, $this->items)){\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['productPrice'] = $item->productPrice * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->productPrice;\n }", "public function create($id)\n {\n $serial_num = serial_num::all();\n\n $item = item::findorfail($id);\n return view('borrow.add',compact('item','serial_num') );\n }", "public function add($item, $id){\n $storedItem = ['qty' => 0,\n 'price'=>$item->price,\n 'item' => $item]; //servirá para os grupos, para nao tar a adicionar 2 da mesma coisa\n\n if($this->items){ //verificar se ja ha items no array\n if (array_key_exists($id, $this->items)){ //verificar se ja existe o item que eu quero adicionar\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['price'] = $item->price * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->price;\n\n }", "public function contract($id = ''){\n\t\t\n\t\tif ($this->input->post('paiement')) {\n\t\t\t\n\t\t\t$medals = $this->input->post('medals_id');\n\t\t\t$method = $this->input->post('method');\n\t\t\t$date = $this->input->post('date_paid');\n\t\t\t\n\t\t\t$this->db->where('number', $medals);\n\t\t\t$this->db->set('date_paid', $date);\n\t\t\t$this->db->set('method', $method);\n\t\t\t$this->db->update('tblcontracts');\n\t\t\t//print_r($this->input->post());\n\t\t\t\n\t\t\t$this->db->where('id', 2);\n\t\t\t$item = $this->db->get('tblinvoiceitemslist')->row();\n\t\t\t\n\t\t\t$data['clientid'] = $this->input->post('clientid');\n\t\t\t$data['date'] = $date;\n\t\t\t$data['duedate'] = date('Y-m-d', strtotime(\"+30 days\"));\n\t\t\t$data['currency'] = \"2\";\n\t\t\t$data['clientnote'] = \"\";\n\t\t\t$data['adminnote'] = \"\";\n\t\t\t$data['terms'] = \"\";\n\t\t\t$data['discount_percent'] = \"0\";\n\t\t\t$data['discount_total'] = \"0\";\n\t\t\t$data['adjustment'] = \"0.00\";\n\t\t\t$data['subtotal'] = $item->rate;\n\t\t\t$data['total'] = $data['subtotal'];\n\t\t\t$data['allowed_payment_modes'] = 'a:6:{i:0;s:1:\"1\";i:1;s:1:\"2\";i:2;s:1:\"3\";i:3;s:1:\"4\";i:4;s:6:\"paypal\";i:5;s:6:\"stripe\";}';\n\t\t\t$data['discount_type'] = \"\";\n\t\t\t$data['recurring'] = \"18\";\n\t\t\t$data['number'] = $medals;\n\t\t\t$data['hash'] = md5(rand() . microtime());\n\t\t\t$data['status'] = 2;\n\t\t\t\n\t\t\t$data['newitems'] = Array ( 'item' => Array ( '2' => Array ( 'quantity' => Array ( 0 => 1 ) ) ) );\n\t\t\t\n\t\t\t$items = $data['newitems'];\n\t\t\t\n\t\t\tunset($data['newitems']);\n\t\t\t\n\t\t\t$this->db->insert('tblinvoices', $data);\n\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t$invoice_id = $insert_id;\n\t\t\tif ($insert_id) {\n\t\t\t\t$this->db->where('name', 'next_invoice_number');\n\t\t\t\t$this->db->set('value', 'value+1', FALSE);\n\t\t\t\t$this->db->update('tbloptions');\n\t\t\t\tif (count($items) > 0) {\n\t\t\t\t\tforeach ($items['item'] as $itemid => $quantity) {\n\t\t\t\t\t\t$this->db->insert('tblinvoiceitems', array(\n\t\t\t\t\t\t\t'invoiceid' => $insert_id,\n\t\t\t\t\t\t\t'itemid' => $itemid,\n\t\t\t\t\t\t\t'qty' => $quantity['quantity'][0]\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$this->db->where('number', $medals);\n $this->db->delete('tblnotused');\n\t\t\t\t\n\t\t\t\t$data_payment['invoiceid'] = $insert_id;\n\t\t\t\t$data_payment['amount'] = $data['subtotal'];\n\t\t\t\t$data_payment['paymentmode'] = 1;\n\t\t\t\t$data_payment['date'] = $date;\n\t\t\t\t$data_payment['daterecorded'] = $date;\n\t\t\t\t$data_payment['addedfrom'] = 1;\n\t\t\t\t\n\t\t\t\t$this->db->insert('tblinvoicepaymentrecords', $data_payment);\n\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\t\n\t\t\t\tif ($insert_id) {\n\t\t\t\t\t\n\t\t\t\t\t//$invoice = $this->invoices_model->get($invoice_id);\n\t\t\t\t\t//$invoice_number = format_invoice_number($invoice->number);\n\t\t\t\t\t//$pdf = invoice_pdf($invoice);\n\t\t\t //\n\t\t\t\t\t//$pdf->Output($invoice_number . '.pdf');\n\t\t\t\t\t\n\t\t\t\t\tredirect(admin_url('contracts/recherche?number='.$medals.'&openinvoice=1&invoice_id='.$invoice_id));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tif ($this->input->post('search_client')) {\n\t\t\t$this->db->like('phonenumber', $this->input->post('search_client'));\n\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\tif ($client) {\n\t\t\t\t$data = json_encode((array)$client);\n\t\t\t\techo $data;\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t$client = array('no_found'=>'no_found');\n\t\t\t\t$data = json_encode((array)$client);\n\t\t\t\techo $data;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif(!has_permission('manageContracts')){\n\t\t\taccess_denied('manageContracts');\n\t\t}\n\n\t\tif($this->input->post()){\n\t\t\t$this->load->helper('perfex_upload');\n\t\t\t\n\t\t\tif($id == ''){\n\t\t\t\t\n\t\t\t\tif (!empty($this->input->post('userid'))) {\n\t\t\t\t\t$cliendid = $this->input->post('userid');\n\t\t\t\t\n\t\t\t\t\t$this->db->where('userid', $cliendid);\n\t\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t} else {\n\t\t\t\t\t$phone = $this->input->post('phonenumber');\n\t\t\t\t\n\t\t\t\t\t$this->db->where('phonenumber', $phone);\n\t\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//print_r($client);\n\t\t\t\t\n\t\t\t\tif (empty($client)) {\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name']);\n\t\t\t\t\tunset($_POST['race']);\n\t\t\t\t\tunset($_POST['color']);\n\t\t\t\t\tunset($_POST['remarque']);\n\t\t\t\t\tunset($_POST['number']);\n\t\t\t\t\tunset($_POST['datecreated']);\n\t\t\t\t\tunset($_POST['userid']);\n\t\t\t\t\tunset($_POST['attachment']);\n\t\t\t\t\tunset($_POST['sexe']);\n\t\t\t\t\tunset($_POST['method']);\n\t\t\t\t\tunset($_POST['rfid']);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$user_id = $this->clients_model->add($_POST);\n\t\t\t\t\t$_POST['client'] = $user_id;\n\t\t\t\t} else {\n\t\t\t\t\t$_POST['client'] = $client->userid;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$medals = $this->input->post('number');\n\t\t\t\t$method = $this->input->post('method');\n\t\t\t\t$date = date('Y-m-d');\n\t\t\t\t\n\t\t\t\t$this->db->where('number', $medals);\n\t\t\t\t$this->db->set('date_paid', $date);\n\t\t\t\t$this->db->set('method', $method);\n\t\t\t\t$this->db->update('tblcontracts');\n\t\t\t\t//print_r($this->input->post());\n\t\t\t\t\n\t\t\t\t$this->load->model('invoice_items_model');\n\t\t\t\t$items = $this->invoice_items_model->get();\n\t\t\t\t\n\t\t\t\t//print_r($items);\n\t\t\t\t\n\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t$villes = explode(',',$item['description']);\n\t\t\t\t\tif ($villes[0] == 'Médaille') {\n\t\t\t\t\t\t$ville = $villes[1];\n\t\t\t\t\t\tif ($client->city == $ville) {\n\t\t\t\t\t\t\t$item_id = $item['itemid'];\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\tif ($item_id) {\n\t\t\t\t\t$item_select = $item_id;\n\t\t\t\t} else {\n\t\t\t\t\t$item_select = 2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tunset($item);\n\t\t\t\t\n\t\t\t\t$this->db->where('id', $item_select);\n\t\t\t\t$item = $this->db->get('tblinvoiceitemslist')->row();\n\t\t\t\t\n\t\t\t\t$data['clientid'] = $_POST['client'];\n\t\t\t\t$data['date'] = $date;\n\t\t\t\t$data['duedate'] = date('Y-m-d', strtotime(\"+30 days\"));\n\t\t\t\t$data['currency'] = \"2\";\n\t\t\t\t$data['clientnote'] = \"\";\n\t\t\t\t$data['adminnote'] = \"\";\n\t\t\t\t$data['terms'] = \"\";\n\t\t\t\t$data['discount_percent'] = \"0\";\n\t\t\t\t$data['discount_total'] = \"0\";\n\t\t\t\t$data['adjustment'] = \"0.00\";\n\t\t\t\t$data['subtotal'] = $item->rate;\n\t\t\t\t$data['total'] = $data['subtotal'];\n\t\t\t\t$data['allowed_payment_modes'] = 'a:6:{i:0;s:1:\"1\";i:1;s:1:\"2\";i:2;s:1:\"3\";i:3;s:1:\"4\";i:4;s:6:\"paypal\";i:5;s:6:\"stripe\";}';\n\t\t\t\t$data['discount_type'] = \"\";\n\t\t\t\t$data['recurring'] = \"18\";\n\t\t\t\t$data['number'] = $medals;\n\t\t\t\t$data['hash'] = md5(rand() . microtime());\n\t\t\t\t$data['status'] = 2;\n\t\t\t\t\n\t\t\t\tif ($_POST['animal_name2']) {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 2 ) ) ) );\n\t\t\t\t} else if ($_POST['animal_name3']) {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 3 ) ) ) );\n\t\t\t\t} else {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 1 ) ) ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$items = $data['newitems'];\n\t\t\t\t\n\t\t\t\tunset($data['newitems']);\n\t\t\t\t\n\t\t\t\t$this->db->insert('tblinvoices', $data);\n\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\tif ($insert_id) {\n\t\t\t\t\t$this->db->where('name', 'next_invoice_number');\n\t\t\t\t\t$this->db->set('value', 'value+1', FALSE);\n\t\t\t\t\t$this->db->update('tbloptions');\n\t\t\t\t\tif (count($items) > 0) {\n\t\t\t\t\t\tforeach ($items['item'] as $itemid => $quantity) {\n\t\t\t\t\t\t\t$this->db->insert('tblinvoiceitems', array(\n\t\t\t\t\t\t\t\t'invoiceid' => $insert_id,\n\t\t\t\t\t\t\t\t'itemid' => $itemid,\n\t\t\t\t\t\t\t\t'qty' => $quantity['quantity'][0]\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->db->where('number', $medals);\n\t\t\t\t\t$this->db->delete('tblnotused');\n\t\t\t\t\t\n\t\t\t\t\t$data_payment['invoiceid'] = $insert_id;\n\t\t\t\t\t$data_payment['amount'] = $data['subtotal'];\n\t\t\t\t\t$data_payment['paymentmode'] = 1;\n\t\t\t\t\t$data_payment['date'] = $date;\n\t\t\t\t\t$data_payment['daterecorded'] = $date;\n\t\t\t\t\t$data_payment['addedfrom'] = 1;\n\t\t\t\t\t\n\t\t\t\t\t$this->db->insert('tblinvoicepaymentrecords', $data_payment);\n\t\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$POST_data = $_POST;\n\t\t\t\t\n\t\t\t\t//print_r($this->input->post());\n\t\t\t\tunset($POST_data['firstname']);\n\t\t\t\tunset($POST_data['lastname']);\n\t\t\t\tunset($POST_data['email']);\n\t\t\t\tunset($POST_data['phonenumber']);\n\t\t\t\tunset($POST_data['phone_other']);\n\t\t\t\tunset($POST_data['no_civique']);\n\t\t\t\tunset($POST_data['address']);\n\t\t\t\tunset($POST_data['app']);\n\t\t\t\tunset($POST_data['city']);\n\t\t\t\tunset($POST_data['state']);\n\t\t\t\tunset($POST_data['zip']);\n\t\t\t\tunset($POST_data['password']);\n\t\t\t\tunset($POST_data['userid']);\n\n\t\t\t\t\n\t\t\t\tif ($_POST['animal_name2']) {\n\t\t\t\t\t\n\t\t\t\t\t$POST_data2['animal_name'] = $_POST['animal_name2'];\n\t\t\t\t\t$POST_data2['race'] = $_POST['race2'];\n\t\t\t\t\t$POST_data2['color'] = $_POST['color2'];\n\t\t\t\t\t$POST_data2['remarque'] = $_POST['remarque2'];\n\t\t\t\t\t$POST_data2['number'] = $_POST['number2'];\n\t\t\t\t\t$POST_data2['attachment'] = $_POST['attachment2'];\n\t\t\t\t\t$POST_data2['sexe'] = $_POST['sexe2'];\n\t\t\t\t\t$POST_data2['method'] = $_POST['method2'];\n\t\t\t\t\t$POST_data2['rfid'] = $_POST['rfid2'];\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name2']);\n\t\t\t\t\tunset($_POST['race2']);\n\t\t\t\t\tunset($_POST['color2']);\n\t\t\t\t\tunset($_POST['remarque2']);\n\t\t\t\t\tunset($_POST['number2']);\n\t\t\t\t\tunset($_POST['attachment2']);\n\t\t\t\t\tunset($_POST['sexe2']);\n\t\t\t\t\tunset($_POST['method2']);\n\t\t\t\t\tunset($_POST['rfid2']);\n\t\t\t\t\t\n\t\t\t\t\t$POST_data2['date_paid'] = $date;\n\t\t\t\t\t$POST_data2['method'] = $method;\n\t\t\t\t\t\n\t\t\t\t\t$id = $this->contracts_model->add($POST_data2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tunset($POST_data['animal_name2']);\n\t\t\t\t\tunset($POST_data['race2']);\n\t\t\t\t\tunset($POST_data['color2']);\n\t\t\t\t\tunset($POST_data['remarque2']);\n\t\t\t\t\tunset($POST_data['number2']);\n\t\t\t\t\tunset($POST_data['attachment2']);\n\t\t\t\t\tunset($POST_data['sexe2']);\n\t\t\t\t\tunset($POST_data['method2']);\n\t\t\t\t\tunset($POST_data['rfid2']);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif ($_POST['animal_name3']) {\n\t\t\t\t\t\n\t\t\t\t\t$POST_data3['animal_name'] = $_POST['animal_name3'];\n\t\t\t\t\t$POST_data3['race'] = $_POST['race3'];\n\t\t\t\t\t$POST_data3['color'] = $_POST['color3'];\n\t\t\t\t\t$POST_data3['remarque'] = $_POST['remarque3'];\n\t\t\t\t\t$POST_data3['number'] = $_POST['number3'];\n\t\t\t\t\t$POST_data3['attachment'] = $_POST['attachment3'];\n\t\t\t\t\t$POST_data3['sexe'] = $_POST['sexe3'];\n\t\t\t\t\t$POST_data3['method'] = $_POST['method3'];\n\t\t\t\t\t$POST_data3['rfid'] = $_POST['rfid3'];\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name3']);\n\t\t\t\t\tunset($_POST['race3']);\n\t\t\t\t\tunset($_POST['color3']);\n\t\t\t\t\tunset($_POST['remarque3']);\n\t\t\t\t\tunset($_POST['number3']);\n\t\t\t\t\tunset($_POST['attachment3']);\n\t\t\t\t\tunset($_POST['sexe3']);\n\t\t\t\t\tunset($_POST['method3']);\n\t\t\t\t\tunset($_POST['rfid3']);\n\t\t\t\t\t\n\t\t\t\t\t$POST_data3['date_paid'] = $date;\n\t\t\t\t\t$POST_data3['method'] = $method;\n\t\t\t\t\t\n\t\t\t\t\t$id = $this->contracts_model->add($POST_data3);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tunset($POST_data['animal_name3']);\n\t\t\t\t\tunset($POST_data['race3']);\n\t\t\t\t\tunset($POST_data['color3']);\n\t\t\t\t\tunset($POST_data['remarque3']);\n\t\t\t\t\tunset($POST_data['number3']);\n\t\t\t\t\tunset($POST_data['attachment3']);\n\t\t\t\t\tunset($POST_data['sexe3']);\n\t\t\t\t\tunset($POST_data['method3']);\n\t\t\t\t\tunset($POST_data['rfid3']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$POST_data['date_paid'] = $date;\n\t\t\t\t$POST_data['method'] = $method;\n\t\t\t\t\n\t\t\t\t$id = $this->contracts_model->add($POST_data);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($id){\n\t\t\t\t\thandle_contract_attachment($id);\n\t\t\t\t\tset_alert('success', _l('added_successfuly',_l('contract')));\n\t\t\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//echo 'sa';\n\t\t\t\tunset($_POST['firstname']);\n\t\t\t\tunset($_POST['lastname']);\n\t\t\t\tunset($_POST['email']);\n\t\t\t\tunset($_POST['phonenumber']);\n\t\t\t\tunset($_POST['phone_other']);\n\t\t\t\tunset($_POST['no_civique']);\n\t\t\t\tunset($_POST['address']);\n\t\t\t\tunset($_POST['app']);\n\t\t\t\tunset($_POST['city']);\n\t\t\t\tunset($_POST['state']);\n\t\t\t\tunset($_POST['zip']);\n\t\t\t\tunset($_POST['password']);\n\t\t\t\tunset($_POST['userid']);\n\t\t\t\tunset($_POST['animal_name2']);\n\t\t\t\tunset($_POST['race2']);\n\t\t\t\tunset($_POST['color2']);\n\t\t\t\tunset($_POST['remarque2']);\n\t\t\t\tunset($_POST['number2']);\n\t\t\t\tunset($_POST['attachment2']);\n\t\t\t\tunset($_POST['sexe2']);\n\t\t\t\tunset($_POST['method2']);\n\t\t\t\tunset($_POST['rfid2']);\n\t\t\t\tunset($_POST['animal_name3']);\n\t\t\t\tunset($_POST['race3']);\n\t\t\t\tunset($_POST['color3']);\n\t\t\t\tunset($_POST['remarque3']);\n\t\t\t\tunset($_POST['number3']);\n\t\t\t\tunset($_POST['attachment3']);\n\t\t\t\tunset($_POST['sexe3']);\n\t\t\t\tunset($_POST['method3']);\n\t\t\t\tunset($_POST['rfid3']);\n\t\t\t\t\n\t\t\t\t$contract_id = $_POST['edit'];\n\t\t\t\tunset($_POST['edit']);\n\t\t\t\t\n\t\t\t\t//print_r($_POST);\n\t\t\t\t\n\t\t\t\t$this->db->where('userid', $cliendid);\n\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t\n\t\t\t\t$_POST['number'];\n\t\t\t\t\n\t\t\t\t$success = $this->contracts_model->update($_POST, $contract_id);\n\n\t\t\t\tif($success){\n\t\t\t\t\tset_alert('success', _l('updated_successfuly',_l('contract')));\n\t\t\t\t} else {\n\t\t\t\t\tset_alert('warning', 'Numéro déjà utilisé');\n\t\t\t\t}\n\n\t\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t}\n\t\t}\n\n\t\tif($id == ''){\n\t\t\t$title = 'Ajouter nouvelle médaille';\n\t\t} else {\n\t\t\t$data['attachment'] = $this->contracts_model->get_contract_attachment($id);\n\t\t\t$data['contract'] = $this->contracts_model->get($id);\n\t\t\t$this->load->model('payment_modes_model');\n\t\t\t$data['payment_modes'] = $this->payment_modes_model->get();\n\t\t\t$client_id = $data['contract']->client;\n\t\t\t$data['client'] = $this->clients_model->get($client_id);\n\t\t\tif(!$data['contract']){\n\t\t\t\tblank_page(_l('contract_not_found'));\n\t\t\t}\n\t\t\t$title = _l('edit',_l('contract_lowercase'));\n\t\t}\n\t\t\n\t\t$this->load->model('payment_modes_model');\n $data['payment_modes'] = $this->payment_modes_model->get();\n\n\t\t$data['types'] = $this->contracts_model->get_contract_types();\n\t\t$this->load->model('clients_model');\n\t\t$data['clients'] = $this->clients_model->get();\n\t\t$data['title'] = $title;\n\t\t$this->load->view('admin/contracts/contract',$data);\n\t}", "public function bill($visit_id = null, $patient_id = null) {\n if ($this->session->userdata('user_name') == '') {\n redirect('login/index/');\n } else {\n//fetch required details\n $bill_id = $this->patient_model->get_bill_id($visit_id);\n// if ($bill_id == NULL)\n// $bill_id = $this->patient_model->create_bill($visit_id, $patient_id);\n\n $patient_id = $this->patient_model->get_patient_id($visit_id);\n $data['patient_id'] = $patient_id;\n $data['medicine'] = $this->patient_model->get_medicine_total($visit_id);\n $data['treatment'] = $this->patient_model->get_treatment_total($visit_id);\n $data['patient'] = $this->patient_model->get_patient_detail($patient_id);\n $data['visit_id'] = $visit_id;\n $data['adv_payment'] = $this->payment_model->get_balance_amount($patient_id);\n $data['items'] = $this->stock_model->get_items();\n $data['currency_postfix'] = $this->settings_model->get_currency_postfix();\n \n $action = $this->input->post('action');\n $item_id = $this->input->post('item_id');\n\n//adding item\n if ($action == 'medicine') {\n $this->form_validation->set_rules('particular', 'Particular', 'required');\n $this->form_validation->set_rules('quantity', 'Quantity', 'is_natural_no_zero|required|callback_check_available_stock[' . $item_id . ']');\n\n if ($this->form_validation->run() === false) {\n \n } else {\n $item_id = $this->input->post('item_id');\n $quantity = $this->input->post('quantity');\n\n $this->select_item($bill_id, $item_id, $quantity);\n }\n $data['bill_id'] = $bill_id;\n $data['bill'] = $this->patient_model->get_bill($visit_id);\n $data['bill_details'] = $this->patient_model->get_bill_detail($visit_id);\n $data['balance'] = $this->payment_model->get_balance_amount($bill_id);\n $data['treatment'] = $this->patient_model->get_treatment_total($visit_id);\n $data['medicine'] = $this->patient_model->get_medicine_total($visit_id);\n $data['paid_amount'] = $this->payment_model->get_paid_amount($bill_id);\n $this->load->view('templates/header');\n $this->load->view('templates/menu');\n $this->load->view('bill', $data);\n $this->load->view('templates/footer');\n } else {\n// $this->form_validation->set_rules('treatment', 'Treatment', 'required');\n// $this->form_validation->set_rules('amount', 'Amount', 'required');\n//\n// if ($this->form_validation->run() === FALSE) {\n// \n// } else {\n// $treatment = $this->input->post('treatment');\n// $amount = $this->input->post('amount');\n// $this->patient_model->add_bill_item($action, $bill_id, $treatment, 1, $amount, $amount);\n// }\n $data['bill_id'] = $bill_id;\n $data['bill'] = $this->patient_model->get_bill($visit_id);\n $data['bill_details'] = $this->patient_model->get_bill_detail($visit_id);\n $data['balance'] = $this->payment_model->get_balance_amount($bill_id);\n $data['treatment'] = $this->patient_model->get_treatment_total($visit_id);\n $data['medicine'] = $this->patient_model->get_medicine_total($visit_id);\n $data['paid_amount'] = $this->payment_model->get_paid_amount($bill_id);\n\n $this->load->view('templates/header');\n $this->load->view('templates/menu');\n $this->load->view('bill', $data);\n $this->load->view('templates/footer');\n }\n }\n }", "public function addNewQuotation(Request $request, $id){\n $ids = Auth::user()->id;\n $user = User::find($ids);\n\n $firstName = $user->first_name;\n $lastName = $user->last_name;\n\n $name = $firstName.\" \".$lastName;\n\n $addNewInvoice = new WlgCorporationInvoice([\n 'user_id'=>$user->id,\n 'if_id'=>$id,\n 'number_of_goods'=>$request->get('no'),\n 'description_of_goods'=>$request->get('descGoods'),\n 'qty'=>$request->get('qty'),\n 'unit_price'=>$request->get('unitPrice'),\n 'total_amount'=>$request->get('totalAmount'),\n 'created_by'=>$name,\n ]);\n\n $addNewInvoice->save();\n Session::flash('successAdd', 'Successfully added');\n\n return redirect()->route('editQuotationInvoiceWlg', ['id'=>$id]);\n\n }", "public function testRequestCreateItem()\n {\n\t\t$response = $this\n\t\t\t\t\t->json('POST', '/api/items', [\n\t\t\t\t\t\t'name' => 'Produkt dodany przez test PHPUnit', \n\t\t\t\t\t\t'amount' => 0\n\t\t\t\t\t]);\n\n $response->assertStatus(200);\n }", "public function createItem($data);", "public function store(Request $request)\n {\n $item=array(\n 'quantity' => $request->input('quantity'),\n 'items' => $request->input('items'),\n 'price_amount' => $request->input('price_amount'),\n 'sub_total' => $request->input('price_amount') * $request->input('quantity'),\n ); \n Budget::create($item);\n return redirect('/budgets')->with('success', 'Items successfully added to list!'); \n\n }", "function addItem ($userId, $item)\n\t{\n\t\t$now = date (\"Y-m-d H:i:s\");\n\t\t$query = sprintf ($this->queries['addItem'],\n\t\t\t$userId,\n\t\t\taddslashes ($item->parentId),\n\t\t\taddslashes ($item->isParent),\n\t\t\taddslashes ($item->name),\n\t\t\taddslashes ($item->description),\n\t\t\taddslashes ($item->visibility),\n\t\t\taddslashes ($item->category),\n\t\t\t$now,\n\t\t\taddslashes ($item->login),\n\t\t\taddslashes ($item->password),\n\t\t\taddslashes ($item->url));\n\t\t$result = $this->db->Execute($query)\n\t\t\tor die(\"AddItem: \" . $this->db->ErrorMsg() . \" \" . $query);\n\t}", "protected function _addGwItemsAmount($item)\n {\n if (!$item->getGwId()) {\n return false;\n }\n $lineNumber = $this->_getNewLineCode();\n $storeId = $item->getQuote()->getStoreId();\n //Add gift wrapping price(for individual items)\n $gwItemsAmount = $item->getGwBasePrice() * $item->getQty();\n\n $line = $this->_getNewDocumentRequestLineObject();\n $line->setLineCode($lineNumber);\n $gwItemsSku = $this->_getConfigHelper()->getGwItemsSku($storeId);\n $line->setItemCode($gwItemsSku ? $gwItemsSku : self::DEFAULT_GW_ITEMS_SKU);\n $line->setItemDescription(self::DEFAULT_GW_ITEMS_DESCRIPTION);\n $line->setAvalaraGoodsAndServicesType($this->_getGiftTaxClassCode($storeId));\n $line->setNumberOfItems($item->getQty());\n $line->setlineAmount($gwItemsAmount);\n $line->setDiscounted('false');\n\n if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {\n $line->setTaxIncluded('true');\n }\n\n $this->_lines[$lineNumber] = $line;\n $this->_setLinesToRequest();\n $this->_lineToLineId[$lineNumber] = $this->_getConfigHelper()->getGwItemsSku($storeId);\n $this->_productGiftPair[$lineNumber] = $item->getId();\n\n return $lineNumber;\n }", "public function actionCreate()\n\t{\n\t\t$model=new ClientInvoice;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ClientInvoice']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ClientInvoice'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function addBedOffer($item, $id){\n\n $storedItem = ['qty' => 0, 'productPrice' => $item->productPrice, 'item' => $item];\n if($this->items){\n if(array_key_exists($id, $this->items)){\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['productPrice'] = $item->productPrice * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->productPrice;\n }", "public function add($item);", "public function add($item);", "public function create($user_id = null)\n\t{\n\t\tif($user_id){\n\t\t\t$insert_data = array(\n\t\t\t'item_type_id' \t\t=> $this->input->post('itemtype'),\n\t\t\t'item_name' \t\t=> trim(ucwords($this->input->post('itemname'))),\n\t\t\t'created_At'\t\t=> strtotime(\"now\"),\n\t\t\t'lastupdated_date'\t=> strtotime(\"now\"),\n\t\t\t'lastupdated_by'\t=> $user_id,\n\t\t);\n\n\t\t$status = $this->db->insert('items', $insert_data);\n\n\t\t\tif($status === true){\n\t\t\t\t//update inventory_history\n\t\t\t\t$item_id = $this->db->insert_id();\n\t\t\t\tif($item_id != 0){\n\t\t\t\t\t$update_data = array(\n\t\t\t\t\t\t'history_type' \t\t=> \"Create\",\n\t\t\t\t\t\t'items_id'\t\t\t=> $item_id,\n\t\t\t\t\t\t'quantity_old'\t\t=> \"0\",\n\t\t\t\t\t\t'quantity_new'\t\t=> \"0\",\n\t\t\t\t\t\t'quantity_summary'\t=> \"Create\",\n\t\t\t\t\t\t'old_update_date'\t=>strtotime(\"now\"),\n\t\t\t\t\t\t'old_updateby'\t\t=>$user_id,\n\t\t\t\t\t\t'new_update_date'\t=>strtotime(\"now\"),\n\t\t\t\t\t\t'new_updateby'\t\t=>$user_id,\n\t\t\t\t\t);\n\n\t\t\t\t\t$query = $this->db->insert('inventory_history', $update_data);\n\n\t\t\t\t\treturn ($query === true ? true : false);\n\t\t\t\t}\n\t\t\treturn false;\n\t\t\t} return false;\n\t\t}\n\t}", "public function create_pending_badge($course_id, $user_id) {\n global $DB;\n $course = $DB->get_record('block_acclaim_courses', array('courseid' => $course_id), '*');\n if (!$course) {\n // This method can be called outside of Acclaim context (for example, by unit tests)\n // with a non-Acclaim course.\n return;\n }\n $user = $DB->get_record('user', array('id' => $user_id), '*', MUST_EXIST);\n\n $pending_badge = new stdClass();\n $pending_badge->badgetemplateid = $course->badgeid;\n $pending_badge->firstname = $user->firstname;\n $pending_badge->lastname = $user->lastname;\n $pending_badge->expiration = $course->expiration;\n $pending_badge->recipientemail = $user->email;\n\n $DB->insert_record('block_acclaim_pending_badges', $pending_badge);\n }", "public function add() {\n\t\t$data = array();\t\n\t\t// add page title\n\t\t$this->output->append_title('Add New Client');\n\t\t// add breadcrumbs\n\t\t\n\t\t$this->breadcrumb->populate(array(\n\t\t\t'Dashboard' => parent::$module.'/dashboard',\n\t\t\t'users' => parent::$module.'/clients',\n\t\t\t'Add Client'\n\t\t));\n\t\t// process form\n\t\tif($this->input->post())\n\t\t{\n\t\t\t// set validation rules\n\t\t\t$this->form_validation->set_rules('client_first_name', 'First Name', 'trim|required');\n\t\t\t$this->form_validation->set_rules('client_last_name', 'Last Name', 'trim|required');\n\t\t\t$this->form_validation->set_rules('client_address', 'Client Address', 'trim|required');\n\t\t\t$this->form_validation->set_rules('client_url', '', 'trim');\n\t\t\t$this->form_validation->set_rules('email', 'Email', 'trim|edit_unique[users.email]');\n\t\t\t$this->form_validation->set_rules('client_phone_number', 'Phone Number', 'trim|required');\n\t\t\t$this->form_validation->set_rules('client_fb_page_url', '', 'trim');\n\t\t\t$this->form_validation->set_rules('client_twitter_page_url', '', 'trim');\n\t\t\t$this->form_validation->set_rules('client_website_url', '', 'trim');\n\t\t\t$this->form_validation->set_rules('client_timezone', 'Client Timezone', 'trim|required');\n\t\t\t\n\t\t\t\n\t\t\t// validate form\n\t\t\tif($this->form_validation->run() == TRUE)\n\t\t\t{\n\n\t\t\t\t// Create client\n\t\t\t\t$user = Sentry::createUser(array(\n\t\t\t\t\t'first_name' => $this->input->post('client_first_name'),\n\t\t\t\t\t'last_name' => $this->input->post('client_last_name'),\n\t\t\t\t\t'address' => $this->input->post('client_address'),\n\t\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t\t'password' => $this->input->post('password'),\n\t\t\t\t\t'country_code' => $this->input->post('client_country_code'),\n\t\t\t\t\t'phone_number' => $this->common->formatPhoneNumber($this->input->post('client_country_code'),$this->input->post('client_phone_number'),true),\n\t\t\t\t\t'timezone' => $this->input->post('client_timezone'),\n\t\t\t\t\t'activated' => true\n\t\t\t\t));\n\t\t\t\t$user_id = $user->getId(); // get user id\n\t\t\t\t\n\t\t\t\t// Find the group using the group id\n\t\t\t\t$adminGroup = Sentry::findGroupById(CLIENT_GROUP_ID); // \n\n\t\t\t\t// Assign the group to the user\n\t\t\t\t$user->addGroup($adminGroup);\n\t\t\t\t\n\t\t\t\t$data = array(\n\t\t\t\t 'client_url' => prep_url($this->input->post('client_url')),\n\t\t\t\t 'client_fb_page_url' => prep_url($this->input->post('client_fb_page_url')),\n\t\t\t\t 'client_twitter_page_url' => prep_url($this->input->post('client_twitter_page_url')),\n\t\t\t\t 'client_website_url' => prep_url($this->input->post('client_website_url')),\n\t\t\t\t 'user_id' => $user_id,\n\t\t\t\t 'created_on' => CURRENT_DATETIME,\n\t\t\t\t 'updated_on' => CURRENT_DATETIME,\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$data = $this->security->xss_clean($data); // filter data & remove malicious code \n\t\t\t\t$this->client_model->insert($data); \n\t\t\t\t\n\t\t\t\t$url = website_url('admin');\n\t\t\t\t\n\t\t\t\t$subject = 'Client Account Creation';\n\t\t\t\t$template_data = array(\n\t\t\t\t\t'email_title' => 'Client Account Creation',\n\t\t\t\t\t'email_heading' => 'Hello '.$this->input->post('client_first_name').' '.$this->input->post('client_last_name'),\n\t\t\t\t\t'email_body' => 'Your account has been created.<br/>\n\t\t\t\t\tYour account details are:<br/>\n\t\t\t\t\tEmail: '.$this->input->post('email').'<br/>\n\t\t\t\t\tPassword: '.$this->input->post('password').'<br/>\n\t\t\t\t\t<br/>Please click on the following link to login:<br/> <a href=\"'.$url.'\">'.$url.'</a><br/>\n\t\t\t\t\tIf clicking the link does not work, please copy and paste the URL into your browser instead.<br/>\n\t\t\t\t\t'\n\t\t\t\t);\n\n\t\t\t\t$body = $this->parser->parse('emails/user_registration', $template_data,TRUE);\n\t\t\t\tif($this->common->sendEmail($email,$subject,$body))\n\t\t\t\t{\n\t\t\t\t\t$this->message->set('success', 'Client added successfully.', TRUE, 'message');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->message->set('warning', 'Unable to send email, please try again later.', TRUE, 'message');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tredirect(website_url('users'));\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->message->set('danger', $this->message->validation_errors());\n\t\t\t}\n\t\t}\n\t\t\n\t\t// create form fields\n\t\t$data['client_first_name'] = array('name' => 'client_first_name',\n\t\t\t'autofocus' => 'autofocus',\n\t\t\t'id' => 'client_first_name',\n\t\t\t'placeholder' => 'First Name',\n\t\t\t'class' => 'form-control',\n\t\t\t'maxlength' => 50,\n\t\t\t'value' => $this->form_validation->set_value('client_first_name')\n\t\t);\n\t\t\n\t\t$data['client_last_name'] = array('name' => 'client_last_name',\n\t\t\t'id' => 'client_last_name',\n\t\t\t'placeholder' => 'Last Name',\n\t\t\t'class' => 'form-control',\n\t\t\t'maxlength' => 50,\n\t\t\t'value' => $this->form_validation->set_value('client_last_name')\n\t\t);\n\t\t\n\t\t$data['client_url'] = array('name' => 'client_url',\n\t\t\t'id' => 'client_url',\n\t\t\t'placeholder' => 'Client URL',\n\t\t\t'class' => 'form-control',\n\t\t\t'maxlength' => 100,\n\t\t\t'value' => $this->form_validation->set_value('client_url')\n\t\t);\n\t\t\n\t\t$data['client_address'] = array('name' => 'client_address',\n\t\t\t'id' => 'client_address',\n\t\t\t'placeholder' => 'Client Address',\n\t\t\t'class' => 'form-control',\n\t\t\t'maxlength' => 300,\n\t\t\t'rows' => 5,\n\t\t\t'value' => $this->form_validation->set_value('client_address')\n\t\t);\n\t\t\n\t\t$data['client_phone_number'] = array('name' => 'client_phone_number',\n\t\t\t'id' => 'client_phone_number',\n\t\t\t'placeholder' => 'Phone Number',\n\t\t\t'class' => 'form-control international-number',\n\t\t\t'maxlength' => 15,\n\t\t\t'type' => 'tel',\n\t\t\t'value' => $this->form_validation->set_value('client_phone_number')\n\t\t);\n\t\t\n\t\t$data['client_fb_page_url'] = array('name' => 'client_fb_page_url',\n\t\t\t'id' => 'client_fb_page_url',\n\t\t\t'placeholder' => 'Facebook Page URL',\n\t\t\t'class' => 'form-control',\n\t\t\t'maxlength' => 100,\n\t\t\t'value' => $this->form_validation->set_value('client_fb_page_url')\n\t\t);\n\t\t\n\t\t$data['client_twitter_page_url'] = array('name' => 'client_twitter_page_url',\n\t\t\t'id' => 'client_twitter_page_url',\n\t\t\t'placeholder' => 'Twitter Page URL',\n\t\t\t'class' => 'form-control',\n\t\t\t'maxlength' => 100,\n\t\t\t'value' => $this->form_validation->set_value('client_twitter_page_url')\n\t\t);\n\t\t\n\t\t$data['client_website_url'] = array('name' => 'client_website_url',\n\t\t\t'id' => 'client_website_url',\n\t\t\t'placeholder' => 'Website URL',\n\t\t\t'class' => 'form-control',\n\t\t\t'maxlength' => 100,\n\t\t\t'value' => $this->form_validation->set_value('client_website_url')\n\t\t);\n\t\t\n\t\t$timezones = $this->timezone->get_timezone_list(); \n\t\t\n\t\t$list=array(''=>'Select Timezone');\n\t\tforeach($timezones as $key=>$value )\n\t\t{\n\t\t\t$list[$value] = $key; \n\t\t}\n\t\t//echo '<pre>'; print_r($list);die;\n\t\t\n\t\t$data['client_timezone'] = array('name' => 'client_timezone',\n\t\t\t'additional' => array(\n\t\t\t\t\t\t\t'id' => 'client_timezone',\n\t\t\t\t\t\t\t'class' => 'form-control',\n\t\t\t\t\t\t),\n\t\t\t'value' => $list,\n\t\t\t'selected' => $this->form_validation->set_value('client_timezone')\n\t\t);\n\t\t\n\t\t$data['client_country_code'] = array('name' => 'client_country_code',\n\t\t\t'id' => 'client_country_code',\n\t\t\t'type' => 'hidden',\n\t\t\t'value' => $this->form_validation->set_value('client_country_code')\n\t\t);\n\t\t\n\t\t$data['email'] = array('name' => 'email',\n\t\t\t'id' => 'email',\n\t\t\t'placeholder' => 'Email',\n\t\t\t'class' => 'form-control',\n\t\t\t'type' => 'text',\n\t\t\t'value' => $this->form_validation->set_value('email')\n\t\t);\n\t\t\n\t\t$data['password'] = array('name' => 'password',\n\t\t\t'id' => 'password',\n\t\t\t'placeholder' => 'Password',\n\t\t\t'class' => 'form-control',\n\t\t\t'type' => 'password',\n\t\t\t'value' => $this->form_validation->set_value('password')\n\t\t);\n\t\t\n\t\t// load view\n\t\t$this->load->view(parent::$module.'/edit',$data);\n\t}", "public function addItems(){\n $this->validate($this->request, [\n 'title' => 'required|max:255',\n 'description' => 'string|max:255',\n 'isbn' => 'string',\n 'authorId' => 'required|integer|min:1',\n 'itemTypeId' => 'required|integer|min:1',\n 'categoryId' => 'required|integer|min:1',\n 'numberInStock' => 'required|integer|min:1',\n 'itemCondition' => 'required',\n 'itemStateId' => 'required|integer|min:1',\n ]);\n $items = array(\n 'title' => $this->request->input('title'),\n 'description' => $this->request->input('description'),\n 'isbn' => $this->request->input('isbn'),\n 'authorId' => $this->request->input( 'authorId'),\n 'catId' => $this->request->input('categoryId'),\n 'numOfItems' => $this->request->input('numberInStock'),\n 'itemCondition' => $this->request->input('itemCondition'),\n 'itemStateId' => $this->request->input('itemStateId'),\n 'itemTypeId' => $this->request->input('itemTypeId'),\n );\n\n try{\n $item = new ItemService();\n $result = $item->createNewItem($items);\n\n if ($result) {\n return response()->json([\n 'success' => true,\n 'data' => [\n 'itemId' => $result,\n ],\n 'message' => 'Item Added Successfully',\n ], 201);\n }\n return response()->json([\n 'success' => false,\n 'message' => 'item could not be added'\n ], 400);\n\n }catch(Exception $ex){\n return response()->json([\n 'success' => false,\n 'message' => 'Error Occured Adding Items. Ensure the IDs are Valid'\n ], 400);\n }\n }", "public function add()\n {\n $item = new stdClass();\n $item->item_id = null;\n $item->barcode = null;\n $item->price = null;\n $item->stock = null;\n $item->name = null;\n $item->category_id = null;\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'add',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => null\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n }", "private function makeItemPurchase() : void\n {\n $this->item->available = $this->item->available - 1;\n $this->coinService->setCoinCount(\n $this->coinService->getCurrenCoinCount() - $this->item->cost\n );\n $this->item->save();\n }", "public function add(){\n\t\t$this->check_role_access(1);\n\t\t// set the page title\t\t\n\t\t$this->set('title_for_layout', 'Create Client - Clients - Manage Hiring');\t\n\t\t$this->load_static_data();\n\t\t$this->set('statusList', array('0' => 'Active', '1' => 'Inactive'));\n\t\t$this->set('titleList', array('1' => 'Mr.', '2' => 'Ms.'));\n\t\tif ($this->request->is('post')){\n\t\t\t// validates the form\n\t\t\t$this->request->data['Client']['created_by'] = $this->Session->read('USER.Login.id');\n\t\t $this->request->data['Client']['created_date'] = $this->Functions->get_current_date();\n\t\t\t$this->request->data['Client']['update_date'] = $this->Functions->get_current_date();\n\t\t\t$this->request->data['Client']['status'] = 2;\n\t\t\t$this->request->data['Client']['is_inactive'] = 'N';\n\t\t\t$this->Client->set($this->request->data);\n\t\t\t// retain the district\n\t\t\t$this->get_district_list($this->request->data['Client']['state']);\n\t\t\t// validate the client contacts\n\t\t\t$contact_validate = $this->validate_contact();\n\t\t\t// validate the form fields\n\t\t\tif ($this->Client->validates(array('fieldList' => array('client_name','city','pincode','state','res_location_id',\n\t\t\t'account_holder'))) && $contact_validate){\t\t\t\t\t\n\t\t\t\t// save the data\n\t\t\t\tif($this->Client->save($this->request->data['Client'], array('validate' => false))){\n\t\t\t\t\t// save client contact list\n\t\t\t\t\t$this->save_client_contact_list($this->Client->id);\n\t\t\t\t\t// save account holder list\n\t\t\t\t\t$this->save_account_holder($this->Client->id);\n\t\t\t\t\t// update req approval status table\n\t\t\t\t\t$this->save_client_approval($this->Client->id);\n\t\t\t\t\t// send mail to approver\n\t\t\t\t\t$sub = 'Manage Hiring - Client created by '.ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name'));\n\t\t\t\t\t$from = ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name'));\n\t\t\t\t\t// get the superiors\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t$this->loadModel('Approve');\n\t\t\t\t\t$approval_data = $this->Approve->find('first', array('fields' => array('level1'), 'conditions'=> array('Approve.users_id' => $this->Session->read('USER.Login.id'))));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// get leader email address\n\t\t\t\t\t$leader_data = $this->Client->Creator->find('all', array('conditions' => array('Creator.id' => $approval_data['Approve']['level1']),'fields' => array('Creator.id',\t'Creator.first_name','Creator.last_name','Creator.email_id')));\n\t\t\t\t\t*/\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// get the Business Head\n\t\t\t\t\t$leader_data = $this->Client->Creator->find('all', array('conditions' => array('roles_id' => '39'), 'fields' => array('Creator.id',\t'Creator.first_name','Creator.last_name', 'Creator.email_id')));\n\t\t\t\t\t\n\t\t\t\t\t// get account holder name\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t$sub = 'Manage Hiring - Client created by '.ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name'));\n\t\t\t\t\t$from = ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name'));\n\t\t\t\t\t// get the Business Head\n\t\t\t\t\t$leader_data = $this->Client->Creator->find('all', array('conditions' => array('roles_id' => '39'), 'fields' => array('Creator.id',\t'Creator.first_name','Creator.last_name', 'Creator.email_id')));\n\t\t\t\t\t// get account holder name\n\t\t\t\t\t$ac_holder = $this->ClientAccountHolder->find('all', array('fields' => array(\"group_concat(User.first_name separator ', ') account_holder\"), 'order' => array('User.first_name ASC'), 'conditions' => array('ClientAccountHolder.clients_id' => $this->Client->id, \t'User.is_deleted' => 'N'), 'group' => array('User.id')));\n\t\t\t\t\t*/\n\t\t\t\t\t\n\t\t\t\t\t// if leader found\n\t\t\t\t\tif(!empty($leader_data)){\n\t\t\t\t\t\t$this->loadModel('ClientStatus');\n\t\t\t\t\t\t// make sure not duplicate status exists\n\t\t\t\t\t\t$this->check_duplicate_status($this->Client->id, $leader_data[0]['Creator']['id']);\t\t\t\n\t\t\t\t\t\t// save req. status data\n\t\t\t\t\t\t$data = array('clients_id' => $this->Client->id, 'created_date' => $this->Functions->get_current_date(), 'users_id' => $leader_data[0]['Creator']['id']);\n\t\t\t\t\t\t// save the client status\n\t\t\t\t\t\tif($this->ClientStatus->save($data, true, $fieldList = array('clients_id','created_date','users_id'))){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$ac_holder = $this->ClientAccountHolder->find('all', array('fields' => array(\"group_concat(User.first_name separator ', ') account_holder\"), 'order' => array('User.first_name ASC'), 'conditions' => array('ClientAccountHolder.clients_id' => $this->Client->id, 'User.is_deleted' => 'N')));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$vars = array('from_name' => $from, 'to_name' => ucwords($leader_data[0]['Creator']['first_name'].' '.$leader_data[0]['Creator']['last_name']), 'client_name' => $this->request->data['Client']['client_name'], 'city' => $this->request->data['Client']['city'],'account_holder' => $ac_holder[0][0]['account_holder']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// notify superiors\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!$this->send_email($sub, 'add_client', '[email protected]', $leader_data[0]['Creator']['email_id'],$vars)){\t\n\t\t\t\t\t\t\t\t// show the msg.\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Problem in sending the mail for approval...', 'default', array('class' => 'alert alert-error'));\t\t\t\t\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Client Created Successfully. After approval, it will be visible!', 'default', array('class' => 'alert alert-info'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>You have no superior to approve your request', 'default', array('class' => 'alert alert-info'));\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t// show the msg.\n\t\t\t\t\t$this->redirect('/client/');\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t// show the error msg.\n\t\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Problem in saving the data...', 'default', array('class' => 'alert alert-error'));\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Please check the validation errors...', 'default', array('class' => 'alert alert-error'));\t\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t}", "public function createItem($item) {\n\t\treturn tdb::insert(self::$tablename,$item);\n\t}", "function add_check_for_client(Request $request , $id){\n bankCheckController::Create([\n 'id' => $id,\n 'type' => 'client',\n 'check_date' =>$request->input('check_date'),\n 'check_value' =>$request->input('check_value'),\n 'increase_value'=>$request->input('increase_value'),\n 'check_owner' =>$request->input('check_owner')\n ]);\n # add payments to merchant from Banckcheck\n # ClientPayments::Create($id,ClientPayments::PaymentValue($id,$request->input('check_value'),'شيك'));\n return back()->with(['success'=>'تم اضافة شيك بنجاح']);\n }", "public function add($item)\n {\n if ($item instanceof ItemInterface) {\n $this->items[] = $item;\n } else {\n $this->items[] = new PayPalItem($item);\n }\n }", "public function addNewCommercialInvoice(Request $request, $id){ \n $ids = Auth::user()->id;\n $user = User::find($ids);\n\n $firstName = $user->first_name;\n $lastName = $user->last_name;\n\n $name = $firstName.\" \".$lastName;\n\n $addNewInvoice = new WlgCorporationInvoice([\n 'user_id'=>$user->id,\n 'if_id'=>$id,\n 'number_of_goods'=>$request->get('no'),\n 'description_of_goods'=>$request->get('descGoods'),\n 'qty'=>$request->get('qty'),\n 'unit_price'=>$request->get('unitPrice'),\n 'total_amount'=>$request->get('totalAmount'),\n 'created_by'=>$name,\n ]);\n\n $addNewInvoice->save();\n Session::flash('successAdd', 'Successfully added');\n\n return redirect()->route('editCommercialInvoiceWlg', ['id'=>$id]);\n }", "public function addNewPackingList(Request $request, $id){\n $ids = Auth::user()->id;\n $user = User::find($ids);\n\n $firstName = $user->first_name;\n $lastName = $user->last_name;\n\n $name = $firstName.\" \".$lastName;\n\n $addNewInvoice = new WlgCorporationInvoice([\n 'user_id'=>$user->id,\n 'if_id'=>$id,\n 'number_of_goods'=>$request->get('no'),\n 'description_of_goods'=>$request->get('descGoods'),\n 'qty'=>$request->get('qty'),\n 'kg_cbm'=>$request->get('kg'),\n 'gross_weight'=>$request->get('grossWeight'),\n 'created_by'=>$name,\n ]);\n\n $addNewInvoice->save();\n Session::flash('successAdd', 'Successfully added');\n\n return redirect()->route('editPackingListWlg', ['id'=>$id]);\n }", "function add_billing_data($billObj) {\n\n $item = new stdClass();\n $item->trans_id = $billObj->transId;\n $item->cardholder = $billObj->billTo->firstName . ' ' . $billObj->billTo->lastName;\n $item->type = 'a';\n $item->address = $billObj->billTo->address;\n $item->state = $billObj->billTo->state;\n $item->city = $billObj->billTo->city;\n $item->zip = $billObj->billTo->zip;\n $item->pdate = time();\n\n $exists = $this->is_billing_data_exists($item->trans_id);\n if ($exists == 0) {\n $query = \"insert into mdl_billing_data \"\n . \"(transaction_id,\"\n . \"cardholder,\"\n . \"type,\"\n . \"address,\"\n . \"state,\"\n . \"city,\"\n . \"zip,\"\n . \"pdate) \"\n . \"values ('$item->trans_id',\"\n . \"'\" . addslashes($item->cardholder) . \"',\"\n . \"'$item->type',\"\n . \"'\" . addslashes($item->address) . \"',\"\n . \"'$item->state',\"\n . \"'\" . addslashes($item->city) . \"',\"\n . \"'$item->zip',\"\n . \"'$item->pdate')\";\n $this->db->query($query);\n } // end if $exists == 0\n }", "function addPostponedclients(Request $request, $id){\n ClientPayments::Create($id,ClientPayments::PaymentValue($id,$request->postponed_value,'دفعات'));\n return back()->with(['success'=>'تم تسديد دفعة بنجاح']);\n }", "protected function _newLine($item)\n {\n if (!$item->getId()) {\n $this->setCanSendRequest(false);\n\n return false;\n }\n\n $this->_addGwItemsAmount($item);\n if ($this->isProductCalculated($item)) {\n return false;\n }\n $product = $this->_getProductByProductId($this->_retrieveProductIdFromQuoteItem($item));\n $taxClass = $this->_getTaxClassCodeByProduct($product);\n $price = $item->getBaseRowTotal();\n if ($this->_getTaxDataHelper()->applyTaxAfterDiscount($item->getStoreId())) {\n $price -= $item->getBaseDiscountAmount();\n }\n\n $lineNumber = $this->_getNewLineCode();\n\n $line = $this->_getNewDocumentRequestLineObject();\n $line->setLineCode($lineNumber);\n $line->setItemCode(\n $this->_getCalculationHelper()->getItemCode(\n $this->_getProductForItemCode($item),\n $item->getStoreId()\n )\n );\n $line->setNumberOfItems($item->getTotalQty());\n $line->setlineAmount($price);\n $line->setItemDescription($item->getName());\n $discounted = (float)$item->getDiscountAmount()\n && $this->_getTaxDataHelper()\n ->applyTaxAfterDiscount($item->getStoreId())\n ? 'true'\n : 'false';\n\n $line->setDiscounted($discounted);\n\n if ($this->_getTaxDataHelper()->priceIncludesTax($item->getStoreId())) {\n $line->setTaxIncluded('true');\n }\n\n if ($taxClass) {\n $line->setAvalaraGoodsAndServicesType($taxClass);\n }\n\n $metadata = null;\n $ref1Value = $this->_getRefValueByProductAndNumber($product, 1, $item->getStoreId());\n if ($ref1Value) {\n $metadata['ref1'] = $ref1Value;\n }\n $ref2Value = $this->_getRefValueByProductAndNumber($product, 2, $item->getStoreId());\n if ($ref2Value) {\n $metadata['ref2'] = $ref2Value;\n }\n if ($metadata) {\n $line->setMetadata($metadata);\n }\n\n $this->_lines[$lineNumber] = $line;\n $this->_lineToLineId[$lineNumber] = $item->getId();\n\n return $lineNumber;\n }", "function addnewPayment($cid, $Amount, $AdditionalAmount, $days, $userid) {\n\n $Date = date(\"Y-m-d H:i\");\n\n $sql = \"INSERT INTO invoice_payments (Amount,AdditionalAmount,DateTime,Credit_Invoice_idCredit_Invoice,User_idUser,PayFor,Status) \"\n\n . \"VALUES ($Amount,$AdditionalAmount,'$Date',$cid,$userid,$days,'1')\";\n\n\n\n if (mysqli_query($this->con, $sql)) {\n\n// return 'error:' . mysqli_error($this->con);\n\n return true;\n\n } else {\n\n// return 'error:' . mysqli_error($this->con);\n\n return false;\n\n }\n\n }", "public function add($item)\n {\n $this->addArray('content', $item, array('ButtonContainer', 'Container', 'Form', 'Heading', 'HTML', 'Image', 'Checkbox', 'Email', 'HiddenField', 'Label', 'Password', 'Phone', 'RadioButtons', 'SelectMenu', 'TextInput', 'TextArea', 'Upload', 'XList', 'Table'));\n }", "public function create(Request $request)\n {\n //creating a list of donated items\n //validadtion \n $this->validate($request, [\n 'user_id' => 'required',\n 'item_name' => 'required',\n 'item_type' => 'required',\n 'item_unit' => 'required',\n 'item_quantity' => 'required',\n 'item_desc' => 'required'\n ]);\n return Donation::create([\n 'user_id' => $request->user_id,\n 'item_name' => $request->item_name,\n 'item_type' => $request->item_type,\n 'item_unit' => $request->item_unit,\n 'item_quantity' => $request->item_quantity,\n 'item_desc' => $request->item_desc,\n ]);\n }", "public function addBill($number, $date_generated, $date_paid=\"\", $is_paid=0){\n\t\n\t\t$sql = \"insert into su_bills(number, date_generated, date_paid, is_paid)\"\n\t\t\t\t. \" values(?, ?, ?, ?)\";\n\t\t$this->runRequest($sql, array($number, $date_generated, $date_paid, $is_paid));\n\t\treturn $this->getDatabase()->lastInsertId();\n\t}", "public function addItem($item)\n {\n if ($item instanceof \\Fastbill\\Item\\Item)\n {\n $this['ITEMS'][] = $item;\n }\n else\n {\n $itemObj = new \\Fastbill\\Item\\Item();\n $itemObj->fillFromArray($item);\n $this['ITEMS'];\n }\n\n }", "function add_item($pid=null)\n {\n if ($this->acl->otentikasi2($this->title) == TRUE && $this->model->valid_add_trans($pid, $this->title) == TRUE){ \n $pr = $this->model->get_by_id($pid)->row();\n $purchase = $this->purchase->get_po($pr->purchase);\n $purchase_item = $this->pitem->get_product_item($purchase->id, $this->input->post('cproduct'));\n \n $this->form_validation->set_rules('cproduct', 'Product', 'required|callback_valid_item['.$pid.']|callback_valid_stock['.$purchase->dates.']');\n $this->form_validation->set_rules('treturn', 'Return', 'required|numeric|callback_valid_qty['.$pr->purchase.']');\n\n if ($this->form_validation->run($this) == TRUE && $this->valid_confirmation($pid) == TRUE)\n {\n $harga = $this->pitem->get_product_item($purchase->id, $this->input->post('cproduct'));\n $price = $harga->price;\n $tax = intval($harga->tax/$harga->qty*$this->input->post('treturn'));\n \n $pitem = array('product' => $this->input->post('cproduct'), 'purchase_return_id' => $pid, 'qty' => $this->input->post('treturn'),\n 'unit' => $this->product->get_unit($this->input->post('cproduct')),\n 'price' => $price, 'amount' => $this->input->post('treturn') * $price + $tax,\n 'tax' => $tax);\n \n if ($this->transmodel->add($pitem) == true){ $this->update_trans($pid); $this->error = 'transaction successfully saved..!'; }else{ $this->reject(); } \n }\n elseif ($this->valid_confirmation($pid) == FALSE){ $this->reject(\"Journal already approved..!!\"); }\n else{ $this->reject(validation_errors()); }\n }else { $this->reject_token('Invalid Token or Expired..!'); }\n $this->response();\n }", "function add_item($edit=NO)\n\t{\n\t\tglobal $db;\n\n\t\tif ($edit == YES)\n\t\t{\n\t\t\t// delete the item first\n\t\t\t$sql = \"DELETE FROM preorders WHERE pre_preorderID=$this->preorderID\";\n\t\t\tmysql_query($sql,$db);\n\t\t\t$this->error->mysql(__FILE__,__LINE__);\n\t\t}\n\n\t\t// insert the new row and obtain the preorder ID\n\t\t$vals = array(\n\t\t\t($edit==NO?'NULL':$this->preorderID),\n\t\t\t$_SESSION['storeID'],\n\t\t\t$this->itemID,\n\t\t\t$this->info['price'],\n\t\t\tPRE_ACTIVE,\n\t\t\tmysql_real_escape_string($this->info['notes']),\n\t\t\tstrtotime($this->info['releasedate'])\n\t\t);\n\n\t\t$sql = \"INSERT INTO preorders VALUES ('\".implode(\"','\",$vals).\"')\";\n\t\tmysql_query($sql,$db);\n\t\t$this->error->mysql(__FILE__,__LINE__);\n\n\t\t$preorderID = mysql_insert_id();\n\n\t\t$this->set_preorderID($preorderID);\n\t}", "function add_multi() {\n \t\t//-- step 1 pilih kode pelanggan\n \t\t$this->load->model('customer_model');\n\t\t$this->load->model('bank_accounts_model');\n \t\t$data['no_bukti']=$this->nomor_bukti();\n\t\t$data['date_paid']=date('Y-m-d');\n\t\t$data['how_paid']='Cash';\n\t\t$data['amount_paid']=0;\n\t\t$data['mode']='add';\n\t\t$data['customer_number']='';\n\t\t$data['how_paid_acct_id']='';\n\t\t$data['how_paid']='';\n\t\t$data['customer_list']=$this->customer_model->customer_list();\n\t\t$data['account_list']=$this->bank_accounts_model->account_number_list();\n\t\t$data['credit_card_number']='';\n\t\t$data['expiration_date']=date('Y-m-d');\n\t\t$data['from_bank']='';\n\t\t$this->template->display_form_input('sales/payment_multi',$data,'');\t\t\t\n\t\t\n }", "function addInvoice() {\n $stmt = $GLOBALS['con']->prepare(\"INSERT INTO invoices (customer_id, amount_due, invoice_due_date, service_id, service_name, fully_paid)\n VALUES (?, ?, ?, ?, ?, ?);\");\n $stmt->bind_param(\"ssssss\", $custId, $amountDue, $invoiceDate, $serviceId, $serviceName, $paid);\n\n\n $custId = validateInput('invoiceCustId', 'post');\n $invoiceDate = validateInput('invoiceDate', 'post');\n list($serviceId, $serviceName) = explode(\":\", validateInput('service', 'post')); // 'service id : service name'\n $paid = validateInput('fullyPaid', 'post'); // 1 === 'no' : 2 === yes'\n $amountDue = '';\n\n // Get the price of the service\n $sql = \"SELECT price FROM services WHERE id = $serviceId\";\n $result = mysqli_query($GLOBALS['con'], $sql);\n if ($result) {\n $amountDue = mysqli_fetch_assoc($result); \n $amountDue = $amountDue['price'];\n }\n\n $stmt->execute();\n $stmt->close(); \n }", "public function actionAdd_new($item = 'product')\n {\n if (Yii::app()->params->testenv === '') { // This condition need to bypass security in test mode\n $this->initAction($item);\n }\n \n $Model = ucfirst($item); // $Model @var string is name for initialise of current Model\n $this->_model = new $Model();\n $formName = 'new_item';\n \n $this->performAjaxValidation($this->_model, $formName);\n \n if (isset($_POST[$Model])) {\n $this->_model->name = $_POST[$Model]['name'];\n \n if (Yii::app()->params->testenv !== '') { // This condition forcibly sets \"1\" the value of model's\n $this->_model->manager_id = 1; // attribute \"manager_id\" when app run in test mode\n } else {\n $this->_model->manager_id = (int)Yii::app()->user->id;\n }\n\n if ($this->_model->validate()) {\n $this->_model->save();\n\n $this->redirect(Yii::app()->params->testenv // in test mode redirect link should be preceded by \"/index-test.php\"\n . '/service/admin/review/item/'\n . $item);\n }\n } \n $this->render('new_item', array('newItem' => $this->_model,\n 'item' => $item,\n 'formName' => $formName,));\n }", "public function postAdd(Request $request) {\n\n\t\t$this->validate($request, [\n\t\t\t'item' => 'required',\n\t\t\t'description' => 'required',\n\t\t\t'price' => 'required|numeric',\n\t\t\t'purchase_link' => 'required|url',\n\t\t\t'number_wanted' => 'required|integer']);\n\n\t\t$wishlist_id = $request->id; \n\n\t\t$data = $request->only('item','description','price','purchase_link','number_wanted');\n\t\t$data['number_remaining'] = $request->number_wanted;\n\t\t$data['wishlist_id'] = $wishlist_id;\n\t\t$item = new \\App\\Item($data);\n\t\t$item->save();\t\t\t\t\n\t\n\t\t\\Session::flash('message', 'Your item was added');\n\n\t\treturn redirect('/wishlist');\n\t}", "public function actionCreateItem()\r\n {\r\n $catalogItem = new CatalogItem(['scenario' => 'create']);\r\n\r\n if($catalogItem->load(Yii::$app->request->post()) && $catalogItem->save())\r\n {\r\n $this->redirect(['/admin/catalog/index', 'id' => $catalogItem->id]);\r\n }\r\n\r\n $catalog = new Catalog();\r\n\r\n return $this->render(\r\n 'create',\r\n [\r\n 'catalog' => $catalog,\r\n 'catalogItem' => $catalogItem,\r\n ]\r\n );\r\n }", "public function addItem($item){\n $this->items[] = $item;\n }", "public function createItemType($user_id)\n {\n $data = array(\n 'name' => $this->input->post('name'),\n 'description' => $this->input->post('description'),\n );\n\n return $this->db->insert('item_type', $data);\n }", "function carton_add_order_item( $order_id, $item ) {\n\tglobal $wpdb;\n\n\t$order_id = absint( $order_id );\n\n\tif ( ! $order_id )\n\t\treturn false;\n\n\t$defaults = array(\n\t\t'order_item_name' \t\t=> '',\n\t\t'order_item_type' \t\t=> 'line_item',\n\t);\n\n\t$item = wp_parse_args( $item, $defaults );\n\n\t$wpdb->insert(\n\t\t$wpdb->prefix . \"carton_order_items\",\n\t\tarray(\n\t\t\t'order_item_name' \t\t=> $item['order_item_name'],\n\t\t\t'order_item_type' \t\t=> $item['order_item_type'],\n\t\t\t'order_id'\t\t\t\t=> $order_id\n\t\t),\n\t\tarray(\n\t\t\t'%s', '%s', '%d'\n\t\t)\n\t);\n\n\t$item_id = absint( $wpdb->insert_id );\n\n\tdo_action( 'carton_new_order_item', $item_id, $item, $order_id );\n\n\treturn $item_id;\n}", "function save_item() {\n\n validate_submitted_data(array(\n \"id\" => \"numeric\",\n \"invoice_id\" => \"required|numeric\"\n ));\n\n $invoice_id = $this->input->post('invoice_id');\n\n $id = $this->input->post('id');\n $rate = unformat_currency($this->input->post('invoice_item_rate'));\n $quantity = unformat_currency($this->input->post('invoice_item_quantity'));\n $desc=$this->input->post('invoice_item_title');\n $get_id_item=$this->db->query('select * from master_items where title=\"'.$desc.'\" AND deleted=0')->row();\n //echo $this->db->last_query();exit();\n\n $invoice_item_data = array(\n \"fid_invoices\" => $invoice_id,\n \"title\" => $this->input->post('invoice_item_title'),\n \"description\" => $this->input->post('description'),\n \"category\" => $this->input->post('category'),\n \"quantity\" => $quantity,\n \"unit_type\" => $this->input->post('unit_type'),\n \"fid_items\" => $get_id_item->id,\n \"basic_price\" => unformat_currency($this->input->post('invoice_item_basic'))* $quantity,\n \"rate\" => unformat_currency($this->input->post('invoice_item_rate')),\n\n \"total\" => $rate * $quantity,\n );\n\n $invoice_item_id = $this->Sales_InvoicesItems_model->save($invoice_item_data, $id);\n if ($invoice_item_id) {\n\n //check if the add_new_item flag is on, if so, add the item to libary. \n $add_new_item_to_library = $this->input->post('add_new_item_to_library');\n if ($add_new_item_to_library) {\n $library_item_data = array(\n \"title\" => $this->input->post('invoice_item_title'),\n \"category\" => $this->input->post('category'),\n \"unit_type\" => $this->input->post('unit_type'),\n \"rate\" => unformat_currency($this->input->post('invoice_item_rate'))\n );\n $this->Master_Items_model->save($library_item_data);\n\n }\n\n $options = array(\"id\" => $invoice_item_id);\n $item_info = $this->Sales_InvoicesItems_model->get_details($options)->row();\n $pajak = 0;\n $invoice_sql = \"SELECT sales_invoices.*, tax_table.percentage AS tax_percentage, tax_table.title AS tax_name\n FROM sales_invoices\n LEFT JOIN (SELECT taxes.* FROM taxes) AS tax_table ON tax_table.id = sales_invoices.fid_tax\n WHERE sales_invoices.deleted=0 AND sales_invoices.id='$invoice_id'\";\n $invoice = $this->db->query($invoice_sql)->row();\n\n $item = $this->db->query(\"SELECT sum(total) as total from sales_invoices_items WHERE fid_invoices = '$invoice_id'\")->row();\n $pajak = $item->total * ($invoice->tax_percentage / 100);\n $query = array(\"amount\" => $item->total + $pajak, \"sub_total\" => $item->total,'ppn' => $pajak);\n $exe = $this->Sales_Invoices_model->save($query,$invoice_id); \n echo json_encode(array(\"success\" => true, \"invoice_id\" => $item_info->fid_invoices, \"data\" => $this->_make_item_row($item_info), \"invoice_total_view\" => $this->_get_invoice_total_view($item_info->fid_invoices), 'id' => $invoice_item_id, 'message' => lang('record_saved')));\n } else {\n echo json_encode(array(\"success\" => false, 'message' => lang('error_occurred')));\n }\n }", "public function addItem($item)\n {\n\n /*echo \"<pre>\";\n print_r($item);exit();*/\n\n \t/*$sql=\"INSERT INTO `item`(`product_code`,`item_name`, `hsn_code`, `category_id`, `unit_id`, `tax_id`, `item_description`, `purchase_price`, `sales_price`, `status`, `picture`,`user_id`,`bar_code`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)\";*/\n\n if($this->db->insert('item',$item)){\n return true;\n }\n return false;\n\n }", "private function _store(Yourdelivery_Model_Inventory $item) {\n $request = $this->getRequest();\n $form = new Yourdelivery_Form_Administration_Inventory_Create();\n if ($form->isValid($request->getPost())) {\n\n if (!$this->_subChecks($form)) {\n return;\n }\n\n $values = $form->getSubForm('item')->getValues();\n $values['item']['printerNextDate'] = date('Y-m-d H:i:s', strtotime($values['item']['printerNextDate']));\n $item->setData($values['item']);\n $item->save();\n\n //store all the stati for creation \n $item->addComment('needs', $form->getSubform('status')->getValue('statusCommentNeeds'), $form->getSubform('status')->getValue('statusNeeds'), $this->session->admin->getId());\n $item->addComment('printer', $form->getSubform('status')->getValue('statusCommentPrinterCost'), $form->getSubform('status')->getValue('statusPrinterCost'), $this->session->admin->getId());\n $item->addComment('website', $form->getSubform('status')->getValue('statusCommentWebsite'), $form->getSubform('status')->getValue('statusWebsite'), $this->session->admin->getId());\n $item->addComment('flyer', $form->getSubform('status')->getValue('statusCommentFlyer'), $form->getSubform('status')->getValue('statusFlyer'), $this->session->admin->getId());\n $item->addComment('terminal', $form->getSubform('status')->getValue('statusCommentTerminal'), $form->getSubform('status')->getValue('statusTerminal'), $this->session->admin->getId());\n\n $this->_redirect('administration_inventory/overview');\n }\n else {\n $this->view->post = $request->getPost();\n $this->error($form->getMessages());\n $this->error(__b(\"Konnte Posten nicht anlegen\"));\n }\n }", "function CreateItem($conn) {\n\t/* Retrieve and sanitize inputs */\n\t$itemID = sanitizeMySQL($conn, get_post($conn, 'itemID')); // Get itemID & sanitize\n\t$title = sanitizeMySQL($conn, get_post($conn, 'title')); // Get title & sanitize\n\t$price = sanitizeMySQL($conn, get_post($conn, 'price')); // Get price & sanitize\n\t$weight = sanitizeMySQL($conn, get_post($conn, 'weight')); // Get weight & sanitize\n\t$quantityA = sanitizeMySQL($conn, get_post($conn, 'quantityA')); // Get quantity & sanitize\n\t$quantityB = sanitizeMySQL($conn, get_post($conn, 'quantityA')); // Get quantity & sanitize\n\t$description = sanitizeMySQL($conn, get_post($conn, 'description')); // Get description & sanitize\n\t//echo $itemID.\"<br>\".$title.\"<br>\".$price.\"<br>\".$weight.\"<br>\".$quantityA.\"<br>\".$quantityB.\"<br>\".$description;\n\n\t/* Insert item into DB */\n\tif(!ItemExists($conn, $itemID)) { // If item does not exist\n\t\tInsertItem($conn, $itemID, $title, $price, $weight, $description); // Insert item\n\t\techo '<div class=\"alert alert-primary\" role=\"alert\">Item insert created!</div>';\n\t} else {\n\t\techo '<div class=\"alert alert-primary\" role=\"alert\">Item already exists!</div>';\n\t\treturn false;\n\t}\n\n\t/* Insert item inventory into DB */\n\tif(!InsertInventory($conn, $itemID, 'A', $quantityA, null)) { // Try to item picture in DB\n\t\techo <<<_END\n <div class=\"alert alert-primary\" role=\"alert\">Inventory A insert failed!</div>\n_END;\n\t\treturn false; // Try to item picture in DB\n\t}\n\tif(!InsertInventory($conn, $itemID, 'B', $quantityB, null)) { // Try to item picture in DB\n\t\techo <<<_END\n <div class=\"alert alert-primary\" role=\"alert\">Inventory B insert failed!</div>\n_END;\n\t\treturn false; // Try to item picture in DB\n\t}\n\t/* Upload picture and retrieve filename */\n\t$picture = UploadPicture($itemID, $title); // Get directory of where the picture was stored\n\tif(is_null($picture)) return false;\n\t/* Insert picture into DB */\n\tif(!InsertPicture($conn, $itemID, $picture)) { // Try to insert picture in DB\n\t\techo <<<_END\n <div class=\"alert alert-primary\" role=\"alert\">Picture insert failed!</div>\n_END;\n\t\treturn false;\n\t} else\n\t\techo <<<_END\n\t\t<div class=\"alert alert-primary\" role=\"alert\">Picture inserted!</div>\n_END;\n\treturn true; // Successful item creation\n}", "private function generateItemsToBuild(Item $item, int $cantidad) \n {\n if ($item->insumo_base) return;\n\n if (!isset($this->itemsToBuild[$item->id])) {\n $this->itemsToBuild[$item->id] = [\n 'id' => $item->id,\n 'nombre'=>$item->nombre,\n 'stock' => $item->stock,\n 'stockNuevo' => $item->stock,\n 'tiempo_produccion' => $item->tiempo_produccion,\n 'cantidad' => 0,\n ];\n }\n if ($cantidad > $this->itemsToBuild[$item->id]['stockNuevo']) {\n $this->itemsToBuild[$item->id]['cantidad'] += $cantidad - $this->itemsToBuild[$item->id]['stockNuevo'];\n $this->itemsToBuild[$item->id]['stockNuevo'] = 0;\n $cantidadDeps = $cantidad - $this->itemsToBuild[$item->id]['stockNuevo'];\n }\n else {\n $this->itemsToBuild[$item->id]['stockNuevo'] -= $cantidad;\n $cantidadDeps = 0;\n }\n\n if ($cantidadDeps > 0) {\n foreach ($item->dependencias as $dependencia)\n {\n $this->generateItemsToBuild($dependencia, $cantidadDeps * $dependencia->cantidadComoInsumoDe($item));\n }\n }\n }", "public static function addItem($id_product, $id_item, $qty)\n {\n }", "function create(){\n // echo \"create function\";\n // sanitize\n $user_id=htmlspecialchars(strip_tags($_POST['user_id']));\n\n $maintenance_id=htmlspecialchars(strip_tags($_POST['maintenance_id']));\n $wallet_amt=htmlspecialchars(strip_tags($_POST['wallet_amt']));\n $remain_amt=htmlspecialchars(strip_tags($_POST['remain_amt']));\n $enter_amount=htmlspecialchars(strip_tags($_POST['enter_amount']));\n $wallet_chbx=htmlspecialchars(strip_tags($_POST['wallet_chbx']));\n\n $subscription_list = (array)json_decode($_POST['subscription_list'],true);\n // print_r($subscription_list);\n $total_amt_have = $enter_amount;\n global $item;\n global $subscription;\n global $user;\n\n if($wallet_chbx == 1){\n $total_amt_have = $total_amt_have + $wallet_amt;\n $wallet_amt = 0;\n }\n\n foreach ($subscription_list as $key => $val)\n {\n // print_r($val);\n $pending = $val[\"total_amt_to_paid\"] - $val[\"paid_amt\"];\n\n if($total_amt_have!=0){\n\n $val[\"paid_amt\"] = $val[\"paid_amt\"] + $total_amt_have;\n\n $total_amt_have = 0;\n if($val[\"paid_amt\"]>$val[\"total_amt_to_paid\"]){\n\n $total_amt_have = $val[\"paid_amt\"] - $val[\"total_amt_to_paid\"];\n $val[\"paid_amt\"] = $val[\"total_amt_to_paid\"];\n }\n\n\n $subscription_response = $subscription->updatebydict($val,$user_id,$val[\"id\"]);\n }\n \n }\n\n if($total_amt_have >0){\n $wallet_amt = $wallet_amt + $total_amt_have;\n $user_response = $user->updatebydict(array('wallet_amt'=>$wallet_amt),$user_id);\n \n }\n\n return json_encode(\n array(\n \"success\" => array(\n \"code\" => \"201\",\n \"message\" => \"Payment was created.\",\n \"data\" => array(\n \"id\" => \"\",\n \"wallet_amt\" => $wallet_amt\n )\n )\n )\n );\n\n \n \n \n }", "public function run()\n {\n BorrowItem::create([\n 'list_id' => 1,\n 'inv_id' => 1,\n 'borrow_request_amount' => 5,\n 'borrow_actual_amount' => null,\n 'status' => 0,\n 'approver_id' => null,\n 'reason_if_not_approve' => null\n ]);\n BorrowItem::create([\n 'list_id' => 1,\n 'inv_id' => 2,\n 'borrow_request_amount' => 5,\n 'borrow_actual_amount' => null,\n 'status' => 0,\n 'approver_id' => null,\n 'reason_if_not_approve' => null\n ]);\n }", "public function add_client(array $data);", "function addItem ($userId, $item)\n\t{\n\t\t$now = date (\"Y-m-d H:i:s\");\n\n\t\t// execute the query\n\t\t$query = sprintf ($this->queries['addItem'],\n\t\t\t$userId,\n\t\t\taddslashes ($item->parentId),\n\t\t\taddslashes ($item->isParent),\n\t\t\taddslashes ($item->name),\n\t\t\taddslashes (trim ($item->description)),\n\t\t\taddslashes ($item->visibility),\n\t\t\taddslashes ($item->category),\n\t\t\taddslashes ($item->when_created),\n\t\t\taddslashes ($item->alias),\n\t\t\taddslashes (trim ($item->address)),\n\t\t\taddslashes ($item->mobile),\n\t\t\taddslashes ($item->faximile),\n\t\t\taddslashes ($item->tel_home),\n\t\t\taddslashes ($item->tel_work),\n\t\t\taddslashes ($item->organization),\n\t\t\taddslashes (trim ($item->org_address)),\n\t\t\taddslashes ($item->job),\n\t\t\taddslashes ($item->email1),\n\t\t\taddslashes ($item->email2),\n\t\t\taddslashes ($item->email3),\n\t\t\taddslashes ($item->webaddress1),\n\t\t\taddslashes ($item->webaddress2),\n\t\t\taddslashes ($item->webaddress3));\n//\t\tdie ($query);\n\n\t\t$this->db->Execute($query) or\n\t\t\t\tdie (\"Could not add contact.\".\n\t\t\t\t$this->db->ErrorMsg () . \" \" . $query);\n\n\t\t// fetch the last known id\n\t\t// todo this is generic code and is candidate to move to the base Services class\n\t\t$query = $this->queries['lastItemInsertId'];\n\t\t$result = $this->db->Execute ($query) or\n\t\t\tdie (\"Could not retrieve last insert id for contact. \".\n\t\t\t$this->db->ErrorMsg () . \" \" . $query);\n\n return $result->fields[0];\n\t}", "function addItem($userInput)\n {\n $stmt = $this->dbConnection->prepare('INSERT INTO todos (item) VALUES (:item)');\n $stmt->bindValue(':item', $userInput, PDO::PARAM_STR);\n $stmt->execute();\n $errorMsg = \"Inserted new item with ID: \" . $this->dbConnection->lastInsertId();\n $_POST=[]; \n }", "public function add_to_cart_bc($userid, $barcode, $cantidad){\n\n\t\t$articulo = $this->cila_model->get_articulo_bc($barcode);\n\t\t$carritoitem = $this->cila_model->set_carrito($userid, $articulo['articuloid'], $cantidad);\n\t\t//recuperar id\n\t\t\n\t\t$response = array(\n\t\t\t'id' => $carritoitem,\n\t\t\t'articulo' => $articulo['articuloid'],\n\t\t\t'precio' => $articulo['articuloprecio'],\n\t\t\t'descripcion' => $articulo['articulodesc'],\n\t\t\t'cantidad' => $cantidad\n\t\t);\n\t\techo json_encode($response);\n\t}", "function billing_userpanel_payment_invoiceCreate(){\n\tif(!$uid = $_SESSION['uid']){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(!$cost = intval($_REQUEST['cost'])){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(!$method = $_REQUEST['method']){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(substr($method, 0, 6)=='manual'){\n\t\treturn billing_userpanel_payment_offline();\n\t} else if(!function_exists('billing_userpanel_payment_'.$method)){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else {\n\t\t$order_id = $_REQUEST['order_id'];\n\t\tif($order_id){\n\t\t\tif(!$rs = dbq(\" SELECT COUNT(*) FROM `billing_invoice` WHERE `order_id`='$order_id' \")){\n\t\t\t\te(\"billing_userpanel_payment_invoiceCreate - \".__LINE__);\n\t\t\t} else if(dbn($rs)==0){\n\t\t\t\t;// its new, we need to insert it\n\t\t\t} else if(!$rw = dbf($rs)){\n\t\t\t\te(\"billing_userpanel_payment_invoiceCreate - \".__LINE__);\n\t\t\t} else {\n\t\t\t\t$invoiceId = $rw['id'];\n\t\t\t}\n\t\t}\n\t\tif($invoiceId){\n\t\t\t;// it already inserted\n\t\t} else if(!dbq(\" INSERT INTO `billing_invoice` (`uid`,`order_id`,`cost`,`method`) VALUES ('$uid','$order_id','$cost','$method') \")){\n\t\t\te(__LINE__.\" : \".__FILE__.\" \".dbe());\n\t\t} else {\n\t\t\t$invoiceId = dbi();\n\t\t}\n\t\tcall_user_func('billing_userpanel_payment_'.$method, $invoiceId);\n\t}\n}", "function add()\n { \n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t'BillNo' => $this->input->post('BillNo'),\n\t\t\t'PurchaseDate' => $this->input->post('PurchaseDate'),\n\t\t\t'PurchaseDateBS' => $this->input->post('PurchaseDateBS'),\n\t\t\t'SupplierName' => $this->input->post('SupplierName'),\n\t\t\t'SupplierNumber' => $this->input->post('SupplierNumber'),\n\t\t\t'SupplierAddress' => $this->input->post('SupplierAddress'),\n\t\t\t'Description' => $this->input->post('Description'),\n );\n //var_dump($params);die;\n $invoice_id = $this->Invoice_model->add_invoice($params);\n $erowindex = count($this->input->post('itemdetail'));\n\t\t\t//var_dump($erowindex);die;\n\t\t\t\tfor($i=0;$i<$erowindex;$i++){\n\t\t\t\t$paramsInvoice = array(\n\t\t\t\t'Item' => $this->input->post('Item['.$i.']'), \n\t\t\t\t'Quantity' => $this->input->post('Quantity['.$i.']'), \n\t\t\t\t'Price' => $this->input->post('Price['.$i.']'), \n\t\t\t\t'Amount' => $this->input->post('Amount['.$i.']'), \n\t\t\t\t'TAmount' => $this->input->post('TAmount'), \n\t\t\t\t'InvoiceId' => $invoice_id ,\t\n\t\t\t\t);\n\t\t\t\n\t\t\t\t//var_dump($param1);die;\n\t\t\t\t//var_dump($paramsInvoice);die;\n\t\t\t\t\t$bill = $this->GenricModel->add('invoicedetail',$paramsInvoice);\n\t\t\t\t\t;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\tredirect('invoice/index');\n }\n else\n { \n\t\t$userid = $this->session->userdata('userid');\n $data['users'] = $this->User_model->get_user($userid);\t\n $data['_view'] = 'invoice/add';\n $this->load->view('layouts/main1',$data);\n }\n }", "public function insertVehicleItem(Item $item)\n {\n $qbo = $this->container->get(\"numa.quickbooks\")->init();\n\n $title = $this->container->get(\"numa.dms.listing\")->getListingTitle($item);\n $desc = $this->getQBItemDesc($item);\n $amount = $this->getQBItemPrice($item);\n\n\n $qbItem = $this->fillQBItem($title, $desc, $item->getVIN(), $amount, \"Inventory\", true);\n return $this->insertQBItemToQB($qbItem);\n }", "public function addNewInvoice(Request $request, $id){\n $ids = Auth::user()->id;\n $user = User::find($ids);\n\n $firstName = $user->first_name;\n $lastName = $user->last_name;\n\n $name = $firstName.\" \".$lastName;\n\n $addNewInvoice = new WlgCorporationInvoice([\n 'user_id'=>$user->id,\n 'if_id'=>$id,\n 'number_of_goods'=>$request->get('no'),\n 'description_of_goods'=>$request->get('descGoods'),\n 'qty'=>$request->get('qty'),\n 'unit_price'=>$request->get('unitPrice'),\n 'total_amount'=>$request->get('totalAmount'),\n 'created_by'=>$name,\n ]);\n\n $addNewInvoice->save();\n Session::flash('successAdd', 'Successfully added');\n\n return redirect()->route('editInvoiceWlg', ['id'=>$id]);\n\n }", "public function create($id, $data=[])\n {\n // TODO validate form data\n return $this->post(\"debt/{$id}/payaccounts/create\", $data);\n }", "public function addItem(SagepayItem $item)\r\n {\r\n $this->_items[] = $item;\r\n }", "public function add($item) {\n $this->items[$item->id()] = $item;\n }", "public function buy($itemid)\n {\n //check for valid id for eg. it should be numeric\n //do buying\n\n }", "public function add($item)\n {\n $this->gridField->setRecord($item);\n $config = $this->gridField->getConfig();\n $config->removeComponentsByType(GridFieldAddNewButton::class);\n $config->removeComponentsByType(GridFieldAddExistingAutocompleter::class);\n\n }", "public function nuevo_item($sender,$param)\r\n {\r\n $item=$param->Item;\r\n if($item->ItemType==='Item' || $item->ItemType==='AlternatingItem')\r\n {\r\n $item->fecha->Text = cambiaf_a_normal($item->fecha->Text);\r\n $item->haber->Text = \"Bs. \".number_format('0', 2, ',', '.');\r\n $item->debe->Text = \"Bs. \".number_format('0', 2, ',', '.');\r\n\r\n if($item->monto->Text<0)\r\n $item->debe->Text = \"Bs. \".number_format(abs($item->monto->Text), 2, ',', '.');\r\n else\r\n $item->haber->Text = \"Bs. \".number_format($item->monto->Text, 2, ',', '.');\r\n \r\n $id=$item->id->Text;\r\n \r\n }\r\n }", "public function addComprasClientes($item) {\n $this->comprasClientes[] = $item;\n }", "public function addGhostItem(Request $request, $item);", "public function whmcs_add_invoice_payment($params = array()) {\n\t\t$params['action'] = 'AddInvoicePayment';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "public function createInvoice()\r\n {\r\n }", "function _addItem ($quantity, $rate, $weight, $length, $width, $height, $description, $readytoship=0) {\r\n $index = $this->items_qty;\r\n $this->item_quantity[$index] = (string)$quantity;\r\n $this->item_weight[$index] = ( $weight ? (string)$weight : '0' );\r\n $this->item_length[$index] = ( $length ? (string)$length : '0' );\r\n $this->item_width[$index] = ( $width ? (string)$width : '0' );\r\n $this->item_height[$index] = ( $height ? (string)$height : '0' );\r\n $this->item_description[$index] = $description;\r\n $this->item_readytoship[$index] = $readytoship;\r\n $this->items_qty ++;\r\n $this->items_price += $quantity * $rate;\r\n }", "public function create()\n\t{\n\t\t$branches = DB::table('fiametta_warehouse.tbl_branch')\n\t\t\t->where('branch_type_id',4)\n\t\t\t->where('active',1)\n\t\t\t->get();\n\t\t$contacts = Contact::where('active',1)->get();\n\t\t$items = Item::AvailableItemKiosk()->get();\n\t\treturn View::make('invoice.create')\n\t\t->with('items',$items)\n\t\t->with('branches',$branches)\n\t\t->with('contacts',$contacts);\n\t}", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function testAddIncompleteItem()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/admin/login')\n ->type('email', '[email protected]')\n ->type('password', 'password')\n ->press('Login')\n ->visit('/item/create')\n ->keys('#start-date', '2017', '{tab}', '09', '15')\n ->keys('#end-date', '2018', '{tab}', '02', '20')\n ->press('Submit')\n ->assertSee('The name field is required.')\n ->assertSee('The tokens given field is required.')\n ->assertSee('The threshold field is required.')\n ->assertSee('The short description field is required.')\n ->assertSee('The long description field is required.');\n \n });\n }" ]
[ "0.5895181", "0.586797", "0.57233477", "0.5667949", "0.55831105", "0.55056405", "0.5445344", "0.5438714", "0.5418606", "0.5398849", "0.5356569", "0.535204", "0.5320702", "0.53193676", "0.5309789", "0.5300819", "0.52761906", "0.52751493", "0.52632713", "0.523926", "0.5233082", "0.5225984", "0.52223694", "0.52134496", "0.5211997", "0.5200872", "0.5196233", "0.5166811", "0.5164076", "0.51357484", "0.5132525", "0.51072544", "0.5094806", "0.5094439", "0.509169", "0.5089237", "0.5081906", "0.50814784", "0.5080141", "0.5080141", "0.5073024", "0.5059968", "0.50564694", "0.50548553", "0.50548035", "0.5048758", "0.50412667", "0.5035973", "0.5025146", "0.50239235", "0.5023898", "0.5000564", "0.4985602", "0.4979044", "0.49767077", "0.49755424", "0.4973142", "0.49724513", "0.4971351", "0.49701813", "0.49685848", "0.49514732", "0.49509957", "0.49489358", "0.49475035", "0.4942038", "0.49387473", "0.49353933", "0.49337113", "0.4932077", "0.49294198", "0.49293593", "0.49267808", "0.49240348", "0.49232632", "0.49168423", "0.49109164", "0.49095467", "0.49065298", "0.49060562", "0.49022624", "0.49020162", "0.4895654", "0.48946327", "0.488858", "0.48859754", "0.48817247", "0.4880883", "0.4880732", "0.48790222", "0.48788083", "0.48767644", "0.4872014", "0.4867804", "0.4864278", "0.48544616", "0.48499846", "0.48457634", "0.48445332", "0.48426822" ]
0.7137854
0
This command is used to add credit to a client Parameters: clientid the ID of the client the credit is to be added to description reason for credit being added (stored in admin credit log) amount the amount to be added Optional Parameters: none See:
public function whmcs_add_credit($params = array()) { $params['action'] = 'AddCredit'; // return Whmcs_base::send_request($params); $load = new Whmcs_base(); return $load->send_request($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}", "public function add_chips_to_client($client_id,$balance)\n {\n $sql=\"UPDATE clients SET client_balance=client_balance+$balance where client_id=$client_id\";\n return $this->db->query($sql);\n }", "public function taskAddCredit($amount,$user=null,$message=null)\n\t{\n\t\t$user=$user?$user:app()->user->model();\n\t\t$credit = $user->credit;\n\t\tif(!$credit)\n\t\t{\n\t\t\t$credit = new MPaymentCredit;\n\t\t\t$credit->id = $user->id;\n\t\t\t$credit->amount = 0;\n\t\t}\n\t\t\n\t\t$credit->amount+= $amount;\n\t\t$credit->save();\n\t\t\n\t\tif($message)\n\t\t{\n\t\t\t$m = new MTransactionHistory;\n\t\t\t$m->userId = $user->id;\n\t\t\t$m->action = $amount >= 0 ? 'plus' : 'minus';\n\t\t\t$m->amount = $amount;\n\t\t\t$m->comment = $message;\n\t\t\t$m->date = time();\n\t\t\t$m->save();\n\t\t}\n\t}", "function addCredit($credit, $id) { // user_charge.php, user_charge_package_10.php\r\n\r\n\tglobal $mysqli,$db_table_prefix; \r\n\r\n\t\t$stmt = $mysqli->prepare(\"UPDATE \".$db_table_prefix.\"user_credits\r\n\r\n\t\t\tSET\r\n\r\n\t\t\tcredits = credits + ?\r\n\r\n\t\t\tWHERE\r\n\r\n\t\t\tuser_id = ?\r\n\t\t\t\r\n\t\t\tAND credits >= 0\");\r\n\r\n\t$stmt->bind_param(\"ii\", $credit, $id);\r\n\r\n\t$result = $stmt->execute();\r\n\r\n\t$stmt->close();\t\r\n\r\n\treturn $result;\r\n\r\n}", "public function addCredits($input) {\n\t\tif(!Validator::UnsignedNumber($input)) throw new Exception(lang('error_128'));\n\t\tif(!$this->_configId) throw new Exception(lang('error_126'));\n\t\tif(!$this->_identifier) throw new Exception(lang('error_127'));\n\t\t\n\t\t// get configs\n\t\t$config = $this->showConfigs(true);\n\t\t\n\t\t// check online\n\t\tif($config['config_checkonline']) {\n\t\t\tif($this->_isOnline($config['config_user_col_id'])) throw new Exception(lang('error_28'));\n\t\t}\n\t\t\n\t\t// check current credits\n\t\t$currentCredits = $this->getCredits();\n\t\t\n\t\t// choose database\n\t\t$database = $config['config_database'] == \"MuOnline\" ? $this->muonline : $this->memuonline;\n\t\t\n\t\t// build query\n\t\t$data = array(\n\t\t\t'credits' => $input,\n\t\t\t'identifier' => $this->_identifier\n\t\t);\n\t\t$variables = array('{TABLE}','{COLUMN}','{USER_COLUMN}');\n\t\t$values = array($config['config_table'], $config['config_credits_col'], $config['config_user_col']);\n\t\t\n\t\tif(check($currentCredits)) {\n\t\t\t$query = str_replace($variables, $values, \"UPDATE {TABLE} SET {COLUMN} = {COLUMN} + :credits WHERE {USER_COLUMN} = :identifier\");\n\t\t} else {\n\t\t\t$query = str_replace($variables, $values, \"UPDATE {TABLE} SET {COLUMN} = :credits WHERE {USER_COLUMN} = :identifier\");\n\t\t}\n\t\t\n\t\t// add credits\n\t\t$addCredits = $database->query($query, $data);\n\t\tif(!$addCredits) throw new Exception(lang('error_129'));\n\t\t\n\t\t$this->_addLog($config['config_title'], $input, \"add\");\n\t}", "public function additionCredit()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `credit`(`idmcr`, `pricecr`, `crdate`, `pricetcr`, `paymentcr`, `crpayment`, `bankdate`, `checkno`, `bankname`)\n VALUES ('$this->idmcr' ,'$this->pricecr' ,'$this->crdate' ,'$this->pricetcr' ,'$this->paymentcr' ,'$this->crpayment'\n ,'$this->bankdate' ,'$this->checkno' ,'$this->bankname')\");\n $result = $sql->execute();\n $idcr = $dbh->lastInsertId();\n return array ($result,$idcr);\n }", "function pnh_add_credits()\r\n\t{\r\n\t\t$user=$this->auth(PNH_ADD_CREDIT);\r\n\t\t$data['page']=\"pnh_add_credit\";\r\n\t\t$this->load->view(\"admin\",$data);\r\n\t}", "function add_money() {\n\t\t$coupon_id = $_REQUEST['coupon_id'];\n\t\t$coupon_amount = $_REQUEST['coupon_amount'];\n\t\t$user_id = $_REQUEST['recharge_user_id'];\n\t\t$user_amount = $_REQUEST['recharge_amount'];\n\t\t$transaction_id = $_REQUEST['transection_id'];\n\t\t$final_amount = $coupon_amount + $user_amount;\n\t\t//\t$wt_type=$_POST['wt_type']; //1- debit in account, 2- credit in account\n\t\t$wt_type = 1;\n\t\t// credit\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t$wt_category = 1;\n\t\t// 1-Add moeny, 2-Recharge\n\t\t$w_category = 6;\n\t\t$w_desc = \"Amount Recieved when add money \" . $user_amount . \" with get amount \" . $coupon_amount;\n\t\t$wt_desc = \"Add Money\";\n\t\tif (!empty($user_id) && !empty($user_amount) && !empty($transaction_id)) {\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t$user_wallet = $wallet_amount + $final_amount;\n\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $user_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\"');\n\t\t\tif (!empty($add_money)) {\n\t\t\t\tif (!empty($coupon_id)) {\n\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('coupon_details', 'coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\tif ($add_money) {\n\t\t\t\t\t\t$records_coupon = $this -> conn -> get_table_row_byidvalue('offer_coupon', 'coupon_id', $coupon_id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$coupon_count = $records_coupon['0']['coupon_limit'];\n\t\t\t\t\t\tif($coupon_count>0){\n\t\t\t\t\t\t\t$data_coupon['coupon_limit'] = $coupon_count - 1;\n\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('offer_coupon', 'coupon_id', $coupon_id, $data_coupon);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$transaction_ids = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $coupon_amount . '\",\"' . $w_category . '\",\"' . $transaction_ids . '\",\"' . $w_desc . '\",\"' . $transaction_id . '\"');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$data['wallet_amount'] = $user_wallet;\n\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\t\t\t\t$post = array(\"status\" => \"true\", 'message' => \"Add amount successfully\", \"transaction_id\" => $transaction_id, 'add_amount' => $user_amount, 'wallet_amount' => $user_wallet, 'transaction_date' => $current_date);\n\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Transaction Failed\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'recharge_user_id' => $user_id, 'recharge_amount' => $user_amount, 'transection_id' => $transection_id);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public static function addClient($client) {\n \n $sql = \"INSERT INTO clients VALUES(NULL\";\n $sql .= \", \" . $client->userGroupId;\n $sql .= \", \" . quote($client->uid);\n $sql .= \", \" . quote($client->lastName, true);\n $sql .= \", \" . quote($client->firstName, true);\n $sql .= \", \" . quote($client->sex);\n $sql .= \", \" . quoteDate($client->birth);\n $sql .= \", \" . quote($client->img);\n $sql .= \", \" . now(); // date_created\n $sql .= \", \" . toBoolInt($client->active);\n $sql .= \", \" . quote($client->cdata1, true);\n $sql .= \", \" . quote($client->cdata2, true);\n $sql .= \", \" . quote($client->cdata3, true);\n $sql .= \", \" . quote($client->cdata4, true);\n $sql .= \", \" . quote($client->cdata5, true);\n $sql .= \", \" . quote($client->cdata6, true);\n $sql .= \", NULL\"; \n $sql .= \", NULL\";\n $sql .= \", \" . quote($client->notes, true);\n $sql .= \", NULL\"; // date_updated\n $sql .= \")\";\n $id = insert($sql);\n \n return $id;\n }", "public function add_client(array $data);", "public function add() {\n\t\t$data = array();\t\n\t\t// add page title\n\t\t$this->output->append_title('Add New Client');\n\t\t// add breadcrumbs\n\t\t\n\t\t$this->breadcrumb->populate(array(\n\t\t\t'Dashboard' => parent::$module.'/dashboard',\n\t\t\t'users' => parent::$module.'/clients',\n\t\t\t'Add Client'\n\t\t));\n\t\t// process form\n\t\tif($this->input->post())\n\t\t{\n\t\t\t// set validation rules\n\t\t\t$this->form_validation->set_rules('client_first_name', 'First Name', 'trim|required');\n\t\t\t$this->form_validation->set_rules('client_last_name', 'Last Name', 'trim|required');\n\t\t\t$this->form_validation->set_rules('client_address', 'Client Address', 'trim|required');\n\t\t\t$this->form_validation->set_rules('client_url', '', 'trim');\n\t\t\t$this->form_validation->set_rules('email', 'Email', 'trim|edit_unique[users.email]');\n\t\t\t$this->form_validation->set_rules('client_phone_number', 'Phone Number', 'trim|required');\n\t\t\t$this->form_validation->set_rules('client_fb_page_url', '', 'trim');\n\t\t\t$this->form_validation->set_rules('client_twitter_page_url', '', 'trim');\n\t\t\t$this->form_validation->set_rules('client_website_url', '', 'trim');\n\t\t\t$this->form_validation->set_rules('client_timezone', 'Client Timezone', 'trim|required');\n\t\t\t\n\t\t\t\n\t\t\t// validate form\n\t\t\tif($this->form_validation->run() == TRUE)\n\t\t\t{\n\n\t\t\t\t// Create client\n\t\t\t\t$user = Sentry::createUser(array(\n\t\t\t\t\t'first_name' => $this->input->post('client_first_name'),\n\t\t\t\t\t'last_name' => $this->input->post('client_last_name'),\n\t\t\t\t\t'address' => $this->input->post('client_address'),\n\t\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t\t'password' => $this->input->post('password'),\n\t\t\t\t\t'country_code' => $this->input->post('client_country_code'),\n\t\t\t\t\t'phone_number' => $this->common->formatPhoneNumber($this->input->post('client_country_code'),$this->input->post('client_phone_number'),true),\n\t\t\t\t\t'timezone' => $this->input->post('client_timezone'),\n\t\t\t\t\t'activated' => true\n\t\t\t\t));\n\t\t\t\t$user_id = $user->getId(); // get user id\n\t\t\t\t\n\t\t\t\t// Find the group using the group id\n\t\t\t\t$adminGroup = Sentry::findGroupById(CLIENT_GROUP_ID); // \n\n\t\t\t\t// Assign the group to the user\n\t\t\t\t$user->addGroup($adminGroup);\n\t\t\t\t\n\t\t\t\t$data = array(\n\t\t\t\t 'client_url' => prep_url($this->input->post('client_url')),\n\t\t\t\t 'client_fb_page_url' => prep_url($this->input->post('client_fb_page_url')),\n\t\t\t\t 'client_twitter_page_url' => prep_url($this->input->post('client_twitter_page_url')),\n\t\t\t\t 'client_website_url' => prep_url($this->input->post('client_website_url')),\n\t\t\t\t 'user_id' => $user_id,\n\t\t\t\t 'created_on' => CURRENT_DATETIME,\n\t\t\t\t 'updated_on' => CURRENT_DATETIME,\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$data = $this->security->xss_clean($data); // filter data & remove malicious code \n\t\t\t\t$this->client_model->insert($data); \n\t\t\t\t\n\t\t\t\t$url = website_url('admin');\n\t\t\t\t\n\t\t\t\t$subject = 'Client Account Creation';\n\t\t\t\t$template_data = array(\n\t\t\t\t\t'email_title' => 'Client Account Creation',\n\t\t\t\t\t'email_heading' => 'Hello '.$this->input->post('client_first_name').' '.$this->input->post('client_last_name'),\n\t\t\t\t\t'email_body' => 'Your account has been created.<br/>\n\t\t\t\t\tYour account details are:<br/>\n\t\t\t\t\tEmail: '.$this->input->post('email').'<br/>\n\t\t\t\t\tPassword: '.$this->input->post('password').'<br/>\n\t\t\t\t\t<br/>Please click on the following link to login:<br/> <a href=\"'.$url.'\">'.$url.'</a><br/>\n\t\t\t\t\tIf clicking the link does not work, please copy and paste the URL into your browser instead.<br/>\n\t\t\t\t\t'\n\t\t\t\t);\n\n\t\t\t\t$body = $this->parser->parse('emails/user_registration', $template_data,TRUE);\n\t\t\t\tif($this->common->sendEmail($email,$subject,$body))\n\t\t\t\t{\n\t\t\t\t\t$this->message->set('success', 'Client added successfully.', TRUE, 'message');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->message->set('warning', 'Unable to send email, please try again later.', TRUE, 'message');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tredirect(website_url('users'));\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->message->set('danger', $this->message->validation_errors());\n\t\t\t}\n\t\t}\n\t\t\n\t\t// create form fields\n\t\t$data['client_first_name'] = array('name' => 'client_first_name',\n\t\t\t'autofocus' => 'autofocus',\n\t\t\t'id' => 'client_first_name',\n\t\t\t'placeholder' => 'First Name',\n\t\t\t'class' => 'form-control',\n\t\t\t'maxlength' => 50,\n\t\t\t'value' => $this->form_validation->set_value('client_first_name')\n\t\t);\n\t\t\n\t\t$data['client_last_name'] = array('name' => 'client_last_name',\n\t\t\t'id' => 'client_last_name',\n\t\t\t'placeholder' => 'Last Name',\n\t\t\t'class' => 'form-control',\n\t\t\t'maxlength' => 50,\n\t\t\t'value' => $this->form_validation->set_value('client_last_name')\n\t\t);\n\t\t\n\t\t$data['client_url'] = array('name' => 'client_url',\n\t\t\t'id' => 'client_url',\n\t\t\t'placeholder' => 'Client URL',\n\t\t\t'class' => 'form-control',\n\t\t\t'maxlength' => 100,\n\t\t\t'value' => $this->form_validation->set_value('client_url')\n\t\t);\n\t\t\n\t\t$data['client_address'] = array('name' => 'client_address',\n\t\t\t'id' => 'client_address',\n\t\t\t'placeholder' => 'Client Address',\n\t\t\t'class' => 'form-control',\n\t\t\t'maxlength' => 300,\n\t\t\t'rows' => 5,\n\t\t\t'value' => $this->form_validation->set_value('client_address')\n\t\t);\n\t\t\n\t\t$data['client_phone_number'] = array('name' => 'client_phone_number',\n\t\t\t'id' => 'client_phone_number',\n\t\t\t'placeholder' => 'Phone Number',\n\t\t\t'class' => 'form-control international-number',\n\t\t\t'maxlength' => 15,\n\t\t\t'type' => 'tel',\n\t\t\t'value' => $this->form_validation->set_value('client_phone_number')\n\t\t);\n\t\t\n\t\t$data['client_fb_page_url'] = array('name' => 'client_fb_page_url',\n\t\t\t'id' => 'client_fb_page_url',\n\t\t\t'placeholder' => 'Facebook Page URL',\n\t\t\t'class' => 'form-control',\n\t\t\t'maxlength' => 100,\n\t\t\t'value' => $this->form_validation->set_value('client_fb_page_url')\n\t\t);\n\t\t\n\t\t$data['client_twitter_page_url'] = array('name' => 'client_twitter_page_url',\n\t\t\t'id' => 'client_twitter_page_url',\n\t\t\t'placeholder' => 'Twitter Page URL',\n\t\t\t'class' => 'form-control',\n\t\t\t'maxlength' => 100,\n\t\t\t'value' => $this->form_validation->set_value('client_twitter_page_url')\n\t\t);\n\t\t\n\t\t$data['client_website_url'] = array('name' => 'client_website_url',\n\t\t\t'id' => 'client_website_url',\n\t\t\t'placeholder' => 'Website URL',\n\t\t\t'class' => 'form-control',\n\t\t\t'maxlength' => 100,\n\t\t\t'value' => $this->form_validation->set_value('client_website_url')\n\t\t);\n\t\t\n\t\t$timezones = $this->timezone->get_timezone_list(); \n\t\t\n\t\t$list=array(''=>'Select Timezone');\n\t\tforeach($timezones as $key=>$value )\n\t\t{\n\t\t\t$list[$value] = $key; \n\t\t}\n\t\t//echo '<pre>'; print_r($list);die;\n\t\t\n\t\t$data['client_timezone'] = array('name' => 'client_timezone',\n\t\t\t'additional' => array(\n\t\t\t\t\t\t\t'id' => 'client_timezone',\n\t\t\t\t\t\t\t'class' => 'form-control',\n\t\t\t\t\t\t),\n\t\t\t'value' => $list,\n\t\t\t'selected' => $this->form_validation->set_value('client_timezone')\n\t\t);\n\t\t\n\t\t$data['client_country_code'] = array('name' => 'client_country_code',\n\t\t\t'id' => 'client_country_code',\n\t\t\t'type' => 'hidden',\n\t\t\t'value' => $this->form_validation->set_value('client_country_code')\n\t\t);\n\t\t\n\t\t$data['email'] = array('name' => 'email',\n\t\t\t'id' => 'email',\n\t\t\t'placeholder' => 'Email',\n\t\t\t'class' => 'form-control',\n\t\t\t'type' => 'text',\n\t\t\t'value' => $this->form_validation->set_value('email')\n\t\t);\n\t\t\n\t\t$data['password'] = array('name' => 'password',\n\t\t\t'id' => 'password',\n\t\t\t'placeholder' => 'Password',\n\t\t\t'class' => 'form-control',\n\t\t\t'type' => 'password',\n\t\t\t'value' => $this->form_validation->set_value('password')\n\t\t);\n\t\t\n\t\t// load view\n\t\t$this->load->view(parent::$module.'/edit',$data);\n\t}", "public function credit ($number)\n {\n $req = new FortieRequest();\n $req->method('PUT');\n $req->path($this->basePath)->path($number)->path('credit');\n\n return $this->send($req->build());\n }", "public function actionAddCompanyPayment()\n {\n if (Yii::app()->request->isAjaxRequest && isset($_POST['amount']) && isset($_POST['clientID']) && isset($_POST['date'])) {\n $result = '';\n $amount = floatval($_POST['amount']);\n $clientID = intval($_POST['clientID']);\n $date = trim($_POST['date']);\n $number = trim($_POST['number']);\n\n $date = Helper::checkDate($date);\n\n $client = Clients::model()->findByPk($clientID);\n\n if ($client && $amount > 0 && preg_match('/^\\d{4}\\-\\d{2}\\-\\d{2}$/', $date)) {\n $result = ServicePayments::addJustPayment($clientID, $amount, $date,$number,'');\n }\n echo CJSON::encode($result);\n\n }\n\n }", "function add_money(){\n\t\t$coupon_id=$_REQUEST['coupon_id'];\n\t\t$coupon_amount=$_REQUEST['coupon_amount'];\n\t\t$user_id=$_REQUEST['recharge_user_id'];\n\t\t$user_amount=$_REQUEST['recharge_amount'];\n\t\t$final_amount=$coupon_amount+$user_amount;\n\t//\t$wt_type=$_POST['wt_type']; //1- debit in account, 2- credit in account\n\t\t$wt_type=1; // credit\n\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\t$wt_category=1; // 1-Add moeny, 2-Recharge\n\t\t$w_category=6; // Amount Recieved when coupon code apply\n\t\t//$card_no=$_REQUEST['card_number'];\n\t\t//$cvv_no=$_REQUEST['cvv_no'];\n\t\t$w_desc=\"Amount Recieved when add money \".$user_amount .\" with get amount \".$coupon_amount;\n\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t//$transaction_id =$_POST['recharge_transaction_id']; // if wt_category=1 then payment gateway transaction id and 2 for recharge id;\n\t\t$wt_desc=\"Add Money\"; // description of transaction like as add moeny, recharge;\n\t\tif(!empty($user_id) && !empty($user_amount) && !empty($transaction_id)){\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t$user_wallet=$wallet_amount + $final_amount;\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $user_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\"');\n\t\t\tif(!empty($add_money)){\n\t\t\t\tif(!empty($coupon_id)){\n\t\t\t\t\t\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('coupon_details','coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\tif($add_money){\n\t\t\t\t\t\t$transaction_ids= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $coupon_amount . '\",\"' . $w_category . '\",\"' .$transaction_ids . '\",\"' . $w_desc . '\",\"' . $transaction_id . '\"');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t $data['wallet_amount']=$user_wallet;\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user','user_id',$user_id, $data);\n\t\t\t\t\t$post = array(\"status\" => \"true\",'message'=>\"Add amount successfully\", \"transaction_id\" =>$transaction_id,'add_amount'=>$user_amount,'wallet_amount'=>$user_wallet,'transaction_date'=>$current_date,'card_no'=>$card_no);\n\t\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Transaction Failed\");\n\t\t\t}\n\t\t}else{\n\t\t$post = array('status' => \"false\",\"message\" => \"Missing parameter\",'recharge_user_id'=>$user_id,'recharge_amount'=>$user_amount,'card_number'=>$card_no,'cvv_no'=>$cvv_no);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "function add_client($nom, $prenom, $sexe, $date_naissance, $adresse, $tel_1, $tel_2, $ville, $dept, $cp, $mail, $pays, $id, $mdp ){\n \n $sql = \"INSERT INTO client (nom_client, prenom_client, sexe, date_naissance, adresse_client, tel_1, tel_2, ville_client, dept_client, cp_client, mail_client, pays_client, identifiant, mdp)\n VALUES(\"\n .$this->eq($nom).\",\"\n .$this->eq($prenom).\",\"\n .$this->eq($sexe).\",\"\n .$this->eq($date_naissance).\",\"\n .$this->eq($adresse).\",\"\n .$this->eq($tel_1).\",\"\n .$this->eq($tel_2).\",\"\n .$this->eq($ville).\",\"\n .$this->eq($dept).\",\"\n .$this->eq($cp).\",\"\n .$this->eq($mail).\",\"\n .$this->eq($pays).\",\"\n .$this->eq($id).\",\"\n .$this->eq($mdp).\")\";\n \n $res = $this->pdo->query($sql);\n if(!$res){\n $this->message = \"impossible d'ajouter le client\";\n return false;\n }\n return true;\n \n }", "public function action_addcreditcard() {\n $package = Model::factory('package');\n $btn_card_confirm = arr::get($_REQUEST, 'btn_card_confirm');\n $config_country['taxicountry'] = $this->country_info();\n $this->session = Session::instance();\n $errors = array();\n $userid = $this->session->get('userid');\n $postvalue = Arr::map('trim', $this->request->post());\n\n $getadmin_profile_info = $package->getadmin_profile_info();\n\n\n $post_values = Securityvalid::sanitize_inputs($postvalue);\n $billing_card_info_details = $package->billing_card_info_details();\n if (empty($billing_card_info_details)) {\n $billing_info_id = '';\n } else {\n $billing_info_id = $billing_card_info_details[0]['_id'];\n }\n if (isset($btn_card_confirm) && Validation::factory($_POST)) {\n $validator = $package->upgrade_plan_validate(arr::extract($post_values, array('cardnumber', 'cvv', 'expirydate', 'firstName', 'lastname', 'address', 'postal_code', 'terms', 'country', 'state', 'city')), $userid);\n if ($validator->check()) {\n $cardnumber = $postvalue['cardnumber'];\n $cvv = $postvalue['cvv'];\n $expirydate = explode('/', $postvalue['expirydate']);\n $firstname = $postvalue['firstName'];\n $lastname = $postvalue['lastname'];\n $address = $postvalue['address'];\n $city = $postvalue['city'];\n $country = $postvalue['country'];\n $state = $postvalue['state'];\n $postal_code = $postvalue['postal_code'];\n $package_upgrade_time = PACKAGE_UPGRADE_TIME;\n $cardnumber = preg_replace('/\\s+/', '', $cardnumber);\n \n $this->billing_info['card_number'] = $cardnumber;\n $this->billing_info['cvv'] = $cvv;\n $this->billing_info['expirationMonth'] = $expirydate[0];\n $this->billing_info['expirationYear'] = $expirydate[1];\n $this->billing_info['firstName'] = $firstname;\n $this->billing_info['lastname'] = $lastname;\n $this->billing_info['address'] = $address;\n $this->billing_info['city'] = $city;\n $this->billing_info['country'] = $country;\n $this->billing_info['state'] = $state;\n $this->billing_info['postal_code'] = $postal_code;\n $this->billing_info['createdate'] = $package_upgrade_time; \n $this->billing_info['currency']=CLOUD_CURRENCY_FORMAT; \n $billing_info_reg = $package->billing_registration($this->billing_info, $billing_info_id);\n if ($billing_info_reg) {\n Message::success(__('billing_updated_sucessfully'));\n }\n } else {\n $errors = $validator->errors('errors');\n }\n }\n $view = View::factory(ADMINVIEW . 'package_plan/addcreditcard')\n ->bind('postedvalues', $this->userPost)\n ->bind('errors', $errors)\n ->bind('getadmin_profile_info', $getadmin_profile_info)\n ->bind('subscription_cost_month', $subscription_cost_month)\n ->bind('billing_card_info_details', $billing_card_info_details)\n ->bind('all_country_list', $config_country['taxicountry'])\n ->bind('setup_cost', $setup_cost)\n ->bind('postvalue', $post_values);\n $this->template->title = CLOUD_SITENAME . \" | \" . __('add_credit_card');\n $this->template->page_title = __('add_credit_card');\n $this->template->content = $view;\n }", "public function credit(RequestInterface $request);", "public function addCreditCard($customer_id, $body)\n {\n \n // verify the required parameter 'customer_id' is set\n if ($customer_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $customer_id when calling addCreditCard');\n }\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $body when calling addCreditCard');\n }\n \n // parse inputs\n $resourcePath = \"/customer/{customer_id}/credit_card\";\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n $method = \"POST\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n // path params\n if ($customer_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"customer_id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($customer_id),\n $resourcePath\n );\n }\n \n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } else if (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n \n \n // make the API Call\n try\n {\n list($response, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, $method,\n $queryParams, $httpBody,\n $headerParams, '\\Tpaga\\Model\\CreditCard'\n );\n \n if (!$response) {\n return null;\n }\n\n return $this->apiClient->getSerializer()->deserialize($response, '\\Tpaga\\Model\\CreditCard', $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 201:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\CreditCard', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 422:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\ApiError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n \n return null;\n \n }", "public function addCredits($amount)\n {\n $credit = $this->credit;\n $credit->amount = $credit->amount + $amount;\n $credit->save();\n return $credit;\n }", "public function addClient( $data = array() ) { \t\n\n $url = $this->_base_url . 'clients';\n $options['data']['client'] = $data;\n $options['post'] = true;\n $this->_callAPI($url, $options);\n }", "function add($message = '') {\n\t$add_certificates = open_table_form('Add New Certificate Amount','add_certificates_amount',SITE_ADMIN_SSL_URL.'?sect=retcustomer&mode=certificateamountnewcheck&lid='.$_GET['lid'],'post',$message);\n\t$add_certificates .= $this->form();\n\t$add_certificates .= close_table_form();\n return $add_certificates;\n }", "public function addCredits($observer)\n{ \n\n$creditmemo = $observer->getCreditmemo();\n//Mage::log($creditmemo);\n//Mage::log($creditmemo->getBaseGrandTotal());\n $order = $creditmemo->getOrder();\n//Mage::log($order);\n$store_id = $order->getStoreId();\n$website_id = Mage::getModel('core/store')->load($store_id)->getWebsiteId();\n$website = Mage::app()->getWebsite($website_id); \n//Mage::log( $website->getName());\n$sName = Mage::app()->getStore($store_id)->getName();\n//Mage::log( $sid);\n//Mage::log(Mage::getSingleton('adminhtml/session')->getTotal()['status']);\n\n\nif (Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig())\n{\n // Deduct the credits which are gained at the time of invoice\n\n $credits = array(); \n $currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n $nowdate = date('Y-m-d H:m:s', $currentTimestamp);\n $credits['c_id'] = $order->getCustomerId();\n $credits['order_id'] = $order->getIncrementId();\n $credits['website1'] = 'Main Website';\n $credits['store_view'] = $sName;\n $credits['action_date'] = $nowdate;\n $credits['action'] = \"Deducted\";\n $credits['customer_notification_status'] = 'Notified';\n $credits['state'] = 1; \n //$credits['custom_msg'] = 'By admin : Deducted the Credits of the Order ' . $credits['order_id'] ;\n\n foreach ($creditmemo->getAllItems() as $item) {\n $orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n $data = $orderItem->getData();\n\n //Mage::log($data);\n $credits['action_credits'] = - ($data[0]['credits'] * $item->getQty());\n\n $collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$order->getCustomerId())->addFieldToFilter('website1','Main Website')->getLastItem();\n\n $totalcredits = $collection->getTotalCredits();\n $credits['total_credits'] = $totalcredits + $credits['action_credits'] ;\n $credits['custom_msg'] = \"By User:For Return The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n $credits['item_id'] = $item->getOrderItemId();\n $table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n $table1->setData($credits);\n try{\n if($credits['action_credits'] != 0)\n $table1->save();\n }catch(Exception $e){\n Mage::log($e);\n }\n }\n\n// End Deduct the credits which are gained at the time of invoice\n\n}\n//end\n$status = array();\n$status = Mage::getSingleton('adminhtml/session')->getTotal(); \nif($status['status'] == 1)\n { \n\n $val = array(); \n \n \n $val['c_id'] = $order->getCustomerId();\n \n $val['order_id'] = $order->getIncrementId();\n \n $val['website1'] = $website->getName();\n \n $val['store_view'] = $sName;\n \n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$val['c_id'])->addFieldToFilter('website1',$val['website1'])->getLastItem();\n $currentCurrencyRefund1 = array();\n $currentCurrencyRefund1 = Mage::getSingleton('adminhtml/session')->getTotal();\n $currentCurrencyRefund = $currentCurrencyRefund1['credits'];\n/*------------------------Convert Current currency(refunded amount is current currency) to credit points-------------- */\n$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n$baseCurrency;\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseCurrency = $currentCurrencyRefund/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseCurrency = $currentCurrencyRefund;\n }\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\nif(isset($array2)){\n$refundCredits = round(($array2['credits'] * $baseCurrency) / $array2['basevalue']); \n}\nelse{\n$refundCredits = round($baseCurrency);\n}\n/*---------------------end------------------ */\n $val['action_credits'] = $refundCredits;\n $val['total_credits'] = $collection->getTotalCredits() + $refundCredits;\n $val['action_date'] = $nowdate; \n $val['action'] = \"Refunded\";\n $val['custom_msg'] = 'By admin : return product by customer to the order ' . $val['order_id'] ;\n $val['customer_notification_status'] = 'Notified'; \n $val['state'] = 0;\n//Mage::getSingleton('adminhtml/session')->unsTotal();\n$model = Mage::getSingleton('kartparadigm_storecredit/creditinfo');\n//Mage::log($creditmemo->getDiscountAmount());\n//Mage::log($creditmemo->getDiscountDescription());\n//checking \nif($creditmemo->getDiscountDescription() == \"Store Credits\"){\n$total = $creditmemo->getGrandTotal() - ($creditmemo->getDiscountAmount());\n}\nelse{\n$total = $creditmemo->getGrandTotal();\n}\n$model->setData($val);\ntry{\nif($total >= $currentCurrencyRefund){\nif( $currentCurrencyRefund > 0)\n{\n\n$model->save();\n\n}\n}\nelse{\n\nMage::getSingleton('adminhtml/session')->setErr('true');\n\n}\n\n} catch(Mage_Core_Exception $e){\n//Mage::log($e);\n}\n\n}\n}", "public function add()\n {\n echo '客户需求添加一个新需求' . PHP_EOL;\n }", "protected function creditClientWalletOnPendingRequest($request, $serviceRequest, $actionUrl){\n $creditWallet = new WalletTransaction;\n $creditWallet['user_id'] = $serviceRequest->client_id;\n $creditWallet['payment_id'] = $serviceRequest['payment']['id'];\n $creditWallet['amount'] = $serviceRequest['price']['amount'];\n $creditWallet['payment_type'] = 'refund';\n $creditWallet['unique_id'] = $serviceRequest['client']['client']['unique_id'];\n $creditWallet['transaction_type'] = 'credit';\n\n //Check if client has at least a record on the `wallet_transactions` table\n if (!WalletTransaction::where('unique_id', $serviceRequest['client']['client']['unique_id'])->exists()) {\n $creditWallet['opening_balance'] = 0;\n $creditWallet['closing_balance'] = (float)$serviceRequest['price']['amount'];\n }else{\n $previousWallet = WalletTransaction::where('user_id', $serviceRequest->client_id)->latest('created_at')->first();\n $creditWallet['opening_balance'] = (float)$previousWallet->closing_balance;\n $creditWallet['closing_balance'] = (float)$previousWallet->closing_balance + (float)$serviceRequest['price']['amount'];\n }\n\n // save record\n $creditWallet->save();\n\n if($creditWallet){\n if($request->user()->type->role->slug == 'client-user'){\n\n //Record service request progress of `Client cancelled job request`\n ServiceRequestProgress::storeProgress($serviceRequest->client_id, $serviceRequest->id, 3, SubStatus::where('uuid', '06dda2af-3831-41af-854d-595e4f6f6b77')->firstOrFail()->id);\n \n $this->log('Request', 'Informational', $actionUrl, $serviceRequest['client']['account']['first_name'].' '.$serviceRequest['client']['account']['last_name'].' cancelled '.$serviceRequest['unique_id'].' job and the wallet account is credited with ₦'. $serviceRequest['price']['amount'].' as refund on pending service request cancellation.');\n \n }else{\n //Record service request progress of `Admin cancelled job request`\n ServiceRequestProgress::storeProgress(1, $serviceRequest->id, 3, SubStatus::where('uuid', '8aebf411-23ba-4ad0-8890-0918ac239376')->firstOrFail()->id);\n \n $this->log('Request', 'Informational', $actionUrl, $request->user()->email.' credited '.$serviceRequest['client']['account']['first_name'].' '.$serviceRequest['client']['account']['last_name'].' wallet account with ₦'. $serviceRequest['price']['amount'].' as refund on pending service request cancellation.');\n }\n }\n \n }", "function add_client(){\n\n\t\t$client[\"nome\"] = $_POST[\"process_client_nome\"];\n\t\t$client[\"numero_cliente\"] = $_POST[\"process_client_numero_cliente\"];\n\t\t$client[\"balcao\"] = $_POST[\"process_client_balcao\"];\n\t\t$client[\"telemovel\"] = $_POST[\"process_client_telemovel\"];\n\t\t$client[\"nipc\"] = $_POST[\"process_client_nipc\"];\n\n\t\t$sql = \"INSERT INTO clients SET \";\n\t\t$sql .= \" `nome` = '\".$client[\"nome\"].\"', \";\n\t\t$sql .= \" `numero_cliente` = '\".$client[\"numero_cliente\"].\"', \";\n\t\t$sql .= \" `balcao` = '\".$client[\"balcao\"].\"', \";\n\t\t$sql .= \" `telemovel` = '\".$client[\"telemovel\"].\"', \";\n\t\t$sql .= \" `nipc` = '\".$client[\"nipc\"].\"'\";\n\n\t\t$insert = mysql_query($sql) or die_sql( $query );\n\t\tif($insert){\n\t\t\t$sql = \"SELECT id FROM clients where numero_cliente = \".$client[\"numero_cliente\"];\n\t\t\t$sql = \"select id from clients order by id desc limit 1\";\n\t\t\t$client_id_result = mysql_fetch_object(mysql_query($sql));\n\t\t\t$client_id = $client_id_result->id;\n\t\t\treturn $client_id;\n\t\t}\n\n\t\treturn false;\n\n\t}", "function addLine($accountid, $valor, $side) {\n $objline = new Icontaaccountingdebcred($this->db);\n $objline->fk_accountid = $accountid; //@porhacer: agregar constraint en base de datos accountid debe estar en la tabla de cuentas\n $objline->amount = $valor;\n $objline->direction = $side;\n $objline->fk_transaction = $this->id;\n $result = $objline->create($user);\n if ($result < 0) {\n $this->error = $objline->error;\n return (-1);\n } else {\n return($result);\n }\n }", "public function createUpdateClient(): void\n {\n $ClientEntity = new Client();\n foreach ($this->fieldsToFill as $field) {\n $result = $this->getCreateInput(\n sprintf(self::INSERT_BASE_MESSAGE, $field['label']),\n [ClientValidation::class, sprintf('isValid%s', $field['fieldName'])],\n [$ClientEntity, sprintf('set%s', $field['fieldName'])]\n );\n if (!$result) {\n print \"Returning to the main menu.\";\n\n return;\n }\n }\n $this->repository->persist($ClientEntity);\n print \"New client registered with success!\\n\";\n }", "function insert_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n $form['creditcard_status'] = 'active';\n $form['default_card'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no';\n }\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"creditcards\n (cc_id, date_added, date_updated, user_id, creditcard_number, creditcard_expiry, cvv2, name_on_card, phone_of_cardowner, email_of_cardowner, card_billing_address1, card_billing_address2, card_city, card_state, card_postalzip, card_country, creditcard_status, default_card, creditcard_type, authorized) \n VALUES(\n NULL,\n '\" . DATETIME24H . \"',\n '\" . DATETIME24H . \"',\n '\" . intval($userid) . \"',\n '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n '\" . $ilance->db->escape_string($form['expmon'] . $form['expyear']) . \"',\n '\" . intval($form['cvv2']) . \"',\n '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n '\" . $ilance->db->escape_string($form['phone']) . \"',\n '\" . $ilance->db->escape_string($form['email']) . \"',\n '\" . $ilance->db->escape_string($form['address1']) . \"',\n '\" . $ilance->db->escape_string($form['address2']) . \"',\n '\" . $ilance->db->escape_string($form['city']) . \"',\n '\" . $ilance->db->escape_string($form['state']) . \"',\n '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n '\" . $ilance->db->escape_string($form['countryid']) . \"',\n '\" . $ilance->db->escape_string($form['creditcard_status']) . \"',\n '\" . $ilance->db->escape_string($form['default_card']) . \"',\n '\" . $ilance->db->escape_string($form['type']) . \"',\n '\" . $ilance->db->escape_string($form['authorized']) . \"')\n \", 0, null, __FILE__, __LINE__);\n $cc_id = $ilance->db->insert_id(); \n $ilance->email->mail = fetch_user('email', $userid);\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_added_new_card');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('member_added_new_card_admin');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n return true;\n }", "function creditTransactionInsert($generals_id, $data, $totalProductCost, $otherProductCost, $newCylinderProductCost)\n {\n //58 account receiable head debit\n\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'debit' => $this->input->post('netTotal'), //sales - discount= grand + vat =newNettotal\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n\n\n //59 Prompt Given Discounts\n if (!empty($data['discount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '59',\n 'debit' => $data['discount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //49 Sales head credit\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '49',\n 'credit' => array_sum($this->input->post('price')),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //60 Sales tax/vat head credit\n if (!empty($data['vatAmount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '60',\n 'credit' => $data['vatAmount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //62 Cost of Goods-Retail head debit\n if (!empty($totalProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '62',\n 'debit' => $totalProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //52 account Inventory head credit\n if (!empty($otherProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '52',\n 'credit' => $otherProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //cylinder product stock.\n if (!empty($newCylinderProductCost)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '173',\n 'credit' => $newCylinderProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n //loader account head credit\n //transportation account head credit\n //loader and transportation account receiaveable head debit against credit\n\n $loaderAmount = $this->input->post('loaderAmount');\n $transportationAmount = $this->input->post('transportationAmount');\n if (!empty($loaderAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '391',\n 'credit' => $loaderAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n if (!empty($transportationAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '392',\n 'credit' => $transportationAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n }", "function addContractHandler1() {\n global $inputs;\n\n $cid = insert('contract',[\n 'title' => $inputs['title'],\n 'content' => $inputs['content'],\n 'status' => $inputs['status'],\n ]);\n\n insert('user_contract',[\n 'user_type' => $inputs['role'],\n 'uid' => $inputs['id'],\n 'contract_id' => $cid,\n ]);\n\n formatOutput(true, 'add success');\n}", "public function created(Credit $credit)\n {\n }", "public function add(){\n\t\t$this->check_role_access(1);\n\t\t// set the page title\t\t\n\t\t$this->set('title_for_layout', 'Create Client - Clients - Manage Hiring');\t\n\t\t$this->load_static_data();\n\t\t$this->set('statusList', array('0' => 'Active', '1' => 'Inactive'));\n\t\t$this->set('titleList', array('1' => 'Mr.', '2' => 'Ms.'));\n\t\tif ($this->request->is('post')){\n\t\t\t// validates the form\n\t\t\t$this->request->data['Client']['created_by'] = $this->Session->read('USER.Login.id');\n\t\t $this->request->data['Client']['created_date'] = $this->Functions->get_current_date();\n\t\t\t$this->request->data['Client']['update_date'] = $this->Functions->get_current_date();\n\t\t\t$this->request->data['Client']['status'] = 2;\n\t\t\t$this->request->data['Client']['is_inactive'] = 'N';\n\t\t\t$this->Client->set($this->request->data);\n\t\t\t// retain the district\n\t\t\t$this->get_district_list($this->request->data['Client']['state']);\n\t\t\t// validate the client contacts\n\t\t\t$contact_validate = $this->validate_contact();\n\t\t\t// validate the form fields\n\t\t\tif ($this->Client->validates(array('fieldList' => array('client_name','city','pincode','state','res_location_id',\n\t\t\t'account_holder'))) && $contact_validate){\t\t\t\t\t\n\t\t\t\t// save the data\n\t\t\t\tif($this->Client->save($this->request->data['Client'], array('validate' => false))){\n\t\t\t\t\t// save client contact list\n\t\t\t\t\t$this->save_client_contact_list($this->Client->id);\n\t\t\t\t\t// save account holder list\n\t\t\t\t\t$this->save_account_holder($this->Client->id);\n\t\t\t\t\t// update req approval status table\n\t\t\t\t\t$this->save_client_approval($this->Client->id);\n\t\t\t\t\t// send mail to approver\n\t\t\t\t\t$sub = 'Manage Hiring - Client created by '.ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name'));\n\t\t\t\t\t$from = ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name'));\n\t\t\t\t\t// get the superiors\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t$this->loadModel('Approve');\n\t\t\t\t\t$approval_data = $this->Approve->find('first', array('fields' => array('level1'), 'conditions'=> array('Approve.users_id' => $this->Session->read('USER.Login.id'))));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// get leader email address\n\t\t\t\t\t$leader_data = $this->Client->Creator->find('all', array('conditions' => array('Creator.id' => $approval_data['Approve']['level1']),'fields' => array('Creator.id',\t'Creator.first_name','Creator.last_name','Creator.email_id')));\n\t\t\t\t\t*/\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// get the Business Head\n\t\t\t\t\t$leader_data = $this->Client->Creator->find('all', array('conditions' => array('roles_id' => '39'), 'fields' => array('Creator.id',\t'Creator.first_name','Creator.last_name', 'Creator.email_id')));\n\t\t\t\t\t\n\t\t\t\t\t// get account holder name\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t$sub = 'Manage Hiring - Client created by '.ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name'));\n\t\t\t\t\t$from = ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name'));\n\t\t\t\t\t// get the Business Head\n\t\t\t\t\t$leader_data = $this->Client->Creator->find('all', array('conditions' => array('roles_id' => '39'), 'fields' => array('Creator.id',\t'Creator.first_name','Creator.last_name', 'Creator.email_id')));\n\t\t\t\t\t// get account holder name\n\t\t\t\t\t$ac_holder = $this->ClientAccountHolder->find('all', array('fields' => array(\"group_concat(User.first_name separator ', ') account_holder\"), 'order' => array('User.first_name ASC'), 'conditions' => array('ClientAccountHolder.clients_id' => $this->Client->id, \t'User.is_deleted' => 'N'), 'group' => array('User.id')));\n\t\t\t\t\t*/\n\t\t\t\t\t\n\t\t\t\t\t// if leader found\n\t\t\t\t\tif(!empty($leader_data)){\n\t\t\t\t\t\t$this->loadModel('ClientStatus');\n\t\t\t\t\t\t// make sure not duplicate status exists\n\t\t\t\t\t\t$this->check_duplicate_status($this->Client->id, $leader_data[0]['Creator']['id']);\t\t\t\n\t\t\t\t\t\t// save req. status data\n\t\t\t\t\t\t$data = array('clients_id' => $this->Client->id, 'created_date' => $this->Functions->get_current_date(), 'users_id' => $leader_data[0]['Creator']['id']);\n\t\t\t\t\t\t// save the client status\n\t\t\t\t\t\tif($this->ClientStatus->save($data, true, $fieldList = array('clients_id','created_date','users_id'))){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$ac_holder = $this->ClientAccountHolder->find('all', array('fields' => array(\"group_concat(User.first_name separator ', ') account_holder\"), 'order' => array('User.first_name ASC'), 'conditions' => array('ClientAccountHolder.clients_id' => $this->Client->id, 'User.is_deleted' => 'N')));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$vars = array('from_name' => $from, 'to_name' => ucwords($leader_data[0]['Creator']['first_name'].' '.$leader_data[0]['Creator']['last_name']), 'client_name' => $this->request->data['Client']['client_name'], 'city' => $this->request->data['Client']['city'],'account_holder' => $ac_holder[0][0]['account_holder']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// notify superiors\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!$this->send_email($sub, 'add_client', '[email protected]', $leader_data[0]['Creator']['email_id'],$vars)){\t\n\t\t\t\t\t\t\t\t// show the msg.\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Problem in sending the mail for approval...', 'default', array('class' => 'alert alert-error'));\t\t\t\t\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Client Created Successfully. After approval, it will be visible!', 'default', array('class' => 'alert alert-info'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>You have no superior to approve your request', 'default', array('class' => 'alert alert-info'));\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t// show the msg.\n\t\t\t\t\t$this->redirect('/client/');\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t// show the error msg.\n\t\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Problem in saving the data...', 'default', array('class' => 'alert alert-error'));\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Please check the validation errors...', 'default', array('class' => 'alert alert-error'));\t\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t}", "function addInvoice() {\n $stmt = $GLOBALS['con']->prepare(\"INSERT INTO invoices (customer_id, amount_due, invoice_due_date, service_id, service_name, fully_paid)\n VALUES (?, ?, ?, ?, ?, ?);\");\n $stmt->bind_param(\"ssssss\", $custId, $amountDue, $invoiceDate, $serviceId, $serviceName, $paid);\n\n\n $custId = validateInput('invoiceCustId', 'post');\n $invoiceDate = validateInput('invoiceDate', 'post');\n list($serviceId, $serviceName) = explode(\":\", validateInput('service', 'post')); // 'service id : service name'\n $paid = validateInput('fullyPaid', 'post'); // 1 === 'no' : 2 === yes'\n $amountDue = '';\n\n // Get the price of the service\n $sql = \"SELECT price FROM services WHERE id = $serviceId\";\n $result = mysqli_query($GLOBALS['con'], $sql);\n if ($result) {\n $amountDue = mysqli_fetch_assoc($result); \n $amountDue = $amountDue['price'];\n }\n\n $stmt->execute();\n $stmt->close(); \n }", "public function addCreditCardCharge($body)\n {\n \n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $body when calling addCreditCardCharge');\n }\n \n // parse inputs\n $resourcePath = \"/charge/credit_card\";\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n $method = \"POST\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n \n \n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } else if (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n \n \n // make the API Call\n try\n {\n list($response, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, $method,\n $queryParams, $httpBody,\n $headerParams, '\\Tpaga\\Model\\CreditCardCharge'\n );\n \n if (!$response) {\n return null;\n }\n\n return $this->apiClient->getSerializer()->deserialize($response, '\\Tpaga\\Model\\CreditCardCharge', $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 201:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\CreditCardCharge', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 402:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\CreditCardCharge', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 422:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\ApiError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n \n return null;\n \n }", "function ciniki_poma_accountApplyCredit(&$ciniki, $tnid, $args) {\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'orderUpdateStatusBalance');\n\n //\n // Load tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $tnid);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_timezone = $rc['settings']['intl-default-timezone'];\n\n //\n // Load the last entry in the customer ledger\n //\n $strsql = \"SELECT id, balance \"\n . \"FROM ciniki_poma_customer_ledgers \"\n . \"WHERE customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"ORDER BY transaction_date DESC \"\n . \"LIMIT 1 \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'entry');\n if( $rc['stat'] != 'ok') {\n return $rc;\n }\n if( !isset($rc['entry']) ) {\n $balance = 0;\n } else {\n $balance = $rc['entry']['balance'];\n }\n\n //\n // Apply the credit to the balance\n //\n $new_balance = bcadd($balance, $args['customer_amount'], 6);\n $credit_balance = $args['customer_amount'];\n\n //\n // Load any unpaid invoices\n //\n $strsql = \"SELECT ciniki_poma_orders.id, \"\n . \"ciniki_poma_orders.total_amount, \"\n . \"ciniki_poma_orders.balance_amount \"\n . \"FROM ciniki_poma_orders \"\n . \"WHERE ciniki_poma_orders.customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND ciniki_poma_orders.payment_status > 0 \"\n . \"AND ciniki_poma_orders.payment_status < 50 \"\n . \"AND ciniki_poma_orders.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'invoice');\n if( $rc['stat'] != 'ok') {\n return $rc;\n }\n if( isset($rc['rows']) ) {\n $unpaid_orders = $rc['rows'];\n //\n // Check if orders will get payment amounts\n //\n foreach($unpaid_orders as $oid => $order) {\n //\n // Skip any orders that might be screwed up with a negative balance\n //\n if( $order['balance_amount'] < 0 ) { \n continue;\n }\n if( $order['balance_amount'] < $credit_balance ) {\n $unpaid_orders[$oid]['payment_amount'] = $order['balance_amount'];\n $credit_balance = bcsub($credit_balance, $order['balance_amount'], 6);\n } else {\n $unpaid_orders[$oid]['payment_amount'] = $credit_balance;\n $credit_balance = 0;\n }\n if( $credit_balance <= 0 ) {\n break;\n }\n }\n }\n\n //\n // Add the ledger entry\n //\n $args['balance'] = $new_balance;\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.customerledger', $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $entry_id = $rc['id'];\n\n //\n // Apply credit to invoice if open unpaid invoices\n //\n if( isset($unpaid_orders) ) {\n foreach($unpaid_orders as $order) {\n if( isset($order['payment_amount']) && $order['payment_amount'] > 0 ) {\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.orderpayment', array(\n 'order_id'=>$order['id'],\n 'ledger_id'=>$entry_id,\n 'payment_type'=>$args['transaction_type'],\n 'amount'=>$order['payment_amount'],\n ), 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rc = ciniki_poma_orderUpdateStatusBalance($ciniki, $tnid, $order['id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n }\n }\n \n return array('stat'=>'ok', 'id'=>$entry_id);\n}", "public function add_client()\n\t{ \n\t\t// echo \"controller\"; die;\n\t\t$client_name = $this->input->post(\"customer_name\");\n\t\t//echo \"--\".$client_name; die;\n\t\t$this->load->model('operations_model'); \n $data['result'] = $this->operations_model->add_customer();\n\t\techo \"Record added Successfully\";\n\t\t// echo print_r($_POST)($data); ; die;\n\t\t\n\t}", "public function whmcs_apply_credit($params = array()) {\n\t\t$params['action'] = 'ApplyCredit';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "function addCreditCard($userDetails){\n\ttry{\n\t\t$cardRegister = new \\MangoPay\\CardRegistration();\n\t\t$cardRegister->UserId \t= $userDetails['userAccountId'];\n\t\t$cardRegister->Currency = $userDetails['userCurrency'];\n\t\t$createdCardRegister = $mangoPayApi->CardRegistrations->Create($cardRegister);\n\t\t$data\n\t\t\n\t\t$handle = curl_init();\n\t\tcurl_setopt($handle, CURLOPT_URL, $url);\n\t\tcurl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($handle, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); \n\t\tcurl_setopt($handle, CURLOPT_POST, true);\n\t\tcurl_setopt($handle, CURLOPT_POSTFIELDS, $data);\n\t\t$response = curl_exec($handle);\n\t\t\n\t\t\n\t\t\n\t}\n\tcatch(Exception $e) {\n\t\treturn $e;//error in field values\n\t}\n\n}", "public function add() {\n\t\t$entry = $this->getEntryToAdd('clov_expense');\n\t\t\n\t\t// Default to the logged-in user.\n\t\t$loggedInUser = new User;\n\t\t$entry->setAttribute('clov_expense_payer', $loggedInUser->getUserID());\n\t\t\n\t\t// If the user got here from a project page, pre-fill the project \n\t\t// attribute.\n\t\tLoader::helper('clov_url', 'clov');\n\t\tif($project = ClovUrlHelper::loadReferrerPage('clov_project')) {\n\t\t\t$entry->setAttribute('clov_expense_project', $project->getCollectionID());\n\t\t}\n\t\t\n\t\t$this->set('entry', $entry);\n\t\t$this->set('showSaveDraft', true);\n\t\t$this->render('clov/default/add');\n\t}", "function add_check_for_client(Request $request , $id){\n bankCheckController::Create([\n 'id' => $id,\n 'type' => 'client',\n 'check_date' =>$request->input('check_date'),\n 'check_value' =>$request->input('check_value'),\n 'increase_value'=>$request->input('increase_value'),\n 'check_owner' =>$request->input('check_owner')\n ]);\n # add payments to merchant from Banckcheck\n # ClientPayments::Create($id,ClientPayments::PaymentValue($id,$request->input('check_value'),'شيك'));\n return back()->with(['success'=>'تم اضافة شيك بنجاح']);\n }", "function addPostponedclients(Request $request, $id){\n ClientPayments::Create($id,ClientPayments::PaymentValue($id,$request->postponed_value,'دفعات'));\n return back()->with(['success'=>'تم تسديد دفعة بنجاح']);\n }", "public function addClient($client) {\n return $this->clientManager->add($client);\n }", "public function addCardDebit($data) {\n\t\t$soapclient = new SoapClient($this->pci);\n\n\t\t$params = [\n\t\t\t\t'DigitalKey' => $this->digitalKey,\n\t\t\t\t'YourSystemReference' => $data['systemRef'],\n\t\t\t\t'YourGeneralReference' => $data['generalRef'],\n\t\t\t\t'LastName' => $data['lastName'],\n\t\t\t\t'FirstName' => $data['firstName'],\n\t\t\t\t'EmailAddress' => $data['email'],\n\t\t\t\t'MobilePhoneNumber' => $data['phone'],\n\t\t\t\t'PaymentReference' => $data['paymentRef'],\n\t\t\t\t'NameOnCreditCard' => $data['cardName'],\n\t\t\t\t'CreditCardNumber' => $data['cardNumber'],\n\t\t\t\t'CreditCardExpiryMonth' => $data['cardExpiryMonth'],\n\t\t\t\t'CreditCardExpiryYear' => $data['cardExpiryYear'],\n\t\t\t\t'CreditCardCCV' => $data['cardCvv'],\n\t\t\t\t'PaymentAmountInCents' => $data['amountInCents'],\n\t\t\t\t'DebitDate' => $data['debitDate'],\n\t\t\t\t'SmsPaymentReminder' => $data['smsReminder'],\n\t\t\t\t'SmsFailedNotification' => $data['smsFailed'],\n\t\t\t\t'SmsExpiredCard' => $data['smsExpired'],\n\t\t\t\t'Username' => $data['username']\n\t\t];\n\n\t\treturn $soapclient->addCardDebit($params);\n\t}", "public function addClients($client_firstname,$client_lastname,$user_name,$password, $emailid, $phone_number,$street_name,$city,$postalcode,$privilege, $db)\n {\n $sql = \"INSERT INTO client_registrations (client_firstname,client_lastname,user_name,password,emailid, phone_number,street_name,city,postalcode,privilege) \n VALUES (:client_firstname,:client_lastname,:user_name,:password,:emailid,:phone_number,:street_name,:city,:postalcode,:privilege) \";\n\n $pst = $db->prepare($sql);\n\n $pst->bindParam(':client_firstname', $client_firstname);\n $pst->bindParam(':client_lastname', $client_lastname);\n $pst->bindParam(':user_name', $user_name);\n $pst->bindParam(':password', $password);\n $pst->bindParam(':emailid', $emailid);\n $pst->bindParam(':phone_number', $phone_number);\n $pst->bindParam(':street_name', $street_name);\n $pst->bindParam(':city', $city);\n $pst->bindParam(':postalcode', $postalcode);\n $pst->bindParam(':privilege', $privilege);\n\n $count = $pst->execute();\n return $count;\n }", "function add_customer()\n\t{\n\t\tglobal $db;\n\n\t\t$vals = array(\n\t\t\t'NULL',\n\t\t\t$this->preorderID,\n\t\t\tmysql_real_escape_string($this->customerinfo['fname']),\n\t\t\tmysql_real_escape_string($this->customerinfo['lname']),\n\t\t\t$this->customerinfo['amountdown'],\n\t\t\tNO\n\t\t);\n\n\t\t$sql = \"INSERT INTO preorder_customers VALUES ('\".implode(\"','\",$vals).\"')\";\n\t\tmysql_query($sql,$db);\n\t\t$this->error->mysql(__FILE__,__LINE__);\n\t}", "function addContractHandler() {\n global $inputs;\n\n $cid = insert('contract',[\n 'title' => $inputs['title'],\n 'content' => $inputs['content'],\n 'status' => $inputs['status'],\n ]);\n\n $loginInfo = getLogin();\n if (isset($loginInfo['uid']) && $loginInfo['uid'] ) {\n $userType = 'admin';\n $uid = $loginInfo['uid'];\n } else {\n $userType = 'member';\n $uid = $loginInfo['mid'];\n }\n\n insert('user_contract',[\n 'user_type' => $userType,\n 'uid' => $uid,\n 'contract_id' => $cid,\n ]);\n\n formatOutput(true, 'add success');\n}", "public function testPostApiAdminAddCard()\n {\n $client = static::createClient();\n $client->request('POST', '/api/admin/cards/add', [], [],\n [\n 'HTTP_ACCEPT' => 'application/json',\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-AUTH-TOKEN' => '72312'\n ],\n '{\n \"name\": \"NewCard\",\n \"creditCardType\": \"Visa\",\n \"creditCardNumber\": 21474837,\n \"currencyCode\": \"EUR\",\n \"value\": 50000\n }'\n );\n\n $response = $client->getResponse();\n $content = $response->getContent();\n\n $this->assertEquals(201, $response->getStatusCode());\n $this->assertJson($content);\n }", "public function add_chips_client($id,$chips)\n {\n $sql=\"UPDATE clients SET client_balance=client_balance+$chips,client_total_chips=client_total_chips+$chips WHERE client_id=$id\";\n $q=$this->db->query($sql);\n \n if($q)\n {\n return true;\n }else{\n return false;\n }\n }", "public function addCustomer($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'YourSystemReference' => $data['systemRef'],\n\t\t\t\t'YourGeneralReference' => $data['generalRef'],\n\t\t\t\t'LastName' => $data['lastName'],\n\t\t\t\t'FirstName' => $data['firstName'],\n\t\t\t\t'AddressLine1' => $data['addressLine1'],\n\t\t\t\t'AddressLine2' => $data['addressLine2'],\n\t\t\t\t'AddressSuburb' => $data['suburb'],\n\t\t\t\t'AddressState' => $data['state'],\n\t\t\t\t'AddressPostCode' => $data['postCode'],\n\t\t\t\t'EmailAddress' => $data['email'],\n\t\t\t\t'MobilePhoneNumber' => $data['phone'],\n\t\t\t\t'ContractStartDate' => $data['startDate'],\n\t\t\t\t'SmsPaymentReminder' => $data['smsReminder'],\n\t\t\t\t'SmsFailedNotification' => $data['smsFailed'],\n\t\t\t\t'SmsExpiredCard' => $data['smsExpired'],\n\t\t\t\t'Username' => $data['username']\n\t\t];\n\n\t\treturn $response = $soapclient->addCustomer($params);\n\t}", "public function c_add()\n {\n\t\t$this->getC();\n $customer = $this->Customers->newEntity();\n if ($this->request->is('post')) {\n $customer = $this->Customers->patchEntity($customer, $this->request->data);\n if ($this->Customers->save($customer)) {\n $this->Flash->success('The customer has been saved.');\n return $this->redirect(['action' => 'c_index']);\n } else {\n $this->Flash->error('The customer could not be saved. Please, try again.');\n }\n }\n $this->set(compact('customer'));\n $this->set('_serialize', ['customer']);\n }", "public function newAction()\n {\n // Layout\n $this->loadLayout();\n\n // Title\n $this->_title($this->__('Add a credit card'));\n\n // Init messages\n $this->_initLayoutMessages('mbiz_cc/session');\n\n // Active menu\n $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');\n if ($navigationBlock) {\n $navigationBlock->setActive('customer/cc');\n }\n\n // Render\n $this->renderLayout();\n }", "public function add() {\n $dataH['CustomerBankAccount'] = $_lib['sess']->get_companydef('BankAccount');\n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $dataH['CustomerAccountPlanID'] = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber')));\n }", "public function addNewCardToCustomer($card) {\n\n\t\treturn $this->request('/card', $card, 'POST');\n\t}", "public function addDonation($amount, $card){\r\n $stmt = $this->DB->prepare(\"INSERT INTO transactions VALUES(NULL, 'DONATION', NULL,NULL,NULL,:card,now(),'PROCESSED');\");\r\n $stmt->bindParam(\"card\",$card);\r\n $stmt->execute();\r\n }", "function amocrmInstall(string $clientId, string $referer, string $code): void {\n\t}", "function credit_transaction($order_id, $amount, $currency, $txn_id, $reason, $origin) {\n\n\t$type = \"CREDIT\";\n\n\t$date = (gmdate(\"Y-m-d H:i:s\"));\n\n\t$sql = \"SELECT * FROM transactions where txn_id='$txn_id' and `type`='CREDIT' \";\n\t$result = mysql_query($sql) or die(mysql_error($sql));\n\tif (mysql_num_rows($result)!=0) {\n\t\treturn; // there already is a credit for this txn_id\n\t}\n\n// check to make sure that there is a debit for this transaction\n\n\t$sql = \"SELECT * FROM transactions where txn_id='$txn_id' and `type`='DEBIT' \";\n\t$result = mysql_query($sql) or die(mysql_error($sql));\n\tif (mysql_num_rows($result)>0) {\n\n\t\t$sql = \"INSERT INTO transactions (`txn_id`, `date`, `order_id`, `type`, `amount`, `currency`, `reason`, `origin`) VALUES('$txn_id', '$date', '$order_id', '$type', '$amount', '$currency', '$reason', '$origin')\";\n\n\t\t$result = mysql_query ($sql) or die (mysql_error());\n\t}\n\n\n}", "public function addCreditNote($creditNoteDate, $total, $currency, $idCreditAddress)\n {\n $nowExpr = new Zend_Db_Expr('NOW()');\n\n $data = array(\n 'idCreditNote' => new Zend_Db_Expr('NULL'),\n 'creditNoteDate' => $creditNoteDate,\n 'total' => (float) $total,\n 'currency' => $currency,\n 'idCreditAddress' => (int) $idCreditAddress,\n 'refunded' => (int) 0,\n 'added' => $nowExpr,\n 'updated' => $nowExpr\n );\n\n try {\n $this->insert($data);\n $idInvoice = $this->_db->lastInsertId();\n\n return $idInvoice;\n } catch (Exception $e) {\n throw $e;\n }\n }", "function cashTransactionInsert($generals_id, $data, $totalProductCost, $otherProductCost, $newCylinderProductCost, $mrid)\n {\n //58 account receiable head debit\n\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'debit' => $this->input->post('netTotal'), //sales - discount= grand + vat =newNettotal\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //59 Prompt Given Discounts\n if (!empty($data['discount'])) :\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '59',\n 'debit' => $data['discount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //49 Sales head credit\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '49',\n 'credit' => array_sum($this->input->post('price')),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //60 Sales tax/vat head credit\n if (!empty($data['vatAmount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '60',\n 'credit' => $data['vatAmount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //7501 Cost of Goods-Retail head debit\n if (!empty($totalProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '62',\n 'debit' => $totalProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //52 account Inventory head credit\n if (!empty($otherProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '52',\n 'credit' => $otherProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //cylinder product stock.\n if (!empty($newCylinderProductCost)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '173',\n 'credit' => $newCylinderProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n\n //loader account head credit\n //transportation account head credit\n //loader and transportation account receiaveable head debit against credit\n $loaderAmount = $this->input->post('loaderAmount');\n $transportationAmount = $this->input->post('transportationAmount');\n if (!empty($loaderAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '391',\n 'credit' => $loaderAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n if (!empty($transportationAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '392',\n 'credit' => $transportationAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n\n\n //customer payment ledger\n $generals_data = array(\n 'form_id' => '7',\n 'customer_id' => $this->input->post('customer_id'),\n 'dist_id' => $this->dist_id,\n 'mainInvoiceId' => $generals_id,\n 'voucher_no' => $this->input->post('voucherid'),\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'credit' => $this->input->post('netTotal'),\n 'narration' => $this->input->post('narration'),\n 'updated_by' => $this->admin_id,\n 'created_at' => $this->timestamp\n );\n $generalPaymentId = $this->Common_model->insert_data('generals', $generals_data);\n //1301 Cash in Hand head debit\n $singleLedger = array(\n 'generals_id' => $generalPaymentId,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '54',\n 'debit' => $this->input->post('netTotal'),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //58 Account Receivable head credit\n $singleLedger = array(\n 'generals_id' => $generalPaymentId,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'credit' => $this->input->post('netTotal'),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //client vendor ledger\n $customerLedger1 = array(\n 'ledger_type' => 1,\n 'trans_type' => 'Sales Payment',\n 'history_id' => $generalPaymentId,\n 'trans_type' => $this->input->post('voucherid'),\n 'client_vendor_id' => $this->input->post('customer_id'),\n 'dist_id' => $this->dist_id,\n 'updated_by' => $this->admin_id,\n 'amount' => $this->input->post('netTotal'),\n 'cr' => $this->input->post('netTotal'),\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate')))\n );\n $this->db->insert('client_vendor_ledger', $customerLedger1);\n //money Receite General\n $moneyReceit = array(\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'invoiceID' => json_encode($this->input->post('voucherid')),\n 'totalPayment' => $this->input->post('netTotal'),\n 'receitID' => $mrid,\n 'mainInvoiceId' => $generals_id,\n 'dist_id' => $this->dist_id,\n 'customerid' => $this->input->post('customer_id'),\n 'narration' => $this->input->post('narration'),\n 'updated_by' => $this->admin_id,\n 'paymentType' => 1\n );\n $this->db->insert('moneyreceit', $moneyReceit);\n }", "public function addAction() {\n try {\n\n $pageHeading = \"Add-New-Order\";\n $this->view->page_heading = $pageHeading;\n $this->view->data_page = \"tables\";\n \n $objClientService = new Base_Model_Lib_Client_Service_Client();\n \n if ($this->_request->isPost()) {\n\n $ordernum = date(\"YmdHis\");\n $clientId = $this->_request->getParam('cmbClient');\n $orderDate = $this->getSystemDateTime();\n $promocode = $this->_request->getParam('cmbPromotionCode');\n $promotype = null;\n $promovalue = null;\n if ($promocode != \"\") {\n $objPromotionCodeService = new Base_Model_Lib_Catelog_Service_PromotionCode();\n $promotionCodeInfo = $objPromotionCodeService->getItem($promocode);\n $promotype = $promotionCodeInfo->getValueType();\n $promovalue = $promotionCodeInfo->getValue();\n }\n $orderdata = serialize($this->_request->getParam('orderData'));\n $paymentmethod = $this->_request->getParam('cmbPaymentMethod');\n $status = $this->_request->getParam('cmbOrderStatus');\n $ipaddress = $this->getRealIpAddr();\n $notes = $this->_request->getParam('txtOrderNotes');\n $canvasser = $this->_request->getParam('cmbCanvasser');\n $salesperson = $this->_request->getParam('cmbSalesperson');\n\n // get the client's information....\n $clientInformation = $objClientService->getClient($clientId);\n $objCurrencyService = new Base_Model_Lib_Catelog_Service_Currency();\n $defaultCurrency = $objCurrencyService->getDefaultCurrency();\n $currencyId = $defaultCurrency->getId();\n $clientName = $clientInformation->getFirstname();\n $clientEmail = $clientInformation->getEmail();\n if($clientInformation){\n if($clientInformation->getCurrency()){\n $currencyId = $clientInformation->getCurrency()->getId();\n }\n }\n \n // save the order details...............\n $objOrderService = new Base_Model_Lib_Order_Service_Order();\n $objOrderEntity = new Base_Model_Lib_Order_Entity_Order();\n $objOrderEntity->setOrdernum($ordernum);\n $objOrderEntity->setUserId($clientId);\n $objOrderEntity->setDate($orderDate);\n $objOrderEntity->setPromocode($promocode);\n $objOrderEntity->setPromotype($promotype);\n $objOrderEntity->setPromovalue($promovalue);\n $objOrderEntity->setOrderdata($orderdata);\n $objOrderEntity->setPaymentmethod($paymentmethod);\n $objOrderEntity->setStatus($status);\n $objOrderEntity->setIpaddress($ipaddress);\n $objOrderEntity->setNotes($notes);\n $objOrderEntity->setCanvasser($canvasser);\n $objOrderEntity->setSalesperson($salesperson);\n $objOrderService->order = $objOrderEntity;\n $orderId = $objOrderService->addItem();\n \n // activity log.....\n //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n // add the details to the system logs....\n $actionName = 'ADD_NEW';\n $logMessage = \"log-msg-record-added\";\n $tableName = 'tbl_orders';\n $rowId = $orderId;\n $this->addSystemLog($actionName, $logMessage, $tableName, $rowId);\n //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n \n\n // add order items......\n // get the order product details..................\n $productIds = $this->_request->getParam('cmbProductService');\n $productDomainNames = $this->_request->getParam('txtDomainName');\n $productBillingCycles = $this->_request->getParam('cmbBillingCycle');\n $productQuantitities = $this->_request->getParam('txtProductQuantity');\n $productPricies = $this->_request->getParam('txtPriceOverride');\n $productPriciesForAmt = $productPricies;\n\n $objOrderProductService = new Base_Model_Lib_Order_Service_Product();\n $objProductService = new Base_Model_Lib_Product_Service_Product();\n $objProductPricingService = new Base_Model_Lib_Product_Service_Pricing();\n $currencyId = $currencyId;\n $orderAmount = 0;\n\n $arrCpanelAccounts = array();\n foreach ($productIds As $pIndex => $productId) {\n\n $productInfo = $objProductService->getItem($productId);\n $productName = $productInfo->getProductName();\n $productPriceInfo = $objProductPricingService->getProductPriceByCurrency($productId, $currencyId, 'product');\n $productMsetupfee = $productPriceInfo->getMonthlySetupfee();\n $productQsetupfee = $productPriceInfo->getQuarterlySetupfee();\n $productSsetupfee = $productPriceInfo->getSemiAnnuallySetupfee();\n $productASsetupfee = $productPriceInfo->getAnnuallySetupfee();\n $productBsetupfee = $productPriceInfo->getBienniallySetupfee();\n $productTsetupfee = $productPriceInfo->getTrienniallySetupfee();\n $productMonthly = $productPriceInfo->getMonthlyFee();\n $productQuarterly = $productPriceInfo->getQuarterlyFee();\n $productSemiannually = $productPriceInfo->getSemiAnnuallyFee();\n $productAnnually = $productPriceInfo->getAnnuallyFee();\n $productBiennially = $productPriceInfo->getBienniallyFee();\n $productTriennially = $productPriceInfo->getTrienniallyFee();\n\n $domainName = $productDomainNames[$pIndex];\n if($productInfo->getCPanelPackage() != ''){\n $userName = substr($domainName, 0, 8);\n $userPasswrd = $this->randomPassword();\n $objCpanelAccount = new stdClass();\n $objCpanelAccount->domainName = $domainName;\n $objCpanelAccount->username = $userName;\n $objCpanelAccount->userPassword = $userPasswrd; \n $objCpanelAccount->package = $productInfo->getCPanelPackage();\n array_push($arrCpanelAccounts, $objCpanelAccount);\n }\n\n $firstPaymentAmount = \"\";\n $amount = \"\";\n $productBillingCycle = $productBillingCycles[$pIndex];\n if ($productBillingCycle == 'Monthly') {\n $firstPaymentAmount = $productMsetupfee + $productMonthly;\n $amount = $productMonthly;\n } elseif ($productBillingCycle == 'Quarterly') {\n $firstPaymentAmount = $productQsetupfee + $productQuarterly;\n $amount = $productQuarterly;\n } elseif ($productBillingCycle == 'Semi-Annually') {\n $firstPaymentAmount = $productSsetupfee + $productSemiannually;\n $amount = $productSemiannually;\n } elseif ($productBillingCycle == 'Annually') {\n $firstPaymentAmount = $productASsetupfee + $productAnnually;\n $amount = $productAnnually;\n } elseif ($productBillingCycle == 'Biennially') {\n $firstPaymentAmount = $productBsetupfee + $productBiennially;\n $amount = $productBiennially;\n } elseif ($productBillingCycle == 'Triennially') {\n $firstPaymentAmount = $productTsetupfee + $productTriennially;\n $amount = $productBiennially;\n }\n \n \n if($productPriciesForAmt[$pIndex] != ''){\n $firstPaymentAmount = $productPriciesForAmt[$pIndex];\n $amount = $productPriciesForAmt[$pIndex];\n }\n \n $objOrderProductEntity = new Base_Model_Lib_Order_Entity_Product();\n $objOrderProductEntity->setClient($clientId);\n $objOrderProductEntity->setOrder($orderId);\n $objOrderProductEntity->setProduct($productId);\n $objOrderProductEntity->setServer(null);\n $objOrderProductEntity->setRegdate($this->getSystemDateTime());\n $objOrderProductEntity->setDomain($domainName);\n $objOrderProductEntity->setDomainStatus('Active');\n $objOrderProductEntity->setPaymentMethod($paymentmethod);\n $objOrderProductEntity->setFirstPaymentAmount($firstPaymentAmount);\n $objOrderProductEntity->setAmount($amount);\n $objOrderProductEntity->setBillingCycle($productBillingCycle);\n $objOrderProductEntity->setNextDueDate(null);\n $objOrderProductEntity->setNextInvoiceDate(null);\n $objOrderProductEntity->setUsername($userName);\n $objOrderProductEntity->setPassword($userPasswrd);\n $objOrderProductEntity->setNotes(NULL);\n $objOrderProductEntity->setSubscription(NULL);\n $objOrderProductEntity->setPromotionCode($promocode);\n $objOrderProductEntity->setSuspendreason(null);\n $objOrderProductEntity->setOverideautosuspend(null);\n $objOrderProductEntity->setOveridesuspenduntil(null);\n $objOrderProductEntity->setDedicatedIp(null);\n $objOrderProductEntity->setAssignedIps(null);\n $objOrderProductEntity->setNs1(null);\n $objOrderProductEntity->setNs2(null);\n $objOrderProductEntity->setDiskusage(null);\n $objOrderProductEntity->setDisklimit(null);\n $objOrderProductEntity->setBwlimit(null);\n $objOrderProductEntity->setBwusage(null);\n $objOrderProductEntity->setLastupdate($this->getSystemDateTime());\n $objOrderProductService->product = $objOrderProductEntity;\n $objOrderProductService->addItem();\n $orderAmount = $orderAmount + $firstPaymentAmount;\n \n \n \n $actionName = 'ADD_NEW';\n $logMessage = \"log-msg-record-added-order-product\";\n $tableName = 'tbl_orders';\n $rowId = $orderId;\n $this->addSystemLog($actionName, $logMessage, $tableName, $rowId);\n \n \n }\n\n\n $domainNames = $this->_request->getParam('txtDomain');\n $domainActionType = $this->_request->getParam('rdDomainRegistration');\n $domainRegistrationPeriod = $this->_request->getParam('regperiod');\n $dNSManagements = $this->_request->getParam('chkDnsManagement');\n $emailForwarding = $this->_request->getParam('chkEmailForwarding');\n $iDProtection = $this->_request->getParam('chkIDProtection');\n \n\n // get default registar...\n $objRegistrarService = new Base_Model_Lib_System_Service_Registrars();\n $enabledRegistrars = $objRegistrarService->getAllByStatus('Enabled'); \n $enabledRegistrar = $enabledRegistrars[0];\n $defaultRegistrar = $enabledRegistrar->getName();\n \n $objSettingService = new Base_Model_Lib_System_Service_Settings();\n $generalSettingsValues = $objSettingService->getAllByType('DOMAIN_SETTINGS');\n \n $nameServer1 = \"\";\n $nameServer2 = '';\n $nameServer3 = '';\n $nameServer4 = '';\n $nameServer5 = '';\n foreach($generalSettingsValues As $gIndex=>$nameServers){\n \n if($nameServers->getSettingFieldName() == 'Default Nameserver 1'){\n $nameServer1 = $nameServers->getSettingValue();\n }\n \n if($nameServers->getSettingFieldName() == 'Default Nameserver 2'){\n $nameServer2 = $nameServers->getSettingValue();\n }\n \n if($nameServers->getSettingFieldName() == 'Default Nameserver 3'){\n $nameServer3 = $nameServers->getSettingValue();\n }\n \n if($nameServers->getSettingFieldName() == 'Default Nameserver 4'){\n $nameServer4 = $nameServers->getSettingValue();\n }\n \n if($nameServers->getSettingFieldName() == 'Default Nameserver 5'){\n $nameServer5 = $nameServers->getSettingValue();\n }\n \n \n }\n\n // add the domain details....\n\n $objDomainService = new Base_Model_Lib_Order_Service_Domain();\n\n foreach ($domainNames As $dIndex => $domainName) {\n \n \n if($domainName != '' && $domainActionType[$dIndex] != ''){\n \n $firstpaymentamount = '7.99';\n $recurringamount = '7.99';\n $orderAmount = $orderAmount + $firstpaymentamount;\n $objDomainEntity = new Base_Model_Lib_Order_Entity_Domain();\n $objDomainEntity->setClient($clientId);\n $objDomainEntity->setOrder($orderId);\n $objDomainEntity->setType($domainActionType[$dIndex]);\n $objDomainEntity->setRegistrationdate(null);\n $objDomainEntity->setRegistrarLock('Yes');\n $objDomainEntity->setDomain($domainName);\n $objDomainEntity->setFirstpaymentamount($firstpaymentamount);\n $objDomainEntity->setRecurringamount($recurringamount);\n $objDomainEntity->setRegistrar($defaultRegistrar);\n $objDomainEntity->setRegistrationperiod($domainRegistrationPeriod[$dIndex]);\n $objDomainEntity->setExpirydate(null);\n $objDomainEntity->setSubscriptionid(null);\n $objDomainEntity->setPromoid(null);\n $objDomainEntity->setStatus('Pending');\n $objDomainEntity->setNextduedate(null);\n $objDomainEntity->setNextinvoicedate(null);\n $objDomainEntity->setAdditionalnotes(null);\n $objDomainEntity->setPaymentmethod($paymentmethod);\n $objDomainEntity->setDnsmanagement($dNSManagements[$dIndex]);\n $objDomainEntity->setEmailforwarding($emailForwarding[$dIndex]);\n $objDomainEntity->setIdprotection($iDProtection[$dIndex]);\n $objDomainEntity->setDonotrenew(null);\n $objDomainEntity->setReminders(null);\n $objDomainEntity->setSynced(null);\n $objDomainEntity->setNameServer1($nameServer1);\n $objDomainEntity->setNameServer2($nameServer2);\n $objDomainEntity->setNameServer3($nameServer3);\n $objDomainEntity->setNameServer4($nameServer4);\n $objDomainEntity->setNameServer5($nameServer5);\n $objDomainService->domain = $objDomainEntity;\n $domainId = $objDomainService->addItem();\n \n //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n $actionName = 'ADD_NEW';\n $logMessage = \"log-msg-record-added-order-domain\";\n $tableName = 'tbl_orders';\n $rowId = $orderId;\n $this->addSystemLog($actionName, $logMessage, $tableName, $rowId);\n //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n }\n }\n\n\n // create invoice for the order....\n $orderInfo = $objOrderService->getOrder($orderId);\n $objInvoiceService = new Base_Model_Lib_Invoice_Service_Invoice();\n $objInvoiceEntity = new Base_Model_Lib_Invoice_Entity_Invoice();\n $objInvoiceEntity->setClient($clientId);\n $objInvoiceEntity->setInvoiceNum($ordernum);\n $objInvoiceEntity->setDate($this->getSystemDateTime());\n $objInvoiceEntity->setDueDate($this->getSystemDateTime());\n $objInvoiceEntity->setDatePaid(null);\n $objInvoiceEntity->setSubTotal($orderAmount);\n $objInvoiceEntity->setCredit(null);\n $objInvoiceEntity->setTax(null);\n $objInvoiceEntity->setTax2(null);\n $objInvoiceEntity->setTotal($orderAmount);\n $objInvoiceEntity->setTaxrate(null);\n $objInvoiceEntity->setTaxrate2(null);\n $objInvoiceEntity->setStatus('Pending');\n $objInvoiceEntity->setPaymentmethod($paymentmethod);\n $objInvoiceEntity->setNotes(null);\n $objInvoiceService->invoice = $objInvoiceEntity;\n $invoiceId = $objInvoiceService->addInvoice();\n\n\n // update amount and invoice id for the order...\n $objOrderService = new Base_Model_Lib_Order_Service_Order();\n $objOrderEntity = new Base_Model_Lib_Order_Entity_Order();\n $objOrderEntity->setId($orderId);\n $objOrderEntity->setAmount($orderAmount);\n $objOrderEntity->setInvoiceid($invoiceId);\n $objOrderService->order = $objOrderEntity;\n $objOrderService->updateItemInvoiceInfo();\n\n // invoice items....\n $orderProducts = $orderInfo->getOrderProducts();\n $orderDomains = $orderInfo->getOrderdomain();\n\n\n $objInvoiceItemService = new Base_Model_Lib_Invoice_Service_InvoiceItem();\n\n foreach ($orderProducts As $oPIndex => $orderProduct) {\n \n $productBillingCycle = $orderProduct->getBillingCycle();\n \n $productPriceInfo = $objProductPricingService->getProductPriceByCurrency($productId, $currencyId, 'product');\n $productMsetupfee = $productPriceInfo->getMonthlySetupfee();\n $productQsetupfee = $productPriceInfo->getQuarterlySetupfee();\n $productSsetupfee = $productPriceInfo->getSemiAnnuallySetupfee();\n $productASsetupfee = $productPriceInfo->getAnnuallySetupfee();\n $productBsetupfee = $productPriceInfo->getBienniallySetupfee();\n $productTsetupfee = $productPriceInfo->getTrienniallySetupfee();\n $productMonthly = $productPriceInfo->getMonthlyFee();\n $productQuarterly = $productPriceInfo->getQuarterlyFee();\n $productSemiannually = $productPriceInfo->getSemiAnnuallyFee();\n $productAnnually = $productPriceInfo->getAnnuallyFee();\n $productBiennially = $productPriceInfo->getBienniallyFee();\n $productTriennially = $productPriceInfo->getTrienniallyFee();\n \n $firstPaymentAmount = \"\";\n $amount = \"\";\n $productFees = 0;\n $productSetUpFees = 0;\n \n if ($productBillingCycle == 'Monthly') {\n $firstPaymentAmount = $productMsetupfee + $productMonthly;\n $productFees = $productMonthly;\n $productSetUpFees = $productMsetupfee;\n } elseif ($productBillingCycle == 'Quarterly') {\n $firstPaymentAmount = $productQsetupfee + $productQuarterly;\n $productFees = $productQuarterly;\n $productSetUpFees = $productQsetupfee;\n } elseif ($productBillingCycle == 'Semi-Annually') {\n $firstPaymentAmount = $productSsetupfee + $productSemiannually;\n $productFees = $productSemiannually;\n $productSetUpFees = $productSsetupfee;\n } elseif ($productBillingCycle == 'Annually') {\n $firstPaymentAmount = $productASsetupfee + $productAnnually;\n $productFees = $productAnnually;\n $productSetUpFees = $productASsetupfee;\n } elseif ($productBillingCycle == 'Biennially') {\n $firstPaymentAmount = $productBsetupfee + $productBiennially;\n $productFees = $productBiennially;\n $productSetUpFees = $productBsetupfee;\n } elseif ($productBillingCycle == 'Triennially') {\n $firstPaymentAmount = $productTsetupfee + $productTriennially;\n $productFees = $productTriennially;\n $productSetUpFees = $productTsetupfee;\n }\n \n \n if($productFees == $orderProduct->getAmount()){\n // order item fees....\n $objInvoiceItemEntity = new Base_Model_Lib_Invoice_Entity_InvoiceItem();\n $objInvoiceItemEntity->setInvoice($invoiceId);\n $objInvoiceItemEntity->setClient($clientId);\n $objInvoiceItemEntity->setType('Item');\n $objInvoiceItemEntity->setRelid($orderId);\n $objInvoiceItemEntity->setDescription($orderProduct->getProduct()->getProductName());\n $objInvoiceItemEntity->setAmount($productFees);\n $objInvoiceItemEntity->setTaxed(null);\n $objInvoiceItemEntity->setDuedate($this->getSystemDateTime());\n $objInvoiceItemEntity->setPaymentmethod($paymentmethod);\n $objInvoiceItemEntity->setNotes(null);\n $objInvoiceItemService->invoiceItem = $objInvoiceItemEntity;\n $objInvoiceItemService->addInvoiceItem();\n \n // order item setup fees....\n $objInvoiceItemEntity = new Base_Model_Lib_Invoice_Entity_InvoiceItem();\n $objInvoiceItemEntity->setInvoice($invoiceId);\n $objInvoiceItemEntity->setClient($clientId);\n $objInvoiceItemEntity->setType('Hosting');\n $objInvoiceItemEntity->setRelid($orderId);\n $objInvoiceItemEntity->setDescription($orderProduct->getProduct()->getProductName().\" Standard Setup Fee\");\n $objInvoiceItemEntity->setAmount($productSetUpFees);\n $objInvoiceItemEntity->setTaxed(null);\n $objInvoiceItemEntity->setDuedate($this->getSystemDateTime());\n $objInvoiceItemEntity->setPaymentmethod($paymentmethod);\n $objInvoiceItemEntity->setNotes(null);\n $objInvoiceItemService->invoiceItem = $objInvoiceItemEntity;\n $objInvoiceItemService->addInvoiceItem();\n\n } else {\n \n $objInvoiceItemEntity = new Base_Model_Lib_Invoice_Entity_InvoiceItem();\n $objInvoiceItemEntity->setInvoice($invoiceId);\n $objInvoiceItemEntity->setClient($clientId);\n $objInvoiceItemEntity->setType('Item');\n $objInvoiceItemEntity->setRelid($orderId);\n $objInvoiceItemEntity->setDescription($orderProduct->getProduct()->getProductName());\n $objInvoiceItemEntity->setAmount($orderProduct->getAmount());\n $objInvoiceItemEntity->setTaxed(null);\n $objInvoiceItemEntity->setDuedate($this->getSystemDateTime());\n $objInvoiceItemEntity->setPaymentmethod($paymentmethod);\n $objInvoiceItemEntity->setNotes(null);\n $objInvoiceItemService->invoiceItem = $objInvoiceItemEntity;\n $objInvoiceItemService->addInvoiceItem();\n \n }\n \n }\n \n foreach($orderDomains As $dIndex=>$orderDomain){\n \n $type = \"Domain \".$orderDomain->getType();\n $itemDescription = $type.\" - \".$orderDomain->getDomain().\" - \".$orderDomain->getRegistrationperiod().\" Year/s\";\n $firstpaymentamount = '7.99';\n \n $objInvoiceItemEntity = new Base_Model_Lib_Invoice_Entity_InvoiceItem();\n $objInvoiceItemEntity->setInvoice($invoiceId);\n $objInvoiceItemEntity->setClient($clientId);\n $objInvoiceItemEntity->setType($type);\n $objInvoiceItemEntity->setRelid($orderId);\n $objInvoiceItemEntity->setDescription($itemDescription);\n $objInvoiceItemEntity->setAmount($firstpaymentamount);\n $objInvoiceItemEntity->setTaxed(null);\n $objInvoiceItemEntity->setDuedate($this->getSystemDateTime());\n $objInvoiceItemEntity->setPaymentmethod($paymentmethod);\n $objInvoiceItemEntity->setNotes(null);\n $objInvoiceItemService->invoiceItem = $objInvoiceItemEntity;\n $objInvoiceItemService->addInvoiceItem();\n }\n \n \n if($invoiceId != \"\"){\n //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n $actionName = 'ADD_NEW';\n $logMessage = \"log-msg-record-added-order-invoice\";\n $tableName = 'tbl_orders';\n $rowId = $orderId;\n $this->addSystemLog($actionName, $logMessage, $tableName, $rowId);\n \n $actionName = 'ADD_NEW';\n $logMessage = \"log-msg-record-added\";\n $tableName = 'tbl_invoices';\n $rowId = $invoiceId;\n $this->addSystemLog($actionName, $logMessage, $tableName, $rowId);\n //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n \n \n }\n \n\n // create cpanel accounts..............\n if($arrCpanelAccounts){\n \n $objCpanellService = new Base_Model_Lib_Api_Service_Cpanel();\n foreach($arrCpanelAccounts As $cIndex=>$cpanel){\n \n $domainName = $cpanel->domainName;\n $userName = $cpanel->username;\n $userPasswrd = $cpanel->userPassword;\n $userPackage = $cpanel->package;\n \n $objCpanellService->createAccount($domainName, $userName, $userPasswrd,$userPackage);\n \n $actionName = 'ADD_NEW';\n $logMessage = \"cpanel-account-created\";\n $tableName = 'tbl_orders';\n $rowId = $orderId;\n $this->addSystemLog($actionName, $logMessage, $tableName, $rowId);\n \n }\n \n }\n \n \n // send welcome mail to that client....\n $objMailTemplate = new Base_Model_Lib_Mail_Service_Template();\n $mailTemplate = $objMailTemplate->read('4');\n $mail = new Base_Model_Lib_Mail_Service_Mailer();\n $emailText = $mailTemplate->getMailBody();\n $emailBody = $mailTemplate->getMailHtmlBody();\n $mailSubject = $mailTemplate->getMailSubject();\n $tag = array('[to_name]' => $clientName);\n $mail->setTag($tag);\n $mail->setText($emailText);\n $mail->setHtml($emailBody);\n $mail->setFrom($mailTemplate->getMailFrom(), $mailTemplate->getMailFromName());\n $mail->addTo($clientEmail, $clientName);\n $mail->setSubject($mailSubject);\n $mail->setMailType('html');\n $mail->send();\n \n $actionName = 'ADD_NEW';\n $logMessage = \"email-notifiaction-sent-to-client\";\n $tableName = 'tbl_orders';\n $rowId = $orderId;\n $this->addSystemLog($actionName, $logMessage, $tableName, $rowId);\n\n $this->_redirect('/admin/order/?action-status=updated');\n } else {\n\n\n \n $objClientEntity = new Base_Model_Lib_Client_Entity_Client();\n $objClientService->client = $objClientEntity;\n $clientDetails = $objClientService->search(\"\");\n $this->view->clientDetails = $clientDetails;\n $client = $this->_request->getParam('client');\n $this->view->clientId = $client;\n \n $objPaymentMethodService = new Base_Model_Lib_Catelog_Service_PaymentMethod();\n $paymentMethods = $objPaymentMethodService->getAll();\n $this->view->paymentMethods = $paymentMethods;\n\n // get all active promotion codes...\n $objPromotionCodeService = new Base_Model_Lib_Catelog_Service_PromotionCode();\n $promotionCodes = $objPromotionCodeService->getAll();\n $this->view->promotionCodes = $promotionCodes;\n\n\n $objProductAndServices = new Base_Model_Lib_Product_Service_Group();\n $productAndServices = $objProductAndServices->getAllWithProducts();\n $this->view->productAndServices = $productAndServices;\n\n\n // get all canvasser...\n $objSalesPersonService = new Base_Model_Lib_User_Service_SalesPerson();\n $salesRoleCanvasser = 6;\n $canvassers = $objSalesPersonService->getAllBySalesRole($salesRoleCanvasser);\n $this->view->canvassers = $canvassers;\n\n $salesRoleSalesperson = 7;\n $salespersons = $objSalesPersonService->getAllBySalesRole($salesRoleSalesperson);\n $this->view->salespersons = $salespersons;\n }\n } catch (Exception $ex) {\n throw new Exception('<ERROR>' . $ex->getMessage() . \"\\n\");\n }\n }", "public function creditcardsAction() {\n if (!$this->_getSession()->isLoggedIn()) {\n $this->_redirect('customer/account/login');\n return;\n }\n\n if ($this->getRequest()->isPost()) {\n $data = $this->getRequest()->getParams();\n if (isset($data)) {\n $result = $this->_save($data);\n switch ($result->getResponseCode()) {\n case self::RESPONSE_CODE_SUCCESS:\n Mage::getSingleton('core/session')->addSuccess('Credit card has been added.');\n break;\n case self::RESPONSE_CODE_FAILURE:\n Mage::getSingleton('core/session')->addError('Credit card has not been saved. Please try again.');\n break;\n }\n\n $this->_redirect('payments/customer/creditcards');\n }\n }\n\n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->renderLayout();\n }", "public function add(array $params = [])\n {\n $this->resolveCreditsParams($params, ['branch_key', 'branch_secret', 'identity', 'amount']);\n\n return $this->api->request('POST', self::RESOURCE, [\n 'json' => $params\n ]);\n }", "public function testAddAmount() {\n $amount = 1000;\n $date = '3/10/2015';\n $this->assertNull( $this->tranche->addAmount($amount, $date));\n }", "function pnh_process_add_credit()\r\n\t{\r\n\t\t$output = array();\r\n\t\t$user=$this->auth(PNH_ADD_CREDIT);\r\n\t\t$fid_list=$this->input->post(\"fid\");\r\n\t\t$new_credit_list=$this->input->post(\"new_credit\");\r\n\t\t$new_credit_reason=$this->input->post(\"new_credit_reason\");\r\n\t\t\r\n\t\t$total_fids = count($fid_list);\r\n\t\t$affected = 0;\r\n\t\tif($total_fids)\r\n\t\t{\r\n\t\t\t\r\n\t\t\tforeach($fid_list as $fid)\r\n\t\t\t{\r\n\t\t\t\t$f=$this->db->query(\"select credit_limit from pnh_m_franchise_info where franchise_id=?\",$fid)->row_array();\r\n\t\t\t\t$inp=array($fid,$new_credit_list[$fid],$new_credit_list[$fid]+$f['credit_limit'],$new_credit_reason[$fid],$user['userid'],$user['userid'],time());\r\n\t\t\t\t$this->db->query(\"insert into pnh_t_credit_info(franchise_id,credit_added,new_credit_limit,reason,credit_given_by,created_by,created_on) values(?,?,?,?,?,?,?)\",$inp);\r\n\t\t\t\t$this->db->query(\"update pnh_m_franchise_info set credit_limit=? where franchise_id=?\",array($new_credit_list[$fid]+$f['credit_limit'],$fid));\r\n\t\t\t\t$affected += $this->db->affected_rows();\r\n\t\t\t}\r\n\t\t}\r\n\t\techo 1;\r\n\t\tdie();\r\n\t}", "public function update(UpdateClient $request,$id)\n {\n $user = User::find($id);\n\n $user->enabled = isset($request->enabled) ? 1 : 0;\n $user->user_name = $request->user_name;\n $user->company_name = $request->company_name;\n $user->phone_number = $request->phone_number;\n $user->email = $request->email;\n\n if(!empty($request->password)){\n $user->password = Hash::make($request->password);\n }\n\n $user->save();\n\n $user->credits()->delete();\n\n $counts = $request->count ? $request->count : [];\n $removedCounts = $request->removed_count ? $request->removed_count : [];\n $datesFrom = $request->valid_from ? $request->valid_from : [];\n $datesTo = $request->valid_to ? $request->valid_to : [];\n\n $insertData = [];\n $date = date('Y-m-d H:i:s');\n\n foreach($counts as $index => $count){\n $from = $datesFrom[$index];\n $to = $datesTo[$index];\n $removed = $removedCounts[$index];\n $insertData[] = ['user_id' => $user->id,\n 'count' => $count,\n 'removed_count' => $removed,\n 'valid_from' => $from,\n 'valid_to' => $to,\n 'created_at' => $date,\n 'updated_at' => $date];\n }\n\n $user->credits()->createMany($insertData);\n\n return redirect()->back()->with('success','Údaje byly uloženy.');\n }", "public function clientAdded($client,$pwd,$send)\n\t{\n\t\tif($send)\n\t\t\t$this->emailService->sendClientCreds($client,$pwd);\n\t\t$companyname=$client->getCompanyname();\n\t\t$country=$client->getAddress()->getCountry();\n\t\t$city=$client->getAddress()->getCity();\n\t\t$this->intercomService->createNewUser($client,$companyname,$country,$city);\n\t}", "function update_user_credits_by_amount($id_user='', $amount=''){\t\n\t\ttry{\n\t\t\t$this->db->set('credits','credits+'.$amount, FALSE);\n\t\t\t$this->db->where('id', $id_user);\n\t\t\t$result = $this->db->update('user');\n\t\t\tif($this->db->affected_rows()>0){\n\t\t\t\treturn TRUE;\n\t\t\t}else{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}catch(Exception $e){\n\t\t\tlog_message('debug','Error en la función update_user_credits_by_amount');\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function addNewClient() {\n\t\t$this->Db->query(\"INSERT INTO `yp_sessions` (`hash`, `last_time`) \n\t\t\tVALUES ('{$this->_thisClientHash()}', '{$this->Request->time}');\");\n\n\t\t\n\t}", "function add()\n { \n if (!$this->session->userdata('admin_logged')){ redirect('admin/login');} \n\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t'name' => $this->input->post('name'),\n );\n \n $client_id = $this->Client_model->add_client($params);\n redirect('client/index');\n }\n else\n { \n $data['_view'] = 'client/add';\n $this->load->view('layouts/main',$data);\n }\n }", "public function add_client()\n {\n\n $cols = \"`image`\";\n\n $this->obj->all_data->Client->set_image($this->upload(\"clients\"));\n $value =\n \"'\" . $this->obj->all_data->Client->get_image() . \"'\";\n\n\n $insert = $this->obj->insert(\"client\", $cols, $value);\n return $insert;\n }", "function update_creditcard($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $form['number_encrypted'] = $ilance->crypt->three_layer_encrypt($form['number'], $ilconfig['key1'], $ilconfig['key2'], $ilconfig['key3']);\n $form['authorized'] = 'yes';\n if ($ilconfig['creditcard_authentication'])\n {\n $form['authorized'] = 'no'; \n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"creditcards \n SET creditcard_number = '\" . $ilance->db->escape_string($form['number_encrypted']) . \"',\n creditcard_type = '\" . mb_strtolower($form['type']) . \"',\n date_updated = '\" . DATETIME24H . \"',\n creditcard_expiry = '\" . $form['expmon'] . $form['expyear'] . \"',\n cvv2 = '\" . $ilance->db->escape_string($form['cvv2']) . \"',\n name_on_card = '\" . $ilance->db->escape_string($form['first_name'] . \" \" . $form['last_name']) . \"',\n phone_of_cardowner = '\" . $ilance->db->escape_string($form['phone']) . \"',\n email_of_cardowner = '\" . $ilance->db->escape_string($form['email']) . \"',\n card_billing_address1 = '\" . $ilance->db->escape_string($form['address1']) . \"',\n card_billing_address2 = '\" . $ilance->db->escape_string($form['address2']) . \"',\n card_city = '\" . $ilance->db->escape_string($form['city']) . \"',\n card_state = '\" . $ilance->db->escape_string($form['state']) . \"',\n card_postalzip = '\" . $ilance->db->escape_string($form['postalzip']) . \"',\n card_country = '\" . $ilance->db->escape_string($form['countryid']) . \"',\n authorized = '\" . $ilance->db->escape_string($form['authorized']) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n AND cc_id = '\" . $ilance->db->escape_string($form['cc_id']) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_updated_creditcard');\t\t\n $ilance->email->set(array(\n '{{member}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send();\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET paymethod = 'account'\n WHERE user_id = '\" . intval($userid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n return true;\n }", "public function setCreditClient(?float $creditClient): Centralisateur {\n $this->creditClient = $creditClient;\n return $this;\n }", "function create_client()\n {\n $nomeClient = $_POST[\"name\"];\n $phoneClient = $_POST[\"phone\"];\n $adressClient = $_POST[\"adress\"];\n $numberClient = $_POST[\"number\"];\n $otherInfoClient = $_POST[\"other\"];\n\n $conexao = open_database_connection();\n\n $sqlCriar = mysql_query(\"INSERT INTO `project_pizzaria`.`cliente` (`id_cliente`, `nome_cliente`, `telefone_cliente`, `endereco_cliente`, `numero_cliente`, `outras_info`) VALUES (NULL, \n '$nomeClient', '$phoneClient','$enderecoClient','$numberClient','$otherInfoClient' );\");\n\n \n close_database_connection($conexao);\n\n mysqli_query($conexao,$sqlCriar);\n }", "function addnewPayment($cid, $Amount, $AdditionalAmount, $days, $userid) {\n\n $Date = date(\"Y-m-d H:i\");\n\n $sql = \"INSERT INTO invoice_payments (Amount,AdditionalAmount,DateTime,Credit_Invoice_idCredit_Invoice,User_idUser,PayFor,Status) \"\n\n . \"VALUES ($Amount,$AdditionalAmount,'$Date',$cid,$userid,$days,'1')\";\n\n\n\n if (mysqli_query($this->con, $sql)) {\n\n// return 'error:' . mysqli_error($this->con);\n\n return true;\n\n } else {\n\n// return 'error:' . mysqli_error($this->con);\n\n return false;\n\n }\n\n }", "function withdrawNow($dream_id, $amount) {\n\tglobal $Withdraw, $content;\n\t$params = array('id' =>$dream_id, 'amount' => $amount);\n\t$Withdraw->addWithdraw($params);\n\n}", "public function testAdd()\n\t{\n\t\t$client = static::createClient(array(), array(\n\t\t 'PHP_AUTH_USER' => 'jr',\n\t\t 'PHP_AUTH_PW' => 'jr',\n\t\t));\n\t\t$client->followRedirects();\n\n\t\t$crawler = $client->request('GET', '/client/add');\n\n\t\t$form = $crawler->selectButton('flyd_dashboardbundle_client_save')->form();\n\n\t\t// définit certaines valeurs\n\t\t$form['flyd_dashboardbundle_client[name]'] \t\t= 'Entreprise de test';\n\t\t$form['flyd_dashboardbundle_client[job]'] \t\t= 'Job de test';\n\n\t\t// soumet le formulaire\n\t\t$crawler = $client->submit($form);\n\n\n\t\t$this->assertEquals(1, $crawler->filter('html:contains(\"Client bien enregistré.\")')->count());\n\t}", "private function sellTrasactionAddsMoney(){\n\n }", "function addMerchant($vars){\n\tglobal $db;\n\t//should do some kind of security checks to prevent duplicate entries...(not in scope)\n\t$id = $db->insert('merchants', $vars);\n\tif($id){\n\t\t//return id merchantid\n\t\treturn $id;\n\t}else{\n\t\treturn false;\n\t}\n\t\n}", "function change_statement($cid,$acc_number,$sum,$role,$order_id)\n\t{\n\n\t\treturn $this->db->set('pamm_clients_stat_date', 'NOW()', FALSE)\n \t->set('pamm_clients_stat_cid', $cid)\n\t\t->set('pamm_clients_stat_acc_number',$acc_number)\n\t\t->set('pamm_clients_stat_sum',$sum)\n\t\t->set('pamm_clients_stat_role',$role)\n\t\t->set('pamm_clients_order_number',trim($order_id))\n\t\t->insert('pamm_clients_statement');\n\t}", "public function add_reasion($admission_form_id, $reason, $comments)\r\n\t{\r\n\t\t// var_dump($f_no);\r\n\t\t// die();\r\n\t\t\r\n\t\t\r\n\r\n\t\t//$admission_data = $this->AB->get_by_all('atif_gs_admission.admission_form','',$where_admission);\r\n\t\t#$admission_data =$this->AB->get_form_id($f_no);\r\n\r\n\t\t\r\n\r\n\t\t#echo \"WEe \".$admission_form_id = $admission_data[\"Form_id\"]; exit;\r\n\r\n\t\t\r\n\t\t $where_reasion = array(\r\n\t\t \t'admission_form_id' => $admission_form_id,\r\n\t\t );\r\n \t\t\r\n\r\n\t\t$data = array(\r\n\t\t\t'admission_form_id' => $admission_form_id,\r\n\t\t\t'reason' => $reason,\r\n\t\t\t'comments' => $comments,\r\n\t\t\t\"created\"=>time(),\r\n\t\t\t\"register_by\" =>$this->session->userdata(\"user_id\"),\r\n\t\t\t\"modified\"=>time(),\r\n\t\t\t\"modified_by\" =>$this->session->userdata(\"user_id\"),\r\n\t\t);\r\n\t\t$this->AB->set(\"log_form_comments\",$data);\r\n\t\t//$this->AB->update_data('atif_gs_admission.log_form_comments',$where_reasion,$data);\r\n\t\t\r\n\t}", "public function addCard()\n {\n }", "function InfAddCreditCard($inf_contact_id, $CardNumber, $ExpirationMonth, $ExpirationYear, $CVV2, $BillName, $BillAddress1, $BillCity, $BillState, $BillZip, $BillCountry) {\n\n\t$credit_card = new Infusionsoft_CreditCard();\n\t$credit_card->ContactId = $inf_contact_id;\n\t$credit_card->CardNumber = $CardNumber;\n\t$credit_card->CVV2 = $CVV2;\n\t$credit_card->CardType = WriteCardType($CardNumber);\n#\t$credit_card->Status = 3; //0: Unknown, 1: Invalid, 2: Deleted, 3: Valid/Good, 4: Inactive\n\t$credit_card->ExpirationMonth = $ExpirationMonth;\n\t$credit_card->ExpirationYear = $ExpirationYear;\n\t$credit_card->BillName = $BillName;\n\t$credit_card->BillAddress1 = $BillAddress1;\n\t$credit_card->BillCity = $BillCity;\n\t$credit_card->BillState = $BillState;\n\t$credit_card->BillZip = $BillZip;\n\t$credit_card->BillCountry = $BillCountry;\n\t\n\t# Return card id\n\treturn $credit_card->save();\n}", "function addCrediInvoice($totalAmount, $grantAmount, $InterestRate, $DailyEqualPayment, $Days, $PaidAmount, $Settled, $Debitors_idDebitors, $CollectionArea_idCollectionArea, $userid, $loan_type) {\n\n\n\n $Date = date(\"Y-m-d\");\n\n $sql = \"INSERT INTO credit_invoice (TotalAmount,GrantAmount,InterestRate,DailyEqualPayment,Days,PaidAmount,Settled,DateTime,Debitors_idDebitors,CollectionArea_idCollectionArea,Status,user_idUser,`type`) \"\n\n . \"VALUES ($totalAmount,$grantAmount, '$InterestRate', '$DailyEqualPayment', '$Days','$PaidAmount','$Settled','$Date','$Debitors_idDebitors','$CollectionArea_idCollectionArea', '0',$userid,'$loan_type')\";\n\n\n\n if (mysqli_query($this->con, $sql)) {\n\n $last_id = $this->con->insert_id;\n\n return $last_id;\n\n// return \"true\";\n\n } else {\n\n// return 'error:' . mysqli_error($this->con);\n\n return \"false\";\n\n }\n\n }", "public function subtract_chips_from_client($client_id,$balance)\n {\n $sql=\"UPDATE clients SET client_balance=client_balance-$balance where client_id=$client_id\";\n return $this->db->query($sql);\n }", "function requestCashPointsPayment($conn, $userID, $cpAmount, $referenceID, $reason = '') {\n if(!is_numeric($userID) || !isset($conn) || !is_numeric($cpAmount) || !isset($referenceID))\n terminatePage('Request CP > parameter invalid.');\n\n $balance = checkCashPoints($conn, $userID);\n $transactionId = -1;\n if($balance <= 0 || $cpAmount <= 0 || $balance < $cpAmount)\n terminatePage(\"Error1\");\n\n $insert_row = $conn->query(\"INSERT INTO cashtable_transactiontable\n (amount, userid, referenceid, reasonid, reason) VALUES\n ($cpAmount, $userID, '$referenceID', 2, '$reason')\n \");\n\n if(!$insert_row)\n terminatePage(' ('. $conn->errno .') '. $conn->error);\n\n $transactionId = $conn->insert_id;\n\n $result = $conn->query(\"SELECT vt.id AS cpID, vt.cashpointbalance AS cpBalance \n FROM cashpoint_usertable AS ut INNER JOIN cashpoint_vaulttable AS vt \n WHERE vt.id = ut.cashpointId AND ut.userId = $userID AND ut.enabled = true AND vt.cashpointbalance = ut.availableBalance\n AND ut.availableBalance > 0 AND vt.datetimeexpiry > now();\");\n\n if ($result->num_rows <= 0)\n terminatePage(\"Error2\");\n\n $remainingBalance = $cpAmount;\n\n while($row = $result->fetch_assoc()) {\n $cpID = $row['cpID'];\n $cpBalance = $row['cpBalance'];\n\n $balanceToSubtract = 0.00;\n if($cpBalance >= $remainingBalance)\n $balanceToSubtract = $remainingBalance;\n else\n $balanceToSubtract = $cpBalance;\n\n $remainingBalance = $remainingBalance - $balanceToSubtract;\n\n $insert_row = $conn->query(\"INSERT INTO cashpoint_exchangetable\n (transactionId, cashpointId, amount) VALUES\n ($transactionId, $cpID, $balanceToSubtract)\n \");\n\n if(!$insert_row)\n terminatePage(' ('. $conn->errno .') '. $conn->error);\n\n if(!$conn->query(\"UPDATE cashpoint_usertable \n SET floatingBalance = floatingBalance + $balanceToSubtract, availableBalance = availableBalance - $balanceToSubtract \n WHERE `userid` = '$userID' AND cashpointId = '$cpID'\"))\n terminatePage(' ('. $conn->errno .') '. $conn->error);\n\n if(!$conn->query(\"UPDATE cashpoint_vaulttable \n SET cashpointbalance = cashpointbalance - $balanceToSubtract \n WHERE id = '$cpID'\"))\n terminatePage(' ('. $conn->errno .') '. $conn->error);\n\n if($remainingBalance <= 0)\n break;\n }\n\n $balance = checkCashPoints($conn, $userID);\n if($balance < 0)\n terminatePage(\"Error3\");\n\n return $transactionId;\n}", "public function create_billing_agreement_with_creditcard($requestData){\n \n $agreement = new Agreement();\n if($this->checkEmptyObject($requestData['agreement'])){\n $this->setArrayToMethods(array_filter($requestData['agreement']), $agreement);\n }\n \n // Add Plan ID\n // Please note that the plan Id should be only set in this case.\n $plan = new Plan();\n $plan->setId($requestData['planId']);\n \n $agreement->setPlan($plan); \n \n // Add Payer\n $payer = new Payer();\n if($this->checkEmptyObject($requestData['payer'])){\n $this->setArrayToMethods(array_filter($requestData['payer']), $payer);\n }\n if($this->checkEmptyObject($requestData['payerInfo'])){\n $payer->setPayerInfo(new PayerInfo(array_filter($requestData['payerInfo'])));\n }\n \n // Add Credit Card to Funding Instruments\n $card = new CreditCard();\n if($this->checkEmptyObject($requestData['creditCard'])){\n $this->setArrayToMethods(array_filter($requestData['creditCard']), $card);\n }\n $fundingInstrument = new FundingInstrument();\n if($this->checkEmptyObject((array)$card)){\n $fundingInstrument->setCreditCard($card);\n }\n if($this->checkEmptyObject((array)$fundingInstrument)){\n $payer->setFundingInstruments(array($fundingInstrument)); \n }\n //Add Payer to Agreement\n if($this->checkEmptyObject((array)$payer)){\n $agreement->setPayer($payer);\n } \n // Add Shipping Address\n if($this->checkEmptyObject($requestData['shippingAddress'])){\n $shippingAddress = new ShippingAddress();\n $this->setArrayToMethods(array_filter($requestData['shippingAddress']), $shippingAddress);\n $agreement->setShippingAddress($shippingAddress); \n } \n // ### Create Agreement\n try {\n // Please note that as the agreement has not yet activated, we wont be receiving the ID just yet.\n $requestArray= clone $agreement;\n $agreement = $agreement->create($this->_api_context); \n $returnArray['RESULT'] = 'Success';\n $returnArray['AGREEMENT'] = $agreement->toArray();\n $returnArray['RAWREQUEST']=$requestArray;\n $returnArray['RAWRESPONSE']=$agreement->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }", "function ajouter_commande($date,$id_client,$prix_commande){\r\n\tglobal $bdd;\r\n\r\n\t$req=$bdd->prepare('INSERT INTO commande(id_commande, date_commande, client_id, prix_commande) VALUES (:id_commande, :date_commande, :client_id, :prix_commande)');\r\n\r\n\t$req->execute(array(\r\n\t\t'id_commande'=>'',\r\n\t\t'date_commande'=>$date,\r\n\t\t'client_id'=>$id_client,\r\n\t\t'prix_commande'=>$prix_commande));\r\n\r\n}", "public function doAddCustomers($form)\n {\n\n\n // $options['AdditionalName'] = null; //>String</AdditionalName>\n // $options['ArchiveNumber'] = null; //>Integer</ArchiveNumber>\n// $options['BankData'] = array(\n// 'PlentySoapObject_CustomerBankData' => array(\n// 'Accountnumber' => null, //>String</Accountnumber>\n// 'BankName' => null, //>String</BankName>\n// 'Blz' => null, //>String</Blz>\n// 'Date' => null, //>Integer</Date>\n// 'OwnerFirstname' => null, //>String</OwnerFirstname>\n// 'OwnerName' => null, //>String</OwnerName>\n// )\n// );\n//\n// $options['Company'] = null; //>String</Company>\n// $options['ContactPerson'] = null; //>String</ContactPerson>\n// $options['CountryID'] = null; //>Integer</CountryID>\n// $options['CustomerClass'] = null; //>Integer</CustomerClass>\n// $options['CustomerID'] = null; //>Integer</CustomerID>\n// $options['CustomerNumber'] = null; //>String</CustomerNumber>\n// $options['CustomerRating'] = null; //>Integer</CustomerRating>\n// $options['CustomerSince'] = null; //>Integer</CustomerSince>\n// $options['DateOfBirth'] = null; //>Integer</DateOfBirth>\n// $options['DebitorAccount'] = null; //>String</DebitorAccount>\n// $options['EbayName'] = null; //>String</EbayName>\n// $options['Evaluation'] = null; //>String</Evaluation>\n// $options['ExternalCustomerID'] = null; //>String</ExternalCustomerID>\n// $options['FSK'] = null; //>Integer</FSK>\n// $options['Fax'] = null; //>String</Fax>\n// $options['FormOfAddress'] = null; //>Integer</FormOfAddress>\n// $options['FreeTextFields'] = array(\n// 'PlentySoapObject_CustomerFreeTestFields' => array(\n// 'Free1' => null, //>String</Free1>\n// 'Free2' => null, //>String</Free2>\n// 'Free3' => null, //>String</Free3>\n// 'Free4' => null, //>String</Free4>\n// 'Free5' => null, //String</Free5>\n// 'Free6' => null, //>String</Free6>\n// 'Free7' => null, //>String</Free7>\n// 'Free8' => null, //>String</Free8>\n// )\n// );\n// $options['IsBlocked'] = null; //>Boolean</IsBlocked>\n// $options['Language'] = null; //>String</Language>\n// $options['LastLogin'] = null; //>Integer</LastLogin>\n// $options['LastSalesOrder'] = null; //>Integer</LastSalesOrder>\n// $options['LastSalesOrderCount'] = null; //>Integer</LastSalesOrderCount>\n// $options['LastSalesOrderID'] = null; //>Integer</LastSalesOrderID>\n// $options['Mobile'] = null; //>String</Mobile>\n// $options['Newsletter'] = null; //>Integer</Newsletter>\n// $options['PasswordMD5'] = null; //>String</PasswordMD5>\n// $options['PasswordPlain'] = null; //>String</PasswordPlain>\n// $options['PayDebitnode'] = null; //>Boolean</PayDebitnode>\n// $options['PayInvoice'] = null; //>Boolean</PayInvoice>\n// $options['PaymentDueWithin'] = null; //>Integer</PaymentDueWithin>\n// $options['Postident'] = null; //>String</Postident>\n// $options['ResponsibleID'] = null; //>Integer</ResponsibleID>\n// $options['StoreID'] = null; //>Integer</StoreID>\n// $options['Telephone'] = null; //>String</Telephone>\n// $options['Title'] = null; //>String</Title>\n// $options['Type'] = null; //>Integer</Type>\n// $options['Updated'] = null; //>Integer</Updated>\n// $options['VAT_ID'] = null; //>String</VAT_ID>\n\n $customer = new PMCustomer();\n\n $customer->Surname = $form['lastname'];\n\n // $options['Surname'] =\n $customer->FirstName = $form['firstname'];\n $customer->HouseNo = $form['HouseNo'];\n $customer->Street = $form['street'];\n $customer->City = $form['city'];\n $customer->ZIP = $form['zip'];\n $customer->CountryID = 1;\n $customer->CountryISO2 = $form['country'];\n $customer->Email = $form['email'];\n $customer->CustomerNumber =\n $customer->Language = 'DE';\n\n\n\n\n try {\n $oResponse = $this->__soapCall('AddCustomers', array($customer));\n } catch (SoapFault $sf) {\n print_r(\"Es kam zu einem Fehler beim Call GetAuthentificationToken<br>\");\n print_r($sf->getMessage());\n }\n\n\n if (isset($oResponse->Success) && $oResponse->Success == true) {\n return ($oResponse);\n } else {\n return ($oResponse->ErrorMessages);\n }\n }", "public function add($sAccount, $sVendor, $sCategory, $sDate, $iDebit, $iFixed, $sAmount, $sNotes)\n {\n \n //global $m_pSession;\n\n $sEnteredOn = date(\"Y-m-d H:i:s\");\n \n $bNewVendor = false;\n $bNewAccount = false;\n $bNewCategory = false;\n\n //Clean Account, Vendor and Category fields. Trim account and vender. Clean up Category and sub categories within the delemiter.\n $sVendor = trim($sVendor);\n $sAccount = trim($sAccount);\n $sCategory = $this->cleanCategory($sCategory);\n\n //Dealing with empty strings sent to add\n if(strlen($sVendor)!=0)\n $iVendorId = $this->pDatabase->selectValue(\"vendors/get_id_by_name\", $this->iUserId, $sVendor);\n else\n $iVendorId = 'NULL';\n \n if(strlen($sAccount)!=0)\n $iAccountId = $this->pDatabase->selectValue(\"accounts/get_id_by_name\", $this->iUserId, $sAccount);\n else\n $iAccountId = 'NULL';\n \n //Get category id form the database.\n if(strlen($sCategory)!=0)\n $iCategoryId = $this->pDatabase->selectValue(\"categories/get_id_by_name\", $this->iUserId, $sCategory);\n else\n $iCategoryId = 'NULL';\n \n //In case that any values are empty that shouldn't be empty\n if(($iVendorId=='NULL') && (strlen($sVendor)!=0)){ \n $this->addNew(\"vendors\",$sVendor); $bNewVendor=true;\n }\n if(($iCategoryId=='NULL') && (strlen($sCategory)!=0)){ \n $this->addNew(\"categories\",$sCategory); $bNewCategory=true;\n }\n if(($iAccountId=='NULL') && (strlen($sAccount)!=0)){ \n $this->addNew(\"accounts\",$sAccount); $bNewAccount=true;\n }\n \n \n \n //Add the transaction to the databse.\n $sTransactionId = $this->pDatabase->insert(\"transactions/add\", \"transactions\", $this->iUserId, $iVendorId, $iAccountId, $iCategoryId, $sDate, $iDebit, $iFixed, $sAmount, $sNotes, $sEnteredOn);\n\n //If error adding the transaction then clean up and report error.\n if ($sTransactionId == null)\n {\n //If vendor, account or category was created then delete them.\n if ($bNewVendor) $this->pDatabase->delete(\"vendors/delete\", $this->iUserId, $iVendorId);\n if ($bNewAccount) $this->pDatabase->delete(\"accounts/delete\", $this->iUserId, $iAccountId);\n if ($bNewCategory) $this->pDatabase->delete(\"categories/delete\", $this->iUserId, $iCategoryId);\n \n return XML::serialize(true, \"addTransaction\", \"type\",\"ERROR\",\"id\", \"-1\");\n }\n\n //If transaction is within visible period then add it to the list add it to the sorted list.\n\n\n return XML::serialize(true, \"addTransaction\", \"type\",\"OK\", \"id\",$sTransactionId);\n }", "public function setCredit($credit) {\n $this->data['credit'] = $credit;\n }", "function add_cross($so, $sn, $cc, $ce, $am, $text, $rep_id){\n $c = new CrossCharge;\n $c->service_order = $so;\n $c->serial = $sn;\n $c->cost_centre = $cc;\n $c->cost_element = $ce;\n $c->amount = $am;\n $c->text = $text;\n $c->repair_id = $rep_id;\n $c->charged = 0;\n $c->charged_date = Carbon::now();\n $c->save();\n }", "public function edit(CreditCard $creditCard)\n {\n //\n }", "public function create_contracts_for_one_legal_client()\n {\n $client_id = factory(Legal::class, 'active')->create()->client_id;\n factory(Contract::class, 'in_progress_legal', 2)->create(['client_id' => $client_id]);\n factory(Contract::class, 'finished_legal', 2)->create(['client_id' => $client_id]);\n }", "public function addComprasClientes($item) {\n $this->comprasClientes[] = $item;\n }", "public function get_credit($key = 0)\n {\n }", "public function whmcs_add_billable_item($params = array()) {\n\t\t$params['action'] = 'AddBillableItem';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "function insert_Creditcard_Transaction($details)\n{\n extract($details);\n\n include(\"db_new.php\");\n //$conn = db_connect();\n $mdate = date('Y-m-d H:i:s');\n $success = 0;\n\n if (DEBUG == 1) echo 'action:'.$action.'<br>';\n\n $purpose = addslashes($txPurpose);\n\n if ($txDate)\n $txDate = date('Y-m-d', strtotime($txDate));\n\n if ($action == \"EDIT\") {\n\n $sql = \"update visa_transaction set transaction_date ='$txDate', amount = $txAmount,\n purpose = '$purpose', visa_id = $creditcard, status = '$status',\n\t\t\t lastmodifieddate = '$mdate' where transaction_id = $id\";\n\n if (DEBUG==1) echo $sql.'<br>';\n\n $msg = 'Record successfully Updated.';\n\n\tif ($con->query($sql) === TRUE) {\n\t\t$msg = \"Credit Card Transaction '$id' successfully Updated.\";\n\t} else {\n\t\t$con->close();\n\t\treturn $id.'@SQL error:UPDATE@0';\n\t}\n /*$result = mysql_query($query, $conn) or die('counter UPDATE error: '.mysql_errno().', '.mysql_error());\n\tif (!$result) return $id.'@SQL error:UPDATE@0';\n $msg = \"Credit Card Transaction '$id' successfully Updated.\";\n*/\n $success = 1;\n\n }\n\n if ($action == \"SAVE\") {\n\n\n $sql = \"insert into visa_transaction(transaction_date, amount,\n purpose, visa_id, status, lastmodifieddate)\n VALUES('$txDate', $txAmount,'$purpose', $creditcard,\n '$status', '$mdate')\";\n\n if (DEBUG==1) echo $sql.'<br>';\n\n\t if ($con->query($sql) === TRUE) {\n\t\t $msg = \"Credit Card Transaction #'$id' successfully Inserted.\";\n\t } else {\n\t\t $con->close();\n\t\t return $id.'@SQL error:UPDATE@0';\n\t }\n\t //$result = mysql_query($query, $conn) or die('counter INSERT error: '.mysql_errno().', '.mysql_error());\n\t $id = mysqli_insert_id();\n\t //echo \"id=\".$id;\n\t //if (!$result) return $id.'@SQL error:INSERT@0';\n //$msg = \"Credit Card Transaction #'$id' successfully Inserted.\";\n\n $success = 1;\n }\n $con->close();\n return $id.'@'.$msg.'@'.$success;\n}", "public function credit(float $amount)\n {\n return $this->query->create(['amount' => $amount, 'type_id' => Transaction::TYPE_CREDIT]);\n }", "function editClient($clientname, $firstname, $lastname, $phone, $email, $address, $city, $state)\n\t{\n\t\teditClientContact($clientname, $firstname, $lastname, $phone, $email, $address, $city, $state);\n\t}", "public function setclient_id($value);", "public function insertinvCredite()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `invcredite`(`idicre`, `idcrdite`, `amount`)VALUES('$this->idicre' ,'$this->idcrdite' ,'$this->amount')\");\n $result = $sql->execute();\n $id = $dbh->lastInsertId();\n return array ($result,$id);\n }" ]
[ "0.61397743", "0.60845107", "0.60529935", "0.59566075", "0.5824449", "0.5804098", "0.5802511", "0.5777823", "0.5718759", "0.56875986", "0.5507631", "0.5478935", "0.54697776", "0.53985703", "0.53643626", "0.5359275", "0.5340747", "0.53281", "0.53189", "0.5306369", "0.5294766", "0.52644825", "0.5261536", "0.52553374", "0.5251105", "0.52091837", "0.519356", "0.51930994", "0.5180071", "0.515329", "0.5152281", "0.5149568", "0.51328385", "0.5124519", "0.51233375", "0.51178414", "0.51163894", "0.5115204", "0.51124555", "0.51047266", "0.51033455", "0.51020753", "0.50568926", "0.5031082", "0.50181663", "0.5015727", "0.5013719", "0.5006882", "0.49968702", "0.49965313", "0.49946982", "0.49885014", "0.49839", "0.49689236", "0.4960601", "0.49578932", "0.49500355", "0.4945684", "0.49431294", "0.493631", "0.4934167", "0.49332467", "0.49297997", "0.49213573", "0.49155903", "0.4915496", "0.49108526", "0.49081862", "0.49060217", "0.4896142", "0.48939288", "0.48921588", "0.4891085", "0.48827302", "0.48694915", "0.48694342", "0.48575413", "0.4850216", "0.48492703", "0.48492426", "0.48453715", "0.4836623", "0.4827279", "0.48244348", "0.48237094", "0.48107836", "0.47955954", "0.4787486", "0.47781035", "0.47780672", "0.4764685", "0.47615364", "0.47612724", "0.475974", "0.47572532", "0.4753989", "0.47496235", "0.47481838", "0.47448042", "0.47420028" ]
0.6651065
0
This command is used to add a transaction. Parameters: mountin amount to add to the account amountout if an outgoing enter this paymentmethod gateway used in WHMCS date date of transaction (same format as your WHMCS eg DD/MM/YYYY) Optional Parameters: userid Add Transaction to a user invoiceid Add transaction to a particular invoice description Description of the transaction fees transaction fee you were charged transid Transaction ID you wish to assign credit set to true to add the transaction as credit to the client See:
public function whmcs_add_transaction($params = array()) { $params['action'] = 'AddTransaction'; // return Whmcs_base::send_request($params); $load = new Whmcs_base(); return $load->send_request($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function AddTransaction($options = array()){\n if( !isset($options['currency1']) ){\n $options['currency1'] = $options['currency'];\n }\n if( !isset($options['currency2']) ){\n $options['currency2'] = $options['currency1'];\n }\n\n return $this->api->CreateComplexTransaction(\n $options['amount'],\n $options['currency1'],\n $options['currency2'],\n $options['buyer_email'],\n $options['address'],\n $options['buyer_name'],\n $options['item_name'],\n $options['item_number'],\n $options['invoice'],\n $options['custom'],\n $options['ipn_url']\n );\n }", "function add_transaction($transaction_id, $date, $time, $customer, $value){\n $str_query=\"insert into pos_transaction set transaction_id='$transaction_id',date='$date',\n time='$time',customer='$customer',value='$value'\";\n return $this->query($str_query);\n }", "public function taskAddCredit($amount,$user=null,$message=null)\n\t{\n\t\t$user=$user?$user:app()->user->model();\n\t\t$credit = $user->credit;\n\t\tif(!$credit)\n\t\t{\n\t\t\t$credit = new MPaymentCredit;\n\t\t\t$credit->id = $user->id;\n\t\t\t$credit->amount = 0;\n\t\t}\n\t\t\n\t\t$credit->amount+= $amount;\n\t\t$credit->save();\n\t\t\n\t\tif($message)\n\t\t{\n\t\t\t$m = new MTransactionHistory;\n\t\t\t$m->userId = $user->id;\n\t\t\t$m->action = $amount >= 0 ? 'plus' : 'minus';\n\t\t\t$m->amount = $amount;\n\t\t\t$m->comment = $message;\n\t\t\t$m->date = time();\n\t\t\t$m->save();\n\t\t}\n\t}", "public function add($sAccount, $sVendor, $sCategory, $sDate, $iDebit, $iFixed, $sAmount, $sNotes)\n {\n \n //global $m_pSession;\n\n $sEnteredOn = date(\"Y-m-d H:i:s\");\n \n $bNewVendor = false;\n $bNewAccount = false;\n $bNewCategory = false;\n\n //Clean Account, Vendor and Category fields. Trim account and vender. Clean up Category and sub categories within the delemiter.\n $sVendor = trim($sVendor);\n $sAccount = trim($sAccount);\n $sCategory = $this->cleanCategory($sCategory);\n\n //Dealing with empty strings sent to add\n if(strlen($sVendor)!=0)\n $iVendorId = $this->pDatabase->selectValue(\"vendors/get_id_by_name\", $this->iUserId, $sVendor);\n else\n $iVendorId = 'NULL';\n \n if(strlen($sAccount)!=0)\n $iAccountId = $this->pDatabase->selectValue(\"accounts/get_id_by_name\", $this->iUserId, $sAccount);\n else\n $iAccountId = 'NULL';\n \n //Get category id form the database.\n if(strlen($sCategory)!=0)\n $iCategoryId = $this->pDatabase->selectValue(\"categories/get_id_by_name\", $this->iUserId, $sCategory);\n else\n $iCategoryId = 'NULL';\n \n //In case that any values are empty that shouldn't be empty\n if(($iVendorId=='NULL') && (strlen($sVendor)!=0)){ \n $this->addNew(\"vendors\",$sVendor); $bNewVendor=true;\n }\n if(($iCategoryId=='NULL') && (strlen($sCategory)!=0)){ \n $this->addNew(\"categories\",$sCategory); $bNewCategory=true;\n }\n if(($iAccountId=='NULL') && (strlen($sAccount)!=0)){ \n $this->addNew(\"accounts\",$sAccount); $bNewAccount=true;\n }\n \n \n \n //Add the transaction to the databse.\n $sTransactionId = $this->pDatabase->insert(\"transactions/add\", \"transactions\", $this->iUserId, $iVendorId, $iAccountId, $iCategoryId, $sDate, $iDebit, $iFixed, $sAmount, $sNotes, $sEnteredOn);\n\n //If error adding the transaction then clean up and report error.\n if ($sTransactionId == null)\n {\n //If vendor, account or category was created then delete them.\n if ($bNewVendor) $this->pDatabase->delete(\"vendors/delete\", $this->iUserId, $iVendorId);\n if ($bNewAccount) $this->pDatabase->delete(\"accounts/delete\", $this->iUserId, $iAccountId);\n if ($bNewCategory) $this->pDatabase->delete(\"categories/delete\", $this->iUserId, $iCategoryId);\n \n return XML::serialize(true, \"addTransaction\", \"type\",\"ERROR\",\"id\", \"-1\");\n }\n\n //If transaction is within visible period then add it to the list add it to the sorted list.\n\n\n return XML::serialize(true, \"addTransaction\", \"type\",\"OK\", \"id\",$sTransactionId);\n }", "function insert_transaction($subscriptionid = 0, $projectid = 0, $buynowid = 0, $user_id = 0, $p2b_user_id = 0, $storeid = 0, $orderid = 0, $description = '', $amount, $paid, $status, $invoicetype, $paymethod, $createdate, $duedate, $paiddate, $custommessage, $archive, $ispurchaseorder = 0, $returnid = 0, $transactionidx = '', $isdeposit = 0, $iswithdraw = 0, $dontprocesstax = 0)\n {\n global $ilance, $ilconfig;\n $subscriptionid = isset($subscriptionid) ? intval($subscriptionid) : '0';\n $projectid = isset($projectid) ? intval($projectid) : '0';\n $buynowid = isset($buynowid) ? intval($buynowid) : '0';\n $user_id = isset($user_id) ? intval($user_id) : '0';\n $p2b_user_id = isset($p2b_user_id) ? intval($p2b_user_id) : '0';\n $storeid = isset($storeid) ? intval($storeid) : '0';\n $orderid = isset($orderid) ? intval($orderid) : '0';\n $description = isset($description) ? $description : 'No transaction description provided';\n $amount = isset($amount) ? $amount : '0.00';\n $paid = isset($paid) ? $paid : '0.00';\n $status = isset($status) ? $status : 'unpaid';\n $invoicetype = isset($invoicetype) ? $invoicetype : 'debit';\n $paymethod = isset($paymethod) ? $paymethod : 'account';\n $ipaddress = IPADDRESS;\n $referer = REFERRER;\n $createdate = DATETIME24H;\n $duedate = isset($duedate) ? $duedate : DATETIME24H;\n $paiddate = isset($paiddate) ? $paiddate : '';\n $custommessage = isset($custommessage) ? $custommessage : 'No memo or administrative comments';\n $archive = isset($archive) ? intval($archive) : '0';\n $ispurchaseorder = isset($ispurchaseorder) ? $ispurchaseorder : '0';\n // withdraw and deposit related transactions\n $iswithdraw \t = isset($iswithdraw) \t ? intval($iswithdraw) : '0';\n $isdeposit \t = isset($isdeposit) \t ? intval($isdeposit) : '0';\n $totalamount = '0.00';\n $transactionid = (isset($transactionidx) AND !empty($transactionidx)) ? $transactionidx : $ilance->accounting_payment->construct_transaction_id();\n $currencyid = $this->currencyid == '0' ? $ilconfig['globalserverlocale_defaultcurrency'] : $this->currencyid;\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"invoices\n (invoiceid, currency_id, subscriptionid, projectid, buynowid, user_id, p2b_user_id, storeid, orderid, description, amount, paid, totalamount, status, paymethod, ipaddress, referer, createdate, duedate, paiddate, custommessage, transactionid, archive, ispurchaseorder, isdeposit, iswithdraw)\n VALUES(\n NULL,\n '\" . intval($currencyid) . \"',\n '\" . intval($subscriptionid) . \"',\n '\" . intval($projectid) . \"',\n '\" . intval($buynowid) . \"',\n '\" . intval($user_id) . \"',\n '\" . intval($p2b_user_id) . \"',\n '\" . intval($storeid) . \"',\n '\" . intval($orderid) . \"',\n '\" . $ilance->db->escape_string($description) . \"',\n '\" . $ilance->db->escape_string($amount) . \"',\n '\" . $ilance->db->escape_string($paid) . \"',\n '\" . $ilance->db->escape_string($totalamount) . \"',\n '\" . $ilance->db->escape_string($status) . \"',\n '\" . $ilance->db->escape_string($paymethod) . \"',\n '\" . $ilance->db->escape_string($ipaddress) . \"',\n '\" . $ilance->db->escape_string($referer) . \"',\n '\" . $ilance->db->escape_string($createdate) . \"',\n '\" . $ilance->db->escape_string($duedate) . \"',\n '\" . $ilance->db->escape_string($paiddate) . \"',\n '\" . $ilance->db->escape_string($custommessage) . \"',\n '\" . $ilance->db->escape_string($transactionid) . \"',\n '\" . $ilance->db->escape_string($archive) . \"',\n '\" . intval($ispurchaseorder) . \"',\n '\" . intval($isdeposit) . \"',\n '\" . intval($iswithdraw) . \"')\n \", 0, null, __FILE__, __LINE__); \n // fetch new last invoice id\n $invoiceid = $ilance->db->insert_id();\n \n // do we skip the taxation support for this transaction?\n // we do this in some situations where the tax needs to be applied before the txn is created\n // for situations like escrow fees that we must already know how much to charge the customer for taxes\n // if we don't do this then the txn may have double taxes added to the overall amount\n // and situations like this usually mean that an unpaid transaction is being created (and tax) is\n // auto-applied\n \n // taxation support: is user taxable for this invoice type?\n // this code block will run if a transaction being created is unpaid waiting for payment from the customer\n if ($ilance->tax->is_taxable($user_id, $invoicetype) AND isset($dontprocesstax) AND $dontprocesstax == 0)\n {\n // fetch tax amount to charge for this invoice type\n $taxamount = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 0);\n // fetch total amount to hold within the \"totalamount\" field\n $totalamount = ($amount + $taxamount);\n // fetch tax bit to display when outputing tax infos\n $taxinfo = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 1);\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\" . $totalamount . \"',\";\n }\n // member is taxable for this invoice type\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET istaxable = '1',\n $extra\n totalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\n taxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\n taxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else\n {\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\".$totalamount.\"',\";\n }\n // customer not taxable > update totalamount value\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET totalamount = '\" . sprintf(\"%01.2f\", $amount) . \"',\n $extra\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n } \n if (isset($returnid) AND $returnid > 0)\n {\n return intval($invoiceid);\n }\n }", "function add_money() {\n\t\t$coupon_id = $_REQUEST['coupon_id'];\n\t\t$coupon_amount = $_REQUEST['coupon_amount'];\n\t\t$user_id = $_REQUEST['recharge_user_id'];\n\t\t$user_amount = $_REQUEST['recharge_amount'];\n\t\t$transaction_id = $_REQUEST['transection_id'];\n\t\t$final_amount = $coupon_amount + $user_amount;\n\t\t//\t$wt_type=$_POST['wt_type']; //1- debit in account, 2- credit in account\n\t\t$wt_type = 1;\n\t\t// credit\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t$wt_category = 1;\n\t\t// 1-Add moeny, 2-Recharge\n\t\t$w_category = 6;\n\t\t$w_desc = \"Amount Recieved when add money \" . $user_amount . \" with get amount \" . $coupon_amount;\n\t\t$wt_desc = \"Add Money\";\n\t\tif (!empty($user_id) && !empty($user_amount) && !empty($transaction_id)) {\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t$user_wallet = $wallet_amount + $final_amount;\n\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $user_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\"');\n\t\t\tif (!empty($add_money)) {\n\t\t\t\tif (!empty($coupon_id)) {\n\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('coupon_details', 'coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\tif ($add_money) {\n\t\t\t\t\t\t$records_coupon = $this -> conn -> get_table_row_byidvalue('offer_coupon', 'coupon_id', $coupon_id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$coupon_count = $records_coupon['0']['coupon_limit'];\n\t\t\t\t\t\tif($coupon_count>0){\n\t\t\t\t\t\t\t$data_coupon['coupon_limit'] = $coupon_count - 1;\n\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('offer_coupon', 'coupon_id', $coupon_id, $data_coupon);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$transaction_ids = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $coupon_amount . '\",\"' . $w_category . '\",\"' . $transaction_ids . '\",\"' . $w_desc . '\",\"' . $transaction_id . '\"');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$data['wallet_amount'] = $user_wallet;\n\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\t\t\t\t$post = array(\"status\" => \"true\", 'message' => \"Add amount successfully\", \"transaction_id\" => $transaction_id, 'add_amount' => $user_amount, 'wallet_amount' => $user_wallet, 'transaction_date' => $current_date);\n\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Transaction Failed\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'recharge_user_id' => $user_id, 'recharge_amount' => $user_amount, 'transection_id' => $transection_id);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "function add_transaction($angebotid, $useridKaeufer, $bewertungVerkaeuferT, $bewertungVerkaeuferV, $bewertungKaeuferT, $bewertungKaeuferV)\r\n {\r\n $stid = $this->parseSql(\"begin sp_addTransaction(:p1, :p2, :p3, :p4, :p5, :p6, :p7); end;\");\r\n oci_bind_by_name($stid, \":p1\", $angebotid);\r\n oci_bind_by_name($stid, \":p2\", $useridKaeufer);\r\n oci_bind_by_name($stid, \":p3\", $bewertungVerkaeuferT);\r\n oci_bind_by_name($stid, \":p4\", $bewertungVerkaeuferV);\r\n oci_bind_by_name($stid, \":p5\", $bewertungKaeuferT);\r\n oci_bind_by_name($stid, \":p6\", $bewertungKaeuferV);\r\n oci_bind_by_name($stid, \":p7\", $errorOut, 300);\r\n $stid = $this->executeParsedSql($stid);\r\n\r\n if (!$this->errorHappened($errorOut)) {\r\n return \"Transaction added!\";\r\n } else {\r\n return \"error\";\r\n }\r\n }", "function create($user, $notrigger = 0) {\n global $conf, $langs;\n $error = 0;\n\n // Clean parameters\n if (isset($this->datec))\n $this->datec = trim($this->datec);\n if (isset($this->number))\n $this->number = trim($this->number);\n if (isset($this->label))\n $this->label = trim($this->label);\n if (isset($this->fk_author))\n $this->fk_author = trim($this->fk_author);\n if (isset($this->fk_source))\n $this->fk_source = trim($this->fk_source);\n if (isset($this->sourcetype))\n $this->sourcetype = trim($this->sourcetype);\n if (isset($this->url))\n $this->url = trim($this->url);\n if (isset($this->fk_fiscal_year))\n $this->fk_fiscal_year = trim($this->fk_fiscal_year);\n\n if ($this->datevalid(($this->datec)) == -1) {\n return -1;\n }\n // Check parameters\n // Put here code to add control on parameters values\n // Insert request\n $sql = \"INSERT INTO \" . MAIN_DB_PREFIX . \"iconta_accountingtransaction(\";\n\n $sql.= \"label,\";\n $sql.= \"entity,\";\n $sql.= \"number,\";\n $sql.= \"datec,\";\n $sql.= \"fk_author,\";\n $sql.= \"fk_source,\";\n $sql.= \"sourcetype,\";\n $sql.= \"url,\";\n $sql.= \"fk_fiscal_year\";\n\n\n $sql.= \") VALUES (\";\n\n $sql.= \" \" . (!isset($this->label) ? 'NULL' : \"'\" . $this->db->escape($this->label) . \"'\") . \",\";\n $sql.= \" \" . (!isset($this->entity) ? '0' : \"'\" . $this->entity . \"'\") . \",\";\n $sql.= \" \" . (!isset($this->number) ? 'NULL' : \"'\" . $this->db->escape($this->number) . \"'\") . \",\";\n $sql.= \" \" . (!isset($this->datec) || dol_strlen($this->datec) == 0 ? 'NULL' : $this->db->idate($this->datec)) . \",\";\n $sql.= \" \" . (!isset($this->fk_author) ? \"'\" . $this->db->escape($user->id) . \"'\" : \"'\" . $this->db->escape($user->id) . \"'\") . \",\";\n $sql.= \" \" . (!isset($this->fk_source) ? 'NULL' : \"'\" . $this->fk_source . \"'\") . \",\";\n $sql.= \" \" . (!isset($this->sourcetype) ? 'NULL' : \"'\" . $this->db->escape($this->sourcetype) . \"'\") . \",\";\n $sql.= \" \" . (!isset($this->url) ? 'NULL' : \"'\" . $this->db->escape($this->url) . \"'\") . \",\";\n $sql.= \" \" . (!isset($this->fk_fiscal_year) ? 'NULL' : \"'\" . $this->db->escape($this->fk_fiscal_year) . \"'\") . \"\";\n\n $sql.= \")\";\n //echo $sql;\n $this->db->begin();\n\n dol_syslog(get_class($this) . \"::create sql=\" . $sql, LOG_DEBUG);\n $resql = $this->db->query($sql);\n if (!$resql) {\n $error++;\n $this->errors[] = \"Error \" . $this->db->lasterror();\n }\n\n if (!$error) {\n $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . \"iconta_accountingtransaction\");\n\n if (!$notrigger) {\n // Uncomment this and change MYOBJECT to your own tag if you\n // want this action call a trigger.\n //// Call triggers\n //include_once(DOL_DOCUMENT_ROOT . \"/core/class/interfaces.class.php\");\n //$interface=new Interfaces($this->db);\n //$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);\n //if ($result < 0) { $error++; $this->errors=$interface->errors; }\n //// End call triggers\n }\n }\n\n // Commit or rollback\n if ($error) {\n foreach ($this->errors as $errmsg) {\n dol_syslog(get_class($this) . \"::create \" . $errmsg, LOG_ERR);\n $this->error.=($this->error ? ', ' . $errmsg : $errmsg);\n }\n $this->db->rollback();\n return -1 * $error;\n } else {\n $this->db->commit();\n return $this->id;\n }\n }", "function addTransaction() {\nrequire(\"/home/course/cda540/u05/public_html/project/dbguest.php\");\n\n//It will import all variables such as $host , $user, $pass and $db\n\n//mysqli_connect() is to connect the database\n$link = mysqli_connect($host, $user, $pass, $db);\n\n//Check the connection. Give error message if any error\nif (!$link) die(\"Couldn't connect to MySQL\");\n\n\n//mysqli_select_db() is used to select the database\nmysqli_select_db($link, $db)\n or die(\"Couldn't open $db: \".mysqli_error($link));\n\n$result_cusID=(int)$_POST['customerID'];\n\n$string_itemID=$_POST['items'];\n\n$string_itemsPrice = $_POST['itemsPrice'];\n\n$result_itemID = explode(\"\\n\",$string_itemID);\n\n$result_itemPrice = explode(\"\\n\",$string_itemsPrice);\n\n$itemIDs = implode (\",\" , $result_itemID);\n\n$result_customer=mysqli_query($link,\"SELECT * FROM CUSTOMER where _id=$result_cusID\");\n\n$result_itemIDs = mysqli_query($link,\"SELECT * FROM ITEM where _id IN ('$itemIDs')\");\n\n$totalpurchaseprice = 0;\n\nforeach($result_itemPrice as $itemprice)\n{\n $totalpurchaseprice = $totalpurchaseprice+$itemprice;\n}\n\n\nif ((mysqli_num_rows($result_customer)>0)&& (mysqli_num_rows($result_itemIDs)>0))\n{\n \n $result_trans=mysqli_query($link, \"INSERT INTO TRANSACTION (discouncode,transactiondate,totalpurchaseprice,customerId) VALUES(70,now(),'$totalpurchaseprice','$result_cusID')\");\n \n $result_no=mysqli_query($link,\"SELECT transactionNumber FROM TRANSACTION ORDER BY customerId DESC LIMIT 1\");\n $obj = mysqli_fetch_object($result_no);\n $transno= $obj-> transactionNumber;\n \n foreach ($result_itemID as $itemID)\n {\n $result_transdetails=mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES('$transno','$itemID')\"); \n }\n\necho '<span style=\"color:#008000;text-align:center;\">Success!!! Customer ID Found and added a new transaction...</span>';\n\n\n}\n\nelse\n{\necho '<span style=\"color:#FF0000;text-align:center;\">Sorry!!! Unable to add a new transaction (Check Customers and Items)...</span>';\n}\n\n//$string_itemID=$_POST['items'];\n\n//$result_itemID = explode(\"\\n\",$string_itemID);\n\n//$j=1;\n\n//foreach ($result_itemID as $item_val)\n//{\n//echo \"$item_val <br>\";\n//$item_intval=int(\"$item_val\");\n\n//Working\n//$result_trans=mysqli_query($link, \"INSERT INTO TRANSACTION (discouncode,transactiondate,totalpurchaseprice,customerId) VALUES(70,'2019jun21',13.14,1)\");\n//$result_no=mysqli_query($link,\"SELECT transactionNumber FROM TRANSACTION ORDER BY customerId DESC LIMIT 1\");\n\n//$value = mysql_fetch_object($result_no);\n//$transno = $value->transactionNumber;\n//echo \"$transno\";\n//$result_transdetails=mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES(5,1)\");\n//$j=$j+1;\n//}\n\n\n//mysqli_query will execute the query and stores into $result\n\n//mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES('$result')\");\n//Close the connection\nmysqli_close($link);\n\n}", "function add_comm_wallet_transaction($type, $amount, $reference, $cellphone){\r\n\r\n $credit = 0.00;\r\n $debit = 0.00;\r\n $result = true;\r\n\r\n if($type == 'credit'){\r\n $credit = $amount;\r\n }\r\n\r\n\r\n if($type == 'debit'){\r\n $debit = $amount;\r\n }\r\n\r\n $cellphone ='0' . substr($cellphone,-9);\r\n $msisdn ='27' . substr($cellphone,-9);\r\n\r\n if(strlen($cellphone) != 10 || substr($cellphone, 0,-9) != '0'){\r\n $result = false;\r\n }\r\n\r\n if(!is_numeric($amount) || $amount <= 0){\r\n $result = false;\r\n }\r\n\r\n if($result){\r\n $result = $this->db->query(\"INSERT INTO `comm_wallet_transactions` \r\n (msisdn, debit, credit, reference, createdate) VALUES (?, ?, ?, ?, NOW())\", \r\n array(trim($cellphone), trim($debit), trim($credit), trim($reference)));\r\n return $this->db->insert_id();\r\n }\r\n\r\n return $result;\r\n\r\n }", "function add_money(){\n\t\t$coupon_id=$_REQUEST['coupon_id'];\n\t\t$coupon_amount=$_REQUEST['coupon_amount'];\n\t\t$user_id=$_REQUEST['recharge_user_id'];\n\t\t$user_amount=$_REQUEST['recharge_amount'];\n\t\t$final_amount=$coupon_amount+$user_amount;\n\t//\t$wt_type=$_POST['wt_type']; //1- debit in account, 2- credit in account\n\t\t$wt_type=1; // credit\n\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\t$wt_category=1; // 1-Add moeny, 2-Recharge\n\t\t$w_category=6; // Amount Recieved when coupon code apply\n\t\t//$card_no=$_REQUEST['card_number'];\n\t\t//$cvv_no=$_REQUEST['cvv_no'];\n\t\t$w_desc=\"Amount Recieved when add money \".$user_amount .\" with get amount \".$coupon_amount;\n\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t//$transaction_id =$_POST['recharge_transaction_id']; // if wt_category=1 then payment gateway transaction id and 2 for recharge id;\n\t\t$wt_desc=\"Add Money\"; // description of transaction like as add moeny, recharge;\n\t\tif(!empty($user_id) && !empty($user_amount) && !empty($transaction_id)){\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t$user_wallet=$wallet_amount + $final_amount;\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $user_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\"');\n\t\t\tif(!empty($add_money)){\n\t\t\t\tif(!empty($coupon_id)){\n\t\t\t\t\t\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('coupon_details','coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\tif($add_money){\n\t\t\t\t\t\t$transaction_ids= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $coupon_amount . '\",\"' . $w_category . '\",\"' .$transaction_ids . '\",\"' . $w_desc . '\",\"' . $transaction_id . '\"');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t $data['wallet_amount']=$user_wallet;\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user','user_id',$user_id, $data);\n\t\t\t\t\t$post = array(\"status\" => \"true\",'message'=>\"Add amount successfully\", \"transaction_id\" =>$transaction_id,'add_amount'=>$user_amount,'wallet_amount'=>$user_wallet,'transaction_date'=>$current_date,'card_no'=>$card_no);\n\t\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Transaction Failed\");\n\t\t\t}\n\t\t}else{\n\t\t$post = array('status' => \"false\",\"message\" => \"Missing parameter\",'recharge_user_id'=>$user_id,'recharge_amount'=>$user_amount,'card_number'=>$card_no,'cvv_no'=>$cvv_no);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function transaction(User $user)\n {\n }", "private function add_user_transaction( $id_in, $amount_in, $time_in, $category_in )\n\t{\n\t\t//debug( $id_in . \" id ended \" . $amount_in . \" amount ended \" . $time_in . \" time ended \" . $category_in . \" category ended\" );\n\t\t$transaction = new UserTransaction;\n\t\t$transaction->set_user_transaction( $id_in, $this->get_id(), $amount_in, $time_in, $category_in );\n\t\t\n\t\tarray_push($this->user_transactions, $transaction);\n\t}", "function creditTransactionInsert($generals_id, $data, $totalProductCost, $otherProductCost, $newCylinderProductCost)\n {\n //58 account receiable head debit\n\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'debit' => $this->input->post('netTotal'), //sales - discount= grand + vat =newNettotal\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n\n\n //59 Prompt Given Discounts\n if (!empty($data['discount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '59',\n 'debit' => $data['discount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //49 Sales head credit\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '49',\n 'credit' => array_sum($this->input->post('price')),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //60 Sales tax/vat head credit\n if (!empty($data['vatAmount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '60',\n 'credit' => $data['vatAmount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //62 Cost of Goods-Retail head debit\n if (!empty($totalProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '62',\n 'debit' => $totalProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //52 account Inventory head credit\n if (!empty($otherProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '52',\n 'credit' => $otherProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //cylinder product stock.\n if (!empty($newCylinderProductCost)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '173',\n 'credit' => $newCylinderProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n //loader account head credit\n //transportation account head credit\n //loader and transportation account receiaveable head debit against credit\n\n $loaderAmount = $this->input->post('loaderAmount');\n $transportationAmount = $this->input->post('transportationAmount');\n if (!empty($loaderAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '391',\n 'credit' => $loaderAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n if (!empty($transportationAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '392',\n 'credit' => $transportationAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n }", "function makeTransaction($userId, $firstName, $lastName, $address, $state, $city, $zipCode, $phone, \n $shippingMethod, $cardType, $cardNumber, $CVC, $cardMonth, $cardYear, $price) {\n global $connect;\n\n $timestamp = date('Y-m-d G:i:s');\n\n $sql = \"INSERT INTO `transactionhistory`(datetimecreate, userid, firstName, lastName, address, state, city, zipCode, phone, shippingMethod, cardType, cardNumber, CVC, cardMonth, cardYear, price) \n VALUES ('\" . $timestamp . \"', '\" . $userId . \"', '\" . $firstName . \"', '\" . $lastName . \"', '\" . $address . \"', '\" . $state . \"', '\" . $city . \"', '\" . $zipCode . \"', '\" . $phone .\n \"', '\" . $shippingMethod . \"', '\" . $cardType . \"', '\" . $cardNumber . \"', '\" . $CVC . \"', '\" . $cardMonth . \"', '\" . $cardYear . \"', '\" . $price .\"')\";\n\n //execute sql query\n mysqli_query($connect, $sql);\n\n $result = array('result' => false,\n 'timestamp' => $timestamp);\n\n if(mysqli_affected_rows($connect) > 0) {\n $result['result'] = true;\n }\n \n return $result;\n }", "public function whmcs_add_credit($params = array()) {\n\t\t$params['action'] = 'AddCredit';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "function insert_transaction_record()\n\t{\n\t\t$invoice_id = strtotime('now');\n\t\t\n\t\t$data = array(\n\t\t 'user_id' => $this->user_id,\n\t\t 'invoice_id' => $invoice_id,\n\t\t 'product_id' => $this->auction_id,\t\t \t\t\n\t\t 'credit_debit' => 'DEBIT',\t\t \n\t\t 'transaction_name' =>'Bid Fee For auction ID: '.$this->auction_id,\n\t\t 'transaction_date' => $this->general->get_local_time('time'),\n\t\t 'transaction_type' => 'bid',\n\t\t 'transaction_status' => 'Completed',\t\t \n\t\t 'payment_method' => 'direct',\n\t\t 'amount'=>$this->user_bid_amt,\n\t\t 'pay_type' => $this->payment_type,\n\t \t);\n\t\t\n\t\t$this->db->insert('transaction', $data);\n\t\treturn $this->db->insert_id(); \t\n\t}", "function addnewPayment($cid, $Amount, $AdditionalAmount, $days, $userid) {\n\n $Date = date(\"Y-m-d H:i\");\n\n $sql = \"INSERT INTO invoice_payments (Amount,AdditionalAmount,DateTime,Credit_Invoice_idCredit_Invoice,User_idUser,PayFor,Status) \"\n\n . \"VALUES ($Amount,$AdditionalAmount,'$Date',$cid,$userid,$days,'1')\";\n\n\n\n if (mysqli_query($this->con, $sql)) {\n\n// return 'error:' . mysqli_error($this->con);\n\n return true;\n\n } else {\n\n// return 'error:' . mysqli_error($this->con);\n\n return false;\n\n }\n\n }", "public function add(){\n if ($_POST) {\n if ($_POST[\"operation\"] == 'egreso'){\n $_POST[\"amount\"] = $_POST[\"amount\"]*(-1);\n }\n if ($this->transactions->save(\"transactions\", $_POST)) {\n $this->redirect(array(\"controller\"=>\"transactions\"));\n }else{\n $this->redirect(array(\"controller\"=>\"transactions\", \"method\"=>\"add\"));\n }\n }\n \n $this->set(\"accounts\", $this->transactions->find(\"accounts\"));\n $this->set(\"categories\", $this->transactions->find(\"categories\"));\n $this->_view->setView(\"add\");\n /* }else{\n $this->redirect(array(\"controller\"=>\"transactions\"));\n }*/\n }", "function cashTransactionInsert($generals_id, $data, $totalProductCost, $otherProductCost, $newCylinderProductCost, $mrid)\n {\n //58 account receiable head debit\n\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'debit' => $this->input->post('netTotal'), //sales - discount= grand + vat =newNettotal\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //59 Prompt Given Discounts\n if (!empty($data['discount'])) :\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '59',\n 'debit' => $data['discount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //49 Sales head credit\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '49',\n 'credit' => array_sum($this->input->post('price')),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //60 Sales tax/vat head credit\n if (!empty($data['vatAmount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '60',\n 'credit' => $data['vatAmount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //7501 Cost of Goods-Retail head debit\n if (!empty($totalProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '62',\n 'debit' => $totalProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //52 account Inventory head credit\n if (!empty($otherProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '52',\n 'credit' => $otherProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //cylinder product stock.\n if (!empty($newCylinderProductCost)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '173',\n 'credit' => $newCylinderProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n\n //loader account head credit\n //transportation account head credit\n //loader and transportation account receiaveable head debit against credit\n $loaderAmount = $this->input->post('loaderAmount');\n $transportationAmount = $this->input->post('transportationAmount');\n if (!empty($loaderAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '391',\n 'credit' => $loaderAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n if (!empty($transportationAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '392',\n 'credit' => $transportationAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n\n\n //customer payment ledger\n $generals_data = array(\n 'form_id' => '7',\n 'customer_id' => $this->input->post('customer_id'),\n 'dist_id' => $this->dist_id,\n 'mainInvoiceId' => $generals_id,\n 'voucher_no' => $this->input->post('voucherid'),\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'credit' => $this->input->post('netTotal'),\n 'narration' => $this->input->post('narration'),\n 'updated_by' => $this->admin_id,\n 'created_at' => $this->timestamp\n );\n $generalPaymentId = $this->Common_model->insert_data('generals', $generals_data);\n //1301 Cash in Hand head debit\n $singleLedger = array(\n 'generals_id' => $generalPaymentId,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '54',\n 'debit' => $this->input->post('netTotal'),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //58 Account Receivable head credit\n $singleLedger = array(\n 'generals_id' => $generalPaymentId,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'credit' => $this->input->post('netTotal'),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //client vendor ledger\n $customerLedger1 = array(\n 'ledger_type' => 1,\n 'trans_type' => 'Sales Payment',\n 'history_id' => $generalPaymentId,\n 'trans_type' => $this->input->post('voucherid'),\n 'client_vendor_id' => $this->input->post('customer_id'),\n 'dist_id' => $this->dist_id,\n 'updated_by' => $this->admin_id,\n 'amount' => $this->input->post('netTotal'),\n 'cr' => $this->input->post('netTotal'),\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate')))\n );\n $this->db->insert('client_vendor_ledger', $customerLedger1);\n //money Receite General\n $moneyReceit = array(\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'invoiceID' => json_encode($this->input->post('voucherid')),\n 'totalPayment' => $this->input->post('netTotal'),\n 'receitID' => $mrid,\n 'mainInvoiceId' => $generals_id,\n 'dist_id' => $this->dist_id,\n 'customerid' => $this->input->post('customer_id'),\n 'narration' => $this->input->post('narration'),\n 'updated_by' => $this->admin_id,\n 'paymentType' => 1\n );\n $this->db->insert('moneyreceit', $moneyReceit);\n }", "function addCrediInvoice($totalAmount, $grantAmount, $InterestRate, $DailyEqualPayment, $Days, $PaidAmount, $Settled, $Debitors_idDebitors, $CollectionArea_idCollectionArea, $userid, $loan_type) {\n\n\n\n $Date = date(\"Y-m-d\");\n\n $sql = \"INSERT INTO credit_invoice (TotalAmount,GrantAmount,InterestRate,DailyEqualPayment,Days,PaidAmount,Settled,DateTime,Debitors_idDebitors,CollectionArea_idCollectionArea,Status,user_idUser,`type`) \"\n\n . \"VALUES ($totalAmount,$grantAmount, '$InterestRate', '$DailyEqualPayment', '$Days','$PaidAmount','$Settled','$Date','$Debitors_idDebitors','$CollectionArea_idCollectionArea', '0',$userid,'$loan_type')\";\n\n\n\n if (mysqli_query($this->con, $sql)) {\n\n $last_id = $this->con->insert_id;\n\n return $last_id;\n\n// return \"true\";\n\n } else {\n\n// return 'error:' . mysqli_error($this->con);\n\n return \"false\";\n\n }\n\n }", "function addTransaction($data) {\n\n $import = $this->getPdo()->prepare(\"INSERT into Transaction (day, amount, name, account_id, category_id) VALUES ( :date, :amount, :name, :accountId, :categoryId )\");\n\n $import->execute(array(\n 'date' \t\t=> $data['date'],\n 'amount' \t\t=> $data['amount'],\n 'name' \t \t\t=> $data['name'],\n 'accountId' \t=> $data['account_id'],\n 'categoryId' \t=> $data['category_id']\n ));\n\n return 'done';\n }", "public function add_transaction($transaction_values){\n $this->load->database();\n\n return $query = $this->db->insert('tbl_transactions',$transaction_values);\n }", "function addTransaction($account, $expensetype, $amount, $type, $date){\n\t\t// check if input data is valid\n\t\tif($expensetype == null || strlen($expensetype) == 0){\n\t\t\tthrow new Exception (\"Please enter a valid transaction type.\");\n\t\t}\n\t\telse if ($amount == null || strlen($amount) == 0 || !(is_numeric($amount))){\n\t\t\tthrow new Exception (\"Please enter a valid amount.\");\n\t\t} \n\t\telse if ($date == null){\n\t\t\tthrow new Exception (\"Please enter a date.\");\n\t\t} else {\n\t\t\t$urlms = $this->urlms;\n\t\t\t$urlmsLab = $urlms->getLab_index(0);\n\t\t\t// find the account that receives a transaction\n\t\t\t$fundingAccount = $this->findFundingAccount($account);\n\t\t\t// create a new expense and add it to the account that was previously found using the input\n\t\t\t$newExpense = new Expense($amount, $date, $expensetype, $fundingAccount);\n\t\t\t$fundingAccount->addExpense($newExpense);\n\t\t\t\n\t\t\t// check if transaction is an expense or a fund\n\t\t\t// and add or substract from balance accordingly\n\t\t\tif($type == \"expense\"){\n\t\t\t\t$fundingAccount->setBalance($fundingAccount->getBalance() - $newExpense->getAmount());\n\t\t\t\t$newExpense->setAmount(-$amount);\n\t\t\t} \n\t\t\telse if ($type == \"fund\"){\n\t\t\t\t$fundingAccount->setBalance($fundingAccount->getBalance() + $newExpense->getAmount());\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthrow new Exception (\"Please choose a valid type of transaction.\");\n\t\t\t}\n\t\t\t// Write data\n\t\t\t//$persistence = new Persistence();\n\t\t\t$this->persistence->writeDataToStore($urlms);\n\t\t\t\n\t\t\t?>\n\t\t\n\t\t\t<!-- Refresh back to funding view -->\n\t\t\t<HTML>\n\t\t\t\t<meta http-equiv=\"refresh\" content=\"0; URL='../view/FundingView.php'\" />\n\t\t\t\t<p>New transation item successfully added!</p>\n\t\t\t\t<a href=\"../view/FundingView.php\">Back</a>\n\t\t\t</HTML><?php\n\t\t}\n\t}", "final public function addItemTechnicianInCharge() {\n $this->addUserByField('users_id_tech', true);\n }", "public function addTransaction($data)\n\t{\n\t\ttry {\n\t\t\t$fields = implode(', ', array_map(\n\t\t\t\t\tfunction ($value, $key) {\n\t\t\t\t\t\treturn sprintf('`%s`', $key);\n\t\t\t\t\t},\n\t\t\t\t\t$data,\n\t\t\t\t\tarray_keys($data)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$values = implode(', ', array_map(\n\t\t\t\t\tfunction ($value) {\n\t\t\t\t\t\treturn sprintf(\"'%s'\", $value);\n\t\t\t\t\t},\n\t\t\t\t\t$data,\n\t\t\t\t\tarray_keys($data)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->db->query(\"\n\t\t\t\tINSERT INTO\n\t\t\t\t\t`\" . DB_PREFIX . \"emerchantpay_checkout_transactions` (\" . $fields . \")\n\t\t\t\tVALUES\n\t\t\t\t\t(\" . $values . \")\n\t\t\t\");\n\t\t} catch (Exception $exception) {\n\t\t\t$this->logEx($exception);\n\t\t}\n\t}", "public function actionCreate()\n {\n /* @var \\common\\models\\User $usr */\n $usr = Yii::$app->user->identity;\n\n $model = new CreateTransaction();\n $model->user_id = Yii::$app->user->id;\n $model->account_from = $usr->account->id;\n\n if ($model->load(Yii::$app->request->post())) {\n try {\n if (!Account::findOne($model->account_to)->user->is_admin) {\n throw new ForbiddenHttpException('You cannot transfer money to another user’s account.');\n }\n $model->createTransaction();\n Yii::$app->session->setFlash('createUserTransaction', 'ok');\n return $this->goBack();\n } catch (\\Exception $e) {\n Yii::$app->session->setFlash('createUserTransaction', $e->getMessage());\n }\n } else {\n Yii::$app->session->setFlash('createUserTransaction', 'Please fill out the following form');\n }\n return $this->render('create', ['model' => $model]);\n }", "public function action_account_transaction() {\n $package = Model::factory('package');\n $invoice_id = explode('/', $_SERVER['REQUEST_URI']);\n $transaction_info = $package->account_transaction($invoice_id[3]);\n $this->template->title = CLOUD_SITENAME . ' | Account';\n $this->template->page_title = __('account_transaction_details');\n $this->meta_description = \"\";\n $this->template->content = View::factory(\"admin/package_plan/account_transaction\")\n ->bind('transaction_info', $transaction_info);\n }", "function createTransaction( $db, $tx_data, $wallet_id ) {\r\n // Insert the transaction data\r\n $db->insert( 'transactions', $tx_data );\r\n // TODO: Record this transaction in the logs\r\n // Now get the current wallet balance\r\n $current_balance = $db->get( 'wallets','balance',[ 'id' => $wallet_id ]);\r\n // Update the wallet with the new Balance\r\n $db->update( 'wallets',\r\n [\r\n 'balance[+]' => $tx_data['amount'],\r\n 'activated' => 1\r\n ],\r\n [ 'id' => $wallet_id ]\r\n );\r\n // If all went well, return an array with the transaction status\r\n return [\r\n 'success' => true,\r\n 'data' => [\r\n 'ref_no' => $tx_data['ref_no'],\r\n 'prev_bal' => $current_balance,\r\n 'currency' => $tx_data['currency'],\r\n 'new_bal' => ( $current_balance + $tx_data['amount'] )\r\n ]\r\n ];\r\n}", "function addCreditCard($userDetails){\n\ttry{\n\t\t$cardRegister = new \\MangoPay\\CardRegistration();\n\t\t$cardRegister->UserId \t= $userDetails['userAccountId'];\n\t\t$cardRegister->Currency = $userDetails['userCurrency'];\n\t\t$createdCardRegister = $mangoPayApi->CardRegistrations->Create($cardRegister);\n\t\t$data\n\t\t\n\t\t$handle = curl_init();\n\t\tcurl_setopt($handle, CURLOPT_URL, $url);\n\t\tcurl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($handle, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); \n\t\tcurl_setopt($handle, CURLOPT_POST, true);\n\t\tcurl_setopt($handle, CURLOPT_POSTFIELDS, $data);\n\t\t$response = curl_exec($handle);\n\t\t\n\t\t\n\t\t\n\t}\n\tcatch(Exception $e) {\n\t\treturn $e;//error in field values\n\t}\n\n}", "public function add()\n {\n echo '客户需求添加一个新需求' . PHP_EOL;\n }", "public function createUserRequestTransaction(User_Model_User $user, $request_id, array $params = array()) {\n\n //FETCH RESPONSE DETAIL\n if ($params['source_type'] == 'siteeventticket_paymentrequest') {\n $response = Engine_Api::_()->getDbtable('paymentrequests', 'siteeventticket')->getResponseDetail($request_id);\n } elseif ($params['source_type'] == 'sitestoreproduct_paymentrequest') {\n $response = Engine_Api::_()->getDbtable('paymentrequests', 'sitestoreproduct')->getResponseDetail($request_id);\n }\n $authemail = '';\n $params['amount'] = @round($response[0]['response_amount'], 2);\n\n $params = array_merge($params, array(\n 'AMT' => @round($response[0]['response_amount'], 2),\n 'ITEMAMT' => @round($response[0]['response_amount'], 2),\n 'SOLUTIONTYPE' => 'sole',\n ));\n $params['additionalinfo'] = \"Payment Request\";\n $params = $this->setExtraParams($params);\n\n // Create transaction\n $transaction = $this->createTransaction($params);\n\n return $transaction;\n }", "public function addCustomer($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'YourSystemReference' => $data['systemRef'],\n\t\t\t\t'YourGeneralReference' => $data['generalRef'],\n\t\t\t\t'LastName' => $data['lastName'],\n\t\t\t\t'FirstName' => $data['firstName'],\n\t\t\t\t'AddressLine1' => $data['addressLine1'],\n\t\t\t\t'AddressLine2' => $data['addressLine2'],\n\t\t\t\t'AddressSuburb' => $data['suburb'],\n\t\t\t\t'AddressState' => $data['state'],\n\t\t\t\t'AddressPostCode' => $data['postCode'],\n\t\t\t\t'EmailAddress' => $data['email'],\n\t\t\t\t'MobilePhoneNumber' => $data['phone'],\n\t\t\t\t'ContractStartDate' => $data['startDate'],\n\t\t\t\t'SmsPaymentReminder' => $data['smsReminder'],\n\t\t\t\t'SmsFailedNotification' => $data['smsFailed'],\n\t\t\t\t'SmsExpiredCard' => $data['smsExpired'],\n\t\t\t\t'Username' => $data['username']\n\t\t];\n\n\t\treturn $response = $soapclient->addCustomer($params);\n\t}", "public function add_payee($id){\n\t\t\t//restricted this area, only for admin\n\t\t//permittedArea(['admin', 'agent']);\n\n\t\t$data['wal_debit'] \t= $this->ledger_model->total_wallet_debit();\n\t\t$data['wal_credit'] \t= $this->ledger_model->total_wallet_credit();\n\t\t\n\t\t//Get Decision who in online?\n\t\t$user = loggedInUserData();\n\t\t$userID = $user['user_id'];\n\t\t\n\t\t$user_contactno = singleDbTableRow($userID)->contactno;\n\t\t$user_first_name = singleDbTableRow($userID)->first_name;\n\t\t$user_referral_code = singleDbTableRow($userID)->referral_code;\n\n\t\t$data['users'] = singleDbTableRow($id, 'otp_transactions');\n\n\t\t\t\t\t\tif($this->input->post()) \n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\tif ($this->input->post('submit') != 'add_agent1') die('Error! sorry');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($this->input->post('submit1') == 'add_agent1'); // die('Error! sorry');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->form_validation->set_rules('otp', 'SMS OTP password ', 'required');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($this->form_validation->run() == true)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$sellProduct = $this->product_model->payee_transfer($id);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($sellProduct){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//redirect(base_url('product/invoice/'.$sellProduct));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tredirect(base_url('product/'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetFlashGoBack('errorMsg', 'Something went wrong! please try again later.');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\t\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\n\t\t\t\t\t\t\t\t\t\n\t\ttheme('add_payee', $data);\n\n\t}", "public function _add()\n {\n $type_code = post_param_string('type_code');\n $object = find_product($type_code);\n\n $amount = post_param_string('amount', '');\n if ($amount == '') {\n $products = $object->get_products(false, $type_code);\n $amount = $products[$type_code][1];\n if ($amount == '?') {\n warn_exit(do_lang_tempcode('INVOICE_REQUIRED_AMOUNT'));\n }\n }\n\n $to = post_param_string('to');\n $member_id = $GLOBALS['FORUM_DRIVER']->get_member_from_username($to);\n if (is_null($member_id)) {\n warn_exit(do_lang_tempcode('_MEMBER_NO_EXIST', escape_html($to)));\n }\n\n $id = $GLOBALS['SITE_DB']->query_insert('invoices', array(\n 'i_type_code' => $type_code,\n 'i_member_id' => $member_id,\n 'i_state' => 'new',\n 'i_amount' => $amount,\n 'i_special' => post_param_string('special'),\n 'i_time' => time(),\n 'i_note' => post_param_string('note')\n ), true);\n\n log_it('CREATE_INVOICE', strval($id), $type_code);\n\n send_invoice_notification($member_id, $id);\n\n $url = build_url(array('page' => '_SELF', 'type' => 'outstanding'), '_SELF');\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }", "private function sellTrasactionAddsMoney(){\n\n }", "public function add($user){\n\n $this->builder->insert($user);\n\n }", "function addUser($user)\n {\n $connection = Doctrine_Manager::connection();\n $query = \"INSERT INTO constant_contact (username, access_token, created_at) VALUES ('\".$user['username'].\"', '\".$user['access_token'].\"', '\".date('Y-m-d H:i:s').\"')\";\n $statement = $connection->execute($query);\n }", "public function ocenture_insert() {\r\n\r\n Logger::log(\"inserting user manually into ocenture\");\r\n require_once( OCENTURE_PLUGIN_DIR . 'lib/Ocenture.php' );\r\n\r\n $ocenture = new Ocenture_Client($this->clientId);\r\n\r\n $params = [\r\n 'args' => [\r\n 'ProductCode' => 'YP83815',\r\n 'ClientMemberID' => 'R26107633',\r\n 'FirstName' => 'Francoise ',\r\n 'LastName' => 'Rannis Arjaans',\r\n 'Address' => '801 W Whittier Blvd',\r\n 'City' => 'La Habra',\r\n 'State' => 'CA',\r\n 'Zipcode' => '90631-3742',\r\n 'Phone' => '(562) 883-3000',\r\n 'Email' => '[email protected]',\r\n 'Gender' => 'Female',\r\n 'RepID' => '101269477',\r\n ]\r\n ];\r\n \r\n Logger::log($params);\r\n $result = $ocenture->createAccount($params);\r\n //if ($result->Status == 'Account Created') \r\n {\r\n $params['args']['ocenture'] = $result;\r\n $this->addUser($params['args']); \r\n }\r\n Logger::log($result);\r\n \r\n }", "public function creditCardDeposit($user, $input)\n {\n //validate input\n $this->depositValidator->validate(\n $input,\n array_merge($this->depositValidator->rules, $this->creditCardDepositService->getCardValidationRules($user))\n );\n\n //check if a child user is the target for the deposit\n if( $childUser = array_get($input, 'child_username', null) ) {\n $depositUser = $this->userRepository->getUserByUsername($childUser);\n } else {\n $depositUser = $user;\n }\n\n //create deposit with gateway\n $response = $this->creditCardDepositService->deposit($depositUser, $input['amount'], array_except($input, array('source', 'amount')));\n\n //create transaction\n $transaction = $this->createDepositTransaction(\n $depositUser,\n AccountTransactionTypeRepositoryInterface::TYPE_EWAY_DEPOSIT,\n array_get($input, 'amount', 0),\n array_get($input, 'source', null)\n );\n\n //notifications\n $this->sendNotifications($depositUser->parent_user_id ? $depositUser->parent_user_id : $depositUser->id, $transaction['id'], array_get($input, 'source', null), $user->parent_user_id ? $user->id : null);\n\n return $transaction;\n }", "function purchase($id = null) {\n\t\tif(!empty($this->data)) { //Credit card is submitted\n\t\t\t$travelerID = $this->Session->read('Traveler.id'); //Check that they are logged in\n\t\t\tif(is_null($travelerID)) {\n\t\t\t\t$this->Session->setFlash(__('Please log in or create an account to make a purchase.', true));\n\t\t\t}\n\t\t\telse {//They are logged in. \n\t\t\t\t//Validate the CC and make the purchase.\n\t\t\t\t//debug($this->Deal->DealPurchase->find('count', array('conditions' => array('DealPurchase.deal_id' => $id))));\n\t\t\t\t$this->loadModel('Traveler');\n\t\t\t\t$traveler = $this->Traveler->read(null, $travelerID);\n\t\t\t\t$this->loadModel('Transaction');\n\t\t\t\t$this->data['Transaction']['cost'] = $this->Session->read('Trip.cost');\n\t\t\t\t$this->Transaction->set($this->data);\n\t\t\t\t//Billing info was entered. Now process the credit card\n\t\t\t\tif($this->Transaction->validates()) { //If CC info entered correctly\n\t\t\t\t\t$result = $this->Transaction->MakeBTTransaction($this->data, $traveler);\n\t\t\t\t\t//$result = Braintree_Transaction::sale($this->Transaction->buildBrainTreeTransaction($this->data, $traveler));\n\t\t\t\t\tif ($result->success) { //Braintree validation Success\n\t\t\t\t\t\t$purchase['DealPurchase']['deal_id'] = $id;\n\t\t\t\t\t\t$random_hash = substr(md5(uniqid(rand(), true)), -10, 10);\n\t\t\t\t\t\t$purchase['DealPurchase']['confirmation_code'] = $random_hash;\n\t\t\t\t\t\t$purchase['DealPurchase']['traveler_id'] = $travelerID;\n\t\t\t\t\t\t$purchase['DealPurchase']['start_date'] = $this->Session->read('Trip.start_date');\n\t\t\t\t\t\t$purchase['DealPurchase']['end_date'] = $this->Session->read('Trip.end_date');\n\t\t\t\t\t\t$purchase['DealPurchase']['purchase_amount'] = $this->Session->read('Trip.cost');\n\t\t\t\t\t\t$transaction = $result->transaction;\n\t\t\t\t\t\t$purchase['DealPurchase']['braintree_id'] = $transaction->id;\n\t\t\t\t\t\t$reservationType = $this->Deal->GetReservationType($id);\n\t\t\t\t\t\t//Save record for DealType 1 & 2\n\t\t\t\t\t\tif($reservationType == Configure::read('ReservationType.Fixed') || $reservationType == Configure::read('ReservationType.Variable')) {\n\t\t\t\t\t\t\t$this->loadModel('DealPurchase');\n\t\t\t\t\t\t\tif ($this->DealPurchase->save($purchase)) {\n\t\t\t\t\t\t\t\t$this->sendPurchaseMail($id, $travelerID, $this->DealPurchase->id, 'dealConfirmation');\n\t\t\t\t\t\t\t\t$this->redirect(array('controller' => 'deals', 'action'=>'confirmation',$id));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Insert Passenger records for DealType 3\n\t\t\t\t\t\telseif($reservationType == Configure::read('ReservationType.Set')) {\n\t\t\t\t\t\t\t$this->loadModel('Passenger');\n\t\t\t\t\t\t\t$purchase['Passenger']['first_name'] = $traveler['Traveler']['first_name'];\n\t\t\t\t\t\t\t$purchase['Passenger']['last_name'] = $traveler['Traveler']['last_name'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//use $this->Passenger so that the deal_purchase_id is inserted correctly\n\t\t\t\t\t\t\tif ($this->Passenger->saveAll($purchase)) {\n\t\t\t\t\t\t\t\t$this->redirect(array('controller' => 'deals', 'action'=>'confirmation',$id));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->Session->setFlash(__('The deal purchase could not be saved. Please, try again.', true),'error_flash');\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 { //Braintree validation failed\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->Session->setFlash(__('Unable to process your transaction. Please check your billing information and try again', true),'error_flash');\n\t\t\t\t\t\t/* Debugging code\n\t\t\t\t\t\tprint_r(\"\\n message: \" . $result->message);\n\t\t\t\t\t\tprint_r(\"\\nValidation errors: \\n\");\n\t\t\t\t\t\tprint_r($result->errors->deepAll());\n\t\t\t\t\t\tprint_r($expirationDate);\n\t\t\t\t\t\t*/\n\t\t\t\t\t} \n\t\t\t\t\n\t\t\t\t} else {//CC info not entered correctly\n\t\t\t\t\t$this->Session->setFlash(__('Billing information missing or formatted incorrectly. Please fix the errors and try again', true), 'error_flash');\n\t\t\t\t}\t\n\t\t\t}\n\t\t}//No data submitted. Load the page.\n\t//If you haven't been redirected yet, load the page\n\t$deal = $this->Deal->read(null, $id);\n\t$deal['Deal']['trip_start_date'] = $this->Session->read('Trip.start_date');\n\t$deal['Deal']['trip_end_date'] = $this->Session->read('Trip.end_date');\n\t$deal['Deal']['days'] = $this->Session->read('Trip.days');\n\t$deal['Deal']['cost'] = $this->Session->read('Trip.cost');\n\t$this->set(compact('deal')); \n\n\t}", "function add($Input = array(), $UserID, $CouponID = NULL) {\n /* Get Coupon Details */\n if (!empty($CouponID)) {\n $this->load->model('Store_model');\n $CouponDetailsArr = $this->Store_model->getCoupons('CouponTitle,CouponDescription,CouponCode,CouponType,CouponValue', array('CouponID' => $CouponID));\n $CouponDetailsArr['DiscountedAmount'] = ($CouponDetailsArr['CouponType'] == 'Flat' ? $CouponDetailsArr['CouponValue'] : ($Input['Amount'] / 100) * $CouponDetailsArr['CouponValue']);\n }\n /* Add Wallet Pre Request */\n $TransactionID = substr(hash('sha256', mt_rand() . microtime()), 0, 20);\n $InsertData = array(\n \"Amount\" => @$Input['Amount'],\n \"WalletAmount\" => @$Input['Amount'],\n \"PaymentGateway\" => $Input['PaymentGateway'],\n \"CouponDetails\" => (!empty($CouponID)) ? json_encode($CouponDetailsArr) : NULL,\n \"CouponCode\" => (!empty($CouponID)) ? $CouponDetailsArr['CouponCode'] : NULL,\n \"TransactionType\" => 'Cr',\n \"TransactionID\" => $TransactionID,\n \"Narration\" => 'Deposit Money',\n \"EntryDate\" => date(\"Y-m-d H:i:s\")\n );\n $WalletID = $this->addToWallet($InsertData, $UserID);\n if ($WalletID) {\n $PaymentResponse = array();\n $Input['PaymentGateway'] = trim($Input['PaymentGateway']);\n if ($Input['PaymentGateway'] == 'PayUmoney') {\n\n /* Generate Payment Hash */\n $Amount = (strpos(@$Input['Amount'], '.') !== FALSE) ? @$Input['Amount'] : @$Input['Amount'] . '.0';\n $HashString = PAYUMONEY_MERCHANT_KEY . '|' . $TransactionID . \"|\" . $Amount . \"|\" . $WalletID . \"|\" . @$Input['FirstName'] . \"|\" . @$Input['Email'] . \"|||||||||||\" . PAYUMONEY_SALT;\n /* Generate Payment Value */\n $PaymentResponse['Action'] = PAYUMONEY_ACTION_KEY;\n $PaymentResponse['MerchantKey'] = PAYUMONEY_MERCHANT_KEY;\n $PaymentResponse['Salt'] = PAYUMONEY_SALT;\n $PaymentResponse['MerchantID'] = PAYUMONEY_MERCHANT_ID;\n $PaymentResponse['Hash'] = strtolower(hash('sha512', $HashString));\n $PaymentResponse['TransactionID'] = $TransactionID;\n $PaymentResponse['Amount'] = $Amount;\n $PaymentResponse['Email'] = @$Input['Email'];\n $PaymentResponse['PhoneNumber'] = @$Input['PhoneNumber'];\n $PaymentResponse['FirstName'] = @$Input['FirstName'];\n $PaymentResponse['ProductInfo'] = $WalletID;\n $PaymentResponse['SuccessURL'] = SITE_HOST . ROOT_FOLDER . 'myAccount?status=success';\n $PaymentResponse['FailedURL'] = SITE_HOST . ROOT_FOLDER . 'myAccount?status=failed';\n } elseif ($Input['PaymentGateway'] == 'Paytm') {\n\n /* Generate Checksum */\n $ParamList = array();\n $PaymentResponse['MerchantID'] = $ParamList['MID'] = PAYTM_MERCHANT_ID;\n $PaymentResponse['OrderID'] = $ParamList['ORDER_ID'] = $WalletID;\n $PaymentResponse['CustomerID'] = $ParamList['CUST_ID'] = \"CUST\" . $UserID;\n $PaymentResponse['IndustryTypeID'] = $ParamList['INDUSTRY_TYPE_ID'] = PAYTM_INDUSTRY_TYPE_ID;\n $PaymentResponse['ChannelID'] = $ParamList['CHANNEL_ID'] = ($Input['RequestSource'] == 'Web') ? 'WEB' : 'WAP';\n $PaymentResponse['Amount'] = $ParamList['TXN_AMOUNT'] = $Input['Amount'];\n $PaymentResponse['Website'] = $ParamList['WEBSITE'] = ($Input['RequestSource'] == 'Web') ? PAYTM_WEBSITE_WEB : PAYTM_WEBSITE_APP;\n $PaymentResponse['CallbackURL'] = $ParamList['CALLBACK_URL'] = ($Input['RequestSource'] == 'Web') ? SITE_HOST . ROOT_FOLDER . 'api/main/paytmResponse' : 'https://' . PAYTM_DOMAIN . '/paytmchecksum/paytmCallback.jsp';\n $PaymentResponse['TransactionURL'] = PAYTM_TXN_URL;\n $PaymentResponse['CheckSumHash'] = $this->generatePaytmCheckSum($ParamList, PAYTM_MERCHANT_KEY);\n } elseif ($Input['PaymentGateway'] == 'Paypal') {\n\n require APPPATH . 'third_party/paypal/lib/Braintree.php';\n $gateway = new Braintree_Gateway([\n 'accessToken' => PAYPAL_TOKEN\n ]);\n $clientToken = $gateway->clientToken()->generate();\n $UpdataData = array(\n 'PaymentGatewayResponse' => $clientToken\n );\n $this->db->where('WalletID', $WalletID);\n $this->db->limit(1);\n $this->db->update('tbl_users_wallet', $UpdataData);\n\n $PaymentResponse['ClientToken'] = $clientToken;\n $PaymentResponse['OrderID'] = $WalletID;\n $PaymentResponse['Amount'] = $Amount;\n }\n return $PaymentResponse;\n }\n return FALSE;\n }", "public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}", "function addContractHandler1() {\n global $inputs;\n\n $cid = insert('contract',[\n 'title' => $inputs['title'],\n 'content' => $inputs['content'],\n 'status' => $inputs['status'],\n ]);\n\n insert('user_contract',[\n 'user_type' => $inputs['role'],\n 'uid' => $inputs['id'],\n 'contract_id' => $cid,\n ]);\n\n formatOutput(true, 'add success');\n}", "public function add() {\n require_once(MODEL . \"master/cabang.php\");\n $loader = null;\n $log = new UserAdmin();\n\t\t$transfer = new Transfer();\n $transfer->CabangId = $this->userCabangId;\n if (count($this->postData) > 0) {\n\t\t\t$transfer->CabangId = $this->GetPostValue(\"CabangId\");\n\t\t\t$transfer->NpbDate = $this->GetPostValue(\"NpbDate\");\n $transfer->NpbNo = $this->GetPostValue(\"NpbNo\");\n $transfer->NpbDescs = $this->GetPostValue(\"NpbDescs\");\n $transfer->ToCabangId = $this->GetPostValue(\"ToCabangId\");\n if ($this->GetPostValue(\"NpbStatus\") == null || $this->GetPostValue(\"NpbStatus\") == 0){\n $transfer->NpbStatus = 1;\n }else{\n $transfer->NpbStatus = $this->GetPostValue(\"NpbStatus\");\n }\n $transfer->CreatebyId = AclManager::GetInstance()->GetCurrentUser()->Id;\n if ($this->ValidateMaster($transfer)) {\n if ($transfer->NpbNo == null || $transfer->NpbNo == \"-\" || $transfer->NpbNo == \"\"){\n $transfer->NpbNo = $transfer->GetNpbDocNo();\n }\n $rs = $transfer->Insert();\n if ($rs != 1) {\n if ($this->connector->IsDuplicateError()) {\n $this->Set(\"error\", \"Maaf Nomor Dokumen sudah ada pada database.\");\n } else {\n $this->Set(\"error\", \"Maaf error saat simpan master dokumen. Message: \" . $this->connector->GetErrorMessage());\n }\n $log = $log->UserActivityWriter($this->userCabangId,'inventory.transfer','Add New Stock Transfer',$transfer->NpbNo,'Failed');\n }else{\n $log = $log->UserActivityWriter($this->userCabangId,'inventory.transfer','Add New Stock Transfer',$transfer->NpbNo,'Success');\n redirect_url(\"inventory.transfer/edit/\".$transfer->Id);\n }\n\t\t\t}\n\t\t}\n //load data cabang\n $loader = new Cabang();\n $cabang = $loader->LoadByEntityId($this->userCompanyId);\n //kirim ke view\n $this->Set(\"cabangs\", $cabang);\n $this->Set(\"transfer\", $transfer);\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Transaction;\n\t\t\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Transaction']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Transaction'];\n\t\t\t//if account owned by this user save the model else throw exception\n\t\t\tif($this->userOwnsAccount($model->acc_id))\n\t\t\t{\n\t\t\t\tif($model->save()) $this->redirect(array('view','id'=>$model->id));\n\t\t\t}\n\t\t\telse throw new CHttpException(403,'You are not authorized to add a Transaction to this account.');\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function addAccount(){\n\n\t}", "public function addTransactionId($id_order, $id_transaction)\r\n\t{\r\n\t\tif (version_compare(_PS_VERSION_, '1.5', '>='))\r\n\t\t{\r\n\t\t\t$new_order = new Order((int)$id_order);\r\n\t\t\tif (Validate::isLoadedObject($new_order))\r\n\t\t\t{\r\n\t\t\t\t$payment = $new_order->getOrderPaymentCollection();\r\n\t\t\t\tif (isset($payment[0]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$payment[0]->transaction_id = pSQL($id_transaction);\r\n\t\t\t\t\t$payment[0]->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function purchaseAccountLedgerEntry()\n {\n $items = $this->getItems();\n \n $financeLedger = new Core_Model_Finance_Ledger;\n $salesLedgerRecord = $financeLedger->fetchByName('Purchase Account');\n \n $totalPrice = 0;\n for($i = 0; $i <= sizeof($items)-1; $i += 1) {\n $price = $items[$i]['unit_price'] * $items[$i]['quantity'];\n $totalPrice = $totalPrice + $price;\n }\n $notes = 'Purchase with Purchase Id = '.$this->_purchaseId;\n \n $dataToInsert = array(\n 'debit' => $totalPrice,\n 'credit' => \"0\",\n 'notes' => $notes,\n 'transaction_timestamp' => $this->_transactionTime,\n 'fa_ledger_id' => $salesLedgerRecord['fa_ledger_id']\n );\n $ledgerEntryModel = new Core_Model_Finance_Ledger_Entry;\n $ledgerEntryId = $ledgerEntryModel->create($dataToInsert);\n return $ledgerEntryId;\n }", "public function transfert()\n {\n\n $account = \\Stripe\\Account::create([\n 'country' => 'US',\n 'type' => 'custom',\n 'requested_capabilities' => ['card_payments', 'transfers'],\n ]);\n\n $transfer = Transfer::create([\n 'amount' => 7000,\n 'currency' => 'usd',\n 'destination' => $account->id,\n 'transfer_group' => '{ORDER10}',\n ]);\n }", "function add_multi() {\n \t\t//-- step 1 pilih kode pelanggan\n \t\t$this->load->model('customer_model');\n\t\t$this->load->model('bank_accounts_model');\n \t\t$data['no_bukti']=$this->nomor_bukti();\n\t\t$data['date_paid']=date('Y-m-d');\n\t\t$data['how_paid']='Cash';\n\t\t$data['amount_paid']=0;\n\t\t$data['mode']='add';\n\t\t$data['customer_number']='';\n\t\t$data['how_paid_acct_id']='';\n\t\t$data['how_paid']='';\n\t\t$data['customer_list']=$this->customer_model->customer_list();\n\t\t$data['account_list']=$this->bank_accounts_model->account_number_list();\n\t\t$data['credit_card_number']='';\n\t\t$data['expiration_date']=date('Y-m-d');\n\t\t$data['from_bank']='';\n\t\t$this->template->display_form_input('sales/payment_multi',$data,'');\t\t\t\n\t\t\n }", "public function add(Transaction $transaction): void\n {\n $this->transactionsByUserAndType[$transaction->getUserId()][$transaction->getOperationType()][] = $transaction;\n }", "function transfer_money() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\t$mobile = $_REQUEST['mobile_no'];\n\t\t$amount = $_REQUEST['amount'];\n\t\t$mobile_no = $_REQUEST['mobile_no'];\n\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main = 2;\n\t\t// amount debit in user self\n\t\t$wallet_type_frnd = 1;\n\t\t// amount credit in frnd\n\t\t$wallet_category_to = 5;\n\t\t// transfer money to\n\t\t$wallet_category_from = 10;\n\t\t// transfer money from\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\tif (!empty($mobile)) {\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif (!empty($user_records)) {\n\t\t\t\t$main_wallet = $user_records['0']['wallet_amount'];\n\t\t\t\t$contact_number_main = $user_records['0']['user_contact_no'];\n\t\t\t\t// main user mobile number\n\t\t\t\tif ($main_wallet >= $amount) {\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\t\tif (!empty($records)) {\n\t\t\t\t\t\t$contact_number_frnd = $records['0']['user_contact_no'];\n\t\t\t\t\t\t// frnd mobile number\n\t\t\t\t\t\t$frnd_wallet = $records['0']['wallet_amount'];\n\t\t\t\t\t\t$frnd_id = $records['0']['user_id'];\n\t\t\t\t\t\tif ($frnd_id != $user_id) {\n\t\t\t\t\t\t\t// amount transfer to another\n\t\t\t\t\t\t\t$transaction_id1 = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t$w_to_desc = \"Amount transfer to \" . $contact_number_frnd;\n\t\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' . $transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\t\tif (!empty($wallet_to_transfer)) {\n\t\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t$w_by_desc = \"Amount transfer from \" . $contact_number_main;\n\t\t\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' . $transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!empty($wallet_by_transfer)) {\n\t\t\t\t\t\t\t\t$main_wallet_money = $main_wallet - $amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money = $frnd_wallet + $amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount'] = $main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount'] = $frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $frnd_id, $data1);\n\t\t\t\t\t\t\t\t$post = array('status' => 'true', 'message' => 'Transfer money successfully', 'main_user_id' => $user_id, 'main_wallet' => $main_wallet_money, 'frnd_wallet' => $frnd_wallet_money, 'frnd_id' => $frnd_id, 'transfer_mobile' => $mobile_no, 'transfer_amount' => $amount, 'transaction_id' => $transaction_id1, 'transfer_date' => $current_date);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Please enter another user number\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"This user is not exist of given number\");\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"invalid user\", 'user_id' => $user_id);\n\t\t\t}\n\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"missing parameter\", 'user_id' => $user_id, 'amount' => $amount, 'mobile' => $moble);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "function newDeposit($user, $amount, $operation_id){\r\n global $pdo;\r\n $stmt = $pdo->prepare('INSERT INTO deposits (DepositUserID, DepositDate, DepositAmount, DepositVerification, DepositType) VALUES (:DepositUserID, :DepositDate, :DepositAmount, :DepositVerification, :DepositType)');\r\n $stmt->execute(array(':DepositUserID' => $user, ':DepositDate' => time(), ':DepositAmount' => $amount, ':DepositVerification' => $operation_id, ':DepositType' => 'FreeKassa'));\r\n}", "public function add(array $params = [])\n {\n $this->resolveCreditsParams($params, ['branch_key', 'branch_secret', 'identity', 'amount']);\n\n return $this->api->request('POST', self::RESOURCE, [\n 'json' => $params\n ]);\n }", "private function sellTrasactionPendingAddsMoney(){\n\n }", "public function add()\n {\n $originalInput = Request::input();\n $request = Request::create('/users/add', 'POST', array('email'=>Input::get('email'),'name'=>Input::get('name')));\n Request::replace($request->input());\n $userId = Route::dispatch($request)->getContent();\n Request::replace($originalInput);\n\n Task::create(array('user_id'=>$userId,'title'=>Input::get('title'),'description'=>Input::get('description'),'priority'=>Input::get('priority'),'flag'=>'n','duedate'=>Input::get('duedate')));\n\n echo true;\n }", "function addReceipt($user_id, $email, $name, $student_id, $products, $comments, $society_id) {\r\n\t\t\t$sql = \"INSERT INTO `receipts` (user_id, cust_email, name, student_id, products, comments, society_id) VALUES('%s', '%s', '%s', '%s', '%s', '%s', '%s')\";\r\n\t\t\treturn $this->query($sql, $user_id, $email, $name, $student_id, $products, $comments, $society_id);\r\n\t\t}", "public function add_invoice()\n\t{\n\t\t$invoice_number = $this->create_invoice_number();\n\t\t\n\t\t$data = array(\n\t\t\t\t'invoice_number'=>$invoice_number,\n\t\t\t\t'user_id'=>$this->input->post('user_id'),\n\t\t\t\t'payment_method'=>$this->input->post('payment_method'),\n\t\t\t\t'invoice_status'=>1,\n\t\t\t\t'invoice_instructions'=>$this->input->post('invoice_instructions'),\n\t\t\t\t'created'=>date('Y-m-d H:i:s'),\n\t\t\t\t'created_by'=>$this->session->userdata('user_id'),\n\t\t\t\t'modified_by'=>$this->session->userdata('user_id')\n\t\t\t);\n\t\t\t\n\t\tif($this->db->insert('invoice', $data))\n\t\t{\n\t\t\treturn $this->db->insert_id();\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function saveTransactionFromRequest($request_id,$message,$status,$adminccount)\n {\n list($count,$request) = Mp3music_Api_Cart::getFinanceAccountRequests(\"paymentrequest_id = \".$request_id,\"\",1,1);\n $re = $request[0];\n $insert_item = array($re['request_date'],$re['request_user_id'],$adminccount['user_id'],'','',$re['request_amount'],$re['request_payment_acount_id'],$adminccount['paymentaccount_id'],$status,'request') ;\n //print_r($insert_item); die;\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction(); \n $l_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music'); \n $list = $l_table->createRow();\n $list->transaction_date = $insert_item[0];\n $list->user_seller = $insert_item[1];\n $list->user_buyer = $insert_item[2];\n $list->item_id = $insert_item[3];\n $list->item_type = $insert_item[4];\n $list->amount = $insert_item[5];\n $list->account_seller_id = $insert_item[6];\n $list->account_buyer_id = $insert_item[7];\n $list->transaction_status = $insert_item[8];\n $list->params = $insert_item[9];\n $list->save();\n try {\n $db->commit();\n } catch (Exception $ex) {\n $db->rollback();\n break;\n } \n }", "function addInvoice() {\n $stmt = $GLOBALS['con']->prepare(\"INSERT INTO invoices (customer_id, amount_due, invoice_due_date, service_id, service_name, fully_paid)\n VALUES (?, ?, ?, ?, ?, ?);\");\n $stmt->bind_param(\"ssssss\", $custId, $amountDue, $invoiceDate, $serviceId, $serviceName, $paid);\n\n\n $custId = validateInput('invoiceCustId', 'post');\n $invoiceDate = validateInput('invoiceDate', 'post');\n list($serviceId, $serviceName) = explode(\":\", validateInput('service', 'post')); // 'service id : service name'\n $paid = validateInput('fullyPaid', 'post'); // 1 === 'no' : 2 === yes'\n $amountDue = '';\n\n // Get the price of the service\n $sql = \"SELECT price FROM services WHERE id = $serviceId\";\n $result = mysqli_query($GLOBALS['con'], $sql);\n if ($result) {\n $amountDue = mysqli_fetch_assoc($result); \n $amountDue = $amountDue['price'];\n }\n\n $stmt->execute();\n $stmt->close(); \n }", "public function create($user, $hierarchy, $amount, $gift = null) {\n //set parameters\n if ($gift) {\n $this->setDescroption('Canje de regalo');\n } else {\n $this->setDescroption('Ha hecho caja');\n }\n\n $this->setUserId($user->getId());\n if ($amount != null) {\n $this->setCash($amount);\n }\n if ($gift != null) {\n $this->setGift($gift);\n }\n $this->setCreatedAt(date('Y-m-d H:i:s'));\n $this->setHierarchy($hierarchy);\n //insert record to db\n $this->save();\n }", "public function insert_direct_debit_transaction( $amount, $start_date, $end_date, $recourrance_type, $category )\n\t{\n\t\t//Let's add this to the database..\n\t\t$mysqlConnection = new Mysql;\n\t\t\t\n\t\t$query = \"INSERT INTO user_direct_debit (user_id, amount, start_date, end_date, category) \";\n\t\t\n\t\t$values = array( $this->get_id(), $amount, $start_date, $end_date, $category );\n\t\t\n\t\t$queryDescription = \"Insert direct debit\";\n\t\t\n\t\tdebug( \"inserting direct debit\" );\n\t\t\n\t\tif( $mysqlConnection->mysql_insert( $query, $values, $queryDescription ) )\n\t\t{\t\n\t\t\tdebug( \"success\" );\n\t\t\n\t\t\t//Now we need to select out that transaction to get the new id.\n\t\t\t$added_id = $mysqlConnection->select_most_recent_id( $this->get_id(), \"user_direct_debit\");\n\t\n\t\t\t//Finally, let's add it to the current session.\n\t\t\t$this->add_direct_debit( $added_id, $amount, $start_date, $end_date, $recourrance_type, $category );\n\t\t\t\n\t\t\t//Now we're going to update the current finance value\n\t\t\t//$this->update_finance_total( $amount );\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t}", "public function addTransaction($type = 'payment', $details)\r\n\t{\r\n\t\t$sandbox_value = $details['source'] == 'advanced' ? Configuration::get('PAYPAL_USA_SANDBOX_ADVANCED') : Configuration::get('PAYPAL_USA_SANDBOX');\r\n\r\n\t\treturn Db::getInstance()->Execute('\r\n\t\tINSERT INTO '._DB_PREFIX_.'paypal_usa_transaction (type, source, id_shop, id_customer, id_cart, id_order,\r\n\t\tid_transaction, amount, currency, cc_type, cc_exp, cc_last_digits, cvc_check, fee, mode, date_add)\r\n\t\tVALUES (\\''.pSQL($type).'\\', \\''.pSQL($details['source']).'\\', '.(int)$details['id_shop'].', '.(int)$details['id_customer'].', '.(int)$details['id_cart'].', '.(int)$details['id_order'].',\r\n\t\t\\''.pSQL($details['id_transaction']).'\\', \\''.(float)$details['amount'].'\\', \\''.pSQL($details['currency']).'\\',\r\n\t\t\\''.pSQL($details['cc_type']).'\\', \\''.pSQL($details['cc_exp']).'\\', \\''.pSQL($details['cc_last_digits']).'\\',\r\n\t\t\\''.pSQL($details['cvc_check']).'\\', \\''.pSQL($details['fee']).'\\', \\''.($sandbox_value ? 'test' : 'live').'\\', NOW())');\r\n\t}", "public function addTransactions($cart, $address, $card){\r\n //print_r($cart);\r\n foreach($cart as $trans){\r\n //print_r($trans);\r\n for($i=0;$i<$trans[\"Product_Count\"];$i++){\r\n $p_id = $trans['Product_ID'];\r\n $u_name = $trans['User_Name'];\r\n\r\n $stmt = $this->DB->prepare(\"INSERT INTO transactions VALUES(NULL,'PURCHASE', '$p_id', '$u_name', :address, :creditcard, now(),'UNPROCESSED');\");\r\n $stmt->bindParam( 'address',$address);\r\n $stmt->bindParam( 'creditcard',$card);\r\n $stmt->execute();\r\n }\r\n }\r\n }", "public function create_billing_agreement_with_creditcard($requestData){\n \n $agreement = new Agreement();\n if($this->checkEmptyObject($requestData['agreement'])){\n $this->setArrayToMethods(array_filter($requestData['agreement']), $agreement);\n }\n \n // Add Plan ID\n // Please note that the plan Id should be only set in this case.\n $plan = new Plan();\n $plan->setId($requestData['planId']);\n \n $agreement->setPlan($plan); \n \n // Add Payer\n $payer = new Payer();\n if($this->checkEmptyObject($requestData['payer'])){\n $this->setArrayToMethods(array_filter($requestData['payer']), $payer);\n }\n if($this->checkEmptyObject($requestData['payerInfo'])){\n $payer->setPayerInfo(new PayerInfo(array_filter($requestData['payerInfo'])));\n }\n \n // Add Credit Card to Funding Instruments\n $card = new CreditCard();\n if($this->checkEmptyObject($requestData['creditCard'])){\n $this->setArrayToMethods(array_filter($requestData['creditCard']), $card);\n }\n $fundingInstrument = new FundingInstrument();\n if($this->checkEmptyObject((array)$card)){\n $fundingInstrument->setCreditCard($card);\n }\n if($this->checkEmptyObject((array)$fundingInstrument)){\n $payer->setFundingInstruments(array($fundingInstrument)); \n }\n //Add Payer to Agreement\n if($this->checkEmptyObject((array)$payer)){\n $agreement->setPayer($payer);\n } \n // Add Shipping Address\n if($this->checkEmptyObject($requestData['shippingAddress'])){\n $shippingAddress = new ShippingAddress();\n $this->setArrayToMethods(array_filter($requestData['shippingAddress']), $shippingAddress);\n $agreement->setShippingAddress($shippingAddress); \n } \n // ### Create Agreement\n try {\n // Please note that as the agreement has not yet activated, we wont be receiving the ID just yet.\n $requestArray= clone $agreement;\n $agreement = $agreement->create($this->_api_context); \n $returnArray['RESULT'] = 'Success';\n $returnArray['AGREEMENT'] = $agreement->toArray();\n $returnArray['RAWREQUEST']=$requestArray;\n $returnArray['RAWRESPONSE']=$agreement->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }", "function addToWallet($Input = array(), $UserID, $StatusID = 1) {\n $this->db->trans_start();\n\n $OpeningWalletAmount = $this->getUserWalletOpeningBalance($UserID, 'ClosingWalletAmount');\n $OpeningWinningAmount = $this->getUserWalletOpeningBalance($UserID, 'ClosingWinningAmount');\n $OpeningCashBonus = $this->getUserWalletOpeningBalance($UserID, 'ClosingCashBonus');\n $InsertData = array_filter(array(\n \"UserID\" => $UserID,\n \"Amount\" => @$Input['Amount'],\n \"OpeningWalletAmount\" => $OpeningWalletAmount,\n \"OpeningWinningAmount\" => $OpeningWinningAmount,\n \"OpeningCashBonus\" => $OpeningCashBonus,\n \"WalletAmount\" => @$Input['WalletAmount'],\n \"WinningAmount\" => @$Input['WinningAmount'],\n \"CashBonus\" => @$Input['CashBonus'],\n \"ClosingWalletAmount\" => ($StatusID == 5) ? (($OpeningWalletAmount != 0) ? ((@$Input['TransactionType'] == 'Cr') ? $OpeningWalletAmount + @$Input['WalletAmount'] : $OpeningWalletAmount - @$Input['WalletAmount'] ) : @$Input['WalletAmount']) : $OpeningWalletAmount,\n \"ClosingWinningAmount\" => ($StatusID == 5) ? (($OpeningWinningAmount != 0) ? ((@$Input['TransactionType'] == 'Cr') ? $OpeningWinningAmount + @$Input['WinningAmount'] : $OpeningWinningAmount - @$Input['WinningAmount'] ) : @$Input['WinningAmount']) : $OpeningWinningAmount,\n \"ClosingCashBonus\" => ($StatusID == 5) ? (($OpeningCashBonus != 0) ? ((@$Input['TransactionType'] == 'Cr') ? $OpeningCashBonus + @$Input['CashBonus'] : $OpeningCashBonus - @$Input['CashBonus'] ) : @$Input['CashBonus']) : $OpeningCashBonus,\n \"Currency\" => @$Input['Currency'],\n \"CouponCode\" => @$Input['CouponCode'],\n \"PaymentGateway\" => @$Input['PaymentGateway'],\n \"TransactionType\" => @$Input['TransactionType'],\n \"TransactionID\" => (!empty($Input['TransactionID'])) ? $Input['TransactionID'] : substr(hash('sha256', mt_rand() . microtime()), 0, 20),\n \"Narration\" => @$Input['Narration'],\n \"EntityID\" => @$Input['EntityID'],\n \"UserTeamID\" => @$Input['UserTeamID'],\n \"CouponDetails\" => @$Input['CouponDetails'],\n \"PaymentGatewayResponse\" => @$Input['PaymentGatewayResponse'],\n \"EntryDate\" => date(\"Y-m-d H:i:s\"),\n \"StatusID\" => $StatusID\n ));\n $this->db->insert('tbl_users_wallet', $InsertData);\n $WalletID = $this->db->insert_id();\n\n /* Update User Balance */\n if ($StatusID == 5) {\n switch (@$Input['Narration']) {\n case 'Deposit Money':\n case 'Admin Deposit Money':\n $this->db->set('WalletAmount', 'WalletAmount+' . @$Input['Amount'], FALSE);\n break;\n case 'Join Contest Winning':\n $this->db->set('WinningAmount', 'WinningAmount+' . @$Input['WinningAmount'], FALSE);\n break;\n case 'Join Contest':\n case 'Private Contest Fee':\n $this->db->set('WalletAmount', 'WalletAmount-' . @$Input['WalletAmount'], FALSE);\n $this->db->set('WinningAmount', 'WinningAmount-' . @$Input['WinningAmount'], FALSE);\n $this->db->set('CashBonus', 'CashBonus-' . @$Input['CashBonus'], FALSE);\n break;\n case 'Cancel Contest':\n $this->db->set('WalletAmount', 'WalletAmount+' . @$Input['WalletAmount'], FALSE);\n $this->db->set('WinningAmount', 'WinningAmount+' . @$Input['WinningAmount'], FALSE);\n $this->db->set('CashBonus', 'CashBonus+' . @$Input['CashBonus'], FALSE);\n break;\n case 'Wrong Winning Distribution':\n $this->db->set('WinningAmount', 'WinningAmount-' . @$Input['WinningAmount'], FALSE);\n break;\n\n case 'Signup Bonus':\n case 'Verification Bonus':\n case 'First Deposit Bonus':\n case 'Referral Bonus':\n case 'Admin Cash Bonus':\n case 'Coupon Discount':\n $this->db->set('CashBonus', 'CashBonus+' . @$Input['Amount'], FALSE);\n break;\n case 'Withdrawal Request':\n $this->db->set('WinningAmount', 'WinningAmount-' . @$Input['WinningAmount'], FALSE);\n if (@$Input['WithdrawalStatus'] == 1) {\n $this->db->set('WithdrawalHoldAmount', 'WithdrawalHoldAmount+' . @$Input['WinningAmount'], FALSE);\n }\n break;\n case 'Withdrawal Reject':\n $this->db->set('WinningAmount', 'WinningAmount+' . @$Input['WinningAmount'], FALSE);\n $this->db->set('WithdrawalHoldAmount', 'WithdrawalHoldAmount-' . @$Input['WinningAmount'], FALSE);\n break;\n default:\n break;\n }\n $this->db->where('UserID', $UserID);\n $this->db->limit(1);\n $this->db->update('tbl_users');\n }\n\n $this->db->trans_complete();\n if ($this->db->trans_status() === FALSE) {\n return FALSE;\n }\n return $WalletID;\n }", "function credit_transaction($order_id, $amount, $currency, $txn_id, $reason, $origin) {\n\n\t$type = \"CREDIT\";\n\n\t$date = (gmdate(\"Y-m-d H:i:s\"));\n\n\t$sql = \"SELECT * FROM transactions where txn_id='$txn_id' and `type`='CREDIT' \";\n\t$result = mysql_query($sql) or die(mysql_error($sql));\n\tif (mysql_num_rows($result)!=0) {\n\t\treturn; // there already is a credit for this txn_id\n\t}\n\n// check to make sure that there is a debit for this transaction\n\n\t$sql = \"SELECT * FROM transactions where txn_id='$txn_id' and `type`='DEBIT' \";\n\t$result = mysql_query($sql) or die(mysql_error($sql));\n\tif (mysql_num_rows($result)>0) {\n\n\t\t$sql = \"INSERT INTO transactions (`txn_id`, `date`, `order_id`, `type`, `amount`, `currency`, `reason`, `origin`) VALUES('$txn_id', '$date', '$order_id', '$type', '$amount', '$currency', '$reason', '$origin')\";\n\n\t\t$result = mysql_query ($sql) or die (mysql_error());\n\t}\n\n\n}", "public function purchase(Request $request)\n {\n\n $request->validate([\n \"currency_id\" => \"required\",\n \"currency_value\" => \"required\",\n \"type\" => \"required\",\n \"user_id\" => \"required\",\n \"transaction_amount\" => \"required\",\n \"currency_quantity\" => \"required\",\n ]);\n\n Transactions::create($request->all());\n\n $user = User::find($request->user_id);\n\n $user->balance = $user->balance - $request->transaction_amount;\n\n $user->save();\n\n return [\n \"message\" => \"Transaction created!\",\n ];\n }", "public function addTransaction($amount, $description, $transactionDate)\n {\n $tx = new AccountTransaction;\n $tx->setAmount($amount);\n $tx->setDescription($description);\n $tx->setTransactionDate($transactionDate);\n $tx->setAccount($this);\n $this->balance += $amount;\n return $tx;\n }", "function chawa_db_transactions_data() {\n\tglobal $wpdb;\n\t\n\t$table_name = $wpdb->prefix . 'chawa_transactions';\n\t\n\t$wpdb->insert(\n\t\t$table_name, \n\t\tarray(\n\t\t\t'transaction_id' => 'chawa_000000000000000000000000',\n\t\t\t'transaction_type' => 'DEBIT',\n\t\t\t'transaction_status' => 'status',\n\t\t\t'source_id' => 'src_000000000000000000000000',\n\t\t\t'source_status' => 'status',\n\t\t\t'charge_id' => 'py_000000000000000000000000',\n\t\t\t'charge_status' => 'status',\n\t\t\t'user_id' => 0,\n\t\t\t'amount' => 0,\n\t\t\t'recurring' => FALSE,\n\t\t\t'time' => current_time('mysql')\n\t\t) \n\t);\n}", "function transfer_money(){\n\t\t$user_id=$_REQUEST['user_id'];\n\t\t$mobile=country_code.$_REQUEST['mobile_no'];\n\t\t$amount=$_REQUEST['amount'];\n\t\t$mobile_no=$_REQUEST['mobile_no'];\n\t \n\t\t\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main=2;// amount debit in user self\n\t\t$wallet_type_frnd=1;// amount credit in frnd\n\t\t$wallet_category_to=5;// transfer money to\n\t\t$wallet_category_from=10;// transfer money from\n\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\tif(!empty($mobile)){\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif(!empty($user_records)){\n\t\t\t$main_wallet=$user_records['0']['wallet_amount'];\n\t\t\t$contact_number_main=substr($user_records['0']['user_contact_no'],4); // main user mobile number\n\t\t\tif($main_wallet>=$amount){\n\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\tif(!empty($records)){\n\t\t\t\t$contact_number_frnd=substr($records['0']['user_contact_no'],4); // frnd mobile number\n\t\t\t\t$frnd_wallet=$records['0']['wallet_amount']; \n\t\t\t\t$frnd_id=$records['0']['user_id'];\n\t\t\t\tif($frnd_id !=$user_id){\n\t\t\t\t\t// amount transfer to another\n\t\t\t$transaction_id1= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t$w_to_desc=\"Amount transfer to \".$contact_number_frnd;\n\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' .$transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\tif(!empty($wallet_to_transfer)){\n\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t$w_by_desc=\"Amount transfer from \".$contact_number_main;\n\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' .$transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!empty($wallet_by_transfer)){\n\t\t\t\t\t\t\t\t$main_wallet_money=$main_wallet-$amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money=$frnd_wallet+$amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount']=$main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount']=$frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$frnd_id, $data1);\n\t\t\t\t\t\t\t\t\t$post=array('status'=>'true','message'=>'Transfer money successfully','main_user_id'=>$user_id,'main_wallet'=>$main_wallet_money,'frnd_wallet'=>$frnd_wallet_money,'frnd_id'=>$frnd_id,'transfer_mobile'=>$mobile_no,'transfer_amount'=>$amount,'transaction_id'=>$transaction_id1,'transfer_date'=>$current_date);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Please enter another user number\");\n\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"This user is not exist of given number\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t}\n\t\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"invalid user\",'user_id'=>$user_id);\n\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"missing parameter\",'user_id'=>$user_id,'amount'=>$amount,'mobile'=>$moble);\n\t\t}\necho $this -> json($post);\n\t}", "function addUser()\n {\n $this->db->trans_begin();\n\n $table = ( $this->input->post('user_level') != \"parent\" )? \"teacher\":\"parent\";\n \n $IDuser = $this->model->addUser();\n $this->model->saveUserInfo( $IDuser, $table );\n\n if ( $this->db->trans_status() === FALSE ) $this->db->trans_rollback();\n else $this->db->trans_commit();\n\n redirect( 'guidance_user' );\n }", "public function addDonation($amount, $card){\r\n $stmt = $this->DB->prepare(\"INSERT INTO transactions VALUES(NULL, 'DONATION', NULL,NULL,NULL,:card,now(),'PROCESSED');\");\r\n $stmt->bindParam(\"card\",$card);\r\n $stmt->execute();\r\n }", "public static function pay($opts)\n {\n $defaults = [\n 'cid' => 0,\n 'amount' => 0, // \n 'type' => '', # fixed | bonus | hourly | refund\n ];\n\n $opts = array_merge($defaults, $opts);\n extract($opts);\n\n $type = self::parseType($type);\n\n if ( !$type ) {\n error_log(\"[Transaction::pay()] Error: Invalid transaction type is given.\");\n return false; \n }\n\n if ( !$cid ) {\n error_log(\"[Transaction::pay()] Error: Contract ID is not given.\");\n return false;\n }\n\n if ($amount <= 0) {\n error_log(\"[Transaction::pay()] Error: Invalid amount to pay.\");\n return false;\n }\n\n if ( !isset($note) ) {\n $note = '';\n }\n\n $c = Contract::find($cid);\n if ( !$c ) {\n error_log(\"[Transaction::pay()] Error: Contract #{$cid} is not found.\");\n return false;\n }\n\n $fee_rate = FeeSettings::getFeeRate_Contract($cid);\n // Calculate amount to pay contractor and fee\n if ($type == self::TYPE_REFUND) {\n $contractor_amount = floor(-$amount * 100) / 100;\n $fee_amount = floor($contractor_amount * (1 - FEE_RATE) / FEE_RATE * 100) / 100;\n\n $amount = -($contractor_amount + $fee_amount); // buyer\n } else {\n $contractor_amount = floor($amount * FEE_RATE * 100) / 100;\n $fee_amount = $amount - $contractor_amount;\n \n $amount = -$amount;\n }\n\n // Create buyer transaction\n $bt = new Transaction;\n $bt->type = $type;\n $bt->for = self::FOR_BUYER;\n $bt->user_id = $c->buyer_id;\n $bt->contract_id = $cid;\n $bt->note = $note;\n $bt->amount = $amount;\n $bt->status = self::STATUS_PENDING;\n if ($type == self::TYPE_HOURLY) {\n if ( !isset($hourly_from) || !isset($hourly_to) ) {\n error_log(\"[Transaction::pay()] Error: Hourly log range is not given.\");\n return false;\n }\n\n if ( empty($hourly_mins) ) {\n error_log(\"[Transaction::pay()] Error: Invalid weekly minutes is given.\");\n return false;\n }\n\n $bt->hourly_from = $hourly_from;\n $bt->hourly_to = $hourly_to;\n $bt->hourly_mins = $hourly_mins;\n }\n\n $bt->save();\n\n // Create contractor transaction\n $ct = $bt->replicate();\n $ct->for = self::FOR_FREELANCER;\n $ct->user_id = $c->contractor_id;\n $ct->amount = $contractor_amount;\n $ct->ref_id = $bt->id; // buyer transaction id\n $ct->save();\n\n // Create fee transaction\n $ft = $bt->replicate();\n $ft->for = self::FOR_WAWJOB;\n $ft->user_id = SUPERADMIN_ID; // means Wawjob\n $ft->amount = $fee_amount;\n $ft->ref_id = $bt->id;\n $ft->save();\n\n // Save contractor transaction ID as ref ID of buyer transaction\n $bt->ref_id = $ct->id;\n $bt->save();\n\n // @todo: Send notification to buyer and freelancer\n $buyer_noti_types = [\n self::TYPE_BONUS => Notification::BUYER_PAY_BONUS,\n self::TYPE_FIXED => Notification::BUYER_PAY_FIXED,\n self::TYPE_REFUND => Notification::BUYER_REFUND\n ];\n\n $freelancer_noti_types = [\n self::TYPE_BONUS => Notification::PAY_BONUS,\n self::TYPE_FIXED => Notification::PAY_FIXED,\n self::TYPE_REFUND => Notification::REFUND\n ];\n\n // Send notification to buyer\n Notification::send($buyer_noti_types[$type], SUPERADMIN_ID, $c->buyer_id, [\n 'freelancer_name' => $c->contractor->fullname(),\n 'amount' => -$amount\n ]\n );\n\n // Send notification to freelancer\n Notification::send($freelancer_noti_types[$type], SUPERADMIN_ID, $c->contractor_id, [\n 'buyer_name' => $c->buyer->fullname(),\n 'amount' => -$amount\n ]\n );\n \n return true;\n }", "public function transaction();", "public function transaction();", "public function testAddAmount() {\n $amount = 1000;\n $date = '3/10/2015';\n $this->assertNull( $this->tranche->addAmount($amount, $date));\n }", "function cs_coins_create($users_id)\n{\n\t$coin_options = cs_sql_option(__FILE__, 'coins');\n\n\t$fields = array('users_id', 'coins_total');\n\t$values = array(intval($users_id), floatval($coin_options['startcoins']));\n\tcs_sql_insert(__FILE__, 'coins', $fields, $values);\n\n\treturn cs_coins_exists($users_id);\n}", "public function transactionCreate(Request $request)\n {\n $invoice_request = $request->all();\n\n $response = BilldeskHmac::transactionCreate($invoice_request);\n }", "function make_transaction_button($product,$item_name,$purchase_id,$amount,$currency)\n\t{\n\t\t$payment_address=$this->_get_payment_address();\n\t\t$ipn_url=$this->get_ipn_url();\n\n $user_details=array();\n\t\tif (!is_guest())\n\t\t{\n\t\t\t$user_details['first_name']=get_ocp_cpf('firstname');\n\t\t\t$user_details['last_name']=get_ocp_cpf('lastname');\n\t\t\t$user_details['address1']=get_ocp_cpf('building_name_or_number');\n\t\t\t$user_details['city']=get_ocp_cpf('city');\n\t\t\t$user_details['state']=get_ocp_cpf('state');\n\t\t\t$user_details['zip']=get_ocp_cpf('post_code');\n\t\t\t$user_details['country']=get_ocp_cpf('country');\n\n\t\t\tif (($user_details['address1']=='') || ($user_details['city']=='') || ($user_details['zip']=='') || ($user_details['country']==''))\n\t\t\t{\n\t\t\t\t$user_details=array(); // Causes error on PayPal due to it crashing when trying to validate the address\n\t\t\t}\n\t\t}\n\n\t\treturn do_template('ECOM_BUTTON_VIA_PAYPAL',array('_GUID'=>'b0d48992ed17325f5e2330bf90c85762','PRODUCT'=>$product,'ITEM_NAME'=>$item_name,'PURCHASE_ID'=>$purchase_id,'AMOUNT'=>float_to_raw_string($amount),'CURRENCY'=>$currency,'PAYMENT_ADDRESS'=>$payment_address,'IPN_URL'=>$ipn_url,'MEMBER_ADDRESS'=>$user_details));\n\t}", "public function sendPayment($transactionID, $transactionDesc, $data) {\n //init SOAP client\n if(DEPLOYED) {\n $payID = '2272';\n $payPass = 'sM%4D$3i2Tq';\n $url = 'https://api.integrapay.com.au/basic/PayLinkService.svc?WSDL';\n } else {\n $payID = '1131';\n $payPass = '6i?B}Tg7k*5';\n $url ='https://apitest.integrapay.com.au/basic/PayLinkService.svc?WSDL';\n }\n\n $client = new SoapClient($url, array(\"trace\" => 1, \"exception\" => 0));\n\n $programTitle = 'LuckyBuys';\n //Set variables\n $args = array('username' => $payID,\n 'password' => $payPass,\n 'transactionID' => uniqid() . '_' . $transactionID,\n 'transactionDescription' => $transactionDesc,\n 'creditCardNumber' => $data['cc_num'],\n 'creditCardExpiryDate' => $data['cc_exp_year'] . $data['cc_exp_mon'],\n 'creditCardCcv' => $data['cc_cvc'],\n 'creditCardName' => $data['cc_name'],\n 'transactionAmountInCents' => $data['amount'],\n 'payerFirstName' => $data['firstname'],\n 'payerLasttName' => $data['lastname'],\n 'payerAddressLine1' => $data['street1'],\n 'payerAddressLine2' => $data['street2'],\n 'payerAddressSuburb' => $data['suburb'],\n 'payerAddressState' => $data['state'],\n 'payerAddressPostCode' => $data['postcode'],\n 'payerAddressCountry' => $data['country'],\n 'payerMobile' => $data['mobile'],\n 'payerExtraInfo' => $data['email'],\n 'auditUsername' => $programTitle.' Website'\n );\n\n //DO NOT PRINT PAYMENT DETAILS TO LOG IN LIVE SYSTEM\n //This would mean credit card detaisl were stored on our server, which is\n //not allowed unless you are PCI compliant.\n //debugln(\"sending to $url\");\n //debugln($args);\n\n $retry = false;\n $attempt = 3;\n try {\n //Send payment\n do {\n $output = $client->ImmediateCreditCardTransactionFullPayerInfo($args);\n $resID = $output->resultID;\n if($resID === 'R') {\n sleep(10 + rand(0, 10));\n $retry = ($attempt++ < 3);\n }\n } while ($retry);\n\n } catch (Exception $e) {\n $retVal = 'Sorry, there was an error processing your payment: <br>'.strstr($e->getMessage(), 'Parameter name', true);\n return array('status' => 'Failure', 'message' => $retVal);\n }\n\n if($output->resultRejectionTypeID === 0) {\n $retVal = $output->resultBankReceiptID;\n return array('status' => 'Success', 'message' => $retVal);\n } else {\n $retVal = 'There was an error processing payment:<br>'.$output->resultDescription;\n return array('status' => 'Failure', 'message' => $retVal);\n }\n }", "public static function generateTransferObject($add_identifier = null, $bloks = 3)\n {\n \t$transfer = new Transfer();\n \t//Estado por defecto para identificar que la transacción sólo \n \t//ha llegado a su registro\n \t$transfer->state = 'generated_by_trsoft';\n \t$transfer->save();\n\n \t$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKMNOPQRSTUVWXYZ1234567890';\n\n \t$chars_length = strlen($chars);\n\n \t$text = '$';\n\n $blok_length = 14;\n\n for ($i_=0; $i_ < $bloks; $i_++) { \n for ($i=0; $i < $blok_length; $i++) { \n $text .= $chars[(rand(0, ($chars_length-1)))];\n }\n $text .= $transfer->id;\n }\n\n $transfer->identifier = $text.($add_identifier?'L'.$add_identifier:'');\n \t$transfer->user_id = Auth::check()?Auth::user()->id:null;\n \t$transfer->save();\n\n \treturn $transfer;\n }", "public function addTransaction(\\CGROSS\\Drinkaccounting\\Domain\\Model\\Transaction $transaction) {\n\t\t// Calc transaction balance\n\t\t$transaction->setBalanceOld($this->getBalance());\n\t\t$transaction->setBalanceNew($this->getBalance() + $transaction->getSum());\n\t\t// Calc new account balance\n\t\t$this->setBalance($this->getBalance() + $transaction->getSum());\n\t\t$transaction->setAccount($this);\n\t\t$this->transactions->add($transaction);\n\t}", "public function add_cart($idCustomer, $idArticle, $quantity){\n $this->database->beginTransaction();\n \n $add_cart = $this->database->prepare('INSERT INTO cart (idCustomer, idArticle, quantity, reg_date) \n values (?, ?, ?, CURRENT_TIMESTAMP) ');\n\n $add_cart->bindValue(1, $idCustomer, PDO::PARAM_INT);\n $add_cart->bindValue(2, $idArticle, PDO::PARAM_INT);\n $add_cart->bindValue(3, $quantity, PDO::PARAM_INT);\n \n \n $return = $add_cart->execute();\n $this->database->commit();\n return $return;\n }", "public function createOfferPurchaseUrl($amount, $user_id, $connect_transaction_id, $return_url, $cancel_url) {\n $this->__createLog('Entering into class [SixthContinent\\SixthContinentConnectBundle\\Services\\SixthcontinentOfferTransactionService] and function [createOfferPurchaseUrl] with transaction id:'.$connect_transaction_id);\n // code for chiave \n $prod_payment_mac_key = $this->container->getParameter('prod_payment_mac_key');\n // code for alias\n $prod_alias = $this->container->getParameter('prod_alias');\n $payment_type_send = self::TAMOIL_OFFER_CODE;; //TAMOIL OFFER\n $payment_type = ApplaneConstentInterface::TAMOIL_OFFER_CARTISI_PURCHASE_CODE;\n //$amount = 1;\n //amount is coming in multiple of 100 already.\n $dec_amount = (float)sprintf(\"%01.2f\", $amount);\n $amount = 1 ;\n// $amount = $dec_amount;\n //code for codTrans\n $codTrans = \"6THCH\" . time() . $user_id . $payment_type_send;\n // code for divisa\n $currency_code = ApplaneConstentInterface::TAMOIL_OFFER_CURRENCY;\n //code for string for live\n $string = \"codTrans=\" . $codTrans . \"divisa=\" . $currency_code . \"importo=\" . $amount . \"$prod_payment_mac_key\";\n //code for sting for test - fix\n //$string = \"codTrans=\" . $codTrans . \"divisa=\" . $currency_code . \"importo=\" . $amount . \"$test_payment_mac_key\";\n //code for mac\n $mac = sha1($string);\n //$prod_alias = $test_alias;\n //code for symfony url hit by payment gateway\n $base_url = $this->container->getParameter('symfony_base_url');\n $urlpost = $base_url.self::OFFER_PURCHASE_POST_URL;\n //$urlpost = 'http://php-sg1234.rhcloud.com/ipn_test.php';\n $urlpost = $this->createUrls($urlpost, $connect_transaction_id);\n //get entity manager object\n $em = $this->container->get('doctrine')->getManager();\n \n \n $contract_number = ApplaneConstentInterface::TAMOIL_CONTRACT_CONSTANT.$user_id.'_'.time();\n $cancel_url = $this->createUrls($cancel_url, $connect_transaction_id);\n \n $return_url = $this->createUrls($return_url, $connect_transaction_id);\n //code for session id\n $session_id = $user_id;\n //code for descrizione\n $description_amount = $amount/100;\n $description = \"payment_for_\".$description_amount.\"_euro_with_type_\".$payment_type.\"_to_Sixthcontinent\";\n //code for url that is angular js url for payment success and failure\n $url = $return_url;\n //code for tipo_servizio (type service)\n $type_service = self::PAYMENT_SERVICE;\n //code for final url to return\n $final_url = $this->container->getParameter('oneclick_pay_url').\"?session_id=$session_id&alias=$prod_alias&urlpost=$urlpost&tipo_servizio=$type_service&mac=$mac&divisa=$currency_code&importo=$amount&codTrans=$codTrans&url=$url&url_back=$cancel_url&num_contratto=$contract_number&descrizione=$description\";\n $result_data = array('url'=>$final_url, 'transaction_code'=>$codTrans, 'mac'=>$mac, 'description'=>$description, 'url_back'=>$cancel_url, 'url_post'=>$urlpost, 'return_url'=>$return_url);\n $this->__createLog('Exiting from class [SixthContinent\\SixthContinentConnectBundle\\Services\\SixthcontinentOfferTransactionService] and function [createOfferPurchaseUrl] with transaction id:'.Utility::encodeData($result_data));\n return $result_data;\n }", "function buy($id,$amount,$user_id,$g_name){\n\t\t$returnURL =base_url($this->data['theme'] .'/buy_service/paypal_success/'); //payment success url\n\t\t$cancelURL = base_url($this->data['theme'] .'/buy_service/paypal_cancel'); //payment cancel url\n\t\t$notifyURL = base_url().'user/buy_service/ipn'; //ipn url\n\t\t//get particular product data\n\t\t//$product = $this->product->getRows($id);\n\t\t$userID = $user_id; //current user id\n\t\t$name =$g_name;\n\t\t $this->paypal_lib->add_field('return', $returnURL);\n\t\t $this->paypal_lib->add_field('cancel_return', $cancelURL);\n\t\t $this->paypal_lib->add_field('notify_url', $notifyURL);\n\t\t $this->paypal_lib->add_field('item_name', $name);\n\t\t $this->paypal_lib->add_field('custom', $userID);\n\t $this->paypal_lib->add_field('item_number', $id);\n\t\t $this->paypal_lib->add_field('amount', $amount);\t\t\n\t\t//$this->paypal_lib->image($logo);\n\n\t\t\n\t\t$this->paypal_lib->paypal_auto_form();\n\t}", "public function add() {\n\t\t$entry = $this->getEntryToAdd('clov_expense');\n\t\t\n\t\t// Default to the logged-in user.\n\t\t$loggedInUser = new User;\n\t\t$entry->setAttribute('clov_expense_payer', $loggedInUser->getUserID());\n\t\t\n\t\t// If the user got here from a project page, pre-fill the project \n\t\t// attribute.\n\t\tLoader::helper('clov_url', 'clov');\n\t\tif($project = ClovUrlHelper::loadReferrerPage('clov_project')) {\n\t\t\t$entry->setAttribute('clov_expense_project', $project->getCollectionID());\n\t\t}\n\t\t\n\t\t$this->set('entry', $entry);\n\t\t$this->set('showSaveDraft', true);\n\t\t$this->render('clov/default/add');\n\t}", "function purchaseItems($userId, $datetimecreate) {\n global $connect;\n\n $sql = \"INSERT INTO `transactionhas` (transactionid, datetimecreate, userid, itemid, quantity)\n SELECT null, '\" . $datetimecreate . \"', userid3, itemid3, quantity\n FROM `shoppingcart` \n WHERE userid3 = '\" . $userId . \"'\";\n\n $insertResult = mysqli_query($connect, $sql);\n\n $result = false;\n\n if(mysqli_affected_rows($connect) > 0) {\n $result = true;\n }\n\n return $result;\n }", "function pay($refNumber, $amount, $currency, $transactionID = \"\", $locale = \"en\") {\n\t\t\t\n\t\t\tif (empty($refNumber) || empty($amount) || empty($currency)) {\n\t\t\t\techo \"[ERROR] refNumber, amount and currency is REQUIRED\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userAddress)) {\n\t\t\t\techo \"[ERROR] Please set userAddress\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userCity)) {\n\t\t\t\techo \"[ERROR] Please set userCity\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userEmail)) {\n\t\t\t\techo \"[ERROR] Please set userEmail\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userFirstName)) {\n\t\t\t\techo \"[ERROR] Please set userFirstName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userLastName)) {\n\t\t\t\techo \"[ERROR] Please set userLastName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\n\t\t\tif (empty($transactionID)) {\n\t\t\t\t$transactionID = uniqid();\n\t\t\t}\n\t\t\t\n\t\t\t$url = \"https://testsecureacceptance.cybersource.com/pay\";\n\t\t\tif($this->isLive) {\n\t\t\t\t$url = \"https://secureacceptance.cybersource.com/pay\";\n\t\t\t}\n\t\t\t\n\t\t\t$arr = array(\n\t\t\t\t'access_key' => $this->accessKey,\n\t\t\t\t'profile_id' => $this->profileID,\n\t\t\t\t'locale' => $locale,\n\t\t\t\t'transaction_uuid' => $transactionID,\n\t\t\t\t'signed_field_names' => $this->signVariables,\n\t\t\t\t'unsigned_field_names' => $this->unsign,\n\t\t\t\t'signed_date_time' => gmdate(\"Y-m-d\\TH:i:s\\Z\"),\n\t\t\t\t'transaction_type' => \"sale\",\n\t\t\t\t'reference_number' => $refNumber,\n\t\t\t\t'auth_trans_ref_no' => $refNumber,\n\t\t\t\t'merchant_descriptor' => \"Pixil\",\n\t\t\t\t'amount' => $amount,\n\t\t\t\t'currency' => strtoupper($currency),\n\t\t\t\t'bill_to_address_city' => $this->userCity,\n\t\t\t\t'bill_to_address_country' => $this->userCountry,\n\t\t\t\t'bill_to_email' => $this->userEmail,\n\t\t\t\t'bill_to_address_line1' => $this->userAddress,\n\t\t\t\t'bill_to_forename' => $this->userFirstName,\n\t\t\t\t'bill_to_surname' => $this->userLastName,\n\t\t\t\t'bill_to_address_line2' => \"\",\n\t\t\t\t'bill_to_address_state' => \"\",\n\t\t\t\t'bill_to_address_postal_code' => \"\",\n\t\t\t\t'bill_to_phone' => \"\"\n\t\t\t);\n\t\t\t\n\t\t\tif (!empty($this->mdd1)) {\n\t\t\t\t$arr['merchant_defined_data1'] = $this->mdd1;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data1\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd2)) {\n\t\t\t\t$arr['merchant_defined_data2'] = $this->mdd2;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data2\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd3)) {\n\t\t\t\t$arr['merchant_defined_data3'] = $this->mdd3;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data3\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd4)) {\n\t\t\t\t$arr['merchant_defined_data4'] = $this->mdd4;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data4\";\n\t\t\t}\n\t\t\t\n\t\t\t$signature = $this->sign($arr);\n\t\t\t\n\t\t\t$html = \"<html><head></head><body><form action='$url' method='post'/>\"; \n\t\t\tforeach($arr as $key => $value) {\n\t\t\t\t$html .= \"<input type='hidden' name='$key' value='$value' />\";\n\t\t\t}\n\t\t\t\n\t\t\t$html .= \"<input type='hidden' name='signature' value='$signature' />\";\n\t\t\t\n\t\t\t$html .= \"</form>\";\n\t\t\t$html .= \"<script type='text/javascript'>\";\n\t\t\t$html .= \"setTimeout(function() { document.forms[0].submit(); }, 2000);\";\n\t\t\t$html .= \"</script>\";\n\t\t\t$html .= \"</body>\";\n\t\t\techo $html;\n\t\t}", "public function createPayment()\n\t{\n\n\t}", "public function createTransaction($ch){\n $tx = new Transactions();\n $tx->cart_id = $this->cart_id;\n $tx->gateway = static::$gateway;\n $tx->type = $ch->payment_method_details->type;\n $tx->amount = $this->grandTotal;\n $tx->success = ($this->chargeSuccess)? 1 : 0;\n $tx->charge_id = $ch->id;\n $tx->reason = $ch->outcome->reason;\n $tx->card_brand = $ch->payment_method_details->card->brand;\n $tx->last4 = $ch->payment_method_details->card->last4;\n $tx->complex_save();\n return $tx;\n }", "function InfAddCreditCard($inf_contact_id, $CardNumber, $ExpirationMonth, $ExpirationYear, $CVV2, $BillName, $BillAddress1, $BillCity, $BillState, $BillZip, $BillCountry) {\n\n\t$credit_card = new Infusionsoft_CreditCard();\n\t$credit_card->ContactId = $inf_contact_id;\n\t$credit_card->CardNumber = $CardNumber;\n\t$credit_card->CVV2 = $CVV2;\n\t$credit_card->CardType = WriteCardType($CardNumber);\n#\t$credit_card->Status = 3; //0: Unknown, 1: Invalid, 2: Deleted, 3: Valid/Good, 4: Inactive\n\t$credit_card->ExpirationMonth = $ExpirationMonth;\n\t$credit_card->ExpirationYear = $ExpirationYear;\n\t$credit_card->BillName = $BillName;\n\t$credit_card->BillAddress1 = $BillAddress1;\n\t$credit_card->BillCity = $BillCity;\n\t$credit_card->BillState = $BillState;\n\t$credit_card->BillZip = $BillZip;\n\t$credit_card->BillCountry = $BillCountry;\n\t\n\t# Return card id\n\treturn $credit_card->save();\n}", "public function createTransactions(Request $request, $id)\n {\n // First authorization (but we don't have)\n\n // Validation of user data\n $rules = [\n 'to_id' => 'required|integer|min:0',\n 'amount' => 'required|numeric|min:0.01',\n 'details' => 'nullable',\n ];\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n $response = [\n 'status' => false,\n 'errors' => $validator->errors()->all(),\n ];\n return response()->json($response, 200);\n }\n\n // People can't have transaction to themselves (by editing front-end code)\n if($request->to_id == $id){\n $response = [\n 'status' => false,\n 'errors' => [__('validation.selfTransaction')],\n ];\n return response()->json($response, 200);\n }\n\n // From Account\n $from_account = Account::findOrFail($id);\n\n // Checking balance | Bank doesn't allow less than zero for balance number.\n if($from_account->balance < ($request->amount + $this->bank_fee)){\n $response = [\n 'status' => false,\n 'errors' => [__('validation.notEnoughBalance')],\n ];\n return response()->json($response, 200);\n }\n\n // Checking destination account\n $to_account = Account::find($request->to_id);\n if(!$to_account){\n $response = [\n 'status' => false,\n 'errors' => [__('validation.destAccountNotFound')],\n ];\n return response()->json($response, 200);\n }\n\n // Process\n $from_account->balance = $from_account->balance - ($request->amount + $this->bank_fee);\n $from_account->save();\n $to_account->balance = $to_account->balance + $request->amount;\n $to_account->save();\n // App\\Observers\\AccountObserver will handle post {action} tasks\n\n // Inserting transaction\n $transaction = new Transaction;\n $transaction->from_id = $from_account->id;\n $transaction->to_id = $to_account->id;\n $transaction->amount = $request->amount;\n $transaction->details = $request->details;\n $transaction->save();\n // App\\Observers\\TransactionObserver will handle post {action} tasks\n\n // Now we can send Notifications\n\n // At last...\n $response = [\n 'status' => true,\n 'model' => $transaction->load('from.user', 'to.user'),\n 'new_balance' => $from_account->balance,\n ];\n return response()->json($response, 200);\n }", "public static function createAccount($userIdentity, $bankName = null, $owner = null, $cardNumber = null, $shaba = null, $accountNumber = null);", "private static function addTransaction($data)\n {\n global $db;\n\n try {\n $fields = implode(', ', array_map(\n function ($v, $k) {\n return sprintf('`%s`', $k);\n },\n $data,\n array_keys(\n $data\n )\n ));\n\n $values = implode(', ', array_map(\n function ($v) {\n return sprintf(\"'%s'\", $v);\n },\n $data,\n array_keys(\n $data\n )\n ));\n\n $db->Execute(\"\n\t\t\t\tINSERT INTO\n\t\t\t\t\t`\" . static::$table_name . \"` (\" . $fields . \")\n\t\t\t\tVALUES\n\t\t\t\t\t(\" . $values . \")\n\t\t\t\");\n } catch (\\Exception $exception) {\n //$this->logEx($exception);\n }\n }", "function add_customer($params){\n $this->company_db->insert('tbl_customer', $params);\n return $this->company_db->insert_id();\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 }", "function addUser($userInfo){\n $this->db->trans_start();\n $this->db->insert('Users', $userInfo);\n\n $insert_id = $this->db->insert_id();\n\n $this->db->trans_complete();\n\n return $insert_id;\n }", "function bunq_CreateRequest($amount, $description, $redirect, $user = 0, $account = 0) {\n\n\t$apiContext = ApiContext::restore(ApiContext::FILENAME_CONFIG_DEFAULT);\n\t$users = User::listing($apiContext)->getValue();\n\t//$user = $users[$user]->getUserPerson();\n\t$user = $users[$user]->getUserCompany();\n\t$userId = $user->getId();\n\t$monetaryAccounts = MonetaryAccount::listing($apiContext, $userId)->getValue();\n\t$monetaryAccount = $monetaryAccounts[$account]->getMonetaryAccountBank();\n\t$monetaryAccountId = $monetaryAccount->getId();\n\t$requestMap = [\n\t\tBunqMeTab::FIELD_BUNQME_TAB_ENTRY => [\n\t\t\tBunqMeTabEntry::FIELD_AMOUNT_INQUIRED => new Amount($amount, 'EUR'),\n\t\t\tBunqMeTabEntry::FIELD_REDIRECT_URL => $redirect,\n\t\t\tBunqMeTabEntry::FIELD_DESCRIPTION => $description\n\t\t]\n\t];\n\t$createBunqMeTab = BunqMeTab::create($apiContext, $requestMap, $userId, $monetaryAccountId)->getValue();\n\t$bunqMeRequest = BunqMeTab::get($apiContext, $userId, $monetaryAccountId, $createBunqMeTab)->getValue();\n\t$r[\"id\"] = $bunqMeRequest->getId();\n\t$r[\"uuid\"] = $bunqMeRequest->getBunqmeTabEntry()->getUuid();\n\t$r[\"amount\"] = $bunqMeRequest->getBunqmeTabEntry()->getAmountInquired()->getValue();\n\t$r[\"paymentlink\"] = $bunqMeRequest->getBunqmeTabShareUrl();\n\t$r[\"status\"] = $bunqMeRequest->getBunqmeTabEntry()->getStatus();\n\t$r[\"description\"] = $bunqMeRequest->getBunqmeTabEntry()->getDescription();\n\t$r[\"redirecturl\"] = $bunqMeRequest->getBunqmeTabEntry()->getRedirectUrl();\n\t$r[\"raw\"] = $bunqMeRequest;\n\treturn $r;\n\n}" ]
[ "0.6663536", "0.6490498", "0.6286132", "0.6228105", "0.60515916", "0.60260266", "0.6001053", "0.5961314", "0.5954987", "0.59515584", "0.58713526", "0.5761473", "0.57506424", "0.57470787", "0.57373303", "0.5735373", "0.5711051", "0.57082266", "0.5640402", "0.56190807", "0.55622756", "0.5547448", "0.5527837", "0.5524945", "0.5517172", "0.55105925", "0.55032396", "0.5490441", "0.5489355", "0.54582137", "0.5407361", "0.540691", "0.53856206", "0.5380524", "0.53663975", "0.5363754", "0.535727", "0.53217083", "0.53210735", "0.5289319", "0.5287486", "0.5282952", "0.52828884", "0.5270351", "0.52666324", "0.5263738", "0.52478695", "0.5244586", "0.52386755", "0.52307606", "0.5226203", "0.52043724", "0.5198597", "0.51944244", "0.51940036", "0.51875556", "0.5186523", "0.5177175", "0.51646584", "0.5153882", "0.51469344", "0.51425105", "0.51424366", "0.5140528", "0.5135352", "0.5134243", "0.512837", "0.5127319", "0.5115996", "0.51155025", "0.5114223", "0.5101798", "0.51016873", "0.5100994", "0.50969005", "0.5095691", "0.5095691", "0.5092343", "0.50867134", "0.5086468", "0.50823456", "0.5079379", "0.5077948", "0.5076395", "0.50758064", "0.5071786", "0.5059863", "0.50579965", "0.50577587", "0.50541425", "0.5043684", "0.5033558", "0.5031197", "0.5031131", "0.50307137", "0.50294304", "0.5028613", "0.50276357", "0.5026129", "0.50226766" ]
0.6032627
5
This command is used to obtain an XML list of transactions from your WHMCS Parameters: None Optional Parameters: clientid User ID to obtain details for invoiceid Obtain transactions for a specific invoice transid Obtain details for a specific transaction ID See:
public function whmcs_get_transactions($params = array()) { $params['action'] = 'GetTransactions'; // return Whmcs_base::send_request($params); $load = new Whmcs_base(); return $load->send_request($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_client_transactions($client_id)\n {\n $sql=\"SELECT * FROM transactions where client_id=$client_id order by trans_date desc\";\n $q=$this->db->query($sql);\n return $q->result_array();\n }", "public function getTransactions();", "public static function pxp_client_transactions_list()\n\t{\n\t\tglobal $My_WP_List_Table;\n\t\t\n\t\t$transactions = self::get_transactions();\n\t\t\n\t\t// Set the transactions to the table list.\n\t\t$My_WP_List_Table->set_item_list( $transactions );\n\t\t\n\t\t// Fetch, prepare, sort, and filter our data.\n\t\t$My_WP_List_Table->prepare_items();\n?>\n\t\t<div>\n\t\t\t<h2>Transaction History</h2>\n\t\t<div>\n\t\t<div>\n\t\t\t<h4>\n\t\t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent finibus orci non turpis suscipit ornare.\n\t\t\t</h4>\n\t\t</div>\n\n<?php \n\t\t$My_WP_List_Table->display();\t\n\t}", "public function transactionsAction() {\n\t\ttry {\n\t\t\t\t\n $pageHeading = \"Transactions\";\n $this->view->page_heading = $pageHeading;\n $this->view->data_page = \"tables\";\n\t\t\t$objPaggination \t\t\t= new Base_Model_ObtorLib_Base_Lib_Paggination();\n \n\t\t\t$objTransactionsService \t\t= new Base_Model_Lib_Invoice_Service_Transaction();\n $objTransactionsEntity \t\t= new Base_Model_Lib_Invoice_Entity_Transaction();\n $objTransactionsService->transaction = $objTransactionsEntity;\n $totalResult = $objTransactionsService->searchCount();\n $page=$this->_getParam('page',1);\n\t\t\t$objPaggination->CurrentPage = $page;\n\t\t\t$objPaggination->TotalResults = $totalResult;\n\t\t\t$paginationData = $objPaggination->getPaggingData();\n\t\t\t$pageLimit1 = $paginationData['MYSQL_LIMIT1'];\n\t\t\t$pageLimit2 = $paginationData['MYSQL_LIMIT2'];\n\t\t\t\t\t\n\t\t\t$limit \t\t\t\t\t\t = \" LIMIT $pageLimit1,$pageLimit2\";\n \n if($page == ''){\n\t\t\t\t$page = 1;\n\t\t\t}\n\t\t\t\n\t\t\t$result \t\t = $objTransactionsService->search($limit);\n\t\t\t$this->view->transactions = $result;\n\t\t\t$this->view->paggination = $objPaggination;\n\t\t\t$this->view->pageNum = $page;\n\t\t\t\n\t\t\t\n\t\t} catch ( Exception $ex ) {\n\t\t\tthrow new Exception ( '<ERROR>' . $ex->getMessage () . \"\\n\" );\n\t\t}\n\n\t}", "abstract protected function getTransactions();", "public function GetExpertTransactions(){\n\t\tif($this->IsLoggedIn('cashier')){\n\t\t\tif(isset($_GET) && !empty($_GET)){\n\t\t\t\t$where=array(\n\t\t\t\t\t'from_date'\t=>$_GET['from_date'],\n\t\t\t\t\t'to_date'\t\t=> $_GET['to_date']\n\t\t\t\t);\n\t\t\t\t\t$data=$this->CashierModel->GetExpertTransactions($where);\n\t\t\t\t\t$this->ReturnJsonArray(true,false,$data['res_arr']);\n die;\n\t\t\t}else{\n\t\t\t\t$this->ReturnJsonArray(false,true,\"Wrong Method!\");\n\t\t\t\tdie;\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\telse{\n\t\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\n\t}", "private function transactions()\n {\n $invoiceModel = new InvoiceModel();\n $transactions = $invoiceModel->getAllInvoices();\n\n $csvData = [];\n $csvData[] = [\"Invoice ID\", \"Company Name\", \"Invoice Amount\"];\n if (!empty($transactions)) {\n foreach ($transactions as $transaction) {\n $csvData[] = [$transaction[\"id\"], $transaction[\"client\"], $transaction[\"invoice_amount_plus_vat\"]];\n }\n }\n\n $this->getCsvFile($csvData, \"transactions_\" . time() . \".csv\");\n }", "function cpay_GetRevise($start,$end) {\r\n $start= strtotime($start);\r\n $start=date('Y:m:d H:i:s',$start);\r\n $end= strtotime($end);\r\n $end=date('Y:m:d H:i:s',$end);\r\n $payments='';\r\n $query=\"SELECT * from `op_transactions` WHERE `paysys` = 'CITYPAY' AND `date` BETWEEN '\".$start.\"' AND '\".$end.\"';\";\r\n $rawData= simple_queryall($query);\r\n if (!empty($rawData)) {\r\n foreach ($rawData as $io=>$each) {\r\n if (cpay_ispos($each['note'], 'date:')) {\r\n $tmpDate=explode('date:',$each['note']);\r\n $transDate=trim($tmpDate[1]);\r\n } else {\r\n $transDate= strtotime($each['date']);\r\n $transDate= date(\"YmdHis\",$transDate);\r\n }\r\n $cleanHash= str_replace('CPAY_', '', $each['hash']);\r\n \r\n $payments.='\r\n <Payment>\r\n <TransactionId>'.$cleanHash.'</TransactionId>\r\n <Account>'.$each['customerid'].'</Account>\r\n <TransactionDate>'.$transDate.'</TransactionDate>\r\n <Amount>'.$each['summ'].'</Amount>\r\n </Payment>\r\n ';\r\n }\r\n }\r\n \r\n $result='\r\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n <Response>\r\n '.$payments.'\r\n </Response>\r\n ';\r\n $result=trim($result);\r\n print($result);\r\n}", "public function get_userTransaction_get(){\n\t\textract($_GET);\n\t\t$result = $this->dashboard_model->get_userTransaction($user_id);\n\t\treturn $this->response($result);\t\t\t\n\t}", "public function transactions() {\n if ($this->input->get('view')) {\n $id = $this->myencrypt->decrypt_url($this->input->get('transaction_id'));\n $data['transaction'] = $this->account_model->getTransactions(array('ttransactions.ttransaction_id' => $id));\n } else {\n $mfinancialyear_id = null;\n if ($this->session->has_userdata('financialyear')) {\n $financialyear_data = $this->session->userdata('financialyear');\n $mfinancialyear_id = $financialyear_data['mfinancialyear_id'];\n }\n if ($this->input->get('unlimited')) {\n $data['unlimited'] = true;\n $data['transactions'] = $this->account_model->getTransactions(false, array('mfinancialyear_id' => $mfinancialyear_id));\n } else {\n $data['transactions'] = $this->account_model->getTransactions(FALSE, array('mfinancialyear_id' => $mfinancialyear_id), 10);\n }\n }\n $this->view('transactions', $data);\n }", "public function get_all_transactions($clients_string)\n\t\t{\n\t\t\t$sql=\"SELECT * FROM transactions t JOIN clients c ON t.client_id=c.client_id where t.client_id In $clients_string ORDER BY trans_date desc\";\n\t\t\t$q=$this->db->query($sql);\n\t\t\treturn $q->result_array();\n }", "public static function pxp_client_transaction_details( $transaction_id )\n\t{\n\t}", "public function transaction($settings = array())\n { \n $data = false;\n // MAKE API CALL\n $defaults = array(\n 'debug' => false,\n 'details' => false,\n 'method' => 'transaction/id',\n 'chain' => $this::$blockchain,\n 'base' => $this::$options['blockchains'][$this::$blockchain]['base'],\n 'id' => 0,\n 'showtxn' => 0,\n 'showtxnio' => 1\n );\n $options = array_merge($defaults, $settings);\n $key = 'transacton_'.$options['chain'].'_'.$options['id'];\n $results = $this::$cache->read($key, 'shortterm');\n $this->url($options);\n if(!$results){\n $results = $this->get($options);\n $this::$cache->write($key, $results, 'shortterm');\n }\n elseif($options['debug'] === true)\n {\n $this->url($options);\n }\n if($options['details'] === true)\n {\n $data = $results;\n }\n else if(isset($results['status']) && $results['status'] == 'success')\n {\n $tx = $results['data']['transaction'];\n $data = $tx;\n }\n return $data;\n }", "public function search_billing_transactions($agreementId,$params){ \n try {\n $result = Agreement::searchTransactions($agreementId, $params, $this->_api_context); \n $returnArray['RESULT'] = 'Success'; \n $returnArray['BILLING_TRANSACTIONS'] = $result->toArray();\n $returnArray['RAWREQUEST']='{id:'.$agreementId.'}';\n $returnArray['RAWRESPONSE']=$result->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n } \n }", "public function actionIndex($xml = null)\n {\n $searchModel = new TransactionSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n if ($xml) {\n Yii::$app->response->format = Response::FORMAT_XML;\n $period = ($searchModel->beginPeriod ?: 'mesozoic') . '_' . ($searchModel->endPeriod ?: date('Y-m-d'));\n $fileName = Client::findOne($searchModel->clientId)->name . \"_transactions_{$period}.xml\";\n Yii::$app->response->setDownloadHeaders($fileName);\n /** @var ActiveQuery $aq */\n $aq = $dataProvider->query;\n return $aq->asArray()->all();\n }\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function QueryTxn() {\r\n\r\n\r\n $ch = curl_init();\r\n\r\n $CURLParameters = http_build_query(array(\r\n // Our default parameters!\r\n \"key\" => $this->key,\r\n \"appid\" => $this->game,\r\n // This can vary from request to request, sometimes its steamid or steamids or even an array.\r\n //\"steamid\" => $this->steamid,\r\n // Custom Queries below here.\r\n \"transid\" => $this->transid,\r\n \"orderid\" => $this->orderid,\r\n ));\r\n\r\n curl_setopt($ch, CURLOPT_URL, \"https://partner.steam-api.com/\" . $this->interface . \"/QueryTxn/v2/?\" . $CURLParameters);\r\n\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n //curl_setopt($ch, CURLOPT_POST, 1);\r\n //curl_setopt($ch, CURLOPT_POSTFIELDS, $CURLParameters);\r\n $CURLResponse = json_decode(curl_exec($ch));\r\n $CURLResponseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n curl_close($ch);\r\n\r\n\r\n // Error handling improved!\r\n\r\n if ($CURLResponseCode != 200) {\r\n if ($CURLResponseCode == 400) {\r\n throw new exceptions\\SteamRequestParameterException(\"The Order ID, Transaction ID or another parameter is invalid!\");\r\n }\r\n if ($CURLResponseCode == 401) {\r\n throw new exceptions\\SteamException(\"App ID or API Key is invalid.\");\r\n }\r\n throw new exceptions\\SteamRequestException(\"$CURLResponseCode Request Error.\");\r\n }\r\n\r\n\r\n return $CURLResponse->response->params;\r\n }", "public function actionViewTransaction() {\n\t\t$params = ['status' => [Yii::$app->params['STATUS_PROCESS'], Yii::$app->params['STATUS_CLOSED']]];\n\t\t$trxSearchModel = new TrxTransactionsSearch();\n\t\t$trxDataProvider = $trxSearchModel->search(Yii::$app->request->queryParams, $params);\n\n \treturn $this->render('view-transaction', ['dataProvider' => $trxDataProvider,\n \t\t\t\t\t\t\t\t\t\t\t 'searchModel' => $trxSearchModel,]);\n }", "public function actionTransaction(){\n $user_id = \\Yii::$app->user->getID();\n $user = User::findIdentity($user_id);\n $transactionsIn = Transaction::find()->joinWith('order')->joinWith('post')->joinWith('withdraw')->where([\n 'payment_status'=>'completed', \n 'post_services.owner_id'=>\\Yii::$app->user->getId(),\n ])->all();\n $transactionsOut = Transaction::find()->joinWith('order')->joinWith('post')->where([\n 'payment_status'=>'completed', \n 'accepted_orders.user_id'=>\\Yii::$app->user->getId(),\n ])->all();\n return $this->render('transactions', ['transactionsIn'=>$transactionsIn, 'transactionsOut'=>$transactionsOut, 'user'=>$user]);\n }", "function get_transaction_result_set($agent_id){\n $user=new Policy();\n $transaction_result_set=$user->read_selective_transaction(\"WHERE agent_id=\".$agent_id);\n return $transaction_result_set; \n }", "public function actionIndex()\n {\n $searchModel = new TransactionSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->query->where('gtransactions.clientId = '.Yii::$app->user->id);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function test_getTransactions()\n {\n factory( Transaction::class, 20 )->create();\n /**\n * @var $builder TransactionsListBuilder\n */\n $builder = app( TransactionsListBuilder::class );\n $viewModel = $builder->GetModel();\n $response = $this->get('/api/transactions');\n $response\n ->assertStatus(200)\n ->assertJson([\n 'items' => [\n [\n 'id' => $viewModel->items[0]->id,\n 'value' => $viewModel->items[0]->value\n ]\n ],\n 'total' => $viewModel->total\n ]);\n }", "function getTransactions() {\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => \"https://hackathon-be.mybluemix.net/customer/304fd2e19f1c14fe3345cca788e4e83d/amexprofitability\",\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\treturn $resp_decode;\n}", "public function getInvoiceTransactions($invoice_id)\n {\n return $this->remote->select()->from('invoicetransaction')->where('invoiceid', '=', $invoice_id)->fetchAll();\n }", "public function getTransaction();", "public function paymentTransactions($paymentId, $merchantList, $startDate) {\r\n\t\t$transactionList = array();\r\n\t\t\r\n\t\t$valuesFormExport = array();\r\n\t\t$valuesFormExport[] = new Oara_Curl_Parameter('csv', 'csv');\r\n\t\t$valuesFormExport[] = new Oara_Curl_Parameter('ajax', 'ajax');\r\n\t\t$valuesFormExport[] = new Oara_Curl_Parameter('type', 'csv');\r\n\t\t$valuesFormExport[] = new Oara_Curl_Parameter('sortColumn', '');\r\n\t\t$valuesFormExport[] = new Oara_Curl_Parameter('sortType', '');\r\n\t\t$valuesFormExport[] = new Oara_Curl_Parameter('startdate', '');\r\n\t\t$valuesFormExport[] = new Oara_Curl_Parameter('enddate', '');\r\n\t\t$valuesFormExport[] = new Oara_Curl_Parameter('paymentid', $paymentId);\r\n\r\n\t\t$urls = array();\r\n\t\t$urls[] = new Oara_Curl_Request('http://www.pepperjamnetwork.com/affiliate/report_payment_history_detail.php?', $valuesFormExport);\r\n\t\t$exportReport = $this->_client->get($urls);\r\n\r\n\t\t$exportData = str_getcsv($exportReport[0], \"\\n\");\r\n\t\t$num = count($exportData);\r\n\t\tfor ($i = 1; $i < $num; $i++) {\r\n\t\t\t$transactionArray = str_getcsv($exportData[$i], \",\");\r\n\t\t\t$transactionList[] = $transactionArray[1];\r\n\t\t}\r\n\t\t\r\n\t\treturn $transactionList;\r\n\t}", "public function index()\n {\n // Get transactions\n // Use Laravel’s pagination for showing Clients/Transactions list, 10 entries per page\n $transactions = Transaction::paginate(10);\n return TransactionResource::collection($transactions);\n }", "function _getTransactionDetails($transaction_id) {\t\t\n\t\t// Set request-specific fields.\n\t\t$transactionID = urlencode($transaction_id);\n\t\t$this->nvpStr = \"&TRANSACTIONID=$transactionID\";\t\n\t\t\t\n\t\treturn $this->query(\"RefundTransaction\");\n\t}", "public function show($id) {\n return ClientTransaction::find($id);\n }", "public function editTransactionsAction() {\n\t\ttry {\n\n $pageHeading = \"Edit-Transactions\";\n $this->view->page_heading = $pageHeading;\n $this->view->data_page = \"tables\";\n \n $objTransactionsService \t\t= new Base_Model_Lib_Invoice_Service_Transaction();\n $objTransactionsEntity \t\t= new Base_Model_Lib_Invoice_Entity_Transaction();\n\t\t\t\n if ($this->_request->isPost()) {\n \n $objTransactionsEntity->setId($this->_request->getParam('txtId'));\n $objTransactionsEntity->setClient($this->_request->getParam('cmbClient'));\n $objTransactionsEntity->setDate($this->_request->getParam('txtTransactionDate'));\n $objTransactionsEntity->setGateway($this->_request->getParam('cmbPaymentMethod'));\n $objTransactionsEntity->setDescription($this->_request->getParam('txtDescription'));\n $objTransactionsEntity->setInvoiceId($this->_request->getParam('txtInvoiceID'));\n $objTransactionsEntity->setTransId($this->_request->getParam('txtTransactionID'));\n $objTransactionsEntity->setAmountIn($this->_request->getParam('txtAmountIn'));\n $objTransactionsEntity->setFees($this->_request->getParam('txtFees'));\n $objTransactionsEntity->setAmountOut($this->_request->getParam('txtAmountOut'));\n $objTransactionsService->transaction = $objTransactionsEntity;\n $objTransactionsService->updateTransaction();\n $this->_redirect('/admin/billing/transactions/');\n \n } else {\n \n $objClientService = new Base_Model_Lib_Client_Service_Client();\n $objClientEntity = new Base_Model_Lib_Client_Entity_Client();\n $objClientService->client = $objClientEntity; \n $clientDetails = $objClientService->search(\"\");\n $this->view->clientDetails = $clientDetails;\n \n $transactionId = $this->_request->getParam('id');\n $transactionInfo = $objTransactionsService->getItem($transactionId);\n $this->view->transactionInfo = $transactionInfo;\n \n $objPaymentMethodService = new Base_Model_Lib_Catelog_Service_PaymentMethod();\n $paymentMethods = $objPaymentMethodService->getAll();\n $this->view->paymentMethods = $paymentMethods;\n }\n\t\t\t\n \n \n \n\t\t\t\t\n\t\t} catch ( Exception $ex ) {\n\t\t\tthrow new Exception ( '<ERROR>' . $ex->getMessage () . \"\\n\" );\n\t\t}\n\n\t}", "public static function get_transactions()\n\t{\n\t\tglobal $user_ID;\n\t\t\n\t\t$args = array(\n\t\t\t'posts_per_page'\t=> -1,\n\t\t\t'post_type'\t\t\t=> 'pxp_transactions',\n\t\t\t'post_status'\t\t=> 'private',\n\t\t\t'order'\t\t\t\t=> 'date',\n\t\t\t'orderby'\t\t\t=> 'ASC',\n\t\t\t'author'\t\t\t=> $user_ID\n\t\t);\n\n\t\t$query = get_posts( $args );\n\t\t\n\t\t$transactions = array();\n\t\t\n\t\tforeach( $query as $transaction )\n\t\t{\n\t\t\t$transactions[] = array(\n\t\t\t\t'ID'\t\t\t\t\t\t=> $transaction->ID,\n\t\t\t\t'transaction_description'\t=> $transaction->post_content,\n\t\t\t\t'transaction_date'\t\t\t=> date( 'F j, Y g:i A', strtotime( $transaction->post_date ) ),\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $transactions;\n\t}", "public function GetSubscriptionTransactions($subscriptionIdentifier){\n $result_dto = new dtoResultObject();\n $result_dto->Status = false;\n $result_dto->ErrorMessage = \"SOAP call not executed.\";\n try {\n $client = $this->GetSoapClient();\n $params = array(\n 'subscriptionIdentifier' => $subscriptionIdentifier,\n );\n $result = $client->GetSubscriptionTransactions($params);\n $transactions=array();\n foreach($result->GetSubscriptionTransactionsResult->Transaction as $transaction){\n $dtoTransaction=new dtoTransactionStatus();\n $dtoTransaction->Address=$transaction[\"Address\"];\n $dtoTransaction->Amount=$transaction[\"Amount\"];\n $dtoTransaction->ExpiryDate=$transaction[\"ExpirationDate\"];\n $dtoTransaction->Zip=$transaction[\"Zip\"];\n $dtoTransaction->City=$transaction[\"City\"];\n $dtoTransaction->Country=$transaction[\"Country\"];\n $dtoTransaction->Data=$transaction[\"DataXML\"];\n $dtoTransaction->Description=$transaction[\"Description\"];\n $dtoTransaction->Status=$transaction[\"Status\"];\n $dtoTransaction->Id=$transaction[\"Id\"];\n $dtoTransaction->Url=$transaction[\"Url\"];\n $dtoTransaction->State=$transaction[\"State\"];\n $dtoTransaction->MerchantIdentifier=$transaction[\"MerchantIdentifier\"];\n $dtoTransaction->TransactionIdentifier=$transaction[\"TransactionIdentifier\"];\n $transactions[]=$dtoTransaction;\n }\n return $transactions;\n } catch (Exception $e) {\n $result_dto->ErrorMessage = \"Exception occured: \" . $e;\n return $result_dto; \n }\n return $result_dto;\n }", "public function transactionGetParameters ();", "public function getconnectTransactions() {\n $yesterday = new \\DateTime('yesterday');\n $start_date = $yesterday->format('Y-m-d');\n $today = new \\DateTime('now');\n $end_date = $today->format('Y-m-d');\n $status = ApplaneConstentInterface::COMPLETED;\n //create the query\n $query = $this->createQueryBuilder('c');\n $query->select()\n ->Where('c.date >=:create_at', 'c.date <:end_at', 'c.status =:status')\n ->setParameter('create_at', $start_date)\n ->setParameter('end_at', $end_date)\n ->setParameter('status', $status);\n\n $result = $query->getQuery();\n $result_res = $result->getResult();\n return $result_res;\n }", "public function transaction()\r\n {\r\n if (($this->dx_auth->is_logged_in()) || ($this->facebook_lib->logged_in()))\r\n {\r\n $user_id = $this->dx_auth->get_user_id();\r\n $conditions = array(\"reservation.userto\" => $user_id);\r\n $query = $this->Trips_model->get_reservation($conditions);\r\n\r\n // Get offset and limit for page viewing\r\n $start = (int) $this->uri->segment(3, 0);\r\n\r\n // Number of record showing per page\r\n $row_count = 20;\r\n\r\n if ($start > 0)\r\n $offset = ($start - 1) * $row_count;\r\n else\r\n $offset = $start * $row_count;\r\n\r\n $limit = array($row_count, $offset);\r\n // Get all transaction\r\n $data['result'] = $this->Trips_model->get_reservation($conditions, $limit);\r\n\r\n // Pagination config\r\n $config['base_url'] = site_url('account/transaction');\r\n $config['uri_segment'] = 3;\r\n $config['num_links'] = 5;\r\n $config['total_rows'] = $query->num_rows();\r\n $config['per_page'] = $row_count;\r\n\r\n // Init pagination\r\n $this->pagination->initialize($config);\r\n // Create pagination links\r\n $data['pagination'] = $this->pagination->create_links2();\r\n\r\n $data['title'] = get_meta_details('Your_Transaction_Details', 'title');\r\n $data[\"meta_keyword\"] = get_meta_details('Your_Transaction_Details', 'meta_keyword');\r\n $data[\"meta_description\"] = get_meta_details('Your_Transaction_Details', 'meta_description');\r\n $data['message_element'] = \"account/view_transaction\";\r\n $this->load->view('template', $data);\r\n }\r\n else\r\n {\r\n redirect('users/signin');\r\n }\r\n }", "function transaction_list($where, $query)\n {\n }", "public function action_account_transaction() {\n $package = Model::factory('package');\n $invoice_id = explode('/', $_SERVER['REQUEST_URI']);\n $transaction_info = $package->account_transaction($invoice_id[3]);\n $this->template->title = CLOUD_SITENAME . ' | Account';\n $this->template->page_title = __('account_transaction_details');\n $this->meta_description = \"\";\n $this->template->content = View::factory(\"admin/package_plan/account_transaction\")\n ->bind('transaction_info', $transaction_info);\n }", "protected function viewTransactions($trans){\n $form = new control\\form('payment_form_transactions');\n $table = new control\\table('tblpaymentTransactions');\n $table->configure('HEADERS', [_('ID'), _('Name'), _('Localize'), _('Edit'), _('Delete')]);\n $table->configure('HEADERS_WIDTH', [1, 7, 2, 1, 1]);\n $table->configure('ALIGN_CENTER', [TRUE, FALSE, TRUE, TRUE, TRUE]);\n $table->configure('BORDER', true);\n $table->configure('SIZE', 9);\n $counter = 0;\n if(!is_null($trans)){\n foreach($trans as $tr){\n\n $counter += 1;\n $row = new control\\row('blog_cat_row');\n\n $lbl_id = new control\\label('lbl');\n $lbl_id->configure('LABEL', $counter);\n $row->add($lbl_id, 1);\n\n $lbl_cat = new control\\label('lbl');\n $lbl_cat->configure('LABEL', 0);\n $row->add($lbl_cat, 1);\n\n $lbl_cat = new control\\label('lbl');\n $lbl_cat->configure('LABEL', 0);\n $row->add($lbl_cat, 1);\n\n $btnVewTransaction = new control\\button('btnVewTransaction');\n $btnVewTransaction->configure('LABEL', _('View'));\n $btnVewTransaction->configure('HREF', core\\general::createUrl(['service', 'administrator', 'load', 'payment', 'viewTransaction', $tr->id]));\n $row->add($btnVewTransaction, 2);\n\n $table->add_row($row);\n }\n }\n $form->add($table);\n return [_('Transactions'),$form->draw()];\n }", "public function getTransactions()\n\t{\n\t\treturn $this->data['transactions'];\n\t}", "function yamoney_transactions_page() {\n $sql = 'SELECT * FROM {yamoney_transaction}';\n\n $rez = pager_query($sql, 20, 0, NULL);\n\n $transactions = array();\n\n while ($row = db_fetch_array($rez)) {\n $transactions[] = $row;\n }\n\n drupal_set_title(t('Transactions'));\n return yamoney_create_transaction_table($transactions);\n}", "public function fetchTransactions(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\FetchTransactionsRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\FetchTransactionsRequest', $parameters);\n }", "public function paymentTransactions($paymentId, $merchantList, $startDate) {\n\t\t$transactionList = array ();\n\t\t\n\t\treturn $transactionList;\n\t}", "public function gettransaction($txid)\n\t{\n\t\treturn $this->connect('gettransaction', array((string) $txid));\n\t}", "public function query_in_transactions(){\n\t\t$response = $this->execute($this->query_in_transaction_url);\n\t\tif(!$response){\n\t\t\tthrow new Exception(\"error in communication\");\n\t\t}\n\t\treturn json_decode($response,true);\n\t}", "public function paymentTransactions($paymentId, $merchantList, $startDate) {\r\n\t\t$transactionList = array();\r\n\t\tforeach ($this->_siteList as $site) {\r\n\t\t\t$url = \"https://65.245.193.87/downloadreport.php?payid=$paymentId&token=\".$site->secureToken.\"&reportid=3\";\r\n\t\t\t$result = file_get_contents($url);\r\n\t\t\tif (preg_match(\"/You cannot request/\", $result)) {\r\n\t\t\t\tthrow new Exception(\"Reached the limit\");\r\n\t\t\t}\r\n\t\t\t$paymentLines = str_getcsv($result, \"\\n\");\r\n\t\t\t$number = count($paymentLines);\r\n\t\t\tfor ($j = 1; $j < $number; $j++) {\r\n\t\t\t\t$paymentData = str_getcsv($paymentLines[$j], \",\");\r\n\t\t\t\t$transactionList[] = $paymentData[4];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $transactionList;\r\n\t}", "public function getClientTransationNumbers($client_id) {\n $stmt = $this->conn->stmt_init ();\n $stmt->prepare ( \"call getClientTransationNumbers (?)\" );\n $stmt->bind_param ( 'i', $client_id );\n $stmt->execute ();\n \n return $stmt->get_result ();\n }", "public function account_transaction($id) {\n $options = [\n 'projection' => [\n '_id' => 1,\n 'purchase_inv_id' => 1,\n 'subscription_cost' => 1,\n 'setup_cost' => 1,\n 'amount' => 1,\n 'package_type' => 1,\n 'payment_terms' => 1,\n 'createddate' => 1,\n 'expirydate' => 1,\n 'paid_status' => 1,\n 'txnID' => 1,\n 'ePGTxnID' => 1,\n 'currency' => 1,\n 'responsecode' => 1,\n 'response_msg' => 1,\n 'pay_mode' => 1,\n 'service_tax' => 1,\n 'service_tax_cost' => 1\n ]\n ];\n\n $query_result = $this->mongo_db->find(MDB_PACKAGE_INFO, ['_id' => (int) $id], $options);\n $result = (!empty($query_result) && isset($query_result[0])) ? $query_result[0] : array();\n return $result;\n }", "public function getTransaction($txid);", "public function paymentTransactions($paymentId, $merchantList, $startDate){\r\n\t\t$result = array();\r\n\t\treturn $result;\r\n\t}", "public function index()\n {\n $uid = auth()->user()->id;\n return Transaction::where('user_id', $uid)->get();\n }", "public function getTransaction($id){\n\n $gateway = $this->getGateway();\n \n $transaction = $gateway->transaction()->find($id);\n\n return $transaction;\n\n }", "public function getTransactions($merchantId)\n {\n $transactionModel = new Application_Model_TransactionTable();\n\t\t$transactionDataArr = $transactionModel->getTransactionsByMerchantID($merchantId);\n\t\t\n\t\t$transactionDataArr = $this->applyCurrencyConverter($transactionDataArr, 'GBP');\n\t\t\n\t\treturn $transactionDataArr;\n }", "public function get_userTransaction($user_id){\n\n\t\t\t//$user_id=$this->session->userdata('user_id');\n\n\t\t//Connection establishment, processing of data and response from REST API\n\t\t\t$path=base_url();\n\t\t\t$url = $path.'api/Dashboard_api/get_userTransaction?user_id='.$user_id;\t\n\t\t\t$ch = curl_init($url);\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$response_json = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t$response=json_decode($response_json, true);\n\t\t\treturn $response;\t\n\t\t}", "public function getCorpoAdminAccountTransactionsList($parameters)\n {\n $accountList = $this->em->getRepository('CorporateBundle:CorpoAccountTransactions')->getAccountTransactionsList($parameters);\n return $accountList;\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "public function get_transaction($id){\n $this->load->database();\n\n $query = $this->db->select('*')\n ->get_where('tbl_transactions',array('id' => $id));\n return $query->result_array();\n }", "public function getXml()\n {\n if (is_null($this->quote)) {\n throw new \\LogicException('Quote object not set.');\n }\n\n if (is_null($this->preparedXml)) {\n $paymentArray = $this->config->getPaymentArray();\n $address = $this->quote->getBillingAddress();\n\n $taType = '27920';\n $processingCode = ($this->config->isLiveMode()) ? '1' : '8';\n\n $xml = simplexml_load_string(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<REQUEST></REQUEST>\");\n $customerobj = $xml->addChild('CUSTOMER');\n $customerobj->addChild('AUTH_ID', $this->config->getApiAuthId());\n $customerobj->addChild('AUTH_PW', $this->config->getApiAuthPassword());\n $customerobj->addChild('CUSTOMER_TA_ID', md5(time()));\n $processobj = $xml->addChild('PROCESS');\n $processobj->addChild('TA_TYPE', $taType);\n $processobj->addChild('PROCESSING_CODE', $processingCode);\n $processobj->addChild('REQUESTREASON', 'ABK');\n $queryobj = $xml->addChild('QUERY');\n $queryobj->addChild('FIRST_NAME', $this->escaper->escapeHtml(substr($address->getFirstname(), 0, 64)));\n $queryobj->addChild('LAST_NAME', $this->escaper->escapeHtml(substr($address->getLastname(), 0, 64)));\n $customerDob = '';\n if ($dob = $this->quote->getCustomerDob()) {\n $customerDob = date('Y-m-d', strtotime($dob));\n }\n $queryobj->addChild('DOB', $customerDob);\n $queryobj->addChild('ADDR_STREET_FULL', $this->escaper->escapeHtml(substr($address->getStreetFull(), 0, 50)));\n $queryobj->addChild('ADDR_ZIP', substr($address->getPostcode(), 0, 5));\n $queryobj->addChild('ADDR_CITY', $this->escaper->escapeHtml(substr($address->getCity(), 0, 32)));\n $queryobj->addChild('ADDR_COUNTRY', $address->getCountryId());\n $queryobj->addChild('CUSTOMERIP', ($this->quote->getRemoteIp() ? $this->quote->getRemoteIp() : '127.0.0.1'));\n $queryobj->addChild('CUSTOMEREMAIL', $this->escaper->escapeHtml(substr($address->getEmail(), 0, 128)));\n $queryobj->addChild('CUSTOMERTEL', $this->escaper->escapeHtml(substr($address->getTelephone(), 0, 64)));\n $queryobj->addChild('COMPANY_NAME', $this->escaper->escapeHtml(substr($address->getCompany(), 0, 64)));\n $queryobj->addChild('AMOUNT', round($this->quote->getGrandTotal() * 100));\n\n // add purchase type with appended group type\n $purchaseType = isset($paymentArray[$this->paymentMethod]) ? $paymentArray[$this->paymentMethod] : '';\n $purchaseType .= ($this->quote->getCheckoutMethod() != Quote::CHECKOUT_METHOD_LOGIN_IN) ? '1' : '2';\n $queryobj->addChild('PURCHASE_TYPE', $purchaseType);\n\n $this->preparedXml = $xml;\n }\n\n return $this->preparedXml;\n }", "public function index()\r\n {\r\n $client = new Client();\r\n $res = $client->request('GET',\r\n 'https://api.ethplorer.io/getAddressTransactions/0xe060ea1402e5713c5E140054B1e1c253137E4636?apiKey=freekey');\r\n echo $res->getBody();\r\n\r\n\r\n }", "public function GetXML() {\n $xml = '<?xml version=\"1.0\" encoding=\"utf-8\"?><getAuthorization>';\n $xml .= \"<Version>$this->version</Version>\";\n $xml .= \"<Processor>$this->processor</Processor>\";\n $xml .= \"<MerchantID>$this->merchantID</MerchantID>\";\n if (!IsNullOrEmptyString($this->terminalID))\n $xml .= \"<TerminalID>$this->terminalID</TerminalID>\";\n $xml .= \"<TransType>$this->transType</TransType>\";\n $xml .= \"<TrAmount>$this->trAmount</TrAmount>\";\n if ($this->transType == '4' || $this->transType == 4)\n $xml .= \"<NewAmount>$this->newAmount</NewAmount>\";\n $xml .= \"<TrCurrency>$this->trCurrency</TrCurrency>\";\n $xml .= \"<DateAndTime>$this->dateAndTime</DateAndTime>\";\n if (!IsNullOrEmptyString($this->PAN))\n $xml .= \"<PAN>$this->PAN</PAN>\";\n if (!IsNullOrEmptyString($this->expDate))\n $xml .= \"<ExpDate>$this->expDate</ExpDate>\";\n if (!IsNullOrEmptyString($this->track1))\n $xml .= \"<Track1>$this->track1</Track1>\";\n if (!IsNullOrEmptyString($this->track2))\n $xml .= \"<Track2>$this->track2</Track2>\";\n $xml .= \"<RRN>$this->RRN</RRN>\";\n if (!IsNullOrEmptyString($this->authCode))\n $xml .= \"<AuthCode>$this->authCode</AuthCode>\";\n if (!IsNullOrEmptyString($this->CVC2))\n $xml .= \"<CVC2>$this->CVC2</CVC2>\";\n if (!IsNullOrEmptyString($this->securityLevelInd))\n $xml .= \"<SecurityLevelInd>$this->securityLevelInd</SecurityLevelInd>\";\n if (!IsNullOrEmptyString($this->UCAF))\n $xml .= \"<UCAF>$this->UCAF</UCAF>\";\n if (!IsNullOrEmptyString($this->CAVV))\n $xml .= \"<CAVV>$this->CAVV</CAVV>\";\n if (!IsNullOrEmptyString($this->XID))\n $xml .= \"<XID>$this->XID</XID>\";\n if (!IsNullOrEmptyString($this->merchantName))\n $xml .= \"<MerchantName>$this->merchantName</MerchantName>\";\n if (!IsNullOrEmptyString($this->merchantCity))\n $xml .= \"<MerchantCity>$this->merchantCity</MerchantCity>\";\n if (!IsNullOrEmptyString($this->merchantCountry))\n $xml .= \"<MerchantCountry>$this->merchantCountry</MerchantCountry>\";\n $xml .= \"</getAuthorization>\";\n return $xml;\n }", "function get_all_transactions(){\n $str_query=\"select * from pos_transaction\";\n if(!$this->query($str_query)){\n return false;\n }\n return $this->fetch();\n }", "public function TransactionQuery($request)\n {\n if (empty($request)) {\n die('No Transaction ID or Access Code provided!');\n }\n $response = $this->PostToRapidAPI(\"Transaction/\" . $request, '', false);\n\n return $response;\n }", "function _canadapostGetQuote() {\r\n\t$strXML = \"<?xml version=\\\"1.0\\\" ?>\";\r\n\r\n\t// set package configuration.\r\n\t$strXML .= \"<eparcel>\\n\";\r\n\t$strXML .= \" <language>\" . $this->language . \"</language>\\n\";\r\n\t$strXML .= \" <ratesAndServicesRequest>\\n\";\r\n\t$strXML .= \" <merchantCPCID>\" . $this->CPCID . \"</merchantCPCID>\\n\";\r\n\t$strXML .= \" <fromPostalCode>\" . $this->_canadapostOriginPostalCode . \"</fromPostalCode>\\n\";\r\n\t$strXML .= \" <turnAroundTime>\" . $this->turnaround_time . \"</turnAroundTime>\\n\";\r\n\t$strXML .= \" <itemsPrice>\" . (string)$this->items_price . \"</itemsPrice>\\n\";\r\n\t\r\n\t// add items information.\r\n\t$strXML .= \" <lineItems>\\n\";\r\n\tfor ($i=0; $i < $this->items_qty; $i++) {\r\n\t $this->item_description[$i] = str_replace(\"&\", \"and\", $this->item_description[$i]);\r\n\t\t$strXML .= \"\t <item>\\n\";\r\n\t\t$strXML .= \" <quantity>\" . $this->item_quantity[$i] . \"</quantity>\\n\";\r\n\t\t$strXML .= \" <weight>\" . ($this->item_weight[$i]) . \"</weight>\\n\";\r\n\t\t$strXML .= \" <length>\" . $this->item_length[$i] . \"</length>\\n\";\r\n\t\t$strXML .= \" <width>\" . $this->item_width[$i] . \"</width>\\n\";\r\n\t\t$strXML .= \" <height>\" . $this->item_height[$i] . \"</height>\\n\";\r\n\t\t$strXML .= \" <description>\" . $this->item_description[$i] . \"</description>\\n\";\r\n\t\tif ($this->item_readytoship[$i]) $strXML .= \" <readyToShip/>\\n\";\r\n\t\t$strXML .= \"\t </item>\\n\";\r\n\t}\r\n\t$strXML .= \" </lineItems>\\n\";\r\n\t\r\n\t// add destination information.\r\n\t$strXML .= \" <city>\" . $this->dest_city . \"</city>\\n\";\r\n\t$strXML .= \" <provOrState>\" . $this->dest_province . \"</provOrState>\\n\";\r\n\t$strXML .= \" <country>\" . $this->dest_country . \"</country>\\n\";\r\n\t$strXML .= \" <postalCode>\" . $this->dest_zip . \"</postalCode>\\n\";\r\n\t$strXML .= \" </ratesAndServicesRequest>\\n\";\r\n\t$strXML .= \"</eparcel>\\n\";\r\n\t\r\n\t//print $strXML;\r\n\tif ($resultXML = $this->_sendToHost($this->server,$this->port,'POST','',$strXML)) {\r\n\t\treturn $this->_parserResult($resultXML);\r\n\t} else {\r\n\t return false;\r\n\t}\r\n }", "public static function getTransaction()\n {\n $query = new Query;\n return $query->select([ 'c.*', 'u.username', 'u.email','t.transaction_id', 't.transaction_amount',\n 't.payment_date as tn_payment_date'])\n ->from('contest as c')\n ->LeftJoin('transaction_details as t', 't.contest_id=c.id')\n ->LeftJoin('user as u', 'u.id=c.user_id')\n ->orderBy(['t.payment_date' => SORT_DESC]); \n }", "public function listTransactions($account = null, $count = 10, $from = 0);", "private function getTransactions()\n {\n //====================================================================//\n // Load All Transactions on this Order\n /** @var Transaction $model */\n $model = Mage::getModel('sales/order_payment_transaction');\n\n return $model->getCollection()\n ->setOrderFilter($this->payment->getOrder())\n ->addPaymentIdFilter($this->payment->getId())\n ->setOrder('transaction_id', Varien_Data_Collection::SORT_ORDER_ASC);\n }", "function get_transaction_id()\n {\n return $this->platnosci_post_vars['txn_id']; \n }", "public function actionIndex() {\n $searchModel = new CustomerTransactionsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function transactionGetResults ($reference);", "public function index($id = null) {\n if ($id == null) {\n return ClientTransaction::orderBy('ID', 'asc')->get();\n } else {\n return $this->show($id);\n }\n }", "public function getTransactions()\n {\n return $this->transactions;\n }", "public function getTransactions() {\n\t\treturn $this->transactions;\n\t}", "public function index()\n {\n $transactions = Transaction::with([\n 'payment',\n 'customer',\n 'supplier', \n ])->get()->toArray();\n return $transactions;\n }", "public function index()\n {\n return Transactions::all();\n }", "public function getflatInvoice() {\r\n $result = $this->clients->flatInvoice();\r\n\r\n foreach ($result as $key => $value) {\r\n $clientId = $this->clients->getClientId($value->CustomerCompanyID);\r\n $result[$key]->ClientId = $clientId;\r\n }\r\n\r\n foreach ($result as $key => $value) {\r\n $getTaxdetails = $this->clients->getVatfaltType($value->ClientId);\r\n $PercentRateAfterEndDate = $getTaxdetails->PercentRateAfterEndDate;\r\n $StartDate = $getTaxdetails->StartDate;\r\n $EndDate = $getTaxdetails->EndDate;\r\n $PercentRate = $getTaxdetails->PercentRate;\r\n\r\n $result[$key]->Type = $Type;\r\n $result[$key]->PercentRateAfterEndDate = $PercentRateAfterEndDate;\r\n $result[$key]->StartDate = $StartDate;\r\n $result[$key]->EndDate = $EndDate;\r\n $result[$key]->PercentRate = $PercentRate;\r\n }\r\n foreach ($result as $key => $vat_listing) {\r\n $FlatRate = '';\r\n $NetSales = '';\r\n if (empty($vat_listing->Type) && empty($vat_listing->PercentRateAfterEndDate) && empty($vat_listing->PercentRate)) {\r\n $var = array('FlatRate' => 0, 'NetSales' => $vat_listing->InvoiceTotal);\r\n } else {\r\n if ($vat_listing->InvoiceTotal != 0 && $vat_listing->PaidOn != '') {\r\n if (strtotime($vat_listing->PaidOn) <= strtotime($vat_listing->EndDate)) {\r\n $flateRate = ($vat_listing->InvoiceTotal * $vat_listing->PercentRateAfterEndDate) / 100;\r\n } else {\r\n $flateRate = ($vat_listing->InvoiceTotal * $vat_listing->PercentRate) / 100;\r\n }\r\n $FlatRate = $flateRate;\r\n } else {\r\n $FlatRate = '0.00';\r\n }\r\n if ($vat_listing->InvoiceTotal != 0) {\r\n $NetSales = (($vat_listing->InvoiceTotal - $FlatRate));\r\n } else {\r\n $NetSales = '0.00';\r\n }\r\n $var = array('FlatRate' => trim($FlatRate), 'NetSales' => trim($NetSales));\r\n }\r\n $response = $this->clients->updateFlatandnetsales($vat_listing->InvoiceID, $var);\r\n echo $response . \"<br/>\";\r\n }\r\n }", "public function getCorpoAdminAccountTransactionsbyId($id)\n {\n $account = $this->em->getRepository('CorporateBundle:CorpoAccountTransactions')->getAccountTransactionsById($id);\n return $account;\n }", "public function whmcs_get_invoices($params = array()) {\n\t\t$params['action'] = 'GetInvoices';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "public function aysnc_get_transactions()\n\t{\n\t\t// some code here\n\t\t$this->load->model('accounts_model');\n\t\t$this->load->model('account_bal_model');\n\t\t$this->load->model('transactions_model');\n\t\t$client_no \t= \t$this->session->userdata('client_no');\n\t\t$start_date = \t$this->input->get('start_date');\n\t\t$end_date = \t$this->input->get('end_date');\n\t\t$ccy = \t\t\t$this->input->get('ccy');\n\t\t$acct_no = \t\t$this->input->get('acct_no');\n\t\t$account = \t\t$this->accounts_model->get_account($client_no,$acct_no);\n\t\t\n\t\tif ( count($account) < 1 ){\n\n\t\t\t//account not found\n\t\t\treturn show_error('Account not found',500);\n\t\t}\n\n\t\t$internal_key = $account[0]->INTERNAL_KEY;\n\t\t$data['transactions'] = $this->transactions_model->get_trans_history($start_date,$end_date,$internal_key);\n\n\t\t $start_balance = $this->account_bal_model->get_start_balance($internal_key,$start_date);\n\t\t// return print $this->transactions_model->get_back_date_amt($internal_key,$start_date);\n\t\t// $end_balance = $this->transactions_model\n\t\t// \t\t\t\t\t->get_end_balance($internal_key,$start_date,\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_date,$start_balance);\n\t\t\n\t\t$end_balance = $this->account_bal_model->get_end_balance($internal_key,$end_date);\n\t\tif ( count( $account) < 1){\n\n\t\t\treturn new Exception('Account not found');\n\t\t}\n\n\t\t// return $this->output\n\t\t// \t->set_content_type('application/json')\n\t\t// \t->set_output(json_encode($data));\n\t\t\n\t\t$branch_name = $this->get_branch_name($account[0]->BRANCH);\n\t\t$ccy_desc = $this->get_ccy_desc($account[0]->CCY);\n\n\t\t// statement header params\n\t\t$data = array(\n\n\t\t\t\t\t'INTERNAL_KEY'\t\t\t=> $internal_key,\n\t\t\t\t\t'CONTACT_TYPE'\t\t\t=> NULL,\n\t\t\t\t\t'ACCT_NO'\t\t\t\t=> $acct_no,\n\t\t\t\t\t'ACCT_DESC'\t\t\t\t=> $account[0]->ACCT_DESC,\n\t\t\t\t\t'CCY'\t\t\t\t\t=> $account[0]->CCY,\n\t\t\t\t\t'CCY_DESC'\t\t\t\t=> $ccy_desc,\n\t\t\t\t\t'BRANCH'\t\t\t\t=> $account[0]->BRANCH,\n\t\t\t\t\t'BRANCH_NAME'\t\t\t=> $branch_name,\n\t\t\t\t\t'NAME'\t\t\t\t\t=> $account[0]->CLIENT_SHORT,\n\t\t\t\t\t'ADDR1'\t\t\t\t\t=> NULL,\n\t\t\t\t\t'ADDR2'\t\t\t\t\t=> NULL,\n\t\t\t\t\t'ADDR3'\t\t\t\t\t=> NULL,\n\t\t\t\t\t'ADDR4'\t\t\t\t\t=> NULL,\n\t\t\t\t\t'POSTAL_CODE'\t\t\t=> NULL,\n\t\t\t\t\t'START_BALANCE'\t\t\t=> $start_balance,\n\t\t\t\t\t'END_BALANCE'\t\t\t=> $end_balance,\n\t\t\t\t\t'START_DATE'\t\t\t=> $start_date,\n\t\t\t\t\t'END_DATE'\t\t\t\t=> $end_date,\n\t\t\t\t\t'PRINT_PRIORITY'\t\t=> 'N',\n\t\t\t\t\t'STMT_HANDLING'\t\t\t=> 'CO',\n\t\t\t\t\t'OFFICER_ID'\t\t\t=> $this->session->userdata('usrname'),\n\t\t\t\t\t'SID'\t\t\t\t\t=> NULL\n\t\t\t);\n\t\t$seq_no = $this->insert_to_stmt_header($data);\n\n\t\tif ( isset($seq_no) ){\n\n\t\t\t$params = array(\n\n\t\t\t\t\t\t'seq_no' => $seq_no,'response' => 200, \n\t\t\t\t\t\t'msg' => 'eStatement has been prepared successfully.');\n\t\t}else{\n\n\t\t\t$params = array(\n\t\t\t\t\t\t'response' => 500, 'msg' => 'An error occured.Please try again.');\n\n\t\t}\n\n\t\treturn $this->toJson($params);\n\n\n\n\t}", "public function fetchTransaction(array $parameters = [])\n {\n return $this->createRequest('\\Omnipay\\VnPay\\Message\\FetchTransactionRequest', $parameters);\n }", "public function viewSuccessfulTransactions()\n {\n return $this->getSuccessfulTransactions(self::GATEWAY);\n }", "public function getOmiseTransactionList()\n {\n // Load `omise-php` library.\n $this->load->library('omise/omise-php/lib/Omise');\n\n // Load language.\n $this->language->load('payment/omise');\n\n // Get Omise Keys.\n if ($keys = $this->_getOmiseKeys()) {\n try {\n $omise = OmiseTransaction::retrieve('', $keys['public_key'], $keys['secret_key']);\n\n return $omise;\n } catch (Exception $e) {\n return array('error' => $e->getMessage());\n }\n } else {\n return $this->_error($this->language->get('error_extension_disabled'));\n }\n }", "public static function listTransactions($account, $count=10, $from=0){\n\t\t$COINS = \\Config::get('coins');\n\t\t$dogecoin = new \\Dogecoin($COINS['DOGE']['USER'],$COINS['DOGE']['PASS'],$COINS['DOGE']['IP'],$COINS['DOGE']['PORT'],'http');\n\t\t$data = $dogecoin->listtransactions($account, $count, $from);\n\t return $data;\n\t}", "public function walletTransactionIdList()\n {\n return WalletTransaction::all();\n }", "public function fetchTransaction(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\FetchTransactionRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\FetchTransactionRequest', $parameters);\n }", "public function listTransactionsRequest($limit = 10, $offset = 0, $account_id = null, $item_id = null, $transaction_type = null, $transaction_type_method = null, $direction = null, $user_id = null)\n {\n if ($limit !== null && $limit > 200) {\n throw new \\InvalidArgumentException('invalid value for \"$limit\" when calling TransactionsApi.listTransactions, must be smaller than or equal to 200.');\n }\n if ($limit !== null && $limit < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$limit\" when calling TransactionsApi.listTransactions, must be bigger than or equal to 1.');\n }\n\n if ($offset !== null && $offset < 0) {\n throw new \\InvalidArgumentException('invalid value for \"$offset\" when calling TransactionsApi.listTransactions, must be bigger than or equal to 0.');\n }\n\n\n $resourcePath = '/transactions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($limit !== null) {\n if('form' === 'form' && is_array($limit)) {\n foreach($limit as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['limit'] = $limit;\n }\n }\n // query params\n if ($offset !== null) {\n if('form' === 'form' && is_array($offset)) {\n foreach($offset as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['offset'] = $offset;\n }\n }\n // query params\n if ($account_id !== null) {\n if('form' === 'form' && is_array($account_id)) {\n foreach($account_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['account_id'] = $account_id;\n }\n }\n // query params\n if ($item_id !== null) {\n if('form' === 'form' && is_array($item_id)) {\n foreach($item_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['item_id'] = $item_id;\n }\n }\n // query params\n if ($transaction_type !== null) {\n if('form' === 'form' && is_array($transaction_type)) {\n foreach($transaction_type as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['transaction_type'] = $transaction_type;\n }\n }\n // query params\n if ($transaction_type_method !== null) {\n if('form' === 'form' && is_array($transaction_type_method)) {\n foreach($transaction_type_method as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['transaction_type_method'] = $transaction_type_method;\n }\n }\n // query params\n if ($direction !== null) {\n if('form' === 'form' && is_array($direction)) {\n foreach($direction as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['direction'] = $direction;\n }\n }\n // query params\n if ($user_id !== null) {\n if('form' === 'form' && is_array($user_id)) {\n foreach($user_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['user_id'] = $user_id;\n }\n }\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function exeGetTransactions() {\n $exeGetTransactions = $this->db->query(\"SELECT *\n FROM transactions \");\n \n if($exeGetTransactions->num_rows() > 0) {\n return $exeGetTransactions->result_array();\n } else {\n return false;\n } \n }", "public function transactionsIndexAction()\n {\n try {\n $accountName = $_POST['account'];\n\n $userID = $_SESSION['id'];\n $bank = new BankAccountModel(null, $userID);\n $id = $bank->findID($accountName);\n unset($bank);\n $collection = new TransactionCollectionModel($id);\n $transactions = $collection->getTransactions();\n $view = new View('transactionPage');\n echo $view->addData('transactions', $transactions)->render();\n } catch (\\Exception $e) {\n $view = new View('transactionPage');\n echo $view->render();\n }\n }", "public function whmcs_get_invoice($params = array()) {\n\t\t$params['action'] = 'GetInvoice';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "public function getTransactions(){\r\n $stmt = $this->DB->prepare(\"SELECT * FROM transactions t JOIN products p ON p.Product_ID = t.Product_ID;\");\r\n $stmt->execute();\r\n $purchases = $stmt->fetchAll (PDO::FETCH_ASSOC);\r\n\r\n $stmt = $this->DB->prepare(\"SELECT * FROM transactions WHERE Transaction_Type='DONATION';\");\r\n $stmt->execute();\r\n $donations = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n return array_merge($purchases,$donations);\r\n }", "public function transactions()\n {\n UserModel::authentication();\n\n //get the session user\n $user = UserModel::user();\n\n //get the users transaction\n $transactions = OrdersModel::transactions();\n\n $this->View->Render('dashboard/transactions', ['transactions' => $transactions]);\n }", "function execute()\n{\n\t\n\n\n\n\n\t$arr = array_merge($this->amount,$this->customer,$this->creditCard,$this->options);\n\t\n\t$collection = Braintree_Transaction::search(array(\n Braintree_TransactionSearch::customerId()->is($arr['customer']['id']),\n));\nif($collection->maximumCount() > 0)\n{\n\n$result = Braintree_Transaction::sale(\n array(\n 'customerId' => $arr['customer']['id'],\n 'amount' => $arr['amount']\n )\n);\nif ($result->success) {\necho json_encode(array('type'=>'success','response'=>'payment amount: '.$arr['amount'].' Your transaction id : '.$result->transaction->id));\n\tdo_action('payment_made',array('message'=>'payment amount: '.$arr['amount'].' transaction id : '.$result->transaction->id));\n\n}elseif ($result->transaction) \n{\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n} else {\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n\t\n}\n}else{\n\n$result = Braintree_Transaction::sale($arr);\n\nif ($result->success) {\n\tdo_action('payment_made',array('message'=>'payment amount: '.$arr['amount'].' transaction id : '.$result->transaction->id));\n\t\necho json_encode(array('type'=>'success','response'=>'Payment Amount : '.$arr['amount'].'Your transaction id : '.$result->transaction->id));\n}elseif ($result->transaction) \n{\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n} else {\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n\t\n}\n\n\n\n\t\n}\n\t\n}", "public function execute()\n {\n if (!empty($_GET[\"responseid\"]) && !empty($_GET[\"requestid\"])) {\n $order_id = base64_decode($_GET[\"requestid\"]);\n $response_id = base64_decode($_GET[\"responseid\"]);\n\n $mode = $this->_paymentMethod->getMerchantConfig('modes');\n\n if ($mode == 'Test') {\n $mid = $this->_paymentMethod->getMerchantConfig('test_mid');\n $mkey = $this->_paymentMethod->getMerchantConfig('test_mkey');\n $client = new SoapClient(\"https://testpti.payserv.net/Paygate/ccservice.asmx?WSDL\");\n } elseif ($mode == 'Live') {\n $mid = $this->_paymentMethod->getMerchantConfig('live_mid');\n $mkey = $this->_paymentMethod->getMerchantConfig('live_mkey');\n $client = new SoapClient(\"https://ptipaygate.paynamics.net/ccservice/ccservice.asmx?WSDL\");\n }\n\n $request_id = '';\n $length = 8;\n $characters = '0123456789';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $request_id .= $characters[rand(0, $charactersLength - 1)];\n }\n\n $merchantid = $mid;\n $requestid = $request_id;\n $org_trxid = $response_id;\n $org_trxid2 = \"\";\n $cert = $mkey;\n $data = $merchantid . $requestid . $org_trxid . $org_trxid2;\n $data = utf8_encode($data . $cert);\n\n // create signature\n $sign = hash(\"sha512\", $data);\n\n $params = array(\"merchantid\" => $merchantid,\n \"request_id\" => $requestid,\n \"org_trxid\" => $org_trxid,\n \"org_trxid2\" => $org_trxid2,\n \"signature\" => $sign);\n\n $result = $client->query($params);\n $response_code = $result->queryResult->txns->ServiceResponse->responseStatus->response_code;\n $response_message = $result->queryResult->txns->ServiceResponse->responseStatus->response_message;\n\n switch ($response_code) {\n case 'GR001':\n case 'GR002':\n case 'GR033':\n $this->getResponse()->setRedirect(\n $this->_getUrl('checkout/onepage/success')\n );\n break;\n default:\n $this->messageManager->addErrorMessage(\n __($response_message)\n );\n /** @var \\Magento\\Framework\\Controller\\Result\\Redirect $resultRedirect */\n $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);\n return $resultRedirect->setPath('checkout/cart');\n break;\n }\n\n// $this->getResponse()->setRedirect(\n// $this->_getUrl('checkout/onepage/success')\n// );\n }\n }", "public function show(transactions $transactions)\n {\n //\n }", "function head() {\n global $_lib;\n\n $query = \"select max(RemittanceDaySequence) from invoicein where RemittanceSendtDateTime='\" . $_lib['sess']->get_session('Date') . \"' and Active=1\";\n #print \"Finn h¿yeste dag sekvens: $query\";\n $daysequence = $_lib['storage']->get_row(array('query' => $query));\n\n $query = \"select max(RemittanceSequence) from invoicein where Active=1\";\n #print \"Finn h¿yeste sekvens: $query\";\n $sequence = $_lib['storage']->get_row(array('query' => $query));\n \n #print \"<h2>Her kommer remitteringsfila p&aring; TelePay 2.0.1 formatet</h2>\";\n $transaction = new stdClass();\n $this->transaction->RemittanceSequence = $daysequence->RemittanceSequence + 1; #MŒ kalkuleres og settes\n $this->transaction->RemittanceDaySequence = $daysequence->RemittanceDaySequence; #MŒ kalkuleres og settes\n\n #$this->transaction->BatchID = 99; #MŒ kalkuleres og settes\n $this->transaction->Date = $_lib['sess']->get_session('Date');\n $this->transaction->Datetime = $_lib['sess']->get_session('Datetime');\n $this->transaction->VersionSoftware = '00001.00 LODO';\n \n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $this->transaction->CustomerOrgNumber = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber'))); \n $this->transaction->CustomerName = $_lib['sess']->get_companydef('CompanyName');\n $this->transaction->Database = $_SETUP['DB_NAME']['0'];\n \n $this->transaction->NumTransactions = 0;\n $this->transaction->TotalAmount = 0;\n $this->transaction->NumRecords = 0; \n\n if(!$InvoiceO->CustomerBankAccount) { #Sjekke lengde og modulus pŒ kontonummer ogsŒ\n $_lib['message']->Add(\"Betalerkonto mangler\");\n return;\n }\n if(!$this->transaction->CustomerOrgNumber) {\n $_lib['message']->Add(\"Orgnummer/personnummer mangler p&aring; betaler\");\n return;\n }\n }", "public function access_content($msisdn,$invoiceNo,$aggreedPayDate){\n $curl = curl_init();\n $url='http://10.12.36.130:8080/services/DcPaServices';\n curl_setopt_array($curl, array(\n CURLOPT_URL => $url,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => '',\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_HTTPHEADER => array(\n 'SOAPAction: Adjustment',\n 'Content-Type: text/xml;charset=UTF-8'),\n CURLOPT_CUSTOMREQUEST => 'POST',\n CURLOPT_POSTFIELDS =>'<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n xmlns:bmp=\"http://cbs.huawei.com/dc/wsservice/bmpinterface\"\n xmlns:cbs=\"http://www.huawei.com/bme/cbsinterface/cbscommon\">\n<soapenv:Header/>\n <soapenv:Body>\n <bmp:CreatePARequestMsg>\n <RequestHeader>\n <cbs:Version>1</cbs:Version>\n <!--Optional:-->\n <cbs:BusinessCode>CreatePA</cbs:BusinessCode>\n <cbs:MessageSeq>'.time().'</cbs:MessageSeq>\n <!--Optional:-->\n <cbs:OwnershipInfo>\n <cbs:BEID>101</cbs:BEID>\n <!--Optional:-->\n </cbs:OwnershipInfo>\n <cbs:AccessSecurity>\n <cbs:LoginSystemCode>hissam</cbs:LoginSystemCode>\n <cbs:Password>Q9nmbqOehHWjysXzmQiabeI0Saa2V3WHEsw+xF7PnxM=</cbs:Password>\n </cbs:AccessSecurity>\n </RequestHeader>\n <CreatePARequest>\n <bmp:AcctAccessCode>\n <!--You have a CHOICE of the next 3 items at this level-->\n <bmp:PrimaryIdentity>'.$msisdn.'</bmp:PrimaryIdentity>\n </bmp:AcctAccessCode>\n <!--Optional:-->\n <bmp:PAExternalID>?</bmp:PAExternalID>\n <bmp:PAType>1</bmp:PAType>\n <bmp:PARequestDate>'.date(\"Ymd\").'000000</bmp:PARequestDate>\n <!--1 or more repetitions:-->\n <bmp:PADetailInfo>\n <bmp:AgreedPaidDate>'.$aggreedPayDate.'000000</bmp:AgreedPaidDate>\n <!--Optional:-->\n <bmp:CurrencyId>1153</bmp:CurrencyId>\n </bmp:PADetailInfo>\n <!--Zero or more repetitions:-->\n <bmp:PAInvoiceInfo>\n <bmp:InvoiceNo>'.$invoiceNo.'</bmp:InvoiceNo>\n </bmp:PAInvoiceInfo>\n <bmp:PAReminderFlag>N</bmp:PAReminderFlag>\n </CreatePARequest>\n </bmp:CreatePARequestMsg>\n </soapenv:Body>\n </soapenv:Envelope>',));\n //Convert XML to JSON\n $response = curl_exec($curl);\n \n return $response;\n //return $response;\n }", "function ExecutePayment ($ccardno,$exp_m,$exp_y,$cvv2,$total) {\n\n if (strlen($exp_y)!=2) $exp_y=substr($exp_y,-2);\n if (strlen($exp_m)!=2) $exp_m=str_repeat(\"0\",(2-strlen($exp_m))).$exp_m;\n\n $data=\"DATA=<?xml version=\\\"1.0\\\" encoding=\\\"ISO-8859-9\\\"?>\n<CC5Request>\n<Name>\".VP_FORTIS_NAME.\"</Name>\n<Password>\".VP_FORTIS_PASSWORD.\"</Password>\n<ClientId>\".VP_FORTIS_CLIENTID.\"</ClientId>\n<IPAddress>\".$_SERVER['REMOTE_ADDR'].\"</IPAddress>\n<Email></Email>\n<Mode>\".VP_FORTIS_MODE.\"</Mode>\n<OrderId></OrderId>\n<GroupId></GroupId>\n<TransId></TransId>\n<UserId></UserId>\n<Type>\".VP_FORTIS_TYPE.\"</Type>\n<Number>$ccardno</Number>\n<Expires>$exp_m/$exp_y</Expires>\n<Cvv2Val>$cvv2</Cvv2Val>\n<Total>$total</Total>\n<Currency>\".VP_FORTIS_CURRENCY.\"</Currency>\n<Taksit></Taksit>\n<BillTo>\n<Name></Name>\n<Street1></Street1>\n<Street2></Street2>\n<Street3></Street3>\n<City></City>\n<StateProv></StateProv>\n<PostalCode></PostalCode>\n<Country></Country>\n<Company></Company>\n<TelVoice></TelVoice>\n</BillTo>\n<ShipTo>\n<Name></Name>\n<Street1></Street1>\n<Street2></Street2>\n<Street3></Street3>\n<City></City>\n<StateProv></StateProv>\n<PostalCode></PostalCode>\n<Country></Country>\n</ShipTo>\n<Extra></Extra>\n</CC5Request>\";\n\n\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_URL, VP_FORTIS_URL);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 90);\n $result = curl_exec($ch);\n curl_close($ch);\n\n\n $response_tag=\"Response\";\n $posf = strpos ( $result, (\"<\" . $response_tag . \">\") );\n $posl = strpos ( $result, (\"</\" . $response_tag . \">\") ) ;\n $posf = $posf+ strlen($response_tag) +2 ;\n $Response = substr ( $result, $posf, $posl - $posf) ;\n\n $response_tag=\"OrderId\";\n $posf = strpos ( $result, (\"<\" . $response_tag . \">\") );\n $posl = strpos ( $result, (\"</\" . $response_tag . \">\") ) ;\n $posf = $posf+ strlen($response_tag) +2 ;\n $OrderId = substr ( $result, $posf , $posl - $posf ) ;\n\n $response_tag=\"AuthCode\";\n $posf = strpos ( $result, \"<\" . $response_tag . \">\" );\n $posl = strpos ( $result, \"</\" . $response_tag . \">\" ) ;\n $posf = $posf+ strlen($response_tag) +2 ;\n $AuthCode = substr ( $result, $posf , $posl - $posf ) ;\n\n $response_tag=\"TransId\";\n $posf = strpos ( $result, \"<\" . $response_tag . \">\" );\n $posl = strpos ( $result, \"</\" . $response_tag . \">\" ) ;\n $posf = $posf+ strlen($response_tag) +2 ;\n $TransId = substr ( $result, $posf , $posl - $posf ) ;\n\n if ($Response==\"Approved\") {\n return array(\"response\"=>true,\"order_id\"=>$OrderId,\"auth_id\"=>$AuthCode,\"trans_id\"=>$TransId);\n }\n else {\n return array(\"response\"=>false);\n }\n}", "public function query_out_transactions(){\n\t\t$response = $this->execute($this->query_out_transaction_url);\n\t\tif(!$response){\n\t\t\tthrow new Exception(\"error in communication\");\n\t\t}\n\t\treturn json_decode($response,true);\n\t}", "function insert_transaction($subscriptionid = 0, $projectid = 0, $buynowid = 0, $user_id = 0, $p2b_user_id = 0, $storeid = 0, $orderid = 0, $description = '', $amount, $paid, $status, $invoicetype, $paymethod, $createdate, $duedate, $paiddate, $custommessage, $archive, $ispurchaseorder = 0, $returnid = 0, $transactionidx = '', $isdeposit = 0, $iswithdraw = 0, $dontprocesstax = 0)\n {\n global $ilance, $ilconfig;\n $subscriptionid = isset($subscriptionid) ? intval($subscriptionid) : '0';\n $projectid = isset($projectid) ? intval($projectid) : '0';\n $buynowid = isset($buynowid) ? intval($buynowid) : '0';\n $user_id = isset($user_id) ? intval($user_id) : '0';\n $p2b_user_id = isset($p2b_user_id) ? intval($p2b_user_id) : '0';\n $storeid = isset($storeid) ? intval($storeid) : '0';\n $orderid = isset($orderid) ? intval($orderid) : '0';\n $description = isset($description) ? $description : 'No transaction description provided';\n $amount = isset($amount) ? $amount : '0.00';\n $paid = isset($paid) ? $paid : '0.00';\n $status = isset($status) ? $status : 'unpaid';\n $invoicetype = isset($invoicetype) ? $invoicetype : 'debit';\n $paymethod = isset($paymethod) ? $paymethod : 'account';\n $ipaddress = IPADDRESS;\n $referer = REFERRER;\n $createdate = DATETIME24H;\n $duedate = isset($duedate) ? $duedate : DATETIME24H;\n $paiddate = isset($paiddate) ? $paiddate : '';\n $custommessage = isset($custommessage) ? $custommessage : 'No memo or administrative comments';\n $archive = isset($archive) ? intval($archive) : '0';\n $ispurchaseorder = isset($ispurchaseorder) ? $ispurchaseorder : '0';\n // withdraw and deposit related transactions\n $iswithdraw \t = isset($iswithdraw) \t ? intval($iswithdraw) : '0';\n $isdeposit \t = isset($isdeposit) \t ? intval($isdeposit) : '0';\n $totalamount = '0.00';\n $transactionid = (isset($transactionidx) AND !empty($transactionidx)) ? $transactionidx : $ilance->accounting_payment->construct_transaction_id();\n $currencyid = $this->currencyid == '0' ? $ilconfig['globalserverlocale_defaultcurrency'] : $this->currencyid;\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"invoices\n (invoiceid, currency_id, subscriptionid, projectid, buynowid, user_id, p2b_user_id, storeid, orderid, description, amount, paid, totalamount, status, paymethod, ipaddress, referer, createdate, duedate, paiddate, custommessage, transactionid, archive, ispurchaseorder, isdeposit, iswithdraw)\n VALUES(\n NULL,\n '\" . intval($currencyid) . \"',\n '\" . intval($subscriptionid) . \"',\n '\" . intval($projectid) . \"',\n '\" . intval($buynowid) . \"',\n '\" . intval($user_id) . \"',\n '\" . intval($p2b_user_id) . \"',\n '\" . intval($storeid) . \"',\n '\" . intval($orderid) . \"',\n '\" . $ilance->db->escape_string($description) . \"',\n '\" . $ilance->db->escape_string($amount) . \"',\n '\" . $ilance->db->escape_string($paid) . \"',\n '\" . $ilance->db->escape_string($totalamount) . \"',\n '\" . $ilance->db->escape_string($status) . \"',\n '\" . $ilance->db->escape_string($paymethod) . \"',\n '\" . $ilance->db->escape_string($ipaddress) . \"',\n '\" . $ilance->db->escape_string($referer) . \"',\n '\" . $ilance->db->escape_string($createdate) . \"',\n '\" . $ilance->db->escape_string($duedate) . \"',\n '\" . $ilance->db->escape_string($paiddate) . \"',\n '\" . $ilance->db->escape_string($custommessage) . \"',\n '\" . $ilance->db->escape_string($transactionid) . \"',\n '\" . $ilance->db->escape_string($archive) . \"',\n '\" . intval($ispurchaseorder) . \"',\n '\" . intval($isdeposit) . \"',\n '\" . intval($iswithdraw) . \"')\n \", 0, null, __FILE__, __LINE__); \n // fetch new last invoice id\n $invoiceid = $ilance->db->insert_id();\n \n // do we skip the taxation support for this transaction?\n // we do this in some situations where the tax needs to be applied before the txn is created\n // for situations like escrow fees that we must already know how much to charge the customer for taxes\n // if we don't do this then the txn may have double taxes added to the overall amount\n // and situations like this usually mean that an unpaid transaction is being created (and tax) is\n // auto-applied\n \n // taxation support: is user taxable for this invoice type?\n // this code block will run if a transaction being created is unpaid waiting for payment from the customer\n if ($ilance->tax->is_taxable($user_id, $invoicetype) AND isset($dontprocesstax) AND $dontprocesstax == 0)\n {\n // fetch tax amount to charge for this invoice type\n $taxamount = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 0);\n // fetch total amount to hold within the \"totalamount\" field\n $totalamount = ($amount + $taxamount);\n // fetch tax bit to display when outputing tax infos\n $taxinfo = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 1);\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\" . $totalamount . \"',\";\n }\n // member is taxable for this invoice type\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET istaxable = '1',\n $extra\n totalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\n taxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\n taxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else\n {\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\".$totalamount.\"',\";\n }\n // customer not taxable > update totalamount value\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET totalamount = '\" . sprintf(\"%01.2f\", $amount) . \"',\n $extra\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n } \n if (isset($returnid) AND $returnid > 0)\n {\n return intval($invoiceid);\n }\n }", "public function generateDirectDebitTransactions($transactions)\n {\n foreach ($transactions as $transaction) {\n try {\n //add Payment Info transactions\n if ($transaction instanceof \\SEPA\\DirectDebitTransaction) {\n $this->paymentInfoObject->addDirectDebitTransaction($transaction);\n } else {\n $transaction = $this->objectToArray($transaction);\n\n $this->paymentInfoObject->addDirectDebitTransaction(\n SEPAXmlGeneratorFactory::createXMLDirectDebitTransaction()\n ->setInstructionIdentification($transaction['id'])\n ->setEndToEndIdentification($transaction['endId'])\n ->setInstructedAmount($transaction['amount'])\n ->setDebtorName($transaction['company_name'])\n ->setDebitIBAN($transaction['iban'])\n ->setDebitBIC($transaction['bic'])\n ->setMandateIdentification($transaction['umr'])\n ->setDateOfSignature($transaction['mandate_sign_date'])\n //->setCurrency('EUR')\n ->setDirectDebitInvoice($transaction['invoice'])\n );\n }\n } catch (Exception $e) {\n //Your logs here\n //$e->getMessage();\n }\n }\n }", "public function getTransactionInfos() {\n return $this->transactionInfos;\n }" ]
[ "0.63802934", "0.63281214", "0.6162321", "0.6152873", "0.61202097", "0.6118184", "0.6093457", "0.5899168", "0.5872867", "0.5712852", "0.56989634", "0.56658953", "0.55668145", "0.556485", "0.5549938", "0.5540952", "0.55267894", "0.55040014", "0.54951215", "0.5487675", "0.5485115", "0.5480576", "0.54304415", "0.54199535", "0.5403662", "0.5395036", "0.53923965", "0.53889126", "0.53877145", "0.53705627", "0.5367154", "0.5364183", "0.5360891", "0.53240156", "0.5311273", "0.5303412", "0.5301851", "0.5289874", "0.5289348", "0.5286574", "0.5279615", "0.5273541", "0.52714044", "0.52697545", "0.5266344", "0.5262982", "0.5238186", "0.5220169", "0.52164817", "0.52100766", "0.520605", "0.52034205", "0.51888156", "0.5182995", "0.5182995", "0.5182995", "0.51764256", "0.5169868", "0.5159214", "0.5157782", "0.5148717", "0.51452416", "0.51416826", "0.5136007", "0.5131225", "0.51262313", "0.5124692", "0.51228", "0.512174", "0.5115874", "0.50884944", "0.50822943", "0.5073254", "0.50706583", "0.5066837", "0.5052406", "0.50499225", "0.5046738", "0.5039191", "0.5038336", "0.5035682", "0.5029081", "0.50064427", "0.5005666", "0.5001818", "0.5000479", "0.4997778", "0.49902478", "0.4989965", "0.49850336", "0.49846303", "0.49810666", "0.49743706", "0.49702814", "0.4968705", "0.4963392", "0.49623907", "0.49622592", "0.49614882", "0.4940038" ]
0.66501606
0
This command is used to update a transaction. Parameters: transactionid The Transaction ID to update. tblaccounts.id (This is not the transid from the gateway) Optional Parameters: userid Add Transaction to a user currency Currency ID for a transaction gateway Gateway to assign transaction to date date of transaction YYYYMMDD description Description of the transaction amountin amount to add to the account fees transaction fee you were charged amountout if an outgoing enter this rate exchange rate based on master currency. Set to 1 if on default currency transid Transaction ID you wish to assign invoiceid Add transaction to a particular invoice refundid Add a refund ID if this is a refund transaction See:
public function whmcs_update_transaction($params = array()) { $params['action'] = 'UpdateTransaction'; // return Whmcs_base::send_request($params); $load = new Whmcs_base(); return $load->send_request($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update($user = 0, $notrigger = 0) {\n global $conf, $langs;\n $error = 0;\n\n // Clean parameters\n if (isset($this->number))\n $this->number = trim($this->number);\n if (isset($this->label))\n $this->label = trim($this->label);\n if (isset($this->fk_author))\n $this->fk_author = trim($this->fk_author);\n if (isset($this->fk_source))\n $this->fk_source = trim($this->fk_source);\n if (isset($this->sourcetype))\n $this->sourcetype = trim($this->sourcetype);\n if (isset($this->url))\n $this->url = trim($this->url);\n if (isset($this->fk_fiscal_year))\n $this->fk_fiscal_year = trim($this->fk_fiscal_year);\n\n\n // Check parameters\n // Put here code to add control on parameters values\n // Update request\n $sql = \"UPDATE \" . MAIN_DB_PREFIX . \"iconta_accountingtransaction SET\";\n\n $sql.= \" label=\" . (isset($this->label) ? \"'\" . $this->db->escape($this->label) . \"'\" : \"null\") . \",\";\n $sql.= \" datec=\" . (dol_strlen($this->datec) != 0 ? \"'\" . $this->db->idate($this->datec) . \"'\" : 'null') . \",\";\n $sql.= \" fk_author=\" . (isset($this->fk_author) ? \"'\" . $this->db->escape($this->fk_author) . \"'\" : \"null\") . \",\";\n $sql.= \" tms=\" . (dol_strlen($this->tms) != 0 ? \"'\" . $this->db->idate($this->tms) . \"'\" : 'null') . \",\";\n $sql.= \" fk_source=\" . (isset($this->fk_source) ? $this->fk_source : \"null\") . \",\";\n $sql.= \" sourcetype=\" . (isset($this->sourcetype) ? \"'\" . $this->db->escape($this->sourcetype) . \"'\" : \"null\") . \",\";\n $sql.= \" url=\" . (isset($this->url) ? \"'\" . $this->db->escape($this->url) . \"'\" : \"null\") . \",\";\n $sql.= \" fk_fiscal_year=\" . (isset($this->fk_fiscal_year) ? \"'\" . $this->db->escape($this->fk_fiscal_year) . \"'\" : \"null\") . \"\";\n\n\n $sql.= \" WHERE rowid=\" . $this->id;\n\n $this->db->begin();\n\n dol_syslog(get_class($this) . \"::update sql=\" . $sql, LOG_DEBUG);\n $resql = $this->db->query($sql);\n if (!$resql) {\n $error++;\n $this->errors[] = \"Error \" . $this->db->lasterror();\n }\n\n if (!$error) {\n if (!$notrigger) {\n // Uncomment this and change MYOBJECT to your own tag if you\n // want this action call a trigger.\n //// Call triggers\n //include_once(DOL_DOCUMENT_ROOT . \"/core/class/interfaces.class.php\");\n //$interface=new Interfaces($this->db);\n //$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);\n //if ($result < 0) { $error++; $this->errors=$interface->errors; }\n //// End call triggers\n }\n }\n\n // Commit or rollback\n if ($error) {\n foreach ($this->errors as $errmsg) {\n dol_syslog(get_class($this) . \"::update \" . $errmsg, LOG_ERR);\n $this->error.=($this->error ? ', ' . $errmsg : $errmsg);\n }\n $this->db->rollback();\n return -1 * $error;\n } else {\n $this->db->commit();\n return 1;\n }\n }", "public function update_tranasction_record()\n\t{\n\t\t$data = array(\n\t\t 'amount'\t\t\t\t=> $this->user_bid_amt,\t\n\t\t 'pay_type' => $this->payment_type,\t\t \t\t\t \n\t\t 'transaction_date'\t=> $this->general->get_local_time('time'),\t\t \n\t \t);\n\t\t\n\t\t$this->db->where('user_id', $this->user_id);\n\t\t$this->db->where('product_id', $this->auction_id);\n\t\t$this->db->where('transaction_type', 'bid');\n\t\t$this->db->where('transaction_status', 'Completed');\n\t\t$this->db->where('payment_method', 'direct');\n\t\t$this->db->update('transaction', $data);\n\t}", "public function updateTransactionRequest($budget_id, $transaction_id, $data)\n {\n // verify the required parameter 'budget_id' is set\n if ($budget_id === null || (is_array($budget_id) && count($budget_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $budget_id when calling updateTransaction'\n );\n }\n // verify the required parameter 'transaction_id' is set\n if ($transaction_id === null || (is_array($transaction_id) && count($transaction_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transaction_id when calling updateTransaction'\n );\n }\n // verify the required parameter 'data' is set\n if ($data === null || (is_array($data) && count($data) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $data when calling updateTransaction'\n );\n }\n\n $resourcePath = '/budgets/{budget_id}/transactions/{transaction_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($budget_id !== null) {\n $resourcePath = str_replace(\n '{' . 'budget_id' . '}',\n ObjectSerializer::toPathValue($budget_id),\n $resourcePath\n );\n }\n // path params\n if ($transaction_id !== null) {\n $resourcePath = str_replace(\n '{' . 'transaction_id' . '}',\n ObjectSerializer::toPathValue($transaction_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($data)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($data));\n } else {\n $httpBody = $data;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function updateTransaction($id, $transaction) {\n\t\t$old = $this->dbConnection->fetchAssoc(\n\t\t\t'SELECT * FROM transaction WHERE id=?',\n\t\t\t[$id]\n\t\t);\n\t\t\n\t\tif(!is_null($old)){\n\t\t\t$this->dbConnection->beginTransaction();\n\t\t\ttry{\n\t\t\t\t$this->dbConnection->executeQuery(\n\t\t\t\t\t'UPDATE transaction SET amount = IFNULL(?, amount), \n\t\t\t\t\tcategory = IFNULL(?, category), date = IFNULL(?, date) WHERE id=?',\n\t\t\t\t\t[$transaction->amount, $transaction->category, $transaction->date, $id]\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$delta = $transaction->amount - $old['amount'];\n\t\t\t\t\n\t\t\t\t$this->dbConnection->executeQuery(\n\t\t\t\t\t'UPDATE account SET balance = balance-? WHERE id = ?',\n\t\t\t\t\t[$delta, $old['account']]\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$this->dbConnection->commit();\n\t\t\t}\n\t\t\tcatch(Exception $e) {\n\t\t\t\t$this->dbConnection->rollBack();\n\t\t\t}\n\t\t\t\n\t\t\t$updated = $this->dbConnection->fetchAssoc(\n\t\t\t\t'SELECT * FROM transaction WHERE id=?',\n\t\t\t\t[$id]\n\t\t\t);\n\t\t\t\n\t\t\treturn !is_null($updated['id']) ? new Transaction($updated['id'], $updated['account'], $updated['category'],\n\t\t\t\t$updated['amount'], $updated['date']) : null;\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "function _updateTransaction($ItemUser)\r\n {\r\n //add amount to wallet\r\n $data['Transaction']['user_id'] = $ItemUser['user_id'];\r\n $data['Transaction']['foreign_id'] = ConstUserIds::Admin;\r\n $data['Transaction']['class'] = 'SecondUser';\r\n $data['Transaction']['amount'] = $ItemUser['discount_amount'];\r\n $data['Transaction']['transaction_type_id'] = ConstTransactionTypes::AddedToWallet;\r\n $data['Transaction']['payment_gateway_id'] = $ItemUser['payment_gateway_id'];\r\n $transaction_id = $this->User->Transaction->log($data);\r\n if (!empty($transaction_id)) {\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount +' . $ItemUser['discount_amount']\r\n ) , array(\r\n 'User.id' => $ItemUser['user_id']\r\n ));\r\n }\r\n //Buy item transaction\r\n $transaction['Transaction']['user_id'] = $ItemUser['user_id'];\r\n $transaction['Transaction']['foreign_id'] = $ItemUser['id'];\r\n $transaction['Transaction']['class'] = 'ItemUser';\r\n $transaction['Transaction']['amount'] = $ItemUser['discount_amount'];\r\n $transaction['Transaction']['transaction_type_id'] = (!empty($ItemUser['is_gift'])) ? ConstTransactionTypes::ItemGift : ConstTransactionTypes::BuyItem;\r\n $transaction['Transaction']['payment_gateway_id'] = $ItemUser['payment_gateway_id'];\r\n if (!empty($ItemUser['rate'])) {\r\n $transaction['Transaction']['currency_id'] = $ItemUser['currency_id'];\r\n $transaction['Transaction']['converted_currency_id'] = $ItemUser['converted_currency_id'];\r\n $transaction['Transaction']['converted_amount'] = $ItemUser['authorize_amt'];\r\n $transaction['Transaction']['rate'] = $ItemUser['rate'];\r\n }\r\n $this->User->Transaction->log($transaction);\r\n //user update\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount -' . $ItemUser['discount_amount']\r\n ) , array(\r\n 'User.id' => $ItemUser['user_id']\r\n ));\r\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['Transaction']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Transaction'];\n\t\t\t//if account owned by this user save the model else throw exception\n\t\t\tif($this->userOwnsAccount($model->acc_id))\n\t\t\t{\n\t\t\t\tif($model->save()) $this->redirect(array('view','id'=>$model->id));\n\t\t\t}\n\t\t\telse throw new CHttpException(403,'You are not authorized to update a Transaction on this account.');\n\t\t}\n\t\t\n\t\t//if account owned by this user save the model else throw exception\n\t\tif($this->userOwnsAccount($model->acc_id))\n\t\t{\n\t\t\t$this->render('update',array(\n\t\t\t\t\t'model'=>$model,\n\t\t\t\t));\n\t\t}\n\t\telse throw new CHttpException(403,'You are not authorized to update a Transaction on this account.');\t\n\t}", "public function delReviewTransactionUpdate($transid){\n $query2=\n \"UPDATE transaction t\n SET status=0\n WHERE transaction_id=:id And status=1 ;\n \";\n $this->db->query($query2);\n $this->db->bind('id', $transid);\n $this->db->execute();\n }", "public function update_transaction($values){\n $this->load->database();\n\n return $query = $this->db->where(array('id' => $values['id']))\n ->update('tbl_transactions',$values);\n }", "public function updateTransaction($data)\n\t{\n\t\ttry {\n\t\t\t$fields = implode(', ', array_map(\n\t\t\t\t\tfunction ($value, $key) {\n\t\t\t\t\t\treturn sprintf(\"`%s` = '%s'\", $key, $value);\n\t\t\t\t\t},\n\t\t\t\t\t$data,\n\t\t\t\t\tarray_keys($data)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->db->query(\"\n\t\t\t\tUPDATE\n\t\t\t\t\t`\" . DB_PREFIX . \"emerchantpay_checkout_transactions`\n\t\t\t\tSET\n\t\t\t\t\t\" . $fields . \"\n\t\t\t\tWHERE\n\t\t\t\t `unique_id` = '\" . $data['unique_id'] . \"'\n\t\t\t\");\n\t\t} catch (Exception $exception) {\n\t\t\t$this->logEx($exception);\n\t\t}\n\t}", "public function update_referral_balance_and_bonus_records_transaction($referrer_id, $new_user_id)\r\n\t{\r\n\t\t$current_date = $this->general->get_local_time('time');\r\n\t\t\r\n\t\t//update referrers bonus\r\n\t\t$this->db->set('balance', 'balance+'.REFER_BONUS, FALSE);\r\n\t\t$this->db->where('id', $referrer_id);\r\n\t\t$this->db->update('members');\r\n\t\t\r\n\t\t//add transaction to transaction table\r\n\t\t$txn_data = array(\r\n\t\t 'user_id' => $referrer_id,\t\t \t\t\r\n\t\t 'credit_get' => REFER_BONUS,\r\n\t\t 'credit_debit' => 'CREDIT',\r\n\t\t 'transaction_name' => lang('referral_bonus').' :'.$new_user_id,\r\n\t\t 'transaction_date' => $current_date,\r\n\t\t 'transaction_type' => 'referer_bonus',\r\n\t\t 'transaction_status' => 'Completed',\r\n\t\t 'payment_method' => 'direct',\r\n\t\t 'current_balance' => 'current_balance +'.$user_total_balance\r\n\t\t\t);\r\n\t\r\n\t\t$this->db->insert('transaction', $txn_data);\r\n\t\treturn $this->db->insert_id(); \t\r\n\t}", "public function edit(balacetransaction $balacetransaction)\n {\n //\n }", "public function update($id)\n\t{\n\t\t$transaction = Transaction::find($id);\n\n\t\t$validator = Validator::make($data = Input::all(), Transaction::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\t$alert[] = [ 'class' => 'alert-danger', 'message' => '<strong><i class=\"fa fa-warning\"></i></strong> Erro!' ];\n\t\t\tSession::flash('alerts', $alert);\t\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\t// DONE\n\t\tif( isset( $data['done'] ) and !empty( $data['done'] ) ) {\n\t\t\t$data['done'] = 1;\n\t\t}else{\n\t\t\t$data['done'] = 0;\n\t\t}\n\n\n\t\tif( isset( $data['amount'] ) ){\n\t\t\t// AMOUNT Format\n\t\t\t$data['amount'] = str_replace('.', '', $data['amount'] );\n\t\t\t$data['amount'] = str_replace(',', '.', $data['amount'] );\t\t\n\t\t\t$data['amount'] = str_replace('-', '', $data['amount'] );\t// TIRA O \"-\"\t\t\t\n\t\t\tif( $data['type'] == 'despesa' ){\n\t\t\t\t$data['amount'] = (0 - $data['amount']); // Deixa o número negativo\n\t\t\t}\n\t\t}\n\n\t\t// return Response::json($data);\n\t\t// exit;\n\n\t\t$transaction->update($data);\n\n\t\t$alert[] = [ 'class' => 'alert-success', 'message' => '<strong><i class=\"fa fa-check\"></i></strong> Lançamento atualizado!' ];\n\t\tSession::flash('alerts', $alert);\t\t\t\n\t\t\n\t\treturn Redirect::to( URL::previous() ); \t\t\n\t}", "public function setTransactionId($id)\n {\n $this->_data['trx_id'] = $id;\n }", "public function update(Request $request, UserTransactions $userTransactions)\n {\n //\n }", "public function edit($id){\n if ($id) {\n $options = array(\n \"conditions\" => \"id=\".$id\n );\n $transaction = $this->transactions->find(\"transactions\",\"first\", $options);\n $this->set(\"transaction\", $transaction);\n $this->set(\"accounts\", $this->transactions->find(\"accounts\"));\n $this->set(\"categories\", $this->transactions->find(\"categories\"));\n }\n\n if($_POST){\n if ($_POST[\"operation\"] == 'egreso'){\n $_POST[\"amount\"] = $_POST[\"amount\"]*(-1);\n }\n if ($this->transactions->update(\"transactions\", $_POST)){\n $this->redirect(\n array(\n \"controller\"=>\"transactions\"\n ));\n }else{\n $this->redirect(\n array(\n \"controller\"=>\"transactions\",\n \"method\"=>\"edit/\".$_POST[\"id\"]\n )\n );\n }\n }\n }", "public function update(Request $request, balacetransaction $balacetransaction)\n {\n //\n }", "public function updateTransactionsRequest($budget_id, $data)\n {\n // verify the required parameter 'budget_id' is set\n if ($budget_id === null || (is_array($budget_id) && count($budget_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $budget_id when calling updateTransactions'\n );\n }\n // verify the required parameter 'data' is set\n if ($data === null || (is_array($data) && count($data) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $data when calling updateTransactions'\n );\n }\n\n $resourcePath = '/budgets/{budget_id}/transactions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($budget_id !== null) {\n $resourcePath = str_replace(\n '{' . 'budget_id' . '}',\n ObjectSerializer::toPathValue($budget_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($data)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($data));\n } else {\n $httpBody = $data;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function updateData($id_transaksi)\t\n\t{\n\t\t$data = array(\n\t\t\t/* 'id' yang dikiri harus sama seperti di table\n\t\t\t'id' yang dikanan harus menurut name inputnya */\n\t\t\t'id_transaksi' => $this->input->post('id_transaksi'),\n\t\t\t'id_pelanggan' => $this->input->post('id_pelanggan'),\n\t\t\t'order_id' => $this->input->post('order_id'),\n\t\t\t'message' => $this->input->post('message'),\n\t\t\t'tgl_kirim' => $this->input->post('tgl_kirim'),\n\t\t\t'tgl_terima' => $this->input->post('tgl_terima')\n\t\t);\n\t\t/* jika semua sama sperti di table\n\t\tgunakan versi simple seprti berikut */\n\t\t$data = $this->input->post();\n\t\t//mengeset where id=$id\n\t\t$this->db->where('id_transaksi',$id_transaksi);\n\t\t/*eksekusi update transaksi set $data from transaksi where id=$id\n\t\tjika berhasil return berhasil */\n\t\tif($this->db->update(\"transaksi\",$data)){\n\t\t\treturn \"Berhasil\";\n\t\t}\n\t}", "public function update(TransactionRequest $request, $id_transaction, $id_wallet)\n {\n $transaction = Transaction::find($id_transaction);\n $amount_temp = $transaction->amount;\n $transaction->id_category = $request->sltCate;\n $transaction->id_wallet = $id_wallet;\n $transaction->amount = str_replace(',', '', $request->txtAmount);\n $transaction->description = $request->txtDescription;\n $transaction->with_who = $request->txtWithWho;\n $transaction->save();\n\n // save wallet\n $wallet = Wallet::find($id_wallet);\n if($request->sltKindCate == 1)\n {\n $wallet->amount = $wallet->amount + str_replace(',', '', $request->txtAmount) - $amount_temp;\n }\n else{\n $wallet->amount = $wallet->amount - str_replace(',', '', $request->txtAmount) + $amount_temp;\n }\n $wallet->save();\n // end save wallet\n\n return redirect()->route('wallet_be_list', $id_wallet);\n }", "public function update_trans($id_trans, Request $request) {\n\t\t// check validate\n\t\t$validate = [\n\t\t\t'name' => 'required'\n\t\t];\n\t\t$this->validate($request, $validate);\n\n\t\t// upload image\n\t\t$data['image'] = $request->file('image');\n\t\t$data['name'] = $request->input('name');\n\t\t$data['path'] = '/image/trans';\n\t\tif ($data['image'] != null) {\n\t\t\tImages::upload_image($data);\n\t\t}\n\n\t\t// create trans\n\t\t$trans = new \\stdClass;\n\t\t$trans->id = $id_trans;\n\t\t$trans->name = $request->input('name');\n\t\t$trans->leader = $request->input('leader');\n\t\t$trans->member = $request->input('member');\n\t\t$trans->facebook = $request->input('facebook');\n\t\t$trans->website = $request->input('website');\n\t\t$trans->description = $request->input('description');\n\t\tif ($data['image'] == null) {\n\t\t\t$trans->is_image = false;\n\t\t} else {\n\t\t\t$trans->is_image = true;\n\t\t}\n\n\t\tTransBModel::update_trans($trans);\n\n\t\treturn redirect()->back()->with('success', 'Chỉnh sửa thông tin nhóm dịch thành công');\n\t}", "public function update(Request $request, $id) {\n $clienttransaction = ClientTransaction::find($id);\n\n $clienttransaction->CID = $request->input('CID');\n $clienttransaction->TransactionID = $request->input('TransactionID');\n $clienttransaction->Amount = $request->input('Amount');\n $clienttransaction->BalanceTransaction = $request->input('BalanceTransaction');\n $clienttransaction->Date = $request->input('Date');\n $clienttransaction->save();\n\n return \"Sucess updating Client Transaction #\" . $clienttransaction->id;\n }", "public function updated(Transaction $transaction)\n {\n //\n }", "public function updated(Transaction $transaction)\n {\n //\n }", "public function dbUpdateTransactionId($orderId, $transactionId)\n {\n $query = 'UPDATE ' . _DB_PREFIX_ . PayViaEpul::MODULE_NAME . '_transactions\n SET `transaction_id` = \\'' . pSQL($transactionId) . '\\', `date_upd` = NOW()\n WHERE `id_order` = ' . pSQL($orderId);\n\n return $this->executeDbQuery($query);\n }", "public function edit(Btc $btc)\n {\n //\n }", "protected function processTransactionUpdate(\\XLite\\Model\\Payment\\Transaction $transaction, $data)\n {\n $transaction->setDataCell('status', 'Transaction successful', 'X-Payments message', 'C');\n\n if (isset($data['advinfo']) && is_array($data['advinfo'])) {\n\n if (!empty($data['advinfo']['Error'])) {\n $transaction->setDataCell('status', $data['advinfo']['Error'], 'X-Payments error', 'C');\n $transaction->setNote($data['advinfo']['Error']);\n }\n\n if (!empty($data['advinfo']['Message'])) {\n $transaction->setDataCell('status', $data['advinfo']['Message'], 'X-Payments message', 'C');\n $transaction->setNote($data['advinfo']['Message']);\n }\n }\n\n $transactionData = array(\n 'xpc_authorized' => $data['authorized'],\n 'xpc_captured' => $data['capturedAmount'],\n 'xpc_charged' => $data['chargedAmount'] + $data['refundedAmount'],\n 'xpc_voided' => $data['voidedAmount'],\n 'xpc_refunded' => $data['refundedAmount'],\n 'xpc_can_capture' => $data['capturedAmountAvail'],\n 'xpc_can_void' => $data['voidedAmountAvail'], \n 'xpc_can_refund' => $data['refundedAmountAvail'],\n 'xpc_is_fraud_status' => $data['isFraudStatus'],\n ); \n\n if (\n isset($data['isFraudStatus'])\n && '1' == $data['isFraudStatus']\n ) {\n // Set default fraud \"review\" for the backwards compatibility\n $transaction->getOrder()->setFraudTypeXpc(\\XLite\\Module\\CDev\\XPaymentsConnector\\Model\\Payment\\FraudCheckData::CODE_GATEWAY);\n $transaction->getOrder()->setFraudStatusXpc(\\XLite\\Model\\Order::FRAUD_STATUS_REVIEW);\n }\n\n if (\n version_compare(\\XLite\\Core\\Config::getInstance()->CDev->XPaymentsConnector->xpc_api_version, '1.6') <= 0\n && $transaction->getDataCell('xpc_txnid')\n ) {\n\n // API 1.6 backwards compatiblity Kount info update\n\n $transactions = array();\n $kountData = false;\n\n $info = $this->client->requestPaymentAdditionalInfo($transaction->getDataCell('xpc_txnid')->getValue()); \n\n if ($info->isSuccess()) {\n $response = $info->getResponse();\n if (\n !empty($response['transactions'])\n && is_array($response['transactions'])\n ) {\n $transactions = $response['transactions'];\n }\n }\n\n // Search for KOUNT data thru transactions\n foreach ($transactions as $tr) {\n\n if (\n isset($tr['fields'])\n && !empty($tr['fields'])\n && is_array($tr['fields'])\n ) {\n $kountData = $this->processKountData($transaction, $tr);\n\n if ((bool)$kountData) {\n $transactionData['xpc_kount'] = serialize($kountData);\n break;\n }\n }\n }\n }\n\n foreach ($transactionData as $key => $value) {\n $transaction->setXpcDataCell($key, $value);\n }\n\n $this->processCardValidationData($transaction, $data);\n\n $this->processMaskedCardData($transaction, $data);\n\n $this->process3dSecureData($transaction, $data);\n\n $this->processFraudCheckData($transaction, $data);\n }", "public function edit(UserTransactions $userTransactions)\n {\n //\n }", "function update($uid=null)\n {\n if ($this->acl->otentikasi2($this->title) == TRUE && $this->model->valid_add_trans($uid, $this->title) == TRUE){\n\n\t// Form validation\n $this->form_validation->set_rules('tdate', 'Date', 'required|callback_valid_period');\n $this->form_validation->set_rules('ccurrency', 'Currency', 'required');\n $this->form_validation->set_rules('tnote', 'Note', 'required');\n $this->form_validation->set_rules('tamount', 'Amount', 'required|numeric');\n $this->form_validation->set_rules('cfrom', 'From', 'required');\n $this->form_validation->set_rules('cto', 'To', 'required|callback_valid_acc');\n\n if ($this->form_validation->run($this) == TRUE && $this->valid_confirmation($uid) == TRUE)\n {\n $transfer = array('from' => $this->input->post('cfrom'), 'to' => $this->input->post('cto'),\n 'dates' => $this->input->post('tdate'), 'currency' => $this->input->post('ccurrency'), 'notes' => $this->input->post('tnote'),\n 'amount' => $this->input->post('tamount'), 'log' => $this->decodedd->log);\n\n if ($this->model->update_id($uid, $transfer) == true){ $this->error = 'Data successfully saved..'; }else{ $this->reject(); }\n }\n elseif ($this->valid_confirmation($uid) != TRUE){ $this->reject(\"Journal approved, can't updated..!\"); }\n else{ $this->reject(validation_errors()); }\n }else { $this->reject_token(); }\n $this->response();\n }", "public function update(Request $request, Transaction $transaction)\n {\n\n }", "function save_complete_transaction($transaction_id, $user_id, $args) {\n\n // Get codeigniter object instance\n $CI = &get_instance();\n\n // Set transaction's data\n $CI->session->set_flashdata('complete_transaction', array(\n 'transaction_id' => $transaction_id\n ));\n\n // Params array\n $params = array();\n\n // Verify if net's id exists\n if ( isset($args['net_id']) ) {\n $params['net_id'] = $args['net_id'];\n }\n\n // Verify if gateway exists\n if ( isset($args['gateway']) ) {\n $params['gateway'] = $args['gateway'];\n }\n \n // Verify if status exists\n if ( isset($args['status']) ) {\n $params['status'] = $args['status'];\n } \n\n // Save the error\n $updated = $CI->base_model->update('transactions', array(\n 'transaction_id' => $transaction_id,\n 'user_id' => $user_id,\n ),\n $params\n );\n\n // Verify if the transaction was updated\n if ( $updated ) {\n\n return true;\n\n } else {\n\n return false;\n\n }\n \n }", "public function update(RecurringTransaction $recurrTran)\n {\n \n $conn = &PDOData::connect();\n $stmt = $conn->prepare(\"UPDATE recurring_transactions SET amount = :amount, description = :description, repeat_type = :repeat_type, from_date = :from_date, every = :every, monthly = :monthly, weekly = :weekly, created_at = :created_at WHERE id = :id and customer_id = :customer_id\");\n\n $stmt->bindParam(':amount', $recurrTran->getAmount()); \n $stmt->bindParam(':description', $recurrTran->getDescription(), PDO::PARAM_STR); \n $stmt->bindParam(':repeat_type', $recurrTran->getRepeatType(), PDO::PARAM_INT);\n $stmt->bindParam(':from_date', $recurrTran->getFromDate());\n $stmt->bindParam(':every', $recurrTran->getEvery(), PDO::PARAM_INT); \n $stmt->bindParam(':monthly', $recurrTran->getMonthly());\n $stmt->bindParam(':weekly', $recurrTran->getWeekly());\n $stmt->bindParam(':created_at', $recurrTran->getCreatedAt());\n $stmt->bindParam(':customer_id', $$recurrTran->getCustomerId(), PDO::PARAM_INT);\n $stmt->bindParam(':id', $recurrTran->getId());\n\n $stmt->execute();\n \n PDOData::disconnect(); \n echo \"SUCCESS\"; \n }", "public static function updateTransfer($db,$table_prefix,$update,$transfer_id,&$error)\n {\n $error = '';\n $output = [];\n \n $table_transfer = $table_prefix.'transfer';\n $table_transfer_item = $table_prefix.'transfer_item';\n\n $transfer = self::get($db,$table_prefix,'transfer',$transfer_id);\n \n if($update === 'TOTALS') {\n $sql = 'SELECT COUNT(*) AS item_no,SUM(total_kg) AS total_kg '.\n 'FROM '.$table_transfer_item.' '.\n 'WHERE transfer_id = \"'.$db->escapeSql($transfer_id).'\" ';\n $totals = $db->readSqlRecord($sql);\n \n $sql = 'UPDATE '.$table_transfer.' '.\n 'SET item_no = \"'.$totals['item_no'].'\", '.\n 'total_kg = \"'.$totals['total_kg'].'\" '.\n 'WHERE transfer_id = \"'.$db->escapeSql($transfer_id).'\" ';\n $db->executeSql($sql,$error); \n }\n\n if($update === 'CONFIRM') {\n if($transfer['status'] !== 'NEW') {\n $error .= 'Cannot CONFIRM a transfer unless status = NEW';\n } else {\n $db->executeSql('START TRANSACTION',$error_tmp);\n if($error_tmp !== '') {\n $error .= 'Could not START Transfer confirm transaction';\n } else { \n $sql = 'SELECT data_id,stock_id,quantity,total_kg,status '.\n 'FROM '.$table_transfer_item.' WHERE transfer_id = \"'.$db->escapeSql($transfer_id).'\" ';\n $items = $db->readSqlarray($sql);\n foreach($items as $data_id => $item) {\n\n Helpers::updateStockInStore($db,$table_prefix,$transfer['to_store_id'],$item['stock_id'],$item['quantity'],$error_tmp);\n if($error_tmp !== '') {\n $error .= 'We could not update TO Store amounts for stock ID['.$item['stock_id'].'] ';\n if(DEBUG) $error .= $error_tmp;\n } else {\n $sql = 'UPDATE '.$table_transfer_item.' SET status = \"CONFIRMED\" '.\n 'WHERE data_id = \"'.$db->escapeSql($data_id).'\" ';\n $db->executeSql($sql,$error_tmp);\n if($error_tmp !== '') $error .= 'We could not CONFIRM transfer ID['.$transfer_id.'] ';\n }\n\n /*\n Helpers::updateStockTransfered($db,$table_prefix,'TO',$transfer['from_store_id'],$transfer['to_store_id'],$item['stock_id'],$item['quantity'],$error_tmp);\n if($error_tmp !== '') {\n $error .= 'We could not update TO Store amounts for stock ID['.$item['stock_id'].'] ';\n } else {\n $sql = 'UPDATE '.$table_transfer_item.' SET status = \"CONFIRMED\" '.\n 'WHERE data_id = \"'.$db->escapeSql($data_id).'\" ';\n $db->executeSql($sql,$error_tmp);\n if($error_tmp !== '') $error .= 'We could not CONFIRM transfer ID['.$transfer_id.'] ';\n }\n */\n }\n } \n\n if($error === '') {\n $sql = 'UPDATE '.$table_transfer.' SET status = \"CONFIRMED\" '.\n 'WHERE transfer_id = \"'.$db->escapeSql($transfer_id).'\" ';\n $db->executeSql($sql,$error_tmp);\n if($error_tmp !== '') $error .= 'We could not CONFIRM transfer ID['.$transfer_id.']';\n }\n\n if($error !== '') {\n $db->executeSql('ROLLBACK',$error_tmp);\n if($error_tmp !== '') $error .= 'Could not ROLLBACK transfer confirm transaction';\n } else {\n $db->executeSql('COMMIT',$error_tmp);\n if($error_tmp !== '') $error .= 'Could not COMMIT transfer confirm transaction';\n }\n }\n }\n \n \n if($error !== '') return false; else return true;\n }", "function update_user_credits_by_amount($id_user='', $amount=''){\t\n\t\ttry{\n\t\t\t$this->db->set('credits','credits+'.$amount, FALSE);\n\t\t\t$this->db->where('id', $id_user);\n\t\t\t$result = $this->db->update('user');\n\t\t\tif($this->db->affected_rows()>0){\n\t\t\t\treturn TRUE;\n\t\t\t}else{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}catch(Exception $e){\n\t\t\tlog_message('debug','Error en la función update_user_credits_by_amount');\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function confirm($id=\"\"){\r\n \t\t\t//$bitcoin_isvalid = $bitcoin->listtransactions();\r\n\r\n \t\t\t/*$bal=$bitcoin->getbalance();*/\r\n\r\n \r\n\r\n\t\t$id=insep_decode($id);\r\n\t\t$condition=array(\"transactionId\"=>$id,\"status\"=>\"Pending\");\r\n\t\t$transdata=$this->CommonModel->getTableData(\"tansation\",$condition);\r\n\t\tif($transdata->num_rows() >0){\t\t\r\n\r\n\r\n if($this->input->post(\"witdraw_submit\")){ \r\n\r\n\r\n \t\t$currecncy=$transdata->row()->currency;\r\n \t \t$currency=$transdata->row()->currency;\r\n \r\n\r\n \tif($currency==\"BTC\"){\r\n\r\n \t\t$txn_id=$this->transfer_coin(\"BTC\",$transdata);\r\n\r\n\r\n \t}else if($currency==\"LTC\"){ \r\n\r\n \t\t$txn_id=$this->transfer_coin(\"LTC\",$transdata);\r\n\r\n \t}else if($currency==\"DGB\"){ \r\n\r\n \t\t$txn_id=$this->transfer_coin(\"DGB\",$transdata);\r\n\r\n \t}else if($currency==\"DASH\"){ \r\n\r\n \t\t$txn_id=$this->transfer_coin(\"DASH\",$transdata);\r\n\r\n \t}else if($currency==\"ETH\"){\r\n \t\t$txn_id=$this->transfer_eth(\"ETH\",$transdata);\r\n\r\n \t}else if($currency==\"XRP\"){\r\n\r\n \t\t$txn_id=$this->transfer_xrp($transdata);\r\n\r\n \t} else if($currency==\"BTG\"){\r\n\r\n \t\t$txn_id=$this->transfer_coin(\"BTG\",$transdata);\r\n\r\n \t}\r\n\t\telse if($currency==\"BCH\"){\r\n\r\n \t\t$txn_id=$this->transfer_coin(\"BCH\",$transdata);\r\n\r\n \t}\r\n\t\telse if($currency==\"ETC\"){\r\n\r\n \t\t$txn_id=$this->transfer_etc(\"ETC\",$transdata);\r\n\r\n \t}else if($currency==\"XMR\"){\r\n\r\n \t \t$txn_id=$this->transfer_xmr($transdata);\r\n\r\n \t}\r\n\t\t \t\r\n \t\t$status=\"Success\";\r\n\r\n \t\tif($status==\"Success\"){\r\n\r\n\t\t\t\t$transdata=$transdata->row();\r\n\t\t\t\t$currecncy=$transdata->currency;\r\n\t\t\t\t$amount=$transdata->total_amount;\r\n\t\t\t\t$update[\"status\"]=\"Completed\";\r\n\t\t\t\t$update[\"transation_hash\"]=$txn_id;\r\n\t\t\t\t$this->CommonModel->updateTableData(\"tansation\",$update,$condition);\r\n\t\t\t\t$email_data=getEmailTeamplete(10);\r\n\t\t\t\t$subject=$email_data->subject;\r\n\t\t\t\t$template=$email_data->template;\r\n\t\t\t\t$site_data=site_settings();\r\n\t\t\t\t$sitename=$site_data->site_name;\r\n\t\t\t\t$trans_data=$transdata;\r\n\t\t \t $trans_data->total_amount;\t\t\t\t\t\r\n\t\t\t\t\t$data=array(\r\n\t\t\t\t\t\t\"###TRANSID###\"=>$trans_data->transactionId,\t\t\t\r\n\t\t\t\t\t\t\"###AMOUNT###\"=>$trans_data->total_amount.$trans_data->currency,\r\n\t\t\t\t\t\t\"###LOGOIMG###\"=> base_url().\"assets/frontend/images/mail_logo.png\",\r\n\t\t\t\t\t\t\"###FBIMG###\"=> base_url().\"assets/frontend/images/facebook.png\",\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\"###STATUS###\"=> \"Completed\",\t\t\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$data[\"###LOGOIMG###\"]=getSiteLogo();\r\n\t\t\t\t\t$data[\"###EMAILIMG###\"]= base_url().\"assets/frontend/images/email_send.png\";\r\n\t\t\t\t\t$data[\"###FBIMG###\"]= base_url().\"assets/frontend/images/facebook.png\";\t\t\t\r\n\t\t\t\t\t$data[\"###TWIMG###\"]= base_url().\"assets/frontend/images/twitter.png\";\r\n\t\t\t\t\t$data[\"###GPIMG###\"]= base_url().\"assets/frontend/images/gplus.png\";\r\n\t\t\t\t\t$data[\"###LEIMG###\"]= base_url().\"assets/frontend/images/linkedin.png\";\t\r\n\t\t\t\t\t$data[\"###HDIMG###\"]= base_url().\"assets/frontend/images/email.png\";\r\n\t\t\t\t\t$data[\"###FBLINK###\"]= $site_data->facebooklink;\t\t\t\t\r\n\t\t\t\t\t$data[\"###TWLINK###\"]= $site_data->twitterlink;\t\r\n\t\t\t\t\t$data[\"###GPLINK###\"]= $site_data->googlelink;\r\n\t\t\t\t\t$data[\"###LELINK###\"]= $site_data->linkedinlink;\r\n\t\t\t\t$email=get_user_email($trans_data->user_id);\r\n\t\t\t\t $message=strtr($template,$data);\t\t\r\n\t\t\t\tsend_mail($email,$subject,$message);\r\n\t\t\t\t$this->session->set_flashdata(\"success\",\"Withdraw request Completed successfully\");\t\t\r\n\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\r\n\r\n\t\t\t}else{\r\n\r\n\r\n\t\t\t\t$this->session->set_flashdata(\"error\",\"Withdraw request error, Tray again after some time\");\t\t\r\n\r\n\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\r\n\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$transdata=$transdata->row();\r\n\t\t\t$user_id=$transdata->user_id;\r\n\t\t\t$condition=array(\"user_id\"=>$user_id);\r\n\t\t\t$userdata=$this->CommonModel->getTableData(\"userdetails\",$condition)->row();\t\r\n\t\t\t$data['withdraw']=$transdata;\t\r\n\r\n\t\t\t $data['user_name']=$userdata->username;\t\t\r\n\t\t\t\r\n\t\t\t$this->load->view(\"admin/transation/withdaw_request_details\",$data);\t\r\n\r\n\t\t}\r\n\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$this->session->set_flashdata(\"error\",\"Invalid link or already used link\");\t\t\r\n\t\r\n\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\r\n\r\n\t\t}\r\n\r\n\r\n\r\n\r\n\r\n\t}", "public function update($id) //CreateRecurringTransactionRequest $request,\n {\n \\DB::transaction(function() use ($id) {\n $transaction = RecurringTransaction::find($id);\n\n if(Gate::denies('has-transaction', $transaction)) {\n abort(403, 'Thats not yours!');\n }\n\n $transaction->update($this->input);\n });\n }", "public function update($id = null,$payment = null, $amount = null) {\n $trasactionId = $this->_request->getParam('id');\n $transUrl = $this->config->getPaymentConfigData('gateway_url') . '/' . $this->config->getPaymentConfigData('transaction') . '/' . $trasactionId;\n $responseGetTrans = $this->serviceConfig->getCurlDataTags($transUrl);\n $status = $responseGetTrans->status;\n\t\t\n\t\tswitch ($status) {\n\t\t\tcase 'SETTLEMENT_REQUESTED':\n\t\t\t\t$paymentStatus = 'capture';\n\t\t\t\tbreak;\n\t\t\tcase 'AUTHORIZED':\n\t\t\t\t$paymentStatus = 'authorization';\n\t\t\t\tbreak;\n\t\t\tcase 'AUTHORIZATION_VOIDED':\n\t\t\t\t$paymentStatus = 'void';\n\t\t\t\tbreak;\n\t\t\tcase 'SETTLEMENT_CANCELLED':\n\t\t\t\t$paymentStatus = 'void';\n\t\t\t\tbreak;\n\t\t}\n\t\t\n $collection = $this->settlements->getCollection()->addFieldToFilter('transaction_id',$trasactionId);\n foreach($collection as $data){\n $reportId = $data->getReportId(); \n $settlementData = $this->settlements->load($reportId);\n $settlementData->setSettlementStatus($status); \n $settlementData->save(); \t\t\t\n }\n\t\t\n\t\t$orderCollection = $this->order->getCollection()->addFieldToFilter('txn_id',$trasactionId);\n\t\tforeach($orderCollection as $orderData){\n $transId = $orderData->getTransactionId(); \n $this->order->load($transId)->setTxnType($paymentStatus)->save();\n\t\t\tif($paymentStatus == 'capture'){\n $orderId = $orderData->getOrderId();\n $order = $this->_orderRepository->get($orderId);\n if($order->canInvoice()) {\n $invoice = $this->_invoiceService->prepareInvoice($order);\n $invoice->register();\n $invoice->save();\n $transactionSave = $this->_transaction->addObject(\n $invoice\n )->addObject(\n $invoice->getOrder()\n );\n $transactionSave->save();\n }\n }\n\t\t\t\n\t\t\t return $responseGetTrans->status;\n\t\t\n\t\t \n\t\t \n\t\t}\n\n \n}", "public function update(Request $request, transactions $transactions)\n {\n //\n }", "public function edit(Transaction $transaction)\n {\n //\n }", "public function edit(Transaction $transaction)\n {\n //\n }", "public function edit(Transaction $transaction)\n {\n //\n }", "public function edit(Transaction $transaction)\n {\n //\n }", "public function setCustomerTransactionId($id) {\n \t$this->customerTransactionId = $id;\n }", "public function update(Request $request, Transaction $transaction)\n {\n $data = $request->json()->all();\n \n $request->validate([\n 'total_price' => 'required|numeric',\n 'status' => 'required|boolean',\n 'customer_id' => 'required|uuid|exists:customers,id',\n\n ]);\n\n $transaction->total_price = $data['total_price'];\n $transaction->status = $data['status'];\n $transaction->shipping_address = $data['shipping_address'];\n $transaction->customer_id = $data['customer_id'];\n $transaction->save();\n\n return $transaction;\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'customer_id' => 'required',\n 'destination_acc_id' => 'required',\n 'description' => 'required',\n 'total' => 'required',\n ]);\n Transaction::find($id)->update([\n 'customer_id' => $request->input('customer_id'),\n 'destination_acc_id' => $request->input('destination_acc_id'),\n 'total' => $request->input('total'),\n 'description' => $request->input('description'),\n\n ]);\n return redirect()->route('cash_in.index')->with(['message' => Alert::setAlert( 1, \"data berhasil di update\" ) ]);\n }", "public function testUpdate()\n {\n $data = array(\n 'foo' => 'baz'\n );\n\n $transaction = $this->client->transaction()->Update(654, $data);\n\n $this->assertEquals($data, get_object_vars($transaction->put), 'Passed variables are not correct');\n $this->assertEquals('PUT', $transaction->request_method, 'The PHP Verb Is Incorrect');\n $this->assertEquals('/transactions/654', $transaction->path, 'The path is incorrect');\n\n }", "public function editTransactionsAction() {\n\t\ttry {\n\n $pageHeading = \"Edit-Transactions\";\n $this->view->page_heading = $pageHeading;\n $this->view->data_page = \"tables\";\n \n $objTransactionsService \t\t= new Base_Model_Lib_Invoice_Service_Transaction();\n $objTransactionsEntity \t\t= new Base_Model_Lib_Invoice_Entity_Transaction();\n\t\t\t\n if ($this->_request->isPost()) {\n \n $objTransactionsEntity->setId($this->_request->getParam('txtId'));\n $objTransactionsEntity->setClient($this->_request->getParam('cmbClient'));\n $objTransactionsEntity->setDate($this->_request->getParam('txtTransactionDate'));\n $objTransactionsEntity->setGateway($this->_request->getParam('cmbPaymentMethod'));\n $objTransactionsEntity->setDescription($this->_request->getParam('txtDescription'));\n $objTransactionsEntity->setInvoiceId($this->_request->getParam('txtInvoiceID'));\n $objTransactionsEntity->setTransId($this->_request->getParam('txtTransactionID'));\n $objTransactionsEntity->setAmountIn($this->_request->getParam('txtAmountIn'));\n $objTransactionsEntity->setFees($this->_request->getParam('txtFees'));\n $objTransactionsEntity->setAmountOut($this->_request->getParam('txtAmountOut'));\n $objTransactionsService->transaction = $objTransactionsEntity;\n $objTransactionsService->updateTransaction();\n $this->_redirect('/admin/billing/transactions/');\n \n } else {\n \n $objClientService = new Base_Model_Lib_Client_Service_Client();\n $objClientEntity = new Base_Model_Lib_Client_Entity_Client();\n $objClientService->client = $objClientEntity; \n $clientDetails = $objClientService->search(\"\");\n $this->view->clientDetails = $clientDetails;\n \n $transactionId = $this->_request->getParam('id');\n $transactionInfo = $objTransactionsService->getItem($transactionId);\n $this->view->transactionInfo = $transactionInfo;\n \n $objPaymentMethodService = new Base_Model_Lib_Catelog_Service_PaymentMethod();\n $paymentMethods = $objPaymentMethodService->getAll();\n $this->view->paymentMethods = $paymentMethods;\n }\n\t\t\t\n \n \n \n\t\t\t\t\n\t\t} catch ( Exception $ex ) {\n\t\t\tthrow new Exception ( '<ERROR>' . $ex->getMessage () . \"\\n\" );\n\t\t}\n\n\t}", "public function update(Request $request, Transaction $transaction)\n {\n //\n }", "public function update(Request $request, Transaction $transaction)\n {\n //\n }", "public function update(Request $request, Transaction $transaction)\n {\n //\n }", "public function update(Request $request, Transaction $transaction)\n {\n //\n }", "function addTransaction() {\nrequire(\"/home/course/cda540/u05/public_html/project/dbguest.php\");\n\n//It will import all variables such as $host , $user, $pass and $db\n\n//mysqli_connect() is to connect the database\n$link = mysqli_connect($host, $user, $pass, $db);\n\n//Check the connection. Give error message if any error\nif (!$link) die(\"Couldn't connect to MySQL\");\n\n\n//mysqli_select_db() is used to select the database\nmysqli_select_db($link, $db)\n or die(\"Couldn't open $db: \".mysqli_error($link));\n\n$result_cusID=(int)$_POST['customerID'];\n\n$string_itemID=$_POST['items'];\n\n$string_itemsPrice = $_POST['itemsPrice'];\n\n$result_itemID = explode(\"\\n\",$string_itemID);\n\n$result_itemPrice = explode(\"\\n\",$string_itemsPrice);\n\n$itemIDs = implode (\",\" , $result_itemID);\n\n$result_customer=mysqli_query($link,\"SELECT * FROM CUSTOMER where _id=$result_cusID\");\n\n$result_itemIDs = mysqli_query($link,\"SELECT * FROM ITEM where _id IN ('$itemIDs')\");\n\n$totalpurchaseprice = 0;\n\nforeach($result_itemPrice as $itemprice)\n{\n $totalpurchaseprice = $totalpurchaseprice+$itemprice;\n}\n\n\nif ((mysqli_num_rows($result_customer)>0)&& (mysqli_num_rows($result_itemIDs)>0))\n{\n \n $result_trans=mysqli_query($link, \"INSERT INTO TRANSACTION (discouncode,transactiondate,totalpurchaseprice,customerId) VALUES(70,now(),'$totalpurchaseprice','$result_cusID')\");\n \n $result_no=mysqli_query($link,\"SELECT transactionNumber FROM TRANSACTION ORDER BY customerId DESC LIMIT 1\");\n $obj = mysqli_fetch_object($result_no);\n $transno= $obj-> transactionNumber;\n \n foreach ($result_itemID as $itemID)\n {\n $result_transdetails=mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES('$transno','$itemID')\"); \n }\n\necho '<span style=\"color:#008000;text-align:center;\">Success!!! Customer ID Found and added a new transaction...</span>';\n\n\n}\n\nelse\n{\necho '<span style=\"color:#FF0000;text-align:center;\">Sorry!!! Unable to add a new transaction (Check Customers and Items)...</span>';\n}\n\n//$string_itemID=$_POST['items'];\n\n//$result_itemID = explode(\"\\n\",$string_itemID);\n\n//$j=1;\n\n//foreach ($result_itemID as $item_val)\n//{\n//echo \"$item_val <br>\";\n//$item_intval=int(\"$item_val\");\n\n//Working\n//$result_trans=mysqli_query($link, \"INSERT INTO TRANSACTION (discouncode,transactiondate,totalpurchaseprice,customerId) VALUES(70,'2019jun21',13.14,1)\");\n//$result_no=mysqli_query($link,\"SELECT transactionNumber FROM TRANSACTION ORDER BY customerId DESC LIMIT 1\");\n\n//$value = mysql_fetch_object($result_no);\n//$transno = $value->transactionNumber;\n//echo \"$transno\";\n//$result_transdetails=mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES(5,1)\");\n//$j=$j+1;\n//}\n\n\n//mysqli_query will execute the query and stores into $result\n\n//mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES('$result')\");\n//Close the connection\nmysqli_close($link);\n\n}", "public function actionUpdate($id)\r\n\t{\r\n\t\t$model=$this->loadModel($id);\r\n\r\n\t\t// Uncomment the following line if AJAX validation is needed\r\n\t\t// $this->performAjaxValidation($model);\r\n\r\n\t\tif(isset($_POST['MoneyTransfer']))\r\n\t\t{\r\n\t\t\t$model->attributes=$_POST['MoneyTransfer'];\r\n\t\t\tif($model->save())\r\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\r\n\t\t}\r\n\r\n\t\t$this->render('update',array(\r\n\t\t\t'model'=>$model,\r\n\t\t));\r\n\t}", "function update($pid=null)\n {\n if ($this->acl->otentikasi2($this->title) == TRUE && $this->model->valid_add_trans($pid, $this->title) == TRUE){ \n\n\t// Form validation\n $this->form_validation->set_rules('tdate', 'Invoice Date', 'required|callback_valid_period');\n $this->form_validation->set_rules('tnote', 'Note', 'required');\n $this->form_validation->set_rules('tcosts', 'Landed Cost', 'numeric');\n $this->form_validation->set_rules('tdocno', 'Docno', '');\n $this->form_validation->set_rules('cacc', 'Account', 'required');\n\n if ($this->form_validation->run($this) == TRUE && $this->valid_confirmation($pid) == TRUE)\n {\n $purchase_returns = $this->model->get_by_id($pid)->row();\n\n $purchase_return = array('log' => $this->decodedd->log, 'docno' => $this->input->post('tdocno'),\n 'dates' => $this->input->post('tdate'), 'acc' => $this->input->post('cacc'), 'notes' => $this->input->post('tnote'),\n 'user' => $this->decodedd->userid, 'costs' => $this->input->post('tcosts'),\n 'balance' => floatval($this->input->post('tcosts')+$purchase_returns->total)\n );\n if ($this->model->update($pid,$purchase_return) == true){ $this->error = 'transaction successfully saved..!'; }else{ $this->reject(); }\n }\n elseif ($this->valid_confirmation($pid) != TRUE){ $this->reject(\"Journal already approved..!\"); }\n else{ $this->reject(validation_errors()); }\n }else { $this->reject_token('Invalid Token or Expired..!'); }\n $this->response(); \n }", "function insert_transaction($subscriptionid = 0, $projectid = 0, $buynowid = 0, $user_id = 0, $p2b_user_id = 0, $storeid = 0, $orderid = 0, $description = '', $amount, $paid, $status, $invoicetype, $paymethod, $createdate, $duedate, $paiddate, $custommessage, $archive, $ispurchaseorder = 0, $returnid = 0, $transactionidx = '', $isdeposit = 0, $iswithdraw = 0, $dontprocesstax = 0)\n {\n global $ilance, $ilconfig;\n $subscriptionid = isset($subscriptionid) ? intval($subscriptionid) : '0';\n $projectid = isset($projectid) ? intval($projectid) : '0';\n $buynowid = isset($buynowid) ? intval($buynowid) : '0';\n $user_id = isset($user_id) ? intval($user_id) : '0';\n $p2b_user_id = isset($p2b_user_id) ? intval($p2b_user_id) : '0';\n $storeid = isset($storeid) ? intval($storeid) : '0';\n $orderid = isset($orderid) ? intval($orderid) : '0';\n $description = isset($description) ? $description : 'No transaction description provided';\n $amount = isset($amount) ? $amount : '0.00';\n $paid = isset($paid) ? $paid : '0.00';\n $status = isset($status) ? $status : 'unpaid';\n $invoicetype = isset($invoicetype) ? $invoicetype : 'debit';\n $paymethod = isset($paymethod) ? $paymethod : 'account';\n $ipaddress = IPADDRESS;\n $referer = REFERRER;\n $createdate = DATETIME24H;\n $duedate = isset($duedate) ? $duedate : DATETIME24H;\n $paiddate = isset($paiddate) ? $paiddate : '';\n $custommessage = isset($custommessage) ? $custommessage : 'No memo or administrative comments';\n $archive = isset($archive) ? intval($archive) : '0';\n $ispurchaseorder = isset($ispurchaseorder) ? $ispurchaseorder : '0';\n // withdraw and deposit related transactions\n $iswithdraw \t = isset($iswithdraw) \t ? intval($iswithdraw) : '0';\n $isdeposit \t = isset($isdeposit) \t ? intval($isdeposit) : '0';\n $totalamount = '0.00';\n $transactionid = (isset($transactionidx) AND !empty($transactionidx)) ? $transactionidx : $ilance->accounting_payment->construct_transaction_id();\n $currencyid = $this->currencyid == '0' ? $ilconfig['globalserverlocale_defaultcurrency'] : $this->currencyid;\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"invoices\n (invoiceid, currency_id, subscriptionid, projectid, buynowid, user_id, p2b_user_id, storeid, orderid, description, amount, paid, totalamount, status, paymethod, ipaddress, referer, createdate, duedate, paiddate, custommessage, transactionid, archive, ispurchaseorder, isdeposit, iswithdraw)\n VALUES(\n NULL,\n '\" . intval($currencyid) . \"',\n '\" . intval($subscriptionid) . \"',\n '\" . intval($projectid) . \"',\n '\" . intval($buynowid) . \"',\n '\" . intval($user_id) . \"',\n '\" . intval($p2b_user_id) . \"',\n '\" . intval($storeid) . \"',\n '\" . intval($orderid) . \"',\n '\" . $ilance->db->escape_string($description) . \"',\n '\" . $ilance->db->escape_string($amount) . \"',\n '\" . $ilance->db->escape_string($paid) . \"',\n '\" . $ilance->db->escape_string($totalamount) . \"',\n '\" . $ilance->db->escape_string($status) . \"',\n '\" . $ilance->db->escape_string($paymethod) . \"',\n '\" . $ilance->db->escape_string($ipaddress) . \"',\n '\" . $ilance->db->escape_string($referer) . \"',\n '\" . $ilance->db->escape_string($createdate) . \"',\n '\" . $ilance->db->escape_string($duedate) . \"',\n '\" . $ilance->db->escape_string($paiddate) . \"',\n '\" . $ilance->db->escape_string($custommessage) . \"',\n '\" . $ilance->db->escape_string($transactionid) . \"',\n '\" . $ilance->db->escape_string($archive) . \"',\n '\" . intval($ispurchaseorder) . \"',\n '\" . intval($isdeposit) . \"',\n '\" . intval($iswithdraw) . \"')\n \", 0, null, __FILE__, __LINE__); \n // fetch new last invoice id\n $invoiceid = $ilance->db->insert_id();\n \n // do we skip the taxation support for this transaction?\n // we do this in some situations where the tax needs to be applied before the txn is created\n // for situations like escrow fees that we must already know how much to charge the customer for taxes\n // if we don't do this then the txn may have double taxes added to the overall amount\n // and situations like this usually mean that an unpaid transaction is being created (and tax) is\n // auto-applied\n \n // taxation support: is user taxable for this invoice type?\n // this code block will run if a transaction being created is unpaid waiting for payment from the customer\n if ($ilance->tax->is_taxable($user_id, $invoicetype) AND isset($dontprocesstax) AND $dontprocesstax == 0)\n {\n // fetch tax amount to charge for this invoice type\n $taxamount = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 0);\n // fetch total amount to hold within the \"totalamount\" field\n $totalamount = ($amount + $taxamount);\n // fetch tax bit to display when outputing tax infos\n $taxinfo = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 1);\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\" . $totalamount . \"',\";\n }\n // member is taxable for this invoice type\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET istaxable = '1',\n $extra\n totalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\n taxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\n taxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else\n {\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\".$totalamount.\"',\";\n }\n // customer not taxable > update totalamount value\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET totalamount = '\" . sprintf(\"%01.2f\", $amount) . \"',\n $extra\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n } \n if (isset($returnid) AND $returnid > 0)\n {\n return intval($invoiceid);\n }\n }", "function update($p_merchant_name, $p_merchant_email, $p_tax_govt, $p_tax_service)\n {\n $result_update = false;\n \n // format\n $p_merchant_name = sanitizeNoTags($p_merchant_name);\n $p_merchant_email = sanitizeEmail(sanitizeNoTags($p_merchant_email));\n $p_tax_govt = sanitizeFloat($p_tax_govt);\n $p_tax_service = sanitizeFloat($p_tax_service);\n \n // set\n $p_tax_govt = number_format(($p_tax_govt/100), 2);\n $p_tax_service = number_format(($p_tax_service/100), 2);\n\n // set\n $arr_vars = array(\n 'MERCHANT_NAME' => $p_merchant_name,\n 'MERCHANT_EMAIL' => $p_merchant_email,\n 'TAX_GOVT' => $p_tax_govt,\n 'TAX_SERVICE' => $p_tax_service\n );\n \n // connect to database \n parent::connect();\n \n while(list($key,$value) = each($arr_vars))\n {\n if ($value != '')\n {\n // update\n $result = parent::dataUpdate($key, $value); \n }\n \n $key = '';\n $value = '';\n }\n \n // disconnect from database\n parent:: disconnect();\n \n $result_update = '1';\n \n return $result_update; \n }", "public function update($id,$acct,$data=[])\n {\n extract_args($data, [\n 'nickname' => '',\n 'auto_pay_active' => null,\n 'active' => null,\n ]);\n return $this->put(\"debt/{$id}/payaccounts/{$acct}\", $data);\n }", "function set_transaction_value($id, $value){\n $str_query=\"update pos_transaction set value = $value where transaction_id='$id'\";\n return $this->query($str_query);\n }", "public function actionUpdate($id)\n {\n if (Yii::$app->request->post('_asnew') == '1') {\n $model = new TransInfo();\n } else {\n $model = $this->findModel($id);\n }\n\n if ($model->loadAll(Yii::$app->request->post(), ['salBasket']) && $model->saveAll(['salBasket'])) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public static function updateStateCompleted($id_transaction){\r\n\t$query = \"UPDATE transaction SET state = 1 WHERE\tid_transaction = '{$id_transaction}' \";\r\n\r\n\t$conn = connect();\r\n\r\n\tif(mysqli_query($conn, $query)){\r\n\r\n\t echo \"Upadate Transaction State Completed guardado: \";\r\n\r\n }else{\r\n\r\n\t die (\"didn't query\".mysqli_error($conn));\r\n\t}\r\n\tmysqli_close($conn);\r\n }", "public static function twispay_tw_updateTransactionStatus( $id, $status ) {\n global $wpdb;\n\n $already = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM \" . $wpdb->prefix . \"twispay_tw_transactions WHERE id_cart = '%d'\", $id) );\n\n if ( $already ) {\n /* Update the DB with the transaction data. */\n $wpdb->query( $wpdb->prepare( \"UPDATE \" . $wpdb->prefix . \"twispay_tw_transactions SET status = '%s' WHERE id_cart = '%d'\", $status, $id ) );\n }\n }", "public function update(Request $request, $id)\n {\n $transaction = \\App\\Transaction::findOrFail($id);\n $transaction->tgl_bayar = Carbon::now();\n $transaction->status_laundry = $request->get('status_laundry');\n $transaction->status_pembayaran = $request->get('status_pembayaran');\n\n $transaction->save();\n return redirect()->route('transactions.index')->with('success', 'Data invoice baru berhasil di ubah');\n }", "public function updateTransaction($tid, $args, $shippingConfirmed){}", "public function update($id)\n\t{\n\t\t$tlb = Tlbpayment::findOrFail($id);\n\n\t\t$validator = Validator::make($data = Input::all(), Tlbpayment::$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$tlb->account_id = Input::get('eq_id');\n\t\t$tlb->asset_id = Input::get('asset_id');\n\t\t$tlb->amount = Input::get('amount');\n\t\t$tlb->date = Input::get('date');\n\t\t$tlb->update();\n\n\t\t$vehicle = Vehicle::findOrFail(Input::get('vehicle_id'));\n\n\t\t/*$cont = Contribution::where('tlbpayment_id',$id)->first();\n\t\t$cont->void = 1;\n\t\t$cont->update();\n\n\t\tif($cont->debit_journal_id != null && $cont->credit_journal_id != null){\n\t\t$journal = Journal::findOrFail($cont->credit_journal_id);\n $journal->void = 1;\n $journal->update();\n\n $journal = Journal::findOrFail($cont->debit_journal_id);\n $journal->void = 1;\n $journal->update();\n }\n\n\t\t$contribution = new Contribution;\n\t\t$contribution->member_id = $vehicle->member_id;\n\t\t$contribution->tlbpayment_id = $id;\n\t\t$contribution->amount = str_replace( ',', '', Input::get('amount'));\n\t\t$contribution->date = Input::get('date');\n\t\t$contribution->type = 'debit';\n\t\t$contribution->void = 0;\n\t\t$contribution->save();\n*/\n\t\t$data = array(\n\t\t\t 'equity_update_credit_account' => $tlb->equity_credit_journal_id,\n\t\t\t 'equity_update_debit_account' => $tlb->equity_debit_journal_id,\n\t\t\t\t\t\t'equity_member_credit_account' => Input::get('eq_id'),\n\t\t\t\t\t\t'equity_member_debit_account' => Input::get('asset_id'),\n\t\t\t\t\t\t'amount' => str_replace( ',', '', Input::get('amount')),\n\t\t\t\t\t\t'initiated_by' => 'system',\n\t\t\t\t\t\t'date'=>Input::get('date'),\n\t\t\t\t\t\t'description' => 'TLB Payments',\n\t\t\t\t\t\t'tid'=>$tlb->id\n\t\t\t\t\t);\n\n\t\t\t\t\t$journal = new Journal;\n\n\n\t\t\t\t\t$journal->journal_updateequity($data);\n\n\t\treturn Redirect::route('tlbpayments.index');\n\t}", "function createTransaction( $db, $tx_data, $wallet_id ) {\r\n // Insert the transaction data\r\n $db->insert( 'transactions', $tx_data );\r\n // TODO: Record this transaction in the logs\r\n // Now get the current wallet balance\r\n $current_balance = $db->get( 'wallets','balance',[ 'id' => $wallet_id ]);\r\n // Update the wallet with the new Balance\r\n $db->update( 'wallets',\r\n [\r\n 'balance[+]' => $tx_data['amount'],\r\n 'activated' => 1\r\n ],\r\n [ 'id' => $wallet_id ]\r\n );\r\n // If all went well, return an array with the transaction status\r\n return [\r\n 'success' => true,\r\n 'data' => [\r\n 'ref_no' => $tx_data['ref_no'],\r\n 'prev_bal' => $current_balance,\r\n 'currency' => $tx_data['currency'],\r\n 'new_bal' => ( $current_balance + $tx_data['amount'] )\r\n ]\r\n ];\r\n}", "public function update(Request $request, Transaction $transaction)\n {\n $validatedData = $request->validate([\n 'client_id' => ['required', 'max:50'],\n 'transaction_date' => ['required', 'max:50'],\n 'amount' => ['required', 'numeric'],\n ]);\n\n $validatedData['amount'] = $this->validateTransactionAmount($request->submit, $request->client_id, $request->amount);\n $transaction->update($validatedData);\n return redirect()->route('transaction.index')\n ->with('success', 'Transaction updated successfully');\n }", "public function setTransactionUid ($transUid);", "function update_bank_account($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"bankaccounts\n SET beneficiary_account_name = '\" . $ilance->db->escape_string($form['beneficiary_account_name']) . \"',\n\t\t\t destination_currency_id = '\" . intval($form['destination_currency_id']) . \"',\n\t\t\t beneficiary_bank_name = '\" . $ilance->db->escape_string($form['beneficiary_bank_name']) . \"',\n\t\t\t beneficiary_account_number = '\" . $ilance->db->escape_string($form['beneficiary_account_number']) . \"',\n\t\t\t beneficiary_bank_routing_number_swift = '\" . $ilance->db->escape_string($form['beneficiary_bank_routing_number_swift']) . \"',\n\t\t\t bank_account_type = '\" . $ilance->db->escape_string($form['bank_account_type']) . \"',\n\t\t\t beneficiary_bank_address_1 = '\" . $ilance->db->escape_string($form['beneficiary_bank_address_1']) . \"',\n\t\t\t beneficiary_bank_address_2 = '\" . $ilance->db->escape_string($form['beneficiary_bank_address_2']) . \"',\n\t\t\t beneficiary_bank_city = '\" . $ilance->db->escape_string($form['beneficiary_bank_city']) . \"',\n\t\t\t beneficiary_bank_state = '\" . $ilance->db->escape_string($form['beneficiary_bank_state']) . \"',\n\t\t\t beneficiary_bank_zipcode = '\" . $ilance->db->escape_string($form['beneficiary_bank_zipcode']) . \"',\n\t\t\t beneficiary_bank_country_id = '\" . intval($form['beneficiary_bank_country_id']) . \"'\n WHERE bank_id = '\".intval($form['bankid']).\"'\n AND user_id = '\" . intval($userid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n return true;\n }", "private static function logTransactionUpdateBalance($userId,$transactionType,$amount){\n if($transactionType != 'charge'){\n // Update User Balance\n $User = User::where('id',$userId)->select('id','balance')->first();\n if($transactionType == 'withdraw'){\n $User->balance = $User->balance - $amount;\n }\n if(in_array($transactionType,['refund','profit'])){\n $User->balance = $User->balance + $amount;\n }\n if($User->balance < 0){\n $User->balance = 0;\n }\n $User->save();\n }\n }", "public function update(TransactionRequest $request, int $id): JsonResponse\n {\n try {\n $updated = TransactionsService::update($request, $id);\n return response()->json($updated);\n } catch (\\Exception $e) {\n return response()->json($e);\n }\n }", "public function addTransactionId($id_order, $id_transaction)\r\n\t{\r\n\t\tif (version_compare(_PS_VERSION_, '1.5', '>='))\r\n\t\t{\r\n\t\t\t$new_order = new Order((int)$id_order);\r\n\t\t\tif (Validate::isLoadedObject($new_order))\r\n\t\t\t{\r\n\t\t\t\t$payment = $new_order->getOrderPaymentCollection();\r\n\t\t\t\tif (isset($payment[0]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$payment[0]->transaction_id = pSQL($id_transaction);\r\n\t\t\t\t\t$payment[0]->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function update_customer_balance($customer_id){\n\t\t$customer_id = sanitize($customer_id);\n\n\t\tmysqli_query_(\"UPDATE customers set `total_cash_in`=(SELECT sum(cash_in) FROM transactions WHERE customer_id='$customer_id'), `total_cash_out`=(SELECT sum(cash_out) FROM transactions WHERE customer_id='$customer_id'),`current_ksh_balance`=(SELECT sum(cash_in) FROM transactions WHERE customer_id='$customer_id') - (SELECT sum(cash_out) FROM transactions WHERE customer_id='$customer_id'),\n\n\t\t`total_dollar_in`=(SELECT sum(dollar_in) FROM transactions WHERE customer_id='$customer_id'), `total_dollar_out`=(SELECT sum(dollar_out) FROM transactions WHERE customer_id='$customer_id'),`current_dollar_balance`=(SELECT sum(dollar_in) FROM transactions WHERE customer_id='$customer_id') - (SELECT sum(dollar_out) FROM transactions WHERE customer_id='$customer_id') where customer_id='$customer_id' \");\n\n}", "public function request_transaction_status($host_obj, $transaction_id)\n\t\t{\n\t\t\t$this->init_braintree_environment($host_obj);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$transaction = Braintree_Transaction::find($transaction_id);\n\t\t\t\tif (!$transaction)\n\t\t\t\t\tthrow new Phpr_ApplicationException('Transaction not found');\n\n\t\t\t\treturn new Shop_TransactionUpdate(\n\t\t\t\t\t$transaction->status,\n\t\t\t\t\t$this->get_status_name($transaction->status)\n\t\t\t\t);\n\t\t\t} catch (Exception $ex)\n\t\t\t{\n\t\t\t\tthrow new Phpr_ApplicationException($this->get_exception_description($ex));\n\t\t\t}\n\t\t}", "public function update_tutor_fee($tid,$fee) {\n\t\t$sql = \"UPDATE profile SET money = money + {$fee} WHERE uid = {$tid} \";\n\t\t$query = $this->db->query($sql);\n\t}", "public static function updateStatePendent($id_transaction){\r\n\t$query = \"UPDATE transaction SET state = 0 WHERE\tid_transaction = '{$id_transaction}' \";\r\n\r\n\t$conn = connect();\r\n\tif(mysqli_query($conn, $query)){\r\n\r\n\t echo \"Upadate Transaction State Pendent guardado: \";\r\n\r\n }else{\r\n\r\n\t die (\"didn't query\".mysqli_error($conn));\r\n\t}\r\n\tmysqli_close($conn);\r\n }", "function update_customer($customer_id,$params){\n $this->company_db->update('tbl_customer', $params,array(\"id\"=>$customer_id)); \n }", "public function update(Request $request, $id)\n {\n $purchases = Purchase::findOrFail($id);\n $this->validate($request, [\n 'supplier_name' => 'required',\n 'payment_status' => 'required',\n 'net_loading_in_litres' => 'required',\n 'total_cost' => 'required|numeric',\n 'amount_paid' => 'required|numeric',\n 'balance' => 'required|numeric',\n 'payment_mode' => 'required',\n 'transaction_code' => 'required',\n 'transaction_date' => 'required'\n ]);\n $input=$request->all();\n \n $supplierName = Inventory::where(\"supplier_number\", \"=\", $request->supplier_name_from_inventory)->get();\n\n $supplierName=\"\";\n $transRefNo = \"SupplierPayment-\" . $id;\n $transaction = \\App\\Transaction::where('trn_ref_no', '=', $transRefNo)\n ->get();\n $trans= $transaction->toArray();\n $transaction = Transaction::findOrFail($trans[0]['id']);\n $transaction->delete();\n\n $transRefNo = \"SupplierPayment-(\" . $id.\")\";\n $transaction = \\App\\Transaction::where('trn_ref_no', '=', $transRefNo)\n ->get();\n $trans = $transaction->toArray();\n $transaction = Transaction::findOrFail($trans[0]['id']);\n $transaction->delete();\n\n\n $transaction = new Transaction();\n $transaction->trn_ref_no = \"SupplierPayment\" . \"-\" . $id;\n $transaction->transaction_date = $request->transaction_date;\n $transaction->product_type = $request->product_type;\n $transaction->liters = 0;\n $transaction->total_cost = 0;\n $transaction->amount_paid = $request->amount_paid;\n $transaction->balance = $request->balance;\n $transaction->narration = \"Payment to supplier\";\n\n $transaction->transaction_code = $request->transaction_code;\n $transaction->customer_name = \"\";\n $transaction->payment_status = $request->payment_status;\n $transaction->shortages = $request->shortages_in_litres;\n $transaction->unit_price = $request->price_per_litre;\n $transaction->posted_from = \"SupplierPayment\";\n $supplier = \"\";\n $transaction->supplier_name = $supplierName;\n $transaction->payment_mode = $request->payment_mode;\n $transaction->bank_name = $request->bank_name;\n $transaction->cheque_number = $request->cheque_number;\n $transaction->payment_status = $request->payment_status;\n $transaction->account_number = $request->account_number;\n $transaction->save();\n\n\n $transaction = new Transaction();\n $transaction->trn_ref_no = \"SupplierPayment\" . \"-(\" . $id . \")\";\n $transaction->transaction_date = $request->transaction_date;\n $transaction->product_type = $request->product_type;\n $transaction->liters = 0;\n $transaction->total_cost = 0;\n $transaction->amount_paid = $request->total_shortage;\n $transaction->balance = 0;\n $transaction->narration = \"shortage\";\n $transaction->supplier_rate = $request->unit_price;\n $transaction->shortages = $request->shortages_in_litres;\n $transaction->transaction_code = $request->transaction_code;\n $transaction->customer_name = \"\";\n $transaction->payment_status = $request->payment_status;\n $transaction->shortages = $request->shortages_in_litres;\n $transaction->unit_price = $request->price_per_litre;\n $transaction->posted_from = \"SupplierPayment\";\n $supplier = \"\";\n $transaction->supplier_name = $supplierName;\n $transaction->payment_mode = $request->payment_mode;\n $transaction->bank_name = $request->bank_name;\n $transaction->cheque_number = $request->cheque_number;\n $transaction->payment_status = $request->payment_status;\n $transaction->account_number = $request->account_number;\n $transaction->save();\n\n\n \n $purchases->update($input);\n\n\n \n Session::flash('flash_message', 'Record successfully Updated!');\n\n return redirect()->back();\n }", "private static function updateTransaction($data)\n {\n global $db;\n\n try {\n $fields = implode(', ', array_map(\n function ($v, $k) {\n return sprintf(\"`%s` = '%s'\", $k, $v);\n },\n $data,\n array_keys(\n $data\n )\n ));\n\n $db->Execute(\"\n\t\t\t\tUPDATE\n\t\t\t\t\t`\" . static::$table_name . \"`\n\t\t\t\tSET\n\t\t\t\t\t\" . $fields . \"\n\t\t\t\tWHERE\n\t\t\t\t `unique_id` = '\" . $data['unique_id'] . \"'\n\t\t\t\");\n } catch (\\Exception $exception) {\n //$this->logEx($exception);\n }\n }", "public function update_transaction_record($data, $id){\n\t\t$this->db->where('transaction_id', $id);\n\t\tif( $this->db->update('tat_finance_transaction',$data)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->TransactionNumber]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update_tgnumber() {\n $tenant_id = $this->tenant_id;\n extract($_POST);\n $payid = $this->classtraineemodel->get_payid_for_class_user($class, $user);\n $invoice = $this->classtraineemodel->get_allinvoice($tenant_id, $payid);\n $tg = $this->classtraineemodel->get_tg_number($tenant_id, $payid, $user);\n $result = $this->classtraineemodel->update_tgnumber($tenant_id, $payid, $tg_number, $user);\n if ($result == TRUE) {\n if($tg != ''){\n $data = array('user_id'=>$user,'class_id'=>$class,'payment_due_id'=>$payid,'tg'=>$tg);\n $previous_data = json_encode($data);\n user_activity(18, $user, $previous_data);\n }\n $this->db->cache_delete_all();\n echo 'success';\n } else {\n echo 'Fail';\n }\n exit();\n }", "public function update(Request $request, $id)\n {\n\n \t@ini_set('max_execution_time', 0);\n\t\t@set_time_limit(0);\n\t\t\n\t\t$validator = Validator::make($request->all(), [\n\t\t\t'method' => '',\n\t\t\t'amount' => 'required|numeric',\n\t\t\t'account_id' => 'required',\n\t\t\t'status' => 'required',\n\t\t\t'user_id' => 'required'\n\t\t]);\n\t\t\n\t\tif ($validator->fails()) {\n\t\t\tif($request->ajax()){ \n\t\t\t return response()->json(['result'=>'error','message'=>$validator->errors()->all()]);\n\t\t\t}else{\n\t\t\t\treturn redirect()->route('deposit.edit', $id)\n\t\t\t\t\t\t\t->withErrors($validator)\n\t\t\t\t\t\t\t->withInput();\n\t\t\t}\t\t\t\n\t\t}\n\t\n \t\n\t\tDB::beginTransaction();\n\n $deposit = Deposit::find($id);\n\t\t//$deposit->method = $request->input('method');\n\t\t$deposit->amount = $request->input('amount');\n\t\t$deposit->account_id = $request->input('account_id');\n\t\t$deposit->note = $request->input('note');\n\t\t$deposit->status = $request->input('status');\n\t\t$deposit->user_id = $request->input('user_id');\n\t\n $deposit->save();\n\t\t\n\t\t//Update Transaction\n\t\t$transaction = Transaction::where('ref_id',$id)\n\t\t\t\t\t\t\t\t ->where('type','deposit')->first();\n\t\t$transaction->user_id = $request->input('user_id');\n\t\t$transaction->amount = $request->input('amount');\n\t\t$transaction->account_id = $request->input('account_id');\n\t\t$transaction->dr_cr = 'cr';\n\t\t$transaction->type = 'deposit';\n\t\t\n\t\tif($request->input('status') == 0){\n\t\t\t$transaction->status = 'pending';\n\t\t}else if($request->input('status') == 1){\n\t\t\t$transaction->status = 'complete';\n\t\t}else if($request->input('status') == 2){\n\t\t\t$transaction->status = 'cancel';\n\t\t}\n\t\t\n\t\t$transaction->note = $request->input('note');\n\t\t$transaction->updated_by = Auth::id();\n\t\n $transaction->save();\n\n DB::commit();\n\t\t\n\t\t//Prefix Output\n\t\tif($deposit->status == 0){\n\t\t\t$deposit->status = \"<span class='badge badge-warning'>\"._lang('Pending').\"</span>\";\n\t\t}else if($deposit->status == 1){\n\t\t\t$deposit->status = \"<span class='badge badge-success'>\"._lang('Completed').\"</span>\";\n\t\t}else if($deposit->status == 2){\n\t\t\t$deposit->status = \"<span class='badge badge-danger'>\"._lang('Canceled').\"</span>\";\n\t\t}\n\t\t\n\t\t$deposit->account_id = $deposit->account->account_number.' ('.$deposit->account->account_type->currency->name.')';\n\t\t$deposit->user_id = $deposit->user->first_name.' '.$deposit->user->last_name;\n\t\t$deposit->amount = decimalPlace($deposit->amount);\n\t\t\n\t\t\n\t\tif(! $request->ajax()){\n return redirect()->route('deposit.index')->with('success', _lang('Updated Sucessfully'));\n }else{\n\t\t return response()->json(['result'=>'success','action'=>'update', 'message'=>_lang('Updated Sucessfully'),'data'=>$deposit]);\n\t\t}\n\t \n }", "function pay($refNumber, $amount, $currency, $transactionID = \"\", $locale = \"en\") {\n\t\t\t\n\t\t\tif (empty($refNumber) || empty($amount) || empty($currency)) {\n\t\t\t\techo \"[ERROR] refNumber, amount and currency is REQUIRED\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userAddress)) {\n\t\t\t\techo \"[ERROR] Please set userAddress\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userCity)) {\n\t\t\t\techo \"[ERROR] Please set userCity\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userEmail)) {\n\t\t\t\techo \"[ERROR] Please set userEmail\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userFirstName)) {\n\t\t\t\techo \"[ERROR] Please set userFirstName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userLastName)) {\n\t\t\t\techo \"[ERROR] Please set userLastName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\n\t\t\tif (empty($transactionID)) {\n\t\t\t\t$transactionID = uniqid();\n\t\t\t}\n\t\t\t\n\t\t\t$url = \"https://testsecureacceptance.cybersource.com/pay\";\n\t\t\tif($this->isLive) {\n\t\t\t\t$url = \"https://secureacceptance.cybersource.com/pay\";\n\t\t\t}\n\t\t\t\n\t\t\t$arr = array(\n\t\t\t\t'access_key' => $this->accessKey,\n\t\t\t\t'profile_id' => $this->profileID,\n\t\t\t\t'locale' => $locale,\n\t\t\t\t'transaction_uuid' => $transactionID,\n\t\t\t\t'signed_field_names' => $this->signVariables,\n\t\t\t\t'unsigned_field_names' => $this->unsign,\n\t\t\t\t'signed_date_time' => gmdate(\"Y-m-d\\TH:i:s\\Z\"),\n\t\t\t\t'transaction_type' => \"sale\",\n\t\t\t\t'reference_number' => $refNumber,\n\t\t\t\t'auth_trans_ref_no' => $refNumber,\n\t\t\t\t'merchant_descriptor' => \"Pixil\",\n\t\t\t\t'amount' => $amount,\n\t\t\t\t'currency' => strtoupper($currency),\n\t\t\t\t'bill_to_address_city' => $this->userCity,\n\t\t\t\t'bill_to_address_country' => $this->userCountry,\n\t\t\t\t'bill_to_email' => $this->userEmail,\n\t\t\t\t'bill_to_address_line1' => $this->userAddress,\n\t\t\t\t'bill_to_forename' => $this->userFirstName,\n\t\t\t\t'bill_to_surname' => $this->userLastName,\n\t\t\t\t'bill_to_address_line2' => \"\",\n\t\t\t\t'bill_to_address_state' => \"\",\n\t\t\t\t'bill_to_address_postal_code' => \"\",\n\t\t\t\t'bill_to_phone' => \"\"\n\t\t\t);\n\t\t\t\n\t\t\tif (!empty($this->mdd1)) {\n\t\t\t\t$arr['merchant_defined_data1'] = $this->mdd1;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data1\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd2)) {\n\t\t\t\t$arr['merchant_defined_data2'] = $this->mdd2;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data2\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd3)) {\n\t\t\t\t$arr['merchant_defined_data3'] = $this->mdd3;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data3\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd4)) {\n\t\t\t\t$arr['merchant_defined_data4'] = $this->mdd4;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data4\";\n\t\t\t}\n\t\t\t\n\t\t\t$signature = $this->sign($arr);\n\t\t\t\n\t\t\t$html = \"<html><head></head><body><form action='$url' method='post'/>\"; \n\t\t\tforeach($arr as $key => $value) {\n\t\t\t\t$html .= \"<input type='hidden' name='$key' value='$value' />\";\n\t\t\t}\n\t\t\t\n\t\t\t$html .= \"<input type='hidden' name='signature' value='$signature' />\";\n\t\t\t\n\t\t\t$html .= \"</form>\";\n\t\t\t$html .= \"<script type='text/javascript'>\";\n\t\t\t$html .= \"setTimeout(function() { document.forms[0].submit(); }, 2000);\";\n\t\t\t$html .= \"</script>\";\n\t\t\t$html .= \"</body>\";\n\t\t\techo $html;\n\t\t}", "function update_contrato($contrato_id,$params)\n {\n $this->db->where('contrato_id',$contrato_id);\n return $this->db->update('contrato',$params);\n }", "function update_costumer($id_costumer,$params)\n {\n $this->db->where('id_costumer',$id_costumer);\n return $this->db->update('costumer',$params);\n }", "public function update($id)\n\t{\n\t\t$debt = Debt::find($id);\n\t\t$debt->payerId = $this->user->id;\n $debt->payeeId = (int) Input::get('payeeId');\n $debt->description = Input::get('description');\n $debt->amount = Input::get('amount');\n $validator = Validator::make($debt->toArray(), Debt::$rules);\n if($validator->passes() && $debt->push()) {\n return Redirect::action('DebtController@edit', array($id))\n ->with('message', 'Debt has been saved.');\n }\n return Redirect::action('DebtController@edit', array($id))\n ->with('message', 'Debt not saved.')\n ->withInput();\n\t}", "public function edit(Transaction $transaction)\n {\n $this->authorize('update', $transaction);\n }", "public function update(Request $request, $id)\n {\n //\n $gudang = Gudang::find($id);\n $gudang->item_id = $request->input('id_barang');\n if($request->input('tipe')=='Keluar'){\n $gudang->amount_out = $request->input('jumlah');\n }elseif ($request->input('tipe')=='Masuk') {\n $gudang->amount_in = $request->input('jumlah');\n }\n if($request->input('id_tank')){\n $gudang->tank_id = $request->input('id_tank');\n }\n $gudang->unit_price = $request->input('harga');\n $newprice = $request->input('harga')*$request->input('jumlah');\n $selisih = $gudang->price - $newprice; //untuk perhitungan ulang hutang piutang\n $gudang->price = $newprice;\n $gudang->type = $request->input('tipe');\n if($gudang->save()){\n $transaction_detail = TransactionDetails::find($gudang->transaction_detail_id);\n if ($transaction_detail) {\n $transaction_detail->amount = $gudang->price;\n\n if($request->input('tipe')=='Keluar'){\n $multiplier = 1;\n $transaction_detail->account_id = Barang::find($gudang->item_id)->sale_account_id;\n }elseif ($request->input('tipe')=='Masuk') {\n $multiplier = -1;\n $transaction_detail->account_id = Barang::find($gudang->item_id)->purchase_account_id;\n }\n\n if (!$transaction_detail->save())\n return redirect()->back()->with('merah','Opps! Ada masalah saat penambahan, silahkan ulangi.');\n\n $transaction_detail2 = TransactionDetails::where('transaction_id', $transaction_detail->transaction_id)\n ->where('item_id', null)\n ->first();\n $transaction_detail2->amount = (abs($transaction_detail2->amount) - $selisih) * $multiplier;\n if (!$transaction_detail2->save())\n return redirect()->back()->with('merah','Opps! Ada masalah saat penambahan, silahkan ulangi.');\n }\n return redirect()->route('barang.show',$gudang->item_id)->with('hijau','Penambahan data gudang berhasil.');\n\n }else{\n return redirect()->back()->with('merah','Opps! Ada masalah saat penambahan, silahkan ulangi.');\n }\n }", "function ciniki_poma_accountApplyCredit(&$ciniki, $tnid, $args) {\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'orderUpdateStatusBalance');\n\n //\n // Load tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $tnid);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_timezone = $rc['settings']['intl-default-timezone'];\n\n //\n // Load the last entry in the customer ledger\n //\n $strsql = \"SELECT id, balance \"\n . \"FROM ciniki_poma_customer_ledgers \"\n . \"WHERE customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"ORDER BY transaction_date DESC \"\n . \"LIMIT 1 \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'entry');\n if( $rc['stat'] != 'ok') {\n return $rc;\n }\n if( !isset($rc['entry']) ) {\n $balance = 0;\n } else {\n $balance = $rc['entry']['balance'];\n }\n\n //\n // Apply the credit to the balance\n //\n $new_balance = bcadd($balance, $args['customer_amount'], 6);\n $credit_balance = $args['customer_amount'];\n\n //\n // Load any unpaid invoices\n //\n $strsql = \"SELECT ciniki_poma_orders.id, \"\n . \"ciniki_poma_orders.total_amount, \"\n . \"ciniki_poma_orders.balance_amount \"\n . \"FROM ciniki_poma_orders \"\n . \"WHERE ciniki_poma_orders.customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND ciniki_poma_orders.payment_status > 0 \"\n . \"AND ciniki_poma_orders.payment_status < 50 \"\n . \"AND ciniki_poma_orders.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'invoice');\n if( $rc['stat'] != 'ok') {\n return $rc;\n }\n if( isset($rc['rows']) ) {\n $unpaid_orders = $rc['rows'];\n //\n // Check if orders will get payment amounts\n //\n foreach($unpaid_orders as $oid => $order) {\n //\n // Skip any orders that might be screwed up with a negative balance\n //\n if( $order['balance_amount'] < 0 ) { \n continue;\n }\n if( $order['balance_amount'] < $credit_balance ) {\n $unpaid_orders[$oid]['payment_amount'] = $order['balance_amount'];\n $credit_balance = bcsub($credit_balance, $order['balance_amount'], 6);\n } else {\n $unpaid_orders[$oid]['payment_amount'] = $credit_balance;\n $credit_balance = 0;\n }\n if( $credit_balance <= 0 ) {\n break;\n }\n }\n }\n\n //\n // Add the ledger entry\n //\n $args['balance'] = $new_balance;\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.customerledger', $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $entry_id = $rc['id'];\n\n //\n // Apply credit to invoice if open unpaid invoices\n //\n if( isset($unpaid_orders) ) {\n foreach($unpaid_orders as $order) {\n if( isset($order['payment_amount']) && $order['payment_amount'] > 0 ) {\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.orderpayment', array(\n 'order_id'=>$order['id'],\n 'ledger_id'=>$entry_id,\n 'payment_type'=>$args['transaction_type'],\n 'amount'=>$order['payment_amount'],\n ), 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rc = ciniki_poma_orderUpdateStatusBalance($ciniki, $tnid, $order['id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n }\n }\n \n return array('stat'=>'ok', 'id'=>$entry_id);\n}", "function buy_ticket($id_user,$number,$ticket_price)\n {\n $pdo = PDO2::getInstance();\n \n //Change usr_id column in number row in the table tbl_numbers\n $query = $pdo->prepare(\"UPDATE tbl_numbers SET usr_id = :usr_id WHERE id = :number\");\n $query->bindValue(\":usr_id\",$id_user);\n $query->bindValue(\":number\",$number);\n $query->execute();\n print_r($query->errorInfo());\n \n //Update the balance of the account\n\t$query = $pdo->prepare(\"UPDATE tbl_user SET user_balance = :new_balance WHERE user_id = :id_user\");\n\t$query->bindValue(\":new_balance\",user_balance($id_user)-$ticket_price);\n $query->bindValue(\":id_user\",$id_user);\n $query->execute();\n print_r($query->errorInfo());\n \n update_jackpot();\n }", "function update_tarifa($id_tarifa,$params)\n {\n $this->db->where('id_tarifa',$id_tarifa);\n return $this->db->update('tarifa',$params);\n }", "public function update(Request $request, $id)\n {\n $a=$request['balance'];\n $amount= str_replace(',','',$a) ;\n $account = AccountModel::find($id); //find the primary key of User table\n $action= $account->update ([\n 'ACCOUNT_NAME' => $request['name'],\n 'PARENT_ACCOUNT' => $request['type'],\n 'ACCOUNT_DESCRIPTION' => $request['naration'],\n 'AFFECTS' => implode(\",\",$request['affects']),\n 'ACCOUNT_BALANCE' => $amount,\n \n 'BALANCE_TYPE' => $request['balance_type'],\n 'BUSINESS_PERSON' => $request['people'],\n \n\n ]);\n \n if (!$action) {\n return redirect()->back()->with(\"error_message', 'Account successfully updated!\");\n \n }\n \n \n return \\Redirect::to('view_accounts');\n }", "public function setTxid($var)\n {\n GPBUtil::checkString($var, True);\n $this->txid = $var;\n\n return $this;\n }", "function update_tb_redacteur($redacteur_id,$params)\n {\n $this->db->where('redacteur_id',$redacteur_id);\n return $this->db->update('tb_redacteurs',$params);\n }", "public function actionUpdate($id) {\n $this->active_menu = \"mcms\";\n $this->open_class = \"category\";\n $this->active_class = \"piadmin\";\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Purchaseitem'])) {\n $model->attributes = $_POST['Purchaseitem'];\n $model->goods_service=$_POST['Purchaseitem']['goods_service'];\n if($_POST['Purchaseitem']['goods_service']==\"Good\"){\n $model->gst_code_type = 'HSN';\n }else{\n $model->gst_code_type = 'SAC';\n }\n $model->low_qty = $_POST['Purchaseitem']['low_qty'];\n $model->type = $_POST['Purchaseitem']['type'];\n $model->gst_code = $_POST['Purchaseitem']['gst_code']; \n $model->gst_percent = $_POST['Purchaseitem']['gst_percent'];\n $model->cess_tax = $_POST['Purchaseitem']['cess_tax'];\n $model->item_classification=$_POST['Purchaseitem']['item_classification'];\n $model->cess_percent=$_POST['Purchaseitem']['cess_percent'];\n if ($model->save()) {\n if (empty($model->barcode)) {\n $model->barcode = time() . $model->id;\n $model->save();\n }\n d21('Purchase Item updated by ' . Yii::app()->user->getUsername(), \"site.login\");\n $this->redirect(array('admin'));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function saveTransactionFromRequest($request_id,$message,$status,$adminccount)\n {\n list($count,$request) = Mp3music_Api_Cart::getFinanceAccountRequests(\"paymentrequest_id = \".$request_id,\"\",1,1);\n $re = $request[0];\n $insert_item = array($re['request_date'],$re['request_user_id'],$adminccount['user_id'],'','',$re['request_amount'],$re['request_payment_acount_id'],$adminccount['paymentaccount_id'],$status,'request') ;\n //print_r($insert_item); die;\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction(); \n $l_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music'); \n $list = $l_table->createRow();\n $list->transaction_date = $insert_item[0];\n $list->user_seller = $insert_item[1];\n $list->user_buyer = $insert_item[2];\n $list->item_id = $insert_item[3];\n $list->item_type = $insert_item[4];\n $list->amount = $insert_item[5];\n $list->account_seller_id = $insert_item[6];\n $list->account_buyer_id = $insert_item[7];\n $list->transaction_status = $insert_item[8];\n $list->params = $insert_item[9];\n $list->save();\n try {\n $db->commit();\n } catch (Exception $ex) {\n $db->rollback();\n break;\n } \n }", "function update_bill_detail($id,$params)\n {\n $this->db->where('id',$id);\n return $this->db->update('bill_detail',$params);\n }", "public function updated(Transaction $transaction)\n {\n if($transaction->isDirty('status')){\n $user = User::findOrFail($transaction->user_id);\n $status = $transaction->status;\n if($status == 'approved'){\n $user->notify(new TransactionNotification(explode(' ', $user->name)[0], false, false, true, $transaction));\n }elseif($status == 'declined'){\n $user->notify(new TransactionNotification(explode(' ', $user->name)[0], false, true, false, $transaction));\n }\n }\n }", "public function update(Request $request, Transaction $transaction)\n {\n // $validated = $request->validate([\n // 'sender_id' => 'required|string'\n // ]);\n\n // $transaction->update($validated);\n $transaction->update([\"received\" => true]);\n\n return response()->json([\n 'message' => 'Successfully updated transaction!'\n ]);\n }", "public function actionUpdate($id)\n {\n $request = Yii::$app->request;\n //$model = $this->findModel($id); \n $model = Transaksi::find()\n ->where(['no_ref'=>$id])\n ->orderBy(['id'=>SORT_ASC])\n ->one();\n\n $model2 = Transaksi::find()\n ->where(['no_ref'=>$id])\n ->orderBy(['id'=>SORT_DESC])\n ->one();\n\n $model->tanggal = Yii::$app->formatter->asDate($model->tanggal);\n //print_r($model2);\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n if($request->isGet){\n return [\n 'title'=> \"Ubah Transaksi\",\n 'content'=>$this->renderAjax('update', [\n 'model' => $model,\n 'idsubakun2' => $model2->idsubakun,\n 'nominal' => $model->kredit,\n ]),\n 'footer'=> Html::button('Tutup',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::button('Simpan',['class'=>'btn btn-primary','type'=>\"submit\"])\n ]; \n }else if($model->load($request->post())){\n $berhasil = 0;\n //echo $_POST['w1-disp'];\n \n $transaction = Yii::$app->db->beginTransaction();\n\n Yii::$app->db->createCommand()\n ->delete(\"transaksi\", [\"no_ref\" => $id])\n ->execute();\n \n //echo $_POST['Transaksi']['debetkredit'];\n if($_POST['Transaksi']['debetkredit']==\"debet\"){\n $modeltransaksi = new Transaksi();\n\n $modeltransaksi->idsubakun = $_POST['Transaksi']['idsubakun'];\n $modeltransaksi->idakundebet = $_POST['Transaksi']['idsubakun'];\n $modeltransaksi->ke_akun = $_POST['Transaksi']['idsubakun2'];\n $modeltransaksi->no_ref = $id;\n $modeltransaksi->kredit = str_replace(\",\", \"\", $_POST['w1-disp']);\n $modeltransaksi->keterangan = $_POST['Transaksi']['keterangan'];\n $modeltransaksi->tanggal = $this->convertTanggal($_POST['Transaksi']['tanggal']);\n //$modeltransaksi->tanggal = date('Y-m-d');\n if($modeltransaksi->save()){\n $modeltransaksi = new Transaksi();\n\n $modeltransaksi->idsubakun = $_POST['Transaksi']['idsubakun2'];\n $modeltransaksi->idakunkredit = $_POST['Transaksi']['idsubakun2'];\n $modeltransaksi->ke_akun = $_POST['Transaksi']['idsubakun'];\n $modeltransaksi->no_ref = $id;\n $modeltransaksi->debet = str_replace(\",\", \"\", $_POST['w1-disp']);\n $modeltransaksi->keterangan = $_POST['Transaksi']['keterangan'];\n $modeltransaksi->tanggal = $this->convertTanggal($_POST['Transaksi']['tanggal']);\n //$modeltransaksi->tanggal = date('Y-m-d');\n if($modeltransaksi->save()){\n $transaction->commit();\n $berhasil = 1;\n }\n \n }else{\n $transaction->rollBack();\n return [\n 'title'=> \"Tambah Transaksi\",\n 'content'=>$this->renderAjax('update', [\n 'model' => $model,\n 'idsubakun2' => $model2->idsubakun,\n 'nominal' => $model->kredit,\n ]),\n 'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::button('Save',['class'=>'btn btn-primary','type'=>\"submit\"])\n \n ];\n }\n \n }else{\n\n $modeltransaksi = new Transaksi();\n\n $modeltransaksi->idsubakun = $_POST['Transaksi']['idsubakun'];\n $modeltransaksi->idakundebet = $_POST['Transaksi']['idsubakun'];\n $modeltransaksi->no_ref = $id;\n $modeltransaksi->debet = str_replace(\",\", \"\", $_POST['w1-disp']);\n $modeltransaksi->keterangan = $_POST['Transaksi']['keterangan'];\n $modeltransaksi->tanggal = $this->convertTanggal($_POST['Transaksi']['tanggal']);\n //$modeltransaksi->tanggal = date('Y-m-d');\n if($modeltransaksi->save()){\n $modeltransaksi = new Transaksi();\n $modeltransaksi->idsubakun = $_POST['Transaksi']['idsubakun2'];\n $modeltransaksi->idakunkredit = $_POST['Transaksi']['idsubakun2'];\n $modeltransaksi->no_ref = $id;\n $modeltransaksi->kredit = str_replace(\",\", \"\", $_POST['w1-disp']);\n $modeltransaksi->keterangan = $_POST['Transaksi']['keterangan'];\n $modeltransaksi->tanggal = $this->convertTanggal($_POST['Transaksi']['tanggal']);\n //$modeltransaksi->tanggal = date('Y-m-d');\n if($modeltransaksi->save()){\n $transaction->commit();\n $berhasil = 1;\n }\n }else{\n $transaction->rollBack();\n return [\n 'title'=> \"Tambah Transaksi\",\n 'content'=>$this->renderAjax('update', [\n 'model' => $model,\n 'idsubakun2' => $model2->idsubakun,\n 'nominal' => $model->kredit,\n ]),\n 'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::button('Save',['class'=>'btn btn-primary','type'=>\"submit\"])\n \n ];\n }\n\n }\n\n //echo \"coba\";\n\n if($berhasil==1){\n return [\n 'forceReload'=>'#crud-datatable-pjax',\n 'title'=> \"Ubah Transaksi\",\n 'content'=>'<span class=\"text-success\">Ubah Transaksi Sukses</span>',\n 'footer'=> Html::button('Tutup',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"])\n ]; \n }else{\n return [\n 'title'=> \"Tambah Transaksi\",\n 'content'=>$this->renderAjax('create', [\n 'model' => $model,\n ]),\n 'footer'=> Html::button('Tutup',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::button('Simpan',['class'=>'btn btn-primary','type'=>\"submit\"])\n \n ]; \n }\n return [\n 'forceReload'=>'#crud-datatable-pjax',\n 'title'=> \"Transaksi\",\n 'content'=>$this->renderAjax('view', [\n 'model' => $model,\n //'model2' => $model2,\n ]),\n 'footer'=> Html::button('Tutup',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::a('Ubah',['update','id'=>$id],['class'=>'btn btn-primary','role'=>'modal-remote'])\n ]; \n }else{\n return [\n 'title'=> \"Ubah Transaksi\",\n 'content'=>$this->renderAjax('update', [\n 'model' => $model,\n 'idsubakun2' => $model2->idsubakun,\n 'nominal' => $model->kredit,\n ]),\n 'footer'=> Html::button('Tutup',['class'=>'btn btn-default pull-left','data-dismiss'=>\"modal\"]).\n Html::button('Simpan',['class'=>'btn btn-primary','type'=>\"submit\"])\n ]; \n }\n }else{\n /*\n * Process for non-ajax request\n */\n // if ($model->load($request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->id]);\n // } else {\n return $this->render('update', [\n 'model' => $model,\n 'idsubakun2' => $model2->idsubakun,\n 'nominal' => $model->kredit,\n ]);\n //}\n }\n }", "public function update(Request $request, $id)\n {\n //\n $purchases=PurchaseTransaction::find($id);\n !is_null($request->input('quantity'))?$purchases->quantity=$request->input('quantity'):$purchases->quantity;\n !is_null($request->input('unitPrice'))?$purchases->unitPrice=$request->input('unitPrice'):$purchases->unitPrice;\n !is_null($request->input('totalPrice'))?$purchases->totalPrice=$request->input('totalPrice'):$purchases->totalPrice;\n !is_null($request->input('date_time'))?$purchases->date_time=$request->input('date_time'):$purchases->date_time;\n $success=$purchases->update();\n if(!$success){\n return response()->json('error updating',500);\n } return response()->json('success',200);\n }" ]
[ "0.606023", "0.6050707", "0.5745061", "0.5736575", "0.5670777", "0.5571383", "0.5542231", "0.5538094", "0.547956", "0.5417745", "0.54023594", "0.5401341", "0.5371702", "0.53282005", "0.5312786", "0.53033274", "0.52986866", "0.5274729", "0.52730805", "0.5271253", "0.5269266", "0.5263792", "0.5263792", "0.52592295", "0.5249812", "0.52466553", "0.52333426", "0.5213109", "0.518721", "0.5167158", "0.5161499", "0.51599854", "0.5155183", "0.5146944", "0.5136695", "0.51299673", "0.51245904", "0.51014304", "0.51014304", "0.51014304", "0.51014304", "0.5085319", "0.50837123", "0.5078354", "0.50778675", "0.50737995", "0.50654584", "0.50654584", "0.50654584", "0.50654584", "0.50558513", "0.504711", "0.5045644", "0.50446177", "0.50422215", "0.50348425", "0.5025777", "0.50180686", "0.5017282", "0.5016622", "0.50130945", "0.5004988", "0.50031", "0.49996075", "0.49931473", "0.4991581", "0.49795654", "0.4975893", "0.4965774", "0.49640578", "0.49610475", "0.4956722", "0.4932077", "0.4929619", "0.49277318", "0.4921172", "0.49137053", "0.49074852", "0.49025857", "0.49009016", "0.48986736", "0.48910913", "0.4877836", "0.48661876", "0.48550603", "0.48536003", "0.48523664", "0.48470512", "0.4844288", "0.48433062", "0.48230332", "0.48216525", "0.48210564", "0.48164558", "0.48114607", "0.48070586", "0.48007235", "0.47998822", "0.47954607", "0.47908482" ]
0.56300217
5
This command is used retrieve a list of payment methods available. Parameters: None Optional Parameters: none See:
public function whmcs_get_payment_methods($params = array()) { $params['action'] = 'GetPaymentMethods'; // return Whmcs_base::send_request($params); $load = new Whmcs_base(); return $load->send_request($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAvailablePaymentMethods ();", "protected function getAllAvailableMethods()\n {\n /* TODO get all available payment methods from toolbox */\n }", "public function iN_PaymentMethods() {\n\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_payment_methods WHERE payment_method_id = '1'\") or die(mysqli_error($this->db));\n\t\t$data = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn $data;\n\t}", "function paymentmethods() {\r\n $db = JFactory::getDBO();\r\n $query = \"SELECT id,payment_method,status FROM #__em_paymentmethod\";\r\n $db->setQuery($query);\r\n $result = $db->loadObjectList();\r\n return $result;\r\n }", "public function get_payment_methods()\n\t{\n\t\t//retrieve all invoice\n\t\t$this->db->from('payment_method');\n\t\t$this->db->select('*');\n\t\t$this->db->order_by('payment_method_name');\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "public static function listPaymentMethods()\n {\n return [\n [\n 'id' => self::PAYMENT_BY_CASH,\n 'name' => 'Tiền mặt',\n ],\n [\n 'id' => self::PAYMENT_BY_CONTRACT,\n 'name' => 'Hợp đồng',\n ],\n ];\n }", "public function get_payment_methods()\n\t{\n\t\t//retrieve all orders\n\t\t$this->db->from('payment_method');\n\t\t$this->db->select('*');\n\t\t$this->db->order_by('payment_method_name');\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "public function getPaymentMethods() {\r\n\t\t//@TODO: Insert PaymentMethods into the datebase, create table\r\n\t\t$payment_methods = array();\r\n\t\t\t$payment_methods[0] = array('id' => 0, 'name' => 'AMEX');\r\n\t\t\t$payment_methods[1] = array('id' => 1, 'name' => 'Discover');\r\n\t\t\t$payment_methods[2] = array('id' => 2, 'name' => 'Mastercard');\r\n\t\t\t$payment_methods[3] = array('id' => 3, 'name' => 'Visa');\r\n\t\t\t$payment_methods[4] = array('id' => 4, 'name' => 'Store Credit');\r\n\t\t\t$payment_methods[5] = array('id' => 5, 'name' => 'Check');\r\n\t\t\t$payment_methods[6] = array('id' => 6, 'name' => 'Wire Transfer');\r\n\t\t\t$payment_methods[7] = array('id' => 7, 'name' => 'Trade');\r\n\t\t\t$payment_methods[9] = array('id' => 9, 'name' => 'Cash');\r\n\t\treturn $payment_methods; //array\r\n\t}", "public function getPaymentAction()\n {\n $builder = Shopware()->Models()->createQueryBuilder();\n $builder->select(['payment'])\n ->from('Shopware\\Models\\Payment\\Payment', 'payment');\n\n $paymentMethods = $builder->getQuery()->getArrayResult();\n\n $languageId = $this->getBackendLanguage();\n\n foreach ($paymentMethods as &$paymentMethod) {\n $paymentMethod = $this->translatePayment($paymentMethod, $languageId);\n }\n\n $total = count($paymentMethods);\n\n $this->view->assign(\n [\n 'data' => $paymentMethods,\n 'total' => $total,\n 'success' => true\n ]\n );\n }", "abstract public function getPaymentMethod();", "public function methods()\n {\n return collect(Paymentmethods::getList());\n }", "public function get_payment_methods() {\n\t\treturn $this->get_supported_payment_methods();\n\t}", "abstract public function getPaymentDrivers();", "public function toOptionArray()\n {\n $methods = [];\n\n //default empty value\n $methods[] = [\"value\" => \"\", \"label\" => __(\"Accept all payment methods\")];\n $accessToken = $this->scopeConfig->getValue(\\MercadoPago\\Core\\Helper\\ConfigData::PATH_ACCESS_TOKEN, \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE, $this->_switcher->getWebsiteId());\n\n if (empty($accessToken)) {\n return $methods;\n }\n\n $this->coreHelper->log(\"GET /v1/payment_methods\", 'mercadopago');\n\n try {\n $response = \\MercadoPago\\Core\\Lib\\RestClient::get(\"/v1/payment_methods\", null, [\"Authorization: Bearer \" . $accessToken]);\n } catch (\\Exception $e) {\n $this->coreHelper->log(\"PaymentMethodsTicket:: An error occurred at the time of obtaining the ticket payment methods: \" . $e);\n return [];\n }\n\n if (isset($response['error']) || (isset($response['status']) && ($response['status'] != '200' && $response['status'] != '201'))) {\n return $methods;\n }\n\n $response = $response['response'];\n\n foreach ($response as $pm) {\n if (isset($pm['payment_type_id']) && $pm['payment_type_id'] == \"ticket\" || $pm['payment_type_id'] == \"atm\") {\n $methods[] = [\n 'value' => $pm['id'],\n 'label' => __($pm['name'])\n ];\n }\n }\n\n $this->coreHelper->log(\"PaymentMethodsTicket:: Displayed\", 'mercadopago', $methods);\n\n return $methods;\n }", "public static function getPaymentMethods() {\n\n // return array(\n // self::PAYMENT_METHOD_PAY_PAL => 'Pay Pal',\n // self::PAYMENT_METHOD_MONEY_BOOKERS => 'Skrill',\n // self::PAYMENT_METHOD_WIRE_TRANSFER => 'Wiretransfer',\n // );\n\n $payment_methods = array();\n\n if(Option::getByName('payment_method_paypal')) \n $payment_methods[self::PAYMENT_METHOD_PAY_PAL] = 'Pay Pal';\n\n if(Option::getByName('payment_method_skrill')) \n $payment_methods[self::PAYMENT_METHOD_MONEY_BOOKERS] = 'Skrill';\n\n if(Option::getByName('payment_method_wiretransfer') && Option::getByName('wiretransfer_doc_path')) \n $payment_methods[self::PAYMENT_METHOD_WIRE_TRANSFER] = 'Wiretransfer';\n\n if(Option::getByName('payment_method_check')) \n $payment_methods[self::PAYMENT_METHOD_CHECK] = 'Check';\n\n if(Option::getByName('payment_method_no_payment')) \n $payment_methods[self::PAYMENT_METHOD_NO_PAYMENT] = 'No Payment';\n\n return $payment_methods;\n }", "public function getAllPaymentMethods($asArray = false) {\r\n $jsonMethods = array();\r\n $methods = array();\r\n $model = new Mage_Checkout_Block_Onepage_Payment_Methods();\r\n $quote = Mage::getSingleton('checkout/cart')->getQuote();\r\n try {\r\n $selectedPaymentMethod = $quote->getPayment()->getData('method');\r\n } catch (Exception $e) {\r\n $this->logException($e, 'Get payment method');\r\n $this->_JSONencodeAndRespond(array(\"title\" => \"Error\", \"content\" => $e->getMessage()));\r\n return;\r\n }\r\n foreach ($model->getMethods() as $method) {\r\n $methodTitle = $method->getTitle();\r\n $methodCode = $method->getCode();\r\n if ($methodCode == \"paypal_express\") { // PayPal. Has logo and strange label text, override\r\n $methodTitle = \"PayPal\";\r\n }\r\n\r\n //eLabelz specific fix\r\n if ($methodCode == 'msp_cashondelivery') {\r\n $methodTitle .= \" – \" . Mage::helper('core')->currency($quote->getMspCashondeliveryInclTax(), true, false);\r\n }\r\n\r\n $m = array(\r\n 'type' => 'option',\r\n 'title' => $methodTitle,\r\n 'code' => $methodCode,\r\n 'price' => $this->getPaymentMethodPrice($methodCode),\r\n // Payment fee (price) is not available for standard payment methods, for extensions this need to be individualy coded\r\n 'image' => null,\r\n 'options' => $this->_getSuboptionsForPaymentMethod($methodCode),\r\n );\r\n $methods[] = $m;\r\n }\r\n if ($asArray)\r\n return $methods;\r\n $jsonMethods['payment_methods'] = $methods;\r\n\r\n return $jsonMethods;\r\n }", "public function getPaymentMethod()\n {\n \n //Fill POST fields array\n $ipPostFields = [\n 'InvoiceAmount' => session()->get('total_price'),\n 'CurrencyIso' => 'KWD'\n ];\n \n //Call endpoint\n $paymentMethods = $this->initiatePayment($this->apiURL, $this->apiKey, $ipPostFields);\n \n \n return view('site.payment.checkout', compact('paymentMethods')); // redirect to the pay method in the service classe with the paymentmedthod id\n \n \n }", "public function getPaymentMethods()\n {\n return $this->payment_methods;\n }", "public function testIsPaymentMethodGettable()\n {\n $response = [self::PAYMENT_METHOD_RESPONSE];\n\n $this->stubRequest(\n 'GET',\n '/payment_methods?customer_id=' . self::CUSTOMER_ID,\n [],\n [],\n $response\n );\n\n $result = DirectDebit::getPaymentMethodsByCustomerID(\n self::CUSTOMER_ID\n );\n\n $this->assertEquals($response, $result);\n }", "public function getInstalledPaymentMethods() {\r\n\t\t// load internal names of installed payment methods\r\n\t\t$this->load->model('setting/extension');\r\n\t\t$paymentCodeList = $this->model_setting_extension->getInstalled('payment');\r\n\r\n\t\t// Get description name of payment methods.\r\n\t\t// It must implemented inline because there is no model method for it.\r\n\t\t// Based on implementation in method getList in class ControllerExtensionExtensionPayment\r\n\t\t$paymentMethods = [];\r\n\t\tforeach ($paymentCodeList as $paymentCode) {\r\n\t\t\t// check if main file of extension exists\r\n\t\t\t$mainFilePath = DIR_APPLICATION . 'controller/extension/payment/' . $paymentCode . '.php';\r\n\t\t\tif (!file_exists($mainFilePath)) {\r\n\t\t\t\tcontinue; // extension is registered as installed, but file is missing\r\n\t\t\t}\r\n\r\n\t\t\t// load description name of payment method from language file of extension\r\n\t\t\t$this->load->language('extension/payment/' . $paymentCode, 'extension');\r\n\t\t\t$extensionName = $this->language->get('extension')->get('heading_title');\r\n\r\n\t\t\t$paymentMethods[] = [\r\n\t\t\t\t'code' => $paymentCode,\r\n\t\t\t\t'name' => $extensionName\r\n\t\t\t];\r\n\t\t}\r\n\r\n\t\treturn $paymentMethods;\r\n\t}", "public function getPaymentMethods(Request $request){\n error_log(\"Request for getPaymentMethods $request\");\n\n $params = array(\n \"merchantAccount\" => env('MERCHANT_ACCOUNT'),\n \"channel\" => \"Web\"\n );\n\n $response = $this->checkout->paymentMethods($params);\n\n return $response;\n }", "public function getPaymentMethodsForCod()\n {\n return $this->_toArrayObject($this->getConfig(\n 'packages/global_settings_payments-for-cod'));\n }", "public static function getPaymentMethods()\n {\n return [\n static::MAIL,\n static::DIRECT_DEPOSIT,\n ];\n }", "public function index()\n\t\t{\n\t\t\t$payment_methods = DB::table('payment_methods')\n\t\t\t\t\t\t\t\t->orderBy('payment_methods.ordering', 'desc')\n\t \t->paginate(10);\n\n\t\t\treturn View::make('admin.payment_methods.payment-methods')\n\t\t\t\t\t\t\t\t->with('payment_methods', $payment_methods);\n\t\t}", "protected function _getPaymentMethodsHtml()\n {\n return $this->_getHtmlByHandle('checkout_onepage_paymentmethod');\n }", "static function listPaymentMethods($config)\n {\n if ($config == NULL) {\n WebPay::throwMissingConfigException();\n }\n\n return new ListPaymentMethods($config);\n }", "public function getSupportedPaymentTypes()\n {\n return [PaymentMethod::PAYPAL];\n }", "public function getPaymentOption() {\r\n $query = $this->db->get('v_combo_payment_method');\r\n \r\n if( $query->num_rows() > 0 ) {\r\n return $query->result();\r\n } else {\r\n return array();\r\n }\r\n }", "protected function getPaymentMethodsRequest()\n {\n $resourcePath = '/payment-methods';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public static function payment_methods() {\n return array(\n CheckfrontModule::PaymentPayNow => 'Pay now',\n CheckfrontModule::PaymentPayLater => 'Pay later'\n );\n }", "public static function getAllPaymentMethods()\n {\n $methods = [];\n $directory = __DIR__ . DIRECTORY_SEPARATOR . 'Method';\n $files = scandir($directory);\n foreach ($files as $file) {\n $file = $directory . DIRECTORY_SEPARATOR . $file;\n\n $info = pathinfo($file);\n if (!isset($info['extension']) || $info['extension'] !== 'php') {\n continue;\n }\n\n $class_name = basename($info['filename'], '.php');\n if (in_array($class_name, ['AbstractMethod'])) {\n continue;\n }\n\n $methods[] = $class_name;\n }\n\n return $methods;\n }", "function getRegisteredPaymentMethods()\n{\n\tglobal $registeredPaymentMethods;\t\n\n\tforeach ($registeredPaymentMethods as $paymentMethod => $className)\n\t{\n\t\t$pmObj = Service_PaymentMethodsFactory::getInstance($paymentMethod);\n\t\tif($pmObj->isUIEnabled() == 'y')\n\t\t{\n\t\t\t$paymentMethodkeyLabels[$paymentMethod] = $pmObj->getPaymentMethodLabel();\n\t\t}\n\t}\n\t\n\treturn $paymentMethodkeyLabels;\t\n}", "public function get_methods(Cart $cart);", "public static function getPaymentMethods($exclude_cash = false) {\n\t\treturn $exclude_cash ?\n\t\t\tArrayHelper::map(Parameter::find()->where(['domain'=>'payment'])->andWhere(['not', ['name' => Payment::CASH]])->orderBy('value_int')->asArray()->all(), 'name', 'value_text')\n\t\t\t:\n\t\t\tArrayHelper::map(Parameter::find()->where(['domain'=>'payment'])->orderBy('value_int')->asArray()->all(), 'name', 'value_text')\n\t\t\t;\n\t}", "function get_organizer_payment_methods($organizer = NULL){\n\t\t$query = \"SELECT distinct(payment_key),payment_method_name\";\n\t\t$query .= \" FROM \" . $this->config->item('ems_organizer_payment_settings','dbtables');\n\t\t$query .= \" WHERE organizer_id = $organizer AND status = 1\";\n\n\t\t$res = $this->db->query($query);\n\t\t$resArr = $res->result_array();\n\n\t\tif(!empty($resArr)){\n\t\t\treturn $resArr;\n\t\t}else{\n\t\t\t$data = array();\n\t\t\treturn $data;\n\t\t}\n\t}", "public function getCardsPaymentMethods()\n {\n $payment_methods = Mage::getModel('mercadopago/core')->getPaymentMethods();\n $payment_methods_types = array(\"credit_card\", \"debit_card\", \"prepaid_card\");\n $types = array();\n\n //percorre todos os payments methods\n foreach ($payment_methods['response'] as $pm) {\n\n //filtra por payment_methods\n if (in_array($pm['payment_type_id'], $payment_methods_types)) {\n $types[] = $pm;\n }\n }\n\n return $types;\n }", "function commerce_marketplace_payment_methods_overview($store) {\n $payment_methods = commerce_marketplace_payment_enabled_methods();\n\n // Get payment methods which are enabled for this store.\n $store_enabled_methods = (!empty($store->data['payment_methods']['enabled'])) ? $store->data['payment_methods']['enabled'] : array();\n\n $output = '<p>' . t('Disabled payment methods can be enabled in the <em>Payment methods</em> section on the <a href=\"@url\">store edit page</a>.', array(\n '%title' => $store->title,\n '@url' => url('store/' . $store->store_id . '/edit', array(\n 'fragment' => 'edit-payment-methods',\n 'query' => drupal_get_destination(),\n )),\n )) . '</p>';\n $class = 'admin-list';\n if ($compact = system_admin_compact_mode()) {\n $class .= ' compact';\n }\n $output .= '<ul class=\"' . $class . '\">';\n foreach ($payment_methods as $method_id => $payment_method) {\n // List only those payment methods which are enabled for this store.\n $method = !empty($store_enabled_methods[$method_id]) ? l($payment_method['title'], 'store/' . $store->store_id . '/payment-methods/' . $method_id) : $payment_method['title'];\n $output .= '<li class=\"leaf\">' . $method;\n if (!$compact && isset($payment_method['description'])) {\n $output .= '<div class=\"description\">' . filter_xss_admin($payment_method['description']) . '</div>';\n }\n $output .= '</li>';\n }\n $output .= '</ul>';\n\n return $output;\n}", "function get_payment_method($method = '')\n{\n global $db_prefix;\n $tmp = array();\n\n if (!$method) {\n $res = sql_query(\"SELECT * FROM \".$db_prefix.\"module WHERE mod_type='payment' AND mod_enabled = '1'\");\n while ($row = sql_fetch_array($res)) {\n // get fee\n $module_config = $summary = array();\n $payment_cmd = 'init';\n $payment_extra_fee = 0;\n $mod = $row['mod_id'];\n if (!file_exists('./module/'.$mod.'/window.php')) {\n msg_die(sprintf($lang['msg']['internal_error'], 'Payment module '.$method.' not found.'));\n }\n require('./module/'.$mod.'/window.php');\n $tmp[$row['mod_id']]['method'] = $row['mod_id'];\n $tmp[$row['mod_id']]['name'] = $row['mod_name'];\n $tmp[$row['mod_id']]['fee'] = $payment_extra_fee;\n }\n\n return $tmp;\n } else {\n $payment_cmd = 'init';\n $payment_extra_fee = 0;\n $row = sql_qquery(\"SELECT * FROM \".$db_prefix.\"module WHERE mod_id='$method' AND mod_type='payment' AND mod_enabled = '1'\");\n if (!$row) {\n return false;\n }\n $mod = $row['mod_id'];\n if (!file_exists('./module/'.$mod.'/window.php')) {\n msg_die(sprintf($lang['msg']['internal_error'], 'Payment module '.$method.' not found.'));\n }\n require('./module/'.$mod.'/window.php');\n return (array('method' => $row['mod_id'], 'name' => $row['mod_name'], 'fee' => $payment_extra_fee));\n }\n}", "public function getListPaymentMethod(ListPaymentMethodRequest $request)\n {\n $this->apiData = $this->paymentMethodService->getListPaymentMethod($request);\n\n return $this->success();\n }", "function aegean_epay_admin_get_payment_options() {\n $return = array();\n $options = aegean_epay_load_payment_options();\n foreach ($options as $option) {\n $return[] = implode('|', $option);\n }\n\n return implode(\"\\n\", $return);\n}", "public function showPaymentMethods()\n {\n if(session()->get('parental'))\n {\n $user = DB::table('users')->where('username', session()->get('parental'))->first();\n $pay = DB::table('paymentsmethods')\n ->where('owner', Auth::id())\n ->orWhere('owner', $user->id)\n ->get();\n }else{\n $pay = DB::table('paymentsmethods')->where('owner', Auth::id() )->get(); \n }\n return response()->json($pay);\n }", "function getAutoEnabledPaymentMethods()\n{\n\tglobal $registeredPaymentMethods;\t\n\t\n\t$autoEnabledPaymentMethod = array();\n\t\n\tforeach ($registeredPaymentMethods as $paymentMethod => $className)\n\t{\n\t\t$pmObj = Service_PaymentMethodsFactory::getInstance($paymentMethod);\n\t\tif($pmObj->isAutoEnabledPaymentMethod() == \"y\" )\n\t\t{\n\t\t\tarray_push($autoEnabledPaymentMethod,$paymentMethod);\n\t\t}\n\t\t\n\t}\n\t\n\treturn $autoEnabledPaymentMethod;\n\t\n}", "static function getPayMethodsOptions($type = 0)\n\t{\n\t\tglobal $ilDB, $lng;\n\t\t\n\t\t$res = $ilDB->query('SELECT * FROM payment_paymethods WHERE pm_enabled = 1');\n\t\t$options = array();\n\t\t\n\t\t//this is only for additional entries in SelectInputGUIs\n\t\tswitch($type)\n\t\t{\n\t\t\tcase 'all':\t\n\t\t\t\t$options['all'] = $lng->txt('pay_all');\n\t\t\t\tbreak;\n\t\t\tcase 'not_specified': \t\n\t\t\t\t$options[0] = $lng->txt('paya_pay_method_not_specified');\n\t\t\t\tbreak;\n\t\t\t//default: break;\n\t\t}\n\t\t\n\t\twhile($row = $ilDB->fetchAssoc($res))\n\t\t{\n\t\t\t$options[$row['pm_id']] = ilPayMethods::getStringByPaymethod($row['pm_title']);\n\t\t}\t\t\n\t\n\t\treturn $options;\n\t}", "public function getPaymentMethod()\n {\n // get pusat\n $pusatCode = m_company::where('c_type', 'PUSAT')->select('c_id')->first();\n $pusatCode = $pusatCode->c_id;\n\n $data = m_paymentmethod::where('pm_isactive', 'Y')\n ->whereHas('getAkun', function ($q) use ($pusatCode) {\n $q->where('ak_comp', $pusatCode);\n })\n ->with('getAkun')\n ->get();\n\n return response()->json([\n 'data' => $data\n ]);\n }", "public function getmethods($id)\n {\n return PaymentNetwork::where('service_id',$id)->get();\n }", "public function fetchPaymentMethod(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\FetchPaymentMethodRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\FetchPaymentMethodRequest', $parameters);\n }", "public function getInstallments() {\n $api = new ApiPaymentMethods($this->_clientId, $this->_clientSecret, $this->_isTest);\n return $api;\n }", "public function display_account_payment_methods( ){\n\t\tif( $this->is_page_visible( \"payment_methods\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_payment_methods.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_payment_methods.php' );\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_payment_methods.php' ) )\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_payment_methods.php' );\n\t\t}\n\t}", "public function selectPaymentAction()\n {\n /* @var $fetcher \\SclZfCartPayment\\Method\\MethodFetcherInterface */\n $fetcher = $this->getServiceLocator()->get('SclZfCartPayment\\Method\\MethodFetcherInterface');\n\n /* @var $selector \\SclZfCartPayment\\Method\\MethodSelectorInterface */\n $selector = $this->getServiceLocator()->get('SclZfCartPayment\\Method\\MethodSelectorInterface');\n\n /* @var $form \\SclZfCartPayment\\Form\\PaymentMethods */\n $form = $this->getServiceLocator()->get('SclZfCartPayment\\Form\\PaymentMethods');\n\n $form->setAttribute('action', $this->url()->fromRoute('payment/select-payment'));\n\n $form->addMethods($fetcher->listMethods());\n\n if ($this->formSubmitted($form)) {\n $selector->setSelectedMethod($form->get($form::ELEMENT_METHOD)->getValue());\n return $this->redirect()->toRoute('cart/checkout');\n }\n\n return array('form' => $form);\n }", "public function index()\n {\n $payment_methods = DB::table('payment_methods')->get();\n return view('backend.payment.index', compact('payment_methods'));\n }", "public function getPaymentMethods()\n {\n $obj = new stdClass();\n\n // Must be in specific order for checksum --\n $obj->Timestamp = $this->getTimeStamp();\n $obj->SessionID = $this->getSessionID();\n $obj->PinCode = $this->getPinCode();\n $obj->UserAgent = $this->getUserAgent();\n // -----------------------------------------\n // Generate Checksum\n $obj->Checksum = $this->generateChecksum($obj);\n\n // Ask for GetPaymentMethods and get response\n $result = $this->client->GetPaymentMethods($obj);\n $result = $result->GetPaymentMethodsResult;\n $methods = isset($result->PaymentMethods->PaymentMethod) ? $result->PaymentMethods->PaymentMethod : null;\n\n $obj->Timestamp = $result->Timestamp;\n\n if (!is_null($methods)) {\n // Assign all properties of the PaymentMethods object as property of mainObject\n $obj = $this->parseForChecksum($obj, $methods);\n }\n\n // Unset properties for new Checksum\n unset($obj->Checksum);\n\n // Verify response data by making a new Checksum\n $CheckSum = $this->generateChecksum($obj);\n\n // Compare Checksums\n if ($result->Checksum != $CheckSum)\n throw new Exception('Data could not be verified');\n\n return (array) $methods;\n }", "public function fetchPaymentMethods(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\FetchPaymentMethodsRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\FetchPaymentMethodsRequest', $parameters);\n }", "public function toOptionArray()\n\t{\n $payments = Mage::getModel('payment/config')->getActiveMethods();\n $methods = [];\n\n foreach ($payments as $paymentCode=>$paymentModel) \n {\n $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');\n $methods[$paymentCode] = array(\n\n 'label' => $paymentTitle,\n 'value' => $paymentCode,\n );\n }\n return $methods;\n\t}", "public function index()\n {\n $method_payment = PaymentMethod::all();\n return view('admin.method-payment.method-payment',compact('method_payment'));\n }", "public function getAllPaymentMethods($translate = true)\n {\n if (empty($this->paymentMethods)) {\n $free = new \\PiedWeb\\ReservationBundle\\PaymentMethod\\Free();\n $this->paymentMethods[$free->getId()] = $translate ? $this->trans->trans('choices.'.$free->getHumanId()) : $free->getHumanId();\n\n $paymentMethods = explode('|', $this->getConfigurationPool()->getContainer()->getParameter('app.payment_method'));\n foreach ($paymentMethods as $paymentMethod) {\n $p = new $paymentMethod();\n $this->paymentMethods[$p->getId()] = $translate ? $this->trans->trans('choices.'.$p->getHumanId()) : $p->getHumanId();\n }\n }\n\n return $this->paymentMethods;\n }", "function getCronEnabledPaymentMethods()\n{\n\t$registeredPaymentMethods = getRegisteredPaymentMethods();\n\t\n\t$cronEnabledPaymentMethod = array();\n\t\n\tforeach ($registeredPaymentMethods as $paymentMethod => $className)\n\t{\n\t\t$pmObj = Service_PaymentMethodsFactory::getInstance($paymentMethod);\n\t\tif($pmObj->isAutoChargeEnabledPaymentMethod() == \"y\")\n\t\t{\n\t\t\tarray_push($cronEnabledPaymentMethod,$paymentMethod);\n\t\t}\n\t\t\n\t}\n\t\n\t$autoChargePaymentMethod = implode(\",\", $cronEnabledPaymentMethod);\n\t\n\treturn $autoChargePaymentMethod;\n}", "public static function PaymentOptionList()\n {\n \t\n \treturn array(\n \t 'cod'=>t(\"Cash On delivery\"),\n \t 'ocr'=>t(\"Offline Credit Card Payment\"),\n \t 'pyr'=>t(\"Pay On Delivery\"),\n \t 'pyp'=>t(\"paypal\"),\n \t 'stp'=>t(\"stripe\"),\n \t 'mcd'=>t(\"mercapado\"),\n \t 'ide'=>t(\"sisow\"),\n \t 'payu'=>t(\"payumoney\"),\n \t 'pys'=>t(\"paysera\"), \t \n \t 'bcy'=>t(\"Barclay\"),\n \t 'epy'=>t(\"EpayBg\"),\n \t 'atz'=>t(\"Authorize.net\"),\n \t 'obd'=>t(\"Offline Bank Deposit\"),\n \t 'btr' =>t(\"Braintree\")\n \t);\n }", "public function getPaymentMethods()\n {\n if (!isset($this->data['paymentProfiles']) || empty($this->data['paymentProfiles'])) {\n return null;\n }\n $paymentMethods = [];\n foreach ($this->data['paymentProfiles'] as $method) {\n $paymentMethods[$method['id']] = new PaymentMethod($method['id'], $method['visibleName']);\n }\n return collect($paymentMethods);\n }", "public function get_supported_payment_methods() {\n\t\treturn array(\n\t\t\tPronamic_WP_Pay_PaymentMethods::BANCONTACT,\n\t\t\tPronamic_WP_Pay_PaymentMethods::BANK_TRANSFER,\n\t\t\tPronamic_WP_Pay_PaymentMethods::CREDIT_CARD,\n\t\t\tPronamic_WP_Pay_PaymentMethods::IDEAL,\n\t\t\tPronamic_WP_Pay_PaymentMethods::SOFORT,\n\t\t);\n\t}", "public function getShippingMethods();", "public function fetchPaymentMethods(array $parameters = array())\n {\n return $this->createRequest(\n 'Omnipay\\MultiSafepay\\Message\\RestFetchPaymentMethodsRequest',\n $parameters\n );\n }", "protected function getPaymentMethod(){\n return $this->method;\n }", "public static function getPaymentMethods($config = NULL)\n {\n if ($config == NULL) {\n WebPay::throwMissingConfigException();\n }\n\n return new GetPaymentMethods($config);\n }", "public function getPaymentMethod()\n {\n return $this->response['result']['payment_type'];\n }", "public function listPaymentMethods(string $customer_id): array;", "function admin_display_payment_gateways()\n {\n $return = array (\n 'name' => $this->name,\n 'title' => 'CC - Manual Payment',\n );\n\n return $return;\n }", "public function index()\n {\n $methods = Payment::all();\n $availablePayments = MerchantPayment::where('merchant_id', Auth::user()->merchant->id)->paginate(10);\n return view('merchant.payment', compact('methods', 'availablePayments'));\n }", "function updatePaymentMethodOptions() {\n try {\n $payments_table = TABLE_PREFIX . 'payments';\n\n if (!in_array('method', $this->listTableFields($payments_table))) {\n DB::execute(\"ALTER TABLE $payments_table ADD method VARCHAR(100) DEFAULT '' AFTER comment\");\n } // if\n\n DB::execute('INSERT INTO ' . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('payment_methods_common', 'payments', ?)\", serialize(array('Bank Deposit','Check','Cash','Credit','Debit')));\n DB::execute('INSERT INTO ' . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('payment_methods_credit_card', 'payments', ?)\", serialize(array('Credit Card','Credit Card (Visa)','Credit Card (Mastercard)','Credit Card (Discover)','Credit Card (American Express)','Credit Card (Diners)')));\n DB::execute('INSERT INTO ' . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('payment_methods_online', 'payments', ?)\", serialize(array('Online Payment', 'Online Payment (PayPal)', 'Online Payment (Authorize)')));\n\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function getPaymentMethods()\n {\n return $this->getValue('payment_method_categories');\n }", "public static function getList(Context $context, $filter = null)\n {\n $context->setSecurityMode(Context::BASIC_AUTHENTICATION);\n\n $queryParams = (!is_null($filter)) ? ['filter' => $filter] : [];\n\n return NetLicensingService::getInstance()->getList($context, Constants::PAYMENT_METHOD_ENDPOINT_PATH, $queryParams, PaymentMethod::class);\n }", "private function _getPaymentMethod ()\n\t{\n\t\t$id = craft()->config->get('paymentMethodId', 'commercepaybear');\n\t\treturn craft()->commerce_paymentMethods->getPaymentMethodById($id);\n\t}", "public function getAutocreatePaymentMethods()\n {\n return $this->_toArrayObject($this->getConfig(\n 'autocreate/autocreate_allowed-payments'));\n }", "public static function metaPayment($post = null)\n {\n $v = get_post_meta($post->ID, 'payment_methods', true);\n print_r($v);\n }", "function colabs_list_gateway_dropdown( $input_name = 'payment_gateway' ) {\n\n $available_gateways = array();\n\n if ( $available_gateways = Colabs_Gateway_Registry::get_active_gateways() ) {\n ?>\n <ul class=\"payment_methods methods\">\n <?php foreach ( $available_gateways as $gateway ) {?>\n <li class=\"payment_method_<?php echo $gateway->identifier(); ?>\">\n <input id=\"payment_method_<?php echo $gateway->identifier(); ?>\" type=\"radio\" class=\"input-radio\" name=\"colabs_payment_method\" value=\"<?php echo esc_attr( $gateway->identifier() ); ?>\" data-order_button_text=\"<?php echo esc_attr( $gateway->display_name( 'dropdown' ) ); ?>\" />\n <label for=\"payment_method_<?php echo $gateway->identifier(); ?>\"><?php echo $gateway->display_name( 'dropdown' ); ?></label>\n <?php\n if ( $gateway->has_fields() || $gateway->get_description() ) {\n echo '<div class=\"payment_box payment_method_' . $gateway->identifier() . '\" style=\"display:none;\">';\n $gateway->payment_fields();\n echo '</div>';\n }\n ?>\n </li>\n <?php }?>\n </ul>\n <?php \n }else{\n echo '<p>'.__( 'No Gateways are currently available', 'colabsthemes' ).'</p>';\n }\n\n}", "public function hookPaymentOptions($params)\n {\n if (!$this->active) {\n return;\n }\n if (!$this->checkCurrency($params['cart'])) {\n return;\n }\n $payments_options = [];\n $ifthenpayGateway = GatewayFactory::build('gateway');\n foreach ((array) unserialize($this->ifthenpayConfig['IFTHENPAY_USER_PAYMENT_METHODS']) as $paymentMethod) {\n if (PrestashopModelFactory::buildCurrency($params['cart']->id_currency)->iso_code === 'EUR' || $paymentMethod === 'ccard') {\n if (Configuration::get('IFTHENPAY_' . Tools::strtoupper($paymentMethod))) {\n $option = PrestashopFactory::buildPaymentOption();\n if ($paymentMethod === 'mbway') {\n $this->context->smarty->assign('mbwaySvg', Media::getMediaPath(\n _PS_MODULE_DIR_ . $this->name . '/views/svg/mbway.svg' \n )\n );\n $this->context->smarty->assign(\n [\n 'action' => $this->context->link->getModuleLink(\n $this->name,\n 'validation',\n [\n 'paymentOption' => $paymentMethod,\n ],\n true\n ),\n ]\n );\n $option->setForm(\n $this->context->smarty->fetch(\n $this->local_path .\n 'views/templates/front/mbwayPhone.tpl'\n )\n );\n }\n $option->setCallToActionText($this->l('Pay by ') . $ifthenpayGateway->getAliasPaymentMethods(\n $paymentMethod, $this->context->language->iso_code)\n )\n ->setLogo(Media::getMediaPath(\n _PS_MODULE_DIR_ . $this->name . '/views/img/' . $paymentMethod . '_option.png'\n ))\n ->setAction(\n $this->context->link->getModuleLink(\n $this->name,\n 'validation',\n [\n 'paymentOption' => $paymentMethod,\n ],\n true\n )\n )\n ->setModuleName($this->name);\n $payments_options[] = $option;\n }\n }\n \n }\n return $payments_options;\n }", "public function getPaymentMethod(){\n return $this->_getData(self::PAYMENT_METHOD);\n }", "public function provides()\n {\n return ['paypalpayment'];\n }", "public function getBuyingPaymentMethods()\n {\n return $this->hasMany(PaymentMethod::className(), ['id' => 'payment_method_id'])\n ->viaTable('{{%currency_exchange_order_buying_payment_method}}', ['order_id' => 'id']);\n }", "public function testIsPaymentMethodGettableButNotFound()\n {\n $result = DirectDebit::getPaymentMethodsByCustomerID(self::CUSTOMER_ID);\n $this->assertEquals($result, []);\n }", "public function getPaymentMethod() \n {\n return $this->_fields['PaymentMethod']['FieldValue'];\n }", "protected function getSavedCardsPaymentMethod()\n {\n return \\XLite\\Core\\Database::getRepo('XLite\\Model\\Payment\\Method')\n ->findOneBy(array('class' => self::METHOD_SAVED_CARD));\n }", "public function getAll()\n\t{\n $get_all = PaymentMethod::all()->toArray();\n return response()->json($get_all);\n\n\t//\treturn view('welcome');\n\t}", "public function getMercadoPagoPaymentMethods($accessToken)\n {\n $mp = $this->getApiInstance($accessToken);\n try {\n $response = $mp->get(\"/v1/payment_methods\");\n if ($response['status'] == 401 || $response['status'] == 400) {\n return false;\n }\n } catch (\\Exception $e) {\n return false;\n }\n \n return $response['response'];\n }", "public function getMethods();", "public function getMethods();", "public function getMethods();", "function payment() {\n\t\t$url = 'https://www.instawallet.org/api/v1/w/' . $wallet_id . '/payment';\n\t\t$json = file_get_contents($url);\n\t\treturn json_decode($json);\n\t}", "protected function getMethod(): string\n {\n return 'rest/getBindingsByCardOrId.do';\n }", "public function index()\n\t{\n\t\t$paymentmethods = Paymentmethod::where('organization_id',Confide::user()->organization_id)->get();\n\n\t\treturn View::make('paymentmethods.index', compact('paymentmethods'));\n\t}", "private function getPaymentInfo()\n {\n $baseUrl = 'http://embeddables.eastus2.cloudapp.azure.com/payment/';\n\n return json_decode(\n file_get_contents(\n $baseUrl . 'payment.json'\n )\n );\n }", "public function getSellingPaymentMethods()\n {\n return $this->hasMany(PaymentMethod::className(), ['id' => 'payment_method_id'])\n ->viaTable('{{%currency_exchange_order_selling_payment_method}}', ['order_id' => 'id']);\n }", "public function getPaymentMethod()\n {\n return $this->paymentMethod;\n }", "public function getPaymentMethod()\n {\n return $this->paymentMethod;\n }", "public function getPaymentMethod()\n {\n return $this->payment_method;\n }", "public function getPaymentMethodAllowableValues()\n {\n return [\n self::PAYMENT_METHOD_ACC,\n self::PAYMENT_METHOD_ALP,\n self::PAYMENT_METHOD_APL,\n self::PAYMENT_METHOD_AMX,\n self::PAYMENT_METHOD_AZP,\n self::PAYMENT_METHOD_BON,\n self::PAYMENT_METHOD_CFY,\n self::PAYMENT_METHOD_CSY,\n self::PAYMENT_METHOD_CUP,\n self::PAYMENT_METHOD_DIN,\n self::PAYMENT_METHOD_DII,\n self::PAYMENT_METHOD_DIB,\n self::PAYMENT_METHOD_DIS,\n self::PAYMENT_METHOD_DNK,\n self::PAYMENT_METHOD_ECA,\n self::PAYMENT_METHOD_ELV,\n self::PAYMENT_METHOD_EPS,\n self::PAYMENT_METHOD_ESY,\n self::PAYMENT_METHOD_INT,\n self::PAYMENT_METHOD_JCB,\n self::PAYMENT_METHOD_JEL,\n self::PAYMENT_METHOD_KLN,\n self::PAYMENT_METHOD_MAU,\n self::PAYMENT_METHOD_MDP,\n self::PAYMENT_METHOD_MFX,\n self::PAYMENT_METHOD_MPX,\n self::PAYMENT_METHOD_MYO,\n self::PAYMENT_METHOD_PAP,\n self::PAYMENT_METHOD_PAY,\n self::PAYMENT_METHOD_PEF,\n self::PAYMENT_METHOD_PFC,\n self::PAYMENT_METHOD_PSC,\n self::PAYMENT_METHOD_REK,\n self::PAYMENT_METHOD_SAM,\n self::PAYMENT_METHOD_SWB,\n self::PAYMENT_METHOD_SCX,\n self::PAYMENT_METHOD_SWP,\n self::PAYMENT_METHOD_TWI,\n self::PAYMENT_METHOD_UAP,\n self::PAYMENT_METHOD_VIS,\n self::PAYMENT_METHOD_WEC,\n ];\n }", "public function getPaymentMethod() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->paymentMethod;\r\n\t}", "public function fetch_order_payment_method(Request $request) {\n $data['orders'] = Order::where('payment_method', $request->method)->get();\n $data['areas'] = Area::where('deleted', 0)->orderBy('id', 'desc')->get();\n $data['sum_price'] = Order::where('payment_method', $request->method)->sum('subtotal_price');\n $data['sum_delivery'] = Order::where('payment_method', $request->method)->sum('delivery_cost');\n $data['sum_total'] = Order::where('payment_method', $request->method)->sum('total_price');\n $data['method'] = $request->method;\n\n return view('admin.orders' , ['data' => $data]);\n }", "public function getCheckoutCommands();", "public static function getPaymentTypes()\n\t{\n\t\t$types = array('' => 'Any');\n\t\treturn array_merge($types, PaymentMethod::getPaymentMethods());\n\t}", "public function _getPaymentMethodsHtml() {\r\n\t\t//$this->_cleanLayoutCache();\r\n\t\t$layout = $this->getLayout();\t\t\r\n\t\t$update = $layout->getUpdate();\r\n\t\t$update->load('onestepcheckout_onestepcheckout_paymentmethod');\r\n\t\t$layout->generateXml();\r\n\t\t$layout->generateBlocks();\r\n\t\t$output = $layout->getOutput();\r\n\t\treturn $output;\r\n\t}" ]
[ "0.81378186", "0.75367045", "0.7113911", "0.7052977", "0.7023732", "0.6987148", "0.6944982", "0.6827033", "0.67784935", "0.67511505", "0.67176086", "0.6686287", "0.666047", "0.6621312", "0.65936416", "0.6592874", "0.65672445", "0.6548892", "0.65153396", "0.64885575", "0.6439911", "0.63512516", "0.6345577", "0.63340414", "0.62941647", "0.62735057", "0.62715286", "0.6242036", "0.6240643", "0.6226821", "0.6197334", "0.61946934", "0.6186093", "0.61847264", "0.61792284", "0.6179024", "0.6176155", "0.61586004", "0.61401457", "0.613544", "0.61072063", "0.6107054", "0.6084115", "0.6080653", "0.6060235", "0.60572165", "0.6054838", "0.6047779", "0.60460293", "0.60422814", "0.6038709", "0.60287094", "0.6024927", "0.6017599", "0.60123247", "0.60103375", "0.5998964", "0.59979784", "0.5970184", "0.5966639", "0.59470147", "0.59389627", "0.5936284", "0.59218806", "0.5898053", "0.58663714", "0.5864595", "0.5843391", "0.5840587", "0.5839287", "0.58386356", "0.58192176", "0.58106333", "0.58098936", "0.579813", "0.5797619", "0.57953525", "0.577839", "0.57713765", "0.57703817", "0.5768696", "0.57466096", "0.57427484", "0.57418346", "0.57418346", "0.57418346", "0.5735992", "0.57335496", "0.57193667", "0.57091945", "0.5708", "0.57037675", "0.57037675", "0.57007104", "0.5700434", "0.5696273", "0.5695299", "0.5693337", "0.56826514", "0.5680028" ]
0.69935954
5
Display a listing of the resource.
public function index() { $especialidades=DB::table('especialidad')->get(); return view('ViewAdm.FormRegistroEspecialidad')->with("especialidades",$especialidades); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function register(Request $request) { $this->validator($request->all())->validate(); $data=Request()->all(); $especialidad = new especialidad; $especialidad->nombre = $data["nombre"]; $especialidad->descripcion = $data["descripcion"]; $resul=$especialidad->save(); if($resul){ \Session::flash('flash_message_correcto', 'Especialidad Creada exitosamente.'); //return view("mensajes.msj_correcto")->with("msj","Usuario Registrado Correctamente"); } else { \Session::flash('flash_message_rechazado', 'Huvo un error al Crear la especialidad vuelva a intentarlo'); // return view("mensajes.msj_rechazado")->with("msj","hubo un error vuelva a intentarlo"); } return redirect()->back(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { $especialidades=DB::table('especialidad')->get(); $especialidad=DB::table('especialidad')->where('id', $id)->first(); return view('ViewAdm.FormEditEspecialidad')->with("especialidades",$especialidades)->with("especialidad",$especialidad); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7855196", "0.76957726", "0.7273917", "0.7241426", "0.71717227", "0.7064183", "0.70528984", "0.69836885", "0.694763", "0.69469565", "0.6941572", "0.69301945", "0.6903868", "0.68989486", "0.68989486", "0.68787694", "0.68641657", "0.6860115", "0.6857286", "0.68464494", "0.6834566", "0.68116575", "0.68075293", "0.6805924", "0.6801357", "0.6796291", "0.67915684", "0.67915684", "0.67874014", "0.678544", "0.67787844", "0.6777662", "0.67675763", "0.676299", "0.6746726", "0.6745706", "0.67450166", "0.67450166", "0.6739429", "0.6734577", "0.6725992", "0.67127997", "0.6694406", "0.6692487", "0.6689421", "0.66884303", "0.6687299", "0.6685663", "0.6682167", "0.66701853", "0.66697115", "0.6666091", "0.6666091", "0.66627705", "0.6661716", "0.6661522", "0.6657919", "0.6656454", "0.6653187", "0.6642113", "0.66332614", "0.66324973", "0.66275465", "0.66275465", "0.6619777", "0.6619387", "0.6617973", "0.66154003", "0.66110945", "0.6607966", "0.66065043", "0.6596376", "0.65953517", "0.65941286", "0.6591486", "0.6590759", "0.6588404", "0.658161", "0.6580548", "0.6579757", "0.6577171", "0.65761065", "0.657386", "0.65686774", "0.6567784", "0.65672046", "0.6566417", "0.65615803", "0.65615714", "0.65615714", "0.65592474", "0.65586483", "0.65568006", "0.6556628", "0.65564895", "0.6555322", "0.65551996", "0.6555016", "0.654888", "0.65477645", "0.65451735" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request ) { $this->validator_edit($request->all())->validate(); $data=Request()->all(); $resul=DB::table('Especialidad')->where('id',$data["id"]) ->update(['nombre'=>$data["nombre"], 'descripcion'=>$data["descripcion"] ]); if($resul){ \Session::flash('flash_message_correcto', 'Especialidad actualizada exitosamente.'); //return view("mensajes.msj_correcto")->with("msj","Usuario Registrado Correctamente"); } else { \Session::flash('flash_message_rechazado', 'Huvo un error al actualizar vuelva a intentarlo'); // return view("mensajes.msj_rechazado")->with("msj","hubo un error vuelva a intentarlo"); } //event(new Registered($user = $this->create($request->all()))); //ingreso luego del registro $this->guard()->login($user); return redirect ()->route('formNewEspecialidad'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1