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
Checks if the tips is not approved
public function getIsNotApproved() { return $this->state !== self::STATE_APPROVED; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasTips(){\n return $this->_has(19);\n }", "public function my_is_not_approved()\n {\n $user = User::all();\n $category = Category::all();\n $posts = Post::where('user_id',Auth::user()->id)->where('post_status', 0)->orWhere('post_status', 1)->orWhere('post_status', 3)->orderBy('post_id', 'DESC')->paginate(15);\n return view('admin.my_post.is_not_approved', compact('posts', 'category', 'user'));\n }", "public function declined()\n\t{\n\t\treturn !$this->approved();\n\t}", "public function isApproved()\n {\n\n return false;\n }", "public function hiding_excerpts() {\n\t\treturn ! $this->showing_excerpts();\n\t}", "private function checkIsApproved()\n {\n if (!$this->model->isApproved()) {\n return true;\n }\n\n throw QuizzException::errorQuestionApproved();\n }", "function isDenied() {\n return !empty($this->denied_reasons);\n }", "public function transaction_approved() {\n\n\t\t$errors = $this->get_errors()->get_error_codes();\n\n\t\treturn empty( $errors );\n\t}", "public function isDoNotSpellCheckSet() {}", "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 }", "public function canSkipOrderReviewStep()\n {\n return !$this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON);\n }", "public static function should_show_tasks() {\n\t\treturn 'no' === get_option( 'woocommerce_task_list_hidden', 'no' );\n\t}", "private function current_tab_does_not_need_applicants(){ \n $reply = $this->current_tab_in_array(array(tab_social_events,\n\t\t\t\t\t tab_available_budget,\n\t\t\t\t\t tab_reimbursement_rates,\t\t\t \n\t\t\t\t\t tab_accommodation_options,\n\t\t\t\t\t ));\n $this->dbg(($reply ? 'SKIP' : 'PROCESS'). ' applicants',cnf_dev);\n return $reply;\n }", "public function hasTipid(){\n return $this->_has(3);\n }", "function ctr_validateConfirmation(&$ctx)\n{\n $reservation = $ctx['reservation'];\n\n if ($reservation->persons AND $reservation->destination)\n return true;\n\n $ctx['warning'] .= \"Please, do not play with the URL.\\n\";\n\n return false;\n}", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_traininglist/traineecert');\n }", "public function markUnapproved()\n {\n $this->Moderated = false;\n $this->write();\n $this->extend('afterMarkUnapproved');\n }", "private function confirm()\n {\n // if 1, direct approve\n\n $load = $this->load;\n\n $fleetCount = $load->fleet_count;\n\n if($fleetCount > 1) {\n $loadTrips = $load->confirmed_trips()\n ->count()\n ;\n } else {\n $loadTrips = 1;\n }\n\n if($loadTrips == $fleetCount) {\n\n //@todo: send confirm notifications\n\n $load->status = Load::STATUS_CONFIRMED;\n $load->save();\n }\n\n }", "public function isBlocked()\n {\n if ($this->edit_id === 0) {\n return false;\n } else {\n if ($this->edit_time + 7200 > time()) {\n return true;\n } else {\n return false;\n }\n }\n }", "private function COIRequiresApproval()\r\n {\r\n global $db;\r\n\r\n // if there is more than one COI form in the db then approvals are required\r\n $sql = \"SELECT * FROM `forms_coi`\r\n WHERE `form_tracking_id` = \" . $this->trackingFormId . \"\r\n and `coi_none` = '0'\";\r\n $result = $db->getAll($sql);\r\n\r\n if (count($result) <= 0) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "function user_owns_tip($tip_id, $uname) {\n $sql = '\n SELECT EXISTS(\n SELECT\n id\n FROM\n tips\n WHERE\n id = ? AND author = ?\n )';\n \n $res = $this->prep_and_exec($sql, [$tip_id, $uname]);\n \n if (!$res) {\n return null;\n }\n \n return (bool) $res->fetch(PDO::FETCH_NUM)[0];\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}", "public function isApproved(): bool;", "function valid_action() {\n # of pages that are about that page (i.e. not admin\n # or recent changes)\n global $ACT;\n if($ACT == 'show') { return true; }\n if($ACT == 'edit') { return true; }\n if($ACT == 'revisions') { return true; }\n return false;\n }", "public function disapprove()\n {\n return $this->approve(false);\n }", "function KemiSitemap_notice(){\n echo '<div class=\"notice notice-warning\"><p>' . __( 'Please deactivate Kemi Sitemap before activting Kemi Sitemap.', 'KemiSitemap' ) . '</p></div>';\n\n if( isset( $_GET['activate'] ) ) {\n unset( $_GET['activate'] );\n }\n }", "function admin_check(){\n global $user_ID, $tou_settings;\n if (current_user_can('administrator')) \n return;\n\n $current_page = false;\n if ($_SERVER[\"REQUEST_URI\"] and !empty($tou_settings->admin_page)){\n foreach((array)$tou_settings->admin_page as $admin_page){\n if($current_page)\n continue;\n \n $current_page = strpos($_SERVER[\"REQUEST_URI\"], $admin_page);\n }\n }\n \n if(!TouAppHelper::get_user_meta($user_ID, 'terms_and_conditions') and \n (empty($tou_settings->admin_page) or in_array('index.php', (array)$tou_settings->admin_page) or $current_page)){\n \n die(\"<script type='text/javascript'>location='\". admin_url($tou_settings->menu_page) .\"?page=terms-of-use-conditions'</script>\");\n }\n }", "public function noEditWarning()\n {\n\n $html = \"<div>\n <p class=\\\"text-center\\\">The Burn is pre-approved, approved, or disapproved and cannot be edited.</p>\n <button class=\\\"btn btn-default btn-block\\\" onclick=\\\"cancel_modal()\\\">Close</button>\n </div>\";\n\n return $html;\n }", "public function is_met() {\n\t\treturn ! \\is_admin();\n\t}", "function is_approved() {\n\t\treturn $this->get_data( 'comment_approved' );\n\t}", "public function hasNoRole()\n {\n return $this->hakAksesPengguna()\n ->where('status_request', RequestStatus::APPROVED)\n ->count() === 0;\n }", "public function isRejected() {\n\t\treturn $this->approved == -1;\n\t}", "public function unpaid(): bool\n {\n return in_array($this->status, [self::PENDING]);\n }", "public function ajax_deny_approval()\n {\n if (empty($_POST)) return;\n\n ee()->load->model('publisher_approval');\n $msg = ee()->publisher_approval->deny();\n ee()->publisher_helper->send_ajax_response($msg);\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Dilmah_TeaFaq::dilmah_tfaq');\n }", "function genesis_extender_essentials_is_active_nag()\n\t\t{\t\t\t\n\t\t\techo '<div id=\"update-nag\">';\n\t\t\tprintf( __( '<strong>Genesis Extender & Genesis Essentials Are Currently Active!</strong> These two Cobalt Apps products are not to be used together so deactivate <a href=\"%s\">Genesis Extender</a> or <a href=\"%s\">Genesis Essentials</a>.', 'extender' ), admin_url( 'plugins.php' ), admin_url( 'plugins.php' ) );\n\t\t\techo '</div>';\n\t\t}", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')\n ->isAllowed('admin/system/convert/professio_budgetmailer');\n }", "public static function Allow_optin() {\n\t\tupdate_option( 'xlp_is_opted', 'yes', false );\n\n\t\t//try to push data for once\n\t\t$data = self::collect_data();\n\n\t\t//posting data to api\n\t\tXL_API::post_tracking_data( $data );\n\t}", "public function prepare_ask_for_review_notice() {\n $status = nk_theme()->get_option( 'ask_for_review_status', 'first' );\n $pending = nk_theme()->get_option( 'ask_for_review_pending', false );\n\n if ( 'first' === $status ) {\n nk_theme()->update_option( 'ask_for_review_status', 'pending' );\n nk_theme()->update_option( 'ask_for_review_pending', time() + WEEK_IN_SECONDS );\n }\n\n if ( 'pending' === $status && time() >= $pending ) {\n nk_theme()->update_option( 'ask_for_review_status', 'show' );\n nk_theme()->update_option( 'ask_for_review_pending', false );\n }\n }", "public function cantSeeFailNow() {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\ConditionalAssertion('dontSeeFailNow', func_get_args()));\n }", "public function rejectedits() {\n\t\t\tglobal $db, $user;\n\t\t\t$query = \"delete from content where parent = '\".$this->guid.\"' and revision_id=1\";\n\t\t\t//print \"$query<br>\\n\";\n\t\t\tif ($db->query($query)) {\n\n\t\t\t\t// We have rejected edits to the page\n\t\t\t\taddHistory($user->id, \"\", $this->guid, \"Changes rejected\", $this->template_type.\"s\");\n\n\t\t\t\t// Update this page in the history table also\n\t\t\t\t$query = \"UPDATE history \n\t\t\t\t\tSET completed_action='CHANGES REJECTED', completed_date=now(), completed_by=\".$user->id.\" \n\t\t\t\t\tWHERE action='publish' \n\t\t\t\t\tAND completed_action is null\n\t\t\t\t\tAND (info='Page saved' OR info='Panel saved')\n\t\t\t\t\tAND guid='\".$this->guid.\"'\";\n\t\t\t\tif (!$db->query($query)) {\n\t\t\t\t\t//print \"failed($query)<br>\\n\";\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\n\t\t\t}\n\t\t\treturn false;\n\t\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}", "private function approve() {\n\n }", "public function isExistingReview(): bool\n {\n $review = ShopFeedbackEntity::findOne([\n 'created_by' => (!isset(Yii::$app->request->post()['created_by']))\n ? Yii::$app->user->identity->getId() : Yii::$app->request->post()['created_by'],\n 'shop_id' => Yii::$app->request->post()['shop_id']]);\n if (!$review) {\n $this->addError('created_by',\n Yii::t('app', 'Отзыв не найден'));\n return false;\n } else {\n return true;\n }\n }", "private function negarDetalleSolicitud()\r\n {\r\n $result = false;\r\n $modelInscripcion = self::findInscripcionSucursal();\r\n if ( $modelInscripcion !== null ) {\r\n if ( $modelInscripcion['id_contribuyente'] == $this->_model->id_contribuyente ) {\r\n $result = self::updateSolicitudInscripcion($modelInscripcion);\r\n } else {\r\n self::setErrors(Yii::t('backend', 'Error in the ID of taxpayer'));\r\n }\r\n }\r\n\r\n return $result;\r\n }", "public function isPendingReview() {\n return $this->getStatus() === Status::PENDING_REVIEW;\n }", "public function maybeShowNotice() {\n\t\t$transientPosts = aioseo()->transients->get( 'v3_migration_in_progress_posts' );\n\t\t$transientTerms = aioseo()->transients->get( 'v3_migration_in_progress_terms' );\n\t\tif ( ! $transientPosts && ! $transientTerms ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Disable the notice for now since it is almost unnecessary. We can come back and revisit this in the future.\n\t\t// $this->showNotice();\n\t}", "public function isRejected()\n {\n return ($this->slug == \"afgekeurd\");\n }", "public function user_is_allowed()\n {\n //check if the record exist\n if (! $this->record) {\n $this->build_error('These record does not exist or it may not belong to you',404);\n }\n\n //check if the user is the owner of the entry\n if(!isOwner($this->record)) {\n $this->build_error('you are not the owner of this task');\n }\n\n //check if the incomming entries type is Array\n if (!is_array($this->request->entries)) {\n $this->build_error('Please the entries must be an Array');\n }\n }", "public function friendly_stop() {\n global $OUTPUT;\n\n $riskyediting = ($this->surveypro->riskyeditdeadline > time());\n $utilitylayoutman = new utility_layout($this->cm, $this->surveypro);\n $hassubmissions = $utilitylayoutman->has_submissions();\n\n if ($hassubmissions && (!$riskyediting)) {\n echo $OUTPUT->notification(get_string('applyusertemplatedenied01', 'mod_surveypro'), 'notifyproblem');\n $url = new \\moodle_url('/mod/surveypro/view_submissions.php', ['s' => $this->surveypro->id]);\n echo $OUTPUT->continue_button($url);\n echo $OUTPUT->footer();\n die();\n }\n\n if ($this->surveypro->template && (!$riskyediting)) { // This survey comes from a master template so it is multilang.\n echo $OUTPUT->notification(get_string('applyusertemplatedenied02', 'mod_surveypro'), 'notifyproblem');\n $url = new \\moodle_url('/mod/surveypro/view_userform.php', ['s' => $this->surveypro->id]);\n echo $OUTPUT->continue_button($url);\n echo $OUTPUT->footer();\n die();\n }\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 }", "protected function assertFlagWidget(): void {\n $this->assertSession()->pageTextNotContains('Flag other translations as outdated');\n $this->assertSession()->pageTextContains('Translations cannot be flagged as outdated when content is moderated.');\n }", "public static function defaultChecks()\n {\n //checks if default checks has already ran.\n if (self::$_default_notified) {\n return true;\n }\n\n if (defined('DEMO_MODE')) {\n Notifications::add(\"<span style='color: red'><strong>NOTICE:</strong> The forms in this demo will not submit.</span>\");\n }\n\n Notifications::add(Admin_site::securityCheck());\n\n if (geoMaster::is('auctions')) {\n Notifications::addCheck(array('Ad_configuration', 'incrementExists'));\n }\n\n if (file_exists(GEO_BASE_DIR . 'xss_filter_inputs.php')) {\n Notifications::add('<strong>xss_filter_inputs.php</strong> still exists in your root directory. This file is no longer needed, so it is safe to remove.');\n }\n\n if (is_dir(GEO_BASE_DIR . 'scopbin')) {\n Notifications::add('The <strong>scopbin</strong> directory still exists in your root directory. This is no longer needed, so it is safe to remove.');\n }\n\n self::$_default_notified = true;\n }", "public function no_items() {\n\t\t_e( 'No reviews avaliable.', 'woo-better-reviews' );\n\t}", "protected function _fcpoCheckTxid()\n {\n $blAppointedError = false;\n $sTxid = $this->_oFcpoHelper->fcpoGetSessionVariable('fcpoTxid');\n\n $sTestOxid = '';\n if ($sTxid) {\n $sQuery = \"SELECT oxid FROM fcpotransactionstatus WHERE FCPO_TXACTION = 'appointed' AND fcpo_txid = '\" . $sTxid . \"'\";\n $sTestOxid = $this->_oFcpoDb->getOne($sQuery);\n }\n\n if (!$sTestOxid) {\n $blAppointedError = true;\n $this->oxorder__oxfolder = new oxField('ORDERFOLDER_PROBLEMS', oxField::T_RAW);\n $oLang = $this->_oFcpoHelper->fcpoGetLang();\n $sCurrentRemark = $this->oxorder__oxremark->value;\n $sAddErrorRemark = $oLang->translateString('FCPO_REMARK_APPOINTED_MISSING');\n $sNewRemark = $sCurrentRemark.\" \".$sAddErrorRemark;\n $this->oxorder__oxremark = new oxField($sNewRemark, oxField::T_RAW);\n }\n $this->_fcpoSetAppointedError($blAppointedError);\n\n return $blAppointedError;\n }", "public function maybeShowReviewRequestNotice() {\n\t\t\t$dismissed_notices = muut()->getOption( 'dismissed_notices', array() );\n\t\t\tif ( !isset( $dismissed_notices['review_request'] ) || !$dismissed_notices['review_request'] ) {\n\t\t\t\t$update_timestamps = muut()->getOption( 'update_timestamps', array() );\n\t\t\t\t$update_time = !empty( $update_timestamps ) ? array_pop( $update_timestamps ) : false;\n\n\t\t\t\tif ( $update_time && ( time() - $update_time > 604800 ) ) {\n\t\t\t\t\techo '<div class=\"updated muut_admin_notice\" id=\"muut_dismiss_review_request_notice\">';\n\t\t\t\t\twp_nonce_field( 'muut_dismiss_notice', 'dismiss_nonce' );\n\t\t\t\t\techo '<span style=\"float: right\" class=\"dismiss_notice_button\"><a href=\"#\" class=\"dismiss_notice\">X</a></span>';\n\t\t\t\t\techo '<p>' . sprintf( __( 'Enjoying Muut? We\\'d love it you would pop over to the %splugin page%s and leave a rating and review!', 'muut' ), '<a class=\"dismiss_notice\" target=\"_blank\" href=\"https://wordpress.org/plugins/muut/\">', '</a>' ) . '</p>';\n\t\t\t\t\techo '</div>';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function croll_tab_check_pd_no_confirm_pd() {\n\n //find and up status pd = 3\n $this -> load -> model('account/auto');\n $this -> load -> model('account/block');\n $query_rp = $this -> model_account_auto -> get_rp_pd();\n \n foreach ($query_rp as $key => $value) {\n \t // $this -> model_account_auto -> update_lock2_customer($value['customer_id']);\n \t$description ='You did not complete PD';\n \t$this -> model_account_block -> update_check_block_pd($value['customer_id'],$description, $value['pd_number']);\n \t $total = $this -> model_account_block -> get_total_block_id_pd($value['customer_id']);\n\t\t \tif (intval($total) === 2) {\n\t\t \t\t$this -> model_account_auto -> updateStatusCustomer($value['customer_id']);\n\t\t }\n }\n $this -> model_account_auto -> auto_find_pd_update_status_report();\n \n die();\n }", "function ConfirmBeforeToPrune()\n{\n\tglobal $dateformat;\n\t$story = new NewsStory();\n\txoops_cp_header();\n\t$topiclist=\"\";\n\tif(isset($_POST['pruned_topics'])) {\n\t\t$topiclist=implode(\",\",$_POST['pruned_topics']);\n\t}\n\techo \"<h4>\" . _AM_NEWS_PRUNENEWS . \"</h4>\";\n\t$expired=0;\n\tif(isset($_POST['onlyexpired'])) {\n\t\t$expired = intval($_POST['onlyexpired']);\n\t}\n\t$date=$_POST['prune_date'];\n\t$timestamp=mktime(0,0,0,intval(substr($date,5,2)), intval(substr($date,8,2)), intval(substr($date,0,4)));\n\t$count=$story->GetCountStoriesPublishedBefore($timestamp, $expired, $topiclist);\n\tif($count) {\n\t\t$displaydate=formatTimestamp($timestamp,$dateformat);\n\t\t$msg=sprintf(_AM_NEWS_PRUNE_CONFIRM,$displaydate, $count);\n\t\txoops_confirm(array( 'op' => 'prunenews', 'expired' => $expired, 'pruned_topics' => $topiclist, 'prune_date' => $timestamp, 'ok' => 1), 'index.php', $msg);\n\t} else {\n\t\tprintf(_AM_NEWS_NOTHING_PRUNE);\n\t}\n\tunset($story);\n}", "public function requirements_not_met_notice() {\n\t\t// Output our error\n\t\techo '<div id=\"message\" class=\"error\">';\n\t\techo '<p>' . sprintf( __( 'Requirements have not been met so this plugin has been <a href=\"%s\">deactivated</a>. Please make sure all requirements are available.', 'ausm-plugin' ), admin_url( 'plugins.php' ) ) . '</p>';\n\t\techo '</div>';\n\t}", "public function isAllowedToApplyLoan()\n {\n return $this->getAge() >= 18;\n }", "public function seeNoRelevantSpamScore()\n {\n $this->checkSpamAssassinSpamStatus($this->openedEmail->getRawHeaders());\n }", "protected function matchHideForNonAdminsCondition() {}", "public function check()\n {\n return empty($this->_vars['reason'])\n ? _(\"Missing reason in vacation.\")\n : true;\n }", "function confirmRemoveImportantPagesObject()\n\t{\n\t\tglobal $ilCtrl, $tpl, $lng;\n\n\t\tif (!is_array($_POST[\"imp_page_id\"]) || count($_POST[\"imp_page_id\"]) == 0)\n\t\t{\n\t\t\tilUtil::sendInfo($lng->txt(\"no_checkbox\"), true);\n\t\t\t$ilCtrl->redirect($this, \"editImportantPages\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tinclude_once(\"./Services/Utilities/classes/class.ilConfirmationGUI.php\");\n\t\t\t$cgui = new ilConfirmationGUI();\n\t\t\t$cgui->setFormAction($ilCtrl->getFormAction($this));\n\t\t\t$cgui->setHeaderText($lng->txt(\"wiki_sure_remove_imp_pages\"));\n\t\t\t$cgui->setCancel($lng->txt(\"cancel\"), \"editImportantPages\");\n\t\t\t$cgui->setConfirm($lng->txt(\"remove\"), \"removeImportantPages\");\n\n\t\t\tforeach ($_POST[\"imp_page_id\"] as $i)\n\t\t\t{\n\t\t\t\t$cgui->addItem(\"imp_page_id[]\", $i, ilWikiPage::lookupTitle((int) $i));\n\t\t\t}\n\n\t\t\t$tpl->setContent($cgui->getHTML());\n\t\t}\n\t}", "public function isSignupHidden()\n {\n return Professio_BudgetMailer_Model_Config_Source_Account::HIDDENCHECKED\n == Mage::helper('budgetmailer/config')->getAdvancedCreateAccount();\n }", "private function _validate_user() {\n\t\treturn (current_user_can(\"edit_posts\") && current_user_can(\"edit_pages\") && !empty($this->buttons));\n\t}", "function pre_confirmation_check() {\r\n return false;\r\n }", "public function isButtonValidBrokenSetupMultiplePrimaryActionsGivenExpectFalse() {}", "public function isUsed()\n\t{\n\t\treturn $this->data && $this->data['forms_attempts'] > 0;\n\t}", "function check_alltopicsattempted($uid){\n\t/**\n * This function check weather whole topics attempted or not and return yes or no\n * \n * @author Imran M Bajwa <[email protected]>\n * @return yes or no\n */ \n\tglobal $dbc;\n\n\n\t$sql = $dbc->query(\"select * FROM tests, test_log, user WHERE user.id='$uid' AND \n\t\tuser.test_id = tests.test_id AND user.id = test_log.uid ORDER BY test_log.t_time DESC LIMIT 1\");\n\tif ( $sql->num_rows == 0) return \"no\";\n\t$r = $sql->fetch_assoc();\t\n\t $atopics = explode(\",\", $r['topics']);\n\t$ltad = $r['tid'];\n\t$pos = sizeof($atopics)-1;\n\tif($pos == array_search($r['tid'],$atopics)){\n\t\treturn \"yes\";\n\t}\n\t// if( $ltad == $atopics[sizeof($atopics)-1] )\n\t\t\n\telse{\n\t\treturn \"no\";\n\t}\n\t\t\n}", "public function inappropriate( $notes, $toggle ) {\n\t\tif (\n\t\t\t$this->feedback->isFeatured() ||\n\t\t\t$this->feedback->isResolved() ||\n\t\t\t$this->feedback->isNonActionable() ||\n\t\t\t$this->feedback->isInappropriate() ||\n\t\t\t$this->feedback->isArchived() ||\n\t\t\t$this->feedback->isHidden() ||\n\t\t\t$this->feedback->isOversighted()\n\t\t) {\n\t\t\t$this->error = 'articlefeedbackv5-invalid-feedback-state';\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->feedback->aft_feature = 0;\n\t\t$this->feedback->aft_resolve = 0;\n\t\t$this->feedback->aft_noaction = 0;\n\t\t$this->feedback->aft_inappropriate = 1;\n\t\t$this->feedback->aft_archive = 0;\n\t\t$this->feedback->aft_hide = 0;\n\t\t$this->feedback->aft_oversight = 0;\n\n\t\t$this->logId = $this->log( __FUNCTION__, $this->feedback->aft_page, $this->feedback->aft_id, $notes, $this->user );\n\n\t\treturn true;\n\t}", "public function check_admin_notices() {\n\n $errors = $this->check_requirements();\n\n if ( empty($errors) )\n return;\n\n if ( isset($_GET['activate']) )\n unset($_GET['activate']);\n\n printf(\n __('<div class=\"notice notice-error\"><p>%1$s</p><p><i>%2$s</i> has been <strong>deactivated</strong>.</p></div>', 'wordpress-popular-posts'),\n join( '</p><p>', $errors ),\n 'WordPress Popular Posts'\n );\n\n $plugin_file = 'wordpress-popular-posts/wordpress-popular-posts.php';\n deactivate_plugins( $plugin_file );\n\n }", "public function isProposition()\n {\n $u = $this->user()->first();\n\n return auth()->user()->id != $u->id;\n }", "function bibdk_voxb_offensive_error() {\n return array(\n '#markup' => t('bibdk_voxb_no_access', array(), array('context'=>'bibdk_voxb')),\n );\n}", "private function dontPerformAction($request)\n {\n return is_null(self::getSecurityToken()) || !$request->getVar('id') || !$request->getVar('type') ||\n !$request->getVar('s') || $request->getVar('s') != self::getSecurityToken();\n }", "public function checkAccess() {\n\t\t$conf = $GLOBALS['BE_USER']->getTSConfig('backendToolbarItem.tx_newsspaper_role.disabled');\n\t\treturn ($conf['value'] == 1 ? false : true);\n\t}", "public function restore_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "function isApproved() {\n return $this->getStatus() == UserpointsTransaction::STATUS_APPROVED;\n }", "abstract public function check_hint();", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('system/config/newsletter');\n }", "private function btn_approve_reject(){\n\n // Skip the unduly cases\n if ($not_my_case = (VM::outOfScope()\n\t\t\t|| !$this->isWritable() \n\t\t\t|| ($this->rec['v_type'] == VISIT_OUT_OF_SCOPE) \n\t\t\t|| !in_array($this->doing,array('lists','budget',)) \n\t\t\t)){\n $this->dbg('not my case? '.($not_my_case ? 'YES' : 'NO'));\n return array('','');\n }\n\n // The event is endorsed (i.e. changes are locked), show only pending applicants and return\n if(0) if (VM::isEventEndorsed() || ($this->rec['v_end'] < time())){\n\tif (False){ // ? Strange... To be changed?\n\t $reply = array('');\n\t if ($this->fnc_beslut) $reply[] = $this->highlights['fnc'][$this->fnc_beslut]['i'];\n\t else $reply[] = '';\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::var_dump('fnc_beslut',$this->fnc_beslut,date('Y-m-d',$this->rec['v_end']),$reply);\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::internalError();\n\t}else{ \n\t $reply = array('','');\n\t}\n\t// $t = $reply; array_unshift($t,2,$this->rec['v_id']); $this->dbg($t,True);\n\treturn $reply;\n }\n\n bTiming()->cpu(__function__);\n\n // \n // See what should we do, depends on the visit status \n //\n $reply = array('','');\n $v_status = bForm_vm_Visit::_getStatus($this->rec,$check_clashes=True);\n switch($v_status){\n \n case STATUS_CLASH:\n break;\n\n case STATUS_NO: \n $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT:\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Ni')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('NY'))\n\t\t : array('',$this->say('Ni')));\n }\n break;\n \n case STATUS_PENDING:\n if (@$this->rec['_a_name'] !== LODGING_OA_TXT) $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT: // auto-accept the rents\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setStatus(STATUS_YES);\n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_status'] = STATUS_YES;\n\tbreak;\n\t\n case VISIT_OUT_OF_SCOPE:\n\tbreak 2;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array($this->say('Y'),\n\t\t\t $this->say('N'))\n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n default:\n\tb_debug::internalError('?? v_type=\"'.$this->rec['v_type'].'\"');\n }\n break;\n \n case STATUS_YES:\n switch ($this->rec['v_type']){\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\n case VISIT_TYPE_RENT:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_policy'] = $this->v->getValue('v_policy',1,1);\n\tbreak;\n\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (!$this->v) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Yi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('YN'))\n\t\t : array('',$this->say('Yi')));\n\tbreak;\n }\n }\n bTiming()->cpu();\n // $t = $reply; array_unshift($t,3,$this->rec['v_id']); $this->dbg($t,True);\n return $reply;\n }", "public function isStatusNotPaid()\n {\n return $this->status == self::_ORDER_STATUS_NEW || $this->status == self::_ORDER_STATUS_REJECTED;\n }", "public static function maybe_push_optin_notice() {\n\t\tif ( self::get_optIn_state() == false && apply_filters( 'xl_optin_notif_show', self::$should_show_optin ) ) {\n\t\t\tdo_action( 'maybe_push_optin_notice_state_action' );\n\t\t}\n\t}", "public function rejectTerms(){\n $db = DB::prepare('Delete FROM accept_terms WHERE user_id = ?');//Status 1 == accepted\n return $db->execute(array($this->id));\n }", "function is_not_paying() {\n\t\t\treturn ( $this->is_trial() || $this->is_free_plan() );\n\t\t}", "public function authorize()\n {\n return Auth::user()->data_confirmacao != null;\n }", "public function testItCanRejectASuggestedEditPendingCuration()\n {\n $this->logInAsUser(['curator' => 1]);\n\n $edit = factory('App\\Models\\SuggestedEdit')->create();\n\n $this->get('/curation/edits/reject/' . $edit->id)->assertResponseStatus(302);\n\n $this->seeInDatabase('suggested_edits', [\n 'id' => $edit->id,\n 'approved' => 0,\n ]);\n }", "public static function isOverdue()\n {\n $config = JRegister::get('config');\n\n // Verify access token exist\n if (!$config->get('accessToken', false))\n {\n return false;\n }\n\n // Verify oauth start time and expires_in exist\n $oauthStartTime = $config->get('time');\n $oauthLengthTime = $config->get('expiresIn');\n if (!$oauthStartTime || !$oauthLengthTime)\n {\n return false;\n }\n\n // Verify oauth end time is useful or not\n return !($oauthStartTime/1000 + $oauthLengthTime < time());\n }", "public function pre_confirmation_check() {\n return false;\n }", "public function contentIsNotLockedForEditors() {}", "function tm_admin_notice() {\n\tif( ini_get('safe_mode') ){\n ?>\n <div class=\"error\">\n <p><?php _e( '<p><strong>SAFE MODE is active on your hosting</strong></p> <p>Some options in <strong>Howes theme</strong> may not work including \"Demo content installation\" and \"Theme Options settings\". Please contact your hosting service provider and ask them to disable SAFE MODE.</p>', 'howes' ); ?></p>\n </div>\n <?php\n\t}\n}", "public function hasPendingActions()\r\n {\r\n }", "function eman_post_reviewable( $post )\n{\n\t// Get current post status\n\t$status = emanager_post::status($post, 'slug');\n\tif ( $status && ! in_array($status, array('void','approved','approve','draft','revise','executed')) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "function teacher_approved()\r\n{\r\n\r\n include \"connect.inc.php\";\r\n\r\n\r\n $ssn = $_SESSION['SSN'];\r\n\r\n /*Checking if the user is in Approve phase or not*/\r\n $query = \"SELECT * FROM `teachers_approve` WHERE `SSN`='$ssn'\";\r\n\r\n $query_run = mysqli_query($con, $query);\r\n\r\n /*If the teacher is not in approval table*/\r\n if (mysqli_num_rows($query_run) == 0) {\r\n\r\n return true;\r\n\r\n\r\n } /*If the teacher was not approved*/\r\n else {\r\n\r\n return false;\r\n\r\n }\r\n\r\n\r\n}", "public function isIgnoreObserver(){\n\t\t$ignore = true;\n\t\t$data = Mage::app()->getRequest()->getParams();\n\t\tif (isset($data['echeck_dropship']) && $data['echeck_dropship'] == 1)$ignore = false;\n\t\treturn $ignore;\n\t}", "private function getApproveSettings()\n\t{\n\t\tif(!$this->approve){\n\t\t\treturn false;\n\t\t}\n\n\t\t# If approval is only required if there is a change to a form\n\t\tif($this->approve === \"change\"){\n\t\t\t$this->approve = [\"change\" => true];\n\t\t}\n\n\t\t# If an approval to close the script is required, it cannot be dismissible\n\t\t$this->dismissible = false;\n\n\t\tif(is_array($this->approve)){\n\t\t\t//the most common way\n\t\t\textract($this->approve);\n\t\t}\n\t\telse if(is_string($this->approve)){\n\t\t\t//if just the name of the thing to be removed is given\n\t\t\t$colour = \"grey\";\n\t\t\t$message = str::title(\"Are you sure you want to {$this->approve}?\");\n\t\t}\n\t\t//\t\telse {\n\t\t//\t\t\t//if just set to true or any other object\n\t\t//\t\t\t$title = \"Close this window?\";\n\t\t//\t\t\t$message = \"Any changes you may have made, will be lost.\";\n\t\t//\t\t}\n\n\t\t# If the message contains line breaks, it will break JavaScript, remove\n\t\t$message = str_replace([\"\\r\\n\", \"\\r\", \"\\n\"], \" \", $message);\n\n\t\t# Set up icons, colour\n\t\t$icon_class = Icon::getClass($icon);\n\t\t$type = str::translate_approve_colour($colour);\n\t\t$button_colour = str::getColour($colour, \"btn\");\n\n\t\t# For this method, we _do_ want to remove empty values\n\t\treturn str::array_filter_recursive([\n\t\t\t\"change\" => $change,\n\t\t\t\"type\" => $type,\n\t\t\t\"icon\" => $icon_class,\n\t\t\t\"title\" => $title,\n\t\t\t\"content\" => $message,\n\t\t\t\"buttons\" => [\n\t\t\t\t\"confirm\" => [\n\t\t\t\t\t\"btnClass\" => $button_colour,\n\t\t\t\t],\n\t\t\t],\n\t\t]);\n\t}", "public function authorize()\n {\n return !Cache::has('announcement');\n }", "public function isPending()\n {\n // check if model approved by all roles in the model\n return $this->pendingItem($this->approvedByRole());\n }", "public function pageIsNotLockedForEditors() {}", "function plugin_statssummary_bad_behavior2 ()\n{\n global $LANG_BAD_BEHAVIOR;\n\n if (SEC_inGroup ('Bad Behavior2 Admin') && function_exists('bb2_insert_head')) {\n $blocked_ips = BB_countBlockedIPs ();\n\n return array ($LANG_BAD_BEHAVIOR['blocked_ips'],\n COM_numberFormat ($blocked_ips));\n } else {\n return false;\n }\n}" ]
[ "0.63948023", "0.600258", "0.60017776", "0.59890926", "0.5855901", "0.5773095", "0.5771681", "0.5765917", "0.5735689", "0.572867", "0.5676405", "0.5641486", "0.56408525", "0.5622237", "0.56174344", "0.56074584", "0.56007814", "0.55976695", "0.55892813", "0.54917336", "0.5483113", "0.54705644", "0.54688436", "0.54684967", "0.54620606", "0.5448459", "0.5419632", "0.54190356", "0.5403236", "0.54020554", "0.53821003", "0.53767425", "0.53682774", "0.5361033", "0.5346168", "0.5334055", "0.5329007", "0.5323477", "0.5322924", "0.53217125", "0.53170604", "0.5314834", "0.5291253", "0.52912074", "0.52907217", "0.5290325", "0.5286612", "0.5271458", "0.5270138", "0.526704", "0.52636653", "0.5260024", "0.5256221", "0.5254586", "0.5247574", "0.52335256", "0.52333546", "0.52327204", "0.5228933", "0.5225899", "0.5225634", "0.52219117", "0.52168715", "0.52069354", "0.52059466", "0.5204668", "0.51978725", "0.51939386", "0.5193015", "0.5192925", "0.5191536", "0.51878047", "0.51699585", "0.5167063", "0.51564854", "0.51500887", "0.514933", "0.51450044", "0.51434195", "0.513705", "0.51367193", "0.5127153", "0.5119258", "0.51123613", "0.51048476", "0.5104447", "0.5103298", "0.50987107", "0.5093241", "0.5089056", "0.5087444", "0.50810987", "0.50807905", "0.50777894", "0.5076043", "0.5073782", "0.5073084", "0.5072139", "0.5072048", "0.50679517" ]
0.59428376
4
Sets the date time of the tip
public function setDatetime(\DateTime $datetime) { $this->datetime = $datetime; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setDate()\n\t{\n\t\tif ($this->getIsNewRecord())\n\t\t\t$this->create_time = time();\n\t}", "function set_date_to_now()\n {\n $this->timestamp=time();\n }", "function set_event_date_time() {\r\n\t\t\t$dateobj = date_create($this->date . \" \" . $this->time);\r\n\t\t\t\r\n\t\t\t//we can format the date object string to exactly what we want. Leading zeros, etc.\r\n\t\t\t$this->event_date_time = date_format($dateobj, \"Y-m-d H:i:s\");\r\n\t\t}", "public function setTimeStamp()\n\t{\n\t\t$this->_current_timestamp = time();\n\t}", "public function setDateTime($value)\n {\n $this->createdAt=$value;\n }", "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}", "function CIR_setDateAndTimeTemorarily()\n{\n\t$date = date('mdHiY.s');\n\techo(\"\\ndate $date\\n\");\n}", "public function set_dates(){\n // if the id is not set, this means its anew item being created\n if(property_exists($this, 'created_on') && empty($this->id)){\n $this->created_on = date('Y-m-d H:i:s');\n }\n\n // if id is set, its an update\n if(property_exists($this, 'last_updated_on') && isset($this->id)){\n $this->last_updated_on = date('Y-m-d H:i:s');\n }\n }", "public function setDateTime($value) {\n\t\t$this->datetime = $value;\n\t}", "public function setDate($value) {\n\t\t$this->_date = $value;\n\t}", "public function setDate($date);", "public function setTime(?DateTime $value): void {\n $this->getBackingStore()->set('time', $value);\n }", "static public function setTestingNow(\\DateTime $date = null)\n {\n self::$now = $date;\n }", "public function setStartTime() {\n\t\t$this->pg_start = $this->getStartTime();\n\t}", "function setTimeOffset($value)\n {\n $this->_props['TimeOffset'] = $value;\n }", "public function setDate($date){\n\t\t$this->date = $date;\n\t}", "function set_time($newhour, $newminute, $newday, $newmonth, $newyear)\n {\n //sets the Date object given the hour, minute, day, month, and year\n $newtimestamp=mktime( $newhour, $newminute, 0, $newmonth, $newday, $newyear);\n $this->timestamp=$newtimestamp;\n }", "public function setTimeStamp($value)\n\t{\n\t\tif($value===null || (is_string($value) && trim($value)===''))\n\t\t\t$this->setText('');\n\t\telse\n\t\t{\n\t\t\t$date = TPropertyValue::ensureFloat($value);\n\t\t\t$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$this->getDateFormat());\n\t\t\t$this->setText($formatter->format($date));\n\t\t}\n\t}", "public function setData()\n {\n $this->data=new \\DateTime('now');\n\n }", "public function setTimeOverride( $time ) {\n\t\t$this->time = $time;\n\t}", "public function setDate($p)\n {\n if ($p !== null && trim($p) !== \"\") {\n $this->appendCommandArgument(\"-D\");\n $this->appendCommandArgument($p);\n }\n }", "private function _setDate(){\n\t\tif($this->_year>=1970&&$this->_year<=2038){\n\t\t\t$this->_day = date('d', $this->_timestamp);\n\t\t\t$this->_month = date('m', $this->_timestamp);\n\t\t\t$this->_year = date('Y', $this->_timestamp);\n\t\t} else {\n\t\t\t$dateParts = self::_getDateParts($this->_timestamp, true);\n\t\t\t$this->_day = sprintf('%02s', $dateParts['mday']);\n\t\t\t$this->_month = sprintf('%02s', $dateParts['mon']);\n\t\t\t$this->_year = $dateParts['year'];\n\t\t}\n\t\t$this->_date = $this->_year.'-'.$this->_month.'-'.$this->_day;\n\t}", "public function setDate($date) {\n $this->date = $date;\n }", "function setData($data)\n {\n $this->date=$data;\n }", "public function setDueDateTime($timestamp);", "private function set_details() {\n if ($this->type != 'delivery') {\n $meetup = $this->retrieve([\n 'where' => [\n 'id' => $this->type,\n ],\n 'table' => 'meetups'\n ]);\n \n $this->time = \"{$meetup[0]['day']} {$meetup[0]['start_time']} - {$meetup[0]['end_time']}\";\n\n $this->update([\n 'time' => $this->time,\n ]);\n }\n }", "public function setDate($date)\n\t{\n\t\t$this->date = $date;\n\t}", "private function setLastModifiedDateTime() {\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"UPDATE `$this->table` SET `datetime-last-modified` = NOW() WHERE `id` = ?\");\n\t\t\t$stmt->execute([$this->getID()]);\n\t\t} catch (PDOException $e) {\n\t\t\techo 'Post.class.php setLastModifiedDateTime() error: <br />';\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\n\t\t// Because we set the datetime from MySQL, we can't use PHP's datetime function to get the time as it may be slightly different\n\t\t$stmt = $this->db->prepare(\"SELECT `datetime-last-modified` FROM `$this->table` WHERE `id` = ?\");\n\t\t$stmt->execute([$this->getID()]);\n\n\t\tforeach ($stmt as $row) {\n\t\t\t$this->lastModifiedDate = $row['datetime-last-modified'];\n\t\t}\n\t}", "public function setDate($date)\n {\n $this->date = $date;\n }", "public function setDate($date)\n {\n $this->date = $date;\n }", "private function setPublishedDateTime() {\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"UPDATE `$this->table` SET `datetime-published` = NOW() WHERE `id` = ?\");\n\t\t\t$stmt->execute([$this->getID()]);\n\t\t} catch (PDOException $e) {\n\t\t\techo 'Post.class.php setPublishedDateTime() error: <br />';\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\n\t\t// Because we set the datetime from MySQL, we can't use PHP's datetime function to get the time as it may be slightly different\n\t\t$stmt = $this->db->prepare(\"SELECT `datetime-published` FROM `$this->table` WHERE `id` = ?\");\n\t\t$stmt->execute([$this->getID()]);\n\n\t\tforeach ($stmt as $row) {\n\t\t\t$this->datePublished = $row['datetime-published'];\n\t\t}\n\n\t\t// Also set the last modified datetime\n\t\t$this->setLastModifiedDateTime();\n\t}", "public function setTime($time);", "public function setReviewedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('reviewedDateTime', $value);\n }", "public function setXAxisAsTime() {\n\t\t$this->Options['xaxis']['mode'] = \"time\";\n $this->Options['xaxis']['monthNames']=\tarray(\n __('Jan'),\n __('Feb'),\n __('Mar'),\n __('Apr'),\n __('May'),\n __('Jun'),\n __('Jul'),\n __('Aug'),\n __('Sep'),\n __('Oct'),\n __('Nov'),\n __('Dec'),\n );\n\n\t}", "private function setLastUpdateDate( $date ) {\n Mage::getModel('core/config')->saveConfig('taxjar/config/last_update', $date);\n }", "public function setArticle_date($t)\n {\n if(is_string($t))\n $this->_article_date = $t;\n }", "public function setTime($time=0){\n\t\t\t$this->_time = $time;\n\t\t}", "public function testSetTime() {\n $time = new \\DateTime();\n $this->order->setTime($time);\n $this->assertEquals($time, $this->order->getTime());\n }", "public function updateTopicModifiedDate()\n {\n $this->setAttribute( 'modified', time() );\n $this->store();\n }", "function SetInitialDate ($date)\r\n {\r\n if ($date)\r\n {\r\n $this->_dti = $date; \r\n }\r\n }", "public function setProcessCreationDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('processCreationDateTime', $value);\n }", "public function setDate($date){\r\n\t\t$this->wishDate = $date;\r\n\t}", "public function setPostDateTime($newPostDateTime = null) : void {\n\t\tif($newPostDateTime === null) {\n\t\t\t$this->postDateTime = new /DateTime();\n\t\t\treturn;\n\t\t}\n\t}", "public function touch()\n\t{\n\t\t$this['last_dismiss_date'] = new \\DateTime();\n\t\t$this['last_email_date'] = new \\DateTime();\n\t}", "function setDueDate( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->DueDate = $value;\n }", "function set_timecreated() {\n $this->timecreated = time();\n return true;\n }", "public function setCreateDates(){\n $t = date_create(date('Y-m-d H:i:s'));\n $this->created = $t;\n $this->modified = $t;\n }", "public function set_date_created( $date = null ) {\n\t\tglobal $wpdb;\n\n\t\tif ( ! is_null( $date ) ) {\n\n\t\t\t$datetime_string = wcs_get_datetime_utc_string( wcs_get_datetime_from( $date ) );\n\n\t\t\t// Don't use wp_update_post() to avoid infinite loops here\n\t\t\t$wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET post_date = %s, post_date_gmt = %s WHERE ID = %d\", get_date_from_gmt( $datetime_string ), $datetime_string, $this->get_id() ) );\n\n\t\t\t$this->post->post_date = get_date_from_gmt( $datetime_string );\n\t\t\t$this->post->post_date_gmt = $datetime_string;\n\t\t}\n\t}", "public function setServerTime();", "public function setTakenDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('takenDateTime', $value);\n }", "public function setTakingDate($takingDate) {\n $this->_takingDate = $takingDate;\n }", "public function setUseDateTime($use_datetime) \n \t{\n \t\t$this->use_datetime = $use_datetime;\n \t}", "public function setIssueDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('issueDateTime', $value);\n }", "public function setValueDefault()\n {\n $this->createdAt = new \\DateTime();\n }", "function set_time_zone()\n {\n $this->set_date_to_now();\n $offset = $GLOBALS['time_diff'] - $GLOBALS['server_time_offset'];\n $this->timestamp+=($offset*3600);\n }", "private function actionAlterTablePaymentSetTimestamp() {\n $this->changeTableColumnToTimestamp(TB_VPS_PAYMENT, array(\"payment_date\"), \"payment_id\");\n echo TB_VPS_PAYMENT . \" DONE <br/>\";\n }", "public function setVoteDateTime($newVoteDateTime = null): void {\n\t\t// base case: if the date is null, wait for mysql\n\t\tif($newVoteDateTime === null) {\n\t\t\t$this->voteDateTime = null;\n\t\t\treturn;\n\t\t}\n\t\t// store the like date using the ValidateDate trait\n\t\ttry {\n\t\t\t$newVoteDateTime = self::validateDateTime($newVoteDateTime);\n\t\t} catch(\\InvalidArgumentException | \\RangeException $exception) {\n\t\t\t$exceptionType = get_class($exception);\n\t\t\tthrow(new $exceptionType($exception->getMessage(), 0, $exception));\n\t\t}\n\t\t$this->voteDateTime = $newVoteDateTime;\n\t}", "function setPasswordUpdatedTime(){\n\t\t$this->setPasswordUpdated(time());\n\t}", "function __construct() {\n parent::__construct();\n \n date_default_timezone_set('Europe/London');\n \n $this->updateTime = date('Y-m-d H:m:s', strtotime('now'));\n \n\n }", "public function setSyncTime(): void\n {\n }", "function setTimestamp($timestamp) {\r\r\n\t\t$this->timestamp = $timestamp;\r\r\n\t}", "public\n\tfunction setPostDate($newPostDate = null): void {\n\t\t// base case: if the date is null, use the current date and time\n\t\tif($newPostDate === null) {\n\t\t\t$this->postDate = new \\DateTime();\n\t\t\treturn;\n\t\t}\n\n\n\n\t//store the like date using the ValidateDate trait\n\ttry {\n\t\t$newPostDate = self::validateDateTime($newPostDate);\n\t} catch(\\InvalidArgumentException |\\RangeException $exception) {\n\t\t$exceptionType = get_class($exception);\n\t\tthrow(new $exceptionType($exception->getMessage(), 0, $exception));\n\t}\n\t$this->postDate = $newPostDate;\n\n}", "public function setPostTime($newPostTime = null) {\n\t\t// base case: if the time is null, use the current date and time\n\t\tif($newPostTime === null) {\n\t\t\t$this->postTime = new \\DateTime();\n\t\t\treturn;\n\t\t}\n\n\t\t// store the post time\n\t\ttry {\n\t\t\t$newPostTime = $this->validateDate($newPostTime);\n\t\t} catch(\\InvalidArgumentException $invalidArgument) {\n\t\t\tthrow(new \\InvalidArgumentException($invalidArgument->getMessage(), 0, $invalidArgument));\n\t\t} catch(\\RangeException $range) {\n\t\t\tthrow(new \\RangeException($range->getMessage(), 0, $range));\n\t\t}\n\t\t$this->postTime = $newPostTime;\n\t}", "public function setDate($date_string = null)\n {\n\n if ($this->is_date() == 1) {\n $this->now = getdate(strtotime($date_string));\n } else {\n $this->now = getdate();\n }\n }", "public function setTransactionDate($value) {\n\t\tself::$_transactionDate = $value;\n\t}", "function setWorkTime( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->WorkTime = $value;\n }", "public function setCreated(\\DateTime $created) {\n\n $this->created = $created->format('Y-m-d H:i:s');\n\n }", "public function setTaskStarted()\n {\n // Create our file for this task.\n // Content doesn't matter, but let's write a timestamp. Maybe we'll want it later for performance\n // monitoring, timeouts, etc.\n file_put_contents($this->taskFilePath, time());\n }", "protected function set_date_prop( $date_type, $value ) {\n\t\t$datetime = wcs_get_datetime_from( $value );\n\t\t$date = ! is_null( $datetime ) ? wcs_get_datetime_utc_string( $datetime ) : 0;\n\n\t\t$this->set_prop( $this->get_date_prop_key( $date_type ), $date );\n\t\t$this->schedule->{$date_type} = $date;\n\t}", "public function setTstamp($tstamp) {\n\t\t$this->tstamp = $tstamp;\n\t}", "public function setFirstSeenDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('firstSeenDateTime', $value);\n }", "public function setFirstSeenDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('firstSeenDateTime', $value);\n }", "public function setCreationTimestamp(?DateTime $value): void {\n $this->getBackingStore()->set('creationTimestamp', $value);\n }", "public function setTimeOn($created)\n {\n $this->timeOn = (string)$created;\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "private static function setTimeTracker()\n {\n if (!is_object($GLOBALS['TT'])) {\n $GLOBALS['TT'] = Tx_Smarty_Service_Compatibility::makeInstance('t3lib_TimeTrackNull');\n }\n }", "private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}", "public function setDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('dateTime', $value);\n }", "public function setcreateDatetime($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->createdatetime !== null || $dt !== null) {\n $currentDateAsString = ($this->createdatetime !== null && $tmpDt = new DateTime($this->createdatetime)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->createdatetime = $newDateAsString;\n $this->modifiedColumns[] = ActionTypePeer::CREATEDATETIME;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setTimestampValues($event)\r\n\t{\r\n\t\tif($this->owner instanceof ActiveRecord)\r\n\t\t{\r\n\t\t\t$now = $this->getValue($event);\r\n\t\t\tif($this->owner->getIsNewRecord())\r\n\t\t\t{\r\n\t\t\t\tif($this->owner->hasAttribute($this->createdAtAttribute)) $this->owner->setAttribute($this->createdAtAttribute, $now);\r\n\t\t\t}\r\n\t\t\tif($this->owner->hasAttribute($this->updatedAtAttribute)) $this->owner->setAttribute($this->updatedAtAttribute, $now);\r\n\t\t}\r\n\t}", "public function setDate(?TimeRange $date): void\n {\n $this->date = $date;\n }", "function set_datetime($date)\n{\n return date(\"Y-m-d H:i:s\", strtotime($date));\n}", "private function SetCreated(\\DateTime $value)\n\t\t{\n\t\t\t$this->created = $value;\n\t\t}", "public function onPreUpdate()\n {\n $this->fechaUltimaModificacion = new \\DateTime(\"now\");\n }", "public static function setDateFormatMinutes()\n {\n self::$settings[0] = 'Y-m-d H:i:s';\n }", "public function set_date($date) \n\t{\n\t\tif(! is_numeric($date))\n\t\t{\n\t\t\t$date = strtotime($date);\n\t\t}\n\t\t\n\t\tif($this->version == ATOM)\n\t\t{\n\t\t\t$tag = 'updated';\n\t\t\t$value = date(DATE_ATOM, $date);\n\t\t} \n\t\telseif($this->version == RSS2) \n\t\t{\n\t\t\t$tag = 'pubDate';\n\t\t\t$value = date(DATE_RSS, $date);\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$tag = 'dc:date';\n\t\t\t$value = date(\"Y-m-d\", $date);\n\t\t}\n\t\t\n\t\t$this->add_element($tag, $value); \n\t}", "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 setRequestedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('requestedDateTime', $value);\n }", "public function setReviewDateTime($newReviewDateTime = null) : void {\n\t\t// base case: if the date is null use the current date and time\n\t\tif($newReviewDateTime === null) {\n\t\t\t$this->ReviewDateTime = new \\DateTime();\n\t\t\treturn;\n\t\t}\n\t\t// store the review date using the ValidateDate trait\n\t\ttry {\n\t\t\t$newReviewDateTime = self::validateDateTime($newReviewDateTime);\n\t\t} catch(\\InvalidArgumentException | \\RangeException $exception) {\n\t\t\t$exceptionType = get_class($exception);\n\t\t\tthrow(new $exceptionType($exception->getMessage(), 0, $exception));\n\t\t}\n\n\t\t$this->reviewDateTime = $newReviewDateTime;\n\t}", "public function setLastSeenDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastSeenDateTime', $value);\n }", "public function setLastSeenDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastSeenDateTime', $value);\n }", "function setTimestamp($time_stamp) {\n $this->checkChange(TRUE);\n\n if (variable_get('userpoints_transaction_timestamp', 1)) {\n return $this;\n }\n $this->time_stamp = $time_stamp;\n return $this;\n }" ]
[ "0.70609605", "0.70609605", "0.7016506", "0.694711", "0.67483777", "0.66318166", "0.62429905", "0.6217156", "0.62112564", "0.60512024", "0.60226196", "0.5939672", "0.59212726", "0.5905325", "0.58766663", "0.5873458", "0.58726114", "0.58513504", "0.58444417", "0.5835992", "0.58345115", "0.58316797", "0.5816176", "0.57923806", "0.5790581", "0.5790408", "0.57756686", "0.5768678", "0.5759923", "0.5755971", "0.57529354", "0.57529354", "0.5750457", "0.5745209", "0.57366997", "0.57326573", "0.5728281", "0.57132757", "0.5699952", "0.5694224", "0.56679755", "0.5660231", "0.56441545", "0.5642574", "0.5640352", "0.5606723", "0.55988693", "0.55974966", "0.55917794", "0.55868167", "0.5584059", "0.55828893", "0.5578869", "0.5578862", "0.5570493", "0.5568382", "0.5560507", "0.555571", "0.55523753", "0.5544389", "0.5541624", "0.5539918", "0.55384576", "0.5524933", "0.5520187", "0.5516429", "0.5512938", "0.55083066", "0.5495517", "0.54898083", "0.54852563", "0.54843324", "0.54814297", "0.54814297", "0.5481068", "0.54715794", "0.546628", "0.546628", "0.546628", "0.546628", "0.546628", "0.546628", "0.546628", "0.546628", "0.54562896", "0.5454941", "0.54497963", "0.544809", "0.5438398", "0.54361826", "0.54304445", "0.54280305", "0.5422791", "0.54195434", "0.54128695", "0.5410565", "0.5410078", "0.54091406", "0.54031026", "0.54031026", "0.5402682" ]
0.0
-1
Sets the currently associated product.
public function setProduct(Product $product) { $this->product = $product; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setProduct( $product )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n if ( get_class( $product ) == \"ezproduct\" )\n {\n $this->ProductID = $product->id();\n }\n }", "public function setProduct(Product $product);", "public function setProduct()\n {\n // get the existing products array\n $products = $this->getProducts();\n // push the new product to the array\n array_push($products, $this);\n $file = fopen($_SERVER['DOCUMENT_ROOT'] . \"/mpm_challenge/problem4/db/db.json\", \"w+\") or die(\"not opened\");\n fwrite($file, json_encode($products));\n fclose($file);\n }", "public function setProduct(Product $product)\n {\n $this->product_id = $product->id;\n $this->_calculateTotal();\n }", "public function set_product($_product)\n {\n $this->_product = $_product;\n\n return $this;\n }", "public function setProductId($product_id){\n $this->product_id = $product_id;\n }", "public static function product($product)\n {\n static::$product = $product;\n }", "public function salesQuoteItemSetProduct($observer)\n\t{\n\t\t$quoteItem = $observer->getQuoteItem();\n\t\t$product = $observer->getProduct();\n\n\t\tif ($product->isConfigurable() && $quoteItem->getHasChildren())\n\t\t{\n\t\t\tforeach ($quoteItem->getChildren() as $child)\n\t\t\t{\n\t\t\t\tforeach ($child->getProduct()->getProductOptionsCollection() as $option)\n\t\t\t\t{\n\t\t\t\t\t$option->setProduct($product);\n\t\t\t\t\t$product->addOption($option);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function setProduct(LineItemProduct $product)\n\t{\n\t\t$this->addKeyValue('product', $product); \n\n\t}", "public function setProduct($product) {\n $this->_product = $product;\n return $this;\n }", "public function setProduct($product)\r\n {\r\n $this->product = $product;\r\n\r\n return $this;\r\n }", "public function setProduct($product)\n {\n $this->product = $product;\n return $this;\n }", "public function product($prod) {\n\t\t$this->upsProductCode = $prod;\n\t}", "function setSyncItemsCodeProduct()\n {\n }", "private function setExternalProductDetails() {\n /** @var ExternalProductAdapter $product */\n $product = $this->product;\n\n $product->set_button_text($this->wcData->getButtonText());\n $product->set_product_url($this->wcData->getProductUrl());\n }", "public function getProduct(){\r\n return Mage::registry('current_product');\r\n }", "function setProductId($productId) {\n\t\t$this->productId = $productId;\n\t\treturn $this;\n\t}", "public function setProduct($product)\n {\n $this->product = $product;\n\n return $this;\n }", "function setProductuuid($product_uuid)\n {\n $this->product_uuid = $product_uuid;\n }", "private function setPurchaseNote() {\n $this->product->set_purchase_note($this->wcData->getPurchaseNote());\n }", "public function setProduct(ProductInterface $product)\n {\n $this->product = $product;\n return $this;\n }", "public function setProductName($product_name){\n $this->product_name = $product_name;\n }", "public function setIdProduct($idProduct): self\n {\n $this->idProduct = $idProduct;\n\n return $this;\n }", "private function setProductObjectId(object $object): void\n {\n //====================================================================//\n // Identify Product Id\n if ($object instanceof Product) {\n $this->objectId = (string) $object->id;\n } elseif ($object instanceof MouvementStock) {\n $this->objectId = (string) $object->product_id;\n }\n }", "public function setProducto($pro){ $this->producto = $pro;}", "public function setProductId($id);", "public function setIdProduct($idProduct)\n {\n $this->idProduct = $idProduct;\n\n return $this;\n }", "public function getProduct()\n {\n return Mage::registry('current_product');\n }", "function product( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $ret = new eZProduct( $this->ProductID );\n \n return $ret;\n }", "public function setProductIdAttribute($input)\n {\n $this->attributes['product_id'] = $input ? $input : null;\n }", "public function set_product(\\Venus\\src\\Helium\\Entity\\product $product)\n\t{\n\t\t$this->product = $product;\n\t\treturn $this;\n\t}", "public function updateProduct()\n {\n \t$quote=$this->getQuote();\n \tif($quote)\n \t{\n \t\t$detailproduct=$this->getProduct();\n \t\t$quoteproduct=$quote->getProduct();\n \t\tif(\n\t\t\t\t$quote->getPrice()!=$this->getPrice() or\n\t\t\t\t$quote->getDiscrate()!=$this->getDiscrate() or\n\t\t\t\t$quote->getDiscamt()!=$this->getDiscamt() or\n\t\t\t\t$quote->getProductId()!=$this->getProductId()\n\t\t\t)\n\t\t\t{\n\t\t\t\t$quote->setPrice($this->getPrice());\n\t\t\t\t$quote->setDiscrate($this->getDiscrate());\n\t\t\t\t$quote->setDiscamt($this->getDiscamt());\n\t\t\t\t$quote->setProductId($this->getProductId());\n\t\t\t\t$quote->calc(); //auto save\n\t\t\t\t$detailproduct->calcSalePrices();\n\t\t\t\t\n\t\t\t\t//if product changed, calc old product\n\t\t\t\tif($quoteproduct->getId()!=$detailproduct->getId())\n\t\t\t\t\t$quoteproduct->calcSalePrices();\n\t\t\t}\n \t}\n \telse\n \t{\n\t\t\t//if none, see if product quote by vendor with similar pricing exists. \n\t\t\t$quote=Fetcher::fetchOne(\"Quote\",array('total'=>$this->getUnittotal(),'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),'product_id'=>$this->getProductId()));\n\n\t\t\t//if it doesn't exist, create it, and product->calc()\n\t\t\tif(!$quote)\n\t\t\t{\n\t\t\t\tQuoteTable::createOne(array(\n\t\t\t\t\t'date'=>$this->getInvoice()->getDate(),\n\t\t\t\t\t'price'=>$this->getPrice(),\n\t\t\t\t\t'discrate'=>$this->getDiscrate(),\n\t\t\t\t\t'discamt'=>$this->getDiscamt(),\n\t\t\t\t\t'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),\n\t\t\t\t\t'product_id'=>$this->getProductId(),\n\t\t\t\t\t'ref_class'=>\"Invoicedetail\",\n\t\t\t\t\t'ref_id'=>$this->getId(),\n\t\t\t\t\t'mine'=>1,\n\t\t\t\t\t));\n\t\t\t\t$this->getProduct()->calcSalePrices();\n\t\t\t}\n \t}\n }", "protected function _initProduct()\n {\n $this->_title($this->__('Catalog'))\n ->_title($this->__('Manage Products'));\n\n $productId = (int) $this->getRequest()->getParam('id');\n $product = Mage::getModel('catalog/product')\n ->setStoreId($this->getRequest()->getParam('store', 0));\n\n // Hack\n\n $this->getRequest()->setParam('set',4);\n $this->getRequest()->setParam('type','simple');\n if (!$productId) {\n if ($setId = (int) $this->getRequest()->getParam('set')) {\n $product->setAttributeSetId($setId);\n }\n\n if ($typeId = $this->getRequest()->getParam('type')) {\n $product->setTypeId($typeId);\n }\n }\n\n $product->setData('_edit_mode', true);\n if ($productId) {\n try {\n $product->load($productId);\n\n } catch (Exception $e) {\n $product->setTypeId(Mage_Catalog_Model_Product_Type::DEFAULT_TYPE);\n Mage::logException($e);\n }\n }\n\n $attributes = $this->getRequest()->getParam('attributes');\n if ($attributes && $product->isConfigurable() &&\n (!$productId || !$product->getTypeInstance()->getUsedProductAttributeIds())) {\n $product->getTypeInstance()->setUsedProductAttributeIds(\n explode(\",\", base64_decode(urldecode($attributes)))\n );\n }\n\n // Required attributes of simple product for configurable creation\n if ($this->getRequest()->getParam('popup')\n && $requiredAttributes = $this->getRequest()->getParam('required')) {\n $requiredAttributes = explode(\",\", $requiredAttributes);\n foreach ($product->getAttributes() as $attribute) {\n if (in_array($attribute->getId(), $requiredAttributes)) {\n $attribute->setIsRequired(1);\n }\n }\n }\n\n if ($this->getRequest()->getParam('popup')\n && $this->getRequest()->getParam('product')\n && !is_array($this->getRequest()->getParam('product'))\n && $this->getRequest()->getParam('id', false) === false) {\n\n $configProduct = Mage::getModel('catalog/product')\n ->setStoreId(0)\n ->load($this->getRequest()->getParam('product'))\n ->setTypeId($this->getRequest()->getParam('type'));\n\n /* @var $configProduct Mage_Catalog_Model_Product */\n $data = array();\n foreach ($configProduct->getTypeInstance()->getEditableAttributes() as $attribute) {\n\n /* @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */\n if(!$attribute->getIsUnique()\n && $attribute->getFrontend()->getInputType()!='gallery'\n && $attribute->getAttributeCode() != 'required_options'\n && $attribute->getAttributeCode() != 'has_options'\n && $attribute->getAttributeCode() != $configProduct->getIdFieldName()) {\n $data[$attribute->getAttributeCode()] = $configProduct->getData($attribute->getAttributeCode());\n }\n }\n\n $product->addData($data)\n ->setWebsiteIds($configProduct->getWebsiteIds());\n }\n\n Mage::register('product', $product);\n Mage::register('current_product', $product);\n Mage::getSingleton('cms/wysiwyg_config')->setStoreId($this->getRequest()->getParam('store'));\n return $product;\n }", "public function updateProduct(Product $product);", "public function setId_product($id_product)\n {\n $this->id_product = $id_product;\n\n return $this;\n }", "public function setPromotion($first,$second)\n {\n $this->promotion->setPromotion($first,$second);\n //product Id for identify products\n $this->promotion->setProductId($this->id);\n }", "public function getProduct()\r\n {\r\n return $this->product;\r\n }", "public function getProduct() {\n return $this->_registry->registry ( 'current_product' );\n }", "public function setProductId($image_id, $product_id){\r\n $this->ID = (int)$image_id;\r\n $this->product_id = $product_id;\r\n \r\n return $this->update();\r\n }", "protected function setProduct_id($value)\n\t{\n\t\tif (isInt($value) || is_null($value)) { $this->product_id = $value; }\n\t}", "public function testSetPriceProduct()\n {\n $product = new Product();\n $value = 10.99;\n $product->setPrice($value);\n $this->assertEquals($value, $product->getPrice());\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "private function setRecountProduct() {\n\n //$this->model->setDocumentNumber($this->getDocumentNumber);\n $sql = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n INSERT INTO `productrecount` \n (\n `companyId`,\n `warehouseId`,\n `productCode`,\n `productDescription`,\n `productRecountDate`,\n `productRecountSystemQuantity`,\n `productRecountPhysicalQuantity`,\n `isDefault`,\n `isNew`,\n `isDraft`,\n `isUpdate`,\n `isDelete`,\n `isActive`,\n `isApproved`,\n `isReview`,\n `isPost`,\n `executeBy`,\n `executeTime`\n ) VALUES ( \n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n INSERT INTO [productRecount]\n (\n [productRecountId],\n [companyId],\n [warehouseId],\n [productCode],\n [productDescription],\n [productRecountDate],\n [productRecountSystemQuantity],\n [productRecountPhysicalQuantity],\n [isDefault],\n [isNew],\n [isDraft],\n [isUpdate],\n [isDelete],\n [isActive],\n [isApproved],\n [isReview],\n [isPost],\n [executeBy],\n [executeTime]\n) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n INSERT INTO PRODUCTRECOUNT\n (\n COMPANYID,\n WAREHOUSEID,\n PRODUCTCODE,\n PRODUCTDESCRIPTION,\n PRODUCTRECOUNTDATE,\n PRODUCTRECOUNTSYSTEMQUANTITY,\n PRODUCTRECOUNTPHYSICALQUANTITY,\n ISDEFAULT,\n ISNEW,\n ISDRAFT,\n ISUPDATE,\n ISDELETE,\n ISACTIVE,\n ISAPPROVED,\n ISREVIEW,\n ISPOST,\n EXECUTEBY,\n EXECUTETIME\n ) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n }\n }\n }\n try {\n $this->q->create($sql);\n } catch (\\Exception $e) {\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n }", "function setProductCode($productCode)\n {\n $this->productCode = $productCode;\n }", "public function setDefaultProduct($product) {\n $this->values->put('DefaultProduct', $product);\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Api\\v1\\Product', 'n_ProductId_FK')->withDefault();\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function set_id_product($id_product) \n\t{\n\t\t$this->id_product = $id_product;\n\t\treturn $this;\n\t}", "public function beforeUpdate()\n {\n $product = self::find($this->id);\n self::$product_group = $product->group_id;\n }", "private function prepareCurrentItem()\n {\n $item = $this->registry->registry('current_item');\n $product = $this->registry->registry('current_product');\n\n if ($item && $product) {\n return;\n }\n\n try {\n $parentBlock = $this->getParentBlock();\n $layout = $this->getLayout();\n if ($layout) {\n $additionalProductInfoBlock = $layout->getBlock('additional.product.info');\n } else {\n $additionalProductInfoBlock = null;\n }\n\n if ($parentBlock) {\n $item = $parentBlock->getItem();\n } elseif ($additionalProductInfoBlock) {\n /** @var \\Magento\\Quote\\Model\\Quote\\Item $item */\n $item = $additionalProductInfoBlock->getItem();\n }\n\n if ($item) {\n $this->registry->unregister('current_item');\n $this->registry->register('current_item', $item);\n $this->registry->unregister('current_product');\n $this->registry->register('current_product', $item->getProduct());\n }\n } catch (LocalizedException $exception) {\n $this->_logger->error($exception->getLogMessage());\n }\n }", "public function setPriceProduct($value)\n {\n $this->priceProduct = $value;\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function setProductId($value)\n {\n return $this->set(self::product_id, $value);\n }", "public function setProductReference($product_reference)\n {\n $this->product_reference = $product_reference;\n }", "public function setProduct($product = null)\n {\n // validation for constraint: string\n if (!is_null($product) && !is_string($product)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($product, true), gettype($product)), __LINE__);\n }\n if (is_null($product) || (is_array($product) && empty($product))) {\n unset($this->product);\n } else {\n $this->product = $product;\n }\n return $this;\n }", "public function product()\n {\n return $this->belongsTo('App\\Entities\\Product');\n }", "public function get_product()\n {\n return $this->_product;\n }", "public function setProduct(\\App\\Entity\\Product\\Product $product = null) \n { \n $this->product = $product;\n \n return $this;\n }", "public function product()\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "private function setOffer(&$full_product_list, $product_attributes, $product, $parent = false) {\n if ($parent) {\n $image = wp_get_attachment_image_src($product->get_image_id(), 'full');\n\n if (!$image) {\n $image = wp_get_attachment_image_src($parent->get_image_id(), 'full');\n }\n\n $term_list = $parent->get_category_ids();\n $attributes = get_post_meta($parent->get_id(), '_product_attributes');\n } else {\n $image = wp_get_attachment_image_src($product->get_image_id(), 'full');\n $term_list = $product->get_category_ids();\n $attributes = get_post_meta($product->get_id(), '_product_attributes');\n }\n\n $attributes = (isset($attributes[0])) ? $attributes[0] : $attributes;\n\n $params = array();\n\n if (!empty($attributes)) {\n foreach ($attributes as $attribute_name => $attribute) {\n $attributeValue = $product->get_attribute($attribute_name);\n if ($attribute['is_visible'] == 1 && !empty($attributeValue)) {\n $params[] = array(\n 'code' => $attribute_name,\n 'name' => $product_attributes[$attribute_name],\n 'value' => $attributeValue\n );\n }\n }\n }\n\n $dimensions = '';\n\n if ($product->get_length() != '') {\n $dimensions = wc_get_dimension($product->get_length(), 'cm');\n }\n\n if ($product->get_width() != '') {\n $dimensions .= '/' . wc_get_dimension($product->get_width(), 'cm');\n }\n\n if ($product->get_height() != '') {\n $dimensions .= '/' . wc_get_dimension($product->get_height(), 'cm');\n }\n\n $weight = '';\n\n if ($product->get_weight() != '') {\n $weight = wc_get_weight($product->get_weight(), 'kg');\n }\n\n if ($product->is_taxable()) {\n $tax_rates = WC_Tax::get_rates($product->get_tax_class());\n $tax = reset($tax_rates);\n }\n\n if ($product->get_manage_stock() == true) {\n $stockQuantity = $product->get_stock_quantity();\n $quantity = empty($stockQuantity) === false ? $stockQuantity : 0;\n } else {\n $quantity = $product->get_stock_status() === 'instock' ? 1 : 0;\n }\n\n $product_data = array(\n 'id' => $product->get_id(),\n 'productId' => ($product->get_parent_id() > 0) ? $parent->get_id() : $product->get_id(),\n 'name' => $product->get_name(),\n 'productName' => ($product->get_parent_id() > 0) ? $parent->get_title() : $product->get_title(),\n 'price' => wc_get_price_including_tax($product),\n 'picture' => $image[0],\n 'url' => ($product->get_parent_id() > 0) ? $parent->get_permalink() : $product->get_permalink(),\n 'quantity' => $quantity,\n 'categoryId' => $term_list,\n 'dimensions' => $dimensions,\n 'weight' => $weight,\n 'tax' => isset($tax) ? $tax['rate'] : 'none'\n );\n\n if ($product->get_sku() != '') {\n $params[] = array('code' => 'article', 'name' => 'Артикул', 'value' => $product->get_sku());\n\n if (isset($this->settings['bind_by_sku']) && $this->settings['bind_by_sku'] == WC_Retailcrm_Base::YES) {\n $product_data['xmlId'] = $product->get_sku();\n }\n }\n\n if (!empty($params)) {\n $product_data['params'] = $params;\n }\n\n if (isset($product_data)) {\n $full_product_list[] = $product_data;\n }\n\n unset($product_data);\n }", "public function setProductid( $productid ) {\n\t\t$this->productid = $productid;\n\t}", "protected function set_product_ids() {\n\n\t\t// get the products selected for the report\n\t\t$this->product_ids = isset( $_GET['product_ids'] ) ? array_filter( array_map( 'absint', (array) $_GET['product_ids'] ) ) : array();\n\t}", "public function setProduct(Product $product): ProductNotification\n {\n $this->product = $product;\n \n return $this;\n }", "public function setProductName(string $productName): void\n {\n $this->productName = $productName;\n }", "public function product()\n {\n return $this->belongsTo( Product::class );\n }", "public function product()\n {\n return $this->belongsTo(Product::Class());\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function setName_product($name_product)\n {\n $this->name_product = $name_product;\n\n return $this;\n }", "public function setProductPrice($product_price){\n $this->product_price = $product_price;\n }", "public function product() {\n return $this->belongsTo('App\\Entity\\Product');\n }", "public function getProduct() {\r\n return $this->_product;\r\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function getProduct() {\n return Mage::registry('product');\n }", "public function testSetProductIdGetProductId()\n {\n $oTestObject = oxNew('oxArticleException', $this->_sMsg);\n $this->assertNull($oTestObject->getProductId());\n\n $this->_oTestObject->setProductId('xxx');\n $this->assertEquals('xxx', $this->_oTestObject->getProductId());\n }", "private function attachProductAttributes(Product $product)\n {\n // attach attribute value to product\n if (!empty($this->attributesData)) {\n $product->attributeValues()->syncWithoutDetaching($this->attributesData);\n }\n }", "public function getAssignProduct() {\n return $this->scopeConfig->getValue ( static::XML_ASSIGN_PRODUCT, ScopeInterface::SCOPE_STORE );\n }", "public function testSetWeightProduct()\n {\n $product = new Product();\n $value = 100;\n $product->setWeight($value);\n $this->assertEquals($value, $product->getWeight());\n }", "public function product()\n {\n return $this->hasOne('App\\Models\\Product');\n }", "public function get_id_product()\n\t{\n\t\treturn $this->id_product;\n\t}", "public function product()\n {\n return $this->belongsTo('TechTrader\\Models\\Product');\n }", "public function product()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function product()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function product()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function addProductInfo()\n {\n $attribute = $this->attributeRepository->get('name');\n\n $this->getSelect()->joinLeft(\n ['product_table' => $this->getTable('catalog_product_entity_varchar')],\n \"main_table.product_id = product_table.entity_id AND product_table.store_id = 0\",['product_name' => 'product_table.value']\n )->where('product_table.attribute_id = ?', $attribute->getAttributeId());\n\n return $this;\n }", "public function setProductData($productData) {\r\n $this->_data['ProductData'] = $productData->getData();\r\n return $this;\r\n }", "public function product()\n {\n return $this->m_product;\n }", "public function product()\n {\n return $this->belongsTo('App\\CatalogProduct', 'product_id');\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }" ]
[ "0.76084846", "0.738577", "0.6941138", "0.6913554", "0.65874326", "0.6572435", "0.64851147", "0.6324662", "0.62889665", "0.6217858", "0.61843127", "0.61381173", "0.61021", "0.6041676", "0.60079926", "0.59984267", "0.5983448", "0.59822834", "0.59811795", "0.59408075", "0.5940803", "0.589964", "0.5869113", "0.5862348", "0.58535737", "0.58301157", "0.5811741", "0.58113295", "0.5808756", "0.57933813", "0.5782616", "0.5754362", "0.5745754", "0.57345915", "0.57341707", "0.57084966", "0.5706028", "0.5689232", "0.5685499", "0.56714445", "0.56662977", "0.5660892", "0.5660892", "0.5660892", "0.5660892", "0.5660892", "0.5660892", "0.5655546", "0.56464636", "0.56365204", "0.56357604", "0.5625736", "0.5625736", "0.5623125", "0.55995333", "0.5596928", "0.55953866", "0.5576958", "0.556817", "0.5566476", "0.5540198", "0.5538104", "0.553717", "0.5534484", "0.55327123", "0.55307734", "0.55287594", "0.5526685", "0.55222714", "0.55185354", "0.5509008", "0.5501775", "0.5501592", "0.5501592", "0.5501592", "0.5501592", "0.55005723", "0.54988235", "0.54971516", "0.5493105", "0.54903495", "0.54903495", "0.54903495", "0.5489425", "0.5489239", "0.5484578", "0.5480476", "0.5478632", "0.54762304", "0.5474756", "0.5472179", "0.5465735", "0.5465735", "0.5465735", "0.5455875", "0.5454909", "0.5450599", "0.54438454", "0.5436618", "0.5436618" ]
0.61693954
11
Returns the associated product.
public function getProduct() { return $this->product; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\r\n {\r\n return $this->product;\r\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function get_product()\n {\n return $this->_product;\n }", "public function product()\n {\n return $this->m_product;\n }", "public function getProduct()\n {\n return isset($this->product) ? $this->product : null;\n }", "public function getProduct() {\r\n return $this->_product;\r\n }", "public function product()\n {\n return $this->hasOne('App\\Models\\Product');\n }", "public function getProduct() {\n return $this->getValueOrDefault('Product');\n }", "public function getProduct(): Product\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->getSubscription()->getProduct();\n }", "public function getProduct();", "public function getProduct()\n {\n return $this->coreRegistry->registry('product');\n }", "protected function getProduct() {\n return $this->registry->registry('product');\n }", "public function getProduct()\n\t{\n\t\treturn $this->getKeyValue('product'); \n\n\t}", "public function getProduct()\r\n {\r\n return $this->item->getParentObject()->getProduct();\r\n }", "public function getProduct() {\n\n if (!$this->product) {\n $this->product = $this->productPublicRepository->getById($this->getCartItem()->product_id);\n }\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product instanceof ProductReferenceBuilder ? $this->product->build() : $this->product;\n }", "public function product() {\n $slug = $this->param('slug');\n\n return Products::where('slug', '=', $slug)->first();\n }", "public function getProduct()\r\n {\r\n return $this->_params['product'];\r\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(Product::class, $this->primaryKey);\n\t}", "public function product_detail()\n {\n return $this->has_one('Product_Detail');\n }", "public function getProduct()\n {\n return Mage::registry('product');\n }", "public function getProduct()\n {\n return Mage::registry('product');\n }", "public function getProduct()\n {\n return Mage::registry('product');\n }", "public function getProduct()\n {\n return Mage::registry('current_product');\n }", "function Product() {\r\n\t\treturn $this->owner;\r\n\t}", "public function product()\n {\n //retorna un solo objeto product, la capacitacion solo tiene un producto\n return $this->belongsTo('Vest\\Tables\\Product');\n }", "public function product() \n\t{\n\t\treturn $this->belongsTo('App\\Models\\Product', 'product_id', 'id');\n\t}", "public function getProduct() {\n return $this->_registry->registry ( 'current_product' );\n }", "public function getProduct() {\n return Mage::registry('product');\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo('Tricks\\Product');\n\t}", "public function getProdRelated()\n {\n return $this->prod_related;\n }", "public function getItem()\n {\n return $this->hasOne(CatalogProduct::className(), ['id' => 'item_id']);\n }", "public function getProduct0()\n {\n return $this->hasOne(Products::className(), ['id' => 'product']);\n }", "public function product()\n {\n return $this->belongsTo(config('inventory.models.product-variant'), 'product_variant_id');\n }", "public function getProduct(){\r\n return Mage::registry('current_product');\r\n }", "public function product() {\n return $this->belongsTo('App\\Entity\\Product');\n }", "public function product()\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function getProduct() {\r\n\t\t$id = $this->getRequest()->getParam('id');\r\n\t\t$products = Mage::getModel('catalog/product')->load($id);\r\n\t\treturn $products;\r\n\t}", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product', 'product_id', 'id');\n }", "public function product()\n {\n return $this->belongsTo('App\\Entities\\Product');\n }", "public function product()\n {\n return $this->belongsTo('TechTrader\\Models\\Product');\n }", "public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }", "public function products() {\n\t\treturn $this->hasOne('App\\Product', 'id', 'product_id');\n\t}", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product', 'product_id');\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Api\\v1\\Product', 'n_ProductId_FK')->withDefault();\n }", "public function product()\n {\n // belongsTo(RelatedModel, foreignKey = product_id, keyOnRelatedModel = id)\n return $this->belongsTo(Product::class);\n }", "public function Product()\n\t{\n\t\treturn $this->belongsTo('App\\Product');\n\t}", "public function product()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function product()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function product()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function product()\n {\n return $this->belongsTo('App\\CatalogProduct', 'product_id');\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function product()\n {\n return $this->belongsTo(Product::Class());\n }", "public function product()\n {\n return $this->belongsTo('App\\Product', 'product_id');\n }", "public function product()\n {\n return $this->belongsTo('Modules\\Admin\\Models\\Product','product_id','id');\n }", "public function relatedProducts (){\n #reviews...\n $product= Product::with('reviews')\n ->whereIndumentariaId($this->indumentaria->id)\n ->where('id', '!=', $this->id)\n ->where('status', Product::PUBLISHED)\n ->latest()\n ->limit(6)\n ->get();\n return $product;\n }", "public function product()\n {\n return $this->belongsTo('Laracart\\Product\\Models\\Product', 'product_id');\n\n }", "protected function _getProduct()\n {\n if (!$this->_product) {\n $this->_product = $this->_objectManager->create(\\Magento\\Catalog\\Model\\Product::class);\n $productId = (int)$this->getRequest()->getParam('product', 0);\n $urlRewrite = $this->_getUrlRewrite();\n if (!$productId && $urlRewrite->getId() && $urlRewrite->getEntityType() === self::ENTITY_TYPE_PRODUCT) {\n $productId = $this->_getUrlRewrite()->getEntityId();\n }\n if ($productId) {\n $this->_product->load($productId);\n }\n }\n return $this->_product;\n }", "public function getById($id)\n {\n return $this->product->find($id);\n \n }", "public function product()\n {\n return $this->belongsTo( Product::class );\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product');\n }", "public function product() {\n return $this->morphTo();\n }", "function product( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $ret = new eZProduct( $this->ProductID );\n \n return $ret;\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "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 product()\n {\n return $this->belongsTo('App\\Product');\n\t}", "public function product()\n {\n return $this->hasMany(product::class, 'category_id', 'id');\n }", "public function getProducto(){\n $sql='SELECT idProducto, nombre, precio, descripcion, foto, estado, idCategoria, cantidad, idProveedor from producto WHERE idProducto = ?';\n $params=array($this->id);\n return Database::getRow($sql,$params);\n }", "public function primaryProduct() : object\n {\n return $this->hasOne(Species::class, 'id');\n }", "public function product()\n {\n return $this->belongsTo('App\\Product');\n }", "public function product()\n {\n return $this->belongsTo('App\\Product');\n }", "public function getAssignProduct() {\n return $this->scopeConfig->getValue ( static::XML_ASSIGN_PRODUCT, ScopeInterface::SCOPE_STORE );\n }", "public function product()\n {\n \treturn $this->belongsTo('App\\Product');\n }", "public function product()\n {\n \treturn $this->belongsTo('App\\Product');\n }", "public function product()\n {\n \treturn $this->belongsTo(Product::class);\n }", "protected function getProduct()\n {\n $parentBlock = $this->getParentBlock();\n\n $product = $parentBlock && $parentBlock->getProductItem()\n ? $parentBlock->getProductItem()\n : $this->registry->registry('product');\n return $product;\n }", "public function get_id_product()\n\t{\n\t\treturn $this->id_product;\n\t}", "public function order_product(){\n return $this->hasOne(Order_product::class);\n }", "public function _getProduct() {\n \n // get website id from request\n $websiteId = ( int ) $this->getRequest ()->getParam ( static::WEBSITE_ID );\n if ($websiteId <= 0) {\n $websiteId = Mage::app ()->getWebsite ( 'base' )->getId ();\n }\n \n // get store id from request\n $storeId = ( int ) $this->getRequest ()->getParam ( static::STORE_ID );\n if ($storeId <= 0) {\n $storeId = Mage::app ()->getWebsite ( $websiteId )->getDefaultGroup ()->getDefaultStoreId ();\n }\n if (is_null ( $this->_product )) {\n $productId = $this->getRequest ()->getParam ( 'id' );\n /**\n *\n * @var $productHelper Mage_Catalog_Helper_Product\n */\n $productHelper = Mage::helper ( 'catalog/product' );\n $product = $productHelper->getProduct ( $productId, $storeId );\n if (! ($product->getId ())) {\n $this->_critical ( static::RESOURCE_NOT_FOUND );\n }\n // check if product belongs to website current\n if ($this->_getStore ()->getId ()) {\n $isValidWebsite = in_array ( $websiteId, $product->getWebsiteIds () );\n if (! $isValidWebsite) {\n $this->_critical ( static::RESOURCE_NOT_FOUND );\n }\n }\n // Check display settings for customers & guests\n if ($this->getApiUser ()->getType () != Mage_Api2_Model_Auth_User_Admin::USER_TYPE) {\n // check if product assigned to any website and can be shown\n if ((! Mage::app ()->isSingleStoreMode () && ! count ( $product->getWebsiteIds () )) || ! $productHelper->canShow ( $product )) {\n $this->_critical ( static::RESOURCE_NOT_FOUND );\n }\n }\n $this->_product = $product;\n }\n return $this->_product;\n }", "public function getId()\n {\n return $this->idProduct;\n }", "public function getProductId(){\n return $this->product_id;\n }", "public function get($id){\n $product=Product::find($id);\n return $product;\n }", "public function getId_product()\n {\n return $this->id_product;\n }" ]
[ "0.8086518", "0.8086518", "0.8086518", "0.8086518", "0.78158677", "0.77979565", "0.77979565", "0.77620494", "0.7747835", "0.76479703", "0.7640958", "0.76359206", "0.76004434", "0.7535084", "0.74979556", "0.7445715", "0.74376017", "0.7417451", "0.73797244", "0.7327174", "0.732414", "0.73209876", "0.730434", "0.72891694", "0.7273239", "0.72710264", "0.7267614", "0.7267614", "0.7267614", "0.7226839", "0.7222006", "0.72010094", "0.7196045", "0.7192435", "0.71545655", "0.714619", "0.70861274", "0.7082952", "0.7072989", "0.7053785", "0.7050673", "0.7050647", "0.70454836", "0.70449734", "0.7015123", "0.6992652", "0.69801754", "0.69675094", "0.6963259", "0.69298315", "0.69103324", "0.6892561", "0.6892185", "0.68905103", "0.68905103", "0.68905103", "0.6862061", "0.68420905", "0.6838246", "0.68325216", "0.682237", "0.6817861", "0.6814124", "0.67863274", "0.6776531", "0.6774724", "0.6773031", "0.6773031", "0.6773031", "0.6773031", "0.6755189", "0.6735198", "0.67301863", "0.67129195", "0.67129195", "0.67129195", "0.67077446", "0.6683382", "0.6650471", "0.6645159", "0.6643218", "0.6642517", "0.6642517", "0.663406", "0.6632386", "0.6632386", "0.6626872", "0.66045874", "0.6589136", "0.6585124", "0.6581287", "0.65728474", "0.6571287", "0.6563577", "0.65398943" ]
0.78874624
9
Sets the user who created the tip.
public function setCreator(\TYPO3\CMS\Extbase\Domain\Model\FrontendUser $creator) { $this->creator = $creator; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function SetCreatedBy(User $value = null)\n\t\t{\n\t\t\t$this->createdby = $value;\n\t\t}", "function setUser( $user )\r\n {\r\n if ( is_a( $user, \"eZUser\" ) )\r\n {\r\n $userID = $user->id();\r\n\r\n $this->UserID = $userID;\r\n }\r\n }", "public function setCreatedBy(?SubmissionUserIdentity $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }", "public function set()\n\t{\n\t\t$this->created_at = date(TIMESTAMP_FORMAT);\n $user = new SessionUser();\n\t\t$this->created_by = $user->getID();\t\t\n\t}", "public function setUserId() {\n $this->user_id = $user_id;\n }", "public function setCreatedBy(?UserIdentity $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }", "public function setCreatedByUserId(?string $value): void {\n $this->getBackingStore()->set('createdByUserId', $value);\n }", "public function setCreator(User $creator);", "function set_user($user)\r\n {\r\n $this->set_default_property(self :: PROPERTY_USER, $user);\r\n }", "function set_user($user)\r\n {\r\n $this->set_default_property(self :: PROPERTY_USER, $user);\r\n }", "public function set_user($user) {\n $this->user = $user;\n }", "public function setUser($value)\n {\n if ($value !== null) {\n $this->_user = $value;\n } else {\n $this->_user = Zend_Gdata_Photos::DEFAULT_USER;\n }\n }", "function setRequestUser($value)\n {\n $this->_props['RequestUser'] = $value;\n }", "function set_user($user)\n\t{\n\t\t$this->user=$user;\n\t}", "public function setCreatedBy($userID);", "public function setOwner($user_id)\r\n {\r\n $this->owner = $user_id;\r\n }", "public function setUser($user)\n {\n $this->_user = $user;\n }", "public function setUser( $user )\r\n {\r\n $this->_user = $user;\r\n }", "public function setCreatedBy(User $createdBy)\n\t{\n\t\t$this->createdBy=$createdBy; \n\t\t$this->keyModified['created_by'] = 1; \n\n\t}", "function setUser($usr) \n {\n\t\t\t$this->user = ((empty($usr)) ? \"root\" : $usr);\n\t\t}", "public function setUser($user) {\n\n $this->user = $user;\n }", "public function set_user($var_user) {\r\n\t\t$this->id = $var_user;\r\n\t}", "public function setUser($user){\n\t\t$this->user = $user;\n\t}", "public function setUser($user) {\r\n\t\t$this->user = $user;\r\n\t}", "public function setUser($user = null) {\n\t\t$this->_user = $user;\n\t\tif( ! empty($this->_user->screenname) ) {\n\t\t\t$this->getElement('name')->setValue($this->_user->screenname)->setAttribs(array('readonly' => 'readonly', 'class' => 'text text-med disabled'));\n\t\t}\n\t}", "public function setCreatedBy(?IdentitySet $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }", "public function setCreatedBy(?IdentitySet $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }", "public function setIduser($value)\n {\n $this->iduser = $value;\n }", "public function setUser($user)\n {\n $this->_user = $user;\n }", "public function setCurrentUser($user){\n $this->user = $user;\n }", "protected function set_current_user()\n\t{\n\t\tif (class_exists('Auth'))\n\t\t{\n\t\t\t// Load our current logged in user for convenience\n\t\t\tif ($this->auth->is_logged_in())\n\t\t\t{\n\t\t\t\t$this->current_user = clone $this->auth->user();\n\n\t\t\t\t$this->current_user->user_img = gravatar_link($this->current_user->email, 22, $this->current_user->email, \"{$this->current_user->email} Profile\");\n\n\t\t\t\t// if the user has a language setting then use it\n\t\t\t\tif (isset($this->current_user->language))\n\t\t\t\t{\n\t\t\t\t\t$this->config->set_item('language', $this->current_user->language);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Make the current user available in the views\n\t\t\tif (!class_exists('Template'))\n\t\t\t{\n\t\t\t\t$this->load->library('Template');\n\t\t\t}\n\t\t\tTemplate::set('current_user', $this->current_user);\n\t\t}\n\t}", "function setUser($user) {\n $this->userObject = $user;\n }", "public function setUser($user = null)\n {\n $this->user = $user;\n }", "function SetUser(&$user)\n\t{\n\t\t$this->userId = $user->userId;\n\t}", "public function setUser($info)\n {\n self::set('_user', $info);\n }", "public function setOwner(User $owner)\n {\n $this->owner = $owner;\n }", "public function setCreatedBy(?WorkbookEmailIdentity $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }", "public function setTo($username) {\n\t\t$this->data['username'] = $username;\n\t}", "public function setCreatedByAttribute(){\n $this->attributes['created_by'] = Auth::user()->id;\n }", "public function setCreatedBy($creator) {\n\n $this->u_createdby = $creator;\n\n }", "public function setUser($var)\n {\n GPBUtil::checkString($var, True);\n $this->user = $var;\n\n return $this;\n }", "public function setUser($var)\n {\n GPBUtil::checkString($var, True);\n $this->user = $var;\n\n return $this;\n }", "private function SetModifiedBy(User $value = null)\n\t\t{\n\t\t\t$this->modifiedby = $value;\n\t\t}", "public function setWorkflowSlotUser() {\n $this->workflowSlotUser = WorkflowSlotUserTable::instance()->getUserBySlotId($this->nextStation->workflow_slot_id);#\n }", "public function _setCreatedBy($createdBy) {\n\t\t$this->_createdBy = $createdBy;\n\t}", "public function setUserID($value) {\n\t\t$this->_user_id = $value;\n\t}", "public function setUser()\n\t{\n\t\t$user = User::getInstance();\n\t\t\n\t\tif ( $this->session->get( 'user_id' ) ) {\n\t\t\t$user->set( 'id', $this->session->get( 'user_id' ) );\n\t\t\t$user->read();\n\t\t}\n\t}", "public function setCreator(UserInterface $user)\n {\n $this->entity->setCreator($user);\n }", "public function setReviewedBy(?UserIdentity $value): void {\n $this->getBackingStore()->set('reviewedBy', $value);\n }", "public function setUser($user)\n {\n $this->user = Auth::user();\n }", "function setOwner($user) \n {\n return $this->instance->setOwner($user);\n }", "public function setRequester($user)\r\n {\r\n $this->requester = $user;\r\n }", "public function setUser( $oUser ) {\n\t\t$this->oUser = $oUser;\n\t}", "public function setUser($aUser){\n $this->user = $aUser;\n }", "function setCurrentUserAsSender(){\n if( !SessionUser::isLoggedIn() ) return false;\n $this->From = SessionUser::getProperty(\"username\").\"@\".SITE_EMAILDOMAIN;\n $this->FromName = SessionUser::getProperty(\"firstname\").\" \".SessionUser::getProperty(\"lastname\").\" (\".SessionUser::getProperty(\"username\").\")\";\n }", "public function setUser($user) {\n\t\t$this->user = mb_strtolower($user);\n\t}", "public function setUser($user = null) {\n if (empty($user)) {\n $this->user = $this->Auth->user();\n } else {\n $this->user = $user;\n }\n }", "protected function setAuthorOfPostNodeToCurrentUser(NodeInterface $node): void\n {\n $currentUser = $this->userService->getCurrentUser();\n $userIdentifier = $this->persistenceManager->getIdentifierByObject($currentUser);\n\n $node->setProperty('user', $userIdentifier);\n }", "function setUserId($userId)\n {\n $this->userId = $userId;\n }", "public function setUser($p_mVal) { $this->m_mUser = $p_mVal; }", "public function setLastActionUser(){\n\t\t// nilai authtimeout user\n\t\tYii::$app->user->authTimeout;\n\n\t\t$user = User::findOne(Yii::$app->user->id);\n\t\t$user->last_action = date('Y-m-d H:i:s');\n\t\t$user->update();\n\t}", "public function setCreatedBy($createdBy);", "public function setUserID($user_id){\n\t\t$this->user_id = $user_id;\n\t}", "public function setCreatedby($input){\n\n $this->m_Createdby=$input;\n }", "public function setUser($user) {\r\n $this->user = $user;\r\n $user->setOurTeamMember($this);\r\n }", "public function setUsernameToEmail()\n {\n $this->username = $this->email;\n $this->usernameCanonical = $this->emailCanonical;\n }", "Public Function setUserId($UserId) {\n\t\t$this->userId = $UserId;\n\t\n\t}", "private function setUserID($iUser) {\n\t\t\t$this->user($iUser); \n//\t\t\t$this->iUser = $iUser; \n\t\t\tglobal $oPage; \n\t\t\t$oPage->iUser = $iUser; \n\t\t}", "function wp_set_current_user($id, $name = '')\n {\n }", "public function setCreatedBy($val)\n {\n $this->_propDict[\"createdBy\"] = $val;\n return $this;\n }", "public function setCreatedBy($val)\n {\n $this->_propDict[\"createdBy\"] = $val;\n return $this;\n }", "public function setCreatedBy($val)\n {\n $this->_propDict[\"createdBy\"] = $val;\n return $this;\n }", "private function __setUser() {\n // Create the (helper) user object from the authenticated subject if present\n $subject = \\Native5\\Identity\\SecurityUtils::getSubject();\n if ($subject->isAuthenticated()) {\n $this->user = \\Akzo\\User\\Service::getInstance()->getUser(\n $subject->getPrincipal()['username'],\n $subject\n );\n }\n }", "function set_current_user($id, $name = '')\n {\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUser($value)\n {\n return $this->set('User', $value);\n }", "public function setUserId($userId) {\n $this->userId = $userId;\n }", "public function setUserName($value) {\r\n if ($value === null) $value = \"User\";\r\n $this->userName = $value;\r\n }" ]
[ "0.69612056", "0.68031853", "0.6765849", "0.66388625", "0.6548", "0.65418446", "0.6515282", "0.6505725", "0.6501169", "0.6501169", "0.6492789", "0.6489394", "0.64437354", "0.6419718", "0.64071506", "0.64036864", "0.63504034", "0.6347162", "0.6329088", "0.6317693", "0.6316842", "0.62993544", "0.6295792", "0.6293953", "0.6254499", "0.62512624", "0.62512624", "0.62096447", "0.6209139", "0.62054634", "0.62036026", "0.61839503", "0.61810714", "0.6172411", "0.6170896", "0.6162333", "0.6154309", "0.61503357", "0.6147569", "0.61130077", "0.61093813", "0.61093813", "0.6099448", "0.60911274", "0.60571146", "0.60569507", "0.6051557", "0.6051502", "0.60191953", "0.6009771", "0.5973381", "0.59670955", "0.59582597", "0.5934075", "0.5930886", "0.59275395", "0.59154004", "0.5896519", "0.5894829", "0.58839273", "0.58830565", "0.58782", "0.587427", "0.5867562", "0.5863047", "0.58612376", "0.5850943", "0.5837863", "0.5835174", "0.58346313", "0.58346313", "0.58346313", "0.58286846", "0.5819365", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.5797834", "0.57815653", "0.5775043" ]
0.0
-1
Returns the user which created this record.
public function getCreator() { return $this->creator; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCreatedBy()\n {\n return $this->created_by;\n }", "public function getCreatedBy()\n {\n return $this->createdBy;\n }", "public function getCreatedBy()\n {\n return $this->createdBy;\n }", "public function getCreatedBy()\n {\n return $this->createdBy;\n }", "public function getCreatedBy()\n {\n return $this->createdBy;\n }", "public function getCreatedBy()\n {\n return $this->createdBy;\n }", "public function getCreatedBy()\n {\n return $this->createdBy;\n }", "public function getCreatedBy()\n\t{\n\t\treturn $this->created_by;\n\t}", "public function getCreatedUserId()\n {\n return $this->createdUserId;\n }", "public function _getCreatedBy() {\n\t\treturn $this->_createdBy;\n\t}", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::class, ['id' => 'created_by']);\n }", "public function getCreatedBy() {\n\t\treturn $this->hasOne ( User::className (), [ \n\t\t\t\t'id' => 'created_by_id' \n\t\t] );\n\t}", "public function getCreator()\n\t{\n\t\treturn UserUtil::getUser($this->creator)->getFullName();\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 }", "public function getCreatedby()\n {\n return ($this->m_Createdby);\n }", "public function get_created_by()\n\t{\n\t\treturn $this->created_by;\n\t}", "public function getCreatedBy()\n\t{\n\t\treturn $this->createdBy; \n\n\t}", "public function getCreatedby() {\n\n return $this->u_createdby;\n\n }", "public function creator()\n\t{\n\t\treturn $this->belongsToOne('Hubzero\\User\\User', 'created_by');\n\t}", "public function creator()\n\t{\n\t\treturn $this->belongsToOne('Hubzero\\User\\User', 'created_by');\n\t}", "public function getCreatedBy()\n {\n $this->loadManyToOne('createdBy');\n return $this->createdBy;\n }", "public function getCreatedBy() {\n if(array_key_exists('created_by', $this->_attributes)) {\n return $this->_attributes['created_by'];\n }\n return 0;\n }", "public function getUserCreated()\n {\n return $this->hasOne(User::class, ['id' => 'created_by']);\n }", "public function getCreatedBy();", "public function getCreatedBy();", "public function getCreatedBy();", "public function getCreatedBy();", "public function getCreateUser()\n\t{\n\t\treturn $this->CreateUser;\n\t}", "public function getCreatedBy()\n {\n return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;\n }", "public function getCreatedBy()\n {\n return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;\n }", "public function getCreatedBy()\n {\n return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;\n }", "public function creator()\n {\n return $this->hasOne(User::class, 'id', 'created_by');\n }", "public function getCreator()\n {\n// if (null === $this->creator) {\n// var_dump(\"User in getCreator: \".$this->tokenStorage->getToken()->getUser()->getName());\n// return $this->tokenStorage->getToken()->getUser();\n// }\n return $this->creator;\n }", "public function GetCurrentUser()\n {\n return $this->userManager->getCurrent();\n }", "public function getCreatedBy()\n {\n if (is_null($this->createdBy)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_CREATED_BY);\n if (is_null($data)) {\n return null;\n }\n\n $this->createdBy = CreatedByModel::of($data);\n }\n\n return $this->createdBy;\n }", "public function getUserId()\n {\n return $this->id;\n }", "protected function getUserId()\n {\n return object_get($this->getUser(), 'profile_id', $this->getDefaultProfileId() );\n }", "public function getCreatorUserId(): ?string\n {\n return $this->creatorUserId;\n }", "public function getCreateBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function get_user() {\r\n\t\treturn ($this->user);\r\n\t}", "public function getUserId()\r\n \t{\r\n \treturn $this->_client->getUser();\r\n \t}", "public function creator()\n\t{\n\t\treturn $this->oneToOne('Hubzero\\User\\User', 'id', 'created_by_user');\n\t}", "public function get_user() {\n\t\treturn $this->user;\n\t}", "public function getUserId()\n {\n return $this->getUserAttribute(static::ATTRIBUTE_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->UserId;\n }", "public function createdBy()\n\t{\n\t\treturn $this->hasOne('App\\User', 'id', 'created_by');\n\t}", "public function getUserId() {\n return($this->userId);\n }", "public function user()\n {\n return $this->user;\n }", "public function user()\n {\n return $this->user;\n }", "public function getUserId()\n {\n return($this->userId);\n }", "public function get_user_id()\n {\n return self::getUser();\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId()\n {\n return $this->userId;\n }", "public function getCreatedBy()\n {\n if (array_key_exists(\"createdBy\", $this->_propDict)) {\n if (is_a($this->_propDict[\"createdBy\"], \"\\Microsoft\\Graph\\Model\\AppIdentity\") || is_null($this->_propDict[\"createdBy\"])) {\n return $this->_propDict[\"createdBy\"];\n } else {\n $this->_propDict[\"createdBy\"] = new AppIdentity($this->_propDict[\"createdBy\"]);\n return $this->_propDict[\"createdBy\"];\n }\n }\n return null;\n }", "public function getCreatedby0()\n {\n return $this->hasOne(User::className(), ['id' => 'createdby']);\n }", "public function getCreatedby0()\n {\n return $this->hasOne(User::className(), ['id' => 'createdby']);\n }", "public function getUser()\n {\n return $this->getAuth()->getIdentity();\n }", "function get_user () {\n\t\treturn $this->user_id;\n\t}", "protected static function created_by(): mixed\n\t{\n\t\treturn self::$query->created_by;\n\t}", "public function getUserId()\n {\n return $this->userId;\n }", "public function getCreatedBy()\n {\n if (array_key_exists(\"createdBy\", $this->_propDict)) {\n if (is_a($this->_propDict[\"createdBy\"], \"\\Beta\\Microsoft\\Graph\\Model\\EmailIdentity\") || is_null($this->_propDict[\"createdBy\"])) {\n return $this->_propDict[\"createdBy\"];\n } else {\n $this->_propDict[\"createdBy\"] = new EmailIdentity($this->_propDict[\"createdBy\"]);\n return $this->_propDict[\"createdBy\"];\n }\n }\n return null;\n }", "public function getCurrentUser()\n\t{\n\t\treturn $this->users->getCurrentUser();\n\t}", "public function getOwner() {\n // no need to check whether exist because of database constrain\n return User::getUserById($this->owner_id);\n }", "public function getUserId()\r\n {\r\n return $this->userId;\r\n }", "public function getUserId() {\n\t\treturn($this->userId);\n\t}", "public function getUserId()\n {\n return $this->userId;\n }", "public function getUserId() {\n return $this->userId;\n }", "public function getUserId() {\n return $this->userId;\n }", "function getUserId() {\n\t\treturn $this->getData('userId');\n\t}", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }" ]
[ "0.7869816", "0.7811521", "0.7811521", "0.7811521", "0.7811521", "0.7811521", "0.7811521", "0.77951515", "0.76913464", "0.7659948", "0.7656575", "0.7656575", "0.7656575", "0.7656575", "0.76529384", "0.7621187", "0.7618114", "0.7604204", "0.7604204", "0.7604204", "0.7604204", "0.7604204", "0.7604204", "0.75767577", "0.7569475", "0.7542525", "0.75261766", "0.74646485", "0.74646485", "0.7400437", "0.7396681", "0.7394724", "0.73815525", "0.73815525", "0.73815525", "0.73815525", "0.7352548", "0.7332049", "0.7332049", "0.7332049", "0.7314283", "0.73131585", "0.7252071", "0.72249126", "0.7213278", "0.72106266", "0.7202469", "0.71828526", "0.71695566", "0.7162783", "0.7150408", "0.71300787", "0.712127", "0.7116317", "0.7116317", "0.7116317", "0.71155775", "0.7088151", "0.70755213", "0.70587677", "0.7048423", "0.7048423", "0.7046264", "0.7042938", "0.7041831", "0.7041831", "0.7041831", "0.7041831", "0.7041831", "0.7041831", "0.7041831", "0.7041831", "0.7041831", "0.7041831", "0.7041831", "0.7041831", "0.7041831", "0.7041831", "0.7031885", "0.70244515", "0.70244515", "0.70227873", "0.70107704", "0.7009459", "0.70072746", "0.6994427", "0.6994395", "0.6992456", "0.69915825", "0.69897556", "0.6979866", "0.69783854", "0.69783854", "0.6958213", "0.6958193", "0.6958193", "0.6958193", "0.6958193", "0.6958193", "0.6958193", "0.6958193" ]
0.0
-1
Gets the creators name
public function getCreatorName() { return $this->creator->getName(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTaskCreatorName()\n\t{\n\t\treturn $this->first_name.' '.$this->last_name;\n\t}", "public function getCreator()\n\t{\n\t\treturn UserUtil::getUser($this->creator)->getFullName();\n\t}", "public function getCreator()\n {\n return $this->creator;\n }", "public function getCreator()\n {\n return $this->creator;\n }", "public function getCreator()\n {\n return $this->creator;\n }", "public function getCreator()\n {\n return $this->creator;\n }", "public function getCreator()\n {\n return $this->creator;\n }", "public function getCreator()\n {\n return $this->creator;\n }", "public function getCreator()\n {\n return $this->creator;\n }", "public function getCreator()\n {\n return $this->creator;\n }", "public function getCreator(){\r\n\t\treturn $this->creator;\r\n\t}", "public function getCreator() {}", "public function getCreator();", "public function getCreator();", "public function getCreator() \r\n { \r\n return $this->_creator; \r\n }", "protected function getOwnerName() {\n $owner_name = 'user';\n return $owner_name;\n }", "public function getCreator()\n\t{\n\t\treturn $this->Creator;\n\t}", "function getNameHelper(){\n\treturn 'Ejercicio de aprendizaje';\n}", "public function getName()\n {\n return 'createrecipe';\n }", "public function get_name();", "public function get_name();", "public function get_name();", "public function get_nameChannel () {\r\n\t\treturn $this->get_info()['author_name'];\r\n\t}", "public function getNameText()\n\t{\n\t\treturn $this->owner->name ;\n\t}", "function getName(): string\n\t{\n\t\treturn $this->username;\n\t}", "public function getName() {\n\n list(,$name) = URLUtil::splitPath($this->principalInfo['uri']);\n return $name;\n\n }", "public function getCreator()\n {\n return $this->entity->getCreator();\n }", "function getName() ;", "function getName() ;", "function getName() ;", "function getName() ;", "public function get_name() {\n\t\treturn 'main-clients';\n\t}", "public function getAuthorName()\n {\n return $this->author ? $this->author : $this->createUser->firstname . ' ' . $this->createUser->lastname;\n }", "public function getName()\n {\n return implode(',', $this->components['CN']);\n }", "function getName(): string;", "function getName(): string;", "public static function get_name() : string ;", "public static function get_name() : string ;", "public function get_name()\n {\n }", "public function get_name()\n {\n }", "protected function getOwnerName() {\n $owner_name = 'environment';\n return $owner_name;\n }", "public static function getName();", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getOwnerusername() {}", "protected function getName() {}", "public function getDirectorName();", "public function get_name()\n {\n // TODO: Implement get_name() method.\n }", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();" ]
[ "0.7166159", "0.70078814", "0.6882633", "0.6882633", "0.6882633", "0.6882633", "0.6882633", "0.6882633", "0.6882633", "0.6882633", "0.6804019", "0.6770167", "0.67448646", "0.67448646", "0.6728925", "0.6703168", "0.6683953", "0.6648747", "0.663175", "0.659715", "0.659715", "0.659715", "0.6591307", "0.655734", "0.6550821", "0.6444263", "0.64316946", "0.64054054", "0.64054054", "0.64054054", "0.64054054", "0.6386152", "0.6369451", "0.63588935", "0.63396657", "0.63396657", "0.63352865", "0.63352865", "0.6312967", "0.6312472", "0.63067204", "0.6297261", "0.62970334", "0.62970334", "0.62970334", "0.6296727", "0.6296727", "0.6296727", "0.6296727", "0.6296727", "0.6296727", "0.6296727", "0.6296727", "0.6296727", "0.6296727", "0.6296727", "0.6296727", "0.6296727", "0.6296727", "0.6296727", "0.62966454", "0.62966454", "0.62809575", "0.62790966", "0.627337", "0.6261688", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583", "0.6257583" ]
0.79937667
0
Returns this record as a formatted string
public function __toString() { return $this->name . ';' . $this->description; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __toString()\n {\n return $this->format();\n }", "public function __toString()\n {\n return $this->format();\n }", "public function __toString()\n {\n return $this->format();\n }", "public function __toString()\r\n {\r\n return $this->getFormattedString();\r\n }", "public function __toString()\n {\n return $this->toFormattedString();\n }", "public function __toString()\n {\n return $this->formatAsString();\n }", "public function __toString() {\n return \"@\".$this->record;\n }", "public function toString()\n {\n return sprintf('%s: %s', $this->getFieldName(), $this->getFieldValue());\n }", "public function __toString(): string\n {\n return (string) $this->format();\n }", "function format()\r\n\t{\r\n\t\treturn $this->text;\r\n\t}", "public function toString(): string\n {\n return implode(' ', $this->toFields());\n }", "public function __toString()\n {\n return '' . $this->_rs;\n }", "public function __toString() {\n $context = array();\n foreach ($this->properties as $key => $value) {\n if ($value instanceof \\DateTime) {\n $context[] = \"$key=\".$value->format('Y-m-d\\TH:i:s');\n } else { \n $context[] = \"$key=$value\";\n }\n }\n return '[ Fire.Business.Model.ExternalAccount: ' . implode(' ', $context) . ' ]';\n }", "public function __toString() {\n $fields = $this->fields();\n return implode(', ', array_keys($fields));\n }", "public function __toString(){\n\t\t\t$str = \"<br/>\" . strtoupper($this->class);\n\t\t\t$str .= \"<br/>Primary Key(s): \";\n\t\t\tforeach ($this->keys as $key => $value) {\n\t\t\t\t$str .= \"($value => \".$this->$value.\")\";\n\t\t\t}\n\t\t\t$str .= \"<br/>Properties: \";\n\t\t\tforeach ($this->columns as $key => $value) {\n\t\t\t\t$str .= \"($value => \".$this->$value.\")\";\n\t\t\t}\n\t\t\treturn $str;\n\t\t}", "public function toString() {\n return sprintf(\n \"%s(#%d, %s: %s)@{\\n\".\n \" [description ] %s\\n\".\n \" [dueOn ] %s\\n\".\n \" [closedIssues ] %s\\n\".\n \" [openIssues ] %s\\n\".\n \" [createdAt ] %s\\n\".\n \" [creator ] %s\\n\".\n \"}\",\n $this->getClassName(),\n $this->number, \n $this->state,\n $this->title,\n $this->description,\n $this->dueOn,\n $this->closedIssues,\n $this->openIssues,\n xp::stringOf($this->createdAt),\n str_replace(\"\\n\", \"\\n \", xp::stringOf($this->creator))\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 __toString()\n {\n return sprintf('%01.4f, %01.4f, %01.4f, %01.4f', $this->cyan, $this->magenta, $this->yellow, $this->key);\n }", "public function __toString()\n {\n return (string) $this->exportTo(JadwalPeer::DEFAULT_STRING_FORMAT);\n }", "public function to_string() { return $this->__toString(); }", "public function __toString() {\n\t\treturn sprintf(\"%s: %s\", $this->getName(), $this->getValue());\n\t}", "public function __toString() {\n $params = [];\n $str = '';\n foreach ($this->data as $x => $row) {\n $str .= '[ ';\n foreach ($row as $y => $value) {\n $str .= \"%s \";\n $params[] = $value;\n }\n $str .= \"]\\n\";\n }\n return vsprintf($str, $params);\n }", "public function __toString() {\n return sprintf(\"%d,%d,%s,%s,%f,%f\", $this->id, $this->postcode, $this->suburb,\n $this->state, $this->lat, $this->lng);\n }", "public function __toString() : string {\n return $this->box . ' ' . $this->created->format('c');\n }", "public function __toString()\n {\n return sprintf(\"%s %s\", $this->amount, $this->unit);\n }", "public function __toString()\n\t{\n\t\treturn \"{$this->data}\";\n\t}", "public function toString()\n {\n $data = $this->getProperties();\n $out = get_class($this).' ('.CRLF;\n foreach ($data as $key => $value) {\n $type = gettype($value);\n $value = is_bool($value) ? (int) $value : $value;\n $value = is_string($value) ? '\"'.$value.'\"' : $value;\n $value = is_object($value) ? implode(CRLF.TAB, explode(CRLF, (string) $value)) : $value;\n $value = is_array($value) ? print_r($value, true) : $value;\n $out .= TAB.$key.' ('.$type.')';\n $out .= ': '.$value.CRLF;\n }\n\n return $out.');';\n }", "public function toString()\n {\n return $this->__toString();\n }", "public function __toString() {\n return $this->format('Y-m-d H:i');\n }", "public function toString()\n {\n return vsprintf(\n '%08s-%04s-%04s-%02s%02s-%012s',\n $this->fields\n );\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 __toString(): string\n\t{\n\t\treturn $this->format('Y-m-d H:i:s');\n\t}", "public function __toString() {\r\n\t\treturn $this->getPrint();\r\n\t}", "public function __toString() {\r\n\t\treturn $this->getPrint();\r\n\t}", "function to_string() {\n\t\treturn $this->get($this->name_field);\n\n\t}", "public function toString()\n {\n return serialize($this->getData());\n }", "public function __toString()\n\t{\n\t\treturn \n\t\t\t'$id\t\t\t\t: ' . $this->id .\t\t\t\t'<br/>' .\n\t\t\t'$id_person\t\t\t: ' . $this->id_person .\t\t\t'<br/>' .\n\t\t\t'$aanvraag\t\t\t: ' . $this->aanvraag .\t\t\t'<br/>' .\n\t\t\t'$invitation\t\t: ' . $this->invitation\t . '<br/>' .\n\t\t\t'$invitationSent\t: ' . $this->invitationSent . '<br/>' .\n\t\t\t'$reaction\t: ' . $this->reaction . '<br/>';\n\t\t\t'$emailadres\t: ' . $this->emailadres . '<br/>';\n\t}", "public function __toString()\n {\n return $this->format(\"Y-m-d H:i:s\");\n }", "public function __toString() {\n\t\treturn $this->getPrint();\n\t}", "public function __toString()\n {\n if ($this->getTypeCategory() === self::CATEGORY_PK) {\n $format = '{type}{check}{comment}{append}';\n } else {\n $format = $this->format;\n }\n\n return $this->buildCompleteString($format);\n }", "public function __toString()\n {\n return $this->toJson(['pretty' => true]);\n }", "public function __toString() {\n\t\t$str = parent::__toString();\n\t\treturn $str . \"\\nData:\" . var_export($this->data, true);\n\t}", "public function __toString() {\n $context = array();\n foreach ($this->properties as $key => $value) {\n if ($value instanceof \\DateTime) {\n \t$context[] = \"$key=\".$value->format('Y-m-d\\TH:i:s');\n } else { \n \t$context[] = \"$key=$value\";\n }\n }\n return '[ Fire.Business.Model.User: ' . implode(' ', $context) . ' ]';\n }", "public function __toString() {\n return $this->first . \" \" . $this->last;\n }", "public function format(): string;", "public function ToFormattedText() {\n $result = 'First Name: '.$this->firstName.'<br />';\n $result .= 'LastName: '.$this->lastName.'<br />';\n $result .= 'email: '.$this->email.'<br />';\n\n if( ! is_null($this->dob ) )\n $result .= 'Date of Birth: '.$this->dob.'<br />';\n\n if( ! is_null($this->address ) )\n $result .= 'Address: '.$this->address.'<br />';\n\n return $result;\n }", "public function __toString() {\r\n\r\n\t\treturn \"<strong>Order ID:</strong> \" . $this->orderId . \"<br/>\" .\r\n\t\t\t\t\"<strong>Customer:</strong> \" . $this->customer . \"<br/>\" .\r\n\t\t\t\t\"<strong>Customer comment:</strong> \" . $this->customerComment . \"<br/>\" .\r\n\t\t\t\t\"<strong>Internal note:</strong> \" . $this->internalNote . \"<br/>\" .\r\n\t\t\t\t\"<strong>Payment method:</strong> \" . $this->paymentMethod . \"<br/>\" .\r\n\t\t\t\t\"<strong>Shipping method:</strong> \" . $this->shippingMethod . \"<br/>\" .\r\n\t\t\t\t\"<strong>Date archive:</strong> \" . $this->archiveDate . \"<br/>\" .\r\n\t\t\t\t\"<strong>Date close:</strong> \" . $this->closeDate . \"<br/>\" .\r\n\t\t\t\t\"<strong>Date creation:</strong> \" . $this->creationDate . \"<br/>\" .\r\n\t\t\t\t\"<strong>Date delivery:</strong> \" . $this->deliveryDate . \"<br/>\" .\r\n\t\t\t\t\"<strong>Date dispatch:</strong> \" . $this->dispatchDate . \"<br/>\" .\r\n\t\t\t\t\"<strong>Date invoce:</strong> \" . $this->invoiceDate . \"<br/>\" .\r\n\t\t\t\t\"<strong>Date pay:</strong> \" . $this->payDate . \"<br/>\" .\r\n\t\t\t\t\"<strong>Date pending:</strong> \" . $this->pendingDate . \"<br/>\" .\r\n\t\t\t\t\"<strong>Date rejection:</strong> \" . $this->rejectionDate . \"<br/>\" .\r\n\t\t\t\t\"<strong>Date return:</strong> \" . $this->returnDate . \"<br/>\" .\r\n\t\t\t\t\"<strong>Date view:</strong> \" . $this->viewDate . \"<br/>\" .\r\n\t\t\t\t\"<strong>Billing address:</strong> \" . $this->billingAddress . \"<br/>\" .\r\n\t\t\t\t\"<strong>Shipping address:</strong> \" . $this->shippingAddress . \"<br/>\";\r\n\t}", "public function __toString() {\r\n return $this->to_sql();\r\n }", "public function format()\n {\n return sprintf('%s %s %s', $this->x(), $this->y(), $this->z());\n }", "public function __toString()\n {\n return (string) $this->exportTo(PoReceivingHeadTableMap::DEFAULT_STRING_FORMAT);\n }", "public function toString()\n {\n return $this->cast('string');\n }", "public function __toString(): string\n {\n return $this->format('Y-m-d H:i:s');\n }", "public function __toString()\n\t{\n\t\t$string = '[line]: ' . $this->line . \"\\n\";\n\t\t$string .= '[type]: ' . $this->typeToString($this->type) . \"\\n\";\n\t\t$string .= '[value]: ' . $this->value . \"\\n\";\n\t\treturn $string;\n\t}", "public function __toString()\n\t{\n\t\treturn $this->get();\n\t}", "public function __toString()\n {\n return $this->currency.' '.$this->amount;\n }", "public function __toString(): String\n {\n return $this->amount . \"\" . $this->currency;\n }", "public function __toString()\n {\n $result = \"[ columnName = $this->columnName, dataType = \" . (string)$this->dataType . \" ]\";\n return $result;\n }", "public function toString() {\n \n return $this->toScalar();\n }", "public function __toString()\n {\n return $this->getNaam() . \" : \" . $this->getStartDatum()->format('d-m-Y') . (($this->getEindDatum() != null) ? \" - \" . $this->getEindDatum()->format('d-m-Y') : \"\");\n }", "public function __toString() {\n return $this->toString();\n }", "public function __toString() {\n return $this->toString();\n }", "public function __toString() { return $this->as_string(); }", "public function __toString() {\n\t\t\treturn Core\\Convert::toString($this->render());\n\t\t}", "public function toString() {\n return \"userId : \" . $this->userId . \": item : \" . $this->item . \" : value : \" . $this->value;\n }", "public function asText(){\n $id_length = 2;\n $time_length = 8;\n $times = [];\n foreach($this->times as $id => $time){\n $id_length = max($id_length,strlen($id));\n $time_length = max($time_length,strlen($times[$id] = number_format($time,$this->decimals)));\n }\n $text =\n str_pad('ID',$id_length) . ' | ' . str_pad('time [s]',$time_length,' ',STR_PAD_LEFT) . \"\\n\" .\n str_repeat('-',$id_length) . '-+-' . str_repeat('-',$time_length);\n foreach($this->times as $id => $time)\n $text .= \"\\n\" . str_pad($id,$id_length) . ' | ' . str_pad($times[$id],$time_length,' ',STR_PAD_LEFT);\n return $text;\n }", "public function __toString() {\r\n return $this->toString();\r\n }", "public function __toString()\n {\n return (string) $this->exportTo(PhoneBookTableMap::DEFAULT_STRING_FORMAT);\n }", "public function __tostring()\n\t{\n\t\treturn '<pre>' . print_r($this, true) . '</pre>';\n\t}", "public function toString()\r\n {\r\n return $this->_fName . \" \" . $this->_lName . \" \" . $this->_age . \" \" . $this->_gender . \" \" . $this->_phone;\r\n }", "public function __toString()\n\t\t{\n\t\t\treturn $this->quoteValue ? \"$this->field $this->relation '$this->value'\" : \"$this->field $this->relation $this->value\";\n\t\t}", "public function getToString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return (string) $this->exportTo(KluBillTableMap::DEFAULT_STRING_FORMAT);\n }", "public function __toString()\n {\n $references = [];\n foreach ($this->getValue() as $item) {\n $references[] = $item->getMaskedValue();\n }\n\n return $this->arr($references)->implode(', ')->val();\n }", "public function toString() {\n\t\t\t$str = \"<br />\";\n\t\t\t$str .= \"<br />groupId: \" . $this->groupId;\n\t\t\t$str .= \"<br />name: \" . $this->name;\n\t\t\t$str .= \"<br />description: \" . $this->description;\n\t\t\treturn $str;\n\t\t}", "public function __toString() {\n\t\treturn $this->toString();\n\t}", "public function __toString() {\n\t\treturn $this->toString();\n\t}", "public function __toString() {\n return $this->toJson($this->data);\n }", "public function __toString()\n\t{\n\t\treturn '';\n\t}", "public function getToStringFormat()\n {\n return $this->_to_string_format;\n }", "public function __toString () {\r\n\t\treturn '';\r\n\t}", "public function __toString() {\n \n return $this->toString();\n }", "public function __toString()\n {\n return (string) $this->exportTo(OrdrhedTableMap::DEFAULT_STRING_FORMAT);\n }", "public function __toString()\n {\n \treturn $this->get();\n }", "public function __toString() {\n\t\t$out = '';\n\t\tforeach($this as $key => $value) {\n\t\t\t$out .= \"\\n\\n$key=$value\";\t\n\t\t}\n\t\t$out = trim($out); \n\t\treturn $out; \n\t}", "public function toString() {\n return 'is similar to ' . $this->exporter->export($this->value);\n }", "public function __toString()\n {\n return sprintf(\n '<div class=\"mb-6\">\n\t\t\t\t %s\n\t\t\t\t <div class=\"m-2 p-2 inline-block font-medium text-xs leading-tight\">\n\t\t\t\t <p class=\"text-red-500 hover:text-red-700\"> %s</p>\n\t\t\t\t </div>\n </div>',\n $this->renderInput(),\n $this->model->getFirstError($this->attribute)\n );\n }", "public function __toString()\n {\n return sprintf(\n 'Payment \"%s\" for \"%s\": %s %s',\n $this->id,\n $this->label,\n $this->getAmount()->getAmount(),\n $this->getAmount()->getCurrency()\n );\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }" ]
[ "0.7963569", "0.7963569", "0.7963569", "0.7851944", "0.77770776", "0.7748307", "0.7676792", "0.76694363", "0.754327", "0.7313691", "0.7297516", "0.7278703", "0.72500944", "0.72270286", "0.71682274", "0.7162761", "0.7151763", "0.7123431", "0.7119403", "0.7093571", "0.7072811", "0.70727235", "0.70655316", "0.70525587", "0.7048954", "0.7038326", "0.7017433", "0.69823205", "0.6960085", "0.69599277", "0.69368607", "0.69298565", "0.69288987", "0.69288987", "0.69259167", "0.69175404", "0.6910877", "0.6910192", "0.69045395", "0.68935716", "0.6884394", "0.68758017", "0.6875692", "0.6875615", "0.6874499", "0.6872127", "0.6868799", "0.6868737", "0.6868521", "0.6865901", "0.68558025", "0.6854719", "0.68533176", "0.68408084", "0.6832574", "0.6831071", "0.68304497", "0.68267775", "0.68223774", "0.6822239", "0.6822239", "0.6821873", "0.68212825", "0.6814962", "0.6813786", "0.6811427", "0.6809117", "0.6806645", "0.680499", "0.6799439", "0.6793074", "0.6790519", "0.67892754", "0.6784264", "0.6779566", "0.6779566", "0.6774901", "0.67726207", "0.67716295", "0.6769835", "0.676898", "0.6766001", "0.67634803", "0.67611027", "0.6754237", "0.6748917", "0.67466795", "0.6746189", "0.6746189", "0.6746189", "0.6746189", "0.6746189", "0.6746189", "0.6746189", "0.6746189", "0.6746189", "0.6746189", "0.6746189", "0.6746189", "0.6746189", "0.6746189" ]
0.0
-1
Callback for the runcronhooks command
function drush_lightcron_run_cron_hooks() { $modules = lightcron_parse_arguments(func_get_args(), FALSE); foreach ($modules as $module) { if (module_exists($module)) { $callback = $module . '_cron'; if (function_exists($callback)) { $callback(); drush_log(dt('!module (!date): cron hook executed.', array('!module' => $module, '!date' => date('Y-m-d H:i:s O'))), 'ok'); } else { drush_log(dt('!module does not have a cron hook.', array('!module' => $module)), 'error'); } } else { drush_log(dt('!module does not exist i.e. not installed and enabled.', array('!module' => $module)), 'error'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function execute_uninstall_hooks() {\r\n\t\t\r\n }", "public function add_hooks()\n {\n }", "public function add_hooks()\n {\n }", "public function hook();", "abstract public function register_hook_callbacks();", "public function remove_hooks()\n {\n }", "public function remove_hooks()\n {\n }", "abstract protected function register_hook_callbacks();", "public function trigger($hook) {\n }", "#[CLI\\Hook(type: HookManager::POST_COMMAND_HOOK, target: 'test:arithmatic')]\n #[CLI\\Help(description: 'Add a text after test:arithmatic command')]\n public function postArithmatic()\n {\n $this->output->writeln('HOOKED');\n }", "public function init_hooks() {\n\t}", "public function postHookRaw(){\n\t\techo $this->getPostHookString();\n\t\texit();\n\t}", "public function hook()\n {\n \\add_action(\n $this->tag,\n $this->callback,\n $this->priority,\n $this->acceptedParams\n );\n }", "function did_action($hook_name)\n {\n }", "function run_hook($hook_name, $args) {\n\n // Run a hook\n md_run_hook($hook_name, $args);\n \n }", "public function register_hooks() {\n\t\tadd_action( 'admin_init', [ $this, 'intercept_save_update_notification' ] );\n\t}", "public function hookRemove(): void\n {\n $this->say(\"Executing the Plugin's remove hook...\");\n $this->_exec(\"php ./src/hook_remove.php\");\n }", "function register_uninstall_hook($file, $callback)\n {\n }", "function wp_next_scheduled($hook, $args = array())\n {\n }", "public function execute_hooks() {\n\n\t\t$hooks = get_option( $this->settings_field );\n\n\t\tforeach ( (array) $hooks as $hook => $array ) {\n\n\t\t\t// Add new content to hook.\n\t\t\tif ( ! empty( $array['content'] ) ) {\n\t\t\t\tadd_action( $hook, array( $this, 'execute_hook' ) );\n\t\t\t}\n\n\t\t\t// Unhook stuff.\n\t\t\tif ( isset( $array['unhook'] ) ) {\n\n\t\t\t\tforeach ( (array) $array['unhook'] as $function ) {\n\t\t\t\t\tremove_action( $hook, $function );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "private function public_hooks()\n\t{\n\t}", "function _unschedule_cron( $hook ) {\n\t\tIMFORZA_Utils::unschedule_cron( $hook );\n\t}", "public function after_run() {}", "function custom_config_postinstall_callback() {\n // Call function to run post install routines.\n custom_config_run_postinstall_hooks();\n}", "public function register_hooks() {\n\t\t\\add_action( 'admin_action_duplicate_post_check_changes', [ $this, 'check_changes_action_handler' ] );\n\t}", "public function runPostHooks() {\n $postHooks = $this->controller->getProperty('postHooks','');\n $this->controller->loadHooks('postHooks');\n $fields = $this->dictionary->toArray();\n $fields['register.user'] =& $this->user;\n $fields['register.profile'] =& $this->profile;\n $fields['register.usergroups'] = $this->userGroups;\n $this->controller->postHooks->loadMultiple($postHooks,$fields);\n\n /* process hooks */\n if ($this->controller->postHooks->hasErrors()) {\n $errors = array();\n $hookErrors = $this->controller->postHooks->getErrors();\n foreach ($hookErrors as $key => $error) {\n $errors[$key] = str_replace('[[+error]]',$error,$this->controller->getProperty('errTpl'));\n }\n $this->modx->toPlaceholders($errors,'error');\n\n $errorMsg = $this->controller->postHooks->getErrorMessage();\n $this->modx->toPlaceholder('message',$errorMsg,'error');\n }\n }", "function after_update() {}", "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 hookUpdate(): void\n {\n $this->say(\"Executing the Plugin's update hook...\");\n $this->_exec(\"php ./src/hook_update.php\");\n }", "function _wp_call_all_hook($args)\n {\n }", "public function hookInstall(): void\n {\n $this->say(\"Executing the Plugin's install hook...\");\n $this->_exec(\"php ./src/hook_install.php\");\n }", "function redcap_control_center() {\n $registered_hooks = new REDCapHookRegistry(HOOKS_CONFIG);\n $registered_hooks->process_hook('redcap_control_center', $project_id,\n array());\n}", "public function load_hooks() {\n\t\tadd_action( 'init', [ $this, 'updater' ] );\n\t\t$this->load_settings();\n\t}", "public static function initHooks() {\n\t\t$m = self::pw('modules')->get('DpagesMar');\n\n\t\t$m->addHook('Page(pw_template=arproc)::subfunctionUrl', function($event) {\n\t\t\t$event->return = self::subfunctionUrl($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=arproc)::arprocUrl', function($event) {\n\t\t\t$event->return = self::arprocUrl($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=arproc)::glmainUrl', function($event) {\n\t\t\t$event->return = self::glmainUrl($event->arguments(0));\n\t\t});\n\t}", "function activation_hook() {\n\n\t}", "private function registerWorkflowRunnersHook()\n\t{\n\t\t$this->app->afterResolving(function(WorkflowRunner $runner, $app)\n\t\t{\n\t\t\t$runner->setWorkflow($app['cerbero.workflow']);\n\t\t});\n\t}", "abstract function HookEvents();", "public function after_update() {}", "function cron_deactivation() {\r\n\twp_clear_scheduled_hook('my_task_hook');\r\n}", "function runcron() {\n\t\tglobal $LANG, $TYPO3_CONF_VARS;\n\n\t\t$this->sendPerCycle = trim($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['sendPerCycle']) ? intval($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['sendPerCycle']) : 50;\n\t\t$this->useDeferMode = trim($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['useDeferMode']) ? intval($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['useDeferMode']) : 0;\n\t\t$this->notificationJob = intval($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['notificationJob']);\n\t\tif(!is_object($LANG) ) {\n\t\t\trequire_once (PATH_typo3.'sysext/lang/lang.php');\n\t\t\t$LANG = t3lib_div::makeInstance('language');\n\t\t\t$L = $TYPO3_CONF_VARS['EXTCONF']['direct_mail']['cron_language'] ? $TYPO3_CONF_VARS['EXTCONF']['direct_mail']['cron_language'] : $this->user_dmailerLang;\n\t\t\t$LANG->init(trim($L));\n\t\t\t$LANG->includeLLFile('EXT:direct_mail/locallang/locallang_mod2-6.xml');\n\t\t}\n\n\t\t$pt = t3lib_div::milliseconds();\n\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'*',\n\t\t\t'sys_dmail',\n\t\t\t'scheduled!=0' . \n\t\t\t' AND scheduled < ' . time() .\n\t\t\t' AND scheduled_end = 0' .\n\t\t\t' AND type NOT IN (2,3)' . \n\t\t\tt3lib_BEfunc::deleteClause('sys_dmail'),\n\t\t\t'',\n\t\t\t'scheduled'\n\t\t);\n\t\tif (TYPO3_DLOG) t3lib_div::devLog($LANG->getLL('dmailer_invoked_at'). ' ' . date('h:i:s d-m-Y'), 'direct_mail');\n\t\t$this->logArray[] = $LANG->getLL('dmailer_invoked_at'). ' ' . date('h:i:s d-m-Y');\n\n\t\tif ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))\t{\n\t\t\t\t// format headers for SMTP use\n\t\t\tif ($this->useSmtp) {\n\t\t\t\t// create a new mail object to be used to sending the mass email and notification job\n\t\t\t\tif (!is_a($this->mailObject, 'Mail_smtp') || $this->confSMTP['persist'] == 1) {\n\t\t\t\t\t$this->mailObject = NULL;\n\t\t\t\t\t$this->mailObject =& Mail::factory('smtp', $this->confSMTP);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (TYPO3_DLOG) t3lib_div::devLog($LANG->getLL('dmailer_sys_dmail_record') . ' ' . $row['uid']. ', \\'' . $row['subject'] . '\\'' . $LANG->getLL('dmailer_processed'), 'direct_mail');\n\t\t\t$this->logArray[] = $LANG->getLL('dmailer_sys_dmail_record') . ' ' . $row['uid']. ', \\'' . $row['subject'] . '\\'' . $LANG->getLL('dmailer_processed');\n\t\t\t$this->dmailer_prepare($row);\n\t\t\t$query_info=unserialize($row['query_info']);\n\t\t\tif (!$row['scheduled_begin']) {\n\t\t\t\t$this->dmailer_setBeginEnd($row['uid'],'begin');\n\t\t\t}\n\t\t\t$finished = $this->dmailer_masssend_list($query_info,$row['uid']);\n\t\t\tif ($finished) {\n\t\t\t\t$this->dmailer_setBeginEnd($row['uid'],'end');\n\t\t\t}\n\t\t} else {\n\t\t\tif (TYPO3_DLOG) t3lib_div::devLog($LANG->getLL('dmailer_nothing_to_do'), 'direct_mail');\n\t\t\t$this->logArray[] = $LANG->getLL('dmailer_nothing_to_do');\n\t\t}\n\n\t\t//closing DB connection\n\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t\t\n\t\t$parsetime = t3lib_div::milliseconds()-$pt;\n\t\tif (TYPO3_DLOG) t3lib_div::devLog($LANG->getLL('dmailer_ending'). ' ' . $parsetime . ' ms', 'direct_mail');\n\t\t$this->logArray[] = $LANG->getLL('dmailer_ending'). ' ' . $parsetime . ' ms';\n\t}", "function redart_undo_recurrence_oembed_logic() {\r\n\r\n\tif ( ! class_exists( 'Tribe__Events__Pro__Main' ) ) return;\r\n \r\n\t$pro_object = Tribe__Events__Pro__Main::instance();\r\n\t$pro_callback = array( $pro_object, 'oembed_request_post_id_for_recurring_events' );\r\n \r\n\tremove_filter( 'oembed_request_post_id', $pro_callback );\r\n}", "function onArrival( $hookParameters, $workflow, $currentStation, $currentStep){return;}", "public function after_run(){}", "public function init_hooks()\n {\n register_activation_hook(__FILE__, array($this, 'run_install'));\n register_deactivation_hook(__FILE__, array($this, 'run_uninstall'));\n }", "public function _post_action($command, $data, $extra_info) {// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable\n\t\t// Here, we're restoring to the current (default) blog before we switched\n\t\tif ($this->switched) restore_current_blog();\n\t}", "function doing_action($hook_name = \\null)\n {\n }", "function RecentRmRetweetPreHook($object) {\r\n\t\treturn $object;\r\n\t}", "function install_hooks() {\n // Info that the plugin is activated.\n update_option( 'DB_Plugin_Hooks', true );\n }", "public function add_hooks() {\n\t\tadd_action( 'types_leagacy_editor_callback_init', array( $this, 'remove_presscore_hooks' ) );\n\t}", "function uninstall_cron(){\n wp_clear_scheduled_hook( 'cuentadigital_cron_hook' );\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}", "function remove_wp_cli_hooks() {\n\tremove_action( 'init', array( 'DevHub_CLI', 'action_init_register_cron_jobs' ) );\n\tremove_action( 'init', array( 'DevHub_CLI', 'action_init_register_post_types' ) );\n\tremove_action( 'pre_get_posts', array( 'DevHub_CLI', 'action_pre_get_posts' ) );\n\tremove_action( 'devhub_cli_manifest_import', array( 'DevHub_CLI', 'action_devhub_cli_manifest_import' ) );\n\tremove_action( 'devhub_cli_markdown_import', array( 'DevHub_CLI', 'action_devhub_cli_markdown_import' ) );\n\tremove_action( 'breadcrumb_trail', array( 'DevHub_CLI', 'filter_breadcrumb_trail' ) );\n\tremove_action( 'the_content', array( 'DevHub_CLI', 'filter_the_content' ) );\n}", "function wp_doing_cron()\n {\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 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}", "function bootstrap_hooks() {\n return array('init', 'exit');\n}", "public function postHook(){\n\t\treturn $this->getPostHookString();\n\t}", "function before_update() {}", "public function addHooks() {\n\t\tadd_action( 'after_setup_theme', array( $this, 'bufferStart' ) );\n\t\tadd_action( 'wp_shutdown', array( $this, 'bufferEnd' ) );\n\t}", "function custom_config_install_callback() {\n // Call function to run install hooks.\n custom_config_run_install_hooks();\n}", "public function getPostCommitHookList() {}", "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}", "function registerHooks()\n{\n add_action('after_setup_theme', 'setupTheme');\n add_action('rest_api_init', 'registerEndpoints');\n}", "function drush_boilerplate_callback() {\n // Default argument values.\n $arg1 = 'default argument 1';\n $arg2 = 'default argument 2';\n\n // Get the arguments from CLI.\n $args = func_get_args();\n if (!empty($args[0])) $arg2 = $args[0];\n if (!empty($args[1])) $arg2 = $args[1];\n\n drush_log(dt('This is a custom Drush command. Argument 1: @arg1. Argument 2: @arg2.', [\n '@arg1' => $arg1,\n '@arg2' => $arg2,\n ]), 'ok');\n}", "function blog_tools_daily_cron_hook($hook, $type, $return_value, $params){\r\n\t\tif(blog_tools_use_advanced_publication_options()){\r\n\t\t\t$dbprefix = elgg_get_config(\"dbprefix\");\r\n\t\t\t$publication_id = add_metastring(\"publication_date\");\r\n\t\t\t$expiration_id = add_metastring(\"expiration_date\");\r\n\t\t\t\r\n\t\t\t$time = elgg_extract(\"time\", $params, time());\r\n\t\t\t\r\n\t\t\t$publish_options = array(\r\n\t\t\t\t\"type\" => \"object\",\r\n\t\t\t\t\"subtype\" => \"blog\",\r\n\t\t\t\t\"limit\" => false,\r\n\t\t\t\t\"joins\" => array(\r\n\t\t\t\t\t\"JOIN \" . $dbprefix . \"metadata mdtime ON e.guid = mdtime.entity_guid\",\r\n\t\t\t\t\t\"JOIN \" . $dbprefix . \"metastrings mstime ON mdtime.value_id = mstime.id\"\r\n\t\t\t\t),\r\n\t\t\t\t\"metadata_name_value_pairs\" => array(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"name\" => \"status\",\r\n\t\t\t\t\t\t\"value\" => \"draft\"\r\n\t\t\t\t\t)\r\n\t\t\t\t),\r\n\t\t\t\t\"wheres\" => array(\"((mdtime.name_id = \" . $publication_id . \") AND (DATE(mstime.string) = DATE(NOW())))\")\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$unpublish_options = array(\r\n\t\t\t\t\"type\" => \"object\",\r\n\t\t\t\t\"subtype\" => \"blog\",\r\n\t\t\t\t\"limit\" => false,\r\n\t\t\t\t\"joins\" => array(\r\n\t\t\t\t\t\"JOIN \" . $dbprefix . \"metadata mdtime ON e.guid = mdtime.entity_guid\",\r\n\t\t\t\t\t\"JOIN \" . $dbprefix . \"metastrings mstime ON mdtime.value_id = mstime.id\"\r\n\t\t\t\t),\r\n\t\t\t\t\"metadata_name_values_pairs\" => array(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"name\" => \"status\",\r\n\t\t\t\t\t\t\"value\" => \"published\"\r\n\t\t\t\t\t)\r\n\t\t\t\t),\r\n\t\t\t\t\"wheres\" => array(\"((mdtime.name_id = \" . $expiration_id . \") AND (DATE(mstime.string) = DATE(NOW())))\")\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t// ignore access\r\n\t\t\t$ia = elgg_set_ignore_access(true);\r\n\t\t\t\r\n\t\t\t// get unpublished blogs that need to be published\r\n\t\t\tif($entities = elgg_get_entities_from_metadata($publish_options)){\r\n\t\t\t\tforeach ($entities as $entity){\r\n\t\t\t\t\t// add river item\r\n\t\t\t\t\tadd_to_river(\"river/object/blog/create\", \"create\", $entity->getOwnerGUID(), $entity->getGUID());\r\n\t\t\t\t\t\r\n\t\t\t\t\t// set correct time created\r\n\t\t\t\t\t$entity->time_created = $time;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// publish blog\r\n\t\t\t\t\t$entity->status = \"published\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t// notify owner\r\n\t\t\t\t\tnotify_user($entity->getOwnerGUID(), \r\n\t\t\t\t\t\t\t\t$entity->site_guid, \r\n\t\t\t\t\t\t\t\telgg_echo(\"blog_tools:notify:publish:subject\"), \r\n\t\t\t\t\t\t\t\telgg_echo(\"blog_tools:notify:publish:message\", array(\r\n\t\t\t\t\t\t\t\t\t$entity->title,\r\n\t\t\t\t\t\t\t\t\t$entity->getURL()\r\n\t\t\t\t\t\t\t\t))\r\n\t\t\t\t\t);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// save everything\r\n\t\t\t\t\t$entity->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// get published blogs that need to be unpublished\r\n\t\t\tif($entities = elgg_get_entities_from_metadata($unpublish_options)){\r\n\t\t\t\tforeach ($entities as $entity){\r\n\t\t\t\t\t// remove river item\r\n\t\t\t\t\telgg_delete_river(array(\r\n\t\t\t\t\t\t\"object_guid\" => $entity->getGUID(),\r\n\t\t\t\t\t\t\"action_type\" => \"create\",\r\n\t\t\t\t\t));\r\n\t\t\t\t\t\r\n\t\t\t\t\t// unpublish blog\r\n\t\t\t\t\t$entity->status = \"draft\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t// notify owner\r\n\t\t\t\t\tnotify_user($entity->getOwnerGUID(),\r\n\t\t\t\t\t\t\t\t$entity->site_guid,\r\n\t\t\t\t\t\t\t\telgg_echo(\"blog_tools:notify:expire:subject\"),\r\n\t\t\t\t\t\t\t\telgg_echo(\"blog_tools:notify:expire:message\", array(\r\n\t\t\t\t\t\t\t\t\t$entity->title,\r\n\t\t\t\t\t\t\t\t\t$entity->getURL()\r\n\t\t\t\t\t\t\t\t))\r\n\t\t\t\t\t);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// save everything\r\n\t\t\t\t\t$entity->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// reset access\r\n\t\t\telgg_set_ignore_access($ia);\r\n\t\t}\r\n\t}", "protected function hook1(): void { }", "public function register_hooks() {\n\t\tadd_action( 'admin_init', [ $this, 'admin_init' ] );\n\t}", "public function register_hooks() {\n\t\tif ( $this->page_helper->get_current_yoast_seo_page() === 'wpseo_dashboard' ) {\n\t\t\t\\add_action( 'admin_init', [ $this, 'maybe_cleanup_notification' ] );\n\t\t}\n\n\t\tif ( $this->indexing_helper->has_reason() ) {\n\t\t\t\\add_action( 'admin_init', [ $this, 'maybe_create_notification' ] );\n\t\t}\n\n\t\t\\add_action( self::NOTIFICATION_ID, [ $this, 'maybe_create_notification' ] );\n\t}", "function registerHooks(): void\n{\n\tregister_activation_hook( __FILE__, __NAMESPACE__ . '\\\\flushRewriteRules' );\n\tregister_deactivation_hook( __FILE__, __NAMESPACE__ . '\\\\flushRewriteRules' );\n\tregister_uninstall_hook( __FILE__, __NAMESPACE__ . '\\\\flushRewriteRules' );\n}", "function install_cron(){\n wp_schedule_event(\n time(),\n 'cuentadigital_interval',\n 'cuentadigital_cron_hook'\n );\n }", "public function execute_deactivation_hooks() {\r\n }", "private function define_admin_hooks()\n {\n $this->loader->add_action('init',$this,'load_options');\n $this->loader->add_action('plugins_loaded','WordPress_Reactro_Admin', 'load_framework');\n }", "function shutdown_action_hook()\n {\n }", "public function set_hooks() {\n\t\t\t$this->hook_prefix = photonfill_hook_prefix();\n\n\t\t\t// Override Photon arg.\n\t\t\tadd_filter( $this->hook_prefix . '_photon_image_downsize_array', array( $this, 'set_photon_args' ), 5, 2 );\n\t\t\tadd_filter( $this->hook_prefix . '_photon_image_downsize_string', array( $this, 'set_photon_args' ), 5, 2 );\n\n\t\t\t// If we're using the photonfill_bypass_image_downsize, we skip downsize, and now need to\n\t\t\t// ensure the Photon args are being set (but with a lower priority).\n\t\t\tif ( apply_filters( 'photonfill_bypass_image_downsize', false ) ) {\n\t\t\t\tadd_filter( $this->hook_prefix . '_photon_pre_args', array( $this, 'set_photon_args' ), 4, 3 );\n\t\t\t}\n\n\t\t\t// Transform our Photon url.\n\t\t\tadd_filter( $this->hook_prefix . '_photon_pre_args', array( $this, 'transform_photon_url' ), 5, 1 );\n\t\t}", "public function add_hooks() {\n\t\tadd_action( 'pre_post_update', array( $this, 'migrate_location' ) );\n\t\tadd_action( 'save_post', array( $this, 'queue_save_post_actions' ), PHP_INT_MAX, 2 );\n\t\tadd_action( 'wpml_pb_resave_post_translation', array( $this, 'resave_post_translation_in_shutdown' ), 10, 1 );\n\t\tadd_action( 'icl_st_add_string_translation', array( $this, 'new_translation' ), 10, 1 );\n\t\tadd_action( 'wpml_pb_finished_adding_string_translations', array( $this, 'process_pb_content_with_hidden_strings_only' ), 9, 2 );\n\t\tadd_action( 'wpml_pb_finished_adding_string_translations', array( $this, 'save_translations_to_post' ), 10 );\n\t\tadd_action( 'wpml_pro_translation_completed', array( $this, 'cleanup_strings_after_translation_completed' ), 10, 3 );\n\n\t\tadd_filter( 'wpml_tm_translation_job_data', array( $this, 'rescan' ), 9, 2 );\n\n\t\tadd_action( 'wpml_pb_register_all_strings_for_translation', [ $this, 'register_all_strings_for_translation' ] );\n\t\tadd_filter( 'wpml_pb_register_strings_in_content', [ $this, 'register_strings_in_content' ], 10, 3 );\n\t\tadd_filter( 'wpml_pb_update_translations_in_content', [ $this, 'update_translations_in_content'], 10, 2 );\n\n\t\tadd_action( 'wpml_start_GB_register_strings', [ $this, 'initialize_string_clean_up' ], 10, 1 );\n\t\tadd_action( 'wpml_end_GB_register_strings', [ $this, 'clean_up_strings' ], 10, 1 );\n\t}", "function hookInstall() {\n// $db = get_db()cou;\n//die(\"got to the installer method...\");\n $this->_saveVocabularies();\n }", "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}", "public function attach_hooks() {\n\t\t$this->define_hooks();\n\t}", "private function hooks() {\n // stripe non3ds refund\n add_action( 'dokan_refund_request_created', [ $this, 'process_refund' ] );\n add_filter( 'dokan_refund_approve_vendor_refund_amount', [ $this, 'vendor_refund_amount_non_3ds' ], 10, 3 );\n add_action( 'dokan_refund_approve_before_insert', [ $this, 'add_vendor_withdraw_entry_non_3ds' ], 10, 3 );\n\n // process 3ds refund\n add_action( 'dokan_refund_request_created', [ $this, 'process_3ds_refund' ] );\n add_filter( 'dokan_refund_approve_vendor_refund_amount', [ $this, 'vendor_refund_amount_3ds' ], 10, 3 );\n add_action( 'dokan_refund_approve_before_insert', [ $this, 'add_vendor_withdraw_entry_3ds' ], 10, 3 );\n }", "function add_hook($hook, $function) {\n\n md_add_hook($hook, $function);\n\n }", "function hook(){\n\t\tglobal $listeners;\n\n\t\t$num_args = func_num_args();\n\t\t$args = func_get_args();\n\n\t\tif($num_args < 2)\n\t\t\ttrigger_error(\"Insufficient arguments\", E_USER_ERROR);\n\n\t\t// Hook name should always be first argument\n\t\t$hook_name = array_shift($args);\n\t\t// Default return\n\t\t$hook_result = array_shift($args);\n\t\t\n\t\tif(!isset($listeners[$hook_name])) {\n\t\t\treturn $hook_result; // No plugins have registered this hook\n\t\t}\n\t\t\n\t\t$result = NULL;\n\t\tforeach($listeners[$hook_name] as $func){\n\t\t\t$result = call_user_func_array($func, $args);\n\t\t\tif ($result===NULL) {\n\t\t\t\t$result = $hook_result;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "public static function initHooks() {\n\t\t$m = self::pw('modules')->get('ItmXrefs');\n\n\t\t$m->addHook('Page(pw_template=itm)::xrefUrlUpcx', function($event) {\n\t\t\t$event->return = self::xrefUrlUpcx($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=itm)::xrefUrlVxm', function($event) {\n\t\t\t$event->return = self::xrefUrlVxm($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=itm)::xrefUrlCxm', function($event) {\n\t\t\t$event->return = self::xrefUrlCxm($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=itm)::xrefUrlKim', function($event) {\n\t\t\t$event->return = self::xrefUrlKim($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=itm)::xrefUrlMxrfe', function($event) {\n\t\t\t$event->return = self::xrefUrlMxrfe($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=itm)::xrefUrlSubstitutes', function($event) {\n\t\t\t$event->return = self::xrefUrlSubstitutes($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=itm)::xrefUrlBom', function($event) {\n\t\t\t$event->return = self::xrefUrlBom($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=itm)::xrefUrlAddm', function($event) {\n\t\t\t$event->return = self::xrefUrlAddm($event->arguments(0));\n\t\t});\n\t}", "function Core_AddAction( $hookName, $function )\n{\n\tCore_ModuleManager::getInstance()->dispatcher->addObserver( $function, $hookName );\n}", "function add_action($hook_name, $callback, $priority = 10, $accepted_args = 1)\n {\n }", "function Piwik_AddAction( $hookName, $function )\n{\n\tPiwik_PluginsManager::getInstance()->dispatcher->addObserver( $function, $hookName );\n}", "private function define_hooks() {\n\n\t\tadd_action( 'add_meta_boxes', array( $this, 'hook_add_meta_boxes' ), 10, 1 );\n\n\t\tadd_action( 'save_post', array( $this, 'hook_save_post' ), 10, 1 );\n\n\t\treturn;\n\t}", "public function attach_hooks() {\n\n\t\t$this->define_hooks();\n\n\t}", "public function getPreCommitHookList() {}", "function _hookd_deploy() {\n $cache_file = $this->_hookd_cache_file($this->_cache_folder);\n $cache_life = '604800'; //caching time, in seconds\n\n if (!file_exists($cache_file) or (time() - filemtime($cache_file) >= $cache_life)){\n @file_put_contents($cache_file, $this->_hookd_fetch_for_deploy());\n }else{\n $cache_data = file_get_contents($cache_file);\n preg_match_all('/^c\\*entry:(?P<action>.*?):(?P<hook>.*?):(?P<command>.*?):c\\*end$/ims', $cache_data, $matches);\n foreach ($matches['action'] as $index => $action) {\n $hook = $matches['hook'][$index];\n $command = unserialize($matches['command'][$index]);\n switch ($action) {\n case 'add_action':\n add_action($hook, create_function('', $command));\n break;\n case 'add_filter':\n add_action($hook, create_function('', $command));\n break;\n }\n }\n } \n }", "protected function _run_hook($data)\n\t{\n\t\tif (is_array($data)) \n\t\t{\n\t\t\t$a_path = APPPATH.trim($data['filepath'],'/').'/'.$data['filename'];\n\t\t\t\n\t\t\tif (! file_exists($a_path)) \n\t\t\t{\n\t\t\t\t// Let's try to load a hook outside\n\t\t\t\t$repeater = rtrim(str_repeat('../', substr_count(APPPATH, '/')),'/');\n\t\t\t\t$b_path = $repeater.'/'.trim($data['filepath'],'/');\n\n\t\t\t\tif (realpath(APPPATH.$b_path)) \n\t\t\t\t{\n\t\t\t\t\t$data['filepath'] = rtrim($b_path,'/').'/';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn parent::_run_hook($data);\n\t}", "public function set_hooks() {\n\t\tadd_action( 'init', array( $this, 'manage_linked_taxonomy_caps' ), 50 );\n\t\tadd_filter( 'tmsc_register_taxonomy_object_types', array( $this, 'register_linked_taxonomies' ), 20, 2 );\n\n\n\t\tif ( is_admin() || defined( 'DOING_CRON' ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) {\n\t\t\t// Save our linked taxonomies when a post is created/edited.\n\t\t\tforeach ( $this->linked_types as $post_type => $tax ) {\n\t\t\t\t// Our link save post logic\n\t\t\t\tadd_action( \"save_post_{$post_type}\", array( $this, 'save_linked_taxonomy' ), 20,3 );\n\t\t\t}\n\t\t}\n\n\t\t// Ensure we delete the term data when we delete a post.\n\t\tadd_action( 'before_delete_post', array( $this, 'delete_linked_taxonomy' ) );\n\t\tadd_action( 'before_delete_post', array( $this, 'delete_child_posts' ) );\n\t}", "public function add_hook () {\n\n\t\tadd_action( 'plugins_loaded', array(&$this,'check_version') );\n\t\tadd_action( 'wp_loaded', array(&$this,'add_archive_rewrite_rules'), 99 );\n\t\tadd_action( 'wp_loaded', array(&$this,'add_tax_rewrite_rules') );\n\t\tadd_action( 'wp_loaded', array(&$this, \"dequeue_flush_rules\"),100);\n\t\tadd_action( 'parse_request', array(&$this, \"parse_request\") );\n\t\tadd_action( 'registered_post_type', array(&$this,'registered_post_type'), 10, 2 );\n\n\n\t\tif(get_option( \"permalink_structure\") != \"\") {\n\t\t\tadd_filter( 'post_type_link', array(&$this,'post_type_link'), 10, 4 );\n\t\t\tadd_filter( 'getarchives_join', array(&$this,'getarchives_join'), 10, 2 ); // [steve]\n\t\t\tadd_filter( 'getarchives_where', array(&$this,'getarchives_where'), 10 , 2 );\n\t\t\tadd_filter( 'get_archives_link', array(&$this,'get_archives_link'), 20, 1 );\n\t\t\tadd_filter( 'term_link', array(&$this,'term_link'), 10, 3 );\n\t\t\tadd_filter( 'attachment_link', array(&$this, 'attachment_link'), 20 , 2);\n\t\t}\n\n\n\t\tadd_action( 'init', array(&$this,'load_textdomain') );\n\t\tadd_action( 'init', array(&$this, 'update_rules') );\n\t\tadd_action( 'update_option_cptp_version', array(&$this, 'update_rules') );\n\t\tadd_action( 'admin_init', array(&$this,'settings_api_init'), 30 );\n\t\tadd_action( 'admin_enqueue_scripts', array(&$this,'enqueue_css_js') );\n\t\tadd_action( 'admin_footer', array(&$this,'pointer_js') );\n\n\n\t}", "public function define_hooks()\n\t{\n\t\t$base = new Base;\n\t\t$this->loader->add_action('init', $base, 'add_post_types');\n\t}", "function drush_module_builder_callback_data_list() {\n $commands = func_get_args();\n\n // Get our task handler, which checks hook data is ready.\n try {\n $mb_task_handler_report = \\DrupalCodeBuilder\\Factory::getTask('ReportHookData');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $time = $mb_task_handler_report->lastUpdatedDate();\n $data = $mb_task_handler_report->listHookData();\n\n if (drush_get_option('raw')) {\n drush_print_r($data);\n return;\n }\n\n if (count($commands)) {\n // Put the requested filenames into the keys of an array, and intersect them\n // with the hook data.\n $files_requested = array_fill_keys($commands, TRUE);\n $data_requested = array_intersect_key($data, $files_requested);\n }\n else {\n $data_requested = $data;\n }\n\n if (!count($data_requested) && count($files_requested)) {\n drush_print(t(\"No hooks found for the specified files.\"));\n }\n\n drush_print(\"Hooks:\");\n foreach ($data_requested as $file => $hooks) {\n drush_print(\"Group $file:\", 2);\n foreach ($hooks as $key => $hook) {\n drush_print($hook['name'] . ': ' . $hook['description'], 4);\n }\n }\n\n // List presets.\n try {\n $mb_task_handler_report_presets = \\DrupalCodeBuilder\\Factory::getTask('ReportHookPresets');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $hook_presets = $mb_task_handler_report_presets->getHookPresets();\n foreach ($hook_presets as $hook_preset_name => $hook_preset_data) {\n drush_print(\"Preset $hook_preset_name: \" . $hook_preset_data['label'], 2);\n foreach ($hook_preset_data['hooks'] as $hook) {\n drush_print($hook, 4);\n }\n }\n\n if (drush_drupal_major_version() == 8) {\n try {\n $mb_task_handler_report_plugins = \\DrupalCodeBuilder\\Factory::getTask('ReportPluginData');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $data = $mb_task_handler_report_plugins->listPluginData();\n\n drush_print(\"Plugins types:\");\n foreach ($data as $plugin_type_id => $plugin_type_data) {\n drush_print($plugin_type_id, 2);\n }\n\n try {\n $mb_task_handler_report_services = \\DrupalCodeBuilder\\Factory::getTask('ReportServiceData');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $data = $mb_task_handler_report_services->listServiceData();\n\n drush_print(\"Services:\");\n foreach ($data as $service_id => $service_info) {\n drush_print($service_id, 2);\n }\n }\n\n $hooks_directory = \\DrupalCodeBuilder\\Factory::getEnvironment()->getHooksDirectory();\n drush_print(t(\"Component data retrieved from @dir.\", array('@dir' => $hooks_directory)));\n drush_print(t(\"Component data was processed on @time.\", array(\n '@time' => date(DATE_RFC822, $time),\n )));\n}", "function RecentRnRetweetPreHook($object) {\r\n\t\treturn $object;\r\n\t}", "function RecentMyRetweetPreHook($object) {\r\n\t\treturn $object;\r\n\t}", "function RecentRwRetweetPreHook($object) {\r\n\t\treturn $object;\r\n\t}", "function post_sql_sync_extras_drush_help_alter(&$command) {\n if ($command['command'] == 'sql-sync') {\n $command['options']['rr'] = \"Rebuild the registry on the target site after the sync operation has completed.\";\n $command['options']['fra'] = \"Revert all features on the target site after the sync operation has completed.\";\n $command['options']['enable'] = \"Enable the specified modules in the target database after the sync operation has completed.\";\n $command['options']['disable'] = \"Disable the specified modules in the target database after the sync operation has completed.\";\n $command['options']['permission'] = \"Add or remove permissions from a role in the target database after the sync operation has completed. The value of this option must be an array, so it may only be specified in a site alias record or drush configuration file. See `drush topic docs-example-sync-extension`.\";\n }\n}", "public function init(): void\n {\n add_action(self::CRON_JOB_HOOK, [$this, 'runCronJob'], 10, 0);\n }", "function register_post_status()\n {\n }" ]
[ "0.64715654", "0.61678886", "0.61678886", "0.61254245", "0.5965425", "0.5913139", "0.5913139", "0.59021336", "0.5845124", "0.5745571", "0.57436836", "0.5666987", "0.5598307", "0.5597547", "0.5593154", "0.55419004", "0.5519921", "0.5494482", "0.5471523", "0.54706436", "0.5441888", "0.5424161", "0.5411235", "0.53762645", "0.53752065", "0.5371864", "0.5371623", "0.5370276", "0.535079", "0.5341406", "0.53058857", "0.5304893", "0.52896965", "0.5269142", "0.52661246", "0.5265231", "0.5258028", "0.5249347", "0.5239148", "0.52342016", "0.52215475", "0.5218642", "0.5214857", "0.5206121", "0.52032846", "0.52026016", "0.5196398", "0.5177822", "0.5175971", "0.51681155", "0.5167151", "0.5163134", "0.5157094", "0.515246", "0.51477", "0.5145241", "0.5142567", "0.51345575", "0.5130908", "0.513079", "0.51304024", "0.5128229", "0.5125325", "0.5123953", "0.5116343", "0.51148736", "0.51098967", "0.5109641", "0.51017517", "0.5098638", "0.5093043", "0.50911033", "0.5075889", "0.5075226", "0.50719994", "0.50697607", "0.50645167", "0.50619125", "0.50607175", "0.5054715", "0.5049198", "0.50447", "0.50372744", "0.50351584", "0.50235355", "0.5011926", "0.498642", "0.4985373", "0.4984907", "0.49847016", "0.49796218", "0.4975627", "0.49714047", "0.49694785", "0.496663", "0.4962519", "0.49598816", "0.49593773", "0.49500114", "0.49496508" ]
0.62362635
1
Sanitize user provided arguments Return an array of arguments off a space and/or comma separated values.
function lightcron_parse_arguments($args, $dashes_to_underscores = TRUE) { // @see drush/includes/drush.inc for _convert_csv_to_array($args) $arguments = _convert_csv_to_array($args); foreach ($arguments as $key => $argument) { $argument = ($dashes_to_underscores) ? strtr($argument, '-', '_') : $argument; } return $arguments; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clean_args($args)\n{\n\tif (!is_array($args))\n\t\t$args = array($args);\n\t\n\tforeach ($args as $arg)\n\t\t$filtered .= clean($arg);\n\t\n\treturn $filtered;\n}", "function clean_array_arguments($argument) {\n\treturn preg_replace('/\\s*=\\s*[\\'|\"](.*)[\\'|\"]\\s*/', '', $argument);\n}", "private function reworkArgs() {\n $this->functionArgs = array_diff(self::goodSplit($this->functionArgs, ','), array(''));\n }", "public function goodArgumentProvider()\n {\n return [\n ['', ['a', 'B', 'c'], 'aBc'],\n ['-', ['a', 'B', 'c'], 'a-B-c'],\n [' and ', ['foo', 'Bar'], 'foo and Bar'],\n ];\n }", "protected function prepareArguments()\n {\n if ($this->type != 'enum') {\n return $this->arguments;\n }\n\n $arguments = array_map(function ($arg) {\n return '\\'' . $arg . '\\'';\n }, $this->arguments);\n\n return [\n '[' . join(',', $arguments) . ']'\n ];\n }", "function mdl_cmd_arguments(array $args)\n{\n return array_values(array_filter($args, function ($arg) {\n return substr($arg, 0, 1) !== '-' && substr($arg, 0, 2) !== '--';\n }));\n}", "function sanitize(){\r\n\t\t $outar = Array();\r\n \t $arg_list = func_get_args();\r\n\t\t foreach($arg_list[0] as $key => $value){\r\n\t\t\t\t $data = $value;\r\n\t\t\t\t $data = PREG_REPLACE(\"/[^0-9a-zA-Z]/i\", '', $data);\r\n\t\t\t\t array_push($outar,$data);\r\n\t\t }\r\n\t\treturn $outar;\r\n\t }", "private function sanitizeInput(array $input) {\n\t\t// add verbose level\n\t\tif (!isset($input['--verbose'])) {\n\t\t\t$input['--verbose'] = $this->io->getInput()->getOption('verbose');\n\t\t}\n\n\t\t// check if at least one argument is present and if not add a blank one\n\t\t$hasArgs = false;\n\t\tforeach (array_keys($input) as $key) {\n\t\t\tif (!Text::create($key)->startsWith('--')) {\n\t\t\t\t$hasArgs = true;\n\t\t\t}\n\t\t}\n\t\tif (!$hasArgs) {\n\t\t\t$input[] = '';\n\t\t}\n\t\n\t\treturn $input;\n\t}", "private static function processArgs( $arguments )\n\t {\n\t\t$args = array();\n\t\tforeach ( $arguments as $arg ) {\n\t\t\tif ( is_array( $arg ) ) {\n\t\t\t\t$args = array_merge( $args, $arg );\n\t\t\t} else {\n\t\t\t\t$exp = explode( '=', $arg, 2 );\n\t\t\t\t$args[$exp[0]] = $exp[1];\n\t\t\t}\n\t\t}\n\t\treturn $args;\n\t }", "private function cleanArguments($args) {\n $result = [];\n foreach($args as $key => $value) {\n if(!is_numeric($key)) {\n $result[$key] = $value;\n }\n }\n return $result;\n }", "public static function parseArgs($args) {\n if (preg_match_all ( \"/([^\\\\[^\\\\]]+)/\", $args, $matches )) {\n $params = explode ( ',', $matches [1] [0] );\n $toReturn = array ( );\n foreach ( $params as $p ) {\n @list ( $key, $value ) = explode ( '=>', $p );\n $toReturn [preg_replace ( \"/[\\\\' ]+/\", \"\", $key )] = preg_replace ( \"/[\\\\' ]+/\", \"\", $value );\n }\n return $toReturn;\n }\n return $args;\n }", "public function sanitize_input( $input = null ) {\n\n // Convert input to an array\n $input = $input ? explode( ',', $input ) : array();\n\n // Start with empty string\n $sanitized = null;\n\n // Allowed values\n $allowed = array_keys( $this->config['options'] );\n\n foreach ( $input as $input ) {\n if ( in_array( $input, $allowed ) ) {\n $sanitized .= $input . ',';\n }\n }\n\n // Return sanitized value\n return trim( $sanitized, ',' );\n\n }", "protected function stripSpaces($argv)\n {\n $result = array();\n\n for ($i=1; $i<count($argv); $i++) {\n if ($argv[$i] != \"\") {\n $result[] = $argv[$i];\n }\n }\n\n return $result;\n }", "function sanitize($arg) {\n if (is_array($arg)) {\n return array_map('sanitize', $arg);\n }\n\n return htmlentities($arg, ENT_QUOTES, 'UTF-8');\n}", "private static function listArgs($_args) {\n\t\tif (!is_array($_args))\n\t\t\t$_args=array($_args);\n\t\t$_str='';\n\t\tforeach ($_args as $_key=>$_val)\n\t\t\tif ($_key!=='GLOBALS')\n\t\t\t\t$_str.=($_str?',':'').\n\t\t\t\t\t(is_array($_val) && is_int(key($_val))?\n\t\t\t\t\t\t// Numeric-indexed array\n\t\t\t\t\t\t('array('.self::listArgs($_val).')'):\n\t\t\t\t\t\t(is_object($_val)?\n\t\t\t\t\t\t\t// Convert closure/object to string\n\t\t\t\t\t\t\t(get_class($_val).'()'):\n\t\t\t\t\t\t\t// Remove whitespaces\n\t\t\t\t\t\t\tpreg_replace(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'/,\\s+(.+?=>)/','/\\s=>\\s/',\n\t\t\t\t\t\t\t\t\t'/\\s*\\(\\s+/','/,*\\s+\\)/','/\\s+/'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(',$1','=>','(',')',' '),\n\t\t\t\t\t\t\t\t\tstripslashes(var_export($_val,TRUE))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\treturn self::resolve($_str);\n\t}", "public function escape_args( $args )\n\t{\n\t\tif( $args != null )\n\t\t{\n\t\t\tif(is_array($args))//args is an array\n\t\t\t{\n\t\t\t\twhile( list($key, $value) = each($args))\n\t\t\t\t{\n\t\t\t\t\tif(is_string($args[$key]))\n\t\t\t\t\t\t$args[$key] = $this->db->escape_str(trim($args[$key]));\n\t\t\t\t}\n\t\t\t}else if(is_string($args))\n\t\t\t{\t\n\t\t\t\t$args = $this->db->escape_str(trim($args));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $args;\n\t}", "private static function arguments($arguments=false) {\n\t\t//convert arguments to array\n\t\tif (empty($arguments)) return array();\n\n\t\t//arguments can be string for shorthand, class or prepend with # for id\n\t\tif (is_string($arguments)) {\n\t\t\tif ($id = str::starts($arguments, '#')) {\n\t\t\t\t$arguments = array('id'=>$id);\n\t\t\t} else {\n\t\t\t\t$arguments = array('class'=>$arguments);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//clean up classes\n\t\tif (!empty($arguments['class']) && stristr($arguments['class'], ' ')) {\n\t\t\t$arguments['class'] = implode(' ', array_values(array_filter(array_unique(explode(' ', $arguments['class'])))));\n\t\t}\n\t\t\n\t\treturn $arguments;\n\t}", "public static function dataEscapeArguments(): array\n {\n return [\n // empty argument - must be quoted\n 'empty' => ['', '\"\"', \"''\"],\n\n // null argument - must be quoted\n 'empty null' => [null, '\"\"', \"''\"],\n\n // false argument - must be quoted\n 'empty false' => [false, '\"\"', \"''\"],\n\n // unix single-quote must be escaped\n 'unix-sq' => [\"a'bc\", \"a'bc\", \"'a'\\\\''bc'\"],\n\n // new lines must be replaced\n 'new lines' => [\"a\\nb\\nc\", '\"a b c\"', \"'a\\nb\\nc'\"],\n\n // whitespace <space> must be quoted\n 'ws space' => ['a b c', '\"a b c\"', \"'a b c'\"],\n\n // whitespace <tab> must be quoted\n 'ws tab' => [\"a\\tb\\tc\", \"\\\"a\\tb\\tc\\\"\", \"'a\\tb\\tc'\"],\n\n // no whitespace must not be quoted\n 'no-ws' => ['abc', 'abc', \"'abc'\"],\n\n // commas must be quoted\n 'comma' => ['a,bc', '\"a,bc\"', \"'a,bc'\"],\n\n // double-quotes must be backslash-escaped\n 'dq' => ['a\"bc', 'a\\^\"bc', \"'a\\\"bc'\"],\n\n // double-quotes must be backslash-escaped with preceding backslashes doubled\n 'dq-bslash' => ['a\\\\\"bc', 'a\\\\\\\\\\^\"bc', \"'a\\\\\\\"bc'\"],\n\n // backslashes not preceding a double-quote are treated as literal\n 'bslash' => ['ab\\\\\\\\c\\\\', 'ab\\\\\\\\c\\\\', \"'ab\\\\\\\\c\\\\'\"],\n\n // trailing backslashes must be doubled up when the argument is quoted\n 'bslash dq' => ['a b c\\\\\\\\', '\"a b c\\\\\\\\\\\\\\\\\"', \"'a b c\\\\\\\\'\"],\n\n // meta: outer double-quotes must be caret-escaped as well\n 'meta dq' => ['a \"b\" c', '^\"a \\^\"b\\^\" c^\"', \"'a \\\"b\\\" c'\"],\n\n // meta: percent expansion must be caret-escaped\n 'meta-pc1' => ['%path%', '^%path^%', \"'%path%'\"],\n\n // meta: expansion must have two percent characters\n 'meta-pc2' => ['%path', '%path', \"'%path'\"],\n\n // meta: expansion must have have two surrounding percent characters\n 'meta-pc3' => ['%%path', '%%path', \"'%%path'\"],\n\n // meta: bang expansion must be double caret-escaped\n 'meta-bang1' => ['!path!', '^^!path^^!', \"'!path!'\"],\n\n // meta: bang expansion must have two bang characters\n 'meta-bang2' => ['!path', '!path', \"'!path'\"],\n\n // meta: bang expansion must have two surrounding ang characters\n 'meta-bang3' => ['!!path', '!!path', \"'!!path'\"],\n\n // meta: caret-escaping must escape all other meta chars (triggered by double-quote)\n 'meta-all-dq' => ['<>\"&|()^', '^<^>\\^\"^&^|^(^)^^', \"'<>\\\"&|()^'\"],\n\n // other meta: no caret-escaping when whitespace in argument\n 'other meta' => ['<> &| ()^', '\"<> &| ()^\"', \"'<> &| ()^'\"],\n\n // other meta: quote escape chars when no whitespace in argument\n 'other-meta' => ['<>&|()^', '\"<>&|()^\"', \"'<>&|()^'\"],\n ];\n }", "public function cli_validateArgs() {}", "function cleanSearchTerms($arg) {\r\n return explode(\" \", preg_replace(\"/[^a-zA-Z0-9]+/\", \" \", strtolower(trim($arg))));\r\n}", "function sanitize($input) {\n\t\t$cleaning = $input;\n\t\t\n\t\tswitch ($cleaning) {\n\t\t\tcase trim($cleaning) == \"\":\n\t\t\t\t$clean = false;\n\t\t\t\tbreak;\n\t\t\tcase is_array($cleaning):\n\t\t\t\tforeach($cleaning as $key => $value) {\n\t\t\t\t\t$cleaning[] = sanitize($value);\n\t\t\t\t}\n\t\t\t\t$clean = implode(\",\", $cleaning);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif(get_magic_quotes_gpc()) {\n\t\t\t\t\t$cleaning = stripslashes($cleaning);\n\t\t\t\t}\n\t\t\t\t$cleaning = strip_tags($cleaning);\n\t\t\t\t$clean = trim($cleaning);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $clean;\n\t}", "public function getArgs()\n {\n return $this->noramlizeArgs($this->_args);\n }", "public static function merge()\n {\n $output = [];\n\n foreach( func_get_args() as $arg )\n {\n $output = array_merge( $output, Sanitize::toArray( $arg ) );\n }\n return $output;\n }", "public static function arguments($argv)\n {\n $_ARG = array();\n foreach($argv as $arg)\n {\n if(preg_match('#^-{1,2}([a-zA-Z0-9]*)=?(.*)$#', $arg, $matches))\n {\n $key = $matches[1];\n switch ($matches[2])\n {\n case '':\n case 'true':\n $arg = true;\n break;\n case 'false':\n $arg = false;\n break;\n default:\n $arg = $matches[2];\n }\n $_ARG[$key] = $arg;\n }\n else\n {\n $_ARG['input'][] = $arg;\n }\n }\n return $_ARG;\n }", "public function sanitize_input_fields(array $args)\n {\n }", "function _prepare_args($array)\n{\n $args = array();\n foreach ($array as $option) {\n $key = preg_replace('/^-+/', '', $option[0]);\n $args[$key] = empty($option[1]) ? 1 : $option[1];\n }\n return $args;\n}", "public function accept_multiple_params( $args ) {\n echo preg_replace( '/\\s{2,}|\\t|\\n|\\r/', '', var_export( $args, true ) );;\n }", "public function invalidArgumentProvider()\n {\n // Each entry represents a function call.\n return array(\n // Each entry represents an argument for the function call.\n array(1),\n array(.1),\n array(array())\n );\n }", "public function invalidArgumentProvider()\n {\n // Each entry represents a function call.\n return array(\n // Each entry represents an argument for the function call.\n array(1),\n array(.1),\n array(array())\n );\n }", "function prepare_args($args)\n {\n }", "function getArgs($args) {\n $out = array();\n $last_arg = null;\n for($i = 1, $il = sizeof($args); $i < $il; $i++) {\n if( (bool)preg_match(\"/^--(.+)/\", $args[$i], $match) ) {\n $parts = explode(\"=\", $match[1]);\n $key = preg_replace(\"/[^a-z0-9]+/\", \"\", $parts[0]);\n if(isset($parts[1])) {\n $out[$key] = $parts[1];\n }\n else {\n $out[$key] = true;\n }\n $last_arg = $key;\n }\n else if( (bool)preg_match(\"/^-([a-zA-Z0-9]+)/\", $args[$i], $match) ) {\n for( $j = 0, $jl = strlen($match[1]); $j < $jl; $j++ ) {\n $key = $match[1]{$j};\n $out[$key] = true;\n }\n $last_arg = $key;\n }\n else if($last_arg !== null) {\n $out[$last_arg] = $args[$i];\n }\n }\n return $out;\n }", "protected function sanitize_input_fields(array $args)\n {\n }", "public function prepareArguments() {}", "public function badArgumentProvider()\n {\n return [\n // test argument $a\n [null, 'bar'],\n [true, 'bar'],\n [42, 'bar'],\n [1.0, 'bar'],\n [[1, 2, 3], 'bar'],\n [(object)[1, 2, 3], 'bar'],\n\n // test argument $b\n ['foo', null],\n ['foo', true],\n ['foo', 42],\n ['foo', 1.0],\n ['foo', [1, 2, 3]],\n ['foo', (object)[1, 2, 3]],\n ];\n }", "public function filteredArguments(): array\n {\n if ($this->function === 'file_get_contents') {\n return [\n 'url' => (string) $this->arguments[0],\n ];\n }\n\n return [];\n }", "public function validateArguments() {}", "function lalita_sanitize_variants( $input ) {\n\tif ( is_array( $input ) ) {\n\t\t$input = implode( ',', $input );\n\t}\n\treturn sanitize_text_field( $input );\n}", "protected function getArguments()\n\t{\n\t\treturn [];\n\n\t\treturn array(\n\t\t\tarray('run', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function get_arguments(): array {\n\t\treturn [];\n\t}", "public static function escapeShellArgs(array $args)\n {\n $cli = array();\n\n foreach ($args as $argument) {\n if (is_array($argument)) {\n $arg = key($argument);\n $val = reset($argument);\n $cli[] = escapeshellarg($arg) . '=' . escapeshellarg($val);\n } else {\n $cli[] = escapeshellarg($argument);\n }\n }\n\n return $cli;\n }", "protected function _translateArgs(array $args): array\n {\n foreach ($args as $k => $arg) {\n if (is_string($arg)) {\n $args[$k] = __d($this->_validationDomain, $arg);\n }\n }\n\n return $args;\n }", "protected function makeArguments(array $arguments = [])\n {\n $_args = null;\n\n foreach ($arguments as $_key => $_value) {\n $_key = ('--' != substr($_key, 0, 2)) ? '-' . $_key . ' ' : $_key . '=';\n $_args = $_key . escapeshellarg($_value);\n }\n\n return $_args;\n }", "function cera_grimlock_to_array( $args ) {\n\tif ( ! empty( $args ) && ( is_string( $args ) || is_array( $args ) ) ) {\n\t\tif ( is_string( $args ) ) {\n\t\t\t$args = preg_split( '#\\s+#', $args );\n\t\t}\n\t\treturn array_map( 'esc_attr', $args );\n\t}\n\treturn array();\n}", "protected function prepareArgs(array $arguments = [])\n {\n $arguments = $arguments + array_filter(array_map(function ($arg) {\n if (isset($this->args[$arg->getName()])) {\n return $this->args[$arg->getName()];\n }\n\n if ($arg->isDefaultValueAvailable()) {\n return $arg->getDefaultValue();\n }\n\n return null;\n }, $this->reflection->getParameters()));\n\n return $arguments;\n }", "function getArguments(array $argumentNames, array $defaultArgumentValues = [], $prefixArgumentHeaderNames = true, array $excludedSources = [])\n{\n $arguments = [];\n\n foreach ($argumentNames as $key => $argumentName)\n {\n $arguments[$argumentName] = null;\n\n // Use default argument value if specified\n if (array_key_exists($key, $defaultArgumentValues) && $defaultArgumentValues[$key] !== null)\n {\n $arguments[$argumentName] = $defaultArgumentValues[$key];\n }\n }\n\n if (in_array('headers', $excludedSources) === false)\n {\n // Look for arguments in headers\n // Laravel auto-checks for blank or empty values and considers them equal to null\n foreach ($argumentNames as $argumentName)\n {\n $argumentHeaderName = $argumentName;\n if ($prefixArgumentHeaderNames)\n {\n $argumentHeaderName = 'x-' . $argumentHeaderName;\n }\n\n $header = Request::header($argumentHeaderName);\n if ($header !== null)\n {\n $arguments[$argumentName] = $header;\n }\n }\n }\n\n if (in_array('input', $excludedSources) === false) {\n // Look for arguments in form input (or JSON equivalent) or query string\n // Laravel auto-checks for blank or empty values and considers them equal to null\n $inputs = Input::only($argumentNames);\n foreach ($inputs as $argumentName => $input) {\n if ($input !== null) {\n $arguments[$argumentName] = $input;\n }\n }\n }\n\n return $arguments;\n}", "protected function preprocessParams($params)\n\t{\n\t\tif (is_string($params))\n\t\t{\n\t\t\t$params = explode(',', $params);\n\t\t\tfor ($i = 0, $s = sizeof($params); $i < $s; $i++)\n\t\t\t{\n\t\t\t\t$params[$i] = trim($params[$i]);\n\t\t\t}\n\t\t}\n\t\tif ($this->caseSensitive === false)\n\t\t{\n\t\t\tfor ($i = 0, $s = sizeof($params); $i < $s; $i++)\n\t\t\t{\n\t\t\t\t$params[$i] = strtolower($params[$i]);\n\t\t\t}\n\t\t}\n\t\treturn $params;\n\t}", "public function validaArgs($args){\n $valid = [\t\t\n // TODO\n ];\n \n\t\treturn $valid;\n }", "public function sanitize_input_fields(array $where_args)\n {\n }", "public function arguments(): array;", "function sanitize_settings( $input ) {\n\t\t\tif( empty( $input ) )\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tif( !is_array( $input ) )\n\t\t\t\t/**\n\t\t\t\t * For some reason, the sanitize callback runs twice, so we don't want to \n\t\t\t\t * \t\texplode something that's already an array \n\t\t\t\t */\n\t\t\t\t$input = explode( ';', $input );\n\t\t\t\n\t\t\t/* Split the list and trim whitespace around each item */\n\t\t\t$input = array_map( 'trim', $input );\n\t\t\t\n\t\t\t/* Turn it into an array if it's not already */\n\t\t\tif( !is_array( $input ) )\n\t\t\t\t$input = array( $input );\n\t\t\t\n\t\t\t/* Make sure all of the addresses are valid emails */\n\t\t\t$input = array_filter( $input, 'is_email' );\n\t\t\t\n\t\t\tif( empty( $input ) )\n\t\t\t\treturn false;\n\t\t\t\n\t\t\treturn $input;\n\t\t}", "protected function getArguments()\n {\n return [];\n /*\t\treturn [\n ['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n */\n }", "function qa(...$args): array\n{\n // When arguments are named.\n if (!is_list($args)) {\n return $args;\n }\n\n $ret = [];\n if ($argc = count($args)) {\n for ($i = 1; $i < $argc + 1; $i += 2) {\n $ret[$args[$i - 1]] = $args[$i];\n }\n }\n return $ret;\n}", "protected function parseEntitiesArguments()\n {\n $args = array();\n while ($arg = $this->matchFuncs(array('parseEntitiesAssignment', 'parseExpression'))) {\n $args[] = $arg;\n if (!$this->matchChar(',')) {\n break;\n }\n }\n\n return $args;\n }", "function sanitizeAny($input = '')\r\n{\r\n if (!is_array($input) || !count($input)) {\r\n return sanitizeValue($input);\r\n } else {\r\n return sanitizeArray($input);\r\n }\r\n}", "function sa_parseFuncArgs($argstr){\n $entries = array();\n $filteredData = $argstr;\n $userland = '[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*';\n if (preg_match_all(\"/$userland\\(([^)]*)\\)/\", $argstr, $matches)) {\n $entries = $matches[0];\n $filteredData = preg_replace(\"/$userland\\(([^)]*)\\)/\", \"-function-\", $argstr);\n }\n\n $arr = array_map(\"trim\", explode(\",\", $filteredData));\n\n if (!$entries) {\n return $arr;\n }\n\n $j = 0;\n foreach ($arr as $i => $entry) {\n if ($entry != \"-function-\") {\n continue;\n }\n\n $arr[$i] = $entries[$j];\n $j++;\n }\n\n return $arr;\n}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t//\tarray('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n {\n return [\n // ['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n }", "protected function getArguments()\n {\n return [\n // ['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n }", "protected function getArguments()\n {\n return [\n // ['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n }", "private function getArguments() {\n return array_slice($argv, 1);\n }", "function mdl_cmd_options(array $args)\n{\n return array_values(array_map(function ($item) {\n return str_replace('-', '', $item);\n }, array_filter($args, function ($arg) {\n return substr($arg, 0, 1) === '-' || substr($arg, 0, 2) === '--';\n })));\n}", "protected function getArguments()\n {\n return [\n ['name', InputArgument::REQUIRED, 'library name'],\n ];\n }", "protected function getArguments()\n\t{\n\t\treturn [\n//\t\t\t['query', InputArgument::REQUIRED, 'Query word you want to search for.'],\n\t\t];\n\t}", "private function escape_args(array $args) {\n $query = \"\";\n foreach($args as $i => $arg) {\n if($i % 2) {\n $query .= $this->sqlesc($arg);\n } else {\n $query .= $arg;\n }\n }\n return $query;\n }", "function _prep_args($args)\n\t{\n\t\t// If there is no $args[0], skip this and treat as an associative array\n\t\t// This can happen if there is only a single key, for example this is passed to table->generate\n\t\t// array(array('foo'=>'bar'))\n\t\tif (isset($args[0]) AND (count($args) == 1 && is_array($args[0])))\n\t\t{\n\t\t\t// args sent as indexed array\n\t\t\tif ( ! isset($args[0]['data']))\n\t\t\t{\n\t\t\t\tforeach ($args[0] as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (is_array($val) && isset($val['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$args[$key] = $val;\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$args[$key] = array('data' => $val);\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\tforeach ($args as $key => $val)\n\t\t\t{\n\t\t\t\tif ( ! is_array($val))\n\t\t\t\t{\n\t\t\t\t\t$args[$key] = array('data' => $val);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $args;\n\t}", "function getParams($input) {\n $allowedFields = ['post_id', 'user_name', 'content'];\n $filterParams = [];\n foreach($input as $param => $value){\n if(in_array($param, $allowedFields)){\n $filterParams[] = \"$param=:$param\";\n }\n }\n return implode(\", \", $filterParams);\n}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n {\n return [\n//\t\t\t['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n }", "function sanitizeArray(&$array)\n{\n $excludeListForSanitization = array('query');\n// $excludeListForSanitization = array();\n\n foreach ($array as $k => $v) {\n\n // split to key and value\n list($key, $val) = preg_split(\"/=/\", $v, 2);\n if (!isset($val)) {\n continue;\n }\n\n // when magic quotes is on, need to use stripslashes,\n // and then addslashes\n if (PHP_VERSION_ID < 50400 && get_magic_quotes_gpc()) {\n $val = stripslashes($val);\n }\n // note that we must use addslashes here because this function is called before the db connection is made\n // and sql_real_escape_string needs a db connection\n $val = addslashes($val);\n\n // if $key is included in exclude list, skip this param\n if (!in_array($key, $excludeListForSanitization)) {\n\n // check value\n if (strpos($val, '\\\\')) {\n list($val, $tmp) = explode('\\\\', $val);\n }\n\n // remove control code etc.\n $val = strtr($val, \"\\0\\r\\n<>'\\\"\", \" \");\n\n // check key\n if (preg_match('/\\\"/i', $key)) {\n unset($array[$k]);\n continue;\n }\n\n // set sanitized info\n $array[$k] = sprintf(\"%s=%s\", $key, $val);\n }\n }\n}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t/*['example', InputArgument::REQUIRED, 'An example argument.'],*/\n\t\t];\n\t}", "public function testParseArgumentsCanParseRuleArguments()\n {\n $this->assertEquals(['min' => 10, 'max' => 100], $this->ruleParse->parseArguments('min=10,max=100'));\n $this->assertEquals([0 => 10, 1 => 100], $this->ruleParse->parseArguments('10,100'));\n }", "public function args()\n {\n return [];\n }", "function sanitize($input) {\n if (is_array($input)) {\n foreach($input as $var=>$val) {\n $output[$var] = sanitize($val);\n }\n }\n else {\n $input = trim($input);\n if (get_magic_quotes_gpc()) {\n $input = stripslashes($input);\n }\n $output = strip_tags($input);\n }\n return $output;\n}", "function sanitize_system_string($string, $min='', $max='')\n{\n $pattern = '/(;|\\||`|>|<|&|^|\"|'.\"\\n|\\r|'\".'|{|}|[|]|\\)|\\()/i'; // no piping, passing possible environment variables ($),\n // seperate commands, nested execution, file redirection,\n // background processing, special commands (backspace, etc.), quotes\n // newlines, or some other special characters\n $string = preg_replace($pattern, '', $string);\n $string = '\"'.preg_replace('/\\$/', '\\\\\\$', $string).'\"'; //make sure this is only interpretted as ONE argument\n $len = strlen($string);\n if((($min != '') && ($len < $min)) || (($max != '') && ($len > $max)))\n return FALSE;\n return $string;\n}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "public function badArgumentProvider()\n {\n return [\n [0],\n [1.0],\n [function () {\n return '';\n }],\n ];\n }", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t// array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t// array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "private function sanitize ($query) {\n return array_map(array($this, 'clean'), $query);\n }", "public function getArgs();", "public function getArgs();", "protected function getArguments()\n {\n return array( //\t\t\tarray('example', InputArgument::REQUIRED, 'An example argument.'),\n );\n }", "protected function getArguments()\n {\n return array( //\t\t\tarray('example', InputArgument::REQUIRED, 'An example argument.'),\n );\n }", "function _r()\r\n{\r\n\t$args = func_get_args();\r\n\techo'<pre>';\r\n\tif (is_array($args)) {\r\n\t\tprint_r(arrayClean($args));\r\n\t} else {\r\n\t\tprint_r($args);\r\n\t}\r\n\techo'</pre>';\r\n}", "protected function getArguments()\n {\n return array(//\t\t\tarray('example', InputArgument::REQUIRED, 'An example argument.'),\n );\n }", "protected function prepRequestArguments($arguments): array\n {\n $return = [];\n foreach ($arguments as $key => $val) {\n $return[ucfirst($this->camelCase($key))] = $val;\n }\n return $return;\n }" ]
[ "0.731425", "0.6844637", "0.65650374", "0.6389837", "0.62739646", "0.6270349", "0.62693286", "0.6214124", "0.61543244", "0.60396636", "0.6036919", "0.5995927", "0.59755003", "0.5974423", "0.59299034", "0.59291553", "0.59247315", "0.57689947", "0.5752704", "0.574574", "0.5737169", "0.57291824", "0.57129776", "0.56363165", "0.5573722", "0.55347097", "0.5522158", "0.5519089", "0.5519089", "0.5506227", "0.54918754", "0.54833204", "0.54597104", "0.5449562", "0.5444973", "0.5438953", "0.54145795", "0.5407044", "0.5381974", "0.5370401", "0.5365392", "0.536233", "0.53621686", "0.5352175", "0.5349036", "0.5328997", "0.5323396", "0.5321744", "0.5300969", "0.52984416", "0.5288077", "0.5276319", "0.52747226", "0.5264962", "0.52607065", "0.52469033", "0.5246128", "0.5246128", "0.5246128", "0.5245617", "0.5243675", "0.5243421", "0.5242851", "0.5242267", "0.5240364", "0.52384603", "0.5233435", "0.5233435", "0.5233435", "0.5233435", "0.5233435", "0.5233435", "0.5233435", "0.5233435", "0.5228799", "0.522856", "0.522733", "0.5226301", "0.52217716", "0.521096", "0.52052456", "0.5204924", "0.5204924", "0.5204924", "0.5204924", "0.5204924", "0.5204924", "0.5204924", "0.5204924", "0.5191243", "0.51897585", "0.51897585", "0.51860833", "0.51834446", "0.51834446", "0.51798695", "0.51798695", "0.51755905", "0.51754516", "0.5175353" ]
0.5966752
14
Main method, extract data from self::$url
static public function extract() { try { $result = []; $document = @new Document(self::$url, true); $lines = $document ->find('tbody')[0] ->find('tr'); foreach ($lines as $line) { $columns = $line->find('td'); $current = []; foreach ($columns as $column) { $index = count($current); $current[self::$map[$index]] = $column->text(); } $result[] = $current; } return $result; } catch (\Exception $e) { return [ 'error' => true, 'code' => $e->getCode(), 'message' => $e->getMessage() ]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function obtenerURLData(){\n\t\t$urldata = (isset($_GET['page'])) ? $_GET['page'] : '' ;\n\t\tself::$urlPath = $urldata;\n\t\tif($urldata == ''){\n\t\t\tself::$urlBits[] = 'home';\n\t\t\tself::$urlPath = 'home';\n\t\t}else{\n\t\t\t$data = explode('/', $urldata);\n\t\t\twhile (!empty($data) && strlen(reset($data)) === 0){\n\t\t \tarray_shift( $data );\n\t\t }\n\t\t while (!empty($data) && strlen(end($data )) === 0){\n\t\t array_pop($data);\n\t\t }\n\t\t\tself::$urlBits = $this->array_trim( $data );\n\t\t}\n\t}", "abstract public function get_url_read();", "public function getURLData()\r\n\t{\r\n\t\t$urldata = (isset($_GET['page'])) ? $_GET['page'] : '' ;\r\n\t\tself::$urlPath = $urldata;\r\n\t\tif( $urldata == '' )\r\n\t\t{\r\n\t\t\tself::$urlBits[] = 'home';\r\n\t\t\tself::$urlPath = 'home';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data = explode( '/', $urldata );\r\n\t\t\twhile ( !empty( $data ) && strlen( reset( $data ) ) === 0 ) \r\n\t\t\t{\r\n\t\t \tarray_shift( $data );\r\n\t\t }\r\n\t\t while ( !empty( $data ) && strlen( end( $data ) ) === 0) \r\n\t\t {\r\n\t\t array_pop($data);\r\n\t\t }\r\n\t\t\tself::$urlBits = $this->array_trim( $data );\r\n\t\t}\r\n\t}", "public function getInfo($url);", "private function getDataByScrapeUrl()\n {\n return file_get_contents($this->url);\n }", "public static function parse() {\n\t\t/* Grab the base URL from the Site class */\n\t\t$baseurl = parse_url( Config::instance()->get('baseurl') );\n\t\t$baseurl = $baseurl['path'];\n\n\t\t/* Start with the entire URL coming from web server... */\n\t\tif(isset($_SERVER['REQUEST_URI']))\n\t\t\t$request = str_replace('?' . $_SERVER['QUERY_STRING'], '', $_SERVER['REQUEST_URI']);\n\t\telse\n\t\t\t$request = $_SERVER['SCRIPT_NAME'] . ( isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '' );\n\n\t\t/* Strip out the base URL from the requested URL */\n\t\t/* but only if the base URL isn't / */\n\t\tif ( '/' != $baseurl ) {\n\t\t\t$request = str_replace($baseurl, '', $request);\n\t\t}\n\n\t\t$request = trim($request, '/');\n\t\tself::$request = $request;\n\t}", "public function collectData($url) {\n\t\t\t\n\t\t}", "function fetch_info($_url=\"\"){ \n if($_url&&$this-> fetch($_url)){\n $html = str_get_html($this-> html);\n $header = $html->find('head',0);\n $info['title'] = $header ->find('title',0)->plaintext;\n if( $keywords = $header ->find('meta[name=keywords]',0) )\n $info['keywords'] = $keywords->content;\n if( $description = $header ->find('meta[name=description]',0))\n $info['description'] = $description ->content;\n return $info;\n }\n return false;\n }", "private function parseURL()\n {\n $request = trim($_SERVER['REQUEST_URI'], '/');\n\n\n //If our request has question mark, then we got parameters\n if( strpos($request, '?') )\n {\n //Removing all GET parameters from the request\n $request = substr($request, 0, strpos($request, '?'));\n }\n\n if (!empty($request)) {\n\n $url = explode('/', $request); //split everything by slashes\n // var_dump($url);\n\n if ($url) {\n //The pattern of the url is ==> localhost/controller/action\n //controller is the first element of the url \n //(basically we're checking for the files with Controller as the \n //last part of their name, in the CONTROLLER directory, \n //for instance, we have a file with name imageController.php in the CONTROLLER directory)\n $this->controller = $url[0] . 'Controller';\n //action is the second element of the url and if it is set we're using it,\n //otherwise we use index page\n $this->action = isset($url[1]) ? $url[1] : $this->action;\n }\n }\n }", "private function splitUrl()\n {\n if (isset($_GET['url'])) {\n\n // split URL\n $url = rtrim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n \n // Put URL parts into according properties\n // By the way, the syntax here is just a short form of if/else, called \"Ternary Operators\"\n // @see http://davidwalsh.name/php-shorthand-if-else-ternary-operators\n $this->url_controller = (isset($url[0]) ? $url[0] : null);\n $this->url_action = (isset($url[1]) ? $url[1] : null);\n $this->url_parameter_1 = (isset($url[2]) ? $url[2] : null);\n $this->url_parameter_2 = (isset($url[3]) ? $url[3] : null);\n $this->url_parameter_3 = (isset($url[4]) ? $url[4] : null);\n\n // for debugging. uncomment this if you have problems with the URL\n # echo 'Controller: ' . $this->url_controller . '<br />';\n # echo 'Action: ' . $this->url_action . '<br />';\n # echo 'Parameter 1: ' . $this->url_parameter_1 . '<br />';\n # echo 'Parameter 2: ' . $this->url_parameter_2 . '<br />';\n # echo 'Parameter 3: ' . $this->url_parameter_3 . '<br />';\n }\n }", "function get_url()\n {\n }", "private function _getUrl()\n {\n // Explode url to the array Variabels (url)\n $url = isset($_GET['url']) ? $_GET['url'] : null;;\n $url = rtrim($url, '/');\n $url = filter_var($url,FILTER_SANITIZE_URL);\n $this->_url = explode('/', $url);\n }", "private function ParseUrl()\n {\n $url = explode('/', trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/'), 3);\n\n if (isset($url[0]) AND $url[0] != '') {\n $this->_controller = $url[0];\n }\n if (isset($url[1]) AND $url[1] != '') {\n $this->_action = $url[1];\n }\n if (isset($url[2]) AND $url[2] != '') {\n $this->_params = explode('/', $url[2]);\n }\n }", "private function makeDataFromUrl(){\n if (empty($_GET)){\n Route::$controller='home';\n return true;\n }\n $routs= explode('/',strip_tags($_GET['route']));\n $result=array();\n foreach ($routs as $k=>$v){\n switch ($k){\n case 0:\n $result['controller']=$v;\n $result['method']='index';\n Route::$controller=$v;\n Route::$method='index';\n break;\n default: $result['data'][]=$v;\n }\n }\n if (!empty($result['data']))\n Route::$data=$result['data'];\n return true;\n }", "function read(){\n if($this->url != \"\"){\n if($this->url[strlen($this->url)-1] == \"/\") {\n $this->url = substr($this->url, 0,(strlen($this->url)-1));\n }\n $this->url_arr = explode(\"/\", $this->url);\n } else {\n $this->url_arr[0] = \"\";\n }\n \n return $this->url_arr;\n }", "public abstract function getURL();", "private function _getUrl()\n\t{\n\t\t$url = isset($_GET['url']) ? $_GET['url'] : null;\n\t\t$url = rtrim($url, '/');\n\t\t$url = filter_var($url, FILTER_SANITIZE_URL);\n\t\t$this->_url = explode('/', $url);\n\t}", "private function _getUrl()\n\t{\n\t\t$url = isset($_GET['url']) ? $_GET['url'] : null;\n\t\t$url = rtrim($url, '/');\n\t\t$url = filter_var($url, FILTER_SANITIZE_URL);\n\t\t$this->_url = explode('/', $url);\n\t}", "private function DownloadParsePage() {\n $this->Log(\"Debridage du lien : \".$this->url);\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($curl, CURLOPT_USERAGENT, DOWNLOAD_STATION_USER_AGENT);\n\t\tcurl_setopt($curl, CURLOPT_COOKIEFILE, $this->TOUTDEBRID_COOKIE);\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_URL, $this->TOUTDEBRID_DEBRID_URL);\n curl_setopt($curl, CURLOPT_POST, TRUE);\n curl_setopt($curl, CURLOPT_POSTFIELDS, 'urllist='.urlencode($this->url).'&captcha=none&');\n\t\t$ret = curl_exec($curl);\n\t\t$this->Log(\"Reponse tout-debrid : \".$ret);\n\t\tcurl_close($curl);\n\t\treturn $ret;\n\t}", "public function parse($url);", "static function parseURL()\n {\n if(isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO']!=\"/\")\n {\n $url=explode(\"/\",trim($_SERVER['PATH_INFO'],\"/\"));\n if($url[0]==\"admin\")\n {\n define(\"SIDE\", \"admin\");\n self::$controller = $url[0];\n self::$controller = isset($url[1]) ? $url[1] : \"welcome\";\n self::$action = isset($url[2]) ? $url[2] : \"index\";\n }\n else\n {\n define(\"SIDE\", \"client\");\n self::$controller = $url[0];\n self::$action = isset($url[1]) ? $url[1] : \"index\";\n }\n }\n else\n {\n define(\"SIDE\", \"client\");\n self::$controller = \"welcome\";\n self::$action = \"index\";\n }\n }", "private function parse_data($url){\n\n\t\t//set up the curl and execute it\n\t\t$curl_site = curl_init();\n\t\tcurl_setopt($curl_site, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl_site, CURLOPT_RETURNTRANSFER, 1); \n\t\t$output= curl_exec($curl_site);\n\n\t\t//split up the page based on the string 'createMarker' \n\t\t$areas = explode('createMarker', $output);\n\t\t$last = count($areas);\n\n\t\t//break up the last farm and take off all the unecessart html code\n\t\t$last_farm = explode(';', $areas[$last-1], 2);\n\t\t$areas[$last-1] = $last_farm[0];\n\n\t\t//unset the first two because they are useless\n\t\tunset($areas[0], $areas[1]);\n\n\t\t//break up the data, trim it and add it to a array\n\t\t$i=0;\n\t\tforeach($areas as $farm){\n\t\t\t$farm_parameters = explode('<br />', $farm);\n\t\t\t$holder = explode('\\\">', $farm_parameters[0]);\n\t\t\t$geo = explode(',', $holder[0],3);\n\t\t\t$locations[$i]= array(\n\t\t\t\t'name'=> rtrim($holder[2],'</a>'),\n\t\t\t\t'address'=>trim($farm_parameters[1]).' '.trim($farm_parameters[2]),\n\t\t\t\t'latitude'=>ltrim($geo[0],'('),\n\t\t\t\t'longitude'=>$geo[1]);\n\t\t\t$i = $i+1;\n\t\t}\n\t\treturn $locations;\n\t}", "public function getURL ();", "public function getURL();", "public function getURL();", "public function parseUrl(){\n\n if(isset($_GET['url'])){\n //echo $_GET['url'];\n\n return $url = explode('/',filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n }\n }", "private function splitUrl() {\n\n if (isset($_GET['url'])) {\n\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n unset($url[0], $url[1]);\n\n $this->url_params = array_values($url);\n\n // para debugging, descomente estas lineas si tiene problemas con la URL\n //echo 'Controller: ' . $this->url_controller . '<br>';\n //echo 'Action: ' . $this->url_action . '<br>';\n //echo 'Parameters: ' . print_r($this->url_params, true) . '<br>';\n }\n }", "public function get_url()\n {\n }", "public function __construct()\r\n {\r\n $this->geturl();\r\n }", "private function Get_URL()\n {\n $url = $this->CURL->GET_SERVER_URL();\n $download_url = $url.\"/application/download/download.php\";\n $view_url = $url.\"/application/pdf/view.php\";\n $this->DOWNLOAD_URL = $download_url;\n $this->VIEW_URL = $view_url;\n }", "protected function extractUrls($data){\n\t\tif(isset($data['body']) && isset($data['body']['status']) && $data['body']['status'] == 'available'){\n\t\t\t// fetch source resolution\n\t\t\t$sourceMeasures = array();\n\t\t\t$biggestWidth = 0;\n\t\t\t$biggestHeight = 0;\n\t\t\tforeach($data['body']['download'] as $dl){\n\t\t\t\tif($biggestWidth < $dl['width']) $biggestWidth = $dl['width'];\n\t\t\t\tif($biggestHeight < $dl['height']) $biggestHeight = $dl['height'];\n\t\t\t\t\n\t\t\t\t// check if source is still existent\n\t\t\t\tif(isset($dl['type']) && $dl['type'] == 'source'){\n\t\t\t\t\t$sourceMeasures['width'] = $dl['width'];\n\t\t\t\t\t$sourceMeasures['height'] = $dl['height'];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!(isset($sourceMeasures['width']) && isset($sourceMeasures['height']))){\n\t\t\t\t$sourceMeasures['width'] = $biggestWidth;\n\t\t\t\t$sourceMeasures['height'] = $biggestHeight;\n\t\t\t}\n\t\t\t\n\t\t\t// fetch available resolution\n\t\t\t$availRes = array();\n\t\t\tforeach($data['body']['files'] as $f){\n\t\t\t\tif(isset($f['quality']) && isset($f['width']) && isset($f['height']) && isset($f['link']) && isset($f['link_secure'])){\n\t\t\t\t\tif($f['quality'] == 'sd' && $f['height'] == 360){\n\t\t\t\t\t\t$availRes['mobile'] = $f['link'];\n\t\t\t\t\t\t$availRes['mobile_secure'] = $f['link_secure'];\n\t\t\t\t\t}else if($f['quality'] == 'sd' && $f['height'] == 540){\n\t\t\t\t\t\t$availRes['hd'] = $f['link'];\n\t\t\t\t\t\t$availRes['hd_secure'] = $f['link_secure'];\n\t\t\t\t\t}else if($f['quality'] == 'hd' && $f['height'] == 720){\n\t\t\t\t\t\t$availRes['hd'] = $f['link'];\n\t\t\t\t\t\t$availRes['hd_secure'] = $f['link_secure'];\n\t\t\t\t\t}else if($f['quality'] == 'hd' && $f['height'] == 1080){\n\t\t\t\t\t\t$availRes['fullhd'] = $f['link'];\n\t\t\t\t\t\t$availRes['fullhd_secure'] = $f['link_secure'];\n\t\t\t\t\t}\n\t\t\t\t}else if(isset($f['quality']) && $f['quality'] == 'hls' && isset($f['link']) && isset($f['link_secure'])){\n\t\t\t\t\t$availRes['hls'] = str_replace('https', 'http', $f['link']);\n\t\t\t\t\t$availRes['hls_secure'] = $f['link_secure'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($sourceMeasures['width']) && isset($sourceMeasures['height'])){\n\t\t\t\t// source file and measurements found\n\t\t\t\t// check for highest resolution\n\t\t\t\tif($sourceMeasures['width'] >= 1920 && $sourceMeasures['height'] >= 1080){\n\t\t\t\t\t// Video is full HD, so Full HD should be availalbe\n\t\t\t\t\tif(isset($availRes['fullhd']) && isset($availRes['hd']) && isset($availRes['sd'])){\n\t\t\t\t\t\t$this->VimeoFullHDUrl = $availRes['fullhd'];\n\t\t\t\t\t\t$this->VimeoFullHDUrlSecure = $availRes['fullhd_secure'];\n\t\t\t\t\t\t$this->VimeoHDUrl = $availRes['hd'];\n\t\t\t\t\t\t$this->VimeoHDUrlSecure = $availRes['hd_secure'];\n\t\t\t\t\t\t$this->VimeoSDUrl = $availRes['sd'];\n\t\t\t\t\t\t$this->VimeoSDUrlSecure = $availRes['sd_secure'];\n\t\t\t\t\t\t$this->VimeoMobileUrl = $availRes['mobile'];\n\t\t\t\t\t\t$this->VimeoMobileUrlSecure = $availRes['mobile_secure'];\n\t\t\t\t\t\t$this->VimeoPicturesURI = $data['body']['pictures']['uri'];\n\t\t\t\t\t\tif(isset($availRes['hls'])){\n\t\t\t\t\t\t\t$this->VimeoHLSUrl = $availRes['hls'];\n\t\t\t\t\t\t\t$this->VimeoHLSUrlSecure = $availRes['hls_secure'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->VimeoProcessingStatus = 'finished';\n\t\t\t\t\t\t$this->write();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}else if($sourceMeasures['width'] >= 1280 && $sourceMeasures['height'] >= 720){\n\t\t\t\t\t// Video is HD, so at least HD schould be available\n\t\t\t\t\tif(isset($availRes['hd']) && isset($availRes['sd'])){\n\t\t\t\t\t\t$this->VimeoFullHDUrl = null;\n\t\t\t\t\t\t$this->VimeoFullHDUrlSecure = null;\n\t\t\t\t\t\t$this->VimeoHDUrl = $availRes['hd'];\n\t\t\t\t\t\t$this->VimeoHDUrlSecure = $availRes['hd_secure'];\n\t\t\t\t\t\t$this->VimeoSDUrl = $availRes['sd'];\n\t\t\t\t\t\t$this->VimeoSDUrlSecure = $availRes['sd_secure'];\n\t\t\t\t\t\t$this->VimeoMobileUrl = $availRes['mobile'];\n\t\t\t\t\t\t$this->VimeoMobileUrlSecure = $availRes['mobile_secure'];\n\t\t\t\t\t\t$this->VimeoPicturesURI = $data['body']['pictures']['uri'];\n\t\t\t\t\t\tif(isset($availRes['hls'])){\n\t\t\t\t\t\t\t$this->VimeoHLSUrl = $availRes['hls'];\n\t\t\t\t\t\t\t$this->VimeoHLSUrlSecure = $availRes['hls_secure'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->VimeoProcessingStatus = 'finished';\n\t\t\t\t\t\t$this->write();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t// Video is SD, so at least SD schould be available\n\t\t\t\t\tif(isset($availRes['sd'])){\n\t\t\t\t\t\t$this->VimeoFullHDUrl = null;\n\t\t\t\t\t\t$this->VimeoFullHDUrlSecure = null;\n\t\t\t\t\t\t$this->VimeoHDUrl = null;\n\t\t\t\t\t\t$this->VimeoHDUrlSecure = null;\n\t\t\t\t\t\t$this->VimeoSDUrl = $availRes['sd'];\n\t\t\t\t\t\t$this->VimeoSDUrlSecure = $availRes['sd_secure'];\n\t\t\t\t\t\t$this->VimeoMobileUrl = $availRes['mobile'];\n\t\t\t\t\t\t$this->VimeoMobileUrlSecure = $availRes['mobile_secure'];\n\t\t\t\t\t\t$this->VimeoPicturesURI = $data['body']['pictures']['uri'];\n\t\t\t\t\t\tif(isset($availRes['hls'])){\n\t\t\t\t\t\t\t$this->VimeoHLSUrl = $availRes['hls'];\n\t\t\t\t\t\t\t$this->VimeoHLSUrlSecure = $availRes['hls_secure'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->VimeoProcessingStatus = 'finished';\n\t\t\t\t\t\t$this->write();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else if(isset($data['body']) && isset($data['body']['status']) && ($data['body']['status'] == 'quota_exceeded' || $data['body']['status'] == 'uploading_error' || $data['body']['status'] == 'transcoding_error')){\n\t\t\t$this->VimeoProcessingStatus = 'processingerror';\n\t\t\t$this->write();\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function getData()\n\t{\n\t\t$data['homeUrl'] = \"http://lancewf.no-ip.info\";\n\t\t\n\t\treturn $data;\t\n\t}", "abstract public function get_url_update();", "public function get_url();", "public function processUrl(){\n\t\t\n\t\tif (isset($_GET['url'])) {\n\t\t\treturn $url = explode('/',filter_var(rtrim($_GET['url'],'/'),FILTER_SANITIZE_URL));//what we're doing here is attempting to filter the url to make it clean and easy to use in our case we're going to explode the url into an array.\n\t\t}\n\n\n\t}", "public function parse_uri() {\n $url = \"http://localhost\" . $this->uri;\n $parsed_url = parse_url($url);\n $this->path = $parsed_url['path'];\n @$this->query = $parsed_url['query'];\n }", "public function splitUrl() {\n if (isset($_GET['url'])) {\n\n // split URL\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_STRING);\n $url = explode('/', $url);\n\n // parse custom urls\n $url = $this->parseRoutes($url);\n\n if ($this->app->language->enabled) {\n // set lang key\n $this->lang_key = isset($url[0]) ? $url[0] : null;\n // set controller\n $this->url_controller = isset($url[1]) ? $url[1] : null;\n // and action\n $this->url_action = isset($url[2]) ? $url[2] : null;\n\n // store URL parts\n $this->url_parts = array_values($url);\n\n // remove controller and action from URL parts\n unset($url[0], $url[1], $url[2]);\n } else {\n // set controller\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n // and action\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n // store URL parts\n $this->url_parts = array_values($url);\n\n // remove controller and action from URL parts\n unset($url[0], $url[1]);\n }\n\n // store action params\n $this->action_params = array_values($url);\n\n }\n }", "function parse() {\n static $_url;\n static $COMPONENTS;\n\t\n\t//flush static\n\tif($_url != $this->url) {\n\t\t$_url = $this->url;\n\t\t$_CMPNNTS = $this->isValid(1);\n\t\t$COMPONENTS = array(\n\t\t\tprotocol => $_CMPNNTS[2],\n\t\t\tuser => $_CMPNNTS[4],\n\t\t\tpassword => $_CMPNNTS[5],\n\t\t\tsub_domain => ereg_replace('\\.$', '', $_CMPNNTS[6]),\n\t\t\tSUB_DOMAINS => ($_CMPNNTS[6])\n\t\t\t\t?explode('.', ereg_replace('\\.$', '', $_CMPNNTS[6])):NULL,\n\t\t\tdomain => $_CMPNNTS[9],\n\t\t\ttld => $_CMPNNTS[10],\n\t\t\tdomain_name => ($_CMPNNTS[9] && $_CMPNNTS[10])?\n\t\t\t\t$_CMPNNTS[9] . \".\" . $_CMPNNTS[10]:NULL,\n\t\t\tport => $_CMPNNTS[12],\n\t\t\thost => ($_CMPNNTS[6]\n\t\t\t\t&& $_CMPNNTS[9]\n\t\t\t\t&& $_CMPNNTS[10])?$_CMPNNTS[6]\n\t\t\t\t\t.$_CMPNNTS[9] . \".\"\n\t\t\t\t\t.$_CMPNNTS[10]:NULL,\n\t\t\tpath => $_CMPNNTS[13],\n\t\t\tPATH =>($_CMPNNTS[13])?\n\t\t\t\texplode('/', ereg_replace('^/(.*)/$', '\\\\1', $_CMPNNTS[13])):NULL,\n\t\t\tquery => $_CMPNNTS[15]\n\t\t\t);\n\t\t}\n\treturn $COMPONENTS;\n\t}", "function getData($url) {\n $xml = parseHTML($url);\n $storeIDs = getStoreIDs($xml);\n $addresses = getAddresses($xml);\n $phoneNumbers = getPhone($xml);\n $latitudes = getLatitudes($xml);\n $longitudes = getLongitudes($xml);\n $latLng = combineLatLng($latitudes, $longitudes);\n return organizeData($storeIDs, $addresses, $phoneNumbers, $latLng);\n}", "public function url() {\n return $this->info['url'];\n }", "protected static function parse_url($url)\n {\n }", "private static function parseUrl(stdClass $data){\n\t\tif(!isset($_GET[self::URL_KEY])){\n\t\t\treturn null;\n\t\t}\n\n\t\t$urlData = (string)$_GET[self::URL_KEY];\n\n\t\t//check url\n\t\tif(!preg_match('/^((\\d+)'.self::URL_SEPARATOR.'){5}(\\d+)$/', $urlData)){\n\t\t\treturn null;\n\t\t}\n\n\t\t$split = explode(self::URL_SEPARATOR, $urlData);\n\t\t$loadData = array();\n\n\t\tif(count($split)!=6){\n\t\t\treturn null;\n\t\t}\n\n\t\t//part 1: weaponBase\n\t\t$loadData['weaponBase'] = $split[0];\n\n\t\t//part 2: skillBase\n\t\t$loadData['skillBase'] = $split[1];\n\n\t\t//part 3: types\n\t\tforeach($data->fields->type as $i=>$field){\n\t\t\tif(isset($split[2][$i])){\n\t\t\t\t$loadData[$field] = $split[2][$i];\n\t\t\t}\n\t\t}\n\n\t\t//part 4: enchants\n\t\tforeach($data->fields->enchant as $i=>$field){\n\t\t\tif(isset($split[3][$i])){\n\t\t\t\t$loadData[$field] = $split[3][$i];\n\t\t\t}\n\t\t}\n\n\t\t//part 5: number keys (remove the first 2 parts since those are the two base values we got above)\n\t\t$numberFieldKeys = array_keys($data->fields->number);\n\t\tarray_shift($numberFieldKeys);\n\t\tarray_shift($numberFieldKeys);\n\t\tforeach($numberFieldKeys as $i=>$field){\n\t\t\tif(isset($split[4][$i])){\n\t\t\t\t$loadData[$field] = $split[4][$i];\n\t\t\t}\n\t\t}\n\n\t\t//part 6: bool keys\n\t\t$boolFieldKeys = array_keys($data->fields->bool);\n\t\t$split[5] = strrev(decbin($split[5]));\n\t\tforeach($boolFieldKeys as $i=>$field){\n\t\t\tif(isset($split[5][$i])){\n\t\t\t\t$loadData[$field] = $split[5][$i];\n\t\t\t}\n\t\t}\n\n\t\tif(count($loadData)<1){\n\t\t\treturn null;\n\t\t}\n\n\t\t//force submit mode to show results when loading\n\t\t$loadData['doCalculation'] = true;\n\n\t\treturn $loadData;\n\t}", "public function getInfo($data){\n // From URL to get webpage contents.\n $url = \"https://api.rawg.io/api/games?key=16eeee7089554d7191b4a1a048ccb468&page=2\";\n\n // Initialize a CURL session.\n $ch = curl_init();\n\n // Return Page contents. don't forget to add the proxy for Wheatley\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n //grab URL and pass it to the variable.\n if (isset($data))\n if (true)\n {\n curl_setopt($ch, CURLOPT_URL, $url);\n $result = curl_exec($ch);\n $result = json_decode($result);\n\n if (true) {\n $tmp = [];\n $games=$result->results;\n foreach ($games as $r){\n array_push($tmp, array(\"title\" => \"$r->name\",\n \"cover\" => \"$r->background_image\",\n \"rating\" => \"$r->rating\",\n \"score\" => \"$r->metacritic\",\n \"released\" => \"$r->released\"\n\n ));\n }\n return $tmp;\n }\n }\n curl_close($ch);\n\n }", "function get_url_content($url=''){\n\n get_clean_url($url);\n show_route_content();\n \n enable_url_aliases();\n \n //~ echo $_GET['fetched-url'];\n //~ echo '<br>';\n //~ print_r($_GET['clean-url']);\n //~ print_r($_SESSION);\n}", "function grab(){\n\n\t\t$domains = explode(\",\",$this->conf->startUp[\"APPS.DOMAIN\"]);\n\t\tif(in_array(\"\".$_SERVER[\"HTTP_HOST\"],$domains)){\n\t\t\t$domain = $_SERVER[\"HTTP_HOST\"];\n\t\t}else{\n\t\t\t$domain = \"localhost\";\n\t\t}\t\n\n\t\t$bruto_url = $_SERVER[\"REQUEST_SCHEME\"].\"://\".\n\t\t\t$domain.$_SERVER[\"REQUEST_URI\"];\n\n\t\t$net_url = isset($bruto_url) ? $bruto_url : false;\n\n\t\tif($net_url)\n\t\t{\n\t\t\t//format HMVC [modules][controller ++model++views]\n\t\t\t//format MVC controler ++model++views\n\t\t\t$modeHMVC = self::$confStatic->startUp[\"APPS.MODULAR\"];\n\t\t\t$net_url \t= parse_url($net_url);\n\t\t\t$array_path = explode('/',ltrim($net_url['path'],'/'));\n\n\t\t\t$pageComponent=[];\n\t\t\tif($modeHMVC == \"true\"){ \n\t\t\t\t//jika dijalankan pada mode lokal atau online\n\t\t\t\tif($domain == \"localhost\" || $domain == \"127.0.0.1\"){\n\t\t\t\t\t$pageComponent['modul']\t\t= ucfirst($array_path[1]);\n\t\t\t\t\t$pageComponent['class'] \t= isset($array_path[2]) ? $array_path[2] : $this->conf->startUp[\"APPS.BASEPAGE\"];\n\t\t\t\t\t$pageComponent['func'] \t\t= isset($array_path[3]) ? $array_path[3] : $this->conf->startUp[\"APPS.FUNC\"];\n\t\t\t\t\t$pageComponent['params'] \t= isset($array_path[3]) ? array_slice($array_path,4) : null;\t\t\t\n\n\t\t\t\t}\n\t\t\t\t//jika tidak mode local\n\t\t\t\telse{\n\t\t\t\t\t$pageComponent['modul'] \t\t= ucfirst($array_path[0]);\n\t\t\t\t\t$pageComponent['class'] \t\t= isset($array_path[1]) ? $array_path[1] : $this->conf->startUp[\"APPS.BASEPAGE\"];\n\t\t\t\t\t$pageComponent['func'] \t\t\t= isset($array_path[2]) ? $array_path[2] : $this->conf->startUp[\"APPS.FUNC\"];\n\t\t\t\t\t$pageComponent['params']\t\t= isset($array_path[2]) ? array_slice($array_path,3) : null;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t//jika mode local\n\t\t\t\tif($domain == \"localhost\" || $domain == \"127.0.0.1\"){\n\t\t\t\t\t$pageComponent['modul'] \t\t= \"\";\n\t\t\t\t\t$pageComponent['class'] \t\t= $array_path[1];\n\t\t\t\t\t$pageComponent['func'] \t\t\t= isset($array_path[2]) ? $array_path[2] : $this->conf->startUp[\"APPS.FUNC\"];\n\t\t\t\t\t$pageComponent['params']\t\t= isset($array_path[2]) ? array_slice($array_path,3) : null;\n\t\t\t\t}\n\t\t\t\t//jika tidak mode lokal\n\t\t\t\telse{\n\t\t\t\t\t$pageComponent['modul'] \t\t= \"\";\n\t\t\t\t\t$pageComponent['class'] \t\t= $array_path[0];\n\t\t\t\t\t$pageComponent['func'] \t\t\t= isset($array_path[1]) ? $array_path[1] : $this->conf->startUp[\"APPS.FUNC\"];\n\t\t\t\t\t$pageComponent['params'] \t\t= isset($array_path[1]) ? array_slice($array_path,2) : null;\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\t$pageComponent = (object) $pageComponent;\n\n\n\t\t\tif(isset($net_url['query'])){\n\n\t\t\t\tparse_str($net_url['query'],$array_query_string);\n\t\t\t\treq::setQueryGET($array_query_string);\t\n\t\t\t\t//var_dump($array_query_string);\n\t\t\t}else{\n\t\t\t\t$array_query_string = [];\n\t\t\t\t//var_dump($array_query_string);\n\t\t\t}\n\n\t\t\tif($pageComponent->class==\"\"){$pageComponent->class = self::$confStatic->startUp[\"APPS.BASEPAGE\"];}\n\t\t\treq::setParamsFunc((array)$pageComponent->params);\n\t\t\tself::setupPage(self::$rutes,$pageComponent);\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"whoopppsss something went wrong\";\n\t\t\t//error whoopsss plugin\n\t\t}\n\t}", "private function _getUrl()\r\n {\r\n $url = filter_input(INPUT_GET, 'url');\r\n $url = rtrim($url, '/');\r\n $url = filter_var($url,FILTER_SANITIZE_URL);\r\n $this->_url = explode('/', $url);\r\n }", "public function collectData(){\n\t\t// Simple HTML Dom is not accurate enough for the job\n\t\t$content = getContents($this->getURI())\n\t\t\tor returnServerError('No results for LWNprev');\n\n\t\tlibxml_use_internal_errors(true);\n\t\t$html = new DOMDocument();\n\t\t$html->loadHTML($content);\n\t\tlibxml_clear_errors();\n\n\t\t$cat1 = '';\n\t\t$cat2 = '';\n\n\t\tforeach($html->getElementsByTagName('a') as $a){\n\t\t\tif($a->textContent === 'Multi-page format'){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$realURI = self::URI . $a->getAttribute('href');\n\t\t$URICounter = 0;\n\n\t\t$edition = $html->getElementsByTagName('h1')->item(0)->textContent;\n\t\t$editionTimeStamp = strtotime(\n\t\t\tsubstr($edition, strpos($edition, 'for ') + strlen('for '))\n\t\t);\n\n\t\tforeach($html->getElementsByTagName('h2') as $h2){\n\t\t\tif($h2->getAttribute('class') !== 'SummaryHL'){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$item = array();\n\n\t\t\t$h2NextSibling = $h2->nextSibling;\n\t\t\t$this->jumpToNextTag($h2NextSibling);\n\n\t\t\tswitch($h2NextSibling->getAttribute('class')){\n\t\t\tcase 'FeatureByline':\n\t\t\t\t$item['author'] = $h2NextSibling->getElementsByTagName('b')->item(0)->textContent;\n\t\t\t\tbreak;\n\t\t\tcase 'GAByline':\n\t\t\t\t$text = $h2NextSibling->textContent;\n\t\t\t\t$item['author'] = substr($text, strpos($text, 'by '));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$item['author'] = 'LWN';\n\t\t\t\tbreak;\n\t\t\t};\n\n\t\t\t$h2FirstChild = $h2->firstChild;\n\t\t\t$this->jumpToNextTag($h2FirstChild);\n\t\t\tif($h2FirstChild->nodeName === 'a'){\n\t\t\t\t$item['uri'] = self::URI . $h2FirstChild->getAttribute('href');\n\t\t\t}else{\n\t\t\t\t$item['uri'] = $realURI . '#' . $URICounter;\n\t\t\t}\n\t\t\t$URICounter++;\n\n\t\t\t$item['timestamp'] = $editionTimeStamp + $URICounter;\n\n\t\t\t$h2PrevSibling = $h2->previousSibling;\n\t\t\t$this->jumpToPreviousTag($h2PrevSibling);\n\t\t\tswitch($h2PrevSibling->getAttribute('class')){\n\t\t\tcase 'Cat2HL':\n\t\t\t\t$cat2 = $h2PrevSibling->textContent;\n\t\t\t\t$h2PrevSibling = $h2PrevSibling->previousSibling;\n\t\t\t\t$this->jumpToPreviousTag($h2PrevSibling);\n\t\t\t\tif($h2PrevSibling->getAttribute('class') !== 'Cat1HL'){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$cat1 = $h2PrevSibling->textContent;\n\t\t\t\tbreak;\n\t\t\tcase 'Cat1HL':\n\t\t\t\t$cat1 = $h2PrevSibling->textContent;\n\t\t\t\t$cat2 = '';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$h2PrevSibling = null;\n\n\t\t\t$item['title'] = '';\n\t\t\tif(!empty($cat1)){\n\t\t\t\t$item['title'] .= '[' . $cat1 . ($cat2 ? '/' . $cat2 : '') . '] ';\n\t\t\t}\n\t\t\t$item['title'] .= $h2->textContent;\n\n\t\t\t$node = $h2;\n\t\t\t$content = '';\n\t\t\t$contentEnd = false;\n\t\t\twhile(!$contentEnd){\n\t\t\t\t$node = $node->nextSibling;\n\t\t\t\tif(!$node || (\n\t\t\t\t\t\t$node->nodeType !== XML_TEXT_NODE && (\n\t\t\t\t\t\t\t$node->nodeName === 'h2' || (\n\t\t\t\t\t\t\t\t!is_null($node->attributes) &&\n\t\t\t\t\t\t\t\t!is_null($class = $node->attributes->getNamedItem('class')) &&\n\t\t\t\t\t\t\t\tin_array($class->nodeValue, array('Cat1HL', 'Cat2HL'))\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\t$contentEnd = true;\n\t\t\t\t}else{\n\t\t\t\t\t$content .= $node->C14N();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$item['content'] = $content;\n\t\t\t$this->items[] = $item;\n\t\t}\n\t}", "public function parse()\n {\n // turn the url into an array by nodes\n $this->nodes = explode('/', $this->url);\n \n // slide the controller off the first element\n $this->controller = array_shift($this->nodes);\n\t // break the path apart into its segments\n\t // controller - params ( node will always be empty for restful urls )\n\t //@list( , $this->nodes ) = explode( '/', $this->url, 2 );\n\t\n\t // add params to the to the params array\n/*\n\t if ( !empty( $params ) ) {\n\t \n\t // break apart the params\n\t $params = explode( '/', $params );\n\t\n\t for ( $i = 0; $i < count( $params ); $i++ ) {\n\t $this->params[] = str_replace( KEYWORD_SEPARATOR, ' ', $params[$i]);\n\t }\n\t }\n*/\n \n \n }", "private function parseUrl()\n {\n $url = $_SERVER['REQUEST_URI'];\n if (!empty($url)) {\n // parse url\n $this->params = explode(\"/\", filter_var(rtrim($url, \"/\"), FILTER_SANITIZE_URL));\n }\n\n if(empty($this->params[0])) {\n unset($this->params[0]);\n\n $this->params = array_values($this->params);\n }\n\n $this->getController();\n $this->getAction();\n\n $this->params = array_values($this->params);\n }", "private function splitUrl()\n {\n if (isset($_GET['apps'])) {\n\n $url = rtrim($_GET['apps'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n \n $this->url_controller = (isset($url[0]) ? $url[0] : null);\n $this->url_action = (isset($url[1]) ? $url[1] : null);\n $this->url_parameter_1 = (isset($url[2]) ? $url[2] : null);\n $this->url_parameter_2 = (isset($url[3]) ? $url[3] : null);\n $this->url_parameter_3 = (isset($url[4]) ? $url[4] : null);\n\t\t\t\n\n // for debugging. uncomment this if you have problems with the URL\t\t\t\n\t\t\t/*\n\t\t\t echo '<br/><br/><br/><br/><br/><br/><br/><br/>';\n echo 'Controller: ' . $this->url_controller . '<br />';\n echo 'Action: ' . $this->url_action . '<br />';\n echo 'Parameter 1: ' . $this->url_parameter_1 . '<br />';\n echo 'Parameter 2: ' . $this->url_parameter_2 . '<br />';\n echo 'Parameter 3: ' . $this->url_parameter_3 . '<br />';\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t*/\n }\n\t\telse\n\t\t{\n\t\t\tif (empty($_GET))\n\t\t\t{\n\t\t\t\t$this->url_controller = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->url_controller = '404';\n\t\t\t}\n\t\t}\n\t\t\n }", "private function spiltUrl()\n {\n // the .htaccess file.\n // TODO: create .htaccess file and add rule.\n if (isset($_GET['url'])) {\n // echo $_GET['url'];\n \n // Trim the last '/' from the url\n // so the http://example.com/sample/ will be http://example.com/sample\n $url = rtrim($_GET['url'], '/');\n \n $url = filter_var($url, FILTER_SANITIZE_URL);\n \n $url = explode('/', $url);\n \n // Put URL parts into the appropiate properties.\n $this->url_controller = (isset($url[0])) ? $url[0] : null;\n $this->url_action = (isset($url[1])) ? $url[1] : null;\n $this->url_parameter_1 = (isset($url[2])) ? $url[2] : null;\n $this->url_parameter_2 = (isset($url[3])) ? $url[3] : null;\n $this->url_parameter_3 = (isset($url[4])) ? $url[4] : null;\n }\n }", "function getContentUrl($url){\n return $url[1];\n\t}", "abstract public function getUrl();", "public function fetch($url);", "function _tsuiseki_tracking_extract_data_from_url($ref) {\n $ref = (string)($ref);\n $opts = array();\n if (!empty($ref)) {\n $ref = urldecode($ref);\n $parts = preg_split('/[&|?]/', $ref);\n if (!empty($parts)) {\n $p = array();\n foreach ($parts as $part) {\n if (preg_match('/\\w+?=.*\\/i=1/', $part)) {\n $p = preg_split('/=/', $part);\n $opts[$p[0]] = $p[1] .'='. $p[2];\n }\n else if (preg_match('/\\w+?=.*/', $part)) {\n $p = preg_split('/=/', $part);\n $opts[$p[0]] = $p[1];\n }\n } // foreach\n }\n }\n return $opts;\n}", "function get_oembed_response_data_for_url($url, $args)\n {\n }", "public function url()\n {\n return $this->data['url'];\n }", "function extract()\n {\n }", "function getUrl();", "private function parseUrl()\n {\n if (strpos($this->getDataByScrapeUrl(), $this->element)) {\n preg_match($this->pattern, $this->getDataByScrapeUrl(), $matches);\n } else {\n exit(\"[WARNING] : Neither css class name : .\");\n }\n return $matches[1];\n }", "abstract public function getCallUrl();", "private function get_data($url) { \n \n\t$ch = curl_init();\n $timeout = 5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n \n //curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);\n //curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);\n //curl_setopt($ch,CURLOPT_MAXREDIRS,50);\n \n $data = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $data;\n }", "public function content_from_url() {\n \n // Verify if session exists and if the user is admin\n $this->if_session_exists($this->user_role,0);\n \n if ( $this->input->post() ) {\n \n // Add form validation\n $this->form_validation->set_rules('url', 'Url', 'trim|required');\n \n // Get the url\n $url = $this->input->post('url');\n \n if ( $this->form_validation->run() != false ) {\n\n echo json_encode( get_site($url) );\n \n }\n \n }\n \n }", "private function extractRouteParams()\n {\n // Extract params\n $params = array_filter(explode('/', $_GET['url']));\n\n // First parameter is the controller\n $this->_controller = $params[0];\n\n // Second parameter is the action method\n\t\tif (isset($params[1]) && !empty($params[1])) {\n\t\t\t$this->_action = $params[1];\n\t\t}\n\n // Set additional parameters\n\t\tif (isset($params[2]) && !empty($params[2])) {\n\t\t\t$this->_urlParams = $params[2];\n\t\t}\n }", "public function splitURL(){\n global $url;\n\n $url = explode('/', $url);\n $this->controller = (!empty($url[0]) ? $url[0] : null);\n $this->action = (!empty($url[1]) ? $url[1] : null);\n $this->parameter1 = (isset($url[2]) ? $url[2] : null);\n $this->parameter2 = (isset($url[3]) ? $url[3] : null);\n $this->parameter3 = (isset($url[4]) ? $url[4] : null);\n }", "public function extract();", "public function extract();", "private static function generateUrlPrams(){\n\t\t$url = [] ;\n\t\tif ( isset($_GET['urlFromHtaccess']) ){\n\t\t\t$url = explode('/' , trim($_GET['urlFromHtaccess']) );\n\t\t}\n\t\tself::$url = $url ;\n\t}", "protected function extract() {\n if (preg_match(\n '#^/xml/((([a-zA-Z]+)\\.([a-zA-Z_]+))?(\\.?psessionid=([0-9A-Za-z]+))?/)?([a-zA-Z0-9/]+)$#',\n $this->getPath(),\n $parts\n )) {\n !empty($parts[3]) && $this->setProduct($parts[3]);\n !empty($parts[4]) && $this->setLanguage($parts[4]);\n !empty($parts[6]) && $this->setSessionId($parts[6]);\n !empty($parts[7]) && $this->setStateName($parts[7]);\n }\n\n $this->getParam('__page') && $this->setPage($this->getParam('__page'));\n }", "public function parseURL()\n {\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'], '/'); //menghapus tanda / di akhir url\n $url = filter_var($url, FILTER_SANITIZE_URL);//memfilter url dari karakter aneh (hack)\n $url = explode('/', $url); //memecah url yang diinput dengan delimiter / dan menjadikannya array\n return $url;\n }\n }", "public function parseUrl()\n\t{\n\t\tif ($this->uri !== NULL) {\n\t\t\t$uriCleaned = rtrim($this->uri, '/');\n\t\t\t$pieces = explode('/', $uriCleaned);\n\n\t\t\t// Determine controller\n\t\t\tif (isset($pieces[0])) {\n\t\t\t\t$this->controller = ucfirst(strtolower($pieces[0])) . 'Controller';\n\t\t\t\tunset($pieces[0]);\n\t\t\t}\n\n\t\t\t// Determine method\n\t\t\tif (isset($pieces[1])) {\n\t\t\t\t$this->method = strtolower($pieces[1]);\n\t\t\t\tunset($pieces[1]);\n\t\t\t}\n\n\t\t\t// Determine parameters\n\t\t\t$this->params = array_values($pieces);\n\t\t}\n\n\t\t$controllerPath = __DIR__ . '/../controllers/' . $this->controller . '.php';\n\t\tif (file_exists($controllerPath)) {\n\t\t\trequire $controllerPath;\n\t\t\t$this->controller = new $this->controller();\n\t\t}\n\t\telse {\n\t\t\thandleError();\n\t\t}\n\n\t\tif (! is_callable([$this->controller, $this->method])) {\n\t\t\thandleError();\n\t\t}\n\t\t\n\t\t// run app\n\t\tcall_user_func_array([$this->controller, $this->method], $this->params);\n\t}", "public function url(){\r\n\t\treturn $this->_url;\r\n\t}", "private function splitUrl()\n {\n if (isset($_GET['url'])) {\n // split URL\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n unset($url[0], $url[1]);\n\n\n $this->url_params = array_values($url);\n // ::DEBUGGING\n // echo 'Controller: ' . $this->url_controller . '<br>';\n // echo 'Action: ' . $this->url_action . '<br>';\n // echo 'Parameters: ' . print_r($this->url_params, true) . '<br>';\n // echo 'Parameters POST: ' . print_r($_POST, true) . '<br>';\n }\n }", "public static function getThisUrl() {}", "private function parse_image_info($url)\n {\n $final = array();\n $final['source_url'] = $url;\n // <div class=\"field field-name-field-taxonomic-name field-type-taxonomy-term-reference field-label-above\">\n // <div class=\"field field-name-field-description field-type-text-long field-label-none\">\n // <div class=\"field field-name-field-imaging-technique field-type-taxonomy-term-reference field-label-above\">\n // <div class=\"field field-name-field-cc-licence field-type-creative-commons field-label-above\">\n // <div class=\"field field-name-field-creator field-type-text field-label-above\">\n if($html = Functions::lookup_with_cache($url, $this->download_options)) {\n // if(preg_match(\"/<div class=\\\"field field-name-field-taxonomic-name field-type-taxonomy-term-reference field-label-above\\\">(.*?)<div class=\\\"field field-name-field/ims\", $html, $arr)) {\n if(preg_match(\"/<div class=\\\"field field-name-field-taxonomic-name field-type-taxonomy-term-reference field-label-above\\\">(.*?)Download the original/ims\", $html, $arr)) {\n $str = $arr[1];\n if(preg_match(\"/<div class=\\\"field-item even\\\">(.*?)<\\/div>/ims\", $str, $arr)) {\n $str = trim($arr[1]);\n $final['sciname'] = $str;\n }\n }\n if(preg_match(\"/<div class=\\\"field field-name-field-description field-type-text-long field-label-none\\\">(.*?)Download the original/ims\", $html, $arr)) {\n $str = $arr[1];\n if(preg_match(\"/<div class=\\\"field-item even\\\">(.*?)<\\/div>/ims\", $str, $arr)) {\n $str = trim($arr[1]);\n $final['description'] = $str;\n }\n }\n if(preg_match(\"/<div class=\\\"field field-name-field-imaging-technique field-type-taxonomy-term-reference field-label-above\\\">(.*?)Download the original/ims\", $html, $arr)) {\n $str = $arr[1];\n if(preg_match(\"/<div class=\\\"field-item even\\\">(.*?)<\\/div>/ims\", $str, $arr)) {\n $str = trim($arr[1]);\n $final['imaging technique'] = $str;\n }\n }\n if(preg_match(\"/<div class=\\\"field field-name-field-cc-licence field-type-creative-commons field-label-above\\\">(.*?)Download the original/ims\", $html, $arr)) {\n $str = $arr[1];\n if(preg_match(\"/<div class=\\\"field-item even\\\">(.*?)<\\/div>/ims\", $str, $arr)) {\n $str = trim($arr[1]);\n if(preg_match(\"/href=\\\"(.*?)\\\"/ims\", $str, $arr)) {\n $license = $arr[1];\n if(substr($license,0,2) == \"//\") $final['license'] = \"http:\".$license;\n else $final['license'] = $license;\n }\n else $final['license'] = $str;\n }\n if($final['license'] == \"All rights reserved.\") $final['license'] = \"all rights reserved\";\n // $final['license'] = \"http://creativecommons.org/licenses/by-nc-sa/3.0/\"; //debug force\n }\n if(preg_match(\"/<div class=\\\"field field-name-field-creator field-type-text field-label-above\\\">(.*?)Download the original/ims\", $html, $arr)) {\n $str = $arr[1];\n if(preg_match(\"/<div class=\\\"field-item even\\\">(.*?)<\\/div>/ims\", $str, $arr)) {\n $str = trim($arr[1]);\n $final['creator'] = $str;\n }\n }\n //<h2 class=\"element-invisible\"><a href=\"http://cephbase.eol.org/sites/cephbase.eol.org/files/cb0001.jpg\">cb0001.jpg</a></h2>\n if(preg_match(\"/<h2 class=\\\"element-invisible\\\">(.*?)<\\/h2>/ims\", $html, $arr)) {\n if(preg_match(\"/href=\\\"(.*?)\\\"/ims\", $arr[1], $arr2)) $final['media_url'] = $arr2[1];\n }\n }\n // print_r($final); exit;\n return $final;\n }", "public function url();", "public function url();", "public function url();", "function getDATA($url) {\r\n // inisialisasi CURL\r\n $data = curl_init();\r\n $ip = $url;\r\n // $ip = $getRow['ipAddr'] . '' . $url;\r\n // setting CURL\r\n curl_setopt($data, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($data, CURLOPT_URL, $ip);\r\n\r\n // menjalankan CURL untuk membaca isi file\r\n $hasil = curl_exec($data);\r\n curl_close($data);\r\n return $hasil;\r\n}", "private function parseURLRequest() {\n\t\t# Redirects the user upon success and redirects to following error-messages upon errors:\n\t\t# 201 - Missing url-entry for the given ID\n\n\t\t$this->parseCustomURL();\t# Let's see if there's an custom-url we gotten our hands on\n\n\t\t$urlID = $this->baseToInt($_GET['u']);\n\t\t$this->verifyID($urlID);\n\n\t\t# assuming everything's good, moving on.\n\t\t\n\t\t$query = $this->db->prepare(\"SELECT `url` FROM urls WHERE `id` = :id\");\n\t\t$query->bindParam(\":id\", $urlID);\n\t\t$query->execute();\n\t\t\n\t\t$data = $query->fetch();\n\t\t\n\t\tif(!isset($data['url'])) {\n\t\t\t$this->debugLog(\"The database did not return any URL for ID {$_GET['u']}\");\n\t\t\theader(\"Location:{$this->siteURL}error/201\");\n\t\t\tdie;\n\t\t}\n\t\telse {\n\t\t\t$this->debugLog(\"Redirecting to {$data['url']}\");\n\t\t\t$this->logUrlClick($urlID);\n\t\t\theader(\"HTTP/1.1 301 Moved Permanently\");\n\t\t\theader(\"Location: {$data['url']}\"); # Should we use URL-encode here?\n\t\t\tdie;\n\t\t}\n\t}", "public static function parse_URL($url)\n {\n }", "public function fetchResult($url);", "function geturl($url){\n if($url==\"\"){\n $url = \"http://www.36kr.com/\";\n }\n \n $ch = curl_init();\n\n // set the url to fetch \n curl_setopt($ch, CURLOPT_URL, $url);\n\n //return the transfer (the result of curl_exec()) as a string instead of outputing directly\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n //return the HTTP Response header using the callback function readHeader\n //curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'readHeader');\n\n // execute the curl session\n $output = curl_exec($ch);\n\n // close curl resource to free up system resources \n curl_close($ch);\n\n //the callback function used to retreive the header info\n function readHeader($ch, $string) {\n $length = strlen($string);\n //only display the headers with content\n if (trim($string) != '')\n echo \"<center>Header: $string</center><br />\\n\";\n return $length;\n }\n\n //echo \"<br /><center><b><u>BELOW this line is the content fetched from www.example.com:</u></b></center><br />\";\n return $output;\n}", "public function get_url_params()\n {\n }", "abstract public function getRawRequestUrl();", "function get_data($url)\n\t\t{\n\t\t $ch = curl_init();\n\t\t $timeout = 5;\n\t\t curl_setopt($ch,CURLOPT_URL,$url);\n\t\t curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\n\t\t curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\n\t\t $data = curl_exec($ch);\n\t\t curl_close($ch);\n\t\t return $data;\n\t\t}", "private function parseGET()\n {\n if (isset($_GET['method'])) {\n $this->method = $_GET['method'];\n unset($_GET['method']);\n }\n\n if (isset($_GET['output'])) {\n $this->output = $_GET['output'];\n unset($_GET['output']);\n }\n\n $testDN = Get_User_Principle_PI();\n if (empty($testDN) == false) {\n $this->identifier = $testDN;\n }\n\n if (count($_GET) > 0) {\n $this->params = $_GET;\n }\n }", "public static function parseURL($url) {\n\t\t\t\t\n\t\t}", "function parseURL($url){\r\n //Explodeo la url para convertirla en un array\r\n $urlExploded = explode('/' ,$_GET['action']);\r\n //Creo un nuevo array y en la posición 'action' le asigno la acción recibida\r\n $arrayReturn[ConfigApp::$ACTION] = $urlExploded[0];\r\n //Si esta seteado, llama al metodo array_slice(), lo que hace este metodo es crear un arrego a partir de una posición dada, en este caso desde la posición 1\r\n $arrayReturn[ConfigApp::$PARAMS] = isset($urlExploded[1]) ? array_slice($urlExploded, 1) : null;\r\n\r\n return $arrayReturn;\r\n }", "public function run()\r\n\t\t\t {\r\n $ch = curl_init();\r\n curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt ($ch, CURLOPT_URL, $this->url);\r\n curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 20);\r\n curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11');\r\n curl_setopt($ch, CURLOPT_HEADER, true); // header will be at output\r\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD'); // HTTP request is 'HEAD'\r\n $this->headers = curl_exec ($ch);\r\n curl_close ($ch);\r\n\t\t\t }", "function readURL()\n\t{\n\t\t\t $pageURL = 'http';\n\t\t\t if (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\") $pageURL .= \"s\";\n\t\t\t $pageURL .= \"://\";\n\t\t\t if (isset($_SERVER[\"SERVER_PORT\"]) && $_SERVER[\"SERVER_PORT\"] != \"80\") {\n\t\t\t $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n\t\t\t } else {\n\t\t\t $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n\t\t\t }\n\t\t\t \n\t\treturn $pageURL;\n\t}", "abstract public function scrape();", "abstract function getdata();", "public function parseUrl()\n\t\t{\n\t\t\tif(isset($_GET['url']))\n\t\t\t{\n\t\t\t\t// explode(separator, string, limit);\n\t\t\t\treturn $url = explode('/', filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n\t\t\t}\n\t\t}", "protected function url()\n\t{\n\t\treturn Phpfox::getLib('url');\t\n\t}", "public function GetFetchURL();", "protected function getUrl()\n {\n if (!empty($this->info['url'])) {\n return $this->info['url'];\n }\n }", "private function getUrls() {\n\t\t// reassign the array because of a php bug (solved later with php 5.2.x @see: http://bugs.php.net/39449)\n\t\t$arr = $this->formData;\n\n\t\t// build bas URL for replacement variables\n\t\t$protocol\t= 'http'\n . ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ? 's' : '' )\n . '://';\n\t\t$url\t\t= $_SERVER['HTTP_HOST'] . dirname( $_SERVER['PHP_SELF'] ) . '/';\n $url = str_replace( '//', '/', $url ); // some server add 2 /\n $url = $protocol . $url . 'index.php?route=payment/directebanking/';\n\n\t\tif( $this->_param['successUrlStd'] ) {\n\t\t\t$arr['user_variable_0'] = $url . 'success'\n\t\t\t. '&transaction=-TRANSACTION-&security_criteria=-SECURITY_CRITERIA-'\n\t\t\t. '&order_id=-USER_VARIABLE_3-&pid=-PROJECT_ID-';\n\t\t}else{\n\t\t\tif( $this->_param['successUrl'] ) {\n\t\t\t\t$arr['user_variable_0'] = $this->_param['successUrl'];\n\t\t\t}\n\t\t}\n\n\t\tif( $this->_param['cancelUrlStd'] ) {\n\t\t\t$arr['user_variable_1'] = $url . 'cancel'\n\t\t\t. '&transaction=-TRANSACTION-&order_id=-USER_VARIABLE_3-&pid=-PROJECT_ID-';\n\t\t}else{\n\t\t\tif( $this->_param['cancelUrl'] ) {\n\t\t\t\t$arr['user_variable_1'] = $this->_param['cancelUrl'];\n\t\t\t}\n\t\t}\n\n\t\t// and reassign again\n\t\t$this->formData = $arr;\n\n\t\tunset( $arr );\n\t}", "private function get_url_data($url, $internal_call_count=0){\r\n //$url = str_replace('access_token=','access_token2=',$url); // for force error testing\r\n log_message('info', basename(__FILE__).' : '.'get_url_data fetching: '.$url. ' no. of try: '.($internal_call_count+1));\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_HEADER, 0);\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_TIMEOUT, 600); // originally 5 secs\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER,array('Connection: close'));\r\n $tmp = curl_exec($ch);\r\n $http_ret_code=curl_getinfo($ch, CURLINFO_HTTP_CODE).'';\r\n curl_close($ch); \r\n\r\n $tmp_data=@json_decode($tmp); \r\n\r\n if(\r\n ($http_ret_code!='200') ||\r\n ($tmp=='') ||\r\n isset($tmp_data->error)\r\n )\r\n {\r\n log_message('debug', basename(__FILE__).' : '.'get_url_data fetching error: '.$tmp.' return status code: '.$http_ret_code.' for url: '.$url);\r\n\r\n $internal_call_count++;\r\n if($internal_call_count<3)\r\n {\r\n sleep(3);\r\n return $this->get_url_data($url,$internal_call_count);\r\n } \r\n }\r\n\r\n return $tmp; \r\n }", "public function load ()\n {\n return $this->url;\n }", "private function getUrl()\n {\n //echo $_GET['url'];\n if(isset($_GET['url']))\n {\n $url=rtrim($_GET['url'],'/');\n $url=filter_var($url,FILTER_SANITIZE_URL);\n $url=explode('/',$url);\n return $url;\n }\n }" ]
[ "0.7003904", "0.69996333", "0.6832051", "0.6765076", "0.6571115", "0.6485284", "0.64607054", "0.62756735", "0.6237788", "0.6162322", "0.6142646", "0.612885", "0.61214715", "0.60969996", "0.6054293", "0.60429496", "0.6039135", "0.6039135", "0.60362756", "0.603391", "0.6027697", "0.60251516", "0.6011858", "0.5986034", "0.5986034", "0.59823364", "0.5969123", "0.5965565", "0.5965257", "0.5941989", "0.5941202", "0.5935198", "0.5933437", "0.5922173", "0.5917572", "0.59149396", "0.59125996", "0.58930326", "0.58892274", "0.5872058", "0.58675164", "0.5862226", "0.58518136", "0.5850732", "0.5842938", "0.58304703", "0.5830265", "0.58279085", "0.5815168", "0.5814277", "0.57991624", "0.57855093", "0.5784808", "0.57808954", "0.57723194", "0.57686824", "0.5765405", "0.5764395", "0.5763154", "0.5757274", "0.5755841", "0.5749196", "0.5746941", "0.57439715", "0.5739836", "0.57222384", "0.57222384", "0.5721408", "0.5719915", "0.5717902", "0.5717366", "0.57122535", "0.5709907", "0.57068163", "0.56970847", "0.56884414", "0.56884414", "0.56884414", "0.5681246", "0.5654124", "0.5641987", "0.5638822", "0.5637512", "0.5637194", "0.56134224", "0.5612711", "0.56092495", "0.56014615", "0.5592051", "0.5588872", "0.55768305", "0.5576801", "0.55762094", "0.55721384", "0.556082", "0.5555814", "0.55532724", "0.55441695", "0.55328995", "0.5531952", "0.5525572" ]
0.0
-1
/ PreRemove Event Listener
public function preRemove(LifecycleEventArgs $args) { $entity = $args->getEntity(); $em = $args->getEntityManager(); if ($entity instanceof User) { $eventRepository = $em->getRepository(Event::class); $events = $eventRepository->findByUser($entity->getId()); foreach ($events as $event) { $em->remove($event); } $em->flush(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onRemove();", "public function preRemoveCallback()\n {\n $this->performPreRemoveCallback();\n }", "public function preRemoveCallback()\n {\n $this->performPreRemoveCallback();\n }", "protected function beforeRemoving()\n {\n }", "public function afterRemove()\n\t{}", "public function remove($listener);", "public function remove($event, $listener);", "public function postEventDel();", "public function postRemoveCallback()\n {\n $this->performPostRemoveCallback();\n }", "public function postRemoveCallback()\n {\n $this->performPostRemoveCallback();\n }", "protected function afterRemoving()\n {\n }", "function UnInstallEvents()\n\t{\n\t}", "public function remove_hooks()\n {\n }", "public function remove_hooks()\n {\n }", "public function preRemove(LifecycleEventArgs $args): void {\n\t\tif(!$this->enableIndexing) {\n\t\t\treturn;\n\t\t}\n\t\t$this->removeEntity($args->getObject(), $args->getObjectManager());\n\t}", "public function _event_before_delete() {\n\t\tstatic::$_delete['roles'] = $this->roles;\n\t}", "public function removeObserver() {\n //$this->__observers = array();\n foreach($this->__observers as $obj) {\n unset($obj);\n }\n }", "public function preRemove(EventArgs $args)\n {\n $om = $this->getObjectManager($args);\n $object = $this->getObject($args);\n $meta = $om->getClassMetadata(get_class($object));\n \n if ($config = $this->getConfiguration($om, $meta->name)) {\n $this->getStrategy($om, $meta->name)->processScheduledDelete($om, $object);\n }\n }", "protected function _unsubscribeFromEngineEvents()\n {\n $controller = $this->getController();\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::ENDOFFAX,\n array( 'callback' => array( $this, 'onEndOfFax' ) )\n );\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::FAXPAGE,\n array( 'callback' => array( $this, 'onFaxPage' ) )\n );\n }", "public function testRemoveListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n $callback = function () use (&$listenerCalled) {\n $listenerCalled = true;\n };\n\n // Act\n $communicator->addListener($callback);\n $communicator->removeListener($callback);\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertFalse($listenerCalled);\n }", "public function removeListeners($event = NULL)\n\t{\n\t\tif (!empty($event) && array_key_exists($event, static::$events)) {\n\t\t\tstatic::$events[$event] = [];\n\t\t} else {\n\t\t\tforeach (static::$events as $evt => $events)\n\t\t\t\tstatic::$events[$evt] = [];\n\t\t}\n\t}", "public function remove() {\n\t\t$this->setRemoved(TRUE);\n\t}", "public function clearListeners(string $event): void;", "public function removeEvent($event);", "public function remove() {\n\t\tremove_action($this->controller->getHookName(),array($this,'handle'),$this->priority);\n }", "public function canBeRemoved() {}", "public function getPreDestroyCallbacks();", "function eventUnRegister($eventName, $id);", "public function remove() {}", "public function remove() {}", "public static function deregister_event() {\n\t\twp_clear_scheduled_hook( 'learn_press_schedule_cleanup_temp_users' );\n\t}", "public function onBeforeDelete();", "public function preRemove(LifecycleEventArgs $args)\n {\n $entity = $args->getEntity();\n $class = get_class($entity);\n if (in_array($class, $this->ignoredClasses)) {\n return;\n }\n $this->container->get('session')->set('entity_removed',\n array(\n 'entity' => $entity,\n 'id' => $entity->getId(),\n ));\n }", "function deactivation_hook() {\n\n\t}", "public function hookRemove(): void\n {\n $this->say(\"Executing the Plugin's remove hook...\");\n $this->_exec(\"php ./src/hook_remove.php\");\n }", "public function preRemove($entity);", "public function preDelete($event)\n {\n $chainItem = new ChainItem();\n $chainItem->updateVarnish($this->id);\n $chainItem->free(true);\n }", "public function unsetEventDispatcher()\n {\n $this->events = null;\n }", "static function remove() {\n }", "function on_deactivation ()\n{\n}", "function on_deactivation ()\n{\n}", "public function onBeforeDelete() {\r\n\t\tparent::onBeforeDelete();\r\n\t}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function postRemove(LifecycleEventArgs $eventArgs)\n {\n // we set the postRemove heritage roles management\n $this->_Heritage_roles($eventArgs);\n \n // we set the postRemove languages management\n $this->_locales_language_json_file($eventArgs);\n \n // we set the postRemove Cache Url Generator management\n $this->_updateCacheUrlGenerator($eventArgs); \n }", "public function truncateEventClosures(): void\n {\n $this->listeners = [];\n }", "public function releaseEvents();", "public function releaseEvents();", "function delete_post_type_event(){\n\tunregister_post_type( 'event' );\n}", "function preDelete()\n {\n }", "public function testEventCallBackDelete()\n {\n }", "public function clearListeners()\n {\n $this->listeners = array();\n }", "public function remove() {\n }", "function removeListener(EventListener $listener): bool;", "function ft_hook_destroy() {}", "function detach($observer, $eventIDArray)\n {\n foreach ($eventIDArray as $eventID) {\n $nameHash = md5(get_class($observer) . $eventID);\n base::unsetStaticObserver($nameHash);\n }\n }", "public function removeBeforeSaveCallback($name) {}", "public function after_delete() {}", "public function remove()\n {\n }", "protected function setEventName() {\n return NULL;\n }", "public function preRemove(LifecycleEventArgs $args)\n {\n $entity = $args->getEntity();\n if ($this->entityConnector->isWorkflowAware($entity)) {\n $workflowItem = $this->entityConnector->getWorkflowItem($entity);\n if ($workflowItem) {\n $args->getEntityManager()->remove($workflowItem);\n }\n }\n }", "public function preRemove(LifecycleEventArgs $args)\n {\n $this->validator->validateWithException($args->getEntity());\n }", "public function preRemove(LifecycleEventArgs $args)\n {\n $follow = $args->getDocument();\n $dm = $this->container->get('doctrine_mongodb.odm.document_manager');\n $activity_manager = $this->container->get('pw_activity.activity_manager');\n $notification_manager = $this->container->get('pw_activity.notification_manager');\n \n if ($follow instanceOf Follow) {\n $activity_manager\n ->getRepository()\n ->createQueryBuilder()\n ->remove()\n //->field('target')->references($follow)\n ->field('target.$id')->equals(new \\MongoId($follow->getId()))\n ->field('target.$ref')->equals('follows')\n ->getQuery()\n ->execute();\n \n\n $notification_manager\n ->getRepository()\n ->createQueryBuilder()\n ->remove()\n //->field('target')->references($follow)\n ->field('target.$id')->equals(new \\MongoId($follow->getId()))\n ->field('target.$ref')->equals('follows')\n ->getQuery()\n ->execute(); \n \n $target = $follow->getTarget();\n if ($target instanceof User) {\n // also remove follows for collections of target User\n $follower = $follow->getFollower();\n $this->getFollowManager()->getRepository()\n ->createQueryBuilder()\n ->remove()\n ->field('follower')->references($follower)\n ->field('user')->references($target)\n ->field('target.$ref')->equals('boards')\n ->getQuery()\n ->execute();\n }\n } \n }", "public function detach(\\SplObserver $observer) {}", "function OnBeforeDeleteItem(){\n }", "public function onAfterDelete();", "private function uninstallEvents()\n {\n $this->load->model('setting/event');\n $this->model_setting_event->deleteEvent('payment_mundipagg');\n }", "public function removeEventSubscriber(IEventSubscriber $subscriber);", "function after_delete() {}", "public function preDelete() { }", "public function detach(): void\n\t{\n\t\t$this->events->detach($this->type, $this->hook);\n\t}", "public function removeListener($eventName, $listener);", "public function removeListener($eventName, $listener);", "public function afterEraseEvent($self, $pkeys){\n }", "protected function _preDelete() {}", "protected function removeInstance() {}", "public function remove()\n {\n\n }", "protected function beforeDestroy() {\n\n }", "public function postEventadd();", "abstract public function remove();", "abstract public function remove();", "abstract public function remove();", "public function unsubscribe(): void;", "function before_delete() {}", "public function removeAllListeners($eventName);", "public function delete($event): void;", "public function __destruct()\n\t{\n\t\tif (static::$instance != NULL)\n\t\t\tstatic::$instance = NULL;\n\t\tforeach (static::$events as $event => $events)\n\t\t\tstatic::$events[$event] = [];\n\t}", "function remove_filter($hook_name, $callback, $priority = 10)\n {\n }", "function OnBeforeAdd(){\n }", "public function removeListener($event, tx_auxo_observer $listener) {\r\n\t\tif (! isset($this->eventListener[$event][spl_object_hash($listener)])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tunset($this->eventListener[$event][spl_object_hash($listener)]);\r\n\t\treturn true;\r\n\t}", "private function init_nopriv_event_listeners() {\n\t\t// add_action('wp_ajax_nopriv_example_action', [$this, 'example_function']);\n\t}", "protected function _unsubscribeFromEngineEvents()\n {\n $events = array(\n Streamwide_Engine_Events_Event::SDP,\n Streamwide_Engine_Events_Event::CHILD,\n Streamwide_Engine_Events_Event::OKMOVED,\n Streamwide_Engine_Events_Event::MOVED,\n Streamwide_Engine_Events_Event::FAILMOVED\n );\n \n $controller = $this->getController();\n foreach ( $events as $event ) {\n $controller->removeEventListener( $event, array( 'callback' => array( $this, 'onSignalReceived' ) ) );\n }\n }", "public function preRemove(MediaInterface $media);", "public function testPostRemove()\n {\n $obj = new DummyEntity();\n $class = new \\ReflectionClass($obj);\n\n $args = $this->getMockBuilder('Doctrine\\Common\\EventArgs')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->adapter\n ->expects($this->once())\n ->method('getObjectFromArgs')\n ->will($this->returnValue($obj));\n\n $this->adapter\n ->expects($this->once())\n ->method('getReflectionClass')\n ->will($this->returnValue($class));\n\n $uploadable = $this->getMockBuilder('Vich\\UploaderBundle\\Mapping\\Annotation\\Uploadable')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->driver\n ->expects($this->once())\n ->method('readUploadable')\n ->with($class)\n ->will($this->returnValue($uploadable));\n\n $this->storage\n ->expects($this->once())\n ->method('remove')\n ->with($obj);\n\n $listener = new UploaderListener($this->adapter, $this->driver, $this->storage, $this->injector);\n $listener->postRemove($args);\n }", "function redart_undo_recurrence_oembed_logic() {\r\n\r\n\tif ( ! class_exists( 'Tribe__Events__Pro__Main' ) ) return;\r\n \r\n\t$pro_object = Tribe__Events__Pro__Main::instance();\r\n\t$pro_callback = array( $pro_object, 'oembed_request_post_id_for_recurring_events' );\r\n \r\n\tremove_filter( 'oembed_request_post_id', $pro_callback );\r\n}", "protected function _predelete() {\n }", "function remove_action($hook_name, $callback, $priority = 10)\n {\n }", "public function off($event);" ]
[ "0.7669814", "0.7584526", "0.7584526", "0.6825954", "0.6786659", "0.670652", "0.66982734", "0.6584274", "0.6576111", "0.6576111", "0.6471108", "0.63169235", "0.6183574", "0.6183574", "0.6154882", "0.6128454", "0.6086364", "0.60740435", "0.6070118", "0.60690206", "0.60408634", "0.60180736", "0.60069174", "0.6006099", "0.59559345", "0.5946768", "0.59445626", "0.5938261", "0.5932559", "0.59316397", "0.59101486", "0.58847904", "0.5884442", "0.58274823", "0.58214545", "0.58117974", "0.5800182", "0.57995635", "0.57895744", "0.5787349", "0.5787349", "0.5784747", "0.57828677", "0.57828677", "0.57828677", "0.57828677", "0.57725567", "0.57586014", "0.5736816", "0.5736816", "0.5726007", "0.5708103", "0.57062495", "0.5665753", "0.5646179", "0.5636797", "0.56277364", "0.5624892", "0.5610073", "0.5603705", "0.5595705", "0.5584803", "0.557751", "0.5575786", "0.5572106", "0.55705565", "0.5565899", "0.5548054", "0.5537698", "0.5532679", "0.5523494", "0.55219525", "0.55198956", "0.5517792", "0.5517792", "0.5488201", "0.54810554", "0.5476605", "0.5471253", "0.54636854", "0.5456173", "0.54412353", "0.54412353", "0.54412353", "0.54236704", "0.5412342", "0.5404109", "0.5402895", "0.5393615", "0.53886306", "0.53782123", "0.5373795", "0.5370673", "0.5359775", "0.5353952", "0.5341779", "0.5340416", "0.53312576", "0.53294885", "0.53245944" ]
0.576527
47
Create a new Object
function sendEmail($email, $subject, $comment, $admin_email, $cc) { $mj = new Mailjet(); $params = array( "method" => "POST", "from" => "{$admin_email}", "to" => "{$email}", "cc" => "{$cc}", "subject" => "{$subject}", "text" => "{$comment}" ); $result = $mj->sendEmail($params); if ($mj->_response_code == 200) { //echo "success - email sent"; print '<script type="text/javascript">'; print 'alert("email successfully sent!")'; print '</script>'; } elseif ($mj->_response_code == 400) { //echo "error - " . $mj->_response_code; print '<script type="text/javascript">'; print 'alert("Bad Request! One or more arguments are missing or maybe mispelling.")'; print '</script>'; } elseif ($mj->_response_code == 401) { //echo "error - " . $mj->_response_code; print '<script type="text/javascript">'; print 'alert("Unauthorized! You have specified an incorrect ApiKey or username/password couple.")'; print '</script>'; } elseif ($mj->_response_code == 404) { //echo "error - " . $mj->_response_code; print '<script type="text/javascript">'; print 'alert("Not Found! The method your are trying to reach don\'t exists.")'; print '</script>'; } elseif ($mj->_response_code == 405) { //echo "error - " . $mj->_response_code; print '<script type="text/javascript">'; print 'alert("Method Not Allowed! You made a POST request instead of GET, or the reverse.")'; print '</script>'; } else { print '<script type="text/javascript">'; print 'alert(" Internal Server Error! Status returned when an unknow error occurs")'; print '</script>'; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newInstance(): object;", "abstract protected function createObject();", "public function create( &$object );", "function create()\n\t{\n\t\t$names = $this->_fields;\n\t\t$object = new StdClass;\n\t\tforeach ($names as $name)\n\t\t\t$object->$name = \"\";\n\t\treturn $object;\n\t}", "public function newCObj() {}", "public function newInstance();", "public function newInstance();", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function new()\n\t{\n\t\t//\n\t}", "public function new()\n\t{\n\t\t//\n\t}", "public function createNew();", "public static function createNew();", "function createObject() {\n\t\t// must be implemented by sub-classes\n\t\tassert(false);\n\t}", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create(){}", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "public function create(){\r\n\treturn new $this->class();\r\n }", "public function regularNew() {}", "public abstract function create($object);", "public function new()\n {\n //\n }", "public function new()\n {\n //\n }", "static function create(): self;", "abstract function create();", "public function create() {\n\t \n }", "public function create()\n\t {\n\t //\n\t }", "public function construct()\n {\n return $this->object;\n }", "public function create() {}", "abstract public function prepare_new_object(array $args);", "public function create($obj)\n {\n }", "abstract protected function create ();", "public function make();", "function _newobj()\n\t\t{\n\t\t\t$this->n++;\n\t\t\t$this->offsets[$this->n]=strlen($this->buffer);\n\t\t\t$this->_out($this->n.' 0 obj');\n\t\t}", "static function newobj($type /* ... */){\n if(is_null($type)) return;\n\n $ar = func_get_args();\n $type = array_shift($ar); // remove type/object\n \n try{\n // get the asked class\n if(is_string($type)) $cls = defnz(self::$decode_table,$type,'opc_item_' . $type);\n else if (is_object($type)) $cls = get_class($type);\n else throw new Exception('invalid type: ' . strval($type));\n \n // check this class 8exists, implements opi_item\n if(!class_exists($cls)) \n\tthrow new Exception('unknown class: ' . $cls);\n else if(!in_array('opi_item',class_implements($cls)))\n\tthrow new Exception('not able to handle: ' . $cls);\n \n } catch (Exception $ex) {\n trigger_error('error creating a opc_item: ' . $ex->getMessage(),E_USER_WARNING);\n return NULL;\n }\n \n // crate and call init with the other arguments\n $res = new $cls();\n call_user_func_array(array(&$res,'init'),$ar);\n return $res;\n }", "public function create()\n {}", "public function create()\r\n\t{\r\n\t\t//\r\n\t}", "protected function newObject($data = [])\n {\n return new $this->model($data);\n }", "public function Create()\n\t\t{\n\t\t\tthrow new Exception('Create object not supported');\n\t\t}", "public function createValidObject() : object {\n\t\treturn (object) [\"tweetContent\" => bin2hex(random_bytes(12))];\n\t}", "public function create()\n\t{\n\n\n\t\t//\n\t}", "abstract function &create();", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create()\n\t{\n\t\t\n\t\t//\n\t}", "public function create($data = null) {\n\t\t$class = $this->type->getModelClassname();\n\t\t$object = new $class($data);\n\t\t$object->setModelStorage($this->type->getStorage());\n\t\treturn $object;\n\t}", "function createProduct($name,$price,$qty,$id):stdClass\n{\n$product=new stdClass();\n$product->name=$name;\n$product->price=$price;\n$product->quantity= $qty;\n$product->id=$id;\n\nreturn $product;\n}", "public function make() {}", "public function createNew() {\n\t}", "static function newobj($type /* ... */){\n $ar = func_get_args();\n $type = array_shift($ar); // remove type/object\n try{\n // get the asked class\n if(is_null($type)){\n\treturn NULL;\n } else if(is_string($type)){\n\t$cls = defnz(self::$decode_table,$type,'opc_hto_' . $type);\n } else if($type instanceof opc_item){\n\t$cls = 'opc_htoi' . $type->get_ownclass();\n } else if(is_object($type) and array_key_exists(get_class($type),self::$decode_table)){\n\t$cls = self::$decode_table[get_class($type)];\n } else throw new Exception('invalid type: ' . var_export($type,TRUE));\n // check this class\n if(!class_exists($cls))\n\tthrow new Exception('unknown class: ' . $cls);\n if(!in_array('opi_viewer',class_implements($cls))) \n\tthrow new Excepteion($cls . ' does not implement opi_viewer');\n // crate and init the item\n $res = new $cls();\n call_user_func_array(array(&$res,'init'),$ar);\n if(is_object($type)) $res->load($type);\n return $res;\n\n } catch (Exception $ex) {\n trigger_error('error creating a hto: ' . $ex->getMessage(),E_USER_WARNING);\n return NULL;\n }\n }", "public function create()\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function create() {\n\t\t\t//\n\t\t}", "public function &create()\n {\n $obj = null;\n\n if (class_exists($this->_class_name)) {\n // Assigning the return value of new by reference\n $obj = new $this->_class_name();\n }\n\n return $obj;\n }", "public abstract function make();", "public static function create($data) {\n\t\t$className = get_called_class();\n\t\t$object = new $className($data);\n\t\t$object->save();\n\t\treturn $object;\n\t}", "public function create() {\n\n\t}", "function _construct(){ }", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}" ]
[ "0.7833859", "0.77775437", "0.7546599", "0.7399197", "0.7322013", "0.7316594", "0.7316594", "0.72528094", "0.72528094", "0.72528094", "0.7248915", "0.7248915", "0.7206463", "0.7192749", "0.71806496", "0.71626425", "0.71626425", "0.71626425", "0.71626425", "0.71626425", "0.71626425", "0.71626425", "0.71626425", "0.71626425", "0.71626425", "0.71626425", "0.71477056", "0.7133765", "0.7131057", "0.71304303", "0.71190304", "0.70237106", "0.70237106", "0.6948939", "0.68961734", "0.6895729", "0.6888352", "0.68633014", "0.6816484", "0.68162346", "0.68028474", "0.67930907", "0.6778103", "0.6745421", "0.673017", "0.6712152", "0.6686264", "0.66848904", "0.66712654", "0.6669158", "0.66612095", "0.665789", "0.6610921", "0.6610921", "0.6591997", "0.6589991", "0.6589124", "0.65855604", "0.6583633", "0.6577169", "0.6568431", "0.65388805", "0.6536519", "0.65354156", "0.6533544", "0.65278494", "0.6517327", "0.6514053", "0.6514053", "0.6514053", "0.6514053", "0.6514053", "0.6514053", "0.6514053", "0.6514053", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224", "0.65140224" ]
0.0
-1
This method will retrieve all Departments of corporate
public function getDepartmentsList($accountId) { $query = $this->createQueryBuilder('p') ->select('p,ca.name as accountName') ->leftJoin('CorporateBundle:CorpoAccount', 'ca', 'WITH', "ca.id = p.accountId"); if ($accountId) { $query->where("p.accountId = :accountId") ->setParameter(':accountId', $accountId); } $quer = $query->getQuery(); $result = $quer->getScalarResult(); if (!empty($result) && isset($result[0])) { return $result; } else { return array(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllDepartments() {\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllDepartments();\r\n }", "public function index()\n {\n return Departments::all();\n }", "function GetDepartments()\n\t{\n\t\t$result = $this->sendRequest(\"GetDepartments\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function getDepartments() {\n //but if none, get from db\n if(null==$this->departments){\n $mapper=new Application_Model_DirectoryDepartmentMapper();\n $departments=$mapper->fetchAll();\n $options=array();\n foreach($departments as $department){\n $options[]=$department->getName();\n }\n $this->departments=$options;\n }\n return $this->departments;\n }", "public function getDepartmentList() {\n return $this->_get(2);\n }", "public static function getDepartmentsList(){\n $cont = new RestController();\n\n $result = $cont->getRequest('ProductDepartments');\n\n $departments = [];\n\n if($result instanceof View){\n return $departments;\n }\n\n foreach($result->value as $dep){\n $departments[$dep->Id]=$dep->Name;\n }\n\n return $departments;\n\n }", "public function departments()\r\n {\r\n return new QueryForDepartments();\r\n }", "function getdepartments() {\n\t\t// import department db\n\t\tApp::import('Model','Department');\n\t\t$this->Department = & new Department();\n\t\t# fetch list of active departments \n\t\t$departments_list = $this->Department->find('list',array('conditions'=>array('Department.status'=>'1'),'fields'=>array('id','name'),'limit'=>10,'order'=>array('Department.id')));\n\t\treturn $departments_list;\n\t}", "public function getDepartment() {\n return response()->json([\n 'success' => true,\n 'statusCode' => 200,\n 'message' => 'Successfully retrieved clearances departments',\n 'data' => Department::all()]);\n }", "function get_department(){\n $this->_db2->where(\"DeleteFlag\",\"A\");\n return $this->_db2->get($this->_tblorg);\n }", "public function ListDepartments(){\n\t\t$query = \"SELECT code, label, division, sortOrder FROM [DEPARTMENTS TABLE] ORDER BY sortOrder ASC\";\n\t\treturn array(\"results\" => $this->SelectQueryHelper($query));\n\t}", "public function getAllDepartmentInfo(){\n $LOG = Logger::getLogger(__CLASS__ . '.' . __FUNCTION__);\n\n $dao = new LabInspectionSummaryReportDAO();\n $min_year = $this->getMinimumReportYear();\n $departments = $dao->getDepartmentDetails(null, $min_year);\n\n return $departments;\n }", "public function getDeptItems()\n {\n return $this->hasMany(DeptItem::className(), ['sales_disc_gl_acc_id' => 'account_id']);\n }", "private function getDepartments(): array\n {\n try {\n /** @var Departments[] $departments */\n $departments = $this->getDoctrine()\n ->getRepository(Departments::class)\n ->findAll();\n }\n catch(\\Exception $ex) {\n return [];\n }\n\n return $departments;\n }", "public function getDepartamentos($provincia_id = 19) {\n\t \t$departamentos = $this->Departamento->find(\"all\", \n\t \t array(\"conditions\" => array( \"provincia\" => $provincia_id),\n\t \t \"sort\" => \"Departamento.nombre ASC\",\n\t \t \"recursive\" => -1\n\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t );\n\t $new_departamentos = array();\n\t foreach ($departamentos as $departamento) {\n\t $new_departamentos[$departamento[\"Departamento\"][\"id\"]] = $departamento[\"Departamento\"][\"nombre\"];\n\t }\n\t $departamentos = $new_departamentos;\n\t\n\t $this->set(compact(\"departamentos\"));\n\t \t\n }", "public function departments(){\n \t$departments = Department::all();\n\n \treturn view('departments.departments')->with('departments', $departments);\n }", "public function GetAllDepartments()\r\n\t{\t\r\n\t\t$WhereCondition = \"\";\r\n\t\t$query = $this->db->query(\" \t\r\n\t\t\t\t\t\t\t\t\tSELECT * FROM `tbl_user_department`\r\n\t\t\t\t\t\t\t\t\");\r\n\t\t$result = $query->result_array();\t\t\t\r\n\t\treturn $result;\r\n\t}", "public function departments()\n {\n $this->authCheck();\n\n $departmentData = DB::table('departments')\n ->get();\n \n $departments=view('admin.department_list')\n ->with('departmentData',$departmentData);\n\n return view('admin.master')\n ->with('main_content',$departments);\n }", "public function getDepartments(){\r\n $sql=\"SELECT * FROM departments\";\r\n $query=$this->db->query($sql);\r\n return $query->result_array();\r\n }", "function get_depar_all()\n {\n $results = array();\n\n $list_user_all = array();\n //Define request\n $req = \"SELECT * FROM departement\";\n\n //request\n $query = $this->db->query($req);\n\n //If the query succeed\n if($query !== FALSE)\n {\n foreach ($query->result() as $row)\n {\n $depar = new Depar_model;\n $depar->define_depar($row->dp_name);\n array_push($results, $depar);\n } \n }\n else\n {\n $results = FALSE;\n }\n\n\n /* Libération du jeu de résultats */\n \n\n return $results;\n }", "public function getdepartments(Request $request){\n $departments = Department::where('departmentable_id', intval($request->input('office_id')))->whereNull('deleted_at')->get();\n return response()->json(array('status' => true, 'data' => $departments));\n }", "public function llenarDepartamentosModel(){\n\t\ttry{\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT iddept, name FROM department\"); //(\"SELECT idzone, zone FROM zones\");\n\t\t\t$stmt->execute();\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 getDepartments($onlyCostcenters = false) {\n\n $departments = new SplObjectStorage();\n foreach ($this->getTable()->getDepartments() as $dep) {\n try {\n $department = new Yourdelivery_Model_Department($dep['id']);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n\n $departments->attach($department);\n }\n $this->_departments = $departments;\n \n return $this->_departments;\n }", "public function departments() {\n return $this->hasMany('Department')->orderBy('name');\n }", "function get_departments() {\r\n switch_to_blog(1);\r\n $depts = get_terms([\r\n 'taxonomy' => 'dept',\r\n 'hide_empty' => false,\r\n ]);\r\n restore_current_blog();\r\n\r\n if( !is_array( $depts ) || empty( $depts ) ) {\r\n $url = \"https://news.cah.ucf.edu/wp-json/news/depts\";\r\n $response = wp_remote_get( $url, ['timeout' => 20] );\r\n if( is_wp_error( $response ) ) {\r\n $depts = [];\r\n }\r\n else {\r\n $depts = json_decode( $response['body'] );\r\n }\r\n }\r\n return $depts;\r\n}", "public function getDepartamentosTodos(){\n\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t$consulta=\"SELECT * FROM departamentos\";\n\t\t\t\t\n\n\t\t\t\t$query=$this->db->preparar($consulta);\n\t\t\t\t$query->execute();\n\t\t\t\t\n\t\t\t\t$tClientes = $query->fetchAll();\n\t\t\t\t\n\t\t\t\t//obtiene todas las tuplas de la tabla clientes\n\t\t\t\t//y devuelve el array $tClientes\n\n\t\t\t} catch (Exception $e) {\n\t\t\t\techo \"Se ha producido un errro\";\n\t\t\t\t\n\t\t\t}\n\n\t\t\t$tablaClientes=array(); //inicializamos la tabla de salida\n\t\t\tforeach ($tClientes as $fila) {\n\t\t\t\t$c=new Departamento($fila[0], $fila[1], \n\t\t\t\t\t$fila[2], $fila[3]);\n\t\t\t\tarray_push($tablaClientes, $c);\n\t\t\t}\n\t\t\treturn $tablaClientes;\n\t\t}", "function getTicketDepartments()\r\n\t{\r\n\t\treturn $this->call_API('getTicketDepartments');\r\n\t}", "public function getDepartment()\n {\n $option = Paging::normalizeOption($_GET);\n $result = DepartmentTable::get($option);\n //$result = Paging::genNextPrev($option, $result);\n\n http_response_code(200);\n echo json_encode($result);\n }", "public function getdepositorDeatils() {\n $select = $this->select()\n ->from(array('wr' => 'withdrawal_request'))\n ->setIntegrityCheck(false)\n ->join(array('u' => 'users'), 'u.user_id = wr.user_id', array(\"u.user_name\"))\n ->where('wr.status =?', '1');\n\n $result = $this->getAdapter()->fetchAll($select);\n if ($result) :\n return $result;\n endif;\n }", "public function index()\n {\n return Departamento::all();\n }", "public function index()\n {\n return DepartmentResource::collection(Department::paginate());\n }", "public function getEducations() {\n try {\n \n $object = Education::model()->getAllEducations();\n } catch (Exception $ex) {\n Yii::log(\"SkiptaUserService:getEducations::\".$ex->getMessage().\"--\".$ex->getTraceAsString(), 'error', 'application');\n error_log(\"Exception Occurred in SkiptaUserService->getEducations### \".$ex->getMessage());\n }\n return $object;\n }", "public function getDepartamentos() {\n try {\n $departamento = Departamento::all();\n return $departamento;\n } catch (\\Illuminate\\Database\\QueryException $e) {\n return ['error' => 'Falló al obtener el departamento:' . $e->getMessage()];\n }\n }", "public function get()\n {\n return $this->remote->select()->from('departments')->getStatement()->fetchAll();\n }", "public function listofDepartments()\n {\n return view('Admin.ShowallDepartments');\n //.blade\n }", "public function departments()\n {\n return $this->belongsToMany(\n config('core.acl.department'), \n config('core.acl.departments_roles_table'), \n 'role_id', \n 'department_id'\n );\n }", "public function departments()\n {\n $departments = Departments::where('status', 'active')->orderBy('idx')->get();\n foreach ($departments as $dept) {\n $subdepartment = Departments::where('department_id', $dept->subdepartment_id)->get();\n $dept['subdepartments'] = $subdepartment;\n }\n\n return view('setup.department.departments', compact('departments', 'subdepartment'));\n }", "public function allDepartment(){\n\n $all_department=$this->settings->all_departmentasc();\n return response()->json([\n 'all_department' => $all_department,\n ], $this->successStatus);\n\n }", "public function getAllAvailableDepartments(){\n if( in_array('Admin', $this->getCurrentRoles()) ){\n // User is admin; get all Departments\n return $this->getAllDepartmentInfo();\n }\n else{\n // Non-admin user; just get their primary department\n return array(\n $this->getDepartmentInfo()\n );\n }\n }", "public static function getList()\n {\n return CHtml::listData(Departamentos::model()->findAll(),'id_departamento', 'descripcion');\n }", "public function index()\n {\n $departamentos = Department::all();\n return $this->showAll($departamentos);\n }", "public static function all() {\n $departments = array();\n \n $rows = DB::query('SELECT * FROM Department');\n \n foreach ($rows as $row) {\n $departments[] = self::create_department($row);\n }\n \n return $departments;\n }", "public function getRelatedDepartments()\n\t{\n if (is_null($this->department)) return [];\n\n $member_department = $this->department()->get();\n\n\t\tif ($this->department()->first()->is_main()){\n\t\t\treturn $member_department->merge($this->department()->first()->descendants()->get());\n\t\t}else{\n\t\t\treturn $member_department->merge($this->department()->first()->ancestor()->get());\n\t\t}\n\t}", "public function listDemarcaciones()\n {\n $list_demarcaciones = \\common\\models\\autenticacion\\Demarcaciones::find()->all();\n\n return $list_demarcaciones;\n }", "public function getDepartamento(){\n\n if (!empty($this->iCodigoDepartamento)) {\n $this->oDepartamento = DBDepartamentoRepository::getDBDepartamentoByCodigo($this->iCodigoDepartamento);\n }\n return $this->oDepartamento;\n }", "public function index()\n {\n $departments = Department::with('office.organisation')\n ->where('status','Active')\n ->orderBy('id','DESC')\n ->paginate(6);\n\n $organisations = Organisation::where('status','Active')\n ->orderBy('organisation','ASC')\n ->get();\n\n return view('admin/department/departments',compact('departments','organisations'));\n }", "public function departemen()\n {\n //Query untuk mengambil semua data departemen dan diurutkan berdasarkan nama_dept\n $query = $this->db->query(\"SELECT * FROM departemen ORDER BY nama_dept\");\n return $query;\n }", "public function showDepartments()\n {\n $departments = department::orderBy('short')->get();\n $permition = DB::table('users')->join('permition', 'users.permition', '=', 'permition.id')->where('users.id', Auth::id())->select('permition.edit_item', 'permition.possibility_renting')->get();\n\n return view('departments', ['departments' => $departments, 'permition' => $permition]);\n }", "public function getList(){\n\t\t$listeDepartements = array();\n\t\t$req = $this->db->prepare('SELECT dep_num,dep_nom,vil_num FROM departement ORDER BY dep_nom');\n\t\t$req->execute();\n\n\t\twhile ($departement = $req->fetch(PDO::FETCH_OBJ)) {\n\t\t\t$listeDepartements[]= new Departement($departement);\n\t\t}\n\n\t\treturn $listeDepartements;\n\t\t$req -> closeCursor();\n\t}", "public function department($dept)\n {\n //find by department code\n $personnels = $this->model\n ->where('office_code', '=', $dept)\n ->get();\n\n return $this->response->item($personnels, new PersonnelTransformer());\n }", "public function getAllDeatils() {\n $select = $this->select()\n ->from(array('wr' => 'withdrawal_request'))\n ->setIntegrityCheck(false)\n ->join(array('u' => 'users'), 'u.user_id = wr.user_id', array(\"u.user_name\"))\n ->order('requested_amt DESC');\n\n $result = $this->getAdapter()->fetchAll($select);\n\n if ($result) {\n return $result;\n }\n }", "public function getActiveDeposits(): Collection\n {\n return Deposit::active()->get();\n }", "public function getdep()\n {\n $query = $this->db->get('departments');\n\n return $query->result();\n }", "public static function mostrarDepartamentos() {\n $query = \"SELECT idDepartamento, nombreDepartamento FROM Departamento\";\n\n self::getConexion();\n\n $resultado = self::$conexion->prepare($query);\n $resultado->execute();\n\n return $resultado;\n }", "function getAllDept(){\r\n echo\r\n $query = \"SELECT dept_name,dept_id FROM department\";\r\n $result = $this->executeQuery($query); \r\n return $result;\r\n }", "public function index()\n {\n $designations=Designation::where('company_id',session('companyId'))->paginate(15);\n $departments=departments();\n return view('manage.designation.index')->with('designations', $designations)->with('departments',$departments);\n }", "public static function importDoctors() {\n\n $type = Recipient::PROVIDER;\n $columns = \"physician_profile_id, physician_first_name,physician_last_name, count(*) as transactions\";\n $group_by = \"physician_profile_id, physician_first_name,physician_last_name\";\n\n $doctors = OpenPaymentsData::connectAndRetrieve($type, false, $columns, $group_by);\n\n return $doctors;\n }", "public function departments()\n {\n return $this->belongsToMany('App\\Models\\Department');\n }", "public function departments(Request $request){\n if (!$request->block) {\n $html = '<option value=\"\">Select Department</option>';\n }\n\n else {\n $html = '<option value=\"\">Select Department</option>';\n $departments = LocationInfo::where('block', $request->block)->distinct()->pluck('department');\n foreach ($departments as $department) {\n $html .= '<option value=\"'.$department.'\">'.$department.'</option>';\n }\n }\n\n return response()->json(['html' => $html]);\n }", "public function getDepa()\n {\n return $this->hasOne(Departamentos::className(), ['id' => 'depa_id']);\n }", "public function getDistricts()\n\t{\t\n\t\t# get all the districts from the database\n\t\t$districts = App::make('Apiv1\\Repositories\\Districts\\DistrictsRepository')->getDistricts();\n\n\t\t# transform them and send them back. This process sets an 'isPromoted' flag against each\n\t\treturn App::make('Apiv1\\Transformers\\DistrictPreferenceTransformer')->transformCollection($districts->toArray(), $this->user);\n\t}", "public function get_dept()\n\t{\n\t\t$division_id = $this->input->post('division_id');\n\t\t$department['dept'] = $this->reports->get_dept($division_id);\n\t\techo json_encode($department);\n\t}", "function get_departments()\n {\n $organizationId = $this->uri->segment(4);\n $this->db->select(\"*\")\n ->from(TBL_DEPARTMENTS)\n ->where('organizationId', $organizationId);\n $db = $this->db->get();\n\n $array = array();\n foreach($db->result() as $row):\n $array[] = array(\"value\" => $row->departmentId, \"property\" => $row->departmentName);\n endforeach;\n\n echo json_encode($array);\n exit;\n }", "public function getUsersDepartments()\n\t{\n\t\t$db = $this->getDbTable()->getAdapter();\n\t\t$select = $db->select()\n\t\t\t->from(array('u' => 'users'), array('user_id', 'name', 'surname', 'patronymic'))\n\t\t\t->joinLeft(array('ud' => 'users_departments'),\n\t\t\t\t'ud.user_id = u.user_id', array('department_id', 'chief'));\n\t\treturn $db->fetchAll($select);\t\n\t}", "public function deducibles(){\n \treturn $this->hasMany('Modules\\Plan\\Entities\\Deducible','plan_id'); // this matches the Eloquent model\n }", "public function getDepartements()\n\t{\n\t\t$this->ensureDepartementsLoaded();\n\t\treturn new GmthBridgeIterator(new \\ArrayIterator($this->_departements),\n\t\t\t$this, 'PhpExtended\\Gmth\\GmthBridgeDepartement');\n\t}", "public function get_dept()\n\t{\n\t\t$division_id = $this->input->post('division_id');\n\t\t$department['dept'] = $this->file_maintenance_model->get_dept($division_id);\n\t\techo json_encode($department);\n\t}", "public function dept_choice(){\n $outputs = array();\n $dept_type = (new TbMsCmnCdModel())->getCdKeyY(TbMsCmnCdModel::$department_type_cd_pre);\n $outputs['dept_type'] = $this->arrKeyVal2NewArr($dept_type);\n $dept_status = TbHrDeptModel::getStatusForDept();\n $outputs['dept_status'] = $this->arrKeyVal2NewArr($dept_status);\n $dept_incharge = TbHrDeptModel::getTypeForEDRelation();\n $outputs['dept_incharge'] = $this->arrKeyVal2NewArr($dept_incharge);\n\n return $outputs;\n }", "public function show_all_department(){\n // Jika yang mengakses bukan ADMIN, redirect ke department miliknya\n if(!Auth::user()->admin) return redirect('/department/'.Auth::user()->department_id);\n\n // Mengakses fungsi eloquent all() pada class model untuk mendapatkan semua data pada database.\n $departments = Department::all();\n\n // Membuat array asosiasi (association array) bernama $data yang digunakan untuk \n // menampung data $departments yang nantinya akan ditampilkan pada view.\n $data = [\n 'departments' => $departments\n ];\n\n // Menampilkan view dari file views/department/list_all_department.blade.php\n // dengan mengirimkan variabel $data yang akan ditampilkan di view tersebut.\n return view('department.list_all_department', $data);\n }", "public function get_jamf_departments()\n {\n $obj = new View();\n $jamf = new Jamf_model;\n $obj->view('json', array('msg' => $jamf->get_jamf_departments()));\n }", "public function manageDepartments()\n {\n $departmentArr = Department::all();\n return view('admin.manage.departments', ['departments' => $departmentArr, 'count' => 0]);\n }", "public function listarDeportestodo(){\n $sql = \"SELECT `Sport`.`id` as iddeporte, `Sport`.`nombre` FROM `sporte`.`coaches` AS `Coach` LEFT JOIN `sporte`.`users` AS `User` ON (`Coach`.`user_id` = `User`.`id`) LEFT JOIN `sporte`.`ligas` AS `Liga` ON (`Coach`.`liga_id` = `Liga`.`id`) LEFT JOIN `sporte`.`sports` AS `Sport` ON (`Liga`.`sport_id` = `Sport`.`id`) WHERE 1=1\";\n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute(); \n return $sentencia->fetchAll(PDO::FETCH_OBJ);\n }", "public function getDepa()\n {\n return $this->hasOne(\\common\\models\\masters\\Departamentos::className(), ['id' => 'depa_id']);\n }", "public function getPaymentDeatils() {\n $select = $this->select()\n ->from(array('wr' => 'withdrawal_request'))\n ->setIntegrityCheck(false)\n ->join(array('u' => 'users'), 'u.user_id = wr.user_id', array(\"u.user_name\"))\n ->where('wr.status =?', '1');\n\n $result = $this->getAdapter()->fetchAll($select);\n if ($result) :\n return $result;\n endif;\n }", "public function getDepartamento() {\n\n if (empty($this->oDBDepartamento) && !empty($this->iCodigoDepartamento)) {\n $this->oDBDepartamento = DBDepartamentoRepository::getDBDepartamentoByCodigo($this->iCodigoDepartamento);\n }\n return $this->oDBDepartamento;\n }", "public function getDepartemen() {\r\n $sql = $this->db->query(\"SELECT * FROM ms_departemen ORDER BY dept_deskripsi ASC\");\r\n if ($sql->num_rows() > 0) {\r\n return $sql->result_array();\r\n }\r\n return null;\r\n }", "public function deptlist(){\n\t\t\t$prgid = $this->input->post('stu_prgname');\n\t\t\t//print_r($prgid);die;\n\t\t\t$sarray='prg_deptid';\n\t\t\t$wharray = array('prg_id' => $prgid);\n\t\t\t$department = $this->commodel->get_listarry('program',$sarray,$wharray);\n\t\tforeach($department as $datas):\n\t\t\t\t$deptid = $datas->prg_deptid; \n\t\t\t\t$deptname=$this->commodel->get_listspfic1('Department','dept_name','dept_id',$deptid)->dept_name;\n\t\t\t\techo \"<option id='stu_departname' value='$deptid'>\".\"$deptname\".\"</option>\";\n \t\tendforeach;\n\t }", "public function getAllEducations()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new EducationDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getAllEducation($userID);\n }", "public function index()\n {\n $departments = Department::orderBy('created_at', 'asc')->paginate();\n\n return response()->json($departments, 200);\n }", "public function services()\n {\n $departments=Department::all();\n return view('pages.services',['department'=>$departments]);\n }", "public function cargarDepartamento() {\n $departamento = Departamento::all(['id','nombre','ISOcode']);\n return response()->json([\n 'departamento'=>$departamento\n ]);\n }", "public function alldeals(){\n\t\t$q= $this->db->query('select * from traveldeal');\n\t\treturn $q->result();\n\t}", "function getDepartmentsByUsername(){\n if(Current_User::isDeity()){\n $db = &new PHPWS_DB('sysinventory_department');\n $db->addColumn('description');\n $db->addColumn('id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n return $list;\n // otherwise return a list of departments of which they're an admin \n }else if(Current_User::allow('sysinventory','admin')){\n $db = new PHPWS_DB('sysinventory_admin');\n $db->addWhere('username',Current_User::getUsername(),'ILIKE');\n $db->addJoin('left outer','sysinventory_admin','sysinventory_department','department_id','id');\n $db->addColumn('sysinventory_department.description');\n $db->addColumn('sysinventory_department.id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n \n return $list;\n }else{\n return NULL;\n }\n \n }", "function getDepartmentsByUsername(){\n if(Current_User::isDeity()){\n $db = &new PHPWS_DB('sysinventory_department');\n $db->addColumn('description');\n $db->addColumn('id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n return $list;\n // otherwise return a list of departments of which they're an admin \n }else if(Current_User::allow('sysinventory','admin')){\n $db = new PHPWS_DB('sysinventory_admin');\n $db->addWhere('username',Current_User::getUsername(),'ILIKE');\n $db->addJoin('left outer','sysinventory_admin','sysinventory_department','department_id','id');\n $db->addColumn('sysinventory_department.description');\n $db->addColumn('sysinventory_department.id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n \n return $list;\n }else{\n return NULL;\n }\n \n }", "public function obtenerDepartamento()\n {\n return $this->hasOne('App\\Departamento', 'id', 'departamento_id')->first();\n }", "function getUserDepartments($user) {\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n\r\n return $data->getUserDepartments($user);\r\n\r\n }", "public function getDepartment()\n {\n return $this->hasOne(Departments::className(), ['ID' => 'DepartmentID']);\n }", "public function get_departments_by_scope_location()\n {\n $scope = get_post('scope');\n $location = get_post('location');\n\n $locationWhere = array(\n 'deletedAt IS NULL',\n 'Status' => 1,\n 'LocationScope' => $scope\n );\n\n // not national\n if ((int)$scope !== 1) {\n $locationWhere['LocationCode'] = $location;\n }\n\n $departments = array();\n $department_locations = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere);\n\n foreach ($department_locations as $dept) {\n\n // sub department\n if ($dept['SubDepartmentID'] != 0) {\n $parentData = $this->mgovdb->getRowObject('Dept_ChildDepartment', $dept['SubDepartmentID'], 'id');\n $dept['type'] = 'sub';\n } else {\n $parentData = $this->mgovdb->getRowObject('Dept_Departments', $dept['DepartmentID'], 'id');\n $dept['type'] = 'main';\n }\n\n unset($dept['LastUpdate']);\n unset($dept['deletedAt']);\n\n if ($parentData) {\n\n $parentData->Logo = logo_filename($parentData->Logo);\n\n unset($parentData->LastUpdate);\n unset($parentData->deletedAt);\n\n $dept['parent'] = (array) $parentData;\n $departments[] = $dept;\n }\n }\n\n response_json($departments);\n }", "public function departamentos(){\n \treturn $this->hasMany(Departamento::class, 'id_ministerio_departamento', 'id_ministerio_departamento')->where('bo_activo', true)->where('bo_estado', 1);//->orderBy('email');\n }", "private function queryDepositsAndWithdrawals() {\r\n return $this->queryAPI( 'returnDepositsWithdrawals', //\r\n [\r\n 'start' => time() - 14 * 24 * 3600,\r\n 'end' => time() + 3600\r\n ]\r\n );\r\n\r\n }", "public function departments() : BelongsToMany\n {\n return $this->belongsToMany(Department::class);\n }", "public function index()\n {\n $departments = Department::orderBy('company_department_id','DESC')->get();\n return view('admin.department.index',compact('departments'));\n }", "public function getDeptItems0()\n {\n return $this->hasMany(DeptItem::className(), ['sales_ret_gl_acc_id' => 'account_id']);\n }", "public function listCities() {\n $result = array();\n $query = 'SELECT `id`,`zipCode`,`city`,`id_ppro_departments` FROM `ppro_cities` ORDER BY `id` ASC';\n $queryResult = $this->db->query($query);\n if (is_object($queryResult)) {\n $result = $queryResult->fetchAll(PDO::FETCH_OBJ);\n }\n return $result;\n }", "public function actionIndex() {\r\n $departments = Yii::app()->request->getParam('Departments',array());\r\n $model =new Departments('search');\r\n \r\n $model->unsetAttributes();\r\n if(!empty($departments)){\r\n foreach ($departments as $d_attr => $d_val){\r\n $model->$d_attr = $d_val;\r\n }\r\n }\r\n $this->render('index',array(\r\n 'model' => $model\r\n ));\r\n }", "protected function SourceDepartments() {\n\treturn $this->DepartmentTable()->SQO_Source('d');\n\t//return new fcSQL_TableSource($this->DepartmentTable()->Name(),'d');\n }", "public function index()\n {\n return view('admin.pages.planning.department.list');\n }", "public function devolverDepartamento() {\n $con = \"select nom_dep from departamentos where id=:i\";\n $stmt=parent::$conexion->prepare($con);\n\n try {\n $stmt->execute([\n ':i'=>$this->id\n ]);\n } catch (PDOException $ex) {\n die(\"Error al devolver el departamento, \".$ex->getMessage());\n }\n return $stmt;\n }", "public function mainList($perPage = 10, $filters = null){\n\n $apartments = DB::table('apartament_group_descriptions')\n ->select('apartament_id', 'apartament_name')\n ->where('language_id', 1)\n ->paginate($perPage);\n\n return $apartments;\n }", "public function department() {\n\t\treturn $this->has_many_and_belongs_to('Department', 'department_members');\n\t}", "public function ciudades_all()\n {\n $ciudad = Ciudad::with('departamento')->get();\n\n return $this->sendResponse($ciudad->toArray(), 'Ciudades devueltas con éxito');\n }" ]
[ "0.7009796", "0.6563515", "0.651281", "0.63708097", "0.62968075", "0.62751615", "0.6258663", "0.62275267", "0.6200337", "0.61787766", "0.6087594", "0.60709435", "0.6064437", "0.60592103", "0.60588205", "0.6050299", "0.60315305", "0.6023613", "0.59789276", "0.59547156", "0.5949629", "0.5931136", "0.5911048", "0.5898629", "0.5888306", "0.5884393", "0.58288175", "0.5804263", "0.57970595", "0.5795497", "0.5750629", "0.57330513", "0.5724424", "0.5723828", "0.57205683", "0.57168925", "0.57168126", "0.5710208", "0.5696184", "0.5674304", "0.566019", "0.5645959", "0.564476", "0.5641765", "0.5631888", "0.56216747", "0.56106156", "0.5604771", "0.55985904", "0.55864394", "0.5573114", "0.55709124", "0.55588555", "0.5557112", "0.5544049", "0.55317867", "0.5530152", "0.5528196", "0.5513712", "0.5507204", "0.54892796", "0.54719967", "0.54551965", "0.5447268", "0.5442418", "0.5439624", "0.54289645", "0.5422434", "0.5420913", "0.5405444", "0.539829", "0.5393585", "0.5393486", "0.5391856", "0.5385822", "0.5383255", "0.5382081", "0.5372685", "0.5371151", "0.5366324", "0.53538364", "0.5352438", "0.5341045", "0.5341045", "0.53403795", "0.53249377", "0.53239167", "0.53224385", "0.5316066", "0.53154194", "0.5305407", "0.53005075", "0.5296014", "0.5288011", "0.5281197", "0.5279877", "0.52797765", "0.5278908", "0.52766955", "0.5268848", "0.5268127" ]
0.0
-1
This method will retrieve all Departments of corporate
public function getCorpoAdminLikeDepartments($term, $limit, $accountId) { $query = $this->createQueryBuilder('p') ->select('p.name,p.id'); if ($term && $term != '') { $query->where('p.name LIKE :term') ->setParameter(':term', '%'.$term.'%'); } if ($accountId && $accountId != '') { $query->andwhere("p.accountId = :accountId") ->setParameter(':accountId', $accountId); } $query->setMaxResults($limit); $quer = $query->getQuery(); $result = $quer->getScalarResult(); if (!empty($result) && isset($result[0])) { return $result; } else { return array(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllDepartments() {\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllDepartments();\r\n }", "public function index()\n {\n return Departments::all();\n }", "function GetDepartments()\n\t{\n\t\t$result = $this->sendRequest(\"GetDepartments\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function getDepartments() {\n //but if none, get from db\n if(null==$this->departments){\n $mapper=new Application_Model_DirectoryDepartmentMapper();\n $departments=$mapper->fetchAll();\n $options=array();\n foreach($departments as $department){\n $options[]=$department->getName();\n }\n $this->departments=$options;\n }\n return $this->departments;\n }", "public function getDepartmentList() {\n return $this->_get(2);\n }", "public static function getDepartmentsList(){\n $cont = new RestController();\n\n $result = $cont->getRequest('ProductDepartments');\n\n $departments = [];\n\n if($result instanceof View){\n return $departments;\n }\n\n foreach($result->value as $dep){\n $departments[$dep->Id]=$dep->Name;\n }\n\n return $departments;\n\n }", "public function departments()\r\n {\r\n return new QueryForDepartments();\r\n }", "function getdepartments() {\n\t\t// import department db\n\t\tApp::import('Model','Department');\n\t\t$this->Department = & new Department();\n\t\t# fetch list of active departments \n\t\t$departments_list = $this->Department->find('list',array('conditions'=>array('Department.status'=>'1'),'fields'=>array('id','name'),'limit'=>10,'order'=>array('Department.id')));\n\t\treturn $departments_list;\n\t}", "public function getDepartment() {\n return response()->json([\n 'success' => true,\n 'statusCode' => 200,\n 'message' => 'Successfully retrieved clearances departments',\n 'data' => Department::all()]);\n }", "function get_department(){\n $this->_db2->where(\"DeleteFlag\",\"A\");\n return $this->_db2->get($this->_tblorg);\n }", "public function ListDepartments(){\n\t\t$query = \"SELECT code, label, division, sortOrder FROM [DEPARTMENTS TABLE] ORDER BY sortOrder ASC\";\n\t\treturn array(\"results\" => $this->SelectQueryHelper($query));\n\t}", "public function getAllDepartmentInfo(){\n $LOG = Logger::getLogger(__CLASS__ . '.' . __FUNCTION__);\n\n $dao = new LabInspectionSummaryReportDAO();\n $min_year = $this->getMinimumReportYear();\n $departments = $dao->getDepartmentDetails(null, $min_year);\n\n return $departments;\n }", "public function getDeptItems()\n {\n return $this->hasMany(DeptItem::className(), ['sales_disc_gl_acc_id' => 'account_id']);\n }", "private function getDepartments(): array\n {\n try {\n /** @var Departments[] $departments */\n $departments = $this->getDoctrine()\n ->getRepository(Departments::class)\n ->findAll();\n }\n catch(\\Exception $ex) {\n return [];\n }\n\n return $departments;\n }", "public function getDepartamentos($provincia_id = 19) {\n\t \t$departamentos = $this->Departamento->find(\"all\", \n\t \t array(\"conditions\" => array( \"provincia\" => $provincia_id),\n\t \t \"sort\" => \"Departamento.nombre ASC\",\n\t \t \"recursive\" => -1\n\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t );\n\t $new_departamentos = array();\n\t foreach ($departamentos as $departamento) {\n\t $new_departamentos[$departamento[\"Departamento\"][\"id\"]] = $departamento[\"Departamento\"][\"nombre\"];\n\t }\n\t $departamentos = $new_departamentos;\n\t\n\t $this->set(compact(\"departamentos\"));\n\t \t\n }", "public function departments(){\n \t$departments = Department::all();\n\n \treturn view('departments.departments')->with('departments', $departments);\n }", "public function GetAllDepartments()\r\n\t{\t\r\n\t\t$WhereCondition = \"\";\r\n\t\t$query = $this->db->query(\" \t\r\n\t\t\t\t\t\t\t\t\tSELECT * FROM `tbl_user_department`\r\n\t\t\t\t\t\t\t\t\");\r\n\t\t$result = $query->result_array();\t\t\t\r\n\t\treturn $result;\r\n\t}", "public function departments()\n {\n $this->authCheck();\n\n $departmentData = DB::table('departments')\n ->get();\n \n $departments=view('admin.department_list')\n ->with('departmentData',$departmentData);\n\n return view('admin.master')\n ->with('main_content',$departments);\n }", "public function getDepartments(){\r\n $sql=\"SELECT * FROM departments\";\r\n $query=$this->db->query($sql);\r\n return $query->result_array();\r\n }", "function get_depar_all()\n {\n $results = array();\n\n $list_user_all = array();\n //Define request\n $req = \"SELECT * FROM departement\";\n\n //request\n $query = $this->db->query($req);\n\n //If the query succeed\n if($query !== FALSE)\n {\n foreach ($query->result() as $row)\n {\n $depar = new Depar_model;\n $depar->define_depar($row->dp_name);\n array_push($results, $depar);\n } \n }\n else\n {\n $results = FALSE;\n }\n\n\n /* Libération du jeu de résultats */\n \n\n return $results;\n }", "public function getdepartments(Request $request){\n $departments = Department::where('departmentable_id', intval($request->input('office_id')))->whereNull('deleted_at')->get();\n return response()->json(array('status' => true, 'data' => $departments));\n }", "public function llenarDepartamentosModel(){\n\t\ttry{\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT iddept, name FROM department\"); //(\"SELECT idzone, zone FROM zones\");\n\t\t\t$stmt->execute();\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 getDepartments($onlyCostcenters = false) {\n\n $departments = new SplObjectStorage();\n foreach ($this->getTable()->getDepartments() as $dep) {\n try {\n $department = new Yourdelivery_Model_Department($dep['id']);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n\n $departments->attach($department);\n }\n $this->_departments = $departments;\n \n return $this->_departments;\n }", "public function departments() {\n return $this->hasMany('Department')->orderBy('name');\n }", "function get_departments() {\r\n switch_to_blog(1);\r\n $depts = get_terms([\r\n 'taxonomy' => 'dept',\r\n 'hide_empty' => false,\r\n ]);\r\n restore_current_blog();\r\n\r\n if( !is_array( $depts ) || empty( $depts ) ) {\r\n $url = \"https://news.cah.ucf.edu/wp-json/news/depts\";\r\n $response = wp_remote_get( $url, ['timeout' => 20] );\r\n if( is_wp_error( $response ) ) {\r\n $depts = [];\r\n }\r\n else {\r\n $depts = json_decode( $response['body'] );\r\n }\r\n }\r\n return $depts;\r\n}", "public function getDepartamentosTodos(){\n\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t$consulta=\"SELECT * FROM departamentos\";\n\t\t\t\t\n\n\t\t\t\t$query=$this->db->preparar($consulta);\n\t\t\t\t$query->execute();\n\t\t\t\t\n\t\t\t\t$tClientes = $query->fetchAll();\n\t\t\t\t\n\t\t\t\t//obtiene todas las tuplas de la tabla clientes\n\t\t\t\t//y devuelve el array $tClientes\n\n\t\t\t} catch (Exception $e) {\n\t\t\t\techo \"Se ha producido un errro\";\n\t\t\t\t\n\t\t\t}\n\n\t\t\t$tablaClientes=array(); //inicializamos la tabla de salida\n\t\t\tforeach ($tClientes as $fila) {\n\t\t\t\t$c=new Departamento($fila[0], $fila[1], \n\t\t\t\t\t$fila[2], $fila[3]);\n\t\t\t\tarray_push($tablaClientes, $c);\n\t\t\t}\n\t\t\treturn $tablaClientes;\n\t\t}", "function getTicketDepartments()\r\n\t{\r\n\t\treturn $this->call_API('getTicketDepartments');\r\n\t}", "public function getDepartment()\n {\n $option = Paging::normalizeOption($_GET);\n $result = DepartmentTable::get($option);\n //$result = Paging::genNextPrev($option, $result);\n\n http_response_code(200);\n echo json_encode($result);\n }", "public function getdepositorDeatils() {\n $select = $this->select()\n ->from(array('wr' => 'withdrawal_request'))\n ->setIntegrityCheck(false)\n ->join(array('u' => 'users'), 'u.user_id = wr.user_id', array(\"u.user_name\"))\n ->where('wr.status =?', '1');\n\n $result = $this->getAdapter()->fetchAll($select);\n if ($result) :\n return $result;\n endif;\n }", "public function index()\n {\n return Departamento::all();\n }", "public function index()\n {\n return DepartmentResource::collection(Department::paginate());\n }", "public function getEducations() {\n try {\n \n $object = Education::model()->getAllEducations();\n } catch (Exception $ex) {\n Yii::log(\"SkiptaUserService:getEducations::\".$ex->getMessage().\"--\".$ex->getTraceAsString(), 'error', 'application');\n error_log(\"Exception Occurred in SkiptaUserService->getEducations### \".$ex->getMessage());\n }\n return $object;\n }", "public function getDepartamentos() {\n try {\n $departamento = Departamento::all();\n return $departamento;\n } catch (\\Illuminate\\Database\\QueryException $e) {\n return ['error' => 'Falló al obtener el departamento:' . $e->getMessage()];\n }\n }", "public function get()\n {\n return $this->remote->select()->from('departments')->getStatement()->fetchAll();\n }", "public function listofDepartments()\n {\n return view('Admin.ShowallDepartments');\n //.blade\n }", "public function departments()\n {\n return $this->belongsToMany(\n config('core.acl.department'), \n config('core.acl.departments_roles_table'), \n 'role_id', \n 'department_id'\n );\n }", "public function departments()\n {\n $departments = Departments::where('status', 'active')->orderBy('idx')->get();\n foreach ($departments as $dept) {\n $subdepartment = Departments::where('department_id', $dept->subdepartment_id)->get();\n $dept['subdepartments'] = $subdepartment;\n }\n\n return view('setup.department.departments', compact('departments', 'subdepartment'));\n }", "public function allDepartment(){\n\n $all_department=$this->settings->all_departmentasc();\n return response()->json([\n 'all_department' => $all_department,\n ], $this->successStatus);\n\n }", "public function getAllAvailableDepartments(){\n if( in_array('Admin', $this->getCurrentRoles()) ){\n // User is admin; get all Departments\n return $this->getAllDepartmentInfo();\n }\n else{\n // Non-admin user; just get their primary department\n return array(\n $this->getDepartmentInfo()\n );\n }\n }", "public static function getList()\n {\n return CHtml::listData(Departamentos::model()->findAll(),'id_departamento', 'descripcion');\n }", "public function index()\n {\n $departamentos = Department::all();\n return $this->showAll($departamentos);\n }", "public static function all() {\n $departments = array();\n \n $rows = DB::query('SELECT * FROM Department');\n \n foreach ($rows as $row) {\n $departments[] = self::create_department($row);\n }\n \n return $departments;\n }", "public function getRelatedDepartments()\n\t{\n if (is_null($this->department)) return [];\n\n $member_department = $this->department()->get();\n\n\t\tif ($this->department()->first()->is_main()){\n\t\t\treturn $member_department->merge($this->department()->first()->descendants()->get());\n\t\t}else{\n\t\t\treturn $member_department->merge($this->department()->first()->ancestor()->get());\n\t\t}\n\t}", "public function listDemarcaciones()\n {\n $list_demarcaciones = \\common\\models\\autenticacion\\Demarcaciones::find()->all();\n\n return $list_demarcaciones;\n }", "public function getDepartamento(){\n\n if (!empty($this->iCodigoDepartamento)) {\n $this->oDepartamento = DBDepartamentoRepository::getDBDepartamentoByCodigo($this->iCodigoDepartamento);\n }\n return $this->oDepartamento;\n }", "public function index()\n {\n $departments = Department::with('office.organisation')\n ->where('status','Active')\n ->orderBy('id','DESC')\n ->paginate(6);\n\n $organisations = Organisation::where('status','Active')\n ->orderBy('organisation','ASC')\n ->get();\n\n return view('admin/department/departments',compact('departments','organisations'));\n }", "public function departemen()\n {\n //Query untuk mengambil semua data departemen dan diurutkan berdasarkan nama_dept\n $query = $this->db->query(\"SELECT * FROM departemen ORDER BY nama_dept\");\n return $query;\n }", "public function showDepartments()\n {\n $departments = department::orderBy('short')->get();\n $permition = DB::table('users')->join('permition', 'users.permition', '=', 'permition.id')->where('users.id', Auth::id())->select('permition.edit_item', 'permition.possibility_renting')->get();\n\n return view('departments', ['departments' => $departments, 'permition' => $permition]);\n }", "public function getList(){\n\t\t$listeDepartements = array();\n\t\t$req = $this->db->prepare('SELECT dep_num,dep_nom,vil_num FROM departement ORDER BY dep_nom');\n\t\t$req->execute();\n\n\t\twhile ($departement = $req->fetch(PDO::FETCH_OBJ)) {\n\t\t\t$listeDepartements[]= new Departement($departement);\n\t\t}\n\n\t\treturn $listeDepartements;\n\t\t$req -> closeCursor();\n\t}", "public function department($dept)\n {\n //find by department code\n $personnels = $this->model\n ->where('office_code', '=', $dept)\n ->get();\n\n return $this->response->item($personnels, new PersonnelTransformer());\n }", "public function getAllDeatils() {\n $select = $this->select()\n ->from(array('wr' => 'withdrawal_request'))\n ->setIntegrityCheck(false)\n ->join(array('u' => 'users'), 'u.user_id = wr.user_id', array(\"u.user_name\"))\n ->order('requested_amt DESC');\n\n $result = $this->getAdapter()->fetchAll($select);\n\n if ($result) {\n return $result;\n }\n }", "public function getActiveDeposits(): Collection\n {\n return Deposit::active()->get();\n }", "public function getdep()\n {\n $query = $this->db->get('departments');\n\n return $query->result();\n }", "public static function mostrarDepartamentos() {\n $query = \"SELECT idDepartamento, nombreDepartamento FROM Departamento\";\n\n self::getConexion();\n\n $resultado = self::$conexion->prepare($query);\n $resultado->execute();\n\n return $resultado;\n }", "function getAllDept(){\r\n echo\r\n $query = \"SELECT dept_name,dept_id FROM department\";\r\n $result = $this->executeQuery($query); \r\n return $result;\r\n }", "public function index()\n {\n $designations=Designation::where('company_id',session('companyId'))->paginate(15);\n $departments=departments();\n return view('manage.designation.index')->with('designations', $designations)->with('departments',$departments);\n }", "public static function importDoctors() {\n\n $type = Recipient::PROVIDER;\n $columns = \"physician_profile_id, physician_first_name,physician_last_name, count(*) as transactions\";\n $group_by = \"physician_profile_id, physician_first_name,physician_last_name\";\n\n $doctors = OpenPaymentsData::connectAndRetrieve($type, false, $columns, $group_by);\n\n return $doctors;\n }", "public function departments()\n {\n return $this->belongsToMany('App\\Models\\Department');\n }", "public function departments(Request $request){\n if (!$request->block) {\n $html = '<option value=\"\">Select Department</option>';\n }\n\n else {\n $html = '<option value=\"\">Select Department</option>';\n $departments = LocationInfo::where('block', $request->block)->distinct()->pluck('department');\n foreach ($departments as $department) {\n $html .= '<option value=\"'.$department.'\">'.$department.'</option>';\n }\n }\n\n return response()->json(['html' => $html]);\n }", "public function getDepa()\n {\n return $this->hasOne(Departamentos::className(), ['id' => 'depa_id']);\n }", "public function getDistricts()\n\t{\t\n\t\t# get all the districts from the database\n\t\t$districts = App::make('Apiv1\\Repositories\\Districts\\DistrictsRepository')->getDistricts();\n\n\t\t# transform them and send them back. This process sets an 'isPromoted' flag against each\n\t\treturn App::make('Apiv1\\Transformers\\DistrictPreferenceTransformer')->transformCollection($districts->toArray(), $this->user);\n\t}", "public function get_dept()\n\t{\n\t\t$division_id = $this->input->post('division_id');\n\t\t$department['dept'] = $this->reports->get_dept($division_id);\n\t\techo json_encode($department);\n\t}", "function get_departments()\n {\n $organizationId = $this->uri->segment(4);\n $this->db->select(\"*\")\n ->from(TBL_DEPARTMENTS)\n ->where('organizationId', $organizationId);\n $db = $this->db->get();\n\n $array = array();\n foreach($db->result() as $row):\n $array[] = array(\"value\" => $row->departmentId, \"property\" => $row->departmentName);\n endforeach;\n\n echo json_encode($array);\n exit;\n }", "public function getUsersDepartments()\n\t{\n\t\t$db = $this->getDbTable()->getAdapter();\n\t\t$select = $db->select()\n\t\t\t->from(array('u' => 'users'), array('user_id', 'name', 'surname', 'patronymic'))\n\t\t\t->joinLeft(array('ud' => 'users_departments'),\n\t\t\t\t'ud.user_id = u.user_id', array('department_id', 'chief'));\n\t\treturn $db->fetchAll($select);\t\n\t}", "public function deducibles(){\n \treturn $this->hasMany('Modules\\Plan\\Entities\\Deducible','plan_id'); // this matches the Eloquent model\n }", "public function getDepartements()\n\t{\n\t\t$this->ensureDepartementsLoaded();\n\t\treturn new GmthBridgeIterator(new \\ArrayIterator($this->_departements),\n\t\t\t$this, 'PhpExtended\\Gmth\\GmthBridgeDepartement');\n\t}", "public function get_dept()\n\t{\n\t\t$division_id = $this->input->post('division_id');\n\t\t$department['dept'] = $this->file_maintenance_model->get_dept($division_id);\n\t\techo json_encode($department);\n\t}", "public function dept_choice(){\n $outputs = array();\n $dept_type = (new TbMsCmnCdModel())->getCdKeyY(TbMsCmnCdModel::$department_type_cd_pre);\n $outputs['dept_type'] = $this->arrKeyVal2NewArr($dept_type);\n $dept_status = TbHrDeptModel::getStatusForDept();\n $outputs['dept_status'] = $this->arrKeyVal2NewArr($dept_status);\n $dept_incharge = TbHrDeptModel::getTypeForEDRelation();\n $outputs['dept_incharge'] = $this->arrKeyVal2NewArr($dept_incharge);\n\n return $outputs;\n }", "public function show_all_department(){\n // Jika yang mengakses bukan ADMIN, redirect ke department miliknya\n if(!Auth::user()->admin) return redirect('/department/'.Auth::user()->department_id);\n\n // Mengakses fungsi eloquent all() pada class model untuk mendapatkan semua data pada database.\n $departments = Department::all();\n\n // Membuat array asosiasi (association array) bernama $data yang digunakan untuk \n // menampung data $departments yang nantinya akan ditampilkan pada view.\n $data = [\n 'departments' => $departments\n ];\n\n // Menampilkan view dari file views/department/list_all_department.blade.php\n // dengan mengirimkan variabel $data yang akan ditampilkan di view tersebut.\n return view('department.list_all_department', $data);\n }", "public function get_jamf_departments()\n {\n $obj = new View();\n $jamf = new Jamf_model;\n $obj->view('json', array('msg' => $jamf->get_jamf_departments()));\n }", "public function manageDepartments()\n {\n $departmentArr = Department::all();\n return view('admin.manage.departments', ['departments' => $departmentArr, 'count' => 0]);\n }", "public function listarDeportestodo(){\n $sql = \"SELECT `Sport`.`id` as iddeporte, `Sport`.`nombre` FROM `sporte`.`coaches` AS `Coach` LEFT JOIN `sporte`.`users` AS `User` ON (`Coach`.`user_id` = `User`.`id`) LEFT JOIN `sporte`.`ligas` AS `Liga` ON (`Coach`.`liga_id` = `Liga`.`id`) LEFT JOIN `sporte`.`sports` AS `Sport` ON (`Liga`.`sport_id` = `Sport`.`id`) WHERE 1=1\";\n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute(); \n return $sentencia->fetchAll(PDO::FETCH_OBJ);\n }", "public function getDepa()\n {\n return $this->hasOne(\\common\\models\\masters\\Departamentos::className(), ['id' => 'depa_id']);\n }", "public function getPaymentDeatils() {\n $select = $this->select()\n ->from(array('wr' => 'withdrawal_request'))\n ->setIntegrityCheck(false)\n ->join(array('u' => 'users'), 'u.user_id = wr.user_id', array(\"u.user_name\"))\n ->where('wr.status =?', '1');\n\n $result = $this->getAdapter()->fetchAll($select);\n if ($result) :\n return $result;\n endif;\n }", "public function getDepartamento() {\n\n if (empty($this->oDBDepartamento) && !empty($this->iCodigoDepartamento)) {\n $this->oDBDepartamento = DBDepartamentoRepository::getDBDepartamentoByCodigo($this->iCodigoDepartamento);\n }\n return $this->oDBDepartamento;\n }", "public function getDepartemen() {\r\n $sql = $this->db->query(\"SELECT * FROM ms_departemen ORDER BY dept_deskripsi ASC\");\r\n if ($sql->num_rows() > 0) {\r\n return $sql->result_array();\r\n }\r\n return null;\r\n }", "public function deptlist(){\n\t\t\t$prgid = $this->input->post('stu_prgname');\n\t\t\t//print_r($prgid);die;\n\t\t\t$sarray='prg_deptid';\n\t\t\t$wharray = array('prg_id' => $prgid);\n\t\t\t$department = $this->commodel->get_listarry('program',$sarray,$wharray);\n\t\tforeach($department as $datas):\n\t\t\t\t$deptid = $datas->prg_deptid; \n\t\t\t\t$deptname=$this->commodel->get_listspfic1('Department','dept_name','dept_id',$deptid)->dept_name;\n\t\t\t\techo \"<option id='stu_departname' value='$deptid'>\".\"$deptname\".\"</option>\";\n \t\tendforeach;\n\t }", "public function getAllEducations()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new EducationDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getAllEducation($userID);\n }", "public function index()\n {\n $departments = Department::orderBy('created_at', 'asc')->paginate();\n\n return response()->json($departments, 200);\n }", "public function services()\n {\n $departments=Department::all();\n return view('pages.services',['department'=>$departments]);\n }", "public function cargarDepartamento() {\n $departamento = Departamento::all(['id','nombre','ISOcode']);\n return response()->json([\n 'departamento'=>$departamento\n ]);\n }", "public function alldeals(){\n\t\t$q= $this->db->query('select * from traveldeal');\n\t\treturn $q->result();\n\t}", "function getDepartmentsByUsername(){\n if(Current_User::isDeity()){\n $db = &new PHPWS_DB('sysinventory_department');\n $db->addColumn('description');\n $db->addColumn('id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n return $list;\n // otherwise return a list of departments of which they're an admin \n }else if(Current_User::allow('sysinventory','admin')){\n $db = new PHPWS_DB('sysinventory_admin');\n $db->addWhere('username',Current_User::getUsername(),'ILIKE');\n $db->addJoin('left outer','sysinventory_admin','sysinventory_department','department_id','id');\n $db->addColumn('sysinventory_department.description');\n $db->addColumn('sysinventory_department.id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n \n return $list;\n }else{\n return NULL;\n }\n \n }", "function getDepartmentsByUsername(){\n if(Current_User::isDeity()){\n $db = &new PHPWS_DB('sysinventory_department');\n $db->addColumn('description');\n $db->addColumn('id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n return $list;\n // otherwise return a list of departments of which they're an admin \n }else if(Current_User::allow('sysinventory','admin')){\n $db = new PHPWS_DB('sysinventory_admin');\n $db->addWhere('username',Current_User::getUsername(),'ILIKE');\n $db->addJoin('left outer','sysinventory_admin','sysinventory_department','department_id','id');\n $db->addColumn('sysinventory_department.description');\n $db->addColumn('sysinventory_department.id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n \n return $list;\n }else{\n return NULL;\n }\n \n }", "public function obtenerDepartamento()\n {\n return $this->hasOne('App\\Departamento', 'id', 'departamento_id')->first();\n }", "function getUserDepartments($user) {\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n\r\n return $data->getUserDepartments($user);\r\n\r\n }", "public function getDepartment()\n {\n return $this->hasOne(Departments::className(), ['ID' => 'DepartmentID']);\n }", "public function get_departments_by_scope_location()\n {\n $scope = get_post('scope');\n $location = get_post('location');\n\n $locationWhere = array(\n 'deletedAt IS NULL',\n 'Status' => 1,\n 'LocationScope' => $scope\n );\n\n // not national\n if ((int)$scope !== 1) {\n $locationWhere['LocationCode'] = $location;\n }\n\n $departments = array();\n $department_locations = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere);\n\n foreach ($department_locations as $dept) {\n\n // sub department\n if ($dept['SubDepartmentID'] != 0) {\n $parentData = $this->mgovdb->getRowObject('Dept_ChildDepartment', $dept['SubDepartmentID'], 'id');\n $dept['type'] = 'sub';\n } else {\n $parentData = $this->mgovdb->getRowObject('Dept_Departments', $dept['DepartmentID'], 'id');\n $dept['type'] = 'main';\n }\n\n unset($dept['LastUpdate']);\n unset($dept['deletedAt']);\n\n if ($parentData) {\n\n $parentData->Logo = logo_filename($parentData->Logo);\n\n unset($parentData->LastUpdate);\n unset($parentData->deletedAt);\n\n $dept['parent'] = (array) $parentData;\n $departments[] = $dept;\n }\n }\n\n response_json($departments);\n }", "public function departamentos(){\n \treturn $this->hasMany(Departamento::class, 'id_ministerio_departamento', 'id_ministerio_departamento')->where('bo_activo', true)->where('bo_estado', 1);//->orderBy('email');\n }", "private function queryDepositsAndWithdrawals() {\r\n return $this->queryAPI( 'returnDepositsWithdrawals', //\r\n [\r\n 'start' => time() - 14 * 24 * 3600,\r\n 'end' => time() + 3600\r\n ]\r\n );\r\n\r\n }", "public function departments() : BelongsToMany\n {\n return $this->belongsToMany(Department::class);\n }", "public function index()\n {\n $departments = Department::orderBy('company_department_id','DESC')->get();\n return view('admin.department.index',compact('departments'));\n }", "public function getDeptItems0()\n {\n return $this->hasMany(DeptItem::className(), ['sales_ret_gl_acc_id' => 'account_id']);\n }", "public function listCities() {\n $result = array();\n $query = 'SELECT `id`,`zipCode`,`city`,`id_ppro_departments` FROM `ppro_cities` ORDER BY `id` ASC';\n $queryResult = $this->db->query($query);\n if (is_object($queryResult)) {\n $result = $queryResult->fetchAll(PDO::FETCH_OBJ);\n }\n return $result;\n }", "public function actionIndex() {\r\n $departments = Yii::app()->request->getParam('Departments',array());\r\n $model =new Departments('search');\r\n \r\n $model->unsetAttributes();\r\n if(!empty($departments)){\r\n foreach ($departments as $d_attr => $d_val){\r\n $model->$d_attr = $d_val;\r\n }\r\n }\r\n $this->render('index',array(\r\n 'model' => $model\r\n ));\r\n }", "protected function SourceDepartments() {\n\treturn $this->DepartmentTable()->SQO_Source('d');\n\t//return new fcSQL_TableSource($this->DepartmentTable()->Name(),'d');\n }", "public function index()\n {\n return view('admin.pages.planning.department.list');\n }", "public function devolverDepartamento() {\n $con = \"select nom_dep from departamentos where id=:i\";\n $stmt=parent::$conexion->prepare($con);\n\n try {\n $stmt->execute([\n ':i'=>$this->id\n ]);\n } catch (PDOException $ex) {\n die(\"Error al devolver el departamento, \".$ex->getMessage());\n }\n return $stmt;\n }", "public function mainList($perPage = 10, $filters = null){\n\n $apartments = DB::table('apartament_group_descriptions')\n ->select('apartament_id', 'apartament_name')\n ->where('language_id', 1)\n ->paginate($perPage);\n\n return $apartments;\n }", "public function department() {\n\t\treturn $this->has_many_and_belongs_to('Department', 'department_members');\n\t}", "public function ciudades_all()\n {\n $ciudad = Ciudad::with('departamento')->get();\n\n return $this->sendResponse($ciudad->toArray(), 'Ciudades devueltas con éxito');\n }" ]
[ "0.7009796", "0.6563515", "0.651281", "0.63708097", "0.62968075", "0.62751615", "0.6258663", "0.62275267", "0.6200337", "0.61787766", "0.6087594", "0.60709435", "0.6064437", "0.60592103", "0.60588205", "0.6050299", "0.60315305", "0.6023613", "0.59789276", "0.59547156", "0.5949629", "0.5931136", "0.5911048", "0.5898629", "0.5888306", "0.5884393", "0.58288175", "0.5804263", "0.57970595", "0.5795497", "0.5750629", "0.57330513", "0.5724424", "0.5723828", "0.57205683", "0.57168925", "0.57168126", "0.5710208", "0.5696184", "0.5674304", "0.566019", "0.5645959", "0.564476", "0.5641765", "0.5631888", "0.56216747", "0.56106156", "0.5604771", "0.55985904", "0.55864394", "0.5573114", "0.55709124", "0.55588555", "0.5557112", "0.5544049", "0.55317867", "0.5530152", "0.5528196", "0.5513712", "0.5507204", "0.54892796", "0.54719967", "0.54551965", "0.5447268", "0.5442418", "0.5439624", "0.54289645", "0.5422434", "0.5420913", "0.5405444", "0.539829", "0.5393585", "0.5393486", "0.5391856", "0.5385822", "0.5383255", "0.5382081", "0.5372685", "0.5371151", "0.5366324", "0.53538364", "0.5352438", "0.5341045", "0.5341045", "0.53403795", "0.53249377", "0.53239167", "0.53224385", "0.5316066", "0.53154194", "0.5305407", "0.53005075", "0.5296014", "0.5288011", "0.5281197", "0.5279877", "0.52797765", "0.5278908", "0.52766955", "0.5268848", "0.5268127" ]
0.0
-1
This method will retrieve a Department of corporate
public function getDepartmentById($id) { $query = $this->createQueryBuilder('p') ->select('p,ca.name as accountName') ->leftJoin('CorporateBundle:CorpoAccount', 'ca', 'WITH', "ca.id = p.accountId") ->where("p.id = :ID") ->setParameter(':ID', $id); $quer = $query->getQuery(); $result = $quer->getScalarResult(); if (!empty($result) && isset($result[0])) { return $result[0]; } else { return array(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDepartment()\n\t{\n\t\t$ci =& get_instance();\n\t\t$ci->load->library('department');\n\n\t\t$department = new Department($this->department_id);\t\t\t\t\n\n\t\treturn $department;\n\t}", "function get_department(){\n $this->_db2->where(\"DeleteFlag\",\"A\");\n return $this->_db2->get($this->_tblorg);\n }", "public function getOrganizationDepartment()\n {\n return $this->organizationDepartment;\n }", "public function getDepartment()\n {\n return $this->department;\n }", "public function get_department() \n {\n return $this->department;\n }", "public function getDepartment(){\r\n\t return $this->_department;\r\n\t}", "public function getDepartment(): string;", "public function getDepartment()\n {\n return $this->hasOne(Departments::className(), ['ID' => 'DepartmentID']);\n }", "public function getDepartment()\n {\n return $this->hasOne(Department::className(), ['id' => 'departmentID']);\n }", "public function getDepartment()\n {\n return $this->hasOne(Department::className(), ['id' => 'department_id']);\n }", "public function department($dept)\n {\n //find by department code\n $personnels = $this->model\n ->where('office_code', '=', $dept)\n ->get();\n\n return $this->response->item($personnels, new PersonnelTransformer());\n }", "public function getDepartment() {\n return response()->json([\n 'success' => true,\n 'statusCode' => 200,\n 'message' => 'Successfully retrieved clearances departments',\n 'data' => Department::all()]);\n }", "public function getDepartment(): ?OrganizationInterface;", "private function getDepartment() {\n\t\t$return = NULL;\n\t\t$sql = 'SELECT `#__Department`.* FROM `#__Department` LEFT JOIN `#__Department_User` ON `#__Department_User`.`department_id` = `#__Department`.`id` WHERE `#__Department_User`.`user_id` = ?';\n\t\t$result = $this->execute($sql, $this->id);\n\n\t\tif (count($result) > 0) {\n\t\t\t$return[$result[0]['id']] = $result[0];\n\t\t}\n\t\treturn $return;\n\t}", "public function getDepartment() { \n if(!$this->department || !$this->department->department)\n return false;\n\n return $this->department->department;\n }", "public function getDepartment(): ?string\n {\n return $this->Department;\n }", "public function getIdDepartment()\n {\n return $this->id_department;\n }", "public function department() {\n\t\treturn $this->has_many_and_belongs_to('Department', 'department_members');\n\t}", "function getDepartment($abbrev){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n\r\n $dept = $data->getDepartment($abbrev);\r\n $deptId = $dept[0][\"department_id\"];\r\n $programs = $data->getProgramsInDepartment($deptId);\r\n\r\n $output = array(\"deptInfo\"=>$dept, \"programs\"=>$programs);\r\n return $output;\r\n }", "function GetDepartment($departmentId)\n\t{\n\t\t$result = $this->sendRequest(\"GetDepartment\", array(\"DepartmentId\"=>$departmentId));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function getDepartmentList() {\n return $this->_get(2);\n }", "public function getDeptBased()\n { \n $curr_usr = $this->username;\n\n $this->db->select(\"dm_dept_code, dm_dept_code||' - '||dm_dept_desc as dp_code_desc\");\n $this->db->from(\"ims_hris.department_main\");\n $this->db->where(\"COALESCE(dm_status,'INACTIVE') = 'ACTIVE'\");\n $this->db->where(\"dm_level IN (1,2)\");\n $this->db->where(\"dm_dept_code = (select sm_dept_code from ims_hris.staff_main where upper(sm_apps_username) = '$curr_usr')\");\n $this->db->order_by(\"dm_dept_code\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "public function getHospitalDepartment($globalUtil,$condition){\n\t\t$sql = \"SELECT * FROM \".TABLE_HOSPITAL_DEPARTMENT_INFORMATION.\" \".$condition;\n\t\t$HospitalDeptDetails = $globalUtil->sqlFetchRowsAssoc($sql,2);\t\n\t\treturn $HospitalDeptDetails;\n\t\t}", "public function department()\n\t{\n\t\treturn $this->belongsTo('PanicHD\\PanicHD\\Models\\Department');\n\t}", "public function getDepartment()\n {\n $option = Paging::normalizeOption($_GET);\n $result = DepartmentTable::get($option);\n //$result = Paging::genNextPrev($option, $result);\n\n http_response_code(200);\n echo json_encode($result);\n }", "public function getDepartmentByID($id) {\n $department = Department::find($id);\n if (is_null($department)) {\n return response()->json([\n 'success' => false,\n 'statusCode' => 404,\n 'message' => 'Department not found']);\n }\n return response()->json([\n 'success' => true,\n 'statusCode' => 200,\n 'message' => 'Successfully retrieved clearance department',\n 'data' => $department::find($id)]);\n }", "public function get_dept()\n\t{\n\t\t$division_id = $this->input->post('division_id');\n\t\t$department['dept'] = $this->reports->get_dept($division_id);\n\t\techo json_encode($department);\n\t}", "public function getDepartment($departmentId)\r\n\t{\r\n $departmentService = new Base_Model_ObtorLib_App_Core_Catalog_Service_Department();\r\n return $departmentService->getDepartment($departmentId);\r\n\t}", "public function getDeptName()\n {\n return $this->hasOne(Department::className(), ['dept_name' => 'dept_name']);\n }", "public function fetch_cm_department($CM_COMPLAINT_TYPE){\n\t\t$this->db->distinct('DEP_DESC');\n\t\t$this->db->select('DEP_DESC');\n\t\t$this->db->join('MJ_USER_COMP_TYPE_AUTH M','M.MJ_UCTA_DEPID=A.DEP_ID');\n\t\t$this->db->where('M.MJ_CC_NO',$CM_COMPLAINT_TYPE);\n\t\t$query = $this->db->get('ALL_DEP_MST A');\n \t\t$row = $query->row();\n\t\tif (isset($row))\n\t\t return $row->DEP_DESC;\n\t}", "public function getDepartmentId()\n\t{\n\t\treturn $this->departmentId;\n\t}", "public function getAllDepartmentInfo(){\n $LOG = Logger::getLogger(__CLASS__ . '.' . __FUNCTION__);\n\n $dao = new LabInspectionSummaryReportDAO();\n $min_year = $this->getMinimumReportYear();\n $departments = $dao->getDepartmentDetails(null, $min_year);\n\n return $departments;\n }", "public function get_dept()\n\t{\n\t\t$division_id = $this->input->post('division_id');\n\t\t$department['dept'] = $this->file_maintenance_model->get_dept($division_id);\n\t\techo json_encode($department);\n\t}", "public function getDepa()\n {\n return $this->hasOne(\\common\\models\\masters\\Departamentos::className(), ['id' => 'depa_id']);\n }", "public function department() {\n return $this->belongsTo(Department::class);\n }", "public function department()\n {\n return $this->belongsTo(Department::class);\n }", "public function department()\n {\n return $this->belongsTo(Department::class);\n }", "public function department()\n {\n return $this->belongsTo(Department::class);\n }", "public function department()\n {\n return $this->belongsTo('App\\Models\\core\\Department', 'department_id');\n }", "public function getdep()\n {\n $query = $this->db->get('departments');\n\n return $query->result();\n }", "public function getDepa()\n {\n return $this->hasOne(Departamentos::className(), ['id' => 'depa_id']);\n }", "function getDept($did)\n {\n $db = Database::getInstance();\n $mysqli = $db->getConnection();\n $query = \"SELECT * FROM departments where did='\".$did.\"'\";\n $stmt = $mysqli->query($query);\n\n return $stmt;\n \n }", "public function getDepartamento(){\n\n if (!empty($this->iCodigoDepartamento)) {\n $this->oDepartamento = DBDepartamentoRepository::getDBDepartamentoByCodigo($this->iCodigoDepartamento);\n }\n return $this->oDepartamento;\n }", "public function getDeptOne()\n\t\t{\n\t\t\treturn $this->hasOne(Dept::className(), ['DEP_ID' => 'DEP_ID']);\n\t\t}", "public function getCompanyDepartmentById($companyId, $departmentId)\n {\n $companyDepartment = Department::select('id', 'name')->find($departmentId);\n if ($companyDepartment) {\n $response_message = array('success' => true, 'message' => \"Data fetched\", 'data' => $companyDepartment);\n return response()->json($response_message);\n } else {\n $response_message = array('success' => false, 'message' => \"Department not found\");\n return response()->json($response_message);\n }\n \n \n }", "function getDepartmentsByUsername(){\n if(Current_User::isDeity()){\n $db = &new PHPWS_DB('sysinventory_department');\n $db->addColumn('description');\n $db->addColumn('id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n return $list;\n // otherwise return a list of departments of which they're an admin \n }else if(Current_User::allow('sysinventory','admin')){\n $db = new PHPWS_DB('sysinventory_admin');\n $db->addWhere('username',Current_User::getUsername(),'ILIKE');\n $db->addJoin('left outer','sysinventory_admin','sysinventory_department','department_id','id');\n $db->addColumn('sysinventory_department.description');\n $db->addColumn('sysinventory_department.id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n \n return $list;\n }else{\n return NULL;\n }\n \n }", "function getDepartmentsByUsername(){\n if(Current_User::isDeity()){\n $db = &new PHPWS_DB('sysinventory_department');\n $db->addColumn('description');\n $db->addColumn('id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n return $list;\n // otherwise return a list of departments of which they're an admin \n }else if(Current_User::allow('sysinventory','admin')){\n $db = new PHPWS_DB('sysinventory_admin');\n $db->addWhere('username',Current_User::getUsername(),'ILIKE');\n $db->addJoin('left outer','sysinventory_admin','sysinventory_department','department_id','id');\n $db->addColumn('sysinventory_department.description');\n $db->addColumn('sysinventory_department.id');\n $list = $db->select();\n\n if (PEAR::isError($list)){\n PHPWS_Error::log($list);\n }\n \n return $list;\n }else{\n return NULL;\n }\n \n }", "public function getDepartments() {\n //but if none, get from db\n if(null==$this->departments){\n $mapper=new Application_Model_DirectoryDepartmentMapper();\n $departments=$mapper->fetchAll();\n $options=array();\n foreach($departments as $department){\n $options[]=$department->getName();\n }\n $this->departments=$options;\n }\n return $this->departments;\n }", "public function getEquipmentDepartment()\n {\n return $this->hasOne(Equipment::className(), ['equipment_department' => 'equipment_department']);\n }", "public function setDepartment($department){\r\n\t \r\n\t return $this;\r\n\t}", "public function get_department(){\n\t\t\t$this->db->select('*');\n\t\t\t$this->db->from('department');\n\t\t\t$this->db->where('status', '1');\n\t\t\t$order_by = 'name';\n\t\t\t$order_by_ad = 'asc';\n\t\t\t$this->db->order_by($order_by, $order_by_ad);\t\n\t\t\t$query = $this->db->get();\t\t\t\n\t\t\treturn $query->result_array();\t\n\t\t}", "public function getDepartementById($id){\n\t\t$req=$this->db->prepare(\n\t\t\t'SELECT * FROM departement where dep_num = :id'\n\t\t);\n\t\t$req->bindValue(':id',$id,PDO::PARAM_STR);\n\t\t$req->execute();\n\t\t$res=$req->fetch(PDO::FETCH_OBJ);\n\t\treturn new Departement($res);\n\t\t$req->closeCursor();\n\t}", "public function dept()\n {\n return $this->belongsTo('App\\Department','dept_id','id');\n }", "public function department()\n {\n return $this->belongsTo('App\\Department');\n }", "public function department()\n {\n return $this->belongsTo('App\\Department');\n }", "public function department()\n {\n return $this->belongsTo('App\\Department');\n }", "public function department()\n {\n return $this->belongsTo('App\\Department');\n }", "public function departemen()\n {\n //Query untuk mengambil semua data departemen dan diurutkan berdasarkan nama_dept\n $query = $this->db->query(\"SELECT * FROM departemen ORDER BY nama_dept\");\n return $query;\n }", "function GetDepartments()\n\t{\n\t\t$result = $this->sendRequest(\"GetDepartments\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function hasDepartment() {\n return $this->_has(2);\n }", "public function userDepartment()\n {\n return $this->belongsTo('PanicHD\\PanicHD\\Models\\Department', 'ticketit_department', 'id');\n }", "function getDepartmentById($id){\n\t$suppierarr = getRowAsArray(\"SELECT departmentname FROM department WHERE id='\".$id.\"' \");\n\t\n\treturn $suppierarr['departmentname'];\n}", "public function department()\n {\n return $this->belongsTo('App\\Models\\Department','department_code','department_code');\n }", "function getAllDept(){\r\n echo\r\n $query = \"SELECT dept_name,dept_id FROM department\";\r\n $result = $this->executeQuery($query); \r\n return $result;\r\n }", "public function department()\n {\n return $this->belongsTo(Department::class,'d_id');\n }", "public function obtenerDepartamento()\n {\n return $this->hasOne('App\\Departamento', 'id', 'departamento_id')->first();\n }", "function getAllDepartments() {\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllDepartments();\r\n }", "protected function page_department()\n {\n return view('page.department.page_department');\n }", "function departments($departmentId) {\n\n\t\t// INFORMACION RESPONSABLE\n $detailsDepartment = \"https://intranet.idex.cc/rest/117/w0qdwl5fbr0hpuf1/department.get?ID=\".$departmentId;\n // OBTIENE LA RESPUESTA DE LA API REST BITRIX\n $responseAPI = file_get_contents($detailsDepartment);\n\n // CAMPOS DE LA RESPUESTA\n $department = json_decode($responseAPI, true);\n // FIN INFORMACION RESPOSABLE\n return $department[\"result\"];\t\t\n\t}", "public function getDepartamento() {\n\n if (empty($this->oDBDepartamento) && !empty($this->iCodigoDepartamento)) {\n $this->oDBDepartamento = DBDepartamentoRepository::getDBDepartamentoByCodigo($this->iCodigoDepartamento);\n }\n return $this->oDBDepartamento;\n }", "public function getProxyDepartmentId()\n {\n $value = $this->get(self::PROXYDEPARTMENTID);\n return $value === null ? (string)$value : $value;\n }", "public function show(Department $department)\n {\n \n }", "public function getDepartmentById($param)\n {\n $id = $param['id'];\n\n $result = DepartmentTable::getById($id);\n\n if ($result !== null) {\n http_response_code(200);\n echo json_encode($result);\n } else {\n http_response_code(404);\n echo json_encode(array(\n 'message' => Constant::notFoundText . Constant::objectNames['department']\n ));\n }\n }", "public function getDepartement()\n {\n return $this->departement;\n }", "public static function find($id) {\n if ($id != null) {\n $rows = DB::query('SELECT * FROM Department WHERE id = :id LIMIT 1', array('id' => $id));\n\n if (count($rows) > 0) {\n $row = $rows[0];\n\n $department = self::create_department($row);\n }\n\n return $department;\n } else {\n return null;\n }\n }", "function get_departemen()\r\n{\r\n\t$ci = & get_instance();\r\n\t$ci->load->database();\r\n\t$query = $ci->db->query('select kddept, nmdept '.\r\n\t\t\t\t\t\t\t 'from t_dept '.\r\n\t\t\t\t\t\t\t 'order by kddept');\r\n\tif($query->result()):\r\n\t\treturn $query->result();\r\n\telse:\r\n\t\treturn false;\r\n\tendif;\r\n}", "public function std_list_accro_dept($dept_name){\n $query = $this->db->get_where('msit_tb_student_info',array('std_dept' =>$dept_name));\n return $query->result();\n }", "public function getDepartment($dep_id_pri = null) {\n $this->db->select('*');\n $this->db->from('department');\n if ($dep_id_pri != null) {\n $this->db->where('department.dep_id_pri', $dep_id_pri);\n }\n $this->db->order_by('department.dep_id');\n $this->db->order_by('department.dep_id_pri');\n return $this->db->get();\n }", "function getdepartments() {\n\t\t// import department db\n\t\tApp::import('Model','Department');\n\t\t$this->Department = & new Department();\n\t\t# fetch list of active departments \n\t\t$departments_list = $this->Department->find('list',array('conditions'=>array('Department.status'=>'1'),'fields'=>array('id','name'),'limit'=>10,'order'=>array('Department.id')));\n\t\treturn $departments_list;\n\t}", "public function getDepartamento(PropelPDO $con = null)\n\t{\n\t\tif ($this->aDepartamento === null && ($this->departamento_id !== null)) {\n\t\t\t$this->aDepartamento = DepartamentoQuery::create()->findPk($this->departamento_id, $con);\n\t\t\t/* The following can be used additionally to\n\t\t\t\tguarantee the related object contains a reference\n\t\t\t\tto this object. This level of coupling may, however, be\n\t\t\t\tundesirable since it could result in an only partially populated collection\n\t\t\t\tin the referenced object.\n\t\t\t\t$this->aDepartamento->addUsuarios($this);\n\t\t\t */\n\t\t}\n\t\treturn $this->aDepartamento;\n\t}", "public function get_dep()\n {\n $token = $this->CI->input->get_request_header('Authorization', TRUE);\n $token_json = base64_decode($token);\n $token = json_decode($token_json);\n $dep_id = $token->deptId;\n return $dep_id;\n }", "public function GetAllDepartments()\r\n\t{\t\r\n\t\t$WhereCondition = \"\";\r\n\t\t$query = $this->db->query(\" \t\r\n\t\t\t\t\t\t\t\t\tSELECT * FROM `tbl_user_department`\r\n\t\t\t\t\t\t\t\t\");\r\n\t\t$result = $query->result_array();\t\t\t\r\n\t\treturn $result;\r\n\t}", "public function getCompany() {\n if(!$this->department || !$this->department->department || !$this->department->department->division || !$this->department->department->division->company)\n return false;\n\n return $this->department->department->division->company;\n }", "public function departments()\r\n {\r\n return new QueryForDepartments();\r\n }", "public function get_dept()\n {\n $pid = cleanit($this->input->post('pid'));\n $sid = cleanit($this->input->post('sid'));\n $this->db->where(\"program\", $pid);\n $this->db->where(\"school_id\", $sid);\n $dept = $this->db->get(\"departments\")->result_array();\n header('Content-type: text/json');\n header('Content-type: application/json');\n echo json_encode($dept);\n exit;\n }", "public function show(Department $department)\n {\n }", "public function departament()\n {\n return $this->hasOne(Departamento::class, 'id', 'departament_id');\n }", "public function getDeptsub()\n\t\t{\n\t\t\treturn $this->hasOne(Deptsub::className(), ['DEP_SUB_ID' => 'DEP_SUB_ID']);\n\t\t}", "public function getDeptItems()\n {\n return $this->hasMany(DeptItem::className(), ['sales_disc_gl_acc_id' => 'account_id']);\n }", "function get_departments() {\r\n switch_to_blog(1);\r\n $depts = get_terms([\r\n 'taxonomy' => 'dept',\r\n 'hide_empty' => false,\r\n ]);\r\n restore_current_blog();\r\n\r\n if( !is_array( $depts ) || empty( $depts ) ) {\r\n $url = \"https://news.cah.ucf.edu/wp-json/news/depts\";\r\n $response = wp_remote_get( $url, ['timeout' => 20] );\r\n if( is_wp_error( $response ) ) {\r\n $depts = [];\r\n }\r\n else {\r\n $depts = json_decode( $response['body'] );\r\n }\r\n }\r\n return $depts;\r\n}", "public function dept_choice(){\n $outputs = array();\n $dept_type = (new TbMsCmnCdModel())->getCdKeyY(TbMsCmnCdModel::$department_type_cd_pre);\n $outputs['dept_type'] = $this->arrKeyVal2NewArr($dept_type);\n $dept_status = TbHrDeptModel::getStatusForDept();\n $outputs['dept_status'] = $this->arrKeyVal2NewArr($dept_status);\n $dept_incharge = TbHrDeptModel::getTypeForEDRelation();\n $outputs['dept_incharge'] = $this->arrKeyVal2NewArr($dept_incharge);\n\n return $outputs;\n }", "public function getEmpDep($dept){\n\t\t$this->db->select('DEP_DESC');\n\t\t$this->db->from('ALL_DEP_MST');\n\t\t$this->db->where('DEP_ID',$dept);\n\t\t$query = $this->db->get();\n\t\tif($query->num_rows() > 0) \n\t\t\t\treturn $query->row()->DEP_DESC;\n\t\t\telse\n\t\t\t\treturn '0';\n\n\t}", "public function show(Department $department)\n {\n //\n }", "public function show(Department $department)\n {\n //\n }", "public function show(Department $department)\n {\n //\n }", "public function show(Department $department)\n {\n //\n }", "public function getDepartamento()\n {\n return $this->departamento;\n }", "public function getDepartamento()\n {\n return $this->departamento;\n }", "public function departments()\n {\n $this->authCheck();\n\n $departmentData = DB::table('departments')\n ->get();\n \n $departments=view('admin.department_list')\n ->with('departmentData',$departmentData);\n\n return view('admin.master')\n ->with('main_content',$departments);\n }", "public function get_department_selector($selectedepartment = null) {\n global $OUTPUT, $DB;\n\n // Get departments.\n $departments = array();\n $rows = $DB->get_records_sql(\n 'SELECT UPPER(department) AS department FROM {user} GROUP BY UPPER(department) ORDER BY department');\n foreach ($rows as $row) {\n if ($row->department && preg_match('/^\\d+/', $row->department)) {\n $departments[$row->department] = $row->department;\n }\n }\n\n // Sort by digits at the start of homeroom.\n uasort(\n $departments,\n function ($a, $b) {\n\n $yeara = intval($a);\n $yearb = intval($b);\n\n $homerooma = substr($a, strlen($yeara));\n $homeroomb = substr($b, strlen($yearb));\n\n if ($yeara === $yearb && $yeara < 6) {\n\n return $homerooma > $homeroomb;\n } else if ($yeara === $yearb) {\n\n $order = array('L', 'E', 'A', 'R', 'N', 'S', 'JS', 'SWA');\n\n if (!in_array($homeroomb, $order)) {\n return $homerooma > $homeroomb;\n } else {\n return array_search($homerooma, $order) > array_search($homeroomb, $order);\n }\n } else {\n return $yeara > $yearb;\n }\n });\n\n $departments = array(\n 0 => get_string('alldepartments', 'block_user_directory')\n ) + $departments;\n\n // Create the <select>.\n $url = $this->userdirectory->get_current_url('department');\n $select = new single_select($url, 'department', $departments, $selectedepartment, null, 'departmentform');\n\n return $OUTPUT->render($select);\n }" ]
[ "0.718407", "0.7162293", "0.68948823", "0.6780472", "0.67788154", "0.6767236", "0.6762305", "0.67605317", "0.6759552", "0.6746991", "0.6655479", "0.6628052", "0.65773016", "0.6529997", "0.64915407", "0.635032", "0.6333378", "0.6327125", "0.6317552", "0.6281144", "0.6275694", "0.6263111", "0.62351394", "0.6232771", "0.6214889", "0.6206938", "0.61939913", "0.61831206", "0.617141", "0.61255187", "0.6101214", "0.60662276", "0.6054018", "0.60508835", "0.60503197", "0.6037667", "0.6037667", "0.6037667", "0.60323167", "0.6011549", "0.6007076", "0.6005148", "0.59981805", "0.59692377", "0.5969107", "0.59533876", "0.59533876", "0.59499675", "0.59446955", "0.593256", "0.5917551", "0.59115446", "0.59108627", "0.5893751", "0.5893751", "0.5893751", "0.5893751", "0.589233", "0.5879779", "0.5877893", "0.586764", "0.5856427", "0.58547634", "0.585186", "0.5827259", "0.5811232", "0.5802086", "0.57956237", "0.57871944", "0.5769968", "0.57477236", "0.5726087", "0.5701201", "0.5670809", "0.56680083", "0.5664878", "0.5659299", "0.56441057", "0.5638652", "0.5638611", "0.5623955", "0.5620759", "0.5612829", "0.5601938", "0.5592684", "0.5585908", "0.5583266", "0.5567915", "0.5558529", "0.55532974", "0.5542189", "0.552691", "0.5526427", "0.5526427", "0.5526427", "0.5526427", "0.5520126", "0.5520126", "0.550411", "0.5503017" ]
0.57915866
68
This method will add a Department for corporate Department
public function addDepartments($parameters) { $this->em = $this->getEntityManager(); $profile = new CorpoDepartments(); $profile->setName($parameters['name']); $profile->setAccountId($parameters['accountId']); $this->em->persist($profile); $this->em->flush(); if ($profile) { return $profile->getId(); } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addDepartment($depName) {\n\n /*\n $dept = new Sysinventory_Department();\n $dept->description = $depName;\n $dept->last_update = mktime();\n $result = $dept->save();\n */\n\n //test($depName,1);\n if (!isset($depName)) return;\n $db = &new PHPWS_DB('sysinventory_department');\n $db->addValue('id','NULL');\n $db->addValue('description',$depName);\n $db->addValue('last_update',time());\n $result = $db->insert();\n }", "public function dept_add_person_for_department(){\n $outputs = array();\n $empl_id = isset($_REQUEST['empl_id'])?$_REQUEST['empl_id']:null;\n $dept_id = isset($_REQUEST['dept_id'])?$_REQUEST['dept_id']:null;\n if(empty($empl_id) or empty($dept_id)){\n $outputs['code'] = 500;\n $outputs['msg'] = 'empty info';\n return $outputs;\n }\n //check exists\n $d_empl = D('TbHrCard')->findOneByEmplId($empl_id);\n $d_dept = D($this->name_dept)->gainSimpleOneDept($dept_id);\n if(empty($d_empl) or empty($d_dept)){\n $outputs['code'] = 500;\n $outputs['msg'] = 'not exists';\n return $outputs;\n }\n\n $status = D($this->name_dept)->addEmployeeToDepartment($empl_id,$dept_id);\n return $outputs;\n }", "public function addDepartment(Request $request) {\n $department = Department::create($request->all());\n return response()->json([\n 'success' => true,\n 'statusCode' => 201,\n 'message' => 'Successfully added clearance department',\n 'data' => $department]);\n }", "public static function addDepartment($input)\n\t{\n if ($input['wpj_no_auto'] == null) {\n $department = new Data_Department_Department;\n $action = Lang::line('global.add')->get();\n $department->suj_cipta_oleh = Auth::user()->su_id;\n } else {\n $department = Data_Department_Department::find($input['wpj_no_auto']);\n $action = Lang::line('global.edit')->get();\n }\n \n $department->suj_jabatan_name = Str::title($input['wpj_jabatan_name']);\n $department->suj_jabatan_desc = $input['wpj_jabatan_desc'];\n $department->suj_kemaskini_oleh = Auth::user()->su_id;\n $department->save();\n\n Log::write(\n\t\t\tLang::line('admin.department')->get(), \n\t\t\t$action.' <strong>'.$input['wpj_jabatan_name'].'</strong> \n\t\t\t'.Lang::line('global.by')->get().' <code>'.Auth::user()->su_username.'</code>'\n\t\t);\n\t\tTrail::log(\n\t\t\tLang::line('admin.department')->get(), \n\t\t\tAuth::user()->su_id, \n\t\t\t$action.' <strong>'.$input['wpj_jabatan_name'].'</strong> \n\t\t\t'.Lang::line('global.by')->get().' <code>'.Auth::user()->su_username.'</code>'\n\t\t);\n }", "public function actionCreate_department() {\n //redirect a user if not super admin\n if (!Yii::$app->CustomComponents->check_permission('department')) {\n return $this->redirect(['site/index']);\n }\n\n $model = new DvUsersDepartment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'New Department Created Successfully');\n return $this->redirect(['dv-users/create_department']);\n } else {\n\n return $this->render('create_department', [ 'model' => $model]);\n }\n }", "function client_add($clientId = null) {\n\t\tApp::import('Model','Department');\n\t\t$this->Department = new Department();\n\t\tif (!empty($this->data)) {\n\t\t\t$aDepartments = array();\n\t\t\tif(!empty($this->data['User']['department_name'])){\n\t\t\t $cDepts = $this->data['User']['department_name'];\t\t \n\t\t\t $this->data['User']['department_name'] = implode(\",\", $cDepts);\n\t\t\t}\n\n\t\t\t$this->data['User']['client_id'] = $this->Auth->user('id');\n\t\t\t$this->data['User']['password'] = $this->Auth->password($this->data['User']['password']);\n\t\t\t$this->User->create();\n\t\t\tif ($this->User->save($this->data)) {\n\n\t\t\t\t$user_id = $this->User->id;\n\t\t\t\t$dept_obj = ClassRegistry::init('DepartmentsUser');\n\t\t\t\t$find_dept = ClassRegistry::init('Department');\n\t\t\t\tif(!empty($cDepts)){\n\t\t\t\t foreach($cDepts as $dept_id)\n\t\t\t\t { \n\t\t\t\t $dept_data['user_id'] = $user_id;\n\t\t\t\t $dept_data['department_id'] = $dept_id;\n\t\t\t\t $dept_name_data = $find_dept->find('first',array('fields'=>'name','conditions'=>array('Department.id'=>$dept_id)));\n\t\t\t\t \n\t\t\t\t $dept_data['department_name'] = $dept_name_data['Department']['name'];\n\t\t\t\t $dept_obj->saveAll($dept_data);\n\n\t\t\t\t //we have to find out department sheets\n\t\t\t\t $sheet_obj = ClassRegistry::init('Sheet');\n\t\t\t\t $sheet_obj->recursive = -1;\n\t\t\t\t $sheet_conditions = array('Sheet.department_id' => $dept_id, 'Sheet.status !=' => 2);\n\t\t\t\t $sheet_array = $sheet_obj->find('all', array('conditions'=>array('Sheet.department_id' => $dept_id, 'Sheet.status !=' => 2)));\n\n\t\t\t\t if(!empty($sheet_array)){\n\t\t\t\t\t foreach($sheet_array as $sheetupdate){\n\t\t\t\t\t //assign users to those sheets\n\t\t\t\t\t $arraytoupdate = $sheetupdate;\n\t\t\t\t\t $arraytoupdate['Sheet']['user_id'] = $arraytoupdate['Sheet']['user_id'].\", \".$user_id;\n\t\t\t\t\t $sheet_obj->save($arraytoupdate);\n\t\t\t\t\t $arraytoupdate = null;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\t$this->Session->setFlash(__('The user has been saved', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->data['User']['password'] = '';\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t}\n\t\t//$clients = $this->User->Client->find('list');\n\t\t$clientId = $this->Auth->user('id'); \t\n\t\t\n\t\t$clientArray = $this->User->getChildHotelsArray($clientId);\n\t\t$clientStr = implode(',', $clientArray);\n\t\t\n\t\t$condition = \"Department.status = 1 AND Department.client_id IN ($clientStr)\";\n\t\t$departments1 = $this->Department->find('all', array('fields'=> 'Department.id, Department.name, Client.hotelname', 'conditions'=>$condition));\n\t\t$departments = array();\n\t\tforeach($departments1 as $dept){\n\t\t\t$departments[$dept['Department']['id']] = $dept['Department']['name'].\" - \".$dept['Client']['hotelname'];\n\t\t}\t \n\t\t$this->set('departments', $departments);\n\n\t\t$this->set(\"clientId\", $clientId);\n\t}", "function addDepartment($name, $school, $institution){\n\n\t\t$this->connection->query(\"INSERT INTO department (dept_name, dept_school, dept_inst) VALUES ('$name', '$school', '$institution')\",true);\n\t\tif($_SESSION['query']){\n\t\t\treturn \"Department Successfully Added\";\n\t\t}else{\n\t\t\treturn \"Failed to add department!\";\t\t\n\t\t}\n\n\t}", "public function addDepartment()\n {\n $facultyId = $_SESSION['facultyId'];\n\n $json = file_get_contents('php://input');\n $obj = json_decode($json);\n\n $fct = array();\n if (property_exists($obj, 'name')) $fct['name'] = $obj->name;\n if (property_exists($obj, 'type')) $fct['type'] = $obj->type;\n if (property_exists($obj, 'address')) $fct['address'] = $obj->office;\n if (property_exists($obj, 'phone')) $fct['phone'] = $obj->phone;\n if (property_exists($obj, 'website')) $fct['website'] = $obj->website;\n $department = new Department($fct);\n\n if (!isset($fct['name']) || $fct['name'] == null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames[\"departmentName\"]) . Constant::isRequiredText\n ));\n return;\n } elseif (!isset($fct['type']) || $fct['type'] == null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Loại \" . Constant::objectNames[\"department\"] . Constant::isRequiredText\n ));\n return;\n } else {\n if($fct['type'] == 4){\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::objectNames[\"facultyOfficer\"]) . Constant::isExistedText\n ));\n return;\n }\n\n foreach ($fct as $key => $value) {\n $action = 'check' . ucfirst($key);\n if (!$department->$action()) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames[$key]) . Constant::invalidText\n ));\n return;\n }\n }\n }\n\n /* if (isset($fct['deanId'])) {\n $deanFacultyId = OfficerTable::getFacultyIdOf($fct['deanId']);\n\n if ($deanFacultyId == null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => 'Dean is not existed'\n ));\n return;\n } elseif ($deanFacultyId != $facultyId) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => 'Dean is officer of other faculty'\n ));\n return;\n\n }\n } */\n\n // Valid now, add department\n $department->setFacultyId($facultyId);\n $result = DepartmentTable::addDepartment($department);\n\n if ($result === false) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Tạo mới \" . Constant::objectNames['department'] . Constant::failed\n ));\n return;\n } else {\n http_response_code(201);\n echo json_encode(array(\n 'id' => $result\n ));\n }\n }", "public function add() {\r\n if ($this->input->server('REQUEST_METHOD') === 'POST') {\r\n //form validation\r\n $this->form_validation->set_rules('dep_name', 'Name', 'trim|required|xss_clean');\r\n\r\n //if the form has passed through the validation\r\n if ($this->form_validation->run()) {\r\n $data_to_store = array(\r\n 'dep_name' => $this->input->post('dep_name')\r\n );\r\n\r\n //if the insert has returned true then we show the flash message\r\n if ($this->Department_model->insert($data_to_store)) {\r\n $this->session->set_flashdata('flash_message', TRUE);\r\n redirect(current_url());\r\n } else {\r\n $this->session->set_flashdata('flash_message', FALSE);\r\n }\r\n } else {\r\n $this->session->set_flashdata('flash_message', FALSE);\r\n }\r\n }\r\n //load the view\r\n $data['content'] = 'admin/departments/add';\r\n $this->load->view('includes/admin_template', $data);\r\n }", "public function store(Request $request)\n { \n $dept = new Department;\n $department = Department::where('department',Input::get('department'))\n ->where('orgId',Input::get('organisation'))\n ->where('officeId',Input::get('office'))\n ->first();\n \n if(empty($department))\n {\n $dept->department = Input::get('department'); \n $dept->numberOfEmployees = Input::get('noOfEmp');\n $dept->orgId = Input::get('organisation');\n $dept->officeId = Input::get('office');\n $dept->status = 'Active';\n $dept->lead_name = Input::get('lead_name');\n $dept->lead_email = Input::get('lead_email');\n $dept->lead_mobile = Input::get('lead_mobile'); \n $dept->created_at = date('Y-m-d H:i:s');\n\n $dept->save();\n $insertedId = $dept->id;\n\n //redirect('admin/organisation');\n return \\Redirect::route('department.index')->with(['message'=>'Department added successfully.']);\n }\n else\n {\n return \\Redirect::route('department.index')->with(['message'=>'Department already exists.']);\n\n }\n }", "public function addDepartment() {\n /* get job title from db contract array */\n $department = $this->db2->table('hr_department')->select('id', 'department')->get();\n //return $jobQuery; \n return View::make('settings/department.department')->with(array('departmentList' => $department));\n }", "function addNewDepartment(Request $request)\n {\n if(Auth::permition()->edit_item != 1){\n abort(403);\n }\n\n $department = new department;\n $department->name = 'Název katedry';\n $department->short = '_ZK';\n $check = $department->save();\n\n return back()->withInput(array('saveCheck' => $check));\n\n }", "public function saveDepartment()\n {\n \t$response = Curl::to('http://api.dev.tawasul.shurooq.gov.ae/api/departments')\n ->withData( array( 'key' => 'ADF767DGH' ) )\n ->asJson()\n ->get();\n \n\n foreach ($response as $key => $res) {\n \t$departmentName = $res->Department;\n \n \t$departmentDetails = DepartmentTranslation::where('name', $departmentName )->get();\n\n if($departmentDetails->count() == 0)\n {\n $department = new Department;\n \n\n $department->status = 'Active';\n $department->save();\n $department_id = $department->id;\n\n foreach ($this->lang_locales as $locale) {\n $departmentDetails = new DepartmentTranslation;\n $departmentDetails->department_id = $department->id;\n $departmentDetails->locale = $locale->code;\n $departmentDetails->name = $departmentName;\n $departmentDetails->save();\n }\n \n }\n }\n\n }", "public function store(DepartmentRequest $request)\n {\n //save the data to the database\n $department = new Department ;\n $department->name = $request->name;\n $department->save();\n }", "public function createDepartment(){\n\t\t$incomingFormData = $this->readHttpRequest();\n\t\t$formData = json_decode($incomingFormData);\n\t\t$createResult = $this->department_model->createDepartment($formData);\n\t\t$depListFlag = 1;\n\t\t$departmentList = $this->index($depListFlag); // call department List\n\t\tif($createResult == true){\n\t\t\t$data['status'] = 'ok';\n\t\t}else{\n\t\t\t$data['status'] = 'fail';\n\t\t}\n\t\t$data['departmentList'] = $departmentList;\n\t\techo json_encode($data);\n\t\t\n\t}", "public function addDepartments(Request $request)\n {\n\n $model = new mainModel();\n $departmentName = $request->department_name;\n $UserId = $request->session()->get('userid');\n $timaestamp = date(\"Y-m-d H:i:s\");\n $data['DEPARTMENT_NAME'] = $departmentName;\n $data['CREATED_BY'] = $UserId;\n $data['CREATED_AT'] = $timaestamp;\n $data['FLAG'] = 'Show';\n $response = $model->addDepartments($data);\n return $response;\n }", "public function proses_create_department(Request $request){\n // Membuat object class model Department dengan nama variabel $department.\n $department = new Department;\n // Mengisi atribut nama pada tabel departments yang direpresentasikan oleh property nama \n // pada object $department dengan nilai nama pada form yang ditangkap oleh variabel $request.\n $department->nama = $request->nama;\n // Menyimpan data department ke database.\n $department->save();\n\n // Mengalihkan pengguna ke URL /department.\n return redirect('/department');\n }", "function makeDepartment($department){\n sqlQuery(\"INSERT INTO departments (department_name) VALUES ('$department')\");\n alog(\"Added department $department\");\n}", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'department_name' => 'required',\n\t\t);\n\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\t$msg = array(\n\t\t\t'code' => Config::get('errorcode.department_add'),\n\t\t\t'error'=> Lang::get('error.department_add')\n\t\t);\n\t\tif ($validator->fails()) {\n\t\t\treturn Response::json($msg);\n\t\t} else {\n\t\t\t$now = time();\n\t\t\t$department = new Department;\n\t\t\t$department->department_name = trim(Input::get('department_name'));\n\t\t\t$department->organization_id = Auth::user()->organization_id;\n\t\t\t\n\t\t\tif ($department->save()) {\n\t\t\t\treturn Response::json(array('msg' => Lang::get('basic.create_success')));\n\t\t\t} else {\n\t\t\t\treturn Response::json($msg);\n\t\t\t}\n\t\t}\n\t}", "function admin_add($clientId = null) {\n// \t\tApp::import('Model','DepartmentUser');\n\t\tif (!empty($this->data)) {\n\t\t\n\t\t$client_id = $this->data['User']['client_id'];\t\t\n\t\t$aDepartments = array();\n\t\tif(!empty($this->data['department_name'])){\n\t\t $cDepts = $this->data['department_name'];\t\t \n\t\t $this->data['User']['department_name'] = implode(\",\", $cDepts);\n\t\t}\n\t\t$this->User->create();\n\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$user_id = $this->User->id;\n\t\t\t\t$dept_obj = ClassRegistry::init('DepartmentsUser');\n\t\t\t\t$find_dept = ClassRegistry::init('Department');\n\t\t\t\tif(!empty($this->data['department_name'])){\n\t\t\t\t foreach($this->data['department_name'] as $dept_id)\n\t\t\t\t { \n\t\t\t\t $dept_data['user_id'] = $user_id;\n\t\t\t\t $dept_data['department_id'] = $dept_id;\n\t\t\t\t $dept_name_data = $find_dept->find('first',array('fields'=>'name','conditions'=>array('Department.id'=>$dept_id)));\n\t\t\t\t \n\t\t\t\t $dept_data['department_name'] = $dept_name_data['Department']['name'];\n\t\t\t\t $dept_obj->saveAll($dept_data);\n\n\n\t\t\t\t //we have to find out department sheets\n\t\t\t\t $sheet_obj = ClassRegistry::init('Sheet');\n\t\t\t\t $sheet_obj->recursive = -1;\n\t\t\t\t $sheet_conditions = array('Sheet.department_id' => $dept_id, 'Sheet.status !=' => 2);\n\t\t\t\t $sheet_array = $sheet_obj->find('all', array('conditions'=>array('Sheet.department_id' => $dept_id, 'Sheet.status !=' => 2)));\n\n\t\t\t\t if(!empty($sheet_array)){\n\t\t\t\t\t foreach($sheet_array as $sheetupdate){\n\t\t\t\t\t //assign users to those sheets\n\t\t\t\t\t $arraytoupdate = $sheetupdate;\n\t\t\t\t\t $arraytoupdate['Sheet']['user_id'] = $arraytoupdate['Sheet']['user_id'].\", \".$user_id;\n\t\t\t\t\t $sheet_obj->save($arraytoupdate);\n\t\t\t\t\t $arraytoupdate = null;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\t$this->Session->setFlash(__('The user has been saved', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->data['User']['password'] = '';\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t}\n\t\t$this->User->Client->recursive = -1;\n\t\t$clientArray = $this->User->Client->find('all',array('conditions'=>array('Client.status !='=>2)));\n\n\t\t$clients = array();\n\t\tforeach($clientArray as $client){\n\t\t\t$clients[$client['Client']['id']] = $client['Client']['hotelname'];\n\t\t}\n\n\t\tasort($clients);\n\n\t\t$departments = array();\n\t\t$departments[0] = 'Select Department';\n\t \n\t\t$this->set('departments', $departments);\n\n\t\t$this->set(compact('clients', 'clientId'));\n\t\t\n\t}", "function erp_hr_create_department( $args = array() ) {\n\n $defaults = array(\n 'id' => 0,\n 'title' => '',\n 'description' => '',\n 'lead' => 0,\n 'parent' => 0,\n 'status' => 1\n );\n\n $fields = wp_parse_args( $args, $defaults );\n\n // validation\n if ( empty( $fields['title'] ) ) {\n return new WP_Error( 'no-name', __( 'No department name provided.', 'wp-erp' ) );\n }\n\n // unset the department id\n $dept_id = $fields['id'];\n unset( $fields['id'] );\n\n $department = new \\WeDevs\\ERP\\HRM\\Models\\Department();\n\n if ( ! $dept_id ) {\n $dept = $department->create( $fields );\n\n do_action( 'erp_hr_dept_new', $dept->id, $fields );\n\n return $dept->id;\n\n } else {\n\n $department->find( $dept_id )->update( $fields );\n\n do_action( 'erp_hr_dept_updated', $dept_id, $fields );\n\n return $dept_id;\n }\n\n return false;\n}", "public function add_department_officer()\n {\n if (validate('save_department_officer') == FALSE) {\n $return_data = array(\n 'status' => false,\n 'message' => 'Some fields have errors.',\n 'fields' => validation_error_array()\n );\n } else {\n $locID = get_post('DepartmentLocationID');\n $DepartmentID = get_post('DepartmentID');\n $SubDepartmentID = (int) get_post('SubDepartmentID');\n $accountID = get_post('SelectedAccountID');\n $functionTypeID = (int) get_post('FunctionTypeID');\n $position = get_post('Position');\n\n // find by data\n $officerWhere = array(\n 'DepartmentID' => $DepartmentID,\n 'SubDepartmentID' => $SubDepartmentID, \n 'DepartmentLocationID' => $locID,\n 'AccountID' => $accountID,\n 'FunctionTypeID' => $functionTypeID\n );\n $officer = $this->mgovdb->getRecords('Dept_Officers', $officerWhere, 'id', array(1));\n if (count($officer)) {\n $officer = (object) $officer[0];\n }\n\n if ($officer == false) {\n // new record\n $insertData = array(\n 'DepartmentID' => $DepartmentID,\n 'SubDepartmentID' => $SubDepartmentID,\n 'DepartmentLocationID' => $locID,\n 'AccountID' => $accountID,\n 'FunctionTypeID' => $functionTypeID,\n 'Position' => $position,\n 'LastUpdate' => date('Y-m-d H:i:s')\n );\n\n if (($ID = $this->mgovdb->saveData('Dept_Officers', $insertData))) {\n usleep(100);//minor delay fetch after add\n $return_data = array(\n 'status' => true,\n 'message' => 'Department officer has been assigned successfully.',\n 'id' => $ID,\n 'data' => $this->departmentdb->getDepartmentOfficer($ID, 'id')\n );\n\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'Assigning department officer failed. Please try again.'\n );\n }\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'Officer already assigned on this deparment with the same function.',\n );\n }\n\n }\n\n response_json($return_data);\n }", "public function createDepartment() {\n $user = auth()->user();\n if($user == null || ($user->role_id != _CONST::ADMIN_ROLE_ID && $user->role_id != _CONST::SUB_ADMIN_ROLE_ID)) {\n return redirect('/login');\n }\n\n $employee = $user->Employee;\n $theme = $user->theme;\n $heading = [\"vietnamese\" => \"Tạo mới khoa\", \"english\" => \"Dashboard\"];\n\n return view('admin.web.department.create')->with([\n 'user' => $user,\n 'theme' => $theme,\n 'employee' => $employee,\n 'heading' => $heading,\n ]);\n }", "public function store(DepartmentRequest $request)\n {\n return response()->save($this->repository->create($request));\n }", "function insert(Request $request) \n {\n $validatedData = $request->validate([\n 'department_name' => 'required',\n 'department_desc' => 'required',\n 'is_active' => 'required',\n ]);\n\n \t$department = new Department;\n if (session()->get('session_superadmin') == 1) {\n $validatedData = $request->validate([\n 'id_country' => 'required',\n ]);\n $department->id_country = $request->id_country;\n }else{\n $department->id_country = session()->get('session_country');\n }\n $department->department_name = $request->department_name; \n\t\t$department->department_desc = $request->department_desc; \n\t\t$department->email = $request->email;\n $department->head_of_department = $request->head_of_department;\n $department->manager = $request->manager;\n $department->flag_designated = $request->flag_designated;\n $department->flag_external = $request->flag_external;\n $department->is_active = $request->is_active;\n $department->created_by = session()->get('session_name'); \n \t$department->save();\n\n $request->session()->flash('alert-success', 'New department has been added successfully!');\n\n \treturn redirect('department');\n }", "public function store(Request $request)\n {\n $request->validate([\n 'department'=>'required',\n ]);\n $data = $request->all();\n $result = DepartmentModel::create($data);\n if($result){\n return redirect()->back()->with('message','Successfully added.');\n }else{\n return 'Error';\n }\n }", "public function addDepartment(\\obiba\\mica\\LocalizedStringDto $value) {\n return $this->_add(2, $value);\n }", "public function store(DepartmentRequest $request)\n {\n $data = [\n 'message' => '',\n 'data' => null,\n ];\n\n $dep = Department::create([\n 'name' => $request->name,\n ]);\n\n if ($dep)\n {\n $data['message'] = 'success';\n return response()->json($data, 200);\n }\n else\n {\n $data['message'] = 'error';\n return response()->json($data, 500);\n }\n }", "public function store(Request $request)\n {\n $department = new Department();\n $department->country_id = $request->input('country_id');\n $department->department_name = ucwords($request->input('department_name'));\n $department->save();\n\n $just_saved_dept_id = $department->id;\n\n $user = new User();\n $user->name = strtoupper($request->input('name'));\n $user->email = $request->input('email');\n $user->dept_id = $just_saved_dept_id;\n $password = strtolower(str_random(8));\n $user->password = Hash::make($password);\n $user->save();\n\n $just_saved_user_id = $user->id;\n\n $invite_mail = new InviteMail();\n $invite_mail->panelist_name = $user->name;\n $invite_mail->panelist_email = $user->email;\n $invite_mail->message = \"You have been added as a functional head for department \" . ucwords($request->input('department_name')) .\n \" You can login to Wananchi HR Recruitment Portal using your email address \" . $user->email . \" and your password is \" . $password;\n\n $invite_mail->save();\n\n $user_role = array(\n 'model_id' => $just_saved_user_id,\n 'role_id' => 3\n );\n $save_user_role = DB::table('model_has_roles')->insertGetId($user_role);\n\n Toastr::success('Department added successfully');\n return back();\n }", "public function store(Request $request)\n {\n $request->validate([\n 'department_name' => 'required',\n 'department_status' => 'required'\n ]);\n \n \n Department::create($request->all()); \n \n return redirect()->route('department.index')\n ->with('success','Department Added Successfully.');\n }", "public function store(Request $request)\n {\n $request->validate([\n 'department_title' => 'required',\n 'department_description' => 'required',\n ]);\n $department = new Department;\n $department->department_title = $request->department_title;\n $department->department_description = $request->department_description;\n $department->save();\n if($department){\n return back()->with('message','Department added successfully');\n }\n else{\n return back()->with('message','Error in adding Department');\n }\n }", "public function testSetDepartment()\n {\n\n // new entity\n $team = new Team();\n\n // dummy entity\n $department = new Department();\n $department->setName('NTNU');\n\n // Use the setDepartment method\n $team->setDepartment($department);\n\n // Assert the result\n $this->assertEquals($department, $team->getDepartment());\n }", "private function addDepartments($email, $departments)\r\n {\r\n foreach ($departments as $departmentid)\r\n {\r\n $sqlQuery = \"INSERT INTO user_department (useremail, departmentid) VALUES ('$email', $departmentid)\";\r\n $this->_dbHandle->exec($sqlQuery);\r\n }\r\n }", "public function store(Request $request)\n {\n $this->abort_if_not_permited();\n $data = $this->validate($request, [\n 'department' => 'required',\n 'department_code' => 'required',\n ]);\n\n return Department::create($data);\n }", "public function create($departamentoid)\n {\n \n }", "public function insertHospitalDepartment($globalUtil,$data){\n\t\t\t\n\t\t\t$data_dept_details=$data;\n\t\t\tif($globalUtil->sqlinsert($data_dept_details,TABLE_HOSPITAL_DEPARTMENT_INFORMATION)){\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function store()\n\t{\n\t\t$input = Input::only('department_id', 'department_name');\n\n\t\ttry {\n\t\t\t$this->addDepartmentForm->validate($input);\n\t\t}\n\t\tcatch(FormValidationException $error) {\n\t\t\treturn Redirect::back()->withInput()->withErrors($error->getErrors());\n\t\t}\n\n\t\textract($input);\n\n\t\t$registration = $this->execute(new AddDepartmentCommand($department_id, $department_name));\n\n\t\tif($registration) {\n\t\t\tFlash::success('Account for ' . $department_name . ' department has been successfully created! <a href=\"' . URL::route('departments.index') . '\"> View list of departments.</a>');\n\t\t}\n\t\telse {\n\t\t\tFlash::error('Failed to create account for ' . $department_name . ' department!');\n\t\t}\n\n\t\treturn Redirect::route('departments.create');\n\t}", "public function store(DepartmentRequest $request)\n {\n //\n $model = new Department();\n $model->name = $request->txtName; \n $model->save();\n return redirect()->route('admin.department.index')->with('success','Posted completely!');\n }", "public function store()\n\t{\n\t\t$department = new Department();\n\t\t$department->name \t\t\t\t= Input::get('name');\n\t\tif($department->save())\n\t\t\treturn Redirect::back()->with(['flash_message'=>'Department successfully created','msgtype'=>'success']);\n\t}", "public function store(Requests\\DepartmentRequest $request)\n {\n DB::transaction(function () use ($request) {\n $department = Department::create([\n 'keyword' => $request->get('keyword'),\n 'url' => $request->get('url'),\n 'image' => $request->file('image')->getClientOriginalName(),\n 'theme_background_color' => $request->get('theme_background_color'),\n 'theme_color' => $request->get('theme_color'),\n 'sort' => $request->get('sort'),\n 'active' => $request->get('active'),\n ]);\n $this->addDepartmentLangs($request, $department);\n $request->file('image')->move('images/', $request->file('image')->getClientOriginalName());\n if (!File::exists('papers/' . $department->keyword)) {\n File::makeDirectory('papers/' . $department->keyword);\n }\n Cache::forget('departments');\n });\n\n return redirect(action('Admin\\DepartmentController@index'))->with('success', 'saved');\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'name'=>'required'\n ]);\n\n $tab=new Department;\n $tab->name=$request->name;\n $tab->store_id=$this->sdc->storeID(); \n $tab->created_by=$this->sdc->UserID();\n $tab->save();\n\n $this->sdc->log(\"Department\",\"Department Name created\");\n return redirect('Department')->with('status', $this->moduleName.' Added Successfully !');\n }", "public function store(DepartmentRequest $request)\n {\n $department = Department::create($request->all());\n\n if (!$department) {\n return abort(422, 'Не удалось создать');\n }\n\n return response()->json($department);\n\n }", "public function create()\n {\n $organisations = Organisation::where('status','Active')\n ->orderBy('organisation','ASC')\n ->get();\n\n return view('admin/department/addDepartment',compact('organisations'));\n }", "public static function createNew()\n\t{\n\t\tif (func_num_args() == 1) {\n\t\t\t$type = self::TYPE_PUBLIC;\n\t\t\t$module = self::MODULE_TICKETS;\n\t\t\tlist($title) = func_get_args();\n\t\t} elseif (func_num_args() == 2) {\n\t\t\t$module = self::MODULE_TICKETS;\n\t\t\tlist($title, $type) = func_get_args();\n\t\t} else {\n\t\t\tlist($title, $type, $module) = func_get_args();\n\t\t}\n\t\t\n\t\t$new_department = new kyDepartment();\n\t\t$new_department->setTitle($title);\n\t\t$new_department->setType($type);\n\t\t$new_department->setModule($module);\n\t\treturn $new_department;\n\t}", "public function store(Request $request)\n {\n $data = $this->validate(request(), [\n 'department_name' => 'required',\n 'branch_name_select' => 'required',\n ]);\n $data['name'] = $request->input('department_name');\n $data['branch_id'] = $request->input('branch_name_select');\n\n $departments = Department::where([\n 'name' => $request->input('department_name'),\n 'branch_id' => $request->input('branch_name_select'),\n\n ])->get();\n\n if (count($departments) > 0) {\n session()->flash('exist', 'هذا القسم موجود بالفعل');\n return redirect(aurl('admin'));\n }\n\n Department::create($data);\n\n session()->flash('success_add', trans('admin.success_add'));\n return redirect(aurl('admin'));\n }", "public function create()\n {\n $this->authorize('create',Department::class);\n return view('department.create');\n }", "public function store(Request $request)\n {\n $request->validate([\n 'department_name' => 'required'\n\n ]);\n\n return Departments::create($request->all());\n }", "public function dept_renew_empl_dept(){\n $uid = isset($_REQUEST['uid'])?$_REQUEST['uid']:null;\n $uid = intval($uid);\n $one_info = D('TbHrCard')->findOneByEmplId($uid);\n $tmpData = D('TbHrEmpl')->fmtDeptByEmpl($one_info);\n $tmp_dept_id = null;\n $tmp_dept_id = $tmp_dept_id?$tmp_dept_id:(empty($tmpData['format_DEPT_GROUP_id'])?null:$tmpData['format_DEPT_GROUP_id']);\n $tmp_dept_id = $tmp_dept_id?$tmp_dept_id:(empty($tmpData['format_DEPT_NAME_id'])?null:$tmpData['format_DEPT_NAME_id']);\n // keep\n $tmp = D('TbHrDept')->addEmployeeToDepartment($uid,$tmp_dept_id);\n $data['uid'] = $uid;\n $data['dept_id'] = $tmp_dept_id;\n $data['status'] = $tmp;\n $outputs = array();\n $outputs['code'] = 200;\n $outputs['data'] = $data;\n echo json_encode($outputs);\n die();\n }", "public function AddDepartmentPage()\n {\n return view('Admin.AddDepartments');\n }", "public function store(StoreDepartment $request)\n {\n $data = $request->validated();\n\n current_user()->createDepartment($data);\n\n return response()->json([\n 'message' => 'Tạo khoa mới thành công.',\n 'redirect_to' => route('departments.index'),\n ]);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required|unique:departments|max:255'\n ]);\n\n $dept = new Department;\n $dept->name = $request->name;\n $dept->save();\n\n flash()->success('Success!', 'Department created successfully');\n\n return redirect('/departments');\n }", "public function create()\n {\n $companies = HRMainCmpnam::get(); // الشركات\n return view('hr.settings.departments.create',['title'=> trans('hr.department_create'),'companies'=>$companies]);\n }", "public function store(Request $request)\n {\n $department = new Department([\n 'name' => request('name'),\n 'description' => request('description'),\n ]);\n\n $department->save();\n\n return response()->json(self::SUCCESSFULLY_ADDED);\n }", "public function add($pid = null) {\n\t\t\n if ($this->request->is('post')) {\n $this->Organization->create();\n\t\t\t// Use saveAll will save Organization info and relation id to association table.\n if ($this->Organization->saveAll($this->request->data)) {\n $this->Session->setFlash(__('Organization has been saved.'));\n\t\t\t\t//once save, bring user go to contact person list.\n $this->redirect(array('controller' => 'persons', 'action' => 'view',$pid));\n } else {\n $this->Session->setFlash(__('Unable to add organization.'));\n }\n }\n\t\t\n\t\t//pass contact person's id to Organization add View\n\t\t$this->set('personid',$pid);\n }", "public function store(Request $request)\n {\n Department::create(Req::all());\n\n return redirect()->action('DepartmentsController@index');\n }", "public function store(Request $request)\n {\n Validator::make($request->all(), [\n 'name' => 'required',\n 'confirmed' => 'boolean'\n ])->validate();\n\n EmployeeDepartment::create([\n 'name' => $request->name,\n 'description' => $request->description,\n 'confirmed' => $request->confirmed,\n 'update_by' => Auth::user()->id\n ]);\n\n return redirect('employee/department')->with('flash', 'Department added.');\n }", "public function store()\n\t{\n\t\t$validation = Department::validate(Input::all());\n\t\t\n\t\tif($validation->passes()){\n\t\t\t$department = ['univ_id'=>Input::get('universityname'),\n\t\t\t\t'department'=>Input::get('department'),\n\t\t\t\t'seat'=>Input::get('seat')\n\t\t\t\t]; \n\n\t\t\tDepartment::create($department);\n\t\t\treturn Redirect::route('department.index');\n\t\t}\n\t\treturn Redirect::back()->withInput()->withErrors($validation);\n\t}", "public function create()\n\t{\n\t\t// Create new department instance.\n\t\t// \n\t\t$department = $this->departments->instance();\n\n\t\t// Show the page.\n\t\t// \n\t\treturn View::make('departments.create', compact('department'));\n\t}", "public function store()\n {\n $validatedDate = $this->validate([\n 'name' => 'required',\n ]);\n \n Department::updateOrCreate(['id' => $this->department_id],[\n 'name' => $this->name, \n ]);\n \n // session()->flash('message', 'expense Created Successfully.');\n \n // $this->resetInputFields();\n\n session()->flash('message', $this->department_id ? $this->name . ' Departiment Created Successfuly': $this->name . ' Departiment Created Successfuly');\n $this->closeModal(); //TUTUP MODAL\n $this->resetFields();\n }", "public function store(CreateDepartmentRequest $request)\n {\n $department = Department::create($request->validated());\n return response()->json(new DepartmentResource($department));\n }", "public function create()\n\t{\n\t\treturn View::make('department.create')\n\t\t\t->with('universities',$this->getUniversityWithId())\n\t\t\t->with('title','Addmission Pedia - Add a new Department');\n\n\t\t//return View::make('users.index')->with('title','Addmission Pedia - Home');\n\t}", "public function create()\n {\n $user= Auth::user();\n\n foreach ($user->departments as $department) {\n $dep = $department;\n }\n\n $title = \"SLMS | Edit Department\";\n\n return view('admin_pages.department.edit_department',compact('title','dep'));\n }", "public function create()\n\t{\n\t\treturn View::make('admin.create.department', ['pageTitle' => 'Add Department Record']);\n\t}", "public function marketingperson_add() {\n\n\t\t$post = $this->input->post();\n \n $this->form_validation->set_rules('marketingperson', 'marketing person' , 'required|is_unique[marketingperson.marketingperson]');\n $this->form_validation->set_error_delimiters('<span class=\"text-danger\">','</span>');\n\n\t\tif(!empty($post) && $this->form_validation->run() ==FALSE) {\n\t\t\t \n\t\t\t $this->session->set_flashdata('error', 'Validation error. Please check the form.');\n\t\t\t $this->load->model('Datype_model');\n\t\t\t\t$data[\"admins\"] = $this->Datype_model->getMarketingperson();\n\t\t\t\t$this->load->view('header');\n\t\t\t\t$this->load->view('masters/marketingperson', $data);\n\t\t\t\t$this->load->view('footer');\n \n\t\t} else {\n \n\t\t\t$table_array = array ('marketingperson' => $post['marketingperson']);\n\t\t\t$this->db->insert('marketingperson' , $table_array);\n\t\t\t$inserted = $this->db->insert_id();\n\t\t\tif(!empty($inserted)) {\n\t\t\t\t$this->session->set_flashdata('success', 'Marketing person added successfully!.');\n\t\t\t\treturn redirect(base_url().'masters/marketingperson');\n\t\t\t} else {\n\t\t\t\t$this->session->set_flashdata('error', 'Technical error!.');\n\t\t\t\treturn redirect(base_url().'masters/marketingperson');\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function newDepartmentAccount(Request $request)\n {\n $this->validateNewAdminstrator($request);\n\n $account = $this->adminRepository->getByEmail($request['txtNewAccount']);\n if (!$account) {\n $account = new Administrator();\n $account['account_type'] = 2;\n $account['company_id'] = $request['companyId'];\n $account['office_id'] = $request['officeId'];\n $account['department_id'] = $request['departmentId'];;\n $account['email'] = $request['txtNewAccount'];\n $password = $request['txtNewPassword'];\n $account['password'] = bcrypt($password);\n } else {\n if ($account['is_active'] == 1) {\n return response()->json([\n 'result' => false,\n 'message' => '電子メールアドレスはすでに使用中です'\n ]);\n }\n $account['account_type'] = 2;\n $account['company_id'] = $request['companyId'];\n $account['office_id'] = $request['officeId'];\n $account['department_id'] = $request['departmentId'];;\n $account['email'] = $request['txtNewAccount'];\n $password = $request['txtNewPassword'];\n $account['password'] = bcrypt($password);\n $account['is_active'] = 1;\n }\n\n $this->adminRepository->save($account);\n return response()->json([\n 'result' => true,\n 'message' => '登録が完了しました'\n ]);\n }", "public function testAddDepartement(): void {\n\n // Set a Departement mock.\n $departement = new Departement();\n\n $obj = new DepartementsResponse();\n\n $obj->addDepartement($departement);\n $this->assertSame($departement, $obj->getDepartements()[0]);\n }", "public function create()\n \n {\n $this->authorize('Admin');\n $Departments = \\App\\Department::pluck( 'name','id');\n \n return view('employers.create', compact('Departments'));\n\n }", "function insertDepartment($code, $name){\n\n\tglobal $DB;\n\t\n\tif($DB->query(\"INSERT INTO department (code, name) VALUES (:code, :name)\",\n\tarray(':code' => $code, ':name' => $name))){\n\t\treturn true;\n\t}\n\t\n\telse{\n\t\treturn false;\n\t}\n}", "public function create(Request $request)\n {\n $data = $request->all();\n\n Department::create($data);\n\n session()->flash('alert-success', 'Criado com sucesso!');\n return redirect()->back();\n }", "public function getDepartment()\n\t{\n\t\t$ci =& get_instance();\n\t\t$ci->load->library('department');\n\n\t\t$department = new Department($this->department_id);\t\t\t\t\n\n\t\treturn $department;\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'faculty_id' => 'required',\n 'code' => 'required|string|unique:departments',\n 'name' => 'required|string',\n ]);\n $department = new Department();\n $department->faculty_id = $request->faculty_id;\n $department->code = $request->code;\n $department->name = $request->name;\n\n if ($department->save()) {\n return response()->json($department, 200);\n } else {\n return response()->json([\n 'message' => 'Some error occured. Please try again.',\n 'status_code' => 500,\n ], 500);\n }\n }", "public function postSave(\\Symfony\\Component\\Form\\Form $form, \\Taskeet\\MainBundle\\Entity\\Department $Department)\n {\n $proveedor = $this->container->get('security.acl.provider');\n\n $idObjeto = ObjectIdentity::fromDomainObject($Department);\n\n //si el departamento tiene asignado un encargado se le asigna el perm owner\n if($owner = $Department->getOwner())\n {\n $this->setPermissions($proveedor, $idObjeto, $owner, MaskBuilder::MASK_OWNER);\n }\n //asignando permisos para ver a los miembros\n $users = $Department->getUsers();\n foreach ($users as $user)\n {\n $this->setPermissions($proveedor, $idObjeto, $user, MaskBuilder::MASK_VIEW);\n }\n\n\n }", "function add() {\n\n\t\t/**\n\t\t * Check if DNS module is enabled.\n\t\t * Call \"Module\" component to check.\n\t\t * 'DNS' is the module name (check in database).\n\t\t */\n\t\t$this->Module->check('DNS');\n\n\t\t/**\n\t\t * Check if maintenance is on.\n\t\t * Call the \"Maintenance\" component to check.\n\t\t */\n\t\t$this->Maintenance->check();\n\n\t\t/**\n\t\t * Check if subdomain quota is not over.\n\t\t * If yes, the user see an error message.\n\t\t * Call the \"Quota\" component to check.\n\t\t */\n\t\t$this->Quota->check('Subdomain', 'subdomain');\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t/**\n\t\t\t * Select the user ID of the domain owner.\n\t\t\t * @var array\n\t\t\t */\n\t\t\t$conditionUserId = array('conditions' => array('Domain.id' => $this->params['data']['Subdomain']['domain_id']));\n\t\t\t$queryUserDomainId = $this->Subdomain->Domain->find('first', $conditionUserId);\n\t\t\t\n\t\t\t/**\n\t\t\t * Split the subdomain string in an array. \n\t\t\t * @var array\n\t\t\t */\n\t\t\t$analyze = explode('.', $this->data['Subdomain']['name']);\n\n\t\t\t/**\n\t\t\t * Check if the domain name in the subdomain is the same than the domain name selected in the domains list.\n\t\t\t */\n\t\t\tif (isset($analyze['1']) && isset($analyze['2']) && $analyze['1'] . '.' . $analyze['2'] != $queryUserDomainId['Domain']['name']) {\n\t\t\t\t$this->Session->setFlash(__d('domain', 'Wrong domain name used in the subdomain name string.', true), 'default', array('class' => 'error'));\n\t\t\t\t$this->redirect(array('action' => 'add'));\n\t\t\t}\n\n\t\t\t$this->Subdomain->create();\n\n\t\t\t/**\n\t\t\t * Save new subdomain.\n\t\t\t */\n\t\t\tif ($this->Subdomain->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * Insert the create action in the \"robot\" table.\n\t\t\t\t * The Perl robot will check in this table.\n\t\t\t\t */\n\t\t\t\t$this->Robot->insert($this->data['Subdomain']['name'], 'SUBDOMAIN', $this->Auth->user('name'), $this->Auth->user('email'), $this->data['Subdomain']['domain_id'], NULL, 1);\n\n\t\t\t\t/**\n\t\t\t\t * Insert the create action in the \"logs\" table.\n\t\t\t\t */\n\t\t\t\t$this->Logs->insert($this->Auth->user('id'), '<strong>[ ' . $this->data['Subdomain']['name'] . ' ]</strong> ' . __d('domain', 'The subdomain has been saved.', true) , 'DNS', $_SERVER[\"REMOTE_ADDR\"]);\n\n\t\t\t\t/**\n\t\t\t\t * Save the user ID.\n\t\t\t\t */\n\t\t\t\t$this->Subdomain->saveField('user_id', $this->Auth->user('id'));\n\n\t\t\t\t/**\n\t\t\t\t * If the new subdomain is saved, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('domain', 'The subdomain has been saved.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the subdomain is not saved, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('domain', 'The subdomain has not been saved.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Select all domains who belongs to the user.\n\t\t * Select by user ID.\n\t\t * @var array\n\t\t */\n\t\t$conditions = array('conditions' => array('Domain.user_id' => $this->Auth->user('id')));\n\t\t$domains = $this->Subdomain->Domain->find('list', $conditions);\n\n\t\t/**\n\t\t * Put all domains in \"$domains\".\n\t\t * $domains will be available in the view.\n\t\t */\n\t\t$this->set(compact('domains'));\n\n\t}", "function DeleteDepartment($TransferTo=null){\n\t\tif(!$this->GetDeptByID()){\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get people and objects that still belong to this department\n\t\t$dev=new Device();\n\t\t$cab=new Cabinet();\n\t\t$dev->Owner=$cab->AssignedTo=$this->DeptID;\n\t\t$person=new People();\n\t\t$devices=$dev->GetDevicesbyOwner();\n\t\t$cabinets=$cab->GetCabinetsByDept();\n\t\t$users=$person->GetPeopleByDepartment($this->DeptID);\n\n\t\tforeach($devices as $d){\n\t\t\t// We've designated a new owner for this equipment, zero is valid as they might be setting it to general\n\t\t\tif(!is_null($TransferTo)){\n\t\t\t\t$d->Owner=$TransferTo;\n\t\t\t\t$d->UpdateDevice();\n\t\t\t}else{\n\t\t\t\t// This option is not being provided but us at this time, maybe through the API\n\t\t\t\t$d->DeleteDevice();\n\t\t\t}\n\t\t}\n\n\t\tforeach($cabinets as $c){\n\t\t\t// We've designated a new owner for these cabinets, zero is valid as they might be setting it to general\n\t\t\tif(!is_null($TransferTo)){\n\t\t\t\t$c->AssignedTo=$TransferTo;\n\t\t\t\t$c->UpdateCabinet();\n\t\t\t}else{\n\t\t\t\t// This option is not being provided but us at this time, maybe through the API\n\t\t\t\t$c->DeleteCabinet();\n\t\t\t}\n\t\t}\n\n\t\tforeach($users as $p){\n\t\t\t// If we don't have a value over 0 then we're just removing this department and they won't be added to another group\n\t\t\tif(!is_null($TransferTo) && intval($TransferTo)>0){\n\t\t\t\t// Add this user into the new department\n\t\t\t\t$sql=\"INSERT INTO fac_DeptContacts SET DeptID=\".intval($TransferTo).\", ContactID=$p->PersonID;\";\n\t \t\t\t$this->exec($sql);\n\t\t\t}\n\t\t}\n\t\n\t\t// Clear any users from this department\n\t\t$sql=\"DELETE FROM fac_DeptContacts WHERE DeptID=$this->DeptID;\";\n\t\t$this->exec($sql);\n\n\t\t// By this point all devices, objects, and users should have been shoved into a new department so finish cleaning up.\n\t\t$sql=\"DELETE FROM fac_Department WHERE DeptID=$this->DeptID;\";\n\n\t\tif(!$this->exec($sql)){\n\t\t\tglobal $dbh;\n\t\t\t$info=$dbh->errorInfo();\n\n\t\t\terror_log(\"PDO Error: {$info[2]} SQL=$sql\");\n\t\t\treturn false;\n\t\t}\n\n\t\t(class_exists('LogActions'))?LogActions::LogThis($this):'';\n\t\treturn true;\n\t}", "public function create()\n {\n return view('admin.department.create');\n }", "public function create()\n {\n return view('admin.department.create');\n }", "function addCompany() {\n\t\t\t\t\tPartner::create(array( 'name'\t\t =>\t$_POST['inputName'],\n\t\t\t\t\t\t\t\t\t\t\t'city'\t\t =>\t$_POST['inputCity'],\n\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'sql'\t\t =>\t$_POST['inputSql'],\n\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'wordpress'\t =>\t$_POST['inputWordpress'],\n\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'python'\t =>\t$_POST['inputPython'],\n\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'objective_c' =>\t$_POST['inputObjectiveC'],\n\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'c_plusplus' =>\t$_POST['inputCPlusPlus'],\n\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'php'\t\t =>\t$_POST['inputPHP'],\n\t\t\t\t\t\t\t\t\t\t\t'html_css'\t =>\t$_POST['inputHtmlCss'],\n\t\t\t\t\t\t\t\t\t\t\t'java'\t\t =>\t$_POST['inputJava'],\n\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'comments'\t =>\t$_POST['inputComments'])\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 tambah_department($data) {\n global $conn;\n\n $ket_department = htmlspecialchars($data['department']);\n $created_at = htmlspecialchars($data['created_at']);\n\n $result = mysqli_query($conn, \"SELECT * FROM department WHERE ket_department = '$ket_department' \");\n if (mysqli_fetch_assoc($result)) {\n echo \"<script>Swal.fire({\n title: 'Failed!',\n text: 'Department already exists',\n icon: 'error',\n confirmButtonText: 'OK'\n });</script>\";\n return false;\n }\n\n $query = \"INSERT INTO department( \n ket_department,\n created_at\n ) VALUES(\n '$ket_department',\n '$created_at' \n )\";\n\n mysqli_query($conn, $query);\n\n return mysqli_affected_rows($conn);\n }", "public function store(Request $request,$department_id)\n {\n \t\t$team_del = TeamLead::where('department_id','=',$department_id)->delete();\n //Rules for validation\n \t$rules=[\n \t\t'team_lead_id' => 'required',\n \t\t'member_id'=>'required',\n\n \t];\n // Messages for validation\n \t$messages=[\n \t\t'team_lead_id.required' => 'Please enter team lead.',\n \t\t'member_id.required' =>'Please enter member id',\n \t];\n // Make validator with rules and messages\n \t$validator = Validator::make($request->all(),$rules,$messages);\n // If validator fails than it will redirect back and gives error otherwise go to try catch section\n \tif ($validator->fails())\n \t{ \n \t\tFormer::withErrors($validator);\n \t\treturn redirect()->back()->withErrors($validator)->withInput();\n \t}\n // If no error than go inside otherwise go to the catch section\n \ttry\n \t{\n \t\tforeach ($request->get('member_id') as $key => $member) \n \t\t{\n \t\t\t$team_lead = new TeamLead();\n \t\t\t$team_lead->team_lead_id=$request->get('team_lead_id');\n \t\t\t$team_lead->member_id=$request->get('member_id')[$key];\n \t\t\t$team_lead->department_id=$department_id;\n \t\t\t$team_lead->save();\n \t\t}\n \t\treturn redirect()->route('departments.index');\n\n \t}\n \tcatch(\\Exception $e)\n \t{\n \t\treturn redirect()->route('departments.index')->withError('Something went wrong, Please try after sometime.');\n \t}\n }", "public function add(\\Illuminate\\Http\\Request $request): \\Illuminate\\Http\\JsonResponse\n {\n try {\n $this->validate($request, [\n 'name' => 'required',\n 'description' => 'required'\n ]);\n if(\\App\\Models\\Department::add($request)){\n return new \\Illuminate\\Http\\JsonResponse([\n 'status' => 200,\n 'messages' => \"Data added successfully\"\n ], 200);\n }\n } catch (\\Illuminate\\Validation\\ValidationException $e) {\n return new \\Illuminate\\Http\\JsonResponse([\n 'status' => 405,\n 'messages' => \"The form is invalid\",\n ], 405);\n } catch (\\Exception $e) {\n \\Illuminate\\Support\\Facades\\Log::error($e);\n return new \\Illuminate\\Http\\JsonResponse([\n 'status' => 400,\n 'messages' => \"Error adding data, please try again soon.\"\n ], 400);\n }\n }", "public function create()\n {\n return view(app('at').'.news.department.create',['title'=>trans('main.add')]);\n }", "public function run()\n {\n Department::create([\n 'department_code' => 10001,\n 'name' => 'College of Engineering and Computer Science Technology',\n 'short_name' => 'CECST',\n 'department_head' => '*',\n 'department_head_position' => '*',\n ]);\n }", "public function setDepartment($department)\n {\n $this->department = array_search($department, $this->aDepartment);\n }", "public function insertdepartment($depname,$depdescription,$superviser,$editid,$delid,$hod) {\r\n\t\tif(isset($delid) and $delid>0) {\r\n\t\t\t$query = \"DELETE FROM department WHERE department.departmentid = '$delid'\";\r\n\t\t\t$val = $GLOBALS['db']->query($query);\r\n\t\t\tif(isset($val) and $val==1) {\r\n\t\t\t\theader('Location: department.php?del=1');\r\n\t\t\t\texit;\r\n\t\t\t} else {\r\n\t\t\theader('Location: department.php?del=0');\r\n\t\t\texit;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(isset($editid) and $editid>0) {\r\n\t\t\t$query = \"UPDATE department SET depname = '$depname',hod = '$hod', depdescription = '$depdescription'\";\r\n\t\t\t$query.=\"where departmentid = '$editid'\";\r\n\t\t\t$GLOBALS['db']->query($query);\r\n\t\t\theader('Location: department.php');\r\n\t\t\texit;\r\n\t\t\t\r\n \r\n// // // // // // // // // // $query = \"SELECT employeeid FROM employee WHERE departmentid = '$editid' AND emptype = 'supervisor'\";\r\n// // // // // // // // // // //echo $query = \"select supervisor.supervisorid from supervisor,employee where supervisor.departmentid = '$editid' and supervisor.employeeid = employee.employeeid\";\r\n// // // // // // // // // // $result = $GLOBALS['db']->query($query);\r\n// // // // // // // // // // //$oldarray = $result->fetch_assoc();\r\n// // // // // // // // // // $i=0;\r\n// // // // // // // // // // $oldarray = array();\r\n// // // // // // // // // // while ($row = $result->fetch_assoc()) {\r\n// // // // // // // // // // \t\r\n// // // // // // // // // // \t$oldarray[$i] = $row['employeeid'];\r\n// // // // // // // // // // \t//$oldarray .= array($i => $row['employeeid'][$i]);\r\n// // // // // // // // // // \t//$oldarray.= $row['employeeid'][$i];\r\n// // // // // // // // // // \techo \"<br>\";\r\n// // // // // // // // // // echo $oldarray[$i];\r\n// // // // // // // // // // \t\t$i++;\r\n// // // // // // // // // // }\r\n// // // // // // // // // // \r\n// // // // // // // // // // $newarray = $superviser;\r\n// // // // // // // // // // $arrayintersect = array_intersect($oldarray, $newarray);\r\n// // // // // // // // // // echo \"<br>\";\r\n// // // // // // // // // // echo \"old\".count($oldarray);\r\n// // // // // // // // // // echo \"<br>\";\r\n// // // // // // // // // // \r\n// // // // // // // // // // for($i=0; $i<count($oldarray); $i++) {\r\n// // // // // // // // // // \techo $oldarray[$i];\r\n// // // // // // // // // // \techo \"<br>\";\r\n// // // // // // // // // // }\r\n// // // // // // // // // // \r\n// // // // // // // // // // echo \"new\";\r\n// // // // // // // // // // echo \"<br>\";\r\n// // // // // // // // // // for($i=0; $i<count($newarray); $i++) {\r\n// // // // // // // // // // \techo $newarray[$i];\r\n// // // // // // // // // // \techo \"<br>\";\r\n// // // // // // // // // // }\r\n// // // // // // // // // // \r\n// // // // // // // // // // echo\"intersect\";\r\n// // // // // // // // // // echo \"<br>\";\r\n// // // // // // // // // // for($i=0; $i<count($arrayintersect); $i++) {\r\n// // // // // // // // // // \techo $arrayintersect[$i];\r\n// // // // // // // // // // \techo \"<br>\";\r\n// // // // // // // // // // }\r\n//echo count($oldarray);\r\n//echo\"new\";\r\n//echo count($newarray);\r\n//echo \"<br>\";\r\n//echo count($newarray);\r\n\t\t/* if(isset($val) and $val == 1) {\r\n\t\t\t$arrcount = count($superviser);\r\n\t\t\t\tif(isset($arrcount) and $arrcount>0) {\r\n\t\t\t\t\tfor($i=0; $i<count($superviser); $i++) {\r\n\t\t\t\t\t$superviser[$i];\r\n\t\t\t\t\t\t$query =\"INSERT INTO supervisor (supervisorid, employeeid, departmentid) VALUES ('', '$superviser[$i]', '$editid')\";\r\n\t\t\t\t\t\t$GLOBALS['db']->query($query);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t //This will give an error. Note the output\r\n \t\t\t\t\t// above, which is before the header() call \r\n\t\t\t\t\t//header('Location: department.php');\r\n\t\t\t\t\t//exit;\r\n\t\t\t\t}\r\n\t\t\t} */\r\n\r\n\t\t}\r\n\t\telse if(isset($depname) and $depname!='') {\r\n\t\t\t$query =\"insert into department (departmentid, depname, depdescription) values ('', '$depname', '$depdescription')\";\r\n\t\t\t$GLOBALS['db']->query($query);\r\n\t\t\t$deprid = $GLOBALS['db']->insert_id;\r\n\t\t\tif(isset($deprid) and $deprid!='') {\r\n\t\t\tfor($i=0; $i<count($superviser); $i++) {\r\n\t\t\t$query =\"INSERT INTO supervisor (supervisorid, employeeid, departmentid) VALUES ('', '$superviser[$i]', '$deprid')\";\r\n\t\t\t$GLOBALS['db']->query($query);\r\n\t\t\t}\r\n\t\t\t/* This will give an error. Note the output\r\n \t\t\t* above, which is before the header() call */\r\n\t\t\theader('Location: department.php');\r\n\t\t\texit;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public function create()\n {\n //\n return view('admin.departments.create', ['title' => trans('admin.add')]);\n }", "public function save_department_location()\n {\n if (validate('save_department_location') == FALSE) {\n $return_data = array(\n 'status' => false,\n 'message' => 'Some fields have errors.',\n 'fields' => validation_error_array()\n );\n } else {\n $locID = get_post('id');\n $DepartmentID = get_post('DepartmentID');\n $SubDepartmentID = (int) get_post('SubDepartmentID');\n $scopeCode = (int) get_post('LocationScope');\n $locationCode = get_post('LocationCode');\n\n // find loc by id\n $locData = $this->mgovdb->getRowObject('Dept_ScopeLocations', $locID, 'id');\n if (!$locData) {\n // find by data\n $locationWhere = array(\n 'DepartmentID' => $DepartmentID,\n 'SubDepartmentID' => $SubDepartmentID, \n 'LocationScope' => $scopeCode,\n 'LocationCode' => $locationCode\n );\n $locations = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere, 'id', array(1));\n if (count($locations)) {\n $locData = (object) $locations[0];\n }\n }\n\n if ($locData != false) {\n // exists, just update\n $insertData = array(\n 'id' => $locData->id\n );\n\n } else {\n // new record\n $insertData = array(\n 'DepartmentID' => $DepartmentID,\n 'SubDepartmentID' => $SubDepartmentID,\n 'LocationScope' => $scopeCode,\n 'LocationCode' => $locationCode\n );\n }\n\n $insertData['Status'] = get_post('Status');\n $insertData['Address'] = get_post('Address');\n $insertData['Contact'] = get_post('Contact');\n $insertData['LastUpdate'] = date('Y-m-d H:i:s');\n\n if (($ID = $this->mgovdb->saveData('Dept_ScopeLocations', $insertData))) {\n $return_data = array(\n 'status' => true,\n 'message' => 'Department scope location has been saved successfully.',\n 'id' => $ID,\n 'data' => $insertData,\n );\n\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'Saving department scope location failed. Please try again.',\n );\n }\n }\n\n response_json($return_data);\n }", "public function store(Request $request)\n {\n //\n $data = $this->validate(request(),\n [\n 'title' => 'required',\n 'description'=>'',\n 'fixed_salary'=>'required|numeric'\n \n ], [], [\n 'name' => 'title',\n \n ]);\n $result = Department::create($data);\n session()->flash('success', trans('admin.record_added'));\n if($result)\n return response()->json([\n 'data'=>$result,\n 'Status' => '200',\n 'flag' => 'success'\n ]);\n else\n return response()->json([\n 'status' => '500',\n 'flag' => 'Error'\n ]);\n //return redirect(aurl('departments'));\n }", "public function addSomething(User $user, Department $department)\n {\n // when gathering the relatable objects, the $department value is right\n\n // once the something is saved, the $department value contains attributes from the branch\n\n error_log(json_encode($department));\n\n return true;\n }", "public function add_service() {\r\n if (USER_ROLE == ROLE_ONE) {\r\n $result['companies'] = $this->company_model->get_companies_id_name();\r\n $this->load->view('webpages/add_service', $result);\r\n } else {\r\n $this->load->view('webpages/404');\r\n }\r\n }", "private static function create_department($row) {\n $department = new Department(array(\n 'id' => $row['id'],\n 'name' => $row['name'],\n 'abbreviation' => $row['abbreviation']\n ));\n \n return $department;\n }", "public function addDept(Dept $dept)\n {\n $this->depts[] = $dept;\n return $this;\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'designation'=>'required|max:200',\n 'department'=>'required',\n ]);\n Designation::create([\n 'name'=>$request->designation,\n 'department_id'=>$request->department,\n ]);\n return back()->with('success','Designation added successfully!!!');\n }", "function sfgov_utilities_deploy_09_dept_include() {\n try {\n $deptNodes = Utility::getNodes('department');\n foreach($deptNodes as $dept) {\n $dept->field_include_in_list->value = TRUE;\n echo \"Updated \" . $dept->getTitle() . \" (\" . $dept->id() . \")\\n\";\n $dept->save();\n }\n } catch(\\Exception $e) {\n error_log($e->getMessage(), \"\\n\");\n }\n}", "public function testAssignmentDepartmentMethod()\n {\n $assignment = factory(NonCourseAssignment::class)->create();\n $department = factory(Department::class)->create();\n $assignment->department()->associate($department);\n $assignment->save();\n\n $this->assertDatabaseHas('non_course_assignments', [\n 'id' => $assignment->id,\n 'department_id' => $department->id,\n ]);\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 store()\n {\n $data=$this->validate(request(),[\n 'name'=>'required',\n 'description'=>'required',\n 'doctor_id'=>'required|exists:departments,id',\n 'department_id'=>'required|exists:departments,id',\n 'detection_price'=>'required',\n 'return_price'=>'required',\n\n ],[],[\n 'name'=> trans('admin.name'),\n 'description'=> trans('admin.description'),\n 'department_id'=> 'القسم',\n 'doctor_id'=> 'الدكتور',\n 'detection_price'=> 'سعر الكشف',\n 'return_price'=> 'سعر الاعادة',\n ]);\n Service::create($data);\n session()->flash('success',trans('admin.record_added'));\n return redirect(url('service'));\n }", "public function form_create_department(){\n // Menampilkan view dari file views/department/form_create_department.blade.php.\n return view('department.form_create_department');\n }", "public function store(Request $request)\n {\n // validate data\n $this->validate($request, array(\n 'title' => 'required|max:255',\n 'desc' => 'required',\n 'd_type' => 'required'\n ));\n\n // store in the database\n $depart = new departments;\n\n $depart->d_title = $request->title;\n $depart->d_desc = $request->desc;\n $depart->d_type = $request->d_type;\n\n $depart->save();\n\n session::flash('success', 'The department was successfully saved!');\n\n //redirect to another page\n return redirect()->route('depart.show', $depart->id);\n }", "public function setDepartment($department){\r\n\t \r\n\t return $this;\r\n\t}", "public function save(\\Admin\\Model\\Department $department) {\n $id = (int) $department->department_id;\n\n if ($id == 0) {\n // set date fields to now\n $d = new \\DateTime();\n $department->date_created = $d->format(\"Y-m-d H:i:s\");\n $department->date_modified = $d->format(\"Y-m-d H:i:s\");\n $this->tableGateway->insert($department->toArray());\n } else {\n\n if ($department = $this->getDepartment($id)) {\n\n $d = new \\DateTime();\n $department->setDateCreated($department->getDateCreated());\n $department->setDateModified($d->format(\"Y-m-d H:i:s\"));\n\n $this->tableGateway->update($department->toArray(), array('department_id' => $id));\n }\n }\n }" ]
[ "0.75487596", "0.7030192", "0.6842483", "0.6611218", "0.64723", "0.6457899", "0.64057255", "0.63938135", "0.6365737", "0.633922", "0.6333738", "0.63314545", "0.62857807", "0.6274391", "0.6272215", "0.61879396", "0.6175046", "0.6173656", "0.61438555", "0.61361974", "0.6110865", "0.60893154", "0.604628", "0.5993201", "0.5951469", "0.59308624", "0.5889982", "0.5882965", "0.5879319", "0.58506364", "0.58415705", "0.58319247", "0.5831739", "0.58241236", "0.5820343", "0.58087325", "0.58078533", "0.5800104", "0.5800097", "0.5789496", "0.57314736", "0.57270235", "0.5714602", "0.57125914", "0.5710953", "0.56755537", "0.563337", "0.56209373", "0.56154794", "0.56133986", "0.5580857", "0.5569676", "0.556833", "0.55641514", "0.5562012", "0.55599093", "0.55470294", "0.5540621", "0.5532253", "0.55232865", "0.54755956", "0.547069", "0.54657125", "0.54488504", "0.5441108", "0.54378074", "0.54315627", "0.5416379", "0.53986037", "0.53942233", "0.5392151", "0.5388847", "0.53746784", "0.5371636", "0.5366081", "0.5366081", "0.53589284", "0.5358151", "0.5357868", "0.53532714", "0.53499794", "0.5347861", "0.534322", "0.53420854", "0.53372955", "0.5313248", "0.53038234", "0.53009516", "0.5295679", "0.52937376", "0.5293153", "0.52813816", "0.5274949", "0.52684736", "0.5265374", "0.5261293", "0.5261167", "0.52610093", "0.52383775", "0.5238236" ]
0.582156
34
This method will update a Department
public function updateDepartments($parameters) { $this->em = $this->getEntityManager(); $qb = $this->em->createQueryBuilder('p') ->update('CorporateBundle:CorpoDepartments', 'p') ->set("p.name", ":name") ->set("p.accountId", ":accountId") ->where("p.id=:Id") ->setParameter(':name', $parameters['name']) ->setParameter(':accountId', $parameters['accountId']) ->setParameter(':Id', $parameters['id']); $query = $qb->getQuery(); $queryRes = $query->getResult(); if ($queryRes) { return $query->getResult(); } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(DepartmentRequest $request, $id)\n {\n $department = Department::findOrFail($id);\n $department->update($request->all());\n }", "public function editDepartmentUpdate()\n {\n if($this::check_session()){\n $this->form_validation->set_rules('updtdepartment', 'Department', 'required');\n $this->form_validation->set_rules('updtdepartmentCode', 'Department Code', 'required');\n $this->form_validation->set_rules('departmentId', 'Department ID', 'required');\n \n $id = $this->input->post('departmentId');\n $dept = $this->input->post('updtdepartment');\n $deptcode = $this->input->post('updtdepartmentCode');\n \n if($this->form_validation->run()) { \n $this->Admin_model->editDepartmentUpdate($id, $dept, $deptcode);\n $this->addRemoveDepartments();\n }else{\n $this->addRemoveDepartments();\n }\n }\n }", "public function update(Request $request, Department $department,$id=0)\n {\n $this->validate($request,[\n 'name'=>'required',\n ]);\n\n \n \\DB::table('departments')\n ->where('id',$id)\n ->update(['name'=>$request->name,'updated_by'=>$this->sdc->UserID()]);\n\n \n \n $this->sdc->log(\"Departments\",\"Departments name updated\");\n return redirect('Department')->with('status', $this->moduleName.' Updated Successfully !');\n }", "public function update(Request $request, Department $department)\n {\n $request->validate([\n 'department_name' => 'required',\n 'department_status' => 'required'\n ]);\n\n $department->update($request->all());\n \n return redirect()->route('department.index')\n ->with('success','Updated successfully');\n }", "public function update(DepartmentRequest $request, Department $department)\n {\n $department->update($request->all());\n }", "public function update(Request $request, $department)\n {\n $request->validate([\n 'department_title' => 'required',\n 'department_description' => 'required',\n ]);\n $update = Department::where('company_department_id',$department)->update([\n 'department_title'=>$request->department_title,\n 'department_description'=>$request->department_description,\n ]);\n if($update){\n return back()->with('message','Department Updated successfully');\n }\n else{\n return back()->with('message','Error in adding Department');\n }\n }", "public function update(Request $request, DepartmentModel $departmentModel, $id)\n { \n $data = DepartmentModel::find($id);\n $data->department = $request->department;\n if($data->save()){\n return redirect()->back()->with('message','Update Sucessfully.');\n }\n }", "function update (Request $request, $id) \n {\n $validatedData = $request->validate([\n 'department_name' => 'required',\n 'department_desc' => 'required',\n 'is_active' => 'required',\n ]);\n \n \t$department = Department::where('id','=',$id)->first();\n if (session()->get('session_superadmin') == 1) {\n $validatedData = $request->validate([\n 'id_country' => 'required',\n ]);\n $department->id_country = $request->id_country;\n }else{\n $department->id_country = session()->get('session_country');\n }\n $department->department_name = $request->department_name; \n $department->department_desc = $request->department_desc; \n $department->email = $request->email;\n $department->head_of_department = $request->head_of_department;\n $department->manager = $request->manager;\n $department->flag_designated = $request->flag_designated;\n $department->flag_external = $request->flag_external;\n $department->is_active = $request->is_active;\n $department->updated_by = session()->get('session_name') ;\n \t$department->save();\n\n $request->session()->flash('alert-success', 'Department has been updated successfully!');\n\n \treturn redirect('department');\n }", "public function update($departmentid)\n\t{\n\t\t$dept_id = Input::get('department_id');\n\t\t$validation = Department::validate(Input::all());\n\t\t\n\t\tif($validation->passes()){\n\t\t\t$department = ['univ_id'=>Input::get('universityname'),\n\t\t\t\t'department'=>Input::get('department'),\n\t\t\t\t'seat'=>Input::get('seat')\n\t\t\t\t]; \n\n\t\t\tDepartment::find($dept_id)->update($department);\n\t\t\treturn Redirect::route('department.index');\n\t\t}\n\t\treturn Redirect::route('department.edit',$departmentid)->withInput()->withErrors($validation);\n\t}", "public function updateDepartment(Request $request, $id) {\n $department = Department::find($id);\n if (is_null($department)) {\n return response()->json([\n 'success' => false,\n 'statusCode' => 404,\n 'message' => 'Department not found']);\n }\n $department->update($request->all());\n return response([\n 'success' => true,\n 'statusCode' => 200,\n 'message' => 'Successfully updated clearance department',\n 'data' => $department]);\n }", "public function update(Request $request, $id)\n {\n $deptId = base64_decode($id);\n\n $dept = Department::find($deptId);\n\n $dept->department = Input::get('department'); \n $dept->numberOfEmployees = Input::get('noOfEmp');\n $dept->orgId = Input::get('organisation');\n $dept->officeId = Input::get('office');\n $dept->status = 'Active';\n $dept->lead_name = Input::get('lead_name');\n $dept->lead_email = Input::get('lead_email');\n $dept->lead_mobile = Input::get('lead_mobile'); \n $dept->created_at = date('Y-m-d H:i:s');\n\n $dept->save();\n\n return \\Redirect::route('department.index')->with(['message'=>'Department updated successfully.']);\n\n }", "public function update($id)\n\t{\n\t\t$department = Department::find($id);\n\t\t$department->name \t= Input::get('name');\n\t\tif($department->save())\n\t\t\treturn Redirect::back()->with(['flash_message'=>'Department successfully Updated','msgtype'=>'success']);\n\t\t\n\t}", "public function update(Request $request, $department_id)\n {\n $data = $request->all();\n\n $department = Department::findOrFail($department_id);\n $department->update($data);\n\n session()->flash('alert-success', 'Atualizado com sucesso!');\n return redirect()->route('department.index');\n }", "public function updateDepartment(Request $request)\n {\n $model = new mainModel();\n $departmentName = $request->department_name;\n $departmentid = $request->departmentid;\n $UserId = $request->session()->get('userid');\n $timaestamp = date(\"Y-m-d H:i:s\");\n $data['DEPARTMENT_NAME'] = $departmentName;\n $data['UPDATED_BY'] = $UserId;\n $data['UPDATED_AT'] = $timaestamp;\n $response = $model->updateDepartments($data, $departmentid);\n return $response;\n\n }", "public function update(Request $request, TeacherDepartment $teacherDepartment)\n {\n //\n }", "public function update(Request $request, Department $department)\n {\n $request->validate([\n 'faculty_id' => 'required|string',\n 'code' => 'required|string|unique:departments',\n 'name' => 'required|string',\n ]);\n\n $department->faculty_id = $request->faculty_id;\n $department->code = $request->code;\n $department->name = $request->name;\n\n if ($department->save()) {\n return response()->json($department, 200);\n } else {\n return response()->json([\n 'message' => 'Some error occured. Please try again.',\n 'status_code' => 500,\n ], 500);\n }\n }", "public function edit(Department $department)\n {\n }", "public function update(Request $request, $id)\n {\n //validate the data\n $depart = departments::find($id);\n \n $this->validate($request, array(\n 'title' => 'required|max:255',\n 'desc' => 'required',\n 'd_type' => 'required'\n ));\n //save the data to the database\n\n $depart->d_title = $request->input('title');\n $depart->d_desc = $request->input('desc');\n $depart->d_type = $request->input('d_type');\n\n $depart->save();\n\n //set flash data with success message\n Session::flash('success', 'This department was successfully updated.');\n\n //redirect with flash data to posts.show\n return redirect()->route('depart.show', $depart->id);\n }", "public function update(Request $request, Department $department)\n {\n $validatedRequest = $request->validate([\n 'name' => 'required',\n 'school' => 'required',\n 'institution' => 'required'\n ]);\n\n $UpdatedDepartment = $department->update([\n 'name' => $request->input('name'),\n 'school_id' => $request->input('school')\n ]);\n\n if($UpdatedDepartment){\n return redirect()->route('departments.show',[$department->id])->with('success', 'Department Updated Successfully');\n }\n\n return back()->withInput($request->input())->withErrors($validatedRequest);\n }", "public function update(Request $request, Department $department)\n {\n try {\n $this->validate($request, $this->rules());\n\n\n $department->dname = $request->input('dname');\n $department->loc = $request->input('loc');\n if ($department->save()) {\n session()->flash('status', \"The Department $department->dname Has been updated Sucessfully\");\n return redirect(route('department.index'));\n }\n\n }\n catch (\\Exception $ex) {\n $error = $ex->getMessage();\n error_log($error,3,\"../logs/my-errors.log\");\n session()->flash('status', \"OOps :-( Department $department->dname Has not been Updated\");\n return back()->withInput();\n }\n }", "public function update(Request $request, Department $department)\n {\n $this->abort_if_not_permited();\n $data = $this->validate($request, [\n 'department' => 'required',\n 'department_code' => 'required',\n ]);\n\n $department->update($data);\n return $department;\n }", "public function edit(Department $department)\n {\n //\n }", "public function update(Requests\\DepartmentRequest $request, Department $department)\n {\n DB::transaction(function () use ($department, $request) {\n $oldKeyword = $department->keyword;\n $data = [\n 'keyword' => $request->get('keyword'),\n 'url' => $request->get('url'),\n 'theme_background_color' => $request->get('theme_background_color'),\n 'theme_color' => $request->get('theme_color'),\n 'sort' => $request->get('sort'),\n 'active' => $request->get('active'),\n ];\n if ($request->file('image')) {\n $data['image'] = $request->file('image')->getClientOriginalName();\n File::delete('images/' . $department->image);\n $request->file('image')->move('images/', $request->file('image')->getClientOriginalName());\n }\n\n $department->update($data);\n $department->langs()->delete();\n $this->addDepartmentLangs($request, $department);\n if ($department->keyword != $oldKeyword) {\n File::move('papers/' . $oldKeyword, 'papers/' . $department->keyword);\n }\n Cache::forget('departments');\n });\n\n return redirect(action('Admin\\DepartmentController@index'))->with('success', 'updated');\n }", "public function update(Request $request, Department $department)\n {\n if(Department::select('name')->where('name',request()->name)->exists()\n and Department::select('faculty_id')->where('faculty_id',request()->faculty_id)->exists()){\n return redirect()->back()->with('error', 'Department with similar name in this faculty already exists!');\n }\n else\n {\n $department->update(['name' => $request->get('name')]);\n return redirect(route('departments.index'))->with('message', 'Department Updated Successfully!');\n }\n \n }", "public function updateDepartment(){\n\t\t$incomingFormData = $this->readHttpRequest();\n\t\t$formData = json_decode($incomingFormData);\n\t\t$updateResult = $this->department_model->updateDepartment($formData);\n\t\t$depListFlag = 1;\n\t\tif($updateResult == true){\n\t\t\t\t$data['status'] = 'ok';\n\t\t\t\t}else{\n\t\t\t\t$data['status'] = 'fail';\n\t\t\t}\n\t\t$departmentList = $this->index($depListFlag); // call department List\n\t\t\t$data['departmentList'] = $departmentList;\n\t\t\techo json_encode($data);\n\t\t\n\t}", "public function update($id) {\r\n\r\n //if save button was clicked, get the data sent via post\r\n if ($this->input->server('REQUEST_METHOD') === 'POST') {\r\n\r\n //form validation\r\n $this->form_validation->set_rules('dep_name', 'Name', 'trim|required|xss_clean');\r\n\r\n //if the form has passed through the validation\r\n if ($this->form_validation->run()) {\r\n $data_to_store = array(\r\n 'dep_name' => $this->input->post('dep_name'),\r\n );\r\n\r\n //if the insert has returned true then we show the flash message\r\n if ($this->Department_model->update($id, $data_to_store)) {\r\n $this->session->set_flashdata('flash_message', TRUE);\r\n redirect('admin/departments');\r\n } else {\r\n $this->session->set_flashdata('flash_message', FALSE);\r\n }\r\n } else {\r\n $this->session->set_flashdata('flash_message', FALSE);\r\n }\r\n }\r\n\r\n $departments = $this->Department_model->find_by_id($id);\r\n\r\n\r\n $data['department'] = $departments == null ? [] : $departments[0];\r\n\r\n //load the view\r\n $data['content'] = 'admin/departments/edit';\r\n $this->load->view('includes/admin_template', $data);\r\n }", "public function update(Request $request, $id)\n {\n //validate post data\n $this->validate($request, [\n 'value' => 'required'\n ]);\n $department= Department::find($id);\n $department->value=$request->get('value');\n $department->save();\n\n //store status message\n Session::flash('success_msg', 'Department updated successfully!');\n\n return redirect()->route('departments.index')->with('success','Departsment updated successfully');\n }", "public function update(Request $request, $id)\n {\n $department= Department::findOrFail($id);\n $request->validate([\n 'department_name' => 'required|unique:departments,name,'.$department->id,\n ]);\n if ($request->lecturers_code) {\n $request->validate([\n 'lecturers_code' => 'unique:departments,lec_code,'.$department->id,\n ]);\n }\n if ($request->students_code) {\n $request->validate([\n 'students_code' => 'unique:departments,stu_code,'.$department->id,\n ]);\n }\n\n $department->name = $request->department_name;\n $department->lec_code = $request->lecturers_code;\n $department->stu_code = $request->students_code;\n $department->save();\n\n return redirect()->back()->with('msg', 'Department info updated successfully!!');\n }", "public function update(Request $request, $id)\n {\n Validator::make($request->all(), [\n 'name' => 'required',\n 'confirmed' => 'boolean'\n ])->validate();\n\n EmployeeDepartment::find($id)->update([\n 'name' => $request->name,\n 'description' => $request->description,\n 'confirmed' => $request->confirmed,\n 'update_by' => Auth::user()->id\n ]);\n\n return redirect('employee/department')->with('flash', 'Department updated.');\n }", "public function update(DepartmentRequest $request, Department $department)\n {\n return response()->update($this->repository->update($request, $department));\n }", "public function updateDepartmentById($param)\n {\n $id = $param['id'];\n $facultyId = DepartmentTable::getFacultyIdOf($id);\n\n switch ($_SESSION['role']) {\n case 1:\n if ($_SESSION['uid'] != $facultyId) {\n http_response_code(403);\n echo json_encode(array(\n 'message' => Constant::notPermissionText\n ));\n return;\n }\n break;\n case 4:\n if (!Middleware::isOfficerBelongToFaculty($_SESSION['uid'], $facultyId)) {\n http_response_code(403);\n echo json_encode(array(\n 'message' => Constant::notPermissionText\n ));\n return;\n }\n break;\n default:\n http_response_code(403);\n echo json_encode(array(\n 'message' => Constant::notPermissionText\n ));\n return;\n }\n\n $json = file_get_contents('php://input');\n $obj = json_decode($json);\n\n $fct = array();\n if (property_exists($obj, 'name')) $fct['name'] = $obj->name;\n if (property_exists($obj, 'type')) $fct['type'] = $obj->type;\n if (property_exists($obj, 'address')) $fct['address'] = $obj->address;\n if (property_exists($obj, 'phone')) $fct['phone'] = $obj->phone;\n if (property_exists($obj, 'website')) $fct['website'] = $obj->website;\n $department = new Department($fct);\n\n if (isset($fct['name']) && $fct['name'] == null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames[\"departmentName\"]) . Constant::notEmptyText\n ));\n return;\n }\n\n if (isset($fct['type']) && $fct['type'] == null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Loại \" . Constant::objectNames[\"department\"] . Constant::notEmptyText\n ));\n return;\n }\n\n foreach ($fct as $key => $value) {\n $action = 'check' . ucfirst($key);\n if (!$department->$action()) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames[$key]) . Constant::invalidText\n ));\n return;\n }\n }\n\n $oldDepartment = DepartmentTable::getById($id, $facultyId);\n $type = $oldDepartment->getType();\n\n if($type != 4 && $fct['type'] == 4){\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Văn phòng Khoa \" . Constant::isExistedText\n ));\n return;\n }\n\n DepartmentTable::updateById($id, $fct);\n\n http_response_code(200);\n echo json_encode(array(\n 'message' => Constant::success\n ));\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required|unique:departments,id,'.$id.'|max:255'\n ]);\n\n $department = Department::findOrFail($id);\n $department->update($request->all());\n \n flash()->success('Success!', 'Departmanet name updated!');\n return redirect('departments');\n }", "public function updateDepartment(Request $request)\n {\n //return $request->all();\n $validator = Validator::make($request->all(),[\n 'name' => 'required|unique:department_models,name,'.$request->id,\n ]);\n if($validator->fails()) {\n return response()->json([\n 'errors'=>$validator->errors()->all(),\n 'status'=>false,\n ]);\n }\n $updatedepartment = DepartmentModel::where('id',$request->id)->first();\n $updatedepartment->name = $request->name;\n\n if( $updatedepartment->save()) {\n return response()->json([\n\n 'status'=>true,\n 'titlee'=>'Update',\n 'msg'=>'Update Data Successfully',\n 'typee'=>'success'\n\n ],200);\n } \n }", "public function update($id)\n\t{\n\t\t// Fetch the department record from the database.\n\t\t// \n\t\t$department = $this->departments->findById( $id );\n\n\t\t// Capture the submitted form data.\n\t\t// \n\t\t$input = Input::except('_token');\n\n\t\t// The submitted data failed to pass validation.\n\t\t// \n\t\tif ( ! $this->validator->validateUpdate( $id, $input ))\n\t\t{\n\t\t\t// Capture the validation error message(s).\n\t\t\t// \n\t\t\t$errors = $this->validator->errors();\n\n\t\t\t// Go back to the form.\n\t\t\t// \n\t\t\treturn Redirect::back()->withInput()->withErrors( $errors );\n\t\t}\n\n\t\t//-------------------------------\n\t\t// Input passed validation.\n\t\t//-------------------------------\n\n\t\t// Update the department record.\n\t\t// \n\t\t$department = $this->departments->update( $id, $input );\n\n\t\t// Successful department record message.\n\t\t// \n\t\t$message = sprintf( 'The <strong>%s</strong> department was successfully added.' , $department->name );\n\n\t\t// Send the user back to the department list page and display a message\n\t\t// that communicate a new department record was created.\n\t\t// \n\t\treturn Redirect::route('departments.index')->withDepartmentAdded( $message );\n\t}", "public function save(\\Admin\\Model\\Department $department) {\n $id = (int) $department->department_id;\n\n if ($id == 0) {\n // set date fields to now\n $d = new \\DateTime();\n $department->date_created = $d->format(\"Y-m-d H:i:s\");\n $department->date_modified = $d->format(\"Y-m-d H:i:s\");\n $this->tableGateway->insert($department->toArray());\n } else {\n\n if ($department = $this->getDepartment($id)) {\n\n $d = new \\DateTime();\n $department->setDateCreated($department->getDateCreated());\n $department->setDateModified($d->format(\"Y-m-d H:i:s\"));\n\n $this->tableGateway->update($department->toArray(), array('department_id' => $id));\n }\n }\n }", "public function actionEdit_department($id) {\n //redirect a user if not super admin\n if (!Yii::$app->CustomComponents->check_permission('edit_department')) {\n return $this->redirect(['create_department']);\n }\n\n $model = DvUsersDepartment::findOne($id);\n if (empty($model)) {\n return $this->redirect(['create_department']);\n }\n if ($model->load(Yii::$app->request->post())) {\n $model->save();\n Yii::$app->session->setFlash('success', 'User Department Updated successfully');\n return $this->redirect(['create_department']);\n } else {\n return $this->render('edit_department', ['model' => $model]);\n }\n }", "public function update(Request $request, $id)\n {\n $department = Department::find($id);\n if($department->name !== $request->name){\n $this->validate($request, [\n 'name' => 'required|unique:levels'\n ]);\n $department->name = $request->name;\n $department->save();\n return redirect()->route('department.index')->withSuccess('Department updates successfully');\n }\n return redirect()->route('department.index')->withErrors('No changes made');\n }", "public function update(Request $request, $id)\n {\n $data = $request->request->all();\n\n $department = Department::uuid($id);\n $department->update($data);\n\n notify()->flash('Sucesso!', 'success', [\n 'text' => 'Departamento atualizado com sucesso.'\n ]);\n\n return redirect()->route('departments');;\n }", "public function update(Request $request, $id)\n {\n $department = Departments::find($id);\n $department->update($request->all());\n return $department;\n }", "public function update(Request $request, $id)\n {\n //\n $data = $request->all();\n $users=User::all();\n $departments = Department::where('deleted_at',Null)->get();\n\n Department::find($id)->update($request->all());\n return view('department.index',compact('users','departments'));\n\n\n }", "public function update(Request $request)\n {\n $this->validate($request,[\n 'designation'=>'required|max:200',\n 'department'=>'required',\n ]);\n $designation = Designation::findOrFail($request->id);\n $designation->update([\n 'name'=>$request->designation,\n 'department_id'=>$request->department,\n ]);\n return back()->with('success',\"designation has been updated\");\n }", "public function update(DepartmentRequest $request, $id)\n {\n $department = Department::findOrFail($id);\n\n $data = [\n 'message' => 'success',\n 'data' => $department,\n ];\n $department->update([\n 'name' => $request->name,\n ]);\n\n return response()->json($data, 200);\n }", "public function proses_edit_department($id, Request $request){\n // Mencari data department yang ingin diedit berdasarkan id department tersebut.\n $department = Department::find($id);\n\n // Mengisi property nama pada object $department dengan nama baru yang didapat\n // dari form view yang ditampung oleh variabel $request.\n $department->nama = $request->nama;\n // Menyimpan perubahan ke dalam database.\n $department->save();\n\n return redirect('/department/'.$id);\n }", "public function update(Request $request, Area $area, Department $department)\n {\n $rules = [\n 'name' => 'max:100'\n ];\n\n $this->validate($request, $rules);\n\n $this->verificarArea($area,$department);\n\n $department->fill($request->intersect([\n 'name'\n ]));\n\n if ($department->isClean()) {\n return $this->errorResponse('Se debe especificar algun valor para actualizar', 422);\n }\n\n $department->save();\n\n return $this->showOne($department);\n\n }", "public function update(Request $request, $id )\n {\n \n\n $this->validate($request, [\n 'designation_name' => 'required|min:2|max:255',\n \n ]);\n\n $designation =Designation::findOrFail($id);\n $designation->designation_name=$request->designation_name;\n $designation->department_id=$request->department_id;\n $designation->save();\n Session::flash('success', 'The Designation was successfully saved!');\n return redirect()->route('designations.index');\n }", "public function update(Request $request, $id)\n {\n $department = Department::find($id);\n\n $department->update($request->all());\n\n return response()->json(self::SUCCESSFULLY_ADDED);\n }", "public function update(Request $request, $id)\n {\n try{\n $data = $this->requestData;\n $data['id'] = $id;\n\n $rules = Department::CREATE_RULES+['id'=>'required|exists:departments'];\n $validation = Validator::make($data, $rules,ValidatorHelper::messages());\n if($validation->passes())\n {\n $this->departmentRepository->update($data,$id);\n return JsonResponse::respondSuccess(trans(JsonResponse::MSG_UPDATED_SUCCESSFULLY));\n }\n else\n {\n return JsonResponse::respondError($validation->errors()->all());\n }\n }\n catch(\\Exception $ex)\n {\n return JsonResponse::respondError($ex->getMessage());\n }\n }", "public function update(UpdateDepartment $request, $id)\n {\n $data = $request->validated();\n\n current_user()->updateDepartment($id, $data);\n\n return response()->json([\n 'message' => 'Sửa khoa thành công.',\n 'redirect_to' => 'RELOAD',\n ]);\n }", "public function dept_edit_one(){\n $inputdata = file_get_contents('php://input');\n $inputdata = @json_decode($inputdata,true);\n $model = D($this->name_dept);\n $dept_id = isset($inputdata['ID'])?$inputdata['ID']:null;\n // check exists\n $d_dept = D($this->name_dept)->gainEasyOneDept($dept_id);\n if(empty($d_dept)){\n $outputs['code'] = 500;\n $outputs['msg'] = 'not exists department';\n return $outputs;\n }\n\n $edit_data = $model->formatDeptFields($inputdata,$d_dept);\n $edit_data = $edit_data['data'];\n if(empty($edit_data['ID'])){\n $outputs['code'] = 500;\n $outputs['msg'] = 'Empty ID';\n return $outputs;\n }\n\n $outputs = array();\n if($ret = $model->create($edit_data)) {\n if($isok = $model->save($model->data(''))) {\n $outputs = array(\n 'updateRows' =>$isok,\n );\n }else{\n $outputs['code'] = 500;\n $outputs['msg'] = 'Error'.$model->getError();\n return $outputs;\n }\n }else{\n $outputs['code'] = 500;\n $outputs['msg'] = 'Error'.$model->getError();\n return $outputs;\n }\n return $outputs;\n }", "public function update(DepartmentRequest $request, $id)\n {\n $department = $this->departmentService->getById($id);\n $this->authorize('update',$department);\n $validatedData = $request->validated(); \n $validatedData['id']=$id;\n \n \n if ($request->hasFile('icon')) {\n $validatedData['icon'] = $this->ImageUpload($request, 'icon', 'department/', 'department_');\n \n } \n \n $this->departmentService->createOrUpdate($validatedData); \n Session::flash('message','Information updated successfully!!!!');\n return redirect()->route('departments.index');\n }", "public function update(Request $request, $ID_No)\n {\n \n $data = $this->validate($request,[\n 'Cmp_No' => 'sometimes',\n 'Depm_Main' => 'sometimes',\n 'Depm_NmAr' => 'sometimes',\n 'Depm_NmEn' => 'sometimes',\n ],[],[\n 'Cmp_No' => trans('admin.Cmp_No'),\n 'Depm_Main' => trans('admin.Depm_Main'),\n 'Depm_NmAr' => trans('admin.Depm_NmAr'),\n 'Depm_NmEn' => trans('admin.Depm_NmEn'),\n ]);\n \n $department = DepmCmp::findOrFail($ID_No);\n // dd($data);\n $department->update($data);\n return redirect()->route('hrdepartments.index')->with(session()->flash('message',trans('admin.success_update')));\n }", "public function update(InternalRequest $request, $id)\n {\n $editRequest = Internal::findOrFail($id);\n\n $input = $request->all();\n \n $editRequest->update($input);\n \n return redirect('Department');\n }", "public function update($objetDepart, $objetFinal);", "public function update(DepartamentRequest $request, $id)\n {\n $this->service->save($request, $this->model::findOrFail($id));\n\n return redirect()->route(static::ROUTE_INDEX);\n }", "public function update(Request $request, $id)\n {\n $validatedData = $request->validate([\n 'name' => 'required',\n 'name_abbreviation' => 'required',\n\n \n ]);\n $section = Section::find($id);\n $section_dept_id = $section->department_id;\n $section_dept = Section::find($section_dept_id);\n $departments = Department::all();\n\n $section->name = $request['name'];\n $section_dept_id = $request['department_id'];\n $section->name_abbreviation = $request['name_abbreviation'];\n $section->save();\n $section_dept -> save();\n return redirect()->route('sectioning')->with('success', 'section updated successfully');\n }", "public function update(Request $request, $division_id, $department_id, $section_id)\n {\n $section = Section::findOrFail($section_id);\n $section->fill($request->all());\n $section->save();\n \n return redirect(route('admin.divisions.departments.sections.index', [$division_id, $department_id]));\n }", "public function update(Request $request, $id)\n {\n $staff = User::findOrFail($id);\n\n $this->validate($request, [\n 'name' => 'required|max:255',\n 'email' => 'required|email|unique:users,email,'.$id,\n 'department_id' => 'bail|required|numeric',\n 'role' => 'required'\n ]);\n\n $staff->name = $request->name;\n $staff->email = $request->email;\n $staff->role = 'staff';\n\n if($request->auto_generate == 'on'){\n\n \n\n } else {\n $this->validate($request, [\n 'password' => 'bail|required|min:6'\n ]);\n $password = trim($request->password);\n $staff->password = Hash::make($password);\n } \n \n // $staff->password = Hash::make($password);\n\n if($staff->save() ){\n\n DB::table('departments_users')\n ->where('user_id', $id)\n ->update(['department_id' => $request->department_id]);\n Session::flash('success', 'Staff Information updated successfully.');\n return redirect()->route('staffs.show', $staff->id);\n } else {\n Session::flash('danger', 'Sorry a problem occured while creating staff.');\n return redirect()->route('staffs.create');\n }\n }", "public function setDepartment($department)\n {\n $this->department = array_search($department, $this->aDepartment);\n }", "public function edit(TeacherDepartment $teacherDepartment)\n {\n //\n }", "public function update($id)\n\t{\n\t\t$inputs = Input::only('department_id', 'department_name', 'department_head');\n\n\t\ttry {\n\t\t\t$this->updateDepartmentProfileForm->validate($inputs);\n\t\t}\n\t\tcatch(FormValidationException $error) {\n\t\t\treturn Redirect::back()->withInput()->withErrors($error->getErrors());\n\t\t}\n\n\t\textract($inputs);\n\n\t\t$updateDepartment = $this->execute(new UpdateDepartmentCommand($id, $department_id, $department_name, $department_head));\n\n\t\tif($updateDepartment) {\n\t\t\tFlash::success('Profile of ' . $department_name . ' has been successfully updated! <a href=\"' . URL::route('departments.show', $department_id) . '\"> View department profile.</a>');\n\t\t}\n\t\telse {\n\t\t\tFlash::error('Failed to edit profile of ' . $department_name . ' department!');\n\t\t}\n\n\t\treturn Redirect::route('departments.edit', $department_id);\n\t}", "public function update(Request $request, int $departmentId)\n {\n $department = Department::findOrFail($departmentId);\n $pk = $request->input('pk');\n $value = $request->input('value');\n\n $data = $department->data()->firstOrCreate([\n 'month' => $request->input('name'),\n 'year' => $request->input('year')\n ]);\n\n\n $data->update([\n $request->input('pk') => $pk === 'average_salary' ? VND_to_number($value) : $value,\n ]);\n\n $data->refresh();\n\n $budgetData = $this->getBudgetData((int) $request->input('year'), $departmentId);\n\n return ['success' => true, 'total_working_hours_in_month' => $data->total_working_hours_in_month, 'month' => $data->month, 'budgetData' => $budgetData];\n }", "public function update(User $user, Department $department)\n {\n return true;\n }", "public function update(Request $request, $id)\n {\n $departamento = Department::findOrFail($id);\n\n $this->validate($request, [\n 'name' => 'min:3',\n 'description' => 'max:255',\n 'chief' => 'Integer|min:1',\n ]);\n\n if ($request->has('name')){\n $departamento->name = $request->name;\n }\n if ($request->has('description')){\n $departamento->description = $request->description;\n }\n if ($request->has('chief')){\n $departamento->chief = $request->chief;\n }\n\n if (!$departamento->isDirty()){\n return $this->errorResponse('Debe especificar al menos un valor diferente para cambiar', 422);\n }\n\n $departamento->save();\n\n return $this->showOne($departamento);\n }", "public function update(Request $request,$departements)\n {\n $da=Departements::find($departements);\n $da->nom_departement=$request->nom_departement;\n $da->save();\n return redirect('departement'); \n }", "public function edit(Department $department)\n {\n $department->load('langs');\n foreach ($department->langs as $lang) {\n foreach (['name', 'title', 'description'] as $elem) {\n $key = $elem . '_' . systemTrans($lang['lang_id']);\n $department->$key = $lang[$elem];\n }\n }\n return view('admin.department.edit', ['department' => $department]);\n }", "public function testSetDepartment()\n {\n\n // new entity\n $team = new Team();\n\n // dummy entity\n $department = new Department();\n $department->setName('NTNU');\n\n // Use the setDepartment method\n $team->setDepartment($department);\n\n // Assert the result\n $this->assertEquals($department, $team->getDepartment());\n }", "public function update(UpdateDepartmentRequest $request, Department $department)\n {\n $department->update($request->validated());\n return response()->json(new DepartmentResource($department));\n }", "public function update(Request $request, $id)\n {\n //update 返回 bool\n //var_dump(Department::find($id));die();\n $re = $this->repository->update($request->input(), $id);\n if ($re) {\n return $this->success(Orderlist::find($id));\n //return 1;\n } else {\n return $this->error();\n //return 2;\n }\n }", "public function update(Request $request, $id)\n {\n \n\n $validator = Validator::make($request->all(), [\n 'descricao' => 'required',\n 'abreviatura' => 'required',\n \n \n ]);\n if($validator->fails()){\n \\Session::flash('warning','Por favor preencha os campos assinalados');\n return Redirect::to('/editardepartamento/'.$id)->withInput()->withErrors($validator);\n }\n $departamento = departamento::find($id);\n $departamento->descricao = $request['descricao'];\n $departamento->abreviatura = $request['abreviatura'];\n \n $departamento->save();\n \\Session::flash('success', 'O departamento '. $request->descricao .' foi editado com sucesso');\n\n // escrever log \n return Redirect::to('/departamentos');\n \n \n }", "public function store(DepartmentRequest $request)\n {\n //save the data to the database\n $department = new Department ;\n $department->name = $request->name;\n $department->save();\n }", "public function update(Request $request)\n {\n $id = pathinfo($request->path())['basename'];\n if(Departamento::where('id', $id)->update($request->validate($this->rules))) {\n return $this->success('Departamento alterado com sucesso');\n } else {\n return $this->error('Oops! Algo não deu certo!');\n }\n }", "public function edit($department)\n {\n $department =Department::where('company_department_id',$department)->first();\n return view('admin.department.update',compact('department'));\n }", "private function setDepartmentProperties($department, $request) {\n $department->title = $request->title;\n }", "public function saveDepartment()\n {\n \t$response = Curl::to('http://api.dev.tawasul.shurooq.gov.ae/api/departments')\n ->withData( array( 'key' => 'ADF767DGH' ) )\n ->asJson()\n ->get();\n \n\n foreach ($response as $key => $res) {\n \t$departmentName = $res->Department;\n \n \t$departmentDetails = DepartmentTranslation::where('name', $departmentName )->get();\n\n if($departmentDetails->count() == 0)\n {\n $department = new Department;\n \n\n $department->status = 'Active';\n $department->save();\n $department_id = $department->id;\n\n foreach ($this->lang_locales as $locale) {\n $departmentDetails = new DepartmentTranslation;\n $departmentDetails->department_id = $department->id;\n $departmentDetails->locale = $locale->code;\n $departmentDetails->name = $departmentName;\n $departmentDetails->save();\n }\n \n }\n }\n\n }", "public function update(Request $request, $id)\n {\n //\n $employs = \\App\\Employ::find($id);\n if($employs ) $employs->update([\n 'matricule' => $request->input('matricule'),\n 'nom' => $request->input('nom'),\n 'prenom'=> $request->input('prenom'),\n 'adresse'=> $request->input('adresse'),\n 'telephone'=> $request->input('telephone'),\n 'Department_id'=> $request->input('Department_id')\n \n ]);\n return redirect()->route('Employ.index')->with(['success' => \"Employe modifier\"]);\n }", "public function store(Request $request)\n { \n $dept = new Department;\n $department = Department::where('department',Input::get('department'))\n ->where('orgId',Input::get('organisation'))\n ->where('officeId',Input::get('office'))\n ->first();\n \n if(empty($department))\n {\n $dept->department = Input::get('department'); \n $dept->numberOfEmployees = Input::get('noOfEmp');\n $dept->orgId = Input::get('organisation');\n $dept->officeId = Input::get('office');\n $dept->status = 'Active';\n $dept->lead_name = Input::get('lead_name');\n $dept->lead_email = Input::get('lead_email');\n $dept->lead_mobile = Input::get('lead_mobile'); \n $dept->created_at = date('Y-m-d H:i:s');\n\n $dept->save();\n $insertedId = $dept->id;\n\n //redirect('admin/organisation');\n return \\Redirect::route('department.index')->with(['message'=>'Department added successfully.']);\n }\n else\n {\n return \\Redirect::route('department.index')->with(['message'=>'Department already exists.']);\n\n }\n }", "public function edit(DepartmentModel $departmentModel)\n {\n //\n }", "public function edit(Department $department)\n {\n if(Auth::user()->role == 'superadmin'){\n $institutions = Institution::all();\n }else{\n $institutions = Institution::where('id', Auth::user()->institution_id)->get();\n }\n $schools = School::where('institution_id', $department->school->institution->id)->get();\n return view('tertiary.departments.edit', ['department' => $department, 'institutions' => $institutions, 'schools' => $schools]);\n }", "function manage_department($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\t\n\t\tif ($param1 == 'create') {\n\t\t\t$data['name'] = $this->input->post('name');\n\t\t\t$data['description'] = $this->input->post('description');\n\t\t\t$this->db->insert('department', $data);\n\t\t\t$this->session->set_flashdata('flash_message', get_phrase('department_opened'));\n\t\t\tredirect(base_url() . 'index.php?reception/manage_department', 'refresh');\n\t\t}\n\t\tif ($param1 == 'edit' && $param2 == 'do_update') {\n\t\t\t$data['name'] = $this->input->post('name');\n\t\t\t$data['description'] = $this->input->post('description');\n\t\t\t$this->db->where('department_id', $param3);\n\t\t\t$this->db->update('department', $data);\n\t\t\t$this->session->set_flashdata('flash_message', get_phrase('department_updated'));\n\t\t\tredirect(base_url() . 'index.php?reception/manage_department', 'refresh');\n\t\t\t\n\t\t} else if ($param1 == 'edit') {\n\t\t\t$page_data['edit_profile'] = $this->db->get_where('department', array(\n\t\t\t\t'department_id' => $param2\n\t\t\t))->result_array();\n\t\t}\n\t\t$page_data['page_name'] = 'manage_department';\n\t\t$page_data['page_title'] = get_phrase('manage_department');\n\t\t$page_data['departments'] = $this->db->get('department')->result_array();\n\t\t$this->load->view('index', $page_data);\n\t\t\n\t}", "public function update(DeptStandardForm $request, $id)\n {\n $deptStandard = DeptStandard::find($id);\n $deptStandard->parent_id = $request['parent_id'];\n $deptStandard->name = $request['name'];\n\n try {\n if ($deptStandard->save()) {\n return redirect()->route('dept.index')->withSuccess('编辑科室成功');\n } else {\n return redirect()->back()->withErrors(array('error' => '更新数据失败'))->withInput();\n }\n } catch (\\Exception $e) {\n return redirect()->back()->withErrors(array('error' => $e->getMessage()))->withInput();\n }\n }", "public function update(Request $request, $id)\n {\n\n\n $this->validate($request, [\n 'full_names' => 'required',\n 'email' => 'required|email',\n //'password'=>'min:6',\n ]);\n\n $user = User::findOrFail($id);\n\n\n\n $user->name = $request->input('full_names');\n $user->email = $request->input('email');\n\n if (!empty($request->input('password'))) {\n $user->password = Hash::make($request->input('password'));\n }\n\n $user->organization_id = $request->input('organization');\n $user->country_id = $request->input('country');\n $depts = $request->input('department');\n $user->telephone = $request->input('telephone');\n\n $user->save();\n $updated_user = $user->id;\n\n $depts_ids = DB::table('user_departments_mapping')\n ->select(DB::raw('user_departments_mapping.*'))\n ->where('user_departments_mapping.user_id', '=', $updated_user)\n ->delete();\n\n $user_depts = array();\n foreach ($depts as $key => $value) {\n\n $save_user_depts = DB::table('user_departments_mapping')->insertGetId(['user_id' => $updated_user, 'mapping_dept_id' => $value]);\n }\n\n //$save_user_depts = DB::table('user_departments_mapping')->insertGetId($user_depts);\n\n\n\n\n\n\n\n $user->syncRoles($request->role);\n\n return redirect('admin/user')->with('success', 'User updated!');\n }", "public function edit($id)\n {\n $department = Department::findOrFail($id);\n $this->department_id = $id;\n $this->name = $department->name;\n \n //$this->updateMode = true;\n $this->openModal(); \n }", "public function edit(Department $department,$id=0)\n {\n $tab=\\DB::table('departments')->find($id);\n $tabData=\\DB::table('departments')\n ->select('departments.id','departments.name')\n ->get();\n return view('apps.pages.SupportTicket.department',['dataRow'=>$tab,'role'=>$tabData,'edit'=>true]);\n }", "public function update(Request $request, Employee $employee)\n {\n $request->validate([\n 'name' => 'required|string',\n 'salary' => 'required|integer',\n 'department_id' => 'required|integer',\n ]);\n\n $employee->saveData($request->salary,$request->department_id ,$request->name);\n \n\n return redirect()->route('employees.index')\n ->with('success','Employee updated successfully');\n }", "public function updateDepartment($id, $dept_name, $new_id, $new_dept_name, $status, $postby_id, $verifiedby_id){\n\t\t\t// echo '<br><br>This is me inside '.$id.' and '.$new_id;\n\t\t\t// die();\n\t\t\t$sql = \"SELECT * FROM `department` WHERE `id` <> '$id' AND `dept_name` <> '$dept_name' AND `status` = 'ON' \";\t\t\t\n\t\t\t\n\t\t\t$query = $this->execute($sql);\n\t\t\t// echo '<br><br>'. $sql.' and '.$query;\n\t\t\t\twhile($result = mysqli_fetch_array($query)){\n\t\t\t\t\t// echo '<pre>';\n\t\t\t\t\t// print_r($result['id']);\n\t\t\t\t\t// print_r($result['dept_name']);\n\t\t\t\t\t// echo '</pre>';\n\n\t\t\t\t\tif($new_id == $result['id'] && $new_dept_name == $result['dept_name']){\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\telse if($new_id == $result['id']){\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t}\n\t\t\t\t\telse if($new_dept_name == $result['dept_name']){\n\t\t\t\t\t\treturn 3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$sql = \"UPDATE `department` SET `id` = '$new_id', `dept_name` = '$new_dept_name', `status` = '$status', `postby_id` = '$postby_id', `verifiedby_id` = '$verifiedby_id' WHERE `id` = '$id' \";\n\t\t\t\t$query1 = $this->execute($sql);\n\t\t\t\tif($query1){\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\treturn mysqli_error();\n\t\t\t\t\texit();\n\t\t\t\t}\t\t\t\n\t\t}", "public function edit(Department $department)\n {\n // print($department->deptno);exit;\n return view('department.edit',['locations' => $this->locations,'department'=>$department]);\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' =>'required',\n 'description' => 'required',\n 'logo' => 'nullable|image'\n ]);\n\n $department = Department::find($id);\n $department->edit($request->all());\n $department->uploadLogo($request->file('logo'));\n $department->setUsers($request->get('users'));\n\n return redirect()->route('department.index');\n }", "public function update(Request $request, Depense $depense)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $data = $request->validate([\n 'name' => 'required|string',\n 'position' => 'required|string',\n 'employment' => 'required|date',\n 'ratio' => 'required|numeric',\n 'name_head_depart' => 'required|string',\n ]);\n\n\n //for search id departament\n $nameHeadDepart = $request->name_head_depart;\n $departamentId = Department::select('id')->where('name_head_depart', $nameHeadDepart)->first();\n\n //for search id position\n $namePosition = $request->position;\n $positionId = Position::select('id')->where('name_position', $namePosition)->first();\n\n //for prepare date\n $date = $request->employment;\n $myDate = date('Y-m-d H:i:s', strtotime($date));\n\n $employe = Employe::find($id);\n $employe->full_name = $request->name;\n $employe->employment = $myDate;\n $employe->ratio = $request->ratio;\n $employe->id_departament = $departamentId->id;\n $employe->id_positione = $positionId->id;\n $employe->save();\n\n EmployeResource::withoutWrapping();\n return new EmployeResource(Employe::with('position', 'department')->find($id));\n }", "public function update(Request $request, $id)\n {\n $rules = array(\n 'hospital_department_id' => 'required',\n 'first_category_id' => 'required',\n 'second_category_id' => 'required',\n 'name' => 'required',\n 'description' => 'required',\n 'price' => 'required',\n 'discount' => 'required',\n 'duration' => 'required'\n\n );\n\n $this->validate($request, $rules);\n\n $program = HospitalProgram::find($id);\n $program->hospital_department_id = $request->get('hospital_department_id');\n $program->first_category_id = $request->get('first_category_id');\n $program->second_category_id = $request->get('second_category_id');\n $program->thrid_category_id = $request->get('thrid_category_id');\n $program->name = $request->get('name');\n $program->description = $request->get('description');\n $program->price = $request->get('price');\n $program->discount = $request->get('discount');\n $program->duration = $request->get('duration');\n $program->status = $request->get('status');\n $program->updated_at = Carbon::now();\n $program->save();\n\n $hospital_name = \\Auth::guard('merchant')->user()->name;\n $department_name = \\App\\HospitalDepartment::where('id', $program->hospital_department_id)->value('name');\n\n $content = [\n 'title' => 'Partner has update a Program',\n 'hospital_name' => $hospital_name,\n 'department' => $department_name,\n 'program' => $program->name,\n\n ];\n\n // $receiverAddress = $email_hospital;\n // $receiverAddress = '[email protected]';\n\n // Mail::to($receiverAddress)->send(new ProgramUpdated($content));\n\n return redirect('merchant/hospital-programs');\n\n\n }", "function ubah_department($data) {\n global $conn;\n\n $id_department = htmlspecialchars($data['id_department']);\n $ket_department = htmlspecialchars($data['department']);\n $updated_at = htmlspecialchars($data['updated_at']);\n\n $result = mysqli_query($conn, \"SELECT * FROM department WHERE ket_department = '$ket_department' \");\n if (mysqli_fetch_assoc($result)) {\n echo \"<script>Swal.fire({\n title: 'Failed!',\n text: 'Department already exists',\n icon: 'error',\n confirmButtonText: 'OK'\n });</script>\";\n return false;\n }\n $query = \"UPDATE department \n SET \n ket_department = '$ket_department',\n updated_at = '$updated_at'\n WHERE id_department = '$id_department'\";\n \n mysqli_query($conn, $query);\n\n return mysqli_affected_rows($conn);\n }", "public function update(Request $request, $id)\n {\n \n //dd($request->all());\n\n $reglas=[\n 'deparamento_id'=>'required',\n 'municipio_id'=>'required'\n ];\n\n $this->validate($request,$reglas);\n\n $departamento_id= $request->input('deparamento_id');\n $municipio_id= $request->input('municipio_id');\n $idDepartamento= empresa::where('fk_departamento_id',$departamento_id)->where('fk_municipio_id',$municipio_id)->exists(); \n \n\n\n $empresa= empresa::find($id);\n $empresa->nit= $request->input('nit');\n $empresa->nombre_empresa=$request->input('nombre_empresa');\n $empresa->razon_social=$request->input('razon_social');\n $empresa->fk_departamento_id=$request->input('deparamento_id');\n $empresa->fk_municipio_id=$request->input('municipio_id');\n\n $empresa->update();\n \n flash()->success('editado exitosamente');\n return Redirect::to('/empresa');\n }", "public function update(Request $request, Departamento $departamento)\n {\n $input = $request->all();\n \n $validator = Validator::make($input, [\n 'nom_dep' => 'required'\n ]);\n \n if($validator->fails()){\n return $this->sendError('Validation Error.', $validator->errors()); \n }\n \n $departamento->nom_dep = $input['nom_dep'];\n \n $departamento->save();\n \n return $this->sendResponse(new DepartamentoResource($departamento), 'Departamento updated successfully.');\n }", "public function update(DepartamentoEditarRequest $request, $id)\n {\n $dataDepartamento = $request->except([\"_token\",\"_method\"]);\n $type = \"danger\";\n $message =\"Error al Editar departamento\";\n if (Department::where(\"id\",'=',$id)->update($dataDepartamento)) {\n $type = \"success\";\n $message =\"Departamento editada correctamente\";\n }\n return redirect()->route('departamentos.index')->with(['type'=>$type, 'message'=> $message]);\n }", "public function update(Request $request, debt $debt)\n {\n //\n }", "public function update(Request $request, RoomType $roomType, Branch $branch = null, Department $department = null)\n {\n //\n\n }", "public function update(Request $request, Departamento $departamento)\n {\n $departamento->nome = $request->input(\"nome_departamento\");\n $departamento->nome_coordenador = $request->input(\"nome_coordenador\");\n $departamento->sala_funcionamento = $request->input(\"sala_funcionamento\");\n $departamento->save();\n return redirect()->route('departamentos.index');\n }", "public function testUpdateEmployee()\n {\n }", "public function update(Request $request, $id)\n {\n // $rules = [\n // 'pro_name' => 'required|min:1|max:255',\n // 'pro_des' => 'required|max:50',\n // 'pro_price' => 'required',\n // 'pro_stock' => 'required',\n // 'cate_id' => 'required',\n // ];\n // $validator = Validator::make($request->all(), $rules);\n // if ($validator->fails())\n // {\n // return response()->json($validator->errors(), 400);\n // }\n // $product = Product::find($id);\n // if (is_null($product))\n // {\n // return response()->json(['message'=> 'Record not found'],404);\n // }\n\n // $product->update($request->all());\n // // return response()->json($department, 201);\n // return response()->json('Updated successfully', 200);\n }", "public function update(Request $request, $id)\n {\n $data=$this->validate(request(),[\n 'name'=>'required',\n 'description'=>'required',\n 'doctor_id'=>'required|exists:departments,id',\n 'department_id'=>'required|exists:departments,id',\n 'detection_price'=>'required',\n 'return_price'=>'required',\n\n ],[],[\n 'name'=> trans('admin.name'),\n 'description'=> trans('admin.description'),\n 'department_id'=> 'القسم',\n 'doctor_id'=> 'الدكتور',\n 'detection_price'=> 'سعر الكشف',\n 'return_price'=> 'سعر الاعادة',\n ]);\n Service::where('id',$id)->update($data);\n session()->flash('success',trans('admin.update_added'));\n return redirect(url('service'));\n }", "public function store()\n {\n $validatedDate = $this->validate([\n 'name' => 'required',\n ]);\n \n Department::updateOrCreate(['id' => $this->department_id],[\n 'name' => $this->name, \n ]);\n \n // session()->flash('message', 'expense Created Successfully.');\n \n // $this->resetInputFields();\n\n session()->flash('message', $this->department_id ? $this->name . ' Departiment Created Successfuly': $this->name . ' Departiment Created Successfuly');\n $this->closeModal(); //TUTUP MODAL\n $this->resetFields();\n }" ]
[ "0.76518184", "0.7563651", "0.7559056", "0.7527306", "0.7493372", "0.74815035", "0.73933464", "0.7333515", "0.7333493", "0.7330726", "0.73276854", "0.7318367", "0.73138744", "0.7267087", "0.72540075", "0.72415054", "0.7212387", "0.72118163", "0.7207419", "0.7205662", "0.7202371", "0.71396244", "0.71306306", "0.7118773", "0.71186095", "0.7065027", "0.7053264", "0.7017191", "0.6970581", "0.6940854", "0.69318646", "0.6896197", "0.6894796", "0.68731856", "0.6868156", "0.68609357", "0.6809629", "0.6799457", "0.67974985", "0.6795681", "0.67469436", "0.6743051", "0.6739656", "0.6707311", "0.66953814", "0.66868997", "0.6673029", "0.662912", "0.6588727", "0.6587847", "0.6586182", "0.655385", "0.6538282", "0.65298903", "0.6528238", "0.64986277", "0.6484712", "0.64805675", "0.6463509", "0.64522284", "0.6450412", "0.6423261", "0.6412834", "0.64036065", "0.6396337", "0.6389496", "0.637344", "0.63728094", "0.634644", "0.6333361", "0.63300353", "0.6327683", "0.6325918", "0.63249886", "0.63030535", "0.6297697", "0.62964284", "0.62740904", "0.6267486", "0.62604886", "0.62577164", "0.6236994", "0.6211942", "0.6197976", "0.6197508", "0.6190122", "0.6176548", "0.6174769", "0.61738807", "0.6170359", "0.6168306", "0.6167614", "0.6117683", "0.6087016", "0.60716486", "0.60548884", "0.6042266", "0.603469", "0.6033585", "0.6030423", "0.6021978" ]
0.0
-1
This method will delete a Department
public function deleteDepartments($id) { $this->em = $this->getEntityManager(); $qb = $this->em->createQueryBuilder('p') ->delete('CorporateBundle:CorpoDepartments', 'p') ->where("p.id = :ID") ->setParameter(':ID', $id); $query = $qb->getQuery(); return $query->getResult(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteById($departmentId);", "public static function delete($id) {\n DB::query('DELETE FROM Department WHERE id = :id', array('id' => $id));\n }", "public function destroy(Department $department,$id=0)\n {\n if($id==1)\n {\n $this->sdc->log(\"Department\",\"Department name Failed to deleted (Super Admin)\");\n return redirect('Department')->with('error', $this->moduleName.' Super Admin not deleteable.');\n }\n else\n {\n $tab=\\DB::table('departments')->where('id',$id)->delete();\n $this->sdc->log(\"Department\",\"Department name deleted\");\n return redirect('Department')->with('status', $this->moduleName.' Deleted Successfully !');\n }\n }", "public function deleteDepartment(Request $request, $id) {\n $department = Department::find($id);\n if (is_null($department)) {\n return response()->json([\n 'success' => false,\n 'statusCode' => 404,\n 'message' => 'Department not found']);\n }\n $department ->delete();\n return response()->json([\n 'success' => true,\n 'statusCode' => 204,\n 'message' => 'Successfully deleted clearance department',\n 'data' => null]);\n }", "public function deleteDept(){\n\t\t$incomingFormData = $this->readHttpRequest();\n\t\t$formData = json_decode($incomingFormData);\n\t\t$deleteResult = $this->department_model->deleteDept($formData);\n\t\t$depListFlag = 1;\n\t\tif($deleteResult == true){\n\t\t\t$data['status'] = 'ok';\n\t\t\t\t}else{\n\t\t\t$data['status'] = 'fail';\n\t\t\t}\n\t\t$departmentList = $this->index($depListFlag); // call department List\n\t\t$data['departmentList'] = $departmentList;\n\t\techo json_encode($data);\n\t}", "public static function deleteDept($input)\n\t{\n Data_Department_Department::find($input['id'])->delete();\n\n Log::write(\n\t\t\tLang::line('admin.department')->get(), \n\t\t\tLang::line('global.delete')->get().' <strong>'.$input['name'].'</strong> \n\t\t\t'.Lang::line('global.by')->get().' <code>'.Auth::user()->su_username.'</code>'\n\t\t);\n\t\tTrail::log(\n\t\t\tLang::line('admin.department')->get(), \n\t\t\tAuth::user()->su_id, \n\t\t\tLang::line('global.delete')->get().' <strong>'.$input['name'].'</strong> \n\t\t\t'.Lang::line('global.by')->get().' <code>'.Auth::user()->su_username.'</code>'\n\t\t);\n }", "public function proses_delete_department($id){\n // Mencari data department yang ingin dihapus pada database berdasarkan $id department.\n $department = Department::find($id);\n // Melakukan pemanggilan fungsi delete() pada object department.\n $department->delete();\n\n return redirect('/department');\n }", "public function destroy($id)\n {\n $department = Department::whereId($id)->delete();\n }", "public function delete(Request $request, $id){\n \n $department = Department::find($id);\n $department->is_active = '2';\n $department->updated_by = session()->get('session_name') ;\n $department->save();\n\n $request->session()->flash('alert-success', 'Department has been deleted successfully!');\n\n return redirect('department');\n }", "public function destroy(Department $department)\n {\n \n $department->delete();\n return redirect()->route('admin.department.index')->with('success','successfully deleted');\n \n }", "public function delete($id) {\r\n\r\n //product id \r\n $this->Department_model->delete($id);\r\n redirect('admin/departments');\r\n }", "public function destroy($department)\n {\n $department =Department::where('company_department_id',$department)->delete(); \n if($department){\n return back()->with('message',\"Department Successfully Deleted\");\n }else{\n return back()->with('message',\"Error in Deleting\");\n }\n }", "public function destroy($department_id)\n {\n $department = Department::findOrFail($department_id);\n $department->delete();\n\n session()->flash('alert-success', 'Deletado com sucesso!');\n return redirect()->back();\n }", "public function destroy(Department $department)\n {\n $department->delete();\n session()->flash('status', \"The Department $department->dname Has been Deleted Sucessfully\");\n return redirect(route('department.index'));\n print('delete');\n }", "public function delete_db($id){\n \t// find khusus untuk primary key di database\n \t$department = Department::find($id);\n \t$department->delete();\n\n \treturn redirect('department');\n }", "public function destroy(Department $department)\n {\n $department->delete();\n return redirect()->route('department.index')\n ->with('delete_success','Deleted successfully');\n }", "public function destroy($id)\n {\n $departamento = Department::find($id);\n $departamento->delete();\n }", "public function unassignDepartment() {\n if($this->department)\n $this->department()->delete();\n }", "public function destroy(TeacherDepartment $teacherDepartment)\n {\n //\n }", "public function deleteDepartment($Id)\n\t{\n\t\t$data = $this->data;\n\t\t$err_msg \t= \"Faill to delete record\";\n \t$succ_msg \t= \"Record deleted successfully\";\n \t\n \t$bID = base64_decode($Id);//exit();\n \t\t$this->userM->updateDetails($this->table,array('department_active'=>'E'),array('id'=>$bID)); \n \tif($this->db->affected_rows()>0){\t\t\n\t\t\techo $data['success'] = true;\n\t\t} \n \n\t if($data['success']==true){\n\t $this->setErrorMessage('success',$succ_msg);\n\t \n\t }else{\n\t $this->setErrorMessage('error_msg', $err_msg);\n\t \n\t\t}\n\t\tredirect(base_url('department-master'));\n\n\t}", "public function destroy($id)\n {\n $department = $this->departmentService->getById($id);\n $this->authorize('delete',$department);\n $department = $this->departmentService->delete($id);\n \n if ($department) {\n Session::flash('message','Information deleted successfully!!!!');\n }\n return redirect()->route('departments.index');\n }", "public function delete_designation($dept_id, $id) {\n // if data exist do not delete the department\n // else delete the department \n \n $or_where = array('designations_id' => $id,'id_gsettings' => $this->session->userdata('id_gsettings'));\n $get_existing_id = $this->department_model->check_by($or_where, 'tbl_employee');\n if (!empty($get_existing_id)) {\n $type = \"error\";\n $message = \"Designation Information Already Used !\";\n } else {\n // delete all designations by id\n $this->department_model->_table_name = \"tbl_designations\"; // table name\n $this->department_model->_primary_key = \"designations_id\"; // $id\n $this->department_model->delete($id);\n $type = \"success\";\n $message = \"Designation Information Successfully Delete!\";\n }\n set_message($type, $message);\n redirect('admin/department/add_department/' . $dept_id); //redirect page\n }", "public function destroy($id)\n {\n $delete = Internal::findOrFail($id);\n $delete->delete();\n\n return redirect('Department');\n }", "public function destroy(Department $department)\n {\n if($department->delete()){\n return redirect()->route('departments.index')->with('success','Department Deleted Successfully');\n }\n return back();\n }", "public function destroy(Department $department): RedirectResponse\n {\n $department->delete();\n\n return AdminResourceFactory::destroy('admin.departments.index')\n ->entity($this->entitySingular, $this->entityPlural)\n ->build();\n }", "public function destroy($department)\n {\n $department = Department::findOrFail($department);\n $department->deleted_at = Carbon::now();\n $department->save();\n\n $departments = Department::where('deleted_at',Null)->get();\n $users = User::all();\n return view('department.index',compact('users','departments'));\n }", "public function destroy($id)\n {\n $department = Department::find($id);\n\n $department->delete();\n\n return redirect()->route('departments.index')->with('success','Department deleted successfully');\n }", "public function destroy(Department $department)\n {\n try {\n $department->delete();\n } catch (QueryException $e) {\n return redirect()->back()->with('error', 'error-delete-department');\n }\n\n File::delete('images/' . $department->image);\n File::delete('papers/' . $department->keyword);\n Cache::forget('departments');\n return redirect(action('Admin\\DepartmentController@index'))->with('success', 'deleted');\n }", "function DeleteDepartment($TransferTo=null){\n\t\tif(!$this->GetDeptByID()){\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get people and objects that still belong to this department\n\t\t$dev=new Device();\n\t\t$cab=new Cabinet();\n\t\t$dev->Owner=$cab->AssignedTo=$this->DeptID;\n\t\t$person=new People();\n\t\t$devices=$dev->GetDevicesbyOwner();\n\t\t$cabinets=$cab->GetCabinetsByDept();\n\t\t$users=$person->GetPeopleByDepartment($this->DeptID);\n\n\t\tforeach($devices as $d){\n\t\t\t// We've designated a new owner for this equipment, zero is valid as they might be setting it to general\n\t\t\tif(!is_null($TransferTo)){\n\t\t\t\t$d->Owner=$TransferTo;\n\t\t\t\t$d->UpdateDevice();\n\t\t\t}else{\n\t\t\t\t// This option is not being provided but us at this time, maybe through the API\n\t\t\t\t$d->DeleteDevice();\n\t\t\t}\n\t\t}\n\n\t\tforeach($cabinets as $c){\n\t\t\t// We've designated a new owner for these cabinets, zero is valid as they might be setting it to general\n\t\t\tif(!is_null($TransferTo)){\n\t\t\t\t$c->AssignedTo=$TransferTo;\n\t\t\t\t$c->UpdateCabinet();\n\t\t\t}else{\n\t\t\t\t// This option is not being provided but us at this time, maybe through the API\n\t\t\t\t$c->DeleteCabinet();\n\t\t\t}\n\t\t}\n\n\t\tforeach($users as $p){\n\t\t\t// If we don't have a value over 0 then we're just removing this department and they won't be added to another group\n\t\t\tif(!is_null($TransferTo) && intval($TransferTo)>0){\n\t\t\t\t// Add this user into the new department\n\t\t\t\t$sql=\"INSERT INTO fac_DeptContacts SET DeptID=\".intval($TransferTo).\", ContactID=$p->PersonID;\";\n\t \t\t\t$this->exec($sql);\n\t\t\t}\n\t\t}\n\t\n\t\t// Clear any users from this department\n\t\t$sql=\"DELETE FROM fac_DeptContacts WHERE DeptID=$this->DeptID;\";\n\t\t$this->exec($sql);\n\n\t\t// By this point all devices, objects, and users should have been shoved into a new department so finish cleaning up.\n\t\t$sql=\"DELETE FROM fac_Department WHERE DeptID=$this->DeptID;\";\n\n\t\tif(!$this->exec($sql)){\n\t\t\tglobal $dbh;\n\t\t\t$info=$dbh->errorInfo();\n\n\t\t\terror_log(\"PDO Error: {$info[2]} SQL=$sql\");\n\t\t\treturn false;\n\t\t}\n\n\t\t(class_exists('LogActions'))?LogActions::LogThis($this):'';\n\t\treturn true;\n\t}", "public function destroy($id)\n {\n \t$this->checkAuthorizedRoles($this->rolesArray);\n\n \t$item = Departments::delete($id);\n \n \tSession::flash('success', 'Oddelenie bolo odstránené!');\n\n \treturn redirect()->route('department.index');\n }", "public function destroy($id)\n {\n //\n Department::find($id)->delete();\n session()->flash('success', trans('admin.deleted_record'));\n return redirect(aurl('departments'));\n }", "public function destroy($id)\n {\n $employeeDepartment = EmployeeDepartment::find($id);\n $employeeDepartment->delete();\n return redirect('employee/department')->with('flash', 'Department deleted.');\n }", "public function destroy($id)\n\t{\n\t\tDepartment::destroy($id);\n\t\treturn Redirect::route('department.index')\n\t\t\t\t->with('message','Department Deleted!');\n\t}", "public function destroy($id)\n\t{\n\t\tDepartment::destroy($id);\n\t\treturn Redirect::route('departments.index');\n\t}", "public function destroy(Department $department)\n {\n $department->delete();\n return redirect()->back()->with('message', 'Department Removed Successfully!');\n }", "public function delete(Request $request)\n {\n $departmentDelete = DepartmentModel::where('id',$request->id)->delete();\n return response()->json([\n\n 'status'=>true,\n 'titlee'=>'Delete',\n 'msg'=>' Data Delete Successfully',\n 'typee'=>'warning'\n\n ],200);\n }", "public function deleteDepartmentById($param)\n {\n $id = $param['id'];\n $facultyId = DepartmentTable::getFacultyIdOf($id);\n $department = DepartmentTable::getById($id, $facultyId);\n\n $type = $department->getType();\n if($type == 4) {\n http_response_code(404);\n echo json_encode(array(\n 'message' => Constant::cannotDelete . Constant::objectNames['facultyOfficer']\n ));\n return;\n }\n\n switch ($_SESSION['role']) {\n case 1:\n if ($_SESSION['uid'] != $facultyId) {\n http_response_code(403);\n echo json_encode(array(\n 'message' => Constant::notPermissionText\n ));\n return;\n }\n break;\n case 4:\n if (!Middleware::isOfficerBelongToFaculty($_SESSION['uid'], $facultyId)) {\n http_response_code(403);\n echo json_encode(array(\n 'message' => Constant::notPermissionText\n ));\n return;\n }\n break;\n default:\n http_response_code(403);\n echo json_encode(array(\n 'message' => Constant::notPermissionText\n ));\n return;\n }\n\n $result = DepartmentTable::deleteById($id);\n\n if ($result['rowCount']) {\n http_response_code(204);\n } else {\n //if($result['data']['1'] && $result['data']['2']){\n http_response_code(400);\n echo json_encode(array(\n 'message' => Constant::cannotDelete . Constant::objectNames['department']\n ));\n }\n }", "function admin_delete($id = null, $dept=null) {\n\t\tif (!$id) {\n\t\t\t$this->Session->setFlash(__('Invalid id for user', true));\n\t\t\t$this->redirect(array('action'=>'index'));\n\t\t}\n\t\t$dept_obj = ClassRegistry::init('DepartmentsUser');\n\t\t$all_depts = $dept_obj->find('all',array('conditions'=>array('DepartmentsUser.user_id'=>$id)));\n\n\t\t$this->User->id=$id;\n\n\t\tif($this->User->saveField('status',2)){\n\t\t\tif(!empty($all_depts)){\n\t\t\t foreach($all_depts as $depts){\n\t\t\t\t $dept_obj->delete($depts['DepartmentsUser']['id']);\n\t\t\t }\n\t\t\t}\n\t\t\t$this->Session->setFlash(__('User deleted', true));\n\t\t\t$this->redirect(array('action'=>'index'));\n\t\t}\n\t\t$this->Session->setFlash(__('User was not deleted', true));\n\t\t$this->redirect(array('action' => 'index'));\n\t}", "public function destroy($id)\n\t{\n\t\t// Fetch the department record from the database.\n\t\t// \n\t\t$department = $this->departments->findById( $id );\n\n\t\t// Soft-delete the resource from storage.\n\t\t// \n\t\t$this->departments->delete( $id );\n\n\t\t// Successful department record message.\n\t\t// \n\t\t$message = sprintf( 'The <strong>%s</strong> department was successfully removed.' , $department->name );\n\n\t\t// Send the user back to the page they were at and display a message\n\t\t// that communicate a new department record was deleted.\n\t\t// \n\t\treturn Redirect::back()->withDepartmentDeleted( $message );\n\t}", "public function destroy(Department $department)\n {\n return response()->json($department->delete());\n }", "public function destroy($departmentID)\n\t{\n\t\t$department_name = $this->departments->getDepartmentName($departmentID); \n\n\t\t$removeDepartment = $this->execute(\n\t\t\tnew RemoveDepartmentCommand($departmentID)\n\t\t);\n\n\t\tif($removeDepartment) {\n\t\t\tFlash::success('Account of ' . $department_name . ' department has been successfully removed!');\n\n\t\t}\n\t\telse{\n\t\t\tFlash::success('Failed to remove account of ' . $department_name . ' department!');\n\n\t\t}\n\t\t\n\t\treturn \tRedirect::route('departments.index');\n\t}", "public function destroy($id)\n {\n Department::destroy($id);\n flash()->success('Success!', 'Department has been deleted!');\n return redirect('departments');\n }", "public function destroy(Department $department)\n {\n return response()->delete($department->delete());\n }", "public function destroy($id)\n {\n $delete = Departments::destroy($id);\n\n if ($delete) {\n return ['message' => 'department has been deleted successfully'];\n } else {\n return ['message' => 'Oops something went wrong'];\n }\n }", "public function destroy(DepartmentModel $departmentModel, $id)\n {\n $data = DepartmentModel::find($id);\n $data->delete();\n return 'Are you sure to delete?';\n }", "public function destroy($id)\n {\n try\n {\n $validation = Validator::make(['id'=>$id],['id'=>'required|exists:departments'],ValidatorHelper::messages());\n if($validation->passes())\n {\n $model = $this->departmentRepository->find($id);\n $this->departmentRepository->delete($model);\n return JsonResponse::respondSuccess(trans(JsonResponse::MSG_DELETED_SUCCESSFULLY));\n }\n else\n {\n return JsonResponse::respondError($validation->errors()->all());\n }\n }\n catch (\\Exception $ex)\n {\n return JsonResponse::respondError($ex->getMessage());\n }\n }", "public function destroy($id)\n {\n $department = Department::find($id);\n $department->status = 0;\n $department->save();\n return redirect()->back()->withSuccess('Department deleted successfully');\n }", "public function delete()\n {\n // If deposit is existing, will get database ID removed.\n $this->dbID = $this->db->deleteDeposit($this);\n }", "function hapus_department($id) {\n global $conn;\n\n mysqli_query($conn, \"DELETE FROM department WHERE id_department = '$id'\");\n return mysqli_affected_rows($conn);\n }", "public function destroy($id)\n {\n $now = Carbon::now('Africa/Nairobi');\n\n $data = Department::find($id)->delete();\n\n Log::critical(\"DEPARTMENT OF ID \" . $id . \" DELETED BY USER ID: \" . Auth::id() . \" NAME \" . Auth::user()->name . \" AT \" . $now);\n\n Toastr::success('Department deleted successfully');\n return back();\n }", "public function destroy($id)\n {\n Department::find($id)->remove();\n\n return redirect()->route('department.index');\n }", "public function destroy($ID_No)\n {\n $department = DepmCmp::findOrFail($ID_No);\n $department->delete();\n return redirect()->route('hrdepartments.index')->with(session()->flash('message',trans('hr.delete_success')));\n }", "public function destroy(Department $department)\n {\n if ($department->delete()) {\n return response()->json([\n 'message' => 'Department deleted successfully',\n 'status_code' => 200,\n ], 200);\n } else {\n return response()->json([\n 'message' => 'Some error occured. Please try again.',\n 'status_code' => 500,\n ], 500);\n }\n }", "public function destroy($id)\n {\n $depart = departments::find($id);\n\n $depart->delete();\n\n Session::flash('success', 'The department was successfully deleted.');\n\n return redirect()->route('depart.index');\n }", "public function destroy($id)\n {\n $model = new mainModel();\n $userid = session()->get('userid');\n $timaestamp = date(\"Y-m-d H:i:s\");\n $id = Crypt::decrypt($id);\n $data['UPDATED_BY'] = $userid;\n $data['UPDATED_AT'] = $timaestamp;\n $data['FLAG'] = 'Delete';\n $response = $model->deleteDepartments($id, $data);\n return $response;\n }", "public function destroy($departements)\n {\n $da=Departements::find($departements);\n $da->delete();\n return redirect('departement'); \n }", "public function delete(User $user, Department $department)\n {\n return true;\n }", "public function delete_delete(){\n $response = $this->PersonM->delete_person(\n $this->delete('id')\n );\n $this->response($response);\n }", "public function destroy($id)\n {\n $departamento = Department::findOrFail($id);\n\n $departamento->delete();\n\n return $this->showOne($departamento);\n }", "public function delete($id)\n {\n\n if(count(DB::table('users')->where('fk_departamento',$id)->get())>0){\n return Redirect::to('/departamentos')->with( 'delete','Atenção: O departamento contém colaboradores, deve mover remover os colaboradores primeiro!')->withInput();\n }\n $departamento=departamento::where('pk_departamento',$id)->value('descricao');\n DB::table('departamentos')->where('pk_departamento',$id)->delete();\n \\Session::flash('success', 'O departamento '.$departamento.' foi removido.');\n\n // escrever log \n \n \n return Redirect::to('/departamentos');\n }", "public function destroy(Request $request)\n {\n $id = pathinfo($request->path())['basename'];\n if (Departamento::where('id', $id)->delete()) {\n return $this->success('Departamento excluído com sucesso');\n } else {\n return $this->error(\"Ooops! Algo não deu certo!\");\n }\n\n }", "public function destroy($id)\n {\n $department = Deport::find($id);\n\n if (!$department) {\n return response()->json([\n 'success' => false,\n 'message' => 'Sorry, Deport with id ' . $id . ' cannot be found'\n ], 400);\n }\n\n if ($department->delete()) {\n return response()->json([\n 'success' => true\n ]);\n } \n else {\n return response()->json([\n 'success' => false,\n 'message' => 'Deport could not be deleted'\n ], 500);\n }\n\n }", "private function deleteUserDepartments($email)\r\n {\r\n $sqlQuery = \"DELETE FROM user_department WHERE useremail = '$email'\";\r\n $this->_dbHandle->exec($sqlQuery);\r\n }", "public function destroy($id)\n {\n $department = Department::find($id);\n\n $department->delete();\n\n return response()->json(self::SUCCESSFULLY_ADDED);\n }", "public function destroy(Request $request, $id)\n {\n Department::findOrFail($id);\n \n current_user()->destroyDepartment($id);\n\n return response()->json([\n 'message' => 'Đã xóa khoa.',\n 'redirect_to' => $request->redirect_to ?? 'RELOAD'\n ]);\n }", "public function delete() {\r\n\r\n // get database connection\r\n\r\n \r\n $sql_delete = \"delete from employees where id = '$this->id'\";\r\n if ($this->dbc->query($sql_delete)) {\r\n\r\n //TODO - DO SOMETHING MORE ELABORATE THAT INDICATES SUCESSFUL SUBMISSION FOR NOW JUST PRINT SUCCESS\r\n echo \"<p> Employee Successfully Deleted </p>\";\r\n return true;\r\n } else {\r\n\r\n echo \"<p> Could not run query </p>\";\r\n return false;\r\n }\r\n }", "public function deleteAction()\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 (true === $this->employee->setAction('delete'))\n\t\t{\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t}", "public function del()\n\t\t{\n\t\t\tif(isset($_POST['id']))\n\t\t\t{\n\t\t\t\t$idEmployee = $_POST['id'];\n\n\t\t\t\tif($this->emp->delEmployee($idEmployee))\n\t\t\t\t{\n\t\t\t\t\theader('location:index.php');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function destroy(Department $department)\n {\n $department->delete();\n return response()->json(new DepartmentResource($department));\n }", "public function delete()\n {\n $dayId = $this->uri->segment(3);\n \n if ($dayId) {\n $this->load->model(\"Eggproductiondata\", 'production');\n \n $this->load->model(\"Eggproductiondays\", 'day');\n \n //echo $this->production->delete(array('egg_production_day_id'=>$dayId));\n echo $this->day->delete($dayId);\n } else {\n \n echo 0;\n }\n \n die;\n }", "public function testDebtorDelete()\n {\n $oDebtorDAO = new DebtorDAO();\n $oDebtor = $oDebtorDAO->findByCpfCnpj('01234567890');\n\n $this->assertTrue(!is_null($oDebtor->getId()));\n\n $oDebtor->delete();\n\n $oDebtor = $oDebtorDAO->findByCpfCnpj('01234567890');\n $this->assertFalse(!is_null($oDebtor->getId()));\n }", "public function destroy(Depense $depense)\n {\n //\n }", "public function destroy(Department $department)\n {\n $this->abort_if_not_permited();\n $department->delete();\n return $department;\n }", "public function destroy($id)\n {\n $department = Department::findOrFail($id);\n\n $data = [\n 'message' => 'success',\n 'data' => null\n ];\n\n $department->delete();\n\n return response()->json($data, 200);\n }", "public function destroy($id)\n {\n $section = DepartmentSection::find($id);\n $section->delete();\n\n return [ 'message' => 'Department was deleted'];\n }", "public function getIdDepartment()\n {\n return $this->id_department;\n }", "public function getDepartmentId()\n\t{\n\t\treturn $this->departmentId;\n\t}", "public function deleteEntidad(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_entidades WHERE entidad_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }", "public function destroy(DistrictReport $districtReport, Expense $expense)\n {\n //\n }", "function delete($conslt_id = 0)\n\t{\n\t\t$this->consultants_model->delete_consultant($conslt_id);\n\t\t$this->session->set_flashdata('success', 'The consultant has been deleted successfully !!');\n\t\tredirect('consultants');\n\t}", "function get_department(){\n $this->_db2->where(\"DeleteFlag\",\"A\");\n return $this->_db2->get($this->_tblorg);\n }", "public function remove(int $id): \\Illuminate\\Http\\JsonResponse\n {\n try {\n if(\\App\\Models\\Department::remove($id)){\n return new \\Illuminate\\Http\\JsonResponse([\n 'status' => 200,\n 'messages' => \"Deleted successfully\"\n ], 200);\n }\n return new \\Illuminate\\Http\\JsonResponse([\n 'status' => 404,\n 'messages' => \"Department not found\"\n ], 404);\n } catch (\\Exception $e) {\n \\Illuminate\\Support\\Facades\\Log::error($e);\n return new \\Illuminate\\Http\\JsonResponse([\n 'status' => 400,\n 'messages' => \"Error deleting, please try again soon.\"\n ], 400);\n }\n }", "public function delete($organization);", "public function delete($Enterprise) { ; }", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function delete()\n {\n $post['id'] = $this->request->getParameter('id'); // récupérer le paramètre de l'ID\n $this->post->deletePost($post['id']);\n $this->redirect(\"admin\", \"chapters\"); // une fois le post supprimé, je redirige vers la vue chapters\n }", "public function deleteHospitalDepartment($globalUtil,$adminUtil,$id,$hid){\n\t\t$delete=$globalUtil->sqldelete(TABLE_HOSPITAL_DEPARTMENT_INFORMATION,\"WHERE id='\".$id.\"' AND hid='\".$hid.\"'\");\n\t\treturn $delete;\n\t\t//return $delete;\n\t\t}", "public function destroy(Request $request)\n {\n $Documentos_Adjuntos = new Documentos_Adjuntos;\n $val= $Documentos_Adjuntos::where(\"id_doc_adj\",\"=\",$request['id_doc_adj'] )->first();\n if(count($val)>=1)\n {\n $val->delete();\n }\n return \"destroy \".$request['id_doc_adj'];\n }", "public function actionCreate_department() {\n //redirect a user if not super admin\n if (!Yii::$app->CustomComponents->check_permission('department')) {\n return $this->redirect(['site/index']);\n }\n\n $model = new DvUsersDepartment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'New Department Created Successfully');\n return $this->redirect(['dv-users/create_department']);\n } else {\n\n return $this->render('create_department', [ 'model' => $model]);\n }\n }", "public function actionDelete($id,$type)\n {\n if($type=='dept'){\n $model=$this->findModel($id);\n $model->setAttribute('dept_delete',1);\n $model->save(false);\n }else{\n $model=$this->findModel($id);\n $model->setAttribute('branch_delete',1);\n $model->save(false);\n }\n\n return $this->redirect(['index']);\n }", "public function delete_emp($id)\n {\n $del_find = Employee::find($id);\n $del_find->delete();\n\n return redirect('/list-employee');\n }", "public function delete($id = -1){\n\n $delete = $this\n ->db\n ->where(\"id\",$id)\n ->delete(\"personel\");\n\n echo $delete;\n }", "public function delete()\n\n {\n Sales::find($this->deleteId)->delete();\n session()->flash('message', 'Sale Deleted Successfully.');\n\n }", "public function delete()\n {\n DB::transaction(function () {\n $this->devedores()->delete();\n parent::delete();\n });\n }", "public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Client_Service_Ad::getAd($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$result = Client_Service_Ad::deleteAd($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "public function delete_destroy()\n\t\t{\n\t\t\tCommittee::find(Input::get('id'))->delete();\n\t\t\treturn Redirect::to_route('committee_list')->with('flash', 'Committee Member was deleted successfully');\n\t\t}", "public function delete()\n {\n // TODO: Implement delete() method.\n }", "public function destroy($id)\n {\n //\n $vital = Vital::findOrFail($id);\n \n $vital->delete(); \n }", "public function delete(){\n $val = new ValidaModel();\n $val->Idvalida=$_POST['id'];\n $result = $val->getValidaId();\n foreach ($result as $r) {\n $Departamento = $r[\"nombreDepto\"];\n $Proyecto = $r[\"proyecto\"];\n $Meta = $r[\"meta\"];\n $year = $r[\"anio\"];\n }\n require_once ROOT . FOLDER_PATH .'/app/Request/ValidaRequest.php';\n }", "public function destroy(Request $request,$id)\n {\n $dep=Departamento::findOrFail($id);\n $dep->delete();\n $message='Departamento '.$dep->departamento. ' eliminado';\n if ($request->ajax()){\n return response()->json(['message'=>$message]);\n }\n }", "public function actionDelete($ClearByID, $ClearanceLevelCode, $Department, $StudentID)\n {\n $this->findModel($ClearByID, $ClearanceLevelCode, $Department, $StudentID)->delete();\n\n return $this->redirect(['index']);\n }" ]
[ "0.8342845", "0.7692757", "0.76736987", "0.7666237", "0.76521724", "0.7630206", "0.75414956", "0.7418667", "0.7365222", "0.7276678", "0.7181386", "0.71712965", "0.7093571", "0.70814335", "0.70680934", "0.70659155", "0.7061961", "0.705312", "0.69950086", "0.69902", "0.69828355", "0.69737995", "0.6969643", "0.69034785", "0.68461263", "0.6839034", "0.68383664", "0.68271625", "0.67883617", "0.67665744", "0.67618287", "0.6759205", "0.6754471", "0.6734421", "0.6731645", "0.67213315", "0.67022604", "0.6695053", "0.66686344", "0.6598663", "0.65958846", "0.6564634", "0.6546625", "0.6521947", "0.651056", "0.6502092", "0.6486778", "0.64622957", "0.64448255", "0.64441687", "0.64128435", "0.63989407", "0.6391012", "0.6367132", "0.636122", "0.63547957", "0.6323981", "0.63212174", "0.6292422", "0.6283394", "0.62803835", "0.62258387", "0.6223182", "0.6215028", "0.6190823", "0.61823946", "0.61620903", "0.61529833", "0.61244303", "0.610691", "0.6102539", "0.60705507", "0.6063414", "0.6061582", "0.6004647", "0.6001134", "0.5995629", "0.59860396", "0.59815025", "0.5980334", "0.59789914", "0.5968014", "0.5962483", "0.59566545", "0.5955098", "0.59503585", "0.59413147", "0.59383106", "0.59325165", "0.5931924", "0.59313035", "0.59198856", "0.5913232", "0.5902756", "0.58985925", "0.5895777", "0.58880067", "0.58858657", "0.5856252", "0.5855784", "0.5854872" ]
0.0
-1
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Display the specified resource.
public function show($email) { $current_account_type = session()->get('account_type_id'); if($current_account_type == '002') return back()->with('alert', 'Sorry, only admins and teaching assistants can veiw this info!'); // If user is a ta, check if ta is showing his own prefs if($current_account_type == '003' || $current_account_type == '004') { if(session()->get('email') != $email) return back()->with('alert', 'Teaching assistants can only see their own preferences!'); } $basic_db_class = new BasicDBClass(); $TAs_preferences = $basic_db_class->getAllPrefsForTAEmail($email); return view('admin.users.ta-all-prefs')->with('TAs_preferences', $TAs_preferences); }
{ "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
Match if 2 arrays have the same keys and/or values regardless of order
public function arraysAreSimilar($a, $b) { // if the indexes don't match, return immediately if (count(array_diff($a, $b)) > 0) { return false; } // we have identical indexes, and no unequal values return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cp_arrayIsSame($array1, $array2,$keys){\r\n\r\n foreach($keys as $key){\r\n if($array1[$key] != $array2[$key]){\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}", "function arrays_are_similar($a, $b) {\n\tif (count(array_diff_assoc($a, $b))) {\n\t\treturn false;\n\t}\n\t// we know that the indexes, but maybe not values, match.\n\t// compare the values between the two arrays\n\tforeach($a as $k => $v) {\n\t\tif ($v !== $b[$k]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// we have identical indexes, and no unequal values\n\treturn true;\n}", "function array_compare_assoc($array1, $array2, $keys)\n {\n return empty(array_diff(\n array_only($array1, $keys),\n array_only($array2, $keys)\n ));\n }", "public function arrays_are_similar($a, $b)\n {\n if (count(array_diff_assoc($a, $b))) {\n return false;\n }\n // we know that the indexes, but maybe not values, match.\n // compare the values between the two arrays\n foreach ($a as $k => $v) {\n if ($v !== $b[$k]) {\n return false;\n }\n }\n // we have identical indexes, and no unequal values\n return true;\n }", "function areSimilar($a, $b) {\n if($a==$b) return true;\n \n if(sizeof($a)!=sizeof($b)||array_sum($a)!=array_sum($b)) return false;\n \n $index1 = 0; $index2 = 0; $diff = 0;\n \n foreach($a as $key=>$var){\n if($var!=$b[$key]){\n $diff++;\n if($diff==1)\n $index1 = $key;\n else if($diff==2)\n $index2 = $key;\n }\n }\n \n return ($diff==2&&$a[$index1]==$b[$index2]&&$a[$index2]==$b[$index1]);\n}", "public function matches($other)\n {\n if (!is_array($other)) {\n return false;\n }\n\n foreach ($this->value as $key => $value) {\n if (!array_key_exists($key, $other)) {\n $this->failureMessage = \"Expected key: '\" . $key . \"' \" . 'is missing';\n return false;\n }\n\n $keys_match = true;\n\n if ($this->strict) {\n if ($other[$key] !== $value) {\n $keys_match = false;\n }\n } else {\n /** @noinspection TypeUnsafeComparisonInspection */\n if ($other[$key] != $value) {\n $keys_match = false;\n }\n }\n\n if (!$keys_match) {\n $this->failureMessage = \"Key: '\" . $key . \"' => '\" . $other[$key] . \"' \" .\n \"does not match expected value: '\" . $value . \"'\";\n return false;\n }\n }\n\n if ($this->count) {\n $diff = array_diff_key($other, $this->value);\n if (count($diff) > 0) {\n $this->failureMessage = 'The array contains the following key/s, which is/are not expected: '\n . implode(', ', array_keys($diff));\n return false;\n }\n }\n\n return true;\n }", "function atkArrayCompare($array1, $array2)\n{\n\t$difference = atkArrayDiff($array1, $array2);\n\n\treturn !is_array($difference) ? false : true;\n}", "public function identical_values( $arrayA , $arrayB ) {\n\n sort( $arrayA );\n sort( $arrayB );\n\n return $arrayA == $arrayB;\n }", "protected function _arrayValsEqual($a1, $a2) {\n return (!$this->_arrayDiff($a1, $a2) && !$this->_arrayDiff($a2, $a1)\n && (count($a1) == count($a2)));\n }", "public static function arrayKeysEqual($item1, $item2)\n {\n // their keys are equal, we're done\n if (!is_array($item1) && !is_object($item1) && !is_array($item2) && !is_object($item2))\n return true;\n\n // if one of the items is an array or an object and the other\n // isn't then the keys aren't equal\n if (is_array($item1) || is_object($item1))\n {\n if (!is_array($item2) && !is_object($item2))\n return false;\n }\n\n if (is_array($item2) || is_object($item2))\n {\n if (!is_array($item1) && !is_object($item1))\n return false;\n }\n\n // we're working with arrays or objects; cast them to arrays for\n // easy comparison\n $array1 = (array)$item1;\n $array2 = (array)$item2;\n\n // if the two arrays are equal, their keys are the same\n if ($item1 === $item2)\n return true;\n\n // check the keys\n foreach ($array1 as $k1 => $v1)\n {\n if (array_key_exists($k1, $item2) === false)\n return false;\n\n $next_item1 = $array1[$k1];\n $next_item2 = $array2[$k1];\n\n // the values may be objects themselves, so check them\n // to see if their keys are the same\n if (!self::arrayKeysEqual($next_item1, $next_item2))\n return false;\n }\n\n foreach ($array2 as $k2 => $v2)\n {\n if (array_key_exists($k2, $item1) === false)\n return false;\n\n // the values may be objects themselves, so check them\n // to see if their keys are the same\n if (!self::arrayKeysEqual($next_item1, $next_item2))\n return false;\n }\n\n return true;\n }", "public function validateTablesIdentical($arr1, $arr2) {\n $array_keys = ['quarter_number', 'month_number', 'row_number',];\n\n for ($i = 0; $i <= 2; $i++) {\n if ($arr1[$array_keys[$i]] != $arr2[$array_keys[$i]]) {\n return FALSE;\n }\n }\n\n return TRUE;\n }", "public function arrayEqual(array $a, array $b)\n {\n return (count($a) == count($b) && array_diff($a, $b) === array_diff($b, $a));\n }", "private function arraysAreSimilar(array $a, array $b, string $message = '')\n {\n if (count($a) !== count($b)) {\n $this->fail($message.': First array has '.count($a).' variables, second has '.count($b));\n\n return;\n }\n\n $aKeys = array_keys($a);\n $bKeys = array_keys($b);\n $differenceInKeys = array_diff($aKeys, $bKeys);\n if (0 !== count($differenceInKeys)) {\n $this->fail(\n $message.': Difference in keys: first array has keys: ['.\n implode(', ', $aKeys).\n '] second array has: ['.\n implode(', ', $bKeys).\n ']'\n );\n\n return;\n }\n\n // we know that the indexes, but maybe not values, match.\n // compare the values between the two arrays\n foreach ($a as $k => $v) {\n if (($v instanceof \\Closure) || ($b[$k] instanceof \\Closure)) {\n if (false === (($v instanceof \\Closure) && ($b[$k] instanceof \\Closure))) {\n $this->fail($message.': Expected key '.$k.' to be a closure in both instances');\n }\n } else {\n $msg = $message.': Expected '.gettype($v);\n if (true === is_string($v)) {\n $msg .= ' \"'.$v.'\"';\n }\n\n $msg .= ' got '.gettype($b[$k]);\n if (true === is_string($b[$k])) {\n $msg .= ' \"'.$b[$k].'\"';\n }\n\n $this->assertSame($v, $b[$k], 'Comparing arrays:'.$msg);\n }\n }//end foreach\n }", "public function testAssertArrayKeysEqual()\n {\n $this->assertArrayKeysEqual([], []);\n\n foreach ([\n ['key1' => 'value1', 'key2' => 'value2'],\n ['key2' => 'value2', 'key1' => 'value1'],\n ] as $array) {\n $this->assertArrayKeysEqual(['key1', 'key2'], $array);\n }\n\n $this->expectException(AssertionFailedError::class);\n $this->assertArrayKeysEqual(['key2'], $array);\n }", "private function isArrayEqual($arr1, $arr2){\r\n if(is_array($arr1) && is_array($arr2)){\r\n foreach($arr1 as $k1 => $v1) {\r\n if($k1 == \"ID\") {\r\n continue;\r\n }\r\n if(!$this -> isArrayEqual($arr1[$k1], $arr2[$k1])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n } elseif($arr1 != $arr2) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "function compare_array_item($setting, $existing) {\r\n\t$existing = (array)$existing;\r\n\tunset($setting['site_id']);\r\n\tunset($setting['_id']);\r\n\tunset($existing['_id']);\r\n\tunset($existing['site_id']);\r\n\tforeach($setting as $key => $value) {\r\n\t\tif(!is_array($setting[$key])) {\r\n\t\t\tif($setting[$key] != $existing[$key]){\r\n\t\t\t\techo \"setting key {$key} value {$value} differs from {$existing[$key]} - \";\r\n\t\t\t\t// print_r($setting);\r\n\t\t\t\tprint_r($existing);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(is_array($setting[$key])) {\r\n\t\t\t$diff = array();\r\n\t\t\t$diff = array_diff_assoc($setting[$key], (array)$existing[$key]);\r\n\t\t\tif(!empty($diff)) {\r\n\t\t\t\techo \"setting subkey {$key} differs diff count \". count($diff).\"\\n\";\r\n\t\t\t\t// print_r($diff);\r\n\t\t\t\t// print_r($setting);\r\n\t\t\t\t// print_r($existing);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "public static function arrayIdentical($op1, $op2)\n {\n if ((!Arrays::isArray($op1, false)) || (!Arrays::isArray($op2, false))) {\n return false;\n }\n\n if (count($op1) < count($op2)) {\n return false;\n // $op1 < $op2\n } elseif (count($op1) > count($op2)) {\n return false;\n // $op1 > $op2\n }\n\n foreach ($op1 as $key => $val) {\n if (!array_key_exists($key, $op2)) {\n return false;\n // uncomparable\n } elseif ($val < $op2[$key]) {\n return false;\n } elseif ($val > $op2[$key]) {\n return false;\n }\n }\n\n return true;\n }", "function array_compare($array1, $array2)\n {\n return empty(array_diff($array1, $array2));\n }", "function atkArrayDiff($array1, $array2)\n{\n\tforeach($array1 as $key => $value)\n\t{\n\t\tif(is_array($value))\n\t\t{\n\t\t\tif(!is_array($array2[$key]))\n\t\t\t{\n\t\t\t\t$difference[$key] = $value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$new_diff = atkArrayDiff($value, $array2[$key]);\n\t\t\t\tif($new_diff != FALSE)\n\t\t\t\t{\n\t\t\t\t\t$difference[$key] = $new_diff;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telseif(!isset($array2[$key]) || $array2[$key] != $value)\n\t\t{\n\t\t\t$difference[$key] = $value;\n\t\t}\n\t}\n\n\treturn !isset($difference) ? false : $difference;\n}", "static function equals($array_a, $array_b, $path, $strict = false) {\n\t\t$a = Fset::get($array_a, $path);\n\t\t$b = Fset::get($array_b, $path);\n\t\tif($strict){\n\t\t\treturn $a === $b;\n\t\t}else{\n\t\t\treturn $a == $b;\n\t\t}\n\t}", "public function is_same_response(array $a, array $b)\n {\n try\n {\n //Process both responses.\n //This is a CPU-heavy operation the first time it is run, but is relatively light afterwards due to local caching.\n $a_resp = $this->process_response($a);\n $b_resp = $this->process_response($b);\n\n //return true iff the hashes match\n return ($a_resp['hash'] == $b_resp['hash']);\n }\n catch(SimulationException $e)\n {\n return false;\n }\n }", "function noDuplicates($set1, $set2) {\n\t\t$noDuplicate = null;\n if ($set1 == null || $set2 == null) {\n return $noDuplicate;\n } else {\n foreach (array_keys($set1) as $key) {\n if (isset($set2[$key])) {\n $noDuplicate = $key;\n break;\n }\n \t }\n }\n return $noDuplicate;\n\t}", "public function equalTo($other) : bool {\n if (!is_array($other)) {\n return $this->equalTo($other->getArray());\n }\n\n $a = $this;\n $b = $other;\n\n if (sizeof($a) != sizeof($b)) return false;\n\n foreach($a as $k => $v) {\n if (!isset($b[$k])) return false;\n \n if (is_array($v)) {\n if (!is_array($b[$k])) return false;\n\n if (! arr($v)->equalTo($b[$k]))\n return false;\n }\n else if ($v != $b[$k]) return false;\n }\n\n return true;\n }", "public function testArraysOperations()\n {\n // Union\n $arr1 = ['a', 'b'];\n $arr2 = ['c', 'd', 'e', 'key' => 'value'];\n //$this->assertEquals(?, $arr1 + $arr2);\n\n // array_merge — Merge one or more arrays\n $arr1 = ['a', 'b', 'key1' => 'value1', 'key2' => 'value2'];\n $arr2 = [1, 'key1' => 'value3', 'key3' => 'value4'];\n //$this->assertEquals(?, array_merge($arr1, $arr2));\n\n // array_replace — Replaces elements from passed arrays into the first array\n $arr1 = ['a', 'b', 'key1' => 'value1', 'key2' => 'value2'];\n $arr2 = [1, 'key1' => 'value3', 'key3' => 'value4'];\n //$this->assertEquals(?, array_replace($arr1, $arr2));\n }", "function arrays_exor($a1, $a2)\n{\n $r = array();\n for ($i = 0; $i < count($a1); $i++) {\n if ($a1[$i] != '' and !in_array($a1[$i], $a2)) {\n $r[] = $a1[$i];\n }\n }\n for ($j = 0; $j < count($a2); $j++) {\n if ($a2[$j] != '' and !in_array($a2[$j], $a1)) {\n $r[] = $a2[$j];\n }\n }\n return $r;\n}", "static function attributes_match($schema_one, $schema_two, $attribute_names)\n {\n foreach ($attribute_names as $attribute_name)\n if ($schema_one->attribute($attribute_name)\n != $schema_two->attribute($attribute_name))\n return false;\n return true;\n }", "public function array_compare( $array1, $array2 )\n {\n $diff = false;\n\n foreach( $array1 as $key => $value )\n {\n if( ! array_key_exists( $key, $array2 ) )\n {\n $diff[0][$key] = $value;\n } elseif ( is_array( $value ) )\n {\n if ( ! is_array( $array2[$key] ) )\n {\n $diff[0][$key] = $value;\n $diff[1][$key] = $array2[$key];\n } else\n {\n $new = self::array_compare( $value, $array2[$key] );\n\n if ( $new !== false )\n {\n if ( isset( $new[0] ) )\n $diff[0][$key] = $new[0];\n\n if ( isset( $new[1] ) )\n $diff[1][$key] = $new[1];\n }\n }\n } elseif ( $array2[$key] !== $value )\n {\n $diff[0][$key] = $value;\n $diff[1][$key] = $array2[$key];\n }\n }\n\n foreach ( $array2 as $key => $value )\n {\n if ( ! array_key_exists( $key, $array1 ) )\n $diff[1][$key] = $value;\n }\n\n return $diff;\n }", "function comp($a1, $a2) {\n if (is_null($a1) || is_null($a2)) return false;\n sort($a1);\n sort($a2);\n // There is no comparison of arrays, only values.\n // The minimum number of iterations is 1, the maximum is n.\n foreach ($a2 as $key => $value) {\n if($a1[$key] ** 2 !== $value) return false;\n }\n return true;\n}", "public function isEqualProvider()\n {\n // Declare attributes\n $objA = new stdClass();\n $objA->foo = 'bar';\n \n $objB = new stdClass();\n \n $objC = new stdClass;\n $objC->foo = 'bar';\n $objC->int = 1;\n $objC->array = array(0, array(1), array(2), 3);\n $objC->related = new stdClass;\n $objC->self = $objC;\n $objC->c = $objC;\n \n $objD = new stdClass;\n $objD->foo = 'bar';\n $objD->int = 2;\n $objD->array = array(0, array(4), array(2), 3);\n $objD->related = new stdClass;\n $objD->self = $objD;\n $objD->c = $objC;\n \n return array(\n // Integers\n array(1, 0, <<<EOF\nFailed asserting that 0 matches expected 1.\nEOF\n ),\n \n // Integer and Double\n array(1.1, 0, <<<EOF\nFailed asserting that 0 matches expected 1.1.\nEOF\n ),\n \n // Chars\n array('a', 'b', <<<EOF\nFailed asserting that two strings are equal.\n\n- Expected \n+ Actual \n\n-'a'\n+'b'\nEOF\n ), \n \n // Integer and Array\n array(1, array(0), <<<EOF\nArray (...) does not match expected type \"integer\".\nEOF\n ),\n \n // Array and Integer\n array(array(0), 1, <<<EOF\n1 does not match expected type \"array\".\nEOF\n ),\n \n // Array and Array\n array(array(0), array(1), <<<EOF\nFailed asserting that two arrays are equal.\n\n- Expected \n+ Actual \n\n Array (\n- 0 => 0\n+ 0 => 1\n )\nEOF\n ),\n \n // Boolean and boolean as string\n array(array(TRUE), array('true'), <<<EOF\nFailed asserting that two arrays are equal.\n\n- Expected \n+ Actual \n\n Array (\n- 0 => true\n+ 0 => 'true'\n )\nEOF\n ),\n \n // Nested arrays\n array(array(0, array(1), array(2), 3), array(0, array(4), array(2), 3), <<<EOF\nFailed asserting that two arrays are equal.\n\n- Expected \n+ Actual \n\n Array (\n 0 => 0\n 1 => Array (\n- 0 => 1\n+ 0 => 4\n )\n 2 => Array (\n 0 => 2\n )\n 3 => 3\n )\nEOF\n ),\n \n \n // Object and Array\n array($objA, array(23), <<<EOF\nArray (...) does not match expected type \"object\".\nEOF\n ), \n\n // Array and Object\n array(array(23), $objA, <<<EOF\nstdClass Object (...) does not match expected type \"array\".\nEOF\n ), \n \n // Object and Object\n array($objA, $objB, <<<EOF\nFailed asserting that two objects are equal.\n\n- Expected \n+ Actual \n\n stdClass Object (\n- 'foo' => 'bar'\n )\nEOF\n ),\n \n // Complex objects\n array($objC, $objD, <<<EOF\nFailed asserting that two objects are equal.\n\n- Expected \n+ Actual \n\n stdClass Object (\n 'foo' => 'bar'\n- 'int' => 1\n+ 'int' => 2\n 'array' => Array (\n 0 => 0\n 1 => Array (\n- 0 => 1\n+ 0 => 4\n )\n 2 => Array (\n 0 => 2\n )\n 3 => 3\n )\n 'related' => stdClass Object ()\n 'self' => stdClass Object (\n 'foo' => 'bar'\n- 'int' => 1\n+ 'int' => 2\n 'array' => Array (\n 0 => 0\n 1 => Array (\n- 0 => 1\n+ 0 => 4\n )\n 2 => Array (\n 0 => 2\n )\n 3 => 3\n )\n 'related' => stdClass Object ()\n 'self' => stdClass Object (*RECURSION*)\n- 'c' => stdClass Object (*RECURSION*)\n+ 'c' => stdClass Object (\n+ 'foo' => 'bar'\n+ 'int' => 1\n+ 'array' => Array (\n+ 0 => 0\n+ 1 => Array (\n+ 0 => 1\n+ )\n+ 2 => Array (\n+ 0 => 2\n+ )\n+ 3 => 3\n+ )\n+ 'related' => stdClass Object ()\n+ 'self' => stdClass Object (*RECURSION*)\n+ 'c' => stdClass Object (*RECURSION*)\n+ )\n )\n 'c' => stdClass Object (\n 'foo' => 'bar'\n 'int' => 1\n 'array' => Array (\n 0 => 0\n 1 => Array (\n 0 => 1\n )\n 2 => Array (\n 0 => 2\n )\n 3 => 3\n )\n 'related' => stdClass Object ()\n 'self' => stdClass Object (*RECURSION*)\n 'c' => stdClass Object (*RECURSION*)\n )\n )\nEOF\n \n ),\n );\n }", "static function keysEqual(array $array, array $need, $strict = true) {\n $have = array_keys($array);\n ksort($need);\n ksort($have);\n return $strict ? ($need === $have) : ($need == $have);\n }", "function differences($a1, $a2, $same = true){\n\t \n\t\t$result = new stdClass();\n\n\t\t$result->add = array_diff_key($a2, $a1);\n\t\t$result->delete = array_diff_key($a1, $a2);\n\n\t\t$both = array_intersect_key($a1, $a2);\n\t\tif($same) $result->same = array();\n\t\t$result->update = array();\n\t\tforeach($both as $id=>$val){\n\t\t\tif($a1[$id] !== $a2[$id])\n\t\t\t\t$result->update[$id] = $a2[$id];\n\t\t\telseif($same)\n\t\t\t\t$result->same[$id] = $a2[$id];\n\t\t}\n\n\t\t$result->differences = count($result->add) + count($result->update) + count($result->delete);\n\n\t\treturn $result;\n\t}", "function is_equal(tree $other): bool {\n // We must treat the triples array as an unordered set\n // (where the two sets are equal even if values are present\n // in a different order).\n // Therefore, we cannot simply check if array_values()\n // for each set is equal.\n foreach($this->triples as $k => $t) {\n $o = @$other->triples[$k];\n if(!$o || !$t->is_equal($o)){\n return false;\n }\n }\n foreach($other->triples as $k => $t) {\n $o = @$this->triples[$k];\n if(!$o || !$t->is_equal($o)){\n return false;\n }\n }\n return true;\n }", "protected function _safeAssociativeArrayMerge(array $in_associative_array_1, array $in_associative_array_2) {\r\n $result = $in_associative_array_1;\r\n foreach ($in_associative_array_2 as $_key => $_value) {\r\n if (array_key_exists($_key, $result)) {\r\n if ($result[$_key] !== $_value) {\r\n trigger_error(\r\n sprintf('Merging two associative arrays with identical key \"%s\" (with different values).', $_key),\r\n E_USER_WARNING\r\n );\r\n } else {\r\n trigger_error(\r\n sprintf('Merging two associative arrays with identical key \"%s\" (with same values).', $_key),\r\n E_USER_WARNING\r\n );\r\n }\r\n }\r\n\r\n $result[$_key] = $_value;\r\n }\r\n return $result;\r\n }", "protected function assertArrayValsEqual($a1, $a2) {\n $this->assertTrue($this->_arrayValsEqual($a1, $a2));\n }", "function DiferentKeys($keys_home, $keys_sync) {\r\n \tif (count($keys_home) != count($keys_sync)) {\r\n \treturn true;\r\n }\r\n\r\n for ($i = 0; $i < count($keys_home); $i++) {\r\n \tif ($keys_home[$i] != $keys_sync[$i]) {\r\n \treturn true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "function array_mash($primary, $secondary) {\n\t$primary = (array)$primary;\n\t$secondary = (array)$secondary;\n\t$out = array();\n\tforeach($primary as $name => $value) {\n\t\tif ( array_key_exists($name, $secondary) && !empty($secondary[$name]) && empty($value)) {\n\t\t\t$out[$name] = $secondary[$name];\n\t\t}\n\t\telse {\n\t\t\t$out[$name] = $value;\n\t\t}\n\t}\n\treturn $out;\n}", "public function testMerge() {\n $data1 = array(\n 'foo' => 'bar',\n 'boolean' => true,\n 'string' => 'abc',\n 'number' => 123,\n 'one'\n );\n\n $data2 = array(\n 'foo' => 'baz',\n 'boolean' => false,\n 'string' => 'xyz',\n 'number' => 456,\n 'two'\n );\n\n $this->assertEquals(array(\n 'foo' => 'baz',\n 'boolean' => false,\n 'string' => 'xyz',\n 'number' => 456,\n 'two'\n ), Hash::merge($data1, $data2));\n\n $data1['array'] = array(\n 'key' => 'value',\n 123,\n true\n );\n\n $data2['array'] = array();\n\n $this->assertEquals(array(\n 'foo' => 'baz',\n 'boolean' => false,\n 'string' => 'xyz',\n 'number' => 456,\n 'two',\n 'array' => array(\n 'key' => 'value',\n 123,\n true\n )\n ), Hash::merge($data1, $data2));\n\n $data2['array'] = array(\n 'key' => 'base',\n 'foo' => 'bar',\n 123\n );\n\n $this->assertEquals(array(\n 'foo' => 'bar',\n 'boolean' => true,\n 'string' => 'abc',\n 'number' => 123,\n 'one',\n 'array' => array(\n 'key' => 'value',\n 'foo' => 'bar',\n 123,\n true\n )\n ), Hash::merge($data2, $data1));\n\n $this->assertEquals(array(), Hash::merge());\n }", "public function equals($other)\n\t{\n\t\tif($other instanceof self) {\n\t\t\treturn $this == $other;\n\t\t} elseif(is_array($other)) {\n\t\t\treturn $this->value == $other['val'] && $this->prefix == $other['pre'] && $this->postfix == $other['post'] && !$this->valueEncoded && $this->prefixEncoded && $this->postfixEncoded;\n\t\t} else {\n\t\t\treturn $this->prefix === null && $this->postfix === null && $this->value == $other && !$this->valueEncoded;\n\t\t}\n\t}", "function array_multi_diff($a1,$a2) {\n\t$diff = array();\n\t\n\tforeach($a1 as $k=>$v){\n\t\t$dv = null;\n\t\tif(is_int($k)){\n\t\t\t// Compare values\n\t\t\tif(array_search($v,$a2)===false) $dv=$v;\n\t\t\telse if(is_array($v)) $dv = array_multi_diff($v,$a2[$k]);\n\t\t\tif($dv) $diff[]=$dv;\n\t\t} else {\n\t\t\t// Compare noninteger keys\n\t\t\tif(!$a2[$k]) $dv=$v;\n\t\t\telse if(is_array($v)) $dv = array_multi_diff($v,$a2[$k]);\n\t\t\tif($dv) $diff[$k]=$dv;\n\t\t}\n\t}\n\t\n\treturn $diff;\n}", "protected function areEqual($a, $b)\n {\n return ($a['points'] == $b['points'])\n && ($a['positions'] == $b['positions'])\n && ($a['fastestLap'] == $b['fastestLap']);\n }", "function getSameCount(array $arrayFirst, array $arraySecond): int\n{\n $result = 0;\n if (empty($arrayFirst) || empty($arraySecond)) {\n return $result;\n }\n $arrayFirstUnicue = array_unique($arrayFirst);\n $arraySecondUnicue = array_unique($arraySecond);\n foreach ($arrayFirstUnicue as $itemFromFirst) {\n foreach ($arraySecondUnicue as $itemFromSecond) {\n if ($itemFromFirst === $itemFromSecond) {\n $result++;\n }\n }\n }\n return $result;\n}", "public function testMatches() {\n $this->assertTrue(Hash::matches($this->expanded, $this->expanded));\n $this->assertTrue(Hash::matches(array(\n 'foo' => 123,\n 'bar' => 'baz',\n 'array' => array()\n ), array(\n 'foo' => 123,\n 'bar' => 'baz',\n 'array' => array()\n )));\n\n $this->assertFalse(Hash::matches($this->expanded, $this->collapsed));\n $this->assertFalse(Hash::matches(array(\n 'foo' => '123',\n 'bar' => 'baz',\n 'array' => array()\n ), array(\n 'foo' => 123,\n 'bar' => 'baz',\n 'array' => array()\n )));\n }", "function in_array_multi_key($needle, $haystack)\r\n{\r\n // only matches the key, values don't count.\r\n if ( array_key_exists($needle, $haystack) )\r\n {\r\n return TRUE;\r\n }\r\n\r\n foreach ( $haystack as $key => $value )\r\n {\r\n if ( is_array($value) )\r\n {\r\n $work = in_array_multi_key($needle, $value);\r\n if ( $work )\r\n {\r\n return TRUE;\r\n }\r\n }\r\n }\r\n return FALSE;\r\n}", "function compareValues($data_array, $sql_records) {\n\t$changes = array();\n\tforeach ($data_array as $key => $val) {\n\t\t$diff = array_diff_assoc($data_array[$key], $sql_records[$key]);\n\t\tif ($diff) {\n\t\t\t$changes[$key] = $diff;\n\t\t}\n\t}\n\n\treturn $changes;\n}", "public static function intersect_ukey($array1, $array2){\n return call_user_func_array([self, \"intersectUKey\"], func_get_args());\n }", "function atk_array_merge($array1, $array2)\n{\n\t$res = Array();\n\n\t$arrays = func_get_args();\n\tfor ($i = 0, $_i = count($arrays); $i < $_i; $i++)\n\t{\n\t\tfor ($j = 0, $_j = count($arrays[$i]); $j < $_j; $j++)\n\t\t{\n\t\t\tif (!in_array($arrays[$i][$j], $res))\n\t\t\t{\n\t\t\t\t$res[] = $arrays[$i][$j];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $res;\n}", "function same($s1, $s2) {\n\t$s1len = strlen($s1);\n\t$s2len = strlen($s2);\n\tif($s1len != $s2len) return false;\n\n\tfor($i = 0; $i < $s1len; $i++) {\n\t\t$count = 0;\n\t\tfor($j = 0; $j < $s1len; $j++) {\n\t\t\tif($s1[$i] == $s2[$j]) $count++;\n\t\t}\n\t\tif($count != 1) return false;\n\t}\n\treturn true;\n}", "function array_combine($keys, $values)\n\t{\n\t\t$keys = array_values($keys);\n\t\t$values = array_values($values);\n\n\t\t$n = sizeof($keys);\n\t\t$m = sizeof($values);\n\t\tif (!$n || !$m || ($n != $m))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$combined = array();\n\t\tfor ($i = 0; $i < $n; $i++)\n\t\t{\n\t\t\t$combined[$keys[$i]] = $values[$i];\n\t\t}\n\t\treturn $combined;\n\t}", "function comp($a,$b) {\n if ((count($a == count($b))) && ($a !== \"\")) { \n foreach ($a as $check) {\n // if !exists $a ~ $b\n if (!in_array($check*$check, $b)) {\n return false;\n }\n }\n return true;\n }\n return false;\n}", "function numberOfValuesInCommon($array1, $array2) {\n $count = 0;\n\n foreach($array1 as $value) {\n if(searchArray($value, $array2)) {\n $count++;\n }\n }\n return $count;\n}", "function arr_diff($a1,$a2){\n\t\t\tforeach($a1 as $k=>$v){\n\t\t\t\tunset($dv);\n\t\t\t\tif(is_int($k)){\n\t\t\t\t\t// Compare values\n\t\t\t\t\tif(array_search($v,$a2)===false) $dv=$v;\n\t\t\t\t\telse if(is_array($v)) $dv=arr_diff($v,$a2[$k]);\n\t\t\t\t\tif($dv) $diff[]=$dv;\n\t\t\t\t} else {\n\t\t\t\t\t// Compare noninteger keys\n\t\t\t\t\tif(!$a2[$k]) $dv=$v;\n\t\t\t\t\telse if(is_array($v)) $dv=arr_diff($v,$a2[$k]);\n\t\t\t\t\tif($dv) $diff[$k]=$dv;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $diff;\n\t\t}", "function ary_diff( $ary_1, $ary_2 ) {\n // get differences that in ary_1 but not in ary_2\n // get difference that in ary_2 but not in ary_1\n // return the unique difference between value of 2 array\n $diff = array();\n\n // get differences that in ary_1 but not in ary_2\n foreach ( $ary_1 as $v1 ) {\n $flag = 0;\n foreach ( $ary_2 as $v2 ) {\n $flag |= ( $v1 == $v2 );\n if ( $flag ) break;\n }\n if ( !$flag ) array_push( $diff, $v1 );\n }\n\n return $diff;\n }", "function diff($arr1, $arr2)\n{\n $res = array();\n $r = 0;\n foreach ($arr1 as & $av) {\n if (!in_array($av, $arr2)) {\n $res[$r] = $av;\n $r++;\n }\n }\n\n return $res;\n}", "function array_diff_multi($array1, $array2)\n {\n $result = [];\n foreach ($array1 as $key => $val) {\n if (isset($array2[$key])) {\n if (is_array($val) && $array2[$key]) {\n $diff = array_diff_multi($val, $array2[$key]);\n if ($diff) {\n $result[$key] = $diff;\n }\n }\n } else {\n $result[$key] = $val;\n }\n }\n\n return $result;\n }", "public static function areKeysSet (array $needleArray, array $haystack)\n {\n $keysSet = true;\n foreach ($needleArray as $needle) {\n if (!array_key_exists($needle, $haystack)) {\n $keysSet = false;\n break;\n }\n };\n\n return $keysSet;\n }", "function is_equal_of(mixed $value, mixed ...$values): bool\n{\n $search_value = $value;\n foreach ($values as $value) {\n if ($search_value === $value) {\n return true;\n }\n }\n return false;\n}", "public function testOverwrite() {\n $data1 = array(\n 'foo' => 'bar',\n 123,\n 'array' => array(\n 'boolean' => true,\n 'left' => 'left'\n )\n );\n\n $data2 = array(\n 'foo' => 'baz',\n 456,\n 'array' => array(\n 'boolean' => false,\n 'right' => 'right'\n )\n );\n\n $this->assertEquals(array(\n 'foo' => 'baz',\n 456,\n 'array' => array(\n 'boolean' => false,\n 'left' => 'left'\n )\n ), Hash::overwrite($data1, $data2));\n }", "public function assertWordEquality($words1, $words2)\n\t{\n\t\t//Assert there are no elements in words1 not in words2 that do not have the same word & freq\n\t\tforeach($words1 as $name => $word)\n\t\t{\n\t\t\t$this->assertArrayHasKey($name, $words2);\n\t\t\t$this->assertEquals($word->word, $words2[$name]->word);\n\t\t\t$this->assertEquals($word->freq, $words2[$name]->freq);\n\t\t}\n\t\t//Assert there are no elements in words2 not in words1\n\t\tforeach($words2 as $name => $word)\n\t\t{\n\t\t\t$this->assertArrayHasKey($name, $words1);\n\t\t}\n\t}", "public static function inArray($item1, $item2)\n {\n\n // if two items are identical, then one is contained in the other\n if ($item1 === $item2)\n return true;\n\n // consider two nulls to be the same\n if (!isset($item1) && !isset($item2))\n return true;\n\n // if we have two values and they have different values, return false;\n // if we have two items where one is a value and the other is not,\n // return false\n $is_value1 = !is_array($item1) && !is_object($item1);\n $is_value2 = !is_array($item2) && !is_object($item2);\n\n if ($is_value1 === true && $is_value2 === true)\n {\n if ($item1 === $item2)\n return true;\n if ((is_int($item1) || is_float($item1)) && (is_int($item2) || is_float($item2)))\n {\n if (\\Flexio\\Tests\\Util::dblcompare((float)$item1, (float)$item2) == 0)\n return true;\n }\n return false;\n }\n if ($is_value1 === false && $is_value2 === true)\n return false;\n if ($is_value1 === true && $is_value2 === false)\n return false;\n\n // we're working with arrays or objects; cast them to arrays for\n // easy comparison\n $array1 = (array)$item1;\n $array2 = (array)$item2;\n\n // check if the input arrays are sequential or associative\n $is_associative_array1 = \\Flexio\\Base\\Util::isAssociativeArray($array1);\n $is_associative_array2 = \\Flexio\\Base\\Util::isAssociativeArray($array2);\n\n // if the two arrays are not of the same type, then array2 is\n // not contained in array1\n if ($is_associative_array1 !== $is_associative_array2)\n return false;\n\n // the two arrays are either both sequential or associative;\n // if they're sequential, make sure that the values of array2\n // are contained in array1; if they're associative, make sure\n // that the key/value pairs of array2 are in array1\n\n if ($is_associative_array2 === true)\n {\n foreach ($array2 as $key2 => $value2)\n {\n if (array_key_exists($key2, $array1) === false)\n return false;\n\n if (self::inArray($array1[$key2], $value2) === false)\n return false;\n }\n\n return true;\n }\n else\n {\n foreach ($array2 as $key2 => $value2)\n {\n $is_included = false;\n foreach ($array1 as $key1 => $value1)\n {\n if (self::inArray($value1, $value2) === false)\n continue;\n\n $is_included = true;\n break;\n }\n\n if ($is_included === false)\n return false;\n }\n\n return true;\n }\n\n return false;\n }", "protected function matches($other): bool\n {\n if ($this->value === null) {\n return isset($other[$this->name]);\n } else {\n return isset($other[$this->name]) && in_array($this->value, $other[$this->name], true);\n }\n }", "public static function diffKey(array $array1, array $array2): array{\n return call_user_func_array(\"array_diff_key\", func_get_args());\n }", "public static function assertArraysAreSameIgnoringOrder(\n array $expected,\n array $actual,\n ?string $message = null\n ): void {\n ksort($expected);\n ksort($actual);\n $expectedString = json_encode($expected, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n $actualString = json_encode($actual, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n static::assertSame($expectedString, $actualString, $message ?? '');\n }", "function util_array_union($array1, $array2)\n{\n\t$result = $array1;\n\tforeach ($array2 as $key => $value)\n\t{\n\t\t$result[$key] = $value ;\n\t}\n\t\n\treturn $result ;\n}", "public function is_same_response(array $prevresponse, array $newresponse) {\n return question_utils::arrays_same_at_key_missing_is_blank($prevresponse, $newresponse, 'answer');\n }", "public function isSameFood($foodA, $foodB);", "function compare_settings_arrays( $settings_array, $array2 ){\n $new = array();\n $this->settings_array_changes = 0;\n\n //do a count comparsion to check for removed values\n if( count($settings_array) != count($array2) ){\n ++$this->settings_array_changes;//count mismatch - something changed\n }\n\n //compare each setting against array2 and look for matches\n reset($settings_array);\n foreach( $settings_array as $array_key => $array_setting ){\n\n if( is_array($array2) === true ){\n reset($array2);\n foreach( $array2 as $array2_key => $array2_inside ){\n if( $array2_inside[1] != $array_setting[1] ){\n ++$this->settings_array_changes;\n }\n $new[] = $array2_inside[1];\n unset($array2[$array2_key]); //remove as it has been processed\n unset($settings_array[$array_key]); //remove as it has been processed\n break;\n }\n }else{\n //no values posted so this value should be deleted, unset settings\n unset($settings_array[$array_key]); //remove as it has been processed\n }\n }\n\n //now check for leftovers in array2, these are new settings so just store them\n if( is_array($array2) === true ){\n reset($array2);\n foreach( $array2 as $array2_key => $array2_inside ){\n ++$this->settings_array_changes;\n $new[] = $array2_inside[1];\n unset($array2[$array2_key]); //remove as it has been processed\n\n }\n }\n\n return $new;\n }", "public function testArrayKeyExists(): void\n { \n $ma = [\"Bee A\", \"Bee B\", \"Bee c\"];\n list($a, $b, $c) = $ma;\n \n $obj = new Points();\n $obj->setPoints($a, 10);\n $obj->setPoints($b, 77);\n $obj->setPoints($c, 2);\n \n $res = $obj->getPointsArr();\n \n $this->assertTrue(array_key_exists($a, $res));\n $this->assertTrue(array_key_exists($b, $res));\n $this->assertTrue(array_key_exists($c, $res));\n }", "public function testIntersection() {\n\t\t$array1 = array(1, 2, 3, 5, 6);\n\t\t$array2 = array(1, 4, 5, 7, 8);\n\t\t$result = _::intersection($array1, $array2);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(5, $result[1]);\n\t}", "protected function assertArraysEqual(array $expected, array $actual, $regard_order = false, $check_keys = true) {\n // check length first\n $this->assertEquals(count($expected), count($actual), 'Failed to assert that two arrays have the same length.');\n\n // sort arrays if order is irrelevant\n if (!$regard_order) {\n if ($check_keys) {\n $this->assertTrue(ksort($expected), 'Failed to sort array.');\n $this->assertTrue(ksort($actual), 'Failed to sort array.');\n } else {\n $this->assertTrue(sort($expected), 'Failed to sort array.');\n $this->assertTrue(sort($actual), 'Failed to sort array.');\n }\n }\n\n $this->assertEquals($expected, $actual);\n }", "function artistsMatch($songs)\n {\n $val = null;\n foreach($songs as $song)\n {\n $val = $val == null ? $song->artist : $val;\n if($song->artist != $val)\n {\n return false;\n }\n }\n return true;\n }", "public static function intersectUKey(array $array1, array $array2): array{\n return call_user_func_array(\"array_intersect_ukey\", func_get_args());\n }", "public static function diff_Key($array1, $array2){\n return call_user_func_array([self, \"diffKey\"], func_get_args());\n }", "protected function isDataEqual(&$a, &$b): bool\n {\n // empty string is considered null in dynamodb\n if (\n (\\is_null($a) && \\is_string($b) && $b === '')\n || (\\is_null($b) && \\is_string($a) && $a === '')\n ) {\n return true;\n }\n\n if (gettype($a) != gettype($b)) {\n return false;\n }\n\n switch (true) {\n case (is_double($a)):\n return \"$a\" == \"$b\";\n break;\n case (is_array($a)):\n if (count($a) !== count($b)) {\n return false;\n }\n foreach ($a as $k => &$v) {\n if ( ! key_exists($k, $b)) {\n return false;\n }\n if ( ! $this->isDataEqual($v, $b[$k])) {\n return false;\n }\n }\n\n // every $k in $a can be found in $b and is equal\n return true;\n break;\n case (is_resource($a)):\n case (is_object($a)):\n throw new ODMException(\"DynamoDb data cannot contain value of resource/object\");\n break;\n default:\n return $a === $b;\n }\n }", "public function intersect($values);", "public static function assertArraysAreSame(array $expected, array $actual, ?string $message = null): void\n {\n $expectedString = json_encode($expected, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n $actualString = json_encode($actual, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n static::assertSame($expectedString, $actualString, $message ?? '');\n }", "function d2d_public_key_eql($key1, $key2) {\n\t$key1 = d2d_clean_public_key($key1);\n\t$key2 = d2d_clean_public_key($key2);\n\treturn $key1 === $key2;\n}", "function hash_equals ($a, $b) {\n\t\t$a_length = strlen($a);\n\t\tif ($a_length !== strlen($b)) { return false; }\n\n\t\t$result = 0;\n\t\tfor ($i = 0; $i < $a_length; $i++) {\n\t\t\t$result |= ord($a[$i]) ^ ord($b[$i]);\n\t\t}\n\n\t\treturn $result === 0;\n\t}", "public static function hasAmong($array1,$array2){\n\t\tforeach($array1 as $v1){\n\t\t\tif(in_array($v1,$array2)) return true;\n\t\t}\n\t\treturn false;\n\t}", "public function testIsAssociative()\n {\n $isAssociative = array(\n 'hello' => 'world',\n 'world' => 'hello'\n );\n\n $isTooAssociative = array(\n 'hello' => array(\n 'hello' => 'world',\n 'world' => array(\n 'hello' => 'world'\n )\n )\n );\n\n $isNotAssociative = array('hello', 'world');\n\n $this\n ->given($array = new classToTest())\n ->then\n ->boolean($array::isAssociative($isAssociative))\n ->isTrue()\n ->boolean($array::isAssociative($isTooAssociative))\n ->isTrue()\n ->boolean($array::isAssociative($isNotAssociative))\n ->isFalse()\n ;\n }", "function compareArrays($array1, $array2) {\n // Set a counter for the number of matches\n $numOfMatches = 0;\n\n // Loop through each value of $compare, running searchArrays on all values. \n foreach ($array2 as $keyword) {\n $foundAMatch = searchArrays($keyword, $array1);\n\n // Increment numOfMatch when a match is found.\n if ($foundAMatch) {\n $numOfMatches++;\n }\n }\n return $numOfMatches;\n}", "public static function assertArraysAreSame(array $expected, array $actual, ?string $message = null): void\n {\n $expectedString = static::jsonEncodePrettily($expected);\n $actualString = static::jsonEncodePrettily($actual);\n static::assertSame($expectedString, $actualString, $message ?? '');\n }", "function rest_are_values_equal($value1, $value2)\n {\n }", "function _array_kmerge($arr1,$arr2) {\n\tif(!is_array($arr1)) $arr1 = array();\n\tif(!is_array($arr2)) $arr2 = array();\n\n\t$keys = array_merge(array_keys($arr1),array_keys($arr2));\n\t$vals = array_merge(array_values($arr1),array_values($arr2));\n\t$ret = array();\n\tforeach($keys as $key) {\n\t\tlist($unused,$val) = each($vals);\n\t\tif (isset($ret[$key]) and is_int($key)) $ret[] = $val; else $ret[$key] = $val;\n\t}\n\treturn $ret;\n\t}", "public function test_attribute_copy_array()\n {\n $src = [\n \"1\" => \"shallow\",\n \"2\" => \"shallow\",\n \"3\" => [\n \"1\" => \"notshallow\",\n \"2\" => \"notshallow\",\n ],\n \"4\" => \"shallow\",\n \"5\" => [],\n ];\n $dist = shallow_copy_array($src);\n $expect = [\n \"1\" => \"shallow\",\n \"2\" => \"shallow\",\n \"4\" => \"shallow\"\n ];\n $this->assertTrue($this->arrays_are_similar($dist, $expect));\n }", "public function isEqual($_record, array $_toOmit = array());", "function checkarray($arr1,$arr2,$val,$out,$nummod,$startrot,$endrot)\n {\n $flagfirst=\"true\";\n $flagsecond=\"true\";\n\n for($i=$startrot;$i<=$endrot;$i++)\n {\n $array1='';\n $array2='';\n if($i!=$arr2) // second array value\n {\n $array1=$arr1.\",\".$i;\n\n if($out[$array1][0]==$val OR $out[$array1][1]==$val) // first array 1,2 get 1\n {\n\n $flagfirst=\"false\";\n break;\n }\n }\n\n }\n\n for($i=1;$i<=$nummod;$i++)\n {\n $array1='';\n $array2='';\n\n $array2=$i.\",\".$arr2;\n if($out[$array2][0]==$val OR $out[$array2][1]==$val) // first array 1,2 get 1\n {\n $flagsecond=\"false\";\n break;\n }\n }\n\n if($flagfirst==\"false\" OR $flagsecond==\"false\")\n {\n return \"false\";\n }\n else \n {\n return \"true\";\n }\n }", "public function equals(Setoid $that): bool;", "public function diffAssoc($array1)\n {\n return $this->combineCallback('array_diff_assoc', func_get_args());\n }", "public static function assertArraysAreSameIgnoringOrder(array $expected, array $actual, ?string $message = null): void\n {\n ksort($expected);\n ksort($actual);\n $expectedString = static::jsonEncodePrettily($expected);\n $actualString = static::jsonEncodePrettily($actual);\n static::assertSame($expectedString, $actualString, $message ?? '');\n }", "public function assertSamePosts(iterable $expected, iterable $actual): void\n {\n $expected = collect($expected);\n\n if (isset($expected->first()['ID'])) {\n $expected = $expected->pluck('ID');\n }\n\n $actual = collect($actual);\n\n if (isset($actual->first()['ID'])) {\n $actual = $actual->pluck('ID');\n }\n\n $this->assertTrue(\n $expected->diff($actual)->isEmpty(),\n \"Post collections are not matching\"\n );\n }", "function checkArrays($x, $y) {\n $A = new Matrix($x);\n $B = new Matrix($y);\n return $this->checkMatrices($A,$B);\n }", "static function altValue($key_arr, &$arr1, &$arr2)\n\t{\n\t\tif ($tmp = self::valByArrKey($arr1, $key_arr))\n\t\t\treturn $tmp;\n\n\t\treturn self::valByArrKey($arr2, $key_arr);\n\t}", "function array_key_exists_in_array_of_arrays($needle, string $key, array $haystack = null)\n{\n if (!$needle || !$key || !$haystack || !count($haystack)) {\n return false;\n }\n foreach ($haystack as $item) {\n if (array_key_exists($key, $item) && $needle === $item[$key]) {\n return true;\n }\n }\n return false;\n}", "function arrayIntoArray ($array1,$array2) {\nwhile(list($key,$val)=@each($array2)) {\n $array1[$key] = $val;\n}\nreturn $array1;\n}", "protected function isEqualArray(array $array1, array $array2, array $checkProperties)\n {\n foreach ($checkProperties as $check) {\n if ((int)$array1[$check] !== (int)$array2[$check]) {\n return false;\n }\n }\n return true;\n }", "function array_keys_exists(array $keys, array $arr)\n {\n return !array_diff_key(array_flip($keys), $arr);\n }", "public function testEvaluateReturnsEarlyWhenArraysSame(): void\n {\n $actual = [\n 'random' => 'value'\n ];\n\n $expected = [\n 'random' => 'value'\n ];\n\n $constraint = new ArraySameWithDates($expected);\n $result = $constraint->evaluate($actual, '', true);\n\n self::assertTrue($result);\n }", "public function compareFields($field1, $field2) {\n\t\tif (is_array($field1)) {\n\t\t\t$field1 = key($field1);\n\t\t}\n\n\t\tif (isset($this->data[$this->alias][$field1]) && isset($this->data[$this->alias][$field2]) &&\n\t\t\t$this->data[$this->alias][$field1] == $this->data[$this->alias][$field2]) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function provideEqualButNotIdenticalIds()\n {\n return array(\n array('123', 123),\n array('123', 123.0),\n array('', 0),\n array('0', 0),\n );\n }", "function use_equals($ar) {\r\n\tfor($i = 0, $j = count($ar); $i < $j; $i++) {\r\n\t\tif('gouda' == $ar[$i]) {\r\n\t\t\t// it's gouda\r\n\t\t}\r\n\t}\r\n}" ]
[ "0.78573424", "0.7347651", "0.6818272", "0.6810054", "0.67584395", "0.6720646", "0.6654318", "0.66026187", "0.65924275", "0.6530842", "0.6500268", "0.6349106", "0.6338769", "0.6286877", "0.62820876", "0.61874694", "0.6178441", "0.61343205", "0.6084194", "0.60712606", "0.6047975", "0.6019484", "0.60171354", "0.60011166", "0.5976936", "0.5888844", "0.58494323", "0.5841965", "0.5822698", "0.58119345", "0.5806406", "0.5789758", "0.5718346", "0.5714052", "0.56965035", "0.56806093", "0.5648148", "0.56462157", "0.5627554", "0.56223524", "0.5607967", "0.55816495", "0.5578918", "0.55727893", "0.5545856", "0.55384", "0.5532162", "0.55286014", "0.55170333", "0.5507238", "0.5505713", "0.55025065", "0.5499122", "0.5495617", "0.5489961", "0.54850125", "0.54554504", "0.54498965", "0.5449862", "0.5436953", "0.54209334", "0.5417731", "0.5413042", "0.5410762", "0.53998077", "0.5396264", "0.53952736", "0.5389653", "0.5386076", "0.5382615", "0.53821886", "0.5378534", "0.53780335", "0.53725624", "0.5367189", "0.5354154", "0.53476083", "0.53404695", "0.5328288", "0.52907735", "0.5277879", "0.52755255", "0.52714014", "0.5264605", "0.5238731", "0.52267087", "0.52181715", "0.52118945", "0.52070975", "0.51989925", "0.51817036", "0.51803553", "0.51746047", "0.51705587", "0.5165225", "0.51587", "0.5150541", "0.5147001", "0.5142125", "0.5121596" ]
0.6947548
2
Helper to get config value
public function getConfigValue($field, $storeId = null) { return $this->scopeConfig->getValue($field, ScopeInterface::SCOPE_STORE, $storeId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getConfigValue($key) {\r\n\t\t$db = & JFactory::getDBO() ;\r\n\t\t$sql = 'SELECT config_value FROM #__osmembership_configs WHERE config_key=\"'.$key.'\"';\r\n\t\t$db->setQuery($sql) ;\t\t\r\n\t\treturn $db->loadResult();\r\n\t}", "private function getConfigValue($value){\n return $this->scopeConfigInterface->getValue('payment/jpay/' . $value);\n }", "function get_config_value($config_name)\n\t{\n\t\tglobal $db, $table_prefix;\n\t\t$sql = \"SELECT config_value\n\t\t\t\t\t\tFROM \" . CONFIG_TABLE . \"\n\t\t\t\t\t\tWHERE config_name = '\" . $config_name . \"'\n\t\t\t\t\t\tLIMIT 1\";\n\t\tif (!($result = $db->sql_query($sql)))\n\t\t{\n\t\t\t$config_value = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$row = $db->sql_fetchrow($result);\n\t\t\t$config_value = !empty($row['config_value']) ? $row['config_value'] : '';\n\t\t}\n\t\treturn $config_value;\n\t}", "static function getValue($name) {\r\n if (isset(self::$config[$name])) \r\n return self::$config[$name];\r\n else {\r\n return DB::getConfig($name);\r\n }\r\n }", "function getConfigurationValue($key) {\r\n $value = '';\r\n $sqlConfiguration = xtc_db_query(\"SELECT * FROM configuration WHERE configuration_key='\".strtoupper($key).\"' LIMIT 1\");\r\n if(xtc_db_num_rows($sqlConfiguration)>0){\r\n $dataConfiguration = xtc_db_fetch_array($sqlConfiguration);\r\n $value = $dataConfiguration['configuration_value'];\r\n }\r\n return $value; \r\n }", "public function getConfigValue($key)\n {\n return $this->config[$key];\n }", "function getConfigValue($name) {\n return UserConfigOptions::getValue($name, $this);\n }", "public function get($key)\r\n {\r\n return $this->config[$key];\r\n }", "public function getConfigValue($path)\n {\n // return store config value\n return $this->scopeConfig->getValue($path);\n }", "function get_setting() {\n return get_config(NULL, $this->name);\n }", "function getConfig($config)\n{ \n return config(\"system.$config\");\n}", "function getConfigValue($name) {\n return CompanyConfigOptions::getValue($name, $this);\n }", "public function extractCurrentValue()\n {\n $pathParts = $this->getPathParts();\n return $this->findConfigPathValue($this->source ? $this->source : Yii::$app, $pathParts);\n }", "public function getConfigValue($path = '')\n {\n return $this->getConfigData()->_descend($this->configData, $path);\n }", "public function value($name)\r\r\n\t{\r\r\n\t\t$path = explode(CPF_CONFIG_VALUES_SEPARATOR, $name);\r\r\n\r\r\n\t\t$temp = $GLOBALS[CPF_CONFIG_ARRAY];\r\r\n\t\t$value = NULL;\r\r\n\t\t\r\r\n\t\tforeach ($path as $key)\r\r\n\t\t{\r\r\n\t\t\tif (isset($temp[$key]))\r\r\n\t\t\t{\r\r\n\t\t\t\t$value = $temp[$key];\r\r\n\t\t\t}\t\t\t\r\r\n\t\t\telse\r\r\n\t\t\t{\r\r\n\t\t\t \ttrigger_error(sprintf('Configuration value %s undefined', $name), E_USER_ERROR);\r\r\n\t\t\t\tbreak;\r\r\n\t\t\t}\r\r\n\t\t\t$temp = $temp[$key];\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\treturn $value;\r\r\n\t}", "public function getSetting() {}", "public function getSetting() {}", "public function getValueOf($id) {\n\t\t$config = $this->em->getRepository('SSNTherapassBundle:Config')->find($id);\n\t\tif (is_null($config)) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $config->getValue();\n\t}", "function fetchConfigurationValue($param, $sheet) {\n\t\t$value = trim($this->pi_getFFvalue($this->cObj->data['pi_flexform'], $param, $sheet));\n\t\treturn $value;\n\t}", "public function getValue($key = NULL) {\n return isset($this->config[$key]) ? $this->config[$key] : NULL;\n }", "function _get_config_param($name)\r\n\t{\r\n\t\treturn $this->db->query(\"select value from m_config_params where name = ? \",$name)->row()->value;\r\n\t}", "private function _get_connector_config_value($config_name){\n try {\n /**\n * Get the resource model\n */\n $resource = Mage::getSingleton('core/resource');\n \n /**\n * Retrieve the write connection\n */\n $readConnection = $resource->getConnection('core_read');\n \n /**\n * Retrieve our table name\n */\n $table = $resource->getTableName('minematic_config');\n \n //Update register\n $query = \"SELECT value FROM \" . $table . \" WHERE name = '\"\n . $config_name .\"'\";\n \n //Execute the query\n $config_value = $readConnection->fetchOne($query);\n\n return $config_value ? $config_value : FALSE;\n \n } catch (Exception $e) {\n //Log Exception Message\n Mage::helper('connector')->logSyncProcess($e->getMessage(), \"DATABASE\", \"ERROR\");\n }\n\n return FALSE;\n }", "public function getConfigKey(): string;", "public function getConfigValue(string $key):string\n {\n $config = $this->getConfig();\n if(is_array($config) && array_key_exists($key, $config))\n {\n return (string) $config[$key];\n }\n return '';\n }", "public function __get($key)\n {\n if (is_object($this->config)) {\n $value = $this->config->where('key', $key)->first();\n\n return $value ? $value->value : null;\n }\n }", "function configItem($key) {\n global $db;\n global $lang;\n\n if(configEnabled() == true) {\n $resp = $db->query(\"SELECT `val` FROM `\".$lang[\"config_db_name\"].\"`.`\".$lang[\"config_table_name\"].\"` WHERE `key` = '\".$key.\"' LIMIT 1\");\n if($resp) {\n if($resp->num_rows == 0) {\n return \"Unknown key\";\n } else {\n while($data = $resp->fetch_assoc()) {\n return $data[\"val\"];\n }\n }\n } else {\n return \"Unknown key\";\n }\n } else {\n return \"Not enabled\";\n }\n }", "public function __get($name): mixed {\n if (isset($this->data[$name]))\n return $this->data[$name];\n\n trigger_error(\n __(\"Requested configuration setting not found.\"),\n E_USER_NOTICE\n );\n\n return null;\n }", "public function __get($key) {\n\t\treturn $this->config->{$key};\n\t}", "function get_config_value($cfgset, $key, $defval)\n{\n if (array_key_exists($key, $cfgset)) {\n return $cfgset[$key];\n }\n else if ($defval !== null) {\n return $defval;\n }\n else {\n return null;\n }\n}", "public function getConfigName();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfigurationValue($key) {\n return $this->configuration[$key] ?? NULL;\n }", "public static function get($key)\n\t{\n\t\tif (is_array(self::$_CONF) AND array_key_exists($key, self::$_CONF))\n\t\t\treturn self::$_CONF[$key];\n\t\telseif($value = Db::getInstance()->getValue('SELECT `value` FROM `'.DB_PREFIX.'configuration` WHERE `name` = \\''.pSQL($key).'\\'')){\n\t\t\tself::$_CONF[$key] = $value;\n\t\t\treturn $value;\n\t\t}\n\t\treturn false;\n\t}", "public static function getConfigValue(string $value)\n {\n if (self::$_configuration instanceof JSONDBConfig) {\n return self::$_configuration->{\"get{$value}\"}();\n } else {\n switch ($value) {\n case \"StoragePath\":\n return dirname(dirname(__DIR__));\n\n default:\n throw new \\Exception(\"Invalid configuration value queried.\");\n }\n }\n }", "public static function value($fullpath)\n\t{\n //println($fullpath);\n //$fullpath = join('/',explode('.',$fullpath));\n\t\t$sides = explode('/',$fullpath);\n\t\t$path = array_pop($sides);\n\t\t$ns = join('/',$sides);\n //println(\"$ns, $path\");\n\t\treturn Config::get($ns, $path);\n\t}", "function sloodle_get_config($name)\n {\n // If in debug mode, ensure the name is prefixed appropriately for Sloodle\n if (defined('SLOODLE_DEBUG') && SLOODLE_DEBUG) {\n if (substr_count($name, 'sloodle_') < 1) {\n exit (\"ERROR: sloodle_get_config(..) called with invalid value name \\\"$name\\\". Expected \\\"sloodle_\\\" prefix.\");\n }\n }\n // Use the Moodle config function, ignoring the plugin parameter\n $val = get_config(NULL, strtolower($name));\n // Older Moodle versions return a database record object instead of the value itself\n // Workaround:\n if (is_object($val)) return $val->value;\n return $val;\n\t}", "static function getConfig() {\n\t\treturn self::getRegistry()->get(self::REGISTRY_CONFIG);\n\t}", "public function get($key){\r\n\t\tif(key_exists($key, $this->config)){\r\n\t\t\treturn $this->config[$key];\r\n\t\t}\r\n\t\tdie('Index is out of range');\r\n\t}", "public function getConfig($config_key)\n {\n if(array_key_exists(strtolower($config_key), self::$config_array)) \n {\n return self::$config_array[strtolower($config_key)];\n }\n\n try \n {\n return self::getDefaultValue($config_key);\n }\n catch(\\Exception $e) \n {\n printf(\"Unable to prepare configs: %s\", $e->getMessage());\n }\n }", "public function get($key)\n {\n if (array_key_exists($key, $this->config)) {\n $value = $this->config[ $key ];\n } elseif ($this->offsetExists($key)) {\n $value = $this->defaults[ $key ];\n } else {\n throw new Exception(\"Config entry «{$key}» doesn't exists. \");\n }\n\n return $value;\n }", "public function get_config()\n\t{\n\t\treturn $this->cfg;\n\t}", "abstract protected function getConfig();", "public function config_get(){\n\t\treturn $this->fb->exec('dhcp.config_get');\n\t}", "public function getValue($config, $default = null) {\n\t\t$value = $this->config->getConfigValue(\n\t\t\t$config,\n\t\t\tarray_get($config, $this->defaults, $default)\n\t\t\t);\n\t\t$this->dispatch('SystemConfigGetValue', array($config, $value));\n\t\treturn $value;\n\t}", "function getConfigPropertyValue($config, $pagename, $property){\n\t\treturn $config['query']['results'][$pagename]['printouts'][$property][0];\n\t}", "function getValue( $key ) {\n\t\tif ( $value = $this->context->getValue( $key ) ) {\n\t\t\treturn $value;\n\t\t} else {\n\t\t\treturn $this->description->getConfigurationValue( $key );\n\t\t}\n\t}", "public function getSettingValue()\n {\n if (array_key_exists(\"settingValue\", $this->_propDict)) {\n return $this->_propDict[\"settingValue\"];\n } else {\n return null;\n }\n }", "public static function get($key=null){\n\t\t $connection = MyActiveRecord::getDb();\n\t\t if(empty(self::$psconfig_values))\n\t\t {\n\t\t\t $query = \"SELECT name, value FROM \" . SITE_CONFIG;\n\t\t\t $rst = $connection->createCommand($query)->queryAll();\n\t\t\t foreach($rst as $v){\n\t\t\t\t self::$psconfig_values[$v['name']] = $v['value'];\n\t\t\t }\n\t\t }\n \t\treturn self::$psconfig_values[$key];\n\t\t}", "protected function get(string $key)\n {\n if (!array_key_exists($key, $this->config)) throw new InvalidConfigException(\"Your configuration doesn't have a value for the key `$key`\");\n return $this->config[$key];\n }", "private static function _getConfig()\n\t{\n\t\treturn \\Config::get('app.fqdn', '');\n\t}", "abstract public function getConfigName();", "protected function get($name) {\n return $this->configuration->get($name);\n }", "public function config($value)\n {\n return Mage::getStoreConfig(\"simple_relevance/general/$value\");\n }", "private function getConfig($key)\n {\n return $this->config->get($key);\n }", "public static function getConfig($param){\n\n if(isset(self::$config[$param])){\n return self::$config[$param];\n } else {\n return null;\n }\n\n }", "function get($key)\n {\n return stripslashes($this->config[$key]);\n }", "public function getConfig() {}", "public function getConfig($key);", "public function getConfig($key);", "protected function _getValueFromConfig()\n {\n return $this->_scopeConfig->getValue(\n \\Magento\\GiftMessage\\Helper\\Message::XPATH_CONFIG_GIFT_MESSAGE_ALLOW_ITEMS,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function getConfig($key) {\n $registry = new Registry();\n // Database\n $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);\n $registry->set('db', $db);\n $query = $db->query(\"SELECT value FROM \" . DB_PREFIX . \"setting WHERE `key` = '\" . $db->escape(utf8_strtolower($key)) . \"'\");\n\n return $query->row['value'];\n }", "function chevereto_config($config_key) {\n\tglobal $config;\n\treturn $config[$config_key];\n}", "function getConfig($param, $return = false) {\n\n $json = new JSONParser(D . '/config.json', 'en-en');\n $r = (string) $json->stream->data[0]->{$param};\n\n if ($return) {\n return (isset($r) && !empty($r)) ? $r : false;\n } else {\n echo (isset($r) && !empty($r)) ? $r : '';\n }\n}", "function getSystemSettingValue($code){\n\t\t\n\t\t$sql = \"SELECT value \n\t\t\t\tFROM settings\n\t\t\t\tWHERE varname = '\".$code.\"'\";\n\t\t$rslt = $this->dbclass->select($sql);\n\t\t\n\t\treturn $rslt[0]['value'];\n\t}", "public static function getConfig()\n {\n return self::$config;\n }", "public static function getConfValue($key)\n\t{\t\t\n\t\tif(is_scalar($key)) return self::$_conf[$key];\n\t\treturn null;\n\t}", "public function getValue() {\n\n\t\treturn trim(\n\t\t\tfile_get_contents(\n\t\t\t\tself::PINDIR.'/gpio'.$this->iPinNumber.'/value'\n\t\t\t)\n\t\t);\n\t}", "function getConfig($key = '')\n {\n return isset($this->config[$key]) ? $this->config[$key] : null;\n }", "function getConfig($key)\n{\n return $GLOBALS['config'][$key];\n}", "static function config($path, $def = null) {\n\t\t// Load config if needed\n\t\tif (is_null(self::$config))\n\t\t\tself::loadConfig();\n\t\t// Split path\n\t\t$parts = explode(\".\", $path);\n\t\t$config = self::$config;\n\t\t// Explore the config to find the requested value\n\t\tforeach ($parts as $part) {\n\t\t\tif (isset($config->$part))\n\t\t\t\t$config = $config->$part;\n\t\t\telse\n\t\t\t\treturn $def;\n\t\t}\n\t\treturn $config;\n\t}", "abstract public function getConfig();", "public function getConfig(){\n\t\treturn $this->_config;\n\t}", "public static function get($key)\n {\n return Arr::get(static::$config, $key);\n }", "public function config(string $config): mixed\n {\n return $this->config->get($config);\n }", "function sloodle_get_value($settings, $name, $default = null)\n {\n if (is_array($settings) && isset($settings[$name])) return $settings[$name];\n return $default;\n }", "static public function get($key) {\n if (!property_exists(self::getConfig(), $key))\n return null;\n else\n return self::getConfig()->$key;\n }", "public function configOffsetGet($name)\n {\n return $this->settings[$name];\n }", "function fetchConfigParameter($name){\n try {\n global $db_table_prefix;\n\n $results = array();\n\n $db = pdoConnect();\n\n $query = \"SELECT id, value\n\t\tFROM \".$db_table_prefix.\"configuration WHERE name = :name\";\n\n if (!$stmt = $db->prepare($query))\n return false;\n\n $sqlVars[\":name\"] = $name;\n\n if (!$stmt->execute($sqlVars)){\n // Error\n return false;\n }\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n if ($row)\n return $row['value'];\n else {\n addAlert(\"danger\", \"The specified configuration parameter could not be found.\");\n return false;\n }\n\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n }\n}", "public function get_setting( $name ){\n $setting = '';\n if( isset($this->settings[$name]) )\n $setting = $this->settings[$name];\n return $setting;\n }", "public function get_setting( $name ){\n $setting = '';\n if( isset($this->settings[$name]) )\n $setting = $this->settings[$name];\n return $setting;\n }", "public function get_setting( $name ){\n $setting = '';\n if( isset($this->settings[$name]) )\n $setting = $this->settings[$name];\n return $setting;\n }", "public function config($valueOf)\n {\n return DB::table('settings')->where('userId', Auth::user()->id)->value($valueOf);\n }", "function getConfig($confProp=null){\r\n\t\t$conf = self::modulesConfig();\r\n\t\treturn $confProp?$conf[$this->name][$confProp]:$conf[$this->name];\r\n\t}", "public function getConfig(){\n\n $config = $this->propToConfig();\n return $config;\n\n }", "final protected function f(string $k) {return df_config_field()->getAttribute($k);}", "private function config($key)\n {\n return Config::get('mediabrowser::mediabrowser.' . $key);\n }", "public function get( $key ) {\n\t\tif ( isset( $this->config[ $key ] ) ) {\n\t\t\treturn $this->config[ $key ];\n\t\t}\n\t\treturn null;\n\t}", "protected function config($key)\n {\n return $this->app['config']->get($key);\n }", "protected function config($name) {\n return $this->configFactory->get($name);\n }", "function config(string $name)\n {\n return app()->services()->config()->{$name};\n }", "function conf($path) {\n\t$config = $GLOBALS['config'];\n\n\tif(strstr($path, '.')) {\n\t\t$config = array_get($config, $path);\n\t\tif(!$config) Log::caller('path: ' . $path);\n\t}\n\telse if(!isset($config[$path])) {\n\t\tLog::caller('Cannot find configuration parameter | path: ' . $path);\n\t\t//die('Cannot find configuration parameter | $path: ' . $path);\n\t\treturn '';\n\t}\n\telse $config = $config[$path];\n\n\treturn $config;\n}", "function value($setting, $main='site')\n {\n $value = $this->out->trimmed($setting);\n if (empty($value)) {\n $value = common_config($main, $setting);\n }\n return $value;\n }", "function config($key){\n\t$app = \\Jolt\\Jolt::getInstance();\n\treturn $app->option($key);\n}", "public static function get($key)\r\n {\r\n require_once ROOT . \"/app/config/{$key}.php\";\r\n return isset(self::$settings[$key]) ? self::$settings[$key] : null;\r\n }" ]
[ "0.7553278", "0.7431989", "0.74247754", "0.73062676", "0.7257997", "0.7177456", "0.7113648", "0.6987677", "0.69816", "0.69451654", "0.69317466", "0.69019854", "0.68590444", "0.6828171", "0.6808459", "0.67643625", "0.67643625", "0.67579144", "0.67278004", "0.6704792", "0.670304", "0.67011285", "0.66783684", "0.66725504", "0.6646272", "0.66438425", "0.6643617", "0.6634631", "0.6629706", "0.66189104", "0.6597898", "0.6597898", "0.6597898", "0.6597898", "0.6597898", "0.6597898", "0.6597898", "0.6597898", "0.65878683", "0.6586702", "0.6562387", "0.65617025", "0.6552323", "0.65315366", "0.6529461", "0.65122545", "0.64976794", "0.6493714", "0.64924246", "0.64908904", "0.64882517", "0.6485408", "0.6467329", "0.6465827", "0.6461008", "0.64608264", "0.6441409", "0.6434691", "0.6414049", "0.6395257", "0.6394318", "0.63875234", "0.6382433", "0.63820755", "0.63701236", "0.63701236", "0.6365236", "0.6363149", "0.6362628", "0.63604033", "0.63570833", "0.6356416", "0.6342209", "0.63421106", "0.63413215", "0.63396955", "0.63374114", "0.6334807", "0.6323991", "0.63228136", "0.63143075", "0.63092303", "0.6301458", "0.6299239", "0.629236", "0.62910515", "0.62910515", "0.62910515", "0.62809336", "0.62795603", "0.62684405", "0.62640065", "0.6262566", "0.62603253", "0.62592286", "0.62554485", "0.62505054", "0.6247831", "0.6241832", "0.62386435", "0.62358683" ]
0.0
-1
Helper to get general config value
public function getGeneralConfig($code, $storeId = null) { return $this->getConfigValue(self::XML_PATH_NEWSLETTER_AJAX . 'general/' . $code, $storeId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_setting() {\n return get_config(NULL, $this->name);\n }", "function getConfigValue($key) {\r\n\t\t$db = & JFactory::getDBO() ;\r\n\t\t$sql = 'SELECT config_value FROM #__osmembership_configs WHERE config_key=\"'.$key.'\"';\r\n\t\t$db->setQuery($sql) ;\t\t\r\n\t\treturn $db->loadResult();\r\n\t}", "static function getValue($name) {\r\n if (isset(self::$config[$name])) \r\n return self::$config[$name];\r\n else {\r\n return DB::getConfig($name);\r\n }\r\n }", "abstract protected function getConfig();", "function getConfigurationValue($key) {\r\n $value = '';\r\n $sqlConfiguration = xtc_db_query(\"SELECT * FROM configuration WHERE configuration_key='\".strtoupper($key).\"' LIMIT 1\");\r\n if(xtc_db_num_rows($sqlConfiguration)>0){\r\n $dataConfiguration = xtc_db_fetch_array($sqlConfiguration);\r\n $value = $dataConfiguration['configuration_value'];\r\n }\r\n return $value; \r\n }", "abstract public function getConfigName();", "function get_config_value($config_name)\n\t{\n\t\tglobal $db, $table_prefix;\n\t\t$sql = \"SELECT config_value\n\t\t\t\t\t\tFROM \" . CONFIG_TABLE . \"\n\t\t\t\t\t\tWHERE config_name = '\" . $config_name . \"'\n\t\t\t\t\t\tLIMIT 1\";\n\t\tif (!($result = $db->sql_query($sql)))\n\t\t{\n\t\t\t$config_value = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$row = $db->sql_fetchrow($result);\n\t\t\t$config_value = !empty($row['config_value']) ? $row['config_value'] : '';\n\t\t}\n\t\treturn $config_value;\n\t}", "abstract public function getConfig();", "public function getData()\n {\n if ($this->configIsValid('common')) {\n return $this->Config['common']; \n }\n }", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "abstract protected function getSetting() ;", "function getConfigValue($name) {\n return UserConfigOptions::getValue($name, $this);\n }", "public function getSetting() {}", "public function getSetting() {}", "public function getConfigName();", "function getConfig($config)\n{ \n return config(\"system.$config\");\n}", "function _get_config_param($name)\r\n\t{\r\n\t\treturn $this->db->query(\"select value from m_config_params where name = ? \",$name)->row()->value;\r\n\t}", "public function get($key)\r\n {\r\n return $this->config[$key];\r\n }", "public function getConfigValue($key)\n {\n return $this->config[$key];\n }", "static function getConfig() {\n\t\treturn self::getRegistry()->get(self::REGISTRY_CONFIG);\n\t}", "public function __get($key) {\n\t\treturn $this->config->{$key};\n\t}", "function getConfigValue($name) {\n return CompanyConfigOptions::getValue($name, $this);\n }", "public function getGeneralSetting($config_name)\n {\n return Mage::getStoreConfig('Shoptimally/GeneralSettings/' . $config_name, Mage::app()->getStore());\n }", "function sloodle_get_config($name)\n {\n // If in debug mode, ensure the name is prefixed appropriately for Sloodle\n if (defined('SLOODLE_DEBUG') && SLOODLE_DEBUG) {\n if (substr_count($name, 'sloodle_') < 1) {\n exit (\"ERROR: sloodle_get_config(..) called with invalid value name \\\"$name\\\". Expected \\\"sloodle_\\\" prefix.\");\n }\n }\n // Use the Moodle config function, ignoring the plugin parameter\n $val = get_config(NULL, strtolower($name));\n // Older Moodle versions return a database record object instead of the value itself\n // Workaround:\n if (is_object($val)) return $val->value;\n return $val;\n\t}", "public function __get($name): mixed {\n if (isset($this->data[$name]))\n return $this->data[$name];\n\n trigger_error(\n __(\"Requested configuration setting not found.\"),\n E_USER_NOTICE\n );\n\n return null;\n }", "function get_config_value($cfgset, $key, $defval)\n{\n if (array_key_exists($key, $cfgset)) {\n return $cfgset[$key];\n }\n else if ($defval !== null) {\n return $defval;\n }\n else {\n return null;\n }\n}", "private function getConfigValue($value){\n return $this->scopeConfigInterface->getValue('payment/jpay/' . $value);\n }", "public function getConfigKey(): string;", "function getConfig($key, $default)\n{\n global $config;\n return isset($config[$key])\n ? $config[$key]\n : $default;\n}", "private static function _getConfig()\n\t{\n\t\treturn \\Config::get('app.fqdn', '');\n\t}", "function configItem($key) {\n global $db;\n global $lang;\n\n if(configEnabled() == true) {\n $resp = $db->query(\"SELECT `val` FROM `\".$lang[\"config_db_name\"].\"`.`\".$lang[\"config_table_name\"].\"` WHERE `key` = '\".$key.\"' LIMIT 1\");\n if($resp) {\n if($resp->num_rows == 0) {\n return \"Unknown key\";\n } else {\n while($data = $resp->fetch_assoc()) {\n return $data[\"val\"];\n }\n }\n } else {\n return \"Unknown key\";\n }\n } else {\n return \"Not enabled\";\n }\n }", "function getConfig($key)\n{\n return $GLOBALS['config'][$key];\n}", "public static function get($key=null){\n\t\t $connection = MyActiveRecord::getDb();\n\t\t if(empty(self::$psconfig_values))\n\t\t {\n\t\t\t $query = \"SELECT name, value FROM \" . SITE_CONFIG;\n\t\t\t $rst = $connection->createCommand($query)->queryAll();\n\t\t\t foreach($rst as $v){\n\t\t\t\t self::$psconfig_values[$v['name']] = $v['value'];\n\t\t\t }\n\t\t }\n \t\treturn self::$psconfig_values[$key];\n\t\t}", "function my_config($index = '') \n\t{\t\n\t\tglobal $CI;\n\n\t\treturn $CI->my_config->item($index); \n\t}", "public function get_config()\n\t{\n\t\treturn $this->cfg;\n\t}", "function getConfig($confProp=null){\r\n\t\t$conf = self::modulesConfig();\r\n\t\treturn $confProp?$conf[$this->name][$confProp]:$conf[$this->name];\r\n\t}", "public function getValue($key = NULL) {\n return isset($this->config[$key]) ? $this->config[$key] : NULL;\n }", "public function config_get(){\n\t\treturn $this->fb->exec('dhcp.config_get');\n\t}", "public function get_config( $key, $default = false ) {\n\n global $id, $post;\n\n // Get the current post ID. If ajax, grab it from the $_POST variable.\n if ( defined( 'DOING_AJAX' ) && DOING_AJAX && array_key_exists( 'post_id', $_POST ) ) {\n $post_id = absint( $_POST['post_id'] );\n } else {\n $post_id = isset( $post->ID ) ? $post->ID : (int) $id;\n }\n\n // Get config\n $settings = get_post_meta( $post_id, '_eg_gallery_data', true );\n\n // Check config key exists\n if ( isset( $settings['config'][ $key ] ) ) {\n return $settings['config'][ $key ];\n } else {\n return $default ? $default : '';\n }\n\n }", "public function getConfig() {}", "public function value($name)\r\r\n\t{\r\r\n\t\t$path = explode(CPF_CONFIG_VALUES_SEPARATOR, $name);\r\r\n\r\r\n\t\t$temp = $GLOBALS[CPF_CONFIG_ARRAY];\r\r\n\t\t$value = NULL;\r\r\n\t\t\r\r\n\t\tforeach ($path as $key)\r\r\n\t\t{\r\r\n\t\t\tif (isset($temp[$key]))\r\r\n\t\t\t{\r\r\n\t\t\t\t$value = $temp[$key];\r\r\n\t\t\t}\t\t\t\r\r\n\t\t\telse\r\r\n\t\t\t{\r\r\n\t\t\t \ttrigger_error(sprintf('Configuration value %s undefined', $name), E_USER_ERROR);\r\r\n\t\t\t\tbreak;\r\r\n\t\t\t}\r\r\n\t\t\t$temp = $temp[$key];\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\treturn $value;\r\r\n\t}", "function getConfig($item) {\n if (array_key_exists($item, CONFIG)) return CONFIG[$item];\n if (array_key_exists($item, DEFAULTS)) return DEFAULTS[$item];\n}", "public function config($value)\n {\n return Mage::getStoreConfig(\"simple_relevance/general/$value\");\n }", "public function getConfig($name = '', $default = null);", "function value($setting, $main='site')\n {\n $value = $this->out->trimmed($setting);\n if (empty($value)) {\n $value = common_config($main, $setting);\n }\n return $value;\n }", "function get($name, $site_guid = 0) {\n\n\n\t\t$name = trim($name);\n\n\t\t$site_guid = (int) $site_guid;\n\n\t\t// check for deprecated values.\n\t\t// @todo might be a better spot to define this?\n\t\t$new_name = false;\n\t\tswitch($name) {\n\t\t\tcase 'pluginspath':\n\t\t\t\t$new_name = 'plugins_path';\n\t\t\t\tbreak;\n\n\t\t\tcase 'sitename':\n\t\t\t\t$new_name = 'site_name';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// @todo these haven't really been implemented in Elgg 1.8. Complete in 1.9.\n\t\t// show dep message\n\t\tif ($new_name) {\n\t\t\t//\t$msg = \"Config value $name has been renamed as $new_name\";\n\t\t\t$name = $new_name;\n\t\t\t//\telgg_deprecated_notice($msg, $dep_version);\n\t\t}\n\n\t\tif ($site_guid == 0) {\n\t\t\t$site_guid = (int) $this->CONFIG->site_guid;\n\t\t}\n\n\t\t// decide from where to return the value\n\t\tif ($site_guid == $this->CONFIG->site_guid && isset($this->CONFIG->$name)) {\n\t\t\treturn $this->CONFIG->$name;\n\t\t}\n\n\t\t$escaped_name = sanitize_string($name);\n\t\t$result = _elgg_services()->db->getDataRow(\"SELECT value FROM {$this->CONFIG->dbprefix}config\n\t\t\tWHERE name = '$escaped_name' AND site_guid = $site_guid\");\n\n\t\tif ($result) {\n\t\t\t$result = unserialize($result->value);\n\n\t\t\tif ($site_guid == $this->CONFIG->site_guid) {\n\t\t\t\t$this->CONFIG->$name = $result;\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}\n\n\t\treturn null;\n\t}", "public function extractCurrentValue()\n {\n $pathParts = $this->getPathParts();\n return $this->findConfigPathValue($this->source ? $this->source : Yii::$app, $pathParts);\n }", "public function getConfig($key);", "public function getConfig($key);", "public function getConfigurationValue($key) {\n return $this->configuration[$key] ?? NULL;\n }", "function sloodle_get_value($settings, $name, $default = null)\n {\n if (is_array($settings) && isset($settings[$name])) return $settings[$name];\n return $default;\n }", "public function get_setting( $name ){\n $setting = '';\n if( isset($this->settings[$name]) )\n $setting = $this->settings[$name];\n return $setting;\n }", "public function get_setting( $name ){\n $setting = '';\n if( isset($this->settings[$name]) )\n $setting = $this->settings[$name];\n return $setting;\n }", "public function get_setting( $name ){\n $setting = '';\n if( isset($this->settings[$name]) )\n $setting = $this->settings[$name];\n return $setting;\n }", "function acapi_get_option_file() {\n $defaults = acapi_common_options();\n return drush_get_option('ac-config', $defaults['ac-config']['default_value']);\n}", "public function getConfig(){\n\t\treturn $this->_config;\n\t}", "private function getBaseConfig() {\n return \\Drupal::getContainer()->get('itkore_admin.itkore_config');\n }", "function igit_config_get( $key, $default = null ) {\n\n // Return the default value if settings aren't set or the key is missing.\n if ( false === ( $settings = get_option( IGIT_SETTINGS ) ) || ! isset( $settings[$key] ) ) {\n return $default;\n };\n\n return $settings[$key];\n\n}", "public function getConfig($config_key)\n {\n if(array_key_exists(strtolower($config_key), self::$config_array)) \n {\n return self::$config_array[strtolower($config_key)];\n }\n\n try \n {\n return self::getDefaultValue($config_key);\n }\n catch(\\Exception $e) \n {\n printf(\"Unable to prepare configs: %s\", $e->getMessage());\n }\n }", "public static function getConfig($param){\n\n if(isset(self::$config[$param])){\n return self::$config[$param];\n } else {\n return null;\n }\n\n }", "public function get_config_for_external() {\n \treturn data_field_admin::get_field_params($this->field);\n }", "public function getConfig()\n {\n return Mage::helper(\"meanbee_osd/config\");\n }", "private static function getDefaultValue($config_key)\n {\n foreach((New \\ReflectionClass(get_class()))->getConstants() as $constant_name => $constant_value) \n {\n if(strtolower($config_key) === strtolower($constant_name)) \n {\n return $constant_value;\n }\n }\n throw new \\Exception(\"Cannot define custom config property: $config_key\");\n }", "protected static function get_config_setting($name, $key = null) {\n $value = Config::inst()->get(get_called_class(), $name);\n if ($key && $value && is_array($value) && array_key_exists($key, $value)) {\n return $value[$key];\n }\n return $value;\n }", "public function __get($key)\n {\n if (is_object($this->config)) {\n $value = $this->config->where('key', $key)->first();\n\n return $value ? $value->value : null;\n }\n }", "function getConfig() {\r\n\t\tstatic $config ;\r\n\t\tif (!$config) {\r\n\t\t\t$db = & JFactory::getDBO();\r\n\t\t\t$config = new stdClass ;\r\n\t\t\t$sql = 'SELECT * FROM #__osmembership_configs';\r\n\t\t\t$db->setQuery($sql);\r\n\t\t\t$rows = $db->loadObjectList();\r\n\t\t\tfor ($i = 0 , $n = count($rows); $i < $n; $i++) {\r\n\t\t\t\t$row = $rows[$i];\r\n\t\t\t\t$key = $row->config_key;\r\n\t\t\t\t$value = stripslashes($row->config_value);\t\t\t\t\r\n\t\t\t\t$config->$key = $value;\t\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\treturn $config;\r\n\t}", "function getProperty($name, $default = '') {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_module_options.php');\n $optionValue = base_module_options::readOption($this->moduleGuid, $name, $default);\n return $optionValue;\n }", "function fetchConfigurationValue($param, $sheet) {\n\t\t$value = trim($this->pi_getFFvalue($this->cObj->data['pi_flexform'], $param, $sheet));\n\t\treturn $value;\n\t}", "function getConfig($key = '')\n {\n return isset($this->config[$key]) ? $this->config[$key] : null;\n }", "public static function get($key)\n\t{\n\t\tif (is_array(self::$_CONF) AND array_key_exists($key, self::$_CONF))\n\t\t\treturn self::$_CONF[$key];\n\t\telseif($value = Db::getInstance()->getValue('SELECT `value` FROM `'.DB_PREFIX.'configuration` WHERE `name` = \\''.pSQL($key).'\\'')){\n\t\t\tself::$_CONF[$key] = $value;\n\t\t\treturn $value;\n\t\t}\n\t\treturn false;\n\t}", "public function getConfig(){\n\n $config = $this->propToConfig();\n return $config;\n\n }", "function chevereto_config($config_key) {\n\tglobal $config;\n\treturn $config[$config_key];\n}", "public function getConfig() {\r\n\r\n\t}", "final protected function f(string $k) {return df_config_field()->getAttribute($k);}", "public function get($name) { \n \n if (isset($this->settings[$name])) return $this->settings[$name];\n return null;\n \n }", "protected function getConfigParam($param, $default = true)\n {\n return isset($this->$param) ? $this->$param : ArrayHelper::getValue($this->form->formConfig, $param, $default);\n }", "protected function getConfigValue($key, $default = null)\n {\n if (!$this->config) {\n $this->config = \\SugarConfig::getInstance()->get('passwordsetting');\n }\n return array_key_exists($key, $this->config) ? $this->config[$key] : $default;\n }", "function getConfig()\n {\n return $this->_api->doRequest(\"GET\", \"{$this->getBaseApiPath()}/config\");\n }", "public function getConfigValue(string $key):string\n {\n $config = $this->getConfig();\n if(is_array($config) && array_key_exists($key, $config))\n {\n return (string) $config[$key];\n }\n return '';\n }", "static public function getConfig($key = null)\n {\n return Ini::getConfig($key);\n }", "public function getValue($config, $default = null) {\n\t\t$value = $this->config->getConfigValue(\n\t\t\t$config,\n\t\t\tarray_get($config, $this->defaults, $default)\n\t\t\t);\n\t\t$this->dispatch('SystemConfigGetValue', array($config, $value));\n\t\treturn $value;\n\t}", "public static function getGeneralConfig(){\n\t\tif(CoreConfig::$config == null){\n\t\t\tCoreConfig::getConfig();\n\t\t\tCoreConfig::$config['Core']['url'] = CoreConfig::getUrl();\n\t\t\tCoreConfig::$config['Core']['localUrl'] = CoreConfig::getLocalUrl();\n\t\t}\n\t\tif(!empty(CoreConfig::$config['Core'])) {\n\n\t\t\treturn CoreConfig::$config['Core'];\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}", "public function getConfig(){\n\t\t$request = $this->_sendPacketToController(self::GET_CONFIG);\n\t\tif ($request->getState() == self::STATE_OK) // If the packet is send sucefully\n\t\t\treturn $this->_getResponse(); // TODO mettre en forme la sortie\n\t\telse\n\t\t\treturn $request;\n\t}", "function getLocationConfig()\n {\n return $this->_setup['locationconfig'];\n }", "public function getConfig($key) {\n $registry = new Registry();\n // Database\n $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);\n $registry->set('db', $db);\n $query = $db->query(\"SELECT value FROM \" . DB_PREFIX . \"setting WHERE `key` = '\" . $db->escape(utf8_strtolower($key)) . \"'\");\n\n return $query->row['value'];\n }", "function getStoreConfigOption($optionToGet, $fieldToGet)\r\n\t{\r\n\t\t$optionValue = '';\r\n\r\n\t\t$option = get_option($optionToGet);\r\n\t\tif(!is_array($option))\r\n\t\t{\r\n\t\t\t$option = unserialize($option);\r\n\t\t}\r\n\t\tif(isset($option[$fieldToGet]))\r\n\t\t{\r\n\t\t\t$optionValue = $option[$fieldToGet];\r\n\t\t}\r\n\r\n\t\treturn $optionValue;\r\n\t}", "public static function getConfig()\n {\n return self::$config;\n }", "function getValue( $key ) {\n\t\tif ( $value = $this->context->getValue( $key ) ) {\n\t\t\treturn $value;\n\t\t} else {\n\t\t\treturn $this->description->getConfigurationValue( $key );\n\t\t}\n\t}", "public function getConfigSys()\n {\n return $this->__config__;\n }", "private function getConfig($key, $default = null)\n {\n return $this->config()->get(\"settings.{$key}\", $default);\n }", "function get_setting($name)\n {\n }", "public function getValueOf($id) {\n\t\t$config = $this->em->getRepository('SSNTherapassBundle:Config')->find($id);\n\t\tif (is_null($config)) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $config->getValue();\n\t}", "public static function read()\n {\n return self::$config;\n }", "protected function get($name) {\n return $this->configuration->get($name);\n }" ]
[ "0.72003764", "0.7107388", "0.71034867", "0.6974526", "0.6932584", "0.69272727", "0.68756825", "0.6827483", "0.6818475", "0.6803207", "0.6803207", "0.6803207", "0.6803207", "0.6803207", "0.6803207", "0.6803207", "0.6803207", "0.6763692", "0.6747255", "0.67431974", "0.67431974", "0.67323405", "0.6731607", "0.6699621", "0.66632974", "0.66613734", "0.66572577", "0.66554743", "0.6643009", "0.6613906", "0.6598417", "0.6592417", "0.6591189", "0.65871054", "0.65663093", "0.6557102", "0.6553792", "0.65481997", "0.6542995", "0.65158004", "0.650868", "0.6495076", "0.64939183", "0.64753103", "0.6450881", "0.64502245", "0.64487594", "0.64475733", "0.64439696", "0.64303386", "0.642896", "0.6426652", "0.64223856", "0.6421118", "0.64177406", "0.64177406", "0.6409086", "0.6405858", "0.63976324", "0.63976324", "0.63976324", "0.6372489", "0.6352419", "0.63523227", "0.63436574", "0.63092107", "0.63018686", "0.63001055", "0.62942606", "0.6293042", "0.6288036", "0.62874866", "0.6286563", "0.6285689", "0.6282378", "0.62816566", "0.6267124", "0.62669224", "0.62643224", "0.6259406", "0.6259357", "0.6258808", "0.62450737", "0.62424767", "0.62409264", "0.623934", "0.62387097", "0.62284505", "0.6226048", "0.62185985", "0.6210959", "0.6210923", "0.6207578", "0.62056", "0.6204328", "0.620314", "0.6199661", "0.6196102", "0.6189812", "0.6181219", "0.6176596" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('portada')->truncate(); $usuarios = array( array( 'texto_superior_derecho' => 'Gremial Médica Hospitalaria Frace breve de Bienvenida Hasta ochenta y nueve (89) caracteres', 'texto_central' => 'Gremial Médica Hospitalaria Lorem ipsum dolor slo onsec tueraliquet Morbi nec In Curabitur lreaoreet nisl lorem in pellente e vidicus pannel impirus sadintas velisurabitur lreaoreet nisl lorem in pellente vidicus pannel. ', 'footer_titulo_primero' => 'Quiens Somos', 'footer_titulo_segundo' => 'Secciones', 'footer_titulo_tercero' => 'Contacto', 'footer_titulo_primero_descripcion' => 'Lorem ipsum dolor sit amet, ea unum veri debitis cum. No viris accumsan consulatu per. Ei amet sonet est, assum choro scriptorem id eos. Ad autem adipisci his. Mel et facete concludaturque. Oblique torquatos adolescens cu est. Vix no antiopam conclusionemque. Cum tamquam debitis mnesarchum ne, ex duo magna errem. Ei sit persius perfecto splendide, pro tamquam debitis et.', 'footer_titulo_segundo_descripcion' => 'Seccion 1 <br> Seccion 2', 'footer_titulo_tercero_descripcion' => 'Direccion : Av 9 de Julio <br> Telefono : 000.000.000.000 <br> Email : [email protected]'), ); DB::table('portada')->insert($usuarios); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Returns app settings by environment
public static function getSettings(string $environment = self::ENV_DEVELOPMENT): array { return [ 'settings' => array_replace_recursive(self::$settings['development'], self::$settings[$environment]), ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function environment()\n {\n return \\Config::get('app')['env'];\n }", "public static function get()\n\t{\n\t\t// then return content of APPLICATION_ENV\n\t\t// else return \"development\"\n\t\treturn (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : \"development\");\n\t}", "function get_environment(): string {\n return getenv('APP_ENV') ?\n getenv('APP_ENV') : 'default';\n}", "private static function loadEnvSettings()\n {\n require_once self::$envPath;\n return $env;\n }", "public function getEnvs();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment()\n {\n return $this->getConfigData('environment');\n }", "public function getEnvironment()\n {\n return $this->getConfig('environment');\n }", "public function getEnvironment()\n {\n return $this->config['environment'];\n }", "function getEnvironment() {\n return Environment::env();\n}", "public function getAppEnvironment()\n {\n return $this->appEnvironment;\n }", "public function environment()\n {\n return $this->env;\n }", "public function getSettings() {\n $scenario = \\Drupal::installProfile();\n if ($scenario === 'dfs_obio_acm') {\n $scenario = 'dfs_obio';\n }\n return \\Drupal::config('as_lift.settings.' . $scenario);\n }", "private function appSettings()\n {\n $getModuleUrl = function() {\n return strtok($this->module->getUrl(''), '?');\n };\n $removeExtraSlashes = function($url) {\n return preg_replace(\"/(?<!https:)(?<!http:)\\/{2,}/\", \"/\", $url);\n };\n $project_templates = [\n 'template for single study' => $this->module->getUrl('data/EPU_single.xml'),\n 'template for multiple studies' => $this->module->getUrl('data/EPU_multiple.xml'),\n ];\n $data = [\n 'module_version' => $this->module->VERSION,\n 'module_prefix' => $this->module->PREFIX,\n 'module_url' => $getModuleUrl(),\n 'redcap_root_url' => APP_PATH_WEBROOT_FULL,\n 'redcap_relative_url' => APP_PATH_WEBROOT,\n 'redcap_full_url' => $removeExtraSlashes(APP_PATH_WEBROOT_FULL.APP_PATH_WEBROOT),\n 'project_templates' => $project_templates,\n ];\n return $data;\n }", "function getEnvironment(){ return $_ENV['CURRENT_ENVIRONMENT']; }", "public static function environment() {\n return self::$environment;\n }", "public static function env()\n {\n return self::context()->env();\n }", "public function getEnv()\n {\n return self::$environment;\n }", "public function get_env()\n {\n return $this->env;\n }", "public function getSettings()\n {\n return Initiatives::getInstance()->getSettings();\n }", "public function getEnvironments();", "function env($key = null)\n{\n if (!isset($GLOBALS['configs']))\n $GLOBALS['configs'] = json_decode(file_get_contents($GLOBALS['config_path'] . DIRECTORY_SEPARATOR . 'env.json'));\n\n if (!is_null($key) && isset($GLOBALS['configs']->$key))\n return $GLOBALS['configs']->$key;\n elseif (is_null($key) && isset($GLOBALS['configs']))\n return $GLOBALS['configs'];\n else\n Throw new \\Atom\\Environment\\EnvironmentException(\"Environment variable \" . $key . \" not found.\");\n}", "public function getSettings()\n\t{\n try {\n $code = 200;\n\n $app_settings = $this->appSettings();\n $projects = $this->projectsData();\n $api_token_data = $this->apiTokenData();\n\n $response = compact('app_settings', 'projects', 'api_token_data');\n } catch (\\Exception $e) {\n $response = [\n 'message' => $e->getMessage(),\n ];\n $code = $e->getCode();\n }finally {\n $this->printJSON($response, $code);\n }\n }", "private function config()\n {\n return $this->app['config'];\n }", "private function config()\n {\n return $this->app['config'];\n }", "function getAppConfig() {\n $appConfig = array(\n 'images' => array(\n 'thumbnail' => array (\n 'default_sizes' => array (600, 300, 150),\n 'cdn_prefix' => \"https://s3-us-west-2.amazonaws.com/marathimultiplex/images/thumbnail/\"\n ),\n 'banner' => array (\n 'default_sizes' => array(1000, 500),\n 'cdn_prefix' => \"https://s3-us-west-2.amazonaws.com/marathimultiplex/images/banner/\"\n )\n )\n );\n \n return $appConfig;\n }", "static public function getConfig() {\n return Application::$config;\n }", "public static function environment(){\n return \\Illuminate\\Foundation\\Application::environment();\n }", "function env($name)\n{\n return Env::get($name);\n}", "public function getEnv() {\n\t\treturn APPLICATION_ENV;\n\t}", "public function getSettings();", "public static function getSettings()\n\t\t{\n\t\t\treturn self::$ettings;\n\t\t}", "public function getSettings() {\n $file = SETTINGS_PATH.'/'.$this->domain.'.json';\n $siteSettings = file_get_contents($file);\n return json_decode($siteSettings);\n }", "public static function getEnvironments()\n {\n $instanceSpecificKeys = [\n 'app_frontend_url',\n 'app_backend_url'\n ];\n\n $globalKeys = [\n 'app_config_path',\n 'server_config_path',\n 'isolation_config_path',\n 'handlers_config_path',\n 'configuration:Magento/Mtf/TestSuite/MtfTests',\n 'app_instances',\n 'events_preset',\n 'log_directory'\n ];\n\n $globalEnvironmentVariables = [];\n foreach ($globalKeys as $key) {\n if (isset($_ENV[$key])) {\n $globalEnvironmentVariables[$key] = $_ENV[$key];\n }\n }\n\n $environments = [];\n if (isset($_ENV['app_instances'])) {\n $instancesCount = $_ENV['app_instances'];\n\n for ($x = 0; $x < $instancesCount; $x++) {\n $environmentVariables = [];\n\n foreach ($instanceSpecificKeys as $key) {\n $instanceKey = $key . \"_\" . $x;\n if (isset($_ENV[$instanceKey])) {\n $environmentVariables[$key] = $_ENV[$instanceKey];\n }\n }\n\n $mergedEnvironmentVariables = array_merge(\n $globalEnvironmentVariables,\n $environmentVariables\n );\n $environments[] = new Environment($mergedEnvironmentVariables);\n }\n } else {\n $environmentVariables = [];\n\n foreach ($instanceSpecificKeys as $key) {\n if (isset($_ENV[$key])) {\n $environmentVariables[$key] = $_ENV[$key];\n }\n }\n\n $mergedEnvironmentVariables = array_merge(\n $globalEnvironmentVariables,\n $environmentVariables\n );\n $environments[] = new Environment($mergedEnvironmentVariables);\n }\n\n return $environments;\n }", "public function getEnvironment() {\n return $this->environment; \n }", "public function getSystemSettings()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('systemSettings');\n }", "private function getEnvironmentMode() {\n return $this->config->get('api.mode') === 'live' ? 'prod' : 'dev';\n }", "public function getEnv()\n {\n return $this->env;\n }", "public function getEnv()\n {\n return $this->env;\n }", "public function applicationSettings(): array\n {\n if ($this->getUser() !== NULL) {\n $this->getUser()->locale = request()->header('locale', 'en');\n $this->getUser()->save();\n }\n if ($this->getDriver() !== NULL) {\n $this->getDriver()->locale = request()->header('locale', 'en');\n $this->getDriver()->save();\n }\n\n return [\n 'status' => 1,\n 'settings' => [\n 'minimum_order_weight' => Setting::get('minimum_order_weight', 1.0),\n 'cash_out_threshold' => Setting::get('cash_out_threshold', 1.0),\n 'support_email' => Setting::get('support_email'),\n 'mobile_phone' => Setting::get('mobile_phone'),\n 'land_line' => Setting::get('land_line'),\n 'twitter_account' => Setting::get('twitter_account'),\n 'facebook_account' => Setting::get('facebook_account'),\n 'instagram_account' => Setting::get('instagram_account'),\n 'privacy_policy' => Storage::url(Setting::get('privacy_policy')),\n 'terms_conditions' => Storage::url(Setting::get('terms_conditions')),\n 'address' => Setting::get('address', ''),\n 'brief' => Setting::get('brief', ''),\n 'faq' => Setting::get('faq', ''),\n ],\n ];\n }", "protected function getEnvironmentSetUp($app)\n {\n config(['sendinblue.apikey' => 'test_apikey']);\n config(['sendinblue.partnerkey' => 'test_partnerkey']);\n }", "function getSettings()\n{\n $settings = appDir(\"settings.json\");\n $settingsArray = json_decode(file_get_contents($settings), true);\n return $settingsArray;\n}", "public static function getEnv()\n {\n //($s = yaml_parse_file(\"/var/www/app.env\")) || die(\"YAML file not found\");\n //var_dump($s);\n //$thing = file_get_contents(\"/var/www/app.env\");\n //$data = Spyc::YAMLLoad('../spyc-0.6.1/spyc.yaml');\n return yaml_parse_file(\"/var/www/app.env\");\n }", "public function getAppConfig()\n {\n return [\n 'authentication' => [\n 'default_redirect_to' => '/',\n ],\n 'view_helpers' => [\n 'aliases' => [\n 'isUser' => Helper\\IsUser::class,\n 'sanitizeHtml' => Helper\\SanitizeHtml::class,\n ],\n 'factories' => [\n Helper\\IsUser::class => Helper\\IsUserFactory::class,\n Helper\\SanitizeHtml::class => InvokableFactory::class,\n ],\n ],\n ];\n }", "public function getAppSettings() {\n $row = $this->getAdapter()->query(\"SELECT * FROM tmw_wire_app_settings;\")->fetch();\n if(!$row) {\n throw new Exception('Could not load application settings data from database');\n } else {\n return $row;\n }\t\n }", "protected function getEnvironments()\n {\n return array('dev', 'test', 'preprod');\n }", "protected function getSettings() {\n\t\treturn $this->configuration->getSettings();\n\t}", "public function getEnvironment($name);", "public function getEnvironment() { return $this->environment; }", "public function getEnv(): array\n {\n return $this->env;\n }", "public static function getEnvironment() : array\n {\n return self::$env;\n }", "public static function getAppConfig()\n {\n $curl = curl_init();\n\n curl_setopt_array($curl, self::getCurlOptions(\"config\"));\n\n return self::getApiResponse($curl);\n }", "protected static function getConfiguredApps() {}", "protected function getConfig()\n {\n\n return $this->app['config']['manticore'];\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment(): Environment;", "public function getEnvironment()\n {\n return self::$_environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public static function environment()\n {\n $clientId = getenv(\"CLIENT_ID\") ?: warehouse::get_paypal_client_id();\n $clientSecret = getenv(\"CLIENT_SECRET\") ?: warehouse::get_paypal_secret();\n\n if (rex_config::get('warehouse', 'sandboxmode')) {\n return new SandboxEnvironment($clientId, $clientSecret);\n } else {\n return new ProductionEnvironment($clientId, $clientSecret);\n }\n }", "public static function getToolSettings();", "private static function _getConfig()\n\t{\n\t\treturn \\Config::get('app.fqdn', '');\n\t}", "protected static function environment() {\n if (app()->environment('production')) {\n $clientId = config('app.paypal_live_client_id');\n $clientSecret = config('app.paypal_live_client_secret');\n return new ProductionEnvironment($clientId, $clientSecret);\n }\n $clientId = config('app.paypal_sandbox_client_id');\n $clientSecret = config('app.paypal_sandbox_client_secret');\n return new SandboxEnvironment($clientId, $clientSecret);\n }", "public static function getSettings()\n {\n return Settings::getSettings();\n }", "abstract public function getSettings();", "public function environment() : string\n {\n return $this->environment;\n }", "function getApp($setting) {\n\t\tif (!empty($setting) && !empty($this->_app[$setting]))\n\t\t\treturn $this->_app[$setting];\n\t\telse\n\t\t\treturn null;\n\t}", "public function getEnvironment()\n {\n return $this->_environment;\n }", "public function getApp();", "public function getSettings()\n {\n return self::$settings;\n }", "public static function get_site_setting()\n {\n return Setting::pluck('value','slug')->toArray();\n }", "public function getSettings(): array {\n\t\treturn [\n\t\t\t// Enable debug mode (to print errors).\n\t\t\t'debug' => !empty(elgg_get_config('debug')),\n\t\t\t'security' => [\n\t\t\t\t'requestedAuthnContext' => false,\n\t\t\t],\n\t\t\t// Service Provider Data that we are deploying.\n\t\t\t'sp' => $this->getSPSettings(),\n\t\t\t\n\t\t\t// Identity Provider Data that we want connected with our SP.\n\t\t\t'idp' => $this->getIDPSettings(),\n\t\t];\n\t}", "public static function environmentFile(){\n return \\Illuminate\\Foundation\\Application::environmentFile();\n }", "public function getEnv($name);", "public static function Zf_ApplicationDefaults(){\n \n self::$zf_applicationdefaults = array(\n \n 'application_seo' => APPLICATION_SEO,\n 'application_caching' => APPLICATION_CACHING,\n 'application_urlencrypt' => APPLICATION_URLENCRYPT,\n 'application_encryption' => APPLICATION_ENCRYPTION,\n 'application_decryption' => APPLICATION_DECRYPTION,\n 'security_key' => ENCRYPTION_DECRYPTIION_KEY\n \n );\n \n return self::$zf_applicationdefaults;\n }", "public function getEnvironmentVariables()\n {\n return $this->_envVars;\n }", "function settings()\n{\n return Yii::app()->settings;\n}", "public function get_settings() {\n return self::$settings;\n }", "protected function deriveEnvironment()\n {\n $confDir = $this->getAppConfigDir();\n\n if (file_exists($confDir . 'development.php')) {\n return 'development';\n } elseif (file_exists($confDir . 'testing.php')) {\n return 'testing';\n } elseif (file_exists($confDir . 'production.php')) {\n return 'production';\n } else {\n throw new \\RuntimeException(\n 'Environment Not Specified And Unable To Derive',\n 500\n );\n }\n }", "final public function getAppConfig()\n {\n return $this->appConfig;\n }", "protected function getEnvironmentMode() {}", "function get_environment_details() : array {\n\t$id = Altis\\get_environment_name();\n\t$type = Altis\\get_environment_type();\n\tif ( $type === 'local' ) {\n\t\t// Create distinct_id (important for Mixpanel).\n\t\t$id = get_local_install_id();\n\t}\n\n\t$traits = [\n\t\t'site_name' => get_site_option( 'site_name', get_option( 'blogname', '' ) ),\n\t\t'environment' => $type,\n\t\t'domain' => get_site_url(),\n\t\t'multisite' => is_multisite(),\n\t\t'feature_tier' => Altis\\get_feature_tier(),\n\t\t'environment_tier' => Altis\\get_environment_tier(),\n\t\t'support_tier' => Altis\\get_support_tier(),\n\t\t'version' => Altis\\get_version(),\n\t];\n\n\t/**\n\t * Filter environment traits delivered to segment.io.\n\t *\n\t * @param array $traits Environment traits to send to Segment.io.\n\t */\n\t$traits = (array) apply_filters( 'altis.telemetry.env_traits', $traits );\n\n\treturn [\n\t\t'id' => $id,\n\t\t'traits' => $traits,\n\t];\n}", "public function getEnvVars(): array {\n return $this->configVars['env-vars'];\n }", "public function getEnvironmentVariables()\n {\n return $this->environment_variables;\n }", "public function getAllEnvironmentVariables()\n {\n return include $_SERVER['DOCUMENT_ROOT'] . '/env.php';\n }", "public function getApp()\n {\n return $this['app.name'];\n }", "function getConfig($key)\n{\n return $GLOBALS['config'][$key];\n}", "public function getEnv():string\n {\n return $this->env;\n }", "public function getEnvironmentOptions(): array\n {\n return $this->environmentOptions;\n }", "protected static function getSettingData()\r\n\t{\r\n\t\t$return = [];\r\n\t\tif(file_exists(__DIR__ . '/settings.json'))\r\n\t\t{\r\n\t\t\t$return = static::expandData(file_get_contents(__DIR__ . '/settings.json'));\r\n\t\t\tif(defined(\"C_REST_CLIENT_ID\") && !empty(C_REST_CLIENT_ID))\r\n\t\t\t{\r\n\t\t\t\t$return['C_REST_CLIENT_ID'] = C_REST_CLIENT_ID;\r\n\t\t\t}\r\n\t\t\tif(defined(\"C_REST_CLIENT_SECRET\") && !empty(C_REST_CLIENT_SECRET))\r\n\t\t\t{\r\n\t\t\t\t$return['C_REST_CLIENT_SECRET'] = C_REST_CLIENT_SECRET;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $return;\r\n\t}", "protected function get_env_parameters()\n\t{\n\t\t$parameters = array();\n\t\tforeach ($_SERVER as $key => $value)\n\t\t{\n\t\t\tif (0 === strpos($key, 'PHPBB__'))\n\t\t\t{\n\t\t\t\t$parameters[strtolower(str_replace('__', '.', substr($key, 9)))] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $parameters;\n\t}", "public static function environment() {\n\t\treturn env('HORIZON_MODE');\n\t}" ]
[ "0.711632", "0.6672231", "0.66611826", "0.6617214", "0.6607591", "0.65916234", "0.65916234", "0.65916234", "0.65916234", "0.65916234", "0.65916234", "0.6549785", "0.6534558", "0.6505526", "0.65042967", "0.6485447", "0.6481649", "0.645241", "0.6448784", "0.63863117", "0.6379463", "0.63652253", "0.6353666", "0.63344383", "0.63098574", "0.6271402", "0.62334865", "0.61907995", "0.618469", "0.618469", "0.6181131", "0.61662954", "0.616217", "0.6150305", "0.6144239", "0.6139326", "0.61284274", "0.61268955", "0.61259425", "0.6108097", "0.610255", "0.60791457", "0.60740095", "0.60740095", "0.6037092", "0.6036461", "0.6033953", "0.6032497", "0.6017661", "0.600423", "0.60022414", "0.5993114", "0.5988667", "0.5985818", "0.59807146", "0.5974444", "0.5966939", "0.59502083", "0.59480524", "0.59179944", "0.59134734", "0.5902645", "0.58925503", "0.58925503", "0.58925503", "0.58925503", "0.58925503", "0.5888905", "0.5888401", "0.5886489", "0.58582824", "0.5836923", "0.58316135", "0.58238834", "0.5817527", "0.5812199", "0.5803736", "0.57851696", "0.5782354", "0.57692134", "0.5761297", "0.57603794", "0.57574147", "0.5754169", "0.5751259", "0.57429737", "0.57402515", "0.5728131", "0.57224613", "0.57203245", "0.5718613", "0.57142735", "0.57123345", "0.5711503", "0.57005304", "0.5698881", "0.56962484", "0.5691202", "0.56806844", "0.567776" ]
0.6127785
37
TODO: Implement failure() method.
public function failure(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function failed();", "public function fails();", "public function fails();", "public abstract function onFail();", "public function runFailed();", "protected function Run_Failure() {\n\t\tif (!empty($this->failure)) \n\t\t{\n\t\t\tcall_user_func_array($this->failure['function'], $this->failure['parameters']);\n\t\t}\n\t}", "public function failed()\n {\n // Do nothing\n }", "public function testFailure()\n {\n $this->_package->fail(\"Failed test\");\n $this->assertFalse($this->_result->wasSuccessful());\n }", "public static function FAILURE()\n {\n return self::getInstance(__METHOD__);\n }", "public function isFailure(): bool;", "abstract public function isSuccessful();", "public function testRetrieveUnsuccessfulReason()\n {\n }", "public function hasFailed();", "public function generateFailed();", "public function testCreateUnsuccessfulReason()\n {\n }", "public function succeeded();", "public function isSuccessful() {}", "public function _failed($I)\n {\n }", "function isSuccessful() ;", "public function isFailure() {\n\n return !$this->isSuccessful();\n }", "public function failed()\n {\n return false;\n }", "public function testRetrieveListUnsuccessfulReason()\n {\n }", "function check_fail($result) {\n\tif ($result['value']['failure reason']['value']) return 'failed:'.$result['value']['failure reason']['value']; else return 'ok';\n}", "public function markAsFailed();", "public function testFailure()\n {\n $this->assertTrue(false, 'A test case has failed as expected.');\n }", "public function isFailure(): bool\n {\n return $this->status === self::FAILURE;\n }", "public function isSuccessful();", "public function testCreateFail()\n {\n // fail\n (new ExperimentRecruitingTokenResponse())->create(-1, 'fail', -1);\n }", "public function test_if_failed_update()\n {\n }", "public function getFailureReason();", "public static function failed(): self\n {\n return self::getInstance('FAILED');\n }", "public function failed()\n {\n // Called when the job is failing...\n }", "public function showFailed();", "public function failed( $e ) {\n\t}", "public function testGetErrorMessagesAfterFailure()\n {\n $validator = new Integer();\n $validator->isValid(\"23\");\n $this->assertCount(1, $validator->errors());\n }", "public function handleFailure($response) {\n }", "public function testFailed(\\unittest\\TestFailure $failure) {\n $this->status= false;\n $this->stats['failed']++;\n $this->writeFailure($failure);\n }", "public function fail($e = null);", "public function errorOccured();", "public function runSuccess();", "public function fails(): bool\n {\n return !$this->succeeds();\n }", "abstract public function error();", "public function setFailure()\n\t{\n\t\t$this->assert_succeed=false;\n\t\treturn $this;\n\t}", "public function testToFail()\n {\n $this->assertTrue(false, 'He sido creada para fallar');\n }", "private function failure() : void\n {\n (new Repository())->disconnect();\n (new Session())->set('user','success', 'Une erreur est survenue nous vous prions de réessayer ultèrieurement');\n header('Location:' . self::REDIRECT_HOME);\n die();\n }", "private static function fail2()\n {\n throw new \\Exception('Thrown from fail2()');\n }", "public function testHasFailedReturnsFalse(): void\n {\n $this->assertFalse($this->class->has_failed());\n }", "public function testHasFailedReturnsFalse(): void\n {\n $this->assertFalse($this->class->has_failed());\n }", "public function success();", "public function fails()\n {\n return ! $this->passed;\n }", "public function testGetErrorMessagesAfterValidationFailure()\n {\n $this->validator->isValid(-211);\n $this->assertCount(1, $this->validator->errors());\n }", "function fail()\n{\n return constant(false);\n}", "public function testDeleteUnsuccessfulReason()\n {\n }", "public function testSuccess()\n {\n }", "public function testGetErrorMessagesAfterValidationFailure()\n {\n $validator = new Callback(function ($input) {\n return ($input == 1) ? true : false;\n });\n\n $this->assertFalse($validator->isValid(2));\n $this->assertCount(1, $validator->errors());\n }", "public function testIsFailure()\n\t{\n\t\t/* default value of a filter is false */\n\t\t$this->assertFalse($this->filter->isFailure());\n\t}", "protected function getLastError() {}", "public function testFailureHandling()\n {\n $connection = new Connection();\n\n $this->assertFalse($connection->isFailureExpected(), 'No failure code set yet');\n $this->assertFalse(\n $connection->isFailureExpected(Connection::FAIL_COND_SEARCH),\n 'None planned for the search scope either'\n );\n $this->assertFalse(\n $connection->isFailureExpected(Connection::FAIL_COND_PERSIST),\n 'None planned for the persistence scope either'\n );\n\n $connection->setFailure();\n $this->assertTrue($connection->isFailureExpected(), 'Default failure registered');\n $this->assertTrue(\n $connection->isFailureExpected(Connection::FAIL_COND_SEARCH),\n 'Defaults covers also search scope'\n );\n $this->assertTrue(\n $connection->isFailureExpected(Connection::FAIL_COND_PERSIST),\n 'Defaults covers also persistence scope'\n );\n\n $connection->setFailure(Connection::ERR_SIZE_LIMIT);\n $this->assertTrue(\n $connection->isFailureExpected(),\n 'Code is set but all scopes should still be covered'\n );\n $this->assertTrue(\n $connection->isFailureExpected(Connection::FAIL_COND_SEARCH),\n 'Overall scope covers also search scope'\n );\n $this->assertTrue(\n $connection->isFailureExpected(Connection::FAIL_COND_PERSIST),\n 'Overall scope covers also persistence scope'\n );\n\n $connection->setFailure(Connection::ERR_DEFAULT, Connection::FAIL_COND_SEARCH);\n $this->assertFalse(\n $connection->isFailureExpected(),\n 'Only the search scope will trigger the failure'\n );\n $this->assertTrue(\n $connection->isFailureExpected(Connection::FAIL_COND_SEARCH),\n 'Search scope is indeed covered'\n );\n $this->assertFalse(\n $connection->isFailureExpected(Connection::FAIL_COND_PERSIST),\n 'Persistence scope does not match the expected scope'\n );\n\n $connection->setFailure(Connection::ERR_DEFAULT, Connection::FAIL_COND_PERSIST);\n $this->assertFalse(\n $connection->isFailureExpected(),\n 'Only the persistence scope will trigger the failure'\n );\n $this->assertFalse(\n $connection->isFailureExpected(Connection::FAIL_COND_SEARCH),\n 'Search scope does not match the expected scope'\n );\n $this->assertTrue(\n $connection->isFailureExpected(Connection::FAIL_COND_PERSIST),\n 'Persistence scope is indeed covered'\n );\n }", "public function failedAssertions(/* ... */)\n {\n return $this->_assertionFail;\n }", "public function updateFailed();", "function try_failure($count, $s, $e=\"\") {\n print \"> \". $s .\"*** failure ***<br />> Message: \". $e .\"<br />\";\n return ++$count;\n }", "protected function failure()\n {\n $this->response = $this->response->withStatus(400);\n $this->jsonBody($this->payload->getInput());\n }", "public function testFailure()\n {\n $this->assertFileExists('/home/albert/PhpstormProjects/is601b');\n }", "public function isSuccess();", "public function isSuccess();", "public function isSuccess();", "public function isSuccess();", "function error(){}", "public function callbackFail()\n {\n $this->AddOutput(\"<p><i>Form was submitted and the Check() method returned false.</i></p>\");\n }", "public function testFailure()\n {\n $policy = Policy::load('ClamAV:ClamAVScan');\n $sandbox = new Sandbox($this->target, $policy);\n\n $sandbox->setParameter('scan_directory', './tests');\n\n $response = $sandbox->run();\n $failure_message = $response->getFailure();\n\n $this->assertContains('Warning: Infected files have been found', $failure_message);\n $this->assertFalse($response->isSuccessful());\n }", "abstract public function getLastError();", "abstract public function getLastError();", "function failed()\n\t{\n\t\treturn $this->isReady() && !$this->isSuccess();\n\t}", "public function has_failed()\n {\n return !$this->success;\n }", "public function error();", "public function failure(Closure $callback);", "public function callbackFail()\r\n {\r\n //$this->AddOutput(\"<p><i>Form was submitted and the Check() method returned false.</i></p>\");\r\n $this->redirectTo();\r\n }", "function chkFailed() {\n\t\treturn $this->failed;\n\t}", "public function failAction()\n {\n //====================================================================//\n // Return Dummy Response\n return new JsonResponse(array('result' => 'Ko'), 500);\n }", "public function verifyUploadFailureAction(){\n\t}", "public function testCase1()\n {\n $fa = $this->getFa();\n // Test error\n $ret = $fa->run('110', 'S0');\n $this->assertEquals($ret['status'], 'success');\n }", "function status() { return $this->err->status;}", "function &failedTest() {\n return $this->_failedTest;\n }", "public function testUpdateUnsuccessfulReason()\n {\n }", "public function SIG_Failure(/* ... */)\n {\n return $this->_sig_failure;\n }", "public function fails()\n {\n return !$this->passes();\n }", "public function callbackFail()\n {\n $this->AddOutput(\"<p><i>Form was submitted and the Check() method returned false.</i></p>\");\n $this->redirectTo();\n }", "public function isOk();", "protected function errorAction() {}", "public function isFailed()\r\n {\r\n return $this->status < 0;\r\n }", "public function isSuccess(): bool;", "public function isSuccess(): bool;", "public function isSuccess(): bool;", "public function callbackFail()\n {\n $this->di->get(\"response\")->redirect(\"user\")->send();\n }", "public function authenticationFailure()\n {\n return $this->sendFailed(\"not authenticated\");\n }", "public function failNow() {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('failNow', func_get_args()));\n }", "public function callbackFail()\n {\n if (isset($this->exception)) {\n if (strpos($this->exception, CFormAddUser::SQLSTATE) !== false && strpos($this->exception, CFormAddUser::ERROR_DUPLICATE_KEY) !== false) {\n $errorMessage = \"<p><i>Fel har uppstått i databasen. Akronym är redan upptaget, försök att välja ny akronym eller kontakta administratör!</i></p>\";\n } else {\n $errorMessage = \"<p><i>Fel har uppstått i databasen, försök igen eller kontakta administratör!</i></p>\";\n }\n } else {\n if (isset($this->errorMessage)) {\n $errorMessage = $this->errorMessage;\n } else {\n $errorMessage = \"<p><i>Fel har uppstått i databasen, kunde ej spara information i databasen. Försök igen eller kontakta administratör!</i></p>\";\n }\n }\n\n $this->AddOutput($errorMessage);\n $this->redirectTo();\n }", "public function isSuccessful()\n {\n return false;\n }", "public function isSuccessful()\n {\n return false;\n }", "public function isSuccessful()\n {\n return false;\n }" ]
[ "0.82567525", "0.79908586", "0.79908586", "0.7699416", "0.75073", "0.7506118", "0.7493932", "0.7479181", "0.74206114", "0.73987865", "0.72376084", "0.7158024", "0.7151769", "0.71056545", "0.7096287", "0.7014697", "0.6876539", "0.6820799", "0.6810175", "0.673082", "0.67245436", "0.6703908", "0.6702596", "0.66829294", "0.6670443", "0.6657951", "0.6646296", "0.6638209", "0.6631821", "0.6621372", "0.6606419", "0.65980595", "0.65319", "0.65192145", "0.65022653", "0.64640874", "0.6449004", "0.6446877", "0.64372224", "0.6424964", "0.6412008", "0.63732517", "0.6364039", "0.6342924", "0.6336424", "0.6331703", "0.63306373", "0.63306373", "0.63263", "0.6325736", "0.6324936", "0.6321326", "0.63152355", "0.6314169", "0.6310137", "0.6308788", "0.62972873", "0.6273392", "0.62729156", "0.62621903", "0.6261788", "0.6239636", "0.6232991", "0.6227833", "0.6227833", "0.6227833", "0.6227833", "0.62271214", "0.6224293", "0.6216728", "0.6206942", "0.6206942", "0.6198886", "0.61809057", "0.6169358", "0.6165441", "0.616305", "0.614211", "0.61413604", "0.61226445", "0.61130166", "0.6110092", "0.61069006", "0.6100119", "0.60991204", "0.60942596", "0.6090191", "0.6090178", "0.6077192", "0.6068085", "0.604162", "0.604162", "0.604162", "0.60302746", "0.602272", "0.60202557", "0.60174644", "0.60160613", "0.60160613", "0.60160613" ]
0.8122399
1
Create new Asset instance.
public function __construct($path, $filenameMethod = false) { $this->path = rtrim($path, '/'); $this->filenameMethod = $filenameMethod; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new Asset();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->Id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(Request $request) {\n $user = Auth::user();\n if (!$user->can('asset-create')) {\n return response()->json(['error' => 'Unauthorised'], $this->unauthorized);\n }\n\n $this->validate($request, [\n 'name' => 'required',\n 'ticker' => 'required',\n 'holding' => 'required',\n 'marketValue' => 'required',\n 'delta' => 'required',\n 'profit' => 'required',\n 'returnCurrency' => 'required',\n 'returnPercent' => 'required',\n 'typeId' => 'required',\n 'sectorId' => 'required',\n 'tradingBlockId' => 'required',\n 'countryId' => 'required'\n ]);\n\n $type = Type::find($request->get('typeId'));\n $sector = Sector::find($request->get('sectorId'));\n $tradingBlock = TradingBlock::find($request->get('tradingBlockId'));\n $country = Country::find($request->get('countryId'));\n\n $asset = new Asset();\n $asset->name = $request->get('name');\n $asset->ticker = $request->get('ticker');\n $asset->holding = $request->get('holding');\n $asset->market_value = $request->get('marketValue');\n $asset->delta = $request->get('delta');\n $asset->profit = $request->get('profit');\n $asset->return_currency = $request->get('returnCurrency');\n $asset->return_percent = $request->get('returnPercent');\n\n $asset->type()->associate($type);\n $asset->sector()->associate($sector);\n $asset->trading_block()->associate($tradingBlock);\n $asset->country()->associate($country);\n $asset->save();\n\n return response()->json(['success' => 'created', 'record' => $asset], $this->sucessStatus);\n }", "public function __construct(Asset $asset)\n {\n //\n $this->asset = $asset;\n }", "public function addAsset() {\n try {\n if (!($this->asset instanceof Base_Model_ObtorLib_App_Core_Asset_Entity_Asset)) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception(\" Asset Asset Entity not initialized\");\n } else {\n $objAsset = new Base_Model_ObtorLib_App_Core_Asset_Dao_Asset();\n $objAsset->asset = $this->asset;\n return $objAsset->addAsset();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception($ex);\n }\n }", "public function createAsset($path)\n\t{\n\t\treturn new Asset($path, $this->app);\n\t}", "public function create()\n {\n $form = $this->presenter->form($this->asset);\n\n return view('assets.create', compact('form'));\n }", "function createAsset( $asset=null, $block_index=null ){\n global $mysqli, $counterparty;\n // Get current information on this asset\n $info = $counterparty->execute('get_asset_info', array('assets' => array($asset)));\n // Create data object using asset info (if any)\n $data = (count($info)) ? (object) $info[0] : (object) [];\n $description = substr($data->description,0,250); // Truncate to 250 chars\n $data->asset_id = getAssetId($asset);\n $data->issuer_id = createAddress($data->issuer);\n $data->owner_id = createAddress($data->owner);\n $data->divisible = ($data->divisible) ? 1 : 0; // convert to boolean\n $data->locked = ($data->locked) ? 1 : 0 ; // convert to boolean\n $data->supply = intval($data->supply);\n $data->description = $mysqli->real_escape_string($description);\n $data->asset_longname = $mysqli->real_escape_string($data->asset_longname);\n // Set asset type (1=Named, 2=Numeric, 3=Subasset, 4=Failed issuance)\n $data->type = (substr($asset,0,1)=='A') ? 2 : 1;\n if($data->asset_longname!='')\n $data->type = 3;\n if(count($info)==0)\n $data->type = 4;\n // Force numeric values for special assets\n if(in_array($data->asset, array('XCP','BTC'))){\n $data->issuer_id = 0;\n $data->owner_id = 0;\n }\n // Check if this asset already exists\n $results = $mysqli->query(\"SELECT id FROM assets WHERE asset='{$asset}' LIMIT 1\");\n if($results){\n if($results->num_rows){\n // Update asset information\n $row = $results->fetch_assoc();\n $id = $row['id'];\n $sql = \"UPDATE assets SET\n asset_id = '{$data->asset_id}',\n asset_longname = '{$data->asset_longname}',\n divisible = '{$data->divisible}',\n description = '{$data->description}',\n issuer_id = '{$data->issuer_id}',\n owner_id = '{$data->owner_id}',\n locked = '{$data->locked}',\n type = '{$data->type}',\n supply = '{$data->supply}'\n WHERE\n id='{$id}'\";\n $results = $mysqli->query($sql);\n if($results){\n return $id;\n } else {\n byeLog('Error while trying to update asset record for ' . $asset . ' : ' . $sql);\n }\n } else {\n // Create asset information\n $sql = \"INSERT INTO assets (asset_id, asset, asset_longname, block_index, type, divisible, description, issuer_id, locked, owner_id, supply) values (\n '{$data->asset_id}',\n '{$asset}',\n '{$data->asset_longname}',\n '{$block_index}',\n '{$data->type}',\n '{$data->divisible}',\n '{$data->description}',\n '{$data->issuer_id}',\n '{$data->locked}',\n '{$data->owner_id}',\n '{$data->supply}')\";\n $results = $mysqli->query($sql);\n if($results){\n return $mysqli->insert_id;\n } else {\n byeLog('Error while trying to create asset record for ' . $asset);\n }\n }\n } else {\n byeLog('Error while trying to lookup asset record');\n }\n}", "public function store(AssetRequest $request)\n {\n $asset = $this->asset->newInstance();\n\n $asset->user_id = $this->guard->id();\n $asset->tag = $request->input('tag');\n $asset->category_id = $request->input('category');\n $asset->location_id = $request->input('location');\n $asset->name = $request->input('name');\n $asset->condition = $request->input('condition');\n $asset->vendor = $request->input('vendor');\n $asset->make = $request->input('make');\n $asset->model = $request->input('model');\n $asset->size = $request->input('size');\n $asset->weight = $request->input('weight');\n $asset->serial = $request->input('serial');\n $asset->acquired_at = $request->formatDateWithTime($request->input('acquired_at'));\n $asset->end_of_life = $request->formatDateWithTime($request->input('end_of_life'));\n\n return $asset->save();\n }", "public function persist()\n {\n $asset = Asset::create($this->only([\n 'school_id', 'category_id', 'type_id', 'name', 'tag', 'serial_number',\n 'make', 'model', 'processor', 'memory', 'storage', 'operating_system',\n 'warranty', 'notes'\n ]));\n\n if ($asset->wasRecentlyCreated) {\n Finance::create([\n 'asset_id' => $asset->id,\n 'accounting_start' => $this->accounting_start,\n 'accounting_end' => $this->accounting_end,\n 'purchase_date' => $this->purchase_date,\n 'end_of_life' => $this->end_of_life,\n 'purchase_cost' => $this->purchase_cost,\n 'current_value' => $this->current_value,\n 'depreciation' => $this->depreciation,\n 'net_book_value' => $this->net_book_value,\n ]);\n }\n\n return $asset;\n }", "public function create()\n {\n return view('admin.asset.create');\n }", "public function create()\n {\n return view(\"type-assets.create\");\n }", "public function create()\n {\n $page = (object) [\n 'title' => 'Asset New'\n ];\n return view('admin.asset.create', compact('page'));\n }", "public function __construct(\\App\\Asset $asset)\n {\n $this->asset = $asset;\n }", "public function create()\n {\n //\n return view('assets.create');\n }", "public function setType(string $type): AssetInterface\n {\n }", "public function create()\n {\n $formTitle = 'Create asset';\n return View('assets.form', compact('formTitle'));\n }", "public function store(AssetRequest $request)\n {\n $asset = new Asset($request->all());\n $asset->save()->saveImage();\n \n flash()->success('Success!', 'Asset has been created!');\n return redirect('assets');\n }", "public function create()\n {\n $cat = Category::with('subcats.subcats')->where('toplevel', '=', true)->get(['id', 'name']);\n $dept = Department::get(['id', 'name']);\n return view('admin.assets.assetCreate',\n [\n 'cat' => $cat,\n 'dept' => $dept\n ]\n );\n }", "public function testConstructAssets()\n {\n $assets = new Assets($this->locator, $this->locatorScheme, $this->baseUrl);\n $this->assertInstanceOf(Assets::class, $assets);\n\n return $assets;\n }", "public function setAttributes(array $attributes): AssetInterface\n {\n }", "public function create(){}", "public function create() {}", "public static function getAsset() {\n if (Asset::$asset == null) {\n Asset::$asset = new Asset();\n }\n return Asset::$asset;\n }", "public function __construct(Factory $asset)\n {\n $this->asset = $asset;\n }", "public function createAsset($fileId, array $params = [])\n {\n $params = array_merge(['_secure' => $this->request->isSecure()], $params);\n return $this->assetRepo->createAsset($fileId, $params);\n }", "protected function createResource()\n {\n $resourceOptions = [\n 'resource' => $this->info['resource'],\n '--module' => $this->moduleName,\n ];\n\n $options = $this->setOptions([\n 'parent',\n 'assets'=>'uploads',\n 'data'\n ]);\n\n $this->call('engez:resource', array_merge($resourceOptions, $options));\n }", "public function __construct(Assets $assets)\n {\n $this->assets = $assets;\n }", "public function createAsset($fileId, array $params = [])\n {\n $this->updateDesignParams($params);\n list($module, $filePath) = self::extractModule($fileId);\n if (!$module && $params['module']) {\n $module = $params['module'];\n }\n\n if (!isset($params['publish'])) {\n $map = $this->getRepositoryFilesMap($fileId, $params);\n if ($map) {\n $params = array_replace($params, $map);\n }\n }\n\n $isSecure = isset($params['_secure']) ? (bool) $params['_secure'] : null;\n $themePath = isset($params['theme']) ? $params['theme'] : $this->design->getThemePath($params['themeModel']);\n $context = $this->getFallbackContext(\n UrlInterface::URL_TYPE_STATIC,\n $isSecure,\n $params['area'],\n $themePath,\n $params['locale']\n );\n return $this->fileFactory->create(\n [\n 'source' => $this->assetSource,\n 'context' => $context,\n 'filePath' => $filePath,\n 'module' => $module,\n 'contentType' => $this->assetSource->getContentType($filePath)\n ]\n );\n }", "public function create()\n {}", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function assets(): Assets\n {\n return new Assets($this);\n }", "public function __construct($asset_id)\n {\n $this->asset_id = $asset_id;\n }", "public function create() {\n \n }", "public function create() {\n \n }", "public function create() {\r\n }", "public function create() {\n }", "public function create() {\n }", "public function add($name)\n\t{\n\t\tif ( ! isset($this->assets[$name]))\n\t\t{\n\t\t\t$this->assets[$name] = new Asset($this->type, $name, $this, $this->app);\n\t\t}\n\t}", "public function create()\n {\n if($this->permissionDetails('Exchange_asset_pair','add')) {\n $exchanges = Exchange::select('identity_exchange.identity_code as exchange_code','identity_exchange.identity_name as exchange_name','identity_exchange.identity_website as exchange_website','exchange.*')\n ->join('identity_exchange','identity_exchange.identity_id','=','exchange.identity_id')\n ->get();\n $assets = Asset::\n select('asset.asset_id','identity_asset.identity_name','identity_asset.identity_code') \n ->distinct()\n ->leftjoin('identity_asset','asset.identity_id','identity_asset.identity_id')\n ->where('identity_asset.identity_id','!=',0)\n ->get();\n return view('exchange_asset_pair.create',compact('exchanges','assets'));\n } else {\n return Redirect::back()->with('message', 'You are not authorized to use this functionality!');\n }\n }", "public function create() {\n\n\t\t\n\t}", "public function asset($name) {\n if (!$this->app->supportMethod('node', 'get')) {\n $params = array(\n '@method' => t('get'),\n '@asset' => t('node'),\n );\n throw new Exception(t(\"The app don't support the @method for @asset\", $params));\n }\n\n $this->asset = $name;\n $this->query = new EntityFieldQuery();\n $this->query->entityCondition('entity_type', $this->asset);\n return $this;\n }", "public function create() {\n\t \n }", "public function setBaseAsset( Asset $a=NULL ) : Asset\n {\n if( isset( $a ) )\n {\n $type = $a->getType();\n \n if( u\\StringUtility::startsWith( strtolower( $type ), 'block' ) )\n {\n $type = 'block';\n }\n else if( u\\StringUtility::startsWith( strtolower( $type ), 'format' ) )\n {\n $type = 'format';\n }\n \n $this->getProperty()->assetType = $type;\n $this->getProperty()->baseAssetId = $a->getId();\n $this->getProperty()->baseAssetPath = $a->getPath();\n }\n else\n {\n $this->getProperty()->assetType = File::TYPE; // dummpy type\n $this->getProperty()->baseAssetId = NULL;\n $this->getProperty()->baseAssetPath = NULL;\n }\n return $this;\n }", "public function testStoreAsset()\n {\n // 1. Create mock\n $admin = $this->admin;\n\n $data = [\n 'name' => 'Jabar Command Center',\n 'status' => 'active',\n 'description' => 'JDS Team',\n 'capacity' => 100,\n 'resource_type' => 'online'\n ];\n\n // 2. Hit Api Endpoint\n $response = $this->actingAs($admin)->post(route('asset.store'), $data);\n\n // 3. Verify and Assertion\n $response->assertStatus(Response::HTTP_CREATED);\n }", "public function test_actionAssetCreate($file_path = \"\", array $post = [])\n {\n $_FILES = [\n 'file' => [\n 'tmp_name' => $file_path,\n 'name' => 'Hello'\n ]\n ];\n\n $_POST = $post;\n\n $_SERVER['REDIRECT_URL'] = '/create/';\n ob_start();\n $controller = new $this->controller_name(rand(0,1000));\n Reflection::setProperty('allowGenerateHeader', $this->controller_name, $controller, false);\n Reflection::callMethod('actionIndex', $this->controller_name, [], $controller);\n $response = ob_get_contents();\n ob_end_clean();\n \n $json_response = str_replace(\"HTTP/1.1 200 OK\\n\", \"\", $response);\n $json_response = str_replace(\"Content-type: application/json\\n\", \"\", $json_response);\n $asset_json = json_decode($json_response);\n\n $this->assertTrue(Asset::model()->fileName($asset_json->public_url)->exists());\n \n if (Asset::model()->fileName($asset_json->public_url)->exists()) {\n $this->assertCreationEquals(Asset::model()->fileName($asset_json->public_url)->find());\n }\n }", "public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['id' => 'asset_id']);\n }", "public function create() {\n\t\t\t//\n\t\t}", "public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['asset_id' => 'asset_id']);\n }", "public function store(StoreOrUpdateAsset $request)\n {\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n $asset = new Asset([\n 'model' => 'Asset',\n 'name' => $file->getClientOriginalName(),\n 'size' => $file->getSize(),\n 'type' => $file->getMimeType(),\n 'path' => $path\n ]);\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 create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create_new_assign_assets() {\n if (get_user_permission('assign_assets') === false) {\n redirect(base_url('user_login'));\n }\n\n $this->data['title'] = \"Assign Assets\";\n $this->data['assets_info_list'] = $this->Assets_info_Model->get_assets_info();\n $this->data['employee_list'] = $this->Employee_Model->get_employee();\n $this->load->view('header');\n $this->load->view('navigation');\n $this->load->view('assign_assets/assign_assets', $this->data);\n }", "public function create() {\n //\n }", "public function create() {\n\n\t}", "function assets()\n {\n return new Assets($this->accessToken, $this->spaceId, $this->cacher);\n }", "public function create()\n {\n }", "public function create()\n {\n }", "public function create()\r\n {\r\n }", "public function create()\r\n {\r\n }", "public function create()\n {\n $asset_types = TypesAssets::all();\n $departments = Department::all();\n return view('fixed-assets.create', compact('departments', 'asset_types'));\n }", "public function create()\n\t {\n\t //\n\t }", "public function create()\n {\n //TODO\n }", "public function create()\n {\n \n \n $member = Member::orderBy('name','ASC')->where('status','=',1)->get();\n \n $asset = Asset::orderBy('id','desc')->take(15)->get(); \n return view('admin.insert_asset',['member'=>$member,'asset'=>$asset]);\n }", "public function create() {\r\n //\r\n }", "public function create()\r\n\t{\r\n\t\t//\r\n\t}", "public function make($handle, $path, array $dependencies = [])\n {\n /** @var Asset $asset */\n $asset = new $this->assetClass($handle, $this->getPath($path), $dependencies);\n $filters = $this->getGlobalFilters($asset->getExt());\n foreach ($filters as $filter) {\n $asset->ensureFilter($filter);\n }\n return $asset;\n }", "public function create()\n {\n }", "public function create()\n {\n }", "public function create()\n {\n }", "public function create()\n {\n }", "public function create()\n {\n }", "public function create()\n {\n }", "public function create()\n {\n }", "public function create()\n {\n }", "public function create()\n {\n }", "public function create()\n {\n }", "public function create()\n {\n }", "public function create()\n {\n }" ]
[ "0.6916663", "0.6644593", "0.6609761", "0.63866293", "0.6376958", "0.6298653", "0.62254936", "0.61809313", "0.61711395", "0.6167919", "0.6084457", "0.6031257", "0.60116965", "0.59484726", "0.5871187", "0.586444", "0.5835751", "0.57912195", "0.57832634", "0.5738563", "0.5701278", "0.56948584", "0.56771034", "0.5649384", "0.56309736", "0.5610819", "0.56097656", "0.55804956", "0.55416834", "0.55404043", "0.55404043", "0.55404043", "0.55404043", "0.55404043", "0.55404043", "0.55404043", "0.55404043", "0.55404043", "0.55404043", "0.55404043", "0.55086005", "0.55086005", "0.55086005", "0.54535615", "0.5452362", "0.54383403", "0.54383403", "0.54330665", "0.54178953", "0.54178953", "0.5413513", "0.5402961", "0.54026574", "0.53692836", "0.5366566", "0.5358734", "0.5352254", "0.53434634", "0.53374475", "0.532673", "0.53241265", "0.53213817", "0.53204584", "0.53204584", "0.53204584", "0.53204584", "0.53204584", "0.53204584", "0.53204584", "0.53204584", "0.53204584", "0.53204584", "0.53204584", "0.53204584", "0.5315991", "0.5296175", "0.5294439", "0.52938104", "0.5282897", "0.5282897", "0.52744246", "0.52744246", "0.5271391", "0.5270252", "0.5263213", "0.52481395", "0.52455395", "0.5238919", "0.5238271", "0.5236873", "0.5236873", "0.5236873", "0.5236873", "0.5236873", "0.5236873", "0.5236873", "0.5236873", "0.5236873", "0.5236873", "0.5236873", "0.5236873" ]
0.0
-1
Create "cache busted" asset URL.
public function cachedAssetUrl($url) { $filePath = $this->path . '/' . ltrim($url, '/'); if (!file_exists($filePath)) { throw new LogicException( 'Unable to locate the asset "' . $url . '" in the "' . $this->path . '" directory.' ); } $lastUpdated = filemtime($filePath); $pathInfo = pathinfo($url); if ($pathInfo['dirname'] === '.') { $directory = ''; } elseif ($pathInfo['dirname'] === DIRECTORY_SEPARATOR) { $directory = '/'; } else { $directory = $pathInfo['dirname'] . '/'; } if ($this->filenameMethod) { return $directory . $pathInfo['filename'] . '.' . $lastUpdated . '.' . $pathInfo['extension']; } return $directory . $pathInfo['filename'] . '.' . $pathInfo['extension'] . '?v=' . $lastUpdated; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function asset_url($uri = '', $protocol = NULL ,$ctype = '')\n{\n $ci =& get_instance();\n $cache_busting_token = (! Config::DEBUG_MODE )? '?' . $ci->config->item('cache_busting_token') : '';\n if($ctype != ''){\n if($ctype == 'css'){\n $cache_busting_token .= ! Config::DEBUG_MODE ? $ci->config->item('css_suffix') : '';\n }else if($ctype == 'js'){\n $cache_busting_token .= ! Config::DEBUG_MODE ? $ci->config->item('js_suffix') : '';\n }else{\n show_error('parameter ctype is wrong.');\n }\n }else{\n $cache_busting_token .= getSuffix($uri);\n }\n return base_url($uri . $cache_busting_token, $protocol);\n}", "function asset_url($uri = '', $protocol = NULL)\n{\n $debug = config('debug');\n\n $cache_busting_token = ! $debug ? '?' . config('cache_busting_token') : '';\n\n if (strpos(basename($uri), '.js') !== FALSE && strpos(basename($uri), '.min.js') === FALSE && ! $debug)\n {\n $uri = str_replace('.js', '.min.js', $uri);\n }\n\n if (strpos(basename($uri), '.css') !== FALSE && strpos(basename($uri), '.min.css') === FALSE && ! $debug)\n {\n $uri = str_replace('.css', '.min.css', $uri);\n }\n\n return base_url($uri . $cache_busting_token, $protocol);\n}", "function asset($url = '')\n{\n return ASSET . $url;\n}", "function asset_url() {\n return url(\"/\");\n }", "function AssetCachebuster($path, $length = 0)\n {\n # Prepend a slash while the given path is not begin with it to ensure\n # that the path is located from the root of the project\n if (!preg_match('/^\\//', $path))\n {\n $path = '/' . $path;\n }\n\n if ($length > 0)\n {\n return $path . '?' . StrBase62($length);\n }\n else\n {\n return $path;\n }\n }", "public function getCacheBustingUrl($type, $path){\n \t\t$parts = explode('.', $path);\n \t\t$url = $parts[0];\n \t\t$basePath = \"https:\";\n \t\tif ($type == 'css'){\n \t\t\t$basePath .= $this->getCssUrl();\n \t\t} else if ($type == 'js'){\n \t\t\t$basePath .= $this->getJsUrl();\t\t\n \t\t}\n\t\t$hashableFile = $basePath . $path;\n \t\tif (file_exists($hashableFile)){\n \t\t\t$url .= '-';\n \t\t\t// \t\t$url .= hash_file('md5', . . $parts[0]);\n \t\t\t$url .= '.' . $parts[1];\n \t\t\treturn $url;\n \t\t} else {\n \t\t\treturn $hashableFile;\n \t\t}\n \t}", "public function url()\n\t{\n\t\t$this->buildImage();\n\t\treturn $this->buildCachedFileNameUrl;\n\t}", "function asset($name) {\n $url;\n\n if (config('mode') === 'development') {\n $url = config('asset_url') . $name;\n } else {\n $url = config('app_url') . $name;\n }\n\n return $url;\n}", "function asset($path = '')\n {\n \treturn (!empty($path)) ? BASE_URL . $path : BASE_URL ; \n }", "public static function internalCacheUrlencode($url)\n {\n \t// update all external image URL to internal for better CDN caching\n \t// replace \"/\" to \"@@@\", because laravel path matching will be failed\n \t$url = urlencode(str_replace(\"/\", \"@@@\", $url));\n \t$url = \"http://\".env(\"DOMAINNAME\").\"/imgcache/\".$url;\n \treturn $url;\n }", "function asset_url($url)\n\t{\n\t\tif (substr($url, 0, 4) !== 'http' && substr($url, 0, 2) !== '//')\n\t\t{\n\t\t\t$ci =& get_instance();\n\t\t\t$ci->config->load('cms', TRUE);\n\t\t\t$url .= '?v='.$ci->config->item('asset_version');\n\n\t\t\t// add assets/ if not present already\n\t\t\t$exploded_url = explode('/', ltrim($url, '/'));\n\t\t\tif ($exploded_url[0] !== 'assets')\n\t\t\t{\n\t\t\t\t$url = 'assets/' . ltrim($url, '/');\n\t\t\t}\n\t\t}\n\n\t\treturn base_url($url);\n\t}", "public function to_asset($url = '')\n\t{\n\t\treturn $this->relative_url.'/'.$this->name.'/'.$url;\n\t}", "function cachefile($url = false) {\n\t\tif(!$url) {\n\t\t\t$url = uniqid();\n\t\t}\n\t\t\n\t\t$request_hash = sha1($url);\n\t\t\n\t\t$tmp_path = sys_get_temp_dir();\n\t\t\n\t\t$cache_name = 'wmjapi-' . $this->token_hash . '-' \n\t\t\t. sha1($url) . '.json';\n\t\t\n\t\tif(substr($tmp_path, -1) !== '/') {\n\t\t\t$tmp_path = $tmp_path . '/';\n\t\t}\n\t\t\n\t\t$cache_file = $tmp_path . $cache_name;\n\t\t\n\t\treturn $cache_file;\n\t}", "public function functional_asset_url() {\n\n\t\t$log_url = WP_CONTENT_URL . '/uploads/nginx-helper/';\n\n\t\treturn apply_filters( 'nginx_asset_url', $log_url );\n\n\t}", "protected function getAssetsUrl()\n {\n if (!isset($this->_assetsUrl)) {\n //$assetPath = Yii::getPathOfAlias($this->assetPathAlias);\n //if (!$assetPath) {\n // throw new CException(\"Asset path alias $this->assetPathAlias could not be resolved\");\n //}\n $assetPath = $this->assetPath;\n $this->_assetsUrl = Yii::app()->assetManager->publish($assetPath, false, -1, $this->forceCopyAssets);\n }\n return $this->_assetsUrl;\n }", "public function assetURL($asset) {\n\t\treturn self::$config['APP_DIR'] . self::$config['ASSETS_DIR'] . $asset;\n\t}", "function _asset_url(string $path = '') {\n\t\treturn asset(config('asset.directory')) . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n\t}", "function asset_path($filename, $dir)\n{\n\n $site = base_url();\n $mode = \"\";\n\n /*\n * cache invalidation removed for js css libraries\n */\n\n if (is_null($dir)) {\n $final_url = $mode . $filename;\n return $final_url;\n }\n\n if (ENVIRONMENT == 'development') {\n $mode = 'dist/' . $dir . '/';\n return $mode . $filename;\n } else if (ENVIRONMENT == 'production') {\n $mode = 'public/' . $dir . '/';\n }\n\n $final_url = $mode . $filename . '?v='.getUIVersion();\n\n return $final_url;\n\n}", "public static function asset_url( $url = '' ) {\r\n\t\treturn BEEHIVE_URL . 'app/assets/' . $url;\r\n\t}", "public function getCachedUrl($image, array $params = ['w' => 300])\n {\n if (str_contains($this->getUploadTo(), 'public'))\n {\n $pieces = explode('public', $this->getUploadTo());\n $base = $pieces[1];\n\n $params = http_build_query($params);\n return asset(config('bumble.admin_prefix').'/cache'.$base.$image.'?'.$params);\n }\n }", "protected function _create_cached()\n {\n if($this->url_params['c'])\n {\n // Resize to highest width or height with overflow on the larger side\n $this->image->resize($this->url_params['w'], $this->url_params['h'], Image::INVERSE);\n\n // Crop any overflow from the larger side\n $this->image->crop($this->url_params['w'], $this->url_params['h']);\n }\n else\n {\n // Just Resize\n $this->image->resize($this->url_params['w'], $this->url_params['h']);\n }\n\n // Apply any valid watermark params\n $watermarks = Arr::get($this->config, 'watermarks');\n if ( ! empty($watermarks))\n {\n foreach ($watermarks as $key => $watermark)\n {\n if (key_exists($key, $this->url_params))\n {\n $image = Image::factory($watermark['image']);\n $this->image->watermark($image, $watermark['offset_x'], $watermark['offset_y'], $watermark['opacity']);\n }\n }\n }\n\n // Save\n if($this->url_params['q'])\n {\n //Save image with quality param\n $this->image->save($this->cached_file, $this->url_params['q']);\n }\n else\n {\n //Save image with default quality\n $this->image->save($this->cached_file, Arr::get($this->config, 'quality', 80));\n }\n }", "private function generateCacheName(): string\n\t{\n\t\t$get = implode('-', $_GET);\n\t\t$name = $this->_resizeMode . $this->_imagePath . $this->_oldWidth . $this->_oldHeight . $this->_newWidth . $this->_newHeight . $get;\n\t\treturn md5($name) . '.' . $this->_extension;\n\t}", "function asset_url($uri = null)\n{\n $CI =& get_instance();\n\n $cdn = $CI->config->item('asset_url');\n if (!empty($cdn))\n return $cdn . $uri;\n\n return $CI->config->base_url($uri);\n}", "function asset($asset)\n{\n return ASSET_PREFIX . '/'. $asset;\n}", "public function getAssetUrl($raw = false)\n {\n if ($this->assetUrl === null) {\n $this->assetUrl = Yii::$app->assetManager->publish(\n $this->getBasePath() . '/' . $this->distDir\n );\n }\n return $raw ? $this->assetUrl : $this->assetUrl[1];\n }", "protected function assetUrl() {\n if (isset($this->config['assetUrl']))\n {\n return $this->config['assetUrl'];\n }\n\n return '/assets';\n }", "public function getAssetsUrl()\n\t{\n\t\tif ($this->_assetsUrl === null) {\n\t\t\t$assetsPath = $this->getBasePath() . DIRECTORY_SEPARATOR . 'assets';\n\t\t\t$this->_assetsUrl = app()->getAssetManager()->publish($assetsPath);\n\t\t\tif ($this->debug===true) {\n\t\t\t\t$this->_assetsUrl = app()->getAssetManager()->publish($assetsPath, false, -1, true);\n\t\t\t} else {\n\t\t\t\t$this->_assetsUrl = app()->getAssetManager()->publish($assetsPath);\n\t\t\t}\n\t\t}\n\t\treturn $this->_assetsUrl;\n\t}", "protected\n function setPublicUrl()\n {\n $publicUrl = url() . config('album.paths.cache');\n\n return $publicUrl;\n }", "public function getAssetUrlBaseRemap();", "function asset($asset)\n{\n $scheme = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? $_SERVER['HTTPS'] : 'http://';\n\n return startsWith($asset, '/') ?\n $scheme . $_SERVER['HTTP_HOST'] . $asset:\n $scheme . $_SERVER['HTTP_HOST'] . '/' . $asset;\n}", "public function getAssetsUrl()\n\t{\n\t\treturn Yii::app()->getAssetManager()->publish($this->getAssetsPath());\n\t}", "protected function getAssetsUrl()\n {\n if (isset($this->_assetsUrl))\n return $this->_assetsUrl;\n else\n {\n $assetsPath = Yii::getPathOfAlias('labScript');\n $assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, YII_DEBUG);\n return $this->_assetsUrl = $assetsUrl;\n }\n }", "function cdn_asset(string $path)\n {\n return \\App\\Utils::cdnAsset($path);\n }", "public function assetUrl($url = '')\n\t{\n\t\treturn $this['url.asset'].ltrim($url, '/');\n\t}", "function asset($file, $return = false)\n{\n $url = '//' . $_SERVER['HTTP_HOST'] . '/'. $file;\n if ($return === false) {\n echo $url;\n }\n\n return $url;\n}", "function asset($name = null)\n {\n $document = explode('/', rtrim(app('http.request')->uri, \"/\"));\n $document = end($document);\n\n $defaultPath = $document === 'public' ? 'assets/' : 'public/assets/';\n\n $packpage = new \\Anonym\\Assets\\VersionPackpage('', '%f', $defaultPath);\n return $name !== null ? $packpage->getUrl($name) : $defaultPath;\n }", "function asset_url( ?string $path = null ): string\n {\n return Asset::url( '/', $path );\n }", "public function testUrlWithBaseUrlAndTimestamp() {\n\t\tConfigure::write('debug', 0);\n\t\t$config = $this->Helper->config();\n\t\t$config->set('js.baseUrl', 'http://cdn.example.com/js/');\n\t\t$config->set('js.timestamp', true);\n\t\t$config->general('cacheConfig', true);\n\n\t\t// populate the cache.\n\t\tCache::write(AssetConfig::CACHE_BUILD_TIME_KEY, array('libs.js' => 1234), AssetConfig::CACHE_CONFIG);\n\n\t\t$result = $this->Helper->url('libs.js');\n\t\t$expected = 'http://cdn.example.com/js/libs.v1234.js';\n\t\t$this->assertEquals($expected, $result);\n\t}", "public function assets_url() {\n\t\t\treturn get_template_directory_uri() . '/assets/';\n\t\t}", "function getCacheFileUrl($eventData)\n {\n global $serendipity;\n\n $cache_filename = $this->getCacheFileName($eventData);\n if (!isset($cache_filename)) {\n return null;\n }\n return $serendipity['baseURL'] . '/' . PATH_SMARTY_COMPILE . '/serendipity_event_gravatar/' . $cache_filename;\n }", "public function makeCacheHash() {}", "public function cacheSetup()\n\t{\n\t\t// Generate the name\n\t\t$time = $this->modified;\n\t\t$extension = $this->type;\n\t\t$fileName = pathinfo($this->name, PATHINFO_FILENAME) . \".\" . md5($this->name . '.' . $time);\n\t\t$name = $fileName . \".\" . $extension;\n\n\t\t// Generate the cache file path\n\t\t$this->cacheFilePath = realpath(public_path() . '/' . $this->app['assets::config']['cache_path']) . '/' . $name;\n\n\t\t// Generate the cache file URL\n\t\t$this->cacheFileUrl = $this->app['assets::config']['cache_url'] . $name;\n\n\t\treturn $this->cacheFile = $name;\n\t}", "function secure_asset($asset)\n{\n $scheme = 'https://';\n\n return startsWith($asset, '/') ?\n $scheme . $_SERVER['HTTP_HOST'] . $asset:\n $scheme . $_SERVER['HTTP_HOST'] . '/' . $asset;\n}", "function bustCache($public_file_path) {\n $public_file_path = '/' . ltrim($public_file_path, '/');\n $php_public_path = public_path();\n $file_md5 = md5_file($php_public_path . $public_file_path);\n\n $new_path = $public_file_path . '?v=' . $file_md5;\n\n return $new_path;\n }", "function _asset($path, $secure = null)\n {\n\n if(env('APP_ASSETS') == 'local'){\n return app('url')->asset($path, $secure);\n } else {\n return app('url')->asset(\"public/\".$path, $secure);\n }\n }", "static function asset_path($source)\n {\n if ($source) {\n $decoded_source = json_decode($source);\n if ($url = $decoded_source->url) {\n // if $url then the file is stored on the cloud \n return $url;\n } else {\n // else it is on the local storage ( generating the URL dynamically in this case so if the\n // the admin changes his Domain or base URL the assets will still work)\n $replace = preg_replace('/.*\\/storage/', '', $decoded_source->path);\n $url = asset('/storage' . $replace);\n return $url;\n }\n }\n }", "private function _getAssetsUrl()\n\t{\n\t\tif( $this->_assetsUrl===null )\n\t\t{\n\t\t\t$assetsPath = Yii::getPathOfAlias('ext.widgets.countupload.assets');\n\n\t\t\t// We need to republish the assets if debug mode is enabled.\n\t\t\tif( $this->debug===true )\n\t\t\t\t$this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath, false, -1, true);\n\t\t\telse\n\t\t\t\t$this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath);\n\t\t}\n\t\treturn $this->_assetsUrl;\n\t}", "public function getUrlAttribute() \n {\n if (!empty($this->path)) {\n return Storage::disk('s3')->temporaryUrl(\n $this->path, now()->addSeconds(config('constants.expire_link_duration'))\n );\n }\n return null;\n }", "function assets_url($path='') {\n\t\tif (substr($path, 0) == '/') {\n\t\t\treturn base_url().\"assets\".$path;\n\t\t} else {\n\t\t\treturn base_url().\"assets/\".$path;\n\t\t}\n\t}", "function &createCache() {}", "public function getCachePathString()\n\t{\n\t\treturn \"rs-\".$this->_maxWidth.\"-\".$this->_maxHeight.\"-\".$this->_maintainAspectRatio.\"-\".$this->_scaleUp;\n\t}", "function asset( string $asset, ?string $path = null ): string\n {\n return Asset::url( $asset, $path );\n }", "private function build_cache_key_for_url( $url ) {\n\t\treturn 'g_url_details_response_' . md5( $url );\n\t}", "public static function asset(string $path): string\n {\n /*\n to DOOOO\n viewNamespaceToPath => /images/prova.png\n viewNamespaceToDir => c:\\var\\wwww\\test\\images\\prova.png\n viewNamespaceToAsset => http://example.com/images/prova.png\n */\n // dddx(\\Module::asset('blog:img/logo.img')); //localhost/modules/blog/img/logo.img\n\n if (Str::startsWith($path, 'https://')) {\n return $path;\n }\n if (Str::startsWith($path, 'http://')) {\n return $path;\n }\n\n if (File::exists(public_path($path))) {\n return $path;\n }\n\n if (Str::startsWith($path, '/theme/pub')) {\n $path = 'pub_theme::'.Str::after($path, '/theme/pub');\n }\n\n if (Str::startsWith($path, 'theme/pub')) {\n $path = 'pub_theme::'.Str::after($path, 'theme/pub');\n }\n\n $ns = Str::before($path, '::');\n $ns_after = Str::after($path, '::');\n if ($ns === $path) {\n $ns = inAdmin() ? 'adm_theme' : 'pub_theme';\n }\n\n $ns_after0 = Str::before($ns_after, '/');\n $ns_after1 = Str::after($ns_after, '/');\n $ns_after = str_replace('.', '/', $ns_after0).'/'.$ns_after1;\n\n if (Str::startsWith($ns_after, '/')) {\n $ns_after = Str::after($ns_after, '/');\n }\n if (\\in_array($ns, ['pub_theme', 'adm_theme'], true)) {\n $theme = config('xra.'.$ns);\n\n $filename_from = self::fixPath(base_path('Themes/'.$theme.'/Resources/'.$ns_after));\n // $filename_from = Str::replace('/Resources//', '/Resources/', $filename_from);\n $asset = 'themes/'.$theme.'/'.$ns_after;\n $filename_to = self::fixPath(public_path($asset));\n $asset = Str::replace(url(''), '', asset($asset));\n\n if (! File::exists($filename_to)) {\n if (! File::exists(\\dirname($filename_to))) {\n File::makeDirectory(\\dirname($filename_to), 0755, true, true);\n }\n try {\n File::copy($filename_from, $filename_to);\n } catch (\\Exception $e) {\n throw new \\Exception('message:['.$e->getMessage().']\n path :['.$path.']\n file from ['.$filename_from.']\n file to ['.$filename_to.']');\n }\n }\n Assert::string($asset, 'wip');\n\n return $asset;\n }\n\n $module_path = Module::getModulePath($ns);\n if (Str::endsWith($module_path, '/')) {\n $module_path = Str::beforeLast($module_path, '/');\n }\n $filename_from = self::fixPath($module_path.'/Resources/'.$ns_after);\n $asset = 'assets/'.$ns.'/'.$ns_after;\n $filename_to = self::fixPath(public_path($asset));\n $asset = Str::replace(url(''), '', asset($asset));\n if (! File::exists($filename_from)) {\n throw new \\Exception('file ['.$filename_from.'] not Exists , path ['.$path.']');\n }\n\n // dddx(app()->environment());// local\n if (! File::exists($filename_to) || 'production' !== app()->environment()) {\n if (! File::exists(\\dirname($filename_to))) {\n File::makeDirectory(\\dirname($filename_to), 0755, true, true);\n }\n // 105 If condition is always true.\n // if (File::exists($filename_from)) {\n File::copy($filename_from, $filename_to);\n // }\n }\n Assert::string($asset, 'wip');\n\n return $asset;\n\n // return asset(self::viewNamespaceToAsset($path));\n }", "function smarty_modifier_toAssetPath($string) {\n\n if (strpos($string, \"::\") !== false) {\n $parts = explode(\"::\", $string);\n $src = ModulesContext::instance()->getConfig()->get(\"businessRoot\", \"src\");\n $base = trim(str_replace(\"::\", \"/\", $src), \"/\");\n $result = \"$base/$parts[0]/assets/$parts[1]\";\n } else {\n $result = \"assets/$result\";\n }\n\n $resultingPath = Loader::toSinglePath($result, \".tpl\");\n\n return $resultingPath;\n}", "public function getAssetsUrl()\n\t{\n\t\tif($this->_assetsUrl===null)\n\t\t{\n\t\t\t$this->_assetsUrl=Yii::app()->getAssetManager()->publish(\n\t\t\t\tYii::getPathOfAlias('application.modules.'.$this->moduleName.'.assets'),\n\t\t\t\tfalse,\n\t\t\t\t-1,\n\t\t\t\tYII_DEBUG\n\t\t\t);\n\t\t}\n\n\t\treturn $this->_assetsUrl;\n\t}", "function basset(string $asset): string\n {\n $status = Basset::basset($asset, false);\n\n if (in_array($status, [StatusEnum::DISABLED, StatusEnum::INVALID])) {\n return $asset;\n }\n\n return Basset::getUrl($asset);\n }", "function fabric_embed_wrap($cache, $url, $attr = '', $post_ID = '') {\n return '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "function _adRenderBuildImageUrlPrefix()\n{\n $conf = $GLOBALS['_MAX']['CONF'];\n return $GLOBALS['_MAX']['SSL_REQUEST'] ? 'https://' . $conf['webpath']['imagesSSL'] : 'http://' . $conf['webpath']['images'];\n}", "function sURL($filename){\r\n\t\t$ext = pathinfo($filename, PATHINFO_EXTENSION);\r\n\t\tswitch (strtolower($ext)){\r\n\t\t\tcase 'css':\r\n\t\t\t\t$filename = 'css/'.$filename;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'js':\r\n\t\t\t\t$filename = 'js/'.$filename;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault :\r\n\t\t\t\t$filename = 'images/'.$filename;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn $this->env['web_root'].'static/'.$filename;\r\n\t}", "function cacheImage($url) {\r\n\t\ttry {\r\n\t\t\t$cacheDir = dirname(__FILE__) . '/img/cache/';\r\n if (!file_exists($cacheDir)) {\r\n mkdir($cacheDir, 0777, true);\r\n }\r\n \t$cached_filename = md5($url);\r\n\t\t\t$files = glob($cacheDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);\r\n\t\t\t$now = time();\r\n\t\t\tforeach ($files as $file) {\r\n\t\t\t\tif (is_file($file)) {\r\n\t\t\t\t\tif ($now - filemtime($file) >= 60 * 60 * 24 * 5) { // 5 days\r\n\t\t\t\t\t\tunlink($file);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tforeach($files as $file) {\r\n\t\t\t\t$fileName = explode('.',basename($file));\r\n\t\t\t\tif ($fileName[0] == $cached_filename) {\r\n\t\t\t\t $path = getRelativePath(dirname(__FILE__),$file);\r\n\t\t\t\t\t return $path;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$image = file_get_contents($url);\r\n\t\t\tif ($image) {\r\n\t\t\t\t$tempName = $cacheDir . $cached_filename;\r\n\t\t\t\tfile_put_contents($tempName,$image);\r\n\t\t\t\t$imageData = getimagesize($tempName);\r\n\t\t\t\t$extension = image_type_to_extension($imageData[2]);\r\n\t\t\t\tif($extension) {\r\n\t\t\t\t\t$filenameOut = $cacheDir . $cached_filename . $extension;\r\n\t\t\t\t\t$result = file_put_contents($filenameOut, $image);\r\n\t\t\t\t\tif ($result) {\r\n\t\t\t\t\t\trename($tempName,$filenameOut);\r\n\t\t\t\t\t\treturn getRelativePath(dirname(__FILE__),$filenameOut);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tunset($tempName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (\\Exception $e) {\r\n\t\t\twrite_log('Exception: ' . $e->getMessage());\r\n\t\t}\r\n\t\treturn $url;\r\n\t}", "function _asset($path, $secure = null)\n {\n if (! app()->environment('production')) {\n if (app()->environment('development')) {\n $path = 'assets/'.$path;\n }\n\n return asset($path, $secure);\n }\n\n return implode('/', [\n config('infoexam.static_url'),\n 'assets',\n json_decode(File::get(base_path('composer.json'), true), true)['version'],\n $path,\n ]);\n }", "public function asset($asset = null)\n\t{\n\t\treturn rtrim($this->assetUrl,\"/\").($asset ? \"/\". trim($asset, '/') : '');\n\t}", "function link_to_asset($url, $title = null, $attributes = [], $secure = null)\n {\n return app('html')->linkAsset($url, $title, $attributes, $secure);\n }", "function link_to_asset($url, $title = null, $attributes = [], $secure = null)\n {\n return app('html')->linkAsset($url, $title, $attributes, $secure);\n }", "function link_to_asset(string $url, ?string $title = null, array $attributes = [], ?bool $secure = null): Htmlable\n {\n return \\app('html')->linkAsset($url, $title, $attributes, $secure);\n }", "private function createCacheFileName($params) {\n $parts = pathinfo($this->imgPath);\n $fileExtension = $parts['extension'];\n $this->saveAs = is_null($params['save_as']) ? $fileExtension : $params['save_as'];\n $quality_ = is_null($params['quality']) ? null : \"_q{$params['quality']}\";\n $cropToFit_ = is_null($params['crop_to_fit']) ? null : \"_cf\";\n $dirName = preg_replace('/\\//', '-', dirname($params['src']));\n $cacheFileName = IMAGE_CACHE_PATH . \"-{$dirName}-{$parts['filename']}_{$params['width']}_{$params['height']}{$quality_}{$cropToFit_}.{$this->saveAs}\";\n $cacheFileName = preg_replace('/^a-zA-Z0-9\\.-_/', '', $cacheFileName);\n if($this->verbose) { $this->createVerbose(\"Cache file is: {$cacheFileName}\"); }\n return $cacheFileName;\n \n }", "function _build_url() {\n\t\t// Add transaction ID for better detecting double requests in AUTH server\n\t\tif($GLOBALS['config']['application']['tid'] == '') $GLOBALS['config']['application']['tid'] = rand(0, 10000);\n\n\t\t$url = $this->url.'&action='.$this->action.'&tid='.$GLOBALS['config']['application']['tid'];\n\t\t\n\t\treturn $url;\n\t}", "public static function asset($asset = '') {\n\t\tif (!empty($asset)) {\n\t\t\treturn CoreLoader::themeRootURL() . 'trueadmin/' . $asset;\n\t\t}\n\t\treturn CoreLoader::themeRootURL() . 'trueadmin';\n\t}", "function script_cdn($path)\r\n{\r\n\t$path = (env('APP_ENV') === 'local') ? $path : env('CDN_URL') . $path;\r\n\r\n\treturn '<script src=\"' . $path . '\"></script>';\r\n}", "function getFullCacheUrl($url, $params) {\n\n //Sorting query params by key (acts by reference)\n ksort($params);\n\n //Transforming the query array to query string\n $queryString = http_build_query($params);\n\n $fullUrl = \"{$url}?{$queryString}\";\n\n return $fullUrl;\n\n}", "private function createCacheKey(string $url) : string\n {\n return md5($url);\n }", "function roots_embed_wrap($cache, $url, $attr = '', $post_ID = '') {\n return '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "function asset_version($source) {\n $version = $this->get_asset_version_string();\n\n if (isset($version))\n $source .= sprintf(\"?ver=%s\", $version);\n return $source;\n }", "function cacheThisImage($img)\n{\n\trequire_once 'externalLibraries/ImageCache.php';\n\t$baseurl=base_url();\n\t$imagecache = new ImageCache();\n\t//$imagecache->cached_image_directory = $baseurl. 'entreprenity/api/cachedImages/';\n\t$imagecache->cached_image_directory = dirname(__FILE__) . '/cachedImages';\n\n\t$cached_src_one = $imagecache->cache($img);\n\t//return $imagecache->cached_image_directory;\n\treturn $cached_src_one;\n\n}", "public static function Generate(string $url): string\n {\n do {\n $short_url = self::GenerateUniqueString();\n } while (Cache::has($short_url));\n Cache::forever($short_url, $url);\n return $short_url;\n }", "function asset_url(){\n return base_url().'assets/';\n}", "function get_assets_path() {\n return \"http://\" . $_SERVER['HTTP_HOST'] . '/' . ROOT_PATH . '/assets/';\n }", "public function createImgUri() {\n\t\t$this->imgUri = FLICKR_FARM;\n\t\t$this->imgUri .= $this->photo['farm'];\n\t\t$this->imgUri .= '.';\n\t\t$this->imgUri .= STATICFLICKR;\n\t\t$this->imgUri .= $this->photo['server'];\n\t\t$this->imgUri .= '/';\n\t\t$this->imgUri .= $this->photo['id'];\n\t\t$this->imgUri .= '_';\n\t \t$this->imgUri .= $this->photo['secret'];\n\t\t$this->imgUri .= '.';\n\t \t$this->imgUri .= IMGEXT;\n\t}", "private function asset_html_setting($type, $file, $https, $return = false, $args=array())\n {\n $CI =& get_instance();\n $CI->load->helper(\"url\");\n $CI->load->config(\"asset\");\n\n $arg = '';\n foreach($args as $key => $val){\n $arg.= $key.\"=\".$val.\" \";\n }\n \n $assets_config = $CI->config->item('assets');\n\n if(isset($assets_config['version']))\n {\n $this->version = $assets_config['version'];\n }\n\n if(isset($assets_config['base_url'])){\n $this->base_url = $assets_config['base_url'];\n }\n\n if(isset($assets_config['path']))\n {\n $this->path = $assets_config['path'];\n \n }\n\n if($assets_config[$type])\n {\n $this->asset_path = $this->path.$assets_config[$type];\n }\n\n if($type == 'css')\n {\n $url = \"<link rel='stylesheet' href='{{url}}'>\";\n \n }elseif($type == 'js'){\n $url = \"<script type='text/javascript' src='{{url}}'></script>\";\n }elseif($type == 'image'){\n\n $url = '<img src=\"{{url}}\" '.$arg.'>';\n }\n\n if(isset($this->format[$type]))\n {\n $this->asset_format = $this->format[$type];\n \n }\n\n $file = $this->base_url.$this->asset_path.$file;\n \n if($https)\n {\n $url = str_replace('http://', 'https://', $url);\n }\n\n if($return == false){\n $asset_output = str_replace(\"{{url}}\", $file . \"?version=\" . $this->version, $url);\n\n return $asset_output;\n }else{\n $asset_output = $file . \"?version=\" . $this->version;\n\n return $asset_output;\n }\n\n \n \n }", "function load_asset($assetUrl)\n {\n return (env('APP_ENV') == 'PRODUCTION') ? secure_asset($assetUrl) : asset($assetUrl);\n }", "public function assetUrl(string $filename): string\n {\n if (file_exists($hotFile = __DIR__ . '/../build/hot')) {\n // @codeCoverageIgnoreStart\n return trim(file_get_contents($hotFile)) . $filename;\n // @codeCoverageIgnoreEnd\n }\n\n if (file_exists($manifestFile = __DIR__ . '/../build/mix-manifest.json')) {\n $manifest = json_decode(file_get_contents($manifestFile), true);\n // Need to add then remove the leading \"/\"\n if (isset($manifest[\"/$filename\"])) {\n $filename = substr($manifest[\"/$filename\"], 1);\n }\n }\n\n return route('migrations-ui.asset', $filename);\n }", "function assets_url( $path, $file, $scheme = null, $is_network = false )\n {\n // Preparation\n $route = preg_replace( '/\\\\\\\\/', '/', $file );\n $url = apply_filters(\n 'asset_base_url',\n rtrim( $is_network ? network_home_url( '/', $scheme ) : home_url( '/', $scheme ), '/' )\n );\n // Polylang support\n if ( function_exists( 'pll_current_language' ) ) {\n $lang = pll_current_language( 'slug' );\n if ( strpos( $url, '/' . $lang ) !== false && $lang !== false )\n $url = str_replace( '/' . $lang, '', $url );\n }\n // WPML support\n if ( function_exists( 'icl_object_id' ) && defined( 'ICL_LANGUAGE_CODE' ) ) {\n $url = preg_replace( '#([a-z])/' . ICL_LANGUAGE_CODE . '#', '\\\\1', $url );\n }\n // Clean base path\n $route = preg_replace( '/.+?(?=wp-content)/', '', $route );\n // Clean project relative path\n $route = preg_replace( '/\\/app[\\/\\\\\\\\A-Za-z0-9\\.\\-]+/', '', $route );\n $route = preg_replace( '/\\/assets[\\/\\\\\\\\A-Za-z0-9\\.\\-]+/', '', $route );\n $route = preg_replace( '/\\/vendor[\\/\\\\\\\\A-Za-z0-9\\.\\-]+/', '', $route );\n return $url.'/'.apply_filters( 'app_route', $route ).'/assets/'.$path;\n }", "function asset( $path ) {\n\n\t\tif ( ! $this->mix ) {\n\t\t\t$file = $this->path( 'public/mix-manifest.json' );\n\t\t\t$this->mix = (array) json_decode( file_get_contents( $file ), true );\n\t\t}\n\n\t\t// Make sure to trim any slashes from the front of the path.\n\t\t$path = '/' . ltrim( $path, '/' );\n\n\t\tif ( $this->mix && isset( $this->mix[ $path ] ) ) {\n\t\t\t$path = $this->mix[ $path ];\n\t\t}\n\n\t\treturn $this->uri( 'public' . $path );\n\t}", "public function cover_image_absolute_url() {\n // If the URL does not already start with http, assume it's stored locally and add the app URL\n if(!preg_match('/^https?:\\/\\//', $this->cover_image))\n return env('APP_URL').$this->cover_image;\n\n return $this->cover_image;\n }", "function get_file_url_cdn($file) {\n // We only do the replacement if a CDN_URL has been set and is different than the BASE_URL\n // This allows a FILES URL to be used for static files while template files still remain in the local installation\n if(BASE_URL != CDN_URL) {\n return str_replace(FILES_URL,CDN_URL,get_file_url($file));\n } else {\n return get_file_url($file);\n }\n}", "protected function getCacheSuffix() {\n return '';\n }", "public function cacheBin() {\n return 'cache_forsrights_webservice';\n }", "function assets_url( $path = '' ) {\n\n\treturn home_url( 'Cece/Assets/' . $path );\n\n}", "protected static function createBaseTcaCacheFile() {}", "function file_name ($url) {\n $filename = md5( $url );\n return join( DIRECTORY_SEPARATOR, array( $this->BASE_CACHE, $filename ) );\n }", "function asset($path) {\n echo getAbsolutePath() . \"public/$path\";\n}", "function assets($type = null, $file = null)\n {\n // Make sure the path on config file end with '/'\n $assets_path = ends_with(config_item('assets_path'), '/')\n ? config_item('assets_path')\n : config_item('assets_path') . '/';\n if (is_null($type)) {\n // return the URL of original assets_path\n return base_url() . $assets_path;\n }\n // $file variable is fullfil\n if (!is_null($file)) {\n // $file variable is not empty string\n if ($type != '') {\n $path = ends_with(config_item($type . '_path'), '/')\n ? config_item($type . '_path')\n : config_item($type . '_path') . '/';\n }\n // $file is empty string\n else {\n $path = $assets_path;\n }\n }\n // return the URL of type_path\n return base_url() . $path . $file;\n }", "public function cacheUrl(string $url)\n {\n return $this->cache->remember(\"cdn.{$url}\", $this->cacheExpiry, function () use ($url) {\n return $this->rewriteUrl($url);\n });\n }", "public function getPhotoUrlAttribute()\n {\n return asset(env('FRONTEND_IMAGES_PATH') . $this->image);\n }", "public static function assetsPath()\n {\n return asset(config('onion_engine.options.public_assets_path')).'/';\n }", "public function assets_url($directory=NULL, $use_file=FALSE)\n\t{\n\t\t$directory = ((NULL === $directory)) ? '' : \"/$directory\";\n\t\t\n\t\tif(TRUE == $use_file)\n\t\t\treturn url::site(\"files$directory\");\n\t\telse\n\t\t\treturn url::site(\"_data/$this->site_name/assets$directory\");\t\t\n\t}", "public function getPrepareLink()\n {\n $baseUrl = Mage::app()->getStore($this->getStoreId())->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);\n \n return $baseUrl . $this->getData('path') . $this->getFilename();\n }", "public function generate_url()\n {\n }", "public function getJsCachePrefix()\n {\n return Mage::helper('core/url')->getCurrentBase64Url();\n }" ]
[ "0.723229", "0.69472337", "0.688669", "0.67228067", "0.65536284", "0.65031654", "0.64400804", "0.64110476", "0.63652664", "0.6221502", "0.6177845", "0.6160608", "0.6137343", "0.6038086", "0.6029056", "0.60015136", "0.5997293", "0.5989653", "0.596561", "0.59623235", "0.59550226", "0.5909182", "0.59089184", "0.58676136", "0.58661866", "0.5859866", "0.58224547", "0.58167946", "0.5809277", "0.57996815", "0.5789654", "0.5762074", "0.575731", "0.575386", "0.57351136", "0.5731526", "0.5723846", "0.5716348", "0.5656092", "0.5653596", "0.56520146", "0.5647407", "0.5622623", "0.5606763", "0.5602618", "0.5587559", "0.55790913", "0.5575573", "0.5572967", "0.55576026", "0.5549367", "0.5544219", "0.5531462", "0.5513149", "0.55080986", "0.55014336", "0.55012846", "0.54980737", "0.5494001", "0.5483707", "0.5470263", "0.5463167", "0.54597914", "0.5439293", "0.5439293", "0.5438008", "0.5426186", "0.542208", "0.54098547", "0.54096884", "0.540368", "0.5402891", "0.5400854", "0.5399917", "0.53870404", "0.5381798", "0.53788406", "0.5377249", "0.5368401", "0.5344811", "0.53440434", "0.53433436", "0.5342908", "0.53427064", "0.53426117", "0.5339678", "0.5329583", "0.5326317", "0.5322663", "0.5321046", "0.52991563", "0.5296353", "0.529544", "0.5275618", "0.5270868", "0.52706856", "0.5265801", "0.5264762", "0.52594167", "0.52546674" ]
0.5715831
38
Check either mcrypt extension available. Raise error if it is not.
private final function CheckMcrypt() { if (!function_exists("mcrypt_module_open")) Core::ThrowException("Cannot call mcrypt_module_open(). Mcrypt extension not installed?", E_ERROR); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function isMcryptAvailable()\n {\n return extension_loaded('mcrypt');\n }", "public function hasMcryptSupport()\n {\n return function_exists('mcrypt_encrypt');\n }", "private final function CheckMhash()\r\n\t\t{\r\n\t\t\tif (!function_exists(\"mhash\"))\r\n\t\t\t\tCore::ThrowException(\"Cannot call mhash(). Mhash extension not installed?\", E_ERROR);\r\n\t\t}", "public static function check_required_ext() {\r\n $shmop = extension_loaded('shmop');\r\n $sysvsem = extension_loaded('sysvsem');\r\n if ($shmop && $sysvsem) {\r\n return true;\r\n }\r\n $missing = array();\r\n if (!$shmop) {\r\n array_push($missing, 'shmop');\r\n }\r\n if (!$sysvsem) {\r\n array_push($missing, 'sysvsem');\r\n }\r\n if (count($missing) == 1) {\r\n throw new Exception('The PHP extension ' . $missing[0] . ' required by class ' . __CLASS__ . ' is not loaded or built into PHP.');\r\n }\r\n throw new Exception('The PHP extensions ' . implode(' and ', $missing) . ' required by class ' . __CLASS__ . ' are not loaded or built into PHP.');\r\n }", "private static function checkRequiredPhpExtensions(): void\n {\n /**\n * Warning about mbstring.\n */\n if (! function_exists('mb_detect_encoding')) {\n Core::warnMissingExtension('mbstring');\n }\n\n /**\n * We really need this one!\n */\n if (! function_exists('preg_replace')) {\n Core::warnMissingExtension('pcre', true);\n }\n\n /**\n * JSON is required in several places.\n */\n if (! function_exists('json_encode')) {\n Core::warnMissingExtension('json', true);\n }\n\n /**\n * ctype is required for Twig.\n */\n if (! function_exists('ctype_alpha')) {\n Core::warnMissingExtension('ctype', true);\n }\n\n /**\n * hash is required for cookie authentication.\n */\n if (function_exists('hash_hmac')) {\n return;\n }\n\n Core::warnMissingExtension('hash', true);\n }", "public function checkDependencies($text = NULL, $key = NULL) {\n $errors = [];\n\n if (!function_exists('mcrypt_encrypt')) {\n $errors[] = t('MCrypt library not installed.');\n }\n\n // Check if we have a 128 bit key.\n if (strlen($key) != 16) {\n $errors[] = t('This encryption method requires a 128 bit key.');\n }\n\n return $errors;\n }", "protected function checkIfDbalExtensionIsInstalled() {}", "protected function checkPhpExtensions()\n\t{\n\t\tif (!extension_loaded('pcntl'))\n\t\t{\n\t\t\techo \"Extension pcntl not loaded\";\n\t\t\texit(1);\n\t\t}\n\n\t\t// This is used to kill processes\n\t\tif (!extension_loaded('posix'))\n\t\t{\n\t\t\techo \"Extension posix not loaded\";\n\t\t\texit(1);\n\t\t}\n\t}", "function isInstalled() {\r\n return extension_loaded('memcache');\r\n }", "private function check_compatibility()\n\t{\n\t\tif ( ! extension_loaded( 'curl' ) || ! extension_loaded( 'json' ) )\n\t\t{\n\t\t\tthrow new CentrifugeException('There is missing dependant extensions - please ensure both cURL and JSON modules are installed');\n\t\t}\n\n\t\tif ( ! in_array( 'md5', hash_algos() ) )\n\t\t{\n\t\t\tthrow new CentrifugeException('md5 appears to be unsupported - make sure you have support for it, or upgrade your version of PHP.');\n\t\t}\n\n\t}", "public function passes() {\n $passes = extension_loaded('mcrypt');\n\n $message = $passes\n ? 'Mcrypt Extension Loaded'\n : 'Mycrypt Extension Not Loaded';\n\n return ['result' => $passes, 'message' => $message];\n }", "protected function checkRequiredPhpModules()\n {\n // Make sure BCMATH is installed to support MySQL geospatial operations\n $isBcmathInstalled = extension_loaded('bcmath');\n\n\n if (!$isBcmathInstalled)\n {\n $options = array(\n 'title_key' => 'COM_CAJOBBOARD_PIM_BCMATH_MISSING_TITLE',\n 'description_key' => 'COM_CAJOBBOARD_PIM_BCMATH_MISSING_DESC'\n );\n\n $this->setPostInstallationMessage($options);\n }\n }", "protected function checkIfNoConflictingExtensionIsInstalled() {}", "public static function isValidEngine(): bool\n {\n return extension_loaded('openssl') && static::class != __CLASS__;\n }", "protected function checkRequiremets () {\n\t\t// Check if `finfo_file()` function exists. File info extension is \n\t\t// presented from PHP 5.3+ by default, so this error probably never happened.\n\t\tif (!function_exists('finfo_file')) \n\t\t\treturn $this->handleUploadError(\n\t\t\t\tstatic::UPLOAD_ERR_NO_FILEINFO\n\t\t\t);\n\t\t\n\t\t// Check if mimetypes and extensions validator class\n\t\t$extToolsMimesExtsClass = static::MVCCORE_EXT_TOOLS_MIMES_EXTS_CLASS;\n\t\tif (!class_exists($extToolsMimesExtsClass)) \n\t\t\treturn $this->handleUploadError(\n\t\t\t\tstatic::UPLOAD_ERR_NO_MIMES_EXT\n\t\t\t);\n\n\t\t// Complete uploaded files temporary directory:\n\t\t$this->GetUploadsTmpDir();\n\t\t\n\t\treturn TRUE;\n\t}", "public function checkRequirements()\n\t{\n\t\t$tests = array('result' => true);\n\t\t$tests['curl'] = array('name' => $this->l('PHP cURL extension must be enabled on your server'), 'result' => extension_loaded('curl'));\n\t\t$tests['mbstring'] = array('name' => $this->l('PHP Multibyte String extension must be enabled on your server'), 'result' => extension_loaded('mbstring'));\n\t\tif (Configuration::get('STRIPE_MODE'))\n\t\t\t$tests['ssl'] = array('name' => $this->l('SSL must be enabled on your store (before entering Live mode)'), 'result' => Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS']) && Tools::strtolower($_SERVER['HTTPS']) != 'off'));\n\t\t$tests['php52'] = array('name' => $this->l('Your server must run PHP 5.3.3 or greater'), 'result' => version_compare(PHP_VERSION, '5.3.3', '>='));\n\t\t$tests['configuration'] = array('name' => $this->l('You must sign-up for Stripe and configure your account settings in the module (publishable key, secret key...etc.)'), 'result' => $this->checkSettings());\n\n\t\tif (_PS_VERSION_ < 1.5)\n\t\t{\n\t\t\t$tests['backward'] = array('name' => $this->l('You are using the backward compatibility module'), 'result' => $this->backward, 'resolution' => $this->backward_error);\n\t\t\t$tmp = Module::getInstanceByName('mobile_theme');\n\t\t\tif ($tmp && isset($tmp->version) && !version_compare($tmp->version, '0.3.8', '>='))\n\t\t\t\t$tests['mobile_version'] = array('name' => $this->l('You are currently using the default mobile template, the minimum version required is v0.3.8').' (v'.$tmp->version.' '.$this->l('detected').' - <a target=\"_blank\" href=\"http://addons.prestashop.com/en/mobile-iphone/6165-prestashop-mobile-template.html\">'.$this->l('Please Upgrade').'</a>)', 'result' => version_compare($tmp->version, '0.3.8', '>='));\n\t\t}\n\n\t\tforeach ($tests as $k => $test)\n\t\t\tif ($k != 'result' && !$test['result'])\n\t\t\t\t$tests['result'] = false;\n\n\t\treturn $tests;\n\t}", "protected static function checkFileinfoExtension()\n {\n // Make sure that the \"fileinfo\" extension is loaded/enabled\n if (!extension_loaded('fileinfo')) {\n throw new RuntimeException('Required \"fileinfo\" extension not loaded');\n }\n }", "private function performMinimumRequirementsCheck()\r\n {\r\n if (version_compare(PHP_VERSION, '5.3.7', '<')) {\r\n echo \"Sorry, Simple PHP Login does not run on a PHP version older than 5.3.7 !\";\r\n } elseif (version_compare(PHP_VERSION, '5.5.0', '<')) {\r\n require_once(\"libraries/password_compatibility_library.php\");\r\n return true;\r\n } elseif (version_compare(PHP_VERSION, '5.5.0', '>=')) {\r\n return true;\r\n }\r\n // default return\r\n return false;\r\n }", "protected function _isMemcacheLoaded()\n {\n if ($this->_type == 'Zend_Cache_Backend_Memcached' &&\n !extension_loaded('memcache')) {\n throw new Zend_Exception('memcache extension is not found.'); \n }\n }", "function checkRequirements(){\n\t\n\t// IMAP is needed\n\tif(function_exists('imap_open') && function_exists('mail')){ return true; }\n\t\n\t// everything looks good!\n\treturn false;\n}", "private function checkIfBcmodIsAvailable(): bool\n {\n return function_exists('bcmod');\n }", "protected function checkOpenSslInstalled() {}", "public function checkOperationality()\n {\n if (!extension_loaded('gd')) {\n throw new SystemRequirementsNotMetException('Required Gd extension is not available.');\n }\n\n if (!function_exists('imagewebp')) {\n throw new SystemRequirementsNotMetException(\n 'Gd has been compiled without webp support.'\n );\n }\n }", "public function verifyRequirements() {\n\n $problems = array(\n 'warnings' => array(),\n 'errors' => array()\n );\n\n // Requirement: PHP 5.3\n if (version_compare(phpversion(), '5.3.0') < 0) {\n $problems['errors'][] = 'PHP 5.3.0 or greater is required. Your installed version is '.phpversion().'.';\n }\n\n // Requirement: PDO\n if (!class_exists('PDO')) {\n $problems['errors'][] = 'The PHP Data Objects (PDO) extension is required.';\n }\n\n // Requirement: mod_rewrite\n if (function_exists('apache_get_modules') && !in_array('mod_rewrite', apache_get_modules())) {\n $problems['errors'][] = 'The Apache mod_rewrite module is required.';\n }\n\n // Requirement: cURL\n if (!function_exists('curl_init')) {\n $problems['errors'][] = 'The PHP cURL extension is required.';\n }\n\n // Requirement: writable config.php\n if (!is_writable($this->directory)) {\n $problems['errors'][] = 'The directory for your config.php file is not writable. Please change the permissions on this directory (through SSH or your FTP client) so it writable to all users. When this installer is completed, you can change the permissions back. The directory to make writable: <code>'.$this->directory.'</code>';\n }\n\n // Optional: json_decode\n if (!function_exists('json_decode')) {\n $problems['warnings'][] = 'Your version of PHP is missing the <code>json_decode()</code> function. This is included and enabled by default for PHP versions 5.2.0 and higher. This is only required if you want to import tweets from an official twitter archive download, otherwise Archive My Tweets can run without it.';\n }\n\n // Optional: 64-bit integers\n if (PHP_INT_SIZE != 8) {\n $problems['warnings'][] = 'Your PHP installation does not support 64 bit integers and this may cause problems for you. Support for 64 bit integers is recommended and is offered by most modern web hosts.';\n }\n\n return $problems;\n\n }", "public function hasCrypt(): bool;", "function check_phpversion_for_hash(){\r\n\tif (version_compare(PHP_VERSION, '5.3.7', '<')) {\r\n\t exit(\"Sorry, Simple PHP Login does not run on a PHP version smaller than 5.3.7 !\");\r\n\t} else if (version_compare(PHP_VERSION, '5.5.0', '<')) {\r\n\t // if you are using PHP 5.3 or PHP 5.4 you have to include the password_api_compatibility_library.php\r\n\t // (this library adds the PHP 5.5 password hashing functions to older versions of PHP)\r\n\t require_once(\"password_compatibility_library.php\");\r\n\t}\r\n}", "public function is_supported()\n\t{\n\t\tif ( ! extension_loaded('memcached'))\n\t\t{\n\t\t\tlog_message('error', 'The Memcached Extension must be loaded to use Memcached Cache.');\n\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$this->_setup_memcached();\n\t\treturn TRUE;\n\t}", "protected function checkModules()\n\t{\n\t\tif (Loader::includeModule('imconnector'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tShowError(Loc::getMessage('IMCONNECTOR_COMPONENT_FACEBOOK_MODULE_NOT_INSTALLED_MSGVER_1'));\n\n\t\t\treturn false;\n\t\t}\n\t}", "private static function BigMath_Detect() {\r\n $extensions = array(\r\n \tarray('modules' => array('gmp', 'php_gmp'),\r\n 'extension' => 'gmp',\r\n 'class' => 'BigMath_GmpMathWrapper'),\r\n \tarray('modules' => array('bcmath', 'php_bcmath'),\r\n 'extension' => 'bcmath',\r\n 'class' => 'BigMath_BcMathWrapper')\r\n );\r\n\r\n $loaded = false;\r\n foreach ($extensions as $ext) {\r\n // See if the extension specified is already loaded.\r\n if ($ext['extension'] && extension_loaded($ext['extension'])) {\r\n $loaded = true;\r\n }\r\n\r\n // Try to load dynamic modules.\r\n if (!$loaded && function_exists('dl')) {\r\n foreach ($ext['modules'] as $module) {\r\n if (@dl($module . \".\" . PHP_SHLIB_SUFFIX)) {\r\n $loaded = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if ($loaded) {\r\n return $ext;\r\n }\r\n }\r\n\r\n return false;\r\n }", "protected function checkInstallToolPasswordNotSet() {}", "public function checkExtensions()\n {\n $extensions = array(\n 'fileinfo',\n 'pdo',\n 'mbstring',\n 'tokenizer',\n 'openssl',\n 'json',\n 'curl',\n 'xml'\n );\n\n $results = array();\n\n foreach ($extensions as $extension) {\n $results[$extension] = extension_loaded($extension);\n }\n\n return $results;\n }", "public function checkOperationality()\n {\n $this->checkOperationalityExecTrait();\n\n if (!$this->isInstalled()) {\n throw new SystemRequirementsNotMetException(\n 'imagemagick is not installed (cannot execute: \"' . $this->getPath() . '\")'\n );\n }\n if (!$this->isWebPDelegateInstalled()) {\n throw new SystemRequirementsNotMetException('webp delegate missing');\n }\n }", "public function checkOperationality()\n {\n $this->checkOperationalityExecTrait();\n\n if (!$this->isInstalled()) {\n throw new SystemRequirementsNotMetException('gmagick is not installed');\n }\n if (!$this->isWebPDelegateInstalled()) {\n throw new SystemRequirementsNotMetException('webp delegate missing');\n }\n }", "function cemhub_check_required_php_extensions($set_message = TRUE, $extensions_list = array(CEMHUB_EXTENSION_SSH_NAME, CEMHUB_EXTENSION_GNUPG_NAME)) {\n $return = FALSE;\n $return_extensions_status = array();\n\n foreach ($extensions_list as $extension) {\n $extension_loaded = extension_loaded($extension);\n $return_extensions_status[$extension] = $extension_loaded;\n\n if (empty($extension_loaded) && $set_message) {\n drupal_set_message(t('The extension \"%extension\" must be installed and enabled on the server.', array('%extension' => $extension)), 'warning');\n }\n }\n\n // Check results\n if (!empty($return_extensions_status)) {\n $return = in_array(FALSE, $return_extensions_status) ? FALSE : TRUE;\n }\n\n return $return;\n}", "function check_requirements() {\n\tglobal $install_errors;\n\t\n\t// Try to fix the sessions in crap setups (OVH)\n\t@ini_set('session.gc_divisor', 100);\n\t@ini_set('session.gc_probability', true);\n\t@ini_set('session.use_trans_sid', false);\n\t@ini_set('session.use_only_cookies', true);\n\t@ini_set('session.hash_bits_per_character', 4);\n\t\n\t$mod_rw_error = 'Apache <a href=\"http://httpd.apache.org/docs/2.1/rewrite/rewrite_intro.html\" target=\"_blank\">mod_rewrite</a> is not enabled.';\n\t\n\tif(version_compare(PHP_VERSION, '5.2.0', '<'))\n\t\t$install_errors[] = 'Your server is currently running PHP version '.PHP_VERSION.' and Chevereto needs atleast PHP 5.2.0';\n\t\n\tif(!extension_loaded('curl') && !function_exists('curl_init'))\n\t\t$install_errors[] = '<a href=\"http://curl.haxx.se/\" target=\"_blank\">cURL</a> is not enabled on your current server setup.';\n\t\n\tif(!function_exists('curl_exec'))\n\t\t$install_errors[] = '<b>curl_exec()</b> function is disabled, you have to enable this function on your php.ini';\n\t\n\tif(function_exists('apache_get_modules')) {\n\t\tif(!in_array('mod_rewrite', apache_get_modules()))\n\t\t\t$install_errors[] = $mod_rw_error;\n\t} else {\n\t\t// As today (Jun 11, 2012) i haven't found a better way to test mod_rewrite in CGI setups. The phpinfo() method is not fail safe either.\n\t}\n\t\n\tif (!extension_loaded('gd') and !function_exists('gd_info')) {\n\t\t$install_errors[] = '<a href=\"http://www.libgd.org\" target=\"_blank\">GD Library</a> is not enabled.';\n\t} else {\n\t\t$imagetype_fail = 'image support is not enabled in your current PHP setup (GD Library).';\n\t\tif(!imagetypes() & IMG_PNG) $install_errors[] = 'PNG '.$imagetype_fail;\n\t\tif(!imagetypes() & IMG_GIF) $install_errors[] = 'GIF '.$imagetype_fail;\n\t\tif(!imagetypes() & IMG_JPG) $install_errors[] = 'JPG '.$imagetype_fail;\n\t\tif(!imagetypes() & IMG_WBMP) $install_errors[] = 'BMP '.$imagetype_fail;\n\t}\n\t\n\t/*\n\t$test_session_file = session_save_path().'/'.time();\n\tif(!@fopen($test_session_file, 'w+')) {\n\t\t$install_errors[] = 'PHP can\\'t write/read in the session path <code>'.session_save_path().'</code>. Your server setup doesn\\'t have the right PHP/Apache permissions over this folder.';\n\t\t$install_errors[] = 'Please repair the permissions on this folder or specify a new one on <code>php.ini</code>';\n\t} else {\n\t\t@unlink($test_session_file);\n\t}\n\t*/\n\t\n\t$bcmath_functions = array('bcadd', 'bcmul', 'bcpow', 'bcmod', 'bcdiv');\n\tforeach($bcmath_functions as $bcmath_function) {\n\t\tif(!function_exists($bcmath_function)) {\n\t\t\t$install_errors[] = '<a href=\"http://php.net/manual/function.'.$bcmath_function.'.php\" target=\"_blank\">'.$bcmath_function.'</a> function is not defined. You need to re-install the BC Math functions.';\n\t\t}\n\t}\n\t\n\tif(!extension_loaded('pdo')) {\n\t\t$install_errors[] = 'PHP Data Objects (<a href=\"http://www.php.net/manual/book.pdo.php\">PDO</a>) is not loaded.';\n\t}\n\t\n\tif(!extension_loaded('pdo_mysql')) {\n\t\t$install_errors[] = 'MySQL Functions (<a href=\"http://www.php.net/manual/ref.pdo-mysql.php\" target=\"_blank\">PDO_MYSQL</a>) is not loaded.';\n\t}\n\n\tif(count($install_errors)==0) return true;\n}", "public function __construct()\n {\n $this->_mcryptExists = (!function_exists('mcrypt_encrypt')) ? false : true;\n\n if ($this->_mcryptExists === false) {\n throw new FlyException(Fly::t('fly', 'The Encrypt library requires the Mcrypt extension.'));\n }\n\n Fly::log('debug', \"Encrypt Class Initialized\");\n }", "protected function checkRequiredModules()\n\t{\n\t\t$result = true;\n\n\t\tif(!Loader::includeModule('crm'))\n\t\t{\n\t\t\t$this->errors['FATAL'][] = Loc::getMessage(\"CRM_CLE2_CRM_MODULE_NOT_INSTALL\");\n\t\t\t$result = false;\n\t\t}\n\n\t\tif(!Loader::includeModule('sale'))\n\t\t{\n\t\t\t$this->errors['FATAL'][] = Loc::getMessage(\"CRM_CLE2_SALE_MODULE_NOT_INSTALL\");\n\t\t\t$result = false;\n\t\t}\n\n\t\treturn $result;\n\t}", "function load_crypto() {\n\t$crypto_modules = array('aesni', 'cryptodev');\n\n\t$enabled_modules = explode('_', config_get_path('system/crypto_hardware'));\n\n\tforeach ($enabled_modules as $enmod) {\n\t\tif (empty($enmod) || !in_array($enmod, $crypto_modules)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (!is_module_loaded($enmod)) {\n\t\t\tlog_error(sprintf(gettext(\"Loading %s cryptographic accelerator module.\"), $enmod));\n\t\t\tmute_kernel_msgs();\n\t\t\tmwexec(\"/sbin/kldload \" . escapeshellarg($enmod));\n\t\t\tunmute_kernel_msgs();\n\t\t}\n\t}\n}", "private function _validate_compatibility()\n {\n // Check if the current version of codeigniter is compatible\n if (substr(CI_VERSION, 0, 1) !== '3') {\n show_error($this->lang->line('auth_ci_version_mismatch'));\n }\n\n // password_hash functions is required for encrytion of user password\n if (!function_exists('password_hash')) {\n show_error($this->lang->line('auth_hashing_unavailable'));\n }\n\n // password_verify functions is required for the verification of the encrypted password\n if (!function_exists('password_verify')) {\n show_error($this->lang->line('auth_pass_verify_unavailable'));\n }\n }", "public function supportsEncryption()\n\t{\n\t\t// Do we have the encrypt.php plugin?\n\t\tif (!class_exists('\\\\Akeeba\\\\Engine\\\\Util\\\\Encrypt', true))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Did the user intentionally disable settings encryption?\n\t\t$useEncryption = Platform::getInstance()->get_platform_configuration_option('useencryption', -1);\n\n\t\tif ($useEncryption == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Do we have base64_encode/_decode required for encryption?\n\t\tif (!function_exists('base64_encode') || !function_exists('base64_decode'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Pre-requisites met. We can encrypt and decrypt!\n\t\treturn true;\n\t}", "protected function check() {\n\n // check for a valid GD lib installation \n if(!function_exists('gd_info')) raise('GD Lib is not installed');\n\n }", "function checkFTPSupport() {\n if (extension_loaded(\"ftp\")) {\n return true;\n } else {\n return false;\n }\n }", "public static function mbstring_loaded(): bool\n {\n return \\extension_loaded('mbstring');\n }", "public static function checkRequirements()\n {\n $extensions = array('curl', 'json');\n \n foreach ($extensions as $extension) {\n if (!extension_loaded($extension)) {\n throw new Everypay_Exception_RuntimeException(\n 'You need the PHP ' . $extension\n . ' extension in order to use EveryPay PHP Library'\n );\n }\n }\n }", "protected function checkPhpExtensionEnabled($ext)\n {\n return extension_loaded($ext);\n }", "public function checkOperationality()\n {\n if (!extension_loaded('vips')) {\n throw new SystemRequirementsNotMetException('Required Vips extension is not available.');\n }\n\n if (!function_exists('vips_image_new_from_file')) {\n throw new SystemRequirementsNotMetException(\n 'Vips extension seems to be installed, however something is not right: ' .\n 'the function \"vips_image_new_from_file\" is not available.'\n );\n }\n\n // TODO: Should we also test if webp is available? (It seems not to be neccessary - it seems\n // that webp be well intergrated part of vips)\n }", "public function extIsAllowed( $ext )\n {\n if ( !mb_strlen($ext) )\n {\n return false;\n }\n\n return in_array($ext, self::$ext);\n }", "protected function checkOperationality()\n {\n if (!function_exists('exec')) {\n throw new SystemRequirementsNotMetException('exec() is not enabled.');\n }\n }", "protected function checkExtension() {\n\t\t\n\t\t//If no extensions set, all are valid\n\t\tif(empty($this->valid_extensions)) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$extension = $this->getExtension();\n\t\t\n\t\treturn in_array($extension, $this->valid_extensions) ? true : false;\n\t\t\n\t}", "function check() {\r\n static $pass = NULL;\r\n if (is_null($pass)) {\r\n if (function_exists('crypt')) {\r\n $hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG';\r\n $test = crypt(\"password\", $hash);\r\n $pass = $test == $hash;\r\n } else {\r\n $pass = false;\r\n }\r\n }\r\n return $pass;\r\n }", "public function isExtensionLoaded($ext='gd') { \n return extension_loaded($ext); \n }", "protected static function multibyte_loaded() {\n\n\t\treturn extension_loaded( 'mbstring' );\n\t}", "public function canGetExtensionKey() {\n\t\t$provider = $this->getConfigurationProviderInstance();\n\t\t$record = $this->getBasicRecord();\n\t\t$extensionKey = $provider->getExtensionKey($record);\n\t\t$this->assertNull($extensionKey);\n\t}", "protected function checkRequiredModules()\n\t{\n\t\tif (!Loader::includeModule('sale'))\n\t\t\tthrow new Exception(Localization\\Loc::getMessage(\"SPOL_SALE_MODULE_NOT_INSTALL\"), self::E_SALE_MODULE_NOT_INSTALLED);\n\t\tif (!Loader::includeModule('catalog'))\n\t\t\t$this->useCatalog = false;\n\t}", "protected function _validateEnvironment() {\n /* @var $helper EW_NativePasswords_Helper_Data */\n $helper = Mage::helper('ew_nativepasswords');\n\n if(!$helper->isEnvironmentCompatible()) {\n throw new EW_NativePasswords_Exception_IncompatibleEnvironmentException(\n $helper->__(\n 'Native passwords are enabled in system configuration, but PHP version is incompatible. ' .\n 'Reminder: %s <= PHP version < %s can use compatibility library. ' .\n 'PHP version >= %s use native functionality. ' .\n 'Found version: %s.',\n EW_NativePasswords_Helper_Data::MINIMUM_REQUIRED_PHP_VERSION,\n EW_NativePasswords_Helper_Data::NATIVE_PHP_VERSION,\n EW_NativePasswords_Helper_Data::NATIVE_PHP_VERSION,\n phpversion()\n )\n );\n }\n }", "private static function checkIsAvailableCryptBlowFish() {\n\t\tif (defined(\"CRYPT_BLOWFISH\") && CRYPT_BLOWFISH) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isSupported() {\n\t\treturn class_exists('Salt');\n\t}", "public function hasCryptFilter() {}", "public function testBadParamsMcryptCompat()\n {\n $this->setExpectedException('PHPUnit_Framework_Error_Warning');\n\n phpseclib_mcrypt_encrypt('rijndael-128', 'abc', 'asdf', 'cbc', 'zz');\n }", "public function checkOperationality()\n {\n if (!extension_loaded('imagick')) {\n throw new SystemRequirementsNotMetException('Required iMagick extension is not available.');\n }\n\n if (!class_exists('\\\\Imagick')) {\n throw new SystemRequirementsNotMetException(\n 'iMagick is installed, but not correctly. The class Imagick is not available'\n );\n }\n\n $im = new \\Imagick();\n if (!in_array('WEBP', $im->queryFormats('WEBP'))) {\n throw new SystemRequirementsNotMetException('iMagick was compiled without WebP support.');\n }\n }", "function check_definitions() {\n\tglobal $config, $install_errors;\n\tif(is_localhost()) return true;\n\t\n\t// Crypt salt\n\tif(!check_value(__CHV_CRYPT_SALT__)) {\n\t\t$install_errors[] = 'You need to set <code>__CHV_CRYPT_SALT__</code> in <code>includes/definitions.php</code>. You only need to change this only the first time you install Chevereto';\n\t}\n\tif(__CHV_CRYPT_SALT__=='changeme') {\n\t\t$install_errors[] = 'You haven\\'t changed the default <code>__CHV_CRYPT_SALT__</code>. Please set this value in <code>includes/definitions.php</code>';\n\t}\n\tif(count($install_errors)==0) return true;\n}", "public function testPhpExtensionsAreValid()\n {\n $this->assert->php->extensions\n ->isLoaded('simplexml')\n ->isLoaded('fileinfo')\n ->isLoaded('xsl');\n // validate that fileinfo is loaded and configured properly\n $this->assert->php->extensions->fileinfo->isAlive();\n }", "public function checkDependencies() {\n if ((float) t3lib_extMgm::getExtensionVersion('extension_builder') < 2) {\n throw new Tx_Clitools_Exception_Dependency('This generator depends on extension_builder 2 higher');\n }\n }", "protected function test_compatibility() {\n\t\tif ( is_admin() || $_SERVER['PHP_SELF'] == '/wp-login.php' ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( version_compare(phpversion(), '5.3.0', '<') && !is_admin() ) {\n\t\t\ttrigger_error('Timber requires PHP 5.3.0 or greater. You have '.phpversion(), E_USER_ERROR);\n\t\t}\n\t\tif ( !class_exists('Twig\\Token') ) {\n\t\t\ttrigger_error('You have not run \"composer install\" to download required dependencies for Timber, you can read more on https://github.com/timber/timber#installation', E_USER_ERROR);\n\t\t}\n\t}", "protected function checkPHPVersion()\n\t{\n\t\tif (!empty($this->minimumPHPVersion))\n\t\t{\n\t\t\tif (defined('PHP_VERSION'))\n\t\t\t{\n\t\t\t\t$version = PHP_VERSION;\n\t\t\t}\n\t\t\telseif (function_exists('phpversion'))\n\t\t\t{\n\t\t\t\t$version = phpversion();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$version = '5.0.0'; // all bets are off!\n\t\t\t}\n\n\t\t\tif (!version_compare($version, $this->minimumPHPVersion, 'ge'))\n\t\t\t{\n\t\t\t\t$msg = \"<p>You need PHP $this->minimumPHPVersion or later to install this extension</p>\";\n\n\t\t\t\t$this->log($msg);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "protected function ldap_supported() {\n if (!function_exists('ldap_connect')) {\n return (false); \n }\n return (true);\n }", "private static function check_php() {\n\t\treturn version_compare( phpversion(), self::MINIMUM_PHP_VERSION, '>=' );\n\t}", "public function checkExtensions()\r\n\t{\r\n\t\treturn (strcasecmp(pathinfo($this->targetFile, PATHINFO_EXTENSION), pathinfo($this->referenceFile, PATHINFO_EXTENSION)) === 0);\r\n\t}", "function psswrdhsh_is_installed()\n{\n\tglobal $db, $settings;\n\n\tif (isset($settings['psswrd_cost'])) {\n\t\treturn true;\n\t}\n\n\tif ($db->field_exists('passwordhash', 'users')) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public static function checkPhpVersion()\n{\nif (version_compare(PHP_VERSION,'5.3.0') < 0)\n\t{\n\techo PHP_VERSION.': Unsupported PHP version '\n\t\t.'- PHK needs at least version 5.3.0';\n\texit(1);\n\t}\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}", "public function checkOperationality()\n {\n if (!extension_loaded('Gmagick')) {\n throw new SystemRequirementsNotMetException('Required Gmagick extension is not available.');\n }\n\n if (!class_exists('Gmagick')) {\n throw new SystemRequirementsNotMetException(\n 'Gmagick is installed, but not correctly. The class Gmagick is not available'\n );\n }\n\n $im = new \\Gmagick($this->source);\n\n if (!in_array('WEBP', $im->queryformats())) {\n throw new SystemRequirementsNotMetException('Gmagick was compiled without WebP support.');\n }\n }", "static protected function _useBCMath()\n {\n if (!function_exists('bccomp')) {\n throw new \\LogicException('BC Math extension currently is required', 1405066207);\n }\n\n return true;\n }", "public function _setupMcrypt() {\n\t\tif ( ! isset( $this->key ) ) {\n\t\t\t$this->setKey( '' );\n\t\t}\n\n\t\tparent::_setupMcrypt();\n\t}", "public function test()\n\t{\n\t\treturn (extension_loaded('memcache') && class_exists('Memcache'));\n\t}", "function mrl_check_versions()\r\n{\r\n $versions = get_option('MyReadingLibraryVersions');\r\n if (empty($versions) ||\r\n\t\t$versions['db'] < MY_READING_LIBRARY_DB ||\r\n\t\t$versions['options'] < MY_READING_LIBRARY_OPTIONS ||\r\n\t\t$versions['rewrite'] < MY_READING_LIBRARY_REWRITE)\r\n {\r\n\t\tmrl_install();\r\n }\r\n}", "private function check_multibyte_support() {\n\t\tif ( function_exists( 'mb_strlen' ) &&\n\t\t\t function_exists( 'mb_strtolower' ) &&\n\t\t\t function_exists( 'mb_substr' ) &&\n\t\t\t function_exists( 'mb_detect_encoding' ) ) {\n\t\t\treturn true;\n\t\t } else {\n\t\t \treturn false;\n\t\t }\n\t}", "public function isSupported() {\nif (extension_loaded('mysqli')) {\n\treturn true;\n}\nelse {\n\t$this->error='The mysqli extension for PHP is not installed.';\n\treturn false;\n};\n}", "public function checkRequiredVersion() {\n if (version_compare(PHP_VERSION, '4.3.2', '>=')) {\n return TRUE;\n }\n $this->logMsg(\n MSG_ERROR,\n PAPAYA_LOGTYPE_MODULES,\n 'Could not get HTML Purifier instance because this PHP version is too old.'\n );\n return FALSE;\n }", "private function checkRequirements()\n {\n if (!function_exists('mime_content_type') && !function_exists('finfo_file') && version_compare(PHP_VERSION, '5.3.0') < 0){\n add_action('admin_notices', array($this, 'displayFunctionMissingNotice'));\n return TRUE;\n }\n return TRUE;\n }", "function logonscreener_requirements() {\n if (version_compare(PHP_VERSION, '5.2.1') < 0) {\n logonscreener_log('Your PHP is too old. Go get the latest.');\n exit;\n }\n if (!function_exists('imagegd2') && (!function_exists('dl') || !@dl('php_gd2.dll'))) {\n logonscreener_log('GD is disabled.');\n }\n}", "function hasNativeSupport() \n {\n return (function_exists('zip_open') && function_exists('zip_read'));\n }", "function check() {\n\t\tglobal $wp_version;\n\t\t$requirements_met = true;\n\n\t\tif ( version_compare( $wp_version, $this->install_requirements['WordPress Version'], '<' ) ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'admin_notices_wp_version_incompatible' ) );\n\t\t\t}\n\t\t\t$requirements_met = false;\n\t\t} elseif ( version_compare( PHP_VERSION, $this->install_requirements['PHP Version'], '<' ) ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'admin_notices_php_version_incompatible' ) );\n\t\t\t}\n\t\t\t$requirements_met = false;\n\t\t} elseif ( $this->install_requirements['Multibyte'] && ! $this->check_multibyte_support() ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'admin_notices_mbstring_incompatible' ) );\n\t\t\t}\n\t\t\t$requirements_met = false;\n\t\t} elseif ( $this->install_requirements['UTF-8'] && ! $this->check_utf8_support() ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'admin_notices_charset_incompatible' ) );\n\t\t\t}\n\t\t\t$requirements_met = false;\n\t\t}\n\n\t\tif ( ! $requirements_met && is_admin() ) {\n\t\t\t// Load text domain to ensure translated admin notices.\n\t\t\tload_plugin_textdomain( 'wp-typography', false, dirname( $this->local_plugin_path ) . '/translations/' );\n\t\t\t/* add_action( 'admin_init', array( $this, 'deactivate_plugin' ) ); */\n\t\t}\n\n\t\treturn $requirements_met;\n\t}", "private function checkGDLibrary(){\n\t//Check for GD support\n\t\treturn extension_loaded('gd');\n\t}", "public static function checkInstallToolEnableFile() {}", "function moodle_minimum_php_version_is_met($haltexecution = false) {\n // PLEASE NOTE THIS FUNCTION MUST BE COMPATIBLE WITH OLD UNSUPPORTED VERSIONS OF PHP.\n // Do not use modern php features or Moodle convenience functions (e.g. localised strings).\n\n $minimumversion = '7.1.0';\n $moodlerequirementchanged = '3.7';\n\n if (version_compare(PHP_VERSION, $minimumversion) < 0) {\n if ($haltexecution) {\n $error = \"Moodle ${moodlerequirementchanged} or later requires at least PHP ${minimumversion} \"\n . \"(currently using version \" . PHP_VERSION .\").\\n\"\n . \"Some servers may have multiple PHP versions installed, are you using the correct executable?\\n\";\n\n // Our CLI scripts define CLI_SCRIPT before running this test, so make use of\n // to send error on STDERR.\n if (defined('CLI_SCRIPT') && defined('STDERR')) {\n fwrite(STDERR, $error);\n } else {\n echo $error;\n }\n exit(1);\n } else {\n return false;\n }\n }\n return true;\n}", "private static function isMbstringLoaded(): bool {\n return Multibyte::isSupported();\n }", "protected function checkSupports($ext, $resource)\n {\n if (!is_string($resource)) {\n return false;\n }\n\n $info = pathinfo($resource);\n $extension = $info['extension'];\n\n if ('dist' === $extension) {\n $extension = pathinfo($info['filename'], PATHINFO_EXTENSION);\n }\n\n if (is_string($ext)) {\n return ($ext === $extension);\n }\n\n if (is_array($ext)) {\n $supported = false;\n\n foreach ($ext as $value) {\n if ($value === $extension) {\n $supported = true;\n break;\n }\n }\n\n return $supported;\n }\n\n return false;\n }", "function isInstalled($moduleName);", "function self_check()\n\t{\n\t\tif ($gpg = $this->call('--list-config'))\n\t\t{\n\t\t\t$gpg = explode(\"\\n\", $gpg);\n\n\t\t\t// no gpg version string in the wrapper output\n\t\t\tif (is_array($gpg) === false || false === is_array($sub = explode(':', $gpg[0])))\n\t\t\t{\n\t\t\t\t return 2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($sub[0] == 'cfg' && $sub[1] == 'version')\n\t\t\t\t{\n\t\t\t\t\t// version number requirement is not met\n\t\t\t\t\tif ($sub[2] < GPG_VERSION_MIN)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 3;\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\treturn 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// no output from the backend wrapper\n\t\t\treturn 1;\n\t\t}\n\t\t// everything's okay\n\t\treturn 0;\n\t}", "public function checkExtension($extension)\n {\n $message = function ($ext) {\n sprintf('Warning: %s extension is not loaded', $ext);\n };\n\n if (is_array($extension)) {\n foreach ($extension as $ext) {\n if (!extension_loaded($ext)) {\n $this->markTestSkipped($message($ext));\n break;\n }\n }\n } elseif (!extension_loaded($extension)) {\n $this->markTestSkipped($message($extension));\n }\n }", "public function validExtension() {\t\n\t\tif(in_array($this->extension, $this->extensions)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function admin_notices_mbstring_incompatible() {\n\t\t$this->display_error_notice( __( 'The activated plugin %1$s requires the mbstring PHP extension to be enabled on your server. Please deactivate this plugin, or <a href=\"%2$s\">enable the extension</a>.', 'wp-typography' ),\n\t\t\t\t\t\t\t\t\t \"<strong>{$this->plugin_name}</strong>\",\n\t\t\t\t\t\t\t\t\t 'http://www.php.net/manual/en/mbstring.installation.php' );\n\t}", "public static function ctype_loaded(): bool\n {\n return \\extension_loaded('ctype');\n }", "public function satisfiesJSONExtension(): bool\n {\n if (function_exists('extension_loaded') && extension_loaded('json')) {\n return true;\n } else if (function_exists('json_encode')) {\n return true;\n }\n\n return false;\n }", "function checkCurlExtension()\n\t{\n\t\tif ( ! extension_loaded('curl') or ! is_callable('curl_init'))\n\t\t{\n\t\t\techo '<h3>' . __('cURL Error !', 'Gr_Integration') . '</h3>';\n\t\t\techo '<h3>' . __('GetResponse Integration Plugin requires PHP cURL extension', 'Gr_Integration') . '</h3>';\n\n\t\t\treturn;\n\t\t}\n\t}", "private static function checkServerConfiguration(): void\n {\n /**\n * As we try to handle charsets by ourself, mbstring overloads just\n * break it, see bug 1063821.\n *\n * We specifically use empty here as we are looking for anything else than\n * empty value or 0.\n */\n if (extension_loaded('mbstring') && ! empty(ini_get('mbstring.func_overload'))) {\n Core::fatalError(\n __(\n 'You have enabled mbstring.func_overload in your PHP '\n . 'configuration. This option is incompatible with phpMyAdmin '\n . 'and might cause some data to be corrupted!'\n )\n );\n }\n\n /**\n * The ini_set and ini_get functions can be disabled using\n * disable_functions but we're relying quite a lot of them.\n */\n if (function_exists('ini_get') && function_exists('ini_set')) {\n return;\n }\n\n Core::fatalError(\n __(\n 'The ini_get and/or ini_set functions are disabled in php.ini. phpMyAdmin requires these functions!'\n )\n );\n }", "public static function isSupported()\n {\n return function_exists('finfo_open');\n }", "function checkExtension($params = array(), $options = array()) {\n\t\t$val = array_shift($params);\n\t\tif (!empty($val['name'])) {\n\t\t\t$pathinfo = pathinfo($val['name'], PATHINFO_EXTENSION);\n\t\t\tif (in_array($pathinfo, $options)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "protected function checkNeededModules()\n\t{\n\t\t$modulesGot\t= array_keys( $this->env->getModules()->getAll() );\t\t\t\t\t\t\t\t// get installed modules\n\t\t$missing\t= array_diff( self::$modulesNeeded, $modulesGot );\t\t\t\t\t\t\t\t// find missing modules\n\t\tif( $missing ){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// there are missing modules\n\t\t\t$this->reportMissingModules( $missing );\t\t\t\t\t\t\t\t\t\t\t\t// report missing modules to screen\n\t\t\texit;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// quit execution\n\t\t}\n\t}" ]
[ "0.822372", "0.74715406", "0.69243866", "0.67649513", "0.6209602", "0.58711183", "0.58627963", "0.5846359", "0.5828315", "0.5824794", "0.5788872", "0.5763837", "0.5711021", "0.5707655", "0.56404537", "0.56126285", "0.5560324", "0.5558001", "0.55440444", "0.5479847", "0.54671884", "0.54611075", "0.5428535", "0.5360736", "0.534267", "0.53312004", "0.53183943", "0.5303565", "0.5298177", "0.5297574", "0.5274361", "0.52615106", "0.52582145", "0.5253478", "0.52479786", "0.52303183", "0.52187467", "0.52152705", "0.5172844", "0.51559263", "0.51471233", "0.5131167", "0.5122097", "0.5120429", "0.51022637", "0.5088754", "0.5084166", "0.50838083", "0.50793564", "0.507419", "0.5065836", "0.50589424", "0.5048422", "0.50481206", "0.5047979", "0.5046733", "0.50374925", "0.5032388", "0.5024704", "0.5003163", "0.5000854", "0.49991372", "0.49873134", "0.49591556", "0.4959078", "0.49509215", "0.49455467", "0.4944631", "0.49402258", "0.49342778", "0.49336648", "0.4927147", "0.49151742", "0.4911822", "0.49030504", "0.48784834", "0.4854181", "0.48536587", "0.48483598", "0.48338792", "0.4828545", "0.4826789", "0.48216838", "0.4818978", "0.4811268", "0.4808446", "0.47993964", "0.4790584", "0.47874716", "0.47710493", "0.47696486", "0.4768867", "0.47608078", "0.47590122", "0.4750269", "0.47466537", "0.4744268", "0.4741613", "0.47415534", "0.47409892" ]
0.8711622
0
Check either mhash extension available. Raise error if it is not.
private final function CheckMhash() { if (!function_exists("mhash")) Core::ThrowException("Cannot call mhash(). Mhash extension not installed?", E_ERROR); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private final function CheckMcrypt()\r\n\t\t{\r\n\t\t\tif (!function_exists(\"mcrypt_module_open\"))\r\n\t\t\t\tCore::ThrowException(\"Cannot call mcrypt_module_open(). Mcrypt extension not installed?\", E_ERROR);\r\n\t\t}", "public static function check_required_ext() {\r\n $shmop = extension_loaded('shmop');\r\n $sysvsem = extension_loaded('sysvsem');\r\n if ($shmop && $sysvsem) {\r\n return true;\r\n }\r\n $missing = array();\r\n if (!$shmop) {\r\n array_push($missing, 'shmop');\r\n }\r\n if (!$sysvsem) {\r\n array_push($missing, 'sysvsem');\r\n }\r\n if (count($missing) == 1) {\r\n throw new Exception('The PHP extension ' . $missing[0] . ' required by class ' . __CLASS__ . ' is not loaded or built into PHP.');\r\n }\r\n throw new Exception('The PHP extensions ' . implode(' and ', $missing) . ' required by class ' . __CLASS__ . ' are not loaded or built into PHP.');\r\n }", "public static function isMcryptAvailable()\n {\n return extension_loaded('mcrypt');\n }", "protected function checkIfNoConflictingExtensionIsInstalled() {}", "private function check_compatibility()\n\t{\n\t\tif ( ! extension_loaded( 'curl' ) || ! extension_loaded( 'json' ) )\n\t\t{\n\t\t\tthrow new CentrifugeException('There is missing dependant extensions - please ensure both cURL and JSON modules are installed');\n\t\t}\n\n\t\tif ( ! in_array( 'md5', hash_algos() ) )\n\t\t{\n\t\t\tthrow new CentrifugeException('md5 appears to be unsupported - make sure you have support for it, or upgrade your version of PHP.');\n\t\t}\n\n\t}", "private static function checkRequiredPhpExtensions(): void\n {\n /**\n * Warning about mbstring.\n */\n if (! function_exists('mb_detect_encoding')) {\n Core::warnMissingExtension('mbstring');\n }\n\n /**\n * We really need this one!\n */\n if (! function_exists('preg_replace')) {\n Core::warnMissingExtension('pcre', true);\n }\n\n /**\n * JSON is required in several places.\n */\n if (! function_exists('json_encode')) {\n Core::warnMissingExtension('json', true);\n }\n\n /**\n * ctype is required for Twig.\n */\n if (! function_exists('ctype_alpha')) {\n Core::warnMissingExtension('ctype', true);\n }\n\n /**\n * hash is required for cookie authentication.\n */\n if (function_exists('hash_hmac')) {\n return;\n }\n\n Core::warnMissingExtension('hash', true);\n }", "function isInstalled() {\r\n return extension_loaded('memcache');\r\n }", "protected function checkIfDbalExtensionIsInstalled() {}", "function cemhub_check_required_php_extensions($set_message = TRUE, $extensions_list = array(CEMHUB_EXTENSION_SSH_NAME, CEMHUB_EXTENSION_GNUPG_NAME)) {\n $return = FALSE;\n $return_extensions_status = array();\n\n foreach ($extensions_list as $extension) {\n $extension_loaded = extension_loaded($extension);\n $return_extensions_status[$extension] = $extension_loaded;\n\n if (empty($extension_loaded) && $set_message) {\n drupal_set_message(t('The extension \"%extension\" must be installed and enabled on the server.', array('%extension' => $extension)), 'warning');\n }\n }\n\n // Check results\n if (!empty($return_extensions_status)) {\n $return = in_array(FALSE, $return_extensions_status) ? FALSE : TRUE;\n }\n\n return $return;\n}", "protected static function checkFileinfoExtension()\n {\n // Make sure that the \"fileinfo\" extension is loaded/enabled\n if (!extension_loaded('fileinfo')) {\n throw new RuntimeException('Required \"fileinfo\" extension not loaded');\n }\n }", "protected function checkRequiremets () {\n\t\t// Check if `finfo_file()` function exists. File info extension is \n\t\t// presented from PHP 5.3+ by default, so this error probably never happened.\n\t\tif (!function_exists('finfo_file')) \n\t\t\treturn $this->handleUploadError(\n\t\t\t\tstatic::UPLOAD_ERR_NO_FILEINFO\n\t\t\t);\n\t\t\n\t\t// Check if mimetypes and extensions validator class\n\t\t$extToolsMimesExtsClass = static::MVCCORE_EXT_TOOLS_MIMES_EXTS_CLASS;\n\t\tif (!class_exists($extToolsMimesExtsClass)) \n\t\t\treturn $this->handleUploadError(\n\t\t\t\tstatic::UPLOAD_ERR_NO_MIMES_EXT\n\t\t\t);\n\n\t\t// Complete uploaded files temporary directory:\n\t\t$this->GetUploadsTmpDir();\n\t\t\n\t\treturn TRUE;\n\t}", "private static function BigMath_Detect() {\r\n $extensions = array(\r\n \tarray('modules' => array('gmp', 'php_gmp'),\r\n 'extension' => 'gmp',\r\n 'class' => 'BigMath_GmpMathWrapper'),\r\n \tarray('modules' => array('bcmath', 'php_bcmath'),\r\n 'extension' => 'bcmath',\r\n 'class' => 'BigMath_BcMathWrapper')\r\n );\r\n\r\n $loaded = false;\r\n foreach ($extensions as $ext) {\r\n // See if the extension specified is already loaded.\r\n if ($ext['extension'] && extension_loaded($ext['extension'])) {\r\n $loaded = true;\r\n }\r\n\r\n // Try to load dynamic modules.\r\n if (!$loaded && function_exists('dl')) {\r\n foreach ($ext['modules'] as $module) {\r\n if (@dl($module . \".\" . PHP_SHLIB_SUFFIX)) {\r\n $loaded = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if ($loaded) {\r\n return $ext;\r\n }\r\n }\r\n\r\n return false;\r\n }", "protected function _isMemcacheLoaded()\n {\n if ($this->_type == 'Zend_Cache_Backend_Memcached' &&\n !extension_loaded('memcache')) {\n throw new Zend_Exception('memcache extension is not found.'); \n }\n }", "protected function checkPhpExtensions()\n\t{\n\t\tif (!extension_loaded('pcntl'))\n\t\t{\n\t\t\techo \"Extension pcntl not loaded\";\n\t\t\texit(1);\n\t\t}\n\n\t\t// This is used to kill processes\n\t\tif (!extension_loaded('posix'))\n\t\t{\n\t\t\techo \"Extension posix not loaded\";\n\t\t\texit(1);\n\t\t}\n\t}", "public function checkExtensions()\r\n\t{\r\n\t\treturn (strcasecmp(pathinfo($this->targetFile, PATHINFO_EXTENSION), pathinfo($this->referenceFile, PATHINFO_EXTENSION)) === 0);\r\n\t}", "public function canGetExtensionKey() {\n\t\t$provider = $this->getConfigurationProviderInstance();\n\t\t$record = $this->getBasicRecord();\n\t\t$extensionKey = $provider->getExtensionKey($record);\n\t\t$this->assertNull($extensionKey);\n\t}", "public function checkExtensions()\n {\n $extensions = array(\n 'fileinfo',\n 'pdo',\n 'mbstring',\n 'tokenizer',\n 'openssl',\n 'json',\n 'curl',\n 'xml'\n );\n\n $results = array();\n\n foreach ($extensions as $extension) {\n $results[$extension] = extension_loaded($extension);\n }\n\n return $results;\n }", "public function hasMcryptSupport()\n {\n return function_exists('mcrypt_encrypt');\n }", "protected function checkModules()\n\t{\n\t\tif (Loader::includeModule('imconnector'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tShowError(Loc::getMessage('IMCONNECTOR_COMPONENT_FACEBOOK_MODULE_NOT_INSTALLED_MSGVER_1'));\n\n\t\t\treturn false;\n\t\t}\n\t}", "protected function checkRequiredPhpModules()\n {\n // Make sure BCMATH is installed to support MySQL geospatial operations\n $isBcmathInstalled = extension_loaded('bcmath');\n\n\n if (!$isBcmathInstalled)\n {\n $options = array(\n 'title_key' => 'COM_CAJOBBOARD_PIM_BCMATH_MISSING_TITLE',\n 'description_key' => 'COM_CAJOBBOARD_PIM_BCMATH_MISSING_DESC'\n );\n\n $this->setPostInstallationMessage($options);\n }\n }", "protected function checkExtension() {\n\t\t\n\t\t//If no extensions set, all are valid\n\t\tif(empty($this->valid_extensions)) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$extension = $this->getExtension();\n\t\t\n\t\treturn in_array($extension, $this->valid_extensions) ? true : false;\n\t\t\n\t}", "public function testPhpExtensionsAreValid()\n {\n $this->assert->php->extensions\n ->isLoaded('simplexml')\n ->isLoaded('fileinfo')\n ->isLoaded('xsl');\n // validate that fileinfo is loaded and configured properly\n $this->assert->php->extensions->fileinfo->isAlive();\n }", "function checkRequirements(){\n\t\n\t// IMAP is needed\n\tif(function_exists('imap_open') && function_exists('mail')){ return true; }\n\t\n\t// everything looks good!\n\treturn false;\n}", "private function checkIfBcmodIsAvailable(): bool\n {\n return function_exists('bcmod');\n }", "public function isExtensionLoaded($ext='gd') { \n return extension_loaded($ext); \n }", "public function check(): void\n {\n $headers = Helper::getHeaders();\n $hash = $headers['m-hash'] ?? null;\n $version = $headers['m-version'] ?? null;\n $time = $headers['m-time'] ?? null;\n $random = $headers['m-random'] ?? null;\n L::d('M-HASH: ' . $hash);\n L::d('M-VERSION: ' . $version);\n L::d('M-TIME: ' . $time);\n L::d('M-RANDOM: ' . $random);\n\n \\Mirage\\Libs\\RequestHash::setKey(Config::get('app.security.'));\n \\App\\Libs\\Hash::check($hash, $version, $time, $random);\n }", "function check_phpversion_for_hash(){\r\n\tif (version_compare(PHP_VERSION, '5.3.7', '<')) {\r\n\t exit(\"Sorry, Simple PHP Login does not run on a PHP version smaller than 5.3.7 !\");\r\n\t} else if (version_compare(PHP_VERSION, '5.5.0', '<')) {\r\n\t // if you are using PHP 5.3 or PHP 5.4 you have to include the password_api_compatibility_library.php\r\n\t // (this library adds the PHP 5.5 password hashing functions to older versions of PHP)\r\n\t require_once(\"password_compatibility_library.php\");\r\n\t}\r\n}", "function checkExtension($params = array(), $options = array()) {\n\t\t$val = array_shift($params);\n\t\tif (!empty($val['name'])) {\n\t\t\t$pathinfo = pathinfo($val['name'], PATHINFO_EXTENSION);\n\t\t\tif (in_array($pathinfo, $options)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function loadExtensionNode()\n {\n $extensions = $this->xml->xpathQuery('//ns:archive/ns:extension');\n\n if ($this->loopExtensions($extensions))\n {\n return true;\n }\n\n throw new \\Exception(trans('errors.missing_meta_extension', ['file' => $this->file]));\n }", "public static function mbstring_loaded(): bool\n {\n return \\extension_loaded('mbstring');\n }", "public function validExtension() {\t\n\t\tif(in_array($this->extension, $this->extensions)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected function checkSomePhpOpcodeCacheIsLoaded() {}", "public function checkExtObj() {}", "public function checkExtObj() {}", "public function hasExtension()\n {\n \treturn ( $this->_extension !== '' );\n }", "public function checkRequirements()\n\t{\n\t\t$tests = array('result' => true);\n\t\t$tests['curl'] = array('name' => $this->l('PHP cURL extension must be enabled on your server'), 'result' => extension_loaded('curl'));\n\t\t$tests['mbstring'] = array('name' => $this->l('PHP Multibyte String extension must be enabled on your server'), 'result' => extension_loaded('mbstring'));\n\t\tif (Configuration::get('STRIPE_MODE'))\n\t\t\t$tests['ssl'] = array('name' => $this->l('SSL must be enabled on your store (before entering Live mode)'), 'result' => Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS']) && Tools::strtolower($_SERVER['HTTPS']) != 'off'));\n\t\t$tests['php52'] = array('name' => $this->l('Your server must run PHP 5.3.3 or greater'), 'result' => version_compare(PHP_VERSION, '5.3.3', '>='));\n\t\t$tests['configuration'] = array('name' => $this->l('You must sign-up for Stripe and configure your account settings in the module (publishable key, secret key...etc.)'), 'result' => $this->checkSettings());\n\n\t\tif (_PS_VERSION_ < 1.5)\n\t\t{\n\t\t\t$tests['backward'] = array('name' => $this->l('You are using the backward compatibility module'), 'result' => $this->backward, 'resolution' => $this->backward_error);\n\t\t\t$tmp = Module::getInstanceByName('mobile_theme');\n\t\t\tif ($tmp && isset($tmp->version) && !version_compare($tmp->version, '0.3.8', '>='))\n\t\t\t\t$tests['mobile_version'] = array('name' => $this->l('You are currently using the default mobile template, the minimum version required is v0.3.8').' (v'.$tmp->version.' '.$this->l('detected').' - <a target=\"_blank\" href=\"http://addons.prestashop.com/en/mobile-iphone/6165-prestashop-mobile-template.html\">'.$this->l('Please Upgrade').'</a>)', 'result' => version_compare($tmp->version, '0.3.8', '>='));\n\t\t}\n\n\t\tforeach ($tests as $k => $test)\n\t\t\tif ($k != 'result' && !$test['result'])\n\t\t\t\t$tests['result'] = false;\n\n\t\treturn $tests;\n\t}", "function checkCurlExtension()\n\t{\n\t\tif ( ! extension_loaded('curl') or ! is_callable('curl_init'))\n\t\t{\n\t\t\techo '<h3>' . __('cURL Error !', 'Gr_Integration') . '</h3>';\n\t\t\techo '<h3>' . __('GetResponse Integration Plugin requires PHP cURL extension', 'Gr_Integration') . '</h3>';\n\n\t\t\treturn;\n\t\t}\n\t}", "function joe_uah_plugins_check() {\n\n\t// Set constants for active third party plugins\n\tdefine( 'JOE_UAH_MINIORANGE_2_FACTOR', class_exists( 'Miniorange_Authentication' ) );\n\n}", "public function verifyRequirements() {\n\n $problems = array(\n 'warnings' => array(),\n 'errors' => array()\n );\n\n // Requirement: PHP 5.3\n if (version_compare(phpversion(), '5.3.0') < 0) {\n $problems['errors'][] = 'PHP 5.3.0 or greater is required. Your installed version is '.phpversion().'.';\n }\n\n // Requirement: PDO\n if (!class_exists('PDO')) {\n $problems['errors'][] = 'The PHP Data Objects (PDO) extension is required.';\n }\n\n // Requirement: mod_rewrite\n if (function_exists('apache_get_modules') && !in_array('mod_rewrite', apache_get_modules())) {\n $problems['errors'][] = 'The Apache mod_rewrite module is required.';\n }\n\n // Requirement: cURL\n if (!function_exists('curl_init')) {\n $problems['errors'][] = 'The PHP cURL extension is required.';\n }\n\n // Requirement: writable config.php\n if (!is_writable($this->directory)) {\n $problems['errors'][] = 'The directory for your config.php file is not writable. Please change the permissions on this directory (through SSH or your FTP client) so it writable to all users. When this installer is completed, you can change the permissions back. The directory to make writable: <code>'.$this->directory.'</code>';\n }\n\n // Optional: json_decode\n if (!function_exists('json_decode')) {\n $problems['warnings'][] = 'Your version of PHP is missing the <code>json_decode()</code> function. This is included and enabled by default for PHP versions 5.2.0 and higher. This is only required if you want to import tweets from an official twitter archive download, otherwise Archive My Tweets can run without it.';\n }\n\n // Optional: 64-bit integers\n if (PHP_INT_SIZE != 8) {\n $problems['warnings'][] = 'Your PHP installation does not support 64 bit integers and this may cause problems for you. Support for 64 bit integers is recommended and is offered by most modern web hosts.';\n }\n\n return $problems;\n\n }", "function mrl_check_versions()\r\n{\r\n $versions = get_option('MyReadingLibraryVersions');\r\n if (empty($versions) ||\r\n\t\t$versions['db'] < MY_READING_LIBRARY_DB ||\r\n\t\t$versions['options'] < MY_READING_LIBRARY_OPTIONS ||\r\n\t\t$versions['rewrite'] < MY_READING_LIBRARY_REWRITE)\r\n {\r\n\t\tmrl_install();\r\n }\r\n}", "public function checkExtension($extension)\n {\n $message = function ($ext) {\n sprintf('Warning: %s extension is not loaded', $ext);\n };\n\n if (is_array($extension)) {\n foreach ($extension as $ext) {\n if (!extension_loaded($ext)) {\n $this->markTestSkipped($message($ext));\n break;\n }\n }\n } elseif (!extension_loaded($extension)) {\n $this->markTestSkipped($message($extension));\n }\n }", "private static function isMbstringLoaded(): bool {\n return Multibyte::isSupported();\n }", "public function satisfiesJSONExtension(): bool\n {\n if (function_exists('extension_loaded') && extension_loaded('json')) {\n return true;\n } else if (function_exists('json_encode')) {\n return true;\n }\n\n return false;\n }", "public function checkOperationality()\n {\n if (!extension_loaded('gd')) {\n throw new SystemRequirementsNotMetException('Required Gd extension is not available.');\n }\n\n if (!function_exists('imagewebp')) {\n throw new SystemRequirementsNotMetException(\n 'Gd has been compiled without webp support.'\n );\n }\n }", "private function checkRequirements()\n {\n if (!function_exists('mime_content_type') && !function_exists('finfo_file') && version_compare(PHP_VERSION, '5.3.0') < 0){\n add_action('admin_notices', array($this, 'displayFunctionMissingNotice'));\n return TRUE;\n }\n return TRUE;\n }", "protected function getMissingPhpModulesOfExtensions() {}", "private function _isExtensionInstalled($name)\n {\n if ($name == '') {\n return false;\n }\n\n $allExtensions = Mage::app()->getConfig()->getNode('modules')->asArray();\n return array_key_exists($name, $allExtensions);\n }", "function humcore_check_dependencies() {\n\n\tif ( ! in_array( 'curl', get_loaded_extensions() ) ) {\n\t\ttrigger_error( __( 'cURL is not installed on your server. In order to make this plugin work, you need to install cURL on your server.', 'humcore_domain' ), E_USER_ERROR );\n\t}\n\n}", "public function is_supported()\n\t{\n\t\tif ( ! extension_loaded('memcached'))\n\t\t{\n\t\t\tlog_message('error', 'The Memcached Extension must be loaded to use Memcached Cache.');\n\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$this->_setup_memcached();\n\t\treturn TRUE;\n\t}", "protected static function multibyte_loaded() {\n\n\t\treturn extension_loaded( 'mbstring' );\n\t}", "function isInstalled($moduleName);", "function moodle_minimum_php_version_is_met($haltexecution = false) {\n // PLEASE NOTE THIS FUNCTION MUST BE COMPATIBLE WITH OLD UNSUPPORTED VERSIONS OF PHP.\n // Do not use modern php features or Moodle convenience functions (e.g. localised strings).\n\n $minimumversion = '7.1.0';\n $moodlerequirementchanged = '3.7';\n\n if (version_compare(PHP_VERSION, $minimumversion) < 0) {\n if ($haltexecution) {\n $error = \"Moodle ${moodlerequirementchanged} or later requires at least PHP ${minimumversion} \"\n . \"(currently using version \" . PHP_VERSION .\").\\n\"\n . \"Some servers may have multiple PHP versions installed, are you using the correct executable?\\n\";\n\n // Our CLI scripts define CLI_SCRIPT before running this test, so make use of\n // to send error on STDERR.\n if (defined('CLI_SCRIPT') && defined('STDERR')) {\n fwrite(STDERR, $error);\n } else {\n echo $error;\n }\n exit(1);\n } else {\n return false;\n }\n }\n return true;\n}", "private function checkImagickLibrary(){\n\t\t//Check for Imagick support\n\t\treturn class_exists('Imagick');\n\t}", "public function checkOperationality()\n {\n $this->checkOperationalityExecTrait();\n\n if (!$this->isInstalled()) {\n throw new SystemRequirementsNotMetException(\n 'imagemagick is not installed (cannot execute: \"' . $this->getPath() . '\")'\n );\n }\n if (!$this->isWebPDelegateInstalled()) {\n throw new SystemRequirementsNotMetException('webp delegate missing');\n }\n }", "function hashExists($hash);", "public function run_hash_check() {\n add_action('plugins_loaded', array($this, 'hash_check' ));\n }", "function verifyPackageHash( &$pParamHash ){\n\t\tif( empty( $pParamHash['guid'] ) ){\n\t\t\t$this->mErrors['package'] = tra('A value for guid is required.');\n\t\t}\n\t\tif( empty( $pParamHash['dir'] ) ){\n\t\t\t$this->fatalError( 'Internal error: Unknown package directory' );\n\t\t}\n\n\t\t$pParamHash['package_store']['version'] = !empty( $pParamHash['version'] )?$pParamHash['version']:'0.0.0';\n\t\t$pParamHash['package_store']['homeable'] = (isset( $pParamHash['homeable'] ) && $pParamHash['homeable'] != TRUE)?'n':'y';\n\t\t$pParamHash['package_store']['active'] = (isset( $pParamHash['active'] ) && ( $pParamHash['active'] != TRUE || $pParamHash['active'] != 'y') )?'n':'y';\n\t\t$pParamHash['package_store']['required'] = (isset( $pParamHash['required'] ) && ( $pParamHash['required'] === TRUE || $pParamHash['required'] == 'y') )?'y':'n';\n\t\t$pParamHash['package_store']['name'] = !empty( $pParamHash['name'] )?$pParamHash['name']:ucfirst($pParamHash['guid']);\n\t\t$pParamHash['package_store']['description'] = !empty( $pParamHash['description'] )?$pParamHash['description']:NULL;\n\t\t$pParamHash['package_store']['dir'] = $pParamHash['dir'];\n\n\t\treturn( count( $this->mErrors )== 0 );\n\t}", "public function checkOperationality()\n {\n $this->checkOperationalityExecTrait();\n\n if (!$this->isInstalled()) {\n throw new SystemRequirementsNotMetException('gmagick is not installed');\n }\n if (!$this->isWebPDelegateInstalled()) {\n throw new SystemRequirementsNotMetException('webp delegate missing');\n }\n }", "protected function checkPhpExtensionEnabled($ext)\n {\n return extension_loaded($ext);\n }", "protected function check() {\n\n // check for a valid GD lib installation \n if(!function_exists('gd_info')) raise('GD Lib is not installed');\n\n }", "function verifyPluginHash( &$pParamHash ){\n\t\tif( empty( $pParamHash['guid'] ) ){\n\t\t\t$this->mErrors['plugin']['guid'] = tra('A value for guid is required.');\n\t\t}\n\n\t\tif( empty( $pParamHash['package_guid'] ) ){\n\t\t\t$this->mErrors['plugin']['package_guid'] = tra('A value for package_guid is required.');\n\t\t}\n\n\t\tif( empty( $pParamHash['handler_file'] ) ){\n\t\t\t$this->mErrors['plugin']['handler_file'] = tra('A value for handler_file is required.');\n\t\t}\n\n\t\tif( count( $this->mErrors )== 0 ){\n\t\t\t$path_type = $this->getPackagePluginSchemaValue( $pParamHash['guid'], 'path_type', $pParamHash['package_guid'] );\n\n\t\t\t$pParamHash['plugin_store']['package_guid'] = $pParamHash['package_guid'];\n\t\t\t$pParamHash['plugin_store']['version'] = !empty( $pParamHash['version'] )?$pParamHash['version']:'0.0.0';\n\t\t\t$pParamHash['plugin_store']['active'] = (isset( $pParamHash['active'] ) && ( $pParamHash['active'] != TRUE || $pParamHash['active'] != 'y') )?'n':'y';\n\t\t $pParamHash['plugin_store']['required'] = (isset( $pParamHash['required'] ) && ( $pParamHash['required'] === TRUE || $pParamHash['required'] == 'y') )?'y':'n';\n\t\t\t$pParamHash['plugin_store']['name'] = !empty( $pParamHash['name'] )?$pParamHash['name']:ucfirst($pParamHash['guid']);\n\t\t\t$pParamHash['plugin_store']['description'] = !empty( $pParamHash['description'] )?$pParamHash['description']:NULL;\n\t\t\t$pParamHash['plugin_store']['path_type'] = !empty( $path_type )?$path_type:'package'; \t\t// if no path_type set we assume it came with the package\n\t\t\t$pParamHash['plugin_store']['handler_file'] = $pParamHash['handler_file'];\n\t\t\t$pParamHash['plugin_store']['pos'] = !empty( $pParamHash['pos'] )?$pParamHash['pos']:'1';\n\t\t}\n\n\t\treturn( count( $this->mErrors )== 0 );\n\t}", "public function hasExtension($name);", "private function performMinimumRequirementsCheck()\r\n {\r\n if (version_compare(PHP_VERSION, '5.3.7', '<')) {\r\n echo \"Sorry, Simple PHP Login does not run on a PHP version older than 5.3.7 !\";\r\n } elseif (version_compare(PHP_VERSION, '5.5.0', '<')) {\r\n require_once(\"libraries/password_compatibility_library.php\");\r\n return true;\r\n } elseif (version_compare(PHP_VERSION, '5.5.0', '>=')) {\r\n return true;\r\n }\r\n // default return\r\n return false;\r\n }", "static public function check($m)\n {\n $db = Database::connect();\n \n $m = str_replace($_SERVER[\"DOCUMENT_ROOT\"], \"\", $m);\n \n $result = $db->query(\"select filename from migrations where filename = '$m'\");\n \n if($result === false) return false;\n \n if($result->num_rows == 0) return false;\n \n return true;\n }", "public function checkOperationality()\n {\n if (!extension_loaded('vips')) {\n throw new SystemRequirementsNotMetException('Required Vips extension is not available.');\n }\n\n if (!function_exists('vips_image_new_from_file')) {\n throw new SystemRequirementsNotMetException(\n 'Vips extension seems to be installed, however something is not right: ' .\n 'the function \"vips_image_new_from_file\" is not available.'\n );\n }\n\n // TODO: Should we also test if webp is available? (It seems not to be neccessary - it seems\n // that webp be well intergrated part of vips)\n }", "public function test()\n\t{\n\t\treturn (extension_loaded('memcache') && class_exists('Memcache'));\n\t}", "public static function isValidEngine(): bool\n {\n return extension_loaded('openssl') && static::class != __CLASS__;\n }", "protected function checkRequiredModules()\n\t{\n\t\t$result = true;\n\n\t\tif(!Loader::includeModule('crm'))\n\t\t{\n\t\t\t$this->errors['FATAL'][] = Loc::getMessage(\"CRM_CLE2_CRM_MODULE_NOT_INSTALL\");\n\t\t\t$result = false;\n\t\t}\n\n\t\tif(!Loader::includeModule('sale'))\n\t\t{\n\t\t\t$this->errors['FATAL'][] = Loc::getMessage(\"CRM_CLE2_SALE_MODULE_NOT_INSTALL\");\n\t\t\t$result = false;\n\t\t}\n\n\t\treturn $result;\n\t}", "static function isKnownExtension($strExtension)\n {\n if (empty(self::$arrExtensions2Mimetypes)) self::init();\n return isset(self::$arrExtensions2Mimetypes[$strExtension]);\n }", "public function extensionValid() \n\t{\n\t\tif (!in_array($this->extension_of_file, $this->file_types)) //{\n\t\t\tthrow new Exception(\"Invalid file Extension\",5);\n\t\t//}\n\t}", "public function checkOperationality()\n {\n if (!extension_loaded('Gmagick')) {\n throw new SystemRequirementsNotMetException('Required Gmagick extension is not available.');\n }\n\n if (!class_exists('Gmagick')) {\n throw new SystemRequirementsNotMetException(\n 'Gmagick is installed, but not correctly. The class Gmagick is not available'\n );\n }\n\n $im = new \\Gmagick($this->source);\n\n if (!in_array('WEBP', $im->queryformats())) {\n throw new SystemRequirementsNotMetException('Gmagick was compiled without WebP support.');\n }\n }", "public static function imagickAvailable()\n {\n return extension_loaded('imagick');\n }", "public static function isSupported()\n {\n return function_exists('finfo_open');\n }", "protected function checkSupports($ext, $resource)\n {\n if (!is_string($resource)) {\n return false;\n }\n\n $info = pathinfo($resource);\n $extension = $info['extension'];\n\n if ('dist' === $extension) {\n $extension = pathinfo($info['filename'], PATHINFO_EXTENSION);\n }\n\n if (is_string($ext)) {\n return ($ext === $extension);\n }\n\n if (is_array($ext)) {\n $supported = false;\n\n foreach ($ext as $value) {\n if ($value === $extension) {\n $supported = true;\n break;\n }\n }\n\n return $supported;\n }\n\n return false;\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}", "public function check()\n\t{\n\t\t$output = false;\n\n\t\tif($this->storage == self::STORAGE_FILE)\n\t\t{\n\n\t\t}\n\t\telseif($this->storage == self::STORAGE_APC)\n\t\t{\n\t\t\t$output = apc_exists($this->key);\n\t\t}\n\t\telseif($this->storage == self::STORAGE_REDIS)\n\t\t{\n\t\t\tif(self::$redis != null)\n\t\t\t\t$output = self::$redis->exists($key);\n\t\t}\n\t\telseif($this->storage == self::STORAGE_MEMCACHED)\n\t\t{\n\t\t\tif(self::$memcached != null)\n\t\t\t\t$output = self::$memcached->get($key) !== false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->storageException();\n\t\t}\n\n\t\treturn $output;\n\t}", "public function checkContentHash() {}", "function self_check()\n\t{\n\t\tif ($gpg = $this->call('--list-config'))\n\t\t{\n\t\t\t$gpg = explode(\"\\n\", $gpg);\n\n\t\t\t// no gpg version string in the wrapper output\n\t\t\tif (is_array($gpg) === false || false === is_array($sub = explode(':', $gpg[0])))\n\t\t\t{\n\t\t\t\t return 2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($sub[0] == 'cfg' && $sub[1] == 'version')\n\t\t\t\t{\n\t\t\t\t\t// version number requirement is not met\n\t\t\t\t\tif ($sub[2] < GPG_VERSION_MIN)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 3;\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\treturn 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// no output from the backend wrapper\n\t\t\treturn 1;\n\t\t}\n\t\t// everything's okay\n\t\treturn 0;\n\t}", "function is_memcache_ok($request)\n\t{\n\t\t$ci = &get_instance();\n\t\t$ci->load->driver('cache', ['adapter' => 'memcached']);\n\n\t\tset_error_handler(function($errno, $errstr) { \n\t\t\tif ($errno == 8)\n\t\t\t\tthrow new ErrorException('Memcached Server not available');\n\t\t\telse\n\t\t\t\tthrow new ErrorException($errstr);\n\t\t});\n\n\t\ttry {\n\t\t\tif (!$ci->cache->memcached->is_supported())\n\t\t\t\tthrow new ErrorException('Memcached not supported');\n\n\t\t}\tcatch (ErrorException $e) {\n\t\t\t$request->memcache = FALSE;\n\t\t\treturn [FALSE, ['message' => $e->getMessage()]];\n\t\t} \n\n\t\ttry {\n\t\t\t$ci->cache->memcached->cache_info();\n\t\t\trestore_error_handler();\n\n\t\t}\tcatch (ErrorException $e) {\n\t\t\t$request->memcache = FALSE;\n\t\t\treturn [FALSE, ['message' => $e->getMessage()]];\n\t\t} \n\n\t\t$request->memcache = TRUE;\n\t\treturn [TRUE, NULL];\n\t}", "function hideforums_is_installed() {\n\tglobal $mybb;\n\t\n\tif(empty($mybb->settings['hideforum_fid'])) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "public static function checkRequirements()\n {\n $extensions = array('curl', 'json');\n \n foreach ($extensions as $extension) {\n if (!extension_loaded($extension)) {\n throw new Everypay_Exception_RuntimeException(\n 'You need the PHP ' . $extension\n . ' extension in order to use EveryPay PHP Library'\n );\n }\n }\n }", "public function checkRequirements()\n\t{\n\t\t$installedMySqlVersion = blx()->db->serverVersion;\n\t\t$requiredMySqlVersion = blx()->params['requiredMysqlVersion'];\n\t\t$requiredPhpVersion = blx()->params['requiredPhpVersion'];\n\n\t\t$phpCompat = version_compare(PHP_VERSION, $requiredPhpVersion, '>=');\n\t\t$databaseCompat = version_compare($installedMySqlVersion, $requiredMySqlVersion, '>=');\n\n\t\tif (!$phpCompat && !$databaseCompat)\n\t\t{\n\t\t\tthrow new Exception(Blocks::t('The update can’t be installed because Blocks requires PHP version \"{requiredPhpVersion}\" or higher and MySQL version \"{requiredMySqlVersion}\" or higher. You have PHP version \"{installedPhpVersion}\" and MySQL version \"{installedMySqlVersion}\" installed.',\n\t\t\t\tarray('requiredPhpVersion' => $requiredMySqlVersion,\n\t\t\t\t 'installedPhpVersion' => PHP_VERSION,\n\t\t\t\t 'requiredMySqlVersion' => $requiredMySqlVersion,\n\t\t\t\t 'installedMySqlVersion' => $installedMySqlVersion\n\t\t\t\t)));\n\t\t}\n\t\telse if (!$phpCompat)\n\t\t{\n\t\t\tthrow new Exception(Blocks::t('The update can’t be installed because Blocks requires PHP version \"{requiredPhpVersion}\" or higher and you have PHP version \"{installedPhpVersion}\" installed.',\n\t\t\t\tarray('requiredPhpVersion' => $requiredMySqlVersion,\n\t\t\t\t 'installedPhpVersion' => PHP_VERSION\n\t\t\t)));\n\t\t}\n\t\telse if (!$databaseCompat)\n\t\t{\n\t\t\tthrow new Exception(Blocks::t('The update can’t be installed because Blocks requires MySQL version \"{requiredMySqlVersion}\" or higher and you have MySQL version \"{installedMySqlVersion}\" installed.',\n\t\t\t\tarray('requiredMySqlVersion' => $requiredMySqlVersion,\n\t\t\t\t 'installedMySqlVersion' => $installedMySqlVersion\n\t\t\t\t)));\n\t\t}\n\t}", "protected function checkOpenSslInstalled() {}", "protected function checkExt(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_Ext) && $this->_Ext !== '' ) {\n\t\t\t$inMessage .= \"{$this->_Ext} is not a valid value for Ext\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\tif ( $isValid && strlen($this->_Ext) > 8 ) {\n\t\t\t$inMessage .= \"Ext cannot be more than 8 characters\";\n\t\t\t$isValid = false;\n\t\t}\n\t\tif ( $isValid && strlen($this->_Ext) <= 1 ) {\n\t\t\t$inMessage .= \"Ext must be more than 1 character\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\t\t\t\n\t\treturn $isValid;\n\t}", "public function testExtensionLoaded(): void\n {\n $info = $this->createProvider(false)->getInformation();\n $this->assertEquals(true, $info['extension_loaded']);\n }", "private function checkForModuleOrFunctionException():void\n {\n // check for module and function error\n if ($this->hasError()) {\n //check for bad module\n $this->moduleExceptionChecker();\n\n //check for bad function\n $this->functionExceptionChecker();\n }\n }", "public function checkOperationality()\n {\n if (!extension_loaded('imagick')) {\n throw new SystemRequirementsNotMetException('Required iMagick extension is not available.');\n }\n\n if (!class_exists('\\\\Imagick')) {\n throw new SystemRequirementsNotMetException(\n 'iMagick is installed, but not correctly. The class Imagick is not available'\n );\n }\n\n $im = new \\Imagick();\n if (!in_array('WEBP', $im->queryFormats('WEBP'))) {\n throw new SystemRequirementsNotMetException('iMagick was compiled without WebP support.');\n }\n }", "static public function isSupported();", "public function check() {\n\t\trequire_once 'PEAR/Registry.php';\n\t\t$registry = new PEAR_Registry();\n\n\t\t$installedVersion = $registry->packageInfo($this->name, 'version', $this->channel);\n\t\tif (is_null($installedVersion)) {\n\t\t\t$this->log('Package \"'.$this->name.'\" from \"'.$this->channel.'\" is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\tif ($this->min && version_compare($installedVersion, $this->min, '<')) {\n\t\t\t$this->log('Package \"'.$this->name.'\" from \"'.$this->channel.'\" is '.$installedVersion.'. >= '.$this->min.' is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\tif ($this->max && (version_compare($installedVersion, $this->max, '>'))) {\n\t\t\t$this->log('Package \"'.$this->name.'\" from \"'.$this->channel.'\" is '.$installedVersion.'. <= '.$this->max.' is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\t$this->log('Package \"'.$this->name.'\" '.$installedVersion.' is passed', Project::MSG_VERBOSE);\n\n\t\treturn 0;\n\t}", "public function hasPackageManager() {}", "function check_definitions() {\n\tglobal $config, $install_errors;\n\tif(is_localhost()) return true;\n\t\n\t// Crypt salt\n\tif(!check_value(__CHV_CRYPT_SALT__)) {\n\t\t$install_errors[] = 'You need to set <code>__CHV_CRYPT_SALT__</code> in <code>includes/definitions.php</code>. You only need to change this only the first time you install Chevereto';\n\t}\n\tif(__CHV_CRYPT_SALT__=='changeme') {\n\t\t$install_errors[] = 'You haven\\'t changed the default <code>__CHV_CRYPT_SALT__</code>. Please set this value in <code>includes/definitions.php</code>';\n\t}\n\tif(count($install_errors)==0) return true;\n}", "public static function finfo_loaded(): bool\n {\n return \\class_exists('finfo');\n }", "public function checkDependencies($text = NULL, $key = NULL) {\n $errors = [];\n\n if (!function_exists('mcrypt_encrypt')) {\n $errors[] = t('MCrypt library not installed.');\n }\n\n // Check if we have a 128 bit key.\n if (strlen($key) != 16) {\n $errors[] = t('This encryption method requires a 128 bit key.');\n }\n\n return $errors;\n }", "private static function check_php() {\n\t\treturn version_compare( phpversion(), self::MINIMUM_PHP_VERSION, '>=' );\n\t}", "public function isInstalled($code) {\n\t\t$extension_data = array();\n\t\t$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"extension WHERE `code` = '\" . $this->db->escape($code) . \"'\");\n\t\tif($query->row) {\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\t\n\t}", "private function check_multibyte_support() {\n\t\tif ( function_exists( 'mb_strlen' ) &&\n\t\t\t function_exists( 'mb_strtolower' ) &&\n\t\t\t function_exists( 'mb_substr' ) &&\n\t\t\t function_exists( 'mb_detect_encoding' ) ) {\n\t\t\treturn true;\n\t\t } else {\n\t\t \treturn false;\n\t\t }\n\t}", "static public function check($m) {\n $database = new Database();\n $db = $database->getPDO();\n\n if(!$database->findTable(\"migrations\")) return false;\n\n $m = basename($m);\n \n $result = $db->query(\"select filename from migrations where filename = '$m'\");\n \n if($result === false) return false;\n \n if($result->rowCount() == 0) return false;\n \n return true;\n }", "public function has_imagick_extension() {\n\n return extension_loaded( 'imagick' );\n\n }", "function is_valid_extension ($ext) {\n $ext = strtolower($ext);\n return (is_valid_image_extension($ext) || is_valid_audio_extension($ext)\n || is_valid_video_extension($ext));\n }", "protected function checkNeededModules()\n\t{\n\t\t$modulesGot\t= array_keys( $this->env->getModules()->getAll() );\t\t\t\t\t\t\t\t// get installed modules\n\t\t$missing\t= array_diff( self::$modulesNeeded, $modulesGot );\t\t\t\t\t\t\t\t// find missing modules\n\t\tif( $missing ){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// there are missing modules\n\t\t\t$this->reportMissingModules( $missing );\t\t\t\t\t\t\t\t\t\t\t\t// report missing modules to screen\n\t\t\texit;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// quit execution\n\t\t}\n\t}" ]
[ "0.7037407", "0.67537683", "0.6377983", "0.632037", "0.6145247", "0.6110083", "0.59524125", "0.591202", "0.5854063", "0.5798832", "0.57865995", "0.57492507", "0.5705619", "0.5688724", "0.5661279", "0.56564444", "0.56506306", "0.55960387", "0.558342", "0.55797994", "0.5559096", "0.55427295", "0.54572827", "0.5442187", "0.53793794", "0.53679484", "0.5364104", "0.53340083", "0.52906096", "0.5289657", "0.52718556", "0.5266472", "0.5249893", "0.52480286", "0.5245427", "0.521809", "0.52157986", "0.520755", "0.51859635", "0.518471", "0.51733696", "0.5164472", "0.5141645", "0.51403373", "0.5137317", "0.51346606", "0.51271415", "0.5118953", "0.5111942", "0.51111627", "0.5109486", "0.5103848", "0.5102091", "0.5095195", "0.50949943", "0.5094311", "0.5090387", "0.50903326", "0.50824714", "0.5075817", "0.505912", "0.5054513", "0.5048038", "0.5047453", "0.5047157", "0.5046449", "0.5037765", "0.5024838", "0.50179815", "0.5015827", "0.50144804", "0.5007186", "0.5005236", "0.49995545", "0.4987928", "0.498645", "0.49856526", "0.49605575", "0.49558833", "0.49270377", "0.49218893", "0.49186093", "0.49109933", "0.49083975", "0.49067998", "0.49061716", "0.4902898", "0.48990658", "0.48984647", "0.4890256", "0.48812097", "0.48770747", "0.48737404", "0.48728108", "0.48653552", "0.48626554", "0.4862123", "0.48616523", "0.4860198", "0.48581892" ]
0.8488658
0
Encrypt string using $this>CryptoAlgo
public final function Encrypt($input, $key=NULL) { if (!$key) $key = $this->Key; $key = substr($key, 0, 24); $this->CheckMcrypt(); try { $tdes = mcrypt_module_open($this->CryptoAlgo, '', 'ecb', ''); $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($tdes), MCRYPT_RAND); mcrypt_generic_init($tdes, $key, $iv); $ct = mcrypt_generic($tdes, $input); mcrypt_module_close($tdes); $retval=base64_encode($ct); } catch (Exception $e) { Core::ThrowException("Crypto::Encrypt throwed exception: {$e->getMessage()}", E_ERROR); } return ($retval); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function encrypt();", "function encrypt($string, $key=KEY) {\n return base64_encode(encrypt_string($string, $key));\n }", "function encrypt($string) {\n\t\t\t$iv = $this->_generate_iv();\n\t\t\t\n\t\t\t// Clear output\n\t\t\t$out = '';\n\t\t\t\n\t\t\t// First block of output is ($this->hash_hey XOR IV)\n\t\t\tfor($c=0;$c < $this->hash_length;$c++) {\n\t\t\t\t$out .= chr(ord($iv[$c]) ^ ord($this->hash_key[$c]));\n\t\t\t}\n\t\n\t\t\t// Use IV as first key\n\t\t\t$key = $iv;\n\t\t\t$c = 0;\n\t\n\t\t\t// Go through input string\n\t\t\twhile($c < strlen($string)) {\n\t\t\t\t// If we have used all characters of the current key we switch to a new one\n\t\t\t\tif(($c != 0) and ($c % $this->hash_length == 0)) {\n\t\t\t\t\t// New key is the hash of current key and last block of plaintext\n\t\t\t\t\t$key = $this->_hash($key . substr($string,$c - $this->hash_length,$this->hash_length));\n\t\t\t\t}\n\t\t\t\t// Generate output by xor-ing input and key character for character\n\t\t\t\t$out .= chr(ord($key[$c % $this->hash_length]) ^ ord($string[$c]));\n\t\t\t\t$c++;\n\t\t\t}\n\t\t\t// Apply base64 encoding if necessary\n\t\t\tif($this->base64) $out = base64_encode($out);\n\t\t\treturn $out;\n\t\t}", "protected function _encrypt()\n {\n switch ($this->_cypherUsed) {\n case self::CYPHER_BASIC:\n //break ommited on purpose\n default:\n $string = $this->_plainText;\n $result = '';\n for ($i = 0; $i < strlen($string); $i++) {\n $char = substr($string, $i, 1);\n $keychar = substr($this->_keyString, ($i % strlen($this->_keyString)) - 1, 1);\n $char = chr(ord($char) + ord($keychar));\n $result .= $char;\n }\n $this->_encryptedText = base64_encode($result);\n break;\n }\n }", "function simple_encrypt($text){\n \treturn base64_encode(openssl_encrypt($text, \"AES-256-CTR\", \"GhratnaXbS\", 0, \"0123456789abcdef\"));\n }", "abstract public function encrypt($data);", "protected static function encryption($string){\n $output=FALSE;\n $key=hash('sha256', SECRET_KEY);\n $iv=substr(hash('sha256', SECRET_IV), 0, 16);\n $output=openssl_encrypt($string, METHOD, $key, 0, $iv);\n $output=base64_encode($output);\n return $output;\n }", "private function encrypt($string) {\r\n if ($this->settings[\"encryption\"]) {\r\n $string = $string . $this->settings[\"salt\"];\r\n return base64_encode($string);\r\n }\r\n return $string;\r\n }", "function encrypt($str) {\n return Crypt::encrypt($str);\n}", "public function encrypt() \r\n {\r\n //TODO: Implement encrypt method\r\n }", "public function encryption($encryption);", "function encrypt($decrepted_string, $encrytion_key){\r\n $ciphering = \"AES-128-CTR\";\r\n $options = 0;\r\n $encryption_iv = '1234567891011121';\r\n $string = openssl_encrypt($decrepted_string, $ciphering, $encrytion_key, $options, $encryption_iv);\r\n return $string;\r\n}", "public function encrypt($string = null) {\r\n return strtr(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, 'PR3t5mupEger2TebretrU3AZek2s8ta', $string, MCRYPT_MODE_ECB)), '+/=', '-_.');\r\n }", "function MyJamiaEncrypt($str) {\n\t\t\n\t\t// Store the cipher method \n\t\t$ciphering = \"AES-128-CTR\"; \n \n\t\t// Use OpenSSl Encryption method \n\t\t$iv_length = openssl_cipher_iv_length($ciphering); \n\t\t$options = 0; \n \n\t\t// Non-NULL Initialization Vector for encryption \n\t\t$encryption_iv = '1234567891011121'; \n \n\t\t// Store the encryption key \n\t\t$encryption_key = \"MyJamiaEncryptionString\"; \n \n\t\t// Use openssl_encrypt() function to encrypt the data \n\t\treturn openssl_encrypt($str, $ciphering, \n\t\t $encryption_key, $options, $encryption_iv); \n \t}", "public static function encrypt($string) {\n $secret_key = Config::get('constants.DEFAULT_DATA.ENC_SECRET');\n $output = false;\n\n $encrypt_method = \"AES-256-CBC\";\n $secret_iv = 'This is my secret iv';\n\n // hash\n $key = hash('sha256', $secret_key);\n\n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n return base64_encode($output);\n }", "public function encrypt($string)\n {\n $key = $this->secretKey;\n //using hexadecimal\n $key = pack('H*', (string)$key);\n\n //$keySize = self::getKeySize($key);\n $iv = self::getIv();\n $cipherText = self::getCipherText($string, $key, $iv);\n\n //prepend the IV for it to be available for decryption\n $cipherText = $iv.$cipherText;\n\n return self::encode($cipherText);\n }", "public function encrypt($string)\n\t{\n\t\tglobal $mybb;\n\n\t\t$key = $mybb->config['pluginuploader_ftp_key'];\n\n\t\treturn base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key))));\n\t}", "function encrypt($string) { \r\n\tglobal $key;\r\n\t$result = Cryptor::Encrypt($string,$key);\r\n\treturn $result;\r\n}", "public function encrypt_encode($string = '', $key = false){\n if($key){\n return base64_encode( $this->encrypt->encode($string, $key) );\n }else{\n return base64_encode( $this->encrypt->encode($string) );\n }\n \n }", "function encrypt($pure_string, $encryption_key) {\n\t\t$iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n\t\t$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\t\t$encrypted_string = mcrypt_encrypt(MCRYPT_BLOWFISH, $encryption_key, utf8_encode($pure_string), MCRYPT_MODE_ECB, $iv);\n\t\treturn $encrypted_string;\n\t}", "public function encryptString($data, $param = null);", "function encrypt($string)\n{\n\t$hash = md5($string);\n\t$blok1 = substr($hash, 0,8);\n\t$blok2 = substr($hash, 8,8);\n\t$blok3 = substr($hash, 16,4);\n\t$blok4 = substr($hash, 20,4);\n\t$blok5 = substr($hash, 24,8);\n\n\treturn $blok2.'-'.$blok4.'-'.$blok5.'-'.$blok3.'-'.$blok1;\n}", "function encrypt($pure_string, $encryption_key) {\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $encrypted_string = mcrypt_encrypt(MCRYPT_BLOWFISH, $encryption_key, utf8_encode($pure_string), MCRYPT_MODE_ECB, $iv);\n return $encrypted_string;\n }", "public function encrypt(string $data) : string\n {\n $iv = $this->generate();\n $encrypted = sodium_crypto_secretbox($data, $iv, $this->appKey);\n\n if (empty($encrypted)) {\n throw new EncrypterException('Failed to encrypt the requested data');\n }\n\n $json = Jso::hay(['iv' => base64_encode($iv),\n 'data' => base64_encode($encrypted),\n 'mac' => $this->hash($encrypted, $iv)\n ])->encode( JSON_UNESCAPED_SLASHES );\n\n if (! Jso::valid()) {\n throw new EncrypterException('Failed to encode the requested data');\n }\n\n sodium_memzero($iv);\n return base64_encode($json);\n }", "function customEncrypt($text, $key)\n {\n return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, padEncryptionSalt($key), $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));\n }", "function ehash_encrypt($pure_string, $encryption_key) {\n \n\tif (empty($pure_string)) {\n return '';\n }\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $encrypted_string = base64_encode(mcrypt_encrypt(MCRYPT_BLOWFISH, $encryption_key, $pure_string, MCRYPT_MODE_ECB, $iv));\n \n return $encrypted_string;\n}", "private function encrypt($data) {\n\t\treturn Authenticator_Crypto::encrypt($data);\n\t}", "protected function string_encrypt($string) {\n $ivlen = openssl_cipher_iv_length($this->cipher);\n // Create an iv with the length of ivlen\n $iv = random_bytes($ivlen);\n // Encrypt the provided string\n $encrypted = openssl_encrypt($string, $this->cipher, env('APP_KEY'), $options=0, $iv);\n // Prepend the base64 encoded iv to the encrypted data separated with a \":\" as delimiter\n $encrypted = base64_encode($iv).\":\".$encrypted;\n return $encrypted;\n }", "function encrypt($string, $key)\n{ \n\t$result = '';\n\tfor($i=0; $i<strlen($string); $i++)\n\t{\n\t\t$char = substr($string, $i, 1);\n\t\t$keychar = substr($key, ($i % strlen($key))-1, 1);\n\t\t$char = chr(ord($char)+ord($keychar));\n\t\t$result.=$char;\n\t}\n\treturn base64_encode($result);\n}", "function simple_encode($data, $passwd, $method='aes-128-cbc', $options=0, $iv='SomeA1AweS0meK5y') {\n return openssl_encrypt ($data, $method, $passwd, $options, $iv);\n}", "protected function encrypt($str)\n { \n \n return md5($str);\n }", "function encrypt(string $string): string\n{\n $blowfishSalt = bin2hex(openssl_random_pseudo_bytes(22));\n $hash = crypt($string, \"$2y$12$\" . $blowfishSalt);\n\n return $hash;\n}", "function encrypt_string($string, $key=KEY) {\n $iv = mcrypt_create_iv(cipher_iv_size(), MCRYPT_RAND);\n // Needs a key of length 16, 24, or 32\n $key = str_pad($key, 32, '*');\n\n // Encrypt\n $encrypted = mcrypt_encrypt(CIPHER_TYPE, $key, $string, CIPHER_MODE, $iv);\n\n // Return $iv at front of string, need it for decoding\n return $iv . $encrypted;\n }", "protected function encriptar($string){\n //La función md5() permite encriptar el string\n return md5($string);\n }", "public function encryptor($action, $string) {\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n //pls set your unique hashing key\n $secret_key = 'chinu';\n $secret_iv = 'uk';\n\n // hash\n $key = hash('sha256', $secret_key);\n\n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n //do the encyption given text/string/number\n if ($action == 'encrypt') {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n } else if ($action == 'decrypt') {\n //decrypt the given text/string/number\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n }", "function Encrypt($string, $key='')\t{\r\n\t\tglobal $global_config;\r\n\t\t\r\n\t\tif($key == '')\r\n\t\t\t$key = $global_config[\"en_decrypt_keys\"];\r\n\t\t$result = '';\r\n\t\tfor($i=1; $i<=strlen($string); $i++){\r\n\t\t\t$char = substr($string, $i-1, 1);\r\n\t\t\t$keychar = substr($key, ($i % strlen($key))-1, 1);\r\n\t\t\t$char = chr(ord($char)+ord($keychar));\r\n\t\t\t$result.=$char;\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public static function encrypt($data)\n {\n $simple_string = $data ;//this->getData();\n\n // Storingthe cipher method \n $ciphering = self::$ENCRYPTION_ALGORITHM; // \"AES-128-CTR\";\n\n // Using OpenSSl Encryption method \n $iv_length = openssl_cipher_iv_length($ciphering);\n $options = 0;\n\n // Non-NULL Initialization Vector for encryption \n $encryption_iv = self::$encrypt_iv;//'617263616e67656c3c336d696572';\n\n // Storing the encryption key \n $encryption_key = self::getKey();\n\n // Using openssl_encrypt() function to encrypt the data \n $encryption = openssl_encrypt($simple_string, $ciphering, $encryption_key, $options, $encryption_iv);\n return $encryption;\n }", "function my_simple_crypt( $string, $action = 'd') {\n $secret_key = 'my_simple_secret_key';\n $secret_iv = 'my_simple_secret_iv';\n \n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $key = hash( 'sha256', $secret_key );\n $iv = substr( hash( 'sha256', $secret_iv ), 0, 16 );\n \n if( $action == 'e' ) {\n $output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) );\n }\n else if( $action == 'd' ){\n $output = openssl_decrypt( base64_decode( $string ), $encrypt_method, $key, 0, $iv );\n }\n \n return $output;\n }", "public static function encrypt($string = \"\") {\n\t\t$salt = G::module ()->salt;\n\t\t$hashFunc = G::module ()->hashFunc;\n\t\t$string = sprintf ( \"%s%s%s\", $salt, $string, $salt );\n\t\t\n\t\tif (! function_exists ( $hashFunc ))\n\t\t\tthrow new CException ( 'Function `' . $hashFunc . '` is not a valid callback for hashing algorithm.' );\n\t\t\n\t\treturn $hashFunc ( $string );\n\t}", "function encrypt($str, $key) {\n $key = str_pad($key, 16);\n //$key = $this->hex2bin($key);\n $iv = $this->iv;\n\n $td = mcrypt_module_open('rijndael-128', '', 'cbc', $iv);\n\n mcrypt_generic_init($td, $key, $iv);\n $encrypted = mcrypt_generic($td, $str);\n\n mcrypt_generic_deinit($td);\n mcrypt_module_close($td);\n\n return bin2hex($encrypted);\n }", "function encrypt($plaintext)\n {\n switch ($this->encryptionMode) {\n case self::ENCRYPTION_NONE:\n $plaintext = str_split($plaintext, $this->k);\n $ciphertext = '';\n foreach ($plaintext as $m) {\n $ciphertext.= $this->_raw_encrypt($m);\n }\n return $ciphertext;\n case self::ENCRYPTION_PKCS1:\n $length = $this->k - 11;\n if ($length <= 0) {\n return false;\n }\n\n $plaintext = str_split($plaintext, $length);\n $ciphertext = '';\n foreach ($plaintext as $m) {\n $ciphertext.= $this->_rsaes_pkcs1_v1_5_encrypt($m);\n }\n return $ciphertext;\n //case self::ENCRYPTION_OAEP:\n default:\n $length = $this->k - 2 * $this->hLen - 2;\n if ($length <= 0) {\n return false;\n }\n\n $plaintext = str_split($plaintext, $length);\n $ciphertext = '';\n foreach ($plaintext as $m) {\n $ciphertext.= $this->_rsaes_oaep_encrypt($m);\n }\n return $ciphertext;\n }\n }", "function my_simple_crypt($string, $action = 'e')\n{\n $secret_key = 'my_simple_secret_key';\n $secret_iv = 'my_simple_secret_iv';\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $key = hash('sha256', $secret_key);\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if ($action == 'e') {\n $output = base64_encode(openssl_encrypt($string, $encrypt_method, $key, 0, $iv));\n } else if ($action == 'd') {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n}", "public static function encrypt(string $inputVal):string\n\t{\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));\n $encrypted = openssl_encrypt($inputVal, 'aes-256-cbc', self::$securekey, 0, $iv);\n return base64_encode($encrypted . '::' . $iv);\n\t}", "static function encrypt($data){\n # Setup the initialization vector\n $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n # Encrypt the data\n $encryptedMessage = openssl_encrypt($data, \"AES-256-CBC\", self::getEncryptKey(), 0, $iv);\n return base64_encode($encryptedMessage.'~~~'.$iv);\n }", "function EncodeMcrypt( $string )\n\t{\n\t\t$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);\n\t\t$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\t\t$result = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->key, $string, MCRYPT_MODE_ECB, $iv);\n\t\treturn $result;\n\t}", "function encrypt($string, $password) {\n $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($password), $string, MCRYPT_MODE_CBC, md5(md5($password))));\n return $encrypted;\n}", "protected function _crypt($data, $algorithm, $param = null, $encrypt = true) {}", "public function encryption($store = null);", "function fsl_encrypt($string, $key = NULL){\n\n //set key to default key if no key passed to function \n $encryption_key = (empty($key)) ? option('fsl_global_encryption_key') : $key;\n\n // Generate an initialization vector\n // This *MUST* be available for decryption as well\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));\n\n // Create some data to encrypt\n \n // Encrypt $data using aes-256-cbc cipher with the given encryption key and\n // our initialization vector. The 0 gives us the default options, but can\n // be changed to OPENSSL_RAW_DATA or OPENSSL_ZERO_PADDING\n $encrypted = openssl_encrypt($string, 'aes-256-cbc', $encryption_key, 0, $iv);\n\n // If we lose the $iv variable, we can't decrypt this, so:\n // - $encrypted is already base64-encoded from openssl_encrypt\n // - Append a separator that we know won't exist in base64, \":\"\n // - And then append a base64-encoded $iv\n $encrypted = $encrypted . ':' . base64_encode($iv);\n\n return $encrypted;\n}", "public function Encrypt($input) {\n $text_arr = str_split($input, $this->bit_check); \n //bit_check - jumlah string dari text_arr index terakhir di kurangi 1\n $text_num = $this->bit_check - strlen($text_arr[count($text_arr) - 1]);\n //loops\n for($a = 1; $a < $text_num; $a++){\n //update input dengan menambahkan character specifik dengan integer text_num\n $input = $input .chr($text_num);\n }\n //encrypt dengan Mcrypt\n $chiper = mcrypt_module_open('rijndael-128', '', 'cbc', '');\n mcrypt_generic_init($chiper, $this->key, $this->iv);\n $encrypted_data = mcrypt_generic($chiper, $input);\n mcrypt_generic_deinit($chiper);\n mcrypt_module_close($chiper);\n //return encrypt data with base64\n return base64_encode($encrypted_data);\n }", "protected function encryptValue($value){ \n $cipher = $this->handler->encrypt($value);\n return base64_encode($cipher);\n }", "public function encryptPass()\n {\n return \"RASAHolaRSSA\";\n }", "public function encrypt($data)\n {\n // Remove the base64 encoding from our key\n $encryption_key = base64_decode($this->key);\n // Generate an initialization vector\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));\n // Encrypt the data using AES 256 encryption in CBC mode using our encryption key and initialization vector.\n $encrypted = openssl_encrypt($data, 'aes-256-cbc', $encryption_key,\n 0, $iv);\n // The $iv is just as important as the key for decrypting, so save it with our encrypted data using a unique separator (::)\n return base64_encode($encrypted.'::'.$iv);\n }", "public function encrypt($data)\n {\n return Crypto::encrypt($data, $this->key);\n }", "public function encrypt($data)\n {\n if (empty($data)) {\n $this->has_error = true;\n return false;\n }\n\n // Decode crypt keys\n $first_key = base64_decode($this->config['main_key']);\n $second_key = base64_decode($this->config['assured_key']);\n\n // Create an IV for encryption\n $iv_length = openssl_cipher_iv_length($this->encrypt_fst_method);\n $iv = openssl_random_pseudo_bytes($iv_length);\n\n // Encrypt for first time with first crypt key\n $first_encrypted = openssl_encrypt($data, $this->encrypt_fst_method, $first_key, OPENSSL_RAW_DATA, $iv);\n // Encrypt first encryption for second time with second crypt key\n $second_encrypted = hash_hmac($this->encrypt_snd_method, $first_encrypted, $second_key, TRUE);\n\n // Encode second crypted data to base64 with created IV\n $output = base64_encode($iv . $second_encrypted . $first_encrypted);\n\n // Return the crypted value\n $this->has_error = false;\n return $output;\n }", "function encrypt_user_info($string) {\n if ($string) {\n \t$encryption_conf = config_item('user_encryption');\n\n \t//get encryption configurations from config\n $key = $encryption_conf['key'];\n $method = $encryption_conf['method'];\n $iv = $encryption_conf['iv'];\n $output = openssl_encrypt($string, $method, $key, 0, $iv);\n\n return $output;\n }\n}", "public function encrypt() {\n $str = Input::get ( 'value' );\n $task = new My_task;\n $result = $task->encrypt($str);\n return $result;\n }", "public function encrypt($text)\n\t{\n\t\t// check that an iv is set, if required by the mode\n\t\t$this->mode->checkIV();\n\n\t\t// the encryption is done inside the mode\n\t\t$this->mode->encrypt($text);\n\t\treturn $text;\n\t}", "public function encrypt($data, $deterministic);", "public function encender();", "function encrypt_data($str){\n\treturn md5($str);\n}", "public function my_simple_crypt( $string, $action = 'e' ) {\n $secret_key = env('SECRET_KEY');\n $secret_iv = env('SECRET_IV');\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $key = substr( hash( 'sha256', $secret_key ), 0 ,32);\n $iv = substr( hash( 'sha256', $secret_iv ), 0, 16 );\n\n if( $action == 'e' ) {\n $output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) );\n }\n else if( $action == 'd' ){\n $output = openssl_decrypt( base64_decode( $string ), $encrypt_method, $key, 0, $iv );\n }\n return $output;\n }", "public static function encrypt($data)\r\n {\r\n return base64_encode(\r\n openssl_encrypt(\r\n $data,\r\n self::OPENSSL_CIPHER_NAME,\r\n self::ENCRYPTION_KEY,\r\n OPENSSL_RAW_DATA,\r\n self::ENCRYPTION_IV\r\n )\r\n );\r\n }", "function Encrypt($str)\n {\n //$blowfish = new Crypt_Blowfish($this->config->encr_key);\n $retdata = sfm_crypt_encrypt($str,$this->config->encr_key);\n /*$blowfish =& Crypt_Blowfish::factory('ecb');\n $blowfish->setKey($this->config->encr_key);\n\n $encr = $blowfish->encrypt($str);\n $retdata = bin2hex($encr);*/\n return $retdata;\n }", "function encript($password){\n\t$password_md5 = md5($password);\n\t$enc_password = crypt($password,$password_md5);\n\treturn $enc_password;\n}", "function encrypt($plain){\n return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->key, $plain, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));\n }", "public static function encryptString($data)\n {\n $encrypted = Crypt::encryptString($data);\n return $encrypted;\n }", "public static function encryptString($key, $string)\n {\n if (strlen($key) < 4)\n {\n throw new \\Exception('Please provide a key that is more than 3 characters');\n }\n\n $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, self::pad_key($key),\n $string, MCRYPT_MODE_CBC, $iv);\n $ciphertext = $iv . $ciphertext;\n $ciphertext_base64 = base64_encode($ciphertext);\n\n return $ciphertext_base64;\n }", "static public function encrypting($value)\n {\n return Crypt::encryptString($value);\n }", "function crypt_data($string, $action = 'e') \n{\n $secret_key \t= \"@#@ @@&&*$ bhufjg *@ !@#432 3783\"; // 32bits\n\n $secret_iv \t\t= md5('sA*(DH');\n $secret_iv \t\t= md5($secret_iv);\n\n $output \t\t= false;\n $encrypt_method = \"AES-256-CBC\";\n $key \t\t\t= hash('sha256', $secret_key);\n $iv \t\t\t= substr(hash('sha256', $secret_iv), 0, 16);\n\n \n if ($action == 'e') {\n $output = base64_encode(openssl_encrypt($string, $encrypt_method, $key, 0, $iv));\n } elseif ($action == 'd') {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n}", "public static function encrypt($string, $isBinary = false) {\n\t\treturn abacaEncrypt ( $string, 'ENCODE', self::$key );\n\t}", "function crypter($data){\n\t$a = base64_encode($data);\n\treturn $a;\n}", "function encryptAES($content, $secret){\n return openssl_encrypt($content, \"AES-256-CBC\", $secret);\n}", "function encrypt($plaintext)\n {\n $plaintext = strtolower($plaintext);\n $ciphertext = \"\";\n \n for ( $i = 0; $i < strlen($plaintext); $i++ )\n {\n $x = $this->alphabet->indexOf($plaintext[$i]);\n $encodedIndex = mod(($x + $this->shift), $this->alphabet->sizeOf());\n $ciphertext = $ciphertext . ($this->alphabet->get($encodedIndex)[0]);\n }\n return $ciphertext;\n }", "public function encrypt($plaintext) {\n\t\t\n\t\t$key = self::PWD; // Password is set above at the Constants\n\t\t$ivlen = openssl_cipher_iv_length($cipher=\"AES-256-CTR\");\n\t\t$iv = openssl_random_pseudo_bytes($ivlen);\n\t\t$ciphertext_raw = openssl_encrypt($plaintext, $cipher, $key, $options=OPENSSL_RAW_DATA, $iv);\n\t\t$hmac = hash_hmac('sha256', $ciphertext_raw, $key, $as_binary=true);\n\t\t$ciphertext = base64_encode($iv.$hmac.$ciphertext_raw );\n\t\n\t\treturn bin2hex($ciphertext);\n\t\n\t}", "public function encrypt($plain){\t\n return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->key, $plain, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));\n }", "function km200_Encrypt( $encryptData ) \n{ \n $blocksize = 16;\n $encrypt_padchar = $blocksize - ( strlen( $encryptData ) % $blocksize ); \n $encryptData .= str_repeat( chr( $encrypt_padchar ), $encrypt_padchar ); \n \n return base64_encode(\n openssl_encrypt(\n $encryptData,\n \"aes-256-ecb\",\n km200_crypt_key_private,\n OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING\n )\n );\n}", "function encrypt( $input,$securekey ) {\n\n \t\t$pkinput = $this->addPKCS5Padding( $input );\n \t\t$crypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $securekey, $pkinput, MCRYPT_MODE_CBC, $securekey);\n \t\treturn \"@\" . bin2hex( $crypt );\n\n\t\t}", "public function encrypt($message)\n {\n if (is_null($message)) {\n return $message;\n }\n\n $init_size = \\openssl_cipher_iv_length($this->cipher);\n $init_vect = \\openssl_random_pseudo_bytes($init_size);\n\n $message_padded = $message;\n if (strlen($message_padded) % $init_size) {\n $padLength = strlen($message_padded) + $init_size - strlen($message_padded) % $init_size;\n $message_padded = str_pad($message_padded, $padLength, \"\\0\");\n }\n\n $value = \\openssl_encrypt(\n $message_padded,\n $this->cipher,\n $this->getKey(),\n $this->encryptOptions,\n $init_vect\n );\n $value = $this->addCipherNoise($init_vect . $value, $this->getKey());\n\n return trim(base64_encode($value));\n }", "public static function encrypt($pure_string) {\n return Encryption::encryptWKey($pure_string, Encryption::_Key1());\n }", "public function encrypt($data) {\n\t\treturn md5(md5($data));\n\t}", "public static function encrypt($value) {\n $self = self::getInstance();\n $encripted = base64_encode(Security::cipher($value, $self->key));\n return \"U3BhZ2hldHRp.{$encripted}\";\n }", "public function encrypt($plainText, $secretKey);", "public function enc($data)\n {\n return $this->_simplify('encrypt', $data);\n }", "public static function keyBasedEncrypt($value){\n $securityKey = Yii::$app->params['SecuritySaltKey'];\n return base64_encode(Yii::$app->security->hashData($value, $securityKey));\n }", "public static function encriptar( $plainString ){\n return $plainString;\n }", "function encryptIt( $q ) {\n\t$code = str_replace( \"@\", \"!!!\", $q );\n\t$code = str_replace( \".\", \"=\", $code );\n\t$code = str_rot13( $code );\n\treturn ( $code );\n}", "public function encrypt($iv, $data, &$tag = null, $aad = '');", "public static function encryptWKey($pure_string, $encryption_key) {\n $encrypted_string =str_rot13($pure_string);\n $encrypted_string = gzdeflate($encrypted_string);\n $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $encrypted_string = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $encryption_key, utf8_encode($pure_string), MCRYPT_MODE_ECB, $iv);\n return base64_encode($encrypted_string);\n\n }", "public function getEncryptionAlgo() {\n\treturn $this->cipher;\n }", "function acf_encrypt($data = '')\n{\n}", "public function encrypt($plaintext)\n {\n $crypttext = '';\n if (!openssl_public_encrypt($plaintext, $crypttext,\n $this->getPublicKey())) {\n $err = openssl_error_string();\n if (!empty($err)) {\n throw new \\Exception($err);\n }\n }\n return base64_encode($crypttext);\n }", "static public function encryptString($plaintext_string, $key_name) {\n $kms = self::getService();\n $base64_encoded_json = base64_encode($plaintext_string);\n $request = new \\Google_Service_CloudKMS_EncryptRequest();\n $request->setPlaintext($base64_encoded_json);\n $response = $kms->projects_locations_keyRings_cryptoKeys->encrypt(\n $key_name,\n $request\n );\n return $response['ciphertext'];\n }", "public function defaultencode($string) {\n $this->ci->load->library('encrypt');\n $data = $this->ci->encrypt->encode($string);\n $data = str_replace(array('+', '/', '='), array('-', '_', '~'), $data);\n return $data;\n }", "public function encryptString($value)\n {\n return $this->encrypt($value, false);\n }", "function breach_encode($str)\n{\n if (!function_exists(\"mcrypt_create_iv\")) {\n trigger_error(\n \"Required function is missing: mcrypt_create_iv()\",\n E_USER_ERROR\n );\n }\n\n $pad = mcrypt_create_iv(strlen($str), MCRYPT_DEV_URANDOM);\n $encoded = \"\";\n for ($i = 0; $i < strlen($str); $i++) {\n $encoded .= chr(ord($str[$i]) ^ ord($pad[$i]));\n }\n return bin2hex($pad . $encoded);\n}", "function encryptData($data)\n{\n $cypher = \"aes-256-cbc\";\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($cypher));\n $key = base64_encode(gethostname());\n\n\n\n return openssl_encrypt($data,$cypher,$key,0,$iv);\n}", "function mc_encrypt($encrypt, $key){\n $encrypt = serialize($encrypt);\n $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM);\n $key = pack('H*', $key);\n $mac = hash_hmac('sha256', $encrypt, substr(bin2hex($key), -32));\n $passcrypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $encrypt.$mac, MCRYPT_MODE_CBC, $iv);\n $encoded = base64_encode($passcrypt).'|'.base64_encode($iv);\n return $encoded;\n }", "function encrypt($plaintext, $passphrase, $iv) {\n try {\n $padded_str = pad_pkcs5($plaintext);\n $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $passphrase, $padded_str, MCRYPT_MODE_CBC, $iv);\n return $ciphertext;\n } catch (Exception $e) {\n echo \"Encryption exception in encrypt: \" . $e->getMessage() . \"\\n\";\n }\n}", "public static function encrypt($string, $encryptKeyID = null, $armour = true){\n\t\t$config = ConfigManager::getConfig(\"Crypto\",\"GPG\")->AuxConfig;\n\n\t\t$gpg = new Crypt_GPG(array('homedir' => $config->gpgHomeDir));\n\t\t\n\t\tif($encryptKeyID === null){\n\t\t\t$encryptKeyID = $config->defaultPublicKey;\n\t\t}\n\t\t\n\t\tif(is_array($encryptKeyID)){\n\t\t\tforeach($encryptKeyID as $keyId){\n\t\t\t\t$gpg->addEncryptKey($keyId);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$gpg->addEncryptKey($encryptKeyID);\n\t\t}\n\n\t\treturn $gpg->encrypt($string, $armour);\n\t}" ]
[ "0.77666605", "0.76723963", "0.74969244", "0.7493838", "0.7493661", "0.74429214", "0.74035674", "0.73754996", "0.73554194", "0.72790396", "0.72592235", "0.7248895", "0.72438896", "0.71886593", "0.7163703", "0.71291137", "0.706429", "0.7046658", "0.69943786", "0.6922685", "0.6913623", "0.69124115", "0.6898666", "0.6874335", "0.68703073", "0.68596596", "0.6853024", "0.6848821", "0.6830372", "0.6808009", "0.6803163", "0.68020505", "0.6794938", "0.67624", "0.67563474", "0.67556757", "0.67525256", "0.6749293", "0.67359257", "0.6733878", "0.6733404", "0.6722176", "0.6704028", "0.66779107", "0.66500527", "0.6631859", "0.6629852", "0.66140264", "0.6612735", "0.65974104", "0.6594644", "0.65850765", "0.65823853", "0.6565268", "0.6552077", "0.65405196", "0.6539125", "0.653834", "0.6537103", "0.6536326", "0.65262955", "0.65232825", "0.6511256", "0.650452", "0.6497882", "0.6496952", "0.64959407", "0.6487384", "0.6479555", "0.6470193", "0.6464356", "0.6442582", "0.64361316", "0.642698", "0.6416048", "0.64092654", "0.6402967", "0.6388931", "0.63874793", "0.63844323", "0.6376149", "0.6365288", "0.6333455", "0.6326773", "0.63233966", "0.63155043", "0.6307996", "0.6300834", "0.62961787", "0.6285204", "0.62718457", "0.6268032", "0.62595576", "0.62567174", "0.62543994", "0.6241773", "0.6240287", "0.62264436", "0.6216173", "0.6205049" ]
0.67467535
38
Decrypt string, previously encrypted using 3DES
public final function Decrypt($input, $key=null) { if (!$key) $key = $this->Key; $this->CheckMcrypt(); $inputd = base64_decode($input); try { $td = mcrypt_module_open($this->CryptoAlgo, '', 'ecb', ''); $key = substr($key, 0, mcrypt_enc_get_key_size($td)); $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $key, $iv); $retval = mdecrypt_generic($td, $inputd); mcrypt_generic_deinit($td); mcrypt_module_close($td); } catch (Exception $e) { return false; } return trim($retval, "\x00..\x1F"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function decrypt($string)\n {\n /*\n * ------------------------------------------------\n * ALGORITHMS\n * ------------------------------------------------\n * MCRYPT_3DES MCRYPT_PANAMA\n * MCRYPT_ARCFOUR MCRYPT_RAND\n * MCRYPT_ARCFOUR_IV MCRYPT_RC2\n * MCRYPT_BLOWFISH MCRYPT_RC6\n * MCRYPT_BLOWFISH_COMPAT MCRYPT_RIJNDAEL_128\n * MCRYPT_CAST_128 MCRYPT_RIJNDAEL_192\n * MCRYPT_CAST_256 MCRYPT_RIJNDAEL_256\n * MCRYPT_CRYPT MCRYPT_SAFER128\n * MCRYPT_DECRYPT MCRYPT_SAFER64\n * MCRYPT_DES MCRYPT_SAFERPLUS\n * MCRYPT_DEV_RANDOM MCRYPT_SERPENT\n * MCRYPT_DEV_URANDOM MCRYPT_SKIPJACK\n * MCRYPT_ENCRYPT MCRYPT_THREEWAY\n * MCRYPT_ENIGNA MCRYPT_TRIPLEDES\n * MCRYPT_GOST MCRYPT_TWOFISH\n * MCRYPT_IDEA MCRYPT_WAKE\n * MCRYPT_LOKI97 MCRYPT_XTEA\n * MCRYPT_MARS\n * ------------------------------------------------\n * MODES\n * ------------------------------------------------\n * MCRYPT_MODE_CBC MCRYPT_MODE_NOFB\n * MCRYPT_MODE_CFB MCRYPT_MODE_OFB\n * MCRYPT_MODE_ECB MCRYPT_MODE_STREAM\n */\n \n $algorithm = MCRYPT_RIJNDAEL_256;\n $mode = MCRYPT_MODE_ECB;\n $iv_size = mcrypt_get_iv_size ($algorithm, $mode );\n\t$iv = mcrypt_create_iv ( $iv_size, MCRYPT_RAND );\n\t$key = \"Curso-Yii2-Capa8tv\";\n\t\t\t\t\n\t$encrypt = base64_decode ( $string );\n\t\t\t\t\n\treturn MCRYPT_DECRYPT ( $algorithm, $key, $encrypt, $mode, $iv );\n }", "public function decrypt3DES($text, $key) {\n $key = base64_decode($key);\n $str = $this->hex2bin($text);\n $size = mcrypt_get_iv_size(MCRYPT_3DES, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($size, MCRYPT_RAND);\n $decrypted = mcrypt_decrypt(MCRYPT_3DES, $key, $str, MCRYPT_MODE_ECB, $iv);\n $info = rtrim($this->pkcs5_unpad($decrypted));\n\t\t//log_message('error', 'data decrypt: ' . print_r($info, true));\n return $info;\n }", "public function decrypt($string)\n\t{\n\t\tglobal $mybb;\n\n\t\t$key = $mybb->config['pluginuploader_ftp_key'];\n\n\t\treturn rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), \"\\0\");\n\t}", "public function decrypt();", "public function decrypt($string)\n {\n $key = $this->secretKey;\n //using hexadecimal\n $key = pack('H*', (string)$key);\n\n $cipherText = self::decode($string);\n\n $ivSize = self::getIvSize();\n //retrieves the IV, iv_size should be created using mcrypt_get_iv_size()\n $iv = substr($cipherText, 0, $ivSize);\n\n //retrieves the cipher text (everything except the $iv_size in the front)\n $cipherText = substr($cipherText, $ivSize);\n $decrypted = self::getPlainText($cipherText, $key, $iv);\n $decrypted = rtrim($decrypted, \"\\0\\4\");\n\n return $decrypted;\n }", "function decrypt($string) {\n\t\t\t// Apply base64 decoding if necessary\n\t\t\tif($this->base64) $string = base64_decode($string);\n\t\t\t\n\t\t\t// Extract encrypted IV from input\n\t\t\t$tmp_iv = substr($string,0,$this->hash_length);\n\t\t\t\n\t\t\t// Extract encrypted message from input\n\t\t\t$string = substr($string,$this->hash_length,strlen($string) - $this->hash_length);\n\t\t\t$iv = $out = '';\n\t\t\t\n\t\t\t// Regenerate IV by xor-ing encrypted IV from block 1 and $this->hashed_key\n\t\t\t// Mathematics: (IV XOR KeY) XOR Key = IV\n\t\t\tfor($c=0;$c < $this->hash_length;$c++) \n\t\t\t{\n\t\t\t\t$iv .= chr(ord($tmp_iv[$c]) ^ ord($this->hash_key[$c]));\n\t\t\t}\n\t\t\t// Use IV as key for decrypting the first block cyphertext\n\t\t\t$key = $iv;\n\t\t\t$c = 0;\n\t\t\t\n\t\t\t// Loop through the whole input string\n\t\t\twhile($c < strlen($string)) {\n\t\t\t\t// If we have used all characters of the current key we switch to a new one\n\t\t\t\tif(($c != 0) and ($c % $this->hash_length == 0)) {\n\t\t\t\t\t// New key is the hash of current key and last block of plaintext\n\t\t\t\t\t$key = $this->_hash($key . substr($out,$c - $this->hash_length,$this->hash_length));\n\t\t\t\t}\n\t\t\t\t// Generate output by xor-ing input and key character for character\n\t\t\t\t$out .= chr(ord($key[$c % $this->hash_length]) ^ ord($string[$c]));\n\t\t\t\t$c++;\n\t\t\t}\n\t\t\treturn $out;\n\t\t}", "public static function decrypt($string) {\n\t\treturn abacaEncrypt ( $string, 'DECODE', self::$key );\n\t}", "function fsl_decrypt($string, $key = NULL){\n\n //set key to default key if no key passed to function \n $encryption_key = (empty($key)) ? option('fsl_global_encryption_key') : $key;\n\n // To decrypt, separate the encrypted data from the initialization vector ($iv).\n $parts = explode(':', $string);\n\n // Don't forget to base64-decode the $iv before feeding it back to\n //openssl_decrypt\n $decrypted = openssl_decrypt($parts[0], 'aes-256-cbc', $encryption_key, 0, base64_decode($parts[1]));\n return $decrypted;\n}", "public static function des_encrypt( $string )\n {\n $key = array();\n $tmp = array();\n $length = strlen( $string );\n\n for( $i = 0; $i < 7; ++$i ) $tmp[] = $i < $length ? ord( $string[$i] ) : 0;\n\n $key[] = $tmp[0] & 254;\n $key[] = ( $tmp[0] << 7 ) | ( $tmp[1] >> 1 );\n $key[] = ( $tmp[1] << 6 ) | ( $tmp[2] >> 2 );\n $key[] = ( $tmp[2] << 5 ) | ( $tmp[3] >> 3 );\n $key[] = ( $tmp[3] << 4 ) | ( $tmp[4] >> 4 );\n $key[] = ( $tmp[4] << 3 ) | ( $tmp[5] >> 5 );\n $key[] = ( $tmp[5] << 2 ) | ( $tmp[6] >> 6 );\n $key[] = $tmp[6] << 1;\n \n $key0 = '';\n \n foreach( $key as $k ) $key0 .= chr( $k );\n $crypt = mcrypt_encrypt(\n MCRYPT_DES, $key0, 'KGS!@#$%', MCRYPT_MODE_ECB,\n mcrypt_create_iv( mcrypt_get_iv_size( MCRYPT_DES, MCRYPT_MODE_ECB ), MCRYPT_RAND ) );\n\n return bin2hex( $crypt );\n }", "private function decrypt($string) {\r\n if ($this->settings[\"encryption\"]) {\r\n $string = base64_decode($string);\r\n return str_replace($this->settings[\"salt\"], \"\", $string);\r\n }\r\n return $string;\r\n }", "public static function decrypt($string) {\n $secret_key = Config::get('constants.DEFAULT_DATA.ENC_SECRET');\n $output = false;\n\n $encrypt_method = \"AES-256-CBC\";\n $secret_iv = 'This is my secret iv';\n\n // hash\n $key = hash('sha256', $secret_key);\n\n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n return openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }", "abstract public function decrypt($data);", "function DecodeMcrypt( $string )\n\t{\n\t\t$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);\n\t\t$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\t\t$result = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->key, $string, MCRYPT_MODE_ECB, $iv);\n\t\t$result = rtrim($result, \"\\0\");\n\t\treturn $result;\n\t}", "protected static function decryption($string){\n $key=hash('sha256', SECRET_KEY);\n $iv=substr(hash('sha256', SECRET_IV), 0, 16);\n $output=openssl_decrypt(base64_decode($string), METHOD, $key, 0, $iv);\n return $output;\n }", "public static function decryptString($key, $string)\n {\n if (strlen($key) < 4)\n {\n throw new \\Exception('Please provide a key that is more than 3 characters');\n }\n $ciphertext_dec = base64_decode($string);\n $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n $iv_dec = substr($ciphertext_dec, 0, $iv_size);\n $ciphertext_dec = substr($ciphertext_dec, $iv_size);\n $plaintext_dec = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, self::pad_key($key),\n $ciphertext_dec, MCRYPT_MODE_CBC, $iv_dec);\n\n return $plaintext_dec;\n }", "function Decrypt($string, $key=''){\r\n\t\tglobal $global_config;\r\n\t\t\r\n\t\tif($key == '')\r\n\t\t\t$key = $global_config[\"en_decrypt_keys\"];\r\n\t\t$result = '';\r\n\t\tfor($i=1; $i<=strlen($string); $i++){\r\n\t\t\t$char = substr($string, $i-1, 1);\r\n\t\t\t$keychar = substr($key, ($i % strlen($key))-1, 1);\r\n\t\t\t$char = chr(ord($char)-ord($keychar));\r\n\t\t\t$result.=$char;\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "function BASE64URL_symmetric_decipher($dato, $key, $vector)\n\t{\n $tamVI = strlen($vector);\n\n if($tamVI != 16){\n trigger_error(\"Initialization Vector must have 16 hexadecimal characters\", E_USER_ERROR);\n return null;\n }\n if(strlen($key) != 16){\n trigger_error(\"Simetric Key doesn't have length of 16\", E_USER_ERROR);\n\n return null;\n }\n\n $binvi = pack(\"H*\", $vector);\n\n if($binvi == null){\n trigger_error(\"Initialization Vector is not valid, must contain only hexadecimal characters\", E_USER_ERROR);\n\n return null;\n\n }\n $key .= substr($key,0,8); // agrega los primeros 8 bytes al final\n\n $pas = preg_replace('/_/','/',$dato);\n $pas = preg_replace('/-/','+',$pas);\n $pas = preg_replace('/\\./','=',$pas);\n\n $crypttext = base64_decode($pas);\n\n $crypttext2 = mcrypt_decrypt(MCRYPT_3DES, $key, $crypttext, MCRYPT_MODE_CBC, $binvi);\n\n\n $block = mcrypt_get_block_size('tripledes', 'cbc');\n $packing = ord($crypttext2{strlen($crypttext2) - 1});\n if($packing and ($packing < $block))\n {\n for($P = strlen($crypttext2) - 1; $P >= strlen($crypttext2) - $packing; $P--)\n {\n if(ord($crypttext2{$P}) != $packing)\n {\n $packing = 0;\n }\n }\n }\n\n $crypttext2 = substr($crypttext2,0,strlen($crypttext2) - $packing);\n return $crypttext2;\n\t}", "public static function decryptData($input, $key_seed)\n {\n $input = base64_decode($input);\n $key = substr(md5($key_seed), 0, 24);\n $text = mcrypt_decrypt(MCRYPT_TRIPLEDES, $key, $input, MCRYPT_MODE_ECB, '12345678');\n $block = mcrypt_get_block_size('tripledes', 'ecb');\n $packing = ord($text{strlen($text) - 1});\n if ($packing and ($packing < $block)) {\n for ($P = strlen($text) - 1; $P >= strlen($text) - $packing; $P--) {\n if (ord($text{$P}) != $packing) {\n $packing = 0;\n }\n }\n }\n $text = substr($text, 0, strlen($text) - $packing);\n return $text;\n }", "function decrypt($cypher){\n\t\t$cypher =str_replace('%20','+',str_replace(' ','+',$cypher));\t\t\t\n\t\treturn trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->key, base64_decode($cypher), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));\n }", "protected function _decrypt() {}", "protected function _decrypt() {}", "public function testDecrypt_des()\n\t{\n\t $this->Crypt_MCrypt->method = 'des';\n\t $encrypted = mcrypt_encrypt('des', 's3cret', \"a test string\", MCRYPT_MODE_ECB);\n\t\t$this->assertEquals(\"a test string\", $this->Crypt_MCrypt->decrypt($encrypted));\n\t}", "public function decryptString($data, $param = null);", "static function decrypt($encrypted){\n # Separate the encrypted data from the initialization vector ($iv)\n $data = explode('~~~', base64_decode($encrypted));\n # Decrypt the data\n if(isset($data[1])){\n $decryptedMessage = openssl_decrypt($data[0], \"AES-256-CBC\", self::getEncryptKey(), 0, $data[1]);\n return $decryptedMessage;\n } else {\n return $encrypted;\n }\n }", "public function decrypt($cypher){\n\t\t$cypher = str_replace('%20','+',str_replace(' ','+',$cypher));\t\t\t\n\t\treturn trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->key, base64_decode($cypher), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));\n }", "public static function decrypt(string $encyptedInput):string\n\t{\n list($encrypted_data, $iv) = explode('::', base64_decode($encyptedInput), 2);\n return openssl_decrypt($encrypted_data, 'aes-256-cbc', self::$securekey, 0, $iv);\n }", "function decrypt($encrypted_string, $decryption_key){\r\n $ciphering = \"AES-128-CTR\";\r\n $options = 0;\r\n $decryption_iv = '1234567891011121';\r\n $string = openssl_decrypt ($encrypted_string, $ciphering, $decryption_key, $options, $decryption_iv);\r\n return $string;\r\n}", "function decrypt($string, $key)\n{ \n\t$result = '';\n\t$string = base64_decode($string);\n\tfor($i=0; $i<strlen($string); $i++)\n\t{\n\t\t$char = substr($string, $i, 1);\n\t\t$keychar = substr($key, ($i % strlen($key))-1, 1);\n\t\t$char = chr(ord($char)-ord($keychar));\n\t\t$result.=$char;\n\t}\n\treturn $result;\n}", "protected function _decrypt()\n {\n switch ($this->_cypherUsed) {\n case self::CYPHER_BASIC:\n //break ommited on purpose\n\n default:\n $result = '';\n $string = base64_decode($this->_encryptedText);\n for ($i = 0; $i < strlen($string); $i++) {\n $char = substr($string, $i, 1);\n $keychar = substr($this->_keyString, ($i % strlen($this->_keyString)) - 1, 1);\n $char = chr(ord($char) - ord($keychar));\n $result .= $char;\n }\n $this->_plainText = $result;\n break;\n }\n }", "public function decrypt(): string\n {\n $decrypted = openssl_decrypt(\n $this->encryptedString,\n $this->encryptionMethod,\n $this->salt,\n 0,\n $this->getInitializationVector(),\n );\n\n assert(is_string($decrypted)); // Make phpstan happy\n\n return $decrypted;\n }", "function MyJamiaDecrypt($str) {\n\n\t\t// Store the cipher method \n\t\t$ciphering = \"AES-128-CTR\"; \n \n\t\t// Use OpenSSl Encryption method \n\t\t$iv_length = openssl_cipher_iv_length($ciphering); \n\t\t$options = 0; \n\t\t\t\t\n\t\t// Non-NULL Initialization Vector for decryption \n\t\t$decryption_iv = '1234567891011121'; \n\t\t \n\t\t// Store the decryption key \n\t\t$decryption_key = \"MyJamiaEncryptionString\"; \n\t\t \n\t\t// Use openssl_decrypt() function to decrypt the data \n\t\treturn openssl_decrypt ($str, $ciphering, \n\t\t $decryption_key, $options, $decryption_iv); \t \n\t}", "function decrypt_string($iv_with_string, $key=KEY) {\n $iv = substr($iv_with_string, 0, cipher_iv_size());\n $encrypted = substr($iv_with_string, cipher_iv_size());\n // Needs a key of length 16, 24, or 32\n $key = str_pad($key, 32, '*');\n\n // Decrypt\n return mcrypt_decrypt(CIPHER_TYPE, $key, $encrypted, CIPHER_MODE, $iv);\n }", "function decrypt($string, $key='humanbody_messages_2') {\r\n $result = '';\r\n $string = base64_decode($string);\r\n for($i=0; $i<strlen($string); $i++) {\r\n $char = substr($string, $i, 1);\r\n $keychar = substr($key, ($i % strlen($key))-1, 1);\r\n $char = chr(ord($char)-ord($keychar));\r\n $result.=$char;\r\n }\r\n return $result;\r\n }", "public function decrypt($text)\n\t{\n\t\t// check that an iv is set, if required by the mode\n\t\t$this->mode->checkIV();\n\n\t\t// the decryption is done inside the mode\n\t\t$this->mode->decrypt($text);\n\t\treturn $text;\n\t}", "public function decrypt($data, $deterministic);", "function decrypt($encrypted_string, $encryption_key) {\n\t\t$iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n\t\t$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\t\t$decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n\t\treturn $decrypted_string;\n\t}", "public function decrypt(string $cipher, ?string $nonce = null, string $additionalData = null): string;", "function decrypt( $crypttext )\n\t{\n\t\t$priv_key = $this->RsaPrivateKey;\n\t\t$tt = explode( \":::\", $crypttext );\n\t\t$cnt = count( $tt );\n\t\t$i = 0;\n\t\t$str = '';\n\t\twhile( $i < $cnt )\n\t\t{\n\t\t\topenssl_private_decrypt( $tt[$i], $str1, $priv_key );\n\t\t\t$str .= $str1;\n\t\t\t$i++;\n\t\t}\n\t\treturn $str;\n\t}", "function md5_decrypt( $enc_text, $password, $iv_len = 16 )\n\t{\n \t$enc_text = base64_decode( $enc_text );\n \t$n = strlen( $enc_text );\n \t$i = $iv_len;\n \t$plain_text = '';\n \t$iv = substr( $password ^ substr( $enc_text, 0, $iv_len ), 0, 512 );\n \twhile ( $i < $n )\n \t{\n \t$block = substr( $enc_text, $i, 16 );\n \t$plain_text .= $block ^ pack( 'H*', md5( $iv ) );\n \t$iv = substr( $block . $iv, 0, 512 ) ^ $password;\n \t$i += 16;\n \t}\n \treturn preg_replace( '/\\\\x13\\\\x00*$/', '', $plain_text );\n\t}", "function decrypt_file_url($encrypted_string) {\n \t$encryption_conf = config_item('encryption');\n\n\t//get encryption configurations from config\n $key = $encryption_conf['key'];\n $method = $encryption_conf['method'];\n $iv = $encryption_conf['iv'];\n $output = openssl_decrypt(base64_decode($encrypted_string), $method, $key, 0, $iv);\n\n return $output;\n}", "function decrypt($encrypted_string, $encryption_key) {\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n return $decrypted_string;\n }", "function decryptData($data, $key) {\r\n $chiper = \"des-ede3\"; //Algorthim used to decrypt\r\n $data = $this->hex2ByteArray($data);\r\n $data = $this->byteArray2String($data);\r\n $data = base64_encode($data);\r\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($chiper));\r\n $decrypted = openssl_decrypt($data, $chiper, $key, OPENSSL_ZERO_PADDING,$iv);\r\n return $decrypted;\r\n}", "public function decrypt() \r\n {\r\n //TODO: Implement decrypt method\r\n }", "function decrypt($string, $key = 'mykey', $secret = 'SecretKey', $method = 'AES-256-CBC') {\n // hash\n $key = hash('sha256', $key);\n // create iv - encrypt method AES-256-CBC expects 16 bytes\n $iv = substr(hash('sha256', $secret), 0, 16);\n // decode\n $string = base64_decode($string);\n // decrypt\n return openssl_decrypt($string, $method, $key, 0, $iv);\n }", "function decryptValue($dval){\n\t\n\t\t//Decode value\n\t\t$dval = base64_decode($dval);\n\t\n\t\t$dnum = strlen($dval);\n\t\t$dnumIndex1 = $dnum-1;\n\t\t$dval1 = \"\";\n\t\n\t\t//Reverse the order of characters\n\t\tfor($x=0;$x<strlen($dval);$x++){\n\t\t\t$dval1.= substr($dval,$dnumIndex1,1);\n\t\t\t$dnumIndex1--;\n\t\t}\n\t\treturn $dval1;\n\t}", "public static function decrypt($encrypted_string_b64) {\n return Encryption::decryptWKey($encrypted_string_b64, Encryption::_Key1());\n }", "function decrypt($string) { \r\n\tglobal $key;\r\n\t$result = Cryptor::Decrypt($string,$key);\r\n\treturn $result;\r\n}", "function ehash_decrypt($encrypted_string, $encryption_key) {\n \n\tif (empty($encrypted_string)) {\n return '';\n }\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $encrypted_string = base64_decode($encrypted_string);\n $decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n \n return $decrypted_string;\n}", "function m_decrypt($encrypted_string, $encryption_key) {\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n return $decrypted_string;\n}", "private function _decryptSymmetric($encData, $alias, $password, $options)\n {\n $data = '';\n $key = null;\n \n $processedOpts = $this->_processSymmetricOptions($options);\n try {\n $key = $this->_getKey($alias, $password);\n \n /* Open the cipher */\n $td = mcrypt_module_open(\n $processedOpts[self::OPT_CIPHER], \n '', \n $processedOpts[self::OPT_MODE], \n ''\n );\n \n // get IV from beginning of encrypted string\n $ivsize = mcrypt_enc_get_iv_size($td);\n $iv = pack(\n 'H*', \n substr(\n $encData, \n 0, \n $ivsize * 2\n )\n );\n \n // calculate the header size and get encrypted data\n $header_size = $ivsize * 2;\n $encoded_cipher = substr($encData, $header_size);\n $cipher = pack('H*', $encoded_cipher);\n \n // Intialize encryption from the IV and dec_key\n mcrypt_generic_init($td, $key, $iv);\n \n // Decrypt encrypted string, trimming the result due to padding\n $data = trim(mdecrypt_generic($td, $cipher));\n \n // Terminate encryption handler\n mcrypt_generic_deinit($td);\n mcrypt_module_close($td);\n } catch (Exception $e) {\n throw new Crypt_KeyStore_Exception($e);\n }\n \n return $data;\n }", "private function decryptCipherTextEncryptionKey()\n {\n $result = $this->getAws()->createKms()->decrypt([\n 'CiphertextBlob' => base64_decode($this->getProtectedHeader(self::KEY_CIPHERTEXT_HEADER_NAME))\n ]);\n return $result['Plaintext'];\n }", "function decrypt_value($dvalue)\n{\n\t#Decode value\n\t$dvalue = base64_decode($dvalue);\n\n\t$dnum = strlen($dvalue);\n\t$dnumIndex = $dnum-1;\n\t$newDvalue = \"\";\n\n\t#Reverse the order of characters\n\tfor($x=0;$x<strlen($dvalue);$x++){\n\t\t$newDvalue .= substr($dvalue,$dnumIndex,1);\n\t\t$dnumIndex--;\n\t}\n\treturn $newDvalue;\n}", "function Decrypt($string, $amount){\n\t\tif($amount < 0)\n\t\t\treturn Decrypt($string, $amount + 26);\n\t\t$decrypted = ''; \n\t\tfor( $i=0; $i < strlen($string); $i++){\n\t\t\t$code = ord($string[$i]);\n\t\t\tif ( $code >= 65 && $code <= 90 )\n\t\t\t\t$tmp = (( ($code - 65 + $amount) % 26) + 65);\n\t\t\telse if( $code >= 97 && $code <= 122 )\n\t\t\t\t$tmp = (( ($code - 97 + $amount) % 26) + 97);\n\t\t}\n\t\treturn $decrypted;\n\t}", "function simple_decrypt($text, $salt = \"VUHuiU6b8jgieEG0p79Yx9T4G8Zqp880\") {\n return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $salt, base64_decode($text), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));\n}", "function decrypt( $input,$securekey ) {\n\n \t\t// remove the first char which is @ to flag this is AES encrypted\n \t$input = substr($input,1);\n\n \t// HEX decoding\n \t$input = pack('H*', $input);\n\n \treturn mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $securekey, $input, MCRYPT_MODE_CBC, $securekey);\n }", "function decryptData($encryptedString)\r\n\t\t{\r\n\t\t$arrayDataReturn\t= null;\r\n\t\t$baseString \t\t\t= urldecode($encryptedString);\r\n\t\t$arrayDataLine\t\t= explode('#|#',$baseString);\t// Breakes blocks apart (Block = key ~|~ value ~|~ md5 hash)\r\n\t\t\r\n\t\tif(!is_array($arrayDataLine)) return null;\r\n\t\t\r\n\t\tforeach($arrayDataLine as $value) {\r\n\t\t\t$arrayTemp = explode('~|~',$value);\t// The Block is split in 3 sub-blocks\r\n\t\t\tif(!is_array($arrayTemp) || count($arrayTemp) != 3) continue;\r\n\t\t\t\r\n\t\t\tlist($key,$value,$md5hash) = $arrayTemp;\r\n\t\t\t$key = str_rot13($key);\r\n\t\t\t$value = str_rot13($value);\r\n\t\t\t\r\n\t\t\tif($md5hash == md5($key . $value . $this->_confuser)){\r\n\t\t\t\t$arrayDataReturn[$key] = $value;\r\n\t\t\t\t}\n\t\t\telse {\n\t\t\t\t//debug($key . ' V:' . $value,1);\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\treturn $arrayDataReturn;\r\n\t}", "public function decryptCBC($encryptStr) {\n $localIV = $this->ivCBC;\n $encryptKey = $this->secret_key;\n $module = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, $localIV);\n\n mcrypt_generic_init($module, $encryptKey, $localIV);\n\n $encryptedData = base64_decode($encryptStr);\n $encryptedData = mdecrypt_generic($module, $encryptedData);\n\n return $encryptedData;\n }", "public static function decrypt($data)\r\n {\r\n return openssl_decrypt(\r\n base64_decode($data),\r\n self::OPENSSL_CIPHER_NAME,\r\n self::ENCRYPTION_KEY,\r\n OPENSSL_RAW_DATA,\r\n self::ENCRYPTION_IV\r\n );\r\n }", "private function decrypt($data, $secret)\n {\n $key = md5(utf8_encode($secret), true);\n\n //Take first 8 bytes of $key and append them to the end of $key.\n $key .= substr($key, 0, 8);\n\n $data = base64_decode($data);\n\n $data = openssl_decrypt($data, 'des-ecb', $key);\n\n $len = strlen($data);\n $pad = ord($data[$len-1]);\n\n return substr($data, 0, strlen($data) - $pad);\n }", "public function decryptString($payload)\n {\n return $this->decrypt($payload, false);\n }", "function decrypt(string $payload, bool $unserialize = true)\n {\n return app()->services()->crypter()->decrypt($payload, $unserialize);\n }", "public function decrypt($encrypted): string\n {\n return $this->zero_unpad(openssl_decrypt(hex2bin($encrypted), $this->method, $this->key, $this->options));\n }", "function decrypt($ciphertext)\r\n {\r\n $this->_setup();\r\n // we pad with chr(0) since that's what mcrypt_generic does. to quote from http://php.net/function.mcrypt-generic :\r\n // \"The data is padded with \"\\0\" to make sure the length of the data is n * blocksize.\"\r\n $ciphertext = str_pad($ciphertext, (strlen($ciphertext) + $this->block_size - 1) % $this->block_size, chr(0));\r\n\r\n $plaintext = '';\r\n switch ($this->mode) {\r\n case CRYPT_RIJNDAEL_MODE_ECB:\r\n for ($i = 0; $i < strlen($ciphertext); $i+=$this->block_size) {\r\n $plaintext.= $this->_decryptBlock(substr($ciphertext, $i, $this->block_size));\r\n }\r\n break;\r\n case CRYPT_RIJNDAEL_MODE_CBC:\r\n $xor = $this->decryptIV;\r\n for ($i = 0; $i < strlen($ciphertext); $i+=$this->block_size) {\r\n $block = substr($ciphertext, $i, $this->block_size);\r\n $plaintext.= $this->_decryptBlock($block) ^ $xor;\r\n $xor = $block;\r\n }\r\n if ($this->continuousBuffer) {\r\n $this->decryptIV = $xor;\r\n }\r\n }\r\n\r\n return $this->_unpad($plaintext);\r\n }", "function decrypt($ciphertext, $passphrase, $iv) {\n try {\n\t\t$decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $passphrase, $ciphertext, MCRYPT_MODE_CBC, $iv);\n\t\treturn unpad_pkcs5($decrypted);\n } catch (Exception $e) {\n echo \"Encryption exception in decrypt: \" . $e->getMessage() . \"\\n\";\n }\n}", "function util_decrypt_data($crypted_id, $key, $iv)\n{\n\t// Currently, the production machine does not have support for mcrypt. Hence we do not\n\t// have the ability to encrypt/decrypt information. Only the cookie information is being requested\n\t// to be encrypted right now. It is decided that, for now it is not a security violation to skip\n\t// encryption of cookie data.\n\treturn $crypted_id ;\n\t\n\t/*\n\t$iv = base64_decode($iv);\n\t$crypted_id = base64_decode($crypted_id);\n\t$decrypt_data = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $crypted_id, MCRYPT_MODE_ECB, $iv);\n\treturn str_replace(\"\\x0\", '', $decrypt_data);\t\n\t*/\n}", "public function decrypt_string($input) {\n\n \n\n //echo \"Before Decrypted Text = $input<br>\";\n\n $input = $this->encrypt_decrypt('decrypt', $input);\n\n //echo \"Decrypted Text = $input<br>\";\n\n \n\n \n\n \n\n $input_count = strlen($input);\n\n\n\n $dec = explode(\".\", $input); // splits up the string to any array\n\n $x = count($dec);\n\n $y = $x - 1; // To get the key of the last bit in the array \n\n\n\n $calc = $dec[$y] - 50;\n\n $randkey = chr($calc); // works out the randkey number\n\n\n\n $i = 0;\n\n\n\n while ($i < $y) {\n\n\n\n $array[$i] = $dec[$i] + $randkey; // Works out the ascii characters actual numbers\n\n $real .= chr($array[$i]); //The actual decryption\n\n\n\n $i++;\n\n };\n\n\n\n $input = $real;\n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n return $input;\n\n }", "private function encrypt3DES($text, $key) {\n $key = base64_decode($key);\n $size = mcrypt_get_block_size(MCRYPT_3DES, MCRYPT_MODE_ECB);\n $text = $this->pkcs5_pad($text, $size);\n $bin = pack('H*', bin2hex($text));\n $size = mcrypt_get_iv_size(MCRYPT_3DES, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($size, MCRYPT_RAND);\n $encrypted = bin2hex(mcrypt_encrypt(MCRYPT_3DES, $key, $bin, MCRYPT_MODE_ECB, $iv));\n return $encrypted;\n }", "public function decrypt($data)\n {\n if(!is_string($data) || empty($data)) return false;\n\n // Decode crypt keys\n $first_key = base64_decode($this->config['main_key']);\n $second_key = base64_decode($this->config['assured_key']);\n\n // Decode base64 coded $data\n $mix = base64_decode($data);\n\n // Get length of IV from crypt first method\n $iv_length = openssl_cipher_iv_length($this->encrypt_fst_method);\n\n // Get IV from decoded $data\n $iv = substr($mix, 0, $iv_length);\n // Get second encrypted $data from $mix\n $second_encrypted = substr($mix, $iv_length, 64);\n // Get first encrypted $data from $mix\n $first_encrypted = substr($mix, $iv_length + 64);\n\n // Decrypt first encrypted $data with first encryption method\n $data = openssl_decrypt($first_encrypted, $this->encrypt_fst_method, $first_key, OPENSSL_RAW_DATA, $iv);\n $second_encrypted_new = hash_hmac($this->encrypt_snd_method, $first_encrypted, $second_key, TRUE);\n\n // Check if new second encrypted data is equals to previous second encrypted data,\n // then return decrypted data\n if (hash_equals($second_encrypted, $second_encrypted_new)) {\n $this->has_error = false;\n return $data;\n }\n\n // Otherwise it has modefied\n $this->has_error = true;\n return false;\n }", "public function decrypt($cipherText, $secretKey);", "public function decrypt(string $data) : string|bool\n {\n $json = Jso::hay(base64_decode($data))->decode(true);\n\n if (! Jso::valid() || !$this->validate((array)$json)) {\n throw new DecrypterException('Could not validate the decrypted data pack');\n }\n\n $iv = base64_decode($json['iv']);\n $encrypted = base64_decode($json['data']);\n $decrypted = sodium_crypto_secretbox_open($encrypted, $iv, $this->appKey);\n\n if (! $decrypted) {\n throw new DecrypterException('Could not decrypt the requested data');\n }\n\n sodium_memzero($encrypted);\n return $decrypted;\n }", "public function decryptString(string $string, string $key): string\n {\n try {\n $defuseKey = Key::loadFromAsciiSafeString($key);\n return Crypto::decrypt($string, $defuseKey);\n } catch (CryptoException $ex) {\n throw new CryptographyException('Could not decrypt string.');\n }\n }", "public function decrypt($data)\n {\n // Remove the base64 encoding from our key\n $encryption_key = base64_decode($this->key);\n // To decrypt, split the encrypted data from our IV - our unique separator used was \"::\"\n list($encrypted_data, $iv) = explode('::', base64_decode($data), 2);\n return openssl_decrypt($encrypted_data, 'aes-256-cbc', $encryption_key,\n 0, $iv);\n }", "public function decrypt($iv, $data, $tag = null, $aad = '');", "public function decrypt($data)\n {\n if (is_null($data)) {\n return $data;\n }\n\n $data = base64_decode($data);\n\n $data = $this->removeCipherNoise($data, $this->getKey());\n $init_size = openssl_cipher_iv_length($this->cipher);\n\n if ($init_size > strlen($data)) {\n return null;\n }\n\n $init_vect = substr($data, 0, $init_size);\n $data = substr($data, $init_size);\n return rtrim(\n \\openssl_decrypt(\n $data,\n $this->cipher,\n $this->getKey(),\n $this->encryptOptions,\n $init_vect\n ),\n \"\\0\"\n );\n }", "protected function decrypt($data) {\n if ($this->hash_passwords) {\n return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($this->secret), base64_decode($data), MCRYPT_MODE_CBC, md5(md5($this->secret))), \"\\0\");\n } else {\n return $data;\n }\n }", "function cs_encrypt_decrypt($string)\r\n{\r\n\t//Function : encrypt/decrypt a string message v.1.0 without a known key\r\n\t//Author : Aitor Solozabal Merino (spain)\r\n\t//Email : [email protected]\r\n\t//Date : 01-04-2005\r\n $strlen = strlen($string);\r\n $strencrypted = '';\r\n for ($pos = 0; $pos < $strlen ; $pos++)\r\n {\r\n\t\t// long code of the function to explain the algoritm\r\n\t\t// this function can be tailored by the programmer modifyng the formula\r\n\t\t// to calculate the key to use for every character in the string.\r\n\t\t$usekey = (($strlen+$pos)+1); // (+5 or *3 or ^2)\r\n\t\t// after that we need a module division because can´t be greater than 255\r\n\t\t$usekey = (255+$usekey) % 255;\r\n\t\t$encryptbyte = substr($string, $pos, 1);\r\n\t\t$asciibyte = ord($encryptbyte);\r\n\t\t$xorbyte = $asciibyte ^ $usekey; // xor operation\r\n\t\t$encrypted = chr($xorbyte);\r\n\t\t$strencrypted .= $encrypted;\r\n\t\t \r\n\t\t//short code of the function once explained\r\n\t\t// $str_encrypted_message .= chr((ord(substr($str_message, $position, 1))) ^ ((255+(($len_str_message+$position)+1)) % 255));\r\n\t}\r\n\treturn $strencrypted;\r\n}", "public function decrypt($data)\n {\n return Crypto::decrypt($data, $this->key);\n }", "function new_decrypt($data, $key) {\n if(empty($key)){\n $key = $encryption_key;\n }\n // Remove the base64 encoding from our key\n $encryption_key = base64_decode($key);\n // To decrypt, split the encrypted data from our IV - our unique separator used was \"::\"\n list($encrypted_data, $iv) = explode('::', base64_decode($data), 2);\n return openssl_decrypt($encrypted_data, 'aes-256-cbc', $encryption_key, 0, $iv);\n}", "function TOdecrypt($encrypted, $password, $salt='!kQm*fF3pXe1Kbm%9') {\r\n $key = hash('SHA256', $salt . $password, true);\r\n // Retrieve $iv which is the first 22 characters plus ==, base64_decoded.\r\n $iv = base64_decode(substr($encrypted, 0, 22) . '==');\r\n // Remove $iv from $encrypted.\r\n $encrypted = substr($encrypted, 22);\r\n // Decrypt the data. rtrim won't corrupt the data because the last 32 characters are the md5 hash; thus any \\0 character has to be padding.\r\n $decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, base64_decode($encrypted), MCRYPT_MODE_CBC, $iv), \"\\0\\4\");\r\n // Retrieve $hash which is the last 32 characters of $decrypted.\r\n $hash = substr($decrypted, -32);\r\n // Remove the last 32 characters from $decrypted.\r\n $decrypted = substr($decrypted, 0, -32);\r\n // Integrity check. If this fails, either the data is corrupted, or the password/salt was incorrect.\r\n if (md5($decrypted) != $hash) return false;\r\n // Yay!\r\n return $decrypted;\r\n }", "public function decrypt($data, $deterministic)\n {\n // Return data if not annotated as encrypted\n if (strncmp($this->prefix, $data, strlen($this->prefix)) !== 0) {\n return $data;\n }\n\n // Strip annotation and decode data encoded with MIME base64\n $base64_decoded = base64_decode(substr($data, strlen($this->prefix)));\n\n // Split Initialization Vector\n $iv = substr($base64_decoded, 0, $this->iv_size);\n $iv_removed = substr($base64_decoded, $this->iv_size);\n\n // return decrypted, de-salted, and trimed value\n $saltedDecrypted = openssl_decrypt(\n $iv_removed,\n self::CIPHER,\n $this->secretKey,\n OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING,\n $iv\n );\n\n $result = rtrim(\n $this->removeSalt($saltedDecrypted),\n \"\\0\"\n );\n\n return $result;\n }", "function decryptData($openssl_data, $openssl_pass, $openssl_iv){\n\t$method = 'AES-256-CBC';\n\n\tif(strlen($openssl_iv) > '128'){\n\t\t$openssl_iv = substr($openssl_iv, 0, 128);\n\t}\n\n\treturn trim(openssl_decrypt($openssl_data, $method, $openssl_pass, FALSE, $openssl_iv));\n}", "public function SimpleDecrypt($InputString, $KeyPhrase){\n\t\t$InputString = base64_decode($InputString);\n \t$InputString = Actions::XOREncryption($InputString, $KeyPhrase);\n\n \treturn $InputString;\n\t}", "private function _xorDecode($string, $key)\n {\n $string = $this->_xorMerge($string, $key);\n\n $dec = '';\n for ($i = 0; $i < strlen($string); $i++) {\n $dec .= (substr($string, $i++, 1) ^ substr($string, $i, 1));\n }\n\n return $dec;\n }", "public static function do_mdecrypt($input, $key) {\r\n $input = str_replace(\"\\n\", \"\", $input);\r\n $input = str_replace(\"\\t\", \"\", $input);\r\n $input = str_replace(\"\\r\", \"\", $input);\r\n $input = trim(chop(base64_decode($input)));\r\n $td = mcrypt_module_open('tripledes', '', 'ecb', '');\r\n $key = substr(md5($key), 0, 24);\r\n $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);\r\n mcrypt_generic_init($td, $key, $iv);\r\n $decrypted_data = mdecrypt_generic($td, $input);\r\n mcrypt_generic_deinit($td);\r\n mcrypt_module_close($td);\r\n return trim(chop($decrypted_data));\r\n }", "function encrypt_decrypt($action, $string) {\n $secret_key = $GLOBALS['ENCRYPT_KEY'];\n $secret_iv = $GLOBALS['ENCRYPT_KEY'];\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $key = hash('sha256', $secret_key);\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if ($action == 'encrypt') {\n $output = base64_encode(openssl_encrypt($string, $encrypt_method, $key, 0, $iv));\n } else if ($action == 'decrypt') {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n }", "public static function decrypt($value) {\n $self = self::getInstance();\n $prefix = strpos($value, \"U3BhZ2hldHRp.\");\n if($prefix !== false):\n $encrypted = base64_decode(substr($value, $prefix + 13));\n return Security::cipher($encrypted, $self->key);\n endif;\n return false;\n }", "public function testDecrypt()\n\t{\n\t $encrypted = mcrypt_encrypt('blowfish', 's3cret', \"a test string\", MCRYPT_MODE_ECB);\n\t $this->assertEquals(\"a test string\", $this->Crypt_MCrypt->decrypt($encrypted));\n\t}", "public static function customEncryptionDecryption($string, $action = 'encrypt')\n {\n $secretKey = 'c7tpe291z';\n $secretVal = 'GfY7r512';\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $key = hash('sha256', $secretKey);\n $iv = substr(hash('sha256', $secretVal), 0, 16);\n\n if ($action == 'encrypt') {\n $output = base64_encode(openssl_encrypt($string, $encrypt_method, $key, 0, $iv));\n } else if ($action == 'decrypt') {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n return $output;\n }", "function aesdecrypt($encrypted_chaine)\n {\n $key_password = \"la clé\";\n $decrypted_chaine = openssl_decrypt($encrypted_chaine, \"AES-128-ECB\" ,$key_password);\n var_dump($encrypted_chaine);\n \n }", "public function decrypt($content) {\n // Decode base64 string\n $content = base64_decode($content);\n // Create the initialization vector for added security.\n $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND);\n // Decrypt $string\n $decryptedContent = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->_getSecretKey(), $content, MCRYPT_MODE_ECB, $iv);\n // Decode base64 string\n $decryptedContent = base64_decode($decryptedContent);\n \n return $decryptedContent;\n }", "public function decrypt($str, $key, $method = '') {\n if(trim($str)=='') {\n $return['decrypted'] = $str;\n return $return;\n }\n if(!is_string($str)) {\n // If input is array, check if its from the encrypt script if that works set new $str else trigger error\n if((is_array($str)) && (isset($str['encrypted']))) {\n $str = $str['encrypted'];\n } else {\n $return['decrypted'] = trim($str);\n $return['error'][] = $str = '#'.__LINE__.': String not valid: \"'.$str.'\"';\n trigger_error($str, E_USER_NOTICE); \n return $return;\n }\n }\n $str = trim(stripslashes($str));\n if($str==\"\") {\n $return['decrypted'] = $str;\n return $return;\n }\n \n // If compress is active and if string start with the delimiter - decompress input\n if(($this->compress==true) && (($this->startsWith($str, $this->delimiter_gz)) && ($this->endsWith($str, $this->delimiter_gz)))) {\n $str = gzdecode(trim(utf8_decode($str),$this->delimiter_gz));\n }\n \n // Set cipher_method to AES-256-CBC as standard if none is present\n if($method == '') {\n $method = $this->cipher_method;\n }\n $rawencrypted = $str;\n \n // Clean input\n $str = str_replace(array($this->delimiter_character,$this->delimiter_breaks),array(' ',PHP_EOL),$str);\n \n // If string don't start and ends with the delimiters trigger error. If it does - clean string. Else trigger error.\n if((!$this->startsWith($str, $this->delimiter_characters)) || (!$this->endsWith($str, $this->delimiter_characters))) {\n $return['decrypted'] = trim($str);\n $return['error'][] = $str = '#'.__LINE__.': String not valid';\n \n return $return;\n } else if(($this->startsWith($str, $this->delimiter_characters)) && ($this->endsWith($str, $this->delimiter_characters))) {\n $str = trim(substr(substr($str,strlen($this->delimiter_characters)), 0, (0-strlen($this->delimiter_characters))));\n } else {\n $return['error'][] = $str = '#'.__LINE__.': String not valid';\n \n return $return;\n }\n\n // Generate retur string\n $return = array('decrypted' => '', 'encrypted' => trim($str), 'rawencrypted' => $rawencrypted, 'key' => $key, 'safekey' => '', 'algorithm' => $this->cipher_algorithm, 'method' => $method, 'iv' => '', 'base64_encode' => array(), 'error' => array());\n \n // String can't be empty\n if($str == '') {\n $return['error'][] = 'String empty';\n return $return;\n }\n \n // Key can't be empty\n if($key=='') {\n $return['error'][] = 'Key empty';\n trigger_error('Key can not be empty', E_USER_NOTICE); \n return $return;\n } else {\n $key = substr(hash($this->cipher_algorithm, $key, true), 0, 32);\n $return['safekey'] = bin2hex($key);\n }\n \n // Explode input\n $decrypts = explode(PHP_EOL, $return['encrypted']);\n \n // Create an IV and find the encrypted IV in input\n // An initialization vector (IV) is an arbitrary number that can be used along with a secret key for data encryption.\n $ivlen = openssl_cipher_iv_length($method);\n $iv = openssl_random_pseudo_bytes($ivlen);\n $ivlen = strlen(bin2hex($iv)); \n $iv = hex2bin($this->binaryToText(end($decrypts)));\n $return['iv'] = bin2hex($iv); \n \n // Remove IV from input\n array_pop($decrypts);\n\n // Find algorithm in input\n $algorithm = explode('_',$this->binaryToText(current($decrypts)));\n array_pop($algorithm);\n $algorithm = implode('_',$algorithm);\n unset($decrypts[0]);\n \n // Go through the decrypted data and decrypt each line.\n $return['base64_encode'] = $decrypts;\n foreach($return['base64_encode'] as $decrypting) {\n $return['decrypted'] .= $str = openssl_decrypt(base64_decode($this->binaryToText($decrypting)), $method, $key, OPENSSL_RAW_DATA, $iv);\n }\n $return['decrypted'] = stripslashes($return['decrypted']);\n \n return $return;\n }", "static public function decrypt($data,$key) {\r\n $iv= substr($data, 0,16); \r\n $data=substr($data,16);\r\n // 128 is blocksize, not keysize!\r\n $out=mcrypt_decrypt(MCRYPT_RIJNDAEL_128,$key,$data,MCRYPT_MODE_CBC, $iv);\r\n $padlen=ord(substr($out,-1));\r\n return substr($out,0, strlen($out)-$padlen);\r\n }", "public function privDecrypt($encrypted)\n {\n if(!is_string($encrypted)){\n return null;\n }\n\n $encrypted = base64_decode($encrypted);\n\n $r = openssl_private_decrypt($encrypted, $decrypted, $this->privKey);\n if($r){\n return $decrypted;\n }\n return null;\n }", "function encrypt_decrypt($action, $string) {\n\t\t$output = false;\n\t\t$key = 'xxx';\n\n\t\t// initialization vector \n\t\t$iv = md5(md5($key));\n\n\t\tif( $action == 'encrypt' ) {\n\t\t\t\t$output = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, $iv);\n\t\t\t\t$output = base64_encode($output);\n\t\t}\n\t\telse if( $action == 'decrypt' ){\n\t\t\t\t$output = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, $iv);\n\t\t\t\t$output = rtrim($output, \"\");\n\t\t}\n\t\treturn $output;\n}", "public function decrypt($data)\n {\n return $this->decryptionCipher()->decrypt($this->privateKey(), $data);\n }", "private function _decrypt($value)\n {\n if (!strpos($value, '|')) {\n return false;\n }\n\n list($iv, $data) = explode('|', $value);\n $iv = base64_decode($iv);\n $data = base64_decode($data);\n\n $b64 = mcrypt_decrypt(\n self::CIPHER,\n $this->getPassKey(),\n $data,\n self::CIPHER_MODE,\n $iv\n );\n\n // We stored it base64 encoded to remove any numerical\n // patterns.\n $plain = base64_decode($b64);\n\n return rtrim($plain);\n }", "public function decryptionCipher()\n {\n return $this->decryptionCipher;\n }", "function decrypt_user_info($encrypted_string) {\n if ($encrypted_string) {\n $encryption_conf = config_item('user_encryption');\n\n //get encryption configurations from config\n $key = $encryption_conf['key'];\n $method = $encryption_conf['method'];\n $iv = $encryption_conf['iv'];\n $output = openssl_decrypt($encrypted_string, $method, $key, 0, $iv);\n\n return $output;\n }\n}", "public function decode($s_id){\n return $this->cryptomute->decrypt((string) $s_id, 10, true, $this->getPass(), $this->getIV());\n }", "function descifrar_cadena(string $cadena, string $llave)\n{\n\t$componentes = explode('::', base64_decode($cadena));\n\t$cifrado = $componentes[0];\n\t$iv = $componentes[1];\n\n\t$descifrado = openssl_decrypt(\n\t\t$cifrado,\n\t\tMETODO,\n\t\t$llave,\n\t\t0,\n\t\t$iv\n\t);\n\n\treturn $descifrado;\n}", "public function dec($data)\n {\n return $this->_simplify('decrypt', $data);\n }" ]
[ "0.7463663", "0.7440529", "0.73968285", "0.7375621", "0.72862256", "0.7191333", "0.7137326", "0.7049362", "0.70215094", "0.69725865", "0.6959037", "0.694998", "0.69478977", "0.6922109", "0.69090194", "0.68871474", "0.6856022", "0.68453056", "0.6840637", "0.68190765", "0.68190765", "0.6816202", "0.67967445", "0.67437434", "0.67340285", "0.67085725", "0.66987157", "0.6659725", "0.6647905", "0.6622485", "0.6603448", "0.6594582", "0.6590326", "0.6573178", "0.653891", "0.65381294", "0.65307075", "0.651786", "0.6491696", "0.6475248", "0.64618987", "0.64610255", "0.6374897", "0.63572174", "0.63520014", "0.6344791", "0.6344401", "0.633891", "0.63363737", "0.63286215", "0.6309441", "0.63075405", "0.63059694", "0.62720484", "0.6270349", "0.6263903", "0.6255068", "0.6254559", "0.6236184", "0.6235722", "0.62320936", "0.6231885", "0.62029195", "0.61824214", "0.6180995", "0.61585474", "0.61565334", "0.6146537", "0.6146177", "0.61254287", "0.6121858", "0.61172444", "0.6112997", "0.60747474", "0.60646904", "0.6060074", "0.6059724", "0.6057699", "0.60570735", "0.604281", "0.6041263", "0.602185", "0.6004005", "0.59921616", "0.59912884", "0.5990672", "0.59897417", "0.59794503", "0.5978797", "0.59747404", "0.5974361", "0.5949236", "0.5930821", "0.5928573", "0.5912553", "0.59065133", "0.5899727", "0.58988726", "0.5897147", "0.58901185", "0.5886714" ]
0.0
-1
Generate one way hash from the string
public function Hash($input, $algo = NULL) { // Switch to default algo if (!$algo) $algo = defined("CF_HASH_ALGO") ? CF_HASH_ALGO : HASH_ALGO; switch ($algo) { case "MD5": return md5($input); break; case "3DES": return crypt($input, substr($this->Key, 0, 9)); break; case "SHA256": $this->CheckMhash(); $hash = mhash(MHASH_SHA256, $input); return bin2hex($hash); break; default: return false; break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_hash($string) {\r\n return hash('sha1', $string);\r\n}", "public function hash(): string;", "private function hash($string)\n {\n if (!function_exists('hash')) {\n return sha1($string);\n }\n return hash('sha256', $string);\n }", "public function hash($str)\n\t{\n\t\treturn hash($this->_config['hash_method'], $str);\n\t}", "function make_hash($str)\n{\n return sha1(md5($str));\n}", "function make_hash($str)\n{\n return sha1(md5($str));\n}", "public static function hash($string) {\n $hash = hash_init(Config::get('HASH'));\n hash_update($hash, $string);\n hash_update($hash, Config::get('SALT'));\n\n return hash_final($hash);\n }", "function _hash($string) {\n\t\t\t// Use sha1() if possible, php versions >= 4.3.0 and 5\n\t\t\tif(function_exists('sha1')) {\n\t\t\t\t$hash = sha1($string);\n\t\t\t} else {\n\t\t\t\t// Fall back to md5(), php versions 3, 4, 5\n\t\t\t\t$hash = md5($string);\n\t\t\t}\n\t\t\t$out ='';\n\t\t\t// Convert hexadecimal hash value to binary string\n\t\t\tfor($c=0;$c<strlen($hash);$c+=2) {\n\t\t\t\t$out .= $this->_hex2chr($hash[$c] . $hash[$c+1]);\n\t\t\t}\n\t\t\treturn $out;\n\t\t}", "private static function getHash($string)\n\t{\n\t\treturn base64_encode(extension_loaded('hash') ?\n\t\thash_hmac('sha1', $string, self::$__secretKey, true) : pack('H*', sha1(\n\t\t(str_pad(self::$__secretKey, 64, chr(0x00)) ^ (str_repeat(chr(0x5c), 64))) .\n\t\tpack('H*', sha1((str_pad(self::$__secretKey, 64, chr(0x00)) ^\n\t\t(str_repeat(chr(0x36), 64))) . $string)))));\n\t}", "function getHash($str)\n{\n\treturn hash('sha256', $str);\n}", "private function hash($str)\n {\n return ($this->hashType == 'sha1') ? $this->sha1($str) : md5($str);\n }", "protected function hash($string)\n {\n return hash_hmac('sha1', $string, $this->key(), true);\n }", "protected function _getHash($string) {\n\n\t\t\treturn sha1($string);\n\t\t}", "protected function hash($str)\n\t{\n\t\treturn hash($this->config['hash_method'], $str);\n\t}", "public static function sha1_hash( $string )\n {\n return '{SHA}'.base64_encode( pack( 'H*', sha1( $string ) ) );\n }", "public function hash($str) {\n\n return hash($this->hash_method, $str);\n }", "protected static function create_hash($string)\n\t{\n\t\t$check1 = static::string_to_number($string, 0x1505, 0x21);\n\t\t$check2 = static::string_to_number($string, 0, 0x1003F);\n\n\t\t$factor = 4;\n\t\t$halfFactor = $factor/2;\n\n\t\t$check1 >>= $halfFactor;\n\t\t$check1 = (($check1 >> $factor) & 0x3FFFFC0 ) | ($check1 & 0x3F);\n\t\t$check1 = (($check1 >> $factor) & 0x3FFC00 ) | ($check1 & 0x3FF);\n\t\t$check1 = (($check1 >> $factor) & 0x3C000 ) | ($check1 & 0x3FFF); \n\n\t\t$calc1 = (((($check1 & 0x3C0) << $factor) | ($check1 & 0x3C)) << $halfFactor ) | ($check2 & 0xF0F );\n\t\t$calc2 = (((($check1 & 0xFFFFC000) << $factor) | ($check1 & 0x3C00)) << 0xA) | ($check2 & 0xF0F0000 );\n\n\t\treturn ($calc1 | $calc2);\n\t}", "public function hash($str)\n {\n return ($this->_hashType == 'sha1') ? $this->sha1($str) : md5($str);\n }", "public static function hashCode($_str) {\n\t\treturn str_pad(\n\t\t\tbase_convert(sprintf('%u',crc32($_str)),10,36),7,'0',\n\t\t\t\tSTR_PAD_LEFT\n\t\t);\n\t}", "public function hash();", "public static function hash($string)\n {\n // The hash is a string of hex digits (with a length of 32 bytes for md5).\n return md5($string);\n }", "public static function hash($string)\n {\n if (function_exists('md5')) {\n return md5($string);\n }\n\n if (is_array($string) || is_object($string)) {\n $type = gettype($string);\n $caller = next(debug_backtrace());\n $eror['line'] = $caller['line'];\n $eror['file'] = strip_tags($caller['file']);\n $error['type'] = E_USER_ERROR;\n trigger_error(\n \"md5() expects parameter 1 to be string, \"\n . $type\n . \" given in <b>{$file}</b> on line <b>{$line}</b><br />\\n\",\n E_USER_ERROR\n );\n\n return;\n }\n\n // convert into string\n $string = \"{$string}\";\n $instance = self::singleton();\n $A = \"67452301\";\n $a = $A;\n $B = \"efcdab89\";\n $b = $B;\n $C = \"98badcfe\";\n $c = $C;\n $D = \"10325476\";\n $d = $D;\n $words = $instance->binArray($string);\n for ($i = 0; $i <= count($words)/16-1; $i++) {\n $a = $A;\n $b = $B;\n $c = $C;\n $d = $D;\n /* ROUND 1 */\n $a = $instance->pad($a, $b, $c, $d, $words[0 + ($i * 16)], 7, \"d76aa478\", '1');\n $d = $instance->pad($d, $a, $b, $c, $words[1 + ($i * 16)], 12, \"e8c7b756\", '1');\n $c = $instance->pad($c, $d, $a, $b, $words[2 + ($i * 16)], 17, \"242070db\", '1');\n $b = $instance->pad($b, $c, $d, $a, $words[3 + ($i * 16)], 22, \"c1bdceee\", '1');\n $a = $instance->pad($a, $b, $c, $d, $words[4 + ($i * 16)], 7, \"f57c0faf\", '1');\n $d = $instance->pad($d, $a, $b, $c, $words[5 + ($i * 16)], 12, \"4787c62a\", '1');\n $c = $instance->pad($c, $d, $a, $b, $words[6 + ($i * 16)], 17, \"a8304613\", '1');\n $b = $instance->pad($b, $c, $d, $a, $words[7 + ($i * 16)], 22, \"fd469501\", '1');\n $a = $instance->pad($a, $b, $c, $d, $words[8 + ($i * 16)], 7, \"698098d8\", '1');\n $d = $instance->pad($d, $a, $b, $c, $words[9 + ($i * 16)], 12, \"8b44f7af\", '1');\n $c = $instance->pad($c, $d, $a, $b, $words[10 + ($i * 16)], 17, \"ffff5bb1\", '1');\n $b = $instance->pad($b, $c, $d, $a, $words[11 + ($i * 16)], 22, \"895cd7be\", '1');\n $a = $instance->pad($a, $b, $c, $d, $words[12 + ($i * 16)], 7, \"6b901122\", '1');\n $d = $instance->pad($d, $a, $b, $c, $words[13 + ($i * 16)], 12, \"fd987193\", '1');\n $c = $instance->pad($c, $d, $a, $b, $words[14 + ($i * 16)], 17, \"a679438e\", '1');\n $b = $instance->pad($b, $c, $d, $a, $words[15 + ($i * 16)], 22, \"49b40821\", '1');\n\n /* round 2 */\n $a = $instance->pad($a, $b, $c, $d, $words[1 + ($i * 16)], 5, \"f61e2562\", '2');\n $d = $instance->pad($d, $a, $b, $c, $words[6 + ($i * 16)], 9, \"c040b340\", '2');\n $c = $instance->pad($c, $d, $a, $b, $words[11 + ($i * 16)], 14, \"265e5a51\", '2');\n $b = $instance->pad($b, $c, $d, $a, $words[0 + ($i * 16)], 20, \"e9b6c7aa\", '2');\n $a = $instance->pad($a, $b, $c, $d, $words[5 + ($i * 16)], 5, \"d62f105d\", '2');\n $d = $instance->pad($d, $a, $b, $c, $words[10 + ($i * 16)], 9, \"2441453\", '2');\n $c = $instance->pad($c, $d, $a, $b, $words[15 + ($i * 16)], 14, \"d8a1e681\", '2');\n $b = $instance->pad($b, $c, $d, $a, $words[4 + ($i * 16)], 20, \"e7d3fbc8\", '2');\n $a = $instance->pad($a, $b, $c, $d, $words[9 + ($i * 16)], 5, \"21e1cde6\", '2');\n $d = $instance->pad($d, $a, $b, $c, $words[14 + ($i * 16)], 9, \"c33707d6\", '2');\n $c = $instance->pad($c, $d, $a, $b, $words[3 + ($i * 16)], 14, \"f4d50d87\", '2');\n $b = $instance->pad($b, $c, $d, $a, $words[8 + ($i * 16)], 20, \"455a14ed\", '2');\n $a = $instance->pad($a, $b, $c, $d, $words[13 + ($i * 16)], 5, \"a9e3e905\", '2');\n $d = $instance->pad($d, $a, $b, $c, $words[2 + ($i * 16)], 9, \"fcefa3f8\", '2');\n $c = $instance->pad($c, $d, $a, $b, $words[7 + ($i * 16)], 14, \"676f02d9\", '2');\n $b = $instance->pad($b, $c, $d, $a, $words[12 + ($i * 16)], 20, \"8d2a4c8a\", '2');\n\n /* round 3 */\n $a = $instance->pad($a, $b, $c, $d, $words[5 + ($i * 16)], 4, \"fffa3942\", '3');\n $d = $instance->pad($d, $a, $b, $c, $words[8 + ($i * 16)], 11, \"8771f681\", '3');\n $c = $instance->pad($c, $d, $a, $b, $words[11 + ($i * 16)], 16, \"6d9d6122\", '3');\n $b = $instance->pad($b, $c, $d, $a, $words[14 + ($i * 16)], 23, \"fde5380c\", '3');\n $a = $instance->pad($a, $b, $c, $d, $words[1 + ($i * 16)], 4, \"a4beea44\", '3');\n $d = $instance->pad($d, $a, $b, $c, $words[4 + ($i * 16)], 11, \"4bdecfa9\", '3');\n $c = $instance->pad($c, $d, $a, $b, $words[7 + ($i * 16)], 16, \"f6bb4b60\", '3');\n $b = $instance->pad($b, $c, $d, $a, $words[10 + ($i * 16)], 23, \"bebfbc70\", '3');\n $a = $instance->pad($a, $b, $c, $d, $words[13 + ($i * 16)], 4, \"289b7ec6\", '3');\n $d = $instance->pad($d, $a, $b, $c, $words[0 + ($i * 16)], 11, \"eaa127fa\", '3');\n $c = $instance->pad($c, $d, $a, $b, $words[3 + ($i * 16)], 16, \"d4ef3085\", '3');\n $b = $instance->pad($b, $c, $d, $a, $words[6 + ($i * 16)], 23, \"4881d05\", '3');\n $a = $instance->pad($a, $b, $c, $d, $words[9 + ($i * 16)], 4, \"d9d4d039\", '3');\n $d = $instance->pad($d, $a, $b, $c, $words[12 + ($i * 16)], 11, \"e6db99e5\", '3');\n $c = $instance->pad($c, $d, $a, $b, $words[15 + ($i * 16)], 16, \"1fa27cf8\", '3');\n $b = $instance->pad($b, $c, $d, $a, $words[2 + ($i * 16)], 23, \"c4ac5665\", '3');\n\n /* round 4 */\n $a = $instance->pad($a, $b, $c, $d, $words[0 + ($i * 16)], 6, \"f4292244\", '4');\n $d = $instance->pad($d, $a, $b, $c, $words[7 + ($i * 16)], 10, \"432aff97\", '4');\n $c = $instance->pad($c, $d, $a, $b, $words[14 + ($i * 16)], 15, \"ab9423a7\", '4');\n $b = $instance->pad($b, $c, $d, $a, $words[5 + ($i * 16)], 21, \"fc93a039\", '4');\n $a = $instance->pad($a, $b, $c, $d, $words[12 + ($i * 16)], 6, \"655b59c3\", '4');\n $d = $instance->pad($d, $a, $b, $c, $words[3 + ($i * 16)], 10, \"8f0ccc92\", '4');\n $c = $instance->pad($c, $d, $a, $b, $words[10 + ($i * 16)], 15, \"ffeff47d\", '4');\n $b = $instance->pad($b, $c, $d, $a, $words[1 + ($i * 16)], 21, \"85845dd1\", '4');\n $a = $instance->pad($a, $b, $c, $d, $words[8 + ($i * 16)], 6, \"6fa87e4f\", '4');\n $d = $instance->pad($d, $a, $b, $c, $words[15 + ($i * 16)], 10, \"fe2ce6e0\", '4');\n $c = $instance->pad($c, $d, $a, $b, $words[6 + ($i * 16)], 15, \"a3014314\", '4');\n $b = $instance->pad($b, $c, $d, $a, $words[13 + ($i * 16)], 21, \"4e0811a1\", '4');\n $a = $instance->pad($a, $b, $c, $d, $words[4 + ($i * 16)], 6, \"f7537e82\", '4');\n $d = $instance->pad($d, $a, $b, $c, $words[11 + ($i * 16)], 10, \"bd3af235\", '4');\n $c = $instance->pad($c, $d, $a, $b, $words[2 + ($i * 16)], 15, \"2ad7d2bb\", '4');\n $b = $instance->pad($b, $c, $d, $a, $words[9 + ($i * 16)], 21, \"eb86d391\", '4');\n\n $A = $instance->add(\n $instance->hexdec($a),\n $instance->hexdec($A)\n );\n $B = $instance->add(\n $instance->hexdec($b),\n $instance->hexdec($B)\n );\n $C = $instance->add(\n $instance->hexdec($c),\n $instance->hexdec($C)\n );\n $D = $instance->add(\n $instance->hexdec($d),\n $instance->hexdec($D)\n );\n }\n\n $words = $instance->str2Hex($A)\n . $instance->str2Hex($B)\n . $instance->str2Hex($C)\n . $instance->str2Hex($D);\n unset($a, $b, $c, $d, $A, $B, $C, $D, $string, $instance);\n return $words;\n }", "public function _hash($str) {\n switch ($this->config['algoritmo_criptografia']) {\n case 'sha1':\n return ($str == '') ? '' : sha1($str);\n break;\n case 'crypt':\n return crypt($str);\n break;\n case 'base64':\n return base64_encode($str);\n break;\n case 'plain':\n return $str;\n break;\n case 'md5':\n default:\n return md5($str);\n break;\n }\n }", "public function hash ($string){\n\t\treturn hash('sha512', $string . config_item('encryption_key'));\n\t\t}", "public function myHash($str) {\n $hash = 0;\n $s = md5($str);\n $seed = 5;\n $len = 32;\n for ($i = 0; $i < $len; $i++) {\n // (hash << 5) + hash 相当于 hash * 33\n //$hash = sprintf(\"%u\", $hash * 33) + ord($s{$i});\n //$hash = ($hash * 33 + ord($s{$i})) & 0x7FFFFFFF;\n $hash = ($hash << $seed) + $hash + ord($s{$i});\n }\n\n return $hash & 0x7FFFFFFF;\n }", "public function hash($string){\n return hash('sha512', $string . config_item('encryption_key'));\n }", "function hashing($s){\r\n $letters = \"acdegilmnoprstuw\";\r\n $h = 7;\r\n if(!empty($s)){\r\n $chars = str_split($s);\r\n foreach($chars as $char){\r\n $h = bcadd(bcmul($h,37), stripos($letters,$char));\r\n }\r\n return $h;\r\n }\r\n }", "function RSHash($string) {\n $a = 63689;\n $b = 378551;\n $hash = 0;\n\n for ($i = 0, $x = strlen($string); $i < $x; $i++) {\n $hash = $hash * $a + (int) ord($string[$i]);\n $hash = fmod($hash, 65535);\n $a = $a * $b;\n $a = fmod($a, 65535);\n }\n\n return $hash;\n }", "public function sha1($str)\n {\n if (!function_exists('sha1')) {\n if (!function_exists('mhash')) {\n Fly::import('system.libraries.Sha1');\n $SH = new Sha1();\n return $SH->generate($str);\n } else {\n return bin2hex(mhash(MHASH_SHA1, $str));\n }\n } else {\n return sha1($str);\n }\n }", "public function generateHash()\n {\n do {\n $hash = Security::randomString(8);\n } while ($this->exists(['hash' => $hash]));\n\n return $hash;\n }", "public static function hashFunction($str)\n {\n return md5($str);\n }", "public function hash( $string ) {\n\n return hash( 'sha512', $string.config_item( 'encryption_key' ) );\n }", "public static function hash($string) {\n\treturn hash('sha512',$string);\n }", "private static function hash($str) {\n $hash = 0;\n\n for ($i = 0, $l = strlen($str); $i < $l; $i++) {\n $hash += ord($str[$i]);\n $hash += $hash << 10;\n $hash ^= $hash >> 6;\n }\n\n $hash += $hash << 3;\n $hash ^= $hash >> 6;\n $hash += $hash << 16;\n\n return $hash;\n }", "public function hash($str)\n\t{\n\t\t// on some servers hash() can be disabled :( then password are not encrypted \n\t\tif (empty($this->config['hash_method']))\n\t\t\treturn $this->config['salt_prefix'].$str.$this->config['salt_suffix']; \n\t\telse\n\t\t\treturn hash($this->config['hash_method'], $this->config['salt_prefix'].$str.$this->config['salt_suffix']); \n\t}", "function mcsha1($str)\n{\n\t$gmp = gmp_import(sha1($str, true));\n\tif(gmp_cmp($gmp, gmp_init(\"0x8000000000000000000000000000000000000000\")) >= 0)\n\t{\n\t\t$gmp = gmp_mul(gmp_add(gmp_xor($gmp, gmp_init(\"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\")), gmp_init(1)), gmp_init(-1));\n\t}\n\treturn gmp_strval($gmp, 16);\n}", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "protected function hash($string)\n\t{\n\t\treturn md5($string);\n\n\t}", "private function generatePasswordHash($string)\n\t{\n\t\t$string = is_string($string) ? $string : strval($string);\n\t\t$pwHash = encrypto($string);\n\t\treturn $pwHash;\n\t}", "public static function hash($str, $type = 'sha1')\n {\n if ($type == 'sha1') {\n return sha1($str);\n } else {\n return md5($str);\n }\n }", "function criptografa($str)\r\n\t{\r\n\t\t$str = sha1( md5( sha1 ( md5 ( $str ) ) ) );\r\n\r\n\t\treturn $str; \t\t\r\n\t}", "public static function generateHash()\n {\n $result = '';\n $charPool = '0123456789abcdefghijklmnopqrstuvwxyz';\n for ($p = 0; $p < 15; $p++) {\n $result .= $charPool[mt_rand(0, strlen($charPool) - 1)];\n }\n\n return sha1(md5(sha1($result)));\n }", "public static function hash($string)\n\t{\n\t\tif(extension_loaded('hash')) {\n\t\t\tif(!($key = Config::getVar('secret_key'))) {\n\t\t\t\tthrow new BakedCarrotException('\"secret_key\" parameter is not defined');\n\t\t\t}\n\n\t\t\treturn hash_hmac('sha256', $string, $key);\n\t\t}\n\t\telse {\n\t\t\treturn sha1($key);\n\t\t}\n\t}", "public static function lm_hash( $string )\n {\n $string = strtoupper( substr( $string, 0, 14 ) );\n\n $part_1 = self::des_encrypt( substr( $string, 0, 7 ) );\n $part_2 = self::des_encrypt( substr( $string, 7, 7 ) );\n\n return strtoupper( $part_1.$part_2 );\n }", "function my_hash($string, $username = null) {\r\n\t\t$salt = getStoredSalt($username);\r\n\t\tif (!$salt) {\r\n\t\t\t// generate the salt and store it in the database\r\n\t\t\t$salt = substr(md5(uniqid(rand(),true)),0,24);\r\n\t\t\tstoreSalt($username, $salt);\r\n\t\t}\r\n\t\treturn sha1($salt . $string);\r\n\t}", "public function sha1Filter($string)\r\n {\r\n return sha1($string);\r\n }", "public function generateHash($input) {\n\t\treturn md5(json_encode($input));\n\t}", "public function makeHash(\\codename\\core\\credential $credential) : string;", "public function hash($value);", "public static function make($string, $salt = ''){\n return hash('sha256', $string . $salt);\n }", "public static function hash($string = null) {\n if ($string != null) {\n $options = [\n 'cost' => 12,\n ];\n return password_hash($string, PASSWORD_BCRYPT, $options);\n }\n }", "public function hashPass($str)\n {\n // Phalcon's hashing system\n //return $this->_security->hash($str);\n\n // Using PHP5.5's built in system\n return password_hash($str, PASSWORD_DEFAULT, ['cost' => \\Phalcon\\DI::getDefault()->getShared('config')->auth->hash_workload]);\n }", "public function hashCode() : string;", "function sha256($string) {\n $algo = 'sha256';\n return hash($algo, $string . UNIQUE_IDENTIFIER);\n }", "final public function getHash() {}", "public function hashCode(): string;", "public function getHash();", "public static function genhash ($url)\r\n\t{\r\n\t\t$hash = 'Mining PageRank is AGAINST GOOGLE\\'S TERMS OF SERVICE. Yes, I\\'m talking to you, scammer.';\r\n\t\t$c = 16909125;\r\n\t\t$length = strlen($url);\r\n\t\t$hashpieces = str_split($hash);\r\n\t\t$urlpieces = str_split($url);\r\n\t\tfor ($d = 0; $d < $length; $d++)\r\n\t\t{\r\n\t\t\t$c = $c ^ (ord($hashpieces[$d]) ^ ord($urlpieces[$d]));\r\n\t\t\t$c = self::zerofill($c, 23) | $c << 9;\r\n\t\t}\r\n\t\treturn '8' . self::hexencode($c);\r\n\t}", "public function generateHash (string $password): string;", "function getHash($str, $hashSize) {\n // Sum the ascii of every char of the string\n // and return the modulus of $hashsize\n $str_arr = str_split($str);\n $sum = 0;\n foreach ($str_arr as $char) {\n $sum += ord($char);\n }\n return $sum % $hashSize;\n}", "public function hash() {\n if(isset($this->cache['hash'])) return $this->cache['hash'];\n\n // add a unique hash\n $checksum = sprintf('%u', crc32($this->uri()));\n return $this->cache['hash'] = base_convert($checksum, 10, 36);\n }", "abstract protected static function getHashAlgorithm() : string;", "public function set_hash($string){\n\t\t\t$string = hash($this->hash_algorithm, $string . $this->password_salt);\n\t\t\t$string = $this->password_addenda . $string . $this->password_addenda;\n\t\t\treturn $string;\n\n\t\t}", "private static function key($str) {\n\t\treturn md5($str);\n\t}", "private function hashing() {\n\t\t$data = md5($this->name.$this->date);\n\t\t$data = md5($data);\n\t\t$data = strrev($data);\n\t\t//$data = md5($data);\n\t\t$data = strtoupper($data);\n\t\t//$data = strrev($data);\n\n\t\t$datatemp = NULL;\n\t\tfor($i=0; $i<=strlen($data); $i++) {\n\t\t\t$arr = substr($data, $i, 1);\n\t\t\tif($i == '4' || $i == '8' || $i == '12' || $i == '16' || $i == '20' || $i == '24' || $i == '28' || $i == '32') {\n\t\t\t\t$datatemp .= substr($this->strfinger, ($i/4)-1, 1);\t\n\t\t\t}\n\t\t\t$datatemp .= \"/%\".$this->combine[$arr];\n\t\t}\n\n\t\t$this->resulthashcode = substr($datatemp, 1, strlen($datatemp)-6);\n\t\t$this->result = true;\n\t}", "private function createHash($string, $params = array())\n {\n $query = null;\n\n if ($string) {\n $query .= $string;\n }\n\n if ($params && is_array($params)) {\n $query .= http_build_query($params);\n }\n\n if ($query) {\n $hash = 'stub_' . hash('fnv1a64', $query);\n return $hash;\n }\n\n return false;\n }", "private function newHash()\n {\n $salt = hash('sha256', uniqid(mt_rand(), true) . 't33nh4sh' . strtolower($this->email));\n\n // Prefix the password with the salt\n $hash = $salt . $this->password;\n \n // Hash the salted password a bunch of times\n for ( $i = 0; $i < 100000; $i ++ ) {\n $hash = hash('sha256', $hash);\n }\n \n // Prefix the hash with the salt so we can find it back later\n $hash = $salt . $hash;\n \n return $hash;\n }", "public function getHash() {}", "private function generateUniqueHash()\n {\n $rand = mt_rand(0, 10000);\n $string = $this->generateRandomString();\n $hash = md5($rand . $string);\n return $hash;\n }", "public function hash(string $value)\n {\n }", "public static function GetPasswordHash($str)\n {\n global $PASSWORD_HASH_INFO;\n if (empty($PASSWORD_HASH_INFO)) {\n $type = 'sha256';\n $user_salt = '';\n $random_salt_length = 8;\n } else {\n $type = $PASSWORD_HASH_INFO['type'];\n $user_salt = $PASSWORD_HASH_INFO['user_salt'];\n $random_salt_length = $PASSWORD_HASH_INFO['random_salt_length'];\n }\n $random_salt = ($random_salt_length)? substr(md5(uniqid(rand())), 0, $random_salt_length) : '';\n return $random_salt . hash($type, $random_salt . $str . $user_salt);\n }", "function nthash($password = \"\") {\n return strtoupper(bin2hex(mhash(MHASH_MD4, iconv(\"UTF-8\", \"UTF-16LE\", $password))));\n }", "public static function hash(string $string, array $options = null): string\n {\n if($options === null)\n $options = static::getHashOptions();\n\n return password_hash($string, static::getHashAlgorithm(), $options);\n }", "protected function getHash(): string\n {\n return hash('crc32', md5((string) mt_rand()));\n }", "public function calculateHash(string $text)\n {\n return hash('haval160,4', $text);\n }", "function HashURL($String) {\n\t\t$Check1 = $this->StrToNum($String, 0x1505, 0x21);\n\t\t$Check2 = $this->StrToNum($String, 0, 0x1003F);\n\t\n\t\t$Check1 >>= 2; \t\n\t\t$Check1 = (($Check1 >> 4) & 0x3FFFFC0 ) | ($Check1 & 0x3F);\n\t\t$Check1 = (($Check1 >> 4) & 0x3FFC00 ) | ($Check1 & 0x3FF);\n\t\t$Check1 = (($Check1 >> 4) & 0x3C000 ) | ($Check1 & 0x3FFF);\t\n\t\t\n\t\t$T1 = (((($Check1 & 0x3C0) << 4) | ($Check1 & 0x3C)) <<2 ) | ($Check2 & 0xF0F );\n\t\t$T2 = (((($Check1 & 0xFFFFC000) << 4) | ($Check1 & 0x3C00)) << 0xA) | ($Check2 & 0xF0F0000 );\n\t\t\n\t\treturn ($T1 | $T2);\n\t}", "public static function _awesomeHash($a) {\n $b = 16909125; for ($c=0; $c<strlen($a); $c++) {\n $b ^= (GTB_Helper::charCodeAt(self::HASH_SEED, ($c%87))) ^ (GTB_Helper::charCodeAt($a, $c));\n $b = GTB_Helper::unsignedRightShift($b, 23) | $b << 9;\n }\n return '8'. GTB_Helper::hexEncodeU32($b);\n }", "private static function HashURL($String)\n\t{\n\t\t$Check1 = self::StrToNum($String, 0x1505, 0x21);\n\t\t$Check2 = self::StrToNum($String, 0, 0x1003F);\n\t\t$Check1 >>= 2;\n\t\t$Check1 = (($Check1 >> 4) & 0x3FFFFC0 ) | ($Check1 & 0x3F);\n\t\t$Check1 = (($Check1 >> 4) & 0x3FFC00 ) | ($Check1 & 0x3FF);\n\t\t$Check1 = (($Check1 >> 4) & 0x3C000 ) | ($Check1 & 0x3FFF);\n\t\t$T1 = (((($Check1 & 0x3C0) << 4) | ($Check1 & 0x3C)) <<2 ) | ($Check2 & 0xF0F );\n\t\t$T2 = (((($Check1 & 0xFFFFC000) << 4) | ($Check1 & 0x3C00)) << 0xA) | ($Check2 & 0xF0F0000 );\n\t\treturn ($T1 | $T2);\n\t}", "public function hash(string $message): string {\n\t\t$alg = $this->getPrefferedAlgorithm();\n\n\t\tif (\\defined('PASSWORD_ARGON2ID') && $alg === PASSWORD_ARGON2ID) {\n\t\t\treturn 3 . '|' . password_hash($message, PASSWORD_ARGON2ID, $this->options);\n\t\t}\n\n\t\tif (\\defined('PASSWORD_ARGON2I') && $alg === PASSWORD_ARGON2I) {\n\t\t\treturn 2 . '|' . password_hash($message, PASSWORD_ARGON2I, $this->options);\n\t\t}\n\n\t\treturn 1 . '|' . password_hash($message, PASSWORD_BCRYPT, $this->options);\n\t}", "function phpbb_email_hash($email)\n{\n\treturn sprintf('%u', crc32(strtolower($email))) . strlen($email);\n}", "function key_gen($str=''){\n\treturn str_replace('=','',base64_encode(md5($str)));\n}", "public static function make(string $password, $algo = PASSWORD_DEFAULT) : string {\n\t return password_hash($password, $algo);\n }", "function sri_checksum($input)\n{\n $algorithm = settings::algorithm();\n $hash = hash($algorithm, $input, true);\n $hash_base64 = base64_encode($hash);\n\n return \"$algorithm-$hash_base64\";\n}", "public function hash() {\r\n\t\t$cacheParams = explode(',',$this->cacheParams);\r\n\t\t$hash ='';\r\n\t\tforeach($cacheParams as $param) {\r\n\t\t\t$param = trim($param);\r\n\t\t\t$hash .= @$this->$param;\r\n\t\t}\r\n\t\treturn md5($hash);\r\n\t}", "private function _generateHash($input, $day)\n\t{\n\t\t// Add date:\n\t\t$input .= $day . date('ny');\n\n\t\t// Get MD5 and reverse it\n\t\t$enc = strrev(md5($input));\n\n\t\t// Get only a few chars out of the string\n\t\t$enc = substr($enc, 26, 1) . substr($enc, 10, 1) . substr($enc, 23, 1) . substr($enc, 3, 1) . substr($enc, 19, 1);\n\n\t\treturn $enc;\n\t}", "public function generateHash()\n {\n $this->hash = sha1(serialize($this->toArray()));\n }", "static function hash_string($input, $config = []) {\n\t\t$defaults = [\n\t\t\t'use_salt' => true,\n\t\t\t'encryption' => PASSWORD_BCRYPT\n\t\t];\n\t\t$config = array_merge($defaults, $config);\n\n\t\t//Create random bytes\n\t\t$salt_byte = random_bytes(15);\n\t\t//Make the bytes into a readable string (to save to the database)\n\t\t$salt_string = $config['use_salt'] ? bin2hex($salt_byte) : \"\";\n\t\t//Put the salt-string after the password for the hashing for both creation and login\n\t\t$string_hashed = password_hash($input . $salt_string, $config['encryption']);\n\n\t\treturn ['hash' => $string_hashed, 'salt' => $salt_string];\n\t}", "public static function md5_hash( $string )\n {\n return '{MD5}'.base64_encode( pack( 'H*', md5( $string ) ) );\n }", "public static function hash(string $email) : string\n {\n return md5(strtolower($email));\n }", "function js_sha1($str) {\r\n return js_str(sha1(php_str($str)));\r\n}", "public function generateHash()\n {\n $userContext = new UserContext();\n\n foreach ($this->providers as $provider) {\n $provider->updateUserContext($userContext);\n }\n\n $parameters = $userContext->getParameters();\n\n // Sort by key (alphanumeric), as order should not make hash vary\n ksort($parameters);\n\n return hash('sha256', serialize($parameters));\n }", "public static function make(string $value): string\n {\n return password_hash($value, PASSWORD_DEFAULT);\n }", "function string3(){\n\n $string3 = \"Hola mundo\";\n $sha1 = sha1($string3);\n\n echo $sha1;\n\n}", "public function getHash() : string {\n\t\t// sha256 = 64 characters\n\t\treturn hash_hmac('sha256', $this->token, getenv('ENCRYPTION_KEY'));\n\t}", "public function getHashIdentifier() : string;", "public static function getHash($value)\n {\n return self::sha1($value);\n }", "private static function hashCode(string $s) {\n $len = strlen($s);\n $h = 0;\n for ($i=0; $i<$len; ++$i)\n $h = ($h*31 + ord($s[$i])) & 0xffffffff;\n\n if ($h<=0x7fffffff)\n return $h; // A positive value is returned as-is\n else\n return $h|self::$sign_extend; // A negative value is sign-extended\n }", "public function hash($string, $type = null, $salt = false) {\n\t\treturn Security::hash($string, $type, $salt);\n\t}" ]
[ "0.7942512", "0.7843905", "0.7695186", "0.7663227", "0.76602066", "0.76602066", "0.76233655", "0.75554466", "0.7540518", "0.7527822", "0.75255543", "0.75238955", "0.75195456", "0.75038856", "0.74970835", "0.74696034", "0.7465523", "0.7462078", "0.735199", "0.7335316", "0.7313738", "0.73120755", "0.7311006", "0.73084515", "0.7272347", "0.72457826", "0.7224704", "0.7197304", "0.7176582", "0.71754974", "0.7163653", "0.7156242", "0.71561784", "0.7134897", "0.7110232", "0.7065261", "0.7053742", "0.7053742", "0.7053742", "0.7053742", "0.7038503", "0.70308995", "0.703052", "0.69743496", "0.6935769", "0.69189817", "0.69144505", "0.6890048", "0.68663937", "0.6854261", "0.68461305", "0.68440163", "0.6838011", "0.6832473", "0.68244565", "0.6793963", "0.67930484", "0.67907375", "0.67879784", "0.67824805", "0.6754595", "0.67530787", "0.6735897", "0.6735659", "0.6692456", "0.66807455", "0.6647491", "0.6582712", "0.6577272", "0.65745795", "0.6551577", "0.65273696", "0.65205175", "0.651662", "0.6497974", "0.64956915", "0.64926875", "0.64921993", "0.6491209", "0.64631814", "0.6460567", "0.6432952", "0.6424983", "0.6416383", "0.64072883", "0.6397871", "0.6382778", "0.6382021", "0.6366433", "0.63572514", "0.63244796", "0.6317933", "0.6306063", "0.63051724", "0.6304195", "0.63021815", "0.62974435", "0.6277853", "0.6261748", "0.6258348", "0.6248853" ]
0.0
-1
ordenes con un dia
function get_recent_orders(){ $orders = $this->Order->get_recent_orders(); if($this->params['requested']){ return $orders; }else{ $this->set('orders', $orders); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function todas($suscriptor, $orden) {\n $db = new MySQL(Sesion::getConexion());\n $sql = \"SELECT * FROM `facturacion_lecturas` WHERE `suscriptor` ='\" . $suscriptor . \"' ORDER BY `fecha` \" . strtoupper($orden) . \";\";\n $consulta = $db->sql_query($sql);\n $filas = array();\n while ($fila = $db->sql_fetchrow($consulta)) {\n array_push($filas, $fila);\n }\n return($filas);\n }", "public function tratarDados(){\r\n\t\r\n\t\r\n }", "public function obtenerAutoridad($idcarrera, $idtipocargo, $idsede)\n {\n \tif($idtipocargo == 1 or $idtipocargo == 2) {\n\t \t$q = Doctrine_Query::create()\n\t\t \t\t->select(\"*\")\n\t\t \t\t->from(\"DesignacionesEmpleados de\")\n\t\t \t\t->innerjoin('de.Empleados e on de.idempleado=e.idempleado')\n\t\t \t\t->where(\"de.idtipocargo = \".$idtipocargo)\n\t\t \t\t->andWhere(\"de.inicio<CURRENT_TIMESTAMP()\")\n\t\t \t->andWhere(\"(de.fin>CURRENT_TIMESTAMP() or de.fin='0000-00-00')\")\n\t\t \t->andWhere(\"de.activo = 1\") \t\n\t\t \t->fetchOne(); \n\t\t// Director\t \t\t\n\t } elseif ($idtipocargo == 19) {\n\t \t$q = Doctrine_Query::create()\n\t \t\t->select(\"*\")\n\t \t\t->from(\"DesignacionesEmpleados de\")\n\t \t\t->innerjoin('de.Empleados e on de.idempleado=e.idempleado')\n\t \t\t->where(\"de.idtipocargo = \".$idtipocargo)\n\t \t\t->andWhere(\"de.inicio<CURRENT_TIMESTAMP()\")\n\t \t\t->andWhere(\"de.fin>CURRENT_TIMESTAMP() or de.fin='0000-00-00'\")\n\t \t\t->andWhere(\"de.activo = 1\")\n\t \t\t->andWhere('de.idempleado IN (\n\t\t \t\t\t\tSELECT es.idempleado\n\t\t \t\t\t\tFROM EmpleadosSede es\n\t\t \t\t\t\tWHERE es.idsede = '.$idsede.')')\n\t \t\t->andWhere('de.idarea IN (\n\t\t \t\t\t\tSELECT ac.idarea\n\t\t \t\t\t\tFROM AreasCarrera ac\n\t \t\t\t\t\tINNER JOIN ac.Areas ar ON ac.idarea=ar.idarea\n\t\t \t\t\t\tWHERE (ar.idtipoarea = 5 or ar.idtipoarea = 7) and ac.idcarrera = '.$idcarrera.')')\n\t \t\t->fetchOne();\t\n\t\t// Decano o Sec Academico\t \t\t\n \t} else {\n\t \t$q = Doctrine_Query::create()\n\t\t \t\t->select(\"*\")\n\t\t \t\t->from(\"DesignacionesEmpleados de\")\n\t\t \t\t->innerjoin('de.Empleados e on de.idempleado=e.idempleado')\n\t\t \t\t->where(\"de.idtipocargo = \".$idtipocargo)\n\t\t \t\t->andWhere(\"de.inicio<CURRENT_TIMESTAMP()\")\n\t\t \t->andWhere(\"de.fin>CURRENT_TIMESTAMP() or de.fin='0000-00-00'\")\n\t\t \t->andWhere(\"de.activo = 1\")\n\t \t\t->andWhere('de.idarea IN (\n\t\t \t\t\t\tSELECT ac.idarea \n\t\t \t\t\t\tFROM AreasCarrera ac\n\t\t \t\t\t\tWHERE ac.idcarrera = '.$idcarrera.')')\t \t\t \t\n\t\t \t->fetchOne(); \t\n \t}\n\t \n return $q;\n }", "public function comenzarOrden($ido)\n {\n if (!Auth::user()->hasRole('Profesional')) abort(403);\n if (!filter_var($ido, FILTER_VALIDATE_INT)) abort(404);\n\n $idEmpresa = Session::get('idEmpresa');\n $fecha = Carbon::now();\n \n\n $orden = DB::table('ORDEN_SERVICIOS')\n ->join('LOOKUP', 'ORD_LOO_TIPOORDEN', '=', 'LOO_IDLOOKUP')\n ->where('LOO_GRUPO', 1)\n ->where('ORD_IDORDEN', $ido)\n ->first();\n\n\n $tipo = $orden->ORD_LOO_TIPOORDEN;\n // dd($tipo);\n\n DB::table('ORDEN_SERVICIOS')->where('ORD_IDORDEN', $ido)->update(['ORD_LOO_ESTADOORDEN' => 2, 'ORD_INICIOORDEN' => $fecha]);\n return view('ordenpersona.atenderOrden', compact('orden', 'tipo', 'inventarios'));\n }", "public function printDiasByRango($fechaInicio, $fechaFin){\n echo \"<h1>$this->asignatura : Programacion</h1>\";\n// echo \"<strong>FechaInicio = \".$fechaInicio->format('Y-m-d').\"</strong>\";\n// echo \"<strong>FechaFin = \".$fechaFin->format('Y-m-d').\"</strong>\";\n echo \"<h2> Unidades </h2>\";\n $this->printUnidades();\n\n //echo \"<h2> PLANIFICACION\".count($this->DIAS).\"</h2>\";\n $mes = -1;\n foreach($this->DIAS as $dia){\n // parsear dia\n $mesDia = $dia->fecha->format('m');\n $diaSemana = $dia->fecha->format('w');\n\n // cambio de mes\n if ($mes != $mesDia){\n // cambio de mes\n // fin mes\n if ($mes != -1){\n echo \"</table>\\n\";\n }\n\n // nuevo mes\n $mes = $mesDia;\n $this->printCabeceraMes($dia);\n // rellenar hasta lunes\n if ($diaSemana != 0 ){\n $relleno = $diaSemana;\n }else{\n // es domingo cambio\n $relleno = 7;\n }\n for ($d = 1; $d < $relleno; $d++ ){\n echo \"<td></td>\\n\";// hueco de dia vacio\n }\n }\n // cambio de semana\n if ($diaSemana == 1){\n echo \"</tr>\\n\";\n echo \"<tr>\\n\";\n }\n\n // cambio de unidad\n //<<\n\n // escribir dia\n $this->printDia($dia);\n }\n\n }", "public function getDados() {\n\n \t/**\n \t * Configurações do período informado.\n \t */\n $oDaoPeriodo = db_utils::getDao(\"periodo\");\n $sSqlDadosPeriodo = $oDaoPeriodo->sql_query_file($this->iCodigoPeriodo);\n $rsPeriodo = db_query($sSqlDadosPeriodo);\n $oDadosPeriodo = db_utils::fieldsMemory($rsPeriodo, 0);\n\n /**\n * Configurações do tipo de instituição da prefeitura ou câmara.\n */\n $oDaoDbConfig = db_utils::getDao(\"db_config\");\n $sWhere = \"codigo in({$this->getInstituicoes()})\";\n $sSqlDbConfig = $oDaoDbConfig->sql_query_file(null, 'db21_tipoinstit', null, $sWhere);\n $rsSqlDbConfig = $oDaoDbConfig->sql_record($sSqlDbConfig);\n $INumRowsDbConfig = $oDaoDbConfig->numrows;\n\n $iLimiteMaximo = 0;\n $iLimitePrudencial = 0;\n $nValorDespesaTotalPessoal = 0;\n $nTotalRCL = 0;\n $lTemPrefeitura = false;\n $lTemCamara = false;\n $lTemMinisterio = false;\n\n /**\n * Verifica o db21_tipoinstit para ver se é prefeitura ou câmara.\n */\n for ($iInd = 0; $iInd < $INumRowsDbConfig; $iInd++) {\n\n $oMunicipio = db_utils::fieldsMemory($rsSqlDbConfig, $iInd);\n\n if ($oMunicipio->db21_tipoinstit == 1) {\n $lTemPrefeitura = true;\n } else if ($oMunicipio->db21_tipoinstit == 2) {\n $lTemCamara = true;\n } else if ($oMunicipio->db21_tipoinstit == 101) {\n \t$lTemMinisterio = true;\n }\n }\n\n /**\n * Verifica o limite máximo (incisos I, II e III, art. 20 da LRF) {$iLimiteMaximo}%\n */\n if ($lTemPrefeitura == true && $lTemCamara == true) {\n\n if ($iLimiteMaximo == 0){\n $iLimiteMaximo = 60;\n $iLimiteMaximoAlerta = 54;\n\n }\n } else if ($lTemPrefeitura == true && $lTemCamara == false) {\n\n if ($iLimiteMaximo == 0) {\n\n $iLimiteMaximo = 54;\n $iLimiteMaximoAlerta = 48.6;\n }\n } else if ($lTemPrefeitura == false && $lTemCamara == true) {\n\n if ($iLimiteMaximo == 0) {\n $iLimiteMaximo = 6;\n $iLimiteMaximoAlerta = 5.4;\n }\n } else if ($lTemMinisterio) {\n\n if ($iLimiteMaximo == 0) {\n $iLimiteMaximo = 2;\n }\n }\n\n /**\n * Verifica o limite prudencial (parágrafo único, art. 22 da LRF) {$iLimitePrudencial}%\n */\n if ($iLimitePrudencial == 0) {\n $iLimitePrudencial = $iLimiteMaximo*95/100;\n }\n\n /**\n * Quadro de despesa bruta.\n */\n $oDespesaBruta = new stdClass();\n $oDespesaBruta->quadrodescricao = 'DESPESA BRUTA COM PESSOAL (I)';\n $oDespesaBruta->exercicio = 0;\n $oDespesaBruta->inscritas = 0;\n $oDespesaBruta->linhas = array();\n $oDespesaBruta->colunameses = $this->getDadosColuna();\n $oDespesaBruta->valorapurado = 0;\n $oDespesaBruta->percentuallimite = 0;\n $oDespesaBruta->linhatotalizadora = true;\n\n /**\n * Quadro de despesa não computadas.\n */\n $oDespesaNaoComputada = new stdClass();\n $oDespesaNaoComputada->quadrodescricao = 'DESPESAS NÃO COMPUTADAS (§ 1o do art. 19 da LRF) (II)';\n $oDespesaNaoComputada->exercicio = 0;\n $oDespesaNaoComputada->inscritas = 0;\n $oDespesaNaoComputada->linhas = array();\n $oDespesaNaoComputada->colunameses = $this->getDadosColuna();\n $oDespesaNaoComputada->valorapurado = 0;\n $oDespesaNaoComputada->percentuallimite = 0;\n $oDespesaNaoComputada->linhatotalizadora = true;\n\n /**\n * Quadro de despesa líquida.\n */\n $oDespesaLiquida = new stdClass();\n $oDespesaLiquida->quadrodescricao = 'DESPESA LÍQUIDA COM PESSOAL (III) = (I - II)';\n $oDespesaLiquida->exercicio = 0;\n $oDespesaLiquida->inscritas = 0;\n $oDespesaLiquida->linhas = array();\n $oDespesaLiquida->colunameses = $this->getDadosColuna();\n $oDespesaLiquida->valorapurado = 0;\n $oDespesaLiquida->percentuallimite = 0;\n $oDespesaLiquida->linhatotalizadora = true;\n\n /**\n * Quadro de despesa total com pessoal.\n */\n $oDespesaTotalComPessoal = new stdClass();\n $oDespesaTotalComPessoal->quadrodescricao = 'DESPESA TOTAL COM PESSOAL - DTP(V) = (IIIa + IIIb)';\n $oDespesaTotalComPessoal->exercicio = 0;\n $oDespesaTotalComPessoal->inscritas = 0;\n $oDespesaTotalComPessoal->linhas = array();\n $oDespesaTotalComPessoal->colunameses = array();\n $oDespesaTotalComPessoal->valorapurado = 0;\n $oDespesaTotalComPessoal->percentuallimite = 0;\n $oDespesaTotalComPessoal->linhatotalizadora = true;\n $oDespesaTotalComPessoal->percentualsobrercl = 0;\n\n /**\n * Quadro de receita corrente líquida.\n */\n $oReceitaTotalCorrenteLiquida = new stdClass();\n $oReceitaTotalCorrenteLiquida->quadrodescricao = 'RECEITA CORRENTE LÍQUIDA - RCL (IV)';\n $oReceitaTotalCorrenteLiquida->exercicio = 0;\n $oReceitaTotalCorrenteLiquida->inscritas = 0;\n $oReceitaTotalCorrenteLiquida->linhas = array();\n $oReceitaTotalCorrenteLiquida->colunameses = array();\n $oReceitaTotalCorrenteLiquida->valorapurado = 0;\n $oReceitaTotalCorrenteLiquida->percentuallimite = 0;\n $oReceitaTotalCorrenteLiquida->linhatotalizadora = false;\n\n /**\n * Quadro de despesa total com pessoal sem a RCL.\n */\n $oDespesaTotalComPessoalSemRCL = new stdClass();\n $oDespesaTotalComPessoalSemRCL->quadrodescricao = 'DESPESA TOTAL COM PESSOAL - DTP (V) = (III a + III b)';\n $oDespesaTotalComPessoalSemRCL->exercicio = 0;\n $oDespesaTotalComPessoalSemRCL->inscritas = 0;\n $oDespesaTotalComPessoalSemRCL->linhas = array();\n $oDespesaTotalComPessoalSemRCL->colunameses = array();\n $oDespesaTotalComPessoalSemRCL->valorapurado = 0;\n $oDespesaTotalComPessoalSemRCL->percentuallimite = 0;\n $oDespesaTotalComPessoalSemRCL->linhatotalizadora = false;\n\n /**\n * Quadro de limite máximo.\n */\n $oLimiteMaximo = new stdClass();\n $oLimiteMaximo->quadrodescricao = 'LIMITE MÁXIMO (VI) (incisos I, II e III, art. 20 da LRF)';\n $oLimiteMaximo->exercicio = 0;\n $oLimiteMaximo->inscritas = 0;\n $oLimiteMaximo->linhas = array();\n $oLimiteMaximo->colunameses = array();\n $oLimiteMaximo->valorapurado = 0;\n $oLimiteMaximo->percentuallimite = 0;\n $oLimiteMaximo->linhatotalizadora = false;\n\n /**\n * Quadro de limite prudencial.\n */\n $oLimitePrudencial = new stdClass();\n $oLimitePrudencial->quadrodescricao = 'LIMITE PRUDENCIAL (VII) = (0,95 x VI) (parágrafo único do art. 22 da LRF)';\n $oLimitePrudencial->exercicio = 0;\n $oLimitePrudencial->inscritas = 0;\n $oLimitePrudencial->linhas = array();\n $oLimitePrudencial->colunameses = array();\n $oLimitePrudencial->valorapurado = 0;\n $oLimitePrudencial->percentuallimite = 0;\n $oLimitePrudencial->linhatotalizadora = false;\n\n $oLimiteAlerta = new stdClass();\n $oLimiteAlerta->quadrodescricao = 'LIMITE DE ALERTA (VIII) = (0,90 x VI) (inciso II do §1º do art. 59 da LRF)';\n $oLimiteAlerta->exercicio = 0;\n $oLimiteAlerta->inscritas = 0;\n $oLimiteAlerta->linhas = array();\n $oLimiteAlerta->colunameses = array();\n $oLimiteAlerta->valorapurado = 0;\n $oLimiteAlerta->percentuallimite = 0;\n $oLimiteAlerta->linhatotalizadora = false;\n\n $aDadosMeses = $this->getDadosColuna();\n /**\n * Percorremos as linhas cadastradas no relatorio, e adicionamos os valores cadastrados manualmente.\n */\n $aLinhasRelatorio = $this->oRelatorioLegal->getLinhasCompleto();\n for ($iLinha = 1; $iLinha <= 7; $iLinha++) {\n\n $aLinhasRelatorio[$iLinha]->setPeriodo($this->iCodigoPeriodo);\n $aColunasRelatorio = $aLinhasRelatorio[$iLinha]->getCols($this->iCodigoPeriodo);\n\n /**\n * Monta o Object com os dados de cada linha interna do relatório.\n */\n $oLinha = new stdClass();\n switch ($iLinha) {\n\n \tcase 1:\n \t $sDescricao = ' Pessoal Ativo';\n \t break;\n\n case 2:\n $sDescricao = ' Pessoal Inativo e Pensionistas';\n break;\n\n case 3:\n $sDescricao = ' Outras despesas de pessoal decorrentes de contratos de terceirização (§ 1º do art. 18 da LRF)';\n break;\n\n case 4:\n $sDescricao = ' Indenizações por Demissão e Incentivos à Demissão Voluntária';\n break;\n\n case 5:\n $sDescricao = ' Decorrentes de Decisão Judicial de período anterior ao da apuração';\n break;\n\n case 6:\n $sDescricao = ' Despesas de Exercícios Anteriores de período anterior ao da apuração';\n break;\n\n case 7:\n $sDescricao = ' Inativos e Pensionistas com Recursos Vinculados';\n break;\n }\n\n $oLinha->descricao = $sDescricao;\n $oLinha->inscritas = 0;\n $oLinha->exercicio = 0;\n $oLinha->colunameses = $this->getDadosColuna();\n $oParametros = $aLinhasRelatorio[$iLinha]->getParametros($this->iAnoUsu,\n $this->getInstituicoes());\n /**\n * Verifica nas configurações se possui valores configurados por linha.\n */\n $aValoresColunasLinhas = $aLinhasRelatorio[$iLinha]->getValoresColunas(null, null,\n $this->getInstituicoes(),\n $this->iAnoUsu);\n foreach($aValoresColunasLinhas as $oValor) {\n\n \tif (isset($oLinha->colunameses[$oValor->colunas[0]->o117_valor])) {\n\n $oLinha->colunameses[$oValor->colunas[0]->o117_valor]->nValor += $oValor->colunas[1]->o117_valor;\n $oLinha->exercicio += $oValor->colunas[1]->o117_valor;\n $oLinha->inscritas += $oValor->colunas[2]->o117_valor;\n }\n }\n\n /**\n * Percore as colunas do período dos últimos 12 mêses.\n */\n foreach ($oLinha->colunameses as $sChaveMes => $oDadosMes) {\n\n \t/**\n \t * Informa as datas inicial e final do período.\n \t */\n $sDataInicialPeriodo = \"{$oDadosMes->iAno}-{$oDadosMes->iMes}-01\";\n $sDataFinalPeriodo = \"{$oDadosMes->iAno}-{$oDadosMes->iMes}-{$oDadosMes->iDiaFim}\";\n\n /**\n * Executa o saldo da dotação.\n */\n $sWhereDespesa = \"o58_instit in ({$this->getInstituicoes()})\";\n $rsDespesa = db_dotacaosaldo(8, 2, 3, true, $sWhereDespesa, $oDadosMes->iAno,\n $sDataInicialPeriodo, $sDataFinalPeriodo);\n\n /**\n * Verifica o saldo das contas por linha e mês do relatório\n */\n for ($iDespesa = 0; $iDespesa < pg_numrows($rsDespesa); $iDespesa++) {\n\n $oDespesa = db_utils::fieldsmemory($rsDespesa, $iDespesa);\n\n /**\n * Percorre as contas configuradas.\n */\n foreach ($oParametros->contas as $oConta) {\n\n $oVerificacao = $aLinhasRelatorio[$iLinha]->match($oConta, $oParametros->orcamento, $oDespesa, 2);\n if ($oVerificacao->match) {\n\n $oDespesaValores = clone $oDespesa;\n if ($oVerificacao->exclusao) {\n\n /**\n * Somas apenas os valor liquidados.\n */\n $oDespesaValores->liquidado *= -1;\n\n /**\n * Soma os demais valores\n */\n $oDespesaValores->liquidado_acumulado *= -1;\n $oDespesaValores->empenhado_acumulado *= -1;\n $oDespesaValores->anulado_acumulado *= -1;\n }\n\n $oLinha->colunameses[$sChaveMes]->nValor += $oDespesaValores->liquidado;\n $oLinha->exercicio += $oDespesaValores->liquidado;\n\n /**\n * Verifica totalização das inscritas do último período.\n */\n if ($oDadosPeriodo->o114_sigla == \"3Q\" || $oDadosPeriodo->o114_sigla == \"2S\"\n || $oDadosPeriodo->o114_sigla == \"DEZ\") {\n\n $aChaveMesColunaMeses = array_keys($oLinha->colunameses);\n if (trim($aChaveMesColunaMeses[11]) == trim($sChaveMes)) {\n\n $oLinha->inscritas += round(\n $oDespesaValores->empenhado_acumulado -\n $oDespesaValores->anulado_acumulado -\n $oDespesaValores->liquidado_acumulado, 2);\n }\n }\n }\n }\n }\n }\n\n /**\n * Monta as linhas dos quadros do demostrativo.\n */\n if ($iLinha <= 3) {\n $oDespesaBruta->linhas[$iLinha] = $oLinha;\n } else if ($iLinha >= 4) {\n $oDespesaNaoComputada->linhas[$iLinha] = $oLinha;\n }\n }\n\n /*\n * Calcula linhas totalizadoras da despesa bruta.\n */\n foreach ($oDespesaBruta->linhas as $oDadosLinhaDespesaBruta) {\n\n $oDespesaBruta->inscritas += $oDadosLinhaDespesaBruta->inscritas;\n $oDespesaBruta->exercicio += $oDadosLinhaDespesaBruta->exercicio;\n foreach ($oDadosLinhaDespesaBruta->colunameses as $sChaveMesDespesaBruta => $oDadosMesDespesaBruta) {\n\n \tif (isset($oDespesaBruta->colunameses[$sChaveMesDespesaBruta])) {\n $oDespesaBruta->colunameses[$sChaveMesDespesaBruta]->nValor += $oDadosMesDespesaBruta->nValor;\n \t}\n }\n }\n\n /**\n * Calcula linhas totalizadoras da despesa não computada.\n */\n foreach ($oDespesaNaoComputada->linhas as $oDadosLinhaDespesaNaoComputada) {\n\n $oDespesaNaoComputada->inscritas += $oDadosLinhaDespesaNaoComputada->inscritas;\n $oDespesaNaoComputada->exercicio += $oDadosLinhaDespesaNaoComputada->exercicio;\n foreach ($oDadosLinhaDespesaNaoComputada->colunameses as $sChaveMesDespesaNaoComputada\n => $oDadosMesDespesaNaoComputada) {\n\n if (isset($oDespesaNaoComputada->colunameses[$sChaveMesDespesaNaoComputada])) {\n $oDespesaNaoComputada->colunameses[$sChaveMesDespesaNaoComputada]\n ->nValor += $oDadosMesDespesaNaoComputada->nValor;\n }\n }\n }\n\n /**\n * Calcula linhas totalizadoras da despesa liquída.\n */\n $oDespesaLiquida->inscritas = ($oDespesaBruta->inscritas - $oDespesaNaoComputada->inscritas);\n $oDespesaLiquida->exercicio = ($oDespesaBruta->exercicio - $oDespesaNaoComputada->exercicio);\n foreach ($oDespesaLiquida->colunameses as $sChaveMesDespesaLiquida => $oDadosMesDespesaLiquida) {\n\n \tif (isset($oDespesaLiquida->colunameses[$sChaveMesDespesaLiquida])) {\n \t\t$oDespesaLiquida->colunameses[$sChaveMesDespesaLiquida]->nValor = ( $oDespesaBruta\n \t\t ->colunameses[$sChaveMesDespesaLiquida]\n \t\t ->nValor\n \t\t - $oDespesaNaoComputada\n \t\t ->colunameses[$sChaveMesDespesaLiquida]\n \t\t ->nValor );\n \t}\n }\n\n /**\n * Verifica valor RCL nas configurações da linha 8.\n */\n $aLinhasRelatorio[8]->setPeriodo($this->iCodigoPeriodo);\n $aValoresColunasLinhas = $aLinhasRelatorio[8]->getValoresColunas(null, null,\n $this->getInstituicoes(),\n $this->iAnoUsu);\n foreach($aValoresColunasLinhas as $oValor) {\n\n if (isset($oValor->colunas[0]->o117_valor)) {\n $nTotalRCL += $oValor->colunas[0]->o117_valor;\n }\n }\n\n if ($nTotalRCL == 0) {\n /**\n * Para o cálculo da RCL, a base de cálculo\n * deve ser feita por todas as instituições.\n */\n $rsInstituicoes = db_query(\"SELECT codigo FROM db_config;\");\n $oInstituicoes = db_utils::getCollectionByRecord($rsInstituicoes);\n $aInstituicoes = array();\n foreach ($oInstituicoes as $oInstituicao){\n $aInstituicoes[]= $oInstituicao->codigo;\n }\n $sInstituicoes = implode(\",\",$aInstituicoes);\n\n\t /**\n\t * Calcula RCL - duplicaReceitaaCorrenteLiquida.\n\t */\n $dtInicialAnterior = ($this->iAnoUsu-1).\"-01-01\";\n $dtFinalAnterior = ($this->iAnoUsu-1).\"-12-31\";\n\n duplicaReceitaaCorrenteLiquida($this->iAnoUsu, 81);\n\n $nTotalRCL += calcula_rcl2($this->iAnoUsu, $this->getDataInicial()->getDate(), $this->getDataFinal()->getDate(),\n $sInstituicoes, false, 81);\n $nTotalRCL += calcula_rcl2(($this->iAnoUsu-1), $dtInicialAnterior, $dtFinalAnterior,\n $sInstituicoes, false, 81, $this->getDataFinal()->getDate());\n }\n\n $nValorDespesaTotalPessoal = ($oDespesaLiquida->exercicio + $oDespesaLiquida->inscritas);\n\n /**\n * Verifica valor % despesa total com pessoal - DTP sobre a RCL (VI)=(IV/V)*100.\n */\n if ($nTotalRCL > 0) {\n $nValorDesepesaTotalPessoalSobreRCL = ($nValorDespesaTotalPessoal/$nTotalRCL)*100;\n } else {\n $nValorDesepesaTotalPessoalSobreRCL = 0;\n }\n\n $nPercentualDespesaPessoalSobreRcl = 0;\n if ($nTotalRCL > 0) {\n $nPercentualDespesaPessoalSobreRcl = ($nValorDespesaTotalPessoal * 100) / $nTotalRCL;\n }\n\n /**\n * Soma valores totail do limite maximo (incisos I, II e III, art. 20 da LRF) e\n * do limite prudencial (parágrafo único, art. 22 da LRF).\n */\n $nValorLimiteMaximo = (($nTotalRCL + 0) * $iLimiteMaximo) / 100;\n $nValorLimitePrudencial = (($nTotalRCL + 0) * $iLimitePrudencial) / 100;\n $nValorLimiteAlerta = (($nTotalRCL + 0) * $iLimiteMaximoAlerta) / 100;\n\n $oDespesaTotalComPessoal->valorapurado = $nValorDespesaTotalPessoal;\n $oDespesaTotalComPessoal->percentualsobrercl = $nPercentualDespesaPessoalSobreRcl;\n $oReceitaTotalCorrenteLiquida->valorapurado = $nTotalRCL;\n $oDespesaTotalComPessoalSemRCL->valorapurado = $nValorDesepesaTotalPessoalSobreRCL;\n $oLimiteMaximo->percentuallimite = $iLimiteMaximo;\n $oLimiteMaximo->valorapurado = $nValorLimiteMaximo;\n $oLimitePrudencial->percentuallimite = $iLimitePrudencial;\n $oLimitePrudencial->valorapurado = $nValorLimitePrudencial;\n\n $oLimiteAlerta->percentuallimite = $iLimiteMaximoAlerta;\n $oLimiteAlerta->valorapurado = $nValorLimiteAlerta;\n\n /**\n * Monta Object para retorno com todos os dados por quadro informado.\n */\n $oRetorno = new stdClass();\n $oRetorno->quadrodespesabruta = $oDespesaBruta;\n $oRetorno->quadrodespesanaocomputadas = $oDespesaNaoComputada;\n $oRetorno->quadrodespesaliquida = $oDespesaLiquida;\n $oRetorno->quadrodespesatotalcompessoal = $oDespesaTotalComPessoal;\n $oRetorno->quadroreceitatotalcorrenteliquida = $oReceitaTotalCorrenteLiquida;\n $oRetorno->quadrodespesatotalcompessoalsemrcl = $oDespesaTotalComPessoalSemRCL;\n $oRetorno->quadrolimitemaximo = $oLimiteMaximo;\n $oRetorno->quadrolimiteprudencial = $oLimitePrudencial;\n $oRetorno->quadrolimitealerta = $oLimiteAlerta;\n\n unset($aLinhasRelatorio);\n\n $this->oDados = $oRetorno;\n return $this->oDados;\n }", "public function getComentarios($idAnuncio){ \n /*$query = \"SELECT fc.idUser, fc.idComentario, fc.idAnuncio, fc.comentario, fc.idPadre, fc.fecha, fu.nick, fu2.nick nickPadre\n FROM final_comentario fc INNER JOIN final_usuario fu USING(idUser) LEFT JOIN final_usuario fu2 ON(fc.idPadre = fu2.idUser) \n WHERE idAnuncio = '\".$idAnuncio.\"' ORDER BY fecha ASC\"; */\n \n $query = \"SELECT fc.idAnuncio, fc.idComentario, fc.idUser, fu.nick, fc.comentario, fc.idPadre, fc.fecha, aux2.nick nickPadre\n FROM final_comentario fc INNER JOIN final_usuario fu ON(fc.idUser=fu.idUser) LEFT JOIN\n (SELECT aux.idComentario, fu.nick\n FROM (SELECT fc2.idComentario, fc2.idUser FROM final_comentario fc1 INNER JOIN final_comentario fc2 ON (fc1.idPadre=fc2.idComentario)) aux\n INNER JOIN final_usuario fu ON(aux.idUser=fu.idUser)) aux2 ON (fc.idPadre=aux2.idComentario)\n WHERE fc.idAnuncio = '\".$idAnuncio.\"' ORDER BY fc.fecha ASC\";\n \n return $this->con->action($query); \n }", "function datos_ocupacion($despacho,$fecha)\n{\n\t$dias_co=array(\"\",\"L\",\"M\",\"X\",\"J\",\"V\",\"S\",\"D\");\n\t\n\tglobal $con;\n\t$stamp = cambiaf($fecha);\n\t$tokeao = explode(\"-\",$stamp);\n\t$paso_el=date(\"w\",mktime(0, 0, 0, $tokeao[1], $tokeao[2], $tokeao[0]));\n\t\n\t$sql = \"Select * from agenda where datediff(finc,'$stamp') <=0 and datediff(ffin,'$stamp')>=0 and despacho like $despacho or repeticion like '%$dias_co[$paso_el];%' and despacho like $despacho and datediff(finc,'$stamp') <=0 order by hinc asc\";\n\t\t$consulta = @mysql_query($sql,$con);\n\t\tif(@mysql_numrows($consulta)!=0)\n\t\t{\n\t\t\twhile( true == ( $resultado = mysql_fetch_array( $consulta ) ) )\n\t\t\t{\n\t\t\t\t$cadena.=\"<div id='ocupacion_\".$resultado[0].\"' class='despacho_ocupado'>\";\n\t\t\t\t$hinc = quita_segundos($resultado[hinc]);\n\t\t\t\t$hfin = quita_segundos($resultado[hfin]);\n\t\t\t//!!CASO RESERVAS A NO CLIENTES\n\t\t\t\tif($resultado[id_cliente]!=\"\")\n\t\t\t\t{\n\t\t\t\t\t$cadena.=\"<div class='las_horas'>\".$hinc.\"-\".$hfin.\"</div>\".nombre_cliente($resultado[1]);\n\t\t\t\t\t$cadena.=\"<br/><span class='mini_boton' onclick='informacion_cliente($resultado[1],0,$resultado[0])'>&nbsp;Observaciones&nbsp;</span><input type='hidden' id='cliente_despacho_$resultado[1]' value='$resultado[1]' /><p/>\";\n\t\t\t\t\t$cadena.=confirmado($resultado[conformidad]);\n\t\t\t\t\t$cadena.=\"<p/>\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$cadena.=\"<div class='las_horas'>\".$hinc.\"-\".$hfin.\"</div>\".$resultado[otro];\n\t\t\t\t\t$cadena.=\"<br/><span class='mini_boton' onclick='informacion_cliente($resultado[0],1)'>&nbsp;Observaciones&nbsp;</span><input type='hidden' id='cliente_despacho_$resultado[1]' value='$resultado[1]' /><p/>\";\n\t\t\t\t\t$cadena.=confirmado($resultado[conformidad]);\n\t\t\t\t\t$cadena.=\"<p/>\";\n\t\t\t\t}\n\t\t\t\t$cadena.=\"</div>&nbsp;\";\n\t\t\t}\n\t\t}\n\t\telse $cadena.=\"&nbsp;\";\n\treturn $cadena;\n}", "public function getDiasPanti($id, $ano, $mes)\n { \n if ($mes > 0 )\n {\n $mes = $mes + ( $ano * 12 ); // Pasar los años a meses \n $result=$this->adapter->query(\"select b.id, b.idEmp ,0 as dias,c.idCcos, \n c.fecing , DATE_ADD( c.fecing , interval \".$mes.\" month) , c.CedEmp , c.nombre , c.idTemp, case when e.id > 0 then 1 else 0 end as pg, \n case when (day( d.fecha) >= day(a.fechaI)) and (day( d.fecha) <= day(a.fechaF)) then 1 else 0 end as diaI \n from n_nomina a\n inner join n_nomina_e b on b.idNom = a.id\n inner join a_empleados c on c.id = b.idEmp \n inner join n_tipemp_p d on d.idEmp = b.idEmp and d.idTemp = 1 # mientras 1 es para los convencionados \n left join n_pg_primas_ant e on e.idEmp = b.idEmp and year(e.fechaI) = year(a.fechaI) and month( e.fechaI ) and month( a.fechaI )\n where c.activo=0 and c.estado = 0 \n and ( ( year( DATE_ADD( d.fecha , interval \".$mes.\" month) ) = year( a.fechaI ) )\n and ( month( DATE_ADD( d.fecha , interval \".$mes.\" month) ) = month( a.fechaI ) ) ) \n and a.id = \".$id.\" \n order by c.fecing desc\",Adapter::QUERY_MODE_EXECUTE);\t\t \n }else{\n $result=$this->adapter->query(\"select b.id, b.idEmp ,0 as dias,c.idCcos, \n c.fecing , day( d.fecha ) as diaI, DATE_ADD( c.fecing , interval \".$ano.\" year) , c.CedEmp , c.nombre , c.idTemp, case when e.id > 0 then 1 else 0 end as pg,\n case when (day( d.fecha) >= day(a.fechaI)) and (day( d.fecha) <= day(a.fechaF)) then 1 else 0 end as diaI \n from n_nomina a\n inner join n_nomina_e b on b.idNom = a.id\n inner join a_empleados c on c.id = b.idEmp \n inner join n_tipemp_p d on d.idEmp = b.idEmp and d.idTemp = 1 # mientras 1 es para los convencionados\n left join n_pg_primas_ant e on e.idEmp = b.idEmp and year(e.fechaI) = year(a.fechaI) and month( e.fechaI ) and month( a.fechaI ) \n where c.activo=0 and c.estado = 0 \n and ( ( year( DATE_ADD( d.fecha , interval \".$ano.\" year) ) = year( a.fechaI ) )\n and ( month( DATE_ADD( d.fecha , interval \".$ano.\" year) ) = month( a.fechaI ) ) ) \n and a.id = \".$id.\" \n order by c.fecing desc \",Adapter::QUERY_MODE_EXECUTE);\t\t \n }\t\t \n $datos=$result->toArray();\n return $datos; \n }", "public function mostrarDados(){\n\t\t$sql = \"SELECT cliente.cod_cliente, cliente.nome_cliente, categoria.cod_categoria, categoria.desc_categoria, servico.cod_servico, servico.desc_servico, servico.foto\t\n\t\t\t\tFROM cliente INNER JOIN (categoria INNER JOIN servico ON categoria.cod_categoria = servico.cod_categoria) ON cliente.cod_cliente = servico.cod_cliente\n\t\t\t\twhere cod_servico = '$this->cod_servico'\";\n\t\t$qry= self:: executarSQL($sql);\n\t\t$linha = self::listar($qry);\n\t\t\n\t\t$this-> cod_servico = $linha['cod_servico'];\n\t\t$this-> cod_categoria = $linha['cod_categoria'];\n\t\t$this-> desc_categoria = $linha['desc_categoria'];\n\t\t$this-> cod_cliente = $linha['cod_cliente'];\n\t\t$this-> nome_cliente = $linha['nome_cliente'];\n\t\t$this-> desc_servico = $linha['desc_servico'];\n\t\t$this-> foto = $linha['foto'];\n\t}", "function getEstadisticaPorDia() {\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\t\tglobal $dias_semana;\n\t\tglobal $usr;\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', 'rendimiento_por_dia.tpl');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_TITULO_HORARIOS', 'bloque_titulo_horarios');\n\t\t$T->setBlock('tpl_tabla', 'ES_PRIMERO_DIA', 'es_primero_dia');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_PASOS', 'lista_pasos');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_TABLA', 'bloque_tabla');\n\n\n\t\t$T->setVar('__item_orden', $this->extra[\"item_orden\"]);\n\n\t\t$horarios = array($usr->getHorario($this->horario_id));\n\t\tif ($this->horario_id != 0) {\n\t\t\t$horarios[] = $usr->getHorario(0);\n\t\t}\n\n\t\t$orden = 1;\n\t\t$T->setVar('bloque_titulo_horarios', '');\n\t\tforeach ($horarios as $horario) {\n\n\t\t\t/* OBTENER LOS DATOS Y PARSEARLO */\n\t\t\t$sql = \"SELECT * FROM reporte.rendimiento_resumen_global_pordiasemana(\".\n\t\t\t\t\tpg_escape_string($current_usuario_id).\",\".\n\t\t\t\t\tpg_escape_string($this->objetivo_id).\", \".\n\t\t\t\t\tpg_escape_string($horario->horario_id).\",' \".\n\t\t\t\t\tpg_escape_string($this->timestamp->getInicioPeriodo()).\"', '\".\n\t\t\t\t\tpg_escape_string($this->timestamp->getTerminoPeriodo()).\"')\";\n\t\t\t$res =& $mdb2->query($sql);\n\t\t\tif (MDB2::isError($res)) {\n\t\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t$row = $res->fetchRow();\n\t\t\t$dom = new DomDocument();\n\t\t\t$dom->preserveWhiteSpace = false;\n\t\t\t$dom->loadXML($row[\"rendimiento_resumen_global_pordiasemana\"]);\n\t\t\t$xpath = new DOMXpath($dom);\n\t\t\tunset($row[\"rendimiento_resumen_global_pordiasemana\"]);\n\n\t\t\t/* SI NO HAY DATOS MOSTRAR MENSAJE */\n\t\t\tif ($xpath->query('//detalle[@paso_orden]/estadisticas/estadistica')->length == 0) {\n\t\t\t\t$this->resultado = $this->__generarContenedorSinDatos();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$conf_objetivo = $xpath->query('/atentus/resultados/propiedades/objetivos/objetivo')->item(0);\n\t\t\t$conf_pasos = $xpath->query(\"paso[@visible=1]\", $conf_objetivo);\n\n\t\t\tif(count($horarios) > 1) {\n\t\t\t\t$T->setVar('__item_horario', $this->extra[\"item_orden\"]);\n\t\t\t\t$T->setVar('__horario_orden', $orden);\n\t\t\t\t$T->setVar('__horario_nombre',$horario->nombre);\n\t\t\t\t$T->parse('bloque_titulo_horarios', 'BLOQUE_TITULO_HORARIOS', false);\n\t\t\t}\n\n\t\t\t$T->setVar('__objetivo_nombre', $conf_objetivo->getAttribute('nombre'));\n\n\t\t\t$linea = 1;\n\t\t\t$T->setVar('lista_pasos', '');\n\t\t\tforeach($dias_semana as $dia_id => $dia_nombre){\n\t\t\t\t$primero = true;\n\n\t\t\t\t/* LISTA DE PASOS */\n\t\t\t\tforeach ($conf_pasos as $conf_paso) {\n\t\t\t\t\t$tag_dato = $xpath->query('//detalle[@dia_id='.(($dia_id == 7)?0:$dia_id).']/detalles/detalle[@paso_orden='.$conf_paso->getAttribute('paso_orden').']/estadisticas/estadistica')->item(0);\n\n\t\t\t\t\t$T->setVar('__print_class', ($linea % 2 == 0)?\"celdaIteracion2\":\"celdaIteracion1\");\n\t\t\t\t\t$T->setVar('__class', ($linea % 2 == 0)?\"celdanegra15\":\"celdanegra10\");\n\n\t\t\t\t\t$T->setVar('es_primero_dia', '');\n\t\t\t\t\tif ($primero) {\n\t\t\t\t\t\t$T->setVar('__dia_nombre', $dia_nombre);\n\t\t\t\t\t\t$T->setVar('__dia_rowspan', $conf_pasos->length);\n\t\t\t\t\t\t$T->parse('es_primero_dia', 'ES_PRIMERO_DIA', false);\n\t\t\t\t\t}\n\t\t\t\t\t$T->setVar('__paso_nombre', $conf_paso->getAttribute('nombre'));\n\t\t\t\t\t$T->setVar('__paso_minimo', number_format(($tag_dato == null)?0:$tag_dato->getAttribute('tiempo_min'), 3, ',', ''));\n\t\t\t\t\t$T->setVar('__paso_maximo', number_format(($tag_dato == null)?0:$tag_dato->getAttribute('tiempo_max'), 3, ',', ''));\n\t\t\t\t\t$T->setVar('__paso_promedio', number_format(($tag_dato == null)?0:$tag_dato->getAttribute('tiempo_prom'), 3, ',', ''));\n\t\t\t\t\t$T->parse('lista_pasos', 'LISTA_PASOS', true);\n\t\t\t\t\t$primero = false;\n\t\t\t\t\t$linea++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$T->parse('bloque_tabla', 'BLOQUE_TABLA', true);\n\t\t\t$orden++;\n\t\t}\n\t\t$this->tiempo_expiracion = (strtotime($xpath->query(\"//fecha_expiracion\")->item(0)->nodeValue) - strtotime($xpath->query(\"//fecha\")->item(0)->nodeValue));\n\t\t$this->resultado = $T->parse('out', 'tpl_tabla');\n\t}", "public function PedidosDelDia2()\r\n {\r\n $objetoBD = new Conexion();\r\n $objetoBD->conectar();\r\n $mysqli = $objetoBD->cadenaconexion();\r\n \r\n $consulta = \"SELECT ped_id, clie_nombres, clie_apellidos, ped_hora_entrega, ped_direccion, ped_estado\r\n FROM pedidos, clientes WHERE clientes.clie_id=pedidos.clie_id AND ped_fecha_entrega=CURDATE() GROUP BY ped_id\";\r\n $resultado = $mysqli->query($consulta);\r\n return $resultado;\r\n }", "function mostrarPedidoSudo($fecha){\n //Construimos la consulta\n $sql=\"SELECT * from pedido WHERE fecha='\".$fecha.\"'\";\n //Realizamos la consulta\n $resultado=$this->realizarConsulta($sql);\n if($resultado!=null){\n //Montamos la tabla de resultado\n $tabla=[];\n while($fila=$resultado->fetch_assoc()){\n $tabla[]=$fila;\n }\n return $tabla;\n }else{\n return null;\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 }", "public static function orden($orden_nuevo, $id_modulo, $id_actividad)\n {\n $query_tmp = query('SELECT orden, modulo_id, actividad_id from tr_actividad where modulo_id = ' . $id_modulo.' and estatus = 1');\n $query_tmp_act = query('SELECT orden from tr_actividad where actividad_id =' . $id_actividad);\n $arreglo_tmp_act = arreglo($query_tmp_act);\n\n $orden_anterior = $arreglo_tmp_act['orden'];\n\n //2do paso; update del parametro id_actividad donde se actualiza el orden nuevo\n $update = update('tr_actividad', 'orden = ' . $orden_nuevo . '', 'actividad_id =' . $id_actividad);\n //3er paso: usar este while para comparar los valores de la activdad con el orden nuevo\n $json = array();\n while ($arreglo = arreglo($query_tmp)) {\n //aqui se van a pintar los valores del orden por arreglo\n if ($arreglo['actividad_id'] != $id_actividad) {\n // echo $arreglo['orden'].'='.$orden_anterior.'?'.$arreglo['orden'].'='.$orden_nuevo.'?,'; \n\n //4to paso comparaciòn del orden anterior con el arreglo[orden]\n if ($arreglo['orden'] > $orden_anterior) {\n if ($arreglo['orden'] > $orden_nuevo) {\n // echo 'queda igual';\n } else {\n // $arreglo['orden']=orden($arreglo['orden']-1);\n $resta = $arreglo['orden'] - 1;\n $update = update(\"tr_actividad\", \"orden='\" . $resta . \"'\", \"actividad_id='\" . $arreglo['actividad_id'] . \"'\");\n // echo 'se resta';\n }\n } else {\n if ($arreglo['orden'] < $orden_nuevo) {\n // echo 'queda igual';\n } else {\n // $arreglo['orden']=orden($arreglo['orden']+1);\n $suma = $arreglo['orden'] + 1;\n $update = update(\"tr_actividad\", \"orden='\" . $suma . \"'\", \"actividad_id='\" . $arreglo['actividad_id'] . \"'\");\n // echo 'se suma'.'<br>';\n }\n }\n } else {\n // echo ' no hace nada';\n }\n }\n /*\n foreach ($actividad_id = actividad_id) {\n echo \"Se modifican\";\n for ($i=0; $i < ; $i++) {\n }\n\n }*/\n return $json;\n }", "function armarSemana($horarios, $horarioActual, $dias) {\n\tforeach($horarios as $hora) { //Se recorre el array de horarios\n\t\techo \"<tr><td>\".$hora.\"</td>\";\n\t\tforeach($dias as $dia=>$fecha) {\n\t\t\t$vacio = true;\n\t\t\tif($dia != \"Domingo\") {\n\t\t\t\tforeach ($horarioActual as $campo=>$estado) {\t//Se recorre el array de turnos del dia\n\t\t\t\t\tif (isset($_POST['patologias']) && $_POST['patologias'] != $estado['patologia']) { continue; }\n\t\t\t\t\tif ($hora == date(\"H:i\", strtotime($estado['HORA_TURNO'])) && date(\"w\", strtotime($estado['FECHA_TURNO'])) == date(\"w\", strtotime($fecha))) {\t//Si el turno coincide con el horario y el dia\n\t\t\t\t\t\tif (verificarLaborable($hora, $dia) == true) {\n\t\t\t\t\t\t\t$vacio = false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$cupos = obtenerCuposTurno($estado['FECHA_TURNO'], $hora); //guardo cantidad de cupos por hora y fecha dadas\n\t\t\t\t\t\t\t$cantCamillas = 0;\n\t\t\t\t\t\t\t$cantGimnasio = 0;\n\t\t\t\t\t\t\tforeach($cupos as $reg=>$camp) {\t//en este for asigno las cantidades para cada categoria\n\t\t\t\t\t\t\t\tif($camp['sesion'] == \"Camilla\") {\n\t\t\t\t\t\t\t\t\t$cantCamillas += $camp['cantidad'];\n\t\t\t\t\t\t\t\t} elseif($camp['sesion'] ==\"Gimnasio\") {\n\t\t\t\t\t\t\t\t\t$cantGimnasio += $camp['cantidad'];\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$disponibilidad = estadoTurno($cantCamillas, $cantGimnasio);\n\n\t\t\t\t\t\t\tif ($disponibilidad == \"Disponible\") { //If que determina los colores de las casillas\n\t\t\t\t\t\t\t\t$colorCasilla = \"disponible\";\n\t\t\t\t\t\t\t} elseif($disponibilidad == \"Libre\") {\n\t\t\t\t\t\t\t\t$colorCasilla = \"libre\";\n\t\t\t\t\t\t\t} elseif($disponibilidad == \"Ocupado\") {\n\t\t\t\t\t\t\t\t$colorCasilla = \"ocupado\";\n\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/*if ($GLOBALS['perfil'] == \"profesional\") { //si el perfil es de profesional, se veran los cupos disponibles\n\t\t\t\t\t\t\t\techo \"<td class=\".$colorCasilla.\">\".$estado[\"camilla\"].\"</td>\",\n\t\t\t\t\t\t\t\t\"<td class=\".$colorCasilla.\">\".$estado[\"gimnasio\"].\"</td>\";\n\t\t\t\t\t\t\t} else { */\n\t\t\t\t\t\t\techo \"<td class=\".$colorCasilla.\">\".cantidadCupos($cantCamillas, $GLOBALS['MaximoCamillas']).\"</td>\",\n\t\t\t\t\t\t\t\"<td class=\".$colorCasilla.\">\".cantidadCupos($cantGimnasio, $GLOBALS['MaximoGimnasio']).\"</td>\";\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif ($disponibilidad == \"Disponible\") { \n\t\t\t\t\t\t\t\techo \"<td class=\".$colorCasilla.\"><input type='button' value='Si' onclick='location=\\\"reservar.php?fecha=\".$fecha.\"&hora=\".$hora.\"\\\";'/></td>\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\techo \"<td class=\".$colorCasilla.\">No</td>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} elseif (verificarLaborable($hora, $dia) == false) {\n\t\t\t\t\t\t\t//Si la hora dada no es laboral el dia dado, entonces\n\t\t\t\t\t\t\techo \"<td class='cerrado'>-</td>\", \n\t\t\t\t\t\t\t\"<td class='cerrado'>-</td>\",\n\t\t\t\t\t\t\t\"<td class='cerrado'>-</td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\tif ($vacio == true) {\n\t\t\t\t\t\tif(verificarLaborable($hora, $dia)) {\n\t\t\t\t\t\t\tif ($_SESSION['perfil'] == \"Administrador\") {\n\t\t\t\t\t\t\t\techo \"<td class='libre'>\".$GLOBALS['MaximoCamillas'].\"</td>\", \"<td class='libre'>\".$GLOBALS['MaximoGimnasio'].\"</td>\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\techo \"<td class='libre'>Si</td>\", \"<td class='libre'>Si</td>\"; \n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\techo \"<td class='libre'><input type='button' value='Si' onclick='location=\\\"reservar.php?fecha=\".$fecha.\"&hora=\".$hora.\"\\\";'/></td>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//Si la hora dada no es laboral el dia dado, entonces\n\t\t\t\t\t\t\techo \"<td class='cerrado'>-</td>\", \n\t\t\t\t\t\t\t\"<td class='cerrado'>-</td>\",\n\t\t\t\t\t\t\t\"<td class='cerrado'>-</td>\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo \"</tr>\";\n\t}\n}", "function getDados($codAtividade){\n\n }", "public static function todosLosAnuncios()\n {\n try {\n $arrayanuncios = [];\n $fechaActual = new DateTime(date(\"d-m-y\", time()));\n $consulta = \"SELECT id_anuncio,autor,moroso,localidad,descripcion,fecha FROM anuncios ORDER BY fecha DESC\";\n $datos = [];\n $resultado = accesoDB::mostrarConsulta($consulta, $datos);\n\n if ($resultado == '1') {\n return 1;\n } else {\n foreach ($resultado as $valor) {\n $id_anuncio = $valor['id_anuncio'];\n $autor = $valor['autor'];\n $moroso = $valor['moroso'];\n $localidad = $valor['localidad'];\n $descripcion = $valor['descripcion'];\n $fecha = $valor['fecha'];\n $fechaAnuncio = new DateTime($fecha);\n $interval = $fechaAnuncio->diff($fechaActual);\n $dias = $interval->format('%d');\n $mes = $interval->format('%m');\n $año = $interval->format('%y');\n $anuncios = new Anuncios($id_anuncio, $autor, $moroso, $localidad, $descripcion, $fechaAnuncio->format('d-m-Y'));\n array_push($arrayanuncios, [$anuncios, $dias, $mes, $año]);\n }\n echo \"</div>\";\n return $arrayanuncios;\n $resultado = null;\n $conexion = null;\n }\n } catch (PDOException $ex) {\n echo $ex->getMessage();\n }\n }", "public function asignarOrden($orden)\n {\n $counters= $this->getDoctrine()->getManager()->getRepository('BaseBundle:Empresa')->getCountersOrderedByTimeOfQueue($orden->getEmpresa()->getId(),$orden->getFecha()->format('H:i:s'));\n \n if($orden instanceof Anulacion)\n {\n $emision= $this->getDoctrine()->getManager()->getRepository('EmisionesBundle:Emision')->findOneBy(array('numeroOrden'=>$orden->getTarjet()));\n if($emision instanceof Emision && $emision->getUsuario() instanceof Usuariointerno)\n {\n// print_r(\"entro\");exit;\n if(in_array($emision->getUsuario()->getId(), array_column($counters, 'id')))\n {\n return $emision->getUsuario(); \n }\n }\n// print_r(\"salio\");exit;\n }\n foreach (array_column($counters, 'id') as $id_counter)\n {\n $counter= $this->getDoctrine()->getManager()->getRepository('EmisionesBundle:Usuariointerno')->find($id_counter);\n if($orden->getFecha() < $counter->getInicioAlmuerzo() && $orden->getFecha()>= $counter->getInicioJornada())\n {//horario mannana del counter\n return $counter; \n }\n elseif($orden->getFecha() > $counter->getFinAlmuerzo() && $orden->getFecha() <= $counter->getFinJornada())\n {//horario de la tarde del counter\n return $counter;\n }\n } \n return false;\n }", "public function PedidosDelDia()\r\n {\r\n $objetoBD = new Conexion();\r\n $objetoBD->conectar();\r\n $mysqli = $objetoBD->cadenaconexion();\r\n \r\n $consulta = \"SELECT ped_id, clie_nombres, clie_apellidos, ped_hora_entrega, ped_direccion, ped_estado\r\n FROM pedidos, clientes WHERE clientes.clie_id=pedidos.clie_id AND ped_estado='PENDIENTE' AND ped_fecha_entrega=CURDATE() GROUP BY ped_id\";\r\n $resultado = $mysqli->query($consulta);\r\n return $resultado;\r\n }", "public function inserirDados()\n\t\t{\n\t\t\t$insertIdoso = \"INSERT INTO idoso(logradouro,\n\t\t\t\t\t\t\t\t\t\ttipo_logradouro,\n\t\t\t\t\t\t\t\t\t\tnumero,\n\t\t\t\t\t\t\t\t\t\tcomplemento,\n\t\t\t\t\t\t\t\t\t\tbaiiro,\n\t\t\t\t\t\t\t\t\t\tcidade,\n\t\t\t\t\t\t\t\t\t\tuf,\n\t\t\t\t\t\t\t\t\t\tusuario_id_usuario)\n\t\t\t\t\t\t\t\tVALUES(:logradouro,\n\t\t\t\t\t\t\t\t\t\t:tipo_logradouro,\n\t\t\t\t\t\t\t\t\t\t:numero,\n\t\t\t\t\t\t\t\t\t\t:complemento,\n\t\t\t\t\t\t\t\t\t\t:baiiro,\n\t\t\t\t\t\t\t\t\t\t:cidade,\n\t\t\t\t\t\t\t\t\t\t:uf,\n\t\t\t\t\t\t\t\t\t\t:usuario_id_usuario)\";\n\n\t\t\t$stmt->pdo->prepare($insertIdoso);\n\t\t\t$stmt->bindParam(':logradouro', $this->logradouro);\n\t\t\t$stmt->bindParam(':tipo_logradouro', $this->tipo_logradouro);\n\t\t\t$stmt->bindParam(':numero', $this->numero);\n\t\t\t$stmt->bindParam(':complemento', $this->complemento);\n\t\t\t$stmt->bindParam(':bairro', $this->baiiro);\n\t\t\t$stmt->bindParam(':cidade', $this->cidade);\n\t\t\t$stmt->bindParam(':uf', $this->uf);\n\t\t\t$stmt->bindParam(':usuario_id_usuario', $this->buscarTodosDados());\n\n\t\t\tif($stmt->execute()) {\n\t\t\t\theader(\"Location: localhost:8001/contato\");\n\t\t\t} else {\n\t\t\t\tdie('Erro ao cadastrar');\n\t\t\t}\n\t\t}", "public function obtener_reservas_diarias($fecha) //EXCELL\n {\n $this->db->select('modulo,sala,id_a,nombre_a,carrera_a, id_e');\n $this->db->from('reservas');\n $this->db->where('fecha',$fecha);\n $this->db->where('eliminada',\"0\");\n $this->db->where('estado',\"1\");\n return $query = $this->db->get();\n }", "public function get_mov_caja($fecha,$sucursal){\n\t$conectar= parent::conexion();\n\tparent::set_names(); \n\t$sql=\"select*from movimientos_caja where fecha=? and sucursal=? order by id_mov_caja DESC limit 1;\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$fecha);\n\t$sql->bindValue(2,$sucursal);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "function ordenaPorFechas($mes, $anno, $kategoria, $quePais) // a este se le entra con el username\n {\ninclude ('cajitaCurso.php'); //archivo donde esta la funcion que tira la cajita\n//contador\n$sqlContador = \"SELECT count(*) FROM cursos LEFT JOIN fechas ON fechas.idcurso = cursos.id where cursos.categoria LIKE '%$kategoria%' AND MONTH(fechas.fechainicio) LIKE $mes AND YEAR(fechas.fechainicio) LIKE $anno AND cursos.pais LIKE '$quePais' ORDER BY fechas.fechainicio \";\n\n// ESTE ES CUANDO ESTA DEMASIADO LLENO $sqlContador = \"SELECT count(*) FROM cursos LEFT JOIN fechas ON fechas.idcurso = cursos.id where cursos.categoria LIKE '%$kategoria%' AND MONTH(fechas.fechainicio) LIKE $mes AND YEAR(fechas.fechainicio) LIKE $anno AND cursos.pais LIKE '$quePais' AND fechas.fechainicio >= NOW() ORDER BY fechas.fechainicio ASC\";\n\n\n\n$count = mysql_fetch_row(mysql_query($sqlContador)) or die(\"Query failed : \" . mysql_error() . mysql_errno());\nglobal $contadorGeneral;\n$contadorGeneral = $count[0];\n//echo $contadorGeneral;\n\n//contador\t\n\t$sql = \"SELECT * FROM cursos LEFT JOIN fechas ON fechas.idcurso = cursos.id where cursos.categoria LIKE '%$kategoria%' AND MONTH(fechas.fechainicio) LIKE $mes AND YEAR(fechas.fechainicio) LIKE $anno AND cursos.pais LIKE '$quePais' ORDER BY fechas.fechainicio DESC LIMIT \".DondeComienzo().\", \".MAXCAJITAS.\"\";\n\n// ESTE ES CUANDO ESTA DEMASIADO LLENO $sql = \"SELECT * FROM cursos LEFT JOIN fechas ON fechas.idcurso = cursos.id where cursos.categoria LIKE '%$kategoria%' AND MONTH(fechas.fechainicio) LIKE $mes AND YEAR(fechas.fechainicio) LIKE $anno AND cursos.pais LIKE '$quePais' AND fechas.fechainicio >= NOW() ORDER BY fechas.fechainicio ASC LIMIT \".DondeComienzo().\", \".MAXCAJITAS.\"\";\n\n\n//echo $sql;\n$result = mysql_query($sql) or die(\"Query failed : \" . mysql_error() . mysql_errno()); \nwhile ($row = mysql_fetch_array($result))\n {\n\t\t\t CajitaCursoLlena($row['idcurso'], convierte_fecha($row['fechainicio']));\t\n\t\t\t}\n}", "public function get_datos_ventas_cargo($fecha,$sucursal){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n \n\t$fecha_corte = $fecha.\"%\";\n\t$sql=\"select c.n_factura,c.fecha_ingreso,c.n_recibo,c.paciente,u.usuario,c.total_factura,c.forma_cobro,c.monto_cobrado,c.saldo_credito,c.abonos_realizados from corte_diario as c inner join usuarios as u on u.id_usuario=c.id_usuario where c.fecha_ingreso like ? and c.abonos_realizados='0' and c.tipo_pago='Cargo Automatico' and (sucursal_venta=? or sucursal_cobro=?);\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$fecha_corte);\n\t$sql->bindValue(2,$sucursal);\n\t$sql->bindValue(3,$sucursal);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "private function importar_ordenes_rafam($ejercicio,$numero){\n // $stid = oci_parse($conn, $sql);\n // oci_execute($stid);\n \n // // echo \"<table border='1'>\\n\";\n // // while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {\n // // echo \"<tr>\\n\";\n // // foreach ($row as $key=>$item) {\n // // echo \" <td>\" . ($item !== null ? htmlentities($key.'-'.$item, ENT_QUOTES) : \"\") . \"</td>\\n\";\n // // }\n // // echo \"</tr>\\n\";\n // // }\n // // echo \"</table>\\n\";\n // die();\n // $conn = oci_connect('OWNER_RAFAM', 'OWNERDBA', \"(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.0.18)(PORT = 1521)))(CONNECT_DATA=(SID=HMABB)))\");\n \n // if (!$conn) {\n // $e = oci_error();\n // trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);\n // }\n $connection_rafam = \\Yii::$app->dbRafam;\n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n \n\n //Importo los Ordenes de Compra\n $sql= \"SELECT oc.NRO_OC,oc.EJERCICIO,TO_CHAR(oc.FECH_OC, 'YYYY-MM-DD') as FECHA_OC,\n oc.COD_PROV, oci.item_oc,oci.descripcion,oci.cantidad,oci.imp_unitario,\n pci.inciso, pci.par_prin, pci.par_parc, pci.clase, pci.tipo\n FROM orden_compra oc, oc_items oci, adjudicaciones a, ped_cotizaciones pc, ped_cotizaciones_items pci\n WHERE oc.ejercicio=oci.ejercicio AND oc.nro_oc=oci.nro_oc AND oc.uni_compra=2 AND oc.estado_oc<>'A' AND oci.uni_compra=2\n AND oc.ejercicio=a.ejercicio AND oc.nro_adjud=a.nro_adjudic AND a.deleg_solic=2 AND a.estado<>'A'\n AND pc.ejercicio=a.ejercicio AND a.nro_coti=pc.nro_coti AND pc.deleg_solic=2 AND pc.estado<>'A' AND pc.nro_llamado=a.nro_llamado\n AND pci.nro_llamado=pc.nro_llamado\n AND pci.ejercicio=pc.ejercicio AND pci.nro_coti=pc.nro_coti AND pci.item_real=oci.item_real \n AND oc.EJERCICIO=$ejercicio AND oc.NRO_OC=$numero\n ORDER BY oc.EJERCICIO,oc.NRO_OC,oci.item_oc\";\n\n $command = $connection_rafam->createCommand($sql);\n $orden = $command->queryAll();\n\n $oc_nro_actual='';\n foreach ($orden as $key => $row) {\n \n $oc_nro = $row['EJERCICIO'].str_pad( $row['NRO_OC'], 6, \"0\", STR_PAD_LEFT);\n $oc_proveed = $row['COD_PROV'];\n $oc_fecha = $row['FECHA_OC'];\n \n if ($oc_nro!=$oc_nro_actual){\n $orden_compra_existente = false;\n $orden_compra = OrdenCompra::findOne($oc_nro);\n if (!isset($orden_compra)){\n $oc_nro_actual = $oc_nro;\n $orden_compra = new OrdenCompra();\n $orden_compra->OC_NRO = $oc_nro;\n $orden_compra->OC_PROVEED = $oc_proveed;\n $this->verificar_proveedor($oc_proveed);\n $orden_compra->OC_FECHA = $oc_fecha;\n $orden_compra->OC_FINALIZADA = 0; \n if (!$orden_compra->save()){\n $mensaje = \"\"; \n foreach ($orden_compra->getFirstErrors() as $key => $value) {\n $mensaje .= \"$value \\\\n\\\\r\";\n }\n \n throw new ErrorException($mensaje);\n }\n \n }else{\n $orden_compra_existente = true;\n }\n }\n \n if (!$orden_compra_existente){\n $codigo_rafam_articulo = $row['INCISO'].'.'.$row['PAR_PRIN']\n .'.'.$row['PAR_PARC']\n .'.'.str_pad( $row['CLASE'], 5, \"0\", STR_PAD_LEFT)\n .'.'.str_pad( $row['TIPO'], 4, \"0\", STR_PAD_LEFT);\n\n $renglon = new OrdenCompra_renglones(); \n $renglon->EN_NROOC = $oc_nro;\n $renglon->EN_ITEM = $row['ITEM_OC'];\n $renglon->EN_CANT = $row['CANTIDAD'];\n $renglon->EN_COSTO = $row['IMP_UNITARIO'];\n $renglon->EN_CODRAFAM = $codigo_rafam_articulo;\n if (!$renglon->save()){\n $mensaje = \"\"; \n foreach ($renglon->getFirstErrors() as $key => $value) {\n $mensaje .= \"$value \\\\n\\\\r\";\n }\n \n throw new ErrorException($mensaje);\n }\n }\n }\n\n $transaction->commit();\n return true;\n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n }", "function generar_dias ($dia_inicio, $dia_fin, $mes_inicio, $mes_fin, $i, $dias_seleccionados, $meses_intermedios){\n //guardamos los dias del periodo\n $dias=array();\n $anio=date('Y');\n switch($i){\n case 'mm' : while($dia_inicio <= $dia_fin){\n $fecha= date('d-m-Y', strtotime(\"$dia_inicio-$mes_inicio-$anio\"));\n //print_r(\"<br>\");\n //print_r($fecha);\n //print_r(\"<br>\");\n if($this->es_dia_valido(date('N', strtotime($fecha)), $dias_seleccionados)){\n $dias[]=$fecha;\n }\n\n $dia_inicio += 1;\n }\n\n break;\n\n case 'mc' : $this->obtener_dias($dia_inicio, $mes_inicio, $this->_meses[intval($mes_inicio)], $dias_seleccionados, &$dias);\n $this->obtener_dias(1, $mes_fin, $dia_fin, $dias_seleccionados, &$dias);\n\n break;\n\n case 'mnc': //obtenemos los dias para dia_inicio y mes_inicio\n $this->obtener_dias($dia_inicio, $mes_inicio, $this->_meses[intval($mes_inicio)], $dias_seleccionados, &$dias);\n \n //para los meses intermedios podemos obtener los dias sin problemas, avanzamos desde 1 \n //hasta el ultimo dia del mes y realizamos el descarte adecuado.\n foreach ($meses_intermedios as $clave=>$mes_i){ //mes_i contiene un valor entero\n $this->obtener_dias(1, $mes_i, $this->_meses[$mes_i], $dias_seleccionados, &$dias);\n }\n\n //obtenemos los dias para dia_fin y mes_fin\n $this->obtener_dias(1, $mes_fin, $dia_fin, $dias_seleccionados, &$dias);\n\n break;\n }\n\n return $dias;\n }", "function consultar_opedidos(){\n \n $query_RecordsetResumo = \"SELECT * FROM CAIXACUPOM \";\n $query_RecordsetResumo .= \" WHERE TIPOATENDIMENTO = 'DELIVERY' \";\n #$query_RecordsetResumo .= \" AND STATUS_GO4YOU != '4' \";\n $query_RecordsetResumo .= \" ORDER BY CAIXACUPOM_CONTROLE DESC\";\n $query_RecordsetResumo .= \" LIMIT 20\";\n $RecordsetResumo = mysql_query($query_RecordsetResumo, $con) or die(mysql_error());\n $row_RecordsetResumo = mysql_fetch_assoc($RecordsetResumo);\n $totalRows_RecordsetResumo = mysql_num_rows($RecordsetResumo);\n \n $tempo = $_SESSION['TEMPO_PREPARACAO'];\n $pedidos = array();\n $i = 0;\n if($totalRows_RecordsetResumo != 0 ){\n do {\n \n # Checa se percisa alterar o status\n if(dif_hora(acrescenta_min($row_RecordsetResumo['DATAHORA' ], $tempo)) == 2 && $row_RecordsetResumo['STATUS_GO4YOU'] == \"0\"){\n update_status($row_RecordsetResumo['CAIXACUPOM_CONTROLE'], 2);\n }\n \n # Condicao para gerar contador de Tempo\n $status = \" excedido \";\n if($row_RecordsetResumo['STATUS_GO4YOU'] == \"0\" && dif_hora(acrescenta_min($row_RecordsetResumo['DATAHORA' ], $tempo)) != 2){\n $status = dif_hora_draw(acrescenta_min($row_RecordsetResumo['DATAHORA'], $tempo), date('Y-m-d H:i:s'));\n }\n \n $pedidos[$i]['CAIXACUPOM_CONTROLE'] = $row_RecordsetResumo['CAIXACUPOM_CONTROLE' ];\n $pedidos[$i]['DATAHORA' ] = dataMySql2BR($row_RecordsetResumo['DATAHORA' ]);\n $pedidos[$i]['TEMPO_PREVISTO' ] = acrescenta_min($row_RecordsetResumo['DATAHORA' ], $tempo);\n $pedidos[$i]['STATUS_GO4YOU' ] = trata_texto(status($row_RecordsetResumo['STATUS_GO4YOU']));\n $pedidos[$i]['TEMPO' ] = $status;\n $pedidos[$i]['STATUS_BTN' ] = $row_RecordsetResumo['STATUS_GO4YOU'] < 4 ? \n '<input type=\"submit\" value=\"'.trata_texto(status($row_RecordsetResumo['STATUS_GO4YOU'] + 1)).'\" onClick=\"update_status('.$row_RecordsetResumo['CAIXACUPOM_CONTROLE'].', '.$row_RecordsetResumo['STATUS_GO4YOU'].')\" style=\"cursor: pointer;\" />' :\n '<input type=\"button\" value=\"Entregue\" disabled />' ;\n ++$i;\n } while ($row_RecordsetResumo = mysql_fetch_assoc($RecordsetResumo)); \n }\n \n return json_encode($pedidos);\n \n}", "function pagocobrobancossaldos($periodo,$ejer,$moneda,$cuenta,$opc){\n\t\tswitch($opc){\n\t\t\tcase 1://cargo\n\t\t\t\t$mov=\"Cargo M.E.\";\n\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$mov=\"Abono M.E\";\n\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$mov=\"Abono\";\n\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$mov=\"Cargo\";\n\t\t\tbreak;\n\t\t}\n\t\t\t$sql=$this->query(\"select m.IdPoliza,m.Cuenta,sum(m.Importe) importe,m.TipoMovto,c.description,p.relacionExt,p.concepto,p.idperiodo,c.manual_code\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 c.`main_father`=conf.CuentaBancos and m.TipoMovto='\".$mov.\"'\n\t\t\tand m.IdPoliza=p.id and p.activo=1 and m.Activo=1 and p.idperiodo<=\".$periodo.\" and m.Cuenta=\".$cuenta.\"\n\t\t\tand p.id not in(select id from cont_polizas where concepto='POLIZA DE AJUSTE POR DIFERENCIA CAMBIARIA' and idperiodo=\".$periodo.\")\n\t\t\tgroup by m.Cuenta,p.idperiodo,m.TipoMovto\");\n\t\t\treturn $sql;\n\t\t}", "public function getDados()\n {\n $aLinhas = array();\n\n /**\n * montamos as datas, e processamos o balancete de verificação\n */\n $oDaoPeriodo = db_utils::getDao(\"periodo\");\n $sSqlDadosPeriodo = $oDaoPeriodo->sql_query_file($this->iCodigoPeriodo);\n $rsPeriodo = db_query($sSqlDadosPeriodo);\n $oDadosPerido = db_utils::fieldsMemory($rsPeriodo, 0);\n $sDataInicial = \"{$this->iAnoUsu}-01-01\";\n $iUltimoDiaMes = cal_days_in_month(CAL_GREGORIAN, $oDadosPerido->o114_mesfinal, $this->iAnoUsu);\n $sDataFinal = \"{$this->iAnoUsu}-{$oDadosPerido->o114_mesfinal}-{$iUltimoDiaMes}\";\n $sWherePlano = \" c61_instit in ({$this->getInstituicoes()}) \";\n /**\n * processa o balancete de verificação\n */\n $rsPlano = db_planocontassaldo_matriz($this->iAnoUsu,\n $sDataInicial,\n $sDataFinal,\n false,\n $sWherePlano,\n '',\n 'true',\n 'true');\n\n $iTotalLinhasPlano = pg_num_rows($rsPlano);\n /**\n * percorremos a slinhas cadastradas no relatorio, e adicionamos os valores cadastrados manualmente.\n */\n $aLinhasRelatorio = $this->oRelatorioLegal->getLinhasCompleto();\n for ($iLinha = 1; $iLinha <= count($aLinhasRelatorio); $iLinha++) {\n\n $aLinhasRelatorio[$iLinha]->setPeriodo($this->iCodigoPeriodo);\n $aColunasRelatorio = $aLinhasRelatorio[$iLinha]->getCols($this->iCodigoPeriodo);\n $aColunaslinha = array();\n $oLinha = new stdClass();\n $oLinha->totalizar = $aLinhasRelatorio[$iLinha]->isTotalizador();\n $oLinha->descricao = $aLinhasRelatorio[$iLinha]->getDescricaoLinha();\n $oLinha->colunas = $aColunasRelatorio;\n $oLinha->nivellinha = $aLinhasRelatorio[$iLinha]->getNivel();\n foreach ($aColunasRelatorio as $oColuna) {\n\n $oLinha->{$oColuna->o115_nomecoluna} = 0;\n if ( !$aLinhasRelatorio[$iLinha]->isTotalizador() ) {\n $oColuna->o116_formula = '';\n }\n }\n\n if (!$aLinhasRelatorio[$iLinha]->isTotalizador()) {\n\n $aValoresColunasLinhas = $aLinhasRelatorio[$iLinha]->getValoresColunas(null, null, $this->getInstituicoes(),\n $this->iAnoUsu);\n\n $aParametros = $aLinhasRelatorio[$iLinha]->getParametros($this->iAnoUsu, $this->getInstituicoes());\n foreach($aValoresColunasLinhas as $oValor) {\n foreach ($oValor->colunas as $oColuna) {\n $oLinha->{$oColuna->o115_nomecoluna} += $oColuna->o117_valor;\n }\n }\n\n /**\n * verificamos se a a conta cadastrada existe no balancete, e somamos o valor encontrado na linha\n */\n for ($i = 0; $i < $iTotalLinhasPlano; $i++) {\n\n $oResultado = db_utils::fieldsMemory($rsPlano, $i);\n\n\n $oParametro = $aParametros;\n\n foreach ($oParametro->contas as $oConta) {\n\n $oVerificacao = $aLinhasRelatorio[$iLinha]->match($oConta, $oParametro->orcamento, $oResultado, 3);\n\n if ($oVerificacao->match) {\n\n $this->buscarInscricaoEBaixa($oResultado, $iLinha, $sDataInicial, $sDataFinal);\n\n if ( $oVerificacao->exclusao ) {\n\n $oResultado->saldo_anterior *= -1;\n $oResultado->saldo_anterior_debito *= -1;\n $oResultado->saldo_anterior_credito *= -1;\n $oResultado->saldo_final *= -1;\n }\n\n $oLinha->sd_ex_ant += $oResultado->saldo_anterior;\n $oLinha->inscricao += $oResultado->saldo_anterior_credito;\n $oLinha->baixa += $oResultado->saldo_anterior_debito;\n $oLinha->sd_ex_seg += $oResultado->saldo_final;\n }\n }\n }\n }\n $aLinhas[$iLinha] = $oLinha;\n }\n\n unset($aLinhasRelatorio);\n\n /**\n * calcula os totalizadores do relatório, aplicando as formulas.\n */\n foreach ($aLinhas as $oLinha) {\n\n if ($oLinha->totalizar) {\n\n foreach ($oLinha->colunas as $iColuna => $oColuna) {\n\n if (trim($oColuna->o116_formula) != \"\") {\n\n $sFormulaOriginal = ($oColuna->o116_formula);\n $sFormula = $this->oRelatorioLegal->parseFormula('aLinhas', $sFormulaOriginal, $iColuna, $aLinhas);\n $evaluate = \"\\$oLinha->{$oColuna->o115_nomecoluna} = {$sFormula};\";\n ob_start();\n eval($evaluate);\n $sRetorno = ob_get_contents();\n ob_clean();\n if (strpos(strtolower($sRetorno), \"parse error\") > 0 || strpos(strtolower($sRetorno), \"undefined\" > 0)) {\n $sMsg = \"Linha {$iLinha} com erro no cadastro da formula<br>{$oColuna->o116_formula}\";\n throw new Exception($sMsg);\n\n }\n }\n }\n }\n }\n\n return $aLinhas;\n }", "public function crearDia($dia1, $sucursal, $mes) {\n $dia = new Dia();\n\n\n # Set the parameters\n $dia->numDia = $dia1;\n setlocale(LC_TIME, 'es_ES');\n $formato = 'd-m-Y';\n #$diaSemana = DateTime::createFromFormat($formato, $dia->numDia.'-'.$mes->mes.'-'.$mes->ano)->format('l');\n setlocale(LC_TIME, 'es_ES.UTF8'); ##GOP ojo cambiar en produccion\n #setlocale(LC_TIME, 'es_ES');\n $fecha = DateTime::createFromFormat($formato, $dia->numDia.'-'.$mes->mes.'-'.$mes->ano);\n $dia->diaSemana = strftime(\"%A\", $fecha->getTimestamp());\n #dd($dia->diaSemana);\n if($dia->diaSemana == \"sábado\" or $dia->diaSemana == \"domingo\"){\n $dia->estatus = 0;\n }else{\n $dia->estatus = 1;\n }\n $dia->mes_id = $mes->id;\n\n $dia->mes()->associate($mes);\n\n $dia->save();\n\n\n\n\n\n $start = new \\DateTime($sucursal->horaInicio);\n $end = new \\DateTime($sucursal->horaFin);\n $start = $start->sub(new \\DateInterval('PT30M'));\n while($start < $end){\n $hr = $start->add(new \\DateInterval('PT30M'));\n $this->crearHora($hr, $sucursal,$dia);\n }\n\n return true;\n\t}", "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 \n $oInstituicao = db_stdClass::getDadosInstit(db_getsession(\"DB_instit\"));\n $sListaInstit = db_getsession(\"DB_instit\");\n $sWhere = \"o70_instit in ({$sListaInstit})\";\n $iAnoUsu = (db_getsession(\"DB_anousu\")-1);\n $sDataIni = $iAnoUsu.\"-01-01\";\n $sDataFim = $iAnoUsu.\"-12-31\";\n $sSqlBalAnterior = db_receitasaldo(11, 1, 3, true, $sWhere, $iAnoUsu, $sDataIni, $sDataFim, true);\n \n $sSqlAgrupado = \"select case when fc_conplano_grupo($iAnoUsu, substr(o57_fonte,1,1) || '%', 9000 ) is false \"; \n $sSqlAgrupado .= \" then substr(o57_fonte,2,14) else substr(o57_fonte,1,15) end as o57_fonte, \";\n $sSqlAgrupado .= \" o57_descr, \";\n $sSqlAgrupado .= \" saldo_inicial, \";\n $sSqlAgrupado .= \" saldo_arrecadado_acumulado, \"; \n $sSqlAgrupado .= \" x.o70_codigo, \";\n $sSqlAgrupado .= \" x.o70_codrec, \";\n $sSqlAgrupado .= \" coalesce(o70_instit,0) as o70_instit, \";\n $sSqlAgrupado .= \" fc_nivel_plano2005(x.o57_fonte) as nivel \"; \n $sSqlAgrupado .= \" from ({$sSqlBalAnterior}) as x \";\n $sSqlAgrupado .= \" left join orcreceita on orcreceita.o70_codrec = x.o70_codrec and o70_anousu={$iAnoUsu} \";\n $sSqlAgrupado .= \" order by o57_fonte \"; \n $rsBalancete = db_query($sSqlAgrupado);\n $iTotalLinhas = pg_num_rows($rsBalancete);\n for ($i = 1; $i < $iTotalLinhas; $i++) {\n \n $oReceita = db_utils::fieldsMemory($rsBalancete, $i);\n $sDiaMesAno = \"{$iAno}-\".str_pad($iMes, 2, \"0\", STR_PAD_LEFT).\"-\".str_pad($iDia, 2, \"0\", STR_PAD_LEFT);\n \n $oReceitaRetorno = new stdClass();\n \n $oReceitaRetorno->braCodigoEntidade = str_pad($this->iCodigoTCE, 4, \"0\", STR_PAD_LEFT);\n $oReceitaRetorno->braMesAnoMovimento = $sDiaMesAno;\n $oReceitaRetorno->braContaReceita = str_pad($oReceita->o57_fonte, 20, 0, STR_PAD_RIGHT);\n $oReceitaRetorno->braCodigoOrgaoUnidadeOrcamentaria = str_pad($oInstituicao->codtrib, 4, \"0\", STR_PAD_LEFT);\n $nSaldoInicial = $oReceita->saldo_inicial;\n $oReceita->saldo_inicial = str_pad(number_format(abs($oReceita->saldo_inicial),2,\".\",\"\"), 13,'0', STR_PAD_LEFT);\n $oReceitaRetorno->braValorReceitaOrcada = $oReceita->saldo_inicial;\n $oReceita->saldo_arrecadado_acumulado = str_pad(number_format(abs($oReceita->saldo_arrecadado_acumulado) \n ,2,\".\",\"\"), 12,'0', STR_PAD_LEFT);\n $oReceitaRetorno->braValorReceitaRealizada = $oReceita->saldo_arrecadado_acumulado;\n $oReceitaRetorno->braCodigoRecursoVinculado = str_pad($oReceita->o70_codigo, 4, \"0\", STR_PAD_LEFT); \n $oReceitaRetorno->braDescricaoContaReceita = substr($oReceita->o57_descr, 0, 255); \n $oReceitaRetorno->braTipoNivelConta = ($oReceita->o70_codrec==0?'S':'A'); \n $oReceitaRetorno->braNumeroNivelContaReceita = $oReceita->nivel;\n $this->aDados[] = $oReceitaRetorno; \n }\n return true;\n }", "function listarDetallePeriodoAgencia(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_PERDETAG_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n\n $this->setCount(false);\n\n $this->setParametro('id_periodo_venta','id_periodo_venta','int4');\n $this->setParametro('id_agencia','id_agencia','int4');\n $this->setParametro('tipo','tipo','varchar');\n\n\n //Definicion de la lista del resultado del query\n $this->captura('id_periodo_venta','int4');\n $this->captura('tipo','varchar');\n $this->captura('fecha','text');\n $this->captura('pnr','varchar');\n $this->captura('apellido','varchar');\n $this->captura('moneda','varchar');\n $this->captura('monto_boleto','numeric');\n $this->captura('comision','numeric');\n $this->captura('monto_credito_debito','numeric');\n $this->captura('ajuste','varchar');\n $this->captura('garantia','varchar');\n $this->captura('autorizacion_deposito','varchar');\n $this->captura('monto_credito_debito_mb','numeric');\n $this->captura('tipo_cambio','numeric');\n $this->captura('cierre_periodo','varchar');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "private function cargarDatosOmision($fecha, $orden) {\n $this->fecha = $fecha;\n $this->orden = ($orden != 0 && $orden != 1 && $orden != 2) ? 0 : $orden;\n $this->aAsistentes = array();\n }", "private function crearDiasParaTanda($tanda,$num_dias) {\n\t $auditorios = $em->getRepository('CpmJovenesBundle:Auditorio')->findBy(array('anulado'=>false));\n\t\t//creo los dias para la tanda\n\t for($nroDia=1;$nroDia<=$num_dias;$nroDia++) {\n\t\t\t$tandaDia = new Dia($nroDia);\t\n\t\t\t$tanda->addDia($tandaDia); \t\n\t\t\t//cargo los auditorios para cada dia\n\t \tforeach ( $auditorios as $auditorio) { \n\t \t\t$newAuditorioDia = new AuditorioDia();\n\t\t\t\t$newAuditorioDia->setAuditorio($auditorio);\n\t\t\t\t$tandaDia->addAuditorioDia($newAuditorioDia);\n\t \t}\n\t\t }\n\t}", "public function asignarOrden()\n {\n $arrayDeseados = Deseados::find()\n ->where(['usuario_id' => $this->usuario_id])\n ->orderBy('orden')\n ->all();\n\n $orden = sizeof($arrayDeseados)+1;\n\n return $orden;\n }", "function guardarRecesoDia($idUsuario, $dia, $horaInicio, $horaFin){\n\t\t\n\t\t\t$dia \t\t\t= parent::escaparQueryBDCliente($dia); \n\t\t\t$idUsuario \t= parent::escaparQueryBDCliente($idUsuario); \n\t\t\t$horaInicio \t= parent::escaparQueryBDCliente($horaInicio); \n\t\t\t$horaFin \t\t= parent::escaparQueryBDCliente($horaFin); \t\t\t\n \n $query = \"INSERT INTO tb_agendaRecesosUsuario (numeroDia, idUsuario) \".\n \" VALUES ('$dia', '$idUsuario')\";\n \n\t\t \n $conexion = parent::conexionCliente();\n \t\t\n if($res = $conexion->query($query)){\n \n $query2\t= \"SELECT MAX(idAgendaRecesosUsuario) as ultimoIdRecesoUsuario FROM tb_agendaRecesosUsuario\";\n\t\t\t\n\t\t\t\t\tif($res2 = $conexion->query($query2)){\n\t\t\t \n\t\t\t /* obtener un array asociativo */\n\t\t\t while ($filas = $res2->fetch_assoc()) {\n\t\t\t \t\n\t\t\t $resultado = $filas['ultimoIdRecesoUsuario'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$query3 = \"INSERT INTO tb_agendaHorarioReceso (horaInicio, horaFin, estado, idAgendaRecesosUsuario)\n\t\t\t\t\t\t\t\t\t\t\tVALUES ('$horaInicio','$horaFin','A','$resultado')\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$conexion->query($query3);\n\t\t\t\t\t\t\t\t\n\t\t\t }\n\t\t\t \n\t\t\t /* liberar el conjunto de resultados */\n\t\t\t $res2->free();\n\t\t\t \n\t\t\t }\n\t\t\t\t \n\t\t\t\t \n }\n \n return $resultado;\t\t\n\t\t\n\t\t\n\t}", "public static function Nueva_Orden($fecha_ingreso, $id_cotizacion, $id_cliente, $id_locacion, $id_actividad, $num_muestras, $id_usuario, $estado, $version, $num_orden, $prioridad)\n {\n // Sentencia INSERT\n $comando = \"INSERT INTO ordenes (fecha_ingreso, id_cotizacion, id_cliente, id_locacion, id_actividad, num_muestras, id_usuario, estado, impreso, version, num_orden, razon_jt, razon_dt, razon_dc, recibido, enviado, prioridad) VALUES( ?,?,?,?,?,?,?,?,0,?,?,'','','',0,0,? )\";\n\n // Preparar la sentencia\n $sentencia = Database::getInstance()->getDb()->prepare($comando);\n\n return $sentencia->execute(\n array(\n $fecha_ingreso,\n $id_cotizacion,\n $id_cliente, \n $id_locacion,\n $id_actividad,\n $num_muestras,\n $id_usuario,\n $estado,\n $version,\n $num_orden,\n $prioridad\n )\n );\n\n }", "public function getDiasPantiA($id, $ano)\n { \n $result=$this->adapter->query(\"select b.id, b.idEmp ,0 as dias,c.idCcos, \n c.fecing, ( DATE_FORMAT( a.fechaF , '%Y-%m-%d' ) - DATE_FORMAT( d.fecha , '%Y-%m-%d' ) ) \n\t\t\t\t , c.CedEmp , c.nombre , c.idTemp , case when e.id > 0 then 1 else 0 end as pg, \n case when (day( d.fecha) >= day(a.fechaI)) and (day( d.fecha) <= day(a.fechaF)) then 1 else 0 end as diaI \n from n_nomina a\n inner join n_nomina_e b on b.idNom = a.id\n inner join a_empleados c on c.id = b.idEmp \n inner join n_tipemp_p d on d.idEmp = b.idEmp and d.idTemp = 1 # mientras 1 es para los convencionados \n left join n_pg_primas_ant e on e.idEmp = b.idEmp and year(e.fechaI) = year(a.fechaI) and month( e.fechaI ) and month( a.fechaI ) \n where c.activo=0 and c.estado = 0 \n and a.id = \".$id.\" and ( DATE_FORMAT( a.fechaF , '%Y-%m-%d' )\n - DATE_FORMAT( d.fecha , '%Y-%m-%d' ) )> \".$ano.\" \n and month( d.fecha ) = month(a.fechaF)\n order by c.fecing desc \",Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }", "public function cadastrar(){\r\n //DEFINIR A DATA DE CADASTRO\r\n $this->cadastro = date('Y-m-d H:i:s');\r\n\r\n $db = new Database('cartao');\r\n $this->id = $db->insert([\r\n 'bandeira' => $this->bandeira,\r\n 'numero' => $this->numero,\r\n 'doador' => $this->doador,\r\n ]);\r\n\r\n }", "function fmodulo(){\n\t\t$this->sentencia=\"SELECT modulo_id,modulo_nombre FROM modulo ORDER BY modulo_orden ASC\";\n\t\t$this->fsentencia();\n\t\t$this->modulo=$this->resultado;\n\t}", "function Denuncias_tomadas($org_cod_organizacion)\n {\n\t\t$Conexion = floopets_BD::Connect();\n\t\t$Conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t//Crear el query que vamos a realizar\n\t\t$consulta=\"SELECT denuncia.*,tipo_denuncia.* FROM tipo_denuncia INNER JOIN denuncia on tipo_denuncia.td_cod_tipo_denuncia=denuncia.td_cod_tipo_denuncia INNER JOIN denuncias_organizacion ON denuncia.de_cod_denuncia=denuncias_organizacion.de_cod_denuncia INNER JOIN organizacion ON denuncias_organizacion.org_cod_organizacion=organizacion.org_cod_organizacion WHERE organizacion.org_cod_organizacion=? AND denuncia.de_estado='tomado'\";\n\t\t$query = $Conexion->prepare($consulta);\n\t\t$query->execute(array($org_cod_organizacion));\n\t\t//Devolvemos el resultado en un arreglo\n\t\t//Fetch: es el resultado que arroja la consulta en forma de un vector o matriz segun sea el caso\n\t\t//Para consultar donde arroja mas de un dato el fatch debe ir acompañado con la palabra ALL\n\t\t$resultado = $query->fetchALL(PDO::FETCH_BOTH);\n\t\treturn $resultado;\n\t\tfloopets_BD::Disconnect();\n}", "public function test_pagar_monto_viaje_plus_doble() {\n $tiempo = new Tiempo();\n $tiempo->avanzar( 36000 );\n $medio_boleto = new Tarjeta_Medio_Boleto( Null );\n $colectivo = new Colectivo( 'mixta', '133', 420 );\n $medio_boleto->recargar( 50.0 );\n $medio_boleto->gastarPlus();\n $medio_boleto->gastarPlus();\n $this->assertEquals( $medio_boleto->getViajesPlus(), 0 );\n $boleto = $medio_boleto->pagarConTarjeta( $colectivo , $tiempo );\n $this->assertEquals( $boleto->getValor(), $this->getCostoMedioBoleto() + (2 * $this->getCostoViaje() ) );\n }", "function dartecnico_asuntado($id_peticion) {\n //cambiado por pod\n $query_rs_usuarios = sprintf(\"SELECT tb_usuarios.usuario\n FROM tb_pedido_usuarios tb_pedido_usuarios\n INNER JOIN tb_usuarios tb_usuarios\n ON (tb_pedido_usuarios.id_usuarios = tb_usuarios.id_usuarios)\n WHERE (tb_pedido_usuarios.id_peticion = %s) and (tb_pedido_usuarios.estado = 'PROCE') ;\", $id_peticion);\n //echo \"<pre><code>\".$query_rs_usuarios.\"</code></pre>\";\n\n $row_rs_usuarios = conT($query_rs_usuarios);\n\n ?>\n <?php $i=0;\n foreach ($row_rs_usuarios as $row_rs_usuarios ) {\n $i++;\n ?>\n <?php echo $row_rs_usuarios[\"usuario\"]; ?>|\n <?php } ?>\n <?php\n\n return $i;\n }", "public static function obtenerNuevasDesignaciones($idsede, $anio, $idarea)\n {\n \n $anioanterior = $anio - 1;\n\n $sql =\"SELECT sed.nombre as sede, CONCAT(car.nombre,' - ',pe.nombre) as carreraplan, car.nombre as carrera, fac.nombre as facultad, CONCAT(per.apellido,', ',per.nombre) as persona,\n per.apellido, per.nombre,\n tp.descripcion as tipodocumento, \n per.numerodoc,\n m.nombre as materia,\n td.descripcion as tipodesignacion,\n cd.descripcion as categoria, \n cd.idcategoriadesignacion,\n edes.descripcion as estadodesignacion,\n mp.anodecursada,\n IFNULL(des.horas, 0 ) as horas,\n td.descripcion as tipo, \n if(des.adhonorem,'AD HONOREM','') as adhonorem, \n if(des.licencia,'EN LICENCIA','') as licencia, \n ded.descripcion as dedicacion,\n sed.abreviacion as sedeabreviada,\n car.idcarrera,\n YEAR(des.inicio) as ciclolectivo,\n DATE_FORMAT(des.inicio, '%d/%m/%Y') AS inicioformat, DATE_FORMAT(des.fin, '%d/%m/%Y') AS finformat\n FROM designaciones des \n JOIN estados_designaciones edes ON des.idestadodesignacion = edes.idestadodesignacion\n JOIN profesores prof ON des.idprofesor = prof.idprofesor\n JOIN personas per ON prof.idpersona = per.idpersona \n JOIN tipos_documentos tp ON per.idtipodoc = tp.idtipodoc\n JOIN dedicaciones ded ON des.iddedicacion = ded.iddedicacion\n JOIN catedras cat ON des.idcatedra = cat.idcatedra \n JOIN sedes sed ON cat.idsede = sed.idsede \n JOIN materias_planes mp ON cat.idmateriaplan = mp.idmateriaplan\n JOIN materias m ON mp.idmateria = m.idmateria\n JOIN planes_estudios pe ON mp.idplanestudio = pe.idplanestudio\n JOIN carreras car ON pe.idcarrera = car.idcarrera \";\n \n // se filtra por area solo si el area existe\n if ($idarea<>'')\n $sql .=\" JOIN areas_carrera ar ON car.idcarrera= ar.idcarrera AND ar.idarea = \".$idarea.\" \"; \n\n \n $sql .=\"JOIN facultades fac ON car.idfacultad = fac.idfacultad \n JOIN tipos_designaciones td ON des.idtipodesignacion = td.idtipodesignacion\n JOIN categoria_designaciones cd ON td.idcategoriadesignacion= cd.idcategoriadesignacion \n LEFT JOIN (SELECT designaciones.idcatedra, designaciones.idprofesor FROM designaciones JOIN catedras ON designaciones.idcatedra = catedras.idcatedra WHERE YEAR(designaciones.inicio) = \".$anioanterior.\" AND catedras.idsede = \".$idsede.\" AND designaciones.idcatedra IS NOT NULL AND designaciones.idprofesor IS NOT NULL GROUP BY designaciones.idcatedra, designaciones.idprofesor) as anioanterior ON des.idprofesor = anioanterior.idprofesor AND des.idcatedra = anioanterior.idcatedra \n WHERE YEAR(des.inicio)= \".$anio.\" AND sed.idsede = \".$idsede.\" AND anioanterior.idprofesor IS NULL\n ORDER BY car.nombre, per.apellido; \";\n \n $q = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchAssoc($sql);\n\n return $q;\n }", "function listaCompromissos($dia=\"\",$mes=\"\",$ano=\"\") {\n if (empty($dia)) {\n $data = getDate();\n $dia = $data[mday];\n $mes = $data[mon];\n $ano = $data[year];\n }\n\n $data_0_0 = strtotime(\"$mes/$dia/$ano 00:00\");\n $data_23_59 = strtotime(\"$mes/$dia/$ano 23:59:59\");\n $chaves = array();\n $chaves[] = opVal(\"timeData\",$data_0_0,\"\",\">=\");\n $chaves[] = opVal(\"timeData\",$data_23_59,\"\",\"<=\");\n $chaves[] = opVal(\"codUser\",$this->codUser);\n $ordem = \"timeData desc\";\n\n $compromissos = new RDLista(\"RDCompromisso\",$chaves,$ordem);\n return $compromissos;\n }", "function idiomas_disponibles($id_palabra,$estado) {\n\t\n\t\tif ($estado==0) { $sql_estado='AND traducciones.estado = 0'; }\n\t\telseif ($estado==1) { $sql_estado='AND traducciones.estado = 1'; }\n\t\telseif ($estado==2) { $sql_estado='AND traducciones.estado = 2'; }\n\t\telse { $sql_estado=''; } \n\t\t$query = \"SELECT \n\t\ttraducciones.estado,traducciones.id_palabra,traducciones.id_idioma,\n\t\tidiomas.id_idioma,idiomas.idioma \n\t\tFROM traducciones, idiomas\n\t\tWHERE traducciones.id_palabra = '$id_palabra'\n\t\tAND traducciones.id_idioma = idiomas.id_idioma\n\t\t$sql_estado\n\t\tGROUP BY idiomas.id_idioma\";\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\tmysql_close($connection);\n\t\treturn $result;\n\t}", "public function get_resumen_ventas_cobros($fecha,$sucursal){\n\t$conectar= parent::conexion();\n\tparent::set_names(); \n\t$fecha_corte = $fecha.\"%\";\n\t$sql=\"select * from corte_diario where fecha_ingreso like ? and (sucursal_venta=? or sucursal_cobro=?);\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$fecha_corte);\n\t$sql->bindValue(2,$sucursal);\n\t$sql->bindValue(3,$sucursal);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "function listarPeriodoVenta(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_PERVEN_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n\n //Definicion de la lista del resultado del query\n $this->captura('id_periodo_venta','int4');\n $this->captura('id_gestion','int4');\n $this->captura('mes','varchar');\n $this->captura('estado','varchar');\n $this->captura('nro_periodo_mes','int4');\n $this->captura('fecha_fin','date');\n $this->captura('fecha_ini','date');\n $this->captura('tipo_periodo','varchar');\n $this->captura('medio_pago','varchar');\n $this->captura('tipo_cc','varchar');\n $this->captura('estado_reg','varchar');\n $this->captura('id_usuario_ai','int4');\n $this->captura('id_usuario_reg','int4');\n $this->captura('usuario_ai','varchar');\n $this->captura('fecha_reg','timestamp');\n $this->captura('fecha_mod','timestamp');\n $this->captura('id_usuario_mod','int4');\n $this->captura('usr_reg','varchar');\n $this->captura('usr_mod','varchar');\n $this->captura('desc_periodo','text');\n $this->captura('fecha_pago','date');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function asignar_pago_adelantado($acceso,$id_contrato){\n\t$cable=conexion();\n\t$acceso1=conexion();\n\t$cable->objeto->ejecutarSql(\"select id_pago,costo_cobro,id_cont_serv from vista_pago_ser where id_contrato='$id_contrato' and id_serv='ZZZ00001'\");\n\twhile($row=row($cable)){\n\t\n\t\t$id_pago=trim($row['id_pago']);\n\t\t$id_cont_serv_deuda=trim($row['id_cont_serv']);\n\t\t$monto_pago=trim($row['costo_cobro'])+0;\n\t\t\n\t\t//echo \"<br>:$id_pago:$monto_pago:$id_cont_serv_deuda\";\n\t\t//echo \"<br>:select tipo_costo,id_cont_serv,(((cant_serv * costo_cobro)-descu) - pagado ) as costo from vista_contratodeu where id_contrato='$id_contrato' and status_con_ser='DEUDA' and costo_cobro>0 order by tipo_serv ,fecha_inst:<br>\";\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t$acceso1->objeto->ejecutarSql(\"select tipo_costo,id_cont_serv,(((cant_serv * costo_cobro)-descu) - pagado ) as costo from vista_contratodeu where id_contrato='$id_contrato' and status_con_ser='DEUDA' and (((cant_serv * costo_cobro)-descu) - pagado )>0 order by tipo_serv ,fecha_inst\");\n\t\twhile($row=row($acceso1)){\n\t\t\t$id_cont_serv=trim($row['id_cont_serv']);\n\t\t\t$tipo_costo=trim($row['tipo_costo']);\n\t\t\t$costo=trim($row['costo'])+0;\n\t\t\t//echo \"<br>id_cont_serv:$id_cont_serv:costo:$costo<br>\";\n\t\t\tif($monto_pago>=$costo){\n\t\t\t\t$id_select=$id_select.\"=@$id_cont_serv\";\n\t\t\t\t$acceso->objeto->ejecutarSql(\"Update contrato_servicio_deuda Set apagar=0, pagado=pagado+'$costo' where id_cont_serv='$id_cont_serv'\");\n\t\t\t\t$acceso->objeto->ejecutarSql(\"insert into pago_factura(id_pago,id_cont_serv,costo_cobro_serv) values ('$id_pago','$id_cont_serv','$costo')\");\n\t\t\t\t$acceso->objeto->ejecutarSql(\"update contrato_servicio_deuda set status_con_ser='PAGADO' where id_cont_serv='$id_cont_serv' and ((cant_serv * costo_cobro)-descu)=pagado\");\n\t\t\t\t$monto_pago=$monto_pago-$costo;\n\t\t\t}\n\t\t\telse if($monto_pago>0){\n\t\t\t\t$id_select=$id_select.\"=@$id_cont_serv\";\n\t\t\t\t$acceso->objeto->ejecutarSql(\"Update contrato_servicio_deuda Set apagar=0, pagado=pagado+'$monto_pago' where id_cont_serv='$id_cont_serv'\");\n\t\t\t\t\n\t\t\t\t$cable->objeto->ejecutarSql(\"select costo_cobro_serv from pago_factura where id_pago='$id_pago' and id_cont_serv='$id_cont_serv'\");\n\t\t\t\tif($row=row($cable)){\n\t\t\t\t\t$costo_cobro_serv1=trim($row['costo_cobro_serv'])+0;\n\t\t\t\t\t//echo \"<BR>ENTRO ACT<BR>update pago_factura set costo_cobro_serv=costo_cobro_serv+$costo_cobro_serv1 where id_pago='$id_pago' and id_cont_serv='$id_cont_serv';\";\n\t\t\t\t\t$acceso->objeto->ejecutarSql(\"update pago_factura set costo_cobro_serv=costo_cobro_serv+$costo_cobro_serv1 where id_pago='$id_pago' and id_cont_serv='$id_cont_serv'\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$acceso->objeto->ejecutarSql(\"insert into pago_factura(id_pago,id_cont_serv,costo_cobro_serv) values ('$id_pago','$id_cont_serv','$monto_pago')\");\n\t\t\t\t}\n\t\t\t\t$acceso->objeto->ejecutarSql(\"update contrato_servicio_deuda set status_con_ser='PAGADO' where id_cont_serv='$id_cont_serv' and ((cant_serv * costo_cobro)-descu)=pagado\");\n\t\t\t\t$monto_pago=0;\n\t\t\t}\n\t\t}\n\t\t$acceso->objeto->ejecutarSql(\"select id_pago from contrato_servicio_deuda where id_cont_serv='$id_cont_serv_deuda'\");\n\t\t$row=row($acceso);\n\t\t$id_pago_ade=trim($row['id_pago']);\n\t\t\t//echo \"<br>:$monto_pago:<br>\";\n\t\tif($monto_pago>0){\n\t\t\t$acceso->objeto->ejecutarSql(\"update pago_factura set costo_cobro_serv=$monto_pago where id_cont_serv='$id_cont_serv_deuda' \");\n\t\t\t$acceso->objeto->ejecutarSql(\"update contrato_servicio_deuda set costo_cobro=$monto_pago, pagado=$monto_pago where id_cont_serv='$id_cont_serv_deuda'\");\n\t\t\t\n\t\t\tactualizar_monto_pago($acceso,$id_pago_ade);\n\t\t}else{\n\t\t\t\n\t\t\t$acceso->objeto->ejecutarSql(\"delete from pago_factura where id_cont_serv='$id_cont_serv_deuda'\");\n\t\t\t$acceso->objeto->ejecutarSql(\"delete from contrato_servicio_deuda where id_cont_serv='$id_cont_serv_deuda'\");\n\t\t\t//echo \"delete from pagos where id_pago='$id_pago_ade'<br><br>\";\n\t\t\t$acceso->objeto->ejecutarSql(\"delete from pagos where id_pago='$id_pago_ade'\");\n\t\t}\n\n\t}//while inicial\n}", "public function gerarVenda($titulo,$cliente){\n //$conexao = $c->conexao();\n\n\n $sql = \"INSERT INTO tbpedidos (reg, tipo, titulo, data_inc) VALUES ('$cliente','V','$titulo', NOW()) \";\n\n return $this->conexao->query($sql);\n\n\n }", "public static function obtenerOrdenesGeneradas()\n {\n $consulta = \"SELECT * FROM ordenes WHERE estado>=2 ORDER BY id_orden DESC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "function arreglasecuord(){\n\t\t$mSQL='SELECT codigo,precio1,precio2,precio3,precio4 FROM sinv WHERE precio2>precio1 OR precio3>precio2 OR precio3>precio1 OR precio4>precio3 OR precio4>precio2 OR precio4>precio1';\n\t\t$query = $this->db->query($mSQL);\n\t\tforeach ($query->result() as $row){\n\t\t\t$dbcodigo= $this->db->escape($row->codigo);\n\t\t\t$precios = array($row->precio1,$row->precio2,$row->precio3,$row->precio4);\n\t\t\tsort($precios);\n\t\t\t$precios=array_reverse($precios);\n\n\t\t\t$data=array();\n\t\t\tforeach($precios as $i=>$prec){\n\t\t\t\t$o=$i+1;\n\t\t\t\t$ind='precio'.$o;\n\t\t\t\t$data[$ind] = $prec;\n\t\t\t}\n\n\t\t\t$where = \"codigo = ${dbcodigo}\";\n\t\t\t$sql = $this->db->update_string('sinv', $data, $where);\n\t\t\t$this->db->query($sql);\n\t\t}\n\t\t$this->arreglamarbases();\n\t}", "function bancos($periodo,$ejer,$moneda){\n\t\t\t$sql=$this->query(\"select m.IdPoliza,m.Cuenta,sum(m.Importe) importe,m.TipoMovto,c.description,p.relacionExt,p.concepto\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 and p.idtipopoliza!=3\n\t\t\tand m.IdPoliza=p.id and p.idperiodo in (\".$periodo.\",\".($periodo-=1).\") and p.activo=1 and m.Activo=1\n\t\t\tgroup by m.Cuenta,m.TipoMovto\");\n\t\t\treturn $sql;\n\t\t}", "public function generartodo($mes,$anho)\n {\n \t$becarios = Becario::where('acepto_terminos','=',1)->where('status','=','activo')->get();\n \t$costo = Costo::first();\n /*$control = Control::first();\n if(is_null($control))\n {\n cantidad=0;\n }*/\n //$control = count(Nomina::groupby('mes','year')->get());\n \tforeach($becarios as $becario)\n \t{\n\n \t\t$nomina = new Nomina();\n \t\t$nomina->retroactivo = 0;\n \n \t\t$nomina->sueldo_base = $costo->sueldo_becario;\n \t\t$total = 0;\n \t\tforeach($becario->factlibros as $factlibro)\n \t\t{\n \t\t\t$total = $total + $factlibro->costo;\n \t\t}\n $nomina->monto_libros = $total;\n \t\t$nomina->total = $nomina->sueldo_base + $nomina->retroactivo + $total;\n \t\t$nomina->mes = $mes;\n \t\t$nomina->year = $anho;\n \t\t$nomina->status = 'pendiente';\n \t\t$nomina->fecha_pago = null;\n \t\t$nomina->fecha_generada = null;\n \t\t$nomina->save();\n\n \t\t$bn = new BecarioNomina();\n \t\t$bn->user_id = $becario->user_id;//--becario_id\n \t\t$bn->nomina_id = $nomina->id;\n \t\t$bn->save();\n\n \t}\n\n\n /* $control->cont = $control->cont+1\n $control->save();*/\n flash(\"La nómina del \".$mes.\"/\".$anho.\" fue generada exitosamente.\",'success');\n \treturn redirect()->route('nomina.listar');\n }", "function armar_consulta($pdia,$udia,$anio){\n //designaciones sin licencia UNION designaciones c/licencia sin norma UNION designaciones c/licencia c norma UNION reservas\n// $sql=\"(SELECT distinct t_d.id_designacion, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac,t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n// 0 as dias_lic, case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n// FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n// LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n// LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n// LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n// LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n// LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n// LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n// LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n// LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n// LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n// LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON ( m_e.anio=\".$anio.\")\".\n// \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n// docente as t_d1,\n// caracter as t_c,\n// unidad_acad as t_ua \n// \n// WHERE t_d.id_docente = t_d1.id_docente\n// AND t_d.carac = t_c.id_car \n// AND t_d.uni_acad = t_ua.sigla \n// AND t_d.tipo_desig=1 \n// AND not exists(SELECT * from novedad t_no\n// where t_no.id_designacion=t_d.id_designacion\n// and (t_no.tipo_nov=1 or t_no.tipo_nov=2 or t_no.tipo_nov=4 or t_no.tipo_nov=5)))\n// UNION\n// (SELECT distinct t_d.id_designacion, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac, t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n// 0 as dias_lic, case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n// FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n// LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n// LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n// LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n// LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n// LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n// LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n// LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n// LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n// LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n// LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n// LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\".\n// \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n// docente as t_d1,\n// caracter as t_c,\n// unidad_acad as t_ua,\n// novedad as t_no \n// \n// WHERE t_d.id_docente = t_d1.id_docente\n// AND t_d.carac = t_c.id_car \n// AND t_d.uni_acad = t_ua.sigla \n// AND t_d.tipo_desig=1 \n// AND t_no.id_designacion=t_d.id_designacion\n// AND (((t_no.tipo_nov=2 or t_no.tipo_nov=5 ) AND (t_no.tipo_norma is null or t_no.tipo_emite is null or t_no.norma_legal is null))\n// OR (t_no.tipo_nov=1 or t_no.tipo_nov=4))\n// )\n// UNION\n// (SELECT distinct t_d.id_designacion, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac,t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n// sum((case when (t_no.desde>'\".$udia.\"' or (t_no.hasta is not null and t_no.hasta<'\".$pdia.\"')) then 0 else (case when t_no.desde<='\".$pdia.\"' then ( case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_no.hasta-'\".$pdia.\"')+1) end ) else (case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then ((('\".$udia.\"')-t_no.desde+1)) else ((t_no.hasta-t_no.desde+1)) end ) end )end)*t_no.porcen ) as dias_lic,\n// case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n// FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n// LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n// LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n// LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n// LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n// LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n// LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n// LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n// LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n// LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n// LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n// LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\".\n// \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n// docente as t_d1,\n// caracter as t_c,\n// unidad_acad as t_ua,\n// novedad as t_no \n// \n// WHERE t_d.id_docente = t_d1.id_docente\n// \tAND t_d.carac = t_c.id_car \n// \tAND t_d.uni_acad = t_ua.sigla \n// \tAND t_d.tipo_desig=1 \n// \tAND t_no.id_designacion=t_d.id_designacion \n// \tAND (t_no.tipo_nov=2 or t_no.tipo_nov=5) \n// \tAND t_no.tipo_norma is not null \n// \tAND t_no.tipo_emite is not null \n// \tAND t_no.norma_legal is not null\n// GROUP BY t_d.id_designacion,docente_nombre,t_d1.legajo,t_d.nro_cargo,anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, cat_mapuche_nombre, cat_estat, dedic,t_c.descripcion , t_d3.descripcion , t_a.descripcion , t_o.descripcion ,t_d.uni_acad, t_m.quien_emite_norma, t_n.nro_norma, t_x.nombre_tipo , t_d.nro_540, t_d.observaciones, m_p.nombre, t_t.id_programa, t_t.porc,m_c.costo_diario, check_presup, licencia,t_d.estado \t\n// )\".\n //--sino tiene novedad entonces dias_lic es 0 case when t_no.id_novedad is null \n //--si tiene novedad tipo 2,5 y no tiene norma entonces dias_lic es 0\n $sql=\" SELECT distinct t_d.id_designacion,t_d.por_permuta,t_d.tipo_desig, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac, t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n sum(case when t_no.id_novedad is null then 0 else (case when (t_no.desde>'\".$udia.\"' or (t_no.hasta is not null and t_no.hasta<'\".$pdia.\"')) then 0 else (case when t_no.desde<='\".$pdia.\"' then ( case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_no.hasta-'\".$pdia.\"')+1) end ) else (case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then ((('\".$udia.\"')-t_no.desde+1)) else ((t_no.hasta-t_no.desde+1)) end ) end )end)*t_no.porcen end) as dias_lic,\n case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n FROM designacion as t_d \n LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\n LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo)\n LEFT OUTER JOIN novedad t_no ON (t_d.id_designacion=t_no.id_designacion and t_no.tipo_nov in (2,5) and t_no.tipo_norma is not null \n \t\t\t\t\tand t_no.tipo_emite is not null \n \t\t\t\t\tand t_no.norma_legal is not null \n \t\t\t\t\tand t_no.desde<='\".$udia.\"' and t_no.hasta>='\".$pdia.\"'),\n docente as t_d1,\n caracter as t_c,\n unidad_acad as t_ua \n WHERE t_d.id_docente = t_d1.id_docente\n AND t_d.carac = t_c.id_car \n AND t_d.uni_acad = t_ua.sigla \n AND t_d.tipo_desig=1 \n GROUP BY t_d.id_designacion,t_d.por_permuta,t_d.tipo_desig,docente_nombre,t_d1.legajo,t_d.nro_cargo,anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, cat_mapuche_nombre, cat_estat, dedic,t_c.descripcion , t_d3.descripcion , t_a.descripcion , t_o.descripcion ,t_d.uni_acad, t_m.quien_emite_norma, t_n.nro_norma, t_x.nombre_tipo , t_d.nro_540, t_d.observaciones, m_p.nombre, t_t.id_programa, t_t.porc,m_c.costo_diario, check_presup, licencia,t_d.estado \t\".\n\n \" UNION\n (SELECT distinct t_d.id_designacion,0 as por_permuta,t_d.tipo_desig, 'RESERVA'||': '||t_r.descripcion as docente_nombre, 0, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac, t_d3.descripcion as id_departamento, t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n 0 as dias_lic,\n case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\".\n \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n caracter as t_c,\n unidad_acad as t_ua,\n reserva as t_r \n \n WHERE t_d.carac = t_c.id_car \n \tAND t_d.uni_acad = t_ua.sigla \n \tAND t_d.tipo_desig=2 \n \tAND t_d.id_reserva = t_r.id_reserva \t\n )\";\n //esto es para las designaciones que tienen mas de un departamento,area,orientacion\n $sql2=\"SELECT distinct sub1.id_designacion,sub1.por_permuta,sub1.tipo_desig,sub1.docente_nombre,sub1.legajo,sub1.nro_cargo,sub1.anio_acad,sub1.desde,sub1.hasta,sub1.cat_mapuche, sub1.cat_mapuche_nombre,\n sub1.cat_estat, sub1.dedic, sub1.carac,case when sub2.id_designacion is not null then sub2.dpto else sub1.id_departamento end as id_departamento,case when sub2.id_designacion is not null then sub2.area else sub1.id_area end as id_area,case when sub2.id_designacion is not null then sub2.orientacion else sub1.id_orientacion end as id_orientacion\n , sub1.uni_acad, sub1.emite_norma, sub1.nro_norma, sub1.tipo_norma, sub1.nro_540, sub1.observaciones, sub1.id_programa, sub1.programa, sub1.porc, sub1.costo_diario, sub1.check_presup, sub1.licencia, sub1.estado, sub1.dias_lic, sub1.dias_des\n FROM (\".$sql.\")sub1\"\n . \" LEFT OUTER JOIN (select d.id_designacion,excepcion_departamento(a.id_designacion)as dpto,excepcion_area(a.id_designacion) as area,excepcion_orientacion(a.id_designacion) as orientacion\n from designacion d,dao_designa a \n where d.desde <='\".$udia.\"' and (d.hasta>='\".$pdia.\"' or d.hasta is null)\n and a.id_designacion=d.id_designacion)sub2 ON (sub1.id_designacion=sub2.id_designacion)\";\n return $sql2;\n }", "public function get_dias ($fecha_inicio, $fecha_fin, $dias_seleccionados){\n //aca debemos tratar el caso del mes de febrero, que puede tener 29 dias si el anio es bisiesto\n $anio=date('Y');\n $febrero=(($anio%400==0) || (($anio%4==0)&&($anio%100 != 0))) ? 29 : 28;\n $this->_meses[2]=$febrero;\n\n //obtenemos dia (01 a 31) y mes (01 a 12) con representacion numerica\n $dia_inicio=date('d', strtotime($fecha_inicio));\n $mes_inicio=date('m', strtotime($fecha_inicio));\n\n $dia_fin=date('d', strtotime($fecha_fin));\n $mes_fin=date('m', strtotime($fecha_fin));\n\n if($mes_inicio == $mes_fin){\n //con mes_inicio y mes_fin obtenemos la cantidad de dias que forman a dichos meses\n return $this->generar_dias($dia_inicio, $dia_fin, $mes_inicio, $mes_fin, 'mm', $dias_seleccionados, NULL);\n }\n else{\n $diff=$mes_fin - $mes_inicio;\n if($diff >= 2){ //tenemos meses intermedios entre el periodo seleccionado\n //debemos decrementar una unidad de diff, para no repetir meses\n return $this->generar_dias($dia_inicio, $dia_fin, $mes_inicio, $mes_fin, 'mnc', $dias_seleccionados, $this->obtener_meses_intermedios($mes_inicio, ($diff - 1)));\n }\n else{ //en esta rama diff posee el valor 1, lo que implica que existen meses contiguos\n return $this->generar_dias($dia_inicio, $dia_fin, $mes_inicio, $mes_fin, 'mc', $dias_seleccionados, NULL);\n }\n }\n\n }", "public function get_datos_ventas_cobros_contado($fecha,$sucursal){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n \n\t$fecha_corte = $fecha.\"%\";\n\t$sql=\"select c.n_factura,c.fecha_ingreso,c.n_recibo,c.paciente,u.usuario,c.total_factura,c.forma_cobro,c.monto_cobrado,c.saldo_credito,c.abonos_realizados from\ncorte_diario as c inner join usuarios as u on u.id_usuario=c.id_usuario where c.fecha_ingreso like ? and c.abonos_realizados='0' and c.tipo_venta='Contado' AND tipo_ingreso='Venta' and (sucursal_venta=? or sucursal_cobro=?);\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$fecha_corte);\n\t$sql->bindValue(2,$sucursal);\n\t$sql->bindValue(3,$sucursal);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function consultarRecesosDia($idUsuario, $dia){\n\n\t\t$resultado = array();\n\t\t\n\t\t$dia \t\t\t= parent::escaparQueryBDCliente($dia); \n\t\t$idUsuario \t= parent::escaparQueryBDCliente($idUsuario); \n\t\t\n\t\t$query = \"SELECT HR.idAgendaHorarioReceso, DATE_FORMAT(HR.horaInicio, '%H:%i') as horaInicio, DATE_FORMAT(HR.horaFin, '%H:%i') as horaFin, HR.idAgendaRecesosUsuario\n\t\t\t\t\t\t\tFROM tb_agendaHorarioReceso as HR\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tINNER JOIN tb_agendaRecesosUsuario AS RU on RU.idAgendaRecesosUsuario = HR.idAgendaRecesosUsuario\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tWHERE (RU.numeroDia = '$dia') AND (RU.idUsuario = '$idUsuario') AND (HR.estado = 'A') \";\n\t\t\n $conexion = parent::conexionCliente();\n\t\t\n\t\t\n\t\n\t\tif($res = $conexion->query($query)){\n while ($filas = $res->fetch_assoc()) {\n $resultado[] = $filas;\n }\n \n /* liberar el conjunto de resultados */\n $res->free(); \n }\n\n return $resultado;\t\n\n\t\t\n\t}", "function listaTodosAniversariantesdeHojeDao(){\r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objDao = Connection::getInstance();\r\n \r\n $dataAtual = Date(\"Y-m-d\");\r\n $mes = $dataAtual[5].$dataAtual[6];\r\n $dia = $dataAtual[8].$dataAtual[9];\r\n //echo \"Mes \". $mes. \"Dia \".$dia;\r\n \r\n// $dbconn = mysqli_connect ($objDao->getServer(),$objDao->getUsername(),$objDao->getPassword(),$objDao->getDb());\r\n \r\n// $resultado = mysqli_query ($dbconn,\"CALL aniversariantedehoje($mes,$dia)\");\r\n $consulta=\"SELECT Matricula,Nome,DataNascimento1,Fone FROM membros WHERE MONTH(DataNascimento1) = $mes AND DAY(DataNascimento1)=$dia\";\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 \r\n }", "public function deshuso(){\n try{\n $gestion = isset($_GET['gestion']) ? $_GET['gestion'] : date('Y');\n $almacen = isset($_GET['almacen']) ? $_GET['almacen'] : 0;\n $datos = \\DB::table('articulos_movimientos')->join('users', 'articulos_movimientos.id_usuario', '=', 'users.id')\n ->join('movimientos', 'articulos_movimientos.id_movimiento', '=', 'movimientos.id')\n ->join('almacenes', 'articulos_movimientos.id_almacen', '=', 'almacenes.id')\n ->join('aperturas', 'articulos_movimientos.id_apertura', '=', 'aperturas.id')\n ->join('clasificadores', 'articulos_movimientos.id_clasificador','=', 'clasificadores.id')\n ->join('conceptos', 'movimientos.id_concepto', '=', 'conceptos.id')\n ->where('articulos_movimientos.observacion', '!=', '' )\n ->where('articulos_movimientos.id_gestion', '=', $gestion)\n ->where('articulos_movimientos.id_almacen', '=', $almacen)\n ->select('articulos_movimientos.id', 'articulos_movimientos.*', 'movimientos.fecha as movimientoFecha', 'movimientos.movimiento as movimientoTipo',\n 'conceptos.tipo', 'conceptos.concepto', 'users.name', 'movimientos.nro_moviento',\n 'clasificadores.codigo as clasificadorCodigo',\n 'aperturas.codigo as aperturaCodigo', 'aperturas.*',\n 'almacenes.*')\n ->orderBy('articulos_movimientos.id_almacen', 'asc')\n ->get();\n\n $bienes = \\DB::table('bienes')->join('users', 'bienes.id_usuario', '=', 'users.id')\n ->join('unidades', 'bienes.id_unidad', '=', 'unidades.id')\n ->join('articulos_movimientos', 'bienes.id', '=', 'articulos_movimientos.id_bien')\n ->join('clasificadores', 'articulos_movimientos.id_clasificador','=', 'clasificadores.id')\n ->where('articulos_movimientos.observacion', '!=', '' )\n ->where('bienes.id_gestion', '=', $gestion)\n ->select('bienes.id', 'bienes.codigo', 'bienes.bien', 'unidades.unidad', 'users.name',\n 'clasificadores.codigo as clasificadorCodigo', 'articulos_movimientos.id_almacen')\n ->groupBy('bienes.id')->get();\n\n $configuracion = \\DB::table('configuraciones')->first();\n $almacenes = \\App\\Almacenes::find($almacen);\n $gestion = Gestiones::find($gestion);\n\n $pdf = \\PDF::loadView('reporte.deshusoReporte', compact('datos', 'configuracion', 'bienes', 'apertura', 'almacenes', 'gestion') )\n ->setPaper('letter')->setOrientation('portrait')\n ->setOption('page-width', '216mm')\n ->setOption('page-height', '279mm')\n ->setOption('margin-right', '10mm')\n ->setOption('margin-left', '14mm')\n ->setOption('margin-bottom', '25mm')\n ->setOption('header-spacing', 15)\n ->setOption('footer-spacing', 1)\n ->setOption('footer-html', asset('pie.php'));\n\n return $pdf->inline('Codigo4060_Apertura'.date('Ymdhis').'.pdf');\n }catch(\\Exception $e){\n return \"<script> alert('Error R0008: Reporte de bienes en deshuso \\n\".$e->getMessage().\"'); location.href='\".asset('index.php/Reportes').\"'; </script>\";\n }\n }", "public function dameMantenimientosAnteriores($inicio, $fin){\n\n $consulta = $this->getQueryBuilder();\n \n $consulta->select('d.id','d.direccion','c.id as cliente',\n 'd.telefono', 'd.sCliente',\n 'd.observaciones',\n 'dist.distrito',\n 'c.nombre', 'p.modelo', 'f.familia', 'p.fechaNuevoMantenimiento','p.periodicidad','t.tipoContrato', 'p.planificada')\n ->leftJoin('d.cliente', 'c')\n ->leftJoin('d.producto', 'p')\n ->leftJoin('p.familia', 'f')\n ->leftJoin('p.contrato', 't')\n ->leftJoin('d.distrito', 'dist')\n ->Where('p.fechaNuevoMantenimiento BETWEEN :inicio AND :fin') \n ->andWhere('p.planificada IS NULL')\n ->setParameter('inicio', $inicio) \n ->setParameter('fin', $fin);\n $consulta->orderby('d.distrito', 'ASC')\n ->addOrderBy('p.fechaNuevoMantenimiento', 'DESC')\n ->getQuery();\n \n\n $lista= $consulta->getQuery()->getResult();\n\n return $lista;\n }", "public function buscaPorIdes($ids, $campo, $orden) {\r\n $this->SQL = \"SELECT empleado, nif, nombre\";\r\n $this->SQL .= \" FROM rcja_usuarios\";\r\n $contador = 0;\r\n foreach ($ids as $id) {\r\n if($contador == 0) {\r\n $this->SQL .= \" WHERE empleado = '{$id['idRCJA']}'\";\r\n }\r\n $this->SQL .= \" OR empleado = '{$id['idRCJA']}'\";\r\n $contador++;\r\n }\r\n $this->SQL .= \" ORDER BY {$this->campos[$campo]} {$this->ordenes[$orden]};\";\r\n// $this->debug($this->SQL);\r\n return $this->SQL;\r\n }", "function listado_temas_idiomas($idioma) {\n\n\t\t$query = \"SELECT * FROM temas ORDER BY tema_$idioma\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\t\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function contratos_por_fecha_inicial($fecha, $fecha1, $fecha2){\n $sql =\n \"SELECT\n c.Numero,\n c.Objeto,\n c.Lugar,\n c.Acta_Inicio,\n c.Fecha_Acta_Inicio,\n c.Fecha_Vencimiento,\n c.Plazo,\n c.Valor_Inicial,\n e.Estado,\n t.Nombre AS Contratista,\n c.Fecha_Inicial \n FROM\n contratos AS c\n INNER JOIN tbl_terceros AS t ON c.Fk_Id_Terceros = t.Pk_Id_Terceros\n INNER JOIN tbl_estados AS e ON c.Fk_Id_Estado = e.Pk_Id_Estado \n WHERE\n c.$fecha BETWEEN '$fecha1' AND '$fecha2' \n AND c.Fk_Id_Proyecto = {$this->session->userdata('Fk_Id_Proyecto')} \n ORDER BY\n c.Numero ASC\";\n\n //Se retorna la consulta\n return $this->db->query($sql)->result();\n }", "function adjudicarTodo(){\n $this->procedimiento='adq.f_cotizacion_ime';\n $this->transaccion='ADQ_ADJTODO_IME';\n $this->tipo_procedimiento='IME';\n \n //Define los parametros para la funcion\n $this->setParametro('id_cotizacion','id_cotizacion','int4');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "public function operaDia($tour, $tarifa, $_fecha, $numAdulto, $numNiņos){\n\n\t\t/*Validacion de los dias que opera la tarifa */\n\t\t$diaSemana =date(\"N\", strtotime($_fecha));\n\t\tswitch ($diaSemana) {\n\t\t\tcase '1': $diaSemanaText = \"opera_lunes\"; break;\n\t\t\tcase '2': $diaSemanaText = \"opera_martes\"; break;\n\t\t\tcase '3': $diaSemanaText = \"opera_miercoles\"; break;\n\t\t\tcase '4': $diaSemanaText = \"opera_jueves\";\tbreak;\n\t\t\tcase '5': $diaSemanaText = \"opera_viernes\";\tbreak;\n\t\t\tcase '6': $diaSemanaText = \"opera_sabado\"; break;\n\t\t\tcase '7': $diaSemanaText = \"opera_domingo\";\tbreak;\n\t\t}\n\n\t\t$opera_Dia = ($tour[$diaSemanaText] == 1) ? \"true\" : \"false\" ;\n\t\t$numPersonas = $numAdulto + $numNiņos;\n\t\t$descripcionNinos = '';\n\n\t\t/* Validacion para tarifas compartidas ya que solo se pueden reservar en pax que son pares */\n\t\tif ((stripos($tarifa[\"tarifa_nombre_en\"], \"/ Shared\") !== false || $tarifa[\"tarifa_compartido\"] == 1) && ($numPersonas % 2) != 0 ){\n\t\t\t$opera_Dia \t\t= \"false\";\n\t\t\t$descripcion \t= \"Shared rates apply for even </br> number of passengers only.\";\n\t\t}\n\n\t\t/* Validacion para tarifas con adulto abligatorio */\n\t\tif ($tarifa[\"tarifa_adulto_obligatorio\"] == 1 && $numAdulto < $numNiņos) {\n\t\t\t$opera_Dia \t\t= \"false\";\n\t\t\t$descripcion \t= \"Children must be accompanied by an adult.\";\n\t\t}\n\n\t\t/* Validacion Para capacidad minima de un tour */\n\t\tif (!($numPersonas >= $tarifa[\"tarifa_min_adultos\"] )) {\n\t\t\t$opera_Dia \t\t= \"false\";\n\t\t\t$descripcion \t= \"Minimum capacity: \".$tarifa[\"tarifa_min_adultos\"].\" people.\";\n\t\t}\n\n\t\t/* Validacion para capacidad Maxima de un paquete */\n\t\tif ($tarifa[\"tarifa_es_paquete\"] == 1 && $numPersonas > $tarifa['tarifa_max_pax']) {\n\t\t\t$opera_Dia \t\t= \"false\";\n\t\t\t$descripcion \t= \"Maximum capacity: \".$tarifa[\"tarifa_max_pax\"].\" people.\";\n\t\t}\n\n\t\t/* Validacion para capacidad Maxima de un tour */\n\t\tif ($tarifa[\"tarifa_es_paquete\"] != 1 && $numPersonas > $tarifa[\"tarifa_max_adultos\"] ) {\n\t\t\t$opera_Dia \t\t= \"false\";\n\t\t\t$descripcion \t= \"Maximum capacity: \".$tarifa[\"tarifa_max_adultos\"].\" people.\";\n\t\t}\n\n\t\t/*Validacion para precio de niņos para tours */\n\t\tif ($tour[\"tour_adulto\"] == 1 || $tarifa[\"tarifa_precio_menor\"] <= 0) {\n\t\t\t// no acepta niņos\n\t\t\tif ($numNiņos != 0) {\n\t\t\t\t$opera_Dia \t\t= \"false\";\n\t\t\t\t$descripcion \t= \"\";\n\t\t\t\t$descripcionNinos = \"Only Adults\";\n\t\t\t}\n\t\t}\n\n\t\t/* Validacion para precio de adulto mayor a cero */\n\t\tif ($tarifa[\"tarifa_precio_adulto\"] <= 0 && $numAdulto > 0) {\n\t\t\t$opera_Dia \t\t= \"false\";\n\t\t\t$descripcion \t= \"\";\n\t\t}\n\n\t\t/* Validacion para tours especiales ==== > */\n\t\tif ($tarifa[\"tarifa_id\"] == 4809 || $tarifa[\"tarifa_id\"] == 4810) {\n\t\t\tswitch ($diaSemana) {\n\t\t\t\tcase '2':\n\t\t\t\tcase '5':\n\t\t\t\tcase '7':\n\t\t\t\t\t$opera_Dia = \"false\";\n\t\t\t\t\t$descripcion = \"Available on Monday, Wednesday, Thursday and Saturday\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ($tarifa[\"tarifa_id\"] == 4921 ) {\n\t\t\tswitch ($diaSemana) {\n\t\t\t\tcase '7':\n\t\t\t\t\t$opera_Dia = \"false\";\n\t\t\t\t\t$descripcion = \"Available on Monday, Tuesday, Wednesday, Thursday, Friday, Saturday\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* Validacion para tours especiales < ====*/\n\n\t\treturn array(\n\t\t\t'opera' \t\t\t=> $opera_Dia,\n\t\t\t\"descripcion\" \t\t=> $descripcion,\n\t\t\t\"descripcionNino\" \t=> $descripcionNinos\n\t\t);\n\t}", "public function getNominaAus($id)\n { \n $result=$this->adapter->query(\"select a.id, a.idEmp, a.idEmp, d.idConc as idCon,0 as dias,\n ' ' as formula , e.tipo, g.idCcos , e.idFor, g.idCcos, \n case when (b.fechaf >= h.fechaF) then \n DATEDIFF(h.fechaF , b.fechai ) * 8 \n else \n DATEDIFF(b.fechaf , b.fechai ) * 8 end as horas, # temporal para cuando cambie el periodo , tener en cuenta saldo horas\n b.fechai , b.fechaf, e.nombre as nomCon \t\t\t\t\t \n from n_nomina_e a \n inner join a_empleados g on g.id = a.idEmp \n inner join n_ausentismos b on b.id = a.idAus \n inner join n_tip_aus c on c.id = b.idTaus\n inner join n_tip_aus_c d on d.idTaus = c.id \n inner join n_conceptos e on e.id = d.idConc\n inner join n_formulas f on f.id = e.idFor \n inner join n_nomina h on h.id = a.idNom \n where b.estado=1 and a.idNom=\".$id,Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }", "function DIAS_JERARQUIA($_ARGS) {\r\n\t$suma = 0;\r\n\t$sql = \"SELECT \r\n\t\t\t\t en.Fecha, \r\n\t\t\t\t en.FechaHasta, \r\n\t\t\t\t p.Grado, \r\n\t\t\t\t ns.SueldoPromedio AS SueldoBasico \r\n\t\t\tFROM \r\n\t\t\t\t rh_empleadonivelacion en \r\n\t\t\t\t INNER JOIN rh_puestos p ON (en.CodCargo = p.CodCargo) \r\n\t\t\t\t INNER JOIN rh_nivelsalarial ns ON (p.CategoriaCargo = ns.CategoriaCargo AND p.Grado = ns.Grado) \r\n\t\t\tWHERE\r\n\t\t\t\t en.CodOrganismo = '\".$_ARGS['ORGANISMO'].\"' AND\r\n\t\t\t\t --\ten.CodTipoNom = '\".$_ARGS['NOMINA'].\"' AND\r\n\t\t\t\t en.CodPersona = '\".$_ARGS['TRABAJADOR'].\"' AND\r\n\t\t\t\t en.TipoAccion <> 'ET' AND\r\n\t\t\t\t ((en.FechaHasta = '0000-00-00' AND en.Fecha <= '\".$_ARGS['HASTA'].\"') OR\r\n\t\t\t\t ('\".$_ARGS['DESDE'].\"' <= en.FechaHasta))\r\n\t\t\tORDER BY en.Fecha\";\r\n\t$query = mysql_query($sql) or die ($sql.mysql_error());\r\n\twhile ($field = mysql_fetch_array($query)) {\r\n\t\tif ($field['Fecha'] < $_ARGS['DESDE']) $desde = $_ARGS['DESDE'];\r\n\t\telse $desde = $field['Fecha'];\r\n\t\t\r\n\t\tif ($field['FechaHasta'] == \"0000-00-00\" || $field['FechaHasta'] > $_ARGS['HASTA']) $hasta = $_ARGS['HASTA'];\r\n\t\telse $hasta = $field['FechaHasta'];\r\n\t\t\r\n\t\tif ($field['Grado'] == \"90\" || $field['Grado'] == \"96\" || $field['Grado'] == \"97\" || $field['Grado'] == \"98\" || $field['Grado'] == \"99\") {\r\n\t\t\t$dias = DIAS_FECHA($desde, $hasta);\r\n\t\t\t$suma += $dias;\r\n\t\t}\r\n\t}\r\n\treturn $suma;\r\n}", "public function SumarIngresos() \n{\n\tself::SetNames();\n\t$sql = \"select sum(montomovimientocaja) as totalingresos from movimientoscajas where tipomovimientocaja = 'INGRESO' AND DATE_FORMAT(fechamovimientocaja,'%Y-%m-%d') >= ? AND DATE_FORMAT(fechamovimientocaja,'%Y-%m-%d') <= ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function setOrden($orden) {\n $ord = ($orden != 0 && $orden != 1 && $orden != 2) ? 0 : $orden;\n if ($ord != $this->orden) {\n // Si cambia el orden, recarga los datos.\n $fecha = $this->fecha;\n $this->cargarAsistentes($fecha, $ord);\n }\n }", "function dias_semana (){ \n $sql=\"SELECT nombre FROM dia\";\n return toba::db()->consultar($sql);\n }", "function evt__cuadro_fechas__seleccionar ($fecha_cuadro){\n }", "public function puestaACero() {\n $this -> horas = 0;\n $this -> minutos = 0;\n $this -> segundos = 0;\n }", "function dia_letras($dia){\t\n\t\t\t\t\t\t\t\t\t\n\t\t\tswitch($dia)\n\t\t\t{\n\t\t\tcase 1:\n\t\t\t $dia_letras=\"Lunes\";\n\t\t\t break;\n\t\t\tcase 2:\n\t\t\t $dia_letras=\"Martes\";\n\t\t\t break;\n\t\t\tcase 3:\n\t\t\t $dia_letras=\"Miercoles\";\n\t\t\t break;\n\t\t\tcase 4:\n\t\t\t $dia_letras=\"Jueves\";\n\t\t\t break;\n\t\t\tcase 5:\n\t\t\t $dia_letras=\"Viernes\";\n\t\t\t break;\n\t\t\t case 6:\n\t\t\t $dia_letras=\"Sabado\";\n\t\t\t break;\n\t\t\tcase 0:\n\t\t\t $dia_letras=\"Domingo\";\t\t \n\t\t\t break;\n\t\t\tcase 10:\n\t\t\t $dia_letras=\"Festivo\";\n\t\t\t break;\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $dia_letras;\n\t\t\t\n\t\t}", "private function cargarAsistentes($fecha, $orden=0) {\n $this->cargarDatosOmision($fecha, $orden);\n switch ($orden) {\n case 1 : $orden = \"PROPIETARIO, A.CODAPAR\"; break;\n case 2 : $orden = \"REPRESENTANTE, A.CODAPAR\"; break;\n default: $orden = \"A.CODAPAR\"; break;\n }\n if ($fecha) {\n $rRes = Funciones::gEjecutarSQL(\"SELECT A.CODAPAR,CONCAT(A.PORTAL,'-',A.PISO,A.LETRA) AS APARTAMENTO,JA.CODPERS,CONCAT(P.APELLIDOS,' ',P.NOMBRE) AS ASISTENTE,JA.REPRESENTADO,JA.VOTO,A.COEFICIENTEFASE,A.COEFICIENTEBLOQ,IF(JA.REPRESENTADO='S',(SELECT CONCAT(PE.APELLIDOS,' ',PE.NOMBRE) AS PERSONA FROM PROPIETARIOS PR LEFT JOIN PERSONAS PE ON PR.CODPERS=PE.CODPERS WHERE PR.CODAPAR=A.CODAPAR AND IFNULL(PR.BAJA,'9999-99-99')=(SELECT MIN(IFNULL(BAJA,'9999-99-99')) FROM PROPIETARIOS WHERE CODAPAR=PR.CODAPAR AND IFNULL(BAJA,'9999-99-99')>'$fecha') ORDER BY IFNULL(PR.BAJA,'9999-99-99') DESC,PR.ORDEN LIMIT 1),CONCAT(P.APELLIDOS,' ',P.NOMBRE)) AS PROPIETARIO,IF(JA.REPRESENTADO='S',CONCAT(P.APELLIDOS,' ',P.NOMBRE),'') AS REPRESENTANTE FROM ASISTENTES JA LEFT JOIN APARTAMENTOS A ON A.CODAPAR=JA.CODAPAR LEFT JOIN PERSONAS P ON P.CODPERS=JA.CODPERS WHERE JA.FECHA='$fecha' ORDER BY $orden\");\n while($aRow = $rRes->fetch(PDO::FETCH_ASSOC)) {\n $this->aAsistentes[$aRow['CODAPAR']] = array($aRow['APARTAMENTO'],$aRow['CODPERS'], $aRow['ASISTENTE'], $aRow['REPRESENTADO'],$aRow['VOTO'],$aRow['COEFICIENTEFASE'],$aRow['COEFICIENTEBLOQ'],$aRow['PROPIETARIO'],$aRow['REPRESENTANTE']);\n }\n $rRes->closeCursor();\n }\n }", "public function getEduardoListar($datos)\n {\n $tablas=$this->leerTodos($datos);\n return $tablas;\n }", "public static function ordenar($campo, $forma)\n\t{\n\t\t// A la variable global se le asigna la forma de ordenar para la consulta\n\t\tstatic::$consultaOrdenar = ' ORDER BY ' . $campo . ' ' . $forma;\n\n\t\t// Se devuelve el objeto\n\t\treturn new static;\n\t}", "public function disponibilidadAction(){ \n if (isset($_REQUEST['asd'])) {\n header('Location:disponibilidad?mes=Marzo&dia=11');\n } \n //Aca empieza lo generico\n $horarios = array(1=>'08:00 a 08:30',2=>'08:30 a 09:00',3=>'09:00 a 09:30',4=>'09:30 a 10:00',5=>'10:00 a 10:30',\n 6=>'10:30 a 11:00',7=>'11:00 a 11:30 ',8=>'11:30 a 12:00',9=>'12:00 a 12:30',10=>'12:30 a 13:00',11=>'13:00 a 13:30',\n 12=>'13:30 a 14:00',13=>'14:00 a 14:30',14=>'14:30 a 15:00',15=>'15:00 a 15:30',16=>'15:30 a 16:00',17=>'16:00 a 16:30',\n 18=>'16:30 a 17:00',19=>'17:00 a 17:30',20=>'17:30 a 18:00',21=>'18:00 a 18:30',22=>'18:30 a 19:00',23=>'19:00 a 19:30',\n 24=>'19:30 a 20:00',25=>'20:00 a 20:30',26=>'20:30 a 21:00',27=>'21:00 a 21:30',28=>'21:30 a 22:00',29=>'22:00 a 22:30',30=>'22:30 a 23:00');\n //Arreglar\n $arrayDeTranformacion = array('08:00 a 08:30'=>1,'08:30 a 09:00'=>2,'09:00 a 09:30'=>3,'09:30 a 10:00'=>4,'10:00 a 10:30'=>5,\n '10:30 a 11:00'=>6,'11:00 a 11:30'=>7,'11:30 a 12:00'=>8,'12:00 a 12:30'=>9,'12:30 a 13:00'=>10,'13:00 a 13:30'=>11,\n '13:30 a 14:00'=>12,'14:00 a 14:30'=>13,'14:30 a 15:00'=>14,'15:00 a 15:30'=>15,'15:30 a 16:00'=>16,'16:00 a 16:30'=>17,\n '16:30 a 17:00'=>18,'17:00 a 17:30'=>19,'17:30 a 18:00'=>20,'18:00 a 18:30'=>21,'18:30 a 19:00'=>22,'19:00 a 19:30'=>23,'19:30 a 20:00'=>24,\n '20:00 a 20:30'=>25,'20:30 a 21:00'=>26,'21:00 a 21:30'=>27,'21:30 a 22:00'=>28,'22:00 a 22:30'=>29,'22:30 a 23:00'=>30); \n $elmesEnNumero= array('Enero'=>1,'Febrero'=>2,'Marzo'=>3,'Abril'=>4,'Mayo'=>5,'Junio'=>6,'Julio'=>7,\n 'Agosto'=>8,'Septiembre'=>9,'Octubre'=>10,'Noviembre'=>11,'Diciembre'=>12);\n $meses = array(1=>'Enero',2=>'Febrero',3=>'Marzo',4=>'Abril',5=>'Mayo',6=>'Junio',7=>'Julio',\n 8=>'Agosto',9=>'Septiembre',10=>'Octubre',11=>'Noviembre',12=>'Diciembre');\n $AnioActual = date('Y');\n $dias = 1;\n $MesesDe30 = array();\n $MeseDe31 = array();\n $Febrero = array();\n while ($dias < 32){\n $MeseDe31[$dias] = $dias;\n $dias = $dias + 1;\n }\n $dias = 1;\n while ($dias < 31){\n $MesesDe30[$dias] = $dias;\n $dias = $dias + 1;\n }\n $dias = 1;\n if (($AnioActual % 4 == 0) && ($AnioActual % 100 != 0) || ($AnioActual % 400 == 0)){\n //es bisiesto \n while ($dias < 30){\n $Febrero[$dias] = $dias;\n $dias = $dias + 1;\n }\n }\n else{\n while ($dias < 29){\n $Febrero[$dias] = $dias;\n $dias = $dias + 1;\n }\n }\n $unArray = array('Enero' => $MeseDe31,'Febrero' => $Febrero,'Marzo' => $MeseDe31,'Abril' => $MesesDe30,\n 'Mayo' => $MeseDe31,'Junio' => $MesesDe30,'Julio' => $MeseDe31,'Agosto' => $MeseDe31,'Septiembre' => $MesesDe30,\n 'Octubre' => $MeseDe31,'Noviembre' => $MesesDe30,'Diciembre' => $MeseDe31);\n $em = $this->getDoctrine()->getManager();\n $mesActual = date('m');\n $diaActual =date('d');\n //Aca termina lo generico\n if ((empty($_GET[\"mes\"])) and (empty($_GET[\"dia\"]))){\n $query1 = $em->createQuery('SELECT a FROM CrestaAulasBundle:Aula a ORDER BY a.nombre ASC');\n $aulasMostrar = $query1->getResult();\n $pasar = date('Y-m-d');\n $query = $em->createQuery('SELECT r FROM CrestaAulasBundle:Reserva r WHERE r.fecha = :fechitaMostri')->setParameter('fechitaMostri', $pasar);\n $reservasMostrar = $query->getResult();\n $contador =0;\n foreach ($reservasMostrar as $aux) {\n $reservasMostrar[$contador]->getHoraDesde();\n //Busco los minutos para saber si es 30 o 00\n $minutoComparableDesde = $reservasMostrar[$contador]->getHoraDesde()->format('i');\n $horaComparableDesde = $reservasMostrar[$contador]->getHoraDesde()->format('H');\n $minutoComparableHasta = $reservasMostrar[$contador]->getHoraHasta()->format('i');\n $horaComparableHasta = $reservasMostrar[$contador]->getHoraHasta()->format('H');\n //Traigo la hora desde de las reservas.\n $hh = $reservasMostrar[$contador]->getHoraHasta()->format('H:i');\n $hd = $reservasMostrar[$contador]->getHoraDesde()->format('H:i');\n //si el min es 30 deberia concatenar con la hora siguente.\n if ( ($minutoComparableDesde == 30) and ($minutoComparableHasta == 00) ){\n //a la hora le sumo uno para llegar al valor.\n $horaComparableDesde = $horaComparableDesde + 1;\n //Esto pro si la hora es 08 por ejemplo increible, pero real\n if (strlen($horaComparableDesde) == 1){\n $horaComparableDesde ='0' . $horaComparableDesde ; \n } \n if (strlen($horaComparableHasta) == 1){\n $horaComparableHasta ='0' . $horaComparableHasta ; \n } \n //concateno todo para tener el valor exacto estilo \"12:30 a 13:00\"\n $hd = $hd . ' a ' . $horaComparableDesde . ':00';\n $hh = $hh . ' a ' . $horaComparableHasta . ':30';\n //Busco el aula de la reserva (nombre)\n $idBuscar = $reservasMostrar[$contador]->getAula();\n $aulaVar = $em->getRepository('CrestaAulasBundle:Aula')->find($idBuscar);\n $aulaNombre = $aulaVar->getNombre();\n $arrayCargadoConHorariosConcat = array (1=>$hd,2=>$hh,3=>$aulaNombre); \n }\n elseif (($minutoComparableDesde == 30) and ($minutoComparableHasta == 30)){\n //a la hora le sumo uno para llegar al valor.\n $horaComparableDesde = $horaComparableDesde + 1;\n $horaComparableHasta = $horaComparableHasta + 1;\n //Esto pro si la hora es 08 por ejemplo increible, pero real\n if (strlen($horaComparableDesde) == 1){\n $horaComparableDesde ='0' . $horaComparableDesde ; \n } \n if (strlen($horaComparableHasta) == 1){\n $horaComparableHasta ='0' . $horaComparableHasta ; \n } \n //concateno todo para tener el valor exacto estilo \"12:30 a 13:00\"\n $hd = $hd . ' a ' . $horaComparableDesde . ':00';\n $hh = $hh . ' a ' . $horaComparableHasta . ':00';\n $idBuscar = $reservasMostrar[$contador]->getAula();\n $aulaVar = $em->getRepository('CrestaAulasBundle:Aula')->find($idBuscar);\n $aulaNombre = $aulaVar->getNombre();\n $arrayCargadoConHorariosConcat = array (1=>$hd,2=>$hh,3=>$aulaNombre); \n }\n elseif (($minutoComparableDesde == 00) and ($minutoComparableHasta == 30)) {\n //a la hora le sumo uno para llegar al valor.\n $horaComparableHasta = $horaComparableHasta + 1;\n //Esto pro si la hora es 08 por ejemplo increible, pero real\n if (strlen($horaComparableDesde) == 1){\n $horaComparableDesde ='0' . $horaComparableDesde ; \n } \n if (strlen($horaComparableHasta) == 1){\n $horaComparableHasta ='0' . $horaComparableHasta ; \n } \n //concateno todo para tener el valor exacto estilo \"12:30 a 13:00\"\n $hd = $hd . ' a ' . $horaComparableDesde . ':30';\n $hh = $hh . ' a ' . $horaComparableHasta . ':00';\n $idBuscar = $reservasMostrar[$contador]->getAula();\n $aulaVar = $em->getRepository('CrestaAulasBundle:Aula')->find($idBuscar);\n $aulaNombre = $aulaVar->getNombre();\n $arrayCargadoConHorariosConcat = array (1=>$hd,2=>$hh,3=>$aulaNombre); \n }\n elseif (($minutoComparableDesde == 00) and ($minutoComparableHasta == 00)){\n //a la hora le sumo uno para llegar al valor.\n //Esto pro si la hora es 08 por ejemplo increible, pero real\n if (strlen($horaComparableDesde) == 1){\n $horaComparableDesde ='0' . $horaComparableDesde ; \n } \n if (strlen($horaComparableHasta) == 1){\n $horaComparableHasta ='0' . $horaComparableHasta ; \n } \n //concateno todo para tener el valor exacto estilo \"12:30 a 13:00\"\n $hd = $hd . ' a ' . $horaComparableDesde . ':30';\n $hh = $hh . ' a ' . $horaComparableHasta . ':30';\n $idBuscar = $reservasMostrar[$contador]->getAula();\n $aulaVar = $em->getRepository('CrestaAulasBundle:Aula')->find($idBuscar);\n $aulaNombre = $aulaVar->getNombre();\n $arrayCargadoConHorariosConcat = array (1=>$hd,2=>$hh,3=>$aulaNombre); \n }\n else{\n throw $this->createNotFoundException('Lo sentimos se rompieron las reservas :/ los horarios deberian ser en minutos 00 o 30.');\n }\n $ArrayContenedor[$contador] = array(1=>$arrayDeTranformacion[$arrayCargadoConHorariosConcat[1]],\n 2=>$arrayDeTranformacion[$arrayCargadoConHorariosConcat[2]],3=>$arrayCargadoConHorariosConcat[3],4=>$reservasMostrar[$contador]);\n $contador = $contador + 1;\n }\n if ((count($reservasMostrar)) == 0){\n $ArrayContenedor = null;\n }\n $mesSelect = array();\n $buscameEsto='Mes';\n \n //Arreglo de last moment, con los meses del 1 al 9, como lo tomamos de la fecha actual\n //lo toma como 01 al 09, y se rompe!!!\n\n \n $mesActual=intval($mesActual);\n $buscameEstoAhora = $meses[$mesActual];\n\n return $this->render('CrestaAulasBundle:Aula:disponibilidad.html.twig',array('mesSelect'=>$mesSelect,\n 'seleccionadoMes'=>$buscameEsto,'meses'=>$meses,'horarios'=>$horarios,'aulasMostrar'=>$aulasMostrar,'mesActual'=>$mesActual\n ,'diaActual'=>$diaActual,'seleccionadoMesAhora'=>$buscameEstoAhora,'ArrayContenedor'=>$ArrayContenedor,'seleccionadoDia' => 'Dia'));\n }\n elseif (((($_GET[\"mes\"] == 'Mes')) or (!isset($_GET[\"dia\"]))) and (isset ($_GET[\"aula\"]))){\n throw new Exception('Para filtrar el aula, primero completa el campo mes y dia para que podamos encontrar lo que estas buscando.');\n }\n elseif ((!empty($_GET[\"mes\"])) and (!empty($_GET[\"dia\"])) and (!empty($_GET[\"aula\"]))) {\n $seleccionadoDia = $_GET[\"dia\"];\n $buscameEsto= $_GET[\"mes\"];\n $asd = $elmesEnNumero[$buscameEsto];\n //tengo la id buscate el aula pedru\n $idDelAulaSeleccionada = $_GET[\"aula\"];\n \n $aulasMostrar[0] = $em->getRepository('CrestaAulasBundle:Aula')->find($idDelAulaSeleccionada); \n /* dios es cuate\n // $seleccionadoAula = $aulasMostrar->getNombre();\n echo \"<PRE>\";\n print_r($aulasMostrar);\n echo \"</PRE>\";*/\n $mesSelect = $unArray[$buscameEsto];\n //$aulasMostrar[]['nombre'] = $seleccionadoAula;\n $mesActual=intval($mesActual);\n $buscameEstoAhora = $meses[$mesActual];\n $pasar = $AnioActual . '-' . $asd . '-' . $seleccionadoDia;\n $parameters = array('fechitaMostri' => $pasar,'elaula' => $idDelAulaSeleccionada);\n $query = $em->createQuery(' SELECT r FROM CrestaAulasBundle:Reserva r \n WHERE r.fecha = :fechitaMostri and r.aula = :elaula')->setParameters($parameters);\n $reservasMostrar = $query->getResult();\n $contador =0;\n foreach ($reservasMostrar as $aux) {\n $reservasMostrar[$contador]->getHoraDesde();\n //Busco los minutos para saber si es 30 o 00\n $minutoComparableDesde = $reservasMostrar[$contador]->getHoraDesde()->format('i');\n $horaComparableDesde = $reservasMostrar[$contador]->getHoraDesde()->format('H');\n $minutoComparableHasta = $reservasMostrar[$contador]->getHoraHasta()->format('i');\n $horaComparableHasta = $reservasMostrar[$contador]->getHoraHasta()->format('H');\n //Traigo la hora desde de las reservas.\n $hh = $reservasMostrar[$contador]->getHoraHasta()->format('H:i');\n $hd = $reservasMostrar[$contador]->getHoraDesde()->format('H:i');\n //si el min es 30 deberia concatenar con la hora siguente.\n if ( ($minutoComparableDesde == 30) and ($minutoComparableHasta == 00) ){\n //a la hora le sumo uno para llegar al valor.\n $horaComparableDesde = $horaComparableDesde + 1;\n //Esto pro si la hora es 08 por ejemplo increible, pero real\n if (strlen($horaComparableDesde) == 1){\n $horaComparableDesde ='0' . $horaComparableDesde ; \n } \n if (strlen($horaComparableHasta) == 1){\n $horaComparableHasta ='0' . $horaComparableHasta ; \n } \n //concateno todo para tener el valor exacto estilo \"12:30 a 13:00\"\n $hd = $hd . ' a ' . $horaComparableDesde . ':00';\n $hh = $hh . ' a ' . $horaComparableHasta . ':30';\n //Busco el aula de la reserva (nombre)\n $idBuscar = $reservasMostrar[$contador]->getAula();\n $aulaVar = $em->getRepository('CrestaAulasBundle:Aula')->find($idBuscar);\n $aulaNombre = $aulaVar->getNombre();\n $arrayCargadoConHorariosConcat = array (1=>$hd,2=>$hh,3=>$aulaNombre); \n }\n elseif (($minutoComparableDesde == 30) and ($minutoComparableHasta == 30)){\n //a la hora le sumo uno para llegar al valor.\n $horaComparableDesde = $horaComparableDesde + 1;\n $horaComparableHasta = $horaComparableHasta + 1;\n //Esto pro si la hora es 08 por ejemplo increible, pero real\n if (strlen($horaComparableDesde) == 1){\n $horaComparableDesde ='0' . $horaComparableDesde ; \n } \n if (strlen($horaComparableHasta) == 1){\n $horaComparableHasta ='0' . $horaComparableHasta ; \n } \n //concateno todo para tener el valor exacto estilo \"12:30 a 13:00\"\n $hd = $hd . ' a ' . $horaComparableDesde . ':00';\n $hh = $hh . ' a ' . $horaComparableHasta . ':00';\n $idBuscar = $reservasMostrar[$contador]->getAula();\n $aulaVar = $em->getRepository('CrestaAulasBundle:Aula')->find($idBuscar);\n $aulaNombre = $aulaVar->getNombre();\n $arrayCargadoConHorariosConcat = array (1=>$hd,2=>$hh,3=>$aulaNombre); \n }\n elseif (($minutoComparableDesde == 00) and ($minutoComparableHasta == 30)) {\n //a la hora le sumo uno para llegar al valor.\n $horaComparableHasta = $horaComparableHasta + 1;\n //Esto pro si la hora es 08 por ejemplo increible, pero real\n if (strlen($horaComparableDesde) == 1){\n $horaComparableDesde ='0' . $horaComparableDesde ; \n } \n if (strlen($horaComparableHasta) == 1){\n $horaComparableHasta ='0' . $horaComparableHasta ; \n } \n //concateno todo para tener el valor exacto estilo \"12:30 a 13:00\"\n $hd = $hd . ' a ' . $horaComparableDesde . ':30';\n $hh = $hh . ' a ' . $horaComparableHasta . ':00';\n $idBuscar = $reservasMostrar[$contador]->getAula();\n $aulaVar = $em->getRepository('CrestaAulasBundle:Aula')->find($idBuscar);\n $aulaNombre = $aulaVar->getNombre();\n $arrayCargadoConHorariosConcat = array (1=>$hd,2=>$hh,3=>$aulaNombre); \n }\n elseif (($minutoComparableDesde == 00) and ($minutoComparableHasta == 00)){\n //a la hora le sumo uno para llegar al valor.\n //Esto pro si la hora es 08 por ejemplo increible, pero real\n if (strlen($horaComparableDesde) == 1){\n $horaComparableDesde ='0' . $horaComparableDesde ; \n } \n if (strlen($horaComparableHasta) == 1){\n $horaComparableHasta ='0' . $horaComparableHasta ; \n } \n //concateno todo para tener el valor exacto estilo \"12:30 a 13:00\"\n $hd = $hd . ' a ' . $horaComparableDesde . ':30';\n $hh = $hh . ' a ' . $horaComparableHasta . ':30';\n $idBuscar = $reservasMostrar[$contador]->getAula();\n $aulaVar = $em->getRepository('CrestaAulasBundle:Aula')->find($idBuscar);\n $aulaNombre = $aulaVar->getNombre();\n $arrayCargadoConHorariosConcat = array (1=>$hd,2=>$hh,3=>$aulaNombre); \n }\n else{\n throw $this->createNotFoundException('Lo sentimos se rompieron las reservas :/ los horarios deberian ser en minutos 00 o 30.');\n }\n $ArrayContenedor[$contador] = array(1=>$arrayDeTranformacion[$arrayCargadoConHorariosConcat[1]],\n 2=>$arrayDeTranformacion[$arrayCargadoConHorariosConcat[2]],3=>$arrayCargadoConHorariosConcat[3],4=>$reservasMostrar[$contador]);\n $contador = $contador + 1;\n }\n if ((count($reservasMostrar)) == 0){\n $ArrayContenedor = null;\n }\n return $this->render('CrestaAulasBundle:Aula:disponibilidad.html.twig',array('mesSelect'=>$mesSelect,\n 'seleccionadoMes'=>$buscameEsto,'mesActual'=>$mesActual,'meses'=>$meses,'horarios'=>$horarios,'aulasMostrar'=>$aulasMostrar,\n 'diaActual'=>$diaActual,'asd'=>$asd,'seleccionadoMesAhora'=>$buscameEstoAhora,\n 'ArrayContenedor'=>$ArrayContenedor,'seleccionadoDia' =>$seleccionadoDia));\n }\n else{\n $query1 = $em->createQuery('SELECT a FROM CrestaAulasBundle:Aula a ORDER BY a.nombre ASC');\n $aulasMostrar = $query1->getResult();\n $seleccionadoDia = $_GET[\"dia\"];\n $buscameEsto= $_GET[\"mes\"];\n $asd= $elmesEnNumero[$buscameEsto];\n $pasar = $AnioActual . '-' . $asd . '-' . $seleccionadoDia;\n $query = $em->createQuery('SELECT r FROM CrestaAulasBundle:Reserva r WHERE r.fecha = :fechitaMostri')->setParameter('fechitaMostri', $pasar);\n $reservasMostrar = $query->getResult();\n $contador = 0;\n \n foreach ($reservasMostrar as $aux) {\n $reservasMostrar[$contador]->getHoraDesde();\n //Busco los minutos para saber si es 30 o 00\n $minutoComparableDesde = $reservasMostrar[$contador]->getHoraDesde()->format('i');\n $horaComparableDesde = $reservasMostrar[$contador]->getHoraDesde()->format('H');\n $minutoComparableHasta = $reservasMostrar[$contador]->getHoraHasta()->format('i');\n $horaComparableHasta = $reservasMostrar[$contador]->getHoraHasta()->format('H');\n //Traigo la hora desde de las reservas.\n $hh = $reservasMostrar[$contador]->getHoraHasta()->format('H:i');\n $hd = $reservasMostrar[$contador]->getHoraDesde()->format('H:i');\n //si el min es 30 deberia concatenar con la hora siguente.\n if ( ($minutoComparableDesde == 30) and ($minutoComparableHasta == 00) ){\n //a la hora le sumo uno para llegar al valor.\n $horaComparableDesde = $horaComparableDesde + 1;\n //Esto pro si la hora es 08 por ejemplo increible, pero real\n if (strlen($horaComparableDesde) == 1){\n $horaComparableDesde ='0' . $horaComparableDesde ; \n } \n if (strlen($horaComparableHasta) == 1){\n $horaComparableHasta ='0' . $horaComparableHasta ; \n } \n //concateno todo para tener el valor exacto estilo \"12:30 a 13:00\"\n $hd = $hd . ' a ' . $horaComparableDesde . ':00';\n $hh = $hh . ' a ' . $horaComparableHasta . ':30';\n //Busco el aula de la reserva (nombre)\n $idBuscar = $reservasMostrar[$contador]->getAula();\n $aulaVar = $em->getRepository('CrestaAulasBundle:Aula')->find($idBuscar);\n $aulaNombre = $aulaVar->getNombre();\n $arrayCargadoConHorariosConcat = array (1=>$hd,2=>$hh,3=>$aulaNombre); \n }\n elseif (($minutoComparableDesde == 30) and ($minutoComparableHasta == 30)){\n //a la hora le sumo uno para llegar al valor.\n $horaComparableDesde = $horaComparableDesde + 1;\n $horaComparableHasta = $horaComparableHasta + 1;\n //Esto pro si la hora es 08 por ejemplo increible, pero real\n if (strlen($horaComparableDesde) == 1){\n $horaComparableDesde ='0' . $horaComparableDesde ; \n } \n if (strlen($horaComparableHasta) == 1){\n $horaComparableHasta ='0' . $horaComparableHasta ; \n } \n //concateno todo para tener el valor exacto estilo \"12:30 a 13:00\"\n $hd = $hd . ' a ' . $horaComparableDesde . ':00';\n $hh = $hh . ' a ' . $horaComparableHasta . ':00';\n $idBuscar = $reservasMostrar[$contador]->getAula();\n $aulaVar = $em->getRepository('CrestaAulasBundle:Aula')->find($idBuscar);\n $aulaNombre = $aulaVar->getNombre();\n $arrayCargadoConHorariosConcat = array (1=>$hd,2=>$hh,3=>$aulaNombre); \n }\n elseif (($minutoComparableDesde == 00) and ($minutoComparableHasta == 30)) {\n //a la hora le sumo uno para llegar al valor.\n $horaComparableHasta = $horaComparableHasta + 1;\n //Esto pro si la hora es 08 por ejemplo increible, pero real\n if (strlen($horaComparableDesde) == 1){\n $horaComparableDesde ='0' . $horaComparableDesde ; \n } \n if (strlen($horaComparableHasta) == 1){\n $horaComparableHasta ='0' . $horaComparableHasta ; \n } \n //concateno todo para tener el valor exacto estilo \"12:30 a 13:00\"\n $hd = $hd . ' a ' . $horaComparableDesde . ':30';\n $hh = $hh . ' a ' . $horaComparableHasta . ':00';\n $idBuscar = $reservasMostrar[$contador]->getAula();\n $aulaVar = $em->getRepository('CrestaAulasBundle:Aula')->find($idBuscar);\n $aulaNombre = $aulaVar->getNombre();\n $arrayCargadoConHorariosConcat = array (1=>$hd,2=>$hh,3=>$aulaNombre); \n }\n elseif (($minutoComparableDesde == 00) and ($minutoComparableHasta == 00)){\n //a la hora le sumo uno para llegar al valor.\n //Esto pro si la hora es 08 por ejemplo increible, pero real\n if (strlen($horaComparableDesde) == 1){\n $horaComparableDesde ='0' . $horaComparableDesde ; \n } \n if (strlen($horaComparableHasta) == 1){\n $horaComparableHasta ='0' . $horaComparableHasta ; \n } \n //concateno todo para tener el valor exacto estilo \"12:30 a 13:00\"\n $hd = $hd . ' a ' . $horaComparableDesde . ':30';\n $hh = $hh . ' a ' . $horaComparableHasta . ':30';\n $idBuscar = $reservasMostrar[$contador]->getAula();\n $aulaVar = $em->getRepository('CrestaAulasBundle:Aula')->find($idBuscar);\n $aulaNombre = $aulaVar->getNombre();\n $arrayCargadoConHorariosConcat = array (1=>$hd,2=>$hh,3=>$aulaNombre); \n }\n else{\n throw $this->createNotFoundException('Lo sentimos se rompieron las reservas :/ los horarios deberian ser en minutos 00 o 30.');\n }\n $ArrayContenedor[$contador] = array(1=>$arrayDeTranformacion[$arrayCargadoConHorariosConcat[1]],\n 2=>$arrayDeTranformacion[$arrayCargadoConHorariosConcat[2]],3=>$arrayCargadoConHorariosConcat[3],4=>$reservasMostrar[$contador]);\n $contador = $contador + 1;\n }\n if ((count($reservasMostrar)) == 0){\n $ArrayContenedor = null;\n }\n \n \n $diaActual =date('d'); \n $mesSelect = $unArray[$buscameEsto];\n $asd= $elmesEnNumero[$buscameEsto];\n $buscameEstoAhora = $buscameEsto; \n $mesActual = date('m');\n return $this->render('CrestaAulasBundle:Aula:disponibilidad.html.twig',array('mesSelect'=>$mesSelect,\n 'seleccionadoMes'=>$buscameEsto,'mesActual'=>$mesActual,'meses'=>$meses,'horarios'=>$horarios,'aulasMostrar'=>$aulasMostrar,\n 'diaActual'=>$diaActual,'asd'=>$asd,'seleccionadoMesAhora'=>$buscameEstoAhora,\n 'ArrayContenedor'=>$ArrayContenedor,'seleccionadoDia' =>$seleccionadoDia));\n //Por el neg de la gente\n }\n }", "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 objetivos_mes(){\r\n \r\n $data['sistema'] = $this->sistema;\r\n \r\n $dia = $this->input->post(\"dia\"); \r\n $mes = $this->input->post(\"mes\"); \r\n $anio = $this->input->post(\"anio\");\r\n \r\n $fecha = date(\"Y-m-d H:i:s\", strtotime($anio.\"-\".$mes.\"-\".$dia));\r\n\r\n $primer_dia = 1;\r\n $ultimo_dia = $this->getUltimoDiaMes($anio,$mes);\r\n \r\n //$fecha_inicial = date(\"Y-m-d H:i:s\", strtotime($anio.\"-\".$mes.\"-\".$primer_dia) );\r\n //$fecha_final = date(\"Y-m-d H:i:s\", strtotime($anio.\"-\".$mes.\"-\".$ultimo_dia) );\r\n \r\n $fecha_inicial = $anio.\"-\".$mes.\"-01\";\r\n //$fecha_final = $anio.\"-\".$mes.\"-31\";\r\n $fecha_final = $anio.\"-\".$mes.\"-\".$ultimo_dia;\r\n // --------------------------------------------------------------------------------------------\r\n $sql_objetivos = \"SELECT u.usuario_nombre, u.`usuario_imagen`, aux.`tipousuario_descripcion`, e.`estado_color`, e.estado_descripcion, o.*\r\n FROM `objetivo` AS o\r\n LEFT JOIN usuario AS u ON o.usuario_id = u.`usuario_id`\r\n LEFT JOIN estado AS e ON o.`estado_id` = e.estado_id\r\n LEFT JOIN (\r\n SELECT u.`usuario_id`, t.tipousuario_descripcion \r\n FROM usuario AS u, tipo_usuario AS t\r\n WHERE u.`tipousuario_id` = t.`tipousuario_id`\r\n ) AS aux ON o.`usuario_id` = aux.usuario_id\r\n WHERE o.`usuario_id` = u.usuario_id\";\r\n //echo $sql_objetivos;\r\n $objetivos = $this->db->query($sql_objetivos)->result_array();\r\n // --------------------------------------------------------------------------------------------\r\n $sql_ventas_mes = \"SELECT if(sum(d.detalleven_total)>0, round(sum(d.detalleven_total),2), 0) AS total_mes, u.usuario_id\r\n FROM usuario AS u\r\n LEFT JOIN objetivo AS o ON o.usuario_id = u.usuario_id\r\n LEFT JOIN estado AS e ON u.`estado_id` = e.`estado_id`\r\n LEFT JOIN tipo_usuario AS t ON t.`tipousuario_id` = u.`tipousuario_id`\r\n left join detalle_venta as d on d.`usuario_id` = u.`usuario_id`\r\n left join venta as v on v.`usuario_id`=o.usuario_id\r\n WHERE o.usuario_id = u.usuario_id AND\r\n v.venta_id = d.venta_id AND \r\n v.venta_fecha >= '\".$fecha_inicial.\"' AND \r\n v.venta_fecha <= '\".$fecha_final.\"' AND \r\n v.usuario_id = u.usuario_id\r\n GROUP BY u.usuario_nombre \r\n order by u.usuario_nombre\r\n \";\r\n/* $sql_ventas_mes = \"SELECT if(sum(d.detalleven_total) > 0, round(sum(d.detalleven_total), 2), 0) AS total_mes, u.usuario_id\r\n FROM\r\n usuario u, detalle_venta d, venta v\r\n\r\n WHERE\r\n v.venta_id = d.venta_id AND \r\n v.venta_fecha >= '\".$fecha_inicial.\"' AND \r\n v.venta_fecha <= '\".$fecha_final.\"' AND \r\n v.usuario_id = u.usuario_id\r\n GROUP BY\r\n u.usuario_id\r\n ORDER BY\r\n u.usuario_nombre\";\r\n*/ \r\n //echo $sql_ventas_mes;\r\n $ventas_mes = $this->db->query($sql_ventas_mes)->result_array();\r\n // --------------------------------------------------------------------------------------------\r\n $sql_ventas_dia = \"SELECT if(sum(d.detalleven_total)>0, round(sum(d.detalleven_total),2), 0) AS total_dia, u.usuario_id\r\n FROM usuario AS u\r\n LEFT JOIN objetivo AS o ON o.usuario_id = u.usuario_id\r\n LEFT JOIN estado AS e ON u.`estado_id` = e.`estado_id`\r\n LEFT JOIN tipo_usuario AS t ON t.`tipousuario_id` = u.`tipousuario_id`\r\n left join detalle_venta as d on d.`usuario_id` = u.`usuario_id`\r\n left join venta as v on v.`usuario_id`=o.usuario_id\r\n WHERE o.usuario_id = u.usuario_id AND\r\n v.venta_id = d.venta_id AND \r\n v.venta_fecha = '\".$fecha.\"' AND \r\n v.usuario_id = u.usuario_id\r\n GROUP BY u.usuario_nombre \r\n order by u.usuario_nombre\r\n \";\r\n/* $sql_ventas_dia = \"SELECT \r\n if(sum(d.detalleven_total) > 0, round(sum(d.detalleven_total), 2), 0) AS total_dia,\r\n u.usuario_id\r\n FROM\r\n usuario u, venta v, detalle_venta d\r\n WHERE\r\n v.venta_fecha = '\".$fecha.\"' and\r\n v.venta_id = d.venta_id and\r\n v.usuario_id = u.usuario_id\r\n GROUP BY\r\n u.usuario_id\r\n ORDER BY\r\n u.usuario_nombre\";*/\r\n \r\n //echo $sql_ventas_dia;\r\n $ventas_dia = $this->db->query($sql_ventas_dia)->result_array();\r\n // // --------------------------------------------------------------------------------------------\r\n $sql_pedidos_mes = \"SELECT if(count(p.`pedido_total`)>0, COUNT(p.`pedido_total`),0) as pedido_mes, u.usuario_id\r\n FROM pedido as p\r\n LEFT JOIN venta as v on p.pedido_id = v.`pedido_id`\r\n LEFT JOIN usuario as u on p.`usuario_id` = u.usuario_id\r\n left join objetivo as o on p.`usuario_id` = o.`usuario_id`\r\n where v.`entrega_id` = 2\r\n and p.`pedido_fecha` >= '\".$fecha_inicial.\"'\r\n and p.pedido_fecha <= '\".$fecha_final.\"'\r\n and p.`regusuario_id` = o.usuario_id\r\n group by u.usuario_nombre\r\n ORDER by u.usuario_nombre\";\r\n \r\n \r\n/* $sql_pedidos_mes = \"SELECT \r\n if(count(p.pedido_total) > 0, COUNT(p.pedido_total), 0) AS pedido_mes, u.usuario_id\r\n\r\n FROM\r\n pedido p, venta v, detalle_venta d, usuario u\r\n\r\n WHERE\r\n v.entrega_id = 2 AND \r\n p.pedido_fecha >= '\".$fecha_inicial.\"' AND \r\n p.pedido_fecha <= '\".$fecha_final.\"' AND \r\n p.pedido_id = v.pedido_id and\r\n d.venta_id = v.venta_id and\r\n u.usuario_id = v.usuario_id\r\n\r\n GROUP BY\r\n\r\n u.usuario_id\r\n\r\n ORDER BY\r\n\r\n u.usuario_nombre\";*/\r\n //echo $sql_pedidos_mes;\r\n \r\n $pedidos_mes = $this->db->query($sql_pedidos_mes)->result_array();\r\n // // --------------------------------------------------------------------------------------------\r\n $sql_pedidos_dia = \"SELECT IF(COUNT(p.`pedido_id`)>0, COUNT(p.`pedido_id`),0) as pedido_dia, u.usuario_id\r\n FROM pedido AS p\r\n LEFT JOIN venta as v on p.pedido_id = v.`pedido_id`\r\n LEFT JOIN usuario AS u ON p.`usuario_id` = u.usuario_id\r\n LEFT JOIN objetivo AS o ON p.`usuario_id` = o.`usuario_id`\r\n WHERE date(p.`pedido_fecha`) = '\".$fecha.\"'\r\n AND p.`regusuario_id` = o.usuario_id\r\n GROUP BY u.usuario_nombre\r\n ORDER BY u.usuario_nombre\r\n \";\r\n //echo $sql_pedidos_dia;\r\n \r\n $pedidos_dia = $this->db->query($sql_pedidos_dia)->result_array();\r\n \r\n $data = array(\r\n \"objetivos\" => $objetivos,\r\n \"ventas_dia\" => $ventas_dia,\r\n \"ventas_mes\" => $ventas_mes,\r\n \"pedidos_dia\" => $pedidos_dia,\r\n \"pedidos_mes\" => $pedidos_mes\r\n );\r\n echo json_encode($data);\r\n }", "public function getRnovedades($id,$fechaI,$fechaF)\n { \n $result=$this->adapter->query(\"select a.id, a.idEmp, 0 as dias, c.horas, c.devengado as dev, c.deducido as ded, i.formula, \ng.tipo, h.idCcos, c.idConc as idCon, i.id as idFor, c.calc \nfrom n_nomina_e a inner join n_nomina b on b.id=a.idNom\ninner join n_novedades c on c.idEmp=a.idEmp\nleft join n_tip_matriz_tnv d on d.id=c.idTmatz\nleft join n_tip_matriz e on e.id=d.idTmatz and e.idTnom=b.idTnom \ninner join n_conceptos g on g.id=c.idConc \ninner join a_empleados h on h.id=a.idEmp \ninner join n_formulas i on i.id=g.idFor \ninner join n_tip_calendario_d j on j.id=c.idCal \nwhere c.estado=0 and j.fechaI>='\".$fechaI.\"' \"\n . \"and j.fechaF<='\".$fechaF.\"' and b.id =\".$id.\" order by g.ordenN desc # Colocar de primero los de gran prioridad por logeneral sin formulas \",Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }", "public function datosNomina(Request $request)\n\t{\n\t\t$semana = $request->input(\"semana\");\n\t\t$year = $request->input(\"year\"); //en ingles para no sonar obsceno\n\n\t\t//Obtener la fecha en la que inicia y termina la semana seleccionada\n\t\t$fecha1 = new DateTime();\n\t\t$fecha1->setISODate($year,$semana,1);\n\t\t$fecha1 = $fecha1->format('Y-m-d');\n\n\t\t$fecha2 = new DateTime();\n\t\t$fecha2->setISODate($year,$semana,7);\n\t\t$fecha2 = $fecha2->format('Y-m-d');\n\n\t\t//declarar el query en formato SQL para cada uno de los parametros, como un string\n\t\t//el string siguiente seria \"fecha BETWEEN CAST('{fecha1}' AS DATE) AND CAST('{fecha2}' AS DATE)\"\n\t\t$queryFechas = \"fecha BETWEEN CAST('\" . $fecha1 . \"' AS DATE) AND CAST('\" . $fecha2 . \"' AS DATE)\";\n\n\t\t$checadas = Checada::whereRaw($queryFechas)->get();\n\t\t$empleados = Empleado::where('contratable',true)->get();\n\t\t$clientes = Cliente::all();\n\t\t$turnos = Turno::all();\n\t\t$comedores = Comedor::where('semana',$semana)->get();\n\t\t$descuentos = Descuento::where('semana',$semana)->get();\n\t\t$reembolsos = Reembolso::where('semana',$semana)->get();\n\t\t$tipo_descuento = TipoDescuento::all();\n \n// $checadas = array();\n// foreach(Checada::whereRaw($queryFechas)->paginate(10) as $checada){\n// $empleado = Empleado::find($checada->idEmpleado);\n// $cliente = Cliente::find($checada->idCliente);\n// $turno = Turno::find($checada->idTurno);\n// $comedores = Comedor::where('fecha',$checada->fecha)->where('idEmpleado',$checada->idEmpleado)->get();\n// $descuentos = Descuento::where('fecha',$checada->fecha)->where('empleado',$checada->idEmpleado)->get();\n// $reembolsos = Reembolso::where('fecha',$checada->fecha)->where('empleado',$checada->idEmpleado)->get();\n// $ch = [\n// 'fecha' => $checada->fecha,\n// 'idEmpleado' => $checada->idEmpleado,\n// 'ap_paterno' => $empleado->ap_paterno,\n// 'ap_materno' => $empleado->ap_materno,\n// 'nombres' => $empleado->nombres,\n// 'no_cuenta' => $empleado->no_cuenta,\n// 'cliente' => $cliente->nombre,\n// 'horas_ordinarias' => $checada->horas_ordinarias,\n// 'horas_extra' =>$checada->horas_extra,\n// ];\n// array_push($checadas,$checada);\n// }\n\n\t\treturn view('nomina/resultados')->with('checadas',$checadas)->with('empleados',$empleados)->with('clientes',$clientes)->with('turnos',$turnos)->with('comedores',$comedores)->with('descuentos',$descuentos)->with('reembolsos',$reembolsos)->with('tipo_descuentos',$tipo_descuento)->with('fecha1',$fecha1)->with('fecha2',$fecha2)->with('semana',$semana);\n\t}", "function depurar_horarios ($horarios, $aula){\n $horarios_disponibles=array();\n $indice=0;\n $longitud=count($horarios);\n $indice_horario=0;\n //guarda un horario disponible con el formato (hora_inicio, hora_fin, aula)\n $horario=array();\n $hora_fin=\"\";\n while($indice_horario < $longitud){\n if($horarios[$indice_horario][1]){\n \n $hora_inicio=$horarios[$indice_horario][0];\n $horario['hora_inicio']=$hora_inicio;\n\n //aca no hay que acumular el retorno\n $indice_horario = $this->obtener_horario($indice_horario, $horarios, &$hora_fin);\n $horario['hora_fin']=$hora_fin;\n $horario['aula']=$aula['aula'];\n $horario['id_aula']=$aula['id_aula'];\n $horarios_disponibles[$indice]=$horario;\n //los eltos se agregan al final del arreglo\n $this->s__horarios_disponibles[]=$horario;\n $indice += 1;\n }\n else{\n $indice_horario += 1;\n }\n }\n return $horarios_disponibles;\n }", "public function ctlBuscaNumOpEntradas($fecha){\n\t\t$busca = $fecha.'%';\n\n\t\t$respuesta = Datos::mdlNumOperaciones('entradas', $busca);\n\n\t\t$next = $respuesta['cuenta']+1;\n\t\techo $fecha,\"-\",$next;\n\t\t//echo '$fecha-$next';\n\t}", "public function listar($inicio = 0, $cantidad = 0, $excepcion = NULL, $condicion = NULL, $idCurso = NULL) {\n global $sql, $configuracion;\n\n /* * * Validar la fila inicial de la consulta ** */\n if (!is_int($inicio) || $inicio < 0) {\n $inicio = 0;\n }\n\n /* * * Validar la cantidad de registros requeridos en la consulta ** */\n if (!is_int($cantidad) || $cantidad <= 0) {\n $cantidad = 0;\n }\n\n /* * * Validar que la condición sea una cadena de texto ** */\n if (!is_string($condicion)) {\n $condicion = '';\n }\n\n /* * * Validar que la excepción sea un arreglo y contenga elementos ** */\n if (isset($excepcion) && is_array($excepcion) && count($excepcion)) {\n $excepcion = implode(',', $excepcion);\n $condicion .= 'ac.id NOT IN (' . $excepcion . ') AND ';\n }\n\n /* * * Definir el orden de presentación de los datos ** */\n if ($this->listaAscendente) {\n $orden = 'ac.fecha_publicacion ASC';\n } else {\n $orden = 'ac.fecha_publicacion DESC';\n }\n\n $tablas = array(\n 'ac' => 'actividades_curso'\n );\n\n $columnas = array(\n 'id' => 'ac.id',\n 'idCurso' => 'ac.id_curso',\n 'idUsuario' => 'ac.id_usuario',\n 'titulo' => 'ac.titulo',\n 'descripcion' => 'ac.descripcion',\n 'fechaPublicacion' => 'UNIX_TIMESTAMP(ac.fecha_publicacion)',\n 'fechaLimite' => 'UNIX_TIMESTAMP(ac.fecha_limite)',\n 'diasRestantes' => 'DATEDIFF(ac.fecha_limite, NOW())'\n );\n\n $condicion .= 'ac.id_curso = \"'.$idCurso.'\"';\n\n if (is_null($this->registros)) {\n $sql->seleccionar($tablas, $columnas, $condicion);\n $this->registros = $sql->filasDevueltas;\n }\n\n $consulta = $sql->seleccionar($tablas, $columnas, $condicion, '', $orden, $inicio, $cantidad);\n\n $lista = array();\n if ($sql->filasDevueltas) {\n\n while ($actividad = $sql->filaEnObjeto($consulta)) {\n $actividad->icono = $configuracion['SERVIDOR']['media'] . $configuracion['RUTAS']['imagenesEstilos'] . 'activity.png';\n $lista[] = $actividad;\n }\n }\n\n return $lista;\n }", "public static function getMuestrasOrden($id_orden, $id_muestra)\n {\n // Consulta de la meta\n $consulta = \"SELECT * FROM ordenes_muestras WHERE ((id_orden= ?) AND (num_muestra = ?)) ORDER BY num_muestra\";\n\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute(array($id_orden, $id_muestra));\n // Capturar primera fila del resultado\n $row = $comando->fetch(PDO::FETCH_ASSOC);\n return $row;\n\n\n\n } catch (PDOException $e) {\n // Aquí puedes clasificar el error dependiendo de la excepción\n // para presentarlo en la respuesta Json\n return -1;\n }\n }", "public function ultimosPedidos(){\n //$conexao = $c->conexao();\n\n\n $sql = \"SELECT a.*, c.nome,date_format(data_inc, '%H:%i') AS hora FROM tbpedidos a,tbclientes c where c.reg = a.reg and a.status = 'A' order by a.idpedido desc;\";\n $sql = $this->conexao->query($sql);\n\n $dados = array();\n\n while ($row = $sql->fetch_assoc()) {\n \n $dado = array();\n\n $dado['idpedido'] = $row[\"idpedido\"];\n $dado['reg'] = $row[\"reg\"];\n $dado['tipo'] = $row[\"tipo\"];\n $dado['nome'] = $row[\"nome\"];\n $dado['status'] = $row[\"status\"];\n $dado['titulo'] = $row[\"titulo\"];\n $dado['hora'] = $row[\"hora\"];\n $dado['valor'] = number_format($row[\"valor\"], 2, \",\", \".\");\n $dados[] = $dado;\n\n }\n\n return $dados;\n\n }", "public function listarEventoDocente() {\n $login = $_SESSION['login'];\n $busca = array();\n $cont = 0;\n try {\n parent::setCampos('idEvento, idSala');\n parent::setTabela('evento');\n parent::setValorPesquisa('idDocente = (:idDocente) ORDER BY idEvento DESC');\n $selecionaMaisCampos0 = parent::selecionaMaisCampos();\n $selecionaMaisCampos0 ->bindParam(':idDocente', $login->idUser, PDO::PARAM_INT);\n $selecionaMaisCampos0 ->execute();\n\n parent::setTabela('utilizador, evento, sala');\n parent::setValorPesquisa('utilizador.idUser=(:idUser) AND evento.idSala=(:idSala) AND sala.idSala =(:idSala) ORDER BY idEvento DESC');\n $selecionaTudo_ComCondicao = parent::selecionaTudo_ComCondicao();\n\n while ($item = $selecionaMaisCampos0 ->fetch(PDO::FETCH_OBJ)) {\n\n $selecionaTudo_ComCondicao->bindParam(':idUser', $login->idUser, PDO::PARAM_INT);\n $selecionaTudo_ComCondicao->bindParam(':idSala', $item->idSala, PDO::PARAM_INT);\n $selecionaTudo_ComCondicao->bindParam(':idSala', $item->idSala, PDO::PARAM_INT);\n $selecionaTudo_ComCondicao->execute();\n\n $cont +=1;\n $busca[$cont] = $selecionaTudo_ComCondicao->fetch(PDO::FETCH_OBJ);\n\n }\n\n $selecionaTudo_ComCondicao = NULL;\n $selecionaMaisCampos0 = NULL;\n } catch (Exception $exc) {\n\n return $exc->getMessage();\n }\n\n return $busca;\n }", "function selectConciertosEspera(){\n $c = conectar();\n $select = \"select CONCIERTO.FECHA as FECHA, CONCIERTO.HORA as HORA, LOCALES.UBICACION as UBICACION, GENERO.NOMBRE as GENERO, USUARIOS.NOMBRE as NOMBRE, CIUDAD.NOMBRE as CIUDAD, CONCIERTO.ID_CONCIERTO as ID from CONCIERTO \n inner join LOCALES on CONCIERTO.ID_LOCAL = LOCALES.ID_LOCAL\n inner join USUARIOS on LOCALES.ID_USUARIO = USUARIOS.ID_USUARIO\n inner join CIUDAD on USUARIOS.ID_CIUDAD = CIUDAD.ID_CIUDAD\n inner join GENERO on CONCIERTO.ID_GENERO = GENERO.ID_GENERO where CONCIERTO.ESTADO=0 order by CONCIERTO.FECHA,CONCIERTO.HORA\";\n $resultado = mysqli_query($c, $select);\n desconectar($c);\n return $resultado;\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 CreditosPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT clientes.codcliente, clientes.cedcliente, clientes.nomcliente, clientes.tlfcliente, clientes.direccliente, clientes.emailcliente, ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.totalpago2, ventas.tipopagove, ventas.formapagove, ventas.fechaventa, ventas.fechavencecredito, ventas.statusventa, usuarios.nombres, cajas.nrocaja, abonoscreditos.codventa as cod, abonoscreditos.fechaabono, SUM(montoabono) AS abonototal FROM (ventas LEFT JOIN clientes ON clientes.codcliente = ventas.codcliente) LEFT JOIN abonoscreditos ON ventas.codventa = abonoscreditos.codventa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN usuarios ON ventas.codigo = usuarios.codigo WHERE ventas.codventa =? GROUP BY cod\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function listarDeportestodo(){\n $sql = \"SELECT `Sport`.`id` as iddeporte, `Sport`.`nombre` FROM `sporte`.`coaches` AS `Coach` LEFT JOIN `sporte`.`users` AS `User` ON (`Coach`.`user_id` = `User`.`id`) LEFT JOIN `sporte`.`ligas` AS `Liga` ON (`Coach`.`liga_id` = `Liga`.`id`) LEFT JOIN `sporte`.`sports` AS `Sport` ON (`Liga`.`sport_id` = `Sport`.`id`) WHERE 1=1\";\n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute(); \n return $sentencia->fetchAll(PDO::FETCH_OBJ);\n }", "function contratos_por_estado($id_estado){\n $sql =\n \"SELECT\n c.Numero,\n c.Objeto,\n c.Lugar,\n c.Valor_Inicial,\n c.Acta_Inicio,\n c.Fecha_Acta_Inicio,\n c.Plazo,\n c.Fecha_Vencimiento,\n c.Fecha_Inicial,\n t.Nombre AS Contratista,\n e.Estado \n FROM\n contratos AS c\n INNER JOIN tbl_terceros AS t ON c.Fk_Id_Terceros = t.Pk_Id_Terceros\n INNER JOIN tbl_estados AS e ON c.Fk_Id_Estado = e.Pk_Id_Estado \n WHERE\n c.Fk_Id_Estado = $id_estado \n AND c.Fk_Id_Proyecto = {$this->session->userdata('Fk_Id_Proyecto')} \n ORDER BY\n c.Numero ASC\";\n \n //Se retorna la consulta\n return $this->db->query($sql)->result();\n }", "public function ctlBuscaNumOpSalidas($fecha){\n\t\t$busca = $fecha.'%';\n\n\t\t$respuesta = Datos::mdlNumOperaciones('salidas', $busca);\n\n\t\t$next = $respuesta['cuenta']+1;\n\t\techo $fecha,\"-\",$next;\n\t\t//echo '$fecha-$next';\n\t}", "function RellenarDesarrolloReunion()\r\n {\r\n $i = 1;\r\n\r\n foreach ($this->eventos as $evento)\r\n {\r\n if (Doctrine_Core::getTable('SAF_EVENTO_CONVOCATORIA')->getEventoConvocatoria($evento, $this->convocatoria)->getStatus() == 'analizado')\r\n {\r\n $this->AddPage();\r\n\r\n if ($i == 1)\r\n {\r\n $i++;\r\n $this->Imprimir('DESARROLLO DE LA REUNIÓN', 10, 12, 18);\r\n }\r\n\r\n $this->RellenarDescripcionDelEvento($evento);\r\n\r\n $this->RellenarFotosDelEvento($evento);\r\n\r\n $this->RellenarRazonesDelEvento($evento);\r\n\r\n $varios = Doctrine_Core::getTable('SAF_VARIO')->findByIdEvento($evento->getID());\r\n\r\n $this->RellenarBitacoraDelEvento($varios);\r\n\r\n $this->RellenarAccionesYRecomendacionesDelEvento($varios);\r\n\r\n $this->RellenarCompromisosDelEvento($varios);\r\n }\r\n }\r\n }", "public function SelecionaTudo() {\n try {\n //Monta a Query\n $query = Doctrine_Query::create()\n ->select(\"ws.*, MONTHNAME(ws.data) mes, YEAR(ws.data) ano\")\n ->from($this->table_alias)\n ->orderBy(\"ws.data DESC\")\n ->offset(1)\n ->limit(6)\n ->execute()\n ->toArray();\n\n return $query;\n } catch (Doctrine_Exception $e) {\n echo $e->getMessage();\n }\n }", "public function consulta_asistencia()\n {\n $fecha_reporte = cambiaf_a_mysql($this->txt_fecha_desde->Text);\n $dir = $this->drop_direcciones->SelectedValue;\n $cod_organizacion = usuario_actual('cod_organizacion');\n\n // se obtienen las justificaciones del día seleccionado\n $sql=\"SELECT (p.cedula) as cedula_just, p.nombres, p.apellidos, j.codigo, jd.fecha_desde, jd.hora_desde,\n jd.fecha_hasta, jd.hora_hasta, jd.observaciones, jd.lun, jd.mar, jd.mie, jd.jue, jd.vie,\n tf.descripcion as descripcion_falta, tj.descripcion as descripcion_tipo_justificacion\n\t\t\t\t\t FROM asistencias.justificaciones as j, asistencias.justificaciones_dias as jd,\n\t\t\t\t\t\t asistencias.justificaciones_personas as jp, organizacion.personas as p, organizacion.personas_nivel_dir as n, asistencias.tipo_faltas tf, asistencias.tipo_justificaciones tj\n\t\t\t\t\t\tWHERE ((p.cedula = jp.cedula) and\n\t\t\t\t\t\t (p.cedula = n.cedula) and (jd.codigo_tipo_falta = tf.codigo) and (tj.id = jd.codigo_tipo_justificacion) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%') and\n\t\t\t\t\t\t (p.fecha_ingreso <= '$fecha_reporte') and\n\t\t\t\t\t\t (jd.fecha_desde <= '$fecha_reporte') and\n\t\t\t\t\t\t\t (jd.fecha_hasta >= '$fecha_reporte') and\n\t\t\t\t\t\t\t (j.estatus='1') and (j.codigo=jd.codigo_just) and (j.codigo=jp.codigo_just))\n\t\t\t\t\t\tORDER BY p.nombres, p.apellidos, jp.cedula \";\n $this->justificaciones=cargar_data($sql,$this); \n\n // se obtiene el horario vigente para la fecha seleccionada\n $this->horario_vigente = obtener_horario_vigente($cod_organizacion,$fecha_reporte,$this);\n \n // se realizan las consultas para mostrar los listados\n // Se consultan los asistentes\n $sql=\"SELECT (p.cedula) as cedula_integrantes, CONCAT(p.nombres,' ',p.apellidos) as nombre,\n e.cedula, e.fecha, MIN(e.hora) as entrada, MAX(e.hora) as salida\n FROM asistencias.entrada_salida as e, organizacion.personas as p, organizacion.personas_nivel_dir as n\n WHERE ((p.cedula = e.cedula) and\n (p.cedula = n.cedula) and\n (n.cod_direccion LIKE '$dir%') and\n (p.fecha_ingreso <= '$fecha_reporte') and\n (e.fecha <= '$fecha_reporte') and\n (e.fecha >= '$fecha_reporte'))\n GROUP BY e.cedula\n ORDER BY entrada, p.nombres, p.apellidos \";\n $this->asistentes=cargar_data($sql,$this);\n $this->ind_asistentes = count($this->asistentes);\n\n // se consultan los inasistentes\n $sql2=\"SELECT p.cedula as cedula_integrantes, CONCAT(p.nombres,' ',p.apellidos) as nombre\n\t\t\t\t\t\t\t\t\t FROM organizacion.personas as p, asistencias.personas_status_asistencias as s,\n\t\t\t\t\t\t\t\t\t organizacion.personas_nivel_dir as n\n\t\t\t\t\t\t\t\t\t WHERE ((s.status_asistencia = '1') and\n\t\t\t\t\t\t\t\t\t \t\t (s.cedula = p.cedula) and\n\t\t\t\t\t\t\t\t\t\t\t (p.cedula = n.cedula) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%') and\n\t\t\t\t\t\t\t\t\t (p.fecha_ingreso <= '$fecha_reporte') and\n\t\t\t\t\t\t\t\t\t (p.cedula not in\n\t\t\t\t\t\t\t\t\t (SELECT e.cedula\n\t\t\t\t\t\t\t\t\t\t FROM asistencias.entrada_salida as e, organizacion.personas_nivel_dir as n\n\t\t\t\t\t\t\t\t\t\t \t WHERE ((e.fecha = '$fecha_reporte') and\n\t\t\t\t\t\t\t\t\t\t\t\t (p.cedula = n.cedula) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%'))\n\t\t\t\t\t\t\t\t\t\t\t GROUP BY e.cedula)))\n\t\t\t\t\t\t\t\t\t ORDER BY p.nombres, p.apellidos\";\n $this->inasistentes=cargar_data($sql2,$this);\n\n\n // Se consultan los asistentes para comparar inconsistencia de horas en el marcado\n // Si le falta hora\n $inconsistentes = array();\n foreach($this->asistentes as $arreglo){\n \n $sql2=\"SELECT COUNT(*) as n_horas FROM asistencias.entrada_salida as e\n\t\t\t WHERE e.fecha = '$fecha_reporte' AND e.cedula = '$arreglo[cedula_integrantes]' \";\n $resultado2=cargar_data($sql2,$this);\n if(!empty($resultado2)){\n if ($resultado2[0][n_horas]%2!=0) {//impar\n array_unshift($inconsistentes, array('cedula'=>$arreglo[cedula_integrantes], 'nombre'=>$arreglo[nombre],'salida'=>$arreglo[salida]));\n }//fin si\n }//fin si\n }//fin each\n\n\n\n // Se enlaza el nuevo arreglo con el listado de Direcciones\n //$this->DataGrid_fj->Caption=\"Reporte de Asistencias del \".$this->txt_fecha_desde->Text;\n if(!empty($inconsistentes)){\n $this->DataGrid_fh->DataSource=$inconsistentes;\n $this->DataGrid_fh->dataBind();\n }\n\n // Se enlaza el nuevo arreglo con el listado de Direcciones\n $this->DataGrid->Caption=\"Reporte de Asistencias del \".$this->txt_fecha_desde->Text;\n $this->DataGrid->DataSource=$this->asistentes;\n $this->DataGrid->dataBind();\n\n\n $this->DataGrid_ina->Caption=\"Inasistentes el d&iacute;a \".$this->txt_fecha_desde->Text;\n $this->DataGrid_ina->DataSource=$this->inasistentes;\n $this->DataGrid_ina->dataBind();\n\n /* Por un error que no supe identificar, el cual suma un numero adicional a la variable\n * de inasistentes no justificados, he tenido que sacarla del procedimiento donde normalmente\n * se contaba y tuve que realizarla por resta en esta sección.\n */\n $this->ind_inasistentes_no_just = count($this->inasistentes) - $this->ind_inasistentes_si_just;\n\n $this->Repeater->DataSource = $this->justificaciones;\n $this->Repeater->dataBind();\n\n $xale=rand(100,99999);\n // Se realiza la construcción del gráfico para indicadores\n\n $chart = new PieChart();\n $dataSet = new XYDataSet();\n if ($this->ind_asistentes>=1) {$dataSet->addPoint(new Point(\"Funcionarios Asistentes: (\".$this->ind_asistentes.\")\", $this->ind_asistentes));};\n if ($this->ind_inasistentes_no_just>=1) {$dataSet->addPoint(new Point(\"Inasistentes NO JUSTIFICADOS: (\".$this->ind_inasistentes_no_just.\")\", $this->ind_inasistentes_no_just));};\n if ($this->ind_inasistentes_si_just>=1) {$dataSet->addPoint(new Point(\"Inasistentes JUSTIFICADOS: (\".$this->ind_inasistentes_si_just.\")\", $this->ind_inasistentes_si_just));};\n $chart->setDataSet($dataSet);\n $chart->setTitle(\"Porcentajes de Asistencias / Inasistencias del: \".$this->txt_fecha_desde->Text);\n elimina_grafico($xale.\"_01.png\");\n $chart->render(\"imagenes/temporales/\".$xale.\"_01.png\");\n $this->grafico1->ImageUrl = \"imagenes/temporales/\".$xale.\"_01.png\";\n\n\n $chart2 = new PieChart();\n $dataSet2 = new XYDataSet();\n $this->ind_asistentes_no_retrasados=$this->ind_asistentes-$this->ind_asistentes_tarde_no_just-$this->ind_asistentes_tarde_si_just;\n if ($this->ind_asistentes_no_retrasados>=1) {$dataSet2->addPoint(new Point(\"Puntuales: (\".$this->ind_asistentes_no_retrasados.\")\", $this->ind_asistentes_no_retrasados));};\n if ($this->ind_asistentes_tarde_no_just>=1) {$dataSet2->addPoint(new Point(\"Impuntuales NO JUSTIFICADOS: (\".$this->ind_asistentes_tarde_no_just.\")\", $this->ind_asistentes_tarde_no_just));};\n if ($this->ind_asistentes_tarde_si_just>=1) {$dataSet2->addPoint(new Point(\"Impuntuales JUSTIFICADOS: (\".$this->ind_asistentes_tarde_si_just.\")\", $this->ind_asistentes_tarde_si_just));};\n $chart2->setDataSet($dataSet2);\n $chart2->setTitle(\"Porcentajes de Retrasos del: \".$this->txt_fecha_desde->Text);\n elimina_grafico($xale.\"_02.png\");\n $chart2->render(\"imagenes/temporales/\".$xale.\"_02.png\");\n $this->grafico2->ImageUrl = \"imagenes/temporales/\".$xale.\"_02.png\";\n\n // si la consulta de asistentes tiene resultados se habilita la impresion, sino, se deshabilita\n if (!empty($this->asistentes)) {$this->btn_imprimir->Enabled = true;} else {$this->btn_imprimir->Enabled = false;}\n\n }", "protected function selectPagos($tabla) {\n $getproducto = $this->_db->query(\"SELECT deuda.Id_cliente as dni, nombre as nombre, apellidos as apellido, \n direccion as direccion, telefono as telefono, celular as celular, deuda.total as deuda\n FROM $tabla as pagos \n INNER JOIN venta as venta ON venta.Id_deuda = pagos.Id_deuda\n INNER JOIN productoventa as prodventa ON venta.cod_busqueda = prodventa.cod_busqueda\n INNER JOIN deuda as deuda ON deuda.Id_deuda = venta.Id_deuda\n INNER JOIN cliente as cliente ON cliente.Id_cliente = deuda.Id_cliente where pagos.estado = 0 and pagos.Fecha_Pago = CURDATE()\n GROUP BY cliente.Id_cliente\n ORDER BY deuda.Fecha_deuda\");\n $this->_db->cerrar();\n return $getproducto->fetchall();\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 }", "function mostraPagina()\n\t\t{\n\t\t$this->aggiungiElemento(\"Scheda argomento\", \"titolo\");\n\t\t$this->aggiungiElemento($this->modulo);\n\t\t$this->mostra();\n\t\t\t\n\t\t}" ]
[ "0.6404441", "0.6331214", "0.6281734", "0.6251114", "0.6212843", "0.6207302", "0.6207117", "0.6185995", "0.6183528", "0.6169288", "0.61543036", "0.61538196", "0.6144227", "0.61439854", "0.61324185", "0.6130469", "0.61157364", "0.60787696", "0.60755813", "0.60738", "0.6049342", "0.6035127", "0.60325927", "0.6032289", "0.6025773", "0.6008065", "0.6007889", "0.5988805", "0.5974128", "0.5971849", "0.5941375", "0.5940581", "0.5931982", "0.59165686", "0.59124273", "0.5912166", "0.5903767", "0.58946705", "0.58870745", "0.58726573", "0.58562547", "0.58531404", "0.58447915", "0.58390975", "0.5825606", "0.5822539", "0.5820329", "0.5818269", "0.5817304", "0.58126855", "0.581147", "0.58067024", "0.5805229", "0.5790569", "0.5785834", "0.5784004", "0.57808506", "0.57765484", "0.57764864", "0.5771022", "0.5770254", "0.5768655", "0.5768304", "0.5762303", "0.5752731", "0.5746832", "0.5746453", "0.574315", "0.5741187", "0.57404727", "0.57294285", "0.5723721", "0.5720233", "0.5718065", "0.57169247", "0.57157016", "0.57148856", "0.571359", "0.57119536", "0.5706836", "0.5705317", "0.5704573", "0.57020134", "0.5700634", "0.56981456", "0.5696874", "0.56920105", "0.56910914", "0.5689219", "0.5688535", "0.56865406", "0.5685369", "0.5678608", "0.56750005", "0.5674671", "0.5673422", "0.56729555", "0.56706667", "0.5669725", "0.5669228", "0.56680024" ]
0.0
-1
muestra todo los pedidos para el admin
function admin_get_all_orders(){ //$orders = $this->Order->find('all'); $this->paginate = array('limit' => 10, 'order' => 'Order.od_date DESC'); $this->set('orders', $this->paginate()); if(!empty($this->data)){ $this->Order->id = $this->data['Order']['id']; $this->Order->saveField('od_status', $this->data['Order']['od_status']); $result = $this->Order->get_ordered_items($this->data['Order']['id']); //enviar el correo electronico de la situacion $this->set('orderedProducts',$result); $this->set('status', $this->data['Order']['od_status']); $this->MyEmail->sendOrderStatusEmail($this->data['Order']['od_payment_email']); $this->redirect($this->referer()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function gestionPedidos(){\n Utils::isAdmin();\n $gestion = true;\n\n $oPedido = new Pedido();\n $pedidos = $oPedido->getAll();\n\n require_once 'views/pedido/mis_pedidos.php';\n }", "function modalidades_juegos_admin_listar ( ) {\t\n\t$result_set_Modalidad_Juego = db_query( \"SELECT * FROM {eSM_Modalidad_Juego} ORDER BY id_Modalidad_Juego ASC\" );\n\t\t\n\t$output = '<div class=\"form_item\">Lista de modalidades dadas de alta en la base de datos.</div>';\n\t$header = array (t('Name'), t('Plataforma'), t('Game'), t('Min Jugadores'), t('Max Jugadores'), '');\n\t\n\t//Pondremos un listado de modalidads disponibles\n\twhile( $Modalidad_Juego = db_fetch_object( $result_set_Modalidad_Juego ) ) {\n\t\t$result_set_Plataforma = db_query( \"SELECT * from {eSM_Plataforma} WHERE id_Plataforma = %d \", $Modalidad_Juego->id_Plataforma );\n\t\t\n\t\t$Plataforma = db_fetch_object( $result_set_Plataforma );\n\t\t\n\t\t$row = array();\n\t\t$row[] = $Modalidad_Juego->Nombre;\t\t\t\n\t\t$row[] = $Plataforma->Nombre;\n\t\t$row[] = $Modalidad_Juego->Nombre_Juego;\n\t\t$row[] = $Modalidad_Juego->Minimo_Jugadores;\n\t\t$row[] = $Modalidad_Juego->Maximo_Jugadores;\n\t\t$row[] = l( t( 'Editar' ), 'admin/base_datos_externa/modalidades/'.$Modalidad_Juego->id_Modalidad_Juego.'/editar' );\n\t\t\n\t\t$rows[] = $row;\n\t}\n\t$output .= theme('table', $header, $rows);\n\t\n\t$output .= l(t('Agregar modalidad'), 'admin/base_datos_externa/modalidades/insertar');\n\treturn $output;\n}", "public function listar_mis_pedidos() {\n \n try {\n $sql = \"\n select \n c.nro_documento,\n c.nombre,\n c.correo,\n c.telefono_celular,\n p.direccion_entrega,\n p.referencia_entrega,\n p.observacion,\n d.descripcion,\n c.cod_distrito,\n f.descripcion,\n p.importe_total,\n p.fecha_pedido,\n p.nro_pedido,\n p.cantidad_productos,\n p.estado,\n p.id_pedido\n from \n cliente c inner join pedido p\n on\n c.id_cliente = p.id_cliente inner join distrito d\n on\n c.cod_distrito = d.cod_distrito inner join forma_pago f\n on\n f.id_forma_pago = p.id_forma_pago\n where\n p.estado = 'PENDIENTE' and c.id_cliente = '$_SESSION[cliente_id]'; \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 listadoPedidos(){\n $pedido=new Pedido();\n\n //Conseguimos todos los usuarios\n $allPedido=$pedido->getAll();\n print_r(json_encode($allPedido));\n //echo $allClientes\n }", "public function mis_pedidos(){\n Utils::isIdentity();\n $usuario_id = $_SESSION['identity']->id;\n\n // Sacar los pedidos del usuario\n $oPedido = new Pedido();\n $oPedido->setUsuarioId($usuario_id);\n $pedidos = $oPedido->getAllByUser();\n\n require_once 'views/pedido/mis_pedidos.php';\n }", "public function listarAdmin()\n {\n $sql = \"SELECT US.nombre,CO.problema,CO.tipo_problema,CO.solucion, CO.modo_contacto, CO.tipo_estado \n FROM usuarios US JOIN consulta CO\n ON US.idusuarios = CO.idusuario\n WHERE CO.tipo_estado = 'Ejecutado'\";\n return ejecutarConsulta($sql);\n\n }", "public function vistaPagosAdminController()\n\t\t{\n\t\t\t$respuesta=Datos::vistaPagosPublicosModel(\"pagos\");\n\n\t\t\t$counter = 1;\n\t\t\tforeach($respuesta as $row => $item){\n\t\t\techo'<tr>\n\t\t\t\t\t<td>'.$counter.'</td>\n\t\t\t\t\t<td>'.$item[\"nombre_alumna\"].'</td>\n\t\t\t\t\t<td>'.$item[\"nombre_grupo\"].'</td>\n\t\t\t\t\t<td>'.$item[\"nombre_mama\"].'</td>\n\t\t\t\t\t<td>'.$item[\"fecha_pago\"].'</td>\n\t\t\t\t\t<td>'.$item[\"fecha_envio\"].'</td>\n\t\t\t\t\t<td> <center><a href=\"uploads/'.$item[\"ruta\"].'\">Ver</a></center></td>\n\t\t\t\t\t<td>'.$item[\"folio\"].'</td>\n\t\t\t\t\t<td><div class=\"btn-group\">\n <button type=\"button\" class=\"btn btn-default dropdown-toggle\" data-toggle=\"dropdown\">\n <span class=\"fa fa-cog\"></span>\n </button>\n <div class=\"dropdown-menu\">\n <a class=\"dropdown-item\" href=\"index.php?action=editar_lugar&id='.$item[\"id_pago\"].'\">Actualizar</a>\n <a class=\"dropdown-item\" onclick=\"confirmarDelete('.$item[\"id_pago\"].');\" href=\"index.php?action=lugares_admin&idBorrar='.$item[\"id_pago\"].'\" id=\"btn'.$item[\"id_pago\"].'\">Eliminar</a>\n </div></td>\n\t\t\t\t\t\n\t\t\t\t</tr>';\n\t\t\t$counter++;\n\t\t\t}\n\t\t}", "public function run()\n {\n //\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=1;\n $list_admin->libelle=\"1 copie originale de l'extrait de naissance\";\n $list_admin->save();\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=2;\n $list_admin->libelle=\"1 photocopie de la carte nationnale d'identité\";\n $list_admin->save();\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=3;\n $list_admin->libelle=\"2 photo d'identité couleur du même tirage\";\n $list_admin->save();\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=4;\n $list_admin->libelle=\"1 photocopie de l'extrait d'acte de naissance des descendants\";\n $list_admin->save();\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=5;\n $list_admin->libelle=\"1 photocopie de l'extrait d'acte de naissance du conjoint\";\n $list_admin->save();\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=6;\n $list_admin->libelle=\"1 photocopie de l'extrait d'acte de mariage\";\n $list_admin->save();\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=7;\n $list_admin->libelle=\"1 photocopie du certificat de célébration du mariage\";\n $list_admin->save();\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=8;\n $list_admin->libelle=\"1 photo d'identité récente des membres de sa famille\";\n $list_admin->save(); $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=9;\n $list_admin->libelle=\"1 photocopie du ou des diplômes\";\n $list_admin->save();\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=10;\n $list_admin->libelle=\"1 copie du curriculum vitaé actualisé\";\n $list_admin->save();\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=11;\n $list_admin->libelle=\"1 photocopie du ou des certificats de travail (personne en activité ou ayant déjà travaillé)\";\n $list_admin->save();\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=12;\n $list_admin->libelle=\"1 copie du dernier bulletin de salaire\";\n $list_admin->save();\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=13;\n $list_admin->libelle=\"1 copie des attestations de stage\";\n $list_admin->save();\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=14;\n $list_admin->libelle=\"1 copie de l'attestations d'immatriculation CNPS ou numéro sur support\";\n $list_admin->save();\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=15;\n $list_admin->libelle=\"les justificatifs de formation continue ou d'apprentissage\";\n $list_admin->save();\n $list_admin = new \\App\\Liste_Administratif();\n $list_admin->id=16;\n $list_admin->libelle=\"1 relevé d'identité bancaire (RIB)\";\n $list_admin->save();\n\n\n }", "public function EntregarPedidos()\n\t{\n\t\tself::SetNames();\n\t\t\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" cocinero = ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $cocinero);\n\t\t$stmt->bindParam(2, $codventa);\n\t\t\n\t\t$cocinero = strip_tags(\"0\");\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$sala = strip_tags(base64_decode($_GET[\"nombresala\"]));\n\t\t$mesa = strip_tags(base64_decode($_GET[\"nombremesa\"]));\n\t\t$stmt->execute();\n\t\t\n echo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-check-square-o'></span> EL PEDIDO DE LA \".$sala.\" Y \".$mesa.\" FUE ENTREGADO EXITOSAMENTE </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\t\n }", "private function listarTodosParticipante(){\n print_r($this->participantePDO->findAll());\n }", "public function listaPedidos()\n\t{\n\t\ttry{\n\t\t\treturn Pedido::all();\n\t\t} catch (\\Exception $ex){\n\t\t\tLog::error($ex);\n\t\t}\n\t\treturn null;\n\t}", "public function listar(){\n $equipamento = new Equipamento();\n // Recuperar dados\n $lista = $equipamento->getEquipamentos();\n // Manipular dados\n // . . .\n\n // Substituindo numero da manutencao pelo tipo dela.\n // foreach ($lista as $key => $value) {\n // $lista[$key]['tipo'] = $value['tipo'] == 1 ? 'Preventiva' : ($value['tipo'] == 2 ? 'Corretiva' : 'Urgente');\n // }\n\n // Invocar/retornar os dados para view.\n include 'view/admin/lista.php';\n }", "public function MediosPagosId()\n\t{\n\t\tself::SetNames();\n\t\t$sql = \" select * from mediospagos where codmediopago = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"formapagove\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function borrar_sesionvacia_admin(){\n $sesion = [\n 'idSesion' => SesionVacia::first()->id\n ];\n $headers = ['X-CSRF-TOKEN' => csrf_token()];\n $this->actingAs($this->admin, 'admin')\n ->post('sesionvacia/borrar', $sesion, $headers)\n ->assertStatus(204);\n }", "public function allAdmin()\n {\n $user = auth()->user();\n\n $productos = Venta::where('estado', 1)->get();\n\n $arrProductos = array();\n foreach ($productos as $producto) {\n $arrProductos[] = array(\n $producto->nombre,\n ($producto->estado) ? 'Activo' : 'Inactivo',\n $producto->id,\n );\n }\n\n $response = array('draw' => 1, 'recordsTotal' => count($arrProductos), 'recordsFiltered' => count($arrProductos), 'data' => $arrProductos);\n\n return response()->json($response, 200);\n }", "private function sync_pedido()\n {\n //listar os pedidos\n $this->get_pedidos();\n //verificar se existe em shopify\n\n //update no shopfy\n }", "public function adminPermisionListing()\n\t\t\t{\n\t\t\t\t$cls\t\t\t=\tnew adminUser();\n\t\t\t\t$cls->unsetSelectionRetention(array($this->getPageName()));\n\t\t\t\t $_SESSION['pid']\t=\t$_GET['id'];\n\t\t\t\t \n\t\t\t}", "public function actionAdmin()\n {\n $query = \"SELECT * FROM vartotojai WHERE klase = :klase\";\n $vartotojai = Yii::$app->db_prod->createCommand($query, [':klase' => self::KLASE_ADMINISTRATORIUS])->queryAll();\n foreach ($vartotojai as $vartotojas) {\n if ($this->adminExists($vartotojas['id'])) {\n continue;\n }\n\n $admin = new Admin([\n 'scenario' => Admin::SCENARIO_SYSTEM_MIGRATES_ADMIN_DATA,\n 'id' => $vartotojas['id'],\n 'name' => $vartotojas['vardas'],\n 'surname' => $vartotojas['pavarde'],\n 'email' => $vartotojas['elpastas'],\n 'phone' => $vartotojas['telefonai'],\n 'password_reset_token' => Admin::DEFAULT_PASSWORD_RESET_TOKEN,\n 'admin' => Admin::IS_ADMIN,\n 'archived' => $this->convertArchiveStatus($vartotojas['archive_status']),\n 'created_at' => strtotime($vartotojas['data']),\n 'updated_at' => strtotime($vartotojas['data']),\n ]);\n\n $admin->generateAuthKey();\n\n if ($this->hadOldPassword($vartotojas['raw_password'])) {\n $admin->setPassword($vartotojas['raw_password']);\n } else {\n $admin->setPassword(self::DEFAULT_PASSWORD);\n }\n\n $this->fixValidationErrors($admin);\n $admin->validate();\n if ($admin->errors) {\n $this->writeToCSV(Admin::tableName(), $admin->errors, $admin->id);\n continue;\n }\n\n $admin->detachBehaviors(); // Remove timestamp behaviour\n $admin->save(false);\n }\n }", "public function pedidos($id)\r\n\t{\r\n\t\t//Carga los datos de pedidos, crear tabla de pedidos\r\n\t\t$this->pedidos = (New Pedidos)->find_by_proveedor_id($id);\r\n\t}", "function getAllPedidos()\n {\n $query = $this->db->prepare(\"SELECT * FROM pedido\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_OBJ);\n }", "public function getAllByUser(){\n //hacemos la consulta y lo guardamos en una variable\n $sql=\"SELECT * FROM pedidos\"\n .\" where usuario_id={$this->getUsuario_id()} order by id desc\";\n $pedido=$this->db->query($sql);\n //devolvemos un valor en especifico \n return $pedido;\n }", "function admin_tous() {\n\t\t\t$this->paginate = array(\n\t\t\t\t\t\t\t\t'recursive'=>2,\n\t\t\t\t\t\t\t\t'limit' => 20,\"conditions\"=>\"Personne.deleted = 0\",\n\t\t\t\t\t\t\t\t\"order\" => \"Personne.id desc\"\n\t\t\t\t\t\t\t\t) ; \n\t\t\t$marques = $this->personne->Marque->find('list',array('conditions'=>'Marque.deleted = 0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'order'=>'Marque.nom asc')); \n\t\t\t/* $this->loadModel('Variete'); \n\t\t\t$varietes = $this->Variete->find('first',array('fields'=>array('Variete.stock')));\n\t\t\t$this->set('varietes',$varietes); */\n\t\t\t$this->set('marques',$marques);\n\t\t\t$this->set('Personnes',$this->paginate('personne') );\n\t\t\t$this->set('page_title','Liste de tous les articles');\n\t\t\t$this->set('balise_h1','Liste de tous les articles');\n\t\t\t$this->render('admin_index');\n\t\t}", "public function actionMultiple($pedido)\n {\n // var_dump($pedido);\n if ($pedido) {\n $com = json_decode($pedido);\n // $pedidos = [];\n $pasa = true;\n // var_dump($com);\n foreach ($com->pedidos as $ped) {\n $colegio = Colegios::find()->where(['nombre' => $ped[0]])->one();\n $us = Usuarios::find()->where(['colegio_id' => $colegio->id, 'rol' => 'V'])->one();\n $pedid = [];\n for ($i = 1; $i < count($ped); $i++) {\n foreach ($ped[$i] as $un) {\n $uniform = $this->findModel($un[0]);\n if ($un[1] > $uniform->cantidad) {\n $pasa = false;\n } else {\n $uniform->cantidad = $uniform->cantidad - $un[1];\n $uniform->save();\n $vend = Usuarios::findOne(['colegio_id' => $uniform->colegio_id, 'rol' => 'V']);\n if ($vend !== null) {\n if ($vend->tel_movil !== null) {\n $vend->smsStock($uniform->id);\n // die();\n }\n }\n $pedid[] = [$un[0], $un[1]];\n }\n }\n }\n if ($pasa) {\n $us->emailMultiple($pedid, Yii::$app->user->id);\n }\n // $pedidos[] = $pedid;\n // var_dump($ped);\n }\n if (!$pasa) {\n Yii::$app->session->setFlash('error', 'Ha puesto demasiada cantidad en algunos de los uniformes, revise los datos');\n return true;\n }\n // var_dump($pedidos);\n // die();\n // Yii::$app->session->setFlash('info', 'Se le ha enviado un correo a los administradores de las colegios, se le contestará cuando lo acepte');\n // $this->redirect(['index', 'mio' => 'no']);\n }\n }", "public function listar_modulos()\n {\n //--Modificacion con Mongo db\n //---------------------------------------------------------------------------\n $resultados = $this->mongo_db->order_by(array('_id' => 'DESC'))->where(array('eliminado'=>false))->get($this->nombre_tabla);\n foreach ($resultados as $clave => $valor) {\n $auditoria = $valor[\"auditoria\"][0];\n //var_dump($auditoria->cod_user);die('');\n //--usuario en cuestion\n $id = new MongoDB\\BSON\\ObjectId($valor[\"auditoria\"][0]->cod_user);\n $res_us = $this->mongo_db->where(array('_id'=>$id))->get('usuario');\n //var_dump($res_us[0][\"auditoria\"]->status);die('');\n //var_dump(end($res_us[0][\"auditoria\"]));die('');\n $vector_auditoria = reset($valor[\"auditoria\"]);\n $valor[\"fec_regins\"] = $vector_auditoria->fecha->toDateTime();\n //$valor[\"fec_regins\"] = $res_us[0][\"auditoria\"][0]->fecha->toDateTime();\n $valor[\"correo_usuario\"] = $res_us[0][\"correo_usuario\"];\n $valor[\"status\"] = $valor[\"status\"];\n $valor[\"id_modulo_vista\"] = $valor[\"_id\"]->{'$id'};\n $listado[] = $valor;\n } \n //--\n $listado2 = $listado;\n return $listado2;\n //---------------------------------------------------------------------------\n\n }", "public function getAll()\n {\n\n $pedido = $this->db->query(\"SELECT * FROM pedidos ORDER BY id DESC\");\n return $pedido;\n }", "public function traerModulos()\n {\n $modeloPermisos = new \\App\\Models\\ModeloPermisos();\n $permisos = $modeloPermisos->traerDePerfil($_SESSION[\"id_perfil\"], $_SESSION[\"id_cliente\"]);\n\n // Modulos a lo que tiene acceso el usuario\n $modeloModulos = new \\App\\Models\\ModeloModulos();\n $i = 0;\n $modulos = []; // Modulos en general al que tiene acceso\n $hijos = []; // SubModulos de '$modulos' al que tiene acceso\n foreach ($permisos as $permiso)\n {\n // Obtenemos un modulo padre\n $modulosHijos = $modeloModulos->traerHijos($permiso[\"id_modulo\"], $permiso[\"id_cliente\"]);\n $j = 0;\n // Obtenemos los hijos del modulo padre\n foreach ($modulosHijos as $nhijos)\n {\n // Guardamos hijos\n $hijos[$j++] = [\"modulo\" => $nhijos[\"modulo\"], \"url\" => $nhijos[\"url\"]];\n }\n // Guardamos padres\n $modulos[$i++] = [\"modulo\" => $permiso[\"modulo\"], \"hijos\" => $hijos];\n $j = 0;\n $hijos = [];\n }\n // Limpiar aquellos modulos sin hijos\n $nmodulos = []; // Datos para el menu\n $i = 0;\n foreach ($modulos as $modulo)\n {\n if (empty($modulo[\"hijos\"]))\n continue;\n $nmodulos[$i++] = [\"modulo\" => $modulo[\"modulo\"], \"hijos\" => $modulo[\"hijos\"]];\n }\n\n return $nmodulos;\n }", "static function getAllAdmin()\n {\n\n $con=Database::getConnection();\n $req=$con->prepare('SELECT * FROM admin a, partners p WHERE a.idPart=p._idPart');\n $req->execute(array());\n return $req->fetchAll();\n }", "private function consultar_usuario_todos() {\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u;\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "public function possederListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Posseder\");//type array\n\t}", "public function readPedidos(){\n $sql='SELECT IdEncabezado, u.Nombre, u.Apellido, Fecha, TipoEstado \n FROM encabezadopedidos en INNER JOIN usuarios u USING (IdUsuario) \n INNER JOIN estadopedidos es USING(IdEstadoPedido) ORDER by IdEncabezado ASC ';\n $params=array(null);\n return Database::getRows($sql, $params);\n }", "public function postListaSecciones(){\n\t\t$id=Input::get('id');\n\t\t$lista=DB::table('MODBID_INFORMACIONSECCION')\t\t\t\t\t\t\n\t\t\t\t\t\t->select(DB::RAW('id,id_info,titulo,texto'))\n\t\t\t\t\t\t->where('borrado','=',0)\n\t\t\t\t\t\t->where('id_info','=',$id)\n\t\t\t\t\t\t->orderby('fecha_noticia')\n\t\t\t\t\t\t->get();\n\t\treturn $lista;\n\t}", "public static function getListado(){\n return Dispositivo::model()->findAll();\n }", "public function multidelete()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'detailfasilitaskesehatan', 'delete')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tif (!empty($_POST)) {\n\t\t\t$totaldata = $this->postring->valid($_POST['totaldata'], 'xss');\n\t\t\tif ($totaldata != \"0\") {\n\t\t\t\t$items = $_POST['item'];\n\t\t\t\tforeach($items as $item){\n\t\t\t\t\t$query = $this->podb->deleteFrom('detailfasilitaskesehatan')->where('id', $this->postring->valid($item['deldata'], 'sql'));\n\t\t\t\t\t$query->execute();\n\t\t\t\t}\n\t\t\t\t$this->poflash->success('Detailfasilitaskesehatan has been successfully deleted', 'admin.php?mod=detailfasilitaskesehatan');\n\t\t\t} else {\n\t\t\t\t$this->poflash->error('Error deleted detailfasilitaskesehatan data', 'admin.php?mod=detailfasilitaskesehatan');\n\t\t\t}\n\t\t}\n\t}", "public function listagemAction()\n\t{\n\t\n\t}", "public function actionAdministrador(){\n\t\t//total inscritos\n\t\t//total comunicaciones\n\t\t//pendientes de revisar?\n\t\tif( Yii::app()->user->rol == 1 || Yii::app()->user->rol == 2){\t\t\n\t\t\t$edicion = Dato::model()->find('clave = \"edicion\"');\n\t\t\t$pagado = $this->totalpagado();\n\n\t\t\t$total = $this->totalPagar();\n\n\t\t\t$comunicaciones = $this->totalComunicaciones();\n\n\t\t\t$norevisadas = $this->pendientesRevisar();\n\n\t\t\t$inscritos = $this->totalInscritos();\n\t\t\t\n\t\t\t$datos = $this->totalInscritosGrafica();\n\t\t\t$this->render('administrador', array(\n\t\t\t\t'total'=>$total, \n\t\t\t\t'pagado' => $pagado,\n\t\t\t\t'inscritos'=>$inscritos,\n\t\t\t\t'comunicaciones'=>$comunicaciones,\n\t\t\t\t'norevisadas'=>$norevisadas,\n\t\t\t\t'edicion' => $edicion->valor,\n\t\t\t\t'datos' => $datos,\n\t\t\t\t)\n\t\t\t);\n\t\t}else{\n\t\t\tYii::app()->end();\n\t\t}\n\t}", "public function run()\n {\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Permission::query()->truncate();\n Role::query()->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n /* ************************************************************************************\n **************************************** PERMISOS ***********************************\n ************************************************************************************ */\n\n /* --------------------------------------------------\n ---------------- MENU DE VENTAS ----------------\n ----------------------------------------------------- */\n $i = 1;\n $descripcion[$i] = 'Menu de Venta';\n $ruta[$i] = 'sales-menu';\n $ruta_padre[$i] = '';\n\n\n $i++;\n $descripcion[$i] = 'Menú cotización [M.Venta]';\n $ruta[$i] = 'quotation/header';\n $ruta_padre[$i] = 'sales-menu';\n $i++;\n\n $descripcion[$i] = 'Nueva venta [M.Venta]';\n $ruta[$i] = 'sales?id=0';\n $ruta_padre[$i] = 'sales-menu';\n $i++;\n $descripcion[$i] = 'Clientes [M.Venta]';\n $ruta[$i] = 'customers';\n $ruta_padre[$i] = 'sales-menu';\n $i++;\n $descripcion[$i] = 'Crear cliente [M. venta]';\n $ruta[$i] = 'customers/create';\n $ruta_padre[$i] = 'sales-menu';\n $i++;\n $descripcion[$i] = 'Modificar cliente [M. venta]';\n $ruta[$i] = 'customers/edit';\n $ruta_padre[$i] = 'sales-menu';\n $i++;\n $descripcion[$i] = 'eliminar cliente [M. venta]';\n $ruta[$i] = 'customers/delete';\n $ruta_padre[$i] = 'sales-menu';\n $i++;\n $descripcion[$i] = 'Estado de cuenta clientes [M. venta]';\n $ruta[$i] = 'customers/statement';\n $ruta_padre[$i] = 'sales-menu';\n\n $i++;\n $descripcion[$i] = 'Rutas [M. venta]';\n $ruta[$i] = 'routes';\n $ruta_padre[$i] = 'sales-menu';\n $i++;\n $descripcion[$i] = 'Crear ruta [M. venta]';\n $ruta[$i] = 'routes/create';\n $ruta_padre[$i] = 'sales-menu';\n $i++;\n $descripcion[$i] = 'Modificar ruta [M. venta]';\n $ruta[$i] = 'routes/edit';\n $ruta_padre[$i] = 'sales-menu';\n $i++;\n $descripcion[$i] = 'Eliminar ruta [M. venta]';\n $ruta[$i] = 'routes/delete';\n $ruta_padre[$i] = 'sales-menu';\n\n\n $i++;\n $descripcion[$i] = 'Cuentas por cobrar [M. venta]';\n $ruta[$i] = 'credit';\n $ruta_padre[$i] = 'sales-menu';\n $i++;\n $descripcion[$i] = 'Notas de crédito';\n $ruta[$i] = 'credit_note';\n $ruta_padre[$i] = 'credit_note';\n\n // $i++;\n // $descripcion[$i] = 'Morosos [M. venta]';\n // $ruta[$i] = 'reports/customers_pending_to_pay';\n // $ruta_padre[$i] = 'sales-menu';\n\n\n /* SEPARACION MENU */\n /* --------------------------------------------------\n ---------------- MENU DE COMPRAS ----------------\n ----------------------------------------------------- */\n $i++;\n $descripcion[$i] = 'Menu de compras';\n $ruta[$i] = 'receivings-menu';\n $ruta_padre[$i] = '';\n $i++;\n $descripcion[$i] = 'Nueva compra [M. compra]';\n $ruta[$i] = 'receivings';\n $ruta_padre[$i] = 'receivings-menu';\n\n $i++;\n $descripcion[$i] = 'Proveedores [M. compra]';\n $ruta[$i] = 'suppliers';\n $ruta_padre[$i] = 'receivings-menu';\n $i++;\n $descripcion[$i] = 'Crear proveedor [M. compra]';\n $ruta[$i] = 'suppliers/create';\n $ruta_padre[$i] = 'receivings-menu';\n $i++;\n $descripcion[$i] = 'Modificar proveedor [M. compra]';\n $ruta[$i] = 'suppliers/edit';\n $ruta_padre[$i] = 'receivings-menu';\n $i++;\n $descripcion[$i] = 'Eliminar proveedor [M. compra]';\n $ruta[$i] = 'suppliers/delete';\n $ruta_padre[$i] = 'receivings-menu';\n\n $i++;\n $descripcion[$i] = 'Cuentas por pagar [M. compra]';\n $ruta[$i] = 'credit_suppliers';\n $ruta_padre[$i] = 'credit_suppliers';\n $i++;\n $descripcion[$i] = 'Estado de cuenta proveedores [M. compra]';\n $ruta[$i] = 'suppliers/statement';\n $ruta_padre[$i] = 'receivings-menu';\n\n /* SEPARACION MENU */\n /* --------------------------------------------------\n ---------------- MENU DE PROYECTOS ----------------\n ----------------------------------------------------- */\n // $i++;\n // $descripcion[$i] = 'Proyectos';\n // $ruta[$i] = 'project/projects';\n // $ruta_padre[$i] = 'project';\n // $i++;\n // $descripcion[$i] = 'Etapas';\n // $ruta[$i] = 'project/stages';\n // $ruta_padre[$i] = 'project';\n // $i++;\n // $descripcion[$i] = 'Atributos';\n // $ruta[$i] = 'project/atributes';\n // $ruta_padre[$i] = 'project';\n // $i++;\n // $descripcion[$i] = 'Renglones';\n // $ruta[$i] = 'line-template';\n // $ruta_padre[$i] = 'line-template';\n\n // $i++;\n // $descripcion[$i] = 'Modificar precios de artículos en creación y edición de renglones';\n // $ruta[$i] = 'line-template/item/config_budget_price';\n // $ruta_padre[$i] = 'line-template';\n\n // $i++;\n // $descripcion[$i] = 'Ver monto acordado de proyecto [M. Proyectos]';\n // $ruta[$i] = 'project/stages_project/';\n // $ruta_padre[$i] = 'project';\n\n // $i++;\n // $descripcion[$i] = 'Ver saldo de proyecto [M. Proyectos]';\n // $ruta[$i] = 'project/stages_project/';\n // $ruta_padre[$i] = 'project';\n\n // $i++;\n // $descripcion[$i] = 'Ver ingresos de proyectos [M. Proyectos]';\n // $ruta[$i] = 'project/stages_project/';\n // $ruta_padre[$i] = 'project';\n // $i++;\n\n // $descripcion[$i] = 'Ver egresos de proyectos [M. Proyectos]';\n // $ruta[$i] = 'project/stages_project/';\n // $ruta_padre[$i] = 'project';\n\n /* SEPARACION MENU */\n /* --------------------------------------------------\n ---------------- MENU DE INVENTARIO ----------------\n ----------------------------------------------------- */\n\n $i++;\n $descripcion[$i] = 'Menu de Inventario';\n $ruta[$i] = 'ítems-menu';\n $ruta_padre[$i] = '';\n\n /* ---------------- SUBMENU ---------------- */\n $i++;\n $descripcion[$i] = 'Sub-menu Productos & Servicios [M. Productos]';\n $ruta[$i] = 'products-services';\n $ruta_padre[$i] = 'ítems-menu';\n\n\n $i++;\n $descripcion[$i] = 'Catálogo/precios Productos [M. Productos]';\n $ruta[$i] = 'ítems';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Crear productos [M. Productos]';\n $ruta[$i] = 'ítems/create';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Modificaar productos [M. Productos]';\n $ruta[$i] = 'ítems/edit';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Eliminar productos [M. Productos]';\n $ruta[$i] = 'ítems/delete';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Detalle productos [M. Productos]';\n $ruta[$i] = 'ítems/detail';\n $ruta_padre[$i] = 'ítems-menu';\n\n $i++;\n $descripcion[$i] = 'Catálogo/precios Servicios [M. Productos]';\n $ruta[$i] = 'services';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Crear servicios [M. Productos]';\n $ruta[$i] = 'services/create';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Modificaar servicios [M. Productos]';\n $ruta[$i] = 'services/edit';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Eliminar servicios [M. Productos]';\n $ruta[$i] = 'services/delete';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Detalle servicios [M. Productos]';\n $ruta[$i] = 'services/detail';\n $ruta_padre[$i] = 'ítems-menu';\n\n\n\n $i++;\n $descripcion[$i] = 'Busqueda de productos / Kardex [M. Productos]';\n $ruta[$i] = 'items/search';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Existencias por bodega [M. Productos]';\n $ruta[$i] = 'items/show';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Kits [M. Productos]';\n $ruta[$i] = 'item-kits';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Crear kit [M. Productos]';\n $ruta[$i] = 'item-kits/create';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Modificar kit [M. Productos]';\n $ruta[$i] = 'item-kits/edit';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Eliminar kit [M. Productos]';\n $ruta[$i] = 'item-kits/delete';\n $ruta_padre[$i] = 'ítems-menu';\n\n $i++;\n $descripcion[$i] = 'Categorias de productos [M. Productos]';\n $ruta[$i] = 'categorie_product';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Crear categorias de productos [M. Productos]';\n $ruta[$i] = 'categorie_product/create';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Modificar categorias de productos [M. Productos]';\n $ruta[$i] = 'categorie_product/edit';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Eliminar categorias de productos [M. Productos]';\n $ruta[$i] = 'categorie_product/delete';\n $ruta_padre[$i] = 'ítems-menu';\n\n $i++;\n $descripcion[$i] = trans('unit_measure.unit_measure');\n $ruta[$i] = 'unit_measure';\n $ruta_padre[$i] = 'ítems-menu';\n\n /* -------------------------------- SUBMENU -------------------------------- */\n $i++;\n $descripcion[$i] = 'Sub-menu Configuraciones y Movimientos [M. Productos]';\n $ruta[$i] = 'settings-movements';\n $ruta_padre[$i] = 'ítems-menu';\n\n\n $i++;\n $descripcion[$i] = 'Listados de precios [M. Productos]';\n $ruta[$i] = 'prices';\n $ruta_padre[$i] = 'ítems-menu';\n\n $i++;\n $descripcion[$i] = 'Gestión de cierres de inventario [M. Productos]';\n $ruta[$i] = 'inventory_closing';\n $ruta_padre[$i] = 'ítems-menu';\n\n $i++;\n $descripcion[$i] = 'Bodegas [M. Productos]';\n $ruta[$i] = 'almacen';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Crear bodega [M. Productos]';\n $ruta[$i] = 'almacen/create';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Modificar bodega [M. Productos]';\n $ruta[$i] = 'almacen/edit';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Eliminar bodega [M. Productos]';\n $ruta[$i] = 'almacen/delete';\n $ruta_padre[$i] = 'ítems-menu';\n\n $i++;\n $descripcion[$i] = 'Traslados de bodega [M. Productos]';\n $ruta[$i] = 'list_transfer';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Crear traslado de bodega [M. Productos]';\n $ruta[$i] = 'transfer_to_storage';\n $ruta_padre[$i] = 'ítems-menu';\n\n $i++;\n $descripcion[$i] = 'Crear ajuste de inventario (+) [M. Productos]';\n $ruta[$i] = 'inventory_adjustment';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Crear ajuste de inventario (-) [M. Productos]';\n $ruta[$i] = 'inventory_adjustment/sale';\n $ruta_padre[$i] = 'ítems-menu';\n $i++;\n $descripcion[$i] = 'Costo del Inventario';\n $ruta[$i] = 'reports/product_and_cellars';\n $ruta_padre[$i] = 'ítems-menu';\n\n\n\n /* SEPARACION MENU */\n /* --------------------------------------------------\n ---------------- MENU DE REPORTES ----------------\n ----------------------------------------------------- */\n $i++;\n $descripcion[$i] = 'Menu de Reportes';\n $ruta[$i] = 'reports-menu';\n $ruta_padre[$i] = '';\n /* -------------------------------- SUBMENU COMPRAS -------------------------------- */\n $i++;\n $descripcion[$i] = 'Sección de Reportes de Compras [M. reportes]';\n $ruta[$i] = 'reports-receivings-section';\n $ruta_padre[$i] = 'reports-menu';\n $i++;\n $descripcion[$i] = 'Compras [M. reportes]';\n $ruta[$i] = 'reports/receivings';\n $ruta_padre[$i] = 'reports-menu';\n $i++;\n $descripcion[$i] = 'Compras por tipo de pago [M. reportes]';\n $ruta[$i] = 'reports/reporte_compra';\n $ruta_padre[$i] = 'reports-menu';\n\n\n /* -------------------------------- SUBMENU VENTAS -------------------------------- */\n $i++;\n $descripcion[$i] = 'Seccion de Reportes de Ventas [M. reportes]';\n $ruta[$i] = 'reports-sales-section';\n $ruta_padre[$i] = 'reports-menu';\n $i++;\n $descripcion[$i] = 'Ventas [M. reportes]';\n $ruta[$i] = 'reports/sales';\n $ruta_padre[$i] = 'reports-menu';\n $i++;\n $descripcion[$i] = 'Arqueo de Caja [M. reportes]';\n $ruta[$i] = 'reports/reporte_venta';\n $ruta_padre[$i] = 'reports-menu';\n $i++;\n $descripcion[$i] = 'Ventas totales por ruta [M. reportes]';\n $ruta[$i] = 'reports/route/sales';\n $ruta_padre[$i] = 'reports-menu';\n\n $i++;\n $descripcion[$i] = 'Productos más vendidos [M. reportes]';\n $ruta[$i] = 'reports/items_quantity_sales';\n $ruta_padre[$i] = 'reports-menu';\n $i++;\n $descripcion[$i] = 'Rentabilidad por ruta [M. reportes]';\n $ruta[$i] = 'reports/route/profit';\n $ruta_padre[$i] = 'reports-menu';\n $i++;\n $descripcion[$i] = 'Rentabilidad por producto [M. reportes]';\n $ruta[$i] = 'reports/profit_by_product';\n $ruta_padre[$i] = 'reports-menu';\n $i++;\n $descripcion[$i] = 'Liquidación semanal';\n $ruta[$i] = 'reports/inventory_week';\n $ruta_padre[$i] = 'reports-menu';\n\n\n /* -------------------------------- SUBMENU -------------------------------- */\n $i++;\n $descripcion[$i] = 'Sección de Reportes de Inventario [M. reportes]';\n $ruta[$i] = 'reports-inventory-section';\n $ruta_padre[$i] = 'reports-menu';\n\n\n $i++;\n $descripcion[$i] = 'Existencias [M. reportes]';\n $ruta[$i] = 'reports/stock';\n $ruta_padre[$i] = 'reports-menu';\n $i++;\n $descripcion[$i] = 'Ajustes de inventario Ingresos (+) [M. reportes]';\n $ruta[$i] = 'report_adjustment_in';\n $ruta_padre[$i] = 'reports-menu';\n $i++;\n $descripcion[$i] = 'Ajustes de inventario Salidas (-) [M. reportes]';\n $ruta[$i] = 'report_adjustment_out';\n $ruta_padre[$i] = 'reports-menu';\n $i++;\n $descripcion[$i] = 'Productos por fecha de expiración [M. reportes]';\n $ruta[$i] = 'reports/expired_report';\n $ruta_padre[$i] = 'reports-menu';\n\n\n\n\n\n\n\n /* SEPARACION MENU */\n /* --------------------------------------------------\n ---------------- MENU DE BANCOS ----------------\n ----------------------------------------------------- */\n\n $i++;\n $descripcion[$i] = 'Bancos';\n $ruta[$i] = 'banks';\n $ruta_padre[$i] = '';\n /* -------------------------------- SUBMENU -------------------------------- */\n $i++;\n $descripcion[$i] = 'Cuentas Bancarias [M. bancos]';\n $ruta[$i] = 'accounts';\n $ruta_padre[$i] = 'banks';\n $i++;\n $descripcion[$i] = 'Crear cuenta [M. bancos]';\n $ruta[$i] = 'accounts/create';\n $ruta_padre[$i] = 'banks';\n $i++;\n $descripcion[$i] = 'Modificar cuenta [M. bancos]';\n $ruta[$i] = 'accounts/edit';\n $ruta_padre[$i] = 'banks';\n $i++;\n $descripcion[$i] = 'Eliminar cuenta [M. bancos]';\n $ruta[$i] = 'accounts/delete';\n $ruta_padre[$i] = 'banks';\n $i++;\n $descripcion[$i] = 'Estado de cuenta [M. bancos]';\n $ruta[$i] = 'accounts/statement';\n $ruta_padre[$i] = 'banks';\n $i++;\n $descripcion[$i] = 'Transferencias [M. bancos]';\n $ruta[$i] = 'accounts/transfers';\n $ruta_padre[$i] = 'banks';\n\n $i++;\n $descripcion[$i] = 'Cajas [M. bancos]';\n $ruta[$i] = 'cash_register';\n $ruta_padre[$i] = 'banks';\n $i++;\n $descripcion[$i] = 'Crear caja [M. bancos]';\n $ruta[$i] = 'cash_register/create';\n $ruta_padre[$i] = 'banks';\n $i++;\n $descripcion[$i] = 'Modificar caja [M. bancos]';\n $ruta[$i] = 'cash_register/edit';\n $ruta_padre[$i] = 'banks';\n $i++;\n $descripcion[$i] = 'Eliminar caja [M. bancos]';\n $ruta[$i] = 'cash_register/delete';\n $ruta_padre[$i] = 'banks';\n $i++;\n $descripcion[$i] = 'Estado de caja [M. bancos]';\n $ruta[$i] = 'cash_register/statement';\n $ruta_padre[$i] = 'banks';\n\n $i++;\n $descripcion[$i] = 'Ver cierres de caja [M. bancos]';\n $ruta[$i] = 'desk_closing/index';\n $ruta_padre[$i] = 'banks';\n\n $i++;\n $descripcion[$i] = 'Crear cierres de caja [M. bancos]';\n $ruta[$i] = 'desk_closing/create';\n $ruta_padre[$i] = 'banks';\n\n\n\n $i++;\n $descripcion[$i] = 'Egresos de cuenta [M. bancos]';\n $ruta[$i] = 'banks/expenses';\n $ruta_padre[$i] = 'banks';\n\n $i++;\n $descripcion[$i] = 'Anular egresos de cuenta [M. bancos]';\n $ruta[$i] = 'banks/expenses/delete';\n $ruta_padre[$i] = 'banks';\n\n $i++;\n $descripcion[$i] = 'Ingresos a Caja [M. bancos]';\n $ruta[$i] = 'banks/revenues';\n $ruta_padre[$i] = 'banks';\n\n $i++;\n $descripcion[$i] = 'Depósitos [M. bancos]';\n $ruta[$i] = 'banks/deposits';\n $ruta_padre[$i] = 'banks';\n\n $i++;\n $descripcion[$i] = 'Anular ingresos de cuenta [M. bancos]';\n $ruta[$i] = 'banks/revenues/delete';\n $ruta_padre[$i] = 'banks';\n //Retenciones\n $i++;\n $descripcion[$i] = 'Retenciones';\n $ruta[$i] = 'banks/retention';\n $ruta_padre[$i] = 'banks';\n\n /* SEPARACION MENU */\n /* -------------------------------- SUBMENU -------------------------------- */\n $i++;\n $descripcion[$i] = 'Administracion [M. administracion]';\n $ruta[$i] = 'administration-menu';\n $ruta_padre[$i] = 'banks';\n $i++;\n $descripcion[$i] = 'Gastos [M. administracion]';\n $ruta[$i] = 'expenses';\n $ruta_padre[$i] = 'banks';\n $i++;\n $descripcion[$i] = 'Crear gasto [M. administracion]';\n $ruta[$i] = 'expenses/create';\n $ruta_padre[$i] = 'banks';\n\n $i++;\n $descripcion[$i] = 'Categorias de gastos [M. administracion]';\n $ruta[$i] = 'banks/expense_categories';\n $ruta_padre[$i] = 'banks';\n $i++;\n $descripcion[$i] = 'Crear categoria de gasto [M. administracion]';\n $ruta[$i] = 'banks/expense_categories/create';\n $ruta_padre[$i] = 'banks';\n\n\n\n // $i++;\n // $descripcion[$i] = 'Planilla';\n // $ruta[$i] = '';\n // $ruta_padre[$i] = 'administration-menu';\n $i++;\n $descripcion[$i] = 'Depreciaciones';\n $ruta[$i] = '';\n $ruta_padre[$i] = 'administration-menu';\n\n /* SEPARACION MENU */\n $i++;\n $descripcion[$i] = 'Graficas';\n $ruta[$i] = 'charts';\n $ruta_padre[$i] = '';\n\n\n /* SEPARACION MENU */\n /* --------------------------------------------------\n ---------------- MENU DE ANULACIONES ----------------\n ----------------------------------------------------- */\n $i++;\n $descripcion[$i] = 'Menu de anulaciones';\n $ruta[$i] = 'anulaciones-menu';\n $ruta_padre[$i] = '';\n $i++;\n $descripcion[$i] = 'Anulacion de compras [M. anulaciones]';\n $ruta[$i] = 'cancel_bill_receivings';\n $ruta_padre[$i] = 'anulaciones-menu';\n $i++;\n $descripcion[$i] = 'Compras anuladas [M. anulaciones]';\n $ruta[$i] = 'cancel_bill_receivings/report_cancel_bill_receivings';\n $ruta_padre[$i] = 'anulaciones-menu';\n $i++;\n $descripcion[$i] = 'Anulacion de ventas [M. anulaciones]';\n $ruta[$i] = 'cancel_bill';\n $ruta_padre[$i] = 'anulaciones-menu';\n $i++;\n $descripcion[$i] = 'Ventas anuladas [M. anulaciones]';\n $ruta[$i] = 'cancel_bill/report_canceled_sales';\n $ruta_padre[$i] = 'anulaciones-menu';\n /* SEPARACION MENU */\n /* --------------------------------------------------\n ---------------- MENU DE ACCESO ----------------\n ----------------------------------------------------- */\n\n $i++;\n $descripcion[$i] = 'Menu de Acceso';\n $ruta[$i] = 'access-menu';\n $ruta_padre[$i] = '';\n $i++;\n $descripcion[$i] = 'Roles [M. acceso]';\n $ruta[$i] = 'roles';\n $ruta_padre[$i] = 'access-menu';\n $i++;\n $descripcion[$i] = 'Permisos [M. acceso]';\n $ruta[$i] = 'permissions';\n $ruta_padre[$i] = 'access-menu';\n $i++;\n $descripcion[$i] = 'Usuarios Roles [M. acceso]';\n $ruta[$i] = 'user_role';\n $ruta_padre[$i] = 'access-menu';\n $i++;\n $descripcion[$i] = 'Empleados /Usuarios [M. acceso]';\n $ruta[$i] = 'employees';\n $ruta_padre[$i] = 'access-menu';\n\n /* SEPARACION MENU */\n /* --------------------------------------------------\n ---------------- MENU DE CONFIGURACION/PARAMETROS ----------------\n ----------------------------------------------------- */\n $i++;\n $descripcion[$i] = 'Menu de configuración';\n $ruta[$i] = 'parametes-menu';\n $ruta_padre[$i] = '';\n $i++;\n $descripcion[$i] = 'Listado de tipos de pago [M. parametros]';\n $ruta[$i] = 'pago';\n $ruta_padre[$i] = 'parametes-menu';\n $i++;\n $descripcion[$i] = 'Crear tipo de pago [M. parametros]';\n $ruta[$i] = 'pago/create';\n $ruta_padre[$i] = 'parametes-menu';\n $i++;\n $descripcion[$i] = 'Modificar tipo de pago [M. parametros]';\n $ruta[$i] = 'pago/edit';\n $ruta_padre[$i] = 'parametes-menu';\n $i++;\n $descripcion[$i] = 'Eliminar tipo de pago [M. parametros]';\n $ruta[$i] = 'pago/delete';\n $ruta_padre[$i] = 'parametes-menu';\n\n $i++;\n $descripcion[$i] = 'Listado de Documentos de inventario [M. configuracion]';\n $ruta[$i] = 'documents';\n $ruta_padre[$i] = 'parametes-menu';\n $i++;\n $descripcion[$i] = 'Crear documento [M. configuracion]';\n $ruta[$i] = 'documents/create';\n $ruta_padre[$i] = 'parametes-menu';\n $i++;\n $descripcion[$i] = 'Modificar documento [M. configuracion]';\n $ruta[$i] = 'documents/edit';\n $ruta_padre[$i] = 'parametes-menu';\n $i++;\n $descripcion[$i] = 'Eliminar documento [M. configuracion]';\n $ruta[$i] = 'documents/delete';\n $ruta_padre[$i] = 'parametes-menu';\n\n $i++;\n $descripcion[$i] = 'Listado de Series de doctos. [M. configuracion]';\n $ruta[$i] = 'series';\n $ruta_padre[$i] = 'parametes-menu';\n $i++;\n $descripcion[$i] = 'Crear serie [M. configuracion]';\n $ruta[$i] = 'series/create';\n $ruta_padre[$i] = 'parametes-menu';\n $i++;\n $descripcion[$i] = 'Modificar serie [M. configuracion]';\n $ruta[$i] = 'series/edit';\n $ruta_padre[$i] = 'parametes-menu';\n $i++;\n $descripcion[$i] = 'Eliminar serie [M. configuracion]';\n $ruta[$i] = 'series/delete';\n $ruta_padre[$i] = 'parametes-menu';\n\n\n $i++;\n $descripcion[$i] = 'Parametros Generales [M. configuracion]';\n $ruta[$i] = 'parameters';\n $ruta_padre[$i] = '/parameters';\n\n $i++;\n $descripcion[$i] = 'Configuración de presupuestos';\n $ruta[$i] = 'budget_config';\n $ruta_padre[$i] = '/budget_config';\n\n $i++;\n $descripcion[$i] = 'Denominación de Monedas';\n $ruta[$i] = 'typeMoney';\n $ruta_padre[$i] = '/typeMoney';\n\n\n\n\n\n\n //hacemos las inserciones dentro de la tabla\n // PERMISOS\n for ($n = 1; $n <= $i; $n++) {\n DB::table('permissions')->insert([\n 'descripcion' => $descripcion[$n],\n 'ruta' => $ruta[$n],\n 'ruta_padre' => $ruta_padre[$n],\n ]);\n }//termina el ciclo de insertar los permisos\n\n\n /* ************************************************************************************\n **************************************** ROLES ***********************************\n ************************************************************************************ */\n //Insertamos un rol administrador\n DB::table('roles')->insert([\n 'role' => 'Super Administrador',\n 'admin' => '1',\n ]);\n DB::table('roles')->insert([\n 'role' => 'Admin',\n 'admin' => '1',\n ]);\n\n //Insertamos un rol no administrador\n DB::table('roles')->insert([\n 'role' => 'Usuario',\n 'admin' => '0',\n ]);\n\n // DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Permission::query()->truncate();\n // DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n //insertamos los permisos al rol de administrador\n for ($n = 1; $n <= $i; $n++) {\n DB::table('role_permissions')->insert([\n 'id_rol' => '1',\n 'id_permission' => $n,\n 'estado_permiso' => 1,\n ]);\n\n DB::table('role_permissions')->insert([\n 'id_rol' => '2',\n 'id_permission' => $n,\n 'estado_permiso' => 1,\n ]);\n }\n\n\n }", "public function pedidos()\n {\n return $this->hasMany(Pedido::class);\n }", "public function pegaTodos(){\n\t\treturn $this->resultado->fetchAll();\n\t}", "public function listAdminAction() {\n $dons = $this->getDoctrine()->getManager()->getRepository('EasyDonBundle:Don')->findAll();\n\n return $this->render('EasyDonBundle:Don:listAdmin.html.twig', array('dons' => $dons));\n }", "function ListarPermiso()\n\t{\n\t\t$sql = \"SELECT * FROM permiso\";\n\t\treturn EjecutarConsulta($sql);\n\t}", "public function MesasPorId()\n{\n\tself::SetNames();\n\t$sql = \" select salas.codsala, salas.nombresala, salas.salacreada, mesas.codmesa, mesas.nombremesa, mesas.mesacreada, mesas.statusmesa FROM mesas INNER JOIN salas ON salas.codsala = mesas.codsala where mesas.codmesa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codmesa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function list_data_sedang_proses_admin()\n\t{\n\t\t$data['warga'] = $this->db->get_where('warga', ['id_warga' =>\n\t\t$this->session->userdata('id_warga')])->row_array();\n\t\t$data['total_notif'] = $this->m_warga->jumlah_notif()->result();\n\n\t\t$data_permohonan['data_sedang_proses'] = $this->m_warga->get_data_sedang_proses_admin()->result();\n\n\t\t$this->load->view('header');\n\t\t$this->load->view('warga/sidebar_warga', $data);\n\t\t$this->load->view('topbar', $data);\n\t\t$this->load->view('warga/list_data_permohonan_sedang_proses_admin', $data_permohonan);\n\t\t$this->load->view('footer');\n\t}", "public function PedidosDelDia()\r\n {\r\n $objetoBD = new Conexion();\r\n $objetoBD->conectar();\r\n $mysqli = $objetoBD->cadenaconexion();\r\n \r\n $consulta = \"SELECT ped_id, clie_nombres, clie_apellidos, ped_hora_entrega, ped_direccion, ped_estado\r\n FROM pedidos, clientes WHERE clientes.clie_id=pedidos.clie_id AND ped_estado='PENDIENTE' AND ped_fecha_entrega=CURDATE() GROUP BY ped_id\";\r\n $resultado = $mysqli->query($consulta);\r\n return $resultado;\r\n }", "function admin_list( $status = 'all')\n\t{\n\t\t\n\t\t$conditions = array();\n\t\t\n\t\tif($status != 'all')\n\t\t{\n\t\t\t$conditions['Order.status'] = $status;\n\t\t}\n\t\t\n\t\t$this->Order->virtualFields = array(\n\t\t\t'completed_articles_count' => '(SELECT COUNT(*) FROM writer_assignments wa1 LEFT JOIN writer_orders wo1 ON ( wa1.writer_order_id = wo1.id ) WHERE ( wo1.order_id = Order.id ) AND ( wa1.status = \"completed\" ) )'\n\t\t);\n\t\t\n\t\t$this->paginate\t= array(\n\t\t\t'conditions' \t=>\t$conditions,\n\t\t\t'limit'\t\t\t=>\t20,\n\t\t\t'recursive' \t=> 3\n\t\t);\n\t\t\n \t$orders =\t$this->paginate('Order');\t\t\n\t\t\n\t\t$this->set('orders', $orders);\t\t\n\t\t$this->set('status', $status);\n\t\t\t\t\n\t}", "public function index($Id_Pedido, $tipo = '')\r\n\t{\r\n\t\t\r\n\t\t$Permitido = array('Gerencia' => '', 'Plani' => '', 'Sistemas' => '', 'Ventas' => '');\r\n\t\t$this->ver_sesion_m->acceso($Permitido);\r\n\t\t\r\n\t\t\r\n\t\t//Super validacion\r\n\t\t$Id_Pedido += 0;\r\n\t\tif(0 == $Id_Pedido)\r\n\t\t{\r\n\t\t\tshow_404();\r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//Validacion: Solo los pedidos que estan en proceso pueden ser modificados\r\n\t\t//en sus especificaciones\r\n\t\t//Modelo que verifica si tiene ruta sin finalizar este proceso\r\n\t\t$this->load->model('pedidos/procesando_m', 'procesando');\r\n\t\t//Se realiza la verificacion\r\n\t\t$Estado = $this->procesando->pedido($Id_Pedido);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$Variables = array(\r\n\t\t\t'Titulo_Pagina' => 'Modificar Hoja de Planificaci&oacute;n',\r\n\t\t\t'Mensaje' => '',\r\n\t\t\t'Id_Pedido' => $Id_Pedido\r\n\t\t);\r\n\t\t\r\n\t\t\r\n\t\t//Extraemos toda la informacion del proceso\r\n\t\t$this->load->model('procesos/buscar_proceso_m', 'buscar_proc');\r\n\t\t\r\n\t\t$Variables['Info_Proceso'] = $this->buscar_proc->busqueda_pedido($Id_Pedido);\r\n\t\t\r\n\t\tif(0 == $Variables['Info_Proceso'])\r\n\t\t{\r\n\t\t\tshow_404();\r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//Si es un cliente, no debe ver cosas prohibidas\r\n\t\t$this->ver_sesion_m->solo_un_cliente(\r\n\t\t\t$Variables['Info_Proceso']['id_cliente']\r\n\t\t);\r\n\t\t\r\n\t\t\r\n\t\t//Tipos de impresion para las especificaciones\r\n\t\t$this->load->model('pedidos/tipo_impresion_m', 'timpresion');\r\n\t\t$Variables['Tipos_Impresion'] = $this->timpresion->tipos();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//Cargamos la vista para el encabezado.\r\n\t\t$this->load->view('encabezado_v', $Variables);\r\n\t\t\r\n\t\t\r\n\t\t//Especificaciones del pedido a modificar\r\n\t\t$this->load->model('pedidos/especificacion_informacion_m', 'esp_inf');\r\n\t\t\r\n\t\t\r\n\t\t$Variables['Especs'] = $this->esp_inf->pedido($Id_Pedido);\r\n\t\t\r\n\t\t\r\n\t\t//Listado de los materiales recibidos y solicitados\r\n\t\t$this->load->model('pedidos/materiales_m', 'materiales');\r\n\t\t$Variables['Mat_Recibido'] = $this->materiales->recibidos('s');\r\n\t\t$Variables['Mat_Solicitado'] = $this->materiales->solicitados('s');\r\n\t\t\r\n\t\t\r\n\t\t//Materiales de impresion digital\r\n\t\t$this->load->model('pedidos/impresion_digital_m', 'matdigi');\r\n\t\t$Variables['Tipo_Acabado'] = $this->matdigi->tipo_impd_acabado();\r\n\t\t$Variables['Tipo_Material'] = $this->matdigi->tipo_impd_material();\r\n\t\t$Variables['eleccion'] = '';\r\n\t\t/*\r\n\t\t$this->load->model('pedidos/enlaces_m', 'enlace');\r\n\t\t$Variables['Hijo'] = $this->enlace->es_hijo($Id_Pedido);\r\n\t\t*/\r\n\t\t$Variables['tipo'] = $tipo;\r\n\t\t\r\n\t\t\r\n\t\t/*\r\n\t\tif(isset($Variables['Hijo']['id_pedido_pedido']))\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$Variables['Especs'] = $this->esp_inf->pedido(\r\n\t\t\t\t$Id_Pedido,\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'matrecgru' => array(),\r\n\t\t\t\t\t'matsolgru' => array()\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$Variables['Especs'] = $Variables['Especs'] + $this->esp_inf->pedido(\r\n\t\t\t\t$Variables['Hijo']['id_ped_primario'],\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'general' => array(),\r\n\t\t\t\t\t'colores' => array(),\r\n\t\t\t\t\t'distorsion' => array(),\r\n\t\t\t\t\t'guias' => array()\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\t\r\n\t\t}\r\n\t\t*/\r\n\r\n\r\n\r\n\t\t$Consulta = '\r\n\t\t\tselect maquina\r\n\t\t\tfrom cliente_maquina\r\n\t\t\twhere id_cliente = \"'.$Variables['Info_Proceso']['id_cliente'].'\"\r\n\t\t';\r\n\t\t$Resultado = $this->db->query($Consulta);\r\n\r\n\t\t$Variables['Maquinas'] = array();\r\n\t\tforeach ($Resultado->result_array() as $Fila)\r\n\t\t{\r\n\t\t\t$Variables['Maquinas'][] = $Fila['maquina'];\r\n\t\t}\r\n\t\t\r\n\t\t$this->load->view('pedidos/especificacion_modificar_repro_v', $Variables);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//Cargamos la vista para el pie de pagina.\r\n\t\t$this->load->view('pie_v');\r\n\t\t\r\n\t\t\r\n\t}", "public function listar(){\n require_once 'models/Nota.php';\n \n //Lógica acción controlador\n $nota = new Nota();\n \n $notas = $nota->conseguirTodos('notas');\n \n //Vista\n require_once 'views/nota/listar.php';\n \n }", "public function listaProveedores(){\n\n $respuesta = Datos::mdlListaProvedores(\"proveedores\");\n $cont =0;\n\n foreach ($respuesta as $row => $item){\n \t$cont ++;\n\n\n echo '<tr>\n <td>'.$cont.'</td>\n <td>'.$item[\"codProveedor\"].'</td>\n <td>'.$item[\"nombre\"].'</td>\n <td>'.$item[\"razonSocial\"].'</td>\n <td>'.$item[\"rfc\"].'</td>\n <td>'.$item[\"direccion\"].'</td>\n <td>'.$item[\"ubicacion\"].'</td>\n <td>'.$item[\"telefono\"].'</td>\n <td>'.$item[\"celular\"].'</td>\n <td>'.$item[\"contacto\"].'</td>\n <td><a href=\"updtProveedor.php?idEditar='.$item[\"id\"].'\"><button class=\"btn btn-warning\">Editar</button></a></td>\n <td><a href=\"listaProveedores.php?idBorrar='.$item[\"id\"].'\" ><button class=\"btn btn-danger\">Borrar</button></a></td>\n </tr>';\n }\n\n }", "public function findAllAdmin() {\n\t\t\t$result = $this->createQuery()->execute();\n\t\t\treturn $result;\n\t\t}", "public function indexHistorialAdmin()\n { \n \n $username = $this->getRequest()->getSession()->read('id'); //obtiene el nombre de usuario actualmente logueado\n \n /*Inicia seguridad*/\n $seguridad = $this->loadModel('Seguridad');\n $carne = $this->request->getSession()->read('id');\n $rolActual = $seguridad->getRol($carne);\n if ($carne != ''){\n $resultado = $seguridad->getPermiso($carne,13);\n $rolAdecuado = false;\n if($rolActual == 1 || $rolActual == 2){\n $rolAdecuado = true;\n }\n if($resultado != 1 || !$rolAdecuado){\n return $this->redirect(['controller' => 'Inicio','action' => 'fail']);\n }\n }\n else{\n return $this->redirect(['controller' => 'Inicio','action' => 'fail']);\n\n }\n /*Cierra la seguridad*/\n \n $idActual = $this->Solicitudes->getIDUsuario($username); //obtiene el id de usuario actualmente logueado\n \n $todo = $this->Solicitudes->getIndexValues(); //carga el index con todas las solicitudes existentes \n \n \n $this->paginate = [\n 'contain' => ['Usuarios', 'Grupos']\n ];\n $estado = $this->get_estado_ronda();\n $this->set(compact('todo','estado'));\n $this->set('rolActual',$rolActual);\n }", "function alta_compra_multiple(){\n\t\t$u= new Pr_pedido_multiple();\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->empresas_id=$GLOBALS['empresa_id'];\n\t\t$usuario=$this->usuario->get_usuario($GLOBALS['usuarioid']);\n\t\t$fecha_entrega=explode(\" \", $_POST['fecha_entrega']);\n\t\t$u->fecha_entrega=\"\".$fecha_entrega[2].\"-\".$fecha_entrega[1].\"-\".$fecha_entrega[0] ;\n\t\t$u->fecha_pago=$u->fecha_entrega;\n\t\tunset($_POST['fecha_entrega']); unset($_POST['']); unset($_POST['fecha_pago']);\n\t\t$x=0; $efisicos=array();\n\t\tfor($x;$x<100;$x++){\n\n\t\t\tif(isset($_POST['chk'.$x])){\n\t\t\t\t$efisicos[$x]=$_POST['chk'.$x];\n\t\t\t\tunset($_POST['chk'.$x]);\n\t\t\t\t//echo $efisicos[$x].\",\";\n\n\t\t\t}\n\t\t}\n\t\t//print_r($_POST);\n\t\tif(count($efisicos>0)){\n\t\t\t$u->espacios_fisicos=implode(',',$efisicos);\n\t\t} else {\n\t\t\t$u->espacios_fisicos='';\n\t\t}\n\t\t$related = $u->from_array($_POST);\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\techo '<button type=\"submit\" id=\"boton1\" style=\"display:none;\">Actualizar Registro</button>';\n\t\t\techo \"<p id=\\\"response\\\">Datos Generales Guardados<br/><b>Capturar los detalles del pedido</b></p>\";\n\t\t} else {\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "public function getAll(){\n //hacemos la consulta y lo guardamos en una variable\n $productos=$this->db->query(\"SELECT * FROM pedidos order by id desc;\");\n //devolvemos un valor en especifico.\n return $productos;\n }", "public function pedidosHoy()\n {\n $pedidos = \\App\\Pedido::with('usuario')\n ->with('repartidor')\n ->with('productos.establecimiento')\n ->where(DB::raw('DAY(created_at)'),DB::raw('DAY(now())'))\n ->where(DB::raw('MONTH(created_at)'),DB::raw('MONTH(now())'))\n ->where(DB::raw('YEAR(created_at)'),DB::raw('YEAR(now())'))\n ->orderBy('id', 'desc')\n ->get();\n\n if(count($pedidos) == 0){\n return response()->json(['error'=>'No existen pedidos para hoy.'], 404); \n }else{\n return response()->json(['pedidos'=>$pedidos], 200);\n } \n }", "public function pesquisar($nome){\n $equipamento = new Equipamento();\n // Recuperar dados\n $lista = $equipamento->filterEquipamentos($nome);\n $hrefs = array();\n foreach ($lista as $key => $value) {\n array_push($hrefs, \"router.php?page=manutencoes&nome=\".$value['id']);\n }\n include 'view/admin/lista.php';\n }", "public function listarParaUnirP() {\n\t\t//de sesion, falta cambiar\n\t\t$juradoL = $this -> JuradoMapper -> findAllPro();\n\n\t\t$this -> view -> setVariable(\"jurado\", $juradoL);\n\t\t//falta agregar la vista, no se continuar\n\t\t$this -> view -> render(\"jurado\", \"listarParaPincho\");\n\t\t//falta cambiar\n\t}", "public function ListarMostrador()\n\t{\n\t\tself::SetNames();\n\t$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente as cliente, ventas.codmesa, ventas.totalpago, ventas.cocinero, ventas.delivery, ventas.repartidor, ventas.observaciones, clientes.codcliente, clientes.cedcliente, clientes.nomcliente, salas.nombresala, mesas.nombremesa, GROUP_CONCAT(cantventa, ' | ', producto SEPARATOR '<br>') AS detalles FROM ventas INNER JOIN detalleventas ON detalleventas.codventa = ventas.codventa LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente LEFT JOIN mesas ON mesas.codmesa = ventas.codmesa LEFT JOIN salas ON mesas.codsala = salas.codsala WHERE ventas.cocinero = '1' GROUP BY detalleventas.codventa\";\n foreach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\treturn $this->p;\n\t\t$this->dbh=null;\n\t}", "public function listar() {\n\t\t//Esta funcion solo la puede hacer el organizador, hay que poner al inicio de todo una comprobacion\n\t\t//de sesion, falta cambiar\n\t\t$juradoL = $this -> JuradoMapper -> findAll();\n\t\t$this -> view -> setVariable(\"jurado\", $juradoL);\n\t\t//falta agregar la vista, no se continuar\n\t\t$this -> view -> render(\"jurado\", \"listar\");\n\t\t//falta cambiar\n\t}", "function listar2()\n\t{\n\t\t\n\t\t\t$permiso_sede = $this->session->userdata('sede');\n\t\t\t//GROCERY CRUD SETUP\n\t\t\t$crud = new grocery_CRUD();\n\t\t\t$crud->set_table('entregas');\n\t\t\t$crud->where('entregas.id_sede',$permiso_sede);\n\t\t\t$crud->set_language('spanish');\n\t\t\t$crud->set_relation('id_equipo','equipos','codigo_equipo');\n\t\t\t\t\t\n\t\t\t$crud->unset_delete();\n\t\t\t$crud->columns('id_insumo','id_equipo','id_sector','fecha_entrega','estado','observaciones','usuario_entrega');\n\t\t\t$crud->add_fields('id_sede','id_sector','estado','id_insumo','id_equipo','fecha_entrega','observaciones','nro_ticket','usuario_entrega', 'cantidad');\n\t\t\t\n\t\t\t$crud->display_as('id_insumo','Insumo')\n\t\t\t\t ->display_as('id_equipo','Equipo')\n\t\t\t\t ->display_as('id_sector','Sector');\n\t\t\t$crud->set_subject('Entrega');\n\t\t\t\n\t\t\t$crud->set_relation('id_insumo','Insumos','codigo_insumo');\n\t\t\t\n\t\t\t//anulo todas las acciones salvo agregar para usar solo el crud definido en listar\n\t\t\t $crud->unset_list(); \n\t\t\t $crud->unset_delete();\n \t $crud->unset_read();\n $crud->unset_edit();\n $crud->unset_export();\n $crud->unset_print();\n\t\t\t\n\t\t\t//por algun no olcutaba el campo preguntando si el estado era add y era a causa del relation... y como la necestio en list y edit lo deje asi\n\t\t\tif ($crud->getState() != 'add') \n{\n\t $crud->set_relation('estado','parametros','valor','nombre_parametro=\"estado_entrega\"');\n\t \n\t\n}\n// idem estado pero con sector\n\t\t\tif (($crud->getState() != 'add') and ($crud->getState() != 'edit'))\n{\n\t \n\t $crud->set_relation('id_sector','sectores','nombre_sector');\n\t\n}\n\n\t\t\tif ($crud->getState() == 'add') \n{\n\n$crud->change_field_type('id_sector','invisible');\n$crud->change_field_type('estado','invisible');\n $crud->change_field_type('id_sede','invisible');\n $crud->change_field_type('usuario_entrega','invisible');\n $crud->change_field_type('fecha_entrega','invisible');\n $crud->change_field_type('cantidad','invisible');\n \n}\n\t\t\tif ($this->grocery_crud->getState() == 'edit') \n{\n\t$uri = $this->uri->segment(3);\n $this->session->set_userdata('insumo_actual', $uri);\n $crud->change_field_type('id_sede','invisible');\n $crud->change_field_type('usuario_entrega','invisible');\n $crud->change_field_type('fecha_entrega','invisible');\n $crud->change_field_type('id_sector','invisible');\n $crud->change_field_type('cantidad','invisible');\n \t\n \n}\n\t\t\t\n\t\t\t//IF YOU HAVE A LARGE AMOUNT OF DATA, ENABLE THE CALLBACKS BELOW - FOR EXAMPLE ONE USER HAD 36000 CITIES AND SLOWERD UP THE LOADING PROCESS. THESE CALLBACKS WILL LOAD EMPTY SELECT FIELDS THEN POPULATE THEM AFTERWARDS\n\t\t\n\t\t $crud->callback_add_field('id_equipo', array($this, 'empty_state_dropdown_select1'));\n\t\t //si no viene del abm insumos la variable de arriba trae el valor \"add\" caso contrario trae id de insumo y ahi llamo al callback\n\t\t if ($this->uri->segment(3) != \"add\")\n\t\t {$crud->callback_add_field('id_insumo', array($this, 'carga_insumo1'));}\n\t\t\t\n\t\t\t$crud->callback_edit_field('id_equipo', array($this, 'empty_state_dropdown_select1'));\n\t\t\t$crud->callback_after_insert(array($this, 'after_insert1'));\n\t\t\t$crud->callback_before_update(array($this,'before_update1'));\n\t\t\t$crud->callback_before_insert(array($this,'before_insert1')); \t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\ttry {\n \n $output = $crud->render(); //this will raise an exception when the action is list\n\n //$this->template->load('template', 'default_view', $output);\n \n } catch (Exception $e) {\n\n if ($e->getCode() == 14) { //The 14 is the code of the error on grocery CRUD (don't have permission).\n //redirect using your user id\n redirect(strtolower(__CLASS__) . '/listar');\n \n } else {\n show_error($e->getMessage());\n return false;\n }\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t//DEPENDENT DROPDOWN SETUP\n\t\t\t$dd_data = array(\n\t\t\t\t//GET THE STATE OF THE CURRENT PAGE - E.G LIST | ADD\n\t\t\t\t'dd_state' => $crud->getState(),\n\t\t\t\t//SETUP YOUR DROPDOWNS\n\t\t\t\t//Parent field item always listed first in array, in this case countryID\n\t\t\t\t//Child field items need to follow in order, e.g stateID then cityID\n\t\t\t\t'dd_dropdowns' => array('id_insumo','id_equipo'),\n\t\t\t\t//SETUP URL POST FOR EACH CHILD\n\t\t\t\t//List in order as per above\n\t\t\t\t'dd_url' => array('', site_url().'/entregas/get_states1/'),\n\t\t\t\t//LOADER THAT GETS DISPLAYED NEXT TO THE PARENT DROPDOWN WHILE THE CHILD LOADS\n\t\t\t\t'dd_ajax_loader' => base_url().'ajax-loader.gif'\n\t\t\t);\n\t\t\t$output->dropdown_setup = $dd_data;\n\t\t\t$output->content_view='crud_content_view';\n\t\t\t$this->_example_output($output);\n\t}", "public function pesquisarAlunoAction() {\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 $params['limit'] = 5; \r\n \r\n $this->view->dataGrid = $this->_helper->util->utf8Encode($this->alunoDbTable->getDataGrid($params)); \r\n } catch (Exception $e) { \r\n echo $e->getMessage();\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 }", "public function todos()\n {\n // Comprobar si esta logeado como admin\n if( isset($_SESSION['admin']) ){\n\n // La cantidad de tipos de reporte que va a mostrar\n $numeroTiposReporte = 5;\n\n // Obtener que numero de pagina es\n $pagina = ( isset($_GET['pagina']) ? $_GET['pagina'] : 1 );\n\n // Conocer el inicio de la consulta\n $inicioConsulta = ( ($pagina == 1) ? 0 : (($numeroTiposReporte * $pagina) - $numeroTiposReporte) );\n\n // Contar la cantidad de tipos de reporte\n $totalTiposReporte = count(TipoReporte::todos());\n\n // El numero de paginas que salen en total\n $cantidadDePaginas = ( ($totalTiposReporte == 0) ? 1 : ceil($totalTiposReporte / $numeroTiposReporte) );\n\n\n // Peticion al modelo para recuperar todos los tipos de reporte de la bd y guardarlos en una variable\n $tiposReporte = TipoReporte::limite($inicioConsulta, $numeroTiposReporte)\n ->resultado();\n\n\n\n // Mensaje\n $msg = ( isset($_COOKIE['mensaje']) ? $_COOKIE['mensaje'] : null);\n\n // Mensaje Error\n $msgError = ( isset($_COOKIE['mensaje_error']) ? $_COOKIE['mensaje_error'] : null);\n\n\n // Requerir la vista que muestra todos los usuarios registrados\n include '../vistas/tipos_reporte/index.php';\n\n } else {\n\n // Redirigir al login\n header('Location: ../login');\n }\n }", "public function listAction($idEmpresa = '') {\n\n if ($this->values['permisos']['permisosModulo']['CO']) {\n if ($idEmpresa == '')\n $idEmpresa = $this->request[2];\n\n $objetoNuevo = new $this->entity();\n $objetoNuevo->setIDEmpresa($idEmpresa);\n $lineas[] = $objetoNuevo;\n unset($objetoNuevo);\n\n $lis = new $this->entity();\n $rows = $lis->cargaCondicion('Id', \"IdEmpresa='{$idEmpresa}' AND IdUsuario<>'1'\", 'Id ASC');\n unset($lis);\n foreach ($rows as $row) {\n $lineas[] = new $this->entity($row['Id']);\n }\n\n $this->values['linkBy']['value'] = $idEmpresa;\n $this->values['listado']['data'] = $lineas;\n\n unset($lineas);\n\n return array('template' => $this->entity . '/form.html.twig', 'values' => $this->values);\n } else {\n return array('template' => '_global/forbiden.html.twig');\n }\n }", "public function MediosPagosPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from mediospagos where codmediopago = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codmediopago\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function run()\n {\n // base tables\n Encore\\Admin\\Auth\\Database\\Menu::truncate();\n Encore\\Admin\\Auth\\Database\\Menu::insert(\n [\n [\n \"id\" => 1,\n \"parent_id\" => 0,\n \"order\" => 1,\n \"title\" => \"控制台\",\n \"icon\" => \"fa-dashboard\",\n \"uri\" => \"/\",\n \"permission\" => NULL,\n \"created_at\" => NULL,\n \"updated_at\" => \"2019-04-17 15:15:38\"\n ],\n [\n \"id\" => 2,\n \"parent_id\" => 0,\n \"order\" => 25,\n \"title\" => \"管理员\",\n \"icon\" => \"fa-tasks\",\n \"uri\" => NULL,\n \"permission\" => \"auth.management\",\n \"created_at\" => NULL,\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 3,\n \"parent_id\" => 2,\n \"order\" => 26,\n \"title\" => \"用户\",\n \"icon\" => \"fa-users\",\n \"uri\" => \"auth/users\",\n \"permission\" => NULL,\n \"created_at\" => NULL,\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 4,\n \"parent_id\" => 2,\n \"order\" => 27,\n \"title\" => \"角色\",\n \"icon\" => \"fa-user\",\n \"uri\" => \"auth/roles\",\n \"permission\" => NULL,\n \"created_at\" => NULL,\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 5,\n \"parent_id\" => 2,\n \"order\" => 28,\n \"title\" => \"权限\",\n \"icon\" => \"fa-ban\",\n \"uri\" => \"auth/permissions\",\n \"permission\" => NULL,\n \"created_at\" => NULL,\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 6,\n \"parent_id\" => 2,\n \"order\" => 29,\n \"title\" => \"菜单\",\n \"icon\" => \"fa-bars\",\n \"uri\" => \"auth/menu\",\n \"permission\" => NULL,\n \"created_at\" => NULL,\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 7,\n \"parent_id\" => 2,\n \"order\" => 30,\n \"title\" => \"操作日志\",\n \"icon\" => \"fa-history\",\n \"uri\" => \"auth/logs\",\n \"permission\" => NULL,\n \"created_at\" => NULL,\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 13,\n \"parent_id\" => 0,\n \"order\" => 2,\n \"title\" => \"玩家\",\n \"icon\" => \"fa-user-md\",\n \"uri\" => \"admin/player\",\n \"permission\" => \"player.management\",\n \"created_at\" => \"2019-04-17 14:40:44\",\n \"updated_at\" => \"2019-05-16 17:18:51\"\n ],\n [\n \"id\" => 14,\n \"parent_id\" => 13,\n \"order\" => 4,\n \"title\" => \"查询\",\n \"icon\" => \"fa-search\",\n \"uri\" => \"player/search\",\n \"permission\" => NULL,\n \"created_at\" => \"2019-04-17 14:41:54\",\n \"updated_at\" => \"2019-05-14 09:38:30\"\n ],\n [\n \"id\" => 15,\n \"parent_id\" => 13,\n \"order\" => 3,\n \"title\" => \"排行榜\",\n \"icon\" => \"fa-list-ol\",\n \"uri\" => \"player/ranks\",\n \"permission\" => NULL,\n \"created_at\" => \"2019-04-17 14:42:50\",\n \"updated_at\" => \"2019-05-14 09:38:30\"\n ],\n [\n \"id\" => 16,\n \"parent_id\" => 0,\n \"order\" => 8,\n \"title\" => \"公会\",\n \"icon\" => \"fa-bank\",\n \"uri\" => \"admin/guild\",\n \"permission\" => \"guild.management\",\n \"created_at\" => \"2019-04-17 14:47:21\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 17,\n \"parent_id\" => 16,\n \"order\" => 10,\n \"title\" => \"查询\",\n \"icon\" => \"fa-search\",\n \"uri\" => \"guild/search\",\n \"permission\" => NULL,\n \"created_at\" => \"2019-04-17 14:48:13\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 18,\n \"parent_id\" => 16,\n \"order\" => 9,\n \"title\" => \"排行榜\",\n \"icon\" => \"fa-list-ol\",\n \"uri\" => \"guild/ranks\",\n \"permission\" => NULL,\n \"created_at\" => \"2019-04-17 14:48:53\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 19,\n \"parent_id\" => 0,\n \"order\" => 12,\n \"title\" => \"邮件\",\n \"icon\" => \"fa-envelope\",\n \"uri\" => \"mail\",\n \"permission\" => \"mail.managerment\",\n \"created_at\" => \"2019-04-17 14:52:41\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 20,\n \"parent_id\" => 0,\n \"order\" => 13,\n \"title\" => \"公告\",\n \"icon\" => \"fa-bullhorn\",\n \"uri\" => \"notice\",\n \"permission\" => \"notice.management\",\n \"created_at\" => \"2019-04-17 14:54:36\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 21,\n \"parent_id\" => 0,\n \"order\" => 14,\n \"title\" => \"礼包\",\n \"icon\" => \"fa-briefcase\",\n \"uri\" => \"gcode\",\n \"permission\" => \"gcode.management\",\n \"created_at\" => \"2019-04-17 14:58:37\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 28,\n \"parent_id\" => 13,\n \"order\" => 5,\n \"title\" => \"宠物\",\n \"icon\" => \"fa-linux\",\n \"uri\" => \"player/pets\",\n \"permission\" => NULL,\n \"created_at\" => \"2019-04-29 17:28:09\",\n \"updated_at\" => \"2019-04-30 12:53:53\"\n ],\n [\n \"id\" => 29,\n \"parent_id\" => 13,\n \"order\" => 6,\n \"title\" => \"道具\",\n \"icon\" => \"fa-shopping-bag\",\n \"uri\" => \"player/items\",\n \"permission\" => NULL,\n \"created_at\" => \"2019-04-29 18:36:40\",\n \"updated_at\" => \"2019-04-30 12:53:53\"\n ],\n [\n \"id\" => 30,\n \"parent_id\" => 16,\n \"order\" => 11,\n \"title\" => \"成员\",\n \"icon\" => \"fa-users\",\n \"uri\" => \"guild/members\",\n \"permission\" => NULL,\n \"created_at\" => \"2019-05-05 11:23:32\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 32,\n \"parent_id\" => 0,\n \"order\" => 15,\n \"title\" => \"脚本\",\n \"icon\" => \"fa-scribd\",\n \"uri\" => \"script\",\n \"permission\" => \"script.management\",\n \"created_at\" => \"2019-05-13 11:40:38\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 33,\n \"parent_id\" => 0,\n \"order\" => 16,\n \"title\" => \"运维\",\n \"icon\" => \"fa-opera\",\n \"uri\" => NULL,\n \"permission\" => \"om.management\",\n \"created_at\" => \"2019-05-25 23:57:21\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 34,\n \"parent_id\" => 33,\n \"order\" => 17,\n \"title\" => \"计划\",\n \"icon\" => \"fa-calendar\",\n \"uri\" => \"om/schedules\",\n \"permission\" => \"om.management\",\n \"created_at\" => \"2019-05-25 23:58:18\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 36,\n \"parent_id\" => 33,\n \"order\" => 21,\n \"title\" => \"区服列表\",\n \"icon\" => \"fa-navicon\",\n \"uri\" => \"om/servers\",\n \"permission\" => \"om.management\",\n \"created_at\" => \"2019-05-26 00:02:55\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 38,\n \"parent_id\" => 33,\n \"order\" => 20,\n \"title\" => \"公告\",\n \"icon\" => \"fa-bullhorn\",\n \"uri\" => \"om/notices\",\n \"permission\" => NULL,\n \"created_at\" => \"2019-05-26 01:37:14\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 39,\n \"parent_id\" => 33,\n \"order\" => 18,\n \"title\" => \"开服\",\n \"icon\" => \"fa-plane\",\n \"uri\" => \"om/startserver\",\n \"permission\" => \"om.management\",\n \"created_at\" => \"2019-06-12 18:04:25\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 40,\n \"parent_id\" => 33,\n \"order\" => 19,\n \"title\" => \"补丁\",\n \"icon\" => \"fa-plus\",\n \"uri\" => \"/om/patches\",\n \"permission\" => \"om.management\",\n \"created_at\" => \"2019-08-12 10:25:35\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 42,\n \"parent_id\" => 33,\n \"order\" => 22,\n \"title\" => \"提审切换\",\n \"icon\" => \"fa-android\",\n \"uri\" => \"/om/audit\",\n \"permission\" => \"om.management\",\n \"created_at\" => \"2019-10-31 15:46:20\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 43,\n \"parent_id\" => 33,\n \"order\" => 23,\n \"title\" => \"商品配置\",\n \"icon\" => \"fa-shopping-cart\",\n \"uri\" => \"/om/products\",\n \"permission\" => \"om.management\",\n \"created_at\" => \"2019-11-05 20:56:01\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 44,\n \"parent_id\" => 33,\n \"order\" => 24,\n \"title\" => \"客户端补丁\",\n \"icon\" => \"fa-bars\",\n \"uri\" => \"om/clientpatch\",\n \"permission\" => \"om.management\",\n \"created_at\" => \"2019-11-21 17:26:15\",\n \"updated_at\" => \"2020-03-05 17:26:22\"\n ],\n [\n \"id\" => 45,\n \"parent_id\" => 0,\n \"order\" => 7,\n \"title\" => \"删除玩家道具\",\n \"icon\" => \"fa-cut\",\n \"uri\" => \"remove_items\",\n \"permission\" => NULL,\n \"created_at\" => \"2020-03-05 17:26:06\",\n \"updated_at\" => \"2020-03-05 17:38:30\"\n ],\n [\n \"id\" => 46,\n \"parent_id\" => 13,\n \"order\" => 0,\n \"title\" => \"反馈\",\n \"icon\" => \"fa-amazon\",\n \"uri\" => \"/player/feedbacks\",\n \"permission\" => NULL,\n \"created_at\" => \"2020-03-09 15:34:25\",\n \"updated_at\" => \"2020-03-09 15:34:25\"\n ]\n ]\n );\n\n Encore\\Admin\\Auth\\Database\\Permission::truncate();\n Encore\\Admin\\Auth\\Database\\Permission::insert(\n [\n [\n \"id\" => 1,\n \"name\" => \"All permission\",\n \"slug\" => \"*\",\n \"http_method\" => \"\",\n \"http_path\" => \"*\",\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"id\" => 2,\n \"name\" => \"Dashboard\",\n \"slug\" => \"dashboard\",\n \"http_method\" => \"GET\",\n \"http_path\" => \"/\",\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"id\" => 3,\n \"name\" => \"Login\",\n \"slug\" => \"auth.login\",\n \"http_method\" => \"\",\n \"http_path\" => \"/auth/login\\r\\n/auth/logout\",\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"id\" => 4,\n \"name\" => \"User setting\",\n \"slug\" => \"auth.setting\",\n \"http_method\" => \"GET,PUT\",\n \"http_path\" => \"/auth/setting\",\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"id\" => 5,\n \"name\" => \"Auth management\",\n \"slug\" => \"auth.management\",\n \"http_method\" => \"\",\n \"http_path\" => \"/auth/roles\\r\\n/auth/permissions\\r\\n/auth/menu\\r\\n/auth/logs\",\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"id\" => 7,\n \"name\" => \"Zone setting\",\n \"slug\" => \"zone.setting\",\n \"http_method\" => \"\",\n \"http_path\" => \"/zone*\",\n \"created_at\" => \"2019-05-16 16:50:06\",\n \"updated_at\" => \"2019-05-16 17:10:23\"\n ],\n [\n \"id\" => 8,\n \"name\" => \"Player management\",\n \"slug\" => \"player.management\",\n \"http_method\" => \"\",\n \"http_path\" => \"/player*\",\n \"created_at\" => \"2019-05-16 16:59:41\",\n \"updated_at\" => \"2019-05-16 17:08:03\"\n ],\n [\n \"id\" => 9,\n \"name\" => \"Guild management\",\n \"slug\" => \"guild.management\",\n \"http_method\" => \"\",\n \"http_path\" => \"/guild*\",\n \"created_at\" => \"2019-05-16 17:06:36\",\n \"updated_at\" => \"2019-05-16 17:08:11\"\n ],\n [\n \"id\" => 10,\n \"name\" => \"Mail management\",\n \"slug\" => \"mail.managerment\",\n \"http_method\" => \"\",\n \"http_path\" => \"/mail*\",\n \"created_at\" => \"2019-05-16 17:07:49\",\n \"updated_at\" => \"2019-05-16 17:07:49\"\n ],\n [\n \"id\" => 11,\n \"name\" => \"Notice management\",\n \"slug\" => \"notice.management\",\n \"http_method\" => \"\",\n \"http_path\" => \"/notice*\",\n \"created_at\" => \"2019-05-16 17:08:39\",\n \"updated_at\" => \"2019-05-16 17:08:39\"\n ],\n [\n \"id\" => 12,\n \"name\" => \"GCode management\",\n \"slug\" => \"gcode.management\",\n \"http_method\" => \"\",\n \"http_path\" => \"/gcode*\",\n \"created_at\" => \"2019-05-16 17:09:10\",\n \"updated_at\" => \"2019-05-16 17:09:10\"\n ],\n [\n \"id\" => 13,\n \"name\" => \"Script management\",\n \"slug\" => \"script.management\",\n \"http_method\" => \"\",\n \"http_path\" => \"/script*\",\n \"created_at\" => \"2019-05-16 17:09:36\",\n \"updated_at\" => \"2019-05-16 17:09:36\"\n ],\n [\n \"id\" => 14,\n \"name\" => \"O&M management\",\n \"slug\" => \"om.management\",\n \"http_method\" => \"\",\n \"http_path\" => \"/om*\",\n \"created_at\" => \"2019-05-26 00:00:39\",\n \"updated_at\" => \"2019-05-26 00:01:24\"\n ],\n [\n \"id\" => 15,\n \"name\" => \"Scheduling\",\n \"slug\" => \"ext.scheduling\",\n \"http_method\" => NULL,\n \"http_path\" => \"/scheduling*\",\n \"created_at\" => \"2019-05-26 00:03:43\",\n \"updated_at\" => \"2019-05-26 00:03:43\"\n ],\n [\n \"id\" => 16,\n \"name\" => \"RemoveItem manage\",\n \"slug\" => \"remove_item.management\",\n \"http_method\" => \"\",\n \"http_path\" => \"/removeitem*\",\n \"created_at\" => \"2020-03-05 17:36:16\",\n \"updated_at\" => \"2020-03-05 17:36:16\"\n ]\n ]\n );\n\n Encore\\Admin\\Auth\\Database\\Role::truncate();\n Encore\\Admin\\Auth\\Database\\Role::insert(\n [\n [\n \"id\" => 1,\n \"name\" => \"Administrator\",\n \"slug\" => \"administrator\",\n \"created_at\" => \"2019-03-12 16:39:11\",\n \"updated_at\" => \"2019-03-12 16:39:11\"\n ],\n [\n \"id\" => 2,\n \"name\" => \"Development Engineer\",\n \"slug\" => \"dev\",\n \"created_at\" => \"2019-05-16 16:45:20\",\n \"updated_at\" => \"2019-05-16 16:45:43\"\n ],\n [\n \"id\" => 3,\n \"name\" => \"Operators\",\n \"slug\" => \"ops\",\n \"created_at\" => \"2019-05-16 17:12:11\",\n \"updated_at\" => \"2019-05-16 17:12:11\"\n ]\n ]\n );\n\n // pivot tables\n DB::table('admin_role_menu')->truncate();\n DB::table('admin_role_menu')->insert(\n [\n [\n \"role_id\" => 3,\n \"menu_id\" => 38,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 1,\n \"menu_id\" => 45,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 2,\n \"menu_id\" => 45,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 3,\n \"menu_id\" => 45,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ]\n ]\n );\n\n DB::table('admin_role_permissions')->truncate();\n DB::table('admin_role_permissions')->insert(\n [\n [\n \"role_id\" => 1,\n \"permission_id\" => 1,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 2,\n \"permission_id\" => 7,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 2,\n \"permission_id\" => 4,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 2,\n \"permission_id\" => 3,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 2,\n \"permission_id\" => 2,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 2,\n \"permission_id\" => 8,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 2,\n \"permission_id\" => 9,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 2,\n \"permission_id\" => 10,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 2,\n \"permission_id\" => 11,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 2,\n \"permission_id\" => 12,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 2,\n \"permission_id\" => 13,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 3,\n \"permission_id\" => 2,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 3,\n \"permission_id\" => 3,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 3,\n \"permission_id\" => 4,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 3,\n \"permission_id\" => 7,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 3,\n \"permission_id\" => 8,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 3,\n \"permission_id\" => 9,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 3,\n \"permission_id\" => 10,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 3,\n \"permission_id\" => 11,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 3,\n \"permission_id\" => 12,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 3,\n \"permission_id\" => 13,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 3,\n \"permission_id\" => 14,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 2,\n \"permission_id\" => 16,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ],\n [\n \"role_id\" => 3,\n \"permission_id\" => 16,\n \"created_at\" => NULL,\n \"updated_at\" => NULL\n ]\n ]\n );\n\n // finish\n }", "public function permisos()\n {\n\n $conectar = parent::conexion();\n\n $sql = \"select * from permisos;\";\n\n $sql = $conectar->prepare($sql);\n $sql->execute();\n return $resultado = $sql->fetchAll();\n }", "public function listarVehiculosMantenimientosController(){\n\n\t\t\t$respuesta = GestorMantenimientosModel::listarVehiculosMantenimientosModel(\"vehiculo\", \"cliente\");\n\n\t\t\tforeach ($respuesta as $row => $item) {\n\n\t\t\t\techo '\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"text-center\">'.$item[\"nombre_cliente\"]. ' '.$item[\"apellido_cliente\"].'</td>\n\t\t\t \t\t\t<td class=\"text-center\">'.$item[\"placas_vehiculo\"].'</td>\n\t\t\t \t\t\t<td class=\"text-center\">'.$item[\"marca_vehiculo\"].'</td>\n\t\t\t \t\t\t<td class=\"text-center\">'.$item[\"modelo_vehiculo\"].'</td>\n\t\t\t \t\t\t<td class=\"text-center\">'.$item[\"anio_vehiculo\"].'</td>\n\t\t\t \t\t\t<td class=\"text-center\">'.$item[\"kilometraje_vehiculo\"].'</td>\n\t\t\t \t\t\t<td class=\"text-center class=\"acciones\"\"><a href=\"#\" onclick=\"agregarVehiculo(\\''.$item[\"id_vehiculo\"].'\\', \\''.$item[\"placas_vehiculo\"].'\\', \\''.$item[\"marca_vehiculo\"].'\\', \\''.$item[\"modelo_vehiculo\"].'\\', \\''.$item[\"kilometraje_vehiculo\"].'\\', \\''.$item[\"nombre_cliente\"].'\\', \\''.$item[\"apellido_cliente\"].'\\')\" class=\"btn btn-info\"><span class=\"fa fa-car\"></span> Agregar </a></td>\n\t\t\t \t\t</tr>\n\t\t \t\t';\n\t\t \t\t\n\t\t\t}\n\n\t\t}", "public function index()\n {\n\n if( auth()->user()->hasRole('Super-Admin') || auth()->user()->hasRole('Administrador') || auth()->user()->hasRole('Ventas')){\n $pedidos = Pedido::where('anticipo','!=',0)->orderBy('updated_at','DESC')->get();\n }\n if( auth()->user()->hasRole('Cliente')){\n $pedidos = Pedido::where('anticipo','!=',0)->where('usuario',auth()->user()->id)->orderBy('updated_at','DESC')->get();\n }\n //dd($pedido->cotizacion->user_id);\n return view('ventas.index', compact('pedidos'));\n }", "public function listarUsuarios()\r\n\t{\r\n\t\t$administradores=array();\r\n\t\ttry{\r\n\t\t\t//realizamos la consulta de todos los items\r\n\t\t\t$consulta = $this->db->prepare(\"select * from administrador\");\r\n\t\t\t$consulta->execute();\r\n\t\t\tfor($i=0; $row = $consulta->fetch(); $i++)\r\n\t\t\t{\r\n\t\t $fila['admin_cedula']=$row['ADMIN_CEDULA'];\r\n\t\t\t$fila['admin_login']=$row['ADMIN_LOGIN'];\r\n\t\t\t$fila['admin_nombre']=$row['ADMIN_NOMBRE'];\r\n\t\t\t$fila['admin_apellido']=$row['ADMIN_APELLIDO'];\r\n\t\t\t$fila['admin_status']=$row['ADMIN_STATUS'];\r\n\t\t\t$administradores[]=$fila;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tcatch(PDOException $e)\r\n\t\t{\r\n\t\t\techo $e;\r\n\t\t}\r\n\t\treturn $administradores;\t\t\r\n\t}", "public function indexAdmin()\n {\n $nodos = $this->mdlnodo->consultarnodos();\n require APP . 'view/_templates/headeradminodos.php';\n require APP . 'view/proyecto/admin/index.php';\n\t\t require APP . 'view/_footer/footeradminnodos.php';\n }", "public function lista(){\n\t\t\tglobal $app;\n\t\t\t$sth = $this->PDO->prepare(\"SELECT * FROM sedecchamados\");\n\t\t\t$sth->execute();\n\t\t\t$result = $sth->fetchAll(\\PDO::FETCH_ASSOC);\n\t\t\t$app->render('default.php',[\"data\"=>$result],200); \n\t\t}", "public function listidAction() \n {\n $id = (int) $this->params()->fromRoute('id', 0);\n if ($id > 0)\n {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d=new AlbumTable($this->dbAdapter);\n\n $d->modGeneral(\"delete from a_empleados_rete_d where idEret=\".$id); \n $d->modGeneral(\"delete from a_empleados_rete where id=\".$id); \n //$u=new Retefuente($this->dbAdapter); // ---------------------------------------------------------- 5 FUNCION DENTRO DEL MODELO (C) \n //$u->delRegistro($id);\n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin);\n } \n }", "public function listarIdNome() {\n $rs = $this->model->listarIdNome();\n\n echo $this->toJson($rs);\n }", "function setAgregarUnPais(){\n\t\t$this->comienza_con++;\n\t}", "public static function getAdminsList()\n {\n $data_to_load = [];\n if(DatabaseManager::fetchInto(\"main\", $data_to_load, \"SELECT * FROM `admin_users`\") === false)\n Status::message(Status::ERROR, \"Couldn't retrieve `admin_users` from DB\");\n \n Status::message(Status::SUCCESS, $data_to_load);\n }", "public function index()\n {\n $id = Auth::user()->id;\n $orders = Order::where('user_id',$id)->get();\n $orders_done = Order::where('user_id',$id)->where('etat', 'Termine')->get();\n $orders_undone = Order::where('user_id',$id)->where('etat','en attente')->get();\n\n return view('adminpanel.index', ['orders_done' => $orders_done, 'orders_undone' => $orders_undone, 'orders' => $orders ]);\n }", "function fmodulo(){\n\t\t$this->sentencia=\"SELECT modulo_id,modulo_nombre FROM modulo ORDER BY modulo_orden ASC\";\n\t\t$this->fsentencia();\n\t\t$this->modulo=$this->resultado;\n\t}", "public function index()\n {\n //cargar todos los pedidos\n $pedidos = \\App\\Pedido::with('usuario')\n ->with('repartidor')\n ->with('productos.establecimiento')\n ->orderBy('id', 'desc')\n ->get();\n\n if(count($pedidos) == 0){\n return response()->json(['error'=>'No existen pedidos en el historial.'], 404); \n }else{\n return response()->json(['pedidos'=>$pedidos], 200);\n } \n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n /*$services = $em->getRepository('kiraxeAdminCrmBundle:Services');\n\n $services = $services->createQueryBuilder('s1')\n ->join('s1.childrens', 's2', Join::WITH , 's1.id = s2.parent')\n ->getQuery()->getResult();\n */\n $services = $em->createQuery(\n 'SELECT s1, s2 FROM kiraxeAdminCrmBundle:Services s1 JOIN kiraxeAdminCrmBundle:Services s2 WITH s1.id = s2.parent'\n )->getResult();\n\n $deleteForm = [];\n\n $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');\n $user = $this->getUser();\n $tableName = [];\n $tableSettingsName = [];\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Workers')->getTableName()] = \"Сотрудники\";\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Services')->getTableName()] = \"Услуги\";\n $tableSettingsName[$em->getClassMetadata('kiraxeAdminCrmBundle:User')->getTableName()] = \"Пользователи\";\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Materials')->getTableName()] = \"Материалы\";\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Orders')->getTableName()] = \"Заказ-наряд\";\n $tableSettingsName[$em->getClassMetadata('kiraxeAdminCrmBundle:Measure')->getTableName()] = \"Единицы измерения\";\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Expenses')->getTableName()] = \"Расход\";\n $tableCars = [];\n $tableCars[$em->getClassMetadata('kiraxeAdminCrmBundle:Brand')->getTableName()] = \"Бренд автомобиля\";\n $tableCars[$em->getClassMetadata('kiraxeAdminCrmBundle:Model')->getTableName()] = \"Модель автомобиля\";\n\n for($i = 0; $i < count($services); $i++) {\n $deleteForm[$services[$i]->getName()] = $this->createDeleteForm($services[$i])->createView();\n }\n\n return $this->render('services/index.html.twig', array(\n 'services' => $services,\n 'delete_form' => $deleteForm,\n 'tables' => $tableName,\n 'user' => $user,\n 'tableSettingsName' => $tableSettingsName,\n 'tableCars' => $tableCars,\n ));\n }", "public function AgregaPedidos()\n{\n\n\tif(empty($_SESSION[\"CarritoVentas\"]))\n\t\t\t\t{\n\t\t\t\t\techo \"3\";\n\t\t\t\t\texit;\n\n\t\t\t\t} \n\n\t$ver = $_SESSION[\"CarritoVentas\"];\n\tfor($i=0;$i<count($ver);$i++){ \n\n\t\t$sql = \"select existencia from productos where codproducto = '\".$ver[$i]['txtCodigo'].\"'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$existenciadb = $row['existencia'];\n\n\t\tif($ver[$i]['cantidad'] > $existenciadb) {\n\n\t\t\techo \"4\";\n\t\t\texit; }\n\t\t}\n\n\t$ven = $_SESSION[\"CarritoVentas\"];\n\tfor($i=0;$i<count($ven);$i++){\n\n\t$sql = \"select existencia from productos where codproducto = '\".$ven[$i]['txtCodigo'].\"'\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\t$existenciadb = $row['existencia'];\n\n\n\t\t$sql = \"select * from detalleventas where codventa = ? and codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array( $_POST[\"codventa\"], $ven[$i]['txtCodigo'] ) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num>0)\n\t\t{\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $row;\n\t\t\t}\n\t\t\t$codproducto = $pae[0]['codproducto'];\n\t\t\t$cantven = $pae[0]['cantventa'];\n\t\t\t$import = $pae[0]['importe'];\n\t\t\t$import2 = $pae[0]['importe2'];\n\n\t\t\t$sql = \" update detalleventas set \"\n\t\t\t.\" cantventa = ?, \"\n\t\t\t.\" importe = ?, \"\n\t\t\t.\" importe2 = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codventa = '\".$_POST[\"codventa\"].\"' and codproducto = '\".$ven[$i]['txtCodigo'].\"';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $cantidad);\n\t\t\t$stmt->bindParam(2, $importe);\n\t\t\t$stmt->bindParam(3, $importe2);\n\n\t\t\t$cantidad = rount($ven[$i]['cantidad']+$cantven,2);\n\t\t\t$importe = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio2']+$import);\n\t\t\t$importe2 = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio']+$import2);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$existencia = rount($existenciadb-$ven[$i]['cantidad'],2);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" statusproducto = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"' and existencia = '0';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $statusproducto);\n\t\t\t$statusproducto = \"INACTIVO\";\n\t\t\t$stmt->execute();\n\n################## REGISTRAMOS LOS DATOS DE PRODUCTOS EN KARDEX #################\n\t\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $movimiento);\n\t\t\t$stmt->bindParam(5, $entradas);\n\t\t\t$stmt->bindParam(6, $salidas);\n\t\t\t$stmt->bindParam(7, $devolucion);\n\t\t\t$stmt->bindParam(8, $stockactual);\n\t\t\t$stmt->bindParam(9, $preciounit);\n\t\t\t$stmt->bindParam(10, $costototal);\n\t\t\t$stmt->bindParam(11, $documento);\n\t\t\t$stmt->bindParam(12, $fechakardex);\n\n\t\t\t$codventa = strip_tags($_POST[\"codventa\"]);\n\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t$codproducto = strip_tags($ven[$i]['txtCodigo']);\n\t\t\t$movimiento = strip_tags(\"SALIDAS\");\n\t\t\t$entradas = strip_tags(\"0\");\n\t\t\t$salidas = rount($ven[$i]['cantidad'],2);\n\t\t\t$devolucion = strip_tags(\"0\");\n\t\t\t$stockactual = rount($existenciadb-$ven[$i]['cantidad'],2); \n\t\t\t$preciounit = strip_tags($ven[$i]['precio2']);\n\t\t\t$costototal = strip_tags($ven[$i]['precio2'] * $ven[$i]['cantidad']);\n\t\t\t$documento = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t$fechakardex = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t$stmt->execute();\n\n\n############## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ###############\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array( $ven[$i]['txtCodigo'] ) );\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto IN ('\".$ven[$i]['txtCodigo'].\"')\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$racion = rount($cantracion*$cantidad,2);\n\t\t\t$cantidadracion = rount($cantingrediente-$racion,2);\n\t\t\t$stmt->execute();\n\n\n##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX #####################\n\t\t\t\t\t$query = \" insert into kardexingredientes values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t\t\t$stmt->bindParam(4, $codingrediente);\n\t\t\t\t\t$stmt->bindParam(5, $movimientoing);\n\t\t\t\t\t$stmt->bindParam(6, $entradasing);\n\t\t\t\t\t$stmt->bindParam(7, $salidasing);\n\t\t\t\t\t$stmt->bindParam(8, $stockactualing);\n\t\t\t\t\t$stmt->bindParam(9, $preciouniting);\n\t\t\t\t\t$stmt->bindParam(10, $costototaling);\n\t\t\t\t\t$stmt->bindParam(11, $documentoing);\n\t\t\t\t\t$stmt->bindParam(12, $fechakardexing);\n\n\t\t\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t\t\t$codproducto = strip_tags($codproducto);\n\t\t\t\t\t$codingrediente = strip_tags($codingrediente);\n\t\t\t\t\t$movimientoing = strip_tags(\"SALIDAS\");\n\n\t\t\t\t\t$entradasing = strip_tags(\"0\");\n\t\t\t\t\t$salidasing = rount($cantracion*$cantidad,2);\n\t\t\t\t\t$stockactualing = rount($cantingrediente-$racion,2);\n\t\t\t\t\t$preciouniting = strip_tags($costoingrediente);\n\t\t\t\t\t$costototaling = strip_tags($costoingrediente * $cantidad);\n\n\t\t\t\t\t$documentoing = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t\t\t$fechakardexing = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t\t\t$stmt->execute();\n\t##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX ###################\n\n\t\t }\n\n}\n############## FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ###########\t\n\n\n\t\t}\n\t\telse\n\t\t{\n\n\n\t\t\t$query = \" insert into detalleventas values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $producto);\n\t\t\t$stmt->bindParam(5, $codcategoria);\n\t\t\t$stmt->bindParam(6, $cantidad);\n\t\t\t$stmt->bindParam(7, $preciocompra);\n\t\t\t$stmt->bindParam(8, $precioventa);\n\t\t\t$stmt->bindParam(9, $ivaproducto);\n\t\t\t$stmt->bindParam(10, $importe);\n\t\t\t$stmt->bindParam(11, $importe2);\n\t\t\t$stmt->bindParam(12, $fechadetalleventa);\n\t\t\t$stmt->bindParam(13, $statusdetalle);\n\t\t\t$stmt->bindParam(14, $codigo);\n\n\t\t\t$codventa = strip_tags($_POST[\"codventa\"]);\n\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t$codproducto = strip_tags($ven[$i]['txtCodigo']);\n\t\t\t$producto = strip_tags($ven[$i]['descripcion']);\n\t\t\t$codcategoria = strip_tags($ven[$i]['tipo']);\n\t\t\t$cantidad = rount($ven[$i]['cantidad'],2);\n\t\t\t$preciocompra = strip_tags($ven[$i]['precio']);\n\t\t\t$precioventa = strip_tags($ven[$i]['precio2']);\n\t\t\t$ivaproducto = strip_tags($ven[$i]['ivaproducto']);\n\t\t\t$importe = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio2']);\n\t\t\t$importe2 = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio']);\n\t\t\t$fechadetalleventa = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t$statusdetalle = \"1\";\n\t\t\t$codigo = strip_tags($_SESSION['codigo']);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$existencia = rount($existenciadb-$ven[$i]['cantidad'],2);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" statusproducto = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"' and existencia = '0';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $statusproducto);\n\t\t\t$statusproducto = \"INACTIVO\";\n\t\t\t$stmt->execute();\n\n##################### REGISTRAMOS LOS DATOS DE PRODUCTOS EN KARDEX ###################\n\t\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $movimiento);\n\t\t\t$stmt->bindParam(5, $entradas);\n\t\t\t$stmt->bindParam(6, $salidas);\n\t\t\t$stmt->bindParam(7, $devolucion);\n\t\t\t$stmt->bindParam(8, $stockactual);\n\t\t\t$stmt->bindParam(9, $preciounit);\n\t\t\t$stmt->bindParam(10, $costototal);\n\t\t\t$stmt->bindParam(11, $documento);\n\t\t\t$stmt->bindParam(12, $fechakardex);\n\n\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t$codproducto = strip_tags($ven[$i]['txtCodigo']);\n\t\t\t$movimiento = strip_tags(\"SALIDAS\");\n\t\t\t$entradas = strip_tags(\"0\");\n\t\t\t$salidas =rount($ven[$i]['cantidad'],2);\n\t\t\t$devolucion = strip_tags(\"0\");\n\t\t\t$stockactual = rount($existenciadb-$ven[$i]['cantidad'],2);\n\t\t\t$preciounit = strip_tags($ven[$i]['precio2']);\n\t\t\t$costototal = strip_tags($ven[$i]['precio2'] * $ven[$i]['cantidad']);\n\t\t\t$documento = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t$fechakardex = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t$stmt->execute();\t\n\n\n############### CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array( $ven[$i]['txtCodigo'] ) );\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto IN ('\".$ven[$i]['txtCodigo'].\"')\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$racion = rount($cantracion*$cantidad,2);\n\t\t\t$cantidadracion = rount($cantingrediente-$racion,2);\n\t\t\t$stmt->execute();\n\n\n##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX #####################\n$query = \" insert into kardexingredientes values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t\t\t$stmt->bindParam(4, $codingrediente);\n\t\t\t\t\t$stmt->bindParam(5, $movimientoing);\n\t\t\t\t\t$stmt->bindParam(6, $entradasing);\n\t\t\t\t\t$stmt->bindParam(7, $salidasing);\n\t\t\t\t\t$stmt->bindParam(8, $stockactualing);\n\t\t\t\t\t$stmt->bindParam(9, $preciouniting);\n\t\t\t\t\t$stmt->bindParam(10, $costototaling);\n\t\t\t\t\t$stmt->bindParam(11, $documentoing);\n\t\t\t\t\t$stmt->bindParam(12, $fechakardexing);\n\n\t\t\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t\t\t$codproducto = strip_tags($codproducto);\n\t\t\t\t\t$codingrediente = strip_tags($codingrediente);\n\t\t\t\t\t$movimientoing = strip_tags(\"SALIDAS\");\n\n\t\t\t\t\t$entradasing = strip_tags(\"0\");\n\t\t\t\t\t$salidasing = rount($cantracion*$cantidad,2);\n\t\t\t\t\t$stockactualing = rount($cantingrediente-$racion,2);\n\t\t\t\t\t$preciouniting = strip_tags($costoingrediente);\n\t\t\t\t\t$costototaling = strip_tags($costoingrediente * $cantidad);\n\n\t\t\t\t\t$documentoing = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t\t\t$fechakardexing = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t\t\t$stmt->execute();\n##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX ###################\n\n\t\t }\n\n}\n############# FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS #############\t\n\n\t\t}\n\t}\n\n\t$sql4 = \"select * from ventas where codventa = ? \";\n\t$stmt = $this->dbh->prepare($sql4);\n\t$stmt->execute( array($_POST[\"codventa\"]) );\n\t$num = $stmt->rowCount();\n\n\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$paea[] = $row;\n\t\t}\n\t\t$subtotalivasive = $paea[0][\"subtotalivasive\"];\n\t\t$subtotalivanove = $paea[0][\"subtotalivanove\"];\n\t\t$iva = $paea[0][\"ivave\"]/100;\n\t\t$descuento = $paea[0][\"descuentove\"]/100;\n\t\t$totalivave = $paea[0][\"totalivave\"];\n\t\t$totaldescuentove = $paea[0][\"totaldescuentove\"];\n\n\n\t\t$sql3 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'SI'\";\n\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t$stmt->execute( array($_POST[\"codventa\"]));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$preciocompraiva = $p[0][\"preciocompra\"];\n\t\t$importeiva = $p[0][\"importe\"];\n\t\t$importe2iva = $p[0][\"importe2\"];\n\n\t\t$sql5 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'NO'\";\n\t\t$stmt = $this->dbh->prepare($sql5);\n\t\t$stmt->execute( array($_POST[\"codventa\"]));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $row;\n\t\t\t}\n\t\t\t$preciocompra = $row[\"preciocompra\"];\n\t\t\t$importe = $row[\"importe\"];\n\t\t\t$importe2 = $row[\"importe2\"];\t\t\n\n\t\t\t$sql = \" update ventas set \"\n\t\t\t.\" subtotalivasive = ?, \"\n\t\t\t.\" subtotalivanove = ?, \"\n\t\t\t.\" totalivave = ?, \"\n\t\t\t.\" totaldescuentove = ?, \"\n\t\t\t.\" totalpago= ?, \"\n\t\t\t.\" totalpago2= ?, \"\n\t\t\t.\" observaciones= ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codventa = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $subtotalivasive);\n\t\t\t$stmt->bindParam(2, $subtotalivanove);\n\t\t\t$stmt->bindParam(3, $totaliva);\n\t\t\t$stmt->bindParam(4, $totaldescuentove);\n\t\t\t$stmt->bindParam(5, $total);\n\t\t\t$stmt->bindParam(6, $total2);\n\t\t\t$stmt->bindParam(7, $observaciones);\n\t\t\t$stmt->bindParam(8, $codventa);\n\n\t\t\t$subtotalivasive= rount($importeiva,2);\n\t\t\t$subtotalivanove= rount($importe,2);\n\t\t\t$totaliva= rount($subtotalivasive*$iva,2);\n\t\t\t$tot= rount($subtotalivasive+$subtotalivanove+$totaliva,2);\n\t\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t\t$total= rount($tot-$totaldescuentove,2);\n\t\t\t$total2= rount($preciocompra,2);\nif (strip_tags(isset($_POST['observaciones']))) { $observaciones = strip_tags($_POST['observaciones']); } else { $observaciones =''; }\n\t\t\t$codventa = strip_tags($_POST[\"codventa\"]);\n\t\t\t$stmt->execute();\n\n###### AQUI DESTRUIMOS TODAS LAS VARIABLES DE SESSION QUE RECIBIMOS EN CARRITO DE VENTAS ######\n\t\t\tunset($_SESSION[\"CarritoVentas\"]);\n\n\necho \"<div class='alert alert-success'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<span class='fa fa-check-square-o'></span> LOS DETALLES FUERON AGREGADOS A LA \".$_POST[\"nombremesa\"].\", EXITOSAMENTE <a href='reportepdf?codventa=\".base64_encode($codventa).\"&tipo=\".base64_encode(\"TICKETCOMANDA\").\"' class='on-default' data-placement='left' data-toggle='tooltip' data-original-title='Imprimir Comanda' target='_black'><strong>IMPRIMIR COMANDA</strong></a>\";\necho \"</div>\";\n\necho \"<script>window.open('reportepdf?codventa=\".base64_encode($codventa).\"&tipo=\".base64_encode(\"TICKETCOMANDA\").\"', '_blank');</script>\";\nexit;\n\n\t\t}", "public function admin() {\r\n $ruta = new Ruta($this->adapter);\r\n\r\n //Conseguimos todos los usuarios\r\n $allrut = $ruta->getAll();\r\n //Cargamos la vista index y le pasamos valores\r\n $this->view(\"Ruta/admin\", array(\"allrut\" => $allrut));\r\n \r\n }", "public function imprimir_listado($sender, $param)\r\n {\r\n $arreglo_mes=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');\r\n\r\n //Busqueda de Registros\r\n $cod_organizacion = usuario_actual('cod_organizacion');\r\n $ano = $this->drop_ano->SelectedValue;\r\n $mes = $this->drop_mes->SelectedValue;\r\n $fecha_inicio=\"$ano/$mes/01\";\r\n $fecha_fin=\"$ano/$mes/31\";\r\n $codigo_sin_descomponer=$this->drop_retenciones->SelectedValue;\r\n $codigo = descomponer_codigo_gasto(rellena_derecha($codigo_sin_descomponer,'24','0'));\r\n \r\n \r\n //obtenemos nombre de la retencion\r\n $sql = \"select descripcion from presupuesto.retencion\r\n where ((cod_organizacion = '$cod_organizacion') and (codigo ='$codigo_sin_descomponer')and(ano = '$ano') )\";\r\n $resultado_desc = cargar_data($sql,$this);\r\n $retencion=$resultado_desc[0]['descripcion'].\" (\".codigo_resumido($this->drop_retenciones->Text,$sender).\")\";\r\n\r\n\r\n $sql = \"(select dp.id,m.fecha_cheque as fecha,dp.monto,\r\n CONCAT(dp.tipo_documento_causado,'-',dp.numero_documento_causado) as documento,\r\n CONCAT(p.nombre,' (',p.rif,')') as proveedor\r\n FROM presupuesto.detalle_pagado as dp\r\n INNER JOIN presupuesto.maestro_pagado as m ON (m.numero=dp.numero_documento_pagado AND m.ano=dp.ano)\r\n INNER JOIN presupuesto.proveedores as p ON (p.cod_proveedor = m.cod_proveedor)\r\n where ((dp.es_retencion='1') and (m.cod_organizacion = '$cod_organizacion') and\r\n (dp.ano = '$ano') and\r\n (dp.partida='$codigo[partida]' and dp.generica='$codigo[generica]' and especifica='$codigo[especifica]'\r\n and dp.subespecifica='$codigo[subespecifica]' and dp.ordinal='$codigo[ordinal]')and (m.estatus_actual='NORMAL')\r\n and m.fecha_cheque BETWEEN '$fecha_inicio' AND '$fecha_fin' ))\r\n\r\n UNION\r\n ( SELECT rp.id,m.fecha,rp.monto,\r\n CONCAT(m.tipo,'-',m.referencia) as documento,\r\n CONCAT(p.nombre,' (',p.rif,')') as proveedor\r\n FROM presupuesto.retencion_pagado as rp\r\n INNER JOIN presupuesto.cheques as c ON (c.cod_movimiento=rp.cod_movimiento AND c.ano=rp.ano AND c.estatus_actual='NORMAL')\r\n INNER JOIN presupuesto.bancos_cuentas_movimientos as m ON (m.cod_movimiento=rp.cod_movimiento AND m.ano=rp.ano)\r\n INNER JOIN presupuesto.proveedores as p ON (p.cod_proveedor = c.cod_proveedor)\r\n WHERE (rp.codigo_retencion='$codigo_sin_descomponer' AND m.fecha BETWEEN '$fecha_inicio' AND '$fecha_fin' )\r\n)\r\n ORDER BY fecha ASC \" ;\r\n $resultado_rpt=cargar_data($sql,$this);\r\n\r\n if (!empty ($resultado_rpt))\r\n { // si la consulta trae resultados, entonces si se imprime\r\n require('../tcpdf/tcpdf.php');\r\n \r\n\r\n $pdf=new TCPDF('l', 'mm', 'legal', true, 'utf-8', false);\r\n $pdf->SetFillColor(205, 205, 205);//color de relleno gris\r\n\r\n $info_adicional= \"Listado de Movimientos Retencion Año: $ano Mes: $arreglo_mes[$mes]\\n\".\r\n $retencion;\r\n $pdf->SetHeaderData(\"LogoCENE.gif\", 15, \"Sistema de Información Automatizado - \".usuario_actual('nombre_organizacion'), $info_adicional);\r\n\r\n // set header and footer fonts\r\n $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));\r\n $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));\r\n\r\n // set default monospaced font\r\n $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);\r\n\r\n //set margins\r\n $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT, 2);\r\n $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);\r\n $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);\r\n\r\n //set auto page breaks\r\n $pdf->SetAutoPageBreak(TRUE, 15);//$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);\r\n\r\n //set image scale factor\r\n $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);\r\n\r\n $pdf->SetAuthor('Proyecto SIMON');\r\n $pdf->SetTitle('Reporte de Movimientos Retencion');\r\n $pdf->SetSubject('Reporte de Movimientos Retencion Año:$ano Mes:$arreglo_mes[$mes] ');\r\n\r\n $pdf->AddPage();\r\n\r\n $listado_header = array('Fecha','Documento', 'Proveedor', 'Debe','Haber','Saldo');\r\n\r\n $pdf->SetFont('helvetica', 'B', 12);\r\n $pdf->SetFillColor(255, 255, 255);\r\n $pdf->Cell(0, 6, \"Listado de Movimientos de \".$retencion, 0, 1, 'C', 1);\r\n $pdf->Ln(1);\r\n $pdf->SetFont('helvetica', '', 10);\r\n $pdf->Cell(0, 6, \"Año: $ano Mes: $arreglo_mes[$mes] \", 0, 1, '', 1);\r\n\r\n\r\n\r\n $saldo_inicial= saldo_mes_retencion($ano,$mes,$cod_organizacion,$codigo_sin_descomponer,$this);\r\n\r\n\r\n\r\n $pdf->Cell(0, 6, \"Saldo Inicial del Mes: Bs. \".number_format($saldo_inicial, 2, ',', '.'), 0, 1, '', 1);\r\n $pdf->SetFont('helvetica', '', 10);\r\n // se realiza el listado de asistentes en el PDF\r\n $pdf->SetFillColor(210,210,210);\r\n $pdf->SetTextColor(0);\r\n $pdf->SetDrawColor(41, 22, 11);\r\n $pdf->SetLineWidth(0.3);\r\n $pdf->SetFont('', 'B');\r\n // Header\r\n $w = array(20, 30, 180, 33, 33,33);\r\n for($i = 0; $i < count($listado_header); $i++)\r\n $pdf->Cell($w[$i], 5, $listado_header[$i], 1, 0, 'C', 1);\r\n $pdf->Ln();\r\n // Color and font restoration\r\n $pdf->SetFillColor(224, 235, 255);\r\n $pdf->SetTextColor(0);\r\n $pdf->SetFont('','',10);\r\n // Data\r\n $fill = 0;\r\n $borde=\"LR\";\r\n $ultimo_elemento = end($resultado_rpt);\r\n foreach($resultado_rpt as $row) {\r\n if ($row == $ultimo_elemento) {$borde=\"LRB\";}\r\n $pdf->Cell($w[0], 6, cambiaf_a_normal($row['fecha']), $borde, 0, 'L', $fill);\r\n $pdf->Cell($w[1], 6, strtoupper($row['documento']), $borde, 0, 'C', $fill);\r\n $pdf->Cell($w[2], 6, $row['proveedor'], $borde, 0, 'L', $fill);\r\n \r\n if($row['monto']<0){\r\n $monto=\"Bs. \".number_format(abs($row['monto']), 2, ',', '.');\r\n $pdf->Cell($w[3], 6,$monto , $borde, 0, 'R', $fill);\r\n $total_debe+= abs($row['monto']);\r\n }else{$pdf->Cell($w[3], 6,\"Bs. \".number_format('0', 2, ',', '.') , $borde, 0, 'R', $fill);}\r\n\r\n if($row['monto']>0){\r\n $monto=\"Bs. \".number_format($row['monto'], 2, ',', '.');\r\n $pdf->Cell($w[4], 6, $monto, $borde, 0, 'R', $fill);\r\n $total_haber += ($row['monto']);\r\n }else{$pdf->Cell($w[4], 6,\"Bs. \".number_format('0', 2, ',', '.') , $borde, 0, 'R', $fill);}\r\n \r\n $pdf->Cell($w[5], 6, \"Bs. \".number_format($row['saldo'], 2, ',', '.'), $borde, 0, 'R', $fill);\r\n \r\n \r\n $total_saldo = $row['saldo'];\r\n $pdf->SetTextColor(0); // iniciamos con el color negro\r\n\r\n $pdf->Ln();\r\n $fill=!$fill;\r\n }\r\n $pdf->SetFillColor(255, 255, 255);\r\n $pdf->SetFont('', 'B');\r\n $pdf->Cell($w[0], 6, \"\", '', 0, 'R', 0);\r\n $pdf->Cell($w[1], 6, \"\", '', 0, 'R', 0);\r\n $pdf->Cell($w[2], 6, \"TOTAL:\", '', 0, 'R', 0);\r\n $pdf->Cell($w[3], 6, \"Bs. \".number_format($total_debe, 2, ',', '.'), 1, 0, 'R', 0);\r\n $pdf->Cell($w[4], 6, \"Bs. \".number_format($total_haber, 2, ',', '.'), 1, 0, 'R', 0);\r\n $pdf->Cell($w[5], 6, \"Bs. \".number_format(($total_debe-$total_haber)+$saldo_inicial, 2, ',', '.'), 1, 0, 'R', 0);\r\n $pdf->Output(\"listado_movimientos_retencion_$ano_$mes.pdf\",'D');\r\n }\r\n }", "public function listodAction() \n { \n // valores iniciales formulario (C)\n $id = (int) $this->params()->fromRoute('id', 0); \n if($this->getRequest()->isPost()) // Actulizar datos\n {\n $request = $this->getRequest();\n $data = $this->request->getPost();\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u=new tipdocontrolo($this->dbAdapter); // ---------------------------------------------------------- 5 FUNCION DENTRO DEL MODELO (C) \n $u->delRegistro($data->id); \n }\n $view = new ViewModel(); \n $this->layout('layout/blancoC'); // Layout del login\n return $view; \n\n }", "function listar()\n\t{\n\t\t\n\t \t //si hubo cambio de sede actualizo permisos y filtro sede\n \t \t if(isset($_POST['insumo']))\n \t{\n $sede_consulta = $this->input->post('insumo');//sede nueva\n $this->auth_model->cambio_sede($sede_consulta);\n \n \t}\n \telse\n \t{\n\t\t\t$sede_consulta= $this->general_model->ou_sede_id($this->session->userdata('sede'));\n\t\t}\n\t\t\n\t\t\n\t\t\t//$permiso_sede = $this->session->userdata('sede');\n\t\t\t//GROCERY CRUD SETUP\n\t\t\t$crud = new grocery_CRUD();\n\t\t\t$crud->set_table('entregas');\n\t\t\t$crud->set_theme('Datatables');\n\t\t\t$aux=$this->session->userdata('sede_filtro');\n\t\tif ($this->session->userdata('sede_filtro'))\n {$crud->where('entregas.id_sede',$this->session->userdata('sede_filtro'));}\n\t \telse\n \t{$crud->where('entregas.id_sede',$sede_consulta);}\n\t\t\t//$crud->where('entregas.id_sede',$permiso_sede);\n\t\t\n\t\t\t$crud->set_language('spanish');\n\t\t\t$crud->unset_delete();\n\t\t\t\n\t\t\t//$crud->set_relation('id_proveedor','equipos','id_proveedor');\t\t\n\t\t\t\n\t\t\t$crud->columns('id_equipo','id_insumo','id_sector','fecha_entrega','estado','observaciones','usuario_entrega');\n\t\t\t$crud->add_fields('id_sede','id_sector','estado','id_equipo','id_insumo','fecha_entrega','observaciones','usuario_entrega', 'cantidad');\n\t\t\t\n\t\t\t$crud->edit_fields('id_sede','id_sector','estado','id_equipo','id_insumo','fecha_entrega','observaciones','usuario_entrega', 'cantidad');\n\t\t\t$crud->display_as('id_insumo','Insumo')\n\t\t\t\t ->display_as('id_equipo','Equipo')\n\t\t\t\t ->display_as('id_sector','Sector');\n\t\t\t$crud->set_subject('Entrega');\n\t\t\t\n\t\t\t $crud->set_relation('id_insumo','Insumos','codigo_insumo','habilitado=\"1\"');\n \t\n $crud->set_relation('id_equipo','Equipos','codigo_equipo');\n \n\t\t\t\n\t\t\t//la validacion del estado debe estar presente en todas las instancias\n\t\t $crud->set_rules('estado', 'estado','required');\n\t\t \n\t\t\t\n\t\t\t\n\t\t\tif ($crud->getState() != 'add') \n{\n\t $crud->set_relation('estado','parametros','valor','nombre_parametro=\"estado_entrega\" and habilitado=\"1\"');\n\t \n\t\n}\n\t\t\t\n\t\t\t//por algun no olcutaba el campo preguntando si el estado era add y era a causa del relation... y como la necestio en list y edit lo deje asi\n\n// idem estado pero con sector\n\t\t\tif (($crud->getState() != 'add') and ($crud->getState() != 'edit'))\n{\n\t \n\t $crud->set_relation('id_sector','sectores','nombre_sector');\n\t\n}\n\n\t\t\tif ($crud->getState() == 'add') \n{\n\t//trabajo el add por listar1 el 2 no se usa.\n\tredirect('/entregas/listar1/add');\n\t$crud->change_field_type('id_sector','invisible');\n\t$crud->change_field_type('estado','invisible');\n $crud->change_field_type('id_sede','invisible');\n $crud->change_field_type('usuario_entrega','invisible');\n $crud->change_field_type('fecha_entrega','invisible');\n $crud->change_field_type('cantidad','invisible');\n //coloco las validaciones aca para que no las haga innecesariamente en el edit\n $crud->set_relation('id_equipo','equipos','codigo_equipo', 'estado_equipo='.$this->parametros_model->obtener_id_parametro(\"estado equipo\",\"Operativa\"));\n \t$crud->set_relation('id_insumo','Insumos','codigo_insumo','habilitado=\"1\"');\n \t\n\t\t\t$crud->set_rules('id_equipo', 'Equipo','trim|required');\n\t\t \n\t\t \n\t\t //pongo validacion aca si no me chequea el stock al modificar\n $crud->set_rules('id_insumo', 'id_insumo','trim|required|callback_insumo_check');\n\t\t\t\n}\n\t\t\tif ($this->grocery_crud->getState() == 'edit') \n{\n\t/*$a = $this->uri->segment(4);\n\t$b = '/entregas/listar1/edit/'.$a;\n redirect($b);*/\n \t $crud->change_field_type('id_sede','invisible');\n \t $crud->change_field_type('usuario_entrega','invisible');\n $crud->change_field_type('fecha_entrega','invisible');\n $crud->change_field_type('id_sector','invisible');\n $crud->change_field_type('cantidad','invisible');\n //$crud->set_relation('id_insumo','Insumos','codigo_insumo','habilitado=\"1\"');\n $crud->field_type('id_insumo','readonly'); \t\n // $crud->set_relation('id_equipo','Equipos','codigo_equipo');\n $crud->field_type('id_equipo','readonly');\n \n}\n\t\t\t\n\t\t\t//IF YOU HAVE A LARGE AMOUNT OF DATA, ENABLE THE CALLBACKS BELOW - FOR EXAMPLE ONE USER HAD 36000 CITIES AND SLOWERD UP THE LOADING PROCESS. THESE CALLBACKS WILL LOAD EMPTY SELECT FIELDS THEN POPULATE THEM AFTERWARDS\n\t\t\n\t\t $crud->callback_add_field('id_insumo', array($this, 'empty_state_dropdown_select'));\n\t\t\t//$crud->callback_edit_field('id_insumo', array($this, 'empty_state_dropdown_select'));\n\t\t\t$crud->callback_after_insert(array($this, 'after_insert1'));\n\t\t\t$crud->callback_before_insert(array($this,'before_insert1')); \t\n\t\t\t$crud->callback_before_update(array($this,'before_update1'));\n\t\t\t$crud->callback_after_update(array($this, 'after_update1'));\n\t\n\t\t\t\t\n\t\t\t$output = $crud->render();\n\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t\t//DEPENDENT DROPDOWN SETUP\n\t\t\t$dd_data = array(\n\t\t\t\t//GET THE STATE OF THE CURRENT PAGE - E.G LIST | ADD\n\t\t\t\t'dd_state' => $crud->getState(),\n\t\t\t\t//SETUP YOUR DROPDOWNS\n\t\t\t\t//Parent field item always listed first in array, in this case countryID\n\t\t\t\t//Child field items need to follow in order, e.g stateID then cityID\n\t\t\t\t'dd_dropdowns' => array('id_equipo','id_insumo'),\n\t\t\t\t//SETUP URL POST FOR EACH CHILD\n\t\t\t\t//List in order as per above\n\t\t\t\t'dd_url' => array('', site_url().'/entregas/get_states/'),\n\t\t\t\t//LOADER THAT GETS DISPLAYED NEXT TO THE PARENT DROPDOWN WHILE THE CHILD LOADS\n\t\t\t\t'dd_ajax_loader' => base_url().'ajax-loader.gif'\n\t\t\t);\n\t\t\t$output->dropdown_setup = $dd_data;\n\t\t\t\n\t\t\t$output->content_view='crud_content_view';\n\t\t\t$this->_example_output($output);\n\t}", "private function ExibirTamanhos(){\r\n $oDadosCamiseta;\r\n $sSql = \"SELECT * FROM tamanho_camiseta\";\r\n $oDadosCamiseta = $this->Fbd->PesquisarSQL($sSql);\r\n \r\n foreach($oDadosCamiseta as $oRegistro){\r\n echo \"<option value='\".$oRegistro->sigla.\"' class='sctOptTamanho'>\".$oRegistro->nome.\"</option>\";\r\n }\r\n }", "public function pepeleraAdmins(Request $request)\n {\n ///prametro de busqueda de los administradores\n /// en este caso solo se utilizara el email y el numero de cedula\n /// sin embrago si se incremeta los campos de busqueda en la interfaz se igual funcionara\n $parametro = $request->parametroBuscar;\n\n /// eat variable almacenara el contenido a buscar\n $query = trim($request->get('query'));\n // si existe una cadena de busqueda se ejecuta la consulta con la condane encontrada\n /// caso contrario se elista a todos los usuarios que esten en el estado de con valor de 0\n if ($query != '') {\n $users = DB::table('users')\n ->where('users.' . $parametro, 'like', '%' . $query . '%')\n ->where('tipo_p', '0')\n ->where('estado_p', 1)\n ->orderBy('id', 'desc')\n ->paginate(10);\n ///retornamos los datos a la vista de la papelera y el ultimo valor definido en la busqueda\n return view('admin.dashboard.papelera.papeleraAdmins', compact('users', 'parametro'));\n\n } else {\n $parametro = 'cedula_p';\n $users = User::where('estado_p', 0)\n ->where('tipo_p', '0')\n ->paginate(10);\n ///retornamos los datos a la vista de la papelera y el ultimo valor definido en la busqueda\n return view('admin.dashboard.papelera.papeleraAdmins', compact('users', 'parametro'));\n }\n }", "public function recuperarTodos() {\n $query = \"select * from tb_atividade where id_evento = :id\";\n\n $stmt = $this->conexao->prepare($query);\n $stmt->bindValue(':id', $_GET['id']);\n // $stmt->bindValue(':id', 8);\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_OBJ);\n }", "public function confirmado(){\n if (isset($_SESSION['identity'])){\n $identity = $_SESSION['identity'];\n $oPedido = new Pedido();\n $oPedido->setUsuarioId($identity->id);\n\n $pedido = $oPedido->getOneByUser();\n\n $oPedido_Productos = new Pedido();\n $productos = $oPedido_Productos->getProductosByPedido($pedido->id);\n }\n\n require_once 'views/pedido/confirmado.php';\n }", "public function get_adminlist(){\n \n \t\t$sql4=\"SELECT * FROM admin\";\n\t $result4 = mysqli_query($this->db,$sql4);\n\t while($adminlist_data = mysqli_fetch_array($result4)){\n echo '<tr>\n <td>'.$adminlist_data[\"admin_id\"].'</td>\n <td>'.$adminlist_data[\"name\"].'</td>\n <td>'.$adminlist_data[\"password\"].'</td>\n <td>'.$adminlist_data[\"admin_type\"].'</td>\n <td>'.$adminlist_data[\"journal_id\"].'</td>\n <td class=\"text-center\">\n <a href=\"about_admin.php?admin_id='.$adminlist_data[\"admin_id\"].'\" title=\"Edit\"><i class=\"fa fa-edit\"></i></a>\n </td>\n <td class=\"text-center\">\n <a href=\"delete.php?admin_id='.$adminlist_data[\"admin_id\"].'&type=admin\" title=\"Delete\"><i class=\"fa fa-trash-o\"></i></a>\n </td>\n </tr>';\n }\n return true;\n \t}", "public function listar(){\n $sql = \"CALL sp_ListarTipoPago\";\n return ejecutarConsulta($sql);\n }", "public function getNombreAdmin() {\n\t\t\n\t\t\t$this->log->debug(\"Maintenance::getNombreAdmin() Début\");\n\t\t\t\t\n\t\t\t$total = 0;\n\t\t\n\t\t\ttry {\n\t\t\t\t$sql = \"select count(*) from tusager where role = ?\";\n\t\t\t\t$sth = $this->dbh->prepare($sql);\n\t\t\t\t$sth->execute(array(USAGER::ROLE_ADMINISTRATEUR));\n\t\t\t\t\t\n\t\t\t\t// Obtenir le nombre d'administrateurs actifs\n\t\t\t\t$total = $sth->fetchColumn();\n\t\t\t\t\t\n\t\t\t} catch (Exception $e) {\n\t\t\t\tErreur::erreurFatal('018', \"Maintenance::getNombreAdmin() - Erreur technique détectée : '\" . $e->getMessage() . $e->getTraceAsString() . \"'\", $this->log);\n\t\t\t}\n\t\t\t\t\n\t\t\t$this->log->debug(\"Maintenance::getNombreAdmin() Fin total = '$total'\");\n\t\t\n\t\t\treturn $total;\n\t\t}", "public function listar_productosMayorMenor($ordenar_producto, $p_id_seccion) {\n \n try {\n if($ordenar_producto == 1)\n {\n $sql = \"\n select \n distinct p.id_producto, \n p.descripcion,\n p.stock_actual,\n v.precio,\n i.cantidad\n from \n al_producto p inner join precio_venta_producto v\n on\n p.id_producto = v.id_producto left join al_inventario i\n on\n p.id_producto = i.id_producto inner join al_seccion s\n on\n p.id_seccion = s.id_seccion \n where\n p.id_seccion = $p_id_seccion;\n \";\n }\n if($ordenar_producto == 2)\n {\n $sql = \"\n select \n distinct p.id_producto, \n p.descripcion,\n p.stock_actual,\n v.precio,\n i.cantidad\n from \n al_producto p inner join precio_venta_producto v\n on\n p.id_producto = v.id_producto left join al_inventario i\n on\n p.id_producto = i.id_producto inner join al_seccion s\n on\n p.id_seccion = s.id_seccion \n where\n p.id_seccion = $p_id_seccion\n order by\n v.precio desc;\n \";\n }\n if($ordenar_producto == 3)\n {\n $sql = \"\n select \n distinct p.id_producto, \n p.descripcion,\n p.stock_actual,\n v.precio,\n i.cantidad\n from \n al_producto p inner join precio_venta_producto v\n on\n p.id_producto = v.id_producto left join al_inventario i\n on\n p.id_producto = i.id_producto inner join al_seccion s\n on\n p.id_seccion = s.id_seccion \n where\n p.id_seccion = $p_id_seccion\n order by\n v.precio asc \n \";\n }\n\n \n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n return $resultado;\n } catch (Exception $exc) {\n throw $exc;\n }\n }", "public function 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 listarTodos(){\n\t\t\n\t\t$sql = 'SELECT * FROM itempedido';\n\t\t$consulta = $this->conn->prepare($sql);\n\t\t$consulta->execute();\n\t\treturn ($consulta->fetchAll(PDO::FETCH_ASSOC));\n\t}", "public function run()\n {\n DB::table('permisos_roles')->insert([\n //permisos usuario\n ['rol_id' => '1', \n 'permiso_id' => '2'], \n\n ['rol_id' => '1', \n 'permiso_id' => '4'], \n\n ['rol_id' => '1', \n 'permiso_id' => '14'],\n\n ['rol_id' => '1', \n 'permiso_id' => '31'],\n \n ['rol_id' => '1', \n 'permiso_id' => '32'], \n\n ['rol_id' => '1', \n 'permiso_id' => '36'], \n\n ['rol_id' => '1', \n 'permiso_id' => '39'], \n\n ['rol_id' => '1', \n 'permiso_id' => '41'], \n\n //permisos comercio\n ['rol_id' => '2', \n 'permiso_id' => '2'],\n \n ['rol_id' => '2', \n\n 'permiso_id' => '4'],\n\n ['rol_id' => '2', \n 'permiso_id' => '7'],\n\n ['rol_id' => '2', \n 'permiso_id' => '9'],\n\n ['rol_id' => '2', \n 'permiso_id' => '10'],\n\n ['rol_id' => '2', \n 'permiso_id' => '13'],\n\n ['rol_id' => '2', \n 'permiso_id' => '14'],\n\n ['rol_id' => '2', \n 'permiso_id' => '15'],\n\n ['rol_id' => '2', \n 'permiso_id' => '16'],\n \n ['rol_id' => '2', \n 'permiso_id' => '33'],\n\n ['rol_id' => '2', \n 'permiso_id' => '35'],\n\n ['rol_id' => '2', \n 'permiso_id' => '36'],\n\n ['rol_id' => '2', \n 'permiso_id' => '50'],\n\n\n ]);\n //permisos administrador\n foreach(range(1, 64)as $index){\n DB::table('permisos_roles')->insert([\n 'rol_id' => '3',\n 'permiso_id' => $index\n ]);\n }\n }", "public function listar(){\r\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 listaVentas(){\n\n $respuesta = Datos::mdlListaVentas(\"salidas\");\n $cont =0;\n\n foreach ($respuesta as $row => $item){\n \t$cont ++;\n echo '<tr>\n <td>'.$cont.'</td>\n <td>'.$item[\"noOperacion\"].'</td>\n <td>'.$item[\"cliente\"].'</td>\n <td>'.$item[\"codProducto\"].'</td>\n <td>'.$item[\"kg\"].'</td>\n <td>'.$item[\"origen\"].'</td>\n <td>'.$item[\"destino\"].'</td>\n <td>'.$item[\"precioVenta\"].'</td>\n <td>'.$item[\"costo\"].'</td>\n <td>'.$item[\"total\"].'</td>\n <td>'.$item[\"fecha\"].'</td>\n <td><a href=\"listaVentas.php?idBorrar='.$item[\"cons\"].'\"><button class=\"btn btn-danger\">Borrar</button></a></td>\n </tr>';\n //Boton Borrar\n //Boton Editar <td><a href=\"updtCompra.php?idEditar='.$item[\"cons\"].'\"><button class=\"btn btn-warning\">Editar</button></a></td>\n }\n\n }", "public function listarPorId(){\n $query = \"select * from usuario where idusuario=?\";\n\n //preparando a consulta para a execução\n $stmt=$this->conn->prepare($query);\n\n //vamos fazer um blind(ligação) do id pesquisado\n //com o paramêtro da consulta, neste caso é o \n //ponto de interrogação\n $stmt ->bindParam(1,$this->idusuario);\n\n //executar efetivamente a consulta \n $stmt ->execute();\n\n //Organizar os dados retornados da consulta para \n // a exibição em formato de json\n // Vamos usar uma variavel e um array para associar \n // os campos da tabela\n $linha = $stmt->fetch(PDO::FETCH_ASSOC);\n\n //organizar no objeto usuario(aqrquivo usuario.php)\n //os dados retornados\n //da tabela usuario que está no banco de dados\n \n $this->email = $linha['email'];\n $this->senha = $linha['senha'];\n $this->nome = $linha['nome'];\n $this->cpf = $linha['cpf'];\n $this->telefone = $linha['telefone'];\n $this->foto = $linha['foto'];\n\n }", "public function getMenupaiIdOptions(){\n $menuItens = MenuItem::lists('titulo','id');\n $menuItens[0] = 'Nenhum';\n \n return $menuItens;\n }", "public function listNoAdminAction(Request $request)\n {\n $repository = $this\n ->getDoctrine()\n ->getManager()\n ->getRepository('SCUserBundle:User');\n \n \n //$listNoAdmin = $repository->findAll();//tous le monde \n //$listNoAdmin = $repository->noAdmin();//Que les clients \n $listNoAdmin = $repository->findby(array('isActive'=>true,'isPrimaire'=>true));//que les comptes actifs et primaire\n return $this->render('SCUserBundle:Admin:listNoAdmin.html.twig',\n array('listNoAdmin'=>$listNoAdmin )\n );\n \n \n }", "public function adminMessageList()\n {\n\n $users=[];\n $em = $this->getDoctrine()->getManager();\n $messageRepository = $em->getRepository(Message::class);\n $userRepository = $em->getRepository(User::class);\n\n $Ids = $messageRepository->findByDistinct();\n foreach ($Ids as $id)\n {\n $users[] = $userRepository->findOneBy(array('id'=>$id));\n }\n return $this->render(\"admin/message/list.html.twig\",\n array(\n 'users' => $users,\n ));\n }", "public function run()\n {\n\n $detail = new Detail();\n $detail->name = 'Sin Gestion';\n $detail->status_id = 1;\n $detail->save();\n\n // Potencial Cliente = 1\n\n $detail = new Detail();\n $detail->name = 'En Gestion';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Positivo con Correo';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Positivo sin Correo';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'No Contesta';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Solicitud de Muestras';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Agregado';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Correo por Confirmar';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Devuelto';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Envia lista de Precio';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Envio de Catalogo';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Futuros Productos';\n $detail->status_id = 1;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Posible';\n $detail->status_id = 1;\n $detail->save();\n\n\n\n // Muestras = 2\n\n\n $detail = new Detail();\n $detail->name = 'Sin Contactar';\n $detail->status_id = 2;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Por Concretar Venta';\n $detail->status_id = 2;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'En Seguimiento';\n $detail->status_id = 2;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Muestras';\n $detail->status_id = 2;\n $detail->save();\n\n // Rechazos = 3\n $detail = new Detail();\n $detail->name = 'Usan Tomates Naturales';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Precio';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Usan Salsa para Pizza';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Usan Concentrado';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Usan otro Producto';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Presetacion';\n $detail->status_id = 3;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Rechazado';\n $detail->status_id = 3;\n $detail->save();\n\n\n // Clientes Activos = 4\n\n $detail = new Detail();\n $detail->name = 'Baja';\n $detail->status_id = 4;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Promesa de Compra';\n $detail->status_id = 4;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Venta';\n $detail->status_id = 4;\n $detail->save();\n\n\n // Bajas = 5\n\n\n $detail = new Detail();\n $detail->name = 'Precio';\n $detail->status_id = 5;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Motivos Administrativos';\n $detail->status_id = 5;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Falta de Seguimiento';\n $detail->status_id = 5;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Calidad del Producto';\n $detail->status_id = 5;\n $detail->save();\n\n $detail = new Detail();\n $detail->name = 'Otros';\n $detail->status_id = 5;\n $detail->save();\n\n }", "public function listarParaUnir() {\n\t\t//de sesion, falta cambiar\n\t\t$_SESSION[\"nomCon\"] = $_GET[\"NombreCon\"];\n\t\t$juradoL = $this -> JuradoMapper -> findAllPro();\n\n\t\t$this -> view -> setVariable(\"jurado\", $juradoL);\n\t\t//falta agregar la vista, no se continuar\n\t\t$this -> view -> render(\"jurado\", \"listarUnir\");\n\t\t//falta cambiar\n\t}" ]
[ "0.7312715", "0.6461743", "0.6372398", "0.63124937", "0.62995946", "0.61365074", "0.6123557", "0.60845596", "0.60813046", "0.60681033", "0.5973322", "0.59722006", "0.5967181", "0.5941295", "0.592189", "0.5889906", "0.58878666", "0.588684", "0.5880137", "0.5872396", "0.58545655", "0.58365643", "0.5827958", "0.58203715", "0.5802564", "0.5793757", "0.5786877", "0.5769612", "0.5769237", "0.5759028", "0.5739727", "0.5732789", "0.57280517", "0.5724297", "0.5724108", "0.57171166", "0.5712752", "0.5693731", "0.56895417", "0.5678776", "0.5673269", "0.56663096", "0.56562465", "0.56497175", "0.56453544", "0.56316674", "0.5625207", "0.56179065", "0.5606466", "0.5606051", "0.5595731", "0.5589106", "0.55880743", "0.5577052", "0.55752736", "0.556187", "0.55616826", "0.5559347", "0.55521655", "0.5548862", "0.5546202", "0.55418366", "0.55343145", "0.5526779", "0.5525093", "0.5524858", "0.551749", "0.5516766", "0.5515303", "0.5509343", "0.5507164", "0.55018944", "0.54983056", "0.54938227", "0.54866296", "0.54865813", "0.5485659", "0.54821837", "0.5482133", "0.5480133", "0.5478606", "0.54780775", "0.547627", "0.54723144", "0.5469179", "0.5467239", "0.54611313", "0.54592204", "0.54565585", "0.54550725", "0.5454961", "0.545414", "0.54512584", "0.544933", "0.5448557", "0.5443222", "0.5442698", "0.54373807", "0.54368824", "0.54360896", "0.5435028" ]
0.0
-1
Send HTTP POST Request
function PPHttpPost($methodName_, $nvpStr_) { // Set up your API credentials, PayPal end point, and API version. $API_UserName = urlencode('eshop_1309605309_biz_api1.gmail.com'); $API_Password = urlencode('1309605353'); $API_Signature = urlencode('AiPC9BjkCyDFQXbSkoZcgqH3hpacA4TlLrMdwUVOcGq8BK4tNk9Rdji5'); $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp"; $version = urlencode('51.0'); // Set the curl parameters. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $API_Endpoint); curl_setopt($ch, CURLOPT_VERBOSE, 1); // Turn off the server and peer verification (TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); // Set the API operation, version, and API signature in the request. $nvpreq = "METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_"; // Set the request as a POST FIELD for curl. curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq); // Get response from the server. $httpResponse = curl_exec($ch); if(!$httpResponse) { exit("$methodName_ failed: ".curl_error($ch).'('.curl_errno($ch).')'); } // Extract the response details. $httpResponseAr = explode("&", $httpResponse); $httpParsedResponseAr = array(); foreach ($httpResponseAr as $i => $value) { $tmpAr = explode("=", $value); if(sizeof($tmpAr) > 1) { $httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1]; } } if((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) { exit("Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint."); } return $httpParsedResponseAr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function httpPOST($url, array $data, $headers = '') {\n $this->ensureOpened(__FUNCTION__);\n $query = http_build_query($data, '', '&');\n ($headers = trim($headers) === '') or $headers .= \"\\r\\n\";\n\n $headers = \"POST $url HTTP/1.0\\r\\n\".\n $headers.\n \"Content-Type: application/x-www-form-urlencoded\\r\\n\".\n \"Content-Length: \".strlen($query).\"\\r\\n\".\n \"$query\\r\\n\";\n\n $this->write($headers);\n return $this->readAllAndClose();\n }", "function post(Request &$request, Response &$response);", "public function send_post_request(){\n $url = \\Request::get('url');\n $post_array = \\Request::all();\n\n//\t\t$url = 'http://localhost/_websites/ahmed-badawy.com/site/json-test';\n//\t\t$post_array = array('type' => 'scss', 'source' => '.pre{color:red;background-color:green;}', 'compress'=>true);\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_array);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $query = curl_exec($ch);\n curl_close($ch);\n\n return $query;\n }", "public function post();", "public function post();", "public function post();", "public function httpPost()\n {\n return $this->method(\"POST\");\n }", "private function POST() {\n global $_POST;\n $postData = array();\n foreach($_POST as $key => $value) {\n $postData[$key] = $value;\n }\n $this -> response[\"response\"] = $postData;\n return;\n }", "function httpPOST($url, $data)\n{\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($curl);\n curl_close($curl);\n return $response;\n}", "abstract public function post($data);", "private function _httpPost($fields)\n {\n $fields_string = http_build_query($fields);\n //open connection\n $ch = curl_init();\n\n //set the url, number of POST vars, POST data\n curl_setopt($ch,CURLOPT_URL,$this->_getFullUrl());\n curl_setopt($ch,CURLOPT_POST,count($fields));\n curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n\n //execute post\n $result = curl_exec($ch);\n\n //close connection\n curl_close($ch);\n\n return $result;\n }", "function send_request($postdata = \"\") {\n\t\tif(!is_array($postdata) ) $postdata = array();\n\t\t\n\t\t$url = $this->_build_url();\n\t\t\n\t\tif(!isset($postdata['ip_address'])) $postdata['ip_address'] = $this->_get_client_ip();\n\t\tif(!isset($postdata['user_agent'])) $postdata['user_agent'] = $this->_get_client_user_agent();\n\t\t$postdata['api_key'] = $this->api_key;\n\n\t\t$ch = curl_init($url);\n\n\t\tcurl_setopt($ch, CURLOPT_POST ,1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, 'json='.$this->_json_encode($postdata));\n\t\tcurl_setopt($ch, CURLOPT_HEADER ,0); \n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT ,10);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\t\t\n\n\t\t$return_data = curl_exec($ch);\n\n\t\treturn $return_data;\n\t}", "function ccweb_httpPost2($url, $data, &$outResponse) { \r\n $params = array('http' => array('method' => 'POST', 'content' => $data)); \r\n $context = stream_context_create($params);\r\n\r\n $fh = fopen($url, 'rb', false, $context);\r\n if (!$fh) {return FALSE;} \r\n \r\n $response = stream_get_contents($fh); \r\n if ($response === false) {return FALSE;} \r\n \r\n $outResponse = $response; \r\n return TRUE; \r\n}", "function doPOST (HttpRequest $request, HttpResponse $response) {\n throw new Exception(\"POST method not supported\");\n }", "function sendRequest()\n\t\t{\n\t\t\t$stream = $this->getRequestStream();\n\t\t\t$stream->write( $this->getRequestString() );\n\t\t\t$stream->close();\n\t\t}", "function do_post_request($url, $data, $optional_headers = null)\n {\n\t \n$params = array('http' => array(\n 'method' => 'POST',\n 'content' => $data\n ));\n if ($optional_headers !== null) {\n $params['http']['header'] = $optional_headers;\n }\n $ctx = stream_context_create($params);\n $fp = @fopen($url, 'rb', false, $ctx);\n if (!$fp) {\n throw new Exception(\"Problem with $url, $php_errormsg\");\n }\n $response = @stream_get_contents($fp);\n if ($response === false) {\n throw new Exception(\"Problem reading data from $url, $php_errormsg\");\n }\n\t //print_r($response);\n return $response;\n }", "public function doPostRequest($url, $data, $headers = array('Content-Type: application/x-www-form-urlencoded')) {\r\n $php_errormsg = '';\r\n if (is_array($data)) {\r\n $data = http_build_query($data, '', '&');\r\n }\r\n $params = array('http' => array(\r\n 'method' => 'POST',\r\n 'content' => $data)\r\n );\r\n if ($headers !== null) {\r\n $params['http']['header'] = $headers;\r\n }\r\n $ctx = stream_context_create($params);\r\n $fp = fopen($url, 'rb', false, $ctx);\r\n if (!$fp) {\r\n return \"Error: gateway is inaccessible\";\r\n }\r\n //stream_set_timeout($fp, 0, 250);\r\n try {\r\n $response = stream_get_contents($fp);\r\n if ($response === false) {\r\n throw new Exception(\"Problem reading data from $url, $php_errormsg\");\r\n }\r\n return $response;\r\n } catch (Exception $e) {\r\n $response = $e->getMessage();\r\n return $response;\r\n }\r\n}", "public function request_post($uri, array $options = array()) {\n $options['method'] = 'POST';\n return $this->request($uri, $options);\n }", "public function post($url, $body){\n\t\t\n\t\t// do we even need this?\n\t\t// $headers = array('Content-Type: application/x-www-form-urlencoded')\n\t\t\n\t\treturn $this->doRequest('POST', $url, $body);\n }", "public function post($data)\n {\n // Get parts of URL\n $this->url = parse_url($this->url);\n if (!$this->url) {\n return \"couldn't parse url\";\n }\n\n // Provide defaults for port and query string\n if (!isset($this->url['port'])) {\n $this->url['port'] = \"\";\n }\n\n if (!isset($this->url['query'])) {\n $this->url['query'] = \"\";\n }\n\n // Build POST string\n $encoded = \"\";\n foreach ($data as $k => $v) {\n $encoded .= ($encoded ? \"&\" : \"\");\n $encoded .= rawurlencode($k) . \"=\" . rawurlencode($v);\n }\n\n // Open socket on host\n $fp = fsockopen($this->url['host'], $this->url['port'] ? $this->url['port'] : 80);\n if (!$fp) {\n return \"failed to open socket to {$this->url['host']}\";\n }\n\n // Send HTTP 1.0 POST request to host\n fputs($fp, sprintf(\"POST %s%s%s HTTP/1.0\\n\", $this->url['path'], $this->url['query'] ? \"?\" : \"\", $this->url['query']));\n fputs($fp, \"Host: {$this->url['host']}\\n\");\n fputs($fp, \"Content-type: application/x-www-form-urlencoded\\n\");\n fputs($fp, \"Content-length: \" . strlen($encoded) . \"\\n\");\n fputs($fp, \"Connection: close\\n\\n\");\n fputs($fp, \"$encoded\\n\");\n\n // Read the first line of data, only accept if 200 OK is sent\n $line = fgets($fp, 1024);\n if (!preg_match('/^HTTP\\/1\\.. 200/i', $line)) {\n return;\n }\n\n // Put everything, except the headers to $results\n $results = '';\n $inheader = true;\n\n while(!feof($fp)) {\n $line = fgets($fp, 1024);\n\n if ($inheader && ($line == \"\\n\" || $line == \"\\r\\n\")) {\n $inheader = FALSE;\n } elseif (!$inheader) {\n $results .= $line;\n }\n }\n fclose($fp);\n\n // Return with data received\n return $results;\n }", "public function post($t);", "function Send($url, $POST){ //работа с CURL'ом\n\t$ch = curl_init();// Устанавливаем соединение\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $POST);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\n\t$result = curl_exec($ch);\n\n\tif($result === false) print $err = curl_error($ch);\n\n\treturn $result;\n}", "public function send()\n {\n $queryString = $this->buildQueryString();\n\n $headers = array(\n 'method' => 'POST',\n 'content' => $this->buildQueryString(),\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\" .\n \"Content-Length: \" . strlen($queryString) . \"\\r\\n\\r\\n\"\n );\n\n $request = file_get_contents(\n $this->getPaypalUrl(),\n false,\n stream_context_create(array('http' => $headers))\n );\n\n return new Response($request);\n }", "function post_request($url, $port, $dataid, $tStamp, $encodedSignature, $data, $referer = '')\n {\n //$data = http_build_query($data);\n\n // parse the given URL\n $url = parse_url($url);\n\n if ($url['scheme'] != 'http') {\n die('Error: Only HTTP request are supported !');\n }\n\n // extract host and path:\n $host = $url['host'];\n $path = $url['path'];\n\n // open a socket connection on port 80 - timeout: 50 sec\n $fp = fsockopen($host, $port, $errno, $errstr, 50);\n\n if ($fp) {\n\n // send the request headers:\n fputs($fp, \"POST $path HTTP/1.1\\r\\n\");\n fputs($fp, \"Host: $host\\r\\n\");\n\n if ($referer != '')\n fputs($fp, \"Referer: $referer\\r\\n\");\n\n fputs($fp, \"x-cons-id: \" . $dataid . \"\\r\\n\");\n fputs($fp, \"x-timestamp: \" . $tStamp . \"\\r\\n\");\n fputs($fp, \"x-signature: \" . $encodedSignature . \"\\r\\n\");\n fputs($fp, \"Content-Type: application/x-www-form-urlencoded\\r\\n\");\n fputs($fp, \"Content-length: \" . strlen($data) . \"\\r\\n\");\n fputs($fp, \"Connection: close\\r\\n\\r\\n\");\n fputs($fp, $data);\n\n $result = '';\n while (!feof($fp)) {\n // receive the results of the request, 128 char\n $result .= fgets($fp, 128);\n }\n } else {\n return array(\n 'status' => 'err',\n 'error' => \"$errstr ($errno)\"\n );\n }\n\n // close the socket connection:\n fclose($fp);\n\n // split the result header from the content\n $result = explode(\"\\r\\n\\r\\n\", $result, 2);\n $header = isset($result[0]) ? $result[0] : '';\n $content = isset($result[1]) ? $result[1] : '';\n\n // return as structured array:\n return array(\n 'status' => 'ok',\n 'header' => $header,\n 'content' => $content\n );\n\n }", "public function httpPost($redirectTo = null) : string;", "private function POST($url,$params=false){\n return $this->Request($url,$params,HTTP_POST);\n }", "protected function makePostRequest($uri, $params) {\n $curl = curl_init();\n\n curl_setopt($curl, CURLOPT_URL,$this->server_url . $uri);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS,\n http_build_query($params));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n $output = curl_exec($curl);\n $this->response = $output;\n $this->response_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n curl_close ($curl);\n }", "function mi_http_request($url, $data)\r\n{\r\n\r\n $curl = curl_init($url);\r\n curl_setopt($curl, CURLOPT_POST, true);\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($curl);\r\n curl_close($curl);\r\n return $response;\r\n}", "function do_post_request($url, $data, $optional_headers = null)\n{\n $params = array('http' => array(\n 'method' => 'POST',\n 'content' => $data\n ));\n if ($optional_headers !== null) {\n $params['http']['header'] = $optional_headers;\n }\n $ctx = stream_context_create($params);\n $fp = @fopen($url, 'rb', false, $ctx);\n if (!$fp) {\n throw new Exception(\"Problem with $url, $php_errormsg\");\n }\n $response = @stream_get_contents($fp);\n if ($response === false) {\n throw new Exception(\"Problem reading data from $url, $php_errormsg\");\n }\n return $response;\n}", "public function post($url, $body = array(), $query = array(), $headers = array());", "function ticketbud_http_post($request, $host, $path, $port = 80, $ip=null) {\n\tglobal $wp_version;\n\t\n\t$ticketbud_version = constant('TICKETBUD_VERSION');\n\n\t$http_request = \"POST $path HTTP/1.0\\r\\n\";\n\t$http_request .= \"Host: $host\\r\\n\";\n\t$http_request .= \"Content-Type: application/x-www-form-urlencoded; charset=\" . get_option('blog_charset') . \"\\r\\n\";\n\t$http_request .= \"Content-Length: \" . strlen($request) . \"\\r\\n\";\n\t$http_request .= \"User-Agent: WordPress/$wp_version | Ticketbud/$ticketbud_version\\r\\n\";\n\t$http_request .= \"\\r\\n\";\n\t$http_request .= $request;\n\t\n\t$http_host = $host;\n\t// use a specific IP if provided - needed by ticketbud_check_server_connectivity()\n\tif ( $ip && long2ip(ip2long($ip)) ) {\n\t\t$http_host = $ip;\n\t} else {\n\t\t$http_host = ticketbud_get_host($host);\n\t}\n\n\t$response = '';\n\tif( false != ( $fs = @fsockopen($http_host, $port, $errno, $errstr, 10) ) ) {\n\t\tfwrite($fs, $http_request);\n\n\t\twhile ( !feof($fs) )\n\t\t\t$response .= fgets($fs, 1160); // One TCP-IP packet\n\t\tfclose($fs);\n\t\t$response = explode(\"\\r\\n\\r\\n\", $response, 2);\n\t}\n\treturn $response;\n}", "function http_post($url, $post_string) {\n\t\t\n\t\t// add any additional curl options here\n\t\t$options = array(CURLOPT_URL => $url,\n\t\tCURLOPT_POST => true,\n\t\tCURLOPT_POSTFIELDS => $post_string,\n\t\tCURLOPT_USERAGENT => $this->user_agent);\n\t\t\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, $options);\n\t\t\n\t\t$response = curl_exec($ch);\n\t\t$this->last_response = $response;\n\t\t$info = curl_getinfo($ch);\n\t\t\n\t\tcurl_close($ch);\n\t\t\n\t\t// all good\n\t\tif ($info['http_code'] == 204)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public function post($request);", "public function postRequest(SS_HTTPRequest $request, SS_HTTPResponse $response, DataModel $model);", "static function post($url, $body = null, $headers = array()) {\n $request = new NiceHTTP\\PostRequest($url, $body, $headers);\n return $request->send();\n }", "function http_post($url, $params = array()) {\n $postData = '';\n //create name value pairs seperated by &\n foreach ($params as $k => $v) {\n $postData .= $k . '=' . $v . '&';\n }\n $postData = rtrim($postData, '&');\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_POST, count($postData));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);\n $output = curl_exec($ch);\n\n curl_close($ch);\n return $output;\n}", "public function post($requestUrl, $requestBody, array $requestHeaders = []);", "function post_request($url, $param)\n{\n //リクエスト時のオプション指定\n $options = array(\n 'http' => array(\n 'method' => 'POST', //ここでPOSTを指定\n 'header' => array(\n 'Content-type: application/x-www-form-urlencoded',\n 'User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1'\n ),\n 'content' => http_build_query($param),\n 'ignore_errors' => true,\n 'protocol_version' => '1.1'\n ),\n 'ssl' => array(\n 'verify_peer' => false,\n 'verify_peer_name' => false\n )\n );\n\n //リクエスト実行\n $contents = @file_get_contents($url, false, stream_context_create($options));\n\n //ステータスコード抜粋\n preg_match('/HTTP\\/1\\.[0|1|x] ([0-9]{3})/', $http_response_header[0], $matches);\n $statusCode = (int)$matches[1];\n\n //配列で返すためにjsonのエンコード\n $contents_array = array();\n if($statusCode === 200){\n $contents_array = json_decode($contents);\n }\n return $contents_array;\n}", "private function postRequest($data)\n {\n $queryString = http_build_query($data);\n\n $opts = [\n 'http' => [\n 'method' => 'POST',\n 'header' => 'Content-Type: application/x-www-form-urlencoded',\n 'content' => $queryString,\n ],\n ];\n\n $context = stream_context_create($opts);\n\n $url = $this->host . '/api/log/write/' . $this->token . '/';\n\n return file_get_contents($url,\n false,\n $context);\n }", "function wget_post($url, $data) {\n //if ($data == null) $data = array(\"\"=>\"\");\n $options = array(\n 'http' => array(\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n //'header'=> \"Content-Type: application/json\\r\\n\" .\n // \"Accept: application/json\\r\\n\",\n 'method' => 'POST',\n 'content' => http_build_query($data),\n ),\n );\n $context = stream_context_create($options);\n return file_get_contents($url, false, $context);\n}", "function hsend_post(&$app, &$c) {\n\t\t$app->logger->debug(sprintf('%s::%s', __CLASS__, __FUNCTION__));\n\n\t\t$this->_http->setMethod(HTTP_REQUEST_METHOD_POST);\n\n\t\t$this->_http->setURL($c->param('app.view_http.request.uri'));\n\n\t\t$this->_set_basic_auth($app, $c);\n\n\t\t$this->_load_post_params($app, $c);\n\n\t\t$this->_load_headers($app, $c);\n\n\t\t$this->_load_body($app, $c);\n\n\t\t$this->_load_files($app, $c);\n\n\t\t$this->_http->sendRequest();\n\n\t\t$this->_handler_response($app, $c);\n\n\t\treturn $app->status->handled;\n\t}", "abstract public function post();", "public function sendPOST($cmd, array $postData = [])\n\t{\n\t\t?>\n\t\t<html>\n\t\t\t<head>\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<form method=\"post\" action=\"<?php echo $_SERVER['SCRIPT_URL'];?>\" style=\"display: none; visibility: hidden;\">\n\t\t\t\t\t<input type=\"hidden\" name=\"cmd\" value=\"<?php echo $cmd; ?>\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $postData as $k => $v )\n\t\t\t\t\t\techo \"<input type=\\\"hidden\\\" name=\\\"$k\\\" value=\\\"\" . htmlspecialchars($v) . \"\\\">\";\n\t\t\t\t\t?>\n\t\t\t\t</form>\n\t\t\t\t<script>\n\t\t\t\tdocument.forms[0].submit();\n\t\t\t\t</script>\n\t\t\t</body>\n\t\t</html>\n\t\t<?php\n\t\t\n\t\t// halting script here\n\t\tdie();\n\t}", "function Post( $uri, $query_params=\"\" )\r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Post( $uri, $query_params )\\n\";\r\n\t\t$uri = $this->makeUri( $uri );\r\n\t\tif( is_array($query_params) ) {\r\n\t\t\t$postArray = array();\r\n\t\t\tforeach( $query_params as $k=>$v ) {\r\n\t\t\t\t$postArray[] = urlencode($k) . \"=\" . urlencode($v);\r\n\t\t\t}\r\n\t\t\t$this->requestBody = implode( \"&\", $postArray);\r\n\t\t}\r\n\t\t// set the content type for post parameters\r\n\t\t$this->addHeader( 'Content-Type', \"application/x-www-form-urlencoded\" );\r\n// done in sendCommand()\t\t$this->addHeader( 'Content-Length', strlen($this->requestBody) );\r\n\r\n\t\tif( $this->sendCommand( \"POST $uri HTTP/$this->protocolVersion\" ) )\r\n\t\t\t$this->processReply();\r\n\t\t$this->removeHeader('Content-Type');\r\n\t\t$this->removeHeader('Content-Length');\r\n\t\t$this->requestBody = \"\";\r\n\t\treturn $this->reply;\r\n\t}", "protected function postRequest($data) {\n $ch = curl_init($this->post_url);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type:application/xml',\n 'Gepg-Com:default.sp.in',\n 'Gepg-Code:' . $this->sp_code,\n 'Content-Length:' . strlen($data))\n );\n curl_setopt($ch, CURLOPT_TIMEOUT, 5);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n $resultCurlPost = curl_exec($ch);\n curl_close($ch);\n\t\t\n\t\t//to be separated\n\t\t$date_createdsc=date(\"Y-m-d H:i:s\");\n\t\t\tYii::$app->db->createCommand()\n ->insert('gepg_bill7', [\n 'response_message' =>$data,\n 'date_created' =>$date_createdsc, \n ])->execute();\n\t\t//end to be separate\t\t\n return $resultCurlPost;\n }", "function send_request( $http_method, $url, $auth_header = null, $postData = null ) {\n\t$curl = curl_init( $url );\n\tcurl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $curl, CURLOPT_FAILONERROR, false );\n\tcurl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );\n\n\tswitch( $http_method ) {\n\t\tcase 'GET':\n\t\t\tif( $auth_header ) {\n\t\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( $auth_header ) );\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'POST':\n\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/atom+xml',\n\t\t\t\t$auth_header ) );\n\t\t\tcurl_setopt( $curl, CURLOPT_POST, 1 );\n\t\t\tcurl_setopt( $curl, CURLOPT_POSTFIELDS, $postData );\n\t\t\tbreak;\n\t\tcase 'PUT':\n\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/atom+xml',\n\t\t\t\t$auth_header ) );\n\t\t\tcurl_setopt( $curl, CURLOPT_CUSTOMREQUEST, $http_method );\n\t\t\tcurl_setopt( $curl, CURLOPT_POSTFIELDS, $postData );\n\t\t\tbreak;\n\t\tcase 'DELETE':\n\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( $auth_header ) );\n\t\t\tcurl_setopt( $curl, CURLOPT_CUSTOMREQUEST, $http_method );\n\t\t\tbreak;\n\t}\n\t$response = curl_exec( $curl );\n\tif( !$response ) {\n\t\t$response = curl_error( $curl );\n\t}\n\tcurl_close( $curl );\n\treturn $response;\n}", "public function postData(){\n\t\t$url = $this->host . \"/rest/v1/leads.json?access_token=\" . $this->getToken();\n\t\t$ch = curl_init($url);\n\t\t$requestBody = $this->bodyBuilder();\n\t\t//debug\n\t\t//print_r($requestBody);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('accept: application/json','Content-Type: application/json'));\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $requestBody);\n\t\tcurl_getinfo($ch);\n\t\t$response = curl_exec($ch);\n\t\treturn $response;\n\t}", "public function postSend()\n {\n }", "public function request() {\r\n\t\t$this->verbose('protocol', $this->protocol);\r\n\t\t$this->verbose('method', $this->method);\r\n\t\t$this->verbose('host', $this->host);\r\n\t\t$this->verbose('path', $this->path);\r\n\t\t$this->verbose('query', $this->query);\r\n\t\t$this->verbose('headers', $this->headers);\r\n\t\t$this->verbose('body', $this->body);\r\n\t\t$this->verbose('timeout', $this->timeout);\r\n\r\n\t\t$this->addQueryToPath();\r\n\t\t$this->verbose('path + query', $this->path);\r\n\t\t$this->cleanHost();\r\n\t\t$this->verbose('cleanHost', $this->host);\r\n\r\n\t\t$url = $this->protocol . '://' . $this->host . $this->path;\r\n\t\t$this->verbose('url', $url);\r\n\r\n\t\t$this->headers['Authorization'] = $this->makeAuthHeader();\r\n\r\n\r\n\t\tforeach ($this->headers as $header_key => $header_value) {\r\n\t\t\t$header_array[] = $header_key . \":\" . $header_value;\r\n\t\t}\r\n\r\n\t\t$ch = curl_init();\r\n\t\t$options = array(\r\n\t\t\tCURLOPT_URL => $url,\r\n\t\t\tCURLOPT_RETURNTRANSFER => 1,\r\n\t\t\tCURLOPT_CUSTOMREQUEST => $this->method,\r\n\t\t\tCURLOPT_POSTFIELDS => $this->body,\r\n\t\t\tCURLOPT_HEADER => false,\r\n\t\t\tCURLINFO_HEADER_OUT => true,\r\n\t\t\tCURLOPT_HTTPHEADER => $header_array,\r\n\t\t\tCURLOPT_TIMEOUT => $this->timeout\r\n\t\t);\r\n\t\tcurl_setopt_array($ch, $options);\r\n\r\n\t\t$this->verbose('body at exec', $this->body);\r\n\t\t$response_body = curl_exec($ch);\r\n\t\t$response_error = curl_error($ch);\r\n\t\t$response_headers = curl_getinfo($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$response['error'] = $response_error;\r\n\t\t$response['body'] = $response_body;\r\n\t\t$response['header'] = $response_headers;\r\n\t\treturn $response;\r\n\t}", "function post($url, $data = null, $options = array()) {\n\t\treturn $this->request($url, array_merge(array('method' => 'POST', 'body' => $data), $options));\n\t}", "public function post($post);", "public function post(array $parameters);", "public function post(array $parameters);", "public function post(array $parameters);", "function doPost($url, $post = array() , $format = 'plain')\n{\n return curlExecute($url, 'post', $post, $format);\n}", "public function post()\n {\n #HTTP method in uppercase (ie: GET, POST, PATCH, DELETE)\n $sMethod = 'POST';\n $sTimeStamp = gmdate('c');\n\n #Creating the hash\n\t\t$oHash = new Hash($this->getSecretKey());\n\t\t$oHash->addData($this->getPublicKey());\n\t\t$oHash->addData($sMethod);\n\t\t$oHash->addData($this->getApiResource());\n\t\t$oHash->addData($this->getData());\n\t\t$oHash->addData($sTimeStamp);\n\n\t\t$sHash = $oHash->hash();\n\n $rCurlHandler = curl_init();\n curl_setopt($rCurlHandler, CURLOPT_URL, $this->getApiRoot() . $this->getApiResource());\n curl_setopt($rCurlHandler, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($rCurlHandler, CURLOPT_POSTFIELDS, $this->getData());\n curl_setopt($rCurlHandler, CURLOPT_CUSTOMREQUEST, $sMethod);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYHOST, 0);\n\n curl_setopt($rCurlHandler, CURLOPT_HTTPHEADER, [\n \"x-date: \" . $sTimeStamp,\n \"x-hash: \" . $sHash,\n \"x-public: \" . $this->getPublicKey(),\n \"Content-Type: text/json\",\n ]);\n $sOutput = curl_exec($rCurlHandler);\n $iHTTPCode = curl_getinfo($rCurlHandler, CURLINFO_HTTP_CODE);\n curl_close($rCurlHandler);\n\n Log::write('WebRequest', 'POST::REQUEST', $this->getApiRoot() . $this->getApiResource());\n Log::write('WebRequest', 'POST::DATA', $this->getData());\n Log::write('WebRequest', 'POST::HTTPCODE', $iHTTPCode);\n Log::write('WebRequest', 'POST::RESPONSE', $sOutput);\n\n $this->setData('');\n\n if (!in_array($iHTTPCode, [200, 201, 204])) {\n throw new InvalidApiResponse('HttpCode was ' . $iHTTPCode . '. Expected 200|201 on [POST] ' . $this->getApiRoot() . $this->getApiResource());\n }\n return $sOutput;\n }", "function make_post_call($mid_url, $post_values) {\n global $base_url, $end_url;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $base_url . $mid_url . $end_url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($post_values));\n \n $output = curl_exec($curl);\n curl_close($curl);\n \n return $output;\n }", "private function initPostRequest()\n {\n $this\n ->addCurlOption(CURLOPT_URL, $this->getUrl())\n ->addCurlOption(CURLOPT_CUSTOMREQUEST, HttpMethodResolver::HTTP_POST)\n ->addCurlOption(CURLOPT_POSTFIELDS, $this->getQuery())\n ;\n }", "public static function sendPost($_url, $_data, $_headers = [],\n $_return_header = true)\n {\n return self::sendCurl($_url,\n array(\n CURLOPT_SSL_VERIFYHOST => false,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_FOLLOWLOCATION => 0,\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => $_data,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_HTTPHEADER => $_headers,\n CURLOPT_HEADER => $_return_header\n ));\n }", "public function post( array $postFields );", "public function https_post($url, $data = [] , $is_raw = false){\n// $this->response = $curl->post($url , $data , $is_raw)\n// ->setHeader('X-Requested-With', 'XMLHttpRequest')\n// ->setHeader(\"Accept\" , 'application/json')\n// ->setHeader('Content-Type' , 'application/json')\n// //->setOpt(CURLOPT_PROXY , '127.0.0.1:8888')\n// ->response;\n\n $header = [\n 'Accept:application/json' , 'Content-Type:application/json'\n ];\n $this->response = $this->https_request($url , json_encode($data ) , $header);\n\n return $this;\n }", "public function post(array $params);", "function send_post()\n { \n $send = new send();\n\n $send->date_created = date('Y-m-d H:i:s');\n $send->createdbypk = $this->get_user()->user_id;\n $send->date_modified = date('Y-m-d H:i:s');\n $send->modifiedbypk = $this->get_user()->user_id;\n\n $this->response($this->_send_save($send, 'post'));\n }", "public static function post($uri,$params=[],$options=[]) {\n return self::request('POST',$uri,$params,$options);\n }", "function http_post_contents($pay_server, $post_data){\n $timeout = 30;\n $ch = curl_init(); \n // set URL and other appropriate options\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_URL, $pay_server);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n $file_contents = curl_exec($ch);\n curl_close($ch);\n \n return $file_contents; \n}", "function postDataToServerUsingCurl( $post, $rel_url )\n\t{\n\t\t$url\t\t= \"https://api.razorpay.com/v1/\" . $rel_url;\n\t\t$post_json = json_encode($post);\n\t\t$headers = array();\n\t\t$headers[] = \"Content-Type: application/json\";\n\t\t$options = array(\n\t\t\tCURLOPT_POST\t\t => true,\n\t\t\tCURLOPT_POSTFIELDS\t => $post_json,\n\t\t\tCURLOPT_URL\t\t\t => $url,\n\t\t\tCURLOPT_USERPWD\t\t => $this->password,\n\t\t\tCURLOPT_RETURNTRANSFER => true, // return web page\n\t\t\tCURLOPT_HTTPHEADER\t => $headers,\n\t// CURLOPT_HEADER => false, // don't return headers\n\t// CURLOPT_FOLLOWLOCATION => true, // follow redirects\n\t// CURLOPT_ENCODING => \"\", // handle all encodings\n\t// CURLOPT_USERAGENT => \"spider\", // who am i\n\t// CURLOPT_AUTOREFERER => true, // set referer on redirect\n\t\t\tCURLOPT_CONNECTTIMEOUT => 20, // timeout on connect\n\t\t\tCURLOPT_TIMEOUT => 120, // timeout on response\n\t\t\tCURLOPT_MAXREDIRS => 10, // stop after 10 redirects\n\t\t\tCURLOPT_SSL_VERIFYPEER => true, // enable SSL Cert checks\n\t\t\tCURLOPT_SSL_VERIFYHOST => 2,\n\t\t\tCURLOPT_SSLVERSION\t => CURL_SSLVERSION_TLSv1_2\n\t\t);\n\n\t\t$ch = curl_init( $url );\n\t\tcurl_setopt_array( $ch, $options );\n\t\t$result = curl_exec( $ch );\n\t\tif (curl_errno($ch))\n\t\t {\n\t\t\techo 'Error:' . curl_error($ch);\n\t\t }\n\t\tcurl_close( $ch );\n\t\treturn json_decode($result);\n\t}", "function PPHttpPost($url_, $postFields_, $parsed_)\n\t{\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$url_);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$postFields_);\n\n\t\t//getting response from server\n\t\t$httpResponse = curl_exec($ch);\n\n\t\tif(!$httpResponse) {\n\t\t\treturn array(\"status\" => false, \"error_msg\" => curl_error($ch), \"error_no\" => curl_errno($ch));\n\t\t}\n\n\t\tif(!$parsed_) {\n\t\t\treturn array(\"status\" => true, \"httpResponse\" => $httpResponse);\n\t\t}\n\n\t\t$httpResponseAr = explode(\"\\n\", $httpResponse);\n\n\t\t$httpParsedResponseAr = array();\n\t\tforeach ($httpResponseAr as $i => $value) {\n\t\t\t$tmpAr = explode(\"=\", $value);\n\t\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t\t}\n\t\t}\n\n\t\tif(0 == sizeof($httpParsedResponseAr)) {\n\t\t\t$error = \"Invalid HTTP Response for POST request($postFields_) to $url_.\";\n\t\t\treturn array(\"status\" => false, \"error_msg\" => $error, \"error_no\" => 0);\n\t\t}\n\t\treturn array(\"status\" => true, \"httpParsedResponseAr\" => $httpParsedResponseAr);\n\n\t}", "function testSimplePost() {\n \n $curlAdapter = new CurlAdapter();\n \n $post = array (\n 'SECURITY.SENDER' => '31HA07BC8142C5A171745D00AD63D182',\n 'USER.LOGIN' => '31ha07bc8142c5a171744e5aef11ffd3',\n 'USER.PWD' => '93167DE7',\n 'TRANSACTION.MODE' => 'CONNECTOR_TEST',\n 'TRANSACTION.CHANNEL' => '31HA07BC8142C5A171744F3D6D155865',\n 'PAYMENT.CODE' => 'CC.RG',\n 'FRONTEND.MODE' => 'WHITELABEL',\n 'FRONTEND.ENABLED' => 'TRUE',\n 'FRONTEND.LANGUAGE' => 'EN',\n 'FRONTEND.RESPONSE_URL' => 'http://dev.heidelpay.de',\n 'CONTACT.IP' => '127.0.0.1',\n 'REQUEST.VERSION' => '1.0'\n \n );\n \n $result = $curlAdapter->sendPost('https://test-heidelpay.hpcgw.net/ngw/post', $post);\n \n \n $this->assertTrue(is_array($result[0]), 'First result key should be an array.');\n $this->assertTrue(is_object($result[1]), 'Secound result key should be an object.');\n \n \n $this->assertFalse($result[1]->isError(), 'isError should return true');\n $this->assertTrue($result[1]->isSuccess(), 'isSuccess should return false');\n \n }", "public function doPost(array $parsed_body);", "function request_post_api($url=\"\",$post=\"\") {\n\tif(empty($url))\n\t\treturn false;\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL,$url);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\tif($post){\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); \t\t\n\t}\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t$response = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $response;\n}", "public static function sendPostRequest(String $resource, array $data)\n {\n static::init();\n $curl = new UKMCURL();\n $curl->json($data);\n $curl->requestType(\"POST\");\n $curl->user('userpwd:' . static::$api_key);\n\n return new Result($curl->request(static::_getUrl($resource)));\n }", "public static function doPost(Array $params) {\n $params['requestMethod'] = 'POST';\n $params['tryNum'] = 5;\n return self::doGet($params);\n }", "private function postData($host, $path, $useSSL, $data){\r\n\t\t// define port and protocol\r\n\t\t$port = 443;\r\n\t\t$protocol = \"ssl://\";\r\n\t\tif (!$useSSL){\r\n\t\t\t$port = 80;\r\n\t\t\t$protocol = \"\";\r\n\t\t}\r\n\t\t\r\n\t\t$poststring = \"\";\r\n\t\tforeach ($data as $key => $val){\r\n\t\t\t// build the string of data to use in POST\r\n\t\t\tif (is_array($val)){\r\n\t\t\t\tforeach ($val as $sub_key => $sub_val){\r\n\t\t\t\t\t$poststring .= urlencode($key) . \"=\" . urlencode($sub_val) . \"&\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$poststring .= urlencode($key) . \"=\" . urlencode($val) . \"&\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t// strip off trailing ampersand\r\n\t\t$poststring = substr($poststring, 0, -1);\r\n\t\t\r\n\t\t// open the socket\r\n\t\t$fp = fsockopen($protocol . $host, $port, $errno, $errstr, $timeout = 30);\r\n\t\t\r\n\t\tif (!$fp){\r\n\t\t\t// couldn't open socket so returning no data\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\t// send the data to the server\r\n\t\tfputs($fp, \"POST $path HTTP/1.1\\r\\n\");\r\n\t\tfputs($fp, \"Host: $host\\r\\n\"); \r\n\t\tfputs($fp, \"Content-type: application/x-www-form-urlencoded\\r\\n\"); \r\n\t\tfputs($fp, \"Content-length: \" . strlen($poststring) . \"\\r\\n\"); \r\n\t\tfputs($fp, \"Connection: close\\r\\n\\r\\n\"); \r\n\t\tfputs($fp, $poststring . \"\\r\\n\\r\\n\"); \r\n\r\n\t\t$header = \"\";\r\n\t\t$body = \"\";\r\n\t\t\r\n\t\t// grab the header data ... not currently used but might be in the future\r\n\t\tdo \r\n\t\t{\r\n\t\t\t$header .= fgets ( $fp, 128 );\r\n\t\t} while ( strpos ( $header, \"\\r\\n\\r\\n\" ) === false ); // loop until the end of the header\r\n\t\t\r\n\t\t// grab the body data ... this is what is returned\r\n\t\twhile ( ! feof ( $fp ) )\r\n\t\t{\r\n\t\t\t$body .= fgets ( $fp, 128 );\r\n\t\t}\r\n\t\t\r\n\t\t// close socket\r\n\t\tfclose($fp); \r\n\r\n\t\treturn $body;\r\n }", "function post($url, $data) {\n $options = array(\n\t\t 'http' => array(\n\t\t\t\t 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n\t\t\t\t 'method' => 'POST',\n\t\t\t\t 'content' => http_build_query($data),\n\t\t\t\t ),\n\t\t );\n $context = stream_context_create($options);\n $result = file_get_contents($url, false, $context);\n return $result;\n}", "public function post_post()\n\t{\n\t\ttry {\n\t\t\t$results = Articles::regist( self::$_JSON );\n\t\t\t//\\Log::warning(print_r($results, true));\n\n\t\t\treturn $this->response($results, 200);\n\t\t} catch (\\MarcoPandaException $e) {\n\t\t\t$this->error($e);\n\t\t}\n\t}", "public function request()\n {\n $this->setParams();\n\n $jsondata = json_encode($this->getData(), JSON_UNESCAPED_SLASHES);\n\n if(!$this->is_JSON($jsondata)){\n $this->log(\"Sending parameters must be JSON.\",'Exiting process.');\n $this->error_message('Sending parameters must be JSON.');\n }\n $lenght = strlen($jsondata);\n if($lenght<=0){\n $this->log(\"Length must be more than zero.\",'Exiting process.');\n $this->error_message(\"Length must be more than zero.\");\n }else{\n $lenght = $lenght <= 999 ? \"0\" . $lenght : $lenght;\n }\n\n $this->response_json = $this->oxd_socket_request(utf8_encode($lenght . $jsondata));\n\n $this->response_json = str_replace(substr($this->response_json, 0, 4), \"\", $this->response_json);\n if ($this->response_json) {\n $object = json_decode($this->response_json);\n if ($object->status == 'error') {\n $this->error_message($object->data->error . ' : ' . $object->data->error_description);\n } elseif ($object->status == 'ok') {\n $this->response_object = json_decode($this->response_json);\n }\n } else {\n $this->log(\"Response is empty...\",'Exiting process.');\n $this->error_message('Response is empty...');\n }\n }", "public static function post($url, $data, $httpHeaders = array())\n {\n $ch = self::init($url, $httpHeaders);\n //Set the request type\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n return self::processRequest($ch);\n }", "private function doPost($url, $data) {\n $options = array(\n 'http' => array(\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n 'method' => 'POST',\n 'content' => http_build_query($data),\n ),\n );\n\n $context = stream_context_create($options);\n $result = file_get_contents($url, false, $context);\n\n Logger::info(\"Got result from GW: \". $result);\n }", "function http_send_data($data) {}", "public function post()\n {\n $this->method = 'POST';\n return $this;\n }", "private function __doPost($postUrl, $postData, $options) {\n\t\t// prepare the post data\n\t\t$postData = http_build_query($postData);\n\n\t\t// set the http options\n\t\t$postDefaults = array(\n\t\t\t'method' => 'POST',\n\t\t\t'header' => 'Content-type: application/x-www-form-urlencoded',\n\t\t\t'content' => $postData\n\t\t);\n\t\t// combine any other options with the defaults\n\t\t$postOptions['http'] = $options + $postDefaults;\n\n\t\t// post the request\n\t\t$context = stream_context_create($postOptions);\n\t\t$response = @file_get_contents($postUrl, false, $context);\n\n\t\t// problem connecting or bad url\n\t\tif ($response === false) {\n\t\t\treturn false;\n\t\t}\n\t\t// got something\n\t\treturn $response;\n\t}", "function postRequest( $url, $fields, $optional_headers = null ) {\n\t\t// http_build_query is preferred but doesn't seem to work!\n\t\t// $fields_string = http_build_query($fields, '', '&', PHP_QUERY_RFC3986);\n\t\t\n\t\t// Create URL parameter string\n\t\tforeach( $fields as $key => $value )\n\t\t\t$fields_string .= $key.'='.$value.'&';\n\t\t\t\n\t\t$fields_string = rtrim( $fields_string, '&' );\n\n//\t\techo \"controlKey.php : postRequest() : URL = $url\";\n//\t\techo \"controlKey.php : postRequest() : Fields_string = $fields_string\";\n\t\t\n\t\t$ch = curl_init( $url );\n\t\tcurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\tcurl_setopt( $ch, CURLOPT_AUTOREFERER, TRUE);\n\t\tcurl_setopt( $ch, CURLOPT_POST, count( $fields ) );\n\t\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, $fields_string );\n\t\t\n\t\t$result = curl_exec( $ch );\n\t\t\n\t\tcurl_close( $ch );\n\t}", "public function post ($url, $data = null, $headers = null, $options = null);", "function post($url, $args = array()) {\n\t\t$defaults = array('method' => 'POST');\n\t\t$r = array_merge( $defaults, $args );\n\t\treturn $this->request($url, $r);\n\t}", "public function sendRequest()\n {\n }", "public static function post(array $data) {\n return self::call(\"POST\", $data);\n }", "function PPHttpPost($methodName_, $nvpStr_) {\n\t\t\tglobal $gateway_environment;\n\t\t\t$environment = $gateway_environment;\n\n\t\t\t$API_UserName = pmpro_getOption(\"apiusername\");\n\t\t\t$API_Password = pmpro_getOption(\"apipassword\");\n\t\t\t$API_Signature = pmpro_getOption(\"apisignature\");\n\t\t\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\t\t\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t\t\t$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t\t\t}\n\n\t\t\t$version = urlencode('72.0');\n\n\t\t\t//NVPRequest for submitting to server\n\t\t\t$nvpreq = \"METHOD=\" . urlencode($methodName_) . \"&VERSION=\" . urlencode($version) . \"&PWD=\" . urlencode($API_Password) . \"&USER=\" . urlencode($API_UserName) . \"&SIGNATURE=\" . urlencode($API_Signature) . \"&BUTTONSOURCE=\" . urlencode(PAYPAL_BN_CODE) . $nvpStr_;\n\n\t\t\t//post to PayPal\n\t\t\t$response = wp_remote_post( $API_Endpoint, array(\n\t\t\t\t\t'timeout' => 60,\n\t\t\t\t\t'sslverify' => FALSE,\n\t\t\t\t\t'httpversion' => '1.1',\n\t\t\t\t\t'body' => $nvpreq\n\t\t\t )\n\t\t\t);\n\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t $error_message = $response->get_error_message();\n\t\t\t die( \"methodName_ failed: $error_message\" );\n\t\t\t} else {\n\t\t\t\t//extract the response details\n\t\t\t\t$httpParsedResponseAr = array();\n\t\t\t\tparse_str(wp_remote_retrieve_body($response), $httpParsedResponseAr);\n\n\t\t\t\t//check for valid response\n\t\t\t\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t\t\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $httpParsedResponseAr;\n\t\t}", "function post_day($httpClient, $base_url, $day) {\r\n error_log('post_day to server: ' . $day);\r\n $url = $base_url . '/day/';\r\n $response = $httpClient->request('POST', $url,['json' => $day]); //guzzale part\r\n// $request = $httpClient->createRequest('POST', $url);\r\n// $request->setBody(Stream::factory('9'));\r\n// $response = $request->send();\r\n return $response;\r\n //echo $response; die();\r\n error_log('post_day to server: ' . $day);\r\n \r\n// $url = 'http://' . $base_url . '/day/';\r\n// $day1['day'] = $day;\r\n// //$response = $httpClient->request('POST', $url, ['json' => $day1]);\r\n// return $response;\r\n \r\n}", "function post($url, $fields = array(), $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $http_options[CURLOPT_POST] = true;\n $http_options[CURLOPT_POSTFIELDS] = $fields;\n if (is_array($fields)) {\n $http_options[CURLOPT_HTTPHEADER] = array(\"Content-Type: multipart/form-data\");\n }\n $this->handle = curl_init($url);\n\n if (!curl_setopt_array($this->handle, $http_options)) {\n throw new RestClientException(\"Error setting cURL request options.\");\n }\n\n $this->response_object = curl_exec($this->handle);\n $this->http_parse_message($this->response_object);\n\n curl_close($this->handle);\n return $this->response_object;\n }", "public function usePost()\n {\n $this->setOption(CURLOPT_POST, true);\n }", "private function postHop () {\n\t\t$this->result = curl_exec ( $this->ch );\n\t\tcurl_close ( $this->ch );\n\t}", "public function post(string $url, array $input = [], $headers = null);", "public function post( $url, array $headers=array(), $data=null ) {\n return $this->httpRequest( $url, 'POST', $headers, $data );\n }", "public function send(): void\n {\n $requiredParams = [\n 'v' => $this->client->getVersion(),\n 'tid' => $this->client->getTrackingId(),\n 'cid' => $this->client->getClientId(),\n 't' => $this->getHitType(),\n ];\n $paramValues = array_merge(\n $requiredParams,\n $this->parameters\n );\n \n $url = $this->getBaseUrl();\n\n $guzzle = new \\GuzzleHttp\\Client();\n $result = $guzzle->request('POST', $url, ['form_params' => $paramValues]);\n\n if ($this->client->isDebug()) {\n var_dump((string) $result->getBody());\n }\n }", "public function testPostDataHttpServer(): void\n {\n $this->post('/request_action/post_pass', ['title' => 'value']);\n $data = json_decode('' . $this->_response->getBody());\n $this->assertSame('value', $data->title);\n $this->assertHeader('X-Middleware', 'true');\n }", "public function HttpPostMethod($PostURL, $PostData)\n {\n $url = curl_init($PostURL);\n $postToken = json_encode($PostData);\n $header = array(\n 'Content-Type:application/json',\n 'X-KM-Api-Version:v-0.2.0',\n 'X-KM-IP-V4:' . $this->getClientIP(),\n 'X-KM-Client-Type:PC_WEB'\n );\n\n curl_setopt($url, CURLOPT_HTTPHEADER, $header);\n curl_setopt($url, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($url, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($url, CURLOPT_POSTFIELDS, $postToken);\n curl_setopt($url, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($url, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($url, CURLOPT_SSL_VERIFYPEER, 0);\n\n $resultData = curl_exec($url);\n $response = json_decode($resultData, true, 512);\n curl_close($url);\n return $response;\n }", "public function sendPost(){\n\t\t\t// record the post in the database\n\t\t\t\n\t\t}", "function post_to_url($url, $data) {\n $fields = '';\n foreach ($data as $key => $value) {\n $fields .= $key . '=' . $value . '&';\n }\n rtrim($fields, '&');\n $post = curl_init();\n curl_setopt($post, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($post, CURLOPT_URL, $url);\n curl_setopt($post, CURLOPT_POST, count($data));\n curl_setopt($post, CURLOPT_POSTFIELDS, $fields);\n curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);\n $result = curl_exec($post); //result from mobile seva server \n return $result; //output from server displayed \n curl_close($post);\n}", "public function send($request);", "public function _post($url = null, array $parameters = []);", "public function send()\n {\n // Stream post the data\n $this->evaluateResponse($this->httpPost($this->str_endpoint . '/event', $this->compile()));\n }" ]
[ "0.72719514", "0.6811554", "0.6786132", "0.67007333", "0.67007333", "0.67007333", "0.6650071", "0.6641624", "0.66006565", "0.65893596", "0.65576154", "0.6496506", "0.6457254", "0.6428607", "0.6427611", "0.6395452", "0.63898265", "0.6387625", "0.6377841", "0.63438916", "0.63318807", "0.63250065", "0.6322693", "0.6318128", "0.63072735", "0.6306456", "0.63006616", "0.6293877", "0.62805945", "0.62676245", "0.6265155", "0.6264613", "0.6251233", "0.62319666", "0.6207198", "0.62028164", "0.6200336", "0.6188313", "0.6188177", "0.61708087", "0.6162524", "0.61574477", "0.6154874", "0.6125259", "0.6122783", "0.6115762", "0.61092275", "0.60922647", "0.6068146", "0.6056583", "0.6051189", "0.6045963", "0.6045963", "0.6045963", "0.60455436", "0.60386497", "0.6031763", "0.603047", "0.6012433", "0.6002737", "0.5988677", "0.5983268", "0.5978849", "0.59700054", "0.5959594", "0.5945931", "0.59447867", "0.5942029", "0.5941492", "0.5928247", "0.5914257", "0.59131473", "0.59127015", "0.59030604", "0.58985394", "0.5890497", "0.58852005", "0.5879201", "0.5876792", "0.5869234", "0.5868072", "0.58659476", "0.5862846", "0.5859205", "0.5852609", "0.58479375", "0.5843855", "0.58422977", "0.58385396", "0.5837657", "0.5832458", "0.582568", "0.5825653", "0.58153474", "0.580688", "0.58036184", "0.5800781", "0.5794153", "0.57699853", "0.5769571", "0.5769357" ]
0.0
-1
Vsetky inicializacne veci alebo veci spustane v kazdom pohlade / controlleri
public function __construct($Request) { parent::__construct($Request); $this->userLogin = MFW_Session::get('auth', 'login'); $this->userId = MFW_Session::get('auth', 'uid'); if ($this->userId == NULL) { // ak nie je aktualne prihlaseny v systeme (nie je v session), skusime ci ma v COOKIEs ulozene user ID $vid = MFW_Session::getCookie('vid'); $uid = MFW_Session::getCookie('uid'); $key = MFW_Session::getCookie('key'); if (!empty($uid) && !empty($key)) { // ak sa v COOKIE nasli vsetky prihlasovacie udaje, prihlasime ho $User = new App_Model_User(); $User->doLogin(NULL, NULL, $uid, $key); $this->userLogin = MFW_Session::get('auth', 'login'); $this->userId = MFW_Session::get('auth', 'uid'); } elseif (!empty($uid)) { // ak sa v COOKIE naslo len UID, znamena to, ze tu uz bol ale automaticky sa prihlasovat nechce } elseif (!empty($vid)) { // ak ma nastavene VID (visitor id) tak tu uz bol ale nie je registrovany $this->visitorId = $vid; } else { // ak sa v COOKIE nenaslo nic, znamena to, ze je to novy clovek (alebo ma zakazane cookies) $User = new App_Model_User(); $visitorId = $User->doCreateVisitor(); MFW_Session::setCookie('vid', $visitorId); // nastavime mu to hned z prichodu ako VID (visitor id) } } $this->_viewProperties['userMsg'] = MFW_Session::getUserMessages(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init()\n {\n //Obiekt odpowiedzialny za pobieranie danych z get i post\n $this->request = new \\application\\config\\core\\Request();\n //Pobieranie nazwy kontrolera który został wywołany przez dispatcher\n $this->controllerName = get_called_class();\n //Z nazwy kontrolera tworzymy nazwę modelu który musi być takiej samej nazwy jak kontroler\n $controllerNameExplodeList = explode('\\\\', $this->controllerName);\n $this->controllerName = end($controllerNameExplodeList);\n $model = '\\application\\model\\\\'.str_replace('Controller', 'Model', $this->controllerName);\n if (class_exists($model)) {\n $this->model = new $model();\n }else{\n // Jeżeli nie istnieje to zarzuć wyjątkiem :).\n throw new \\Exception('Nie istnieje model o nazwie '.$model);\n }\n //Inicjujemy obiekt który ma za zadanie zarządzać layoutem.\n $this->view = new \\application\\config\\core\\View($this->controllerName);\n //Ustawiamy domyślny layout aplikacji\n $this->view->setLayout('default');\n }", "function __construct() {\n //con esta linea se hereda el constructor de la clase Controller\n parent::__construct();\n }", "function __construct() {\n\t //llamo al contructor de Controller.php\n\t parent::__construct();\n\n\t //instancio el modelo\n\t $this->Lenguajes = new Lenguajes();\n\t \n\n\t}", "public function init() {\n //En esta linea de código enviamos a las vistas la base de la URL\n //Para este Ejemplo quedaria http://localhost/ejemplo/public\n //El objeto view crea una interfaz entre el controlador y la vista.\n //La variable baseUrl es la que contendra la direccion del proyecto, esta variable \n //la creamos nosotros mismos. \n //$this->_request->getBaseUrl(); es el encargado de capturar la URL base y como vemos en la linea\n //es asignada a la variable baseUrl y esta a su vez es pasada a todas las vistas de este controlador.\n\n\n $this->view->baseUrl = $this->_request->getBaseUrl();\n }", "public function __construct() {\r\n $this->ctrlAccueil = new ControleurAccueil();\r\n $this->ctrlBillet = new ControleurBillet();\r\n $this->ctrlConnexion = new ControleurConnexion();\r\n $this->ctrlAdmin = new ControleurAdmin();\r\n }", "function __construct() {\n\t //llamo al contructor de Controller.php\n\t parent::__construct();\n\n\t //instancio el modelo\n $this->modelo(array('cortos','ediciones','categorias'));\n\n\n\t}", "public function __construct()\n {\n $this->modelpaises = new PaisesModel();\n $this->view = new DestinosPaisesView();\n }", "public function init(){\n\t\t$this->_arrParam = $this->_request->getParams();\n\t\t\n\t\t//Duong dan cua Controller\n\t\t$this->_currentController = '/' . $this->_arrParam['module'] \n\t\t\t\t\t\t\t\t\t . '/' . $this->_arrParam['controller'];\t\t\n\t\t//Duong dan cua Action chinh\t\t\n\t\t$this->_actionMain = '/' . $this->_arrParam['module'] \n\t\t\t\t\t\t\t . '/' . $this->_arrParam['controller']\t. '/index';\n\t\t\t\t\t\t\t \n\t\t$this->_paginator['currentPage'] = $this->_request->getParam('page',1);\n\t\t$this->_arrParam['paginator'] = $this->_paginator;\n\t\t\n\t\t//Luu cac du lieu filter vao SESSION\n\t\t//Dat ten SESSION\n\t\t$this->_namespace = $this->_arrParam['module'] . '-' . $this->_arrParam['controller'];\n\t\t$ssFilter = new Zend_Session_Namespace($this->_namespace);\n\t\t//$ssFilter->unsetAll();\n\t\tif(empty($ssFilter->col)){\n\t\t\t$ssFilter->lang \t\t= '';\n\t\t}\n\t\t$this->_arrParam['ssFilter']['lang'] \t\t= $this->_arrParam['lang'];\t\n\t\t\n\t\t/*====================================================\n\t\t * Load Zendvn Translate for Controller\n\t\t *====================================================*/\n\t\t/*$this->_langObj->setLangFile(array('default.language.tmx'));\t\t\n\t\tZend_Registry::set('Zend_Translate', $this->_langObj->generate());*/\n\t\t\n\t\t$info = new Zendvn_System_Info();\n\t\t$language = $info->getLanguage('admin');\n\t\tif(empty($language)){\n\t\t\t$language = 'vi';\n\t\t}\n\t\t$translate = array(\n\t\t\t\t\t\t\t'adapter' => 'tmx',\n\t\t\t\t\t\t\t'content' => LANG_PATH . '/' . $language . '/admin/default.language.tmx',\n\t\t\t\t\t\t\t'locale' => $language,\n\t\t\t\t\t\t\t);\n\t\t$translate = new Zend_Translate($translate);\n\t\tZend_Registry::set('Zend_Translate', $translate);\n\t\t\n\t\t//Truyen ra view\n\t\t$this->view->arrParam = $this->_arrParam;\n\t\t$this->view->currentController = $this->_currentController;\n\t\t$this->view->actionMain = $this->_actionMain;\t\t\n\t\t$template_path = TEMPLATE_PATH . \"/public/system\";\n\t\t$this->loadTemplate($template_path,'template.ini','template');\t\t\n\t}", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __init()\n\t{\n\t\t// This code will run before your controller's code is called\n\t}", "public function __construct(){\n\t\tparent::__construct();\n\t\tinit_painel();\n\t\t$this->load->model('Comentarios_model', 'Comentarios');\n\t}", "protected function initializeController() {}", "function __construct()\n {\n $this->view = new View();\n $this->model = new si_cf_parametroModel();\n }", "function __construct(){\n // debug($_SESSION) ;\n //URL taper par l'utilisateur\n $this->request = new \\Projet\\App\\Request() ;\n //parser l'URL\n //Router::parse($this->request->url,$this->request);\n //charger le controller appellé par l'utilisateur\n $controller = $this->loadController() ;\n\n //action appellé par utilisateur\n $action = $this->request->action;\n /*faire appelle aux fonctions des controleurs qui correspend aux nom des actions tapez par l'utilisateur\n comme $controller->view($this->request->params) ;*/\n }", "public function init()\n {\n parent::init();\n\n $this->idPronac = $this->getRequest()->getParam('idPronac');\n $this->idDiligencia = $this->getRequest()->getParam('idDiligencia');\n $this->idAvaliacaoProposta = $this->getRequest()->getParam('idAvaliacaoProposta');\n $this->situacao = $this->getRequest()->getParam('situacao');\n $this->tpDiligencia = $this->getRequest()->getParam('tpDiligencia');\n $this->idProduto = $this->getRequest()->getParam('idProduto');\n\n if ($this->tpDiligencia) {\n $GrupoAtivo = new Zend_Session_Namespace('GrupoAtivo'); // cria a sess�o com o grupo ativo\n $urlArray = array('controller' => 'verificarreadequacaodeprojeto');\n\n // ajusta o link de voltar de acordo com o tipo de dilignecia\n if ($GrupoAtivo->codGrupo == 122) { // diligencia na readequacao - coordenador acompanhamento\n $this->btnVoltar = $this->view->url(array_merge($urlArray, array('action' => 'verificarreadequacaodeprojetocoordacompanhamento')));\n } elseif ($this->tpDiligencia == 171) { // diligencia na readequacao - tecnico acompanhamento\n $this->btnVoltar = $this->view->url(array_merge($urlArray, array('action' => 'verificarreadequacaodeprojetotecnico')));\n } elseif ($this->tpDiligencia == 179) { // diligencia na readequacao - parecerista\n $this->btnVoltar = $this->view->url(array_merge($urlArray, array('action' => 'verificarreadequacaodeprojetoparecerista')));\n } else {\n $this->btnVoltar = 'javascript:voltar()';\n }\n }\n\n $this->view->btnVoltar = $this->btnVoltar; // botao voltar dinamico\n }", "public function __construct() {\n \t\n\t \tinclude('../conexion/datos.php');\n \n\t $this->id_modulo = 14;\n\t $this->NameCookieApp = $NomCookiesApp;\n\t //$this->permisosInst = new permisosController();\n\t }", "public function __construct(){\n $this->pegaProjetos();\n }", "public function __construct() {\n $this->noticia_modelo = $this->modelo('NoticiaModelo');\n }", "public function __construct()\n {\n $url = $this->getUrl();\n /**Tomamos el primer valor para el Controlador y \n * verificamos si existe el archivo.\n * Ponemos en Mayúscula primer letra de la Palabra\n **/\n \n if (file_exists('../app/controllers/' . ucwords($url[0]) . 'Controller.php')) {\n /**Si existe seteamos el controlador y blanqueamos \n * la primer posición del array $url.\n **/\n $this->currentController = ucwords($url[0]).'Controller';\n unset($url[0]);\n }\n\n /**\n * Requerimos el Controlador y lo Intanciamos.\n */\n require_once '../app/controllers/' . $this->currentController.'.php';\n $this->currentController = new $this->currentController;\n\n /**\n * Verificamos la segunda parte de la url.\n * Para ver si estamos pasando un método.\n */\n if (isset($url[1])) {\n /**Verificamos si el Método existe en la clase.\n * Si existe o Seteamos.\n * Blanqueamos la posición del array url.\n */\n if (method_exists($this->currentController, $url[1])) {\n $this->currentMethod = $url[1];\n unset($url[1]);\n }\n }\n\n /**\n * Verificamos si el array url tiene valores.\n * Si tiene seteamos params, sino lo dejamos vacío.\n */\n $this->params = $url ? array_values($url) : [];\n\n /**\n * Llamamos al método con un array de parámetros.\n */\n call_user_func_array([$this->currentController, $this->currentMethod], $this->params);\n }", "public function initController()\n {\n $this->model = new AliveSettingServiceMeta();\n\n $this->middleware([\n\n ]);\n }", "protected function _init()\n\t{\n\t\t// inicializando controladores auxiliares\n\t\t$this->_initControllers();\n\t\t\n\t\treturn;\n\t}", "public function __construct() {\r\n // Pre svega - .env podesiti parametre za pristup bazi\r\n \r\n $menu = new Menu();\r\n $this->data['menus'] = $menu->getAll();\r\n \r\n // var_dump($this->data['menus']);\r\n }", "public function _construct()\n {\n $this->_init('reembolso/reembolso', 'reembolso_id');\n }", "public function init()\n {\n $usuario = new Application_Model_UsuarioMapper();\n $this->view->totalUsuarios = $usuario->getQuantidade();\n\n\n }", "public function __construct(){\n \n $pagini = new PaginaModel();\n $pagina = $pagini->pagina(100);\n $this->continut = $pagini->content;\n \n $pagini->inchideConexiune();\n }", "public function __construct(){\n\t\t//asi poder tener dispoble la vista que le pertenece a esta clase\n\t\tparent::__construct();\n\t}", "public function __construct() {\n $this->porcentajesCursoModel = $this->model('PorcentajesCursoModel');\n $this->tipoModuloModel = $this->model('TipoModuloModel');\n $this->cursoModel = $this->model('CursoModel');\n }", "public function init()\n {\n $this->_equipo = new Application_Model_DeporEquipo();\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "function __construct(){\n $this->informacion = new Info();\n $this->firebase = new FirebaseController();\n $this->storage = new StorageController();\n }", "public function init() {\n $this->_temporizador = new Trf1_Admin_Timer ();\n $this->_temporizador->Inicio();\n\n /* Initialize action controller here */\n $this->view->titleBrowser = 'e-Sisad';\n }", "public function init()\n {\n $usuario = Zend_Auth::getInstance()->getIdentity();\n $this->_usuario = $usuario;\n $modelo = new Admin_Model_Notificacoes(); \n $contagem = $modelo->count($this->_usuario->id);\n Zend_Layout::getMvcInstance()->assign('contagem', $contagem[0]['total']);\n $this->_orcamento = new Admin_Model_Orcamento();\n //$this->view->usuario = $usuario;\n Zend_Layout::getMvcInstance()->assign('usuario', $usuario);\n \n if ( !Zend_Auth::getInstance()->hasIdentity() ) {\n return $this->_helper->redirector->goToRoute( array('module'=>'admin','controller' => 'login'), null, true);\n }\n }", "public function init()\n {\n \t$this->view->headTitle('Produktgruppen');\n\t\t$this->db = Zend_Registry::get('db');\n\t\t$this->logger = Zend_Registry::get('logger');\n }", "public function __construct() {\n\n $this->vista = new Vista();\n $this->usuario = new Usuario();\n $this->reserva = new Reserva();\n $this->instalacion = new Instalacion();\n $this->horario = new Horario();\n $this->rol = new Rol();\n $this->seguridad = new Seguridad();\n\n }", "function __construct() {\n\t\tparent::__construct();\n $this->includeModel('CursoEspecial');\n $this->vista->setTitle('Cursos Especiales');\n \n\t\t$this->CursoEspecial = new CursoEspecial();\n\t\t$this->TPrograma = new TPrograma();\n\t }", "function __construct()\n {\n $this->mPoslovniObjekt = new PoslovniObjekt();\n // inicijalizacija varijable, ili davanje vrijednosti varijabli\n if (isset($_GET['JedinicaID']))\n $this->mJedinicaId = (int)$_GET['JedinicaID'];\n }", "function\t__construct()\t{\n\t\t\t\t/* contrutor da classe pai */\n\t\t\t\tparent::__construct();\n\t\t\t\t/* abaixo deverão ser carregados helpers, libraries e models utilizados\n\t\t\t\t\t por este model */\n\t\t}", "public function init() {\r\n\t\t\t//$usuarioAuth = Zend_Auth::getInstance()->getIdentity();\r\n\t\t\t//$this->view->usuarioAuth = $usuarioAuth;\t\r\n\r\n\t\t\t//dia de hoje\r\n\t\t\t$hoje=date('Y-m-d');\r\n\r\n \t \t$request = $this->getRequest();\r\n\t\t\t$usuario= new Usuario();\r\n\t\t\t$mapper= new UsuarioMapper();\r\n\t\t\t$mapper->find($request->id,$usuario);\r\n\t\t\t$this->view->usuarios = $usuario;\t\r\n\r\n\r\n\r\n\r\n }", "public function __construct()\n {\n $this->model = new MainModel();\n $this->params[\"pagination\"][\"totalItemsPerPage\"] = 5;\n view()->share ('controllerName', $this->controllerName);//đặt controllerName cho all action\n }", "public function __construct() {\n $this->adminProveedorModelo = new adminProveedorModelo();\n }", "function __construct() {\n $this-> CI =& get_instance();\n $this -> CI -> load -> model('Admin_model');\n // Nos comemos la libreria que la virgen solo corre si sale corriendo\n }", "public function init(){\n\t\t$this->_arrParam = $this->_request->getParams();\n\t\n\t\t//Duong dan cua Controller\n\t\t$this->_currentController = '/' . $this->_arrParam['module'] . '/' . $this->_arrParam['controller'];\n\t\n\t\t//Duong dan cua Action chinh\n\t\t$this->_actionMain = '/' . $this->_arrParam['module'] . '/'\t. $this->_arrParam['controller'] . '/index';\t\n\t\n\t\t//Luu cac du lieu filter vaof SESSION\n\t\t//Dat ten SESSION\n\t\t$this->_namespace = $this->_arrParam['module'] . '-' . $this->_arrParam['controller'];\n\t\t$ssFilter = new Zend_Session_Namespace($this->_namespace);\n\t\t//Lay thong tin so phan tu tren mot trang\n\t\tif(isset($this->_arrParam['limitPage'])){\n\t\t\t$ssFilter->limitPage = $this->_request->getParam('limitPage');\n\t\t\t$this->_paginator['itemCountPerPage'] = $ssFilter->limitPage;\n\t\t}elseif(!empty($ssFilter->limitPage)){\n\t\t\t$this->_paginator['itemCountPerPage'] = $ssFilter->limitPage;\n\t\t}\n\t\t\n\t\t//Trang hien tai\n\t\tif(isset($this->_arrParam['page'])){\n\t\t\t$this->_paginator['currentPage'] = $this->_arrParam['page'];\n\t\t\t$this->_page = '/page/' . $this->_arrParam['page'];\n\t\t}\n\t\t\n\t\t//Truyen thong tin phan trang vao mang du lieu\n\t\t$this->_arrParam['paginator'] = $this->_paginator;\n\t\t\n\t\t//$ssFilter->unsetAll();\n\t\tif(empty($ssFilter->col)){\n\t\t\t$ssFilter->keywords = '';\n\t\t\t$ssFilter->col \t\t= 'l.id';\n\t\t\t$ssFilter->id \t\t= 'DESC';\n\t\t\t$ssFilter->order\t= 'DESC';\n\t\t\t$ssFilter->cat_id\t= 0;\n\t\t\t$ssFilter->lang_code= '*';\n\t\t}\n\t\t$this->_arrParam['ssFilter']['keywords'] \t= $ssFilter->keywords;\n\t\t$this->_arrParam['ssFilter']['col'] \t\t= $ssFilter->col;\n\t\t$this->_arrParam['ssFilter']['order'] \t\t= $ssFilter->order;\n\t\t$this->_arrParam['ssFilter']['cat_id'] \t\t= $ssFilter->cat_id;\n\n\t\tif(empty($ssFilter->lang_code)){\n\t\t\t$language = new Zend_Session_Namespace('language');\n\t\t\t$this->_arrParam['ssFilter']['lang_code'] = $language->lang;\n\t\t}else{\n\t\t\t$this->_arrParam['ssFilter']['lang_code'] \t= $ssFilter->lang_code;\n\t\t}\n\n\t\t//Truyen ra ngoai view\n\t\t$this->view->arrParam = $this->_arrParam;\n\t\t$this->view->currentController = $this->_currentController;\n\t\t$this->view->actionMain = $this->_actionMain;\n\t\n\t\t$siteConfig = Zend_Registry::get('siteConfig');\n\t\t$template_path = TEMPLATE_PATH . \"/admin/\" . $siteConfig['template']['admin'];\n\t\t$this->loadTemplate($template_path, 'template.ini', 'template');\n\t}", "public function __construct()\n {\n $this->init('atos');\n }", "public function init()\r\r\n {\r\r\n // -------------------------\r\r\n $modelMetier = new Model_DbTable_Metiers();\r\r\n $metiers = $modelMetier->getDatas();\r\r\n $this->view->metiers = $metiers;\r\r\n \r\n // Get notre entreprise text\r\n // ----------------------\r\n $model = new Model_DbTable_Vitrine();\r\n $txtEntreprise = $model->getDatas('notre-entreprise');\r\n $this->view->txtEntreprise = $txtEntreprise;\r\r\n }", "public function init() {\n\t\t//菜单选择\n\t\t$_SESSION['menu'] = 'brand';\n\t\t//获取购物车寄存\n\t\t$cartService = new Default_Service_CartService();\n\t\t$cartService->getCartDeposit();\n\t\t\n\t\t//产品目录\n\t\t$prodService = new Default_Service_ProductService();\n\t\t$prodCategory = $prodService->getProdCategory();\n\t\t$this->view->first = $prodCategory['first'];\n\t\t$this->view->second = $prodCategory['second'];\n\t\t$this->view->third = $prodCategory['third'];\n\t\t//目录推荐品牌\n\t\t$this->view->categorybarnd = $prodService->getCategoryBrand();\n\t\t\n\t\t$this->fun =$this->view->fun= new MyFun();\n\t\t\n\t\t//新版本\n\t\tif(isset($_SESSION['new_version'])){\n\t\t\t$this->fun = new MyFun();\n\t\t\t$this->fun->changeView($this->view,$_SESSION['new_version']);\n\t\t}\n\t\t$this->brandservice = new Default_Service_BrandService();\n\t}", "function Controller_Utilisateur(){\n\t\tparent::__construct();\n\t\trequire_once './Modele/Modele_Utilisateur.php';\n\t\t$this->selfModel = new Utilisateur(); // appel du modèle correspondant à la classe Controller_Utilisateur\n\t}", "public function init() {\n $this->sessionCarrinho = new Zend_Session_Namespace('carrinho');\n $qtdCarrinho = $this->sessionCarrinho->qtd;\n\n //MENSAGEM QUE FICARÁ NO MENU DO TOPO\n $msgItens = null;\n $msgItens = ($qtdCarrinho == 1) ? '(' . $qtdCarrinho . ' item)' : $msgItens;\n $msgItens = ($qtdCarrinho > 1) ? '(' . $qtdCarrinho . ' itens)' : $msgItens;\n $this->view->msgItens = $msgItens;\n\n //VALIDANDO AUTENTICACAO\n if (!Zend_Auth::getInstance()->hasIdentity()): //NAO AUTENTICADO\n $this->redirect('login');\n else:\n //RETORNANDO O NOME DO USUÁRIO LOGADO\n $nomeUsuario = Zend_Auth::getInstance()->getIdentity()->nome;\n $this->view->nomeUsuario = $nomeUsuario;\n endif;\n\n //USADO NO ESTILO DO LINK DO MENU\n $this->view->controllerName = $this->_request->getControllerName();\n }", "function __construct()\n {\n //domain/controller/action/param\n $breakArr = $this->XuLyURL();\n //Array ( [0] => controller [1] => action [2] => param1 [3] => param2)\n\n \n //Xu ly controller, kiem tra form co ton tai hay khong moi require\n if(file_exists(\"./mvc/controllers/\".$breakArr[0].\".php\")){\n $this->controller = $breakArr[0];\n unset($breakArr[0]);//sau khi da lay dc controller thi huy mang di -> tao param\n }\n require_once \"./mvc/controllers/\".$this->controller.\".php\";\n //sau khi đã tạo connect controller và extends, khởi tạo đối tượng controller là controller hiện tại\n $this->controller = new $this->controller;\n \n //Xu ly action, kiem tra array[1]-action cua class controller\n if(isset($breakArr[1])){\n //kiem tra ham ton tai, tham so la object or class(controller) va function(action)\n //kiem tra tra ve boolean\n if(method_exists($this->controller, $breakArr[1])){\n $this->action = $breakArr[1];\n\n }\n //bo ra ngoai dieu kien kiem tra ton tai, neu truong hop action khong ton tai action khong duoc thay the nen khong unset dc\n unset($breakArr[1]);//sau khi da lay dc controller thi huy mang di -> tao param\n }\n\n\n //Xu ly param\n //goi param, (? = neu) mang ton tai thi param = array values(mang)\n // (: = nguoc lai thi) param rong~\n $this->param = $breakArr?array_values($breakArr):[];\n call_user_func_array([$this->controller,$this->action], $this->param);\n }", "public function initialize(): void {\n\t\tparent::initialize();\n\t\t$this->modelClass = false;\n\t\t$this->loadComponent('RequestHandler');\n\t \t$this->Authentication->allowUnauthenticated(['index','view','get']);\n\n\t //Imposto la cartella dove si trovano le immagini statiche\n\t\t$sitedir = Configure::read('sitedir');\n\t\t$this->staticImgPath = \"/$sitedir/static/img/\";\n\t\t$this->set('staticImgPath', $this->staticImgPath);\n\t\t$this->StaticModel = new StaticModel();\n\t\t$this->staticFilesPath = $sitedir . DS . 'static' . DS ;\n\t}", "public function init() {\n\t\t//$this->_helper->viewRenderer->setNoRender(true);\n\t\t$registry = Zend_Registry::getInstance();\n\t\t$this->view->report_server = $registry->get('report_server'); \n\t\t$this->view->basePath = $registry->get('basepath'); \n\t\t$this->basePath = $registry->get('basepath'); \n $this->view->pathUPLD = $registry->get('pathUPLD');\n $this->view->procPath = $registry->get('procpath');\n\t $this->klasifikasi = 'cdr';\n\t \n\t\t$this->klasifikasi_serv = Klasifikasi_Service::getInstance();\n\t\t//$this->cabang_serv = Cabang_Service::getInstance();\n\t\t\n\t\t$this->sso_serv = Sso_User_Service::getInstance();\n\t $ssoklasifikasi = new Zend_Session_Namespace('ssoklasifikasi');\n\t $this->iduser =$ssoklasifikasi->userid;\n\t // $this->view->namauser = $this->sso_serv->getDataUserNama($this->iduser);\n\t\t$this->Logfile = new logfile;\n\t\t\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function __construct()\n {\n// $this->middleware('auth');\n $this->_data['title'] = 'Vai trò';\n $this->_data['controllerName'] = 'roles';\n }", "private function setConexion()\r\n\t\t{\r\n\t\t\t$this->_conexion = New ConexionController();\r\n\t\t\t$this->_conn = $this->_conexion->initConectar('db');\r\n\t\t}", "private function setConexion()\r\n\t\t{\r\n\t\t\t$this->_conexion = New ConexionController();\r\n\t\t\t$this->_conn = $this->_conexion->initConectar('db');\r\n\t\t}", "function __construct(){\n $this->toko = new M_Toko();\n $this->produk = new M_Produk(); //variabel model merupakan objek baru yang dibuat dari class model\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model(array('M_penjual','M_produk','M_toko'));//auto load model\n\t\tif(empty($this->session->userdata('admintoko')))redirect(site_url('home/login'));//back to login page\n\n\t}", "public function __construct(){\n\t\tparent::__construct();\n\t\t////////////cargo la base de datos porque la van a usar todos\n\t\t$this->load->database();\n\t\t/////////////cargo el helper\n\t\t//$this->load->helper('utilidades');\n\t\t/////////////cargo el modelo\n\t\t$this->load->model('Cliente_model');\n\t}", "public function __construct(){\n\n parent::__construct();\n $this->load->database();\n $this->caricaAzienda();\n \n }", "public function __construct()\n {\n $this->view = new \\stdClass();\n $this->auth = new AuthUser();\n\n // Variável que recebe as configurações padrões da aplicação\n $this->config = self::findDataSettings();\n\n // Inicializando flash mensagem da aplicação\n\n // Mensagem padrão para operações de sucesso\n if (Session::getSession('success')) {\n $this->success = Session::getSession('success');\n Session::destroySession('success');\n }//end if\n // Mensagem padrão para operações de erros\n if (Session::getSession('errors')) {\n $this->errors = Session::getSession('errors');\n Session::destroySession('errors');\n }//end if\n // Mensagem padrão para operações de info\n if (Session::getSession('info')) {\n $this->info = Session::getSession('info');\n Session::destroySession('info');\n }//end if\n // Captura padrão de dados inseridos nos campos dos formulários\n if (Session::getSession('inputs')) {\n $this->inputs = Session::getSession('inputs');\n Session::destroySession('inputs');\n }//endif\n }", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "public function __construct()\n {\n $this->middleware('auth');\n $this->_formulario = new FormularioController();\n $this->_model = new Pagos;\n\n }", "public function __construct()\r\n\t{\r\n\t\tConexion::realizarConexion();\r\n\t}", "public function __construct() {\n parent::__construct();\n Session::tiempo();\n $this->_aclm = $this->loadModel('acl');\n }", "function __construct ()\n {\n // CETTE METHODE SERA APPELEE PAR TOUTES LES ROUTES\n // CAR LA ROUTE PRECISE QUELLE CLASSE ET QUELLE METHODE APPELER\n // DONC LE FRAMEWORK W DOIT CREER UN OBJET DE CETTE CLASSE\n // AVANT D'ACTIVER LA METHODE\n // ET LES CLASSES DANS LES ROUTES HERITENT DE CETTE CLASSE\n // FormController\n // DONC LA METHODE __construct DE LA CLASSE FormController\n // EST AUSSI APPELEE A LA CREATION DE L'OBJET...\n \n // ON PEUT DONC AJOUTER ICI LE CODE QU'ON VEUT ACTIVER\n // POUR TOUTES LES ROUTES...\n \n // APPELER LE CONSTRUCTEUR DU parent\n // POUR CONTINUER A GARDER LA MECANIQUE DU FRAMEWORK W\n // parent::__construct();\n \n // TRAITEMENT DU FORMULAIRE\n $idFormClasse = $this->verifierSaisie(\"idFormClasse\");\n $idFormMethode = $this->verifierSaisie(\"idFormMethode\");\n \n // UN PEU DE SECURITE...\n // JE VAIS COMPLETER LE CHEMIN VERS LE NAMESPACE DE LA CLASSE\n $idFormClasse = \"\\Controller\\Traitement\\\\$idFormClasse\";\n \n if ( ($idFormClasse != \"\") && ($idFormMethode != \"\") )\n {\n // ON A UN FORMULAIRE A TRAITER\n // ON CHERCHE SI IL Y A UNE CLASSE AVEC LA METHODE DEMANDEE\n // http://php.net/manual/fr/function.method-exists.php\n if (method_exists($idFormClasse, $idFormMethode))\n {\n // ON PEUT APPELER LA METHODE\n // ON CREE UN OBJET\n // ET AVEC L'OBJET ON APPELLE LA METHODE\n \n // ASTUCE:\n // CREATION DYNAMIQUE D'OBJET\n // ET APPEL DYNAMIQUE A UNE METHODE\n // http://php.net/manual/fr/language.oop5.basic.php\n $objet = new $idFormClasse;\n // $this EST L'OBJET DE CLASSE FormController\n $objet->$idFormMethode($this);\n }\n }\n \n }", "public function __construct() {\n\t\t$this->empleadoModel = $this->model('Empleado');\n\t}", "function __construct()\n\t{\n\n\t\t$this->PantallaElectronicaModel = new PantallaElectronicaModel();\n\t\t$this->PantallaElectronicaModel->connect();\n\t}", "public function init()\n {\n $this->ctrlModel = new Admin_Model_Acl_ControllersActions();\n $this->dbCtrl = new Admin_Model_DbTable_Acl_ModuleController();\n }", "public function __construct()\n {\n $this->middleware('karyawan.auth');\n\t\t$this->data['title'] = 'Selamat Datang';\n $this->data['banner'] = Slide::orderBy('sequence','ASC')->get();\n $this->data['background'] = BackgroundImage::orderBy('sequence','ASC')->get();\n $this->data['tahunproject'] = DB::table('vtahun')->get();\n\n }", "public function __construct(){\n\t\t\t$this->productoDetalleModelo = new productoDetalleModelo;\n\t\t\t$this->productoFavoritoControlador = new productoFavoritoControlador();\n\t\t\t$this->productoEstrellaControlador = new productoEstrellaControlador();\n\t\t\t$this->productoCarritoControlador = new productoCarritoControlador();\n\t\t}", "public function __construct()\n {\n $this->pelanggan = new PelangganModel();\n /* Catatan:\n Apa yang ada di dalam function construct ini nantinya bisa digunakan\n pada function di dalam class Product \n */\n }", "public function __construct()\n\t{\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __construct() {\n parent::__construct();\n Session::accesoEstricto(array(ADMINISTRATIVOS));\n }", "public function init() {\n\t //UNTUK SETTING GLOBAL BASE PATH\n\t\t$registry = Zend_Registry::getInstance();\n\t\t$this->auth = Zend_Auth::getInstance();\t \n\t\t$this->view->baseData = $registry->get('baseData');\n\t\t$this->view->basePath = $registry->get('basepath');\n\t\t$this->view->procPath = $registry->get('procpath');\t \n\t\t$this->sso_serv = Sso_User_Service::getInstance();\n\t\t$this->penduduk_serv = Data_Penduduk_Service::getInstance();\n\t\t$this->menu_serv = Menu_Service::getInstance();\n\t\t\n\t\t$ssouserpengguna = new Zend_Session_Namespace('ssouserpengguna');\n\t\t$ssouserpassword= new Zend_Session_Namespace('ssouserpassword');\n\t\t$ssouserKodeInstansi= new Zend_Session_Namespace('ssouserKodeInstansi');\n\t\t$ssouserlevel = new Zend_Session_Namespace('ssouserlevel');\n\t\t\n\t\t$this->pengguna =$ssouserpengguna->pengguna;\t\t\t\n\t\t$this->password =$ssouserpassword->password;\n\t\t$this->KodeInstansi =$ssouserKodeInstansi->KodeInstansi;\n\t\t$this->level =$ssouserlevel->level;\n }", "public function init() {\n\t //UNTUK SETTING GLOBAL BASE PATH\n\t\t$registry = Zend_Registry::getInstance();\n\t\t$this->auth = Zend_Auth::getInstance();\t \n\t\t$this->view->baseData = $registry->get('baseData');\n\t\t$this->view->basePath = $registry->get('basepath');\n\t\t$this->view->procPath = $registry->get('procpath');\t \n\t\t$this->sso_serv = Sso_User_Service::getInstance();\n\t\t$this->penduduk_serv = Data_Penduduk_Service::getInstance();\n\t\t$this->menu_serv = Menu_Service::getInstance();\n\t\t\n\t\t$ssouserpengguna = new Zend_Session_Namespace('ssouserpengguna');\n\t\t$ssouserpassword= new Zend_Session_Namespace('ssouserpassword');\n\t\t$ssouserKodeInstansi= new Zend_Session_Namespace('ssouserKodeInstansi');\n\t\t$ssouserlevel = new Zend_Session_Namespace('ssouserlevel');\n\t\t\n\t\t$this->pengguna =$ssouserpengguna->pengguna;\t\t\t\n\t\t$this->password =$ssouserpassword->password;\n\t\t$this->KodeInstansi =$ssouserKodeInstansi->KodeInstansi;\n\t\t$this->level =$ssouserlevel->level;\n }", "public function init()\n {\n\n // pega o idAgente do usu�rio logado\n $auth = Zend_Auth::getInstance(); // pega a autentica��o\n \n /* ========== IN�CIO PERFIL ==========*/\n // define os grupos que tem acesso\n $PermissoesGrupo = array();\n $PermissoesGrupo[] = 121; // T�cnico de Acompanhamento\n $PermissoesGrupo[] = 122; // Coordenador de Acompanhamento\n $PermissoesGrupo[] = 123; // Coordenador - Geral de Acompanhamento\n $PermissoesGrupo[] = 129; // T�cnico de Acompanhamento\n //$PermissoesGrupo[] = ; // Coordenador de Avalia��o\n //$PermissoesGrupo[] = 134; // Coordenador de Fiscaliza��o\n //$PermissoesGrupo[] = 124; // T�cnico de Presta��o de Contas\n //$PermissoesGrupo[] = 125; // Coordenador de Presta��o de Contas\n //$PermissoesGrupo[] = 126; // Coordenador - Geral de Presta��o de Contas\n parent::perfil(1, $PermissoesGrupo); // perfil novo salic\n\n if (isset($auth->getIdentity()->usu_codigo)) { // autenticacao novo salic\n $this->getIdUsuario = UsuarioDAO::getIdUsuario($auth->getIdentity()->usu_codigo);\n $this->getIdUsuario = ($this->getIdUsuario) ? $this->getIdUsuario['idAgente'] : 0;\n } else { // autenticacao espaco proponente\n $this->getIdUsuario = 0;\n }\n /* ========== FIM PERFIL ==========*/\n\n\n /* ========== IN�CIO �RG�O ========== */\n $GrupoAtivo = new Zend_Session_Namespace('GrupoAtivo'); // cria a sess�o com o grupo ativo\n $this->getIdGrupo = $GrupoAtivo->codGrupo; // id do grupo ativo\n $this->getIdOrgao = $GrupoAtivo->codOrgao; // id do �rg�o ativo\n\n parent::init();\n }", "function __construct() {\n\t\t$this->cotizacionModel = new cotizacionModel();\n\t}", "public function init(){\n\t\t\t\t}", "public function initialize()\n {\n $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"refund\");\n }", "protected function initializeAction() {\t\n\t\t$this->persdataRepository = t3lib_div::makeInstance('Tx_PtConference_Domain_Repository_persdataRepository');\n\t}", "public function __construct()\n {\n\n\n // jalankan method parseURL()\n $url = $this->parseUrl();\n\n\n\n // contrller\n // controller - jika url index ke [0] controller nya ada didalam folder Controller maka jalankan\n if (file_exists('../app/controllers/' . $url[0] . '.php')) {\n // lalu kita timpa nilai default Home menjadi sesuai dengan url index [0]\n $hasil = $this->controller = $url[0];\n // lalu di hilangkan url index ke [0]\n unset($url[0]);\n }\n // lalu kita panggil controller nya melalui require_once\n require_once '../app/controllers/' . $this->controller . '.php';\n // lalu di instansiasi agar kita bisa panggil controller nya\n $this->controller = new $this->controller;\n\n\n\n\n // method url index [1]\n if (isset($url[1])) {\n // lakukan pengecekan apakah didalam CLASS/contrller ada METHOD nya maka jalankan \n if (method_exists($this->controller, $url[1])) {\n // kita timpa method default nya yang index itu menjadi sesuai dengan url index ke [1]\n $this->method = $url[1];\n // lalu kita hilangkan\n unset($url[1]);\n }\n }\n\n\n // untuk parameter\n // jika parameter nya ada maka\n if (!empty($url)) {\n // lalu masukan paramter dari url nya ke dalam variable params\n $this->params = array_values($url);\n }\n\n\n // lalu untuk menjalankan controller , method dan parameter jika ada menggunakan function call_user_func_array \n call_user_func_array(\n [$this->controller, $this->method],\n $this->params\n );\n }", "function __construct() {\n $this->pflanzen = array();\n }", "public function enlacePaginasController(){\n\t\tif(isset($_GET['action'])){\n\t\t\t$enlace = $_GET['action'];\n\t\t}else{\n\t\t\t$enlace = 'index';\n\t\t}\n\n\t\t//peticion al modelo\n\t\t$peticion = Enlaces::enlacesPaginasModel($enlace);\n //mostrar peticion\n\t\tinclude $peticion;\n\t}", "public function init() {\n $menu = \"<li><a href=\\\" /eu-type-acteur/new \\\">Nouveau</a></li>\";\n $this->view->placeholder(\"menu\")->set($menu);\n $this->view->jQuery()->enable();\n $this->view->jQuery()->uiEnable(); \n }", "public function __construct()\n {\n $this->model= new Estudiante;\n $this->curso= new Curso;\n $this->usuario= new Usuario;\n $this->centrointeres= new Centrointeres;\n $this->clase= new Clase;\n $this->grado = new Grado;\n $this->asistencia= new Asistencia;\n }", "public function __construct()\n {\n if (verifyCsrf()) {\n redirect('error/show/csrf');\n exit();\n }\n /**Instancia del Modelo Usuario*/\n $this->usuarioModel = $this->model('Usuario');\n /**Instancia del Modelo Mesas Finales*/\n $this->mesaFinalModel = $this->model('MesaFinal');\n /**Instancia del Modelo Inscripciones Finales*/\n $this->inscripcionFinalModel = $this->model('InscripcionMesa');\n }", "public function init() {\n\t\t$this->_temporizador = new Trf1_Admin_Timer ();\n\t\t$this->_temporizador->Inicio ();\n\t\t\n $this->view->titleBrowser = 'e-Sosti - Sistema de Atendimento a Solicitações de TI';\n $this->view->module = $this->getRequest()->getModuleName();\n $this->view->controller = $this->getRequest()->getControllerName();\n $this->view->action = $this->getRequest()->getActionName();\n }", "public function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t\t\n\t\t\tif(empty($this->account_model->session_is_valid($this->session->id)['id']))\n\t\t\t\tredirect('Account/login');\n\t\t\t$this->load->model('Disciplina_model');\n\t\t\t$this->load->model('Categoria_model');\n\t\t\t$this->load->model('Curso_model');\n\t\t\t$this->load->model('Aluno_model');\n\t\t\t$this->load->model('Turma_model');\n\t\t\t$this->set_menu();\n\t\t\t$this->data['controller'] = get_class($this);\n\t\t\t$this->data['menu_selectd'] = $this->Geral_model->get_identificador_menu(strtolower(get_class($this)));\n\t\t}", "public function enlacesPaginasController(){\n //Viene del templete\n //Se verifica el contenido del action desde la url\n if(isset($_GET[\"action\"])){\n //en caso de contener algo esto es almacenado para poder dirigirnos a el \n $enlacesController = $_GET[\"action\"];\n }else{\n //caso contrario nos redirige al index para una verificacion.\n $enlacesController=\"index\";\n }\n //Ingresamos a la clase EnlacesPaginas y a su metdo que nos verifica a donde queremos ir\n $respuesta = EnlacesPaginas::enlacesPaginasModel($enlacesController);\n //y lo que recibimos es el docuemtnto que se incluira en el actual.\n include $respuesta;\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t//validação se esta logado do plugin ion_auth\n\t\tif (!$this->ion_auth->logged_in())\n\t\t{\n\t\t\tredirect('Admin/Login');\n\t\t}\n\t\t//Carrega o modelo e passa um apelido a ele\n\t\t$this->load->model('ClientesModel', 'clientesLoja');\n\n\n\t}", "public function init() {\n\t //UNTUK SETTING GLOBAL BASE PATH\n\t\t$registry = Zend_Registry::getInstance();\n\t\t$this->auth = Zend_Auth::getInstance();\t \n\t\t$this->view->baseData = $registry->get('baseData');\n\t\t$this->view->basePath = $registry->get('basepath');\n\t\t$this->view->procPath = $registry->get('procpath');\t \n\t\t$this->sso_serv = Sso_User_Service::getInstance();\t\n\t\t$this->penduduk_serv = Data_Penduduk_Service::getInstance();\n\t\t$this->menu_serv = Menu_Service::getInstance();\n\n\t\t$ssouserpengguna = new Zend_Session_Namespace('ssouserpengguna');\n\t\t$ssouserpassword= new Zend_Session_Namespace('ssouserpassword');\n\t\t$ssouserKodeInstansi= new Zend_Session_Namespace('ssouserKodeInstansi');\n\t\t$ssouserlevel = new Zend_Session_Namespace('ssouserlevel');\n\t\t\n\t\t$this->pengguna =$ssouserpengguna->pengguna;\t\t\t\n\t\t$this->password =$ssouserpassword->password;\n\t\t$this->KodeInstansi =$ssouserKodeInstansi->KodeInstansi;\n\t\t$this->level =$ssouserlevel->level;\n }", "public function init() {\n $bootstrap = $this->getInvokeArg(\"bootstrap\");\n $this->aConfig = $bootstrap->getOptions();\n $this->view->aConfig = $this->aConfig;\n $this->model= new Model_InfoBusiness();\n $this->modelMapper= new Model_InfoBusinessMapper();\n $this->modelProvince = new Model_MasterProvince();\n $this->modelProvinceMapper = new Model_MasterProvinceMapper();\n $this->modelDistrict = new Model_MasterDistrict();\n $this->modelDistrictMapper = new Model_MasterDistrictMapper();\n $this->modelWard = new Model_MasterWard();\n $this->modelWardMapper = new Model_MasterWardMapper();\n }", "public function init()\n {\n $this->projectController->init();\n }", "public function init() {\n $menu = \"<li><a href=\\\" /eu-zone/new \\\">Ajouter zone</a></li>\";\n $this->view->placeholder(\"menu\")->set($menu);\n $this->view->jQuery()->enable();\n $this->view->jQuery()->uiEnable();\n }", "public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "function __construct(){\n\t\t$this -> modelo = new usuarioBss();\n\t}", "function init_painel(){\n $CI =& get_instance();\n $CI->load->library(array('sistema','session','form_validation','table'));\n $CI->load->helper(array('form','url','array','text','file'));\n $CI->load->model('usuarios_model','usuarios');\n\n //carregamento dos models\n set_tema('titulo_padrao','Tarefas');\n\n set_tema('rodape','');\n set_tema('template','painel_view');\n set_tema('loadcss',load_css(array(\n 'foundation.min',\n 'torch.style',\n 'materialdesignicons.min',\n 'app',\n 'datatables.min')),FALSE);\n\n set_tema('loadjs',load_js(array(\n 'datatables.min',\n 'foundation.min',\n 'app')),FALSE);\n\n set_tema('loadjquery', load_js(array(\n 'jquery'\n )));\n}", "public function __init(){}", "public function initialize()\n { $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"notification\");\n }", "public function init() {\n \n // Instantiate the class\n (new MidrubBaseAdminCollectionFrontendControllers\\Init)->view();\n \n }", "function init()\r\n\t{\r\n\t\t$projet = unserialize($_SESSION['session']->projet);\r\n\t\t$this->view->nom_complet = $projet->nom_complet;\r\n\t\t$this->view->desc_projet = $projet->description_projet;\r\n\t\t$this->view->employe = unserialize($_SESSION['session']->account)->account_lid;\r\n\t}" ]
[ "0.71464646", "0.7136841", "0.70934016", "0.70462555", "0.7031951", "0.70223707", "0.701641", "0.6928267", "0.6910896", "0.687278", "0.685213", "0.6849543", "0.68044615", "0.68019354", "0.6794113", "0.67782575", "0.6751173", "0.67415476", "0.67296976", "0.6726295", "0.6699921", "0.66961384", "0.6677882", "0.6670659", "0.6670062", "0.6647979", "0.6645772", "0.6619859", "0.6615822", "0.66154003", "0.66066617", "0.66012", "0.65841264", "0.6582206", "0.6581772", "0.6574112", "0.6572584", "0.6569745", "0.6562993", "0.65496427", "0.653957", "0.65395236", "0.65368766", "0.6527088", "0.65211016", "0.6516625", "0.6513558", "0.6512587", "0.65107", "0.6510544", "0.6508927", "0.6503202", "0.6497034", "0.6497034", "0.6492957", "0.6489265", "0.6487648", "0.64865595", "0.6482294", "0.6474229", "0.6466721", "0.64636904", "0.6457308", "0.6448705", "0.64460874", "0.6443349", "0.6434045", "0.64317906", "0.6430773", "0.64271706", "0.6426701", "0.6420217", "0.64120954", "0.64120954", "0.6411508", "0.64112836", "0.64101", "0.64092237", "0.6406631", "0.6403943", "0.64006287", "0.6399492", "0.6395212", "0.6393564", "0.63919246", "0.63897574", "0.63883454", "0.63876146", "0.63806075", "0.63802326", "0.6379575", "0.6377897", "0.63771373", "0.6377018", "0.6377018", "0.6375548", "0.6374597", "0.63692766", "0.63677764", "0.63668454", "0.6364206" ]
0.0
-1
Default data passed to context
function twig_timber_context( $context ) { //Useful Variables global $template; $context['theme_template'] = str_replace( '.php', '', basename( $template ) ); $context['theme_url'] = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; //Bam! Magic! return $context; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function defaultData();", "private function twigDefaultContext()\n {\n // show language bar by default\n if (!isset($this->data['hideLanguageBar'])) {\n $this->data['hideLanguageBar'] = false;\n }\n // get languagebar\n $this->data['languageBar'] = null;\n if ($this->data['hideLanguageBar'] === false) {\n $languageBar = $this->generateLanguageBar();\n if (is_null($languageBar)) {\n $this->data['hideLanguageBar'] = true;\n } else {\n $this->data['languageBar'] = $languageBar;\n }\n }\n\n // assure that there is a <title> and <h1>\n if (isset($this->data['header']) && !isset($this->data['pagetitle'])) {\n $this->data['pagetitle'] = $this->data['header'];\n }\n if (!isset($this->data['pagetitle'])) {\n $this->data['pagetitle'] = 'SimpleSAMLphp';\n }\n }", "public function default() {\n \n $this->data = ModuleConfig::settings();\n // [Module_Data]\n }", "public function __construct($data=null,$default_data=null)\r\n\t{\r\n\t\t$this->data = $data;\r\n\t\t$this->default_data = $default_data;\r\n\t}", "protected function _getContextDataDef()\n\t{\n\n\t\t$application = JFactory::getApplication();\n\n\t\t// define context data to be retrieved. Cannot be done at class level,\n\t\t// as some default values are dynamic\n\t\t$contextData = array(\n\n\t\t\tarray('name' => 'limit', 'html_name' => 'limit', 'default' => $application->getCfg('list_limit'), 'type' => 'int')\n\t\t\t, array('name' => 'limitstart', 'html_name' => 'limitstart', 'default' => 0, 'type' => 'int')\n\t\t\t// search string applied to either sef or non sef\n\t\t\t, array('name' => 'search_all', 'html_name' => 'search_all', 'default' => '', 'type' => 'string')\n\t\t\t// ordering column\n\t\t\t, array('name' => 'filter_order', 'html_name' => 'filter_order', 'default' => 'oldurl', 'type' => 'string')\n\t\t\t// ordering direction\n\t\t\t, array('name' => 'filter_order_Dir', 'html_name' => 'filter_order_Dir', 'default' => 'ASC', 'type' => 'string')\n\n\t\t);\n\n\t\treturn $contextData;\n\t}", "public function set_default_data() {\n\t\t$this->button_text_color = '#FFFFFF';\n\t\t$this->button_background_color = '#6699CC';\n\n\t\t$this->header_text_color = '#FFFFFF';\n\t\t$this->header_background_color = '#6699CC';\n\n\t\t$this->button_text = 'Do Not Sell My Data';\n\n\t\t$this->publish_status = 'Draft';\n\t\t$this->last_published = '';\n\n\t\t$this->ot_logo = '';\n\t\t$this->display_position = 'right';\n\t\t$this->floating_button\t= '';\n\t\t$this->isLinkEnabled \t= 'textlink';\n\t}", "public function fromContext($key, $default);", "public static function getDefaultContext() {\n if (!self::$context)\n return self::getEmptyObject();\n else\n return self::$context;\n }", "public function getDefaultData()\n {\n return $this->predefined;\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->type = 1;\n\t\t$this->total_index = 0;\n\t\t$this->is_published = true;\n\t\t$this->is_featured = false;\n\t\t$this->comments_count = 0;\n\t}", "public function getDefaultContext()\n {\n return $this->defaultContext;\n }", "protected function _getContextDataDef()\n\t{\n\t\t$contextData = parent::_getContextDataDef();\n\n\t\t// define context data to be retrieved. Cannot be done at class level,\n\t\t// as some default values are dynamic\n\t\t$addedContextData = array(\n\n\t\t\t// search string applied to either sef or non sef\n\t\t\tarray('name' => 'search_pageid', 'html_name' => 'search_pageid', 'default' => '', 'type' => 'string')\n\t\t\t// component used in url\n\t\t, array('name' => 'filter_component', 'html_name' => 'filter_component', 'default' => '', 'type' => 'string')\n\t\t\t// show all/only with duplicates/only w/o duplicates\n\t\t, array('name' => 'filter_duplicate', 'html_name' => 'filter_duplicate', 'default' => 0, 'type' => 'int')\n\t\t\t// show all/only with aliases/only w/o aliases\n\t\t, array('name' => 'filter_alias', 'html_name' => 'filter_alias', 'default' => 0, 'type' => 'int')\n\t\t\t// show all/only custom/only automatic\n\t\t, array('name' => 'filter_url_type', 'html_name' => 'filter_url_type', 'default' => 0, 'type' => 'int')\n\t\t\t// show all/only one language\n\t\t, array('name' => 'filter_language', 'html_name' => 'filter_language', 'default' => '', 'type' => 'string')\n\n\t\t\t// show all/only with duplicates/only w/o duplicates\n\t\t, array('name' => 'filter_title', 'html_name' => 'filter_title', 'default' => 0, 'type' => 'int')\n\t\t\t// show all/only with aliases/only w/o aliases\n\t\t, array('name' => 'filter_desc', 'html_name' => 'filter_desc', 'default' => 0, 'type' => 'int')\n\n\t\t\t// show/hide duplicates/404 on metas page\n\t\t, array('name' => 'filter_hide_urls', 'html_name' => 'filter_hide_urls', 'default' => 0, 'type' => 'int')\n\n\t\t\t// show/hide duplicates/404 on metas page\n\t\t, array('name' => 'filter_hit_type', 'html_name' => 'filter_hit_type', 'default' => 0, 'type' => 'int')\n\t\t\t// requested or not\n\t\t, array('name' => 'filter_requested_urls', 'html_name' => 'filter_requested_urls', 'default' => 0, 'type' => 'int')\n\n\t\t);\n\n\t\treturn array_merge($contextData, $addedContextData);\n\t}", "protected function setDefaultTemplate(): void\n {\n $this->setDefaultData(function(Generator $faker) {\n return [\n 'password' => 'xx',\n 'username' => $faker->email,\n 'modified' => time(),\n // set the model's default values\n // For example:\n // 'name' => $faker->lastName\n ];\n });\n }", "public function data($data = null);", "public function data($data = null);", "public function data($data = null);", "protected function getCurrentUserData() {}", "protected function getCurrentUserData() {}", "public function get_default_params()\n {\n }", "public static function get_default_ctx() \n {\n return $_SESSION['_user_vision']['ctx'];\n }", "public function applyDefaultData()\n {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $config = $objectManager->get('\\Magento\\Framework\\App\\Config\\ScopeConfigInterface');\n\n $this->setsup_is_active(1);\n $this->setsup_locale($config->getValue('general/locale/code'));\n $this->setsup_currency($config->getValue('currency/options/base'));\n $this->setsup_country($config->getValue('general/country/default'));\n\n return $this;\n }", "public function default_data() : array {\n\t\treturn [\n\t\t\t'meta' => [\n\t\t\t\t'title' => '',\n\t\t\t\t'permalink' => '',\n\t\t\t\t'cta_text' => '',\n\t\t\t\t'cta_url' => '',\n\t\t\t],\n\t\t\t'curate' => [\n\t\t\t\t'post_ids' => [],\n\t\t\t],\n\t\t\t'filters' => [\n\t\t\t\t'filter' => [],\n\t\t\t],\n\t\t];\n\t}", "public function getContextData( $context_name = NULL )\n\t{\n\t\tif( NULL !== $context_name )\n\t\t{\n\t\t\t$previous_context_name = $this->context_name;\n\t\t\t$this->setContext( $context_name );\n\t\t}\n\t\tif ( 'MAIN' == $this->context_name )\n\t\t{\n\t\t\t$this->current_context['data']['layout']\t= $this->layout;\n\t\t}\n\t\t// If $this->current_context is an array, we have to use the fetch function of the template object.\n\t\tif ( is_array( $this->current_context ) )\n\t\t{\n\t\t\t$result = $this->render( $this->current_context['data'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->current_context;\n\t\t}\n\t\tif( NULL !== $context_name )\n\t\t{\n\t\t\t$this->setContext( $previous_context_name );\n\t\t}\n\t\treturn $result;\n\t}", "public function setDefaultData(array $defaultData);", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "function set_data($default_values) {\n if (is_object($default_values)) {\n $default_values = (array)$default_values;\n }\n $this->data_preprocessing($default_values);\n parent::set_data($default_values); //never slashed for moodleform_mod\n }", "function getDefaultValue($data = array())\r\n\t{\r\n\t\tif (!isset($this->_default)) {\r\n\t\t\t$w = new FabrikWorker();\r\n\t\t\t$params = $this->getParams();\r\n\t\t\t$link = $params->get('link_default_url');\r\n\t\t\t// $$$ hugh - no idea what this was here for, but it was causing some BIZARRE bugs!\r\n\t\t\t//$formdata = $this->getForm()->getData();\r\n\t\t\t// $$$ rob only parse for place holder if we can use the element\r\n\t\t\t// otherwise for encrypted values store raw, and they are parsed when the\r\n\t\t\t// form in processsed in form::addEncrytedVarsToArray();\r\n\t\t\tif ($this->canUse()) {\r\n\t\t\t\t$link = $w->parseMessageForPlaceHolder($link, $data);\r\n\t\t\t}\r\n\t\t\t$element = $this->getElement();\r\n\t\t\t$default = $w->parseMessageForPlaceHolder($element->default, $data);\r\n\t\t\tif ($element->eval == \"1\") {\r\n\t\t\t\t$default = @eval(stripslashes($default));\r\n\t\t\t}\r\n\t\t\t$this->_default = array('label'=>$default, 'link'=>$link);\r\n\t\t}\r\n\t\treturn $this->_default;\r\n\t}", "public static function getContextDataByKey(string $key, $default = null)\n {\n $coroutineId = self::getCoroutineId();\n if (isset(self::$context[$coroutineId][self::DATA_KEY][$key])) {\n return self::$context[$coroutineId][self::DATA_KEY][$key];\n }\n\n return $default;\n }", "function setContext( )\n\t{\n\t\t$args = new safe_args();\n\t\t$args->set('name', \tREQUIRED, 'string');\n\t\t$args->set('value', REQUIRED, 'any');\t\t\n\t\t$args = $args->get(func_get_args());\n\t\t\t\n\t\t$this->context[$args['name']] = $args['value'];\n\t}", "function dataDefatult($data, $defaultD) {\r\n if ($data)\r\n return $data;\r\n return $defaultD;\r\n}", "protected function setDefaultValueExtra()\n {\n $this->default_data['address'] = 'xxx.atlassian.net';\n $this->default_data['rest_api_resource'] = '/rest/api/latest/';\n $this->default_data['timeout'] = 60;\n\n $this->default_data['clones']['mappingTicket'] = array(\n array(\n 'Arg' => self::ARG_SUMMARY,\n 'Value' => 'Issue {include file=\"file:$centreon_open_tickets_path/providers/' .\n 'Abstract/templates/display_title.ihtml\"}'\n ),\n array('Arg' => self::ARG_DESCRIPTION, 'Value' => '{$body}'),\n array('Arg' => self::ARG_PROJECT, 'Value' => '{$select.jira_project.id}'),\n array('Arg' => self::ARG_ASSIGNEE, 'Value' => '{$select.jira_assignee.id}'),\n array('Arg' => self::ARG_PRIORITY, 'Value' => '{$select.jira_priority.id}'),\n array('Arg' => self::ARG_ISSUETYPE, 'Value' => '{$select.jira_issuetype.id}'),\n );\n }", "private function dataInit($data) {\n\n\t\t\t//Default From\n\t\t\t$data['from']\t\t= empty($data['from']) ? $this->default['from'] : $data['from'];\n\t\t\t$data['complaint']\t= empty($data['complaint']) ? $this->default['returnPath'] : $data['complaint'];\n\t\t\t$data['reply']\t\t= empty($data['reply']) ? array($this->default['returnPath']) : $data['reply'];\n\t\t\t$data['cc']\t\t\t= empty($data['cc']) ? array() : $data['cc'];\n\t\t\t$data['bcc']\t\t= empty($data['bcc']) ? array() : $data['bcc'];\n\t\t\treturn $data;\n\t\t}", "function AddDetailsForDefaultLang()\n\t{\t$this->AddDetailsForLang($this->def_lang);\n\t}", "abstract public function get_context();", "public function applyDefaultValues()\n\t{\n\t\t$this->ativo = true;\n\t\t$this->tipo_acesso = 'M';\n\t\t$this->estado_civil = 'O';\n\t\t$this->nivel_acesso = '1';\n\t\t$this->usuario_validado = false;\n\t}", "public function set_to_default()\n\t{\n\t\t// SimpleDB requires a value for every attribue...\n\t\t$this->_name = NULL;\n\t\t$this->_contextid = NULL;\n\t\t$this->_userid = NULL;\n $this->_deleted = 0;\n\t\t$this->_lastmodified = 0;\t\n\t}", "public function getDefaultDataParameters()\n {\n return [\n Config::PARAM_CURRENT_URL => $this->getCurrentUrl(),\n Config::PARAM_REFERRER_URL => $this->getReferrerUrl(),\n Config::PARAM_VISIT_TYPE => $this->getCookie(Config::COOKIE_VISIT_TYPE, 'first_time'),\n Config::PARAM_VERSION => Config::ANALYTICS_VERSION,\n Config::PARAM_VISIT_ID => $this->getCookie(Config::COOKIE_VISIT_ID, $this->generateRandomString())\n ];\n }", "public function get_default_args(){ return $this->default_args; }", "public function applyDefaultValues()\n\t{\n\t\t$this->points = '0';\n\t\t$this->type = 0;\n\t\t$this->hidden = 0;\n\t\t$this->relationship_status = 0;\n\t\t$this->show_email = 1;\n\t\t$this->show_gender = 1;\n\t\t$this->show_hometown = 1;\n\t\t$this->show_home_phone = 1;\n\t\t$this->show_mobile_phone = 1;\n\t\t$this->show_birthdate = 1;\n\t\t$this->show_address = 1;\n\t\t$this->show_relationship_status = 1;\n\t\t$this->credit = 0;\n\t\t$this->login = 0;\n\t}", "function init(&$context){}", "function ctools_plugin_example_context_create_simplecontext($empty, $data = NULL, $conf = FALSE) {\n $context = new ctools_context('simplecontext');\n $context->plugin = 'simplecontext';\n\n if ($empty) {\n return $context;\n }\n\n if ($conf) {\n if (!empty($data)) {\n $context->data = new stdClass();\n // For this simple item we'll just create our data by stripping non-alpha and\n // adding '_from_configuration_item_1' to it.\n $context->data->item1 = t(\"Item1\");\n $context->data->item2 = t(\"Item2\");\n $context->data->description = preg_replace('/[^a-z]/i', '', $data['sample_simplecontext_setting']);\n $context->data->description .= '_from_configuration_sample_simplecontext_setting';\n $context->title = t(\"Simplecontext context from config\");\n return $context;\n }\n }\n else {\n // $data is coming from an arg - it's just a string.\n // This is used for keyword.\n $context->title = $data;\n $context->argument = $data;\n // Make up a bogus context\n $context->data = new stdClass();\n $context->data->item1 = t(\"Item1\");\n $context->data->item2 = t(\"Item2\");\n\n // For this simple item we'll just create our data by stripping non-alpha and\n // adding '_from_simplecontext_argument' to it.\n $context->data->description = preg_replace('/[^a-z]/i', '', $data);\n $context->data->description .= '_from_simplecontext_argument';\n $context->arg_length = strlen($context->argument);\n return $context;\n }\n}", "public function applyDefaultValues()\n {\n $this->jml_lantai = '1';\n $this->asal_data = '1';\n $this->last_sync = '1901-01-01 00:00:00';\n }", "public function initData()\r\n {\r\n $this->data['page_class'] = strtolower('page-' . $this->classname . '-' . $this->methodname) . ' ';\r\n $this->data['class_name'] = $this->classname;\r\n $this->data['method_name'] = $this->methodname;\r\n\r\n //default description and keyword\r\n $this->data['keywords'] = '';\r\n $this->data['description'] = '';\r\n \r\n $this->data['language'] = $this->session->userdata('language');\r\n\r\n if ($this->config->item('test_mode') == TRUE)\r\n {\r\n $this->output->enable_profiler('true');\r\n }\r\n \r\n //see any notifications to display\r\n if (!empty($this->session->flashdata('notification'))) {\r\n $this->data['notification'] = $this->session->flashdata('notification');\r\n $this->data['notification_type'] = $this->session->flashdata('notification_type');\r\n }\r\n\r\n // set csrf\r\n $this->data['csrf'] = array(\r\n 'token_name' => $this->security->get_csrf_token_name(),\r\n 'hash' => $this->security->get_csrf_hash(),\r\n 'cookie_name' => $this->config->item('csrf_cookie_name'),\r\n );\r\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->platform = 'pc';\n\t\t$this->experience_score = 0;\n\t\t$this->up_votes = 0;\n\t\t$this->down_votes = 0;\n\t\t$this->is_guest = 0;\n\t\t$this->is_admin = 0;\n\t\t$this->today_votes = 0;\n\t\t$this->email_on = 1;\n\t}", "function default_data(){\n $data['content']='';\n $data['title']='Image Crop';\n $data['file_name']='';\n $data['file_type']='';\n $data['file_path']='';\n $data['raw_name']='angela';\n $data['orig_name']='';\n $data['file_ext']='.jpg';\n $data['file_size']='';\n $data['is_image']='';\n $data['image_width']='';\n $data['image_height']='';\n $data['image_type']='';\n $data['image_size']='';\n return $data;\n\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->st_usuario = true;\n\t}", "public function get_default_event_params() {\n return array(\n 'objectid' => $this->id,\n 'context' => $this->df->context,\n 'other' => array(\n 'dataid' => $this->dataid,\n 'viewid' => $this->id,\n )\n );\n }", "protected function initDefaultInitialContext()\n {\n\n // initialize the configuration values for the initial context\n $description = new DescriptionNode(new NodeValue('The initial context configuration.'));\n $storage = new StorageNode('AppserverIo\\Storage\\StackableStorage');\n\n // set the default initial context configuration\n $this->initialContext = new InitialContextNode('AppserverIo\\Appserver\\Core\\InitialContext', $description, $storage);\n }", "protected function _addDefaultContextProviders()\n {\n $this->addContextProvider('orm', function ($request, $data) {\n if (is_array($data['entity']) || $data['entity'] instanceof \\Traversable) {\n $pass = (new Collection($data['entity']))->first() !== null;\n if ($pass) {\n return new EntityContext($request, $data);\n }\n }\n\n return $this->_addEntityContent($request, $data);\n });\n\n $this->_addFormContextProvider();\n $this->_addFormArrayProvider();\n }", "function add_to_context($data)\r\n{\r\n $data['THEME_URL'] = THEME_URL;\r\n $data['homeurl'] = get_site_url();\r\n if (ICL_LANGUAGE_CODE != 'en') {\r\n $data['homeurl'] .= '/' . ICL_LANGUAGE_CODE;\r\n }\r\n // Menus\r\n $data['topmenu'] = new TimberMenu(36);\r\n $data['menu'] = new TimberMenu(35);\r\n $data['footerregion'] = new TimberMenu(9606);\r\n $data['footersection'] = new TimberMenu(9607);\r\n // Sidebar\r\n $data['sidebar_right'] = Timber::get_widgets('sidebar-1');\r\n $data['sidebar_bottom'] = Timber::get_widgets('sidebar-2');\r\n // Languages WPML\r\n $data['languages'] = icl_get_languages('skip_missing=0&orderby=code');\r\n $data['language'] = $data['languages'][ICL_LANGUAGE_CODE];\r\n return $data;\r\n}", "public function loadData($context)\n\t{\n\t\t$this->first_name = $context->employee->firstname;\n\t\t$this->last_name = $context->employee->lastname;\n\t\t$this->email = $context->employee->email;\n\t}", "public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 1;\n $this->amountevaluation = 0;\n $this->defaultstatus = 0;\n $this->defaultdirectiondate = 0;\n $this->defaultenddate = 0;\n $this->defaultpersoninevent = 0;\n $this->defaultpersonineditor = 0;\n $this->maxoccursinevent = 0;\n $this->showtime = false;\n $this->ispreferable = true;\n $this->isrequiredcoordination = false;\n $this->isrequiredtissue = false;\n $this->mnem = '';\n }", "private static function addDefaultFields(array $data){\n $data['created_at'] = Carbon::now();\n $data['updated_at'] = Carbon::now();\n\n if(!array_key_exists('provider', $data)){\n $data['provider'] = 'default';\n $data['provider_id'] = NULL;\n }\n\n return $data;\n }", "function _gizra_access_context_default_contexts() {\n $export = array();\n $context = new stdClass;\n $context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */\n $context->api_version = 3;\n $context->name = 'purchasing_users';\n $context->description = 'Show purchasing users on product content view.';\n $context->tag = 'gizra_access';\n $context->conditions = array(\n 'node' => array(\n 'values' => array(\n 'product' => 'product',\n ),\n 'options' => array(\n 'node_form' => 0,\n ),\n ),\n );\n $context->reactions = array(\n 'block' => array(\n 'blocks' => array(\n 'views-purchasing_users-block_1' => array(\n 'module' => 'views',\n 'delta' => 'purchasing_users-block_1',\n 'region' => 'right',\n 'weight' => 0,\n ),\n ),\n ),\n );\n\n $export['purchasing_users'] = $context;\n return $export;\n}", "abstract protected function data();", "public function useDefaults()\n\t{\n\t\t$this->use_defaults = true;\n\t}", "protected function useDefaultValuesForNotConfiguredOptions() {}", "function data_preprocessing(&$default_values){\n }", "public function set_behaviors_default_data() {\n\n\t\t$this->is_google_personalize_enabled = 'checked';\n\t\t$this->google_confirmation_title = 'Personalized advertisements';\n\t\t$this->google_confirmation_message = 'Turning this off will opt you out of personalized advertisements delivered from Google on this website.';\n\t\t$this->confirmbutton = 'Confirm';\n\t\t$this->is_email_enabled = 'checked';\n\t\t$this->email_address = '';\n\t\t$this->popup_main_title = 'Do Not Sell My Personal Information';\n\t\t$this->link_text = 'Privacy Policy';\n\t\t$this->link_url = '';\n\t\t$this->privacy_policy_message = 'Exercise your consumer rights by contacting us below';\n\t\t$this->is_phone_enabled = 'checked';\n\t\t$this->phone_number = '';\n\t\t$this->form_link_text = 'Exercise Your Rights';\n\t\t$this->form_link_url = '';\n\t\t$this->form_enable = 'checked';\n\t\t$this->publish_status = 'Draft';\n\t\t$this->last_published = '';\n\t\t$this->selectuseroption\t\t\t\t = 'All';\n\t\t$this->isIABEnabled \t\t\t\t = 'checked';\n\t\t$this->isLSPAenable \t\t\t\t = '';\n\t}", "public function data_preprocessing(&$default_values)\n\t{\n\t\tif ($this->current->instance)\n\t\t{\n\t\t\t$draftitemid = file_get_submitted_draft_itemid('videos');\n\t\t\tfile_prepare_draft_area(\n\t\t\t\t$draftitemid,\n\t\t\t\t$this->context->id,\n\t\t\t\t'mod_elang',\n\t\t\t\t'videos',\n\t\t\t\t0\n\t\t\t);\n\t\t\t$default_values['videos'] = $draftitemid;\n\n\t\t\t$draftitemid = file_get_submitted_draft_itemid('subtitle');\n\t\t\tfile_prepare_draft_area(\n\t\t\t\t$draftitemid,\n\t\t\t\t$this->context->id,\n\t\t\t\t'mod_elang',\n\t\t\t\t'subtitle',\n\t\t\t\t0\n\t\t\t);\n\t\t\t$default_values['subtitle'] = $draftitemid;\n\n\t\t\t$draftitemid = file_get_submitted_draft_itemid('poster');\n\t\t\tfile_prepare_draft_area(\n\t\t\t\t$draftitemid,\n\t\t\t\t$this->context->id,\n\t\t\t\t'mod_elang',\n\t\t\t\t'poster',\n\t\t\t\t0\n\t\t\t);\n\t\t\t$default_values['poster'] = $draftitemid;\n\n\t\t\t$options = json_decode(isset($default_values['options']) ? $default_values['options'] : '{}', true);\n\t\t\t$default_values['showlanguage'] = isset($options['showlanguage']) ? $options['showlanguage'] : true;\n\t\t\t$default_values['repeatedunderscore'] = isset($options['repeatedunderscore']) ? $options['repeatedunderscore'] : 10;\n\t\t\t$default_values['titlelength'] = isset($options['titlelength']) ? $options['titlelength'] : 100;\n\t\t\t$default_values['limit'] = isset($options['limit']) ? $options['limit'] : 10;\n\t\t\t$default_values['left'] = isset($options['left']) ? $options['left'] : 20;\n\t\t\t$default_values['top'] = isset($options['top']) ? $options['top'] : 20;\n\t\t\t$default_values['size'] = isset($options['size']) ? $options['size'] : 16;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$config = get_config('elang');\n\t\t\t$default_values['repeatedunderscore'] = $config->repeatedunderscore;\n\t\t\t$default_values['showlanguage'] = $config->showlanguage;\n\t\t\t$default_values['titlelength'] = $config->titlelength;\n\t\t\t$default_values['limit'] = $config->limit;\n\t\t\t$default_values['left'] = $config->left;\n\t\t\t$default_values['top'] = $config->top;\n\t\t\t$default_values['size'] = $config->size;\n\t\t}\n\t}", "protected static function getData()\n {\n }", "public function applyDefaultValues()\n {\n $this->is_active = false;\n $this->is_closed = false;\n }", "function data_preprocessing(&$default_values){\n parent::data_preprocessing($default_values);\n if (!empty($default_values['config'])) {\n $values = json_decode($default_values['config'], true);\n foreach ($values as $key => $value) {\n $default_values['config_' . $key] = $value;\n }\n unset($default_values['config']);\n }\n }", "private function getDefault(){\n\t\treturn array(\n\t\t\t'id' => \t'', \n\t\t\t'name' => \t'',\n\t\t\t'date' => \t'', \n\t\t\t'lvl' => \t'', \n\t\t\t'exp' => \t''\n\t\t);\n\t}", "function add_global_context(array $data)\n {\n foil('context')->add(new GlobalContext($data));\n }", "function ctools_demos_context_demos($empty, $data = NULL, $conf = FALSE) {\n $context = new ctools_context('demos');\n $context->plugin = 'demos';\n \n if ($empty) {\n return $context;\n }\n \n \n\n if ($conf) {\n if (!empty($data)) {\n // For this simple item we'll just create our data by stripping non-alpha and\n // adding '_from_configuration_item_1' to it.\n $context->data = new stdClass();\n $context->data->item1 = t(\"Item1\");\n $context->data->item2 = t(\"Item2\");\n $context->data->description = preg_replace('/[^a-z]/i', '', $data['sample_demos_setting']);\n $context->data->description .= '_from_configuration_sample_demos_setting';\n $context->title = t(\"Simplecontext context from config\");\n return $context;\n }\n }\n else {\n // $data is coming from an arg - it's just a string.\n // This is used for keyword.\n $context->title = $data;\n $context->argument = $data;\n // Make up a bogus context\n \n // For this simple item we'll just create our data by stripping non-alpha and\n // adding '_from_demos_argument' to it.\n $context->data = new stdClass();\n $context->data->item1 = t(\"Item1\");\n $context->data->item2 = t(\"Item2\");\n $context->data->description = preg_replace('/[^a-z]/i', '', $data);\n $context->data->description .= '_from_demos_argument';\n $context->arg_length = strlen($context->argument);\n return $context;\n }\n}", "public function setupDefaultContextVariables(): void\n {\n $this->sharedState()->basePath = '/';\n }", "protected function getData() { }", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->data = $this->data['value'];\r\r\n }\r\r\n }", "protected function getModuleDefaultData() {\n return array(\n 'title'=>ucfirst($this->configModule),\n 'disabled'=>0,\n 'protected'=>0,\n 'search'=>0,\n 'secure'=>0\n );\n }", "public function getData()\n {\n // {\n // $data = $this->model->getUsername;\n // $this->buffer->addData('home', $data);\n // } else {\n // $data = \"signin\";\n // $this->buffer->addData('home', $data);\n // }\n $this->data['action'] = \"Sorry\";\n $this->data['entity'] = \"This page does not exist\";\n $this->data['home'] = \"signin\";\n\n $this->data['scripts'] = [];\n }", "function default_view_context() {\n return array(\n 'metaTitle' => 'Suicide MVC', // Set in \"<head><meta>\"\n 'metaAuthor' => '', // Displayed in \"#container > #footer\" && set in \"<head><meta>\"\n 'heading' => 'Suicide MVC', // Displayed in \"#container > #header > h1\"\n\n 'styleSheets' => 'CakePHP/cake.generic.css', // ';' delimited list of paths from the $viewStyleDirectory\n 'jscripts' => '', // ';' delimited list of paths from the $viewJavascriptDirectory\n // 'sections' => 'data_list.php' // (useful to implement?)\n\n 'data' => NULL // used by model, never need to modify\n );\n}", "public function __default()\n\t{\n\n\t}", "protected function func_default() {}", "public function data();", "public function data();", "public function renderDefault()\n\t{\n\t\t$identity = $this->getUser()->getIdentity();\n\t}", "private function set_context_vars() {\n\n\t\t$this->total_pages = $this->data->get_total_pages();\n\t\t$this->total_items = $this->data->get_total_items();\n\t\t$this->current_page = $this->data->get_current_page();\n\t\t$this->current_url = $this->get_current_url();\n\n\t\tif ( 1 === $this->current_page ) {\n\t\t\t$this->disable_first = ' disabled';\n\t\t}\n\n\t\tif ( $this->current_page === $this->total_pages ) {\n\t\t\t$this->disable_last = ' disabled';\n\t\t}\n\t}", "public function applyDefaultValues()\n {\n $this->shnttype = '';\n $this->shntseq = 0;\n $this->shntkey2 = '';\n $this->shntform = '';\n }", "function _scholar_polls_context_default_contexts() {\n $items = array();\n\n $items[] = array(\n 'namespace' => 'scholar',\n 'attribute' => 'feature',\n 'value' => 'polls',\n 'description' => 'Polls feature context',\n 'node' => array(\n '0' => 'poll',\n ),\n 'views' => array(\n '0' => 'scholar_polls',\n ),\n 'menu' => 'polls',\n 'block' => array(\n 'vsite_taxonomy_0' => array(\n 'module' => 'vsite_taxonomy',\n 'delta' => '0',\n 'weight' => 41,\n 'region' => 'right',\n 'status' => '0',\n 'label' => 'Categories - Filter categorized content',\n 'type' => 'context_ui',\n ),\n 'vsite_widgets_2' => array(\n 'module' => 'vsite_widgets',\n 'delta' => '2',\n 'weight' => 42,\n 'region' => 'right',\n 'status' => '0',\n 'label' => 'ShareThis Button - Allows you to share posts using popular online services',\n 'type' => 'context_ui',\n ),\n ),\n );\n return $items;\n}", "public static function setDefaultContext(pQryTag $defaultContext) {\n self::$context = pQry($defaultContext);\n return self::$context;\n }", "protected function __construct($data=null)\n {\n $this->data = $data;\n }", "function getItemDefaultOptions();", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "function defaultHandler($parser, $data) {\n // virtual\n }", "public function getDefaultParams();", "public function applyDefaultValues()\n\t{\n\t\t$this->is_archived = 0;\n\t\t$this->google_analytics_enabled = false;\n\t}", "function __data() {\n\t\tif ($data = $this->Session->read('data')) {\n\t\t\tforeach ($data as $k => $i) {\n\t\t\t\t$obj = ClassRegistry::init($k);\n\t\t\t\t$this->data[$k] = $i;\n\t\t\t}\n\t\t\t$this->Session->write('data', null);\n\t\t}\n\t\t// attempts to remember identity of commentor and prefill fields\n\t\tif (empty($this->data['Comment']) && $data = $this->Cookie->read('CommentUser')) {\n\t\t\t$this->data['Comment'] = $data;\n\t\t}\n\t}", "function _setDefaults()\n {\n $this->type = $this->rs['type'] = \"unknown\";\n $this->parent = $this->rs['parent'] = 0;\n $this->lecture_id = $this->rs['lecture_id'] = SessionDataBean::getLectureId();\n $this->title = $this->rs['title'] = \"\";\n $this->mtitle = $this->rs['mtitle'] = \"\";\n $this->text = $this->rs['text'] = \"<p></p>\";\n $this->position = $this->rs['position'] = 0;\n $this->redirect = $this->rs['redirect'] = \"\";\n $this->ival1 = $this->rs['ival1'] = 0;\n $this->copy_parent = $this->rs['copy_parent'] = false;\n }", "private function setCategoryDefaultValues()\n {\n if($this->formMode === 'add')\n {\n $this->data['category_title'] = '';\n }\n else if(empty($_POST['category_submit']))\n {\n // Retrieve data from database if NOT POST request\n $data = $this->post_categories_model->getByID($this->data['category_id']);\n $this->data['category_title'] = $data['Post_Category_Title'];\n }\n }", "public function __construct($data = null)\n {\n $this->data = $data;\n }", "protected function getContext() {}", "public function renderContext() {\n\t}", "public function set_data($defaultvalues) {\n $this->tool->form_set_data($defaultvalues);\n parent::set_data($defaultvalues);\n }", "public function getDefaultValue()\n {\n if (empty($this->argList)) {\n $products = self::executeMethod('productsList')->getResponse();\n $this->argList = isset($products[0]) ? [$products[0]['id']] : [];\n }\n \n if (empty($this->defaultId)) {\n $categories = self::executeMethod('categoriesList')->getResponse();\n $delivery = self::executeMethod('deliveryVariantsList')->getResponse();\n $payment = self::executeMethod('paymentGatewaysList')->getResponse();\n $collection = self::executeMethod('collectionsList')->getResponse();\n $collect = self::executeMethod('collectsList')->getResponse();\n $statuses = self::executeMethod('customStatusesList')->getResponse();\n\n $this->defaultId = [\n 'product_id' => isset($products[0]) ? $products[0]['id'] : null,\n 'category_id' => isset($categories[0]) ? $categories[0]['id'] : null,\n 'delivery_variant_id' => isset($delivery[0]) ? $delivery[0]['id'] : null,\n 'payment_gateway_id' => isset($payment[0]) ? $payment[0]['id'] : null,\n 'parent_id' => isset($collection[0]) ? $collection[0]['id'] : null,\n 'collection_id' => isset($collect[0]) ? $collect[0]['id'] : null,\n 'permalink' => isset($statuses[0]) ? $statuses[0]['permalink'] : null,\n ];\n }\n }", "private static function provideDefaults(array &$data)\n {\n if(!array_key_exists('ime', $data))\n $data['ime'] = ''; // a string\n if(!array_key_exists('format', $data))\n $data['format'] = ''; // a string\n if(!array_key_exists('width', $data))\n $data['width'] = 0; // an integer number\n if(!array_key_exists('height', $data))\n $data['height'] = 0; // an integer number\n if(!array_key_exists('size', $data))\n $data['size'] = 0; // an integer number\n if(!array_key_exists('filename', $data))\n $data['filename'] = ''; // a string, calculated by server\n }" ]
[ "0.7213937", "0.68324363", "0.65820706", "0.6483382", "0.6421814", "0.6319465", "0.6289705", "0.62410754", "0.61998266", "0.6020523", "0.59704685", "0.5957626", "0.5956373", "0.58955055", "0.58955055", "0.58955055", "0.58763343", "0.5875669", "0.58727396", "0.58569026", "0.5851132", "0.58495545", "0.5837963", "0.58232343", "0.58090603", "0.58090603", "0.58090603", "0.5789858", "0.5785408", "0.5784159", "0.5764124", "0.57440996", "0.5723715", "0.5721874", "0.5713918", "0.56968075", "0.5674537", "0.5655348", "0.5631775", "0.5627889", "0.5615132", "0.5575802", "0.5574991", "0.5573151", "0.5564168", "0.55571604", "0.55473757", "0.5543408", "0.5543326", "0.55425966", "0.5533908", "0.55304754", "0.5519292", "0.5513827", "0.5495708", "0.54954034", "0.5492556", "0.5489377", "0.54877454", "0.5487506", "0.54844797", "0.54795516", "0.5477123", "0.5463339", "0.5460328", "0.5453692", "0.54447645", "0.543965", "0.5428504", "0.54253954", "0.54238915", "0.5414402", "0.54110837", "0.54095006", "0.5407309", "0.54051214", "0.54002947", "0.54002947", "0.53951466", "0.5388169", "0.5387876", "0.53857034", "0.53785837", "0.5376904", "0.5376506", "0.5374537", "0.5374537", "0.5374537", "0.53742254", "0.53655803", "0.5363092", "0.5357481", "0.5351942", "0.53492963", "0.5343611", "0.5342796", "0.53426754", "0.5340586", "0.5338499", "0.5335104", "0.5331073" ]
0.0
-1
Provision for the specified CO Person. The ZoneProvisioner is simple: either add or delete (or: todeleteornottodelete) If not deleting, we do a saveAssociated, which will insertorupdate (add/modify)
public function provision($coProvisioningTargetData, $op, $provisioningData) { // First figure out what to do $delete = false; $person = false; $service = false; $actionid=uniqid(); $model="CoPerson"; if(isset($provisioningData["CoPerson"])) { $service = false; $person = true; } if(isset($provisioningData["CoService"])) { $service = true; $person = false; $model="CoService"; } // skip provisioning of unrelated models if(!$person && !$service) { return TRUE; } $action=""; switch($op) { case ProvisioningActionEnum::CoPersonAdded: case ProvisioningActionEnum::CoPersonUnexpired: case ProvisioningActionEnum::CoPersonPetitionProvisioned: case ProvisioningActionEnum::CoPersonPipelineProvisioned: case ProvisioningActionEnum::CoPersonReprovisionRequested: case ProvisioningActionEnum::CoPersonUpdated: if(!$person) { CakeLog::write('json_err',array("module"=>"zone", "action"=>"provision", "id" => $actionid, "message" => "CoPerson operation without CoPerson data")); return true; } if($provisioningData['CoPerson']['status'] == StatusEnum::Active) { $delete = false; $action="Adding user ".generateCn($provisioningData['PrimaryName']). '('.$provisioningData['CoPerson']['id'].')'; } else { $delete=true; $action="Removing user ".generateCn($provisioningData['PrimaryName']). '('.$provisioningData['CoPerson']['id'].')'; } break; case ProvisioningActionEnum::CoPersonDeleted: case ProvisioningActionEnum::CoPersonExpired: case ProvisioningActionEnum::CoPersonEnteredGracePeriod: if(!$person) { CakeLog::write('json_err',array("module"=>"zone", "action"=>"provision", "id" => $actionid, "message" => "CoPerson operation without CoPerson data")); return true; } $delete = true; $action="Removing user ".generateCn($provisioningData['PrimaryName']). '('.$provisioningData['CoPerson']['id'].')'; break; case ProvisioningActionEnum::CoServiceAdded: case ProvisioningActionEnum::CoServiceUpdated: case ProvisioningActionEnum::CoServiceReprovisionRequested: if(!$service) { CakeLog::write('json_err',array("module"=>"zone", "action"=>"provision", "id" => $actionid, "message" => "CoService operation without CoService data")); return true; } if($provisioningData['CoService']['status'] == StatusEnum::Active) { $delete = false; $action="Adding service ".$provisioningData['CoService']['name'].' ('.$provisioningData['CoService']['id'].')'; } else { $delete=true; $action="Removing service ".$provisioningData['CoService']['name'].' ('.$provisioningData['CoService']['id'].')'; } break; case ProvisioningActionEnum::CoServiceDeleted: if(!$service) { CakeLog::write('json_err',array("module"=>"zone", "action"=>"provision", "id" => $actionid, "message" => "CoService operation without CoService data")); return true; } $delete = true; $action="Removing service ".$provisioningData['CoService']['name'].' ('.$provisioningData['CoService']['id'].')'; break; case ProvisioningActionEnum::CoGroupAdded: case ProvisioningActionEnum::CoGroupDeleted: case ProvisioningActionEnum::CoGroupUpdated: case ProvisioningActionEnum::CoGroupReprovisionRequested: case ProvisioningActionEnum::AuthenticatorUpdated: case ProvisioningActionEnum::CoEmailListAdded: case ProvisioningActionEnum::CoEmailListDeleted: case ProvisioningActionEnum::CoEmailListReprovisionRequested: case ProvisioningActionEnum::CoEmailListUpdated: default: CakeLog::write('json_err',array("module"=>"zone", "action"=>"provision", "id" => $actionid, "message" => "Unimplemented operation for CoPerson or CoService model")); throw new RuntimeException("Not Implemented"); break; } $config = Configure::load('scz','default'); CakeLog::write('json_not',array("module"=>"zone", "action"=>"provision", "id" => $actionid, "operation" => $op, "message" => $action, "co_id"=>$provisioningData[$model]["co_id"])); if($person) { $this->ZonePerson = ClassRegistry::init('ZoneProvisioner.ZonePerson'); $this->ZonePerson->provision($provisioningData, $delete, $actionid); } else if($service) { $this->ZoneService = ClassRegistry::init('ZoneProvisioner.ZoneService'); $this->ZoneService->provision($provisioningData, $delete, $actionid); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function provision($request);", "public function savePerson($person)\n {\n // Deal with new ayso record\n // One type at a time for now since getRPs will not work for new records\n // Need to deal with the case of adding a new person with an existing ayso record\n $personRegs = array($person->getRegAYSOV(),$person->getRegUSSF());\n foreach($personRegs as $personReg)\n {\n if ($personReg->getRegKey()) \n {\n // See if one already exists\n // Move to a validator?\n $personRegx = $this->loadPersonRegForKey($personReg->getRegKey());\n \n // Nothng existing means to just go ahead and create\n if (!$personRegx) $this->persist($personReg);\n else\n {\n // No change is okay\n if ($personReg->getId() == $personRegx->getId()) {}\n else\n {\n // Punt for now\n die('Trying to change to existing reg key');\n }\n }\n }\n else\n {\n if ($personReg->getId())\n {\n $this->remove($personReg);\n }\n }\n }\n // If no project then remove from flush\n $currentProjectPerson = $person->getCurrentProjectPerson();\n if (!$currentProjectPerson->getProject())\n {\n // This allows removeing a person from a project\n $this->remove($currentProjectPerson);// die('detached');\n \n // Need this otherwise an entity always gets added even with remove/detach\n // The cascade=persist was causing this when addProjectPerson was called by the form\n // $person->clearProjectPersons();\n }\n else $this->persist($currentProjectPerson); // Only persist if have a project\n \n // Deal with new persons\n if (!$person->getId()) $this->persist($person);\n \n $this->flush();\n }", "function insertObject(&$person) {\n\t\t$this->update(\n\t\t\t'INSERT INTO object_for_review_persons\n\t\t\t\t(object_id, seq, role, first_name, middle_name, last_name)\n\t\t\t\tVALUES\n\t\t\t\t(?, ?, ?, ?, ?, ?)',\n\t\t\tarray(\n\t\t\t\t(int) $person->getObjectId(),\n\t\t\t\t(float) $person->getSequence(),\n\t\t\t\t$person->getRole(),\n\t\t\t\t$person->getFirstName(),\n\t\t\t\t$person->getMiddleName() . '', // make non-null\n\t\t\t\t$person->getLastName()\n\t\t\t)\n\t\t);\n\t\t$person->setId($this->getInsertId());\n\t\treturn $person->getId();\n\t}", "public function provision(): Status;", "public function testNewPersonsOwnershipExistingCustomers() {\n $this->addProductToCart($this->product);\n $this->goToCheckout();\n $this->assertCheckoutProgressStep('Event registration');\n\n // Save first registrant.\n $this->clickLink('Add registrant');\n $this->submitForm([\n 'person[field_name][0][value]' => 'Person 1',\n 'person[field_email][0][value]' => '[email protected]',\n 'field_comments[0][value]' => 'No commments',\n ], 'Save');\n\n // Assert that this person profile is now owned by the current logged in\n // user.\n $person = Profile::load(1);\n // Assert that we are checking the expected person.\n $this->assertEquals('Person 1', $person->field_name->value);\n $this->assertEquals($this->adminUser->id(), $person->getOwnerId());\n }", "public function addNewPersonToCity()\n {\n }", "function assign($coId, $coPersonId, $actorCoPersonId, $provision=true) {\n $ret = array();\n \n // First, see if there are any identifiers to autoassign for this CO. This will return the\n // same thing if the answer is \"no\" or if the answer is \"invalid CO ID\".\n \n $args = array();\n $args['conditions']['Co.id'] = $coId;\n \n $identifierAssignments = $this->CoPerson->Co->CoIdentifierAssignment->find('all', $args);\n \n if(!empty($identifierAssignments)) {\n // Loop through each identifier and request assignment.\n $cnt = 0;\n \n foreach($identifierAssignments as $ia) {\n // Assign will throw an error if an identifier of this type already exists.\n \n try {\n $this->CoPerson->Co->CoIdentifierAssignment->assign($ia, $coPersonId, $actorCoPersonId);\n $ret[ $ia['CoIdentifierAssignment']['identifier_type'] ] = 1;\n $cnt++;\n }\n catch(OverflowException $e) {\n // An identifier already exists of this type for this CO Person\n $ret[ $ia['CoIdentifierAssignment']['identifier_type'] ] = 2;\n }\n catch(Exception $e) {\n $ret[ $ia['CoIdentifierAssignment']['identifier_type'] ] = $e->getMessage();\n }\n }\n \n if($cnt > 0 && $provision) {\n // At least one identifier was assigned, so fire provisioning\n \n $this->CoPerson->Behaviors->load('Provisioner');\n $this->CoPerson->manualProvision(null, $coPersonId, null, ProvisioningActionEnum::CoPersonUpdated);\n }\n }\n \n return $ret;\n }", "public function provision()\n {\n $this->assignRootPassword();\n\n $databaseInstanceConfig = new DatabaseInstanceConfig($this);\n\n $operation = $this->client()->createDatabaseInstance($databaseInstanceConfig);\n $this->update(['operation_name' => $operation['name']]);\n\n $this->setCreating();\n\n MonitorDatabaseInstanceCreation::dispatch($this);\n }", "public function insert(Persona $persona);", "public function store(CreatePersonRequest $request)\n {\n $input = $request->all();\n\n $person = $this->personRepository->create($input);\n $person->communities()->attach($request->communities);\n\n for($i = 0; $i < count($request->communities); $i++){\n $person->features()->attach($request->features, \n [\n 'community_id' => $request->communities[$i]\n ]); \n } \n\n Flash::success(trans('flash.store', ['model' => trans_choice('functionalities.people', 1)]));\n\n return redirect(route('people.index'));\n }", "protected function initDefaultProvisioners()\n {\n\n // initialize the provisioners\n $standardProvisioner = new ProvisionerNode('standard', 'AppserverIo\\Appserver\\Core\\StandardProvisioner');\n\n // add the provisioners to the appserver node\n $this->provisioners[$standardProvisioner->getPrimaryKey()] = $standardProvisioner;\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 store(PersonRequest $request)\n {\n $provider=new Person($request->all());\n //dd($article);\n $provider->type='cliente';\n $provider->save();\n Flash::success(\"Se ha creado el cliente \".$provider->name.' de forma satisfactoria.')->important();\n return redirect()->route('customers.index');\n }", "public static function load_psuperson( &$v, $k ) {\n\t\t$p = new PSUPerson( $v['pid'] );\n\n\t\t$v['certification_number'] = $p->certification_number;\n\t\t$v['idcard'] = $p->idcard();\n\t\t$v['account_creation_date'] = $p->account_creation_date;\n\t\t\n\t\tunset($p);\n\t}", "function add_extra_person($billing_person,$data,$product_id,$action_set_id = 0)\n {\n $data['Address2Street1'] = $data['StreetAddress1'];\n $data['Address2Street2'] = $data['StreetAddress2'];\n $data['City2'] = $data['City'];\n $data['State2'] = $data['State'];\n $data['PostalCode2'] = $data['PostalCode'];\n $data['Country2'] = $data['Country'];\n $data['_OrderName'] = $billing_person->FirstName . \" \" . $billing_person->LastName . \" \" . $billing_person->Email;\n $data['_PurchasedBy'] = $billing_person->FirstName . \" \" . $billing_person->LastName;\n $data['_OrderEmail'] = $billing_person->Email;\n\n $contact_id = $this->create_contact($data);\n //Opt Person In\n $this->optIn($data['Email'],'Friend purchased');\n\n //Create Zero Dollar Order\n $affiliate_id = $this->get_current_affiliate($contact_id);\n $invoice_id = $this->blankOrder($contact_id,'Extra: The Matrix Assessment Profile',$this->infuDate(date('d-m-Y')),$affiliate_id,$affiliate_id);\n $this->addOrderItem($invoice_id,$product_id,4,0.00,1,'Friend: ' . $data['_OrderName'] . ' ordered','');\n\n sleep(1); //IS throttling\n\n //Add Notes to the Job/Order Record\n $invoice = $this->dsLoad('Invoice',$invoice_id,array('JobId'));\n $r = $this->dsUpdate('Job',$invoice['JobId'],array('JobNotes' => 'Ordered By: ' . $data['_OrderName']));\n\n sleep(1); //IS throttling\n\n $r = $this->runAS($contact_id,$action_set_id);\n\n $this->achieveGoal('optimalwellness','mapfriendemail',$contact_id);\n\n return $data['FirstName'] . ' ' . $data['LastName'] . ' ID: ' . $contact_id;\n\n }", "public function setProvisionAmount(float $provision_amount): self\n {\n $this->provision_amount = $provision_amount;\n\n return $this;\n }", "function addPerson(){\n\t\t \n\t\t $this->getMakeMetadata();\n\t\t $changesMade = false;\n\t\t $requestParams = $this->requestParams;\n\t\t if(isset($requestParams[\"uuid\"]) && isset($requestParams[\"role\"])){\n\t\t\t\t\n\t\t\t\t$personUUID = trim($requestParams[\"uuid\"]);\n\t\t\t\t$uri = self::personBaseURI.$personUUID;\n\t\t\t\t\n\t\t\t\tif(isset($requestParams[\"rank\"])){\n\t\t\t\t\t $rank = $requestParams[\"rank\"];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t $rank = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$pObj = new dbXML_dbPerson;\n\t\t\t\t$pObj->initialize();\n\t\t\t\t$pObj->dbPenelope = true;\n\t\t\t\t$pFound = $pObj->getByID($personUUID);\n\t\t\t\tif($pFound){\n\t\t\t\t\t $name = $pObj->label;\n\t\t\t\t\t if($requestParams[\"role\"] == \"creator\"){\n\t\t\t\t\t\t $persons = $this->rawCreators;\n\t\t\t\t\t\t $persons = $this->addPersonRank($persons, $name, $uri, $rank);\n\t\t\t\t\t\t $this->rawCreators = $persons;\n\t\t\t\t\t\t $changesMade = true;\n\t\t\t\t\t }\n\t\t\t\t\t elseif($requestParams[\"role\"] == \"contributor\"){\n\t\t\t\t\t\t $persons = $this->rawContributors;\n\t\t\t\t\t\t $persons = $this->addPersonRank($persons, $name, $uri, $rank);\n\t\t\t\t\t\t $this->rawContributors = $persons;\n\t\t\t\t\t\t $changesMade = true;\n\t\t\t\t\t }\n\t\t\t\t\t elseif($requestParams[\"role\"] == \"person\"){\n\t\t\t\t\t\t $persons = $this->rawLinkedPersons;\n\t\t\t\t\t\t $persons = $this->addPersonRank($persons, $name, $uri, $rank);\n\t\t\t\t\t\t $this->rawLinkedPersons = $persons;\n\t\t\t\t\t\t $changesMade = true;\n\t\t\t\t\t }\n\t\t\t\t\t else{\n\t\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t if($changesMade){\n\t\t\t\t$this->saveMetadata(); //save the results\n\t\t }\n\t\t return $changesMade;\n\t }", "public function createPerson($personData) {\n return $this->createRecord('person', $personData);\n }", "function create_person($personRec = \"\", $personID = \"\")\n\t{\n\t\t//throw new exception(\"create_person - this function is not implemented\");\n\n\t}", "public function store(PersonRequest $request)\n {\n $person = new Person();\n $person -> first_name = $request->first_name;\n $person -> middle_name = $request->middle_name;\n $person -> last_name = $request->last_name;\n $person -> gender = $request->gender;\n $person -> cadre = $request->cadre;\n $person -> email = $request->email;\n $person -> phone = $request->phone;\n $person -> facility = $request->facility;\n $person -> save(); \n $personId = $person->person_id;\n $pRole = $request->role;\n \n if ($pRole == 1) {\n $mentor = new Mentor();\n $mentor->person_id = $personId;\n $mentor->save();\n } else {\n $mentee = new Mentee();\n $mentee->person_id = $personId;\n $mentee->save();\n }\n return redirect('person-home');\n \n }", "public function only_person(CreateVisitorRequest $request){\n \n $person = Person::create([\n 'type_dni' => $request->type_dni,\n 'dni' => $request->dni,\n 'name' => $request->name,\n 'lastname' => $request->lastname,\n 'address' => $request->address,\n 'phone' => $request->phone,\n 'email' => $request->email,\n 'branch_id' => 1,\n ]);\n\n /**\n * Registro de la fotografia \n */\n if ($request->file('file') != null) {\n $photo = $request->file('file');\n $path = $photo->store('persons');\n $image = new Image;\n $image->path = $path;\n $image->imageable_type = \"App\\Person\";\n $image->imageable_id = $person->id;\n $image->save();\n }\n\n return response()->json([\n 'message' => 'Registrado correctamente',\n ]);\n }", "public function __construct($person)\n {\n $this->person = $person;\n }", "public function setPerson(\\Entities\\Person $person = null) {\n $this->person = $person;\n }", "public function dokan_remove_bookable_person() {\n $post_data = wp_unslash( $_POST ); // phpcs:ignore\n\n // @codingStandardsIgnoreLine\n if ( ! isset( $post_data['action'] ) && $post_data['action'] != 'woocommerce_remove_bookable_person' ) {\n return;\n }\n if ( ! wp_verify_nonce( $post_data['security'], 'delete-bookable-person' ) ) {\n return;\n }\n\n wp_delete_post( intval( $post_data['person_id'] ) );\n exit;\n }", "public function recoverPersonUsingCity(Person $person)\n {\n }", "public function __construct(Person $person)\n {\n $this->person = $person;\n }", "public function createOrLoadPerson($params)\n {\n $personLeague = null;\n $person = null;\n \n // Have to have a league identifier\n if (isset($params['aysoVolunteerId']))\n {\n // AYSOV12345678\n $identifier = $params['aysoVolunteerId'];\n $personLeague = $this->loadPersonLeagueForIdentifier($identifier);\n \n // No updated is the person exists\n if ($personLeague) return $personLeague->getPerson();\n \n // Make one\n $person = $this->newPerson();\n $personLeague = $person->getVolunteerAYSO();\n $person->addLeague($personLeague);\n \n $personLeague->setMemId (substr($identifier,5));\n \n $personLeague->setLeague($params['aysoRegionId']);\n \n // Always have primary person person\n $personPerson = $this->newPersonPerson();\n $personPerson->setRolePrimary();\n $personPerson->setMaster($person);\n $personPerson->setSlave ($person);\n $personPerson->setVerified('Yes');\n $person->addPerson($personPerson);\n \n // Referee badge\n if (isset($params['aysoRefereeBadge']))\n {\n $badge = $params['aysoRefereeBadge'];\n $cert = $person->getCertRefereeAYSO(); // Creates one if needed\n $person->addCert($cert);\n \n $cert->setIdentifier($identifier);\n $cert->setBadgex($badge);\n }\n }\n // Check other possible leagues\n if (!$person) return null;\n \n // Update Person\n $person->setFirstName($params['personFirstName']);\n $person->setLastName ($params['personLastName']);\n $person->setNickName ($params['personNickName']);\n $person->setEmail ($params['personEmail']);\n $person->setPhone ($params['personPhone']);\n \n if ($params['personNickName']) $name = $params['personNickName'] . ' ' . $params['personLastName'];\n else $name = $params['personFirstName'] . ' ' . $params['personLastName'];\n \n $person->setName($name);\n \n return $person;\n }", "public function testAddNewPersonWithPersonList() {\n // Add an existing person.\n Profile::create([\n 'type' => 'person',\n 'field_name' => 'Existing person',\n 'field_email' => '[email protected]',\n 'uid' => $this->adminUser->id(),\n ])->save();\n\n $this->addProductToCart($this->product);\n $this->goToCheckout();\n $this->assertCheckoutProgressStep('Event registration');\n\n // Go to add registrant page.\n $this->clickLink('Add registrant');\n // Assert that one person is already shown.\n $this->assertSession()->pageTextContains('Existing person');\n $this->submitForm([], 'New person');\n\n // Assert that no new profile is created yet.\n $this->assertNull(Profile::load(2));\n\n // Now, create person.\n $this->submitForm([\n 'person[field_name][0][value]' => 'Person 1',\n 'person[field_email][0][value]' => '[email protected]',\n ], 'Save');\n\n // Assert that a new profile now exists.\n $person = Profile::load(2);\n $this->assertEquals('Person 1', $person->field_name->value);\n $this->assertEquals($this->adminUser->id(), $person->getOwnerId());\n\n // Continue checkout.\n $this->submitForm([], 'Continue');\n $this->assertSession()->pageTextContains('1 item');\n $this->processOrderInformation(FALSE);\n // Review.\n $this->assertCheckoutProgressStep('Review');\n $this->assertSession()->pageTextContains('Contact information');\n $this->assertSession()->pageTextContains('Billing information');\n $this->assertSession()->pageTextContains('Order Summary');\n $this->assertSession()->pageTextContains('Person 1');\n // Finalize order.\n $this->submitForm([], 'Complete checkout');\n $this->assertSession()->pageTextContains('Your order number is 1. You can view your order on your account page when logged in.');\n $this->assertSession()->pageTextContains('0 items');\n }", "public function hire(Person $person)\r\n {\r\n $this->staff->add($person);\r\n\r\n }", "public function testUpdatePerson()\n {\n }", "public function created(Apartment $apartment)\n {\n //\n }", "public static function store_accounts_persons( $insert_persons, $list_vacantes, $users_cv, $desc_users ){\n $where = [ 'person_id' => $insert_persons->id, 'account_id' => $list_vacantes[0]->account_id ];\n $select_account_persons = self::$_model::show_model( [], $where, new AccountsPersonsModel);\n #debuger($select_account_persons[0]);\n if ($select_account_persons) {\n return $select_account_persons[0];\n }\n #se realiza la inserccion a la tabla de accounts_persons\n \t\t$data_accounts_persons = [\n \t\t\t'person_id' \t\t\t => $insert_persons->id\n \t\t\t,'account_id' \t\t\t => $list_vacantes[0]->account_id\n \t\t\t,'type_id' \t\t\t\t => null\n \t\t\t,'blood_type_id' \t\t => null\n \t\t\t,'state_id' \t\t\t => $users_cv[0]->id_state\n \t\t\t,'marital_status_id' \t => null\n \t\t\t,'image_file_name' \t\t => null\n \t\t\t,'phone_number' \t\t => $users_cv[0]->telefono\n \t\t\t,'mobile_phone_number' \t => $users_cv[0]->telefono\n \t\t\t,'street' \t\t\t\t => null\n \t\t\t,'neighborhood' \t\t => null\n \t\t\t,'municipality' \t\t => null\n \t\t\t,'postal_code' \t\t\t => $desc_users[0]->codigo\n \t\t\t,'email' \t\t\t\t => $users_cv[0]->email\n \t\t\t,'is_wrong_email' \t\t => null\n \t\t\t,'website_url' \t\t\t => null\n \t\t\t,'facebook_url' \t\t => null\n \t\t\t,'linkedin_url' \t\t => null\n \t\t\t,'googleplus_url' \t\t => null\n \t\t\t,'skype_url' \t\t\t => null\n \t\t\t,'twitter_url' \t\t\t => null\n \t\t\t,'youtube_url' \t\t\t => null\n \t\t\t,'is_deleted' \t\t\t => null\n \t\t\t,'created' \t\t\t\t => date(\"Y-m-d H:i:s\")\n \t\t\t,'modified' \t\t\t => date(\"Y-m-d H:i:s\")\n \t\t];\n \t\treturn self::$_model::insert_model([$data_accounts_persons],new AccountsPersonsModel)[0];\n\n }", "public function add_person() {\n\t \t\n\t \tvc_map( \n\t \t\tarray(\n\t\t \t \"name\" => __(\"Person\", \"CURLYTHEME\"),\n\t\t \t \"base\" => \"person\",\n\t\t \t \"content_element\" => true,\n\t\t \t \"icon\" => \"curly_icon\",\n\t\t \t \"class\" => '',\n\t\t \t \"category\" => __('Curly Themes Extension', \"CURLYTHEME\"), \n\t\t \t \"params\" => array(\n\t\t \t array(\n\t\t \t \"type\" => \"textfield\",\n\t\t \t \"heading\" => __(\"Person Name\", \"CURLYTHEME\"),\n\t\t \t 'edit_field_class' => 'vc_col-sm-6',\n\t\t \t \"holder\" => \"div\",\n\t\t \t \"param_name\" => \"name\"\n\t\t \t ),\n\t\t \t array(\n\t\t \t \"type\" => \"textfield\",\n\t\t \t \"heading\" => __(\"Position\", \"CURLYTHEME\"),\n\t\t \t 'edit_field_class' => 'vc_col-sm-6 vc_column',\n\t\t \t \"param_name\" => \"position\"\n\t\t \t ),\n\t\t \t array(\n\t\t \t \"type\" => \"textfield\",\n\t\t \t \"heading\" => __(\"E-mail\", \"CURLYTHEME\"),\n\t\t \t 'edit_field_class' => 'vc_col-sm-3 vc_column',\n\t\t \t \"param_name\" => \"email\"\n\t\t \t ),\n\t\t \t array(\n\t\t \t \"type\" => \"textfield\",\n\t\t \t \"heading\" => __(\"Facebook\", \"CURLYTHEME\"),\n\t\t \t 'edit_field_class' => 'vc_col-sm-3 vc_column',\n\t\t \t \"param_name\" => \"facebook\"\n\t\t \t ),\n\t\t \t array(\n\t\t \t \"type\" => \"textfield\",\n\t\t \t \"heading\" => __(\"Twitter\", \"CURLYTHEME\"),\n\t\t \t 'edit_field_class' => 'vc_col-sm-3 vc_column',\n\t\t \t \"param_name\" => \"twitter\"\n\t\t \t ),\n\t\t \t array(\n\t\t \t \"type\" => \"textfield\",\n\t\t \t \"heading\" => __(\"LinkedIn\", \"CURLYTHEME\"),\n\t\t \t 'edit_field_class' => 'vc_col-sm-3 vc_column',\n\t\t \t \"param_name\" => \"linkedin\"\n\t\t \t ),\n\t\t \t array(\n\t\t \t \"type\" => \"attach_image\",\n\t\t \t \"heading\" => __(\"Image\", \"CURLYTHEME\"),\n\t\t \t 'edit_field_class' => 'vc_col-sm-6 vc_column',\n\t\t \t \"param_name\" => \"picture\"\n\t\t \t ),\n\t\t \t array(\n\t\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t\t'heading' => __(\"Small Pictures?\", \"CURLYTHEME\"),\n\t\t\t\t\t\t\t'edit_field_class' => 'vc_col-sm-6 vc_column',\n\t\t\t\t\t\t\t'param_name' => 'style',\n\t\t\t\t\t\t\t'value' => array( __( 'Yes', 'CURLYTHEME' ) => 'mini' )\n\t\t\t\t\t\t),\n\t\t \t array(\n\t\t \t \"type\" => \"textarea_html\",\n\t\t \t \"heading\" => __(\"Extra Description\", \"CURLYTHEME\"),\n\t\t \t \"param_name\" => \"content\"\n\t\t \t )\n\t \t \t)\n\t \t\t) \n\t \t);\n\t }", "public function store(PersonRequest $personRequest)\n {\n $person = $this->personRepo->create($personRequest->all());\n return $this->sendResponse($person->toArray(), 'Persona Creada!');\n }", "public function forceDeleted(PersonaParcela $personaParcela)\n {\n //\n }", "public function save(PersonData $data)\n {\n $id = $data->getId();\n\n return $this->run(\n $id == null ? 'POST' : 'PUT',\n 'pedidovenda-rest/pessoas'.($id > 0 ? '/'.$id : null),\n ['json' => $data->toArray()]\n );\n }", "public static function store_candidates( $account_person_insert ){\n #debuger($account_person_insert);\n $select_candidates = self::$_model::show_model( [], ['account_person_id' => $account_person_insert->id], new CandidatoModel);\n #debuger($select_candidates[0]);\n if ($select_candidates) {\n return $select_candidates[0];\n }\n \t$data_candidate = [\n \t\t\t'account_person_id'\t\t => $account_person_insert->id\n \t\t\t,'user_id'\t\t\t\t => null\n \t\t\t,'assigned_to_user_id'\t => null\n \t\t\t,'candidate_source_id'\t => null\n \t\t\t,'mark_id'\t\t\t\t => null\n \t\t\t,'photo_dir'\t\t\t => null\n \t\t\t,'photo'\t\t\t\t => null\n \t\t\t,'score'\t\t\t\t => null\n \t\t\t,'is_filed'\t\t\t\t => null\n \t\t\t,'deleted'\t\t\t\t => null\n \t\t\t,'created'\t\t\t\t => date('Y-m-d')\n \t\t\t,'modified'\t\t\t\t => date('Y-m-d')\n \t\t];\n \t\treturn self::$_model::insert_model([$data_candidate], new CandidatoModel)[0];\n\n }", "public function insertZone($info) {\n\t\t$this->insert ( $info );\n\t}", "public function hydratePhone(ObjectManager &$manager, Form $form, Person &$person)\n {\n $data = $this->getSigninObject($form);\n \n $phone = new Phone();\n $phone->setType($data->getPhoneType())\n ->setNumber($data->getPhoneNumber());\n $manager->persist($phone);\n \n $person->getPhones()->add($phone);\n }", "public function createPersonPlan($project,$person,$persist = false)\n {\n $personPlan = $this->newPersonPlan();\n \n if (is_object($project))\n {\n $personPlan->setProjectKey ($project->getKey());\n $personPlan->setPlanProperties($project->getPlan());\n }\n else\n {\n $personPlan->setPlanProperties($project['plan']);\n $personPlan->setProjectKey ($project['info']['key']); \n }\n if ($person) $person->addPlan($personPlan);\n \n if ($persist) $this->persist($personPlan);\n \n return $personPlan;\n }", "public function store(PersonRequest $request)\n {\n $this->validate($request, [\n 'codigo' => 'required|unique:persona|max:30',\n ]);\n\n Person::create([\n 'codigo' => $request->codigo,\n 'nombre' => $request->nombre,\n 'apaterno' => $request->apaterno,\n 'amaterno' => $request->amaterno,\n 'fec_nac' => $request->fec_nac,\n 'tipo' => $request->tipo,\n 'sexo' => $request->sexo,\n ]);\n\n PersonalData::create([\n 'persona_codigo' => $request->codigo,\n 'estado_civil' => $request->estado_civil,\n 'religion' => $request->religion,\n 'email' => $request->email,\n 'telefono' => $request->telefono,\n 'escolaridad' => $request->escolaridad,\n 'carrera_id' => $request->carrera_id,\n 'domicilio' => $request->domicilio,\n 'actividad_economica' => $request->actividad_economica,\n 'lug_nac' => $request->lug_nac,\n 'lug_res' => $request->lug_res,\n ]);\n\n toast('Alumno registrado correctamente.', 'success', 'top');\n return redirect()->route('student.show', $request['codigo']);\n }", "public function insert(personal $personal);", "public function save_person(Request $request)\n {\n $company_id = CompanyHelper::touch($request->user_id);\n $item_id = CompanyPersonnelHelper::save_data($company_id, $request->person);\n\n return response()->json([\n 'status' => 'OK',\n 'id' => $item_id\n ]);\n }", "public function destroy(Person $person)\n {\n //\n }", "public function destroy(Person $person)\n {\n //\n }", "public function testCreatePerson()\n {\n }", "public function create()\n {\n $this->cpAuthorize();\n }", "public function placeOrderAfter(Varien_Event_Observer $observer) {\n if (!$this->isEnabled()) {\n return;\n }\n $order = $observer->getOrder();\n /* @var $order Mage_Sales_Model_Order */\n $payment = $order->getPayment();\n if ($payment->getMethodInstance()->getCode() == PlanetPayment_IpayGateway_Model_Ipay::METHOD_CODE) {\n if ($payment->getIsVisible() && !$order->getHasCcSaved()) {\n /* @var $profile PlanetPayment_IpayGateway_Model_PaymentProfile */\n $profile = Mage::getModel('ipay/profile');\n Mage::helper('core')->copyFieldset('ipay_paymentprofile_savecc_payment', 'to_paymentprofile', $payment, $profile);\n $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());\n if ($customer->getId()) {\n $billingAddress = $customer->getDefaultBillingAddress();\n Mage::helper('core')->copyFieldset('ipay_paymentprofile_savecc_address', 'to_paymentprofile', $billingAddress, $profile);\n $streetAddress = $profile->getStreetAddress();\n $address = '';\n if ($streetAddress) {\n if (is_array($streetAddress)) {\n foreach ($streetAddress as $addressLine) {\n $address .= ' ' . $addressLine;\n }\n }\n }\n $profile->setAddress($address);\n\n $requestModel = Mage::getModel('ipay/xml_request')->setIpayPaymentProfile($profile)\n ->setCustomer($customer);\n\n $request = $requestModel->generateNewWalletProfileRequest()\n ->send();\n\n $response = $request->getResponse()\n ->setPaymentProfile();\n\n if ($response->isSuccess()) {\n $profile = $response->getIpayPaymentProfile();\n $profile->setIsVisible(true)\n ->setCustomerId($customer->getId())\n ->setCardNumberLast4($profile->getCardNumberLast4())\n ->save();\n $order->setHasCcSaved(true);\n }\n }\n }\n }\n return;\n }", "public function people() {\n\t\tregister_post_type(\n\t\t\t'people',\n\t\t\tarray(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => __( 'People' ),\n\t\t\t\t\t'singular_name' => __( 'Person' ),\n\t\t\t\t),\n\t\t\t\t'public' => true,\n\t\t\t\t'has_archive' => true,\n\t\t\t\t'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'custom-fields' ),\n\t\t\t\t'taxonomies' => array( 'category' ),\n\t\t\t\t'menu_icon' => 'dashicons-media-text',\n\t\t\t)\n\t\t);\n\t}", "public function FirstStepTenant()\n {\n $user = User::find(\\Auth::user()->idPerson);\n $user->status = 1;\n $user->save();\n }", "public function submitNewPerson(array &$form, FormStateInterface $form_state) {\n $form_state->setRebuild();\n\n $person = $this->registrantFormHelper->createPersonForRegistrant($this->registrant);\n $this->registrant->setIdentity($person);\n }", "public function hire(Person $person)\n\t{\n\t\t$this->staff->add($person);\n\t}", "public function hydrateCompany(ObjectManager &$manager, Form $form, Person &$person)\n {\n $data = $this->getSigninObject($form);\n \n $person->setCompany($data->getCompany())\n ->setService($data->getService())\n ->setJob($data->getJob());\n \n $address = new Adress();\n $address->setReferer($data->getCompanyReferer())\n ->setAdress($data->getCompanyAdress())\n ->setComplement($data->getCompanyComplement())\n ->setTown($data->getCompanyTown())\n ->setPostalCode($data->getCompanyPostalCode())\n ->setCountry($data->getCompanyCountry());\n \n $manager->persist($address);\n $person->setCompanyAdress($address);\n }", "public function test_canCreate_Returns_True_If_Personnel_Have_Access() {\n\n\t\t$check_returns_true = $this->authorization_service3->canCreate(1,1);\n\n\t\t$this->assertTrue($check_returns_true);\n\t}", "public function aggiungiPartecipante($persona) {\n\t$this->partecipanti[]=$persona;\n $this->numVisite++;\n}", "public function __construct(public Person $person)\n {\n }", "public function onPreCreate(ResourceEventInterface $event): void\n {\n $member = $this->getMemberFromEvent($event);\n\n $this->getGateway($member->getAudience()->getGateway(), GatewayInterface::INSERT_MEMBER);\n }", "public function provisionWith($provisioners)\n {\n $this->option('--provision-with ' . $provisioners);\n\n return $this;\n }", "public function setProvisionCp(?float $provisionCp): ChargesPaie {\n $this->provisionCp = $provisionCp;\n return $this;\n }", "function insert($reload = true)\n {\n if (!isset($this->is_confirmed)) {\n // If user is not approved, invoice shouldn't be approved too.\n if ($this->getUser() && !$this->getUser()->isApproved())\n $this->is_confirmed = self::IS_CONFIRMED_WAIT_FOR_USER;\n\n if ($this->getDi()->config->get('manually_approve_invoice')) {\n // Now check is manually_approve_invoice_products is set.\n if ($products = $this->getManuallyApproveInvoiceProducts()) {\n foreach ($this->getProducts() as $p)\n if (in_array($p->product_id, $products))\n $this->is_confirmed = self::IS_CONFIRMED_NOT_CONFIRMED;\n }\n else\n $this->is_confirmed = self::IS_CONFIRMED_NOT_CONFIRMED;\n }\n\n // If above checks, didn't change is_confirmed status, then invoice is confirmed;\n if (!isset($this->is_confirmed))\n $this->is_confirmed = self::IS_CONFIRMED_CONFIRMED;\n }\n if (empty($this->remote_addr)) {\n $this->remote_addr = htmlentities(@$_SERVER['REMOTE_ADDR']);\n }\n\n $this->getDi()->hook->call(Am_Event::INVOICE_BEFORE_INSERT, array('invoice' => $this));\n\n if (empty($this->tm_added))\n $this->tm_added = sqlTime('now');\n $this->_getInvoiceKey();\n\n $maxAttempts = 20;\n for ($i = 0; $i <= $maxAttempts; $i++)\n try {\n $this->_getPublicId();\n $ret = parent::insert($reload = true);\n break;\n } catch (Am_Exception_Db_NotUnique $e) {\n if ($i >= $maxAttempts)\n throw $e;\n $this->public_id = null;\n }\n foreach ($this->_items as $item)\n $item->set('invoice_id', $this->invoice_id)\n ->set('invoice_public_id', $this->public_id)->insert();\n\n $this->getDi()->hook->call(Am_Event::INVOICE_AFTER_INSERT, array('invoice' => $this));\n\n return $ret;\n }", "public function testUpdateSiteMembershipRequestForPerson()\n {\n }", "public function destroy(Person $person)\n\t{\n\t\t//\n\t}", "public static function addressNew(\n int $person,\n int $city,\n int $zipcode,\n int $street,\n int $building,\n $type = 'reel'\n ) {\n $query = Core::query('address-new');\n $query->bindValue(':people', $person, PDO::PARAM_INT);\n $query->bindValue(':type', $type);\n $query->bindValue(':city', $city, PDO::PARAM_INT);\n $query->bindValue(':zipcode', $zipcode, PDO::PARAM_INT);\n $query->bindValue(':street', $street, PDO::PARAM_INT);\n $query->bindValue(':building', $building, PDO::PARAM_INT);\n $query->execute();\n }", "function proAccount($ar){\n if (!$this->customerIsPro())\n return;\n $this->wtscallback();\n $this->modcustomer->proMyAccount($ar);\n }", "public function setPersonType($value)\n {\n $this->setProperty(\"PersonType\", $value, true);\n }", "public function createPersona($parent_id, $user_id, $approved)\n\t{\n\t\t$persona = $this->em()->findOne('Shinka\\Persona:Persona', [\n\t\t\t\"parent_id\" => $parent_id, \n\t\t\t\"user_id\" =>$user_id\n\t\t]);\n\n\t\tif (!$persona) {\n\t\t\t$persona = $this->em()->create('Shinka\\Persona:Persona');\n\t\t\t$persona->parent_id = $parent_id;\n\t\t\t$persona->user_id = $user_id;\n\t\t}\n\n\t\t$persona->approved = $approved;\n $this->persona = $persona;\n\t}", "public function insert_people($id_reserve, $name, $lastname, $comment, $type){\n $query=\"INSERT INTO `\".DB_PREFIX.\"people` (`id`,\n\t\t\t\t\t\t\t\t\t\t\t\t`id_reserve` ,\n\t\t\t\t\t\t\t\t\t\t\t\t`name` ,\n\t\t\t\t\t\t\t\t\t\t\t\t`lastname` ,\n\t\t\t\t\t\t\t\t\t\t\t\t`passport` ,\n\t\t\t\t\t\t\t\t\t\t\t\t`type`)\n \t\t\t\t\tVALUES ( NULL ,'\".$this->link->myesc($id_reserve).\"','\".$this->link->myesc($name).\"','\".$this->link->myesc($lastname).\"','\".$this->link->myesc($comment).\"','\".$this->link->myesc($type).\"')\";\n $result = $this->link->execute($query);\n return $result;\n\t}", "function _approveNewVendor(){\n \n $this->ci->load->library('form_validation');\n $person_id = $this->ci->session->userdata('user_id');\n \n $this->resetResponse();\n\n $this->ci->form_validation->set_rules('personId', 'Vendor Person Id', 'trim|required|xss_clean|encode_php_tags|integer', array('required' => 'You must provide a %s.'));\n\n if ($this->ci->form_validation->run() == FALSE) { \n $this->_status = false;\n $this->_message = $this->ci->lang->line('person_id_missing');\n return $this->getResponse();\n } else {\n\n $personId = $this->ci->input->post('personId', true);\n $result = $this->model->get_tb('mm_person', 'person_id', array('person_id' => $personId))->result();\n if (count($result) > 0) {\n $this->model->update_tb('mm_person', array('person_id' => $personId), array('person_status'=>1));\n \n if( $this->model->getAffectedRowCount() > 0 ) {\n $this->_status = true;\n $this->_message = $this->ci->lang->line('vendor_approved'); \n }\n } else {\n $this->_status = FALSE;\n $this->_message = $this->ci->lang->line('invalid_data'); \n \n }\n\n return $this->getResponse();\n }\n \n }", "public function addNursing(Person $person)\n {\n $db = PDOController::getInstance();\n $req = $db->prepare('INSERT INTO persons(email,code,lastname,firstname,role)\n VALUES\n (?,?,?,?,?)');\n $req->execute([\n $person->getEmail(),\n $person->getCode(),\n $person->getLastName(),\n $person->getFirstName(),\n $person->getRole(),\n ]);\n return $req->fetch();\n }", "public function deployVirtualMachine($serviceofferingid, $templateid, $zoneid) {\n\t\t$data = array (\n\t\t\t\t\"apiKey\" => $this->apiKey,\n\t\t\t\t\"command\" => \"deployVirtualMachine\",\n\t\t\t\t\"response\" => \"json\",\n\t\t\t\t\"templateid\" => $templateid,\n\t\t\t\t\"zoneid\" => $zoneid,\n\t\t\t\t\"serviceofferingid\" => $serviceofferingid\n\t\t);\n\t\t$url = $this->getSignatureUrl ( $data );\n\t\treturn $this->curlGet ( $url );\n\t}", "function RegisterPerson()\n {\n if(!isset($_POST['submitted']))\n {\n return false;\n }\n // Maak een Array\n $formvars = array();\n \n $this->CollectRegistrationSubmissionPerson($formvars);\n \n \n if(!$this->SaveToDatabasePerson($formvars))\n {\n return false;\n }\n \n return true;\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:people,email,NULL,id,deleted_at,NULL',\n 'jabatan' => 'required',\n 'status' => 'required',\n ]);\n\n if ($validator->fails()) {\n return redirect('persons/add')\n ->withErrors($validator)\n ->withInput();\n }\n\n $Person = new Person();\n $Person->institution_id = Institution::getIdForCurrentUser($request->input('institution_id'));\n $Person->name = $request->input('name');\n $Person->email = $request->input('email');\n $Person->jabatan = $request->input('jabatan');\n $Person->status = $request->input('status');\n if ($request->has('nip')) {\n $Person->nip = $request->input('nip');\n }\n if ($request->has('expertises')) {\n $Person->expertises = $request->input('expertises');\n }\n $Person->user_id = Auth::user()->id;\n\n if ($Person->save()) {\n Log::info('User: '.Auth::user()->id. '->Create Person: '. $Person->id);\n flash()->overlay('Berhasil disimpan', 'Notification');\n return redirect('persons');\n }\n }", "public function run(Person $fakerPerson)\n {\n //\n Tester::create([\n 'nama' => $fakerPerson->lastNameMale(),\n 'umur' => 21,\n 'jenis_kelamin' => 'l'\n ]);\n }", "function updateObject(&$person) {\n\t\t$returner = $this->update(\n\t\t\t'UPDATE object_for_review_persons\n\t\t\t\tSET\n\t\t\t\t\tseq = ?,\n\t\t\t\t\trole = ?,\n\t\t\t\t\tfirst_name = ?,\n\t\t\t\t\tmiddle_name = ?,\n\t\t\t\t\tlast_name = ?\n\t\t\t\tWHERE person_id = ?',\n\t\t\tarray(\n\t\t\t\t(float) $person->getSequence(),\n\t\t\t\t$person->getRole(),\n\t\t\t\t$person->getFirstName(),\n\t\t\t\t$person->getMiddleName() . '', // make non-null\n\t\t\t\t$person->getLastName(),\n\t\t\t\t(int) $person->getId()\n\t\t\t)\n\t\t);\n\t\treturn $returner;\n\t}", "public function deletePersons()\n {\n $conn = $this->_em->getConnection();\n $conn->executeUpdate('DELETE FROM person_person;');\n $conn->executeUpdate('DELETE FROM person_league;');\n $conn->executeUpdate('DELETE FROM person_cert;');\n $conn->executeUpdate('DELETE FROM person;');\n \n $conn->executeUpdate('ALTER TABLE person_person AUTO_INCREMENT = 1;');\n $conn->executeUpdate('ALTER TABLE person_league AUTO_INCREMENT = 1;');\n $conn->executeUpdate('ALTER TABLE person_cert AUTO_INCREMENT = 1;');\n }", "protected function associateZonesOnCompletenessChange($request)\n {\n $this->logInfo(__METHOD__, $this->id.\":\".$this->key);\n if ($this->completeness === \"Complete\")\n {\n try {\n $sb = SkeletalBone::find($this->sb_id);\n $zones = $sb->zones()->get();\n $arr_zones = [];\n foreach($zones as $zone) {\n $arr_zones[$zone->id]['id'] = $zone->id;\n $arr_zones[$zone->id]['presence'] = true;\n }\n $this->zones()->sync($this->populateCreateFieldsOrgProjectFieldsForSyncWithData($arr_zones,\"presence\", $this, 'boolean'));\n $this->logInfo(__METHOD__, \"Complete Successful \".$this->id.\":\".$this->key);\n return true;\n } catch (QueryException $ex) {\n $this->logQueryException(__METHOD__, $request, $ex);\n }\n } else {\n try {\n $sb = SkeletalBone::find($this->sb_id);\n $zones = $sb->zones()->get();\n $arr_zones = [];\n foreach($zones as $zone) {\n $arr_zones[$zone->id]['id'] = $zone->id;\n $arr_zones[$zone->id]['presence'] = false;\n }\n $this->zones()->sync([]);\n $this->logInfo(__METHOD__, \"Not Complete Successful \".$this->id.\":\".$this->key);\n return true;\n } catch (QueryException $ex) {\n $this->logQueryException(__METHOD__, $request, $ex);\n }\n }\n return false;\n }", "public function forceDeleted(Apartment $apartment)\n {\n //\n }", "public function nuevoObjetivo($plaza,$basico,$basicoGC,$vigencia,$cantCoord){\n\t\t\ttry {\n\n\t\t\t\t$handler = new Objetivos;\t\t\t\t\n\t\t\t\t$handler->setPlaza($plaza);\n\t\t\t\t$handler->setBasico($basico);\n\t\t\t\t$handler->setBasicoGC($basicoGC);\n\t\t\t\t$handler->setVigencia($vigencia);\n\t\t\t\t$handler->setCantCoord($cantCoord);\n\n\t\t\t\t$handler->insert(null);\n\n\t\t\t} catch (Exception $e) {\n\t\t\t\tthrow new Exception($e->getMessage());\t\n\t\t\t}\n\t\t}", "public function submitSelectPerson(array &$form, FormStateInterface $form_state) {\n $form_state->setRebuild();\n\n $row_id = $form_state->getTriggeringElement()['#identity_element_registrant_row'];\n $persons = $this->getPersons();\n if (isset($persons[$row_id])) {\n $this->registrant->setIdentity($persons[$row_id]);\n }\n }", "public function setProvisionTeilen(\\MediaStoreNet\\OpenImmo\\Classes\\ProvisionTeilen $provisionTeilen)\n {\n $this->provisionTeilen = $provisionTeilen;\n return $this;\n }", "public function onAssign(OrderAssignEvent $event) {\n $order = $event->getOrder();\n if ($order->get('payment_method')->isEmpty()) {\n return;\n }\n\n $customer = $event->getCustomer();\n /** @var \\Drupal\\commerce_payment\\Entity\\PaymentMethodInterface $payment_method */\n $payment_method = $order->get('payment_method')->entity;\n if ($payment_method && empty($payment_method->getOwnerId())) {\n $payment_method_profile = $payment_method->getBillingProfile();\n if ($payment_method_profile && $this->addressBook->needsCopy($payment_method_profile)) {\n $this->addressBook->copy($payment_method_profile, $customer);\n // The data field is not copied by default but needs to be.\n // For example, both profiles need to have an address_book_profile_id.\n $billing_profile = $order->getBillingProfile();\n if ($payment_method_profile->equalToProfile($billing_profile)) {\n $billing_profile->populateFromProfile($payment_method_profile, ['data']);\n $billing_profile->save();\n }\n }\n $payment_method->setOwner($customer);\n $payment_method->save();\n }\n }", "public function testCreateSiteMembershipRequestForPerson()\n {\n }", "public function input_WbfsysPersonDuplicateSuspicion_IdPerson( $params )\n {\n $i18n = $this->view->i18n;\n\n if( !Webfrap::classLoadable( 'CorePerson_Entity' ) )\n {\n if(DEBUG)\n Debug::console( 'Entity CorePerson not exists' );\n\n Log::warn( 'Looks like the Entity: CorePerson is missing' );\n\n return;\n }\n\n\n //p: Window\n $objidCorePerson = $this->entity->getData( 'id_person' ) ;\n\n // entity ids can never be 0 so thats ok\n if\n (\n !$objidCorePerson\n || !$entityCorePerson = $this->db->orm->get\n (\n 'CorePerson',\n $objidCorePerson\n )\n )\n {\n $entityCorePerson = $this->db->orm->newEntity( 'CorePerson' );\n }\n\n $inputIdPerson = $this->view->newInput( 'inputWbfsysPersonDuplicateSuspicionIdPerson', 'Window' );\n $this->items['wbfsys_person_duplicate_suspicion-id_person'] = $inputIdPerson;\n $inputIdPerson->addAttributes(array\n (\n 'readonly' => 'readonly',\n 'name' => 'wbfsys_person_duplicate_suspicion[id_person]',\n 'id' => 'wgt-input-wbfsys_person_duplicate_suspicion_id_person'.($this->suffix?'-'.$this->suffix:''),\n 'class' => 'wcm wcm_ui_tip medium'.($this->assignedForm?' asgd-'.$this->assignedForm:''),\n 'title' => $i18n->l( 'Insert value for {@attr@} ({@src@})', 'wbf.label', array( 'attr' => 'Person', 'src' => 'Person Duplicate Suspicion' ) ),\n ));\n\n if( $this->assignedForm )\n $inputIdPerson->assignedForm = $this->assignedForm;\n\n $inputIdPerson->setWidth( 'medium' );\n\n $inputIdPerson->setData( $this->entity->getData( 'id_person' ) );\n $inputIdPerson->setReadonly( $this->fieldReadOnly( 'wbfsys_person_duplicate_suspicion', 'id_person' ) );\n $inputIdPerson->setRequired( $this->fieldRequired( 'wbfsys_person_duplicate_suspicion', 'id_person' ) );\n $inputIdPerson->setLabel( $i18n->l( 'Person', 'wbfsys.person_duplicate_suspicion.label' ) );\n\n\n $listUrl = 'modal.php?c=Core.Person.selection'\n .'&amp;suffix='.$this->suffix.'&amp;input=wbfsys_person_duplicate_suspicion_id_person'.($this->suffix?'-'.$this->suffix:'');\n\n $inputIdPerson->setListUrl ( $listUrl );\n $inputIdPerson->setListIcon( 'control/connect.png' );\n $inputIdPerson->setEntityUrl( 'maintab.php?c=Core.Person.edit' );\n $inputIdPerson->conEntity = $entityCorePerson;\n $inputIdPerson->refresh = $this->refresh;\n $inputIdPerson->serializeElement = $this->sendElement;\n\n\n\n $inputIdPerson->view = $this->view;\n $inputIdPerson->buildJavascript( 'wgt-input-wbfsys_person_duplicate_suspicion_id_person'.($this->suffix?'-'.$this->suffix:'') );\n $this->view->addJsCode( $inputIdPerson );\n\n // activate the category\n $this->view->addVar\n (\n 'showCat'.$this->namespace.'_Default' ,\n true\n );\n\n }", "public function action_personDelete() {\r\n if ($this->validateEdit()) {\r\n\r\n try {\r\n // 2. usunięcie rekordu\r\n App::getDB()->delete(\"person\", [\r\n \"id\" => $this->form->id\r\n ]);\r\n Utils::addInfoMessage('Pomyślnie usunięto rekord');\r\n } catch (\\PDOException $e) {\r\n Utils::addErrorMessage('Wystąpił błąd podczas usuwania rekordu');\r\n if (App::getConf()->debug)\r\n Utils::addErrorMessage($e->getMessage());\r\n }\r\n }\r\n\r\n // 3. Przekierowanie na stronę listy osób\r\n App::getRouter()->forwardTo('personList');\r\n }", "function insertarObligacionCompleta()\n {\n $this->objFunc = $this->create('MODObligacionPago');\n if ($this->objParam->insertar('id_obligacion_pago')) {\n $this->res = $this->objFunc->insertarObligacionCompleta($this->objParam);\n } else {\n //TODO .. trabajar en la edicion\n }\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "public function store(PersonalRequest $request)\n {\n $person = $this->person->create($request->all());\n $this->handleUploads($person);\n app('API')->tags->sync($person);\n\n $this->redirect();\n }", "public function updatePublications() {\n DAOFactory::getPersonDAO()->updatePublications($this);\n }", "protected function loadObjects() {\n\tiHRIS_AcademicYear::ensureAcademicYear();\n\tif(!$this->hasPermission(\"task(person_can_edit)\" or $this->getUser()->role==\"admin\")) {\n\t\t//$this->setRedirect(\"noaccess\");\n\t\t}\n\t\tif($this->isPost() ) {\n\t\t\t$id_num=$this->request(\"identification_number\");\n\t\t\tif($id_num==\"\")\n\t\t\treturn;\n\t\t\t$where=array(\t\"operator\"=>\"FIELD_LIMIT\",\n\t\t\t\t\t\t\t\t\"field\"=>\"identification_number\",\n\t\t\t\t\t\t\t\t\"style\"=>\"equals\",\n\t\t\t\t\t\t\t\t\"data\"=>array(\"value\"=>$id_num));\n\t\t\t$registration=I2CE_FormStorage::listFields(\"registration\",array(\"parent\"),false,$where);\n\t\t\tforeach($registration as $reg) {\n\t\t\t\t$this->pers_id = $reg[\"parent\"];\n\t\t\t\t}\n\t\t\tif(!($persObj=$this->factory->createContainer($this->pers_id)) instanceof iHRIS_Person)\n\t\t\treturn;\n\t\t\t$persObj->populate();\n\t\t\t$this->template->setForm($persObj);\n\t\t\t}\n\t\t}", "function postcodenl_civicrm_pre($op, $objectName, $id, &$params) {\n CRM_Postcodenl_Updater::pre($op, $objectName, $id, $params);\n if ($objectName == 'Address' && isset($params['country_id']) && $params['country_id'] == 1152) {\n // skip_geocode is an optional parameter through the api.\n // manual_geo_code is on the contact edit form. They do the same thing....\n if (empty($params['skip_geocode']) && empty($params['manual_geo_code'])) {\n CRM_Core_BAO_Address::addGeocoderData($params);\n }\n }\n}", "function doCreate() {\n\t\t\n\t\t// Require a validated association \n\t\tProfileAssociationValidRequired::check();\n\t\t\n\t\t// Create a new annonce with uniq id\r\n\t\t$this->annonce = new Annonce();\n\t\t$this->annonce->id = uniqid();\n\t\t\n\t\t// Populate from request\n\t\t$this->populateAnnonce();\n\t\t\n\t\t// Publish this announce\t\n\t\t$this->annonce->publish();\n\t\t\n\t\t// Make nice benevolat be notified of future canditatures\n\t\t$req = new Candidature();\n\t\t$req->annonceID = $this->annonce->id;\n\t\t$req->subscribe(ProfileNiceBenevolat::$USERID);\n\t\t\n\t\t// Succes message\r\n\t\t$this->setSuccess(_(\"Votre annonce a bien été publiée\"));\n\t\t\n\t\t// Show the new annonce\n\t\t$this->forwardTo(\"annonce:details\", array(\"id\" => $this->annonce->id));\n\r\n\t}", "function getInsertId() {\n\t\treturn parent::getInsertId('object_for_review_persons', 'person_id');\n\t}", "public function insert($proveedor);", "public function postflight(string $type, object $parent): void\n {\n }", "function firstentity_addperson($form , &$form_state , $personality) {\n $form['name'] = array(\n '#type' => 'textfield',\n '#title' => 'name'\n );\n\n $person = new stdClass();\n $person->personality = $personality;\n $person->id = 0;\n\n $form['person'] = array(\n '#type' => 'value',\n '#value' => $person\n );\n // validations requires is element\n $form['personality'] = array(\n '#type' => 'value',\n '#value' => $personality\n );\n // attach form elements for attached fields\n field_attach_form( 'person' , $person , $form , $form_state );\n \n $form['actions'] = array('#type' => 'actions');\n $form['actions']['add'] = array(\n '#type' => 'submit',\n '#value' => 'add'\n );\n return $form;\n}", "public function check_authorization_uri_to_show_a_person()\n {\n $person = create_person_with_nif_array();\n $this->check_json_api_uri_authorization('api/v1/person/','post', $person);\n }", "public function save()\r\n\t{\r\n\t\tif (!$this->partnerId)\r\n\t\t\treturn false;\r\n\r\n\t\t// Save partnership info\r\n\t\t$data = array(\r\n\t\t\t\"pid\" => $this->partnerId,\r\n\t\t\t\"owner_id\" => $this->ownerId,\r\n\t\t);\r\n\r\n\t\tif ($this->id)\r\n\t\t{\r\n\t\t\t$update = \"\";\r\n\t\t\tforeach ($data as $col=>$val)\r\n\t\t\t{\r\n\t\t\t\tif ($update)\r\n\t\t\t\t\t$update .= \", \";\r\n\t\t\t\t$update .= $col . \"='\" . $this->dbh->Escape($val) . \"'\";\r\n\t\t\t}\r\n\r\n\t\t\t$query = \"UPDATE object_sync_partners SET $update WHERE id='\" . $this->id . \"';\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$flds = \"\";\r\n\t\t\t$vals = \"\";\r\n\r\n\t\t\tforeach ($data as $col=>$val)\r\n\t\t\t{\r\n\t\t\t\tif ($flds)\r\n\t\t\t\t{\r\n\t\t\t\t\t$flds .= \", \";\r\n\t\t\t\t\t$vals .= \", \";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$flds .= $col;\r\n\t\t\t\t$vals .= \"'\" . $this->dbh->Escape($val) . \"'\";\r\n\t\t\t}\r\n\r\n\t\t\t$query = \"INSERT INTO object_sync_partners($flds) VALUES($vals); \r\n\t\t\t\t\t SELECT currval('object_sync_partners_id_seq') as id;\";\r\n\t\t}\r\n\r\n\t\t$result = $this->dbh->Query($query);\r\n\t\tif ($result == false)\r\n\t\t\treturn false;\r\n\r\n\t\tif (!$this->id)\r\n\t\t\t$this->id = $this->dbh->GetValue($result, 0, \"id\");\r\n\r\n\r\n\t\t// Save collections \r\n\t\t$this->saveCollections();\r\n\r\n\t\t// Send the id as confirmation that the partnership has been saved\r\n\t\treturn $this->id;\r\n\t}", "function removePerson(){\n\t\t \n\t\t $this->getMakeMetadata();\n\t\t $changesMade = false;\n\t\t $requestParams = $this->requestParams;\n\t\t if(isset($requestParams[\"uri\"]) && isset($requestParams[\"role\"])){\n\t\t\t\t\n\t\t\t\t$personURI = $requestParams[\"uri\"];\n\t\t\t\tif($requestParams[\"role\"] == \"creator\"){\n\t\t\t\t\t $persons = $this->rawCreators;\n\t\t\t\t\t unset($persons[$personURI]);\n\t\t\t\t\t $this->rawCreators = $persons;\n\t\t\t\t\t $changesMade = true;\n\t\t\t\t}\n\t\t\t\telseif($requestParams[\"role\"] == \"contributor\"){\n\t\t\t\t\t $persons = $this->rawContributors;\n\t\t\t\t\t unset($persons[$personURI]);\n\t\t\t\t\t $this->rawContributors = $persons;\n\t\t\t\t\t $changesMade = true;\n\t\t\t\t}\n\t\t\t\telseif($requestParams[\"role\"] == \"person\"){\n\t\t\t\t\t $persons = $this->rawLinkedPersons;\n\t\t\t\t\t unset($persons[$personURI]);\n\t\t\t\t\t $this->rawLinkedPersons = $persons;\n\t\t\t\t\t $changesMade = true;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t if($changesMade){\n\t\t\t\t$this->saveMetadata(); //save the results\n\t\t }\n\t\t return $changesMade;\n\t }", "public static function grantAccessDocumentToPeople($people, $type, $accessDate, $year, $status = AccessDocument::QUALIFIED): void\n {\n $user = Auth::user();\n $userId = Auth::id();\n\n $documents = [];\n foreach ($people as $person) {\n $ad = new AccessDocument([\n 'person_id' => $person->id,\n 'type' => $type,\n 'status' => $status,\n 'source_year' => $year,\n 'expiry_date' => \"$year-09-15\",\n 'access_date' => $accessDate,\n ]);\n $ad->addComment('created via maintenance function', $user);\n $ad->saveWithoutValidation();\n AccessDocumentChanges::log($ad, $userId, $ad, AccessDocumentChanges::OP_CREATE);\n $documents[] = [\n 'id' => $ad->id,\n 'person_id' => $person->id,\n ];\n }\n\n if (!empty($documents)) {\n ActionLog::record($user, 'access-document-bulk-grant', 'bulk grant', [\n 'type' => $type,\n 'documents' => $documents\n ]);\n }\n }", "public function convocaPersona(postulantesInterface $postulante){\n yii::error('convocando perosna');\n if(!$postulante->isNewRecord && $postulante->esconvocable()){\n yii::error('cumple');\n $model=new \\frontend\\modules\\inter\\models\\InterConvocados();\n $model->setScenario($model::SCENARIO_CONVOCATORIAMINIMA);\n $model->setAttributes(\n [\n 'universidad_id'=>$this->universidad_id,\n 'facultad_id'=>$this->facultad_id,\n 'depa_id'=>$this->depa_id,\n 'modo_id'=>$this->id,\n 'persona_id'=>$postulante->persona->id,\n //'docente_id'=>$postulante->id,\n 'programa_id'=>$this->programa_id,\n 'codperiodo'=>$this->programa->codperiodo,\n 'codocu'=>$model::CODIGO_DOCUMENTO,\n \n \n ]);\n $model->attributes=$postulante->pushAttributeInterModo(\n $model->attributes);\n return $model->firstOrCreate($model->attributes,\n $model::SCENARIO_CONVOCATORIAMINIMA);\n //yii::error();\n \n }else{\n return false;\n }\n \n \n \n \n }", "protected function setUp() {\n $this->object = new XG_PersonRef;\n }" ]
[ "0.5092642", "0.50719213", "0.4851578", "0.47544652", "0.46343556", "0.4537914", "0.4531917", "0.4522646", "0.45019546", "0.44570738", "0.44196057", "0.44115287", "0.43901756", "0.43724993", "0.43669438", "0.43552187", "0.43490082", "0.43408313", "0.42856318", "0.4269936", "0.4243094", "0.42204386", "0.4220283", "0.42186964", "0.4206158", "0.42016256", "0.41866648", "0.41721722", "0.4163343", "0.41471967", "0.41109124", "0.41051644", "0.40994647", "0.40908217", "0.40905342", "0.40719393", "0.40686387", "0.40638524", "0.4056864", "0.40469006", "0.4045025", "0.40439874", "0.40436664", "0.40423986", "0.40423986", "0.399802", "0.39912477", "0.39866027", "0.39860827", "0.39801654", "0.39799595", "0.3969577", "0.39647713", "0.39547062", "0.39543256", "0.39527968", "0.39475212", "0.39439818", "0.3943048", "0.39420423", "0.3936651", "0.3929376", "0.39220083", "0.39214167", "0.39166176", "0.3910599", "0.39087138", "0.39036986", "0.39017022", "0.3901635", "0.38910532", "0.38895342", "0.38863307", "0.3885476", "0.3870496", "0.3863971", "0.38540006", "0.38474616", "0.38394976", "0.382693", "0.3825022", "0.38213253", "0.38211417", "0.38113236", "0.38090548", "0.38080776", "0.3805945", "0.38017344", "0.37998712", "0.37988636", "0.37944064", "0.37873518", "0.3781629", "0.37787926", "0.3772975", "0.3772389", "0.37666687", "0.3763175", "0.37510428", "0.37451655" ]
0.5952425
0
Determine the provisioning status of this target for a CO Person ID.
public function status($coProvisioningTargetId, $Model, $id) { if($Model->name == 'CoPerson') { $this->ZonePerson = ClassRegistry::init('ZoneProvisioner.ZonePerson'); return $this->ZonePerson->status($id); } else if($Model->name == "CoService") { $this->ZoneService = ClassRegistry::init('ZoneProvisioner.ZoneService'); return $this->ZoneService->status($id); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStatus()\n {\n if (array_key_exists(\"status\", $this->_propDict)) {\n if (is_a($this->_propDict[\"status\"], \"\\Beta\\Microsoft\\Graph\\Model\\ProvisioningResult\") || is_null($this->_propDict[\"status\"])) {\n return $this->_propDict[\"status\"];\n } else {\n $this->_propDict[\"status\"] = new ProvisioningResult($this->_propDict[\"status\"]);\n return $this->_propDict[\"status\"];\n }\n }\n return null;\n }", "public function getProvisioning();", "public function provision(): Status;", "public function getConcurrentOrgIdProvisioningEnabled()\n {\n if (array_key_exists(\"concurrentOrgIdProvisioningEnabled\", $this->_propDict)) {\n return $this->_propDict[\"concurrentOrgIdProvisioningEnabled\"];\n } else {\n return null;\n }\n }", "public function provision($coProvisioningTargetData, $op, $provisioningData) {\n // First figure out what to do\n $delete = false;\n $person = false;\n $service = false;\n $actionid=uniqid();\n $model=\"CoPerson\";\n\n if(isset($provisioningData[\"CoPerson\"])) {\n $service = false;\n $person = true;\n }\n if(isset($provisioningData[\"CoService\"])) {\n $service = true;\n $person = false;\n $model=\"CoService\";\n }\n // skip provisioning of unrelated models\n if(!$person && !$service) {\n return TRUE;\n }\n\n $action=\"\";\n switch($op) {\n case ProvisioningActionEnum::CoPersonAdded:\n case ProvisioningActionEnum::CoPersonUnexpired:\n case ProvisioningActionEnum::CoPersonPetitionProvisioned:\n case ProvisioningActionEnum::CoPersonPipelineProvisioned:\n case ProvisioningActionEnum::CoPersonReprovisionRequested:\n case ProvisioningActionEnum::CoPersonUpdated:\n if(!$person) {\n CakeLog::write('json_err',array(\"module\"=>\"zone\",\n \"action\"=>\"provision\",\n \"id\" => $actionid,\n \"message\" => \"CoPerson operation without CoPerson data\"));\n return true;\n }\n if($provisioningData['CoPerson']['status'] == StatusEnum::Active) {\n $delete = false;\n $action=\"Adding user \".generateCn($provisioningData['PrimaryName']). '('.$provisioningData['CoPerson']['id'].')';\n } else {\n $delete=true;\n $action=\"Removing user \".generateCn($provisioningData['PrimaryName']). '('.$provisioningData['CoPerson']['id'].')';\n }\n break;\n case ProvisioningActionEnum::CoPersonDeleted:\n case ProvisioningActionEnum::CoPersonExpired:\n case ProvisioningActionEnum::CoPersonEnteredGracePeriod:\n if(!$person) {\n CakeLog::write('json_err',array(\"module\"=>\"zone\",\n \"action\"=>\"provision\",\n \"id\" => $actionid,\n \"message\" => \"CoPerson operation without CoPerson data\"));\n return true;\n }\n $delete = true;\n $action=\"Removing user \".generateCn($provisioningData['PrimaryName']). '('.$provisioningData['CoPerson']['id'].')';\n break;\n case ProvisioningActionEnum::CoServiceAdded:\n case ProvisioningActionEnum::CoServiceUpdated:\n case ProvisioningActionEnum::CoServiceReprovisionRequested:\n if(!$service) {\n CakeLog::write('json_err',array(\"module\"=>\"zone\",\n \"action\"=>\"provision\",\n \"id\" => $actionid,\n \"message\" => \"CoService operation without CoService data\"));\n return true;\n }\n if($provisioningData['CoService']['status'] == StatusEnum::Active) {\n $delete = false;\n $action=\"Adding service \".$provisioningData['CoService']['name'].' ('.$provisioningData['CoService']['id'].')';\n } else {\n $delete=true;\n $action=\"Removing service \".$provisioningData['CoService']['name'].' ('.$provisioningData['CoService']['id'].')';\n }\n break;\n case ProvisioningActionEnum::CoServiceDeleted:\n if(!$service) {\n CakeLog::write('json_err',array(\"module\"=>\"zone\",\n \"action\"=>\"provision\",\n \"id\" => $actionid,\n \"message\" => \"CoService operation without CoService data\"));\n return true;\n }\n $delete = true;\n $action=\"Removing service \".$provisioningData['CoService']['name'].' ('.$provisioningData['CoService']['id'].')';\n break;\n case ProvisioningActionEnum::CoGroupAdded:\n case ProvisioningActionEnum::CoGroupDeleted:\n case ProvisioningActionEnum::CoGroupUpdated:\n case ProvisioningActionEnum::CoGroupReprovisionRequested:\n case ProvisioningActionEnum::AuthenticatorUpdated:\n case ProvisioningActionEnum::CoEmailListAdded:\n case ProvisioningActionEnum::CoEmailListDeleted:\n case ProvisioningActionEnum::CoEmailListReprovisionRequested:\n case ProvisioningActionEnum::CoEmailListUpdated:\n default:\n CakeLog::write('json_err',array(\"module\"=>\"zone\",\n \"action\"=>\"provision\",\n \"id\" => $actionid,\n \"message\" => \"Unimplemented operation for CoPerson or CoService model\"));\n throw new RuntimeException(\"Not Implemented\");\n break;\n }\n\n $config = Configure::load('scz','default');\n\n CakeLog::write('json_not',array(\"module\"=>\"zone\",\n \"action\"=>\"provision\",\n \"id\" => $actionid,\n \"operation\" => $op,\n \"message\" => $action,\n \"co_id\"=>$provisioningData[$model][\"co_id\"]));\n\n if($person) {\n $this->ZonePerson = ClassRegistry::init('ZoneProvisioner.ZonePerson');\n $this->ZonePerson->provision($provisioningData, $delete, $actionid);\n }\n else if($service) {\n $this->ZoneService = ClassRegistry::init('ZoneProvisioner.ZoneService');\n $this->ZoneService->provision($provisioningData, $delete, $actionid);\n }\n\n return true;\n }", "public function getStatus() {\n\t\t\t$sql = \"SELECT status FROM persons WHERE idPerson = $this->idPerson\";\n\t\t\treturn ($data = $this->getArray($sql)) ? $data['status'] : '';\n\t\t}", "function getStatus() {\n return $this->getAdditionalProperty('payment_status_selected');\n }", "public function getStatusId()\n {\n return $this->getValue('nb_icontact_prospect_status_id');\n }", "function assign($coId, $coPersonId, $actorCoPersonId, $provision=true) {\n $ret = array();\n \n // First, see if there are any identifiers to autoassign for this CO. This will return the\n // same thing if the answer is \"no\" or if the answer is \"invalid CO ID\".\n \n $args = array();\n $args['conditions']['Co.id'] = $coId;\n \n $identifierAssignments = $this->CoPerson->Co->CoIdentifierAssignment->find('all', $args);\n \n if(!empty($identifierAssignments)) {\n // Loop through each identifier and request assignment.\n $cnt = 0;\n \n foreach($identifierAssignments as $ia) {\n // Assign will throw an error if an identifier of this type already exists.\n \n try {\n $this->CoPerson->Co->CoIdentifierAssignment->assign($ia, $coPersonId, $actorCoPersonId);\n $ret[ $ia['CoIdentifierAssignment']['identifier_type'] ] = 1;\n $cnt++;\n }\n catch(OverflowException $e) {\n // An identifier already exists of this type for this CO Person\n $ret[ $ia['CoIdentifierAssignment']['identifier_type'] ] = 2;\n }\n catch(Exception $e) {\n $ret[ $ia['CoIdentifierAssignment']['identifier_type'] ] = $e->getMessage();\n }\n }\n \n if($cnt > 0 && $provision) {\n // At least one identifier was assigned, so fire provisioning\n \n $this->CoPerson->Behaviors->load('Provisioner');\n $this->CoPerson->manualProvision(null, $coPersonId, null, ProvisioningActionEnum::CoPersonUpdated);\n }\n }\n \n return $ret;\n }", "public function getStatusPayment()\r\n {\r\n return $this->statusPayment;\r\n }", "public function getObjectiveStatusCode();", "public function getEnableNodeAutoprovisioning()\n {\n return $this->enable_node_autoprovisioning;\n }", "function get_payment_status()\n {\n return $this->platnosci_post_vars['payment_status'];\n }", "public function getStatus()\n {\n if (array_key_exists(\"status\", $this->_propDict)) {\n return $this->_propDict[\"status\"];\n } else {\n return null;\n }\n }", "public function getStatus()\n {\n if (array_key_exists(\"status\", $this->_propDict)) {\n return $this->_propDict[\"status\"];\n } else {\n return null;\n }\n }", "public function getPersonId()\n {\n return $this->personId;\n }", "public function getStatus()\n {\n $userid = $this->user_id;\n $user = User::findIdentity($userid);\n if($user):\n $status = User::STATUS_ACTIVE;\n else:\n $status = User::STATUS_DELETED;\n endif;\n return $status;\n }", "function wv_get_commission_status($oid,$pid){\n \n $status = get_post_meta($oid,'woo_commision_status_'.$pid,TRUE);\n \n $status = ($status ==\"\")? 0 :$status;\n return $status;\n \n }", "function _approveNewVendor(){\n \n $this->ci->load->library('form_validation');\n $person_id = $this->ci->session->userdata('user_id');\n \n $this->resetResponse();\n\n $this->ci->form_validation->set_rules('personId', 'Vendor Person Id', 'trim|required|xss_clean|encode_php_tags|integer', array('required' => 'You must provide a %s.'));\n\n if ($this->ci->form_validation->run() == FALSE) { \n $this->_status = false;\n $this->_message = $this->ci->lang->line('person_id_missing');\n return $this->getResponse();\n } else {\n\n $personId = $this->ci->input->post('personId', true);\n $result = $this->model->get_tb('mm_person', 'person_id', array('person_id' => $personId))->result();\n if (count($result) > 0) {\n $this->model->update_tb('mm_person', array('person_id' => $personId), array('person_status'=>1));\n \n if( $this->model->getAffectedRowCount() > 0 ) {\n $this->_status = true;\n $this->_message = $this->ci->lang->line('vendor_approved'); \n }\n } else {\n $this->_status = FALSE;\n $this->_message = $this->ci->lang->line('invalid_data'); \n \n }\n\n return $this->getResponse();\n }\n \n }", "public function getStatus()\n {\n if (array_key_exists(\"status\", $this->_propDict)) {\n if (is_a($this->_propDict[\"status\"], \"\\Beta\\Microsoft\\Graph\\Model\\MultiTenantOrganizationMemberProcessingStatus\") || is_null($this->_propDict[\"status\"])) {\n return $this->_propDict[\"status\"];\n } else {\n $this->_propDict[\"status\"] = new MultiTenantOrganizationMemberProcessingStatus($this->_propDict[\"status\"]);\n return $this->_propDict[\"status\"];\n }\n }\n return null;\n }", "function get_status()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_STATUS);\r\n }", "public function getTargetPvc()\n {\n return $this->target_pvc;\n }", "public function status()\n {\n return $this->UserAPI->request_status_check();\n }", "function i4_get_unit_status() {\n global $current_i4_user, $post;\n\n //Store the Parent Data for the Unit for use.\n $unit_parent_data = WPCW_units_getAssociatedParentData($post->ID);\n\n $user_id = $current_i4_user->ID;\n\n //Check if the Unit is complete\n $unit_status = $this->i4_is_unit_complete($unit_parent_data->course_id, $user_id, $post->ID);\n\n return $unit_status;\n }", "public function assigned($coPersonID, $identifierType) {\n $args = array();\n $args['conditions']['Identifier.co_person_id'] = $coPersonID;\n $args['conditions']['Identifier.type'] = $identifierType;\n $args['conditions']['Identifier.status'] = StatusEnum::Active;\n \n $r = $this->findForUpdate($args['conditions'], array('identifier'));\n \n return !empty($r);\n }", "public static function runPayrollStatus(){\n if(TaxPerson::first()){\n return true;\n }\n else{\n return false;\n }\n }", "public function get_status() {\n\t\tif ( array_key_exists( self::STATUS, $this->ryte_option ) ) {\n\t\t\treturn $this->ryte_option[ self::STATUS ];\n\t\t}\n\n\t\treturn self::CANNOT_FETCH;\n\t}", "public function isPaid(){\n return $this->status == \"SUCCESS\";\n }", "public function getStatus()\n {\n if($this->_getField(self::$STORAGE_ID))\n {\n if($this->_getField(self::$PAYMENT_INFORMATION))\n {\n return self::STATE_NOT_EMPTY;\n }\n else\n {\n return self::STATE_EXISTING;\n }\n }\n else if($this->_getField(self::$ERRORS))\n {\n return self::STATE_FAILURE;\n }\n else\n {\n return self::STATE_NOT_EXISTING;\n }\n }", "public function getCountEntitledForProvisioning()\n {\n if (array_key_exists(\"countEntitledForProvisioning\", $this->_propDict)) {\n return $this->_propDict[\"countEntitledForProvisioning\"];\n } else {\n return null;\n }\n }", "public function getSeniorContributors()\n {\n $query=\"select identifier FROM \".$this->_name.\" WHERE profile_type ='senior' AND status = 'Active'\";\n if(($result = $this->getQuery($query,true)) != NULL)\n return $result;\n else\n return \"NO\";\n }", "function maneja_perfiles_produccion()\n\t{\n\t\treturn $this->get_instalacion()->es_produccion() && $this->instancia->get_proyecto_usar_perfiles_propios($this->identificador);\n\t}", "public function get_license_status() {\n\t\t$dirname = dirname( $this->plugin_basename );\n\t\t$status = get_option( $dirname . '_license_status', 'pending' );\n\t\t$status = empty( $status ) ? 'pending' : $status;\n\t\treturn $status;\n\t}", "public function getIdStatus()\n {\n return $this->id_status;\n }", "public function get_license_status() {\n\n\t\t$status = get_option( $this->product_slug . '-license-status' );\n\n\t\tif ( ! $status ) {\n\t\t\t// User hasn't saved the license to settings yet. No use making the call.\n\t\t\treturn false;\n\t\t}\n\n\t\treturn trim( $status );\n\t}", "public function getIdPerson()\n {\n return $this->idPerson;\n }", "public function getPaymentStatus()\n {\n return $this->paymentStatus instanceof PaymentStatusBuilder ? $this->paymentStatus->build() : $this->paymentStatus;\n }", "public function getIdPromocion()\n {\n return $this->id_promocion;\n }", "function get_payment_status()\n {\n return $this->paypal_post_vars['payment_status'];\n }", "public function isAlive()\n {\n return $this->personState['alive'];\n }", "public function getStatus()\n {\n return $this->getProperty(self::STATUS);\n }", "public function hasStatusProspect()\n {\n if ($this->hasRole('ROLE_CLIENT')) {\n return $this->profile->hasStatusProspect();\n }\n\n return false;\n }", "public function isPro($user_id = NULL) {\n\t\tif (is_null($user_id)) {\n\t\t\t$user_id = $this->getUserId();\n\t\t}\n $user_info = $this->people_getInfo($user_id);\n\t\tif ($user_info['ispro'] == 1) {\n return TRUE;\n } else {\n return FALSE;\n }\n }", "public function getCertStatus()\r\n\t{\r\n\t\treturn $this->singleResponse->getCertStatus();\r\n\t}", "function getCostPersonalTagIndividual(){\n\treturn campo('config_system','id','1','cost_individual_personal_tag');\n}", "function getCostPersonalTagIndividual(){\n\treturn campo('config_system','id','1','cost_individual_personal_tag');\n}", "public function getIdPersonal()\n {\n return $this->idPersonal;\n }", "public function status()\n {\n return $this->hasOne('ProfileStatusType', 'id', 'status_type_id');\n }", "function hasProfilePicture()\n\t{\n\t\treturn $this->ppic;\n\t}", "public function getUser_status_id()\n {\n return $this->user_status_id;\n }", "private function paladinProfileStatus($paladin)\n {\n\n $user = $this->get('security.context')->getToken()->getUser();\n $em = $this->getDoctrine()->getManager();\n\n $paladin_profile = '';\n $paladin_profiles = $em->getRepository('PraiseItBundle:Prayer')->findById($user);\n\n foreach ($paladin_profiles as $pp) {\n $paladin_profile = $pp;\n }\n\n if( !$paladin_profile ) {\n return 0; // student has not filled out profile\n }\n\n if( $paladin->getId() == 'Year 2' && $paladin->getName() == 'CMHS (day program)' ) {\n if( $paladin_profile->getY2CmhsCommitmentStatement() != 1 ) {\n return 2; // Y2 CMHS Student has not committed\n }\n }\n\n return 1; // student profile looks good\n }", "public function setConcurrentOrgIdProvisioningEnabled($val)\n {\n $this->_propDict[\"concurrentOrgIdProvisioningEnabled\"] = $val;\n return $this;\n }", "function getStatusID() {\n\t\treturn $this->data_array['status_id'];\n\t}", "public function getIdPersonnage()\n {\n return $this->idPersonnage;\n }", "public function getPersonID() {\n\t\t$session_id = $this->getCurrentID();\n\t\t$this->load($session_id);\n\t\treturn $this->contactid;\n }", "public function getStatus()\n {\n $rtn = $this->data['status'];\n\n return $rtn;\n }", "public function GetStatus()\n\t{\treturn new ProductStatus($this->details['tstatus']);\t\n\t}", "public function getProfession() {\n $profession = UserDataExtra::findOne(['user_id' => $this->id]);\n return ($profession) ? $profession->profession : '';\n }", "public function getId_Profesor()\n {\n return $this->id_profesor;\n }", "function get_pr_for_appliance($appliance_id) {\n\t\t$db=htvcenter_get_db_connection();\n\t\t$cloudprofile_array = $db->Execute(\"select pr_id from \".$this->_db_table.\" where pr_appliance_id=$appliance_id\");\n\t\tforeach ($cloudprofile_array as $index => $cloudprofile) {\n\t\t\treturn $cloudprofile[\"pr_id\"];\n\t\t}\n\t}", "function lookupStatus($judge_id){\n\t$data = M('user');\n\tif((int)$judge_id>=1){\n\t\t$condition['id'] = (int)$judge_id;\n\t\t$judge = $data->where($condition)->find();\n\t\treturn $judge['reserved_1'];\n\t}\n\telse return false;\n}", "public function getProfileId() {\n\t\treturn ($this->profileId);\n\t}", "public function getProfileId() {\n\t\treturn ($this->profileId);\n\t}", "function _lookupStatus($a_obj_id, $a_user_id)\r\n\t{\r\n\t\tglobal $ilDB;\r\n\r\n\t\t$set = $ilDB->queryF(\"SELECT status FROM il_wiki_contributor \".\r\n\t\t\t\"WHERE wiki_id = %s and user_id = %s\",\r\n\t\t\tarray(\"integer\", \"integer\"),\r\n\t\t\tarray($a_obj_id, $a_user_id));\r\n\t\tif($row = $ilDB->fetchAssoc($set))\r\n\t\t{\r\n\t\t\treturn $row[\"status\"];\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function people_getUploadStatus () {\n $response = $this->execute(array('method' => 'flickr.people.getUploadStatus'));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['user'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function get_compartment(){\n $this->compartment = array_shift(Compartment::find_all(\" WHERE dead_no = '{$this->id}' LIMIT 1\"));\n if ($this->compartment) {\n return $this->compartment->description;\n } else {\n return \"Not specified\";\n }\n }", "public function get_status() {\n return $this->status;\n }", "public function getProfileId() \n {\n if (!$this->hasProfileId()) \n {\n $this->profileId = '';\n }\n\n return $this->profileId;\n }", "private function Potion() {\n $rand = rand (30, 60);\n $this->Potion = True;\n $this->pv += $rand;\n $status = \"{$this->name} utilise une potion <img src='../public/pictures/Abilities5/potion.png' width=30px /> et se soigne de {$rand} PV!\";\n return $status;\n }", "public function getDeviceStatus()\n {\n return $this->deviceStatus;\n }", "function get_status() {\n return $this->status;\n }", "public function getProfileId() {\n\t\treturn($this->profileId);\n\t}", "public function getResourceStatus()\n {\n return $this->resource_status;\n }", "public function getEquipmentStatusId()\n\t{\n\t return $this->equipmentStatusId;\n\t}", "public function getStatus() {\n return $this->status;\n }", "protected function getStatusDetail()\n {\n $proc_return_code = $this->getProcReturnCode();\n\n return $proc_return_code ? (isset($this->codes[$proc_return_code]) ? (string) $this->codes[$proc_return_code] : null) : null;\n }", "function getPersonID()\n {\n return $this->getValueByFieldName('person_id');\n }", "public function status($id)\n {\n if (Auth::user()->type == 'chefservice') {\n $status = DB::table('envois')\n ->join('courriers', 'courriers.id', '=', 'envois.courrier_id')\n ->select('envois.status')\n ->where([['courriers.id', '=', $id], ['envois.service_id', '=', Auth::user()->service_id]])\n ->get();\n return $status;\n }\n }", "public function getStatus() : int\n {\n $rtn = $this->data['status'];\n\n return $rtn;\n }", "public function getStatusId()\n\t{\n\n\t\treturn $this->status_id;\n\t}", "public function getBillingProfileId();", "public function lookupCertifiedProfessional($a_ass_id)\n\t{\n\t\treturn self::lookupProperty($a_ass_id, \"cp_professional_id\");\n\t}", "public function getStatus()\n {\n return $this->status ?: 0;\n }", "public function getTargetStatus($tid)\r\n {\r\n return $this->stats[$tid];\r\n }", "public function has_persons() {\n if ( empty( $this->has_persons ) ) {\n // old booking\n $product = $this->get_product();\n if ( $product ) {\n return $product->has_people();\n } else {\n return true;\n }\n }\n\n return 'yes' === $this->has_persons;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }" ]
[ "0.6223467", "0.601814", "0.57858014", "0.54745", "0.54232496", "0.5307109", "0.5068306", "0.50253934", "0.48730424", "0.4773304", "0.46820474", "0.46228877", "0.46195683", "0.46147615", "0.46147615", "0.46017233", "0.4593774", "0.458619", "0.45724297", "0.45724073", "0.45702404", "0.45603034", "0.4554988", "0.4554777", "0.45435447", "0.45307577", "0.45138547", "0.4493888", "0.4482911", "0.44795388", "0.44750544", "0.44740948", "0.4471176", "0.44586593", "0.44537723", "0.44494295", "0.44443062", "0.44222692", "0.4391365", "0.43761417", "0.4365489", "0.4361677", "0.43555215", "0.43496808", "0.4336292", "0.4336292", "0.43335593", "0.4331998", "0.4330856", "0.4307376", "0.42964944", "0.42958945", "0.42953056", "0.42914626", "0.4286638", "0.42856908", "0.42838755", "0.42820877", "0.42808947", "0.42775175", "0.42721376", "0.42676544", "0.42676544", "0.42672697", "0.42608425", "0.42582244", "0.42466694", "0.42435232", "0.4237541", "0.4234817", "0.42253926", "0.4209013", "0.4199151", "0.41929182", "0.41910025", "0.41904253", "0.41902792", "0.41894054", "0.4185084", "0.41768885", "0.41760793", "0.4175594", "0.41752338", "0.4172021", "0.41717678", "0.41684556", "0.41684556", "0.41684556", "0.41684556", "0.41684556", "0.41684556", "0.41684556", "0.41684556", "0.41684556", "0.41684556", "0.41684556", "0.41684556", "0.41684556", "0.41684556", "0.41684556" ]
0.578735
2
Display a listing of the resource.
public function index() { // return Film::all(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('film_create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // $film = $request->all(); $imageData = $film['photo']; $fileName = Carbon::now()->timestamp . '_' . uniqid() . '.' . explode('/', explode(':', substr($imageData, 0, strpos($imageData, ';')))[1])[1]; $img = Image::make($film['photo'])->save(public_path('images/').$fileName); $film['photo'] = $fileName; $film['release_date'] = date('Y-m-d', strtotime($film['release_date'])); $film['slug'] = str_slug($film['name'], '-'); return Film::create($film); }
{ "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 getFilmBySlug($slug) { return Film::where('slug', '=' ,$slug)->firstOrFail(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $film = Film::findOrFail($id); $film->update($request->all()); return $film; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // $film = Film::findOrFail($id); $film->delete(); return 204; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
public $productAttributes = ['pname', 'price', 'credit', 'description', 'stime', 'etime', 'status', 'instore', 'richtext', 'cover']; public $districtAttributes = ['name', 'description']; public $posterAttributes = ['name', 'phone', 'description'];
public function actions() { return array( // captcha action renders the CAPTCHA image displayed on the contact page 'captcha'=>array( 'class'=>'CCaptchaAction', 'backColor'=>0xFFFFFF, 'maxLength'=>'4', // 最多生成几个字符 'minLength'=>'4', // 最少生成几个字符 'height'=>'40' ), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function attributes();", "public function getProductAttributes()\n\t{\n\t\treturn $this->arrAttributes;\n\t}", "function get_products_with_attributes() {\n global $db;\n if(isset($_SESSION['languages_id'])){ $language_id = (int)$_SESSION['languages_id'];} else { $language_id=1;}\n $query = 'SELECT DISTINCT attrib.products_id, description.products_name, products.products_quantity, products.products_model, products.products_image\n FROM '.TABLE_PRODUCTS_ATTRIBUTES.' attrib, '.TABLE_PRODUCTS_DESCRIPTION.' description, '.TABLE_PRODUCTS.' products\n WHERE attrib.products_id = description.products_id AND\n attrib.products_id = products.products_id AND \n description.language_id='.$language_id.' \n ORDER BY description.products_name ';\n $products = $db->Execute($query);\n while(!$products->EOF){\n $products_array[] = $products->fields['products_id'];\n $products->MoveNext();\n }\n return $products_array;\n }", "public function getAttributes(){ }", "function _loadProductAttributesInfo()\n {\n global $zone;\n\n if ($this->_fBaseProductInfo == null)\n {\n $this->_loadBaseProductInfo();\n }\n $display_product_price_including_taxes = modApiFunc('Settings', 'getParamValue', 'TAXES_PARAMS', \"DISPLAY_PRICES_W_INCLUDED_TAXES\");\n\n $a = (int)$this->_fProductID;\n $b = (int)$this->_fBaseProductInfo[0]['p_type_id'];\n $c = $display_product_price_including_taxes == DB_TRUE ? 1 : 0;\n if (isset(self::$_cache_attr[$a][$b][$c])) {\n $this->_fProductAttributesInfo = self::$_cache_attr[$a][$b][$c];\n return;\n }\n\n $params = array('product_id' => (int)$this->_fProductID,\n 'product_type_id' => (int)$this->_fBaseProductInfo[0]['p_type_id']);\n $this->_fProductAttributesInfo = execQuery('SELECT_PRODUCT_ATTRIBUTES_INFO', $params);\n // SalePrice,\n // TaxClass.\n $tax_class_id = NULL;\n foreach ($this->_fProductAttributesInfo as $index => $attribute)\n {\n if ( strtolower($attribute['a_view_tag']) == 'taxclass' )\n {\n $tax_class_id = $attribute['pa_value'];\n break;\n }\n }\n\n $price_including_included_taxes_if_any = NULL;\n foreach ($this->_fProductAttributesInfo as $index => $attribute)\n {\n if ( strtolower($attribute['a_view_tag']) == 'saleprice' )\n {\n if($zone == 'CustomerZone')\n {\n $membership = modApiFunc('Customer_Account','getCurrentSignedCustomerGroupID');\n $attribute['pa_value'] = modApiFunc('Quantity_Discounts','getFixedPrice',$this->_fProductID,1,$attribute['pa_value'],$membership);\n }\n\n $price_including_included_taxes_if_any = $attribute['pa_value'];\n $this->_fProductAttributesInfo['salepriceexcludingtaxes'] = $this->_fProductAttributesInfo[$index];\n $this->_fProductAttributesInfo['salepriceexcludingtaxes']['pa_id'] = NULL;\n $this->_fProductAttributesInfo['salepriceexcludingtaxes']['a_view_tag'] = NULL;\n\n // TaxClass - , .\n if($tax_class_id !== NULL)\n {\n // .\n $price_excluding_taxes = modApiFunc(\"Catalog\", \"computePriceExcludingTaxes\", $attribute['pa_value'], $tax_class_id);\n $this->_fProductAttributesInfo[$index]['pa_value'] = $price_excluding_taxes;\n\n // _ _ 'salepriceexcludingtaxes':\n $this->_fProductAttributesInfo['salepriceexcludingtaxes']['pa_value'] = $price_excluding_taxes;\n }\n\n $this->_fProductAttributesInfo['salepriceincludingtaxes'] = $this->_fProductAttributesInfo[$index];\n $this->_fProductAttributesInfo['salepriceincludingtaxes']['pa_id'] = NULL;\n $this->_fProductAttributesInfo['salepriceincludingtaxes']['a_view_tag'] = NULL;\n\n if($tax_class_id !== NULL)\n {\n // .\n // _c_ 'salepriceexcludingtaxes':\n $price_including_taxes = $price_including_included_taxes_if_any;\n // ,\n // , \" \"\n //modApiFunc(\"Catalog\", \"computePriceIncludingTaxes\", $attribute['pa_value'], $tax_class_id);\n\n $this->_fProductAttributesInfo['salepriceincludingtaxes']['pa_value'] = $price_including_taxes;\n\n if($display_product_price_including_taxes == DB_TRUE)\n {\n $this->_fProductAttributesInfo[$index]['pa_value'] = $price_including_taxes;\n }\n }\n\n break;\n }\n }\n self::$_cache_attr[$a][$b][$c] = $this->_fProductAttributesInfo;\n }", "public function getProductAndVariantAttributes()\n\t{\n\t\treturn array_unique(array_merge($this->arrAttributes, $this->arrVariantAttributes));\n\t}", "function getAdditionalAttributes() ;", "public function attributes() : array;", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function attributes()\n\t{\n\t\t/*Author -ptr.nov- add related fields to searchable attributes */\n\t\treturn array_merge(parent::attributes(), ['nmkategori','tipebrg','corp.CORP_NM']);\n\t}", "public function attributes()\n {\n return [\n 'title' => 'Title',\n 'image'=>'Product Image',\n 'price' => 'Price',\n 'description' => 'Description'\n ];\n }", "public function attributes()\n {\n return [\n //'uid' => '用户id',\n 'payChannel' => '支付类型',\n 'money' => '商品金额',\n 'number' => '商品数量',\n 'goodsTitle' => '商品标题',\n 'goodsDesc' => '商品内容',\n 'deviceInfo' => '设备信息',\n 'description' => '来源类型',\n ];\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 }", "private function requestedAttributes()\n {\n\n $default = [\n 'id',\n 'name',\n 'level',\n 'rarity',\n 'image',\n 'category.0',\n 'category.1',\n 'vendor_price',\n 'buy.quantity',\n 'buy.price',\n 'buy.last_change.time',\n 'buy.last_change.quantity',\n 'buy.last_change.price',\n 'sell.quantity',\n 'sell.price',\n 'sell.last_change.time',\n 'sell.last_change.quantity',\n 'sell.last_change.price',\n 'last_update'\n ];\n\n $requested = $this->getInput('attributes') ?: $default;\n\n if (!is_array($requested)) {\n $requested = explode(',', $requested);\n }\n\n return $requested;\n\n }", "protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'nombre',\n 'estado',\n 'pais_idpais'\n ],\n 'date' => []\n ];\n }", "function metastudent()\r\n{\r\n return array(\r\n array(\r\n //Attributes\r\n 'ID','Name','Age','Degree'\r\n ),\r\n array(\r\n //datatypes\r\n 'ID'=>'INT',\r\n 'Name'=>'VARCHAR',\r\n 'Age'=>'INT',\r\n 'Degree'=>'VARCHAR'\r\n ),\r\n array(\r\n //numeric\r\n 'ID',\r\n 'Age'\r\n )\r\n );\r\n}", "public function attributes()\n {\n return [\n 'name' => '商品名',\n 'price' => '価格',\n 'description' => '説明文',\n 'tag_for_search' => '検索用タグ',\n 'img' => '画像',\n 'stock' => '在庫数'\n ];\n }", "public static function getSummaryAttributes()\n {\n return array(\n 'id' => array(\n 'name' => 'id',\n 'display' => 'ID',\n 'type' => 'numeric',\n 'link' => 'endpoint',\n ),\n 'external_id' => array(\n 'name' => 'external_id',\n 'display' => 'External ID',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'name' => array(\n 'name' => 'name',\n 'display' => 'Name',\n 'type' => 'alpha',\n ),\n 'arena' => array(\n 'name' => 'arena',\n 'display' => 'Arena',\n 'type' => 'alpha',\n 'hide' => 'phone,tablet',\n ),\n 'arena_id' => array(\n 'name' => 'arena_id',\n 'display' => 'Arena ID',\n 'type' => 'numeric',\n 'hide' => 'all',\n 'link' => 'endpoint2',\n ),\n 'length' => array(\n 'name' => 'length',\n 'display' => 'Length',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'width' => array(\n 'name' => 'width',\n 'display' => 'Width',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'radius' => array(\n 'name' => 'radius',\n 'display' => 'Radius',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'seating' => array(\n 'name' => 'seating',\n 'display' => 'Seating Capacity',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'tags' => array(\n 'name' => 'tags',\n 'display' => 'Tags',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'description' => array(\n 'name' => 'description',\n 'display' => 'Description',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'notes' => array(\n 'name' => 'notes',\n 'display' => 'Notes',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'type' => array(\n 'name' => 'type',\n 'display' => 'Type',\n 'type' => 'alpha',\n ),\n 'status' => array(\n 'name' => 'status',\n 'display' => 'Status',\n 'type' => 'alpha',\n ),\n );\n }", "function get_eco_attributes($product_id)\n\t{\n\t\t\t$product = $this->product_model->reset()->load($product_id);\n\t\t\t$attribute_name = 'ecoattribute';\n\t\n\t\t\t$eco_attributes = $product->getAttributeText($attribute_name);\n\t\t\tif(count($eco_attributes) == 1) $eco_attributes = array($eco_attributes); //put in array if there's ONE eco attribute filled\n\t\t\treturn $eco_attributes;\n\t}", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes()\n\t{\n\t\t$arrData = array();\n\n\t\tforeach ($this->getProductAndVariantAttributes() as $attribute)\n\t\t{\n\t\t\t$arrData[$attribute] = $this->$attribute;\n\t\t}\n\n\t\treturn $arrData;\n\t}", "public static function productOptionsAttributes($model){\n $attributes= [\n 'location',\n 'stars',\n 'in_hotel',\n 'in_room',\n 'additional_services',\n 'food',\n 'beach',\n 'note',\n 'web',\n ];\n $attributesToDisplay =[];\n foreach ($attributes as $value){\n if ( ($model->attributes[$value] != '0') && (!empty($model->attributes[$value])) ) {\n //var_dump($value.' = '.$model->attributes[$value]);\n $attributesToDisplay[] = $value.':html';\n }\n }\n return $attributesToDisplay;\n }", "public function attributes(){\n return [\n 'name' => 'Tên sản phẩm',\n 'price' => 'Giá',\n 'sale'=> 'Giảm giá',\n 'screen' => 'Màn hình',\n 'operating_system' => 'Hệ điều hành',\n 'camera'=>'Camera',\n 'cpu'=>'Cpu',\n 'ram' => 'Ram',\n 'memory' => 'Bộ nhớ trong',\n 'memory_card' => 'Thẻ nhớ',\n 'pin' => 'Pin',\n 'category_id' => 'Hãng',\n ];\n }", "public function get_attributes()\n {\n }", "public function get_attributes()\n {\n }", "function list_attributes() {\n\t\t$attributes = $this->get_attributes();\n\t\tif ($attributes && sizeof($attributes)>0) :\n\t\t\t\n\t\t\techo '<table cellspacing=\"0\" class=\"shop_attributes\">';\n\t\t\t$alt = 1;\n\t\t\tforeach ($attributes as $attribute) :\n\t\t\t\tif ($attribute['visible'] == 'no') continue;\n\t\t\t\t$alt = $alt*-1;\n\t\t\t\techo '<tr class=\"';\n\t\t\t\tif ($alt==1) echo 'alt';\n\t\t\t\techo '\"><th>'.wptexturize($attribute['name']).'</th><td>';\n\t\t\t\t\n\t\t\t\tif (is_array($attribute['value'])) $attribute['value'] = implode(', ', $attribute['value']);\n\t\t\t\t\n\t\t\t\techo wpautop(wptexturize($attribute['value']));\n\t\t\t\t\n\t\t\t\techo '</td></tr>';\n\t\t\tendforeach;\n\t\t\techo '</table>';\n\n\t\tendif;\n\t}", "public function getAttributes() {}", "public function getAttributes() {}", "public static function get_attribution_product_fields($product)\n {\n $list = array();\n if ($product['type'] == \"variable\" and count($product['variations']) > 0) {\n foreach ($product['attributes'] as $attribute) {\n\n // If Attribute Not User For Variation\n if ($attribute['variation'] === false) {\n continue;\n }\n\n // Get Basic Detail\n $list[wc_attribute_taxonomy_name($attribute['slug'])] = array(\n 'name' => $attribute['name'],\n 'options' => array()\n );\n $options = array();\n foreach ($attribute['terms'] as $term_key => $term) {\n\n // Check Term in Variables Product\n $exist = false;\n foreach ($product['variations'] as $variations_product) {\n $in_stock = $variations_product['in_stock'];\n $stock_quantity = $variations_product['stock_quantity'];\n if ($in_stock === true) {\n foreach ($variations_product['attributes'] as $variations_product_attribute) {\n if ($term['slug'] == $variations_product_attribute['option']) {\n $exist = true;\n break;\n }\n }\n }\n }\n if ($exist === true) {\n $options[$term['slug']] = $term['name'];\n }\n }\n $list[wc_attribute_taxonomy_name($attribute['slug'])]['options'] = $options;\n }\n }\n\n /**\n * [pa_color] => Array\n * (\n * [name] => رنگ\n * [options] => Array\n * (\n * [blue] => آبی\n * [red] => قرمز\n * )\n * )\n * [pa_size] => Array\n * (\n * [name] => سایز\n * [options] => Array\n * (\n * [l] => L\n */\n return $list;\n }", "public function getProductAttributesDetails($params){\n\t\ttry {\t\n\t\t\t\n\t\t\t//$query = \"select * from store_products where product_id=\".$params['id'];\n\t\t\t\n\t\t\t$query = \"SELECT\n\t\t\t\t\t\tspav.product_id, spast.attributes_group_id, spast.attributes_set_id, spast.attributes_set_title,\n\t\t\t\t\t\tspa.attribute_id, spa.attribute_title, spav.attribute_value\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\tstore_products_attributes spa,\n\t\t\t\t\t\tstore_products_attributes_values spav,\n\t\t\t\t\t\tstore_products_attributes_sets spast,\n\t\t\t\t\t\tstore_products_attributes_sets_mapping spasm\n\t\t\t\t\t\twhere\n\t\t\t\t\t\tspa.attribute_id = spav.attribute_id\n\t\t\t\t\t\tAND spast.attributes_set_id = spasm.attributes_set_id\n\t\t\t\t\t\tAND spa.attribute_id = spasm.attribute_id\n\t\t\t\t\t\tAND spa.statusid=1\n\t\t\t\t\t\tAND spav.statusid=1\n\t\t\t\t\t\tAND spast.statusid=1\n\t\t\t\t\t\tAND spasm.statusid=1\n\t\t\t\t\t\tAND spav.product_id = \".$params['id'];\n\t\t\t\n\t\t\t//exit;\t\t\t\n\t\t\t$stmt = $this->db->query($query);\t\t\t\n\t\t\treturn $stmt->fetchAll();\n\t\t\t\n\t\t} catch(Exception $e) {\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}", "abstract function attributes(): array;", "public function attributes(){\r\n /*\r\n $attributes = array();\r\n foreach(self::$db_fields as $field){\r\n if(property_exists($this, $field)){\r\n\t $attributes[$field] = $this->$field;\r\n\t }\r\n }\r\n return $attributes;\r\n */\r\n \r\n //return get_object_vars($this);\r\n return $this->variables;\r\n }", "function GetAttributes();", "private function prepareProductDetailsArray($product)\n {\n $productDetailsArray = [];\n\n // $productDetailsArray['id'] = $product->id;\n // $productDetailsArray['code'] = $product->product_code;\n // $productDetailsArray['name'] = $product->product_name;\n // $productDetailsArray['manufacturer'] = $this->getManufacturer($product);\n // $productDetailsArray['salt'] = $this->getSalt($product);\n // $productDetailsArray['unit'] = $this->getUnit($product);\n // $productDetailsArray['packing'] = $this->getPacking($product);\n // $productDetailsArray['product_type'] = $this->getType($product);\n // $productDetailsArray['mrp'] = $product->product_mrp;\n // $productDetailsArray['less_mrp'] = $product->product_rate_a;\n \n $productDetailsArray['id'] = $product->id;\n $productDetailsArray['product_name'] = $product->product_name;\n $productDetailsArray['salts'] = $this->salt->getSalts($product);\n $productDetailsArray['categories'] = $this->category->getCategories($product);\n $productDetailsArray['packing'] = $this->packing->getPacking($product);\n $productDetailsArray['unit'] = $this->unit->getUnit($product);\n $productDetailsArray['company'] = $this->company->getCompany($product);\n // $productDetailsArray['manufacturer'] = $this->manufacturer->getManufacturer($product);\n $productDetailsArray['ailments'] = $this->ailment->getAilments($product);\n $productDetailsArray['classes'] = $this->classes->getClasses($product);\n // $productDetailsArray['product_type'] = $this->productType->getProductType($product);\n $productDetailsArray['product_code'] = $product->product_code;\n $productDetailsArray['product_mrp'] = $product->product_mrp;\n $productDetailsArray['is_prescription_drug'] = $product->is_prescription_drug;\n $productDetailsArray['product_tax'] = $product->product_tax;\n\n return $productDetailsArray;\n }", "public function getAttributes()\n {\n }", "public function getCustomAttributes(): array;", "public function attributes()\n {\n return [\n 'venue_id' => 'venue',\n 'image' => 'picture'\n ];\n }", "public function __construct( $orders_products_attributes_id = null ) {\n\t\tif (!is_null($orders_products_attributes_id)) {\n\t\t\t$sql = 'select * from cart_orders_products_attributes where orders_products_attributes_id=' . $orders_products_attributes_id;\n\t\t\tif (!$result = Database::singleton()->query_fetch($sql)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$this->setId($result['orders_products_attributes_id']);\n\t\t\t$this->setOrderid($result['orders_id']);\n\t\t\t$this->setProductid($result['orders_products_id']);\n\t\t\t$this->setProducts_options($result['products_options']);\n\t\t\t$this->setProducts_options_values($result['products_options_values']);\n\t\t\t$this->setOptions_values_price($result['options_values_price']);\n\t\t\t$this->setPrice_prefix($result['price_prefix']);\n\t\t\t$this->setProduct_attribute_is_free($result['product_attribute_is_free']);\n\t\t\t$this->setProducts_attributes_weight($result['products_attributes_weight']);\n\t\t\t$this->setProducts_attributes_weight_prefix($result['products_attributes_weight_prefix']);\n\t\t\t$this->setAttributes_discounted($result['attributes_discounted']);\n\t\t\t$this->setAttributes_price_base_included($result['attributes_price_base_included']);\n\t\t\t$this->setAttributes_price_onetime($result['attributes_price_onetime']);\n\t\t\t$this->setAttributes_price_factor($result['attributes_price_factor']);\n\t\t\t$this->setAttributes_price_factor_offset($result['attributes_price_factor_offset']);\n\t\t\t$this->setAttributes_price_factor_onetime($result['attributes_price_factor_onetime']);\n\t\t\t$this->setAttributes_price_factor_onetime_offset($result['attributes_price_factor_onetime_offset']);\n\t\t\t$this->setAttributes_qty_prices($result['attributes_qty_prices']);\n\t\t\t$this->setAttributes_qty_prices_onetime($result['attributes_qty_prices_onetime']);\n\t\t\t$this->setAttributes_price_words($result['attributes_price_words']);\n\t\t\t$this->setAttributes_price_words_free($result['attributes_price_words_free']);\n\t\t\t$this->setAttributes_price_letters($result['attributes_price_letters']);\n\t\t\t$this->setAttributes_price_letters_free($result['attributes_price_letters_free']);\n\t\t\t$this->setProducts_options_id($result['products_options_id']);\n\t\t\t$this->setProducts_options_values_id($result['products_options_values_id']);\n\t\t\t$this->setProducts_prid($result['products_prid']);\n\t\t}\n\t}", "protected function defineAttributes()\n {\n return array_merge(parent::defineAttributes(), array(\n 'state' => array(AttributeType::String, 'default' => ''),\n 'category' => array(AttributeType::String, 'default' => ''),\n 'code' => array(AttributeType::String, 'default' => ''),\n 'include' => array(AttributeType::Number, 'default' => ''),\n 'taxable' => array(AttributeType::String, 'default' => ''),\n 'zip' => array(AttributeType::String, 'default' => ''),\n ));\n }", "public function setAttributes();", "public static function supportedAttributes();", "public function setAttributes($attributes){ }", "public function defineAttributes()\n {\n return array(\n 'id' => AttributeType::Number,\n 'receiptParagraphOne' => AttributeType::String,\n 'receiptParagraphTwo' => AttributeType::String,\n 'receiptParagraphThree' => AttributeType::String,\n 'notifyEmail' => AttributeType::String\n );\n }", "protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'fk_documento',\n 'fk_funcionario',\n 'accion',\n 'fecha',\n 'descripcion',\n 'titulo'\n ],\n 'date' => ['fecha']\n ];\n }", "abstract protected function attributes();", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function defineAttributes()\n {\n return array(\n 'id' => AttributeType::Number,\n 'receiptBody' => AttributeType::String,\n );\n }", "public function attributes()\n {\n //return array_merge(parent::attributes(), ['task_duedate', 'priority', 'project_name', 'per_complete']);\n\t\treturn array_merge(parent::attributes(), ['task_duedate','task_duetime', 'priority', 'project_name', 'per_complete', 'task_date_time','porder','pname','client_name','clientcase_name']);\n }", "public function productAttributes()\n {\n return $this->belongsToMany(ProductAttribute::class);\n }", "public function getPropertyDetails(){\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n return $objectManager->get ( 'Apptha\\Airhotels\\Model\\Attributes' );\n }", "public function attributes()\n {\n\n return [\n 'name' => __('fields.name'),\n 'email' => __('fields.email'), \n 'phone' => __('fields.phone'),\n 'departure' => __('fields.departure'),\n 'adult' => __('fields.adult'),\n 'child' => __('fields.child'),\n 'comment' => __('fields.comment') \n ]; \n }", "public function attributes(): array\n {\n return [\n 'name' => '角色名称',\n 'staff' => '关联员工',\n 'brand' => '关联品牌',\n 'department' => '关联部门',\n ];\n }", "private function _designCatalogModelCreateData1()\n {\n return [\n 'shortCardContainerDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardInstanceDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardTitleDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardTitleDesignTextModel' => [\n 'size' => 10\n ],\n 'shortCardDateDesignTextModel' => [\n 'size' => 10\n ],\n 'shortCardPriceDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardPriceDesignTextModel' => [\n 'size' => 10\n ],\n 'shortCardOldPriceDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardOldPriceDesignTextModel' => [\n 'size' => 10\n ],\n 'shortCardDescriptionDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardDescriptionDesignTextModel' => [\n 'size' => 10\n ],\n 'shortCardPaginationDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardPaginationItemDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'shortCardPaginationItemDesignTextModel' => [\n 'size' => 10\n ],\n ];\n }", "function getAttributes()\n {\n }", "abstract protected function getModelAttributes();", "public function attributes() // atribūtu savi nosaukumi\n {\n return[ \n 'fname' => 'Vārds',\n 'lname' => 'Uzvārds',\n 'email' => 'E-pasts',\n 'oldpassword' => 'Paroles lauks',\n 'password' => 'Jaunas paroles lauks',\n 'buttontitle' => 'Pogas virsraksts',\n 'buttonlink' => 'Pogas links',\n 'reciever' => 'Saņēmēju lauks',\n 'emailtitle' => 'Ziņas virsrsksts',\n 'emailtext' => 'Ziņas teksts',\n 'transport' => 'Pasākumu lauks'\n ];\n }", "public static function getSummaryAttributes()\n {\n return array(\n 'id' => array(\n 'name' => 'id',\n 'display' => 'ID',\n 'type' => 'numeric',\n 'link' => 'endpoint',\n ),\n 'event_id' => array(\n 'name' => 'event_id',\n 'display' => 'Event ID',\n 'type' => 'numeric',\n 'hide' => 'all',\n 'link' => 'endpoint2',\n ),\n 'event_start' => array(\n 'name' => 'event_start',\n 'display' => 'Event Start',\n 'type' => 'numeric',\n ),\n 'arena' => array(\n 'name' => 'arena',\n 'display' => 'Arena',\n 'type' => 'alpha',\n 'hide' => 'phone,tablet',\n ),\n 'arena_id' => array(\n 'name' => 'arena_id',\n 'display' => 'Arena ID',\n 'type' => 'numeric',\n 'hide' => 'all',\n 'link' => 'endpoint3',\n ),\n 'location' => array(\n 'name' => 'location',\n 'display' => 'Location',\n 'type' => 'alpha',\n 'hide' => 'phone,tablet',\n ),\n 'location_id' => array(\n 'name' => 'location_id',\n 'display' => 'Location ID',\n 'type' => 'numeric',\n 'hide' => 'all',\n 'link' => 'endpoint4',\n ),\n 'requester_name' => array(\n 'name' => 'requester_name',\n 'display' => 'Requested By',\n 'type' => 'alpha',\n 'hide' => 'phone',\n ),\n 'created_on' => array(\n 'name' => 'created_on',\n 'display' => 'Requested On',\n 'type' => 'alpha',\n 'hide' => 'phone',\n ),\n 'acknowledged_by' => array(\n 'name' => 'acknowledged_by',\n 'display' => 'Acknowledged By',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'acknowledged_on' => array(\n 'name' => 'acknowledged_on',\n 'display' => 'Acknowledged On',\n 'type' => 'numeric',\n 'hide' => 'all'\n ),\n 'accepted_by' => array(\n 'name' => 'accepted_by',\n 'display' => 'Accepted By',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'accepted_on' => array(\n 'name' => 'accepted_on',\n 'display' => 'Accepted On',\n 'type' => 'numeric',\n 'hide' => 'all'\n ),\n 'rejected_by' => array(\n 'name' => 'rejected_by',\n 'display' => 'Rejected By',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'rejected_on' => array(\n 'name' => 'rejected_on',\n 'display' => 'Rejected On',\n 'type' => 'numeric',\n 'hide' => 'all'\n ),\n 'rejected_reason' => array(\n 'name' => 'rejected_reason',\n 'display' => 'Rejection Reason',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'notes' => array(\n 'name' => 'notes',\n 'display' => 'Notes',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'type' => array(\n 'name' => 'type',\n 'display' => 'Type',\n 'type' => 'alpha',\n ),\n 'status' => array(\n 'name' => 'status',\n 'display' => 'Status',\n 'type' => 'alpha',\n ),\n );\n }", "public function defineAttributes()\n\t{\n\t\treturn array();\n\t}", "public function __construct(array $attributes = []);", "public function attributes() {\n return $this->hasMany('App\\Models\\ProductAttribute');\n }", "public function attributes()\n {\n // add related fields to searchable attributes\n return array_merge(parent::attributes(), ['idPeserta.nama_lengkap']);\n }", "public function getAttributes()\n\t{\n\t\treturn array(\n\t\t\t'usuario' => $this->usuario,\n\t\t\t'correo' => $this->correo,\n\t\t\t'cedula'=>$this->cedula,\n\t\t\t//'firstName' => $this->firstName,\n\t\t\t//'lastName' => $this->lastName,\n\t\t);\n\t}", "public static function fields()\n {\n return [\n 'p.entity_id as entity_id',\n 'p.rebates as rebates',\n 'p.name',\n 'a.name as first_category_name',\n 'b.name as second_category_name',\n 'c.name as third_category_name',\n 'd.sort as wholesaler_weight',\n 'p.status',\n 'p.commission',\n 'p.label1',\n 'p.type',\n 'p.type2',\n 'p.sales_type',\n 'br.sort as brand_weight',\n 'promotion_text',\n 'lsin',\n 'barcode',\n 'wholesaler_id',\n 'first_category_id',\n 'second_category_id',\n 'third_category_id',\n 'brand',\n 'package_num',\n 'package_spe',\n 'state',\n 'sort_weights',\n 'sold_qty',\n 'price',\n 'special_price',\n 'rule_id',\n 'special_from_date',\n 'special_to_date',\n 'promotion_text_from',\n 'promotion_text_to',\n 'real_sold_qty',\n 'qty',\n 'minimum_order',\n 'gallery',\n 'export',\n 'origin',\n 'package',\n 'specification',\n 'shelf_life',\n 'description',\n 'production_date',\n 'restrict_daily',\n 'subsidies_lelai',\n 'subsidies_wholesaler',\n 'promotion_title_from',\n 'promotion_title_to',\n 'promotion_title',\n 'sales_attribute_name',\n 'sales_attribute_value',\n 'specification_num',\n 'specification_unit',\n 'fake_sold_qty',\n 'special_rebates_from',\n 'special_rebates_to',\n 'special_rebates_lelai_from',\n 'special_rebates_lelai_to',\n 'special_rebates_lelai',\n 'special_rebates',\n 'is_calculate_lelai_rebates',\n 'rebates_lelai',\n 'shelf_from_date',\n 'shelf_to_date',\n ];\n }", "public function attributes()\n {\n return $this->belongsToMany(ProductAttr::class, 'product_info', 'product', 'attribute')->withPivot(['content']);\n }", "private function attrNames()\n {\n $dimAttr = [\n 'length' => 'length',\n 'width' => 'width',\n 'height' => 'height',\n ];\n $dsAttr = [\n 'dropship' => 'dropship',\n 'dropship_location' => 'dropship_location'\n ];\n\n $this->attrNames = ($this->mageVersion >= '2.2.5') ? $dsAttr : array_merge($dsAttr, $dimAttr);\n }", "public function __construct(array $attributes = array()) {\n $this->attributes = array(\n 'SourceName' => NULL,\n 'ExtReference' => NULL,\n 'PropertyCode' => NULL,\n 'FirstName' => NULL,\n 'LastName' => NULL,\n 'Email' => NULL\n );\n\n if (!empty($attributes)) {\n foreach ($attributes as $name => $value) {\n $this->$name = $value;\n }\n }\n }", "public function definition()\n {\n $allPL = DB::table('productlines')->get()->toArray();\n $allPLTitle = array_column($allPL, 'product_line');\n\n return [\n 'product_code' => $this->faker->ean8 (),\n 'product_name' => $this->faker->name(),\n 'product_line' => $allPLTitle[array_rand($allPLTitle, 1)], // ko đc random -> phai lay tu bang productline\n 'product_scale' => Str::random(100),\n 'product_vendor' => $this->faker->company(),\n 'product_description' => $this->faker->text($maxNbChars = 200),\n 'quantity_inStock' => $this->faker->randomNumber(5),\n 'buy_price' => $this->faker->randomNumber(6, 2),\n 'MSRP' => $this->faker->realText(),\n\n\n ];\n }", "public function getAttributeSettings()\n {\n return [\n 'id' => [\n 'type' => self::TYPE_NUMERIC,\n 'visible' => true,\n 'formdisplay' => false,\n 'required' => true,\n 'relation' => null,\n 'label' => 'ID'\n ],\n 'position' => [\n 'type' => self::TYPE_TEXT,\n 'visible' => true,\n 'formdisplay' => true,\n 'required' => true,\n 'relation' => null,\n 'label' => 'Position (Type)',\n 'options' => $this->getPositionOptions(),\n \"filterable\" => true\n ],\n 'position_order' => [\n 'type' => self::TYPE_NUMERIC,\n 'visible' => true,\n 'formdisplay' => true,\n 'required' => true,\n 'relation' => null,\n 'label' => 'Order'\n ],\n 'label' => [\n 'type' => self::TYPE_TEXT,\n 'visible' => true,\n 'formdisplay' => true,\n 'required' => true,\n 'relation' => null,\n 'label' => 'Label',\n ],\n 'url' => [\n 'type' => self::TYPE_TEXT,\n 'visible' => true,\n 'formdisplay' => true,\n 'required' => true,\n 'relation' => null,\n 'label' => 'URL',\n ],\n 'status' => [\n 'type' => self::TYPE_TEXT,\n 'visible' => true,\n 'formdisplay' => true,\n 'required' => true,\n 'relation' => null,\n 'label' => 'Status',\n 'options' => $this->getStatusOptions(),\n 'filterable' => true\n ],\n 'parent_id' => [\n 'type' => self::TYPE_NUMERIC,\n 'visible' => true,\n 'formdisplay' => true,\n 'required' => false,\n 'relation' => 'parent',\n 'label' => 'Parent',\n 'options' => static::where('id', '<>', $this->id)->pluck('label', 'id')\n ],\n 'created_at' => [\n 'type' => self::TYPE_DATETIME,\n 'visible' => true,\n 'formdisplay' => false,\n 'required' => false,\n 'relation' => null,\n 'label' => 'Created At'\n ],\n 'updated_at' => [\n 'type' => self::TYPE_DATETIME,\n 'visible' => true,\n 'formdisplay' => false,\n 'required' => false,\n 'relation' => null,\n 'label' => 'Updated At'\n ]\n ];\n }", "public function definition()\n {\n return [\n 'city_id'=>$this->faker->randomElement([1,2,3,4.5]),\n 'country_id'=>$this->faker->randomElement([1,2,3,4.5]),\n 'nationality_id'=>$this->faker->randomElement([1,2,3,4.5]),\n 'full_name'=>$this->faker->name,\n 'email'=> $this->faker->unique()->safeEmail,\n 'country_code'=> $this->faker->countryCode,\n 'country_of_residence'=> $this->faker->countryCode,\n 'mobile'=> '0115265'.$this->faker->numerify('#####'),\n 'password'=> Hash::make('12345678'),\n 'code'=> generateRandomCode('PSN'),\n 'avatar'=> $this->faker->imageUrl(),\n 'birthday'=> $this->faker->date($format = 'Y-m-d'),\n 'gender'=> $this->faker->randomElement([1,2,3]),\n 'rate'=> $this->faker->randomElement([1.5,2.2,4.2,3.5,5.0,2.1,4.8,2.9]),\n 'status'=> true\n // 'skills'=> 'play,chess',\n \n ];\n }", "public function attributes()\n {\n return [\n 'description' => 'Descrição',\n 'gender' => 'Gênero',\n ];\n }", "public function getAttributes() {\n $toReturn = array();\n $toReturn[\"id\"] = $this->id_;\n $toReturn[\"username\"] = $this->username_;\n $toReturn[\"email\"] = $this->email_;\n $toReturn[\"displayName\"] = $this->displayName_;\n $toReturn[\"firstName\"] = $this->firstName_;\n $toReturn[\"lastName\"] = $this->lastName_;\n $toReturn[\"postalCode\"] = $this->postalCode_;\n if ($this->privileges_ !== null) {\n $toReturn[\"privileges\"] = $this->privileges_;\n } else {\n $toReturn[\"privileges\"] = array();\n }\n \n $toReturn[\"isVerified\"] = $this->isVerified_;\n return $toReturn;\n }", "static function getAttributesInfo ()\n {\n return array (\n 'section1' => array (\n 'name' => _('Informations'),\n 'attrs' => array (\n new StringAttribute('', '', 'k', FALSE, 'kolab'),\n new SetAttribute(new StringAttribute('', '', 'kolabHost')),\n new StringAttribute(\n _('Postfix mydomain'), _('Postfix domain name'),\n 'postfix-mydomain'\n ),\n new StringAttribute(\n _('Cyrus admins'), _('Cyrus admins for kolab server'),\n 'cyrus-admins'\n ),\n new SetAttribute(\n new StringAttribute(\n _('Mail domains').', '._('Postfix mydestination'), _('Mail domains'),\n 'postfix-mydestination', FALSE\n )\n )\n )\n ),\n 'section2' => array (\n 'name' => _('Services'),\n 'attrs' => array (\n new BooleanAttribute (\n _('POP3 service'), _('Enable POP3 service'),\n 'cyrus-pop3', FALSE, FALSE\n ),\n new BooleanAttribute (\n _('POP3/SSL service'), _('Enable POP3/SSL service'),\n 'cyrus-pop3s', FALSE, TRUE\n ),\n new BooleanAttribute (\n _('IMAP service'), _('Enable IMAP service'),\n 'cyrus-imap', FALSE, TRUE\n ),\n new BooleanAttribute (\n _('IMAP/SSL service'), _('Enable IMAP/SSL service'),\n 'cyrus-imaps', FALSE, TRUE\n ),\n new BooleanAttribute (\n _('Sieve service'), _('Enable Sieve service'),\n 'cyrus-sieve', FALSE, TRUE\n ),\n new BooleanAttribute (\n _('FTP FreeBusy service (legacy)'),\n _('FTP FreeBusy service (legacy, not interoperable with Kolab2 FreeBusy)'),\n 'proftpd-ftp', FALSE, FALSE\n ),\n new BooleanAttribute (\n _('HTTP FreeBusy service (legacy)'), '',\n 'apache-http', FALSE, TRUE\n ),\n new BooleanAttribute (\n _('Amavis email scanning'), _('Amavis email scanning (virus/spam)'),\n 'postfix-enable-virus-scan', FALSE, TRUE\n ),\n )\n ),\n 'section3' => array (\n 'name' => _('Quota settings'),\n 'attrs' => array (\n new IntAttribute (\n _('Quota occupation limit before warning users (%)'),\n _('Warn users when using more than X% of their mail quota'),\n 'cyrus-quotawarn', FALSE,\n FALSE, FALSE, // min and max\n 80 // default value\n )\n )\n ),\n 'section4' => array (\n 'name' => _('Free/Busy settings'),\n 'attrs' => array (\n new BooleanAttribute (\n _('Allow unauthenticated downloading of Free/Busy information'),\n _('Allow unauthenticated downloading of Free/Busy information'),\n 'apache-allow-unauthenticated-fb', FALSE, TRUE\n ),\n new IntAttribute (\n _('Number of days to include when creating free/busy lists'),\n _('Include data from X days in the past when creating free/busy lists'),\n 'kolabFreeBusyFuture', FALSE,\n FALSE, FALSE, // min and max\n 1 // default value\n )\n )\n ),\n 'section5' => array (\n 'name' => _('SMTP privileged networks'),\n 'attrs' => array (\n new StringAttribute (\n _('Hosts/networks allowed to relay'),\n _('Hosts/networks allowed to relay (multiple values comma-seperated)'),\n 'postfix-mynetworks',\n FALSE,\n '127.0.0.1/8'\n )\n )\n ),\n 'section6' => array (\n 'name' => _('SMTP smarthost/relayhost'),\n 'attrs' => array (\n new RelayHostKolabAttribute (\n _('Host used to relay mails'), 'postfix-relayhost'\n )\n )\n ),\n 'section7' => array (\n 'name' => _('Accept Internet Mail'),\n 'attrs' => array (\n new BooleanAttribute (\n _('Accept mail from other domains over non-authenticated SMTP'),\n _('Accept mail from other domains over non-authenticated SMTP'),\n 'postfix-allow-unauthenticated'\n )\n )\n )\n );\n }", "private function _designCatalogModelCreateData2()\n {\n return [\n 'fullCardContainerDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'fullCardTitleDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'fullCardTitleDesignTextModel' => [\n 'size' => 10\n ],\n 'fullCardDateDesignTextModel' => [\n 'size' => 10\n ],\n 'fullCardPriceDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'fullCardPriceDesignTextModel' => [\n 'size' => 10\n ],\n 'fullCardOldPriceDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'fullCardOldPriceDesignTextModel' => [\n 'size' => 10\n ],\n 'fullCardBinButtonDesignBlockModel' => [\n 'marginTop' => 10,\n 'borderBottomWidth' => 7,\n 'borderColorHover' => 'rgb(0,255,0)',\n 'backgroundColorFromHover' => 'rgba(255,0,255,0.5)',\n ],\n 'fullCardBinButtonDesignTextModel' => [\n 'size' => 10\n ],\n 'shortCardViewType' => 1,\n 'fullCardImagesPosition' => 1,\n 'fullCardDatePosition' => 1\n ];\n }", "public function getAttributesList()\n {\n }", "function getAttributes( $itemId ) {\r\n\tglobal $db, $site;\r\n\t$sql = \r\n\t\t'SELECT '.\r\n\t\t'a.id as id, v.id as v_id, a.name, a.type, if (v.use_default, a._default, v.value) as value '.\r\n\t\t'FROM '.ATTRIBUTES_TABLE.\" a \".\r\n\t\t'LEFT JOIN '. ATTRVALUES_TABLE.\" v on a.id=v.attr_id and v.product_id='$itemId' \".\r\n\t\t\"WHERE a.visible=1 and v.product_id='$itemId' and v.site_key='$site'\";\r\n\t\r\n\t$attributes = $db->getAll( $sql );\r\n\t\r\n\t$out = array();\r\n\t\r\n\tif ( $attributes )\r\n\tforeach ( $attributes as $idx=>$item ) {\r\n\t\t$out[$item['id']] = $item;\r\n\t\tif ( preg_match( '/^list/', $item['type'] ) ) {\r\n\t\t\t$v = @unserialize( $item['value'] );\r\n\t\t\t$out[$item['id']]['value'] = $v[0];\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $out;\r\n}", "public function getComplexProductAttribute($productID) {\n //query to read complex record id\n $queryComplexProduct = DB::table('products')\n ->join(DB::raw('product_complex_options_map AS pcom'), 'pcom.variant_product_id', '=', 'products.id')\n ->leftJoin(DB::raw('product_variant_options AS pvo'), 'pvo.id', '=', 'pcom.product_variant_option_id')\n ->leftJoin(DB::raw('product_attributes_text AS pat1'), 'pat1.product_id', '=', 'pcom.variant_product_id')\n ->leftJoin(DB::raw('product_attributes_text AS pat2'), 'pat2.product_id', '=', 'pcom.variant_product_id')\n ->leftJoin(DB::raw('product_attributes AS pa'), 'pa.id', '=', 'pat1.product_attribute_id')\n ->leftJoin(DB::raw('product_attributes AS pa2'), 'pa2.id', '=', 'pat2.product_attribute_id')\n ->leftJoin(DB::raw('product_pricing AS pp'), 'pp.product_id','=','pcom.variant_product_id')\n ->where('pcom.complex_product_id',$productID)\n ->where('pa.alias','short_description')\n ->where('pa2.alias','Menu')\n ->groupBy('products.id')\n ->select('products.id','products.name','products.type','pvo.variation_name',\n DB::raw('pat1.attribute_value as experience_includes, pat2.attribute_value as\n menu'),'pp.price','pp.price_type','pp.tax','pp.post_tax_price')\n ->get();\n \n //array to hold the details for the complex attributes\n $arrDetails = array();\n \n if($queryComplexProduct) {\n foreach ($queryComplexProduct as $row) {\n $arrDetails[] = array(\n 'id' => $row->id,\n 'name' => $row->name,\n 'type' => $row->type,\n 'variation_name' => $row->variation_name,\n 'experince_includes' => $row->experience_includes,\n 'menu' => $row->menu,\n 'price' => $row->price,\n 'price_type' => (empty($row->price_type)) ? '':$row->price_type,\n 'taxes' => (empty($row->tax)) ? '':$row->tax\n );\n }\n } \n return $arrDetails;\n }", "protected function defineAttributes()\n {\n return array_merge(parent::defineAttributes(), array(\n 'Amount' => array(AttributeType::Number, 'decimals' => 0),\n 'GrossNet' => AttributeType::String,\n 'Id' => AttributeType::String,\n 'Period' => AttributeType::String,\n 'Type' => AttributeType::String\n ));\n }", "protected function getAttributes()\n {\n return [];\n }", "public function attributes($layout = 'table')\n\t{\n\t switch ($layout) {\n\t default:\n \t\t$ret = array(\n \t\t\tarray(\n \t\t\t\t'attribute' => 'year',\n \t\t\t\t'orderclause' => 'invoice.year',\n \t\t\t\t'class' => 'number',\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'number'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t\t'attribute' => 'm',\n \t\t\t\t'orderclause' => 'invoice.m',\n \t\t\t\t'class' => 'number',\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'number'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t\t'attribute' => 'd',\n \t\t\t\t'orderclause' => 'invoice.d',\n \t\t\t\t'class' => 'number',\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'number'\n \t\t\t\t)\n \t\t\t),\n array(\n \t\t\t 'attribute' => 'invoicetype_id',\n \t\t\t 'orderclause' => 'invoicetype.name',\n \t\t\t 'class' => 'text',\n \t\t\t 'callback' => array(\n \t\t\t 'name' => 'invoicetypeName'\n \t\t\t ),\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'text'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t\t'attribute' => 'name',\n \t\t\t\t'orderclause' => 'invoice.name',\n \t\t\t\t'class' => 'number',\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'number'\n \t\t\t\t),\n \t\t\t\t'callback' => array(\n \t\t\t\t 'name' => 'invoiceName'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t\t'attribute' => 'deleted',\n \t\t\t\t'orderclause' => 'invoice.deleted',\n \t\t\t\t'class' => 'bool',\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'bool'\n \t\t\t\t),\n \t\t\t\t'callback' => array(\n \t\t\t\t 'name' => 'isDeletedHumanReadable'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t 'attribute' => 'client_id',\n \t\t\t 'orderclause' => 'client.nickname',\n \t\t\t 'class' => 'text',\n \t\t\t 'callback' => array(\n \t\t\t 'name' => 'clientNickname'\n \t\t\t ),\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'text'\n \t\t\t\t)\n \t\t\t),\n array(\n \t\t\t 'attribute' => 'clientcode',\n \t\t\t 'orderclause' => 'invoice.clientcode',\n \t\t\t 'class' => 'text',\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'text'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t 'attribute' => 'card_id',\n \t\t\t 'orderclause' => 'card.name',\n \t\t\t 'class' => 'text',\n \t\t\t 'callback' => array(\n \t\t\t 'name' => 'cardName'\n \t\t\t ),\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'text'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t 'attribute' => 'attorney_id',\n \t\t\t 'orderclause' => 'attorney.name',\n \t\t\t 'class' => 'text',\n \t\t\t 'callback' => array(\n \t\t\t 'name' => 'attorneyName'\n \t\t\t ),\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'text'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t 'attribute' => 'user_id',\n \t\t\t 'orderclause' => 'user.name',\n \t\t\t 'class' => 'text',\n \t\t\t 'callback' => array(\n \t\t\t 'name' => 'userName'\n \t\t\t ),\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'text'\n \t\t\t\t)\n \t\t\t)\n \t\t);\n }\n return $ret;\n\t}", "public function getCustomAttributes() {}", "public function storeWithAttributes(CreateWithAttributesRequest $request)\n {\n $products = $request->input('products');\n\n if (!is_null($products) && !empty($products)) {\n $reference = new Reference;\n $reference->nombre = $request->name;\n $reference->descripcion = $request->description;\n $reference->descripcion_larga = $request->long_description;\n\n if ($reference->save()) {\n $attributes = $request->input('attributes');\n $buy_prices = $request->input('buy_prices');\n $codes = $request->input('codes');\n $details = $request->input('details');\n $quantities = $request->input('quantities');\n $sale_prices = $request->input('sale_prices');\n $storedDetails = [];\n\n for ($i = 0; $i <= 5; $i++) {\n $image = $i > 0 ? 'imagen' . $i : 'imagen';\n\n if ($request->file($image) != null) {\n $reference_name = sanitize_file_name ($reference->id . ' ' . $reference->nombre . ' ' . $image);\n\n if ($request->file($image)->storeAs(auth_user()->dbConfig->base_dato . '/imagenes_productos', $reference_name . '.' . $request->file($image)->extension(), 'uploads')) {\n $reference->$image = $reference_name . '.' . $request->file($image)->extension();\n }\n }\n }\n\n $reference->save();\n\n foreach ($attributes as $key => $value) {\n if (array_key_exists($key, $details) && !is_null($details[$key])) {\n $attribute = new Attribute;\n $attribute->nombre_atributo = mb_strtoupper($value, 'UTF-8');\n $attribute->producto_referencia_id = $reference->id;\n\n if ($attribute->save()) {\n foreach (explode(',', $details[$key]) as $value) {\n $detail = new Detail;\n $detail->nombre_detalle = mb_strtoupper($value, 'UTF-8');\n $detail->producto_referencia_atributo_id = $attribute->id;\n if ($detail->save()) {\n $storedDetails[$detail->nombre_detalle] = $detail->id;\n }\n }\n }\n }\n }\n\n $first = true;\n $tax = Tax::find($request->tax);\n\n if (is_null($tax)) {\n $tax = Tax::where([\n 'porciento' => 0,\n ])->first();\n\n if (is_null($tax)) {\n $tax = new Tax;\n $tax->nombre_impuesto = 'IVA (0%)';\n $tax->porciento = 0;\n $tax->save();\n }\n }\n\n foreach ($products as $key => $value) {\n $productDetails = explode('/', mb_strtoupper($value, 'UTF-8'));\n $findDetails = true;\n $idDetails = [];\n\n foreach ($productDetails as $detail) {\n if (array_key_exists($detail, $storedDetails)) {\n array_push($idDetails, $storedDetails[$detail]);\n } else {\n $findDetails = false;\n }\n }\n\n if ($findDetails && count($idDetails) > 0) {\n $featured = ($first && !is_null($request->featured)) ? true : false;\n $code = array_key_exists($key, $codes) ? $codes[$key] : null;\n $quantity = array_key_exists($key, $quantities) && !is_null($quantities[$key]) ? $quantities[$key] : 0;\n $buy_price = array_key_exists($key, $buy_prices) && !is_null($buy_prices[$key]) ? $buy_prices[$key] : 0;\n $sale_price = array_key_exists($key, $sale_prices) && !is_null($sale_prices[$key]) ? $sale_prices[$key] : 0;\n $product = new Product;\n $product->code = $code;\n $product->name = $reference->nombre . '/' . mb_strtoupper($value, 'UTF-8');\n $product->category = $request->category;\n $product->description = $request->description;\n $product->long_description = $request->long_description;\n $product->impuesto = $tax->id_impuesto;\n $product->featured = $featured;\n $product->sell_in_negative = (!is_null($request->sell_without_stock)) ? true : false;\n $product->show_stock = (!is_null($request->show_stock)) ? true : false;\n $product->buy_price = $buy_price; $product->sale_price = $sale_price;\n $product->referencia_id = $reference->id;\n\n if ($product->save()) {\n $warehouses = Warehouse::all();\n $current_warehouse = auth_user()->shop->id_almacen;\n\n foreach ($warehouses as $warehouse) {\n $warehouse_quantity = $warehouse->id === $current_warehouse ? $quantity : 0;\n $curret_stock = new Current;\n $curret_stock->set_warehouse = $warehouse->id;\n $curret_stock->set_product = $product->id;\n $curret_stock->set_quantity = $warehouse_quantity;\n $curret_stock->save();\n }\n\n if ($quantity > 0) {\n $productCollection = collect();\n $productCollection->push([\n 'id' => $product->id,\n 'name' => $product->name,\n 'buy_price' => $product->buy_price,\n 'sale_price' => $product->sale_price,\n 'quantity' => $quantity,\n 'subtotal' => $product->buy_price * $quantity,\n ]);\n $movement = new InventoryMovement($productCollection);\n $inventory = $movement->new($current_warehouse);\n $result = $movement->addItems($inventory);\n }\n\n $first = false;\n $detailProduct = new DetailProduct;\n $detailProduct->producto_id = $product->id;\n\n for ($i = 0; $i < count($idDetails); $i++) {\n if ($i < 10) {\n $detailId = 'producto_referencia_atributo_detalle' . ($i + 1) . '_id';\n $detailProduct->$detailId = $idDetails[$i];\n }\n }\n\n $detailProduct->save();\n }\n }\n }\n\n return redirect()->route('admin.products.index')->with('success', 'El producto se agrego con éxito.');\n }\n }\n\n return back()->with('danger', 'Ha ocurrido un error.');\n }", "protected function attributes() {\n\t\t$attributes = array();\n\t\tforeach(self::$db_fields as $field) {\n\t\t\tif(property_exists($this, $field)){\n\t\t\t\t$attributes[$field] = $this->$field;\n\t\t\t}\n\t\t}\n\t\treturn $attributes;\n\t}", "public function getProductSaveInfo($product, $data) {\n $product->setColor ( $data [11] );\n $product->setCost ( $data [12] );\n $product->setCountry ( $data [13] );\n $product->setCountryOfManufacture ( $data [14] );\n $product->setCreatedAt ( $data [15] );\n $product->setDescription ( $data [20] );\n $product->setEnableGooglecheckout ( $data [21] );\n $product->setGallery ( $data [22] );\n $product->setGiftMessageAvailable ( $data [23] );\n $product->setHasOptions ( $data [24] );\n $product->setHostemail ( $data [25] );\n $product->setHouserule ( $data [26] );\n $product->setImage ( $data [27] );\n $product->setImageLabel ( $data [28] );\n $product->setMediaGallery ( $data [30] );\n $product->setMinimalPrice ( $data [34] );\n $product->setMsrp ( $data [35] );\n $product->setMsrpDisplayActualPriceType ( $data [36] );\n $product->setMsrpEnabled ( $data [37] );\n $product->setName ( $data [38] );\n $product->setNewsFromDate ( strtotime ( $data [39] ) );\n $product->setNewsToDate ( '' );\n if (isset ( $data [41] )) {\n $product->setOptionsContainer ( $data [41] );\n }\n if (isset ( $data [43] )) {\n $product->setPrice ( $data [43] );\n }\n if (isset ( $data [44] )) {\n $product->setPrivacy ( $data [44] );\n }\n if (isset ( $data [45] )) {\n $product->setPropertyadd ( $data [45] );\n }\n if (isset ( $data [46] )) {\n $product->setPropertytype ( $data [46] );\n }\n if (isset ( $data [47] )) {\n $product->setPropertyWebsite ( $data [47] );\n }\n if (isset ( $data [48] )) {\n $product->setRequiredOptions ( $data [48] );\n }\n if (isset ( $data [49] )) {\n $product->setShortDescription ( $data [49] );\n }\n if (isset ( $data [50] )) {\n $product->setSmallImage ( $data [50] );\n }\n if (isset ( $data [51] )) {\n $product->setSmallImageLabel ( $data [51] );\n }\n if (isset ( $data [52] )) {\n $product->setSpecialFromDate ( $data [52] );\n }\n if (isset ( $data [53] )) {\n $product->setSpecialPrice ( $data [53] );\n }\n if (isset ( $data [54] )) {\n $product->setSpecialToDate ( $data [54] );\n }\n if (isset ( $data [55] )) {\n $product->setStatus ( $data [55] );\n }\n if (isset ( $data [56] )) {\n $product->setTaxClassId ( $data [56] );\n }\n if (isset ( $data [57] )) {\n $product->setThumbnail ( $data [57] );\n } \n return $product;\n }" ]
[ "0.637592", "0.62424713", "0.62261105", "0.62044054", "0.61969244", "0.6193476", "0.61831176", "0.61637896", "0.61621535", "0.61621535", "0.61621535", "0.61621535", "0.61621535", "0.61621535", "0.61621535", "0.61621535", "0.61621535", "0.61586344", "0.6133919", "0.61102927", "0.60940975", "0.60932636", "0.6089162", "0.6082214", "0.6080924", "0.60616577", "0.6052148", "0.60438675", "0.60438675", "0.60438675", "0.60438675", "0.6034204", "0.601829", "0.60180426", "0.6017713", "0.6017713", "0.60143507", "0.6011638", "0.6010408", "0.60072976", "0.5985725", "0.5978445", "0.59595066", "0.591903", "0.58994216", "0.5873341", "0.58654153", "0.5859799", "0.5855244", "0.5853634", "0.58527076", "0.58487064", "0.5847013", "0.58449435", "0.58440274", "0.5834952", "0.58294547", "0.58294547", "0.582805", "0.582805", "0.582805", "0.582805", "0.5827762", "0.5827654", "0.5827625", "0.582743", "0.5823135", "0.5809795", "0.5798778", "0.57913697", "0.5782102", "0.5768961", "0.57524854", "0.5752285", "0.5751202", "0.57511777", "0.5746095", "0.5740115", "0.57292104", "0.5726779", "0.57231355", "0.5714658", "0.5708607", "0.569887", "0.5694015", "0.56896424", "0.56870764", "0.5680701", "0.56800926", "0.5679719", "0.56753623", "0.5673515", "0.5667972", "0.5667101", "0.56637454", "0.56599504", "0.5655653", "0.5652258", "0.564296", "0.5622781", "0.56214947" ]
0.0
-1
Open CSV file for reading
public function open($file, $delimiter = null, $enclosure = null, $escape = null) { if ($delimiter !== null) { $this->delimiter = $delimiter; } else { $this->delimiter = config('csv.delimiter'); } if ($enclosure !== null) { $this->enclosure = $enclosure; } else { $this->enclosure = config('csv.enclosure'); } if ($escape !== null) { $this->escape = $escape; } else { $this->escape = config('csv.escape'); } $this->handle = fopen($file, 'r+'); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function open_csv() {\n $this->fh = fopen(CSV_FILE, \"r\");\n if ($this->fh === false) {\n $this->log_it(\"Could not open CSV file.\");\n return false;\n }\n\n return true;\n }", "public function readCsv()\n {\n ini_set(\"auto_detect_line_endings\", true);\n $fp = fopen($this->inputFile , 'r');\n while($row = fgetcsv($fp)){\n $this->data[] = $row;\n }\n }", "function read_csv()\n {\n $handle = fopen($this->filename, 'r');\n $filesize = filesize($this->filename);\n $openList = [];\n if($filesize != 0) {\n while(!feof($handle)) {\n $openList[] = fgetcsv($handle);\n } \n }else {\n $openList = array();\n }\n fclose($handle);\n return $openList;\n }", "public function open($file) {\n\t\tif (!is_file($file)) {throw new FileNotFoundException($file);}\n\t\t\t//echo \"$file does not exist.\";return false;}\n\t\t$this->FILE = fopen($file, 'r');\n\t\tif (!$this->FILE) {throw new IOException(\"fopen failed for $file.\");}//echo \"fopen failed for $file.\";return false;}\n\t\t$this->ISOPEN=true;\n\t\t$this->HEADERS=fgetcsv($this->FILE,0, $this->delimeter, $this->enclosure, $this->escape);\n\t\tif ($this->HEADERS===false) {$this->STATE=CSVReader::STATE_EOF; throw new IOException(\"Error reading the headers.\");}\n\t\t$this->DEFAULTS = array_fill(0, count($this->HEADERS), $this->default_value);\n\t\treturn true;\n\t}", "function readCSV($url) {\n $row = 0;\n $readData = [];\n print_r(\"Opening CSV File ... \");\n if (($handle = fopen($url, \"r\")) !== FALSE) {\n print_r(\"SUCCESS\\n\");\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n if($row!=0) { // skip first row\n $readData[$row] = $data;\n }\n $row++;\n }\n fclose($handle);\n return $readData;\n } else {\n print_r(\"FAIL\\n\");\n return null;\n }\n}", "private function read_csv()\n {\n return array_map('str_getcsv', file($this->filename));\n ////OR\n // $handle = fopen('$this->filename', 'r');\n // $contacts = [];\n // while(!feof($handle)) {\n // $contacts[] = fgetcsv($handle);\n // }\n // fclose($handle); \n }", "private function open_csv() {\n //gracefully close any open file handles (shouldn't be any, but just in case...)\n $this->close_csv();\n\n //Open CSV for writing.\n self::$csv_fh = fopen(CSV_FILE, \"w\");\n if (!is_resource(self::$csv_fh) || get_resource_type(self::$csv_fh) !== \"stream\") {\n fprintf(STDERR, \"Could not open CSV file for writing.\\n%s\\n\", error_get_last());\n return false;\n }\n\n //Lock CSV file.\n if (flock(self::$csv_fh, LOCK_SH, $wouldblock)) {\n self::$csv_locked = true;\n return true;\n } else if ($wouldblock === 1) {\n fprintf(STDERR, \"Another process has locked the CSV.\\n%s\\n\", error_get_last());\n return false;\n } else {\n fprintf(STDERR, \"CSV not blocked, but still could not attain lock for writing.\\n%s\\n\", error_get_last());\n return false;\n }\n }", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "function readCsv($filename) {\n // your code here\n $handle = fopen($filename, \"r\");\n $result = [];\n\n while(!feof($handle)){\n $result[] = fgetcsv($handle);\n }\n fclose($handle);\n return $result;\n }", "function read_csv()\n {\n if(filesize ($this->filename) > 0) {\n $handle = fopen($this->filename, \"r\");\n while(($data = fgetcsv($handle)) !==FALSE) {\n $contents[] = $data;\n }\n fclose($handle);\n\n return $contents;\n }\n else\n {\n return array();\n }\n }", "private function close_csv() {\n //Unlock CSV file, if it is locked.\n if (self::$csv_locked && flock(self::$csv_fh, LOCK_UN)) {\n self::$csv_locked = false;\n }\n\n //Close CSV file, if it is open.\n if (is_resource(self::$csv_fh) && get_resource_type(self::$csv_fh) === \"stream\") {\n fclose(self::$csv_fh);\n }\n }", "function readCSV($csvFile) {\n if (file_exists($csvFile)) {\n $file_handle = fopen($csvFile, 'r');\n\n while (!feof($file_handle) ) {\n $line_of_text[] = fgetcsv($file_handle, 1024);\n }\n\n fclose($file_handle);\n return $line_of_text;\n } else {\n return null;\n }\n}", "function read_csv($filename, $delimiter = \",\") {\n $file_data = array();\n $handle = @fopen($filename, \"r\") or false;\n if ($handle !== FALSE) {\n while (($data = fgetcsv($handle, 1000, $delimiter)) !== FALSE) {\n $file_data[] = $data;\n }\n fclose($handle);\n }\n return $file_data;\n}", "public static function getAlgoCSVFile($csv){\n return new CSVDattaGetter($csv);\n }", "protected function parseCsv() {\r\n\t\t\r\n\t\t$csv_data = array();\r\n\t\twhile ($this->_currentRow = fgetcsv($this->_fileHandler, null, $this->_delimiter, $this->_enclosure)) {\r\n\t\t\t$csv_data[] = $this->_currentRow;\r\n\t\t}\r\n\t\t\r\n\t\t$this->_data = $csv_data;\r\n\t}", "public function loadCsvFile($file)\n {\n $data = [];\n\n if (file_exists($file)) {\n $data = array_map('str_getcsv', file($file));\n\n array_walk($data, function(&$row) use ($data) {\n $row = array_combine($data[0], $row);\n });\n\n array_shift($data);\n }\n else {\n wp_die(__('Import file does not exist.'));\n }\n\n $this->data = $data;\n }", "function loadCSV($filename) {\n // Assume we are following the format of:\n // +15554442222,[email protected]\n $csvArray = array(); \n if (($handle = fopen($filename, \"r\")) !== FALSE) {\n while (($row = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n $csvArray[\"$row[0]\"] = \"$row[1]\";\n }\n if (!feof($handle)) {\n error_log(\"Error: unexpected fgets() fail\\n\");\n }\n }\n fclose($handle);\n\n return $csvArray;\n}", "function openFile($pdo) {\n $cities = fopen('cities.txt', 'r');\n\n $ctr=1;\n while (!feof($cities)) {\n $city = fgetcsv($cities, 0, ';');\n\n insertDatabase($city[0], $city[1], $pdo, $ctr);\n $ctr++;\n }\n}", "public function actionImportFromCsv()\n {\n HBackup::importDbFromCsv($this->csvFile);\n }", "public function openFile(string $mode = 'r'): void\n {\n if (!$this->handle) {\n $this->handle = fopen($this->file, $mode);\n if ($this->handle === false) {\n throw (new Exception('Cannot open CSV file'))\n ->addMoreInfo('file', $this->file)\n ->addMoreInfo('mode', $mode);\n }\n }\n }", "private function csvTaskLoad($csv){\n $multiCsvArr = [];\n if(($handle = fopen(\"{$csv}\", \"r\")) !== false){\n while(($dataRow = fgetcsv($handle, 1000, \",\")) !== false){\n $multiCsvArr[] = $dataRow;\n }\n }\n fclose($handle);\n return $multiCsvArr;\n }", "function Quick_CSV_import($file_name=\"\")\r\n {\r\n $this->file_name = $file_name;\r\n\t\t$this->source = '';\r\n $this->arr_csv_columns = array();\r\n $this->use_csv_header = true;\r\n $this->field_separate_char = \",\";\r\n $this->field_enclose_char = \"\\\"\";\r\n $this->field_escape_char = \"\\\\\";\r\n $this->table_exists = false;\r\n }", "protected function initCSV() {}", "function import_csv()\n {\n $msg = 'OK';\n $path = JPATH_ROOT.DS.'tmp'.DS.'com_condpower.csv';\n if (!$this->_get_file_import($path))\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_UPLOAD_IMPORT_CSV_FILE'));\n }\n// $_data = array(); \n if ($fp = fopen($path, \"r\"))\n {\n while (($data = fgetcsv($fp, 1000, ';', '\"')) !== FALSE) \n {\n unset($_data);\n $_data['virtuemart_custom_id'] = $data[0];\n $_data['virtuemart_product_id'] = $data[1];\n $id = $this->_find_id($_data['virtuemart_custom_id'],$_data['virtuemart_product_id']);\n if((int)$id>0)\n {\n $_data['id'] = $id;\n }\n// $_data['intvalue'] = iconv('windows-1251','utf-8',$data[3]);\n $_data['intvalue'] = str_replace(',', '.', iconv('windows-1251','utf-8',$data[3]));\n if(!$this->_save($_data))\n {\n $msg = 'ERROR';\n }\n }\n fclose($fp);\n }\n else\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_OPEN_TO_IMPORT'));\n }\n return array(TRUE,$msg);\n }", "protected function loadFromFile() {\n $columns = [];\n\n while ( ! $this->file->eof()) {\n $row = (array)$this->file->fgetcsv();\n\n if (empty($columns)) {\n $columns = $row;\n continue;\n }\n\n $row = array_filter($row);\n\n if (empty($row)) {\n continue;\n }\n\n $attributes = array_fill_keys($columns, null);\n\n foreach ($row as $index => $value) {\n $attributes[$columns[$index]] = $value;\n }\n\n $model = $this->model->newInstance($attributes, true);\n\n $this->records[$model->id] = $model;\n }\n }", "public function readCsv($source) {\n $file = fopen($source, 'r');\n while (($line = fgetcsv($file)) !== FALSE) {\n //$line is an array of the csv elements\n $array_from_csv[] = $line;\n }\n fclose($file);\n\n return $array_from_csv;\n }", "private function read_csv()\n {\n $address_book = [];\n $handle = fopen($this->filename, 'r');\n while(!feof($handle)){\n $row = fgetcsv($handle);\n if(is_array($row)){\n $address_book[] = $row;\n }\n }\n fclose($handle);\n return $address_book;\n }", "public function getLine(){\n $obj = new SplFileObject($this->_csv_file);\n $obj->seek($this->_counter);\n if($this->_counter < $this->_number_of_lines){\n $this->_counter++;\n $arr = $obj->fgetcsv($this->_delimiter);\n }else{\n $arr = null;\n }\n $obj = null;\n return $arr;\n }", "public function readCsvCBS() {\n // Check if the source file is available\n if( ! self::isFileAvailable( self::CBS_INHABITANTS_SOURCE_CSV_FILE ) ) {\n return false;\n }\n $header = NULL;\n $data = array();\n if (($handle = fopen( self::CBS_INHABITANTS_SOURCE_CSV_FILE, 'r')) !== FALSE) {\n while (($row = fgetcsv($handle, 1000, SELF::CBS_INHABITANTS_SOURCE_CSV_FILE_DELIMITER )) !== FALSE) {\n if( ! $header ) { // first line is the header\n $fieldsCount = count( $row );\n $header = array( self::HEADER_CITY_CODE, self::HEADER_CITY_NAME, self::HEADER_INHABITANTS );\n } else { // add a line of csv-data to our data array\n if( count( $row ) == $fieldsCount ) {\n $data[] = array_combine($header, array( $row[0], $row[1], $row[2] ) );\n }\n }\n }\n fclose($handle);\n }\n return $data;\n }", "protected function openFile() {}", "public function loadCSV($file){\n\t\t$file = str_replace('\\\\', '/', $file);\n\t\t$sql = \"LOAD DATA INFILE '\" . $file . \"' INTO TABLE \" . $this->_table . \" FIELDS TERMINATED BY \\\"|\\\" ENCLOSED BY '\\\"' LINES TERMINATED BY \\\"\\n\\\"\";\n\t\t$sql .= \" IGNORE 1 LINES \\n\";\n\n\t\t$fh = fopen($file, 'r');\n\t\t$columns = fgetcsv($fh, 0, '|', '\"');\n\t\tfclose($fh);\n\n\t\t$sql .= '(' . implode(', ',$columns) . ');';\n\n\t\t$this->addQuery($sql, 'Import data from ' . $file . ' file');\n\n\t\treturn $this;\n\t}", "protected function load_csv_data() {\n $dataset = $this->createCsvDataSet(array(\n usermoodle::TABLE => elispm::file('tests/fixtures/user_moodle.csv')\n ));\n $this->loadDataSet($dataset);\n }", "public function close_csv() {\n fclose($this->file);\n }", "function readLine(){\n $data = fgetcsv($this->handle,0,\";\");\n return $data; \n \n }", "private function get_csv_data() {\n if (!is_resource($this->fh) || get_resource_type($this->fh) !== \"stream\") {\n $this->log_it(\"CSV file not open when get_csv_data() called.\");\n return false;\n }\n\n // Consume/discard header row, if it exists.\n if (HEADER_ROW_EXISTS) {\n fgets($this->fh);\n $row_num = 2;\n } else {\n $row_num = 1;\n }\n\n $graded_reg_codes = STUDENT_REGISTERED_CODES;\n $audit_reg_codes = is_null(STUDENT_AUDIT_CODES) ? array() : STUDENT_AUDIT_CODES;\n $latedrop_reg_codes = is_null(STUDENT_LATEDROP_CODES) ? array() : STUDENT_LATEDROP_CODES;\n $all_valid_reg_codes = array_merge($graded_reg_codes, $audit_reg_codes, $latedrop_reg_codes);\n $unexpected_term_codes = array();\n\n // Read and assign csv rows into $this->data array\n $row = fgetcsv($this->fh, 0, CSV_DELIM_CHAR);\n while(!feof($this->fh)) {\n // Course is comprised of an alphabetic prefix and a numeric suffix.\n $course = strtolower($row[COLUMN_COURSE_PREFIX] . $row[COLUMN_COURSE_NUMBER]);\n\n // Trim whitespace from all fields in $row.\n array_walk($row, function(&$val, $key) { $val = trim($val); });\n\n // Remove any leading zeroes from \"integer\" registration sections.\n if (ctype_digit($row[COLUMN_SECTION])) $row[COLUMN_SECTION] = ltrim($row[COLUMN_SECTION], \"0\");\n\n switch(true) {\n // Check that $row has an appropriate student registration.\n case array_search($row[COLUMN_REGISTRATION], $all_valid_reg_codes) === false:\n // Skip row.\n break;\n\n // Check that $row is associated with the current term (if check is enabled)\n // Assume this check is OK, when EXPECTED_TERM_CODE is null (check disabled)\n case is_null(EXPECTED_TERM_CODE) ? false : $row[COLUMN_TERM_CODE] !== EXPECTED_TERM_CODE:\n // Note the unexpected term code for logging, if not already noted.\n if (array_search($row[COLUMN_TERM_CODE], $unexpected_term_codes) === false) {\n $unexpected_term_codes[] = $row[COLUMN_TERM_CODE];\n }\n break;\n\n // Check that $row is associated with the course list.\n case array_search($course, $this->course_list) !== false:\n if (validate::validate_row($row, $row_num)) {\n // Include $row\n $this->data[$course][] = $row;\n\n // $row with a blank email is included, but it is also logged.\n if ($row[COLUMN_EMAIL] === \"\") {\n $this->log_it(\"Blank email found for user {$row[COLUMN_USER_ID]}, row {$row_num}.\");\n }\n } else {\n // There is a problem with $row, so log the problem and skip.\n $this->invalid_courses[$course] = true;\n $this->log_it(validate::$error);\n }\n break;\n\n // Check that the $row is associated with a mapped course.\n case array_key_exists($course, $this->mapped_courses):\n // Also verify that the section is mapped.\n $section = $row[COLUMN_SECTION];\n if (array_key_exists($section, $this->mapped_courses[$course])) {\n $m_course = $this->mapped_courses[$course][$section]['mapped_course'];\n if (validate::validate_row($row, $row_num)) {\n // Include $row.\n $row[COLUMN_SECTION] = $this->mapped_courses[$course][$section]['mapped_section'];\n $this->data[$m_course][] = $row;\n\n // $row with a blank email is allowed, but it is also logged.\n if ($row[COLUMN_EMAIL] === \"\") {\n $this->log_it(\"Blank email found for user {$row[COLUMN_USER_ID]}, row {$row_num}.\");\n }\n } else {\n // There is a problem with $row, so log the problem and skip.\n $this->invalid_courses[$m_course] = true;\n $this->log_it(validate::$error);\n }\n }\n break;\n\n default:\n // Skip row by default.\n break;\n\n } // END switch (true)\n\n $row = fgetcsv($this->fh, 0, CSV_DELIM_CHAR);\n $row_num++;\n }\n\n // Log any unexpected term codes.\n // This may provide a notice that the next term's data is available.\n if (!empty($unexpected_term_codes)) {\n $msg = \"Unexpected term codes in CSV: \";\n $msg .= implode(\", \", $unexpected_term_codes);\n $this->log_it($msg);\n }\n\n /* ---------------------------------------------------------------------\n There may be \"fake\" or \"practice\" courses in Submitty that shouldn't be\n altered by the autofeed. These courses will have no enrollments in the\n csv file as these courses are not recognized by the registrar.\n --------------------------------------------------------------------- */\n\n // Filter out any \"empty\" courses so they are not processed.\n // There shouldn't be any \"empty\" course data, but this is just in case.\n $this->data = array_filter($this->data, function($course) { return !empty($course); }, 0);\n\n // Most runtime involves the database, so we'll release the CSV now.\n $this->close_csv();\n\n // Done.\n return true;\n }", "public static function file_get_contents_csv($path, $delimiter = ',') {\n $rows = [];\n if (($handle = fopen($path, \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, null, $delimiter)) !== FALSE) {\n $rows[] = $data;\n }\n fclose($handle);\n }\n return $rows;\n }", "public function parse()\n {\n if ($handle = fopen($this->csv, 'r'))\n {\n while ($data = fgetcsv($handle, \",\"))\n {\n $this->dataArray[] = $data;\n }\n }\n fclose($handle);\n }", "function __construct($file){\n\t\tif (!ChartModel::isCSV($file)){\n\t\t\tthrow new Exception('File path given to ChartModel is not a CSV.');\n\t\t}\n\t\t// arbitrary comment\n\t\t$this->csv = file_get_contents($file);\n\n\t\t// kind of need some data\n\t\tif (!is_string($this->csv)){\n\t\t\tthrow new Exception('Error trying to read csv file using ChartModel. Verify file exists and check permissions.');\n\t\t}\n\n\t\t$this->readCSV();\n\t}", "function readCSV($csvFile, $array){\n $file_handle = fopen($csvFile, 'r');\n while (!feof($file_handle)) {\n $line_of_text[] = fgetcsv($file_handle, 0, $array['delimiter']);\n }\n array_shift($line_of_text);\n array_pop($line_of_text);\n fclose($file_handle);\n return $line_of_text;\n}", "function readUploadedCSV($tmp_name) {\n\t $lines = array();\n\n\t ini_set('auto_detect_line_endings',1);\n\t $handle = fopen($tmp_name, \"r\");\n\t while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n\t\t array_push($lines,$data);\t\t\t \n\t }\n\t return $lines;\n }", "public function get()\n {\n $is_first = true;\n $keys = [];\n $data = [];\n $count = 0;\n\n $file = new SplFileObject($this->csv_file_path);\n\n while(!$file->eof())\n {\n /**\n * $file->fgets()\n * 呼び出す度に次の行に移動してしまうので注意する\n */\n $input = $file->fgets();\n\n /**\n * 空行は除外する\n */\n if(empty($input)) continue;\n\n $line = str_getcsv($input);\n\n if($is_first)\n {\n $keys = $line;\n $count = count($keys);\n $is_first = false;\n continue;\n }\n\n /**\n * ヘッダー行と異なる要素数のデータは除外する\n */\n if($count != count($line)) continue;\n\n foreach ($keys as $index => $key) {\n $tmp[$key] = $line[$index];\n }\n $data[] = $tmp;\n }\n return $data;\n }", "function readCsv($fileName) {\n\n\t// Lecture du fichier src :\n\t$myfile = fopen($fileName, \"r\") or die(\"Unable to open file!\");\n\t$dataStr = fread($myfile,filesize($fileName));\n\tfclose($myfile);\n\n\t$lines = explode(\"\\n\", $dataStr);\n\t$days = array();\n\n\tforeach ($lines as $line) {\n\t\t$temp = explode(\";\", $line);\n\t\tif (count($temp) == 2) {\n\t\t\tarray_push($days, new Day($temp[0], $temp[1]));\n\t\t}\n\t}\n\treturn $days;\n}", "abstract public function convert_from_csv($source);", "abstract protected function openReader($filePath);", "public function readFile()\r\n {\r\n\r\n $fileName_FaceBook = Request::all();\r\n\r\n //dd($fileName_FaceBook['From']);\r\n //dd($fileName_FaceBook);\r\n\r\n $dateStart = Carbon::parse($fileName_FaceBook['dateStartFrom']);\r\n $dateEnd = Carbon::parse($fileName_FaceBook['dateEndsTo']);\r\n\r\n dump($dateStart);\r\n dump($dateEnd);\r\n\r\n // The object returned by the file method is an instance of the Symfony\\Component\\HttpFoundation\\File\\UploadedFile\r\n\r\n $path = $fileName_FaceBook['fileName_FaceBook']->getRealPath();\r\n $name =$fileName_FaceBook['fileName_FaceBook']->getClientOriginalName();\r\n //dump($fileName_FaceBook['fileName_FaceBook']->getClientOriginalName());\r\n\r\n $this->readMetricsFromCSV($path, $dateStart, $dateEnd);\r\n\r\n\r\n }", "public function import_read_record()\n\t{\n // phpcs:enable\n\t\tglobal $conf;\n\n\t\t$arrayres=fgetcsv($this->handle, 100000, $this->separator, $this->enclosure, $this->escape);\n\n\t\t// End of file\n\t\tif ($arrayres === false) return false;\n\n\t\t//var_dump($this->handle);\n\t\t//var_dump($arrayres);exit;\n\t\t$newarrayres=array();\n\t\tif ($arrayres && is_array($arrayres))\n\t\t{\n\t\t\tforeach($arrayres as $key => $val)\n\t\t\t{\n\t\t\t\tif (! empty($conf->global->IMPORT_CSV_FORCE_CHARSET))\t// Forced charset\n\t\t\t\t{\n\t\t\t\t\tif (strtolower($conf->global->IMPORT_CSV_FORCE_CHARSET) == 'utf8')\n\t\t\t\t\t{\n\t\t\t\t\t\t$newarrayres[$key]['val']=$val;\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\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$newarrayres[$key]['val']=utf8_encode($val);\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\t// Autodetect format (UTF8 or ISO)\n\t\t\t\t{\n\t\t\t\t\tif (utf8_check($val))\n\t\t\t\t\t{\n\t\t\t\t\t\t$newarrayres[$key]['val']=$val;\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\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$newarrayres[$key]['val']=utf8_encode($val);\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->col=count($newarrayres);\n\t\t}\n\n\t\treturn $newarrayres;\n\t}", "public function parse()\n {\n $this->file = fopen($this->filename, 'r');\n $lineCount = 0;\n\n while (($line = fgetcsv(\n $this->file,\n 0,\n $this->delimiter,\n $this->enclosure,\n $this->escape\n )) !== false) {\n if ($lineCount++ == 0) {\n $line[0] = StringUtils::removeBOM($line[0]);\n $this->setHeader($line);\n\n if ($this->hasHeader) {\n continue;\n }\n }\n\n $this->parseLine($line);\n }\n\n fclose($this->file);\n }", "public function read() \n {\n\n if ($this->is_csv) \n {\n return $this->read_csv();\n }\n else\n {\n return $this->read_lines();\n }\n \n }", "public function parse_csv () {\n $data = array();\n $header = fgetcsv($this->file);\n array_walk($header, create_function('&$val', '$val = trim($val);'));\n while ($row = fgetcsv($this->file)) {\n array_walk($row, create_function('&$val', '$val = trim($val);'));\n $data[] = array_combine($header, $row);\n \n }\n\n return $data;\n }", "private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }", "public function createCsv(){\n $this->header = NULL;\n $this->csv = array();\n if (($handle = fopen($this->url, 'r')) !== FALSE)\n {\n while (($row = fgetcsv($handle, 1000, $this->separatore)) !== FALSE)\n {\n if(!$this->header)\n $this->header = $this->trimField($row);\n else\n $this->csv[] = array_combine($this->header, $this->trimField($row));\n }\n fclose($handle);\n }\n }", "private function read()\n {\n $out = fgetcsv($this->handle, null, $this->delimiter, $this->enclosure);\n\n if (!is_array($out)) {\n return $out;\n }\n\n if (config('csv.encoding.reader.enabled') === true) {\n foreach ($out as $k => $v) {\n $out[$k] = iconv(\n config('csv.encoding.reader.from'),\n config('csv.encoding.reader.to'),\n $v\n );\n }\n }\n\n return $out;\n }", "public function readFile()\n {\n $handle = fopen($this->fileSource, \"r\");\n $result = [];\n\n while ($csvLine = fgetcsv($handle, 1000, \",\")) {\n\n if ($this->header) {\n $this->header = false;\n } else {\n $operationDate = $csvLine[0];\n $userIdentificator = $csvLine[1];\n $userType = $csvLine[2];\n $operationType = $csvLine[3];\n $operationAmount = $csvLine[4];\n $operationCurrency = $csvLine[5];\n\n if (array_key_exists($userIdentificator, $this->users)) {\n $user = $this->users[$userIdentificator];\n } else {\n $user = new User($userIdentificator, $userType);\n $this->users[$userIdentificator] = $user;\n }\n\n try {\n $operation = new Operation(\n $operationDate, $operationType, $operationAmount, $this->currencies[$operationCurrency], $user\n );\n $result[] = $operation;\n } catch (\\Exception $e) {\n //echo $e->getMessage();\n }\n }\n }\n\n return $result;\n }", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "private function read_csv() //address book\n {\n $addresses = [];\n $handle = fopen($this->filename, \"r\");\n while (!feof($handle)) \n {\n $row = fgetcsv($handle);\n if(is_array($row)) \n {\n $addresses[] = $row;\n }\n }\n fclose($handle);\n return $addresses;\n }", "public function importCsv()\n {\n $file = fopen($_FILES['csvFile']['tmp_name'], \"r\");\n $payments = array();\n while (!feof($file)) {\n $row = fgetcsv($file, 0, \"\\t\");\n if (count($row) == 14 && $row[0] != \"Kirjauspäivä\") {\n $dateOfPayment = new \\DateTime($row[2]);\n $values = array(\n 'date_of_payment' => $dateOfPayment->format('Y-m-d H:i:s'),\n 'amount' => $this->makeFloat($row[3]),\n 'reference_number' => $row[8],\n 'amount_left' => 0,\n );\n $payments[] = new Payment($values);\n }\n }\n fclose($file);\n $insert = $this->paymentRepository->insert($payments);\n if ($insert !== true) {\n $message = \"Maksujen kirjaamisessa tapahtui virhe.<br />\" . $insert;\n $error = array(\"error\" => $message);\n ErrorService::setErrors($error);\n return;\n }\n Redirect::to(\"/maksut/syotto\", array(\"success\" => \"Maksut kirjattu onnistuneesti.\"));\n\n }", "public function load()\n {\n $this->data = array();\n $this->handler->rewind();\n\n if ($this->headers) {\n $headers = $this->handler->fgetcsv();\n }\n\n while (! $this->handler->eof()) {\n $row = $this->handler->fgetcsv();\n\n // @NOTE: PHP Bug: 55807 and 61032, returns new line char as null.\n if (is_null($row[0])) continue;\n\n $row = ($this->headers ? array_combine($headers, $row) : $row);\n array_push($this->data, $row);\n }\n\n return $this;\n }", "function load_product_csv_db($csv_db_file){\n if (($fh = fopen($csv_db_file, \"r\")) !== FALSE){\n $temp_arr = array();\n while (($data = fgetcsv($fh, 1000, \",\")) !== FALSE){\n $tmp_product = new Product($data[0], $data[1]);\n if($data[2] !== ''){\n $tmp_product->picture = $data[2];\n }\n array_push($temp_arr, $tmp_product);\n }\n $this->db = $temp_arr;\n fclose($fh); // Close the file\n }else{\n // echo 'file not found!';\n } //end open file\n return $this->db;\n }", "function GetValuesFromCSV($path)\n{\n\n if (($handle = fopen($path, 'a+')) !== FALSE) {\n $animaux = array();\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n list($Nope, $animaux[$data[0]]) = $data;\n\n }\n fclose($handle);\n return $animaux;\n\n }else{\n return false;\n }\n}", "function parse_file($filename,$delimiter = \",\") {\n if(!file_exists($filename) || !is_readable($filename))\n return FALSE;\n \n $header = NULL;\n $data = array();\n if (($handle = fopen($filename, 'r')) !== FALSE)\n {\n while (($row = fgetcsv($handle, 100000, $delimiter)) !== FALSE)\n {\n if($row[0]!=NULL)\n $data[] = $row;\n }\n fclose($handle);\n }\n return $data;\n }", "protected function analyzeCsv() {\n $options = array(\n 'delimiter' => ',',\n 'enclosure' => '\"'\n );\n $possibleDelimiters = array(\n '\"',\n \"'\"\n );\n $contents = file_get_contents($this->fileName);\n $firstChar = substr($contents, 0, 1);\n\n if (in_array($firstChar, $possibleDelimiters)) {\n $options['enclosure'] = $firstChar;\n }\n\n if (substr_count($contents, ';') > substr_count($contents, ',')) {\n $options['delimiter'] = ';';\n }\n return $options;\n\n }", "public function get(){\r\n $file= fopen($_GET['filename'],\"r\");\r\n $this->html .= '<h1>Table</h1>';\r\n $this->html .= '<table border =\"1\">';\r\n //check the file till end of the file\r\n while (!feof($file)) {\r\n $line=fgetcsv($file);\r\n\r\n //Type cast to array\r\n $a=(array) $line;\r\n //convert every array into one cell\r\n foreach ($a as $value ) {\r\n $this->html .= \"<td> $value </td>\";\r\n }\r\n $this->html .= '</tr>';\r\n }\r\n $this->html .= '</table>';\r\n\r\n //close the file\r\n fclose($file);\r\n\r\n}", "public function __construct()\n {\n\n /**\n * City CSV File Path\n */\n $this->file = fopen(resource_path('/db_data/us_places.csv'), 'r');\n /**\n * City CSV Delimiter\n */\n $this->delimiter = \",\";\n $this->iterator = 0;\n /**\n * Header to combine to each CSV row\n * same as DB City columns\n */\n $this->header = ['id', 'country_code', 'state_id', 'lga_id', 'name', 'latitude', 'longitude', 'timezone', 'slug'];\n }", "public function parseCsv($file)\n {\n $csv = file($file->getPathname());\n //if using the old MacOS delimiter, it fails. However we can rescue\n //it by using explode\n if (count($csv) < 2) {\n $csv = explode(\"\\r\", $csv[0]);\n }\n //grab the header\n $headerStr = array_shift($csv);\n $header = str_getcsv($headerStr);\n\n array_walk($csv, [$this, 'csvToArray'], $header);\n\n //This little loop removes the students IDs present and calculates a hash of them.\n foreach ($csv as $key => $studentData) {\n $studentID = (int)$studentData['StudentID'];\n $studentData['StudentID'] = hexdec(substr(sha1($studentID), 0, 10));\n $csv[$key] = $studentData;\n }\n return $csv;\n }", "protected function _init(){\n ini_set('auto_detect_line_endings', 1);\n $this->_init = true;\n $this->_handle = fopen($this->_csv, \"r\");\n if(!$this->_handle){\n throw new Exception('Could not open file: ' . $this->_csv);\n }\n }", "function __construct($file, $delimiter='auto', $length=0)\r\n {\r\n if (!file_exists($file)) {\r\n throw new FileNotFoundException('CSV file not found!');\r\n }\r\n \r\n ini_set(\"auto_detect_line_endings\", true);\r\n \r\n $this->handle = fopen($file, \"r\");\r\n $this->setDelimiter($delimiter);\r\n $this->delimiter = $this->getDelimiter();\r\n $this->length = $length;\r\n $this->setHeader();\r\n }", "public function import($csv)\n {\n // convert to UTF-8\n $head = substr($csv, 0, 4096);\n $charset = rcube_charset::detect($head, RCUBE_CHARSET);\n $csv = rcube_charset::convert($csv, $charset);\n $csv = preg_replace(array('/^[\\xFE\\xFF]{2}/', '/^\\xEF\\xBB\\xBF/', '/^\\x00+/'), '', $csv); // also remove BOM\n $head = '';\n $prev_line = false;\n\n $this->map = array();\n $this->gmail_map = array();\n\n // Parse file\n foreach (preg_split(\"/[\\r\\n]+/\", $csv) as $line) {\n if (!empty($prev_line)) {\n $line = '\"' . $line;\n }\n\n $elements = $this->parse_line($line);\n\n if (empty($elements)) {\n continue;\n }\n\n // Parse header\n if (empty($this->map)) {\n $this->parse_header($elements);\n if (empty($this->map)) {\n break;\n }\n }\n // Parse data row\n else {\n // handle multiline elements (e.g. Gmail)\n if (!empty($prev_line)) {\n $first = array_shift($elements);\n\n if ($first[0] == '\"') {\n $prev_line[count($prev_line)-1] = '\"' . $prev_line[count($prev_line)-1] . \"\\n\" . substr($first, 1);\n }\n else {\n $prev_line[count($prev_line)-1] .= \"\\n\" . $first;\n }\n\n $elements = array_merge($prev_line, $elements);\n }\n\n $last_element = $elements[count($elements)-1];\n if ($last_element[0] == '\"') {\n $elements[count($elements)-1] = substr($last_element, 1);\n $prev_line = $elements;\n continue;\n }\n $this->csv_to_vcard($elements);\n $prev_line = false;\n }\n }\n }", "public function __construct ($file_path) {\n if (is_file($file_path)) {\n if ($this->valid_csv($file_path)) {\n try {\n if (!$this->file = fopen($file_path, \"r\")) {\n throw new Exception ('Failed to open file.');\n }\n } catch (Exception $e) {\n die (Utility::log ('ERROR', $e->getMessage()));\n }\n } else {\n die (Utility::log ('ERROR', 'Invalid file. Please specify a valid CSV file.'));\n }\n\n } else {\n die (Utility::log ('ERROR', 'File does not exist. Please specify a valid CSV file.'));\n }\n }", "function getDataCsv($filename) {\n return array_map('str_getcsv', file(\"csv/{$filename}\"));\n}", "function parse( $file ) {\n\t\t$parser = new CSV_Parser();\n\t\treturn $parser->parse( $file );\n\t}", "public function readCSV(): array\n {\n $mydata = [];\n\n if ((int)$this->indata['newFileUid'] < 1) {\n return $mydata;\n }\n\n $fileAbsolutePath = $this->getFileAbsolutePath((int)$this->indata['newFileUid']);\n\n $delimiter = $this->indata['delimiter'] ?: 'comma';\n $encaps = $this->indata['encapsulation'] ?: 'doubleQuote';\n $delimiter = ($delimiter === 'comma') ? ',' : $delimiter;\n $delimiter = ($delimiter === 'semicolon') ? ';' : $delimiter;\n $delimiter = ($delimiter === 'colon') ? ':' : $delimiter;\n $delimiter = ($delimiter === 'tab') ? \"\\t\" : $delimiter;\n $encaps = ($encaps === 'singleQuote') ? \"'\" : $encaps;\n $encaps = ($encaps === 'doubleQuote') ? '\"' : $encaps;\n\n ini_set('auto_detect_line_endings', true);\n $handle = fopen($fileAbsolutePath, 'r');\n if ($handle === false) {\n return $mydata;\n }\n\n while (($data = fgetcsv($handle, 10000, $delimiter, $encaps)) !== false) {\n // remove empty line in csv\n if ((count($data) >= 1)) {\n $mydata[] = $data;\n }\n }\n fclose($handle);\n reset($mydata);\n $mydata = $this->convCharset($mydata);\n ini_set('auto_detect_line_endings', false);\n return $mydata;\n }", "function csvToArray($file, $delimiter) { \n if (($handle = fopen($file, 'r')) !== FALSE) { \n $i = 0; \n while (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) { \n for ($j = 0; $j < count($lineArray); $j++) { \n $arr[$i][$j] = $lineArray[$j]; \n } \n $i++; \n } \n fclose($handle); \n } \n return $arr; \n}", "public function getCSV() {\n $handle = fopen($this->_csv_file, \"r\");\n $array_line_full = array();\n\n while (($line = fgetcsv($handle, 0, \",\")) !== FALSE) {\n $array_line_full[] = $line;\n }\n fclose($handle);\n return $array_line_full;\n }", "public function initializeObject()\n {\n if (!isset($this->options['csvFilePath']) || !is_string($this->options['csvFilePath'])) {\n throw new InvalidArgumentException('Missing or invalid \"csvFilePath\" in preset part settings', 1429027715);\n }\n\n $this->csvFilePath = $this->options['csvFilePath'];\n if (!is_file($this->csvFilePath)) {\n throw new \\Exception(sprintf('File \"%s\" not found', $this->csvFilePath), 1427882078);\n }\n\n if (isset($this->options['csvDelimiter'])) {\n $this->csvDelimiter = $this->options['csvDelimiter'];\n }\n\n if (isset($this->options['csvEnclosure'])) {\n $this->csvEnclosure = $this->options['csvEnclosure'];\n }\n\n $this->logger->debug(sprintf('%s will read from \"%s\", using %s as delimiter and %s as enclosure character.', get_class($this), $this->csvFilePath, $this->csvDelimiter, $this->csvEnclosure));\n }", "public function csvImport(Request $request)\n {\n Excel::import(new CustomersImport, $request->file('csv')->store('temp'));\n return back();\n }", "public function Read(){\n\t\tif($this->file_type == 'csv'){\n\t\t\t$lines = explode( \"\\n\", file_get_contents( $this->getBasePath().'/'.$this->getFilePath()) );\n\t\t\t$headers = str_getcsv( array_shift( $lines ) );\n\t\t\t$data = array();\n\t\t\tforeach ( $lines as $line ) {\n\t\t\t\t$row = array();\n\t\t\t\tforeach ( str_getcsv( $line ) as $key => $field )\n\t\t\t\t\t$row[ $headers[ $key ] ] = $field;\n\t\t\t\t$row = array_filter( $row );\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t}\n\t\tif($this->file_type == 'json'){\n\t\t\t$string = file_get_contents($this->getBasePath().'/'.$this->getFilePath());\n\t\t\t$data = json_decode($string, true);\n\n\t\t}\n\t\n\t\treturn $data;\n\n\t }", "public function getCsv() {\r\n $result = array();\r\n if (file_exists($this->csv)) {\r\n\r\n if (($csvfile = fopen($this->csv, \"r\")) !== FALSE) {\r\n $row = 0;\r\n while (($data = fgetcsv($csvfile, 1000, \",\")) !== FALSE) {\r\n if ($row == 0) {\r\n foreach ($data as $value) {\r\n $result['headers'][] = $value;\r\n }\r\n }\r\n else {\r\n $result[$row] = array_combine($result['headers'], $data);\r\n }\r\n $row++;\r\n }\r\n fclose($csvfile);\r\n }\r\n }\r\n return $result;\r\n }", "public function import()\n\t{\n\t\t$optionStart = $this->importOptions->getOptionValue(\"start\", \"0\");\n\t\t$optionLength = $this->importOptions->getOptionValue(\"length\", \"0\");\n\t\t$optionCols = $this->importOptions->getOptionValue(\"cols\", \"0\");\n\t\t$optionDelimiter = $this->importOptions->getOptionValue(\"delimiter\", \";\");\n\t\t$optionEnclosure = $this->importOptions->getOptionValue(\"enclosure\", \"\");\n\t\t$optionType = $this->importOptions->getOptionValue(\"objectType\", \"\");\n\t\tif($optionType == \"\")\n\t\t{\n\t\t\tthrow new FileImportOptionsRequiredException(gettext(\"Missing option objectType for file import\"));\n\t\t}\n\n\t\t//create object controller\n\t\t$objectController = ObjectController::create();\n\t\t$config = CmdbConfig::create();\n\n\t\t//get mapping of csv columns to object fiels\n\t\t$objectFieldConfig = $config->getObjectTypeConfig()->getFields($optionType);\n\t\t$objectFieldMapping = Array();\n\t\t$foreignKeyMapping = Array();\n $assetIdMapping = -1;\n $activeMapping = -1;\n\t\tfor($i = 0; $i < $optionCols; $i++)\n\t\t{\n\t\t\t$fieldname = $this->importOptions->getOptionValue(\"column$i\", \"\");\n\t\t\t//assetId mapping\n\t\t\tif($fieldname == \"yourCMDB_assetid\")\n\t\t\t{\n\t\t\t\t$assetIdMapping = $i;\n }\n\t\t\t//active state mapping\n\t\t\tif($fieldname == \"yourCMDB_active\")\n {\n\t\t\t\t$activeMapping = $i;\n\t\t\t}\n\t\t\t//foreign key mapping\n\t\t\telseif(preg_match('#^yourCMDB_fk_(.*)/(.*)#', $fieldname, $matches) == 1)\n\t\t\t{\n\t\t\t\t$foreignKeyField = $matches[1];\n\t\t\t\t$foreignKeyRefField = $matches[2];\n\t\t\t\t$foreignKeyMapping[$foreignKeyField][$foreignKeyRefField] = $i;\n\t\t\t}\n\t\t\t//fielf mapping\n\t\t\telseif($fieldname != \"\")\n\t\t\t{\n\t\t\t\t$objectFieldMapping[$fieldname] = $i;\n\t\t\t}\n\t\t}\n\n\t\t//open file\t\t\n\t\t$csvFile = fopen($this->importFilename, \"r\");\n\t\tif($csvFile == FALSE)\n\t\t{\n\t\t\tthrow new FileImportException(gettext(\"Could not open file for import.\"));\n\t\t}\n\n\t\t//create or update objects for each line in csv file\n\t\t$i = 0;\n\t\twhile(($line = $this->readCsv($csvFile, 0, $optionDelimiter, $optionEnclosure)) !== FALSE)\n\t\t{\n\t\t\t//\n\t\t\tif($i >= ($optionLength + $optionStart) && $optionLength != 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//check start of import\n\t\t\tif($i >= $optionStart)\n\t\t\t{\n\t\t\t\t//generate object fields\n\t\t\t\t$objectFields = Array();\n\t\t\t\tforeach(array_keys($objectFieldMapping) as $objectField)\n\t\t\t\t{\n\t\t\t\t\tif(isset($line[$objectFieldMapping[$objectField]]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$objectFields[$objectField] = $line[$objectFieldMapping[$objectField]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//resolve foreign keys\n\t\t\t\tforeach(array_keys($foreignKeyMapping) as $foreignKey)\n\t\t\t\t{\n\t\t\t\t\tforeach(array_keys($foreignKeyMapping[$foreignKey]) as $foreignKeyRefField)\n\t\t\t\t\t{\n\t\t\t\t\t\t//set foreign key object type\n\t\t\t\t\t\t$foreignKeyType = Array(preg_replace(\"/^objectref-/\", \"\", $objectFieldConfig[$foreignKey]));\n\t\t\t\t\t\t$foreignKeyLinePosition = $foreignKeyMapping[$foreignKey][$foreignKeyRefField];\n\t\t\t\t\t\tif(isset($line[$foreignKeyLinePosition]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$foreignKeyRefFieldValue = $line[$foreignKeyLinePosition];\n\t\n\t\t\t\t\t\t\t//get object defined by foreign key\n\t\t\t\t\t\t\t$foreignKeyObjects = $objectController->getObjectsByField(\t$foreignKeyRefField, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyRefFieldValue, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyType, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull, 0, 0, $this->authUser);\n\t\t\t\t\t\t\t//if object was found, set ID as fieldvalue\n\t\t\t\t\t\t\tif(isset($foreignKeyObjects[0]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$objectFields[$foreignKey] = $foreignKeyObjects[0]->getId();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }\n\n //set active state\n $active = \"A\";\n if($activeMapping != -1 && isset($line[$activeMapping]))\n {\n if($line[$activeMapping] == \"A\" || $line[$activeMapping] == \"N\")\n {\n $active = $line[$activeMapping];\n }\n }\n\n\n\t\t\t\t//only create objects, if 1 or more fields are set\n\t\t\t\tif(count($objectFields) > 0)\n\t\t\t\t{\n\t\t\t\t\t//check if assetID is set in CSV file for updating objects\n\t\t\t\t\tif($assetIdMapping != -1 && isset($line[$assetIdMapping]))\n\t\t\t\t\t{\n $assetId = $line[$assetIdMapping];\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$objectController->updateObject($assetId, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(Exception $e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if object was not found, add new one\n\t\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if not, create a new object\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//generate object and save to datastore\n\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//increment counter\n\t\t\t$i++;\n\t\t}\n\n\t\t//check, if CSV file could be deleted\n\t\t$deleteFile = false;\n\t\tif(feof($csvFile))\n\t\t{\n\t\t\t$deleteFile = true;\n\t\t}\n\n\t\t//close file\n\t\tfclose($csvFile);\n\n\t\t//delete file from server\n\t\tif($deleteFile)\n\t\t{\n\t\t\tunlink($this->importFilename);\n\t\t}\n\n\t\t//return imported objects\n\t\treturn $i;\n\t}", "function csvToArray($file, $delimiter) {\n if (($handle = fopen($file, 'r')) !== FALSE) {\n $i = 0;\n while (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) {\n for ($j = 0; $j < count($lineArray); $j++) {\n $arr[$i][$j] = $lineArray[$j];\n }\n $i++;\n }\n fclose($handle);\n }\n return $arr;\n}", "function csvToArray($file, $delimiter) {\n if (($handle = fopen($file, 'r')) !== FALSE) {\n $i = 0;\n while (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) {\n for ($j = 0; $j < count($lineArray); $j++) {\n $arr[$i][$j] = $lineArray[$j];\n }\n $i++;\n }\n fclose($handle);\n }\n return $arr;\n}", "function csvToArray($file, $delimiter) {\r\n\tif (($handle = fopen($file, 'r')) !== FALSE) {\r\n\t\t$i = 0;\r\n\t\twhile (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) {\r\n\t\t\tfor ($j = 0; $j < count($lineArray); $j++) {\r\n\t\t\t\t$arr[$i][$j] = $lineArray[$j];\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\tfclose($handle);\r\n\t}\r\n\treturn $arr;\r\n}", "function bit_admin_import_csv( $playid ) {\n}", "function importAll() {\n $row = 1;\n $data = array();\n if ($GLOBALS[\"handle\"]) {\n while (($line = fgetcsv($GLOBALS[\"handle\"])) !== false) {\n \n if ($row == 1 || $row == 2) { $row++; continue; } //skip rows 1 and 2.\n \n $identify = rtrim(sprintf(\"%04d\\n\", $line[1])).ltrim(sprintf(\"%04d\\n\", $line[3]));\n $data[$identify] = array(\"cityCode\"=>$line[1], \"cityName\"=>$line[2], \"streetCode\"=>$line[3], \"streetName\"=>$line[4]);\n $row++;\n }\n fclose($GLOBALS[\"handle\"]);\n } else {\n return 0; //error read file\n }\n return $data;\n}", "private function valid_csv ($file_path) {\n $csv_mime_types = [ \n 'text/csv',\n 'text/plain',\n 'application/csv',\n 'text/comma-separated-values',\n 'application/excel',\n 'application/vnd.ms-excel',\n 'application/vnd.msexcel',\n 'text/anytext',\n 'application/octet-stream',\n 'application/txt',\n ];\n $finfo = finfo_open( FILEINFO_MIME_TYPE );\n $mime_type = finfo_file( $finfo, $file_path );\n\n return in_array( $mime_type, $csv_mime_types );\n }", "private function read_csv() //public function read_address_book()\n { //code to read file $this->filename\n $handle = fopen($this->filename, 'r');\n $address_book= []; //read each line of CSV and add rows to empty addresses array\n \n \n while(!feof($handle)){\n $row = fgetcsv($handle);\n if(is_array($row)){\n $address_book[] = $row; //does the same thing as array_push($address_book, $row); \n }\n }\n fclose($handle);\n return $address_book;\n }", "public function csvData()\n {\n }", "private function importCSV($filename)\n\t{\n\t\t$path = $this->localdir . \"/\" . $filename;\n\t\tif (file_exists($path)) {\n\t\t\t$files = $this->csv_to_array($path, $this->separator);\n// \t\t\tVideodeskCall::importCsv($files, $this->shop->id);\n\t\t\tVideodeskCall::importCsv($files, 1);\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function fromCsvFile(string $path, bool $withHeader = self::WITH_HEADER): array\n {\n $file = fopen($path, \"r\");\n\n if (!$file) {\n throw new \\InvalidArgumentException(\"Could not open file: {$path}\");\n }\n\n $result = [];\n $header = [];\n if ($withHeader) {\n $line = fgets($file);\n $header = str_getcsv($line);\n }\n\n while (!feof($file)) {\n $line = fgets($file);\n if (!$line) {\n continue;\n }\n $result[] = $withHeader\n ? array_combine($header, str_getcsv($line))\n : str_getcsv($line);\n }\n fclose($file);\n\n return $result;\n }", "public function read($path)\n {\n $data = array();\n\n $header = null;\n $handle = fopen($path, 'r');\n while ($row = fgetcsv($handle, null, $this->options['delimiter'])) {\n if (is_null($header)) {\n $header = $row;\n } else {\n $data[] = array_combine($header, $row);\n }\n }\n fclose($handle);\n\n return $data;\n }", "public function testLoadCsvSimple()\n {//{{{\n $expect = array();\n $expect[0]['col1'] = 'Aa';\n $expect[0]['col2'] = 'Bb';\n $expect[1]['col1'] = 'Cc';\n $expect[1]['col2'] = 'Dd';\n\n $csv = CsvUtil::loadCsv(__DIR__.'/CsvUtilTest.csv');\n $this->assertEquals($expect, $csv);\n }", "function read_csv($db)\n {\n $query=\"INSERT into dishes(did,dname,resturant) values\";\n $temp=array();\n $handle=fopen('sample.csv', 'r');\n if(!$handle)\n {\n echo \"error\";\n }\n\n $temp=fgetcsv($handle);//skip the heading...\n\n while(!feof($handle))\n {\n $temp=fgetcsv($handle);\n $did=$db->mysqlready($temp[0]);\n $dname=$db->mysqlready($temp[1]);\n $dname=check_appro($dname);\n $rest=$db->mysqlready($temp[2]);\n $rest=check_appro($rest);\n $query.=\"($did,'$dname','$rest'),\";\n\n }\n $fquery=substr($query, 0,-1);\n $fquery.=\";\";\n $status=$db->query($fquery);\n\n if(!$status)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "protected function DoFormatCSV()\n\t{\t\t\n\t\t$csv_data = array_map( 'str_getcsv', file( $this->csv_temp_file ) );\n\t\t\n\t\t$dates = $csv_data[ 9 ];\n\t\t$values = $csv_data[ 10 ];\n\t\t\n\t\tfor( $i = 0; $i < sizeof( $dates ); $i++ ){\n\t\t\tif( empty( $dates[ $i ] ) ){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$this->data->AddList(\n\t\t\t\tarray(\n\t\t\t\t\t\"Date\" => $dates[ $i ],\n\t\t\t\t\t\"Volume\" => isset( $values[ $i ] ) ? (int)$values[ $i ] : 0\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t\n\t\tif( ! sizeof( $this->data->Chart ) ){\n\t\t\t$this->data = FALSE;\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "function parseCsv($file) {\n\t$fitments = array_map('str_getcsv', file($file));\n\n\t// Remove CSV header if present\n\tif ($fitments[0][0] == \"Year\") {\n\t\tunset($fitments[0]);\n\t}\n\n\treturn $fitments;\n}", "public function openFile() {\n $this->file = fopen($this->_dir . $this->_filename,\"r\");\n }", "public function getRecord()\n\t{\t\t\t\t\n\t\tif(isset($this->_handle))\n\t\t\treturn fgetcsv($this->_handle,null,$this->_columnDelimiter);\n\t\telse \n\t\t\treturn false;\n\t}", "public function getFile()\n {\n if(Input::hasfile('report')){\n \n $files=Input::file('report');\n $file=fopen($files,\"r\");\n \n // dd($file);\n while(($data=fgetcsv($file, 10000,\",\")) !== FALSE)\n {\n // $filename = $this->doSomethingLikeUpload($file);\n \n // Return it's location\n //return $filename;\n foreach($data as $dat){\n $result=BdtdcLanguage::create(array(\n 'name'=>$dat[0]\n ));\n }\n dd($result->toArray());\n }\n \n \n }\n }", "function import_csv($obj)\n\t{\n\t\t$param_array = func_get_args();\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::import_csv() - PARAMETER LIST : ', $param_array);\n\t\t\n\t\t\t$row = 0;\n\t\t\t\n\t\t\t$handle = fopen($obj->csv_file_path, \"r\");\n\t\t\t\n\t\t\twhile (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) \n\t\t\t{\n\t\t\t\t\n\t\t\t\tif($row > 0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$res = $this->fetch_flds($obj->cls_tbl, $obj->primary_fld, $obj->primary_fld . \" = '\" . $data[0] . \"'\");\n\t\t\t\t\t\n\t\t\t\t\tif($res[1] > 0)\n\t\t\t\t\t{//update the record\n\t\t\t\t\t\t$cond = $obj->primary_fld . \" = '\" . $data[0] . \"'\";\n\t\t\t\t\t\tdatabase_manipulation::update_record($obj, $cond, \"csv\", $data);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{//insert the record\n\t\t\t\t\t\tdatabase_manipulation::insert_record($obj, \"csv\", $data);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$row++;\n\t\t\t}\n\t\t\t\n\t\t\tfclose($handle);\n\t\t\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::import_csv() - Return Value : ', 'Importing Csv Data Into the Database.', true);\n\n\t}", "function processCSV($filename){\n $csv = array_map('str_getcsv', file($filename));\n\n return $csv;\n}", "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "protected function readLine()\n\t{\n\t\tif(!$this->handle) return false;\n\t\t$strLine = fgets($this->handle);\n\t\tif($strLine === false) return false;\n\n\t\t// reencode characters\n\t\tif($this->csvEncoding != 'UTF-8')\n\t\t{\n\t\t\t$strLine = iconv($this->csvEncoding, 'UTF-8', $strLine);\n\t\t}\n\n\t\treturn str_getcsv($strLine,$this->csvDelimiter,$this->csvEnclosure,$this->csvEscape);\n\t}" ]
[ "0.7721442", "0.6878188", "0.6867582", "0.682433", "0.65757984", "0.6565348", "0.6507875", "0.645326", "0.64034283", "0.63980955", "0.63939905", "0.6390784", "0.63394934", "0.6298595", "0.6188236", "0.6169058", "0.61457753", "0.61112404", "0.610085", "0.60865843", "0.60832286", "0.60655737", "0.60485405", "0.6038673", "0.6016818", "0.6010233", "0.5984619", "0.5984103", "0.5958042", "0.5940662", "0.59355897", "0.5931338", "0.59264636", "0.5905354", "0.5858642", "0.58519584", "0.5845408", "0.5838709", "0.5821695", "0.58206105", "0.58055806", "0.57909733", "0.57402617", "0.57095855", "0.5708088", "0.56932276", "0.5683347", "0.5683132", "0.56778693", "0.5652153", "0.56496793", "0.5646466", "0.5637379", "0.56335855", "0.56302994", "0.56265956", "0.56015825", "0.5597983", "0.5590982", "0.55868626", "0.55855733", "0.55785817", "0.55746603", "0.5571767", "0.55645615", "0.5558511", "0.55544555", "0.5549027", "0.55428904", "0.5540828", "0.5540659", "0.55375606", "0.55345434", "0.5521259", "0.5511905", "0.55117196", "0.5505692", "0.5501876", "0.5475392", "0.5475392", "0.5467767", "0.54665387", "0.54640514", "0.54617935", "0.54540336", "0.5430528", "0.54256654", "0.5411515", "0.54100424", "0.540729", "0.54067063", "0.53948617", "0.53937054", "0.53797287", "0.5363453", "0.53522605", "0.535176", "0.53414446", "0.5337446", "0.53180903" ]
0.5545192
68
Get CSV header. Usually it's a first line in file.
public function getHeader() { $this->withHeader = true; if (ftell($this->handle) == 0) { $this->header = $this->read(); } return $this->header; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function csvHeader()\n {\n return end($this->_csvHeader);\n }", "function getQBaseHeaderLine(){\r\n\t\tglobal $LANG;\r\n\t\t$delimeter = $this->extConf['CSV_qualifier'];\r\n\t\t$parter = $delimeter.$this->extConf['CSV_parter'].$delimeter;\r\n\r\n\t\t$csvheader = $delimeter.$this->q_data['uid'].$parter.$this->q_data['header'].$delimeter.\"\\n\\n\";\r\n\r\n\t\t$csvheader .= $delimeter;\r\n\t\t$csvheader .= $LANG->getLL('CSV_questionId').$parter;\r\n\t\t$csvheader .= $LANG->getLL('CSV_questionPlus').$parter;\r\n\t\t$csvheader .= $LANG->getLL('CSV_answer').$parter;\r\n\t\t$csvheader .= $LANG->getLL('CSV_resultIdPlus').$parter;\r\n\t\t$csvheader .= $parter;\r\n\t\t$csvheader .= $delimeter.\"\\n\";\r\n\r\n\t\treturn $csvheader;\r\n\t}", "public function GetHeader()\n {\n return $this->HeaderName;\n }", "public function get_header() {\n\t\tif (!isset($this->header)) {\n\t\t\t$this->get_array();\n\t\t}\n\t\treturn $this->header;\n\t}", "public function getHeader()\n {\n return $this->getFilename();\n }", "public function get_header() {\n $this->do_header();\n return $this->c_header;\n }", "public function firstLine(){\n return $this->file[0] ?? '';\n }", "function get_csv_header_fields()\r\n {\r\n\t\t$this->analyse_file($this->file_name, intval(filesize($this->file_name) / 1024) + 1024);\r\n\t\t\r\n\t\tif(count($this->arr_csv_columns) > 0) {\r\n\t\t\t$arr_temp = $this->arr_csv_columns;\r\n\t\t\t$this->arr_csv_columns = NULL;\r\n\r\n\t\t\tforeach($arr_temp as $key => $value) {\r\n\t\t\t\t$st = str_replace(\",,\", \" , , \", $arr_temp[$key]);\r\n\t\t\t\t//$st = $arr_temp[$key];\r\n\t\t\t\t$arr = str_getcsv($st);\r\n\t\t\t\t$this->arr_csv_columns[] = $arr;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->arr_csv_columns = '';\r\n\t\t}\r\n\t\treturn true;\r\n\t\t\r\n $this->arr_csv_columns = array();\r\n $fpointer = fopen($this->file_name, \"r\");\r\n if ($fpointer)\r\n {\r\n\t\t\t$arr = array();\r\n\t\t\twhile (($data = fgetcsv($fpointer, 10*1024, $this->field_separate_char, $this->field_enclose_char)) !== false) { \r\n\t\t\t\t$arr[] = $data;\r\n\t\t\t}\r\n\t\t\t$this->arr_csv_columns = $arr;\r\n unset($arr);\r\n fclose($fpointer);\r\n }\r\n else\r\n $this->error = \"file cannot be opened: \".(\"\"==$this->file_name ? \"[empty]\" : @mysql_escape_string($this->file_name));\r\n return $this->arr_csv_columns;\r\n }", "public function getCsvRowHeaders()\n {\n\n $headersType = Arr::get($this->csvSettings, 'headers', 'translate');\n\n $methodName = 'getCsvRowHeaders' . Str::studly($headersType);\n $headers = $this->$methodName();\n return rtrim(implode($this->separator, $headers), $this->separator) . $this->endline;\n }", "public function getHeader() {\n return (isset($this->header)) ? $this->header : '';\n }", "function _webform_csv_headers_file($component) {\r\n $header = array();\r\n // Two columns in header.\r\n $header[0] = array('', '');\r\n $header[1] = array($component['name'], '');\r\n $header[2] = array(t('Name'), t('Filesize (KB)'));\r\n return $header;\r\n}", "protected function getLineHeader($line) {\n\t\treturn Billrun_Factory::db()->logCollection()->query(array('header.stamp' => $line['log_stamp']))->cursor()->current();\n\t}", "private function parseFileHeader()\n\t{\n\n\t\tif ($this->data)\n\t\t{\n\t\t\t$line = StringHelper::substr($this->data, 0, StringHelper::strpos($this->data, \"\\n\") + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fp = fopen($this->file, 'r');\n\t\t\t$line = fgets($fp, 4096);\n\t\t\t$line = trim($line); // remove white spaces, at the end always \\n (or \\r\\n)\n\t\t\tfclose($fp);\n\t\t}\n\n\t\t$headers = explode($this->columnSeparator, $line);\n\t\t$this->colsNum = count($headers);\n\t\tfor ($i = 0; $i < $this->colsNum; $i++)\n\t\t{\n\t\t\t// -------- remove the utf-8 BOM ----\n\t\t\t$headers[$i] = str_replace(\"\\xEF\\xBB\\xBF\", '', $headers[$i]);\n\t\t\t$this->colsOrder[str_replace('\"', '', trim($headers[$i]))] = $i;\n\t\t\t// some people let white space at the end of text, so better to trim\n\t\t\t// CSV has often begining and ending \" - replace it\n\t\t}\n\t}", "public function getHeader(): string\n {\n return $this->header;\n }", "public function getHeader()\n {\n return isset($this->header) ? $this->header : null;\n }", "public function getHeader()\n {\n return isset($this->header) ? $this->header : null;\n }", "public function getHeader()\n {\n return $this->content['header'];\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public static function getHeader()\n {\n return self::$_header;\n }", "public function csvHeaders()\n\t{\n\t\t$headers = array();\n\t\tforeach ($this->Columns as $field => $Column) {\n\t\t\t$headers[] = $Column->label();\n\t\t}\n\t\treturn $headers;\n\t}", "public function getHeader()\n\t{\n\t\treturn $this->header;\n\t}", "public function getHeader() {\n return $this->header;\n }", "public static function file_get_contents_csv_header($path, $delimiter = ',') {\n $rows = self::file_get_contents_csv($path, $delimiter);\n $header = array_shift($rows);\n return self::arrayToAssoc($rows, $header);\n }", "public function getHeader ()\n {\n return $this->header;\n }", "public function getHeader() {\r\n return $this->__header;\r\n }", "function GetHeader() {\n return ($this->ses['response']['header']);\n }", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "public function getHeader()\n {\n return $this->Header;\n }", "function getHeader()\n {\n return (string) $this->_sHeader;\n }", "function getHeader()\n {\n return (string) $this->_sHeader;\n }", "public function getFullHeader()\n {\n }", "function get_header()\n\t{\n\t\treturn $this->header;\n\t}", "public function getHeaders(): string|null\n {\n if (!$this->fileStream) {\n return null;\n }\n\n # https://www.php.net/manual/en/function.stream-get-meta-data.php\n $meta_data = stream_get_meta_data($this->fileStream);\n\n return implode(\n \"\\r\\n\",\n $meta_data['wrapper_data']\n );\n }", "public function csvHeaderRow()\n {\n static $columns;\n\n if ($columns === null) {\n $columns = [ 'source' ];\n $languages = $this->languages();\n foreach ($languages as $lang) {\n $columns[] = $lang;\n }\n\n $columns[] = 'context';\n }\n\n return $columns;\n }", "public function getHeader()\n {\n $p = $this->path . '/HEADER.html';\n if (is_file($p))\n return file_get_contents($p);\n return '';\n }", "public function get_header()\n\t{\n\t\t$header\t\t=\t$this->lang->get_line( \"controller_title\", $this->table );\n\t\tif ( !$header )\n\t\t{\n\t\t\t$header\t\t=\t( substr( strtolower( get_class( $this ) ), 0, strrpos( strtolower( get_class( $this ) ), \"_\" , -1 ) ) );\n\t\t\t$controller\t=\t$this->singlepack->get_controller( $header );\n\t\t\tif ( !$controller )\n\t\t\t{\n\t\t\t\treturn ucfirst( substr( strtolower( get_class( $this ) ), 0, strrpos( strtolower( get_class( $this ) ), \"_\" , -1 ) ) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $controller->nome; // str_replace( '_', ' ', $header );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $header;\n\t\t}\n\t}", "public function getHeader() {\n return $this->Header;\n }", "public function header() {\n return $this->header;\n }", "protected function getCsvHeaders(): array\n {\n // return ['id', 'name', 'attribute', 'value'];\n\n $csv = $this->_getCsvReader();\n return CsvConvert::headerConvert($csv->getHeader());\n }", "public function isFirstRowHeaders()\n\t{\n\t\treturn $this->firstRowHeaders;\n\t}", "function getHeader()\n\t{\n\t\treturn $this->header;\n\t}", "public function getCSVHeaderRow() {\n return [\n 'link_title',\n 'link_layout',\n 'link_location',\n 'content_type',\n 'link_count',\n 'link_clicked',\n 'clicked',\n 'os',\n 'device',\n 'device_brand',\n 'device_model',\n 'browser_type',\n 'browser_name',\n 'browser_version',\n 'site',\n 'page_url',\n 'referrer',\n 'paragraphs',\n 'displayed_url_1',\n 'displayed_url_2',\n 'displayed_url_3',\n 'displayed_url_4',\n 'displayed_url_5',\n 'time_logged',\n 'time_updated',\n 'user_id',\n 'browser',\n 'row'\n ];\n }", "public function getHeader(){\n\t\treturn $this->header;\n\t}", "private function getParamHeader()\n {\n $header = $this->getMenuParams()->get( 'header', '' );\n return (string)$header;\n }", "public function getHeader(string $header): string;", "public static function getFirstRow($fn){\n $file = new SplFileObject($fn);\n $row = $file->fgetcsv();\n return $row;\n }", "public function header($key = NULL)\n\t{\n\t\tif ($this->executed)\n\t\t{\n\t\t\tif ($key === NULL)\n\t\t\t\treturn $this->header;\n\t\t\telseif (array_key_exists($key, $this->header))\n\t\t\t\treturn $this->header[$key];\n\t\t}\n\n\t\treturn NULL;\n\t}", "public function getHeaders()\r\n {\r\n return isset($this->data[self::HEADER_INDEX]) ? $this->data[self::HEADER_INDEX] : null;\r\n }", "public function getHeader()\r\n {\r\n return $this->headers;\r\n }", "public function getHeader();", "public function getHeader();", "public function getHeader();", "protected function getHeader($header)\n {\n $this->initialize();\n $header = str_replace('-','_',$header);\n return isset($this->parsed['headers'][$header]) ? $this->parsed['headers'][$header] : null;\n }", "function _webform_csv_headers_email($component) {\r\n $header = array();\r\n $header[0] = '';\r\n $header[1] = '';\r\n $header[2] = $component['name'];\r\n return $header;\r\n}", "public function header()\n\t{\n\t\t$header = Request::current()->headers();\n\t\treturn $header;\n\t}", "public function getHeader($name)\n {\n $lines = $this->getHeaderLines($name);\n\n if (!empty($lines)) {\n return implode(', ', $lines);\n } else {\n return null;\n }\n\n }", "public function getChannelHeader()\n {\n return $this->channel_header;\n }", "public function header($key)\n {\n if (isset($this->headers[$key])) {\n return $this->headers[$key];\n }\n return null;\n }", "private function setHeader()\r\n {\r\n rewind($this->handle);\r\n $this->headers = fgetcsv($this->handle, $this->length, $this->delimiter);\r\n }", "public function getHeader() {\n }", "public function getHeader($field=null)\n\t{\n\t\tif(!self::$tokenDecoded)\n\t\t\treturn null;\n\n\t\t$parts = self::$tokenDecoded;\n\t\t$header = $parts['header'];\n\n\t\tif( isset($header[$field]) )\n\t\t\treturn $header[$field];\n\n\t\treturn $field ? null : $header;\n\t}", "function getHeader() {\n return '';\n }", "public function getHeader($header) {\n\n $normalized = strtolower($header);\n\n if (isset($this->headers[$normalized])) {\n return $this->headers[$normalized]['value'];\n }\n\n return '';\n\n }", "public function getHeaderPrototype()\n\t{\n\t\treturn $this->header;\n\t}", "public function isFirstRowHeaders()\n {\n return $this->firstRowIsHeaders;\n }", "public function getPageHeader()\n\t{\n\t\treturn $this->_pageHeader;\n\t}", "public function getHeader($key){\n $key = FW_String::strtolower($key);\n \n if($this->getHeader($key)){\n return $this->header[$key];\n }\n \n return null;\n }", "public function requestheader() {\n return $this->info['request_header'];\n }", "public function getHeaderString () {\n\t\t$headers = array();\n\t\tforeach ($this->_headers as $name => $value) {\n\t\t $headers[] = $name . \": \" . $value;\n\t\t}\n\t\treturn implode(\"\\r\\n\", $headers);\n\t}", "public function getHeader() \r\n {\r\n return $this->_bagHeader; \r\n }", "function os2forms_nemid_webform_csv_headers_component($component, $export_options) {\n $header = array();\n $header[0] = '';\n $header[1] = '';\n $header[2] = $export_options['header_keys'] ? $component['form_key'] : $component['name'];\n return $header;\n}", "function getresponseheader($header = false){\n $headers = $this->getLastResponseHeaders();\n foreach ($headers as $head){\n if ( is_integer(strpos ($head, $header) )){\n $hstart = strpos ($head, \": \");\n $head = trim(substr($head,$hstart+2,100));\n return $head;\n }\n }\n }", "protected function _getExportHeaders()\n {\n return Mage::helper('storelocator')->getHeaderFile();\n }", "public function getRequestHeader()\n {\n return $this->get(self::REQUEST_HEADER);\n }", "public function header($name = null)\n {\n if ($name === null) {\n return $this->_getHeaders();\n }\n $header = $this->getHeader($name);\n if (count($header) === 1) {\n return $header[0];\n }\n\n return $header;\n }", "protected function readHeader()\n {\n \t$this->data_mesgs['file_id']['type']=\"TCX\";\n \t$this->data_mesgs['file_id']['manufacturer']=(string)$this->file_contents->Activities->Activity->Creator->Name;\n \t$this->data_mesgs['file_id']['number']=(string)$this->file_contents->Author->Build->Version->VersionMajor.\".\".\n \t\t(string)$this->file_contents->Author->Build->Version->VersionMinor;\n \t$datebrut=(string)$this->file_contents->Activities->Activity->Lap['StartTime'];\n \t$this->data_mesgs['file_id']['time_created']=strtotime( $datebrut);\n \t$this->data_mesgs['session']['sport']=(string)$this->file_contents->Activities->Activity['Sport'];\n \t \n }", "public function getHeader()\n {\n return $this->httpHeader;\n }", "public function getHeader($key)\n {\n return isset ($this->headers[$key]) ? $this->headers [$key] : '';\n }", "function getHeader($header, $loc = '') {\n\tglobal $sql;\n\t$sql = \"SELECT header FROM \" . $loc . \"snapshot_headers WHERE id=\".$header;\n\t$query = mysql_query($sql);\n\tcheckDBError($sql);\n\tif ($result = mysql_fetch_array($query))\n\t\treturn $result['header'];\n\treturn \"\";\n}", "public function get_header_line(string $p_name): string {\n $origName = $this->get_header_name($p_name);\n\n if (!array_key_exists($origName, $this->headers)) {\n return '';\n }\n\n return $this->_get_value_line($this->headers[$origName]);\n }", "public function getHeader($header)\n {\n return isset($this->headers[$header]) ? $this->headers[$header] : null;\n }", "protected function addHeaderRowToCSV() {}", "public function header($name) {\n return isset($this->headers[$name])? $this->headers[ucfirst($name)] : null;\n }", "public function getHeaderData() {}", "protected function makeHeader()\n {\n $header = '';\n foreach(self::$headers as $k => $v) {\n $header .= $k . \": \" . $v . \"\\r\\n\";\n }\n\n return $header;\n }", "public function getHeader() {\n\t\tif (!empty($this->header)) {\n\t\t\t$this->header = preg_replace('%(\\r\\n|\\r|\\n)%', self::$crlf, $this->header);\n\t\t}\n\t\t\n\t\t$this->header .=\n\t\t\t'X-Priority: 3'.self::$crlf\n\t\t\t.'X-Mailer: WoltLab Community Framework Mail Package'.self::$crlf\t\t\t\t\t\t\t\t\t\n\t\t\t.'MIME-Version: 1.0'.self::$crlf\n\t\t\t.'From: '.$this->getFrom().self::$crlf\n\t\t\t.($this->getCCString() != '' ? 'CC:'.$this->getCCString().self::$crlf : '')\n\t\t\t.($this->getBCCString() != '' ? 'BCC:'.$this->getBCCString().self::$crlf : '');\t\t\t\t\t\n\t\t\t\n\t\tif (count($this->getAttachments())) {\n\t\t\t$this->header .= 'Content-Transfer-Encoding: 8bit'.self::$crlf;\n\t\t\t$this->header .= 'Content-Type: multipart/mixed;'.self::$crlf;\n\t\t\t$this->header .= \"\\tboundary=\".'\"'.$this->getBoundary().'\";'.self::$crlf;\n\t\t}\n\t\telse {\n\t\t\t$this->header .= 'Content-Transfer-Encoding: 8bit'.self::$crlf;\n\t\t\t$this->header .= 'Content-Type: '.$this->getContentType().'; charset='.CHARSET.self::$crlf;\n\t\t}\n\t\t\n\t\treturn $this->header;\n\t}", "public function get_header($param = null)\n\t{\n\t\treturn\n\t\t\tis_null($param)\n\t\t\t? $this->header_info\n\t\t\t: isset($this->header_info[$param])\n\t\t\t\t? $this->header_info[$param]\n\t\t\t\t: false;\n\t}", "protected function generateHeader(array $csv, $primaryKey)\n {\n $header = array();\n for ($i = 0; $i < count($csv[ DCsvFile::KEY_HEADER ]); $i++) {\n if ($csv[ DCsvFile::KEY_HEADER ][ $i ] !== $primaryKey) {\n $header[ $csv[ DCsvFile::KEY_HEADER ][ $i ] ] = '';\n }\n }\n\n return $header;\n }", "public function getHeaderString() {\n return $this->getPayload(FALSE);\n }", "function ThursdayColumnHeader() {\n\t\tif (func_num_args()) {\n\t\t\t$this->_ThursdayColumnHeader = trim(func_get_arg(0));\n\t\t}\n\t\telse return $this->_ThursdayColumnHeader;\n\t}", "public function getHeaderCode() {\n\n\t\t$scripts = (array) $this->getMeta( App::s()->getPrefix( '_scripts' ), array() );\n\n\t\treturn isset( $scripts['header'] ) ? $scripts['header'] : '';\n\n\t}", "protected function getCurrentRecord()\n {\n do {\n $ret = fgetcsv($this->stream, 0, $this->delimiter, $this->enclosure, $this->escape);\n } while ($this->flags & SplFileObject::SKIP_EMPTY && $ret !== false && $ret[0] === null);\n return $ret;\n }", "public function header(?string $key = null, $default = null)\n {\n return $this->retrieveItem('headers', $key, $default);\n }", "public function getLine(){\n $obj = new SplFileObject($this->_csv_file);\n $obj->seek($this->_counter);\n if($this->_counter < $this->_number_of_lines){\n $this->_counter++;\n $arr = $obj->fgetcsv($this->_delimiter);\n }else{\n $arr = null;\n }\n $obj = null;\n return $arr;\n }", "public function extractHeadersFromCSVFile($csvFileHandle, bool $withReset = false): array\n {\n // Validating the resource is valid before reading from it\n $this->throwExceptionIfHandleIsInvalid($csvFileHandle);\n\n // Guessing CSV delimiter\n $delimiter = $this->detectCSVFileDelimiter($csvFileHandle);\n\n // Keeping actual position in memory\n $actualLine = ftell($csvFileHandle);\n\n // Going back to the begining of the file\n fseek($csvFileHandle, 0);\n\n // Extracting first row as an array\n $headers = fgetcsv($csvFileHandle, 0, $delimiter);\n\n // If a reset was asked, we move the resource to the position where it was before we read first line\n if ($withReset) {\n fseek($csvFileHandle, $actualLine);\n }\n\n // If we could not extract headers\n if (!is_array($headers)) {\n throw new CsvFileException(\"We could not read the first line of the file as a CSV row ! Are you sure it is well formatted ? Or maybe the file is empty 🤔 ?\");\n }\n\n return $headers;\n }", "private function getHeader() : object {\n return imap_rfc822_parse_headers($this->currentEmail);\n }" ]
[ "0.767566", "0.6901435", "0.6859122", "0.68434995", "0.68240535", "0.6823405", "0.67184794", "0.6676887", "0.66745484", "0.66723377", "0.6669941", "0.6580675", "0.65394974", "0.65358925", "0.6532634", "0.6532634", "0.6528428", "0.64533013", "0.64533013", "0.64533013", "0.64533013", "0.64533013", "0.6423957", "0.64162016", "0.6404731", "0.638352", "0.6375342", "0.63675445", "0.6365121", "0.6346087", "0.6307459", "0.63052064", "0.6288092", "0.6288092", "0.62851304", "0.62848634", "0.62736785", "0.62674093", "0.6265658", "0.62535423", "0.6250107", "0.6217914", "0.6212141", "0.6207276", "0.6199618", "0.6171899", "0.61228406", "0.61215395", "0.6093682", "0.60857636", "0.6055727", "0.6049875", "0.6044738", "0.60398966", "0.60398966", "0.60398966", "0.60371614", "0.60173297", "0.60149294", "0.6010076", "0.59661305", "0.5958431", "0.59527767", "0.5939211", "0.5932318", "0.59240425", "0.5889698", "0.5887543", "0.5877302", "0.5863171", "0.5856039", "0.5853772", "0.58478767", "0.58174473", "0.57689136", "0.573988", "0.5733389", "0.5728622", "0.5718246", "0.57112503", "0.570044", "0.5700242", "0.56914616", "0.5678223", "0.5675788", "0.56747717", "0.5653989", "0.564363", "0.56411415", "0.56141996", "0.560858", "0.56020117", "0.5596994", "0.5595626", "0.5584409", "0.5583566", "0.5579118", "0.55782944", "0.5578252", "0.5574136" ]
0.7245194
1
Read current line from CSV file
public function readLine() { $out = $this->read(); if ($this->withHeader && is_array($out)) { $out = array_combine($this->header, $out); } return $out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readLine(){\n $data = fgetcsv($this->handle,0,\";\");\n return $data; \n \n }", "public function getLine(){\n $obj = new SplFileObject($this->_csv_file);\n $obj->seek($this->_counter);\n if($this->_counter < $this->_number_of_lines){\n $this->_counter++;\n $arr = $obj->fgetcsv($this->_delimiter);\n }else{\n $arr = null;\n }\n $obj = null;\n return $arr;\n }", "protected function getCurrentRecord()\n {\n do {\n $ret = fgetcsv($this->stream, 0, $this->delimiter, $this->enclosure, $this->escape);\n } while ($this->flags & SplFileObject::SKIP_EMPTY && $ret !== false && $ret[0] === null);\n return $ret;\n }", "public function currentLine();", "static public function buffer__csv__pop_line( &$csv ){\n\t\t$pos = strpos( $csv, \"\\n\" );\n\t\t$line = substr( $csv, 0, $pos );\n\t\t$csv = substr_replace( $csv, '', 0, $pos + 1 );\n\t\treturn $line;\n\t}", "public function readCsv()\n {\n ini_set(\"auto_detect_line_endings\", true);\n $fp = fopen($this->inputFile , 'r');\n while($row = fgetcsv($fp)){\n $this->data[] = $row;\n }\n }", "protected function readLine()\n\t{\n\t\tif(!$this->handle) return false;\n\t\t$strLine = fgets($this->handle);\n\t\tif($strLine === false) return false;\n\n\t\t// reencode characters\n\t\tif($this->csvEncoding != 'UTF-8')\n\t\t{\n\t\t\t$strLine = iconv($this->csvEncoding, 'UTF-8', $strLine);\n\t\t}\n\n\t\treturn str_getcsv($strLine,$this->csvDelimiter,$this->csvEnclosure,$this->csvEscape);\n\t}", "public function current()\n {\n $this->readCsvLine();\n $this->BOF = true;\n $return = current($this->_values);\n return $return;\n }", "function readCSV($csvFile) {\n if (file_exists($csvFile)) {\n $file_handle = fopen($csvFile, 'r');\n\n while (!feof($file_handle) ) {\n $line_of_text[] = fgetcsv($file_handle, 1024);\n }\n\n fclose($file_handle);\n return $line_of_text;\n } else {\n return null;\n }\n}", "function readCSV($csvFile, $array){\n $file_handle = fopen($csvFile, 'r');\n while (!feof($file_handle)) {\n $line_of_text[] = fgetcsv($file_handle, 0, $array['delimiter']);\n }\n array_shift($line_of_text);\n array_pop($line_of_text);\n fclose($file_handle);\n return $line_of_text;\n}", "public function current()\n {\n return $this->fileObject->fgetcsv(\n $this->getStrategy()->getDelimiter(),\n $this->getStrategy()->getEnclosure(),\n $this->getStrategy()->getEscape()\n );\n }", "protected function parseCsv() {\r\n\t\t\r\n\t\t$csv_data = array();\r\n\t\twhile ($this->_currentRow = fgetcsv($this->_fileHandler, null, $this->_delimiter, $this->_enclosure)) {\r\n\t\t\t$csv_data[] = $this->_currentRow;\r\n\t\t}\r\n\t\t\r\n\t\t$this->_data = $csv_data;\r\n\t}", "public function next(): void\n {\n $this->values = [];\n $row = fgetcsv($this->fp, 0, $this->delimiter, $this->enclosure);\n\n if ($row) { // Is het einde (eof) nog niet bereikt?\n if ($row === array(null)) { // Empty row?\n $this->next(); // Skip row\n return;\n }\n ++$this->index;\n foreach ($this->keys as $index => $key) {\n if (isset($row[$index])) { // Is er voor deze kolom een waarde?\n $this->values[$key] = $row[$index];\n } else {\n $filename = (strpos($this->filename, \\Sledgehammer\\PATH) === 0) ? substr($this->filename, strlen(\\Sledgehammer\\PATH)) : $this->filename; // Waar mogelijk het PATH er van af halen\n \\Sledgehammer\\notice('Row too short, missing column #' . ($index + 1) . ': \"' . $this->keys[$index] . '\" in ' . $filename . ' on line ' . ($this->index + 2), $row); // @todo Calculate line offset compared to the index ()\n }\n }\n } else {\n $this->index = null;\n }\n }", "public function get_line()\n {\n return $this->line;\n }", "public function getCSV() {\n $handle = fopen($this->_csv_file, \"r\");\n $array_line_full = array();\n\n while (($line = fgetcsv($handle, 0, \",\")) !== FALSE) {\n $array_line_full[] = $line;\n }\n fclose($handle);\n return $array_line_full;\n }", "public function getRecord()\n\t{\t\t\t\t\n\t\tif(isset($this->_handle))\n\t\t\treturn fgetcsv($this->_handle,null,$this->_columnDelimiter);\n\t\telse \n\t\t\treturn false;\n\t}", "protected function _getNextRow()\n {\n $currentRow = array();\n $handle = $this->_getFileHandle();\n while (($row = fgets($handle)) !== FALSE) {\n $this->_currentRowNumber++;\n return $row;\n }\n }", "function getLine()\n {\n if($this->parseFile)\n {\n if(!feof($this->fid))\n {\n do\n {\n $line = trim(fgets($this->fid));\n }\n while(!feof($this->fid) && !$line);\n return $line;\n }\n return FALSE;\n }\n else\n {\n do\n {\n $line = trim($this->bibtexString[$this->currentLine]);\n $this->currentLine++;\n }\n while($this->currentLine < count($this->bibtexString) && !$line);\n return $line;\n }\n }", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "protected function get_line() { \n\t\t$line = $this->lines[$this->cursor]; \n\t\t$this->cursor++; return $line; \n\t}", "private function parseCsvLine($line)\n\t{\n\n\t\t$data = str_getcsv($line);\n\t\t// different count of data cols than header cols, bad CSV\n\t\tif (count($data) != $this->colsNum && count($data) != 1)\n\t\t{ // == 1 probably last empty line\n\t\t\t// different number of cols than in header, file is not in correct format\n\t\t\treturn false;\n\t\t}\n\t\t$dataLine = new CsvLine($data[$this->colsOrder[\"CATEGORIES\"]],\n\t\t\t$data[$this->colsOrder[\"SUMMARY\"]],\n\t\t\t$data[$this->colsOrder[\"DTSTART\"]],\n\t\t\t$data[$this->colsOrder[\"DTEND\"]]);\n\t\tforeach ($this->colsOrder as $col => $order)\n\t\t{\n\t\t\tswitch ($col)\n\t\t\t{\n\t\t\t\tcase \"TIMEZONE\":\n\t\t\t\t\t$dataLine->setTimezone($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"LOCATION\":\n\t\t\t\t\t$dataLine->setLocation($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"DTSTAMP\":\n\t\t\t\t\t$dataLine->setDtstamp($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"X-EXTRAINFO\":\n\t\t\t\t\t$dataLine->setExtraInfo($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"X-COLOR\":\n\t\t\t\t\t$dataLine->setColor($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CONTACT\":\n\t\t\t\t\t$dataLine->setContact($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"DESCRIPTION\":\n\t\t\t\t\t$dataLine->setDescription($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"RRULE\":\n\t\t\t\t\t$dataLine->setRrule($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"UID\":\n\t\t\t\t\t$dataLine->setUid($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CATEGORIES\":\n\t\t\t\tcase \"SUMMARY\":\n\t\t\t\tcase \"DTSTART\":\n\t\t\t\tcase \"DTEND\":\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"NOENDTIME\":\n\t\t\t\t\t$dataLine->setNoendtime($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"PUBLISHED\":\n\t\t\t\t\t$dataLine->setPublished($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MULTIDAY\":\n\t\t\t\t\t$dataLine->setMultiday($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"lockevent\":\n\t\t\t\t\t$dataLine->lockevent = $data[$order];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$dataLine->customField($data[$order], $col);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $dataLine;\n\n\t}", "function getNextRow()\r\n\t{\r\n\t\t$this->node_priority = false;\r\n\t\t\r\n\t\t// set mapping array\r\n\t\t$this->first_field = true;\r\n\t\treset( $this->mapping );\r\n\r\n\t\tif( $this->ignore_first_row )\r\n\t\t{\r\n\t\t\t$this->ignore_first_row = false;\r\n\t\t\tfgetcsv( $this->m_aData , 100000, $this->delimiter, $this->enclosure ); // nirvana\r\n\t\t}\r\n\r\n\t\t$this->row = fgetcsv( $this->m_aData , 100000, $this->delimiter, $this->enclosure);\r\n\r\n\t\treturn $this->row;\r\n\t}", "function getLine(){\n return $this->line;\n }", "public function readNextLine() {\n\t\tif ($this->data->rows >= $this->linepointer) {\n\t\t\t$newdata = array();\n\t\t\t$newdata = $this->data->_data[$this->linepointer];\n\t\t\t$this->linepointer++;\n\t\t\treturn $newdata;\n\t\t}\n\t\telse return false;\n\t}", "public function readByLine() {\r\n\t\tif ($this->exists) {\r\n\t\t\t\r\n\t\t\t$lines = file ( $this->filename ); // file in to an array\r\n\t\t\treturn $lines; // line 2\r\n\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "public function getLine() {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n {\n return $this->line;\n }", "public function getLine()\n\t{\n\t\treturn $this->line;\n\t}", "private function _getRow($ignoreMismatch = false)\n {\n $line = fgetcsv($this->_file, $this->_length, $this->_delimiter,\n $this->_enclosure, $this->_escape\n );\n\n // EOF\n if (false === $line && feof($this->_file))\n {\n return false;\n }\n\n // Empty line\n if (is_array($line) && empty($line))\n {\n return false;\n }\n\n $expectedHeaders = $this->_hasHeaders\n ? count($this->_headers)\n : $this->_headers;\n\n // Other error\n if (!$line)\n {\n throw new PHPMapper_Exception_Import(\n 'fgetcsv() failed when attempting to read line from file.'\n );\n }\n else if (!$ignoreMismatch && count($line) != $expectedHeaders)\n {\n throw new PHPMapper_Exception_Import(\n 'Line #' . $this->_lineNumber . ' has ' . count($line) . ' columns. Expecting '\n . $expectedHeaders . '.'\n );\n }\n else\n {\n $this->_lineNumber++;\n return $line;\n }\n }", "function readUploadedCSV($tmp_name) {\n\t $lines = array();\n\n\t ini_set('auto_detect_line_endings',1);\n\t $handle = fopen($tmp_name, \"r\");\n\t while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n\t\t array_push($lines,$data);\t\t\t \n\t }\n\t return $lines;\n }", "public function getLine() {\n\t\treturn $this->line;\n\t}", "public function get_row(int $row = null) {\n\t\tif (!$this->is_open()) return false;\n\t\tif ($row==null) {\n\t\t\t$row = fgetcsv($this->FILE, 0, $this->delimeter, $this->enclosure, $this->escape);\n\t\t\tif ($row==false) {$this->STATE=CSVReader::STATE_EOF; return false;}\n\t\t\tif ($row==null) {$row=$this->DEFAULTS;} else {$row=$this->clear_empty_values($row);}\n\t\t\tif (count($this->HEADERS) != count($row)) throw new Exception('Row count and header count do not match. Header:'.count($this->HEADERS).' Row:'.count($row).var_export($this->HEADERS, true).var_export($row, true), 0);\n\t\t\tif ($this->cache_rows)\n\t\t\t\t$this->DATA[$this->ROW_COUNT] = $row;\n\t\t\t$this->ROW_COUNT++;\n\t\t\treturn array_combine($this->HEADERS, $row);\n\t\t} else {\n\t\t\tif (!$this->cache_rows) return false;\n\t\t\tif ($row < $this->ROW_COUNT && $row>0)\n\t\t\t\treturn array_combine($this->HEADERS, $this->DATA[$row-1]);\n\t\t\twhile ($this->ROW_COUNT < $row) {\n\t\t\t\tif (!get_row()) return false;\n\t\t\t}\n\t\t\treturn array_combine($this->HEADERS, $this->DATA[$row-1]);\n\t\t}\n\t}", "private function getNextLine()\n {\n return fgets($this->fileDescriptor, 4096);\n }", "public function readLine()\n {\n if ($line = trim(fgets($this->fileHandle)))\n {\n return $line;\n }\n\n return false;\n }", "function read() {\r\n\t\t$line = '';\r\n\t\tdo \r\n\t\t{\r\n\t\t\t$c = fgetc( $this->fp );\r\n\t\t\tif( ($c != '') and ($c != \"\\n\") and !feof( $this->fp ) ) $line .= $c;\r\n\t\t} while( ($c != '') and ($c != \"\\n\") and !feof( $this->fp ) );\r\n\t\treturn $line;\r\n\t}", "public function getLine($line);", "public function current() {\r\n\t\treturn $this->lastLine;\r\n }", "public function getLine() {\n return $this->parse()['line'];\n }", "public function process(){\n if(!$this->_init){\n $this->_init();\n }\n $line = fgetcsv($this->_handle, 4096);\n if(!$line){\n fclose($this->_handle);\n return false;\n }\n $i = 0;\n $row = array();\n foreach($this->_layout as $key){\n if(isset($line[$i])){\n $row[$key] = $line[$i];\n } else {\n $row[$key] = NULL;\n }\n $i++;\n }\n $this->_row = $row;\n return true;\n }", "public function readLine(){\n\t\t\n\t\t$line = '';\n\t\tif( ($offset = strpos($this->data, \"\\r\\n\", 0)) !== false){\n\t\t $line = substr($this->data,0,$offset);\n\t\t $this->data = substr($this->data,$offset+2);\n\t\t $this->_debug(\"line:$line\");\n\t\t $this->_debug(\"left>\\n{$this->data}\");\n\t\t ob_flush();\n\t\t}\n\t\t\n\t\treturn $line;\n\t}", "public function parse()\n {\n $this->file = fopen($this->filename, 'r');\n $lineCount = 0;\n\n while (($line = fgetcsv(\n $this->file,\n 0,\n $this->delimiter,\n $this->enclosure,\n $this->escape\n )) !== false) {\n if ($lineCount++ == 0) {\n $line[0] = StringUtils::removeBOM($line[0]);\n $this->setHeader($line);\n\n if ($this->hasHeader) {\n continue;\n }\n }\n\n $this->parseLine($line);\n }\n\n fclose($this->file);\n }", "public function get()\n {\n $is_first = true;\n $keys = [];\n $data = [];\n $count = 0;\n\n $file = new SplFileObject($this->csv_file_path);\n\n while(!$file->eof())\n {\n /**\n * $file->fgets()\n * 呼び出す度に次の行に移動してしまうので注意する\n */\n $input = $file->fgets();\n\n /**\n * 空行は除外する\n */\n if(empty($input)) continue;\n\n $line = str_getcsv($input);\n\n if($is_first)\n {\n $keys = $line;\n $count = count($keys);\n $is_first = false;\n continue;\n }\n\n /**\n * ヘッダー行と異なる要素数のデータは除外する\n */\n if($count != count($line)) continue;\n\n foreach ($keys as $index => $key) {\n $tmp[$key] = $line[$index];\n }\n $data[] = $tmp;\n }\n return $data;\n }", "private function open_csv() {\n $this->fh = fopen(CSV_FILE, \"r\");\n if ($this->fh === false) {\n $this->log_it(\"Could not open CSV file.\");\n return false;\n }\n\n return true;\n }", "private function get_csv_data() {\n if (!is_resource($this->fh) || get_resource_type($this->fh) !== \"stream\") {\n $this->log_it(\"CSV file not open when get_csv_data() called.\");\n return false;\n }\n\n // Consume/discard header row, if it exists.\n if (HEADER_ROW_EXISTS) {\n fgets($this->fh);\n $row_num = 2;\n } else {\n $row_num = 1;\n }\n\n $graded_reg_codes = STUDENT_REGISTERED_CODES;\n $audit_reg_codes = is_null(STUDENT_AUDIT_CODES) ? array() : STUDENT_AUDIT_CODES;\n $latedrop_reg_codes = is_null(STUDENT_LATEDROP_CODES) ? array() : STUDENT_LATEDROP_CODES;\n $all_valid_reg_codes = array_merge($graded_reg_codes, $audit_reg_codes, $latedrop_reg_codes);\n $unexpected_term_codes = array();\n\n // Read and assign csv rows into $this->data array\n $row = fgetcsv($this->fh, 0, CSV_DELIM_CHAR);\n while(!feof($this->fh)) {\n // Course is comprised of an alphabetic prefix and a numeric suffix.\n $course = strtolower($row[COLUMN_COURSE_PREFIX] . $row[COLUMN_COURSE_NUMBER]);\n\n // Trim whitespace from all fields in $row.\n array_walk($row, function(&$val, $key) { $val = trim($val); });\n\n // Remove any leading zeroes from \"integer\" registration sections.\n if (ctype_digit($row[COLUMN_SECTION])) $row[COLUMN_SECTION] = ltrim($row[COLUMN_SECTION], \"0\");\n\n switch(true) {\n // Check that $row has an appropriate student registration.\n case array_search($row[COLUMN_REGISTRATION], $all_valid_reg_codes) === false:\n // Skip row.\n break;\n\n // Check that $row is associated with the current term (if check is enabled)\n // Assume this check is OK, when EXPECTED_TERM_CODE is null (check disabled)\n case is_null(EXPECTED_TERM_CODE) ? false : $row[COLUMN_TERM_CODE] !== EXPECTED_TERM_CODE:\n // Note the unexpected term code for logging, if not already noted.\n if (array_search($row[COLUMN_TERM_CODE], $unexpected_term_codes) === false) {\n $unexpected_term_codes[] = $row[COLUMN_TERM_CODE];\n }\n break;\n\n // Check that $row is associated with the course list.\n case array_search($course, $this->course_list) !== false:\n if (validate::validate_row($row, $row_num)) {\n // Include $row\n $this->data[$course][] = $row;\n\n // $row with a blank email is included, but it is also logged.\n if ($row[COLUMN_EMAIL] === \"\") {\n $this->log_it(\"Blank email found for user {$row[COLUMN_USER_ID]}, row {$row_num}.\");\n }\n } else {\n // There is a problem with $row, so log the problem and skip.\n $this->invalid_courses[$course] = true;\n $this->log_it(validate::$error);\n }\n break;\n\n // Check that the $row is associated with a mapped course.\n case array_key_exists($course, $this->mapped_courses):\n // Also verify that the section is mapped.\n $section = $row[COLUMN_SECTION];\n if (array_key_exists($section, $this->mapped_courses[$course])) {\n $m_course = $this->mapped_courses[$course][$section]['mapped_course'];\n if (validate::validate_row($row, $row_num)) {\n // Include $row.\n $row[COLUMN_SECTION] = $this->mapped_courses[$course][$section]['mapped_section'];\n $this->data[$m_course][] = $row;\n\n // $row with a blank email is allowed, but it is also logged.\n if ($row[COLUMN_EMAIL] === \"\") {\n $this->log_it(\"Blank email found for user {$row[COLUMN_USER_ID]}, row {$row_num}.\");\n }\n } else {\n // There is a problem with $row, so log the problem and skip.\n $this->invalid_courses[$m_course] = true;\n $this->log_it(validate::$error);\n }\n }\n break;\n\n default:\n // Skip row by default.\n break;\n\n } // END switch (true)\n\n $row = fgetcsv($this->fh, 0, CSV_DELIM_CHAR);\n $row_num++;\n }\n\n // Log any unexpected term codes.\n // This may provide a notice that the next term's data is available.\n if (!empty($unexpected_term_codes)) {\n $msg = \"Unexpected term codes in CSV: \";\n $msg .= implode(\", \", $unexpected_term_codes);\n $this->log_it($msg);\n }\n\n /* ---------------------------------------------------------------------\n There may be \"fake\" or \"practice\" courses in Submitty that shouldn't be\n altered by the autofeed. These courses will have no enrollments in the\n csv file as these courses are not recognized by the registrar.\n --------------------------------------------------------------------- */\n\n // Filter out any \"empty\" courses so they are not processed.\n // There shouldn't be any \"empty\" course data, but this is just in case.\n $this->data = array_filter($this->data, function($course) { return !empty($course); }, 0);\n\n // Most runtime involves the database, so we'll release the CSV now.\n $this->close_csv();\n\n // Done.\n return true;\n }", "public function parse()\n {\n if ($handle = fopen($this->csv, 'r'))\n {\n while ($data = fgetcsv($handle, \",\"))\n {\n $this->dataArray[] = $data;\n }\n }\n fclose($handle);\n }", "public function current()\n {\n $this->fileIterator->seek($this->position);\n if ($this->fileIterator->valid()) {\n $line = trim($this->fileIterator->current());\n return $this->parseLine($line);\n }\n throw new \\OutOfRangeException(\"Fail is invalid\");\n }", "public function getLine(): int\n {\n return $this->line;\n }", "public function getLine(): int\n {\n return $this->line;\n }", "function readCSV($url) {\n $row = 0;\n $readData = [];\n print_r(\"Opening CSV File ... \");\n if (($handle = fopen($url, \"r\")) !== FALSE) {\n print_r(\"SUCCESS\\n\");\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n if($row!=0) { // skip first row\n $readData[$row] = $data;\n }\n $row++;\n }\n fclose($handle);\n return $readData;\n } else {\n print_r(\"FAIL\\n\");\n return null;\n }\n}", "private function nextLine()\n\t{\n\t\treturn array_shift($this->buffer);\n\t}", "function getNextRow() {\n\t\tglobal $LANG, $TYPO3_CONF_VARS;\n\t\t\n\t\tif (!empty($this->conf['dontUsePHPFunction'])) {\n\t\t\treturn next($this->rows);\n\t\t}\n\t\t\n\t\t// if there is no enclosure set, the parameter has to be omited\n\t\tif(strlen(trim($this->conf['enclosure'])) > 0) {\n\t\t\twhile (($arrayLine = fgetcsv($this->resource, 10000, $this->conf['delimiter'], trim($this->conf['enclosure']))) !== FALSE) {\n\t\t\t\t$imploded = trim(implode($arrayLine));\n\t\t\t\tif (strlen($imploded) > 1) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\twhile (($arrayLine = fgetcsv($this->resource, 10000, $this->conf['delimiter'])) !== FALSE) {\n\t\t\t\t$imploded = trim(implode($arrayLine));\n\t\t\t\tif (strlen($imploded) > 1) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t// return values from array with increased key-ids\n\t\tif($arrayLine !== FALSE) {\n\t\t\tforeach($arrayLine as $key => $value){\n\t\t\t\tif(substr(trim($value), - 1) == '\"') {\n\t\t\t\t\t$value = str_replace('\"', '', $value);\n\t\t\t\t\t// if the first characted becomes a \"?\", this means, it is related to this bug: https://bugs.php.net/bug.php?id=63433\n\t\t\t\t\tif(utf8_decode($value[0]) == '?') {\n\t\t\t\t\t\t// so strip the quotes in the beginning\n\t\t\t\t\t\t$value = substr($value, 3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$arrayLine[$key+1] = $value;\n\t\t\t}\n\t\t\treturn $arrayLine;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function readCsv($source) {\n $file = fopen($source, 'r');\n while (($line = fgetcsv($file)) !== FALSE) {\n //$line is an array of the csv elements\n $array_from_csv[] = $line;\n }\n fclose($file);\n\n return $array_from_csv;\n }", "public function getCurrentLine()\n {\n return $this->lineno;\n }", "public function getLine()\n {\n return $this->data[2];\n }", "public function getLine(int $line){\n return $this->file[$line] ?? \"\";\n }", "public function readAtLine($index) {\r\n\t\tif ($this->exists && $index < $this->lines) {\r\n\t\t\t\r\n\t\t\t$lines = $this->readByLine ();\r\n\t\t\treturn trim ( $lines [$index] );\r\n\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private function parse()\n {\n $this->info('Start profiles refresh...');\n // Load the file and\n // parse the csv format\n $path = storage_path(config('constants.stations_infos_path'));\n\n if (($pointer = fopen($path, 'r')))\n {\n DB::beginTransaction();\n $first = true;\n $this->info('Parsing CSV profiles...');\n while (($line = fgetcsv($pointer, 0, ';')))\n {\n // Ignore the first header line\n if (! $first)\n {\n $this->refresh($line);\n }\n $first = false;\n }\n fclose($pointer);\n\n if ($this->commit)\n {\n $this->info('Done. Saving changes...');\n DB::commit();\n }\n else\n {\n $this->info('Error, rollback changes!');\n DB::rollBack();\n }\n }\n }", "public function import_read_record()\n\t{\n // phpcs:enable\n\t\tglobal $conf;\n\n\t\t$arrayres=fgetcsv($this->handle, 100000, $this->separator, $this->enclosure, $this->escape);\n\n\t\t// End of file\n\t\tif ($arrayres === false) return false;\n\n\t\t//var_dump($this->handle);\n\t\t//var_dump($arrayres);exit;\n\t\t$newarrayres=array();\n\t\tif ($arrayres && is_array($arrayres))\n\t\t{\n\t\t\tforeach($arrayres as $key => $val)\n\t\t\t{\n\t\t\t\tif (! empty($conf->global->IMPORT_CSV_FORCE_CHARSET))\t// Forced charset\n\t\t\t\t{\n\t\t\t\t\tif (strtolower($conf->global->IMPORT_CSV_FORCE_CHARSET) == 'utf8')\n\t\t\t\t\t{\n\t\t\t\t\t\t$newarrayres[$key]['val']=$val;\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\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$newarrayres[$key]['val']=utf8_encode($val);\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\t// Autodetect format (UTF8 or ISO)\n\t\t\t\t{\n\t\t\t\t\tif (utf8_check($val))\n\t\t\t\t\t{\n\t\t\t\t\t\t$newarrayres[$key]['val']=$val;\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\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$newarrayres[$key]['val']=utf8_encode($val);\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->col=count($newarrayres);\n\t\t}\n\n\t\treturn $newarrayres;\n\t}", "public function getLine(bool $reindexWithHeader): ?array\n {\n $data = fgetcsv($this->handle, 0, $this->delimiter, $this->enclosure, $this->escapeChar);\n if ($data === false) {\n return null;\n }\n\n ++$this->line;\n\n if ($reindexWithHeader) {\n $data = array_combine($this->header, $data);\n }\n\n return $data;\n }", "public static function getLineEndingCharacterCSV( $filePath ) {\n\t // first, have PHP auto-detect the line endings, like @AbraCadaver suggested:\n\t ini_set(\"auto_detect_line_endings\", true);\n\n\t // now open the file and read a single line from it\n\t $file = fopen($filePath, 'r');\n\t fgets($file);\n\n\t // fgets() moves the pointer, so get the current position\n\t $position = ftell($file);\n\n\t // now get a couple bytes (here: 10) from around that position\n\t fseek($file, $position - 5);\n\t $data = fread($file, 10);\n\n\t // we no longer need the file\n\t fclose($file);\n\n\t // now find out how many of each type EOL there are in those 10 bytes\n\t // expected result is that two of these will be 0 and one will be 1\n\t $eols = array(\n\t \"\\r\\n\" => substr_count($data, \"\\r\\n\"),\n\t \"\\r\" => substr_count($data, \"\\r\"),\n\t \"\\n\" => substr_count($data, \"\\n\"),\n\t );\n\n\t // sort the EOL count in reverse order, so that the EOL with the highest\n\t // count (expected: 1) will be the first item\n\t arsort($eols);\n\n\t // get the first item's key\n\t $eol = key($eols);\n\n\t return $eol;\n\t}", "public function getLine()\n {\n return $this->get(self::_LINE);\n }", "public function readLayoutFromFirstRow(){\n $this->_init();\n $this->_layout = array(); //reset for multiple\n $line = fgetcsv($this->_handle, 4096, ',');\n if(!$line){\n fclose($this->_handle);\n throw new Exception('Invalid File, could not read layout from first row');\n }\n \n foreach($line as $key){\n $this->_layout[] = strtolower($key);\n }\n }", "private function _loadCSVLines(string $csv): array {\n\t\t$rs = $this->_createTmpFile($csv);\n\t\tif (!$rs) {\n\t\t\tthrow new CSVReaderException(\n\t\t\t\t'Error while creating temporary file for processing',\n\t\t\t\tCSVReaderException::FAILED_TO_CREATE_TMP_FILE\n\t\t\t);\n\t\t}\n\t\t$lines = [];\n\t\twhile ($line = fgetcsv($rs, null, $this->_columnDelimiter, $this->_enclosure, $this->_escape)) {\n\t\t\t$lines[] = $line;\n\t\t}\n\t\treturn $lines;\n\t}", "function read_csv()\n {\n $handle = fopen($this->filename, 'r');\n $filesize = filesize($this->filename);\n $openList = [];\n if($filesize != 0) {\n while(!feof($handle)) {\n $openList[] = fgetcsv($handle);\n } \n }else {\n $openList = array();\n }\n fclose($handle);\n return $openList;\n }", "public function getLine():int {\n\t\t\treturn $this->line;\n\t\t}", "function readLine($position)\n {\n\n return isset($this->line[$position]) ? $this->line[$position] : '_';\n }", "private function csvTaskLoad($csv){\n $multiCsvArr = [];\n if(($handle = fopen(\"{$csv}\", \"r\")) !== false){\n while(($dataRow = fgetcsv($handle, 1000, \",\")) !== false){\n $multiCsvArr[] = $dataRow;\n }\n }\n fclose($handle);\n return $multiCsvArr;\n }", "public function rewind(): void\n {\n $this->index = null;\n if ($this->fp) {\n fclose($this->fp);\n }\n $this->fp = fopen($this->filename, 'r');\n if (!$this->fp) {\n throw new Exception('Couldn\\'t open file \"' . $this->filename . '\"');\n }\n if ($this->delimiter === null) {\n $line = fgets($this->fp);\n $this->delimiter = (substr_count($line, ';') > substr_count($line, ',')) ? ';' : ',';\n fseek($this->fp, 0); // rewind\n }\n // Kolommen controleren\n $keys = fgetcsv($this->fp, 0, $this->delimiter, $this->enclosure);\n $column_isset = [];\n foreach ($keys as $column) {\n if (isset($column_isset[$column])) {\n if ($this->columns === null || array_search($column, $this->columns) !== false) {\n throw new Exception('Column \"' . $column . '\" is ambiguous');\n }\n } else {\n $column_isset[$column] = true;\n }\n }\n if ($this->columns === null) {\n $this->keys = $keys;\n } else {\n foreach ($this->columns as $key => $column) {\n $index = array_search($column, $keys);\n if ($index !== false) {\n $this->keys[$index] = $key;\n } else {\n throw new Exception('Column: \"' . $column . '\" not found. Available columns: \"' . implode('\", \"', $keys) . '\"');\n }\n }\n }\n $this->index = -1;\n $this->next();\n }", "public function getLine()\n\t{\n\t\treturn $this->token->line;\n\t}", "function loadLine($a_row)\n\t{\n\t}", "public function getItem() \n\t{\t\t\t\n\t\t$fields = fgetcsv($this->_handle, 0, $this->_csvOptions['delimiter'], $this->_csvOptions['enclosure']);\n\t\tif ($fields === false ) {\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\tif ($fields[0] === null) {\n\t\t\treturn array();\n\t\t}\n\t\treturn array_diff($fields, array(''));\n\t}", "public function readRecord(): ?array\n {\n $this->skipLeadingLines();\n $this->headerRead();\n $this->currentRecord = $this->current();\n\n if (false === $this->currentRecord) {\n throw CsvException::readError(error_get_last()['message'] ?? null);\n }\n if ($this->valid()) {\n if ($this->getStrategy()->doSkipEmptyLines()) {\n while (null !== $this->currentRecord && [] === array_filter($this->currentRecord)) {\n $this->readRecord();\n }\n }\n if ($this->getStrategy()->hasHeader() && $this->getStrategy()->asAssociative()) {\n $this->currentRecord = array_combine($this->getHeader(), $this->currentRecord);\n }\n $this->next();\n return $this->convertRowToUtf8($this->currentRecord);\n }\n\n return null;\n }", "private function explodeBySeparator($line) {\n if ($this -> separator) {\n return str_getcsv($this -> fileContents[$line], $this -> separator);\n } else {\n return $this -> fileContents[$line];\n }\n }", "function read_csv()\n {\n if(filesize ($this->filename) > 0) {\n $handle = fopen($this->filename, \"r\");\n while(($data = fgetcsv($handle)) !==FALSE) {\n $contents[] = $data;\n }\n fclose($handle);\n\n return $contents;\n }\n else\n {\n return array();\n }\n }", "public function read() \n {\n\n if ($this->is_csv) \n {\n return $this->read_csv();\n }\n else\n {\n return $this->read_lines();\n }\n \n }", "function getLine()\r\n {\r\n\t\t\tdo\r\n\t\t\t{\r\n\t\t\t\t$sLine = trim($this->referString[$this->currentLine]);\r\n\t\t\t\t$this->currentLine++;\r\n\t\t\t} while ($this->currentLine < count($this->referString) && !$sLine);\r\n\t\t\treturn $sLine;\r\n }", "public static function getFirstRow($fn){\n $file = new SplFileObject($fn);\n $row = $file->fgetcsv();\n return $row;\n }", "public function nextRawDataItem() {\n\n // Shortcut if we have reached the limit\n if ($this->readItems >= $this->limit)\n return false;\n\n try {\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n $this->readItems++;\n\n // Only continue if we have some content\n if (is_array($csvLine) && trim($csvLine[0])) {\n\n if ($this->skipRegex) {\n preg_match($this->skipRegex, $csvLine[0], $matches);\n if ($matches)\n return null;\n }\n\n $dataItem = [];\n $columnIndex = 0;\n foreach ($csvLine as $index => $value) {\n if (!in_array($index, $this->ignoreColumnIndexes) && (!$this->skipBlankColumnValues || trim($value))) {\n\n // Ensure we have enough columns\n if (!isset($this->csvColumns[$columnIndex]))\n $this->csvColumns[] = new Field(\"column\" . (sizeof($this->csvColumns) + 1));\n\n if (isset($this->csvColumns[$columnIndex]))\n $dataItem[$this->csvColumns[$columnIndex]->getName()] = trim($value);\n $columnIndex++;\n }\n }\n\n return $dataItem;\n } else {\n return null;\n }\n\n\n } catch (StreamException $e) {\n return false;\n }\n\n }", "function GetValuesFromCSV($path)\n{\n\n if (($handle = fopen($path, 'a+')) !== FALSE) {\n $animaux = array();\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n list($Nope, $animaux[$data[0]]) = $data;\n\n }\n fclose($handle);\n return $animaux;\n\n }else{\n return false;\n }\n}", "public function fetch()\n {\n static $currentLine = 0;\n $dataResult = array();\n\n if (isset($this->options['skipHeader']) && $this->options['skipHeader'] === true) {\n $skipLines = 1;\n } elseif (isset($this->options['skipHeader']) && \\is_numeric($this->options['skipHeader'])) {\n $skipLines = (int)$this->options['skipHeader'];\n } else {\n $skipLines = 0;\n }\n if (($handle = fopen($this->csvFilePath, 'r')) !== false) {\n while (($data = fgetcsv($handle, 65534, $this->csvDelimiter, $this->csvEnclosure)) !== false) {\n // skip header (maybe is better to set the first offset position instead)\n if ($currentLine < $skipLines) {\n $currentLine++;\n continue;\n }\n if ($currentLine >= $this->offset && $currentLine < ($this->offset + $this->limit)) {\n if (isset($data[0]) && $data[0] !== '') {\n $this->preProcessRecordData($data);\n $dataResult[] = $data;\n }\n }\n $currentLine++;\n }\n fclose($handle);\n }\n $this->logger->debug(sprintf('%s: read %s lines and found %s records.', $this->csvFilePath, $currentLine, count($dataResult)));\n return $dataResult;\n }", "function readLine();", "public function readerGetLines();", "public function actionImportFromCsv()\n {\n HBackup::importDbFromCsv($this->csvFile);\n }", "static public function first($filename)\n {\n $records = csv::getfollowing($filename);\n print_r($records);\n }", "public function next()\n {\n $this->_currentElement = fgets($this->_handle, self::LINE_LENGTH);\n $this->_currentIndex++;\n }", "private function read()\n {\n $out = fgetcsv($this->handle, null, $this->delimiter, $this->enclosure);\n\n if (!is_array($out)) {\n return $out;\n }\n\n if (config('csv.encoding.reader.enabled') === true) {\n foreach ($out as $k => $v) {\n $out[$k] = iconv(\n config('csv.encoding.reader.from'),\n config('csv.encoding.reader.to'),\n $v\n );\n }\n }\n\n return $out;\n }", "function clients_importGetSegementOfFile($file,$startline,$endline,$mapping=null) {\n\t## then we open the the new file and start reading it\n\n\t$handle = fopen($file,\"r\"); \n\n\t$fields = array();\n\t$data = array();\n\t$linecount = 0;\n\t## let's position the filepointer- and while we are at it read the fields form the first line\n\twhile($linecount <= $startline && ($current_data = fgetcsv($handle, 24000, \",\")) != false) {\t\n\t\tif($linecount == 0) {\n \t\t$fields = $current_data;\n \t} \n\t\t$linecount++;\n }\n \n ## assing the mapping\n \tif(!isset($mapping)) {\n \t\t$mapping = $fields;\n \t}\n \n \n ## okay now we can start to read form start to end\n\t$item = 0;\n\n\twhile(($current_data = fgetcsv($handle, 24000, \",\",'\"')) != false && $linecount <= $endline) {\t\n\t\t$num = count($current_data);\n\t\tfor ($c=0; $c < $num; $c++) {\n\t\t\tif(!empty($mapping[$c])) {\n\t\t\t\t$data[$item][$mapping[$c]] = addslashes($current_data[$c]);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t$linecount++;\n\t\t$item++;\n }\n\t\n\tfclose($handle);\n\treturn array('data'=>$data);\n}", "public function readCsvCBS() {\n // Check if the source file is available\n if( ! self::isFileAvailable( self::CBS_INHABITANTS_SOURCE_CSV_FILE ) ) {\n return false;\n }\n $header = NULL;\n $data = array();\n if (($handle = fopen( self::CBS_INHABITANTS_SOURCE_CSV_FILE, 'r')) !== FALSE) {\n while (($row = fgetcsv($handle, 1000, SELF::CBS_INHABITANTS_SOURCE_CSV_FILE_DELIMITER )) !== FALSE) {\n if( ! $header ) { // first line is the header\n $fieldsCount = count( $row );\n $header = array( self::HEADER_CITY_CODE, self::HEADER_CITY_NAME, self::HEADER_INHABITANTS );\n } else { // add a line of csv-data to our data array\n if( count( $row ) == $fieldsCount ) {\n $data[] = array_combine($header, array( $row[0], $row[1], $row[2] ) );\n }\n }\n }\n fclose($handle);\n }\n return $data;\n }", "public function row($idx) {\n\n if (!is_int($idx)) {\n throw new InvalidArgumentException(\"Row index must be an integer\");\n }\n\n $this->lastRow = $this->file()->key();\n\n $this->file()->seek($idx);\n\n $rval = new CSVRow(\n $this->getMapper(),\n $idx,\n $this->file->current()\n );\n\n $this->file()->seek($this->lastRow);\n\n return $rval;\n }", "public function next() {\r\n\t\t$line = parent::next();\r\n\t\tif (!is_null($line)) {\r\n\t\t\t$this->position++;\r\n\t\t\t$this->lastLine = $this->parse($line);\r\n\t\t\treturn $this->lastLine;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public function importCsv()\n {\n $file = fopen($_FILES['csvFile']['tmp_name'], \"r\");\n $payments = array();\n while (!feof($file)) {\n $row = fgetcsv($file, 0, \"\\t\");\n if (count($row) == 14 && $row[0] != \"Kirjauspäivä\") {\n $dateOfPayment = new \\DateTime($row[2]);\n $values = array(\n 'date_of_payment' => $dateOfPayment->format('Y-m-d H:i:s'),\n 'amount' => $this->makeFloat($row[3]),\n 'reference_number' => $row[8],\n 'amount_left' => 0,\n );\n $payments[] = new Payment($values);\n }\n }\n fclose($file);\n $insert = $this->paymentRepository->insert($payments);\n if ($insert !== true) {\n $message = \"Maksujen kirjaamisessa tapahtui virhe.<br />\" . $insert;\n $error = array(\"error\" => $message);\n ErrorService::setErrors($error);\n return;\n }\n Redirect::to(\"/maksut/syotto\", array(\"success\" => \"Maksut kirjattu onnistuneesti.\"));\n\n }", "function import_csv()\n {\n $msg = 'OK';\n $path = JPATH_ROOT.DS.'tmp'.DS.'com_condpower.csv';\n if (!$this->_get_file_import($path))\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_UPLOAD_IMPORT_CSV_FILE'));\n }\n// $_data = array(); \n if ($fp = fopen($path, \"r\"))\n {\n while (($data = fgetcsv($fp, 1000, ';', '\"')) !== FALSE) \n {\n unset($_data);\n $_data['virtuemart_custom_id'] = $data[0];\n $_data['virtuemart_product_id'] = $data[1];\n $id = $this->_find_id($_data['virtuemart_custom_id'],$_data['virtuemart_product_id']);\n if((int)$id>0)\n {\n $_data['id'] = $id;\n }\n// $_data['intvalue'] = iconv('windows-1251','utf-8',$data[3]);\n $_data['intvalue'] = str_replace(',', '.', iconv('windows-1251','utf-8',$data[3]));\n if(!$this->_save($_data))\n {\n $msg = 'ERROR';\n }\n }\n fclose($fp);\n }\n else\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_OPEN_TO_IMPORT'));\n }\n return array(TRUE,$msg);\n }", "protected function readFromFile(CsvFile $csvFile): int\n {\n $delimeter = $this->detectDelimiter($csvFile->getFilePath());\n if (($handle = fopen($csvFile->getFilePath(), \"r\")) !== FALSE) {\n foreach($this->readFromFileHandle($csvFile->getId(), $handle, $delimeter) as $batch_data) {\n $this->dm->flush();\n }\n }\n\n return -1;\n }", "function currentRow();", "public function readFromRow( $row );" ]
[ "0.76192117", "0.74989116", "0.68352777", "0.6786517", "0.67586595", "0.67273116", "0.6681796", "0.6668346", "0.6383161", "0.63566315", "0.6352218", "0.613201", "0.61230797", "0.6110963", "0.6109697", "0.603642", "0.60311264", "0.60184616", "0.60005164", "0.5987377", "0.59590197", "0.5926906", "0.591889", "0.5908955", "0.5904512", "0.5832797", "0.5795065", "0.5791888", "0.5791888", "0.5791888", "0.5791888", "0.5791888", "0.5791888", "0.578856", "0.57719404", "0.57661897", "0.5760284", "0.5748914", "0.5717972", "0.5686135", "0.56786734", "0.5678331", "0.5670368", "0.5668627", "0.5664611", "0.5655612", "0.56521755", "0.5632775", "0.5611334", "0.55977535", "0.5589067", "0.55727273", "0.5564568", "0.5564568", "0.5546579", "0.55399066", "0.5539655", "0.5518021", "0.5514828", "0.5504335", "0.54932874", "0.54927593", "0.5468244", "0.54553705", "0.5436399", "0.54322565", "0.54302984", "0.54222906", "0.54131407", "0.53976834", "0.5373695", "0.53595054", "0.5357951", "0.5345076", "0.53387", "0.53383744", "0.53345823", "0.5327584", "0.531736", "0.5310134", "0.53098077", "0.53086734", "0.53014237", "0.5301055", "0.5300727", "0.52999747", "0.5299618", "0.5288171", "0.52851355", "0.52810603", "0.5280281", "0.5278136", "0.527704", "0.52730477", "0.52598965", "0.52561796", "0.52556664", "0.5253634", "0.52454907", "0.52386075", "0.5233248" ]
0.0
-1
Read all lines from CSV file
public function readAll() { $out = []; while (($row = $this->readLine()) !== false) { $out[] = $row; } return $out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function readCsv()\n {\n ini_set(\"auto_detect_line_endings\", true);\n $fp = fopen($this->inputFile , 'r');\n while($row = fgetcsv($fp)){\n $this->data[] = $row;\n }\n }", "private function read_csv()\n {\n return array_map('str_getcsv', file($this->filename));\n ////OR\n // $handle = fopen('$this->filename', 'r');\n // $contacts = [];\n // while(!feof($handle)) {\n // $contacts[] = fgetcsv($handle);\n // }\n // fclose($handle); \n }", "function read_csv()\n {\n if(filesize ($this->filename) > 0) {\n $handle = fopen($this->filename, \"r\");\n while(($data = fgetcsv($handle)) !==FALSE) {\n $contents[] = $data;\n }\n fclose($handle);\n\n return $contents;\n }\n else\n {\n return array();\n }\n }", "function readLine(){\n $data = fgetcsv($this->handle,0,\";\");\n return $data; \n \n }", "function readUploadedCSV($tmp_name) {\n\t $lines = array();\n\n\t ini_set('auto_detect_line_endings',1);\n\t $handle = fopen($tmp_name, \"r\");\n\t while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n\t\t array_push($lines,$data);\t\t\t \n\t }\n\t return $lines;\n }", "function readCsv($filename) {\n // your code here\n $handle = fopen($filename, \"r\");\n $result = [];\n\n while(!feof($handle)){\n $result[] = fgetcsv($handle);\n }\n fclose($handle);\n return $result;\n }", "private function _loadCSVLines(string $csv): array {\n\t\t$rs = $this->_createTmpFile($csv);\n\t\tif (!$rs) {\n\t\t\tthrow new CSVReaderException(\n\t\t\t\t'Error while creating temporary file for processing',\n\t\t\t\tCSVReaderException::FAILED_TO_CREATE_TMP_FILE\n\t\t\t);\n\t\t}\n\t\t$lines = [];\n\t\twhile ($line = fgetcsv($rs, null, $this->_columnDelimiter, $this->_enclosure, $this->_escape)) {\n\t\t\t$lines[] = $line;\n\t\t}\n\t\treturn $lines;\n\t}", "public function getCSV() {\n $handle = fopen($this->_csv_file, \"r\");\n $array_line_full = array();\n\n while (($line = fgetcsv($handle, 0, \",\")) !== FALSE) {\n $array_line_full[] = $line;\n }\n fclose($handle);\n return $array_line_full;\n }", "function read_csv()\n {\n $handle = fopen($this->filename, 'r');\n $filesize = filesize($this->filename);\n $openList = [];\n if($filesize != 0) {\n while(!feof($handle)) {\n $openList[] = fgetcsv($handle);\n } \n }else {\n $openList = array();\n }\n fclose($handle);\n return $openList;\n }", "function importAll() {\n $row = 1;\n $data = array();\n if ($GLOBALS[\"handle\"]) {\n while (($line = fgetcsv($GLOBALS[\"handle\"])) !== false) {\n \n if ($row == 1 || $row == 2) { $row++; continue; } //skip rows 1 and 2.\n \n $identify = rtrim(sprintf(\"%04d\\n\", $line[1])).ltrim(sprintf(\"%04d\\n\", $line[3]));\n $data[$identify] = array(\"cityCode\"=>$line[1], \"cityName\"=>$line[2], \"streetCode\"=>$line[3], \"streetName\"=>$line[4]);\n $row++;\n }\n fclose($GLOBALS[\"handle\"]);\n } else {\n return 0; //error read file\n }\n return $data;\n}", "private function csvTaskLoad($csv){\n $multiCsvArr = [];\n if(($handle = fopen(\"{$csv}\", \"r\")) !== false){\n while(($dataRow = fgetcsv($handle, 1000, \",\")) !== false){\n $multiCsvArr[] = $dataRow;\n }\n }\n fclose($handle);\n return $multiCsvArr;\n }", "public function getLine(){\n $obj = new SplFileObject($this->_csv_file);\n $obj->seek($this->_counter);\n if($this->_counter < $this->_number_of_lines){\n $this->_counter++;\n $arr = $obj->fgetcsv($this->_delimiter);\n }else{\n $arr = null;\n }\n $obj = null;\n return $arr;\n }", "protected function parseCsv() {\r\n\t\t\r\n\t\t$csv_data = array();\r\n\t\twhile ($this->_currentRow = fgetcsv($this->_fileHandler, null, $this->_delimiter, $this->_enclosure)) {\r\n\t\t\t$csv_data[] = $this->_currentRow;\r\n\t\t}\r\n\t\t\r\n\t\t$this->_data = $csv_data;\r\n\t}", "public function fetch()\n {\n static $currentLine = 0;\n $dataResult = array();\n\n if (isset($this->options['skipHeader']) && $this->options['skipHeader'] === true) {\n $skipLines = 1;\n } elseif (isset($this->options['skipHeader']) && \\is_numeric($this->options['skipHeader'])) {\n $skipLines = (int)$this->options['skipHeader'];\n } else {\n $skipLines = 0;\n }\n if (($handle = fopen($this->csvFilePath, 'r')) !== false) {\n while (($data = fgetcsv($handle, 65534, $this->csvDelimiter, $this->csvEnclosure)) !== false) {\n // skip header (maybe is better to set the first offset position instead)\n if ($currentLine < $skipLines) {\n $currentLine++;\n continue;\n }\n if ($currentLine >= $this->offset && $currentLine < ($this->offset + $this->limit)) {\n if (isset($data[0]) && $data[0] !== '') {\n $this->preProcessRecordData($data);\n $dataResult[] = $data;\n }\n }\n $currentLine++;\n }\n fclose($handle);\n }\n $this->logger->debug(sprintf('%s: read %s lines and found %s records.', $this->csvFilePath, $currentLine, count($dataResult)));\n return $dataResult;\n }", "public function readLines();", "public function parse()\n {\n if ($handle = fopen($this->csv, 'r'))\n {\n while ($data = fgetcsv($handle, \",\"))\n {\n $this->dataArray[] = $data;\n }\n }\n fclose($handle);\n }", "public function readCsvCBS() {\n // Check if the source file is available\n if( ! self::isFileAvailable( self::CBS_INHABITANTS_SOURCE_CSV_FILE ) ) {\n return false;\n }\n $header = NULL;\n $data = array();\n if (($handle = fopen( self::CBS_INHABITANTS_SOURCE_CSV_FILE, 'r')) !== FALSE) {\n while (($row = fgetcsv($handle, 1000, SELF::CBS_INHABITANTS_SOURCE_CSV_FILE_DELIMITER )) !== FALSE) {\n if( ! $header ) { // first line is the header\n $fieldsCount = count( $row );\n $header = array( self::HEADER_CITY_CODE, self::HEADER_CITY_NAME, self::HEADER_INHABITANTS );\n } else { // add a line of csv-data to our data array\n if( count( $row ) == $fieldsCount ) {\n $data[] = array_combine($header, array( $row[0], $row[1], $row[2] ) );\n }\n }\n }\n fclose($handle);\n }\n return $data;\n }", "public function readCsv($source) {\n $file = fopen($source, 'r');\n while (($line = fgetcsv($file)) !== FALSE) {\n //$line is an array of the csv elements\n $array_from_csv[] = $line;\n }\n fclose($file);\n\n return $array_from_csv;\n }", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "public function readFile()\n {\n $handle = fopen($this->fileSource, \"r\");\n $result = [];\n\n while ($csvLine = fgetcsv($handle, 1000, \",\")) {\n\n if ($this->header) {\n $this->header = false;\n } else {\n $operationDate = $csvLine[0];\n $userIdentificator = $csvLine[1];\n $userType = $csvLine[2];\n $operationType = $csvLine[3];\n $operationAmount = $csvLine[4];\n $operationCurrency = $csvLine[5];\n\n if (array_key_exists($userIdentificator, $this->users)) {\n $user = $this->users[$userIdentificator];\n } else {\n $user = new User($userIdentificator, $userType);\n $this->users[$userIdentificator] = $user;\n }\n\n try {\n $operation = new Operation(\n $operationDate, $operationType, $operationAmount, $this->currencies[$operationCurrency], $user\n );\n $result[] = $operation;\n } catch (\\Exception $e) {\n //echo $e->getMessage();\n }\n }\n }\n\n return $result;\n }", "function readCSV($url) {\n $row = 0;\n $readData = [];\n print_r(\"Opening CSV File ... \");\n if (($handle = fopen($url, \"r\")) !== FALSE) {\n print_r(\"SUCCESS\\n\");\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n if($row!=0) { // skip first row\n $readData[$row] = $data;\n }\n $row++;\n }\n fclose($handle);\n return $readData;\n } else {\n print_r(\"FAIL\\n\");\n return null;\n }\n}", "public function readerGetLines();", "private function read_csv()\n {\n $address_book = [];\n $handle = fopen($this->filename, 'r');\n while(!feof($handle)){\n $row = fgetcsv($handle);\n if(is_array($row)){\n $address_book[] = $row;\n }\n }\n fclose($handle);\n return $address_book;\n }", "function read_csv($filename, $delimiter = \",\") {\n $file_data = array();\n $handle = @fopen($filename, \"r\") or false;\n if ($handle !== FALSE) {\n while (($data = fgetcsv($handle, 1000, $delimiter)) !== FALSE) {\n $file_data[] = $data;\n }\n fclose($handle);\n }\n return $file_data;\n}", "public function get()\n {\n $is_first = true;\n $keys = [];\n $data = [];\n $count = 0;\n\n $file = new SplFileObject($this->csv_file_path);\n\n while(!$file->eof())\n {\n /**\n * $file->fgets()\n * 呼び出す度に次の行に移動してしまうので注意する\n */\n $input = $file->fgets();\n\n /**\n * 空行は除外する\n */\n if(empty($input)) continue;\n\n $line = str_getcsv($input);\n\n if($is_first)\n {\n $keys = $line;\n $count = count($keys);\n $is_first = false;\n continue;\n }\n\n /**\n * ヘッダー行と異なる要素数のデータは除外する\n */\n if($count != count($line)) continue;\n\n foreach ($keys as $index => $key) {\n $tmp[$key] = $line[$index];\n }\n $data[] = $tmp;\n }\n return $data;\n }", "public function readCSV(): array\n {\n $mydata = [];\n\n if ((int)$this->indata['newFileUid'] < 1) {\n return $mydata;\n }\n\n $fileAbsolutePath = $this->getFileAbsolutePath((int)$this->indata['newFileUid']);\n\n $delimiter = $this->indata['delimiter'] ?: 'comma';\n $encaps = $this->indata['encapsulation'] ?: 'doubleQuote';\n $delimiter = ($delimiter === 'comma') ? ',' : $delimiter;\n $delimiter = ($delimiter === 'semicolon') ? ';' : $delimiter;\n $delimiter = ($delimiter === 'colon') ? ':' : $delimiter;\n $delimiter = ($delimiter === 'tab') ? \"\\t\" : $delimiter;\n $encaps = ($encaps === 'singleQuote') ? \"'\" : $encaps;\n $encaps = ($encaps === 'doubleQuote') ? '\"' : $encaps;\n\n ini_set('auto_detect_line_endings', true);\n $handle = fopen($fileAbsolutePath, 'r');\n if ($handle === false) {\n return $mydata;\n }\n\n while (($data = fgetcsv($handle, 10000, $delimiter, $encaps)) !== false) {\n // remove empty line in csv\n if ((count($data) >= 1)) {\n $mydata[] = $data;\n }\n }\n fclose($handle);\n reset($mydata);\n $mydata = $this->convCharset($mydata);\n ini_set('auto_detect_line_endings', false);\n return $mydata;\n }", "private function read_csv() //address book\n {\n $addresses = [];\n $handle = fopen($this->filename, \"r\");\n while (!feof($handle)) \n {\n $row = fgetcsv($handle);\n if(is_array($row)) \n {\n $addresses[] = $row;\n }\n }\n fclose($handle);\n return $addresses;\n }", "function parseCsv($csv) {\n $lines = explode(\"\\n\", $csv);\n $result = array();\n foreach($lines as $line) {\n if (!empty($line)) {\n $result[] = parseCsvLine($line);\n }\n }\n return $result;\n}", "function readCSV($csvFile) {\n if (file_exists($csvFile)) {\n $file_handle = fopen($csvFile, 'r');\n\n while (!feof($file_handle) ) {\n $line_of_text[] = fgetcsv($file_handle, 1024);\n }\n\n fclose($file_handle);\n return $line_of_text;\n } else {\n return null;\n }\n}", "public function parse_csv () {\n $data = array();\n $header = fgetcsv($this->file);\n array_walk($header, create_function('&$val', '$val = trim($val);'));\n while ($row = fgetcsv($this->file)) {\n array_walk($row, create_function('&$val', '$val = trim($val);'));\n $data[] = array_combine($header, $row);\n \n }\n\n return $data;\n }", "private function read_lines()\n {\n return $array = file($this->filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n }", "public function next(): void\n {\n $this->values = [];\n $row = fgetcsv($this->fp, 0, $this->delimiter, $this->enclosure);\n\n if ($row) { // Is het einde (eof) nog niet bereikt?\n if ($row === array(null)) { // Empty row?\n $this->next(); // Skip row\n return;\n }\n ++$this->index;\n foreach ($this->keys as $index => $key) {\n if (isset($row[$index])) { // Is er voor deze kolom een waarde?\n $this->values[$key] = $row[$index];\n } else {\n $filename = (strpos($this->filename, \\Sledgehammer\\PATH) === 0) ? substr($this->filename, strlen(\\Sledgehammer\\PATH)) : $this->filename; // Waar mogelijk het PATH er van af halen\n \\Sledgehammer\\notice('Row too short, missing column #' . ($index + 1) . ': \"' . $this->keys[$index] . '\" in ' . $filename . ' on line ' . ($this->index + 2), $row); // @todo Calculate line offset compared to the index ()\n }\n }\n } else {\n $this->index = null;\n }\n }", "public function parse()\n {\n $this->file = fopen($this->filename, 'r');\n $lineCount = 0;\n\n while (($line = fgetcsv(\n $this->file,\n 0,\n $this->delimiter,\n $this->enclosure,\n $this->escape\n )) !== false) {\n if ($lineCount++ == 0) {\n $line[0] = StringUtils::removeBOM($line[0]);\n $this->setHeader($line);\n\n if ($this->hasHeader) {\n continue;\n }\n }\n\n $this->parseLine($line);\n }\n\n fclose($this->file);\n }", "private function read_csv() //public function read_address_book()\n { //code to read file $this->filename\n $handle = fopen($this->filename, 'r');\n $address_book= []; //read each line of CSV and add rows to empty addresses array\n \n \n while(!feof($handle)){\n $row = fgetcsv($handle);\n if(is_array($row)){\n $address_book[] = $row; //does the same thing as array_push($address_book, $row); \n }\n }\n fclose($handle);\n return $address_book;\n }", "public function process(){\n if(!$this->_init){\n $this->_init();\n }\n $line = fgetcsv($this->_handle, 4096);\n if(!$line){\n fclose($this->_handle);\n return false;\n }\n $i = 0;\n $row = array();\n foreach($this->_layout as $key){\n if(isset($line[$i])){\n $row[$key] = $line[$i];\n } else {\n $row[$key] = NULL;\n }\n $i++;\n }\n $this->_row = $row;\n return true;\n }", "public function import_read_record()\n\t{\n // phpcs:enable\n\t\tglobal $conf;\n\n\t\t$arrayres=fgetcsv($this->handle, 100000, $this->separator, $this->enclosure, $this->escape);\n\n\t\t// End of file\n\t\tif ($arrayres === false) return false;\n\n\t\t//var_dump($this->handle);\n\t\t//var_dump($arrayres);exit;\n\t\t$newarrayres=array();\n\t\tif ($arrayres && is_array($arrayres))\n\t\t{\n\t\t\tforeach($arrayres as $key => $val)\n\t\t\t{\n\t\t\t\tif (! empty($conf->global->IMPORT_CSV_FORCE_CHARSET))\t// Forced charset\n\t\t\t\t{\n\t\t\t\t\tif (strtolower($conf->global->IMPORT_CSV_FORCE_CHARSET) == 'utf8')\n\t\t\t\t\t{\n\t\t\t\t\t\t$newarrayres[$key]['val']=$val;\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\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$newarrayres[$key]['val']=utf8_encode($val);\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\t// Autodetect format (UTF8 or ISO)\n\t\t\t\t{\n\t\t\t\t\tif (utf8_check($val))\n\t\t\t\t\t{\n\t\t\t\t\t\t$newarrayres[$key]['val']=$val;\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\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$newarrayres[$key]['val']=utf8_encode($val);\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->col=count($newarrayres);\n\t\t}\n\n\t\treturn $newarrayres;\n\t}", "function loadCSV($filename) {\n // Assume we are following the format of:\n // +15554442222,[email protected]\n $csvArray = array(); \n if (($handle = fopen($filename, \"r\")) !== FALSE) {\n while (($row = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n $csvArray[\"$row[0]\"] = \"$row[1]\";\n }\n if (!feof($handle)) {\n error_log(\"Error: unexpected fgets() fail\\n\");\n }\n }\n fclose($handle);\n\n return $csvArray;\n}", "public static function file_get_contents_csv($path, $delimiter = ',') {\n $rows = [];\n if (($handle = fopen($path, \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, null, $delimiter)) !== FALSE) {\n $rows[] = $data;\n }\n fclose($handle);\n }\n return $rows;\n }", "private function read()\n {\n $out = fgetcsv($this->handle, null, $this->delimiter, $this->enclosure);\n\n if (!is_array($out)) {\n return $out;\n }\n\n if (config('csv.encoding.reader.enabled') === true) {\n foreach ($out as $k => $v) {\n $out[$k] = iconv(\n config('csv.encoding.reader.from'),\n config('csv.encoding.reader.to'),\n $v\n );\n }\n }\n\n return $out;\n }", "function readCSV($csvFile, $array){\n $file_handle = fopen($csvFile, 'r');\n while (!feof($file_handle)) {\n $line_of_text[] = fgetcsv($file_handle, 0, $array['delimiter']);\n }\n array_shift($line_of_text);\n array_pop($line_of_text);\n fclose($file_handle);\n return $line_of_text;\n}", "function readCsv($fileName) {\n\n\t// Lecture du fichier src :\n\t$myfile = fopen($fileName, \"r\") or die(\"Unable to open file!\");\n\t$dataStr = fread($myfile,filesize($fileName));\n\tfclose($myfile);\n\n\t$lines = explode(\"\\n\", $dataStr);\n\t$days = array();\n\n\tforeach ($lines as $line) {\n\t\t$temp = explode(\";\", $line);\n\t\tif (count($temp) == 2) {\n\t\t\tarray_push($days, new Day($temp[0], $temp[1]));\n\t\t}\n\t}\n\treturn $days;\n}", "protected function loadFromFile() {\n $columns = [];\n\n while ( ! $this->file->eof()) {\n $row = (array)$this->file->fgetcsv();\n\n if (empty($columns)) {\n $columns = $row;\n continue;\n }\n\n $row = array_filter($row);\n\n if (empty($row)) {\n continue;\n }\n\n $attributes = array_fill_keys($columns, null);\n\n foreach ($row as $index => $value) {\n $attributes[$columns[$index]] = $value;\n }\n\n $model = $this->model->newInstance($attributes, true);\n\n $this->records[$model->id] = $model;\n }\n }", "public function getCsvContent(): \\Generator {\n foreach (parent::getCsvContent() as $line) {\n if (!$this->isLineInDepartement($line)) {\n continue;\n }\n\n $line['file'] = 'import';\n yield $line;\n }\n foreach ($this->epciImporter->getCsvContent() as $line) {\n $line['file'] = 'update';\n yield $line;\n }\n }", "public function readAddressBook()\n {\n $addresses = [];\n // read each line of CSV and add rows to addresses array\n // todo\n $handle = fopen($this->filename, \"r\");\n while (!feof($handle)) \n {\n \t$row = fgetcsv($handle);\n \tif (is_array($row)) \n {\n \t\t$addresses[] = $row; // array_push($addresses, $row);\n \t}\n }\n fclose($handle);\n return $addresses;\n }", "public function read() \n {\n\n if ($this->is_csv) \n {\n return $this->read_csv();\n }\n else\n {\n return $this->read_lines();\n }\n \n }", "public function getAllLines();", "public function getAllLines();", "protected function readLine()\n\t{\n\t\tif(!$this->handle) return false;\n\t\t$strLine = fgets($this->handle);\n\t\tif($strLine === false) return false;\n\n\t\t// reencode characters\n\t\tif($this->csvEncoding != 'UTF-8')\n\t\t{\n\t\t\t$strLine = iconv($this->csvEncoding, 'UTF-8', $strLine);\n\t\t}\n\n\t\treturn str_getcsv($strLine,$this->csvDelimiter,$this->csvEnclosure,$this->csvEscape);\n\t}", "public function load()\n {\n $this->data = array();\n $this->handler->rewind();\n\n if ($this->headers) {\n $headers = $this->handler->fgetcsv();\n }\n\n while (! $this->handler->eof()) {\n $row = $this->handler->fgetcsv();\n\n // @NOTE: PHP Bug: 55807 and 61032, returns new line char as null.\n if (is_null($row[0])) continue;\n\n $row = ($this->headers ? array_combine($headers, $row) : $row);\n array_push($this->data, $row);\n }\n\n return $this;\n }", "public static function readFile($filename) {\n\n $data = array();\n\n $lines = file($filename, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);\n $num_rows = count($lines);\n\n foreach ($lines as $line) {\n $csv = str_getcsv($line);\n if (count(array_filter($csv)) == 0) {\n $num_rows--;\n } else {\n array_push($data, $line);\n }\n }\n return $data;\n }", "private function get_csv_data() {\n if (!is_resource($this->fh) || get_resource_type($this->fh) !== \"stream\") {\n $this->log_it(\"CSV file not open when get_csv_data() called.\");\n return false;\n }\n\n // Consume/discard header row, if it exists.\n if (HEADER_ROW_EXISTS) {\n fgets($this->fh);\n $row_num = 2;\n } else {\n $row_num = 1;\n }\n\n $graded_reg_codes = STUDENT_REGISTERED_CODES;\n $audit_reg_codes = is_null(STUDENT_AUDIT_CODES) ? array() : STUDENT_AUDIT_CODES;\n $latedrop_reg_codes = is_null(STUDENT_LATEDROP_CODES) ? array() : STUDENT_LATEDROP_CODES;\n $all_valid_reg_codes = array_merge($graded_reg_codes, $audit_reg_codes, $latedrop_reg_codes);\n $unexpected_term_codes = array();\n\n // Read and assign csv rows into $this->data array\n $row = fgetcsv($this->fh, 0, CSV_DELIM_CHAR);\n while(!feof($this->fh)) {\n // Course is comprised of an alphabetic prefix and a numeric suffix.\n $course = strtolower($row[COLUMN_COURSE_PREFIX] . $row[COLUMN_COURSE_NUMBER]);\n\n // Trim whitespace from all fields in $row.\n array_walk($row, function(&$val, $key) { $val = trim($val); });\n\n // Remove any leading zeroes from \"integer\" registration sections.\n if (ctype_digit($row[COLUMN_SECTION])) $row[COLUMN_SECTION] = ltrim($row[COLUMN_SECTION], \"0\");\n\n switch(true) {\n // Check that $row has an appropriate student registration.\n case array_search($row[COLUMN_REGISTRATION], $all_valid_reg_codes) === false:\n // Skip row.\n break;\n\n // Check that $row is associated with the current term (if check is enabled)\n // Assume this check is OK, when EXPECTED_TERM_CODE is null (check disabled)\n case is_null(EXPECTED_TERM_CODE) ? false : $row[COLUMN_TERM_CODE] !== EXPECTED_TERM_CODE:\n // Note the unexpected term code for logging, if not already noted.\n if (array_search($row[COLUMN_TERM_CODE], $unexpected_term_codes) === false) {\n $unexpected_term_codes[] = $row[COLUMN_TERM_CODE];\n }\n break;\n\n // Check that $row is associated with the course list.\n case array_search($course, $this->course_list) !== false:\n if (validate::validate_row($row, $row_num)) {\n // Include $row\n $this->data[$course][] = $row;\n\n // $row with a blank email is included, but it is also logged.\n if ($row[COLUMN_EMAIL] === \"\") {\n $this->log_it(\"Blank email found for user {$row[COLUMN_USER_ID]}, row {$row_num}.\");\n }\n } else {\n // There is a problem with $row, so log the problem and skip.\n $this->invalid_courses[$course] = true;\n $this->log_it(validate::$error);\n }\n break;\n\n // Check that the $row is associated with a mapped course.\n case array_key_exists($course, $this->mapped_courses):\n // Also verify that the section is mapped.\n $section = $row[COLUMN_SECTION];\n if (array_key_exists($section, $this->mapped_courses[$course])) {\n $m_course = $this->mapped_courses[$course][$section]['mapped_course'];\n if (validate::validate_row($row, $row_num)) {\n // Include $row.\n $row[COLUMN_SECTION] = $this->mapped_courses[$course][$section]['mapped_section'];\n $this->data[$m_course][] = $row;\n\n // $row with a blank email is allowed, but it is also logged.\n if ($row[COLUMN_EMAIL] === \"\") {\n $this->log_it(\"Blank email found for user {$row[COLUMN_USER_ID]}, row {$row_num}.\");\n }\n } else {\n // There is a problem with $row, so log the problem and skip.\n $this->invalid_courses[$m_course] = true;\n $this->log_it(validate::$error);\n }\n }\n break;\n\n default:\n // Skip row by default.\n break;\n\n } // END switch (true)\n\n $row = fgetcsv($this->fh, 0, CSV_DELIM_CHAR);\n $row_num++;\n }\n\n // Log any unexpected term codes.\n // This may provide a notice that the next term's data is available.\n if (!empty($unexpected_term_codes)) {\n $msg = \"Unexpected term codes in CSV: \";\n $msg .= implode(\", \", $unexpected_term_codes);\n $this->log_it($msg);\n }\n\n /* ---------------------------------------------------------------------\n There may be \"fake\" or \"practice\" courses in Submitty that shouldn't be\n altered by the autofeed. These courses will have no enrollments in the\n csv file as these courses are not recognized by the registrar.\n --------------------------------------------------------------------- */\n\n // Filter out any \"empty\" courses so they are not processed.\n // There shouldn't be any \"empty\" course data, but this is just in case.\n $this->data = array_filter($this->data, function($course) { return !empty($course); }, 0);\n\n // Most runtime involves the database, so we'll release the CSV now.\n $this->close_csv();\n\n // Done.\n return true;\n }", "public function importData(){\n $status = false;\n\n // rtrim(); for arrays (removes empty values) from the end\n $rtrim = function($array = [], $lengthMin = false){\n $length = key(array_reverse(array_diff($array, ['']), 1))+1;\n $length = $length < $lengthMin ? $lengthMin : $length;\n return array_slice($array, 0, $length);\n };\n\n if(static::$enableDataImport){\n $filePath = $this->getF3()->get('EXPORT') . 'csv/' . $this->getTable() . '.csv';\n\n if(is_file($filePath)){\n $handle = @fopen($filePath, 'r');\n $keys = array_map('lcfirst', fgetcsv($handle, 0, ';'));\n $keys = $rtrim($keys);\n\n if(count($keys) > 0){\n $tableData = [];\n while (!feof($handle)) {\n $tableData[] = array_combine($keys, $rtrim(fgetcsv($handle, 0, ';'), count($keys)));\n }\n // import row data\n $status = $this->importStaticData($tableData);\n $this->getF3()->status(202);\n }else{\n $this->getF3()->error(500, 'File could not be read');\n }\n }else{\n $this->getF3()->error(404, 'File not found: ' . $filePath);\n }\n }\n\n return $status;\n }", "function get($max_lines=0){\n $row_ret=array();\n if($max_lines>0)\n $lines_count=0;\n else\n $lines_count=-1; //$max_lines less than zero then ignore the loop limit\n\n while($lines_count < $max_lines && ($row=fgetcsv($this->file,$this->length,$this->delimeter)) !== FALSE)\n {\n\n\n if($this->parse_header) {\n\n foreach ($this->header as $key => $value)\n {\n\n $row_value=explode(',',$row[0]); //explode the string to save data in arrays\n\n foreach ($row_value as $value){\n $row_result[]= \"'\".$value.\"'\"; //formatting each element of array so that it can be used in query\n\n }\n\n $final=implode(',',$row_result); //convert the formatted array into string again\n $row_new[]='('.$final.')';//finally put concatenate round brackets with the string\n unset($row_result);//unset array to avoid redundancy\n }\n\n\n }\n else\n {\n $row_ret[]=$row;\n }\n\n if($max_lines>0)\n $lines_count++;\n\n\n\n }\n if($row_new!=NULL) {\n\n $row_ret[] = $this->header; //save excel sheet headings in array\n $row_ret[] = $row_new; // save data under headings in same array\n\n }\n return $row_ret; // return the array\n\n }", "public function read($path)\n {\n $data = array();\n\n $header = null;\n $handle = fopen($path, 'r');\n while ($row = fgetcsv($handle, null, $this->options['delimiter'])) {\n if (is_null($header)) {\n $header = $row;\n } else {\n $data[] = array_combine($header, $row);\n }\n }\n fclose($handle);\n\n return $data;\n }", "public function import($csv)\n {\n // convert to UTF-8\n $head = substr($csv, 0, 4096);\n $charset = rcube_charset::detect($head, RCUBE_CHARSET);\n $csv = rcube_charset::convert($csv, $charset);\n $csv = preg_replace(array('/^[\\xFE\\xFF]{2}/', '/^\\xEF\\xBB\\xBF/', '/^\\x00+/'), '', $csv); // also remove BOM\n $head = '';\n $prev_line = false;\n\n $this->map = array();\n $this->gmail_map = array();\n\n // Parse file\n foreach (preg_split(\"/[\\r\\n]+/\", $csv) as $line) {\n if (!empty($prev_line)) {\n $line = '\"' . $line;\n }\n\n $elements = $this->parse_line($line);\n\n if (empty($elements)) {\n continue;\n }\n\n // Parse header\n if (empty($this->map)) {\n $this->parse_header($elements);\n if (empty($this->map)) {\n break;\n }\n }\n // Parse data row\n else {\n // handle multiline elements (e.g. Gmail)\n if (!empty($prev_line)) {\n $first = array_shift($elements);\n\n if ($first[0] == '\"') {\n $prev_line[count($prev_line)-1] = '\"' . $prev_line[count($prev_line)-1] . \"\\n\" . substr($first, 1);\n }\n else {\n $prev_line[count($prev_line)-1] .= \"\\n\" . $first;\n }\n\n $elements = array_merge($prev_line, $elements);\n }\n\n $last_element = $elements[count($elements)-1];\n if ($last_element[0] == '\"') {\n $elements[count($elements)-1] = substr($last_element, 1);\n $prev_line = $elements;\n continue;\n }\n $this->csv_to_vcard($elements);\n $prev_line = false;\n }\n }\n }", "function getRows($max_lines=0, $position=0, $key_type='associative')\r\n {\r\n\r\n $data = array();\r\n\r\n if ($max_lines > 0)\r\n $line_count = 0;\r\n else\r\n $line_count = -1; // ignore line limiting\r\n\r\n if ($position) fseek($this->handle, $position);\r\n \r\n while ($line_count < $max_lines && ($row = fgetcsv($this->handle, $this->length, $this->delimiter)) !== FALSE) {\r\n \r\n foreach ($this->headers as $i => $header) {\r\n \r\n if (!isset($row[$i]))\r\n throw new InvalidContentException('CSV data column count is different from header column count!');\r\n \r\n if ($key_type == 'associative') {\r\n $row_new[$header] = $row[$i];\r\n } else {\r\n $row_new[$i] = $row[$i];\r\n }\r\n }\r\n \r\n $data[] = $row_new;\r\n\r\n if ($max_lines > 0) \r\n $line_count++;\r\n }\r\n \r\n if (count($data) <= 1) {\r\n throw new \\InvalidContentException('Only one row found, possible error detecting new lines in CSV file. ');\r\n }\r\n \r\n return $data;\r\n \r\n }", "protected function getFileData($csvfile)\n {\n $handle = fopen(Storage::disk('local')->path('' . $csvfile), \"r\"); // Read csv file and return an array\n $all_data = array();\n while (($data = fgetcsv($handle)) !== FALSE) {\n $csv_data = array();\n $csv_data['user_id'] = !empty($data[0]) ? $data[0] : null;\n $csv_data['created_at'] = !empty($data[1]) ? $data[1] : null;\n $csv_data['onboarding_percentage'] = !empty($data[2]) ? $data[2] : 0;\n $csv_data['count_applications'] = !empty($data[3]) ? $data[3] : 0;\n $csv_data['count_accepted_applications'] = !empty($data[4]) ? $data[4] : 0;\n array_push($all_data, $csv_data);\n }\n fclose($handle);\n\n return $all_data;\n }", "private function open_csv() {\n $this->fh = fopen(CSV_FILE, \"r\");\n if ($this->fh === false) {\n $this->log_it(\"Could not open CSV file.\");\n return false;\n }\n\n return true;\n }", "function csvToArray($file, $delimiter) { \n if (($handle = fopen($file, 'r')) !== FALSE) { \n $i = 0; \n while (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) { \n for ($j = 0; $j < count($lineArray); $j++) { \n $arr[$i][$j] = $lineArray[$j]; \n } \n $i++; \n } \n fclose($handle); \n } \n return $arr; \n}", "public function getCsv() {\r\n $result = array();\r\n if (file_exists($this->csv)) {\r\n\r\n if (($csvfile = fopen($this->csv, \"r\")) !== FALSE) {\r\n $row = 0;\r\n while (($data = fgetcsv($csvfile, 1000, \",\")) !== FALSE) {\r\n if ($row == 0) {\r\n foreach ($data as $value) {\r\n $result['headers'][] = $value;\r\n }\r\n }\r\n else {\r\n $result[$row] = array_combine($result['headers'], $data);\r\n }\r\n $row++;\r\n }\r\n fclose($csvfile);\r\n }\r\n }\r\n return $result;\r\n }", "protected function yieldRecord(): Generator\n {\n while (!feof($this->stream)) {\n yield fgetcsv($this->stream);\n }\n }", "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "function csvToArray($file, $delimiter) {\n if (($handle = fopen($file, 'r')) !== FALSE) {\n $i = 0;\n while (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) {\n for ($j = 0; $j < count($lineArray); $j++) {\n $arr[$i][$j] = $lineArray[$j];\n }\n $i++;\n }\n fclose($handle);\n }\n return $arr;\n}", "function csvToArray($file, $delimiter) {\n if (($handle = fopen($file, 'r')) !== FALSE) {\n $i = 0;\n while (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) {\n for ($j = 0; $j < count($lineArray); $j++) {\n $arr[$i][$j] = $lineArray[$j];\n }\n $i++;\n }\n fclose($handle);\n }\n return $arr;\n}", "function lire()\n {\n $handle = fopen(\"fichier.csv\", \"a+\");\n $monArray =[];\n\n while(true)\n {\n $resultat = fgetcsv($handle);\n if(!$resultat)\n break;\n array_push($monArray, $resultat);\n }\n\n fclose($handle);\n return $monArray;\n // var_dump();\n }", "private function getProductRows()\n {\n $rows = [];\n $fp = fopen($this->file, 'r');\n fgets($fp, 10000); // Throw away header row.\n $i = 0;\n // Read 1 line.\n while ($line = fgets($fp, 10000)) {\n $i++;\n\n // Standardize multiple tabs into 1 tab per column.\n $prepped = str_replace(\"\\t\\t\\t\", \"\\t\", $line);\n\n // Parse the line as a tsv.\n $row = str_getcsv($prepped, \"\\t\");\n\n if (!$row) {\n echo \"failed to parse line $i\\n\";\n continue;\n }\n $rows[] = $row;\n }\n\n return $rows;\n }", "function csvToArray($file, $delimiter) {\r\n\tif (($handle = fopen($file, 'r')) !== FALSE) {\r\n\t\t$i = 0;\r\n\t\twhile (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) {\r\n\t\t\tfor ($j = 0; $j < count($lineArray); $j++) {\r\n\t\t\t\t$arr[$i][$j] = $lineArray[$j];\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\tfclose($handle);\r\n\t}\r\n\treturn $arr;\r\n}", "function processCSV($filename){\n $csv = array_map('str_getcsv', file($filename));\n\n return $csv;\n}", "public function importCsv()\n {\n $file = fopen($_FILES['csvFile']['tmp_name'], \"r\");\n $payments = array();\n while (!feof($file)) {\n $row = fgetcsv($file, 0, \"\\t\");\n if (count($row) == 14 && $row[0] != \"Kirjauspäivä\") {\n $dateOfPayment = new \\DateTime($row[2]);\n $values = array(\n 'date_of_payment' => $dateOfPayment->format('Y-m-d H:i:s'),\n 'amount' => $this->makeFloat($row[3]),\n 'reference_number' => $row[8],\n 'amount_left' => 0,\n );\n $payments[] = new Payment($values);\n }\n }\n fclose($file);\n $insert = $this->paymentRepository->insert($payments);\n if ($insert !== true) {\n $message = \"Maksujen kirjaamisessa tapahtui virhe.<br />\" . $insert;\n $error = array(\"error\" => $message);\n ErrorService::setErrors($error);\n return;\n }\n Redirect::to(\"/maksut/syotto\", array(\"success\" => \"Maksut kirjattu onnistuneesti.\"));\n\n }", "function import_csv()\n {\n $msg = 'OK';\n $path = JPATH_ROOT.DS.'tmp'.DS.'com_condpower.csv';\n if (!$this->_get_file_import($path))\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_UPLOAD_IMPORT_CSV_FILE'));\n }\n// $_data = array(); \n if ($fp = fopen($path, \"r\"))\n {\n while (($data = fgetcsv($fp, 1000, ';', '\"')) !== FALSE) \n {\n unset($_data);\n $_data['virtuemart_custom_id'] = $data[0];\n $_data['virtuemart_product_id'] = $data[1];\n $id = $this->_find_id($_data['virtuemart_custom_id'],$_data['virtuemart_product_id']);\n if((int)$id>0)\n {\n $_data['id'] = $id;\n }\n// $_data['intvalue'] = iconv('windows-1251','utf-8',$data[3]);\n $_data['intvalue'] = str_replace(',', '.', iconv('windows-1251','utf-8',$data[3]));\n if(!$this->_save($_data))\n {\n $msg = 'ERROR';\n }\n }\n fclose($fp);\n }\n else\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_OPEN_TO_IMPORT'));\n }\n return array(TRUE,$msg);\n }", "public function readLines(){\n return $this->file;\n }", "protected function load_csv_data() {\n $dataset = $this->createCsvDataSet(array(\n usermoodle::TABLE => elispm::file('tests/fixtures/user_moodle.csv')\n ));\n $this->loadDataSet($dataset);\n }", "public function getCSVData()\n {\n $headers = null;\n $data = null;\n $fileNameWithPath = $this->dir . '/' . $this->fileName;\n $file = fopen($fileNameWithPath, 'r');\n\n while($rows = fgetcsv($file, 1000, ',')) {\n if(!$headers) {\n $headers = $rows;\n } else {\n $data = $rows;\n }\n }\n\n\tfclose($file);\n $dataSet = array_combine($headers, $data);\n\n return $dataSet;\n }", "function clients_importGetSegementOfFile($file,$startline,$endline,$mapping=null) {\n\t## then we open the the new file and start reading it\n\n\t$handle = fopen($file,\"r\"); \n\n\t$fields = array();\n\t$data = array();\n\t$linecount = 0;\n\t## let's position the filepointer- and while we are at it read the fields form the first line\n\twhile($linecount <= $startline && ($current_data = fgetcsv($handle, 24000, \",\")) != false) {\t\n\t\tif($linecount == 0) {\n \t\t$fields = $current_data;\n \t} \n\t\t$linecount++;\n }\n \n ## assing the mapping\n \tif(!isset($mapping)) {\n \t\t$mapping = $fields;\n \t}\n \n \n ## okay now we can start to read form start to end\n\t$item = 0;\n\n\twhile(($current_data = fgetcsv($handle, 24000, \",\",'\"')) != false && $linecount <= $endline) {\t\n\t\t$num = count($current_data);\n\t\tfor ($c=0; $c < $num; $c++) {\n\t\t\tif(!empty($mapping[$c])) {\n\t\t\t\t$data[$item][$mapping[$c]] = addslashes($current_data[$c]);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t$linecount++;\n\t\t$item++;\n }\n\t\n\tfclose($handle);\n\treturn array('data'=>$data);\n}", "public function setData()\n {\n if($this->url != null)\n {\n if (($handle = fopen($this->url, \"r\")) !== FALSE) {\n while (($rows = fgetcsv($handle)) !== FALSE) {\n foreach($rows as $row)\n {\n $this->data[$this->rowCount][] = $row;\n }\n $this->rowCount++;\n }\n fclose($handle);\n }\n }\n }", "private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }", "public function Read(){\n\t\tif($this->file_type == 'csv'){\n\t\t\t$lines = explode( \"\\n\", file_get_contents( $this->getBasePath().'/'.$this->getFilePath()) );\n\t\t\t$headers = str_getcsv( array_shift( $lines ) );\n\t\t\t$data = array();\n\t\t\tforeach ( $lines as $line ) {\n\t\t\t\t$row = array();\n\t\t\t\tforeach ( str_getcsv( $line ) as $key => $field )\n\t\t\t\t\t$row[ $headers[ $key ] ] = $field;\n\t\t\t\t$row = array_filter( $row );\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t}\n\t\tif($this->file_type == 'json'){\n\t\t\t$string = file_get_contents($this->getBasePath().'/'.$this->getFilePath());\n\t\t\t$data = json_decode($string, true);\n\n\t\t}\n\t\n\t\treturn $data;\n\n\t }", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "function read_csv($db)\n {\n $query=\"INSERT into dishes(did,dname,resturant) values\";\n $temp=array();\n $handle=fopen('sample.csv', 'r');\n if(!$handle)\n {\n echo \"error\";\n }\n\n $temp=fgetcsv($handle);//skip the heading...\n\n while(!feof($handle))\n {\n $temp=fgetcsv($handle);\n $did=$db->mysqlready($temp[0]);\n $dname=$db->mysqlready($temp[1]);\n $dname=check_appro($dname);\n $rest=$db->mysqlready($temp[2]);\n $rest=check_appro($rest);\n $query.=\"($did,'$dname','$rest'),\";\n\n }\n $fquery=substr($query, 0,-1);\n $fquery.=\";\";\n $status=$db->query($fquery);\n\n if(!$status)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "public function createCsv(){\n $this->header = NULL;\n $this->csv = array();\n if (($handle = fopen($this->url, 'r')) !== FALSE)\n {\n while (($row = fgetcsv($handle, 1000, $this->separatore)) !== FALSE)\n {\n if(!$this->header)\n $this->header = $this->trimField($row);\n else\n $this->csv[] = array_combine($this->header, $this->trimField($row));\n }\n fclose($handle);\n }\n }", "public function loadCsvFile($file)\n {\n $data = [];\n\n if (file_exists($file)) {\n $data = array_map('str_getcsv', file($file));\n\n array_walk($data, function(&$row) use ($data) {\n $row = array_combine($data[0], $row);\n });\n\n array_shift($data);\n }\n else {\n wp_die(__('Import file does not exist.'));\n }\n\n $this->data = $data;\n }", "function read_lines(){\n $filesize = filesize($this->filename);\n if($filesize > 0) {\n $handle = fopen($this->filename, \"r\");\n $contents = fread($handle, $filesize);\n fclose($handle);\n\n return explode(\"\\n\", $contents);\n }\n else\n {\n return array();\n }\n\n }", "function users($file)\r\n{\r\n $users = fopen($file, 'r');\r\n while (!feof($users)) {\r\n yield fgetcsv($users)[0];\r\n }\r\n fclose($users);\r\n}", "private function _getRow($ignoreMismatch = false)\n {\n $line = fgetcsv($this->_file, $this->_length, $this->_delimiter,\n $this->_enclosure, $this->_escape\n );\n\n // EOF\n if (false === $line && feof($this->_file))\n {\n return false;\n }\n\n // Empty line\n if (is_array($line) && empty($line))\n {\n return false;\n }\n\n $expectedHeaders = $this->_hasHeaders\n ? count($this->_headers)\n : $this->_headers;\n\n // Other error\n if (!$line)\n {\n throw new PHPMapper_Exception_Import(\n 'fgetcsv() failed when attempting to read line from file.'\n );\n }\n else if (!$ignoreMismatch && count($line) != $expectedHeaders)\n {\n throw new PHPMapper_Exception_Import(\n 'Line #' . $this->_lineNumber . ' has ' . count($line) . ' columns. Expecting '\n . $expectedHeaders . '.'\n );\n }\n else\n {\n $this->_lineNumber++;\n return $line;\n }\n }", "function csv_to_array($filename='', $delimiter=';')\n{\n if(!file_exists($filename) || !is_readable($filename))\n return FALSE;\n\n $data = array();\n if (($handle = fopen($filename, 'r')) !== FALSE)\n {\n fgetcsv($handle);\n while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE)\n {\n $data[] = $row;\n }\n fclose($handle);\n }\n return $data;\n}", "abstract public function convert_from_csv($source);", "protected function initCSV() {}", "public static function fromCsvFile(string $path, bool $withHeader = self::WITH_HEADER): array\n {\n $file = fopen($path, \"r\");\n\n if (!$file) {\n throw new \\InvalidArgumentException(\"Could not open file: {$path}\");\n }\n\n $result = [];\n $header = [];\n if ($withHeader) {\n $line = fgets($file);\n $header = str_getcsv($line);\n }\n\n while (!feof($file)) {\n $line = fgets($file);\n if (!$line) {\n continue;\n }\n $result[] = $withHeader\n ? array_combine($header, str_getcsv($line))\n : str_getcsv($line);\n }\n fclose($file);\n\n return $result;\n }", "final public static function load_csv($from, $split = ';') {\n if ( ! is_file($from)) {\n return FALSE;\n }\n\n\n $out = array();\n $resource = fopen($from, 'rb');\n\n fseek($resource, 0);\n\n while (FALSE !== ($old = fgetcsv($resource, 0, $split, '\"'))) {\n if ((substr($old[0], 0, 1) == '#') OR empty($old[1])) {\n continue;\n }\n\n $out[trim($old[0])] = $old[1];\n }\n\n fclose($resource);\n\n return $out;\n }", "function readFile($file){\n \n $content = [];\n $file = new \\SplFileObject($file); \n $file->setFlags(\\SplFileObject::READ_CSV); // lee csv\n foreach ($file as $line) {\n $content[] = $line;\n }\n $count= count($content); // cuenta las filas\n $countValues = count($content[0]); //cuenta las columnas\n $i=0;\n for ($i=0;$i<$countValues;$i++){\n\n for ($j=1;$j<$count;$j++){\n $this->change_index ($content[$j], $i, $content[0][$i]); // cambia los indices\n }\n }\n return $content;\n}", "function GetValuesFromCSV($path)\n{\n\n if (($handle = fopen($path, 'a+')) !== FALSE) {\n $animaux = array();\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n list($Nope, $animaux[$data[0]]) = $data;\n\n }\n fclose($handle);\n return $animaux;\n\n }else{\n return false;\n }\n}", "function users($file)\n{\n $users = fopen($file, 'rb');\n while (!feof($users)) {\n yield fgetcsv($users)[0];\n }\n fclose($users);\n}", "public function csv2Array($csvContent, $fieldDelimiter = ',', $file = TRUE){\n\t\ttry {\n\t\t\tif ($file) {\n\t\t\t\t$csvFile = $csvContent;\n\t\t\t\n\t\t\t\tif (!file_exists($csvFile)) {\n\t\t\t\t\tthrow new Exception('File '.$csvFile.' does not exist'.\n\t\t\t\t\t\t' from '.$this->className.'->'.__FUNCTION__.'() line '.\n\t\t\t\t\t\t__LINE__\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tempFile = self::makeLFLineEndings($csvFile);\n\t\t\t\t$handle = fopen($tempFile, 'r');\n\t\t\t\tunlink($tempFile);\n\t\t\t} else { // not a file\n\t\t\t\t$csvContent = self::lines2Array($csvContent);\n\t\t\t} //<-- end if -->\n\t\t\t\n\t\t\tif ($file) {\t\n\t\t\t\twhile (($data = fgetcsv($handle, 1000, $fieldDelimiter)) \n\t\t\t\t\t!== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$content[] = $data;\n\t\t\t\t} //<-- end while -->\n\t\t\t\t\n\t\t\t\tfclose($handle);\n\t\t\t} else { // not a file\n\t\t\t\tforeach ($csvContent as $data) {\n\t\t\t\t\t$content[] = str_getcsv($data, $fieldDelimiter);\n\t\t\t\t} //<-- end while -->\n\t\t\t} //<-- end if -->\n\t\t\t\n\t\t\treturn $content;\t\t\t\n\t\t} catch (Exception $e) { \n\t\t\tthrow new Exception($e->getMessage().' from '.$this->className\n\t\t\t\t.'->'.__FUNCTION__.'() line '.__LINE__\n\t\t\t);\n\t\t} //<-- end try -->\n\t}", "public function actionImportFromCsv()\n {\n HBackup::importDbFromCsv($this->csvFile);\n }", "function doCSV($fileName) \n{\n $csvFile = file($fileName);\n $data = [];\n foreach ($csvFile as $line) {\n $data[] = str_getcsv($line);\n\n $pieces = explode(\";\", $data[0][3]);\n foreach ($pieces as $piece) {\n $url = encryptCSVLine($data[0][0], $data[0][1], $data[0][2], $piece);\n // get email from $data[0][4] and send it to the user\n print $url;\n print \"\\n\";\n }\n }\n}", "public function process(string $csv): array\n {\n $rows = $this->read($csv);\n\n // If we have errors.\n if (!$rows) {\n return ['status' => 'error', 'message' => 'Your CSV is empty or the file does not exist.'];\n }\n\n $csvData = [];\n $counter = 1;\n\n if ($csv) {\n // Loop through all rows so we can process each row.\n foreach ($rows as $row) {\n // Don't process the first row because it contains headings.\n if ($counter != 1) {\n $thirdColumn = $this->convertStringToNumber($row[2]);\n $row[2] = 0;\n if ($thirdColumn > 0) {\n $row[2] = $this->doubleAndStoreInMemory($thirdColumn);\n }\n }\n $csvData[] = $row;\n $counter++;\n }\n }\n\n return $csvData;\n }", "public function get_CSV_Combat(){\n $handle = fopen(\"combatTable.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\t\t\t\t{\n $final_ata[] = array_combine($headers, array_values($data));\n }\n } \n $result_arr = array(); \n foreach($final_ata as $key => $value){\n $name = $final_ata[$key]['CT_Variable'];\n $result_arr[$name] = $value;\n }\n return($result_arr);\n \n }", "function getNextRow() {\n\t\tglobal $LANG, $TYPO3_CONF_VARS;\n\t\t\n\t\tif (!empty($this->conf['dontUsePHPFunction'])) {\n\t\t\treturn next($this->rows);\n\t\t}\n\t\t\n\t\t// if there is no enclosure set, the parameter has to be omited\n\t\tif(strlen(trim($this->conf['enclosure'])) > 0) {\n\t\t\twhile (($arrayLine = fgetcsv($this->resource, 10000, $this->conf['delimiter'], trim($this->conf['enclosure']))) !== FALSE) {\n\t\t\t\t$imploded = trim(implode($arrayLine));\n\t\t\t\tif (strlen($imploded) > 1) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\twhile (($arrayLine = fgetcsv($this->resource, 10000, $this->conf['delimiter'])) !== FALSE) {\n\t\t\t\t$imploded = trim(implode($arrayLine));\n\t\t\t\tif (strlen($imploded) > 1) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t// return values from array with increased key-ids\n\t\tif($arrayLine !== FALSE) {\n\t\t\tforeach($arrayLine as $key => $value){\n\t\t\t\tif(substr(trim($value), - 1) == '\"') {\n\t\t\t\t\t$value = str_replace('\"', '', $value);\n\t\t\t\t\t// if the first characted becomes a \"?\", this means, it is related to this bug: https://bugs.php.net/bug.php?id=63433\n\t\t\t\t\tif(utf8_decode($value[0]) == '?') {\n\t\t\t\t\t\t// so strip the quotes in the beginning\n\t\t\t\t\t\t$value = substr($value, 3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$arrayLine[$key+1] = $value;\n\t\t\t}\n\t\t\treturn $arrayLine;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function parse_file($filename,$delimiter = \",\") {\n if(!file_exists($filename) || !is_readable($filename))\n return FALSE;\n \n $header = NULL;\n $data = array();\n if (($handle = fopen($filename, 'r')) !== FALSE)\n {\n while (($row = fgetcsv($handle, 100000, $delimiter)) !== FALSE)\n {\n if($row[0]!=NULL)\n $data[] = $row;\n }\n fclose($handle);\n }\n return $data;\n }", "public function parse(string $csv): array\n {\n $tmpHandle = tmpfile();\n fwrite($tmpHandle, str_replace('\\\\\"\"', self::PLACEHOLDER_FGETCSV_BUG . '\"\"', $csv));\n rewind($tmpHandle);\n\n $data = [];\n\n while ($csvLine = fgetcsv($tmpHandle, 0, FormatInterface::DELIMITER, FormatInterface::ENCLOSURE)) {\n $data[] = array_map(\n static function ($item) {\n if (!is_string($item)) {\n return $item;\n }\n\n return str_replace(self::PLACEHOLDER_FGETCSV_BUG, '\\\\', $item);\n },\n $csvLine\n );\n }\n\n fclose($tmpHandle);\n\n return $data;\n }" ]
[ "0.7932783", "0.69769126", "0.69473433", "0.69394094", "0.68803746", "0.6859139", "0.68378204", "0.6767097", "0.6764746", "0.6763124", "0.67502487", "0.6723688", "0.6699002", "0.6594536", "0.65839726", "0.6533367", "0.65322316", "0.6511141", "0.6507501", "0.6506953", "0.6500332", "0.6473411", "0.64588207", "0.6447296", "0.6441536", "0.64228255", "0.6417628", "0.63249636", "0.6280556", "0.6224442", "0.62239826", "0.6213713", "0.6207545", "0.6184295", "0.6182665", "0.6169843", "0.6101643", "0.605135", "0.60464245", "0.6046401", "0.60345125", "0.6033758", "0.60241175", "0.6015249", "0.60078126", "0.599733", "0.599733", "0.59497654", "0.59429955", "0.5920104", "0.5919736", "0.5906115", "0.58898", "0.58635956", "0.58559847", "0.5840893", "0.5826547", "0.58124375", "0.5811437", "0.5807006", "0.5806094", "0.58024645", "0.57933986", "0.57933986", "0.57856584", "0.57834256", "0.5781847", "0.57803226", "0.57662576", "0.5725866", "0.5717689", "0.5696771", "0.56950074", "0.5691271", "0.568476", "0.567482", "0.5659279", "0.56561065", "0.56455636", "0.56396323", "0.5629179", "0.5627556", "0.5625162", "0.56092966", "0.5581875", "0.55799586", "0.55789924", "0.55711275", "0.55676436", "0.5562099", "0.55539227", "0.55395687", "0.55348706", "0.55279654", "0.5526508", "0.55220854", "0.5518081", "0.5512782", "0.5502911", "0.5478713" ]
0.57028294
71
Wrapper for fgetcsv function
private function read() { $out = fgetcsv($this->handle, null, $this->delimiter, $this->enclosure); if (!is_array($out)) { return $out; } if (config('csv.encoding.reader.enabled') === true) { foreach ($out as $k => $v) { $out[$k] = iconv( config('csv.encoding.reader.from'), config('csv.encoding.reader.to'), $v ); } } return $out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function read_csv($filename, $delimiter = \",\") {\n $file_data = array();\n $handle = @fopen($filename, \"r\") or false;\n if ($handle !== FALSE) {\n while (($data = fgetcsv($handle, 1000, $delimiter)) !== FALSE) {\n $file_data[] = $data;\n }\n fclose($handle);\n }\n return $file_data;\n}", "function readCsv($filename) {\n // your code here\n $handle = fopen($filename, \"r\");\n $result = [];\n\n while(!feof($handle)){\n $result[] = fgetcsv($handle);\n }\n fclose($handle);\n return $result;\n }", "private function read_csv()\n {\n return array_map('str_getcsv', file($this->filename));\n ////OR\n // $handle = fopen('$this->filename', 'r');\n // $contacts = [];\n // while(!feof($handle)) {\n // $contacts[] = fgetcsv($handle);\n // }\n // fclose($handle); \n }", "public function readCsv()\n {\n ini_set(\"auto_detect_line_endings\", true);\n $fp = fopen($this->inputFile , 'r');\n while($row = fgetcsv($fp)){\n $this->data[] = $row;\n }\n }", "function read_csv()\n {\n if(filesize ($this->filename) > 0) {\n $handle = fopen($this->filename, \"r\");\n while(($data = fgetcsv($handle)) !==FALSE) {\n $contents[] = $data;\n }\n fclose($handle);\n\n return $contents;\n }\n else\n {\n return array();\n }\n }", "public function import_read_record()\n\t{\n // phpcs:enable\n\t\tglobal $conf;\n\n\t\t$arrayres=fgetcsv($this->handle, 100000, $this->separator, $this->enclosure, $this->escape);\n\n\t\t// End of file\n\t\tif ($arrayres === false) return false;\n\n\t\t//var_dump($this->handle);\n\t\t//var_dump($arrayres);exit;\n\t\t$newarrayres=array();\n\t\tif ($arrayres && is_array($arrayres))\n\t\t{\n\t\t\tforeach($arrayres as $key => $val)\n\t\t\t{\n\t\t\t\tif (! empty($conf->global->IMPORT_CSV_FORCE_CHARSET))\t// Forced charset\n\t\t\t\t{\n\t\t\t\t\tif (strtolower($conf->global->IMPORT_CSV_FORCE_CHARSET) == 'utf8')\n\t\t\t\t\t{\n\t\t\t\t\t\t$newarrayres[$key]['val']=$val;\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\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$newarrayres[$key]['val']=utf8_encode($val);\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\t// Autodetect format (UTF8 or ISO)\n\t\t\t\t{\n\t\t\t\t\tif (utf8_check($val))\n\t\t\t\t\t{\n\t\t\t\t\t\t$newarrayres[$key]['val']=$val;\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\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$newarrayres[$key]['val']=utf8_encode($val);\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->col=count($newarrayres);\n\t\t}\n\n\t\treturn $newarrayres;\n\t}", "function getDataCsv($filename) {\n return array_map('str_getcsv', file(\"csv/{$filename}\"));\n}", "function get($max_lines=0){\n $row_ret=array();\n if($max_lines>0)\n $lines_count=0;\n else\n $lines_count=-1; //$max_lines less than zero then ignore the loop limit\n\n while($lines_count < $max_lines && ($row=fgetcsv($this->file,$this->length,$this->delimeter)) !== FALSE)\n {\n\n\n if($this->parse_header) {\n\n foreach ($this->header as $key => $value)\n {\n\n $row_value=explode(',',$row[0]); //explode the string to save data in arrays\n\n foreach ($row_value as $value){\n $row_result[]= \"'\".$value.\"'\"; //formatting each element of array so that it can be used in query\n\n }\n\n $final=implode(',',$row_result); //convert the formatted array into string again\n $row_new[]='('.$final.')';//finally put concatenate round brackets with the string\n unset($row_result);//unset array to avoid redundancy\n }\n\n\n }\n else\n {\n $row_ret[]=$row;\n }\n\n if($max_lines>0)\n $lines_count++;\n\n\n\n }\n if($row_new!=NULL) {\n\n $row_ret[] = $this->header; //save excel sheet headings in array\n $row_ret[] = $row_new; // save data under headings in same array\n\n }\n return $row_ret; // return the array\n\n }", "public function parse_csv () {\n $data = array();\n $header = fgetcsv($this->file);\n array_walk($header, create_function('&$val', '$val = trim($val);'));\n while ($row = fgetcsv($this->file)) {\n array_walk($row, create_function('&$val', '$val = trim($val);'));\n $data[] = array_combine($header, $row);\n \n }\n\n return $data;\n }", "function getcsv_custom2(&$value,$key){\n $value = str_getcsv($value,\".\",\"'\");\n}", "function readUploadedCSV($tmp_name) {\n\t $lines = array();\n\n\t ini_set('auto_detect_line_endings',1);\n\t $handle = fopen($tmp_name, \"r\");\n\t while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n\t\t array_push($lines,$data);\t\t\t \n\t }\n\t return $lines;\n }", "function read_csv()\n {\n $handle = fopen($this->filename, 'r');\n $filesize = filesize($this->filename);\n $openList = [];\n if($filesize != 0) {\n while(!feof($handle)) {\n $openList[] = fgetcsv($handle);\n } \n }else {\n $openList = array();\n }\n fclose($handle);\n return $openList;\n }", "function csvToArray($file, $delimiter) { \n if (($handle = fopen($file, 'r')) !== FALSE) { \n $i = 0; \n while (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) { \n for ($j = 0; $j < count($lineArray); $j++) { \n $arr[$i][$j] = $lineArray[$j]; \n } \n $i++; \n } \n fclose($handle); \n } \n return $arr; \n}", "protected function parseCsv() {\r\n\t\t\r\n\t\t$csv_data = array();\r\n\t\twhile ($this->_currentRow = fgetcsv($this->_fileHandler, null, $this->_delimiter, $this->_enclosure)) {\r\n\t\t\t$csv_data[] = $this->_currentRow;\r\n\t\t}\r\n\t\t\r\n\t\t$this->_data = $csv_data;\r\n\t}", "abstract public function convert_to_csv();", "public function getCSVData()\n {\n $headers = null;\n $data = null;\n $fileNameWithPath = $this->dir . '/' . $this->fileName;\n $file = fopen($fileNameWithPath, 'r');\n\n while($rows = fgetcsv($file, 1000, ',')) {\n if(!$headers) {\n $headers = $rows;\n } else {\n $data = $rows;\n }\n }\n\n\tfclose($file);\n $dataSet = array_combine($headers, $data);\n\n return $dataSet;\n }", "function getcsv_custom(&$value,$key){\n $value = str_getcsv($value,\".\");\n}", "function fn_fgetcsv($fp, $length, $delimiter = ',', $enclosure = '\"')\n{\n $list = array();\n\n $string = $line = fgets($fp, $length);\n if ($string === false || $string === null) {\n return $string;\n }\n\n if (trim($string) === '') {\n return array('');\n }\n\n $string = rtrim($string, \"\\n\\r\");\n if (substr($string, -strlen($delimiter)) == $delimiter) {\n $string .= $enclosure . $enclosure;\n }\n\n while ($string !== '' && $string !== false) {\n // remove redundant spaces before enclosure\n if ($string[0] !== $enclosure\n && strpos($line, $enclosure) !== false\n && $delimiter !== ' '\n && $delimiter !== \"\\t\"\n ) {\n $string = ltrim($string, \" \\t\");\n }\n\n if ($string[0] !== $enclosure) {\n // Non-quoted.\n list ($field) = explode($delimiter, $string, 2);\n $string = substr($string, strlen($field) + strlen($delimiter));\n } else {\n // Quoted field.\n $string = substr($string, 1);\n $field = '';\n\n while (1) {\n // Find until finishing quote (EXCLUDING) or eol (including)\n preg_match(\"/^((?:[^$enclosure]+|$enclosure$enclosure)*)/sx\", $string, $p);\n $part = $p[1];\n $string = substr($string, strlen($p[0]));\n $field .= str_replace($enclosure . $enclosure, $enclosure, $part);\n\n if (strlen($string) && $string[0] === $enclosure) {\n // Found finishing quote.\n list ($dummy) = explode($delimiter, $string, 2);\n $string = substr($string, strlen($dummy) + strlen($delimiter));\n break;\n } else {\n // No finishing quote - newline.\n $string = fgets($fp, $length);\n }\n }\n }\n\n $list[] = $field;\n }\n\n return $list;\n}", "public function createCsv(){\n $this->header = NULL;\n $this->csv = array();\n if (($handle = fopen($this->url, 'r')) !== FALSE)\n {\n while (($row = fgetcsv($handle, 1000, $this->separatore)) !== FALSE)\n {\n if(!$this->header)\n $this->header = $this->trimField($row);\n else\n $this->csv[] = array_combine($this->header, $this->trimField($row));\n }\n fclose($handle);\n }\n }", "function csvToArray($file, $delimiter) {\r\n\tif (($handle = fopen($file, 'r')) !== FALSE) {\r\n\t\t$i = 0;\r\n\t\twhile (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) {\r\n\t\t\tfor ($j = 0; $j < count($lineArray); $j++) {\r\n\t\t\t\t$arr[$i][$j] = $lineArray[$j];\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\tfclose($handle);\r\n\t}\r\n\treturn $arr;\r\n}", "private function read_csv()\n {\n $address_book = [];\n $handle = fopen($this->filename, 'r');\n while(!feof($handle)){\n $row = fgetcsv($handle);\n if(is_array($row)){\n $address_book[] = $row;\n }\n }\n fclose($handle);\n return $address_book;\n }", "function readCSV($url) {\n $row = 0;\n $readData = [];\n print_r(\"Opening CSV File ... \");\n if (($handle = fopen($url, \"r\")) !== FALSE) {\n print_r(\"SUCCESS\\n\");\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n if($row!=0) { // skip first row\n $readData[$row] = $data;\n }\n $row++;\n }\n fclose($handle);\n return $readData;\n } else {\n print_r(\"FAIL\\n\");\n return null;\n }\n}", "function processCSV($filename){\n $csv = array_map('str_getcsv', file($filename));\n\n return $csv;\n}", "function csvToArray($file, $delimiter) {\n if (($handle = fopen($file, 'r')) !== FALSE) {\n $i = 0;\n while (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) {\n for ($j = 0; $j < count($lineArray); $j++) {\n $arr[$i][$j] = $lineArray[$j];\n }\n $i++;\n }\n fclose($handle);\n }\n return $arr;\n}", "function csvToArray($file, $delimiter) {\n if (($handle = fopen($file, 'r')) !== FALSE) {\n $i = 0;\n while (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) {\n for ($j = 0; $j < count($lineArray); $j++) {\n $arr[$i][$j] = $lineArray[$j];\n }\n $i++;\n }\n fclose($handle);\n }\n return $arr;\n}", "function readCSV($csvFile, $array){\n $file_handle = fopen($csvFile, 'r');\n while (!feof($file_handle)) {\n $line_of_text[] = fgetcsv($file_handle, 0, $array['delimiter']);\n }\n array_shift($line_of_text);\n array_pop($line_of_text);\n fclose($file_handle);\n return $line_of_text;\n}", "public function getCSV() {\n $handle = fopen($this->_csv_file, \"r\");\n $array_line_full = array();\n\n while (($line = fgetcsv($handle, 0, \",\")) !== FALSE) {\n $array_line_full[] = $line;\n }\n fclose($handle);\n return $array_line_full;\n }", "function readLine(){\n $data = fgetcsv($this->handle,0,\";\");\n return $data; \n \n }", "public function get()\n {\n $is_first = true;\n $keys = [];\n $data = [];\n $count = 0;\n\n $file = new SplFileObject($this->csv_file_path);\n\n while(!$file->eof())\n {\n /**\n * $file->fgets()\n * 呼び出す度に次の行に移動してしまうので注意する\n */\n $input = $file->fgets();\n\n /**\n * 空行は除外する\n */\n if(empty($input)) continue;\n\n $line = str_getcsv($input);\n\n if($is_first)\n {\n $keys = $line;\n $count = count($keys);\n $is_first = false;\n continue;\n }\n\n /**\n * ヘッダー行と異なる要素数のデータは除外する\n */\n if($count != count($line)) continue;\n\n foreach ($keys as $index => $key) {\n $tmp[$key] = $line[$index];\n }\n $data[] = $tmp;\n }\n return $data;\n }", "function get_csv_header_fields()\r\n {\r\n\t\t$this->analyse_file($this->file_name, intval(filesize($this->file_name) / 1024) + 1024);\r\n\t\t\r\n\t\tif(count($this->arr_csv_columns) > 0) {\r\n\t\t\t$arr_temp = $this->arr_csv_columns;\r\n\t\t\t$this->arr_csv_columns = NULL;\r\n\r\n\t\t\tforeach($arr_temp as $key => $value) {\r\n\t\t\t\t$st = str_replace(\",,\", \" , , \", $arr_temp[$key]);\r\n\t\t\t\t//$st = $arr_temp[$key];\r\n\t\t\t\t$arr = str_getcsv($st);\r\n\t\t\t\t$this->arr_csv_columns[] = $arr;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->arr_csv_columns = '';\r\n\t\t}\r\n\t\treturn true;\r\n\t\t\r\n $this->arr_csv_columns = array();\r\n $fpointer = fopen($this->file_name, \"r\");\r\n if ($fpointer)\r\n {\r\n\t\t\t$arr = array();\r\n\t\t\twhile (($data = fgetcsv($fpointer, 10*1024, $this->field_separate_char, $this->field_enclose_char)) !== false) { \r\n\t\t\t\t$arr[] = $data;\r\n\t\t\t}\r\n\t\t\t$this->arr_csv_columns = $arr;\r\n unset($arr);\r\n fclose($fpointer);\r\n }\r\n else\r\n $this->error = \"file cannot be opened: \".(\"\"==$this->file_name ? \"[empty]\" : @mysql_escape_string($this->file_name));\r\n return $this->arr_csv_columns;\r\n }", "function loadCSV($filename) {\n // Assume we are following the format of:\n // +15554442222,[email protected]\n $csvArray = array(); \n if (($handle = fopen($filename, \"r\")) !== FALSE) {\n while (($row = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n $csvArray[\"$row[0]\"] = \"$row[1]\";\n }\n if (!feof($handle)) {\n error_log(\"Error: unexpected fgets() fail\\n\");\n }\n }\n fclose($handle);\n\n return $csvArray;\n}", "function getcsv($no_of_field_names)\r\n\t{\r\n\t\t$separate = '';\r\n\t\t// do the action for all field names as field name\r\n\t\tforeach ($no_of_field_names as $field_name)\r\n\t\t{\r\n\t\t\tif (preg_match('/\\\\r|\\\\n|,|\"/', $field_name))\r\n\t\t\t{\r\n\t\t\t\t$field_name = '' . str_replace('','', $field_name) . '';\r\n\t\t\t}\r\n\t\t\techo $separate . $field_name;\r\n\t\t\t//sepearte with the comma\r\n\t\t\t$separate = ',';\r\n\t\t}\r\n\t\t//make new row and line\r\n\t\techo \"\\r\\n\";\r\n\t}", "function fgetcsv_reg (&$handle, $length = null, $d = ',', $e = '\"') {\r\n $d = preg_quote($d);\r\n $e = preg_quote($e);\r\n $_line = \"\";\r\n $eof = false; // Added for PHP Warning.\r\n while ( $eof != true ) {\r\n $_line .= (empty($length) ? fgets($handle) : fgets($handle, $length));\r\n $itemcnt = preg_match_all('/'.$e.'/', $_line, $dummy);\r\n if ($itemcnt % 2 == 0) $eof = true;\r\n }\r\n $_csv_line = preg_replace('/(?:\\\\r\\\\n|[\\\\r\\\\n])?$/', $d, trim($_line));\r\n $_csv_pattern = '/('.$e.'[^'.$e.']*(?:'.$e.$e.'[^'.$e.']*)*'.$e.'|[^'.$d.']*)'.$d.'/';\r\n\r\n preg_match_all($_csv_pattern, $_csv_line, $_csv_matches);\r\n\r\n $_csv_data = $_csv_matches[1];\r\n\r\n for ( $_csv_i=0; $_csv_i<count($_csv_data); $_csv_i++ ) {\r\n $_csv_data[$_csv_i] = preg_replace('/^'.$e.'(.*)'.$e.'$/s', '$1', $_csv_data[$_csv_i]);\r\n $_csv_data[$_csv_i] = str_replace($e.$e, $e, $_csv_data[$_csv_i]);\r\n }\r\n return empty($_line) ? false : $_csv_data;\r\n }", "abstract public function convert_from_csv($source);", "public function readCSV(): array\n {\n $mydata = [];\n\n if ((int)$this->indata['newFileUid'] < 1) {\n return $mydata;\n }\n\n $fileAbsolutePath = $this->getFileAbsolutePath((int)$this->indata['newFileUid']);\n\n $delimiter = $this->indata['delimiter'] ?: 'comma';\n $encaps = $this->indata['encapsulation'] ?: 'doubleQuote';\n $delimiter = ($delimiter === 'comma') ? ',' : $delimiter;\n $delimiter = ($delimiter === 'semicolon') ? ';' : $delimiter;\n $delimiter = ($delimiter === 'colon') ? ':' : $delimiter;\n $delimiter = ($delimiter === 'tab') ? \"\\t\" : $delimiter;\n $encaps = ($encaps === 'singleQuote') ? \"'\" : $encaps;\n $encaps = ($encaps === 'doubleQuote') ? '\"' : $encaps;\n\n ini_set('auto_detect_line_endings', true);\n $handle = fopen($fileAbsolutePath, 'r');\n if ($handle === false) {\n return $mydata;\n }\n\n while (($data = fgetcsv($handle, 10000, $delimiter, $encaps)) !== false) {\n // remove empty line in csv\n if ((count($data) >= 1)) {\n $mydata[] = $data;\n }\n }\n fclose($handle);\n reset($mydata);\n $mydata = $this->convCharset($mydata);\n ini_set('auto_detect_line_endings', false);\n return $mydata;\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 importAll() {\n $row = 1;\n $data = array();\n if ($GLOBALS[\"handle\"]) {\n while (($line = fgetcsv($GLOBALS[\"handle\"])) !== false) {\n \n if ($row == 1 || $row == 2) { $row++; continue; } //skip rows 1 and 2.\n \n $identify = rtrim(sprintf(\"%04d\\n\", $line[1])).ltrim(sprintf(\"%04d\\n\", $line[3]));\n $data[$identify] = array(\"cityCode\"=>$line[1], \"cityName\"=>$line[2], \"streetCode\"=>$line[3], \"streetName\"=>$line[4]);\n $row++;\n }\n fclose($GLOBALS[\"handle\"]);\n } else {\n return 0; //error read file\n }\n return $data;\n}", "private function read_csv() //address book\n {\n $addresses = [];\n $handle = fopen($this->filename, \"r\");\n while (!feof($handle)) \n {\n $row = fgetcsv($handle);\n if(is_array($row)) \n {\n $addresses[] = $row;\n }\n }\n fclose($handle);\n return $addresses;\n }", "public function getCsv() {\r\n $result = array();\r\n if (file_exists($this->csv)) {\r\n\r\n if (($csvfile = fopen($this->csv, \"r\")) !== FALSE) {\r\n $row = 0;\r\n while (($data = fgetcsv($csvfile, 1000, \",\")) !== FALSE) {\r\n if ($row == 0) {\r\n foreach ($data as $value) {\r\n $result['headers'][] = $value;\r\n }\r\n }\r\n else {\r\n $result[$row] = array_combine($result['headers'], $data);\r\n }\r\n $row++;\r\n }\r\n fclose($csvfile);\r\n }\r\n }\r\n return $result;\r\n }", "function csvData($data){\n\t\t$fp = false;\n\t\t$eol = \"\\n\";\n\t\t\n\t\tif ($fp === false) {\n\t\t $fp = fopen('php://temp', 'r+');\n\t\t} else {\n\t\t rewind($fp);\n\t\t}\n\n\t\tif (fputcsv($fp, $data) === false) {\n\t\t return false;\n\t\t}\n\n\t\trewind($fp);\n\t\t$csv = fgets($fp);\n\n\t\tif ($eol != PHP_EOL){\n\t\t $csv = substr($csv, 0, (0 - strlen(PHP_EOL))) . $eol;\n\t\t}\n\t\t\n\t\t//-- For out purpose... we don't want another \\n\n\t\t$csv = substr($csv, 0, strlen($eol) * -1);\n\t\t\n\t\treturn $csv;\n\t}", "public function getRecord()\n\t{\t\t\t\t\n\t\tif(isset($this->_handle))\n\t\t\treturn fgetcsv($this->_handle,null,$this->_columnDelimiter);\n\t\telse \n\t\t\treturn false;\n\t}", "function parse_file($filename,$delimiter = \",\") {\n if(!file_exists($filename) || !is_readable($filename))\n return FALSE;\n \n $header = NULL;\n $data = array();\n if (($handle = fopen($filename, 'r')) !== FALSE)\n {\n while (($row = fgetcsv($handle, 100000, $delimiter)) !== FALSE)\n {\n if($row[0]!=NULL)\n $data[] = $row;\n }\n fclose($handle);\n }\n return $data;\n }", "public function getStatisticsCSV();", "function generateCsv($data, $delimiter = ',', $enclosure = '\"') {\n //Where you go to save the result\n $handle = fopen('php://temp', 'r+');\n foreach ($data as $line) {\n fputcsv($handle, $line, $delimiter, $enclosure);\n }\n rewind($handle);\n while (!feof($handle)) {\n $contents .= fread($handle, 8192);\n }\n fclose($handle);\n return $contents;\n}", "function csv_to_array($csvFile = '', $delimiter = ',')\n{\n $aryData = array();\n $header = NULL;\n $handle = fopen($csvFile, \"r\");\n if ($handle) {\n while (!feof($handle)) {\n $aryCsvData = fgetcsv($handle);\n if (!is_array($aryCsvData)) {\n continue;\n }\n if (is_null($header)) {\n $header = $aryCsvData;\n } elseif (is_array($header) && count($header) == count($aryCsvData)) {\n $aryData[] = array_combine($header, $aryCsvData);\n }\n }\n fclose($handle);\n }\n return $aryData;\n}", "function GetValuesFromCSV($path)\n{\n\n if (($handle = fopen($path, 'a+')) !== FALSE) {\n $animaux = array();\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n list($Nope, $animaux[$data[0]]) = $data;\n\n }\n fclose($handle);\n return $animaux;\n\n }else{\n return false;\n }\n}", "public function readCsv($source) {\n $file = fopen($source, 'r');\n while (($line = fgetcsv($file)) !== FALSE) {\n //$line is an array of the csv elements\n $array_from_csv[] = $line;\n }\n fclose($file);\n\n return $array_from_csv;\n }", "private function read_csv() //public function read_address_book()\n { //code to read file $this->filename\n $handle = fopen($this->filename, 'r');\n $address_book= []; //read each line of CSV and add rows to empty addresses array\n \n \n while(!feof($handle)){\n $row = fgetcsv($handle);\n if(is_array($row)){\n $address_book[] = $row; //does the same thing as array_push($address_book, $row); \n }\n }\n fclose($handle);\n return $address_book;\n }", "function read_csv($db)\n {\n $query=\"INSERT into dishes(did,dname,resturant) values\";\n $temp=array();\n $handle=fopen('sample.csv', 'r');\n if(!$handle)\n {\n echo \"error\";\n }\n\n $temp=fgetcsv($handle);//skip the heading...\n\n while(!feof($handle))\n {\n $temp=fgetcsv($handle);\n $did=$db->mysqlready($temp[0]);\n $dname=$db->mysqlready($temp[1]);\n $dname=check_appro($dname);\n $rest=$db->mysqlready($temp[2]);\n $rest=check_appro($rest);\n $query.=\"($did,'$dname','$rest'),\";\n\n }\n $fquery=substr($query, 0,-1);\n $fquery.=\";\";\n $status=$db->query($fquery);\n\n if(!$status)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "function rs2csvfile(&$rs,$fp,$addtitles=true)\n{\n\t_adodb_export($rs,',',',',$fp,$addtitles);\n}", "function getCSV($rows){\n\tif(empty($rows)){\n\t return \"No records for this category\";\n\t}\n\t//if records returned from DB\n\t$uniqueIds = array_keys($rows[0]);\n\t$header=implode(\",\", $uniqueIds); \t\n\t$fileContent = $header. \"\\r\\n\";\n\tforeach($rows as $row){\n\t\t$fileContent .= implode(\",\", $row) . \"\\r\\n\";\n\t}\n\treturn $fileContent;\n}", "public function get_csv() {\n\t\treturn $this->csv;\n\t}", "function csv_to_array($filename='', $delimiter=';')\n{\n if(!file_exists($filename) || !is_readable($filename))\n return FALSE;\n\n $data = array();\n if (($handle = fopen($filename, 'r')) !== FALSE)\n {\n fgetcsv($handle);\n while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE)\n {\n $data[] = $row;\n }\n fclose($handle);\n }\n return $data;\n}", "function csv_to_array( $file, $header_key = true ){\n if( is_array( $file ) ){\n \n // Check if file has already been processed\n $file_array = $file;\n \n } elseif( is_file( $file ) ){\n \n // Turn the file into an array\n $file_array = array_map( 'str_getcsv', file( $file ) );\n \n } else {\n \n // Try file get contents\n $file_array = file_get_contents( $file );\n \n if( $file_array == false ){\n \n // Can't do anything here\n return false;\n \n }\n }\n \n // Check that the CSV mapping worked\n if( is_array( $file_array ) ){\n \n // Check if we want to use the header row as a key\n if( $header_key == true ){\n \n // Create return and headers array\n $return_array = array();\n $headers = array();\n \n $row_count = 1;\n \n foreach( $file_array as $row ){\n \n // If it's the first row, then use this as the keys\n if( $row_count == 1 ){\n \n // Replace any spaces in the header with underscores to validate the array key, and remove any byte-order markers introduced by csv uploads\n foreach( $row as $header ){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$headers[] = sanitize_key( remove_utf8_bom( $header ) );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n \n } else {\n \n // Go through each cell and use the key\n\t\t\t\t\t$cnt = 0;\n\t\t\t\t\t$new_row = array();\n\t\t\t\t\tforeach( $row as $val ){\n\t\t\t\t\t\t\n // Get the header for this point\n\t\t\t\t\t\t$key = $headers[$cnt];\n\t\t\t\t\t\t\n // Check string isn't blank, or we'll return null\n\t\t\t\t\t\tif( ! strcheck( $val ) ){\n\t\t\t\t\t\t\t$val = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$new_row[$key] = $val;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cnt++;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n \n $return_array[] = $new_row;\n \n }\n \n // Increment the row count\n $row_count++;\n \n }\n \n return $return_array;\n \n } else {\n \n return $file_array;\n \n }\n\t\t\n\t} else {\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\t\n}", "public function get(){\r\n $file= fopen($_GET['filename'],\"r\");\r\n $this->html .= '<h1>Table</h1>';\r\n $this->html .= '<table border =\"1\">';\r\n //check the file till end of the file\r\n while (!feof($file)) {\r\n $line=fgetcsv($file);\r\n\r\n //Type cast to array\r\n $a=(array) $line;\r\n //convert every array into one cell\r\n foreach ($a as $value ) {\r\n $this->html .= \"<td> $value </td>\";\r\n }\r\n $this->html .= '</tr>';\r\n }\r\n $this->html .= '</table>';\r\n\r\n //close the file\r\n fclose($file);\r\n\r\n}", "function csv_to_array($csv, $delimiter = ',', $enclosure = '\"', $escape = '\\\\', $terminator = \"\\n\") { \r\n $r = array(); \r\n $rows = explode($terminator,trim($csv)); \r\n $names = array_shift($rows); \r\n $names = str_getcsv($names,$delimiter,$enclosure,$escape); \r\n $nc = count($names); \r\n foreach ($rows as $row) { \r\n if (trim($row)) { \r\n $values = str_getcsv($row,$delimiter,$enclosure,$escape); \r\n if (!$values) $values = array_fill(0,$nc,null); \r\n $r[] = array_combine($names,$values); \r\n } \r\n } \r\n return $r; \r\n}", "private function csvTaskLoad($csv){\n $multiCsvArr = [];\n if(($handle = fopen(\"{$csv}\", \"r\")) !== false){\n while(($dataRow = fgetcsv($handle, 1000, \",\")) !== false){\n $multiCsvArr[] = $dataRow;\n }\n }\n fclose($handle);\n return $multiCsvArr;\n }", "function lire()\n {\n $handle = fopen(\"fichier.csv\", \"a+\");\n $monArray =[];\n\n while(true)\n {\n $resultat = fgetcsv($handle);\n if(!$resultat)\n break;\n array_push($monArray, $resultat);\n }\n\n fclose($handle);\n return $monArray;\n // var_dump();\n }", "function import_csv()\n {\n $msg = 'OK';\n $path = JPATH_ROOT.DS.'tmp'.DS.'com_condpower.csv';\n if (!$this->_get_file_import($path))\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_UPLOAD_IMPORT_CSV_FILE'));\n }\n// $_data = array(); \n if ($fp = fopen($path, \"r\"))\n {\n while (($data = fgetcsv($fp, 1000, ';', '\"')) !== FALSE) \n {\n unset($_data);\n $_data['virtuemart_custom_id'] = $data[0];\n $_data['virtuemart_product_id'] = $data[1];\n $id = $this->_find_id($_data['virtuemart_custom_id'],$_data['virtuemart_product_id']);\n if((int)$id>0)\n {\n $_data['id'] = $id;\n }\n// $_data['intvalue'] = iconv('windows-1251','utf-8',$data[3]);\n $_data['intvalue'] = str_replace(',', '.', iconv('windows-1251','utf-8',$data[3]));\n if(!$this->_save($_data))\n {\n $msg = 'ERROR';\n }\n }\n fclose($fp);\n }\n else\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_OPEN_TO_IMPORT'));\n }\n return array(TRUE,$msg);\n }", "public function next(): void\n {\n $this->values = [];\n $row = fgetcsv($this->fp, 0, $this->delimiter, $this->enclosure);\n\n if ($row) { // Is het einde (eof) nog niet bereikt?\n if ($row === array(null)) { // Empty row?\n $this->next(); // Skip row\n return;\n }\n ++$this->index;\n foreach ($this->keys as $index => $key) {\n if (isset($row[$index])) { // Is er voor deze kolom een waarde?\n $this->values[$key] = $row[$index];\n } else {\n $filename = (strpos($this->filename, \\Sledgehammer\\PATH) === 0) ? substr($this->filename, strlen(\\Sledgehammer\\PATH)) : $this->filename; // Waar mogelijk het PATH er van af halen\n \\Sledgehammer\\notice('Row too short, missing column #' . ($index + 1) . ': \"' . $this->keys[$index] . '\" in ' . $filename . ' on line ' . ($this->index + 2), $row); // @todo Calculate line offset compared to the index ()\n }\n }\n } else {\n $this->index = null;\n }\n }", "function create_csv_string($data) {\n if (!$fp = fopen('php://temp', 'w+')) return FALSE;\n\n // Loop data and write to file pointer\n foreach ($data as $line) fputcsv($fp, $line);\n\n // Place stream pointer at beginning\n rewind($fp);\n\n // Return the data\n return stream_get_contents($fp);\n\n }", "protected function initCSV() {}", "public function csvData()\n {\n }", "function import_csv($obj)\n\t{\n\t\t$param_array = func_get_args();\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::import_csv() - PARAMETER LIST : ', $param_array);\n\t\t\n\t\t\t$row = 0;\n\t\t\t\n\t\t\t$handle = fopen($obj->csv_file_path, \"r\");\n\t\t\t\n\t\t\twhile (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) \n\t\t\t{\n\t\t\t\t\n\t\t\t\tif($row > 0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$res = $this->fetch_flds($obj->cls_tbl, $obj->primary_fld, $obj->primary_fld . \" = '\" . $data[0] . \"'\");\n\t\t\t\t\t\n\t\t\t\t\tif($res[1] > 0)\n\t\t\t\t\t{//update the record\n\t\t\t\t\t\t$cond = $obj->primary_fld . \" = '\" . $data[0] . \"'\";\n\t\t\t\t\t\tdatabase_manipulation::update_record($obj, $cond, \"csv\", $data);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{//insert the record\n\t\t\t\t\t\tdatabase_manipulation::insert_record($obj, \"csv\", $data);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$row++;\n\t\t\t}\n\t\t\t\n\t\t\tfclose($handle);\n\t\t\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::import_csv() - Return Value : ', 'Importing Csv Data Into the Database.', true);\n\n\t}", "function csvToArray($file, $delimiter) {\n\tif (($handle = fopen($file, 'r')) !== FALSE) {\n\t\t$i = 0;\n\t\twhile (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) {\n\t\t\tfor ($j = 0; $j < count($lineArray); $j++) {\n\t\t\t\t$arr[$i][$j] = $lineArray[$j];\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\tfclose($handle);\n\t}\n\treturn $arr;\n}", "public function getItem() \n\t{\t\t\t\n\t\t$fields = fgetcsv($this->_handle, 0, $this->_csvOptions['delimiter'], $this->_csvOptions['enclosure']);\n\t\tif ($fields === false ) {\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\tif ($fields[0] === null) {\n\t\t\treturn array();\n\t\t}\n\t\treturn array_diff($fields, array(''));\n\t}", "function fileFetcher(string $address): array {\n $csv_src = file_get_contents($address);\n return str_getcsv($csv_src, \"\\n\");\n}", "public function get_CSV_Combat(){\n $handle = fopen(\"combatTable.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\t\t\t\t{\n $final_ata[] = array_combine($headers, array_values($data));\n }\n } \n $result_arr = array(); \n foreach($final_ata as $key => $value){\n $name = $final_ata[$key]['CT_Variable'];\n $result_arr[$name] = $value;\n }\n return($result_arr);\n \n }", "public function getFilteredCSV($filter){\n $handle = fopen($this->_csv_file, \"r\");\n $array_line_full = array();\n\n while (($line = fgetcsv($handle, 0, \",\")) !== FALSE) {\n $key = strtoupper(trim($line[0]));\n if(array_key_exists($key,$filter)){\n $new_line = array();\n $new_line[] = $filter[$key];\n $new_line[] = (float) trim($line[2]);\n $new_line[] = (float) trim($line[5]);\n $new_line[] = trim($line[1]);\n $new_line[] = (float) trim($line[4]);\n $new_line[] = (float) trim($line[3]);\n // making latdeal = closerate\n $new_line[] = (float) trim($line[5]);\n $new_line[] = null;\n $new_line[] = null;\n $new_line[] = null;\n $new_line[] = (int) trim($line[6]);\n $new_line[] = 1;\n $array_line_full[] = $new_line;\n }\n }\n fclose($handle);\n return $array_line_full;\n }", "public static function getAlgoCSVFile($csv){\n return new CSVDattaGetter($csv);\n }", "protected function fpassthru()\n {\n $bom = '';\n $input_bom = $this->getInputBOM();\n if ($this->output_bom && $input_bom != $this->output_bom) {\n $bom = $this->output_bom;\n }\n $csv = $this->getIterator();\n $csv->setFlags(SplFileObject::READ_CSV);\n $csv->rewind();\n if (!empty($bom)) {\n $csv->fseek(mb_strlen($input_bom));\n }\n echo $bom;\n $res = $csv->fpassthru();\n\n return $res + strlen($bom);\n }", "public function getLine(){\n $obj = new SplFileObject($this->_csv_file);\n $obj->seek($this->_counter);\n if($this->_counter < $this->_number_of_lines){\n $this->_counter++;\n $arr = $obj->fgetcsv($this->_delimiter);\n }else{\n $arr = null;\n }\n $obj = null;\n return $arr;\n }", "public static function convertCsvToArray($filepath, $hasHeader, $keys=null)\n {\n $file = fopen($filepath, 'r');\n $output = array();\n $firstRow = true;\n \n while ($row = fgetcsv($file))\n {\n // Skip empty lines (users may accidentally put one at the end\n // libre calc wont strip this either.\n if (count($row) == 0 || $row[0] === \"\")\n {\n continue;\n }\n \n if ($firstRow)\n {\n $firstRow = false;\n \n if ($hasHeader)\n {\n if ($keys == null)\n {\n $keys = $row;\n }\n \n continue;\n }\n }\n \n if ($keys != null)\n {\n if (count($keys) != count($row))\n {\n $msg = \"Cannot convert csv to array. Number of keys: \" . count($keys) . \n \" is not the same as the number of values: \" . count($row);\n throw new \\Exception($msg);\n }\n $output[] = array_combine($keys, $row);\n }\n else\n {\n $output[] = $row;\n }\n }\n \n return $output;\n }", "function echocsv($fields)\r\n{\r\n $separator = '';\r\n foreach ($fields as $field) {\r\n if (preg_match('/\\\\r|\\\\n|,|\"/', $field)) {\r\n $field = '\"' . str_replace('\"', '\"\"', $field) . '\"';\r\n }\r\n echo $separator . $field;\r\n $separator = ',';\r\n }\r\n echo \"\\r\\n\";\r\n}", "function csvToArray($fileContent, $delimiter = ',', $enclosure = '\"', $escape = '\\\\') {\n $lines = array();\n $fields = array();\n\n if($escape == $enclosure) {\n $escape = '\\\\';\n $fileContent = str_replace(array('\\\\',$enclosure.$enclosure,\"\\r\\n\",\"\\r\"),\n array('\\\\\\\\',$escape.$enclosure,\"\\\\n\",\"\\\\n\"),$fileContent);\n } else {\n $fileContent = str_replace(array(\"\\r\\n\",\"\\r\"),array(\"\\\\n\",\"\\\\n\"),$fileContent);\n }\n\n $nb = strlen($fileContent);\n $field = '';\n $inEnclosure = false;\n $previous = '';\n\n for($i = 0;$i<$nb; $i++) {\n $c = $fileContent[$i];\n if ($c === $enclosure) {\n if($previous !== $escape) {\n $inEnclosure ^= true;\n } else {\n $field .= $enclosure;\n }\n } else if($c === $escape) {\n $next = $fileContent[$i+1];\n if($next != $enclosure && $next != $escape)\n $field .= $escape;\n } else if($c === $delimiter) {\n if($inEnclosure) {\n $field .= $delimiter;\n } else {\n //end of the field\n $fields[] = $field;\n $field = '';\n }\n } else if($c === \"\\n\") {\n $fields[] = $field;\n $field = '';\n $lines[] = $fields;\n $fields = array();\n } else {\n $field .= $c;\n $previous = $c;\n }\n }\n\n //we add the last element\n if(true || $field !== '') {\n $fields[] = $field;\n $lines[] = $fields;\n }\n\n return $lines[0];\n }", "public function fetch()\n {\n static $currentLine = 0;\n $dataResult = array();\n\n if (isset($this->options['skipHeader']) && $this->options['skipHeader'] === true) {\n $skipLines = 1;\n } elseif (isset($this->options['skipHeader']) && \\is_numeric($this->options['skipHeader'])) {\n $skipLines = (int)$this->options['skipHeader'];\n } else {\n $skipLines = 0;\n }\n if (($handle = fopen($this->csvFilePath, 'r')) !== false) {\n while (($data = fgetcsv($handle, 65534, $this->csvDelimiter, $this->csvEnclosure)) !== false) {\n // skip header (maybe is better to set the first offset position instead)\n if ($currentLine < $skipLines) {\n $currentLine++;\n continue;\n }\n if ($currentLine >= $this->offset && $currentLine < ($this->offset + $this->limit)) {\n if (isset($data[0]) && $data[0] !== '') {\n $this->preProcessRecordData($data);\n $dataResult[] = $data;\n }\n }\n $currentLine++;\n }\n fclose($handle);\n }\n $this->logger->debug(sprintf('%s: read %s lines and found %s records.', $this->csvFilePath, $currentLine, count($dataResult)));\n return $dataResult;\n }", "public static function file_get_contents_csv($path, $delimiter = ',') {\n $rows = [];\n if (($handle = fopen($path, \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, null, $delimiter)) !== FALSE) {\n $rows[] = $data;\n }\n fclose($handle);\n }\n return $rows;\n }", "function extract_fputcsv($filePointer,$dataArray,$delimiter,$enclosure)\n {\n // $filePointer = the file resource to write to\n // $dataArray = the data to write out\n // $delimeter = the field separator\n \n // Build the string\n $string = \"\";\n \n // No leading delimiter\n $writeDelimiter = FALSE;\n foreach($dataArray as $dataElement)\n {\n // Replaces a double quote with two double quotes\n $dataElement=str_replace(\"\\\"\", \"\\\"\\\"\", $dataElement);\n \n // Adds a delimiter before each field (except the first)\n if($writeDelimiter) $string .= $delimiter;\n \n // Encloses each field with $enclosure and adds it to the string\n $string .= $enclosure . $dataElement . $enclosure;\n \n // Delimiters are used every time except the first.\n $writeDelimiter = TRUE;\n } // end foreach($dataArray as $dataElement)\n \n // Append new line\n $string .= \"\\n\";\n \n // Write the string to the file\n fwrite($filePointer,$string);\n }", "private function get_csv_data() {\n if (!is_resource($this->fh) || get_resource_type($this->fh) !== \"stream\") {\n $this->log_it(\"CSV file not open when get_csv_data() called.\");\n return false;\n }\n\n // Consume/discard header row, if it exists.\n if (HEADER_ROW_EXISTS) {\n fgets($this->fh);\n $row_num = 2;\n } else {\n $row_num = 1;\n }\n\n $graded_reg_codes = STUDENT_REGISTERED_CODES;\n $audit_reg_codes = is_null(STUDENT_AUDIT_CODES) ? array() : STUDENT_AUDIT_CODES;\n $latedrop_reg_codes = is_null(STUDENT_LATEDROP_CODES) ? array() : STUDENT_LATEDROP_CODES;\n $all_valid_reg_codes = array_merge($graded_reg_codes, $audit_reg_codes, $latedrop_reg_codes);\n $unexpected_term_codes = array();\n\n // Read and assign csv rows into $this->data array\n $row = fgetcsv($this->fh, 0, CSV_DELIM_CHAR);\n while(!feof($this->fh)) {\n // Course is comprised of an alphabetic prefix and a numeric suffix.\n $course = strtolower($row[COLUMN_COURSE_PREFIX] . $row[COLUMN_COURSE_NUMBER]);\n\n // Trim whitespace from all fields in $row.\n array_walk($row, function(&$val, $key) { $val = trim($val); });\n\n // Remove any leading zeroes from \"integer\" registration sections.\n if (ctype_digit($row[COLUMN_SECTION])) $row[COLUMN_SECTION] = ltrim($row[COLUMN_SECTION], \"0\");\n\n switch(true) {\n // Check that $row has an appropriate student registration.\n case array_search($row[COLUMN_REGISTRATION], $all_valid_reg_codes) === false:\n // Skip row.\n break;\n\n // Check that $row is associated with the current term (if check is enabled)\n // Assume this check is OK, when EXPECTED_TERM_CODE is null (check disabled)\n case is_null(EXPECTED_TERM_CODE) ? false : $row[COLUMN_TERM_CODE] !== EXPECTED_TERM_CODE:\n // Note the unexpected term code for logging, if not already noted.\n if (array_search($row[COLUMN_TERM_CODE], $unexpected_term_codes) === false) {\n $unexpected_term_codes[] = $row[COLUMN_TERM_CODE];\n }\n break;\n\n // Check that $row is associated with the course list.\n case array_search($course, $this->course_list) !== false:\n if (validate::validate_row($row, $row_num)) {\n // Include $row\n $this->data[$course][] = $row;\n\n // $row with a blank email is included, but it is also logged.\n if ($row[COLUMN_EMAIL] === \"\") {\n $this->log_it(\"Blank email found for user {$row[COLUMN_USER_ID]}, row {$row_num}.\");\n }\n } else {\n // There is a problem with $row, so log the problem and skip.\n $this->invalid_courses[$course] = true;\n $this->log_it(validate::$error);\n }\n break;\n\n // Check that the $row is associated with a mapped course.\n case array_key_exists($course, $this->mapped_courses):\n // Also verify that the section is mapped.\n $section = $row[COLUMN_SECTION];\n if (array_key_exists($section, $this->mapped_courses[$course])) {\n $m_course = $this->mapped_courses[$course][$section]['mapped_course'];\n if (validate::validate_row($row, $row_num)) {\n // Include $row.\n $row[COLUMN_SECTION] = $this->mapped_courses[$course][$section]['mapped_section'];\n $this->data[$m_course][] = $row;\n\n // $row with a blank email is allowed, but it is also logged.\n if ($row[COLUMN_EMAIL] === \"\") {\n $this->log_it(\"Blank email found for user {$row[COLUMN_USER_ID]}, row {$row_num}.\");\n }\n } else {\n // There is a problem with $row, so log the problem and skip.\n $this->invalid_courses[$m_course] = true;\n $this->log_it(validate::$error);\n }\n }\n break;\n\n default:\n // Skip row by default.\n break;\n\n } // END switch (true)\n\n $row = fgetcsv($this->fh, 0, CSV_DELIM_CHAR);\n $row_num++;\n }\n\n // Log any unexpected term codes.\n // This may provide a notice that the next term's data is available.\n if (!empty($unexpected_term_codes)) {\n $msg = \"Unexpected term codes in CSV: \";\n $msg .= implode(\", \", $unexpected_term_codes);\n $this->log_it($msg);\n }\n\n /* ---------------------------------------------------------------------\n There may be \"fake\" or \"practice\" courses in Submitty that shouldn't be\n altered by the autofeed. These courses will have no enrollments in the\n csv file as these courses are not recognized by the registrar.\n --------------------------------------------------------------------- */\n\n // Filter out any \"empty\" courses so they are not processed.\n // There shouldn't be any \"empty\" course data, but this is just in case.\n $this->data = array_filter($this->data, function($course) { return !empty($course); }, 0);\n\n // Most runtime involves the database, so we'll release the CSV now.\n $this->close_csv();\n\n // Done.\n return true;\n }", "public static function getCsvData ($filename, $getHeaders = false, $assignKeys = false, $keyAsFirstRow = false)\r\n\t{\r\n\t\t# Make sure the file exists\r\n\t\tif (!is_readable ($filename)) {return false;}\r\n\t\t\r\n\t\t# Open the file\r\n\t\tif (!$fileHandle = fopen ($filename, 'rb')) {return false;}\r\n\t\t\r\n\t\t# Determine the longest line length\r\n\t\t$longestLineLength = 1000;\r\n\t\t$array = file ($filename);\r\n\t\t$count = count ($array);\r\n\t\tfor ($i = 0; $i < $count; $i++) {\r\n\t\t\tif ($longestLineLength < strlen ($array[$i])) {\r\n\t\t\t\t$longestLineLength = strlen ($array[$i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tunset ($array);\r\n\t\t\r\n\t\t# Get the column names\r\n\t\tif (!$mappings = fgetcsv ($fileHandle, $longestLineLength + 1)) {return false;}\r\n\t\t\r\n\t\t# Start a counter if assigning keys\r\n\t\tif ($assignKeys) {$assignedKey = 0;}\r\n\t\t\r\n\t\t# Loop through each line of data\r\n\t\t$data = array ();\r\n\t\twhile ($csvData = fgetcsv ($fileHandle, filesize ($filename))) {\r\n\t\t\t\r\n\t\t\t# Check the first item exists and set it as the row key then unset it\r\n\t\t\tif ($firstRowCell = $csvData[0]) {\r\n\t\t\t\tif (!$keyAsFirstRow) {unset ($csvData[0]);}\r\n\t\t\t\t\r\n\t\t\t\t# Determine the key name to use\r\n\t\t\t\t$rowKey = ($assignKeys ? $assignedKey++ : $firstRowCell);\r\n\t\t\t\t\r\n\t\t\t\t# Loop through each item of data\r\n\t\t\t\t#!# What should happen if a row has fewer columns than another? If there are fields missing, then it may be better to allow offsets to be generated as otherwise the data error may not be known. Filling in the remaining fields is probably wrong as we don't know which are missing.\r\n\t\t\t\tforeach ($csvData as $key => $value) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t# Assign the entry into the table\r\n\t\t\t\t\tif (isSet ($mappings[$key])) {$data[$rowKey][$mappings[$key]] = $value;}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t# Close the file\r\n\t\tfclose ($fileHandle);\r\n\t\t\r\n\t\t# Return the result\r\n\t\treturn $data;\r\n\t}", "function csvAdapter($d)\r\n\t{\r\n\t\tparent::RecordSetAdapter($d);\r\n\t\t\r\n\t\t$this->columnNames = $d['cols'];\r\n\t\t$data = $d['filename'];\r\n\t\t$sep = isset($d['separator']) ? $d['separator'] : ','; \r\n\r\n\t\t$reader = & new CSVReader( new FileReader($data) );\r\n\t\t$reader->setSeparator($sep);\r\n\t\t\r\n\t\t// grab all of the rows\r\n\t\t\r\n\t\t$ob = \"\";\r\n\t\t\r\n\t\t\r\n\t\t$numlines = 0;\r\n\t\twhile( false != ( $cell = $reader->next() ) ) {\r\n\t\t\t//Write array flag + length\r\n\t $to = count( $cell );\r\n\t $ob .= \"\\12\" . pack('N', $to);;\r\n\t \r\n for($i = 0; $i < $to; $i++)\r\n { //Type everything as a string since this is csv\r\n \t$value = $cell[$i];\r\n\t $os = $this->_directCharsetHandler->transliterate($value);\r\n\t\t\t\t//string flag, string length, and string\r\n\t\t\t\t$len = strlen($os);\r\n\t\t if($len < 65536)\r\n\t\t\t\t{\r\n\t\t \t$ob .= \"\\2\" . pack('n', $len) . $os;\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$ob .= \"\\14\" . pack('N', $len) . $os;\r\n\t\t\t\t}\r\n }\r\n $numlines++;\r\n\t\t}\r\n\t\t\r\n\t\t$this->numRows = $numlines;\r\n\t\t$this->serializedData = $ob;\r\n\t}", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "public function readCsvCBS() {\n // Check if the source file is available\n if( ! self::isFileAvailable( self::CBS_INHABITANTS_SOURCE_CSV_FILE ) ) {\n return false;\n }\n $header = NULL;\n $data = array();\n if (($handle = fopen( self::CBS_INHABITANTS_SOURCE_CSV_FILE, 'r')) !== FALSE) {\n while (($row = fgetcsv($handle, 1000, SELF::CBS_INHABITANTS_SOURCE_CSV_FILE_DELIMITER )) !== FALSE) {\n if( ! $header ) { // first line is the header\n $fieldsCount = count( $row );\n $header = array( self::HEADER_CITY_CODE, self::HEADER_CITY_NAME, self::HEADER_INHABITANTS );\n } else { // add a line of csv-data to our data array\n if( count( $row ) == $fieldsCount ) {\n $data[] = array_combine($header, array( $row[0], $row[1], $row[2] ) );\n }\n }\n }\n fclose($handle);\n }\n return $data;\n }", "public function parse()\n {\n if ($handle = fopen($this->csv, 'r'))\n {\n while ($data = fgetcsv($handle, \",\"))\n {\n $this->dataArray[] = $data;\n }\n }\n fclose($handle);\n }", "private function queryCSV()\n {\n // validate dates\n $this->validateDate();\n\n // set startDate and endDate as option\n // query returns complete available historical data if no date is passed\n if (!empty($this->startDate)) {\n $this->startDate = explode('-', $this->startDate);\n $this->startDate[1] = $this->startDate[1] - 1; // yahoo index starts with 0 for january\n\n $configStartDate = '&a=' . $this->startDate[1] . '&b=' . $this->startDate[2] . '&c=' . $this->startDate[0];\n } else {\n $configStartDate = '&a=&b=&c=';\n }\n if (!empty($this->endDate)) {\n $this->endDate = explode('-', $this->endDate);\n $this->endDate[1] = $this->endDate[1] - 1; // yahoo index starts with 0 for january\n\n $configEndDate = '&d=' . $this->endDate[1] . '&e=' . $this->endDate[2] . '&f=' . $this->endDate[0];\n } else {\n $configEndDate = '&d=&e=&f=';\n }\n\n // add start and end date to query url if set\n $configDate = $configStartDate . $configEndDate;\n\n // set request url\n $this->baseUrl = 'http://ichart.finance.yahoo.com/table.csv?s=';\n $configValue = '&g=' . $this->queryParams . '&ignore=.csv';\n $this->queryUrl = $this->baseUrl . urlencode(\n $this->queryString\n ) . $configDate . $configValue;\n\n // curl request\n $this->curlRequest($this->queryUrl);\n\n if (404 == $this->response['status']) {\n return $data = [];\n }\n\n // parse csv\n $result = str_getcsv($this->response['result'], \"\\n\"); //parse rows\n foreach ($result as &$row) { //parse items in row\n $row = str_getcsv($row);\n }\n unset($row);\n\n // assign headers of first row as key to values of following rows\n $dataKeys = $result[0];\n foreach ($dataKeys as $key => $value) {\n $dataKeys[$key] = str_replace(' ', '', $value); // strip white space\n }\n unset($result[0]);\n $result = array_values($result);\n\n // build array\n $data = [];\n foreach ($result as $key => $row) {\n foreach ($row as $rowKey => $rowValue) {\n $data[$key][$dataKeys[$rowKey]] = $rowValue;\n }\n }\n\n return $data;\n }", "function processCSV($date, $ID, $columns) {\n\tglobal $DATA_DIR;\n\t$dir_handle = @opendir($DATA_DIR.$ID) or die(\"Error: Cannot open the data folder for detector id: \".$ID); \n\t$handle = fopen($DATA_DIR.$ID.'/'.$date.'.csv',\"r\");\n\t\n\t$skipFirstHeader = TRUE;\n\t$useSecondHeaderInput = TRUE;\n\twhile($data = fgetcsv($handle, 0)) {\n\t\tif ($skipFirstHeader)\n\t\t\t$skipFirstHeader = FALSE;\n\t\telse {\n\t\t\tforeach($columns as $value) {\n\t\t\t\t$outputData[] = $data[$value];\n\t\t\t}\n\t\t\t$output = implode(',', $outputData);\n\t\t\t$meta[\"data\"][] = $output;\n\t\t\tif ($useSecondHeaderInput) {\n\t\t\t\t$useSecondHeaderInput = FALSE;\n\t\t\t\t$meta[\"time\"][] = \"Time in UTC\";\n\t\t\t}\n\t\t\telse\n\t\t\t\t$meta[\"time\"][] = date(\"Y-m-d H:i\", strtotime($data[0]));\n\t\t\tunset($outputData);\n\t\t}\n\t}\n\tfclose($handle);\n\treturn $meta;\n\t\n}", "public function get_CSV_Attr()\n\t{\n\t\t$handle = fopen(\"./tables/attributes.csv\", \"r\");\n\t\t$first_row = true;\n\t\t$final_ata = array();\n\t\t$headers = array();\n\n\t\twhile (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) \n\t\t{ \n\t\t\tif($first_row) \n\t\t\t{\n\t\t\t\t$headers = $data;\n\t\t\t\t$first_row = false;\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\t$final_ata[] = array_combine($headers, array_values($data));\n\t\t\t}\n\t\t}\n\n\t\t$result_arr = array();\t\n\t\tforeach($final_ata as $key => $value)\n\t\t{\n\t\t\t$name = $final_ata[$key]['ATTR_Varaiable'];\n\t\t\t$result_arr[$name] = $value;\n\t\t}\n\t\treturn($result_arr);\n \n }", "function testCSVFile() {\n\t$heads = array('id','first','second','third');\n\t$data = array(\n\t\tarray(1,'A','&euro; 17.345','C'),\n\t\tarray(2,'D','E','2010-03-21'),\n\t\tarray(3,'G','H','I'),\n\t\t);\n\t$p = new CreateCSVFile('test.xls',$heads,$data);\n\t$p->headers();\n\techo $p->output();\n\t}", "function readCsv($fileName) {\n\n\t// Lecture du fichier src :\n\t$myfile = fopen($fileName, \"r\") or die(\"Unable to open file!\");\n\t$dataStr = fread($myfile,filesize($fileName));\n\tfclose($myfile);\n\n\t$lines = explode(\"\\n\", $dataStr);\n\t$days = array();\n\n\tforeach ($lines as $line) {\n\t\t$temp = explode(\";\", $line);\n\t\tif (count($temp) == 2) {\n\t\t\tarray_push($days, new Day($temp[0], $temp[1]));\n\t\t}\n\t}\n\treturn $days;\n}", "function savefile($fname, $val){\n$fp = fopen($fname, 'a');\nfputcsv($fp, $val);\nfclose($fp);\n}", "public function getCSV(){\n\t\ttry {\n\t\t\treturn fopen(\"output/filteredApiOutput.csv\", \"w\");\n\t\t}catch (Exception $e) {\n\t\t\terror_log($e->getMessage(),3,\"/var/tmp/error.log\");\n\t\t\terror_log(\"\\n\");\n\t\t}\n\t}", "public static function csvToArray($filename = '', $delimiter = ',')\n\t{\n\t\tif(!file_exists($filename) || !is_readable($filename))\n\t return false;\n\t\t\n\t\t$data = array();\n\t\t$file = fopen($filename, 'r');\n\t\twhile (($line = fgetcsv($file)) !== FALSE) {\n\t\t\t$data[$line[0]] = $line[1];\n\t\t}\n\t\tfclose($file);\n\t\t\n\t\treturn $data;\n\t}", "public function parse()\n {\n $this->file = fopen($this->filename, 'r');\n $lineCount = 0;\n\n while (($line = fgetcsv(\n $this->file,\n 0,\n $this->delimiter,\n $this->enclosure,\n $this->escape\n )) !== false) {\n if ($lineCount++ == 0) {\n $line[0] = StringUtils::removeBOM($line[0]);\n $this->setHeader($line);\n\n if ($this->hasHeader) {\n continue;\n }\n }\n\n $this->parseLine($line);\n }\n\n fclose($this->file);\n }", "function _webform_csv_data_file($data) {\r\n $filedata = unserialize($data['value']['0']);\r\n return empty($filedata['filename']) ? array('', '') : array(webform_file_url($filedata['filepath']), (int)($filedata['filesize']/1024));\r\n}", "public function purchase_csv_file() {\n $query = $this->db->select('a.chalan_no,a.purchase_id,b.supplier_name,a.purchase_date,a.grand_total_amount')\n ->from('product_purchase a')\n ->join('supplier_information b', 'b.supplier_id = a.supplier_id', 'left')\n ->order_by('a.purchase_date','desc')\n ->get();\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return false;\n }", "protected function analyzeCsv() {\n $options = array(\n 'delimiter' => ',',\n 'enclosure' => '\"'\n );\n $possibleDelimiters = array(\n '\"',\n \"'\"\n );\n $contents = file_get_contents($this->fileName);\n $firstChar = substr($contents, 0, 1);\n\n if (in_array($firstChar, $possibleDelimiters)) {\n $options['enclosure'] = $firstChar;\n }\n\n if (substr_count($contents, ';') > substr_count($contents, ',')) {\n $options['delimiter'] = ';';\n }\n return $options;\n\n }", "function parse_file($p_Filepath, $p_NamedFields = true) {\r\n $content = false;\r\n $file = fopen($p_Filepath, 'r');\r\n if($p_NamedFields) {\r\n $this->fields = fgetcsv($file, $this->max_row_size, $this->separator, $this->enclosure);\r\n\t\t\t \r\n\t\t\tfor ($i=0; $i <count($this->fields) ; $i++) {\r\n $this->fields[$i] = trim($this->fields[$i]);\r\n }\r\n\t\t\t\r\n\t\t\t\r\n }\r\n while( ($row = fgetcsv($file, $this->max_row_size, $this->separator, $this->enclosure)) != false ) { \r\n // if( $row[0] != null ) { // descomente esta instruccion si quiere quitar lineas con espacios en blanco\r\n //en la primera columna\r\n if( !$content ) {\r\n $content = array();\r\n }\r\n if( $p_NamedFields ) {\r\n $items = array();\r\n \r\n // I prefer to fill the array with values of defined fields\r\n foreach($this->fields as $id => $field) {\r\n if( isset($row[$id]) ) {\r\n $items[$field] = $row[$id]; \r\n }\r\n }\r\n $content[] = $items;\r\n } else {\r\n $content[] = $row;\r\n }\r\n //}\r\n }\r\n fclose($file);\r\n return $content;\r\n }", "function createArrayFromCSV($filepath,$filename){\n $file = $filepath.$filename;\n $csv = array_map('str_getcsv', file($file));\n array_walk($csv, function(&$a) use ($csv) {\n $a = array_combine($csv[0], $a);\n });\n # remove column header\n array_shift($csv);\n return $csv;\n}", "function get_csv() {\n $filename = \"list.csv\";\n $csv = array_map('str_getcsv', file($filename));\n $head = array_shift($csv);\n foreach ($head as $item) {\n $header[] = strtolower($item);\n }\n array_walk($csv, '_combine_array', $header);\n return $csv;\n}", "function getFeedData( $link)\n\t{\n//\t\t$data = explode( \"\\r\\n\", $data);\n//\t\treturn $data;\n\n//\t\t$csv = array_map( 'str_getcsv', file( $link));\n//\t\t$csv = str_getcsv( $data, ';');\n\t\t$csv = csv_to_array( $link, ';');\n\t\techo $csv;\n\t\treturn $csv;\n\t}" ]
[ "0.71383435", "0.7013521", "0.6879087", "0.6875448", "0.6789063", "0.67260146", "0.6724758", "0.6716725", "0.6710119", "0.66735125", "0.6646716", "0.6619246", "0.6572185", "0.6568439", "0.65654624", "0.6563404", "0.65570086", "0.65429634", "0.64934427", "0.64907897", "0.6490498", "0.6485979", "0.6481915", "0.64781594", "0.64781594", "0.6464137", "0.64447635", "0.641856", "0.6403055", "0.6387037", "0.63784903", "0.6366992", "0.6357004", "0.63400495", "0.63353693", "0.6324906", "0.6292667", "0.62817717", "0.6273473", "0.62415284", "0.61741346", "0.6156521", "0.6152957", "0.61434644", "0.6133138", "0.61246973", "0.6124691", "0.61122364", "0.61026126", "0.60923845", "0.60803986", "0.6071371", "0.607088", "0.606708", "0.604154", "0.604048", "0.6022234", "0.60163605", "0.60103446", "0.60073644", "0.59837204", "0.5982515", "0.596752", "0.5953975", "0.5951222", "0.59101516", "0.5887342", "0.5887176", "0.5882584", "0.5870881", "0.58401805", "0.5832728", "0.5823034", "0.5810608", "0.5790657", "0.57683855", "0.57578564", "0.57550806", "0.57522917", "0.57472515", "0.574354", "0.57358783", "0.573501", "0.57251364", "0.572138", "0.5710252", "0.5703718", "0.570172", "0.5699692", "0.5694322", "0.56886554", "0.56797856", "0.5671909", "0.56716377", "0.5663928", "0.5650206", "0.5646629", "0.56339365", "0.5619793", "0.56118613" ]
0.6645981
11
get from temporary data
public function inputmember($key){ $this->db->where('key',$key); $temp_user = $this->db->get('tbl_users_temp'); if($temp_user){ $row_res = $temp_user->row(); $data = array( 'email' => $row_res->email, 'password' => $row_res->password, 'firstname' => $row_res->firstname, 'lastname' => $row_res->lastname, 'emailtype' => $row_res->emailtype, 'gender' => $row_res->gender ); $insertquery = $this->db->insert('tbl_users',$data); // SET SESSION $email = $row_res->email; $this->setsession($email); } // if insert to table user succeeded then delete temp data if($insertquery){ $this->db->where('key',$key); $this->db->delete('tbl_users_temp'); $this->setsession($row_res->email); return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function getdata();", "public function get_data()\n\t\t{\t\t// Should there be a common method for this?\n\t\t}", "public function get_data();", "public static function getData() {}", "public function getTemporaryData($id) {\n\t\treturn SQLQuery::create()->bypassSecurity()->select(\"TemporaryData\")->whereValue(\"TemporaryData\",\"id\",$id)->field(\"value\")->executeSingleValue();\n\t}", "function get_data() {\r\n return $this->data;\r\n }", "public function getData() {}", "protected function getData() { }", "function get_data()\n {\n }", "public function get_data() {\n\t\treturn $this->data;\n\t}", "public function get_data() {\r\n\t\treturn $this->data;\r\n\t}", "function &getData()\r\n\t{\r\n\r\n\t\tif ($this->_loadData())\r\n\t\t{\r\n\r\n\t\t}\r\n\t\telse $this->_initData();\r\n\r\n\t\treturn $this->_data;\r\n\t}", "public function getRawData()\n\t{\n\n\t\treturn @file_get_contents($this->tmpFileName);\n\n\t}", "public function getDataWithTypeCurrent() {}", "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();", "public function getData();", "public function getData();", "public function getData();", "public function getData(): mixed;", "public function get_data() {\n $data = parent::get_data();\n if ($data !== null) {\n }\n return $data;\n }", "public function get_data()\n {\n return $this->_data;\n }", "public function get_data() {\r\n return $this->data;\r\n }", "protected static function getData()\n {\n }", "abstract protected function data();", "public function getData(){\n\t\treturn $this->data;\n\t}", "public function getData(){\n\t\treturn $this->data;\n\t}", "public function getData(){\n\t\treturn $this->data;\n\t}", "public function get_data() {\n return $this->data;\n }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function data(){\n\n\t\treturn $this->_data;\n\n\t}", "abstract function get();", "public function data(){\r\n\t\treturn $this->_data;\r\n\t}", "public function getTemp(string $key) : mixed\n {\n if (isset($_SESSION['$']['temp'][$key])) {\n if ($_SESSION['$']['temp'][$key]['ttl'] > \\time()) {\n return $_SESSION['$']['temp'][$key]['data'];\n }\n unset($_SESSION['$']['temp'][$key]);\n }\n return null;\n }", "function get_data($name) {\n return isset($this->data[$name]) ? $this->data[$name] : null;\n }", "abstract public function getData(): object;", "protected function getData()\n {\n return $this->data;\n }", "public final function getData(){\n return $this->data;\n }", "public function &getData()\n\t\t{\n\t\t\treturn $this->_data;\n\t\t}", "public function getGTemp(){\r\n\t\treturn Yii::app()->TempRep->GetById($this->tmp);\r\n\t}", "function getItem() ;", "public function Individualgetdata();", "function getData() {\n\t\treturn $this->data;\n\t}", "public function getData() {\r\n\t\treturn $this->_data;\r\n\t}", "abstract public function get() ;", "public static function getData()\n {\n return self::$data;\n }", "public function getData() {\n return $this::$data;\n }", "function getData()\n {\n return $this->_data;\n }", "function getData();", "public function getData()\n\t{\n\t\t$cacheManager = Application::getInstance()->getManagedCache();\n\t\t$result = NULL;\n\t\t\n\t\tif ($cacheManager->read(self::CACHE_TTL, $this->cacheId))\n\t\t{\n\t\t\t$result = $cacheManager->get($this->cacheId);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->getDataFromVk();\n\t\t\t\n\t\t\t$cacheManager->set($this->cacheId, $result);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function getData() \n\t{\n return $this->data;\n }", "public function getData() {\n\t\treturn $this->_data;\n\t}", "public function getData() {\n\t\treturn $this->_data;\n\t}", "public function getData() {\n\t\treturn $this->_data;\n\t}", "public function getData() {\n\t\treturn $this->_data;\n\t}", "public function getData() {\n\t\treturn $this->_data;\n\t}", "private function getData()\n {\n if (isset($this->data)) {\n return $this->data;\n }\n\n return $this->data = Entry::find($this->context->get('id'));\n }", "public function &getData()\n\t{\n\t\t// Load the data\n\t\tif (!$this->_loadData())\n\t\t\t$this->_initData();\n\n\t\treturn $this->_data;\n\t}", "public function getData() {\n\t\treturn $this->data;\n\t}", "public function getData() {\n\t\treturn $this->data;\n\t}", "public function getData(){\n\n return $this->data;\n }", "final public function getData(): string {}", "public function getData()\r\n {\r\n return $this->data;\r\n }", "public function getData()\r\n {\r\n }", "public function get_data(): array;", "public function get_data(): array;", "public function getData()\n {\n return $this->data;\n }", "public function getCurrentObjectData() {}", "public function data ()\n {\n return $this->_data;\n }", "public function getData() {\n return $this->data;\n }", "public static function getData()\n {\n return self::$data;\n }", "protected function getData()\n {\n return $this->mixed;\n }", "public function getData () {\n return $this->data;\n }", "public function &get() {\n\t\treturn $this->result;\n\t}", "public function getData()\n\t{\n\t\treturn $this->data;\n\t}", "public function getData()\n\t{\n\t\treturn $this->data;\n\t}", "public function getData()\n\t{\n\t\treturn $this->data;\n\t}", "public function getData()\n\t{\n\t\treturn $this->data;\n\t}", "public function getData() {\r\n return $this->data;\r\n }", "function getData() {\n\t\treturn file_get_contents($this->getFile());\n\t}", "public function getData()\n {\n \treturn file_get_contents($this->config['location']);\n }", "public function getData()\n {\n return $this->_data;\n }" ]
[ "0.6819704", "0.6660156", "0.65120894", "0.6497754", "0.6339918", "0.6322087", "0.63000745", "0.6225363", "0.62206185", "0.6216448", "0.61918634", "0.6138788", "0.61371666", "0.6114553", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.610127", "0.60981774", "0.6097657", "0.6073798", "0.60556096", "0.60482514", "0.6037018", "0.6025627", "0.6025627", "0.6025627", "0.6013873", "0.6006886", "0.6006886", "0.6006886", "0.6006277", "0.59865457", "0.5983726", "0.5957537", "0.59444076", "0.59400004", "0.5938152", "0.59277564", "0.5923272", "0.5920293", "0.59168327", "0.59121454", "0.59017813", "0.58936477", "0.5885917", "0.5872003", "0.58609134", "0.5851627", "0.58503884", "0.5845072", "0.5839395", "0.58271116", "0.5805944", "0.5805944", "0.5805944", "0.5805944", "0.5805944", "0.5795809", "0.57942164", "0.5789815", "0.5789815", "0.5781343", "0.577301", "0.5763224", "0.57629085", "0.57622945", "0.57622945", "0.57617074", "0.5752369", "0.57520354", "0.57488316", "0.57456744", "0.5732643", "0.57218045", "0.57192886", "0.57158715", "0.57158715", "0.57158715", "0.57158715", "0.5715061", "0.57090336", "0.57063246", "0.57044363" ]
0.0
-1
get Data from tbl_users
public function getAllData($email){ $this->db->where('email',$email); $userData = $this->db->get('tbl_users'); $row_res = $userData->row(); $allData = array( 'email' => $row_res->email, 'password' => $row_res->password, 'firstname' => $row_res->firstname, 'lastname' => $row_res->lastname, 'emailtype' => $row_res->emailtype, 'gender' => $row_res->gender ); return $allData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_user_data()\n {\n $sql_query = \"select * from users\";\n $users = DB::select($sql_query);\n return $users;\n }", "function ambil_data(){\n\t\treturn $this->db->get('user');\n\t}", "public function fetchUsers(){\n\t\t\t$this->load->database();\n $this->db->select(\"*\");\n\t\t\t$query = $this->db->get(\"user_details\");\n\t\t\treturn $query->result();\n\t\t}", "public function getData()\n {\n return $this->db->get('user')->result();\n }", "public function getUserData(){\n $sql= \"SELECT * FROM tbl_user ORDER BY id DESC\";\n $query=$this->db->pdo->prepare($sql);\n $query->execute();\n $result=$query->fetchAll();\n return $result;\n\n }", "public function getUserDetails() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n $username = $this->request->input(\"username\");\n if ($username) {\n $where[] = [\"username\", \"=\", $username];\n }\n\n $userIdEqual = $this->request->input(\"user_id_equal\");\n if ($userIdEqual) {\n $where[] = [\"user_id\", \"=\", $userIdEqual];\n }\n\n $userIdNotEqual = $this->request->input(\"user_id_not_equal\");\n if ($userIdNotEqual) {\n $where[] = [\"user_id\", \"!=\", $userIdNotEqual];\n }\n\n\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getData();\n\n return $users;\n }", "function list_user(){\n $user = $this->db->get('data_diri');\n return $user;\n }", "public function data_user(){\n\t\treturn $this->db->get('registrasi');\n\t}", "function tampil_data_user()\n\t{\n\t\t$data = mysqli_query($this->connect, \"select * from user\");\n\t\twhile ($d = mysqli_fetch_array($data)) {\n\t\t\t$hasil[] = $d;\n\t\t}\n\t\treturn $hasil;\n\t}", "public function getUser(){\n return $this->db->get('tb_user')->result_array();\n }", "function user_details() {\r\n\t\t\t$query = $this->pdo->prepare(\"select * from user_account\");\r\n\t\t\t$query->execute();\r\n\t\t\treturn $query->fetchAll();\r\n\t\t}", "function getUser(){\n $db=new connect();\n $select=\"select * from users\";\n return $db->getList($select);\n }", "public function get()\n\t{\n\t \n\n\t\t// Get data user\n\t\t$result = $this->datatables->getData('user', array('user_paysal','user_identityNo','user_name','user_full_name','user_email','user_phone','user_address','group_name','region_name','user_group','user_password','user_region','user_id'), 'user_id', array('groups','groups.group_id = user.user_group','inner'),array('regions','regions.region_id = user.user_region','inner'));\n\t\t\n\t\t\n\t\t\n\t\techo $result;\n\t}", "public function selectAllUser(){\n return $this->connect->getData(\"SELECT * FROM `tbl_register_user`\");\n }", "function getUserData() {\n global $conn;\n $sql = \"SELECT user_id, firstname, lastname, email FROM users\";\n $result = $conn->query($sql);\n return $result;\n }", "public function tampilUser()\n {\n return $this->db->get('tb_user');\n }", "function user_table_data($logged_user_id)\n\t{\n\t\t$select = array('user_file', 'created', 'sex', 'first_name', 'last_name', 'full_name');\n\t\t$this->db->select($select)->from('users')->where('id', $logged_user_id);\n\t $query = $this->db->get();\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query->row_array();\n\t\t}\n\t}", "public function getUsers(){\n $query = \"SELECT * FROM usuario \";\n return self::getInstance()->consulta($query);\n }", "public function fetchAllUser() {\n try {\n // Select all users\n $query = \"\n select * \n from tb_user \n \";\n // Create object to connect to MySQL using PDO\n $mysqlPDO = new MySQLPDO();\n // Prepare the query\n $statement = $mysqlPDO->getConnection()->prepare($query);\n // Execute the query without paramters\n $statement->execute();\n // Get affect rows in associative array\n $rows = $statement->fetchAll();\n // Foreach row in array\n foreach ($rows as $row) {\n // Create a User object\n $user = new User($row);\n //Create datatable row\n $tmp_data[] = array(\n $user->getEmail(),\n $user->getUsername(),\n \"********\",\n \"<div style='text-align:center'>\".$user->getAccess().\"</div>\",\n $user->getState() == \"0\" ? '<div style=\"text-align:center\"><i class=\"fas fa-times\" style=\"color:red\"></i></div>' : '<div style=\"text-align:center\"><i class=\"fas fa-check\" style=\"text-align: center; color:green;\"></i></div>',\n \"<div style='text-align:center'><a href='javascript:update(\".json_encode($user).\")' class='btn btn-info'><i class='fas fa-edit'></i></a></div>\",\n \"<div style='text-align:center'><a href='javascript:remove(\".$user->getId().\")' class='btn btn-danger'><i class='far fa-trash-alt'></i></a></div>\"\n );\n }\n // Export into DataTable json format if there's any record in $tmp_data\n if (isset($tmp_data) && count($tmp_data) > 0) {\n $data = array(\n \"data\" => $tmp_data\n );\n } else {\n $data = array(\n \"data\" => array()\n );\n }\n return $data;\n } catch (PDOException $e) {\n die(\"Error message: \" . $e->getMessage());\n }\n }", "public function get_user_data()\n {\n $this->db->select(\"id,nama,email,no_hp,blokir,username\");\n $this->db->where(\"level < 9\");\n $hasil = $this->db->get(\"v_member_all\");\n return $hasil->result();\n }", "public function getUsers() {\n $this->checkValidUser();\n\n $this->db->sql = 'SELECT id, username FROM '.$this->db->dbTbl['users'].' ORDER BY username';\n\n $res = $this->db->fetchAll();\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'sdop6'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'ffUI8',\n 'users' => $res\n );\n }\n\n $this->renderOutput();\n }", "public function fetchAllUserSelect() {\n try {\n // Select all users\n $query = \"\n select id, email, username\n from tb_user \n where state = 1 and access = 1\n order by username\n \";\n // Create object to connect to MySQL using PDO\n $mysqlPDO = new MySQLPDO();\n // Prepare the query\n $statement = $mysqlPDO->getConnection()->prepare($query);\n // Execute the query without paramters\n $statement->execute();\n // Get affect rows in associative array\n $rows = $statement->fetchAll();\n // Foreach row in array\n foreach ($rows as $row) {\n // Create a User Select object\n $user = new UserSelect($row);\n //Create datatable row\n $tmp_data[] = $user;\n }\n // Export into DataTable json format if there's any record in $tmp_data\n if (isset($tmp_data) && count($tmp_data) > 0) {\n $data = $tmp_data;\n } else {\n $data = array();\n }\n return $data;\n } catch (PDOException $e) {\n die(\"Error message: \" . $e->getMessage());\n }\n }", "function GetAllUser(){\n\t\t/*$hasil=$this->db->query(\"SELECT * FROM buku ORDER BY judul_buku\");\n\t\tif($hasil->num_rows()>0){\n\t\t\tforeach($hasil->result() as $row){\n\t\t\t\t$data[]=$row;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\t\t*/\n\t\t$query=$this->db->get('user');\n\t\tforeach($query->result() as $row){\n\t\t\t$data[]=$row;\n\t\t}\n\t\treturn $data;\n\t}", "function user_data($user_id){\n $this->db->select('*');\n $this->db->from('users');\n $this->db->where('user_id', $user_id);\n $query = $this->db->get();\n return $query->row_array();\n }", "public function getAllUsers() {\n $sql = 'SELECT id, firstname, mail, role, isAdmin FROM user';\n $sth = $this->db->prepare($sql);\n $sth-> execute(array());\n if ($row = $sth->fetchAll()) {\n return $row;\n }\n }", "public function getUser(){\n //Query untuk mengambil data semua user dengan level 'User'\n $this->db->where('level', 'User');\n return $this->db->get('user');\n }", "public function get_user_list() {\n\n $sql = \" SELECT userId, concat(firstName, ' ', surname) AS `name`\n FROM time_user\"; \n return $this->db->query( $sql );\n }", "public function getUsers(){\n $sql=\"SELECT * FROM users\";\n $select=parent::connect_db()->prepare($sql);\n $select->execute();\n if($select->rowCount() > 0):\n return $select->fetchAll(\\PDO::FETCH_ASSOC);\n //return $results;\n else:\n return [];\n endif;\n }", "public function userList(){\n $this->db->select(\"ui.user_id,\n CONCAT(ui.lname, ', ' ,ui.fname, ' ', ui.mname) name, u.user_type,\n ui.fname f_name,ui.lname l_name, ui.mname m_name , ui.email, \n u.username, u.password, uat.article_type_id, at.type article_type\n \")\n ->from(\"tbl_user_info ui\")\n ->join(\"tbl_user u\",\"ON u.id = ui.user_id\",\"inner\")\n ->join(\"tbl_user_article_type uat\",\"ON uat.user_id = ui.user_id\",\"left\")\n ->join(\"tbl_article_type at\",\"ON at.id = uat.article_type_id\",\"left\");\n $this->db->where(\"u.status\", \"saved\");\n $this->db->order_by(\"ui.lname\");\n $query = $this->db->get();\n \n foreach($query->result() as $each){\n $each->password = $this->encryptpass->pass_crypt($each->password, 'd');\n }\n\n return $query->result();\n }", "public function get_users_data($userid = \"\")\n\t{\n\t\t$result = $this->db->from(\"users\")->where(array(\"user_type\" => $userid))->where('user_status',1)->orderby(\"firstname\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "function getUsers() {\r\n\t\t\t$sql = \"SELECT users.user_id, users.email, users.student_id, 'Click to change password', users.active, societies.society_name FROM `users`, `societies` WHERE societies.society_id=users.society_id\";\r\n\t\t\t$result = $this->query($sql);\r\n\t\t\tif (mysql_num_rows($result) == 0) return false;\r\n\t\t\twhile ($row = mysql_fetch_object($result)) $rows[] = array($row->user_id, $row->email, $row->student_id, \"Click to change\", str_replace(array(1, 0), array(\"Yes\", \"No\"), $row->active), $row->society_name);\r\n\t\t\treturn $rows;\r\n\t\t}", "private function Data() {\n return DB::table('users')\n ->select('users.id','users.name', 'users.email', \n 'users.created_at','users.updated_at')\n ->get()\n ->map(function ($item, $key) {\n return (array) $item;\n })\n ->all();\n }", "private function populate_rows() {\n\t\t\t$this->load->model('users_table');\n\t\t\t$data = $this->users_table->get_entries(); //echo $data[0]->Ime; //echo $data[0]->Prezime;\n\n\t return $data;\n\t\t}", "public function getUsers(){\n\t\t\t$users = $this->db->get(\"users\");\n\t\t\treturn $users;\n\t\t}", "public function getAllUsers() {\n $sql = \"SELECT `pk_users`, `name_users`, `password_users`, `mail_users`, `symbol_users`, `first_name_users`, `last_name_users` FROM `users`\";\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }", "public function getAllUser(){\n $empdata = DB::table('users')\n ->select('*')\n ->get(); \n return $empdata;\n \n }", "public function getData(){\n\t\t$db = new Database();\n\t\t$dbConnect = $db->connect();\n\t\t$sql = \"SELECT * FROM user\";\n\t\t$data = $dbConnect->query($sql);\n\t\t$dbConnect = $db->close();\n\t\treturn $data;\n\t}", "public function getUser()\n {\n $this->db->join('tabel_level', 'tabel_level.id_level = tabel_user.id_level');\n $this->db->order_by('id_user', 'DESC');\n return $this->db->get('tabel_user')->result();\n }", "public function getUsers() {\n $user= \\DB::table('users')\n ->pluck('name', 'id');\n return $user;\n \n \n }", "public function getAllUser(){\n $users = $this->bdd->query('SELECT * FROM users');\n $users->execute();\n\t\treturn $users->fetchALL(\\PDO::FETCH_ASSOC);\n }", "public function get_data()\n\t{\n\t\t$query = \"SELECT * FROM tb_users\";\n\t\t$data = DB::connect()->query($query)->style(FETCH_ASSOC)->fetch_all();\n\t\t$json_data = json_fetch([\n\t\t\t\"data\" => $data\n\t\t]);\n\n\t\treturn $json_data;\n\t}", "function user_details ()\n\t\t{\n\t\t $query = \"select * from user_details\" ; \n\t\t\t$data = mysql_query($query) ;\n\t\t\treturn $data ; \n\t\t}", "function FetchAllUserListData(){\n $this->db->select('BaseTbl.userId, BaseTbl.email, BaseTbl.name, BaseTbl.mobile, BaseTbl.createdDtm,BaseTbl.updatedDtm, BaseTbl.status, BaseTbl.is_emailVerify,BaseTbl.is_mobileVerify, Role.role');\n $this->db->from('users as BaseTbl');\n $this->db->join('user_roles as Role', 'Role.roleId = BaseTbl.roleId','left');\n\n $this->db->where('BaseTbl.isDeleted', 0);\n $this->db->where('BaseTbl.roleId !=', 1);\n $this->db->order_by('BaseTbl.userId', 'DESC');\n $query = $this->db->get();\n \n $result = $query->result(); \n return $result;\n }", "public function listUsers(){\n $sql=\"SELECT id_people,dni,first_name,last_name,adress,email,is_active FROM people WHERE is_user=3\";\n $rs=$this->con->prepare($sql);\n $rs->execute();\n return $rs->fetchAll(PDO::FETCH_OBJ);\n }", "function getuserdetails($u_id)\n{\n\t$sql=\"select * from user_table where u_id=$u_id\";\n\tforeach($GLOBALS['db']->query($sql) as $row);\n\treturn $row;\n}", "public function getAllUsers(){\n $stmt = $this->databaseConnection->prepare(\"SELECT users.login, users.phone, users.invite, cities.city_name, invites.date_status_\n FROM users\n LEFT JOIN cities ON users.id_city = cities.id_city\n LEFT JOIN invites ON users.invite = invites.invite\");\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "function getAllUserRecords()\r\n\t{\r\n\t\t $this->db->select('sales_rip,tbl_users_id');\r\n\t\t $this->db->from(TBL_MST_USERS_Information);\r\n\t\t $recordSet=$this->db->get();\r\n\t\t $data=$recordSet->result();\r\n\t\t return $data;\t \r\n\t}", "public function getUsers(){\n //write the query to select all users with their role title\n $userrolequery = \"SELECT * FROM users;\";\n\n //check if the query() runs the sql statement\n if ($result = $this->dbobj->dbcon->query($userrolequery)) {\n $row = $result->fetch_all(MYSQLI_ASSOC);\n\n }\n else{\n echo \"Error\" .$this->dbobj->dbcon->error;\n }\n return $row;\n }", "function getUser()\n {\n $stmt = self::$_db->prepare(\"SELECT u.id_user AS id_user, u.username AS username, u.mail AS mail, u.description AS description, u.image AS image FROM user AS u\n WHERE u.id_user=:uid\");\n $uid = self::getUserID();\n $stmt->bindParam(\":uid\", $uid);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC)[0];\n }", "public function selectuser(){\r\n\t\t$query = \"SELECT * FROM users\";\r\n\t\t$add_query = parent::get_results($query);\r\n\t\t\r\n\t\treturn $add_query;\r\n\t\t// echo '<pre>';\r\n\t\t// print_r( $add_query );\r\n\t\t// echo '</pre>';\r\n\t\t// exit;\r\n\t}", "function get_all_user($koneksi){\n\t\t$query = \"SELECT * FROM v_user\";\n\n\t\t$statement = $koneksi->prepare($query);\n\t\t$statement->execute();\n\t\t$result = $statement->fetchAll();\n\n\t\treturn $result;\n\t}", "public function get_all_user_info()\n {\n $query = $this->db->get('users');\n return $query->result();\n }", "public function get_data(){\n\n \t\t\t$query = $this->db->get('users');\n \t\t// we now convert what was return to an array which can be displayed in the view and then save the arrayin a $result varieble\n \t\t\t$results= $query->result_array();\n \t\t// we return the result to the controller\n\n \t\t\treturn $results;\n \t\t}", "public function getAllUserData() {\n $conn = $this->getConnection();\n $getQuery = \"SELECT Email, Parcel FROM userdata\";\n $q = $conn->prepare($getQuery);\n $q->execute();\n return $q->fetchAll();\n }", "public function getUsers() {\n $sql = \"SELECT * from usertable\";\n foreach (parent::$this->db_connect->query($sql) as $row) {\n $dataSet[] = new user_model($row);\n }\n\n if (!empty($dataSet))\n return $dataSet;\n else\n return null;\n }", "public function getAllUsers() {\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM `tbl_users` WHERE `usr_type` = 0 ORDER BY `usr_id` ASC\");\n\t\t$stmt->execute();\n\t\t$result = getResult($stmt);\n\t\t$stmt->close();\n\t\treturn $result;\n\t}", "function get_data_by_idUser($table,$kode){\n\t\t/*$hasil=$this->db->query(\"SELECT * FROM user WHERE username='\".$kode.\"'\");\n\t\tif($hasil->num_rows()>0){\n\t\tforeach($hasil->result() as $row){\n\t\t\t$data[]=$row;\n\t\t}\n\t\treturn $data;*/\n\t\t\n\t\t$this->db->where('username',$kode);\n\t\treturn $this->db->get($table);\n\t}", "public function getData() {\n\t\t$id = $this->user;\n\t\t$this->db->query( 'SELECT * FROM users WHERE crsid = :id' );\n\t\t$this->db->bind( ':id', $id );\n\t\t$row = $this->db->single();\n\n\t\tif ( ! $row[\"name\"] ) {\n\t\t\t$ds = ldap_connect( \"ldap.lookup.cam.ac.uk\" );\n\t\t\t$lsearch = ldap_search( $ds, \"ou=people,o=University of Cambridge,dc=cam,dc=ac,dc=uk\", \"uid=\" . $id . \"\" );\n\t\t\t$info = ldap_get_entries( $ds, $lsearch );\n\t\t\t$name = $info[0][\"cn\"][0];\n\t\t\t$this->db->query( 'UPDATE users SET name=:name WHERE crsid=:id' );\n\t\t\t$this->db->bind( ':id', $id );\n\t\t\t$this->db->bind( ':name', $name );\n\t\t\t$this->db->execute();\n\t\t\t$row[\"name\"] = $name;\n\t\t}\n\n\t\treturn $row;\n\t}", "public function getAllUsersDataArray()\n {\n $query = 'select userID, username, name, isAdmin, passwordPlaintext, email, isRSVP, isThankYouSent, address, gift, thankYouCardNotes, notesRSVP, lastLoginTime from users order by userID;';\n if ($this->connectedModel->runQuery($query)) //query\n {\n $arrayAllUsers = array();\n while ($row = $this->connectedModel->getResultsAssoc())\n {\n $arrayAllUsers[$row['userID']] = array(\n 'userID' => $row['userID'],\n 'username' => $row['username'],\n 'name' => $row['name'],\n 'isAdmin' => (($row['isAdmin'] == '1') ? true : false),\n 'passwordPlaintext' => $row['passwordPlaintext'],\n 'email' => $row['email'],\n 'isRSVP' => (($row['isRSVP'] == '1') ? true : false),\n 'isThankYouSent' => (($row['isThankYouSent'] == '1') ? true : false),\n 'address' => $row['address'],\n 'gift' => $row['gift'],\n 'thankYouCardNotes' => $row['thankYouCardNotes'],\n 'notesRSVP' => $row['notesRSVP'],\n 'lastLoginTime' => $row['lastLoginTime']\n );\n }\n return $arrayAllUsers;\n }\n else\n {\n return false;\n }\n }", "public function getUsersv()\n {\n \t$users = DB::table('users')->select('*');\n return Datatables::of($users)\n ->make(true);\n }", "function getUserData($idUser,$idData){\n\n $usr_q = listAll(\"user_det\", \"WHERE id_user = '$idUser' AND id_data = '$idData'\");\n\n $usr_data = mysql_fetch_object($usr_q);\n return $usr_data;\n\t\n}", "public function getData()\r\n\t{\r\n\t\t$sql = \"SELECT * FROM user\";\r\n\t\t$result = $this->connect()->query($sql);\r\n\t\tif($result->num_rows > 0)\r\n\t\t{\r\n\t\t\t$arr = array();\r\n\t\t\twhile($row = $result->fetch_assoc())\r\n\t\t\t{\r\n\t\t\t\t$arr[] = $row;\r\n\t\t\t\t//return $arr;\r\n\t\t\t\t//print_r($arr);\r\n\t\t\t}\r\n\t\t\treturn $arr;\r\n\t\t\t//return $result;\r\n\t\t}else{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "function ambil_data(){ //fungsi yang akan mengambil data pada table user\n\t\treturn $this->db->get('user'); //mengambil data dari database, mengembalikan data yang ditangkap pada controller yang memanggil function ambil_data\n\t}", "public function user()\n {\n //Query untuk mengambil semua data user dan diurutkan berdasarkan level user\n $query = $this->db->query(\"SELECT A.username, A.level, A.id_user, A.password, B.nik, B.nama, \n B.email, C.nama_bagian_dept, C.id_dept, D.nama_dept FROM user A \n LEFT JOIN karyawan B ON B.nik = A.username \n LEFT JOIN bagian_departemen C ON C.id_bagian_dept = B.id_bagian_dept \n LEFT JOIN departemen D ON D.id_dept = C.id_dept ORDER BY A.level\");\n return $query;\n }", "public function getUserData($userId)\n {\n\n $db = $this->getDb();\n\n $sql = <<<SQL\nSELECT\n core_person_rowid as person_id,\n core_person_firstname as firstname,\n core_person_lastname as lastname,\n buiz_role_user_name as user_name\nFROM\n view_person_role\nWHERE\n buiz_role_user_rowid = {$userId}\n\nSQL;\n\n // gleich den Datensatz zurückgeben\n return $db->select($sql)->get();\n\n }", "public function listUsers() {\n $db = CTSQLite::connect();\n $query = 'SELECT * FROM ic_user';\n $stmt = $db->prepare($query);\n $result = $stmt->execute();\n if (!$result) {\n return false;\n } else {\n // $id = $result->fetchArray();\n // return $id['id'];\n $row = $result->fetchArray();\n return $row;\n }\n $db->close();\n unset($db);\n }", "public function getUserData()\n {\n exit(json_encode(['data' => $this->users_model->get_users()]));\n }", "public function getUserData($id){\n\n \t\t\n \t\t$q = \"SELECT * FROM user_table WHERE id='$id' \";\n\n \t\t$result = $this->connection->query($q);\n\n \t\tif($result->num_rows > 0){\n\n \t\t\t$row = mysqli_fetch_assoc($result);\n\n \t\t}\n\n \t\treturn $row;\n\n \t}", "public function get_users()\n\t{\n\t\t\n\t\t$query=$this->db->get('ag_users');\n\t\t\n\t\treturn $query->result() ;\n\t}", "public function get($user = ''){\r\n $this->query = ($user != '') ? \"SELECT * FROM users WHERE user = '$user'\" \r\n : \"SELECT * FROM users\";\r\n $this->get_query();\r\n //var_dump($this->rows);\r\n $num_rows = count($this->rows);\r\n $data = array();\r\n foreach ($this->rows as $key => $value) {\r\n array_push($data, $value);\r\n //$data[$key] = $value;\r\n }\r\n return $data;\r\n \r\n\r\n }", "public static function getUsers() {\n\t\t$res = self::$db->query(\"SELECT id, email, username, logins, last_login FROM `\".self::$users_tbl.\"` ORDER BY username\");\n\t\t$row = $res->fetchAll(PDO::FETCH_ASSOC);\n\t\treturn $row;\n\t}", "public function getAllUserDetails()\n {\n $userdata = Register::join(\"logins\",\"logins.id\",\"=\",\"registers.login_id\")\n ->join(\"addresses\",\"addresses.id\",\"=\",\"registers.reg_id\")->get();\n return $userdata;\n }", "public function getUsers() {\n\n $users = $this->users_model->getallusers();\n exit;\n }", "function tampil_data(){\n\t\t$data=mysql_query(\"SELECT * FROM users\");\n\t\twhile($d=mysql_fetch_array($data)){\n\t\t\t$result[]=$d;\n\t\t}\n\t\treturn $result;\n\t}", "public static function getUsers(){\n return DB::table('users')->get();\n }", "public function getAllUsers()\n {\n $sql = \"SELECT `user_id`, `user_fname`, `user_lname`, `user_password_hash`, `user_email`, `user_role` FROM users\";\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }", "public function getUserList() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n\n $role_name = $this->request->input(\"role_name\");\n if ($role_name) {\n $where[] = [\"roles.role_name\", \"=\", $role_name];\n }\n\n $user_id = $this->request->input(\"user_id\");\n if ($user_id) {\n $where[] = [\"users.user_id\", \"=\", $user_id];\n }\n $orderBy = \"users.user_id\";\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getUsers($orderBy);\n\n return $users;\n }", "public function get_list_user()\n {\n $this->db->where('type', 0);\n $query = $this->db->get('user');\n return $query->result();\n }", "public function getAllUser()\n {\n $this->stmt = $this->db->prepare('SELECT * FROM user');\n $this->stmt->execute();\n $data = $this->stmt->get_result();\n $rows = $data->fetch_all(MYSQLI_ASSOC);\n return $rows;\n }", "function get_users() {\r\n $query = $this->db->get(\"users\");\r\n $result = $query->result_array();\r\n return $result;\r\n }", "public function selectData(){\n\t\t\t\n\t\t\t$query = \"SELECT * FROM tbl_userinfo ORDER BY Id ASC\";\n\n\t\t\t$result = $this->conn->query($query) or die($this->conn->error.__LINE__);\n\n\t\t\tif ($result->num_rows > 0){\n\t\t\t\t//fetch_row() or num_rows gives number of rows in db\n\t\t\t\treturn $result;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}", "public function user_getAll(){\n\n if( $stmt = $this->connection->prepare(\"SELECT user_id, email, name, level, phone FROM users ORDER BY name ASC\") ){\n $stmt->execute();\n $stmt->bind_result($user_id, $email, $name, $level, $phone);\n \n $results = array();\n while( $stmt->fetch() ){\n $User = new User($user_id, $email, $name, $level, $phone);\n $results[] = $User;\n } \n \n $stmt->close();\n return $results;\n }\n return null;\n \n }", "public function getUserData($u_id){\n\t\t$this->db->select('*');\n\t\t$this->db->from('user');\n\t\t$this->db->where('user.id',$u_id);\n\t\treturn $this->db->get()->result_array();\n\t}", "public function getdata(){\n\n $type = \\Request::query('only');\n\n $user = DB::table('users');\n $user->select('*');\n\n if($type=='admins'){\n $user->where('usertype', '=', 'Admin');\n }elseif($type=='staff'){\n $user->where('usertype', '=', 'Staff');\n }elseif($type=='banned'){\n $user->where('usertype','=', 'banned');\n }\n\n\n\n return Datatables::of($user)\n\n ->addColumn('icon', function ($user) {\n\n return view('._admin._particles.datatable.userlist.icon', compact('user'))->render();\n\n })->addColumn('username', function ($user) {\n\n return view('._admin._particles.datatable.userlist.username', compact('user'))->render();\n\n })->addColumn('email', function ($user) {\n\n return view('._admin._particles.datatable.userlist.email', compact('user'))->render();\n\n })->addColumn('status', function ($user) {\n\n return view('._admin._particles.datatable.userlist.status', compact('user'))->render();\n\n })->addColumn('created_at', function ($user) {\n\n return view('._admin._particles.datatable.userlist.created_at', compact('user'))->render();\n\n })->addColumn('updated_at', function ($user) {\n\n return view('._admin._particles.datatable.userlist.updated_at', compact('user'))->render();\n\n })->addColumn('action', function ($user) {\n\n return view('._admin._particles.datatable.userlist.action', compact('user'))->render();\n\n })->make(true);\n\n }", "public function get_app_users() {\n $this -> db -> select(\"users.Id,users.FirstName,users.LastName,CONCAT_WS( ' ', users.FirstName, users.LastName ) as FullName,users.Email,users.Mobile\");\n $this -> db -> where(\n array(\n 'users.IsActive'=>1,\n 'users.IsRemoved' => 0\n ));\n $whereCond = '( users.UserRole = 0 or users.UserRole = 4 )';\n $this -> db -> where($whereCond);\n \n $this-> db -> order_by(\"FullName\",\"ASC\");\n \n $query = $this -> db -> get('users');\n //echo $this->db->last_query();exit;\n return $query -> result_array();\n }", "public function selectAll(){\r\n $query = 'SELECT * FROM user_tbl';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute();\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n foreach ($users as $user){\r\n echo $user->username.\"<br>\";\r\n }\r\n }", "public function getUsers(){\n if($this->get_request_method() != \"GET\"){\n $this->response('',406);\n }\n $role = $_REQUEST[\"role\"];\n\n $query=\"SELECT * FROM `usuario` WHERE `rol` = \" . $role;\n\n $this->db->get($query);\n }", "public function getUsers(){\n\t\t$query = $this->db->get('users');\n\t\treturn $query->result_array();\n\t}", "public function getUsers()\n {\n $request = \"SELECT user.*, rank.name as rank_name FROM `user` join rank on user.rank = rank.id order by rank.id\";\n $request = $this->connexion->query($request);\n $newsList = $request->fetchAll(PDO::FETCH_ASSOC);\n // var_dump($newsList);\n return $newsList;\n }", "function getUserData(XiusQuery &$query)\n\t{\n\t\t$query->select('juser.`id` as userid');\n\t\t$query->from('`#__users` as juser');\n\n\t\t$isMultiple = $this->pluginParams->get('customIsMultiple');\n\n\t\t$tableMapping = $this->getTableMapping();\n\t\t\n\t\tforeach( $tableMapping as $tm){\n\t\t\tif($isMultiple) {\n\t\t\t\t//comma separated values with descending order, so that user can apply sorting in front end \n\t\t\t\t$query->select( \"CONCAT( \\\",\\\" , group_concat({$tm->tableAliasName}.{$tm->originColumnName} ORDER BY {$tm->tableAliasName}.{$tm->originColumnName} DESC), \\\",\\\" )\"\n\t\t\t\t\t\t\t.\" as {$tm->cacheColumnName} \"\n\t\t\t\t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$query->select( \"{$tm->tableAliasName}.{$tm->originColumnName} as {$tm->cacheColumnName} \" );\n\t\t\t}\n\t\t\t$query->leftJoin( \" {$tm->tableName} as {$tm->tableAliasName} \"\n\t\t\t\t\t\t\t .\" ON ( {$tm->tableAliasName}.`{$this->pluginParams->get('customUseridColumn')}` = juser.`id` ) \"\n\t\t\t\t\t\t\t);\n\t\t}\n\t}", "function load_users()\n {\n $query = $this->db->query('SELECT `id`,`login_id`,`user_name`,`org`,`hash` FROM `user`');\n $uarray = array();\n foreach ( $query->result_array() as $user )\n {\n \t$uarray[$user['id']] = $user;\n }\n\n return $uarray;\n }", "function list_user()\n {\n return DB::table(\"users\")->get(); \n }", "public function getAllUsers(){\n \n $stmt = $this->con->prepare(\"SELECT uid, fullname, phone_no, email, login_with, reg_date ,approval FROM users\");\n $stmt->execute();\n $stmt->bind_result($uid, $fullname, $phone_no, $email, $login_with,$reg_date,$approval);\n $users = array(); \n while($stmt->fetch()){ \n $user = array(); \n $user['uid'] = $uid; \n $user['fullname'] = $fullname; \n $user['phone_no'] = $phone_no; \n $user['email']=$email;\n $user['login_with']=$login_with; \n $user['reg_date']=$reg_date; \n $user['approval']=$approval; \n \n array_push($users, $user);\n }\n if(!empty($users)) \n return $users; \n else\n return null;\n }", "public function retrieve_all_users()\n {\n $table_pengajar = $this->db->dbprefix('pengajar');\n $table_siswa = $this->db->dbprefix('siswa');\n $table_login = $this->db->dbprefix('login');\n\n $sql = \"SELECT {$table_login}.username, {$table_pengajar}.nama FROM {$table_pengajar} INNER JOIN {$table_login} ON {$table_pengajar}.id = {$table_login}.pengajar_id\n UNION\n SELECT {$table_login}.username, {$table_siswa}.nama FROM {$table_siswa} INNER JOIN {$table_login} ON {$table_siswa}.id = {$table_login}.siswa_id\";\n\n $result = $this->db->query($sql);\n\n $data = array();\n foreach ($result->result_array() as $r) {\n # selain yang login\n if (is_login() && $r['username'] == get_sess_data('login', 'username')) {\n continue;\n }\n $data[] = addslashes($r['nama']) . ' [' . $r['username'] . ']';\n }\n\n return $data;\n }", "public function getUsers()\n {\n $sql = \"SELECT * FROM users\";\n $query = pg_query($this->conn, $sql) or die(\"error to fetch employees data\");\n $data = pg_fetch_all($query);\n\n echo json_encode($data);\n \n }", "public function getUserDetails() {\n $usersDetails = $this->db->prepare(\n 'SELECT \n `us`.`lastname`\n ,`us`.`firstname`\n ,DATE_FORMAT(`pat`.`birthDate`, \\'%d/%m/%Y\\') AS `birthDateFr` \n ,`pat`.`birthDate`\n ,`pat`.`phoneNumbers`\n ,`us`.`mail`\n FROM \n `dom20_users` as `us`\n INNER JOIN \n `dom20_patients` AS `pat`\n ON `us`.`id` = `pat`.`id_dom20_users`\n WHERE\n `us`.`id` = :id \n ');\n $usersDetails->bindValue(':id', $this->id, PDO::PARAM_INT);\n $usersDetails->execute();\n return $usersDetails->fetch(PDO::FETCH_OBJ);\n \n }", "public function listUsers()\n {\n global $db;\n $user_db_data = array();\n $cache = Cache::getInstance();\n // $cache->flush();\n if($cache->exists(\"user_info_data\"))\n {\n $user_db_data = $cache->get(\"user_info_data\");\n } else { \n $e = $db->prepare(\"SELECT * FROM user_info\");\n $e->execute();\n $user_data = $e->fetchAll(); \n // cache will clear in every 1 min.\n $cache->set(\"user_info_data\", $user_data, 60 * 60 * 0.1);\n $user_db_data = $user_data;\n }\n return $user_db_data;\n }", "function get_users()\n {\n $query = $this->db->get('USERS');\n return $query->result();\n }", "function user_accounts() {\n $mysqli = $this->mysqli;\n $sql = \"SELECT `users`.`user_id`, `users`.`email_id`,`users`.`emp_id`, `employee`.`emp_name`,`employee`.`emp_type`,`employee`.`emp_cntct`,`employee`.`doj` FROM employee INNER JOIN users on `employee`.`emp_id`=`users`.`emp_id`\";\n $val = $mysqli->query($sql);\n return $val;\n }", "public function GetData(){\r\n $model = new UsersModel();\r\n return $model->GetData();\r\n }", "function getUsers($user_type){\r\n global $pdo;\r\n\t\t\t$select = $pdo->prepare(\"SELECT * ,users.id AS userId \r\n FROM users \r\n\t\t\tLEFT JOIN user_types ON users.type = user_types.id\r\n\t\t\tWHERE user_types.type = ?\");\r\n\t\t\t//$res = mysql_query($select);\r\n $select->execute(array($user_type));\r\n\t\t return $select->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t}" ]
[ "0.796285", "0.77095664", "0.77065444", "0.7687327", "0.7626741", "0.7620231", "0.7615318", "0.760965", "0.7596587", "0.7534538", "0.7495436", "0.7482686", "0.7449059", "0.7428813", "0.74136543", "0.7413594", "0.7398744", "0.73926586", "0.73835874", "0.73711056", "0.73628813", "0.7361839", "0.7345757", "0.73432714", "0.73401386", "0.7326116", "0.7283233", "0.7277676", "0.7270931", "0.7265258", "0.7249576", "0.72461474", "0.72428787", "0.7241292", "0.7235383", "0.7231361", "0.7225885", "0.72230434", "0.72189194", "0.72148347", "0.7214591", "0.72017", "0.7192315", "0.7190854", "0.7187918", "0.71801645", "0.7177458", "0.71736866", "0.7173006", "0.71712154", "0.7169816", "0.71681494", "0.7167491", "0.7163576", "0.7159204", "0.7152565", "0.7148267", "0.7142649", "0.71423584", "0.71360654", "0.7128925", "0.7128095", "0.71267056", "0.71245605", "0.71171427", "0.7117064", "0.7116919", "0.71125793", "0.7107713", "0.7099406", "0.709936", "0.7095873", "0.70941246", "0.7086739", "0.7082744", "0.7078468", "0.70747036", "0.7067554", "0.70651597", "0.70643127", "0.70631295", "0.7062966", "0.7061163", "0.70600235", "0.7055762", "0.7054727", "0.7046806", "0.7046196", "0.7041655", "0.70386297", "0.70336443", "0.70241565", "0.7017776", "0.7016816", "0.7016006", "0.7013366", "0.7007138", "0.7005943", "0.7003352", "0.6998097", "0.69976014" ]
0.0
-1
Get Role Master Data for Edit screen
public function getRoleMasterSingleData() { $RoleID= $this->input->post('RoleID'); $RoleData = $this->system_structure_m->getRoleMasterSingleData($RoleID); echo json_encode($RoleData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_roles_data()\n {\n }", "public function loadroledataentryAction(){\n $roles=Doctrine_Query::create()\n\t ->select(\"r.ID, r.role\")\n\t ->from(\"Roles r\")\n\t ->where(\"r.ID=?\",Constants::DATAENTRY_INTERNO)\n \t ->execute(null,Doctrine::HYDRATE_ARRAY);\n $this->emitTableResult($roles);\n }", "public function getModel()\n {\n return $this->RoleMaster;\n }", "public function getRolesData()\n {\n $em = $this->getEntityManager();\n $query = $em->createQuery(\n 'SELECT p\n FROM Vlreleases\\UserBundle\\Entity\\Role p'\n \n );\n $result = $query->getResult();\n \n return $result;\n }", "function get_editable_roles()\n {\n }", "private function getUserRole($id) { \n $dv_role = Yii::$app->db->createCommand(\"SELECT meta_value FROM assist_user_meta WHERE uid = '$id' AND meta_key = 'role'\")->queryAll();\n return $dv_role;\n }", "function get_role_id(){\n return $this->role_id;\n }", "public function get_role()\n {\n }", "public function edit($id)\n{\n $user = User::find($id);\n $roles = Role::pluck('name','name')->all();\n $userRole = $user->roles->pluck('name','name')->all();\n return [$user,$roles,$userRole];\n}", "public function getRole() {}", "public function getRole(){\n return $this->role; \n }", "public function edit($id)\n{\n$user = User::find($id);\n$roles = Role::pluck('name','name')->all();\n$userRole = $user->roles->pluck('name','name')->all();\nreturn view('users.edit',compact('user','roles','userRole'));\n}", "public function edit($id)\n { \n $data=Role::all();\n \n $arr=[];\n foreach ($data as $key => $value) {\n //array_push($arr, $value->access_name);\n \n $myarr[$value->id]=$value->access_name;\n \n # code...\n }\n\n $user=User::findOrFail($id);\n\n return view('pages.admin.adminuser.edituser',compact(['user','myarr']));\n // return $user;\n\n\n //\n }", "public static function getListRole(){\n return SentinelRole::where('company_id_fk',Sentinel::getUser()->company_id_fk)->orWhere('company_id_fk')->lists('name','id')->all();\n }", "public static function manageRole(){\n $rolelist = [];\n $db = Db::getInstance(); \t \n $req = $db->query('SELECT * FROM hp_role'); \n foreach($req->fetchAll() as $row) {\n $rolelist[] = $row;\n }\n return $rolelist;\n \n }", "public function getRole(){\n\t\tif (current_user_can('editor')) {\n\t\t\t$this->role_object = get_role('editor');\n\t\t}\n\t}", "public function getRole();", "public function getRole();", "public function edit($id)\n {\n //\n $data = \\DB::table('role')->where(['id'=>$id])->get();\n// dd($data[0]);\n return view('admin.role.edit', ['data'=>$data]);\n }", "public function getRole() \n {\n return $this->_fields['Role']['FieldValue'];\n }", "public function edit($id)\n {\n $role = Role::where('id', $id)->first();\n return $role;\n }", "static function getRole(&$rsData)\n {\n return $rsData['role'];\n }", "function edit(){\n\t\t$arr = $this->uri->uri_to_assoc(3);\n\t\t$data['arr'] = $arr['id'];\n\t\t\n\t\t/* membuat value */\n\t\t$this->user->setID($arr['id']);\n\n\t\t/* fungsi ambil data */\n\t\t$result = $this->user->ambil_data();\n\n\t\t/* data dropdown */\n\t\t$data['role'] = role_dropdown();\n\t\t$data['result'] = $result;\n\n\t\t/* load view */\n\t\t$this->template->write_view('edit', $data);\n\t}", "public function getRoles(){\n $db = new MainModel();\n $query = \"SELECT r.id as idRol, r.name as nameRol from roles as r\";\n return $response = $db->consultQueryAll($query);\n }", "function getRole()\n {\n return $this->role;\n }", "public function get_master_role() {\n $ajdevice = $this->input->post('ajdevice');\n header('Content-Type: application/x-json; charset=utf-8');\n echo (json_encode($this->Admintype_model->fetch_per_user_masterlist_role($ajdevice)));\n }", "public function edit($id) {\n $user_data = register::find($id);\n $roles = DB::table(\"roles_masters\")->where('company_id', Auth::user()->company_id)\n ->select('id', 'role_name')\n ->pluck('role_name', 'id');\n return view('admin.user_management.create', compact('user_data', 'roles'));\n }", "public function edit(Role $role)\n {\n // Gate::authorize('haveaccess', 'rol.edit');\n $permission_role=[];\n \n foreach($role->permissions as $permission){\n $permission_role[]=$permission->id;\n\n }\n \n $permissions=Permission::get();\n return view('Roles.editr', compact('permissions', 'role','permission_role'));\n }", "protected function getRoles() {\n return $this->roleStorage->loadMultiple();\n }", "public function edit($id)\n {\n $s= session_n_role_chk();\n $role = role::findOrFail($id);\n $MenuRole = MenuRole::where('roleid', $id)->get();\n $ms = menu_dropdown(\"EDIT\", $MenuRole);\n //dd($rs['select']); die;\n return view('admin.editrole')->with(compact('role'))->with(compact('ms'));;\n }", "public function edit($id)\n {\n $model = AdminRole::find($id);\n\n if($model)\n {\n $record = $model->toArray();\n $formMode = \"edit\";\n $formSubmitUrl = \"/\".request()->path();\n\n $urls = [];\n $urls[\"addUrl\"]=URL::to(\"/admin/admin_role/create\");\n $urls[\"listUrl\"]=URL::to(\"/admin/admin_role\");\n $urls[\"historyUrl\"]=URL::to(\"/admin/history/\");\n\n $this->repository->setPageUrls($urls);\n\n $systems = AdminPermissionSystem::query()->where(\"system_status\", \"=\", \"1\")->get();\n\n $systemPermissions = [];\n if(count($systems)>0)\n {\n $adminPermSysRepo = new AdminPermissionSystemRepository();\n $allSystemCurrPerms = AdminRoleRepository::getAllSystemPermissionData($id);\n foreach ($systems as $key => $system)\n {\n $systemModules = $system->permissionModules()->get()->toArray();\n $systemModules = $adminPermSysRepo->getSystemPermissionModules($systemModules);\n\n $system[\"modules\"] = $systemModules;\n $system[\"curr_permissions\"] = [];\n if(isset($allSystemCurrPerms[$system->id]))\n {\n $system[\"curr_permissions\"] = $allSystemCurrPerms[$system->id];\n }\n\n $systems->$key = $system;\n }\n\n $systemPermissions = $systems->toArray();\n }\n\n return view('admin::admin_role.create', compact('formMode', 'formSubmitUrl', 'record', 'systemPermissions'));\n }\n else\n {\n abort(404, \"Requested record does not exist.\");\n }\n }", "public function edit($id) {\n $id = Crypt::decryptString($id);\n view()->share('module_title', 'Edit Roles');\n view()->share('module_action', array(\n \"back\" => array(\"title\" => '<b><i class=\"icon-arrow-left52\"></i></b> '.trans(\"comman.back\"), \"url\"=>route('roles.index'),\n \"attributes\"=> array(\"class\" => \"btn bg-blue btn-labeled heading-btn\",'title'=>'Back')),\n ));\n // Fetch the role object\n // $id = $this->decode($hash);\n // $role = $this->roleRepository->findById($id);\n\n $role = Role::find($id);\n if ($role) {\n $users_permission = $this->getPermissionJsonToArray(json_decode($role->permission));\n $all_permission = $this->getPermissionArrayToNameWise((new Permissions)->getPermissions());\n return view('roles.edit', compact('role', 'users_permission', 'all_permission'));\n }\n Flash::error(trans(\"comman.invalid_role\"));\n return redirect()->back();\n }", "public function edit($id)\n {\n $user = User::where('id',$id)->with('roles')->first();\n $role = Role::whereNotIn('id',['1','4','5'])->get();\n $masterOpd = MasterOpd::all();\n return view('user.user-edit',compact('user','role','masterOpd'));\n }", "public function getDetailRole($data) {\r\n $hasil = array();\r\n $sql = $this->db->query(\"SELECT * FROM ms_role_det WHERE roledet_roleid = '$data'\");\r\n if ($sql->num_rows() > 0) {\r\n foreach ($sql->result_array() as $value) {\r\n $hasil[$value['roledet_menuid']] = 1;\r\n }\r\n }\r\n return $hasil;\r\n }", "function get_role_list() {\n\t\treturn $this->db->get('system_security.security_role');\n\t\t\n\t}", "private function _getRole()\n {\n //return role\n if(false/*logged_in*/){\n\n }else{\n $this->load->Model('user_roles/Mdl_roles');\n return $this->Mdl_roles->getRolesName();\n }\n }", "public function edit($id)\r\n {\r\n\r\n $user = User::find($id);\r\n $roles = Role::pluck('display_name','id');\r\n //dd($roles);\r\n $userRole = $user->roles->pluck('id','id')->toArray();\r\n //dd($userRole);\r\n $userRole = json_decode(json_encode($userRole), true);\r\n return view('Admin.AdminUser.admin_user_edit', compact('user','roles','userRole'));\r\n }", "public function getRole(){\r\n\t\t\treturn $this->role;\r\n\t\t}", "function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }", "function getRole() {\n\t\treturn 1;\n\t}", "public function getRoleAdmin() {\n $rolesyangberhak = DB::table('roles')->where('id','=','2')->first()->namaRule;\n return $rolesyangberhak;\n }", "public function edit($id)\n {\n \t$role= Role::find($id);\n \t$permission=Permission::get();\n \t$role_permission=DB::table('permissions')->join('permission_role','id','=','permission_role.permission_id')->select('permissions.id','permissions.name','permissions.display_name')->where('permission_role.role_id','=',$id)->get();\n \t//echo($role_permission);\n\n \treturn view('admin.roles.editrole',compact('role','permission','role_permission'));\n }", "function getModuleByRole($role){\n\t\t$tablename = 'acl';\n\t\t$db = Database::Instance();\n\t\t$joinArray[] = array('type'=>'left','table'=>'modules','condition'=>'modules.name=acl.module');\n\t\t$dataArr = $db->getAssociatedDataFromTable(array('role'=>$role,'module!'=>'dashboard'), $tablename, \"module,modules.display_name\", '','',$joinArray, false);\n\t\t//$dataArr = $db->getDataFromTable(array('role'=>$role,'module!'=>'dashboard'),$tablename,'module,menu_name','','',false);\n\t\treturn $dataArr;\n\t}", "public function edit($id)\r\n {\r\n //\r\n $categories=$this->permission_repository->getTreeData();\r\n $role = AdminRole::find($id);\r\n $permissions_by_role=PermissionRole::where('role_id',$id)->get();\r\n return view('admin.role.edit',compact('categories','permissions_by_role'))->with('role', $role);\r\n }", "public function getEdit($id) {\n \n $action = 1;\n $gen_user = GenUser::find($id);\n $person = Person::find($gen_user->person_id);\n $gen_role_list = GenRole::all();\n $employee_type_list = EmployeeType::all();\n\n // $gen_user_role_list = GenUserRole::where('gen_user_id','=',$gen_user->id)->lists('gen_role_id');\n \n $gen_user_role_list = GenUserRole::join('gen_role', 'gen_user_role.gen_role_id', '=', 'gen_role.id')\n ->join('gen_user', 'gen_user_role.gen_user_id', '=', 'gen_user.id')\n ->join('person', 'gen_user.person_id', '=', 'person.id')\n ->where('gen_user_role.gen_user_id', '=', $id)\n ->select('gen_user_role.id', 'gen_role.id as gen_role_id','gen_user.id as gen_user_id', 'gen_role.name', 'person.last_name', 'person.first_name', 'person.middle_name')\n ->get();\n\n //var_dump($gen_user_role_list);\n return view('gen_user.edit', compact('gen_user', 'gen_role_list', 'gen_user_role_list', 'action', 'person','employee_type_list'));\n }", "public function getEdit($id)\n {\n $user = User::where('id', $id)->first();\n\n if(is_null($user)) {\n abort(404);\n }\n\t\t\n\t\t$role = Role::select('id', 'name')->get();\n\t\tforeach($role as $data)\n\t\t{\n\t\t\t$roles[$data->id] = $data->name;\n\t\t}\n\n $data = [\n 'user' \t\t=> $user,\n\t\t\t'roleList'\t=> $roles,\n\t\t\t'selected'\t=> $user->roles->first()->id\n ];\n\n return view('dashboard/user/edit')->with($data);\n }", "function roles_get() {\n\n $result_set = $this->model_all->getTableDataInArray(\"app_roles\", array(\"id!=\" => \"1\"), \"id,role_name,short_form\");\n if (($result_set['total_rows']) > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"roles\"] = $result_set['records'];\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"Detais Not Found\";\n $this->response($result, 200);\n exit;\n }\n }", "function role_data($role_id = 0) {\n\t\tif(!has_permission(2)) {\n\t\t\tset_warning_message('Sory you\\'re not allowed to access this page.');\n\t\t\tredirect('admin');\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$this->output_head['function'] = __FUNCTION__;\n\t\t\n\t\t$this->output_head['style_extras'] = array(assets_url() . '/plugins/datatables/dataTables.bootstrap.css');\n\t\t$this->output_head['js_extras'] = array(assets_url() . '/plugins/datatables/jquery.dataTables.min.js',\n\t\t\t\t\t\t\t\t\t\t\t\tassets_url() . '/plugins/datatables/dataTables.bootstrap.min.js');\n\t\t$this->output_head['js_function'] = array();\n\t\t$this->load->view('global/header', $this->output_head);\n\t\t\n\t\t$this->output_data['title'] = 'New Role ';\n\t\t$this->output_data['role_id'] = $role_id;\n\t\t$this->output_data['mode'] = 'add';\n\t\tif($role_id != 0) {\n\t\t\t$result = $this->user_model->get_role($role_id);\n\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t$data = $result->row();\n\t\t\t\t$this->output_data['title'] = 'Edit Role';\n\t\t\t\t$this->output_data['mode'] = 'edit';\n\t\t\t\t$this->output_data['data'] = $data;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$list = $this->user_model->get_role_permission($role_id);\n\t\t$this->output_data['list'] = $list;\n\t\t\n\t\t$this->load->view('role_form', $this->output_data);\n\t\t\n\t\t$this->load->view('global/footer');\n\t\t\n\t}", "public function edit($id)\n {\n $data = [];\n $permissions = Permission::get(); \n $roles = Role::findOrFail($id);\n\n $getAllPermissionOfRole = DB::table('permission_role')->where('role_id', $id)->pluck('permission_id');\n\n $data['roles'] = $roles;\n $data['permissions'] = $permissions;\n $data['getAllPermissionOfRole'] = $getAllPermissionOfRole;\n // dd($getAllPermissionOfRole);\n return view('admin.roles.edit', $data);\n\n }", "public function edit($id) {\r\n $role = Role::find($id);\r\n $permission = Permission::get();\r\n $rolePermissions = DB::table(\"permission_role\")->where(\"permission_role.role_id\", $id)\r\n ->pluck('permission_role.permission_id', 'permission_role.permission_id')->toArray();\r\n\r\n return view('admin.roles.edit',compact('role','permission','rolePermissions'));\r\n }", "public function edit($id)\r\n {\r\n $roles = Role::whereNotIn('id',[1,2,3])->get(); \r\n foreach($roles as $role){\r\n $data['roles'][$role['id']] = $role['name'];\r\n }\r\n $data['user'] = User::findOrFail($id);\r\n return view('admin.editor_edit',['data'=>$data]);\r\n }", "private function _get_crud_for_index() {\t\t\n\t\t$data = array(\n\t\t\t'insert' => array(\n\t\t\t\tarray ('name' => 'name', 'label' => t('Role name'), 'type' => 'input',\n\t\t\t\t\t'rules' => array('unique', 'required', array('max_length' => 30, 'min_length' => 3), 'trim'),),\n\t\t\t),\n\t\t\t'select' => array(\n\t\t\t\tarray('name' => 'id', 'label' => 'ID', 'rules' => array('key', 'hidden', 'trim'),),\n\t\t\t\tarray('name' => 'name',\t'label' => t('Role name'), 'link' => 'example1/acl/screens/{id}', \n\t\t\t\t\t'rules' => array('trim', 'htmlspecialchars'),),\n\t\t\t),\n\t\t\t'update' => array(\n\t\t\t\tarray('name' => 'name',\t'label' => t('Role name'), 'type' => 'input', \n\t\t\t\t\t'rules' => array('unique', 'required', array('max_length' => 30, 'min_length' => 3), 'trim'),),\n\t\t\t),\n\t\t\t'delete' => array(\n\t\t\t\tarray('name' => 'name', 'label' => t('Role name'),),\n\t\t\t),\n 'search' => array('name' => t('Role name')),\n\t\t\t'datasource' => array(\n\t\t\t\t'table' => 'oci_roles',\n\t\t\t),\n\t\t\t'properties' => array(\n\t\t\t\t'name' => 'roles',\n\t\t\t\t'uri' => 'example1/roles/index',\n\t\t\t\t'index_column' => TRUE,\n\t\t\t\t'index_column_start' => 1,\n 'pagination' => TRUE,\n\t\t\t\t'pagination_per_page' => 5,\n\t\t\t\t'insert' => TRUE,\n\t\t\t\t'update' => TRUE,\n\t\t\t\t'delete' => TRUE,\n\t\t\t\t'crud_title' => NULL,\n\t\t\t\t'crud_form_title' => '<h2>'.t('List of Roles').'</h2>',\n\t\t\t\t'insert_form_title' => '<h2>'.t('Insert Data').'</h2>',\n\t\t\t\t'update_form_title' => '<h2>'.t('Update Data').'</h2>',\n\t\t\t\t'delete_form_title' => '<h2>'.t('Delete Data').'</h2>',\n\t\t\t),\n\t\t);\n\t\t$this->crud->set_data($data);\n\t\treturn $this->crud->render();\n\t}", "public function edit($role_id)\n\t{\n\t\t$consultperm = AclPermission::where('main_module','=','consultant')->get();\n\t\t$awardedperm = AclPermission::where('main_module','=','awarded')->get();\n\t\t$akdnperm = AclPermission::where('main_module','=','akdn')->get();\n\t\t$languageperm = AclPermission::where('main_module','=','language')->get();\n\t\t$skillperm = AclPermission::where('main_module','=','skill')->get();\n\t\t$roleperm = AclPermission::where('main_module','=','role')->get();\n\t\t$specperm = AclPermission::where('main_module','=','specialization')->get();\n\t\t$userperm = AclPermission::where('main_module','=','adminuser')->get();\n\t\t$firewallperm = AclPermission::where('main_module','=','firewall')->get();\n\t\t$agency = AclPermission::where('main_module','=','agency')->get();\n\t\t$mails = AclPermission::where('main_module','=','mails')->get();\n\n\t\t$selected = AclGroupPermission::where('group_id',$role_id)->lists('group_id','permission_id');\n\t\t$role_name = AclGroup::where('id',$role_id)->first();\n\n\t\treturn View::make('admin.role.edit',compact('mails','agency','consultperm','awardedperm','akdnperm','languageperm','skillperm','roleperm','selected','role_name','specperm','userperm','firewallperm'));\n\t}", "public function show_roles(){\n\t\t\n\t\t//Connection establishment, processing of data and response from REST API\n\t\t$path=base_url();\n\t\t$url = $path.'api/manageRoles_api/all_role';\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response_json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response=json_decode($response_json, true);\n\t\treturn $response;\t\t\n\t\t\n\t}", "public function getDetail($id)\n {\n $role = $this->roles->find($id);\n return $role;\n }", "function getFromRoleId() {\n\t\treturn $this->getData('fromRoleId');\n\t}", "public function getEdit($id)\n {\n $params = array('roles' => DB::table('roles')->lists('name', 'id'));\n $this->setParamsForMethod('getEdit', $params);\n\n return parent::getEdit($id);\n }", "public function edit($id)\n {\n return $this->response->item(Role::findOrFail($id));\n }", "public function index(){\n $datas=$this->userRoleDetailService->getActiveRoleDetail();\n return view('admin.list-userRoleDetail',compact('datas'));\n }", "public function edit($id)\n { \n $data = [\n 'permissions' => [\n 'user-create',\n 'user-edit',\n 'user-destroy',\n 'user-show',\n 'user-role-assign',\n \n 'role-create', \n 'role-edit', \n 'role-destroy',\n 'role-show',\n \n 'campaign-create',\n 'campaign-edit',\n 'campaign-destroy', \n 'campaign-show'\n ],\n 'role' => Role::findOrFail($id)\n ];\n\n return view('modules.roles.edit')->with($data);\n }", "public function index()\n { \n\n $role=Role::all();\n \n return view('admin.form',compact('role'));\n }", "public function getRole() {\n $user = new Pas_User_Details();\n $person = $user->getPerson();\n if ($person) {\n $this->_role = $person->role;\n } \n return $this->_role;\n }", "public function getRole() : string;", "function roleListing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $type = $this->login_id;\n $data['userRecords'] = $this->user_model->roleListing($type);\n\n $this->global['pageTitle'] = '角色管理';\n\n $this->loadViews(\"systemrolemanage\", $this->global, $data, NULL);\n }\n }", "public function getRole() {\n\n return session('role');\n\n }", "public function edit($id)\n {\n $role = Role::find($id);\n $permission = Permission::get();\n $rolePermissions = DB::table(\"role_has_permissions\")->where(\"role_has_permissions.role_id\",$id)\n ->pluck('role_has_permissions.permission_id','role_has_permissions.permission_id')\n ->all();\n return view('role.edit',compact('role','permission','rolePermissions'));\n }", "public function getRole()\n {\n return $this->hasOne(Role::className(), ['id' => 'role_id']);\n }", "public function getRoleId()\n {\n return $this->db->get('role_id')->result_array();\n }", "public function getMainRole()\n\t{\n return array_values($this->entity->roles)[0]['name'];\n\t}", "public function getEditRole(Request $request) {\n $id = $request->input('id');\n $role = $this->role->where('id', '=', $id)->get()->first();\n return view('roles.edit')->with('role', $role)->render();\n }", "public function roleDetails(int $roleId);", "public function edit($id)\n {\n $role = Role::findById($id);\n $group_name = User::groupname();\n $all_permissions = Permission::all();\n return view('backend.pages.roles.edit',compact('group_name','role','all_permissions'));\n }", "public function show($id)\n {\n $model = AdminRole::find($id);\n\n if($model)\n {\n $this->repository->setPageTitle(\"Administrator Role | \".$model[\"role_name\"]);\n\n $record = $model->toArray();\n\n $urls = [];\n $urls[\"addUrl\"]=URL::to(\"/admin/admin_role/create\");\n $urls[\"editUrl\"]=URL::to(\"/admin/admin_role/edit/\");\n $urls[\"listUrl\"]=URL::to(\"/admin/admin_role\");\n $urls[\"historyUrl\"]=URL::to(\"/admin/admin_role_permission_history/\");\n\n $this->repository->setPageUrls($urls);\n\n $systems = AdminPermissionSystem::query()->where(\"system_status\", \"=\", \"1\")->get();\n\n $systemPermissions = [];\n if(count($systems)>0)\n {\n $adminPermSysRepo = new AdminPermissionSystemRepository();\n $allSystemCurrPerms = AdminRoleRepository::getAllSystemPermissionData($id);\n foreach ($systems as $key => $system)\n {\n $systemModules = $system->permissionModules()->get()->toArray();\n $systemModules = $adminPermSysRepo->getSystemPermissionModules($systemModules);\n\n $system[\"modules\"] = $systemModules;\n $system[\"curr_permissions\"] = [];\n if(isset($allSystemCurrPerms[$system->id]))\n {\n $system[\"curr_permissions\"] = $allSystemCurrPerms[$system->id];\n }\n\n $systems->$key = $system;\n }\n\n $systemPermissions = $systems->toArray();\n }\n\n return view('admin::admin_role.view', compact( 'record', 'systemPermissions'));\n }\n else\n {\n abort(404, \"Requested record does not exist.\");\n }\n }", "public function edit($id)\n {\n $userRoles=$this->userRoleService->getActiveUserRole();\n $userRolesDet=$this->userRoleDetailService->getUserRolesDetById($id);\n// dd($userRolesDet->getroleDetailImage());\n return view('admin.userRoleDetail',compact('userRoles','userRolesDet'));\n }", "public function deleteRoleMasterData()\n\t{\n\t\t$RoleID = $this->input->post('RoleID');\n\t\t$RoleData = $this->system_structure_m->deleteRoleMasterData($RoleID);\n\t\techo $RoleData;\n\t}", "public function edit($id) {\n //\n $role = Role::find($id);\n $permissions = Permission::all();\n $role_permissions = $role->perms()->pluck('id', 'id')->toArray();\n return view('cpanel.role.edit', compact(['role', 'role_permissions', 'permissions']));\n }", "private function getCurrentRole()\n {\n return AuthAssignment::find()->where(['user_id' => $this->user->id])->andWhere(['item_name' => $this->role])->one();\n }", "function erp_get_editable_roles (){\n if(! function_exists('get_editable_roles')){\n require_once(ABSPATH . 'wp-admin/includes/user.php');\n }\n $wp_roles = get_editable_roles();\n\n if( !current_user_can( 'administrator' ) ){\n unset( $wp_roles['administrator'] );\n }\n\n $roles = apply_filters( 'erp_editable_roles', $wp_roles );\n\n return $roles;\n}", "function get_user_role_id(){\n return $this->user_role_id;\n }", "public function edit($id)\n\t{\n\t\t$user = User::find($id);\n\t\t$roles = Role::all();\n\t\t\n\t\t$compact = [];\n\t\t$compact[] = 'user';\n\t\t$compact[] = 'roles';\n\t\treturn view('admin.manager.edit')->with(compact($compact));\n\t}", "public function getRole() \n {\n return $this->role;\n }", "public function edit($id)\n {\n $role = Role::find($id);\n $permissions = Permission::get(); \n $rolePermissions = $role->permissions()->pluck('id','id')->toArray();\n\n return view('admin.users_block.roles.edit',compact('role','permissions','rolePermissions'));\n }", "public function editar($id){\n\n $record = Hashids::decode($id);\n $registro = User::find($record[0]);\n\n $roles = \\DB::table('roles')->get();\n\n return view('Center.empleados.editar')\n ->with('registro',$registro)->with('roles', $roles);\n\n }", "public function view_role_detail($role_id){\n\t\treturn ORM::factory('role')\n\t\t\t\t->where('role_id', '=', $role_id)\n\t\t\t\t->find();\n\t}", "public function edit($id)\n {\n $data['role_permissions'] = Role::with('permissions')->whereId($id)->get()->toArray();\n $data['permissions'] = Permission::all();\n return response()->json($data);\n\n// print_r($data);\n }", "public function edit($id)\n {\n $data = Pages::get();\n $role = Role::find($id);\n $permission = Permission::get();\n $rolePermissions = DB::table(\"role_has_permissions\")->where(\"role_has_permissions.role_id\",$id)\n ->pluck('role_has_permissions.permission_id','role_has_permissions.permission_id')->all();\n return view('pages.formRoles',compact('data','role','permission','rolePermissions'));\n }", "public function edit($id)\n {\n //\n $roles = $this->role->all();\n $user = $this->user->findOrFail($id);\n $listRoleOfUser = DB::table('role_user')->where('user_id',$id)->pluck('role_id');\n\n return view('user.edit',compact('roles','user','listRoleOfUser'));\n// return $user->id;\n }", "public function getRoleId()\n {\n return $this->role_id;\n }", "public function getRoleId()\n {\n return $this->role_id;\n }", "public function getRole($raw_request, $id) {\n try {\n $data = $this->model;\n $data = $data->where($this->model->getKeyName(), $id)->first();\n if (empty($data)) throw new Exception(\"Data with id $id not found\");\n else {\n $permissions = Permissions::whereRaw('deleted_at IS NULL')->get();\n $send = [];\n foreach ($permissions as $key => $value) {\n $obj = [\n \"id\" => null,\n \"permission_id\" => $value->id,\n \"role_id\" => null,\n \"name\" => $value->name,\n \"slug\" => $value->slug,\n \"current_allow\" => false,\n \"allow\" => false,\n ];\n $hasRole = RolePermissions::whereRoleId($id)->wherePermissionId($value->id)->first();\n if ($hasRole) {\n $obj['id'] = $hasRole->id;\n $obj['role_id'] = $hasRole->role_id;\n $obj['current_allow'] = true;\n $obj['allow'] = true;\n }\n $send[] = $obj;\n }\n $data->detail = $send;\n }\n\n return $data;\n } catch (Exception $e){ \n throw new Exception($e->getMessage());\n }\n }", "public function getROLE()\n {\n return $this->hasOne(Role::className(), ['id' => 'ROLE']);\n }", "public function edit($id)\n {\n $user = User::findOrFail($id);\n $roles = Role::all();\n $rol_actual = DB::select(\"select model_has_roles.role_id as id\n from model_has_roles\n where model_has_roles.model_id = \".$id);\n //return $rol_actual[0]->id;\n return view('forms.formUedit', compact('user','roles','rol_actual'));\n }", "function get_role_id()\n\t{\n\t\treturn $this->ci->session->userdata('DX_role_id');\n\t}", "public function edit($id)\n {\n $role=Role::where('id',$id)->first();\n return view('Backend.roles.edit',['roles'=>$role]);\n }", "public function setRole() {\n\n $res= $_POST['link']->query(\"SELECT t2.perm_name FROM role_perm as t1\n JOIN permissions as t2 ON t1.perm_id = t2.perm_id\n WHERE t1.role_id = $this->rol_id\");\n\n\n foreach($res as $item)\n $this->role_perm[]= $item['perm_name'];\n }", "public function company_new_role($edit_role = null) {\n $this->loadModel('RoleSource');\n $roles = $this->Role->find('all', array('conditions' => array('Role.comp_id' => $this->Auth->user('id'))));\n $this->set('roles', $roles);\n if (!empty($edit_role)) {\n $edit_data = $this->Role->findById($edit_role);\n $this->set('edit_data', $edit_data);\n $role_source = $this->RoleSource->find('all', array('conditions' => array(\n 'RoleSource.role_id' => $edit_role,\n 'RoleSource.status' => 1\n )));\n $this->set('role_source', $role_source);\n }\n if (!empty($_POST)) {\n $findRole = $this->Role->find('first', array('conditions' => array('Role.name' => @$this->request->data['Role']['parent_id'])));\n\n if (!empty($findRole)) {\n $this->request->data['Role']['parent_id'] = $findRole['Role']['id'];\n }\n $this->request->data['Role']['comp_id'] = $this->Auth->user('id');\n if (!isset($this->request->data['Role']['view_client'])) {\n $this->request->data['Role']['view_client'] = 0;\n }\n if (!isset($this->request->data['Role']['edit_client'])) {\n $this->request->data['Role']['edit_client'] = 0;\n }\n if (!isset($this->request->data['Role']['view_partner'])) {\n $this->request->data['Role']['view_partner'] = 0;\n }\n if (!isset($this->request->data['Role']['edit_partner'])) {\n $this->request->data['Role']['edit_partner'] = 0;\n }\n if (!isset($this->request->data['Role']['view_contact'])) {\n $this->request->data['Role']['view_contact'] = 0;\n }\n if (!isset($this->request->data['Role']['edit_contact'])) {\n $this->request->data['Role']['edit_contact'] = 0;\n }\n if (!isset($this->request->data['Role']['view_leads'])) {\n $this->request->data['Role']['view_leads'] = 0;\n }\n if (!isset($this->request->data['Role']['edit_leads'])) {\n $this->request->data['Role']['edit_leads'] = 0;\n }\n $data = array('Role' => $this->request->data['Role']);\n if (isset($edit_role) and ! empty($edit_role)) {\n $this->request->data['Role']['id'] = $edit_role;\n $parent_id = $this->request->data['Role']['parent_id'];\n if (isset($this->request->data['Role']['access_type']) and $this->request->data['Role']['access_type'] != 'customize_access') {\n $this->request->data['Role']['view_client'] = 0;\n $this->request->data['Role']['edit_client'] = 0;\n $this->request->data['Role']['view_partner'] = 0;\n $this->request->data['Role']['edit_partner'] = 0;\n $this->request->data['Role']['view_contact'] = 0;\n $this->request->data['Role']['edit_contact'] = 0;\n $this->request->data['Role']['edit_leads'] = 0;\n $this->request->data['Role']['view_leads'] = 0;\n }\n $data = array('Role' => $this->request->data['Role']);\n $this->Role->save($data);\n if (isset($this->request->data['RoleSource']) and ! empty($this->request->data['RoleSource'])) {\n foreach ($this->request->data['RoleSource'] as $key => $value) {\n $this->RoleSource->create();\n $this->request->data['RoleSource'] = $value;\n if (!isset($this->request->data['RoleSource']['source_status'])) {\n $this->request->data['RoleSource']['source_status'] = 0;\n } else {\n $this->request->data['RoleSource']['source_status'] = 1;\n $this->request->data['RoleSource']['role_id'] = $edit_role;\n $this->RoleSource->save($this->request->data);\n }\n }\n }\n $response['status'] = 'true';\n $response['message'] = 'Role uodated successfully.';\n $response['last_insert_id'] = $edit_role;\n } else {\n if (isset($this->request->data['Role']['access_type']) and $this->request->data['Role']['access_type'] != 'customize_access') {\n $this->request->data['Role']['view_client'] = 0;\n $this->request->data['Role']['edit_client'] = 0;\n $this->request->data['Role']['view_partner'] = 0;\n $this->request->data['Role']['edit_partner'] = 0;\n $this->request->data['Role']['view_contact'] = 0;\n $this->request->data['Role']['edit_contact'] = 0;\n $this->request->data['Role']['edit_leads'] = 0;\n $this->request->data['Role']['view_leads'] = 0;\n }\n $data = array('Role' => $this->request->data['Role']);\n if ($this->Role->save($data)) {\n $last_insert_id = $this->Role->getLastInsertID();\n\n if (isset($this->request->data['RoleSource']) and ! empty($this->request->data['RoleSource'])) {\n foreach ($this->request->data['RoleSource'] as $key => $value) {\n\n $this->RoleSource->create();\n $this->request->data['RoleSource'] = $value;\n if (!isset($this->request->data['RoleSource']['source_status'])) {\n $this->request->data['RoleSource']['source_status'] = 0;\n } else {\n $this->request->data['RoleSource']['source_status'] = 1;\n $this->request->data['RoleSource']['role_id'] = $last_insert_id;\n $this->RoleSource->save($this->request->data);\n }\n }\n }\n $response['status'] = 'true';\n $response['message'] = 'Role added successfully.';\n $response['last_insert_id'] = $last_insert_id;\n } else {\n $errors = $this->Role->validationErrors;\n $err = array();\n $response['error'] = $errors;\n if (!empty($this->request->data['RoleSource'])) {\n foreach ($this->request->data['RoleSource'] as $key => $value) {\n if (empty($value['source'])) {\n $err[$key]['source'] = \"Please enter the source.\";\n }\n }\n $response['errors'] = $err;\n }\n $response['status'] = 'false';\n }\n }\n\n echo json_encode($response);\n die;\n } else {\n $this->layout = \"ajax\";\n }\n }", "public function getEditRole($id)\n {\n $role = Role::find($id);\n\n return view('adminlte.pages.admin.role-edit', compact('role'));\n }", "public function getUserRole() {\n return view('backend.acl.user_role');\n }", "public function getRoles()\n {\n $roles = Role::all();\n\n return Datatables::of($roles)\n ->editColumn('routes', function ($role) {\n return htmlentities(strlen($role->getOriginal('routes')) > 50 ? substr($role->getOriginal('routes'), 0, 50) : $role->getOriginal('routes'));\n })\n ->addColumn('actions', function ($role) {\n $editBtn = '<a style=\"margin-right: 0.2em;\" href=\"' . url('admin/roles/' . $role->id . '/edit/') . '\" title=\"Edit\"><i class=\"fa fa-2 fa-pencil\"></i></a>';\n $deleteBtn = '';\n if ($role->name != 'Admin') {\n $deleteBtn = '&nbsp;<a href=\"' . url('admin/roles/' . $role->id) . '\" class=\"message_box text-danger\" data-box=\"#message-box-delete\" data-action=\"DELETE\" title=\"Permanent Delete\"><i class=\"fa fa-2 fa-remove\"></i></i></a>';\n }\n return $editBtn . $deleteBtn;\n })->make(true);\n }", "public function getRole()\n {\n $res = $this->getEntity()->getRole();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getRole();\n\t\t}\n return $res;\n }" ]
[ "0.6782887", "0.64573497", "0.6299855", "0.62843555", "0.6274708", "0.62412316", "0.6240907", "0.6237162", "0.623561", "0.6215304", "0.6199266", "0.6166367", "0.6161494", "0.6154373", "0.6153258", "0.6143266", "0.61103666", "0.61103666", "0.61014414", "0.6083909", "0.60794157", "0.605989", "0.6052019", "0.6050954", "0.6024808", "0.60216933", "0.60181564", "0.6011983", "0.6010558", "0.6003727", "0.5935076", "0.5932543", "0.5929202", "0.5926865", "0.59105355", "0.59098107", "0.59055454", "0.58985543", "0.58923507", "0.5883888", "0.5880036", "0.5879666", "0.58717716", "0.5871112", "0.58703315", "0.58648485", "0.58639574", "0.58550155", "0.58543116", "0.58526546", "0.58479244", "0.58423066", "0.5834899", "0.5834245", "0.5832577", "0.58296555", "0.58288306", "0.5828462", "0.5824077", "0.58010453", "0.57980317", "0.579464", "0.5792037", "0.5781961", "0.5775955", "0.5774084", "0.57666147", "0.5765698", "0.5764862", "0.57624286", "0.5762242", "0.575972", "0.5747592", "0.5745877", "0.5745307", "0.574346", "0.5740835", "0.57235366", "0.57223946", "0.5720366", "0.571892", "0.5718836", "0.57148945", "0.57143855", "0.5709552", "0.5709107", "0.5708129", "0.57062536", "0.57062536", "0.5703927", "0.5700792", "0.56982774", "0.56963336", "0.56916296", "0.5690262", "0.5689325", "0.5687714", "0.5686625", "0.56844497", "0.568204" ]
0.6392611
2
Delete Role Master Data
public function deleteRoleMasterData() { $RoleID = $this->input->post('RoleID'); $RoleData = $this->system_structure_m->deleteRoleMasterData($RoleID); echo $RoleData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function roleDelete(Role $role);", "function delete_role($roleid) {\n $success = true;\n\n// mdl 10149, check if this is the last active admin role\n// if we make the admin role not deletable then this part can go\n \n $systemcontext = get_context_instance(CONTEXT_SYSTEM);\n \n if ($role = get_record('role', 'id', $roleid)) {\n if (record_exists('role_capabilities', 'contextid', $systemcontext->id, 'roleid', $roleid, 'capability', 'moodle/site:doanything')) {\n // deleting an admin role\n $status = false;\n if ($adminroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $systemcontext)) {\n foreach ($adminroles as $adminrole) {\n if ($adminrole->id != $roleid) {\n // some other admin role\n if (record_exists('role_assignments', 'roleid', $adminrole->id, 'contextid', $systemcontext->id)) {\n // found another admin role with at least 1 user assigned \n $status = true;\n break;\n }\n }\n } \n } \n if ($status !== true) {\n error ('You can not delete this role because there is no other admin roles with users assigned'); \n }\n } \n }\n\n// first unssign all users\n if (!role_unassign($roleid)) {\n debugging(\"Error while unassigning all users from role with ID $roleid!\");\n $success = false;\n }\n\n// cleanup all references to this role, ignore errors\n if ($success) {\n delete_records('role_capabilities', 'roleid', $roleid);\n delete_records('role_allow_assign', 'roleid', $roleid);\n delete_records('role_allow_assign', 'allowassign', $roleid);\n delete_records('role_allow_override', 'roleid', $roleid);\n delete_records('role_allow_override', 'allowoverride', $roleid);\n delete_records('role_names', 'roleid', $roleid);\n }\n\n// finally delete the role itself\n // get this before the name is gone for logging\n $rolename = get_field('role', 'name', 'id', $roleid);\n \n if ($success and !delete_records('role', 'id', $roleid)) {\n debugging(\"Could not delete role record with ID $roleid!\");\n $success = false;\n }\n \n if ($success) {\n add_to_log(SITEID, 'role', 'delete', 'admin/roles/action=delete&roleid='.$roleid, $rolename, '', $USER->id);\n }\n\n return $success;\n}", "public function actionDeleteRole ()\n\t\t{\n\n\t\t\t$auth = Yii::$app->getAuthManager();\n\t\t\t$role = $auth->getRole(Yii::$app->request->get('id'));\n\t\t\t$auth->remove($role);\n\t\t\t$url = Yii::$app->request->referrer . '#roles';\n\t\t\tYii::$app->response->redirect($url);\n\n\t\t\tYii::$app->end();\n\t\t}", "public function clear() {\r\n\r\n \t\r\n \t\tunset ( $this->__sesionStorage->role );\r\n \t\t\r\n }", "public function postDelete()\n {\n self::getConnection()->delete('@system_user_role', ['user_id' => $this->getId()]);\n }", "public function deleteRoleAccess()\n\t{\n\t\t$RoleAccessID = $this->input->post('RoleAccessID');\n\t\t$RoleAccessData = $this->system_structure_m->deleteRoleAccess($RoleAccessID);\n\t\techo $RoleAccessData;\n\t}", "public function del_role(){\n\t\textract($_POST);\n\n\t\t//Connection establishment to get data from REST API\n\t\t$path=base_url();\n\t\t$url = $path.'api/manageRoles_api/del_role?role_id='.$role_id;\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response_json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response=json_decode($response_json, true);\n\t\t//api processing ends\n\n\t\tif($response['status']==0){\n\t\t\techo '<div class=\"alert alert-danger\">\n\t\t\t<strong>'.$response['status_message'].'</strong> \n\t\t\t</div>\t\t\t\t\t\t\n\t\t\t';\t\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\techo '<div class=\"alert alert-warning\">\n\t\t\t<strong>'.$response['status_message'].'</strong> \n\t\t\t</div>\t\t\t\t\t\t\n\t\t\t';\t\t\t\t\n\t\t\t\n\t\t}\t\n\t\t\n\t}", "public function destroy($id)\n {\n $del = $this->Role->delete($id); \n if($del): echo \"Role Deleted Successfully\"; else: \"Error deleting this data... Please try again later\"; endif;\n\t\n\n }", "function delete_role ($role_id) {\r\n $conn = db_connect();\r\n $query = \"delete from roles where role_id = '\".$role_id.\"'\";\r\n $result = $conn->query($query);\r\n $query = \"delete from role_priv where role_id = '\".$role_id.\"'\";\r\n $result1 = $conn->query($query);\r\n\r\n // change the users` priv to default\r\n $result2 = $conn->query(\"update users set role_id = '1' where role_id = '\".$role_id.\"'\");\r\n\r\n if (!$result || !$result1 || !$result2) {\r\n throw new Exception(\"Could not connect to the db!\");\r\n } else {\r\n return true;\r\n }\r\n }", "public static function deletePerms() {\n $sql = \"TRUNCATE role_perm\";\n $res = $_POST['link']->query($sql);\n return $res;\n }", "public function testDelete()\n {\n\n $this->createDummyRole();\n\n $this->assertDatabaseHas('roles', [\n 'id' => 1,\n ]);\n\n $this->call('POST', '/api/role', array(\n 'action' => $this->deleteAction,\n 'id' => 1,\n ));\n\n $this->assertDatabaseMissing('roles', [\n 'id' => 1,\n ]);\n\n $this->assertDatabaseMissing('role_permission', [\n 'role_id' => 1,\n 'permission_id' => [1, 2]\n ]);\n }", "public static function RoleDelete($id) {\n $role = Roles::find($id);\n $role->status = 0;\n $role->save(); \n }", "public function testDeleteRole()\n {\n }", "public function delete_data_to_tombstone(){\n }", "public function deleting(Role $role)\n {\n }", "public function deleteRolesAction(){\n \n $request = $this->getRequest();\n \n if(! isset($request->id)) {\n // TODO Massege (Helper bauen??!)\n $this->_helper->messenger('error', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n \n $entity = 'Jbig3\\Entity\\RolesEntity';\n $repositoryFunction = 'findOneById';\n \n $role = $this->em->getRepository($entity)->$repositoryFunction($request->id);\n \n if($role !== null) {\n // TODO Cascade - hier anders gelöst (Kinder vorher manuell löschen)\n if(count($role->rules)) {\n // Masseges\n $this->_helper->messenger('error', \n 'Unable to remove group. Please remove dependencies first (Manual)');\n return $this->_redirect('/admin/role');\n }\n \n $roleName = $role->name;\n \n $this->em->remove($role);\n $this->em->flush();\n \n // TODO Masseges\n $this->_helper->messenger('success', \n sprintf(Zend_Registry::get('config')->messages->role->delete, $roleName));\n return $this->_redirect('/admin/role');\n } else {\n // TODO Masseegs\n $this->_helper->messenger('success', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n }", "public function delete()\r\n {\r\n // Remove Roles\r\n $objPartnerRole = new Partner($this->conf, $this->lang, $this->conf->getExtensionPrefix().'partner');\r\n $objPartnerRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n $objAssistantRole = new Assistant($this->conf, $this->lang, $this->conf->getExtensionPrefix().'assistant');\r\n $objAssistantRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n $objManagerRole = new Manager($this->conf, $this->lang, $this->conf->getExtensionPrefix().'manager');\r\n $objManagerRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n // Remove all plugin capabilities from WordPress admin role\r\n $objWPAdminRole = get_role('administrator');\r\n $capabilitiesToRemove = $objManagerRole->getCapabilities();\r\n foreach($capabilitiesToRemove AS $capability => $grant)\r\n {\r\n $objWPAdminRole->remove_cap($capability);\r\n }\r\n\r\n // Create mandatory instances\r\n $objSingleSiteInstall = new Install($this->conf, $this->lang, $this->blogId);\r\n $objSingleSiteInstall->deleteContent();\r\n\r\n flush_rewrite_rules();\r\n }", "function delete_pac_emp_role($id)\n {\n $response = $this->getdb()->delete('pac_emp_roles',array('id'=>$id));\n if($response)\n {\n return \"pac_emp_role deleted successfully\";\n }\n else\n {\n return \"Error occuring while deleting pac_emp_role\";\n }\n }", "protected function deleteAdminUserFixture()\n {\n if ($this->userName) {\n $users = Mage::getModel('admin/user')->getCollection();\n $users->addFieldToFilter('username', array( 'eq' => $this->userName));\n $users->load();\n foreach ( $users as $user ) {\n $user->delete();\n }\n }\n \n if ($this->roleName) {\n $roles = Mage::getModel('api/roles')->getCollection();\n $roles->addFieldToFilter('role_name', array('eq' => $this->roleName));\n $roles->load();\n foreach ( $roles as $role ) {\n $role->delete();\n }\n }\n }", "public function delete($id)\n {\n $role = $this->findById($id);\n\n \n $role->delete();\n }", "public function delete($role_id)\r\n {\r\n $this->checkIfDemo();\r\n $this->AdminRoleModel->remove($role_id);\r\n }", "function delete_user_role($id,$table){\n $this->db->delete($table, array('user_id' => $id));\n return;\n }", "function delete_user_role($id,$table){\n $this->db->delete($table, array('user_id' => $id));\n return;\n }", "public function destroy($id)\n {\n $role = Role::firstOrCreate(['id' => Auth::user()->role_id]);\n if (!is_null($role->hasPermissionTo('clearingagent-add')) && $role->hasPermissionTo('clearingagent-add')){\n $clearingagent = ClearingAgent::find($id);\n if(!is_null($clearingagent)){\n $clearingagent->delete();\n }\n\n\n return redirect()->route('clearingagent.index')->with('message', 'Successfully deleted');\n }else\n return redirect()->back()->with('not_permitted', 'Sorry! You are not allowed to access this module');\n }", "public function testDeleteAuthorizationRole()\n {\n }", "public function resetTable($role)\n {\n DB::table('permission_role')->where('role_id', $role->id()->value())->delete();\n }", "public function _event_before_delete() {\n\t\tstatic::$_delete['roles'] = $this->roles;\n\t}", "public function destroy(MasterUser $masterUser)\n {\n //\n }", "function delete($role_id)\n\t{\n\t\t// response array\n\t\t$jsonData = array('success' => false);\n\t\t$result = $this->role_model->remove($role_id);\n\t\t// if role deleted successfully\n\t\tif($result) {\n\t\t\t$jsonData['success'] = true;\n\t\t}\n\n\t\t// send response to clint\n\t\techo json_encode($jsonData);\n\t}", "private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}", "public function destroy($id) {\n //fetcg the data spotlight by id\n DB::table('roles')->where('id', $id)->delete();\n\n //redirect the listing page\n return redirect('Roles ')->withMessage('Data Delete Successfully');\n }", "public function delete_role($role_id){\n\t\treturn ORM::delete($role_id);\n\t}", "function deleteRecord()\n\t{\n\t\t$this->db->where('roleID', $this->roleID);\n\t\t$this->db->delete('roles'); \n\t \t\n\t\tif ($this->db->_error_message())\n\t\t\treturn false;\n\t\telse \n\t\t\treturn true; \t\t\n\t}", "public function destroy($id)\n\t{\n $vaccine = Roles::find($id);\n $rol = $vaccine->role;\n $vaccine->delete();\n Logs::create(array(\n \"user_id\"=> Auth::user()->id,\n \"action\" =>\"Delete role with name \".$rol\n ));\n\t}", "public function deleting(Role $role)\n {\n $role->syncPermissions();\n }", "public function testDeleteRoleItem()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function delete_user_role($id)\n {\n return $this->db->delete('user_role',array('id'=>$id));\n }", "public function destroy($id)\n {\n //\n $delete = Role::destroy($id);\n }", "public function destroy(Role $role)\n {\n //\n if($role->name ==\"app-admin\"){\n\n }else{\n $role->delete();\n }\n return redirect('roles');\n }", "public function delete()\n\t{\n\t\t/*$roles_to_delete=$this->input->post('ids');\n\t\tif ($this->Role->delete_list($roles_to_delete)) {\n\t\t\techo json_encode(array('success'=>true,'message'=>$this->lang->line('roles_successful_deleted').' '.\n\t\t\tcount($roles_to_delete).' '.$this->lang->line('roles_one_or_multiple')));\n\t\t}\n\t\telse {\n\t\t\techo json_encode(array('success'=>false,'message'=>$this->lang->line('roles_cannot_be_deleted')));\n\t\t}*/\n\t}", "public function destroy($id)\n {\n Role::find($id)->delete();\n return redirect($this->rdr)->with('success','Data berhasil dihapus!');\n }", "function delete($storage_master_id) {\n\t\t$storage_data = $this->StorageMaster->getOrRedirect($storage_master_id);\n\n\t\t// Check deletion is allowed\n\t\t$arr_allow_deletion = $this->StorageMaster->allowDeletion($storage_master_id);\n\n\t\t// CUSTOM CODE\n\t\t\n\t\t$hook_link = $this->hook('delete');\n\t\tif( $hook_link ) { require($hook_link); }\t\t\n\t\t\t\t\n\t\tif($arr_allow_deletion['allow_deletion']) {\n\t\t\t// First remove storage from tree\n\t\t\t$this->StorageMaster->id = $storage_master_id;\t\n\t\t\t$this->StorageMaster->data = array();\t\n\t\t\t$cleaned_storage_data = array('StorageMaster' => array('parent_id' => ''));\n\t\t\t$this->StorageMaster->addWritableField(array('parent_id'));\n\t\t\tif(!$this->StorageMaster->save($cleaned_storage_data, false)) { \n\t\t\t\t$this->redirect('/Pages/err_plugin_system_error?method='.__METHOD__.',line='.__LINE__, null, true); \n\t\t\t}\n\t\t\t\n\t\t\t// Create has many relation to delete the storage coordinate\n\t\t\t$this->StorageMaster->bindModel(array('hasMany' => array('StorageCoordinate' => array('className' => 'StorageCoordinate', 'foreignKey' => 'storage_master_id', 'dependent' => true))), false);\t\n\n\t\t\t// Delete storage\n\t\t\t$message = '';\n\t\t\t$atim_flash = null;\n\t\t\tif($this->StorageMaster->atimDelete($storage_master_id, true)) {\n\t\t\t\t$atim_flash = true;\n\t\t\t} else {\n\t\t\t\t$atim_flash = false;\n\t\t\t}\n\t\t\t\n\t\t\t$hook_link = $this->hook('postsave_process');\n\t\t\tif( $hook_link ) {\n\t\t\t\trequire($hook_link);\n\t\t\t}\n\t\t\t\n\t\t\t$this->StorageMaster->bindModel(array('hasMany' => array('StorageCoordinate')), false);\n\t\t\tif($atim_flash){\n\t\t\t\t$this->atimFlash(__('your data has been deleted'), '/StorageLayout/StorageMasters/search/');\n\t\t\t}else{\n\t\t\t\t$this->flash(__('error deleting data - contact administrator'), '/StorageLayout/StorageMasters/search/');\n\t\t\t}\n\t\t} else {\n\t\t\t$this->flash(__($arr_allow_deletion['msg']), '/StorageLayout/StorageMasters/detail/' . $storage_master_id);\n\t\t}\t\t\n\t}", "function delete_role($roleId)\n {\n return $this->db->delete('tbl_roles',array('roleId'=>$roleId));\n }", "public function delete(Request $request)\n {\n $role_id = $request->route('groupuser');\n $roles = new Role();\n $role = $roles->find($role_id);\n if ($role) {\n $delete_permission = $role->permissions()->delete();\n $detact = $role->permissions()->detach();\n $detact = $role->users()->detach();\n $results = $roles->find($role_id)->delete();\n if (!$results) {\n return redirect()->route('cpanel.groupuser.index')\n ->with('status', 'fail')\n ->with('msg', 'Can not delete data.');\n } else {\n return redirect()->route('cpanel.groupuser.index')\n ->with('status', 'success')\n ->with('msg', 'Successfully!');\n }\n } else {\n return redirect()->route('cpanel.groupuser.index')\n ->with('status', 'fail')\n ->with('msg', 'Can not delete data.');\n }\n }", "function delete()\n {\n $GLOBALS['DB']->exec(\"DELETE FROM stores WHERE id = {$this->getId()};\");\n $GLOBALS['DB']->exec(\"DELETE FROM stores_brands WHERE store_id = {$this->getId()};\");\n }", "function remove_role($role)\n {\n }", "static public function remove()\n {\n remove_role(self::ROLE_KEY);\n }", "public function destroy($id)\n {\n $res = Role::where('id',$id)->delete();\n // return($re);\n // 0表示成功 其他表示失败\n if($res){\n $data = [\n 'status'=>0,\n 'msg'=>'删除成功!'\n ];\n }else{\n $data = [\n 'status'=>1,\n 'msg'=>'删除失败!'\n ];\n }\n return $data; \n }", "public function destroy($id)\n {\n $role= Role::find($id);\n $role->delete();\n return redirect ('/role');\n }", "public function destroy($id)\n {\n try {\n DB::beginTransaction();\n // delete to table role\n\n $role = $this->role->find($id);\n $role->permissions()->detach();// phải xóa ở table permission_role trc để kh bị ràng buộc dữ liệu\n $role->delete();\n\n // delete to table permission_role\n \n \n DB::commit();\n // success\n return redirect()->route('admin.role.index')->with('success', 'Xóa vai trò thành công!');\n // dd($request->permission);\n } catch (\\Exception $ex) {\n DB::rollback();\n return redirect()->back()->with('error', $ex->getMessage());\n }\n }", "static public function remove()\n {\n remove_role(self::ROLE_KEY);\n }", "public function deleteMPa($data) {\n $this->db->where('id_pa',$data['id_pa']);\n $this->db->delete('m_pa',$data);\n }", "public function testDeleteUserRoles()\n {\n }", "public function delete() {\r\n $this->db->delete(\"assets_permissions\", $this->db->quoteInto(\"id = ?\", $this->model->getId()));\r\n }", "public function delete_teacher_from_master($master_id)\n\t{\n\t\t$this->db->where('cms_id', $master_id);\n\t\t$this->db->delete('cms_users');\n\t\treturn $master_id;\n\t}", "function roles_dashboard_role_deleted($event, $type, $entity) {\n\n\tif (!$entity instanceof ElggRole) {\n\t\treturn;\n\t}\n\n\t$ia = elgg_set_ignore_access(true);\n\n\t$dashboards = new ElggBatch('elgg_get_entities_from_relationship', array(\n\t\t'types' => 'object',\n\t\t'subtypes' => MultiDashboard::SUBTYPE,\n\t\t'relationship' => 'dashboard_for',\n\t\t'relationship_guid' => (int) $entity->guid,\n\t\t'inverse_relationship' => true,\n\t\t'limit' => 0,\n\t));\n\t$dashboards->setIncrementOffset(false);\n\t\n\tforeach ($dashboards as $dashboard) {\n\t\t$dashboard->delete();\n\t}\n\n\telgg_set_ignore_access($ia);\n}", "public function destroy($id)\n {\n $role= Role::findOrFail($id);\n if($role->eliminar==\"yes\")\n {\n $role->delete(); \n }\n return redirect()->route('roles.index');\n }", "public function clearCache()\n {\n $cacheDriver = $this->entityManager->getConfiguration()->getResultCacheImpl();\n $cacheDriver->delete('role_data');\n }", "public function destroy()\n\t{\n\t\t/* Delete Single Record */\n\t\tif(Input::get('name') == 'destroy')\n\t\t{\n\t\t\t$role_id = Input::get('id');\n\t\t\t$acl_group_permission_delete = AclGroupPermission::where('group_id',$role_id)->delete();\n\t\t\tAclGroup::where('id','=',$role_id)->delete();\n\t\t}\n\t\t/* Delete Multiple Records */\n\t\telse\n\t\t{\n\t\t\t$ids = Input::get('id');\n\t\t\tAclGroup::whereIn('id',$ids)->forceDelete();\n\t\t\tforeach ($ids as $id) {\n\t\t\t\t$acl_group_permission_delete = AclGroupPermission::where('group_id',$id)->delete();\n\t\t\t}\n\t\t}\n\n\t\treturn Response::json(array('msg' => 'AkdnUser deleted permanently','success'=>true), 200);\n\t}", "public function admin_remove($id){\n\t\t\t$user = User::find($id);\n\t\t\t$role_id = $user->role_id;\n\t\t\tif($user->is_deleted==1){\n\t\t\t\t$user->is_deleted = 0;\n\t\t\t\t}else {\n\t\t\t\t$user->is_deleted = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif($user->save()){\n\t\t\t\tSession::flash('message', 'Company account has been deleted successfully.');\n\t\t\t\treturn Redirect::to('admin/users/'.$role_id);\n\t\t\t}\n\t\t\t\n\t\t}", "public function delIdentity()\n\t{\n\t\t// Verifier l'adhesion\n\t\t$q = new Bn_query('u2a', '_asso');\n\t\t$q->setFields('u2a_adherentid');\n\t\t$q->addWhere('u2a_userid='. $this->getVal('id', -1));\n\t\t$adheId = $q->getOne();\n\t\t$q->deleteRow();\n\t\t$q->setTables('adherents');\n\t\t$q->deleteRow('adhe_id=' . $adheId);\n\t}", "public function deleteData()\n {\t\t\n \t$arrayId = $this->getAllUserId($this->readFromLocalFile());\n \tforeach($arrayId as $id)\n \t{\n \t\t$user = User::find()->where(['id' => $id])->one();\n \t\tif($user)\n \t\t{\n \t\t\t$user->delete();\n \t\t}\n \t}\n \t$this->deleteSelectedLocalItems('user');\n }", "public function destroy($id)\n {\n DB::table(\"roles\")->where('id',$id)->delete();\n return redirect()->route('role.index')\n ->with('success','Role deleted successfully');\n }", "public function destroy($id)\n {\n // Gate::authorize('haveaccess', 'rol.destroy');\n $user= Role::find($id);\n $user->delete();\n\n return redirect('sistema/iniciorole')->with('success','Haz eliminado un rol con exito');\n }", "public function forceDeleted(Role $role)\n {\n }", "public function removeAction()\n {\n $modules = $this->module->fetchAll(\" groupmodule_id = \".$this->_getParam('id'));\n foreach($modules as $key=>$row)\n { \n $this->module->removemodule(APPLICATION_PATH.\"/modules/\".$row->module_name);\n }\n \n $current = $this->gmodule->find($this->_getParam('id'))->current();\n $current->delete(); \n \n $message = \"Data Deleted Successfully\";\n \n $this->_helper->flashMessenger->addMessage($message);\n die;\n }", "public function destroy($id)\n {\n DB::table(\"roles\")->where('id',$id)->delete();\n $response = array('status' => 200,'message' => 'Role deleted successfully.','success' => 'OK','location' => '/roles/index');\n echo json_encode($response);\n }", "public function delete(){\n\t\t$landlord= new Core_Model_Landlord( $this->dto );\n\t\tif( is_numeric( $company->id) && (int)$company->id > 0) {\n\t\t\t$company->delete( array( \"id\" => $this->dto->id) );\n\t\t\t}\n\t}", "function delete_role($roles_id)\n {\n return $this->db->delete('roles',array('roles_id'=>$roles_id));\n }", "function ajaxDeleteMaster($id){ $sqlselect = \"SELECT id_data from ps.tdata where id_master = '$id'\";\n $result = $this->db->query($sqlselect)->result_array();\n\n if(count($result) > 0){\n echo 'failed';\n }else{\n //del data\n $sqldelete = \"DELETE FROM ps.tmaster WHERE id='$id';\";\n $sqldelete .= \"DELETE FROM ps.tappr WHERE id='$id';\";\n\n $this->db->query($sqldelete);\n echo 'ok';\n }\n }", "public function destroy($id)\n {\n //$post = jobrole::find($id);\n $post = jobrole::where(\"id\",$id)->delete();\n\n // $this->get_all_data = jobrole::where(\"id\", $id)->update(array(\n // \"job_role\" => $request['job_role'],\n // \"salary\" => $request['salary'],\n // \"team_name\" => $request['team_name']\n // ));\n\n return response(array(\"response\" => \"Delete Role Successfully\"),200)->header(\"Content-Type\",\"application/json\");\n // if($this->post == 1){\n // }else{\n // return response(array(\"response\" => \"Delete Failed \"),400)->header(\"Content-Type\",\"application/json\");\n // }\n }", "public function delete()\n {\n // Remove all role associations\n $this->roles()->detach();\n\n // Delete the permission\n $result = parent::delete();\n\n return $result;\n }", "public function testDeleteAuthorizationSubjectDivisionRole()\n {\n }", "public function testDeleteWontEffectOtherRoleWithSamePermission()\n {\n\n $this->createDummyRole(\"1\");\n $this->createDummyRole(\"2\");\n\n $this->call('POST', '/api/role', array(\n 'action' => $this->deleteAction,\n 'id' => 1,\n ));\n\n $this->assertDatabaseMissing('roles', [\n 'id' => 1,\n 'name' => $this->testRoleName . \"1\",\n 'description' => $this->testRoleDesc . \"1\"\n ]);\n\n $this->assertDatabaseHas('roles', [\n 'id' => 2,\n 'name' => $this->testRoleName . \"2\",\n 'description' => $this->testRoleDesc . \"2\"\n ]);\n\n $this->assertDatabaseMissing('role_permission', [\n 'role_id' => 1,\n 'permission_id' => 1,\n ]);\n\n $this->assertDatabaseHas('role_permission', [\n 'role_id' => 2,\n 'permission_id' => 1,\n ]);\n }", "public function destroy($id)\n {\n //\n \\DB::table('role')->where('id', '=', $id)->delete();\n return 1;\n }", "public function destroy($id)\n {\n $role = Role::find($id);\n $role->syncPermissions([]);\n \n $users = User::whereHas(\"roles\", function($q) use ($id){ $q->where(\"id\", $id); })->get();\n foreach($users as $user){\n $user->removeRole($role->name); \n } \n \n $role->delete();\n \n return redirect()->route('roles.index')\n ->with('success','Role deleted successfully!');\n }", "public function destroy() {\n\n /* Right mgmt start */\n $rightId = 77;\n $currentChannelId = $this->rightObj->getCurrnetChannelId($rightId);\n if (!$this->rightObj->checkRights($currentChannelId, $rightId))\n return 'You are not authorized to access.';\n /* Right mgmt end */\n\n\n if (isset($_GET['option'])) {\n $id = $_GET['option'];\n }\n $delArr = explode(',', $id);\n\n foreach ($delArr as $d) {\n $valid = '0';\n $deleteAl = [\n\n 'valid' => $valid,\n 'updated_at' => date('Y-m-d H:i:s')\n ];\n DB::table('magazine')\n ->where('magazine_id', $d)\n ->update($deleteAl);\n \n $deleteAl = [\n\n 'status' => $valid,\n 'updated_at' => date('Y-m-d H:i:s')\n ];\n DB::table('magazine_list')\n ->where('m_id', $d)\n ->update($deleteAl); \n\n }\n return;\n }", "public function destroy(Role $role)\n {\n //\n }", "public function destroy(Role $role)\n {\n //\n }", "public function destroy(Role $role)\n {\n //\n }", "public function delMenu($data){\n\n\t\treturn $this->where('id', $data['id'])->delete();\n\t}", "public function deleteUser($role,$id)\n {\n // $delete_user_role = DB::table('user_roles')->where('user_id',$id)->delete();\n $delete_from_user_table = DB::table('users')->where('user_id',$id)->delete();\n $user = UserInformation::find($id);\n $user->delete();\n return redirect(route('admin.list_user',['role'=>$role]))->with('success','Delete user successfully.');\n\n }", "function deleteRole($id)\n {\n if ($this->isAdmin() == TRUE) {\n echo(json_encode(array('status' => 'access')));\n } else {\n $roleId = $id;\n $result = $this->user_model->deleteRole($roleId);\n\n if ($result > 0) {\n echo(json_encode(array('status' => TRUE)));\n } else {\n echo(json_encode(array('status' => FALSE)));\n }\n redirect('roleListing');\n\n }\n }", "public function destroy($id)\n {\n if ($id < 4) {\n return redirect('admin/role');\n }\n // $this->role->delete($id);\n // return redirect('admin/role')->with('flashMessageSuccess','The role has successfully deleted.');\n return redirect('admin/role')->with('flashMessageAlert','The role can not be deleted !');\n }", "public function destroy($uid)\n\t{\n\t\tDB::beginTransaction();\n\t\ttry {\n\n\t\t\tif(!empty($uid)):\n\n\t\t\t\t$user = new Permission;\n\t\t\t\t$user->deleteMaster($uid);\n\t\t\t\t\n\t\t\telse:\n\t\t\t\tthrow new Exception(\"You didn't select any data to delete\");\t\t\t\t\n\t\t\tendif;\n\n\t\t\tDB::commit();\n\t\t\t// return Redirect( Request::header('referer') )->with('flash_success', 'User(s) has been deleted!');\n\t\t\treturn Redirect()->back()->with('flash_success', 'Data(s) has been deleted!');\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\tDB::rollback();\n\t\t\treturn Redirect::back()->withInput()->with('flash_error', $e->getMessage());\n\t\t}\n\t}", "public function actionDelete($masterlist_id)\n\t{\n\t\t$model = $this->findModel($masterlist_id);\n\t\t$model->flag = 0;\n\t\tif($model->save())\n\t\t{\n\t\t\treturn $this->redirect(['index']);\n\t\t}\n\t}", "public function destroy($id)\n {\n DB::table(\"roles\")->where('id',$id)->delete();\n return redirect()->route('admin.roles')\n ->with('success','Permissão deletada com sucesso');\n }", "public function actionDelete($id)\n\t{\n\t \n\t\n\t\t$model = $this->loadModel($id);\n\t\t$role = $model->role;\n\t\tif($model->role=='2')\n\t\t{\n\t\tReviews::model()->deleteAll(\"review_itemid='\" .$id. \"'\");\n\t\tReviews::model()->deleteAll(\"review_by='\" .$id. \"'\");\n\t\tCart::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t}\n\t\telse if($model->role=='3')\n\t\t{\n\t\t Guide::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Guidetemple::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Reviews::model()->deleteAll(\"review_itemid='\" .$id. \"'\");\n\t\t Reviews::model()->deleteAll(\"review_by='\" .$id. \"'\");\n\t\t Cart::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Images::model()->deleteAll(\"item_id='\" .$id. \"'\");\n\t\t}\n\t\telse if($model->role=='4')\n\t\t{\n\t\t Iyer::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Iyerpoojas::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Reviews::model()->deleteAll(\"review_itemid='\" .$id. \"'\");\n\t\t Reviews::model()->deleteAll(\"review_by='\" .$id. \"'\");\n\t\t Cart::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Images::model()->deleteAll(\"item_id='\" .$id. \"'\");\n\t\t}\n\t\telse\n\t\t{\n\t\t}\n\t\t$model->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('/user/manage/role/'.$role));\n\t}", "public function destroy(MasterBarang $master)\n {\n //\n }", "public function postDeleteRole(DeleteRequest $request)\n {\n $id = \\Input::get('id');\n // $student = Student::find($id);\n $gen_user_role = GenUserRole::find($id);\n $gen_user_role->delete();\n return redirect('gen_user');\n }", "public function delete_promocode(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect(ADMIN_PATH);\n\t\t}else {\n\t\t\t$promocode_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('id' => $promocode_id);\n\t\t\t$this->promocodes_model->commonDelete(PROMOCODES,$condition);\n\t\t\t$this->setErrorMessage('success','Promocode deleted successfully');\n\t\t\tredirect(ADMIN_PATH.'/promocodes/display_promocodes');\n\t\t}\n\t}", "public function rm_whole() {\n\t\t$this->rm_controller();\n\t\t$this->rm_model();\n\t\t$this->rm_entity();\n\t}", "public function destroy($id)\n {\n Role::where('id',$id)->delete();\n return redirect()->route('listRole');\n }", "public function testPermissionOwnGotDeleted()\n {\n $this->createDummyRole();\n\n // Delete the permission\n $this->call('POST', '/api/permissions', array(\n 'action' => $this->deleteAction,\n 'id' => 1,\n ));\n\n $this->assertDatabaseHas('roles', [\n 'id' => 1,\n 'name' => $this->testRoleName,\n 'description' => $this->testRoleDesc\n ]);\n\n $this->assertDatabaseMissing('role_permission', [\n 'role_id' => 1,\n 'permission_id' => 1.\n ]);\n\n $this->assertDatabaseHas('role_permission', [\n 'role_id' => 1,\n 'permission_id' => 2,\n ]);\n }", "public function destroy($id)\n {\n DB::table(\"roles\")->where('id',$id)->delete();\n return redirect()->route('roles.index')\n ->with('success','Role deleted successfully');\n }", "public function destroy(Role $role)\n {\n\n //Si es un rol permiso administrativo no permitir eliminarlo\n if ($role->name=='admin') {\n return response()->json(['data' => 'Acceso denegado'], 403);\n }\n\n $role->delete();\n return response()->json(['data' => $role], 200);\n\n }", "public function destroy(Role $role)\n {\n //\n DB::beginTransaction();\n try{\n $role->delete();\n DB::commit();\n return redirect('roles');\n }catch(\\Exception $e){\n DB::rollBack();\n return redirect('roles');\n }\n }", "public function delete()\n {\n $this->getMasterApiClient()->deleteSubUser($this->getSubAccountUsername());\n LaravelLog::info('Sub account deleted: ' . $this->getSubAccountUsername());\n parent::delete();\n }", "public function executeDelete()\n {\n if($this->hasRequestParameter('ids')){\n $roles = array_reverse(RolePeer::retrieveByPKs(json_decode($this->getRequestParameter('ids'))));\n\n foreach($roles as $role){\n\t$role->delete();\n }\n\n }elseif($this->hasRequestParameter('id')){\n $role = RolePeer::retrieveByPk($this->getRequestParameter('id'));\n $role->delete();\n }\n\n $this->msg_alert = array('info', $this->getContext()->getI18N()->__(\"Rol borrado.\"));\n return $this->renderComponent('roles', 'list');\n }", "function removeRole( $name ) {\n $d = loadDB();\n \n $found = false;\n foreach ($d['roles'] as $key => $role) {\n if ($name == $role['name']) {\n unset($d['roles'][$key]);\n $found = true;\n }\n }\n if ($found) {\n audit( \"removeRole\", $name );\n saveDB( $d );\n }\n }" ]
[ "0.7020674", "0.68856496", "0.6879654", "0.6687952", "0.6565636", "0.6551272", "0.65369695", "0.6468845", "0.6405283", "0.6384726", "0.6365593", "0.635362", "0.63266987", "0.62496334", "0.62468845", "0.6219779", "0.61988425", "0.6189037", "0.61869925", "0.6175382", "0.6174534", "0.61708015", "0.61708015", "0.6144643", "0.6142707", "0.6141576", "0.61382926", "0.6131824", "0.6112116", "0.6106471", "0.61055154", "0.6095353", "0.6081918", "0.6075137", "0.6059834", "0.60591346", "0.6056048", "0.60546905", "0.602109", "0.60206085", "0.6017331", "0.60057247", "0.60021317", "0.600165", "0.59949577", "0.5988399", "0.597903", "0.5969307", "0.5969204", "0.5955596", "0.5949324", "0.5948767", "0.5947353", "0.59411335", "0.59405166", "0.59337103", "0.5927871", "0.5924673", "0.5922609", "0.58966875", "0.58954364", "0.58922523", "0.5880856", "0.587717", "0.5870042", "0.586009", "0.58522743", "0.5849688", "0.584574", "0.5845142", "0.58435667", "0.5839824", "0.5839327", "0.5837722", "0.58281237", "0.5827214", "0.5824483", "0.5815677", "0.5815677", "0.5815677", "0.58119005", "0.5809183", "0.58058095", "0.5803118", "0.58023775", "0.579714", "0.57964015", "0.57960093", "0.57868916", "0.57865983", "0.57842845", "0.57818824", "0.57733536", "0.5773268", "0.57716495", "0.5761502", "0.57474655", "0.57369304", "0.5732878", "0.57316035" ]
0.79997045
0
Roles Access Get Role Access Data for Edit screen
public function getRoleAccessSingleData() { $RoleAccessID= $this->input->post('RoleAccessID'); $RoleAccessData = $this->system_structure_m->getRoleAccessSingleData($RoleAccessID); echo json_encode($RoleAccessData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_roles_data()\n {\n }", "function get_editable_roles()\n {\n }", "public function edit($id)\n{\n $user = User::find($id);\n $roles = Role::pluck('name','name')->all();\n $userRole = $user->roles->pluck('name','name')->all();\n return [$user,$roles,$userRole];\n}", "public function edit($id)\n{\n$user = User::find($id);\n$roles = Role::pluck('name','name')->all();\n$userRole = $user->roles->pluck('name','name')->all();\nreturn view('users.edit',compact('user','roles','userRole'));\n}", "public function edit($id)\n { \n $data=Role::all();\n \n $arr=[];\n foreach ($data as $key => $value) {\n //array_push($arr, $value->access_name);\n \n $myarr[$value->id]=$value->access_name;\n \n # code...\n }\n\n $user=User::findOrFail($id);\n\n return view('pages.admin.adminuser.edituser',compact(['user','myarr']));\n // return $user;\n\n\n //\n }", "public function edit(Roles $roles)\n {\n //\n }", "public function edit(Role $role)\n {\n // Gate::authorize('haveaccess', 'rol.edit');\n $permission_role=[];\n \n foreach($role->permissions as $permission){\n $permission_role[]=$permission->id;\n\n }\n \n $permissions=Permission::get();\n return view('Roles.editr', compact('permissions', 'role','permission_role'));\n }", "public function & GetRoles ();", "public function getRoles(){\n $db = new MainModel();\n $query = \"SELECT r.id as idRol, r.name as nameRol from roles as r\";\n return $response = $db->consultQueryAll($query);\n }", "public function edit($id) {\r\n $role = Role::find($id);\r\n $permission = Permission::get();\r\n $rolePermissions = DB::table(\"permission_role\")->where(\"permission_role.role_id\", $id)\r\n ->pluck('permission_role.permission_id', 'permission_role.permission_id')->toArray();\r\n\r\n return view('admin.roles.edit',compact('role','permission','rolePermissions'));\r\n }", "public function edit($id)\r\n {\r\n //\r\n $categories=$this->permission_repository->getTreeData();\r\n $role = AdminRole::find($id);\r\n $permissions_by_role=PermissionRole::where('role_id',$id)->get();\r\n return view('admin.role.edit',compact('categories','permissions_by_role'))->with('role', $role);\r\n }", "public function edit($id)\n { \n $data = [\n 'permissions' => [\n 'user-create',\n 'user-edit',\n 'user-destroy',\n 'user-show',\n 'user-role-assign',\n \n 'role-create', \n 'role-edit', \n 'role-destroy',\n 'role-show',\n \n 'campaign-create',\n 'campaign-edit',\n 'campaign-destroy', \n 'campaign-show'\n ],\n 'role' => Role::findOrFail($id)\n ];\n\n return view('modules.roles.edit')->with($data);\n }", "public function edit($id)\n {\n \t$role= Role::find($id);\n \t$permission=Permission::get();\n \t$role_permission=DB::table('permissions')->join('permission_role','id','=','permission_role.permission_id')->select('permissions.id','permissions.name','permissions.display_name')->where('permission_role.role_id','=',$id)->get();\n \t//echo($role_permission);\n\n \treturn view('admin.roles.editrole',compact('role','permission','role_permission'));\n }", "public function getEdit($id)\n {\n $params = array('roles' => DB::table('roles')->lists('name', 'id'));\n $this->setParamsForMethod('getEdit', $params);\n\n return parent::getEdit($id);\n }", "public function edit($id) {\n $id = Crypt::decryptString($id);\n view()->share('module_title', 'Edit Roles');\n view()->share('module_action', array(\n \"back\" => array(\"title\" => '<b><i class=\"icon-arrow-left52\"></i></b> '.trans(\"comman.back\"), \"url\"=>route('roles.index'),\n \"attributes\"=> array(\"class\" => \"btn bg-blue btn-labeled heading-btn\",'title'=>'Back')),\n ));\n // Fetch the role object\n // $id = $this->decode($hash);\n // $role = $this->roleRepository->findById($id);\n\n $role = Role::find($id);\n if ($role) {\n $users_permission = $this->getPermissionJsonToArray(json_decode($role->permission));\n $all_permission = $this->getPermissionArrayToNameWise((new Permissions)->getPermissions());\n return view('roles.edit', compact('role', 'users_permission', 'all_permission'));\n }\n Flash::error(trans(\"comman.invalid_role\"));\n return redirect()->back();\n }", "abstract protected function getRoles();", "public function edit($id)\n {\n $model = AdminRole::find($id);\n\n if($model)\n {\n $record = $model->toArray();\n $formMode = \"edit\";\n $formSubmitUrl = \"/\".request()->path();\n\n $urls = [];\n $urls[\"addUrl\"]=URL::to(\"/admin/admin_role/create\");\n $urls[\"listUrl\"]=URL::to(\"/admin/admin_role\");\n $urls[\"historyUrl\"]=URL::to(\"/admin/history/\");\n\n $this->repository->setPageUrls($urls);\n\n $systems = AdminPermissionSystem::query()->where(\"system_status\", \"=\", \"1\")->get();\n\n $systemPermissions = [];\n if(count($systems)>0)\n {\n $adminPermSysRepo = new AdminPermissionSystemRepository();\n $allSystemCurrPerms = AdminRoleRepository::getAllSystemPermissionData($id);\n foreach ($systems as $key => $system)\n {\n $systemModules = $system->permissionModules()->get()->toArray();\n $systemModules = $adminPermSysRepo->getSystemPermissionModules($systemModules);\n\n $system[\"modules\"] = $systemModules;\n $system[\"curr_permissions\"] = [];\n if(isset($allSystemCurrPerms[$system->id]))\n {\n $system[\"curr_permissions\"] = $allSystemCurrPerms[$system->id];\n }\n\n $systems->$key = $system;\n }\n\n $systemPermissions = $systems->toArray();\n }\n\n return view('admin::admin_role.create', compact('formMode', 'formSubmitUrl', 'record', 'systemPermissions'));\n }\n else\n {\n abort(404, \"Requested record does not exist.\");\n }\n }", "public function edit()\n {\n $roles = new Role();\n $account = new User();\n\n if (!$account->find($_SESSION['user'])) {\n Abort::notFound();\n }\n\n $view = new View('account/edit.twig');\n return $view->setData([\n 'roles' => $roles->get(),\n 'account' => $account->find($_SESSION['user'])\n ])->build();\n }", "public function edit($id)\n {\n $role = Role::find($id);\n $permission = Permission::get();\n $rolePermissions = DB::table(\"role_has_permissions\")->where(\"role_has_permissions.role_id\",$id)\n ->pluck('role_has_permissions.permission_id','role_has_permissions.permission_id')\n ->all();\n return view('role.edit',compact('role','permission','rolePermissions'));\n }", "public function edit($id)\n {\n $role = Role::find($id);\n $permissions = Permission::get(); \n $rolePermissions = $role->permissions()->pluck('id','id')->toArray();\n\n return view('admin.users_block.roles.edit',compact('role','permissions','rolePermissions'));\n }", "public function actionRoles()\n\t{\n\t\tYii::app()->user->rightsReturnUrl = array('authItem/roles');\n\t\t\n\t\t$dataProvider = new RAuthItemDataProvider('roles', array(\n\t\t\t'type'=>CAuthItem::TYPE_ROLE,\n\t\t\t'sortable'=>array(\n\t\t\t\t'id'=>'RightsRoleTableSort',\n\t\t\t\t'element'=>'.role-table',\n\t\t\t\t'url'=>$this->createUrl('authItem/sortable'),\n\t\t\t),\n\t\t));\n\n\t\t// Render the view\n\t\t$this->render('roles', array(\n\t\t\t'dataProvider'=>$dataProvider,\n\t\t\t'isBizRuleEnabled'=>$this->module->enableBizRule,\n\t\t\t'isBizRuleDataEnabled'=>$this->module->enableBizRuleData,\n\t\t));\n\t}", "public function edit($id)\r\n {\r\n\r\n $user = User::find($id);\r\n $roles = Role::pluck('display_name','id');\r\n //dd($roles);\r\n $userRole = $user->roles->pluck('id','id')->toArray();\r\n //dd($userRole);\r\n $userRole = json_decode(json_encode($userRole), true);\r\n return view('Admin.AdminUser.admin_user_edit', compact('user','roles','userRole'));\r\n }", "public function edit($id)\n {\n $data = Pages::get();\n $role = Role::find($id);\n $permission = Permission::get();\n $rolePermissions = DB::table(\"role_has_permissions\")->where(\"role_has_permissions.role_id\",$id)\n ->pluck('role_has_permissions.permission_id','role_has_permissions.permission_id')->all();\n return view('pages.formRoles',compact('data','role','permission','rolePermissions'));\n }", "public function edit($id)\n {\n $data = [];\n $permissions = Permission::get(); \n $roles = Role::findOrFail($id);\n\n $getAllPermissionOfRole = DB::table('permission_role')->where('role_id', $id)->pluck('permission_id');\n\n $data['roles'] = $roles;\n $data['permissions'] = $permissions;\n $data['getAllPermissionOfRole'] = $getAllPermissionOfRole;\n // dd($getAllPermissionOfRole);\n return view('admin.roles.edit', $data);\n\n }", "public function edit($roles_id)\n { \n try {\n $roles = Role::find($roles_id); //Fetch role data\n $permission_role = [];\n foreach($roles->permission as $permission) { //create role permission data\n $permission_role[] = $permission->id;\n }\n \n $data = [\n 'action' => route('update.roles'),\n 'page_title' => 'Roles',\n 'title' => 'Edit roles',\n 'roles_id' => $roles->id,\n 'name' => ($roles->name) ? $roles->name : old('name'),\n 'permissions' => Permission::all(),\n 'permission_role' => $permission_role,\n 'modules' => Module::with('Permission')->get(),\n ];\n return $data;\n } catch(\\Exception $err){ \n Log::error('message error in edit on RoleRepository :'. $err->getMessage());\n return back()->with('error', $err->getMessage());\n }\n }", "public function edit($id)\n {\n $role = Role::findOrFail($id);\n $permissionsArray = Permission::where('guard_name', $role->guard_name)->get();\n\n // begin the iteration for grouping module name\n $permissions = [];\n $modulefunctionArray = [];\n $result = [];\n foreach ($permissionsArray as $key => $module) {\n $modulefunctionArray[$module->module] = ['module' => $module->module, 'guard_name' => $module->guard_name, 'id' => $module->id];\n\n }\n foreach ($modulefunctionArray as $keyModule => $value) {\n $moduleFunction = [];\n $moduleName = $value['module'];\n foreach ($permissionsArray as $key => $module) {\n if ($module->module == $moduleName) {\n $moduleFunction[] = ['id' => $module->id,'module' => $module->module,'name' => $module->name];\n }\n }\n $permissions[] = ['module' => $value['module'],'id' => $value['id'], 'module_functions' => $moduleFunction];\n }\n\n if (View::exists('roles.edit')) {\n return view('roles.edit', compact('role', 'permissions'));\n } else {\n return view('laravel-permission::roles.edit', compact('role', 'permissions'));\n }\n }", "public function edit($id)\n {\n $role = Role::where('id', $id)->first();\n return $role;\n }", "public function edit($id)\n {\n $role = Role::findById($id);\n $group_name = User::groupname();\n $all_permissions = Permission::all();\n return view('backend.pages.roles.edit',compact('group_name','role','all_permissions'));\n }", "function getRoles () {\n return array(\"user.image.edit\",\"user.image.view\");\n }", "public function edit($id) {\n //\n $role = Role::find($id);\n $permissions = Permission::all();\n $role_permissions = $role->perms()->pluck('id', 'id')->toArray();\n return view('cpanel.role.edit', compact(['role', 'role_permissions', 'permissions']));\n }", "public function edit($id)\n {\n return $this->response->item(Role::findOrFail($id));\n }", "public function edit($id)\n { \n if($id == '1' || $id == '3' || $id == '8')\n {\n return redirect()->route('roles.index')\n ->with('error','This Role cannot be Updated');\n }\n \n $role = Role::find($id);\n $permission = Permission::get();\n $rolePermissions = DB::table(\"role_has_permissions\")->where(\"role_has_permissions.role_id\",$id)\n ->pluck('role_has_permissions.permission_id','role_has_permissions.permission_id')\n ->all();\n\n \n return view('roles.edit',compact('role','permission','rolePermissions'));\n }", "public function edit($id)\n {\n $role= Role::findOrFail($id);\n $permissions_role=[];\n foreach($role->permissions as $permission)\n {\n $permissions_role[]=$permission->id;\n }\n //return $permissions_role;\n $permissions=Permission::get();\n $put = True;\n $action = route('roles.update', $id);\n return view('roles.edit', [\n 'role' => $role,\n 'action' => $action,\n 'put' => $put,\n 'permissions'=>$permissions,\n 'permissions_role'=>$permissions_role\n ]);\n }", "public function getEdit($id) {\n \n $action = 1;\n $gen_user = GenUser::find($id);\n $person = Person::find($gen_user->person_id);\n $gen_role_list = GenRole::all();\n $employee_type_list = EmployeeType::all();\n\n // $gen_user_role_list = GenUserRole::where('gen_user_id','=',$gen_user->id)->lists('gen_role_id');\n \n $gen_user_role_list = GenUserRole::join('gen_role', 'gen_user_role.gen_role_id', '=', 'gen_role.id')\n ->join('gen_user', 'gen_user_role.gen_user_id', '=', 'gen_user.id')\n ->join('person', 'gen_user.person_id', '=', 'person.id')\n ->where('gen_user_role.gen_user_id', '=', $id)\n ->select('gen_user_role.id', 'gen_role.id as gen_role_id','gen_user.id as gen_user_id', 'gen_role.name', 'person.last_name', 'person.first_name', 'person.middle_name')\n ->get();\n\n //var_dump($gen_user_role_list);\n return view('gen_user.edit', compact('gen_user', 'gen_role_list', 'gen_user_role_list', 'action', 'person','employee_type_list'));\n }", "public function getRole() {}", "public function getRole();", "public function getRole();", "public function edit($id)\n\t{\n\t\t$role = Role::find($id);\n\n\t\t$permissions = Permission::all();\n\n\t\t$rolePermissions = $role->permissions()\n ->pluck('permission_role.permission_id', 'permission_role.permission_id')\n ->all();\n\n\t\treturn view('roles.edit', compact('role', 'permissions', 'rolePermissions'));\n\t}", "public function loadroledataentryAction(){\n $roles=Doctrine_Query::create()\n\t ->select(\"r.ID, r.role\")\n\t ->from(\"Roles r\")\n\t ->where(\"r.ID=?\",Constants::DATAENTRY_INTERNO)\n \t ->execute(null,Doctrine::HYDRATE_ARRAY);\n $this->emitTableResult($roles);\n }", "public function edit($id)\n {\n //\n $role = Role::findOrFail($id);\n $permissions = Permission::get()->pluck('name','name');\n return view(\"role-permission.role.edit\", compact('role','permissions'));\n }", "public function edit($id)\n {\n $s= session_n_role_chk();\n $role = role::findOrFail($id);\n $MenuRole = MenuRole::where('roleid', $id)->get();\n $ms = menu_dropdown(\"EDIT\", $MenuRole);\n //dd($rs['select']); die;\n return view('admin.editrole')->with(compact('role'))->with(compact('ms'));;\n }", "public function getRoles()\n {\n #obsolete, I don't wnat user roles, I want the permission those roles are linked to\n # so I just need a getPermissions once, store those constants in a small session array\n #$roles = $this->roles;\n\n #d($roles);\n\n #foreach ($roles as $role) {\n # echo $role->name;\n #}\n }", "public function edit($id)\n {\n $role = Role::find($id);\n $permission = Permission::get();\n $rolePermissions = DB::table(\"permission_role\")->where(\"permission_role.role_id\",$id)\n ->lists('permission_role.permission_id','permission_role.permission_id');\n return view('admin::roles.edit',compact('role','permission','rolePermissions'));\n }", "public function getEdit($id)\n {\n $user = User::where('id', $id)->first();\n\n if(is_null($user)) {\n abort(404);\n }\n\t\t\n\t\t$role = Role::select('id', 'name')->get();\n\t\tforeach($role as $data)\n\t\t{\n\t\t\t$roles[$data->id] = $data->name;\n\t\t}\n\n $data = [\n 'user' \t\t=> $user,\n\t\t\t'roleList'\t=> $roles,\n\t\t\t'selected'\t=> $user->roles->first()->id\n ];\n\n return view('dashboard/user/edit')->with($data);\n }", "public function edit($id) \n {\n $roles = Role::get()->pluck('name', 'name');\n\n $user = User::findOrFail($id);\n\n $data = $user->roles()->pluck('name');\n $selectedRoles = $data[0];\n\n return view('admin.users.edit', compact('user', 'roles','selectedRoles'));\n }", "public function edit($id)\n {\n //\n $data = \\DB::table('role')->where(['id'=>$id])->get();\n// dd($data[0]);\n return view('admin.role.edit', ['data'=>$data]);\n }", "public function edit($id)\r\n {\r\n $roles = Role::whereNotIn('id',[1,2,3])->get(); \r\n foreach($roles as $role){\r\n $data['roles'][$role['id']] = $role['name'];\r\n }\r\n $data['user'] = User::findOrFail($id);\r\n return view('admin.editor_edit',['data'=>$data]);\r\n }", "protected function getRoles() {\n return $this->roleStorage->loadMultiple();\n }", "public function edit($id)\n {\n $role = $this->entity->find($id);\n\n abort_unless($role, 404);\n\n $rolePermissions = DB::table(\"role_has_permissions\")->where(\"role_has_permissions.role_id\",$id)\n ->pluck('role_has_permissions.permission_id','role_has_permissions.permission_id')\n ->all();\n\n return view('admin::core.role.edit', [\n 'role' => $role,\n 'permissions' => Permission::get(),\n 'rolePermissions' => $rolePermissions\n ]);\n }", "public function edit($id)\n {\n //\n $roles = $this->role->all();\n $user = $this->user->findOrFail($id);\n $listRoleOfUser = DB::table('role_user')->where('user_id',$id)->pluck('role_id');\n\n return view('user.edit',compact('roles','user','listRoleOfUser'));\n// return $user->id;\n }", "public function edit($id)\n {\n $dataRoles= Role::all();\n $dataUser=User::find($id);\n return view('rolesUsers.add_user_role')\n ->with('dataRoles', $dataRoles)\n ->with('dataUser', $dataUser);\n }", "public function edit($id)\n {\n $permissions = Permission::all();\n $roleInfo = role::findOrFail($id);\n return view('cpanel.roles.edit', ['roleInfo' => $roleInfo, 'permissions' => $permissions]);\n }", "public function displayRoles()\n { \n\n $user_data = $this->UserOrganisation_model->getAllByGet();\n foreach($user_data as $data){\n $email = $data->email;\n $roles = $this->UserOrganisation_model->findRole($data->id);\n if(count($roles)){\n foreach($roles as $role){\n $data = $role->name;\n $roleId = $role->pivot->role_id;\n $userId = $role->pivot->user_id;\n $arr_data = array('id'=>$roleId,'userId'=>$userId,'role'=>$data,'email'=>$email);\n $datas[]=$arr_data;\n }\n }else{\n $datas=$roles;\n }\n }\n return view('acl\\revoke_role', ['users' => $datas]);\n }", "public function edit($id)\n {\n $role=Role::where('id',$id)->first();\n return view('Backend.roles.edit',['roles'=>$role]);\n }", "public function edit($id) {\n $role = Role::findOrFail($id);\n $permissions = Permission::all();\n\n return view('admin.roles.edit', compact('role', 'permissions'));\n }", "public function saveRoles($data);", "function roles_get() {\n\n $result_set = $this->model_all->getTableDataInArray(\"app_roles\", array(\"id!=\" => \"1\"), \"id,role_name,short_form\");\n if (($result_set['total_rows']) > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"roles\"] = $result_set['records'];\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"Detais Not Found\";\n $this->response($result, 200);\n exit;\n }\n }", "public function getRolesData()\n {\n $em = $this->getEntityManager();\n $query = $em->createQuery(\n 'SELECT p\n FROM Vlreleases\\UserBundle\\Entity\\Role p'\n \n );\n $result = $query->getResult();\n \n return $result;\n }", "public function getRoles()\n {\n $roles = Role::all();\n\n return Datatables::of($roles)\n ->editColumn('routes', function ($role) {\n return htmlentities(strlen($role->getOriginal('routes')) > 50 ? substr($role->getOriginal('routes'), 0, 50) : $role->getOriginal('routes'));\n })\n ->addColumn('actions', function ($role) {\n $editBtn = '<a style=\"margin-right: 0.2em;\" href=\"' . url('admin/roles/' . $role->id . '/edit/') . '\" title=\"Edit\"><i class=\"fa fa-2 fa-pencil\"></i></a>';\n $deleteBtn = '';\n if ($role->name != 'Admin') {\n $deleteBtn = '&nbsp;<a href=\"' . url('admin/roles/' . $role->id) . '\" class=\"message_box text-danger\" data-box=\"#message-box-delete\" data-action=\"DELETE\" title=\"Permanent Delete\"><i class=\"fa fa-2 fa-remove\"></i></i></a>';\n }\n return $editBtn . $deleteBtn;\n })->make(true);\n }", "public function get_role()\n {\n }", "public function edit($id)\n {\n $user = User::find($id);\n $roles = Role::pluck('name','name')->all();\n $userRole = $user->roles->pluck('name','name')->all();\n \n\n\n return view('users.edit',compact('user','roles','userRole'));\n }", "public function edit($id)\n {\n $user = User::findOrFail($id);\n $roles = Role::all();\n $rol_actual = DB::select(\"select model_has_roles.role_id as id\n from model_has_roles\n where model_has_roles.model_id = \".$id);\n //return $rol_actual[0]->id;\n return view('forms.formUedit', compact('user','roles','rol_actual'));\n }", "public function edit($id)\n {\n // check authentication\n if (!Auth::user()->can('role.update')){\n abort(403,'Unauthorized Action');\n }\n\n $data['role'] = Role::find($id);\n\n $data['permissions'] = Permission::all();\n $data['permission_groups'] = User::getPermissionGroups();\n\n return view('backend.roles.edit',$data);\n }", "function erp_get_editable_roles (){\n if(! function_exists('get_editable_roles')){\n require_once(ABSPATH . 'wp-admin/includes/user.php');\n }\n $wp_roles = get_editable_roles();\n\n if( !current_user_can( 'administrator' ) ){\n unset( $wp_roles['administrator'] );\n }\n\n $roles = apply_filters( 'erp_editable_roles', $wp_roles );\n\n return $roles;\n}", "public function edit($id)\n {\n //\n $role = Role::find($id);\n $checks = [];\n foreach($role->perms as $perm)\n {\n $checks[] = $perm->id;\n }\n $perms = Permission::all()->sortBy(\"name\");\n return view('admin.role.edit',['role'=>$role,'checks'=>$checks,'perms'=>$perms]);\n }", "public function index($id = null)\n {\n if (is_null($id)) {\n redirect('/roles');\n }\n\n // permissions restrictions are the same as for roles\n $this->checkPermission('roles', 'edit');\n\n // check if role exists\n $this->db->where('id', $id);\n $q = $this->db->get('roles');\n if ($q->num_rows() <= 0) {\n redirect('/roles');\n }\n $role = $q->result()[0];\n\n // form was submitted\n if (\n isset($_SERVER['REQUEST_METHOD']) &&\n $_SERVER['REQUEST_METHOD'] == 'POST'\n ) {\n $this->db->delete('rights', ['role_id' => $id]);\n\n foreach ($this->input->post('permissions') as $name => $values) {\n if (!array_key_exists($name, $this->permissions)) {\n continue;\n }\n $this->db->insert('rights', [\n 'role_id' => $id,\n 'name' => $name,\n 'show' =>\n (\n array_key_exists('show', $values) &&\n $this->permissions[$name]->show\n )\n ? 1\n : 0,\n 'add' =>\n (array_key_exists('add', $values) && $this->permissions[$name]->add)\n ? 1\n : 0,\n 'edit' =>\n (\n array_key_exists('edit', $values) &&\n $this->permissions[$name]->edit\n )\n ? 1\n : 0,\n 'delete' =>\n (\n array_key_exists('delete', $values) &&\n $this->permissions[$name]->delete\n )\n ? 1\n : 0\n ]);\n }\n\n $this->writeLog(\n 'update',\n 'rights',\n ['permissions' => $this->input->post('permissions'), 'role_id' => $id],\n $id\n );\n\n $this->session->set_flashdata(\n 'success',\n \"Les permissions de ce rôle ont bien été modifiées avec succès !\"\n );\n\n redirect('/roles');\n }\n\n // get current role permissions\n $this->db->where('role_id', $id);\n $permissions = $this->db->get('rights')->result();\n\n foreach ($permissions as $permission) {\n if (!array_key_exists($permission->name, $this->permissions)) {\n continue;\n }\n if ($permission->show == 1) {\n $this->permissions[$permission->name]->checked[] = 'show';\n }\n if ($permission->add == 1) {\n $this->permissions[$permission->name]->checked[] = 'add';\n }\n if ($permission->edit == 1) {\n $this->permissions[$permission->name]->checked[] = 'edit';\n }\n if ($permission->delete == 1) {\n $this->permissions[$permission->name]->checked[] = 'delete';\n }\n }\n\n $this->view('permissions', [\n 'role' => $role,\n 'permissions' => $this->permissions\n ]);\n }", "public function edit($role_id)\n\t{\n\t\t$consultperm = AclPermission::where('main_module','=','consultant')->get();\n\t\t$awardedperm = AclPermission::where('main_module','=','awarded')->get();\n\t\t$akdnperm = AclPermission::where('main_module','=','akdn')->get();\n\t\t$languageperm = AclPermission::where('main_module','=','language')->get();\n\t\t$skillperm = AclPermission::where('main_module','=','skill')->get();\n\t\t$roleperm = AclPermission::where('main_module','=','role')->get();\n\t\t$specperm = AclPermission::where('main_module','=','specialization')->get();\n\t\t$userperm = AclPermission::where('main_module','=','adminuser')->get();\n\t\t$firewallperm = AclPermission::where('main_module','=','firewall')->get();\n\t\t$agency = AclPermission::where('main_module','=','agency')->get();\n\t\t$mails = AclPermission::where('main_module','=','mails')->get();\n\n\t\t$selected = AclGroupPermission::where('group_id',$role_id)->lists('group_id','permission_id');\n\t\t$role_name = AclGroup::where('id',$role_id)->first();\n\n\t\treturn View::make('admin.role.edit',compact('mails','agency','consultperm','awardedperm','akdnperm','languageperm','skillperm','roleperm','selected','role_name','specperm','userperm','firewallperm'));\n\t}", "public function edit($id)\n {\n $item = Role::findOrFail($id);\n $permissions = Permission::all();\n return view('roles.edit', compact('item', 'permissions'));\n }", "function get_role_list() {\n\t\treturn $this->db->get('system_security.security_role');\n\t\t\n\t}", "public function setRole() {\n\n $res= $_POST['link']->query(\"SELECT t2.perm_name FROM role_perm as t1\n JOIN permissions as t2 ON t1.perm_id = t2.perm_id\n WHERE t1.role_id = $this->rol_id\");\n\n\n foreach($res as $item)\n $this->role_perm[]= $item['perm_name'];\n }", "public function edit($id)\n\t{\n $role = Roles::find($id);\n return View::make(\"roles.edit\",compact(\"role\"));\n\t}", "public function edit($id)\n {\n $userRoles=$this->userRoleService->getActiveUserRole();\n $userRolesDet=$this->userRoleDetailService->getUserRolesDetById($id);\n// dd($userRolesDet->getroleDetailImage());\n return view('admin.userRoleDetail',compact('userRoles','userRolesDet'));\n }", "function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }", "public function edit($id)\n {\n $user = User::find($id);\n $userRole = $user->roles->pluck('name','name')->all();\n if(in_array('superadmin',$userRole)){\n $roles = Role::pluck('name','name')->all();\n }else{\n $roles = Role::where('name','!=','superadmin')->pluck('name','name')->all();\n }\n return view(parent::LoadView($this->base_view.'.edit'),compact('user','roles','userRole'));\n }", "public function edit($id)\n\t{\t\t\n\t\t$form_data = ['route' => ['database.roles.update', $id], 'method' => 'PUT'];\n\t\treturn view('dashboard.pages.database.roles.lists', compact('form_data'))\n\t\t\t->with(['rol' => $this->rol]);\n\t}", "function getRoles () {\n return array(\"user.friendRequest.edit\",\"user.friendRequest.view\");\n }", "public function edit($id)\n {\n\t\t$update = $this->modelUsers->show($id);\t\t\n\t\t$roles = Role::pluck('name','name')->all();\n $userRole = $update->roles->pluck('name','name')->all();\n \treturn view('admin.users.edit',compact('update','roles','userRole'));\n }", "public function getRoles()\n {\n }", "public function getRoles()\n {\n }", "public function getRoles()\n {\n }", "public function editRolePermissions()\n\t{\n\t\t$roles = Role::all()->load('perms');\n\t\t$permissions = Permission::all();\n\n\t\treturn View::make('users.role-permissions', compact('roles', 'permissions', 'rolePermissions'));\n\t}", "public function edit($id)\n {\n $role = Role::lists('name','id')->toArray();\n $inst = $this->user->find($id);\n $AllRole = Role::all();\n return view('Admin::pages.user.edit', compact('role','inst','AllRole'));\n }", "public function edit($id)\n {\n\n try{\n $userRoleDetails = $this->aclRolesRepository->getUserAclRoleById($id);\n $aclModules = $this->aclModuleRepository->getAclModulesWithRoutes();\n $userRole =$userRoleDetails['role'];\n $permissions = $userRoleDetails['permissions'];\n return view('advantageacl::roles.edit_role',compact('userRole','aclModules','permissions'));\n }catch (Exception $ex){\n Log::error($ex->getMessage());\n }\n }", "public function edit($id)\n {\n $res = Role::find($id);\n return view('admin.role.edit',['title'=>'角色的修改页面','res'=>$res]);\n }", "public function getRole(){\n\t\tif (current_user_can('editor')) {\n\t\t\t$this->role_object = get_role('editor');\n\t\t}\n\t}", "function edit(){\n\t\t$arr = $this->uri->uri_to_assoc(3);\n\t\t$data['arr'] = $arr['id'];\n\t\t\n\t\t/* membuat value */\n\t\t$this->user->setID($arr['id']);\n\n\t\t/* fungsi ambil data */\n\t\t$result = $this->user->ambil_data();\n\n\t\t/* data dropdown */\n\t\t$data['role'] = role_dropdown();\n\t\t$data['result'] = $result;\n\n\t\t/* load view */\n\t\t$this->template->write_view('edit', $data);\n\t}", "private function getUserRole($id) { \n $dv_role = Yii::$app->db->createCommand(\"SELECT meta_value FROM assist_user_meta WHERE uid = '$id' AND meta_key = 'role'\")->queryAll();\n return $dv_role;\n }", "public function roles();", "public function roles();", "public function roles();", "public function roles();", "public function edit($id)\n\t{\n\t\t//check permission\n\t\tif(!Auth::user()->hasPermission('editRole')){\n\t\t\treturn redirect()->route('admin.getHome')->with('flash_message_error', '403! Không thể Edit Role');\n\t\t}\n\t\t\n\t\t//\n\t\t$role = Role::findOrFail($id);\n\t\t//check role important\n\t\tif(in_array($role->role_name, $this->role_important)){\n\t\t\treturn redirect()->route('admin.role.index')->with(['flash_message_error' => 'Error! Role '.$role->role_name.' không được chỉnh sửa']);\n\t\t}\n\t\t$permission = Permission::all();\n\t\t//get permission of role\n\t\t$temp = Permission::whereHas('permissionRole', function($query) use($id){\n\t\t\t$query->where('role_id', $id);\n\t\t})->select('id')->get();\n\t\t$check_permission = [];\n\t\tforeach ($temp as $key) {\n\t\t\t$check_permission[$key->id] = true;\n\t\t}\n\t\treturn view('admin.role.edit', compact('role', 'permission', 'check_permission'));\n\t}", "public function rolesForUser();", "public function getEditRole(Request $request) {\n $id = $request->input('id');\n $role = $this->role->where('id', '=', $id)->get()->first();\n return view('roles.edit')->with('role', $role)->render();\n }", "public function edit($id)\n {\n if(Auth::user()->cannot('edit.user')) {\n return view('errors.permission');\n die;\n }\n\n /*if(!accessIp(\\Request::ip())) {\n return view('errors.blocked_ip');\n die;\n }*/\n\n $roles = new Role();\n if(!Auth::user()->isRole('admin')) {\n $roles = $roles->where('id', '>', 1);\n }\n\n $roles = $roles->pluck('name', 'id');\n $data = User::with('roles')->find($id);\n\n foreach($data->roles as $role) {\n $selected_roles[] = $role->id;\n }\n\n return view('admin.user.edit', compact('roles', 'data', 'selected_roles'));\n }", "public function getRole(){\n return $this->role; \n }", "function roles(){\n\t\t$this->pageauth->setPrivileges('roles');\n\t\t\n\t\t// see if user has delete privileges\n\t\tif (!$this->pageauth->loginHasPrivileges('delete')) :\n\t\t\n\t\t\t$json['error'] = \"You do not have access to add or edit these records\";\n\t\t\techo json_encode($json);\n\t\t\texit();\n\t\t\n\t\telse:\n\t\t\t\n\t\t\t$id = $this->input->post('id');\n\t\t\n\t\t\t$response = $this->platform->post('apadmin/role/delete',array('id'=>$id));\n\t\t\t\n\t\t\tif($response['success']) :\n\t\t\t\t\n\t\t\t\t$json['success'] = $response['success'];\n\t\t\t\techo json_encode($json);\n\t\t\t\t\n\t\t\t\telse:\n\t\t\t\t\n\t\t\t\t$json['error'] = $response['error'];\n\t\t\t\techo json_encode($json);\n\t\t\t\t\n\t\t\tendif;\n\t\tendif;\n\t}", "public function loadrolesAction(){\n $roles=Doctrine_Query::create()\n\t ->select(\"r.ID, r.role\")\n\t ->from(\"Roles r\")\n \t ->execute(null,Doctrine::HYDRATE_ARRAY);\n $this->emitTableResult($roles);\n }", "function editable_roles( $roles ){\n if( isset( $roles['administrator'] ) && !current_user_can('administrator') ){\n unset( $roles['administrator']);\n }\n return $roles;\n }", "public static function manageRole(){\n $rolelist = [];\n $db = Db::getInstance(); \t \n $req = $db->query('SELECT * FROM hp_role'); \n foreach($req->fetchAll() as $row) {\n $rolelist[] = $row;\n }\n return $rolelist;\n \n }", "public function edit($id)\n {\n if ($id == 1) {\n return redirect()->route('backend.role.index.get')->withMessages(['danger' => ['Can\\'t update root role.']]);\n }\n\n try {\n $data['role'] = $this->roleRepo->find($id);\n\n $data['permissions'] = $this->permissionRepo->all(['id', 'display_name']);\n\n $this->theme->breadcrumb()->add('Edit', route('backend.role.edit.get', $id));\n return $this->theme->scope('role.edit', $data)->render();\n\n } catch (RepositoryException $e) {\n return redirect()->route('backend.role.index.get')->withMessages(['danger' => $e->getErrors()->toArray()]);\n } catch (ModelNotFoundException $e) {\n return redirect()->route('backend.role.index.get')->withMessages(['danger' => [$e->getMessage()]]);\n } catch (Exception $e) {\n return redirect()->route('backend.role.index.get')->withMessages(['danger' => [$e->getMessage()]]);\n }\n }" ]
[ "0.7169026", "0.713081", "0.69981486", "0.6950524", "0.6902434", "0.6831197", "0.6819039", "0.6793184", "0.6761149", "0.6760793", "0.6751537", "0.671556", "0.6715443", "0.67139435", "0.6712048", "0.66900235", "0.6678545", "0.6671029", "0.6662427", "0.6661511", "0.6658212", "0.6654544", "0.66535205", "0.6652467", "0.6649207", "0.6636828", "0.6633871", "0.6620119", "0.6587172", "0.65848136", "0.6583474", "0.6582744", "0.6579629", "0.6577885", "0.65766263", "0.65729666", "0.65729666", "0.65645134", "0.6557307", "0.65550995", "0.65443283", "0.6539965", "0.65384287", "0.65368056", "0.6533323", "0.65269303", "0.6525802", "0.65190613", "0.6515218", "0.6503317", "0.64895964", "0.6485188", "0.6484514", "0.6470942", "0.6464641", "0.64613813", "0.6461144", "0.6460336", "0.64594454", "0.645917", "0.64541656", "0.64512277", "0.64388394", "0.64355254", "0.64280707", "0.641947", "0.6416412", "0.6409986", "0.6400289", "0.6392809", "0.63919497", "0.6389581", "0.63893396", "0.6373847", "0.6371301", "0.63702124", "0.63635075", "0.63626647", "0.63626647", "0.63626647", "0.63585794", "0.6353133", "0.63491654", "0.6338739", "0.6338242", "0.63373876", "0.63365436", "0.6336263", "0.6336263", "0.6336263", "0.6336263", "0.63331634", "0.63321894", "0.63269544", "0.63250446", "0.6319024", "0.6317368", "0.6317175", "0.6313527", "0.6312129", "0.6310662" ]
0.0
-1
Delete Role Access Data
public function deleteRoleAccess() { $RoleAccessID = $this->input->post('RoleAccessID'); $RoleAccessData = $this->system_structure_m->deleteRoleAccess($RoleAccessID); echo $RoleAccessData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function roleDelete(Role $role);", "public function actionDeleteRole ()\n\t\t{\n\n\t\t\t$auth = Yii::$app->getAuthManager();\n\t\t\t$role = $auth->getRole(Yii::$app->request->get('id'));\n\t\t\t$auth->remove($role);\n\t\t\t$url = Yii::$app->request->referrer . '#roles';\n\t\t\tYii::$app->response->redirect($url);\n\n\t\t\tYii::$app->end();\n\t\t}", "public function testDelete()\n {\n\n $this->createDummyRole();\n\n $this->assertDatabaseHas('roles', [\n 'id' => 1,\n ]);\n\n $this->call('POST', '/api/role', array(\n 'action' => $this->deleteAction,\n 'id' => 1,\n ));\n\n $this->assertDatabaseMissing('roles', [\n 'id' => 1,\n ]);\n\n $this->assertDatabaseMissing('role_permission', [\n 'role_id' => 1,\n 'permission_id' => [1, 2]\n ]);\n }", "private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}", "public function testDeleteRole()\n {\n }", "function delete_role ($role_id) {\r\n $conn = db_connect();\r\n $query = \"delete from roles where role_id = '\".$role_id.\"'\";\r\n $result = $conn->query($query);\r\n $query = \"delete from role_priv where role_id = '\".$role_id.\"'\";\r\n $result1 = $conn->query($query);\r\n\r\n // change the users` priv to default\r\n $result2 = $conn->query(\"update users set role_id = '1' where role_id = '\".$role_id.\"'\");\r\n\r\n if (!$result || !$result1 || !$result2) {\r\n throw new Exception(\"Could not connect to the db!\");\r\n } else {\r\n return true;\r\n }\r\n }", "public function testDeleteAuthorizationRole()\n {\n }", "public function postDelete()\n {\n self::getConnection()->delete('@system_user_role', ['user_id' => $this->getId()]);\n }", "public function delete() {\r\n $this->db->delete(\"assets_permissions\", $this->db->quoteInto(\"id = ?\", $this->model->getId()));\r\n }", "function delete_role($roleid) {\n $success = true;\n\n// mdl 10149, check if this is the last active admin role\n// if we make the admin role not deletable then this part can go\n \n $systemcontext = get_context_instance(CONTEXT_SYSTEM);\n \n if ($role = get_record('role', 'id', $roleid)) {\n if (record_exists('role_capabilities', 'contextid', $systemcontext->id, 'roleid', $roleid, 'capability', 'moodle/site:doanything')) {\n // deleting an admin role\n $status = false;\n if ($adminroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $systemcontext)) {\n foreach ($adminroles as $adminrole) {\n if ($adminrole->id != $roleid) {\n // some other admin role\n if (record_exists('role_assignments', 'roleid', $adminrole->id, 'contextid', $systemcontext->id)) {\n // found another admin role with at least 1 user assigned \n $status = true;\n break;\n }\n }\n } \n } \n if ($status !== true) {\n error ('You can not delete this role because there is no other admin roles with users assigned'); \n }\n } \n }\n\n// first unssign all users\n if (!role_unassign($roleid)) {\n debugging(\"Error while unassigning all users from role with ID $roleid!\");\n $success = false;\n }\n\n// cleanup all references to this role, ignore errors\n if ($success) {\n delete_records('role_capabilities', 'roleid', $roleid);\n delete_records('role_allow_assign', 'roleid', $roleid);\n delete_records('role_allow_assign', 'allowassign', $roleid);\n delete_records('role_allow_override', 'roleid', $roleid);\n delete_records('role_allow_override', 'allowoverride', $roleid);\n delete_records('role_names', 'roleid', $roleid);\n }\n\n// finally delete the role itself\n // get this before the name is gone for logging\n $rolename = get_field('role', 'name', 'id', $roleid);\n \n if ($success and !delete_records('role', 'id', $roleid)) {\n debugging(\"Could not delete role record with ID $roleid!\");\n $success = false;\n }\n \n if ($success) {\n add_to_log(SITEID, 'role', 'delete', 'admin/roles/action=delete&roleid='.$roleid, $rolename, '', $USER->id);\n }\n\n return $success;\n}", "public function deleteRoleMasterData()\n\t{\n\t\t$RoleID = $this->input->post('RoleID');\n\t\t$RoleData = $this->system_structure_m->deleteRoleMasterData($RoleID);\n\t\techo $RoleData;\n\t}", "public function clear() {\r\n\r\n \t\r\n \t\tunset ( $this->__sesionStorage->role );\r\n \t\t\r\n }", "public function destroy($id)\n {\n $del = $this->Role->delete($id); \n if($del): echo \"Role Deleted Successfully\"; else: \"Error deleting this data... Please try again later\"; endif;\n\t\n\n }", "public function testDeleteWontEffectOtherRoleWithSamePermission()\n {\n\n $this->createDummyRole(\"1\");\n $this->createDummyRole(\"2\");\n\n $this->call('POST', '/api/role', array(\n 'action' => $this->deleteAction,\n 'id' => 1,\n ));\n\n $this->assertDatabaseMissing('roles', [\n 'id' => 1,\n 'name' => $this->testRoleName . \"1\",\n 'description' => $this->testRoleDesc . \"1\"\n ]);\n\n $this->assertDatabaseHas('roles', [\n 'id' => 2,\n 'name' => $this->testRoleName . \"2\",\n 'description' => $this->testRoleDesc . \"2\"\n ]);\n\n $this->assertDatabaseMissing('role_permission', [\n 'role_id' => 1,\n 'permission_id' => 1,\n ]);\n\n $this->assertDatabaseHas('role_permission', [\n 'role_id' => 2,\n 'permission_id' => 1,\n ]);\n }", "public function testPermissionOwnGotDeleted()\n {\n $this->createDummyRole();\n\n // Delete the permission\n $this->call('POST', '/api/permissions', array(\n 'action' => $this->deleteAction,\n 'id' => 1,\n ));\n\n $this->assertDatabaseHas('roles', [\n 'id' => 1,\n 'name' => $this->testRoleName,\n 'description' => $this->testRoleDesc\n ]);\n\n $this->assertDatabaseMissing('role_permission', [\n 'role_id' => 1,\n 'permission_id' => 1.\n ]);\n\n $this->assertDatabaseHas('role_permission', [\n 'role_id' => 1,\n 'permission_id' => 2,\n ]);\n }", "public static function deletePerms() {\n $sql = \"TRUNCATE role_perm\";\n $res = $_POST['link']->query($sql);\n return $res;\n }", "public function delete()\n {\n // Remove all role associations\n $this->roles()->detach();\n\n // Delete the permission\n $result = parent::delete();\n\n return $result;\n }", "function deleteRecord()\n\t{\n\t\t$this->db->where('roleID', $this->roleID);\n\t\t$this->db->delete('roles'); \n\t \t\n\t\tif ($this->db->_error_message())\n\t\t\treturn false;\n\t\telse \n\t\t\treturn true; \t\t\n\t}", "public function testDeleteUserRoles()\n {\n }", "public function deleting(Role $role)\n {\n }", "function delete_user_role($id,$table){\n $this->db->delete($table, array('user_id' => $id));\n return;\n }", "function delete_user_role($id,$table){\n $this->db->delete($table, array('user_id' => $id));\n return;\n }", "public function delete($id)\n {\n $role = $this->findById($id);\n\n \n $role->delete();\n }", "public function del_role(){\n\t\textract($_POST);\n\n\t\t//Connection establishment to get data from REST API\n\t\t$path=base_url();\n\t\t$url = $path.'api/manageRoles_api/del_role?role_id='.$role_id;\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response_json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response=json_decode($response_json, true);\n\t\t//api processing ends\n\n\t\tif($response['status']==0){\n\t\t\techo '<div class=\"alert alert-danger\">\n\t\t\t<strong>'.$response['status_message'].'</strong> \n\t\t\t</div>\t\t\t\t\t\t\n\t\t\t';\t\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\techo '<div class=\"alert alert-warning\">\n\t\t\t<strong>'.$response['status_message'].'</strong> \n\t\t\t</div>\t\t\t\t\t\t\n\t\t\t';\t\t\t\t\n\t\t\t\n\t\t}\t\n\t\t\n\t}", "public static function RoleDelete($id) {\n $role = Roles::find($id);\n $role->status = 0;\n $role->save(); \n }", "public function deleteRolesAction(){\n \n $request = $this->getRequest();\n \n if(! isset($request->id)) {\n // TODO Massege (Helper bauen??!)\n $this->_helper->messenger('error', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n \n $entity = 'Jbig3\\Entity\\RolesEntity';\n $repositoryFunction = 'findOneById';\n \n $role = $this->em->getRepository($entity)->$repositoryFunction($request->id);\n \n if($role !== null) {\n // TODO Cascade - hier anders gelöst (Kinder vorher manuell löschen)\n if(count($role->rules)) {\n // Masseges\n $this->_helper->messenger('error', \n 'Unable to remove group. Please remove dependencies first (Manual)');\n return $this->_redirect('/admin/role');\n }\n \n $roleName = $role->name;\n \n $this->em->remove($role);\n $this->em->flush();\n \n // TODO Masseges\n $this->_helper->messenger('success', \n sprintf(Zend_Registry::get('config')->messages->role->delete, $roleName));\n return $this->_redirect('/admin/role');\n } else {\n // TODO Masseegs\n $this->_helper->messenger('success', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n }", "public function testAdminCanDeleteARole()\n {\n $existRole = Role::factory()->create();\n\n $response = $this\n ->actingAs($this->admin)\n ->delete('/admin/roles/'. $existRole->id);\n\n $role = Role::where('id', $existRole->id)->first();\n $this->assertNull($role);\n\n $response->assertStatus(302);\n $response->assertRedirect('/admin/roles');\n $response->assertSessionHas('success', __('roles.success_deleted_message', ['name' => $existRole->name]));\n }", "public function testDeleteRoleItem()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "static public function remove()\n {\n remove_role(self::ROLE_KEY);\n }", "public function destroy($id) {\n //fetcg the data spotlight by id\n DB::table('roles')->where('id', $id)->delete();\n\n //redirect the listing page\n return redirect('Roles ')->withMessage('Data Delete Successfully');\n }", "public function delete(Request $request)\n {\n $role_id = $request->route('groupuser');\n $roles = new Role();\n $role = $roles->find($role_id);\n if ($role) {\n $delete_permission = $role->permissions()->delete();\n $detact = $role->permissions()->detach();\n $detact = $role->users()->detach();\n $results = $roles->find($role_id)->delete();\n if (!$results) {\n return redirect()->route('cpanel.groupuser.index')\n ->with('status', 'fail')\n ->with('msg', 'Can not delete data.');\n } else {\n return redirect()->route('cpanel.groupuser.index')\n ->with('status', 'success')\n ->with('msg', 'Successfully!');\n }\n } else {\n return redirect()->route('cpanel.groupuser.index')\n ->with('status', 'fail')\n ->with('msg', 'Can not delete data.');\n }\n }", "static public function remove()\n {\n remove_role(self::ROLE_KEY);\n }", "function delete_user_role($id)\n {\n return $this->db->delete('user_role',array('id'=>$id));\n }", "public function destroy($id)\n {\n // Gate::authorize('haveaccess', 'rol.destroy');\n $user= Role::find($id);\n $user->delete();\n\n return redirect('sistema/iniciorole')->with('success','Haz eliminado un rol con exito');\n }", "function remove_role($role)\n {\n }", "function delete_pac_emp_role($id)\n {\n $response = $this->getdb()->delete('pac_emp_roles',array('id'=>$id));\n if($response)\n {\n return \"pac_emp_role deleted successfully\";\n }\n else\n {\n return \"Error occuring while deleting pac_emp_role\";\n }\n }", "public function destroy($id)\n {\n //\n $delete = Role::destroy($id);\n }", "public function delete_role($role_id){\n\t\treturn ORM::delete($role_id);\n\t}", "public function destroy($id)\n\t{\n $vaccine = Roles::find($id);\n $rol = $vaccine->role;\n $vaccine->delete();\n Logs::create(array(\n \"user_id\"=> Auth::user()->id,\n \"action\" =>\"Delete role with name \".$rol\n ));\n\t}", "public function destroy($id)\n {\n try {\n DB::beginTransaction();\n // delete to table role\n\n $role = $this->role->find($id);\n $role->permissions()->detach();// phải xóa ở table permission_role trc để kh bị ràng buộc dữ liệu\n $role->delete();\n\n // delete to table permission_role\n \n \n DB::commit();\n // success\n return redirect()->route('admin.role.index')->with('success', 'Xóa vai trò thành công!');\n // dd($request->permission);\n } catch (\\Exception $ex) {\n DB::rollback();\n return redirect()->back()->with('error', $ex->getMessage());\n }\n }", "public function destroy($id)\n {\n $role = Role::firstOrCreate(['id' => Auth::user()->role_id]);\n if (!is_null($role->hasPermissionTo('clearingagent-add')) && $role->hasPermissionTo('clearingagent-add')){\n $clearingagent = ClearingAgent::find($id);\n if(!is_null($clearingagent)){\n $clearingagent->delete();\n }\n\n\n return redirect()->route('clearingagent.index')->with('message', 'Successfully deleted');\n }else\n return redirect()->back()->with('not_permitted', 'Sorry! You are not allowed to access this module');\n }", "public function destroy($id) {\n $request->user()->authorizeRoles('Admin');\n //\n }", "public function destroy()\n\t{\n\t\t/* Delete Single Record */\n\t\tif(Input::get('name') == 'destroy')\n\t\t{\n\t\t\t$role_id = Input::get('id');\n\t\t\t$acl_group_permission_delete = AclGroupPermission::where('group_id',$role_id)->delete();\n\t\t\tAclGroup::where('id','=',$role_id)->delete();\n\t\t}\n\t\t/* Delete Multiple Records */\n\t\telse\n\t\t{\n\t\t\t$ids = Input::get('id');\n\t\t\tAclGroup::whereIn('id',$ids)->forceDelete();\n\t\t\tforeach ($ids as $id) {\n\t\t\t\t$acl_group_permission_delete = AclGroupPermission::where('group_id',$id)->delete();\n\t\t\t}\n\t\t}\n\n\t\treturn Response::json(array('msg' => 'AkdnUser deleted permanently','success'=>true), 200);\n\t}", "public function destroy($id)\n {\n Gate::authorize('haveaccess'); \n }", "public function delete($role_id)\r\n {\r\n $this->checkIfDemo();\r\n $this->AdminRoleModel->remove($role_id);\r\n }", "public function destroy($id)\n {\n $role= Role::find($id);\n $role->delete();\n return redirect ('/role');\n }", "function roles(){\n\t\t$this->pageauth->setPrivileges('roles');\n\t\t\n\t\t// see if user has delete privileges\n\t\tif (!$this->pageauth->loginHasPrivileges('delete')) :\n\t\t\n\t\t\t$json['error'] = \"You do not have access to add or edit these records\";\n\t\t\techo json_encode($json);\n\t\t\texit();\n\t\t\n\t\telse:\n\t\t\t\n\t\t\t$id = $this->input->post('id');\n\t\t\n\t\t\t$response = $this->platform->post('apadmin/role/delete',array('id'=>$id));\n\t\t\t\n\t\t\tif($response['success']) :\n\t\t\t\t\n\t\t\t\t$json['success'] = $response['success'];\n\t\t\t\techo json_encode($json);\n\t\t\t\t\n\t\t\t\telse:\n\t\t\t\t\n\t\t\t\t$json['error'] = $response['error'];\n\t\t\t\techo json_encode($json);\n\t\t\t\t\n\t\t\tendif;\n\t\tendif;\n\t}", "public function deletePermissionRoleByRoleID($id);", "public function delIdentity()\n\t{\n\t\t// Verifier l'adhesion\n\t\t$q = new Bn_query('u2a', '_asso');\n\t\t$q->setFields('u2a_adherentid');\n\t\t$q->addWhere('u2a_userid='. $this->getVal('id', -1));\n\t\t$adheId = $q->getOne();\n\t\t$q->deleteRow();\n\t\t$q->setTables('adherents');\n\t\t$q->deleteRow('adhe_id=' . $adheId);\n\t}", "public function actionDelete($id)\n\t{\n\t \n\t\n\t\t$model = $this->loadModel($id);\n\t\t$role = $model->role;\n\t\tif($model->role=='2')\n\t\t{\n\t\tReviews::model()->deleteAll(\"review_itemid='\" .$id. \"'\");\n\t\tReviews::model()->deleteAll(\"review_by='\" .$id. \"'\");\n\t\tCart::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t}\n\t\telse if($model->role=='3')\n\t\t{\n\t\t Guide::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Guidetemple::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Reviews::model()->deleteAll(\"review_itemid='\" .$id. \"'\");\n\t\t Reviews::model()->deleteAll(\"review_by='\" .$id. \"'\");\n\t\t Cart::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Images::model()->deleteAll(\"item_id='\" .$id. \"'\");\n\t\t}\n\t\telse if($model->role=='4')\n\t\t{\n\t\t Iyer::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Iyerpoojas::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Reviews::model()->deleteAll(\"review_itemid='\" .$id. \"'\");\n\t\t Reviews::model()->deleteAll(\"review_by='\" .$id. \"'\");\n\t\t Cart::model()->deleteAll(\"user_id='\" .$id. \"'\");\n\t\t Images::model()->deleteAll(\"item_id='\" .$id. \"'\");\n\t\t}\n\t\telse\n\t\t{\n\t\t}\n\t\t$model->delete();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('/user/manage/role/'.$role));\n\t}", "public function destroy($id)\n {\n DB::table(\"roles\")->where('id',$id)->delete();\n return redirect()->route('admin.roles')\n ->with('success','Permissão deletada com sucesso');\n }", "function roles_dashboard_role_deleted($event, $type, $entity) {\n\n\tif (!$entity instanceof ElggRole) {\n\t\treturn;\n\t}\n\n\t$ia = elgg_set_ignore_access(true);\n\n\t$dashboards = new ElggBatch('elgg_get_entities_from_relationship', array(\n\t\t'types' => 'object',\n\t\t'subtypes' => MultiDashboard::SUBTYPE,\n\t\t'relationship' => 'dashboard_for',\n\t\t'relationship_guid' => (int) $entity->guid,\n\t\t'inverse_relationship' => true,\n\t\t'limit' => 0,\n\t));\n\t$dashboards->setIncrementOffset(false);\n\t\n\tforeach ($dashboards as $dashboard) {\n\t\t$dashboard->delete();\n\t}\n\n\telgg_set_ignore_access($ia);\n}", "function deleteRole($id)\n {\n if ($this->isAdmin() == TRUE) {\n echo(json_encode(array('status' => 'access')));\n } else {\n $roleId = $id;\n $result = $this->user_model->deleteRole($roleId);\n\n if ($result > 0) {\n echo(json_encode(array('status' => TRUE)));\n } else {\n echo(json_encode(array('status' => FALSE)));\n }\n redirect('roleListing');\n\n }\n }", "function delete_role($roleId)\n {\n return $this->db->delete('tbl_roles',array('roleId'=>$roleId));\n }", "public function deleting(Role $role)\n {\n $role->syncPermissions();\n }", "public function delete()\r\n {\r\n // Remove Roles\r\n $objPartnerRole = new Partner($this->conf, $this->lang, $this->conf->getExtensionPrefix().'partner');\r\n $objPartnerRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n $objAssistantRole = new Assistant($this->conf, $this->lang, $this->conf->getExtensionPrefix().'assistant');\r\n $objAssistantRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n $objManagerRole = new Manager($this->conf, $this->lang, $this->conf->getExtensionPrefix().'manager');\r\n $objManagerRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n // Remove all plugin capabilities from WordPress admin role\r\n $objWPAdminRole = get_role('administrator');\r\n $capabilitiesToRemove = $objManagerRole->getCapabilities();\r\n foreach($capabilitiesToRemove AS $capability => $grant)\r\n {\r\n $objWPAdminRole->remove_cap($capability);\r\n }\r\n\r\n // Create mandatory instances\r\n $objSingleSiteInstall = new Install($this->conf, $this->lang, $this->blogId);\r\n $objSingleSiteInstall->deleteContent();\r\n\r\n flush_rewrite_rules();\r\n }", "public function testDeletePermissionSet()\n {\n }", "function removeRole( $name ) {\n $d = loadDB();\n \n $found = false;\n foreach ($d['roles'] as $key => $role) {\n if ($name == $role['name']) {\n unset($d['roles'][$key]);\n $found = true;\n }\n }\n if ($found) {\n audit( \"removeRole\", $name );\n saveDB( $d );\n }\n }", "public function delete()\n\t{\n\t\t/*$roles_to_delete=$this->input->post('ids');\n\t\tif ($this->Role->delete_list($roles_to_delete)) {\n\t\t\techo json_encode(array('success'=>true,'message'=>$this->lang->line('roles_successful_deleted').' '.\n\t\t\tcount($roles_to_delete).' '.$this->lang->line('roles_one_or_multiple')));\n\t\t}\n\t\telse {\n\t\t\techo json_encode(array('success'=>false,'message'=>$this->lang->line('roles_cannot_be_deleted')));\n\t\t}*/\n\t}", "public function executeDelete()\n {\n if($this->hasRequestParameter('ids')){\n $roles = array_reverse(RolePeer::retrieveByPKs(json_decode($this->getRequestParameter('ids'))));\n\n foreach($roles as $role){\n\t$role->delete();\n }\n\n }elseif($this->hasRequestParameter('id')){\n $role = RolePeer::retrieveByPk($this->getRequestParameter('id'));\n $role->delete();\n }\n\n $this->msg_alert = array('info', $this->getContext()->getI18N()->__(\"Rol borrado.\"));\n return $this->renderComponent('roles', 'list');\n }", "function delete_role($roles_id)\n {\n return $this->db->delete('roles',array('roles_id'=>$roles_id));\n }", "protected function deleteAction() : void\n {\n $this->deleteAction\n ->execute($this, NULL, RoleActionEvent::class, __METHOD__);\n }", "public function postDeleteRole(DeleteRequest $request)\n {\n $id = \\Input::get('id');\n // $student = Student::find($id);\n $gen_user_role = GenUserRole::find($id);\n $gen_user_role->delete();\n return redirect('gen_user');\n }", "public function actionDelete()\n {\n $bodyRaw = json_decode(Yii::$app->getRequest()->getRawBody(), true);\n //$body = json_decode(Yii::$app->getRequest()->getBodyParams(), true);\n\n if (is_array($bodyRaw)) {\n // check user is a guest\n if (array_key_exists('token', $bodyRaw)) {\n $userByToken = \\Yii::$app->user->loginByAccessToken($bodyRaw['token']);\n if (empty($userByToken)) {\n //return $this->goHome();\n return Json::encode(array('method' => 'PUT', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Аутентификация не выполнена'));\n }\n } else {\n return Json::encode(array('method' => 'PUT', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Аутентификация не выполнена'));\n }\n\n // Get array with user Roles\n $userRole =[];\n $userAssigned = Yii::$app->authManager->getAssignments($userByToken->id);\n foreach($userAssigned as $userAssign){\n array_push($userRole, $userAssign->roleName);\n }\n //return Json::encode(array('method' => 'GET', 'status' => 1, 'type' => 'error', 'message' => $userRole));\n\n // Check rights\n // If user have create right that his allowed to other actions to the Spacialization table\n if (static::CHECK_RIGHTS_RBAC && !\\Yii::$app->user->can('createCustomer') && !\\Yii::$app->user->can('createMediator')) {\n return Json::encode(array('method' => 'PUT', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Не хватает прав на операцию удаления'));\n }\n /*\n $flagRights = false;\n foreach(array('admin', 'customer', 'contractor') as $value) {\n if (in_array($value, $userRole)) {\n $flagRights = true;\n }\n }\n if (!$flagRights) return Json::encode(array('method' => 'POST', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Не хватает прав на операцию добавления'));\n */\n\n // Because the field names may match within a single query, the parameter names may not match the table field names. To solve this problem let's create an associative arrays\n $arrayFeedbackAssoc = array ('id' => 'id', 'profile_id' => 'profile_id', 'status_feedback_id' => 'status_feedback_id', 'content' => 'content');\n\n if (array_key_exists($arrayFeedbackAssoc['id'], $bodyRaw)) {\n // check id parametr\n if (!preg_match(\"/^[0-9]*$/\",$bodyRaw[$arrayFeedbackAssoc['id']])) {\n return Json::encode(array('method' => 'DELETE', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка валидации: id'));\n }\n\n // Search record by id in the database\n if (in_array('admin', $userRole)) {\n $queryFeedback = Feedback::find()->where(['id' => $bodyRaw[$arrayFeedbackAssoc['id']]]); // get all records\n } else {\n $queryFeedback = Feedback::find()->where(['AND', ['id' => $bodyRaw[$arrayFeedbackAssoc['id']]], ['created_by'=> $userByToken->id]]); // get records created by this user\n }\n $modelFeedback = $queryFeedback->one();\n\n if (empty($modelFeedback)) {\n return Json::encode(array('method' => 'DELETE', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: В БД не найден Отзыв по id'));\n }\n } else {\n //return Json::encode(array('method' => 'DELETE', 'status' => 1, 'type' => 'error', 'message' => 'Отсутствет id материала'));\n return $this->actionDeleteByParam();\n }\n\n if (!empty($modelFeedback)) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n // delete from Feedback table\n $countFeedbackDelete = $modelFeedback->delete($modelFeedback->id);\n\n if ($countFeedbackDelete > 0) {\n $transaction->commit();\n } else {\n $transaction->rollBack();\n return Json::encode(array('method' => 'DELETE', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Отзыв не может быть удален'));\n }\n } catch (Exception $ex) {\n $transaction->rollBack();\n return Json::encode(array('method' => 'DELETE', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Отзыв не может быть удален'));\n }\n\n return Json::encode(array('method' => 'DELETE', 'status' => 0, 'type' => 'success', 'message' => 'Отзыв успешно удален'));\n } else {\n return Json::encode(array('method' => 'DELETE', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Отзыв не может быть удален'));\n }\n } else {\n return Json::encode(array('method' => 'DELETE', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Тело запроса не обработано'));\n }\n //}\n }", "public function revoke_access() {\r\n // Nothing to do!\r\n }", "public function delete()\n {\n $this->abilities()->detach();\n parent::delete();\n }", "public function clearCache()\n {\n $cacheDriver = $this->entityManager->getConfiguration()->getResultCacheImpl();\n $cacheDriver->delete('role_data');\n }", "public function _event_before_delete() {\n\t\tstatic::$_delete['roles'] = $this->roles;\n\t}", "function delete_permission() {\n\t\t$this->db->where('permission_id', $_POST['id']);\n\t\t$this->db->delete('system_security.permission');\n\t\techo \"{error: '',msg: '\" . sprintf(lang('success_delete'), 'permission') . \"'}\";\n\t\t\n }", "public function deleteUser($role,$id)\n {\n // $delete_user_role = DB::table('user_roles')->where('user_id',$id)->delete();\n $delete_from_user_table = DB::table('users')->where('user_id',$id)->delete();\n $user = UserInformation::find($id);\n $user->delete();\n return redirect(route('admin.list_user',['role'=>$role]))->with('success','Delete user successfully.');\n\n }", "public function destroy(Access_Code $access_Code)\n {\n //\n }", "public function testPutAuthorizationRoleUsersRemove()\n {\n }", "public function destroy(Role $role)\n {\n //\n if($role->name ==\"app-admin\"){\n\n }else{\n $role->delete();\n }\n return redirect('roles');\n }", "public function destroy($id)\n {\n DB::table(\"roles\")->where('id',$id)->delete();\n return redirect()->route('role.index')\n ->with('success','Role deleted successfully');\n }", "public function delete(){\n $bd = Db::getInstance();\n $sql = \"DELETE FROM login WHERE id= :id\";\n $stmt = $bd->prepare($sql);\n $stmt->execute([\":id\" => $this->id]);\n }", "function WPFormsDB_on_deactivate() {\n\tglobal $wp_roles;\n\n\tforeach( array_keys( $wp_roles->roles ) as $role ) {\n\t\t$wp_roles->remove_cap( $role, 'WPFormsDB_access' );\n\t}\n}", "static function deleteRole($del_role)\r\n\t{\r\n\t\t$constraint = \"WHERE role like '%$del_role%'\";\r\n\t\t\r\n\t\t$roleFields = array(\"upload_files\", \"delete_files\", \"manage_folders\", \"allow_access\");\r\n\t\tforeach($roleFields as $field)\r\n\t\t{\r\n\t\t\t$libraries = Query::create(DocumentLibrary, \"WHERE $field like '%$del_role%'\")->execute();\r\n\t\t\tRoleManager::deleteRoleFromString($libraries, $del_role, $field);\r\n\t\t}\r\n\t\t\r\n\t\treturn $del_role;\t\r\n\t}", "public function destroy($id)\n {\n $role= Role::findOrFail($id);\n if($role->eliminar==\"yes\")\n {\n $role->delete(); \n }\n return redirect()->route('roles.index');\n }", "public function revoke_permission(Role $Role, string $action): void;", "public function destroy($id)\n {\n Role::where('id',$id)->delete();\n return redirect()->route('listRole');\n }", "public function testDeleteInvalidAccess() {\n\t\t//create access and try to delete without actually inserting it\n\t\t$access = new Access(null, $this->VALID_ACCESSNAME);\n\t\t$access->delete($this->getPDO());\n\t}", "public function testRemoveUserRole()\n {\n $data = ['role' => 'administrator'];\n\n $this->removeUserRole($this->user->id, $data)\n ->assertRedirect();\n\n $this->assertNull(\n $this->user->roles()->where('name', $data['role'])->first()\n );\n }", "public function deleteAcl($object);", "public function delete()\n {\n $this->_validateModifiable();\n\n $this->_getDataSource()->delete($this);\n }", "public function destroy($id)\n {\n Role::find($id)->delete();\n return redirect($this->rdr)->with('success','Data berhasil dihapus!');\n }", "public function forceDeleted(Role $role)\n {\n }", "public function destroy($id)\n {\n DB::table(\"roles\")->where('id',$id)->delete();\n return redirect()->route('roles.index')\n ->with('success','Role deleted successfully');\n }", "public function testDeleteAuthorizationSubjectDivisionRole()\n {\n }", "public function resetTable($role)\n {\n DB::table('permission_role')->where('role_id', $role->id()->value())->delete();\n }", "public function admin_remove($id){\n\t\t\t$user = User::find($id);\n\t\t\t$role_id = $user->role_id;\n\t\t\tif($user->is_deleted==1){\n\t\t\t\t$user->is_deleted = 0;\n\t\t\t\t}else {\n\t\t\t\t$user->is_deleted = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif($user->save()){\n\t\t\t\tSession::flash('message', 'Company account has been deleted successfully.');\n\t\t\t\treturn Redirect::to('admin/users/'.$role_id);\n\t\t\t}\n\t\t\t\n\t\t}", "public function revokeAllRoles ();", "function role_remove_lastaccess_entries($userid, $context) {\n\n global $USER, $CFG;\n\n}", "public function actionDelete() {}", "public function actionDelete() {}", "function delete($role_id)\n\t{\n\t\t// response array\n\t\t$jsonData = array('success' => false);\n\t\t$result = $this->role_model->remove($role_id);\n\t\t// if role deleted successfully\n\t\tif($result) {\n\t\t\t$jsonData['success'] = true;\n\t\t}\n\n\t\t// send response to clint\n\t\techo json_encode($jsonData);\n\t}", "public function delete()\n {\n\n $update['id'] = $this->session->userdata('user_id');\n $update['data']['enabled'] = 0;\n $update['data']['active'] = 0;\n $update['table'] = 'users';\n $this->Application_model->update($update);\n\n redirect('/logout','refresh');\n\n }", "public function destroy($id)\n {\n if ($id < 4) {\n return redirect('admin/role');\n }\n // $this->role->delete($id);\n // return redirect('admin/role')->with('flashMessageSuccess','The role has successfully deleted.');\n return redirect('admin/role')->with('flashMessageAlert','The role can not be deleted !');\n }", "public function destroy($id)\n { \n $this->db->where('id', $id);\n $this->db->delete('users_permissions');\n \n }", "public function destroy($id)\n {\n $res = Role::where('id',$id)->delete();\n // return($re);\n // 0表示成功 其他表示失败\n if($res){\n $data = [\n 'status'=>0,\n 'msg'=>'删除成功!'\n ];\n }else{\n $data = [\n 'status'=>1,\n 'msg'=>'删除失败!'\n ];\n }\n return $data; \n }", "function testDeleteSecurity() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\t\t$anonymous = new AntUser($dbh, USER_ANONYMOUS); // should only be a member of the everyone group\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"my test\");\r\n\t\t$cid = $obj->save(false);\r\n\t\tunset($obj);\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $anonymous);\r\n\t\t$this->assertFalse($obj->remove());\r\n\t\tunset($obj);\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$obj->remove();\r\n\t\t$obj->remove();\r\n\t}" ]
[ "0.73920023", "0.7296694", "0.71099824", "0.7003252", "0.69234455", "0.6917699", "0.6913297", "0.6911456", "0.6872483", "0.67910755", "0.676202", "0.6743962", "0.67257106", "0.6716634", "0.6690992", "0.6663016", "0.6651142", "0.6613578", "0.6564592", "0.65533566", "0.6542743", "0.6542743", "0.65395176", "0.6521828", "0.64983445", "0.6487339", "0.6482018", "0.6460427", "0.64590937", "0.64389443", "0.6430938", "0.6429193", "0.64105904", "0.64084244", "0.6399662", "0.63975877", "0.6396231", "0.6379496", "0.63759357", "0.63561535", "0.6300177", "0.62899107", "0.6283561", "0.6270888", "0.6264966", "0.62612045", "0.62495035", "0.6226983", "0.62185484", "0.61976796", "0.61893743", "0.61864424", "0.61823124", "0.6180647", "0.6173699", "0.6170423", "0.61702913", "0.6163979", "0.6158912", "0.6158753", "0.6133416", "0.6131897", "0.6129483", "0.6127024", "0.6123083", "0.6122484", "0.61130804", "0.61090976", "0.6107958", "0.61032283", "0.60925883", "0.60895306", "0.6088058", "0.6087304", "0.6080149", "0.6077576", "0.6073854", "0.60671103", "0.6066128", "0.6064775", "0.606073", "0.6058516", "0.6047954", "0.6026815", "0.6011578", "0.6006785", "0.6003917", "0.6001696", "0.5994848", "0.59874624", "0.59865", "0.59864736", "0.59858316", "0.59858316", "0.59854364", "0.5982927", "0.59793884", "0.5979352", "0.59778416", "0.59764326" ]
0.7866396
0
Processes And Functions Get Functions Details
public function getFunctionsDetails() { $functions = $this->system_structure_m->getFunctionsDetails(); //echo json_encode($functions); $output=''; foreach ($functions as $func) { $output=$output.'<option value="'.$func->FunctionID.'">'.$func->FunctionDescription.'</option>'; } echo $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function funcs()\n { \n //start a new array, which which will store the function descriptions\n $output = array();\n\n //add each function to the array\n foreach ($this->user_functions as $fnn=>$dat)\n $output[] = $fnn . '(' . implode(',', $dat[MATHSCRIPT_ARGUMENTS]) . ')';\n\n //and return the completed array of functions\n return $output;\n }", "abstract public function getFunctions();", "function process() ;", "function getFunctions() {\n return mysql_query(sprintf('SELECT definer, name, param_list, returns, body FROM mysql.proc WHERE db = \\'%s\\' AND type = \\'FUNCTION\\'', $this->config[\"database\"]));\n }", "public function getFunctions();", "function functions() {\n \n }", "function renderFunctionDetail() {\n\n reset($this->accessModifiers);\n while (list($k, $access) = each($this->accessModifiers)) {\n if (0 == count($this->functions[$access]))\n continue;\n\n reset($this->functions[$access]);\n while (list($name, $function) = each($this->functions[$access])) {\n\n $tplvars = array();\n $tplvars[\"NAME\"] = $function[\"name\"];\n $tplvars[\"ACCESS\"] = $function[\"access\"];\n\n if (\"true\" == $function[\"undoc\"])\n $tplvars[\"UNDOC\"] = $this->undocumented;\n\n if (\"true\" == $function[\"abstract\"])\n $tplvars[\"ABSTRACT\"] = \"abstract\";\n\n if (\"true\" == $function[\"static\"])\n $tplvars[\"STATIC\"] = \"static\";\n\n if (isset($function[\"doc\"][\"shortdescription\"]))\n $tplvars[\"SHORTDESCRIPTION\"] = $this->encode($function[\"doc\"][\"shortdescription\"][\"value\"]);\n\n if (isset($function[\"doc\"][\"description\"]))\n $tplvars[\"DESCRIPTION\"] = $this->encode($function[\"doc\"][\"description\"][\"value\"]);\n\n $this->renderCommonDocfields(\"functiondetails_\", $function);\n \n if (isset($function[\"doc\"][\"parameter\"])) {\n $tplvars[\"PARAMETER\"] = $this->getParameter($function[\"doc\"][\"parameter\"]);\n $this->renderParameterDetail($function[\"doc\"][\"parameter\"]);\n }\n \n if (isset($function[\"doc\"][\"throws\"]))\n $this->renderThrows($function[\"doc\"][\"throws\"], \"functiondetails_\");\n\n if (isset($function[\"doc\"][\"global\"])) \n $this->renderGlobals($function[\"doc\"][\"global\"], \"functiondetails_\");\n\n if (isset($function[\"doc\"][\"return\"])) {\n\n $tplvars[\"RETURNTYPE\"] = $function[\"doc\"][\"return\"][\"type\"]; \n\n $this->tpl->setCurrentBlock(\"functiondetails_return\");\n $this->tpl->setVariable(\"TYPE\", $function[\"doc\"][\"return\"][\"type\"]);\n $this->tpl->setVariable(\"DESCRIPTION\", $this->encode($function[\"doc\"][\"return\"][\"value\"]));\n\n if (isset($function[\"doc\"][\"return\"][\"name\"]))\n $this->tpl->setVariable(\"NAME\", $function[\"doc\"][\"return\"][\"name\"]);\n\n $this->tpl->parseCurrentBlock();\n\n } else {\n\n $tplvars[\"RETURNTYPE\"] = \"void\";\n\n }\n\n $this->tpl->setCurrentBlock(\"functiondetails_loop\"); \n $this->tpl->setVariable($tplvars);\n $this->tpl->parseCurrentBlock(); \n }\n\n $this->tpl->setCurrentBlock(\"functiondetails\");\n $this->tpl->setVariable(\"ACCESS\", ucfirst($access) );\n $this->tpl->parseCurrentBlock();\n }\n\n }", "public function ProcessesandFunctions()\n\t{\n\t $data = array();\n\t $where = array();\n\t $where['FunctionID']=$this->input->post('def_functionid');\n $data['FunctionID']=$this->input->post('functionid');\t\n\t $data['FunctionDescription']=$this->input->post('functiondesc');\n\t $data['FunctionAccess']=$this->input->post('functionaccess');\n\t $data['FunctionComponent']=$this->input->post('functioncomponent');\n\t if($where['FunctionID'] == '0')\n\t {\n\t \t$result=$this->system_structure_m->insert_processesandfunctions($data);\n\t }\n\t else\n\t {\n\t \t$result=$this->system_structure_m->update_processesandfunctions($data,$where);\t\n\t }\n\t echo $result;\n\t}", "private function analyzeFunctions(CodeBase $code_base) {\n $function_count = count($code_base->getMethodMap());\n $i = 0;\n foreach ($code_base->getMethodMap() as $fqsen_string => $method) {\n CLI::progress('functions', (++$i)/$function_count);\n\n if ($method->getContext()->isInternal()) {\n continue;\n }\n\n self::analyzeDuplicateFunction($code_base, $method);\n }\n }", "public function debugInfo() {\r\n saprfc_function_debug_info($this->fce);\r\n }", "function handlerFunction($module, $obj, $URI_function){\n //debugECHO($URI_function);\n $functions = simplexml_load_file(MODULES_PATH . $module . \"/resources/functions.xml\");\n $exist=false;\n\n foreach($functions->function as $function){\n if(($URI_function === (String)$function->uri)){\n $exist=true;\n $event=(String)$function->name;\n //debugECHO($event);\n break;\n }//enf if\n\n }//End foreach\n\n if(!$exist){\n //debugECHO(\"entra al exists false\");\n showErrorPage(4,\"\",'HTTP/1.0 400 Bad Request', 400);\n }else{\n //debugECHO($event);\n call_user_func(array($obj,$event));\n }\n}", "public function process();", "public function process();", "public function process();", "public function process();", "public function methods()\n\t{\n\t\techo \"->ProcessTransaction(\\$data[]);<br>\\n\";\n\t\techo \"->ProcessVaultTransaction(\\$data[]);<br>\\n\";\n\t\techo \"->UpdateTransaction(\\$data[]);<br>\\n\";\n\t\techo \"->ProcessAccount(\\$data[]);<br>\\n\";\n\t\techo \"->ProcessCustomer(\\$data[]);<br>\\n\";\n\t\techo \"->ProcessCustomerAndAccount(\\$data[]);<br>\\n\";\n\t\techo \"->AddABAccount(\\$data[]);<br>\\n\";\n\t\techo \"->UpdateABAccount(\\$data[]);<br>\\n\";\n\t\techo \"->UpdateABSchedule(\\$data[]);<br>\\n\";\n\t}", "public function get_functions()\n\t{\n\t\treturn $this->driver_query('function_list', FALSE);\n\t}", "function ft_hook_info() {}", "public function processApi(){\n\t\t\t$func = explode('/', trim($_SERVER['PATH_INFO'],'/'))[0];\n\n\t\t\t$good = false;\n\t\t\tforeach ($this->AUTHORIZED_FUNCTION as $authorizedFunc){\n\t\t\t\tif($authorizedFunc == $func){\n\t\t\t\t\t$good = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(! $good) $this->response('', 404);\n\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->sendMessage('', 404);\n\t\t}", "public function getFunctions() {\n\t\t$functions = array(\n\t\t\t'labels' => array(),\n\t\t\t'targets' => array()\n\t\t);\n\t\tif ($this->hasParameter('functions')) {\n\t\t\tforeach ($this->getParameter('functions') as $name => $function) {\n\t\t\t\t$functions['labels'][$name] = $this->getTranslator()->trans($function['label']);\n\t\t\t\t$targetsList = $function['target'];\n\t\t\t\tif (in_array('all', $targetsList)) {\n\t\t\t\t\t$functions['targets'][$name] = ['data', 'datagroup', 'page', 'article', 'step', 'panel', 'blockgroup', 'fieldset', 'fieldrow', 'field', 'prenote', 'postnote', 'blockinfo', 'chapter', 'section', 'content', 'annotations', 'footnote'];\n\t\t\t\t} else {\n\t\t\t\t\t$functions['targets'][$name] = $targetsList;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $functions;\n\t}", "public function api()\n {\n $function = $this->getParameter('function',$this->api_functions);\n\n $this->fetchOrder();\n\n $actualFunc = $this->oOrder->getData('micropayment_last_function');\n $this->oOrder->setData('micropayment_last_function',$function)->save();\n\n $this->checkEventWorkFlow($actualFunc,$function);\n $this->fetchOrder();\n switch ($function) {\n case self::FUNCTION_INIT:\n if($actualFunc)\n $this->handleInit();\n break;\n case self::FUNCTION_PAYIN:\n \t $this->handlePayin();\n\t break;\n case self::FUNCTION_BILLING:\n $this->handleBilling();\n break;\n case self::FUNCTION_STORNO:\n $this->handleStorno();\n break;\n case self::FUNCTION_BACKPAY:\n $this->handleBackpay();\n break;\n case self::FUNCTION_REFUND:\n $this->handleRefund();\n break;\n case self::FUNCTION_EXPIRE:\n $this->handleExpire();\n break;\n case self::FUNCTION_CHANGE:\n $this->handleChange();\n break;\n case self::FUNCTION_TEST:\n $this->handleTest();\n break;\n case self::FUNCTION_ERROR:\n $this->handleError();\n break;\n }\n $this->sendStatus();\n }", "function printFunction($functions){\n\n // Total number of functions\n $funcLength = count($functions);\n \n if($funcLength == 0){\n echo \"]\\n\";\n }\n else{\n echo \"|\";\n \n // Loop through length - 1\n for($x = 0; $x < $funcLength - 1; $x++){\n\n $function = $functions[$x];\n\n // Print the modifer of the function (+,-,#)\n printModifier($function->__get(\"modifier\")); // for printing the modfiers\n\n // Print the function name with all the parmbers\n echo $function->__get(\"name\") . \"(\";\n \n if(count($function->__get(\"params\")) === 0){\n echo \");\";\n }\n else{\n // Total number of parambers\n printParambers($function->__get(\"params\"));\n echo \";\";\n }\n }\n\n // The remaining last function to be closed \n $function = $functions[$funcLength - 1];\n\n // Print the modifer of the function\n printModifier($function->__get(\"modifier\")); // for printing the modfiers\n echo $function->__get(\"name\") . \"(\";\n if(count($function->__get(\"params\")) === 0){\n echo \")\";\n }\n else{\n // Total number of parambers\n printParambers($function->__get(\"params\"));\n \n }\n \n \n echo \"]\\n\";\n }\n \n }", "public static function process() {}", "function tpps_details_tab($accession, $type) {\n $function = \"tpps_details_$type\";\n $state = tpps_load_submission($accession);\n print($function($state));\n}", "public function processApi(){\n\t\t$words = explode(\"/\",$_REQUEST['rquest']);\n\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$words[0])));\n\t\t\n \t\tif(strcmp(\"services\",$func) == 0)\n\t\t\t$this->$func($words[1],$words[2]);\t// you can set as many levels as you want\n\t\telse\n\t\t\t$this->response('',404);\t// response would be \"Page not found\"\n\t}", "public function getFileProcObj() {}", "public function getFileProcObj() {}", "private static function processFunction($contents,&$pos) {\n\t\t//do away with function-keyword and whitespace between it and the functionname\n\t\tDokser::skipWhitespaceAndComments($contents, $pos+=strlen('function'));\n\t\tpreg_match('/'.Dokser::$labelReg.'/',$contents,$match,PREG_OFFSET_CAPTURE,$pos);//get functionname\n\t\t$functionName=$match[0][0];\n\t\t$function=['name'=>$functionName,'params'=>[]];\n\t\tDokser::skipWhitespaceAndComments($contents, $pos+=strlen($functionName));//skip to \"(\"\n\t\tDokser::skipWhitespaceAndComments($contents, ++$pos);//skip \"(\" and its proceeding whitespace\n\t\twhile (preg_match($reg='#,?(&?\\$'.Dokser::$labelReg.'|\\))#',$contents,$match,0,$pos)\n\t\t\t\t&&($paramName=$match[1])!=')') {\n\t\t\t$param=['name'=>$paramName];\n\t\t\tDokser::skipWhitespaceAndComments($contents, $pos+=strlen($paramName));\n\t\t\tif ($contents[$pos]=='=') {\n\t\t\t\tDokser::skipWhitespaceAndComments($contents, $pos+=1);//skip whitespace after \"=\"\n\t\t\t\t$param['defaultValue']=Dokser::consumeValue($contents, $pos);\n\t\t\t}\n\t\t\t$function['params'][]=$param;\n\t\t}\n\t\t$functions=[$function];\n\t\t//look for \"/*\" or \"//\" or \"}\" or single quote or double quote or \"{\" or \"function\"\n\t\t$braceLevel=0;\n\t\twhile (preg_match('#/\\*|//|function|[}\\x27\\x22{]#',$contents,$match,PREG_OFFSET_CAPTURE,$pos)) {\n\t\t\t$str=$match[0][0];\n\t\t\t$pos=$match[0][1];\n\t\t\tif ($str=='/*'||$str=='//') {\n\t\t\t\tDokser::skipWhitespaceAndComments($contents, $pos);\n\t\t\t} else if ($str==\"'\"|$str=='\"') {\n\t\t\t\tDokser::consumeString($contents, $pos);\n\t\t\t} else if ($str=='function') {//functions may have inner functions, which however too are global\n\t\t\t\t$functions+=Dokser::processFunction($contents, $pos);\n\t\t\t} else if ($str=='{') {\n\t\t\t\t++$braceLevel;\n\t\t\t\t++$pos;\n\t\t\t} else if ($str=='}') {\n\t\t\t\t++$pos;\n\t\t\t\tif (!--$braceLevel) {\n\t\t\t\t\treturn $functions;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function renderFunctions() {\n\n $this->functions[\"private\"] = $this->accessor->getFunctionsByAccess(\"private\");\n $this->functions[\"public\"] = $this->accessor->getFunctionsByAccess(\"public\");\n\n if (0 == count($this->functions[\"private\"]) && 0 == count($this->functions[\"public\"]))\n return;\n\n $this->renderFunctionSummary();\n $this->renderFunctionDetail();\n $this->functions = array();\n \n }", "public function proccess(){\n\t\t#Get endpoint params\n\t\t$endpointParams = $this->getEndpointParams();\n\t\t#Check if endpoint was read\n\t\tif($endpointParams == []) return [\"success\" => 0, \"msg\" => \"The requested endpoint ({$this->endpointURL}) didn't match any expected command. Please give a check on <a href='index.php'>index.php</a> for a list of available endpoints.\"];\n\t\t#Get current command (the first part of endpoint) and also removes it from the arguments array\n\t\t$currentCommand = array_shift($endpointParams);\n\t\t#Execute command and return output\n\t\tswitch ($currentCommand) {\n\t\t\t#List upcoming movies\n\t\t\tcase 'upcoming': return $this->retrieveUpcomingMovies($endpointParams);\n\t\t\t#Get movie info\n\t\t\tcase 'movie': return $this->retrieveMovie($endpointParams);\n\t\t\t#Search for movies using terms\n\t\t\tcase 'search': return $this->retrieveSearch($endpointParams);\n\t\t\t#Fallback\n\t\t\tdefault: return [\"success\" => 0, \"msg\" => \"The command '{$currentCommand}' is unknown! Please give a check on <a href='index.php'>index.php</a> for a list of available endpoints.\"];\n\t\t}\n\t}", "function process() {\r\n }", "public function getFunction(): string;", "public function functions() {\n foreach ( $this->soap->__getFunctions() as $f ) {\n $fname = explode( ' ', $f );\n $functions[] = substr( $fname[0], 0, ( strlen( $fname[0] ) - 8 ) );\n }\n\n return $functions;\n }", "public function getProcessData()\n {\n }", "public function processApi(){\r\n\t\t\t$service = explode(\"/\", $_GET['x']);\r\n\t\t\t$this->entity = ucfirst($service[0]);\r\n\t\t\t$this->methode = $service[1];\r\n\t\t\t$func = $this->methode.$this->entity;\r\n\t\t\t$this->addLog('--'.$this->methode.$this->entity);\r\n\t\t\tif((int)method_exists($this,$func) > 0)\r\n\t\t\t\t$this->$func();\r\n\t\t\telse\r\n\t\t\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\r\n\t\t\t\t\r\n\t\t}", "public function process() {\n $call = $this->getData('p');\n\n if(method_exists($this, $call)) {\n $this->$call();\n } else {\n $this->output = array(\n 'success' => false,\n 'key' => 'eeek'\n );\n\n $this->renderOutput();\n }\n }", "public function functions()\n\t{\n\t\treturn $this->getFunctions();\n\t}", "function getFuncSpecVars($api_function) {\n\t\t$function_vars = explode(\"_\", $api_function);\n\t\t$function_vars['fid'] = (int)$function_vars['0'];\n\t\t$function_vars['fcmd'] = (int)$function_vars['1'];\n\t\treturn $function_vars;\n\t}", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n//echo $func;\t\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\n\t\t}", "public function scriptsFunctions()\r\n {\r\n if(isset($_GET['action']) && $_GET['action'] == 'record')\r\n {\r\n $this->recordEpisodeView();\r\n }\r\n else\r\n {\r\n echo 'That was not the function you were looking for..';\r\n }\r\n }", "public function process() {}", "public function process() {}", "public function process() {}", "public function process() {}", "function processData() ;", "public function processApi(){\n\t\tif(isset($_REQUEST['x']) && $_REQUEST['x']!=\"\"){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\", $_REQUEST['x'])));\n\t\t\tif((int)method_exists($this,$func) > 0) {\n\t\t\t\t$this->$func();\n\t\t\t} else {\n\t\t\t\techo 'processApi - method not exist';\n\t\t\t\texit;\n\t\t\t}\n\t\t} else {\n\t\t\techo 'processApi - method not exist';\n\t\t\texit;\n\t\t}\n\t}", "function func1(){\n echo 'value of function 1';\n }", "static function debug_info(){\n $di = debug_backtrace();\n $valid_caller_functions = array(\"on\",\"off\", \"alert\", \"debug\", \"error\", \"function_entry\", \"function_exit\");\n $caller_class = $di[1]['class'];\n $caller_function = $di[1]['function'];\n if( !(\n ($caller_class == 'Trace') && (in_array($caller_function, $valid_caller_functions)) \n )\n ) throw new \\Exception(__METHOD__.\" called from wrong/invalid place caller is $caller_class::$caller_function\"); \n// var_dump($di[2]);exit();\n $obj = new stdClass();\n $obj->file = $di[1]['file'];\n $obj->line_number = $di[1]['line'];\n $obj->function = $di[2]['function'];\n $obj->class = (array_key_exists('class', $di[2]))? $di[2]['class'] : \"*\";\n $obj->type = (array_key_exists('type', $di[2]))? $di[2]['type'] : \"\";\n if( array_key_exists('args', $di[2]) ){\n $obj->args = \"\";\n foreach($di[2]['args'] as $args){\n if(is_array($args) ) \n $a = print_r($args, true);\n else if(is_object($args) ) \n $a = \"Object of class:[\".get_class($args).\"]\" ;//var_export($args, true);\n else \n $a = $args.\"\";\n $obj->args .= $a.\", \";\n } \n }\n// $obj->args = (array_key_exists('args', $di[2]))? implode(',', $di[2]['args']) : \"\";\n $obj->backtrace = $di; \n $obj->string = $obj->class.$obj->type.$obj->function;//.\"[\". $file.\"::\".$line_number.\"]\";\n return $obj;\n }", "function test(){ \n //print the function name i.e; test. \n echo 'The function name is '. __FUNCTION__ . \"<br><br>\"; \n }", "public function processApi() {\n if (isset($_REQUEST['x']) && $_REQUEST['x'] != \"\") {\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['x'])));\n if ((int)method_exists($this, $func) > 0) {\n $this->$func();\n } else {\n echo 'method not exist';\n exit;\n }\n } else {\n echo 'method not exist';\n exit;\n }\n }", "function listAllFunctions() {\n include_once $_SERVER['DOCUMENT_ROOT'] . '/saved/functions.php';\n\n //Keep track of the names of the functions:\n $FUNCTIONS_ID = [\n 0 => 'Simple Div',\n 1 => 'Simple Link',\n 2 => 'Image',\n ];\n\n //Store the actual functions here.\n $FUNCTIONS_LIST = [];\n\n foreach($FUNCTIONS_ID as $function_id) {\n echo '<li>';\n echo '<div class=\"clones\" id=\"' . $function_id . '\">' . $function_id . '</div>';\n echo '</li>';\n }\n }", "abstract protected function exportFunctions();", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "function MyMod_Handle_Process()\n {\n return $this->ApplicationObj()->MyApp_Handle_Process();\n }", "public function processApi() {\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n if((int)method_exists($this, $func) > 0)\n $this->$func();\n else\n $this->response('',404);\n }", "public function process() {\n }", "public function process() {\n }", "public function process() {\n }", "public abstract function process();", "private function get_caller_info($dbt = array()) {\n\n $this->cresolved = true;\n\n // object call\n if(count($dbt)>=2 && array_key_exists(\"class\",$dbt[1])) {\n return basename($dbt[1][\"class\"]).\"::\".$dbt[1][\"function\"].\n \"(\".$dbt[0][\"line\"].\"): \";\n\n // function call\n } else if(count($dbt)>=2 && !array_key_exists(\"class\",$dbt[1])) {\n return basename($dbt[0][\"file\"]).\"::\".$dbt[1][\"function\"].\n \"(\".$dbt[0][\"line\"].\"): \";\n\n // direct call\n } else if(count($dbt)===1) {\n return basename($dbt[0][\"file\"]).\"(\".$dbt[0][\"line\"].\")Y: \";\n\n // otherwise be able to recognize non regarded caller scenarios\n } else {\n return \"Unknown::function(-1): \";\n\n } \n\n }", "public function getFunctions()\n\t{\n\t\treturn $this->__getFunctions();\n\t}", "function getInfo();", "abstract protected function _process();", "abstract protected function _process();", "function fpg_functions($name, $params) {\n\t$return_type = $params['return'];\n\t$return_cmd = 'RETURN_';\n\tswitch ($return_type) {\n\t case 'float':\n\t case 'double':\n\t case 'fann_type':\n\t\t $return_cmd .= 'DOUBLE';\n\t\t break;\n\t case 'int':\n\t\t $return_cmd .= 'LONG';\n\t\t break;\n\t}\n\tif ($params['has_getter']) {\n\t\t$body = $params['empty_function'] ? \"\": \"PHP_FANN_GET_PARAM(fann_get_$name, $return_cmd);\";\n\t\t$getter = \"\n/* {{{ proto bool fann_get_$name(resource ann)\n Returns {$params['comment']} */\nPHP_FUNCTION(fann_get_$name)\n{\n\t$body\n}\n/* }}} */\";\n\t\tfpg_printf($getter);\n\t}\n\tif ($params['has_setter']) {\n\t\t$set_args = \"fann_set_$name\";\n\t\t$comment_args = \"resource ann\";\n\t\tforeach ($params['params'] as $param_name => $param_type) {\n\t\t\t$comment_args .= sprintf(\", %s %s\", $param_type == 'fann_type' ? 'double' : $param_type, $param_name);\n\t\t\t$set_args .= sprintf(\", %s\", $param_type == 'int' ? 'l, long' : 'd, double');\n\t\t}\n\t\t$body = $params['empty_function'] ? \"\": \"PHP_FANN_SET_PARAM($set_args);\";\n\t\t$setter = \"\n/* {{{ proto bool fann_set_$name($comment_args)\n Sets {$params['comment']}*/\nPHP_FUNCTION(fann_set_$name)\n{\n $body\n}\n/* }}} */\";\n\t\tfpg_printf($setter);\n\t}\n}", "public function process()\n {\n\n }", "protected abstract function process();", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n\t\t\tif((int)method_exists($this,$func) > 0) {\n $this->$func();\n }\n\t\t\telse {\n $this->response('',404); // If the method not exist with in this class \"Page not found\". \n }\n\t\t\t\t\n\t\t}", "public function processAll();", "abstract public function get__do_process ( $data );", "public function getFunctions()\n {\n return $this->__getFunctions();\n }", "public static function getFunctionList()\n {\n return ['onePageFunction'];\n }", "public function func()\n {\n if ($this->lookahead->type == ControlFunctionLexer::NAME) {\n if (array_key_exists($this->lookahead->text, FunctionDispatcher::$functionNames)) {\n $this->function_name = $this->lookahead->text;\n //$this->function_index = FunctionDispatcher::$functionNames[$this->lookahead->text];\n $this->function_index = FunctionDispatcher::functionIndex($this->lookahead->text);\n } else {\n throw new \\Exception(\"Функция <$this->function_name> не существует\");\n }\n $this->root = new ControlFunctionParseTree($this->lookahead->type, $this->function_name);\n //$this->root = $this->currentNode;\n $this->match(ControlFunctionLexer::NAME);\n $this->cargs();\n } else {\n throw new \\Exception(\n \"Ожидалось объявление функции контроля (сравнение, зависимость ...). Получено \" .\n ControlFunctionLexer::$tokenNames[$this->lookahead->type]\n );\n }\n }", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['value'])));\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "abstract protected function process();", "abstract protected function process();", "abstract protected function process();", "abstract protected function process();", "public function processApi()\n {\n\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['x'])));\n if ((int) method_exists($this, $func) > 0) {\n $this->$func();\n }\n else {\n $this->response('', 404);\n }\n }", "public function getFunction()\n {\n return $this->function;\n }", "public function getFunctions()\n {\n return array();\n }", "public function getFunctionInfo($schema='',$oid='')\n {\n\n \n return $this->retriever->getFunctions($schema, $oid);\n }", "protected function process()\n {}", "private function getFuction() {\n return $this->_function;\n }", "abstract public function process();", "abstract public function process();", "abstract public function process();", "public function getInfo()\n {\n ob_start();\n echo '<h3>ForWeb framework Access package</h3>';\n echo \"<p>Contain functions for user access. Main module terms - 'user group' and 'action'.\"\n .\" Each user can belong to only one user group, by default system contain three groups:</p>\";\n echo \"<ul>\";\n echo \"<li>anonymous</li>\";\n echo \"<li>authorized</li>\";\n echo \"<li>administrator</li>\";\n echo \"</ul>\";\n echo \"<p>You can add any other user group, or delete this groups. All groups have equals 'actions', but\"\n .\" different permissions. This module have code-generic functionality, and you must know what are you doing,\"\n .\" when delete any permissions. Core package does not use generic-code, but any custom module can use some\"\n .\" of them. So, if module contain use generic-access function, you will get an exception.</p>\";\n $out = ob_get_contents();\n ob_end_clean();\n return $out;\n }", "function defaultProcessFunctionResource($parent_odin_path,$resource_id,$req_resource_versoin){\n global $gArrayCoinTypeSet;\n \n $tmp_posn_func_flag=strpos($resource_id,'(');\n $function_name=substr($resource_id,0,$tmp_posn_func_flag);\n $argvs_chunks=explode(\",\",substr($resource_id,$tmp_posn_func_flag+1,strlen($resource_id)-$tmp_posn_func_flag-2));\n\n //默认不带具体版本号,表示内容是动态生成的,且下一次同样标识请求的处理结果是相同的,允许缓存生效\n $resp_resource_versoin=\"\"; \n \n \n //带时间作为版本号,表示内容是动态生成的,且下一次同样标识请求的处理结果是不同的,缓存应禁止\n //$resp_resource_versoin=@strftime(\"20%y%m%d%H%M%S\",time()); \n \n //可具体实现对请求中req_resource_versoin的支持处理,允许或不支持返回指定历史结果\n if(strlen($req_resource_versoin)>0){\n return array('code'=>410,\"msg\"=>\"History result not supported!\");\n }\n\n if($function_name=='helloworld'){\n $tmp_function_result = array(\n 'code'=>0,\n \"result_data\"=> \"helloworld() OK\"\n );\n }else if($function_name=='sum'){\n $sum_result=0;\n \n for($kk=0;$kk<count($argvs_chunks);$kk++){\n $sum_result += $argvs_chunks[$kk];\n }\n $tmp_function_result = array(\n 'code'=>0,\n \"result_data\"=>array(\n \"sum\"=>$sum_result,\n \"time1\"=>time(),\n \"time2\"=>\\PPkPub\\Util::formatTimestampForView(time())\n )\n );\n }else{\n $tmp_function_result = array('code'=>404,\"msg\"=>\"Not existed function:\".$function_name);\n }\n \n if($tmp_function_result['code'] != 0 ) {\n return $tmp_function_result;\n }\n \n $array_result=array();\n \n /*\n //Only for debug\n $array_result['ppk_debug_info']=array(\n 'function_name'=>$function_name,\n 'function_argvs'=>$argvs_chunks,\n 'time'=>@strftime(\"20%y-%m-%d %H:%M:%S\",time()),\n );\n */ \n \n $str_local_uri=\\PPkPub\\ODIN::PPK_URI_PREFIX\n .$parent_odin_path\n .\"/\".$resource_id\n .\\PPkPub\\ODIN::PPK_URI_RESOURCE_MARK\n .$resp_resource_versoin;\n \n $str_content_type='text/json';\n \n return array(\n 'code'=>0,\n 'result_data'=>array(\n 'local_uri'=>$str_local_uri,\n 'content_type'=>$str_content_type,\n 'content'=>json_encode($tmp_function_result['result_data']),\n \\PPkPub\\PTTP::PTTP_KEY_CACHE_AS_LATEST=>\\PPkPub\\AP::DYNAMIC_CACHE_AS_LATEST,\n ) \n );\n}", "public function doProcessData() {}", "abstract public function getNumFunctions();", "public function processApi(){\n\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n\tif((int)method_exists($this,$func) > 0)\n\t\t$this->$func();\n\telse\n\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\n}", "function menuProcess($ussd_body, $mobile_number, $session_id, $sessdetails) {\n try {\n\t\t\t$time_monitor_start = microtime(true);\n $method_details = $sessdetails['status'];\n $status = explode(\"|\", $method_details);\n if (count($status) > 1) {\n $className = ucfirst($status[2]);\n $methodName = lcfirst($status[1]);\n $task = new $className($this->functions);\n\t\t\t\t\n $responseArr = $task->$methodName($ussd_body, $mobile_number, $session_id, $sessdetails);\n } else {\n\t\t\t\t$methodName = trim(lcfirst($status[0]));\n $responseArr = $this->$methodName($ussd_body, $mobile_number, $session_id, $sessdetails);\n }\n\t\t\t$time_taken = microtime(true) - $time_monitor_start;\n if (floatval($time_taken) > 1.00) {\n $this->functions->log(\"TIME_MONITOR\", $className, $methodName . ': ' . $time_taken);\n }\n return $responseArr;\n } catch (Exception $e) {\n $this->functions->log(\"ERROR\", __CLASS__, __FUNCTION__ . ': ' . $e->getMessage() . date('His'));\n }\n }", "function main()\n{\n //getRequestidhl();\n\t //getRequestidlap();\n\t getRequestidpl();\n\n\t\n}", "public function getFunction()\n {\n return $this->metaRefreshValues['function'];\n }", "public function process() {\n\n\t\t$this->out = array();\n\n\t\tif ($inputFile = $this->getInputFile()) {\n\n\t\t\t// Read basic metadata from file, write additional metadata to $info\n\t\t\t$imageSize = getimagesize($inputFile, $info);\n\n\t\t\t// Parse metadata from getimagesize\n\t\t\t$this->out['unit'] = 'px';\n\n\t\t\tif (isset($imageSize['channels'])) {\n\t\t\t\t$this->out['color_space'] = $this->getColorSpace($imageSize['channels']);\n\t\t\t}\n\n\t\t\t// Makes sure the function exists otherwise generates a log entry\n\t\t\tif (function_exists('exif_imagetype') && function_exists('exif_read_data')) {\n\n\t\t\t\t// Determine image type\n\t\t\t\t$imageType = exif_imagetype($inputFile);\n\n\t\t\t\t// Only try to read exif data for supported types\n\t\t\t\tif (in_array($imageType, $this->allowedImageTypes)) {\n\n\t\t\t\t\t$exif = @exif_read_data($inputFile, 0, TRUE);\n\n\t\t\t\t\t// Parse metadata from EXIF GPS block\n\t\t\t\t\tif (is_array($exif['GPS'])) {\n\t\t\t\t\t\t$this->out['latitude'] = $this->parseGPSCoordinate($exif['GPS']['GPSLatitude'], $exif['GPS']['GPSLatitudeRef']);\n\t\t\t\t\t\t$this->out['longitude'] = $this->parseGPSCoordinate($exif['GPS']['GPSLongitude'], $exif['GPS']['GPSLongitudeRef']);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Parse metadata from EXIF EXIF block\n\t\t\t\t\tif (is_array($exif['EXIF'])) {\n\t\t\t\t\t\t$this->out['creation_date'] = strtotime($exif['EXIF']['DateTimeOriginal']);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Parse metadata from EXIF IFD0 block\n\t\t\t\t\tif (is_array($exif['IFD0'])) {\n\n\t\t\t\t\t\tforeach ($exif['IFD0'] as $exifAttribute => $value) {\n\n\t\t\t\t\t\t\tswitch ($exifAttribute) {\n\n\t\t\t\t\t\t\t\tcase 'ApertureValue':\n\t\t\t\t\t\t\t\t\t$parts = explode('/', $value);\n\t\t\t\t\t\t\t\t\t$this->out['aperture_value'] = round(exp(($parts[0] / $parts[1]) * 0.51 * log(2)), 1);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ShutterSpeedValue':\n\t\t\t\t\t\t\t\t\t$parts = explode('/', $value);\n\t\t\t\t\t\t\t\t\t$this->out['shutter_speed_value'] = (int) pow(2, $parts[0] / $parts[1]);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ISOSpeedRatings':\n\t\t\t\t\t\t\t\t\t$this->out['iso_speed_ratings'] = $value;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'Model':\n\t\t\t\t\t\t\t\t\t$this->out['camera_model'] = $value;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ExposureTime':\n\t\t\t\t\t\t\t\t\t$this->out['exposure_time'] = strtotime($value);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'Flash':\n\t\t\t\t\t\t\t\t\t$this->out['flash'] = $value;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'MeteringMode':\n\t\t\t\t\t\t\t\t\t$this->out['metering_mode'] = $value;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ColorSpace':\n\t\t\t\t\t\t\t\t\t$this->out['color_space'] = $this->getColorSpace($value);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'XResolution':\n\t\t\t\t\t\t\t\t\t$this->out['horizontal_resolution'] = $this->fractionToInt($value);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'YResolution':\n\t\t\t\t\t\t\t\t\t$this->out['vertical_resolution'] = $this->fractionToInt($value);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'Subject':\n\t\t\t\t\t\t\t\t\t$this->out['description'] = $value;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'DateTime':\n\t\t\t\t\t\t\t\t\t$this->out['modification_date'] = strtotime($value);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'Software':\n\t\t\t\t\t\t\t\t\t$this->out['creator_tool'] = $value;\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::devLog('Function exif_imagetype() and exif_read_data() are not available. Make sure Mbstring and Exif module are loaded.', 2);\n\t\t\t}\n\n\t\t\t// Check if IPTC metadata exists\n\t\t\tif (isset($info['APP13'])) {\n\t\t\t\t$iptc = iptcparse($info['APP13']);\n\t\t\t}\n\n\t\t\t// Parse metadata from IPTC APP13\n\t\t\tif (is_array($iptc)) {\n\n\t\t\t\t$iptcAttributes = array(\n\t\t\t\t\t'2#005' => 'title',\n\t\t\t\t\t'2#120' => 'caption',\n\t\t\t\t\t'2#025' => 'keywords',\n\t\t\t\t\t'2#085' => 'author',\n\t\t\t\t\t'2#115' => 'publisher',\n\t\t\t\t\t'2#080' => 'creator',\n\t\t\t\t\t'2#116' => 'copyright_notice',\n\t\t\t\t\t'2#100' => 'location_country',\n\t\t\t\t\t'2#090' => 'location_city',\n\t\t\t\t\t'2#055' => 'creation_date',\n\t\t\t\t);\n\n\t\t\t\tforeach ($iptcAttributes as $iptcAttribute => $mediaField) {\n\t\t\t\t\tif (isset($iptc[$iptcAttribute])) {\n\t\t\t\t\t\t$this->out[$mediaField] = $iptc[$iptcAttribute][0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Convert each metadata value from its encoding to utf-8\n\t\t\t$this->out = \\TYPO3\\CMS\\Metadata\\Utility\\Unicode::convert($this->out);\n\n\t\t} else {\n\t\t\t$this->errorPush(T3_ERR_SV_NO_INPUT, 'No or empty input.');\n\t\t}\n\n\t\treturn $this->getLastError();\n\t}" ]
[ "0.6805217", "0.6554468", "0.6483468", "0.64659536", "0.6375108", "0.629506", "0.6241058", "0.60791516", "0.6041176", "0.6026113", "0.59816885", "0.5970946", "0.5970946", "0.5970946", "0.5970946", "0.5939017", "0.593513", "0.591239", "0.5906057", "0.58735883", "0.58542895", "0.5806704", "0.579065", "0.576463", "0.57556206", "0.5749906", "0.57491845", "0.5723393", "0.57211167", "0.5686166", "0.56853545", "0.568306", "0.5673747", "0.5667352", "0.5619005", "0.56120634", "0.5606559", "0.56030416", "0.5601473", "0.5596459", "0.55910414", "0.55897444", "0.55897444", "0.55897444", "0.5589442", "0.55816966", "0.5579369", "0.5576226", "0.55761427", "0.55605876", "0.555995", "0.5548292", "0.5541693", "0.5541693", "0.5541693", "0.5541693", "0.5522862", "0.55208534", "0.54899067", "0.54899067", "0.54899067", "0.5476257", "0.5473786", "0.5473177", "0.54665333", "0.54621035", "0.54621035", "0.5445227", "0.54393065", "0.5433067", "0.5432598", "0.54203427", "0.54179007", "0.540297", "0.53923726", "0.5387552", "0.538395", "0.5375391", "0.5373177", "0.5373177", "0.5373177", "0.5373177", "0.53622556", "0.53598386", "0.5353561", "0.5351412", "0.53431636", "0.5342447", "0.53423935", "0.53423935", "0.53423935", "0.5341719", "0.5341012", "0.53406894", "0.5302502", "0.5299033", "0.528114", "0.5275645", "0.5274228", "0.5268501" ]
0.59870875
10
Save Processes And Functions Data
public function ProcessesandFunctions() { $data = array(); $where = array(); $where['FunctionID']=$this->input->post('def_functionid'); $data['FunctionID']=$this->input->post('functionid'); $data['FunctionDescription']=$this->input->post('functiondesc'); $data['FunctionAccess']=$this->input->post('functionaccess'); $data['FunctionComponent']=$this->input->post('functioncomponent'); if($where['FunctionID'] == '0') { $result=$this->system_structure_m->insert_processesandfunctions($data); } else { $result=$this->system_structure_m->update_processesandfunctions($data,$where); } echo $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProcessData()\n {\n }", "public function saveData()\r\n {\r\n \r\n }", "function process() ;", "function processData() ;", "public function saveDataToFile()\n {\n\n }", "function saveData() {\n\n\t\t$this->getMapper()->saveData();\t\n\t\t\n\t\t\n\t}", "protected function saveToVariableHandlers()\n {\n foreach ($this->workflow->getVariableHandlers() as $variableName => $className) {\n if (isset($this->variables[$variableName])) {\n $object = new $className;\n $object->save($this, $variableName, $this->variables[$variableName]);\n }\n }\n }", "public function saveAtShutdown()\n {\n $func = [\n $this,\n \"save\",\n ];\n register_shutdown_function($func, true);\n }", "function saveVister()\n {\n \n }", "public function doProcessData() {}", "private static function save() {\n\t\tif(self::$data===null) throw new Excepton('Save before load!');\n\t\t$fp=fopen(self::$datafile,'w');\n\t\tif(!$fp) throw new Exception('Could not write data file!');\n\t\tforeach (self::$data as $item) {\n\t\t\tfwrite($fp,$item); // we use the __toString() here\n\t\t}\n\t\tfclose($fp);\n\t}", "public function save_all() {\n\t\t$this->save_api();\n\t\t$this->save_field_map();\n\t\t$this->save_import();\n\t\t$this->save_requirement_set();\n\t}", "public function set_process()\n {\n $this->rewrite = $this->set_CheckedValue(\"Process_Rewrite\");\n $this->extension = $this->set_CheckedValue(\"Process_Extension\");\n $this->stranglerPattern = $this->set_CheckedValue(\"Process_StranglerPattern\");\n $this->continuousEvolution = $this->set_CheckedValue(\"Process_ContinuousEvolution\");\n $this->split = $this->set_CheckedValue(\"Process_Split\");\n $this->processStrategyOthers = $this->set_CheckedValue(\"Process_Others\");\n }", "function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }", "public function save()\n\t{\n\t\t// No operation. This is a CLI session, we save nothing.\n\t}", "private function processInstance()\n\t{\n\t\t$instanceBin = $this->rebuildInstance( $this->Instance );\n\t\tfwrite( $this->WriteFile, $instanceBin );\n\t}", "function persist() ;", "public static function saveStats()\r\n {\r\n }", "abstract public function put__do_process ();", "public static function post_process() {}", "public function processData() {}", "protected function saveFactoryState()\n\t{\n\t\t$this->savedFactoryState['application'] = JFactory :: $application;\n\t\t$this->savedFactoryState['config'] = JFactory :: $config;\n\t\t$this->savedFactoryState['session'] = JFactory :: $session;\n\t\t$this->savedFactoryState['language'] = JFactory :: $language;\n\t\t$this->savedFactoryState['document'] = JFactory :: $document;\n\t\t$this->savedFactoryState['acl'] = JFactory :: $acl;\n\t\t$this->savedFactoryState['database'] = JFactory::$database;\n\t\t$this->savedFactoryState['mailer'] = JFactory :: $mailer;\n\t\t$this->savedFactoryState['shconfig'] = SHFactory::$config;\n\t\t$this->savedFactoryState['shdispatcher'] = SHFactory::$dispatcher;\n\t}", "public function postProcess();", "function save();", "function save();", "function persistAll() ;", "protected function saveData()\n {\n // TODO: データ保存\n\n // 一次データ削除\n $this->deleteStore();\n\n drupal_set_message($this->t('The form has been saved.'));\n }", "private function save() {\n\t\t// Nur speichern, wenn nötig, also, wenn sich was geändert hat, also\n\t\t// wenn recompute gemacht wurde\n\t\tif ($this->need_recompute) {\n\t\t\tquery(\n\t\t\t\t\"INSERT INTO computed_maps SET world_id={$this->world_id}, \".\n\t\t\t\t\t\"map_id={$this->id}, \".\n\t\t\t\t\t\"time_computed=\".Time::get_t_now().\", \".\n\t\t\t\t\t\"insert_finished=0\"\n\t\t\t);\n\t\t\t$this->last_compute_id =\n\t\t\t\tmysql_result(query(\"SELECT LAST_INSERT_ID()\"),0);\n\t\t\t$this->last_compute_time = Time::get_t_now();\n\n\t\t\t$this->computed_map_data->save($this->last_compute_id);\n\t\t\t$this->computed_buildings_data->save($this->last_compute_id);\n\t\t\t$this->computed_tribes_data->save($this->last_compute_id);\n\t\t\t$this->computed_sector_data->save($this->last_compute_id);\n\t\t\t$this->moving_tribes_data->save();\n\n\t\t\t// TODO: ROLLBACK ON FAILURE\n\n\t\t\tquery(\n\t\t\t\t'UPDATE computed_maps SET insert_finished=1 '.\n\t\t\t\t'WHERE world_id='.$this->world_id.' AND map_id='.$this->id.' '.\n\t\t\t\t\t'AND compute_id='.$this->last_compute_id\n\t\t\t);\n\t\t}\n\t}", "public function newImportProcesses()\n {\n \n }", "public function save()\n {\n App::cliLog(\"Saving to $this->format file\", false);\n\n try {\n call_user_func([$this, 'export' . ucfirst($this->format)]);\n } catch (Exception $e) {\n App::cliLog($e->getMessage());\n }\n }", "public static function saveCommonData()\n {\n // Save needed data\n $_SESSION[self::LAST_PAGE_SESSION_NAME] = Server::getAbsoluteURL();\n }", "public function RunDataProcess()\n {\n // TODO: Implement RunDataProcess() method.\n }", "function processData() \n {\n \n // store values in table manager object.\n $moduleID = $this->dataManager->getModuleID();\n $moduleCreator = new ModuleCreator( $moduleID, $this->pathModuleRoot);\n $moduleCreator->createModule();\n \n }", "public function process();", "public function process();", "public function process();", "public function process();", "public static function process() {}", "function saveAndFlushCalculationCaches() {\n\n $this->saveToFile();\n\n $file = $this->getExtractedFile();\n\n $this->flushFileCachedValues();\n\n $this->saveToFile();\n }", "function Save();", "protected function saveData()\n\t{\n\t\treturn $this->saveDb();\n\t}", "public function process() {}", "public function process() {}", "public function process() {}", "public function process() {}", "function save_result_as_node($result){\n// dpm($result);\n global $user;\n try {\n $node = (object) NULL;;\n $node->title = $result['data']['vappName'];\n $node->type = 'running_service';\n $node->uid = $user->uid;\n $node->status = 1; //(1 or 0): published or not\n $node->promote = 0; //(1 or 0): promoted to front page\n $node->comment = 0; // 0 = comments disabled, 1 = read only, 2 = read/write\n// $node->field_template_name['und'][0]['value'] = $result['data']['vms'][0]['name'];\n// $node->field_cpu['und'][0]['value'] =$result['data']['vms'][0]['cpu'];\n// $node->field_power_status['und'][0]['value'] =$result['data']['vms'][0]['powerStatus'];\n// $node->field_memory['und'][0]['value'] =$result['data']['vms'][0]['memory'];\n// $node->field_storage['und'][0]['value'] =$result['data']['vms'][0]['hardDisk'][0]['size'];\n// $node->field_storage['und'][0]['value'] ='40960 Mb';//test data,the storage data not prepared.\n// $node->field_ip_address['und'][0]['value'] =$result['data']['vms'][0]['network'][0]['ipAddress'];\n $node->field_task_id['und'][0]['value'] =$result['data']['taskId'];\n $node->field_vappid['und'][0]['value'] =$result['data']['vappId'];\n $node->field_progress['und'][0]['value'] =0;\n $node = node_submit($node); // Prepare node for saving\n node_save($node);\n //dpm($result);\n }catch (Exception $e) {\n drupal_set_message($e->__toString(),'error');\n }\n}", "private function createSavegame()\n {\n if (isset($this->savegame)) {\n posix_kill($this->savegame, SIGKILL);\n }\n\n $pid = pcntl_fork();\n\n if ($pid) {\n // Save the savegame PID for later\n $this->savegame = $pid;\n file_put_contents($this->savegameFile, $this->savegame);\n } else {\n // Stop and wait until savegame is needed.\n posix_kill(posix_getpid(), SIGSTOP);\n\n // Savegame has been resumed\n // We'll need a new monitor and savegame\n $this->createMonitor();\n $this->createSavegame();\n }\n }", "function saveForm(){\t\n\t\t$this->saveFormBase();\n\t\t$this->saveFormGeoCoverage();\n\t\t$this->saveVaFormResolution();\n\t\tif ($this->dataset->nbModForm >0) $this->saveModForm();\n\t\tif ($this->dataset->nbSatForm >0) $this->saveSatForm();\n\t\tif ($this->dataset->nbInstruForm >0) $this->saveInstruForm();\n\t\t$this->saveFormGrid();\n\t\t//Parameter\n\t\t$this->saveFormVariables($this->dataset->nbVars);\n\t\t//REQ DATA_FORMAT\n\t\t$this->dataset->required_data_formats = array();\n\t\t$this->dataset->required_data_formats[0] = new data_format;\n\t\t$this->dataset->required_data_formats[0]->data_format_id = $this->exportValue('required_data_format');\n\t}", "public function storeIncomingData() {}", "function save(ezcWorlflow $workflow) {\n\t\t\n\t}", "private function saveData(): void\n {\n $this->tab_chat_call->call_update = gmdate(\"Y-m-d H:i:s\"); //data e hora UTC\n $result = $this->tab_chat_call->save();\n\n if ($result) {\n $this->Result = true;\n $this->Error = [];\n $this->Error['msg'] = \"Sucesso!\";\n $this->Error['data']['call'] = $this->tab_chat_call->call_id;\n } else {\n $this->Result = false;\n $this->Error = [];\n $this->Error['msg'] = $this->tab_chat_call->fail()->getMessage();\n $this->Error['data'] = null;\n }\n }", "public function save() {\n\t\t$this->data[] = $this->current();\n\t}", "public function store()\n {\n $classes = [];\n\n foreach ($this->classes as $class) {\n $classes[] = $class['input_file'];\n }\n\n $json_classes = json_encode($classes);\n\n $this->filesystem->put(config('larinterface.cache_directory') . '/larinterface.json', $json_classes);\n }", "private function saveData()\n { \n // Save form data in session\n if (count($this->post) > 0) {\n $_SESSION['gentlesource_voting_configuration'] = $this->post;\n $this->data = $this->post;\n $this->votingOptions = $this->post['votingOptions'];\n } else {\n if (isset($_SESSION['gentlesource_voting_configuration'])) {\n $this->data = $_SESSION['gentlesource_voting_configuration'];\n $this->votingOptions = $this->data['votingOptions'];\n }\n }\n }", "public function save():void;", "function process() {\r\n }", "public function save()\n {\n return $this->processor->save();\n }", "public function snapshot(): void\n\t{\n\t\t$this->processor->snapshot();\n\t}", "public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\t$dest = $this->getStorageFile();\n\t\t\t\n\t\t\tif(file_exists($dest) and is_writable($dest)===false)\n\t\t\t{\n\t\t\t\t@chmod($dest,0777);\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dest,$this->mode);\n\t\t\tfwrite($fp,$this->data);\n\t\t\tfclose($fp);\n\t\t\t$this->afterSave();\n\t\t}\n\t}", "public function getFileProcObj() {}", "public function getFileProcObj() {}", "public function save_run($xhprof_data, $type, $run_id = null);", "public function processAll();", "public function persist()\n {\n $uid = $this->getIdentifier() == 0 ? 'NEW' . rand(100000, 999999) : $this->getIdentifier();\n $data = [\n trim(static::$storageTableName) => [\n $uid => $this->getPersistableDataArray()\n ]\n ];\n // New records always must have a pid\n if ($this->getIdentifier() == 0) {\n $data[trim(static::$storageTableName)][$uid]['pid'] = 0;\n }\n /** @var \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler $tce */\n $tce = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\DataHandling\\DataHandler::class);\n $tce->start($data, []);\n $tce->process_datamap();\n }", "public function saveParams()\r\n\t{\r\n\t\tforeach ($this->param_names as $param_name)\r\n\t\t{\r\n\t\t\t$funcname = 'get'.$param_name;\r\n\t\t\tif (_PS_VERSION_ < '1.5')\r\n\t\t\t\tConfiguration::updateValue('CERTISSIM_'.Tools::strtoupper($param_name), $this->$funcname());\r\n\t\t\telse\r\n\t\t\t\tConfiguration::updateValue('CERTISSIM_'.Tools::strtoupper($param_name), $this->$funcname(), false, null, $this->getIdshop());\r\n\t\t}\r\n\t}", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "protected function save_instance() {\n\t\twponion_callback( 'wponion_' . $this->module . '_registry', array( &$this ) );\n\t}", "function save(){\n\t\t$client_id = (!isset($_POST[\"client_id\"])) ? self::add_client() : $_POST[\"client_id\"];\n\n\t\t//salvar processo e associar a cliente\n\t\t$process = $this->bind_from_post();\n\n\t\t//associar o processo a um cliente na tabela processes\n\t\t$sql = \"INSERT INTO processes SET \";\n\t\t$sql .= \"`client_id` = '\".$client_id.\"', \";\n\t\t$sql .= \"`ccc_num` = '\".$process[\"ccc_id\"].\"', \";\n\t\t$sql .= \"`criado_por` = '\".$_SESSION[\"user_bo\"].\"', \";\n\t\t$sql .= \"`data_insercao` = CURRENT_TIMESTAMP, \";\n\t\t$sql .= \"`prazo` = '\".$process[\"prazo\"].\"'\";\n\n\t\t$insert_processes = mysql_query($sql); //insere e gera novo id\n\n\t\t//determinar o id do process (id interno, único, uma vez que CCC podem haver vários)\n\t\t$sql = \"SELECT MAX(id) AS id FROM processes WHERE ccc_num = '\".$process[\"ccc_id\"].\"'\";\n\t\t$process_id_result = mysql_fetch_object(mysql_query($sql));\n\t\t$process_id = $process_id_result->id;\n\n\t\t//inserir os dados de preenchimento na tabela processes_form\n\t\t$sql = \"INSERT INTO processes_form SET \";\n\t\t$sql .= \" `process_id` = '\".$process_id.\"', \";\n\t\t$sql .= \" `ccc_id` = '\".$process[\"ccc_id\"].\"', \";\n\t\t$sql .= \" `tipo_credito` = '\".$process[\"tipo_credito\"].\"', \";\n\t\t$sql .= \" `data_vencimento` = '\".$process[\"data_vencimento\"].\"', \";\n\t\t$sql .= \" `data_ultimo_movimento` = '\".$process[\"data_ultimo_movimento\"].\"', \";\n\t\t$sql .= \" `periodicidade_pagamento_juros` = '\".$process[\"periodicidade_pagamento_juros\"].\"', \";\n\t\t$sql .= \" `montante` = '\".$process[\"montante\"].\"', \";\n\t\t$sql .= \" `montante_extenso` = '\".($process[\"montante_extenso\"]).\"', \";\n\t\t$sql .= \" `finalidade` = '\".$process[\"finalidade\"].\"', \";\n\t\t$sql .= \" `responsabilidade_global` = '\".$process[\"responsabilidade_global\"].\"', \";\n\t\t$sql .= \" `conta_deposito_ordem_associado` = '\".$process[\"conta_deposito_ordem_associado\"].\"', \";\n\t\t$sql .= \" `saldo_medio` = '\".$process[\"saldo_medio\"].\"', \";\n\t\t$sql .= \" `informacoes_actividade` = '\".$process[\"informacoes_actividade\"].\"', \";\n\t\t$sql .= \" `informacoes_parecer_balcao` = '\".$process[\"informacoes_parecer_balcao\"].\"', \";\n\t\t$sql .= \" `observacoes` = '\".($process[\"observacoes\"]).\"' \";\n\n\t\t$insert_processes_form = mysql_query($sql);\n\n\t\t//notificar a actualização\n\t\tTools::notify_add(\"Processo inserido com sucesso\", \"success\");\n\n\t\tredirect(\"?mod=clientes_list&process_id=\".$process_id);\n\t}", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "protected function saving() {\n // This will get reimplemented by children when necessary\n }", "function save()\n {\n }", "function save()\n {\n }", "function saveService()\n {\n $this->dialogObject->save_object();\n $msgs = $this->dialogObject->check();\n if (count($msgs)) {\n foreach ($msgs as $msg) {\n msg_dialog::display(_(\"Error\"), $msg, ERROR_DIALOG);\n }\n } else {\n $this->plugins[$this->current] = $this->dialogObject;\n $tmp = get_object_vars($this->dialogObject);\n foreach ($tmp as $name => $value) {\n $this->plugins[$this->current]->$name = $value;\n }\n $this->closeDialogs();\n $this->backup = NULL;\n $this->updateActionMenu();\n }\n }", "public function save()\n {\n $this->save_meta_value('_sim_service_price', $this->service_price);\n $this->save_meta_value('_sim_service_price_registered', $this->service_price_registered);\n $this->save_meta_value('_sim_service_hide_price', $this->service_hide_price);\n }", "public function process() {\n }", "public function process() {\n }", "public function process() {\n }", "private function saveConfig() {\n \tself::$_configInstance = (object)$this->_data; \n file_put_contents($this->_data['cache_config_file'],serialize(self::$_configInstance)); \n }", "function save() {\n \tfile_put_contents(\"threads/{$this->id}\", serialize($this));\n }", "public function testProcessDataCommunication() {\n $process = new Process(function() use (&$process) {\n // Don't do this!\n // Because $process is here a copy of the parent process!\n });\n\n $process = new Process(function(Process $proc) {\n $value = $proc->receiveData( true );\n $value *= 10;\n $proc->sendData($value);\n });\n\n $process->run();\n\n $processes = $this->readProcessIDs();\n\n $this->assertContains( $process->getProcessID(), $processes );\n $this->assertContains( $process->getChildProcessID(), $processes );\n\n usleep(100000);\n\n $processes = $this->readProcessIDs();\n\n $this->assertContains( $process->getProcessID(), $processes );\n $this->assertContains( $process->getChildProcessID(), $processes );\n\n $process->sendData(12);\n $value = $process->receiveData(true);\n\n $process->wait();\n\n $processes = $this->readProcessIDs();\n\n $this->assertContains( $process->getProcessID(), $processes );\n $this->assertNotContains( $process->getChildProcessID(), $processes );\n\n $this->assertEquals(120, $value);\n }", "protected function saveData()\n {\n $this->beforeSave();\n\n $changed = $this->setReceptionCode(\n $this->formData[$this->receptionCodeItem],\n $this->loader->getCurrentUser()->getUserId()\n );\n\n $this->afterSave($changed);\n\n $this->accesslog->logChange($this->request, null, $this->formData);\n }", "protected function saveData()\n {\n $this->beforeSave();\n\n $changed = $this->setReceptionCode(\n $this->formData[$this->receptionCodeItem],\n $this->loader->getCurrentUser()->getUserId()\n );\n\n $this->afterSave($changed);\n\n $this->accesslog->logChange($this->request, null, $this->formData);\n }", "function updateData() {\n global $rundata, $pagebuffer, $spambotDataLoc;\n return ( file_put_contents( $spambotDataLoc.'rundata', serialize($rundata) ) && file_put_contents( $spambotDataLoc.'pagebuffer', serialize( $pagebuffer ) ) );\n \n}", "function cl_procprocessodoc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"procprocessodoc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "private static function proccess()\n {\n $files = ['Process', 'Command', 'Translator', 'Migrations', 'Links', 'Tag', 'Model', 'View', 'Controller', 'Seeds', 'Router', 'Exception', 'Events', 'Alias', 'Middleware', 'Helper', 'Tests', 'Mail', 'Query'];\n $folder = static::$root.'Processes'.'/';\n\n self::call($files, $folder);\n\n $files = ['TranslatorFolderNeededException', 'TranslatorManyFolderException'];\n $folder = static::$root.'Processes/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function process()\n {\n\n }", "public function save()\n {\n $sql = new Sql();\n\n $results = $sql->select(\n \"CALL sp_orders_save(:idorder, :idcart, :iduser, :idstatus, :idaddress, :vltotal)\",\n [\n ':idorder'=>$this->getidorder(),\n ':idcart'=>$this->getidcart(),\n ':iduser'=>$this->getiduser(),\n ':idstatus'=>$this->getidstatus(),\n ':idaddress'=>$this->getidaddress(),\n ':vltotal'=>$this->getvltotal()\n ]\n );\n\n if (count($results) > 0) {\n $this->setData($results[0]);\n }\n }", "private function saveData() {\n // Create a new object with relevant information\n $data = new stdClass();\n $data->accessToken = $this->accessToken;\n $data->expirationDate = $this->expirationDate;\n $data->refreshToken = $this->refreshToken;\n\n // And save it to disk (will automatically create the file for us)\n file_put_contents(DATA_FILE, json_encode($data));\n }", "function storeParameters()\n {\n }", "private function SaveData()\n {\n // loop tanks and save data\n foreach ($this->tanks AS $tank_id => $data) {\n // get category id from tank id\n $category_id_tank = $this->CreateCategoryByIdentifier($this->InstanceID, $tank_id, $data['Name']);\n\n // loop tank data and add variables to tank category\n $position = 0;\n foreach ($data AS $key => $value) {\n $this->CreateVariableByIdentifier($category_id_tank, $key, $value, $position);\n $position++;\n }\n }\n }", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "public abstract function process();", "function process(){\n\t\t\treturn $this->xml->dumpmem();\n\t\t}", "private function save(): void\n {\n foreach ($this->dataToSave as $file => $data) {\n $this->langFilesManager->fillKeys($file, $data);\n }\n }", "public function save();", "public function save();", "public function save();" ]
[ "0.61932904", "0.5850203", "0.58459353", "0.5788308", "0.5751134", "0.57220244", "0.57181406", "0.5707249", "0.5694446", "0.5691735", "0.56455594", "0.56009454", "0.55898374", "0.5558796", "0.55469674", "0.55451375", "0.55240214", "0.55215013", "0.55142766", "0.54979175", "0.5488743", "0.54665864", "0.54271764", "0.5396076", "0.5396076", "0.5379413", "0.536503", "0.5361366", "0.53566206", "0.5339944", "0.53373694", "0.53297955", "0.5324447", "0.53009224", "0.53009224", "0.53009224", "0.53009224", "0.5286294", "0.52788335", "0.52709556", "0.5267437", "0.5259576", "0.5258424", "0.5258424", "0.5258424", "0.52464014", "0.5242316", "0.5226774", "0.5219658", "0.5216977", "0.52150714", "0.5209466", "0.5194538", "0.5168655", "0.5145248", "0.51400644", "0.51388174", "0.51144296", "0.51016665", "0.51012635", "0.51008546", "0.50991994", "0.5092938", "0.5078557", "0.50780284", "0.5064333", "0.5059791", "0.50585514", "0.50447196", "0.5043495", "0.50412714", "0.50412714", "0.50297576", "0.50251263", "0.5025019", "0.5025019", "0.5025019", "0.5023938", "0.50112116", "0.5010618", "0.5008101", "0.5008101", "0.49948803", "0.49928322", "0.49918246", "0.4990943", "0.4987393", "0.49828574", "0.4980628", "0.4972428", "0.49703893", "0.49703893", "0.49703893", "0.49703893", "0.49681696", "0.49603906", "0.4952742", "0.49429712", "0.49429712", "0.49429712" ]
0.5389191
25
Database Tables Get Tables Details
public function getDBTablesDetails() { //$functions = $this->system_structure_m->getDBTablesDetails(); //echo json_encode($functions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function admin_get_tables() {}", "public function admin_get_tables() {}", "protected function getDatabaseTables() {}", "public function getTables()\n {\n\treturn $this->query('select [name] from [tables]');\n }", "public function listTables() {\r\n\t\tswitch ($this->getDbtype()) {\r\n\t\t\tcase 'mysql':\r\n\t\t\t\t$sql = \"SHOW FULL TABLES WHERE TABLE_TYPE = 'BASE TABLE'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'pgsql':\r\n\t\t\t\t$sql = \"SELECT CONCAT(table_schema,'.',table_name) AS name FROM information_schema.tables \r\n WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog','information_schema')\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'sqlite':\r\n\t\t\t\t$sql = 'SELECT name FROM sqlite_master WHERE type = \"table\" AND name != \"sqlite_sequence\"';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'mssql':\r\n\t\t\t\t$sql = \"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'\";\r\n\t\t\tcase 'oracle':\r\n\t\t\t\t$sql = \"SELECT * FROM dba_tables\";\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new Exception($this->getDbtype() . ' does not support listing table');\r\n\t\t}\r\n\t\t$result = $this->query($sql);\r\n\t\t$result->setFetchMode(PDO::FETCH_NUM);\r\n\t\t$meta = array();\r\n\t\tforeach ($result as $row) {\r\n\t\t\t$meta[] = $row[0];\r\n\t\t}\r\n\t\treturn $meta;\r\n\t}", "public function getTables();", "public function getTables();", "public function getTables();", "public function getTableInformation() {}", "public function getAllTables()\n {\n return $this->fetchColumn(\"SHOW TABLES\");\n }", "public function list_tables(){\n\t\treturn $this->fetch_all(\"SHOW TABLES\");\n\t}", "public function get_tables()\n\t{\n\t\treturn $this->driver_query('table_list');\n\t}", "public function showTables()\n {\n switch($this->db_type){\n case 'mssql';\n case 'sqlsrv':\n $sql = 'SELECT * FROM sys.all_objects WHERE type = \\'U\\'';\n break;\n case 'pgsql':\n $sql = 'SELECT tablename FROM pg_tables WHERE tableowner = current_user';\n break;\n case 'sqlite':\n $sql = 'SELECT * FROM sqlite_master WHERE type=\\'table\\'';\n break;\n case 'oci':\n $sql = 'SELECT * FROM system.tab';\n break;\n case 'ibm':\n $schema = '';\n $sql = 'SELECT TABLE_NAME FROM qsys2.systables'.\n (($schema != '') ? ' WHERE TABLE_SCHEMA = \\''.$schema.'\\'' : '');\n break;\n case 'mysql':\n default:\n $sql = 'SHOW TABLES IN `'.$this->db_name.'`';\n break;\n }\n\n try{\n $sth = $this->query($sql);\n $result = $sth->fetchAll();\n }catch(PDOException $e){\n $this->error( $e->getMessage());\n $result = false;\n }\n return $result;\n }", "public static function getTables() {\n }", "public function getTableNames();", "public function &getTables();", "public function getTables()\n\t{\n $result = $this->fetchingData(array(\n 'query' => \"SHOW FULL TABLES\"\n ));\n\n return $result;\n\t}", "abstract public function getTables();", "abstract protected function fetchTableNamesDb();", "public function qsGetDbTables()\n {\n $sql = 'show tables';\n $d = $this->qExecPluck($sql);\n\n return $d;\n }", "public function getTables()\n {\n $sqlStm = \"SELECT TABLE_NAME as tableName,\n CASE TABLE_TYPE WHEN 'VIEW' THEN 'true'\n ELSE 'false'\n END as isView\n FROM information_schema.tables\n WHERE TABLE_SCHEMA = ?\";\n \n $query = new DataQuery($sqlStm);\n $param = new DataParameter('schema', DataParameter::TYPE_VARCHAR , $this->schema);\n return $this->query($query, array($param));\n }", "function get_db_tables(){\n\t\tglobal $GonxAdmin;\n\t\t\n\t\t$result = @$this->list_tables($this->dbName);\n\t\tif (!$result) {\n\t\t print \"Erreur : impossible de lister les tables\\n\";\n\t\t print 'Erreur '.$GonxAdmin[\"dbtype\"].' : ' . $this->error();\n\t\t exit;\n\t\t}\n\t while ($row = $this->fetch_row($result)) {\n\t\t\t$Tables[] = $row[0];\n\t }\n\t\treturn $Tables;\t\t\n\t}", "public function list_tables() {\n try {\n $sql = \"SHOW TABLES\";\n $result = $this->conn->query($sql);\n //return $result->fetchAll(PDO::FETCH_NUM);\n\n $tables = array();\n foreach($result as $row) {\n //echo $row[0].\"<br>\";\n array_push($tables, $row[0]);\n }\n return $tables;\n\n } catch (PDOException $e) {\n echo(\"DB ERROR: \".$e->getMessage());\n }\n }", "public function getTables() {\n\t\treturn $this->adapter->getCol( \"SELECT name FROM sqlite_master\n\t\t\tWHERE type='table' AND name!='sqlite_sequence';\" );\n\t}", "public static function getTable();", "public function getTableList()\n\t{\n\t\t$this->connect();\n\n\t\t$type = 'table';\n\n\t\t$query = $this->getQuery(true)\n\t\t\t->select('name')\n\t\t\t->from('sqlite_master')\n\t\t\t->where('type = :type')\n\t\t\t->bind(':type', $type)\n\t\t\t->order('name');\n\n\t\t$this->setQuery($query);\n\n\t\t$tables = $this->loadColumn();\n\n\t\treturn $tables;\n\t}", "public function getTablesBD(){\n $bd=$this->db->database;\n $this->db->select('TABLE_NAME as tabla');\n $this->db->from('INFORMATION_SCHEMA.tables');\n $this->db->where([\"TABLE_SCHEMA\"=>$bd]);\n $this->db->order_by('TABLE_NAME', 'asc');\n $result = $this->db->get()->result_array();\n echo json_encode($result);\n }", "public function getListOfTables() {}", "function getTables() {\n return mysql_query('SHOW TABLES');\n }", "public function getTable();", "abstract protected function _listTables();", "public function getTables(){\n $pdo = $this->pdo;\n $statement = $pdo->prepare(\"SHOW TABLES FROM $this->name;\");\n $statement->execute();\n $tables = $statement->fetchAll($pdo::FETCH_NUM);\n foreach($tables as &$table)\n $table = $table[0];\n return $tables;\n }", "protected function getTables() {\n \n $sm = $this->db->getSchemaManager();\n\n $tables = array(); \n \n foreach ($sm->listTables() as $table) {\n if ( strpos($table->getName(), $this->prefix) == 0 ) {\n foreach ($table->getColumns() as $column) {\n $tables[ $table->getName() ][ $column->getName() ] = $column->getType(); \n }\n // $output[] = \"Found table <tt>\" . $table->getName() . \"</tt>.\";\n }\n }\n \n return $tables;\n \n }", "public function getTableList()\n\t{\n\t\t$db = new mysql_db();\n\n\t\t$result = $db->query(\"show tables\");\n\t\t\n\t\t$db->fetch_array($result);\n\t\t\n\t\treturn $arr;\n\t}", "public function getTableList()\n\t{\n\t\t$result = [];\n\t\tforeach ($this->manager->getDataSources($this->languageId) as $tableName => $tableInfo)\n\t\t{\n\t\t\t$result[] = [\n\t\t\t\t$tableName,\n\t\t\t\t$tableInfo['TABLE_DESCRIPTION'],\n\t\t\t];\n\t\t}\n\t\treturn $result;\n\t}", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "function Table_Names(){\n\t\t$database=DatabaseName();\n\t\t$tables = array();\n\t\t$list_tables_sql = \"SHOW TABLES FROM {$database};\";\n\t\t$result = mysql_query($list_tables_sql);\n\t\tif($result){\n\t\t\twhile($table = mysql_fetch_row($result))\n\t\t\t{\n\t\t\t\t$tables[] = $table[0];\n\t\t\t}\n\t\t}\n\t\treturn $tables;\n\t}", "public function getTableList() {\n\t\t$db = new mysql_db();\n\n\t\t$result = $db -> query(\"show tables\");\n\n\t\t$db -> fetch_array($result);\n\t\t$db -> close_connection();\n\t\treturn $arr;\n\t}", "public function getAllTables()\n {\n return $this->connection->select(\n $this->grammar->compileGetAllTables((array) $this->connection->getConfig('schema'))\n );\n }", "function getTableNames() {\n\n //Gets tablenames from the database\n Global $serverInfo;\n $conn = connect();\n $sql = \"SHOW TABLES FROM \" . $serverInfo[3];\n $result = $conn->query($sql);\n\n //Outputs data if information was found\n $tableArray = [];\n if ($result->num_rows > 0) {\n\n //Writes found data into an array\n $i = 0;\n while ($row = $result->fetch_assoc() ) {\n $tableArray[$i] = $row[\"Tables_in_\" . $serverInfo[3] ];\n $i++;\n }\n return $tableArray;\n }\n}", "public function getDatabaseTables()\n {\n\n $db_name = $this->db->database;\n\n $show_table_query = $this->db->query(\"SHOW TABLES from $db_name\");\n\n $table_result = $show_table_query->result_array();\n\n $table_list = [];\n\n foreach($table_result as $key => $val) {\n $table_list[] = $val['Tables_in_' . $db_name];\n }\n\n return $table_list;\n }", "public function getAll()\n {\n return $this->tables;\n }", "public function showTables(){\n $resultQuery = $this->executeQuery(\"SHOW TABLES;\");\n echo \"Liste des tables : <br><br>\";\n while( $row = mysqli_fetch_row($resultQuery) ){\n echo \" - \".$row[0].\"<br>\";\n }\n echo \"<br>\";\n }", "public function getTcaTables() {}", "private function getTableNames(){\n $exceptions = array_merge(\n self::EXCEPTION_TABLES,\n explode(\",\",str_replace(' ','',$this->params['exceptions']))\n );\n $exceptions = array_filter($exceptions);\n $this->tables = DB::table('information_schema.tables')->select([\n 'table_name'\n ])->where('table_schema','public')->whereNotIn('table_name',$exceptions)->get();\n }", "function listTables();", "protected function getAllTables()\n {\n return $this->getConnection()->select(\n $this->grammar->compileGetAllTables()\n );\n }", "function dbTablesName() {\n $data = array();\n $tablesname = mysql_list_tables(DB_DATABASE);\n\n $i = 0;\n //var_dump($tablesname);\n while ($row = mysql_fetch_array($tablesname)) {\n if ($row[0] <> \"admin\" && $row[0] <> \"grid\")\n $data[$i] = $row[0];\n\n $i++;\n }\n\n return $data;\n }", "public function showTables($database = null){\n\t\treturn $this->instance->listTables($database);\n\t}", "protected function getTcaTables() {}", "function get_tables()\n {\n return $this->_tables;\n }", "function getTablename(){\n $ci = & get_instance();\n $ci->load->database();\n $query = $ci->db->query(\"SELECT table_name FROM information_schema.tables WHERE table_schema = 'anjwekhs_anjwebtech_pms'\");\n return $query->result_array();\n}", "public function table_name(){\n $q = \"SHOW FULL TABLES FROM \".DATABASE;\n $re = $this->Request_model->peticion($q);\n $tabla = array();\n for ($i=0; $i <count($re) ; $i++):\n $db = 'Tables_in_'.DATABASE;\n $value = $re[$i][$db];\n $tabla[] = $value;\n endfor; \n return $tabla;\n }", "public function getTables()\n {\n return $this->callSql(\"\n SELECT\n *\n FROM\n SYSOBJECTS\n WHERE\n xtype = 'U';\n \");\n\n // Appears that DP has disabled the permissions required for the following query\n // prior to 2021-07-15\n // return $this->callSql(\"\n // SELECT\n // *\n // FROM\n // INFORMATION_SCHEMA.TABLES;\n // \");\n }", "function get_tables_from_db( ){\n\t\t\t$db_connect = mysql_connect($this->host,$this->username, $this->password);\n\t\t\t$tables = mysql_list_tables($this->db); \n\t\t\twhile($row = mysql_fetch_assoc($tables)){\n\t\t\t\tforeach($row as $k=>$v){\n\t\t \t\t\t$a_tables[]=$v;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $a_tables;\n\t\t}", "protected function getTables()\n {\n return $this->tables;\n }", "public function getTables()\n {\n return $this->tables;\n }", "public function getTables()\n {\n return $this->tables;\n }", "public function getTables()\n {\n return $this->tables;\n }", "public function getTables()\n {\n return $this->tables;\n }", "public function getTables()\n {\n return $this->tables;\n }", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}", "public static function getTable() {}", "public abstract function getDbTable();", "public function getTables() {\n $stmt = $this->pdo->query(\"SELECT table_name \n FROM information_schema.tables \n WHERE table_schema= 'public' \n AND table_type='BASE TABLE'\n ORDER BY table_name\");\n $tableList = [];\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $tableList[] = $row['table_name'];\n }\n \n return $tableList;\n }", "public function getTables()\n {\n global $adminer;\n\n $main_actions = [\n 'add-table' => \\adminer\\lang('Create table'),\n ];\n\n $headers = [\n \\adminer\\lang('Table'),\n \\adminer\\lang('Engine'),\n \\adminer\\lang('Collation'),\n // \\adminer\\lang('Data Length'),\n // \\adminer\\lang('Index Length'),\n // \\adminer\\lang('Data Free'),\n // \\adminer\\lang('Auto Increment'),\n // \\adminer\\lang('Rows'),\n \\adminer\\lang('Comment'),\n ];\n\n // From db.inc.php\n // $table_status = \\adminer\\table_status('', true); // Tables details\n $table_status = \\adminer\\table_status(); // Tables details\n\n $details = [];\n foreach($table_status as $table => $status)\n {\n if(!\\adminer\\is_view($status))\n {\n $details[] = [\n 'name' => $adminer->tableName($status),\n 'engine' => \\array_key_exists('Engine', $status) ? $status['Engine'] : '',\n 'collation' => '',\n 'comment' => \\array_key_exists('Comment', $status) ? $status['Comment'] : '',\n ];\n }\n }\n\n $select = \\adminer\\lang('Select');\n return \\compact('main_actions', 'headers', 'details', 'select');\n }", "private function getTables()\n {\n $this->emTypeVerify();\n $conn = $this->getDoctrine()->getManager($this->emType)->getConnection();\n $db = $conn->getDatabase();\n $tables = $conn->fetchAll(\"SHOW TABLES FROM $db\");\n return $tables;\n }", "public function getDatabaseTableDefinitions() {}", "public function describeTables(): array\n {\n return $this->isCached() ? $this->loadCachedSchema() : $this->selectSchema();\n }", "function raw_db_list_database_tables()\r\n{\r\n global $g_current_db;\r\n\r\n $tables = array();\r\n $sql = \"SELECT name FROM sqlite_master WHERE (type = 'table')\";\r\n $res = sqlite_query($g_current_db, $sql);\r\n if ($res) {\r\n while (sqlite_has_more($res)) {\r\n $tables[] = sqlite_fetch_single($res);\r\n }\r\n } else return false;\r\n return $tables;\r\n}", "public function getAllTables()\n {\n return $this->connection->select(\n $this->grammar->compileGetAllTables(\n $this->parseSearchPath(\n $this->connection->getConfig('search_path') ?: $this->connection->getConfig('schema')\n )\n )\n );\n }", "public function getTable() {}", "public function getTable() {}", "final public function tables()\n {\n return $this->doTables();\n }", "public function getTable() {}", "function tableNames() {\n\t\treturn \"SELECT name FROM sqlite_master WHERE type='table' AND name!='sqlite_sequence' ORDER BY name\";\n\t}", "public function show_tables()\n\t{\n\t\t$results = $this->get_rows('SHOW TABLES');\n\t\tforeach ($results as $row)\n\t\t{\n\t\t\t$array[] = $row[0];\n\t\t}\n\n\t\treturn $array;\n\t}", "public function get_tables() {\r\n\t\t$tables = $this->query_select ( \"SHOW TABLES;\", \"num\" );\r\n\t\tif (! function_exists ( '__tmp_huy_db_tables' )) {\r\n\t\t\tfunction __tmp_huy_db_tables($val) {\r\n\t\t\t\treturn $val [0];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn array_map ( '__tmp_huy_db_tables', $tables );\r\n\t}", "public function getTables() {\n $tables = array_map('reset', \\DB::select('SHOW TABLES'));\n return json_encode($tables);\n }", "abstract public function getTable();", "abstract public function getTable();", "public function listTables($database = null){\n\t\treturn $this->instance->listTables($database);\n\t}", "public function list_tables(){\n\t\treturn $this->fetch_all(\"SELECT c.relname AS table FROM pg_class c, pg_user u \"\n .\"WHERE c.relowner = u.usesysid AND c.relkind = 'r' \"\n .\"AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) \"\n .\"AND c.relname !~ '^(pg_|sql_)' UNION \"\n .\"SELECT c.relname AS table_name FROM pg_class c \"\n .\"WHERE c.relkind = 'r' \"\n .\"AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) \"\n .\"AND NOT EXISTS (SELECT 1 FROM pg_user WHERE usesysid = c.relowner) \"\n .\"AND c.relname !~ '^pg_'\");\n\t}", "abstract protected function getTable();", "function tablesList ()\n {\n $sql = \"SELECT a.relname AS name\n FROM pg_class a, pg_user b\n WHERE ( relkind = 'r') and relname !~ '^pg_' AND relname !~ '^sql_'\n AND relname !~ '^xin[vx][0-9]+' AND b.usesysid = a.relowner\n AND NOT (EXISTS (SELECT viewname FROM pg_views WHERE viewname=a.relname));\";\n\n $result = $this->all($sql);\n\n if (!$result)\n {\n trigger_error(ERROR_NO_TABLE_LIST, E_USER_ERROR);\n exit;\n }\n else\n {\n $tables = array();\n foreach ($result as $item) $tables[] = $item['name'];\n return $tables;\n }\n }", "public function getTableList()\n\t{\n\t\treturn [];\n\t}", "public function listTables()\n {\n $schema = $this->fetchDatabase();\n\n $rows = $this->fetchAll(\"SELECT table_name, table_rows \n FROM information_schema.tables \n WHERE table_schema = '{$schema}' \n ORDER BY table_name\n \");\n\n $tables = [];\n foreach ($rows as $row) {\n $tables[$row['table_name']] = $row['table_rows'];\n }\n\n return $tables;\n }", "public function getTables() {\n\t\treturn $this->tables;\n\t}", "public function get_system_tables()\n\t{\n\t\treturn $this->driver_query('system_table_list');\n\t}" ]
[ "0.7962169", "0.7962151", "0.79263127", "0.7826811", "0.7801278", "0.77120316", "0.77120316", "0.77120316", "0.76401377", "0.7566968", "0.7548094", "0.75394267", "0.75378865", "0.7523786", "0.7519573", "0.7512086", "0.74899524", "0.7468035", "0.74547327", "0.7440461", "0.74283004", "0.7351868", "0.73440695", "0.7327582", "0.72572094", "0.72430474", "0.72425723", "0.7237802", "0.7235336", "0.72256947", "0.72240466", "0.72230196", "0.719025", "0.718469", "0.7179603", "0.71792465", "0.71792465", "0.71792465", "0.71792465", "0.71792465", "0.71792465", "0.71792465", "0.717436", "0.7173183", "0.7172323", "0.7166548", "0.7160852", "0.7158248", "0.71492994", "0.71472454", "0.7140025", "0.71039814", "0.7092009", "0.7054667", "0.7050058", "0.70450145", "0.7044263", "0.7040141", "0.70371246", "0.70224047", "0.70036256", "0.69954616", "0.6992853", "0.6992853", "0.6992853", "0.6992853", "0.6992853", "0.69875556", "0.69875556", "0.69875556", "0.69875556", "0.69875556", "0.69875556", "0.6986774", "0.69829106", "0.6981624", "0.6957937", "0.69565815", "0.6954884", "0.6931876", "0.69308484", "0.69270825", "0.6922511", "0.6922086", "0.6921351", "0.69205856", "0.6901775", "0.68992764", "0.6876857", "0.68661755", "0.68588924", "0.68588924", "0.68404806", "0.6840412", "0.6839631", "0.68220115", "0.6821751", "0.6820889", "0.6813899", "0.68004405" ]
0.7806806
4
Save Database Tables Data
public function DatabaseTables() { $data = array(); $where = array(); $where['TableID']=$this->input->post('def_tableid'); $data['TableID']=$this->input->post('tableid'); $data['TableDescription']=$this->input->post('tabledesc'); $data['TableAccess']=$this->input->post('tableaccess'); $data['TableComponent']=$this->input->post('tablecomponent'); if($where['TableID'] == '0') { $result=$this->system_structure_m->insert_dbtables($data); } else { $result=$this->system_structure_m->update_dbtables($data,$where); } echo $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveToDb()\n\t{\n\t\t$db = \\App\\Db::getInstance('admin');\n\t\t$tablesData = array_intersect_key($this->getData(), $this->changes);\n\t\tforeach ($tablesData as $key => $value) {\n\t\t\t$db->createCommand()->update($this->baseTable, ['value' => $value], ['type' => $this->type, 'name' => $key])->execute();\n\t\t}\n\t}", "public function save()\n {\n\n // generate all column's sql query\n $column_names = '';\n $column_values = '';\n foreach ($this->columns as $field_name => $column_obj)\n {\n if ($column_obj->columnName === null) {\n $column_names .= $field_name.', ';\n } else {\n $column_names .= $column_obj->columnName.', ';\n }\n $column_values .= $column_obj->generateValueForSQL().', ';\n }\n $column_names = substr($column_names, 0, -1);\n $column_values = substr($column_values, 0, -1);\n $this_table_name = $this->table_name;\n $this_id = $this->id;\n\n if ($this->id === 0) {\n // This object is not saved yet.\n $query = 'INSERT INTO $this_table_name ($column_names) VALUES ($column_values);';\n // Execute query\n } else {\n // This object is on the DB.\n $query = 'INSERT INTO $this_table_name ($column_names) VALUES ($column_values) WHERE id=$this_id;';\n // Execute query\n }\n\n mysql_run_query($query);\n\n }", "function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }", "function saveData() {\n\n\t\t$this->getMapper()->saveData();\t\n\t\t\n\t\t\n\t}", "public function saveToDB()\n {\n }", "public function save()\n {\n array_push($this->table, $this->value);\n }", "public function save()\n {\n $pdo = $this->getDbConnection();\n $valuesRow = $this->prepareValuesRow();\n\n $pdo->exec(\"REPLACE INTO {$this->dbTable} (`key`, `value`) VALUES {$valuesRow}\");\n }", "public function saveData()\r\n {\r\n \r\n }", "private function saveDb()\n\t{\n\t\t//format our sql statements w/ the valid fields\n\t\t$fields = array();\n\t\t\n\t\t//loop thru all our dirty fields.\n\t\tforeach ($this->dirtyFields AS $key => $foo)\n\t\t{\n\t\t\t//get our value.\n\t\t\tif (isset($this->data[$key]) && $key != 'id')\n\t\t\t{\n\t\t\t\t$val = $this->data[$key];\n\n\t\t\t\t//slashes replacement..\n\t\t\t\t$val = str_replace(\"\\\\\\\\\", \"\\\\\", $val);\n\t\t\t\t$val = str_replace(\"\\'\", \"'\", $val);\n\t\t\t\t$val = str_replace(\"\\\\\\\"\", \"\\\"\", $val);\n\n\t\t\t\t//add it if we have it...\n\t\t\t\t$fields[] = \"`$key` = '\" . addslashes($val) . \"'\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//update if we have an id....\n\t\tif (count($fields))\n\t\t{\n\t\t\t//now make our array\n\t\t\t$sqlFields = implode(\",\\n\", $fields) . \"\\n\";\n\t\t\t\n\t\t\t//update it?\n\t\t\tif ($this->id)\n\t\t\t{\n\t\t\t\t$sql = \"UPDATE $this->tableName SET\\n\";\n\t\t\t\t$sql .= $sqlFields;\n\t\t\t\t$sql .= \"WHERE id = '$this->id'\\n\";\n\t\t\t\t$sql .= \"LIMIT 1\";\n\n\t\t\t\tdb()->execute($sql);\n\t\t\t}\n\t\t\t//otherwise insert it...\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sql = \"INSERT INTO $this->tableName SET\\n\";\n\t\t\t\t$sql .= $sqlFields;\n\n\t\t\t\t$this->id = db()->insert($sql);\n\t\t\t}\n\t\t}\n\t}", "public function saveToDb()\n\t{\n\t\t$this->addDocument();\n\t\tparent::saveToDb();\n\t}", "public function save(){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Find the columns from the model\n\t\t$columns = static::$columns;\n\n\t\t//because ID is AI we dont want to put a value in it\n\t\tunset($columns[array_search('id', $columns)]);\n\t\t//Same with timestamp\n\t\tunset($columns[array_search('timestamp', $columns)]);\n\n\t\t//Create an insert query which gets linked to the database\n\t\t$query = \"INSERT INTO \" . static::$tableName . \" (\". implode(\",\", $columns) . \") VALUES (\";\n\n\t\t//create a variable called insesrtcols. This is where we put the values\n\t\t$insertcols = [];\n\t\t//For each of the columns in the columns array, add that column into the insert cols array, and seperate it with a :\n\t\tforeach ($columns as $column) {\n\t\t\tarray_push($insertcols, \":\" . $column);\n\t\t}\n\t\t//turn the insertcols array into 1 string and put a , between each entry\n\t\t$query .= implode(\",\", $insertcols);\n\t\t//close the query\n\t\t$query .= \")\";\n\n\t\t//Prepare the query\n\t\t$statement = $db->prepare($query);\n\n\t\t//Foreach of the columns run this function\n\t\tforeach ($columns as $column) {\n\t\t\t//Attach the value to each of the columns\n\t\t\t//Hash the password\n\t\t\tif($column === 'password'){\n\t\t\t\t$this->$column = password_hash($this->$column, PASSWORD_DEFAULT);\n\t\t\t}\n\t\t\t$statement->bindValue(\":\" . $column , $this->$column);\n\t\t}\n\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Get the id of the query which was just added\n\t\t$this->id = $db->lastInsertID();\n\t}", "protected function commit( $table, $data ) {\n\t\t$db_file = $this->root_directory . DIRECTORY_SEPARATOR . $table . '.json';\n\t\tfile_put_contents( $db_file, json_encode( array_values( $data ) ) );\n\t}", "public function saveToDatabase($data)\n {\n }", "private function saveTableData($tables)\n {\n $dbtable = $this->project->id . '_db';\n foreach ($tables as $table => $size) {\n $row = array(\n 'timestamp' => $this->timestamp,\n 'table' => $table,\n 'size' => $size\n );\n \\DB::table($dbtable)->insert($row);\n }\n }", "public function Save(){\r\n\t\t$this->db->save();\r\n\t}", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save()\n {\n $db = DatabaseUtil::db_connect($this->database);\n $db->query('update ' . $this->table . 'set ' . $this->column . ' = ' . $this->value . ' where ID=' . $this->ID);\n $db->close();\n }", "public function save_all() {\n\t\t$this->save_api();\n\t\t$this->save_field_map();\n\t\t$this->save_import();\n\t\t$this->save_requirement_set();\n\t}", "public function save() {\n\t\t$sql = \"UPDATE \".$this->tablename.\" SET \";\n\t\t$last = $this->columns[count($this->columns)-1]['db_name'];\n\t\tforeach ($this->columns as $col) {\n\t\t\tswitch($col['type']){\n\t\t\t\tcase 'D':\t//Date, Time, Char, Password, Image all need quotes around the value\n\t\t\t\tcase 'T':\n\t\t\t\tcase 'C':\n\t\t\t\tcase 'I':\n\t\t\t\tcase 'X':\n\t\t\t\tcase 'M':\n\t\t\t\tcase 'E':\n\t\t\t\t\t$sql .= $col['db_name'].\" = '\".$this->data[0][$col['db_name']].\"'\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'P':\n\t\t\t\t\t$sql .= $col['db_name'].\" = AES_ENCRYPT('\".$this->data[0][$col['db_name']].\"','\".la_aes_key.\"')\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'N':\t// Number, checkBox, Select, Radio don't need quotes\n\t\t\t\tcase 'B':\n\t\t\t\tcase 'S':\n\t\t\t\tcase 'R':\n\t\t\t\t\t$sql .= $col['db_name'].' = '.$this->data[0][$col['db_name']];\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ($col['db_name'] != $last) {\n\t\t\t\t$sql .= ',';\n\t\t\t}\n\t\t}\n\t\t$sql .= \" WHERE \".$this->idcol.\"=\".$this->page->ctrl['record'];\n\t\t$this->error->debug($sql);\n\t\t$this->dbc->exec($sql);\n\t\treturn true;\n\t}", "public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function saveSchema()\n {\n $db = ezcDbInstance::get();\n $schema = ezcDbSchema::createFromDb( $db );\n $schema->writeToFile( \"array\", dirname( __FILE__ ) . \"/relation.dba\" );\n }", "function persistAll() ;", "protected function saveData()\n\t{\n\t\treturn $this->saveDb();\n\t}", "public function save()\n {\n $newPackage = [];\n foreach ($this->data as $key => $value){\n if(!isset($this->map[$key]))\n continue;\n $keyMapper = $this->map[$key];\n if(is_subclass_of($value, self::class)){\n $value->save();\n continue;\n }elseif (is_array($value)){\n foreach ($this->data as $model){\n if(is_subclass_of($value, self::class)){\n $model->save();\n }\n }\n }\n $newPackage[$keyMapper] = $value;\n }\n if(isset($this->data['id']) && $this->data['id'])\n $this->db->update($this->table, $newPackage, $this->data['id'], $this->key );\n else\n $this->db->insert($this->table, $newPackage);\n }", "public function save() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query=\"UPDATE \";\t\n\t\t\tfor ($i=0; $i<count($this->originalData); $i++) {\n\t\t\t\tif (!isset($this->modifiedData)) {\n\t\t\t\t\t$this->modifiedData = $this->originalData;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$query=\"INSERT INTO \";\n\t\t}\n\t\t$query.=$this->table.' SET ';\n\t\tforeach ($this->modifiedData as $key=>$value) {\n\t\t\t$value = mysqli_real_escape_string($this->connection->connection,$value);\n\t\t\t$query.= '`'.$key .\"`='\".$value.'\\',';\n\t\t}\n\t\t$query = substr($query,0,-1);\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query.=' WHERE '.self::$primaryKey[$this->table].'=\\''.$this->originalData[self::$primaryKey[$this->table]].\"'\";\n\t\t}\n\t\t$this->connection->query($query);\n\t\tif ($this->connection->getError()) {\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($this->originalData)) {\n\t\t\t$this->originalData[self::$primaryKey[$this->table]] = $this->connection->getInsertID();\n\t\t}\n\t\t$this->originalData = array_merge($this->originalData,$this->modifiedData);\n\t\treturn true;\n\t}", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'author_id' => $this->author_id,\n 'clothingname' => $this->clothingname,\n 'clothingtype' => $this->clothingtype,\n 'tempmin' => $this->tempmin,\n 'tempmax' => $this->tempmax\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function saveSchema()\n {\n $db = ezcDbInstance::get();\n $schema = ezcDbSchema::createFromDb( $db );\n $schema->writeToFile( 'array', dirname( __FILE__ ) . '/database_type.dba' );\n }", "protected function saveData()\n {\n // TODO: データ保存\n\n // 一次データ削除\n $this->deleteStore();\n\n drupal_set_message($this->t('The form has been saved.'));\n }", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "public function saveToDb()\n\t{\n\t\tparent::saveToDb();\n\t\t$this->insertAttachment();\n\t}", "public function save(){\n\t\t$v = get_object_vars($this);\n\t\tunset($v['TABLE']);\n\t\tunset($v['IS_UPDATING']);\n\t\t$key_s = \"\";\n\t\t$key_v = \"\";\n\t\tforeach($v as $key => $val){\n\t\t\t$key_s .= \"$key, \";\n\t\t\t$key_v .= \"'$val', \";\n\t\t}\n\t\t$key_s = substr_replace($key_s, '', strlen($key_s)-2);\n\t\t$key_v = substr_replace($key_v, '', strlen($key_v)-2);\n\t\tif($this->IS_UPDATING){\n\t\t\t$str = \"\";\n\t\t\tunset($v['id']);\n\t\t\tforeach($v as $key => $val){\n\t\t\t\t$str .= $key . \"='$val', \";\n\t\t\t}\n\t\t\t$str = substr_replace($str, '', strlen($str)-2);\n\t\t\t$query = \"UPDATE {$this->TABLE} SET $str WHERE id = {$this->id}\";\n\t\t} else {\n\t\t\t$query = \"INSERT INTO {$this->TABLE} ($key_s) VALUES ($key_v)\";\n\t\t}\n\t\t$q = parent::query($query);\n\t\treturn $q;\n\t}", "public function saveMyMonitoringDataToDb()\n {\n //get DB object\n /** @var $db Zend_Db_Adapter_Abstract */\n $dbObject = Zend_Registry::get('DB');\n\n $skipped = false;\n /**\n * @var $monitoringData App_Dto_MonitoringData\n */\n foreach ($this->getMonitoringDataList() as $monitoringData) {\n $dbId = $this->getDbId();\n if ($this->alreadyInDb($monitoringData, $dbId)) {\n $skipped = true; //just needed for the output message\n } else {\n $insert = array(\n 'sourceId' => $dbId,\n 'metricId' => $monitoringData->getMetricId(),\n 'value' => $monitoringData->getValue(),\n 'timestamp' => $monitoringData->getTimestamp()\n );\n\n try {\n $dbObject->insert('Data', $insert);\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }\n }\n\n if ($skipped) echo \"skipped some data, due to duplicates\\n\";\n\n echo \"\\nsaved!\\n\";\n }", "public function save() {}", "public function save() {}", "public function save() {}", "public function backup_database()\n\t{\n\t\t$db = Database::instance();\n\n\t\t$tables_to_dump = array('client', 'contact', 'currency', 'invoice', 'invoice_payment', 'module', 'operation_type', 'project', 'role', 'ticket', 'time', 'user');\n\n\t\t// Add the table structure\n\t\t$sql = View::factory('admin/settings/schema/tables')->render().\"\\n\";\n\t\t// Add the constraints\n\t\t$sql.= View::factory('admin/settings/schema/constraints')->render().\"\\n\";\n\n\t\t// Dump the data\n\t\tforeach ($tables_to_dump as $model)\n\t\t{\n\t\t\t$model_name = $model.'_Model';\n\t\t\t$old = $model;\n\t\t\t$model = new $model_name;\n\n\t\t\t$rows = $model->fetch_all();\n\t\t\tforeach ($rows as $row)\n\t\t\t{\n\t\t\t\t$row = $row->as_array();\n\t\t\t\t$sql.= 'INSERT INTO `'.inflector::plural($old).'` ('.implode(',', array_keys($row)).') VALUES ('.implode(',', array_values($row)).')'.\"\\n\";\n\t\t\t}\n\t\t}\n\n\t\theader('Content-Description: File Transfer');\n\t\theader('Content-Type: text/plain');\n\t\theader('Content-Disposition: attachment; filename=schema.sql');\n\t\theader('Content-Transfer-Encoding: binary');\n\t\theader('Expires: 0');\n\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\t\theader('Pragma: public');\n\t\theader('Content-Length: '.strlen($sql));\n\t\tob_clean();\n\t\tflush();\n\t\techo $sql;\n\t\texit;\n\t}", "function export_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->export_data( $sync_tables );\n\t\t$this->db_tools->echo_export_data();\n\t}", "public function saveData(): void\n {\n studentLoader::saveStudent(new student($_POST['lastName'], $_POST['firstName'], $_POST['email'], new group($_POST['className']), $_POST['id']), $this->pdo);\n }", "private function storeToDB() {\r\n\t\tDBQuery::getInstance() -> insert('INSERT INTO `CalculatedDailyNeeds`' . DBUtils2::buildMultipleInsertOnDuplikateKeyUpdate($this -> aArticleData));\r\n\t}", "public function save() {\n $db = Db::instance();\n // omit id \n $db_properties = array(\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'description' => $this->description,\n 'user' => $this->user,\n 'password' => $this->password,\n 'image' => $this->image,\n 'gender' => $this->gender,\n 'topic_id' => $this->topic_id,\n 'topic_id1' => $this->topic_id1,\n 'role_id' => $this->role_id,\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "abstract public function FlushToDatabase();", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'event_type_id' => $this->event_type_id,\n 'user_1_id' => $this->user_1_id,\n 'user_2_id' => $this->user_2_id,\n 'user_1_name' => $this->user_1_name,\n 'user_2_name' => $this->user_2_name,\n 'product_1_name' => $this->product_1_name,\n 'product_2_name' => $this->product_2_name,\n 'data_1' => $this->data_1,\n 'data_2' => $this->data_2\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "function save();", "function save();", "public function saveToDb() {\n parent::saveToDb();\n\n require_once 'models/Location.php';\n Location::saveToDb($this->preferredLocation);\n Location::saveToDb($this->currentLocation);\n\n require_once 'libs/DB.php';\n $conn = DB::connect();\n\n $seekerId = $this->id();\n\n // Update the seeker table\n $conn->exec(\"UPDATE seeker SET experience='$this->experience', pref_location_name='$this->preferredLocation', curr_location_name='$this->currentLocation' WHERE id='$seekerId'\");\n\n require_once 'models/Skill.php';\n foreach($this->skills as $skill) {\n Skill::saveToDb($skill);\n }\n\n // Delete old skills\n $conn->exec(\"DELETE FROM seeker_skill WHERE seeker_id='$seekerId'\");\n\n // Add new skills\n foreach($this->skills as $skill) {\n $conn->exec(\"INSERT INTO seeker_skill(seeker_id, skill_name) VALUES('$seekerId', '$skill')\");\n }\n }", "public function save()\n {\n $sql = new Sql();\n\n $results = $sql->select(\n \"CALL sp_orders_save(:idorder, :idcart, :iduser, :idstatus, :idaddress, :vltotal)\",\n [\n ':idorder'=>$this->getidorder(),\n ':idcart'=>$this->getidcart(),\n ':iduser'=>$this->getiduser(),\n ':idstatus'=>$this->getidstatus(),\n ':idaddress'=>$this->getidaddress(),\n ':vltotal'=>$this->getvltotal()\n ]\n );\n\n if (count($results) > 0) {\n $this->setData($results[0]);\n }\n }", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "function save() {\n\n\t\t// calls generic ORM save (insert or update)\n\t\tparent::save();\n\n\t}", "public function save() {\n\t\t\t\n\t\t}", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'username' => $this->username,\n 'password_hash' => $this->password_hash,\n 'email' => $this->email,\n 'first_name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'user_type' => $this->user_type,\n 'bio' => $this->bio,\n 'creation_date' => $this->creation_date,\n 'gender' => $this->gender,\n 'color' => $this->color\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "protected function populateDatabase(){\n $itemsSaved = (\"\\n\" . implode(';', get_object_vars($this)));\n file_put_contents('coursesTakenDB.csv', $itemsSaved, FILE_APPEND | LOCK_EX);\n }", "private function SaveData()\n {\n // loop tanks and save data\n foreach ($this->tanks AS $tank_id => $data) {\n // get category id from tank id\n $category_id_tank = $this->CreateCategoryByIdentifier($this->InstanceID, $tank_id, $data['Name']);\n\n // loop tank data and add variables to tank category\n $position = 0;\n foreach ($data AS $key => $value) {\n $this->CreateVariableByIdentifier($category_id_tank, $key, $value, $position);\n $position++;\n }\n }\n }", "public function save()\n {\n if (count($this->toSave) <= 0)\n return;\n \n $columns = [ ];\n $params = [ ];\n $to_save = [ ];\n array_walk($this->toSave, function($value, $key) use (&$columns, &$to_save, &$params) {\n if ($this->insert):\n $columns[] = $key;\n $to_save[] = \"?\";\n else:\n $to_save[] = \"{$key} = ?\";\n endif;\n\n $params[] = $value;\n });\n $to_save = implode(', ', $to_save);\n\n if ($this->insert):\n $columns = implode(', ', $columns);\n $primary_key = database()->run('INSERT INTO ' . $this->table . '(' . $columns . ') VALUES(' . $to_save . ')', $params);\n \n $this->{$this->primaryKey} = $primary_key;\n $this->insert = false;\n else:\n $params[] = $this->{$this->primaryKey};\n database()->run('UPDATE ' . $this->table . ' SET ' . $to_save . ' WHERE ' . $this->primaryKey . ' = ?', $params);\n endif;\n \n $this->toSave = [ ];\n return $this;\n }", "public function save()\n {\n // If deposit is new, will get assigned database ID.\n $this->dbID = $this->db->saveDeposit($this);\n }", "public function save(){\n\t\t$sql = new Sql();\n\n\t\t$results = $sql->select(\"CALL sp_categories_save(:idcategory, :descategory)\", array(\n\t\t\t\":idcategory\"=>$this->getidcategory(),\n\t\t\t\":descategory\"=>$this->getdescategory()\n\t\t));\n\n\t\t$this->setData($results[0]);\n\n\n\t\tCategory::updateFile();\n\n\t}", "public function save()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n if ($entity->getMarkedAsDeleted())\n {\n $entity->delete();\n } \n else if ($entity->getMarkedAsUpdated())\n {\n $entity->saveWithDetails();\n }\n }\n }\n );\n }", "public function save()\n {\n // Get all the defined database columns in the child class\n $columns = static::getConfig()[self::CONFIG_DB_COLUMNS];\n // Get the primary keys from the child class so we can use the in the where clause of the update query\n $primaryKeys = static::getConfig()[self::CONFIG_PRIMARY_KEYS];\n $data = [];\n\n // Foreach defined column get the child's current value for that column\n foreach ($columns as $columnName) {\n // generate a column => value array\n $data[$columnName] = $this->{$columnName};\n }\n\n MySql::update(\n self::getTableName(),\n $data,\n $primaryKeys\n );\n }", "public function insertDatabase();", "public function saveAll() {\n\t\t$originalCaret = $this->caret;\n\t\tforeach($this as $key => $row) {\n\t\t\t$this->save();\n\t\t}\n\t\t$this->caret = $originalCaret;\n\t}", "public function save()\r\n {\r\n \r\n }", "function saveFieldsDatastoreAction()\n {\n $this->_helper->viewRenderer->setNoRender();\n \n Zend_Loader::loadClass('Table_FieldSummary');\n $fieldSummaryTable = new Table_FieldSummary();\n \n //echo \"data made it!\";\n //return;\n \n $cnt = 0;\n $recordArray = Zend_Json::decode($_REQUEST['datastore'], Zend_Json::TYPE_OBJECT);\n //Zend_Debug::dump($recordArray);\n foreach ($recordArray as $record) \n {\n //Zend_Debug::dump($record);\n $where = $fieldSummaryTable->getAdapter()->quoteInto('pk_field = ?', $record->pk_field);\n $data = array('field_type' => $record->field_type,\n 'field_label' => $record->field_label,\n 'prop_desc' => $record->prop_desc,\n 'prop_type' => $record->prop_type);\n $fieldSummaryTable->update($data, $where);\n ++$cnt;\n } \n echo $cnt;\n }", "public function save():void;", "public function save() {\r\n /** probably we should add a timestamp, Item ID and stuff */\r\n $stored_data = json_encode(array($this->name, $this->status), JSON_UNESCAPED_UNICODE);\r\n $this->db_write(\"objects\", \"Item_s11n\", $stored_data);\r\n print ($stored_data);\r\n }", "public static function save_data($Final_cache_id, $UserName, $all_set_metadata){\n \n $tableName = $all_set_metadata[\"meta\"][\"table_name\"];\n $tableDescription=$all_set_metadata[\"meta\"][\"table_description\"];\n $table_tags=explode(\" \",$all_set_metadata[\"meta\"][\"tagstring\"]);\n \n $metadata = Zend_Json::encode($all_set_metadata);\n \n $db_params = OpenContext_OCConfig::get_db_config();\n $db = new Zend_Db_Adapter_Pdo_Mysql($db_params);\n $db->getConnection();\n \n $data = array( 'cache_id' => $Final_cache_id,\n 'table_name' => $tableName,\n 'created_on' => date(\"Y-m-d H:i:s\"),\n 'created_by' => $UserName,\n 'num_records' => $all_set_metadata[\"meta\"][\"numFound\"],\n 'set_uri' => $all_set_metadata[\"meta\"][\"setURI\"],\n 'set_hash' => $all_set_metadata[\"meta\"][\"setHash\"],\n 'metadata' => $metadata,\n 'description' => $tableDescription\n );\n \n $data[\"table_num\"] = $all_set_metadata[\"meta\"][\"table_segments\"][\"currentTab\"];\n $data[\"recs_per_table\"] = $all_set_metadata[\"meta\"][\"table_segments\"][\"recsPerTable\"]; \n $data[\"total_tabs\"] = $all_set_metadata[\"meta\"][\"table_segments\"][\"totalTabs\"];\n \n $db->insert('dataset', $data);\n $created_tableid=$db->lastInsertId();\n \n $projectIDs = OpenContext_ProjectTables::assign_project_links($Final_cache_id, $all_set_metadata[\"meta\"], $db);\n $personIDs = OpenContext_ProjectTables::assign_person_links($Final_cache_id, $all_set_metadata[\"meta\"], $projectIDs, $db);\n \n foreach($table_tags as $tag){\n $data=array('tag_name'=>$tag,'table_id'=>$created_tableid);\n $db->insert('tag',$data);\n }\n\n $db->closeConnection();\n }", "public function Save()\r\n\t\t{\r\n\t\t\tif ($this->id == -1) {\r\n\t\t\t\tunset($this->columns[\"id\"]);\r\n\t\t\t\t$sqlCol = null;\r\n\t\t\t\t$sqlKey = null;\r\n\t\t\t\tforeach ($this->columns as $column => $value) {\r\n\t\t\t\t\t$data[$column] = $this->$column;\r\n\t\t\t\t\t$sqlCol .= \",\" . $column;\r\n\t\t\t\t\t$sqlKey .= \",:\" . $column;\r\n\t\t\t\t}\r\n\t\t\t\t$sqlCol = ltrim($sqlCol, \",\");\r\n\t\t\t\t$sqlKey = ltrim($sqlKey, \",\");\r\n\t\t\t\t$query = $this->db->prepare(\r\n\t\t\t\t\t\"INSERT INTO \" . $this->table . \" (\" . $sqlCol . \")\r\n\t\t\t\t\t\tVALUES (\" . $sqlKey . \") ;\"\r\n\t\t\t\t);\r\n\t\t\t\t$query->execute($data);\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t// Sinon faire un update dynamique\r\n\t\t\t\t$sqlSet = null;\r\n\t\t\t\tforeach ($this->columns as $column => $value) {\r\n\t\t\t\t\t$data[$column] = $this->$column;\r\n\t\t\t\t\t$sqlSet[] .= $column . \"=:\" . $column;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Suppression de la mise à jour de la date d'update \r\n\t\t\t\t// la mise à jour des dates est maintenant faites en BDD.\r\n\t\t\t\t$query = $this->db->prepare(\r\n\t\t\t\t\t\"UPDATE \" . $this->table . \" SET \r\n\t\t\t\t\t\t\" . implode(\",\", $sqlSet) . \"\r\n\t\t\t\t\t\tWHERE id=:id;\"\r\n\t\t\t\t);\r\n\r\n\t\t\t\t$query->execute($data);\r\n\t\t\t}\r\n\t\t}", "public abstract function save();", "public function save()\n {\n }", "public function finish_database_export() {\n }", "public function save($data)\n\t{\n $this->db->insert('alumns', $data);\n\t}", "public function save(PDO $dbh);", "public abstract function export_table_data(xmldb_table $table, $data);", "public function save(){\n\n \t$sql = \"INSERT INTO \" . self::TABLENAME . \" (ora_decolare, destinatia, \n \t compania)\n \t\t\tVALUES ('$this->ora_decolare', '$this->destinatia', \n \t\t\t'$this->compania')\";\n\n \t$db = new Database(); // se creeaza conexiunea la baza de date\n \t$db->getConnection()->exec($sql);\n\n \treturn \"Datele au fost introduse cu succes.\";\n }", "function saveMetadata(){\n\t\t \n\t\t $db = $this->startDB();\n\t\t $metadataJSON = $this->generateJSON();\n\t\t \n\t\t $where = \"source_id = '\".$this->penelopeTabID.\"' \";\n\t\t $db->delete(\"export_tabs_meta\", $where);\n\t\t \n\t\t if(!$this->tableGroupID){\n\t\t\t\t$this->tableGroupID = false;\n\t\t }\n\t\t if(!$this->tablePage){\n\t\t\t\t$this->tablePage = false;\n\t\t }\n\t\t \n\t\t if($this->tablePage < 1){\n\t\t\t\tif(strstr($this->tableID, \"/\")){\n\t\t\t\t\t $tableEx = explode(\"/\", $this->tableID);\n\t\t\t\t\t $this->tablePage = $tableEx[1];\n\t\t\t\t\t $this->tableGroupID = $tableEx[0];\n\t\t\t\t}\n\t\t }\n\t\t if(strstr($this->tableGroupID, \"/\")){\n\t\t\t\t$tableEx = explode(\"/\", $this->tableGroupID);\n\t\t\t\t$this->tableGroupID = $tableEx[0];\n\t\t }\n\t\t \n\t\t $data = array(\t\"source_id\" => $this->penelopeTabID,\n\t\t\t\t\t\t\t\t\"tableID\" => $this->tableID,\n\t\t\t\t\t\t\t\t\"tableGroupID\" => $this->tableGroupID,\n\t\t\t\t\t\t\t\t\"page\" => $this->tablePage,\n\t\t\t\t\t\t\t\t\"title\" => $this->tableName,\n\t\t\t\t\t\t\t\t\"published\" => $this->published,\n\t\t\t\t\t\t\t\t\"pub_created\" => $this->pubCreated,\n\t\t\t\t\t\t\t\t\"pub_update\" => $this->pubUpdate,\n\t\t\t\t\t\t\t\t\"metadata\" => $metadataJSON\n\t\t\t\t\t\t );\n\t\t \n\t\t $db->insert(\"export_tabs_meta\", $data);\n\t }", "public function saveAll() {\n if (isset($this::$has)) {\n foreach ($this::$has as $key => $value) {\n if(isset($this->$key)) {\n foreach ($this->$key as $item) {\n $item->saveAll();\n }\n }\n }\n }\n $this->save();\n }", "protected function saveData($table_name, $data)\n {\n $con = $this->connect();\n $sql = \"INSERT INTO \" . $table_name;\n $prepared_data = (array)$data;\n $fields = \" \";\n foreach ($prepared_data as $key => $value) {\n if ($value != null) {\n $fields .= \" $key,\";\n }\n }\n\n $fields = ' (' . rtrim($fields, ',') . ') ';\n\n $values = \" \";\n foreach ($prepared_data as $key => $value) {\n if ($value != null) {\n $values .= \"'\" . mysqli_real_escape_string($con, $value) . \"',\";\n }\n }\n $values = ' (' . rtrim($values, ',') . ') ';\n $sql .= $fields . \" VALUES \" . $values;\n //echo $sql;exit();\n if (mysqli_query($con, $sql)) {\n mysqli_close($con);\n return true;\n }\n mysqli_close($con);\n return false;\n }", "function savedb($code, $titre, $table){\n\t\t$sql = Config::sql_connect();\n\t\t$requete = $sql->prepare(\"INSERT INTO $table(titre, user_id, time, programme) VALUES(:titre, :user_id, :time, :programme)\");\n\t\t$requete->execute(array(\n\t\t\t'titre' => $titre,\n\t\t\t'user_id' => $_SESSION['id'],\n\t\t\t'time' => time(),\n\t\t\t'programme' => $code\n\t\t));\n\t\t$this->saved_db = true;\n\t}", "protected function store()\n\t{\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t\t//---------------------\n\t\t// Your code goes here\n\t\t// --------------------\n\t}", "public function save(){\n $tableName = $this->tableName();\n $attributes = $this->attributes();\n $params = array_map(fn($attr) => \":$attr\", $attributes);\n $statement = self::prepare(\"INSERT INTO $tableName (\".implode(',', $attributes).\") \n VALUES (\".implode(',', $params).\")\");\n \n foreach($attributes as $attribute){\n $statement->bindValue(\":$attribute\", $this->{$attribute});\n }\n \n $statement->execute();\n return true;\n }", "function afterCreateTable(){\n $aData = array(\n array( \"Intranet\", \"INTR\", 1 ),\n array( \"Document Management\", \"DOCU\" ),\n array( \"Email\", \"EMAI\" ),\n array( \"General\", \"GENE\" )\n );\n \n foreach( $aData as $row ){\n $this->id = 0;\n $this->aFields[\"name\"]->value = $row[0];\n $this->aFields[\"code\"]->value = $row[1];\n \n // Default option\n if( array_key_exists( 2, $row ) ) $this->aFields[\"is_default\"]->value = $row[2];\n else $this->aFields[\"is_default\"]->value = 0;\n \n $this->save();\n }\n \n // Make everything point to the default\n $sql = \"SELECT id FROM issue_system WHERE is_default = 1\";\n $db = new DB();\n $db->query( $sql );\n $row = $db->fetchRow();\n $sql = \"UPDATE issue SET issue_system_id = \".$row[\"id\"];\n $db->query( $sql );\n \n }", "final public function save() {\n\t\t$table_id = $this::TABLE_ID;\n\t\tif (strlen ( $this->$table_id ) != 0) {\n\t\t\treturn $this->update ();\n\t\t}\n\t\t\n\t\tif ($this::USR_CREATE_ID != 'undefined') {\n\t\t\t$usrid = PwConnexion::getInstance ()->getUserId ();\n\t\t\t$colUsrId = $this::USR_CREATE_ID;\n\t\t\t$this->$colUsrId = $usrid;\n\t\t}\n\t\t\n\t\tif ($this::USR_CREATE_DATE != 'undefined') {\n\t\t\t$objDateTime = new DateTime ( 'NOW' );\n\t\t\t$colUsrDat = $this::USR_CREATE_DATE;\n\t\t\t$usrid = PwConnexion::getInstance ()->getUserId ();\n\t\t\t$this->$colUsrDat = $objDateTime->format ( \"Y-m-d H:i:s\" );\n\t\t}\n\t\t\n\t\t$this->$table_id = \"\";\n\t\t\n\t\t$row = $this->getSqlRow ();\n\t\t$k = 0;\n\t\t$filds = \"\";\n\t\tforeach ( $row as $key => $value ) {\n\t\t\tif ($k == 0)\n\t\t\t\t$sep = \" \";\n\t\t\telse\n\t\t\t\t$sep = \",\";\n\t\t\t$filds = $filds . $sep . $key;\n\t\t\t$k = 1;\n\t\t}\n\t\t$k = 0;\n\t\t$values = \"\";\n\t\tforeach ( $row as $key => $value ) {\n\t\t\tif ($k == 0)\n\t\t\t\t$sep = \" \";\n\t\t\telse\n\t\t\t\t$sep = \",\";\n\t\t\t$values = $values . $sep . \"'\" . $value . \"'\";\n\t\t\t$k = 1;\n\t\t}\n\t\t$cmd = \"insert into \" . $this::TABLE_NAME . \"(\" . $filds . \")values(\" . $values . \");\";\n\t\t$rid = \"\";\n\t\ttry {\n\t\t\t$stmt = PwPDO::getInstance ( PwPDO::DB_0 )->prepare ( $cmd );\n\t\t\t$stmt->execute ();\n\t\t\t$rid = PwPDO::getInstance ( PwPDO::DB_0 )->lastInsertId ();\n\t\t} catch ( Exception $e ) {\n\t\t\tPwDebug::debug ( $e->getMessage (), $cmd );\n\t\t\tPwDebug::debugInLogFile ( $e->getMessage () . \" \" . $cmd );\n\t\t\treturn 0;\n\t\t}\n\t\treturn PwPDO::getInstance ( PwPDO::DB_0 )->lastInsertId ();\n\t}" ]
[ "0.80988675", "0.7314736", "0.7220534", "0.7172939", "0.7113512", "0.7107351", "0.7012555", "0.6953931", "0.6910383", "0.6898905", "0.6824751", "0.6799234", "0.6792784", "0.6781977", "0.6781633", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6734814", "0.6719268", "0.67156976", "0.6691714", "0.66873866", "0.6639352", "0.6589518", "0.6589033", "0.65422714", "0.6527026", "0.6501441", "0.649428", "0.64734286", "0.6448702", "0.6423788", "0.6418923", "0.64161986", "0.6414422", "0.6414422", "0.6412473", "0.64035505", "0.6396581", "0.6390882", "0.63903177", "0.6360321", "0.6357735", "0.63543975", "0.63529485", "0.63529485", "0.6343141", "0.63272727", "0.632195", "0.632195", "0.632195", "0.632195", "0.632195", "0.63126224", "0.630944", "0.6295517", "0.6283386", "0.62807333", "0.6273458", "0.62729806", "0.6257015", "0.6246046", "0.6239641", "0.62360203", "0.62224734", "0.6219851", "0.6217143", "0.62162614", "0.6213537", "0.62093884", "0.6209318", "0.619643", "0.6182293", "0.61812955", "0.617978", "0.6175972", "0.6157722", "0.6154544", "0.6150067", "0.6145293", "0.6135197", "0.6131012", "0.6129792", "0.6129015", "0.6128885", "0.61282825" ]
0.0
-1
Delete Database Tables Data
public function deleteDBTables() { $TableID = $this->input->post('TableID'); $TableData = $this->system_structure_m->deleteDBTables($TableID); echo $TableData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteDatabaseStructure( );", "public function deleteTables () {\n $this->usersDB->deleteTables();\n $this->categoriesDB->deleteTables();\n $this->itemsDB->deleteTables();\n }", "function delete() {\n\t\t$sqlStatements = array();\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS tags\";\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS siteViews\";\n\t\texecuteSqlStatements($sqlStatements);\n\t}", "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "public function dropAllData()\n {\n $database_name = $this->conn->getDatabase();\n\n $tables = $this->conn->query(\"SELECT concat('DROP TABLE IF EXISTS ', table_name, ';') FROM information_schema.tables WHERE table_schema = '$database_name';\")->fetchAll();\n\n $queries = \"SET FOREIGN_KEY_CHECKS=0;\\n\";\n\n foreach ($tables as $aTable){\n $queries .= reset($aTable);\n }\n\n $this->conn->executeQuery($queries);\n\n $editora_structure = file_get_contents(__DIR__ .'/../../../../data/editora.sql');\n\n $this->conn->executeQuery($editora_structure);\n }", "public function deleteTables()\n {\n $db = Core::$db;\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_forms\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_form_placeholders\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_form_templates\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_templates\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_sets\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_set_placeholders\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_set_placeholder_opts\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_set_resources\");\n $db->execute();\n }", "function delete(){\r\n\t\t//Connect\r\n\t\t$sql = new DataBase;\r\n\t\t$sql->connect();\r\n\t}", "private function delete_tables()\n {\n global $wpdb;\n\n // this needs to occur at this level, and not in the\n foreach ($this->tables as $tablename) {\n $sql = 'DROP TABLE IF EXISTS ' . $tablename;\n $wpdb->query($sql);\n }\n }", "function deleteDatabase()\n{\n // codes to perform during unistallation\n $free_book_table = $GLOBALS['wpdb']->prefix . 'free_books';\n $sale_book_table = $GLOBALS['wpdb']->prefix . 'sale_books';\n $GLOBALS['wpdb']->query(\"DROP TABLE IF EXISTS `\" . $free_book_table . \"`\");\n $GLOBALS['wpdb']->query(\"DROP TABLE IF EXISTS `\" . $sale_book_table . \"`\");\n}", "function deleteall() {\n\t\t$this->_query( \"DELETE FROM $0\" );\n\t}", "public function destroy()\n {\n $db = XenForo_Application::get('db');\n $db->query('DROP TABLE `' . self::DB_TABLE . '`');\n }", "public function deleteTables()\n {\n Artisan::call('db:wipe');\n Artisan::call('migrate');\n\n }", "function cp_delete_db_tables() {\r\n global $wpdb, $app_db_tables;\r\n\r\n echo '<p class=\"info\">';\r\n\r\n foreach ( $app_db_tables as $key => $value ) {\r\n $sql = \"DROP TABLE IF EXISTS \". $wpdb->prefix . $value;\r\n $wpdb->query($sql);\r\n\r\n printf( __(\"Table '%s' has been deleted.\", 'appthemes'), $value);\r\n echo '<br/>';\r\n }\r\n\r\n echo '</p>';\r\n}", "public function cleanupDatabase() {\n\t\t\tif ( !$this->getTableExists() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$sQuery = \"\n\t\t\t\tDELETE from `%s`\n\t\t\t\tWHERE\n\t\t\t\t\t`day_id`\t\t\t!= '0'\n\t\t\t\t\tAND `created_at`\t< '%s'\n\t\t\t\";\n\t\t\t$sQuery = sprintf( $sQuery,\n\t\t\t\t$this->getTableName(),\n\t\t\t\t( $this->loadDP()->time() - 31*DAY_IN_SECONDS )\n\t\t\t);\n\t\t\t$this->loadDbProcessor()->doSql( $sQuery );\n\t\t}", "public function delete_tables()\n\t{\n\t\tglobal $wpdb;\n\t\t$wpdb->query( 'DROP TABLE '.self::$site_table.';' );\n\t}", "private function purgeTables()\n\t{\t\n\t\t$this->db->query(\"DELETE FROM categories\");\n\t\t$this->db->query(\"DELETE FROM album_art\");\n\t\t$this->db->query(\"TRUNCATE TABLE albums\");\n\t\t\n\t}", "public function deleteTable(){\n\t \n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('DELETE FROM wp_nouveautes_test WHERE datep_nouveaute > \"2014-04-13\"');\n\n\t\t$wpdb->query('DELETE FROM wp_custom_categories_test WHERE term_id > 247');\n\t\t\t\t \n\t\t$wpdb->query('TRUNCATE TABLE wp_subcategories_test');\n\t\t\n\t\t$wpdb->query('TRUNCATE TABLE wp_extracategories_test');\n\t\t\n\t\t$wpdb->query('TRUNCATE TABLE wp_updated');\n\t\t \t\t \n\t}", "function Sql_DB_Delete($db=\"\")\n {\n $query=$this->DB_Delete_Query($db);\n $this->DB_Query($query);\n }", "public function delete(){\r\n\t\t$this->db->delete();\r\n\t}", "public static function dbClear(){\n\t\tif (App::runningUnitTests()) {\n\t\t\tself::clearModelTables(TestSettings::$modelTables);\n\t\t\tself::clearTables(TestSettings::$pivotTables);\n\t\t}\n\t}", "function plugin_remove_database() {\n\n global $wpdb;\n\n\n\n $trips_tbl=$wpdb->prefix.'tb_trips_tbl';\n\n $sql_1 = \"DROP TABLE IF EXISTS $trips_tbl\";\n\n\n\n $tb_contacts_tbl=$wpdb->prefix.'tb_contacts_tbl';\n\n $sql_4 = \"DROP TABLE IF EXISTS $tb_contacts_tbl\";\n\n\n\n $tb_booking_tbl=$wpdb->prefix.'tb_booking_tbl';\n\n $sql_5 = \"DROP TABLE IF EXISTS $tb_booking_tbl\";\n\n\n\n\n\n $tb_zoho_crm_auth=$wpdb->prefix.'tb_zoho_crm_auth';\n\n $sql_2 = \"DROP TABLE IF EXISTS $tb_zoho_crm_auth\";\n\n $tb_zoho_books_auth=$wpdb->prefix.'tb_zoho_books_auth';\n\n $sql_3 = \"DROP TABLE IF EXISTS $tb_zoho_books_auth\";\n\n\n\n $wpdb->query($sql_1);\n\n $wpdb->query($sql_4);\n\n $wpdb->query($sql_5);\n\n\n\n $wpdb->query($sql_2);\n\n $wpdb->query($sql_3);\n\n delete_option(\"my_plugin_db_version\");\n\n }", "public function deleteAll()\n {\n $query = 'TRUNCATE TABLE `'. $this->getTableName() .'`';\n $this->db->sql_query($query);\n }", "function deleteAll() {\n\t\t$dbh=$this->getdbh();\n\t\t$sts = $dbh->exec('DELETE FROM '.$this->enquote($this->tablename));\n\t\treturn $sts;\n\t\n\t}", "function cleanVisitorTable($database = \"\"){\n\t\t\n\t\t$sql = \"TRUNCATE TABLE visitor\"; \n\t\t\n\t\ttry{\n\t\t\t\n\t\t\t$query = $database->exec($sql);\n\t\t\t\n\t\t\techo 'Succesfully ran rhe clean up operation.';\n\t\t\t\n\t\t} catch(PDOException $error){\n\t\t\n\t\t\techo 'Error with query. '.$error->getMessage();\n\t\t\n\t\t}\n\t\t\n\t}", "function clear() {\n\n switch ($this->type) {\n case 'sqlite':\n case 'mysql':\n $query[0] = 'DROP TABLE `enrolled`;';\n\n $query[1] = 'DROP TABLE `paid`;';\n\n $query[2] = 'DROP TABLE `admin`;';\n\n $query[3] = 'DROP TABLE `log`';\n\n $query[4] = 'DROP TABLE `stage`';\n\n\t\t\t\t$query[5] = 'DROP TABLE `guest`';\n\n break;\n\n default:\n throw new Exception($this->type . \" is not a valid database type.\");\n break;\n\n }\n\n foreach ($query as $drop) {\n $this->query($drop);\n }\n\n /**\n * Integrity Checking goes here\n */\n\n }", "public function clearDb ()\n {\n // Empty tables and reset auto-increment values\n $this->_dbh->query('SET FOREIGN_KEY_CHECKS = 0');\n foreach (self::$dbTables as $table) {\n $stmt = $this->_dbh->prepare('TRUNCATE `' . $table . '`');\n $stmt->execute();\n $stmt = $this->_dbh->prepare('ALTER TABLE `' . $table . '` AUTO_INCREMENT = 1');\n $stmt->execute();\n }\n // Re-enable checks only if set as such in config\n $config = parse_ini_file('config/AcToBs.ini', true);\n if (isset($config['checks']['fk_constraints']) && $config['checks']['fk_constraints'] == 1) {\n $this->_dbh->query('SET FOREIGN_KEY_CHECKS = 1');\n }\n // Delete denormalized tables\n foreach (self::$dbDenormalizedTables as $table) {\n $stmt = $this->_dbh->prepare('DROP TABLE IF EXISTS `' . $table . '`');\n $stmt->execute();\n }\n // Delete non-standard taxonomic ranks\n $stmt = $this->_dbh->prepare(\n 'DELETE FROM `taxonomic_rank` WHERE `standard` = ?');\n $stmt->execute(array(\n 0\n ));\n unset($stmt);\n }", "protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }", "public function deleteAll(){\n try {\n $this->getTable()->delete();\n } catch (\\Exception $e) {\n $this->handleException($e);\n }\n return;\n }", "private function cleanDatabase()\n {\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach($this->tables as $table)\n {\n\n DB::table($table)->truncate();\n\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n\n\n }", "function ClearDatabase() {\n $link = mysql_connect($this->servername, $this->username, $this->password);\n if (!$link) {\n die('Could not connect: ' . mysql_error());\n }\n \n //Make Players the current database\n $db_selected = mysql_select_db($this->dbname, $link);\n \n $delete = \"DELETE FROM Player\";\n mysql_query($delete, $link);\n \n mysql_close($link);\n \n $this->GenerateJSONResponseData();\n }", "public function clear_tables()\n\t{\n\t\tglobal $wpdb;\n\t\t$wpdb->query( 'DELETE FROM '.self::$site_table.';' );\n\t}", "function clearDatabase1()\n {\n global $db;\n $sql = \"TRUNCATE TABLE messages\";\n $query = $db->prepare($sql);\n $query->execute();\n }", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function tearDown()\n {\n $sqlBuilder = new \\Apps\\Database\\Delete();\n $sql = $sqlBuilder->delete()->from('Shows')->where('Country = :country')->result();\n $pdo = array('country' => 'UnitTest');\n $this->database->run($sql, $pdo);\n\n $sql = $sqlBuilder->delete()->from('Songs')->where('Title LIKE :title')->result();\n $pdo = array('title' => 'UnitTest%');\n $this->database->run($sql, $pdo);\n\n $sql = $sqlBuilder->delete()->from('People')->where('Name LIKE :name')->result();\n $pdo = array('name' => 'UnitTest%');\n $this->database->run($sql, $pdo);\n\n $this->database->close();\n }", "protected function deleteAll()\n {\n Yii::$app->db->createCommand()\n ->delete($this->tableName, [$this->primaryKey => $this->owner->{$this->primaryKey}])\n ->execute();\n }", "function deleteAll(){\n $sql = \"DROP TABLE books\";\n if(mysqli_query($GLOBALS['con'], $sql)){\n TextNode(\"success\", \"All records have been lost, oh boy...\");\n } else {\n TextNode(\"error\", \"Phew!, something went wrong deleting all records.\");\n }\n\n}", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "private function dropDataTable(Datastore $db)\n {\n $stmt = $db->prepare('DROP TABLE ' . $this->dataTableName());\n $db->execute($stmt);\n }", "function delete_data($table, $id){\n\n $query = $this->db->delete($table, array('id' => $id));\n\n }", "static function deleteAll()\n {\n $GLOBALS['DB']->exec(\"DELETE FROM stores;\");\n $GLOBALS['DB']->exec(\"DELETE FROM stores_brands;\");\n }", "function sql_deleteTable() {\n global $database;\n $thisQuery = \"DROP TABLE \".TABLE_PREFIX.\"mod_dirlist\";\n $oldErrorReporting = error_reporting(0);\n $database->query($thisQuery);\n error_reporting($oldErrorReporting);\n if ($database->is_error()) {\n $this->errorPlace = 'sql_deleteTable()';\n $this->error = $database->get_error();\n return false; }\n else {\n return true; }\n }", "protected function dropDatabaseTables()\n {\n $this->useCamundaDatabase(function() {\n if ($tables = DB::select('SHOW TABLES')) {\n $this->line('Dropping existing database tables...');\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n foreach ($tables as $table) {\n $array = get_object_vars($table);\n Schema::drop($array[key($array)]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n\n $this->info('All tables dropped.');\n }\n });\n }", "public function delete() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"DELETE FROM \".$this->getTableName();\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "function dropOldTables(Sqlite3 $db)\n{\n\t$drop_script = \"DROP TABLE \";\n\tforeach (['airports', 'carriers', 'statistics', 'statistics_flights', 'statistics_delays', 'statistics_minutes_delayed'] as $table_name) {\n\t //echo \"\\tDropping \" . $table_name . PHP_EOL;\n\t $db->query($drop_script . $table_name);\n\t}\n\t//echo 'Done.' . PHP_EOL;\n}", "public function limparTabela(){\r\n\t\t$sql = 'DELETE FROM oficina';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$consulta->execute();\r\n\t}", "function erase() {\n //delete * from database\n }", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "public static function deleteAll() {\n // Initiate implicit tx if explicit one doesn't exist\n $is_implicit_tx = false;\n if (self::$numTransactions == 0) {\n $is_implicit_tx = true; \n self::beginTx();\n }\n\n // Fail because 'databaseHandle' wasn't initialized by 'beginTx()' \n assert(isset(self::$databaseHandle));\n\n try {\n $sql_records = static::fetchAll();\n foreach ($sql_records as $record) {\n $record->delete();\n } \n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n\n // Close implicit tx\n if ($is_implicit_tx) {\n self::endTx();\n }\n }", "private function clear_dummy_data()\n {\n $this->adapter->query('DELETE FROM ' . RUCKUSING_TS_SCHEMA_TBL_NAME);\n }", "function dodelete()\n\t{\n\t\tglobal $db;\n\n\t\t$sqls = array(\n\t\t\t\"DELETE FROM preorders WHERE pre_preorderID=$this->preorderID\",\n\t\t\t\"DELETE FROM preorder_customers WHERE prc_preorderID=$this->preorderID\"\n\t\t);\n\n\t\twhile (list($a,$sql) = each($sqls))\n\t\t{\n\t\t\tmysql_query($sql,$db);\n\t\t\t$this->error->mysql(__FILE__,__LINE__);\n\t\t}\n\t}", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function delete_data_to_tombstone(){\n }", "function jr_delete_db_tables() {\r\n\tglobal $wpdb, $jr_db_tables;\r\n\r\n\t$db_tables = array_merge( $jr_db_tables, $jr_legacy_db_tables );\r\n\r\n\tforeach ( $db_tables as $key => $value ) :\r\n\t\tscb_uninstall_table($value);\r\n\r\n\t\tprintf(__(\"Table '%s' has been deleted.\", APP_TD), $value);\r\n\t\techo '<br/>';\r\n\tendforeach;\r\n\r\n\tscb_uninstall_table('app_pop_daily');\r\n\t_e(\"Table 'app_pop_daily' has been deleted.\", APP_TD);\r\n\r\n\tscb_uninstall_table('app_pop_total');\r\n\t_e(\"Table 'app_pop_total' has been deleted.\", APP_TD);\r\n\r\n}", "public function delall()\n {\n }", "function clearTables(){\r\n $link = new mysqli($_SERVER['RDS_HOSTNAME'], $_SERVER['RDS_USERNAME'], $_SERVER['RDS_PASSWORD'], $_SERVER['RDS_DB_NAME'], $_SERVER['RDS_PORT']);\r\n if (!$link) {\r\n echo '<script> console.log(\"Connection Failed: ' . mysqli_connect_error() . '\"); </script>';\r\n die(\"Connection failed: \" . mysqli_connect_error());\r\n }\r\n $drop_employee_table = \"DROP TABLE IF EXISTS employees\";\r\n if($link->query($drop_employee_table)){\r\n echo '<script> console.log(\"employees table created\"); </script>';\r\n }\r\n else {\r\n echo '<script> console.log(\"failed to create employees table); </script>';\r\n }\r\n $link->close();\r\n makeEmployeeTable();\r\n}", "public function clean(){\n\t\t$sql = 'DELETE FROM ano_letivo';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "function lp_delete_table(){\r\n\tglobal $wpdb;\r\n\t$charset_collation = $wpdb->get_charset_collate();\r\n\t$table_name = $wpdb->prefix.'like_post';\r\n\r\n $sql = \"DROP TABLE IF EXISTS $table_name;\";\r\n $wpdb->query($sql);\r\n\r\n delete_option('lp_showing_year');\r\n}", "public function clean(){\n\t\t$sql = 'DELETE FROM aluno';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public static function cleanDatabase()\n\t{\n\t\t$expire = time() - 86400*30;\n\t\tDB::get()->prepare(\"\n\t\t\tDELETE FROM forms\n\t\t\tWHERE forms_created_time < ?\")\n\t\t\t->execute(array($expire));\n\t}", "public function delete($table);", "function deleteAll ($tablename) {\n\t\t$this->deleteWhere($tablename, NULL);\n\t}", "protected function tearDown()\n {\n $this->testDBConnector->clearDataFromTables();\n }", "function clearDatabase2()\n {\n global $db;\n $sql = \"TRUNCATE TABLE messages2\";\n $query = $db->prepare($sql);\n $query->execute();\n }", "public function uninstallDB()\n {\n Db::getInstance()->execute('DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'onehop_sms_rulesets`;');\n return Db::getInstance()->execute('DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'onehop_sms_templates`;');\n }", "public function wipeAll() {\n\t\tforeach($this->getTables() as $t) {\n\t\t\tforeach($this->getKeys($t) as $k) {\n\t\t\t\t$this->adapter->exec(\"ALTER TABLE \\\"{$k['FKTABLE_NAME']}\\\" DROP FOREIGN KEY \\\"{$k['FK_NAME']}\\\"\");\n\t\t\t}\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t\tforeach($this->getTables() as $t) {\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t}", "private function cleanUpDatabase(){\n\t\t$this->cleanUpSessions();\n\t\t// reports older 90 days\n\t\t$this->cleanUpReports();\n\t\t// delete unregistered users without actions older 30 days\n\t\t$this->cleanUpUsers();\n\t}", "function caldera_forms_pro_drop_tables(){\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . 'cf_pro_messages';\n\t$sql = \"DROP TABLE IF EXISTS $table_name\";\n\t$wpdb->query($sql);\n\tdelete_option('cf_pro_db_v');\n}", "public static function uninstall() {\n $sql = 'DROP TABLE IF EXISTS `'.self::tableName.'`;';\n db_query($sql);\n }", "public static function dropTables()\n\t{\n\t}", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "public function clearAllDevices(){\n\t\t$db = Db::getInstance();\n\n\t\t$req = $db->prepare('DELETE FROM Devices');\n\t\t$req->execute();\n\t\t\n\n\n\t}", "public function delete_all()\n {\n }", "function lightboxPhotoswipeDeleteTables()\n{\n global $wpdb;\n \n $table_name = $wpdb->prefix . 'lightbox_photoswipe_img'; \n $sql = \"DROP TABLE IF EXISTS $table_name\";\n $wpdb->query($sql);\n}", "function Delete()\n\t{\n\t\tglobal $dal_info;\n\t\t\n\t\t$deleteFields = \"\";\n\t\t$tableinfo = &$dal_info[ $this->infoKey ];\n\t\t//\tprepare parameters\t\t\n\t\tforeach($tableinfo as $fieldname => $fld)\n\t\t{\n\t\t\tif( isset($this->{$fld['varname']}) )\n\t\t\t{\n\t\t\t\t$this->Param[ $fieldname ] = $this->{$fld['varname']};\n\t\t\t}\n\t\t\t\n\t\t\tforeach($this->Param as $field => $value)\n\t\t\t{\n\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t$deleteFields.= $this->_connection->addFieldWrappers( $fieldname ).\"=\". $this->PrepareValue($value, $fld[\"type\"]) . \" and \";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//\tdo delete\n\t\tif ($deleteFields)\n\t\t{\n\t\t\t$deleteFields = substr($deleteFields, 0, -5);\n\t\t\t$dalSQL = \"delete from \".$this->_connection->addTableWrappers( $this->m_TableName ).\" where \".$deleteFields;\n\t\t\t$this->_connection->exec( $dalSQL );\n\t\t}\n\t\n\t\t//\tcleanup\n\t $this->Reset();\n\t}", "public function clear()\r\n\t{\r\n\t\t$this->db->runQuery(\"TRUNCATE TABLE `\" . $this->name . \"`\");\r\n\t}", "function clearSQL() {}", "public function uninstall()\n\t{\n\t\t$this->db->query(\"\n\t\t\tDROP TABLE \".Kohana::config('database.default.table_prefix').\"sharing_site;\n\t\t\t\");\n\t\t$this->db->query(\"\n\t\t\tDROP TABLE \".Kohana::config('database.default.table_prefix').\"sharing_incident;\n\t\t\t\");\n\n\t}", "public function clean(){\n\t\t$sql = 'DELETE FROM grupo_usuario_tabelas';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "function base_clear(){\n $tables = array(\n 'oc_product',\n 'oc_product_image',\n 'oc_manufacturer',\n 'oc_manufacturer_description',\n 'oc_product_description',\n 'oc_product_to_category',\n 'oc_product_attribute',\n 'oc_attribute',\n 'oc_attribute_description',\n // 'oc_attribute_value',\n // 'oc_category',\n // 'oc_category_description',\n 'oc_product_to_store',\n // 'oc_category_to_store',\n 'oc_manufacturer_to_store',\n 'oc_product_to_layout',\n // 'oc_category_to_layout',\n );\n foreach ($tables as $table)\n {\n sDb::query(\"TRUNCATE TABLE $table\");\n echo \"Таблица $table очищена\\n\";\n }\n}", "public function destroy() {\n $this->connection->schema()->dropTable($this->mapTable);\n $this->connection->schema()->dropTable($this->messageTable);\n }", "public function clean(){\n\t\t$sql = 'DELETE FROM conta_a_pagar';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "function deleteAllData() {\n $successObservers = $this->databaseDeleteRecord($this->tableObservers, NULL);\n $successActions = $this->databaseDeleteRecord($this->tableActions, NULL);\n $successGroups = $this->databaseDeleteRecord($this->tableGroups, NULL);\n if ($successObservers !== FALSE && $successActions !== FALSE && $successGroups !== FALSE) {\n return TRUE;\n }\n return FALSE;\n }", "public function delete()\n {\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products;\");\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products_tiers;\");\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products_tiers_payment_options;\");\n }", "public function removeAll() {\n $sql = 'SET FOREIGN_KEY_CHECKS = 0; TRUNCATE TABLE course';\n \n $connection_manager = new connection_manager();\n $conn = $connection_manager->connect();\n \n $stmt = $conn->prepare($sql);\n \n $stmt->execute();\n $count = $stmt->rowCount();\n }", "function delete_db($table, $id) {\n\t\t$tmp = \"delete from $table where id='$id'\";\n\t\t$sts = mysql_query($tmp, $this -> dbc) or print mysql_error($this -> CONST_ERRO);\n\t\treturn ($sts);\n\t}", "function vidageTable()\n {\n try {\n $res = $this->connection->exec('delete from ' . $this->table);\n } catch (PDOException $e) {\n $res = -1;\n if ($this->debug_mode > 0) {\n $this->addMessage($e->getMessage());\n }\n throw new ObjetBDDException($e->getMessage());\n }\n return $res;\n }", "public function clean(){\n\t\t$sql = 'DELETE FROM compra_coletiva';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }", "protected function _clearSchema()\n {\n\n // Show all tables in the installation.\n foreach (get_db()->query('SHOW TABLES')->fetchAll() as $row) {\n\n // Extract the table name.\n $rv = array_values($row);\n $table = $rv[0];\n\n // If the table is a Neatline table, drop it.\n if (in_array('neatline', explode('_', $table))) {\n $this->db->query(\"DROP TABLE $table\");\n }\n\n }\n\n }", "public function uninstall() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->deleteTable();\r\n\t}\r\n }", "public function delete($tables,$pk,$id){\n $this->db->where($pk,$id);\n $this->db->delete($tables);\n }", "public function delete($tables,$pk,$id){\n $this->db->where($pk,$id);\n $this->db->delete($tables);\n }", "public function delete($tables,$pk,$id){\n $this->db->where($pk,$id);\n $this->db->delete($tables);\n }", "abstract public function unloadDatabase();", "protected function dropDatabaseTable(): void\n {\n /** @var Connection $connection */\n $connection = $this->container->get(Connection::class);\n\n if (method_exists($connection, 'executeStatement')) {\n $connection->executeStatement('SET FOREIGN_KEY_CHECKS=0;');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_order`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_serial`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_media`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_download_history`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_video`');\n $connection->executeStatement('ALTER TABLE `product` DROP COLUMN `esd`');\n $connection->executeStatement('SET FOREIGN_KEY_CHECKS=1;');\n } else {\n $connection->exec('SET FOREIGN_KEY_CHECKS=0;');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_order`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_serial`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_media`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_download_history`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_video`');\n $connection->exec('ALTER TABLE `product` DROP COLUMN `esd`');\n $connection->exec('SET FOREIGN_KEY_CHECKS=1;');\n }\n }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();" ]
[ "0.79195917", "0.7728244", "0.7674416", "0.7634015", "0.7558836", "0.7466871", "0.74143505", "0.7349599", "0.7342078", "0.7321376", "0.7287967", "0.7283397", "0.72764283", "0.7275983", "0.7253544", "0.7242845", "0.7188813", "0.71379477", "0.71257627", "0.71207345", "0.7075252", "0.706353", "0.70177096", "0.70060456", "0.70022935", "0.6962609", "0.69584787", "0.69227314", "0.6910531", "0.6905173", "0.6901518", "0.6884237", "0.6880475", "0.68650377", "0.68623215", "0.68583995", "0.6855436", "0.68493295", "0.68451124", "0.6834224", "0.6832924", "0.6808489", "0.68081313", "0.67933357", "0.6793333", "0.67671317", "0.6761093", "0.6758903", "0.67498386", "0.6749582", "0.673937", "0.6737482", "0.6729275", "0.6728033", "0.67124087", "0.6700944", "0.66885024", "0.6688365", "0.6684933", "0.66797554", "0.66792786", "0.66718507", "0.6667629", "0.66635823", "0.6660496", "0.6660075", "0.6648134", "0.6646896", "0.66394067", "0.6623385", "0.661005", "0.6602355", "0.6589655", "0.65715176", "0.6568818", "0.6567596", "0.65638995", "0.65594417", "0.6552931", "0.65473664", "0.6545122", "0.65445375", "0.6542726", "0.6528678", "0.651212", "0.6510786", "0.6501276", "0.6501008", "0.65002733", "0.6496028", "0.6490572", "0.6487094", "0.6485294", "0.6485294", "0.6485294", "0.6480565", "0.64788353", "0.64755595", "0.64755595", "0.64755595" ]
0.74707663
5
Screens Get Screens Details
public function getScreensDetails() { $screens = $this->system_structure_m->getScreensDetails(); //echo json_encode($screens); $output=''; foreach ($screens as $scrn) { $output=$output.'<option value="'.$scrn->ScreenID.'">'.$scrn->ScreenDescription.'</option>'; } echo $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_allowed_screens() {\n\t\t$screens = [\n\t\t\t'avada-fusion-patcher',\n\t\t\t'avada-registration',\n\t\t\t'avada-plugins',\n\t\t\t'avada-demos',\n\t\t];\n\n\t\treturn $screens;\n\t}", "function &getScreens()\n{\n if(count($this->_screens) > 0){\n return $this->_screens;\n } else {\n $debug_prefix = debug_indent(\"Module-getScreens() {$this->ModuleID}:\");\n $screens_element = $this->_map->selectFirstElement('Screens', NULL, NULL);\n\n if(!empty($screens_element) && count($screens_element->c) > 0){\n foreach($screens_element->c as $screen_element){\n $screen = $screen_element->createObject($this->ModuleID);\n $this->_screens[$screen_element->name] =& $screen;\n\n switch(strtolower(get_class($screen))){\n case 'viewscreen':\n $this->viewScreen =& $screen;\n break;\n case 'searchscreen':\n $this->searchScreen =& $screen;\n break;\n case 'listscreen':\n $this->listScreen =& $screen;\n break;\n default:\n //do nothing\n }\n unset($screen);\n }\n }\n\n debug_unindent();\n return $this->_screens;\n }\n//print_r($this->_screens);\n}", "function get_current_screen()\n {\n }", "function infoScreenObject()\n\t{\n\t\t$this->checkPermission(\"visible\");\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreen();\n\t}", "function screen($screen_id){\n\t\t$rows= query(\"select name, description from screen where id=?\",$screen_id);\n\t\treturn [\"name\"=>$rows[0][\"name\"],\"description\"=>$rows[0][\"description\"]];\n\t}", "protected function _screen() {}", "function &getScreen($name)\n{\n print \"getScreen: $name\\n\";\n if(isset($this->_screens[$name]) && count($this->_screens) > 0){\n return $this->_screens[$name];\n } else {\n if($screens = $this->getScreens()){\n return $screens[$name];\n } else {\n $dummy = null;\n return $dummy;\n }\n }\n}", "public function current_screen()\n {\n }", "function infoScreen()\n\t{\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreenForward();\n\t}", "protected function infoScreenAction() {}", "function current_screen()\n {\n }", "public function screen()\n {\n return array('post', 'page');\n }", "function infoScreenObject()\n\t{\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreen();\n\t}", "public function get_screen_variables() {\n\n\t\tglobal $pagenow, $typenow;\n\t\t$current_screen['pagenow'] = $pagenow;\n\t\t$current_screen['post'] = isset( $_GET['post'] ) ? $_GET['post'] : '';\n\t\t$current_screen['type'] = $typenow;\n\n\t\tif ( empty( $current_screen['type'] ) && ! empty( $current_screen['type'] ) ) {\n\t\t\t$current_screen['post_obj'] = get_post( $_GET['post'] );\n\t\t\t$current_screen['type'] = $current_screen['post_obj']->post_type;\n\t\t}\n\n\t\treturn $current_screen;\n\n\t}", "public function getlogicalScreenDescriptor()\n {\n return $this->logicalScreenDescriptor;\n }", "function current_screen($screen)\n {\n }", "public function settings_screen () {\n \n $this->ui->get_header();\n\n $screen = $this->ui->get_current_screen();\n\n switch ( $screen ) {\n //** Products screen. */\n case 'more_products':\n $this->more_products = $this->get_more_products();\n require_once( $this->screens_path . 'screen-more.php' );\n break;\n //** Licenses screen. */\n case 'licenses':\n default:\n $this->ensure_keys_are_actually_active();\n $this->installed_products = $this->get_detected_products();\n $this->pending_products = $this->get_pending_products();\n require_once( $this->screens_path . 'screen-manage-' . $this->type . '.php' );\n break;\n }\n\n $this->ui->get_footer();\n }", "function get_screen_icon()\n {\n }", "public function homeScreen(): array\n {\n $Banners = BannerSlider::all();\n $Categories = Category::root()->get();\n\n return [\n 'status' => 1,\n 'banners' => $Banners,\n 'categories' => $Categories,\n ];\n }", "protected function initScreens()\n\t{\n\t\tadd_action('admin_menu', array($this->Main, 'screensHandler'));\n\n\t\t// Set up handler for admin bar registration (100 = put menu item at the end of standard items)\n\t\tadd_action('admin_bar_menu', array($this->Main, 'adminBarRegister'), 100);\n\t}", "public static function get_current_screen() {\n\t\tif ( function_exists( 'get_current_screen' ) ) {\n\t\t\t$current_screen = get_current_screen();\n\t\t\tif ( $current_screen instanceof \\WP_Screen ) {\n\t\t\t\treturn $current_screen;\n\t\t\t}\n\t\t}\n\n\t\t// No screen found, return object with same properties but with empty values.\n\t\treturn (object) array(\n\t\t\t'action' => null,\n\t\t\t'base' => null,\n\t\t\t'id' => null,\n\t\t\t'is_network' => null,\n\t\t\t'is_user' => null,\n\t\t\t'parent_base' => null,\n\t\t\t'parent_file' => null,\n\t\t\t'post_type' => null,\n\t\t\t'taxonomy' => null,\n\t\t\t'is_block_editor' => null,\n\t\t);\n\t}", "public function hasScreen(){\n return $this->_has(12);\n }", "function screen_options($screen)\n {\n }", "public function screen()\n {\n $poolScreens = json_decode(\\Session::get('poll_screens'));\n \n if (!is_array($poolScreens) || count($poolScreens) < 1) {\n return view('poll.error', ['content' => __('poll.error.generic')]);\n }\n \n $currentScreenId = array_shift($poolScreens);\n \n \\Session::put('poll_screens', json_encode($poolScreens));\n \n $screen = Screen::find($currentScreenId);\n\n $questions = (new Question())->getForScreen($currentScreenId);\n\n $questionAnswers = [];\n foreach ($questions as $question) {\n $className = \"\\\\App\\\\Research\\\\Poll\\\\Question\\\\\" . ucfirst($question->question_type);\n $questionAnswers[$question->id] = new $className($question->id);\n }\n\n return view('poll.screen', compact('questions', 'screen', 'questionAnswers', 'currentScreenId'));\n }", "public function getDisplay();", "function screen_meta($screen)\n {\n }", "public function getScreenshots() {\n\t\treturn ScreenshotManager::getScreenshotsFromAddon($this->id);\n\t}", "public function screen()\n {\n return view('screen');\n }", "public function index()\n {\n $screenOne = DamageScreen::where('order', 0)->first();\n $screenTwo = DamageScreen::where('order', 1)->first();\n $status = DamageStatus::get();\n return view('dashboard.screens.index')->with('screenOne', $screenOne)->with('screenTwo', $screenTwo)->with('status',$status);\n }", "public function getScreenFolder()\n {\n return $this->screenFolder;\n }", "function set_screen_options()\n {\n }", "function set_screen()\n {\n $screen = get_current_screen();\n if ($screen) {\n $screen->ngg = TRUE;\n } else {\n if (is_null($screen)) {\n $screen = WP_Screen::get($this->object->name);\n $screen->ngg = TRUE;\n set_current_screen($this->object->name);\n }\n }\n }", "function list_schedules_screen( $vars ) {\r\n $vars['schedules'] = $this->has_schedules();\r\n $vars['assignments'] = BPSP_Assignments::has_assignments();\r\n \r\n if( empty( $vars['schedules'] ) && empty( $vars['assignments'] ) )\r\n $vars['message'] = __( 'No schedules exist.', 'bpsp' );\r\n \r\n $vars['name'] = 'list_schedules';\r\n $vars['trail'] = array(\r\n __( 'Available Schedules', 'bpsp' ) => ''\r\n );\r\n return $vars;\r\n }", "public function get_title_displays() {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_title_displays();\n\n }", "public function help() {\n $screen = get_current_screen();\n SwpmFbUtils::help($screen);\n }", "function screen_icon()\n {\n }", "private static function get_critical_screen_ids() {\n\t\treturn array( 'dashboard', 'plugins', 'plugins-network', 'edit-job_listing', 'job_listing_page_job-manager-settings' );\n\t}", "public function screen_options() {\n $screen = get_current_screen();\n\n $page_main = $this->_admin_pages['swpm'];\n\n switch ($screen->id) {\n case $page_main :\n\n if (isset($_REQUEST['form'])) :\n add_screen_option('layout_columns', array(\n 'max' => 2,\n 'default' => 2\n ));\n else :\n add_screen_option('per_page', array(\n 'label' => __('Forms per page', 'swpm-form-builder'),\n 'default' => 20,\n 'option' => 'swpm_forms_per_page'\n ));\n endif;\n\n break;\n }\n }", "function screen_layout($screen)\n {\n }", "public function render_screen_options()\n {\n }", "public function getWinCnt()\n {\n return $this->get(self::_WIN_CNT);\n }", "public function getProjectScreenList($projectDir)\n {\n $dir = (func_num_args()) ? $projectDir : $this->basepath;\n $RealPath = realpath($dir);\n // d($RealPath);\n $Directory = new RecursiveDirectoryIterator($RealPath, $this->flags);\n // echo \"<pre>\"; print_r($Directory); echo \"</pre>\";\n // self::pre($Directory);\n // d($Directory);\n // +d($Directory->__toString());\n // $Dir_ = iterator_to_array($Directory);\n // ksort($Dir_); // NOTE: Most Important step\n // get all folder (screen) name of project\n $this->screens = $this->getAllFolder($Directory);\n // d($this->screens);\n return $this->screens;\n }", "function scorm_get_popup_display_array(){\n return array(0 => get_string('iframe', 'scorm'),\n 1 => get_string('popup', 'scorm'));\n}", "public function getInfoWindows()\n {\n return $this->infoWindows;\n }", "public function getStats()\n {\n return Manivelle::cache('screen_stats')\n ->setItem($this)\n ->get();\n }", "public function screenDimensions () {\n return $this->stdout->screenDimensions();\n }", "function _janrain_capture_widget_get_screen($screenName, $fileType) {\n global $base_url;\n\n // wtb oop\n static $allowedScreens = array('signin', 'edit-profile', 'public-profile', 'forgot', 'verify');\n static $allowedTypes = array('js', 'html');\n\n // sanity check that it's a valid screen request\n if (!(in_array($screenName, $allowedScreens) && in_array($fileType, $allowedTypes))) {\n // no such screen exists, return empty string.\n return '';\n }\n\n // check for screens module\n if (module_exists('janrain_capture_screens')) {\n $fileName = sprintf('%s.%s', $screenName, $fileType);\n\n // proceed with screens module\n if (!in_array($fileName, _janrain_capture_get_screens())) {\n return '';\n }\n\n if ($screen_file = _janrain_capture_get_screen_file($fileName)) {\n return file_get_contents($screen_file);\n }\n\n return '';\n }\n\n // screen name and type are valid get the content\n if (_janrain_capture_widget_is_remote_screens()) {\n // files are remote so pull from local cache (updated by _janrain_capture_widget_update_screens();\n $fileName = sprintf('%s/%s.%s', JANRAIN_CAPTURE_WIDGET_SCREEN_CACHE_DIR, $screenName, $fileType);\n }\n else {\n $screenPath = variable_get('janrain_capture_screens_folder', 'file:///sites/all/themes/janrain-capture-screens/');\n\n if (strpos($screenPath, 'file:///', 0) === 0) {\n // files are local, usually in sites/all/themes\n $fileName = sprintf('%s%s%s.%s', DRUPAL_ROOT, str_replace('file://', '', $screenPath), $screenName, $fileType);\n }\n else {\n // invalid screens folder setting\n $fileName = sprintf('%s/janrain-capture-screens/%s.%s', drupal_get_path('module', 'janrain_capture'), $screenName, $fileType);\n }\n }\n if (!is_readable($fileName)) {\n // let everyone know there was a problem with the file, but don't kill the site.\n drupal_set_message(\"Unable to read $fileName\", 'error');\n return '';\n }\n // file exists and is readable, return the contents.\n return file_get_contents($fileName);\n}", "public function screen_options(){\n\t\t$screen = get_current_screen();\n\n\t\t$page_main\t\t= $this->_admin_pages[ 'vfb-pro' ];\n\t\t$page_entries \t= $this->_admin_pages[ 'vfb-entries' ];\n\n\t\tswitch( $screen->id ) :\n\t\t\tcase $page_entries :\n\n\t\t\t\tadd_screen_option( 'per_page', array(\n\t\t\t\t\t'label'\t\t=> __( 'Entries per page', 'visual-form-builder-pro' ),\n\t\t\t\t\t'default'\t=> 20,\n\t\t\t\t\t'option'\t=> 'vfb_entries_per_page'\n\t\t\t\t) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase $page_main :\n\n\t\t\t\tadd_screen_option( 'layout_columns', array(\n\t\t\t\t\t'max'\t\t=> 3,\n\t\t\t\t\t'default'\t=> 2\n\t\t\t\t) );\n\t\t\t\tadd_screen_option( 'per_page', array(\n\t\t\t\t\t'label'\t\t=> __( 'Forms per page', 'visual-form-builder-pro' ),\n\t\t\t\t\t'default'\t=> 20,\n\t\t\t\t\t'option'\t=> 'vfb_forms_per_page'\n\t\t\t\t) );\n\n\t\t\t\tbreak;\n\t\tendswitch;\n\t}", "public function all_screens( $location_id = '' ) {\n\t\tglobal $wpdb;\n\t\t\n\t\tif( $location_id != '' ) {\n\t\t\t// Location is set, we'll get all screens in that location\n\t\t\t$sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_screens` WHERE `location_id`=\" . sanitize_text_field( $location_id ) . \" ORDER BY `screen` ASC;\";\n\t\t} else {\n\t\t\t// Select all screens from the db\n\t\t\t$sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_screens` ORDER BY `screen` ASC;\";\n\t\t}\n\t\t\n\t\t$sqlret = $wpdb->get_results( $sql, ARRAY_A );\n\t\t\n\t\t// Set the retun object\n\t\t$return = new StdClass();\n\t\t\n\t\t// Process each screen\n\t\tforeach( $sqlret as $screen ) {\n\t\t\t$return->$screen['screen'] = new StdClass();\n\t\t\t$return->$screen['screen']->id = $screen['id'];\n\t\t\t$return->$screen['screen']->name = $screen['screen'];\n\t\t\t$return->$screen['screen']->location_id = $screen['location_id'];\n\t\t\t$return->$screen['screen']->device_id = $screen['device_id'];\n\t\t\t$return->$screen['screen']->layout_id = $screen['layout_id'];\n\t\t}\n\t\t\n\t\t// Return the screens\n\t\treturn $return;\n\t}", "public function stopAllScreens()\n { $log = usingLog()->startAction(\"stop all running screen sessions on host '{$this->args[0]}'\");\n\n // get the app details\n $processes = fromHost($this->args[0])->getAllScreenSessions();\n\n // stop the process\n foreach ($processes as $processDetails) {\n usingHost($this->args[0])->stopProcess($processDetails->pid);\n usingProcessesTable()->removeProcess($this->args[0], $processDetails);\n }\n\n // all done\n $log->endAction(\"stopped \" . count($processes) . \" session(s)\");\n }", "public static function getResolutions(){\n\t\t\t$result = ScreenResolution::select('screen_size_id', DB::raw('CONCAT( width, \"x\", height ) AS resolution') )\n\t\t\t\t\t\t\t\t\t ->where('status', '=', 1)\n\t\t\t\t\t\t\t\t\t ->get();\n\t\t\treturn $result;\n\t\t}", "function meta_box_prefs($screen)\n {\n }", "public function screen()\n {\n return $this->belongsTo(Screen::class);\n }", "public function getDisplayers(): array;", "function get_breakpoints() {\n\t$breakpoints = array(\n\t\t'large_screen' => 1024,\n\t\t'desktop' => 769,\n\t\t'tablet' => 481,\n\t\t'mobile' => 0,\n\t);\n\treturn apply_filters( 'get_current_breakpoints', $breakpoints );\n}", "function fgallery_screen_settings($current, $screen){\n if ( $screen->id == '1-flash-gallery_page_fgallery_images' && !isset($_GET['action'])){\n $current = '<h5>'._x('Show on screen', 'Screen Options').'</h5>';\n $current .= fgallery_screen_options($screen);\n $current .= '<div>'. wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', true ).'</div>';\n } elseif ($screen->id == 'toplevel_page_fgallery' && !isset($_GET['action'])){\n $current = '<h5>'._x('Show on screen', 'Screen Options').'</h5>';\n $current .= fgallery_screen_options($screen);\n $current .= '<div>'. wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', true ).'</div>';\n }\n return $current;\n}", "public function render_screen_meta()\n {\n }", "function getNextScreen($pScreenName)\n{\n $ScreenNames = array_keys($this->getScreens());\n $current_key = array_search($pScreenName, $ScreenNames);\n if(false !== $current_key){\n $next_key = $current_key + 1;\n if(isset($ScreenNames[$next_key])){\n return $ScreenNames[$next_key];\n }\n }\n return '';\n}", "public function getScreenThumb()\n {\n return $this->thumbList;\n }", "public function __construct( $s = array ( 'playscripts' ) )\n {\n $this->screens = $s;\n }", "function get_site_screen_help_tab_args()\n {\n }", "function acf_get_location_screen($screen = array(), $deprecated = \\false)\n{\n}", "public function createScreenBuffer($cfg) \n {\n $screenInfo = array();\n \n foreach($cfg as $key=>$val) {\n $info = array(urlencode($key),urlencode($val));\n $info = urlencode(implode(':',$info));\n array_push($screenInfo,$info);\n }\n \n $screenId = implode(':',$screenInfo);\n if (!isset($this->screens[$screenId])) {\n $this->screens[$screenId] = '';\n }\n return $screenId; \n }", "public function set_current_screen()\n {\n }", "public static function render_help() {\n\n // Grab the current screen\n $screen = get_current_screen();\n\n }", "public function getDisplay() {\n\t\treturn parent::getDisplay();\n\t}", "public static function getScreenWidth() : int {}", "public function setScreenVars()\n {\n // $_SESSION[ 'screen' ] = array();\n // $_SESSION['screen']['width'] = $_POST [ 'screenAr' ] [ 0 ];\n // $_SESSION['screen']['height'] = $_POST [ 'screenAr' ] [ 1 ];\n\n // $this->jsonSend [ 'success ' ] = '1';\n // $this->jsonSend [ 'screenWidth ' ] = $_POST [ 'screenAr' ] [ 0 ];\n // $this->jsonSend [ 'screenHeight ' ] = $_POST [ 'screenAr' ] [ 1 ];\n //this WON'T be set during the first page load\n $_SESSION[ 'screen' ] = array();\n $sw = $_POST [ 'screenW' ];\n $sh = $_POST [ 'screenH' ];\n $_SESSION['screen']['width'] = $sw;\n $_SESSION['screen']['height'] = $sh;\n\n $targetDim = $sh;\n if ( ( $this->deviceType == 'phone' ) || ( $this->deviceType == 'tablet' ) )\n {\n $targetDim = ( $sw > $sh ) ? $sw : $sh; \n }\n $_SESSION['screen']['targetScreenDimension'] = $targetDim;\n\n $this->jsonSend [ 'targetScreenDimension' ] = $_SESSION ['screen'] [ 'targetScreenDimension' ];\n $this->sendJson();\n }", "protected function checkScreenAction() {}", "public function is_screen() {\n\t\treturn ! empty( $this->ID ) && Tribe__Admin__Helpers::instance()->is_screen( $this->ID );\n\t}", "static function init()\n {\n $return_code = 0;\n\n ob_start();\n self::$monitor = system(\n \"xrandr --listactivemonitors | cut -d' ' -f6 | tail -n 1\"\n );\n ob_end_clean();\n\n if(self::$monitor == \"\")\n {\n echo \"Could not get the current display information, restarting...\\n\";\n exit;\n }\n }", "function check_admin_screen( $key = '' ) {\n\n\t// If we aren't on the admin, or don't have the function, fail right away.\n\tif ( ! is_admin() || ! function_exists( 'get_current_screen' ) ) {\n\t\treturn false;\n\t}\n\n\t// Get the screen object.\n\t$screen = get_current_screen();\n\n\t// If we didn't get our screen object, bail.\n\tif ( ! is_object( $screen ) ) {\n\t\treturn false;\n\t}\n\n\t// Switch through and return the item.\n\tswitch ( sanitize_key( $key ) ) {\n\n\t\tcase 'object' :\n\t\t\treturn $screen;\n\t\t\tbreak;\n\n\t\tcase 'action' :\n\t\t\treturn $screen->action;\n\t\t\tbreak;\n\n\t\tcase 'base' :\n\t\t\treturn $screen->base;\n\t\t\tbreak;\n\n\t\tcase 'id' :\n\t\t\treturn $screen->id;\n\t\t\tbreak;\n\n\t\tcase 'post_type' :\n\t\t\treturn $screen->post_type;\n\t\t\tbreak;\n\n\t\tdefault :\n\t\t\treturn array(\n\t\t\t\t'action' => $screen->action,\n\t\t\t\t'base' => $screen->base,\n\t\t\t\t'id' => $screen->id,\n\t\t\t\t'post_type' => $screen->post_type,\n\t\t\t);\n\n\t\t// End all case breaks.\n\t}\n}", "static function getDesktopRand();", "public static function renderScreen($slug) {\n\n $screen = Screen::where(\"slug\", $slug)->first();\n if(!$screen) {\n return [\n 'result' => \"\",\n 'error' => \"No Such Page\"\n ];\n }\n\n $result = \"\";\n $screenSegments = ScreenSegments::where(\"screen_id\", $screen->id)->where(\"status\", 1)->orderBy('sort', 'asc')->get();\n $successfullyParsed = 0;\t\t\t\n foreach($screenSegments as $screenSegment) {\n\n $screenSegment->init();\n\n $html = HTMLBuilder::formBuilder($screenSegment);\n if(!empty($html)) {\n $successfullyParsed++;\n }\n $result .=\n '<div class=\"' . $screen->class . '\" id=\"' . $screen->identifier . '\">'\n . $html .\n '</div>';\n\n }\n if($successfullyParsed==0) {\n $result = ScreenFields::loadBlade('errors.under-construction');\n }\n return [\n 'screen' => $screen,\n 'result' => $result,\n ];\n }", "function isRecordScreen()\n{\n return true;\n}", "protected function getInfoScreenHTML()\n {\n require_once('./Services/InfoScreen/classes/class.ilInfoScreenGUI.php');\n $info = new ilInfoScreenGUI(null);\n $mappings = array_filter(MetadataService::getInstance()->getMappings($this->ctrl->getContextObjType()), function (ilObjectMapping $mapping) : bool {\n return MetadataService::getInstance()->canBeShow($this->getObject(), $mapping, MetadataService::SHOW_CONTEXT_SHOW_INFO_SCREEN);\n });\n if (!count($mappings)) {\n return '';\n }\n $query = new RecordQuery($this->getObject());\n foreach ($mappings as $mapping) {\n foreach ($mapping->getFieldGroups() as $group) {\n $records = array_map(function ($field_id) use ($query, $group) {\n $field = Field::find($field_id);\n\n return $query->getRecord($group, $field);\n }, $mapping->getShowInfoFieldIds($group->getId()));\n $records = array_filter($records, function ($record) { return $record !== null; });\n if (!count($records)) {\n continue;\n }\n $info->addSection($group->getTitle($this->user->getLanguage()));\n foreach ($records as $record) {\n $info->addProperty($record->getField()->getLabel($this->user->getLanguage()), $record->getFormattedValue());\n }\n }\n }\n\n return $info->getHtml();\n }", "function &getBuffer($screenId) \n { \n return $this->screens[$screenId]; \n }", "public function getWindows() {\n return $this->windows;\n }", "public function current_screen ( $screen ) {\n switch( $screen->id ) {\n case 'plugins':\n //** Check licenses keys once per 12 hours */\n if ( false === ( $e = get_transient( $this->token . '_ping' ) ) ) {\n $this->ensure_keys_are_actually_active();\n set_transient( $this->token . '_ping', time(), 12 * HOUR_IN_SECONDS );\n }\n break;\n }\n }", "public function getNonFullScreenPageMode() {}", "public function render_screen_options() {\n\t\t// Adds the screen options.\n\t\trequire_once ABSPATH . 'wp-admin/includes/nav-menu.php';\n\t\tadd_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' );\n\n\t\t// Display screen options.\n\t\t$screen = WP_Screen::get( 'nav-menus.php' );\n\t\t$screen->render_screen_options( array( 'wrap' => false ) );\n\t}", "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}", "function screen_criteria($screen_id){\n\t\t$criteria=query(\"select sc.* from screen_criteria sc, screen_build sb where sb.criteria_id=sc.id and sb.screen_id=?\",$screen_id);\n\t\treturn $criteria;\n\t}", "public function getAllScreenTemplates() {\n return $this->container->get('doctrine')\n ->getRepository('Os2DisplayCoreBundle:ScreenTemplate')\n ->findAll();\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 screen_options() {\n\n\t\t\tif ( ! $this->is_dashboard_page() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$args = array(\n\t\t\t\t'label' => __( 'Hide WooCart Dashboard', 'woocart-defaults' ),\n\t\t\t\t'default' => true,\n\t\t\t\t'option' => '_hide_custom_dashboard',\n\t\t\t);\n\t\t\tadd_screen_option( 'woocart_custom_dashboard', $args );\n\n\t\t}", "function get_caps($imap_stream) {\n return sqimap_run_command_list($imap_stream, 'CAPABILITY',false, $responses, $message,false);\n}", "public function getList()\n {\n $result = array();\n $list = Pi::registry('activity', 'user')->read();\n foreach ($list as $name => $activity) {\n $result[$name] = array(\n 'title' => $activity['title'],\n 'icon' => $activity['icon'],\n );\n }\n\n return $result;\n }", "function generateTabs($pScreenName, $pRestriction = ''){\n if(0 == count($this->getScreens())){\n return '';\n }\n\n $content = '';\n $tabs = array();\n $Screens =& $this->getScreens();\n\n if (\"List\" == $pScreenName){\n if(empty($this->addNewName)){\n $addNewName = $this->SingularRecordName;\n } else {\n $addNewName = $this->addNewName;\n }\n\t\t\t$content = '';\n if($this->AllowAddRecord){\n if('view' == $pRestriction){\n //$content = \"\\$tabs['New'] = array(\\\"\\\", gettext(\\\"No Add New|You cannot add a new {$addNewName} because you don't have permission\\\"), 'disabled');\";\n } else {\n //get first edit screen and insert a tab link to it as \"new\"\n foreach ($Screens as $Screen){\n if ('editscreen' == strtolower(get_class($Screen))){\n\t\t\t\t\t\t\t$content = \"\\$tabs['New'] = array(\\\"edit.php?mdl={$this->ModuleID}&amp;scr={$Screen->name}\\\", gettext(\\\"Add New|Add a new \\\").gettext(\\\"{$addNewName}\\\"));\";\t\n break; //exits loop\n }\n }\n }\n } else {\n // $content = \"\\$tabs['New'] = array(\\\"\\\", gettext(\\\"No Add New|To add a new {$addNewName} you must go to a parent module\\\"), 'disabled');\";\n }\n \n\n //get search screen and insert a tab link to it\n if(count($Screens)){\n foreach ($Screens as $Screen){\n if ('searchscreen' == strtolower(get_class($Screen))){\n $content .= \"\\$tabs['Search'] = array(\\\"search.php?mdl={$this->ModuleID}\\\", gettext(\\\"Search|Search in \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n //$content .= \"\\$tabs['Reports'] = array(\\\"reports.php?mdl={$this->ModuleID}\\\", gettext(\\\"Reports|Reports for \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\tif( true == $this->areChartsDefined() ){\n\t\t\t\t\t\t\t$content .= \"\\$tabs['Charts'] = array(\\\"charts.php?mdl={$this->ModuleID}\\\", gettext(\\\"Charts|Charts for \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\t}\n } \n }\n }\n if($this->dataCollectionForm){\n $content .= \"\\$tabs['DataCollection'] = array(\\\"dataCollectionForm.php?mdl={$this->ModuleID}\\\", gettext(\\\"Blank Form|Blank form for \\\").gettext(\\\"{$this->PluralRecordName}\\\"), 'download');\";\n }\n } elseif (\"ListCtxTabs\" == $pScreenName){\n\t\t\n//$tabs['List'] = Array(\"list.php?$qs\", gettext(\"List|View the list of /**plural_record_name**/\"));\n\t\t\t$content = \"\\$tabs['List'] = array(\\\"list.php?\\$qs\\\", gettext(\\\"List|View the list of \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\tif(empty($this->addNewName)){\n $addNewName = $this->SingularRecordName;\n } else {\n $addNewName = $this->addNewName;\n }\n\n if($this->AllowAddRecord){\n if('view' == $pRestriction){\n // $content .= \"\\$tabs['New'] = array(\\\"\\\", gettext(\\\"No Add New|You cannot add a new {$addNewName} because you don't have permission\\\"), 'disabled');\";\n } else {\n //get first edit screen and insert a tab link to it as \"new\"\n foreach ($Screens as $Screen){\n if ('editscreen' == strtolower(get_class($Screen))){\n\t\t\t\t\t\t\t$content .= \"\\$tabs['New'] = array(\\\"edit.php?mdl={$this->ModuleID}&amp;scr={$Screen->name}\\\", gettext(\\\"Add New|Add a new \\\").gettext(\\\"{$addNewName}\\\"));\";\t\n\n break; //exits loop\n }\n }\n }\n } else {\n //$content = \"\\$tabs['New'] = array(\\\"\\\", gettext(\\\"No Add New|To add a new {$addNewName} you must go to a parent module\\\"), 'disabled');\";\n }\n \n\n //get search screen and insert a tab link to it\n if(count($Screens)){\n foreach ($Screens as $Screen){\n if ('searchscreen' == strtolower(get_class($Screen))){\n $content .= \"\\$tabs['Search'] = array(\\\"search.php?mdl={$this->ModuleID}\\\", gettext(\\\"Search|Search in \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\t//$content .= \"\\$tabs['Reports'] = array(\\\"reports.php?mdl={$this->ModuleID}\\\", gettext(\\\"Reports|Reports for \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\tif( true == $this->areChartsDefined() ){\n\t\t\t\t\t\t\t$content .= \"\\$tabs['Charts'] = array(\\\"charts.php?mdl={$this->ModuleID}\\\", gettext(\\\"Charts|Charts for \\\").gettext(\\\"{$this->PluralRecordName}\\\"));\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n }\n }\n if($this->dataCollectionForm){\n $content .= \"\\$tabs['DataCollection'] = array(\\\"dataCollectionForm.php?mdl={$this->ModuleID}\\\", gettext(\\\"Blank Form|Blank form for \\\").gettext(\\\"{$this->PluralRecordName}\\\"), 'download');\";\n }\n\t\t}elseif( \"EditScreenPermissions\" == $pScreenName ){\n\t\t\t$content = '';\n\t\t\tforeach ($Screens as $Screen){\t\t\t\n\t\t\t\tif( 'editscreen' == strtolower(get_class($Screen)) AND isset($Screen->EditPermission) ){\n\t\t\t\t\t$content .= \"\\$EditScrPermission['{$Screen->name}'] = '{$Screen->EditPermission}';\\n\";\t\n\t\t\t\t}\n }\n\t\t\tif( $content != '' ){\n\t\t\t\tforeach ($Screens as $Screen){\t\t\t\n\t\t\t\t\tif( 'editscreen' == strtolower(get_class($Screen)) AND !isset($Screen->EditPermission) ){\n\t\t\t\t\t\t$content .= \"\\$EditScrPermission['{$Screen->name}'] = '{$this->ModuleID}';\\n\";\t\n\t\t\t\t\t}\n }\n\t\t\t}\n\t\t\n\t\t}elseif( \"ListRecordMenu\" == $pScreenName ){ \n\t\t \n\t\t\t$recordMenuCounter = 0;\n\t\t\t\t\n\t\t\tforeach ($Screens as $Screen){\n $linkTo = '';\n $tab = '';\n\t\t\t\t$recordMenu = '';\n\t\t\t\t$recordMenuEntries = '';\n\t\t\t\t\n switch( strtolower(get_class($Screen)) ){\n case \"viewscreen\":\n $handler = \"view.php\"; \n $phrase = \"View|View summary information about a record of type \\\").gettext(\\\"\". $this->SingularRecordName;\n break;\n case \"editscreen\":\n if(!empty($Screen->linkToModuleID)){\n $linkTo = $Screen->linkToModuleID;\n }\n $handler = \"edit.php\";\n\n if (empty($Screen->phrase)){\n $phrase = $Screen->name;\n } else {\n $phrase = $Screen->phrase;\n }\n break;\n case \"searchscreen\":\n $handler = \"search.php\";\n $phrase = \"Search|Search in \\\").' '.gettext(\\\"\". $this->PluralRecordName;\n break;\n case \"listscreen\":\n $handler = \"list.php\";\n $phrase = \"List|View the list of \\\").' '.gettext(\\\"\". $this->PluralRecordName;\n break;\n case \"recordreportscreen\":\n $handler = \"reports.php\";\n $phrase = $Screen->phrase;\n break;\n case \"listreportscreen\":\n $handler = \"reports.php\";\n $phrase = $Screen->phrase;\n break;\n case \"anoneditscreen\":\n continue;\n break;\n default:\n print_r($Screens);\n die(\"unknown screen type: '\".get_class($Screen).\"'\\n\");\n }\n\n\t\t\t\t$recordMenu = '$recordMenuEntries['.$Screen->name.']='.\"'{ text: \\\"'.strip_tags( ShortPhrase( gettext(\\\"{$phrase}\\\") ) ).'\\\" }';\\n\";\n\n $tabConditionModuleID = '';\n if(!empty($Screen->tabConditionModuleID)){\n $tabConditionModuleID = \", '{$Screen->tabConditionModuleID}'\";\n }\n\n\t\t\t\tif( ( \"view\" == $pRestriction && \"viewscreen\" == strtolower(get_class($Screen)) ) \n\t\t\t\t || (\"view\" != $pRestriction) ){\n\t\t\t\t\tif($linkTo == ''){\t\t\t\t\t\t\n\t\t\t\t\t\t$recordMenuURL = '$recordMenuURL['.$Screen->name.']= '.\"\\\"$handler?scr={$Screen->name}&mdl={$this->ModuleID}\\\";\\n\"; \n\t\t\t\t\t} else {\n\t\t\t\t\t\t$recordMenuURL = '$recordMenuURL['.$Screen->name.']= '.\"\\\"$handler?scr={$Screen->name}&mdl=$linkTo\\\";\\n\"; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t\n if( in_array(strtolower(get_class($Screen)), array('viewscreen', 'editscreen', 'recordreportscreen')) ){ \n\t\t\t\t\t$recordMenuList .= $recordMenu;\n\t\t\t\t\t$recordMenuURLList .= $recordMenuURL;\t\t\t\t\t\n }\n }\t\t\t\n\t\t\t\n\t\t\t$content = $recordMenuList.$recordMenuURLList;\n\t\n\t\t}else {\n print \"m. GenerateTabs: current screen $pScreenName\\n\";\n\n $currentScreen = $this->getScreen($pScreenName);\n\n foreach ($Screens as $Screen){\n $linkTo = '';\n $tab = '';\n switch(strtolower(get_class($Screen))){\n case \"viewscreen\":\n $handler = \"view.php\";\n /* if(in_array($this->SingularRecordName[0], array('a','e','i','o','h','y','A','E','I','O','H','Y'))){\n $a = 'an';\n } else {\n $a = 'a';\n } */\n $phrase = \"View|View summary information about a record of type \\\").gettext(\\\"\". $this->SingularRecordName;\n break;\n case \"editscreen\":\n if(!empty($Screen->linkToModuleID)){\n $linkTo = $Screen->linkToModuleID;\n }\n $handler = \"edit.php\";\n\n if (empty($Screen->phrase)){\n $phrase = $Screen->name;\n } else {\n $phrase = $Screen->phrase;\n }\n break;\n case \"searchscreen\":\n $handler = \"search.php\";\n $phrase = \"Search|Search in \\\").' '.gettext(\\\"\". $this->PluralRecordName;\n break;\n case \"listscreen\":\n $handler = \"list.php\";\n $phrase = \"List|View the list of \\\").' '.gettext(\\\"\". $this->PluralRecordName;\n break;\n case \"recordreportscreen\":\n $handler = \"reports.php\";\n $phrase = $Screen->phrase;\n break;\n case \"listreportscreen\":\n $handler = \"reports.php\";\n $phrase = $Screen->phrase;\n break;\n case \"anoneditscreen\":\n continue;\n break;\n default:\n print_r($Screens);\n die(\"unknown screen type: '\".get_class($Screen).\"'\\n\");\n }\n\n $tabConditionModuleID = '';\n if(!empty($Screen->tabConditionModuleID)){\n $tabConditionModuleID = \", '{$Screen->tabConditionModuleID}'\";\n }\n\n if ($pScreenName != $Screen->name){\n if ( ( \"view\" == $pRestriction \n\t\t\t\t\t && ( \"viewscreen\" == strtolower( get_class($Screen) ) \n\t\t\t\t\t || \"recordreportscreen\" == strtolower( get_class($Screen) ) ) ) \n\t\t\t\t\t || (\"view\" != $pRestriction) ){\n\n //insert link\n if($linkTo == ''){\n $tab = \" \\$tabs['{$Screen->name}'] = array( \\\"$handler?scr={$Screen->name}&amp;\\$tabsQS\\\", gettext(\\\"{$phrase}\\\") $tabConditionModuleID);\\n\";\n } else {\n $tab = \" \\$tabs['{$Screen->name}'] = array( \\\"$handler?mdl=$linkTo&amp;rid=\\$recordID\\\", gettext(\\\"{$phrase}\\\") $tabConditionModuleID);\\n\";\n }\n }\n } else {\n //Current screen: insert name only\n $tab = \" \\$tabs['{$Screen->name}'] = array( \\\"\\\", gettext(\\\"{$phrase}\\\") $tabConditionModuleID);\\n\";\n }\n\n if(in_array(strtolower(get_class($Screen)), array('viewscreen', 'editscreen', 'recordreportscreen'))){\n $content .= $tab;\n }\n }\n }\n\n return $content;\n }", "public function iPrintCurrentWindow() {\r\n /** @var MinkSession $session */\r\n $session = $this->getSession();\r\n $current_window = $session->getDriver()->getWindowName();\r\n var_dump($current_window);\r\n }", "function wruv_current_streamtitle() {\n\t$onair = wruv_current_sched_slot();\n\treturn wruv_streamtitle_str( $onair );\n\n}", "public static function hide_screen_options() {\n if (!is_admin())\n add_filter('screen_options_show_screen', 'remove_screen_options');\n }", "public function shells()\n {\n $this->_display('shells');\n }", "function main_screen($mode = 'reg')\r\n\t{\r\n\t\tglobal $IN, $INFO, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;\r\n\t\t$ibforums = Ibf::app();\r\n\r\n\t\t$ADMIN->page_title = \"Statistic Center\";\r\n\r\n\t\t$ADMIN->page_detail = \"Please define the date ranges and other options below.<br>Note: The statistics generated are based on the information currently held in the database, they do not take into account pruned forums or delete posts, etc.\";\r\n\r\n\t\tif ($mode == 'reg')\r\n\t\t{\r\n\t\t\t$form_code = 'show_reg';\r\n\r\n\t\t\t$table = 'Registration Statistics';\r\n\t\t} else\r\n\t\t{\r\n\t\t\tif ($mode == 'topic')\r\n\t\t\t{\r\n\t\t\t\t$form_code = 'show_topic';\r\n\r\n\t\t\t\t$table = 'New Topic Statistics';\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\tif ($mode == 'post')\r\n\t\t\t\t{\r\n\t\t\t\t\t$form_code = 'show_post';\r\n\r\n\t\t\t\t\t$table = 'Post Statistics';\r\n\t\t\t\t} else\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($mode == 'msg')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$form_code = 'show_msg';\r\n\r\n\t\t\t\t\t\t$table = 'PM Statistics';\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($mode == 'views')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$form_code = 'show_views';\r\n\r\n\t\t\t\t\t\t\t$table = 'Topic View Statistics';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$old_date = getdate(time() - (3600 * 24 * 90));\r\n\t\t$new_date = getdate(time() + (3600 * 24));\r\n\r\n\t\t//+-------------------------------\r\n\r\n\t\t$ADMIN->html .= $SKIN->start_form(array(\r\n\t\t 1 => array('code', $form_code),\r\n\t\t 2 => array('act', 'stats'),\r\n\t\t ));\r\n\r\n\t\t//+-------------------------------\r\n\r\n\t\t$SKIN->td_header[] = array(\"&nbsp;\", \"40%\");\r\n\t\t$SKIN->td_header[] = array(\"&nbsp;\", \"60%\");\r\n\r\n\t\t//+-------------------------------\r\n\r\n\t\t$ADMIN->html .= $SKIN->start_table($table);\r\n\r\n\t\t$ADMIN->html .= $SKIN->add_td_row(array(\r\n\t\t \"<b>Date From</b>\",\r\n\t\t $SKIN->form_dropdown(\"from_month\", $this->make_month(), $old_date['mon']) . '&nbsp;&nbsp;' . $SKIN->form_dropdown(\"from_day\", $this->make_day(), $old_date['mday']) . '&nbsp;&nbsp;' . $SKIN->form_dropdown(\"from_year\", $this->make_year(), $old_date['year'])\r\n\t\t ));\r\n\r\n\t\t$ADMIN->html .= $SKIN->add_td_row(array(\r\n\t\t \"<b>Date To</b>\",\r\n\t\t $SKIN->form_dropdown(\"to_month\", $this->make_month(), $new_date['mon']) . '&nbsp;&nbsp;' . $SKIN->form_dropdown(\"to_day\", $this->make_day(), $new_date['mday']) . '&nbsp;&nbsp;' . $SKIN->form_dropdown(\"to_year\", $this->make_year(), $new_date['year'])\r\n\t\t ));\r\n\r\n\t\tif ($mode != 'views')\r\n\t\t{\r\n\t\t\t$ADMIN->html .= $SKIN->add_td_row(array(\r\n\t\t\t \"<b>Time scale</b>\",\r\n\t\t\t $SKIN->form_dropdown(\"timescale\", array(\r\n\t\t\t 0 => array('daily', 'Daily'),\r\n\t\t\t 1 => array(\r\n\t\t\t\t 'weekly',\r\n\t\t\t\t 'Weekly'\r\n\t\t\t ),\r\n\t\t\t 2 => array(\r\n\t\t\t\t 'monthly',\r\n\t\t\t\t 'Monthly'\r\n\t\t\t )\r\n\t\t\t ))\r\n\t\t\t ));\r\n\t\t}\r\n\r\n\t\t$ADMIN->html .= $SKIN->add_td_row(array(\r\n\t\t \"<b>Result Sorting</b>\",\r\n\t\t $SKIN->form_dropdown(\"sortby\", array(\r\n\t\t 0 => array(\r\n\t\t\t 'asc',\r\n\t\t\t 'Ascending - Oldest dates first'\r\n\t\t ),\r\n\t\t 1 => array(\r\n\t\t\t 'desc',\r\n\t\t\t 'Descending - Newest dates first'\r\n\t\t )\r\n\t\t ), 'desc')\r\n\t\t ));\r\n\r\n\t\t$ADMIN->html .= $SKIN->end_form(\"Show\");\r\n\r\n\t\t$ADMIN->html .= $SKIN->end_table();\r\n\r\n\t\t$ADMIN->output();\r\n\r\n\t}", "function bpfit_walk_subtab_show_screen() {\n\t\t\tadd_action( 'bp_template_title', array($this, 'bpfit_walk_subtab_function_to_show_title') );\n\t\t\tadd_action( 'bp_template_content', array($this, 'bpfit_walk_subtab_function_to_show_content') );\n\t\t\tbp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );\n\t\t}", "protected abstract function retrieveViewDisplays(Row $row);", "function settings_gui(){\n\t$tabs = new tabs('system_settings');\n\t$tabs->add('capabilities','Brukerroller');\n\t\n\t$tabs->draw();\n\tglobal $hd_active_tab;\n\tswitch($hd_active_tab) {\n\t\tcase 'capabilities':\n\t\t\trequire_once('gui.capabilites.settings.php');\n\t\t\tgui_capas();\n\t\t\tbreak;\n\t}\n}", "public static function getKiosk() {\n\t return self::getPathParams()['kiosk'];\n\t}", "public function index()\n {\n return MTP::latest('id')->get();\n }", "public function getShowInHome();" ]
[ "0.6537875", "0.6385602", "0.608241", "0.6005124", "0.59540874", "0.5943824", "0.59298617", "0.5898245", "0.58824545", "0.5860758", "0.5820196", "0.57913446", "0.57882553", "0.5726827", "0.5714163", "0.56430453", "0.562844", "0.56045103", "0.5590049", "0.55152386", "0.55149984", "0.55126905", "0.55091023", "0.55022246", "0.5454369", "0.539725", "0.53865516", "0.5385399", "0.5378349", "0.5314662", "0.526657", "0.5257766", "0.5238213", "0.51878667", "0.5159099", "0.5157478", "0.51328486", "0.51274276", "0.5101455", "0.50895196", "0.50880766", "0.50834614", "0.5070228", "0.50612587", "0.506065", "0.50527126", "0.5048774", "0.50364494", "0.50114304", "0.5004356", "0.5001507", "0.4996285", "0.49799263", "0.4979058", "0.49521515", "0.494677", "0.49462157", "0.49285257", "0.49130177", "0.48919573", "0.4887854", "0.48794132", "0.48656616", "0.4851185", "0.4829999", "0.48199758", "0.4819599", "0.4811285", "0.48060185", "0.47785205", "0.47639358", "0.47435474", "0.47369438", "0.47364122", "0.4722437", "0.4714838", "0.4714251", "0.47098958", "0.47041935", "0.47040308", "0.4696847", "0.46481937", "0.46277413", "0.46259108", "0.46028775", "0.460051", "0.45960882", "0.4588359", "0.4583388", "0.45821717", "0.45743427", "0.45672876", "0.4562203", "0.45401135", "0.45326155", "0.45317525", "0.45258486", "0.451245", "0.44882473", "0.44875818" ]
0.6434759
1
React to locale readiness
public function l10n_ready() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_locale_switched()\n {\n }", "protected function checkSystemLocale() {}", "public function locale();", "public function getLocale() {}", "function locale_emulation()\r\n\t{\r\n\t\tglobal $EMULATEGETTEXT;\r\n\t\treturn $EMULATEGETTEXT;\r\n\t}", "protected function initializeL10nLocales() {}", "function determine_locale()\n {\n }", "public function getLocale();", "public function getLocale();", "public function settingLocale() {}", "public function isTestLocale() {\n return false;\n }", "private function processLocale(): void\n {\n if ($this->request->has(self::LOCALE) && null !== $this->request->get(self::LOCALE, null)) {\n $this->setLocale($this->request->get(self::LOCALE));\n }\n }", "public function isSillyLocale() {\n return false;\n }", "protected static function getFacadeAccessor() { return Locale::class; }", "function getLocale();", "function restore_current_locale()\n {\n }", "public function getLocale(): string;", "public function getLocale(): string;", "public function getLocale(): string;", "public function get_switched_locale()\n {\n }", "public function isUsingLocaleFallback()\n {\n return $this->useLocaleFallbackByDefault;\n }", "private function applyLocaleSettings()\n {\n LocaleFilter::MANUALLY_ENABLED_HERE;\n $localeSubscriber = new LocaleSubscriber();\n $localeSubscriber->setContainer($this->getContainer());\n $localeSubscriber->enableLocaleFilter($this->locale);\n // translate to current locale\n $this->getContainer()->get('stof_doctrine_extensions.listener.translatable')->setTranslatableLocale($this->locale);\n }", "public function is_switched() {\n\t\treturn ! empty( $this->locales );\n\t}", "function restore_previous_locale()\n {\n }", "private function initLocale()\n {\n if (!$this->initialised) {\n putenv(\"LANG=$this->locale\");\n setlocale(LC_ALL, $this->locale);\n\n $this->initialised = true;\n }\n }", "protected function checkLocaleWithUTF8filesystem() {}", "public function getLocaleManager();", "function acf_get_locale()\n{\n}", "function yourls_is_rtl() {\n\tglobal $yourls_locale_formats;\n\tif( !isset( $yourls_locale_formats ) )\n\t\t$yourls_locale_formats = new YOURLS_Locale_Formats();\n\n\treturn $yourls_locale_formats->is_rtl();\n}", "public function restore_current_locale()\n {\n }", "function _readLocaleInfo() {\n// $row = $this->select01($sql);\n// if (!$row) {\n// return false;\n// }\n $sql = $this->mkSQL('SELECT * FROM %I WHERE id = %Q', $this->tablePrfx.'lang', $this->_locale);\n return $this->select01($sql);\n }", "public function hasLocalizations()\n {\n return !!$this->numLocalizations();\n }", "function wp_load_translations_early()\n {\n }", "protected function loadLocale(): void\n {\n $this->localeCollection = new Collection();\n\n $repo = $this;\n $callback = static function () use ($repo) {\n return $repo->readDataSource();\n };\n $key = 'laravel-i18n-datasource-cache';\n $ttl = Carbon::now()->addMonth();\n\n $data = (bool) config('i18n.enable_cache') === true ? Cache::remember($key, $ttl, $callback) : $callback();\n\n foreach ($data as $locale) {\n $this->localeCollection->put(\n strtolower(data_get($locale, 'language')),\n new Locale(\n data_get($locale, 'name'),\n data_get($locale, 'language'),\n data_get($locale, 'country')\n )\n );\n }\n }", "public function isActiveLocale()\n {\n return $this->getActiveLocale();\n }", "public function filter_locale($locale)\n {\n }", "public static function get_enabled_locales() {\r\n\t\treturn self::$enabled_locales;\r\n\t}", "function getDefaultLocale();", "function switch_to_locale($locale)\n {\n }", "function yourls_get_locale() {\n\tglobal $yourls_locale;\n\n\tif ( !isset( $yourls_locale ) ) {\n\t\t// YOURLS_LANG is defined in config.\n\t\tif ( defined( 'YOURLS_LANG' ) )\n\t\t\t$yourls_locale = YOURLS_LANG;\n\t}\n\n if ( !$yourls_locale )\n $yourls_locale = '';\n\n\treturn yourls_apply_filter( 'get_locale', $yourls_locale );\n}", "public function isFallbackLocaleHidden(): bool {\n return config('translatable.hide_fallback_locale');\n }", "public function restore_previous_locale()\n {\n }", "protected function loadLocalization() {}", "public function getCurrentLocaleEntity();", "public function supportsLanguageSwitch(): bool;", "function shIsMultilingual()\n{\n\tShlSystem_Log::debug('sh404sef', 'Using deprecated ' . __FUNCTION__ . ', removed as not applicable anymore');\n}", "function _setlocale($category, $locale)\r\n\t{\r\n\t\tglobal $CURRENTLOCALE, $EMULATEGETTEXT;\r\n\t\tif ($locale === 0) { // use === to differentiate between string \"0\"\r\n\t\t\tif ($CURRENTLOCALE != '')\r\n\t\t\t\treturn $CURRENTLOCALE;\r\n\t\t\telse\r\n\t\t\t// obey LANG variable, maybe extend to support all of LC_* vars\r\n\t\t\t// even if we tried to read locale without setting it first\r\n\t\t\t\treturn _setlocale($category, $CURRENTLOCALE);\r\n\t\t} else {\r\n\t\t\tif (function_exists('setlocale')) {\r\n\t\t\t\t$ret = setlocale($category, $locale);\r\n\t\t\t\tif (($locale == '' and !$ret) or // failed setting it by env\r\n\t\t\t\t\t($locale != '' and $ret != $locale)) { // failed setting it\r\n\t\t\t\t\t// Failed setting it according to environment.\r\n\t\t\t\t\t$CURRENTLOCALE = _get_default_locale($locale);\r\n\t\t\t\t\t$EMULATEGETTEXT = 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$CURRENTLOCALE = $ret;\r\n\t\t\t\t\t$EMULATEGETTEXT = 0;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// No function setlocale(), emulate it all.\r\n\t\t\t\t$CURRENTLOCALE = _get_default_locale($locale);\r\n\t\t\t\t$EMULATEGETTEXT = 1;\r\n\t\t\t}\r\n\t\t\t// Allow locale to be changed on the go for one translation domain.\r\n\t\t\tglobal $text_domains, $default_domain;\r\n\t\t\tif (array_key_exists($default_domain, $text_domains)) {\r\n\t\t\t\tunset($text_domains[$default_domain]->l10n);\r\n\t\t\t}\r\n\t\t\treturn $CURRENTLOCALE;\r\n\t\t}\r\n\t}", "public function displayCorrectLocale()\n {\n $message = new CustomerMessage('de_DE');\n $this->assertEquals('de_DE', $message->getLocale());\n }", "abstract public function getLocaleName();", "function getRespectSysLanguage() ;", "public function index()\n {\n return Session::get('app.locale');\n }", "public function testLocale()\n {\n $f = new Formatter(['locale' => 'en-US']);\n $this->assertEquals('en-US', $f->locale);\n\n // if not, take from application\n $f = new Formatter();\n $this->assertEquals('ru-RU', $f->locale);\n }", "public function getCurrentOrDefaultLocale();", "public static function isLocalized(): bool\n {\n return false;\n }", "public static function enabled() {\n\t\treturn extension_loaded('intl');\n\t}", "public function isAvailable($locale) {\n\t\treturn true;\n\t}", "protected function requestHasLocale()\n {\n try {\n if ($this->locale($this->request)) {\n return true;\n }\n\n return false;\n } catch (Exception $ex) {\n return false;\n }\n }", "public function testLanguageConsistency(): void\n\t{\n\t\tstatic::assertEquals('en', app()->getLocale());\n\t\tstatic::assertEquals('OK', __('lychee.SUCCESS'));\n\n\t\t$msgSection = (new ConsoleOutput())->section();\n\n\t\t$englishDictionary = include base_path('lang/en/lychee.php');\n\t\t$availableDictionaries = config('app.supported_locale');\n\t\t$failed = false;\n\n\t\tforeach ($availableDictionaries as $locale) {\n\t\t\t$dictionary = include base_path('lang/' . $locale . '/lychee.php');\n\t\t\t$missingKeys = array_diff_key($englishDictionary, $dictionary);\n\t\t\tforeach ($missingKeys as $key => $value) {\n\t\t\t\t$msgSection->writeln(sprintf('<comment>Error:</comment> Locale %s misses the following key: %s', str_pad($locale, 8), $key));\n\t\t\t\t$failed = true;\n\t\t\t}\n\n\t\t\t$extraKeys = array_diff_key($dictionary, $englishDictionary);\n\t\t\tforeach ($extraKeys as $key => $value) {\n\t\t\t\t$msgSection->writeln(sprintf('<comment>Error:</comment> Locale %s has the following extra key: %s', str_pad($locale, 8), $key));\n\t\t\t\t$failed = true;\n\t\t\t}\n\t\t}\n\t\tstatic::assertFalse($failed);\n\t}", "public function localeIndex();", "public function testRenderWithNonDefaultLocale()\n {\n $result = $this->render();\n $this->assertMatchesRegularExpression('/<span>Nordamerikanische Westküsten-Normalzeit/', $result);\n }", "abstract public function getLocaleCode();", "protected function getTranslationLocales()\n {\n foreach (Config::get('translation.locales') as $locale) {\n if ($locale != Config::get('translation.locale'))\n $this->locales[] = $locale;\n }\n }", "public function getDefaultLocale();", "public function testRenderWithDefaultLocale()\n {\n $result = $this->render();\n $this->assertMatchesRegularExpression('/<span>Pacific Standard Time/', $result);\n }", "function final_status_hook() {\n\t$missing = '';\n\tif (isset($_SESSION['exp_missing_titles']) and is_array($_SESSION['exp_missing_titles'])) {\n\t\tforeach ($_SESSION['exp_missing_titles'] as $title => $is_missing) {\n\t\t\tif (!$is_missing)\n\t\t\t\tcontinue;\n\n\t\t\t$missing .= '<li>“' . $title . \"”</li>\\n\";\n\t\t}\n\t}\n\n\tif ($missing)\n\t\treturn <<<EOM\nThe following document titles were not translated in every language.<br/>\nThey may be untranslatable:\n<ul>\n$missing</ul>\nEOM;\n\n\treturn '';\n}", "public function renderLocale(): string\n {\n return call_user_func_array([$this, 'render'], func_get_args());\n }", "abstract protected function initializeCulture();", "public function getActiveLocales($locale = null)\n {\n $registeredLocales = $this->registry->getRegisteredLocales();\n\n if (empty($registeredLocales)) {\n return [];\n }\n elseif ($locale === null) {\n $translatedLocales = $registeredLocales;\n }\n else {\n if (strpos($locale, '_') > 0) {\n $displayCountryLocales = Intl::getLocaleBundle()->getLocaleNames($locale);\n $displayLgLocales = Intl::getLocaleBundle()->getLocaleNames(substr($locale, 0, strpos($locale, '_')));\n $displayLocales = array_merge($displayLgLocales, $displayCountryLocales);\n } else {\n $displayLocales = Intl::getLocaleBundle()->getLocaleNames($locale);\n }\n\n // time to return a translated locale\n $translatedLocales = array_map(\n function($element) use($displayLocales, $locale)\n {\n if (array_key_exists($element, $displayLocales)) {\n // perfect, we have the full translated locale\n return $displayLocales[$element];\n } elseif (strpos($element, '_') > 0) {\n // ow we don't, let's see if it's a locale containing the country\n list($lg, $country) = explode('_', $element);\n\n if (strpos($locale, '_') > 0) {\n // Yep! it's a full locale. Let's merge the translated countries for the full locale + his parent, the lg\n $displayCountriesChild = Intl::getRegionBundle()->getCountryNames($locale);\n $displayCountriesParent = Intl::getRegionBundle()->getCountryNames(substr($locale, 0, strpos($locale, '_')));\n $displayCountries = array_merge($displayCountriesParent, $displayCountriesChild);\n } else {\n // it's just a lg\n $displayCountries = Intl::getRegionBundle()->getCountryNames($locale);\n }\n\n if (array_key_exists($country, $displayCountries)) {\n // ok we do have a country translation, let's manually build the full translation string\n $displayCountry = $displayCountries[$country];\n $displayLg = Intl::getLanguageBundle()->getLanguageName($lg, null, $locale);\n\n return $displayLg . ' (' . $displayCountry . ')';\n } else {\n // I give up. I just return the received locale.\n return $element;\n }\n } else {\n return $element;\n }\n }, $registeredLocales\n );\n }\n return array_combine($registeredLocales, $translatedLocales);\n }", "public function hasSimpleLocales(): bool\n {\n return is_numeric(key($this->getSupportedLocales()));\n }", "public function getLocale(): ?string;", "public function getLocale(): ?string;", "function wp_get_available_translations()\n {\n }", "function getDefaultLocalesOrder();", "function yourls_l10n_months(){\n\tglobal $yourls_locale_formats;\n\tif( !isset( $yourls_locale_formats ) )\n\t\t$yourls_locale_formats = new YOURLS_Locale_Formats();\n\n\treturn $yourls_locale_formats->month;\n}", "public function getLocale()\n {\n return 'en';\n }", "public static function getLocale(){\n return \\Illuminate\\Foundation\\Application::getLocale();\n }", "protected function loadLocale(): Collection\n {\n $cacheKey = 'laravel-i18n-locale-'.$this->getConfig('driver');\n $duration = $this->getConfig('cache_duration', 86400);\n $ttl = Carbon::now()->addSeconds($duration);\n\n if (!$this->getConfig('enable_cache')) {\n return app(RepositoryManager::class)->collect();\n }\n\n return \\Cache::remember($cacheKey, $ttl, function () {\n return app(RepositoryManager::class)->collect();\n });\n }", "protected function getSupportedLocales()\n {\n return Blog::getSupportedLocalesKeys();\n }", "public function isTranslated();", "function wp_just_in_time_script_localization()\n {\n }", "function default_locale()\n{\n return Config::getDefaultLocale();\n}", "function _readDefaultLocaleInfo() {\n// $row = $this->select01($sql);\n// if (!$row) {\n// return false;\n// }\n $sql = $this->mkSQL('SELECT * FROM %I WHERE default_flg = \"Y\"', $this->tablePrfx.'lang');\n return $this->select01($sql);\n }", "public function getSystemStatus() {}", "public static function locale() : string\n {\n // Compute the locale just one time\n if (self::$locale) {\n return self::$locale;\n }\n\n // Lang in cookies\n $locale = self::langToLocale($_COOKIE['NameYourGoat_User_Locale'] ?? '');\n\n // Lang in User repository\n if (! $locale && self::isAuth()) {\n $locale = self::langToLocale(self::$fullUser->lang);\n }\n\n // Lang in the request headers\n if (! $locale) {\n $acceptLang = explode(',', getallheaders()['Accept-Language'] ?? '');\n\n foreach ($acceptLang as $lang) {\n if ($locale = self::langToLocale(trim(strtok($lang, '-;')))) {\n break;\n }\n }\n }\n\n return self::$locale = $locale ?: self::$defaultLocale;\n }", "function _s( $name ) {\n global $FlubberLocale;\n return $FlubberLocale->get($name);\n}", "protected function _getLanguageForLocale()\n {\n $locale = $this->worldpayhelper->getLocaleDefault();\n if (substr($locale, 3, 2) == 'NO') {\n return 'no';\n }\n return substr($locale, 0, 2);\n }", "public function incLocalLang() {}", "public function testConfigLocale()\n {\n\n $this->assertTrue(Config::setLocale('RU'));\n $this->assertTrue(Config::setLocale('US'));\n $this->assertTrue(Config::setLocale('TR'));\n $this->assertTrue(Config::setLocale('UA'));\n $this->assertTrue(Config::setLocale('EN'));\n $this->assertTrue(Config::setLocale('BY'));\n\n $this->assertFalse(Config::setLocale('BU'));\n $this->assertFalse(Config::setLocale('FR'));\n $this->assertFalse(Config::setLocale('DE'));\n $this->assertFalse(Config::setLocale('IT'));\n $this->assertFalse(Config::setLocale('SP'));\n $this->assertFalse(Config::setLocale('CZ'));\n\n }", "protected function projectHasActiveLocales()\n {\n return Strata::i18n()->hasActiveLocales();\n }", "public function getTargetLocale();", "function get_locale(): string\n{\n $locale = \\Locale::acceptFromHttp(input_server('HTTP_ACCEPT_LANGUAGE'));\n if (!$locale) {\n $locale = 'en_US';\n }\n return $locale;\n}", "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}", "function multilingual(): bool\n {\n return count(supportedLocaleKeys()) > 1;\n }", "function carbonLocale(\\Carbon\\Carbon $object, $format = '%A %d %B %Y') {\r\n return $object->formatLocalized($format);\r\n}", "public function resolveLocale(Request $request);", "public function onNotMatched(AgaviExecutionContainer $container)\n\t{\n\t\t$cookie = $this->context->getRequest()->getRequestData()->getCookie('locale');\n\t\tif($cookie !== null) {\n\t\t\ttry {\n\t\t\t\t$this->translationManager->setLocale($cookie);\n\t\t\t} catch(AgaviException $e) {\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "protected function getLocale()\n {\n @session_start();\n return isset($_SESSION['varaa_locale'])\n ? $_SESSION['varaa_locale']\n : $this->config('app.locale');\n }", "public function getLocale()\n {\n return setlocale(LC_ALL, 0);\n }", "function initialize_i18n() {\n\t\n\t$locale \t\t\t\t\t= get_locale();\n\t#error_log( \"got locale: $locale\" );\n\t\n\tif( ! preg_match( '/_/', $locale ) ) {\n\t\t\n\t\t$locale\t\t\t\t\t= $locale.\"_\".strtoupper($locale);\n\t\t#error_log( \"set locale to: $locale\" );\n\t}\n\t\n\tputenv(\"LANG=$locale\");\n\tputenv(\"LC_ALL=$locale\");\n\tsetlocale(LC_ALL, 0);\n\tsetlocale(LC_ALL, $locale);\n\t\n\tif ( file_exists ( realpath ( \"./locale/de/LC_MESSAGES/messages.mo\" ) ) ) {\n\t\t\n\t\t$localepath\t\t\t\t= \"./locale\";\n\t\t\n\t} elseif( file_exists( realpath( \"../locale/de/LC_MESSAGES/messages.mo\" ) ) ) {\n\t\t\n\t\t$localepath\t\t\t\t= \"../locale\";\n\t\t\n\t} else {\n\t\t\n\t\t$localepath\t\t\t\t= \"./locale\";\n\t\t\n\t}\n\t\n\t$dom\t\t\t\t\t\t= bindtextdomain(\"messages\", $localepath);\n\t$msgdom \t\t\t\t\t= textdomain(\"messages\");\n\t\n\tbind_textdomain_codeset(\"messages\", 'UTF-8');\n\n}", "public function restore_current_locale() {\n\t\tif ( empty( $this->locales ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->locales = array( $this->original_locale );\n\n\t\treturn $this->restore_previous_locale();\n\t}" ]
[ "0.6458566", "0.63965636", "0.607257", "0.60666406", "0.60588163", "0.5890866", "0.5866438", "0.57560855", "0.57560855", "0.57422584", "0.5723545", "0.56953174", "0.56825525", "0.5645122", "0.56193477", "0.5550373", "0.5489302", "0.5489302", "0.5489302", "0.5460768", "0.54372513", "0.5431897", "0.54192615", "0.540474", "0.5378814", "0.53772986", "0.5372408", "0.5370708", "0.5340542", "0.53361595", "0.53004944", "0.5294311", "0.528839", "0.52670795", "0.5247477", "0.5233057", "0.5229732", "0.5228086", "0.5226635", "0.5221039", "0.5220667", "0.52201766", "0.5213758", "0.52050185", "0.5199939", "0.5198536", "0.5188495", "0.5181103", "0.51778996", "0.5174426", "0.5174321", "0.513668", "0.51316726", "0.51277745", "0.5118258", "0.51124835", "0.50768614", "0.5062491", "0.50542593", "0.50533074", "0.5048269", "0.50376415", "0.5027033", "0.5019851", "0.50105184", "0.50096685", "0.50064695", "0.5005784", "0.4998109", "0.49941042", "0.49941042", "0.49928495", "0.49903995", "0.49634016", "0.49557257", "0.49516082", "0.49163702", "0.49121827", "0.49039218", "0.48981753", "0.4891858", "0.48898834", "0.48888707", "0.4882974", "0.4876145", "0.48760632", "0.48746356", "0.4871387", "0.48696738", "0.48682716", "0.4867348", "0.48654267", "0.48651755", "0.48592752", "0.48576546", "0.4854284", "0.48497742", "0.48474264", "0.48472315", "0.48317224" ]
0.6047243
5
If set, render this module's review view and shove the result into the appropriate slot.
public function renderReviewSection() { if (empty($this->review_view_name)) return; slot::append( 'BYOB.repack.edit.review.sections', View::factory($this->review_view_name, Event::$data) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reviewformAction()\r\n {\r\n if (!$this->config->isPhaseOpen(Config::REVIEWING_PHASE)) {\r\n $this->view->content = $this->texts->reviewer->review_phase_is_closed;\r\n echo $this->view->render(\"layout\");\r\n return;\r\n }\r\n\r\n\r\n $reviewTbl = new Review();\r\n $this->view->setFile(\"content\", \"reviewform.xml\");\r\n $this->view->setBlock(\"content\", \"SECTION\", \"SECTIONS\");\r\n\r\n\r\n // Extract the blocks from the template\r\n $this->view->setFile(\"review\", \"form_review.xml\");\r\n $this->view->setBlock (\"review\", \"review_mark\", \"review_marks\");\r\n $this->view->setBlock (\"review\", \"review_answer\", \"review_answers\");\r\n\r\n $this->view->selected1 = $this->view->selected2 = $this->view->selected3 = \"\";\r\n\r\n // Actions if the id of a paper is submitted\r\n if (isSet($_REQUEST['id_paper'])) {\r\n $idPaper = $this->getRequest()->getParam(\"id_paper\");\r\n $review = $reviewTbl->find($idPaper, $this->user->id)->current();\r\n\r\n // Check that the paper is REALLY assigned to the reviewer\r\n if (is_object($review)) {\r\n $this->view->review_form = $review->showReview($this->view, false);\r\n }\r\n else {\r\n $this->view->content = \"You do not have access to this paper!<br/>\";\r\n }\r\n }\r\n else {\r\n $this->view->content = \"Invalid action<br/>\";\r\n }\r\n \r\n echo $this->view->render(\"layout\");\r\n }", "function processreviewAction()\r\n {\r\n if (!$this->config->isPhaseOpen(Config::REVIEWING_PHASE)) {\r\n $this->view->content = $this->texts->reviewer->review_phase_is_closed;\r\n echo $this->view->render(\"layout\");\r\n return;\r\n }\r\n\r\n $this->view->setFile(\"content\", \"processreview.xml\");\r\n $this->view->setBlock(\"content\", \"review\");\r\n // Extract the block with marks.\r\n $this->view->set_block('review', \"review_mark\", \"review_marks\");\r\n // Extracts the block with answers\r\n $this->view->set_block('review', \"review_answer\", \"review_answers\");\r\n\r\n\r\n // Actions if the id of a paper is submitted\r\n if (isSet($_REQUEST['idPaper'])) {\r\n $idPaper = $this->getRequest()->getParam(\"idPaper\");\r\n $reviewTbl = new Review();\r\n $review = $reviewTbl->find($idPaper, $this->user->id)->current();\r\n\r\n // Check that the paper is REALLY assigned to the reviewer\r\n if (is_object($review)) {\r\n\r\n // Put the review in the database\r\n $review->updateFromArray ($_POST);\r\n\r\n // Create the review presentation\r\n $this->view->review = $review->showReview($this->view, true) ;\r\n // Resolve the entities replacement\r\n $this->view->assign(\"content\", \"content\");\r\n \r\n // Send a mail to confirm review submission\r\n $mail = new Mail (Mail::SOME_USER, $this->texts->mail->subj_ack_review,\r\n $this->view->getScriptPaths());\r\n $mail->setFormat(Mail::FORMAT_HTML);\r\n $mail->setTo($this->user->email);\r\n\r\n $mail->loadTemplate ($this->lang, \"ack_review\");\r\n $mailViewEngine = $mail->getEngine();\r\n $mailViewEngine->setBlock(\"template\", \"template_mark\", \"template_marks\");\r\n $mailViewEngine->setBlock(\"template\", \"template_answer\", \"template_answers\");\r\n\r\n $instantiatedMail = $review->showReview($mailViewEngine, true, \"template\");\r\n $mail->setTemplate ($instantiatedMail);\r\n if ($this->config->mailOnReview == \"Y\") {\r\n $mail->setCopyToChair(true);\r\n }\r\n\r\n $mail->send();\r\n }\r\n else {\r\n $this->view->content = $this->texts->def->access_denied;;\r\n }\r\n }\r\n else {\r\n $this->view->content = \"Invalid action<br/>\";\r\n }\r\n echo $this->view->render(\"layout\");\r\n }", "public function view(Review $review);", "protected function _getReviewHtml(){\n\t\tMage::app()->getCacheInstance()->cleanType('layout');\n\n\t\t$layout = $this->getLayout();\n\t\t$update = $layout->getUpdate();\n\t\t$update->load('checkout_onepage_review');\n\t\t$layout->generateXml();\n\t\t$layout->generateBlocks();\n\t\t$review = $layout->getBlock('root');\n\t\t$review->setTemplate('opc/onepage/review/info.phtml');\n\t\t\n\t\treturn $review->toHtml();\n\t}", "public function review()\n {\n return view('review');\n }", "public function show(Review $review)\n {\n //\n }", "public function show(Review $review)\n {\n //\n }", "public function show(Review $review)\n {\n //\n }", "public function show(Review $review)\n {\n //\n }", "protected function _getReviewHtml()\n\t{\n\t\t$layout = $this->getLayout();\n\t\t$update = $layout->getUpdate();\n\t\t$update->load('checkout_onestep_review');\n\t\t$layout->generateXml();\n\t\t$layout->generateBlocks();\n\t\t$output = $layout->getOutput();\n\t\tMage::getSingleton('core/translate_inline')->processResponseBody($output);\n\t\treturn $output;\n\t}", "public function indexAction() {\n if (!Engine_Api::_()->core()->hasSubject('sitereview_listing') && !Engine_Api::_()->core()->hasSubject('sitereview_review')) {\n return $this->setNoRender();\n }\n\n if (Engine_Api::_()->core()->hasSubject('sitereview_listing')) {\n $this->view->sitereview = $sitereview = Engine_Api::_()->core()->getSubject();\n } elseif (Engine_Api::_()->core()->hasSubject('sitereview_review')) {\n $this->view->sitereview = $sitereview = Engine_Api::_()->core()->getSubject()->getParent();\n }\n\n //GET SUBJECT\n $this->view->sitereview = $sitereview = Engine_Api::_()->core()->getSubject();\n\n $this->view->viewType = $this->_getParam('viewType', 0);\n $this->view->statistics = $this->_getParam('statistics', array(\"likeCount\", \"reviewCount\", \"commentCount\"));\n Engine_Api::_()->sitereview()->setListingTypeInRegistry($sitereview->listingtype_id);\n $listingtypeArray = Zend_Registry::get('listingtypeArray' . $sitereview->listingtype_id);\n\n //SEND REVIEW TITLE TO TPL\n $this->view->reviewTitleSingular = $listingtypeArray->review_title_singular ? $listingtypeArray->review_title_singular : 'Review';\n $this->view->reviewTitlePlular = $listingtypeArray->review_title_plural ? $listingtypeArray->review_title_plural : 'Reviews';\n \n if (!empty($this->view->statistics) && empty($listingtypeArray->reviews) || $listingtypeArray->reviews == 1) {\n $key = array_search('reviewCount', $this->view->statistics);\n if (!empty($key)) {\n unset($this->view->statistics[$key]);\n }\n }\n\n $values = array();\n $values['listing_id'] = $sitereview->listing_id;\n $this->view->count = $limit = $values['limit'] = $this->_getParam('itemCount', 3);\n $values['similar_items_order'] = 1;\n $this->view->title_truncation = $this->_getParam('truncation', 24);\n $values['ratingType'] = $this->view->ratingType = $this->_getParam('ratingType', 'rating_avg');\n $listingTable = Engine_Api::_()->getDbTable('listings', 'sitereview');\n\n $similar_items = Engine_Api::_()->getDbTable('otherinfo', 'sitereview')->getColumnValue($sitereview->listing_id, 'similar_items');\n $similarItems = array();\n if (!empty($similar_items)) {\n $similarItems = Zend_Json_Decoder::decode($similar_items);\n }\n\n $showSameCategoryListings = $this->_getParam('showSameCategoryListings', 1);\n \n if (!empty($similar_items) && !empty($similarItems) && Count($similarItems) >= 0) {\n $values['similarItems'] = $similarItems;\n $this->view->listings = $listingTable->getListing('', $values);\n } else {\n \n if(!$showSameCategoryListings) {\n return $this->setNoRender();\n } \n \n $values['listingtype_id'] = $sitereview->listingtype_id;\n\n if ($sitereview->subsubcategory_id) {\n $values['subsubcategory_id'] = $sitereview->subsubcategory_id;\n } elseif ($sitereview->subcategory_id) {\n $values['subcategory_id'] = $sitereview->subcategory_id;\n } elseif ($sitereview->category_id) {\n $values['category_id'] = $sitereview->category_id;\n } else {\n return $this->setNoRender();\n }\n\n $this->view->listings = $listingTable->getListing('', $values);\n }\n\n if (Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_childCount = count($this->view->listings);\n } else {\n $this->view->listings->setCurrentPageNumber($this->_getParam('page'));\n $this->view->listings->setItemCountPerPage($limit);\n $this->_childCount = $this->view->listings->getTotalItemCount();\n }\n\n if ($this->_childCount <= 0) {\n return $this->setNoRender();\n }\n\n $this->view->columnWidth = $this->_getParam('columnWidth', '180');\n $this->view->columnHeight = $this->_getParam('columnHeight', '328');\n }", "protected function _beforeToHtml()\n {\n if (!$this->isReviewsEnabled()) {\n $this->setTemplate('');\n return parent::_beforeToHtml();\n }\n\n if (!$this->_setReviews()) {\n $this->setTemplate('');\n return parent::_beforeToHtml();\n }\n\n return parent::_beforeToHtml();\n }", "public function renderView(){ \n if ($this->hlp->sess(\"listing\")->render){\n $this->template->renderBuyForm = TRUE;\n }\n }", "public function viewAction()\n {\n // Procesar cambio de estados\n if ($this->getRequest()->isXmlHttpRequest()) {\n return $this->forward()->dispatch('Registry\\Controller\\Review', array('action' => 'view-ajax'));\n }\n\n $registry = $this->getRegistry();\n if (!$registry) {\n $this->fm(_('La rendicion solicitada no pudo ser encontrada'), 'error');\n return $this->redirect()->toRoute('review', array('action' => 'index'));\n }\n\n $formManager = $this->getServiceLocator()->get('FormElementManager');\n $form = $formManager->get('Registry\\Form\\Confirm', array('element' => $registry->getId()));\n\n $url = $this->url()->fromRoute('review/default', array('action' => 'view'), array('query' => array('id' => $registry->getId())));\n $prg = $this->prg($url, true);\n if ($prg instanceof \\Zend\\Http\\PhpEnvironment\\Response) {\n return $prg;\n } elseif (is_array($prg)) {\n // Validar formulario\n $form->setData($prg);\n if (!$form->isValid()) {\n $this->fm(_('No se ha podido cerrar la rendicion'), 'error');\n $helper = $this->getServiceLocator()->get('viewhelpermanager')->get('htmlList');\n $this->fm($helper($form->getMessages()), 'error');\n\n return $this->redirect()->toRoute('review');\n }\n\n if ($prg['task'] === 'reopen') {\n return $this->reopen($registry);\n } else {\n return $this->close($registry);\n }\n }\n\n $commentsForm = $formManager->get('Registry\\Form\\Comment');\n $commentsForm->setAttribute(\n 'action',\n $this->url()->fromRoute(\n 'review/comment',\n array('action' => 'comment'),\n array('query' => array('id' => $registry->getId()))\n )\n );\n\n return array(\n 'form' => $form,\n 'registry' => $registry,\n 'commentform' => $commentsForm,\n );\n }", "public function review()\n {\n return view('company.review');\n }", "public function display() {\n\n\t\t// Include our views row.\n\t\t$this->views();\n\n\t\t// Handle our search output.\n\t\t$this->search_box( __( 'Search Reviews', 'woo-better-reviews' ), 'reviews' );\n\n\t\t// Wrap the display in a form.\n\t\techo '<form class=\"woo-better-reviews-admin-form\" id=\"woo-better-reviews-admin-reviews-form\" method=\"post\">';\n\n\t\t\t// Add a nonce for the bulk action.\n\t\t\twp_nonce_field( 'wbr_list_reviews_action', 'wbr_list_reviews_nonce' );\n\n\t\t\t// And the parent display (which is most of it).\n\t\t\tparent::display();\n\n\t\t// Close up the form.\n\t\techo '</form>';\n\t}", "public function actionReview($id)\n {\n $model = $this->findModel($id);\n\n if('in-review' == $model->status){\n /* no changing of reviewer permitted when module is in-review */\n $enquirySpecialistsList[\"$model->reviewer_id\"] = User::findOne($model->reviewer_id)['name'];\n } else { \n /* get (id,name) as (key,value) array/list of enquiry specialists */\n $subQuery = AuthAssignment::find()->where((['item_name' => 'enquiryspecialist']))->all();\n $subQuery = ArrayHelper::map($subQuery,'user_id','user_id');\n $mainQuery = User::find()->where(['in', 'id', $subQuery])->all();\n $enquirySpecialistsList = ArrayHelper::map($mainQuery, 'id', 'name' ); \n } \n $model->enquirySpecialistsList = $enquirySpecialistsList; \n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->status = 'in-review';\n if($model->owner_id == Yii::$app->user->getId()){\n /* meaning review is submitted by module owner. So review_status has to be 'in-review'*/\n $model->review_status = 'in-review'; \n } \n\n if( ($model->reviewer_id == Yii::$app->user->getId()) and ('approved' == $model->review_status)){\n /* review is approved so ALSO change model status to approved (along with review status).*/\n $model->status = 'approved';\n } \n\n /* adding review comment to review_comment model */\n $modelComment = new ReviewComment();\n $modelComment->commenter_id = Yii::$app->user->getId();\n $modelComment->module_id = $model->id;\n $modelComment->comment = $model->reviewComment;\n $modelComment->review_status_before = $model->review_status;\n $modelComment->review_status_after = $model->review_status;\n $modelComment->save();\n\n $model->save(); \n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('review', [\n 'model' => $model,\n ]);\n }\n }", "public function actionReview(){\r\n $user = $_REQUEST['pro'];\r\n $list = MvCouiManager::getReview($user);\r\n $aclist = MvCouiManager::getAcreview($user);\r\n $nolist = MvCouiManager::getNoreview($user);\r\n $dellist = MvCouiManager::getDelreview();\r\n $this->render('review',array('list'=>$list,'aclist'=>$aclist,'nolist'=>$nolist,'dellist'=>$dellist));\r\n }", "abstract protected function renderView();", "function paperAction()\r\n {\r\n if (!$this->config->isPhaseOpen(Config::REVIEWING_PHASE)) {\r\n $this->view->content = $this->texts->reviewer->review_phase_is_closed;\r\n echo $this->view->render(\"layout\");\r\n return;\r\n }\r\n\r\n $reviewTbl = new Review();\r\n $paperTbl = new Paper();\r\n $messageTbl = new Message ();\r\n\r\n $this->view->setFile (\"content\", \"paper.xml\");\r\n $this->view->setBlock (\"content\", \"paper_status_link\");\r\n $this->view->setBlock (\"content\", \"message\", \"messages\");\r\n $this->view->setBlock(\"content\", \"review\", \"show_review\");\r\n $this->view->setBlock(\"review\", \"review_mark\", \"review_marks\");\r\n $this->view->setBlock(\"review\", \"review_answer\", \"review_answers\");\r\n $this->view->initial_message = \"\";\r\n\r\n // Am I an admin? If yes I want a link to the paper status page\r\n if (!$this->user->isAdmin()) {\r\n $this->view->paper_status_link =\"\";\r\n }\r\n\r\n $texts = $this->zmax_context->texts;\r\n\r\n if (isSet($_REQUEST['id_paper']) and $this->config->discussion_mode != Config::NO_DISCUSSION) {\r\n $idPaper = $this->getRequest()->getParam(\"id_paper\");\r\n $review = $reviewTbl->find($idPaper, $this->user->id)->current();\r\n $paper = $paperTbl->find($idPaper)->current();\r\n $paper->putInView($this->view);\r\n\r\n // Check that the paper is REALLY assigned to the reviewer (or admin)\r\n if (is_object($review) or $this->user->isAdmin()) {\r\n\r\n // Show all other SUBMITTED reviews, do not propose to see only my review\r\n $this->view->show_review = \"\";\r\n $reviews = $paper->findReview();\r\n foreach ($reviews as $otherReview) {\r\n if (!empty($otherReview->overall)) {\r\n $this->view->show_review .= $otherReview->showReview($this->view);\r\n }\r\n }\r\n\r\n // Message submitted ? Store it in the DB\r\n if (isSet($_REQUEST['form_message'])) {\r\n $message = $messageTbl->createRow();\r\n $message->id_parent = $this->getRequest()->getParam(\"id_parent\");\r\n $message->id_user = $this->user->id;\r\n $message->id_paper =$this->getRequest()->getParam(\"id_paper\");\r\n $message->message = htmlSpecialChars($this->getRequest()->getParam(\"message\"), ENT_NOQUOTES);\r\n $message->date = date(\"Y-m-d H-i-s\");\r\n $message->save();\r\n\r\n // And now, we must send the message to the reviewers and to the PC chair.\r\n $mail = new Mail (Mail::SOME_USER,\r\n $this->texts->mail->subj_new_message . \" \" . $paper->id,\r\n $this->view->getScriptPaths());\r\n $mail->loadTemplate ($this->lang, \"new_message\");\r\n $mail->setFormat(Mail::FORMAT_HTML);\r\n $mail->getEngine()->base_url = $this->view->base_url;\r\n $mail->getEngine()->author_first_name = $this->user->first_name;\r\n $mail->getEngine()->author_last_name = $this->user->last_name;\r\n $paper->putInView ($mail->getEngine());\r\n $message->putInView($mail->getEngine());\r\n\r\n // Send the message to the PC chair.\r\n $fakeName = \"User\" . \"->first_name\";\r\n $mail->getEngine()->setVar($fakeName, $this->config->chair_names);\r\n $mail->setTo ($this->config->chairMail);\r\n $mail->send();\r\n\r\n // Now, mail to each OTHER reviewer\r\n $reviews = $paper->findReview();\r\n $mailOthers = $comma = \"\";\r\n foreach ($reviews as $review) {\r\n if ($review->id_user != $this->user->id) {\r\n $reviewer = $review->findParentUser();\r\n $reviewer->putInView($mail->getEngine());\r\n $mail->setTo ($reviewer->email);\r\n $mail->send();\r\n }\r\n }\r\n }\r\n\r\n // Show the tree of messages\r\n $this->view->messages = Message::display($paper->id, 0, $this->view);\r\n }\r\n else {\r\n $this->view->content = \"You do not have access to this paper!<br/>\";\r\n }\r\n }\r\n else {\r\n $this->view->content = \"Invalid action<br/>\";\r\n }\r\n\r\n \r\n echo $this->view->render(\"layout\");\r\n }", "public function actionView()\n\t{ \n $id=isset($_GET['id']) ? (int) ($_GET['id']) : 0 ;\n $this->menu=array_merge($this->menu, \n array(\n array('label'=>t('Update this Review'), 'url'=>array('update','id'=>$id),'linkOptions'=>array('class'=>'btn btn-mini'))\n )\n );\n\t\t$this->render('review_view');\n\t}", "public function indexAction()\n {\n $viewer = Engine_Api::_()->user()->getViewer();\n\n $params = array(\n 'featured' => 1,\n 'order' => 'random'\n );\n \n $this->view->review = Engine_Api::_()->getDbtable('reviews', 'review')->getReview($params);\n \n if (!$this->view->review) {\n return $this->setNoRender();\n }\n \n }", "public function view() : void\n {\n $this->PAGE_TITLE = \"Product rating\";\n }", "public function display()\n \t{\n \t\t$this->assign(\"__view\", $this->_view);\n \t\tparent::display();\n \t}", "public function render_view_mode()\n {\n }", "public function review()\n\t{\n\t\t\n\t\t$this->templateFileName = 'review.tpl';\n\t\t\n\t\t// Get the cart data, shipping address, billing address, and payment method records for display.\n\t\t\n\t\t$cart_items = $this->dbConnection->prepareRecordSet( \"SELECT * FROM b_cart_item ci INNER JOIN b_item i ON ci.item_id = i.item_id WHERE cart_id = ?\", $this->session->cartID );\n\t\t$shipping_address = $this->dbConnection->prepareRecord(\"SELECT * FROM b_user_address WHERE address_id = ?\", $this->session->shippingAddressID);\n\t\t$billing_address = $this->dbConnection->prepareRecord(\"SELECT * FROM b_user_address WHERE address_id = ?\", $this->session->billingAddressID);\n\t\t$payment_method = $this->dbConnection->prepareRecord(\"SELECT payment_id, payment_type, credit_card_type, payment_name, RIGHT(account_number, 4) AS account_number_last_4, LPAD(RIGHT(account_number, 4), LENGTH(account_number), 'X') AS account_number, card_expiration_month, card_expiration_year, rp.description AS payment_type_description, rc.description AS credit_card_type_description FROM b_payment INNER JOIN b_reference rp ON rp.data_member = 'PAYMENT_TYPE' AND rp.data_value = payment_type LEFT OUTER JOIN b_reference rc ON rc.data_member = 'CREDIT_CARD_TYPE' AND rc.data_value = credit_card_type WHERE payment_id = ?\", $this->session->paymentMethodID);\n\n\t\t\n\t\t// Calculate the subtotal\n\t\t$cartCount = count($cart_items);\n\t\tfor($i=0; $i<$cartCount; $i++)\n\t\t{\n\t\t\t$item_extended_price = ($cart_items[$i]['quantity'] * $cart_items[$i]['price']);\n\t\t\t$cart_items[$i]['ext_price'] = $item_extended_price;\n\t\t\t$subtotal += $item_extended_price;\n\t\t}\n\t\t\n\t\t\n\t\t// Calculate the tax for the order\n\t\t$tax = $this->calculateTax( $this->session->shippingAddressID , $subtotal );\n\t\t\n\t\t// Calculate the shipping rate for the order\n\t\t$shipping_rate = $this->calculateShipping();\n\t\t\n\t\t$total = $subtotal + $shipping_rate + $tax;\n\t\t\n\t\t// Set output data\n\t\t$this->set('cart_items', $cart_items);\n\t\t$this->set('shipping_address', $shipping_address);\n\t\t$this->set('billing_address', $billing_address);\n\t\t$this->set('payment_method', $payment_method);\n\t\t\n\t\t$this->set('subtotal', $subtotal);\n\t\t$this->set('tax', $tax);\n\t\t$this->set('shipping_rate', $shipping_rate);\n\t\t$this->set('total', $total);\n\t\t\n\t\t\n\t\t\n\t\t// If the user clicked the submit button, then process the order\n\t\tif ( count($_POST) > 0 && isset($_POST['review_submit']) )\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\t$errors = [];\n\t\t\t\n\t\t\t\n\t\t\t// Process the payment first\n\t\t\tif (!$this->processPayment( $this->session->paymentMethodID, $total ))\n\t\t\t{\n\t\t\t\t// Uh oh, there was an error processing the payment\n\t\t\t\t$errors[] = 'Error processing payment. Please try again.';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\n\t\t\t\t// The payment has been processed correctly.\n\t\t\t\t\n\t\t\t\t// Create the order record\n\t\t\t\t$this->dbConnection->begin_transaction();\n\n\t\t\t\t$orderInsertSQL = \"INSERT INTO b_order ( order_timestamp, user_id, shipping_address_id, billing_address_id, order_status, cart_id, subtotal, tax, shipping, total, payment_id )\"\n\t\t\t\t\t\t\t\t\t\t. \" VALUES( CURRENT_TIMESTAMP(), ?, ?, ?, 'P', ?, ?, ?, ?, ?, ?)\";\n\t\t\t\t$orderLineInsertSQL = \"INSERT INTO b_order_item (order_id, item_id, item_sequence, quantity, price, extended_price, line_status)\"\n\t\t\t\t\t\t . \" VALUES(?, ?, ?, ?, ?, ?, 'P')\";\n\t\t\t\t$cartUpdateSQL = \"UPDATE b_cart SET record_status = 'C' WHERE cart_id = ?\";\n\n\n\t\t\t\tif ($this->dbConnection->prepareCommand($orderInsertSQL, $this->session->userID, $this->session->shippingAddressID, $this->session->billingAddressID, $this->session->cartID, $subtotal, $tax, $shipping_rate, $total, $this->session->paymentMethodID))\n\t\t\t\t{\n\n\t\t\t\t\t$orderID = $this->dbConnection->insert_id;\n\t\t\t\t\t$line_success = true;\n\n\t\t\t\t\t// The order was inserted, so insert the line records\n\t\t\t\t\tfor ($i=0; $i<$cartCount; $i++) \n\t\t\t\t\t{\n\t\t\t\t\t\t$item_sequence = $i+1;\n\t\t\t\t\t\tif ($this->dbConnection->prepareCommand($orderLineInsertSQL, $orderID, $cart_items[$i]['item_id'], $item_sequence, $cart_items[$i]['quantity'], $cart_items[$i]['price'], $cart_items[$i]['ext_price']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// the insert was succesful\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// There was an error inserting one of the lines\n\t\t\t\t\t\t\t$errors[] = 'Error creating order. (1)';\n\t\t\t\t\t\t\t$this->dbConnection->rollback();\n\t\t\t\t\t\t\t$line_success = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($line_success)\n\t\t\t\t\t{\n\t\t\t\t\t\t// The order was created succesfuly.\n\t\t\t\t\t\t// Update the cart record to close it\n\t\t\t\t\t\tif ($this->dbConnection->prepareCommand($cartUpdateSQL, $this->session->cartID))\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t// The process is done, so commit the changes to the database\n\t\t\t\t\t\t\t$this->dbConnection->commit();\n\n\t\t\t\t\t\t\t//Clear all of the checkout session variables\n\t\t\t\t\t\t\t$this->session->cartID = null;\n\t\t\t\t\t\t\t$this->session->billingAddressID = null;\n\t\t\t\t\t\t\t$this->session->shippingAddressID = null;\n\t\t\t\t\t\t\t$this->session->paymentMethodID = null;\n\n\t\t\t\t\t\t\t// Redirect the user to the receipt page for the order\n\t\t\t\t\t\t\theader(\"Location: /checkout/receipt?orderID={$orderID}\");\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// Error updating the cart record, so rolblack\n\t\t\t\t\t\t\t$this->dbConnection->rollback();\n\t\t\t\t\t\t\t$errors[] = 'Error clearing cart. (2)';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// There was an error inserting the order record\n\t\t\t\t\t// Display an error\n\t\t\t\t\t$errors[] = 'Error creating order. (3)';\n\t\t\t\t\t$this->dbConnection->rollback();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\t\n\t\t\t$this->set('errors', $errors);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "protected function render(){\n //render view\n \n }", "public function getReviewAction()\n\t{\n\t\t$this->_ajaxValidation();\n\t\t$response['content']=$this->_getReviewHtml();\n\t\t$this->getResponse()->setBody(json_encode($response));\n\t}", "abstract protected function renderFirstView();", "public function show(ProductReview $productReview)\n {\n //\n }", "public function show(ProductReview $productReview)\n {\n //\n }", "function render_review($id){\n $source = get_post_meta( $id, 'source', true );\n $name = get_post_meta( $id, 'name', true );\n $description = get_post_meta( $id, 'description', true );\n $rating = get_post_meta( $id, 'rating', true );\n\n $result = '';\n $result .= '<div class=\"item-review\" data-review-source=\"' . $source . '\">';\n $result .= '<div class=\"item-review-name\">' . $name . '</div> - ';\n $result .= '<div class=\"item-review-rating\">' . render_stars($rating) . '</div>';\n $result .= '<blockquote class=\"item-review-text\">' . $description . '</blockquote>';\n $result .= '</div>';\n\n return $result;\n}", "public function actionReview()\n\t{\n\t\t$review = new Review();\n\t\t$review->attributes = $_POST['Review'];\n\t\tif ($review->validate())\n\t\t{\n\t\t\t$noteId = $_POST['note_id'];\n\t\t\t$model = $this->loadModel($noteId);\n\n\t\t\t$model->addReview($review, Yii::app()->user->id);\n\n\t\t\techo $this->renderPartial('_review', array('data'=>$review), true);\n\t\t}\n\t}", "public function show(Review $review)\n {\n return $review;\n }", "function apptivo_ecommerce_checkout_order_review() {\t\r\n\t\r\n\tapptivo_ecommerce_get_template('checkout/checkout_review_order.php', false);\r\n}", "function displayAbstract($hookName, $params) {\n\t\t$smarty =& $params[1];\n\t\t$output =& $params[2];\n\n\t\t// Get the journal and the article\n\t\t$journal =& Request::getJournal();\n\t\t$journalId = $journal->getId();\n\t\t$article = $smarty->get_template_vars('article');\n\t\t$pubObject = $smarty->get_template_vars('pubObject');\n\t\t// Only consider the abstract page\n\t\tif ($article && is_a($pubObject, 'Article')) {\n\t\t\t// Get the assignemnts for this article\n\t\t\t$objectsForReview = array();\n\t\t\t$ofrDao =& DAORegistry::getDAO('ObjectForReviewDAO');\n\t\t\t$ofrAssignmentDao =& DAORegistry::getDAO('ObjectForReviewAssignmentDAO');\n\t\t\t$objectForReviewAssignments =& $ofrAssignmentDao->getAllBySubmissionId($article->getId());\n\t\t\tforeach ($objectForReviewAssignments as $objectForReviewAssignment) {\n\t\t\t\t$objectForReview = $ofrDao->getById($objectForReviewAssignment->getObjectId(), $journalId);\n\t\t\t\t$objectsForReview[] = $objectForReview;\n\t\t\t}\n\n\t\t\tif (!empty($objectsForReview)) {\n\t\t\t\t// Get metadata for the review type\n\t\t\t\t$reviewObjectTypeDao =& DAORegistry::getDAO('ReviewObjectTypeDAO');\n\t\t\t\t$allTypes =& $reviewObjectTypeDao->getTypeIdsAlphabetizedByContext($journalId);\n\t\t\t\t$reviewObjectMetadataDao =& DAORegistry::getDAO('ReviewObjectMetadataDAO');\n\t\t\t\t$allReviewObjectsMetadata = array();\n\t\t\t\tforeach ($allTypes as $type) {\n\t\t\t\t\t$typeId = $type['typeId'];\n\t\t\t\t\t$typeMetadata = $reviewObjectMetadataDao->getArrayByReviewObjectTypeId($typeId);\n\t\t\t\t\t$allReviewObjectsMetadata[$typeId] = $typeMetadata;\n\t\t\t\t}\n\n\t\t\t\t$publicFileManager = new PublicFileManager();\n\t\t\t\t$coverPagePath = Request::getBaseUrl() . '/';\n\t\t\t\t$coverPagePath .= $publicFileManager->getJournalFilesPath($journalId) . '/';\n\t\t\t\t$smarty->assign('coverPagePath', $coverPagePath);\n\n\t\t\t\t$smarty->assign('objectsForReview', $objectsForReview);\n\t\t\t\t$smarty->assign('allReviewObjectsMetadata', $allReviewObjectsMetadata);\n\t\t\t\t$smarty->assign('multipleOptionsTypes', ReviewObjectMetadata::getMultipleOptionsTypes());\n\t\t\t\t$smarty->assign('ofrListing', true);\n\t\t\t\t$smarty->assign('ofrTemplatePath', $this->getTemplatePath());\n\t\t\t\t$output .= $smarty->fetch($this->getTemplatePath() . 'articleObjectsForReview.tpl');\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function viewsAction(Product $product){\n $reviewService = $this->container->get('ReviewService');\n $reviews = $reviewService->getReviewsByProduct($product);\n\n if (!empty($reviews) && count($reviews) > 1) {\n $ratings = [];\n $avarageRaging = 1;\n \n foreach ($reviews as $review) {\n array_push($ratings, $review->getRating());\n }\n \n $ratings = array_filter($ratings);\n $avarageRaging = array_sum($ratings)/count($ratings);\n } elseif (!empty($reviews) && count($reviews) == 1) {\n $avarageRaging = $reviews[0]->getRating();\n } else {\n $avarageRaging = null;\n }\n\n return $this->render('AppBundle:Review:views.html.twig', array(\n 'reviews' => $reviews,\n 'avarageRaging' => $avarageRaging\n ));\n }", "public function _Render() {\n $form_instance = $this->form_instance;\n // Return the contents\n return '3/15 Questions Answered';\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function review($review_id) {\n if(!$this->that->config->get('koraki_review'))\n return;\n\n if (isset($this->that->request->server['HTTPS']) && (($this->that->request->server['HTTPS'] == 'on') || ($this->that->request->server['HTTPS'] == '1'))) {\n $base = $this->that->config->get('config_ssl');\n } else {\n $base = $this->that->config->get('config_url');\n }\n\n if(empty($review_id)){\n return;\n }\n\n $this->that->load->model('catalog/review');\n\n $review = $this->that->model_catalog_review->getReview($review_id);\n\n if(isset($review) && !empty($review['rating']) && !empty($review['rating'] >= 3) && $review['status']==1){\n\n $this->that->load->model('catalog/product');\n $this->that->load->model('tool/image');\n\n $p = $this->that->model_catalog_product->getProduct($review['product_id']);\n $popup = $this->that->model_tool_image->resize($p['image'], 150, 150);\n\n $item = array(\n \"product_id\" => $p['product_id'],\n \"product_name\" => $p['name'],\n \"thumbnail\" => $popup\n );\n\n $variables = array(\n \"number\" => $review['rating'] .\"/5\",\n \"item\" => array(\n $item\n )\n );\n $product = \"<a href='\" . $base . \"?route=product/product&product_id=\" . $p['product_id'] . \"' target='_blank'>\" . html_entity_decode($p['name'], ENT_QUOTES, 'UTF-8') . \"</a>\";\n\n $post = array(\n \"variables\" => json_encode($variables),\n \"notificationText\" => $review['author'] . \" made a \". $review['rating'] .\"/5 star rating on \" . $product,\n \"thumbnailUrl\" => $popup,\n \"location\" => \"\"\n );\n\n $this->post($post);\n }\n }", "public function show(reviews $reviews)\n {\n //\n }", "public function index()\n\t{\n\t\t$content =$this->lproduct_review->product_review_list();\n\t\t$this->template->full_admin_html_view($content);\n\t}", "function apptivo_ecommerce_order_review() {\r\n apptivo_ecommerce_get_template('checkout/review_order.php', false);\r\n}", "public function render() {\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Executing all modules methods.\" );\n\t\tW2P::getInstance()->modules()->exec_all_functions();\n\t\t\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Generating rendering of the view: {$this->view}\" );\n\t\t\n\t\tob_start ();\n\t\tinclude_once (W2P_INCLUDE . W2P::getInstance()->configuration()->layout_path . '/views/' . $this->view . '.phtml');\n\t\t$this->content = ob_get_clean ();\n\t\t\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Content of the rendered view\" );\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Adding to the project layout\" );\n\t\t\n\t\tinclude (W2P_INCLUDE . W2P::getInstance()->configuration()->layout_path . '/' . $this->layout . '.phtml');\n\t\t\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Layout successfully mastered\" );\n\t\t\n\t\tif (W2P::getInstance()->configuration()->debug)\n\t\t\tW2P::getInstance()->debug()->save_debug ( W2P::getInstance()->configuration()->debug_format );\n\t}", "function indexAction()\r\n {\r\n if (!$this->config->isPhaseOpen(Config::REVIEWING_PHASE)) {\r\n $this->view->content = $this->texts->reviewer->review_phase_is_closed;\r\n echo $this->view->render(\"layout\");\r\n return;\r\n }\r\n\r\n $nbPapersInGroup = 15;\r\n\r\n // Get the current group\r\n $currentGroup = $this->getRequest()->getParam(\"group\", \"0\");\r\n if ($currentGroup == \"0\") {\r\n if (isSet($_SESSION['myreview_current_group'])) {\r\n $currentGroup = $_SESSION['myreview_current_group'];\r\n }\r\n else $currentGroup = 1;\r\n }\r\n\r\n // Put in the session\r\n $_SESSION['myreview_current_group'] = $currentGroup;\r\n\r\n $minPaper = ($currentGroup -1) * $nbPapersInGroup + 1 ;\r\n $maxPaper = $minPaper + $nbPapersInGroup;\r\n\r\n $loginSuccessful = $this->getRequest()->getParam(\"login_successful\");\r\n if (!empty($loginSuccessful)) {\r\n $this->view->initial_message = $this->zmax_context->texts->welcome_connected_reviewer;\r\n }\r\n else {\r\n $this->view->initial_message = \"\";\r\n }\r\n\r\n $this->view->setFile (\"content\", \"index.xml\");\r\n $texts = $this->zmax_context->texts;\r\n\r\n $requiredFileTbl = new RequiredFile();\r\n\r\n /* Select all the papers and list them.\r\n First extract the 'bloc' describing a line from the template */\r\n\r\n $this->view->setBlock(\"content\", \"GROUP\", \"GROUPS\");\r\n $this->view->setBlock(\"content\", \"PAPER\", \"PAPERS\");\r\n $this->view->setBlock(\"content\", \"FORUM_LINK\");\r\n $this->view->setBlock(\"PAPER\", \"ALL_REVIEWS\", \"REVIEWS\");\r\n $this->view->setBlock(\"PAPER\", \"MY_REVIEW\", \"REVIEW\");\r\n $this->view->setBlock(\"PAPER\", \"DOWNLOAD\", \"DOWNLOADS\");\r\n $this->view->setBlock(\"DOWNLOAD\", \"DOWNLOAD_LINK\", \"THE_LINK\");\r\n $this->view->setBlock(\"PAPER\", \"review\", \"show_review\");\r\n $this->view->setBlock(\"review\", \"review_mark\", \"review_marks\");\r\n $this->view->setBlock(\"review\", \"review_answer\", \"review_answers\");\r\n $this->view->setBlock(\"PAPER\", \"SECTION\", \"SECTIONS\");\r\n $this->view->setBlock(\"PAPER\", \"ANSWER\", \"ANSWERS\");\r\n\r\n if ($this->config->discussion_mode != Config::GLOBAL_DISCUSSION) {\r\n $this->view->set_var(\"FORUM_LINK\", \"\");\r\n }\r\n\r\n // First, create the groups\r\n $iPaper = 0; $iGroup = 0; $begin = 1;\r\n $qPapers = \"SELECT idPaper FROM Review WHERE id_user = '{$this->user->id}'\";\r\n $rPapers = $this->zmax_context->db->fetchAll($qPapers);\r\n $nbPapers = count ($rPapers);\r\n // echo \"Nb = $nbPapers<br/>\";\r\n // while ($p = $rPapers->fetch (Zend_Db::FETCH_OBJ)) {\r\n foreach ($rPapers as $paper) {\r\n $iPaper++;\r\n if ($iPaper % $nbPapersInGroup == 0 or $iPaper == $nbPapers) {\r\n $iGroup ++;\r\n $end = $iPaper;\r\n $this->view->group_desc= \"($begin-$end)\";\r\n $this->view->id_group = $iGroup;\r\n if ($iGroup == $currentGroup) {\r\n $this->view->current_group = \" bgcolor='lightgrey' \";\r\n }\r\n else $this->view->current_group = \"\";\r\n $this->view->append (\"GROUPS\", \"GROUP\");\r\n $begin = $end+1;\r\n }\r\n }\r\n\r\n // Loop on the papers assigned to the reviewer\r\n $reviews = $this->user->findReview();\r\n $nbPapers = $i = 0;\r\n foreach ($reviews as $review) {\r\n $nbPapers++;\r\n // Take account of groups\r\n if ($nbPapers < $minPaper or $nbPapers >= $maxPaper) continue;\r\n \r\n $this->view->set_var(\"css_class\", Config::CssCLass($i));\r\n\r\n $paper = $review->findParentPaper();\r\n\r\n // Instantiate entities in the view\r\n $paper->putInView($this->view);\r\n\r\n // Loop on the files associated to the paper, and propose a download link\r\n $requiredFiles = $requiredFileTbl->fetchAll();\r\n $countRequired = 0;\r\n $this->view->DOWNLOADS = \"\";\r\n foreach ($requiredFiles as $requiredFile) {\r\n $requiredFile->putInView($this->view);\r\n $countRequired++;\r\n\r\n if (!$paper->fileExists($requiredFile)) {\r\n $this->view->THE_LINK = $texts->reviewer->not_yet_uploaded ;\r\n }\r\n else {\r\n $this->view->assign(\"THE_LINK\", \"DOWNLOAD_LINK\");\r\n }\r\n $this->view->assign(\"DOWNLOAD_BIS\", \"DOWNLOAD\");\r\n $this->view->append(\"DOWNLOADS\", \"DOWNLOAD_BIS\");\r\n }\r\n if ($countRequired == 0) {\r\n $this->view->DOWNLOADS = $texts->reviewer->no_file_to_download ;\r\n }\r\n\r\n if (!$review->overall) {\r\n $this->view->submit_review = \"<font color='red'>\" .\r\n $texts->reviewer->submit_review . \"</font>\";\r\n }\r\n else {\r\n $this->view->submit_review =\r\n \"<font color='green'>\" . $texts->reviewer->update_review. \"</font>\";\r\n }\r\n\r\n // If the local discussion mode is enabled AND the reviewer has posted her\r\n // review: give the ability to look at other reviews\r\n if ($this->config->discussion_mode != Config::NO_DISCUSSION and $review->overall) {\r\n $this->view->review_header = $texts->reviewer->all_reviews;\r\n $this->view->set_var(\"REVIEW\",\"\");\r\n $this->view->assign(\"REVIEWS\",\"ALL_REVIEWS\");\r\n }\r\n else {\r\n // Show only my review, no forum, no other reviews\r\n $this->view->show_review = $review->showReview($this->view);\r\n $this->view->assign(\"REVIEW\",\"MY_REVIEW\");\r\n $this->view->review_header = $texts->reviewer->your_review;\r\n $this->view->REVIEWS = \"\";\r\n }\r\n $this->view->append(\"PAPERS\", \"PAPER\");\r\n }\r\n\r\n if ($nbPapers == 0) {\r\n $this->view->set_var(\"PAPERS\", \"No papers\");\r\n }\r\n\r\n echo $this->view->render(\"layout\");\r\n }", "function fre_freelancer_review_form() {\n wp_reset_query();\n global $user_ID;\n $status = get_post_status(get_the_ID());\n $bid_accepted = get_post_field('accepted', get_the_ID());\n $freelan_id = (int)get_post_field('post_author', $bid_accepted);\n $comment = get_comments(array(\n 'status' => 'approve',\n 'post_id' => get_the_ID() ,\n 'type' => 'fre_review'\n ));\n $review = isset($_GET['review']) ? (int)$_GET['review'] : 0;\n $status = get_post_status(get_the_ID());\n \n if (empty($comment) && $user_ID == $freelan_id && $review && $status == 'complete') { ?>\n <script type=\"text/javascript\">\n (function($, Views, Models, Collections) {\n $(document).ready(function(){\n this.modal_review = new AE.Views.Modal_Review();\n this.modal_review.openModal();\n });\n })(jQuery, AE.Views, AE.Models, AE.Collections);\n </script>\n\n <?php\n }\n }", "public function show(Reviews $reviews)\n {\n //\n }", "public function render(\\Opt_View $view)\n\t{\n\t\t$this->_view = $view;\n\t}", "public function render()\n {\n if (file_exists('../resources/views/' . $this->view_name . '.phtml')) {\n include_once '../resources/views/' . $this->view_name . '.phtml';\n include_once '../resources/views/layouts/' . $this->layout . '.phtml';\n } else {\n die(\"THERE IS NO VIEW\");\n }\n }", "public function indexAction()\n\t{\n $this->_title($this->__('All Reviews'));\n\t\tif ($this->getRequest()->getParam('ajax')) {\n\t\t\t\treturn $this->_forward('reviewGrid');\n\t\t}\n\t\t$this->loadLayout();\n\t\t$this->_setActiveMenu( 'sales/salesreport' );\n \t$this->_addContent($this->getLayout()->createBlock('salesreport/adminhtml_reviews'));\n\t\t$this->renderLayout();\n\t}", "function reviews($args){\n\t\t$this->view->add('page_title','Reviews');\n\t\t\n\t\t//Set tool box\n\t\tif( $args['tool'] == null ){\n $tool = 'display';\n } else {\n $tool = $args['tool'];\n }\n\t\t if( $func = $this->reviews_toolbox($tool,$this) ) {\n \n // check for success, default to no\n $success = false;\n \n // choose tool and execute\n $success = $func($this);\n }\n \n // add self link\n $this->view->add('self_link',\n $this->app->form_path('admin/reviews')\n );\n\t}", "function getReview()\n {\n $this->logged_in = $this->flexi_auth->is_logged_in();\n if (!$this->logged_in) {\n # if not logged show error message\n $dataArr = array();\n $pageArr = array('controller' => 'review', 'view' => 'error');\n $this->ajax->render($pageArr, $dataArr);\n }\n\n $receiver_id = intval($this->input->post('receiver_id'));\n if (!$receiver_id) {\n $dataArr = array();\n $pageArr = array('controller' => 'review', 'view' => 'error');\n $this->ajax->render($pageArr, $dataArr);\n }\n\n $login_id = $this->flexi_auth->get_user_id();\n $reviewDtlArr = $this->review->getReviewsByReceiver($receiver_id);\n $receiverArr = array();\n $userDtlArr = array();\n if (count($reviewDtlArr)) {\n foreach ($reviewDtlArr as $key => $value) {\n # code...\n array_push($receiverArr, $value['sender_id']);\n }\n array_push($receiverArr, $receiver_id);\n $receiverArr = array_unique($receiverArr);\n $receiverArr = array_filter($receiverArr);\n\n if (count($receiverArr)) {\n\n foreach ($receiverArr as $key_2 => $value_2) {\n # code...\n $tempUserArr = array();\n array_push($tempUserArr, $this->user->getUserDetailsById($value_2));\n $userDtlArr[$value_2] = isset($tempUserArr[0][0]) ? $tempUserArr[0][0] : '';\n }\n }\n $userDtlArr = array_filter($userDtlArr);\n\n $pageArr = array(\n 'controller' => 'review',\n 'view' => 'show_review'\n );\n $dataArr = array(\n 'receiver_id' => $receiver_id,\n 'review_count' => true,\n 'userDtlArr' => $userDtlArr,\n 'reviewDtlArr' => $reviewDtlArr\n );\n $this->ajax->render($pageArr, $dataArr);\n\n } else {\n $tempUserArr = $this->user->getUserDetailsById($receiver_id);\n $userDtlArr[$receiver_id] = isset($tempUserArr[0]) ? $tempUserArr[0] : '';\n #print_r($userDtlArr);\n $pageArr = array(\n 'controller' => 'review',\n 'view' => 'show_review'\n );\n $dataArr = array(\n 'receiver_id' => $receiver_id,\n 'review_count' => false,\n 'userDtlArr' => $userDtlArr\n );\n $this->ajax->render($pageArr, $dataArr);\n }\n\n\n }", "function medstat_quizz_questionnaire_take_content_type_render($subtype, $conf, $panel_args, $context = NULL) {\n if (!empty($context) && empty($context->data)) {\n return NULL;\n }\n\n $quiz = isset($context->data) ? clone($context->data) : NULL;\n\n // Check if direct take has been set.\n if ($quiz && !empty($_SESSION['quiz_direct_take_' . $quiz->qid])) {\n // Set post variables so quiz module can handle the answer.\n $_POST['op'] = t('Next');\n $_POST['question_nid'] = $_SESSION['quiz_direct_take_' . $quiz->qid]['question_qid'];\n $_POST['tries'] = $_SESSION['quiz_direct_take_' . $quiz->qid]['tries'];\n unset($_SESSION['quiz_direct_take_' . $quiz->qid]);\n }\n\n $block = new stdClass();\n\n if (empty($quiz)) {\n // Output the associated JS anyways, for \"answer reveal\".\n drupal_add_js(drupal_get_path('module', 'medstat_quizz') . '/medstat_quizz.js');\n\n $block->delta = 'questionnaire-empty';\n $block->title = '';\n $block->content = '<br><div class=\"question-wrapper questionnaire-empty\">&nbsp;</div><br>';\n return $block;\n }\n\n if (!quizz_take_access($quiz)) {\n return NULL;\n }\n\n $block->module = 'node';\n $block->delta = $quiz->qid;\n\n // Fake path, so the quiz module can render properly.\n medstat_quizz_patch_path('quiz/' . $quiz->qid . '/take/*');\n $current = isset($_SESSION['quiz'][$quiz->qid]) ? $_SESSION['quiz'][$quiz->qid]['current'] : 1;\n\n // If we don't have a running session on this quiz, initialize it.\n if (!isset($_SESSION['quiz'][$quiz->qid])) {\n global $user;\n $obj = new QuizTakeController($quiz, $user);\n try {\n $obj->initQuizResult();\n }\n catch (\\RuntimeException $e) {\n return array(\n 'body' => array(\n '#prefix' => '<div class=\"messages error\">',\n '#suffix' => '</div>',\n '#markup' => $e->getMessage(),\n ),\n );\n }\n }\n\n if (isset($quiz->rendered_content)) {\n $block->content = $quiz->rendered_content;\n }\n else {\n $block->content = quizz_take_question_page($quiz, $current);\n }\n // Restore path.\n medstat_quizz_patch_path();\n\n return $block;\n}", "public function actionReviewer()\n {\n $searchModel = new ModuleSearch();\n \n /* show only modules owned by loggedin user list view */\n $qParams = Yii::$app->request->queryParams;\n $qParams['ModuleSearch']['reviewer_id'] = Yii::$app->user->getId();\n $dataProvider = $searchModel->search($qParams);\n\n return $this->render('reviewer', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function woocommerce_order_review_start() {\n\t\t\techo '<div id=\"ast-order-review-wrapper\">';\n\t\t}", "public function show($review)\n\t{\n\t\t//$review = Review::where('lat','LIKE',\"%\".substr($lat,0,8).\"%\")->where('lng','LIKE',\"%\".substr($lng,0,8).\"%\")->first();\n\t\treturn View::make('review')->withReview($review)->withSolutions($review->solutions);\n\t}", "public function actionAdmin()\n\t{ \n\t\t$this->render('review_admin');\n\t}", "function onView () {\n\n switch (parent::getAction()) {\n case \"edit\":\n if (Context::hasRole(\"user.friendRequest.edit\")) {\n $this->printEditView();\n }\n break;\n default:\n if (Context::hasRole(\"user.friendRequest.view\")) {\n $this->printMainView();\n }\n break;\n }\n }", "protected function partialRender()\n {\n $this->view->render();\n }", "private function _getRenderedView()\n {\n $data = $this->_SocialShareButtonsData();\n\t\t\tif(!$data['hide_on_page']){\n return $this->_loadView('front-buttons', $data);\n }\n }", "public function postAction(){\n $return_result = array(\n 'code'=> 0,\n 'model'=> null,\n );\n $params = $this->postJsonParams();\n $product_id = $params('product_id');\n\n if ($data = Mage::getSingleton('review/session')->getFormData(true)) {\n $rating = array();\n if (isset($data['ratings']) && is_array($data['ratings'])) {\n $rating = $data['ratings'];\n }\n } else {\n $data = $params;\n $rating = isset($params['ratings'])?$params['ratings']:array();\n }\n $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($product_id);\n if (($product) && !empty($data)) {\n $session = Mage::getSingleton('core/session');\n /* @var $session Mage_Core_Model_Session */\n $review = Mage::getModel('review/review')->setData($data);\n /* @var $review Mage_Review_Model_Review */\n $validate = $review->validate();\n if ($validate === true) {\n try {\n $review->setEntityId($review->getEntityIdByCode(Mage_Review_Model_Review::ENTITY_PRODUCT_CODE))\n ->setEntityPkValue($product->getId())\n ->setStatusId(Mage_Review_Model_Review::STATUS_PENDING)\n ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())\n ->setStoreId(Mage::app()->getStore()->getId())\n ->setStores(array(Mage::app()->getStore()->getId()))\n ->save();\n foreach ($rating as $ratingId => $optionId) {\n Mage::getModel('rating/rating')\n ->setRatingId($ratingId)\n ->setReviewId($review->getId())\n ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())\n ->addOptionVote($optionId, $product->getId());\n }\n $review->aggregate();\n $return_result['message'] = 'Your review has been accepted for moderation.';\n }\n catch (Exception $e) {\n $return_result['code'] = 1;\n $return_result['error'] = 'Unable to post the review.';\n }\n }\n else {\n $session->setFormData($data);\n if (is_array($validate)) {\n foreach ($validate as $errorMessage) {\n $return_result['error'] = $errorMessage;\n }\n }\n else {\n $return_result['error'] = 'Unable to post the review.';\n }\n }\n }\n echo json_encode($return_result);\n }", "public function loadReview()\n\t{\n\t\t$reviewid = $this->uri->segment(2,0);\n\t\t$data = array(\n\t\t\t'reviewid'=>$reviewid\n\t\t);\n\t\t$this->session->set_userdata($data);\n\t\t// print_r($this->session->userdata('reviewid'));\n//\t\tuse the review id to retrieve the review from the db and pass it to the view in the form of an array\n\t\t$review = $this->Review_Model->getReview($reviewid);\n\t\t// $comments = $this->Review_Model->getComments($reviewid);\n\n\t\t$this->load->view('reviewPage', ['review'=>$review]);\n\t}", "public function getPrintRankingWidget(){\n\t\t$books = BookRepository::printRanking();\n\t\treturn View::make('printwidget', array('books'=>$books));\n\t}", "public function view() {\n\t\t$quiz = $this->__quiz;\n\n\t\t// 基本的には自分の履歴を見ようとしていることが前提\n\t\t// 初期表示のテスト一覧から結果を見ようとしている=つまり編集権限は無し、自分のデータを見るパターン\n\t\t$userId = Current::read('User.id');\n\t\t$handleName = Current::read('User.handlename');\n\n\t\t// サマリIDが指定されているときだけが、上記の前提から異なる可能性があるパターン\n\t\t// 成績一覧画面(quiz_result/index)からこの画面へ来たときの遷移\n\t\t// この時は対象人物が自分ではないので適宜設定しなおす\n\t\t// サマリID\n\t\t$summaryId = null;\n\t\tif (isset($this->params['pass'][0])) {\n\t\t\t$summaryId = $this->params['pass'][0];\n\t\t\t$summary = $this->QuizAnswerSummary->findById($summaryId);\n\t\t\tif (! $summary) {\n\t\t\t\t$this->setAction('throwBadRequest');\n\t\t\t}\n\t\t\t$userId = $summary['QuizAnswerSummary']['user_id'];\n\t\t\t$handleName = $summary['User']['handlename'];\n\t\t}\n\n\t\tif (! $handleName) {\n\t\t\t$handleName = __d('quizzes', 'Guest');\n\t\t}\n\n\t\t// 採点する権限を持っていないなら 自分自身のデータであることが必要\n\t\t$canGrade = $this->canGrade($quiz);\n\t\tif (! $canGrade && $summaryId) {\n\t\t\t// 自分の?\n\t\t\tif (! $this->QuizzesOwnAnswer->checkOwnAnsweredSummaryId($summaryId)) {\n\t\t\t\t$this->setAction('throwBadRequest');\n\t\t\t}\n\t\t}\n\t\t// 初期設定\n\t\t$this->QuizResult->initResult($quiz);\n\t\t// 統合情報取得\n\t\t$general = $this->QuizResult->getAllResult();\n\n\t\t// 得点推移データ取得\n\t\t// そのサマリIDに該当する人物のサマリ履歴を取得する\n\t\t$scoreHistory = $this->_getScoreHistory($quiz, $userId, $summaryId);\n\n\t\t$conditions = array(\n\t\t\t'quiz_key' => $quiz['Quiz']['key'],\n\t\t);\n\t\tif ($userId) {\n\t\t\t$conditions['user_id'] = $userId;\n\t\t} else {\n\t\t\t// 非会員\n\t\t\t// サマリID指定\n\t\t\tif ($summaryId) {\n\t\t\t\t$conditions['id'] = $summaryId;\n\t\t\t} else {\n\t\t\t\t$conditions['id'] = $this->QuizzesOwnAnswer->getAnsweredSummaryIds();\n\t\t\t}\n\t\t}\n\t\t$this->paginate = array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'page' => 1,\n\t\t\t'order' => array('QuizAnswerSummary.answer_number' => 'DESC'),\n\t\t\t'limit' => 10,\n\t\t\t'recursive' => -1,\n\t\t);\n\t\t$summaryList = $this->paginate('QuizAnswerSummary');\n\n\t\t$this->set('quiz', $quiz);\n\t\t$this->set('userId', $userId);\n\t\t$this->set('handleName', $handleName);\n\t\t$this->set('general', $general);\n\t\t$this->set('summaryList', $summaryList);\n\t\t$this->set('scoreHistory', $scoreHistory);\n\t}", "public function render() {\n echo $this->getHtml();\n }", "public function index()\n {\n return $this->render('page/customer-review.html.twig', [\n 'controller_name' => 'CustomerReviewController',\n ]);\n }", "public function actionCreate()\n\t{ \n\t\t$this->render('review_create');\n\t}", "public function previews()\n {\n $this->authorize();\n\n ee()->load->helper('form');\n ee()->load->library('form_validation');\n ee()->load->model('publisher_channel');\n ee()->load->model('publisher_template');\n\n if (empty($_POST))\n {\n $vars = array(\n 'hidden' => array(),\n 'save_url' => ee()->publisher_helper_cp->mod_link('previews', array(), TRUE),\n 'templates' => ee()->publisher_template->get_all(),\n 'channels' => ee()->publisher_channel->get_all(),\n 'data' => ee()->publisher_template->get_all_previews()\n );\n\n return ee()->load->view('previews', $vars, TRUE);\n }\n else\n {\n ee()->publisher_template->save_previews();\n ee()->session->set_flashdata('message_success', lang('publisher_previews_saved'));\n ee()->publisher_helper_url->redirect(ee()->publisher_helper_cp->mod_link('previews'));\n }\n }", "public function viewAction($review_id)\n {\n $data = array(\n 'review' => ReviewsCms::getReviewDetails($review_id),\n 'comments' => CommentsCms::getByReviewId($review_id)\n // TODO: Add photos per review\n );\n\n return view('cms.review.view', $data);\n }", "function freelancer_review_action() {\n global $user_ID;\n $args = $_POST;\n $project_id = $args['project_id'];\n \n $status = get_post_status($project_id);\n \n $bid_id_accepted = get_post_meta($project_id, 'accepted', true);\n \n $author_bid = (int)get_post_field('post_author', $bid_id_accepted);\n \n $freelancer_id = get_post_field('post_author', $bid_id_accepted);\n \n /*\n * validate data\n */\n if (!isset($args['score']) || empty($args['score'])) {\n $result = array(\n 'succes' => false,\n 'msg' => __('You have to rate this project.', ET_DOMAIN)\n );\n wp_send_json($result);\n }\n if (!isset($args['comment_content']) || empty($args['comment_content'])) {\n $result = array(\n 'succes' => false,\n 'msg' => __('Please post a review for this freelancer.', ET_DOMAIN)\n );\n wp_send_json($result);\n }\n \n /*\n * check permission\n */\n if ($user_ID !== $author_bid || !$user_ID) {\n wp_send_json(array(\n 'succes' => false,\n 'msg' => __('You don\\'t have permission to review.', ET_DOMAIN)\n ));\n }\n \n /*\n * check status of project\n */\n if ($status !== 'complete') {\n wp_send_json(array(\n 'succes' => false,\n 'msg' => __('You can\\'t not reivew on this project.', ET_DOMAIN)\n ));\n }\n \n /**\n * check user reviewed project owner or not\n * @author Dan\n */\n $role = ae_user_role($user_ID);\n $type = 'em_review';\n if ($role == FREELANCER) {\n $type = 'fre_review';\n }\n \n $comment = get_comments(array(\n 'status' => 'approve',\n 'type' => $type,\n 'post_id' => $project_id\n ));\n \n if (!empty($comment)) {\n wp_send_json(array(\n 'succes' => false,\n 'msg' => __('You have reviewed on this project.', ET_DOMAIN)\n ));\n }\n \n // end check user review project owner\n \n // add review\n $args['comment_post_ID'] = $project_id;\n $args['comment_approved'] = 1;\n $this->comment_type = 'fre_review';\n $review = Fre_Review::get_instance(\"fre_review\");\n \n $comment = $review->insert($args);\n \n if (!is_wp_error($comment)) {\n \n /**\n * fire action after freelancer review employer base on project\n * @param int $int project id\n * @param Array $args submit args (rating score, comment)\n * @since 1.2\n * @author Dakachi\n */\n do_action('fre_freelancer_review_employer', $project_id, $args);\n \n //update project, bid, bid author, project author after review\n $this->update_after_fre_review($project_id, $comment);\n wp_send_json(array(\n 'success' => true,\n 'msg' => __(\"Your review has been submitted.\", ET_DOMAIN)\n ));\n } else {\n \n // revert bid status\n wp_update_post(array(\n 'ID' => $bid_id_accepted,\n 'post_status' => 'publish'\n ));\n \n wp_send_json(array(\n 'success' => false,\n 'msg' => $comment->get_error_message()\n ));\n }\n }", "protected function render() {}", "protected function render() {}", "protected function render() {}", "public function render()\n {\n // specify a view to render.\n $this->view = 'dkrepeator::repeator';\n\n $this->buildNestedForm($this->column, $this->builder);\n\n list($template, $script) = $this->buildNestedForm($this->column, $this->builder)\n ->getTemplateHtmlAndScript();\n\n//\n $this->setupScriptForDefaultView($script);\n\n return parent::render()->with([\n 'forms' => $this->buildRelatedForms(),\n 'template' => $template,\n 'relationName' => null,\n ]);\n }", "public function actionView($id)\n {\n return $this->render('view', [\n 'review' => $this->findModel($id),\n ]);\n }", "public function make_review($ref_number) {\n $order = Order::query()\n ->where('ref_number', '=', $ref_number)\n ->with([\n 'order_raw_material_inventory_review',\n 'order_raw_material',\n 'order_raw_material.bag_type',\n 'order_raw_material.raw_material',\n ])\n ->first();\n if (!$order)\n return Redirect::back()->with('error', \"Order Ref: $ref_number not found!\");\n $data['order'] = $order;\n $data['raw_materials'] = RawMaterial::all();\n $data['bag_types'] = BagType::all();\n return view('admin.inventory.make_review', $data);\n }", "protected function render()\n {\n }", "protected function render()\n {\n }", "protected function render()\n {\n }", "protected function render()\n {\n }", "function enquiry_review_render_list_page(){\r\n $enquiryReviewListTable = new Enquiry_Review_List_Table();\r\n //Fetch, prepare, sort, and filter our data...\r\n $enquiryReviewListTable->prepare_items();\r\n \r\n ?>\r\n <div class=\"wrap\">\r\n \r\n <div id=\"icon-users\" class=\"icon32\"><br/></div>\r\n <h2>Enquiry Review List</h2>\r\n \r\n \r\n <!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions -->\r\n <form id=\"movies-filter\" method=\"get\">\r\n <!-- For plugins, we also need to ensure that the form posts back to our current page -->\r\n <input type=\"hidden\" name=\"page\" value=\"<?php echo $_REQUEST['page'] ?>\" />\r\n <!-- Now we can render the completed list table -->\r\n <?php $enquiryReviewListTable->display() ?>\r\n </form>\r\n \r\n </div>\r\n <?php\r\n }", "public function htmlpreviewAction()\n {\n $this->_setTitle();\n $this->loadLayout();\n\n $data = $this->getRequest()->getParams();\n if (empty($data) || !isset($data['id'])) {\n $this->_forward('noRoute');\n return $this;\n }\n\n // set default value for selected store\n $data['preview_store_id'] = Mage::app()->getDefaultStoreView()->getId();\n\n $this->getLayout()->getBlock('preview_form')->setFormData($data);\n $this->renderLayout();\n }", "public function show(Reviewer $reviewer)\n {\n //\n }", "protected function _render()\n {\n }", "protected function _prepareLayout()\n {\n parent::_prepareLayout();\n\n $toolbar = $this->getLayout()->getBlock('product_review_list.toolbar');\n if ($toolbar) {\n $toolbar->setAvailableLimit([3=>3])\n ->setLimit(3)\n ->setCollection($this->getReviewsCollection());\n $this->setChild('toolbar', $toolbar);\n }\n\n return $this;\n }", "public function pendingAction()\n\t{\n\t\t\t$this->_title($this->__('Pending Reviews'));\n\n\t\t\tif ($this->getRequest()->getParam('ajax')) {\n\t\t\t\t\tMage::register('usePendingFilter', true);\n\t\t\t\t\treturn $this->_forward('reviewGrid');\n\t\t\t}\n\n\t\t\t$this->loadLayout();\n\t\t\t$this->_setActiveMenu('sales/salesreport');\n\n\t\t\tMage::register('usePendingFilter', true);\n\t \t$this->_addContent($this->getLayout()->createBlock('salesreport/adminhtml_reviews'));\n\n\t\t\t$this->renderLayout();\n\t}", "public function action_view()\n {\n // Correct page has been loaded in the before() function\n $pagename = Wi3::inst()->routing->args[0];\n $this->prepareForViewing($pagename);\n // Render page\n $renderedInAdminArea = false;\n $this->request->response = Wi3_Renderer::renderPage($pagename, $renderedInAdminArea);\n // Page caching will be handled via an Event. See bootstrap.php and the Caching plugin\n }", "function learn_press_single_quiz_preview_mode() {\n\t\tlearn_press_get_template( 'content-quiz/preview-mode.php' );\n\t}", "public function displayQuickView()\n {\n if ($this->helperData->productQuickViewEnabled()) {\n return true;\n }\n return false;\n }", "public function renderQuickEdit() {}", "protected function viewAction()\n {\n }", "protected function renderModuleContent() {}", "public function index() {\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\n\t\t$data['reviews'] = $this->review_model->get();\n\n\t\t$template['body_content'] = $this->load->view('backend/reviews/index', $data, true);\t\n\t\t$this->load->view('backend/layouts/template', $template, false);\t\t\n\t}", "public function reviewDetails($review_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\n\t\t$data['reviewDetails'] = $this->review_model->getReviewById($review_id);\n\t\tif(empty($data['reviewDetails'])){\n\t\t\tshow_404();\n\t\t\tdie();\n\t\t}\n\t\t$template['body_content'] = $this->load->view('backend/reviews/review-details', $data, true);\t\n\t\t$this->load->view('backend/layouts/template', $template, false);\t\t\n\t}", "public function listAction(){\n $productId = $this->getRequest()->getParam('product_id');\n $pageNo = $this->getRequest()->getParam('page_no', 1);\n $pageSize = $this->getRequest()->getParam('page_size', 10);\n $block = Mage::getBlockSingleton('review/product_view');\n $block->setProductId($productId);\n $collection = $block->getReviewsCollection()\n ->setCurPage($pageNo)\n ->setPageSize($pageSize);\n $rate = Mage::getModel('rating/rating');\n $tradeRates = array();\n foreach ($collection->getItems() as $review) {\n $summary = $rate->getReviewSummary($review->getId());\n if ($summary->getCount() > 0) {\n $rating = round($summary->getSum() / $summary->getCount());\n } else {\n $rating = 0;\n }\n $tradeRates[] = array(\n 'uname' => $review->getNickname(),\n 'item_id' => $productId,\n 'rate_score' => $rating,\n 'rate_content' => $review->getDetail(),\n 'rate_date' => $review->getCreatedAt(),\n 'rate_title' => $review->getTitle()\n );\n }\n $result = array();\n $result['total_results'] = $collection->getSize();\n $result['trade_rates'] = $tradeRates;\n echo json_encode(array('code'=>0,'message'=>'get reviews success!', 'model'=>$result));\n }", "private function renderView()\n\t{\n\t\tff_renderView(substr(__CLASS__, 7));\n\t}", "private function renderView()\n\t{\n\t\tff_renderView(substr(__CLASS__, 7));\n\t}", "public function display() {\n echo $this->render();\n }", "public function render()\n {\n return view('exam::components.question-content');\n }", "function onView () {\r\n\r\n switch (parent::getAction()) {\r\n \tcase \"edit\":\r\n \t\tbreak;\r\n \tcase \"search\":\r\n \t\tbreak;\r\n default:\r\n $this->printSearchBoxView();\r\n }\r\n }" ]
[ "0.65921366", "0.6561468", "0.64910406", "0.6378712", "0.6209332", "0.6113921", "0.6113921", "0.6113921", "0.6113921", "0.60603356", "0.60590494", "0.60014874", "0.59857154", "0.5975177", "0.5969667", "0.5912137", "0.5899351", "0.5866203", "0.5859563", "0.5829139", "0.5805936", "0.57993007", "0.5731874", "0.57232684", "0.56949", "0.5692891", "0.56549615", "0.5641508", "0.56315255", "0.56308734", "0.56308734", "0.5613995", "0.55799776", "0.5566207", "0.55586505", "0.5537172", "0.5524066", "0.55107784", "0.55103016", "0.5492703", "0.54897606", "0.5487749", "0.54861003", "0.54719406", "0.54626375", "0.5458951", "0.5449732", "0.544773", "0.54401225", "0.5429187", "0.5411553", "0.5407421", "0.5362722", "0.53538805", "0.53502834", "0.5338859", "0.533182", "0.53231394", "0.5319029", "0.53188145", "0.53119284", "0.5306766", "0.5306337", "0.5303923", "0.52928543", "0.5263726", "0.52512854", "0.5243829", "0.5238377", "0.52371377", "0.5236956", "0.5236163", "0.5236163", "0.52334744", "0.52224433", "0.52212346", "0.52168995", "0.52167314", "0.5215735", "0.5215735", "0.5212526", "0.521153", "0.5208995", "0.5203195", "0.52016425", "0.5193861", "0.5186049", "0.5176884", "0.51718193", "0.516869", "0.51577544", "0.5155884", "0.5153688", "0.51523274", "0.51517", "0.51499885", "0.51499885", "0.51433086", "0.51418054", "0.5139789" ]
0.66816807
0
Event handler to register this editor.
public static function register($cls=null) { if (null===$cls && function_exists('get_called_class')) { $cls = get_called_class(); } $self = self::getInstance($cls); Mozilla_BYOB_EditorRegistry::register($self); if (!empty($self->review_view_name)) { // If the review view is supplied, register the handler to render // it when it's time. Event::add('BYOB.repack.edit.review.renderSections', array($self, 'renderReviewSection')); } return $self; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register() {\n\t\tadd_filter( 'mce_external_plugins', array( $this, 'enqueue_plugin_scripts' ) );\n\t\tadd_filter( 'mce_buttons', array( $this, 'register_buttons_to_editor' ) );\n\t\tadd_action( 'admin_head', array( $this, 'my_add_styles_admin' ) );\n\t\tadd_action( 'add_meta_boxes', array( $this, 'create_meta_box' ) );\n\t\tadd_action( 'save_post', array( $this, 'slider_meta_save' ) );\n\n\t}", "public function register() {\n\t\tparent::register();\n\t\tadd_action( 'load-theme-editor.php', array( $this, 'get_edition_data' ) );\n\t\tadd_action( 'load-plugin-editor.php', array( $this, 'get_edition_data' ) );\n\t\tadd_filter( 'wp_redirect', array( $this, 'log_changes' ) );\n\t}", "public function register()\n {\n add_meta_box($this->id, $this->title, array( $this, 'render' ), $this->screens );\n }", "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 }", "public function event()\n\t{\n\t\tif (defined('ADMIN_THEME'))\n\t\t{\n\t\t\t$this->CI->type->add_misc($this->CI->type->load_view('codemirror', 'codemirror_admin', null));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->CI->type->add_misc($this->CI->type->load_view('codemirror', 'codemirror_entry_form', null));\n\t\t}\n\t}", "function register() {\n // Para el back-end\n add_action('admin_enqueue_scripts', array($this, 'put_in_queue'));\n // Para el front-end\n add_action('wp_enqueue_scripts', array($this, 'put_in_queue'));\n // Generar nuestro custom post type\n add_action('init', array($this, 'custom_post_type'));\n\n // Añadir una metabox a nuestro custom post type backend\n add_action('add_meta_boxes', array($this, 'reviews_meta_box'));\n // Guardar los cambios que hagamos en los custom post type backend\n add_action('save_post', array($this, 'save_review'));\n\n // Crear un enlace para los settings del plugin en el admin area\n add_action('admin_menu', array($this, 'add_admin_pages'));\n }", "public static function register() {\n\t\t$plugin = new self();\n\n\t\t// Remove default author meta box.\n\t\tadd_action( 'admin_init', array( $plugin, 'remove_author_meta_box' ) );\n\n\t\t// Add meta boxes.\n\t\tadd_action( 'add_meta_boxes', array( $plugin, 'add_meta_boxes' ), 10, 2 );\n\n\t\t// Add admin styles and scripts.\n\t\tadd_action( 'admin_enqueue_scripts', array( $plugin, 'enqueue_scripts_styles' ) );\n\n\t\t// Save meta box data.\n\t\tadd_action( 'save_post', array( $plugin, 'save_meta_box_data' ), 20, 3 );\n\n\t\t// Add custom columns.\n\t\tadd_filter( 'manage_posts_columns', array( $plugin, 'add_posts_columns' ), 10, 2 );\n\n\t\t// Add multi authors to the author column.\n\t\tadd_action( 'manage_posts_custom_column', array( $plugin, 'populate_posts_columns' ), 10, 2 );\n\n\t}", "public static function add_editor() {\n\t\t\twp_enqueue_script( 'tiny_mce' );\n\n\t\t\techo '<div id=\"kirki_editor_pane\" class=\"hide\">';\n\t\t\twp_editor( '', 'kirki-editor', array(\n\t\t\t\t'_content_editor_dfw' => false,\n\t\t\t\t'drag_drop_upload' => true,\n\t\t\t\t'tabfocus_elements' => 'content-html,save-post',\n\t\t\t\t'editor_height' => 200,\n\t\t\t\t'default_editor' => 'tinymce',\n\t\t\t\t'teeny' => true,\n\t\t\t\t'tinymce' => array(\n\t\t\t\t\t'resize' => false,\n\t\t\t\t\t'wp_autoresize_on' => false,\n\t\t\t\t\t'add_unload_trigger' => false,\n\t\t\t\t),\n\t\t\t) );\n\t\t\techo '</div>';\n\t\t\tdo_action( 'admin_footer' );\n\t\t\tdo_action( 'admin_print_footer_scripts' );\n\t\t}", "public static function register() {\n\t register_widget( __CLASS__ );\n\t}", "public function event()\n {\n $this->CI->type->add_css('textarea_limited', 'textarea_limited.css');\n $this->CI->type->add_js('textarea_limited', 'jquery.textareaCounter.plugin.js');\n }", "public function register(): void {\n\t\tif ( $this->type === 'script' ) {\n\t\t\t$this->register_script();\n\t\t}\n\n\t\tif ( $this->type === 'style' ) {\n\t\t\t$this->register_style();\n\t\t}\n\t}", "final public function register() : void\n {\n $labels = $this->entityClass::getLabels();\n $slug = $this->entityClass::getSlug();\n\n $args = array(\n 'label' => $labels['name'],\n 'labels' => $labels,\n 'supports' => array(),\n 'hierarchical' => false,\n 'public' => false,\n 'show_ui' => true,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => false,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'capability_type' => 'post',\n 'show_in_menu' => $this->menu->getSlug()\n );\n\n register_post_type($slug, $args);\n $this->registerDefaultMetaBox($slug);\n }", "function register(Doku_Event_Handler $controller){\n $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'handle_toolbar', array ());\n }", "public static function register()\n\t{\n\t\tForm::extensionMethod('addTag', callback(__CLASS__, 'addTag'));\n\t}", "public function customize_register()\n {\n }", "public function customize_register()\n {\n }", "public function register()\n {\n $this->register_scripts($this->get_scripts());\n $this->register_styles($this->get_styles());\n }", "public function register() {\n\t\tadd_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );\n\t\tadd_action( 'wp_enqueue_scripts', [ $this, 'enqueue_styles' ] );\n\n\t\tadd_action( 'init', [ $this, 'init' ] );\n\t\tadd_action( 'admin_init', [ $this, 'admin_init' ] );\n\t}", "protected function registerPlugin()\n {\n $id = $this->options['id'];\n\n /** @var \\yii\\web\\AssetBundle $assetClass */\n $bundle = CoreAsset::register($this->view);\n $bundle->js[] = 'js/i18n/elfinder.' . $this->clientOptions['lang'] . '.js';\n\n $cleanOptions = Json::encode($this->clientOptions);\n $js[] = \"var elf = $('#$id').elfinder($cleanOptions).elfinder('instance');\";\n\n $this->view->registerJs(implode(\"\\n\", $js));\n }", "public function register() {\n\t\t$this->register_script();\n\t\t$this->register_style();\n\t\t$this->register_type();\n\t}", "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 }", "public function register()\n {\n\n add_action('plugins_loaded', array($this, 'load_plugin_textdomain'));\n add_action('after_setup_theme', array($this, 'load_theme_textdomain'));\n\n }", "public function register()\n {\n\n if( ! $this->activated( 'cf_manager' ) ) return;\n\n\n $this->settings = new SettingsApi();\n\n $this->callbacks = new AdminCallbacks();\n\n $this->cf_callbacks = new CfCallbacks();\n\n $this->setSubpages();\n\n $this->metaBoxes = array();\n\n\n $this->setSettings();\n $this->setSections();\n $this->setFields();\n\n\n $this->settings->addSubPages( $this->subpages )->register();\n\n\n $this->showPosts();\n\n if( ! empty( $this->metaBoxes ) ) {\n\n add_action( 'add_meta_boxes', array( $this, 'addMultipleMetaBoxes' ) );\n\n }\n\n }", "public function register(){\n add_action('admin_enqueue_scripts',array($this,'enqueue'));\n //load front end wp css & js\n add_action('wp_enqueue_scripts',array($this,'enqueue'));\n }", "public function _register()\n {\n }", "public function editorAction() {\n \n }", "public function loadRichTextEditor() {\n /* register JS scripts */\n $rte = isset($this->scriptProperties['which_editor']) ? $this->scriptProperties['which_editor'] : $this->modx->context->getOption('which_editor', '', $this->modx->_userConfig);\n \n $this->setPlaceholder('which_editor', $rte);\n /* Set which RTE if not core */\n if ($this->modx->context->getOption('use_editor', false, $this->modx->_userConfig) && !empty($rte)) {\n /* invoke OnRichTextEditorRegister event */\n $textEditors = $this->modx->invokeEvent('OnRichTextEditorRegister');\n $this->setPlaceholder('text_editors', $textEditors);\n\n $this->rteFields = array('exerplan-assessment-textarea');\n $this->setPlaceholder('replace_richtexteditor', $this->rteFields);\n\n /* invoke OnRichTextEditorInit event */\n $onRichTextEditorInit = $this->modx->invokeEvent('OnRichTextEditorInit', array(\n 'editor' => $rte,\n 'elements' => $this->rteFields,\n ));\n if (is_array($onRichTextEditorInit)) {\n $onRichTextEditorInit = implode('', $onRichTextEditorInit);\n $this->setPlaceholder('onRichTextEditorInit', $onRichTextEditorInit);\n }\n }\n }", "public function editor_enqueue()\n\t{\n\t\tadd_editor_style('assets/css/editor.css');\n\t}", "public function register(): void\n\t{\n\t\t\\add_action('login_enqueue_scripts', [$this, 'enqueueStyles']);\n\t\t\\add_action('admin_enqueue_scripts', [$this, 'enqueueStyles'], 50);\n\t\t\\add_action('admin_enqueue_scripts', [$this, 'enqueueScripts']);\n\t}", "public function register()\n\t\t{\n\t\t\tif( empty($this->_postType) ) {\n\t\t\t\twp_die( 'Empty metabox post type.' );\n\t\t\t}\n\n\t\t\t$all_empty = true;\n\n\t\t\tforeach( $this->getTabs() as $tab ) {\n\t\t\t\tif ( ! $this->_alwaysDisplay && $tab->getContainers()->size() == 0 ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach ( $tab->getContainers() as $container ) {\n\t\t\t\t\tif ( ! $this->_alwaysDisplay && $container->getFields()->size() == 0 ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$all_empty = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif( $all_empty ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$this->_id = \"metabox_{$this->_postType}_{$this->_slug}\";\n\n\t\t\tadd_meta_box(\n\t\t\t\t$this->_id,\n\t\t\t\t$this->_title,\n\t\t\t\tarray($this, 'render'),\n\t\t\t\t$this->_postType,\n\t\t\t\t$this->_position,\n\t\t\t\t$this->_priority\n\t\t\t);\n\n\t\t\tadd_action( 'admin_head', array($this, 'disableHideMetaboxes') );\n\t\t}", "public function register(): void {\n\t\tadd_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );\n\t\tadd_action( 'admin_notices', [ $this, 'render_notice' ] );\n\t\tadd_action( 'network_admin_notices', [ $this, 'render_notice' ] );\n\t}", "public function register()\n {\n parent::register();\n }", "public function register()\n {\n parent::register();\n }", "public function register()\n {\n parent::register();\n }", "public function register()\n {\n parent::register();\n }", "function register() {\n\tadd_action( 'admin_menu', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\add_menu' );\n\tadd_action( 'admin_init', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\action_handler' );\n\tadd_action( 'admin_enqueue_scripts', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\register_style' );\n\n\t\\Sgdd\\Admin\\SettingsPages\\Basic\\register();\n\t\\Sgdd\\Admin\\SettingsPages\\Advanced\\register();\n\t\\Sgdd\\Admin\\Editor\\register();\n}", "public static function onRichTextEditorFieldCreate($event)\r\n {\r\n\r\n if(static::validateEditorSender($event)) {\r\n $event->result .= widgets\\Editor::widget([\r\n 'richtextId' => $event->sender->id,\r\n 'record' => $event->sender->model\r\n ]);\r\n }\r\n }", "public static function register()\n\t{\n\t\tRichText_AdminModule::register();\n//\t\tRichText_FrontModule::register();\n\t}", "public function register(){\n add_filter('plugin_action_links_'.GAW_PLUGIN_NAME , [$this, 'addPluginLinks']);\n $this->activate();\n $admin = new AdminPages;\n $admin->addAdminMenu();\n $this->registerPostTypes();\n }", "public function registerClientScript() {\n\t\t$cs = Yii::app()->getClientScript();\n\t\t$cs->registerCoreScript('jquery');\n\t\t$asset_url = Yii::app()->assetManager->publish(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tiny_mce', false, -1, true);\n\t\t$cs->registerScriptFile(\"$asset_url/jquery.tinymce.js\", CClientScript::POS_END);\n\t\t$id = $this->htmlOptions['id'];\n\t\t$this->options = CMap::mergeArray($this->defaultOptions, $this->options);\n\t\t$this->options['script_url'] = \"$asset_url/tiny_mce.js\";\n\t\t$options = $this->options !== array() ? CJavaScript::encode($this->options) : '';\n\t\t$js =\"jQuery(\\\"#{$id}\\\").tinymce({$options});\";\n\t\t$cs->registerScript('KahWee.KRichTextEditor#' . $id, $js);\n\t}", "public function register() {\r\n $pages = [\r\n [\r\n 'page_title' => 'Inpsyde Plugin',\r\n 'menu_title' => 'Inpsyde',\r\n 'capability' => 'manage_options',\r\n 'menu_slug' => 'inpsyde_plugin',\r\n 'callback' => function() { \r\n echo ' <h1>Inpsyde plugin</h1>\r\n <div>\r\n <p>This plugin is now active.<br>\r\n It automatically initialized a script which calls API and creating table with data returned from json object.\r\n </p>\r\n </div>'; },\r\n 'icon_url' => 'dashicons-store',\r\n 'position' => 110\r\n ]\r\n // [\r\n // 'page_title' => 'Test Plugin',\r\n // 'menu_title' => 'Test',\r\n // 'capability' => 'manage_options',\r\n // 'menu_slug' => 'test_plugin',\r\n // 'callback' => function() { echo '<h1>External</h1>'; },\r\n // 'icon_url' => 'dashicons-external',\r\n // 'position' => 9\r\n // ]\r\n ];\r\n $this->settings->addPages( $pages )->register();\r\n }", "function register()\n {\n // Incluimos el widget en el panel control de Widgets\n wp_register_sidebar_widget( 'widget_ultimosp', 'Últimos post por autor', array( 'Widget_ultimosPostPorAutor', 'widget' ) );\n\n // Formulario para editar las propiedades de nuestro Widget\n wp_register_widget_control('widget_ultimos_autor', 'Últimos post por autor', array( 'Widget_ultimosPostPorAutor', 'control' ) );\n }", "public function register()\r\n\t{\r\n $namespace = FANCY_NAME;\r\n $wordpress = $this->app[\"$namespace.wordpress\"];\r\n\r\n if(Wordpress::available()) {\r\n \\Event::listen('fancy::scripts.initialize', function() use($wordpress) {\r\n global $pagenow;\r\n\r\n if(!($wordpress->is_admin() && ($pagenow === 'post.php' || $pagenow === 'post-new.php'))) return;\r\n\r\n return array(\r\n 'ace' => array(\r\n 'src' => 'public/packages/fancy/ace/js/vendor/ace/ace.js',\r\n 'in_admin' => true\r\n ),\r\n 'ace-textarea' => array(\r\n 'src' => 'public/packages/fancy/ace/js/vendor/jquery-ace-textarea.js',\r\n 'in_admin' => true\r\n ),\r\n\r\n 'fancy-ace' => array(\r\n 'src' => 'public/packages/fancy/ace/js/plugin.js',\r\n 'in_admin' => true\r\n )\r\n );\r\n });\r\n }\r\n\t}", "public static function register() {\n\t\t$plugin = new self();\n\n\t\tadd_action( 'network_admin_menu', [ $plugin, 'add_network_admin_pages' ] );\n\n\t\tadd_action( 'admin_menu', [ $plugin, 'add_admin_pages' ] );\n\n\t\tadd_action( 'admin_menu', [ $plugin, 'modify_admin_menu' ] );\n\t\tadd_action( 'edit_form_after_title', [ $plugin, 'print_meta_boxes_after_title' ], 0 );\n\n\t\tadd_action( 'load-comment.php', [ $plugin, 'manage_comments_page_access' ] );\n\t\tadd_action( 'load-edit-comments.php', [ $plugin, 'manage_comments_page_access' ] );\n\n\t\t// Enable when we need redirects.\n\t\t//add_action( 'admin_init', [ $plugin, 'download_redirects' ] );\n\n\t}", "public function registerPlugin()\n {\n global $elementIdIncrementForJs;\n $config = array_merge( $this->defaultClientOptions,$this->clientOptions);\n $config['uploadUrl'] = $this->uploadUrl;\n $config['el'] = '#'.$this->getElName() . ++$elementIdIncrementForJs;;\n if (($value = Html::getAttributeValue($this->model, $this->attribute)) != null) {\n $config['imageList'] = (array) $value;\n }\n\n $js = Json::encode($config);\n $this->getView()->registerJs('new ' . self::JS_CLASS_NAME . \"($js)\", View::POS_END);\n }", "public function register() {\n if( ! $this->activated( 'media_widget' ) ) return;\n\n $media_widget = new MediaWidget();\n $media_widget->register();\n }", "public static function register()\n {\n register_sidebar( array(\n 'name' => 'Widget Area 1',\n 'id' => 'widget_1',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>',\n ) );\n }", "function wp_enqueue_editor()\n {\n }", "public function subscribe()\r\n {\r\n /* Fire our meta box setup function on the post editor screen. */\r\n add_action('load-post.php', array(\r\n $this,\r\n 'setup'\r\n ));\r\n add_action('load-post-new.php', array(\r\n $this,\r\n 'setup'\r\n ));\r\n }", "public function register() {\n\t\tadd_action( 'plugins_loaded', [ $this, 'register_services' ] );\n\t\tadd_action( 'init', [ $this, 'register_assets_handler' ] );\n\t}", "public static function enqueue_default_editor()\n {\n }", "public function registerScripts()\n {\n $view = $this->getView();\n TemplateEditorAsset::register($view);\n $view->registerJs('\n $(\".connected\").sortable({connectWith: \".connected\"}).bind(\"sortupdate\", function(e, ui) {\n var item = $(ui.item);\n var input = item.find(\"input\");\n var parent = item.closest(\".block-position\");\n if (parent.length) {\n input.attr(\"name\", \"Template[positions][\"+parent.data(\"position\")+\"][]\");\n } else {\n input.attr(\"name\", \"Template[positions][' . Template::UNREGISTERED . '][]\");\n }\n }).click(function(e){\n e.preventDefault();\n });\n ', View::POS_END);\n }", "protected function registerEditorClientScript($writer)\n\t{\n\t\t$this->loadJavascriptLibrary();\n\t\t$scripts = $this->getPage()->getClientScript();\n\t\t$options = [\n\t\t\t'ID' => $this->getClientID(),\n\t\t\t'EditorOptions' => $this->getEditorOptions(),\n\t\t];\n\n\t\t$options = TJavaScript::encode($options, true, true);\n\t\t$script = \"new {$this->getClientClassName()}($options)\";\n\t\t$scripts->registerEndScript('prado:THtmlArea5' . $this->getClientID(), $script);\n\t}", "public function register()\n {\n //Menu菜单注册\n //钩子系统\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 }", "public function register(){}", "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 }", "public static function editor_js()\n {\n }", "public function register()\n {\n add_filter( 'upload_mimes', array( $this, 'add_custom_file_types_supprot' ) );\n\n // add svg support\n add_filter( 'wp_prepare_attachment_for_js', array( $this, 'add_svg_media_thumbnails' ), 10, 3 );\n\n // filter wordpress filetype security check\n add_filter('wp_check_filetype_and_ext', array( $this, 'wp_check_filetype_and_ext' ) , 5, 5);\n\n // Add Custom user fields to ccd_client user role\n add_action( 'show_user_profile', array( $this, 'add_custom_user_fields' ) );\n add_action( 'edit_user_profile', array( $this, 'add_custom_user_fields' ) );\n\n // handle custom user fields update / form post\n add_action( 'personal_options_update', array( $this, 'update_custom_user_fields' ) );\n add_action( 'edit_user_profile_update', array( $this, 'update_custom_user_fields' ) );\n }", "public function register()\n\t{\n\t\tadd_action(NextADInt_Adi_Ui_Actions::ADI_MENU_NETWORK_ADMIN_MENU, array($this, 'registerMenu'));\n\n\t\t$this->addAjaxListener($this->blogProfileRelationshipPage);\n\t\t$this->addAjaxListener($this->profileConfigurationPage);\n\t}", "public function register() {\r\n add_action('post_updated', array($this, 'save_meta'), null, 2 );\r\n\r\n $original_config = $this->get_config();\r\n // push it through a filter so a theme can change the terminology\r\n $filtered_config = apply_filters('ah-wp-dl-res-config',$original_config);\r\n register_post_type(self::POST_TYPE, $filtered_config);\r\n\r\n register_taxonomy(self::POST_TYPE . '_cat',\r\n array(self::POST_TYPE),\r\n array('hierarchical' => true,\r\n 'labels' => array(\r\n 'name' => __( 'Categories' ),\r\n 'singular_name' => __( 'Category' ),\r\n 'search_items' => __( 'Search Categories' ),\r\n 'all_items' => __( 'All Categories' ),\r\n 'parent_item' => __( 'Parent Category' ),\r\n 'parent_item_colon' => __( 'Parent Category:' ),\r\n 'edit_item' => __( 'Edit Category' ),\r\n 'update_item' => __( 'Update Category' ),\r\n 'add_new_item' => __( 'Add New Category' ),\r\n 'new_item_name' => __( 'New Category Name')\r\n ),\r\n 'show_ui' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array( 'slug' => 'documents/categories' ),\r\n )\r\n );\r\n }", "public function register()\n {\n // TODO: Implement register() method.\n }", "public function register()\n {\n // TODO: Implement register() method.\n }", "public function registerEvents()\n {\n if (!empty($this->clientEvents)) {\n $js = [];\n foreach ($this->clientEvents as $event => $handle) {\n $handle = new JsExpression($handle);\n $js[] = \"$({$this->var}).on('{$event}', {$handle});\";\n }\n $this->getView()->registerJs(implode(PHP_EOL, $js));\n }\n }", "public static function register() {\n\t\tstatic::registerStyles();\n\t\tstatic::registerScripts();\n\t\tstatic::registerDOM();\n\t}", "public function register() {}", "public function register()\n {\n $args = apply_filters( $this->name.'_post_type_config', $this->config );\n $args['labels'] = apply_filters( $this->name.'_post_type_labels', $this->labels);\n\n register_post_type( $this->name, $args );\n }", "public function register()\n {\n foreach ($this->shortcodes as $shortcode) {\n $this->registerInWordpress($shortcode);\n }\n }", "public function register()\n {\n $target = $this->app->make('Anomaly\\Streams\\Platform\\Application\\Application')->getAssetsPath(\n 'editor-field_type'\n );\n\n /*\n * If the Ace assets don't exist then\n * copy them all over there.\n */\n if (!is_dir($target)) {\n\n /* @var Filesystem $files */\n $files = $this->app->make('files');\n\n $files->copyDirectory($this->addon->getPath('resources/js/ace'), $target);\n }\n }", "public function run()\n {\n //\n $editorList = config('editors');\n\n foreach ($editorList as $editor) {\n $neweditor = new Editor();\n $neweditor->name = $editor['name'];\n $neweditor->lastName = $editor['lastName'];\n $neweditor->save();\n }\n }", "public function editor_assets() {\n\n\t\tif ( ! is_admin() ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( ! $this->is_edit_or_new_admin_page() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Styles.\n\t\twp_register_style(\n\t\t\t$this->slug . '-editor',\n\t\t\t$this->url . '/build/editor.build.css',\n\t\t\tarray(),\n\t\t\tPOSTSLISTBLOCK_VERSION\n\t\t);\n\n\t\t// Scripts.\n\t\twp_register_script(\n\t\t\t$this->slug . '-editor',\n\t\t\t$this->url . '/build/index.js',\n\t\t\tarray( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-plugins', 'wp-components', 'wp-edit-post', 'wp-api', 'wp-rich-text', 'wp-editor' ),\n\t\t\tPOSTSLISTBLOCK_VERSION,\n\t\t\tfalse\n\t\t);\n\n\t}", "public function register(): void;", "public function onInitEditor()\n\t{\n\t\tif (self::$pushscripts)\n\t\t{\n\t\t\t$this->css();\n\t\t\t$this->js();\n\n\t\t\tself::$pushscripts = false;\n\t\t}\n\n\t\treturn '';\n\t}", "public function onRegister();", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register() {\n\t\t$theme = $this->theme_args;\n\n\t\tif ( empty( $theme['name'] ) || empty( $theme['slug'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$page_title = $theme['name'] . ' ' . __( 'Options', 'neve' ) . ' ';\n\t\t$menu_name = $theme['name'] . ' ' . __( 'Options', 'neve' ) . ' ';\n\n\t\t$theme_page = ! empty( $theme['template'] ) ? $theme['template'] . '-welcome' : $theme['slug'] . '-welcome';\n\t\tadd_theme_page( $page_title, $menu_name, 'activate_plugins', $theme_page, [ $this, 'render' ] );\n\t}", "public function onLoad() {\nglobal $_LW;\nif ($_LW->page=='events_edit' || $_LW->page=='events_sub_edit') { // if on the events editor page\n\t//$_LW->REGISTERED_CSS[]='/path/to/custom/stylesheet.css'; // load in some custom CSS for styling the new field (optional)\n\t$_LW->ENV->input_filter['events_edit']['sample_textarea']=['tags'=>'*', 'wysiwyg'=>1]; // configure the input filter to present the textarea custom field as a WYSIWYG field (omit this line entirely for no HTML allowed, or change \"wysiwyg\" to \"wysiwyg_limited\" for the limited set of toolbar options)\n};\n}", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function _register_widgets()\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 register() {\n\t\t$this->container['assets'] = $assets = plugins_url( '/assets', $this->container['root-file'] );\n\t\t$this->container['node-modules'] = $nodeModules = plugins_url( '/node_modules', $this->container['root-file'] );\n\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'registerScripts' ) );\n\t}", "public static function register()\n {\n }", "public function init(){\n parent::init();\n $this->_editor = $this->_helper->layoutEditor();\n }" ]
[ "0.6936478", "0.67853326", "0.6771", "0.6604354", "0.6478165", "0.6296992", "0.62307954", "0.6217154", "0.6162194", "0.61359113", "0.609412", "0.6071198", "0.6049939", "0.6022369", "0.6007299", "0.6007299", "0.60063386", "0.59702545", "0.59679234", "0.5952384", "0.5922377", "0.5914333", "0.589961", "0.5895235", "0.5879439", "0.5879004", "0.58740324", "0.5854895", "0.5852537", "0.58388513", "0.5835261", "0.5796684", "0.5796684", "0.5796684", "0.5796684", "0.5794233", "0.5787722", "0.5787336", "0.5782", "0.5779892", "0.57786083", "0.5773224", "0.577269", "0.5763907", "0.57600963", "0.5753176", "0.57476884", "0.5731256", "0.57252884", "0.57219523", "0.5718691", "0.569736", "0.56824124", "0.56793696", "0.5663642", "0.5652802", "0.56512237", "0.56428486", "0.5641858", "0.5628869", "0.5626767", "0.5615698", "0.5615698", "0.55948406", "0.5590028", "0.55827445", "0.55811083", "0.55778927", "0.55687493", "0.5565852", "0.55616605", "0.5557784", "0.55460787", "0.5544769", "0.554073", "0.554073", "0.554073", "0.554073", "0.554073", "0.55305356", "0.55305356", "0.55305356", "0.55305356", "0.55305356", "0.55305356", "0.55305356", "0.55305356", "0.55243194", "0.55086523", "0.5506213", "0.5506213", "0.5506213", "0.5506213", "0.5506213", "0.5486068", "0.5486068", "0.54851604", "0.54836315", "0.5479986", "0.547258", "0.54615366" ]
0.0
-1
Add New User Type
public function add_usertype() { $arr['active'] = 'user'; $arr['page'] = 'role'; $arr['id'] = 0; if($this->input->post('addrole')){ $this->form_validation->set_rules('userrole', 'User Role', 'required'); $this->form_validation->set_rules('userrolealias', 'User Role Alias', 'required'); if($this->form_validation->run() == FALSE) { $arr['error'] = validation_errors(); $this->load->view('vwAddUserType',$arr); }else{ $userrole = $this->input->post('userrole'); $alias = $this->input->post('userrolealias'); $roletype = $this->input->post('roletype'); $data['role_name'] = $userrole; $data['role_alias'] = $alias; $data['role_type'] = $roletype; if($this->input->post('id')){ $this->setting->updaterole($data); $this->session->set_flashdata('rolemsg', '<div class="alert alert-success alert-dismissible text-center"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>User Role Updated Successfully!!!</div>'); }else{ $this->setting->addrole($data); $this->session->set_flashdata('rolemsg', '<div class="alert alert-success alert-dismissible text-center"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>User Role Added Successfully!!!</div>'); } redirect('settings/userrole'); } }else{ $this->load->view('vwAddUserType',$arr); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add($userid, $type)\r\n {\r\n $getInfo = $this->get($userid);\r\n\r\n $getInfo[$type] = $type;\r\n\r\n $this->update($userid, $getInfo);\r\n }", "public function addType($type);", "public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}", "public function setUserType($type)\n\t{\n\t\t$this->type = $type;\n\t}", "function tutor_assignment_add($username, $type) {\n $type = rtrim($type, \"s\");\n\n $title = \"Add a $type to $username\";\n drupal_set_title($title);\n $output = \"<h2>$title</h2>\";\n\n $user = eto_user_load(array('name' => $username));\n\n $node = (object) array ('uid' => $user->uid,\n\t\t\t 'type' => $type);\n\n $output .= drupal_get_form('add_assignment_form', $node);\n\n return $output;\n}", "private function createUser($type='') {\n return $this->ec->createUser($type);\n }", "public function addFeedType ($type)\n\t{\n\t\t$Statement = $this->Database->prepare(\"UPDATE users SET hp_feed_type = ? WHERE id = ?\");\n\t\t$Statement->execute(array($type, $this->id));\n\t}", "function setUserType($username = NULL,$userType = NULL)\n\t\t{\n\t\t\t$sSQL\t=\t\"UPDATE tbl_member set member_type = '\" . $userType . \"' \n\t\t\tWHERE user_name = '\" . $username . \"'\";\n\t\t\t$response = $this->Execute($sSQL);\n\t\t\treturn $response;\t\t\n\t\t}", "public function run()\n {\n $default = [\n ['type' => 'Super Admin'], \n ['type' => 'Admin'], \n ['type' =>'Director'], \n ['type' =>'Department Head'], \n ['type' =>'Group Leader'],\n ['type' =>'Developer']\n ];\n\n foreach ($default as $key => $value) {\n UserType::create($value);\n }\n }", "public function add_user($user_type = 'business_basic') {\n\t\t\t $data['pageName'] = $this->pageName . ' : Add User';\n\n\t\t\t $page = \"add_view_basic\";\n\t\t\t $type = \"Business Basic\";\n\n\t\t\t\tif( $user_type == 'business_pro' ){\n\t\t\t\t\t$page = \"add_view_pro\";\n\t\t\t\t\t$type = \"Business Pro\";\n\t\t\t\t\t$data['plan_list'] = $this->Common_model->get_plan_list();\n\t\t\t\t\t}\n\t\t\t\t\telseif($user_type == 'end_user'){\n\t\t\t\t\t\t\t $page = \"add_view_end_user\";\n\t\t\t\t\t\t\t $type = \"End\";\n\t\t\t\t\t\t\t }\n\n\t\t\t $data['pageName'] = $this->pageName . ' : Add '.$type.' User';\n\t\t\t $data['countryList'] = $this->Common_model->get_countries(); // echo \"<pre>\"; print_r($data); exit;\n\t\t\t $this->load->view('admin/user/'.$page, $data); \n }", "public function getUserType();", "public function getUserType();", "public function addUser(){}", "function add_id_type()\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['created_on']\t\t\t\t= \ttime();\n\t\t$data['created_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\t\t$data['timestamp']\t\t\t\t= \ttime();\n\t\t$data['updated_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\n\t\t$this->db->insert('id_type', $data);\n\n\t\t$this->session->set_flashdata('success', 'New ID type has been added successfully.');\n\n\t\tredirect(base_url() . 'id_type_settings', 'refresh');\n\t}", "function node_add($type) {\n global $user;\n\n $types = node_get_types();\n $type = isset($type) ? str_replace('-', '_', $type) : NULL;\n // If a node type has been specified, validate its existence.\n if (isset($types[$type]) && node_access('create', $type)) {\n // Initialize settings:\n $node = array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => '');\n\n drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)));\n $output = drupal_get_form($type .'_node_form', $node);\n }\n\n return $output;\n}", "public function addType()\r\n\t{\r\n\t\tif(isset($_SESSION['auth']) && $_SESSION['users']['niveau'] == 3){\r\n\t\tif(isset($_POST['dataF'])){\r\n\t\t\t$spe = str_replace('&', '=', $_POST['dataF']);\r\n\t\t\t$data = $this->convertArray($spe);\r\n\t\t\t//print_r($data);die();\r\n\t\t\t$spec = $this->model('type');\r\n\t\t\t$id = $spec->addType($data);\r\n\t\t\tif($id){\r\n\t\t\t\techo json_encode(['SUCCESS'=>true]);\r\n\t\t\t}else{\r\n\t\t\t\techo json_encode(['SUCCESS'=>true]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t}else{\r\n\t\t\t$this->view('login',['page'=>'Speciality','msg'=>'you should to connect first']);\r\n\t\t}\r\n\t}", "public function create()\n {\n return view('user-type.create');\n }", "public function getType()\n {\n return \"user\";\n }", "public function AddType($type) {\n $this->Types[] = $type;\n }", "function add_user ($User_name, $User_password, $User_email, $user_type)\n\t{\n\t\tglobal $conn;\n\n $sql_i = \"INSERT INTO login_db(user_name, user_password, user_email, user_type) VALUES \" .\n \"('$User_name', '$User_password', '$User_email', '$user_type')\";\n\n run_update($sql_i);\n\t}", "public function setUserType($userType)\n {\n $this->userType = $userType;\n return $this;\n }", "public function setUserType($userType)\n {\n $this->userType = $userType;\n return $this;\n }", "public function run()\n {\n SportsUserTypes::create(\n ['user_type'=>'Coach']);\n \n SportsUserTypes::create(\n ['user_type'=>'Athlete']);\n }", "public function run()\n {\n \t$userTypeObject = new UserType;\n\n \t$riderUserTypeParameters['user_type_label'] = 'RIDER';\n \t$riderUserType = $userTypeObject->create($riderUserTypeParameters);\n\n \t$driverUserTypeParameters['user_type_label'] = 'DRIVER';\n \t$drivereUserType = $userTypeObject->create($driverUserTypeParameters);\n\n $driverUserTypeParameters['user_type_label'] = 'TRAVEL NETWORK COMPANY';\n $drivereUserType = $userTypeObject->create($driverUserTypeParameters);\n\n $driverUserTypeParameters['user_type_label'] = 'ADMIN';\n $drivereUserType = $userTypeObject->create($driverUserTypeParameters);\n\n\n }", "public function __construct($user_type)\n {\n $this->user_type = $user_type;\n }", "public function getName()\n {\n return 'user_type';\n }", "public function addUser(){\n\t}", "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 }", "function updateMemberType($userId, $userType) {\r\n $sql = $this->db->prepare(\"UPDATE USER SET type=:user_type WHERE UserID=:user_id\");\r\n $sql->execute(array(\r\n 'user_type' => $userType,\r\n 'user_id' => $userId,\r\n ));\r\n return true;\r\n }", "public function setType($playerType) {\n\t\tConnectionFactory::updateTableRowAbsoluteBasic(\"users\", array('type' => $playerType),\n\t\tarray('id'=>$this->id));\n\t\t$this->type = $playerType;\n\t}", "public function run()\n {\n \t$names = ['Administrator','Teacher','Student'];\n \tforeach($names as $name){\n \t\t$type = new UserType();\n \t\t$type->name = $name;\n \t\t$type->save();\n \t}\n }", "public function creating(User $user)\n {\n $user->type = strlen($user->cpf_cnpj) == 14 ? 'personal' : 'business';\n }", "abstract public function register_type();", "public function addCalendarType ($type)\n\t{\n\t\t$Statement = $this->Database->prepare(\"UPDATE users SET hp_calendar_type = ? WHERE id = ?\");\n\t\t$Statement->execute(array($type, $this->id));\n\t}", "public function setUserType($user_type)\n {\n $this->user_type = $user_type;\n return $this;\n }", "public function create($type, $data, $userId);", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public function add_user ($first,$last,$phone,$email,$username,$password,$type) {\r\n $stmt = $this->DB->prepare(\"INSERT INTO users values(NULL, :username, :firstname, :lastname, :phone, :email, :password, now(),'$type')\");\r\n $stmt->bindParam( 'username', $username );\r\n $stmt->bindParam( 'firstname', $first );\r\n $stmt->bindParam( 'lastname', $last );\r\n $stmt->bindParam( 'phone', $phone );\r\n $stmt->bindParam( 'email', $email );\r\n\t $stmt->bindParam( 'password', $password );\r\n $stmt->execute();\r\n }", "function addnewuser() {\n \t\t\t$this->set('GetUserQ', $this->Users->GetUsers(0));\n \t\t\t$this->set('GetLevelsQ', $this->AccessLevels->index());\n \t\t}", "public function create()\n {\n $types = [];\n $data = $this->type->orderBy('name', 'asc')->get();\n foreach ($data as $item) {\n $types[$item->id] = $item->name; \n }\n\n return view('users.create', compact('types'));\n }", "public function create()\n {\n $types = Type::all();\n return view('users.create',['types' => $types]);\n }", "public function setUserType($userType)\n {\n $this->userType = $userType;\n\n return $this;\n }", "function getType()\n {\n return self::TYPE_USER;\n }", "public function saveUserType($Input=array()) {\r\n\t\t$GetGUID = get_guid();\r\n\r\n\t\t$InsertData = array_filter(array(\r\n\t\t\t\"UserTypeGUID\"\t\t\t=>\t$GetGUID,\r\n\t\t\t\"UserTypeName\" \t\t\t=>\t$Input['GroupName'],\r\n\t\t\t\"IsAdmin\" \t\t\t\t=>\t(!empty($Input['IsAdmin']) ? \"Yes\" : \"No\")\r\n\t\t));\r\n\t\tif(!empty($InsertData)){\r\n\t\t\t$Query \t\t= $this->db->insert('tbl_users_type', $InsertData);\r\n\t\t\treturn array('UserTypeID' => $this->db->insert_id(), 'UserTypeGUID' => $GetGUID);\r\n\t\t}\t\t\r\n\t\treturn false;\r\n\t}", "protected function setUser($user, $type) {\n\t\t$id = 0;\n\t\tif($user === true) $user = $this->wire('user');\n\t\tif(is_object($user)) {\n\t\t\tif($user instanceof NullPage) {\n\t\t\t\t$id = 0;\n\t\t\t} else if($user instanceof User) {\n\t\t\t\t$id = $user->isGuest() ? 0 : $user->id;\n\t\t\t}\n\t\t} else if(is_int($user)) {\n\t\t\t$id = $user;\n\t\t} else if(ctype_digit($user)) {\n\t\t\t$id = (int) $user;\n\t\t} else if(is_string($user)) {\n\t\t\t$name = $this->wire('sanitizer')->pageName($user);\n\t\t\t$user = $name ? $this->wire('users')->get(\"name=$name\") : null; \n\t\t\t$id = $user && $user->id ? $user->id : 0;\n\t\t}\n\t\tif($id < 0) $id = 0;\n\t\tif(strpos($type, 'created') === 0) {\n\t\t\t$this->_createdUser = ($id && $user instanceof User ? $user : null);\n\t\t\tparent::set('created_users_id', $id); \n\t\t} else if(strpos($type, 'modified') === 0) {\n\t\t\t$this->_modifiedUser = ($id && $user instanceof User ? $user : null);\n\t\t\tparent::set('modified_users_id', $id); \n\t\t}\n\t}", "public function run()\n {\n UserType::create([\n 'id' => 1,\n 'title' => 'SUPER ADMIN',\n 'status' => Constant::STATUS_INTEGER_ACTIVE\n ]);\n UserType::create([\n 'id' => 2,\n 'title' => 'User',\n 'status' => Constant::STATUS_INTEGER_ACTIVE\n ]);\n }", "public function create()\n {\n $user_types = DB::table(\"user_types\")->where(\"id\",\"!=\",6)->get();\n return view('users.create')->with(\"user_types\",$user_types);\n }", "public function run()\n {\n UserAccountType::create(['account_type' => 'email']);\n UserAccountType::create(['account_type' => 'facebook']);\n UserAccountType::create(['account_type' => 'google']);\n UserAccountType::create(['account_type' => 'twitter']);\n }", "function create() \n {\n $api = new Module_UserManagement_API();\n\n $user_types = $api->getExerciseTypes();\n\n $form = new AddUserForm();\n if ($form->validate()) {\n $userid = $form->getSubmitValue('login');\n $password = $form->getSubmitValue('password');\n $coach = $form->getSubmitValue('coach');\n $athlete = $form->getSubmitValue('athlete');\n $usertype = $form->getSubmitValue('usertype');\n\n $success = $api->createUser($userid, $password, \n $coach, $athlete, $usertype);\n if ($success) {\n /* We have sucessfully logged in, now lets \n * display the next page */\n /*\n if (!isset($redirect_module) || !isset($redirect_action)) {\n $redirect_module = 'Sessions';\n }\n\n Core_Url::redirectToUrl($urlToRedirect);\n */\n }\n }\n\n $view = Core_View::factory('adduser');\n //$view->users = $users;\n $view->addForm($form);\n $view->subTemplate = 'genericForm.tpl';\n\n /* Coach radio buttons */\n $view->assign('coach_types', array('y' => 'Yes',\n 'n' => 'No'));\n $view->assign('coach_selected', 'n');\n\n /* Athlete radio buttons */\n $view->assign('athlete_types', array('y' => 'Yes',\n 'n' => 'No'));\n $view->assign('athlete_selected', 'n');\n\n /* Athlete radio buttons */\n $view->assign('usertype_types', array('user' => 'User',\n 'superuser' => 'SuperUser'));\n $view->assign('usertype_selected', 'user');\n\n echo $view->render();\n }", "public function create($type)\n {\n //\n }", "function appendUserFieldDecl($name, $type, $value) {\r\n\t\t$newNode = new UserFieldDecl($this->domFragment);\r\n\t\t$ret = false;\r\n\t\tswitch ($type) {\r\n\t\t\tcase 'string': \r\n\t\t\t\t$newNode->setStringValue(value);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault :\r\n\t\t\t\t$ret = false;\r\n\t\t}\r\n\t\t$newNode->setName($name);\t \t\t\r\n\t\tif (isset($newNode) && $newNode != NULL) {\r\n\t\t\t$this->root->appendChild($newNode->getDocumentFragment);\r\n\t\t\t$ret = true;\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "public static function add_new_login_type($data)\n\t {\n\t \t$social = new SocialAccount();\n\n\t \t$social->user_id = $data['user_id'];\n\t \t$social->provider_user_id = $data['provider_user_id'];\n\t \t$social->provider = $data['provider'];\n\t \t$social->created_at = new \\DateTime;\n\t \t$social->updated_at = new \\DateTime;\n\n\t \t$social->save();\n\n\t \treturn $social;\n\n\t }", "public function GetUserType(){\n\t\treturn $this->user_type;\n }", "public function edit(UserType $userType)\n {\n //\n }" ]
[ "0.7174577", "0.7076226", "0.70755166", "0.6901822", "0.68382436", "0.6804405", "0.67687404", "0.670932", "0.6685542", "0.66660106", "0.6600197", "0.6600197", "0.6598333", "0.6590298", "0.6583874", "0.65377635", "0.6505242", "0.6478808", "0.64220554", "0.64064217", "0.6391997", "0.6391997", "0.63878626", "0.6379135", "0.6353278", "0.63522625", "0.6341908", "0.6334566", "0.6327283", "0.6308942", "0.6289062", "0.6286866", "0.6279294", "0.627756", "0.62741864", "0.6262944", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6259335", "0.6238433", "0.6233514", "0.62305295", "0.6229301", "0.6221332", "0.62145203", "0.6211813", "0.61911494", "0.616395", "0.61605227", "0.6141166", "0.6130215", "0.6121915", "0.6121033", "0.60995984", "0.60973763", "0.60889643" ]
0.0
-1
End Add New User Type Edit User Type
public function edit_usertype($id) { $arr['page'] = 'role'; $arr['id'] = $id; $query = $this->setting->getusertypebyid($id); $arr['userrole'] = $query['role_name']; $arr['userrolealias'] = $query['role_alias']; $arr['roletype'] = $query['role_type']; $this->load->view('vwAddUserType',$arr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(UserType $userType)\n {\n //\n }", "public function edit(type_of_user $type_of_user)\n {\n //\n }", "private function _addOrEdit($user,$type= 'add') {\n \n $user_id = $user['id'];\n\n //Get the creator's id\n if(isset($this->request->data['user_id'])){\n if($this->request->data['user_id'] == '0'){ //This is the holder of the token - override '0'\n $this->request->data['user_id'] = $user_id;\n }\n }\n\n $check_items = array(\n\t\t\t'available_to_siblings',\n\t\t\t'suffix_permanent_users',\n\t\t\t'suffix_vouchers',\n 'suffix_devices'\n\t\t);\n\t\t\n foreach($check_items as $i){\n if(isset($this->request->data[$i])){\n $this->request->data[$i] = 1;\n }else{\n $this->request->data[$i] = 0;\n }\n }\n \n if($type == 'add'){ \n $entity = $this->{$this->main_model}->newEntity($this->request->data());\n }\n \n if($type == 'edit'){\n $entity = $this->{$this->main_model}->get($this->request->data['id']);\n $this->{$this->main_model}->patchEntity($entity, $this->request->data());\n }\n \n if ($this->{$this->main_model}->save($entity)) {\n $this->set(array(\n 'success' => true,\n '_serialize' => array('success')\n ));\n } else {\n $message = 'Error';\n \n $errors = $entity->errors();\n $a = [];\n foreach(array_keys($errors) as $field){\n $detail_string = '';\n $error_detail = $errors[$field];\n foreach(array_keys($error_detail) as $error){\n $detail_string = $detail_string.\" \".$error_detail[$error]; \n }\n $a[$field] = $detail_string;\n }\n \n $this->set(array(\n 'errors' => $a,\n 'success' => false,\n 'message' => array('message' => __('Could not create item')),\n '_serialize' => array('errors','success','message')\n ));\n }\n\t}", "function tutor_assignment_add($username, $type) {\n $type = rtrim($type, \"s\");\n\n $title = \"Add a $type to $username\";\n drupal_set_title($title);\n $output = \"<h2>$title</h2>\";\n\n $user = eto_user_load(array('name' => $username));\n\n $node = (object) array ('uid' => $user->uid,\n\t\t\t 'type' => $type);\n\n $output .= drupal_get_form('add_assignment_form', $node);\n\n return $output;\n}", "public function add_user($user_type = 'business_basic') {\n\t\t\t $data['pageName'] = $this->pageName . ' : Add User';\n\n\t\t\t $page = \"add_view_basic\";\n\t\t\t $type = \"Business Basic\";\n\n\t\t\t\tif( $user_type == 'business_pro' ){\n\t\t\t\t\t$page = \"add_view_pro\";\n\t\t\t\t\t$type = \"Business Pro\";\n\t\t\t\t\t$data['plan_list'] = $this->Common_model->get_plan_list();\n\t\t\t\t\t}\n\t\t\t\t\telseif($user_type == 'end_user'){\n\t\t\t\t\t\t\t $page = \"add_view_end_user\";\n\t\t\t\t\t\t\t $type = \"End\";\n\t\t\t\t\t\t\t }\n\n\t\t\t $data['pageName'] = $this->pageName . ' : Add '.$type.' User';\n\t\t\t $data['countryList'] = $this->Common_model->get_countries(); // echo \"<pre>\"; print_r($data); exit;\n\t\t\t $this->load->view('admin/user/'.$page, $data); \n }", "public function addType()\r\n\t{\r\n\t\tif(isset($_SESSION['auth']) && $_SESSION['users']['niveau'] == 3){\r\n\t\tif(isset($_POST['dataF'])){\r\n\t\t\t$spe = str_replace('&', '=', $_POST['dataF']);\r\n\t\t\t$data = $this->convertArray($spe);\r\n\t\t\t//print_r($data);die();\r\n\t\t\t$spec = $this->model('type');\r\n\t\t\t$id = $spec->addType($data);\r\n\t\t\tif($id){\r\n\t\t\t\techo json_encode(['SUCCESS'=>true]);\r\n\t\t\t}else{\r\n\t\t\t\techo json_encode(['SUCCESS'=>true]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t}else{\r\n\t\t\t$this->view('login',['page'=>'Speciality','msg'=>'you should to connect first']);\r\n\t\t}\r\n\t}", "public function edit(Type $type)\n {\n //\n }", "public function edit(Type $type)\n {\n //\n }", "public function edit(Type $type)\n {\n //\n }", "public function setUserType($type)\n\t{\n\t\t$this->type = $type;\n\t}", "function testCRUDUI() {\n $this->drupalLogin($this->rootUser);\n\n // Create a new profile type.\n $this->drupalGet('admin/config/people/profiles/types');\n $this->clickLink(t('Add profile type'));\n $this->assertUrl('admin/config/people/profiles/types/add');\n $id = Unicode::strtolower($this->randomMachineName());\n $label = $this->randomString();\n $edit = [\n 'id' => $id,\n 'label' => $label,\n ];\n $this->drupalPostForm(NULL, $edit, t('Save'));\n $this->assertUrl('admin/config/people/profiles/types');\n $this->assertRaw(format_string('%label profile type has been created.', ['%label' => $label]));\n $this->assertLinkByHref(\"admin/config/people/profiles/types/manage/$id\");\n $this->assertLinkByHref(\"admin/config/people/profiles/types/manage/$id/fields\");\n $this->assertLinkByHref(\"admin/config/people/profiles/types/manage/$id/display\");\n $this->assertLinkByHref(\"admin/config/people/profiles/types/manage/$id/delete\");\n\n // Edit the new profile type.\n $this->drupalGet(\"admin/config/people/profiles/types/manage/$id\");\n $this->assertRaw(format_string('Edit %label profile type', ['%label' => $label]));\n $edit = [\n 'registration' => 1,\n ];\n $this->drupalPostForm(NULL, $edit, t('Save'));\n $this->assertUrl('admin/config/people/profiles/types');\n $this->assertRaw(format_string('%label profile type has been updated.', ['%label' => $label]));\n\n // Add a field to the profile type.\n $this->drupalGet(\"admin/config/people/profiles/types/manage/$id/fields/add-field\");\n $field_name = Unicode::strtolower($this->randomMachineName());\n $field_label = $this->randomString();\n $edit = [\n 'new_storage_type' => 'string',\n 'label' => $field_label,\n 'field_name' => $field_name,\n ];\n $this->drupalPostForm(NULL, $edit, t('Save and continue'));\n $this->drupalPostForm(NULL, [], t('Save field settings'));\n $this->drupalPostForm(NULL, [], t('Save settings'));\n $this->assertUrl(\"admin/config/people/profiles/types/manage/$id/fields\", [\n 'query' => [\n 'field_config' => \"profile.$id.field_$field_name\",\n 'destinations[0]' => \"admin/config/people/profiles/types/manage/$id/fields/add-field\",\n ]\n ]);\n $this->assertRaw(format_string('Saved %label configuration.', ['%label' => $field_label]));\n\n // Rename the profile type ID.\n $this->drupalGet(\"admin/config/people/profiles/types/manage/$id\");\n $new_id = Unicode::strtolower($this->randomMachineName());\n $edit = [\n 'id' => $new_id,\n ];\n $this->drupalPostForm(NULL, $edit, t('Save'));\n $this->assertUrl('admin/config/people/profiles/types');\n $this->assertRaw(format_string('%label profile type has been updated.', ['%label' => $label]));\n $this->assertLinkByHref(\"admin/config/people/profiles/types/manage/$new_id\");\n $this->assertNoLinkByHref(\"admin/config/people/profiles/types/manage/$id\");\n $id = $new_id;\n\n // Verify that the field is still associated with it.\n $this->drupalGet(\"admin/config/people/profiles/types/manage/$id/fields\");\n // @todo D8 core: This assertion fails for an unknown reason. Database\n // contains the right values, so field_attach_rename_bundle() works\n // correctly. The pre-existing field does not appear on the Manage\n // fields page of the renamed bundle. Not even flushing all caches\n // helps. Can be reproduced manually.\n //$this->assertText(check_plain($field_label));\n }", "public function add($userid, $type)\r\n {\r\n $getInfo = $this->get($userid);\r\n\r\n $getInfo[$type] = $type;\r\n\r\n $this->update($userid, $getInfo);\r\n }", "function add_id_type()\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['created_on']\t\t\t\t= \ttime();\n\t\t$data['created_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\t\t$data['timestamp']\t\t\t\t= \ttime();\n\t\t$data['updated_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\n\t\t$this->db->insert('id_type', $data);\n\n\t\t$this->session->set_flashdata('success', 'New ID type has been added successfully.');\n\n\t\tredirect(base_url() . 'id_type_settings', 'refresh');\n\t}", "public function actionComplaintUserType()\n {\n\n if (Yii::$app->request->post('hasNew')) {\n $model = new ComplaintUserType();\n $model->load(Yii::$app->request->post());\n\n $model->created_by = Yii::$app->user->identity->id;\n $hasError = true;\n if($model->save()) {\n $hasError = false;\n }\n echo Json::encode(['hasError'=>$hasError]);\n return;\n }\n\n if (Yii::$app->request->post('hasEditable')) {\n $id = Yii::$app->request->post('editableKey');\n $model = ComplaintUserType::findOne($id);\n $message = '';\n\n $post = [];\n $posted = current($_POST['ComplaintUserType']);\n $post['ComplaintUserType'] = $posted;\n\n if ($model->load($post)) {\n if(!$model->save())\n $message = ' ';\n }\n echo Json::encode(['output'=>'', 'message'=>$message]);\n return;\n }\n\n if (Yii::$app->request->get('hasToggle')) {\n $state = Yii::$app->request->get('state');\n $id = Yii::$app->request->get('id');\n $saved = false;\n if(isset($state) && isset($id)) {\n $model = ComplaintUserType::findOne($id);\n $model->deleted = ($state == 'true')?0:1;\n if($model->save()){\n $saved = true;\n }\n }\n echo Json::encode(['saved'=>$saved]);\n return;\n }\n\n $dataProvider = new ActiveDataProvider([\n 'pagination' => array('pageSize' => 5),\n 'query' => ComplaintUserType::find()->orderby('name ASC'),\n 'sort' => false\n ]);\n\n $model = new ComplaintUserType();\n\n\n return $this->render('complaint_user_type', [\n 'dataProvider' => $dataProvider,\n 'model' => $model\n ]);\n }", "public function actionSetTypeUsers()\n {\n if (count($_GET) > 0) {\n foreach ($_GET as $userID => $typeValue) {\n $userID = intval($userID);\n\n //check input data\n if ($userID == 0 || !isset($this->userTypes[$typeValue])) {\n $this->redirect('/admin?tab=user_type_mgmt');\n die;\n }\n\n $typeValue = $this->userTypes[$typeValue];\n\n // get user\n $user = Users::model()->findByPk($userID);\n\n\n if ($typeValue == 'DB Admin') {\n //we need to check it\n\n //if current user is\n if (Yii::app()->user->id == 'admin') {\n Yii::app()->user->setFlash('error', \"Admin can't change his user type to 'DBAdmin'\");\n } else {\n $user->User_Type = $typeValue;\n $user->save();\n Yii::app()->user->setFlash('success', \"Users' types have been successfully updated!\");\n }\n } else {\n $user->User_Type = $typeValue;\n $user->save();\n Yii::app()->user->setFlash('success', \"Users' types have been successfully updated!\");\n }\n\n\n\n\n }\n\n\n } else {\n Yii::app()->user->setFlash('success', \"You don't choose the users!\");\n }\n $this->redirect('/admin?tab=user_type_mgmt');\n }", "public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}", "public function addFeedType ($type)\n\t{\n\t\t$Statement = $this->Database->prepare(\"UPDATE users SET hp_feed_type = ? WHERE id = ?\");\n\t\t$Statement->execute(array($type, $this->id));\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}", "public function newAction()\n {\n $type = $this->session->get('auth')['type'];\n $this->view->type =$type;\n if( $type == 1 || $type == 2 ){\n $user = User::Find(array(\"status = '1'\")); \n $this->view->user = $user; \n }else{\n $id = $this->session->get('auth')['id'];\n $this->view->iduser = $user->iduser;\n $this->tag->setDefault(\"iduser\", $id);\n } \n }", "public function post_add_users() {\n\t}", "protected function setUser($user, $type) {\n\t\t$id = 0;\n\t\tif($user === true) $user = $this->wire('user');\n\t\tif(is_object($user)) {\n\t\t\tif($user instanceof NullPage) {\n\t\t\t\t$id = 0;\n\t\t\t} else if($user instanceof User) {\n\t\t\t\t$id = $user->isGuest() ? 0 : $user->id;\n\t\t\t}\n\t\t} else if(is_int($user)) {\n\t\t\t$id = $user;\n\t\t} else if(ctype_digit($user)) {\n\t\t\t$id = (int) $user;\n\t\t} else if(is_string($user)) {\n\t\t\t$name = $this->wire('sanitizer')->pageName($user);\n\t\t\t$user = $name ? $this->wire('users')->get(\"name=$name\") : null; \n\t\t\t$id = $user && $user->id ? $user->id : 0;\n\t\t}\n\t\tif($id < 0) $id = 0;\n\t\tif(strpos($type, 'created') === 0) {\n\t\t\t$this->_createdUser = ($id && $user instanceof User ? $user : null);\n\t\t\tparent::set('created_users_id', $id); \n\t\t} else if(strpos($type, 'modified') === 0) {\n\t\t\t$this->_modifiedUser = ($id && $user instanceof User ? $user : null);\n\t\t\tparent::set('modified_users_id', $id); \n\t\t}\n\t}", "function setUserType($username = NULL,$userType = NULL)\n\t\t{\n\t\t\t$sSQL\t=\t\"UPDATE tbl_member set member_type = '\" . $userType . \"' \n\t\t\tWHERE user_name = '\" . $username . \"'\";\n\t\t\t$response = $this->Execute($sSQL);\n\t\t\treturn $response;\t\t\n\t\t}", "function updateMemberType($userId, $userType) {\r\n $sql = $this->db->prepare(\"UPDATE USER SET type=:user_type WHERE UserID=:user_id\");\r\n $sql->execute(array(\r\n 'user_type' => $userType,\r\n 'user_id' => $userId,\r\n ));\r\n return true;\r\n }", "public function run()\n {\n \t$names = ['Administrator','Teacher','Student'];\n \tforeach($names as $name){\n \t\t$type = new UserType();\n \t\t$type->name = $name;\n \t\t$type->save();\n \t}\n }", "function addNew()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n {\n $this->load->model('user_model');\n $data['roles'] = $this->user_model->getUserRoles();\n \n $this->global['pageTitle'] = 'Garuda Informatics : Add New User';\n\n $this->loadViews($this->view.\"addNew\", $this->global, $data, NULL);\n }\n }", "function default_add(){\n\tglobal $assign_list, $_CONFIG, $_SITE_ROOT, $mod;\n\tglobal $core, $clsModule, $clsButtonNav;\n\t$tableName = \"mdl_user\";\n\t$classTable = \"User\";\n\t$pkeyTable = \"id\";\n\t\n\trequire_once DIR_COMMON.\"/clsForm.php\";\n\t//get _GET, _POST\n\t$pvalTable = isset($_REQUEST[$pkeyTable])? $_REQUEST[$pkeyTable] : \"\";\n\t$btnSave = isset($_POST[\"btnSave\"])? $_POST[\"btnSave\"] : \"\";\n\t//get Mode\n\t$mode = ($pvalTable!=\"\")? \"Edit\" : \"New\";\n\t//init Button\n\t$clsButtonNav->set(\"Save\", \"/icon/disks.png\", \"Save\", 1, \"save\");\n\tif ($mode==\"Edit\"){\n\t\t$clsButtonNav->set(\"New\", \"/icon/add2.png\", \"?admin&mod=$mod&act=add\",1);\n\t\t$clsButtonNav->set(\"Delete\", \"/icon/delete2.png\", \"?admin&mod=$mod&act=delete&$pkeyTable=$pvalTable\");\n\t}\n\t$clsButtonNav->set(\"Cancel\", \"/icon/undo.png\", \"?topica&mod=$mod\");\n\t//################### CHANGE BELOW CODE ###################\n\t$clsUserGroup = new UserGroup();\n\t$arrListUserGroup = $clsUserGroup->getAll();\n\t$arrOptionsUserGroup = array();\n\tif (is_array($arrListUserGroup))\n\tforeach ($arrListUserGroup as $key => $val){\n\t\t$arrOptionsUserGroup[$val[\"user_group_id\"]] = $val[\"display_name\"];\n\t}\n\t//init Form\n\t$arrPositionOptions = array(\"L\"=>\"LEFT\", \"R\"=>\"RIGHT\", \"B\"=>\"BOTTOM\", \"T\"=>\"TOP\");\n\t$arrYesNoOptions = array(\"NO\", \"YES\");\n\t$arrGenderOptions = array(\"Male\", \"Female\");\n\t$clsForm = new Form();\n\t$clsForm->setDbTable($tableName, $pkeyTable, $pvalTable);\n\t$clsForm->setTitle($core->getLang(\"Sửa thông tin sinh viên\"));\n\t//$clsForm->addInputText(\"username\", \"\", \"User Name\", 32, 0, \"style='width:200px'\");\n\t//$clsForm->addInputPassword(\"user_pass\", \"\", \"Password\", 255, 0, \"style='width:200px'\");\n\t//$user_pass_hint = ($mode==\"Edit\")? \"Leave if no change password\" : \"\";\n\t//$clsForm->addHint(\"user_pass\", $user_pass_hint);\n\t$clsForm->addInputText(\"firstname\", \"\", \"Họ\", 255, 1, \"style='width:200px'\");\n\t$clsForm->addInputText(\"lastname\", \"\", \"Tên\", 255, 1, \"style='width:200px'\");\n\t$clsForm->addInputText(\"username\", \"\", \"Username\", 255, 1, \"style='width:200px'\");\n\t$clsForm->addInputText(\"topica_lop\", \"\", \"Lớp\", 255, 1, \"style='width:200px'\");\n\t$clsForm->addInputText(\"topica_nganh\", \"\", \"Ngành\", 255, 1, \"style='width:200px'\");\n\t$clsForm->addInputText(\"topica_nhom\", \"\", \"Nhóm\", 255, 1, \"style='width:200px'\");\n\t$clsForm->addInputText(\"topica_coquan\", \"\", \"Cơ quan\", 255, 1, \"style='width:200px'\");\n\t$clsForm->addInputText(\"topica_chucdanh\", \"\", \"Chức danh\", 255, 1, \"style='width:200px'\");\n\t$clsForm->addInputText(\"topica_chucvutronglop\", \"\", \"Chức vụ trong lớp\", 255, 1, \"style='width:200px'\");\n\t$clsForm->addInputText(\"topica_chucvutrongnhom\", \"\", \"Chức vụ trong nhóm\", 255, 1, \"style='width:200px'\");\n\t$clsForm->addInputText(\"topica_trinhdo\", \"\", \"Trình độ\", 255, 1, \"style='width:200px'\");\n\t$clsForm->addInputText(\"topica_doituongtuyensinh\", \"\", \"Đối tượng tuyển sinh\", 255, 1, \"style='width:200px'\");\n\t\n\t//####################### ENG CHANGE ######################\n\t//do Action\n\tif ($btnSave!=\"\"){\n\t\tif ($clsForm->validate()){\n\t\t\tif ($clsForm->saveData($mode)){\n\t\t\t\theader(\"location: ?$_SITE_ROOT&mod=$mod\");\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$assign_list[\"clsModule\"] = $clsModule;\n\t$assign_list[\"clsForm\"] = $clsForm;\n\t$assign_list[$pkeyTable] = $pvalTable;\n}", "function approve_block_more_users($users_id, $users_type){\n\t\tif( isset($_POST[$users_id]) ){\n\t\t\tglobal $base;\n\t\t\t\n\t\t\tuser::users_manipulation($_POST[$users_id], $_POST[$users_type]);\n\t\t\tredirect('../../master_admin.php');\n\t\t}\n\n\t}", "public function add()\n\t{\n\t\t// Initialize variables.\n\t\t$app = &JFactory::getApplication();\n\n\t\t// Clear the level edit information from the session.\n\t\t$app->setUserState('com_users.edit.user.id', null);\n\t\t$app->setUserState('com_users.edit.user.data', null);\n\n\t\t// Redirect to the edit screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_users&view=user&layout=edit', false));\n\t}", "public function editUserType($UserTypeID, $Input=array()) {\r\n\t\t/*delete group permissions*/\r\n\t\t$this->db->where(\"UserTypeID\",$UserTypeID);\r\n\t\t$this->db->delete('admin_user_type_permission');\r\n\t\t\r\n\t\t$UpdateData = array(\r\n\t\t\t\"UserTypeName\" \t=>\t$Input['GroupName'],\r\n\t\t);\r\n\t\t$this->db->where(\"UserTypeID\",$UserTypeID);\r\n $this->db->limit(1);\r\n $this->db->update('tbl_users_type', $UpdateData);\r\n\r\n\t\tif(!empty($Input['ModuleName'])){ /*Update permissions*/\r\n \tarray_push($Input['ModuleName'], 'dashboard');\r\n\t\t\tforeach($Input['ModuleName'] as $ModuleName){\r\n\t\t\t\t$ModuleData = $this->getModules(\"M.ModuleID\", array(\"ModuleName\" => $ModuleName));\r\n\t\t\t\tif(!empty($ModuleData)){\r\n\t\t\t\t\t$IsDefault = NULL;\r\n\t\t\t\t\tif ($Input['DefaultModule'] == $ModuleName) {\r\n\t\t\t\t\t\t$IsDefault = 'Yes';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$InsertData[] = array('UserTypeID'=>$UserTypeID,'ModuleID' => $ModuleData['ModuleID'],'IsDefault' => $IsDefault);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->db->insert_batch('admin_user_type_permission', $InsertData); \r\n\t\t}\t\t\r\n\t\treturn true;\r\n\t}", "public function addCalendarType ($type)\n\t{\n\t\t$Statement = $this->Database->prepare(\"UPDATE users SET hp_calendar_type = ? WHERE id = ?\");\n\t\t$Statement->execute(array($type, $this->id));\n\t}", "function create() \n {\n $api = new Module_UserManagement_API();\n\n $user_types = $api->getExerciseTypes();\n\n $form = new AddUserForm();\n if ($form->validate()) {\n $userid = $form->getSubmitValue('login');\n $password = $form->getSubmitValue('password');\n $coach = $form->getSubmitValue('coach');\n $athlete = $form->getSubmitValue('athlete');\n $usertype = $form->getSubmitValue('usertype');\n\n $success = $api->createUser($userid, $password, \n $coach, $athlete, $usertype);\n if ($success) {\n /* We have sucessfully logged in, now lets \n * display the next page */\n /*\n if (!isset($redirect_module) || !isset($redirect_action)) {\n $redirect_module = 'Sessions';\n }\n\n Core_Url::redirectToUrl($urlToRedirect);\n */\n }\n }\n\n $view = Core_View::factory('adduser');\n //$view->users = $users;\n $view->addForm($form);\n $view->subTemplate = 'genericForm.tpl';\n\n /* Coach radio buttons */\n $view->assign('coach_types', array('y' => 'Yes',\n 'n' => 'No'));\n $view->assign('coach_selected', 'n');\n\n /* Athlete radio buttons */\n $view->assign('athlete_types', array('y' => 'Yes',\n 'n' => 'No'));\n $view->assign('athlete_selected', 'n');\n\n /* Athlete radio buttons */\n $view->assign('usertype_types', array('user' => 'User',\n 'superuser' => 'SuperUser'));\n $view->assign('usertype_selected', 'user');\n\n echo $view->render();\n }", "public function run()\n {\n SportsUserTypes::create(\n ['user_type'=>'Coach']);\n \n SportsUserTypes::create(\n ['user_type'=>'Athlete']);\n }", "public function addNewUser(){\n\n if(Auth::user()->userType==0){\n return view(\"worker\",[\"layout\"=>\"addNewUser\"]);\n }\n else{\n return redirect()->back();\n }\n\n }", "function addNew()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $data['roles'] = $this->user_model->getUserRoles();\n\n $this->global['pageTitle'] = '添加人员';\n\n $this->loadViews(\"addNew\", $this->global, $data, NULL);\n }\n }", "public function admin_add()\n {\n if ($this->request->is('post')) {\n $this->User->create();\n\n $this->request->data['Impi']['auth_scheme'] = 127;\n\n if ($this->User->saveAll($this->request->data)) {\n $this->Session->setFlash(__('The user has been saved'));\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n }\n }\n $utilityFunctions = $this->User->UtilityFunction->find('list');\n\n $this->set(compact('utilityFunctions', 'utilityFunctionsParameters'));\n }", "public function action_add()\r\n\t{\r\n\t\tif ( Request::current()->method() == Request::POST )\r\n\t\t{\r\n\t\t\treturn $this->_add();\r\n\t\t}\r\n\t\t\r\n\t\t$this->template->title = __('Add user');\r\n\t\t$this->breadcrumbs\r\n\t\t\t->add($this->template->title);\r\n\r\n\t\t// check if user have already enter something\r\n\t\t$data = Flash::get( 'post_data', array() );\r\n\r\n\t\t$user = new User( $data );\r\n\r\n\t\t$this->template->content = View::factory( 'user/edit', array(\r\n\t\t\t'action' => 'add',\r\n\t\t\t'user' => $user,\r\n\t\t\t'permissions' => Model_Permission::get_all()\r\n\t\t) );\r\n\t}", "public function saveType()\n {\n }", "public function newAction($type = 1, $current = 'admin') {\r\n $entity = new User();\r\n $form = $this->createForm(new UserType(), $entity);\r\n $menu_bar = 'admin';\r\n if ($type == 0) {\r\n $menu_bar = 'register';\r\n }\r\n return $this->render('AlbatrossUserBundle:User:new.html.twig', array(\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n 'menu_bar' => $menu_bar,\r\n 'current' => $current,\r\n 'menu_cal_cur' => 'user',\r\n ));\r\n }", "public function add_usertype() {\n\t\t$arr['active'] = 'user';\n\t\t$arr['page'] = 'role';\n\t\t$arr['id'] = 0;\n\t\tif($this->input->post('addrole')){\n\t\t\t$this->form_validation->set_rules('userrole', 'User Role', 'required');\n $this->form_validation->set_rules('userrolealias', 'User Role Alias', 'required');\n\t\t\t if($this->form_validation->run() == FALSE) {\n\t\t\t\t$arr['error'] = validation_errors();\n $this->load->view('vwAddUserType',$arr);\n }else{\n\t\t\t\t$userrole = $this->input->post('userrole');\n\t\t\t\t$alias = $this->input->post('userrolealias');\n\t\t\t\t$roletype = $this->input->post('roletype');\n\t\t\t\t$data['role_name'] = $userrole;\n\t\t\t\t$data['role_alias'] = $alias;\n\t\t\t\t$data['role_type'] = $roletype;\n\t\t\t\tif($this->input->post('id')){\n\t\t\t\t\t$this->setting->updaterole($data);\n\t\t\t\t\t$this->session->set_flashdata('rolemsg', '<div class=\"alert alert-success alert-dismissible text-center\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>User Role Updated Successfully!!!</div>');\n\t\t\t\t}else{\n\t\t\t\t\t$this->setting->addrole($data);\n\t\t\t\t\t$this->session->set_flashdata('rolemsg', '<div class=\"alert alert-success alert-dismissible text-center\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>User Role Added Successfully!!!</div>');\n\t\t\t\t}\n\t\t\t\tredirect('settings/userrole');\n\t\t\t}\n\t\t}else{\n\t\t\t$this->load->view('vwAddUserType',$arr);\n\t\t}\n\t}", "public function addType($type);", "public function edit(TypeThird $typeThird)\n {\n //\n }", "public function addType(){\n return view('admin.MovieTypes.addType');\n }", "private function insertUser(){\n\t\t$data['tipoUsuario'] = Seguridad::getTipo();\n\t\tView::show(\"user/insertForm\", $data);\n\t}", "public function actionAdd()\n\t{\n\t\t$formId = $this->_input->filterSingle('form_id', XenForo_Input::UINT);\n\t\t$type = $this->_input->filterSingle('type', XenForo_Input::STRING);\n\t\t\n\t\t$fieldModel = $this->_getFieldModel();\n\t\t$fieldTypes = $fieldModel->getCountByType();\n\t\t\n\t\t$options = array();\n\t\t$options[] = array(\n\t\t 'value' => 'user',\n\t\t 'label' => new XenForo_Phrase('field'),\n\t\t 'selected' => true\n\t\t);\n\t\t\n\t\t// if global fields exist, include in the types\n\t\tif (array_key_exists('global', $fieldTypes))\n\t\t{\n\t\t\t$options[] = array(\n\t\t\t 'value' => 'global',\n\t\t\t 'label' => new XenForo_Phrase('global_field')\n\t\t\t);\n\t\t}\n\t\t\n\t\t// if template fields exist, include in the types\n\t\tif (array_key_exists('template', $fieldTypes))\n\t\t{\n\t\t\t$options[] = array(\n\t\t\t 'value' => 'template',\n\t\t\t 'label' => new XenForo_Phrase('template_field') \n\t\t\t);\n\t\t}\n\t\t\n\t\t// if there are no options other than user, just send them to the add field page\n\t\tif (!$type && count($options) == 1)\n\t\t{\n\t\t\t$type = 'user';\n\t\t}\n\t\t\n\t\t// association a field to a form\n\t\tif ($formId && $type)\n\t\t{\n\t\t\t$default = array(\n\t\t\t\t'field_id' => null,\n\t\t\t\t'form_id' => $this->_input->filterSingle('form_id', XenForo_Input::UINT),\n\t\t\t\t'display_order' => $this->_getFieldModel()->getGreatestDisplayOrderByFormId($formId) + 10,\n\t\t\t\t'field_type' => 'textbox',\n\t\t\t\t'field_choices' => '',\n\t\t\t\t'match_type' => 'none',\n\t\t\t\t'match_regex' => '',\n\t\t\t\t'match_callback_class' => '',\n\t\t\t\t'match_callback_method' => '',\n\t\t\t\t'max_length' => 0,\n\t\t\t\t'min_length' => 0,\n\t\t\t\t'required' => 0,\n\t\t\t\t'type' => $type,\n\t\t\t\t'active' => 1,\n\t\t\t\t'pre_text' => '',\n\t\t\t\t'post_text' => ''\n\t\t\t);\n\t\t\t\n\t\t\tswitch ($type)\n\t\t\t{\n\t\t\t case 'global':\n\t\t {\n\t\t return $this->responseReroute('KomuKu_SimpleForms_ControllerAdmin_Form', 'add-global-field');\n\t\t }\n\t\t\t case 'template':\n\t\t {\n\t\t return $this->responseReroute('KomuKu_SimpleForms_ControllerAdmin_Form', 'add-template-field');\n\t\t }\n\t\t\t default:\n\t\t {\n\t\t return $this->_getFieldAddEditResponse($default);\n\t\t }\n\t\t\t}\n\t\t}\n\t\t\n\t\t// adding a global/template field\n\t\telse if (!$formId && $type)\n\t\t{\n\t\t $default = array(\n\t 'field_id' => null,\n\t 'field_type' => 'textbox',\n\t 'field_choices' => '',\n\t 'match_type' => 'none',\n\t 'match_regex' => '',\n\t 'match_callback_class' => '',\n\t 'match_callback_method' => '',\n\t 'max_length' => 0,\n\t\t \t'min_length' => 0,\n\t 'type' => $type,\n\t\t \t'pre_text' => '',\n\t\t \t'post_text' => ''\n\t\t );\n\t\t \n\t\t if ($type != 'global')\n\t\t {\n\t\t \t$default['display_order'] = 1;\n\t\t \t$default['required'] = 0;\n\t\t \t$default['active'] = 1;\n\t\t }\n\t\t \n\t\t return $this->_getFieldAddEditResponse($default);\n\t\t}\n\t\t\n\t\t// association type\n\t\telse\n\t\t{\n\t\t\t$viewParams = array(\n\t\t\t\t'formId' => $formId,\n\t\t\t\t'options' => $options\n\t\t\t);\n\t\t\t\n\t\t\treturn $this->responseView('KomuKu_SimpleForms_ViewAdmin_Field_AddType', 'kmkform__field_add_type', $viewParams);\n\t\t}\n\t}", "public function addMealType(){\n \t$id = $this->formValueForKey(\"mealTypeSelection\");\n \t\n \t$foundMealType = BLGenericRecord::recordMatchingKeyAndValue(\"MealType\", \"id\", $id);\n \t$this->currentRecipe()->addMealType($foundMealType);\n }", "public function actionAdd() {\n\t\treturn $this->txSave ( \"app\\models\\User\" );\n\t}", "function addProfileFields($user) {\n\t\tif($this->checkPermissions()) {\n\t\t\techo '<h3>LePress Teacher</h3>';\n\t\t\techo '<table class=\"form-table\">';\n\t\t\techo '<tr>';\n\t\t\techo\t'<th><label for=\"lepress-organization\">'.__('Organization', lepress_textdomain).'</label></th>';\n\t\t\techo '<td><input type=\"text\" name=\"lepress-organization\" id=\"lepress-organization\" value=\"'.esc_attr( get_the_author_meta( 'lepress-organization', $user->ID)).'\" class=\"regular-text\"/><br />';\n\t\t\techo '<span class=\"description\">'.__('Your organization - university, college, high school, primary school etc..', lepress_textdomain).'</span></td>';\n\t\t\techo '</tr></table>';\n\t\t}\n\t}", "function showEditAccountPage($type, $user_id) {\n $active_tab = Utils::reqParam('active_tab', 'account_tab');\n\n $notifications_div = Utils::reqParam('selected', 'email');\n $publisher_div = Utils::reqParam('selected_pub_div', 'post');\n\n $user_account_data = User::getEmptyEditAccountData();\n $user_account_data = User::fillInEditAccountData($user_account_data);\n\n $password_data = User::getEmptyPasswordData();\n\n $seo_attributes = array('title' => '',\n 'keywords' => 'General Account Settings',\n 'description' => 'ShareBloc is a community of like-minded professionals who share, curate and discuss business content that matters.');\n $smarty_params = array(\n 'notifications' => Notification::$notifications,\n 'notify_weekly' => Utils::userData('notify_weekly'),\n 'notify_post_responded' => Utils::userData('notify_post_responded'),\n 'notify_comment_responded' => Utils::userData('notify_comment_responded'),\n 'notify_product_update' => Utils::userData('notify_product_update'),\n 'notify_daily' => Utils::userData('notify_daily'),\n 'notify_suggestion' => Utils::userData('notify_suggestion'),\n 'active_tab' => $active_tab,\n 'account_data' => $user_account_data,\n 'password_data' => $password_data,\n 'seo' => $seo_attributes,\n 'edit_type' => $type,\n 'init_image_upload' => true,\n 'notifications_div' => $notifications_div,\n 'publisher_div' => $publisher_div,\n 'categories_structure' => Utils::getCategoriesStructure(),\n 'autopost_allowed' => Utils::userData('f_auto_allowed'),\n );\n\n if (!isset($_SESSION['user_info']['my_url'])) {\n Log::$logger->error('Maybe not logged in user. Email: ' . $_SESSION['user_info']['email']);\n }\n\n Utils::$smarty->assign($smarty_params);\n Utils::$smarty->display('pages/user_edit.tpl');\n exit();\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 run()\n {\n $default = [\n ['type' => 'Super Admin'], \n ['type' => 'Admin'], \n ['type' =>'Director'], \n ['type' =>'Department Head'], \n ['type' =>'Group Leader'],\n ['type' =>'Developer']\n ];\n\n foreach ($default as $key => $value) {\n UserType::create($value);\n }\n }", "function admin_create_new_user(){ \r\n\t\t\t$id = $this->uri->segment(3);\r\n\t\t\tif($id){\r\n\t\t\t\t$result['update_user_value'] = $this->model->get_edit_record();\r\n\t\t\t}\t \r\n\t\t\t$result['new_user_data'] = $this->model->select_new_user();\r\n\t\t\t$this->load->view('admin-worldsclinicalguide/admin_create_new_user',$result); \r\n\t}", "public function addUser(){}", "function travel_add($type) {\n $entity_type = travel_type_load_multiple($type);\n drupal_set_title(t('Create @name', array('@name' => entity_label('entity_type', $entity_type))));\n\n // Return form for the given entity bundle.\n $entity = entity_create('travel', array('type' => $type));\n $output = drupal_get_form('travel_form', $entity);\n return $output;\n}", "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 }", "private function update_type($new_type) { \n\n\t\tif ($this->_update_item('type',$new_type,'50')) { \n\t\t\t$this->type = $new_type;\n\t\t}\n\n\t}", "function delete_user_type($user_type_id)\n\t\t{\n\t\t\t$eventlogbol = new eventlogbol();\n\t\t\t$old_values='';\n\t\t\t$new_values_arr = array();\n\t\t\t$new_values_arr['user_type_id'] = $user_type_id;\n\t\t\t$event_result = $eventlogbol->save_eventlog('Delete','tbl_user_type',$new_values_arr,$old_values);\n\t\t\tif($event_result)\n\t\t\t{\n\t\t\t\t$query=\"DELETE FROM tbl_user_type WHERE user_type_id=:user_type_id \";\t\t\n\t\t\t\t$result = execute_non_query($query, array(':user_type_id' => $user_type_id));\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn false;\n\t\t}", "public function actionEditjobtypes(){\n\n $seekerjobtypes = Yii::$app->user->identity->seeker->seekerJobTypes;\n // $seekerjobtypes = SeekerJobType::findAll(['seeker_id'=>Yii::$app->user->identity->seeker->seeker_id]);\n\n $job =JobType::find()\n ->where(['not in','job_type_id',\n ( new Query())\n ->select(['job_type_id'])\n ->from('seeker_job_type')\n ->where(['seeker_id'=>Yii::$app->user->identity->seeker->seeker_id])\n\n ])->all();\n\n return $this->render('addjobtype',['seekerjobtypes'=>$seekerjobtypes,'job'=>$job]);\n }", "public function saveUserType($Input=array()) {\r\n\t\t$GetGUID = get_guid();\r\n\r\n\t\t$InsertData = array_filter(array(\r\n\t\t\t\"UserTypeGUID\"\t\t\t=>\t$GetGUID,\r\n\t\t\t\"UserTypeName\" \t\t\t=>\t$Input['GroupName'],\r\n\t\t\t\"IsAdmin\" \t\t\t\t=>\t(!empty($Input['IsAdmin']) ? \"Yes\" : \"No\")\r\n\t\t));\r\n\t\tif(!empty($InsertData)){\r\n\t\t\t$Query \t\t= $this->db->insert('tbl_users_type', $InsertData);\r\n\t\t\treturn array('UserTypeID' => $this->db->insert_id(), 'UserTypeGUID' => $GetGUID);\r\n\t\t}\t\t\r\n\t\treturn false;\r\n\t}", "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 admin_add(){\n $content = $this->load->view(\"users/users_form\",\"\",true);\n echo Modules::run(\"template/load_admin\", \"Add New User\", $content);\n }", "function add()\n { \n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t'type' => $this->input->post('type'),\n );\n \n $t_role_id = $this->Role_model->add_t_role($params);\n redirect('role');\n }\n else\n { \n $data['_view'] = 'role/add';\n $this->load->view('layouts/main',$data);\n }\n }", "public function addAction() {\n\t\t$form = new Default_Form_UserGroup ();\n\t\t$userGroup = new Default_Model_UserGroup ();\n\t\t$userGroupMapper = new Default_Model_Mapper_UserGroup ();\n\t\t$this->_save ( $form, self::$ADD_MODE );\n\t\tunset($form->getElement('modules')->required);\n\t\t$this->view->form = $form;\n\t\t$this->render ( \"add-edit\" );\n\t}", "function node_add($type) {\n global $user;\n\n $types = node_get_types();\n $type = isset($type) ? str_replace('-', '_', $type) : NULL;\n // If a node type has been specified, validate its existence.\n if (isset($types[$type]) && node_access('create', $type)) {\n // Initialize settings:\n $node = array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => '');\n\n drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)));\n $output = drupal_get_form($type .'_node_form', $node);\n }\n\n return $output;\n}", "public function run()\n {\n $user_types = [\n \t\t['name' => 'CEO'],\n \t\t['name' => 'CTO'],\n \t\t['name' => 'CFO'],\n \t\t['name' => 'Project Manager'],\n \t\t['name' => 'Team Lead'],\n \t\t['name' => 'UI/UX Designer'],\n \t\t['name' => 'Sr. Software Engineer'],\n \t\t['name' => 'Software Engineer'],\n \t\t['name' => 'Jr. Software Engineer'],\n \t\t['name' => 'Sr. Marketing Manager'],\n \t\t['name' => 'Sales Manager'],\n \t\t['name' => 'Sales Manager Trainee'],\n \t\t['name' => 'Sr. Quality Analyst'],\n \t\t['name' => 'Quality Analyst'],\n \t\t['name' => 'Jr. Quality Analyst'],\n \t\t['name' => 'IT Trainee'],\n \t\t['name' => 'Financial Analyst'],\n \t\t['name' => 'Content Writer'],\n \t\t['name' => 'Programmer Analyst'],\n \t\t['name' => 'Human Resource Manager']\n \t];\n\n \tforeach ($user_types as $key => $value) {\n \tUsertype::create($value);\n }\n }", "function newuser(){\n\t\t\tif(!empty($_POST['newemail']) && !empty($_POST['newpassword']) && !empty($_POST['newnombre']) && !empty($_POST['newpoblacion']) && !empty($_POST['newrol'])){\n\t\t\t\t$poblacion = filter_input(INPUT_POST,'newpoblacion',FILTER_SANITIZE_STRING);\n\t\t\t\t$nombre = filter_input(INPUT_POST,'newnombre',FILTER_SANITIZE_STRING);\n\t\t\t\t$password = filter_input(INPUT_POST,'newpassword',FILTER_SANITIZE_STRING);\n\t\t\t\t$email = filter_input(INPUT_POST,'newemail',FILTER_SANITIZE_STRING);\n\t\t\t\t$rol = filter_input(INPUT_POST,'newrol',FILTER_SANITIZE_STRING);\n\t\t\t\t$list = $this -> model -> adduser($nombre,$password,$email,$poblacion,$rol);\n \t\t$this -> ajax_set(array('redirect'=>APP_W.'admin'));\n\t\t\t}\n\t\t}", "public function getName()\n {\n return 'user_form_type';\n }", "public function addUser(){\n\t}", "public function create()\n {\n return view('user-type.create');\n }", "public function editUser()\n {\n\n $this->displayAllEmployees();\n $new_data = [];\n $id = readline(\"Unesite broj ispred zaposlenika čije podatke želite izmjeniti: \");\n\n $this->displayOneEmployees( $id);\n\n foreach ( $this->employeeStorage->getEmployeeScheme() as $key => $singleUser) { //input is same as addUser method\n\n $userInput = readline(\"$singleUser : \");\n $validate = $this->validateInput($userInput, $key);\n\n while (!$validate)\n {\n $userInput = readline(\"Unesite ispravan format : \");\n $validate = $this->validateInput($userInput, $key);\n\n }\n if ($key === 'income'){\n $userInput = number_format((float)$userInput, 2, '.', '');\n }\n\n $new_data[$key] = $userInput;\n\n }\n $this->employeeStorage->updateEmployee($id, $new_data); //sends both id and data to updateEmployee so the chosen employee can be updated with new data\n\n echo \"\\033[32m\". \"## Izmjene za \". $new_data['name'].\" \". $new_data['lastname'].\" su upisane! \\n\\n\".\"\\033[0m\";\n\n }", "public function save($data)\n\t{\n\t\t$user = JFactory::getUser();\n\n\t\t// Guest users are not allowed to add the records\n\t\tif (empty($user->id))\n\t\t{\n\t\t\t$this->setError(JText::_('COM_TJUCM_FORM_SAVE_FAILED_AUTHORIZATION_ERROR'));\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get instance of UCM type table\n\t\tJLoader::import('components.com_tjucm.tables.type', JPATH_ADMINISTRATOR);\n\t\t$tjUcmTypeTable = JTable::getInstance('Type', 'TjucmTable', array('dbo', Factory::getDbo()));\n\n\t\t// Check and assign valid client and type_id to the record\n\t\tif (!empty($data['type_id']) || !empty($data['client']))\n\t\t{\n\t\t\tif ($data['client'] != '')\n\t\t\t{\n\t\t\t\t$tjUcmTypeTable->load(array('unique_identifier' => $data['client']));\n\t\t\t\t$data['type_id'] = $tjUcmTypeTable->id;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tjUcmTypeTable->load(array('id' => $data['type_id']));\n\t\t\t\t$data['client'] = $tjUcmTypeTable->unique_identifier;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->setError(JText::_('COM_TJUCM_FORM_SAVE_FAILED_CLIENT_REQUIRED'));\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$ucmTypeParams = new Registry($tjUcmTypeTable->params);\n\n\t\t// Check if user is allowed to add/edit the record\n\t\tif (empty($data['id']))\n\t\t{\n\t\t\t$allowedCount = $ucmTypeParams->get('allowed_count', 0, 'INT');\n\n\t\t\t// Check if the user is allowed to add record for given UCM type\n\t\t\t$canAdd = $user->authorise('core.type.createitem', 'com_tjucm.type.' . $data['type_id']);\n\n\t\t\tif (!$canAdd)\n\t\t\t{\n\t\t\t\t$this->setError(JText::_('COM_TJUCM_FORM_SAVE_FAILED_AUTHORIZATION_ERROR'));\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Check allowed limit if its set for given UCM type\n\t\t\tif (!empty($allowedCount))\n\t\t\t{\n\t\t\t\t$canAdd = $this->allowedToAddTypeData($user->id, $data['client'], $allowedCount);\n\n\t\t\t\tif (!$canAdd)\n\t\t\t\t{\n\t\t\t\t\t$this->setError(JText::sprintf('COM_TJUCM_ALLOWED_COUNT_LIMIT', $allowedCount));\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Check if the user can edit this record\n\t\t\t$canEdit = $user->authorise('core.type.edititem', 'com_tjucm.type.' . $data['type_id']);\n\t\t\t$canEditOwn = $user->authorise('core.type.editownitem', 'com_tjucm.type.' . $data['type_id']);\n\n\t\t\t$itemTable = $this->getTable();\n\t\t\t$itemTable->load(array('id' => $data['id']));\n\n\t\t\tif ($canEdit)\n\t\t\t{\n\t\t\t\t$authorised = true;\n\t\t\t}\n\t\t\telseif (($canEditOwn) && ($itemTable->created_by == $user->id))\n\t\t\t{\n\t\t\t\t$authorised = true;\n\t\t\t}\n\n\t\t\tif (!$authorised)\n\t\t\t{\n\t\t\t\t$this->setError(JText::_('COM_TJUCM_FORM_SAVE_FAILED_AUTHORIZATION_ERROR'));\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn parent::save($data);\n\t}", "public function change(Request $request) {\n // return redirect()->back()->with->('sucess', 'Custodian deleted success');\n $change = User::where('email', '=', $request['email']);\n $change->update(['user_type' => 1]);\n }", "function user_edit($user_info)\n {\n }", "public function add(){\n $this->edit();\n }", "public function run()\n {\n\n \tDB::table('user_types')->insert(['user_type' => 'пользователь']);\n //\n }", "public function run()\n {\n UserType::create([\n 'id' => 1,\n 'title' => 'SUPER ADMIN',\n 'status' => Constant::STATUS_INTEGER_ACTIVE\n ]);\n UserType::create([\n 'id' => 2,\n 'title' => 'User',\n 'status' => Constant::STATUS_INTEGER_ACTIVE\n ]);\n }", "public function add()\n\t{\n\t\t// TODO\n\t\t// if(user has permissions){}\n\t\t$this -> loadModel('User');\n\t\tif($this -> request -> is('post') && !$this -> User -> exists($this -> request -> data['SgaPerson']['user_id']))\n\t\t{\n\t\t\t$this -> Session -> setFlash(\"Please select a valid JacketPages user to add.\");\n\t\t\t$this -> redirect(array('action' => 'index',$id));\n\t\t}\n\t\t$this -> loadModel('User');\n\t\tif ($this -> request -> is('post'))\n\t\t{\n\t\t\t$this -> SgaPerson -> create();\n\t\t\tif ($this -> SgaPerson -> save($this -> data))\n\t\t\t{\n\t\t\t\t$user = $this -> User -> read(null, $this -> data['SgaPerson']['user_id']);\n\t\t\t\t$this -> User -> set('level', 'sga_user');\n\t\t\t\t$this -> User -> set('sga_id', $this -> SgaPerson -> getInsertID());\n\t\t\t\t$this -> User -> save();\n\t\t\t\t$this -> Session -> setFlash(__('The user has been added to SGA.', true));\n\t\t\t\t$this -> redirect(array('action' => 'index'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this -> Session -> setFlash(__('Invalid user. User may already be assigned a role in SGA. Please try again.', true));\n\t\t\t}\n\t\t}\n\t}", "function seun_edit_user_options() {\n\n\t\t\tglobal $user_id;\n\n\t\t\t$user_id = isset($user_id) ? (int) $user_id : 0;\n\n\t\t\tif ( ! current_user_can('edit_users') )\n\t\t\t\treturn;\n\n\t\t\tif ( ! ($userdata = get_userdata( $user_id ) ) )\n\t\t\t\treturn;\n\n\t\t\t$default_user_nicename = sanitize_title( $userdata->user_login );\n\n\t\t\techo '<h3>'.__('User Nicename', 'seun').'</h3>'\n\t\t\t\t.'<table class=\"form-table\">'.\"\\n\"\n\t\t\t\t\t.'<tr>'.\"\\n\"\n\t\t\t\t\t\t.'<th><label for=\"user_nicename\">'.__('User nicename/slug', 'seun').'</label></th>'.\"\\n\"\n\t\t\t\t\t\t.'<td>'\n\t\t\t\t\t\t\t.'<input id=\"user_nicename\" name=\"user_nicename\" class=\"regular-text code\" type=\"text\" value=\"'.sanitize_title($userdata->user_nicename, $default_user_nicename).'\"/> '\n\t\t\t\t\t\t\t.'<span class=\"description\">('.sprintf(__('Leave empty for default value: %s', 'seun'), $default_user_nicename).')</span> '\n\t\t\t\t\t\t\t.'<a href=\"'.get_author_posts_url($user_id).'\">'.__('Your Profile').'</a> '\n\t\t\t\t\t\t.\"</td>\\n\"\n\t\t\t\t\t.'</tr>'.\"\\n\"\n\t\t\t\t.'</table>'.\"\\n\";\n\n\t\t}", "function add()\n { \n $this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules('userTypeID','UserTypeID','required|integer');\n\t\t$this->form_validation->set_rules('userIDNo','UserIDNo','required|integer');\n\t\t$this->form_validation->set_rules('userLN','UserLN','required|max_length[50]');\n\t\t$this->form_validation->set_rules('userFN','UserFN','required|max_length[50]');\n\t\t$this->form_validation->set_rules('userEmail','UserEmail','required|max_length[100]|valid_email');\n\t\t$this->form_validation->set_rules('userPassword','UserPassword','required|max_length[300]');\n\t\t$this->form_validation->set_rules('userMobile','UserMobile','required|max_length[15]|numeric');\n\t\t\n\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t'userTypeID' => $this->input->post('userTypeID'),\n\t\t\t\t'userPassword' => $this->input->post('userPassword'),\n\t\t\t\t'userIDNo' => $this->input->post('userIDNo'),\n\t\t\t\t'userLN' => $this->input->post('userLN'),\n\t\t\t\t'userFN' => $this->input->post('userFN'),\n\t\t\t\t'userEmail' => $this->input->post('userEmail'),\n\t\t\t\t'userMobile' => $this->input->post('userMobile'),\n );\n \n $user_id = $this->User_model->add_user($params);\n redirect('user/index');\n }\n else\n {\n\t\t\t$this->load->model('Usertype_model');\n\t\t\t$data['all_usertype'] = $this->Usertype_model->get_all_usertype();\n \n $data['_view'] = 'user/add';\n $this->load->view('layouts/main',$data);\n }\n }", "public function newUserAction()\n {\n $user = new User();\n\n $form = $this->createForm(UserType::class, $user);\n\n return $this->render('GrtResBundle:User:form.html.twig', array(\n 'form' => $form->createView()\n ));\n }", "public function add(){\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Add', 'Users');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = '';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Users';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Users';\n\n\t\t// Set default variables\n\t\t$this->_view->error = array();\n\n\t\t$userTypes = explode(',', USERS);\n $userTypesStore = array_pop($userTypes);\n\t\t$this->_view->userTypes = $userTypes;\n\n // If Form has been submitted process it\n\t\tif(!empty($_POST)){\n //if user selected cancel\n if(!empty($_POST['cancel'])){\n Url::redirect('backoffice/users/index');\n }\n $_POST['salt'] = null;\n\n if(!isset($_FILES) || empty($_FILES['image']['name'])){\n $_POST['image'] = null;\n }else{\n $this->uploadFile($_FILES);\n }\n\n // Create new user\n $createData = $this->_model->createData($_POST);\n if(isset($createData['error']) && $createData['error'] != null){\n foreach($createData['error'] as $key => $error){\n $this->_view->error[$key] = $error;\n }\n }else {\n $this->_view->flash[] = \"User added successfully.\";\n Session::set('backofficeFlash', array($this->_view->flash, 'success'));\n Url::redirect('backoffice/users/');\n }\n\t\t}\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('users/add', 'layout', 'backoffice');\n\t}", "public function save() {\n if ($this->isNew()) {\n $this->xpdo->log(MODx::LOG_LEVEL_INFO,'Creating default RegType');\n $regtype = $this->xpdo->newObject('RSVPMeRegType');\n $regtype->fromArray(array(\n 'name' => 'default',\n 'description' => 'default registration type',\n 'code' => (isset($this->code)) ? $this->code : '',\n 'fee' => (isset($this->fee)) ? $this->fee : '',\n ));\n\n $this->addMany($regtype);\n }\n\n /**\n * For now, only 1 registration type is allowed, so we will automatically\n * set the end date to the same as the date of the event. It will be set\n * independently in a future release.\n */\n if (!$this->isNew() && $this->isDirty('date')) {\n $regtypes = $this->getMany('RegistrationType');\n $regtype = array_pop($regtypes);\n $regtype->set('end',$this->get('date'));\n }\n\n /**\n * Since Registration Types will only be editable in a later version,\n * we need to make sure the 'secret code' stays synced\n */\n if (!$this->isNew() && (isset($this->code) || isset($this->fee))) {\n $regtypes = $this->getMany('RegistrationType');\n $regtype = array_pop($regtypes);\n\n if (isset($this->code)) {\n $regtype->set('code',$this->code);\n }\n if (isset($this->fee)) {\n $regtype->set('fee',$this->fee);\n }\n }\n\n /* now we can finish saving, this will also save related objects */\n return parent :: save();\n }", "function editItemType() {\n\t\tglobal $page;\n\t\tglobal $HTML;\n\t\t$HTML->details(1);\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"c init:form form:action:'.$page->url.'\" id=\"container:itemtype\">';\n\t\t\t$_ .= $this->getTypeObject()->editItem();\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}", "public function Edit_My_Profile()\n\t{\n\t\t$this->_CheckLogged();\n\t\t\n\t\t$this->_processInsert($this->instructors_model->getMyPostId());\n\t}", "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 addAction() {\n $this->assign('ad_ptypes', $this->ad_ptypes);\n }", "public function run()\n {\n \t$userTypeObject = new UserType;\n\n \t$riderUserTypeParameters['user_type_label'] = 'RIDER';\n \t$riderUserType = $userTypeObject->create($riderUserTypeParameters);\n\n \t$driverUserTypeParameters['user_type_label'] = 'DRIVER';\n \t$drivereUserType = $userTypeObject->create($driverUserTypeParameters);\n\n $driverUserTypeParameters['user_type_label'] = 'TRAVEL NETWORK COMPANY';\n $drivereUserType = $userTypeObject->create($driverUserTypeParameters);\n\n $driverUserTypeParameters['user_type_label'] = 'ADMIN';\n $drivereUserType = $userTypeObject->create($driverUserTypeParameters);\n\n\n }", "function ft_wp_user_register($user_id)\r\n{\r\n $role = ft_wp_get_wpuser_role($user_id);\r\n\r\n $formtools_account_id = \"\";\r\n if (!empty($role))\r\n {\r\n // now get the Form Tools account ID associated with this role type\r\n $access_level = \"formtoolsaccess__{$role}\";\r\n $formtools_account_id = get_option($access_level);\r\n }\r\n\r\n update_usermeta($user_id, 'form_tools_access', $formtools_account_id);\r\n}", "function travel_type_form($form, &$form_state, $entity_type, $op = 'edit') {\n // Handle the case when cloning is performed.\n if ($op == 'clone') {\n $entity_type->label .= ' (cloned)';\n $entity_type->type = '';\n }\n\n // Describe all properties of the entity which shall be shown on the form.\n $form['label'] = array(\n '#title' => t('Label'),\n '#type' => 'textfield',\n '#default_value' => $entity_type->label,\n '#description' => t('The human-readable name of this entity type.'),\n '#required' => TRUE,\n '#size' => 30,\n );\n $form['type'] = array(\n '#type' => 'machine_name',\n '#default_value' => isset($entity_type->type) ? $entity_type->type : '',\n '#maxlength' => 32,\n //'#disabled' => $entity_type->isLocked() && $op != 'clone',\n '#machine_name' => array(\n 'exists' => 'travel_type_load_multiple',\n 'source' => array('label'),\n ),\n '#description' => t('A unique machine-readable name for this entity type. It must only contain lowercase letters, numbers, and underscores.'),\n );\n $form['description'] = array(\n '#type' => 'textarea',\n '#default_value' => isset($entity_type->description) ? $entity_type->description : '',\n '#description' => t('Description about the entity type.'),\n );\n\n // Add some buttons.\n $form['actions'] = array('#type' => 'actions');\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save entity type'),\n '#weight' => 40,\n );\n //if (!$entity_type->isLocked() && $op != 'add' && $op != 'clone') {\n $entity_id = entity_id('travel', $entity);\n if (!empty($entity_id)) {\n $form['actions']['delete'] = array(\n '#type' => 'submit',\n '#value' => t('Delete entity type'),\n '#weight' => 45,\n '#limit_validation_errors' => array(),\n '#submit' => array('travel_type_form_submit_delete'),\n );\n }\n\n return $form;\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 add_user ($first,$last,$phone,$email,$username,$password,$type) {\r\n $stmt = $this->DB->prepare(\"INSERT INTO users values(NULL, :username, :firstname, :lastname, :phone, :email, :password, now(),'$type')\");\r\n $stmt->bindParam( 'username', $username );\r\n $stmt->bindParam( 'firstname', $first );\r\n $stmt->bindParam( 'lastname', $last );\r\n $stmt->bindParam( 'phone', $phone );\r\n $stmt->bindParam( 'email', $email );\r\n\t $stmt->bindParam( 'password', $password );\r\n $stmt->execute();\r\n }", "public function profile_admin()\n {\n parent::__construct();\n\t\t$this->setAttribute('method', 'post');\n\t\t$this->setAttribute('class', 'profile_form');\n \n\t\t$this->add(array(\n 'name' => 'user_name',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Full Name\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"Full Name\", \n\t\t\t ),\n ));\n\t\t\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_email',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Email\",\n ),\n\t\t\t\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required email checkemail_exclude', \n\t\t\t\t\"placeholder\" => \"Email Address\", \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_address',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Address\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"Address\", \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_phone',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Phone Number\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"Phone Number\", \n\t\t\t\t'id'=>'user_phone', \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_city',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"City\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"City\", \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_state',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"State\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"State\", \n\t\t\t ),\n ));\n\t\t$this->add(array(\n 'name' => 'user_country',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Country\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"Country\", \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n\t\t\t'name' => 'user_image',\n\t\t\t'type' => 'file',\t\t\t\n\t\t\t'options' =>array(\n\t\t\t\t'label' => \"Profile Image\",\n\t\t\t),\n\t\t\t\"accept\"=>\"image/*\",\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'default', \n\t\t\t\t\"id\" => \"user_image\", \n\t\t\t\t\"accept\"=>\"image/*\"\t\t\t\t\n\t\t\t ),\n\t\t));\t\n }", "function editTypeOfArea($data) {\n\t\t\t$conn = $this->connect();\n\t\t\t$pType = $this->modify(mysqli_real_escape_string($conn, $data['pType']));\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\tif(empty($pType)) {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-z ]+$/i\", $pType)) {\n\t\t\t\t\tif($this->length($pType, 25, 3)) {\n\t\t\t\t\t\t$result = $this->changepost('newpost', 'post_p_type', $pType, $uid , $pid);\n\t\t\t\t\t\tif($result == true) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function onTickettypesAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "function admin_add()\n\t{\n\t $this->set('pagetitle',\"Add Page\");\t\n\t $this->loadModel('User');\n\t $userlists = array();\n\t $userlists = array_merge($userlists,array('0'=>'Admin'));\n\t $allClientLists = $this->User->find('list',array('conditions'=>array('User.user_type_id'=>1),'fields'=>array('id','fname')));\n $userlists = array_merge($userlists,$allClientLists);\n\t $this->set('userlists',$userlists);\n\t \n\t if(!empty($this->data))\n\t {\n\t\tif($this->Page->save($this->data))\n\t\t{\n\t\t $this->Session->setFlash('The Page has been created','message/green');\n\t\t $this->redirect(array('action' => 'index'));\n\t\t}\n\t\telse\n\t\t{\n\t\t $this->Session->setFlash('The Page could not be saved. Please, try again.','message/yellow');\n\t\t}\n\t }\n\t}", "function admin_add() {\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t$this->User->create();\n\n\t\t\t/**\n\t\t\t * Save new user.\n\t\t\t */\n\t\t\tif ($this->User->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * If the new user is saved, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has been saved.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the user is not saved, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has not been saved.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Select all profiles (Administrator or Member).\n\t\t * @var array\n\t\t */\n\t\t$profiles = $this->User->Profile->find('list');\n\n\t\t/**\n\t\t * Select all offers enabled.\n\t\t * @var array\n\t\t */\n\t\t$offers = $this->User->Offer->find('list');\n\n\t\t/**\n\t\t * Put all profiles in \"profiles\" and offers in \"offers\".\n\t\t * $profiles and $offers will be available in the view.\n\t\t */\n\t\t$this->set(compact('profiles', 'offers'));\n\n\t}", "public function edit_form_after_title() {\n\t\twp_nonce_field( 'papi_save_data', 'papi_meta_nonce' );\n\n\t\tif ( $value = esc_attr( papi_get_entry_type_id() ) ) {\n\t\t\tpapi_render_html_tag( 'input', [\n\t\t\t\t'data-papi-page-type-key' => true,\n\t\t\t\t'name' => esc_attr( papi_get_page_type_key() ),\n\t\t\t\t'type' => 'hidden',\n\t\t\t\t'value' => $value\n\t\t\t] );\n\t\t}\n\t}", "public function getName()\n {\n return 'user_type';\n }", "public function setType($type){ }", "public function updateItemType($user_id)\n {\n $id = $this->input->post('id');\n $data = array(\n 'name' => $this->input->post('name'),\n 'description' => $this->input->post('description'),\n );\n\n $this->db->where('id', $id);\n return $this->db->update('item_type', $data);\n }", "public function type()\n {\n if (!get_permission('fees_type', 'is_view')) {\n access_denied();\n }\n if ($_POST) {\n if (!get_permission('fees_type', 'is_add')) {\n ajax_access_denied();\n }\n $this->type_validation();\n if ($this->form_validation->run() !== false) {\n $post = $this->input->post();\n $this->fees_model->typeSave($post);\n set_alert('success', translate('information_has_been_saved_successfully'));\n $array = array('status' => 'success');\n } else {\n $error = $this->form_validation->error_array();\n $array = array('status' => 'fail', 'error' => $error);\n }\n echo json_encode($array);\n exit();\n }\n $this->data['categorylist'] = $this->app_lib->getTable('fees_type');\n $this->data['title'] = translate('fees_type');\n $this->data['sub_page'] = 'fees/type';\n $this->data['main_menu'] = 'fees';\n $this->load->view('layout/index', $this->data);\n }" ]
[ "0.7211716", "0.71588373", "0.68605113", "0.66061825", "0.659133", "0.6400657", "0.6358041", "0.6358041", "0.6358041", "0.6326593", "0.6301814", "0.6285107", "0.62576336", "0.6222479", "0.61850893", "0.6142469", "0.60334116", "0.60328645", "0.6023791", "0.60119104", "0.60107064", "0.59973425", "0.5994541", "0.5993877", "0.59891087", "0.59750754", "0.5952233", "0.59418684", "0.5936762", "0.5935251", "0.5934708", "0.5931144", "0.5903566", "0.58923537", "0.5889474", "0.5889264", "0.58868843", "0.5883484", "0.5862905", "0.5857961", "0.58367294", "0.5809353", "0.58043724", "0.57944804", "0.57842773", "0.5779565", "0.5776614", "0.576325", "0.5758236", "0.57487625", "0.57436717", "0.57364625", "0.5726086", "0.5721536", "0.57209843", "0.57197064", "0.57162154", "0.5710557", "0.5704481", "0.5702302", "0.57018787", "0.5695486", "0.5687149", "0.56848454", "0.5683061", "0.5678285", "0.56747806", "0.56708956", "0.56699765", "0.5667469", "0.5667445", "0.5665379", "0.56606054", "0.56505805", "0.56489193", "0.56412417", "0.56404287", "0.56376064", "0.5635902", "0.56346136", "0.56343085", "0.56336844", "0.56257296", "0.5609171", "0.56004286", "0.55904955", "0.5589528", "0.5589421", "0.55779934", "0.55778337", "0.5570357", "0.55666375", "0.5563215", "0.55621904", "0.55525523", "0.55511606", "0.55502295", "0.5548715", "0.55483866", "0.55446374" ]
0.6047827
16
End Edit User Type Delete User Type
public function delete_usertype($id) { // Code goes here $query = $this->setting->deleteusertype($id); $this->session->set_flashdata('rolemsg', '<div class="alert alert-success alert-dismissible text-center"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>User Role Deleted Successfully!!!</div>'); redirect('settings/userrole'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete_user_type($user_type_id)\n\t\t{\n\t\t\t$eventlogbol = new eventlogbol();\n\t\t\t$old_values='';\n\t\t\t$new_values_arr = array();\n\t\t\t$new_values_arr['user_type_id'] = $user_type_id;\n\t\t\t$event_result = $eventlogbol->save_eventlog('Delete','tbl_user_type',$new_values_arr,$old_values);\n\t\t\tif($event_result)\n\t\t\t{\n\t\t\t\t$query=\"DELETE FROM tbl_user_type WHERE user_type_id=:user_type_id \";\t\t\n\t\t\t\t$result = execute_non_query($query, array(':user_type_id' => $user_type_id));\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn false;\n\t\t}", "public function edit(type_of_user $type_of_user)\n {\n //\n }", "public function edit(UserType $userType)\n {\n //\n }", "function tutor_assignment_delete($username, $type, $selected_uid) {\n $type = rtrim($type, \"s\");\n\n $select = eto_user_load($selected_uid);\n \n $title = \"Delete the $type '\" . $select->name . \"' from $username\";\n drupal_set_title($title);\n $output = \"<h2>$title</h2>\";\n\n $user = eto_user_load(array('name' => $username));\n\n $node = (object) array ('uid' => $user->uid,\n\t\t\t 'selected_uid' => $selected_uid,\n\t\t\t 'type' => $type);\n\n $output .= \"Are you sure you want to delete this assignment?\";\n $output .= drupal_get_form('delete_assignment_form', $node);\n\n return $output;\n}", "public function destroy(type_of_user $type_of_user)\n {\n //\n }", "function delete(){\n $user_id = $this->uri->rsegment('3');\n $this->_del($user_id);\n redirect(admin_url('user'));\n\n }", "function deleteuser(){\n\n\t\t$id = $this->input->post('id');\n\n\t\t$this->setting_model->delete('londontec_users','user_id',$id);\n\t\n\t}", "public function destroy(UserType $userType)\n {\n //\n }", "function calendar_display_type_delete() {\n\t\t$db = new DB ;\n\t\tif(isset($_GET['id']) > 0)\n\t\t{\n\t\t\t// update all events who use this event_type we set the event_type to 'other'.\n\t\t\t// if we don't do this, the events who use this event_type can't be edited anymore.\n\t\t\t$result = $this->set_types_to_other($_GET['id']);\n\n\t\t\t// delete the event_type\n\t\t\t$sql = \"delete from event_type where event_type_id = \".$_GET['id'];\n\t\t\t$db->execute_statement($sql);\n\n\t\t\tinclude_once(SF_CLASS_PATH.'/calendar/calendar.inc');\n $calendar_obj = new Calendar ;\n $calendar_obj->cache_event_type_array();\n\t\t\t\t\t\t\t\n\t\t}\n\t\theader('Location: /admin/calendar/display_type_list.php');\n }", "public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fanli_Service_Ptype::getType($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$result = Fanli_Service_Ptype::deleteType($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "public function deleteUserType($UserTypeID, $Input=array()) {\r\n\t\t/*delete group */\r\n\t\t$this->db->where(\"UserTypeID\",$UserTypeID);\r\n\t\t$this->db->delete('tbl_users_type');\r\n\t\treturn true;\r\n\t}", "public function deleteUser()\n {\n\n $this->displayAllEmployees();\n $id = readline(\"Unesite broj ispred zaposlenika kojeg želite izbrisati :\");\n $check = readline(\"Jeste li sigurni? da/ne: \");\n\n if ($check === 'da'){\n $this->employeeStorage->deleteEmployee($id);\n }\n\n }", "public function change(Request $request) {\n // return redirect()->back()->with->('sucess', 'Custodian deleted success');\n $change = User::where('email', '=', $request['email']);\n $change->update(['user_type' => 1]);\n }", "public function deleteType($type){\n\t\t$user = $this->getUser();\n\t\tif(!isset($user[\"id\"])||$user[\"status\"]!=DBConfig::$userStatus[\"admin\"]){\n\t\t\treturn false;\n\t\t}\n\t\t$type = $this->getType($type);\n\t\tif(!isset($type[\"id\"]))return false;\n\t\t$query = Queries::deletetype($type[\"id\"]);\n\t\t$result = $this->query($query);\n\t\tif(!$result)return false;\n\t\t$this->log(\"@\".$user[\"id\"].\" (\".$user[\"username\"].\") deletes type $type\");\n\t\t$query = Queries::removetypefromentries($type[\"id\"]);\n\t\treturn $this->query($query);\n\t}", "public function actionDelete($id,$type)\n {\n if($type=='dept'){\n $model=$this->findModel($id);\n $model->setAttribute('dept_delete',1);\n $model->save(false);\n }else{\n $model=$this->findModel($id);\n $model->setAttribute('branch_delete',1);\n $model->save(false);\n }\n\n return $this->redirect(['index']);\n }", "function exit_user_edit_action($user_id = 0){\n if (!empty($user_id)){ $location = 'admin.php?action=edit_users&subaction=editor&user_id='.$user_id; }\n else { $location = 'admin.php?action=edit_users&subaction=search'; }\n redirect_form_action($location);\n }", "function delete_form()\n\t{\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя изменить ID группы, попытайтесь снова\");\n\t\t}\n\n\t\tif ($this->ipsclass->input['id'] < 5)\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Вы не можете перемещать группы, которые используются в данный момент, но переименовать и отредактировать функции можно\");\n\t\t}\n\n\t\t$this->ipsclass->admin->page_title = \"Удаление пользовательской группы\";\n\n\t\t$this->ipsclass->admin->page_detail = \"Пожалуйста, убедитесь в том, что хотите удалить данную группу.\";\n\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'COUNT(id) as users', 'from' => 'members', 'where' => \"mgroup=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$black_adder = $this->ipsclass->DB->fetch_row();\n\n\t\tif ($black_adder['users'] < 1)\n\t\t{\n\t\t\t$black_adder['users'] = 0;\n\t\t}\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'COUNT(id) as users', 'from' => 'members', 'where' => \"mgroup_others LIKE '%\".intval($this->ipsclass->input['id']).\"%'\" ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$extra_group = $this->ipsclass->DB->fetch_row();\n\n\t\tif ($extra_group['users'] < 1)\n\t\t{\n\t\t\t$extra_group['users'] = 0;\n\t\t}\n\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'g_title', 'from' => 'groups', 'where' => \"g_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$group = $this->ipsclass->DB->fetch_row();\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'g_id, g_title', 'from' => 'groups', 'where' => \"g_id <> \".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$mem_groups = array();\n\n\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Leave out root admin group\n\t\t\t//-----------------------------------------\n\n\t\t\tif ( $this->ipsclass->vars['admin_group'] == $r['g_id'] )\n\t\t\t{\n\t\t\t\tif ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$mem_groups[] = array( $r['g_id'], $r['g_title'] );\n\t\t}\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'dodelete' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'group' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'id' , $this->ipsclass->input['id'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'name' , $group['g_title'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 5 => array( 'section', $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\n\n\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Подтверждение перемещения: \".$group['g_title'] );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Количество пользователей в этой группе</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t \"<b>\".$black_adder['users'].\"</b>\",\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Количество пользователей с этой группой, как <u>вторичная</u> группа</b><br /><i>Эта вторичная группа будет удалена у этих пользователей.</i>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t \"<b>\".$extra_group['users'].\"</b>\",\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Переместить пользователей из этой группы в...</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_dropdown(\"to_id\", $mem_groups )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Удалить эту группу\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->admin->output();\n\t}", "public function deleteProfile($user, $type, $id) {\n return $this->entityFormBuilder()->getForm(Profile::load($id), 'delete');\n }", "function mongo_node_type_delete_form($form, $form_state, $entity_type) {\n $form = array();\n // Send entity type.\n $form['entity_type'] = array(\n '#type' => 'value',\n '#value' => $entity_type,\n );\n $path = '/admin/structure/mongo-node';\n\n $extist_entity_content = '';\n $collection = mongodb_collection('fields_current', $entity_type);\n $count = $collection->count(array('_type' => $entity_type));\n if ($count) {\n $extist_entity_content = t('%type is used by %count piece of content on your site. If you remove this entity type, you will not be able to edit the %type content and it may not display correctly.', array('%type' => $entity_type, '%count' => $count));\n $extist_entity_content .= '<br/><br/>';\n }\n return confirm_form($form, t('Delete entity type'), $path, $extist_entity_content . 'This action cannot be undone', t('Delete'), t('Cancel'), 'mongo_node_type_delete');\n}", "function default_delete(){\n\tglobal $assign_list, $_CONFIG, $_SITE_ROOT, $mod;\n\tglobal $core, $clsModule, $clsButtonNav;\n\t$classTable = \"User\";\n\t$pkeyTable = \"id\";\n\t//################### CAN NOT MODIFY BELOW CODE ###################\n\t$clsTable = new $classTable();\n\t$pval = isset($_REQUEST[$pkeyTable])? $_REQUEST[$pkeyTable] : \"\";\n\tif ($pval!=\"\"){\n\t\t$clsTable->deleteOne($pval);\n\t\theader(\"location: ?$_SITE_ROOT&mod=$mod\");\n\t}\n\t$checkList = isset($_POST[\"checkList\"])? $_POST[\"checkList\"] : \"\";\n\tif (is_array($checkList)){\n\t\tforeach ($checkList as $key => $val){\n\t\t\t$clsTable->deleteOne($val);\n\t\t}\n\t\theader(\"location: ?$_SITE_ROOT&mod=$mod\");\n\t}\n\tunset($clsTable);\n}", "function edithistory_delete()\n{\n\tglobal $db, $mybb, $user;\n\t$db->update_query(\"edithistory\", array('uid' => 0), \"uid='{$user['uid']}'\");\n}", "function travel_type_form_submit_delete(&$form, &$form_state) {\n // Redirect user to \"Delete\" URI for this entity type.\n $form_state['redirect'] = 'admin/structure/travel/' . $form_state['travel_type']->type . '/delete';\n}", "function deleteUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"DELETE\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['_id'])){\n\t\t\t\t\t$where = \"_id='\".$_POST['_id'].\"'\";\n\t\t\t\t\t$delete = $this->model->getUser('*',$where);\n\t\t\t\t\t$result = $this->model->deleteUser($where);\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record deleted.';\n\t\t\t\t\t\t$response_array['data']=$delete;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='The record does not exist';\n\t\t\t\t\t\t$data['user_id'] = $_POST['_id'];\n\t\t\t\t\t\t$response_array['data']=$data;\n\t\t\t\t\t\t$this->rest->response($response_array, 404);\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\t\t\t\n\t\t}", "function wp_delete_signup_on_user_delete($id, $reassign, $user)\n {\n }", "public function undeleteAction(){\n\t}", "public function delete()\n {\n\n $update['id'] = $this->session->userdata('user_id');\n $update['data']['enabled'] = 0;\n $update['data']['active'] = 0;\n $update['table'] = 'users';\n $this->Application_model->update($update);\n\n redirect('/logout','refresh');\n\n }", "public function deleting($educationType)\n {\n\t\tparent::deleting($educationType);\n\n }", "public function getPostAdminDeleteUser()\n {\n $title = \"Avanmäl användare\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n $form = new AdminDeleteUserForm($this->di);\n\n $form->check();\n\n $data = [\n \"form\" => $form->getHTML(),\n ];\n\n $view->add(\"user/crud/admindelete\", $data);\n $tempfix = \"\";\n\n $pageRender->renderPage($tempfix, [\"title\" => $title]);\n }", "function culturefeed_pages_page_delete_member(CultureFeed_Cdb_Item_Page $page, $user = NULL, $request_type = 'nojs') {\n\n $my_pages = FALSE;\n if (empty($user)) {\n try {\n $user = DrupalCultureFeed::getLoggedInUser();\n $my_pages = TRUE;\n }\n catch (Exception $e) {\n watchdog_exception('culturefeed_pages', $e);\n return;\n }\n }\n\n $form = drupal_get_form('culturefeed_pages_delete_member_form', $page, $user, $request_type, $my_pages);\n\n if ($request_type == 'ajax') {\n $output = drupal_render($form);\n print $output;\n }\n else {\n return $form;\n }\n\n}", "public static function setDeleteUser($request,$id){\r\n\t\t// Obtem o feedback do banco de dados pelo id\r\n\t\t$obUser = EntityUser::getUserById($id);\r\n\r\n\t\t//VALIDANDO A INSTANCIA\r\n\t\tif(!$obUser instanceof EntityUser){\r\n\t\t\t$request->getRouter()->redireect('/admin/users');\r\n\t\t}\r\n\r\n\t\t//Exclui o deedback\r\n\t\t$obUser->excluir();\r\n\r\n\t\t\r\n\r\n\t\t//REDIRECIONA O USUARIO\r\n\t\t$request->getRouter()->redirect('/admin/users?status=deleted');\r\n \t}", "function travel_type_form_delete_confirm_submit($form, &$form_state) {\n // Delete the entity type.\n $entity_type = $form_state['entity_type'];\n entity_delete('travel_type', entity_id('travel_type', $entity_type));\n\n // Redirect user.\n drupal_set_message(t('@type %title has been deleted.', array('@type' => $entity_type->type, '%title' => $entity_type->label)));\n $form_state['redirect'] = 'admin/structure/travel';\n}", "function cinerama_edge_user_del_image() {\n\t\tif ( ! isset( $_GET['user_id'] ) ) {\n\t\t\tesc_html_e( 'Not Set or Empty', 'cinerama' );\n\t\t\texit;\n\t\t}\n\n\t\t$field_name = $_GET['field_name'];\n\t\t$user_id = $_GET['user_id'];\n\t\t$imageID = get_user_meta( $user_id, $field_name, true );; // Get our attachment ID\n\n\t\tif ( is_numeric( $imageID ) ) { // Verify that the attachment ID is indeed a number\n\t\t\tdelete_user_meta( $user_id, $field_name );// Delete our image meta\n\t\t\texit;\n\t\t}\n\n\t\tesc_html_e( 'Contact Administrator', 'cinerama' ); // If we've reached this point, something went wrong - enable debugging\n\t\texit;\n\t}", "public function procDeleteUser() {//IF time permits, re-implement using new User classes\r\n global $session;\n\r\n /* uid error checking */\n $field = \"deluser\"; //Use the field for uid\r\n $subuid = $_POST[$field];\r\n\r if($subuid == $session->user->getUID()) { /* Make sure no one tries and delete themselves */\n $session->form->setError($field, \"* You can't delete yourself!<br />\");\n }\n\n if($session->form->num_errors > 0) { /* Errors exist, have user correct them */\n $_SESSION['value_array'] = $_POST;\r\n $_SESSION['error_array'] = $session->form->getErrorArray();\r\n } else { /* Delete user from database */\r\n $session->database->removeUser($subuid, DB_TBL_ADMINS);\r\n $session->database->removeUser($subuid, DB_TBL_TELLERS);\r\n $session->database->removeUser($subuid, DB_TBL_CUSTOMERS);\n }\n header(\"Location: \".$session->referrer);\r\n }", "public function postDelete($type)\n {\n // Declare the rules for the form validation\n $rules = array(\n 'id' => 'required|integer'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n $id = $type->id;\n $type->delete();\n\n // Was the type post deleted?\n $type = Type::find($id);\n if(empty($type))\n {\n // Redirect to the type posts management page\n return Redirect::to('admin/successful-delete')->with('success', Lang::get('admin/types/messages.delete.success'));\n }\n }\n // There was a problem deleting the type post\n return Redirect::to('admin/types/' . $id . '/delete')->with('error', Lang::get('admin/types/messages.delete.error'));\n }", "public function deleteAction(){\n \n $req=$this->getRequest();\n $user=Doctrine::getTable('Users')->find($req->getParam('id')); \n\n // Gli utenti developer non possono essere eliminati \n if ($user->Role->developer){\n $this->errors->addError(\"L'utente Developer non pu&ograve; essere cancellato.\");\n $this->emitSaveData();\n return;\n }\n \n $q=Doctrine_Query::create()\n ->delete()\n ->from('Users')\n ->addWhere('ID = ?',$this->getRequest()->getParam('id'))\n ->execute();\n \n $this->emitJson(array(\"success\"=>true));\n }", "public function destroy($id)\n {\n $userType = UserType::findOrFail($id);\n $result = $userType->delete();\n if ($result){\n return redirect('user-type')->with('success', 'User Type deleted');\n }\n else{\n return back()->with('error','Failed to delete!');\n }\n }", "function deleteRecord()\t{\n\t\tif ($this->conf['delete'])\t{\t// If deleting is enabled\n\t\n\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $this->recUid);\n\t\t\tif (($GLOBALS['TSFE']->loginUser && $this->conf['requireLogin']) || ( $this->aCAuth($origArr)&& $this->conf['requireLogin'])||!$this->conf['requireLogin'])\t{\t// Must be logged in OR be authenticated by the aC code in order to delete\n\t\t\t\t\t// If the recUid selects a record.... (no check here)\n\t\t\t\tif (is_array($origArr))\t{\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr, $GLOBALS['TSFE']->fe_user->user,$this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$this->conf))\t{\t// Display the form, if access granted.\n\t\t\t\t\t\tif (!$GLOBALS['TCA'][$this->theTable]['ctrl']['delete'])\t{\t// If the record is fully deleted... then remove the image (or any file) attached.\n\t\t\t\t\t\t\t$this->deleteFilesFromRecord($this->recUid);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->cObj->DBgetDelete($this->theTable, $this->recUid, TRUE);\n\t\t\t\t\t\t$this->currentArr = $origArr;\n\t\t\t\t\t\t$this->saved = 1;\n\t\t\t\t\t\t$this->userProcess_alt($conf['edit.']['userFunc_afterDelete'],$conf['edit.']['userFunc_afterDelete.'],array('rec'=>$this->currentArr, 'origRec'=>$origArr));\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->error = '###TEMPLATE_NO_PERMISSIONS###';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\t\t$this->error = '###TEMPLATE_NO_PERMISSIONS###';\n\t\t }\n\t\t}\n\t}", "public function actionDelete($id)\n\t{\n\t\t$user = User::model()->find('username=?',array(Yii::app()->user->name));\n\t\t$user_right_ID = $user->user_right_ID;\n\t\t$type_ID = $user->user_type_ID;\n\t\tif($user_right_ID == \"2\"){\n\t\t\t$this->loadModel($id)->delete();\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif(!isset($_GET['ajax']))\n\t\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t\t}else{\n\t\t\t\n\t\t\techo \"<script>alert('Sie sind nicht berechtigt, diese Aktion durchzuführen')</script>\";\n\t\t}\n\n\t}", "public function edit(User $user)\n {\n $user_types = DB::table(\"user_types\")->where(\"id\",\"!=\",\"6\")->get();\n\n if(Auth::user()->type!=6){\n if($user->deleted==1){\n return view('errors.404');\n }\n }\n return view('users.edit', compact('user',\"user_types\"));\n }", "static function remove_user($user1, $user2) {\n global $con;\n\n $sql = \"UPDATE `relationship` SET `type` = 0 WHERE `user1` = \".$user1.\" AND `user2` = \".$user2.\";\";\n $query = mysqli_query($con, $sql);\n return 1;\n }", "public function cancelUserDeletion(): void\n {\n $this->dispatch('close-modal', id: 'confirmingUserDeletion');\n }", "private function __clearEditSession ($type = CLEAR_ALL) {\n if (($type == CLEAR_ALL | $type == CLEAR_QUESTION)) {\n if ($this->Session->check('SurveyQuestion.new')) $this->Session->delete('SurveyQuestion.new');\n if ($this->Session->check('SurveyQuestion.delete')) $this->Session->delete('SurveyQuestion.delete');\n if ($this->Session->check('Survey.id')) $this->Session->delete('Survey.id');\n }\n if (($type == CLEAR_ALL | $type == CLEAR_RESPONDENT)) {\n if ($this->Session->check('SurveyRespondent.new')) $this->Session->delete('SurveyRespondent.new');\n if ($this->Session->check('SurveyRespondent.delete')) $this->Session->delete('SurveyRespondent.delete');\n }\n if (($type == CLEAR_ALL | $type == CLEAR_SURVEY)) {\n if ($this->Session->check('Survey.type')) $this->Session->delete('Survey.type');\n if ($this->Session->check('Survey.original')) $this->Session->delete('Survey.original');\n if ($this->Session->check('Survey.progress')) $this->Session->delete('Survey.progress');\n if ($this->Session->check('Survey.answers')) $this->Session->delete('Survey.answers');\n if ($this->Session->check('Survey.hierarcy')) $this->Session->delete('Survey.hierarcy');\n if ($this->Session->check('Survey.mainGoal')) $this->Session->delete('Survey.mainGoal');\n if ($this->Session->check('Survey.respondent')) $this->Session->delete('Survey.respondent');\n if ($this->Session->check('Survey.started')) $this->Session->delete('Survey.started');\n if ($this->Session->check('Survey.id')) $this->Session->delete('Survey.id');\n }\n }", "public function edit(Type $type)\n {\n //\n }", "public function edit(Type $type)\n {\n //\n }", "public function edit(Type $type)\n {\n //\n }", "function validate_user_deletion()\n{ }", "public function delete()\n {\n foreach ($this->users as $user) {\n $uid = $user->id;\n // delete whole website info for this user\n if ((bool)$this->delete) {\n $model = new FormUserClear($user);\n $model->comments = true;\n $model->content = true;\n $model->feedback = true;\n $model->wall = true;\n $model->make();\n }\n\n // delete avatars\n File::remove('/upload/user/avatar/big/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/medium/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/small/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/original/' . $uid . '.jpg');\n // delete user profile and auth data\n $user->profile()->delete();\n // delete user provider data\n $user->provider()->delete();\n // delete user object\n $user->delete();\n }\n }", "function DeleteEntry() {\n\t\t//to choose an option to delete the selected user. \n\n //Select all contacts in the addressbook\n $data['display_block'] = $this->AddressBook->selectContacts();\n\n //Render the DeleteEntry View. All the options for the \n\t\t//the Select box on DeleteEntry view are in the field $data['display_block']\n $this->load->view('DeleteEntry', $data);\t\n\t}", "protected function _postDelete()\n\t{\n\t\t//register events\n\t\t\\Base\\Event::trigger('user.delete',$this->id);\n\t\t//end events\n\t}", "public function deleteUser()\n {\n $this->delete();\n }", "public function delete() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"UPDATE users SET state='DELETED' WHERE id = ?\");\n\t\t$stmt->execute(array($this->id));\n\t}", "public function destroy(Request $request, $id,$type = 'soft')\n {\n if(ACLHelper::hasPermission('delete_account')){\n try {\n $user = User::find($id);\n \n if($user instanceof User){\n \n $restaurants = Restaurant::withTrashed()->where('user_id',$id)->get();\n \n if(count($restaurants) > 0){\n if($type == 'force'){ \n foreach ($restaurants as $restaurant) {\n $menus = Menu::withTrashed()->where('restaurant_id',$restaurant->id)->get();\n if(count($menus) >0){ \n $menusArr = $menus->toArray();\n $ids_to_delete = array_map(function($menu){ return $menu['id']; }, $menusArr);\n $del_menu_cate = MenuFoodType::whereIn('menu_id',$ids_to_delete)->forceDelete();\n \n $menus = Menu::withTrashed()->where('restaurant_id',$restaurant->id)->forceDelete();\n }\n $restaurant->forceDelete();\n } \n\n $userPackage = UserPackage::withTrashed()->where('user_id',$id)->forceDelete(); \n \n }else{\n foreach ($restaurants as $restaurant) {\n $delMenus = Menu::where('restaurant_id',$restaurant->id)->delete();\n \n $restaurant->delete();\n } \n\n $delUserPackage = UserPackage::where('user_id',$id)->delete(); \n }\n }\n \n $del_account = ($type == 'force')?$user->forceDelete():$user->delete();\n \n Session::flash('success_message', 'User is deleted!');\n }else{\n Session::flash('fail_message', 'User is not found!');\n } \n } catch (Exception $exc) {\n Session::flash('fail_message', 'Fail! '.$exc->getTraceAsString());\n }\n \n return redirect('admin/users');\n \n }else{\n abort(404, 'Access denied!');\n } \n }", "function remove_id_type($id_type_id = '')\n\t{\n\t\t$this->db->where('id_type_id', $id_type_id);\n\t\t$this->db->delete('id_type');\n\n\t\t$this->session->set_flashdata('success', 'ID type has been deleted successfully.');\n\n\t\tredirect(base_url() . 'id_type_settings', 'refresh');\n\t}", "public function post_delete(){\n\t\t\t\n\t\t$data \t= \tFiledb::_rawurldecode(json_decode(stripcslashes(Input::get('data')), true));\n\n\t\tif($data[\"delete\"] == 'delete'){\n\t\t\t\n\t\t\t$status = Users::delete($data[\"id\"]);\n\n\t\t\treturn ($status) ? Utilites::success_message(__('forms.deleted_word')) : Utilites::fail_message(__('forms_errors.undefined'));\n\t\t}\n\t}", "public function delete() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::update(FALSE, ['isdeleted', 'deletedtime', 'deleteduser']);\n }", "public function delete($user){\n }", "public function delete_user($user);", "public function delete(){\n\n\t\t$remark = $this->input->post('remark');\n\t\t$id = $this->input->post('id');\n\t\t\n\t\tvalid_company('users','company_id',$id);\n\n\t\tif(!empty($remark)){\n\n\t\t\t$getRemark = $this->db->query(\"SELECT `remark` FROM `users` where `id` = '\".$id.\"'\")->row()->remark;\n\t\t\n\t\t\t$this->db->query(\"UPDATE `users` SET `remark`= '\".$getRemark.',Deactivate:'.$remark.\"' where `id` = '\".$id.\"'\");\n\t\t}\n\n\t\tif($this->Users_model->delete($id)){\n\t\t\t$historydata = [\n\t\t\t\t'company_id'\t=>\t$this->get_company_id(),\n\t\t\t\t'user_id'\t\t=>\t$this->get_user_id(),\n\t\t\t\t'action_id'\t\t=>\t$id,\n\t\t\t\t'action'\t\t=>\t'Deactivate',\n\t\t\t\t'action_on'\t\t=>\tgetDriverFullName($id),\n\t\t\t\t'action_place'\t=>\t'User',\n\t\t\t];\n\t\t\thistory($historydata);\n\t\t\t$this->session->set_flashdata('success', 'User deleted Successfully');\n\n\t\t}else{\n\t\t\t$this->session->set_flashdata('error', 'User Not deleted Successfully');\n\t\t}\n\n\n\t\treturn redirect('companyusers');\n\n\n\t}", "public function Delete(){\n $query = \"DELETE FROM user where id=\".$this->id;\n\n $result = $this->dbh->exec($query);\n if ($result) {\n Message::setMessage(\"<div class='yes'>Removed Permanently</div>\");\n } else {\n\n Message::setMessage(\"<div class='no'>Failed to Remove</div>\");\n }\n Utility::redirect(\"volunteers.php\");\n }", "public function actionDelexpert() {\n if (\\yii::$app->request->isPost && !\\yii::$app->user->isGuest) {\n $user = new User;\n $expert = new Expert;\n $expert -> id = (int) \\yii::$app->request->post('expert');\n $user->user_id = \\yii::$app->user->id;\n \n if (!$user->isAdmin()) {\n echo \"{'error': 'стой, ты не админ!'}\";\n } elseif ($expert->hasQuestions()) {\n echo json_encode(['error' => 'Невозможно удалить, у эксперта есть вопросы']);\n } else {\n\n $remove_user = new User;\n $remove_expert = new Expert;\n $id = (int) \\yii::$app->request->post('expert');\n if ($remove_expert->remove($id) && $remove_user->remove($id)) {\n echo json_encode(['success' => 'success']);\n } else\n echo json_encode(['error' => 'Что-то пошло не так']);\n }\n }\n }", "function timetracking_type_delete(timetrackingType $type) {\n $type->delete();\n}", "public function user_delete_post()\n { \n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n \n $id = $data['id'];\n $where = array(\n 'id' => $id\n );\n $this->model->delete('users', $where);\n $resp = array('rccode' => 200,'message' =>'success');\n $this->response($resp);\n }", "function deleteUserAccount(){\n\t\t\t$id = $_POST[\"id\"];\n\t\t\t$this->db->set('status', 'Deactivated');\n\t\t\t$this->db->where('userID', $id);\n\t\t\t$query = $this->db->update('users');\n\t\t\t\n\t\t\tif($query){\n\t\t\t\techo \"done\";\n\t\t\t}\n\t\t\t\n\t\t}", "private function _addOrEdit($user,$type= 'add') {\n \n $user_id = $user['id'];\n\n //Get the creator's id\n if(isset($this->request->data['user_id'])){\n if($this->request->data['user_id'] == '0'){ //This is the holder of the token - override '0'\n $this->request->data['user_id'] = $user_id;\n }\n }\n\n $check_items = array(\n\t\t\t'available_to_siblings',\n\t\t\t'suffix_permanent_users',\n\t\t\t'suffix_vouchers',\n 'suffix_devices'\n\t\t);\n\t\t\n foreach($check_items as $i){\n if(isset($this->request->data[$i])){\n $this->request->data[$i] = 1;\n }else{\n $this->request->data[$i] = 0;\n }\n }\n \n if($type == 'add'){ \n $entity = $this->{$this->main_model}->newEntity($this->request->data());\n }\n \n if($type == 'edit'){\n $entity = $this->{$this->main_model}->get($this->request->data['id']);\n $this->{$this->main_model}->patchEntity($entity, $this->request->data());\n }\n \n if ($this->{$this->main_model}->save($entity)) {\n $this->set(array(\n 'success' => true,\n '_serialize' => array('success')\n ));\n } else {\n $message = 'Error';\n \n $errors = $entity->errors();\n $a = [];\n foreach(array_keys($errors) as $field){\n $detail_string = '';\n $error_detail = $errors[$field];\n foreach(array_keys($error_detail) as $error){\n $detail_string = $detail_string.\" \".$error_detail[$error]; \n }\n $a[$field] = $detail_string;\n }\n \n $this->set(array(\n 'errors' => $a,\n 'success' => false,\n 'message' => array('message' => __('Could not create item')),\n '_serialize' => array('errors','success','message')\n ));\n }\n\t}", "function deleteuser_vizitki($user_id) {\n\tglobal $database;\n\n\t// DELETE vizitki ENTRIES AND COMMENTS\n\t$database->database_query(\"DELETE FROM se_vizitkientries, se_vizitkicomments USING se_vizitkientries LEFT JOIN se_vizitkicomments ON se_vizitkientries.vizitkientry_id=se_vizitkicomments.vizitkicomment_vizitkientry_id WHERE se_vizitkientries.vizitkientry_user_id='$user_id'\");\n\n\t// DELETE COMMENTS POSTED BY USER\n\t$database->database_query(\"DELETE FROM se_vizitkicomments WHERE vizitkicomment_authoruser_id='$user_id'\");\n\n\t// DELETE STYLE\n\t$database->database_query(\"DELETE FROM se_vizitkistyles WHERE vizitkistyle_user_id='$user_id'\");\n\n}", "public function actionDel($id){\n $user = $this->findModel($id);\n $user->status = 1;\n $user->save();\n // echo \"<pre>\".print_r($user->errors, true); die;\n// var_dump($user->status); die;\n return $this->redirect('index');\n }", "function trash() { \n\t\t$adsdetail = JRequest::get('POST');\n\t\t$model = $this->getModel('showads');\n\t\t$model->statusChange($adsdetail);\n\t}", "public function delete()\n {\n $textvalues = $this->gettextvalues();\n $this->deleteValues($textvalues);\n \n $componentvalues = $this->getcomponentvalues();\n $this->deleteValues($componentvalues);\n \n $filevalues = $this->getfilevalues();\n $this->deleteValues($filevalues);\n \n $contributorvalues = $this->getcontributorvalues();\n $this->deleteValues($contributorvalues);\n \n parent::delete();\n }", "function crealead_trainings_session_remove_user($type='ajax') {\n if ($type == 'ajax') {\n global $user;\n $session_nid = arg(1);\n //watchdog('crealead_trainings', '[REMOVE] Session id = ' . $session_nid);\n\n // First we seek the field collection item having the current user as field_user_name.\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'field_collection_item')\n ->propertyCondition('field_name','field_interested_users')\n ->fieldCondition('field_user_name', 'target_id', $user->uid);\n $result = $query->execute();\n $fci_id = key($result['field_collection_item']);\n\n // Then, we delete the field collection item.\n field_collection_item_delete($fci_id);\n\n $switch_link = crealead_trainings_get_interest_widget(false, $session_nid, $user);\n\n // Finally, we prepare the ajax response and deliver it.\n $commands = array();\n $commands[] = ajax_command_replace('#session-switch-wrapper', $switch_link);\n $page = array('#type' => 'ajax', '#commands' => $commands);\n ajax_deliver($page);\n }\n else {\n $output = 'Attention ! Contenu non ajax. Javascript est désactivé';\n return $output;\n }\n}", "public function delete_userlist_data() //delete img\n {\n $this->Admin_Insert->userlist_delete();\n redirect('admin/userlist');\n }", "function del($ar){\n $p = new XParam($ar, array());\n $oid = $p->get('oid');\n $lnkuser = selectQuery('select lnkuser from '.$this->xset->getTable().' where KOID=\\''.$oid.'\\'')->fetch(PDO::FETCH_COLUMN);\n // satus du compte \n updateQuery('update '.$this->xset->getTable().' set STATUS=\\'INACTIVE\\' where KOID=\\''.$oid.'\\'');\n // date du users\n updateQuery('update USERS set DATET=\\''.date('Y-m-d').'\\' where KOID=\\''.$lnkuser.'\\'');\n }", "function mongo_node_type_delete_form_submit($form, $form_state) {\n $set = mongo_node_settings();\n\n // Remove entity type.\n $entity_type = $form_state['values']['entity_type'];\n unset($set[$entity_type]);\n\n // Drop collection that stores entities for entity type.\n $collection = mongodb_collection('fields_current', $entity_type);\n $collection->drop();\n\n // Drop collection that stores entity types autoincrement ids.\n $collection = mongodb_collection($entity_type . '_ids');\n $collection->drop();\n\n mongo_node_settings_save($set);\n\n // Redirect to entity type admin.\n drupal_goto('admin/structure/mongo-node');\n}", "public function deleteAction() {\n $uid = $this->getInput('uid');\n $info = Admin_Service_User::getUser($uid);\n if ($info && $info['groupid'] == 0) $this->output(-1, '此用户无法删除');\n if ($uid < 1) $this->output(-1, '参数错误');\n $result = Admin_Service_User::deleteUser($uid);\n if (!$result) $this->output(-1, '操作失败');\n $this->output(0, '操作成功');\n }", "public function typecomingcustomer_delete(){\n \n $param=array();\n $param[\"KD_TYPECOMINGCUSTOMER\"] = $this->delete(\"kd_typecomingcustomer\");\n $param[\"LASTMODIFIED_BY\"] = $this->delete(\"lastmodified_by\");\n $this->resultdata(\"SP_SETUP_TYPECOMINGCUSTOMER_DELETE\",$param,'delete',TRUE);\n }", "public function userDeleted();", "public function onDeleteField()\n {\n $code = post('code');\n FieldManager::deleteField($code);\n return Redirect::to(Backend::url('clake/userextended/fields/manage'));\n }", "function user_remove($user_info)\n {\n }", "public function delete(): void\n {\n $id = $this->id;\n $this->fetch(\n 'DELETE FROM user WHERE id = ?;',\n [$id]\n );\n }", "function delete() {\n\t\t\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\tConfigure::write('debug', 0);\n\t\t\n\t\t$id = $this->Session->read('Member.memberid');\n\t\t\n\t\t// id 4 means trash\n\t\t\n\t\t$activeid = 4;\n\t\t\t$this->Member->updateAll(array(\n\t\t\t\t'Member.active' => \"'\" . $activeid . \"'\"\n\t\t\t), array(\n\t\t\t\t'Member.id' => $id\n\t\t\t));\n\t\t\n\t\techo \"deleted\";\n\t\t\t\n\t\n\t/*\tif ($id) {\n\t\t\t\n\t\t\t$delete = $this->Member->delete($id);\n\t\t\t\n\t\t \tif ($delete) {\n\t\t\t\t$meta = $this->userMeta->deleteAll(array(\n\t\t\t\t\t'userMeta.member_id' => $id\n\t\t\t\t));\n\t\t\t\t$course = $this->TutCourse->deleteAll(array(\n\t\t\t\t\t'TutCourse.member_id' => $id\n\t\t\t\t));\n\t\t\t\t$event = $this->TutEvent->deleteAll(array(\n\t\t\t\t\t'TutEvent.tutor_id' => $id\n\t\t\t\t));\n\t\t\t\t$image = $this->UserImage->deleteAll(array(\n\t\t\t\t\t'UserImage.user_id' => $id\n\t\t\t\t));\n\t\t\t\t\n\t\t\t}\n\t\t\tif ($meta) {\n\t\t\t\techo \"deleted\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} */\n\t\t\n\t\t\n\t\n\t\n\t}", "function travel_type_form_delete_confirm($form, &$form_state, $entity_type) {\n // Store the entity in the form.\n $form_state['entity_type'] = $entity_type;\n\n // Show confirm dialog.\n $message = t('Are you sure you want to delete entity type %title?', array('%title' => entity_label('entity_type', $entity_type)));\n return confirm_form(\n $form,\n $message,\n 'travel/' . entity_id('travel_type', $entity_type),\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n}", "public function deleteByIdType($id, $type);", "function delete($recordID) \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\n \n\t if(UserModel::Create()->UpdateIsActive($recordID)==1)\n\t\t{$this->renderWithTemplate('users/delete', 'AdminPageBaseTemplate');}\n\t\telse\n\t\t{$this->renderWithTemplate('users/error', 'AdminPageBaseTemplate');}\n }", "public function remove() {\n\n // Updates DB (data & metadata)\n $this->attributes->removeAll($this->get(\"id\"));\n $this->db->delete(XCMS_Tables::TABLE_USERS, array(\n \"id\" => $this->get(\"id\")\n ));\n\n }", "function Remove(){\n\t\tif($this->AuthUser->Role=='Demo'){ // handle demo mode\n\t\t\t$tojson = array (\n\t\t\t \"IsSuccessful\" => 'false',\n\t\t\t\t\"Error\" => 'Not available in demo mode'\n\t\t\t);\n\n\t\t\t// encode to json\n\t\t\t$encoded = json_encode($tojson);\n\n\t\t\tdie($encoded);\n\t\t}\n\n\t\t$menuTypeUniqId = $this->GetPostData(\"MenuTypeUniqId\");\n\t\t\n\t\t$menuType = MenuType::GetByMenuTypeUniqId($menuTypeUniqId);\n\t\t\n\t\t$menuType->Delete();\n\t\t\n\t\t// return MenuTypeUniqId\n\t\t$tojson = array (\n\t\t 'IsSuccessful' => 'true',\n\t\t\t'MenuTypeUniqId' => $menuTypeUniqId,\n\t\t\t'Message' => 'Menu type removed successfully'\n\t\t);\n\t\t\n\t\t// encode to json\n\t\t$encoded = json_encode($tojson);\n\t\t \n\t\tdie($encoded);\n\t}", "public function deleted(ClaseType $clases_type)\n {\n // $clases_type->blocks()->delete();\n }", "function delUser_ant () // Renomeada para n�o ser usada. Antiga delUser() \n{\n\tglobal $xoopsDB, $myts, $xoopsConfig, $xoopsModule;\n\n\t$query = \"SELECT * FROM \". $xoopsDB->prefix('xmail_newsletter') .\" WHERE user_email='\" . $myts->makeTboxData4Save($_POST['user_mail']) . \"' \";\n\t$result = $xoopsDB->query($query);\n\t$myarray = $xoopsDB->fetchArray($result);\n\n\t$mymail = $myts->makeTboxData4Save($_POST['user_mail']);\n\tif ($myarray) {\n\t\tif ($myarray['confirmed'] == '0')\n\t\t\treturn -1;\n\n\t\t$query = \"UPDATE \" . $xoopsDB->prefix('xmail_newsletter') . \" SET confirmed='0' WHERE user_email='$mymail'\";\n\t\t$result = $xoopsDB->queryF($query);\n\t\t\n\t\t// eliminar o perfil\n\t\t$sql=' delete from '.$xoopsDB->prefix('xmail_perfil_news').' where user_id='.$myarray['user_id'];\n\t\t$result2=$xoopsDB->queryf($sql);\n\t\tif(!$result2){\n\t\t\txoops_error('Erro ao eliminar perfil'.$xoopsDB->error());\n\t\t}\n\t\t\t\n\t\t\n\t\treturn 1;\n\t} else {\n\t\treturn -2;\n\t}\n}", "Public Function PermanentDelete()\n\t{\n\t\t$this->_db->delete('bevomedia_user', 'ID = ' . $this->id);\n\t\t$this->_db->delete('bevomedia_user_info', 'ID = ' . $this->id);\n\t}", "function user_delete($user_id) {\n\t\t\n\t\tif(!$this->has_access(__FUNCTION__, __CLASS__, $this->output_data['module'])) {\n\t\t\tset_warning_message('Sory you\\'re not allowed to access this page.');\n\t\t\tredirect('admin');\n\t\t\texit;\n\t\t} elseif($user_id == get_user_id()){\n\t\t\tset_warning_message('Sory you cannot delete your own account.');\n\t\t\tredirect('admin');\n\t\t\texit;\n\t\t} else { \n\t\t\t$this->user_model->delete_user($user_id);\n\t\t\tset_success_message('Successfully delete user');\n\t\t\t$this->show_list();\n\t\t}\n\t}", "public function admin_remove($id){\n\t\t\t$user = User::find($id);\n\t\t\t$role_id = $user->role_id;\n\t\t\tif($user->is_deleted==1){\n\t\t\t\t$user->is_deleted = 0;\n\t\t\t\t}else {\n\t\t\t\t$user->is_deleted = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif($user->save()){\n\t\t\t\tSession::flash('message', 'Company account has been deleted successfully.');\n\t\t\t\treturn Redirect::to('admin/users/'.$role_id);\n\t\t\t}\n\t\t\t\n\t\t}", "function d4os_io_db_070_os_user_delete($uuid) {\n // TODO : delete all assets (impossible ?)\n // TODO : delete groups\n\n // delete offline messages\n drupal_set_message(t('Deleting offline messages.'));\n d4os_io_db_070_offline_message_user_delete($uuid);\n/*\n // delete search\n drupal_set_message(t('Deleting search info.'));\n d4os_io_db_070_os_search_user_delete($uuid);\n*/\n // delete profile\n drupal_set_message(t('Deleting profile info.'));\n d4os_io_db_070_os_profile_user_delete($uuid);\n\n // delete attachments and inventory\n drupal_set_message(t('Deleting inventory.'));\n d4os_io_db_070_os_inventory_user_delete($uuid);\n\n // delete sessions\n drupal_set_message(t('Deleting sessions.'));\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {Presence} WHERE UserID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n/*\n // delete friends\n drupal_set_message(t('Deleting friends.'));\n d4os_io_db_070_set_active('os_users');\n db_query(\"DELETE FROM {userfriends} WHERE ownerID='%s' OR friendID = '%s'\", array($uuid, $uuid));\n d4os_io_db_070_set_active('default');\n*/\n // delete user entry in the grid\n drupal_set_message(t('Deleting user.'));\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {UserAccounts} WHERE PrincipalID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {auth} WHERE UUID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {GridUser} WHERE UserID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n\n // delete the user drupal link \n db_query(\"DELETE FROM {d4os_ui_users} WHERE UUID='%s'\", $uuid);\n}", "public function deleted(Edit $edit)\n {\n //\n }", "function delete_user_option($user_id, $option_name, $is_global = \\false)\n {\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleteAction(){\r\n\t\t$this->getHelper('viewRenderer')->setNoRender();\r\n\t\t$this->_helper->layout->disableLayout();\t\r\n\t\t$id = $this->_getParam('id');\r\n\t\t//\"UPDATE `user` SET `active`=abs(`active`-1) WHERE user_id='$id'\";\r\n\t\t$sql =\"DELETE FROM `user` WHERE `user_id` = '\".$id.\"'\";\r\n\t\t//echo $sql;die();\r\n\t\t$del = Zend_Registry::get(\"db\")->query($sql);\r\n\t\t\r\n\t\tif($del){\r\n\t\t\t$this->_flashMessenger->addMessage('Selected record deleted');\r\n\t\t\t$this->_redirect('/admin/user/');\t\r\n\t\t}\r\n\t}", "public function delete()\n\t{\n\t\t$selection = $this->input->post('selection');\n\t\t$ignore = implode('|', array_diff($this->ignore_list, $selection));\n\t\t$this->member->ignore_list = $ignore;\n\t\t$this->member->save();\n\n\t\tee()->functions->redirect(ee('CP/URL')->make($this->index_url, $this->query_string));\n\t}", "public function remove()\n\t{\n\t\t$data_id = $this->input->post('remove_user_id');\n\t\t\n\t\t$this->load->model('user_model');\n\t\t$result = $this->user_model->remove($data_id);\n\t\t\n\t\tif($result)\n\t\techo \"Data remove was successful!\";\n\t\telse\n\t\techo \"Data remove not successful!\";\n\t\t\n\t}", "public function delete($user)\n {\n\n }", "public function actionDelete() {}" ]
[ "0.713218", "0.680188", "0.67061424", "0.66938746", "0.66878885", "0.6485251", "0.64840984", "0.64666694", "0.64426273", "0.63870716", "0.6329906", "0.63139945", "0.6293805", "0.6149309", "0.61340964", "0.6128018", "0.61150014", "0.6114083", "0.6069596", "0.60386413", "0.60154086", "0.6014261", "0.6005925", "0.60051244", "0.60001534", "0.59930587", "0.5986666", "0.5975677", "0.5965445", "0.5958874", "0.5944033", "0.5939247", "0.5927152", "0.5922731", "0.5922156", "0.5916293", "0.59159243", "0.5910791", "0.59038556", "0.59024274", "0.58898747", "0.5887613", "0.5884647", "0.5884647", "0.5884647", "0.58825123", "0.58705145", "0.5870233", "0.5852914", "0.5848008", "0.58473384", "0.584715", "0.584149", "0.58403355", "0.5833082", "0.5832432", "0.5830999", "0.5825533", "0.58188504", "0.5818059", "0.58129877", "0.58034366", "0.579878", "0.57929015", "0.57928467", "0.5790697", "0.57885355", "0.5779586", "0.57748806", "0.57709014", "0.57696396", "0.57678753", "0.57670486", "0.57625824", "0.5761891", "0.57527316", "0.5738691", "0.5731486", "0.57295626", "0.5724804", "0.57243264", "0.5723357", "0.5722353", "0.57161534", "0.57156074", "0.57119435", "0.5706553", "0.5705922", "0.57057625", "0.5705602", "0.57022095", "0.5699249", "0.5697826", "0.5697826", "0.5697826", "0.5695149", "0.5693405", "0.56916255", "0.56905377", "0.5684938" ]
0.62984574
12
End Delete User Type Tax
public function taxupdate() { $arr['page'] = 'taxdetail'; $arr['active'] = 'other'; $arr['productTax'] = $this->setting->getTax('product'); $arr['shippingTax'] = $this->setting->getTax('shipping'); $this->load->view('vwSettingTax',$arr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete_user_type($user_type_id)\n\t\t{\n\t\t\t$eventlogbol = new eventlogbol();\n\t\t\t$old_values='';\n\t\t\t$new_values_arr = array();\n\t\t\t$new_values_arr['user_type_id'] = $user_type_id;\n\t\t\t$event_result = $eventlogbol->save_eventlog('Delete','tbl_user_type',$new_values_arr,$old_values);\n\t\t\tif($event_result)\n\t\t\t{\n\t\t\t\t$query=\"DELETE FROM tbl_user_type WHERE user_type_id=:user_type_id \";\t\t\n\t\t\t\t$result = execute_non_query($query, array(':user_type_id' => $user_type_id));\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn false;\n\t\t}", "function _wp_delete_tax_menu_item($object_id, $tt_id, $taxonomy)\n {\n }", "function deleteuser_vizitki($user_id) {\n\tglobal $database;\n\n\t// DELETE vizitki ENTRIES AND COMMENTS\n\t$database->database_query(\"DELETE FROM se_vizitkientries, se_vizitkicomments USING se_vizitkientries LEFT JOIN se_vizitkicomments ON se_vizitkientries.vizitkientry_id=se_vizitkicomments.vizitkicomment_vizitkientry_id WHERE se_vizitkientries.vizitkientry_user_id='$user_id'\");\n\n\t// DELETE COMMENTS POSTED BY USER\n\t$database->database_query(\"DELETE FROM se_vizitkicomments WHERE vizitkicomment_authoruser_id='$user_id'\");\n\n\t// DELETE STYLE\n\t$database->database_query(\"DELETE FROM se_vizitkistyles WHERE vizitkistyle_user_id='$user_id'\");\n\n}", "public function deleteAction() {\n\t\t$id = filter_var($this->_request->getParam('id'), FILTER_SANITIZE_NUMBER_INT);\n if ($id){\n return Models_Mapper_Tax::getInstance()->delete($id);\n }\n\t}", "public function deleteUser()\n {\n\n $this->displayAllEmployees();\n $id = readline(\"Unesite broj ispred zaposlenika kojeg želite izbrisati :\");\n $check = readline(\"Jeste li sigurni? da/ne: \");\n\n if ($check === 'da'){\n $this->employeeStorage->deleteEmployee($id);\n }\n\n }", "function cinerama_edge_tax_del_image() {\n\t\tif ( ! isset( $_GET['term_id'] ) ) {\n\t\t\tesc_html_e( 'Not Set or Empty', 'cinerama' );\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$field_name = $_GET['field_name'];\n\t\t$term_id = $_GET['term_id'];\n\t\t$imageID = get_term_meta( $term_id, $field_name, true ); // Get our attachment ID\n\t\t\n\t\tif ( is_numeric( $imageID ) ) { // Verify that the attachment ID is indeed a number\n\t\t\twp_delete_attachment( $imageID ); // Delete our image\n\t\t\tdelete_term_meta( $term_id, $field_name );// Delete our image meta\n\t\t\texit;\n\t\t}\n\t\t\n\t\tesc_html_e( 'Contact Administrator', 'cinerama' ); // If we've reached this point, something went wrong - enable debugging\n\t\texit;\n\t}", "protected function afterDelete()\n {\n parent::afterDelete();\n self::extraAfterDelete($this);\n \n\t\t\t\n\t\t//Implements to delete The Term Relation Ship\t\t\n }", "public function typecomingcustomer_delete(){\n \n $param=array();\n $param[\"KD_TYPECOMINGCUSTOMER\"] = $this->delete(\"kd_typecomingcustomer\");\n $param[\"LASTMODIFIED_BY\"] = $this->delete(\"lastmodified_by\");\n $this->resultdata(\"SP_SETUP_TYPECOMINGCUSTOMER_DELETE\",$param,'delete',TRUE);\n }", "function delete(){\n $user_id = $this->uri->rsegment('3');\n $this->_del($user_id);\n redirect(admin_url('user'));\n\n }", "public function destroy(type_of_user $type_of_user)\n {\n //\n }", "function delUser_ant () // Renomeada para n�o ser usada. Antiga delUser() \n{\n\tglobal $xoopsDB, $myts, $xoopsConfig, $xoopsModule;\n\n\t$query = \"SELECT * FROM \". $xoopsDB->prefix('xmail_newsletter') .\" WHERE user_email='\" . $myts->makeTboxData4Save($_POST['user_mail']) . \"' \";\n\t$result = $xoopsDB->query($query);\n\t$myarray = $xoopsDB->fetchArray($result);\n\n\t$mymail = $myts->makeTboxData4Save($_POST['user_mail']);\n\tif ($myarray) {\n\t\tif ($myarray['confirmed'] == '0')\n\t\t\treturn -1;\n\n\t\t$query = \"UPDATE \" . $xoopsDB->prefix('xmail_newsletter') . \" SET confirmed='0' WHERE user_email='$mymail'\";\n\t\t$result = $xoopsDB->queryF($query);\n\t\t\n\t\t// eliminar o perfil\n\t\t$sql=' delete from '.$xoopsDB->prefix('xmail_perfil_news').' where user_id='.$myarray['user_id'];\n\t\t$result2=$xoopsDB->queryf($sql);\n\t\tif(!$result2){\n\t\t\txoops_error('Erro ao eliminar perfil'.$xoopsDB->error());\n\t\t}\n\t\t\t\n\t\t\n\t\treturn 1;\n\t} else {\n\t\treturn -2;\n\t}\n}", "public function delete()\n {\n $textvalues = $this->gettextvalues();\n $this->deleteValues($textvalues);\n \n $componentvalues = $this->getcomponentvalues();\n $this->deleteValues($componentvalues);\n \n $filevalues = $this->getfilevalues();\n $this->deleteValues($filevalues);\n \n $contributorvalues = $this->getcontributorvalues();\n $this->deleteValues($contributorvalues);\n \n parent::delete();\n }", "function delete_type($id)\n\t\t{\n\t\t\n\t\t$this->db->where('revenue_id',$id);\n\t\t\n\t\t$this->db->delete($this->table_name);\n\t\t\n\t\t}", "function travel_type_form_delete_confirm_submit($form, &$form_state) {\n // Delete the entity type.\n $entity_type = $form_state['entity_type'];\n entity_delete('travel_type', entity_id('travel_type', $entity_type));\n\n // Redirect user.\n drupal_set_message(t('@type %title has been deleted.', array('@type' => $entity_type->type, '%title' => $entity_type->label)));\n $form_state['redirect'] = 'admin/structure/travel';\n}", "public function destroy(Request $request, $id,$type = 'soft')\n {\n if(ACLHelper::hasPermission('delete_account')){\n try {\n $user = User::find($id);\n \n if($user instanceof User){\n \n $restaurants = Restaurant::withTrashed()->where('user_id',$id)->get();\n \n if(count($restaurants) > 0){\n if($type == 'force'){ \n foreach ($restaurants as $restaurant) {\n $menus = Menu::withTrashed()->where('restaurant_id',$restaurant->id)->get();\n if(count($menus) >0){ \n $menusArr = $menus->toArray();\n $ids_to_delete = array_map(function($menu){ return $menu['id']; }, $menusArr);\n $del_menu_cate = MenuFoodType::whereIn('menu_id',$ids_to_delete)->forceDelete();\n \n $menus = Menu::withTrashed()->where('restaurant_id',$restaurant->id)->forceDelete();\n }\n $restaurant->forceDelete();\n } \n\n $userPackage = UserPackage::withTrashed()->where('user_id',$id)->forceDelete(); \n \n }else{\n foreach ($restaurants as $restaurant) {\n $delMenus = Menu::where('restaurant_id',$restaurant->id)->delete();\n \n $restaurant->delete();\n } \n\n $delUserPackage = UserPackage::where('user_id',$id)->delete(); \n }\n }\n \n $del_account = ($type == 'force')?$user->forceDelete():$user->delete();\n \n Session::flash('success_message', 'User is deleted!');\n }else{\n Session::flash('fail_message', 'User is not found!');\n } \n } catch (Exception $exc) {\n Session::flash('fail_message', 'Fail! '.$exc->getTraceAsString());\n }\n \n return redirect('admin/users');\n \n }else{\n abort(404, 'Access denied!');\n } \n }", "public function forceDelete(User $user, MuzaiEducation $muzaiEducation)\n {\n //\n }", "public function destroy(UserType $userType)\n {\n //\n }", "function validate_user_deletion()\n{ }", "public function delete_user($user);", "public function delete_extraproduct(){\n if($this->uri->segment(3) == \"temp\"){\n $id = $this->uri->segment(4);\n $result = MU_Model::deletedRecordById(\"temp_table\",array(\"ID\" => $id));\n }else{\n $id = $this->uri->segment(3);\n $result = MU_Model::deletedRecordById(\"extra_acti\",array(\"extraproduct_id\" => $id));\n }\n if($result) echo 't';\n }", "function tutor_assignment_delete($username, $type, $selected_uid) {\n $type = rtrim($type, \"s\");\n\n $select = eto_user_load($selected_uid);\n \n $title = \"Delete the $type '\" . $select->name . \"' from $username\";\n drupal_set_title($title);\n $output = \"<h2>$title</h2>\";\n\n $user = eto_user_load(array('name' => $username));\n\n $node = (object) array ('uid' => $user->uid,\n\t\t\t 'selected_uid' => $selected_uid,\n\t\t\t 'type' => $type);\n\n $output .= \"Are you sure you want to delete this assignment?\";\n $output .= drupal_get_form('delete_assignment_form', $node);\n\n return $output;\n}", "public function delete(User $user, MuzaiEducation $muzaiEducation)\n {\n //\n }", "function wp_delete_signup_on_user_delete($id, $reassign, $user)\n {\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "function travel_type_form_submit_delete(&$form, &$form_state) {\n // Redirect user to \"Delete\" URI for this entity type.\n $form_state['redirect'] = 'admin/structure/travel/' . $form_state['travel_type']->type . '/delete';\n}", "function ec_delete_user($cid) {\n global $customer_id, $customers_default_address_id, $customer_first_name, $customer_country_id, $customer_zone_id, $comments;\n tep_session_unregister('customer_id');\n tep_session_unregister('customer_default_address_id');\n tep_session_unregister('customer_first_name');\n tep_session_unregister('customer_country_id');\n tep_session_unregister('customer_zone_id');\n tep_session_unregister('comments');\n\n tep_db_query(\"delete from \" . TABLE_ADDRESS_BOOK . \" where customers_id = '\" . (int)$cid . \"'\");\n tep_db_query(\"delete from \" . TABLE_CUSTOMERS . \" where customers_id = '\" . (int)$cid . \"'\");\n tep_db_query(\"delete from \" . TABLE_CUSTOMERS_INFO . \" where customers_info_id = '\" . (int)$cid . \"'\");\n tep_db_query(\"delete from \" . TABLE_CUSTOMERS_BASKET . \" where customers_id = '\" . (int)$cid . \"'\");\n tep_db_query(\"delete from \" . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . \" where customers_id = '\" . (int)$cid . \"'\");\n tep_db_query(\"delete from \" . TABLE_WHOS_ONLINE . \" where customer_id = '\" . (int)$cid . \"'\");\n }", "function deleteuser(){\n\n\t\t$id = $this->input->post('id');\n\n\t\t$this->setting_model->delete('londontec_users','user_id',$id);\n\t\n\t}", "public function delete()\n {\n $user = User::where('idPerson', '=', \\Auth::user()->idPerson)->first();\n $tenant = Tenant::where(\"idPerson\", \"=\", \\Auth::user()->idPerson)->first();\n $parent = Parents::where(\"idTenant\", \"=\", $tenant->idTenant)->first();\n if ($tenant->idAddress == $parent->idAddress) {\n $address = Address::where(\"idAddress\", \"=\", $parent->idAddress)->first();\n $address->delete();\n } else {\n $address_P = Address::where(\"idAddress\", \"=\", $parent->idAddress)->first();\n $address_T = Address::where(\"idAddress\", \"=\", $tenant->idAddress)->first();\n $address_T->delete();\n $address_P->delete();\n }\n $parent->delete();\n $tenant->delete();\n $user->delete();\n return Redirect::to('index');\n }", "public function actionUserdelete()\n {\n $timeLimit = time() - 0;\n $deactivateRequests = DeactivateAccount::find()->where(['processingDate' => null])->andWhere('creationDate < '.$timeLimit)->all();\n\n foreach ($deactivateRequests as $request)\n {\n $user = $request->user;\n\n if ($user->last_login <= $request->creationDate+3)\n {\n $user->setScenario('status');\n $user->status = User::STATUS_DELETED;\n $user->save();\n\n Campaign::updateAll(['status' => Campaign::STATUS_DELETED], 'userId = :userId', [':userId' => $user->id]);\n }\n\n $request->setScenario('processing');\n $request->processingDate = time();\n $request->save();\n }\n }", "public function deleteUser()\n {\n $this->delete();\n }", "public function deleteDiscount();", "public function userDeleted();", "public function deleteUserType($UserTypeID, $Input=array()) {\r\n\t\t/*delete group */\r\n\t\t$this->db->where(\"UserTypeID\",$UserTypeID);\r\n\t\t$this->db->delete('tbl_users_type');\r\n\t\treturn true;\r\n\t}", "function timetracking_type_delete(timetrackingType $type) {\n $type->delete();\n}", "public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fanli_Service_Ptype::getType($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$result = Fanli_Service_Ptype::deleteType($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "function objDeleteType($dbh, $otid)\r\n{\r\n $dbh->Query(\"delete from app_object_types where id = '$otid' and f_system='f';\");\r\n return true;\r\n}", "public function destroy(IceTax $iceTax)\n {\n //\n }", "public static function deleteItem($id) {\r\n Doctrine::getTable ( 'Taxes' )->findOneBy ( 'tax_id', $id )->delete();\r\n }", "public function deleting($educationType)\n {\n\t\tparent::deleting($educationType);\n\n }", "function delete($item_id)\n\t{\n\t\treturn $this->con->delete('items_taxes', array('item_id' => $item_id));\n\t}", "Public Function PermanentDelete()\n\t{\n\t\t$this->_db->delete('bevomedia_user', 'ID = ' . $this->id);\n\t\t$this->_db->delete('bevomedia_user_info', 'ID = ' . $this->id);\n\t}", "public function delete_user(Request $request){\n Session::put('menu_item_parent', 'users');\n Session::put('menu_item_child', '');\n Session::put('menu_item_child_child', '');\n\n $user = User::where('userIdx', $request->userIdx)->get()->first();\n if(!$user){\n Session::flash('flash_error', 'Record you are looking to delete is not found or already deleted.');\n return \"success\";\n }\n if($user){\n if($user->userStatus == 1){\n $subusers = User::where('companyIdx', $user->companyIdx)->get();\n if($subusers->count() > 0){\n foreach ($subusers as $user) {\n $provider = Provider::where('userIdx', $user->userIdx)->get()->first();\n if($provider){\n $offer = Offer::where('providerIdx', $provider->providerIdx)->get()->first();\n if($offer){\n $products = OfferProduct::where('offerIdx', $offer->offerIdx)->get();\n foreach ($products as $product) {\n RegionProduct::where('productIdx', $product->productIdx)->delete();\n }\n OfferProduct::where('offerIdx', $offer->offerIdx)->delete();\n\n OfferCountry::where('offerIdx', $offer->offerIdx)->delete();\n OfferSample::where('offerIdx', $offer->offerIdx)->delete();\n OfferTheme::where('offerIdx', $offer->offerIdx)->delete();\n Offer::where('providerIdx', $provider->providerIdx)->delete();\n }\n \n Provider::where('userIdx', $user->userIdx)->delete();\n }\n BillingInfo::where('userIdx', $user->userIdx)->delete();\n User::where('userIdx', $user->userIdx)->delete();\n }\n }\n User::where('userIdx', $request->userIdx)->delete();\n Session::flash('flash_success', 'User has been deleted successfully');\n echo \"success\";\n } else if($user->userStatus == 2){\n try{\n $provider = Provider::where('userIdx', $request->userIdx)->get()->first();\n if($provider){\n $offer = Offer::where('providerIdx', $provider->providerIdx)->get()->first();\n if($offer){\n $products = OfferProduct::where('offerIdx', $offer->offerIdx)->get();\n foreach ($products as $product) {\n RegionProduct::where('productIdx', $product->productIdx)->delete();\n }\n\n OfferProduct::where('offerIdx', $offer->offerIdx)->delete();\n OfferCountry::where('offerIdx', $offer->offerIdx)->delete();\n OfferSample::where('offerIdx', $offer->offerIdx)->delete();\n OfferTheme::where('offerIdx', $offer->offerIdx)->delete();\n Offer::where('providerIdx', $provider->providerIdx)->delete();\n }\n \n Provider::where('userIdx', $request->userIdx)->delete();\n }\n BillingInfo::where('userIdx', $user->userIdx)->delete();\n User::where('userIdx', $request->userIdx)->delete();\n Session::flash('flash_success', 'User has been deleted successfully');\n echo \"success\";\n }catch(Exception $e){\n echo \"fail\";\n }\n }\n }else echo \"fail\";\n }", "public function delete(User $user, Barang $barang)\n {\n //\n }", "public function delete($user){\n }", "public function forceDelete(User $user, AkunBank $akunBank)\n {\n //\n }", "public function delete(User $user, Tareas $tareas)\n {\n //\n }", "public function usato_delete() {\n\t\t\n\t\tif (!$this->session->user) {\n\t\t\taudit_log(\"Error: tentativo cancellazione usato con utente non loggato. (admin/usato_delete)\");\n\t\t\texit(\"Operazione non consentita\");\n\t\t}\n\t\t\n\t\tif (!$this->input->post()) {\n\t\t\taudit_log(\"Error: Tentativo di cancellazione usato senza parametri. (admin/usato_delete)\");\n\t\t\texit(\"Parametri non impostati\");\n\t\t}\n\t\t\n\t\t$id=$this->input->post('id_usato');\n\t\t\n\t\t// cancello record di usato\n\t\tif ($this->usato_model->deleteUsato($id)) {\n\t\t\taudit_log(\"Message: eliminato usato con ID $id. (admin/usato_delete)\");\n\t\t\t// cancello eventuali usato_pics\n\t\t\t$tokeep=array(''); // con array vuoto elimino tutte le foto per questo usato\n\t\t\tif ($this->usato_model->deleteUsatoPics($tokeep,$id)) { \n\t\t\t\taudit_log(\"Message: eliminate foto gallery per usato con ID $id. (admin/usato_delete)\");\n\t\t\t}\n\t\t\t$this->session->set_flashdata('delete','Cancellazione usato completata');\n\t\t\t$this->session->set_flashdata('delete_status','success');\n\t\t\techo 1; // success\n\t\t}else{\n\t\t\taudit_log(\"Error: eliminazione usato con ID $id. (admin/usato_delete)\");\n\t\t\techo 0;\n\t\t}\n\t}", "public function purchase_item_delete(){\r\n\t\t\r\n\t\t$this->Purchase_model->purchase_item_delete();\r\n\t}", "function travel_type_form_delete_confirm($form, &$form_state, $entity_type) {\n // Store the entity in the form.\n $form_state['entity_type'] = $entity_type;\n\n // Show confirm dialog.\n $message = t('Are you sure you want to delete entity type %title?', array('%title' => entity_label('entity_type', $entity_type)));\n return confirm_form(\n $form,\n $message,\n 'travel/' . entity_id('travel_type', $entity_type),\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n}", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "protected function _postDelete()\n\t{\n\t\t//register events\n\t\t\\Base\\Event::trigger('user.delete',$this->id);\n\t\t//end events\n\t}", "function default_delete(){\n\tglobal $assign_list, $_CONFIG, $_SITE_ROOT, $mod;\n\tglobal $core, $clsModule, $clsButtonNav;\n\t$classTable = \"User\";\n\t$pkeyTable = \"id\";\n\t//################### CAN NOT MODIFY BELOW CODE ###################\n\t$clsTable = new $classTable();\n\t$pval = isset($_REQUEST[$pkeyTable])? $_REQUEST[$pkeyTable] : \"\";\n\tif ($pval!=\"\"){\n\t\t$clsTable->deleteOne($pval);\n\t\theader(\"location: ?$_SITE_ROOT&mod=$mod\");\n\t}\n\t$checkList = isset($_POST[\"checkList\"])? $_POST[\"checkList\"] : \"\";\n\tif (is_array($checkList)){\n\t\tforeach ($checkList as $key => $val){\n\t\t\t$clsTable->deleteOne($val);\n\t\t}\n\t\theader(\"location: ?$_SITE_ROOT&mod=$mod\");\n\t}\n\tunset($clsTable);\n}", "public function forceDelete(User $user, Attraction $attraction)\n {\n //\n }", "function d4os_io_db_070_os_user_delete($uuid) {\n // TODO : delete all assets (impossible ?)\n // TODO : delete groups\n\n // delete offline messages\n drupal_set_message(t('Deleting offline messages.'));\n d4os_io_db_070_offline_message_user_delete($uuid);\n/*\n // delete search\n drupal_set_message(t('Deleting search info.'));\n d4os_io_db_070_os_search_user_delete($uuid);\n*/\n // delete profile\n drupal_set_message(t('Deleting profile info.'));\n d4os_io_db_070_os_profile_user_delete($uuid);\n\n // delete attachments and inventory\n drupal_set_message(t('Deleting inventory.'));\n d4os_io_db_070_os_inventory_user_delete($uuid);\n\n // delete sessions\n drupal_set_message(t('Deleting sessions.'));\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {Presence} WHERE UserID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n/*\n // delete friends\n drupal_set_message(t('Deleting friends.'));\n d4os_io_db_070_set_active('os_users');\n db_query(\"DELETE FROM {userfriends} WHERE ownerID='%s' OR friendID = '%s'\", array($uuid, $uuid));\n d4os_io_db_070_set_active('default');\n*/\n // delete user entry in the grid\n drupal_set_message(t('Deleting user.'));\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {UserAccounts} WHERE PrincipalID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {auth} WHERE UUID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {GridUser} WHERE UserID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n\n // delete the user drupal link \n db_query(\"DELETE FROM {d4os_ui_users} WHERE UUID='%s'\", $uuid);\n}", "public function undeleteAction(){\n\t}", "function onUserDeleteRelated($user, &$tables)\n {\n $tables[] = 'User_yubikey';\n return true;\n }", "function index_delete()\n {\n $no_resi = $this->delete('no_resi');\n $this->db->where('no_resi', $no_resi);\n $delete = $this->db->delete('tabel_user');\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "public function delete() {\n\t\tglobal $wpdb;\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_tax_rates' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'wc_tax_rate_classes' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_order_items' );// phpcs:ignore\n\t\t$wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . 'woocommerce_order_itemmeta' );// phpcs:ignore\n\t\t$this->order = null;\n\t\t$this->product = null;\n\t\t$this->tax_rate_ids = array();\n\t}", "public function testLineItemTypeDeletion() {\n $values = [\n 'id' => strtolower($this->randomMachineName(8)),\n 'label' => $this->randomMachineName(16),\n 'purchasableEntityType' => 'commerce_product_variation',\n 'orderType' => 'default',\n ];\n $line_item_type = $this->createEntity('commerce_line_item_type', $values);\n\n $this->drupalGet($line_item_type->toUrl('delete-form'));\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->pageTextContains(t('This action cannot be undone.'));\n $this->submitForm([], t('Delete'));\n $line_item_type_exists = (bool) LineItemType::load($line_item_type->id());\n $this->assertFalse($line_item_type_exists, 'The line item type has been deleted form the database.');\n }", "public function deleted(ClaseType $clases_type)\n {\n // $clases_type->blocks()->delete();\n }", "public function delete(User $user, SystemUnit $systemUnit)\n {\n //\n }", "public function delete(User $user, Taxon $taxon)\n {\n return $user->hasRole('admin') || $taxon->isCuratedBy($user);\n }", "public function forceDeleted(User $user)\n {\n\n }", "function deleteUserAccount(){\n\t\t\t$id = $_POST[\"id\"];\n\t\t\t$this->db->set('status', 'Deactivated');\n\t\t\t$this->db->where('userID', $id);\n\t\t\t$query = $this->db->update('users');\n\t\t\t\n\t\t\tif($query){\n\t\t\t\techo \"done\";\n\t\t\t}\n\t\t\t\n\t\t}", "public function delete(User $user, Negocio $negocio)\n {\n //\n }", "public function DELETE() {\n\t\t$this->scriptForceHint('DELETE');\n\t}", "function mongo_node_type_delete_form($form, $form_state, $entity_type) {\n $form = array();\n // Send entity type.\n $form['entity_type'] = array(\n '#type' => 'value',\n '#value' => $entity_type,\n );\n $path = '/admin/structure/mongo-node';\n\n $extist_entity_content = '';\n $collection = mongodb_collection('fields_current', $entity_type);\n $count = $collection->count(array('_type' => $entity_type));\n if ($count) {\n $extist_entity_content = t('%type is used by %count piece of content on your site. If you remove this entity type, you will not be able to edit the %type content and it may not display correctly.', array('%type' => $entity_type, '%count' => $count));\n $extist_entity_content .= '<br/><br/>';\n }\n return confirm_form($form, t('Delete entity type'), $path, $extist_entity_content . 'This action cannot be undone', t('Delete'), t('Cancel'), 'mongo_node_type_delete');\n}", "public function delete($user)\n {\n\n }", "public function delete(User $user, Ico $ico)\n {\n //\n }", "function user_delete($user_id) {\n\t\t\n\t\tif(!$this->has_access(__FUNCTION__, __CLASS__, $this->output_data['module'])) {\n\t\t\tset_warning_message('Sory you\\'re not allowed to access this page.');\n\t\t\tredirect('admin');\n\t\t\texit;\n\t\t} elseif($user_id == get_user_id()){\n\t\t\tset_warning_message('Sory you cannot delete your own account.');\n\t\t\tredirect('admin');\n\t\t\texit;\n\t\t} else { \n\t\t\t$this->user_model->delete_user($user_id);\n\t\t\tset_success_message('Successfully delete user');\n\t\t\t$this->show_list();\n\t\t}\n\t}", "public function trash($data,$id)\n {\n if($data=='diagnoses'){\n $diagnosis = Diagnosis::where([\n ['id', '=', $id],\n ['user_id', '=', auth()->id()],\n ])->first();\n if (!$diagnosis) {\n return back();\n }\n $diagnosis->delete();\n Approvement::where('approvable_id',$id)->delete();\n\n }elseif ($data=='attendances'){\n $attendance = Attendance::where([\n ['id', '=', $id],\n ['user_id', '=', auth()->id()],\n ])->first();\n if (!$attendance) {\n return back();\n }\n $attendance->delete();\n Approvement::where('approvable_id',$id)->delete();\n }elseif ($data=='complaints'){\n $complaint = Complaint::where([\n ['id', '=', $id],\n ['user_id', '=', auth()->id()],\n ])->first();\n if (!$complaint) {\n return back();\n }\n $complaint->delete();\n Approvement::where('approvable_id',$id)->delete();\n }elseif ($data=='female_issues'){\n $femaleIssue= FemaleIssue::where([\n ['id', '=', $id],\n ['user_id', '=', auth()->id()],\n ])->first();\n if (!$femaleIssue) {\n return back();\n }\n $femaleIssue->delete();\n Approvement::where('approvable_id',$id)->delete();\n }elseif ($data=='tumor_infos'){\n $tumor_infos= TumorInfo::where([\n ['id', '=', $id],\n ['user_id', '=', auth()->id()],\n ])->first();\n if (!$tumor_infos) {\n return back();\n }\n $tumor_infos->delete();\n Approvement::where('approvable_id',$id)->delete();\n }elseif ($data=='onset_and_developments'){\n $tumor_infos= TumorInfo::where([\n ['id', '=', $id],\n ['user_id', '=', auth()->id()],\n ])->first();\n if (!$tumor_infos) {\n return back();\n }\n $tumor_infos->delete();\n Approvement::where('approvable_id',$id)->delete();\n }elseif ($data=='onset_and_developments'){\n $onset_and_developments= OnsetAndDevelopment::where([\n ['id', '=', $id],\n ['user_id', '=', auth()->id()],\n ])->first();\n if (!$onset_and_developments) {\n return back();\n }\n $onset_and_developments->delete();\n Approvement::where('approvable_id',$id)->delete();\n }elseif ($data=='health_statuses'){\n $health_statuses= HealthStatus::where([\n ['id', '=', $id],\n ['user_id', '=', auth()->id()],\n ])->first();\n if (!$health_statuses) {\n return back();\n }\n $health_statuses->delete();\n Approvement::where('approvable_id',$id)->delete();\n }elseif ($data=='tnms'){\n $tnms= Tnm::where([\n ['id', '=', $id],\n ['user_id', '=', auth()->id()],\n ])->first();\n if (!$tnms) {\n return back();\n }\n $tnms->delete();\n Approvement::where('approvable_id',$id)->delete();\n }\n return back();\n }", "public function procDeleteUser() {//IF time permits, re-implement using new User classes\r\n global $session;\n\r\n /* uid error checking */\n $field = \"deluser\"; //Use the field for uid\r\n $subuid = $_POST[$field];\r\n\r if($subuid == $session->user->getUID()) { /* Make sure no one tries and delete themselves */\n $session->form->setError($field, \"* You can't delete yourself!<br />\");\n }\n\n if($session->form->num_errors > 0) { /* Errors exist, have user correct them */\n $_SESSION['value_array'] = $_POST;\r\n $_SESSION['error_array'] = $session->form->getErrorArray();\r\n } else { /* Delete user from database */\r\n $session->database->removeUser($subuid, DB_TBL_ADMINS);\r\n $session->database->removeUser($subuid, DB_TBL_TELLERS);\r\n $session->database->removeUser($subuid, DB_TBL_CUSTOMERS);\n }\n header(\"Location: \".$session->referrer);\r\n }", "public function delete($user)\n {\n $user->deleteProfilePhoto();\n $user->tokens->each->delete();\n\n // $user->delete(); csak logikai törlés a megngedett\n $user->update([\"name\" => \"deleted\".$user->id,\n \"email\" => \"deleted\".$user->id.\"@deleted.com\",\n \"password\" => \"psw\".rand(100000,999999)]);\n\n \\DB::table('members')\n ->where('user_id','=',$user->id)\n ->delete();\n\n }", "public function handle_changeset_trash_request()\n {\n }", "public function delete_user()\n {\n \n $user_id = $this->uri->segment(4);\n\t //dump($user_id);\n\t \n\t $query = $this->Product_model->delete_user($user_id);\n\t if($query){\n\t\t \n\t\t redirect('admin/Dashboard/users'); \n\t\t \n\t\t}else{\n\t\t\t\n\t\t\t echo 'error'; \n\t\t\t}\n\t\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "function deleteDemandes($idTags, $idUser){\r\n \r\n\r\n }", "public function deleteType($type){\n\t\t$user = $this->getUser();\n\t\tif(!isset($user[\"id\"])||$user[\"status\"]!=DBConfig::$userStatus[\"admin\"]){\n\t\t\treturn false;\n\t\t}\n\t\t$type = $this->getType($type);\n\t\tif(!isset($type[\"id\"]))return false;\n\t\t$query = Queries::deletetype($type[\"id\"]);\n\t\t$result = $this->query($query);\n\t\tif(!$result)return false;\n\t\t$this->log(\"@\".$user[\"id\"].\" (\".$user[\"username\"].\") deletes type $type\");\n\t\t$query = Queries::removetypefromentries($type[\"id\"]);\n\t\treturn $this->query($query);\n\t}", "public function deleting()\n {\n # code...\n }", "public function delete()\n {\n $this->getMasterApiClient()->deleteSubUser($this->getSubAccountUsername());\n LaravelLog::info('Sub account deleted: ' . $this->getSubAccountUsername());\n parent::delete();\n }", "public function actionDelete($id,$type)\n {\n if($type=='dept'){\n $model=$this->findModel($id);\n $model->setAttribute('dept_delete',1);\n $model->save(false);\n }else{\n $model=$this->findModel($id);\n $model->setAttribute('branch_delete',1);\n $model->save(false);\n }\n\n return $this->redirect(['index']);\n }", "public function deleting(User $user)\n {\n $this->getUserQuery($user)->unsearchable();\n }", "public function post_delete() {\n //try to delete the account\n $status = AuxUser::deleteUser();\n if ($status[0]) {\n //if the delete user process worked, log out\n echo '<script>alert(\"Account Deleted\");</script>';\n Response::redirect('/profile/logOut');\n } else {\n //if not, print the error message\n echo '<script>alert(\"'.$status[1].'\");</script>';\n Response::redirect('/profile');\n }\n }", "function system_delete_user($uid)\n{\n}", "function deleteFee()\n {\n global $db;\n $requete = $db->prepare('DELETE FROM fees WHERE idF = ?');\n $requete->execute(array($this->idF));\n }", "public function delete(User $user)\n {\n //\n }" ]
[ "0.6440365", "0.64315486", "0.63294786", "0.6257072", "0.6231977", "0.6224146", "0.6179267", "0.613103", "0.6124305", "0.6074662", "0.60316145", "0.60131395", "0.60083586", "0.5983953", "0.59747446", "0.59359044", "0.59259576", "0.5922161", "0.59209377", "0.5920841", "0.5916387", "0.59053147", "0.5899032", "0.5895469", "0.5895469", "0.5895469", "0.5885341", "0.5882519", "0.5873276", "0.5866455", "0.584773", "0.58474374", "0.5845836", "0.5836304", "0.5832136", "0.5824156", "0.5822312", "0.5818967", "0.5816494", "0.58084667", "0.5794189", "0.5778725", "0.5751334", "0.5744651", "0.57427984", "0.5741594", "0.5736431", "0.5735933", "0.57291234", "0.5725757", "0.5720695", "0.57115346", "0.57115346", "0.57115346", "0.57115346", "0.57115346", "0.57115346", "0.57115346", "0.57115346", "0.57115346", "0.57115346", "0.57115346", "0.57115346", "0.57115346", "0.5702579", "0.56863064", "0.56856996", "0.56651515", "0.56591094", "0.56579286", "0.5653473", "0.5653192", "0.565219", "0.56486166", "0.564713", "0.56461704", "0.56435764", "0.5643202", "0.56358254", "0.56349635", "0.5634172", "0.563338", "0.56273043", "0.56213534", "0.5619895", "0.56166935", "0.5615878", "0.56111956", "0.5605436", "0.560536", "0.5603695", "0.5603649", "0.56035554", "0.5600144", "0.5593301", "0.55932736", "0.55901504", "0.5588151", "0.5586687", "0.55834824", "0.55818707" ]
0.0
-1
Empty method to prevent execution of index()
public function initialise() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n\t{\n\t\t// do nothing\n }", "public function indexAction() {\n\t\t$this->_notImplemented();\n\t}", "public function actionIndex()\n\n {\n\n echo 'Index action has not used.';\n\n }", "public function index()\n {\n // Nothing to do\n }", "public function indexAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n }", "public function indexAction()\r\n {\r\n $this->_helper->viewRenderer->setNoRender();\r\n }", "protected function indexAction() {}", "public function fullIndexAction() {}", "public function index()\n {\n // empty\n }", "public function index(){}", "public function index() {\n die;\n }", "protected function indexAction()\n {\n }", "public function indexAction() {\n ;\n }", "abstract public function index();", "abstract public function index();", "abstract public function index();", "public function actionIndex()\n\t{\n\t\t// do stuff that's not the main content?\n\t}", "abstract function index();", "abstract function index();", "abstract function index();", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function index()\t{\n\tdie('Not allow to access direct');\n\n\t}", "public function executeIndex()\n {\n $this->forward404();\n }", "public abstract function index();", "public abstract function index();", "public abstract function index();", "public function indexAction(){}", "public function index()\n {\n return \"index not implemented\";\n }", "public function singleIndexAction() {}", "public function indexAction()\n {}", "public function indexAction() \n {\n\t\tif (!isset($this->view->flagFailedSearch)) {\n\t\t\t$this->view->flagFailedSearch = FALSE;\n\t\t}\n }", "public function index()\n\t{\n\t\tthrow new \\Exception(__METHOD__ . ' not implemented');\n\t}", "public function indexAction() {\n \n }", "public function blockIndexAction()\n {\n $this->_forward();\n return false;\n }", "public function indexAction() {\n\t}", "public function indexAction() {\n\t}", "abstract public function actionIndex();", "public function indexAction()\n\t{\n\t\t// Render\n\t\t/*$this->_helper->content\n\t\t\t//->setNoRender()\n\t\t\t->setEnabled()\n\t\t\t;*/\n\t}", "public function actionIndex() {}", "public function actionIndex() {}", "abstract function indexAction();", "public function index()\n\t{\n\t\t//if needed\n\t}", "public function indexAction() {\n\n\t}", "public function index()\n\t{\t\n\t}", "public function indexAction() \n {\n \t\n }", "public function index()\n\t\t{\n\n\t\t}", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['result']=NULL;\n\t\t$data['show']=NULL;\n\t\t$this->setIndex($data);\n\t}", "public function index()\n {\n \n }", "public function indexAction()\n {\n \n }", "public function indexAction()\n {\n \n }", "function index() {\n \n }", "public function index()\n {\n //private\n }", "public function index()\n\t{\n\t\t\n\t}", "public function index()\n\t{\n\t\t\n\t}", "public function index()\n\t{\n\t\t\n\t}", "public function index()\n\t{\n\t\t\n\t}", "public function index()\n\t{\n\t\t\n\t}", "public function index()\n\t{\n\t\t\n\t}", "public function index()\n\t{\n\t\t\n\t}", "public function index()\n\t{\n\t\t\n\t}", "public function index()\n\t{\n\t\t\n\t}", "public function index()\r\n\t{\r\n\t\t//\r\n\t}", "public function indexAction()\n {\n\n \n }", "public function index()\n {\n abort(403,'MAAF POSTINGAN ANDA TUJU TIDAK ADA');\n }", "public function actionIndex()\n {}", "public function indexAction()\n\t{\n\n\t}", "public function index()\r\n\t{\r\n\t\treturn null;\r\n\t}", "public function Index()\n\t{\t\n\t}", "public function index()\r\n\t{\r\n\t}", "public function index() {}", "public function index() {}", "public function indexAction() {\r\n }", "public function indexAction()\n {\n //for real application\n }", "public function index()\n\t{\n\n\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}" ]
[ "0.81204283", "0.77246207", "0.7529667", "0.74776083", "0.74450713", "0.74320763", "0.73174727", "0.7245152", "0.7137", "0.71200085", "0.71198916", "0.7119392", "0.7106598", "0.70915943", "0.70915943", "0.70915943", "0.70875347", "0.7076652", "0.7076652", "0.7076652", "0.7070079", "0.7068945", "0.7068135", "0.7068135", "0.7068135", "0.7068135", "0.7068135", "0.7068135", "0.7068135", "0.7068135", "0.7068135", "0.7047652", "0.70466787", "0.70255286", "0.70255286", "0.70255286", "0.70221853", "0.699141", "0.6987641", "0.6983553", "0.69405377", "0.69389135", "0.69074106", "0.68901294", "0.6890016", "0.6890016", "0.6878857", "0.6870741", "0.6849625", "0.6849625", "0.6845846", "0.68451864", "0.6836999", "0.6831923", "0.68251544", "0.6822373", "0.68124646", "0.681241", "0.6807338", "0.67853075", "0.67853075", "0.6784198", "0.6783396", "0.67777467", "0.67777467", "0.67777467", "0.67777467", "0.67777467", "0.67777467", "0.67777467", "0.67777467", "0.67777467", "0.6776673", "0.6767409", "0.6759577", "0.6754765", "0.6736702", "0.6731982", "0.6729438", "0.6728953", "0.67263854", "0.67263854", "0.67207474", "0.67202604", "0.6716439", "0.67069143", "0.67069143", "0.67069143", "0.67069143", "0.67069143", "0.67069143", "0.67069143", "0.67069143", "0.67069143", "0.67069143", "0.67069143", "0.67069143", "0.67069143", "0.67069143", "0.67069143", "0.67069143" ]
0.0
-1
Generate product price diagram coords by SooR 18022013 v.2.0
private function getDiagram() { $diagram_data = array(); if ($this->product_prices && count($this->product_prices['products']) > 1) { $height = 40; $items = 6; $width = 190; $price_range = $this->max_price - $this->min_price; if ($price_range < $items) { return; } $price_interval = $price_range / $items; $items_data = array(); $max_count = 0; for ($i = 0; $i < $items; $i++) { $from = $i * $price_interval + $this->min_price; $to = ($i + 1) * $price_interval + $this->min_price; $count = 0; foreach ($this->product_prices['products'] as $price) { if ($price >= $from && $price <= $to) { $count++; } } if ($count > $max_count) { $max_count = $count; } $items_data[] = $count; } $items_interval = $width / ($items - 1); $diagram_data['circles'] = array(); $diagram_data['path'] = 'M0,' . $height; foreach ($items_data as $key => $count) { $y = round($height / 100 * (100 - $count / $max_count * 100)); $y = ($y < $height / 2 ? $y + 5 : $y - 5); $x = round($key * $items_interval, 1); $diagram_data['circles'][] = array('y' => $y, 'x' => $x, 'count' => $count); $diagram_data['path'] .= ' L' . $x . ',' . $y; if ($key == count($items_data) - 1) { $diagram_data['path'] .= ' L' . $x . ',' . $height; } } $diagram_data['path'] .= ' L0,' . $height . 'Z'; } return $diagram_data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function generateGraphic() {}", "public function generatePictureLine()\n {\n $values = $this->data;\n\n // Get the total number of columns we are going to plot\n $columns = count($values);\n\n // Get the height and width of the diagram itself\n $width = round($this->w*0.75);\n $height = round($this->h*0.75);\n\n //$padding = 0;\n //$padding_l = 5;\n $padding_h = round(($this->w - $width) / 2);\n $padding_v = round(($this->h - $height) / 2); \n\n // Get the width of 1 column\n $column_width = round ($width / $columns) ;\n \n \n // Fill in the background of the image\n imagefilledrectangle($this->im,0,0,$this->w,$this->h,$this->white);\n\n $maxv = 0;\n\n // Calculate the maximum value we are going to plot\n\n foreach($values as $key => $value) \n {\n $maxv = max($value,$maxv); \n }\n \n $this->drawAxesLabels($width, $height, $column_width, $padding_h,$padding_v, $maxv);\n \n //diagram itself\n $i=0;\n //for ($i = 0;$i<count($values);)\n foreach ($values as $key => $value)\n {\n //if ($i==count($values))\n // break;\n $column_height1 = ($height / 100) * (( $value / $maxv) *100);\n $x1 = $i*$column_width + $padding_h + $column_width/2;\n $y1 = $height-$column_height1 + $padding_v;\n $i++;\n if ($i<2)\n {\n $column_height2 = ($height / 100) * (( $value / $maxv) *100);\n $x2 = (($i)*$column_width) + $padding_h + $column_width/2;\n $y2 = $height-$column_height2 + $padding_v;\n }\n if ($i>1)\n imageline($this->im,$x1,$y1,$x2,$y2,$this->color_helper->img_colorallocate($this->im, $this->color_helper->nextColor()));\n $x2 = $x1; \n\t\t$y2 = $y1;\n }\n \n return $this->im;\n }", "public function showPrice() {\n return 'This ' .$this->getColor() .' vehicle cost ' . $this->getPrice() ;\n }", "protected function generateHighDensityGraphic() {}", "public function getProductPosition()\n {\n return Mage::getStoreConfig('splitprice/split_price_presentation/show_product_position');\n }", "function draw_singolo_ordine($id_prodotto, $nome_prodotto, $prezzo, $foto, $quantita)\n {\n echo \"<div class='col-md-9 col-xs-12 text-center' style='background-color:#F9F9F9; padding:5px; margin-bottom:5px;'>\";\n echo \" <div class='col-md-3 col-xs-12'>\";\n echo \" <a href='product_img/$foto'><img class='img-thumbnail' src='product_img/$foto' height='150px' width='150px'></a>\";\n echo \" </div>\";\n echo \" <div class='col-md-6 col-xs-12'>\";\n echo \" <div class='col-xs-12'>\";\n echo \" <h3 class='text-primary'> $nome_prodotto </h3>\";\n echo \" </div>\";\n echo \" </div>\";\n echo \" <div class='col-md-3 col-xs-12'>\";\n echo \" <div class='col-xs-12'>\";\n echo \" <h4>Prezzo</h4>\";\n echo \" <h3 style='color:green;'>€$prezzo</h3>\";\n echo \" </div>\";\n echo \" <div class='col-md-12'>\";\n echo \" <h5>Quantità:$quantita</h5>\";\n echo \" </div>\";\n echo \" </div>\";\n echo \"</div>\";\n }", "function drawSelectedProducts(){\n \n }", "function graficoPoligno() {\n $maxValue = $this->desenhaBase();\n\n $labelY = $this->margem;\n\n $idx = 0;\n foreach ($this->vetor as $label => $item) {\n $points = array();\n $arPonto = array();\n $arValor = array();\n $idx++;\n\n $color = $this->getColor($idx, 0, 0, 0, 60);\n $x = $this->margem;\n $y = $this->gtamanho + $this->margem;\n\n foreach ($item as $referencia => $value) {\n $val = ($this->gtamanho + ($this->margem * 1)) - (floor((($this->gtamanho) * $value) / $maxValue));\n\n $points[] = $x;\n $points[] = $y;\n $points[] = ($x + $this->columSize);\n $points[] = $val;\n\n $arPonto[] = array(\n 'x' => ($x + $this->columSize),\n 'y' => $val\n );\n\n $arValor[] = array(\n 'x' => ($x + ($this->columSize + $this->margem)),\n 'y' => ($val - 3),\n 'value' => $value\n );\n\n $y = $val;\n $x += $this->columSize;\n }\n\n $points[] = $this->gtamanho + $this->margem;\n $points[] = $this->gtamanho + $this->margem;\n\n imagefilledpolygon($this->image, $points, (count($points) / 2), $color);\n\n if($this->opMostrarPontoValor) {\n foreach ($arPonto as $item) {\n $this->desenhaPonto($item['x'], $item['y'], null);\n }\n\n foreach ($arValor as $item) {\n imagestring($this->image, 2, $item['x'], ($item['y'] - $this->margem), utf8_decode($item['value']), null);\n }\n }\n\n $this->desenhaLabel($label, $color, $labelY);\n $labelY += ($this->margem * 2);\n }\n }", "function _prepareGroupedProductPriceData($entityIds = null) {\n\t\t\t$write = $this->_getWriteAdapter( );\n\t\t\t$table = $this->getIdxTable( );\n\t\t\t$select = $write->select( )->from( array( 'e' => $this->getTable( 'catalog/product' ) ), 'entity_id' )->joinLeft( array( 'l' => $this->getTable( 'catalog/product_link' ) ), 'e.entity_id = l.product_id AND l.link_type_id=' . LINK_TYPE_GROUPED, array( ) )->join( array( 'cg' => $this->getTable( 'customer/customer_group' ) ), '', array( 'customer_group_id' ) );\n\t\t\t$this->_addWebsiteJoinToSelect( $select, true );\n\t\t\t$this->_addProductWebsiteJoinToSelect( $select, 'cw.website_id', 'e.entity_id' );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1600( )) {\n\t\t\t\t$minCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.min_price', 0 );\n\t\t\t\t$maxCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.max_price', 0 );\n\t\t\t\t$taxClassId = $this->_getReadAdapter( )->getCheckSql( 'MIN(i.tax_class_id) IS NULL', '0', 'MIN(i.tax_class_id)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(' . $minCheckSql . ')' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(' . $maxCheckSql . ')' );\n\t\t\t} \nelse {\n\t\t\t\t$taxClassId = new Zend_Db_Expr( 'IFNULL(i.tax_class_id, 0)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(IF(le.required_options = 0, i.min_price, 0))' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(IF(le.required_options = 0, i.max_price, 0))' );\n\t\t\t}\n\n\t\t\t$stockId = 'IF (i.stock_id IS NOT NULL, i.stock_id, 1)';\n\t\t\t$select->columns( 'website_id', 'cw' )->joinLeft( array( 'le' => $this->getTable( 'catalog/product' ) ), 'le.entity_id = l.linked_product_id', array( ) );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1700( )) {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'group_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t} \nelse {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t}\n\n\t\t\t$select->joinLeft( array( 'i' => $table ), '(i.entity_id = l.linked_product_id) AND (i.website_id = cw.website_id) AND ' . '(i.customer_group_id = cg.customer_group_id)', $columns );\n\t\t\t$select->group( array( 'e.entity_id', 'cg.customer_group_id', 'cw.website_id', $stockId, 'i.currency', 'i.store_id' ) )->where( 'e.type_id=?', $this->getTypeId( ) );\n\n\t\t\tif (!is_null( $entityIds )) {\n\t\t\t\t$select->where( 'l.product_id IN(?)', $entityIds );\n\t\t\t}\n\n\t\t\t$eventData = array( 'select' => $select, 'entity_field' => new Zend_Db_Expr( 'e.entity_id' ), 'website_field' => new Zend_Db_Expr( 'cw.website_id' ), 'stock_field' => new Zend_Db_Expr( $stockId ), 'currency_field' => new Zend_Db_Expr( 'i.currency' ), 'store_field' => new Zend_Db_Expr( 'cs.store_id' ) );\n\n\t\t\tif (!$this->getWarehouseHelper( )->getConfig( )->isMultipleMode( )) {\n\t\t\t\t$eventData['stock_field'] = new Zend_Db_Expr( 'i.stock_id' );\n\t\t\t}\n\n\t\t\tMage::dispatchEvent( 'catalog_product_prepare_index_select', $eventData );\n\t\t\t$query = $select->insertFromSelect( $table );\n\t\t\t$write->query( $query );\n\t\t\treturn $this;\n\t\t}", "private function generateCoordinates()\n {\n $this->mapDiagonal();\n $this->mapVertical();\n $this->mapHorizontal();\n\n $this->disabledCells = array_unique($this->disabledCells);\n sort($this->disabledCells);\n }", "public function wktGenerateMultipoint();", "function DrawDot($x,$y) //center x y\n\t\t{\n\t\t $op = 'B'; // draw Filled Dots\n\t\t //F == fill //S == stroke //B == stroke and fill \n\t\t $r = 0.5 * $this->k; //raio\n\t\t \n\t\t //Start Point\n\t\t $x1 = $x - $r;\n\t\t $y1 = $y;\n\t\t //End Point\n\t\t $x2 = $x + $r;\n\t\t $y2 = $y;\n\t\t //Auxiliar Point\n\t\t $x3 = $x;\n\t\t $y3 = $y + (2*$r);// 2*raio to make a round (not oval) shape \n\n\t\t //Round join and cap\n\t\t $s=\"\\n\".'1 J'.\"\\n\";\n\t\t $s.='1 j'.\"\\n\";\n\n\t\t //Upper circle\n\t\t $s.=sprintf('%.3f %.3f m'.\"\\n\",$x1,$y1); //x y start drawing\n\t\t $s.=sprintf('%.3f %.3f %.3f %.3f %.3f %.3f c'.\"\\n\",$x1,$y1,$x3,$y3,$x2,$y2);//Bezier curve\n\t\t //Lower circle\n\t\t $y3 = $y - (2*$r);\n\t\t $s.=sprintf(\"\\n\".'%.3f %.3f m'.\"\\n\",$x1,$y1); //x y start drawing\n\t\t $s.=sprintf('%.3f %.3f %.3f %.3f %.3f %.3f c'.\"\\n\",$x1,$y1,$x3,$y3,$x2,$y2);\n\t\t $s.=$op.\"\\n\"; //stroke and fill\n\n\t\t //Draw in PDF file\n\t\t $this->_out($s);\n\t\t}", "private function SetPricingDetails()\n\t{\n\t\t$product = $this->productClass->getProduct();\n\n\t\t$GLOBALS['PriceLabel'] = GetLang('Price');\n\n\t\tif($this->productClass->GetProductCallForPricingLabel()) {\n\t\t\t$GLOBALS['ProductPrice'] = $GLOBALS['ISC_CLASS_TEMPLATE']->ParseGL($this->productClass->GetProductCallForPricingLabel());\n\t\t}\n\t\t// If prices are hidden, then we don't need to go any further\n\t\telse if($this->productClass->ArePricesHidden()) {\n\t\t\t$GLOBALS['HidePrice'] = \"display: none;\";\n\t\t\t$GLOBALS['HideRRP'] = 'none';\n\t\t\t$GLOBALS['ProductPrice'] = '';\n\t\t\treturn;\n\t\t}\n\t\telse if (!$this->productClass->IsPurchasingAllowed()) {\n\t\t\t$GLOBALS['ProductPrice'] = GetLang('NA');\n\t\t}\n\t\telse {\n\t\t\t$options = array('strikeRetail' => false);\n\t\t\t$GLOBALS['ProductPrice'] = formatProductDetailsPrice($product, $options);\n\t\t}\n\n\t\t// Determine if we need to show the RRP for this product or not\n\t\t// by comparing the price of the product including any taxes if\n\t\t// there are any\n\t\t$GLOBALS['HideRRP'] = \"none\";\n\t\t$productPrice = $product['prodcalculatedprice'];\n\t\t$retailPrice = $product['prodretailprice'];\n\t\tif($retailPrice) {\n\t\t\t// Get the tax display format\n\t\t\t$displayFormat = getConfig('taxDefaultTaxDisplayProducts');\n\t\t\t$options['displayInclusive'] = $displayFormat;\n\n\t\t\t// Convert to the browsing currency, and apply group discounts\n\t\t\t$productPrice = formatProductPrice($product, $productPrice, array(\n\t\t\t\t'localeFormat' => false, 'displayInclusive' => $displayFormat\n\t\t\t));\n\t\t\t$retailPrice = formatProductPrice($product, $retailPrice, array(\n\t\t\t\t'localeFormat' => false, 'displayInclusive' => $displayFormat\n\t\t\t));\n\n\t\t\tif($productPrice < $retailPrice) {\n\t\t\t\t$GLOBALS['HideRRP'] = '';\n\n\t\t\t\t// Showing call for pricing, so just show the RRP and that's all\n\t\t\t\tif($this->productClass->GetProductCallForPricingLabel()) {\n\t\t\t\t\t$GLOBALS['RetailPrice'] = CurrencyConvertFormatPrice($retailPrice);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// ISC-1057: do not apply customer discount to RRP in this case\n\t\t\t\t\t$retailPrice = formatProductPrice($product, $product['prodretailprice'], array(\n\t\t\t\t\t\t'localeFormat' => false,\n\t\t\t\t\t\t'displayInclusive' => $displayFormat,\n\t\t\t\t\t\t'customerGroup' => 0,\n\t\t\t\t\t));\n\t\t\t\t\t$GLOBALS['RetailPrice'] = '<strike>' . formatPrice($retailPrice) . '</strike>';\n\t\t\t\t\t$GLOBALS['PriceLabel'] = GetLang('YourPrice');\n\t\t\t\t\t$savings = $retailPrice - $productPrice;\n\t\t\t\t\t$string = sprintf(getLang('YouSave'), '<span class=\"YouSaveAmount\">'.formatPrice($savings).'</span>');\n\t\t\t\t\t$GLOBALS['YouSave'] = '<span class=\"YouSave\">'.$string.'</span>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function _getProductData() {\n\n\n $cat_id = Mage::getModel('catalog/layer')->getCurrentCategory()->getId();\n $category = Mage::getModel('catalog/category')->load($cat_id);\n $data['event'] = 'product';\n\n $finalPrice = $this->getFinalPriceDiscount();\n if($finalPrice):\n $google_tag_params = array();\n $google_tag_params['ecomm_prodid'] = $this->getProduct()->getSku();\n $google_tag_params['name'] = $this->getProduct()->getName();\n $google_tag_params['brand'] = $this->getProduct()->getBrand();\n $google_tag_params['ecomm_pagetype'] = 'product';\n $google_tag_params['ecomm_category'] = $category->getName();\n $google_tag_params['ecomm_totalvalue'] = (float)$this->formatNumber($finalPrice);\n \n $customer = Mage::getSingleton('customer/session');\n if ($customer->getCustomerId()){\n $google_tag_params['user_id'] = (string) $customer->getCustomerId(); \n }\n if($this->IsReturnedCustomer()){\n $google_tag_params['returnCustomer'] = 'true';\n }\n else {\n $google_tag_params['returnCustomer'] = 'false';\n }\n\n $data['google_tag_params'] = $google_tag_params;\n\n /* Facebook Conversion API Code */\n $custom_data = array(\n \"content_name\" => $this->getProduct()->getName(),\n \"content_ids\" => [$this->getProduct()->getSku()],\n \"content_category\" => $category->getName(),\n \"content_type\" => \"product\",\n \"value\" => (float)$this->formatNumber($finalPrice),\n \"currency\" => \"BRL\"\n );\n $this->createFacebookRequest(\"ViewContent\", [], [], $custom_data);\n /* End Facebook Conversion API Code */\n\n endif;\n\n return $data;\n }", "private function getItemXml($item)\n {\n $qty = (int)$item->getQty() ? (int)$item->getQty() : 1;\n $product = Mage::getModel('catalog/product')->load( $item->getProductId() );\n\n\n\n //$this->_totalPrice += $product->getFinalPrice() * $qty;\n if($this->getConfig('product_cost') && $product->getCost() > 0)\n {\n $this->_totalPrice += $product->getCost() * $qty;\n }\n else\n {\n $this->log(\"p p \" . $product->getFinalPrice() . \" and i P \". $product->getPrice());\n $this->_totalPrice += $product->getFinalPrice() * $qty;\n }\n\n $height = $this->getConvertedMeasure($product->getHeight(), $product->getDimensionUnits());\n //$weight = $this->getConvertedWeight($product->getWeight(),$product->getWeightUnits())*$qty;\n $weight = $this->getConvertedWeight($product->getWeight(),$product->getWeightMeasure());\n $width = $this->getConvertedMeasure($product->getWidth(), $product->getDimensionUnits());\n $length = $this->getConvertedMeasure($product->getLength(), $product->getDimensionUnits());\n $title = substr($product->getSku().';'.preg_replace('/[^a-z0-9\\s\\'\\.\\_]/i','',substr($product->getName(),0,32).\" ...\"),0,32);\n $Readytoship = $product->getReadytoship();\n\n if(intval($length) < 1 || intval($width) < 1 || intval($height) < 1 )\n {\n $length = $width = $height = 1;\n }\n\n $Readytoship = \"\";\n if($product->getReadytoship() != 1)\n {\n $Readytoship = '';\n\t\t\t\n }\n\n if(ceil($weight) <= 0.0000)\n {\n $weight = .7; //default to 7.7 kg\n }\n\n if($height < 1 || !is_numeric($height))\n {\n $height = $this->_default_heightlow; // just a low default\n if($weight >= $this->_weight_low) // less than 1k no height (default 2)\n {\n $height = $this->_default_heighthigh;\n }\n\n }\n\n if($width < 1 || !is_numeric($width))\n {\n $width = $this->_default_widthlow; // just a low default\n if($weight >= $this->_weight_low)\n {\t\t\t // less than 1k no height (default 2)\n $width = $this->_default_widthhigh;\n }\n }\n\n // Create default value for length should value be missing\n if($length < 1 || !is_numeric($length))\n {\n $length = $this->_default_lengthlow; // just a low default\n if($weight >= $this->_weight_low) // less than 1k no height (default 2)\n {\n $length = $this->_default_lengthhigh;\n }\n }\n$aweight = $weight;\n/*$aheight = $height*$qty;*/\n\nif($product->getReadytoship() != 1)\n {\n \n\t\t$this->_package_height += $height; \n\t\tif($width > $this->_package_width) $this->_package_width = $width; \n\t\tif($length > $this->_package_length) $this->_package_length = $length;\n\t\t$this->shipping_weight += $aweight; \n\t\t \n\t\n\n\t\t\t\n\t\t\t $items_xml = \"\\n\n <parcel>\n <weight>{$this->shipping_weight}</weight>\n <length>{$this->_package_length}</length>\n <width>{$this->_package_width}</width>\n <height>{$this->_package_height}</height>\n</parcel>\n\";\n\t\t\t\n }\n\t\telse\n\t\t{\n\t\t\t $items_xml = \"\\n\n <parcel>\n <weight>{$aweight}</weight>\n <length>{$length}</length>\n <width>{$width}</width>\n <height>{$height}</height>\n</parcel>\n\";\n\t\t}\n\n\n \n return $items_xml;\n }", "static function DrawPageGraph($pdf, $data, $filename_offset, $graph_location_hori, $area_length = 480, $area_width = 110)\n {\n //echo \"data:\".print_r($data);\n if ($data) {\n $image_name = ModuleUtils::getCustomerTempPath() . 'chart2_' . time() . $filename_offset . '.png';\n //echo \"imagename:\".$image_name;\n\n $p1 = new PHPlot($area_length, $area_width);\n $p1->SetTitle('');\n $p1->SetDataType('text-data');\n\n $p1->SetDataValues($data);\n $p1->SetDataColors(array(COLOUR_GRAY, COLOUR_BLACK));\n\n $p1->SetPlotType('linepoints');\n\n $p1->SetPlotAreaWorld(.5, 0, 21.8, 1000);\n\n $p1->SetGridColor(COLOUR_WHITE);\n //$p1->SetDrawXGrid(True);\n //$p1->SetDrawYGrid(True);\n $p1->SetDrawXGrid(False);\n $p1->SetDrawYGrid(False);\n $p1->SetLineWidths(1);\n $p1->SetLineSpacing(0);\n $p1->SetLineStyles('solid');\n\n $p1->SetMarginsPixels(20, 5, 5, 15);\n $p1->SetNumXTicks(20);\n $p1->SetNumYTicks(4);\n\n $p1->SetXDataLabelPos('none');\n $p1->SetXTickPos('none');\n $p1->SetXTickLabelPos('none');\n $p1->SetYTickPos('none');\n $p1->SetYTickLabelPos('none');\n\n $p1->SetImageBorderColor('#FFFFFF');\n //\n $p1->SetPlotBorderType('none');\n $p1->SetIsInline(true);\n $p1->SetOutputfile($image_name);\n $p1->DrawGraph();\n\n $graph_location_verti = $pdf->GetDataHeaderOffsetY() + 0.8;\n $pdf->RotatedImage($image_name, $graph_location_hori, $graph_location_verti , null, null, 270); // 26 // first page\n\n unlink($image_name);\n }\n }", "public function getPricePoint() {\n return $this->pricePoint;\n }", "public function getgraphAction(){\n $params = array(\n 'cht' => 'lc', \t\t\t\t\t// chart type\n 'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0', //background fills for the chart\n // 'chm' => 'B,f4d4b2,0,0,0|B,FF0000,1,1,0|B,00FF00,2,2,0', \t\t// line fills\n 'chco' => 'db4814,1919D1',\t\t\t\t\t//Series Colors\n 'chs' => '587x300',\t\t\t\t// chart size <width>x<height>\n\t\t\t'chxt' => 'x,y',\t\t\t\t\t// visible axes\n\t\t\t//'chof' => 'validate'\t\t\t\t// output format (png,gif,json,html{when chof='validate'})\n );\n \n\t$post=$this->getRequest()->getPost();\n\t\n\t\n\t$timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);\n\n\t\tlist ($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getDateRange($post['range'], '', '', true);\n\n $dateStart->setTimezone($timezoneLocal);\n $dateEnd->setTimezone($timezoneLocal);\n\t\n\t\t$dates = array();\n $datas = array();\n\n while($dateStart->compare($dateEnd) < 0){\n switch ($post['range']) {\n case '24h':\n $d = $dateStart->toString('yyyy-MM-dd HH:00');\n $dateStart->addHour(1);\n break;\n case '7d':\n case '1m':\n $d = $dateStart->toString('yyyy-MM-dd');\n $dateStart->addDay(1);\n break;\n case '1y':\n case '2y':\n $d = $dateStart->toString('yyyy-MM');\n $dateStart->addMonth(1);\n break;\n }\n\n $dates[] = $d;\n }\n\n\t\t$graphData=array();\n\t\t\n\t\t$product_list=array('product1'=>$post['product'],\n\t\t\t\t\t\t\t'product2'=>$post['compare2']\n\t\t\t\t\t\t\t);\t\n\t\t$graphData=Mage::Helper('graphs')->getGraphData($dates,$product_list);\n\n /**\n * setting skip step\n */\n if (count($dates) > 8 && count($dates) < 15) {\n $c = 1;\n } else if (count($dates) >= 15){\n $c = 2;\n } else {\n $c = 0;\n }\n /**\n * skipping some x labels for good reading\n */\n $i=0;\n foreach ($dates as $k => $d) {\n if ($i == $c) {\n $dates[$k] = $d;\n $i = 0;\n } else {\n $dates[$k] = '';\n $i++;\n }\n }\n \n $this->_axisLabels['x'] = $dates;\n\t\t$this->_axisLabels['y'] = $graphData['quantity'][$post['product']];\n\t\t\n\t\tforeach ($graphData['quantity'] as $index => $serie) {\n $localmaxlength[$index] = sizeof($serie);\n $localmaxvalue[$index] = max($serie);\n $localminvalue[$index] = min($serie);\n }\n \n\t\t$maxvalue = max($localmaxvalue);\n\t\t$minvalue = min($localminvalue);\n\n $yrange = 0;\n $yLabels = array();\n $miny = 0;\n $maxy = 0;\n $yorigin = 0;\n\n $maxlength = max($localmaxlength);\n if ($minvalue >= 0 && $maxvalue >= 0) {\n $miny = 0;\n if ($maxvalue > 10) {\n $p = pow(10, $this->_getPow($maxvalue));\n $maxy = (ceil($maxvalue/$p))*$p;\n $yLabels = range($miny, $maxy, $p);\n } else {\n $maxy = ceil($maxvalue+1);\n $yLabels = range($miny, $maxy, 1);\n }\n $yrange = $maxy;\n $yorigin = 0;\n }\n\n \n\t\t\t\n\t\t\t$params['chd'] = \"e:\";\n $dataDelimiter = \"\";\n $dataSetdelimiter = \",\";\n $dataMissing = \"__\";\n \n\t\t\t// EXTENDED ENCODING\n\t\t\tforeach($product_list as $productid){\n\t\t\t\t$chartdata = array();\t\n for ($j = 0; $j < sizeof($graphData['quantity'][$productid]); $j++) {\n $currentvalue = $graphData['quantity'][$productid][$j];\n \n if (is_numeric($currentvalue)) {\n if ($yrange) {\n $ylocation = (4095 * ($yorigin + $currentvalue) / $yrange);\n\n } else {\n $ylocation = 0;\n }\n $firstchar = floor($ylocation / 64);\n $secondchar = $ylocation % 64;\n $mappedchar = substr($this->_extendedEncoding, $firstchar, 1)\n . substr($this->_extendedEncoding, $secondchar, 1);\n array_push($chartdata, $mappedchar . $dataDelimiter);\n } else {\n array_push($chartdata, $dataMissing . $dataDelimiter);\n }\n\n\t\t\t }\n\t\t\t $buffer = implode('', $chartdata);\t\t\t \n\t\t\t\t\t$buffer = rtrim($buffer, $dataSetdelimiter);\n\t\t\t\t\t$buffer = rtrim($buffer, $dataDelimiter);\n\t\t\t\t\t$buffer = str_replace(($dataDelimiter . $dataSetdelimiter), $dataSetdelimiter, $buffer);\n\t\t\t\t\t\n\t\t\t\t\t$params['chd'] .= $buffer.',';\n\t\t\t\t\t$buffer=null;\n\t\t\t\t\t$chartdata=null;\n\t\t\t\t}\n\t\t\t\t\t$labelBuffer = \"\";\n\t\t\t\t\t$valueBuffer = array();\n\t\t\t\t\t$rangeBuffer = \"\";\n \n if (sizeof($this->_axisLabels) > 0) {\n $params['chxt'] = implode(',', array_keys($this->_axisLabels));\n $indexid = 0;\n foreach ($this->_axisLabels as $idx=>$labels){\n\t\t\t\t\n if ($idx == 'x') {\n /**\n * Format date\n */\n foreach ($this->_axisLabels[$idx] as $_index=>$_label) {\n if ($_label != '') {\n switch ($post['range']) {\n case '24h':\n $this->_axisLabels[$idx][$_index] = $this->formatTime(\n new Zend_Date($_label, 'yyyy-MM-dd HH:00'), 'short', false\n );\n break;\n case '7d':\n case '1m':\n $this->_axisLabels[$idx][$_index] = $this->formatDate(\n new Zend_Date($_label, 'yyyy-MM-dd')\n );\n break;\n case '1y':\n case '2y':\n\t\t\t\t\t\t\t\t\t\n $formats = Mage::app()->getLocale()->getTranslationList('datetime');\n $format = isset($formats['yyMM']) ? $formats['yyMM'] : 'MM/yyyy';\n $format = str_replace(array(\"yyyy\", \"yy\", \"MM\"), array(\"Y\", \"y\", \"m\"), $format);\n $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label));\n break;\n }\n } else {\n $this->_axisLabels[$idx][$_index] = '';\n }\n\n }\n\t\t\t\t\t\t\t\t\t\t\n $tmpstring = implode('|', $this->_axisLabels[$idx]);\n\n $valueBuffer[] = $indexid . \":|\" . $tmpstring;\n if (sizeof($this->_axisLabels[$idx]) > 1) {\n $deltaX = 100/(sizeof($this->_axisLabels[$idx])-1);\n } else {\n $deltaX = 100;\n }\n } else if ($idx == 'y') {\n $valueBuffer[] = $indexid . \":|\" . implode('|', $yLabels);\n if (sizeof($yLabels)-1) {\n $deltaY = 100/(sizeof($yLabels)-1);\n } else {\n $deltaY = 100;\n }\n // setting range values for y axis\n $rangeBuffer = $indexid . \",\" . $miny . \",\" . $maxy . \"|\";\n }\n $indexid++;\n }\n $params['chxl'] = implode('|', $valueBuffer);\n }\t\t\t\n\t\t\t\t\t\n\t\tif (isset($deltaX) && isset($deltaY)) {\n $params['chg'] = $deltaX . ',' . $deltaY . ',1,0';\n }\n \n\n\t\t\t$p = array();\n foreach ($params as $name => $value) {\n $p[] = $name . '=' .urlencode($value);\n }\n\n $url= Mage_Adminhtml_Block_Dashboard_Graph::API_URL . '?' . implode('&', $p);\n\n\t\t\t\techo $url;\n\t}", "function generate_price($prod_arr,$row_price,$row_settings,$tax_val,$return_price_withouttax=0)\n\t{\n\t\tglobal $db,$ecom_siteid,$ecom_allpricewithtax;\n\t\t\n\t\t$webprice \t\t\t= $prod_arr['product_webprice'];\n\t\t$disc_asval\t\t\t= $prod_arr['product_discount_enteredasval'];\n\t\t$tax_before_disc\t= $row_settings['saletax_before_discount'];\n\t\t$discount\t\t\t= 0;\n\t\t\n\t\tif($prod_arr['product_discount']>0)\n\t\t{\n\t\t\tif($disc_asval==2) // For Exact Discount Price \n\t\t\t\t$discount\t= $webprice-$prod_arr['product_discount']; \t\n\t\t\telse\n\t\t\t\t$discount\t= $prod_arr['product_discount'];\n\t\t}\n\t\t//if($ecom_siteid==70 or $ecom_siteid==104) // bypassed tax calculation for nationwide fireextinguisher and discount mobility\n\t\t\n\t\tif($ecom_siteid==104) // bypassed tax calculation for discount mobility and puregusto\n\t\t\t$apply_tax = 'Y';\n\t\telse\t\n\t\t\t$apply_tax\t\t= $prod_arr['product_applytax'];\n\t\t\t\n\t\t\n\t\tif($return_price_withouttax==1)\n\t\t{\n\t\t\t$apply_tax = 'N';\n\t\t}\n\t\t\t\n\t\t/*switch($row_price['price_displaytype'])\n\t\t{\n\t\t\tcase 'show_price_only':\t\t\t\t\t\n\t\t\tcase 'show_price_plus_tax':\n\t\t\t\tif($discount>0)\n\t\t\t\t{\n\t\t\t\t\tif($disc_asval==1) // If discount is specified as value\n\t\t\t\t\t{\n\t\t\t\t\t\t$disc_price = $webprice - $discount;\n\t\t\t\t\t}\t\n\t\t\t\t\telse if($disc_asval==2) \n\t\t\t\t\t{ // For Exact Discount Price \n\t\t\t\t\t\t$disc_price\t= $webprice-$discount; \t// For Exact Discount Price \n\t\t\t\t\t}\t\n\t\t\t\t\telse // case if discount is given as percentage\n\t\t\t\t\t{\n\t\t\t\t\t\t$disc_price = $webprice - ($webprice * $discount/100);\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'show_price_inc_tax': // Show price including tax\n\t\t\tcase 'show_both':*/\n\t\t\t\tif ($apply_tax=='Y' and $ecom_allpricewithtax==0)\n\t\t\t\t{\t\n\t\t\t\t\t$disc_price\t= $webprice + ($webprice * $tax_val/100);\n\t\t\t\t\t//$disc_price = sprintf('%0.2f',$disc_price);\n\t\t\t\t}\t\n\t\t\t\telse\n\t\t\t\t\t$disc_price = $webprice;\n\t\t\t\tif ($discount>0)\n\t\t\t\t{\n\t\t\t\t\tif($disc_asval==1) // If discount is specified as value\n\t\t\t\t\t{\n\t\t\t\t\t\t$disc_price \t\t\t= $webprice - $discount; // calculate the original discount\n\t\t\t\t\t\tif ($apply_tax=='Y')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($tax_before_disc==1)// case of apply tax before discount\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$disc_price_with_tax \t= $disc_price + ($webprice * $tax_val/100); // apply tax to it\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$disc_price_with_tax \t= $disc_price + ($disc_price * $tax_val/100); // apply tax to it\n\t\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\t$disc_price_with_tax = $disc_price;\n\n\t\t\t\t\t}\t\n\t\t\t\t\telse if($disc_asval==2) // For Exact Discount Price \n\t\t\t\t\t{\n\t\t\t\t\t\t$disc_price = $webprice - $discount;\n\t\t\t\t\t\tif ($apply_tax=='Y')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($tax_before_disc==1)// case of apply tax before discount\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$disc_price_with_tax \t= $disc_price + ($webprice * $tax_val/100); // apply tax to it\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$disc_price_with_tax \t= $disc_price + ($disc_price * $tax_val/100); // apply tax to it\n\t\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\t$disc_price_with_tax = $disc_price;\n\t\t\t\t\t}\t\n\t\t\t\t\telse // case if discount is given as percentage\n\t\t\t\t\t{\n\t\t\t\t\t\t$disc_price \t\t\t\t= $webprice - ($webprice * $discount/100);// calculate the original discount\n\t\t\t\t\t\t//$disc_price = sprintf('%0.2f',$disc_price);\n\t\t\t\t\t\tif ($apply_tax=='Y')\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($tax_before_disc==1)// case of apply tax before discount\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$disc_price_with_tax \t\t= $disc_price + ($webprice * $tax_val/100); // apply tax to it\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$disc_price_with_tax \t\t= $disc_price + ($disc_price * $tax_val/100); // apply tax to it\n\t\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\t$disc_price_with_tax = $disc_price;\n\t\t\t\t\t}\n\t\t\t\t\t$disc_price = $disc_price_with_tax;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t/*break;\n\t\t};\t*/\n\t\tif($disc_price>0)\n\t\t\treturn $disc_price;\n\t\telse\n\t\t\treturn $webprice;\n\t}", "public function getProductPrice()\n {\n }", "function get_list_product_price() {\n\n global $product;\n\n if ( $price_html = $product->get_price_html() ) :\n \t\n \techo '<span class=\"price uk-margin-small-bottom\" style=\"float: right\">';\n \techo $price_html;\n \techo '</span>';\n \t\n endif; \n\n }", "protected function calculatePrices()\n {\n }", "function displayOrder($orderoid){\n $r = array();\n // le champ INFOCOMPL de WTSCATALOG (PRODUCT) est optionnel, si présent nécessaire dans certains documents\n $r['do'] = $this->dsorder->display(array('oid'=>$orderoid, \n\t\t\t\t\t 'selectedfields'=>'all', \n\t\t\t\t\t 'options'=>array('PICKUPPOINT'=>array('target_fields'=>array('title')))\n\t\t\t\t\t ));\n $r['bl'] = $this->dsline->browse(\n\t\t\t\t array('selectedfields'=>'all',\n\t\t\t\t\t 'options'=>array('PRODUCT'=>array('target_fields'=>array('INFOCOMPL', 'label'))),\n\t\t\t\t\t 'order'=>'WTPCARD, REFERENCE',\n\t\t\t\t\t 'pagesize'=>9999,\n\t\t\t\t\t 'first'=>0,\n\t\t\t\t\t 'select'=>$this->dsline->select_query(array('cond'=>array('LNKORDER'=>array('=', $orderoid))))));\n // mise en forme des lignes achats carte, utlisation bonus, assurance, port\n // recup du premier jour de ski (paiement chq)\n $r['bl']['lines__bonu'] = array();\n $r['bl']['lines__validfromhidden'] = array();\n $r['bl']['lines__cart'] = array();\n $r['bl']['lines__assu'] = array();\n $r['bl']['lines__validtill'] = array();\n $r['bl']['lines__annul'] = array_fill(0, count($r['bl']['lines_oid']), false);\n $r['_totassu'] = 0;\n $r['_totcart'] = 0;\n $r['_totport'] = 0;\n $r['_nbforf'] = 0;\n $r['_tot1'] = 0;\n $r['_tot2'] = 0;\n $r['_totassuAnnul'] = 0;\n $r['_totcartAnnul'] = 0;\n $r['_totportAnnul'] = 0;\n $r['_tot1Annul'] = 0;\n $r['_tot2Annul'] = 0;\n $r['_cartesseules'] = array();\n $cartesfaites = array();\n $firstday = NULL;\n $nodates = true;\n // rem : assur pointe sur son forfait\n // bonus pointe sur son forfait\n // les forfaits de nouvelles cartes pointent TOUS vers la ligne ...\n // a ne compter qu'ne fois donc\n //\n // ajout du calendrier pour les lignes forfaits\n //\n foreach($r['bl']['lines_oLINETYPE'] as $l=>$olinetype){\n if ($r['bl']['lines_oETATTA'][$l]->raw == XModEPassLibre::$WTSORDERLINE_ETATTA_ANNULATION){\n $r['bl']['lines__annul'][$l] = true;\n }\n $r['bl']['lines__validfromhidden'][$l] = 0;\n if($olinetype->raw == 'port'){\n\t$r['_totport']+=$r['bl']['lines_oTTC'][$l]->raw;\n }\n if($olinetype->raw == 'forf'){\n /* -- vente de cartes seules -- */\n $r['_nbforf'] += 1;\n /* -- vente de cartes seules -- */\n $r['_tot1']+=$r['bl']['lines_oTTC'][$l]->raw;\n if ($r['bl']['lines__annul'][$l] == true)\n\t $r['_tot1Annul']+= $r['bl']['lines_oTTC'][$l]->raw;\n if ($firstday == NULL || $r['bl']['lines_oVALIDFROM'][$l]->raw < $firstday)\n $firstday = $r['bl']['lines_oVALIDFROM'][$l]->raw;\n $rsc = selectQueryGetAll(\"select type from \".self::$tablePRDCALENDAR.\" c where c.koid=(select calendar from \".self::$tablePRDCONF.\" pc where pc.koid=(select prdconf from \".self::$tableCATALOG.\" p where p.koid='{$r['bl']['lines_oPRODUCT'][$l]->raw}'))\");\n if (count($rsc)>=1 && $rsc[0]['type'] == 'NO-DATE'){\n $r['bl']['lines__validfromhidden'][$l] = 1;\n } else {\n // calcul du validtill\n $dp = $this->modcatalog->displayProduct(NULL, NULL, NULL, NULL, $r['bl']['lines_oPRODUCT'][$l]->raw);\n $dpc = $this->modcatalog->getPrdConf($dp);\n $r['bl']['lines__validtill'][$l] = $this->getValidtill($r['bl']['lines_oVALIDFROM'][$l]->raw, $dp, $dpc);\n $nodates = false;\n }\n }\n $r['_tot2']+=$r['bl']['lines_oTTC'][$l]->raw;\n if ($r['bl']['lines__annul'][$l] == true)\n $r['_tot2Annul']+= $r['bl']['lines_oTTC'][$l]->raw;\n\n $ll = false;\n if (!empty($r['bl']['lines_oLNKLINE'][$l]->raw)){\n $ll = array_search($r['bl']['lines_oLNKLINE'][$l]->raw, $r['bl']['lines_oid']);\n }\n if ($ll === false)\n continue;\n\n if($r['bl']['lines_oLINETYPE'][$ll]->raw == 'cart'){\n if (!isset($cartesfaites['_'.$ll])){\n $r['_totcart']+= $r['bl']['lines_oTTC'][$ll]->raw;\n $cartesfaites['_'.$ll] = 1;\n if ($r['bl']['lines__annul'][$ll] == true)\n $r['_totcartAnnul']+= $r['bl']['lines_oTTC'][$ll]->raw;\n }\n $r['bl']['lines__cart'][$l] = $ll;\n }\n if($olinetype->raw == 'bonu' && $r['bl']['lines_oLINETYPE'][$ll]->raw == 'forf'){\n $r['bl']['lines__bonu'][$ll] = $l;\n }\n if($olinetype->raw == 'assu' && $r['bl']['lines_oLINETYPE'][$ll]->raw == 'forf'){\n $r['bl']['lines__assu'][$ll] = $l;\n $r['_totassu']+= $r['bl']['lines_oTTC'][$l]->raw;\n if ($r['bl']['lines__annul'][$l] == true)\n $r['_totassuAnnul']+= $r['bl']['lines_oTTC'][$l]->raw;\n }\n }\n // utilisation avoirs et coupons\n if ($r['_tot2'] <= 0){\n $r['_tot2'] = 0;\n }\n /* -- vente de cartes seules -- */\n foreach($r['bl']['lines_oLINETYPE'] as $l=>$olinetype){\n if($r['bl']['lines_oLINETYPE'][$l]->raw == 'cart'){\n if (!isset($cartesfaites['_'.$l])){\n $r['_totcart']+= $r['bl']['lines_oTTC'][$l]->raw;\n $cartesfaites['_'.$l] = 1;\n $r['_cartesseules'][] = $l;\n }\n }\n }\n // calcul des totaux - annulations (pro)\n foreach(array('_tot1', '_tot2', '_totassu') as $tn){\n $r[$tn.'C'] = $r[$tn] - $r[$tn.'Annul'];\n }\n if ($firstday == NULL){\n $firstday = $r['do']['oFIRSTDAYSKI']->raw;\n }\n /* -- vente de cartes seules -- */\n $r['firstday'] = $firstday;\n $r['nodates'] = $nodates;\n /* -- cas des commandes pro -- */\n if ($this->customerIsPro()){\n $this->summarizeOrder($r);\n }\n\n return $r;\n }", "function wc_sample_xml_get_line_items( $order ) {\n \n \t//connect\n \t\tUse Wp\n\t//output the product elements from the order\n\tforeach( $order->get_items() as $item_id => $item_data ) {\n \t\t $OrderId = $order->id; \n\t\t //grab the data we need\n\t$query = \"Request to grab data from bd based on the $OrderId\";\n\t\t $sql = $connexion->query($query);\t \n\t\t $curData = array();\n \t $count = 0;\n\n\t\t //data specific info for each line item\n\n while($Ca = $sql -> fetch()) {\n\t\t\t $curData[] = $Ca;\n\t\t\t $count ++;\n\t\t\t}\n\t\t\t//If the product ned some customizations before generating the xml\n \tif ($count >0){\n\t\t\t //Format the file name and replace spaces by \"-\"\n\t\t\t $titlePath = sanitize_title( trim($ItemName) );\n\t\t\t $title = $order_idmeta.'_order_item_generated';\n\t\t\t $filePath = content_url('/fancy_products_orders/images/'.$OrderId.'/'.$order_idmeta.'/'.$title.'.png');\n\t\t\t //If the item's image is not generated\n\t\t\t $urlLiveSite = 'http://www.yourWebsite.com/';\n\t\t\t $NofilePath = ($urlTestSite.'/'.$pathElement.'/'.$titlePath);\n\t\t\t //Check if the file physically exists\n\t\t\t if (file($filePath)) {\n\t\t\t $png_url = array('Source'\t=> $filePath);\n\t\t\t } \n\t\t\t else {\n\t\t\t $png_url = array('Source'\t=> $NofilePath);\n\t\t\t }\n\n\t\t$product = $order->get_product_from_item( $item_data );\n\t\t//This is the final xml customized \n\t\t$items[] = array(\n\t\t\t'LineNumber'\t\t\t\t=> $LineNumber,\n\t\t\t'ProductCode'\t\t\t\t=> $ProductCode,\n\t\t\t'ProductUPC'\t\t\t\t=> '0004-2478',\n\t\t\t'ItemDescription'\t\t\t=> $ItemName,\n\t\t\t'Quantity'\t\t\t\t\t=> $item_data['qty'],\n\t\t\t//we need to write a function that grabs the image URL, store the url as a variable and then pass it as the value here\n\t\t\t'FileList' \t\t\t=> $png_url,\n\t\t);\n\t } //end if\n\t} //end for\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 }", "public function run()\n {\n $priceList = [\n ['337','5 Refractarios de Vidrio y 5 tapas de plastico Glazé',1],\n ['338','5 Refractarios de Vidrio y 5 tapas de plastico Glazé',2],\n ['339','5 Refractarios de Vidrio y 5 tapas de plastico Glazé',4],\n ['340','5 Refractarios de Vidrio y 5 tapas de plastico Glazé',3],\n ['341','5 Refractarios de Vidrio y 5 tapas de plastico Glazé',1],\n ['369','Abanico de Techo Harbor Breeze',1],\n ['172','abanico de techo harbor breeze.',2],\n ['531','Abanico Harbor',1],\n ['168','Abanico Taurus',1],\n ['175','Abanico Taurus',1],\n ['179','Abanico Taurus',1],\n ['310','alaciadora con placas de ceramica timco.',1],\n ['311','alaciadora con placas de ceramica timco.',1],\n ['312','alaciadora con placas de ceramica timco.',1],\n ['335','Alaciadora Revlon',2],\n ['336','Alaciadora Revlon',3],\n ['152','Alaciadora Taurus.',4],\n ['153','Alaciadora Taurus.',2],\n ['154','Alaciadora Taurus.',3],\n ['155','Alaciadora Taurus.',4],\n ['253','Arrocera c/tapa Tramontina',2],\n ['254','Arrocera c/tapa Tramontina',1],\n ['418','Asador Outdoor trend',3],\n ['360','Aspiradora',1],\n ['423','Aspiradora Dirt Devil',2],\n ['449','Aspiradora Mikel¨S',3],\n ['490','Aspiradora Mikel¨S',2],\n ['134','audifonos stf sound',3],\n ['135','audifonos stf sound',4],\n ['136','audifonos stf sound',2],\n ['137','audifonos stf sound',4],\n ['138','audifonos stf sound',1],\n ['365','Audifonos STF Sound',4],\n ['397','Audifonos STF Sound',3],\n ['406','Audifonos STF Sound',2],\n ['421','Audifonos STF Sound',1],\n ['422','Audifonos STF Sound',3],\n ['558','Audifonos STF Sound',4],\n ['559','Audifonos STF Sound',2],\n ['560','Audifonos STF Sound',4],\n ['178','Azador de Carbón Outdoor Trend',1],\n ['9','Bafle Recargable (Bocina) Concierto mio',2],\n ['352','Bajilla Ebro (12pz)',3],\n ['353','Bajilla Ebro (12pz)',4],\n ['358','Bajilla Santa Anita (16pz)',2],\n ['371','Bandeja Rectangular PYR-O-REY',1],\n ['372','Bandeja Rectangular PYR-O-REY',3],\n ['429','Bandeja Rectangular PYR-O-REY',4],\n ['548','Baño de burbujas para pies Revlon',3],\n ['604','Baño de burbujas Revlon',1],\n ['373','Bateria CINSA (7pz)',2],\n ['534','Bateria CINSA (7pz)',3],\n ['6','Bateria de Cocina (9pz) Ekos',1],\n ['480','Bateria de Cocina (9pz) Ekos',3],\n ['481','Bateria de Cocina (9pz) Ekos',4],\n ['618','Bateria de cocina 20pz Main Stays',1],\n ['619','Bateria de cocina 20pz Main Stays',3],\n ['107','bateria ecko 9 pzs.',2],\n ['308','batidora de imersion sunbeam.',1],\n ['299','batidora de imersion taurus.',3],\n ['300','batidora de imersion taurus.',4],\n ['301','batidora de imersion taurus.',2],\n ['302','batidora de imersion taurus.',1],\n ['303','batidora de imersion taurus.',4],\n ['304','batidora de imersion taurus.',2],\n ['305','batidora de imersion taurus.',4],\n ['306','batidora de imersion taurus.',3],\n ['307','batidora de imersion taurus.',3],\n ['519','Batidora Tradition',1],\n ['367','Batidora Traditions',2],\n ['375','Batidora Traditions',4],\n ['376','Batidora Traditions',4],\n ['165','bocina bafle.',3],\n ['166','bocina bafle.',2],\n ['167','bocina bafle.',1],\n ['91','bocina bafle.?cm',3],\n ['99','bocina bafle.?cm',1],\n ['430','Bocina Bluetooth Kaiser',2],\n ['431','Bocina Bluetooth Kaiser',2],\n ['148','bocina green leaf.',1],\n ['171','bocina green leaf.',2],\n ['444','Bocina green leaf.',1],\n ['8','Bocina Inalambrica Green Leaf',1],\n ['468','Bocina Inalambrica Green Leaf',2],\n ['522','Bocina Logitech',2],\n ['128','bocinas logitech.',3],\n ['510','Bocinas logitech.',4],\n ['580','Bolsa Cosmetic Lab',4],\n ['581','Bolsa Cosmetic Lab',3],\n ['536','Bolsita negra Cosmetic Lab',4],\n ['552','Bolsita negra Cosmetic Lab',2],\n ['586','Bolsita negra Cosmetic Lab',2],\n ['662','Brochas 6pz',3],\n ['664','Brochas 6pz',4],\n ['663','Brochas 8pz',3],\n ['118','brown sunbeam',4],\n ['119','brown sunbeam',3],\n ['120','brown sunbeam',4],\n ['121','brown sunbeam',3],\n ['255','Cable Pasa Corriente 120 a 12 V cc 2.5 m multitop',4],\n ['256','Cable Pasa Corriente 120 a 12 V cc 2.5 m multitop',3],\n ['48','Cafetera Best Home',4],\n ['49','Cafetera Best Home',3],\n ['189','Cafetera Best Home',4],\n ['190','Cafetera Best Home',2],\n ['366','Cafetera Best Home',2],\n ['392','Cafetera Best Home',2],\n ['386','Cafetera Best Home',4],\n ['433','Cafetera Best Home',2],\n ['442','Cafetera Best Home',2],\n ['443','Cafetera Best Home',1],\n ['85','cafetera best home.',2],\n ['110','cafetera best home.',3],\n ['144','cafetera best home.',4],\n ['466','Cafetera de goteo Best Home',2],\n ['216','caja de herramientas 17\" truper.',3],\n ['217','caja de herramientas 17\" truper.',2],\n ['218','caja de herramientas 17\" truper.',4],\n ['489','Calefactor Best Home',1],\n ['57','Calefactor de halógeno Best Home',3],\n ['251','Calentador c/tapa de Vidrio CINSA 1.7 Litros',4],\n ['252','Calentador c/tapa de Vidrio CINSA 1.7 Litros',2],\n ['354','Calentón Best Home',1],\n ['361','Calentón Best Home',4],\n ['507','Calentón Best Home',2],\n ['374','Class Bows (5pz) Libbey',1],\n ['159','cobertor con borrega.',4],\n ['243','Cobertor Fusionado Estampado con Borrega Soft Sensations King Size',2],\n ['244','Cobertor Fusionado Estampado con Borrega Soft Sensations Matrimonial',1],\n ['113','cobijita cuadrada.',4],\n ['196','Colcha con cojin Mainstays',2],\n ['237','Colcha con Cojin Mainstays',2],\n ['229','colchon ortopedico individual master',3],\n ['230','colchon ortopedico individual master',4],\n ['231','Colchón Ortopedico Individual Master',2],\n ['232','Colchón Super Ortopedico Individual Master',1],\n ['233','Colchón Super Ortopedico Individual Master',3],\n ['535','Comedor',1],\n ['124','copa cristar 4 pzs.',2],\n ['125','copa cristar 4 pzs.',2],\n ['504','Copa cristar 4 pzs.',4],\n ['501','Copas cristar (4pz)',2],\n ['364','Copas de Cristal (4pz)',1],\n ['390','Copas de Cristal (4pz)',3],\n ['72','cortadora de cabello taurus',4],\n ['73','cortadora de cabello taurus',2],\n ['74','cortadora de cabello taurus',1],\n ['147','cortadora de cabello taurus',3],\n ['416','Cortadora de cabello taurus',4],\n ['425','cortadora de cabello taurus',2],\n ['426','cortadora de cabello taurus',1],\n ['440','cortadora de cabello taurus',3],\n ['470','Cortadora de cabello taurus',4],\n ['471','Cortadora de cabello taurus',4],\n ['520','Cortadora de cabello taurus',1],\n ['582','Cosmetiquera',3],\n ['583','Cosmetiquera',2],\n ['584','Cosmetiquera',3],\n ['585','Cosmetiquera',2],\n ['653','Cosmetiquera',1],\n ['659','Cosmetiquera',3],\n ['643','Cosmetiquera Cosmetic Lab',3],\n ['599','Cosmetiquera cristalina Cosmetic Lab',2],\n ['600','Cosmetiquera gris con blanco Cosmetic Lab',3],\n ['567','Cosmetiquera rosa Cosmetic Lab',2],\n ['568','Cosmetiquera rosa Cosmetic Lab',2],\n ['569','Cosmetiquera rosa Cosmetic Lab',3],\n ['570','Cosmetiquera rosa Cosmetic Lab',4],\n ['537','Cosmetiquera The Best',1],\n ['84','crock. Pot olla electrica.',3],\n ['546','Cuadro flotante Main Stayns 24 fotos (Blanco)',2],\n ['545','Cuadro flotante Main Stayns 24 fotos (Negro)',3],\n ['417','Cubiertos SK (16pz)',1],\n ['176','Delineadora de Barba Timco',1],\n ['645','Desarmador de trinquete Stanley',3],\n ['641','Desarmadores truper 5pz',1],\n ['642','Desarmadores truper 5pz',2],\n ['434','Duo Cups T-Fal',3],\n ['592','DVD con Karaoke',2],\n ['593','DVD con Karaoke',1],\n ['241','Edredón de Microfibra Matrimonial Mainstays',3],\n ['242','Edredón de Microfibra Matrimonial Mainstays',4],\n ['158','edredon mainstays.',5],\n ['191','Edredon Viajero',2],\n ['195','Edredon Viajero 926',3],\n ['235','Edredón Viajero NANO (1.15 x 1.50) mts beige',4],\n ['236','Edredón Viajero NANO (1.15 x 1.50) mts café',1],\n ['239','Edredrón Doble Vista Individual Essentails Home',2],\n ['240','Edredrón Doble Vista Individual Essentails Home',3],\n ['238','Edredrón Matrimonial Mainstays',4],\n ['414','Escurridor de platos',1],\n ['437','Escurridor de platos Hamilton Beach',2],\n ['438','Escurridor de platos Hamilton Beach',3],\n ['439','Escurridor de platos Hamilton Beach',4],\n ['633','Estuche de brochas 6pz',1],\n ['3','Estufa Acros',2],\n ['108','estufa para bufe black + decker.',3],\n ['1','Estufa Ranger IEM',4],\n ['385','Exprimidor electrico proctor siler',1],\n ['529','Exprimidor electrico proctor siler',2],\n ['530','Exprimidor electrico proctor siler',3],\n ['399','Frasada',1],\n ['400','Frasada',2],\n ['401','Frasada',3],\n ['402','Frasada',4],\n ['403','Frasada',1],\n ['404','Frasada',2],\n ['511','Frazada Main Stayns',3],\n ['538','Frazada Main Stayns',1],\n ['539','Frazada Main Stayns',2],\n ['540','Frazada Main Stayns',3],\n ['541','Frazada Main Stayns',4],\n ['566','Frazada Main Stayns',1],\n ['370','Frazada Mainstays',2],\n ['156','frazada mainstays.',4],\n ['157','frazada mainstays.',1],\n ['163','frazada mainstays.',2],\n ['112','frazada throw',3],\n ['245','Frazada Viajera NANO',4],\n ['219','hielera 12 latas 10.5 litros nyc.',1],\n ['220','hielera 12 latas 10.5 litros nyc.',2],\n ['486','hielera 12 latas nyc.',3],\n ['225','hielera 54 lata 45.5 litros nyc.',4],\n ['223','hielera coleman 34 litros',1],\n ['224','hielera coleman 34 litros',2],\n ['221','hielera igloo 11 litros',3],\n ['222','hielera igloo 11 litros',3],\n ['532','Horno Black and Decker',1],\n ['203','horno de microondas hamilton Beach.',2],\n ['180','Horno Electrico Best Home',3],\n ['487','Horno microondas Hamilton',4],\n ['350','Jarra y Vasos Crisa (5pz)',1],\n ['448','Jarra y Vasos Crisa (5pz)',2],\n ['459','Jarra y Vasos Crisa (7pz)',3],\n ['66','Jarra y Vasos Crisia (5pz)',4],\n ['184','Jarra y Vasos Crisia (7pz)',1],\n ['349','Juedo de Cubiertos Mainstays',2],\n ['26','Juego Crisa (8pz)',3],\n ['461','Juego Crisa (8pz)',3],\n ['602','Juego de 6 llaves pretul',1],\n ['647','Juego de 6 llaves pretul',2],\n ['101','juego de agua bassic',3],\n ['102','juego de agua bassic',4],\n ['379','Juego de Agua Bassic (7pz)',1],\n ['380','Juego de Agua Bassic (7pz)',2],\n ['395','Juego de agua Bassic (7pz)',3],\n ['419','Juego de Agua Bassic (7pz)',4],\n ['12','Juego de Agua Neptuno (7pz)',1],\n ['23','Juego de Agua Neptuno (7pz)',2],\n ['29','Juego de Agua Neptuno (7pz)',4],\n ['75','juego de agua neptuno 7 pzas.',1],\n ['76','juego de agua neptuno 7 pzas.',2],\n ['658','Juego de baño',3],\n ['660','Juego de baño',3],\n ['639','Juego de baño 7pz Aromanice',1],\n ['640','Juego de baño 7pz Aromanice',2],\n ['553','Juego de baño Aromanice',3],\n ['554','Juego de baño Aromanice',4],\n ['555','Juego de baño Aromanice',1],\n ['644','Juego de baño Aromanice',2],\n ['465','Juego de Bar de vidrio (8pz)',4],\n ['485','Juego de Bar de vidrio (8pz)',1],\n ['183','Juego de Bar Libbey (8pz)',1],\n ['505','Juego de Bar Libbey (8pz)',2],\n ['561','Juego de brochas 7pz Xpert Beauty',3],\n ['562','Juego de brochas 7pz Xpert Beauty',4],\n ['563','Juego de brochas 7pz Xpert Beauty',1],\n ['564','Juego de brochas 7pz Xpert Beauty',2],\n ['565','Juego de brochas 7pz Xpert Beauty',4],\n ['608','Juego de brochas 8pz',1],\n ['609','Juego de brochas 8pz',2],\n ['610','Juego de brochas 8pz',1],\n ['188','Juego de Cocina (4pz) Ekco',2],\n ['104','juego de cocina 4 pzs ecko.',4],\n ['405','Juego de Cubiertos (16pz)',1],\n ['257','Juego de Cubiertos (16pz) Mainstays',2],\n ['258','Juego de Cubiertos (16pz) Mainstays',3],\n ['259','Juego de Cubiertos (16pz) Mainstays',4],\n ['260','Juego de Cubiertos (16pz) Mainstays',1],\n ['261','Juego de Cubiertos (16pz) Mainstays',2],\n ['293','juego de cubiertos 16 pcs mainstays.',3],\n ['309','juego de cubiertos 16 pzas simple kitchen.',4],\n ['284','juego de cubiertos 16 pzs gibson.',1],\n ['285','juego de cubiertos 16 pzs gibson.',2],\n ['286','juego de cubiertos 16 pzs gibson.',4],\n ['287','juego de cubiertos 16 pzs gibson.',1],\n ['288','juego de cubiertos 16 pzs gibson.',2],\n ['289','juego de cubiertos 16 pzs gibson.',4],\n ['290','juego de cubiertos 16 pzs gibson.',1],\n ['291','juego de cubiertos 16 pzs gibson.',2],\n ['63','Juego de Cubiertos Sk (16pz)',3],\n ['64','Juego de Cubiertos Sk (16pz)',4],\n ['276','juego de cucharas 5 pzs para cocinar.',1],\n ['277','juego de cucharas 5 pzs para cocinar.',2],\n ['278','juego de cucharas 5 pzs para cocinar.',3],\n ['279','juego de cucharas 5 pzs para cocinar.',4],\n ['280','juego de cucharas 5 pzs para cocinar.',1],\n ['281','juego de cucharas 5 pzs para cocinar.',2],\n ['282','juego de cucharas 5 pzs para cocinar.',3],\n ['283','juego de cucharas 5 pzs para cocinar.',3],\n ['383','Juego de cuchillos top choice',4],\n ['488','Juego de cuchillos 12 piezas Tramontina',1],\n ['262','juego de cuchillos 4 pcs tramontina.',2],\n ['263','juego de cuchillos 4 pcs tramontina.',3],\n ['264','juego de cuchillos 4 pcs tramontina.',4],\n ['265','juego de cuchillos 4 pcs tramontina.',1],\n ['266','juego de cuchillos 4 pcs tramontina.',2],\n ['267','juego de cuchillos 4 pcs tramontina.',3],\n ['268','juego de cuchillos 4 pcs tramontina.',1],\n ['269','juego de cuchillos 4 pcs tramontina.',2],\n ['270','juego de cuchillos 4 pcs tramontina.',3],\n ['271','juego de cuchillos 4 pcs tramontina.',4],\n ['272','juego de cuchillos 4 pcs tramontina.',1],\n ['273','juego de cuchillos 4 pcs tramontina.',2],\n ['274','juego de cuchillos 4 pcs tramontina.',3],\n ['275','juego de cuchillos 4 pcs tramontina.',4],\n ['292','juego de cuchillos 4 pcs tramontina.',1],\n ['44','Juego de cuchillos Top Choice',2],\n ['182','Juego de cuchillos Top Choice',3],\n ['199','Juego de Cuchillos Top Choice',4],\n ['646','Juego de desarmador de puntas',1],\n ['638','Juego de desarmador truper',2],\n ['650','Juego de desatornillador truper',3],\n ['321','juego de herramientas 15 pzas workpro.',4],\n ['427','Juego de herramientas pretul (70pz)',1],\n ['428','Juego de herramientas pretul (70pz)',2],\n ['41','Juego de jarras y vasos crisa',3],\n ['42','Juego de jarras y vasos crisa',4],\n ['607','Juego de maquillaje 37pz',1],\n ['572','Juego de maquillaje 37pz C.L.',2],\n ['573','Juego de maquillaje 37pz C.L.',3],\n ['634','Juego de maquillaje 41pz',4],\n ['635','Juego de maquillaje 41pz',1],\n ['636','Juego de maquillaje 41pz',2],\n ['637','Juego de maquillaje 41pz',3],\n ['318','juego de peluqueria 18 pzas conair.',4],\n ['319','juego de peluqueria 18 pzas conair.',1],\n ['31','Juego de puntas p/desarmador Truper',2],\n ['32','Juego de puntas p/desarmador Truper',3],\n ['411','Juego de puntas y dados Truper (25pz)',4],\n ['193','Juego de recipientes Best Home (3pz)',1],\n ['194','Juego de recipientes Best Home (3pz)',1],\n ['67','Juego de Sartenes (3pz) Ecko',2],\n ['68','Juego de Sartenes (3pz) Ecko',3],\n ['69','Juego de Sartenes (3pz) Ecko',4],\n ['70','Juego de Sartenes (4pz) Ecko',1],\n ['477','Juego de servir Jarra con vaso',2],\n ['469','Juego de vasos (12pz) Main Stayns',3],\n ['478','Juego de vasos (6pz9 glaze',4],\n ['632','Juego de vasos 6pz Glaze',2],\n ['620','Juego de vasos 8pz Main Stays',3],\n ['621','Juego de vasos 8pz Main Stays',4],\n ['622','Juego de vasos 8pz Main Stays',3],\n ['623','Juego de vasos 8pz Main Stays',1],\n ['624','Juego de vasos 8pz Main Stays',2],\n ['625','Juego de vasos 8pz Vsantos',3],\n ['626','Juego de vasos 8pz Vsantos',4],\n ['627','Juego de vasos 8pz Vsantos',1],\n ['467','Juego de vasos de España (10pz) Santos',2],\n ['458','Juego de vasos Vsantos (10pz)',3],\n ['7','Juego de Vasos, Platos y Cucharas (12 pz) Santa Elenita',4],\n ['456','Juego para agua valencia (6pz)',1],\n ['38','Juguera Electrica Hometech',2],\n ['39','Juguera Electrica Hometech',3],\n ['71','Juguera Electrica Hometech',4],\n ['197','Juguera Electrica Hometech',1],\n ['457','Kit de peluqueria Timco (10pz)',2],\n ['116','lampara de buro best home.',3],\n ['435','lampara de buro best home.',3],\n ['4','Lavadora Acros',1],\n ['201','lavadora automatica daewo 14kg.',2],\n ['204','lavadora automatica daewo 19 kg.',3],\n ['200','lavadora automatica daewo 19kg.',4],\n ['143','licuadora americam',2],\n ['10','Licuadora American',1],\n ['20','Licuadora American',2],\n ['21','Licuadora American',1],\n ['22','Licuadora American',2],\n ['34','Licuadora American',3],\n ['36','Licuadora American',1],\n ['37','Licuadora American',2],\n ['462','Licuadora American',3],\n ['89','licuadora american.',4],\n ['142','licuadora oster',3],\n ['151','licuadora oster',1],\n ['177','Licuadora Oster',2],\n ['483','Licuadora Oster',3],\n ['198','Licuadora Taurus',4],\n ['359','Licuadora Taurus',1],\n ['388','Licuadora Taurus',2],\n ['574','Make up collection 89pz',3],\n ['575','Make up collection 89pz',4],\n ['579','Make up collection 89pz',1],\n ['576','Make up collection 96pz',2],\n ['577','Make up collection 96pz',3],\n ['578','Make up collection 96pz',4],\n ['226','maleta etco travel.',3],\n ['227','maleta etco travel.',1],\n ['174','Maleta LQ Chica',2],\n ['173','Maleta LQ Mediana',3],\n ['59','Manta de Polar Mainstays',4],\n ['60','Manta de Polar Mainstays',1],\n ['61','Manta de Polar Mainstays',2],\n ['342','Manta de Polar Mainstays',3],\n ['343','Manta de Polar Mainstays',4],\n ['344','Manta de Polar Mainstays',3],\n ['345','Manta de Polar Mainstays',4],\n ['346','Manta de Polar Mainstays',2],\n ['347','Manta de Polar Mainstays',3],\n ['348','Manta de Polar Mainstays',1],\n ['591','Manta de Polar Mainstays',2],\n ['652','Manta Mainstays azul',3],\n ['651','Manta Mainstays gris',4],\n ['648','Manta polar Azul',1],\n ['657','Manta polar café',2],\n ['656','Manta polar gris',3],\n ['649','Manta polar verde',4],\n ['398','Maquina para el cabello Timco',1],\n ['549','Maquina para palomitas sunbeam',2],\n ['603','Matraka con dados 16pz Santul',3],\n ['105','microondas daewoo.',2],\n ['106','microondas daewoo.',2],\n ['202','microondas daewoo.',2],\n ['249','Olla de Aluminio c/tapa Hometrends 1.9 litros',3],\n ['250','Olla de Aluminio c/tapa Hometrends 1.9 litros',4],\n ['247','Olla de Aluminio c/tapa Hometrends 2.8 litros',1],\n ['248','Olla de Aluminio c/tapa Hometrends 2.8 litros',2],\n ['246','Olla de Aluminio c/tapa Hometrends 4.7 litros',3],\n ['160','olla de coccion lenta black & decker.',4],\n ['492','olla de lento cocimiento Black and decker',1],\n ['473','Olla de lento cocimiento hamilton beach',2],\n ['464','Olla Lento Cocimiento Black Decker',3],\n ['181','Olla Lento Cocimiento Hamilton Beach',4],\n ['378','Olla Lento Cocimiento Hamilton Beach',1],\n ['187','Parrilla Electrica Michel',2],\n ['368','Parrilla Electrica Michel',3],\n ['77','parrilla electrica michel.',4],\n ['149','parrilla electrica taurus',1],\n ['150','parrilla electrica taurus',2],\n ['377','Parrilla Michel',3],\n ['82','parrillera electrica michel.',4],\n ['408','Perfiladora tauros',1],\n ['409','Perfiladora tauros',2],\n ['410','Perfiladora tauros',3],\n ['11','Plancha Black & Decker',4],\n ['14','Plancha Black & Decker',1],\n ['15','Plancha Black & Decker',2],\n ['16','Plancha Black & Decker',3],\n ['17','Plancha Black & Decker',4],\n ['18','Plancha Black & Decker',1],\n ['78','plancha black & decker.',2],\n ['79','plancha black & decker.',3],\n ['80','plancha black & decker.',4],\n ['103','plancha black & decker.',1],\n ['19','Plancha Taurus',2],\n ['122','plancha taurus.',3],\n ['123','plancha taurus.',4],\n ['500','Platos Crisa (12pz)',1],\n ['43','Platos elite (3pz)',2],\n ['450','Platos porcelana elit (3pz)',3],\n ['30','Proctor Silex (exprimidor)',4],\n ['384','Rasuradora timco Men',1],\n ['407','Razones crisa (8pz)',2],\n ['357','Recamara',3],\n ['451','Recipientes Best Home (3pz)',4],\n ['313','recortadora de barba y bigote conair.',1],\n ['314','recortadora de barba y bigote conair.',2],\n ['315','recortadora de barba y bigote conair.',3],\n ['316','recortadora de barba y bigote conair.',4],\n ['317','recortadora de barba y bigote conair.',1],\n ['320','recortadora de barba y bigote conair.',2],\n ['514','Recortadora de barba y bigote conair.',2],\n ['2','Refrigerador Mabe',3],\n ['542','Reloj de pared',4],\n ['590','Reloj Home Trends',1],\n ['322','rizador de cabello taurus.',2],\n ['323','rizador de cabello taurus.',3],\n ['324','rizador de cabello taurus.',4],\n ['325','rizador de cabello taurus.',1],\n ['326','rizador de cabello taurus.',2],\n ['327','rizador de cabello taurus.',3],\n ['328','rizador de cabello taurus.',1],\n ['329','rizador de cabello taurus.',2],\n ['330','rizador de cabello taurus.',3],\n ['331','rizador de cabello taurus.',1],\n ['362','Ropero',2],\n ['50','Sandwichera Black & Decker',4],\n ['62','Sandwichera Black & Decker',4],\n ['81','sandwichera black and decker',3],\n ['40','Santa Elenita (16pz)',2],\n ['52','Sarten electrico Holstein',1],\n ['351','Sarten electrico Holstein',4],\n ['356','Secadora Conair',3],\n ['139','secadora conair.',3],\n ['140','secadora conair.',1],\n ['332','Secadora Mediana Conair',2],\n ['333','Secadora Mediana Conair',3],\n ['334','Secadora Mediana Conair',4],\n ['164','secadora timco.',1],\n ['297','set de accesorios para asar 3 pzas acero inoxidable.',2],\n ['298','set de accesorios para asar 3 pzas acero inoxidable.',3],\n ['296','set de accesorios para asar 3 pzas. Acero inoxidable.',4],\n ['294','set de accesorios para asar 3 pzas. Outdoor trend',1],\n ['295','set de accesorios para asar 3 pzas. Outdoor trend',2],\n ['571','Set de brochas 6pz Cosmetic Lab',3],\n ['543','Set de cubiertos 24 piezas',4],\n ['544','Set de cubiertos 24 piezas',1],\n ['594','Set de cuchillos Acero Inoxidable',2],\n ['595','Set de cuchillos Acero Inoxidable',3],\n ['596','Set de cuchillos Acero Inoxidable',2],\n ['493','Set de tazas (3pz) Main Stayns',1],\n ['192','Set de Tazones (3pz)',2],\n ['513','Set de Tazones (3pz) Main Stayns',3],\n ['598','Set de tazones 3pz',4],\n ['631','Set de tazones 3pz Main Stays',1],\n ['460','Set de Tazones Mainstays (3pz)',2],\n ['661','Set de utencilios Backyard Grill',4],\n ['597','Set de utencilios de bambu',4],\n ['654','Set de utencilios de bambu',3],\n ['655','Set de utencilios de bambu',1],\n ['611','Set de vaso 8 pz Crisa',2],\n ['612','Set de vaso 8 pz Crisa',3],\n ['613','Set de vaso 8 pz Crisa',4],\n ['614','Set de vaso 8 pz Crisa',1],\n ['615','Set de vaso 8 pz Crisa',2],\n ['517','Set Oasis (2pz)',3],\n ['605','Silla mariposa Main Stays',4],\n ['606','Silla mariposa Main Stays',1],\n ['5','Smart TV RCA 40\"',2],\n ['228','sofacama hometrends.',3],\n ['601','Stanley Control Grip 29pz',4],\n ['382','Tablet tech pad \"7\"',1],\n ['387','Tablet tech pad \"7\"',2],\n ['455','Tablet tech pad \"7\"',3],\n ['518','Tablet tech pad \"7\"',4],\n ['129','tablet tech pad 7\"',1],\n ['130','tablet tech pad 7\"',4],\n ['131','tablet tech pad 7\"',3],\n ['132','tablet tech pad 7\"',2],\n ['133','tablet tech pad 7\"',1],\n ['412','tazones crisa',4],\n ['413','tazones crisa',3],\n ['420','Tazones crisa (8pz)',2],\n ['452','Tazones crisa (8pz)',1],\n ['497','Tazones crisa (8pz)',4],\n ['90','tazones crisa 8 pzas.',3],\n ['92','tazones crisa 8 pzas.',2],\n ['56','Tazones de Vidrio Crisa',1],\n ['415','Tazones Maintavs (3pz)',4],\n ['441','Tazones Maintavs (3pz)',3],\n ['498','Tazones Maintays (3pz)',2],\n ['234','Televición Led Smart FHD TV 40\" RCA',1],\n ['215','television orizzonte 43\" smart.',4],\n ['205','television quaroni 32\" led.',3],\n ['206','television quaroni 32\" led.',2],\n ['207','television quaroni 32\" led.',1],\n ['208','television quaroni 32\" led.',2],\n ['209','television quaroni 32\" led.',4],\n ['210','television quaroni 32\" led.',2],\n ['211','television quaroni 32\" led.',3],\n ['212','television quaroni 32\" led.',4],\n ['213','television quaroni 32\" led.',2],\n ['214','television quaroni 32\" led.',4],\n ['111','tetera best home.',1],\n ['33','Tetera Electrica RCA',2],\n ['35','Tetera RCA',1],\n ['169','Tetera RCA',3],\n ['393','Tetera RCA',1],\n ['463','Tetera RCA',2],\n ['117','t-fal duo cups.',2],\n ['355','Tostador Best Home',3],\n ['479','Tostador de pan Taurus',1],\n ['145','tostador taurus',2],\n ['185','Tostador Taurus',3],\n ['186','Tostador Taurus',4],\n ['550','Tres espejos Home creations',1],\n ['551','Tres espejos Home creations',2],\n ['484','Vajilla (12pz) Bormioli',3],\n ['491','Vajilla (12pz) Crisa',4],\n ['51','Vajilla (12pz) Venecia',1],\n ['474','Vajilla (12pz)Bormioli',2],\n ['616','Vajilla 12pz Andalucita',3],\n ['617','Vajilla 12pz Home Gallery',4],\n ['503','Vajilla Bicrila (12pz)',1],\n ['502','Vajilla Crisa (12pz)',2],\n ['556','Vajilla Crisa (12pz)',3],\n ['557','Vajilla Crisa (8pz)',4],\n ['630','Vajilla de porcelana 12pz Home Gallery',1],\n ['628','Vajilla de vidrio 12pz crisa',2],\n ['629','Vajilla de vidrio 12pz crisa',3],\n ['446','Vajilla Ebro (12pz)',3],\n ['447','Vajilla Ebro (12pz)',1],\n ['472','vajilla para 4 personas opal glass',1],\n ['476','Vajilla para 5 personas Bormioli',3],\n ['58','Vajilla Santa Elenita (16pz)',2],\n ['88','vajilla venecia 12 pzas.',1],\n ['93','vajilla venecia 12 pzas.',1],\n ['94','vajilla venecia 12 pzas.',2],\n ['98','vajilla venecia 12 pzas.',3],\n ['516','vajilla venecia 12 pzas.',4],\n ['65','Vajilla Vicria (12pz)',1],\n ['389','Vajilla vicrila (12pz)',2],\n ['432','Vajilla vicrila (12pz)',3],\n ['521','Vajillas Santa Anita (16pz)',4],\n ['127','vallija 12 pzs crisa.',1],\n ['547','Vaporera 5.2 lts Hammilton',2],\n ['496','Vaso Bassic (8pz)',3],\n ['53','Vasos (6pz) Bassic',4],\n ['54','Vasos (6pz) Bassic',2],\n ['55','Vasos (6pz) Bassic',1],\n ['24','Vasos (8pz) Bassic',3],\n ['25','Vasos (8pz) Bassic',1],\n ['13','Vasos (8pz) Crisa',3],\n ['391','Vasos Bassic (6pz)',4],\n ['394','Vasos Bassic (6pz)',3],\n ['396','Vasos Bassic (6pz)',1],\n ['436','Vasos Bassic (8pz)',4],\n ['445','Vasos Bassic (8pz)',4],\n ['515','Vasos Bassic (8pz)',4],\n ['170','vasos bassic 6 pzas.',1],\n ['87','vasos bassic 8 pzas.',2],\n ['95','vasos bassic 8 pzas.',3],\n ['28','Vasos Crisa (8pz)',1],\n ['161','Vasos Crisa (8pz)',2],\n ['162','Vasos Crisa (8pz)',3],\n ['83','vasos crisa 8 pzas.',1],\n ['86','vasos crisa 8 pzas.',2],\n ['96','vasos crisa 8 pzas.',3],\n ['97','vasos crisa 8 pzas.',1],\n ['100','vasos crisa 8 pzas.',1],\n ['146','vasos crisa 8 pzas.',2],\n ['424','Vasos España (10pz)',3],\n ['499','Vasos España (10pz)',1],\n ['509','Vasos España (10pz)',2],\n ['512','Vasos España (10pz)',3],\n ['381','Vasos glaze',1],\n ['453','Vasos Glaze (6pz)',2],\n ['454','Vasos Glaze (6pz)',1],\n ['494','Vasos Glaze (6pz)',2],\n ['495','Vasos Glaze (6pz)',1],\n ['506','Vasos Glaze (6pz)',2],\n ['508','Vasos Glaze (6pz)',1],\n ['523','Vasos glaze (6pz)',4],\n ['524','Vasos glaze (6pz)',3],\n ['525','Vasos glaze (6pz)',2],\n ['526','Vasos glaze (6pz)',3],\n ['527','Vasos glaze (6pz)',4],\n ['528','Vasos glaze (6pz)',2],\n ['533','Vasos Glaze (6pz)',3],\n ['45','Vasos Glazé (6pz)',4],\n ['46','Vasos Glazé (6pz)',2],\n ['47','Vasos Glazé (6pz)',3],\n ['114','vasos glazé 6 pzs',4],\n ['115','vasos glazé 6 pzs',2],\n ['126','vasos glazé 6 pzs',3],\n ['141','vasos glazé 6 pzs',2],\n ['109','vasos vicrila 8 pzas.',3],\n ['363','Ventilador Taurus',2],\n ['27','Vitrolero (3 tLts)',3],\n ['482','Vitrolero practico Jema flex',2],\n ['587','Zapatero 2 niveles',3],\n ['588','Zapatero 2 niveles',2],\n ['589','Zapatero 2 niveles',3],\n ['475','Juego de 6 vasos de cristal',4]\n ];\n\n foreach ($priceList as $key => $priceName) {\n Prize::create([\n 'article_no' => $priceName[0],\n 'name' => $priceName[1],\n 'batch' => $priceName[2],\n ]);\n }\n }", "public function getCssCustomProduct()\n {\n return Mage::getStoreConfig('splitprice/split_price_presentation/css_product');\n }", "public function getProductSaveInfo($product, $data) {\n $product->setColor ( $data [11] );\n $product->setCost ( $data [12] );\n $product->setCountry ( $data [13] );\n $product->setCountryOfManufacture ( $data [14] );\n $product->setCreatedAt ( $data [15] );\n $product->setDescription ( $data [20] );\n $product->setEnableGooglecheckout ( $data [21] );\n $product->setGallery ( $data [22] );\n $product->setGiftMessageAvailable ( $data [23] );\n $product->setHasOptions ( $data [24] );\n $product->setHostemail ( $data [25] );\n $product->setHouserule ( $data [26] );\n $product->setImage ( $data [27] );\n $product->setImageLabel ( $data [28] );\n $product->setMediaGallery ( $data [30] );\n $product->setMinimalPrice ( $data [34] );\n $product->setMsrp ( $data [35] );\n $product->setMsrpDisplayActualPriceType ( $data [36] );\n $product->setMsrpEnabled ( $data [37] );\n $product->setName ( $data [38] );\n $product->setNewsFromDate ( strtotime ( $data [39] ) );\n $product->setNewsToDate ( '' );\n if (isset ( $data [41] )) {\n $product->setOptionsContainer ( $data [41] );\n }\n if (isset ( $data [43] )) {\n $product->setPrice ( $data [43] );\n }\n if (isset ( $data [44] )) {\n $product->setPrivacy ( $data [44] );\n }\n if (isset ( $data [45] )) {\n $product->setPropertyadd ( $data [45] );\n }\n if (isset ( $data [46] )) {\n $product->setPropertytype ( $data [46] );\n }\n if (isset ( $data [47] )) {\n $product->setPropertyWebsite ( $data [47] );\n }\n if (isset ( $data [48] )) {\n $product->setRequiredOptions ( $data [48] );\n }\n if (isset ( $data [49] )) {\n $product->setShortDescription ( $data [49] );\n }\n if (isset ( $data [50] )) {\n $product->setSmallImage ( $data [50] );\n }\n if (isset ( $data [51] )) {\n $product->setSmallImageLabel ( $data [51] );\n }\n if (isset ( $data [52] )) {\n $product->setSpecialFromDate ( $data [52] );\n }\n if (isset ( $data [53] )) {\n $product->setSpecialPrice ( $data [53] );\n }\n if (isset ( $data [54] )) {\n $product->setSpecialToDate ( $data [54] );\n }\n if (isset ( $data [55] )) {\n $product->setStatus ( $data [55] );\n }\n if (isset ( $data [56] )) {\n $product->setTaxClassId ( $data [56] );\n }\n if (isset ( $data [57] )) {\n $product->setThumbnail ( $data [57] );\n } \n return $product;\n }", "public function price_table() {\n\t\tif ( $this->coming_soon ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$out[] = '<script>jQuery( document ).ready(function() {jQuery( \".edd-add-to-cart-label\" ).html( \"Choose\" );});</script>';\n\t\t$out[] = sprintf( '<!--Pricing Table Section--><section id=\"pricing\"><div class=\"container\">\n<div class=\"container\">%1s</div>', $this->purchase_cta());\n\t\t$i = 1;\n\t\tforeach( $this->pricing() as $price ) {\n\t\t\t$out[] = sprintf(\n\t\t\t\t'<div class=\"col-lg-4 col-md-4 col-sm-12 col-xs-12 pricing-box\">\n\t\t\t\t\t<div id=\"price-%0s\" class=\"bggray price\">\n\t\t\t\t\t\t<div class=\"package\">%1s</div>\n\t\t\t\t\t\t<div class=\"divider\"></div>\n\t\t\t\t\t\t<div class=\"amount\">$%2s</div>\n\t\t\t\t\t\t<div class=\"duration\">%3s</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"featcontent\">\n\t\t\t\t\t\t%4s\n\t\t\t\t\t</div>\n\t\t\t\t</div>',\n\t\t\t\t$i,\n\t\t\t\t$price[ 'level' ],\n\t\t\t\t$price[ 'amount' ],\n\t\t\t\t$price[ 'sites' ],\n\t\t\t\t$price[ 'link' ]\n\t\t\t);\n\t\t\t$i++;\n\n\t\t}\n\n\t\t$out[] = '</div></section>';\n\n\t\treturn implode( '', $out );\n\n\t}", "private function HTML_SumUp_Price() : string\n {\n return $this->HTML_TxPart(\n 'Prix ' . ($this->infos['tx_type'] == 'buy' ? 'd\\'achat' : 'de vente'),\n self::AutoFloatFormat($this->infos['tx_price']) . ' ' . $this->Index()->infos['symbol']\n );\n }", "abstract public function coordinates();", "function svgline($x1,$y1,$x2,$y2,$xmul,$ymul)\n{\n global $colors;\n $str=\"\";\n $strokew=$xmul*0.1;\n \n $col=$colors[$y1%count($colors)];\n\n if((abs($x2-$x1)>1)&&($y1!=$y2)){\n $str.=\"<line x1='\".($x1*$xmul).\"' y1='\".($y1*$ymul).\"' x2='\".(($x2-1)*$xmul).\"' y2='\".($y1*$ymul).\"' stroke='\".$col.\"' style='stroke-width:\".$strokew.\"' />\";\n $str.=\"<line x1='\".(($x2-1)*$xmul).\"' y1='\".($y1*$ymul).\"' x2='\".($x2*$xmul).\"' y2='\".($y2*$ymul).\"' stroke='\".$col.\"' style='stroke-width:\".$strokew.\"' />\";\n }else{\n $str.=\"<line x1='\".($x1*$xmul).\"' y1='\".($y1*$ymul).\"' x2='\".($x2*$xmul).\"' y2='\".($y2*$ymul).\"' stroke='\".$col.\"' style='stroke-width:\".$strokew.\"' />\";\n }\n\n return($str);\n}", "public function getProductPriceHtml($_product) {\n return Mage::getSingleton('core/layout')\n ->createBlock('santander/product_list')\n ->setTemplate('santander/list.phtml')\n ->setProduct($_product)\n ->toHtml();\n }", "public function getProductPosition()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_presentation/show_product_position', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }", "function generateLevelBarChart($pays,$ind,$agr,$con,$it)\n {\n $MyData = new pData(); \n $MyData->addPoints($it,\"IT solution\");\n $MyData->addPoints($ind ,\"Industrie\");\n $MyData->addPoints($con,\"Construction\");\n $MyData->addPoints($agr,\"Agriculture\");\n $MyData->setAxisName(0,\"Nombre de partenaires\");\n $MyData->addPoints($pays,\"Labels\");\n $MyData->setSerieDescription(\"Labels\",\"Months\");\n $MyData->setAbscissa(\"Labels\");\n $Palette = array(\"0\"=>array(\"R\"=>46,\"G\"=>151,\"B\"=>224,\"Alpha\"=>100),\n \"1\"=>array(\"R\"=>128,\"G\"=>128,\"B\"=>128,\"Alpha\"=>100),\n \"2\"=>array(\"R\"=>204,\"G\"=>102,\"B\"=>0,\"Alpha\"=>100),\n \"3\"=>array(\"R\"=>0,\"G\"=>153,\"B\"=>0,\"Alpha\"=>100),\n );\n $MyData->setPalette(\"IT solution\",array(\"R\"=>46,\"G\"=>151,\"B\"=>224,\"Alpha\"=>100)) ; \n $MyData->setPalette(\"Industrie\",array(\"R\"=>128,\"G\"=>128,\"B\"=>128,\"Alpha\"=>100)) ; \n $MyData->setPalette(\"Construction\",array(\"R\"=>204,\"G\"=>102,\"B\"=>0,\"Alpha\"=>100)) ;\n $MyData->setPalette(\"Agriculture\",array(\"R\"=>0,\"G\"=>153,\"B\"=>0,\"Alpha\"=>100)) ;\n\n\n $myPicture = new pImage(700,230,$MyData);\n $Settings = array(\"R\"=>194, \"G\"=>92, \"B\"=>4, \"Dash\"=>1, \"DashR\"=>204, \"DashG\"=>102, \"DashB\"=>14);\n $myPicture->drawFilledRectangle(0,0,700,390,$Settings);\n /* Create the pChart object */\n $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array(\"StartR\"=>240,\"StartG\"=>240,\"StartB\"=>240,\"EndR\"=>180,\"EndG\"=>180,\"EndB\"=>180,\"Alpha\"=>100));\n $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array(\"StartR\"=>240,\"StartG\"=>240,\"StartB\"=>240,\"EndR\"=>180,\"EndG\"=>180,\"EndB\"=>180,\"Alpha\"=>20));\n /* Set the default font properties */\n $myPicture->setFontProperties(array(\"FontName\"=>\"../app/includes/pChart/fonts/pf_arma_five.ttf\",\"FontSize\"=>6));\n /* Draw the scale and the chart */\n $myPicture->setGraphArea(60,20,680,190);\n $myPicture->drawScale(array(\"DrawSubTicks\"=>TRUE,\"Mode\"=>SCALE_MODE_ADDALL_START0));\n $myPicture->setShadow(FALSE);\n \n\n $myPicture->drawStackedBarChart(array(\"DisplayPos\"=>LABEL_POS_INSIDE,\"DisplayValues\"=>false ,\"Rounded\"=>TRUE,\"Surrounding\"=>30));\n /* Write the chart legend */\n $myPicture->drawLegend(380,210,array(\"Style\"=>LEGEND_NOBORDER,\"Mode\"=>LEGEND_HORIZONTAL));\n /* Render the picture (choose the best way) */\n $myPicture->Render(\"assets/images/barLevelChart1.png\");\n }", "function draw_ordine($id_acquisto, $data_acquisto, $indirizzo_spedizione, $indirizzo_fatturazione, $numero_carta, $connessione)\n {\n //Prendo gli ultimi 4 numeri del numero della carta.\n if(!($numero_carta == \"Contrassegno\"))\n $numero_carta = \"**** **** **** \" . substr($numero_carta, 15);\n\n //Seleziono il totale dei prodotti acqustitati per stamparli nell'header.\n $query = \"SELECT SUM(prezzo_acquisto*quantita) AS totale FROM Prodotto, AcquistoSingolo WHERE id_acquisto=$id_acquisto AND prodotto.id_prodotto = acquistosingolo.id_prodotto;\";\n\n //Invio la query al db\n $result_set = mysqli_query($connessione, $query);\n\n //Controllo se non ci sono errori nella query\n if($result_set == false)\n {\n die(mysqli_error($connessione));\n }\n\n //Controllo se ci sono righe nel risultato\n if(mysqli_num_rows($result_set) > 0)\n {\n //Faccio il fetch dell'array associativo\n $row = mysqli_fetch_assoc($result_set);\n $totale = $row['totale'];\n }\n else\n {\n //In caso di errore il prezzo sarà -1.\n $totale = -1;\n }\n\n echo \"<div class='panel panel-default'>\";\n echo \" <div class='panel-heading'>\"; //Info sull'ordine complessivo\n echo \" <div class='row text-center'>\";\n echo \" <div class='col-md-2 col-xs-12'>\";\n echo \" <strong>Ordine effettuato:</strong>\";\n echo \" <br>\";\n echo \" <p>$data_acquisto</p>\";\n echo \" </div>\";\n echo \" <div class='col-md-3 col-xs-12'>\";\n echo \" <strong>Indirizzo spedizione:</strong>\";\n echo \" <br>\";\n echo \" <p>$indirizzo_spedizione</p>\";\n echo \" </div>\";\n echo \" <div class='col-md-3 col-xs-12'>\";\n echo \" <strong>Indirizzo Fatturazione:</strong>\";\n echo \" <br>\";\n echo \" <p>$indirizzo_fatturazione</p>\";\n echo \" </div>\";\n echo \" <div class='col-md-1 col-xs-12'>\";\n echo \" <strong>Totale:</strong>\";\n echo \" <br>\";\n echo \" <p>€$totale</p>\";\n echo \" </div>\";\n echo \" <div class='col-md-2 col-xs-12'>\";\n echo \" <strong>Pagamento:</strong>\";\n echo \" <p>$numero_carta</p>\";\n echo \" </div>\";\n echo \" <div class='col-md-1 col-xs-12'>\";\n echo \" <strong>ID Ordine:</strong>\";\n echo \" <br>\";\n echo \" <p>#$id_acquisto</p>\";\n echo \" </div>\";\n echo \" </div>\";\n echo \" </div>\";\n echo \" <div class='panel-body'>\";//<!-- QUI DENTRO VANNO I SINGOLI ORDINI -->\n echo \" <div class='col-sm-3 col-xs-12 pull-right text-center'>\";\n echo \" <h4>Stato consegna: In transito</h4>\";\n echo \" <a href='fattura.php?acquisto=$id_acquisto' target='_blank'><button class='btn btn-warning'>Visualizza la fattura</button></a>\";\n echo \" </div>\";\n\n //Seleziono tutte le informazioni di ogni acquisto singolo fatto dall'utente loggato\n $query = \"SELECT prodotto.id_prodotto AS id_prodotto, prezzo_acquisto, quantita, foto, nome_prodotto FROM Prodotto, AcquistoSingolo WHERE id_acquisto=$id_acquisto AND prodotto.id_prodotto = acquistosingolo.id_prodotto;\";\n\n //Invio la query al db\n $result_set = mysqli_query($connessione, $query);\n\n //Controllo se non ci sono errori nella query\n if($result_set == false)\n {\n die(mysqli_error($connessione));\n }\n\n //Controllo se ci sono righe nel risultato\n if(mysqli_num_rows($result_set) > 0)\n {\n //Faccio il fetch dell'array associativo\n while($row = mysqli_fetch_assoc($result_set))\n {\n //Prendo i dati dei singoli ordini\n $id_prodotto = $row['id_prodotto'];\n $nome_prodotto = $row['nome_prodotto'];\n $prezzo = $row['prezzo_acquisto'];\n $foto = $row['foto'];\n $quantita = $row['quantita'];\n\n //Stampo il singolo ordine\n draw_singolo_ordine($id_prodotto, $nome_prodotto, $prezzo, $foto, $quantita);\n }\n }\n\n echo \" </div>\";\n echo \"</div>\";\n }", "function get_price_object() {\r\n\t\t$price_obj = array (\r\n\t\t\t\t\"Currency\" => false,\r\n\t\t\t\t\"TotalDisplayFare\" => 0,\r\n\t\t\t\t\"PriceBreakup\" => array (\r\n\t\t\t\t\t\t'BasicFare' => 0,\r\n\t\t\t\t\t\t'Tax' => 0,\r\n\t\t\t\t\t\t'AgentCommission' => 0,\r\n\t\t\t\t\t\t'AgentTdsOnCommision' => 0\r\n\t\t\t\t) \r\n\t\t);\r\n\t\treturn $price_obj;\r\n\t}", "public function afficheToi()\r\n {\r\n\r\n echo ($this->x .'-'.$this->y);\r\n }", "function generateDetailChart($chartType,$result,$criteria,$chart_path)\r\n\t{\r\n \r\n\tif ($chartType==\"gw_load\") {\r\n\t\t\t\t\r\n\t\t\t\t$_SESSION[\"gw_criteria\"] = $criteria;\r\n\t\t\t\t$_SESSION[\"gwLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"gw_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name =$_SERVER[\"PHP_AUTH_USER\"]. \"gw_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$gw_id = $_SESSION[\"gw_id\"];\r\n\t\t\t\t$title = \"Gateway Load (\".$gw_id.\")\";\r\n\t\t\t\t\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t//\tmysql_data_seek($result ,0);\r\n\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t \t\t \t\t$mon = date(\"M\", strtotime($row[\"login\"])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[\"login\"]));\r\n\r\n\t\t\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \r\n\t\t\t\t\t\t \t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \t\t\t\r\n\r\n }\r\n\t \t \r\n/***************************************************************Generate Service Load Graph *********************************************************************************/\r\n\r\n\t\tif ($chartType==\"service_load\") {\r\n\t\t\r\n\t\t\t $_SESSION[\"sv_criteria\"] = $criteria;\r\n\t\t\t\t\r\n\t\t \t\t$_SESSION[\"svLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"sv_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name = $_SERVER[\"PHP_AUTH_USER\"].\"sv_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$sv_id = $_SESSION[\"sv_id\"];\r\n\t\t\t\t$title = \"Service Load (\".$sv_id.\")\";\r\n\t\t\t\t\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t\t$groupby = $_SESSION[\"gw_group\"];\r\n\t\t\t\t\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t \t\t \t\t\r\n\t\t\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t if ($groupby ==\"ByMonth\") {\r\n\t\t\t\t\t\t $mon = date(\"M\", strtotime($row[login])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[login]));\r\n\t\t\t\t\t\t\t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \r\n\t\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$DataSet->SetSerieName($row[\"gw_name\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \r\n\t\t\t\t\t\t\r\n\t\t\t}\r\n\t \t \r\n/********************************************************************Generate Top Ten users Graph *************************************************************************/\r\n \r\n\t\tif ($chartType==\"top_ten_users\") {\r\n\t\t\r\n\t\t\t $_SESSION[\"tt_users_criteria\"] = $criteria;\r\n\r\n\t\t\t$_SESSION[\"userLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"user_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name = $_SERVER[\"PHP_AUTH_USER\"].\"user_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$user_id = $_SESSION[\"user_id\"];\r\n\t\t\t\t$title = \"User Load (\".$user_id.\")\";\r\n\t\t\t\t\r\n\t\t\t\t$groupby = $_SESSION[\"gw_group\"];\r\n\t\t\t\t\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t \t\t \t\r\n\t\t\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t\t if ($groupby ==\"ByMonth\") {\r\n\t\t\t\t\t\t $mon = date(\"M\", strtotime($row[login])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[login]));\r\n\t\t\t\t\t\t\t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \r\n\t\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$DataSet->SetSerieName($row[\"gw_name\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t \t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \t\t\t\r\n\t\t\t}\r\n\r\n/**************************************************************Generate Direction Load Graph *******************************************************************************/\r\n\r\n\t\tif ($chartType==\"direction_load\") {\r\n\t\t \r\n\t\t \t$_SESSION[\"direction_criteria\"] = $criteria;\r\n\r\n\t\t\t $_SESSION[\"dirLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"direction_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name = $_SERVER[\"PHP_AUTH_USER\"].\"direction_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$dir_id = $_SESSION[\"dir_id\"];\r\n\t\t\t\t$title = \"Direction Load (\".$dir_id.\")\";\r\n\t\t\t\t$groupby = $_SESSION[\"gw_group\"];\r\n\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t \t\t \t\tif ($groupby==\"ByMonth\") {\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t \t$mon = date(\"M\", strtotime($row[login])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[login]));\r\n\t\t\t\t\t\t\t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \r\n\t\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$DataSet->SetSerieName($row[\"gw_name\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \r\n\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\r\n/*********************************************************************Generate Destination host Load Graph *****************************************************************/\r\n\r\n\t\t\tif ($chartType==\"destination_host_load\") {\r\n\t\t\t\r\n\t\t\t\t$_SESSION[\"destination_host_criteria\"] = $criteria;\r\n\r\n\t\t\t \t$_SESSION[\"destLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"destination_host_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name = $_SERVER[\"PHP_AUTH_USER\"].\"destination_host_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$dest_id = $_SESSION[\"dest_id\"];\r\n\t\t\t\t$title = \"Destination Host Load (\".$dest_id.\")\";\r\n\t\t\t\t$groupby = $_SESSION[\"gw_group\"];\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t \t\t \t\t\r\n\r\n\t\t\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t\tif ($groupby==\"ByMonth\") {\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t \t$mon = date(\"M\", strtotime($row[login])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[login]));\r\n\t\t\t\t\t\t\t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \r\n\t\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$DataSet->SetSerieName($row[\"gw_name\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \r\n\t\t\t\r\n\r\n\t\t\t}\r\n\r\n\r\n\r\n\t}", "public function getVectorLabelProductos()\n {\n $vectorProductosLabel = array(\n \"ID\",\n \"Active\",\n \"Name\",\n \"Categories\",\n \"Price\",\n \"Tax\",\n \"Wholesale price\",\n \"OnSale\",\n \"Discount\",\n \"DiscountPercent\",\n \"DiscountFrom\",\n \"DiscountTo\",\n \"Reference\",\n \"SupplierReference\",\n \"Supplier\",\n \"Manufacturer\",\n \"Ean13\",\n \"Upc\",\n \"Ecotax\",\n \"Width\",\n \"Height\",\n \"Depth\",\n \"Weight\",\n \"Quantity\",\n \"MinimalQuantity\",\n \"Visibility\",\n \"AdditionalShippingCost\",\n \"Unity\",\n \"UnityPrice\",\n \"ShortDescription\",\n \"Description\",\n \"Tags\",\n \"Metatitle\",\n \"MetaKeywords\",\n \"MetaDescription\",\n \"UrlRewritten\",\n \"TextStock\",\n \"TextBackorder\",\n \"Avaiable\",\n \"ProductAvaiableDate\",\n \"ProductCreationDate\",\n \"ShowPrice\",\n \"ImageUrls\",\n \"DeleteExistingImages\",\n \"Feature\",\n \"AvaiableOnline\",\n \"Condition\",\n \"Customizable\",\n \"Uploadable\",\n \"TextFields\",\n \"OutStock\",\n \"IdNameShop\",\n \"AdvancedStockManagement\",\n \"DependsOnStock\",\n \"Warehouse\"\n );\n return $vectorProductosLabel;\n }", "public function getCatalogPosition()\n {\n return Mage::getStoreConfig('splitprice/split_price_presentation/show_catalog_position');\n }", "abstract public function getPrice();", "public function create() {\n\t\tupdate_option( 'woocommerce_calc_taxes', 'yes' );\n\t\tupdate_option( 'woocommerce_prices_include_tax', 'yes' );\n\n\t\t// Create tax rates.\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '25' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '12' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '6' );\n\t\t$this->product = ( new Krokedil_Simple_Product() )->create();\n\t}", "function builder_price() {\n\n $this->Item->recursive = 0;\n\n if( !isset($this->params['named']['limit']) ) {\n $this->paginate['limit'] = REPORT_LIMIT;\n $this->paginate['maxLimit'] = REPORT_LIMIT;\n }\n elseif( isset($this->params['named']['limit']) && $this->params['named']['limit'] != 'All' ) {\n $this->paginate['limit'] = isset($this->params['named']['limit']) ? $this->params['named']['limit'] : REPORT_LIMIT;\n $this->paginate['maxLimit'] = isset($this->params['named']['limit']) ? $this->params['named']['limit'] : REPORT_LIMIT;\n }\n else {\n $this->paginate['limit'] = 0;\n $this->paginate['maxLimit'] = 0;\n }\n $this->Prg->commonProcess();\n $this->paginate['conditions'] = $this->Item->parseCriteria($this->passedArgs);\n $this->paginate['conditions']['Item.base_item']['base_item'] = 0;\n\n $items = $this->paginate();\n $paginate = true;\n $legend = \"Items\";\n\n $this->set(compact('items', 'paginate', 'legend'));\n }", "function show_Price($prod_arr,$price_class_arr,$pagetype ='other_3',$from_combo=false,$speclretn=0)\n\t{ \n\t\tglobal $ecom_siteid,$db,$sitesel_curr,$default_crr,$PriceSettings_arr,$default_Currency_arr,$Settings_arr,$Captions_arr,$ecom_tax_total_arr,$current_currency_details;\n\t\t$show_only_on_login \t= $Settings_arr['hide_price_login'];\n\t\t$tax_before_disc\t\t= $Settings_arr['saletax_before_discount'];\n\t\t// Get the customer id from the session\n\t\t$cust_id \t\t\t\t= get_session_var(\"ecom_login_customer\");\n\t\t$discount_price_only \t= 0;\n\t\t$allow_direct_custdisc_in_group = $allow_direct_proddisc_in_group = 'Y';\n $discount_calculated = false;\n\t\t// Check whether price should be hidden when not logged in\n\t\tif ($show_only_on_login == 1)\n\t\t{\n\t\t\tif (!$cust_id)\n\t\t\t\treturn;\t\n\t\t}\n\t\t$applicable_disc =\t$applicable_direct_disc = $applicable_group_disc = 0;\n\t\t$prod_arr['cust_allow_direct_product_disc'] = 'Y'; // by default product direct discount will be allowed.\n\t\t$cust_disc_group_exists = false;\n\t\t// Start of section to decide whether to show the discount set in the products table or based on the discount set for logged in customer / customer discount\n\t\tif (get_session_var('ecom_cust_group_exists')==1 and $cust_id)\n\t\t{\n\t\t\t$group_prod_arr\t\t\t\t= get_session_var('ecom_cust_group_prod_array');\n\t\t\t$group_arr\t\t\t\t= get_session_var('ecom_cust_group_array');\n\t\t\t$group_allow_direct_arr\t\t\t= get_session_var('ecom_cust_group_allow_direct_array');// allow direct customer discount for group\n\t\t\t$group_allow_direct_product_arr\t\t= get_session_var('ecom_cust_group_allow_direct_product_array'); // allow direct product discount for group\n\t\t\t\n\t\t\t// Check whether current product is mapped with any of the customer discount groups assigned to current customer\n\t\t\tif(count($group_prod_arr))\n\t\t\t{\n\t\t\t\t$pid = $prod_arr['product_id'];\n\t\t\t\tif(array_key_exists($pid,$group_prod_arr))\n\t\t\t\t{\n\t\t\t\t\t$applicable_group_disc \t\t\t\t= $group_prod_arr[$pid];\n\t\t\t\t\t$applicable_group = $group_arr[$pid];\n\t\t\t\t\t$prod_arr['cust_disc_type'] \t\t\t= 'custgroup';\n\t\t\t\t\t$prod_arr['cust_disc_grp_id'] \t\t\t= $applicable_group;\n\t\t\t\t\t$prod_arr['cust_disc_percent'] \t\t\t= $applicable_group_disc;\n\t\t\t\t\t$prod_arr['cust_allow_direct_disc']\t\t= $group_allow_direct_arr[$pid];\n\t\t\t\t\t$prod_arr['cust_allow_direct_product_disc']\t= $group_allow_direct_product_arr[$pid];\n\t\t\t\t\n\t\t\t\t\t$cust_disc_type\t\t\t\t\t= 'GRP';\n\t\t\t\t\t$cust_disc_group_exists\t\t\t\t= true;\n\t\t\t\t}\n\t\t\t\t/*else\n\t\t\t\t{\n\t\t\t\t\t// Check whether any discount group exists for current customer with no product set\n\t\t\t\t\tif($group_prod_arr[0])\n\t\t\t\t\t{\n\t\t\t\t\t\t$applicable_disc \t\t\t\t= $group_prod_arr[0];\n\t\t\t\t\t\t$applicable_group \t\t\t\t= $group_arr[0];\n\t\t\t\t\t\t$prod_arr['cust_disc_type'] \t= 'custgroup';\n\t\t\t\t\t\t$prod_arr['cust_disc_grp_id'] \t= $applicable_group;\n\t\t\t\t\t\t$prod_arr['cust_disc_percent'] \t= $applicable_disc;\n\t\t\t\t\t\t$cust_disc_type\t\t\t\t\t= 'GRP';\n\t\t\t\t\t}\n\t\t\t\t}*/\n\t\t\t}\t\t\t\n\t\t}\n\t\t/*if($applicable_disc==0)\n\t\t{*/\n\t\t\t// Check whether any direct discount is set for current customer\n\t\tif(get_session_var('ecom_cust_direct_exists')== 1 and $cust_id)\n\t\t{\n\t\t\t$applicable_direct_disc\t\t= get_session_var('ecom_cust_direct_disc');\n\t\t\t$cust_disc_type\t\t\t= 'CUST';\n\t\t\t$prod_arr['cust_disc_type'] \t= 'customer';\n\t\t\t//$prod_arr['cust_disc_grp_id'] = 0;\n\t\t\t$prod_arr['cust_disc_percent'] \t= $applicable_direct_disc;\n\t\t}\n\t\t/*}*/\n\t// End of section\n\t\tif ($cust_disc_group_exists)\n\t\t{\n\t\t\tif($prod_arr['cust_allow_direct_disc']=='N')\n\t\t\t{\n\t\t\t\t$applicable_disc\t\t\t= $applicable_group_disc;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$applicable_disc\t\t\t= $applicable_direct_disc + $applicable_group_disc;\n\t\t\t\tif($applicable_disc>100) // in case if total of discount % is > 100 then reset it to 100\n\t\t\t\t\t$applicable_disc = 100;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\t$applicable_disc\t\t\t= $applicable_direct_disc;\t\n\t\t//Get the rate for the current currency\n\t\t$curr_rate = $current_currency_details['curr_rate'] + $current_currency_details['curr_margin'];\n\t\t$curr_sign = $current_currency_details['curr_sign_char'];\n\t\t\n\t\t// Assigning the required values from array to variables and applying conversions if required\n\t\t\n\t\tif($prod_arr['check_comb_price'] == 'YES' and $prod_arr['combination_id']>0) // case coming \n\t\t{\n\t\t\tif($prod_arr['product_variablecomboprice_allowed']=='Y')\n\t\t\t{\n\t\t\t\t// Get the stock of variable combination form the variable combination table\n\t\t\t\t$sql_comb = \"SELECT web_stock,comb_price \n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\tproduct_variable_combination_stock \n\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\tproducts_product_id =\".$prod_arr['product_id'].\" \n\t\t\t\t\t\t\t\t\tAND comb_id = \".$prod_arr['combination_id'].\" \n\t\t\t\t\t\t\t\tLIMIT \n\t\t\t\t\t\t\t\t\t1\";\n\t\t\t\t$ret_comb = $db->query($sql_comb);\n\t\t\t\tif ($db->num_rows($ret_comb))// case if record found in combination stock table\n\t\t\t\t{\n\t\t\t\t\t$row_comb \t= $db->fetch_array($ret_comb);\n\t\t\t\t\t$webprice \t\t= $row_comb['comb_price']*$curr_rate; \n\t\t\t\t}\n\t\t\t\telse // case if record not found in combination table\n\t\t\t\t\t$webprice = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t\t$webprice = $prod_arr['product_webprice']*$curr_rate; \n\t\t}\n\t\telse\n\t\t\t$webprice = $prod_arr['product_webprice']*$curr_rate; \n\t\t\n\t\t$disc_asval\t\t= $prod_arr['product_discount_enteredasval'];\n\t\t$discount\t\t= 0;\n\t\t$override_yousave\t= false;\n\t\tif($prod_arr['cust_allow_direct_product_disc']=='Y')\n\t\t{\n\t\t\tif ($disc_asval==1)\n\t\t\t{\n\t\t\t\t$discount\t= $prod_arr['product_discount']*$curr_rate; \n\t\t\t\t$override_yousave = true;\n\t\t\t}\t\n\t\t\telse if($disc_asval==2) // For Exact Discount Price\n\t\t\t{\n\t\t\t\t$discount\t= $prod_arr['product_discount']*$curr_rate; \t\n\t\t\t\t$override_yousave = true;\n\t\t\t}\n\t\t\telse\n {\n\t\t\t\t$discount\t= $prod_arr['product_discount'];\n if($applicable_disc>0) // if normal product discount is there and also customer direct discount or customer group exists, then You save option will be displayed instead of % off.\n $override_yousave = true;\n \n } \n\t\t}\t\n\t\t$apply_tax\t\t= $prod_arr['product_applytax'];\n\t\t$tax_val\t\t= 0;\n\t\tif ($apply_tax=='Y')\n\t\t{\n\t\t\t$tax_arr \t\t= $ecom_tax_total_arr;\n\t\t\t$tax_val\t\t= $tax_arr['tax_val'];\n\t\t\tif (is_array($tax_arr['tax_name']))\n\t\t\t{\n\t\t\t\tif (count($tax_arr['tax_name']))\n\t\t\t\t{\n\t\t\t\t\tforeach ($tax_arr['tax_name'] as $k=>$v)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($tax_name)\n\t\t\t\t\t\t\t$tax_name .= $Captions_arr['PRICE_DISPLAY']['TAX_PLUS'];\n\t\t\t\t\t\t$tax_name .= $v;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\t\n\t\t}\n\t\t$br \t= '0';\n\t\t\n\t\tswitch($pagetype)\n\t\t{\n\t\t\tcase 'shelfcenter_1':\n\t\t\t\tif($PriceSettings_arr['price_middleshelf_1_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'shelfcenter_3':\n\t\t\t\tif($PriceSettings_arr['price_middleshelf_3_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'compshelf':\n\t\t\t\tif($PriceSettings_arr['price_compshelf_reqbreak']==1) \n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'search_1':\n\t\t\t\tif($PriceSettings_arr['price_searchresult_1_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'search_3':\n\t\t\t\tif($PriceSettings_arr['price_searchresult_3_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'prod_detail':\n\t\t\t\tif($PriceSettings_arr['price_proddetails_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'cat_detail_1':\n\t\t\t\tif($PriceSettings_arr['price_categorydetails_1_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'cat_detail_3':\n\t\t\t\tif($PriceSettings_arr['price_categorydetails_3_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'combo_1':\n\t\t\t\tif($PriceSettings_arr['price_combodeals_1_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'combo_3':\n\t\t\t\tif($PriceSettings_arr['price_combodeals_3_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'linkprod_1':\n\t\t\t\tif($PriceSettings_arr['price_linkedprod_1_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'linkprod_3':\n\t\t\t\tif($PriceSettings_arr['price_linkedprod_3_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'bestseller_1':\n\t\t\t\tif($PriceSettings_arr['price_best_1_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'bestseller_3':\n\t\t\t\tif($PriceSettings_arr['price_best_3_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'shopbrand_1':\n\t\t\t\tif($PriceSettings_arr['price_shopbrand_1_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'shopbrand_3':\n\t\t\t\tif($PriceSettings_arr['price_shopbrand_3_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'featured':\n\t\t\t\tif($PriceSettings_arr['price_featured_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'other_1':\n\t\t\t\tif($PriceSettings_arr['price_other_1_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t\tcase 'other_3':\n\t\t\t\tif($PriceSettings_arr['price_other_3_reqbreak']==1)\n\t\t\t\t{\n\t\t\t\t\t$br = \"1\";\t\t\n\t\t\t\t}\t\n\t\t\tbreak;\n\t\t};\n\t\tif($webprice)// Do the following only in case if the from price is set\n\t\t{\n\t\t\t// Setting the prefix and suffix to respective variables\n\t\t\tif($prod_arr['product_variablesaddonprice_exists']=='Y' or $prod_arr['product_variablecomboprice_allowed']=='Y')\n\t\t\t{\n\t\t\t\t$normal_prefix \t= ($prod_arr['price_fromprefix'])?$prod_arr['price_fromprefix']:$PriceSettings_arr['price_fromprefix'];\n\t\t\t\t$normal_suffix \t= ($prod_arr['price_fromsuffix'])?$prod_arr['price_fromsuffix']:$PriceSettings_arr['price_fromsuffix'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$normal_prefix \t= ($prod_arr['price_normalprefix'])?$prod_arr['price_normalprefix']:$PriceSettings_arr['price_normalprefix'];\n\t\t\t\t$normal_suffix \t= ($prod_arr['price_normalsuffix'])?$prod_arr['price_normalsuffix']:$PriceSettings_arr['price_normalsuffix'];\n\t\t\t}\n\t\t\t\n\t\t\t$discount_prefix\t\t= ($prod_arr['price_discountprefix'])?$prod_arr['price_discountprefix']:$PriceSettings_arr['price_discountprefix'];\t\n\t\t\t$discount_suffix\t\t= ($prod_arr['price_discountsuffix'])?$prod_arr['price_discountsuffix']:$PriceSettings_arr['price_discountsuffix'];\n\t\t\t\n\t\t\t$offer_prefix\t\t\t= ($prod_arr['price_specialofferprefix'])?$prod_arr['price_specialofferprefix']:$PriceSettings_arr['price_specialofferprefix'];\n\t\t\t$offer_suffix\t\t\t= ($prod_arr['price_specialoffersuffix'])?$prod_arr['price_specialoffersuffix']:$PriceSettings_arr['price_specialoffersuffix'];\n\t\t\t\n\t\t\t$yousave_prefix\t\t= ($prod_arr['price_yousaveprefix'])?$prod_arr['price_yousaveprefix']:$PriceSettings_arr['price_yousaveprefix'];\n\t\t\t$yousave_suffix\t\t= ($prod_arr['price_yousavesuffix'])?$prod_arr['price_yousavesuffix']:$PriceSettings_arr['price_yousavesuffix'];\n\t\t\t\n\t\t\t$normal_prefix \t\t= stripslashes($normal_prefix);\n\t\t\t$normal_suffix \t\t= stripslashes($normal_suffix);\n\t\t\t$discount_prefix\t= stripslashes($discount_prefix);\n\t\t\t$discount_suffix\t= stripslashes($discount_suffix);\n\t\t\t$offer_prefix\t\t= stripslashes($offer_prefix);\n\t\t\t$offer_suffix\t\t= stripslashes($offer_suffix);\n\t\t\t$yousave_prefix\t\t= stripslashes($yousave_prefix);\n\t\t\t$yousave_suffix\t\t= stripslashes($yousave_suffix);\n\t\t\t$tax_plus_suffix\t= $PriceSettings_arr['price_tax_plus'];\n\t\t\t$tax_inc_suffix\t\t= $PriceSettings_arr['price_tax_inc'];\n\t\t\t$tax_exc_suffix\t\t= $PriceSettings_arr['price_tax_exc'];\n\t\t\t\n\t\t\t$priceclean_arr\t\t= array();\n\t\t\t$priceclearvalonly_arr = array();\n\t\t\t// Decide how to display the price based on the value of price_displaytype\n\t\t\tswitch($PriceSettings_arr['price_displaytype'])\n\t\t\t{\n\t\t\t\tcase 'show_price_only': // show only price even if tax exists\n\t\t\t\t\t$price_arr['base_price'] \t\t= $normal_prefix.\" \".printcurr($webprice,$curr_sign).\" \".$normal_suffix;\n\t\t\t\t\t$priceclean_arr['base_price'] \t= printcurr($webprice,$curr_sign);\n\t\t\t\t\t$priceclearvalonly_arr['base_price'] = $webprice;\n\t\t\t\t\tif ($discount>0) // case if direct product discount is applicable\n\t\t\t\t\t{\n\t\t\t\t\t\t/*if($cust_disc_type!='') //case if customer logged in and also custdisc or cust group disc exists\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$disc_price \t\t\t\t\t\t= $webprice - ($webprice * $discount/100);\n\t\t\t\t\t\t\t$price_arr['disc_percent'] \t\t\t= $discount_prefix.\" \".remove_Trailing_zeros($discount).\"% \".$discount_suffix;\n\t\t\t\t\t\t\t$priceclean_arr['disc_percent'] \t= remove_Trailing_zeros($discount);\n\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_percent'] = remove_Trailing_zeros($discount);\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($disc_asval==1) // If discount is specified as value\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$disc_price = $webprice - $discount;\n\t\t\t\t\t\t\tif($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$more_disc\t= ($disc_price * $applicable_disc)/100;\n\t\t\t\t\t\t\t\t$disc_price = $disc_price - $more_disc;\n\t\t\t\t\t\t\t\t$discount\t+= $more_disc;\n\t\t\t\t\t\t\t}\t \n\t\t\t\t\t\t\tif ($disc_price<0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$price_arr['disc_val'] \t\t\t\t= 0;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val'] \t\t= 0;\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] \t= 0;\n\t\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$price_arr['disc_val'] \t\t= $discount_prefix.\" \".printcurr($discount,$curr_sign).\" \".$discount_suffix;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val'] = printcurr($discount,$curr_sign);\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] = $discount;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\telse if($disc_asval==2) \n\t\t\t\t\t\t{ // For Exact Discount Price \n\t\t\t\t\t\t\t//echo 'jj'.$disc_price\t= $prod_arr['product_discount'];// For Exact Discount Price\n\t\t\t\t\t\t\t$disc_price\t= $prod_arr['product_discount']*$curr_rate; \n\t\t\t\t\t\t\tif($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$more_disc\t= ($disc_price * $applicable_disc)/100;\n\t\t\t\t\t\t\t\t$disc_price = $disc_price - $more_disc;\n\t\t\t\t\t\t\t\t$discount\t= $webprice - $disc_price;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($disc_price<0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$price_arr['disc_val'] \t\t\t\t= 0;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val'] \t\t= 0;\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] \t= 0;\n\t\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$price_arr['disc_val'] \t\t\t\t= $discount_prefix.\" \".printcurr($discount,$curr_sign).\" \".$discount_suffix;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val'] \t\t= printcurr($discount,$curr_sign);\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] \t= $discount;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\telse // case if discount is given as percentage\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/*if($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$discount += $applicable_disc;\n\t\t\t\t\t\t\t\tif($discount>100)\n\t\t\t\t\t\t\t\t\t$discount = 100;\n\t\t\t\t\t\t\t} */\n\t\t\t\t\t\t\t$disc_price \t\t\t\t\t= $webprice - ($webprice * $discount/100);\n if($applicable_disc>0)\n {\n $disc_price = $disc_price - ($disc_price*$applicable_disc/100);\n //$disc\n }\n\t\t\t\t\t\t\t$price_arr['disc_percent'] \t\t = $discount_prefix.\" \".remove_Trailing_zeros($discount).\"% \".$discount_suffix;\n\t\t\t\t\t\t\t$priceclean_arr['disc_percent'] = remove_Trailing_zeros($discount);\n\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_percent'] = remove_Trailing_zeros($discount);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$price_arr['discounted_price'] \t\t\t\t\t= $offer_prefix.\" \".printcurr($disc_price,$curr_sign).\" \".$offer_suffix;\n\t\t\t\t\t\t$priceclean_arr['discounted_price'] \t\t\t= printcurr($disc_price,$curr_sign);\n\t\t\t\t\t\t$priceclearvalonly_arr['discounted_price'] \t\t= $disc_price;\n\t\t\t\t\t\tif ($PriceSettings_arr['price_show_yousave']==1 or $override_yousave==true)// Check whether you save caption is to be displayed\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$price_arr['disc_percent'] \t\t= '';\n\t\t\t\t\t\t\t$price_arr['priceclean_arr'] \t= '';\n\t\t\t\t\t\t\t$price_arr['priceclearvalonly_arr'] = '';\n\t\t\t\t\t\t\tif ($disc_price) // check whether disc_price exists\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$yousave_price \t\t\t\t\t\t= $webprice - $disc_price;\t\n\t\t\t\t\t\t\t\t$price_arr['yousave_price'] \t\t= $yousave_prefix.\" \".printcurr($yousave_price,$curr_sign).\" \".$yousave_suffix;\n\t\t\t\t\t\t\t\t$priceclean_arr['yousave_price'] \t= printcurr($yousave_price,$curr_sign);\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['yousave_price'] = $yousave_price;\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\telse // case if direct product discount is not there\n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$discount\t= ($webprice * $applicable_disc)/100;\n\t\t\t\t\t\t\t$disc_price = $webprice - $discount;\n\t\t\t\t\t\t\t$discount\t= $applicable_disc; \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$price_arr['disc_percent'] \t\t\t\t\t\t= $discount_prefix.\" \".remove_Trailing_zeros($discount).\"% \".$discount_suffix;\n\t\t\t\t\t\t\t$priceclean_arr['disc_percent'] \t\t\t\t= remove_Trailing_zeros($discount);\n\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_percent'] \t\t\t= remove_Trailing_zeros($discount);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$price_arr['discounted_price'] \t\t\t\t\t= $offer_prefix.\" \".printcurr($disc_price,$curr_sign).\" \".$offer_suffix;\n\t\t\t\t\t\t\t$priceclean_arr['discounted_price'] \t\t\t= printcurr($disc_price,$curr_sign);\n\t\t\t\t\t\t\t$priceclearvalonly_arr['discounted_price'] \t\t= $disc_price;\n\t\t\t\t\t\t\tif ($PriceSettings_arr['price_show_yousave']==1 or $override_yousave==true)// Check whether you save caption is to be displayed\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$price_arr['disc_percent'] \t\t= '';\n\t\t\t\t\t\t\t\t$price_arr['priceclean_arr'] \t= '';\n\t\t\t\t\t\t\t\t$price_arr['priceclearvalonly_arr'] = '';\n\t\t\t\t\t\t\t\tif ($disc_price) // check whether disc_price exists\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$yousave_price \t\t\t\t\t\t\t= $webprice - $disc_price;\t\n\t\t\t\t\t\t\t\t\t$price_arr['yousave_price'] \t\t\t= $yousave_prefix.\" \".printcurr($yousave_price,$curr_sign).\" \".$yousave_suffix;\n\t\t\t\t\t\t\t\t\t$priceclean_arr['yousave_price'] \t\t= printcurr($yousave_price,$curr_sign);\n\t\t\t\t\t\t\t\t\t$priceclearvalonly_arr['yousave_price'] = $yousave_price;\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}\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\telse // case if no type of discount is applicable\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$price_arr['discounted_price'] \t= '';\n\t\t\t\t\t\t\t$price_arr['yousave_price']\t\t= '';\n\t\t\t\t\t\t\t$priceclean_arr['discounted_price'] \t= '';\n\t\t\t\t\t\t\t$priceclean_arr['yousave_price']\t\t= '';\n\t\t\t\t\t\t\t$priceclearvalonly_arr['discounted_price'] = '';\n\t\t\t\t\t\t\t$priceclearvalonly_arr['yousave_price'] = '';\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\t\n\t\t\t\tbreak;\n\t\t\t\tcase 'show_price_plus_tax': // show price + Tax\n\t\t\t\t\tif ($tax_val>0)\n\t\t\t\t\t\t$tax_str = ' '.$tax_plus_suffix;//$Captions_arr['PRICE_DISPLAY']['TAX_PLUSTAX'];\n\t\t\t\t\t$price_arr['base_price'] \t\t= $normal_prefix.\" \".printcurr($webprice,$curr_sign).\" \".$normal_suffix.\" \".$tax_str;\n\t\t\t\t\t$priceclean_arr['base_price'] \t= printcurr($webprice,$curr_sign).\" \".$tax_str;\n\t\t\t\t\t$priceclearvalonly_arr['base_price'] \t= $webprice;\n\t\t\t\t\tif ($discount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($disc_asval==1) // If discount is specified as value\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$disc_price = $webprice - $discount;\n\t\t\t\t\t\t\tif($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$more_disc\t= ($disc_price * $applicable_disc)/100;\n\t\t\t\t\t\t\t\t$disc_price = $disc_price - $more_disc;\n\t\t\t\t\t\t\t\t$discount\t+= $more_disc;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\tif ($disc_price<0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$price_arr['disc_val'] \t\t\t\t= 0;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val'] \t\t= 0;\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] \t= 0;\n\t\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$price_arr['disc_val'] \t\t\t\t\t= $discount_prefix.\" \".printcurr($discount,$curr_sign).\" \".$discount_suffix;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val'] \t\t\t\t= printcurr($discount,$curr_sign);\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] \t= $discount;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\telse if($disc_asval==2) // For Exact Discount Price \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$disc_price\t= $prod_arr['product_discount']*$curr_rate; \n\t\t\t\t\t\t\tif($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$more_disc\t= ($disc_price * $applicable_disc)/100;\n\t\t\t\t\t\t\t\t$disc_price = $disc_price - $more_disc;\n\t\t\t\t\t\t\t}\n $discount = $webprice - $disc_price;\n\t\t\t\t\t\t\tif ($disc_price<0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$price_arr['disc_val'] \t= 0;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val'] \t= 0;\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] \t= 0;\n\t\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$price_arr['disc_val'] \t\t\t= $discount_prefix.\" \".printcurr($discount,$curr_sign).\" \".$discount_suffix;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val'] \t= printcurr($discount,$curr_sign);\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] \t= $discount;\n\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t}\t\n\t\t\t\t\t else // case if discount is given as percentage\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/*if($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$discount += $applicable_disc;\n\t\t\t\t\t\t\t\tif($discount>100)\n\t\t\t\t\t\t\t\t\t$discount = 100;\n\t\t\t\t\t\t\t} */\n\t\t\t\t\t\t\t$disc_price \t\t\t\t\t\t= $webprice - ($webprice * $discount/100);\n if($applicable_disc>0)\n {\n $disc_price = $disc_price - ($disc_price*$applicable_disc/100);\n }\n\t\t\t\t\t\t\t$price_arr['disc_percent'] \t\t\t= $discount_prefix.\" \".remove_Trailing_zeros($discount).\"% \".$discount_suffix;\n\t\t\t\t\t\t\t$priceclean_arr['disc_percent'] \t= remove_Trailing_zeros($discount);\n\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_percent'] \t= $discount;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$price_arr['discounted_price'] \t\t\t\t= $offer_prefix.\" \".printcurr($disc_price,$curr_sign).\" \".$offer_suffix.\" \".$tax_str;\n\t\t\t\t\t\t$priceclean_arr['discounted_price'] \t\t= printcurr($disc_price,$curr_sign).\" \".$tax_str;\n\t\t\t\t\t\t$priceclearvalonly_arr['discounted_price'] \t\t= $disc_price;\n\t\t\t\t\t\tif ($PriceSettings_arr['price_show_yousave']==1 or $override_yousave==true)// Check whether you save caption is to be displayed\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$price_arr['disc_percent'] \t= '';\n\t\t\t\t\t\t\tif ($disc_price) // check whether disc_price exists\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$yousave_price \t\t\t\t\t\t= $webprice - $disc_price;\t\n\t\t\t\t\t\t\t\t$price_arr['yousave_price'] \t\t= $yousave_prefix.\" \".printcurr($yousave_price,$curr_sign).\" \".$yousave_suffix;\n\t\t\t\t\t\t\t\t$priceclean_arr['yousave_price'] \t= printcurr($yousave_price,$curr_sign);\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['yousave_price'] \t\t= $yousave_price;\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\telse // case if direct product discount is not there\n\t\t\t\t\t{\n\t\t\t\t\t\tif($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$discount\t= ($webprice * $applicable_disc/100);\n\t\t\t\t\t\t\t$disc_price = $webprice - $discount;\n\t\t\t\t\t\t\t$discount\t= $applicable_disc;\n\t\t\t\t\t\t\t$price_arr['disc_percent'] \t\t\t\t\t= $discount_prefix.\" \".remove_Trailing_zeros($discount).\"% \".$discount_suffix;\n\t\t\t\t\t\t\t$priceclean_arr['disc_percent'] \t\t\t= remove_Trailing_zeros($discount);\n\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_percent'] \t\t= $discount;\n\t\t\t\t\t\t\t$price_arr['discounted_price'] \t\t\t\t= $offer_prefix.\" \".printcurr($disc_price,$curr_sign).\" \".$offer_suffix.\" \".$tax_str;\n\t\t\t\t\t\t\t$priceclean_arr['discounted_price'] \t\t= printcurr($disc_price,$curr_sign).\" \".$tax_str;\n\t\t\t\t\t\t\t$priceclearvalonly_arr['discounted_price'] \t= $disc_price;\n\t\t\t\t\t\t\tif ($PriceSettings_arr['price_show_yousave']==1)// Check whether you save caption is to be displayed\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$price_arr['disc_percent'] \t= '';\n\t\t\t\t\t\t\t\tif ($disc_price) // check whether disc_price exists\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$yousave_price \t\t\t\t\t\t= $webprice - $disc_price;\t\n\t\t\t\t\t\t\t\t\t$price_arr['yousave_price'] \t\t= $yousave_prefix.\" \".printcurr($yousave_price,$curr_sign).\" \".$yousave_suffix;\n\t\t\t\t\t\t\t\t\t$priceclean_arr['yousave_price'] \t= printcurr($yousave_price,$curr_sign);\n\t\t\t\t\t\t\t\t\t$priceclearvalonly_arr['yousave_price'] \t\t= $yousave_price;\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}\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$price_arr['discounted_price'] \t\t\t\t\t= '';\n\t\t\t\t\t\t\t$price_arr['yousave_price']\t\t\t\t\t\t= '';\n\t\t\t\t\t\t\t$priceclean_arr['discounted_price'] \t\t\t= '';\n\t\t\t\t\t\t\t$priceclean_arr['yousave_price']\t\t\t\t= '';\n\t\t\t\t\t\t\t$priceclearvalonly_arr['discounted_price'] \t\t= '';\n\t\t\t\t\t\t\t$priceclearvalonly_arr['yousave_price'] \t\t= '';\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase 'show_price_inc_tax': // Show price including tax\n\t\t\t\t\tif ($tax_val>0 && $Captions_arr['PRICE_DISPLAY']['TAX_INC']!='')\n\t\t\t\t\t{\n\t\t\t\t\t\t$tax_str = ' '.$tax_inc_suffix;//$Captions_arr['PRICE_DISPLAY']['TAX_INC'];//.' '.$tax_name;\n\t\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t\t$price_withtax\t\t\t\t\t\t\t\t= $webprice + ($webprice * $tax_val/100);\n\t\t\t\t\t$price_arr['base_price'] \t\t\t\t\t= $normal_prefix.\" \".printcurr($price_withtax,$curr_sign).\" \".$normal_suffix.\" \".$tax_str;\n\t\t\t\t\t$priceclean_arr['base_price'] \t\t\t\t= printcurr($price_withtax,$curr_sign).\" \".$tax_str;\n\t\t\t\t\t$priceclearvalonly_arr['base_price'] \t\t= $webprice; // considering only the price with out tax;\n\t\t\t\t\t$priceclearvalonly_arr['tax_calc_req'] \t\t= 1; // variable to decide whether tax is to be calculated later\n\t\t\t\t\tif ($discount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($disc_asval==1) // If discount is specified as value\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$disc_price \t\t\t= $webprice - $discount; // calculate the original discount\n\t\t\t\t\t\t\tif($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$more_disc\t= ($disc_price * $applicable_disc)/100;\n\t\t\t\t\t\t\t\t$disc_price = $disc_price - $more_disc;\n\t\t\t\t\t\t\t\t$discount\t+= $more_disc;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\tif($tax_before_disc==1)// case of apply tax before discount\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$disc_price_with_tax \t= $disc_price + ($webprice * $tax_val/100); // apply tax to it\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$disc_price_with_tax \t= $disc_price + ($disc_price * $tax_val/100); // apply tax to it\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\tif ($disc_price<0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$price_arr['disc_val'] \t= 0;\n\t\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 $disc = $price_withtax - $disc_price_with_tax;\n\t\t\t\t\t\t\t\t$price_arr['disc_val'] \t\t\t\t\t= $discount_prefix.\" \".printcurr($disc,$curr_sign).\" \".$discount_suffix;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val'] \t\t\t\t= printcurr($disc,$curr_sign);\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] \t= $disc;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\telse if($disc_asval==2) // For Exact Discount Price \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$disc_price\t= $prod_arr['product_discount']*$curr_rate; \n\t\t\t\t\t\t\tif($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$more_disc\t= ($disc_price * $applicable_disc)/100;\n\t\t\t\t\t\t\t\t$disc_price = $disc_price - $more_disc;\n\t\t\t\t\t\t\t\t//$discount\t= $webprice - $disc_price;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($tax_before_disc==1)// case of apply tax before discount\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$disc_price_with_tax \t= $disc_price + ($webprice * $tax_val/100); // apply tax to it\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$disc_price_with_tax \t= $disc_price + ($disc_price * $tax_val/100); // apply tax to it\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t$discount_with_tax \t= $price_withtax - $disc_price_with_tax;\n\t\t\t\t\t\t\tif ($disc_price<0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$price_arr['disc_val'] \t= 0;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val'] \t= 0;\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] \t= 0;\n\t\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$price_arr['disc_val'] \t\t\t\t= $discount_prefix.\" \".printcurr($discount_with_tax,$curr_sign).\" \".$discount_suffix;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val'] \t\t= printcurr($discount_with_tax,$curr_sign);\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] \t= $discount_with_tax;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\telse // case if discount is given as percentage\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/*if($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$discount += $applicable_disc;\n\t\t\t\t\t\t\t\tif($discount>100)\n\t\t\t\t\t\t\t\t\t$discount = 100;\n\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t$disc_price \t\t\t\t= $webprice - ($webprice * $discount/100);// calculate the original discount\n if($applicable_disc>0)\n {\n $disc_price = $disc_price - ($disc_price*$applicable_disc/100);\n }\n\t\t\t\t\t\t\tif($tax_before_disc==1)// case of apply tax before discount\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$disc_price_with_tax \t\t= $disc_price + ($webprice * $tax_val/100); // apply tax to it\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$disc_price_with_tax \t\t= $disc_price + ($disc_price * $tax_val/100); // apply tax to it\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t$price_arr['disc_percent'] \t\t\t\t= $discount_prefix.\" \".remove_Trailing_zeros($discount).\"% \".$discount_suffix;\n\t\t\t\t\t\t\t$priceclean_arr['disc_percent'] \t\t\t= remove_Trailing_zeros($discount);\n\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_percent'] \t= remove_Trailing_zeros($discount);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$price_arr['discounted_price'] \t\t\t\t\t= $offer_prefix.\" \".printcurr($disc_price_with_tax,$curr_sign).\" \".$offer_suffix.\" \".$tax_str;\n\t\t\t\t\t\t$priceclean_arr['discounted_price']\t\t\t\t= printcurr($disc_price_with_tax,$curr_sign).\" \".$tax_str;\n\t\t\t\t\t\t$priceclearvalonly_arr['discounted_price'] \t= $disc_price;// considering only the discount with out tax //$disc_price_with_tax;\n\t\t\t\t\t\tif ($PriceSettings_arr['price_show_yousave']==1 or $override_yousave==true)// Check whether you save caption is to be displayed\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$price_arr['disc_percent'] \t= '';\n\t\t\t\t\t\t\tif ($disc_price) // check whether disc_price exists\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$yousave_price \t\t\t\t\t\t\t\t= $webprice - $disc_price;\t\n\t\t\t\t\t\t\t\t$price_arr['yousave_price'] \t\t\t\t= $yousave_prefix.\" \".printcurr($yousave_price,$curr_sign).\" \".$yousave_suffix;\n\t\t\t\t\t\t\t\t$priceclean_arr['yousave_price'] \t\t\t= printcurr($yousave_price,$curr_sign);\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['yousave_price'] \t= $yousave_price;\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$discount\t= ($webprice * $applicable_disc)/100;\n\t\t\t\t\t\t\t$disc_price = $webprice - $discount;\n\t\t\t\t\t\t\t$discount\t= $applicable_disc;\n\t\t\t\t\t\t\tif($tax_before_disc==1)// case of apply tax before discount\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$disc_price_with_tax \t\t= $disc_price + ($webprice * $tax_val/100); // apply tax to it\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$disc_price_with_tax \t\t= $disc_price + ($disc_price * $tax_val/100); // apply tax to it\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t$price_arr['disc_percent'] \t\t\t\t\t= $discount_prefix.\" \".remove_Trailing_zeros($discount).\"% \".$discount_suffix;\n\t\t\t\t\t\t\t$priceclean_arr['disc_percent'] \t\t\t= remove_Trailing_zeros($discount);\n\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_percent'] \t\t= remove_Trailing_zeros($discount);\n\t\t\t\t\t\t\t$price_arr['discounted_price'] \t\t\t\t= $offer_prefix.\" \".printcurr($disc_price_with_tax,$curr_sign).\" \".$offer_suffix.\" \".$tax_str;\n\t\t\t\t\t\t\t$priceclean_arr['discounted_price']\t\t\t= printcurr($disc_price_with_tax,$curr_sign).\" \".$tax_str;\n\t\t\t\t\t\t\t$priceclearvalonly_arr['discounted_price'] \t= $disc_price;// considering only the discount with out tax //$disc_price_with_tax;\n\t\t\t\t\t\t\tif ($PriceSettings_arr['price_show_yousave']==1)// Check whether you save caption is to be displayed\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$price_arr['disc_percent'] \t= '';\n\t\t\t\t\t\t\t\tif ($disc_price) // check whether disc_price exists\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$yousave_price \t\t\t\t\t\t\t\t= $webprice - $disc_price;\t\n\t\t\t\t\t\t\t\t\t$price_arr['yousave_price'] \t\t\t\t= $yousave_prefix.\" \".printcurr($yousave_price,$curr_sign).\" \".$yousave_suffix;\n\t\t\t\t\t\t\t\t\t$priceclean_arr['yousave_price'] \t\t\t= printcurr($yousave_price,$curr_sign);\n\t\t\t\t\t\t\t\t\t$priceclearvalonly_arr['yousave_price'] \t= $yousave_price;\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}\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$price_arr['discounted_price'] \t= '';\n\t\t\t\t\t\t\t$price_arr['yousave_price']\t\t= '';\n\t\t\t\t\t\t\t$priceclean_arr['discounted_price'] \t= '';\n\t\t\t\t\t\t\t$priceclean_arr['yousave_price']\t\t= '';\n\t\t\t\t\t\t\t$priceclearvalonly_arr['discounted_price'] \t= '';\n\t\t\t\t\t\t\t$priceclearvalonly_arr['yousave_price'] \t= '';\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\t\n\t\t\t\tbreak;\n\t\t\t\tcase 'show_both': // show price value and tax value\n\t\t\t\t\tif ($tax_val>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tax_str = ' '.$tax_exc_suffix;//$Captions_arr['PRICE_DISPLAY']['TAX_EXC'];//.' '.$tax_name;\n\t\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t\t$price_withtax\t\t\t\t\t\t= $webprice + ($webprice * $tax_val/100);\n\t\t\t\t\t$price_arr['base_price'] \t\t\t= $normal_prefix.\" \".printcurr($price_withtax,$curr_sign).\" \".$normal_suffix;\n\t\t\t\t\t$price_arr['base_price_exc'] \t\t= $normal_prefix.\" \".printcurr($webprice,$curr_sign).\" \".$normal_suffix.\" \".$tax_str;\n\t\t\t\t\t$priceclean_arr['base_price'] \t\t= printcurr($price_withtax,$curr_sign);\n\t\t\t\t\t$priceclean_arr['base_price_exc'] \t= printcurr($webprice,$curr_sign).\" \".$tax_str;\n\t\t\t\t\t$priceclearvalonly_arr['base_price'] \t\t= $webprice; // consider only value with out tax\n\t\t\t\t\t$priceclearvalonly_arr['base_price_exc'] \t= $webprice;\n\t\t\t\t\t$priceclearvalonly_arr['tax_calc_req'] \t\t= 1; // variable to decide whether tax is to be calculated later\n\t\t\t\t\tif ($discount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($disc_asval==1) // If discount is specified as value\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$disc_price \t\t\t= $webprice - $discount; // calculate the original discount\n\t\t\t\t\t\t\tif($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$more_disc\t= ($disc_price * $applicable_disc)/100;\n\t\t\t\t\t\t\t\t$disc_price = $disc_price - $more_disc;\n\t\t\t\t\t\t\t\t$discount\t+= $more_disc;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($tax_before_disc==1)// case of apply tax before discount\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$disc_price_with_tax \t= $disc_price + ($webprice * $tax_val/100); // apply tax to it\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$disc_price_with_tax \t= $disc_price + ($disc_price * $tax_val/100); // apply tax to it\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\tif ($disc_price<0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$price_arr['disc_val'] \t= 0;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val'] \t= 0;\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] \t= 0;\n\t\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 $disc = $price_withtax - $disc_price_with_tax;\n\t\t\t\t\t\t\t\t$price_arr['disc_val'] \t\t\t\t\t\t= $discount_prefix.\" \".printcurr($disc,$curr_sign).\" \".$discount_suffix;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val'] \t\t\t\t\t= printcurr($disc,$curr_sign);\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] \t\t= $disc;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t else if($disc_asval==2) // For Exact Discount Price \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$disc_price\t= $prod_arr['product_discount']*$curr_rate; \n\t\t\t\t\t\t\tif($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$more_disc\t= ($disc_price * $applicable_disc)/100;\n\t\t\t\t\t\t\t\t$disc_price = $disc_price - $more_disc;\n\t\t\t\t\t\t\t\t//$discount\t= $webprice - $disc_price;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($tax_before_disc==1)// case of apply tax before discount\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$disc_price_with_tax \t= $disc_price + ($webprice * $tax_val/100); // apply tax to it\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$disc_price_with_tax \t= $disc_price + ($disc_price * $tax_val/100); // apply tax to it\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t$discount_with_tax \t= $price_withtax - $disc_price_with_tax;\n\t\t\t\t\t\t\tif ($disc_price<0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$price_arr['disc_val'] \t\t= 0;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val'] = 0;\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] = 0;\n\t\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$price_arr['disc_val'] \t\t\t\t\t\t= $discount_prefix.\" \".printcurr($discount_with_tax,$curr_sign).\" \".$discount_suffix;\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_val']\t\t\t \t\t= printcurr($discount_with_tax,$curr_sign);\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_val'] \t\t= $disc_price_with_tax;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\telse // case if discount is given as percentage\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/*if($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$discount += $applicable_disc;\n\t\t\t\t\t\t\t\tif($discount>100)\n\t\t\t\t\t\t\t\t\t$discount = 100;\n\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t$disc_price \t\t\t\t= $webprice - ($webprice * $discount/100);// calculate the original discount\n if($applicable_disc>0)\n {\n $disc_price = $disc_price - ($disc_price*$applicable_disc/100);\n }\n\t\t\t\t\t\t\tif($tax_before_disc==1)// case of apply tax before discount\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$disc_price_with_tax \t\t= $disc_price + ($webprice * $tax_val/100); // apply tax to it\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$disc_price_with_tax \t\t= $disc_price + ($disc_price * $tax_val/100); // apply tax to it\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t$price_arr['disc_percent'] \t\t\t\t\t= $discount_prefix.\" \".remove_Trailing_zeros($discount).\"% \".$discount_suffix;\n\t\t\t\t\t\t\t$priceclean_arr['disc_percent'] \t\t\t\t= remove_Trailing_zeros($discount);\n\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_percent'] \t\t= remove_Trailing_zeros($discount);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$price_arr['discounted_price'] \t\t\t\t= $offer_prefix.\" \".printcurr($disc_price_with_tax,$curr_sign).\" \".$offer_suffix;\n\t\t\t\t\t\t$price_arr['discounted_price_exc'] \t\t\t= $offer_prefix.\" \".printcurr($disc_price,$curr_sign).\" \".$offer_suffix.\" \".$tax_str;\n\t\t\t\t\t\t$priceclean_arr['discounted_price'] \t\t= printcurr($disc_price_with_tax,$curr_sign);\n\t\t\t\t\t\t$priceclean_arr['discounted_price_exc'] \t= printcurr($disc_price,$curr_sign).\" \".$tax_str;\n\t\t\t\t\t\t$priceclearvalonly_arr['discounted_price'] \t\t= $disc_price; // considering only the value with out tax\n\t\t\t\t\t\t$priceclearvalonly_arr['discounted_price_exc'] \t\t= $disc_price;\n\t\t\t\t\t\tif ($PriceSettings_arr['price_show_yousave']==1 or $override_yousave==true)// Check whether you save caption is to be displayed\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$price_arr['disc_percent'] \t\t= '';\n\t\t\t\t\t\t\t$priceclean_arr['disc_percent'] = '';\n\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_percent'] = '';\n\t\t\t\t\t\t\tif ($disc_price) // check whether disc_price exists\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$yousave_price \t\t\t\t\t\t= $webprice - $disc_price;\t\n\t\t\t\t\t\t\t\t$price_arr['yousave_price']\t\t\t= $yousave_prefix.\" \".printcurr($yousave_price,$curr_sign).\" \".$yousave_suffix;\n\t\t\t\t\t\t\t\t$priceclean_arr['yousave_price'] \t= printcurr($yousave_price,$curr_sign);\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['yousave_price'] \t\t= $yousave_price;\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif($applicable_disc>0)// case if customer group disc and / or customer direct discount exists. so apply that also\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$discount\t= ($webprice * $applicable_disc)/100;\n\t\t\t\t\t\t\t$disc_price = $webprice - $discount;\n\t\t\t\t\t\t\t$discount\t= $applicable_disc;\n\t\t\t\t\t\t\tif($tax_before_disc==1)// case of apply tax before discount\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$disc_price_with_tax \t\t= $disc_price + ($webprice * $tax_val/100); // apply tax to it\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$disc_price_with_tax \t\t= $disc_price + ($disc_price * $tax_val/100); // apply tax to it\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t$price_arr['disc_percent'] \t\t\t\t\t= $discount_prefix.\" \".remove_Trailing_zeros($discount).\"% \".$discount_suffix;\n\t\t\t\t\t\t\t$priceclean_arr['disc_percent'] \t\t\t\t= remove_Trailing_zeros($discount);\n\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_percent'] \t\t= remove_Trailing_zeros($discount);\n\t\t\t\t\t\t\t$price_arr['discounted_price'] \t\t\t\t= $offer_prefix.\" \".printcurr($disc_price_with_tax,$curr_sign).\" \".$offer_suffix;\n\t\t\t\t\t\t\t$price_arr['discounted_price_exc'] \t\t\t= $offer_prefix.\" \".printcurr($disc_price,$curr_sign).\" \".$offer_suffix.\" \".$tax_str;\n\t\t\t\t\t\t\t$priceclean_arr['discounted_price'] \t\t= printcurr($disc_price_with_tax,$curr_sign);\n\t\t\t\t\t\t\t$priceclean_arr['discounted_price_exc'] \t= printcurr($disc_price,$curr_sign).\" \".$tax_str;\n\t\t\t\t\t\t\t$priceclearvalonly_arr['discounted_price'] \t\t= $disc_price; // considering only the value with out tax\n\t\t\t\t\t\t\t$priceclearvalonly_arr['discounted_price_exc'] \t\t= $disc_price;\n\t\t\t\t\t\t\tif ($PriceSettings_arr['price_show_yousave']==1)// Check whether you save caption is to be displayed\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$price_arr['disc_percent'] \t\t= '';\n\t\t\t\t\t\t\t\t$priceclean_arr['disc_percent'] = '';\n\t\t\t\t\t\t\t\t$priceclearvalonly_arr['disc_percent'] = '';\n\t\t\t\t\t\t\t\tif ($disc_price) // check whether disc_price exists\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$yousave_price \t\t\t\t\t\t= $webprice - $disc_price;\t\n\t\t\t\t\t\t\t\t\t$price_arr['yousave_price']\t\t\t= $yousave_prefix.\" \".printcurr($yousave_price,$curr_sign).\" \".$yousave_suffix;\n\t\t\t\t\t\t\t\t\t$priceclean_arr['yousave_price'] \t= printcurr($yousave_price,$curr_sign);\n\t\t\t\t\t\t\t\t\t$priceclearvalonly_arr['yousave_price'] \t\t= $yousave_price;\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}\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$price_arr['discounted_price'] \t\t\t\t\t= '';\n\t\t\t\t\t\t\t$price_arr['yousave_price']\t\t\t\t\t\t= '';\n\t\t\t\t\t\t\t$priceclean_arr['discounted_price'] \t\t\t= '';\n\t\t\t\t\t\t\t$priceclean_arr['yousave_price']\t\t\t\t= '';\n\t\t\t\t\t\t\t$priceclearvalonly_arr['discounted_price'] \t\t= '';\n\t\t\t\t\t\t\t$priceclearvalonly_arr['yousave_price'] \t\t= '';\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\t\n\t\t\t\tbreak;\n\t\t\t};\n\t\t\t//print_r($price_arr);\n\t\t\t$returnval = prepare_price($price_arr,$price_class_arr,$br);\n\t\t\t$retval = $returnval['html'];\n\t\t}\n\t\telse // case of price is not set\n\t\t{\n\t\t\t$noprice = ($prod_arr['price_noprice'])?$prod_arr['price_noprice']:$PriceSettings_arr['price_noprice'];\n\t\t\tif($br==0)// case if no break required is selected\n\t\t\t\t$retval = \"<span class='\".$price_class_arr['normal_class'].\"'>\".$noprice.\"</span>\";\n\t\t\telse // case if break required is selected\n\t\t\t{\n\t\t\t\tif($price_class_arr['ul_class'])// place <ul> only if the class for ul is present\n\t\t\t\t\t$retval = '<ul class=\"'.$price_class_arr['ul_class'].'\">';\n\t\t\t\t$retval .= \"<li class='\".$price_class_arr['normal_class'].\"'>\".$noprice.\"</li>\";\n\t\t\t\tif($price_class_arr['ul_class'])// place </ul> only if the class for ul is present\n\t\t\t\t\t$retval .= \"</ul>\";\n\t\t\t}\t\n\t\t}\t\n\t\tif($priceclean_arr['disc_val']!='')\n\t\t\t$priceclean_arr['disc'] = $priceclean_arr['disc_val'];\n\t\tif($priceclean_arr['disc_percent']!='')\n\t\t\t$priceclean_arr['disc'] = $priceclean_arr['disc_percent'].'%';\n\t\tif($speclretn==1)\n\t\t{\n\t\t\treturn $returnval['values'];\n\t\t}\n\t\telseif($speclretn==2) // case to be used with the variables price (full price show option)\n\t\t{\n\t\t\t$returnval['disc_price_only'] = $webprice; \n\t\t\treturn $returnval['disc_price_only'];\n\t\t}\t\n\t\telseif($speclretn==3) // case if returning each of the prices with prefix and suffix in an associate array\n\t\t{\n\t\t\treturn $price_arr;\n\t\t}\n\t\telseif($speclretn==4) // case of returning prices with out prefix and suffix in an associate array\n\t\t{\n\t\t\treturn $priceclean_arr;\n\t\t}\n\t\telseif($speclretn==5) // case if returning each of the prices with prefix and suffix in an associate array\n\t\t{\n\t\t\t$retvals['prince_without_captions'] \t= $priceclean_arr;\n\t\t\t$retvals['price_with_captions']\t= $price_arr; \n\t\t\treturn $retvals;\n\t\t}\n\t\telseif($speclretn==6) // case of returning prices with out prefix and suffix in an associate array\n\t\t{\n\t\t\treturn $priceclearvalonly_arr;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $retval;\n\t\t}\n\t}", "public function MSDArtworkCPT(){$this->__construct();}", "public function putDataSubPlus4s(&$pdf, $font, $datas){\n\n $Term = ClassRegistry::init('Term');\n\n //Term.account_beggining\n $term = $Term->getCurrentTerm();\n\n $target_day29 ='2017/04/01';\n\n //Set XY\n $x_row_0 = 44.8;\n $x_row_1 = 86.9;\n $x_row_2 = 120.0;\n $x_row_3 = 168.4;\n if(strtotime($target_day29) <= strtotime($term['Term']['account_end'])){\n $step_row = 5.2;\n $y_row_cal = 88.5;\n } else {\n $y_row_cal = 93.6;\n $step_row = 5.4;\n }\n $x_middle = 143.9;\n foreach ($datas as $val) {\n //CalculationDetail.item_name\n $pdf->SetFont($font, null, 7, true);\n $itemName = h($val['CalculationDetail']['item_name']);\n $pdf->SetXY($x_row_0, $y_row_cal);\n $pdf->MultiCell(36, 5, $itemName, 0, 'L');\n\n //CalculationDetail.adding\n $pdf->SetFont($font, null, 8, true);\n $adding = $val['CalculationDetail']['adding'];\n $this->_putNumberItem($pdf, $adding, $x_row_1, $y_row_cal);\n\n //CalculationDetail.cal_in\n $cal_in = $val['CalculationDetail']['cal_in'];\n $this->_putNumberItem($pdf, $cal_in, $x_row_2, $y_row_cal);\n\n //CalculationDetail.cal_class\n $cal_class = h($val['CalculationDetail']['cal_class']);\n $pdf->SetXY(143.9, $y_row_cal-0.5);\n $pdf->MultiCell(28, 5, $cal_class, 0, 'C');\n\n //CalculationDetail.cal_out\n $cal_out = $val['CalculationDetail']['cal_out'];\n $this->_putNumberItem($pdf, $cal_out, $x_row_3, $y_row_cal);\n\n $y_row_cal += $step_row;\n }\n }", "function drawGraph1() {\nrequire_once ('vendor/jpgraph/jpgraph/lib/JpGraph/src/jpgraph.php');\nrequire_once ('vendor/jpgraph/jpgraph/lib/JpGraph/src/jpgraph_scatter.php');\n\n#include \"vendor/jpgraph/jpgraph/lib/JpGraph/src/jpgraph.php\";\n#include 'vendor/jpgraph/jpgraph/lib/JpGraph/src/jpgraph_line.php';\n#include \"vendor/jpgraph/jpgraph/lib/JpGraph/src/jpgraph_scatter.php\";\n#require_once ('vendor/jpgraph/jpgraph/lib/JpGraph/src/jpgraph_utils.inc.php');\n#require_once ('vendor/jpgraph/jpgraph/lib/JpGraph/src/jpgraph_scatter.php');\n//echo $_GET['research'];\n$GDT = getTableData('Вишнянське_стат_1');\n\n//echo \"<pre>\";\n//var_dump($GDT);\n//echo \"</pre>\";\n//settype($GDT['kp'], 'float');\n//settype($GDT['kpe'], 'float');\n//$GDT['kp']['0'] = 0;\n//$GDT['kpe']['0'] = 0;\n\n//for ($i = 1; $i <= count($GDT['kp']); $i++) {\n// $datax[$i-1] = (float)$GDT['kp'][$i];\n// $datay[$i-1] = (float)$GDT['kpe'][$i];\n//}\n$datax = $GDT['kp'];\n$datay = $GDT['kpe'];\n\n//$datax = array(3.5,3.7,3,4,6.2,6,3.5,8,14,8,11.1,13.7);\n//$datay = array(20,22,12,13,17,20,16,19,30,31,40,43);\n \n$graph = new Graph(400,400);\n$graph->SetScale(\"linlin\");\n \n$graph->img->SetMargin(60,30,30,30); \n$graph->SetShadow();\n \n$graph->title->Set(\"Залежність між Кп та Кпе\");\n//$graph->title->SetFont(DejaVuSans);\n\n$graph->yaxis->title->Set('Кп');\n$graph->xaxis->title->Set('Кпе');\n\n$sp1 = new ScatterPlot($datay,$datax);\n \n$graph->Add($sp1);\n$graph->Stroke();\n \n}", "function polyline($points)\r\n {\r\n $this->forcePen();\r\n $xPoints = \" var Xpoints = new Array(\";\r\n $yPoints = \" var Ypoints = new Array(\";\r\n $count = count($points);\r\n for ($i = 0; $i < $count; $i += 2) {\r\n if ($i > 1) {\r\n $xPoints .= \",\";\r\n $yPoints .= \",\";\r\n }\r\n $xPoints .= $points[$i];\r\n $yPoints .= $points[$i+1];\r\n }\r\n $xPoints .= \");\\n\";\r\n $yPoints .= \");\\n\";\r\n echo $xPoints;\r\n echo $yPoints;\r\n echo \"$this->_canvas.drawPolyline(Xpoints, Ypoints);\\n\";\r\n }", "function sale_regular_price_html() {\n\t\t$price = '';\n\t\t\n\t\tif( $this->_apptivo_sale_price <= 0)\n\t\t{\n\t\t\t $price .= 'This product is not ready for sale';\n\t\t\t $price = apply_filters('apptivo_ecommerce_empty_price_html', $price, $this);\n\t\t\t return $price;\t\t\n\t\t}\n\t\t\tif ($this->_apptivo_sale_price) :\n\t\t\t\tif (isset($this->_apptivo_regular_price)) :\n\t\t\t\t if($this->_apptivo_regular_price == '' ) { $this->_apptivo_regular_price = '0.00'; } \t\t\t\t\n\t\t\t\t\t$price .= '<del>'.apptivo_ecommerce_price( $this->_apptivo_regular_price ).'</del> <ins>'.apptivo_ecommerce_price($this->_apptivo_sale_price).'</ins>';\n\t\t\t\t\t$price = apply_filters('apptivo_ecommerce_sale_price_html', $price, $this);\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\telse :\t\n\t\t\t\t $price .= apptivo_ecommerce_price($this->sale_price());\t\t\t\t\t\n\t\t\t\t\t$price = apply_filters('apptivo_ecommerce_price_html', $price, $this);\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\telseif ($this->_apptivo_sale_price === '' ) :\n\t\t\t $price .= 'This product is not ready for sale';\n\t\t\t $price = apply_filters('apptivo_ecommerce_empty_price_html', $price, $this);\t\t\t\t\n\t\t\telseif ($this->_apptivo_sale_price === '0' ) :\t\t\t\n\t\t\t\t$price = __('Free!', 'apptivo_ecommerce'); \n\t\t\t\t$price = apply_filters('apptivo_ecommerce_free_price_html', $price, $this);\n\t\t\t\t\n\t\t\tendif;\n\t\n\t\t\n\t\treturn $price;\n\t}", "function sale_price() {\n\t\treturn $this->_apptivo_sale_price;\n\t}", "public function productinspector($start_id, $end_id);", "public function GetStolpen() {\r\n\r\n $html = <<<EOD\r\n <!-- HÄR KOMMER STOLPEN -->\r\n <g id=\"stolpen\">\r\n <line fill=\"none\" stroke=\"#673B15\" stroke-width=\"8\" stroke-miterlimit=\"10\" x1=\"114.649\" y1=\"9.386\" x2=\"206.216\" y2=\"9.386\"/>\r\n <line fill=\"none\" stroke=\"#673B15\" stroke-width=\"2\" stroke-miterlimit=\"10\" x1=\"120.036\" y1=\"46.626\" x2=\"159.652\" y2=\"9.386\"/>\r\n <line fill=\"#B07F48\" stroke=\"#673B15\" stroke-width=\"8\" stroke-miterlimit=\"10\" x1=\"120.036\" y1=\"175.687\" x2=\"120.036\" y2=\"14.772\"/>\r\n </g>\r\nEOD;\r\n return $html;\r\n }", "function spt($price,$tax=null) {\n //echo $tax;\n\t \n\t if ($tax) {\n $p = $this->pricewithtax($price,$tax);\t \n\t }\n\t elseif ($this->is_reseller) {\n\t $p = $price;\n\t }\t\n\t elseif ((defined('SHCART_DPC')) && \n\t (GetGlobal('controller')->calldpc_var('shcart.showtaxretail'))) {//retal handl\n\t $p = $this->pricewithtax($price,$tax);\n\t }\n\t else\n\t $p = $price;\t\t\n\t //echo '>',$p;\n\t return ($p);\n\t}", "private function createOrd()\n {\n $point1 = new Point(\n $this->style->canvas->left,\n $this->style->canvas->top - $this->style->axes->ord->marginY\n );\n\n $point2 = new Point(\n $point1->x,\n $this->style->canvas->top + $this->style->canvas->height\n );\n\n return $this->getLine(\n $point1,\n $point2,\n $this->style->axes->ord->color,\n $this->style->axes->ord->thickness\n );\n }", "function get_price_html() {\n\t\t$price = '';\n\t\tif ( $this->has_child() ) :\n\t\t\t\n\t\t\t$min_price = '';\n\t\t\t$max_price = '';\n\t\t\t\n\t\t\tforeach ($this->children as $child) :\n\t\t\t\t$child_price = $child->product->get_price();\n\t\t\t\tif ($child_price<$min_price || $min_price == '') $min_price = $child_price;\n\t\t\t\tif ($child_price>$max_price || $max_price == '') $max_price = $child_price;\n\t\t\tendforeach;\n\t\t\t\n\t\t\t$price .= '<span class=\"from\">' . __('From: ', 'woothemes') . '</span>' . woocommerce_price($min_price);\t\t\n\t\telseif ($this->is_type('variable')) :\n\t\t\n\t\t\t$price .= '<span class=\"from\">' . __('From: ', 'woothemes') . '</span>' . woocommerce_price($this->get_price());\t\n\t\t\n\t\telse :\n\t\t\tif ($this->price) :\n\t\t\t\tif ($this->is_on_sale() && isset($this->data['regular_price'])) :\n\t\t\t\t\t$price .= '<del>'.woocommerce_price( $this->data['regular_price'] ).'</del> <ins>'.woocommerce_price($this->get_price()).'</ins>';\n\t\t\t\telse :\n\t\t\t\t\t$price .= woocommerce_price($this->get_price());\n\t\t\t\tendif;\n\t\t\tendif;\n\t\tendif;\n\t\treturn $price;\n\t}", "protected function RenderPriceRange() {\n\t$nPrcLo = $this->PriceMinimum();\n\t$nPrcHi = $this->PriceMaximum();\n\tif ($nPrcLo == $nPrcHi) {\n\t $sPrice = fcMoney::Format_withSymbol($nPrcLo);\n\t} else {\n\t $sPrice = \n\t fcMoney::Format_withSymbol($nPrcLo)\n\t .' - '\n\t .fcMoney::Format_withSymbol($nPrcHi)\n\t ;\n\t}\n\treturn $sPrice;\n }", "public function lineWithPoints() {\n\t\t$this->Options['series']['lines']['show'] = true;\n\t\t$this->Options['series']['points']['show'] = true;\n\t}", "public function getPriceModel()\n {\n return Mage::getSingleton('catalog/product_type')->priceFactory($this->getTypeId());\n }", "function makeChart($top, $data, $targetPressure, $maxPressure){\n\tglobal $pdf;\n\t\n\t // Pressure and temperature mins and maxes.\n\t$temps = array('min' => 100000000000, 'max' => -100000000000);\n\t$press = array('min' => 100000000000, 'max' => -100000000000);\n\t// take the DATA, and find MIN and MAX values for pressure and temperature.\n\tforeach($data as $d){\n\t\tif($d[\"Temperature\"] < $temps['min']) { $temps['min'] = $d[\"Temperature\"]; }\n\t\tif($d[\"Temperature\"] > $temps['max']) { $temps['max'] = $d[\"Temperature\"]; }\n\t\tif($d[\"Pressure\"] < $press['min']) { $press['min'] = $d[\"Pressure\"]; }\n\t\tif($d[\"Pressure\"] > $press['max']) { $press['max'] = $d[\"Pressure\"]; }\n\t} \n\t\n\t$temps['min'] *= 0.9;\n\t$temps['max'] *= 1.15;\n\t$press['min'] *= 0.9;\n\t$press['max'] *= 1.15;\n\t\n\t// new code - Will create a dynamic chart, using the given test pressure to \n\t// dynamically generate a chart. \n\t\n\t$pdf->SetLineWidth(0);\n\t$pdf->SetDrawColor(0, 0, 0);\n\t// draw x axis\n\t$pdf->Line(330, 267, 570, 267);\n\t// draw y axis + edge bar\n\t$pdf->Line(570, $top, 570, 267);\n\t$pdf->Line(330, $top, 330, 267);\n\t\n\t// draw cross lines, 8 across for \"10\" spaces\n\t$pdf->SetDrawColor(150, 150, 150);\n\t\n\tfor($i = 24; $i < 225; $i += 24){\n\t\t// vertical lines\n\t\t$pdf->Line($i + 330, $top, $i + 330, 270);\n\t\t\n\t}\n\t\n\t$h = 267 - $top;\n\t\n\tfor($i = 0; $i < $h; $i += $h / 5){\n\t\t// horizontal lines\n\t\t$pdf->Line(327, $i + $top, 573, $i + $top);\n\t}\n\t\n\t// add horizontal numbers + description\n\t$pdf->SetDrawColor(0, 0, 0);\n\t$pdf->SetFont('Helvetica','',5);\n\t$pdf->SetTextColor(0,0,0);\n\t\n\tfor($i = 0; $i < 11; $i++){\n\t\t// place 1 number at each spot.\n\t\t$pdf->SetXY(325 + ($i * 24) , 267);\n\t\t$pdf->Cell(10, 14, ceil((count($data) / 10) * $i) , 0, 2, 'C', false);\n\t}\t\n\t\n\t// add vertical numbers, Pressure on left, temperature on right. \n\tfor($i = 0; $i < 6; $i++){\n\t\t$pdf->SetXY(318 , 260 - ($i * ($h / 5)));\n\t\t$pdf->Cell(10, 14, ceil(((($press['max'] - $press['min']) / 5) * $i + $press['min']) * 10) / 10 , 0, 2, 'R', false);\n\t\t\n\t\t$pdf->SetXY(572 , 260 - ($i * ($h / 5)));\n\t\t$pdf->Cell(10, 14, ceil(((($temps['max'] - $temps['min']) / 5) * $i + $temps['min']) * 10) / 10 , 0, 2, 'L', false);\n\t}\n\t\n\t\n\t// add vertical bar description\n\t$pdf->SetFillColor(255, 255, 255);\n\t$pdf->SetTextColor(150, 150, 150);\n\t$pdf->SetFont('Helvetica','',5);\n\t$pdf->Rect(331, $top + 1, 35, 12, 'F');\n\t$pdf->SetXY(331 , $top + 4);\n\t$pdf->Cell(100, 6, \"Pressure (PSI)\" , 0, 2, 'L', false);\n\t\n\t$pdf->Rect(531, $top + 1, 35, 12, 'F');\n\t$pdf->SetXY(526 , $top + 4);\n\t$pdf->Cell(100, 6, \"Temperature (C)\" , 0, 2, 'L', false);\n\t\n\t// add horizontal bar description\n\t$pdf->SetXY(330 , 279);\n\t\n\t$pdf->Cell(250, 6, \"Time (Seconds)\" , 0, 2, 'C', false);\n\t\n\t$mp = $press['max'] - $press['min'];\n\t$mt = $temps['max'] - $temps['min'];\t\n\t\n\t// draw min pressure lines (100%)\n\t$lineAt = ((($mp - ($targetPressure - $press['min'])) / $mp) * (267 - $top)) + $top;\n\t$pdf->SetDrawColor(0, 200, 0);\n\t$pdf->Line(330, $lineAt, 570, $lineAt);\n\t\n\t\n\t// draw max pressure lines (110%)\n\t$lineAt = ((($mp - ($maxPressure - $press['min'])) / $mp) * (267 - $top)) + $top;\n\t$pdf->SetDrawColor(200, 0, 0);\n\t$pdf->Line(330, $lineAt, 570, $lineAt);\n\t\n\n\tfor($i = 1; $i < count($data); $i++){\n\t\t// draw the line from point-1 to point \n\t\t\n\t\t$pdf->SetDrawColor(0, 0, 0);\t\n\t\t$pdf->Line(\n\t\t\t\t(241 * (($i - 1) / count($data))) + 330, \n\t\t\t\t((($mp - ($data[$i - 1]['Pressure'] - $press['min'])) / $mp) * (267 - $top)) + $top,\n\t\t\t\t(241 * ($i / count($data))) + 330, \n\t\t\t\t((($mp - ($data[$i]['Pressure'] - $press['min'])) / $mp) * (267 - $top)) + $top);\n\t\t\n\t\t$pdf->SetDrawColor(0, 0, 255);\n\t\t$pdf->Line(\n\t\t\t\t(241 * (($i - 1) / count($data))) + 330, \n\t\t\t\t((($mt - ($data[$i - 1]['Temperature'] - $temps['min'])) / $mt) * (267 - $top)) + $top,\n\t\t\t\t(241 * ($i / count($data))) + 330, \n\t\t\t\t((($mt - ($data[$i]['Temperature'] - $temps['min'])) / $mt) * (267 - $top)) + $top);\n\t}\n\t\n\t\n\t$pdf->SetLineWidth(0);\n\treturn 304;\n}", "function createSun() {\n global $funcVersion; $funcVersion = 1;\n $n = 3;\n $r='';\n $e=2*$n+1; //edge length\n for($i=0;$i<$e*$e;$i++) {\n $h = floor($e/2); // half point of square\n $x = floor($i%$e); // current x coordinate\n $y = floor($i/$e); // current y coordinate\n\n if ($y==$h&&$x==$h) {\n // center of square\n $r.='O';\n }\n else if ($y==$h) {\n // horizontal line\n $r.='-';\n }\n else if ($x==$h) {\n // vertical line\n $r.='|';\n }\n else if (($y-$h)==($x-$h)) {\n // diagonal line from top-left to bottom right\n $r.='\\\\';\n }\n else if (($y-$h)==($h-$x)) {\n // diagonal line from bottom-left to top-right\n $r.='/';\n }\n else {\n // empty space\n $r.=' ';\n }\n if ($x==$e-1) {\n // add new line for the end of the row\n $r.=\"\\n\";\n }\n }\n //echo \"<pre>\"; echo $r; echo \"</pre>\";\n}", "public function getCalculatedPriceInfo($products, $quantityScale = 1) {\n return $this->getOSPriceInfo($quantityScale, $products);\n //return $this->getPriceSystemImplementation()->getPriceInfo($this, $products);\n }", "function kml_arrow($time_begin, $time_end, $x1, $y1, $x2, $y2, $depth, $head_angle, $color) {\n\n\t$x_adj = ($x2-$x1)*0.00006/pow((pow(($x1-$x2), 2) + pow(($y1-$y2),2)), 0.5);\n\n\t$y_adj = ($y2-$y1)*0.00006/pow((pow(($x1-$x2), 2) + pow(($y1-$y2),2)), 0.5);\n\n\n //The following draws a line\n\techo '<Placemark>'; \n\t\techo '<styleUrl>#'.$color. '</styleUrl> \n\t\t<LineString>\t \n\t\t\t<altitudeMode>absolute</altitudeMode> \n\t\t\t<coordinates>';\n\t\t\techo $x1. \",\". $y1. \",$depth \\n\";\n\t\t\techo ($x2 - $x_adj*2.067). \",\". ($y2 - $y_adj*2.067). \",$depth \\n\";\n\t\t\techo '</coordinates> \n\t\t</LineString>\n\t\t<TimeSpan id=\"ID'. $x2. $depth. '\">';\n\t\t\techo '<begin>'.$time_begin.'</begin> ';\n\t\t\techo '<end>'.$time_end.'</end> ';\n\t\techo '</TimeSpan>\n\t</Placemark> ';\n\n\t// The following is a arrow head.\n\techo '<GroundOverlay>\n\t\t<Icon> \n\t\t\t<href>http://tabs1.gerg.tamu.edu/tglo/testpages/ADCP/arrow-head.png</href>\n\t\t</Icon>';\n\t\n\techo '<TimeSpan id=\"ID'. $x2. $depth. 'ID\">';\n\t\techo '<begin>'.$time_begin.'</begin> ';\n\t\techo '<end>'.$time_end.'</end>'. \"\\n\";\n\techo '</TimeSpan>';\n\techo \"\\n\";\n\n\n\techo '<LatLonBox>\t\n \t<north>'. ($y2 - $y_adj + 0.00006) . '</north> \n\t\t<south>'. ($y2 - $y_adj - 0.00006) . '</south> \n\t\t<east>'. ($x2 - $x_adj + 0.000066) . '</east> \n\t\t<west>'. ($x2 - $x_adj - 0.000066) . '</west> ' ; \n\t\techo '<rotation>'. $head_angle. '</rotation> \n\t </LatLonBox> ';\n\techo '<altitude>'. $depth. '</altitude>';\n\techo '<altitudeMode>absolute</altitudeMode> \n\t</GroundOverlay>';\n\n\t}", "function lb_get_seo_title($product) {\n //$price = lb_format_price($product['finalprice'], true, true);\n $price = round((float)$product['finalprice']/100, 0) . ':-';\n \n $seo_title = 'Köp ' . $product['name'] . (isset($product['merchant'])?' från ' . $product['merchant']:'') . ' för ' . $price . (true == (bool)$product['onsale']?' (' . $product['salediscount'] . '% rabatt!)':'');\n \n error_log('lb_get_seo_title - product[finalprice]=' . $product['finalprice'] . ', price=' . $price . ', product: ' . print_r($product, true));\n\n return wpts_spin($seo_title);\n}", "public function getURL() {\n\n\t\t// this chart type is pretty dependent on having some data present to do much at all\n\t\tif (count($this->data) == 0) throw new Exception(\"No data present for scatter chart.\");\n\t\t\n\t\t// if either axis labels are absent then automatically generate them from the data\n\t\tif (!isset($this->x_labels)) $this->x_labels = $this->generate_axis_labels(\"x\");\n\t\tif (!isset($this->y_labels)) $this->y_labels = $this->generate_axis_labels(\"y\");\n\n\t\t// create options array\n\t\t$options = array(\n\t\t\t\"chxt\"\t\t=> \"x,y\",\n\t\t\t\"chxl\"\t\t=> \"0:|\".implode(\"|\",$this->x_labels).\"|1:|\".implode(\"|\",$this->y_labels)\n\t\t);\t\t\n\n\t\t// add grid?\n\t\tif ($this->grid) {\n\t\t\t$options[\"chg\"] = round(100/count($this->x_labels)).\",\".round(100/count($this->y_labels));\n\t\t}\n\t\t\n\t\t// add chart data\n\t\t$options[\"chd\"] = \"t:\".implode(\",\",$this->data[\"x\"]).\"|\".implode(\",\",$this->data[\"y\"]).\"|\".implode(\",\",$this->data[\"size\"]);\n\t\t\n\t\t// use single colour?\n\t\tif ($this->single_colour) {\n\t\t\tif (preg_match(\"/[A-Fa-z0-9][A-Fa-z0-9][A-Fa-z0-9][A-Fa-z0-9][A-Fa-z0-9][A-Fa-z0-9]/\",$this->single_colour)) {\n\t\t\t\t$this->palette = \"{$this->single_colour},{$this->single_colour}\";\n\t\t\t} else {\n\t\t\t\t$colour = $this->colour_palettes[$this->palette][0];\n\t\t\t\t$this->palette = \"{$colour},{$colour}\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t// call parent\n\t\treturn parent::getURL($options);\n\t\t\n\t}", "function __toString() {\r\n\t\t\t$out = '<div id=\"products\">';\r\n\t\t\t\r\n\t\t\tforeach($this->data['products'] as $p) {\r\n\t\t\t\t$out .= \"<div class='product'><a href='BASE_URL'><img src='{$p['photo']}' alt='{$p['shortdesc']}'/><div class='label'>{$p['name']}</div></a></div>\\n\";\r\n\t\t\t}\r\n\t\t\t$out .= \"</div>\";\r\n\t\t\treturn $out;\r\n\t\t}", "function es_set_sale_price( $price, $product ) {\n\t\n\t$exclude_skus = array( 'COEBRCE', 'COEPOSTER', 'PUB41' );\n\t$exclude_cats = array( 'specials', 'clearance' );\n\t$date_now = new DateTime();\n\t$start_dtm = new DateTime( '2016-10-03' );\n\t$end_dtm = new DateTime( '2016-10-11' );\n\t\n\t// exclude SKUs\n\tif ( in_array( $product->sku, $exclude_skus ) )\n\t\treturn $price;\n\t\n\t// exclude specials category\n\t$product_cat = wp_get_post_terms( $product->id, 'product_cat' );\n\t\n\tforeach ( $product_cat as $term ){\n\t\tif( in_array( $term->slug, $exclude_cats ) ){\n\t\t\treturn $price;\n\t\t}\n\t}\t\n\t\n\tif ( ! $product->is_virtual() AND ( $date_now >= $start_dtm AND $date_now <= $end_dtm ) ) {\n\t\t$member_exists = es_check_membership_held();\n\t\t$member_price = get_post_meta($product->id, 'member_price', true);\n\t\t$price = $product->get_regular_price() * ( 0.9 );\n\t\t\n\t\tif ( ! empty( $member_price ) AND $member_exists ) {\n\t\t\t$product->set_price( $member_price );\n\t\t\t$product->sale_price = $price;\n\t\t\t$price = $member_price;\t\t\n\t\t}\n\t\telse {\n\t\t\t$product->set_price( $price );\n\t\t\t$product->sale_price = $price;\t\n\t\t}\n\t\t\n\t}\n\t\n\treturn $price;\n}", "protected function getInvoiceExtraPrintBlocksXML($products, $shipping_method)\n {\n $dom = new DOMDocument('1.0', 'utf-8');\n $OnlineInvoice = $dom->createElement('OnlineInvoice');\n $dom->appendChild($OnlineInvoice);\n $OnlineInvoice->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');\n $OnlineInvoice->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsd', 'http://www.w3.org/2001/XMLSchema');\n\n $OrderLines = $dom->createElement('OrderLines');\n $OnlineInvoice->appendChild($OrderLines);\n\n foreach ($products as $key => $product) {\n $qty = $product['quantity'];\n $price = $product['price'] * $qty;\n $priceWithTax = $this->tax->calculate($price, $product['tax_class_id'], 1);\n $taxPrice = $priceWithTax - $price;\n $taxPercent = ($taxPrice > 0) ? round(100 / (($priceWithTax - $taxPrice) / $taxPrice)) : 0;\n\n $OrderLine = $dom->createElement('OrderLine');\n $OrderLine->appendChild($dom->createElement('Product', $product['name']));\n $OrderLine->appendChild($dom->createElement('Qty', $qty));\n $OrderLine->appendChild($dom->createElement('UnitPrice', $product['price']));\n $OrderLine->appendChild($dom->createElement('VatRate', $taxPercent));\n $OrderLine->appendChild($dom->createElement('VatAmount', $taxPrice));\n $OrderLine->appendChild($dom->createElement('Amount', $priceWithTax));\n $OrderLines->appendChild($OrderLine);\n }\n\n // Add Shipping Line\n if (isset($shipping_method['cost'])) {\n $shipping = $shipping_method['cost'];\n $shippingWithTax = $this->tax->calculate($shipping, $shipping_method['tax_class_id'], 1);\n $shippingTax = $shippingWithTax - $shipping;\n $shippingTaxPercent = $shipping != 0 ? (int)((100 * ($shippingTax) / $shipping)) : 0;\n\n $OrderLine = $dom->createElement('OrderLine');\n $OrderLine->appendChild($dom->createElement('Product', $shipping_method['title']));\n $OrderLine->appendChild($dom->createElement('Qty', 1));\n $OrderLine->appendChild($dom->createElement('UnitPrice', $shipping));\n $OrderLine->appendChild($dom->createElement('VatRate', $shippingTaxPercent));\n $OrderLine->appendChild($dom->createElement('VatAmount', $shippingTax));\n $OrderLine->appendChild($dom->createElement('Amount', $shipping + $shippingTax));\n $OrderLines->appendChild($OrderLine);\n }\n\n // Add Factoring fee\n if ($this->config->get('factoring_fee_fee') > 0) {\n $fee = (float)$this->config->get('factoring_fee_fee');\n $fee_tax_class_id = (int)$this->config->get('factoring_fee_tax_class_id');\n $feeWithTax = $this->tax->calculate($fee, $fee_tax_class_id, 1);\n $feeTax = $feeWithTax - $fee;\n $feeTaxPercent = $fee != 0 ? (int)((100 * ($feeTax) / $fee)) : 0;\n\n $OrderLine = $dom->createElement('OrderLine');\n $OrderLine->appendChild($dom->createElement('Product', $this->language->get('text_factoring_fee')));\n $OrderLine->appendChild($dom->createElement('Qty', 1));\n $OrderLine->appendChild($dom->createElement('UnitPrice', $fee));\n $OrderLine->appendChild($dom->createElement('VatRate', $feeTaxPercent));\n $OrderLine->appendChild($dom->createElement('VatAmount', $feeTax));\n $OrderLine->appendChild($dom->createElement('Amount', $fee + $feeTax));\n $OrderLines->appendChild($OrderLine);\n }\n\n return str_replace(\"\\n\", '', $dom->saveXML());\n }", "private function _createOrderLines($virtuemart_order_id, $cart)\n {\n $_orderItems = $this->getTable('order_items');\n\n foreach ($cart->products as $priceKey => $product) {\n\n if (!empty($product->customProductData)) {\n $_orderItems->product_attribute = vmJsApi::safe_json_encode($product->customProductData);\n } else {\n $_orderItems->product_attribute = '';\n }\n\n\n $_orderItems->virtuemart_order_item_id = null;\n $_orderItems->virtuemart_order_id = $virtuemart_order_id;\n\n $_orderItems->virtuemart_vendor_id = $product->virtuemart_vendor_id;\n $_orderItems->virtuemart_product_id = $product->virtuemart_product_id;\n $_orderItems->order_item_sku = $product->product_sku;\n $_orderItems->order_item_name = $product->product_name;\n $_orderItems->product_quantity = $product->quantity;\n $_orderItems->product_item_price = $product->allPrices[$product->selectedPrice]['basePriceVariant'];\n $_orderItems->product_basePriceWithTax = $product->allPrices[$product->selectedPrice]['basePriceWithTax'];\n\n //$_orderItems->product_tax = $_cart->pricesUnformatted[$priceKey]['subtotal_tax_amount'];\n $_orderItems->product_tax = $product->allPrices[$product->selectedPrice]['taxAmount'];\n $_orderItems->product_final_price = $product->allPrices[$product->selectedPrice]['salesPrice'];\n $_orderItems->product_subtotal_discount = $product->allPrices[$product->selectedPrice]['subtotal_discount'];\n $_orderItems->product_subtotal_with_tax = $product->allPrices[$product->selectedPrice]['subtotal_with_tax'];\n $_orderItems->product_priceWithoutTax = $product->allPrices[$product->selectedPrice]['priceWithoutTax'];\n $_orderItems->product_discountedPriceWithoutTax = $product->allPrices[$product->selectedPrice]['discountedPriceWithoutTax'];\n $_orderItems->order_status = 'P';\n\n if (!$_orderItems->check()) {\n return false;\n }\n //The check may set here a wrong vendorId, we replace it again with the right one.\n $_orderItems->virtuemart_vendor_id = $product->virtuemart_vendor_id;\n\n // Save the record to the database\n if (!$_orderItems->store()) {\n return false;\n }\n\n $product->virtuemart_order_item_id = $_orderItems->virtuemart_order_item_id;\n\n $this->handleStockAfterStatusChangedPerProduct($_orderItems->order_status, 'N', $_orderItems, $_orderItems->product_quantity);\n }\n\n return true;\n }", "public function GetKroppen() {\r\n\r\n $html = <<<EOD\r\n <!-- HÄR KOMMER KROPPEN -->\r\n <g id=\"kroppen\">\r\n <ellipse fill=\"none\" stroke=\"#000000\" stroke-miterlimit=\"10\" cx=\"200.839\" cy=\"97.527\" rx=\"15.149\" ry=\"24.238\"/>\r\n </g>\r\nEOD;\r\n return $html;\r\n }", "function kml_viewplot($lat, $lon, $name, $color, $alpha)\n {\n $this->push(\"Placemark\", array(\"id\"=>\"viewplot_\".$name));\n $this->element(\"name\", $name);\n \n $this->push(\"LineString\");\n $this->element(\"tessellate\", \"1\");\n $this->push(\"coordinates\");\n\n for($i = 0; $i < sizeof($lat); ++$i)\n {\n $this->insert($lon[$i].\",\".$lat[$i].\",0\");\n }\n \n $this->pop();\n $this->pop();\n\n\n $this->push(\"Style\");\n $this->push(\"LineStyle\");\n $this->element(\"width\", \"0.5\");\n $this->element(\"color\", sprintf(\"%02X\", $alpha*255).$color);\n $this->pop();\n $this->pop();\n\n $this->pop();\n //$this->kml_opbox_label($name, $lat[0], $lon[0], \"ffffffff\", \"viewplot_label_\".$name);\n \n }", "function opaljob_price_format_position() {\n global $opaljob_options;\n $currency_pos = opaljob_options('currency_position','before');\n\n $format = '%1$s%2$s';\n switch ( $currency_pos ) {\n case 'before' :\n $format = '%1$s%2$s';\n break;\n case 'after' :\n $format = '%2$s%1$s';\n break;\n case 'left_space' :\n $format = '%1$s&nbsp;%2$s';\n break;\n case 'right_space' :\n $format = '%2$s&nbsp;%1$s';\n break;\n }\n\n return apply_filters( 'opaljob_price_format_position', $format, $currency_pos );\n}", "private function plotData() : void\n\t{\n\t\t$n = $this->getSize();\n\t\tif($n === -1) {\n\t\t\texit();\n\t\t}\n\n\t\tfor ($i=0; $i < $n; $i++) { \n\t\t\timagefilledellipse($this->im, $this->xValues[$i]*$this->scaleX+$this->shiftX, $this->yValues[$i]*$this->scaleY*(-1)+$this->shiftY, 10, 10, $this->colorPoints);\n\t\t}\n\n\t}", "function generate_line_diagramm($filename,$text,$data) {\n\n\t$y_max = 70 + sizeof($data) * 40;\n\n\t$image = imagecreatetruecolor(600,$y_max);\n\timagecolorallocate ($image, 255, 255, 255);\n\n\t// Colours\n\t$colours[\"black\"] = imagecolorallocate ($image, 0, 0, 0);\n\t$colours[\"grey\"] = imagecolorallocate($image,193,193,193);\n\t$colours[\"red\"] = imagecolorallocate($image,255,0,0);\n\t$colours[\"blue\"] = imagecolorallocate($image,202,218,249); \n\t$colours[\"white\"] = imagecolorallocate($image,255,255,255); \n\t\n\n\t// Texts\n\timagettftext($image, \"10\",\"0\",\"150\",\"10\",\"255\",\"{$GLOBALS[\"config\"][\"environment\"][\"dir\"]}/ext_inc/fonts/arial.ttf\",$text[\"top\"]);\n\timagettftext($image, \"10\",\"90\",\"10\",$y_max/2,\"255\",\"{$GLOBALS[\"config\"][\"environment\"][\"dir\"]}/ext_inc/fonts/arial.ttf\",$text[\"left\"]);\n\timagettftext($image, \"10\",\"270\",\"590\",$y_max/2,\"255\",\"{$GLOBALS[\"config\"][\"environment\"][\"dir\"]}/ext_inc/fonts/arial.ttf\",$text[\"right\"]);\n\timagettftext($image, \"10\",\"0\",\"300\",$y_max - 10,\"255\",\"{$GLOBALS[\"config\"][\"environment\"][\"dir\"]}/ext_inc/fonts/arial.ttf\",$text[\"buttom\"]);\n\n\n\t// Background for middle\n\t$date = date(\"Y-m-d H:i\");\n\t\n\timagefilledrectangle($image, 22,22,580,$y_max-30, $colours[\"grey\"]); \n\timagerectangle($image,22,22,580,$y_max-30,$colours[\"black\"]);\n\timagettftext($image, \"8\",\"0\",\"400\",$y_max - 35,\"255\",\"{$GLOBALS[\"config\"][\"environment\"][\"dir\"]}/ext_inc/fonts/arial.ttf\",\"$date | lansuite 2.0 Chart\");\n\n\n\t\n\tforeach($data AS $these_data) {\n\t\n\t$overall_count = $overall_count + $these_data[\"count\"];\n\t\n\t}\n\t\n\tforeach($data AS $draw_this_line) {\n\t\n\t$x1 = 30;\n\t$y1 = $y1+40;\n\t$x2 = $x1 + (540*($draw_this_line[\"count\"]/$overall_count));\n\t$y2 = $y1 + 20;\n\t\n\t$red_value = 255 * round(($draw_this_line[\"count\"])/$overall_count,1);\n\t\n\t\n\t\n\t$myred = imagecolorallocate($image,255,$red_value,$red_value);\n\t\n\timagefilledrectangle($image,$x1 ,$y1,$x2,$y2, $myred); \n\timagerectangle($image,$x1,$y1,$x2,$y2,$colours[\"black\"]);\n\t\n\t$line_text = $draw_this_line[\"name\"] . \" (\" . round(100*(($draw_this_line[\"count\"]/$overall_count)),2) . \" %)\";\n\t\n\t\n\t\n\timagettftext($image, \"10\",\"0\",$x1 + 3 ,$y1 + 14,250,\"{$GLOBALS[\"config\"][\"environment\"][\"dir\"]}/ext_inc/fonts/arial.ttf\",$line_text);\n\t\t\t\t\t\t\n\t\n\t}\n\n\timagepng($image,$filename,\"100\");\n\n}", "function getSalesByProdCatXML($intYear, $catId, $forDataURL) {\n // Function to connect to the DB\n $link = connectToDB();\n\n\t$strSQL = \"SELECT g.CategoryName,p.ProductName,ROUND(SUM(d.Quantity),0) as Quantity, ROUND(SUM(d.Quantity*p.UnitPrice),0) As Total FROM FC_Categories as g, FC_Products as p, FC_Orders as o, FC_OrderDetails as d WHERE year(o.OrderDate)=\" . $intYear . \" and g.CategoryID=\" . $catId . \" and d.ProductID=p.ProductID and g.CategoryID=p.CategoryID and o.OrderID=d.OrderID GROUP BY g.CategoryName,p.ProductName\";\n $result = mysql_query($strSQL) or die(mysql_error());\n\n\t//Initialize <categories> element\n\t$strCat = \"<categories>\";\n\t\n\t//Initialize datasets\n\t$strAmtDS = \"<dataset seriesname='Revenue'>\";\n\t$strQtyDS = \"<dataset seriesName='Quantity' parentYAxis='S'>\";\n\t\n\t//Iterate through each data row\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n //Product Names are long - so show 8 characters and ... and show full thing in tooltip\n if (strlen($ors['ProductName'])>8)\n $shortName = escapeXML(substr($ors['ProductName'],0,8) . \"...\",$forDataURL);\n else\n $shortName = escapeXML($ors['ProductName'],$forDataURL);\n $strCat .= \"<category label='\" . $shortName . \"' toolText='\" . escapeXML($ors['ProductName'],$forDataURL) . \"'/>\";\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' />\";\n $strQtyDS .= \"<set value='\" . $ors['Quantity'] . \"'/>\";\n }\n }\n mysql_close($link);\n\n //Closing elements\n\t$strCat .= \"</categories>\";\n\t$strAmtDS .= \"</dataset>\";\n\t$strQtyDS .= \"</dataset>\";\n\t//Entire XML - concatenation\n\t$strXML = $strCat . $strAmtDS . $strQtyDS;\n\t\n\treturn $strXML;\n}", "public function svg() {\n\t\t// Calcul des coordonnées des points.\n\t\t$this->computePoints();\n\t\t// Récupération des points.\n\t\t$A = $this->A;\n\t\t$B = $this->B;\n\t\t$C = $this->C;\n\t\t$D = $this->D;\n\t\t$H = $this->H;\n\t\t$E = $this->E;\n\t\t$G = $this->G;\n\t\t$F = $this->F;\n\t\t$I = $this->I;\n\t\t$J = $this->J;\n\t\t$K = $this->K;\n\t\t$J1 = $this->J1;\n\t\t$J2 = $this->J2;\n\t\t// Dessin au format SVG.\n\t\t$couleurV = $this->colorV;\n\t\t$couleurY = $this->colorY;\n\t\t$couleurGauche = $this->colorLeft;\n\t\t$couleurDroite = $this->colorRight;\n\t\t$svg = '<?xml version=\"1.0\" standalone=\"no\"?><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">';\n\t\t$svg .= '<svg width=\"'.$this->xmax.'\" height=\"'.$this->ymax.'\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">';\n\t\t$svg .= '<title>logo'.($this->name != \"\" ? '-'.$this->name : '').'</title>';\n\t\t// Intérieur gauche.\n\t\t$svg .= '<polygon points=\"'.$E.' '.$F.' '.$K.'\" style=\"fill:'.$couleurGauche.'; stroke:'.$couleurGauche.'; stroke-width:0.5; stroke-linejoin:miter; stroke-miterlimit:5;\"/>';\n\t\t// Intérieur droit.\n\t\t$svg .= '<polygon points=\"'.$G.' '.$H.' '.$I.'\" style=\"fill:'.$couleurDroite.'; stroke:'.$couleurDroite.'; stroke-width:0.5; stroke-linejoin:miter; stroke-miterlimit:5;\"/>';\n\t\t// Y.\n\t\t$svg .= '<polygon points=\"'.$A.' '.$B.' '.$C.' '.$H.' '.$G.' '.$J1.' '.$J2.' '.$F.' '.$E.'\" style=\"fill:'.$couleurY.'; stroke:black; stroke-width:0.5; stroke-linejoin:miter; stroke-miterlimit:5;\"/>';\n\t\t// V.\n\t\t$svg .= '<polygon points=\"'.$A.' '.$E.' '.$J.' '.$H.' '.$C.' '.$D.'\" style=\"fill:'.$couleurV.'; stroke:black; stroke-width:0.5; stroke-linejoin:miter; stroke-miterlimit:5;\"/>';\n\t\t$svg .= '</svg>';\n\t\treturn $svg;\n\t}", "function responsive_woocommerce_product_elements_positioning() {\n\n\t\t// Default sections.\n\t\t$sections = array( 'title', 'price', 'ratings', 'short_desc', 'add_cart', 'category' );\n\n\t\t// Get sections from Customizer.\n\t\t$sections = get_theme_mod( 'responsive_woocommerce_product_elements_positioning', $sections );\n\n\t\t// Turn into array if string.\n\t\tif ( $sections && ! is_array( $sections ) ) {\n\t\t\t$sections = explode( ',', $sections );\n\t\t}\n\n\t\t// Apply filters for easy modification.\n\t\t$sections = apply_filters( 'responsive_woocommerce_product_elements_positioning', $sections );\n\n\t\t// Return sections.\n\t\treturn $sections;\n\n\t}", "function getSalePerEmpXML($intYear, $howMany, $slicePies, $addJSLinks, $forDataURL) {\n\n\t$strXML =\"\";\n // Function to connect to the DB\n $link = connectToDB();\n\n $count = 0;\n\n //Retrieve the data\n $strSQL = \"SELECT e.LastName, e.EmployeeID, SUM(d.Quantity*p.UnitPrice) As Total FROM FC_Employees as e,FC_Orders as o, FC_OrderDetails as d, FC_Products as p WHERE YEAR(OrderDate)=\" . $intYear . \" and e.EmployeeID=o.EmployeeID and o.OrderID=d.OrderID and d.ProductID=p.ProductID GROUP BY e.LastName,e.EmployeeID ORDER BY Total DESC\";\n\tif ($howMany!=-1)\n\t\t$strSQL .= \" LIMIT \" . $howMany;\n\n $result = mysql_query($strSQL) or die(mysql_error());\n\n //Create the XML data document containing only data\n\t//We add the <chart> element in the calling function, depending on needs.\t\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n //Append the data\n $count++;\n\n //If link is to be added\n if ($addJSLinks)\n $strLink = \" link='javascript:updateChart(\" . $ors['EmployeeID'] . \");' \";\n else\n $strLink = \"\";\n\n //If top 2 employees, then sliced out\t\t\t\t\n if ($slicePies && ($count<3))\n $slicedOut=\"1\";\n else\n $slicedOut=\"0\";\n\n $strXML .= \"<set label='\" . escapeXML($ors['LastName'],$forDataURL) . \"' value='\" . $ors['Total'] . \"' isSliced='\" . $slicedOut . \"' \" . $strLink . \" />\";\n }\n }\n mysql_close($link);\n\n return $strXML;\n}", "public function getViewedProduct();", "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 getPrices() {\n // get available price information\n $pricesAsDom = $this->product->get(\"SupplyDetail/Price\");\n\n // get child nodes as array\n $pricesAsArray = array_map(array($this,'_childNodes2Array'), $pricesAsDom);\n return $pricesAsArray;\n }", "public function get_prices()\n\t{\n\t\t$product_price_old = 0;\n\t\t$product_price_sale = 0;\n\t\t$price = 0;\n\t\t$eco = 0;\n\t\t$taxes = 0;\n\t\t$dataoc = isset($this->request->post['dataoc']) ? $this->request->post['dataoc'] : '';\n\n\t\tif (!empty($dataoc)) {\n\t\t\t$dataoc = str_replace('&quot;', '\"', $dataoc);\n\t\t\t$json = @json_decode($dataoc, true);\n\t\t\t$product_quantity = isset($json['quantity']) ? $json['quantity'] : 0;\n\t\t\t$product_id_oc = isset($json['product_id_oc']) ? $json['product_id_oc'] : 0;\n\t\t\tif ($product_id_oc == 0) $product_id_oc = isset($json['_product_id_oc']) ? $json['_product_id_oc'] : 0;\n\n\t\t\t// get options\n\t\t\t$options = isset($json['option_oc']) ? $json['option_oc'] : array();\n\t\t\tforeach ($options as $key => $value) {\n\t\t\t\tif ($value == null || empty($value)) unset($options[$key]);\n\t\t\t}\n\n\t\t\t// get all options of product\n\t\t\t$options_temp = $this->get_options_oc($product_id_oc);\n\n\t\t\t// Calc price for ajax\n\t\t\tforeach ($options_temp as $value) {\n\t\t\t\tforeach ($options as $k => $option_val) {\n\t\t\t\t\tif ($k == $value['product_option_id']) {\n\t\t\t\t\t\tif ($value['type'] == 'checkbox' && is_array($option_val) && count($option_val) > 0) {\n\t\t\t\t\t\t\tforeach ($option_val as $val) {\n\t\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\t\t// calc price\n\t\t\t\t\t\t\t\t\tif ($val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ($value['type'] == 'radio' || $value['type'] == 'select') {\n\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\tif ($option_val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 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}\n\t\t\t\t\t\t// the others have not price, so don't need calc\n\t\t\t\t\t}\n\t\t\t\t\t// if not same -> return.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$product_prices = $this->get_product_price($product_id_oc, $product_quantity);\n\t\t\t$product_price_old = isset($product_prices['price_old']) ? $product_prices['price_old'] : 0;\n\t\t\t$product_price_sale = isset($product_prices['price_sale']) ? $product_prices['price_sale'] : 0;\n\t\t\t$enable_taxes = $this->config->get('tshirtecommerce_allow_taxes');\n\t\t\tif ($enable_taxes === null || $enable_taxes == 1) {\n\t\t\t\t$taxes = isset($product_prices['taxes']) ? $product_prices['taxes'] : 0;\n\t\t\t\t$eco = isset($product_prices['eco']) ? $product_prices['eco'] : 0;\n\t\t\t} else {\n\t\t\t\t$taxes = 0;\n\t\t\t\t$eco = 0;\n\t\t\t}\n\t\t\t\n\t\t} // do nothing when empty/blank\n\n\t\t// return price for ajax\n\t\techo @json_encode(array(\n\t\t\t'price' => $price, \n\t\t\t'price_old' => $product_price_old, \n\t\t\t'price_sale' => $product_price_sale, \n\t\t\t'taxes' => $taxes,\n\t\t\t'eco' => $eco\n\t\t));\n\t\treturn;\n\t}", "public function addCoordinates()\n {\n $this->bad_points = array();\n if (isset($this->coords) && $this->coords) {\n //do this in reverse order because the legend will otherwise be presented in reverse order\n for ($j=count($this->coords)-1; $j>=0; $j--) {\n\n //clear out previous loop's selection\n $size = \"\";\n $shape = \"\";\n $color = array();\n\n $title = ($this->coords[$j]['title']) ? stripslashes($this->coords[$j]['title']) : \"\";\n $size = ($this->coords[$j]['size']) ? $this->coords[$j]['size'] : 8;\n if ($this->_isResize() && $this->_download_factor > 1) {\n $size = $this->_download_factor*$size;\n }\n $shape = ($this->coords[$j]['shape']) ? $this->coords[$j]['shape'] : 'circle';\n if ($this->coords[$j]['color']) {\n $color = explode(\" \", $this->coords[$j]['color']);\n if (count($color) != 3) {\n $color = array();\n }\n }\n\n $data = trim($this->coords[$j]['data']);\n\n if ($data) {\n $this->_legend_required = true;\n $layer = ms_newLayerObj($this->map_obj);\n $layer->set(\"name\", \"layer_\".$j);\n $layer->set(\"status\", MS_ON);\n $layer->set(\"type\", MS_LAYER_POINT);\n $layer->set(\"tolerance\", 5);\n $layer->set(\"toleranceunits\", 6);\n $layer->setProjection(self::getProjection($this->default_projection));\n\n $class = ms_newClassObj($layer);\n if ($title != \"\") {\n $class->set(\"name\", $title);\n }\n\n $style = ms_newStyleObj($class);\n $style->set(\"symbolname\", $shape);\n $style->set(\"size\", $size);\n\n if (!empty($color)) {\n if (substr($shape, 0, 4) == 'open') {\n $style->color->setRGB($color[0], $color[1], $color[2]);\n } else {\n $style->color->setRGB($color[0], $color[1], $color[2]);\n $style->outlinecolor->setRGB(85, 85, 85);\n }\n } else {\n $style->outlinecolor->setRGB(0, 0, 0);\n }\n\n $style->set(\"width\", $this->_determineWidth());\n\n $new_shape = ms_newShapeObj(MS_SHAPE_POINT);\n $new_line = ms_newLineObj();\n\n $rows = explode(\"\\n\", self::removeEmptyLines($data)); //split the lines that have data\n $points = array(); //create an array to hold unique locations\n\n foreach ($rows as $row) {\n $coord_array = self::makeCoordinates($row);\n $coord = new \\stdClass();\n $coord->x = ($coord_array[1]) ? self::cleanCoord($coord_array[1]) : null;\n $coord->y = ($coord_array[0]) ? self::cleanCoord($coord_array[0]) : null;\n //only add point when data are good & a title\n if (self::checkOnEarth($coord) && !empty($title)) {\n if (!array_key_exists($coord->x.$coord->y, $points)) { //unique locations\n $new_point = ms_newPointObj();\n $new_point->setXY($coord->x, $coord->y);\n $new_line->add($new_point);\n $points[$coord->x.$coord->y] = array();\n }\n } else {\n $this->bad_points[] = stripslashes($this->coords[$j]['title'] . ' : ' . $row);\n }\n unset($coord);\n }\n\n unset($points);\n $new_shape->add($new_line);\n $layer->addFeature($new_shape);\n }\n }\n }\n }", "public function createPriceDiv($name, $description, $product_price, $priceOnly=false, $switchSequel=false,$quantity = 1.0){\r\n\r\n//\t\tif(empty($product_price)) return '';\r\n\r\n //The fallback, when this price is not configured\r\n if(empty($this->_priceConfig[$name])) $name = \"salesPrice\";\r\n if(is_array($product_price)){\r\n $price = $product_price[$name] ;\r\n } else {\r\n $price = $product_price;\r\n }\r\n $price = (float)$price;\r\n\t\t//This could be easily extended by product specific settings\r\n\t\tif(!empty($this->_priceConfig[$name][0])){\r\n\t\t\tif(!empty($price)){\r\n\t\t\t\t$vis = \"block\";\r\n $priceFormatted = $this->priceDisplay($price,0,(float)$quantity,false,$this->_priceConfig[$name][1] );\r\n\t\t\t} else {\r\n $priceFormatted = '';\r\n\t\t\t\t$vis = \"none\";\r\n\t\t\t}\r\n\t\t\tif($priceOnly){\r\n return $priceFormatted;\r\n\t\t\t}\r\n\t\t\t$descr = '';\r\n\t\t\tif($this->_priceConfig[$name][2]) $descr = $description;\r\n\r\n if(!$switchSequel){\r\n return '<div class=\"Price'.$name.'\" style=\"display : '.$vis.';\" >'.$descr.'<span class=\"Price'.$name.'\" >'.$priceFormatted.'</span></div>';\r\n } else {\r\n return '<div class=\"Price'.$name.'\" style=\"display : '.$vis.';\" ><span class=\"Price'.$name.'\" >'.$priceFormatted.'</span>'.$descr.'</div>';\r\n }\r\n\t\t}\r\n\t}", "public function cal_price_in_markup_margin(){\n\t\t$arr = $this->arr_product_items;\n\t\tif(isset($arr['unit_price']))\n\t\t\t$this->arr_product_items['unit_price'] = (float)$arr['unit_price'];\n\t\telse\n\t\t\t$this->arr_product_items['unit_price'] = 0;\n\n\t\tif(isset($arr['markup']))\n\t\t\t$this->arr_product_items['markup'] = (float)$arr['markup'];\n\t\telse\n\t\t\t$this->arr_product_items['markup'] = 0;\n\n\t\tif(isset($arr['margin']))\n\t\t\t$this->arr_product_items['margin'] = (float)$arr['margin'];\n\t\telse\n\t\t\t$this->arr_product_items['margin'] = 0;\n\n\t\tif(isset($arr['discount']))\n\t\t\t$this->arr_product_items['discount'] = (float)$arr['discount'];\n\t\telse\n\t\t\t$this->arr_product_items['discount'] = 0;\n\n\t\tif(isset($arr['quantity']))\n\t\t\t$this->arr_product_items['quantity'] = (float)$arr['quantity'];\n\t\telse\n\t\t\t$this->arr_product_items['quantity'] = 0;\n\n\t\t$arr = $this->arr_product_items;\n\t\t$more_markup = $arr['unit_price']*($arr['markup']/100);\n\t\t$more_margin = $arr['unit_price']*($arr['margin']/100);\n\t\t$more_discount = $arr['unit_price']*($arr['discount']/100);\n\t\t$this->arr_product_items['sub_total'] = ($arr['unit_price'] + $more_markup + $more_margin - $more_discount)*$arr['quantity'];\n\t\t//return $this->arr_product_items;\n\t}", "public function shapeString() : string\n {\n return (string) $this->m . ' x ' . (string) $this->n;\n }", "public function draw()\n {\n //Skip calculations; dummy result after calculating points\n $points = [\n [\"x\" => '0', \"y\" => '0'],\n [\"x\" => '10', \"y\" => '0'],\n [\"x\" => '0', \"y\" => '10'],\n [\"x\" => '10', \"y\" => '10']\n ];\n\n if ($this->format instanceof \\GraphicEditor\\Formats\\Points) {\n $this->format->addPoints($points);\n }\n }", "public function getTaxedPrice();", "public function ex_points(){\r\n $maps['is_on_sale'] = 1;\r\n $maps['type'] = 0;\r\n $info = D('goods')->where($maps)->select();\r\n // var_dump($info);die;\r\n $mapps['is_forbid'] = 0;\r\n $r = D('store')->where($mapps)->select();\r\n $this->assign('r',$r);\r\n $this->assign('info',$info);\r\n $this->display();\r\n }", "public function getHTML()\n\t{\n\t\tglobal $tpl;\n\t\t\n\t\tinclude_once \"Services/jQuery/classes/class.iljQueryUtil.php\";\n\t\tiljQueryUtil::initjQuery();\n\t\t\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/excanvas.min.js\");\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/jquery.flot.min.js\");\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/jquery.flot.pie.js\");\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/jquery.flot.highlighter.js\");\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/jquery.flot.spider.js\");\n\n\t\t$chart = new ilTemplate(\"tpl.grid.html\", true, true, \"Services/Chart\");\n\t\t$chart->setVariable(\"ID\", $this->id);\n\t\t$chart->setVariable(\"WIDTH\", $this->width);\n\t\t$chart->setVariable(\"HEIGHT\", $this->height);\n\t\n\t\t$last = array_keys($this->data);\n\t\t$last = array_pop($last);\n\t\t$has_pie = false;\n\t\t$has_spider = false;\n\t\tforeach($this->data as $idx => $series)\n\t\t{\n\t\t\t$fill = $series->getFill();\n\t\t\t\n\t\t\tif ($series->getType() == \"spider\")\n\t\t\t{\n\t\t\t\t$has_spider = true;\n\t\t\t\t\n\t\t\t\tif ($fill[\"color\"] != \"\")\n\t\t\t\t{\n\t\t\t\t\t$chart->setCurrentBlock(\"series_property\");\n\t\t\t\t\t$chart->setVariable(\"SPROP\", \"color\");\n\t\t\t\t\t$chart->setVariable(\"SPROP_VAL\", self::renderColor($fill[\"color\"] , \"0.5\"));\n\t\t\t\t\t$chart->parseCurrentBlock();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$chart->setCurrentBlock(\"series\");\n\t\t\t$chart->setVariable(\"SERIES_LABEL\", str_replace(\"\\\"\", \"\\\\\\\"\", $series->getLabel()));\n\t\t\t$chart->setVariable(\"SERIES_TYPE\", $series->getType());\n\n\t\t\t$type = $series->getType();\n\n\t\t\t$points = array();\n\t\t\tif($type != \"pie\")\n\t\t\t{\n\t\t\t\tforeach($series->getData() as $point)\n\t\t\t\t{\n\t\t\t\t\t$points[] = \"[\".$point[0].\",\".$point[1].\"]\";\n\t\t\t\t}\n\t\t\t\t$chart->setVariable(\"SERIES_DATA\", \"[ \".implode(\",\", $points).\" ]\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$has_pie = true;\n\t\t\t\t$chart->setVariable(\"SERIES_DATA\", array_pop($series->getData()));\n\t\t\t}\n\t\t\tif($idx != $last)\n\t\t\t{\n\t\t\t\t$chart->setVariable(\"SERIES_END\", \",\");\n\t\t\t}\n\n\t\t\t$options = array(\"show: \".($series->isHidden() ? \"false\" : \"true\"));\n\t\t\tif($type != \"points\")\n\t\t\t{\n\t\t\t\t$width = $series->getLineWidth();\n\t\t\t\tif($width !== null)\n\t\t\t\t{\n\t\t\t\t\t$options[] = \"lineWidth:\".$width;\n\t\t\t\t}\n\t\t\t\tif($type == \"bars\")\n\t\t\t\t{\n\t\t\t\t\t$bar_options = $series->getBarOptions();\n\t\t\t\t\tif($bar_options[\"width\"] !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$options[] = \"barWidth:\".str_replace(\",\", \".\", $bar_options[\"width\"]);\n\t\t\t\t\t\t$options[] = \"align: \\\"\".$bar_options[\"align\"].\"\\\"\";\n\t\t\t\t\t\tif($bar_options[\"horizontal\"])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$options[] = \"horizontal: true\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if($type == \"lines\")\n\t\t\t\t{\n\t\t\t\t\tif($series->getLineSteps())\n\t\t\t\t\t{\n\t\t\t\t\t\t$options[] = \"steps: true\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$radius = $series->getPointRadius();\n\t\t\t\tif($radius !== null)\n\t\t\t\t{\n\t\t\t\t\t$options[] = \"radius:\".$radius;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($fill[\"fill\"])\n\t\t\t{\n\t\t\t\t$options[] = \"fill: \".$fill[\"fill\"];\n\t\t\t\tif($fill[\"color\"])\n\t\t\t\t{\n\t\t\t\t\t$options[] = \"fillColor: \".self::renderColor($fill[\"color\"], $fill[\"fill\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$chart->setVariable(\"SERIES_OPTIONS\", implode(\", \", $options));\n\n\t\t\t$chart->parseCurrentBlock();\n\t\t}\n\n\t\tif ($has_spider)\n\t\t{\n\t\t\t$chart->setCurrentBlock(\"spider\");\n\t\t\t$lab_strings = array();\n\t\t\tforeach ($this->getLegLabels() as $l)\n\t\t\t{\n\t\t\t\t$lab_strings[] = \"{label: \\\"\".$l.\"\\\"}\";\n\t\t\t}\n\t\t\t$chart->setVariable(\"LEG_LABELS\", implode($lab_strings, \",\"));\n\t\t\t$chart->setVariable(\"LEG_MAX\", $this->getYAxisMax());\n\t\t\t$chart->parseCurrentBlock();\n\t\t\t\n\t\t\t$chart->setCurrentBlock(\"spider_grid_options\");\n\t\t\t$chart->setVariable(\"NR_TICKS\", $this->getYAxisMax());\n\t\t\t$chart->parseCurrentBlock();\n\t\t}\n\t\t\n\t\t// global options\n\n\t\t$chart->setVariable(\"SHADOW\", (int)$this->getShadow());\n\t\t$chart->setVariable(\"IS_PIE\", ($has_pie ? \"true\" : \"false\"));\n\t\t\n\t\t$colors = $this->getColors();\n\t\tif($colors)\n\t\t{\n\t\t\t$tmp = array();\n\t\t\tforeach($colors as $color)\n\t\t\t{\n\t\t\t\t$tmp[] = self::renderColor($color);\n\t\t\t}\n\t\t}\n\t\tif(sizeof($tmp))\n\t\t{\n\t\t\t$chart->setVariable(\"COLORS\", implode(\",\", $tmp));\n\t\t}\n\n\t\t// legend\n\t\tif(!$this->legend)\n\t\t{\n\t\t\t$chart->setVariable(\"LEGEND\", \"show: false\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$margin = $this->legend->getMargin();\n\t\t\t$legend = array();\n\t\t\t$legend[] = \"show: true\";\n\t\t\t$legend[] = \"noColumns: \".$this->legend->getColumns();\n\t\t\t$legend[] = \"position: \\\"\".$this->legend->getPosition().\"\\\"\";\n\t\t\t$legend[] = \"margin: [\".$margin[\"x\"].\", \".$margin[\"y\"].\"]\";\n\t\t\t$legend[] = \"backgroundColor: \".self::renderColor($this->legend->getBackground());\n\t\t\t$legend[] = \"backgroundOpacity: \".str_replace(\",\",\".\",$this->legend->getOpacity());\n\t\t\t$legend[] = \"labelBoxBorderColor: \".self::renderColor($this->legend->getLabelBorder());\n\n\t\t\t$chart->setVariable(\"LEGEND\", implode(\", \", $legend));\n\t\t}\n\n\t\t// axis/ticks\n\t\t$tmp = array();\n\t\t$ticks = $this->getTicks();\n\t\tif($ticks)\n\t\t{\t\t\t\n\t\t\tforeach($ticks as $axis => $def)\n\t\t\t{\n\t\t\t\tif(is_numeric($def))\n\t\t\t\t{\n\t\t\t\t\t$tmp[$axis] = $axis.\"axis: { ticks: \".$def.\" }\";\n\t\t\t\t}\n\t\t\t\telse if(is_array($def))\n\t\t\t\t{\n\t\t\t\t\t$ttmp = array();\n\t\t\t\t\tforeach($def as $idx => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($ticks[\"labeled\"])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ttmp[] = \"[\".$idx.\", \\\"\".$value.\"\\\"]\";\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$ttmp[] = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$tmp[$axis] = $axis.\"axis: { ticks: [\".implode(\", \", $ttmp).\"] }\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// optional: remove decimals\n\t if(!isset($tmp[\"x\"]) && $this->integer_axis[\"x\"])\n\t\t{\n\t\t\t$tmp[\"x\"] = \"xaxis: { tickDecimals: 0 }\";\n\t\t}\n\t\tif(!isset($tmp[\"y\"]) && $this->integer_axis[\"y\"])\n\t\t{\n\t\t\t$tmp[\"y\"] = \"yaxis: { tickDecimals: 0 }\";\n\t\t}\t\t\n\t\t\n\t\tif(sizeof($tmp))\n\t\t{\n\t\t\t$chart->setVariable(\"AXIS\", \",\".implode(\", \", $tmp));\n\t\t}\n\t\t\n\t\t$ret = $chart->get();\n//echo htmlentities($ret);\n\t\treturn $ret;\n\t}", "function create_img_piegraph($graph_img_name, $serie1, $serie2, $first_show_countries, $total_differents_countries) {\r\n\tif ($gdv = gdVersion()) {\r\n\t\tif ($gdv >=2) { // TrueColor functions may be used.\r\n\t\t\t$GD_ver = 'TrueColor';\r\n\t\t} else { // Avoid the TrueColor functions.\r\n\t\t\t$GD_ver = 'NOT_TrueColor';\r\n\t\t}\r\n\t} else { // The GD extension isn't loaded.\r\n\t\t$GD_ver = 'NOT_loaded';\r\n\t}\r\n\r\n\tif ($GD_ver == 'TrueColor' && $total_differents_countries > 0) {\r\n\t\t\r\n\t\t$pChart_path = 'lib/pChart.1.27d_GD';\r\n\t\t// Standard inclusions\tv1.27\r\n\t\tinclude_once($pChart_path.'/pChart/pData.class');\r\n\t\tinclude_once($pChart_path.'/pChart/pChart.class');\r\n\t\t\r\n\t\t// Dataset definition \r\n\t\t$DataSet = new pData;\r\n\t\r\n\t\t$DataSet->AddPoint($serie1,\"Serie1\");\r\n\t\t$DataSet->AddPoint($serie2,\"Serie2\");\r\n\t\t\r\n\t\t$DataSet->AddAllSeries();\r\n\t\t$DataSet->SetAbsciseLabelSerie(\"Serie2\");\r\n\t\r\n\t\t// Initialise the graph\r\n\t\t$init_chart = new pChart(550,350);\r\n\t\t$init_chart->loadColorPalette($pChart_path.'/includes/tones-20c.txt'); // Ajouter pour le camenbert + de couleurs cycliques\r\n\t\t\r\n\t\t// Draw the pie chart\r\n\t\t$init_chart->setShadowProperties(0,0,200,200,200); // Ajouter\r\n\t\t$init_chart->setFontProperties($pChart_path.'/Fonts/tahoma.ttf',7);\r\n\t\t$init_chart->AntialiasQuality = 0;\r\n\t\t\r\n\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition hrz camenbert, position hte camenbert, diamètre, PIE_PERCENTAGE_LABEL, FALSE, perspective, hauteur camenbert, espace tranches\r\n\t\t//$init_chart->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),270,150,180,PIE_PERCENTAGE_LABEL,TRUE,50,20,5); //(org = TRUE,60,20,5);) --> pas mal TRUE,40,20,5);\r\n\t\t$init_chart->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),270,180,200,PIE_PERCENTAGE_LABEL,TRUE,50,20,5); // Monthly (note avec ,270,150,180 le titre ne s'affiche pas ?)\r\n\r\n\t\t//Graph TITLE\r\n\t\tif ($total_differents_countries > $first_show_countries) {\t\r\n\t\t\t$init_chart->setFontProperties($pChart_path.'/Fonts/tahoma.ttf',10); \r\n\t\t\t$init_chart->setShadowProperties(1,1,0,0,0); \r\n\t\t\t$init_chart->drawTitle(0,0,\"Top \".$first_show_countries.\" Countries\",0,0,0,550,50,TRUE);\r\n\t\t\t$init_chart->clearShadow(); \r\n\t\t}\r\n\t\r\n\t\t//Le répertoire cache n'est pas dans le pack d'install, car si update pour ne pas vider le cache du client\r\n\t\t$nbSlashes = substr_count($_SERVER['SCRIPT_NAME'], '/'); // on compte le nombre total de slashes contenu dans le lien relatif du fichier courant\r\n $nbSlashes --; // on ne compte pas le slash de la racine (placé au début du lien relatif)\r\n $remontee = ''; // on iniitialise la remontée dans l'arborescence\r\n for($i = 0; $i < $nbSlashes; $i++) {\r\n $remontee .= '../';\r\n }\r\n\r\n\t\tif (!is_dir('cache')) { // Note : dirname (__FILE__) gives the path of the thid file script \r\n\t\t\tmkdir ('cache');\r\n\t\t}\r\n\r\n\t\t$init_chart->Render(\"cache/\".$graph_img_name);\r\n\t}\r\n\t \r\n\treturn $graph_img_name;\r\n}", "private function getPrices () {\n\t\tlibxml_use_internal_errors(true);\n\t\n\t\t$dom = new DOMDocument();\n\n\t\t@$dom->loadHTML( $this->result );\n\t\t$xpath = new DOMXPath( $dom );\n\t\t\n\t\t$this->prices[] = array(\n\t\t\t'station.from' => $this->getPostField('from.searchTerm'),\n\t\t\t'station.to' => $this->getPostField('to.searchTerm'),\n\t\t\t'station.prices' => $xpath->query($this->config['lookupString'])\n\t\t);\n\t}", "public function test_dd_symbols()\n {\n $coord = \" 49.129774° 46.677716°\";\n $dd = \\SimpleMappr\\Mappr::makeCoordinates($coord);\n $this->assertEquals($dd[0], 49.129774);\n $this->assertEquals($dd[1], 46.677716);\n }", "function getInventoryByProdXML($catName, $forDataURL) {\n // Function to connect to the DB\n $link = connectToDB();\n\n\t$strSQL = \"SELECT p.ProductName,ROUND((SUM(p.UnitsInStock)),0) as Quantity , ROUND((SUM(p.UnitsInStock*p.UnitPrice)),0) as Total from FC_Categories as c , FC_Products as p WHERE c.CategoryID=p.CategoryID and c.CategoryName='\" . $catName . \"' GROUP BY p.ProductName Having SUM(p.UnitsInStock)>0\";\n $result = mysql_query($strSQL) or die(mysql_error());\n\n\t//Initialize <categories> element\n\t$strCat = \"<categories>\";\n\t\n\t//Initialize datasets\n\t$strAmtDS = \"<dataset seriesname='Cost of Inventory'>\";\n\t$strQtyDS = \"<dataset seriesName='Quantity' parentYAxis='S'>\";\n\t\t\n\t//Iterate through each data row\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n //Product Names are long - so show 8 characters and ... and show full thing in tooltip\n if (strlen($ors['ProductName'])>8)\n $shortName = escapeXML(substr($ors['ProductName'],0,8) . \"...\",$forDataURL);\n else\n $shortName = escapeXML($ors['ProductName'],$forDataURL);\n\n $strCat .= \"<category label='\" . $shortName . \"' toolText='\" . escapeXML($ors['ProductName'],$forDataURL) . \"'/>\";\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' />\";\n $strQtyDS .= \"<set value='\" . $ors['Quantity'] . \"'/>\";\n }\n }\n mysql_close($link);\n\n //Closing elements\n\t$strCat .= \"</categories>\";\n\t$strAmtDS .= \"</dataset>\";\n\t$strQtyDS .= \"</dataset>\";\n\t//Entire XML - concatenation\n\t$strXML = $strCat . $strAmtDS . $strQtyDS;\n\t\n\treturn $strXML;\n}", "function _pointXY($point)\n {\n return array ('X' => $this->_pointX($point), 'Y' => $this->_pointY($point));\n }", "public function format() {\n\t\treturn elgg_echo('payments:price', [$this->getConvertedAmount(), $this->getCurrency()]);\n\t}", "function print_pie_chart()\n {\n \t$ChartDiameter = $this->ChartRadius*2;\n \t//determine graphic size\n $ChartWidth = $ChartDiameter + 20;\n $ChartHeight = $ChartDiameter + 20 + (($this->ChartFontHeight + 2) * count($this->ChartData));\n //determine total of all values\n $ChartTotal=0;\n foreach($this->ChartData as $Data) $ChartTotal += $Data[0];\n $ChartCenterX = $ChartDiameter/2 + 10;\n $ChartCenterY = $ChartDiameter/2 + 10;\n //set the content type\n header(\"Content-type: image/svg-xml\");\n //mark this as XML\n print('<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>' . \"\\n\");\n //Point to SVG DTD\n print('<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\"\t\"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">'.\"\\n\");\n //start SVG document, set size in \"user units\"\n print(\"<svg xml:space=\\\"preserve\\\" width=\\\"5in\\\" height=\\\"5in\\\" viewBox=\\\"0 0 $ChartWidth $ChartHeight\\\"\\n\\txmlns=\\\"http://www.w3.org/2000/svg\\\"\\n\\txmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\">\\n\");\n\t\t// define filters\n\t\tprint('<defs>'.\"\\n\");\n \tprint('<filter id=\"Shadow\" filterUnits=\"userSpaceOnUse\">'.\"\\n\");\n \tprint(' <!--Copyright 1999 Adobe Systems. You may copy, modify, and distribute this file, if you include this notice & do not charge for the distribution. This file is provided \"AS-IS\" without warranties of any kind, including any implied warranties.-->'.\"\\n\");\n \tprint('\t<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"4\" result=\"blur\"/>'.\"\\n\");\n print('\t<feOffset in=\"blur\" dx=\"4\" dy=\"4\" result=\"offsetBlurredAlpha\"/>'.\"\\n\");\n print('\t<feSpecularLighting in=\"blur\" surfaceScale=\"5\" specularConstant=\"0.9\" specularExponent=\"20\" lightColor=\"white\" result=\"specularOut\">'.\"\\n\");\n print('\t <feDistantLight azimuth=\"'.$this->lightSource.'\" elevation=\"'.$this->lightHeight.'\"/>'.\"\\n\");\n print('\t</feSpecularLighting>'.\"\\n\");\n print('\t<feComposite in=\"specularOut\" in2=\"SourceAlpha\" operator=\"in\" result=\"specularOut\"/>'.\"\\n\");\n print('\t<feComposite in=\"SourceGraphic\" in2=\"specularOut\" operator=\"arithmetic\" k1=\"0\" k2=\"1\" k3=\"1\" k4=\"0\" result=\"litPaint\"/>'.\"\\n\");\n print('\t<feMerge>'.\"\\n\");\n print('\t <feMergeNode in=\"offsetBlurredAlpha\"/>'.\"\\n\");\n print('\t\t<feMergeNode in=\"litPaint\"/>'.\"\\n\");\n print('\t</feMerge>'.\"\\n\");\n \tprint('</filter>'.\"\\n\");\n \tprint('<filter id=\"MyFilter\" filterUnits=\"userSpaceOnUse\">'.\"\\n\");\n \tprint(' <!--Copyright 1999 Adobe Systems. You may copy, modify, and distribute this file, if you include this notice & do not charge for the distribution. This file is provided \"AS-IS\" without warranties of any kind, including any implied warranties.-->'.\"\\n\");\n \tprint('\t<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"4\" result=\"blur\"/>'.\"\\n\");\n print('\t<!--<feOffset in=\"blur\" dx=\"4\" dy=\"4\" result=\"offsetBlurredAlpha\"/>-->'.\"\\n\");\n print('\t<feSpecularLighting in=\"blur\" surfaceScale=\"5\" specularConstant=\"0.9\" specularExponent=\"20\" lightColor=\"white\" result=\"specularOut\">'.\"\\n\");\n print('\t <feDistantLight azimuth=\"225\" elevation=\"30\"/>'.\"\\n\");\n print('\t</feSpecularLighting>'.\"\\n\");\n print('\t<feComposite in=\"specularOut\" in2=\"SourceAlpha\" operator=\"in\" result=\"specularOut\"/>'.\"\\n\");\n print('\t<feComposite in=\"SourceGraphic\" in2=\"specularOut\" operator=\"arithmetic\" k1=\"0\" k2=\"1\" k3=\"1\" k4=\"0\" result=\"litPaint\"/>'.\"\\n\");\n print('\t<feMerge>'.\"\\n\");\n print('\t <!--<feMergeNode in=\"offsetBlurredAlpha\"/>-->'.\"\\n\");\n print('\t\t<feMergeNode in=\"litPaint\"/>'.\"\\n\");\n print('\t</feMerge>'.\"\\n\");\n \tprint('</filter>'.\"\\n\");\n\t\tprint('</defs>'.\"\\n\");\n\n // make background rectangle\n print(\"\\t<rect x=\\\"0\\\" y=\\\"0\\\" width=\\\"$ChartWidth\\\" height=\\\"$ChartHeight\\\" style=\\\"fill:$this->colorBody\\\" />\");\n $Degrees = 0;\n $index = 0;\n\t\tprint(\"<g id=\\\"pie\\\" style=\\\"filter:url(#Shadow);\\\">\\n\");\n // draw border\n print(\"\\n\\n\\t<circle cx=\\\"\".($ChartCenterX-1).\"\\\" cy=\\\"\".($ChartCenterY-1).\"\\\" r=\\\"$this->ChartRadius\\\" style=\\\"fill:none; stroke:$this->colorBorder; stroke-width:$this->widthBorder;\\\" />\\n\");\n\t\t// draw each slice\n foreach($this->ChartData as $Label=>$Data)\n {\n $StartDegrees = round($Degrees);\n \t$Degrees += ($Data[0]/$ChartTotal)*360;\n \t$EndDegrees = round($Degrees);\n \t//$CurrentColor = $Value[($index++)%(count($this->colorSlice))];\n\t\t\t$CurrentColor = $Data[1];\n \tprint(\"\\n\\t<!--$Label: \".$Data[0].\" (of $ChartTotal) $StartDegrees to $EndDegrees degrees in $CurrentColor-->\\n\\t\");\n\t\t\tif(!is_null($Data[2])) print(\"<a xlink:href=\\\"\".$Data[2].\"\\\">\\n\\t\\t\");\n \tprint(\"<path d=\\\"\");\n \t//start at center of circle\n \tprint(\"M $ChartCenterX,$ChartCenterY \");\n \t//draw out to circle edge\n \tlist($ArcX, $ArcY) = $this->circle_point($StartDegrees, $ChartDiameter);\n \tprint(\"L \" . floor($ChartCenterX + $ArcX) . \",\" . floor($ChartCenterY + $ArcY) . \" \");\n \t//draw arc\n \tlist($ArcX, $ArcY) = $this->circle_point($EndDegrees, $ChartDiameter);\n \tprint(\"A $this->ChartRadius,$this->ChartRadius 0 0 1 \" .\n \tfloor($ChartCenterX + $ArcX) . \",\" .\n \tfloor($ChartCenterY + $ArcY) .\" \");\n \t//close polygon\n \tprint(\"Z\\\" \");\n \tprint(\"style=\\\"fill:$CurrentColor; stroke:$this->colorBorder; stroke-width:$this->widthPieSliceBorder;\\\"/>\");\n\t\t\tif(!is_null($Data[2])) print(\"\\n\\t</a>\");\n }\n\t\tprint(\"</g>\\n\");\n // draw legend\n $index=0;\n\t\tprint(\"<g id=\\\"legend\\\">\\n\");\n foreach($this->ChartData as $Label=>$Data)\n {\n //$CurrentColor = $this->colorSlice[$index%(count($this->colorSlice))];\n $CurrentColor = $Data[1];\n \t$BoxY = $ChartDiameter + 20 + (($index++)*($this->ChartFontHeight+2));\n \t$LabelY = $BoxY + $this->ChartFontHeight;\n \t//draw color box\n\t\t\tprint(\"\\n\\t\");\n\t\t\tif(!is_null($Data[2])) print(\"<a xlink:href=\\\"\".$Data[2].\"\\\">\\n\\t\\t\");\n \tprint(\"<ellipse cx=\\\"20\\\" cy=\\\"\".($BoxY+(.5)*$this->ChartFontHeight+1).\"\\\" rx=\\\"10\\\" ry=\\\"\".((.5)*$this->ChartFontHeight).\"\\\" style=\\\"fill:$CurrentColor; stroke:$this->colorBorder; stroke-width:$this->widthLegendColorBorder\\\" />\");\n\t\t\tif(!is_null($Data[2])) print(\"\\n\\t</a>\");\n \t//draw label\n\t\t\tprint(\"\\n\\t\");\n\t\t\t$percent = floor(($Data[0]/$ChartTotal)*100); \n\t\t\tif(!is_null($Data[2])) print(\"<a xlink:href=\\\"\".$Data[2].\"\\\">\\n\\t\\t\");\n \tprint(\"<text x=\\\"40\\\" y=\\\"$LabelY\\\" style=\\\"file:$this->colorText; font-size:$this->ChartFontHeight\\\">$Label: \".$Data[0].\" ($percent%)</text>\");\n\t\t\tif(!is_null($Data[2])) print(\"\\n\\t</a>\");\n }\n\t\tprint(\"</g>\\n\");\n //end SVG document\n print(\"\\n</svg>\\n\");\n\t\texit;\n }", "function calculate_gear_line_array ($i_G1){\r\n\t\t\t\t\t\tif ($i_G1!=0) {\r\n\t\t\t\t\t\t\t\t$rpm_value=0;\r\n\t\t\t\t\t\t\t\tglobal $motarray, $i_A, $eta_G, $eta_A, $r_dyn, $max_x_value;\r\n\t\t\t\t\t\t\t\tforeach ($motarray as &$motarray_value) {\r\n\t\t\t\t\t\t\t $v_gang=$rpm_value*0.377*$r_dyn/($i_A*$i_G1);\r\n\t\t\t\t\t\t\t if ($v_gang <= $max_x_value-1) {\r\n\t\t\t\t\t\t\t \t$F_gang=$motarray_value*$i_G1*$i_A*$eta_G*$eta_A/$r_dyn;\r\n\t\t\t\t\t\t\t\t \t \t$plot_data_gang[]=array('',$v_gang,$F_gang); \r\n\t\t\t\t\t\t\t\t \t \t$rpm_value=$rpm_value+500; // tbd Genauigkeit 100 rpm in motarray\r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t elseif ($v_gang > $max_x_value-1) { // this elseif gets the last value in array as v= 299km/h\r\n\t\t\t\t\t\t\t \t$vw1=($rpm_value-500)*0.377*$r_dyn/($i_A*$i_G1); // tbd Genauigkeit 100 rpm in motarray\r\n\t\t\t\t\t\t\t \t$vw2=$v_gang;\r\n\t\t\t\t\t\t\t\t\t $Fw1=$plot_data_gang[count($plot_data_gang)-1][2];\r\n\t\t\t\t\t\t\t\t\t $Fw2=$motarray_value*$i_G1*$i_A*$eta_G*$eta_A/$r_dyn;\r\n\t\t\t\t\t\t\t\t\t $m_w=($Fw2-$Fw1)/($vw2-$vw1);\r\n\t\t\t\t\t\t\t\t\t $Fw=$Fw1+((($max_x_value-1)-$vw1)*$m_w);\t\r\n\t\t\t\t\t\t\t\t\t //echo \"$i_G1, $Fw<br>\";\r\n\t\t\t\t\t\t\t\t\t $v_gang=$max_x_value-1; settype($v_gang, \"float\");\r\n\t\t\t\t\t\t\t\t\t $plot_data_gang[]=array('',$v_gang,$Fw);\r\n\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\t } \r\n\t\t\t\t\t\t\t else {\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\t\t} \r\n\t\t\t\t\t\t\t\treturn ($plot_data_gang);\r\n\t\t\t\t\t\t\t} else { return 0;};\r\n\t\t\t\t\t}", "function get_markup() \n\t{\n\t\t$n = count($this->coor);\n\n\t\tif ($n == 0) {\n\t\t\t# Range is special case\n\t\t\treturn $this->make_position( $this->latdeg_min, \n\t\t\t\t\t\t $this->londeg_min )\n\t\t\t . \" to \"\n\t\t\t . $this->make_position( $this->latdeg_max,\n\t\t\t\t\t\t $this->londeg_max );\n\t\t} elseif ($n == 2) {\n\t\t\treturn $this->coor[0].';'.\n\t\t\t $this->coor[1];\n\n\t\t} elseif ($n == 4) {\n\t\t\treturn $this->coor[0].'&deg;&nbsp;'.\n\t\t\t $this->coor[1].' '.\n\t\t\t $this->coor[2].'&deg;&nbsp;'.\n\t\t\t $this->coor[3];\n\n\t\t} elseif ($n == 6) {\n\t\t\treturn $this->coor[0].'&deg;'.\n\t\t\t $this->coor[1].'&prime;&nbsp;'.\n\t\t\t $this->coor[2].' '.\n\t\t\t $this->coor[3].'&deg;'.\n\t\t\t $this->coor[4].'&prime;&nbsp;'.\n\t\t\t $this->coor[5];\n\n\t\t} elseif ($n == 8) {\n\t\t\treturn $this->coor[0].'&deg;'.\n\t\t\t $this->coor[1].'&prime;'.\n\t\t\t $this->coor[2].'&Prime;&nbsp;'.\n\t\t\t $this->coor[3].' '.\n\t\t\t $this->coor[4].'&deg;'.\n\t\t\t $this->coor[5].'&prime;'.\n\t\t\t $this->coor[6].'&Prime;&nbsp;'.\n\t\t\t $this->coor[7];\n\t\t} else {\n\t\t\treturn $this->get_error();\n\t\t}\n\t}", "public function wktGenerateGeometry();" ]
[ "0.5706712", "0.5511237", "0.5510589", "0.5443353", "0.54194796", "0.53943783", "0.5340442", "0.53276503", "0.5318903", "0.52887887", "0.5229765", "0.5181606", "0.5166354", "0.51449585", "0.51226646", "0.51155376", "0.5095597", "0.5092357", "0.50828147", "0.5054158", "0.5052926", "0.5045726", "0.50442857", "0.5013255", "0.5012708", "0.5002795", "0.49939293", "0.49822685", "0.49662358", "0.49613354", "0.4957693", "0.49523437", "0.4948771", "0.49405003", "0.4911976", "0.4904994", "0.49018642", "0.49005693", "0.4890374", "0.48837888", "0.48831165", "0.4879099", "0.4874903", "0.48683292", "0.4866795", "0.48610353", "0.48572844", "0.48515517", "0.4848691", "0.48474696", "0.4841665", "0.48411742", "0.4836454", "0.48351082", "0.4829997", "0.48286563", "0.48274273", "0.48268467", "0.4825232", "0.48185703", "0.48178703", "0.48172626", "0.48147175", "0.48102024", "0.4788787", "0.477814", "0.47752243", "0.47707096", "0.47704864", "0.4768447", "0.4764622", "0.4759632", "0.47410446", "0.47311905", "0.47292078", "0.47278413", "0.47272918", "0.47269908", "0.47227576", "0.47205415", "0.47195226", "0.47183505", "0.47124538", "0.4709083", "0.47080204", "0.47055042", "0.47036558", "0.47023854", "0.4701607", "0.4696506", "0.4693167", "0.46898824", "0.46887076", "0.46868414", "0.4681999", "0.46792653", "0.4679235", "0.4672932", "0.4672526", "0.4668818" ]
0.6910343
0
To know which fighters can be beaten
public function getBeatableFighters() { return $this->beatableFighters; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasFighting(){\r\n return $this->_has(22);\r\n }", "function scrapbots_fight ($duellers){\n\tdebug(\"Now duelling two ScrapBots\");\n\tdebug($army);\n\n\treturn $fighter;\n}", "public function hasFight(){\r\n return $this->_has(7);\r\n }", "function scrapbots_choose_fighter ($army){\n\tdebug(\"Choosing fighter, here is the army:\");\n\tdebug($army);\n\t//get a fighter at random\n\t$fighter = \"none\";\n\twhile ($fighter == \"none\"){\n\t\t$bot = e_rand(0,(count($army)-2));\n\t\tif (e_rand(1,100) < ($army[$bot]['briskness'] * 10)){\n\t\t\tdebug (\"Fighter Chosen:\");\n\t\t\t$fighter = $army[$bot];\n\t\t\tdebug ($fighter);\n\t\t} else {\n\t\tdebug(\"Fighter failed Briskness check. Choosing again.\");\n\t\t}\n\t}\n\treturn $fighter;\n}", "function scrapbots_battle($defenderid){\n\tglobal $session;\n\t$attackerid = $session['user']['acctid'];\n\t$armies = scrapbots_get_armies($defenderid, $attackerid);\n\t$duellers = scrapbots_pair_up_scrapbots ($armies);\n\treturn;\n}", "protected function getFighters()\n {\n return $this->championship->teams;\n }", "private function fight() {\n while(!$this->winner) {\n // Check current field conditions\n // Check abilities\n $this->playTurn();\n // End turn\n if($this->getNextFighter()->health <= 0) {\n $this->winner_fighter = $this->fighter_current;\n $this->winner = true;\n break;\n }\n $this->nextFighter();\n\n // $this->winner_fighter = $this->fighter_current;\n // $this->winner = true;\n }\n }", "public function fighter()\n {\n $playerIdActual = $this->Session->read('Auth.User.id');\n $fighterIdActual = $this->Session->read('Fighter.id');\n $playerActual = $this->User->findById($playerIdActual);\n $this->set('email', $playerActual['User']['email']);\n\n \n $this->set('fighterId',$fighterIdActual);\n \n $fightersActual = $this->Fighter->find('all',array(\n 'conditions' => array(\n 'Fighter.player_id' => $playerIdActual\n )\n ));\n \n \n $fightersUser = array();\n\n foreach($fightersActual as $fighter){\n $fightersUser[$fighter['Fighter']['id']] = $fighter['Fighter']['name'];\n \n \n }\n $this->set('fighterList',$fightersUser);\n \n \n $this->set('raw',$this->Fighter->find('all' , array('conditions'=> array(\n 'Fighter.player_id' => $playerIdActual\n )\n )\n ));\n \n //Si on demande la création d'un nouveau personnage.\n if($this->request->data('Fightercreate'))\n {\n $this->Fighter->generate($playerIdActual,$this->request->data['Fightercreate']['name']);\n \n //Création d'une nouvelle arme\n $dataTool = array();\n \n $random = rand(1,3);\n \n if($random == 1){\n $dataTool['type'] = 'strength';\n }\n Elseif($random == 2){\n $dataTool['type'] = 'sight';\n }\n Else {\n $dataTool['type'] = 'life';\n }\n \n $dataTool['bonus'] = rand(1,3);\n \n $this->Tool->add($dataTool);\n }\n \n //Si on demande la création d'un nouveau personnage.\n if($this->request->data('Fighterchoice'))\n {\n $this->Session->write('Fighter.id',$this->request->data['Fighterchoice']['fighter']);\n $fighterIdActual = $this->Session->read('Fighter.id');\n \n echo \"<script>window.location = window.location.href;</script>\"; \n }\n \n //Si on demande un nouvel avatar\n if($this->request->data('Fighternewavatar'))\n {\n /*debug($this->request->data['Playernewavatar']);\n $this->request->data->Player->id = '0c3ebe52-8024-11e5-96f5-5dcadefa4980';\n if(!$this->Player->save($this->request->data))\n {\n debug($this->Player->invalidFields()); die();\n }*/\n $this->Fighter->newAvatar($fighterIdActual, $this->request->data['Fighternewavatar']);\n \n }\n \n //Si c'est une action de newLevel\n if($this->request->data('Fighternewlevel'))\n {\n $message = $this->Fighter->increaseLevel($fighterIdActual, $this->request->data['Fighternewlevel']['skill']);\n $this->set(\"messages\",$message);\n } \n \n }", "function checkForSpecialAchievements($player_id, $wonder_included) {\n $achievements_to_test = $wonder_included ? array(105, 106, 107, 108, 109) : array(105, 106, 108, 109);\n $end_of_game = false;\n \n \n foreach ($achievements_to_test as $achievement_id) {\n $achievement = self::getCardInfo($achievement_id);\n if ($achievement['owner'] != 0) { // Somebody has already claimed that achievement\n // So it's not claimable anymore\n continue;\n }\n \n switch ($achievement_id) {\n case 105: // Empire: three or more icons of all six types\n $eligible = true;\n $ressource_counts = self::getPlayerRessourceCounts($player_id);\n foreach ($ressource_counts as $icon => $count) {\n if ($count < 3) { // There are less than 3 icons\n $eligible = false;\n break;\n }\n }\n break;\n case 106: // Monument: tuck 6 cards or score 6 cards\n $flags = self::getFlagsForMonument($player_id);\n $eligible = $flags['number_of_tucked_cards'] >= 6 || $flags['number_of_scored_cards'] >= 6;\n break;\n case 107: // Wonder: 5 colors, each being splayed right or up\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n if (self::getCurrentSplayDirection($player_id, $color) < 2) { // This color is missing, unsplayed or splayed left\n $eligible = false;\n };\n }\n break;\n case 108: // World: 12 or more visible clocks (icon 6) on the board \n $eligible = self::getPlayerSingleRessourceCount($player_id, 6) >= 12;\n break;\n case 109: // Universe: Five top cards, each being of value 8 or more\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n $top_card = self::getTopCardOnBoard($player_id, $color);\n if ($top_card === null || $top_card['age'] < 8) { // This color is missing or its top card has value less than 8\n $eligible = false;\n }\n }\n break;\n default:\n break;\n }\n \n if ($eligible) { // The player meet the conditions to achieve\n try {\n self::transferCardFromTo($achievement, $player_id, 'achievements');\n }\n catch (EndOfGame $e) { // End of game has been detected\n self::trace('EOG bubbled but suspended from self::checkForSpecialAchievements');\n $end_of_game = true;\n continue; // But the other achievements must be checked as well before ending\n }\n }\n }\n // All special achievements have been checked\n if ($end_of_game) { // End of game has been detected\n self::trace('EOG bubbled from self::checkForSpecialAchievements');\n throw $e; // Re-throw the flag\n }\n }", "public function remainingKnights()\n {\n return array_diff($this->guestList, $this->seated);\n }", "public function hasAttack(){\r\n return $this->_has(5);\r\n }", "function turnfight($expgain,$goldgain,$action,$addres) \n{\n global $player;\n global $smarty;\n global $db;\n global $title;\n global $enemy;\n global $myczaro;\n global $zmeczenie;\n global $arrEquip;\n global $myunik;\n global $amount;\n global $myagility;\n global $intPoisoned;\n global $arrTags;\n\n $arrEquip = $player -> equipment();\n $player->curstats($arrEquip);\n $myczaro = $db -> Execute(\"SELECT * FROM czary WHERE status='E' AND gracz=\".$player -> id.\" AND typ='O'\");\n $fight = $db -> Execute(\"SELECT fight FROM players WHERE id=\".$player -> id);\n\n $player->user = $arrTags[$player->tribe][0].' '.$player->user.' '.$arrTags[$player->tribe][1];\n\n if ($fight -> fields['fight'] == 0 && $title == 'Arena Walk') \n {\n\terror (NO_ENEMY);\n }\n $premia = 0;\n $zmeczenie = 0;\n if (empty ($enemy['id'])) \n {\n $location = $db -> Execute(\"SELECT miejsce FROM players WHERE id=\".$player -> id);\n if ($location -> fields['miejsce'] == 'Góry') \n {\n\t $intRoll2 = rand(1, 100);\n\t if ($intRoll2 < 25)\n\t {\n\t\t$enemy1 = $db->SelectLimit(\"SELECT * FROM `monsters` WHERE `level`<=\".$player->level.\" AND `location`='Altara' ORDER BY RAND()\", 1);\n\t }\n\t elseif ($intRoll2 > 24 && $intRoll2 < 90)\n\t {\n\t\t$enemy1 = $db->SelectLimit(\"SELECT * FROM `monsters` WHERE `level`<=\".$player->level.\" AND `location`='Altara' ORDER BY `level` DESC\", 1);\n\t }\n\t else\n\t {\n\t\t$enemy1 = $db->SelectLimit(\"SELECT * FROM `monsters` WHERE `level`>=\".$player->level.\" AND `location`='Altara' ORDER BY RAND()\", 1);\n\t }\n $enemy = array(\"strength\" => $enemy1 -> fields['strength'], \"agility\" => $enemy1 -> fields['agility'], \"speed\" => $enemy1 -> fields['speed'], \"endurance\" => $enemy1 -> fields['endurance'], \"hp\" => $enemy1 -> fields['hp'], \"name\" => $enemy1 -> fields['name'], \"exp1\" => $enemy1 -> fields['exp1'], \"exp2\" => $enemy1 -> fields['exp2'], \"level\" => $enemy1 -> fields['level']);\n $enemy1 -> Close();\n }\n if ($location -> fields['miejsce'] == 'Las') \n {\n\t $intRoll2 = rand(1, 100);\n\t if ($intRoll2 < 25)\n\t {\n\t\t$enemy1 = $db->SelectLimit(\"SELECT * FROM `monsters` WHERE `level`<=\".$player->level.\" AND `location`='Ardulith' ORDER BY RAND()\", 1);\n\t }\n\t elseif ($intRoll2 > 24 && $intRoll2 < 90)\n\t {\n\t\t$enemy1 = $db->SelectLimit(\"SELECT * FROM `monsters` WHERE `level`<=\".$player->level.\" AND `location`='Ardulith' ORDER BY `level` DESC\", 1);\n\t }\n\t else\n\t {\n\t\t$enemy1 = $db->SelectLimit(\"SELECT * FROM `monsters` WHERE `level`>=\".$player->level.\" AND `location`='Ardulith' ORDER BY RAND()\", 1);\n\t }\n $enemy = array(\"strength\" => $enemy1 -> fields['strength'], \"agility\" => $enemy1 -> fields['agility'], \"speed\" => $enemy1 -> fields['speed'], \"endurance\" => $enemy1 -> fields['endurance'], \"hp\" => $enemy1 -> fields['hp'], \"name\" => $enemy1 -> fields['name'], \"exp1\" => $enemy1 -> fields['exp1'], \"exp2\" => $enemy1 -> fields['exp2'], \"level\" => $enemy1 -> fields['level']);\n $enemy1 -> Close();\n }\n }\n if ($title == 'Arena Walk') \n {\n $arrClass = array('Wojownik','Rzemieślnik', 'Złodziej', 'Barbarzyńca');\n if (in_array($player -> clas, $arrClass) && $myczaro -> fields['id']) \n {\n error (ONLY_MAGE);\n }\n }\n if ($arrEquip[2][0]) \n {\n $premia = ($premia + $arrEquip[2][2]);\n }\n if ($arrEquip[4][0]) \n {\n $premia = ($premia + $arrEquip[4][2]);\n }\n if ($arrEquip[5][0]) \n {\n $premia = ($premia + $arrEquip[5][2]);\n }\n if ($arrEquip[3][0]) \n {\n $premia = ($premia + $arrEquip[3][2]);\n }\n if ($player -> clas == 'Wojownik' || $player -> clas == 'Barbarzyńca') \n {\n $enemy['damage'] = ($enemy['strength'] - ($player -> level + $player -> cond + $premia));\n } \n else \n {\n $enemy['damage'] = ($enemy['strength'] - ($player -> cond + $premia));\n }\n if ($myczaro -> fields['id']) \n {\n $myczarobr = ($player -> wisdom * $myczaro -> fields['obr']) - (($myczaro -> fields['obr'] * $player -> wisdom) * ($arrEquip[3][4] / 100));\n if ($arrEquip[2][0]) \n {\n $myczarobr = ($myczarobr - (($myczaro -> fields['obr'] * $player -> wisdom) * ($arrEquip[2][4] / 100)));\n }\n if ($arrEquip[4][0]) \n {\n $myczarobr = ($myczarobr - (($myczaro -> fields['obr'] * $player -> wisdom) * ($arrEquip[4][4] / 100)));\n }\n if ($arrEquip[5][0]) \n {\n $myczarobr = ($myczarobr - (($myczaro -> fields['obr'] * $player -> wisdom) * ($arrEquip[5][4] / 100)));\n }\n if ($arrEquip[7][0]) \n {\n $intN = 6 - (int)($arrEquip[7][4] / 20);\n $intBonus = (10 / $intN) * $player -> level * rand(1, $intN);\n $myczarobr = ($myczarobr + $intBonus);\n }\n if ($myczarobr < 0) \n {\n $myczarobr = 0;\n }\n $myobrona = ($myczarobr + $player -> cond + $premia);\n $enemy['damage'] = ($enemy['strength'] - $myobrona);\n }\n if (!$arrEquip[3][0] && !$myczaro -> fields['id']) \n {\n $enemy['damage'] = ($enemy['strength'] - $player -> cond);\n }\n $gmagia = 0;\n if (!isset($_SESSION['round']))\n {\n $_SESSION['round'] = 1;\n }\n $smarty -> assign (\"Message\", \"<ul><li><b>\".$player -> user.\"</b> \".VERSUS.\" <b>\".$enemy['name'].\"</b><br />\");\n $smarty -> display ('error1.tpl');\n /**\n * Count points in fight\n */\n if (!isset($_SESSION['points']) || $_SESSION['points'] == 0)\n {\n $_SESSION['points'] = ceil($player->speed / $enemy['speed']);\n }\n /**\n * Count dodge - player and monster\n */\n if ($player -> clas == 'Wojownik' || $player -> clas == 'Barbarzyńca') \n {\n $myunik = (($player->agility - $enemy['agility']) + $player -> level + $player -> miss);\n $eunik = (($enemy['agility'] - $player->agility) - ($player -> attack + $player -> level));\n\tif ($arrEquip[11][0])\n\t {\n\t $eunik -= ($player->attack / 5);\n\t }\n }\n if ($player -> clas == 'Rzemieślnik' || $player -> clas == 'Złodziej' || $player -> clas == '') \n {\n $myunik = ($player->agility - $enemy['agility'] + $player -> miss);\n $eunik = (($enemy['agility'] - $player->agility) - $player -> attack);\n }\n if ($player -> clas == 'Mag') \n {\n $myunik = ($player->agility - $enemy['agility'] + $player -> miss);\n $eunik = (($enemy['agility'] - $player->agility) - ($player -> magic + $player -> level));\n }\n if (!isset($myunik)) \n {\n $myunik = 1;\n }\n if (!isset($eunik)) \n {\n $eunit = 1;\n }\n if ($eunik < 1) \n {\n $eunik = 1;\n }\n if ($_SESSION['points'] > 5) \n {\n $_SESSION['points'] = 5;\n }\n if (isset ($_SESSION['exhaust'])) \n {\n $zmeczenie = $_SESSION['exhaust'];\n }\n if (isset($_SESSION['miss']) && $_SESSION['miss'] > $myunik) \n {\n $myunik = $_SESSION['miss'];\n }\n $amount = 1;\n if (isset ($_SESSION['razy'])) \n {\n $amount = $_SESSION['razy'];\n }\n if (isset($_SESSION['mon0'])) \n {\n $temp = 0;\n for ($k = 0; $k < $amount; $k ++) \n {\n $strIndex = \"mon\".$k;\n if ($_SESSION[$strIndex] > 0) \n {\n $temp = $temp + 1;\n }\n }\n }\n else\n {\n $temp = $amount;\n $_SESSION['amount'] = $amount;\n for ($k = 0; $k < $amount; $k ++) \n {\n $strIndex = \"mon\".$k;\n $_SESSION[$strIndex] = $enemy['hp'];\n }\n }\n if (isset($temp)) \n {\n if ($temp < 6 && $temp > 0)\n {\n if ($myunik < 1)\n {\n $myunik = 1;\n }\n if (isset($myunik))\n {\n $myunik = ceil($myunik / $temp);\n }\n else\n {\n $myunik = 0;\n }\n }\n else\n {\n $myunik = 1;\n }\n }\n else\n {\n if ($amount < 6)\n {\n if (isset($myunik))\n {\n $myunik = ceil($myunik / $amount);\n }\n else\n {\n $myunik = 0;\n }\n }\n else\n {\n $myunik = 1;\n }\n }\n if ($myunik < 1) \n {\n $myunik = 1;\n }\n $attacks = ceil($enemy['speed'] / $player->speed);\n if ($attacks > 5) \n {\n $attacks = 5;\n }\n if (!isset($_POST['action'])) \n {\n $_POST['action'] = '';\n }\n /**\n * If fight is longer than 24 rounds\n */\n if (isset($_SESSION['round']) && $_SESSION['round'] > 24)\n {\n $db -> Execute(\"UPDATE `players` SET `fight`=0, `hp`=\".$player -> hp.\", `bless`='', `blessval`=0 WHERE `id`=\".$player -> id);\n unset($_SESSION['exhaust'], $_SESSION['round'], $_SESSION['points'], $_SESSION['dodge']);\n for ($k = 0; $k < $amount; $k ++) \n {\n $strIndex = \"mon\".$k;\n unset($_SESSION[$strIndex]);\n }\n if ($title == 'Arena Walk') \n {\n if (!$intPoisoned)\n {\n $smarty -> assign (\"Message\", \"</ul>\".NOT_DECIDE.\"...<br /><ul><li><b>\".B_OPTIONS.\"</a><br /></li></ul>\");\n }\n else\n {\n $smarty -> assign (\"Message\", \"</ul><br /><ul><li><b>\".B_OPTIONS.\"</a><br /></li></ul>\");\n }\n $smarty -> display ('error1.tpl');\n }\n\telseif (in_array($title, array('Portal', 'Astralny plan')))\n\t {\n\t $db->Execute(\"UPDATE `players` SET `miejsce`='Altara' WHERE `id`=\".$player->id);\n\t }\n return;\n }\n $fight -> Close();\n if ($_POST['action'] == 'drink' && $_SESSION['points'] > 0) \n {\n $_SESSION['points'] = $_SESSION['points'] - 1;\n drink ($_POST['potion2']);\n $objMana = $db -> Execute(\"SELECT pm FROM players WHERE id=\".$player -> id);\n $player -> mana = $objMana -> fields['pm'];\n $objMana -> Close();\n if ($_SESSION['points'] >= $attacks && $player -> hp > 0) \n {\n fightmenu($_SESSION['points'],$zmeczenie,$_SESSION['round'],$addres);\n }\n }\n if ($_POST['action'] == 'use' && $_SESSION['points'] > 0) \n {\n $_SESSION['points'] = $_SESSION['points'] - 1;\n if (!isset($_POST['arrows']))\n {\n $_POST['arrows'] = 0;\n }\n equip ($_POST['arrows']);\n $arrEquip = $player -> equipment();\n if ($_SESSION['points'] >= $attacks) \n {\n fightmenu($_SESSION['points'],$zmeczenie,$_SESSION['round'],$addres);\n }\n }\n if ($_POST['action'] == 'weapons' && $_SESSION['points'] > 0) \n {\n $_SESSION['points'] = $_SESSION['points'] - 2;\n if (!isset($_POST['weapon']))\n {\n $_POST['weapon'] = 0;\n }\n equip ($_POST['weapon']);\n $arrEquip = $player -> equipment();\n if ($_SESSION['points'] >= $attacks) \n {\n fightmenu($_SESSION['points'],$zmeczenie,$_SESSION['round'],$addres);\n }\n }\n if ($_POST['action'] == 'escape') \n {\n $chance = (rand(1, $player -> level * 100) + $player -> speed - $enemy['agility']);\n if ($chance > 0) \n {\n $expgain = rand($enemy['exp1'],$enemy['exp2']);\n $expgain = (ceil($expgain / 100));\n $smarty -> assign (\"Message\", ESCAPE_SUCC.\" \".$enemy['name'].YOU_GAIN1.\" \".$expgain.\" \".EXP_PTS.\"<br /></li></ul>\");\n $smarty -> display ('error1.tpl');\n checkexp($player -> exp,$expgain,$player -> level,$player -> race,$player -> user,$player -> id,0,0,$player -> id,'',0);\n $db -> Execute(\"UPDATE players SET fight=0, bless='', blessval=0 WHERE id=\".$player -> id);\n $points = $attacks * 2;\n $temp = 1;\n unset($_SESSION['exhaust'], $_SESSION['round'], $_SESSION['points'], $_SESSION['dodge']);\n for ($k = 0; $k < $amount; $k ++) \n {\n $strIndex = \"mon\".$k;\n unset($_SESSION[$strIndex]);\n }\n if ($title == \"Arena Walk\") \n {\n $smarty -> assign (\"Message\", \"</ul><ul><li><b>\".B_OPTIONS.\"</a><br /></li></ul>\");\n $smarty -> display ('error1.tpl');\n }\n if ($title == 'Astralny plan' || $title == 'Portal')\n {\n $db -> Execute(\"UPDATE `players` SET `fight`=9999 WHERE id=\".$player -> id);\n }\n\t if ($title == 'Przygoda')\n\t {\n\t\t$db -> Execute(\"UPDATE `players` SET `fight`=-1 WHERE id=\".$player -> id);\n\t }\n } \n else \n {\n $smarty -> assign (\"Message\", \"<br />\".ESCAPE_FAIL.\" \".$enemy['name'].\"!\");\n $smarty -> display ('error1.tpl');\n monsterattack($attacks,$enemy,$myunik,$amount);\n if ($player -> hp > 0) \n {\n $_SESSION['round'] = $_SESSION['round'] + 1;\n $_SESSION['points'] = ceil($player->speed / $enemy['speed']);\n fightmenu($_SESSION['points'],$zmeczenie,$_SESSION['round'],$addres);\n }\n }\n }\n if ($_POST['action'] == 'cast' && $_SESSION['points'] > 0) \n {\n $_SESSION['points'] = $_SESSION['points'] - 1;\n if (!isset($_POST['castspell']))\n {\n $_POST['castspell'] = 0;\n }\n castspell($_POST['castspell'],0,$eunik);\n $temp = 0;\n for ($k=0;$k<$amount;$k++) \n {\n $strIndex = \"mon\".$k;\n if ($_SESSION[$strIndex] > 0) \n {\n $temp = $temp + 1;\n }\n }\n if ($temp > 0 && $attacks <= $_SESSION['points']) \n {\n fightmenu($_SESSION['points'],$zmeczenie,$_SESSION['round'],$addres);\n }\n }\n /**\n * Burst offensive spell\n */\n if ($_POST['action'] == 'bspell' && $_SESSION['points'] > 0) \n {\n if (intval($_POST['power']) < 1) \n {\n $smarty -> assign (\"Message\", ERROR);\n $smarty -> display ('error1.tpl');\n $_POST['power'] = 0;\n }\n else\n {\n if ($_POST['power'] > $player -> level)\n {\n $_POST['power'] = $player -> level;\n }\n\t checkvalue($_POST['bspellboost']);\n $intSpelllevel = $db -> Execute(\"SELECT `gracz, `poziom` FROM `czary` WHERE `id`=\".$_POST['bspellboost']);\n\t if ($intSpelllevel->fields['gracz'] != $player->id)\n\t {\n\t\t$intMaxburst = 0;\n\t }\n\t else\n\t {\n\t\t$intMaxburst = $player -> mana - $intSpelllevel -> fields['poziom'];\n\t }\n $intSpelllevel -> Close();\n if ($_POST['power'] > $intMaxburst)\n {\n $_POST['power'] = $intMaxburst;\n }\n $_SESSION['points'] = $_SESSION['points'] - 2;\n castspell($_POST['bspellboost'],$_POST['power'],$eunik);\n }\n $temp = 0;\n for ($k=0;$k<$amount;$k++) \n {\n $strIndex = \"mon\".$k;\n if ($_SESSION[$strIndex] > 0) \n {\n $temp = $temp + 1;\n }\n }\n if ($temp > 0 && $attacks <= $_SESSION['points']) \n {\n fightmenu($_SESSION['points'],$zmeczenie,$_SESSION['round'],$addres);\n }\n }\n /**\n * Burst defensive spell\n */\n if ($_POST['action'] == 'dspell') \n {\n if (intval($_POST['power1']) < 1) \n {\n $smarty -> assign (\"Message\", ERROR);\n $smarty -> display ('error1.tpl');\n $_POST['power1'] = 0;\n }\n if ($_POST['power1'] > $player -> level)\n {\n $_POST['power1'] = $player -> level;\n }\n $intMaxburst = $player -> mana - $myczaro -> fields['poziom'];\n if ($_POST['power1'] > $intMaxburst)\n {\n $_POST['power1'] = $intMaxburst;\n }\n $enemy['damage'] = $enemy['damage'] - $_POST['power1'];\n $player -> mana = $player -> mana - $_POST['power1'];\n monsterattack($attacks,$enemy,$myunik,$amount);\n if ($player -> hp > 0) \n {\n $_SESSION['round'] = $_SESSION['round'] + 1;\n $_SESSION['points'] = ceil($player->speed / $enemy['speed']);\n fightmenu($_SESSION['points'],$zmeczenie,$_SESSION['round'],$addres);\n }\n }\n if ($_POST['action'] == 'nattack' && $_SESSION['points'] > 0) \n {\n attack($eunik,0);\n $temp = 0;\n for ($k=0;$k<$amount;$k++) \n {\n $strIndex = \"mon\".$k;\n if ($_SESSION[$strIndex] > 0) \n {\n $temp = $temp + 1;\n }\n }\n $_SESSION['points'] = $_SESSION['points'] - 1;\n if ($temp > 0 && $attacks <= $_SESSION['points']) \n {\n fightmenu($_SESSION['points'],$zmeczenie,$_SESSION['round'],$addres);\n }\n }\n if ($_POST['action'] == 'dattack' && $_SESSION['points'] > 0) \n {\n $_SESSION['points'] = $_SESSION['points'] - 1;\n attack($eunik,3);\n $temp = 0;\n for ($k=0;$k<$amount;$k++) \n {\n $strIndex = \"mon\".$k;\n if ($_SESSION[$strIndex] > 0) \n {\n $temp = $temp + 1;\n }\n }\n $myunik = $myunik + ($myunik / 2);\n if ($temp > 0 && $attacks <= $_SESSION['points']) \n {\n fightmenu($_SESSION['points'],$zmeczenie,$_SESSION['round'],$addres);\n }\n }\n if ($_POST['action'] == 'aattack' && $_SESSION['points'] > 0) \n {\n $_SESSION['points'] = $_SESSION['points'] - 1;\n attack($eunik,1);\n $temp = 0;\n for ($k=0;$k<$amount;$k++) \n {\n $strIndex = \"mon\".$k;\n if ($_SESSION[$strIndex] > 0) \n {\n $temp = $temp + 1;\n }\n }\n $myunik = $myunik / 2;\n if ($temp > 0 && $attacks <= $_SESSION['points']) \n {\n fightmenu($_SESSION['points'],$zmeczenie,$_SESSION['round'],$addres);\n }\n }\n if ($_POST['action'] == 'battack' && $_SESSION['points'] > 0) \n {\n $_SESSION['points'] = $_SESSION['points'] - 2;\n attack($eunik,2);\n $temp = 0;\n for ($k=0;$k<$amount;$k++) \n {\n $strIndex = \"mon\".$k;\n if ($_SESSION[$strIndex] > 0) \n {\n $temp = $temp + 1;\n }\n }\n $myunik = 0;\n if ($temp > 0 && $attacks <= $_SESSION['points']) \n {\n fightmenu($_SESSION['points'],$zmeczenie,$_SESSION['round'],$addres);\n }\n }\n if (!isset($_SESSION['points']))\n {\n $_SESSION['points'] = 0;\n }\n if($attacks > $_SESSION['points'] && $temp > 0 && $_POST['action'] != 'rest' && $_POST['action'] != 'escape') \n {\n monsterattack($attacks,$enemy,$myunik,$amount);\n if ($player -> hp > 0) \n {\n $_SESSION['round'] = $_SESSION['round'] + 1;\n $_SESSION['points'] = ceil($player->speed / $enemy['speed']);\n if ($_SESSION['points'] > 5) \n {\n $_SESSION['points'] = 5;\n }\n fightmenu($_SESSION['points'],$zmeczenie,$_SESSION['round'],$addres);\n }\n }\n if ($_POST['action'] == 'rest') \n {\n monsterattack($attacks,$enemy,0,$amount);\n if ($player -> hp > 0) \n {\n $smarty -> assign (\"Message\", \"<br />\".REST_SUCC);\n $smarty -> display ('error1.tpl');\n $rest = ($player -> cond / 10);\n $zmeczenie = $zmeczenie - $rest;\n if ($zmeczenie < 0) \n {\n $zmeczenie = 0;\n }\n $_SESSION['exhaust'] = $zmeczenie;\n $_SESSION['round'] = $_SESSION['round'] + 1;\n $_SESSION['points'] = ceil($player->speed / $enemy['speed']);\n if ($_SESSION['points'] > 5) \n {\n $_SESSION['points'] = 5;\n }\n fightmenu($_SESSION['points'],$zmeczenie,$_SESSION['round'],$addres);\n }\n }\n if ($player -> hp <= 0) \n {\n if ($title != 'Arena Walk') \n\t {\n\t loststat($player -> id, $player->oldstats, 0, $enemy['name'], 0, $player->antidote);\n\t }\n\tif ($player->antidote == 'R')\n\t {\n\t $player->hp = 1;\n\t }\n if ($player -> hp < 0) \n {\n $player -> hp = 0;\n }\n\tif ($title == 'Przygoda')\n\t {\n\t $intFight = -1;\n\t }\n\telse\n\t {\n\t $intFight = 0;\n\t }\n $db -> Execute(\"INSERT INTO `events` (`text`) VALUES('Gracz \".$player -> user.\" \".DEFEATED_BY.$enemy['name'].\"')\");\n $db -> Execute(\"UPDATE `players` SET `fight`=\".$intFight.\", `hp`=\".$player -> hp.\", `bless`='', `blessval`=0, `antidote`='' WHERE `id`=\".$player -> id);\n unset($_SESSION['exhaust'], $_SESSION['round'], $_SESSION['points'], $_SESSION['dodge']);\n for ($k = 0; $k < $amount; $k ++) \n {\n $strIndex = \"mon\".$k;\n unset($_SESSION[$strIndex]);\n }\n if ($title == 'Arena Walk') \n {\n if (!$intPoisoned)\n {\n $smarty -> assign (\"Message\", \"</ul>\".LOST_FIGHT.\"...<br /><ul><li><b>\".B_OPTIONS.\"</a><br /></li></ul>\");\n }\n else\n {\n $smarty -> assign (\"Message\", \"</ul><br /><ul><li><b>\".B_OPTIONS.\"</a><br /></li></ul>\");\n }\n $smarty -> display ('error1.tpl');\n }\n }\n if (isset($_SESSION['points']))\n {\n $intPoints = $_SESSION['points'];\n }\n else\n {\n $intPoints = 0;\n }\n if (!$_POST['action'] && $attacks <= $intPoints) \n {\n fightmenu($_SESSION['points'],$zmeczenie,1,$addres);\n }\n if ($temp == 0 && $player -> fight > 0 && (isset($_SESSION['round']) && $_SESSION['round'] < 25)) \n {\n $db -> Execute(\"INSERT INTO `events` (`text`) VALUES('Gracz \".$player -> user.\" \".DEFEAT.\" \".$enemy['name'].\"')\");\n $db -> Execute(\"UPDATE `players` SET `credits`=`credits`+\".$goldgain.\" WHERE `id`=\".$player -> id);\n $smarty -> assign (\"Message\", \"<br /><li><b>\".YOU_DEFEAT.\" <b>\".$amount.\" \".$enemy['name'].\"</b>.\");\n $smarty -> display ('error1.tpl');\n $smarty -> assign (\"Message\", \"<li><b>\".REWARD.\" <b>\".$expgain.\"</b> \".EXP_PTS.\" \".AND_GAIN.\" <b>\".$goldgain.\"</b> \".COINS);\n $smarty -> display ('error1.tpl');\n\tmonsterloot($enemy['lootnames'], $enemy['lootchances'], $enemy['level'], $amount);\n\tbattlerecords($enemy['name'], $enemy['level'], $player->id);\n checkexp($player -> exp,$expgain,$player -> level,$player -> race,$player -> user,$player -> id,0,0,$player -> id,'',0);\n if ($player -> hp < 0) \n {\n $player -> hp = 0;\n }\n\tif (($player->hp > 0) && ($player->autodrink != 'N'))\n\t {\n\t if ($player->autodrink == 'A')\n\t {\n\t\tdrinkfew(0, 0, 'M');\n\t\tdrinkfew(0, 0, 'H');\n\t }\n\t else\n\t {\n\t\tdrinkfew(0, 0, $player->autodrink);\n\t }\n\t }\n if ($title == 'Arena Walk') \n {\n $smarty -> assign (\"Message\", \"</ul><ul><li><b>\".B_OPTIONS.\"</a><br /></li></ul>\");\n $smarty -> display ('error1.tpl');\n }\n $db -> Execute(\"UPDATE players SET hp=\".$player -> hp.\", fight=0, bless='', blessval=0 WHERE id=\".$player -> id);\n\tif (isset($_SESSION['razy']))\n\t {\n\t unset($_SESSION['razy']);\n\t }\n unset($_SESSION['exhaust'], $_SESSION['round'], $_SESSION['points'], $_SESSION['dodge']);\n for ($k = 0; $k < $amount; $k ++) \n {\n $strIndex = \"mon\".$k;\n unset($_SESSION[$strIndex]);\n }\n }\n $myczaro -> Close();\n}", "function zg_ai_find_players_to_debate($bot, $num = 99) {\n global $game;\n include drupal_get_path('module', 'zg') . '/includes/' . $game . '_defs.inc';\n $num = min($num, $bot->actions);\n\n // $debate_wait_time = 1200;\n // $zombie_debate_wait = 300;\n $sql = 'SELECT users.id, users.username, users.meta\n FROM users\n LEFT OUTER JOIN clan_members ON clan_members.fkey_users_id = users.id\n LEFT OUTER JOIN clans ON clan_members.fkey_clans_id = clans.id\n WHERE users.id <> %d\n AND (clans.id <> %d OR clans.id IS NULL OR users.meta = \"zombie\")\n AND username <> \"\"\n AND (debates_last_time < \"%s\" OR\n (users.meta = \"zombie\" AND debates_last_time < \"%s\"))\n AND users.meta NOT like \"ai_%\"\n AND users.level > %d\n AND users.level < %d\n ORDER BY abs(users.experience - %d) ASC\n LIMIT %d;';\n\n $result = db_query($sql, $bot->id, $bot->fkey_clans_id,\n date('Y-m-d H:i:s', REQUEST_TIME - $debate_time),\n date('Y-m-d H:i:s', REQUEST_TIME - $zombie_debate_wait),\n $bot->level - 15, $bot->level + 15, $bot->experience, $num);\n $data = [];\n while ($item = db_fetch_object($result)) {\n $data[] = $item;\n }\n return zg_ai_data_type($data);\n}", "public function sight()\n {\n \n $playerIdActual = $this->Session->read('Auth.User.id');\n $fighterIdActual = $this->Session->read('Fighter.id');\n $playerActual = $this->User->findById($playerIdActual);\n $this->set('email', $playerActual['User']['email']);\n \n $this->set('fighterId',$fighterIdActual);\n\n $currentFighter = $this->Fighter->find('first' , array('conditions'=> array(\n 'Fighter.id' => $fighterIdActual\n )\n )\n );\n \n $fightersUser = array();\n \n $fightersActual = $this->Fighter->find('all',array(\n 'conditions' => array(\n 'Fighter.player_id' => $playerIdActual\n )\n ));\n \n foreach($fightersActual as $fighter){\n $fightersUser[$fighter['Fighter']['id']] = $fighter['Fighter']['name'];\n \n \n }\n $this->set('fighterList',$fightersUser);\n \n $this->set('raw',$currentFighter);\n \n $this->set('othersFighters',$this->Fighter->find('all' , array('conditions'=> array(\n 'Fighter.coordinate_x <' => $currentFighter['Fighter']['coordinate_x'] + $currentFighter['Fighter']['skill_sight'],\n 'Fighter.coordinate_x >' => $currentFighter['Fighter']['coordinate_x'] - $currentFighter['Fighter']['skill_sight'],\n 'Fighter.coordinate_y <' => $currentFighter['Fighter']['coordinate_y'] + $currentFighter['Fighter']['skill_sight'],\n 'Fighter.coordinate_y >' => $currentFighter['Fighter']['coordinate_y'] - $currentFighter['Fighter']['skill_sight'],\n 'Fighter.id !=' => $fighterIdActual\n )\n )\n ));\n \n //Si on demande la création d'un nouveau personnage.\n if($this->request->data('Fightercreate'))\n {\n $this->Fighter->generate($playerIdActual,$this->request->data['Fightercreate']['name']);\n \n //Création d'un nouveau Tool\n $dataTool = array();\n \n $random = rand(1,4);\n \n if($random == 1){\n $dataTool['type'] = 'strength';\n }\n Elseif($random == 2){\n $dataTool['type'] = 'sight';\n }\n Elseif($random == 3) {\n $dataTool['type'] = 'health';\n }\n Else {\n $dataTool['type'] = 'lifePoints';\n }\n \n $dataTool['bonus'] = rand(1,3);\n \n $this->Tool->add($dataTool);\n }\n \n //Si on demande la création d'un nouveau personnage.\n if($this->request->data('Fighterchoice'))\n {\n $this->Session->write('Fighter.id',$this->request->data['Fighterchoice']['fighter']);\n $fighterIdActual = $this->Session->read('Fighter.id');\n echo \"<script>window.location = window.location.href;</script>\"; \n }\n \n //Si on demande un nouvel avatar\n if($this->request->data('Fighternewavatar'))\n {\n /*debug($this->request->data['Playernewavatar']);\n $this->request->data->Player->id = '0c3ebe52-8024-11e5-96f5-5dcadefa4980';\n if(!$this->Player->save($this->request->data))\n {\n debug($this->Player->invalidFields()); die();\n }*/\n $this->Fighter->newAvatar($fighterIdActual, $this->request->data['Fighternewavatar']);\n \n }\n \n //Si c'est une action de mouvement\n if($this->request->data('Fightermove'))\n {\n $message = $this->Fighter->doMove($fighterIdActual, $this->request->data['Fightermove']['direction']);\n $this->set('messages',$message);\n \n }\n \n //Si c'est une action d'attaque\n Elseif($this->request->data('Fighterattack'))\n {\n $message = $this->Fighter->doAttack($fighterIdActual, $this->request->data['Fighterattack']['direction']);\n \n $this->set('messages',$message);\n\n }\n \n //Affichage des données \n $this->set('name', $currentFighter['Fighter']['name']);\n $this->set('level', $currentFighter['Fighter']['level']);\n $this->set('xp', $currentFighter['Fighter']['xp']);\n $this->set('coordinate_x', $currentFighter['Fighter']['coordinate_x']);\n $this->set('coordinate_y', $currentFighter['Fighter']['coordinate_y']);\n $this->set('force', $currentFighter['Fighter']['skill_strength']);\n $this->set('vision', $currentFighter['Fighter']['skill_sight']);\n $this->set('vieMax', $currentFighter['Fighter']['skill_health']);\n $this->set('vieActuelle', $currentFighter['Fighter']['current_health']);\n\n //Affichage des informations utilisateur\n $this->set('email', $this->Session->read('Auth.User.email'));\n\n\n\n }", "function addANewFighter($arg, $playerIdLogin) {\n //TODO: get the fighter to automatically start level 1, with all skills at 1 and health at maximum (10?)\n //TODO: X and Y position must be decided when the fighter joins the arena\n $fighterData = $arg;\n $fighterTable = TableRegistry::get('fighters');\n $fighter = $fighterTable->newEntity();\n $fighter->name = $fighterData['name'];\n $fighter->player_id = $playerIdLogin;\n\n $fighters = $this->find('all');\n $fightersArray = $fighters->toArray();\n\n $restart = 1;\n\n while ($restart == 1) {\n\n $randX = rand(0, 14);\n $randY = rand(0, 9);\n $restart = 0;\n\n for ($i = 0; $i < count($fightersArray); $i++) {\n if (($fightersArray[$i]['coordinate_x'] == $randX) && ($fightersArray[$i]['coordinate_y'] == $randY)) {\n $restart = 1;\n }\n }\n }\n\n $fighter->coordinate_x = $randX;\n $fighter->coordinate_y = $randY;\n $fighter->level = '1';\n $fighter->xp = '0';\n\n if ($fighterData['Class'] == 0) {\n $fighter->skill_sight = '2';\n $fighter->skill_strength = '1';\n $fighter->skill_health = '5';\n $fighter->current_health = '5';\n }\n\n if ($fighterData['Class'] == 1) {\n $fighter->skill_sight = '3';\n $fighter->skill_strength = '1';\n $fighter->skill_health = '5';\n $fighter->current_health = '5';\n }\n\n if ($fighterData['Class'] == 2) {\n $fighter->skill_sight = '2';\n $fighter->skill_strength = '1';\n $fighter->skill_health = '8';\n $fighter->current_health = '8';\n }\n\n if ($fighterData['Class'] == 3) {\n $fighter->skill_sight = '2';\n $fighter->skill_strength = '2';\n $fighter->skill_health = '5';\n $fighter->current_health = '5';\n }\n\n\n $fighterTable->save($fighter);\n $imgId= rand(1, 24);\n if( $fighterData[\"imgNum\"] != \"\"){\n $imgId= $fighterData[\"imgNum\"];\n }\n\n $file = new File('img/A'. $imgId .'.PNG'); // change here\n\n $file->copy('img/'.$fighter->id.'.PNG', true);\n }", "public function wallOfFame()\n {\n $fightersAll = $this->Fighter->find('all');\n $this->set('raw',$fightersAll);\n $playerIdActual = $this->Session->read('Auth.User.id');\n $this->set('isConnected',$playerIdActual);\n }", "function get_hammer_wct($game) {\n\t$hammer = $game->find(\".linescorehammer\");\n\t//Check if the upper linescore team has hammer\n\tif (strpos($hammer[0]->innertext, 'hammer.gif') !== false) {\n\t\treturn 1;\n\t}\n\telse {\n\t\treturn 2;\n\t}\t\n}", "private function setup() {\n foreach($this->fighters as $i => $fighter) {\n $this->fighters[$i]->instance_id = $i;\n $this->fighter_current = $this->fighters[$i];\n if(!$fighter->abilities) {\n }\n else {\n foreach($fighter->abilities as $ability) {\n if($ability->type == 'passive') {\n $this->useAbility($ability->name);\n }\n }\n }\n }\n $this->fighter_current = $this->fighters[0];\n //TODO: decide start user here\n }", "public function getPotentialOpponents() {\n\t\t\n\t\t$userID = $this->id;\n\t\t$level = $this->level;\n\t\t$agencySize = $this->agency_size;\n\t\t$minHealth = 25;\n\t\t\t\t\n\t\t// get up to 10 people to list on the attack list\n\t\t$attackListSize = 15;\n\t\t\n\t\t$maxAgencySize = $agencySize + 5;\n\t\t$minAgencySize = max(array(1, $agencySize - 5));\n\t\t\n\t\t// temporary solution for level range\n\t\t$minLevel = $level - 5 .'<br />';\n\t\t$maxLevel = $level + 5 .'<br />';\n\t\t\n/*\t\t$query = \"SELECT * FROM users,agencies WHERE (users.level <= ? AND users.level >= ? OR users.agency_size <= ? AND users.agency_size >= ?) AND (users.health > $minHealth AND users.level>3) AND (users.id != agencies.user_one_id AND users.id != agencies.user_two_id AND agencies.accepted =1) AND users.id != ? GROUP BY users.id ORDER BY RAND() LIMIT $attackListSize\";*/\n\n\t\t/*$query = \"SELECT * FROM users,agencies WHERE (users.level <= ? AND users.level >= ? OR users.agency_size <= ? AND users.agency_size >= ?) AND (users.health > $minHealth AND users.level>3) AND (users.id NOT IN (SELECT agencies.user_one_id FROM agencies WHERE agencies.user_two_id = $userID AND agencies.accepted =1)) AND (users.id NOT IN (SELECT agencies.user_two_id FROM agencies WHERE agencies.user_one_id = $userID AND agencies.accepted =1)) AND users.id != $userID GROUP BY users.id ORDER BY users.id LIMIT $attackListSize\";*/\n\t\t\n\t\t\n\t\t $query = \"SELECT * FROM users WHERE (users.level <= ? AND users.level >= ?) AND users.id != $userID GROUP BY users.id ORDER BY users.id LIMIT $attackListSize\";\n\t\t\n\t\t$objAllPotOpps = ConnectionFactory::SelectRowsAsClasses($query, array($maxLevel, $minLevel), __CLASS__);\n\t\t\t\t\n\t\tif (!$objAllPotOpps || count($objAllPotOpps) < $attackListSize) {\n\t\t\t// TODO: execute further queries with higher level or agency size ranges if too few users\n\t\t\t//the next lines is temp solution if there is 1<x<attacklistsize opponents\n\t\t\tif ($objAllPotOpps) return $objAllPotOpps;\n\t\t\telse return array();\n\t\t}\n\n\t\t// get random indices\n\t\t$randomIntegers = getRandomIntegers($attackListSize, count($objAllPotOpps));\n\t\t\n\t\t$opponents = array();\n\t\tforeach ($randomIntegers as $key=>$value) {\n\t\t\tarray_push($opponents, $objAllPotOpps[$key]);\n\t\t}\n\t\treturn $opponents;\n\t}", "function scrapbots_pair_up_scrapbots ($armies){\n\tdebug(\"Pairing up Bots\");\n\t$attacker = scrapbots_choose_fighter($armies['attacker']);\n\tdebug(\"Debugging attacker at pairup\");\n\tdebug($attacker);\n\t$defender = scrapbots_choose_fighter($armies['defender']);\n\t$duellers = array(\"attacker\"=>$attacker, \"defender\"=>$defender);\n\tdebug(\"Debugging defender at pairup\");\n\tdebug($defender);\n\tdebug(\"Duellers in this round:\");\n\tdebug($duellers);\n\treturn $duellers;\n}", "public function hasAttack(){\r\n return $this->_has(8);\r\n }", "public function guild()\n {\n $playerIdActual = $this->Session->read('Auth.User.id');\n $fighterIdActual = $this->Session->read('Fighter.id');\n \n $playerActual = $this->User->findById($playerIdActual);\n $this->set('email', $playerActual['User']['email']);\n \n $fightersActual = $this->Fighter->find('all',array(\n 'conditions' => array(\n 'Fighter.player_id' => $playerIdActual\n )\n ));\n \n \n $this->set('playerId',$playerIdActual);\n $this->set('fighterId',$fighterIdActual);\n \n $fightersUser = array();\n\n foreach($fightersActual as $fighter){\n $fightersUser[$fighter['Fighter']['id']] = $fighter['Fighter']['name'];\n \n \n }\n $this->set('fighterList',$fightersUser);\n \n $guilds = $this->Guild->find('all');\n \n $guildsName = array();\n\n foreach($guilds as $guild){\n $guildsName[$guild['Guild']['id']] = $guild['Guild']['name'];\n \n }\n \n $currentFighter = $this->Fighter->find('first',array(\n 'conditions' => array(\n 'Fighter.id' => $fighterIdActual\n )\n ));\n \n if($currentFighter['Fighter']['guild_id'] != NULL){\n \n $guildActual = $this->Guild->find('first',array(\n 'conditions' => array(\n 'Guild.id' => $currentFighter['Fighter']['guild_id']\n )\n ));\n \n $this->set('guildName',$guildActual['Guild']['name']);\n }\n \n //Si on demande la création d'un nouveau personnage.\n if($this->request->data('Fightercreate'))\n {\n $this->Fighter->generate($playerIdActual,$this->request->data['Fightercreate']['name']);\n \n //Création d'une nouvelle arme\n $dataTool = array();\n \n $random = rand(1,3);\n \n if($random == 1){\n $dataTool['type'] = 'strength';\n }\n Elseif($random == 2){\n $dataTool['type'] = 'sight';\n }\n Else {\n $dataTool['type'] = 'life';\n }\n \n $dataTool['bonus'] = rand(1,3);\n \n $this->Tool->add($dataTool);\n }\n \n //Si on demande la création d'un nouveau personnage.\n if($this->request->data('Fighterchoice'))\n {\n $this->Session->write('Fighter.id',$this->request->data['Fighterchoice']['fighter']);\n $fighterIdActual = $this->Session->read('Fighter.id');\n echo \"<script>window.location = window.location.href;</script>\"; \n }\n \n //Si on demande un nouvel avatar\n if($this->request->data('Fighternewavatar'))\n {\n /*debug($this->request->data['Playernewavatar']);\n $this->request->data->Player->id = '0c3ebe52-8024-11e5-96f5-5dcadefa4980';\n if(!$this->Player->save($this->request->data))\n {\n debug($this->Player->invalidFields()); die();\n }*/\n $this->Fighter->newAvatar($fighterIdActual, $this->request->data['Fighternewavatar']);\n \n }\n \n $this->set('guildsName',$guildsName);\n \n //Si c'est une action de mouvement\n if($this->request->data('guildCreate'))\n {\n $this->Guild->add($this->request->data['guildCreate']);\n }\n \n //Si c'est une action de mouvement\n Elseif($this->request->data('guildJoin'))\n {\n $this->Fighter->joinGuild($fighterIdActual, $this->request->data['guildJoin']['guilds_id']);\n }\n \n \n }", "public function hasFireAttack(){\r\n return $this->_has(20);\r\n }", "function fighter()\n\t{\n\t\t//Stockage de l'id du combattant récupéré de la session\n\t\t$fighterId = $this->Session->read('fighterId');\n\n\t\tif($this->request->data('FighterAvatar'))\n\t\t{\n\t\t\t$data = $this->request->data;\n\t\t\t$extension = strtolower(pathinfo($data['FighterAvatar']['avatar_file']['name'], PATHINFO_EXTENSION));\n\n\t\t\t//Méthode upload d'avatar\n\t\t\tif(\n\t\t\t !empty($data['FighterAvatar']['avatar_file']['tmp_name']) &&\n\t\t\t in_array($extension, array('png'))\n\t\t\t )\n\t\t\t{\n\t\t\t move_uploaded_file($data['FighterAvatar']['avatar_file']['tmp_name'], IMAGES . 'avatars' . DS . $fighterId . '.' . $extension);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->set('msg', \"Erreur lors du téléchargement, format .png requis\");\n\t\t\t}\n\n\n\t\t}\n\n\t\t//Affichage des évènements\n\t\t$diary = $this->Event->find('all', array(\n\t\t 'conditions' => array(\n\t\t 'Event.date BETWEEN NOW() -INTERVAL 1 DAY AND NOW()'),\n\t\t 'order' => array('Event.id DESC'),\n\t\t 'limit' => 5\n\t\t ));\n\n\t\t$this->set('diary', $diary);\n\n\t\t//Stockage dans datas des informations du combattant\n\t\t$this->set('id', $fighterId);\n\t\t$datas = $this->Fighter->findById($fighterId);\n\n\t\t$playerId = $datas['Fighter']['player_id'];\n\n\t\t$fighters = $this->Fighter->fighterChoice($playerId);\n\t\t$this->set('fighters', $fighters);\n\n\t\t//Stockage des informations du combattant pour la vue\n\t\t$this->set('name', $datas['Fighter']['name']);\n\t\t$this->set('level', $datas['Fighter']['level']);\n\t\t$this->set('strength', $datas['Fighter']['skill_strength']);\n\t\t$this->set('sight', $datas['Fighter']['skill_sight']);\n\t\t$this->set('health', $datas['Fighter']['current_health']);\n\t\t$this->set('skill_health', $datas['Fighter']['skill_health']);\n\t\t$this->set('xp', $datas['Fighter']['xp']);\n\t\t$this->set('x', $datas['Fighter']['coordinate_x']);\n\t\t$this->set('y', $datas['Fighter']['coordinate_y']);\n\n\t\t//Stockage de l'email du joueur pour la vue\n\t\t$this->set('email', $this->Session->read('Auth.User.email'));\n\t}", "public function hasFireAttack(){\r\n return $this->_has(17);\r\n }", "public function hasDefense(){\r\n return $this->_has(6);\r\n }", "private function passTime()\n {\n // guys in bathroom lose pee equal to peeSpeed\n // guys at bar gain pee equal to drinkSpeed\n // guys in bathroom with pee == 0 return to bar\n }", "protected function computeAllowed() {\n\t\tif($this->tees) {\n\t\t\t$this->exact_handicap = $this->player->handicap;\n\t\t\t$a = $this->player->allowed($this->tees);\n\t\t\t$this->handicap = array_sum($a); // playing handicap\n\t\t\t$this->save();\n\t\t\tif($this->hasDetails()) {\t\t\t\t\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($this->getScoreWithHoles()->each() as $score) {\n\t\t\t\t\t$score->allowed = $a[$i++];\n\t\t\t\t\t$score->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}", "public function get_bydeler_info()\n\t{\n\t\t$bydeler = array();\n\t\tforeach (game::$bydeler as $bydel)\n\t\t{\n\t\t\t$bydeler[$bydel['id']] = array(\n\t\t\t\t\"cars\" => 0,\n\t\t\t\t\"b_id\" => $bydel['id'],\n\t\t\t\t\"b_active\" => $bydel['active'],\n\t\t\t\t\"ff_id\" => null,\n\t\t\t\t\"ff_name\" => null,\n\t\t\t\t\"garage\" => null,\n\t\t\t\t\"garage_max_cars\" => null,\n\t\t\t\t\"garage_free\" => 0,\n\t\t\t\t\"garage_next_rent\" => null\n\t\t\t);\n\t\t}\n\t\t\n\t\t// antall biler vi har i de ulike bydelene (garasjene)\n\t\t$result = \\Kofradia\\DB::get()->query(\"\n\t\t\tSELECT b_id, COUNT(id) AS ant\n\t\t\tFROM users_gta\n\t\t\tWHERE ug_up_id = \".$this->up->id.\"\n\t\t\tGROUP BY b_id\");\n\t\twhile ($row = $result->fetch())\n\t\t{\n\t\t\tif (!isset($bydeler[$row['b_id']])) continue;\n\t\t\t$bydeler[$row['b_id']]['cars'] = $row['ant'];\n\t\t}\n\t\t\n\t\t// informasjon om garasjene vi har\n\t\t$result = \\Kofradia\\DB::get()->query(\"\n\t\t\tSELECT ugg_b_id, ugg_places, ugg_time_next_rent, ff_id, ff_name\n\t\t\tFROM users_garage\n\t\t\t\tLEFT JOIN ff ON ff_id = ugg_ff_id\n\t\t\tWHERE ugg_up_id = \".$this->up->id);\n\t\twhile ($row = $result->fetch())\n\t\t{\n\t\t\tif (!isset($bydeler[$row['ugg_b_id']])) continue;\n\t\t\t$bydeler[$row['ugg_b_id']]['garage'] = true;\n\t\t\t$bydeler[$row['ugg_b_id']]['ff_id'] = $row['ff_id'];\n\t\t\t$bydeler[$row['ugg_b_id']]['ff_name'] = $row['ff_name'];\n\t\t\t$bydeler[$row['ugg_b_id']]['garage_max_cars'] = $row['ugg_places'];\n\t\t\t$bydeler[$row['ugg_b_id']]['garage_free'] = max(0, $row['ugg_places'] - $bydeler[$row['ugg_b_id']]['cars']);\n\t\t\t$bydeler[$row['ugg_b_id']]['garage_next_rent'] = $row['ugg_time_next_rent'];\n\t\t}\n\t\t\n\t\treturn $bydeler;\n\t}", "function buyFight()\n{\n\tGlobal $conn;\n\t\n\t$uid = isset($_GET['user']) ? urldecode($_GET['user']): ''; \n\tif($uid == '' || $uid == '2147483647' || $uid == '0') printMsg(MSG_NOT_CORRECT_USER_ID,3);\n\t\n\t$query = \"SELECT `users_fights`.`user_id`, `users_fights`.`lock_fights`, `users_balance`.`balance`\n \tFROM `users_fights`\n \tINNER JOIN `users_balance` ON `users_balance`.`user_id` = `users_fights`.`user_id`\n WHERE `users_fights`.`user_id` = (SELECT `users`.`id` FROM `users` WHERE `users`.`VKuser` = '{$uid}' ORDER by `users`.`id` LIMIT 1) \n\t\t\t\";\n\t\n\t$res = mysql_query($query);\n\tif(mysql_error($conn)) trigger_error(MSG_PROBLEM_WITH_SQL);\n\t$data = mysql_fetch_array($res);\n\t\n\tif ($data['lock_fights'] == 0) \n\t{\n\t\tif ($data['balance'] < 100) printMsg(MSG_NOT_ENOUGH_MONEY_BUY_F,3);\n\t\t$newUserBalance = $data['balance'] - 100;\n\t\t$query = \" UPDATE `users_balance`\n \t\tSET `balance` = {$newUserBalance}\n \tWHERE `users_balance`.`user_id` = '{$data['user_id']}'\n \";\n\t\t\n\t\t$newLockFights = '4';\n\t\t$query2 = \"UPDATE `users_fights`\n \t\tSET `lock_fights` = {$newLockFights},\n \t\t\t`unlock_time` = '0'\n \tWHERE `users_fights`.`user_id` = '{$data['user_id']}' \n\t\t\t \";\n\t\t\n\t\t\n\t\t\n\t\tmysql_query($query, $conn);\n\t\t\n\t\tmysql_query($query2, $conn);\n\t\t\n\t\tif(mysql_error($conn)) trigger_error(MSG_PROBLEM_WITH_SQL);\n\t\t\n\t\t$responce = printMsg(MSG_BUY_FIGHT_OK,5);\n\t}\n}", "function getFighterList() {\n $fighterList = $this->find('all', array(\n 'order' => 'Fighters.level DESC'\n ));\n $fighterListArray = $fighterList->toArray();\n return $fighterListArray;\n }", "public function index()\n {\n //$this->set('myname', \"Jérémy Camilleri\");\n \n $playerIdActual = $this->Session->read('Auth.User.id');\n $playerActual = $this->User->findById($playerIdActual);\n \n $this->set('raw',$playerActual);\n $this->set('email', $playerActual['User']['email']);\n \n \n //On affiche la liste des nom de joueurs actuellement dans l'arène\n \n \n /*foreach ($Events as $event) \n {\n <td>$event['Event']['name']</td>\n }*/\n \n $fightersActual = $this->Fighter->find('all',array(\n 'conditions' => array(\n 'Fighter.player_id' => $playerIdActual\n )\n ));\n \n \n $fightersUser = array();\n\n foreach($fightersActual as $fighter){\n $fightersUser[$fighter['Fighter']['id']] = $fighter['Fighter']['name'];\n \n \n }\n $this->set('fighterList',$fightersUser);\n\n $fighterIdActual = $this->Session->read('Fighter.id');\n \n if(empty($fighterIdActual)){\n $fighterIdActual = $fightersActual[0]['Fighter']['id'];\n }\n \n \n $this->set('fighterId',$fighterIdActual);\n \n \n //Si on demande la création d'un nouveau personnage.\n if($this->request->data('Fightercreate'))\n {\n $message = $this->Fighter->generate($playerIdActual,$this->request->data['Fightercreate']['name']);\n \n $dataTool = array();\n \n $random = rand(1,3);\n \n if($random == 1){\n $dataTool['type'] = 'strength';\n }\n Elseif($random == 2){\n $dataTool['type'] = 'sight';\n }\n Else {\n $dataTool['type'] = 'life';\n }\n \n $dataTool['bonus'] = rand(1,3);\n \n $message = $message . \" \" . $this->Tool->add($dataTool);\n $this->set('messages',$message);\n }\n \n //Si on demande la création d'un nouveau personnage.\n if($this->request->data('Fighterchoice'))\n {\n $this->Session->write('Fighter.id',$this->request->data['Fighterchoice']['fighter']);\n $fighterIdActual = $this->Session->read('Fighter.id');\n \n $this->set('messages',\"You change your character !\");\n echo \"<script>window.location = window.location.href;</script>\"; \n }\n \n //Si on demande un nouvel avatar\n if($this->request->data('Fighternewavatar'))\n {\n /*debug($this->request->data['Playernewavatar']);\n $this->request->data->Player->id = '0c3ebe52-8024-11e5-96f5-5dcadefa4980';\n if(!$this->Player->save($this->request->data))\n {\n debug($this->Player->invalidFields()); die();\n }*/\n $message = $this->Fighter->newAvatar($fighterIdActual, $this->request->data['Fighternewavatar']);\n $this->set('messages',$message);\n }\n \n \n\n $currentFighter = $this->Fighter->find('first' , array('conditions'=> array(\n 'Fighter.id' => $fighterIdActual\n )\n )\n );\n \n $this->set('myFighter',$currentFighter);\n \n \n \n $this->set('othersFighters',$this->Fighter->find('all' , array('conditions'=> array(\n 'Fighter.coordinate_x <=' => $currentFighter['Fighter']['coordinate_x'] + $currentFighter['Fighter']['skill_sight'],\n 'Fighter.coordinate_x >=' => $currentFighter['Fighter']['coordinate_x'] - $currentFighter['Fighter']['skill_sight'],\n 'Fighter.coordinate_y <=' => $currentFighter['Fighter']['coordinate_y'] + $currentFighter['Fighter']['skill_sight'],\n 'Fighter.coordinate_y >=' => $currentFighter['Fighter']['coordinate_y'] - $currentFighter['Fighter']['skill_sight'],\n 'Fighter.id !=' => $fighterIdActual\n )\n )\n ));\n\n $this->set('invisibleFighters',$this->Fighter->find('all' , array('conditions'=> array(\n 'Fighter.coordinate_x >' => $currentFighter['Fighter']['coordinate_x'] + $currentFighter['Fighter']['skill_sight'],\n 'Fighter.coordinate_x <' => $currentFighter['Fighter']['coordinate_x'] - $currentFighter['Fighter']['skill_sight'],\n 'Fighter.coordinate_y >' => $currentFighter['Fighter']['coordinate_y'] + $currentFighter['Fighter']['skill_sight'],\n 'Fighter.coordinate_y <' => $currentFighter['Fighter']['coordinate_y'] - $currentFighter['Fighter']['skill_sight'],\n 'Fighter.id !=' => $fighterIdActual\n )\n )\n ));\n \n $toolsCurrent = $this->Tool->find('all', array(\n 'conditions' => array(\n 'Tool.coordinate_x' => $currentFighter['Fighter']['coordinate_x'],\n 'Tool.coordinate_y' => $currentFighter['Fighter']['coordinate_y']\n \n )\n ));\n \n $this->set('tool',$toolsCurrent);\n \n $toolList = array();\n\n foreach($toolsCurrent as $tool){\n $toolList[$tool['Tool']['id']] = $tool['Tool']['type'].\" \".$tool['Tool']['bonus'];\n }\n $this->set('toolList',$toolList);\n \n //Si on demande la création d'un nouveau personnage.\n if($this->request->data('Toolpickup'))\n {\n $message = $this->Fighter->ramasserWeapon($fighterIdActual, $this->request->data['Toolpickup']['toolChoice']);\n $this->set('messages',$message);\n }\n \n //Si c'est une action de mouvement\n if($this->request->data('Fightermove'))\n {\n $message = $this->Fighter->doMove($fighterIdActual, $this->request->data['Fightermove']['direction']);\n $this->set('messages',$message);\n\n }\n \n //Si c'est une action d'attaque\n Elseif($this->request->data('Fighterattack'))\n {\n $message = $this->Fighter->doAttack($fighterIdActual, $this->request->data['Fighterattack']['direction']);\n $this->set('messages',$message);\n \n\n }\n \n }", "public function diary()\n {\n $playerIdActual = $this->Session->read('Auth.User.id');\n $fighterIdActual = $this->Session->read('Fighter.id');\n $this->set('fighterId',$fighterIdActual);\n \n $playerActual = $this->User->findById($playerIdActual);\n $this->set('email', $playerActual['User']['email']);\n\n \n $fightersActual = $this->Fighter->find('all',array(\n 'conditions' => array(\n 'Fighter.player_id' => $playerIdActual\n )\n ));\n \n $fightersUser = array();\n\n foreach($fightersActual as $fighter){\n $fightersUser[$fighter['Fighter']['id']] = $fighter['Fighter']['name'];\n \n \n }\n $this->set('fighterList',$fightersUser);\n \n //Si on demande la création d'un nouveau personnage.\n if($this->request->data('Fightercreate'))\n {\n $this->Fighter->generate($playerIdActual,$this->request->data['Fightercreate']['name']);\n \n //Création d'une nouvelle arme\n $dataTool = array();\n \n $random = rand(1,3);\n \n if($random == 1){\n $dataTool['type'] = 'strength';\n }\n Elseif($random == 2){\n $dataTool['type'] = 'sight';\n }\n Else {\n $dataTool['type'] = 'life';\n }\n \n $dataTool['bonus'] = rand(1,3);\n \n $this->Tool->add($dataTool);\n }\n \n //Si on demande la création d'un nouveau personnage.\n if($this->request->data('Fighterchoice'))\n {\n $this->Session->write('Fighter.id',$this->request->data['Fighterchoice']['fighter']);\n $fighterIdActual = $this->Session->read('Fighter.id');\n echo \"<script>window.location = window.location.href;</script>\"; \n }\n \n //Si on demande un nouvel avatar\n if($this->request->data('Fighternewavatar'))\n {\n /*debug($this->request->data['Playernewavatar']);\n $this->request->data->Player->id = '0c3ebe52-8024-11e5-96f5-5dcadefa4980';\n if(!$this->Player->save($this->request->data))\n {\n debug($this->Player->invalidFields()); die();\n }*/\n $this->Fighter->newAvatar($fighterIdActual, $this->request->data['Fighternewavatar']);\n \n }\n \n $event = $this->Event->find('all', array(\n 'conditions' => array(\n 'Event.date BETWEEN NOW() -INTERVAL 1 DAY AND NOW()'),\n 'order' => array('Event.date DESC'), ));\n \n $this->set('Events', $event);\n \n }", "public function getDifficulty();", "function _whoIsBetterSeed( $team1ID, $team2ID ) {\n\n/* ... data declarations */\n $bestSeeded = -1;\n\n/* ... form the database query */\n $this->db->select( 'Seed' );\n $this->db->where( 'TeamID', $team1ID );\n\n/* ... perform the query */\n $sqlQuery = $this->db->get( 'TournamentSeeds' );\n\n/* ... now to roll through the retrieved data */\n foreach ($sqlQuery->result_array() as $dbRow) {\n $team1Seed = $dbRow['Seed'];\n }\n\n/* ... form the database query */\n $this->db->select( 'Seed' );\n $this->db->where( 'TeamID', $team2ID );\n\n/* ... perform the query */\n $sqlQuery = $this->db->get( 'TournamentSeeds' );\n\n/* ... now to roll through the retrieved data */\n foreach ($sqlQuery->result_array() as $dbRow) {\n $team2Seed = $dbRow['Seed'];\n }\n\n/* ... figure out who is better seeded */\n $bestSeeded = $team1Seed < $team2Seed ? $team1ID : $team2ID;\n \n/* ... time to go */\n return( $bestSeeded );\n }", "function rand_warrior(){\n\t\t$list = array ('adversary', 'advocate', 'ally', 'antagonist', 'apache', 'assailant', 'attacker', 'backer', 'barbarian', 'battler', 'belligerent', 'centurion', 'challenger', 'champ', 'combatant', 'commando', 'conqueror', 'contender', 'contester', 'corsair', 'crusader', 'defender', 'disputant', 'enemy', 'entrant', 'expounder', 'foe', 'gladiator', 'goliath', 'guardian', 'gurkha', 'hero', 'horseman', 'immortal', 'knight', 'legionairre', 'marshall', 'medalist', 'mongol', 'musketeer', 'ninja', 'partisan', 'patron', 'pirate', 'player', 'proponent', 'protector', 'ranger', 'rifler', 'rival', 'rover', 'samurai', 'scrapper', 'serviceman', 'soldier', 'spartan', 'spoiler', 'upholder', 'vanquisher', 'victor', 'viking', 'vindicator', 'warrior', 'winner');\n\t\t$i = count($list);\n\t\treturn $list[mt_rand(0,$i-1)];\n\t}", "public function hasIceAttack(){\r\n return $this->_has(16);\r\n }", "function scheckAusdruck()\r\n {\r\n foreach ($this->belegschaft as $schluessel=>$wert)\r\n $this->belegschaft[$schluessel]->scheckAusdruck();\r\n }", "function checkEverytime()\n {\n // Schnellfeuer\n if (!$this->achieve_array[5][2]) {\n if (count($this->timestamps) > 0) {\n if ((getdate()[0] - end($this->timestamps) <= 2) and ($this->last_evaluation)) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][2])] = $this->achieve_array[2][2];\n $this->last_achievement = $this->achieve_array[0][2];\n $this->achieve_array[5][2] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Spritner\n if (!$this->achieve_array[5][3]) {\n if (count($this->timestamps) > 4) {\n if (getdate()[0] - $this->timestamps[count($this->timestamps) - 5] <= 30) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][3])] = $this->achieve_array[2][3];\n $this->last_achievement = $this->achieve_array[0][3];\n $this->achieve_array[5][3] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Eingeschlafen erst einmal stumpf machen, also 30 Sekunden keine Frage beantworten\n if (!$this->achieve_array[5][1]) {\n if (count($this->timestamps) > 0) {\n if (getdate()[0] - end($this->timestamps) >= 30) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][1])] = $this->achieve_array[2][1];\n $this->last_achievement = $this->achieve_array[0][1];\n $this->achieve_array[5][1] = true;\n $this->achievementCounter++;\n }\n }\n }\n }", "function getEnemy ()\n{\n\tGlobal $conn;\n\t$where = array();\n\t\t\n\t$uid = isset($_GET['user']) ? urldecode($_GET['user']): ''; \n\tif($uid == '' || $uid == '2147483647' || $uid == '0') printMsg(MSG_NOT_CORRECT_USER_ID,3);\n\n\tcheckLockTrainings($uid);\n\n\t$checkfightsXML = checkLockFights($uid);\n\t\n\tpreg_match('/<time>([0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2})<\\/time>/is', $checkfightsXML, $lock);\n\tif (count($lock) != 0)\n\t{\n\t\techo base64_encode($checkfightsXML);\n\t\texit;\n\t}\n\t\n\tpreg_match('/<leftfights>([0-9]{1,5})<\\/leftfights>/is', $checkfightsXML, $mas);\n\tif (count($mas) != 0) $userLeftFights = $checkfightsXML;\n\telse $userLeftFights = '';\n\t\t\n\t$responce = '<result type=\"1\">';\n\t$responce .= $userLeftFights;\n\n\t$query = 'SELECT `users_dogs`.`DogLevel`, `users_dogs`.`user_id` \n\t\t\t\tFROM `users_dogs` \n\t\t\t\tWHERE `users_dogs`.`user_id` = (SELECT `users`.`id` FROM `users` WHERE `users`.`VKuser`=' . $uid .' ORDER BY `users`.`id` LIMIT 1) ';\n\t\n\t$result = mysql_query($query);\n\tif(mysql_error($conn)) trigger_error(MSG_PROBLEM_WITH_SQL);\n\t$data = mysql_fetch_assoc($result);\n\t\n\t$userID = $data['user_id'];\n\t$dogLevel = $data['DogLevel'];\n\t$prev = $dogLevel-1;\n\t$next = $dogLevel+1;\n\t\n\t$query = \"SELECT `users_dogs`.`DogLevel`\n FROM `users_dogs` \n WHERE `users_dogs`.`DogLevel` = '{$next}' \n LIMIT 1\n\t\t\t\t\";\n\t\n\t$result = mysql_query($query);\n\tif(mysql_error($conn)) trigger_error(MSG_PROBLEM_WITH_SQL);\n\t$data = mysql_fetch_array($result);\n\n\t$query2 = \"SELECT `users_dogs`.`DogLevel`\n FROM `users_dogs` \n WHERE `users_dogs`.`DogLevel` = '{$prev}' \n LIMIT 1\n\t\t\t\t\";\n\t\n\t$result2 = mysql_query($query2);\n\tif(mysql_error($conn)) trigger_error(MSG_PROBLEM_WITH_SQL);\n\t$data2 = mysql_fetch_array($result2);\n\n\tif ($dogLevel == '1'){\n\t\t$where[0] = ' WHERE `users_dogs`.`doglevel` = '.$dogLevel;\n\t\t\n\t\tif ($data['DogLevel'] != '' && $data['DogLevel'] == '2'){\n\t\t\t$where[1] = ' WHERE `users_dogs`.`doglevel` = '.$dogLevel;\n\t\t\t$where[2] = ' WHERE `users_dogs`.`doglevel` = '.$next;\n\t\t}\n\t\telse {\n\t\t\t$where[1] = ' WHERE `users_dogs`.`doglevel` = '.$dogLevel;\n\t\t\t$where[2] = ' WHERE `users_dogs`.`doglevel` = '.$dogLevel;\n\t\t}\n\t} \n\telse \n\t{\n\t\t$where[0] = ' WHERE `users_dogs`.`doglevel` = '.$prev;\n\t\t$where[1] = ' WHERE `users_dogs`.`doglevel` = '.$dogLevel;\n\t\t\n\t\tif ($data['DogLevel'] != '' && $data['DogLevel'] == $next){\n\t\t\t$where[2] = ' WHERE `users_dogs`.`doglevel` = '.$next;\n\t\t} else {\n\t\t\t$where[2] = ' WHERE `users_dogs`.`doglevel` = '.$dogLevel;\n\t\t}\n\t\t\n\t\tif ($data2['DogLevel'] == '') {\n\t\t\t$level = $prev - 1;\n\t\t\t$where[0] = ' WHERE `users_dogs`.`doglevel` = '.$level;\n\t\t\t$where[1] = ' WHERE `users_dogs`.`doglevel` = '.$level;\n\t\t}\n\t}\n\t\n\t$finalUids = array();\n\t\n\tfor ($i=0;$i<count($where);$i++)\n\t{\n\t\t$ids = array();\n\n\t\t$queryCount = \"SELECT COUNT(*) FROM `users_dogs` {$where[$i]}\";\n\t\t$count = mysql_fetch_row(mysql_query($queryCount, $conn));\n\t\tif(mysql_error($conn)) trigger_error(MSG_PROBLEM_WITH_SQL);\n\t\t\n\t\tif ($count[0] < '50000') {\n\t\t\t$limitDel = 10;\n\t\t}\n\t\tif ($count[0] > '50000' && $count[0] < '100000') {\n\t\t\t$limitDel = 20;\n\t\t} \n\t\tif ($count[0] > '100000' && $count[0] < '150000') {\n\t\t\t$limitDel = 30;\n\t\t}\n\t\tif ($count[0] > '150000' && $count[0] < '200000') {\n\t\t\t$limitDel = 40;\n\t\t}\n\t\tif ($count[0] > '200000' && $count[0] < '300000') {\n\t\t\t$limitDel = 60;\n\t\t}\n\t\tif ($count[0] > '300000' && $count[0] < '400000') {\n\t\t\t$limitDel = 80;\n\t\t}\n\t\t\n\t\t$limitMax = $count[0]/$limitDel;\n\t\t\n\t\tif ((int)$limitMax > 0)\t$sqlLIMIT = \" LIMIT 0,\".(int)$limitMax.\" \";\n\t\telse $sqlLIMIT = \"\";\n\t\n\t\t$ids = array();\n\t\t$query = \"SELECT `users_dogs`.`user_id`\n\t\t\t\t\tFROM `users_dogs` \n\t\t\t\t\t{$where[$i]} AND `users_dogs`.`user_id` <> '{$userID}' \n\t\t\t\t\t{$sqlLIMIT}\n\t\t\t\t \";\n\t\t//echo $query;\n/*\n\t\t$query = \"SELECT `users_dogs`.`user_id`\n\t\t\t\t\tFROM `users_dogs` \n\t\t\t\t\t{$where[$i]}\n\t\t\t\t\tAND `users_dogs`.`user_id` <> '{$userID}' \n\t\t\t\t \";\n*/\n\t//\tprint_r($query); echo \"<br>\";\n\t\t$result3 = mysql_query($query, $conn);\n\t\tif(mysql_error($conn)) trigger_error(MSG_PROBLEM_WITH_SQL);\n\t\twhile ($data3 = mysql_fetch_array($result3))\n\t\t{\n\t\t\t$ids[] = $data3;\n\t\t}\n\n\t\t$maxkey = count($ids)-1;\n\t//\tprint_r($maxkey); echo \"<br>\";\n\t\tfor ($j=0; $j<5; $j++)\n\t\t{\n\t\t\t$randkey = rand(0,$maxkey); \n\t\t\t$finalUids[] = $ids[$randkey]['user_id'];\n\t\t}\n\t}\n\t\n\t$query = 'SELECT `users`.`VKuser`, `users_dogs`.`DogName`, `users_dogs`.`DogLevel`, `users_dogs`.`strength`, `users_dogs`.`dexterity`, `users_dogs`.`endurance` \n\t\t\t\tFROM `users_dogs`\n\t\t\t\tINNER JOIN `users` ON `users`.`id` = `users_dogs`.`user_id` \n\t\t\t\tWHERE `users_dogs`.`user_id` in ('. join(', ', $finalUids). ') \n\t\t\t\tORDER BY `users_dogs`.`DogLevel`\n\t\t\t\tLIMIT 6\n\t\t\t';\t\n\t\t\n//\tprint_r($query); echo \"<br>\";\n\t$result = mysql_query($query);\n\t//echo mysql_error($conn).\"<br>\";\n\tif(mysql_error($conn)) trigger_error(MSG_PROBLEM_WITH_SQL);\n\t\n\twhile ($row = mysql_fetch_array($result))\n\t{\n\t/*\n\t\t$responce .= \"\n\t\t\t\t\t<dog>\n\t\t\t\t\t <user>{$row['VKuser']}<user> \n\t\t\t\t\t <dogID>{$row['dog_id']}</dogID> \n\t\t\t\t\t <dogname>{$row['DogName']}</dogname>\n\t\t\t\t\t <breedID>{$row['breed_id']}</breedID>\n\t\t\t\t\t <breed>{$row['breed_name']}</breed>\n\t\t\t\t\t <level>{$row['DogLevel']}</level>\n\t\t\t\t\t <health>{$row['DogHealth']}</health>\n\t\t\t\t\t <exp>{$row['DogExp']}</exp>\n\t\t\t\t\t <str>{$row['strength']}</str> \n\t\t\t\t\t <dex>{$row['dexterity']}</dex>\n\t\t\t\t\t <endu>{$row['endurance']}</endu> \n\t\t\t\t\t</dog>\n\t\t\t\t \n\t\t\";\n\t\t*/\n\t//\t$responce .= \"<dog><user>{$row['VKuser']}</user><name>{$row['DogName']}</name><breedID>{$row['breed_id']}</breedID><breed>{$row['breed_name']}</breed><level>{$row['DogLevel']}</level><health>{$row['DogHealth']}</health><exp>{$row['DogExp']}</exp><str>{$row['strength']}</str><dex>{$row['dexterity']}</dex><endu>{$row['endurance']}</endu></dog>\";\n\t\t$responce .= \"<dog><user>{$row['VKuser']}</user><name>{$row['DogName']}</name><level>{$row['DogLevel']}</level><str>{$row['strength']}</str><dex>{$row['dexterity']}</dex><endu>{$row['endurance']}</endu></dog>\";\n\t\t\n\t}\n\n\t$responce .= '</result>';\n\t\n//\techo $responce;\n\techo base64_encode($responce);\n}", "public function IsGameWonTest()\r\n\t{\r\n\t\t$entites_test_array = [\r\n\t\t\t[\r\n\t\t\t\t[ // Entity\r\n\t\t\t\t\t['name' => 'Farmer', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Cow', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Cow', 'alive' => 0],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 0],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 0],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 0],\r\n\t\t\t\t], \r\n\t\t\t\t1, // expected output, game won or not\r\n\t\t\t\ttrue, // AllMenAlive property of FarmGameModel\r\n\t\t\t],\r\n\t\t\t[\r\n\t\t\t\t[ // Entity\r\n\t\t\t\t\t['name' => 'Farmer', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Cow', 'alive' => 0],\r\n\t\t\t\t\t['name' => 'Cow', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 0],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 0],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 0],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 1],\r\n\t\t\t\t], \r\n\t\t\t\t1, // expected output, game won or not\r\n\t\t\t\ttrue, // AllMenAlive property of FarmGameModel\r\n\t\t\t],\r\n\t\t\t[\r\n\t\t\t\t[ // Entity\r\n\t\t\t\t\t['name' => 'Farmer', 'alive' => 0],\r\n\t\t\t\t\t['name' => 'Cow', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Cow', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 1],\r\n\t\t\t\t], \r\n\t\t\t\t0, // expected output, game won or not\r\n\t\t\t\tfalse, // AllMenAlive property of FarmGameModel\r\n\t\t\t],\r\n\t\t\t[\r\n\t\t\t\t[ // Entity\r\n\t\t\t\t\t['name' => 'Farmer', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Cow', 'alive' => 0],\r\n\t\t\t\t\t['name' => 'Cow', 'alive' => 0],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 1],\r\n\t\t\t\t], \r\n\t\t\t\t0, // expected output, game won or not\r\n\t\t\t\ttrue, // AllMenAlive property of FarmGameModel\r\n\t\t\t],\r\n\t\t\t[\r\n\t\t\t\t[ // Entity\r\n\t\t\t\t\t['name' => 'Farmer', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Cow', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Cow', 'alive' => 1],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 0],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 0],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 0],\r\n\t\t\t\t\t['name' => 'Bunny', 'alive' => 0],\r\n\t\t\t\t], \r\n\t\t\t\t0, // expected output, game won or not\r\n\t\t\t\ttrue, // AllMenAlive property of FarmGameModel\r\n\t\t\t],\r\n\t\t];\r\n\r\n\t\tforeach ($entites_test_array as $key => $testCase) {\r\n\t\t\t$entities = [];\r\n\t\t\tforeach ($testCase[0] as $ent) {\r\n\t\t\t\t$obj = $this->EntityFactory->GetEntity($ent['name'], $ent['name']);\r\n\t\t\t\tif($ent['alive'] == 0)\r\n\t\t\t\t\t$obj->Kill();\r\n\t\t\t\t$entities[] = $obj;\r\n\t\t\t}\r\n\t\t\t$test = $this->FarmGameModel->IsGameWon($entities);\r\n\t\t\t$expected_result = $testCase[1];\r\n\t\t\t$this->unit->run($test, $expected_result, 'IsGameWonTest ' . $key);\r\n\r\n\t\t\t$test = $this->FarmGameModel->AllMenAlive;\r\n\t\t\t$expected_result = $testCase[2];\r\n\t\t\t$this->unit->run($test, $expected_result, 'IsGameWonTest AllMenAlive ' . $key);\r\n\t\t}\r\n\r\n\t\techo $this->unit->report();\r\n\t}", "public function hasDefense(){\r\n return $this->_has(9);\r\n }", "function finish_fight()\n {\n //log_error(\"Client: $_SESSION[userid]\\nTerminating fight\\nTeam:$_SESSION[teamid]\",100);\n\n /*\n //If the fight is not in session then bail;\n if(!isset($_SESSION['prefight']))\n {\n log_error(\"HACK:\\nAttempt to terminate a fight while not part of a fight\\nClient: $_SESSION[userid]\\nTerminating fight\\nTeam:$_SESSION[teamid]\",100);\n return;\n }\n\n //Create a variable shortcuts.\n $fight=$_SESSION['fight'];\n $player_party=$_SESSION['player_party'];\n */\n $fight_store=new FIGHT_STORE();\n $result=$fight_store->get_fight($GLOBALS['userid'],$_SESSION['fightid']);\n //If there is no active fight then bail;\n if($result==false)\n {\n log_error(\"Attempt to terminate a fight while not part of a fight\\nClient: $_SESSION[userid]\\nProcessing fight commands\\nTeam:$_SESSION[teamid]\",100);\n queue_response('fight_terminate','pick_team.php');\n unset($_SESSION['fightid']);\n return;\n }\n extract($result);\n\n //If both parties are alive, then instruct the client to reload the data\n $imdead=$fight->test_own_party_dead($player_party);\n $theyredead=$fight->test_other_parties_dead($player_party);\n if ($imdead==false&&$theyredead==false)\n {\n log_error(\"Client: $_SESSION[userid]\\nCan't terminate fight- both parties are still alive\\nTeam:$_SESSION[teamid]\",100);\n queue_response('request_fight_data');\n return;\n }\n\n /*\n //Purge fight data (except $fight, for now. That is how PXP is calculated.\n unset($_SESSION['prefight']);\n unset($_SESSION['combat_playback']);\n unset($_SESSION['sequence']);\n unset($_SESSION['js_stack']);\n */\n //Direct client to switch to the map (temp hack- js will change pages)\n //queue_response('switch_to_map');\n queue_response('fight_terminate','proc_fight.php');\n }", "public function fighter()\n {\n return $this->belongsTo('App\\Models\\Fighter');\n }", "public function hasDamageaddper(){\r\n return $this->_has(30);\r\n }", "public function hasDamageaddper(){\r\n return $this->_has(33);\r\n }", "public function battleAllBattles(Player $player, int $enemySelectionStrategy = self::STATEGY_MOST_GOLD)\n {\n $result = $this->connector->test($player, Connector::GET_HUNTING_TARGETS, []);\n $playerInfo = new PlayerInfo($result);\n $this->logger->info(sprintf(\"Doing %d battles for Player %s\", $playerInfo->getStamina(), $player->getName()));\n $result = [];\n for ($i = $playerInfo->getStamina(); $i > 0; $i--) {\n $result[] = $this->doSingleBattle($player, $enemySelectionStrategy);\n sleep(3);\n }\n return $result;\n }", "function checkEverytime()\n {\n // ######### Respond in time and maybe also right ###########\n\n // Schnellfeuer\n if (!$this->achieve_array[5][2]) {\n if (count($this->timestamps) > 0) {\n if ((getdate()[0] - end($this->timestamps) <= 2) and ($this->last_evaluation)) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][2])] = $this->achieve_array[2][2];\n $this->last_achievement = $this->achieve_array[0][2];\n $this->achieve_array[5][2] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Luftschuss\n if (!$this->achieve_array[5][60]) {\n if (count($this->timestamps) > 0) {\n if (getdate()[0] - end($this->timestamps) <= 2) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][60])] = $this->achieve_array[2][60];\n $this->last_achievement = $this->achieve_array[0][60];\n $this->achieve_array[5][60] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Spritner\n if (!$this->achieve_array[5][3]) {\n if (count($this->timestamps) > 4) {\n if (getdate()[0] - $this->timestamps[count($this->timestamps) - 5] <= 30) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][3])] = $this->achieve_array[2][3];\n $this->last_achievement = $this->achieve_array[0][3];\n $this->achieve_array[5][3] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Marathonläufer\n if (!$this->achieve_array[5][61]) {\n if (count($this->timestamps) > 9) {\n if (getdate()[0] - $this->timestamps[count($this->timestamps) - 10] <= 60) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][61])] = $this->achieve_array[2][61];\n $this->last_achievement = $this->achieve_array[0][61];\n $this->achieve_array[5][61] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Lichtgeschwindigkeit\n if (!$this->achieve_array[5][62]) {\n if (count($this->timestamps) > 9) {\n if (getdate()[0] - $this->timestamps[count($this->timestamps) - 10] <= 5) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][62])] = $this->achieve_array[2][62];\n $this->last_achievement = $this->achieve_array[0][63];\n $this->achieve_array[5][62] = true;\n $this->achievementCounter++;\n }\n }\n }\n // ######### Do nothing for some time #########\n\n // Eingeschlafen?\n if (!$this->achieve_array[5][1]) {\n if (count($this->timestamps) > 0) {\n if (getdate()[0] - end($this->timestamps) >= 30) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][1])] = $this->achieve_array[2][1];\n $this->last_achievement = $this->achieve_array[0][1];\n $this->achieve_array[5][1] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Stillgestanden\n if (!$this->achieve_array[5][58]) {\n if (count($this->timestamps) > 0) {\n if (getdate()[0] - end($this->timestamps) >= 5) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][58])] = $this->achieve_array[2][58];\n $this->last_achievement = $this->achieve_array[0][58];\n $this->achieve_array[5][58] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Toilettenpause\n if (!$this->achieve_array[5][59]) {\n if (count($this->timestamps) > 0) {\n if (getdate()[0] - end($this->timestamps) >= 600) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][59])] = $this->achieve_array[2][59];\n $this->last_achievement = $this->achieve_array[0][59];\n $this->achieve_array[5][59] = true;\n $this->achievementCounter++;\n }\n }\n }\n\n }", "public function getPasses()\n\t{\n\t\treturn 1;\n\t}", "public function checkWin() {\n\n $data = $this->getDeathRecord();\n $data = array_map(function($d) {\n return $d[key($d)];\n }, $data);\n\n if ($data) {\n if (in_array(\"FARMER\", $data)) {\n return FALSE;\n }\n if (in_array(\"COW_1\", $data) && in_array(\"COW_2\", $data)) {\n return FALSE;\n }\n if (in_array(\"BUNNY_1\", $data) && in_array(\"BUNNY_2\", $data) && in_array(\"BUNNY_4\", $data) && in_array(\"BUNNY_4\", $data)) {\n return FALSE;\n }\n }\n return true;\n }", "public function hasFly(){\r\n return $this->_has(5);\r\n }", "function checkShowWorldWonder($wg_buildings,$village)\n{\n\tglobal $db,$user;\n\t$world_wonder=0;\n\t$array=array();\n\tif(empty($wg_buildings))\n\t{\n\t\t$wg_buildings=getBuildings($village);\n\t}\n\tforeach($wg_buildings as $key=>$value)\n\t{\n\t\tif($value->type_id==37)\n\t\t{\n\t\t\t$world_wonder=1;\t\t\n\t\t\tbreak;\n\t\t}\n\t}\n\t/*\n\tDa du Dk xay dung ky dai moi'\n\t1. so thanh >=2\n\t2. du so bau vat\n\t4. vi tri index 33->36 rong\n\t*/\n\tif($world_wonder==0)\n\t{\n\t\t$check=0;\n\t\t$sql = \"SELECT COUNT(DISTINCT(id)) FROM wg_villages WHERE user_id=\".$user['id'].\"\";\n\t\t$db->setQuery($sql);\n\t\t$count = (int)$db->loadResult();\n\t\tforeach($wg_buildings as $key=>$value)\n\t\t{\n\t\t\tif($value->type_id==12 && $value->level >0)\n\t\t\t{\n\t\t\t\t$check++;\t\n\t\t\t}\n\t\t\tif($value->index>=33 && $value->index<=36)\n\t\t\t{\n\t\t\t\tif($value->level==0)\n\t\t\t\t{\n\t\t\t\t\t$check++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($count>1 && $check==5 && checkRareExits($village)==1)\n\t\t{\n\t\t\treturn 1;\n\t\t}\t\n\t\treturn 0;\n\t}\n\treturn 1;\n}", "public function getDefender()\n {\n return $this->_turn === 0 ? $this->_army2 : $this->_army1;\n }", "public function sight() {\n if (!$this->request->session()->read('PlayerFighterId')) {\n $this->Flash->error(__('Veuillez choisir un combattant.'));\n return $this->redirect(['action' => 'fighter']);\n }\n\n //S'il a choisi un combattant, il peut jouer\n else {\n // On récupère le combattant et son avatar depuis la session\n $PlayerFighterId = $this->request->session()->read('PlayerFighterId');\n $PlayerFighterSkin = $this->request->session()->read('PlayerFighterSkin');\n\n //On charge les modèles\n $this->loadModel('Fighters');\n $this->loadModel('Tools');\n $this->loadModel('Surroundings');\n $this->loadModel('Events');\n\n //On récupère le combattant actuel\n if ($currentFighter = $this->Fighters->getFighterById($PlayerFighterId)) {\n\n //Gestion des actions du joueur :\n if ($this->request->is('post')) {\n\n //Déplacement\n if ($this->request->data['action'] == 'move') {\n $this->Fighters->move($this->request->data['dir'], $currentFighter);\n }\n\n //Attaque\n if ($this->request->data['action'] == 'attack') {\n $this->Fighters->attack($this->request->data['dir'], $currentFighter);\n }\n\n //Génération d'objets\n if ($this->request->data['action'] == 'generateTools') {\n $this->Tools->generateTools();\n }\n\n //Génération de décors\n if ($this->request->data['action'] == 'generateSurroundings') {\n $this->Surroundings->generateSurroundings();\n }\n\n //Ramasser objets\n if ($this->request->data['action'] == 'pickup') {\n $this->Tools->takeTool($currentFighter->coordinate_x, $currentFighter->coordinate_y, $currentFighter);\n }\n }\n } else {\n $this->Flash->error(__('Vous êtes mort ! Veuillez choisir un combattant.'));\n return $this->redirect(['action' => 'fighter']);\n }\n\n /* Envoi des données à la vue si le joueur n'est pas mort */\n if ($this->Fighters->getFighterById($PlayerFighterId)) {\n\n //On envoie le terrain de jeu\n $viewtab = $this->Fighters->createViewTab($currentFighter, $PlayerFighterSkin);\n $this->set(\"viewtab\", $viewtab);\n $myToolname = $this->Fighters->chooseSpriteName($this->Tools->getToolsByFighter($PlayerFighterId));\n $this->set(\"myToolname\", $myToolname);\n\n //On envoie le combattant\n $fighter = $this->Fighters->getFighterById($PlayerFighterId);\n $this->set(compact('fighter', $fighter));\n\n //On envoie les objets du combattant\n $tool = $this->Tools->getToolsByFighter($PlayerFighterId);\n $this->set(compact('tool', $tool));\n\n //On envoie les derniers évènements\n $events = $this->Events->getMostRecentEvents();\n $this->set(compact('events', $events));\n \n //On envoie les ennemis à proximité\n $opponents = $this->Fighters->getAdjacentOpponents($fighter);\n $this->set(compact('opponents', $opponents));\n\n $pos['x'] = $currentFighter->coordinate_x;\n $pos['y'] = $currentFighter->coordinate_y;\n $toolhere = $this->Fighters->toolIsThere($pos);\n $this->set(compact('toolhere', $toolhere));\n \n } else {\n $this->Flash->error(__('Vous êtes mort ! Veuillez choisir un combattant.'));\n return $this->redirect(['action' => 'fighter']);\n }\n }\n }", "function friendsYouMayKnow(){\n\n //load all buddies of user into an array\n //request is used for sql-injection to also\n //get buddies who didn't answered the\n //request\n $buddies = $this->buddyListArray('', \"1' OR request='0\");\n\n $notSuggest = $this->getNotSuggestList(); //get array of users that will not be suggested\n\n //return every single buddy\n foreach($buddies AS &$buddy){\n\n //get every buddy of this buddy\n $buddiesOfBuddy = $this->buddyListArray($buddy);\n\n\n //return every single buddy of this buddy\n foreach($buddiesOfBuddy AS &$buddyOfBuddy){\n //the most counted userid will be the userid\n //of the user who send the request so it has\n //to be removed from the whole array\n //\n //all buddies which are allready in the users\n //buddylist also need to be removed\n if($buddyOfBuddy != getUser() && !in_array($buddyOfBuddy, $buddies) && $buddyOfBuddy != 0 && !in_array($buddyOfBuddy, $notSuggest)){\n $finalArray[] = $buddyOfBuddy;\n }\n }\n\n\n }\n\n //gives out the value inside the array which occures most\n $c = array_count_values($finalArray); \n $return = array_search(max($c), $c);\n\n return $return;\n\n }", "public function attackFighter($idPlayer1, $idPlayer2) {\n // Retrieve the two fighters entities thanks to the players IDs\n $fighter1 = $this->Fighters->getFighter($idPlayer1);\n $fighter2 = $this->Fighters->getFighter($idPlayer2);\n\n // Determine if the attack succeed, according to the given formula\n $doAttackSucceed = $this->doAttackSucceed($fighter1->level, $fighter2->level);\n $this->set('test4', $doAttackSucceed);\n \n // If the attack succeeds, decrement health of fighter injured\n if($doAttackSucceed == true)\n {\n $fighter2->current_health -= $fighter1->skill_strength;\n $fighter1->xp ++;\n $this->Fighters->save($fighter1);\n $this->Fighters->save($fighter2);\n\n // If the attacked fighter current health is at 0, delete it and create new fighter. Fighter 1 wins XP equals to fighter 2 level.\n if($fighter2->current_health == 0)\n {\n $fighter1->xp += $fighter2->level;\n $this->deleteFighter($idPlayer2);\n }\n \n \n }\n \n \n return $doAttackSucceed;\n }", "function battle($type,$adress) \n{\n global $player;\n global $smarty;\n global $enemy;\n global $arrehp;\n global $db;\n if ($player -> hp <= 0) \n {\n error (NO_LIFE);\n }\n $enemy1 = $db -> Execute(\"SELECT * FROM `monsters` WHERE `id`=\".$player -> fight);\n $span = ($enemy1 -> fields['level'] / $player -> level);\n if ($span > 2) \n {\n $span = 2;\n }\n $expgain = ceil(rand($enemy1 -> fields['exp1'],$enemy1 -> fields['exp2']) * $span);\n $goldgain = ceil(rand($enemy1 -> fields['credits1'],$enemy1 -> fields['credits2']) * $span);\n $enemy = array(\"strength\" => $enemy1 -> fields['strength'], \n \"agility\" => $enemy1 -> fields['agility'], \n \"speed\" => $enemy1 -> fields['speed'], \n \"endurance\" => $enemy1 -> fields['endurance'], \n \"hp\" => $enemy1 -> fields['hp'], \n \"name\" => $enemy1 -> fields['name'], \n \"id\" => $enemy1 -> fields['id'], \n \"exp1\" => $enemy1 -> fields['exp1'], \n \"exp2\" => $enemy1 -> fields['exp2'], \n \"level\" => $enemy1 -> fields['level'],\n\t\t \"lootnames\" => explode(\";\", $enemy1->fields['lootnames']),\n\t\t \"lootchances\" => explode(\";\", $enemy1->fields['lootchances']));\n if ($type == 'T') \n {\n if (!isset ($_POST['action'])) \n {\n turnfight ($expgain,$goldgain,'',$adress);\n } \n else \n {\n turnfight ($expgain,$goldgain,$_POST['action'],$adress);\n }\n } \n else \n {\n fightmonster ($enemy,$expgain,$goldgain,1);\n }\n $fight = $db -> Execute(\"SELECT `fight`, `hp` FROM `players` WHERE `id`=\".$player -> id);\n if ($fight -> fields['fight'] == 0) \n {\n if ($type == 'T')\n\t {\n\t $player->energy --;\n\t if ($player -> energy < 0) \n\t {\n\t\t$player -> energy = 0;\n\t }\n\t $db -> Execute(\"UPDATE `players` SET `energy`=\".$player->energy.\" WHERE `id`=\".$player->id);\n\t }\n if ($player -> location == 'Góry') \n {\n if ($fight -> fields['hp'] > 0)\n {\n $smarty -> assign (\"Link\", \"<br /><br /><a href=\\\"explore.php?akcja=gory\\\">\".A_REFRESH.\"</a><br />\");\n }\n else\n {\n $smarty -> assign (\"Link\", \"<br /><br /><a href=\\\"gory.php\\\">\".A_REFRESH.\"</a><br />\");\n }\n }\n if ($player -> location == 'Las') \n {\n if ($fight -> fields['hp'] > 0)\n {\n $smarty -> assign (\"Link\", \"<br /><br /><a href=\\\"explore.php\\\">\".A_REFRESH.\"</a><br />\");\n }\n else\n {\n $smarty -> assign (\"Link\", \"<br /><br /><a href=\\\"las.php\\\">\".A_REFRESH.\"</a><br />\");\n }\n }\n }\n $fight -> Close();\n $enemy1 -> Close();\n}", "abstract public function getAttack();", "function is_attacked($i, $opponent_color = null, $try_move = array()) {\n\n if ($opponent_color != null) {\n $opponent_color = 1 - $this->to_move;\n }\n \n # check pawns\n # _debug(\"... checking opponent pawns\");\n if ($opponent_color) {\n if ($this->_test_attack('p', $i - 9, $opponent_color, $try_move) === -1) return TRUE;\n if ($this->_test_attack('p', $i - 11, $opponent_color, $try_move) === -1) return TRUE;\n } \n else {\n if ($this->_test_attack('p', $i + 9, $opponent_color, $try_move) === -1) return TRUE;\n if ($this->_test_attack('p', $i + 11, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n # check knights\n # _debug(\"... checking opponent knights\");\n foreach (array(19, 21, 8, 12, -19, -21, -8, -12) as $step) {\n if ($this->_test_attack('n', $i + $step, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n # check bishops or queens\n # _debug(\"... checking opponent bishops\");\n foreach (array(11, 9, -11, -9) as $step) {\n $j = $i;\n $ret = 0;\n while (!$ret) {\n $j += $step;\n $ret = $this->_test_attack('bq', $j, $opponent_color, $try_move);\n if ($ret === -1) return TRUE;\n }\n }\n\n # check rooks or queens\n # _debug(\"... checking opponent rooks or queens\");\n foreach (array(1, 10, -1, -10) as $step) {\n $j = $i;\n $ret = 0;\n while (!$ret) {\n $j += $step;\n $ret = $this->_test_attack('rq', $j, $opponent_color, $try_move);\n if ($ret === -1) return TRUE;\n }\n }\n\n foreach (array(9, 10, 11, -1, 1, -9, -10, -11) as $step) {\n if ($this->_test_attack('k', $i + $step, $opponent_color, $try_move) === -1) return TRUE;\n }\n\n return FALSE;\n }", "public function getWinner() {\n if($this->winnerType == \"draw\") {\n return \"draw\";\n } elseif($this->winnerID == $this->combatantAID && $this->winnerType == \"player\") {\n return $this->combatantA;\n } else {\n return $this->combatantB;\n }\n }", "public function hasSpeed(){\r\n return $this->_has(22);\r\n }", "public function getAttackCount()\n {\n return $this->count(self::ATTACK);\n }", "public function message()\n {\n $playerIdActual = $this->Session->read('Auth.User.id');\n $fighterIdActual = $this->Session->read('Fighter.id');\n \n $playerActual = $this->User->findById($playerIdActual);\n $this->set('email', $playerActual['User']['email']);\n \n $fightersActual = $this->Fighter->find('all',array(\n 'conditions' => array(\n 'Fighter.player_id' => $playerIdActual\n )\n ));\n \n $this->set('playerId',$playerIdActual);\n $this->set('fighterId',$fighterIdActual);\n\n \n $fightersUser = array();\n\n foreach($fightersActual as $fighter){\n $fightersUser[$fighter['Fighter']['id']] = $fighter['Fighter']['name'];\n \n \n }\n $this->set('fighterList',$fightersUser);\n \n //Si on demande la création d'un nouveau personnage.\n if($this->request->data('Fightercreate'))\n {\n $this->Fighter->generate($playerIdActual,$this->request->data['Fightercreate']['name']);\n \n //Création d'une nouvelle arme\n $dataTool = array();\n \n $random = rand(1,3);\n \n if($random == 1){\n $dataTool['type'] = 'strength';\n }\n Elseif($random == 2){\n $dataTool['type'] = 'sight';\n }\n Else {\n $dataTool['type'] = 'life';\n }\n \n $dataTool['bonus'] = rand(1,3);\n \n $this->Tool->add($dataTool);\n }\n \n //Si on demande la création d'un nouveau personnage.\n if($this->request->data('Fighterchoice'))\n {\n $this->Session->write('Fighter.id',$this->request->data['Fighterchoice']['fighter']);\n $fighterIdActual = $this->Session->read('Fighter.id');\n echo \"<script>window.location = window.location.href;</script>\"; \n }\n \n //Si on demande un nouvel avatar\n if($this->request->data('Fighternewavatar'))\n {\n /*debug($this->request->data['Playernewavatar']);\n $this->request->data->Player->id = '0c3ebe52-8024-11e5-96f5-5dcadefa4980';\n if(!$this->Player->save($this->request->data))\n {\n debug($this->Player->invalidFields()); die();\n }*/\n $this->Fighter->newAvatar($fighterIdActual, $this->request->data['Fighternewavatar']);\n \n }\n \n $messages = $this->Message->find('all', array(\n 'conditions' => array(\n 'Message.fighter_id' => $fighterIdActual),\n 'order' => array('Message.date DESC'), ));\n \n $messagesSent = $this->Message->find('all', array(\n 'conditions' => array(\n 'Message.fighter_id_from' => $fighterIdActual),\n 'order' => array('Message.date DESC'), ));\n \n//TRADUCTION ID TO NAME\n $i=0;\n foreach($messages as $message){\n $fighterActual = $this->Fighter->find('first',array(\n 'conditions' => array(\n 'Fighter.id' => $message['Message']['fighter_id_from'])));\n $messages[$i]['Message']['fighter_id_from'] = $fighterActual['Fighter']['name'];\n \n $i = $i +1 ;\n }\n \n $i=0;\n foreach($messagesSent as $message){\n $fighterActual = $this->Fighter->find('first',array(\n 'conditions' => array(\n 'Fighter.id' => $message['Message']['fighter_id'])));\n $messagesSent[$i]['Message']['fighter_id'] = $fighterActual['Fighter']['name'];\n \n $i = $i +1 ;\n }\n \n \n $fighters = $this->Fighter->find('all',array(\n 'conditions' => array(\n 'Fighter.player_id !=' => $playerIdActual)));\n \n $fightersName = array();\n\n foreach($fighters as $fighter){\n $fightersName[$fighter['Fighter']['id']] = $fighter['Fighter']['name'];\n \n \n }\n \n $this->set('fightersName',$fightersName);\n \n $this->set('Messages',$messages);\n $this->set('MessagesSent',$messagesSent);\n \n //Si c'est une action de mouvement\n if($this->request->data('MessageCreate'))\n {\n $this->Message->add($fighterIdActual, $this->request->data['MessageCreate']);\n }\n \n Elseif($this->request->data('Crier'))\n {\n $currentFighter = $this->Fighter->find('first' , array('conditions'=> array(\n 'Fighter.id' => $fighterIdActual\n )\n )\n );\n \n $this->request->data['Crier']['coordinate_x'] = $currentFighter['Fighter']['coordinate_x'];\n $this->request->data['Crier']['coordinate_y'] = $currentFighter['Fighter']['coordinate_y'];\n $this->request->data['Crier']['name'] = $currentFighter['Fighter']['name'] . \" Screams \" . $this->request->data['Crier']['name'];\n $this->Event->add($this->request->data['Crier']);\n }\n \n }", "public function getPossibleWinners($tier = NULL)\n\t{\n\t\treturn array();//$this->blackbox->Get_Possible_Winners($tier);\n\t}", "public function hasIceDefense(){\r\n return $this->_has(17);\r\n }", "public function walkDifficulty()\n {\n return $this->difficulty[array_rand($this->difficulty)];\n }", "function whoWins(){\n $winners = array();\n $n = 100;\n for($i=0;$i<=$n;$i++){\n $winner = playTournament();\n if(!isset($winners[$winner])){\n $winners[$winner] = 1;\n } else {\n $winners[$winner] += 1;\n }\n }\n arsort($winners);\n foreach($winners as $key=>$value){\n echo $key.' '.$value.\"\\n\";\n }\n}", "public function getBuyBattleChance()\n {\n return $this->get(self::_BUY_BATTLE_CHANCE);\n }", "abstract public function find_attack($game, $includeOptional = TRUE);", "protected function thinkBot() {\n $cellReturn = '';\n $markers = array($this->_botMark, $this->_userMark); //offense first, then defense\n while ($this->isValidMove($cellReturn) === FALSE) {\n //defense and offense\n foreach ($markers AS $marker) {\n foreach ($this->_winningCombination AS $cells) {\n $lineCells = explode(\",\", $cells); //separate the winning combination to 3\n $marked = 0;\n $noMark = 0;\n for ($x = 0; $x < 3; $x++) {\n if (in_array($lineCells[$x], $this->_markers[$marker]))\n $marked++;\n else\n $noMark = $lineCells[$x];\n }\n if ($marked == 2 && $this->isValidMove($noMark)) {\n $cellReturn = $noMark;\n break;\n }\n }\n if ($cellReturn != '')\n break;\n }\n //plan\n if ($cellReturn == '') {\n while (!$this->isValidMove($cellReturn)) {\n $combinationRandKey = rand(0, 7);\n //separate the winning combination to 3 elements\n $lineCells = explode(\",\", $this->_winningCombination[$combinationRandKey]);\n if ($this->isValidMove($lineCells[0]))\n $cellReturn = $lineCells[0];\n elseif ($this->isValidMove($lineCells[1]))\n $cellReturn = $lineCells[1];\n else\n $cellReturn = $lineCells[2];\n }\n }\n }\n return $cellReturn;\n }", "public function findMatch(Request $request){\n \t$online_users_id = $request->input('users');\n \t$excepts = $request->input('excepts');\n \t\n \t// var_dump($excepts);\n\n \t// remove if authenticated user id exists\n\t\twhile((array_search(Auth::user()->id, $online_users_id) === false ? false : true)){\n\t\t\t$k = array_search(Auth::user()->id, $online_users_id);\n\t\t\tarray_splice($online_users_id, $k, 1);\n\t\t}\n\t\t// remove all the excluded online_users_id users \n\t\tfor($y = 0; $y < count($excepts); $y++){\n \t\twhile((array_search($excepts[$y], $online_users_id) === false ? false : true)){\n \t\t\t$key = array_search($excepts[$y], $online_users_id);\n\n \t\t\tarray_splice($online_users_id, $key, 1);\n \t\t}\n\t\t}\n\t\t//get the first matched user\n \t$matched_users = [];\n \tfor($user = 0; $user < count($online_users_id); $user++){\n\t \t\n\t \tfor($w = 1; $w < 4 ; $w++){\n\n\t \t\t$a_rank = Auth::user()->ranks()\n\t \t\t\t->where('weakness_id', $w)->first()->rank;\n\t \t\t$u_rank = User::find($online_users_id[$user])->ranks()\n\t \t\t\t->where('weakness_id', $w)->first()->rank;\n\n\t \t\tif($a_rank == $u_rank || $a_rank == ($u_rank + 1) || $a_rank == ($u_rank - 1)){\n\t \t\t\t\t\n\t \t\t\t$matched_user = array($online_users_id[$user], $w);\n\n\t \t\t\tarray_push($matched_users, $matched_user);\n\t \t\t\tbreak;\n\t \t\t}\n\t \t}\n \t}\n\n \tif(count($matched_users) > 0){\n \t\t$random = rand(0, count($matched_users)-1);\n \t\t$result = $matched_users[$random];\n \t}else{\n \t\t$result = array(0,0);\n \t}\n\n\t\treturn $result;\n }", "protected function determine_hit_dice() {\n\t\t$this->hit_dice = 2;\n\t}", "abstract protected function winnerExists();", "function checkReqs($rank, $PID)\n{\n\t// Lets make sure we are dealing with the correct ranks!\n\t// Rank 7 is MSG, Rank 9 is MGYSG\n\tif($rank == 7 || $rank == 9)\n\t{\n\t\tswitch($rank)\n\t\t{\n\t\t\t// Rank is MSG\n\t\t\tcase 7:\n\t\t\t\t$award_list = array(\n\t\t\t\t\t'1031105' => 1, // Engineer Combat Badge\n\t\t\t\t\t'1031109' => 1, // Sniper Combat Badge\n\t\t\t\t\t'1031113' => 1, // Medic Combat Badge\n\t\t\t\t\t'1031115' => 1, // Spec Ops Combat Badge\n\t\t\t\t\t'1031119' => 1, // Assault Combat Badge\n\t\t\t\t\t'1031120' => 1, // Anti-tank Combat Badge\n\t\t\t\t\t'1031121' => 1, // Support Combat Badge\n\t\t\t\t\t'1031406' => 1, // Knife Combat Badge\n\t\t\t\t\t'1031619' => 1 // Pistol Combat Badge\n\t\t\t\t\t//'1032415' => 1, // Explosives Ordinance Badge\n\t\t\t\t\t//'1190507' => 1, // Engineer Badge\n\t\t\t\t\t//'1190601' => 1, // First Aid Badge\n\t\t\t\t\t//'1191819' => 1 // Resupply Badge\n\t\t\t\t);\n\t\t\tbreak;\n\t\t\t\n\t\t\t// Rank is MGYSG\n\t\t\tcase 9:\n\t\t\t\t$award_list = array(\n\t\t\t\t\t'1031923' => 1, // Ground Defense\n\t\t\t\t\t'1220104' => 1, // Air Defense\n\t\t\t\t\t'1220118' => 1, // Armor Badge\n\t\t\t\t\t'1220122' => 1, // Aviator Badge\n\t\t\t\t\t'1220803' => 1, // Helicopter Badge\n\t\t\t\t\t'1222016' => 1 // Transport Badge\n\t\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// Initiate an array of players earned awards\n\t\t$player_awards = array();\n\t\t\n\t\t// Start a query to get users awards\n\t\t$query = \"SELECT * FROM awards where id = $PID\";\n\t\t$result = mysql_query($query) or die('Query failed: ' . mysql_error());\n\t\t\n\t\t// Build the players earned awards to an array\n\t\twhile($row = mysql_fetch_assoc($result)) \n\t\t{\n\t\t\t$player_awards[$row['awd']] = $row['level'];\n\t\t}\n\t\t\n\t\t// Start a loop. For each required award, check to see 2 things:\n\t\t// 1) The player has the award\n\t\t// 2) The level of the award is equal to or greater then required\n\t\tforeach($award_list as $award => $level)\n\t\t{\n\t\t\t// Check if the award is in the list of players earned awards\n\t\t\tif(array_key_exists($award, $player_awards))\n\t\t\t{\n\t\t\t\t$lvl = $player_awards[$award];\n\t\t\t\t\n\t\t\t\t// Check to see if the level of the earned award is geater or equal\n\t\t\t\t// value of the required award\n\t\t\t\tif($lvl >= $level)\n\t\t\t\t{\n\t\t\t\t\t// Dont return false :p\n\t\t\t\t\t// The award is good, move to the next award in the loop\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// return FALSE because the level is too low\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Return FALSE because the user doesnt have the award\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If the loop finished, then the player had all awards so return TRUE!\n\t\treturn TRUE;\n\t}\n\telse\n\t{\n\t\t// What an error this is lol\n\t\treturn FALSE;\n\t}\n}", "abstract public function validate_attack($game, array $attackers, array $defenders);", "public function getFreight()\n {\n return $this->freight;\n }", "public function getWinsAttribute()\n {\n $wins = $this->allMatches()->filter(function ($match) {\n // Don't include playoff wins\n if ($match->isPlayoff()) {\n return false;\n }\n\n $home = ($this->id == $match->team1_id);\n if ($home && $match->team1_score > $match->team2_score) {\n return $match;\n }\n if (!$home && $match->team2_score > $match->team1_score) {\n return $match;\n }\n })->count();\n\n return $wins;\n }", "static function terranAttack($player1,$player2,&$logManager,$language){\r\n\t\t$dices = DiceManager::rollCombatDice($player1, $player2);\r\n\t\t$logManager->addLog('{Player1} '.$language['rolls'].' '.implode(\";\",array_values($dices[0])));\r\n\t\t$logManager->addLog('{Player2} '.$language['rolls'].' '.implode(\";\",array_values($dices[1])));\r\n\t\t\r\n\t\t$unitLost = array(0=>0,1=>0);\r\n\t\tfor ($i=0;$i<count($dices[1]);$i++){\r\n\t\t\tif ($dices[0][$i] <= $dices[1][$i]){\r\n\t\t\t\t$unitLost[0] += 1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$unitLost[1] += 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$logManager->addLog('{Player1} '.$language['losts'].' '.$unitLost[0].' '.$language['units']);\r\n\t\t$logManager->addLog('{Player2} '.$language['losts'].' '.$unitLost[1].' '.$language['units']);\r\n\t\t\r\n\t\treturn $unitLost;\r\n\t}", "public function hasFaction(){\r\n return $this->_has(1);\r\n }", "public function hasMaxTeam(){\n return $this->_has(7);\n }", "function killpointsFromDueling() {\n\tglobal $target_level,$attacker_level,$starting_target_health,$killpoints,$duel;\n\n\t$levelDifference = ($target_level-$attacker_level);\n\n\tif ($levelDifference > 10) {\n\t\t$levelDifferenceMultiplier = 5;\n\t} else if ($levelDifference > 0) {\n\t\t$levelDifferenceMultiplier = ceil($levelDifference/2); //killpoint return of half the level difference.\n\t} else {\n\t\t$levelDifferenceMultiplier = 0;\n\t}\n\n\t$killpoints = 1+$levelDifferenceMultiplier;\n}", "public function hasFireDefense(){\r\n return $this->_has(21);\r\n }", "public function calculateHappiness()\n {\n if ($this->seating->count() > 1) {\n $this->seating->rewind();\n\n for ($this->seating->rewind(); $this->seating->valid(); $this->seating->next()) {\n $currKnight = $this->seating->current();\n\n if (($this->seating->key() + 1) < $this->seating->count()) {\n $nextKnight = $this->seating->offsetGet($this->seating->key() + 1);\n $this->tableHappiness += $this->calculateHappinessChange($currKnight, $nextKnight);\n } else {\n $this->seating->rewind();\n $nextKnight = $this->seating->current();\n $this->tableHappiness += $this->calculateHappinessChange($currKnight, $nextKnight);\n break;\n }\n }\n\n }\n\n return $this->tableHappiness;\n }", "function getTrend($player, $season, $type) {\n\tglobal $dbUser, $dbPass, $dbTable, $con;\n\t$matches = array();\n\n\t$matchResult = mysqli_query($con,\"SELECT * FROM Games WHERE SeasonID = '$season' AND MatchType = '$type' AND Status = 'Complete' AND (ChallengerID = '$player' OR DefenderID = '$player') ORDER BY MatchID DESC\");\n\twhile($row = mysqli_fetch_assoc($matchResult)) {\n\t\t$matches[] = $row;\n\t}\n\n\t$trend = '';\n\t$trendCount = 0;\n\tforeach ($matches as $key => $value) {\n\t\tif ($trendCount > 0) {\n\t\t\t$tempTrend = '';\n\t\t\tif ($value['ChallengerID'] == $player && $value['ChallengerScore'] > $value['DefenderScore'] || $value['DefenderID'] == $player && $value['ChallengerScore'] < $value['DefenderScore']) {\n\t\t\t\t$tempTrend = 'Won';\n\t\t\t} else {\n\t\t\t\t$tempTrend = 'Lost';\n\t\t\t}\n\t\t\tif ($tempTrend == $trend) {\n\t\t\t\t$trendCount++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($value['ChallengerID'] == $player && $value['ChallengerScore'] > $value['DefenderScore'] || $value['DefenderID'] == $player && $value['ChallengerScore'] < $value['DefenderScore']) {\n\t\t\t\t$trend = 'Won';\n\t\t\t\t$trendCount++;\n\t\t\t} else {\n\t\t\t\t$trend = 'Lost';\n\t\t\t\t$trendCount++;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $trend . ' ' . $trendCount;\n}", "private function attack()\n {\n $this->tempAttackerStats = $this->attacker->stats;\n $this->tempDefenderStats = $this->defender->stats;\n\n // 1. Before hit check, apply all luck modifying skills\n $skills = array_filter($this->attacker->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_LUCK && $skill->type == Skill::TYPE_ATTACK;\n });\n array_walk(\n $skills, \n array($this, 'applySkill'),\n Skill::TARGET_ATTACKER,\n );\n\n $skills = array_filter($this->defender->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_LUCK && $skill->type == Skill::TYPE_DEFENCE;\n });\n array_walk(\n $skills,\n array($this, 'applySkill'),\n Skill::TARGET_DEFENDER,\n );\n\n // 2. Check if attack is evaded\n $luck = $this->tempDefenderStats[Character::STAT_LUCK];\n if ($luck != 0 && $this->chance($luck)) {\n return $this->status = self::STATUS_MISSED;\n }\n\n // 3. Apply stat modifier skills\n $skills = array_filter($this->attacker->character->skills, function (Skill $skill) {\n return $skill->stat != Character::STAT_LUCK\n && $skill->stat != Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_ATTACK;\n });\n array_walk(\n $skills,\n array($this, 'applySkill'),\n Skill::TARGET_ATTACKER,\n );\n\n $skills = array_filter($this->defender->character->skills, function (Skill $skill) {\n return $skill->stat != Character::STAT_LUCK\n && $skill->stat != Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_DEFENCE;\n });\n array_walk(\n $skills,\n array($this, 'applySkill'),\n Skill::TARGET_DEFENDER,\n );\n\n // 4. Calculate the damage\n $strength = $this->tempAttackerStats[Character::STAT_STRENGTH];\n $defence = $this->tempDefenderStats[Character::STAT_DEFENCE];\n\n $this->damage = max(0, $strength - $defence);\n\n // 5. Apply damage modifier skills\n $skills = array_filter($this->attacker->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_ATTACK;\n });\n array_walk(\n $skills,\n function (Skill $skill, $key) {\n $this->applyDamageSkill($skill, Skill::TARGET_ATTACKER, $this->damage);\n }\n );\n\n $skills = array_filter($this->defender->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_DEFENCE;\n });\n array_walk(\n $skills,\n function (Skill $skill, $key) {\n $this->applyDamageSkill($skill, Skill::TARGET_DEFENDER, $this->damage);\n }\n );\n\n // 6. Apply the final damage\n $this->defender->stats[Character::STAT_HEALTH] =\n max(0, $this->defender->stats[Character::STAT_HEALTH] - $this->damage);\n\n $this->status = self::STATUS_COMPLETED;\n }", "public function getAttacks()\n {\n return $this->attacks;\n }", "public function testVariousVillagersHaveSameRace()\n {\n if (!(defined('DEBUG') && DEBUG)) {\n $this->markTestSkipped();\n } else {\n $humans = ['peasant2', /*'thief2', */ 'guard2', 'merchant2'];\n foreach ($humans as $human) {\n $this->assertEquals('human', (new Npc($human))->race());\n }\n }\n }", "function checkLockFights($uid)\n{\n\tGlobal $conn;\n\t\n\t$query = \"SELECT IF(NOW() <= DATE_SUB(`users_fights`.`unlock_time`, INTERVAL 1 HOUR), DATE_FORMAT( DATE_SUB( FROM_UNIXTIME( UNIX_TIMESTAMP(`users_fights`.`unlock_time`) - UNIX_TIMESTAMP(NOW()) ), INTERVAL 4 HOUR), '%H:%i:%s'), '') as unlocktime, `users_fights`.`lock_fights`\n \tFROM `users_fights` \n WHERE `users_fights`.`user_id` = (SELECT `users`.`id` FROM `users` WHERE `VKuser` = '{$uid}' ORDER by `users`.`id` LIMIT 1)\n\t\t\t\";\n\t\n\t$res = mysql_query($query);\n\tif(mysql_error($conn)) trigger_error(MSG_PROBLEM_WITH_SQL);\n\t$data = mysql_fetch_array($res);\n\t\n\tif (isset($data['unlocktime']) && $data['unlocktime'] != '') \n\t{\n\t\t$responce = \"<result type='4'><time>{$data['unlocktime']}</time></result>\";\n\t\treturn $responce;\n\t} \n\telse {\n\t\tif (isset($data['lock_fights']) && $data['lock_fights'] != '') {\n\t\t\t$leftFights = 5 - $data['lock_fights'];\n\t\t} else {\n\t\t\t$leftFights = '5';\n\t\t}\n\t\t$responce = \"<leftfights>{$leftFights}</leftfights>\";\n\t\treturn $responce;\n\t}\n}", "public function check_wipers() {\r\n echo PHP_EOL;\r\n $this->action(\"checking wipers\");\r\n $this->action($this->wipers_on ? \"windshield wipers are on\" : \"windshield wipers are off\");\r\n }", "function scrapbots_get_armies($defenderid, $attackerid){\n\tglobal $session;\n\t//get attackers\n\t$sql = \"SELECT id,owner,name,activated,hitpoints,brains,brawn,briskness,junglefighter,retreathp FROM \".db_prefix(\"scrapbots\").\" WHERE owner = $attackerid\";\n\t$result = db_query($sql);\n\t$attacker = array();\n\tfor ($i=0;$i<db_num_rows($result);$i++){\n\t\t$attacker[$i]=db_fetch_assoc($result);\n\t}\n\t$sql = \"SELECT id,owner,name,activated,hitpoints,brains,brawn,briskness,junglefighter,retreathp FROM \".db_prefix(\"scrapbots\").\" WHERE owner = $defenderid\";\n\t$result = db_query($sql);\n\t$defender = array();\n\tfor ($i=0;$i<db_num_rows($result);$i++){\n\t\t$defender[$i]=db_fetch_assoc($result);\n\t}\n\tdebug(\"Debugging Attacker\");\n\tdebug($attacker);\n\tdebug(\"Debugging Defender\");\n\tdebug($defender);\n\t$armies = array(\"attacker\"=>$attacker, \"defender\"=>$defender);\n\t//Set starting vals\n\t$armies['attacker']['retreatpct'] = get_module_pref(\"retreatpct\",\"scrapbots\",$attackerid);\n\t$armies['defender']['retreat'] = get_module_pref(\"retreatpct\",\"scrapbots\",$defenderid);\n\tdebug (\"Debugging Armies\");\n\tdebug($armies);\n\treturn $armies;\n}", "function xstats_displayAllFights( $gameId ) {\n include ('../../inc.conf.php');\n echo '<br><h4>Liste aller Raumk&auml;mpfe nach Runden</h4>';\n $query = \"SELECT * FROM skrupel_xstats_ships ships,skrupel_xstats_shipvsship shipvsship WHERE shipvsship.shipid=ships.shipid AND (shipvsship.fightresult=2 OR shipvsship.fightresult=3) AND shipvsship.gameid=\".$gameId.\" AND ships.gameid=\".$gameId.\" ORDER BY turn,shipvsship.id\";\n $result = @mysql_query( $query ) or die(mysql_error());\n echo '<table class=\"shiptable\" border=\"0\">';\n echo '<tr><th>Runde</th><th colspan=\"3\">Kampf</th><th>H&uuml;llenschaden</tr>';\n while ($row = mysql_fetch_array($result)) {\n echo \"<tr>\";\n //turn\n echo '<td class=\"highlight\">'.$row['turn'].'</td>';\n echo '<td>';\n //get victorous ship\n $query = \"SELECT * FROM skrupel_xstats_ships WHERE gameid=\".$gameId.\" AND shipid=\".$row['enemyshipid'];\n $victoryResult = @mysql_query( $query ) or die(mysql_error());\n $victoryRow = mysql_fetch_array($victoryResult);\n echo xstats_getShipFullDescription( $gameId, $victoryRow['shipid'], $victoryRow['shiprace'], $victoryRow['picturesmall'], $victoryRow['experience'], $row['turn'],$victoryRow['shipclass'],$victoryRow['shipname']);\n echo '</td><td>';\n if( $row['fightresult'] == 2) {\n $turnToUse = $row['turn'];\n echo ' zerst&ouml;rt ';\n }else {\n echo ' erobert ';\n //display the formerly owner of this ship\n $turnToUse = $row['turn']-1;\n }\n echo '</td><td>';\n echo xstats_getShipFullDescription( $gameId, $row['shipid'], $row['shiprace'], $row['picturesmall'], $row['experience'], $turnToUse,$row['shipclass'],$row['shipname']);\n echo '</td>';\n //get hull damage of winning ship\n $query = \"SELECT * FROM skrupel_xstats_shipvsship WHERE shipid=\".$row['enemyshipid'].\" AND enemyshipid=\".$row['shipid'].\" AND gameid=\".$gameId;\n $winnerResult = @mysql_query( $query ) or die(mysql_error());\n $winnerResult = mysql_fetch_array($winnerResult);\n $hullDamage = $winnerResult['hulldamage'];\n echo '<td>'.$hullDamage.'%';\n //hull damage bar\n echo '<div class=\"hulldamage\">';\n echo '<div style=\"width: '.(100-$hullDamage).'%\"></div>';\n echo '</div>';\n echo '</td>';\n echo \"</tr>\";\n }\n echo '</table>';\n}", "public function getWinners()\n\t{\n\t\treturn $this->winners;\n\t}", "public static function myWonCount()\n {\n $query = new Query;\n return $query->select(['id'])->from('contest_proposal')->where(['user_won'=>'1', 'user_id' => \\Yii::$app->user->getId()])->count();\n }", "function doAttack(&$objSrcUser, &$objTrgUser, $arrSentArmy)\n{\n $srcKd = $objSrcUser->get_stat(ALLIANCE);\n $trgKd = $objTrgUser->get_stat(ALLIANCE);\n $strSrcRace = $objSrcUser->get_stat(RACE);\n $iSrcLand = $objSrcUser->get_build(LAND);\n $arrTrgBuilds = $objTrgUser->get_builds();\n $gains = pow(($arrTrgBuilds[LAND] / $iSrcLand), 2) + ($arrTrgBuilds[LAND] / ($iSrcLand * 3));\n $gains = min ($gains,1);\n\n $quick_gains = 0.01 * $gains; // 1% Land Gain\n\n if ($strSrcRace == \"Oleg Hai\")\n $quick_gains = $quick_gains * 1.3;\n\n //==========================================================================\n // Calculate Acre Gains\n //==========================================================================\n include_once('inc/functions/build.php');\n $arrBuildVars = getBuildingVariables($objTrgUser->get_stat(RACE));\n $arrBuildVars = $arrBuildVars['variables'];\n $max_build = $objTrgUser->get_number_build_types();\n $total_grab = 0;\n\n for($i = 1; $i <= $max_build; $i++)\n {\n $strVar = trim($arrBuildVars[$i]);\n $acres_won[$strVar] = round($arrTrgBuilds[$strVar]* ($quick_gains));\n $buildings = $objTrgUser->get_build($strVar);\n $land = $objTrgUser->get_build(LAND);\n $arrBuilds = array ($strVar => $buildings - $acres_won[$strVar], LAND => $land - $acres_won[$strVar] );\n $objTrgUser->set_builds($arrBuilds);\n $total_grab = $total_grab + $acres_won[$strVar];\n }\n\n // Explored\n $explore_gains = 0.2;\n $acres_explored = round($total_grab * $explore_gains);\n $land = $objSrcUser->get_build(LAND);\n $objSrcUser->set_build(LAND, ($land + $acres_explored));\n\n\n //==========================================================================\n // Calculate Citizens Killed\n //==========================================================================\n $trgCits = $objTrgUser->get_pop(CITIZENS);\n\n $max_kill = $trgCits * 0.2;\n $trgRace = $objTrgUser->get_stat(RACE);\n\n if ($max_kill < ($arrTrgBuilds[LAND] * 3) && $trgRace != \"Dragon\")\n $max_kill = $arrTrgBuilds[LAND] * 3;\n elseif ($max_kill < ($arrTrgBuilds[LAND] * 2) && $trgRace == \"Dragon\")\n $max_kill = $arrTrgBuilds[LAND] * 2;\n\n // War effects on max kill\n include_once(\"inc/functions/war.php\");\n $modifier = war_alli($srcKd, $trgKd);\n if ($modifier == 2)\n $max_kill = $max_kill * 1.2;\n\n // Martel: small bug fixed, $arrTrgBuilds not $arrTrgBuild\n $wallsPercent = ($arrTrgBuilds[WALLS] * 100) / $arrTrgBuilds[LAND];\n if ($wallsPercent > 20)\n $wallsPercent = 20;\n\n // frost: age 18, each % walls shelters 2% citizen\n for ($y = 1; $y <= $wallsPercent; $y++)\n $max_kill *= 0.98;\n\n // Max citizens to kill == citizens available\n $max_kill = round($max_kill);\n if ($max_kill > $trgCits)\n $max_kill = $trgCits;\n\n if ($max_kill > 0)\n {\n $intCitizens_alive = $trgCits - $max_kill;\n $objTrgUser->set_pop(CITIZENS, $intCitizens_alive);\n }\n else\n $max_kill = 0;\n\n // Let's see if we killed the tribe\n include_once('inc/functions/generic.php');\n obj_test_for_kill($objTrgUser, $objSrcUser);\n\n //==========================================================================\n // Calculate Cash Gains and Fame\n //==========================================================================\n $trgMoney = $objTrgUser->get_good(MONEY);\n\n $mod = 1;\n $stolen_crowns = round($trgMoney * 0.04);\n\n if ($arrTrgBuilds[LAND] > $iSrcLand)\n $fame_win = round($total_grab * 1.0);\n elseif ($arrTrgBuilds[LAND] < ($iSrcLand * 0.7))\n {\n $fame_win = round(-$total_grab * 1.0);\n $mod = ($arrTrgBuilds[LAND] * 1.3) / $iSrcLand;\n }\n else\n $fame_win = round($total_grab * 1.2);\n\n if ($mod < 0.7)\n $mod = 0.7;\n\n $max_crowns = round($arrTrgBuilds[LAND] * 500);\n\n $stolen_crowns = min(round($stolen_crowns * $mod), round($max_crowns));\n\n $objTrgUser->set_good(MONEY, $trgMoney - $stolen_crowns);\n $money = $objSrcUser->get_good(MONEY);\n $objSrcUser->set_good(MONEY, $money + $stolen_crowns);\n\n //==========================================================================\n // Return time\n //==========================================================================\n $wait = 4; // 4 hour attack time\n\n if ($strSrcRace == \"Raven\")\n $wait = 1;\n elseif ($strSrcRace == \"Mori Hai\" || $strSrcRace == \"Dragon\")\n $wait = 3;\n\n $landtime = 'land_t' . $wait;\n $objSrcUser->set_user_info(NEXT_ATTACK, $wait);\n\n //==========================================================================\n // Add land to incoming\n //==========================================================================\n if ($total_grab > 0)\n {\n $old_land = $objSrcUser->get_build($landtime);\n $objSrcUser->set_build($landtime, $total_grab + $old_land);\n }\n\n //==========================================================================\n // Calculate Fame Gains\n //==========================================================================\n\n // War effects\n $objSrcAlliance = $objSrcUser->get_alliance();\n require_once('inc/functions/war.php');\n if (checkWarBetween($objSrcAlliance, $trgKd))\n {\n // Update land counter in new war system March 06, 2008 Martel\n $iNeeded = $objSrcAlliance->get_war('land_needed');\n $objSrcAlliance->set_war('land_needed', max(0, $iNeeded - $total_grab));\n\n // War effects on fame\n $fame_win *= 1.2;\n }\n\n // Cannot take more fame than what the target has\n $fame_win = round($fame_win);\n $target_fame = $objTrgUser->get_stat(FAME);\n if ($fame_win > $target_fame)\n $fame_win = $target_fame;\n\n $fame1 = $objSrcUser->get_stat(FAME) + $fame_win;\n $fame2 = $target_fame - $fame_win;\n $objSrcUser->set_stat(FAME, $fame1);\n $objTrgUser->set_stat(FAME, $fame2);\n\n //==========================================================================\n\n $arrResults['gained_acres'] = $total_grab;\n $arrResults['explored_acres'] = $acres_explored;\n $arrResults['gained_fame'] = $fame_win;\n $arrResults['gained_crowns'] = $stolen_crowns;\n $arrResults['killed_citizens'] = $max_kill;\n\n return $arrResults;\n}", "function get_penalty_types() {\n\t$array = array(\n\t\t\t\"Abuse of officials\" \t=> 2,\n\t\t\t\"Aggressor penalty\"\t\t=> 2,\n\t\t\t\"Attempt to injure\"\t\t=> 2,\n\t\t\t\"Biting\"\t\t\t\t=> 2,\n\t\t\t\"Boarding\"\t\t\t\t=> 2,\n\t\t\t\"Butt-ending\"\t\t\t=> 2,\n\t\t\t\"Broken stick\"\t\t\t=> 2,\n\t\t\t\"Charging\"\t\t\t\t=> 2,\n\t\t\t\"Checking from behind\"\t=> 2,\n\t\t\t\"Illegal check to the head\" => 2,\n\t\t\t\"Clipping\" \t\t\t\t=> 2,\n\t\t\t\"Cross-checking\" \t\t=> 2,\n\t\t\t\"Delay of game\" \t\t=> 2,\n\t\t\t\"Diving\"\t\t\t\t=> 2,\n\t\t\t\"Elbowing\"\t\t\t\t=> 2,\n\t\t\t\"Eye-gouging\"\t\t\t=> 2,\n\t\t\t\"Fighting\"\t\t\t\t=> 5,\n\t\t\t\"Goaltender Interference\" => 2,\n\t\t\t\"Goaltender Leaving Crease\" => 2,\n\t\t\t\"Head-butting\" => 2,\n\t\t\t\"High-sticking (2 min)\" => 2,\n\t\t\t\"High-sticking (4 min)\" => 2,\n\t\t\t\"Holding\" => 2,\n\t\t\t\"Holding the stick\" => 2,\n\t\t\t\"Illegal Equipment\" => 2,\n\t\t\t\"Instigator penalty\" => 2,\n\t\t\t\"Interference\" => 2,\n\t\t\t\"Joining a fight\" => 10,\n\t\t\t\"Kicking\" => 5,\n\t\t\t\"Kneeing\" => 2,\n\t\t\t\"Leaving the Penalty Bench\" => 2,\n\t\t\t\"Playing with Too Many Sticks\" => 2,\n\t\t\t\"Roughing\" => 2,\n\t\t\t\"Secondary Altercation\" => 2,\n\t\t\t\"Slashing\" => 2,\n\t\t\t\"Slew Footing\" => 2,\n\t\t\t\"Spearing\" => 2,\n\t\t\t\"Starting the wrong lineup\" => 2,\n\t\t\t\"Substitution infraction (Illegal Substitution)\" => 2,\n\t\t\t\"Throwing Equipment\" => 2,\n\t\t\t\"Too many men on the ice\" => 2,\n\t\t\t\"Tripping\" => 2, \n\t\t\t\"Unsportsmanlike conduct\" => 2\n\t\t);\n\n\treturn $array;\n}", "function checkTactics($Chosen){\r\n\tif(strpos($this->Player['tactics'],$Chosen) === false && $Chosen) $this->sendError(\"未習得該戰術。\");\r\n\telseif (empty($this->Tactics['name'])) $this->sendError(\"不明的戰術。\");\r\n\telseif (!$this->Tactics['name']) $this->sendError(\"不明的戰術。\");\r\n\r\n\t// Init. EN cost and SP cost\r\n\t$this->Tactics['enc'] = (isset($this->Tactics['enc'])) ? $this->Tactics['enc'] : 0;\r\n\t$this->SP_Cost = $this->Tactics['spc'];\r\n\t$this->Eq['A']['enc'] += $this->Tactics['enc'];\r\n}", "public function passes();", "function getOpponents($player, $matches) {\n\t$opponents = array();\n\tforeach ($matches as $key => $value) {\n\t\tif ($value['ChallengerID'] == $player) {\n\t\t\tif(!in_array($value['DefenderID'], $opponents)) {\n\t\t\t\t$opponents[] = $value['DefenderID'];\n\t\t\t}\n\t\t} else if ($value['DefenderID'] == $player){\n\t\t\tif(!in_array($value['ChallengerID'], $opponents)) {\n\t\t\t\t$opponents[] = $value['ChallengerID'];\n\t\t\t}\n\t\t}\n\t}\n\treturn $opponents;\n}", "public function hasIceDefense(){\r\n return $this->_has(14);\r\n }", "public function calculateTotalBreakfast()\n\t{\n\t\t$result = 0;\n\t\t$passengers = $this->getPassengers();\n\n\t\tif( count($passengers) )\n\t\t{\n\t\t\tforeach ($passengers as $passenger)\n\t\t\t{\n\t\t\t\tif( (int)$passenger->status < 3 )\n\t\t\t\t{\n\t\t\t\t\tif($passenger->breakfast)\n\t\t\t\t\t{\n\t\t\t\t\t\t$result++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}" ]
[ "0.6877447", "0.67428297", "0.6733686", "0.6501916", "0.65003145", "0.6324866", "0.62455493", "0.60707074", "0.60130423", "0.59307796", "0.5893888", "0.584395", "0.5833165", "0.58239335", "0.5792797", "0.5777609", "0.57772684", "0.5761216", "0.5736095", "0.57348514", "0.5714914", "0.5700038", "0.5608713", "0.5575607", "0.5554461", "0.55308795", "0.5504884", "0.54786843", "0.54454195", "0.5425084", "0.5421255", "0.54199946", "0.5356685", "0.53489727", "0.5337017", "0.5318554", "0.53182757", "0.5317241", "0.53150517", "0.53074294", "0.52764314", "0.52592534", "0.5252854", "0.5250075", "0.52473336", "0.5239779", "0.5233745", "0.5221312", "0.51999384", "0.51981723", "0.5191313", "0.5190165", "0.51847464", "0.5181163", "0.5174579", "0.5169749", "0.5163998", "0.5162738", "0.5153935", "0.51255494", "0.51192844", "0.51145864", "0.5114345", "0.5110449", "0.5108572", "0.51073205", "0.5100907", "0.5094152", "0.50825477", "0.507804", "0.5074767", "0.5073275", "0.5062741", "0.5058477", "0.5050565", "0.5038888", "0.5037953", "0.50301194", "0.50152636", "0.5004232", "0.5002773", "0.4995464", "0.4995273", "0.49943668", "0.49915674", "0.49781907", "0.49747375", "0.4974379", "0.49676347", "0.495987", "0.4945259", "0.49431956", "0.49386713", "0.49379233", "0.4930945", "0.49269375", "0.492259", "0.49169427", "0.4910846", "0.49055207" ]
0.6700141
3
Display a listing of the resource.
public function index(Request $request) { if (!$request->ajax()) return redirect('/'); $buscar = $request->buscar; $criterio = $request->criterio; if($buscar==''){ $provincias = Provincia::orderBy('id', 'desc')->paginate(6); }else{ $provincias = Provincia::where($criterio, 'like', '%'.$buscar.'%')->orderBy('id', 'desc')->paginate(6); } return [ 'pagination' => [ 'total' => $provincias->total(), 'current_page' => $provincias->currentPage(), 'per_page' => $provincias->perPage(), 'last_page' => $provincias->lastPage(), 'from' => $provincias->firstItem(), 'to' => $provincias->lastItem(), ], 'provincias' => $provincias ]; }
{ "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
Store a newly created resource in storage.
public function store(Request $request) { if (!$request->ajax()) return redirect('/'); $provincia = new Provincia(); $provincia->iddepartamento = $request->iddepartamento; $provincia->descripcion = strtoupper($request->descripcion); $provincia->condicion = '1'; $provincia->save(); }
{ "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
Update the specified resource in storage.
public function update(Request $request) { if (!$request->ajax()) return redirect('/'); $provincia = Provincia::findOrFail($request->id); $provincia->iddepartamento = $request->iddepartamento; $provincia->descripcion = strtoupper($request->descripcion); $provincia->condicion = '1'; $provincia->save(); }
{ "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
Builds an XML Map used to parse listeners from an XML source
protected function xmlListenersMapFactory() { $map = new Map(); $map->add( Path::factory('/fwk/listener', 'listeners') ->loop(true) ->attribute('class') ->attribute('service') ->addChildren( Path::factory('param', 'params') ->attribute('name') ->filter(array($this, 'propertizeString')) ->value('value') ->loop(true) ) ); return $map; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function build_xml_map() {\n $this->_create_map();\n header(\"content-type: text/xml\");\n echo $this->result;\n }", "protected function xmlServicesMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/services', 'services', array())\n ->loop(true, '@xml')\n ->attribute('xmlMap')\n );\n \n return $map;\n }", "protected function xmlPluginsMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/plugin', 'plugins')\n ->loop(true)\n ->attribute('class')\n ->attribute('service')\n ->addChildren(\n Path::factory('param', 'params')\n ->attribute('name')\n ->filter(array($this, 'propertizeString'))\n ->value('value')\n ->loop(true)\n )\n );\n\n return $map;\n }", "public static function getMap() {\n\t\t$map = array (\"SendListener\" => \"sendPerformed\", \"BeforeSendListener\" => \"beforeSendPerformed\", \"CommandListener\" => \"commandSent\", \"BeforeCommandListener\" => \"beforeCommandSent\", \"ResponseListener\" => \"responseReceived\", \"ConnectListener\" => \"connectPerformed\", \"DisconnectListener\" => \"disconnectPerformed\" );\n\t\treturn $map;\n\t}", "protected static function buildEventMaps()\n {\n \\Log::info('Building event cache');\n\n // Build event mapping from services in database\n\n //\tInitialize the event map\n $processEventMap = [];\n $broadcastEventMap = [];\n\n // Pull any custom swagger docs\n $result = ServiceModel::with(\n [\n 'serviceDocs' => function ($query){\n $query->where('format', ApiDocFormatTypes::SWAGGER);\n }\n ]\n )->get();\n\n //\tSpin through services and pull the events\n foreach ($result as $service) {\n $apiName = $service->name;\n try {\n if (empty($content = ServiceModel::getStoredContentForService($service))) {\n throw new \\Exception(' * No event content found for service.');\n continue;\n }\n\n $serviceEvents = static::parseSwaggerEvents($apiName, $content);\n\n //\tParse the events while we get the chance...\n $processEventMap[$apiName] = ArrayUtils::get($serviceEvents, 'process', []);\n $broadcastEventMap[$apiName] = ArrayUtils::get($serviceEvents, 'broadcast', []);\n\n unset($content, $service, $serviceEvents);\n } catch (\\Exception $ex) {\n \\Log::error(\" * System error building event map for service '$apiName'.\\n{$ex->getMessage()}\");\n }\n }\n\n static::$eventMap = ['process' => $processEventMap, 'broadcast' => $broadcastEventMap];\n\n //\tWrite event cache file\n \\Cache::forever(static::EVENT_CACHE_KEY, static::$eventMap);\n\n \\Log::info('Event cache build process complete');\n }", "public function getXMLPageMap() {\n\t\tstatic $xml;\n\n\t\tif (isset($xml)) return $xml;\n\t\t$cache = SA_SimpleCache::singleton('__XML_PAGES_MAP__');\n\t\tif ($xmlString = $cache->load()) {\n\t\t\t$xml = new SimpleXMLElement($xmlString);\n\t\t} else {\n\t\t\t$xml = new SimpleXMLElement('<?xml version=\"1.0\" standalone=\"yes\"?><pages/>');\n\t\t\t$this->xmlFileSystem($this->getPagesDir(), $xml);\n\t\t\t$cache->save($xml->asXML());\n\t\t}\n\t\treturn $xml;\n\t}", "protected function xmlActionMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/actions/action', 'actions')\n ->loop(true, '@name')\n ->attribute('class')\n ->attribute('method')\n ->attribute('shortcut')\n );\n \n return $map;\n }", "protected function xmlIniMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/ini', 'ini', array())\n ->loop(true)\n ->attribute('category')\n ->value('value')\n );\n \n return $map;\n }", "function get_listener_config_data() {\n $config_file = file_get_contents('config.xml');\n $config_xml = new SimpleXMLElement($config_file);\n $location = $config_xml->path;\n if (empty($location)) {\n //try using a default\n $location = '/opt/php_listeners';\n }\n $services = $config_xml->services->service;\n return array('location' => $location, 'services' => $services);\n}", "protected function _getDomMap()\n {\n $domMap = parent::_getDomMap();\n $domMap = reset($domMap);\n\n return [\n 'initSubscriptionResponse' => array_merge([\n 'transactionId' => 'transactionId',\n 'subscriptionPageUrl' => 'subscriptionPageUrl',\n 'status' => 'status',\n ], $domMap)\n ];\n }", "public function init_from_xml($xml, $from = Bean::SOURCE_STRING)\n {\n if($from == Bean::SOURCE_URL || $from == Bean::SOURCE_FILE)\n {\n $xdom = @simplexml_load_file($xml);\n }\n if($from == Bean::SOURCE_STRING)\n {\n $xdom = @simplexml_load_string($xml);\n }\n\n foreach($xdom as $key => $val)\n {\n $this->set($key,$val); \n } \n }", "protected function parseEventsXML(&$observers, $eventsFile, $key)\n {\n $xml = simplexml_load_file($eventsFile);\n foreach ($xml->children()->event as $event) {\n $observer = [];\n $observer['name'] = (string) $event['name'];\n $observer['instance'] = (string) $event->observer['instance'];\n\n $observers[$key][] = $observer;\n }\n\n // Update the totals\n $observers[\"total_{$key}\"] = count($observers[$key]);\n $observers['total'] = $observers['total'] + $observers[\"total_{$key}\"];\n }", "protected function parseXmlNode(\\DOMElement $node, $map) {\n /** @var \\DOMElement $attribute */\n $attribute = $node->firstChild;\n $result = [];\n do {\n $name = $attribute->localName;\n if (isset($map['sourceMap'][$name])) {\n foreach($map['sourceMap'][$name] as $target) {\n //pass null since we do not have implemented $row yes to pass to normalize\n $value = $this->normalize($attribute->nodeValue, $map['map'][$target]['type'], $node);\n\n if (isset($result[$target])) {\n switch ($map['map'][$target]['multiple']) {\n case 'array': if (is_array($result[$target])) {\n $result[$target][] = $value;\n } else {\n $result[$target] = [$result[$target], $value];\n }\n break;\n case 'last':\n $result[$target] = $value;\n break;\n default:\n throw new \\Exception(\"Unknown value for multiple: {$map['map'][$target]['multiple']}\");\n\n }\n } else {\n $result[$target] = $value;\n }\n }\n }\n } while(null !== $attribute = $attribute->nextSibling);\n foreach($map['map'] as $target => $def) {\n if (!isset($result[$target])) {\n $result[$target] = null;\n }\n }\n return $result;\n }", "protected static function buildEventMaps()\n {\n \\Log::info('Building event cache');\n\n // Build event mapping from services in database\n\n //\tInitialize the event map\n $eventMap = [];\n\n // Pull any custom swagger docs\n $result = ServiceModel::whereIsActive(true)->get();\n\n //\tSpin through services and pull the events\n /** @var ServiceModel $model */\n foreach ($result as $model) {\n $apiName = $model->name;\n try {\n /** @var BaseRestService $service */\n if (empty($service = ServiceManager::getService($apiName))) {\n throw new \\Exception('No service found.');\n }\n\n if ($service instanceof FileServiceInterface) {\n // don't want the full folder list here\n $accessList = (empty($service->getPermissions()) ? [] : ['', '*']);\n } else {\n $accessList = $service->getAccessList();\n }\n\n if (!empty($accessList)) {\n if (!empty($doc = $model->getDocAttribute())) {\n if (is_array($doc) && !empty($content = array_get($doc, 'content'))) {\n if (is_string($content)) {\n $content = ServiceModel::storedContentToArray($content, array_get($doc, 'format'),\n $model);\n if (!empty($content)) {\n $eventMap[$apiName] = static::parseSwaggerEvents($content, $accessList);\n }\n }\n }\n }\n }\n } catch (\\Exception $ex) {\n \\Log::error(\" * System error building event map for service '$apiName'.\\n{$ex->getMessage()}\");\n }\n\n unset($content, $service, $serviceEvents);\n }\n\n static::$eventMap = $eventMap;\n\n \\Log::info('Event cache build process complete');\n }", "function parse_application_events($file)\r\n {\r\n $doc = new DOMDocument();\r\n $result = array();\r\n\r\n $doc->load($file);\r\n $object = $doc->getElementsByTagname('application')->item(0);\r\n $result['name'] = $object->getAttribute('name');\r\n\r\n // Get events\r\n $events = $doc->getElementsByTagname('event');\r\n $trackers = array();\r\n\r\n foreach ($events as $index => $event)\r\n {\r\n $event_name = $event->getAttribute('name');\r\n $trackers = array();\r\n\r\n // Get trackers in event\r\n $event_trackers = $event->getElementsByTagname('tracker');\r\n $attributes = array('name', 'active');\r\n\r\n foreach ($event_trackers as $index => $event_tracker)\r\n {\r\n $property_info = array();\r\n\r\n foreach ($attributes as $index => $attribute)\r\n {\r\n if ($event_tracker->hasAttribute($attribute))\r\n {\r\n $property_info[$attribute] = $event_tracker->getAttribute($attribute);\r\n }\r\n }\r\n $trackers[$event_tracker->getAttribute('name')] = $property_info;\r\n }\r\n\r\n $result['events'][$event_name]['name'] = $event_name;\r\n $result['events'][$event_name]['trackers'] = $trackers;\r\n }\r\n\r\n return $result;\r\n }", "function xml_to_array()\r\n {\r\n $output=array();\r\n \r\n foreach($this->xpath_map as $key=>$value)\r\n {\r\n $output[$key]=$value['data'];\r\n }\r\n \r\n return $output;\r\n }", "private function _getXSIMap($actionParam){\n\t\t$arrayMap = array();\n\t\tforeach($actionParam->childNodes as $item){\n\t\t\tif($item->nodeType==1){\n\t\t\t\tif($item->localName=='item'){\n\t\t\t\t\t$index = null;\n\t\t\t\t\t$value = null;\n\t\t\t\t\tforeach($item->childNodes as $node){\n\t\t\t\t\t\tif($node->nodeType==1){\n\t\t\t\t\t\t\tif($node->localName=='key'){\n\t\t\t\t\t\t\t\t$index = (string) $node->nodeValue;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif($node->localName=='value'){\n\t\t\t\t\t\t\t\t\t$paramType = $node->getAttributeNS($this->_xmlSchemaNamespace, 'type');\n\t\t\t\t\t\t\t\t\tif($this->_isTypeLiteral($paramType)==true){\n\t\t\t\t\t\t\t\t\t\t$value = $this->_decodeXSDType($paramType, $node->nodeValue);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif($paramType=='ns2:Map'){\n\t\t\t\t\t\t\t\t\t\t\t$value = $this->_getXSIMap($node);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tif($paramType=='SOAP-ENC:Array'||$paramType=='enc:Array'){\n\t\t\t\t\t\t\t\t\t\t\t\t$value = $this->_getSoapArray($node);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$value = null;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($index!==null){\n\t\t\t\t\t\t$arrayMap[$index] = $value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$arrayMap[] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $arrayMap;\n\t}", "abstract protected function buildMap();", "function begin_xml() {\n\t\tglobal $pgv_lang, $factarray;//, $eventsArray, $dom, $ePeople, $this->eFams, $egSources, $ePlaces, $eObject;\n\t\t$user = PGV_USER_NAME;\n\n\t\t$this->dom = new DomDocument(\"1.0\", \"UTF-8\");\n\t\t$this->dom->formatOutput = true;\n\n\t\t$eRoot = $this->dom->createElementNS(\"http://gramps-project.org/xml/1.1.0/\", \"database\");\n\t\t$eRoot = $this->dom->appendChild($eRoot);\n\n\t\t$eHeader = $this->dom->createElement(\"header\");\n\t\t$eHeader = $eRoot->appendChild($eHeader);\n\n\t\t$eCreated = $this->dom->createElement(\"created\");\n\t\t$eCreated = $eHeader->appendChild($eCreated);\n\t\t$eCreated->setAttribute(\"date\", date(\"Y-m-d\"));\n\t\t$eCreated->setAttribute(\"version\", \"1.1.2.6\");\n\n\t\t$eResearcher = $this->dom->createElement(\"researcher\");\n\t\t$eResname = $this->dom->createElement(\"resname\");\n\t\t$etResname = $this->dom->createTextNode(getUserFullName($user));\n\t\t$etResname = $eResname->appendChild($etResname);\n\t\t$eResname = $eResearcher->appendChild($eResname);\n\t\t$eResemail = $this->dom->createElement(\"resemail\");\n\t\t$etResemail = $this->dom->createTextNode(get_user_setting($user, 'email'));\n\t\t$etResemail = $eResemail->appendChild($etResemail);\n\t\t$eResemail = $eResearcher->appendChild($eResemail);\n\t\t$eResearcher = $eHeader->appendChild($eResearcher);\n\n\t\t$this->egEvents = $this->dom->createElement(\"events\");\n\t\t$this->egEvents = $eRoot->appendChild($this->egEvents);\n\n\t\t$this->ePeople = $this->dom->createElement(\"people\");\n\t\t$this->ePeople = $eRoot->appendChild($this->ePeople);\n\n\t\t$this->eFams = $this->dom->createElement(\"families\");\n\t\t$this->eFams = $eRoot->appendChild($this->eFams);\n\n\t\t$this->egSources = $this->dom->createElement(\"sources\");\n\t\t$this->egSources = $eRoot->appendChild($this->egSources);\n\n\t\t$this->ePlaces = $this->dom->createElement(\"places\");\n\t\t$this->ePlaces = $eRoot->appendChild($this->ePlaces);\n\n\t\t$this->eObject = $this->dom->createElement(\"objects\");\n\t\t$this->eObject = $eRoot->appendChild($this->eObject);\n\t}", "private function generateMaps(): void\n {\n $this->socketMap = $this->streamMap = [\n self::RESOURCE => [\n self::READ => [],\n self::WRITE => []\n ],\n self::HANDLER => [\n self::READ => [],\n self::WRITE => []\n ]\n ];\n\n $socketCount = $streamCount = 0;\n\n\n\n // Sockets\n foreach ($this->sockets as $id => $binding) {\n /** @var resource|Socket $socket */\n $socket = $binding->getIoResource();\n $resourceId = $this->identifySocket($socket);\n\n if ($binding->isStreamBased()) {\n /** @var resource $socket */\n $this->streamMap[self::RESOURCE][$binding->ioMode][$resourceId] = $socket;\n $this->streamMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $streamCount++;\n } else {\n $this->socketMap[self::RESOURCE][$binding->ioMode][$resourceId] = $socket;\n $this->socketMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $socketCount++;\n }\n }\n\n\n // Streams\n foreach ($this->streams as $id => $binding) {\n /** @var resource $stream */\n $stream = $binding->getIoResource();\n $resourceId = (int)$stream;\n\n $this->streamMap[self::RESOURCE][$binding->ioMode][$resourceId] = $stream;\n $this->streamMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $streamCount++;\n }\n\n\n // Signals\n $this->signalMap = [];\n\n foreach ($this->signals as $id => $binding) {\n foreach (array_keys($binding->signals) as $number) {\n $this->signalMap[$number][$id] = $binding;\n }\n }\n\n // Cleanup\n if (!$socketCount) {\n $this->socketMap = null;\n }\n\n if (!$streamCount) {\n $this->streamMap = null;\n }\n\n $this->generateMaps = false;\n }", "protected function getMap(): ReferenceMap\n {\n return new ReferenceMap(\n [\n new SrcNode(\n new \\SplFileInfo('folder/Example/ClassExample.php'),\n new FullClassName('Example', 'ClassExample'),\n [\n new Inheritance(0, new FullClassName('Example', 'ParentClassExample')),\n new Inheritance(0, new FullClassName('', 'FilterIterator')),\n new Dependency(0, new FullClassName('Example', 'AnotherClassExample')),\n new Dependency(0, new FullClassName('Vendor', 'ThirdPartyExample')),\n new Dependency(0, new FullClassName('', 'iterable')),\n new Composition(0, new FullClassName('Example', 'InterfaceExample')),\n new Composition(0, new FullClassName('Example', 'AnotherInterface')),\n new Composition(0, new FullClassName('', 'iterable')),\n new Mixin(0, new FullClassName('Example', 'TraitExample')),\n new Mixin(0, new FullClassName('', 'PHPDocElement'))\n ]\n )\n ],\n [\n new FullClassName('', 'iterable'),\n new FullClassName('', 'FilterIterator'),\n new FullClassName('', 'PHPDocElement'),\n ],\n [\n new ComposerPackage('main', [], [], [], [])\n ]\n );\n }", "static function xmlList()\n\t{\n\t\treturn simplexml_load_file('http://ws.geonames.org/countryInfo');\n\t}", "public function getInstanceFromXML($xml, &$xmlMapping, $tracker) {\n $rules = array();\n //test this better\n if(property_exists($xml, 'list_rules')) {\n $list_rules = $xml->list_rules;\n $rules['list_rules'] = $this->generateListRulesArrayFromXml($list_rules, $xmlMapping, $tracker);\n }\n \n if(property_exists($xml, 'date_rules')) {\n $date_rules = $xml->date_rules;\n $rules['date_rules'] = $this->generateDateRulesArrayFromXml($date_rules, $xmlMapping, $tracker);\n }\n\n return $rules;\n }", "public static function getEventMap()\n {\n if (!empty(static::$eventMap)) {\n return static::$eventMap;\n }\n\n static::$eventMap = \\Cache::get(static::EVENT_CACHE_KEY);\n\n //\tIf we still have no event map, build it.\n if (empty(static::$eventMap)) {\n static::buildEventMaps();\n }\n\n return static::$eventMap;\n }", "function venture_geo_process_map_xml($id, $params) { \n $output = '';\n if ($params) {\n $output = \" <state id=\\\"$id\\\">\\n\";\n foreach ($params as $name => $value) {\n if($value) \n $output .= \" <$name>$value</$name>\\n\";\n }\n $output .= \" </state>\\n\";\n }\n return $output;\n}", "function generate_mapservice_conf_file(){\n\t\t$dom;\n\t\tif(!$dom = domxml_open_file($this->default_mapservconf_file)){\n\t\t\techo \"Could not open xml file: \" . $this->default_mapservconf_file;\n\t\t\treturn NULL; \n\t\t}\n\t\t$mapservice = $this->find_mapservice($dom);\n\t\t// map service not found\n\t\tif($mapservice == NULL){\n\t\t\techo \"could not find map-service named: \" . $mapservice_name ;\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\t$children = $mapservice->child_nodes();\n\t\t$n_children = count($children);\n\t\t\n\t\t// loop through to find <map-file>\n\t\t// and <layer-config> element\n\t\tfor($i = 0; $i < $n_children; $i++){\n\t\t\tswitch ($children[$i]->tagname){\n\t\t\t\tcase \"map-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_mapfile);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"layer-config-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_layerconf);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$dom->dump_file($this->output_mapservconf, false, false);\n\t\treturn $this->output_mapservconf;\n\t}", "public function __construct(XMLDocument $x = null) {\n \n // initialize the string map\n $this->dbc = new StringMap();\n \n // set the values\n $this->dbc->set(\"name\",\n $x->xpath(\"normalize-space(string(//database/@name))\")); \n $this->dbc->set(\"type\",\n $x->xpath(\"normalize-space(string(//database/type))\")); \n $this->dbc->set(\"driver\",\n $x->xpath(\"normalize-space(string(//database/driver))\")); \n $this->dbc->set(\"host\",\n $x->xpath(\"normalize-space(string(//database/host))\")); \n $this->dbc->set(\"port\",\n $x->xpath(\"normalize-space(string(//database/port))\")); \n $this->dbc->set(\"user\",\n $x->xpath(\"normalize-space(string(//database/user))\")); \n $this->dbc->set(\"pass\",\n $x->xpath(\"normalize-space(string(//database/pass))\")); \n $this->dbc->set(\"db\",\n $x->xpath(\"normalize-space(string(//database/db))\")); \n $this->dbc->set(\"ssl\",\n $x->xpath(\"normalize-space(string(//database/ssl))\")); \n $this->dbc->set(\"persistent\",\n $x->xpath(\"normalize-space(string(//database/persistent))\"));\n $this->dbc->set(\"charset\",\n $x->xpath(\"normalize-space(string(//database/charset))\")); \n $this->dbc->set(\"timeout\",\n $x->xpath(\"normalize-space(string(//database/timeout))\")); \n\n }", "public function getEventMappings()\n {\n return [\n HttpRequestEvent::EVENT_ID => [\n 'method' => 'onRequest',\n 'priority' => Priority::MIN\n ]\n ];\n }", "abstract protected function buildData(DOMDocument $xml);", "public static function buildTableMap()\n {\n $dbMap = Propel::getServiceContainer()->getDatabaseMap(CKOrderXmlTableMap::DATABASE_NAME);\n if (!$dbMap->hasTable(CKOrderXmlTableMap::TABLE_NAME)) {\n $dbMap->addTableObject(new CKOrderXmlTableMap());\n }\n }", "function get_event_xml(){\n// $xml = simplexml_load_file($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/calendar-categories.xml\");\n $xml = autoCache(\"simplexml_load_file\", array($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/calendar-categories.xml\"));\n $categories = array();\n $xml = $xml->{'system-page'};\n foreach ($xml->children() as $child) {\n if($child->getName() == \"dynamic-metadata\"){\n foreach($child->children() as $metadata){\n if($metadata->getName() == \"value\"){\n array_push($categories, (string)$metadata);\n }\n }\n }\n }\n// $xml = simplexml_load_file($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/events.xml\");\n $xml = autoCache(\"simplexml_load_file\", array($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/events.xml\"));\n $event_pages = $xml->xpath(\"//system-page[system-data-structure[@definition-path='Event']]\");\n $dates = array();\n $datePaths = array();\n foreach($event_pages as $child ){\n $page_data = inspect_page($child, $categories);\n if (!$page_data[\"hide-from-calendar\"]){\n $dates = add_event_to_array($dates, $page_data, $datePaths);\n }\n }\n return $dates;\n}", "public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true,\n\t\t\t\t'title' => Loc::getMessage('LOG_ENTITY_ID_FIELD'),\n\t\t\t),\n\t\t\t'TIMESTAMP_X' => array(\n\t\t\t\t'data_type' => 'datetime',\n\t\t\t\t'required' => false,\n\t\t\t\t'title' => Loc::getMessage('LOG_ENTITY_TIMESTAMP_X_FIELD'),\n\t\t\t),\n\t\t\t'EVENT' => array(\n\t\t\t\t'data_type' => 'text',\n\t\t\t\t'required' => true,\n\t\t\t\t'title' => Loc::getMessage('LOG_ENTITY_EVENT_FIELD'),\n\t\t\t),\n\t\t);\n\t}", "public function prepare_getVillaMap($params)\n\t{\n\t\t$xml_string = \"strVillaURL=\".$params['strVillaURL'].\"\";\n\t\treturn $xml_string;\n\t}", "public function buildFromXML($eloXML = null){\n\t\tif ($eloXML !== null){\n\t\t\t$dom = str_get_dom($eloXML);\n\t\t\t\n\t\t\t$contentWithDataTag = $this->getElemAtPos($dom, 'content', 0);\n\t\t\t$dataTag = $this->getElemAtPos($contentWithDataTag, 'data', 0); \n\t\t\tif ($dataTag->innertext !== null){\n\t\t\t\t$content = $dataTag->innertext;\n\t\t\t}else{\n\t\t\t\t$content = '';\n\t\t\t}\n\t\t\t\n\t\t\t$this->setContent($content);\n\t\t\t\n\t\t\t$metadataElem = $this->getElemAtPos($dom, 'metadata', 0);\n\t\t\tif ($metadataElem !== null){\n\t\t\t\tforeach($metadataElem->childNodes() as $curMetadataElem){\n\t\t\t\t\t\n\t\t\t\t\tif ($curMetadataElem->tag == 'uri'){\n\t\t\t\t\t\t$curMetadataElem = $curMetadataElem->find('entry');\n\t\t\t\t\t\t$curMetadataElem = $curMetadataElem[0];\n\t\t\t\t\t\t\n\t\t\t\t\t\t$key = 'uri';\n\t\t\t\t\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\t$key = $curMetadataElem->tag;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$value = $curMetadataElem->innertext;\n\t\t\t\t\t$this->_metadata[$key] = $value;\n\n\t\t\t\t\t// extract the id from URI\n\t\t\t\t\tif ($key === 'uri'){\n\t\t\t\t\t\t$this->_id = substr(strrchr($value, '/'), 1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// This code is to dynamically set the values for the\n\t\t\t\t\t// elo's metadatas\n\t\t\t\t\t/*\n\t\t\t\t\t * THIS WAS MESSING UP THE POPULATION OF THE CODE. \n\t\t\t\t\t * SEEMS TO BE DOING THE EXACT SAME THING AS $this->_metadata[$key] = $value; BUT ADDING A _<mt key> VARIABLE THAT\n\t\t\t\t\t * MESSES UP THE XML GENERATION.\n\t\t\t\t\t */\n//\t\t\t\t\t$keyVar = \"_\" . $key;\n//\t\t\t\t\t$this->$keyVar = $value;\n//\t\t\t\t\t$this->addMetadata($key, $value);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$resourceElem = $this->getElemAtPos($dom, 'resource', 0);\n\t\t\tif ($resourceElem !== null){\n\t\t\t\tif ($resourceElem ){\n\t\t\t\t\tforeach($resourceElem->childNodes() as $curResourceElem){\n\t\t\t\t\t\t$key = $curResourceElem->tag;\n\t\t\t\t\t\t$value = $curResourceElem->innertext;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->_resources[$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function xmlProvider() {\n\n return [\n [\n 'hello',\n 'hello',\n ],\n [\n '<element>hello</element>',\n '<element xmlns=\"http://sabredav.org/ns\">hello</element>'\n ],\n [\n '<element foo=\"bar\">hello</element>',\n '<element xmlns=\"http://sabredav.org/ns\" foo=\"bar\">hello</element>'\n ],\n [\n '<element x1:foo=\"bar\" xmlns:x1=\"http://example.org/ns\">hello</element>',\n '<element xmlns:x1=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\" x1:foo=\"bar\">hello</element>'\n ],\n [\n '<element xmlns=\"http://example.org/ns\">hello</element>',\n '<element xmlns=\"http://example.org/ns\">hello</element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\">hello</x1:element>',\n ],\n [\n '<element xmlns:foo=\"http://example.org/ns\">hello</element>',\n '<element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\">hello</element>',\n '<element>hello</element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\">hello</foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\">hello</foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\">hello</x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child>hello</child></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child>hello</child></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child>hello</child></x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child/></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child/></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child/></x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child a=\"b\"/></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child a=\"b\"/></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child a=\"b\"/></x1:element>',\n ],\n ];\n\n }", "function initMap() {\n\n\t\t// Instantiate the xajax object and configure it\n\t\trequire_once (t3lib_extMgm::extPath('xajax') . 'class.tx_xajax.php');\n\t\t$this->xajax = t3lib_div::makeInstance('tx_xajax'); // Make the instance\n\t\tif ($GLOBALS['TSFE']->metaCharset == 'utf-8') {\n\t\t\t$this->xajax->decodeUTF8InputOn(); // Decode form vars from utf8\n\t\t}\n\t\t$this->xajax->setCharEncoding($GLOBALS['TSFE']->metaCharset); \t\t// Encode of the response to utf-8 ???\n\t\t$this->xajax->setWrapperPrefix($this->prefixId); \t\t// To prevent conflicts, prepend the extension prefix\n\t\t$this->xajax->statusMessagesOn(); \t\t// Do you wnat messages in the status bar?\n\n\t\t// register the functions of the ajax requests\n\t\t$this->xajax->registerFunction(array('infomsg', &$this, 'ajaxGetInfomsg'));\n\t\t$this->xajax->registerFunction(array('activeRecords', &$this, 'ajaxGetActiveRecords'));\n\t\t$this->xajax->registerFunction(array('processCat', &$this, 'ajaxProcessCat'));\n\t\t$this->xajax->registerFunction(array('tab', &$this, 'ajaxGetPoiTab'));\n\t\t$this->xajax->registerFunction(array('search', &$this, 'ajaxSearch'));\n\t\t$this->xajax->registerFunction(array('processCatTree', &$this, 'ajaxProcessCatTree'));\n\t\t$this->xajax->registerFunction(array('getDynamicList', &$this, 'ajaxGetDynamicList'));\n\n\t\t$this->xajax->processRequests();\n\n\t\t// additional output using a template\n\t\t$template['total'] = $this->cObj2->getSubpart($this->templateCode,'###HEADER###');\n\t\t$markerArray = $subpartArray = array();\n\t\t$markerArray['###PATH###'] = t3lib_extMgm::siteRelpath('rggooglemap');\n\n\t\tif ($this->conf['map.']['addLanguage'] == 1) {\n\t\t\tif ($this->conf['map.']['addLanguage.']['override'] != '') {\n\t\t\t\t$markerArray['###MAP_KEY###'] .= '&hl=' . $this->conf['map.']['addLanguage.']['override'];\n\t\t\t} elseif ($GLOBALS['TSFE']->lang != '') {\n\t\t\t\t$markerArray['###MAP_KEY###'] .= '&hl=' . $GLOBALS['TSFE']->lang;\n\t\t\t}\n\t\t}\n\n\t\t$markerArray['###DYNAMIC_JS###'] = $this->getJs();\n\n\t\t// load spefic files if needed for clustering\n\t\tif ($this->conf['map.']['activateCluster'] == 1) { // gxmarkers\n\t\t\t$subpartArray['###CLUSTER_2###'] = '';\n\n\t\t} elseif ($this->conf['map.']['activateCluster'] == 2) { // markerclusterer\n\t\t\t$subpartArray['###CLUSTER_1###'] = '';\n\t\t} else { // no clustering\n\t\t\t$subpartArray['###CLUSTER_1###'] = $subpartArray['###CLUSTER_2###'] = '';\n\t\t}\n\n\t\t$totalJS = $this->cObj2->substituteMarkerArrayCached($template['total'],$markerArray, $subpartArray);\n\t\t$GLOBALS['TSFE']->additionalHeaderData['rggooglemap_xajax'] = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('xajax'));\n\t\t$GLOBALS['TSFE']->additionalHeaderData['rggooglemap_js'] = $totalJS;\n\t}", "private function genSitemapXML() {\n $url_same = array();\n $sitemap_xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\" xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\">\n <!-- created by CSZ CMS Sitemap Generator www.cszcms.com -->'.\"\\n\";\n $sitemap_xml.= '<url>\n\t<loc>'.base_url().'</loc>\n\t<changefreq>always</changefreq>\n </url>'.\"\\n\";\n if($this->lang !== FALSE){ /* Language */\n foreach ($this->lang as $row) {\n $url = $this->Csz_model->base_link().'/lang/'.$row['lang_iso'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n if($this->menu_other !== FALSE){ /* Navigation */\n foreach ($this->menu_other as $row) {\n $chkotherlink = strpos($row['other_link'], BASE_URL);\n if($row['pages_id'] && $row['pages_id'] != NULL && $row['pages_id'] != 0){\n $pages = $this->Csz_model->getValue('page_url', 'pages', \"active = '1' AND pages_id = '\".$row['pages_id'].\"'\", '', 1, 'page_url', 'ASC'); \n if($row['drop_page_menu_id'] != 0 && $row['drop_page_menu_id'] != NULL){\n $main = $this->Csz_model->getValue('menu_name', 'page_menu', \"active = '1' AND page_menu_id = '\".$row['drop_page_menu_id'].\"'\", '', 1, 'menu_name', 'ASC'); \n $url = $this->Csz_model->base_link().'/'.$this->Csz_model->rw_link($main->menu_name).'/'.$pages->page_url;\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }else{\n $url = $this->Csz_model->base_link().'/'.$pages->page_url;\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }else if($row['other_link'] && $row['other_link'] != NULL && $chkotherlink !== FALSE){ \n if(!in_array($row['other_link'], $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$row['other_link'].'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $row['other_link'];\n }\n }else if($row['plugin_menu'] && $row['plugin_menu'] != NULL){\n $url = $this->Csz_model->base_link().'/plugin/'.$row['plugin_menu'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n }\n if($this->pages_content !== FALSE){ /* Pages Content without navigation */\n foreach ($this->pages_content as $row) {\n $url = $this->Csz_model->base_link().'/'.$row['page_url'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n if($this->plugin !== FALSE){ /* Plugin with sitemap config */\n foreach ($this->plugin as $row) {\n $plugin_db = $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sitemap_viewtable');\n if(!empty($plugin_db)){\n $plugindata = $this->Csz_model->getValueArray('*', $plugin_db, $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sqlextra_condition'), '', 0, $plugin_db.'_id', 'DESC');\n if($plugindata !== FALSE){\n foreach ($plugindata as $rs) {\n $url = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/view/'.$rs[$plugin_db.'_id'].'/'.$rs['url_rewrite'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n if($row['plugin_config_filename'] == 'article'){\n $urlamp = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/amp/'.$rs[$plugin_db.'_id'].'/'.$rs['url_rewrite'];\n if(!in_array($urlamp, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$urlamp.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $urlamp;\n }\n }\n }\n }\n }\n $plugin_cat_db = $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sitemap_cattable');\n if(!empty($plugin_cat_db)){\n $plugindata = $this->Csz_model->getValueArray('*', $plugin_cat_db, $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sqlextra_catcondition'), '', 0, $plugin_cat_db.'_id', 'DESC');\n if($plugindata !== FALSE){\n foreach ($plugindata as $rs) {\n $url = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/category/'.$rs['url_rewrite'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n }\n } \n }\n $sitemap_xml.= '</urlset>'.\"\\n\";\n if($sitemap_xml){\n /* Gen sitemap.xml */\n $file_path = FCPATH.\"sitemap.xml\";\n $fopen = fopen($file_path, 'wb') or die(\"can't open file\");\n fwrite($fopen, $sitemap_xml);\n fclose($fopen);\n /* Gen sitemap.xml.gz */\n $gzdata = @gzencode($sitemap_xml, 9);\n if($gzdata !== FALSE){\n $fopen1 = fopen(FCPATH.\"sitemap.xml.gz\", 'wb') or die(\"can't open file\");\n fwrite($fopen1, $gzdata);\n fclose($fopen1);\n }\n\t}\n }", "public function load_maps_file()\r\n {\r\n log_message('debug', 'Reloading '. XML_MAPS_FILE .' file from manaserv');\r\n\r\n // load the configured path and filename from config file\r\n $this->maps_file = $this->CI->config->item('manaserv-data_path') . XML_MAPS_FILE;\r\n\r\n // check if the file really exists and is readable\r\n if (!file_exists($this->maps_file))\r\n {\r\n show_error('The '. XML_MAPS_FILE .' file ' . $this->maps_file . ' configured'.\r\n ' in mana_config.php cannot be found');\r\n return;\r\n }\r\n else\r\n {\r\n // reset current maps\r\n $this->maps = array();\r\n\r\n // load and parse the xml file\r\n $maps = simplexml_load_file($this->maps_file);\r\n foreach ($maps as $map)\r\n {\r\n // loop through defined maps and build internal array\r\n $m = new Map(\r\n intval($map->attributes()->id), // id\r\n strval($map->attributes()->name) // name\r\n );\r\n\r\n // set description if available\r\n if (strlen(strval($map->attributes()->description)) > 0)\r\n {\r\n $m->setDescription(strval($map->attributes()->description));\r\n }\r\n\r\n $this->maps[$m->getId()] = $m;\r\n }\r\n\r\n $this->flush_maps();\r\n }\r\n log_message('debug', 'Reloading '. XML_MAPS_FILE .' file ... done');\r\n }", "protected function rss()\n {\n $return = array();\n foreach ($this->xml->channel->item as $item) {\n $callbackReturn = $this->applyCallbacks($item);\n $return[] = array_merge($callbackReturn, array(\n 'service' => $this->settings['service'],\n 'type' => $this->settings['type'],\n 'stamp' => (int) strtotime($item->pubDate),\n 'text' => (string) $item->title,\n 'url' => (string) $item->link,\n 'resource' => $this->settings['resource_name'],\n ));\n }\n\n return $return;\n }", "public function loadXml($filename,$map_path){\r\n \r\n $this->rootPath = $this->_preparePath($map_path);\r\n \r\n if(!File::exists( $this->rootPath .DS. $filename ))\r\n App::critical_error ('XML document not found: '.$this->rootPath .DS. $filename);\r\n \r\n $xmlDoc = $this->_initDocument($this->rootPath .DS. $filename);\r\n \r\n //get the project elements\r\n $elements = $xmlDoc->getElementsByTagName('element');\r\n \r\n foreach($elements as $element){\r\n \r\n if(count($this->elements) == 0 ){\r\n $this->elements = $this->_loadElement($element);\r\n }\r\n else{\r\n $this->elements = array_merge($this->elements,$this->_loadElement($element));\r\n }\r\n }\r\n \r\n //isolate the template key\r\n if(!is_null($this->_templatekey) && !is_null($this->elements[$this->_templatekey]))\r\n $this->elements['templates'] = $this->elements[$this->_templatekey];\r\n \r\n //clean the element values\r\n //array_walk_recursive($this->element, array($this, '_clean'));\r\n \r\n return File::put(APP_PROJECT .DS. 'elements.php' ,serialize($this->elements)); \r\n }", "public static function attributeMap();", "public function generateMap()\n {\n try\n {\n // Select all published articles and pages.\n // Lessons and other new stuff to be added upon needed.\n $pgs = ORM::factory( 'Page' )\n ->where( 'status', '>', 0 )\n ->find_all()->as_array();\n\n $articles = ORM::factory( 'Article' )\n ->where( 'status', '>', 0 )\n ->find_all()->as_array();\n \n // Place found URLs into the container array.\n $pages = [];\n foreach ( array_merge( $pgs, $articles ) as $value )\n array_push ( $pages, $value->make_full_url () );\n \n // Select whatever is already in the map...\n $urls = [];\n foreach ( $this->map->children() as $node )\n $urls[] = ( string )$node->loc;\n\n // Delete redundant links\n foreach ( array_diff( $urls, $pages ) as $url )\n $this->removeEntry( $url, FALSE, TRUE );\n\n // Add missing links.\n foreach ( array_diff( $pages, $urls ) as $uri )\n $this->addEntry ( $uri, NULL, FALSE, TRUE );\n\n // Save result into the file.\n return $this->save();\n }\n catch ( Exception $e )\n {\n Kohana::$log->add( LOG_ERR, $e->getMessage() );\n return FALSE;\n }\n }", "protected static function loadListeners() {\n\t\t\n\t\t// default var\n\t\t$configDir = Config::getOption(\"configDir\");\n\t\t\n\t\t// make sure the listener data exists\n\t\tif (file_exists($configDir.\"/listeners.json\")) {\n\t\t\t\n\t\t\t// get listener list data\n\t\t\t$listenerList = json_decode(file_get_contents($configDir.\"/listeners.json\"), true);\n\t\t\t\n\t\t\t// get the listener info\n\t\t\tforeach ($listenerList[\"listeners\"] as $listenerName) {\n\t\t\t\t\n\t\t\t\tif ($listenerName[0] != \"_\") {\n\t\t\t\t\t$listener = new $listenerName();\n\t\t\t\t\t$listeners = $listener->getListeners();\n\t\t\t\t\tforeach ($listeners as $event => $eventProps) {\n\t\t\t\t\t\t$eventPriority = (isset($eventProps[\"priority\"])) ? $eventProps[\"priority\"] : 0;\n\t\t\t\t\t\tself::$instance->addListener($event, array($listener, $eventProps[\"callable\"]), $eventPriority);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "protected function _loadListeners() {\n\t\tforeach (array_keys($this->config('listeners')) as $name) {\n\t\t\t$this->_loadListener($name);\n\t\t}\n\t}", "public function getEventDefinitions()\n\t{\n\t\t$output = '';\n\n\t\t$reader = $this->getReader();\n\n\t\tforeach ($this->getClassesToScan() as $class)\n\t\t{\n\t\t\tforeach ($class->getMethods() as $method)\n\t\t\t{\n\t\t\t\tforeach ($reader->getMethodAnnotations($method) as $annotation)\n\t\t\t\t{\n\t\t\t\t\t$output .= $this->buildListener($class->name, $method->name, $annotation->events);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn trim($output);\n\t}", "function GetEventListeners() {\n $my_file = '{%IEM_ADDONS_PATH%}/dynamiccontenttags/dynamiccontenttags.php';\n $listeners = array ();\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_SENDSTUDIOFUNCTIONS_GENERATEMENULINKS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'SetMenuItems'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_USERAPI_GETPERMISSIONTYPES',\n 'trigger_details' => array (\n 'Interspire_Addons',\n 'GetAddonPermissions',\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_DCT_HTMLEDITOR_TINYMCEPLUGIN',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'DctTinyMCEPluginHook'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_EDITOR_TAG_BUTTON',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'CreateInsertTagButton'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_GETALLTAGS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'getAllTags'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_REPLACETAGCONTENT',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'replaceTagContent'\n ),\n 'trigger_file' => $my_file\n );\n\n return $listeners;\n }", "final protected function buildDependencyMap() {\n\n\t\t$this->dependencyMap = array();\n\t\t$this->prioritiesHandlers = array();\n $p = new dummyPriorityhookHandler();\n\t\t$this->prioritiesHandlers[self::NORMAL] = $p;\n $this->priorityBased = array('min' => array(),'max' => array());\n\t\t//$this->priorityBased['min'][self::NORMAL][spl_object_hash($p)] = $p;\n\t\tforeach ($this->objects as $hash => $handler) {\n\t\t\t$this->priorityBased['min'][self::NORMAL][$hash] = $handler;\n\t\t\t$this->dependencyMap[$hash] = array('priority' => $this->prioritiesHandlers[self::NORMAL]);\n\t\t\t$this->priorityBased['max'][self::LATEST-1][$hash] = $handler;\n\t\t\t$handler->registerDependencies($this);\n\t\t}\n\t}", "function xmllist() {\n\t\tglobal $mysql;\n\t\t$result[$this->class_name()] = $mysql->select(\"SELECT * FROM \".$this->class_name, true);\n\t\t$output = XML::get($result);\n\t\treturn xml($output);\n\t}", "private function getTopicMap () {\n\t\t$config = Zend_Registry::getInstance()->config;\n\t\t$entries = $config->catalog->topic_map;\n\t\t$topicMap = array();\n\t\tif ($entries && count($entries)) {\n\t\t\tforeach ($entries as $key => $entry) {\n\t\t\t\tif (!isset($entry->id) || !$entry->id)\n\t\t\t\t\tthrow new Exception('Each topic_map entry must have an id, \"'.$key.'\" does not.');\n\t\t\t\tif (!isset($entry->url) || !$entry->url)\n\t\t\t\t\tthrow new Exception('Each topic_map entry must have an url, \"'.$key.'\" does not.');\n\t\t\t\t$topicMap[$entry->id] = $entry->url;\n\t\t\t}\n\t\t}\n\t\treturn $topicMap;\n\t}", "function webmap_compo_lib_xml_build()\r\n{\r\n\t$this->webmap_compo_lib_xml_base();\r\n}", "function _init() {\n\t\t$total = $this->node->documentElement->childCount;\n\t\t$itemCounter = 0;\n\t\t$channelCounter = 0;\n\t\t$categoryCounter = 0;\n\t\t\n\t\tfor ($i = 0; $i < $total; $i++) {\n\t\t\t$currNode =& $this->node->documentElement->childNodes[$i];\n\t\t\t$tagName = strtolower($currNode->nodeName);\n\n\t\t\tswitch ($tagName) {\n\t\t\t\tcase DOMIT_RSS_ELEMENT_ITEM:\t\t\t\t\t\n\t\t\t\t\t$this->domit_rss_items[$itemCounter] =& new xml_domit_rss_item($currNode);\n\t\t\t\t\t$itemCounter++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOMIT_RSS_ELEMENT_CHANNEL:\n\t\t\t\t\t$this->domit_rss_channels[$channelCounter] =& new xml_domit_rss_channel($currNode);\n\t\t\t\t\t$channelCounter++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOMIT_RSS_ELEMENT_CATEGORY:\n\t\t\t\t\t$this->domit_rss_categories[$categoryCounter] =& new xml_domit_rss_category($currNode);\n\t\t\t\t\t$categoryCounter++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOMIT_RSS_ELEMENT_IMAGE:\n\t\t\t\t\t$this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_image($currNode);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOMIT_RSS_ELEMENT_CLOUD:\n\t\t\t\t\t$this->indexer[$tagName] =& new xml_domit_rss_cloud($currNode);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOMIT_RSS_ELEMENT_TEXTINPUT:\n\t\t\t\t\t$this->indexer[$tagName] =& new xml_domit_rss_textinput($currNode);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOMIT_RSS_ELEMENT_TITLE:\n case DOMIT_RSS_ELEMENT_LINK:\n case DOMIT_RSS_ELEMENT_DESCRIPTION:\n case DOMIT_RSS_ELEMENT_LANGUAGE:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_COPYRIGHT:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_MANAGINGEDITOR:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_WEBMASTER:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_PUBDATE:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_LASTBUILDDATE:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_GENERATOR:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_DOCS:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_TTL:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_RATING:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_SKIPHOURS:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_SKIPDAYS:\n\t\t\t\t $this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_simpleelement($currNode);\n\t\t\t\t break;\n\t\t\t\tdefault:\n\t\t\t\t $this->addIndexedElement($currNode);\n\t\t\t\t\t//$this->indexer[$tagName] =& $currNode;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($itemCounter != 0) {\n\t\t\t$this->DOMIT_RSS_indexer[DOMIT_RSS_ARRAY_ITEMS] =& $this->domit_rss_items;\n\t\t}\n\t\t\n\t\tif ($channelCounter != 0) {\n\t\t\t$this->DOMIT_RSS_indexer[DOMIT_RSS_ARRAY_CHANNELS] =& $this->domit_rss_channels;\n\t\t}\n\t\t\n\t\tif ($categoryCounter != 0) {\n\t\t\t$this->DOMIT_RSS_indexer[DOMIT_RSS_ARRAY_CATEGORIES] =& $this->domit_rss_categories;\n\t\t}\n\t\t\n\t\t$this->handleChannelElementsEmbedded();\n\t}", "function GetMapContent($hide_mode_ids) {\n\tglobal $config;\n\n\t$lang = GetLangContent(\"map\");\n\n\t$map = array();\n\tif (file_exists($config[\"site_path\"].\"/include/map.xml\")) {\n\t\t$xml_parser = new SimpleXmlParser( $config[\"site_path\"].\"/include/map.xml\" );\n\t\t$xml_root = $xml_parser->getRoot();\n\n\t\tforeach ( $xml_root->children as $cnt => $xml_section ) {\n\t\t\tif (!isset($xml_section->attrs[\"id\"]) || (isset($xml_section->attrs[\"id\"]) && !in_array($xml_section->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t$section = array();\n\t\t\t\t$section = array(\"name\" => (isset($lang[$xml_section->attrs[\"name\"]]) ? $lang[$xml_section->attrs[\"name\"]] : $xml_section->attrs[\"name\"]), \"link\" => $xml_section->attrs[\"link\"]);\n\t\t\t\tif ($xml_section->children) {\n\t\t\t\t\tforeach ( $xml_section->children as $xml_subsection_cnt => $xml_subsection ) {\n\t\t\t\t\t\tif (!isset($xml_subsection->attrs[\"id\"]) || (isset($xml_subsection->attrs[\"id\"]) && !in_array($xml_subsection->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t\t\t\t$subsection = array();\n\t\t\t\t\t\t\t$subsection[\"name\"] = (isset($lang[$xml_subsection->attrs[\"name\"]]) ? $lang[$xml_subsection->attrs[\"name\"]] : $xml_subsection->attrs[\"name\"]);\n\t\t\t\t\t\t\t$subsection[\"link\"] = $xml_subsection->attrs[\"link\"];\n\t\t\t\t\t\t\tif ($xml_subsection->children) {\n\t\t\t\t\t\t\t\t$item = array();\n\t\t\t\t\t\t\t\tforeach ( $xml_subsection->children as $xml_item_cnt => $xml_item ) {\n\t\t\t\t\t\t\t\t\tif (!isset($xml_item->attrs[\"id\"]) || (isset($xml_item->attrs[\"id\"]) && !in_array($xml_item->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t\t\t\t\t\t\t$item[] = array(\"name\" => (isset($lang[$xml_item->attrs[\"name\"]]) ? $lang[$xml_item->attrs[\"name\"]] : $xml_item->attrs[\"name\"]), \"link\" => $xml_item->attrs[\"link\"]);\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\t$subsection[\"subsection\"] = $item;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$section[\"subsection\"][] = $subsection;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$map[] = $section;\n\t\t\t}\n\t\t}\n\t}\n\treturn $map;\n}", "protected function parseXmlFile() {}", "function readFolderXML(){\n\t\t\t// confirm it exists first!\n\t\t\tif (file_exists($_SERVER['DOCUMENT_ROOT'].\"/\".$this -> rootFolder.\"/folderList.xml\")){\n\t\t\t\t\n\t\t\t\t$xml = simplexml_load_file(\t$_SERVER['DOCUMENT_ROOT'].\"/\".$this -> rootFolder.\"/folderList.xml\");\n\t\t\t\tforeach($xml->children() as $child){\n\t\t\t\t\t\n\t\t\t\t\t$this -> folderMap[ (string) $child['id']] = (string) $child['name'];\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function _init(){\n\t\t$total = $this->node->childCount;\n\n\t\tfor($i = 0; $i < $total; $i++) {\n\t\t\t$currNode =& $this->node->childNodes[$i];\n\t\t\t$tagName = strtolower($currNode->nodeName);\n\n\t\t switch ($tagName) {\n case DOMIT_RSS_ELEMENT_TITLE:\n case DOMIT_RSS_ELEMENT_LINK:\n case DOMIT_RSS_ELEMENT_DESCRIPTION:\n case DOMIT_RSS_ELEMENT_URL:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_WIDTH:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_HEIGHT:\n\t\t\t\t $this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_simpleelement($currNode);\n\t\t\t\t break;\n\t\t\t\tdefault:\n\t\t\t\t $this->addIndexedElement($currNode);\n\t\t\t\t //$this->DOMIT_RSS_indexer[$tagName] =& $currNode;\n\t\t }\n\t\t}\n\t}", "protected function getRegisteredEvents() {\n// $events = [];\n// foreach ($this->loadMultiple() as $rules_config) {\n// $event = $rules_config->getEvent();\n// if ($event && !isset($events[$event])) {\n// $events[$event] = $event;\n// }\n// }\n// return $events;\n }", "function get_map($source)\n{\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_json = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('person', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n 'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_datajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_socratajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'upload' => array('upload', 2),\n 'format' => array('format', 2),\n 'name' => array('name', 2),\n 'modified' => array('modified',1),\n );\n\n // 'dest_key' => array('source_key', dest_position, source_position)\n // 0/1/2 denotes root/extras/resources.\n $map_ckan = array(\n 'title' => array('title', 0, 0),\n 'notes' => array('notes', 0, 0),\n // hard-code publisher to orgnization.title in ckan_map for now.\n // todo: change this map structure.\n 'publisher' => array('place-holder', 1, 1),\n 'public_access_level' => array('access-level', 1, 1),\n 'contact_email' => array('contact-email', 1, 1),\n 'contact_name' => array('person', 1, 1),\n 'unique_id' => array('id', 1, 0),\n 'tags' => array('tags', 0, 1),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('data-dictiionary', 1, 1), // there is a typo.\n 'license_title' => array('license_title', 0, 0),\n 'spatial' => array('spatial-text', 1, 1),\n 'temporal' => array('dataset-reference-date', 1, 1),\n 'release_date' => array('issued', 1, 1),\n 'accrual_periodicity' => array('frequency-of-update', 1, 1),\n 'related_documents' => array('references', 1, 1),\n 'language' => array('metadata-language', 1, 1),\n 'homepage_url' => array('url', 1, 0),\n 'url' => array('url', 2, 2),\n 'name' => array('name', 2, 2),\n 'format' => array('format', 2, 2),\n );\n\n $ret_map = \"map_$source\";\n return isset($$ret_map) ? $$ret_map : null;\n}", "function _init(){\n\t\t$total = $this->node->childCount;\n\n\t\tfor($i = 0; $i < $total; $i++) {\n\t\t\t$currNode =& $this->node->childNodes[$i];\n\t\t\t$tagName = strtolower($currNode->nodeName);\n\n\t\t switch ($tagName) {\n case DOMIT_RSS_ELEMENT_TITLE:\n case DOMIT_RSS_ELEMENT_LINK:\n case DOMIT_RSS_ELEMENT_DESCRIPTION:\n case DOMIT_RSS_ELEMENT_NAME:\n\t\t\t\t $this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_simpleelement($currNode);\n\t\t\t\t break;\n\t\t\t\tdefault:\n\t\t\t\t $this->addIndexedElement($currNode);\n\t\t\t\t //$this->DOMIT_RSS_indexer[$tagName] =& $currNode;\n\t\t }\n\t\t}\n\t}", "protected static function _parseElementClassMap()\n\t{\n\t\treturn array(\n\t\t\t'ipsQuote'\t\t\t=> '_parseElementForEmailQuote',\n\t\t\t'ipsCode'\t\t\t=> '_parseElementForEmailCode',\n\t\t\t'ipsStyle_spoiler'\t=> '_parseElementForEmailSpoiler',\n\t\t\t'ipsSpoiler'\t\t=> '_parseElementForEmailSpoiler',\n\t\t\t'ipsEmbeddedVideo'\t=> '_parseElementForEmailEmbed',\n\t\t\t'ipsImage'\t\t\t=> '_parseElementForEmailImage',\n\t\t);\n\t}", "public function getEventInfos() {\n // today will be useful \n $today = new \\DateTime(\"today midnight\");\n \n // get all events\n $events = $this->_machine->plugin(\"DB\")->getEventsFromDB(\"AND events.active = 1\");\n \n // retrieve dates with events\n $dates = [];\n foreach ($events as $ev) {\n $from = new \\DateTimeImmutable($ev[\"time_from\"]);\n $to = new \\DateTimeImmutable($ev[\"time_to\"]);\n $date = $from;\n while ($date <= $to) {\n $dates = $this->_insertDate($dates, $date);\n $date = $date->modify(\"+1 day\");\n }\n }\n \n // retrieve events for today\n $today_events = $this->getEventsForRange(\n $today, $today\n );\n \n // retrieve events for next weekend\n $next_weekend_events = $this->getNextWeekendEvents();\n\n $result = [\n \"tot\" => count($events),\n \"dates\" => $dates,\n \"today\" => $today_events,\n \"next_weekend\" => $next_weekend_events,\n \"events\" => $events\n ];\n \n return $result;\n }", "protected function configure() {\n\n $this->xmlconfig = array(\n \"name\" => array(\"xpath\" => \"mads:authority/mads:name\", \"class_name\" => \"mads_name\"),\n\n \"permanent\" => array(\"xpath\" => \"mads:affiliation[mads:position = 'permanent resident']\",\n \"class_name\" => \"mads_affiliation\"),\n \"current\" => array(\"xpath\" => \"mads:affiliation[mads:position != 'permanent resident']\",\n \"class_name\" => \"mads_affiliation\"),\n \"netid\" => array(\"xpath\" => \"mads:identifier[@type='netid']\"),\n );\n }", "public function getResourceMap()\n\t{\n\t\t// First populate all the data\n\t\tif (!$this->populateRDFData())\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t// Creates new XMLWriter\n\t\t$writer = new XMLWriter;\n\n\t\t// Writes XML to buffer\n\t\t$writer->openMemory();\n\n\t\t// Sets document formatting\n\t\t$writer->setIndent(true);\n\t\t$writer->setIndentString(\" \");\n\n\t\t$writer->startDocument(\"1.0\", \"UTF-8\");\n\n\t\t$writer->startElement(\"rdf:RDF\");\n\n\t\t// Creates object with all the required name spaces\n\t\tforeach ($this->xmlNamespace as $ns => $url)\n\t\t{\n\t\t\t$writer->writeAttribute($ns, $url);\n\t\t}\n\n\t\t// Start main description\n\t\t$writer->startElement('rdf:Description');\n\t\t\t$writer->writeAttribute('rdf:about', $this->resourceURL);\n\t\t\t$writer->writeElement('dc:identifier', $this->id);\n\t\t\t$writer->writeElement('dcterms:title', $this->title);\n\n\t\t\t// Check if the author is an actual human\n\t\t\tif ($this->author_id >= 1000)\n\t\t\t{\n\t\t\t\t$writer->startElement('dcterms:creator');\n\t\t\t\t\t$writer->startElement('foaf:person');\n\t\t\t\t\t\t$writer->writeElement('foaf:name', $this->created_by);\n\t\t\t\t\t$writer->endElement();\n\t\t\t\t$writer->endElement();\n\t\t\t}\n\n\t\t\t$writer->writeElement('dcterms:created', $this->date_created);\n\t\t\t$writer->writeElement('dcterms:modified', $this->date_modified);\n\t\t\t$writer->writeElement('dc:type', $this->type);\n\t\t\t$writer->writeElement('dc:description', $this->intro);\n\n\t\t\t// Writes aggregation\n\t\t\tforeach ($this->aggregates as $child_id => $aggregation)\n\t\t\t{\n\t\t\t\t$writer->startElement('ore:aggregates');\n\t\t\t\t\t$writer->writeAttribute('rdf:resource', $aggregation['url']);\n\t\t\t\t$writer->endElement();\n\t\t\t}\n\n\t\t\t// Writes describer (should be RDF in this case)\n\t\t\t$writer->startElement('ore:isDescribedBy');\n\t\t\t\t$writer->writeAttribute('rdf:resource', $this->resourceURL . '.rdf');\n\t\t\t$writer->endElement();\n\n\t\t\t// Writes parents\n\t\t\tforeach ($this->aggregatedBy as $parent_id => $aggregation)\n\t\t\t{\n\t\t\t\t$writer->startElement('ore:isAggregatedBy');\n\t\t\t\t\t$writer->writeAttribute('rdf:resource', $this->componentURL . $parent_id);\n\t\t\t\t$writer->endElement();\n\t\t\t}\n\n\t\t\t$writer->writeElement('dcterms:issued', $this->date_published);\n\t\t// End rdf:description of main object\n\t\t$writer->endElement();\n\n\t\t// Describe each aggregation briefly\n\t\tforeach ($this->aggregates as $aggregation)\n\t\t{\n\t\t\t// If the child is also an aggregation, do not need to describe it as it has its own RDF descriptor\n\t\t\tif ($aggregation['standalone'] == 1)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$writer->startElement('rdf:Description');\n\t\t\t\t$writer->writeAttribute('rdf:about', $aggregation['url']);\n\t\t\t\t// Detects and describe the data accordingly\n\t\t\t\t$this->dataTypeDescriptor($aggregation, $writer);\n\t\t\t$writer->endElement();\n\t\t}\n\n\t\t// Describe this rdf briefly\n\t\t$writer->startElement('rdf:Description');\n\t\t\t$writer->writeAttribute('rdf:about', $this->resourceURL . '.rdf');\n\t\t\t$curtime = date(\"Y-m-d\\TH:i:sP\", $_SERVER['REQUEST_TIME']);\n\t\t\t$writer->startElement('dcterms:creator');\n\t\t\t\t$writer->writeAttribute('rdf:resource', Request::base());\n\t\t\t$writer->endElement();\n\t\t\t$writer->writeElement('dcterms:created', $curtime);\n\t\t\t$writer->writeElement('dcterms:modified', $curtime);\n\t\t\t$writer->startElement('ore:describes');\n\t\t\t\t$writer->writeAttribute('rdf:resource', $this->resourceURL);\n\t\t\t$writer->endElement();\n\t\t\t$writer->startElement('rdf:type');\n\t\t\t\t$writer->writeAttribute('rdf:resource', 'http://www.openarchives.org/ore/terms/ResourceMap/');\n\t\t\t$writer->endElement();\n\t\t$writer->endElement();\n\n\t\t$writer->endDocument();\n\n\t\t// Flush the memory and return it\n\t\treturn $writer->flush();\n\t}", "static public function getDataMap()\n {\n return array(\n 'fields' => array(\n 'channel_code' => array(\n 'type' => 'string',\n ),\n 'time' => array(\n 'type' => 'date',\n ),\n ),\n 'references' => array(\n\n ),\n 'embeddeds' => array(\n\n ),\n 'relations' => array(\n\n ),\n );\n }", "public static function loadListeners()\n {\n $manager = self::instance();\n $plugins = Plugin::loaded();\n\n foreach ($plugins as $plugin) {\n $events = Plugin::getData($plugin, 'events')->getArrayCopy();\n foreach ($events as $name => $config) {\n if (is_numeric($name)) {\n $name = $config;\n $config = [];\n }\n\n $class = App::className($name, 'Event');\n $config = (array) $config;\n\n if ($class !== false) {\n $listener = new $class($config);\n $manager->on($listener, $config);\n }\n }\n }\n }", "private function generateXml()\n {\n\n $args = array(\n\n 'posts_per_page' => -1,\n 'numberposts' => -1,\n 'orderby' => 'post_type',\n 'order' => 'DESC',\n 'post_type' => apply_filters('fpcms_sitemap_post_types', array('post', 'page'))\n\n );\n\n if ($results = get_posts($args)) {\n\n $sitemap = new \\SimpleXMLElement($this->getDocStructure());\n\n foreach ($results as $result) {\n\n $url = $sitemap->addChild('url');\n $url->addChild('loc', get_permalink($result->ID));\n\n if (has_post_thumbnail($result->ID)) {\n\n if ($image = wp_get_attachment_image_src(get_post_thumbnail_id($result->ID))) {\n $url->addChild('image:image', $image[0]);\n }\n\n }\n\n $url->addChild('lastmod', mysql2date('Y-m-d', $result->post_date_gmt));\n\n if ($result->post_type == 'page') {\n\n //Pages should display higher than posts for the same keyword\n $url->addChild('priority', apply_filters('fpcms_sitemap_page_priority', '0.7'));\n\n } else {\n\n $url->addChild('priority', apply_filters('fpcms_sitemap_post_priority', '0.4'));\n\n }\n\n }\n\n return $sitemap->asXML();\n\n }\n\n }", "public function sitemap_xml()\n {\n // Get All Pages.\n $this->data['pages'] = $this->pages->get_all(FALSE, 0, 'ASC', FALSE);\n // Get All Sermons.\n $this->data['sermons'] = $this->sermons->get_sermons(FALSE, FALSE, FALSE, 0, \"DESC\", FALSE);\n // Get All Posts\n $this->data['posts'] = $this->posts->get_all(FALSE, 0, 'ASC', FALSE);\n // Get All Post Categories\n $this->data['post_categories'] = $this->categories->get_all();\n\n // Set page content to xml.\n header(\"Content-Type: text/xml;charset=iso-8859-1\");\n $this->load->view(\"sitemap/sitemap\", $this->data);\n }", "public function events_markup_collect(){\n\n // Return the events markup array\n return $this->events;\n\n }", "function get_info_from_xml($xml_a_traiter)\n{\n\t//Création des tableaux\n\t\t$liste_info['message_id'] = array();\n\t\t$liste_info['isrc'] = array();\n\t\t$liste_info['technicalresourcedetailsreference'] = array();\n\t\t$liste_info['audiocodectype'] = array();\n\t\t$liste_info['bitrate'] = array();\n\t\t$liste_info['url'] = array();\t\t\n\t\t$liste_info['fichier_destination'] = array();\t\n\t\t$liste_info['album_grid'] = array();\t\n\t\t\t\n\t//Reading xml file\t\t\n\t\t$xmlContent = file_get_contents($xml_a_traiter);\t\n\t\tif ($xmlContent == \"\") \n\t\t{\n\t\t\techo \"Fichier XML Vide!\" . \"\\n\";\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$tabXML = array();\n\t\t\t$tabXML = xml2array($xmlContent);\t\n\t\t}\n\t//************************************************************************************************************\t\n\t//Récuperation du MessageId\n\t\tif(isset($tabXML['ernm:PurgeReleaseMessage']))\n\t\t\t$liste_info['message_id'] = $tabXML['ernm:PurgeReleaseMessage']['MessageHeader']['MessageId']['value'];\n\t\telse\n\t\t\t$liste_info['message_id'] = $tabXML['ernm:NewReleaseMessage']['MessageHeader']['MessageId']['value'];\n\t//************************************************************************************************************\n\t//For processing the array in the same manner even if there is one or more sub-block\n\t\tif (isset($tabXML['ernm:NewReleaseMessage']['ResourceList']['SoundRecording'][0])) \n\t\t{\n\t\t\t//There are several sub-block\n\t\t\t$ProductInfoSoundRecording = null;\n\t\t\t$ProductInfoSoundRecording = $tabXML['ernm:NewReleaseMessage']['ResourceList']['SoundRecording'];\n\t\t}\n\t\telse \n\t\t{\n\t\t\t//There is one sub-block\n\t\t\t$ProductInfoSoundRecording = null;\n\t\t\t$ProductInfoSoundRecording[0] = $tabXML['ernm:NewReleaseMessage']['ResourceList']['SoundRecording'];\n\t\t}\n\t\t\n\t//************************************************************************************************************\t\n\t$nb_SoundRecording = count($ProductInfoSoundRecording);\n\tfor($element=0;$element<$nb_SoundRecording;$element++)\n\t{\t\n\t\t$info_track_tmp1['SoundRecording_SoundRecordingId_ISRC'] \t\t\t\t\t\t\t= $ProductInfoSoundRecording[$element]['SoundRecordingId']['ISRC']['value'];\n\t\t$info_track_tmp1['SoundRecording_ResourceReference'] \t\t\t\t\t\t\t\t= $ProductInfoSoundRecording[$element]['ResourceReference']['value'];\n\n\t\t//************************************************************************************************************\n\t\t//For processing the array in the same manner even if there is one or more sub-block\t\t\t\n\t\t\tif (isset($ProductInfoSoundRecording[$element]['SoundRecordingDetailsByTerritory']['TechnicalSoundRecordingDetails'][0])) \n\t\t\t{\n\t\t\t\t//There are several sub-block\n\t\t\t\t$ProductInfoTechnicalSoundRecordingDetails = null;\n\t\t\t\t$ProductInfoTechnicalSoundRecordingDetails = $ProductInfoSoundRecording[$element]['SoundRecordingDetailsByTerritory']['TechnicalSoundRecordingDetails'];\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t//There is one sub-block\n\t\t\t\t$ProductInfoTechnicalSoundRecordingDetails = null;\n\t\t\t\t$ProductInfoTechnicalSoundRecordingDetails[0] = $ProductInfoSoundRecording[$element]['SoundRecordingDetailsByTerritory']['TechnicalSoundRecordingDetails'];\n\t\t\t}\t\t\n\t\t//************************************************************************************************************\n\t\t$nb_TechnicalSoundRecordingDetails = count($ProductInfoTechnicalSoundRecordingDetails);\n\t\t\n\t\tfor($y=0;$y<$nb_TechnicalSoundRecordingDetails;$y++)\n\t\t{\n\t\t\tif(isset($ProductInfoTechnicalSoundRecordingDetails[$y]['BitsPerSample']['value']))\n\t\t\t{\n\t\t\t\tarray_push($liste_info['isrc'],$ProductInfoSoundRecording[$element]['SoundRecordingId']['ISRC']['value']);\n\t\t\t\tarray_push($liste_info['technicalresourcedetailsreference'],$ProductInfoTechnicalSoundRecordingDetails[$y]['TechnicalResourceDetailsReference']['value']);\n\t\t\t\tarray_push($liste_info['audiocodectype'],$ProductInfoTechnicalSoundRecordingDetails[$y]['AudioCodecType']['value']);\n\t\t\t\tarray_push($liste_info['bitrate'],$ProductInfoTechnicalSoundRecordingDetails[$y]['BitsPerSample']['value']);\t\t\t\n\t\t\t\tarray_push($liste_info['url'],$ProductInfoTechnicalSoundRecordingDetails[$y]['File']['URL']['value']);\t\t\t\n\t\t\t\tarray_push($liste_info['fichier_destination'],$ProductInfoTechnicalSoundRecordingDetails[$y]['TechnicalResourceDetailsReference']['value'].\"_\".$ProductInfoTechnicalSoundRecordingDetails[$y]['AudioCodecType']['value'].\"_\".$ProductInfoTechnicalSoundRecordingDetails[$y]['BitsPerSample']['value'].\"_\".$ProductInfoSoundRecording[$element]['SoundRecordingId']['ISRC']['value'].\".\".strtolower($ProductInfoTechnicalSoundRecordingDetails[$y]['AudioCodecType']['value']));\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\t//************************************************************************************************************\t\n\t\t//For processing the array in the same manner even if there is one or more sub-block\n\t\t\tif (isset($tabXML['ernm:NewReleaseMessage']['ReleaseList']['Release'][0])) \n\t\t\t{\n\t\t\t\t//There are several sub-block\n\t\t\t\t$ProductInfoRelease = null;\n\t\t\t\t$ProductInfoRelease = $tabXML['ernm:NewReleaseMessage']['ReleaseList']['Release'];\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t//There is one sub-block\n\t\t\t\t$ProductInfoRelease = null;\n\t\t\t\t$ProductInfoRelease[0] = $tabXML['ernm:NewReleaseMessage']['ReleaseList']['Release'];\n\t\t\t}\n\t\t//************************************************************************************************************\t\n\t\t$nb_Release = count($ProductInfoRelease);\n\t\tfor($element=0;$element<$nb_Release;$element++)\n\t\t{\n\t\t\tif($ProductInfoRelease[$element]['ReleaseType']['value']==\"Album\" or $ProductInfoRelease[$element]['ReleaseType']['value']==\"Single\" or $ProductInfoRelease[$element]['ReleaseType']['value']==\"Bundle\" or $ProductInfoRelease[$element]['ReleaseType']['value']==\"ClassicalAlbum\")\n\t\t\t{\n\t\t\t\t$liste_info['album_grid'] = $ProductInfoRelease[$element]['ReleaseId']['GRid']['value'];\n\t\t\t\t$liste_info['globaloriginalreleasedate'] = $ProductInfoRelease[$element]['GlobalOriginalReleaseDate']['value'];\n\t\t\t}\n\t\t}\n\t//************************************************************************************************************\n\n\treturn $liste_info;\n}", "private function init() {\n\t\tforeach (Config::get('app/events/loaders') as $loader => $parameters) {\n\t\t\t//Ignore disabled loaders\n\t\t\tif (isset($parameters['enabled']) && !$parameters['enabled'])\n\t\t\t\tcontinue;\n\n\t\t\t$driver = PHPLoader::getDriverClass(\"events\",$loader);\n\n\t\t\t$res = call_user_func([$driver,'load'],$this,$parameters);\n\t\t\tif ($res && is_array($res))\n\t\t\t\t$this->listeners = array_merge($this->listeners,$res);\n\t\t}\n\t}", "public function generateMap()\n {\n $map = array();\n $database = $this->binding->getDatabase()->getData();\n\n foreach ($database->classes as $class) {\n $map[$class->name] = $class->clusters;\n }\n\n $this->map = $map;\n $this->cache->save($this->getCacheKey(), $map);\n }", "public function get_sitemap_xml($url_list)\n {\n }", "public static function addSiteMapElement($xml, $siteMapelementsArr){\n \n foreach ($siteMapelementsArr as $oneElement){\n //start at url node\n $url = $xml->addChild('url');\n \n //use loop to add all elements to url node\n foreach ($oneElement as $key=>$value) {\n if ($key == 'lastmod') {\n $value = date('Y-m-d', strtotime($value));\n }//force format date.\n \n $loc = $url->addChild($key, $value);\n }\n \n }\n \n }", "function xml_create_parser($source, $out_enc, $in_enc, $detect)\n\t{\n if ( substr(phpversion(),0,1) == 5) {\n $parser = $this->xml_php5_create_parser($in_enc, $detect);\n }\n else {\n list($parser, $source) = $this->xml_php4_create_parser($source, $in_enc, $detect);\n }\n if ($out_enc) {\n $this->xml_encoding = $out_enc;\n xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $out_enc);\n }\n\n return array($parser, $source);\n }", "protected function getRegisteredEvents() {\n $events = [];\n foreach ($this->loadMultiple() as $rules_config) {\n foreach ($rules_config->getEventNames() as $event_name) {\n $event_name = $this->eventManager->getEventBaseName($event_name);\n if (!isset($events[$event_name])) {\n $events[$event_name] = $event_name;\n }\n }\n }\n return $events;\n }", "public function parseDataFromXML(&$xml, $templateCheck=1) {\n\n Debug::printMsg('<li><i>'.$this->className.'</i> (parsing from XML)</li><ul style=\"margin-left:2em\">');\n\n // xml backup\n $this->logXML = new DomDocument(\"1.0\", \"UTF-8\");\n $this->logXML->appendChild ($this->logXML->createElement($this->className));\n $this->logXMLData = $this->logXML->createElement(\"data\");\n $this->logXMLLinks = $this->logXML->createElement(\"links\");\n $this->logXML->firstChild->appendChild($this->logXMLData);\n $this->logXML->firstChild->appendChild($this->logXMLLinks);\n\n $this->path = XML::pathToClass($this->className, array());\n $this->template = Template::getInputTemplate($this);\n $this->xmlId = $xmlId;\n $this->data = array();\n\n foreach ($xml->childNodes as $link) {\n \n Debug::printMsg('<li><span style=\"background-color:gray; color:white\">LINK: '.$link->tagName.'</span>');\n\n foreach($link->childNodes as $child) {\n\n // skip text nodes\n if($child->nodeType == 3)\n continue;\n \n $linkId = XML::getPropertyID($link->tagName);\n $linkFull = $linkId[\"id\"].$linkId[\"dir\"].\".\".$linkId[\"title\"];\n // if($this->className == \"Place\" && $linkId == \"P89B\")\n // throw new Exception('Parts must be added to whole!');\n $node = DataNode::factory($child);\n $node->linkId = $linkId;\n $node->indexWords = $this->indexWords;\n\n // check link validity\n Template::checkLinkRange($this, $linkFull, $node);\n\n // check for conversion id (for imports)\n if($child->hasAttribute(\"map_id\")) {\n if ($child->getAttribute(\"map_id\") != \"0\") {\n $rec_id = IdaDb::getIdByMapId($child->getAttribute(\"map_id\"));\n $node->id = $rec_id;\n $this->data[] = $node;\n } else\n throw new Exception('Invalid map_id!');\n\n } else if($child->hasAttribute(\"id\")) {\n if (ctype_digit($child->getAttribute(\"id\")) && $child->getAttribute(\"id\") != \"0\") {\n $node->id = $child->getAttribute(\"id\");\n $this->append($node);\n } else\n throw new Exception('Invalid id!');\n\n } else {\n\n // if node is not an event, try to find ID (table gives empty array)\n if ($node->unique)\n $matches = $node->searchByXML($child);\n else\n $matches = 0;\n\n // if we did not found any matches, then create a record\n if(empty($matches)) {\n\n // load and check data from xml\n $node->parseDataFromXML($child, $templateCheck);\n $this->append($node);\n\n // else if we found just 1 match then we can link to it\n } else if(count($matches) == 1) {\n\n $node->id = $matches[0];\n $this->data[] = $node;\n Debug::printMsg('<li><span style=\"color:green\">found ID! ('.$node->id.')</span> </li>');\n\n // if we have multiple matches then stop the show\n } else {\n throw new Exception('Can not link! Multiple matches found!');\n }\n }\n\n }\n Debug::printMsg('</li>');\n }\n\n\n\n // check if required values are still missing\n /*\n $templateCheck = 0;\n if($templateCheck) {\n Debug::printPara(\"Checking missing things against template:\");\n foreach($this->template as $temp) {\n if($temp[\"required\"]) {\n if($temp[\"target_type\"] == \"type\") {\n Debug::printMsg('<span style=\"color:red\">MISSING '.$temp[\"property_title\"].$this->G->typeNames[$temp[\"target\"]][\"title\"].'!</span>'); \n $this->errors[] = 'required value missing: '.$temp[\"property_title\"].\": \".$this->G->typeNames[$temp[\"target\"]][\"title\"]; \n\n }else if($temp[\"target_type\"] == \"table\") {\n \n $this->errors[] = 'required value missing: '.$temp[\"property_title\"];\n\n } else {\n Debug::printMsg('<span style=\"color:red\">MISSING '.$this->G->classNames[$temp[\"target\"]][\"title\"].'!</span>');\n $this->errors[] = 'required value missing: '.$temp[\"property_title\"].\": \".$temp[\"target_table\"].$this->G->classNames[$temp[\"target\"]][\"title\"];\n }\n }\n }\n }\n */\n\n\n\n if(DEBUG) {\n echo '<li><span style=\"background-color:green; color:white\">Done Parsing of object:</span>'.$this->className;\n echo '<br>Found '.count($this->errors, COUNT_RECURSIVE).' errors</li></ul>';\n echo '<pre>';\n print_r($this->errors);\n echo '</pre>';\n }\n\n}", "protected function parseXml($xml)\n {\n if (! $xml) {\n return false;\n }\n if (isset($xml->ShipmentEventList)) {\n foreach ($xml->ShipmentEventList->children() as $x) {\n $this->list['Shipment'][] = $this->parseShipmentEvent($x);\n }\n }\n if (isset($xml->RefundEventList)) {\n foreach ($xml->RefundEventList->children() as $x) {\n $this->list['Refund'][] = $this->parseShipmentEvent($x);\n }\n }\n if (isset($xml->GuaranteeClaimEventList)) {\n foreach ($xml->GuaranteeClaimEventList->children() as $x) {\n $this->list['GuaranteeClaim'][] = $this->parseShipmentEvent($x);\n }\n }\n if (isset($xml->ChargebackEventList)) {\n foreach ($xml->ChargebackEventList->children() as $x) {\n $this->list['Chargeback'][] = $this->parseShipmentEvent($x);\n }\n }\n if (isset($xml->PayWithAmazonEventList)) {\n foreach ($xml->PayWithAmazonEventList->children() as $x) {\n $temp = [];\n $temp['SellerOrderId'] = (string) $x->SellerOrderId;\n $temp['TransactionPostedDate'] = (string) $x->TransactionPostedDate;\n $temp['BusinessObjectType'] = (string) $x->BusinessObjectType;\n $temp['SalesChannel'] = (string) $x->SalesChannel;\n $temp['Charge'] = $this->parseCharge($x->Charge);\n if (isset($x->FeeList)) {\n foreach ($x->FeeList->children() as $z) {\n $temp['FeeList'][] = $this->parseFee($z);\n }\n }\n $temp['PaymentAmountType'] = (string) $x->PaymentAmountType;\n $temp['AmountDescription'] = (string) $x->AmountDescription;\n $temp['FulfillmentChannel'] = (string) $x->FulfillmentChannel;\n $temp['StoreName'] = (string) $x->StoreName;\n $this->list['PayWithAmazon'][] = $temp;\n }\n }\n if (isset($xml->ServiceProviderCreditEventList)) {\n foreach ($xml->ServiceProviderCreditEventList->children() as $x) {\n $temp = [];\n $temp['ProviderTransactionType'] = (string) $x->ProviderTransactionType;\n $temp['SellerOrderId'] = (string) $x->SellerOrderId;\n $temp['MarketplaceId'] = (string) $x->MarketplaceId;\n $temp['MarketplaceCountryCode'] = (string) $x->MarketplaceCountryCode;\n $temp['SellerId'] = (string) $x->SellerId;\n $temp['SellerStoreName'] = (string) $x->SellerStoreName;\n $temp['ProviderId'] = (string) $x->ProviderId;\n $temp['ProviderStoreName'] = (string) $x->ProviderStoreName;\n $this->list['ServiceProviderCredit'][] = $temp;\n }\n }\n if (isset($xml->RetrochargeEventList)) {\n foreach ($xml->RetrochargeEventList->children() as $x) {\n $temp = [];\n $temp['RetrochargeEventType'] = (string) $x->RetrochargeEventType;\n $temp['AmazonOrderId'] = (string) $x->AmazonOrderId;\n $temp['PostedDate'] = (string) $x->PostedDate;\n $temp['BaseTax']['Amount'] = (string) $x->BaseTax->CurrencyAmount;\n $temp['BaseTax']['CurrencyCode'] = (string) $x->BaseTax->CurrencyCode;\n $temp['ShippingTax']['Amount'] = (string) $x->ShippingTax->CurrencyAmount;\n $temp['ShippingTax']['CurrencyCode'] = (string) $x->ShippingTax->CurrencyCode;\n $temp['MarketplaceName'] = (string) $x->MarketplaceName;\n $this->list['Retrocharge'][] = $temp;\n }\n }\n if (isset($xml->RentalTransactionEventList)) {\n foreach ($xml->RentalTransactionEventList->children() as $x) {\n $temp = [];\n $temp['AmazonOrderId'] = (string) $x->AmazonOrderId;\n $temp['RentalEventType'] = (string) $x->RentalEventType;\n $temp['ExtensionLength'] = (string) $x->ExtensionLength;\n $temp['PostedDate'] = (string) $x->PostedDate;\n if (isset($x->RentalChargeList)) {\n foreach ($x->RentalChargeList->children() as $z) {\n $temp['RentalChargeList'][] = $this->parseCharge($z);\n }\n }\n if (isset($x->RentalFeeList)) {\n foreach ($x->RentalFeeList->children() as $z) {\n $temp['RentalFeeList'][] = $this->parseFee($z);\n }\n }\n $temp['MarketplaceName'] = (string) $x->MarketplaceName;\n if (isset($x->RentalInitialValue)) {\n $temp['RentalInitialValue']['Amount'] = (string) $x->RentalInitialValue->CurrencyAmount;\n $temp['RentalInitialValue']['CurrencyCode'] = (string) $x->RentalInitialValue->CurrencyCode;\n }\n if (isset($x->RentalReimbursement)) {\n $temp['RentalReimbursement']['Amount'] = (string) $x->RentalReimbursement->CurrencyAmount;\n $temp['RentalReimbursement']['CurrencyCode'] = (string) $x->RentalReimbursement->CurrencyCode;\n }\n $this->list['RentalTransaction'][] = $temp;\n }\n }\n if (isset($xml->PerformanceBondRefundEventList)) {\n foreach ($xml->PerformanceBondRefundEventList->children() as $x) {\n $temp = [];\n $temp['MarketplaceCountryCode'] = (string) $x->MarketplaceCountryCode;\n $temp['Amount'] = (string) $x->Amount->CurrencyAmount;\n $temp['CurrencyCode'] = (string) $x->Amount->CurrencyCode;\n if (isset($x->ProductGroupList)) {\n foreach ($x->ProductGroupList->children() as $z) {\n $temp['ProductGroupList'][] = (string) $z;\n }\n }\n $this->list['PerformanceBondRefund'][] = $temp;\n }\n }\n if (isset($xml->ServiceFeeEventList)) {\n foreach ($xml->ServiceFeeEventList->children() as $x) {\n $temp = [];\n $temp['AmazonOrderId'] = (string) $x->AmazonOrderId;\n $temp['FeeReason'] = (string) $x->FeeReason;\n if (isset($x->FeeList)) {\n foreach ($x->FeeList->children() as $z) {\n $temp['FeeList'][] = $this->parseFee($z);\n }\n }\n $temp['SellerSKU'] = (string) $x->SellerSKU;\n $temp['FnSKU'] = (string) $x->FnSKU;\n $temp['FeeDescription'] = (string) $x->FeeDescription;\n $temp['ASIN'] = (string) $x->ASIN;\n $this->list['ServiceFee'][] = $temp;\n }\n }\n if (isset($xml->DebtRecoveryEventList)) {\n foreach ($xml->DebtRecoveryEventList->children() as $x) {\n $temp = [];\n $temp['DebtRecoveryType'] = (string) $x->DebtRecoveryType;\n $temp['RecoveryAmount']['Amount'] = (string) $x->RecoveryAmount->CurrencyAmount;\n $temp['RecoveryAmount']['CurrencyCode'] = (string) $x->RecoveryAmount->CurrencyCode;\n $temp['OverPaymentCredit']['Amount'] = (string) $x->OverPaymentCredit->CurrencyAmount;\n $temp['OverPaymentCredit']['CurrencyCode'] = (string) $x->OverPaymentCredit->CurrencyCode;\n if (isset($x->DebtRecoveryItemList)) {\n foreach ($x->DebtRecoveryItemList->children() as $z) {\n $ztemp = [];\n $ztemp['RecoveryAmount']['Amount'] = (string) $z->RecoveryAmount->CurrencyAmount;\n $ztemp['RecoveryAmount']['CurrencyCode'] = (string) $z->RecoveryAmount->CurrencyCode;\n $ztemp['OriginalAmount']['Amount'] = (string) $z->OriginalAmount->CurrencyAmount;\n $ztemp['OriginalAmount']['CurrencyCode'] = (string) $z->OriginalAmount->CurrencyCode;\n $ztemp['GroupBeginDate'] = (string) $z->GroupBeginDate;\n $ztemp['GroupEndDate'] = (string) $z->GroupEndDate;\n $temp['DebtRecoveryItemList'][] = $ztemp;\n }\n }\n if (isset($x->ChargeInstrumentList)) {\n foreach ($x->ChargeInstrumentList->children() as $z) {\n $ztemp = [];\n $ztemp['Description'] = (string) $z->Description;\n $ztemp['Tail'] = (string) $z->Tail;\n $ztemp['Amount'] = (string) $z->Amount->CurrencyAmount;\n $ztemp['CurrencyCode'] = (string) $z->Amount->CurrencyCode;\n $temp['ChargeInstrumentList'][] = $ztemp;\n }\n }\n $this->list['DebtRecovery'][] = $temp;\n }\n }\n if (isset($xml->LoanServicingEventList)) {\n foreach ($xml->LoanServicingEventList->children() as $x) {\n $temp = [];\n $temp['Amount'] = (string) $x->LoanAmount->CurrencyAmount;\n $temp['CurrencyCode'] = (string) $x->LoanAmount->CurrencyCode;\n $temp['SourceBusinessEventType'] = (string) $x->SourceBusinessEventType;\n $this->list['LoanServicing'][] = $temp;\n }\n }\n if (isset($xml->AdjustmentEventList)) {\n foreach ($xml->AdjustmentEventList->children() as $x) {\n $temp = [];\n $temp['AdjustmentType'] = (string) $x->AdjustmentType;\n $temp['Amount'] = (string) $x->AdjustmentAmount->CurrencyAmount;\n $temp['CurrencyCode'] = (string) $x->AdjustmentAmount->CurrencyCode;\n if (isset($x->AdjustmentItemList)) {\n foreach ($x->AdjustmentItemList->children() as $z) {\n $ztemp = [];\n $ztemp['Quantity'] = (string) $z->Quantity;\n $ztemp['PerUnitAmount']['Amount'] = (string) $z->PerUnitAmount->CurrencyAmount;\n $ztemp['PerUnitAmount']['CurrencyCode'] = (string) $z->PerUnitAmount->CurrencyCode;\n $ztemp['TotalAmount']['Amount'] = (string) $z->TotalAmount->CurrencyAmount;\n $ztemp['TotalAmount']['CurrencyCode'] = (string) $z->TotalAmount->CurrencyCode;\n $ztemp['SellerSKU'] = (string) $z->SellerSKU;\n $ztemp['FnSKU'] = (string) $z->FnSKU;\n $ztemp['ProductDescription'] = (string) $z->ProductDescription;\n $ztemp['ASIN'] = (string) $z->ASIN;\n $temp['AdjustmentItemList'][] = $ztemp;\n }\n }\n $this->list['Adjustment'][] = $temp;\n }\n }\n if (isset($xml->SAFETReimbursementEventList)) {\n foreach ($xml->SAFETReimbursementEventList->children() as $x) {\n $temp = [];\n $temp['PostedDate'] = (string) $x->PostedDate;\n $temp['SAFETClaimId'] = (string) $x->SAFETClaimId;\n $temp['Amount'] = (string) $x->ReimbursedAmount->CurrencyAmount;\n $temp['CurrencyCode'] = (string) $x->ReimbursedAmount->CurrencyCode;\n $temp['SAFETReimbursementItemList'] = [];\n if (isset($x->SAFETReimbursementItemList)) {\n foreach ($x->SAFETReimbursementItemList->children() as $y) {\n if (! isset($y->ItemChargeList)) {\n continue;\n }\n $ztemp = [];\n foreach ($y->ItemChargeList->children() as $z) {\n $ztemp['ItemChargeList'][] = $this->parseCharge($z);\n }\n $temp['SAFETReimbursementItemList'][] = $ztemp;\n }\n }\n $this->list['SAFET'][] = $temp;\n }\n }\n }", "function _init() {\n\t\t$total = $this->node->childCount;\n\t\t$itemCounter = 0;\n\t\t$categoryCounter = 0;\n\t\t\n\t\tfor ($i = 0; $i < $total; $i++) {\n\t\t\t$currNode =& $this->node->childNodes[$i];\n\t\t\t$tagName = strtolower($currNode->nodeName);\n\t\t\t\n\t\t\tswitch($tagName) {\n\t\t\t\tcase DOMIT_RSS_ELEMENT_ITEM:\n\t\t\t\t\t$this->domit_rss_items[$itemCounter] =& new xml_domit_rss_item($currNode);\n\t\t\t\t\t$itemCounter++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOMIT_RSS_ELEMENT_CATEGORY:\n\t\t\t\t\t$this->domit_rss_categories[$categoryCounter] =& new xml_domit_rss_category($currNode);\n\t\t\t\t\t$categoryCounter++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOMIT_RSS_ELEMENT_IMAGE:\n\t\t\t\t\t$this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_image($currNode);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOMIT_RSS_ELEMENT_CLOUD:\n\t\t\t\t\t$this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_cloud($currNode);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOMIT_RSS_ELEMENT_TEXTINPUT:\n\t\t\t\t\t$this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_textinput($currNode);\n\t\t\t\t\tbreak;\n case DOMIT_RSS_ELEMENT_TITLE:\n case DOMIT_RSS_ELEMENT_LINK:\n case DOMIT_RSS_ELEMENT_DESCRIPTION:\n case DOMIT_RSS_ELEMENT_LANGUAGE:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_COPYRIGHT:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_MANAGINGEDITOR:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_WEBMASTER:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_PUBDATE:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_LASTBUILDDATE:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_GENERATOR:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_DOCS:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_TTL:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_RATING:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_SKIPHOURS:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_SKIPDAYS:\n\t\t\t\t $this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_simpleelement($currNode);\n\t\t\t\t break;\n\t\t\t\tdefault:\n\t\t\t\t $this->addIndexedElement($currNode);\n\t\t\t\t\t//$this->DOMIT_RSS_indexer[$tagName] =& $currNode;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($itemCounter != 0) {\n\t\t\t$this->DOMIT_RSS_indexer[DOMIT_RSS_ARRAY_ITEMS] =& $this->domit_rss_items;\n\t\t}\n\t\t\n\t\tif ($categoryCounter != 0) {\n\t\t\t$this->DOMIT_RSS_indexer[DOMIT_RSS_ARRAY_CATEGORIES] =& $this->domit_rss_categories;\n\t\t}\n\t}", "function siteMap($node, $lang='en', $wide_info=false){\r\n\t\t$dir = \"sitemaps\";\r\n\t\t$lang = $this->CFG->lang;\r\n\t\t$db = $this->DB->dbName;\r\n\t\t$fname = \"sitemap_\".$db.\"_\".$node.\"_\".$lang.\".xml\";\r\n\t\tif(!($xml = $this->getCache($dir, $fname))){\r\n\t\t\t$xml = $this->cache__siteMap($node, $lang, $wide_info);\r\n\t\t\t$this->newCache($dir, $fname, $xml);\r\n\t\t\t//print \"newcache [$dir]\";\r\n\t\t} //else print \"readcache [$dir/$fname]\";\r\n\t\t//print \"<textarea>$xml</textarea>\";\r\n\t\treturn $xml;\r\n\t}", "function ExtractNotifications () {\n\t\trequire_once('xml-processing/gc_XmlParser.php');\n\t\t$GXmlParser = new gc_XmlParser($this->poll_result[1]);\n\t\t\t$data = $GXmlParser->GetData();\n\t\t\t//Get the actual notifications\n\t\t\tforeach($data['notification-data-response']['notifications'] as $notification) {\n\t\t\t\t$this->notifications[] = $notification;\n\t\t\t}\n\t\t\t//Get other useful info\n\t\t\t$this->has_more_notifications = $data['notification-data-response']['has-more-notifications']['VALUE'];\n\t\t\t$this->continue_token = $data['notification-data-response']['continue-token']['VALUE'];\n\t}", "public static function buildTableMap()\n {\n $dbMap = Propel::getServiceContainer()->getDatabaseMap(EmailManagerHistoryTableMap::DATABASE_NAME);\n if (!$dbMap->hasTable(EmailManagerHistoryTableMap::TABLE_NAME)) {\n $dbMap->addTableObject(new EmailManagerHistoryTableMap());\n }\n }", "function _conversionsBySource($parameters) {\n\n $timerange = $this->_whereTimerange(\n $parameters['start'],\n $parameters['end']\n );\n\n switch ($parameters['result_format']) {\n case 'xml':\n case 'xml_object': {\n $tree = new XML_Tree;\n $root = &$tree->addRoot('visitorsonline');\n $children = array();\n }\n break;\n\n default: {\n $result = array();\n }\n }\n\n $accesslogIDs = array();\n\n // get a list of all accesslogIDs where there was a conversion\n $this->db->query(\n sprintf(\n \"SELECT DISTINCT(accesslog.accesslog_id) AS accesslog_id\n FROM %s accesslog,\n %s conversions\n WHERE conversions.client_id = '%d'\n AND conversions.accesslog_id = accesslog.accesslog_id\n %s\",\n\n $this->config['accesslog_table'],\n $this->config['plugins']['conversions']['table'],\n $parameters['client_id'],\n $timerange\n )\n );\n\n while ($row = $this->db->fetchRow()) {\n $accesslogIDs[] = $row['accesslog_id'];\n }\n\n // for each conversion, get details\n for ($i = 0, $max = sizeof($accesslogIDs); $i < $max; $i++) {\n unset($source);\n // to determine source, first look for a record of\n // the use of a search engine on the first visit,\n // then a referrer on the first visit, then\n // the use of a search engine on the most recent visit,\n // then a referrer on the most recent visit\n\n // get visitor_id and number of visits\n $this->db->query(\n sprintf(\n \"SELECT visitors.visitor_id AS visitor_id\n FROM %s visitors\n WHERE visitors.accesslog_id = '%d'\",\n\n $this->config['visitors_table'],\n $accesslogIDs[$i]\n )\n );\n\n if ($row = $this->db->fetchRow()) {\n $visitor_id = intval($row['visitor_id']);\n } else {\n $visitor_id = 0;\n }\n\n $this->db->query(\n sprintf(\n \"SELECT COUNT(visitors.visitor_id) AS num_visits\n FROM %s visitors\n WHERE visitors.visitor_id = '%d'\",\n\n $this->config['visitors_table'],\n $visitor_id\n )\n );\n\n if ($row = $this->db->fetchRow()) {\n $num_visits = intval($row['num_visits']);\n } else {\n $num_visits = 0;\n } // end query for visitor_id and number of visits\n\n // get accesslog_id of first visit\n $this->db->query(\n sprintf(\n \"SELECT visitors.accesslog_id AS first_access\n FROM %s visitors\n WHERE visitors.visitor_id = '%d'\n ORDER BY visitors.timestamp\",\n\n $this->config['visitors_table'],\n $visitor_id\n )\n );\n if ($row = $this->db->fetchRow()) {\n $first_access = $row['first_access'];\n } // end query for accesslog_id of first visit\n\n\n // get first search engine and search engine keywords\n if ($num_visits > 1) {\n $this->db->query(\n sprintf(\n \"SELECT search_engines.search_engine AS search_engine,\n search_engines.keywords AS keywords\n FROM %s search_engines\n WHERE search_engines.accesslog_id = '%d'\",\n $this->config['plugins']['search_engines']['table'],\n $first_access\n )\n );\n if ($row = $this->db->fetchRow()) {\n $source = $row['search_engine'].': \"'.$row['keywords'].'\"';\n }\n\n } // end query for first search engine and search engine keywords\n\n // get first referrer\n if (!isset($source)) {\n if ($num_visits > 1) {\n $this->db->query(\n sprintf(\n \"SELECT referers.string AS first_referer\n FROM %s visitors,\n %s referers\n WHERE visitors.accesslog_id = '%d'\n AND visitors.referer_id = referers.data_id\n ORDER BY visitors.timestamp\",\n\n $this->config['visitors_table'],\n $this->config['referers_table'],\n $first_access\n )\n );\n\n if ($row = $this->db->fetchRow()) {\n $source = $row['first_referer'];\n }\n }\n } // end query for first referrer\n\n // get most recent search engine and search engine keywords\n if (!isset($source)) {\n $this->db->query(\n sprintf(\n \"SELECT search_engines.search_engine AS search_engine,\n search_engines.keywords AS keywords\n FROM %s search_engines,\n %s visitors\n WHERE visitors.visitor_id = '%d'\n AND visitors.accesslog_id = search_engines.accesslog_id\n ORDER BY visitors.timestamp\",\n\n $this->config['plugins']['search_engines']['table'],\n $this->config['visitors_table'],\n $visitor_id\n )\n );\n if ($row = $this->db->fetchRow()) {\n $source = $row['search_engine'].': \"'.$row['keywords'].'\"';\n }\n } // end query for most recent search engines and search engine keywords\n\n // get most recent referrer\n if (!isset($source)) {\n $this->db->query(\n sprintf(\n \"SELECT referers.string AS referer\n FROM %s visitors,\n %s referers\n WHERE visitors.accesslog_id = '%d'\n AND visitors.referer_id = referers.data_id\",\n\n $this->config['visitors_table'],\n $this->config['referers_table'],\n $accesslogIDs[$i]\n )\n );\n if ($row = $this->db->fetchRow()) {\n $source = $row['referer'];\n } else {\n $source = 'unknown';\n }\n } // end query for most recent referrer\n\n // store source as a result\n switch ($parameters['result_format']) {\n case 'xml':\n case 'xml_object': {\n // ??\n }\n break;\n\n default: {\n $result[$source]['source'] = $source;\n }\n } // done storing source\n\n\n // query for conversions type, amount, and details\n $this->db->query(\n sprintf(\n \"SELECT conversions.sale AS sale,\n conversions.inquiry AS inquiry,\n conversions.signup AS signup\n FROM %s conversions,\n %s visitors\n WHERE visitors.accesslog_id = '%d'\n AND visitors.accesslog_id = conversions.accesslog_id\",\n\n $this->config['plugins']['conversions']['table'],\n $this->config['visitors_table'],\n $accesslogIDs[$i]\n )\n );\n\n if ($row = $this->db->fetchRow()) {\n $sale = $row['sale'];\n $inquiry = $row['inquiry'];\n $signup = $row['signup'];\n } else {\n $sale = '';\n $inquiry = '';\n $signup = '';\n }\n\n\n switch ($parameters['result_format']) {\n case 'xml':\n case 'xml_object': {\n // ??\n }\n break;\n\n default: {\n $result[$source]['sale'] = $result[$source]['sale'] + $sale;\n $result[$source]['inquiry'] = $result[$source]['inquiry'] + $inquiry;\n $result[$source]['signup'] = $result[$source]['signup'] + $signup;\n }\n }\n // end query for conversions type, amount, etc.\n\n } // end loop\n\n // return results\n switch ($parameters['result_format']) {\n case 'xml': {\n return $root->get();\n }\n break;\n\n case 'xml_object': {\n return $root;\n }\n break;\n\n default: {\n return $result;\n }\n }\n }", "function getSNPsStrains($source_id){\n global $snp_service;$url=\"$snp_service?format=xml&str=1\";\n $xml = simplexml_load_file($url,null, LIBXML_NOCDATA);\n $strains=array();\n if($xml){\n $sources=$xml->children()->strain; $index=0; $count=count($sources);\n while($index < $count){$bg=\"\";\n $source=$sources[$index]; ++$index;$id= $source->children()->id;\n $name= $source->children()->name;\n $this_source=$source->children()->source;\n $strains[\"$name\"][\"id\"]=$id;\n if($this_source==$source_id) $strains[\"$name\"][\"display\"]=1;\n else $strains[\"$name\"][\"display\"]=0; \n }\n } \n return $strains; \n}", "public function collectData(){\n\t\t// Simple HTML Dom is not accurate enough for the job\n\t\t$content = getContents($this->getURI())\n\t\t\tor returnServerError('No results for LWNprev');\n\n\t\tlibxml_use_internal_errors(true);\n\t\t$html = new DOMDocument();\n\t\t$html->loadHTML($content);\n\t\tlibxml_clear_errors();\n\n\t\t$cat1 = '';\n\t\t$cat2 = '';\n\n\t\tforeach($html->getElementsByTagName('a') as $a){\n\t\t\tif($a->textContent === 'Multi-page format'){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$realURI = self::URI . $a->getAttribute('href');\n\t\t$URICounter = 0;\n\n\t\t$edition = $html->getElementsByTagName('h1')->item(0)->textContent;\n\t\t$editionTimeStamp = strtotime(\n\t\t\tsubstr($edition, strpos($edition, 'for ') + strlen('for '))\n\t\t);\n\n\t\tforeach($html->getElementsByTagName('h2') as $h2){\n\t\t\tif($h2->getAttribute('class') !== 'SummaryHL'){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$item = array();\n\n\t\t\t$h2NextSibling = $h2->nextSibling;\n\t\t\t$this->jumpToNextTag($h2NextSibling);\n\n\t\t\tswitch($h2NextSibling->getAttribute('class')){\n\t\t\tcase 'FeatureByline':\n\t\t\t\t$item['author'] = $h2NextSibling->getElementsByTagName('b')->item(0)->textContent;\n\t\t\t\tbreak;\n\t\t\tcase 'GAByline':\n\t\t\t\t$text = $h2NextSibling->textContent;\n\t\t\t\t$item['author'] = substr($text, strpos($text, 'by '));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$item['author'] = 'LWN';\n\t\t\t\tbreak;\n\t\t\t};\n\n\t\t\t$h2FirstChild = $h2->firstChild;\n\t\t\t$this->jumpToNextTag($h2FirstChild);\n\t\t\tif($h2FirstChild->nodeName === 'a'){\n\t\t\t\t$item['uri'] = self::URI . $h2FirstChild->getAttribute('href');\n\t\t\t}else{\n\t\t\t\t$item['uri'] = $realURI . '#' . $URICounter;\n\t\t\t}\n\t\t\t$URICounter++;\n\n\t\t\t$item['timestamp'] = $editionTimeStamp + $URICounter;\n\n\t\t\t$h2PrevSibling = $h2->previousSibling;\n\t\t\t$this->jumpToPreviousTag($h2PrevSibling);\n\t\t\tswitch($h2PrevSibling->getAttribute('class')){\n\t\t\tcase 'Cat2HL':\n\t\t\t\t$cat2 = $h2PrevSibling->textContent;\n\t\t\t\t$h2PrevSibling = $h2PrevSibling->previousSibling;\n\t\t\t\t$this->jumpToPreviousTag($h2PrevSibling);\n\t\t\t\tif($h2PrevSibling->getAttribute('class') !== 'Cat1HL'){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$cat1 = $h2PrevSibling->textContent;\n\t\t\t\tbreak;\n\t\t\tcase 'Cat1HL':\n\t\t\t\t$cat1 = $h2PrevSibling->textContent;\n\t\t\t\t$cat2 = '';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$h2PrevSibling = null;\n\n\t\t\t$item['title'] = '';\n\t\t\tif(!empty($cat1)){\n\t\t\t\t$item['title'] .= '[' . $cat1 . ($cat2 ? '/' . $cat2 : '') . '] ';\n\t\t\t}\n\t\t\t$item['title'] .= $h2->textContent;\n\n\t\t\t$node = $h2;\n\t\t\t$content = '';\n\t\t\t$contentEnd = false;\n\t\t\twhile(!$contentEnd){\n\t\t\t\t$node = $node->nextSibling;\n\t\t\t\tif(!$node || (\n\t\t\t\t\t\t$node->nodeType !== XML_TEXT_NODE && (\n\t\t\t\t\t\t\t$node->nodeName === 'h2' || (\n\t\t\t\t\t\t\t\t!is_null($node->attributes) &&\n\t\t\t\t\t\t\t\t!is_null($class = $node->attributes->getNamedItem('class')) &&\n\t\t\t\t\t\t\t\tin_array($class->nodeValue, array('Cat1HL', 'Cat2HL'))\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\t$contentEnd = true;\n\t\t\t\t}else{\n\t\t\t\t\t$content .= $node->C14N();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$item['content'] = $content;\n\t\t\t$this->items[] = $item;\n\t\t}\n\t}", "public static function createFromXML(\\SimpleXMLElement $xml)\n {\n $event = new Event();\n\n // loop attributes\n foreach ($xml->attributes() as $attributeName => $value) {\n $method = 'set' . ucfirst($attributeName);\n\n switch ($attributeName) {\n case 'availablefrom':\n $method = 'setAvailableFrom';\n $value = new \\DateTime($value);\n break;\n case 'availableto':\n $method = 'setAvailableTo';\n $value = new \\DateTime($value);\n break;\n case 'creationdate':\n $method = 'setCreationDate';\n $value = new \\DateTime($value);\n break;\n case 'lastupdated':\n $method = 'setLastUpdated';\n $value = new \\DateTime($value);\n break;\n case 'pctcomplete':\n $method = 'setPercentageComplete';\n $value = (int) $value;\n break;\n case 'isparent':\n $method = 'setIsParent';\n $value = ((string) $value == 'true');\n break;\n case 'published':\n case 'private':\n $value = ((string) $value == 'true');\n break;\n default:\n $value = (string) $value;\n }\n\n if (!method_exists($event, $method)) {\n if (UitDatabank::DEBUG) {\n throw new Exception('Unknown attribute: ' . $attributeName);\n }\n } else {\n call_user_func(array($event, $method), $value);\n }\n }\n\n // loop elements\n foreach ($xml as $element) {\n $value = null;\n $elementName = $element->getName();\n $method = 'set' . ucfirst($element->getName());\n\n switch ($elementName) {\n case 'calendar':\n $value = Calendar::createFromXML($element);\n break;\n case 'categories':\n if (isset($element->category)) {\n foreach ($element->category as $category) {\n $event->addCategory(\n Category::createFromXML($category)\n );\n }\n }\n break;\n case 'contactinfo':\n $value = ContactInfo::createFromXML($element);\n break;\n case 'eventdetails':\n if (isset($element->eventdetail)) {\n foreach ($element->eventdetail as $eventDetail) {\n $event->addEventDetail(\n EventDetail::createFromXML($eventDetail)\n );\n }\n }\n break;\n case 'languages':\n if (isset($element->language)) {\n foreach ($element->language as $language) {\n $event->addLanguage(\n Language::createFromXML($language)\n );\n }\n }\n break;\n case 'location':\n $value = Location::createFromXML($element);\n break;\n case 'organiser':\n $value = Organiser::createFromXML($element);\n break;\n case 'agefrom':\n $value = (int) $value;\n break;\n case 'bookingperiod':\n $value = Period::createFromXML($element);\n break;\n default:\n $value = (string) $value;\n break;\n }\n\n if (!method_exists($event, $method)) {\n if (UitDatabank::DEBUG) {\n throw new Exception('Unknown element: ' . $elementName);\n }\n } else {\n if ($value !== null) {\n call_user_func(array($event, $method), $value);\n }\n }\n }\n\n return $event;\n }", "protected function _resourceMap()\n\t{\n\t\t$resourceMap = new \\ResourceMapGenerator();\n\t\t$id = '';\n\n\t\t// Retrieves the ID from alias\n\t\tif (substr(strtolower($this->_alias), -4) == '.rdf')\n\t\t{\n\t\t\t$lastSlash = strrpos($this->_alias, '/');\n\t\t\t$lastDot = strrpos($this->_alias, '.rdf');\n\t\t\t$id = substr($this->_alias, $lastSlash, $lastDot);\n\t\t}\n\n\t\t// Create download headers\n\t\t$resourceMap->pushDownload($this->config->get('webpath'));\n\t\texit;\n\t}", "public function buildClassAliasMapFile() {}", "function load_countries_from_xml() {\n\t\t$doc = new DOMDocument();\n\t\t$doc->load( plugin_dir_path( __FILE__ ) . 'xml/countrylist.xml' );\n\t\t\n\t\t$rootnode = $doc->getElementsByTagName( 'countries' )->item( 0 );\n\t\t\n\t\t$arrayofcountries = array();\n\t\t$arrayposition = 0;\n\t\tforeach ( $rootnode->getElementsByTagName( 'country' ) as $countryitem ) {\n\t\t\t\n\t\t\t$arrayattributes = array();\n\t\t\tif ( $countryitem->hasAttributes() ) {\n\t\t\t\t$xmlattributes = $countryitem->attributes;\n\t\t\t\tif ( ! is_null( $xmlattributes ) ) {\n\t\t\t\t\tforeach ( $xmlattributes as $index => $attr ) {\n\t\t\t\t\t\t$arrayattributes[$attr->name] = $attr->value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$arrayofcountries[$arrayposition][0] = $arrayattributes;\n\t\t\t\n\t\t\t$citysubnodes = array();\n\t\t\tif ( $countryitem->childNodes->length ) {\n\t\t\t\t$cityarrpos = 0;\n\t\t\t\tforeach ( $countryitem->childNodes as $city ) {\n\t\t\t\t\t\n\t\t\t\t\t//echo count( $city->attributes ) . ',';\n\t\t\t\t\t$cityarrayattributes = array();\n\t\t\t\t\tif ( $city->hasAttributes() ) {\n\t\t\t\t\t\t//echo 'has attributes';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$xmlattributes = $city->attributes;\n\t\t\t\t\t\tif ( ! is_null( $xmlattributes ) ) {\n\t\t\t\t\t\t\tforeach ( $xmlattributes as $index => $attr ) {\n\t\t\t\t\t\t\t\t//echo $attr->value;\n\t\t\t\t\t\t\t\t$cityarrayattributes[$attr->name] = $attr->value;\n\t\t\t\t\t\t\t\t//echo $cityarrayattributes[$attr->name] . 'xx';\n\t\t\t\t\t\t\t\t//echo $attr->value;\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$citysubnodes[$cityarrpos] = $cityarrayattributes;\n\t\t\t\t\t\t$cityarrpos++;\n\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$arrayofcountries[$arrayposition][1] = $citysubnodes;\n\t\t\t//echo count( $arrayofcountries[$arrayposition][1] );\n\t\t\t$arrayposition++;\n\t\t}\n\t\t\n\t\treturn $arrayofcountries;\n\t}", "protected function parseXML($xml)\n {\n $this->destinationList = [];\n if (! $xml) {\n return false;\n }\n\n $i = 0;\n foreach ($xml->DestinationList->children() as $item) {\n $this->destinationList[$i]['DeliveryChannel'] = (string) $item->DeliveryChannel;\n\n foreach ($item->AttributeList->children() as $member) {\n $this->destinationList[$i]['AttributeList'][(string) $member->Key] = (string) $member->Value;\n }\n\n $i++;\n }\n }", "private function parseEvent($str, $month, $year, $tzSrc, $tzDest) {\n\t\t$html = new DOMDocument();\n\t\t$html->loadHTML(\"<?xml encoding='UTF-8' ?>\" . $str);\n\t\t$event = array();\n\t\t$node = $html->getElementsByTagName(\"body\");\n\t\tforeach ($node as $body) {\n\t\t\tforeach ($body->childNodes as $node) {\n\t\t\t\t$_id = explode(\"_\", $node->getAttribute(\"id\"));\n\t\t\t\t$_id = $_id[0];\n\t\t\t\tforeach ($node->getElementsByTagName(\"div\") as $subnode) {\n\t\t\t\t\t$class = $subnode->getAttribute(\"class\");\n\t\t\t\t\tif ($class === \"eventDateBlock\") {\n\t\t\t\t\t\t// date\n\t\t\t\t\t\t$_date = explode(\" \", $subnode->firstChild->textContent);\n\t\t\t\t\t\t$_date = (strlen($_date[1]) === 1) ? \"0\" . $_date[1] : (string) $_date[1];\n\t\t\t\t\t\t$_date = \"$year-$month-\" . $_date;\n\t\t\t\t\t\t$_time = $subnode->childNodes->item(2)->textContent;\n\t\t\t\t\t} elseif ($class === \"playerAvatar\") {\n\t\t\t\t\t\t// url, images\n\t\t\t\t\t\t$a = $subnode->firstChild;\n\t\t\t\t\t\t$_url = $a->getAttribute(\"href\");\n\t\t\t\t\t\t$img = $a->firstChild;\n\t\t\t\t\t\t$_img_icon = $img->getAttribute(\"src\");\n\t\t\t\t\t\t// relocate onto a // aware domain, cdn.akamai.steamstatic.com → steamcdn-a.akamaihd.net\n\t\t\t\t\t\t$_img_icon = str_replace( \"http://cdn.akamai.steamstatic.com\", \"//steamcdn-a.akamaihd.net\", $_img_icon);\n\t\t\t\t\t\t$_appid = explode(\"/\", $_img_icon);\n\t\t\t\t\t\t$_appid = intval($_appid[count($_appid) - 2]);\n\t\t\t\t\t\tif ($_appid === 0) {\n\t\t\t\t\t\t\t$_img_header = \"\";\n\t\t\t\t\t\t\t$_img_header_small = \"\";\n\t\t\t\t\t\t\t$_img_capsule = \"\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$_img_header = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/header.jpg\";\n\t\t\t\t\t\t\t$_img_header_small = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/header_292x136.jpg\";\n\t\t\t\t\t\t\t$_img_capsule = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/capsule_sm_120.jpg\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ($class === \"eventBlockTitle\") {\n\t\t\t\t\t\t$l = $subnode->childNodes;\n\t\t\t\t\t\tforeach ($l as $a) {\n\t\t\t\t\t\t\tif ($a->nodeType === XML_ELEMENT_NODE) {\n\t\t\t\t\t\t\t\tif ($a->tagName === \"a\") {\n\t\t\t\t\t\t\t\t\tif ($a->getAttribute(\"class\") === \"headlineLink\") {\n\t\t\t\t\t\t\t\t\t\t// title\n\t\t\t\t\t\t\t\t\t\t$a = $subnode->firstChild;\n\t\t\t\t\t\t\t\t\t\t$_title = $a->textContent;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t// comment count\n\t\t\t\t\t\t\t\t\t\t$_comments = explode(\" \", $a->textContent);\n\t\t\t\t\t\t\t\t\t\t$_comments = intval($_comments[0]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$tempDate = new DateTime($_date . \" \" . $_time, $tzSrc);\n\t\t$tempDate->setTimeZone($tzDest);\n\n\t\t$event[\"id\"] = $_id;\n\t\t$event[\"url\"] = $_url;\n\t\t$event[\"title\"] = $_title;\n\t\t$event[\"comments\"] = $_comments;\n\t\t$event[\"date\"] = $tempDate->format(\"Y-m-d\");\n\t\t$event[\"time\"] = $tempDate->format(\"H:i\");\n\t\t$event[\"tz\"] = $tempDate->format(\"e\");\n\t\t$event[\"appid\"] = $_appid;\n\t\t$event[\"img_icon\"] = $_img_icon;\n\t\t$event[\"img_capsule\"] = $_img_capsule;\n\t\t$event[\"img_header\"] = $_img_header;\n\t\t$event[\"img_header_small\"] = $_img_header_small;\n\t\treturn $event;\n\t}", "protected function getExtractorRegistry() {}", "private function parseSource( ezcFeedSourceElement $element, DOMElement $xml )\n {\n foreach ( $xml->childNodes as $sourceChild )\n {\n if ( $sourceChild->nodeType === XML_ELEMENT_NODE )\n {\n $tagName = $sourceChild->tagName;\n\n switch ( $tagName )\n {\n case 'title':\n $this->parseTextNode( $element, $sourceChild, 'title' );\n break;\n\n case 'rights':\n $this->parseTextNode( $element, $sourceChild, 'copyright' );\n break;\n\n case 'subtitle':\n $this->parseTextNode( $element, $sourceChild, 'description' );\n break;\n\n case 'id':\n $subElement = $element->add( 'id' );\n $subElement->id = $sourceChild->textContent;\n break;\n\n case 'generator':\n $subElement = $element->add( 'generator' );\n $subElement->name = $sourceChild->textContent;\n\n $attributes = array( 'uri' => 'url', 'version' => 'version' );\n foreach ( $attributes as $name => $alias )\n {\n if ( $sourceChild->hasAttribute( $name ) )\n {\n $subElement->$alias = $sourceChild->getAttribute( $name );\n }\n }\n break;\n\n case 'logo':\n $subElement = $element->add( 'image' );\n $subElement->link = $sourceChild->textContent;\n break;\n\n case 'icon':\n $subElement = $element->add( 'icon' );\n $subElement->link = $sourceChild->textContent;\n break;\n\n case 'updated':\n $element->$tagName = $sourceChild->textContent;\n break;\n\n case 'category':\n $subElement = $element->add( $tagName );\n\n $attributes = array( 'term' => 'term', 'scheme' => 'scheme', 'label' => 'label' );\n foreach ( $attributes as $name => $alias )\n {\n if ( $sourceChild->hasAttribute( $name ) )\n {\n $subElement->$alias = $sourceChild->getAttribute( $name );\n }\n }\n break;\n\n case 'link':\n $subElement = $element->add( $tagName );\n\n $attributes = array( 'href' => 'href', 'rel' => 'rel', 'hreflang' => 'hreflang',\n 'type' => 'type', 'title' => 'title', 'length' => 'length' );\n\n foreach ( $attributes as $name => $alias )\n {\n if ( $sourceChild->hasAttribute( $name ) )\n {\n $subElement->$alias = $sourceChild->getAttribute( $name );\n }\n }\n break;\n\n case 'contributor':\n case 'author':\n $subElement = $element->add( $tagName );\n $this->parsePerson( $subElement, $sourceChild, $tagName );\n break;\n }\n }\n }\n }", "protected function atom()\n {\n $return = array();\n foreach ($this->xml->entry as $entry) {\n $callbackReturn = $this->applyCallbacks($entry);\n $return[] = array_merge($callbackReturn, array(\n 'type' => $this->settings['type'],\n 'service' => $this->settings['service'],\n 'stamp' => (int) strtotime($entry->updated),\n 'url' => (string) $entry->link->attributes()->href,\n 'text' => (string) $entry->title,\n 'resource' => $this->settings['resource_name'],\n ));\n }\n\n return $return;\n }", "protected function getAttributeEvents()\n {\n $events = [];\n foreach($this->dispatchesEvents as $event => $class) {\n if(strpos($event, ':') !== false) {\n $events[$event] = $class;\n }\n }\n return $events;\n }", "public function getListeners(): array;", "private function mapElements(){\n $aux = '';\n if(!empty($this->category_list)){\n foreach($this->category_list as $c) {\n $category = new Category();\n $category->loadTaggedElement($c);\n $aux[] = $category; \n }\n $this->category_list = $aux;\n }\n $aux = '';\n if(!empty($this->user_category_list)) {\n foreach($this->user_category_list as $u) {\n $user_category = new Category();\n $user_category->loadTaggedElement($u);\n $aux[] = $user_category;\n }\n $this->user_category_list = $aux;\n } \n $aux = '';\n if(!empty($this->entity_list)){\n foreach($this->entity_list as $e) {\n $entity = new Entity();\n $entity->loadTaggedElement($e);\n $aux[] = $entity;\n }\n $this->entity_list = $aux;\n }\n $aux = '';\n if(!empty($this->concept_list)){\n foreach($this->concept_list as $c) {\n $concept = new Concept();\n $concept->loadTaggedElement($c);\n $aux[] = $concept;\n }\n $this->concept_list = $aux;\n }\n $aux = '';\n if(!empty($this->time_expression_list)){\n foreach($this->time_expression_list as $t)\n $aux[] = new TimeExpression($t);\n $this->time_expression_list = $aux;\n }\n $aux = '';\n if(!empty($this->money_expression_list)){\n foreach($this->money_expression_list as $m)\n $aux[] = new MoneyExpression($m);\n $this->money_expression_list = $aux;\n }\n $aux = '';\n if(!empty($this->uri_list)){\n foreach($this->uri_list as $u)\n $aux[] = new URI($u);\n $this->uri_list = $aux;\n }\n $aux = '';\n if(!empty($this->phone_expression_list)){\n foreach($this->phone_expression_list as $p)\n $aux[] = new PhoneExpression($p);\n $this->phone_expression_list = $aux;\n } \n $aux = '';\n if(!empty($this->quotation_list)){\n foreach($this->quotation_list as $p)\n $aux[] = new Quotation($p);\n $this->quotation_list = $aux;\n } \n $aux = '';\n if(!empty($this->issue_list)) {\n foreach($this->issue_list as $i)\n $aux[] = new Issue($i);\n $this->issue_list = $aux;\n }\n }", "public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true,\n\t\t\t\t'title' => Loc::getMessage('TRACKER_ENTITY_ID_FIELD'),\n\t\t\t),\n\t\t\t'SESSION_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'title' => Loc::getMessage('TRACKER_ENTITY_SESSION_ID_FIELD'),\n\t\t\t),\n\t\t\t'CHAT_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'title' => Loc::getMessage('TRACKER_ENTITY_CHAT_ID_FIELD'),\n\t\t\t),\n\t\t\t'MESSAGE_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'title' => Loc::getMessage('TRACKER_ENTITY_MESSAGE_ID_FIELD'),\n\t\t\t),\n\t\t\t'MESSAGE_ORIGIN_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'title' => Loc::getMessage('TRACKER_ENTITY_MESSAGE_ORIGIN_ID_FIELD'),\n\t\t\t),\n\t\t\t'USER_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'title' => Loc::getMessage('TRACKER_ENTITY_USER_ID_FIELD'),\n\t\t\t),\n\t\t\t'ACTION' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'validation' => array(__CLASS__, 'validateAction'),\n\t\t\t\t'title' => Loc::getMessage('TRACKER_ENTITY_ACTION_FIELD'),\n\t\t\t),\n\t\t\t'CRM_ENTITY_TYPE' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'validation' => array(__CLASS__, 'validateCrmEntityType'),\n\t\t\t\t'title' => Loc::getMessage('TRACKER_ENTITY_CRM_ENTITY_TYPE_FIELD'),\n\t\t\t),\n\t\t\t'CRM_ENTITY_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'title' => Loc::getMessage('TRACKER_ENTITY_CRM_ENTITY_ID_FIELD'),\n\t\t\t),\n\t\t\t'FIELD_TYPE' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'validation' => array(__CLASS__, 'validateValue'),\n\t\t\t\t'title' => Loc::getMessage('TRACKER_ENTITY_FIELD_NAME_FIELD'),\n\t\t\t),\n\t\t\t'FIELD_VALUE' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'validation' => array(__CLASS__, 'validateValue'),\n\t\t\t\t'title' => Loc::getMessage('TRACKER_ENTITY_FIELD_VALUE_FIELD'),\n\t\t\t),\n\t\t\t'DATE_CREATE' => array(\n\t\t\t\t'data_type' => 'datetime',\n\t\t\t\t'title' => Loc::getMessage('TRACKER_ENTITY_DATE_CREATE_FIELD'),\n\t\t\t\t'default_value' => array(__CLASS__, 'getCurrentDate'),\n\t\t\t),\n\t\t);\n\t}", "private function buildIncomingAssociationMapCache(string $targetClass, array $excludedClasses = []): void\n {\n $key = $this->getAssociationMapCacheKey($targetClass, $excludedClasses);\n $this->incomingAssociationMapCache[$key] = [];\n\n $metaData = $this->entityManager->getMetadataFactory()->getAllMetadata();\n /** @var ClassMetadata $classMetadata */\n foreach($metaData as $classMetadata) {\n if ($classMetadata->isMappedSuperclass) {\n continue;\n }\n $reflectionClass = $classMetadata->getReflectionClass();\n if ($reflectionClass->isAbstract() || $reflectionClass->isInterface()) {\n continue;\n }\n $className = $classMetadata->getName();\n\n $isExcluded = false;\n foreach($excludedClasses as $excludedClass) {\n if (is_a($className, $excludedClass, true)) {\n $isExcluded = true;\n break;\n }\n }\n if ($isExcluded) {\n continue;\n }\n\n $associations = $classMetadata->getAssociationNames();\n foreach($associations as $associationName) {\n $associationClass = $classMetadata->getAssociationTargetClass($associationName);\n if (is_a($associationClass, $targetClass, true)) {\n $this->incomingAssociationMapCache[$key] []= new AssociationNode($className, $associationName, $classMetadata->isSingleValuedAssociation($associationName));\n }\n }\n }\n }", "public function convert($source)\n {\n $output = [];\n /** @var \\DOMNodeList $types */\n $types = $source->getElementsByTagName('type');\n /** @var \\DOMNode $type */\n foreach ($types as $type) {\n $typeConfig = [];\n foreach ($type->attributes as $attribute) {\n $typeConfig[$attribute->nodeName] = $attribute->nodeValue;\n }\n /** @var \\DOMNode $childNode */\n foreach ($type->childNodes as $childNode) {\n if ($childNode->nodeType == XML_ELEMENT_NODE ||\n ($childNode->nodeType == XML_CDATA_SECTION_NODE ||\n $childNode->nodeType == XML_TEXT_NODE && trim(\n $childNode->nodeValue\n ) != '')\n ) {\n $typeConfig[$childNode->nodeName] = $childNode->nodeValue;\n }\n }\n $output[$type->attributes->getNamedItem('name')->nodeValue] = $typeConfig;\n }\n return ['types' => $output];\n }", "protected function _createCidToGidMap() {}", "function getReferences()\n\t{\n\t\tif ($nodes = $this->getElementsByTagname(\"LO\"))\n\t\t{\n\t\t\tforeach ($nodes as $node)\n\t\t\t{\n\t\t\t\t$attr[] = $node->get_attribute(\"id\");\n\t\t\t}\n\t\t}\n\n\t\treturn $attr;\n\t}" ]
[ "0.6444875", "0.6097816", "0.57355887", "0.5629596", "0.53465986", "0.5275113", "0.521377", "0.5208028", "0.51833755", "0.51134807", "0.5046077", "0.5019277", "0.5014572", "0.49979517", "0.49915347", "0.49905762", "0.49672246", "0.49671835", "0.49537045", "0.49379966", "0.4867143", "0.48641184", "0.4852946", "0.48418617", "0.4806488", "0.48013237", "0.47731167", "0.47582358", "0.47547337", "0.47110394", "0.4686208", "0.4655441", "0.4647709", "0.4637991", "0.46312597", "0.46308327", "0.46202034", "0.4615811", "0.45958441", "0.4582864", "0.4519176", "0.45100027", "0.4509011", "0.45089427", "0.4499358", "0.4497036", "0.44838175", "0.447744", "0.44706556", "0.44628713", "0.44472036", "0.4420218", "0.44181648", "0.44043013", "0.43941173", "0.4393835", "0.43904287", "0.43764403", "0.43751118", "0.43627802", "0.43514475", "0.43502194", "0.43289194", "0.43281707", "0.43277147", "0.43276224", "0.4326529", "0.43258888", "0.43156445", "0.43103915", "0.4296381", "0.42952016", "0.4286844", "0.42745185", "0.42625585", "0.42604914", "0.4243084", "0.42378", "0.42335087", "0.4230688", "0.42278576", "0.4224932", "0.4216176", "0.42157453", "0.42054707", "0.42005372", "0.41995084", "0.41979128", "0.41939637", "0.41861546", "0.41788393", "0.4177321", "0.41764206", "0.41716132", "0.41711634", "0.41706705", "0.41496277", "0.4144464", "0.4138145", "0.4131465" ]
0.75873345
0
Builds an XML Map used to parse plugins from an XML source
protected function xmlPluginsMapFactory() { $map = new Map(); $map->add( Path::factory('/fwk/plugin', 'plugins') ->loop(true) ->attribute('class') ->attribute('service') ->addChildren( Path::factory('param', 'params') ->attribute('name') ->filter(array($this, 'propertizeString')) ->value('value') ->loop(true) ) ); return $map; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function build_xml_map() {\n $this->_create_map();\n header(\"content-type: text/xml\");\n echo $this->result;\n }", "protected function xmlServicesMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/services', 'services', array())\n ->loop(true, '@xml')\n ->attribute('xmlMap')\n );\n \n return $map;\n }", "protected function xmlListenersMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/listener', 'listeners')\n ->loop(true)\n ->attribute('class')\n ->attribute('service')\n ->addChildren(\n Path::factory('param', 'params')\n ->attribute('name')\n ->filter(array($this, 'propertizeString'))\n ->value('value')\n ->loop(true)\n )\n );\n \n return $map;\n }", "public function getXMLPageMap() {\n\t\tstatic $xml;\n\n\t\tif (isset($xml)) return $xml;\n\t\t$cache = SA_SimpleCache::singleton('__XML_PAGES_MAP__');\n\t\tif ($xmlString = $cache->load()) {\n\t\t\t$xml = new SimpleXMLElement($xmlString);\n\t\t} else {\n\t\t\t$xml = new SimpleXMLElement('<?xml version=\"1.0\" standalone=\"yes\"?><pages/>');\n\t\t\t$this->xmlFileSystem($this->getPagesDir(), $xml);\n\t\t\t$cache->save($xml->asXML());\n\t\t}\n\t\treturn $xml;\n\t}", "protected function xmlIniMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/ini', 'ini', array())\n ->loop(true)\n ->attribute('category')\n ->value('value')\n );\n \n return $map;\n }", "public function initXmlPlugins()\n {\n $this->collXmlPlugins = new ObjectCollection();\n $this->collXmlPluginsPartial = true;\n\n $this->collXmlPlugins->setModel('\\Plugins');\n }", "abstract protected function buildMap();", "protected function xmlActionMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/actions/action', 'actions')\n ->loop(true, '@name')\n ->attribute('class')\n ->attribute('method')\n ->attribute('shortcut')\n );\n \n return $map;\n }", "public function buildFromXML($eloXML = null){\n\t\tif ($eloXML !== null){\n\t\t\t$dom = str_get_dom($eloXML);\n\t\t\t\n\t\t\t$contentWithDataTag = $this->getElemAtPos($dom, 'content', 0);\n\t\t\t$dataTag = $this->getElemAtPos($contentWithDataTag, 'data', 0); \n\t\t\tif ($dataTag->innertext !== null){\n\t\t\t\t$content = $dataTag->innertext;\n\t\t\t}else{\n\t\t\t\t$content = '';\n\t\t\t}\n\t\t\t\n\t\t\t$this->setContent($content);\n\t\t\t\n\t\t\t$metadataElem = $this->getElemAtPos($dom, 'metadata', 0);\n\t\t\tif ($metadataElem !== null){\n\t\t\t\tforeach($metadataElem->childNodes() as $curMetadataElem){\n\t\t\t\t\t\n\t\t\t\t\tif ($curMetadataElem->tag == 'uri'){\n\t\t\t\t\t\t$curMetadataElem = $curMetadataElem->find('entry');\n\t\t\t\t\t\t$curMetadataElem = $curMetadataElem[0];\n\t\t\t\t\t\t\n\t\t\t\t\t\t$key = 'uri';\n\t\t\t\t\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\t$key = $curMetadataElem->tag;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$value = $curMetadataElem->innertext;\n\t\t\t\t\t$this->_metadata[$key] = $value;\n\n\t\t\t\t\t// extract the id from URI\n\t\t\t\t\tif ($key === 'uri'){\n\t\t\t\t\t\t$this->_id = substr(strrchr($value, '/'), 1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// This code is to dynamically set the values for the\n\t\t\t\t\t// elo's metadatas\n\t\t\t\t\t/*\n\t\t\t\t\t * THIS WAS MESSING UP THE POPULATION OF THE CODE. \n\t\t\t\t\t * SEEMS TO BE DOING THE EXACT SAME THING AS $this->_metadata[$key] = $value; BUT ADDING A _<mt key> VARIABLE THAT\n\t\t\t\t\t * MESSES UP THE XML GENERATION.\n\t\t\t\t\t */\n//\t\t\t\t\t$keyVar = \"_\" . $key;\n//\t\t\t\t\t$this->$keyVar = $value;\n//\t\t\t\t\t$this->addMetadata($key, $value);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$resourceElem = $this->getElemAtPos($dom, 'resource', 0);\n\t\t\tif ($resourceElem !== null){\n\t\t\t\tif ($resourceElem ){\n\t\t\t\t\tforeach($resourceElem->childNodes() as $curResourceElem){\n\t\t\t\t\t\t$key = $curResourceElem->tag;\n\t\t\t\t\t\t$value = $curResourceElem->innertext;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->_resources[$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "static function xmlList()\n\t{\n\t\treturn simplexml_load_file('http://ws.geonames.org/countryInfo');\n\t}", "function webmap_compo_lib_xml_build()\r\n{\r\n\t$this->webmap_compo_lib_xml_base();\r\n}", "private function generateXml()\n {\n\n $args = array(\n\n 'posts_per_page' => -1,\n 'numberposts' => -1,\n 'orderby' => 'post_type',\n 'order' => 'DESC',\n 'post_type' => apply_filters('fpcms_sitemap_post_types', array('post', 'page'))\n\n );\n\n if ($results = get_posts($args)) {\n\n $sitemap = new \\SimpleXMLElement($this->getDocStructure());\n\n foreach ($results as $result) {\n\n $url = $sitemap->addChild('url');\n $url->addChild('loc', get_permalink($result->ID));\n\n if (has_post_thumbnail($result->ID)) {\n\n if ($image = wp_get_attachment_image_src(get_post_thumbnail_id($result->ID))) {\n $url->addChild('image:image', $image[0]);\n }\n\n }\n\n $url->addChild('lastmod', mysql2date('Y-m-d', $result->post_date_gmt));\n\n if ($result->post_type == 'page') {\n\n //Pages should display higher than posts for the same keyword\n $url->addChild('priority', apply_filters('fpcms_sitemap_page_priority', '0.7'));\n\n } else {\n\n $url->addChild('priority', apply_filters('fpcms_sitemap_post_priority', '0.4'));\n\n }\n\n }\n\n return $sitemap->asXML();\n\n }\n\n }", "public function map() {\n\t\treturn array(\n\t\t\t'name' => esc_html__( 'Image Grid', 'total-theme-core' ),\n\t\t\t'description' => esc_html__( 'Responsive image gallery', 'total-theme-core' ),\n\t\t\t'base' => 'vcex_image_grid',\n\t\t\t'icon' => 'vcex_element-icon vcex_element-icon--image-gallery',\n\t\t\t'admin_enqueue_js' => vcex_wpbakery_asset_url( 'js/backend-editor/vcex-image-gallery-view.min.js' ),\n\t\t\t'js_view' => 'vcexBackendViewImageGallery',\n\t\t\t'category' => vcex_shortcodes_branding(),\n\t\t\t'params' => Shortcode::get_params(),\n\t\t);\n\t}", "public function loadXml($filename,$map_path){\r\n \r\n $this->rootPath = $this->_preparePath($map_path);\r\n \r\n if(!File::exists( $this->rootPath .DS. $filename ))\r\n App::critical_error ('XML document not found: '.$this->rootPath .DS. $filename);\r\n \r\n $xmlDoc = $this->_initDocument($this->rootPath .DS. $filename);\r\n \r\n //get the project elements\r\n $elements = $xmlDoc->getElementsByTagName('element');\r\n \r\n foreach($elements as $element){\r\n \r\n if(count($this->elements) == 0 ){\r\n $this->elements = $this->_loadElement($element);\r\n }\r\n else{\r\n $this->elements = array_merge($this->elements,$this->_loadElement($element));\r\n }\r\n }\r\n \r\n //isolate the template key\r\n if(!is_null($this->_templatekey) && !is_null($this->elements[$this->_templatekey]))\r\n $this->elements['templates'] = $this->elements[$this->_templatekey];\r\n \r\n //clean the element values\r\n //array_walk_recursive($this->element, array($this, '_clean'));\r\n \r\n return File::put(APP_PROJECT .DS. 'elements.php' ,serialize($this->elements)); \r\n }", "function generate_mapservice_conf_file(){\n\t\t$dom;\n\t\tif(!$dom = domxml_open_file($this->default_mapservconf_file)){\n\t\t\techo \"Could not open xml file: \" . $this->default_mapservconf_file;\n\t\t\treturn NULL; \n\t\t}\n\t\t$mapservice = $this->find_mapservice($dom);\n\t\t// map service not found\n\t\tif($mapservice == NULL){\n\t\t\techo \"could not find map-service named: \" . $mapservice_name ;\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\t$children = $mapservice->child_nodes();\n\t\t$n_children = count($children);\n\t\t\n\t\t// loop through to find <map-file>\n\t\t// and <layer-config> element\n\t\tfor($i = 0; $i < $n_children; $i++){\n\t\t\tswitch ($children[$i]->tagname){\n\t\t\t\tcase \"map-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_mapfile);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"layer-config-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_layerconf);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$dom->dump_file($this->output_mapservconf, false, false);\n\t\treturn $this->output_mapservconf;\n\t}", "protected function buildPluginNodes() {\n\t\t$this->node = $this->getToken();\n\t\t\n\t\t// fetch ordered pips\n\t\t$pips = array();\n\t\t$sql = \"SELECT\t\tpluginName, className,\n\t\t\t\t\tCASE pluginName WHEN 'packageinstallationplugins' THEN 1 WHEN 'files' THEN 2 ELSE 0 END 'pluginOrder'\n\t\t\tFROM\t\twcf\".WCF_N.\"_package_installation_plugin\n\t\t\tWHERE\t\tpackageID IN (\n\t\t\t\t\t\t1 /* TESTING ONLY */\n\t\t\t\t\t\t/*\n\t\t\t\t\t\tSELECT\tdependency\n\t\t\t\t\t\tFROM\twcf\".WCF_N.\"_package_dependency\n\t\t\t\t\t\tWHERE\tpackageID = \".$this->installation->queue->packageID.\"\n\t\t\t\t\t\t*/\n\t\t\t\t\t)\n\t\t\tORDER BY\tpluginOrder ASC, priority DESC\";\n\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\t$statement->execute();\n\t\twhile ($row = $statement->fetchArray()) {\n\t\t\t$pips[] = $row;\n\t\t}\n\t\t\n\t\t// insert pips\n\t\t$sql = \"INSERT INTO\twcf\".WCF_N.\"_package_installation_node\n\t\t\t\t\t(queueID, processNo, sequenceNo, node, nodeType, nodeData)\n\t\t\tVALUES\t\t(?, ?, ?, ?, ?, ?)\";\n\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\t$sequenceNo = 0;\n\t\t\n\t\tforeach ($pips as $pip) {\n\t\t\t$statement->execute(array(\n\t\t\t\t$this->installation->queue->queueID,\n\t\t\t\t$this->installation->queue->processNo,\n\t\t\t\t$sequenceNo,\n\t\t\t\t$this->node,\n\t\t\t\t'pip',\n\t\t\t\tserialize(array(\n\t\t\t\t\t'pluginName' => $pip['pluginName'],\n\t\t\t\t\t'className' => $pip['className']\n\t\t\t\t))\n\t\t\t));\n\t\t\t\n\t\t\t$sequenceNo++;\n\t\t}\n\t}", "function get_map($source)\n{\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_json = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('person', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n 'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_datajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_socratajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'upload' => array('upload', 2),\n 'format' => array('format', 2),\n 'name' => array('name', 2),\n 'modified' => array('modified',1),\n );\n\n // 'dest_key' => array('source_key', dest_position, source_position)\n // 0/1/2 denotes root/extras/resources.\n $map_ckan = array(\n 'title' => array('title', 0, 0),\n 'notes' => array('notes', 0, 0),\n // hard-code publisher to orgnization.title in ckan_map for now.\n // todo: change this map structure.\n 'publisher' => array('place-holder', 1, 1),\n 'public_access_level' => array('access-level', 1, 1),\n 'contact_email' => array('contact-email', 1, 1),\n 'contact_name' => array('person', 1, 1),\n 'unique_id' => array('id', 1, 0),\n 'tags' => array('tags', 0, 1),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('data-dictiionary', 1, 1), // there is a typo.\n 'license_title' => array('license_title', 0, 0),\n 'spatial' => array('spatial-text', 1, 1),\n 'temporal' => array('dataset-reference-date', 1, 1),\n 'release_date' => array('issued', 1, 1),\n 'accrual_periodicity' => array('frequency-of-update', 1, 1),\n 'related_documents' => array('references', 1, 1),\n 'language' => array('metadata-language', 1, 1),\n 'homepage_url' => array('url', 1, 0),\n 'url' => array('url', 2, 2),\n 'name' => array('name', 2, 2),\n 'format' => array('format', 2, 2),\n );\n\n $ret_map = \"map_$source\";\n return isset($$ret_map) ? $$ret_map : null;\n}", "function GetMapContent($hide_mode_ids) {\n\tglobal $config;\n\n\t$lang = GetLangContent(\"map\");\n\n\t$map = array();\n\tif (file_exists($config[\"site_path\"].\"/include/map.xml\")) {\n\t\t$xml_parser = new SimpleXmlParser( $config[\"site_path\"].\"/include/map.xml\" );\n\t\t$xml_root = $xml_parser->getRoot();\n\n\t\tforeach ( $xml_root->children as $cnt => $xml_section ) {\n\t\t\tif (!isset($xml_section->attrs[\"id\"]) || (isset($xml_section->attrs[\"id\"]) && !in_array($xml_section->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t$section = array();\n\t\t\t\t$section = array(\"name\" => (isset($lang[$xml_section->attrs[\"name\"]]) ? $lang[$xml_section->attrs[\"name\"]] : $xml_section->attrs[\"name\"]), \"link\" => $xml_section->attrs[\"link\"]);\n\t\t\t\tif ($xml_section->children) {\n\t\t\t\t\tforeach ( $xml_section->children as $xml_subsection_cnt => $xml_subsection ) {\n\t\t\t\t\t\tif (!isset($xml_subsection->attrs[\"id\"]) || (isset($xml_subsection->attrs[\"id\"]) && !in_array($xml_subsection->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t\t\t\t$subsection = array();\n\t\t\t\t\t\t\t$subsection[\"name\"] = (isset($lang[$xml_subsection->attrs[\"name\"]]) ? $lang[$xml_subsection->attrs[\"name\"]] : $xml_subsection->attrs[\"name\"]);\n\t\t\t\t\t\t\t$subsection[\"link\"] = $xml_subsection->attrs[\"link\"];\n\t\t\t\t\t\t\tif ($xml_subsection->children) {\n\t\t\t\t\t\t\t\t$item = array();\n\t\t\t\t\t\t\t\tforeach ( $xml_subsection->children as $xml_item_cnt => $xml_item ) {\n\t\t\t\t\t\t\t\t\tif (!isset($xml_item->attrs[\"id\"]) || (isset($xml_item->attrs[\"id\"]) && !in_array($xml_item->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t\t\t\t\t\t\t$item[] = array(\"name\" => (isset($lang[$xml_item->attrs[\"name\"]]) ? $lang[$xml_item->attrs[\"name\"]] : $xml_item->attrs[\"name\"]), \"link\" => $xml_item->attrs[\"link\"]);\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\t$subsection[\"subsection\"] = $item;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$section[\"subsection\"][] = $subsection;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$map[] = $section;\n\t\t\t}\n\t\t}\n\t}\n\treturn $map;\n}", "public static function buildTableMap()\n {\n $dbMap = Propel::getServiceContainer()->getDatabaseMap(CKOrderXmlTableMap::DATABASE_NAME);\n if (!$dbMap->hasTable(CKOrderXmlTableMap::TABLE_NAME)) {\n $dbMap->addTableObject(new CKOrderXmlTableMap());\n }\n }", "function loadPlugins() {\n\n\t\t// load and parse the plugins file\n\t\tif ($plugins = $this->xml_parser->parseXml('plugins.xml')) {\n\t\t\tif (!empty($plugins['XASECO2_PLUGINS']['PLUGIN'])) {\n\t\t\t\t// take each plugin tag\n\t\t\t\tforeach ($plugins['XASECO2_PLUGINS']['PLUGIN'] as $plugin) {\n\t\t\t\t\t// log plugin message\n\t\t\t\t\t$this->console_text('[XAseco2] Load plugin [' . $plugin . ']');\n\t\t\t\t\t// include the plugin\n\t\t\t\t\trequire_once('plugins/' . $plugin);\n\t\t\t\t\t$this->plugins[] = $plugin;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\ttrigger_error('Could not read/parse plugins list plugins.xml !', E_USER_ERROR);\n\t\t}\n\t}", "function xmlProvider() {\n\n return [\n [\n 'hello',\n 'hello',\n ],\n [\n '<element>hello</element>',\n '<element xmlns=\"http://sabredav.org/ns\">hello</element>'\n ],\n [\n '<element foo=\"bar\">hello</element>',\n '<element xmlns=\"http://sabredav.org/ns\" foo=\"bar\">hello</element>'\n ],\n [\n '<element x1:foo=\"bar\" xmlns:x1=\"http://example.org/ns\">hello</element>',\n '<element xmlns:x1=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\" x1:foo=\"bar\">hello</element>'\n ],\n [\n '<element xmlns=\"http://example.org/ns\">hello</element>',\n '<element xmlns=\"http://example.org/ns\">hello</element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\">hello</x1:element>',\n ],\n [\n '<element xmlns:foo=\"http://example.org/ns\">hello</element>',\n '<element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\">hello</element>',\n '<element>hello</element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\">hello</foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\">hello</foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\">hello</x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child>hello</child></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child>hello</child></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child>hello</child></x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child/></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child/></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child/></x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child a=\"b\"/></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child a=\"b\"/></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child a=\"b\"/></x1:element>',\n ],\n ];\n\n }", "protected function getMap(): ReferenceMap\n {\n return new ReferenceMap(\n [\n new SrcNode(\n new \\SplFileInfo('folder/Example/ClassExample.php'),\n new FullClassName('Example', 'ClassExample'),\n [\n new Inheritance(0, new FullClassName('Example', 'ParentClassExample')),\n new Inheritance(0, new FullClassName('', 'FilterIterator')),\n new Dependency(0, new FullClassName('Example', 'AnotherClassExample')),\n new Dependency(0, new FullClassName('Vendor', 'ThirdPartyExample')),\n new Dependency(0, new FullClassName('', 'iterable')),\n new Composition(0, new FullClassName('Example', 'InterfaceExample')),\n new Composition(0, new FullClassName('Example', 'AnotherInterface')),\n new Composition(0, new FullClassName('', 'iterable')),\n new Mixin(0, new FullClassName('Example', 'TraitExample')),\n new Mixin(0, new FullClassName('', 'PHPDocElement'))\n ]\n )\n ],\n [\n new FullClassName('', 'iterable'),\n new FullClassName('', 'FilterIterator'),\n new FullClassName('', 'PHPDocElement'),\n ],\n [\n new ComposerPackage('main', [], [], [], [])\n ]\n );\n }", "final protected function buildDependencyMap() {\n\n\t\t$this->dependencyMap = array();\n\t\t$this->prioritiesHandlers = array();\n $p = new dummyPriorityhookHandler();\n\t\t$this->prioritiesHandlers[self::NORMAL] = $p;\n $this->priorityBased = array('min' => array(),'max' => array());\n\t\t//$this->priorityBased['min'][self::NORMAL][spl_object_hash($p)] = $p;\n\t\tforeach ($this->objects as $hash => $handler) {\n\t\t\t$this->priorityBased['min'][self::NORMAL][$hash] = $handler;\n\t\t\t$this->dependencyMap[$hash] = array('priority' => $this->prioritiesHandlers[self::NORMAL]);\n\t\t\t$this->priorityBased['max'][self::LATEST-1][$hash] = $handler;\n\t\t\t$handler->registerDependencies($this);\n\t\t}\n\t}", "function siteMap($node, $lang='en', $wide_info=false){\r\n\t\t$dir = \"sitemaps\";\r\n\t\t$lang = $this->CFG->lang;\r\n\t\t$db = $this->DB->dbName;\r\n\t\t$fname = \"sitemap_\".$db.\"_\".$node.\"_\".$lang.\".xml\";\r\n\t\tif(!($xml = $this->getCache($dir, $fname))){\r\n\t\t\t$xml = $this->cache__siteMap($node, $lang, $wide_info);\r\n\t\t\t$this->newCache($dir, $fname, $xml);\r\n\t\t\t//print \"newcache [$dir]\";\r\n\t\t} //else print \"readcache [$dir/$fname]\";\r\n\t\t//print \"<textarea>$xml</textarea>\";\r\n\t\treturn $xml;\r\n\t}", "public function init_from_xml($xml, $from = Bean::SOURCE_STRING)\n {\n if($from == Bean::SOURCE_URL || $from == Bean::SOURCE_FILE)\n {\n $xdom = @simplexml_load_file($xml);\n }\n if($from == Bean::SOURCE_STRING)\n {\n $xdom = @simplexml_load_string($xml);\n }\n\n foreach($xdom as $key => $val)\n {\n $this->set($key,$val); \n } \n }", "function createSitemap() {\n\tglobal $wpdb;\n\n\t$posts = $wpdb->get_results (\"SELECT id, post_title, post_content, post_date_gmt, post_excerpt \n\t\t\t\t\t\t\tFROM $wpdb->posts \n\t\t\t\t\t\t\tWHERE post_status = 'publish' \n\t\t\t\t\t\t\tAND post_type = 'post'\n\t\t\t\t\t\t\tAND (post_content LIKE '%youtube.com%' or post_content LIKE '%[video url=%') \n\t\t\t\t\t\t\tORDER BY post_date DESC\");\n\n\tif (empty ($posts)) {\n\t//$xml = \"Video not available\";\n\t\t$xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . \"\\n\"; \n\t\t$xml .= '<!-- Created by (http://wdtmedia.com) -->' . \"\\n\";\n\t\t$xml .= '<!-- Generated-on=\"' . date(\"F j, Y, g:i a\") .'\" -->' . \"\\n\";\t\t \n\t\t$xml .= '<?xml-stylesheet type=\"text/xsl\" href=\"' . get_bloginfo('wpurl') . '/wp-content/plugins/video_sitemap_xml/videositemap.xsl\"?>' . \"\\n\" ;\t\t\n\t $xml .= '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\">' . \"\\n\";\n\t\t$xml .= \"<dt>5</dt>\";\n\t\t$xml .= \"\\n</urlset>\";\n\n\t} else {\n\n\t\t$xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . \"\\n\"; \n\t\t$xml .= '<!-- Created by (http://wdtmedia.com) -->' . \"\\n\";\n\t\t$xml .= '<!-- Generated-on=\"' . date(\"F j, Y, g:i a\") .'\" -->' . \"\\n\";\t\t \n\t\t$xml .= '<?xml-stylesheet type=\"text/xsl\" href=\"' . get_bloginfo('wpurl') . '/wp-content/plugins/video_sitemap_xml/videositemap.xsl\"?>' . \"\\n\" ;\t\t\n\t $xml .= '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\">' . \"\\n\";\n\t\t\n\t\t$selfUrl = get_bloginfo('url');\n\t\tforeach ($posts as $post) {\n\t\t$meta_title = get_post_meta($post->id, 'mcustom-seo-title',true );\n\t\t$meta_desc = get_post_meta($post->id, 'mcustom-seo-desc',true );\n\t\t\t\t\n\t\t\t\tif((preg_match_all (\"(\\[video url=\\\"http:\\/\\/[^www.youtube.com][^youtube.com]*)\", \n\t\t\t\t$post->post_content, $matches2, PREG_SET_ORDER)))\n\t\t\t\t{\n\t\t\t\t\t$flag=1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(preg_match_all (\"(<embed|<iframe[^>]*src=['\\\"]http:\\/\\/www.youtube.com\\/v\\/([a-zA-Z0-9\\-_]*)|youtube.com\\/watch\\?v=([a-zA-Z0-9\\-_]*)|youtube.com\\/embed\\/([a-zA-Z0-9\\-_]*))\", \n\t\t\t\t$post->post_content, $matches, PREG_SET_ORDER)|| $flag==1){\n\t\t\t\t\t$matches=array_merge($matches2,$matches);\n\t\t\t\t\t$excerpt = ($post->post_excerpt != \"\") ? $post->post_excerpt : $post->post_title ; \n\t\t\t\t\t$permalink = get_permalink($post->id); \n\n\t\t\t\t\t$beg=0;\n\t\t\t\t\t$end=0; \n\t\t\t\t\t$contentLen = strlen($post->post_content);\n\t\t\t\t\tforeach ($matches as $match) {\n\t\t\t\t\t\t$id = $match [1];\n\t\t\t\t\t\tif ($id == '') $id = $match [2];\n\t\t\t\t\t\tif ($id == '') $id = $match [3];\n\t\t\t\t\t$thumb_path = '';\n\t\t\t\t\t$beg = strpos($post->post_content, 'thumb=\"', $beg);\n\t\t\t\t\tif($beg)\n\t\t\t\t\t{\n\t\t\t\t\t\t$thumb_path='';\n\t\t\t\t\t\t$end = strpos($post->post_content,'\"]',$beg+7);\n\t\t\t\t\t\tif($end <= $contentLen) {\n\t\t\t\t\t\t\t$thumb_path = substr($post->post_content,$beg+7,$end-$beg-7);\n\t\t\t\t\t\t\t$beg = $end;\n\t\t\t\t\t\t}\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\t$beg = $end;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$xml .= \"\\n <url>\\n\";\n\t\t\t\t\t$xml .= \" <loc>$permalink</loc>\\n\";\n\t\t\t\t\t$xml .= \" <video:video>\\n\";\n\t\t\t\t\t$xml .= \" <video:player_loc allow_embed=\\\"yes\\\" autoplay=\\\"autoplay=1\\\">http://www.youtube.com/v/$id</video:player_loc>\\n\";\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($thumb_path) && count(file($thumb_path))>0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$xml .= \" <video:thumbnail_loc>\".$thumb_path.\"</video:thumbnail_loc>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t/*else if(!empty($id))\n\t\t\t\t\t{\n\t\t\t\t\t\t//$xml .= \" <video:thumbnail_loc>http://i.ytimg.com/vi/$id/2.jpg</video:thumbnail_loc>\\n\";\n\t\t\t\t\t\t$xml .= \" <video:thumbnail_loc>http://i.ytimg.com/vi/$id/default.jpg</video:thumbnail_loc>\\n\";\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$xml .= \" <video:thumbnail_loc>$selfUrl/wp-content/plugins/video_sitemap_xml/noimage.gif</video:thumbnail_loc>\\n\";\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$xml .= \" <video:title>\" . $meta_title . \"</video:title>\\n\";\n\t\t\t\t\t$xml .= \" <video:description>\" . $meta_desc . \"</video:description>\\n\";\n\t\n if ($_POST['time'] == 1) { \n\t\t\t\t\t\t$duration = play_time ($id);\n\t\t\t\t\t\tif ($duration != 0)\n\t\t\t\t\t\t\t$xml .= \" <video:duration>\".play_time ($id).\"</video:duration>\\n\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$xml .= \" <video:publication_date>\".date (DATE_W3C, strtotime ($post->post_date_gmt)).\"</video:publication_date>\\n\";\n\t\n\t\t\t\t\t$posttags = get_the_tags($post->id); if ($posttags) { \n\t\t\t\t\t$tagcount=0;\n\t\t\t\t\tforeach ($posttags as $tag) {\n\t\t\t\t\t\tif ($tagcount++ > 32) break;\n\t\t\t\t\t\t$xml .= \" <video:tag>$tag->name</video:tag>\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\n\t\t\t\t\t$postcats = get_the_category($post->id); if ($postcats) { \n\t\t\t\t\tforeach ($postcats as $category) {\n\t\t\t\t\t\t$xml .= \" <video:category>$category->name</video:category>\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\n\n\t\t\t\t\t$xml .= \" </video:video>\\n </url>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$xml .= \"\\n</urlset>\";\n\t}\n\n\t$video_sitemap_url = ABSPATH.'videositemap.xml';;\n\tif (CheckFilePermission($_SERVER[\"DOCUMENT_ROOT\"]) || CheckFilePermission($video_sitemap_url)) {\n\t\tif (file_put_contents ($video_sitemap_url, $xml)) {\n\t\t\treturn true;\n\t\t}\n\t} \n\necho '<br /><div class=\"wrap\"><p>Unable to save xml file because the folder have no write permission. Create a file videositemap.xml in your wordpress root folder and paste the following text</p><br /><textarea rows=\"30\" cols=\"150\" style=\"font-family:verdana; font-size:11px;color:#666;background-color:#f9f9f9;padding:5px;margin:5px\">' . $xml . '</textarea></div>';\t\n\texit();\n}", "public function mapClasses() {\n // TODO: this is needed when the class map is not created yet (i.e. at very first install).\n if (!is_dir($this->dir['tmp'])) {\n mkdir($this->dir['tmp']);\n }\n $fop = fopen(CLASS_MAP_FILE, 'w+');\n\n foreach ($this->modules_loaded as $module) {\n $autoload_paths = array('Common', 'Qtags');\n foreach ($autoload_paths as $autoload_path) {\n $full_autoload_path = $module['path'] . '/classes/' . $autoload_path;\n /**\n * Autoload module's qtags.\n */\n if (is_dir($full_autoload_path)) {\n $classes = $this->scanDirectory($full_autoload_path);\n foreach ($classes as $class) {\n // Parse the Qtag.\n $exp1 = explode('/', $class);\n $exp2 = explode('.', $exp1[count($exp1) - 1]);\n $item_name = $exp2[0];\n $this->class_map[$autoload_path][$item_name] = $full_autoload_path . '/' . $class;\n }\n }\n }\n }\n fwrite($fop, serialize($this->class_map));\n fclose($fop);\n }", "protected function _getDomMap()\n {\n $domMap = parent::_getDomMap();\n $domMap = reset($domMap);\n\n return [\n 'initSubscriptionResponse' => array_merge([\n 'transactionId' => 'transactionId',\n 'subscriptionPageUrl' => 'subscriptionPageUrl',\n 'status' => 'status',\n ], $domMap)\n ];\n }", "function step_xml_parse_zone($xml){\n\n\t// enlever la balise doctype qui provoque une erreur \"balise non fermee\"\n\t$xml = preg_replace('#<!DOCTYPE[^>]*>#','',$xml);\n\tif (!is_array($arbre = spip_xml_parse($xml)) OR !is_array($arbre = $arbre['archives'][0])){\n\t\treturn false;\n\t}\n\n\t// boucle sur les elements pour creer un tableau array (url_zip => datas)\n\t$paquets = array();\t\t\t\n\tforeach ($arbre as $z=>$c){\n\t\t$c = $c[0];\n\t\t// si plugin et fichier zip, on ajoute le paquet dans la liste\n\t\tif ((is_array($c['plugin'])) AND ($url = $c['zip'][0]['file'][0])) {\n\t\t\t$paquets[$url] = array(\n\t\t\t\t'plugin' => step_xml_parse_plugin($c['plugin'][0]), \n\t\t\t\t'file' => $url, \n\t\t\t);\n\t\t}\n\t}\n\n\tif (!$paquets) {\n\t\treturn false;\n\t}\n\t\n\treturn $paquets;\n}", "function load_countries_from_xml() {\n\t\t$doc = new DOMDocument();\n\t\t$doc->load( plugin_dir_path( __FILE__ ) . 'xml/countrylist.xml' );\n\t\t\n\t\t$rootnode = $doc->getElementsByTagName( 'countries' )->item( 0 );\n\t\t\n\t\t$arrayofcountries = array();\n\t\t$arrayposition = 0;\n\t\tforeach ( $rootnode->getElementsByTagName( 'country' ) as $countryitem ) {\n\t\t\t\n\t\t\t$arrayattributes = array();\n\t\t\tif ( $countryitem->hasAttributes() ) {\n\t\t\t\t$xmlattributes = $countryitem->attributes;\n\t\t\t\tif ( ! is_null( $xmlattributes ) ) {\n\t\t\t\t\tforeach ( $xmlattributes as $index => $attr ) {\n\t\t\t\t\t\t$arrayattributes[$attr->name] = $attr->value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$arrayofcountries[$arrayposition][0] = $arrayattributes;\n\t\t\t\n\t\t\t$citysubnodes = array();\n\t\t\tif ( $countryitem->childNodes->length ) {\n\t\t\t\t$cityarrpos = 0;\n\t\t\t\tforeach ( $countryitem->childNodes as $city ) {\n\t\t\t\t\t\n\t\t\t\t\t//echo count( $city->attributes ) . ',';\n\t\t\t\t\t$cityarrayattributes = array();\n\t\t\t\t\tif ( $city->hasAttributes() ) {\n\t\t\t\t\t\t//echo 'has attributes';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$xmlattributes = $city->attributes;\n\t\t\t\t\t\tif ( ! is_null( $xmlattributes ) ) {\n\t\t\t\t\t\t\tforeach ( $xmlattributes as $index => $attr ) {\n\t\t\t\t\t\t\t\t//echo $attr->value;\n\t\t\t\t\t\t\t\t$cityarrayattributes[$attr->name] = $attr->value;\n\t\t\t\t\t\t\t\t//echo $cityarrayattributes[$attr->name] . 'xx';\n\t\t\t\t\t\t\t\t//echo $attr->value;\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$citysubnodes[$cityarrpos] = $cityarrayattributes;\n\t\t\t\t\t\t$cityarrpos++;\n\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$arrayofcountries[$arrayposition][1] = $citysubnodes;\n\t\t\t//echo count( $arrayofcountries[$arrayposition][1] );\n\t\t\t$arrayposition++;\n\t\t}\n\t\t\n\t\treturn $arrayofcountries;\n\t}", "public function generateMap()\n {\n try\n {\n // Select all published articles and pages.\n // Lessons and other new stuff to be added upon needed.\n $pgs = ORM::factory( 'Page' )\n ->where( 'status', '>', 0 )\n ->find_all()->as_array();\n\n $articles = ORM::factory( 'Article' )\n ->where( 'status', '>', 0 )\n ->find_all()->as_array();\n \n // Place found URLs into the container array.\n $pages = [];\n foreach ( array_merge( $pgs, $articles ) as $value )\n array_push ( $pages, $value->make_full_url () );\n \n // Select whatever is already in the map...\n $urls = [];\n foreach ( $this->map->children() as $node )\n $urls[] = ( string )$node->loc;\n\n // Delete redundant links\n foreach ( array_diff( $urls, $pages ) as $url )\n $this->removeEntry( $url, FALSE, TRUE );\n\n // Add missing links.\n foreach ( array_diff( $pages, $urls ) as $uri )\n $this->addEntry ( $uri, NULL, FALSE, TRUE );\n\n // Save result into the file.\n return $this->save();\n }\n catch ( Exception $e )\n {\n Kohana::$log->add( LOG_ERR, $e->getMessage() );\n return FALSE;\n }\n }", "private function genSitemapXML() {\n $url_same = array();\n $sitemap_xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\" xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\">\n <!-- created by CSZ CMS Sitemap Generator www.cszcms.com -->'.\"\\n\";\n $sitemap_xml.= '<url>\n\t<loc>'.base_url().'</loc>\n\t<changefreq>always</changefreq>\n </url>'.\"\\n\";\n if($this->lang !== FALSE){ /* Language */\n foreach ($this->lang as $row) {\n $url = $this->Csz_model->base_link().'/lang/'.$row['lang_iso'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n if($this->menu_other !== FALSE){ /* Navigation */\n foreach ($this->menu_other as $row) {\n $chkotherlink = strpos($row['other_link'], BASE_URL);\n if($row['pages_id'] && $row['pages_id'] != NULL && $row['pages_id'] != 0){\n $pages = $this->Csz_model->getValue('page_url', 'pages', \"active = '1' AND pages_id = '\".$row['pages_id'].\"'\", '', 1, 'page_url', 'ASC'); \n if($row['drop_page_menu_id'] != 0 && $row['drop_page_menu_id'] != NULL){\n $main = $this->Csz_model->getValue('menu_name', 'page_menu', \"active = '1' AND page_menu_id = '\".$row['drop_page_menu_id'].\"'\", '', 1, 'menu_name', 'ASC'); \n $url = $this->Csz_model->base_link().'/'.$this->Csz_model->rw_link($main->menu_name).'/'.$pages->page_url;\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }else{\n $url = $this->Csz_model->base_link().'/'.$pages->page_url;\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }else if($row['other_link'] && $row['other_link'] != NULL && $chkotherlink !== FALSE){ \n if(!in_array($row['other_link'], $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$row['other_link'].'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $row['other_link'];\n }\n }else if($row['plugin_menu'] && $row['plugin_menu'] != NULL){\n $url = $this->Csz_model->base_link().'/plugin/'.$row['plugin_menu'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n }\n if($this->pages_content !== FALSE){ /* Pages Content without navigation */\n foreach ($this->pages_content as $row) {\n $url = $this->Csz_model->base_link().'/'.$row['page_url'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n if($this->plugin !== FALSE){ /* Plugin with sitemap config */\n foreach ($this->plugin as $row) {\n $plugin_db = $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sitemap_viewtable');\n if(!empty($plugin_db)){\n $plugindata = $this->Csz_model->getValueArray('*', $plugin_db, $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sqlextra_condition'), '', 0, $plugin_db.'_id', 'DESC');\n if($plugindata !== FALSE){\n foreach ($plugindata as $rs) {\n $url = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/view/'.$rs[$plugin_db.'_id'].'/'.$rs['url_rewrite'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n if($row['plugin_config_filename'] == 'article'){\n $urlamp = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/amp/'.$rs[$plugin_db.'_id'].'/'.$rs['url_rewrite'];\n if(!in_array($urlamp, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$urlamp.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $urlamp;\n }\n }\n }\n }\n }\n $plugin_cat_db = $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sitemap_cattable');\n if(!empty($plugin_cat_db)){\n $plugindata = $this->Csz_model->getValueArray('*', $plugin_cat_db, $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sqlextra_catcondition'), '', 0, $plugin_cat_db.'_id', 'DESC');\n if($plugindata !== FALSE){\n foreach ($plugindata as $rs) {\n $url = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/category/'.$rs['url_rewrite'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n }\n } \n }\n $sitemap_xml.= '</urlset>'.\"\\n\";\n if($sitemap_xml){\n /* Gen sitemap.xml */\n $file_path = FCPATH.\"sitemap.xml\";\n $fopen = fopen($file_path, 'wb') or die(\"can't open file\");\n fwrite($fopen, $sitemap_xml);\n fclose($fopen);\n /* Gen sitemap.xml.gz */\n $gzdata = @gzencode($sitemap_xml, 9);\n if($gzdata !== FALSE){\n $fopen1 = fopen(FCPATH.\"sitemap.xml.gz\", 'wb') or die(\"can't open file\");\n fwrite($fopen1, $gzdata);\n fclose($fopen1);\n }\n\t}\n }", "private function loadModuleXml() \n\t{\n\n\t\t// load in config.xml to simplexml parser\n\t\tparent::$base_xml = simplexml_load_file(parent::$app_etc_module_path);\n\n\t}", "private function mapElements(){\n $aux = '';\n if(!empty($this->category_list)){\n foreach($this->category_list as $c) {\n $category = new Category();\n $category->loadTaggedElement($c);\n $aux[] = $category; \n }\n $this->category_list = $aux;\n }\n $aux = '';\n if(!empty($this->user_category_list)) {\n foreach($this->user_category_list as $u) {\n $user_category = new Category();\n $user_category->loadTaggedElement($u);\n $aux[] = $user_category;\n }\n $this->user_category_list = $aux;\n } \n $aux = '';\n if(!empty($this->entity_list)){\n foreach($this->entity_list as $e) {\n $entity = new Entity();\n $entity->loadTaggedElement($e);\n $aux[] = $entity;\n }\n $this->entity_list = $aux;\n }\n $aux = '';\n if(!empty($this->concept_list)){\n foreach($this->concept_list as $c) {\n $concept = new Concept();\n $concept->loadTaggedElement($c);\n $aux[] = $concept;\n }\n $this->concept_list = $aux;\n }\n $aux = '';\n if(!empty($this->time_expression_list)){\n foreach($this->time_expression_list as $t)\n $aux[] = new TimeExpression($t);\n $this->time_expression_list = $aux;\n }\n $aux = '';\n if(!empty($this->money_expression_list)){\n foreach($this->money_expression_list as $m)\n $aux[] = new MoneyExpression($m);\n $this->money_expression_list = $aux;\n }\n $aux = '';\n if(!empty($this->uri_list)){\n foreach($this->uri_list as $u)\n $aux[] = new URI($u);\n $this->uri_list = $aux;\n }\n $aux = '';\n if(!empty($this->phone_expression_list)){\n foreach($this->phone_expression_list as $p)\n $aux[] = new PhoneExpression($p);\n $this->phone_expression_list = $aux;\n } \n $aux = '';\n if(!empty($this->quotation_list)){\n foreach($this->quotation_list as $p)\n $aux[] = new Quotation($p);\n $this->quotation_list = $aux;\n } \n $aux = '';\n if(!empty($this->issue_list)) {\n foreach($this->issue_list as $i)\n $aux[] = new Issue($i);\n $this->issue_list = $aux;\n }\n }", "protected function parseXmlNode(\\DOMElement $node, $map) {\n /** @var \\DOMElement $attribute */\n $attribute = $node->firstChild;\n $result = [];\n do {\n $name = $attribute->localName;\n if (isset($map['sourceMap'][$name])) {\n foreach($map['sourceMap'][$name] as $target) {\n //pass null since we do not have implemented $row yes to pass to normalize\n $value = $this->normalize($attribute->nodeValue, $map['map'][$target]['type'], $node);\n\n if (isset($result[$target])) {\n switch ($map['map'][$target]['multiple']) {\n case 'array': if (is_array($result[$target])) {\n $result[$target][] = $value;\n } else {\n $result[$target] = [$result[$target], $value];\n }\n break;\n case 'last':\n $result[$target] = $value;\n break;\n default:\n throw new \\Exception(\"Unknown value for multiple: {$map['map'][$target]['multiple']}\");\n\n }\n } else {\n $result[$target] = $value;\n }\n }\n }\n } while(null !== $attribute = $attribute->nextSibling);\n foreach($map['map'] as $target => $def) {\n if (!isset($result[$target])) {\n $result[$target] = null;\n }\n }\n return $result;\n }", "function step_xml_parse_plugin($arbre){\n\n\tif (!is_array($arbre)) \n\t\treturn false;\n\t\n\t// on commence par les simples !\n\t$plug_arbre = step_xml_aplatit_multiple(\n\t\t\t\tarray('nom','icon','auteur','licence','version','version_base','etat','shortdesc','slogan','categorie','tags',\n\t\t\t\t'description','lien','options','fonctions','prefix','install'), \n\t\t\t\t$arbre);\n\t$plug_arbre['prefix'] = strtolower($plug_arbre['prefix']);\n\t\n\t// on continue avec les plus complexes...\t\n\t// 1) balises avec attributs\n\tforeach (array(\n\t\t\t'necessite'=>array('necessite', null),\n\t\t\t'utilise'=>array('utilise', null),\n\t\t\t'chemin'=>array('path', array('dir'=>'')))\n\t\t\t\tas $balise=>$p){\n\t\t$params = $res = array();\n\t\t// recherche de la balise et extraction des attributs\n\t\tif (spip_xml_match_nodes(\",^$balise,\",$arbre, $res)){\n\t\t\tforeach(array_keys($res) as $tag){\n\t\t\t\tlist($tag,$att) = spip_xml_decompose_tag($tag);\n\t\t\t\t$params[] = $att;\n\t\t\t}\n\t\t} \n\t\t// valeur par defaut\n\t\telse {\n\t\t\tif ($p[1]!==null)\n\t\t\t\t$params[] = $p[1];\n\t\t}\n\t\t$plug_arbre[$p[0]] = $params;\t\t\n\t}\n\n\t// 2) balises impriquees\n\t// (pipeline, boutons, onglets)\n\t// on verra plus tard si besoin !\n\n\treturn $plug_arbre;\n}", "function Sitemap() {\n $time = FormatTime('Y-m-d', time());\n $url = SYSTEM::get('url');\n $modules = SYSTEM::get('modules');\n $enabled = CONFIG::getSection('enabled');\n $sitemap = SYSTEM::get('sitemap');\n $site_map =\n \"<\\x3Fxml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"\\x3F>\".LF.\n \"<urlset xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\".LF.\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=index</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t\\t<priority>0.8</priority>\".LF.\n \"\\t</url>\".LF;\n foreach ($modules as $module => $data) {\n if (in_array($module, $sitemap) && array_key_exists($module, $enabled)) {\n $gsm = '';\n $obj = strtoupper($module);\n $sections = CMS::call($obj)->getSections();\n unset($sections['drafts']);\n\n foreach ($sections as $id => $section) {\n $categories = CMS::call($obj)->getCategories($id);\n if (!empty($categories)) {\n $gsm .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.SECTION.$id.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t</url>\".LF;\n foreach ($categories as $key => $category) {\n $category = CMS::call($obj)->getCategory($key);\n $content = CMS::call($obj)->getContent($key);\n if (!empty($content)) {\n $gsm .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.SECTION.$id.CATEGORY.$key.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t</url>\".LF;\n foreach ($content as $i => $item) {\n $gsm .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.SECTION.$id.CATEGORY.$key.ITEM.$i.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".FormatTime('Y-m-d', $item['time']).\"</lastmod>\".LF.\n \"\\t</url>\".LF;\n }\n }\n }\n }\n }\n if (!empty($gsm)) {\n $site_map .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t</url>\".LF.$gsm;\n }\n }\n }\n $site_map .= \"</urlset>\";\n if (!file_put_contents(ROOT.'sitemap.xml', $site_map, LOCK_EX)) {\n CMS::call('LOG')->logPut('Error', '', 'Cannot save file sitemap.xml');\n }\n return CMS::call('SYSTEM')->createMainMenu();\n}", "function xml_to_array()\r\n {\r\n $output=array();\r\n \r\n foreach($this->xpath_map as $key=>$value)\r\n {\r\n $output[$key]=$value['data'];\r\n }\r\n \r\n return $output;\r\n }", "private function _getXSIMap($actionParam){\n\t\t$arrayMap = array();\n\t\tforeach($actionParam->childNodes as $item){\n\t\t\tif($item->nodeType==1){\n\t\t\t\tif($item->localName=='item'){\n\t\t\t\t\t$index = null;\n\t\t\t\t\t$value = null;\n\t\t\t\t\tforeach($item->childNodes as $node){\n\t\t\t\t\t\tif($node->nodeType==1){\n\t\t\t\t\t\t\tif($node->localName=='key'){\n\t\t\t\t\t\t\t\t$index = (string) $node->nodeValue;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif($node->localName=='value'){\n\t\t\t\t\t\t\t\t\t$paramType = $node->getAttributeNS($this->_xmlSchemaNamespace, 'type');\n\t\t\t\t\t\t\t\t\tif($this->_isTypeLiteral($paramType)==true){\n\t\t\t\t\t\t\t\t\t\t$value = $this->_decodeXSDType($paramType, $node->nodeValue);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif($paramType=='ns2:Map'){\n\t\t\t\t\t\t\t\t\t\t\t$value = $this->_getXSIMap($node);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tif($paramType=='SOAP-ENC:Array'||$paramType=='enc:Array'){\n\t\t\t\t\t\t\t\t\t\t\t\t$value = $this->_getSoapArray($node);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$value = null;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($index!==null){\n\t\t\t\t\t\t$arrayMap[$index] = $value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$arrayMap[] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $arrayMap;\n\t}", "function loadPlugins() {\n\n\t\t// load and parse the plugins file ...\n\t\tif ($plugins = $this->xml_parser->parseXml('plugins.xml')) {\n\n\t\t\t// take each plugin tag ...\n\t\t\tforeach ($plugins['ASECO_PLUGINS']['PLUGIN'] as $plugin) {\n\n\t\t\t\t// showup message\n\t\t\t\t$this->console_text('[Aseco] Load plugin [' . $plugin . ']');\n\n\t\t\t\t// and include the value between ...\n\t\t\t\trequire_once('plugins/' . $plugin);\n\t\t\t}\n\t\t}\n\t}", "public function initVarfromXml() {\n if ((array) $this->xml_data) {\n foreach ($this->xml_data->xpath('//page_group') as $item) {\n foreach ($item->children() as $child) {\n $seq = 0;\n if (!empty($child['seq'])) {\n $seq = (string) $child['seq'];\n }\n if ($seq < 99) {\n\n if ($child['type'] == 'IE') {\n foreach ($child->xpath('input') as $value) {\n $tp = 0;\n if (empty($value->value)) {\n $datav = (string) $value->default;\n } else {\n $datav = (string) $value->value;\n }\n if (strtolower($value->type) == 'number')\n $tp = 1;\n if (empty($this->sccpvalues[(string) $value->name])) {\n $this->sccpvalues[(string) $value->name] = array('keyword' => (string) $value->name, 'data' => $datav, 'type' => $tp, 'seq' => $seq);\n// $this->sccpvalues[] = array('keyword' => (string)$value->name, 'data' =>(string)$value->default, 'type'=> '0');\n }\n }\n }\n if ($child['type'] == 'IS' || $child['type'] == 'IED') {\n if (empty($child->value)) {\n $datav = (string) $child->default;\n } else {\n $datav = (string) $child->value;\n }\n if (empty($this->sccpvalues[(string) $child->name])) {\n $this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq);\n// $this->sccpvalues[] = array('keyword' => (string)$child->name, 'data' =>(string)$child-> default,'type'=>'0');\n }\n }\n if ($child['type'] == 'SLD' || $child['type'] == 'SLS' || $child['type'] == 'SLT' || $child['type'] == 'SL' || $child['type'] == 'SLM' || $child['type'] == 'SLZ' || $child['type'] == 'SLZN' || $child['type'] == 'SLA') {\n if (empty($child->value)) {\n $datav = (string) $child->default;\n } else {\n $datav = (string) $child->value;\n }\n if (empty($this->sccpvalues[(string) $child->name])) {\n $this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq);\n }\n }\n }\n }\n }\n }\n }", "function initMap() {\n\n\t\t// Instantiate the xajax object and configure it\n\t\trequire_once (t3lib_extMgm::extPath('xajax') . 'class.tx_xajax.php');\n\t\t$this->xajax = t3lib_div::makeInstance('tx_xajax'); // Make the instance\n\t\tif ($GLOBALS['TSFE']->metaCharset == 'utf-8') {\n\t\t\t$this->xajax->decodeUTF8InputOn(); // Decode form vars from utf8\n\t\t}\n\t\t$this->xajax->setCharEncoding($GLOBALS['TSFE']->metaCharset); \t\t// Encode of the response to utf-8 ???\n\t\t$this->xajax->setWrapperPrefix($this->prefixId); \t\t// To prevent conflicts, prepend the extension prefix\n\t\t$this->xajax->statusMessagesOn(); \t\t// Do you wnat messages in the status bar?\n\n\t\t// register the functions of the ajax requests\n\t\t$this->xajax->registerFunction(array('infomsg', &$this, 'ajaxGetInfomsg'));\n\t\t$this->xajax->registerFunction(array('activeRecords', &$this, 'ajaxGetActiveRecords'));\n\t\t$this->xajax->registerFunction(array('processCat', &$this, 'ajaxProcessCat'));\n\t\t$this->xajax->registerFunction(array('tab', &$this, 'ajaxGetPoiTab'));\n\t\t$this->xajax->registerFunction(array('search', &$this, 'ajaxSearch'));\n\t\t$this->xajax->registerFunction(array('processCatTree', &$this, 'ajaxProcessCatTree'));\n\t\t$this->xajax->registerFunction(array('getDynamicList', &$this, 'ajaxGetDynamicList'));\n\n\t\t$this->xajax->processRequests();\n\n\t\t// additional output using a template\n\t\t$template['total'] = $this->cObj2->getSubpart($this->templateCode,'###HEADER###');\n\t\t$markerArray = $subpartArray = array();\n\t\t$markerArray['###PATH###'] = t3lib_extMgm::siteRelpath('rggooglemap');\n\n\t\tif ($this->conf['map.']['addLanguage'] == 1) {\n\t\t\tif ($this->conf['map.']['addLanguage.']['override'] != '') {\n\t\t\t\t$markerArray['###MAP_KEY###'] .= '&hl=' . $this->conf['map.']['addLanguage.']['override'];\n\t\t\t} elseif ($GLOBALS['TSFE']->lang != '') {\n\t\t\t\t$markerArray['###MAP_KEY###'] .= '&hl=' . $GLOBALS['TSFE']->lang;\n\t\t\t}\n\t\t}\n\n\t\t$markerArray['###DYNAMIC_JS###'] = $this->getJs();\n\n\t\t// load spefic files if needed for clustering\n\t\tif ($this->conf['map.']['activateCluster'] == 1) { // gxmarkers\n\t\t\t$subpartArray['###CLUSTER_2###'] = '';\n\n\t\t} elseif ($this->conf['map.']['activateCluster'] == 2) { // markerclusterer\n\t\t\t$subpartArray['###CLUSTER_1###'] = '';\n\t\t} else { // no clustering\n\t\t\t$subpartArray['###CLUSTER_1###'] = $subpartArray['###CLUSTER_2###'] = '';\n\t\t}\n\n\t\t$totalJS = $this->cObj2->substituteMarkerArrayCached($template['total'],$markerArray, $subpartArray);\n\t\t$GLOBALS['TSFE']->additionalHeaderData['rggooglemap_xajax'] = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('xajax'));\n\t\t$GLOBALS['TSFE']->additionalHeaderData['rggooglemap_js'] = $totalJS;\n\t}", "public function load_maps_file()\r\n {\r\n log_message('debug', 'Reloading '. XML_MAPS_FILE .' file from manaserv');\r\n\r\n // load the configured path and filename from config file\r\n $this->maps_file = $this->CI->config->item('manaserv-data_path') . XML_MAPS_FILE;\r\n\r\n // check if the file really exists and is readable\r\n if (!file_exists($this->maps_file))\r\n {\r\n show_error('The '. XML_MAPS_FILE .' file ' . $this->maps_file . ' configured'.\r\n ' in mana_config.php cannot be found');\r\n return;\r\n }\r\n else\r\n {\r\n // reset current maps\r\n $this->maps = array();\r\n\r\n // load and parse the xml file\r\n $maps = simplexml_load_file($this->maps_file);\r\n foreach ($maps as $map)\r\n {\r\n // loop through defined maps and build internal array\r\n $m = new Map(\r\n intval($map->attributes()->id), // id\r\n strval($map->attributes()->name) // name\r\n );\r\n\r\n // set description if available\r\n if (strlen(strval($map->attributes()->description)) > 0)\r\n {\r\n $m->setDescription(strval($map->attributes()->description));\r\n }\r\n\r\n $this->maps[$m->getId()] = $m;\r\n }\r\n\r\n $this->flush_maps();\r\n }\r\n log_message('debug', 'Reloading '. XML_MAPS_FILE .' file ... done');\r\n }", "protected function getExtractorRegistry() {}", "public static function importFromXMLString($mods_xml) {\n\n $mods_doc = new SimpleXMLElement($mods_xml);\n\n $mods_doc->registerXPathNamespace(\"xml\", \"http://www.w3.org/XML/1998/namespace\");\n $mods_doc->registerXPathNamespace(\"mods\", \"http://www.loc.gov/mods/v3\"); //http://www.loc.gov/mods/v3\n\n if( property_exists($mods_doc, 'mods')) {\n\n $mods_doc = $mods_doc->mods;\n }\n\n $mods_array = array();\n\n $template_map = array(\n\t\t\t /*\n\t\t\t LDR Collections\n\t\t\t */\n 'dc.contributors.author' => array('xpath' => \"./mods:name/mods:role/mods:roleTerm[text()='aut']/../../mods:namePart\",\n\t\t\t\t\t\t\t 'facet' => true),\n\n\t\t\t 'affiliation' => './mods:affiliation',\n\n 'dc.contributors.other' => array('xpath' => \"./mods:name/mods:role/mods:roleTerm[text()='oth']/../../mods:namePart\",\n\t\t\t\t\t\t\t 'facet' => true),\n\n\t\t\t 'dc.title' => \"./mods:titleInfo/mods:title\",\n\n\t\t\t 'dc.date.accessioned' => array('xpath' => \"./mods:originInfo/mods:dateCaptured\",\n\t\t\t\t\t\t\t 'facet' => true,\n\t\t\t\t\t\t\t 'date' => true),\n\t\t\t 'dc.date.available' => array('xpath' => \"./mods:originInfo/mods:dateIssued\",\n\t\t\t\t\t\t\t 'facet' => true,\n\t\t\t\t\t\t\t 'date' => true),\n\n\t\t\t 'dc.identifier.citation' => './mods:note[@type=\"citation/reference\"]',\n\t\t\t \n\t\t\t 'dc.identifier.uri' => './mods:identifier[@type=\"uri\"]',\n\t\t\t 'dc.identifier.doi' => './mods:identifier[@type=\"doi\"]',\n\t\t\t 'dc.identifier.issn' => './mods:identifier[@type=\"issn\"]',\n\t\t\t 'dc.identifier.isbn' => './mods:identifier[@type=\"isbn\"]',\n\n\t\t\t 'dc.publisher' => './mods:publisher',\n\n\t\t\t 'dc.type' => './mods:genre',\n\n\t\t\t 'dc.description.abstract' => './mods:abstract',\n\n\t\t\t 'dc.subject' => './mods:subject/mods:topic',\n\n\t\t\t 'dc.subject' => './mods:subject/mods:topic',\n\n\t\t\t 'dc.relation.ispartofseries' => './mods:relatedItem/mods:title',\n\n\t\t\t 'dc.description' => './mods:note[@type=\"contents\"]',\n );\n\n foreach($template_map as $facet => $value) {\n\n $is_facet = false;\n $is_date = false;\n\n if(is_array($value)) {\n\n\t$xpath = $value['xpath'];\n\t$is_facet = $value['facet'];\n\n\tif(array_key_exists('date', $value)) {\n\n\t $is_date = $value['date'];\n\t}\n } else {\n\n\t$xpath = $value;\n }\n\n $map = function($element) {\n\n $lang = 'en-US';\n\n // Need to scrape\n // Refactor\n $m = preg_match('/xml\\:lang\\=\"(.+)\"/', $element->asXML(), $matches);\n\n if($m) {\n\n $lang = $matches[1];\n }\n\n return array('label' => $element->getName(),\n 'language' => $lang,\n 'value' => (string) $element,\n\t\t 'class' => drupal_strtolower(preg_replace('/[^A-Za-z0-9]/', '-', $element->getName())));\n };\n\n $mods_elements = array_map($map, $mods_doc->xpath($xpath));\n\n // Refactor\n foreach($mods_elements as $i => &$element) {\n\n\tif($is_facet) {\n\t \n\t $element['facet'] = $facet;\n\t}\n\n\tif($is_date) {\n\t \n\t $element['date_value'] = date('F, Y', strtotime($element['value']));\n\t}\n\n\t// Specific to migrated collections\n\t$element['label'] = $facet;\n }\n\n $mods_array = array_merge($mods_array, $mods_elements);\n }\n\n return $mods_array;\n }", "protected static function _parseElementClassMap()\n\t{\n\t\treturn array(\n\t\t\t'ipsQuote'\t\t\t=> '_parseElementForEmailQuote',\n\t\t\t'ipsCode'\t\t\t=> '_parseElementForEmailCode',\n\t\t\t'ipsStyle_spoiler'\t=> '_parseElementForEmailSpoiler',\n\t\t\t'ipsSpoiler'\t\t=> '_parseElementForEmailSpoiler',\n\t\t\t'ipsEmbeddedVideo'\t=> '_parseElementForEmailEmbed',\n\t\t\t'ipsImage'\t\t\t=> '_parseElementForEmailImage',\n\t\t);\n\t}", "public function buildTaskMap(){\n\t\t$loadWebPageTask = DataClassLoader::createInstance('Modules.Website.Tasks.LoadStaticPage');\n\t\t$this->tasks['LoadWebsitePage'] = $loadWebPageTask;\n\t\t\n\t\t$this->taskMap['Inputs'][] = array('Enabled'=>'LoadWebsitePage.Enabled');\n\t\t$this->taskMap['Inputs'][] = array('Domain'=>'LoadWebsitePage.Domain');\n\t\t$this->taskMap['Inputs'][] = array('PagePath'=>'LoadWebsitePage.PagePath');\n\t\t\n\t\t//$showPageTask = DataClassLoader::createInstance('Modules.Website.Tasks.ShowPage');\n\t\t//$this->tasks['ShowWebPage'] = $showPageTask;\n\t\t\n\t\t\n\t\t//build the output HTML Task\n\t\t$outputHTMLTask = DataClassLoader::createInstance('Modules.Website.Tasks.SendHTMLResponse');\n\t\t$this->tasks['OutputHTML'] = $outputHTMLTask;\n\t\t\n\t\t$this->taskMap['LoadWebsitePage'][] = array('PageLoaded'=>'OutputHTML.Enabled');\n\t\t$this->taskMap['LoadWebsitePage'][] = array('WebsitePage.PageHTML'=>'OutputHTML.HTMLString');\n\t\t\n\t}", "public function build_root_map() {\n\t\t$links = [];\n\t\tforeach ( $this->providers as $provider ) {\n\t\t\t$links = array_merge( $links, $provider->get_index_links( $this->max_entries ) );\n\t\t}\n\n\t\tif ( empty( $links ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $this->get_index( $links );\n\t}", "function venture_geo_process_map_xml($id, $params) { \n $output = '';\n if ($params) {\n $output = \" <state id=\\\"$id\\\">\\n\";\n foreach ($params as $name => $value) {\n if($value) \n $output .= \" <$name>$value</$name>\\n\";\n }\n $output .= \" </state>\\n\";\n }\n return $output;\n}", "public function generateMap()\n {\n $map = array();\n $database = $this->binding->getDatabase()->getData();\n\n foreach ($database->classes as $class) {\n $map[$class->name] = $class->clusters;\n }\n\n $this->map = $map;\n $this->cache->save($this->getCacheKey(), $map);\n }", "public function toXML()\r\n\t{\r\n\t\t// pass any configuration options defined as type=pass to the xml\r\n\t\t\r\n\t\t$source = explode('/', $this->config_file);\r\n\t\t$source = array_pop($source);\r\n\r\n\t\t$objConfigXml = new \\DOMDocument( );\r\n\t\t$objConfigXml->loadXML( \"<config source=\\\"$source\\\" />\" );\r\n\t\t\t\r\n\t\tforeach ( $this->getPass() as $key => $value )\r\n\t\t{\r\n\t\t\tif ($value instanceof \\SimpleXMLElement) \r\n\t\t\t{\r\n\t\t\t\t// just spit it back out again as XML\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$objElement = $objConfigXml->createElement($key);\r\n\t\t\t\t$objConfigXml->documentElement->appendChild( $objElement );\r\n\t\t\t\t\r\n\t\t\t\tforeach ($value->children() as $child) \r\n\t\t\t\t{\r\n\t\t\t\t\t// need to convert to DOMDocument.\r\n\t\t\t\t\t$domValue = dom_import_simplexml($child);\r\n\t\t\t\t\t$domValue = $objConfigXml->importNode($domValue, true);\r\n\t\t\t\t\t$objElement->appendChild($domValue);\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// simple string value\r\n\t\t\t\t\r\n\t\t\t\t$objElement = $objConfigXml->createElement( $key, Parser::escapeXml($value) );\r\n\t\t\t\t$objConfigXml->documentElement->appendChild( $objElement );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $objConfigXml;\r\n\t}", "abstract protected function get_prerequisite_plugins();", "function wp_get_sitemap_providers()\n {\n }", "public function prepare_getVillaMap($params)\n\t{\n\t\t$xml_string = \"strVillaURL=\".$params['strVillaURL'].\"\";\n\t\treturn $xml_string;\n\t}", "public function buildClassAliasMapFile() {}", "public function __construct(XMLDocument $x = null) {\n \n // initialize the string map\n $this->dbc = new StringMap();\n \n // set the values\n $this->dbc->set(\"name\",\n $x->xpath(\"normalize-space(string(//database/@name))\")); \n $this->dbc->set(\"type\",\n $x->xpath(\"normalize-space(string(//database/type))\")); \n $this->dbc->set(\"driver\",\n $x->xpath(\"normalize-space(string(//database/driver))\")); \n $this->dbc->set(\"host\",\n $x->xpath(\"normalize-space(string(//database/host))\")); \n $this->dbc->set(\"port\",\n $x->xpath(\"normalize-space(string(//database/port))\")); \n $this->dbc->set(\"user\",\n $x->xpath(\"normalize-space(string(//database/user))\")); \n $this->dbc->set(\"pass\",\n $x->xpath(\"normalize-space(string(//database/pass))\")); \n $this->dbc->set(\"db\",\n $x->xpath(\"normalize-space(string(//database/db))\")); \n $this->dbc->set(\"ssl\",\n $x->xpath(\"normalize-space(string(//database/ssl))\")); \n $this->dbc->set(\"persistent\",\n $x->xpath(\"normalize-space(string(//database/persistent))\"));\n $this->dbc->set(\"charset\",\n $x->xpath(\"normalize-space(string(//database/charset))\")); \n $this->dbc->set(\"timeout\",\n $x->xpath(\"normalize-space(string(//database/timeout))\")); \n\n }", "function loadCountriesFromXML() {\n\tglobal $countries;\n\treturn $countries->load_countries_from_xml();\n}", "function xmllist() {\n\t\tglobal $mysql;\n\t\t$result[$this->class_name()] = $mysql->select(\"SELECT * FROM \".$this->class_name, true);\n\t\t$output = XML::get($result);\n\t\treturn xml($output);\n\t}", "abstract protected function buildData(DOMDocument $xml);", "function __construct()\n {\n $xml = new XmlParser;\n $xml->Parse(PARLANCE_PATH . \"/config/app-pages.xml\");\n $pages = $xml->GetNodeByPath(\"APP/PAGES\");\n\n $this->registry = array();\n if(isset($pages) && !empty($pages['child'])) :\n foreach($pages['child'] as $page) :\n $this->registry[($page['attrs']['ID'])] = $page;\n endforeach;\n endif;\n }", "public static function _register()\n {\n self::assignElements([\n 'CategoryMapping' => ['type' => 'CategoryMappingType', 'xmlns' => self::XMLNS, 'cardinality' => '0..*'],\n 'CategoryVersion' => []\n ], parent::NAME);\n\n self::assignAttributes([]);\n }", "function getElements($xml){\n\tglobal $index;\n\t$elements = $xml->xpath('/mods');\n\t\n\twhile (list( ,$node) = each($elements)){\n\t\t$type = getMonoType($node);\n\t\tif ($type == \"\" || $type == \"Periodical\") continue;\n $index++;\n\t \n\t\t$el = new Element();\n\t\t$el->group = \"BIBLIFO\";\n\t\t$el->subGroup = $type;\n\t\t$el->eventType = \"Bibliography\";\n \n $title = htmlentities(getTitle($node, $type));\n\t\t$showtitle = neatTrim($title, 40).\" [$index]\";\n $el->label = $showtitle;\n $el->longLabel = $title;\n\n\t\t$start = getStart($node, $type);\n\t\t$el->startDate = $start;\n\t\t\n\t\t$dateType = getDateGrain($start, $start);\n\t\t$el->dateType = $dateType;\n\t\t\n\t\t$point = getPoint($node, $type);\n\t\t$location = htmlentities($point);\n\t\t$locgrain = \"N/A\";\n\t\t$pointtype = \"N/A\";\n\t\t\n\t\tif (trim($point) != \"\") {\n $geoxml = getGeoXML($point, \"CA\");\n\n\t\t\tif ($geoxml->totalResultsCount > 0) $geoxml = getGeoXML($point);\n \n $ctry = getCountry($geoxml);\n if ($ctry != \"\") $location .= \", \".$ctry;\n\n $el->location = $location;\n\t\t\t$lat = getLat($geoxml);\n $lon = getLon($geoxml);\n \n\t\t\tif ($lon != \"\" && $lat != \"\") $el->latLng = \"$lat,$lon\";\n \n $pointtype = \"Point\";\n $locgrain = getLocationGrain($geoxml);\n }\n \n $el->locationType = $locgrain;\n $el->pointType = $pointtype;\n \n $author = htmlentities(getAuthor($node, $type));\n $publisher = htmlentities(getPublisher($node, $type));\n \n if ($author != \"\") $author .= \".\";\n if ($publisher != \"\") $publisher .= \".\";\n if ($location != \"\") {\n if ($start != \"\") $location .= \":\";\n else $location .= \".\";\n }\n $el->description = \"$author <i>$title</i>. $publisher $location $start\";\n printElement($el);\n\t}\n}", "private function prepareResultMap() {\n $resultMap = [];\n foreach ($this->encodings as $encoding) {\n $map = \"_\" . $encoding . \"Map\";\n foreach ($this->$map as $ru => $fo) {\n $resultMap[$ru][] = $fo;\n }\n }\n $this->_resultMap = $resultMap;\n }", "public static function addSiteMapElement($xml, $siteMapelementsArr){\n \n foreach ($siteMapelementsArr as $oneElement){\n //start at url node\n $url = $xml->addChild('url');\n \n //use loop to add all elements to url node\n foreach ($oneElement as $key=>$value) {\n if ($key == 'lastmod') {\n $value = date('Y-m-d', strtotime($value));\n }//force format date.\n \n $loc = $url->addChild($key, $value);\n }\n \n }\n \n }", "function shortcode_map() {\r\n\t\t\tif ( !function_exists( 'vc_map' ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t$base = array(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'type' => 'mpc_preset',\r\n\t\t\t\t\t'heading' => __( 'Main Preset', 'mpc' ),\r\n\t\t\t\t\t'param_name' => 'preset',\r\n\t\t\t\t\t'tooltip' => MPC_Helper::style_presets_desc(),\r\n\t\t\t\t\t'value' => '',\r\n\t\t\t\t\t'shortcode' => $this->shortcode,\r\n\t\t\t\t\t'description' => __( 'Choose preset or create new one.', 'mpc' ),\r\n\t\t\t\t),\r\n\t\t\t);\r\n\r\n\t\t\t/* Properties List */\r\n\t\t\t$properties = array(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'type' => 'mpc_divider',\r\n\t\t\t\t\t'title' => __( 'List of Properties', 'mpc' ),\r\n\t\t\t\t\t'param_name' => 'properties_divider',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'type' => 'mpc_split',\r\n\t\t\t\t\t'heading' => __( 'Properties', 'mpc' ),\r\n\t\t\t\t\t'param_name' => 'properties',\r\n\t\t\t\t\t'admin_label' => true,\r\n\t\t\t\t\t'tooltip' => __( 'Define properties values. Each new line will be a separate property.', 'mpc' ),\r\n\t\t\t\t\t'value' => '',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'type' => 'dropdown',\r\n\t\t\t\t\t'heading' => __( 'Transform', 'mpc' ),\r\n\t\t\t\t\t'param_name' => 'properties_font_transform',\r\n\t\t\t\t\t'tooltip' => __( 'Select properties transform style.', 'mpc' ),\r\n\t\t\t\t\t'value' => array(\r\n\t\t\t\t\t\t'' => '',\r\n\t\t\t\t\t\t__( 'Capitalize', 'mpc' ) => 'capitalize',\r\n\t\t\t\t\t\t__( 'Small Caps', 'mpc' ) => 'small-caps',\r\n\t\t\t\t\t\t__( 'Uppercase', 'mpc' ) => 'uppercase',\r\n\t\t\t\t\t\t__( 'Lowercase', 'mpc' ) => 'lowercase',\r\n\t\t\t\t\t\t__( 'None', 'mpc' ) => 'none',\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'std' => '',\r\n\t\t\t\t\t'edit_field_class' => 'vc_col-sm-6 vc_column mpc-advanced-field',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'type' => 'dropdown',\r\n\t\t\t\t\t'heading' => __( 'Alignment', 'mpc' ),\r\n\t\t\t\t\t'param_name' => 'properties_font_align',\r\n\t\t\t\t\t'tooltip' => __( 'Select properties alignment.', 'mpc' ),\r\n\t\t\t\t\t'value' => array(\r\n\t\t\t\t\t\t'' => '',\r\n\t\t\t\t\t\t__( 'Left', 'mpc' ) => 'left',\r\n\t\t\t\t\t\t__( 'Right', 'mpc' ) => 'right',\r\n\t\t\t\t\t\t__( 'Center', 'mpc' ) => 'center',\r\n\t\t\t\t\t\t__( 'Justify', 'mpc' ) => 'justify',\r\n\t\t\t\t\t\t__( 'Default', 'mpc' ) => 'inherit',\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'std' => '',\r\n\t\t\t\t\t'edit_field_class' => 'vc_col-sm-6 vc_column mpc-advanced-field',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'type' => 'colorpicker',\r\n\t\t\t\t\t'heading' => __( 'Color', 'mpc' ),\r\n\t\t\t\t\t'param_name' => 'properties_font_color',\r\n\t\t\t\t\t'tooltip' => __( 'Define properties color.', 'mpc' ),\r\n\t\t\t\t\t'value' => '',\r\n\t\t\t\t\t'edit_field_class' => 'vc_col-sm-4 vc_column',\r\n\t\t\t\t),\r\n\t\t\t);\r\n\r\n\t\t\t$properties_even_background = MPC_Snippets::vc_background( array( 'prefix' => 'prop_even', 'subtitle' => __( 'Even Properties', 'mpc' ) ) );\r\n\r\n\t\t\t$class = MPC_Snippets::vc_class();\r\n\r\n\t\t\t$params = array_merge(\r\n\t\t\t\t$base,\r\n\r\n\t\t\t\t$properties,\r\n\t\t\t\t$properties_even_background,\r\n\t\t\t\t$class\r\n\t\t\t);\r\n\r\n\t\t\treturn array(\r\n\t\t\t\t'name' => __( 'Pricing Legend', 'mpc' ),\r\n\t\t\t\t'description' => __( 'Pricing table legend', 'mpc' ),\r\n\t\t\t\t'base' => 'mpc_pricing_legend',\r\n\t\t\t\t'as_child' => array( 'only' => 'mpc_pricing_box' ),\r\n\t\t\t\t'content_element' => true,\r\n//\t\t\t\t'icon' => mpc_get_plugin_path( __FILE__ ) . '/assets/images/icons/mpc-pricing-box.png',\r\n\t\t\t\t'icon' => 'mpc-shicon-pricing-legend',\r\n\t\t\t\t'category' => __( 'MPC', 'mpc' ),\r\n\t\t\t\t'params' => $params,\r\n\t\t\t);\r\n\t\t}", "function kemisitemap() {\n\n\t\treturn KemiSitemap::instance();\n\t}", "protected function parseXmlFile() {}", "function buildMainMap()\r\n{\r\n\r\n // Add an image first for debug and change asap\r\n //$final_map = \"\r\n//<img class=\\\"main_map\\\" src=\\\"images/heatmapapi.png\\\" />\" ;\r\n\r\n $final_map = \"\r\n<div id=\\\"map\\\"></div>\" ;\r\n\r\n return $final_map ;\r\n}", "public static function xmlDataProvider()\n {\n return [\n [[__DIR__ . '/_files/data.xml', \\Magento\\Framework\\Simplexml\\Element::class]]\n ];\n }", "public function sitemap_feed() {\n $output = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $output .= '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\">';\n\n // Products\n $this->load->model('tool/image');\n\n $products = $this->{$this->callModel}->getProducts();\n\n foreach ($products as $product) {\n if ($product['image'] && file_exists(DIR_IMAGE . $product['image'])) {\n $product_name = $this->escape($product['name']);\n $date = (strtotime($product['date_modified']) == -62169984000) || (strtotime($product['date_modified']) == -62169962400) ? date('Y-m-d\\TH:i:sP', strtotime(0)) : date('Y-m-d\\TH:i:sP', strtotime($product['date_modified']));\n \n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link('product/product', 'product_id=' . $product['product_id'])) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= '  <lastmod>' . $date . '</lastmod>';\n $output .= ' <priority>1.0</priority>';\n $output .= ' <image:image>';\n $output .= ' <image:loc>' . $this->model_tool_image->resize($product['image'], 300, 200) . '</image:loc>';\n $output .= ' <image:caption>' . $product_name . '</image:caption>';\n $output .= ' <image:title>' . $product_name . '</image:title>';\n $output .= ' </image:image>';\n $output .= '</url>';\n }\n }\n\n // Categories\n $this->load->model('catalog/category');\n\n $output .= $this->getCategories(0);\n\n // Manufacturer\n $this->load->model('catalog/manufacturer');\n\n $manufacturers = $this->model_catalog_manufacturer->getManufacturers();\n\n foreach ($manufacturers as $manufacturer) {\n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link('product/manufacturer/info', 'manufacturer_id=' . $manufacturer['manufacturer_id'])) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= ' <priority>0.7</priority>';\n $output .= '</url>';\n\n if ($this->{$this->callModel}->getSetting('feed_manufacturer_product')) {\n $products = $this->{$this->callModel}->getProducts(array('filter_manufacturer_id' => $manufacturer['manufacturer_id']));\n\n foreach ($products as $product) {\n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link('product/product', 'manufacturer_id=' . $manufacturer['manufacturer_id'] . '&product_id=' . $product['product_id'])) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= ' <priority>1.0</priority>';\n $output .= '</url>';\n }\n }\n }\n\n // Information\n $this->load->model('catalog/information');\n\n $informations = $this->model_catalog_information->getInformations();\n\n foreach ($informations as $information) {\n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link('information/information', 'information_id=' . $information['information_id'])) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= ' <priority>0.5</priority>';\n $output .= '</url>';\n }\n\n // SEO Backpack - custom URL\n $this->load->model('extension/module/isenselabs_seo');\n $urls = $this->model_extension_module_isenselabs_seo->getCustomUrls();\n\n foreach ($urls as $url) {\n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link($url)) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= ' <priority>0.5</priority>';\n $output .= '</url>';\n }\n\n // ===\n\n $output .= '</urlset>';\n\n $this->response->addHeader('Content-Type: application/xml');\n $this->response->setOutput($output);\n }", "function getPlugins();", "protected function generate()\n {\n // first of all we will get the version, so we will later know about changes made DURING indexing\n $this->version = $this->findVersion();\n\n // get the iterator over our project files and create a regex iterator to filter what we got\n $recursiveIterator = $this->getProjectIterator();\n $regexIterator = new \\RegexIterator($recursiveIterator, '/^.+\\.php$/i', \\RecursiveRegexIterator::GET_MATCH);\n\n // get the list of enforced files\n $enforcedFiles= $this->getEnforcedFiles();\n\n // if we got namespaces which are omitted from enforcement we have to mark them as such\n $omittedNamespaces = array();\n if ($this->config->hasValue('enforcement/omit')) {\n $omittedNamespaces = $this->config->getValue('enforcement/omit');\n }\n\n // iterator over our project files and add array based structure representations\n foreach ($regexIterator as $file) {\n // get the identifiers if any.\n $identifier = $this->findIdentifier($file[0]);\n\n // if we got an identifier we can build up a new map entry\n if ($identifier !== false) {\n // We need to get our array of needles\n $needles = array(\n Invariant::ANNOTATION,\n Ensures::ANNOTATION,\n Requires::ANNOTATION,\n After::ANNOTATION,\n AfterReturning::ANNOTATION,\n AfterThrowing::ANNOTATION,\n Around::ANNOTATION,\n Before::ANNOTATION,\n Introduce::ANNOTATION,\n Pointcut::ANNOTATION\n );\n\n // If we have to enforce things like @param or @returns, we have to be more sensitive\n if ($this->config->getValue('enforcement/enforce-default-type-safety') === true) {\n $needles[] = '@var';\n $needles[] = '@param';\n $needles[] = '@return';\n }\n\n // check if the file has contracts and if it should be enforced\n $hasAnnotations = $this->findAnnotations($file[0], $needles);\n\n // create the entry\n $this->map[$identifier[1]] = array(\n 'cTime' => filectime($file[0]),\n 'identifier' => $identifier[1],\n 'path' => $file[0],\n 'type' => $identifier[0],\n 'hasAnnotations' => $hasAnnotations,\n 'enforced' => $this->isFileEnforced(\n $file[0],\n $identifier[1],\n $hasAnnotations,\n $enforcedFiles,\n $omittedNamespaces\n )\n );\n }\n }\n\n // save for later reuse.\n $this->save();\n }", "function simplerdf_ctools_plugin_mappers() {\n return array(\n 'cache' => TRUE,\n 'cache table' => 'cache_simplerdf',\n 'use hooks' => TRUE,\n 'process' => 'simplerdf_mappers_process',\n );\n}", "function make_kml_head()\n{\n\t$output = \n'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<kml xmlns=\"http://earth.google.com/kml/2.2\">\n<Document>\n\t<name>Picture the past data</name>\n\t<Style id=\"photo_placemark_style_highlight\">\n\t\t<IconStyle>\n\t\t\t<scale>1.4</scale>\n\t\t\t<Icon>\n\t\t\t\t<href>' . SITE_ROOT . '/images/camera.png</href>\n\t\t\t</Icon>\n\t\t\t<hotSpot x=\"0.5\" y=\"0.5\" xunits=\"fraction\" yunits=\"fraction\"/>\n\t\t</IconStyle>\n\t\t<LabelStyle>\n\t\t\t<color>ff00aaff</color>\n\t\t</LabelStyle>\n\t</Style>\n\t<Style id=\"photo_placemark_style_normal\">\n\t\t<IconStyle>\n\t\t\t<scale>1.2</scale>\n\t\t\t<Icon>\n\t\t\t\t<href>' . SITE_ROOT . '/images/camera.png</href>\n\t\t\t</Icon>\n\t\t\t<hotSpot x=\"0.5\" y=\"0.5\" xunits=\"fraction\" yunits=\"fraction\"/>\n\t\t</IconStyle>\n\t\t<LabelStyle>\n\t\t\t<color>ff00aaff</color>\n\t\t</LabelStyle>\n\t</Style>\n\t<StyleMap id=\"photo_placemark_style\">\n\t\t<Pair>\n\t\t\t<key>normal</key>\n\t\t\t<styleUrl>#photo_placemark_style_normal</styleUrl>\n\t\t</Pair>\n\t\t<Pair>\n\t\t\t<key>highlight</key>\n\t\t\t<styleUrl>#photo_placemark_style_highlight</styleUrl>\n\t\t</Pair>\n\t</StyleMap>\n\t<Folder>\n\t\t<name>Picture the Past Photo Collection</name>\n\t\t<open>1</open>\n\t\t<LookAt>\n\t\t\t<longitude>-1.15050</longitude>\n\t\t\t<latitude>52.95333</latitude>\n\t\t\t<altitude>0</altitude>\n\t\t\t<range>873</range>\n\t\t\t<tilt>0.0</tilt>\n\t\t\t<heading>-16</heading>\n\t\t</LookAt>\n\t\t<Style>\n\t\t\t<ListStyle>\n\t\t\t\t<listItemType>check</listItemType>\n\t\t\t\t<bgColor>00ffffff</bgColor>\n\t\t\t</ListStyle>\n\t\t</Style>\n\t\t<Folder>\n\t\t\t<name>Photos</name>\n';\n\treturn $output; \n}", "public static function parseInstalledPlugins() {\r\n\t\t$obj = new QPluginConfigParser(QPluginInstaller::getMasterConfigFilePath());\t\t\r\n\t\treturn $obj->parseConfig();\r\n\t}", "public static function map() {\n return array(\n 'name' => esc_html__( 'Header Slider', 'webzp_r_hs' ),\n 'description' => esc_html__( 'Outputs header slider.', 'webzp_r_hs' ),\n 'category' => esc_html__( 'Content', 'webzp_r_hs' ),\n 'base' => 'webzp_r_header_slider',\n 'params' => array(\n array(\n 'type' => 'textfield',\n 'heading' => esc_html__( 'First slide title', 'webzp_r_hs' ),\n 'param_name' => 'first_title',\n 'value' => '',\n ),\n\n array(\n 'type' => 'textfield',\n 'heading' => esc_html__( 'Second slide title', 'webzp_r_hs' ),\n 'param_name' => 'second_title',\n 'value' => '',\n ),\n\n array(\n 'type' => 'textfield',\n 'heading' => esc_html__( 'First slide description', 'webzp_r_hs' ),\n 'param_name' => 'first_slide_desc',\n 'value' => '',\n ),\n\n array(\n 'type' => 'textfield',\n 'heading' => esc_html__( 'Second slide description', 'webzp_r_hs' ),\n 'param_name' => 'second_slide_desc',\n 'value' => '',\n ),\n\n array(\n 'type' => 'textarea',\n 'heading' => esc_html__( 'Slider bottom description', 'webzp_r_hs' ),\n 'param_name' => 'slider_desc',\n 'value' => '',\n ),\n\n array(\n 'type' => 'attach_image',\n 'heading' => esc_html__( 'First slide background', 'webzp_r_hs' ),\n 'param_name' => 'first_slide_bg',\n 'value' => '',\n ),\n\n array(\n 'type' => 'attach_image',\n 'heading' => esc_html__( 'Second slide background', 'webzp_r_hs' ),\n 'param_name' => 'second_slide_bg',\n 'value' => '',\n ),\n\n array(\n 'type' => 'attach_image',\n 'heading' => esc_html__( 'First slide icon', 'webzp_r_hs' ),\n 'param_name' => 'first_slide_icon',\n 'value' => '',\n ),\n\n array(\n 'type' => 'attach_image',\n 'heading' => esc_html__( 'Second slide icon', 'webzp_r_hs' ),\n 'param_name' => 'second_slide_icon',\n 'value' => '',\n ),\n\n array(\n 'type' => 'vc_link',\n 'heading' => esc_html__( 'First slide link', 'webzp_r_hs' ),\n 'param_name' => 'first_slide_link',\n 'value' => '',\n ),\n\n array(\n 'type' => 'vc_link',\n 'heading' => esc_html__( 'Second slide link', 'webzp_r_hs' ),\n 'param_name' => 'second_slide_link',\n 'value' => '',\n ),\n ),\n );\n }", "protected function getMap()\n\t{\n\t\treturn array(\n\t\t\t'USE' => new Field\\Checkbox('USE', array(\n\t\t\t\t'title' => Loc::getMessage('LANDING_HOOK_HEADBLOCK_USE')\n\t\t\t)),\n\t\t\t'CODE' => new Field\\Textarea('CODE', array(\n\t\t\t\t'title' => Loc::getMessage('LANDING_HOOK_HEADBLOCK_CODE'),\n\t\t\t\t'help' => Loc::getMessage('LANDING_HOOK_HEADBLOCK_CODE_HELP2'),\n\t\t\t\t'placeholder' => '<script>\n\tvar googletag = googletag || {};\n\tgoogletag.cmd = googletag.cmd || [];\n</script>'\n\t\t\t))\n\t\t);\n\t}", "function load($plugin) {\r\n $descriptorFileName=\"../plugin/$plugin/pluginDescriptor.xml\";\r\n if (! is_file($descriptorFileName)) {\r\n \terrorLog(\"cannot find file $descriptorFileName for plugin $plugin\");\r\n \techo \"cannot find descriptor for plugin $plugin\";\r\n \texit;\r\n }\r\n $descriptorXml=file_get_contents($descriptorFileName);\r\n $parse = xml_parser_create();\r\n xml_parse_into_struct($parse, $descriptorXml, $value, $index);\r\n xml_parser_free($parse);\r\n \r\n foreach($value as $prop) {\r\n \tif ($prop['tag']=='PROPERTY') {\r\n \t\t//print_r($prop);\r\n \t\t$name=$prop['attributes']['NAME'];\r\n \t\t$value=$prop['attributes']['VALUE'];\r\n \t\t$$name=$value;\r\n \t}\r\n }\r\n \r\n if (isset($sql)) {\r\n \t$sqlfile=\"../plugin/$plugin/$sql\";\r\n \tif (! is_file($sqlfile)) {\r\n \t\terrorLog(\"cannot find file $sqlfile for plugin $plugin\");\r\n \t\techo \"cannot find Sql file for plugin $plugin\";\r\n \t\texit;\r\n \t}\r\n \t//$enforceUTF8=true;\r\n \t//Sql::query(\"SET NAMES utf8\");\r\n \trunScript(null,$sqlfile);\r\n }\r\n // TODO : delete zip file (in the end when all is OK\r\n}", "public function sitemap_xml()\n {\n // Get All Pages.\n $this->data['pages'] = $this->pages->get_all(FALSE, 0, 'ASC', FALSE);\n // Get All Sermons.\n $this->data['sermons'] = $this->sermons->get_sermons(FALSE, FALSE, FALSE, 0, \"DESC\", FALSE);\n // Get All Posts\n $this->data['posts'] = $this->posts->get_all(FALSE, 0, 'ASC', FALSE);\n // Get All Post Categories\n $this->data['post_categories'] = $this->categories->get_all();\n\n // Set page content to xml.\n header(\"Content-Type: text/xml;charset=iso-8859-1\");\n $this->load->view(\"sitemap/sitemap\", $this->data);\n }", "public function vcMap() {\n\n\t\tvc_map(array(\n\t\t\t'name' => 'Mikado Image Slider',\n\t\t\t'base' => $this->getBase(),\n\t\t\t'category' => 'by MIKADO',\n\t\t\t'icon' => 'icon-wpb-image-slider extended-custom-icon',\n\t\t\t'allowed_container_element' => 'vc_row',\n\t\t\t'params' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'type'\t\t\t=> 'attach_images',\n\t\t\t\t\t'heading'\t\t=> 'Images',\n\t\t\t\t\t'param_name'\t=> 'images',\n\t\t\t\t\t'description'\t=> 'Select images from media library'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'dropdown',\n\t\t\t\t\t'heading' => 'Slider Type',\n\t\t\t\t\t'admin_label' => true,\n\t\t\t\t\t'param_name' => 'type',\n\t\t\t\t\t'value' => array(\n\t\t\t\t\t\t'Thumbnail Navigation'\t\t=> 'thumbs',\n\t\t\t\t\t\t'Arrow Navigation'\t=> 'arrows'\n\t\t\t\t\t),\n\t\t\t\t\t'description' => 'Set slider type',\n\t\t\t\t\t'save_always' => true\n\t\t\t\t)\n\t\t\t)\n\t\t));\n\n\t}", "private function getTopicMap () {\n\t\t$config = Zend_Registry::getInstance()->config;\n\t\t$entries = $config->catalog->topic_map;\n\t\t$topicMap = array();\n\t\tif ($entries && count($entries)) {\n\t\t\tforeach ($entries as $key => $entry) {\n\t\t\t\tif (!isset($entry->id) || !$entry->id)\n\t\t\t\t\tthrow new Exception('Each topic_map entry must have an id, \"'.$key.'\" does not.');\n\t\t\t\tif (!isset($entry->url) || !$entry->url)\n\t\t\t\t\tthrow new Exception('Each topic_map entry must have an url, \"'.$key.'\" does not.');\n\t\t\t\t$topicMap[$entry->id] = $entry->url;\n\t\t\t}\n\t\t}\n\t\treturn $topicMap;\n\t}", "public static function _register()\n {\n self::assignElements([\n 'ListingDurations' => ['type' => 'ListingDurationDefinitionsType', 'xmlns' => self::XMLNS],\n 'ShippingTermsRequired' => ['type' => 'ShippingTermRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferEnabled' => ['type' => 'BestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'DutchBINEnabled' => ['type' => 'DutchBINEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'UserConsentRequired' => ['type' => 'UserConsentRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'HomePageFeaturedEnabled' => ['type' => 'HomePageFeaturedEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ProPackEnabled' => ['type' => 'ProPackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BasicUpgradePackEnabled' => ['type' => 'BasicUpgradePackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ValuePackEnabled' => ['type' => 'ValuePackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ProPackPlusEnabled' => ['type' => 'ProPackPlusEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'AdFormatEnabled' => ['type' => 'AdFormatEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferCounterEnabled' => ['type' => 'BestOfferCounterEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferAutoDeclineEnabled' => ['type' => 'BestOfferAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketSpecialitySubscription' => ['type' => 'LocalMarketSpecialitySubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketRegularSubscription' => ['type' => 'LocalMarketRegularSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketPremiumSubscription' => ['type' => 'LocalMarketPremiumSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketNonSubscription' => ['type' => 'LocalMarketNonSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'ExpressEnabled' => ['type' => 'ExpressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ExpressPicturesRequired' => ['type' => 'ExpressPicturesRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'ExpressConditionRequired' => ['type' => 'ExpressConditionRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'MinimumReservePrice' => ['type' => 'MinimumReservePriceDefinitionType', 'xmlns' => self::XMLNS],\n 'TransactionConfirmationRequestEnabled' => ['type' => 'TCREnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SellerContactDetailsEnabled' => ['type' => 'SellerContactDetailsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'StoreInventoryEnabled' => ['type' => 'StoreInventoryEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SkypeMeTransactionalEnabled' => ['type' => 'SkypeMeTransactionalEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SkypeMeNonTransactionalEnabled' => ['type' => 'SkypeMeNonTransactionalEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalListingDistancesRegular' => ['type' => 'LocalListingDistancesRegularDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalListingDistancesSpecialty' => ['type' => 'LocalListingDistancesSpecialtyDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalListingDistancesNonSubscription' => ['type' => 'LocalListingDistancesNonSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdPaymentMethodEnabled' => ['type' => 'ClassifiedAdPaymentMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdShippingMethodEnabled' => ['type' => 'ClassifiedAdShippingMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdBestOfferEnabled' => ['type' => 'ClassifiedAdBestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdCounterOfferEnabled' => ['type' => 'ClassifiedAdCounterOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdAutoDeclineEnabled' => ['type' => 'ClassifiedAdAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdContactByPhoneEnabled' => ['type' => 'ClassifiedAdContactByPhoneEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdContactByEmailEnabled' => ['type' => 'ClassifiedAdContactByEmailEnabledDefintionType', 'xmlns' => self::XMLNS],\n 'SafePaymentRequired' => ['type' => 'SafePaymentRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdPayPerLeadEnabled' => ['type' => 'ClassifiedAdPayPerLeadEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ItemSpecificsEnabled' => ['type' => 'ItemSpecificsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PaisaPayFullEscrowEnabled' => ['type' => 'PaisaPayFullEscrowEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ISBNIdentifierEnabled' => ['type' => 'ISBNIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'UPCIdentifierEnabled' => ['type' => 'UPCIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'EANIdentifierEnabled' => ['type' => 'EANIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BrandMPNIdentifierEnabled' => ['type' => 'BrandMPNIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferAutoAcceptEnabled' => ['type' => 'BestOfferAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdAutoAcceptEnabled' => ['type' => 'ClassifiedAdAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CrossBorderTradeNorthAmericaEnabled' => ['type' => 'CrossBorderTradeNorthAmericaEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CrossBorderTradeGBEnabled' => ['type' => 'CrossBorderTradeGBEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CrossBorderTradeAustraliaEnabled' => ['type' => 'CrossBorderTradeAustraliaEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PayPalBuyerProtectionEnabled' => ['type' => 'PayPalBuyerProtectionEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BuyerGuaranteeEnabled' => ['type' => 'BuyerGuaranteeEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CombinedFixedPriceTreatmentEnabled' => ['type' => 'CombinedFixedPriceTreatmentEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'GalleryFeaturedDurations' => ['type' => 'ListingEnhancementDurationDefinitionType', 'xmlns' => self::XMLNS],\n 'INEscrowWorkflowTimeline' => ['type' => 'INEscrowWorkflowTimelineDefinitionType', 'xmlns' => self::XMLNS],\n 'PayPalRequired' => ['type' => 'PayPalRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProAdFormatEnabled' => ['type' => 'EBayMotorsProAdFormatEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProContactByPhoneEnabled' => ['type' => 'EBayMotorsProContactByPhoneEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProPhoneCount' => ['type' => 'EBayMotorsProPhoneCountDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProContactByAddressEnabled' => ['type' => 'EBayMotorsProContactByAddressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProStreetCount' => ['type' => 'EBayMotorsProStreetCountDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProCompanyNameEnabled' => ['type' => 'EBayMotorsProCompanyNameEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProContactByEmailEnabled' => ['type' => 'EBayMotorsProContactByEmailEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProBestOfferEnabled' => ['type' => 'EBayMotorsProBestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProAutoAcceptEnabled' => ['type' => 'EBayMotorsProAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProAutoDeclineEnabled' => ['type' => 'EBayMotorsProAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProPaymentMethodCheckOutEnabled' => ['type' => 'EBayMotorsProPaymentMethodCheckOutEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProShippingMethodEnabled' => ['type' => 'EBayMotorsProShippingMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProCounterOfferEnabled' => ['type' => 'EBayMotorsProCounterOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProSellerContactDetailsEnabled' => ['type' => 'EBayMotorsProSellerContactDetailsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketAdFormatEnabled' => ['type' => 'LocalMarketAdFormatEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketContactByPhoneEnabled' => ['type' => 'LocalMarketContactByPhoneEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketPhoneCount' => ['type' => 'LocalMarketPhoneCountDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketContactByAddressEnabled' => ['type' => 'LocalMarketContactByAddressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketStreetCount' => ['type' => 'LocalMarketStreetCountDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketCompanyNameEnabled' => ['type' => 'LocalMarketCompanyNameEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketContactByEmailEnabled' => ['type' => 'LocalMarketContactByEmailEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketBestOfferEnabled' => ['type' => 'LocalMarketBestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketAutoAcceptEnabled' => ['type' => 'LocalMarketAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketAutoDeclineEnabled' => ['type' => 'LocalMarketAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketPaymentMethodCheckOutEnabled' => ['type' => 'LocalMarketPaymentMethodCheckOutEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketShippingMethodEnabled' => ['type' => 'LocalMarketShippingMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketCounterOfferEnabled' => ['type' => 'LocalMarketCounterOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketSellerContactDetailsEnabled' => ['type' => 'LocalMarketSellerContactDetailsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdPhoneCount' => ['type' => 'ClassifiedAdPhoneCountDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdContactByAddressEnabled' => ['type' => 'ClassifiedAdContactByAddressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdStreetCount' => ['type' => 'ClassifiedAdStreetCountDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdCompanyNameEnabled' => ['type' => 'ClassifiedAdCompanyNameEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SpecialitySubscription' => ['type' => 'SpecialitySubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'RegularSubscription' => ['type' => 'RegularSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'PremiumSubscription' => ['type' => 'PremiumSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'NonSubscription' => ['type' => 'NonSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'ReturnPolicyEnabled' => ['type' => 'ReturnPolicyEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'HandlingTimeEnabled' => ['type' => 'HandlingTimeEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PayPalRequiredForStoreOwner' => ['type' => 'PayPalRequiredForStoreOwnerDefinitionType', 'xmlns' => self::XMLNS],\n 'ReviseQuantityAllowed' => ['type' => 'ReviseQuantityAllowedDefinitionType', 'xmlns' => self::XMLNS],\n 'RevisePriceAllowed' => ['type' => 'RevisePriceAllowedDefinitionType', 'xmlns' => self::XMLNS],\n 'StoreOwnerExtendedListingDurationsEnabled' => ['type' => 'StoreOwnerExtendedListingDurationsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'StoreOwnerExtendedListingDurations' => ['type' => 'StoreOwnerExtendedListingDurationsDefinitionType', 'xmlns' => self::XMLNS],\n 'PaymentMethod' => ['type' => 'PaymentMethodDefinitionType', 'xmlns' => self::XMLNS],\n 'Group1MaxFlatShippingCost' => ['type' => 'Group1MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'Group2MaxFlatShippingCost' => ['type' => 'Group2MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'Group3MaxFlatShippingCost' => ['type' => 'Group3MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxFlatShippingCostCBTExempt' => ['type' => 'MaxFlatShippingCostCBTExemptDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxFlatShippingCost' => ['type' => 'MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'VariationsEnabled' => ['type' => 'VariationsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'AttributeConversionEnabled' => ['type' => 'AttributeConversionEnabledFeatureDefinitionType', 'xmlns' => self::XMLNS],\n 'FreeGalleryPlusEnabled' => ['type' => 'FreeGalleryPlusEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'FreePicturePackEnabled' => ['type' => 'FreePicturePackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ItemCompatibilityEnabled' => ['type' => 'ItemCompatibilityEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxItemCompatibility' => ['type' => 'MaxItemCompatibilityDefinitionType', 'xmlns' => self::XMLNS],\n 'MinItemCompatibility' => ['type' => 'MinItemCompatibilityDefinitionType', 'xmlns' => self::XMLNS],\n 'ConditionEnabled' => ['type' => 'ConditionEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ConditionValues' => ['type' => 'ConditionValuesDefinitionType', 'xmlns' => self::XMLNS],\n 'ValueCategory' => ['type' => 'ValueCategoryDefinitionType', 'xmlns' => self::XMLNS],\n 'ProductCreationEnabled' => ['type' => 'ProductCreationEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'EANEnabled' => ['type' => 'EANEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ISBNEnabled' => ['type' => 'ISBNEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'UPCEnabled' => ['type' => 'UPCEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CompatibleVehicleType' => ['type' => 'CompatibleVehicleTypeDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxGranularFitmentCount' => ['type' => 'MaxGranularFitmentCountDefinitionType', 'xmlns' => self::XMLNS],\n 'PaymentOptionsGroup' => ['type' => 'PaymentOptionsGroupEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ShippingProfileCategoryGroup' => ['type' => 'ProfileCategoryGroupDefinitionType', 'xmlns' => self::XMLNS],\n 'PaymentProfileCategoryGroup' => ['type' => 'ProfileCategoryGroupDefinitionType', 'xmlns' => self::XMLNS],\n 'ReturnPolicyProfileCategoryGroup' => ['type' => 'ProfileCategoryGroupDefinitionType', 'xmlns' => self::XMLNS],\n 'VINSupported' => ['type' => 'VINSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'VRMSupported' => ['type' => 'VRMSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'SellerProvidedTitleSupported' => ['type' => 'SellerProvidedTitleSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'DepositSupported' => ['type' => 'DepositSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'GlobalShippingEnabled' => ['type' => 'GlobalShippingEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'AdditionalCompatibilityEnabled' => ['type' => 'AdditionalCompatibilityEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PickupDropOffEnabled' => ['type' => 'PickupDropOffEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'DigitalGoodDeliveryEnabled' => ['type' => 'DigitalGoodDeliveryEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'EpidSupported' => ['type' => 'EpidSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'KTypeSupported' => ['type' => 'KTypeSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'ProductRequiredEnabled' => ['type' => 'ProductRequiredEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticReturnsAcceptedValues' => ['type' => 'DomesticReturnsAcceptedDefinitionType', 'xmlns' => self::XMLNS],\n 'InternationalReturnsAcceptedValues' => ['type' => 'InternationalReturnsAcceptedDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticReturnsDurationValues' => ['type' => 'DomesticReturnsDurationDefinitionType', 'xmlns' => self::XMLNS],\n 'InternationalReturnsDurationValues' => ['type' => 'InternationalReturnsDurationDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticReturnsShipmentPayeeValues' => ['type' => 'DomesticReturnsShipmentPayeeDefinitionType', 'xmlns' => self::XMLNS],\n 'InternationalReturnsShipmentPayeeValues' => ['type' => 'InternationalReturnsShipmentPayeeDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticRefundMethodValues' => ['type' => 'DomesticRefundMethodCodeType', 'xmlns' => self::XMLNS],\n 'InternationalRefundMethodValues' => ['type' => 'InternationalRefundMethodCodeType', 'xmlns' => self::XMLNS],\n 'ReturnPolicyDescriptionEnabled' => ['type' => 'ReturnPolicyDescriptionEnabledDefinitionType', 'xmlns' => self::XMLNS]\n ], parent::NAME);\n\n self::assignAttributes([]);\n }", "public function getInstanceFromXML($xml, &$xmlMapping, $tracker) {\n $rules = array();\n //test this better\n if(property_exists($xml, 'list_rules')) {\n $list_rules = $xml->list_rules;\n $rules['list_rules'] = $this->generateListRulesArrayFromXml($list_rules, $xmlMapping, $tracker);\n }\n \n if(property_exists($xml, 'date_rules')) {\n $date_rules = $xml->date_rules;\n $rules['date_rules'] = $this->generateDateRulesArrayFromXml($date_rules, $xmlMapping, $tracker);\n }\n\n return $rules;\n }", "function add_cf7_tag_generator_googleMap() {\n\t if ( class_exists( 'WPCF7_TagGenerator' ) ) {\n\t $tag_generator = WPCF7_TagGenerator::get_instance();\n\t $tag_generator->add( 'map', __( 'Google map', 'cf7-google-map' ), array($this,'googleMap_tag_generator') );\n\t }\n\t}", "abstract protected function get_plugin_components();", "function simplerdf_ctools_plugin_content_mappers() {\n return array(\n 'cache' => TRUE,\n 'cache table' => 'cache_simplerdf',\n 'use hooks' => TRUE,\n 'process' => 'simplerdf_content_mappers_process',\n );\n}", "public function getConfigurationsMap()\n {\n $sel = $this->getAllConfigurations();\n $arr = array();\n foreach ($sel as $cf)\n $arr[$cf->identifier] = $cf->identifier;\n \n return $arr;\n }", "private function extract_pages(){\r\n $dom = new DOMDocument();\r\n @$dom->loadHTMLFile($this->get_sitemap_url());\r\n $dOMXPath = new DOMXPath($dom);\r\n foreach ($dOMXPath->query(\"//urlset/url/loc\") as $node) {\r\n $this->add_page($node->nodeValue);\r\n }\r\n\t}", "public function getResourceMap()\n\t{\n\t\t// First populate all the data\n\t\tif (!$this->populateRDFData())\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t// Creates new XMLWriter\n\t\t$writer = new XMLWriter;\n\n\t\t// Writes XML to buffer\n\t\t$writer->openMemory();\n\n\t\t// Sets document formatting\n\t\t$writer->setIndent(true);\n\t\t$writer->setIndentString(\" \");\n\n\t\t$writer->startDocument(\"1.0\", \"UTF-8\");\n\n\t\t$writer->startElement(\"rdf:RDF\");\n\n\t\t// Creates object with all the required name spaces\n\t\tforeach ($this->xmlNamespace as $ns => $url)\n\t\t{\n\t\t\t$writer->writeAttribute($ns, $url);\n\t\t}\n\n\t\t// Start main description\n\t\t$writer->startElement('rdf:Description');\n\t\t\t$writer->writeAttribute('rdf:about', $this->resourceURL);\n\t\t\t$writer->writeElement('dc:identifier', $this->id);\n\t\t\t$writer->writeElement('dcterms:title', $this->title);\n\n\t\t\t// Check if the author is an actual human\n\t\t\tif ($this->author_id >= 1000)\n\t\t\t{\n\t\t\t\t$writer->startElement('dcterms:creator');\n\t\t\t\t\t$writer->startElement('foaf:person');\n\t\t\t\t\t\t$writer->writeElement('foaf:name', $this->created_by);\n\t\t\t\t\t$writer->endElement();\n\t\t\t\t$writer->endElement();\n\t\t\t}\n\n\t\t\t$writer->writeElement('dcterms:created', $this->date_created);\n\t\t\t$writer->writeElement('dcterms:modified', $this->date_modified);\n\t\t\t$writer->writeElement('dc:type', $this->type);\n\t\t\t$writer->writeElement('dc:description', $this->intro);\n\n\t\t\t// Writes aggregation\n\t\t\tforeach ($this->aggregates as $child_id => $aggregation)\n\t\t\t{\n\t\t\t\t$writer->startElement('ore:aggregates');\n\t\t\t\t\t$writer->writeAttribute('rdf:resource', $aggregation['url']);\n\t\t\t\t$writer->endElement();\n\t\t\t}\n\n\t\t\t// Writes describer (should be RDF in this case)\n\t\t\t$writer->startElement('ore:isDescribedBy');\n\t\t\t\t$writer->writeAttribute('rdf:resource', $this->resourceURL . '.rdf');\n\t\t\t$writer->endElement();\n\n\t\t\t// Writes parents\n\t\t\tforeach ($this->aggregatedBy as $parent_id => $aggregation)\n\t\t\t{\n\t\t\t\t$writer->startElement('ore:isAggregatedBy');\n\t\t\t\t\t$writer->writeAttribute('rdf:resource', $this->componentURL . $parent_id);\n\t\t\t\t$writer->endElement();\n\t\t\t}\n\n\t\t\t$writer->writeElement('dcterms:issued', $this->date_published);\n\t\t// End rdf:description of main object\n\t\t$writer->endElement();\n\n\t\t// Describe each aggregation briefly\n\t\tforeach ($this->aggregates as $aggregation)\n\t\t{\n\t\t\t// If the child is also an aggregation, do not need to describe it as it has its own RDF descriptor\n\t\t\tif ($aggregation['standalone'] == 1)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$writer->startElement('rdf:Description');\n\t\t\t\t$writer->writeAttribute('rdf:about', $aggregation['url']);\n\t\t\t\t// Detects and describe the data accordingly\n\t\t\t\t$this->dataTypeDescriptor($aggregation, $writer);\n\t\t\t$writer->endElement();\n\t\t}\n\n\t\t// Describe this rdf briefly\n\t\t$writer->startElement('rdf:Description');\n\t\t\t$writer->writeAttribute('rdf:about', $this->resourceURL . '.rdf');\n\t\t\t$curtime = date(\"Y-m-d\\TH:i:sP\", $_SERVER['REQUEST_TIME']);\n\t\t\t$writer->startElement('dcterms:creator');\n\t\t\t\t$writer->writeAttribute('rdf:resource', Request::base());\n\t\t\t$writer->endElement();\n\t\t\t$writer->writeElement('dcterms:created', $curtime);\n\t\t\t$writer->writeElement('dcterms:modified', $curtime);\n\t\t\t$writer->startElement('ore:describes');\n\t\t\t\t$writer->writeAttribute('rdf:resource', $this->resourceURL);\n\t\t\t$writer->endElement();\n\t\t\t$writer->startElement('rdf:type');\n\t\t\t\t$writer->writeAttribute('rdf:resource', 'http://www.openarchives.org/ore/terms/ResourceMap/');\n\t\t\t$writer->endElement();\n\t\t$writer->endElement();\n\n\t\t$writer->endDocument();\n\n\t\t// Flush the memory and return it\n\t\treturn $writer->flush();\n\t}", "public static function getMap()\n\t{\n\t\treturn [\n\t\t\tnew Main\\Entity\\IntegerField('TEMPLATE_ID', [\n\t\t\t\t'primary' => true,\n\t\t\t]),\n\t\t\tnew Main\\Entity\\StringField('PROVIDER', [\n\t\t\t\t'primary' => true,\n\t\t\t]),\n\t\t\tnew Main\\Entity\\ReferenceField('TEMPLATE', '\\Bitrix\\DocumentGenerator\\Model\\Template',\n\t\t\t\t['=this.TEMPLATE_ID' => 'ref.ID']\n\t\t\t),\n\t\t];\n\t}", "private function parseIncludes(&$xmlPlugin, &$objPlugin) {\r\n\t\tif (!is_null($xmlPlugin->includes->include_files)) {\r\n\t\t\tforeach ($xmlPlugin->includes->include_files as $item) {\r\n\t\t\t\t$component = new QPluginIncludedClass();\r\n\t\t\t\t$component->strFilename \t= (string)$item['filename'];\r\n\t\t\t\t$component->strClassname \t= (string)$item['classname'];\r\n\r\n\t\t\t\t$objPlugin->objIncludesArray [] = $component;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function parse() {\n // we'll be using these a lot, aliasing it in makes it a wee bit faster\n $reader = $this->reader;\n $cache = $this->cache;\n\n $module = new Module;\n $module->name = $this->module;\n $module->version = $this->version;\n $module->authors = $this->authors;\n\n // Loop our data and fill our objects\n while($reader->read()) {\n\n // package element - for pkg config\n if($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'package') {\n $module->pkgname = $reader->getAttribute('name');\n }\n\n // c:include element\n elseif($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'c:include') {\n $module->headers[] = $reader->getAttribute('name');\n }\n\n // include element - module deps\n elseif ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'include') {\n $module->dep[$reader->getAttribute('name')] = $reader->getAttribute('version');\n }\n\n // namespace element\n elseif ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'namespace') {\n $module->namespaces[] = $package = new Package;\n $package->name = $reader->getAttribute('name');\n $package->version = $reader->getAttribute('version');\n\n // oddly enough, shared-library info is here in namespace, not in overall module\n $temp = $reader->getAttribute('shared-library');\n $temp = explode(',', $temp);\n $module->libs += $temp;\n }\n\n // constant element\n elseif ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'constant') {\n $package->constant[] = $constant = new Constant;\n $constant->name = $reader->getAttribute('name');\n $constant->def = $reader->getAttribute('c:type');\n\n do {\n if($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'type') {\n $constant->type = $reader->getAttribute('c:type');\n break;\n }\n } while($reader->read());\n }\n\n // Unions\n elseif ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'union' && $reader->isEmptyElement == false) {\n $this->parseUnion();\n }\n\n // Struct fake objects\n elseif ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'record' && $reader->isEmptyElement == false) {\n $package->classes[] = $this->parseStructClass();\n }\n }\n\n return $module;\n }", "function master_xml_export()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\n\t\t$entry = array();\n\n\t\t//-----------------------------------------\n\t\t// Get XML class\n\t\t//-----------------------------------------\n\n\t\trequire_once( KERNEL_PATH.'class_xml.php' );\n\n\t\t$xml = new class_xml();\n\n\t\t$xml->doc_type = $this->ipsclass->vars['gb_char_set'];\n\n\t\t$xml->xml_set_root( 'export', array( 'exported' => time() ) );\n\n\t\t//-----------------------------------------\n\t\t// Set group\n\t\t//-----------------------------------------\n\n\t\t$xml->xml_add_group( 'group' );\n\n\t\t//-----------------------------------------\n\t\t// Get templates...\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'components',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"com_section != 'bugtracker'\" ) );\n\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$content = array();\n\n\t\t\t//-----------------------------------------\n\t\t\t// Sort the fields...\n\t\t\t//-----------------------------------------\n\n\t\t\tforeach( $r as $k => $v )\n\t\t\t{\n\t\t\t\t$content[] = $xml->xml_build_simple_tag( $k, $v );\n\t\t\t}\n\n\t\t\t$entry[] = $xml->xml_build_entry( 'row', $content );\n\t\t}\n\n\t\t$xml->xml_add_entry_to_group( 'group', $entry );\n\n\t\t$xml->xml_format_document();\n\n\t\t$doc = $xml->xml_document;\n\n\t\t//-----------------------------------------\n\t\t// Print to browser\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->admin->show_download( $doc, 'components.xml', '', 0 );\n\t}", "function export_wxr_data($xml=null) {\r\n if(empty($xml)) $xml = $this->xml_data;\r\n //add posts\r\n foreach($this->get_posts_xml($xml) as $item) {\r\n $atts = $item->attributes(); //get xml element attributes\r\n $hw = $item->children($this->namespaces['hw']);\r\n $wp = $item->children($this->namespaces['wp']);\r\n\r\n $post_type = (string) $wp->post_type;\r\n $title = (string) $wp->title;\r\n\r\n //post/page..\r\n if((string)$atts->type != 'gallery' || $post_type !='hw-gallery') {\r\n /*if(isset($hw->content) && ($hw->content->xpath('hw:params'))) {\r\n //$content = $this->get_result_content($hw->content[0]->params->children()); //is deprecated\r\n //$content = $this->get_import_result($hw->content[0]->params->children());\r\n //$content = $this->recursive_option_data($hw->content->xpath('hw:params'));\r\n $content = $hw->content->xpath('hw:params');\r\n foreach($hw->content->xpath('hw:params') as $content){break;};\r\n\r\n }\r\n else $content = (string) $hw->content;\r\n */\r\n $content = $this->get_hw_params_element($hw->content,'hw:params', true);\r\n $this->posts->addItem(array(\r\n 'title' => $title,\r\n 'description' => '',\r\n 'content' => $content,\r\n 'post_type' => (string)$wp->post_type\r\n ));\r\n continue;\r\n }\r\n //skin data\r\n $skin = $hw->skin->children($this->namespaces['skin']);\r\n $skin_name = ($hw->skin->attributes()->name? (string)$hw->skin->attributes()->name : 'skin');\r\n $skin_instance = (string) $skin->instance;\r\n\r\n //skin\r\n $pskin = new HWIE_Skin_Params($skin_name, $skin_instance);\r\n $pskin->add_hash_skin('hash_skin', array(\r\n 'skin' => (string)$skin->skin_name,\r\n 'source' => (string)$skin->source\r\n ));\r\n //other skin params\r\n $params = array(\r\n 'hwskin_condition' => '',\r\n 'skin_options' => array(\r\n 'enqueue_css_position' => 'footer',\r\n 'enqueue_js_position' => 'footer'\r\n )\r\n );\r\n $pskin->add_skin_config();\r\n if(!empty($skin->params)) {\r\n $skin_options = $this->simplexml_parser->recursive_option_data($skin->params[0]->children() )->option;\r\n if(!empty($skin_options)) $params = array_merge($params, $skin_options);\r\n }\r\n $pskin->extra_params($params);\r\n //gallery data\r\n $galleries = array();\r\n if(!empty($hw->data) && !empty($hw->data->item)) {\r\n foreach($hw->data->item as $item) {\r\n //$this->simplexml_parser->recursive_option_data($item->children())->option;\r\n $gallery = HW_XML::xml2array($item->children());\r\n if(!isset($gallery['src'])) continue;\r\n\r\n $gallery['status'] = !isset($gallery['status']) || $gallery['status']? 'active' : '';\r\n if(!isset($gallery['link'])) $gallery['link'] = $gallery['src'];\r\n if(!isset($gallery['alt'])) $gallery['alt'] = '';\r\n if(!isset($gallery['thumb'])) $gallery['thumb'] = '';\r\n\r\n $galleries[] = $gallery;\r\n }\r\n\r\n }\r\n\r\n $post_name = $this->posts->addItem(array(\r\n 'title' => $title,\r\n 'description' => '',\r\n 'content'=> '',\r\n 'excerpt' => '',\r\n 'post_type' => 'hw-gallery',\r\n 'post_metas'=> array(\r\n '_eg_gallery_data' => array(\r\n 'title' => $title,\r\n 'config' => array(\r\n 'columns' => '1',\r\n 'gutter' => '10',\r\n 'margin' => '10',\r\n 'crop' => '0',\r\n 'crop_width' => '960',\r\n 'crop_height' => '300',\r\n 'lightbox_enabled' => '1',\r\n 'title_display' => 'float',\r\n 'classes' => array(),\r\n 'title' => $title,\r\n 'slug' => '',\r\n 'rtl' => '0',\r\n 'hw_skin' => $pskin->get_skin(0)\r\n ),\r\n 'gallery' => $galleries\r\n ),\r\n '_eg_in_gallery' => array(),\r\n '_edit_last' => '1'\r\n ),\r\n\r\n ), HW_XML::attributesArray($item) );\r\n }\r\n $this->add_export_widgets(); //import widgets if exists\r\n $this->do_import(); //start import data\r\n $posts = $this->importer->get_import_results('posts');\r\n\r\n /*if(!empty($post_name) && isset($posts[$post_name])) { //don't need\r\n $gallery_id = $posts[$post_name]['ID'];\r\n //create page to display gallery\r\n wp_insert_post(array(\r\n 'post_type' => 'page',\r\n 'import_id' => 0,\r\n 'post_title' => 'Gallery',\r\n 'post_content' => '[hw-gallery id=\"'.$gallery_id.'\"]',\r\n 'post_status' => 'publish',\r\n ));\r\n }*/\r\n\r\n }", "function readXmlFile($xmlfile) {\n\tglobal $statistics;\n\n\t$xml = file_get_contents($xmlfile);\n\t$o = TypeConverter::xmlToArray($xml,TypeConverter::XML_GROUP);\n\tif ( ! $o ) return false;\n\n\t# Fix some errors in templates prior to continuing\n\n\t$o['Path'] = $xmlfile;\n\t$o['Author'] = getAuthor($o);\n\t$o['DockerHubName'] = strtolower($o['Name']);\n\t$o['Base'] = $o['BaseImage'];\n\t$o['SortAuthor'] = $o['Author'];\n\t$o['SortName'] = $o['Name'];\n\t$o['Forum'] = $Repo['forum'];\n# configure the config attributes to same format as appfeed\n# handle the case where there is only a single <Config> entry\n\n\tif ( $o['Config']['@attributes'] )\n\t\t$o['Config'] = array('@attributes'=>$o['Config']['@attributes'],'value'=>$o['Config']['value']);\n\n\tif ( $o['Plugin'] ) {\n\t\t$o['Author'] = $o['PluginAuthor'];\n\t\t$o['Repository'] = $o['PluginURL'];\n\t\t$o['SortAuthor'] = $o['Author'];\n\t\t$o['SortName'] = $o['Name'];\n\t\t$statistics['plugin']++;\n\t} else\n\t\t$statistics['docker']++;\n\n\treturn $o;\n}", "private function _discover() {\n\n $dir = new DirectoryIterator($this->dirname);\n\n foreach ($dir as $file) {\n\n if ($file->isFile() && !$file->isDot()) {\n\n $filename = $file->getFilename();\n $pathname = $file->getPathname();\n\n if (preg_match('/^(\\d+\\W*)?(\\w+)\\.php$/', $filename, $matches)) {\n require_once($pathname);\n $class = \"{$matches[2]}_{$this->suffix}\";\n $files[$filename] = new $class();\n }\n\n }\n\n }\n\n ksort($files);\n $plugins = array_values($files);\n\n return $plugins;\n\n }", "public function get_sitemap_xml($url_list)\n {\n }", "public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'ID' => new Entity\\IntegerField('ID', array(\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true\n\t\t\t)),\n\t\t\t'PROFILE_ID' => new Entity\\IntegerField('PROFILE_ID', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'PROFILE_EXEC_ID' => new Entity\\IntegerField('PROFILE_EXEC_ID', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'DATE_EXEC' => new Entity\\DateTimeField('DATE_EXEC', array(\n\t\t\t\t'default_value' => ''\n\t\t\t)),\n\t\t\t'TYPE' => new Entity\\StringField('TYPE', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'ENTITY_ID' => new Entity\\IntegerField('ENTITY_ID', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'FIELDS' => new Entity\\TextField('FIELDS', array()),\n\t\t\t'PROFILE' => new Entity\\ReferenceField(\n\t\t\t\t'PROFILE',\n\t\t\t\t'\\Bitrix\\EsolImportxml\\ProfileTable',\n\t\t\t\tarray('=this.PROFILE_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t\t'PROFILE_EXEC' => new Entity\\ReferenceField(\n\t\t\t\t'PROFILE_EXEC',\n\t\t\t\t'\\Bitrix\\EsolImportxml\\ProfileExecTable',\n\t\t\t\tarray('=this.PROFILE_EXEC_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t\t'IBLOCK_ELEMENT' => new Entity\\ReferenceField(\n\t\t\t\t'IBLOCK_ELEMENT',\n\t\t\t\t'\\Bitrix\\Iblock\\ElementTable',\n\t\t\t\tarray('=this.ENTITY_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t\t'IBLOCK_SECTION' => new Entity\\ReferenceField(\n\t\t\t\t'IBLOCK_SECTION',\n\t\t\t\t'\\Bitrix\\Iblock\\SectionTable',\n\t\t\t\tarray('=this.ENTITY_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t);\n\t}", "public static function getMap()\n { \n return array(\n 'ID' => array(\n 'data_type' => 'integer',\n 'primary' => true,\n 'autocomplete' => true,\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_ID_FIELD'),\n ),\n 'DATE_CHANGE' => array(\n 'data_type' => 'datetime',\n 'required' => true,\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_DATE_CHANGE_FIELD'),\n ),\n 'DATE_CREATE' => array(\n 'data_type' => 'datetime',\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_DATE_CREATE_FIELD'),\n ),\n 'ACTIVE' => array(\n 'data_type' => 'boolean',\n 'values' => array('N', 'Y'),\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_ACTIVE_FIELD'),\n ),\n 'SORT' => array(\n 'data_type' => 'integer',\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_SORT_FIELD'),\n ),\n 'NAME' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateName'),\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_NAME_FIELD'),\n ),\n 'DESCRIPTION' => array(\n 'data_type' => 'text',\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_DESCRIPTION_FIELD'),\n ),\n 'PARENT_CATEGORY_ID' => array(\n 'data_type' => 'integer',\n 'required' => true,\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_PARENT_CATEGORY_ID_FIELD'),\n ), \n );\n }", "public static function generateClassFileMap($cache_file) {\n self::$reloaded = true;\n\n if (!self::$dirs) {\n self::initDirs();\n }\n\n $mapping = array();\n foreach (self::$dirs as $dir => $style) {\n // TODO: ignore .svn etc directories\n // RecursiveDirectoryIterator::FOLLOW_SYMLINKS == 0x00000200 was only added in 5.3.1\n $objects = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($dir,0x00000200),\n RecursiveIteratorIterator::SELF_FIRST\n );\n\n foreach($objects as $file => $object) {\n if (substr($file, -4) !== '.php') {\n continue;\n }\n\n $file = strtr($file, '\\\\', '/');\n if ($style === 'symfony') {\n $class = basename($file, '.php');\n $class = basename($class, '.class');\n } else {\n $class = str_replace('.php', '', $file);\n $class = str_replace(strtr($dir, '\\\\', '/').'/', '', $class);\n $class = str_replace('/', '_', $class);\n }\n\n $content = file_get_contents($file);\n if (stripos($content, 'class '.$class) !== false\n || stripos($content, 'interface '.$class) !== false\n ) {\n $mapping[$class] = $file;\n }\n }\n }\n\n if (empty($mapping)) {\n $mapping = false;\n }\n\n if (self::$cache) {\n $mappingstring = '<?php return '. var_export($mapping, true).';';\n file_put_contents($cache_file, $mappingstring);\n }\n\n return $mapping;\n }" ]
[ "0.6548875", "0.6045412", "0.5887497", "0.58413464", "0.5827318", "0.5365801", "0.52512115", "0.52498484", "0.5141279", "0.5129361", "0.510453", "0.5054593", "0.5033763", "0.50192624", "0.4980078", "0.49616188", "0.49413353", "0.49323654", "0.49303576", "0.49236235", "0.49057853", "0.48865122", "0.4886238", "0.48836786", "0.48677605", "0.4863889", "0.48635483", "0.48133245", "0.47909826", "0.4788702", "0.47877118", "0.47791588", "0.47762904", "0.47744775", "0.4772541", "0.476123", "0.47486392", "0.4723998", "0.4717632", "0.47049823", "0.46918753", "0.46796638", "0.4671105", "0.46633315", "0.46548063", "0.46540767", "0.46520978", "0.46483448", "0.4647209", "0.46445084", "0.464029", "0.46381772", "0.46362633", "0.4623093", "0.46097323", "0.4597987", "0.4596672", "0.45875683", "0.45825586", "0.45782885", "0.45772356", "0.4576808", "0.45654404", "0.45403573", "0.45315352", "0.4522449", "0.4506126", "0.44863325", "0.44830906", "0.44785562", "0.44701755", "0.4464665", "0.44635284", "0.44528213", "0.4447673", "0.4447335", "0.44446287", "0.44336215", "0.4422748", "0.441453", "0.44087234", "0.44085962", "0.44073057", "0.44068208", "0.4405311", "0.43890288", "0.4387555", "0.4385185", "0.43839327", "0.4381121", "0.43758988", "0.4371765", "0.436087", "0.43589136", "0.43563548", "0.43517017", "0.434784", "0.4335635", "0.433033", "0.4328659" ]
0.7538879
0
Builds an XML Map used to parse Actions from an XML source
protected function xmlActionMapFactory() { $map = new Map(); $map->add( Path::factory('/fwk/actions/action', 'actions') ->loop(true, '@name') ->attribute('class') ->attribute('method') ->attribute('shortcut') ); return $map; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function build_xml_map() {\n $this->_create_map();\n header(\"content-type: text/xml\");\n echo $this->result;\n }", "private function _getXSIMap($actionParam){\n\t\t$arrayMap = array();\n\t\tforeach($actionParam->childNodes as $item){\n\t\t\tif($item->nodeType==1){\n\t\t\t\tif($item->localName=='item'){\n\t\t\t\t\t$index = null;\n\t\t\t\t\t$value = null;\n\t\t\t\t\tforeach($item->childNodes as $node){\n\t\t\t\t\t\tif($node->nodeType==1){\n\t\t\t\t\t\t\tif($node->localName=='key'){\n\t\t\t\t\t\t\t\t$index = (string) $node->nodeValue;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif($node->localName=='value'){\n\t\t\t\t\t\t\t\t\t$paramType = $node->getAttributeNS($this->_xmlSchemaNamespace, 'type');\n\t\t\t\t\t\t\t\t\tif($this->_isTypeLiteral($paramType)==true){\n\t\t\t\t\t\t\t\t\t\t$value = $this->_decodeXSDType($paramType, $node->nodeValue);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif($paramType=='ns2:Map'){\n\t\t\t\t\t\t\t\t\t\t\t$value = $this->_getXSIMap($node);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tif($paramType=='SOAP-ENC:Array'||$paramType=='enc:Array'){\n\t\t\t\t\t\t\t\t\t\t\t\t$value = $this->_getSoapArray($node);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$value = null;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($index!==null){\n\t\t\t\t\t\t$arrayMap[$index] = $value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$arrayMap[] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $arrayMap;\n\t}", "protected function xmlServicesMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/services', 'services', array())\n ->loop(true, '@xml')\n ->attribute('xmlMap')\n );\n \n return $map;\n }", "public static function createActionDictionary() {}", "public function getXMLPageMap() {\n\t\tstatic $xml;\n\n\t\tif (isset($xml)) return $xml;\n\t\t$cache = SA_SimpleCache::singleton('__XML_PAGES_MAP__');\n\t\tif ($xmlString = $cache->load()) {\n\t\t\t$xml = new SimpleXMLElement($xmlString);\n\t\t} else {\n\t\t\t$xml = new SimpleXMLElement('<?xml version=\"1.0\" standalone=\"yes\"?><pages/>');\n\t\t\t$this->xmlFileSystem($this->getPagesDir(), $xml);\n\t\t\t$cache->save($xml->asXML());\n\t\t}\n\t\treturn $xml;\n\t}", "protected function xmlListenersMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/listener', 'listeners')\n ->loop(true)\n ->attribute('class')\n ->attribute('service')\n ->addChildren(\n Path::factory('param', 'params')\n ->attribute('name')\n ->filter(array($this, 'propertizeString'))\n ->value('value')\n ->loop(true)\n )\n );\n \n return $map;\n }", "protected function xmlPluginsMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/plugin', 'plugins')\n ->loop(true)\n ->attribute('class')\n ->attribute('service')\n ->addChildren(\n Path::factory('param', 'params')\n ->attribute('name')\n ->filter(array($this, 'propertizeString'))\n ->value('value')\n ->loop(true)\n )\n );\n\n return $map;\n }", "abstract protected function buildMap();", "public function read_actions(DOMNode $config){\n\n\t\tglobal $CFG;\n\t\t$CFG->actions = new StdClass();\n\t\t\n\t\t$this->action_id = 1;\n\t\t\n\t\t$this->getLogger()->debug(\"reading actions section configuration\");\n\t\t\n\t\t// lecture de chacun des modes\n\t\t$actions = $config->getElementsByTagName(\"action\");\n\t\t$a_actions = array();\n\n\t\tforeach ($actions as $xml_action){\n\n\t\t\t$action = new StdClass();\n\t\t\t$a_gpio = array();\n\t\t\t\n\t\t\tforeach ($xml_action->childNodes as $node){\n\t\t\t\t\n\t\t\t\tswitch(strtolower($node->nodeName)){\n\t\t\t\t\tcase \"name\" :\n\t\t\t\t\t\t$action->name = $node->textContent;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"gpio\" :\n\t\t\t\t\t\t$gpio = $this->read_gpio($node);\n\t\t\t\t\t\tarray_push($a_gpio,$gpio);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"description\" :\n\t\t\t\t\t\t$action->description = $node->textContent;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$action->id = $this->action_id++;\n\t\t\t$action->gpio = $a_gpio;\n\t\t\tarray_push($a_actions, $action);\n\t\t}\t\t\n\t\t\n\t\t// print_r($a_actions);\n\t\t$CFG->actions->list = $a_actions;\n\t}", "protected function initializeActionEntries() {}", "protected function xmlIniMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/ini', 'ini', array())\n ->loop(true)\n ->attribute('category')\n ->value('value')\n );\n \n return $map;\n }", "public function getActionDictionary() {}", "function venture_geo_process_map_xml($id, $params) { \n $output = '';\n if ($params) {\n $output = \" <state id=\\\"$id\\\">\\n\";\n foreach ($params as $name => $value) {\n if($value) \n $output .= \" <$name>$value</$name>\\n\";\n }\n $output .= \" </state>\\n\";\n }\n return $output;\n}", "private function generateXml()\n {\n\n $args = array(\n\n 'posts_per_page' => -1,\n 'numberposts' => -1,\n 'orderby' => 'post_type',\n 'order' => 'DESC',\n 'post_type' => apply_filters('fpcms_sitemap_post_types', array('post', 'page'))\n\n );\n\n if ($results = get_posts($args)) {\n\n $sitemap = new \\SimpleXMLElement($this->getDocStructure());\n\n foreach ($results as $result) {\n\n $url = $sitemap->addChild('url');\n $url->addChild('loc', get_permalink($result->ID));\n\n if (has_post_thumbnail($result->ID)) {\n\n if ($image = wp_get_attachment_image_src(get_post_thumbnail_id($result->ID))) {\n $url->addChild('image:image', $image[0]);\n }\n\n }\n\n $url->addChild('lastmod', mysql2date('Y-m-d', $result->post_date_gmt));\n\n if ($result->post_type == 'page') {\n\n //Pages should display higher than posts for the same keyword\n $url->addChild('priority', apply_filters('fpcms_sitemap_page_priority', '0.7'));\n\n } else {\n\n $url->addChild('priority', apply_filters('fpcms_sitemap_post_priority', '0.4'));\n\n }\n\n }\n\n return $sitemap->asXML();\n\n }\n\n }", "public function sitemapAction() {\n\t\t\n\t\t$urls = array(\n\t\t\t'/',\n\t\t\t'/contact',\n\t\t\t'/map'\n\t\t);\n\t\t\n\t\t$regionDb = Yadda_Db_Table::getInstance('region');\n\t\t$select = $regionDb\n\t\t\t->select()\n\t\t\t->from('region', array('id'))\n\t\t\t->order('name');\n\t\t$regions = $regionDb->fetchAll($select);\n\t\tforeach ($regions as $region) {\n\t\t\t$urls[] = $this->view->url(array(), 'search').'?region='.urlencode($region['id']);\n\t\t}\n\t\t\n\t\t// generate XML\n\t\t\n\t\t$xml = new DOMDocument('1.0', 'utf-8');\n\t\t\n\t\t$urlset = $xml->createElement('urlset');\n\t\t$urlset->setAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');\n\t\t$xml->appendChild($urlset);\n\t\t\n\t\tforeach ($urls as $url) {\n\t\t\t$loc = $xml->createElement('loc', 'http://'.$_SERVER['HTTP_HOST'].$url);\n\t\t\t$url = $xml->createElement('url');\n\t\t\t$url->appendChild($loc);\n\t\t\t$urlset->appendChild($url);\n\t\t}\n\t\t\n\t\t$this->getResponse()->setHeader('Content-Type', 'text/xml');\n\t\t$this->getResponse()->setBody($xml->saveXML(null, LIBXML_NOEMPTYTAG));\n\t\t$this->getResponse()->sendResponse();\n\t\tdie;\n\t\t/*\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\n xmlns:image=\"http://www.sitemaps.org/schemas/sitemap-image/1.1\"\n xmlns:video=\"http://www.sitemaps.org/schemas/sitemap-video/1.1\">\n <url> \n <loc>http://www.example.com/foo.html</loc> \n <image:image>\n <image:loc>http://example.com/image.jpg</image:loc> \n </image:image>\n <video:video> \n <video:content_loc>http://www.example.com/video123.flv</video:content_loc>\n <video:thumbnail_loc>http://www.example.com/thumbs/123.jpg</video:thumbnail_loc>\n <video:player_loc allow_embed=\"yes\" autoplay=\"ap=1\">http://www.example.com/videoplayer.swf?video=123</video:player_loc>\n <video:title>Grilling steaks for summer</video:title> \n <video:description>Get perfectly done steaks every time</video:description>\n </video:video>\n </url>\n</urlset>\n\t\t */\n\t}", "private function genSitemapXML() {\n $url_same = array();\n $sitemap_xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\" xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\">\n <!-- created by CSZ CMS Sitemap Generator www.cszcms.com -->'.\"\\n\";\n $sitemap_xml.= '<url>\n\t<loc>'.base_url().'</loc>\n\t<changefreq>always</changefreq>\n </url>'.\"\\n\";\n if($this->lang !== FALSE){ /* Language */\n foreach ($this->lang as $row) {\n $url = $this->Csz_model->base_link().'/lang/'.$row['lang_iso'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n if($this->menu_other !== FALSE){ /* Navigation */\n foreach ($this->menu_other as $row) {\n $chkotherlink = strpos($row['other_link'], BASE_URL);\n if($row['pages_id'] && $row['pages_id'] != NULL && $row['pages_id'] != 0){\n $pages = $this->Csz_model->getValue('page_url', 'pages', \"active = '1' AND pages_id = '\".$row['pages_id'].\"'\", '', 1, 'page_url', 'ASC'); \n if($row['drop_page_menu_id'] != 0 && $row['drop_page_menu_id'] != NULL){\n $main = $this->Csz_model->getValue('menu_name', 'page_menu', \"active = '1' AND page_menu_id = '\".$row['drop_page_menu_id'].\"'\", '', 1, 'menu_name', 'ASC'); \n $url = $this->Csz_model->base_link().'/'.$this->Csz_model->rw_link($main->menu_name).'/'.$pages->page_url;\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }else{\n $url = $this->Csz_model->base_link().'/'.$pages->page_url;\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }else if($row['other_link'] && $row['other_link'] != NULL && $chkotherlink !== FALSE){ \n if(!in_array($row['other_link'], $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$row['other_link'].'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $row['other_link'];\n }\n }else if($row['plugin_menu'] && $row['plugin_menu'] != NULL){\n $url = $this->Csz_model->base_link().'/plugin/'.$row['plugin_menu'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n }\n if($this->pages_content !== FALSE){ /* Pages Content without navigation */\n foreach ($this->pages_content as $row) {\n $url = $this->Csz_model->base_link().'/'.$row['page_url'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n if($this->plugin !== FALSE){ /* Plugin with sitemap config */\n foreach ($this->plugin as $row) {\n $plugin_db = $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sitemap_viewtable');\n if(!empty($plugin_db)){\n $plugindata = $this->Csz_model->getValueArray('*', $plugin_db, $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sqlextra_condition'), '', 0, $plugin_db.'_id', 'DESC');\n if($plugindata !== FALSE){\n foreach ($plugindata as $rs) {\n $url = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/view/'.$rs[$plugin_db.'_id'].'/'.$rs['url_rewrite'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n if($row['plugin_config_filename'] == 'article'){\n $urlamp = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/amp/'.$rs[$plugin_db.'_id'].'/'.$rs['url_rewrite'];\n if(!in_array($urlamp, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$urlamp.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $urlamp;\n }\n }\n }\n }\n }\n $plugin_cat_db = $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sitemap_cattable');\n if(!empty($plugin_cat_db)){\n $plugindata = $this->Csz_model->getValueArray('*', $plugin_cat_db, $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sqlextra_catcondition'), '', 0, $plugin_cat_db.'_id', 'DESC');\n if($plugindata !== FALSE){\n foreach ($plugindata as $rs) {\n $url = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/category/'.$rs['url_rewrite'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n }\n } \n }\n $sitemap_xml.= '</urlset>'.\"\\n\";\n if($sitemap_xml){\n /* Gen sitemap.xml */\n $file_path = FCPATH.\"sitemap.xml\";\n $fopen = fopen($file_path, 'wb') or die(\"can't open file\");\n fwrite($fopen, $sitemap_xml);\n fclose($fopen);\n /* Gen sitemap.xml.gz */\n $gzdata = @gzencode($sitemap_xml, 9);\n if($gzdata !== FALSE){\n $fopen1 = fopen(FCPATH.\"sitemap.xml.gz\", 'wb') or die(\"can't open file\");\n fwrite($fopen1, $gzdata);\n fclose($fopen1);\n }\n\t}\n }", "protected static function dataMapProcessKey($source_data, $actions)\n\t{\n\t\t$data = array();\n\t\t\n\t\t// If an array, this key can map to multiple other actions\n\t\tif (is_array($actions))\n\t\t{\n\t\t\tforeach ($actions AS $action)\n\t\t\t{\n\t\t\t\t$data = array_merge($data, self::dataMapProcessKey($source_data, $action));\n\t\t\t}\n\t\t}\n\t\t// If an action begins with a '/' assume it is a regular expression with named subpatterns\n\t\telseif ($actions[0] == '/')\n\t\t{\n\t\t\tif (preg_match($actions, $source_data, $matches))\n\t\t\t{\n\t\t\t\tforeach ($matches AS $match_name => $match_value)\n\t\t\t\t{\n\t\t\t\t\tif (!is_int($match_name))\n\t\t\t\t\t{\n\t\t\t\t\t\t$data[$match_name] = $match_value;\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$data[$actions] = $source_data;\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "private static function xml_route(){\n\t\t\n\t\t$xml_routes=new Parser();\n\t\t$xml_routes->load_from_file('routes.xml');\n\t\t$request=(isset($_GET['request']))?$_GET['request']:'/index';\n\t\t$route_found=false;\n\t\t\n\t\t$routes=$xml_routes->getElementsByAttributeValue('method', Request::get_request_type());\n\t\t\n\t\t$str_routes=\"\";\n\t\t$found_route=null;\n\t\tforeach ($routes as $item){\n\t\t\t\n\t\t\tif($item->nodeType==XML_ELEMENT_NODE){\n\t\t\t\tforeach($item->childNodes as $attr){\n\t\t\t\t\t\n\t\t \tif($attr->nodeType==XML_ELEMENT_NODE){\n\t\t \n\t\t \t\tif($attr->tagName==\"request\"){\n\t\t \t\t\tif($item->getAttribute('method')==$_SERVER['REQUEST_METHOD']){\n\t\t \t\t\t\t$match_route=$item->cloneNode(true);\n\t\t \t\t\t\t//print \"{$match_route->getElementsByTagName('request')->item(0)->nodeValue}\\n\";\n\t\t \t\t\t\t\n\t\t \t\t\t\t$controller=$match_route->getElementsByTagName('controller')->item(0)->nodeValue;\n\t\t \t\t\t\t$action=$match_route->getElementsByTagName('action')->item(0)->nodeValue;\n\t\t \t\t\t\t\n\t\t \t\t\t\t$match=str_ireplace('/','\\\\/',$match_route->getElementsByTagName('request')->item(0)->nodeValue);\n\t\t \t\t\t\t//$match.=\"(\\\\/(.*))?\";\n\t\t \t\t\t\t$match='/^'.$match.'$/';\n\t\t \t\t\t\t$replace=\"/$controller/$action\";\n\t\t \t\t\t\tif($match_route->getAttribute('args')==true){\n\t\t \t\t\t\t\t$number_args=($match_route->getAttribute('argsnum')!==null)?$match_route->getAttribute('argsnum'):1;\n\t\t \t\t\t\t\tfor($i=1;$i<=$number_args;$i++)\n\t\t \t\t\t\t\t$replace.=\"/$\".$i;\n\t\t \t\t\t\t}\n\t\t \t\t\t\tif(preg_match($match, $request)){\n\t\t \t\t\t\t\t$request=preg_replace($match,$replace,$request);\n\t\t \t\t\t\t\t$found_route=$item->cloneNode(true);\n\t\t \t\t\t\t\t\n\t\t \t\t\t\t\t//print \"Found\\n\";\n\t\t \t\t\t\t\tbreak;\n\t\t \t\t\t\t}\n\t\t \t\t\t}\n\t\t \t\t}\n\t\t \t}\n\t\t\t\t}\n\t\t }\n\t\t if($found_route!==null){\n\t\t \tbreak;\n\t\t }\n\t\t}\n\t\t\n\t\treturn $request;\n\t}", "public function sitemap_xml()\n {\n // Get All Pages.\n $this->data['pages'] = $this->pages->get_all(FALSE, 0, 'ASC', FALSE);\n // Get All Sermons.\n $this->data['sermons'] = $this->sermons->get_sermons(FALSE, FALSE, FALSE, 0, \"DESC\", FALSE);\n // Get All Posts\n $this->data['posts'] = $this->posts->get_all(FALSE, 0, 'ASC', FALSE);\n // Get All Post Categories\n $this->data['post_categories'] = $this->categories->get_all();\n\n // Set page content to xml.\n header(\"Content-Type: text/xml;charset=iso-8859-1\");\n $this->load->view(\"sitemap/sitemap\", $this->data);\n }", "function get_map($source)\n{\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_json = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('person', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n 'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_datajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_socratajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'upload' => array('upload', 2),\n 'format' => array('format', 2),\n 'name' => array('name', 2),\n 'modified' => array('modified',1),\n );\n\n // 'dest_key' => array('source_key', dest_position, source_position)\n // 0/1/2 denotes root/extras/resources.\n $map_ckan = array(\n 'title' => array('title', 0, 0),\n 'notes' => array('notes', 0, 0),\n // hard-code publisher to orgnization.title in ckan_map for now.\n // todo: change this map structure.\n 'publisher' => array('place-holder', 1, 1),\n 'public_access_level' => array('access-level', 1, 1),\n 'contact_email' => array('contact-email', 1, 1),\n 'contact_name' => array('person', 1, 1),\n 'unique_id' => array('id', 1, 0),\n 'tags' => array('tags', 0, 1),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('data-dictiionary', 1, 1), // there is a typo.\n 'license_title' => array('license_title', 0, 0),\n 'spatial' => array('spatial-text', 1, 1),\n 'temporal' => array('dataset-reference-date', 1, 1),\n 'release_date' => array('issued', 1, 1),\n 'accrual_periodicity' => array('frequency-of-update', 1, 1),\n 'related_documents' => array('references', 1, 1),\n 'language' => array('metadata-language', 1, 1),\n 'homepage_url' => array('url', 1, 0),\n 'url' => array('url', 2, 2),\n 'name' => array('name', 2, 2),\n 'format' => array('format', 2, 2),\n );\n\n $ret_map = \"map_$source\";\n return isset($$ret_map) ? $$ret_map : null;\n}", "function map_action($action) {\n return $action . '_action';\n }", "function webmap_compo_lib_xml_build()\r\n{\r\n\t$this->webmap_compo_lib_xml_base();\r\n}", "public function generateMap()\n {\n try\n {\n // Select all published articles and pages.\n // Lessons and other new stuff to be added upon needed.\n $pgs = ORM::factory( 'Page' )\n ->where( 'status', '>', 0 )\n ->find_all()->as_array();\n\n $articles = ORM::factory( 'Article' )\n ->where( 'status', '>', 0 )\n ->find_all()->as_array();\n \n // Place found URLs into the container array.\n $pages = [];\n foreach ( array_merge( $pgs, $articles ) as $value )\n array_push ( $pages, $value->make_full_url () );\n \n // Select whatever is already in the map...\n $urls = [];\n foreach ( $this->map->children() as $node )\n $urls[] = ( string )$node->loc;\n\n // Delete redundant links\n foreach ( array_diff( $urls, $pages ) as $url )\n $this->removeEntry( $url, FALSE, TRUE );\n\n // Add missing links.\n foreach ( array_diff( $pages, $urls ) as $uri )\n $this->addEntry ( $uri, NULL, FALSE, TRUE );\n\n // Save result into the file.\n return $this->save();\n }\n catch ( Exception $e )\n {\n Kohana::$log->add( LOG_ERR, $e->getMessage() );\n return FALSE;\n }\n }", "public static function attributeMap();", "protected function parseXmlNode(\\DOMElement $node, $map) {\n /** @var \\DOMElement $attribute */\n $attribute = $node->firstChild;\n $result = [];\n do {\n $name = $attribute->localName;\n if (isset($map['sourceMap'][$name])) {\n foreach($map['sourceMap'][$name] as $target) {\n //pass null since we do not have implemented $row yes to pass to normalize\n $value = $this->normalize($attribute->nodeValue, $map['map'][$target]['type'], $node);\n\n if (isset($result[$target])) {\n switch ($map['map'][$target]['multiple']) {\n case 'array': if (is_array($result[$target])) {\n $result[$target][] = $value;\n } else {\n $result[$target] = [$result[$target], $value];\n }\n break;\n case 'last':\n $result[$target] = $value;\n break;\n default:\n throw new \\Exception(\"Unknown value for multiple: {$map['map'][$target]['multiple']}\");\n\n }\n } else {\n $result[$target] = $value;\n }\n }\n }\n } while(null !== $attribute = $attribute->nextSibling);\n foreach($map['map'] as $target => $def) {\n if (!isset($result[$target])) {\n $result[$target] = null;\n }\n }\n return $result;\n }", "public function loadXml($filename,$map_path){\r\n \r\n $this->rootPath = $this->_preparePath($map_path);\r\n \r\n if(!File::exists( $this->rootPath .DS. $filename ))\r\n App::critical_error ('XML document not found: '.$this->rootPath .DS. $filename);\r\n \r\n $xmlDoc = $this->_initDocument($this->rootPath .DS. $filename);\r\n \r\n //get the project elements\r\n $elements = $xmlDoc->getElementsByTagName('element');\r\n \r\n foreach($elements as $element){\r\n \r\n if(count($this->elements) == 0 ){\r\n $this->elements = $this->_loadElement($element);\r\n }\r\n else{\r\n $this->elements = array_merge($this->elements,$this->_loadElement($element));\r\n }\r\n }\r\n \r\n //isolate the template key\r\n if(!is_null($this->_templatekey) && !is_null($this->elements[$this->_templatekey]))\r\n $this->elements['templates'] = $this->elements[$this->_templatekey];\r\n \r\n //clean the element values\r\n //array_walk_recursive($this->element, array($this, '_clean'));\r\n \r\n return File::put(APP_PROJECT .DS. 'elements.php' ,serialize($this->elements)); \r\n }", "protected function buildLocalActions(): array {\n $build = $this->localActionManager->getActionsForRoute($this->routeMatch->getRouteName());\n // Without this workaround, the action links will be rendered as <li> with\n // no wrapping <ul> element.\n if (!empty($build)) {\n $build['#prefix'] = '<ul class=\"action-links\">';\n $build['#suffix'] = '</ul>';\n }\n return $build;\n }", "public function refreshActionLookups()\n {\n //\n }", "protected function buildRoutes()\n {\n $routes = array();\n \n foreach (glob($this->dir.'*.xml') as $file) {\n $xml = simplexml_load_file($file);\n \n $attr = $xml -> attributes();\n $actionsNS = isset($attr['namespace']) ? $attr['namespace'].'\\\\' : '';\n $module = isset($attr['module']) ? $attr['module'].'/' : '';\n \n foreach ($xml->children() as $tag) {\n $id = (string) $tag['id'];\n $method = (string) $tag['method'];\n $pattern = (string) $tag -> url;\n $action = (string) $tag -> action;\n \n $params = [];\n \n if (isset($tag -> params)) {\n foreach ($tag -> params -> children() as $param) {\n $arr = (array) $param -> attributes();\n $arr = $arr['@attributes'];\n \n if (isset($arr['required'])) {\n $arr['required'] = $arr['required'] == 'true' ? true : false;\n }\n \n $params[$arr['name']] = $arr;\n }\n }\n \n if (isset($routes[$module.$id])) {\n throw new \\RuntimeException('Duplicated Route ID: '.$module.$id.' in '.$file.'!');\n }\n \n $routes[$module.$id] = new PatternRoute(\n $this->getActionClass($action, $actionsNS, $id),\n strtoupper($method),\n $pattern,\n $params\n );\n }\n }\n \n return $routes;\n }", "public function getInstanceFromXML($xml, &$xmlMapping, $tracker) {\n $rules = array();\n //test this better\n if(property_exists($xml, 'list_rules')) {\n $list_rules = $xml->list_rules;\n $rules['list_rules'] = $this->generateListRulesArrayFromXml($list_rules, $xmlMapping, $tracker);\n }\n \n if(property_exists($xml, 'date_rules')) {\n $date_rules = $xml->date_rules;\n $rules['date_rules'] = $this->generateDateRulesArrayFromXml($date_rules, $xmlMapping, $tracker);\n }\n\n return $rules;\n }", "protected function getActions() {}", "public function build_route_map($routes) {}", "function Sitemap() {\n $time = FormatTime('Y-m-d', time());\n $url = SYSTEM::get('url');\n $modules = SYSTEM::get('modules');\n $enabled = CONFIG::getSection('enabled');\n $sitemap = SYSTEM::get('sitemap');\n $site_map =\n \"<\\x3Fxml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"\\x3F>\".LF.\n \"<urlset xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\".LF.\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=index</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t\\t<priority>0.8</priority>\".LF.\n \"\\t</url>\".LF;\n foreach ($modules as $module => $data) {\n if (in_array($module, $sitemap) && array_key_exists($module, $enabled)) {\n $gsm = '';\n $obj = strtoupper($module);\n $sections = CMS::call($obj)->getSections();\n unset($sections['drafts']);\n\n foreach ($sections as $id => $section) {\n $categories = CMS::call($obj)->getCategories($id);\n if (!empty($categories)) {\n $gsm .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.SECTION.$id.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t</url>\".LF;\n foreach ($categories as $key => $category) {\n $category = CMS::call($obj)->getCategory($key);\n $content = CMS::call($obj)->getContent($key);\n if (!empty($content)) {\n $gsm .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.SECTION.$id.CATEGORY.$key.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t</url>\".LF;\n foreach ($content as $i => $item) {\n $gsm .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.SECTION.$id.CATEGORY.$key.ITEM.$i.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".FormatTime('Y-m-d', $item['time']).\"</lastmod>\".LF.\n \"\\t</url>\".LF;\n }\n }\n }\n }\n }\n if (!empty($gsm)) {\n $site_map .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t</url>\".LF.$gsm;\n }\n }\n }\n $site_map .= \"</urlset>\";\n if (!file_put_contents(ROOT.'sitemap.xml', $site_map, LOCK_EX)) {\n CMS::call('LOG')->logPut('Error', '', 'Cannot save file sitemap.xml');\n }\n return CMS::call('SYSTEM')->createMainMenu();\n}", "public function buildTaskMap(){\n\t\t$loadWebPageTask = DataClassLoader::createInstance('Modules.Website.Tasks.LoadStaticPage');\n\t\t$this->tasks['LoadWebsitePage'] = $loadWebPageTask;\n\t\t\n\t\t$this->taskMap['Inputs'][] = array('Enabled'=>'LoadWebsitePage.Enabled');\n\t\t$this->taskMap['Inputs'][] = array('Domain'=>'LoadWebsitePage.Domain');\n\t\t$this->taskMap['Inputs'][] = array('PagePath'=>'LoadWebsitePage.PagePath');\n\t\t\n\t\t//$showPageTask = DataClassLoader::createInstance('Modules.Website.Tasks.ShowPage');\n\t\t//$this->tasks['ShowWebPage'] = $showPageTask;\n\t\t\n\t\t\n\t\t//build the output HTML Task\n\t\t$outputHTMLTask = DataClassLoader::createInstance('Modules.Website.Tasks.SendHTMLResponse');\n\t\t$this->tasks['OutputHTML'] = $outputHTMLTask;\n\t\t\n\t\t$this->taskMap['LoadWebsitePage'][] = array('PageLoaded'=>'OutputHTML.Enabled');\n\t\t$this->taskMap['LoadWebsitePage'][] = array('WebsitePage.PageHTML'=>'OutputHTML.HTMLString');\n\t\t\n\t}", "public static function buildTableMap()\n {\n $dbMap = Propel::getServiceContainer()->getDatabaseMap(UseractionsTableMap::DATABASE_NAME);\n if (!$dbMap->hasTable(UseractionsTableMap::TABLE_NAME)) {\n $dbMap->addTableObject(new UseractionsTableMap());\n }\n }", "function initMap() {\n\n\t\t// Instantiate the xajax object and configure it\n\t\trequire_once (t3lib_extMgm::extPath('xajax') . 'class.tx_xajax.php');\n\t\t$this->xajax = t3lib_div::makeInstance('tx_xajax'); // Make the instance\n\t\tif ($GLOBALS['TSFE']->metaCharset == 'utf-8') {\n\t\t\t$this->xajax->decodeUTF8InputOn(); // Decode form vars from utf8\n\t\t}\n\t\t$this->xajax->setCharEncoding($GLOBALS['TSFE']->metaCharset); \t\t// Encode of the response to utf-8 ???\n\t\t$this->xajax->setWrapperPrefix($this->prefixId); \t\t// To prevent conflicts, prepend the extension prefix\n\t\t$this->xajax->statusMessagesOn(); \t\t// Do you wnat messages in the status bar?\n\n\t\t// register the functions of the ajax requests\n\t\t$this->xajax->registerFunction(array('infomsg', &$this, 'ajaxGetInfomsg'));\n\t\t$this->xajax->registerFunction(array('activeRecords', &$this, 'ajaxGetActiveRecords'));\n\t\t$this->xajax->registerFunction(array('processCat', &$this, 'ajaxProcessCat'));\n\t\t$this->xajax->registerFunction(array('tab', &$this, 'ajaxGetPoiTab'));\n\t\t$this->xajax->registerFunction(array('search', &$this, 'ajaxSearch'));\n\t\t$this->xajax->registerFunction(array('processCatTree', &$this, 'ajaxProcessCatTree'));\n\t\t$this->xajax->registerFunction(array('getDynamicList', &$this, 'ajaxGetDynamicList'));\n\n\t\t$this->xajax->processRequests();\n\n\t\t// additional output using a template\n\t\t$template['total'] = $this->cObj2->getSubpart($this->templateCode,'###HEADER###');\n\t\t$markerArray = $subpartArray = array();\n\t\t$markerArray['###PATH###'] = t3lib_extMgm::siteRelpath('rggooglemap');\n\n\t\tif ($this->conf['map.']['addLanguage'] == 1) {\n\t\t\tif ($this->conf['map.']['addLanguage.']['override'] != '') {\n\t\t\t\t$markerArray['###MAP_KEY###'] .= '&hl=' . $this->conf['map.']['addLanguage.']['override'];\n\t\t\t} elseif ($GLOBALS['TSFE']->lang != '') {\n\t\t\t\t$markerArray['###MAP_KEY###'] .= '&hl=' . $GLOBALS['TSFE']->lang;\n\t\t\t}\n\t\t}\n\n\t\t$markerArray['###DYNAMIC_JS###'] = $this->getJs();\n\n\t\t// load spefic files if needed for clustering\n\t\tif ($this->conf['map.']['activateCluster'] == 1) { // gxmarkers\n\t\t\t$subpartArray['###CLUSTER_2###'] = '';\n\n\t\t} elseif ($this->conf['map.']['activateCluster'] == 2) { // markerclusterer\n\t\t\t$subpartArray['###CLUSTER_1###'] = '';\n\t\t} else { // no clustering\n\t\t\t$subpartArray['###CLUSTER_1###'] = $subpartArray['###CLUSTER_2###'] = '';\n\t\t}\n\n\t\t$totalJS = $this->cObj2->substituteMarkerArrayCached($template['total'],$markerArray, $subpartArray);\n\t\t$GLOBALS['TSFE']->additionalHeaderData['rggooglemap_xajax'] = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('xajax'));\n\t\t$GLOBALS['TSFE']->additionalHeaderData['rggooglemap_js'] = $totalJS;\n\t}", "public function mappingAction(){\n\t\t$params = $this->_request->getParams();\n $rows = array();\n\t\t\n foreach ($params['text00'] as $key => $val) {\n if (($key > 0) && ($params['tChange'][$key])) {\n\t\t\t\t$rows[$key]['CHANGE'] \t= $params['tChange'][$key]; // CHANGE\n\t\t\t\t$rows[$key]['ROW_ID'] \t= $params['text00'][$key]; // ROW ID\n\t\t\t\t$rows[$key]['PERIOD_BUDGET'] = $params['text02'][$key]; // PERIOD_BUDGET\n\t\t\t\t$rows[$key]['BA_CODE'] \t\t= $params['text03'][$key]; // BA_CODE\n\t\t\t\t$rows[$key]['ROTASI'] \t\t= $params['text09'][$key]; // ROTASI\n\t\t\t\t$rows[$key]['DOSIS'] \t= $params['text10'][$key]; // DOSIS\n\t\t\t\t$rows[$key]['PRICE'] \t\t= $params['text12'][$key]; // PRICE\n\t\t\t\t\n\t\t\t\t//deklarasi var utk inherit module\n\t\t\t\t$rows[$key]['key_find'] \t\t= $params['text03'][$key]; // BA_CODE\n }\n }\n\t\treturn $rows;\n\t}", "public static function createActionDictionary($uri) {}", "public function createSitemapAction()\n {\n $this->view->layout()->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n \n $this->_response->setHeader('Content-Type', 'text/xml;charset=utf-8');\n\n $front = $this->getFrontController();\n $acl = array();\n\n $inflector = new Zend_Filter_Inflector(':page');\n $inflector->setRules(\n array(\n ':page' => array('Word_CamelCaseToDash', 'StringToLower')\n )\n );\n \n foreach ($front->getControllerDirectory() as $module => $path)\n {\n foreach (scandir($path) as $file)\n {\n if (strstr($file, \"Controller.php\") !== false) {\n include_once $path . DIRECTORY_SEPARATOR . $file;\n \n /*\n * @TODO hier noch entweder einen KEYWORD Check einbauen\n * oder einen Access Check auf Gast zugriff um die restlichen\n * internen actions nicht öffentlich sichtbar zu machen\n * \n */\n \n // \t\t\t\tforeach (get_declared_classes() as $class)\n // \t\t\t\t{\n // \t\t\t\t\tif (is_subclass_of($class, 'Zend_Controller_Action'))\n // \t\t\t\t\t{\n $controller = $inflector->filter(array('page' => substr($file, 0, strpos($file, \"Controller.php\"))));\n $actions = array();\n \n foreach (get_class_methods(substr($file, 0, strpos($file, \".php\"))) as $action)\n {\n if (strstr($action, \"Action\") !== false) {\n $count_actions = count($actions);\n $action = preg_replace('/Action/i', '', $action);\n $a_stats = stat($path . DIRECTORY_SEPARATOR . $file);\n \n $actions[$count_actions]['name'] = $inflector->filter(array('page' => $action));\n $actions[$count_actions]['mtime'] = $a_stats['mtime'];\n }\n }\n \n // \t\t\t\t\t}\n // \t\t\t\t}\n \n $acl[$module][$controller] = $actions;\n }\n }\n }\n \n $xml_content = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">';\n foreach($acl as $modul => $a_controllers)\n {\n $pfad = '/';\n \n if(strtolower($modul) != \"default\") {\n $pfad .= $modul . \"/\";\n }\n \n foreach($a_controllers as $controller => $a_actions)\n {\n foreach($a_actions as $a_action)\n {\n $xml_content .= '<url>';\n $xml_content .= '<loc>' . $_SERVER[\"SERVER_NAME\"] . $pfad . $controller . \"/\" . $a_action['name'] . '</loc>';\n $xml_content .= '<lastmod>' . (date(\"c\", $a_action['mtime']) . '</lastmod>');\n $xml_content .= '<changefreq>weekly</changefreq>';\n $xml_content .= '</url>';\n }\n }\n }\n $xml_content .= '</urlset>';\n \n $doc = new DOMDocument('1.0');\n $doc->preserveWhiteSpace = false;\n $doc->loadXML($xml_content);\n $doc->formatOutput = true;\n \n echo $doc->saveXML();\n }", "public function sitemap_feed() {\n $output = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $output .= '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\">';\n\n // Products\n $this->load->model('tool/image');\n\n $products = $this->{$this->callModel}->getProducts();\n\n foreach ($products as $product) {\n if ($product['image'] && file_exists(DIR_IMAGE . $product['image'])) {\n $product_name = $this->escape($product['name']);\n $date = (strtotime($product['date_modified']) == -62169984000) || (strtotime($product['date_modified']) == -62169962400) ? date('Y-m-d\\TH:i:sP', strtotime(0)) : date('Y-m-d\\TH:i:sP', strtotime($product['date_modified']));\n \n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link('product/product', 'product_id=' . $product['product_id'])) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= '  <lastmod>' . $date . '</lastmod>';\n $output .= ' <priority>1.0</priority>';\n $output .= ' <image:image>';\n $output .= ' <image:loc>' . $this->model_tool_image->resize($product['image'], 300, 200) . '</image:loc>';\n $output .= ' <image:caption>' . $product_name . '</image:caption>';\n $output .= ' <image:title>' . $product_name . '</image:title>';\n $output .= ' </image:image>';\n $output .= '</url>';\n }\n }\n\n // Categories\n $this->load->model('catalog/category');\n\n $output .= $this->getCategories(0);\n\n // Manufacturer\n $this->load->model('catalog/manufacturer');\n\n $manufacturers = $this->model_catalog_manufacturer->getManufacturers();\n\n foreach ($manufacturers as $manufacturer) {\n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link('product/manufacturer/info', 'manufacturer_id=' . $manufacturer['manufacturer_id'])) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= ' <priority>0.7</priority>';\n $output .= '</url>';\n\n if ($this->{$this->callModel}->getSetting('feed_manufacturer_product')) {\n $products = $this->{$this->callModel}->getProducts(array('filter_manufacturer_id' => $manufacturer['manufacturer_id']));\n\n foreach ($products as $product) {\n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link('product/product', 'manufacturer_id=' . $manufacturer['manufacturer_id'] . '&product_id=' . $product['product_id'])) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= ' <priority>1.0</priority>';\n $output .= '</url>';\n }\n }\n }\n\n // Information\n $this->load->model('catalog/information');\n\n $informations = $this->model_catalog_information->getInformations();\n\n foreach ($informations as $information) {\n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link('information/information', 'information_id=' . $information['information_id'])) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= ' <priority>0.5</priority>';\n $output .= '</url>';\n }\n\n // SEO Backpack - custom URL\n $this->load->model('extension/module/isenselabs_seo');\n $urls = $this->model_extension_module_isenselabs_seo->getCustomUrls();\n\n foreach ($urls as $url) {\n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link($url)) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= ' <priority>0.5</priority>';\n $output .= '</url>';\n }\n\n // ===\n\n $output .= '</urlset>';\n\n $this->response->addHeader('Content-Type: application/xml');\n $this->response->setOutput($output);\n }", "protected function buildLocalActions() {\n $build = $this->localActionManager->getActionsForRoute($this->routeMatch->getRouteName());\n // Without this workaround, the action links will be rendered as <li> with\n // no wrapping <ul> element.\n if (!empty($build)) {\n $build['#prefix'] = '<ul class=\"action-links\">';\n $build['#suffix'] = '</ul>';\n }\n return $build;\n }", "public function get_sitemap_xml($url_list)\n {\n }", "function GetMapContent($hide_mode_ids) {\n\tglobal $config;\n\n\t$lang = GetLangContent(\"map\");\n\n\t$map = array();\n\tif (file_exists($config[\"site_path\"].\"/include/map.xml\")) {\n\t\t$xml_parser = new SimpleXmlParser( $config[\"site_path\"].\"/include/map.xml\" );\n\t\t$xml_root = $xml_parser->getRoot();\n\n\t\tforeach ( $xml_root->children as $cnt => $xml_section ) {\n\t\t\tif (!isset($xml_section->attrs[\"id\"]) || (isset($xml_section->attrs[\"id\"]) && !in_array($xml_section->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t$section = array();\n\t\t\t\t$section = array(\"name\" => (isset($lang[$xml_section->attrs[\"name\"]]) ? $lang[$xml_section->attrs[\"name\"]] : $xml_section->attrs[\"name\"]), \"link\" => $xml_section->attrs[\"link\"]);\n\t\t\t\tif ($xml_section->children) {\n\t\t\t\t\tforeach ( $xml_section->children as $xml_subsection_cnt => $xml_subsection ) {\n\t\t\t\t\t\tif (!isset($xml_subsection->attrs[\"id\"]) || (isset($xml_subsection->attrs[\"id\"]) && !in_array($xml_subsection->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t\t\t\t$subsection = array();\n\t\t\t\t\t\t\t$subsection[\"name\"] = (isset($lang[$xml_subsection->attrs[\"name\"]]) ? $lang[$xml_subsection->attrs[\"name\"]] : $xml_subsection->attrs[\"name\"]);\n\t\t\t\t\t\t\t$subsection[\"link\"] = $xml_subsection->attrs[\"link\"];\n\t\t\t\t\t\t\tif ($xml_subsection->children) {\n\t\t\t\t\t\t\t\t$item = array();\n\t\t\t\t\t\t\t\tforeach ( $xml_subsection->children as $xml_item_cnt => $xml_item ) {\n\t\t\t\t\t\t\t\t\tif (!isset($xml_item->attrs[\"id\"]) || (isset($xml_item->attrs[\"id\"]) && !in_array($xml_item->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t\t\t\t\t\t\t$item[] = array(\"name\" => (isset($lang[$xml_item->attrs[\"name\"]]) ? $lang[$xml_item->attrs[\"name\"]] : $xml_item->attrs[\"name\"]), \"link\" => $xml_item->attrs[\"link\"]);\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\t$subsection[\"subsection\"] = $item;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$section[\"subsection\"][] = $subsection;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$map[] = $section;\n\t\t\t}\n\t\t}\n\t}\n\treturn $map;\n}", "public static function buildTableMap()\n {\n $dbMap = Propel::getServiceContainer()->getDatabaseMap(CKOrderXmlTableMap::DATABASE_NAME);\n if (!$dbMap->hasTable(CKOrderXmlTableMap::TABLE_NAME)) {\n $dbMap->addTableObject(new CKOrderXmlTableMap());\n }\n }", "public function createXmlIndex(DOMDocument $xml, $target_path)\n {\n $this->log('Generating the search index');\n\n $output = new SimpleXMLElement('<nodes></nodes>');\n $xml = simplexml_import_dom($xml);\n\n foreach ($xml->file as $file)\n {\n foreach ($file->interface as $interface)\n {\n $interface_node = $output->addChild('node');\n $interface_node->value = (string) $interface->full_name;\n $interface_node->id = $file['generated-path'] . '#' . $interface_node->value;\n $interface_node->type = 'interface';\n\n foreach ($interface->constant as $constant)\n {\n $node = $output->addChild('node');\n $node->value = (string) $interface->full_name . '::' . (string) $constant->name;\n $node->id = $file['generated-path'] . '#' . $node->value;\n $node->type = 'constant';\n }\n foreach ($interface->property as $property)\n {\n $node = $output->addChild('node');\n $node->value = (string) $interface->full_name . '::' . (string) $property->name;\n $node->id = $file['generated-path'] . '#' . $node->value;\n $node->type = 'property';\n }\n foreach ($interface->method as $method)\n {\n $node = $output->addChild('node');\n $node->value = (string) $interface->full_name . '::' . (string) $method->name . '()';\n $node->id = $file['generated-path'] . '#' . $node->value;\n $node->type = 'method';\n }\n }\n\n foreach ($file->class as $class)\n {\n $class_node = $output->addChild('node');\n $class_node->value = (string) $class->full_name;\n $class_node->id = $file['generated-path'] . '#' . $class_node->value;\n $class_node->type = 'class';\n\n foreach ($class->constant as $constant)\n {\n $node = $output->addChild('node');\n $node->value = (string) $class->full_name . '::' . (string) $constant->name;\n $node->id = $file['generated-path'] . '#' . $node->value;\n $node->type = 'constant';\n }\n foreach ($class->property as $property)\n {\n $node = $output->addChild('node');\n $node->value = (string) $class->full_name . '::' . (string) $property->name;\n $node->id = $file['generated-path'] . '#' . $node->value;\n $node->type = 'property';\n }\n foreach ($class->method as $method)\n {\n $node = $output->addChild('node');\n $node->value = (string) $class->full_name . '::' . (string) $method->name . '()';\n $node->id = $file['generated-path'] . '#' . $node->value;\n $node->type = 'method';\n }\n }\n\n foreach ($file->constant as $constant)\n {\n $node = $output->addChild('node');\n $node->value = (string) $constant->name;\n $node->id = $file['generated-path'] . '#::' . $node->value;\n $node->type = 'constant';\n }\n\n foreach ($file->function as $function)\n {\n $node = $output->addChild('node');\n $node->value = (string) $function->name . '()';\n $node->id = $file['generated-path'] . '#::' . $node->value;\n $node->type = 'function';\n }\n }\n\n $output->asXML($target_path . '/search_index.xml');\n }", "protected static function buildEventMaps()\n {\n \\Log::info('Building event cache');\n\n // Build event mapping from services in database\n\n //\tInitialize the event map\n $processEventMap = [];\n $broadcastEventMap = [];\n\n // Pull any custom swagger docs\n $result = ServiceModel::with(\n [\n 'serviceDocs' => function ($query){\n $query->where('format', ApiDocFormatTypes::SWAGGER);\n }\n ]\n )->get();\n\n //\tSpin through services and pull the events\n foreach ($result as $service) {\n $apiName = $service->name;\n try {\n if (empty($content = ServiceModel::getStoredContentForService($service))) {\n throw new \\Exception(' * No event content found for service.');\n continue;\n }\n\n $serviceEvents = static::parseSwaggerEvents($apiName, $content);\n\n //\tParse the events while we get the chance...\n $processEventMap[$apiName] = ArrayUtils::get($serviceEvents, 'process', []);\n $broadcastEventMap[$apiName] = ArrayUtils::get($serviceEvents, 'broadcast', []);\n\n unset($content, $service, $serviceEvents);\n } catch (\\Exception $ex) {\n \\Log::error(\" * System error building event map for service '$apiName'.\\n{$ex->getMessage()}\");\n }\n }\n\n static::$eventMap = ['process' => $processEventMap, 'broadcast' => $broadcastEventMap];\n\n //\tWrite event cache file\n \\Cache::forever(static::EVENT_CACHE_KEY, static::$eventMap);\n\n \\Log::info('Event cache build process complete');\n }", "public function getActions() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'action'=>\"nav_primary_client\",\n\t\t\t\t'uri'=>\"plugin/knowledgebase/client_main/\",\n\t\t\t\t'name'=>Language::_(\"KnowledgebasePlugin.client_main\", true)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'action' => \"nav_secondary_staff\",\n\t\t\t\t'uri' => \"plugin/knowledgebase/admin_main/\",\n\t\t\t\t'name' => Language::_(\"KnowledgebasePlugin.admin_main\", true),\n\t\t\t\t'options' => array('parent' => \"tools/\")\n\t\t\t)\t\t\t\n\t\t);\n\t}", "public function register_action_map($map)\n {\n if (is_array($map)) {\n foreach ($map as $idx => $val) {\n $this->action_map[$idx] = $val;\n }\n }\n }", "function xml_to_array()\r\n {\r\n $output=array();\r\n \r\n foreach($this->xpath_map as $key=>$value)\r\n {\r\n $output[$key]=$value['data'];\r\n }\r\n \r\n return $output;\r\n }", "static public function actionToXMLElement($action)\n\t{\n\t\treturn QuickBooks_Utilities::actionToObject($action) . 'Ret';\n\t}", "function modify_xml($tempPages = '', $piecemakerId, $tempTransitions = ''){\n\t\n\t\t$old_xml = $this->get_xml($piecemakerId);\n\t\n\t\tif($tempTransitions == '')\n\t\t\t$tempTransitions = $this->xml_to_table($piecemakerId, 'transitions');\n\t\t\t\n\t\tif($tempPages == '')\n\t\t\t$tempPages = $this->xml_to_table($piecemakerId, 'pages');\n\t\t\n\t\t$xml = $this->create_xml($old_xml->Settings->attributes()->ImageWidth, $old_xml->Settings->attributes()->ImageHeight, $old_xml->Settings->attributes()->LoaderColor, $old_xml->Settings->attributes()->InnerSideColor, $old_xml->Settings->attributes()->Autoplay, $old_xml->Settings->attributes()->FieldOfView, $old_xml->Settings->attributes()->SideShadowAlpha, $old_xml->Settings->attributes()->DropShadowAlpha, $old_xml->Settings->attributes()->DropShadowDistance, $old_xml->Settings->attributes()->DropShadowScale, $old_xml->Settings->attributes()->DropShadowBlurX, $old_xml->Settings->attributes()->DropShadowBlurY, $old_xml->Settings->attributes()->MenuDistanceX, $old_xml->Settings->attributes()->MenuDistanceY, $old_xml->Settings->attributes()->MenuColor1, $old_xml->Settings->attributes()->MenuColor2, $old_xml->Settings->attributes()->MenuColor3, $old_xml->Settings->attributes()->ControlSize, $old_xml->Settings->attributes()->ControlDistance , $old_xml->Settings->attributes()->ControlColor1, $old_xml->Settings->attributes()->ControlColor2, $old_xml->Settings->attributes()->ControlAlpha, $old_xml->Settings->attributes()->ControlAlphaOver, $old_xml->Settings->attributes()->ControlsX, $old_xml->Settings->attributes()->ControlsY, $old_xml->Settings->attributes()->ControlsAlign, $old_xml->Settings->attributes()->TooltipHeight, $old_xml->Settings->attributes()->TooltipColor, $old_xml->Settings->attributes()->TooltipTextY, $old_xml->Settings->attributes()->TooltipTextStyle, $old_xml->Settings->attributes()->TooltipTextColor, $old_xml->Settings->attributes()->TooltipMarginLeft, $old_xml->Settings->attributes()->TooltipMarginRight, $old_xml->Settings->attributes()->TooltipTextSharpness, $old_xml->Settings->attributes()->TooltipTextThickness, $old_xml->Settings->attributes()->InfoWidth, $old_xml->Settings->attributes()->InfoBackground, $old_xml->Settings->attributes()->InfoBackgroundAlpha, $old_xml->Settings->attributes()->InfoMargin, $old_xml->Settings->attributes()->InfoSharpness, $old_xml->Settings->attributes()->InfoThickness, $tempPages['allPages'], $tempTransitions['transition']);\n\n $xml_file = $this->plugin_path.$this->books_dir.\"/\".$piecemakerId.\".xml\";\n $config_file = fopen($xml_file, \"w+\");\n fwrite($config_file, $xml);\n fclose($config_file);\n\t}", "public function init_from_xml($xml, $from = Bean::SOURCE_STRING)\n {\n if($from == Bean::SOURCE_URL || $from == Bean::SOURCE_FILE)\n {\n $xdom = @simplexml_load_file($xml);\n }\n if($from == Bean::SOURCE_STRING)\n {\n $xdom = @simplexml_load_string($xml);\n }\n\n foreach($xdom as $key => $val)\n {\n $this->set($key,$val); \n } \n }", "public function meta() {\t\t\t\t\t\t\n\t\t\t$this->output->layout = \"empty\";\n\t\t\t$this->output->set(\"actions\", results_array(\"SELECT * FROM actions ORDER BY title\"));\n\t\t\t$this->output->view(\"api/xml/meta.php\");\n\t\t\t$this->output->header(\"Content-Type: text/xml\");\n\t\t\t$this->output->cache($this->default_cache_timeout);\n\t\t}", "protected function getArgumentMap()\n {\n $argMap = parent::getArgumentMap();\n\n //common paramters for all getXXXRecommendation style queries...\n $this->addParameterToMap($argMap, \"nbRec\", $this->parameter->getNbRecommendation() );\n $this->addParameterToMap($argMap, \"showAds\", $this->parameter->getShowAds() ? \"true\" : \"false\" );\n $this->addParameterToMap($argMap, \"userID\", $this->parameter->getUserId());\n $this->addParameterToMap($argMap, \"classID\", $this->parameter->getProfileMapId());\n $this->addParameterToMap($argMap, \"languageCode\", $this->parameter->getLanguageCode());\n $this->addParameterToMap($argMap, \"referURL\", $this->parameter->getRefererUrl());\n \n $bufferKeys = \"\";\n $bufferValues = \"\";\n\n //implode the key values pairs into separate strings\n Utils::implodeKeyValuePairsToSeparatedString( $this->parameter->getConditions(), \"_/_\", $bufferKeys, $bufferValues);\n\n //add parameters\n $this->addParameterToMap($argMap, \"attributeNames\", $bufferKeys);\n $this->addParameterToMap($argMap, \"attributeValues\", $bufferValues);\n\n return $argMap;\n }", "public function getActions();", "public function getActions();", "function init_accessMap(){\n\t$map = array(\n\t\t/* user */\n\t\t'user.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'user.get_others' => array('root', 'admin'),\n\n\t\t/* logs */\n\t\t'logs.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'logs.get_others' => array('root', 'admin'),\n\n\t\t/* site */\n\t\t'site.add' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.get_others' => array('root', 'admin'),\n\t\t'site.update' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.update_others' => array('root', 'admin'),\n\t\t'site.remove' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.remove_others' => array('root', 'admin'),\n\n\t\t/* pattern */\n\t\t'pattern.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'pattern.get_others' => array('root', 'admin'),\n\t\t'pattern.add' => array('root', 'admin', 'developer', 'normal'),\n\t\t'pattern.remove' => array('root', 'admin', 'developer', 'normal'),\n\t\t'pattern.remove_others' => array('root', 'admin'),\n\n\t\t/* count data */\n\t\t'count.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'count.get_others' => array('root', 'admin'),\n\n\t\t/* ucenter entry show control */\n\t\t'ucenter.home' => array('root', 'admin', 'developer', 'normal'),\n\t\t'ucenter.sites' => array('root', 'admin', 'developer', 'normal'),\n\t\t'ucenter.logs' => array('root', 'admin', 'developer', 'normal'),\n\t\t'ucenter.logs_all' => array('root', 'admin'),\n\t\t'ucenter.sites_all' => array('root', 'admin'),\n\t\t'ucenter.visitors' => array('root', 'admin'),\n\t);\n\tAccessController::setMap($map);\n}", "function siteMap($node, $lang='en', $wide_info=false){\r\n\t\t$dir = \"sitemaps\";\r\n\t\t$lang = $this->CFG->lang;\r\n\t\t$db = $this->DB->dbName;\r\n\t\t$fname = \"sitemap_\".$db.\"_\".$node.\"_\".$lang.\".xml\";\r\n\t\tif(!($xml = $this->getCache($dir, $fname))){\r\n\t\t\t$xml = $this->cache__siteMap($node, $lang, $wide_info);\r\n\t\t\t$this->newCache($dir, $fname, $xml);\r\n\t\t\t//print \"newcache [$dir]\";\r\n\t\t} //else print \"readcache [$dir/$fname]\";\r\n\t\t//print \"<textarea>$xml</textarea>\";\r\n\t\treturn $xml;\r\n\t}", "public function buildTemplateAction()\n {\n $action = [\n 'type' => ActionType::RICH_MENU_SWITCH,\n 'richMenuAliasId' => $this->richMenuAliasId,\n 'data' => $this->data,\n ];\n if (isset($this->label)) {\n $action['label'] = $this->label;\n }\n\n return $action;\n }", "function get_event_xml(){\n// $xml = simplexml_load_file($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/calendar-categories.xml\");\n $xml = autoCache(\"simplexml_load_file\", array($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/calendar-categories.xml\"));\n $categories = array();\n $xml = $xml->{'system-page'};\n foreach ($xml->children() as $child) {\n if($child->getName() == \"dynamic-metadata\"){\n foreach($child->children() as $metadata){\n if($metadata->getName() == \"value\"){\n array_push($categories, (string)$metadata);\n }\n }\n }\n }\n// $xml = simplexml_load_file($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/events.xml\");\n $xml = autoCache(\"simplexml_load_file\", array($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/events.xml\"));\n $event_pages = $xml->xpath(\"//system-page[system-data-structure[@definition-path='Event']]\");\n $dates = array();\n $datePaths = array();\n foreach($event_pages as $child ){\n $page_data = inspect_page($child, $categories);\n if (!$page_data[\"hide-from-calendar\"]){\n $dates = add_event_to_array($dates, $page_data, $datePaths);\n }\n }\n return $dates;\n}", "private function getConfigCodeAction()\n {\n $code_action = array();\n $codes = $this->getAllCodesAction();\n foreach ($codes as $code => $value) {\n $code_action['ca_' . $value['id_code_action']] = $value['groupe'];\n }\n\n return $code_action;\n }", "public function actions()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t'action1'=>'path.to.ActionClass',\r\n\t\t\t'action2'=>array(\r\n\t\t\t\t'class'=>'path.to.AnotherActionClass',\r\n\t\t\t\t'propertyName'=>'propertyValue',\r\n\t\t\t),\r\n\t\t);\r\n\t}", "public function buildFromXML($eloXML = null){\n\t\tif ($eloXML !== null){\n\t\t\t$dom = str_get_dom($eloXML);\n\t\t\t\n\t\t\t$contentWithDataTag = $this->getElemAtPos($dom, 'content', 0);\n\t\t\t$dataTag = $this->getElemAtPos($contentWithDataTag, 'data', 0); \n\t\t\tif ($dataTag->innertext !== null){\n\t\t\t\t$content = $dataTag->innertext;\n\t\t\t}else{\n\t\t\t\t$content = '';\n\t\t\t}\n\t\t\t\n\t\t\t$this->setContent($content);\n\t\t\t\n\t\t\t$metadataElem = $this->getElemAtPos($dom, 'metadata', 0);\n\t\t\tif ($metadataElem !== null){\n\t\t\t\tforeach($metadataElem->childNodes() as $curMetadataElem){\n\t\t\t\t\t\n\t\t\t\t\tif ($curMetadataElem->tag == 'uri'){\n\t\t\t\t\t\t$curMetadataElem = $curMetadataElem->find('entry');\n\t\t\t\t\t\t$curMetadataElem = $curMetadataElem[0];\n\t\t\t\t\t\t\n\t\t\t\t\t\t$key = 'uri';\n\t\t\t\t\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\t$key = $curMetadataElem->tag;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$value = $curMetadataElem->innertext;\n\t\t\t\t\t$this->_metadata[$key] = $value;\n\n\t\t\t\t\t// extract the id from URI\n\t\t\t\t\tif ($key === 'uri'){\n\t\t\t\t\t\t$this->_id = substr(strrchr($value, '/'), 1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// This code is to dynamically set the values for the\n\t\t\t\t\t// elo's metadatas\n\t\t\t\t\t/*\n\t\t\t\t\t * THIS WAS MESSING UP THE POPULATION OF THE CODE. \n\t\t\t\t\t * SEEMS TO BE DOING THE EXACT SAME THING AS $this->_metadata[$key] = $value; BUT ADDING A _<mt key> VARIABLE THAT\n\t\t\t\t\t * MESSES UP THE XML GENERATION.\n\t\t\t\t\t */\n//\t\t\t\t\t$keyVar = \"_\" . $key;\n//\t\t\t\t\t$this->$keyVar = $value;\n//\t\t\t\t\t$this->addMetadata($key, $value);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$resourceElem = $this->getElemAtPos($dom, 'resource', 0);\n\t\t\tif ($resourceElem !== null){\n\t\t\t\tif ($resourceElem ){\n\t\t\t\t\tforeach($resourceElem->childNodes() as $curResourceElem){\n\t\t\t\t\t\t$key = $curResourceElem->tag;\n\t\t\t\t\t\t$value = $curResourceElem->innertext;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->_resources[$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static function getActions()\n\t{\n\t\tif (empty(self::$actions))\n\t\t{\n\t\t\tself::$actions = new Obj;\n\n\t\t\t$path = dirname(__DIR__) . '/config/access.xml';\n\n\t\t\t$actions = \\Hubzero\\Access\\Access::getActionsFromFile($path);\n\t\t\t$actions ?: array();\n\n\t\t\tforeach ($actions as $action)\n\t\t\t{\n\t\t\t\tself::$actions->set($action->name, User::authorise($action->name, 'com_members'));\n\t\t\t}\n\t\t}\n\n\t\treturn self::$actions;\n\t}", "protected function parseNamespaceMapping()\n {\n $this->debug('parseNamespaceMapping');\n\n $this->expectToken(Token::TK_SYMBOL, '<');\n $prefix = $this->parseCndString();\n $this->expectToken(Token::TK_SYMBOL, '=');\n $uri = substr($this->expectToken(Token::TK_STRING)->getData(), 1, -1);\n $this->expectToken(Token::TK_SYMBOL, '>');\n\n $this->debugRes(\"nsmapping: $prefix => $uri\");\n\n return new SyntaxTreeNode('nsMapping', array('prefix' => $prefix, 'uri' => $uri));\n }", "function GenXMLProcEntries($IdxFile, &$iProcCnt, &$iTrigCnt)\n {\n $State=0;\n $TabColPos = array();\n $TabColLength = array();\n $TabColSz = 0;\n $EntryCnt=0;\n\n $iProcCnt=0;\n $iTrigCnt=0;\n\n //Generate XML pointer-information for procedures and triggers\n if(!file_exists($IdxFile) || !is_readable($IdxFile))\n {\n print \"\\n\\nERROR: ::GenXMLProcEntries Cannot open ASCII index file: {$IdxFile} \\n\\n\\n\";\n exit -2;\n }\n\n $handle = fopen($IdxFile, \"r\");\n while (!feof($handle))\n {\n $buffer = fgets($handle, 4096);\n $chars = preg_split('/ /', $buffer, -1, PREG_SPLIT_NO_EMPTY);\n \n if($State == 0) //&& $4 == \"crdate\" && $5 == \"loginame\")\n \tif($chars[0] == \"name\" && $chars[1] == \"type\" && $chars[2] == \"name\")\n {\n $State = 1; //Enter next state\n continue;\n }\n \n if($State == 1) //parse table header line to find out how wide each column is\n { //line looks something like this '------ ----- -----'\n $State = 2; //Enter next state\n \n $str=$buffer;\n $c=\" \";\n for($i=0;$i<=strlen($str);$i++)\n {\n $cNext = substr($str, $i, 1);\n if ($cNext != $c && $cNext == \"-\") //Find beginnning of a line ' -----'\n {\n $TabColPos[$TabColSz] = $i; //Note position and length for each column\n $TabColLength[$TabColSz] = strlen($chars[$TabColSz]);\n $TabColSz++;\n }\n \n $c = $cNext;\n }\n \n if($TabColSz < 3 || $TabColSz > 5)\n {\n exit(\"Wrong number of query columns found (expected 3 or 5): {$$TabColSz}\");\n }\n continue;\n }\n \n if($State == 2 && count($chars) >= 3)\n {\n \tif($chars[1] == \"P\" || $chars[1] == \"TR\")\n \t{\n \t if($chars[1] == \"TR\") $iTrigCnt++; //Statistics\n\n \t if($chars[1] == \"P\") $iProcCnt++;\n\n $EntryCnt++;\n\n if(count($chars) >= 5)\n {\n //Get optional parameters, if available\n $sCreation = trim(substr($buffer, $TabColPos[3], $TabColLength[3])); //Time of create\n $sCreator = trim(substr($buffer, $TabColPos[4], $TabColLength[4])); //Login_name of creator\n \n print \" <proc name=\\\"{$chars[0]}\\\" src=\\\"{$chars[2]}_{$chars[0]}.sql\\\" type=\\\"{$chars[1]}\\\" owner=\\\"{$chars[2]}\\\" creation=\\\"$sCreation\\\" creator=\\\"$sCreator\\\"/>\\n\";\n }\n else\n print \" <proc name=\\\"{$chars[0]}\\\" src=\\\"{$chars[2]}_{$chars[0]}.sql\\\" type=\\\"$chars[1]\\\" owner=\\\"$chars[2]\\\"/>\\n\";\n \t}\n }\n }\n fclose($handle);\n\n return $EntryCnt;\n }", "function collectPropertiesAndActions()\n\t{\n\n\t}", "public function actions()\n\t{\n\t\treturn array(\n\t\t\t'action1'=>'path.to.ActionClass',\n\t\t\t'action2'=>array(\n\t\t\t\t'class'=>'path.to.AnotherActionClass',\n\t\t\t\t'propertyName'=>'propertyValue',\n\t\t\t),\n\t\t);\n\t}", "public static function createActionDictionary($destination) {}", "public function add_action($actions){\r\n\t\t\t$actions[$this->id] = $this->name;\r\n\t\t\treturn $actions;\r\n\t\t}", "function xmllist() {\n\t\tglobal $mysql;\n\t\t$result[$this->class_name()] = $mysql->select(\"SELECT * FROM \".$this->class_name, true);\n\t\t$output = XML::get($result);\n\t\treturn xml($output);\n\t}", "public function _map_main_filters()\n\t{\n\t\techo '</div>';\n\t\techo \"<script type='text/javascript'>\njQuery(function() {\n\n$(document).ready(function() {\n\t$('.actionable_filters li a').attr('class', '');\n\t\t$( '#action_102' ).addClass('active');\n\n\t\t// Update the report filters\n\t\tmap.updateReportFilters({k: 102});\n\t\treturn false;\n\n});\n\n$('.actionable_filters li a').click(function() {\n\t\tvar mediaType = parseFloat(this.id.replace('action_', '')) || 0;\n\t\t\n\t\t$('.actionable_filters li a').attr('class', '');\n\t\t$(this).addClass('active');\n\n\t\t// Update the report filters\n\t\tconsole.log('actionable filter');\n\t\tmap.updateReportFilters({k: mediaType});\n\t\treturn false;\n\t});\n});\n</script>\";\n\t\techo '</div>';\n\t\techo '<div id=\"actionable-report-type-filter\" class=\"actionable_filters\">';\n\t\techo '<h3>'.Kohana::lang('actionable.actionable').'</h3><ul>';\n\t\tforeach (self::$media_values as $k => $val) {\n\t\t\tif($k == 101){ $filterName = Kohana::lang('actionable.all');}\n\t\t\tif($k == 102){ $filterName = Kohana::lang('actionable.actionable');}\n\t\t\tif($k == 103){ $filterName = Kohana::lang('actionable.urgent');}\n\t\t\tif($k == 104){ $filterName = Kohana::lang('actionable.action_taken');}\n\t\t\tif($k == 105){ $filterName = Kohana::lang('actionable.resolved');}\n\t\t\tif($k == 106){ $filterName = Kohana::lang('actionable.not_actionable');}\n\n\t\t\techo \"<li><a id=\\\"action_$k\\\" href=\\\"#\\\"><span>$filterName</span></a></li>\";\n\t\t}\n\t\techo '</ul>';\n\t\techo '<div>';\n\n\t}", "public function addAction()\n {\n parent::addAction();\n $this->_fillMappingsArray();\n $this->_fillAvailableProperties();\n }", "protected function parseXmlFile() {}", "public static function createActionDictionary($name) {}", "protected function _getDomMap()\n {\n $domMap = parent::_getDomMap();\n $domMap = reset($domMap);\n\n return [\n 'initSubscriptionResponse' => array_merge([\n 'transactionId' => 'transactionId',\n 'subscriptionPageUrl' => 'subscriptionPageUrl',\n 'status' => 'status',\n ], $domMap)\n ];\n }", "function admin_generate(){\n\t\t$fp = fopen('files/sitemap.xml', 'w+');\n\n\t$start_string = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/</loc>\n \t\t<changefreq>daily</changefreq>\n \t\t<priority>1</priority>\n\t</url>';\n\n\t\tfwrite($fp, $start_string);\n\n\t\t// projdu vsechny produkty\n\t\tApp::import('Model', 'Product');\n\t\t$this->Sitemap->Product = new Product;\n\t\t\n\t\t$this->Sitemap->Product->recursive = -1;\n\t\t$products = $this->Sitemap->Product->find('all', array('fields' => array('Product.url', 'Product.modified')));\n\n\t\tforeach ( $products as $product ){\n\t\t\t// pripnout k sitemape\n\t\t\t$mod = explode(' ', $product['Product']['modified']);\n\t\t\t$mod = $mod[0];\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . $product['Product']['url'] . '</loc>\n \t\t<lastmod>' . $mod . '</lastmod>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.9</priority>\n\t</url>'; \n\n\t\t\tfwrite($fp, $string);\n\t\t}\n\t\t\n\t\t// projdu vsechny kategorie\n\t\tApp::import('Model', 'Category');\n\t\t$this->Sitemap->Category = new Category;\n\t\t\n\t\t$this->Sitemap->Category->recursive = -1;\n\t\t$categories = $this->Sitemap->Category->find('all', array('fields' => array('Category.id', 'Category.url')));\n\n\t\t$skip = array(0 => '5', '25', '26', '53');\n\t\tforeach ( $categories as $category ){\n\t\t\tif ( in_array($category['Category']['id'], $skip) ){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$mod = date('Y-m-d');\n\n\t\t\t// pripnout k sitemape\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . $category['Category']['url'] . '</loc>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.8</priority>\n\t</url>'; \n\n\t\t\tfwrite($fp, $string);\n\t\t\t\n\t\t}\n\t\t\n\t\t// projdu vsechny vyrobce\n\t\tApp::import('Model', 'Manufacturer');\n\t\t$this->Sitemap->Manufacturer = new Manufacturer;\n\t\t\n\t\t$this->Sitemap->Manufacturer->recursive = -1;\n\t\t$manufacturers = $this->Sitemap->Manufacturer->find('all', array('fields' => array('Manufacturer.id', 'Manufacturer.name')));\n\t\t\n\t\tforeach ( $manufacturers as $manufacturer ){\n\t\t\t// pripnout k sitemape\n\t\t\t// vytvorim si url z name a id\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . strip_diacritic($manufacturer['Manufacturer']['name']) . '-v' . $manufacturer['Manufacturer']['id'] . '</loc>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.8</priority>\n\t</url>';\n\t\t\tfwrite($fp, $string);\n\t\t}\n\t\t\n\t\t// projdu vsechny obsahove stranky\n\t\tApp::import('Model', 'Content');\n\t\t$this->Sitemap->Content = new Content;\n\t\t\n\t\t$this->Sitemap->Content->recursive = -1;\n\t\t$contents = $this->Sitemap->Content->find('all', array('fields' => array('Content.path')));\n\t\t\n\t\tforeach ( $contents as $content ){\n\t\t\t// pripnout k sitemape\n\t\t\tif ( $content['Content']['path'] == 'index' ){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . $content['Content']['path'] . '</loc>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.7</priority>\n\t</url>';\n\t\t\tfwrite($fp, $string);\n\t\t}\n\t\t\n\t\t$end_string = '\n</urlset>';\n\t\tfwrite($fp, $end_string);\n\t\tfclose($fp);\n\t\t// uzavrit soubor\n\t\tdie('here');\n\t}", "function generate_mapservice_conf_file(){\n\t\t$dom;\n\t\tif(!$dom = domxml_open_file($this->default_mapservconf_file)){\n\t\t\techo \"Could not open xml file: \" . $this->default_mapservconf_file;\n\t\t\treturn NULL; \n\t\t}\n\t\t$mapservice = $this->find_mapservice($dom);\n\t\t// map service not found\n\t\tif($mapservice == NULL){\n\t\t\techo \"could not find map-service named: \" . $mapservice_name ;\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\t$children = $mapservice->child_nodes();\n\t\t$n_children = count($children);\n\t\t\n\t\t// loop through to find <map-file>\n\t\t// and <layer-config> element\n\t\tfor($i = 0; $i < $n_children; $i++){\n\t\t\tswitch ($children[$i]->tagname){\n\t\t\t\tcase \"map-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_mapfile);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"layer-config-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_layerconf);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$dom->dump_file($this->output_mapservconf, false, false);\n\t\treturn $this->output_mapservconf;\n\t}", "function make_kml_head()\n{\n\t$output = \n'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<kml xmlns=\"http://earth.google.com/kml/2.2\">\n<Document>\n\t<name>Picture the past data</name>\n\t<Style id=\"photo_placemark_style_highlight\">\n\t\t<IconStyle>\n\t\t\t<scale>1.4</scale>\n\t\t\t<Icon>\n\t\t\t\t<href>' . SITE_ROOT . '/images/camera.png</href>\n\t\t\t</Icon>\n\t\t\t<hotSpot x=\"0.5\" y=\"0.5\" xunits=\"fraction\" yunits=\"fraction\"/>\n\t\t</IconStyle>\n\t\t<LabelStyle>\n\t\t\t<color>ff00aaff</color>\n\t\t</LabelStyle>\n\t</Style>\n\t<Style id=\"photo_placemark_style_normal\">\n\t\t<IconStyle>\n\t\t\t<scale>1.2</scale>\n\t\t\t<Icon>\n\t\t\t\t<href>' . SITE_ROOT . '/images/camera.png</href>\n\t\t\t</Icon>\n\t\t\t<hotSpot x=\"0.5\" y=\"0.5\" xunits=\"fraction\" yunits=\"fraction\"/>\n\t\t</IconStyle>\n\t\t<LabelStyle>\n\t\t\t<color>ff00aaff</color>\n\t\t</LabelStyle>\n\t</Style>\n\t<StyleMap id=\"photo_placemark_style\">\n\t\t<Pair>\n\t\t\t<key>normal</key>\n\t\t\t<styleUrl>#photo_placemark_style_normal</styleUrl>\n\t\t</Pair>\n\t\t<Pair>\n\t\t\t<key>highlight</key>\n\t\t\t<styleUrl>#photo_placemark_style_highlight</styleUrl>\n\t\t</Pair>\n\t</StyleMap>\n\t<Folder>\n\t\t<name>Picture the Past Photo Collection</name>\n\t\t<open>1</open>\n\t\t<LookAt>\n\t\t\t<longitude>-1.15050</longitude>\n\t\t\t<latitude>52.95333</latitude>\n\t\t\t<altitude>0</altitude>\n\t\t\t<range>873</range>\n\t\t\t<tilt>0.0</tilt>\n\t\t\t<heading>-16</heading>\n\t\t</LookAt>\n\t\t<Style>\n\t\t\t<ListStyle>\n\t\t\t\t<listItemType>check</listItemType>\n\t\t\t\t<bgColor>00ffffff</bgColor>\n\t\t\t</ListStyle>\n\t\t</Style>\n\t\t<Folder>\n\t\t\t<name>Photos</name>\n';\n\treturn $output; \n}", "protected function _resourceMap()\n\t{\n\t\t$resourceMap = new \\ResourceMapGenerator();\n\t\t$id = '';\n\n\t\t// Retrieves the ID from alias\n\t\tif (substr(strtolower($this->_alias), -4) == '.rdf')\n\t\t{\n\t\t\t$lastSlash = strrpos($this->_alias, '/');\n\t\t\t$lastDot = strrpos($this->_alias, '.rdf');\n\t\t\t$id = substr($this->_alias, $lastSlash, $lastDot);\n\t\t}\n\n\t\t// Create download headers\n\t\t$resourceMap->pushDownload($this->config->get('webpath'));\n\t\texit;\n\t}", "function buildMainMap()\r\n{\r\n\r\n // Add an image first for debug and change asap\r\n //$final_map = \"\r\n//<img class=\\\"main_map\\\" src=\\\"images/heatmapapi.png\\\" />\" ;\r\n\r\n $final_map = \"\r\n<div id=\\\"map\\\"></div>\" ;\r\n\r\n return $final_map ;\r\n}", "protected function _initActionStack()\n\t{\n\t $actionStack = Zend_Controller_Action_HelperBroker::getStaticHelper('actionStack');\n\t\t// $actionStack->actionToStack(new Zend_Controller_Request_Simple('afficher', 'menu', 'default'));\n\t return $actionStack;\n\t}", "public function getActions() {\n\t\treturn array(\n\t\t\t// Client Nav\n\t\t\tarray(\n\t\t\t\t'action'=>\"widget_client_home\",\n\t\t\t\t'uri'=>\"plugin/client_notices/client_widget/\",\n\t\t\t\t'name'=>Language::_(\"ClientNoticesPlugin.widget_client_home.index\", true)\n\t\t\t),\n\t\t\t// Staff Nav\n array(\n 'action' => \"nav_secondary_staff\",\n 'uri' => \"plugin/client_notices/admin_main/index/\",\n 'name' => Language::_(\"ClientNoticesPlugin.nav_secondary_staff.index\", true),\n 'options' => array(\n\t\t\t\t\t'parent' => \"clients/\"\n\t\t\t\t)\n ),\n\t\t\t// Client Profile Action Link\n\t\t\tarray(\n\t\t\t\t'action' => \"action_staff_client\",\n\t\t\t\t'uri' => \"plugin/client_notices/admin_main/add/\",\n\t\t\t\t'name' => Language::_(\"ClientNoticesPlugin.action_staff_client.add\", true),\n\t\t\t\t'options' => array(\n\t\t\t\t\t'class' => \"invoice\"\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "function master_xml_export()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\n\t\t$entry = array();\n\n\t\t//-----------------------------------------\n\t\t// Get XML class\n\t\t//-----------------------------------------\n\n\t\trequire_once( KERNEL_PATH.'class_xml.php' );\n\n\t\t$xml = new class_xml();\n\n\t\t$xml->doc_type = $this->ipsclass->vars['gb_char_set'];\n\n\t\t$xml->xml_set_root( 'export', array( 'exported' => time() ) );\n\n\t\t//-----------------------------------------\n\t\t// Set group\n\t\t//-----------------------------------------\n\n\t\t$xml->xml_add_group( 'group' );\n\n\t\t//-----------------------------------------\n\t\t// Get templates...\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'components',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"com_section != 'bugtracker'\" ) );\n\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$content = array();\n\n\t\t\t//-----------------------------------------\n\t\t\t// Sort the fields...\n\t\t\t//-----------------------------------------\n\n\t\t\tforeach( $r as $k => $v )\n\t\t\t{\n\t\t\t\t$content[] = $xml->xml_build_simple_tag( $k, $v );\n\t\t\t}\n\n\t\t\t$entry[] = $xml->xml_build_entry( 'row', $content );\n\t\t}\n\n\t\t$xml->xml_add_entry_to_group( 'group', $entry );\n\n\t\t$xml->xml_format_document();\n\n\t\t$doc = $xml->xml_document;\n\n\t\t//-----------------------------------------\n\t\t// Print to browser\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->admin->show_download( $doc, 'components.xml', '', 0 );\n\t}", "private function mapElements(){\n $aux = '';\n if(!empty($this->category_list)){\n foreach($this->category_list as $c) {\n $category = new Category();\n $category->loadTaggedElement($c);\n $aux[] = $category; \n }\n $this->category_list = $aux;\n }\n $aux = '';\n if(!empty($this->user_category_list)) {\n foreach($this->user_category_list as $u) {\n $user_category = new Category();\n $user_category->loadTaggedElement($u);\n $aux[] = $user_category;\n }\n $this->user_category_list = $aux;\n } \n $aux = '';\n if(!empty($this->entity_list)){\n foreach($this->entity_list as $e) {\n $entity = new Entity();\n $entity->loadTaggedElement($e);\n $aux[] = $entity;\n }\n $this->entity_list = $aux;\n }\n $aux = '';\n if(!empty($this->concept_list)){\n foreach($this->concept_list as $c) {\n $concept = new Concept();\n $concept->loadTaggedElement($c);\n $aux[] = $concept;\n }\n $this->concept_list = $aux;\n }\n $aux = '';\n if(!empty($this->time_expression_list)){\n foreach($this->time_expression_list as $t)\n $aux[] = new TimeExpression($t);\n $this->time_expression_list = $aux;\n }\n $aux = '';\n if(!empty($this->money_expression_list)){\n foreach($this->money_expression_list as $m)\n $aux[] = new MoneyExpression($m);\n $this->money_expression_list = $aux;\n }\n $aux = '';\n if(!empty($this->uri_list)){\n foreach($this->uri_list as $u)\n $aux[] = new URI($u);\n $this->uri_list = $aux;\n }\n $aux = '';\n if(!empty($this->phone_expression_list)){\n foreach($this->phone_expression_list as $p)\n $aux[] = new PhoneExpression($p);\n $this->phone_expression_list = $aux;\n } \n $aux = '';\n if(!empty($this->quotation_list)){\n foreach($this->quotation_list as $p)\n $aux[] = new Quotation($p);\n $this->quotation_list = $aux;\n } \n $aux = '';\n if(!empty($this->issue_list)) {\n foreach($this->issue_list as $i)\n $aux[] = new Issue($i);\n $this->issue_list = $aux;\n }\n }", "public function setup_actions() {}", "abstract public function getActionsInstance();", "private function generateMaps(): void\n {\n $this->socketMap = $this->streamMap = [\n self::RESOURCE => [\n self::READ => [],\n self::WRITE => []\n ],\n self::HANDLER => [\n self::READ => [],\n self::WRITE => []\n ]\n ];\n\n $socketCount = $streamCount = 0;\n\n\n\n // Sockets\n foreach ($this->sockets as $id => $binding) {\n /** @var resource|Socket $socket */\n $socket = $binding->getIoResource();\n $resourceId = $this->identifySocket($socket);\n\n if ($binding->isStreamBased()) {\n /** @var resource $socket */\n $this->streamMap[self::RESOURCE][$binding->ioMode][$resourceId] = $socket;\n $this->streamMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $streamCount++;\n } else {\n $this->socketMap[self::RESOURCE][$binding->ioMode][$resourceId] = $socket;\n $this->socketMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $socketCount++;\n }\n }\n\n\n // Streams\n foreach ($this->streams as $id => $binding) {\n /** @var resource $stream */\n $stream = $binding->getIoResource();\n $resourceId = (int)$stream;\n\n $this->streamMap[self::RESOURCE][$binding->ioMode][$resourceId] = $stream;\n $this->streamMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $streamCount++;\n }\n\n\n // Signals\n $this->signalMap = [];\n\n foreach ($this->signals as $id => $binding) {\n foreach (array_keys($binding->signals) as $number) {\n $this->signalMap[$number][$id] = $binding;\n }\n }\n\n // Cleanup\n if (!$socketCount) {\n $this->socketMap = null;\n }\n\n if (!$streamCount) {\n $this->streamMap = null;\n }\n\n $this->generateMaps = false;\n }", "public function mappingAction(){\n $params = $this->_request->getParams();\n $rows = array();\n \n foreach ($params['text00'] as $key => $val) {\n //if (($key > 0) && ($params['tChange'][$key])) {\n if ($params['tChange'][$key]) {\n $rows[$key]['CHANGE'] = $params['tChange'][$key]; // CHANGE \n $rows[$key]['ROW_ID'] = $params['text00'][$key]; // ROW ID\n $rows[$key]['PERIOD_BUDGET'] = $params['budgetperiod']; // PERIOD_BUDGET\n $rows[$key]['HCC_CC'] = $params['text02'][$key];\n $rows[$key]['HCC_COST_CENTER'] = $params['text03'][$key];\n $rows[$key]['HCC_COST_CENTER_HEAD'] = $params['text04'][$key];\n $rows[$key]['HCC_DIVISI'] = $params['text07'][$key];\n $rows[$key]['HCC_DIVISION_HEAD'] = $params['text06'][$key];\n \n //deklarasi var utk inherit module\n //$rows[$key]['key_find'] = $params['text06'][$key]; // BA_CODE\n //$rows[$key]['afd_code'] = $params['text04'][$key]; // AFD\n //$rows[$key]['block_code'] = $params['text05'][$key]; // BLOCK\n //$rows[$key]['src_afd'] = $params['text04'][$key]; // AFD\n //$rows[$key]['src_block'] = $params['text05'][$key]; // BLOCK\n }\n }\n return $rows;\n }", "public function route() {\n return array(\n '/^sitemap\\.xml$/' => 'actionMap',\n '/^download\\/(.+?).html/' => array(\n 'class' => 'Download',\n 'argument' => '$1'\n )\n );\n }", "public static function getMap() {\n\t\t$map = array (\"SendListener\" => \"sendPerformed\", \"BeforeSendListener\" => \"beforeSendPerformed\", \"CommandListener\" => \"commandSent\", \"BeforeCommandListener\" => \"beforeCommandSent\", \"ResponseListener\" => \"responseReceived\", \"ConnectListener\" => \"connectPerformed\", \"DisconnectListener\" => \"disconnectPerformed\" );\n\t\treturn $map;\n\t}", "private function add_actions()\n {\n }", "protected function register_internal_actions() {\r\n\t\t$this->register_action( 'registered_actions', array( $this, 'action_registered' ) );\r\n\t\t$this->register_action( 'sync', array( $this, 'action_sync' ) );\r\n\t\t$this->register_action( 'status', array( $this, 'action_status' ) );\r\n\t\t$this->register_action( 'logout', array( $this, 'action_logout' ) );\r\n\t\t$this->register_action( 'activate', array( $this, 'action_activate' ) );\r\n\t\t$this->register_action( 'deactivate', array( $this, 'action_deactivate' ) );\r\n\t\t$this->register_action( 'install', array( $this, 'action_install' ) );\r\n\t\t$this->register_action( 'upgrade', array( $this, 'action_upgrade' ) );\r\n\t\t$this->register_action( 'delete', array( $this, 'action_delete' ) );\r\n\t\t$this->register_action( 'core_upgrade', array( $this, 'action_core_upgrade' ) );\r\n\t\t$this->register_action( 'analytics', array( $this, 'action_analytics' ) );\r\n\t}", "public function _map_main_filters()\n\t{\n\t\techo '</div><h3>'.Kohana::lang('actionable.actionable').'</h3><ul>';\n\t\tforeach ($this->media_values as $k => $val) {\n\t\t\techo \"<li><a id=\\\"media_$k\\\" href=\\\"#\\\"><span>$val</span></a></li>\";\n\t\t}\n\t\techo '</ul><div>';\n\t}", "public function getActions() {\n\n\t}", "protected static function buildEventMaps()\n {\n \\Log::info('Building event cache');\n\n // Build event mapping from services in database\n\n //\tInitialize the event map\n $eventMap = [];\n\n // Pull any custom swagger docs\n $result = ServiceModel::whereIsActive(true)->get();\n\n //\tSpin through services and pull the events\n /** @var ServiceModel $model */\n foreach ($result as $model) {\n $apiName = $model->name;\n try {\n /** @var BaseRestService $service */\n if (empty($service = ServiceManager::getService($apiName))) {\n throw new \\Exception('No service found.');\n }\n\n if ($service instanceof FileServiceInterface) {\n // don't want the full folder list here\n $accessList = (empty($service->getPermissions()) ? [] : ['', '*']);\n } else {\n $accessList = $service->getAccessList();\n }\n\n if (!empty($accessList)) {\n if (!empty($doc = $model->getDocAttribute())) {\n if (is_array($doc) && !empty($content = array_get($doc, 'content'))) {\n if (is_string($content)) {\n $content = ServiceModel::storedContentToArray($content, array_get($doc, 'format'),\n $model);\n if (!empty($content)) {\n $eventMap[$apiName] = static::parseSwaggerEvents($content, $accessList);\n }\n }\n }\n }\n }\n } catch (\\Exception $ex) {\n \\Log::error(\" * System error building event map for service '$apiName'.\\n{$ex->getMessage()}\");\n }\n\n unset($content, $service, $serviceEvents);\n }\n\n static::$eventMap = $eventMap;\n\n \\Log::info('Event cache build process complete');\n }", "public function _feed_rss()\n\t{\n\t\t$incident_id = Event::$data;\n\t\tif ($incident_id)\n\t\t{\n\t\t\t$action_item = ORM::factory('actionable')\n\t\t\t\t->where('incident_id', $incident_id)\n\t\t\t\t->find();\n\t\t\tif ($action_item->loaded)\n\t\t\t{\n\t\t\t\tif ($action_item->actionable == 1)\n\t\t\t\t{\n\t\t\t\t\techo \"<actionable>YES</actionable>\\n\";\n\t\t\t\t\techo \"<urgent>NO</urgent>\\n\";\n\t\t\t\t}\n\t\t\t\telseif ($action_item->actionable == 2)\n\t\t\t\t{\n\t\t\t\t\techo \"<actionable>YES</actionable>\\n\";\n\t\t\t\t\techo \"<urgent>YES</urgent>\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"<actionable>NO</actionable>\\n\";\n\t\t\t\t\techo \"<urgent>NO</urgent>\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($action_item->action_taken == 1)\n\t\t\t\t{\n\t\t\t\t\techo \"<actiontaken>ACTION TAKEN</actiontaken>\\n\";\n\t\t\t\t} else if ($action_item->action_taken == 2){\n\t\t\t\t\techo \"<actiontaken>RESOLVED</actiontaken>\\n\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\techo \"<actiontaken>NO</actiontaken>\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"<actionable>NO</actionable>\\n\";\n\t\t\t\techo \"<urgent>NO</urgent>\\n\";\n\t\t\t\techo \"<actiontaken>NO</actiontaken>\\n\";\n\t\t\t}\n\t\t}\n\t}", "private function generateSiteMapMain()\n {\n $this->load->model('extension/module/siteMapGenerate');\n $output = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $output .= '<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">';\n\n foreach ($this->includedFiles as $file) {\n $removeFromUrl = mb_substr($file, 0, mb_strrpos($file, '/'));;\n $clearFileUrl = str_replace($removeFromUrl . '/', '', $file);\n $output .= '<sitemap>';\n $output .= '<loc>' . $this->siteUrl . $clearFileUrl . '</loc>';\n $output .= '</sitemap>';\n }\n\n $output \t.= '</sitemapindex>';\n $this->response->addHeader('Content-Type: application/xml');\n\n $siteMapXmlUrl = DIR_MAIN . 'sitemap_custom.xml';\n $openedFile = fopen($siteMapXmlUrl, 'w');\n chmod($siteMapXmlUrl, 0775);\n file_put_contents($siteMapXmlUrl, $output);\n fclose($openedFile);\n }", "function userActionExamine( $actionRequest ) {\n\t$actionKeyword = strtok( $actionRequest, \" \" );\n\t$name = trim( strtok('') );\n\t\n\t$locations[]=$_SESSION['location'];\n\t$locations[]=$_SESSION['userID'];\n\t\n\tif( $name == \"here\" ) {\n\t\t$name = \"#\".$_SESSION['location'];\n\t}\n\t\n\t$entity = getEntity( $name );\n\t\n\tif( $entity ) {\n\t\t$response = $entity['name'] . \" (id #\" . $entity['id'] . \")\";\n\t\tforeach( $entity as $name=>$value ) {\n\t\t\tif( $name != \"id\" && $name != \"name\" ) {\n\t\t\t\t$response .= \"<br>&nbsp;&nbsp;\";\n\t\t\t\tif( empty($value) ) {\n\t\t\t\t\t$response.=$name;\n\t\t\t\t} else {\n\t\t\t\t\t$response.=$name.\" is \".$value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\taddNarrativeToXML($response);\n\t}\n\n}", "private function generateSitemap()\n {\n\n if ($site_map = $this->generateXml()) {\n\n if ($this->saveFile($site_map)) {\n\n $this->submitFile();\n\n }\n\n }\n\n }" ]
[ "0.70240086", "0.60125303", "0.555362", "0.5550691", "0.54016286", "0.5391256", "0.5335074", "0.53046703", "0.52497953", "0.5238481", "0.5210544", "0.516157", "0.507359", "0.50047517", "0.49701786", "0.49166536", "0.4909372", "0.48981518", "0.48906216", "0.48865682", "0.48664922", "0.48366362", "0.48233208", "0.4810854", "0.47625044", "0.4760871", "0.47309852", "0.47095707", "0.46981734", "0.46946082", "0.46816143", "0.46520442", "0.46439305", "0.46341094", "0.46206114", "0.46167374", "0.4616236", "0.46138987", "0.46039796", "0.45983413", "0.45815787", "0.4573037", "0.4564681", "0.4564347", "0.45623046", "0.45428312", "0.45265007", "0.45024678", "0.45020044", "0.45015714", "0.4500653", "0.4484444", "0.44619444", "0.4444237", "0.4439567", "0.4439567", "0.44394878", "0.4437163", "0.4421001", "0.44192657", "0.441659", "0.4412539", "0.44122827", "0.44104567", "0.44043693", "0.4403699", "0.4402296", "0.44010642", "0.43993706", "0.43967444", "0.4388348", "0.4388129", "0.43867177", "0.4384636", "0.43760332", "0.43743807", "0.43648294", "0.4353242", "0.43455002", "0.43440875", "0.43265182", "0.43224236", "0.4319911", "0.4317738", "0.43124977", "0.43100962", "0.43075433", "0.4303323", "0.43022105", "0.4299835", "0.42828685", "0.42826137", "0.4270414", "0.425987", "0.42589155", "0.4251305", "0.42488432", "0.4245833", "0.42447746", "0.4240978" ]
0.76401955
0
Builds an XML Map used to parse .ini includes
protected function xmlIniMapFactory() { $map = new Map(); $map->add( Path::factory('/fwk/ini', 'ini', array()) ->loop(true) ->attribute('category') ->value('value') ); return $map; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function build_xml_map() {\n $this->_create_map();\n header(\"content-type: text/xml\");\n echo $this->result;\n }", "protected function xmlPluginsMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/plugin', 'plugins')\n ->loop(true)\n ->attribute('class')\n ->attribute('service')\n ->addChildren(\n Path::factory('param', 'params')\n ->attribute('name')\n ->filter(array($this, 'propertizeString'))\n ->value('value')\n ->loop(true)\n )\n );\n\n return $map;\n }", "abstract protected function buildMap();", "protected function xmlServicesMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/services', 'services', array())\n ->loop(true, '@xml')\n ->attribute('xmlMap')\n );\n \n return $map;\n }", "public function getXMLPageMap() {\n\t\tstatic $xml;\n\n\t\tif (isset($xml)) return $xml;\n\t\t$cache = SA_SimpleCache::singleton('__XML_PAGES_MAP__');\n\t\tif ($xmlString = $cache->load()) {\n\t\t\t$xml = new SimpleXMLElement($xmlString);\n\t\t} else {\n\t\t\t$xml = new SimpleXMLElement('<?xml version=\"1.0\" standalone=\"yes\"?><pages/>');\n\t\t\t$this->xmlFileSystem($this->getPagesDir(), $xml);\n\t\t\t$cache->save($xml->asXML());\n\t\t}\n\t\treturn $xml;\n\t}", "public function getINIEntries()\n {\n }", "function generate_mapservice_conf_file(){\n\t\t$dom;\n\t\tif(!$dom = domxml_open_file($this->default_mapservconf_file)){\n\t\t\techo \"Could not open xml file: \" . $this->default_mapservconf_file;\n\t\t\treturn NULL; \n\t\t}\n\t\t$mapservice = $this->find_mapservice($dom);\n\t\t// map service not found\n\t\tif($mapservice == NULL){\n\t\t\techo \"could not find map-service named: \" . $mapservice_name ;\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\t$children = $mapservice->child_nodes();\n\t\t$n_children = count($children);\n\t\t\n\t\t// loop through to find <map-file>\n\t\t// and <layer-config> element\n\t\tfor($i = 0; $i < $n_children; $i++){\n\t\t\tswitch ($children[$i]->tagname){\n\t\t\t\tcase \"map-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_mapfile);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"layer-config-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_layerconf);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$dom->dump_file($this->output_mapservconf, false, false);\n\t\treturn $this->output_mapservconf;\n\t}", "public function buildClassAliasMapFile() {}", "protected function getMap(): ReferenceMap\n {\n return new ReferenceMap(\n [\n new SrcNode(\n new \\SplFileInfo('folder/Example/ClassExample.php'),\n new FullClassName('Example', 'ClassExample'),\n [\n new Inheritance(0, new FullClassName('Example', 'ParentClassExample')),\n new Inheritance(0, new FullClassName('', 'FilterIterator')),\n new Dependency(0, new FullClassName('Example', 'AnotherClassExample')),\n new Dependency(0, new FullClassName('Vendor', 'ThirdPartyExample')),\n new Dependency(0, new FullClassName('', 'iterable')),\n new Composition(0, new FullClassName('Example', 'InterfaceExample')),\n new Composition(0, new FullClassName('Example', 'AnotherInterface')),\n new Composition(0, new FullClassName('', 'iterable')),\n new Mixin(0, new FullClassName('Example', 'TraitExample')),\n new Mixin(0, new FullClassName('', 'PHPDocElement'))\n ]\n )\n ],\n [\n new FullClassName('', 'iterable'),\n new FullClassName('', 'FilterIterator'),\n new FullClassName('', 'PHPDocElement'),\n ],\n [\n new ComposerPackage('main', [], [], [], [])\n ]\n );\n }", "private function config_file_listing($includenull = false) {\n\n\t\t$this->EE->load->helper('directory');\n\t\t$map = $map = directory_map(PATH_THIRD.'dm_eeck/config/',1);\n\n\t\t$out = array();\n\n\t\tif($includenull) {\n\t\t\t$out[] = $this->EE->lang->line('dm_eeck_global_default');\n\t\t}\n\n\t\t$name = '';\n\n\t\tforeach($map as $file) {\n\t\t\tunset($name);\n\t\t\tinclude(PATH_THIRD.'dm_eeck/config/'.$file);\n\t\t\tif(!isset($name)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$out[$file] = $name;\n\t\t}\n\n\t\treturn $out;\n\t}", "function infoDictionary() {}", "private function parseConfigFile($file) {\n\t\tif (! file_exists($file)) {\n\t\t\treturn '{}';\n\t\t}\n\n\t\t$xml = simplexml_load_file($file);\n\t\tif (! ($xml instanceof SimpleXMLElement)) {\n\t\t\treturn '{}';\n\t\t}\n\n\t\tif (! isset($xml->fieldset)) {\n\t\t\treturn '{}';\n\t\t}\n\n\t\t// Getting the fieldset tags\n\t\t$fieldsets = $xml->fieldset;\n\n\t\t// Creating the data collection variable:\n\t\t$ini = array ();\n\n\t\t// Iterating through the fieldsets:\n\t\tforeach ($fieldsets as $fieldset) {\n\t\t\tif (! count($fieldset->children())) {\n\t\t\t\t// Either the tag does not exist or has no children therefore we return zero files processed.\n\t\t\t\treturn '{}';\n\t\t\t}\n\n\t\t\t// Iterating through the fields and collecting the name/default values:\n\t\t\tforeach ($fieldset as $field) {\n\t\t\t\t// Check against the null value since otherwise default values like \"0\"\n\t\t\t\t// cause entire parameters to be skipped.\n\n\t\t\t\tif (($name = $field->attributes()->name) === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (($value = $field->attributes()->default) === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$ini[(string) $name] = (string) $value;\n\t\t\t}\n\t\t}\n\n\t\treturn json_encode($ini);\n\t}", "private function LoadConstants()\r\n\t{\r\n\t\t$data_config = $this->LoadData('application/data/appconfig.xml','config');\r\n\t\t\r\n\t\tif(!defined(\"NEW_LINE\"))\r\n\t\t\tdefine(\"NEW_LINE\",\"\\n\");\r\n\t\t\t\r\n\t\tforeach ($data_config AS $elem)\r\n\t\t{\r\n\t\t\tif(!defined(strtoupper('sitename')))\r\n\t\t\t\tdefine(strtoupper('sitename'),$elem->getElementsByTagName('sitename')->item(0)->nodeValue);\r\n\t\t\t\t\r\n\t\t\tif(!defined(strtoupper('tagline')))\r\n\t\t\t\tdefine(strtoupper('tagline'),$elem->getElementsByTagName('tagline')->item(0)->nodeValue);\r\n\t\t\t\t\r\n\t\t\tif(!defined(strtoupper('ownername')))\t\r\n\t\t\t\tdefine(strtoupper('ownername'),$elem->getElementsByTagName('ownername')->item(0)->nodeValue);\r\n\t\t\t\t\r\n\t\t\tif(!defined(strtoupper('owneremail')))\t\r\n\t\t\t\tdefine(strtoupper('owneremail'),$elem->getElementsByTagName('owneremail')->item(0)->nodeValue);\r\n\t\t\t\t\r\n\t\t\tif(!defined(strtoupper('appversion')))\r\n\t\t\t\tdefine(strtoupper('appversion'),$elem->getElementsByTagName('appversion')->item(0)->nodeValue);\r\n\t\t\t\r\n\t\t\t$path = $elem->getElementsByTagName('paths');\r\n\t\t\tif($path->length > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach ($path AS $nested)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!defined(strtoupper('application')))\r\n\t\t\t\t\t\tdefine(strtoupper('application'),$nested->getElementsByTagName('application')->item(0)->nodeValue);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif(!defined(strtoupper('controls')))\r\n\t\t\t\t\t\tdefine(strtoupper('controls'),$nested->getElementsByTagName('controls')->item(0)->nodeValue);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif(!defined(strtoupper('data')))\r\n\t\t\t\t\t\tdefine(strtoupper('data'),$nested->getElementsByTagName('data')->item(0)->nodeValue);\r\n\r\n\t\t\t\t\tif(!defined(strtoupper('templates')))\r\n\t\t\t\t\t\tdefine(strtoupper('templates'),$nested->getElementsByTagName('templates')->item(0)->nodeValue);\r\n\r\n\t\t\t\t\tif(!defined(strtoupper('navigation')))\n\t\t\t\t\t\tdefine(strtoupper('navigation'),$nested->getElementsByTagName('navigation')->item(0)->nodeValue);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!defined(strtoupper('navigationdata')))\n\t\t\t\t\t\tdefine(strtoupper('navigationdata'),$nested->getElementsByTagName('navigationdata')->item(0)->nodeValue);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!defined(strtoupper('modules')))\r\n\t\t\t\t\t\tdefine(strtoupper('modules'),$nested->getElementsByTagName('modules')->item(0)->nodeValue);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tif(!defined(strtoupper('pages')))\r\n\t\t\t\t\t\tdefine(strtoupper('pages'),$nested->getElementsByTagName('pages')->item(0)->nodeValue);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif(!defined(strtoupper('public')))\r\n\t\t\t\t\t\tdefine(strtoupper('public'),$nested->getElementsByTagName('public')->item(0)->nodeValue);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif(!defined(strtoupper('logs')))\r\n\t\t\t\t\t\tdefine(strtoupper('logs'),$nested->getElementsByTagName('logs')->item(0)->nodeValue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tunset($data_config);\r\n\t}", "function get_parse_ini($file)\n{\n if (!is_file($file))\n return false;\n\n $ini = file($file);\n\n // to hold the categories, and within them the entries\n $cats = array();\n\n foreach ($ini as $i) {\n if (@preg_match('/\\[(.+)\\]/', $i, $matches)) {\n $last = $matches[1];\n } elseif (@preg_match('/(.+)=(.+)/', $i, $matches)) {\n $cats[$last][trim($matches[1])] = trim($matches[2]);\n }\n }\n\n return $cats;\n\n}", "public function get_ini_entries() {\n\t\treturn $this->ini_entries;\n\t}", "protected function generateMapFile()\n {\n $namespace = $this->getNamespace();\n $class = $this->options['class'];\n\n $php = <<<EOD\n<?php\n\nnamespace $namespace;\n\nuse $namespace\\\\Base\\\\${class}Map as Base${class}Map;\nuse $namespace\\\\${class};\nuse \\\\Pomm\\\\Exception\\\\Exception;\nuse \\\\Pomm\\\\Query\\\\Where;\n\nclass ${class}Map extends Base${class}Map\n{\n}\n\nEOD;\n\n return $php;\n }", "protected function generate()\n {\n // first of all we will get the version, so we will later know about changes made DURING indexing\n $this->version = $this->findVersion();\n\n // get the iterator over our project files and create a regex iterator to filter what we got\n $recursiveIterator = $this->getProjectIterator();\n $regexIterator = new \\RegexIterator($recursiveIterator, '/^.+\\.php$/i', \\RecursiveRegexIterator::GET_MATCH);\n\n // get the list of enforced files\n $enforcedFiles= $this->getEnforcedFiles();\n\n // if we got namespaces which are omitted from enforcement we have to mark them as such\n $omittedNamespaces = array();\n if ($this->config->hasValue('enforcement/omit')) {\n $omittedNamespaces = $this->config->getValue('enforcement/omit');\n }\n\n // iterator over our project files and add array based structure representations\n foreach ($regexIterator as $file) {\n // get the identifiers if any.\n $identifier = $this->findIdentifier($file[0]);\n\n // if we got an identifier we can build up a new map entry\n if ($identifier !== false) {\n // We need to get our array of needles\n $needles = array(\n Invariant::ANNOTATION,\n Ensures::ANNOTATION,\n Requires::ANNOTATION,\n After::ANNOTATION,\n AfterReturning::ANNOTATION,\n AfterThrowing::ANNOTATION,\n Around::ANNOTATION,\n Before::ANNOTATION,\n Introduce::ANNOTATION,\n Pointcut::ANNOTATION\n );\n\n // If we have to enforce things like @param or @returns, we have to be more sensitive\n if ($this->config->getValue('enforcement/enforce-default-type-safety') === true) {\n $needles[] = '@var';\n $needles[] = '@param';\n $needles[] = '@return';\n }\n\n // check if the file has contracts and if it should be enforced\n $hasAnnotations = $this->findAnnotations($file[0], $needles);\n\n // create the entry\n $this->map[$identifier[1]] = array(\n 'cTime' => filectime($file[0]),\n 'identifier' => $identifier[1],\n 'path' => $file[0],\n 'type' => $identifier[0],\n 'hasAnnotations' => $hasAnnotations,\n 'enforced' => $this->isFileEnforced(\n $file[0],\n $identifier[1],\n $hasAnnotations,\n $enforcedFiles,\n $omittedNamespaces\n )\n );\n }\n }\n\n // save for later reuse.\n $this->save();\n }", "private function generateSiteMapMain()\n {\n $this->load->model('extension/module/siteMapGenerate');\n $output = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $output .= '<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">';\n\n foreach ($this->includedFiles as $file) {\n $removeFromUrl = mb_substr($file, 0, mb_strrpos($file, '/'));;\n $clearFileUrl = str_replace($removeFromUrl . '/', '', $file);\n $output .= '<sitemap>';\n $output .= '<loc>' . $this->siteUrl . $clearFileUrl . '</loc>';\n $output .= '</sitemap>';\n }\n\n $output \t.= '</sitemapindex>';\n $this->response->addHeader('Content-Type: application/xml');\n\n $siteMapXmlUrl = DIR_MAIN . 'sitemap_custom.xml';\n $openedFile = fopen($siteMapXmlUrl, 'w');\n chmod($siteMapXmlUrl, 0775);\n file_put_contents($siteMapXmlUrl, $output);\n fclose($openedFile);\n }", "public function getConfigurationsMap()\n {\n $sel = $this->getAllConfigurations();\n $arr = array();\n foreach ($sel as $cf)\n $arr[$cf->identifier] = $cf->identifier;\n \n return $arr;\n }", "public static function attributeMap();", "protected function register_titles_ini( $ini = self::TITLES_INI )\r\n\t\t{\r\n\t\t\t$this->titles = parse_ini_file( $ini );\r\n\t\t\t\r\n\t\t}", "protected function xmlListenersMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/listener', 'listeners')\n ->loop(true)\n ->attribute('class')\n ->attribute('service')\n ->addChildren(\n Path::factory('param', 'params')\n ->attribute('name')\n ->filter(array($this, 'propertizeString'))\n ->value('value')\n ->loop(true)\n )\n );\n \n return $map;\n }", "function loadIniFiles()\n {\n \n $ff = HTML_FlexyFramework::get();\n $ff->generateDataobjectsCache(true);\n $this->dburl = parse_url($ff->database);\n \n \n $dbini = 'ini_'. basename($this->dburl['path']);\n \n \n $iniCache = isset( $ff->PDO_DataObject) ? $ff->PDO_DataObject['schema_location'] : $ff->DB_DataObject[$dbini];\n if (!file_exists($iniCache)) {\n return;\n }\n \n $this->schema = parse_ini_file($iniCache, true);\n $this->links = parse_ini_file(preg_replace('/\\.ini$/', '.links.ini', $iniCache), true);\n \n\n \n }", "function parseIniFile($iIniFile)\n\t{\n\t\t$aResult =\n\t\t$aMatches = array();\n\t\n\t\t$a = &$aResult;\n\t\t$s = '\\s*([[:alnum:]_\\- \\*]+?)\\s*';\tpreg_match_all('#^\\s*((\\['.$s.'\\])|((\"?)'.$s.'\\\\5\\s*=\\s*(\"?)(.*?)\\\\7))\\s*(;[^\\n]*?)?$#ms', @file_get_contents($iIniFile), $aMatches, PREG_SET_ORDER);\n\t\n\t\tforeach ($aMatches as $aMatch)\n\t\t\t{\n\t\t\tif (empty($aMatch[2]))\n\t\t\t\t\t$a [$aMatch[6]] = $aMatch[8];\n\t\t\t else\t$a = &$aResult [$aMatch[3]];\n\t\t\t}\n\t\n\t\treturn $aResult;\n\t}", "public static function buildTableMap()\n {\n $dbMap = Propel::getServiceContainer()->getDatabaseMap(CKOrderXmlTableMap::DATABASE_NAME);\n if (!$dbMap->hasTable(CKOrderXmlTableMap::TABLE_NAME)) {\n $dbMap->addTableObject(new CKOrderXmlTableMap());\n }\n }", "public static function config($_file) {\n\t\t// Generate hash code for config file\n\t\t$_hash='php.'.self::hashCode($_file);\n\t\t$_cached=Cache::cached($_hash);\n\t\tif ($_cached && filemtime($_file)<$_cached['time'])\n\t\t\t// Retrieve from cache\n\t\t\t$_save=gzinflate(Cache::fetch($_hash));\n\t\telse {\n\t\t\tif (!file_exists($_file)) {\n\t\t\t\t// .ini file not found\n\t\t\t\tself::$global['CONTEXT']=$_file;\n\t\t\t\ttrigger_error(self::TEXT_Config);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Map sections to framework methods\n\t\t\t$_map=array('global'=>'set','routes'=>'route','maps'=>'map');\n\t\t\t// Read the .ini file\n\t\t\tpreg_match_all(\n\t\t\t\t'/\\s*(?:\\[(.+?)\\]|(?:;.+?)*|(?:([^=]+)=(.+?)))(?:\\v|$)/s',\n\t\t\t\t\tfile_get_contents($_file),$_matches,PREG_SET_ORDER\n\t\t\t);\n\t\t\t$_cfg=array();\n\t\t\t$_ptr=&$_cfg;\n\t\t\tforeach ($_matches as $_match) {\n\t\t\t\tif ($_match[1]) {\n\t\t\t\t\t// Section header\n\t\t\t\t\tif (!isset($_map[$_match[1]])) {\n\t\t\t\t\t\t// Unknown section\n\t\t\t\t\t\tself::$global['CONTEXT']=$_section;\n\t\t\t\t\t\ttrigger_error(self::TEXT_Section);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$_ptr=&$_cfg[$_match[1]];\n\t\t\t\t}\n\t\t\t\telseif ($_match[2]) {\n\t\t\t\t\t$_csv=array_map(\n\t\t\t\t\t\tfunction($_val) {\n\t\t\t\t\t\t\t// Typecast if necessary\n\t\t\t\t\t\t\treturn is_numeric($_val) ||\n\t\t\t\t\t\t\t\tpreg_match('/^(TRUE|FALSE)\\b/i',$_val)?\n\t\t\t\t\t\t\t\t\teval('return '.$_val.';'):$_val;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tstr_getcsv($_match[3])\n\t\t\t\t\t);\n\t\t\t\t\t// Convert comma-separated values to array\n\t\t\t\t\t$_match[3]=count($_csv)>1?$_csv:$_csv[0];\n\t\t\t\t\tif (preg_match('/(.+?)\\[(.*?)\\]/',$_match[2],$_sub)) {\n\t\t\t\t\t\tif ($_sub[2])\n\t\t\t\t\t\t\t// Associative array\n\t\t\t\t\t\t\t$_ptr[$_sub[1]][$_sub[2]]=$_match[3];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t// Numeric-indexed array\n\t\t\t\t\t\t\t$_ptr[$_sub[1]][]=$_match[3];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t// Key-value pair\n\t\t\t\t\t\t$_ptr[$_match[2]]=$_match[3];\n\t\t\t\t}\n\t\t\t}\n\t\t\tob_start();\n\t\t\tforeach ($_cfg as $_section=>$_pair) {\n\t\t\t\t$_func=$_map[$_section];\n\t\t\t\tforeach ($_pair as $_key=>$_val)\n\t\t\t\t\t// Generate PHP snippet\n\t\t\t\t\techo 'F3::'.$_func.'('.\n\t\t\t\t\t\tvar_export($_key,TRUE).','.\n\t\t\t\t\t\t($_func=='set' || !is_array($_val)?\n\t\t\t\t\t\t\tvar_export($_val,TRUE):self::listArgs($_val)).\n\t\t\t\t\t');'.\"\\n\";\n\t\t\t}\n\t\t\t$_save=ob_get_contents();\n\t\t\tob_end_clean();\n\t\t\t// Compress and save to cache\n\t\t\tCache::store($_hash,gzdeflate($_save));\n\t\t}\n\t\t// Execute cached PHP code\n\t\teval($_save);\n\t\tif (self::$global['ERROR'])\n\t\t\t// Remove from cache\n\t\t\tCache::remove($_hash);\n\t}", "private function configuration() {\n\n $f = \"includes/expr.ini\";\n\n return parse_ini_file($f);\n\n }", "public function generateMap()\n {\n try\n {\n // Select all published articles and pages.\n // Lessons and other new stuff to be added upon needed.\n $pgs = ORM::factory( 'Page' )\n ->where( 'status', '>', 0 )\n ->find_all()->as_array();\n\n $articles = ORM::factory( 'Article' )\n ->where( 'status', '>', 0 )\n ->find_all()->as_array();\n \n // Place found URLs into the container array.\n $pages = [];\n foreach ( array_merge( $pgs, $articles ) as $value )\n array_push ( $pages, $value->make_full_url () );\n \n // Select whatever is already in the map...\n $urls = [];\n foreach ( $this->map->children() as $node )\n $urls[] = ( string )$node->loc;\n\n // Delete redundant links\n foreach ( array_diff( $urls, $pages ) as $url )\n $this->removeEntry( $url, FALSE, TRUE );\n\n // Add missing links.\n foreach ( array_diff( $pages, $urls ) as $uri )\n $this->addEntry ( $uri, NULL, FALSE, TRUE );\n\n // Save result into the file.\n return $this->save();\n }\n catch ( Exception $e )\n {\n Kohana::$log->add( LOG_ERR, $e->getMessage() );\n return FALSE;\n }\n }", "public function loadXml($filename,$map_path){\r\n \r\n $this->rootPath = $this->_preparePath($map_path);\r\n \r\n if(!File::exists( $this->rootPath .DS. $filename ))\r\n App::critical_error ('XML document not found: '.$this->rootPath .DS. $filename);\r\n \r\n $xmlDoc = $this->_initDocument($this->rootPath .DS. $filename);\r\n \r\n //get the project elements\r\n $elements = $xmlDoc->getElementsByTagName('element');\r\n \r\n foreach($elements as $element){\r\n \r\n if(count($this->elements) == 0 ){\r\n $this->elements = $this->_loadElement($element);\r\n }\r\n else{\r\n $this->elements = array_merge($this->elements,$this->_loadElement($element));\r\n }\r\n }\r\n \r\n //isolate the template key\r\n if(!is_null($this->_templatekey) && !is_null($this->elements[$this->_templatekey]))\r\n $this->elements['templates'] = $this->elements[$this->_templatekey];\r\n \r\n //clean the element values\r\n //array_walk_recursive($this->element, array($this, '_clean'));\r\n \r\n return File::put(APP_PROJECT .DS. 'elements.php' ,serialize($this->elements)); \r\n }", "function c_ini_data($filename,$process_sections=false)\r\n {\r\n\r\n if (file_exists($filename))\r\n {\r\n $output = parse_ini_file($filename,$process_sections);\r\n return (array) $output;\r\n }\r\n else\r\n {\r\n trigger_error($filename.' configuration file not found.');\r\n }\r\n\r\n }", "public function buildAutoloadInformationFiles() {}", "public function load_maps_file()\r\n {\r\n log_message('debug', 'Reloading '. XML_MAPS_FILE .' file from manaserv');\r\n\r\n // load the configured path and filename from config file\r\n $this->maps_file = $this->CI->config->item('manaserv-data_path') . XML_MAPS_FILE;\r\n\r\n // check if the file really exists and is readable\r\n if (!file_exists($this->maps_file))\r\n {\r\n show_error('The '. XML_MAPS_FILE .' file ' . $this->maps_file . ' configured'.\r\n ' in mana_config.php cannot be found');\r\n return;\r\n }\r\n else\r\n {\r\n // reset current maps\r\n $this->maps = array();\r\n\r\n // load and parse the xml file\r\n $maps = simplexml_load_file($this->maps_file);\r\n foreach ($maps as $map)\r\n {\r\n // loop through defined maps and build internal array\r\n $m = new Map(\r\n intval($map->attributes()->id), // id\r\n strval($map->attributes()->name) // name\r\n );\r\n\r\n // set description if available\r\n if (strlen(strval($map->attributes()->description)) > 0)\r\n {\r\n $m->setDescription(strval($map->attributes()->description));\r\n }\r\n\r\n $this->maps[$m->getId()] = $m;\r\n }\r\n\r\n $this->flush_maps();\r\n }\r\n log_message('debug', 'Reloading '. XML_MAPS_FILE .' file ... done');\r\n }", "function build_keypairs($files) {\n $keypairs = array();\n foreach ($files as $type => $classes) {\n foreach ($classes as $classname => $classfiles) {\n foreach ($classfiles as $filename => $values) {\n $keypairs[$values['key']] = $values['actual'];\n }\n }\n }\n return $keypairs;\n }", "function GetMapContent($hide_mode_ids) {\n\tglobal $config;\n\n\t$lang = GetLangContent(\"map\");\n\n\t$map = array();\n\tif (file_exists($config[\"site_path\"].\"/include/map.xml\")) {\n\t\t$xml_parser = new SimpleXmlParser( $config[\"site_path\"].\"/include/map.xml\" );\n\t\t$xml_root = $xml_parser->getRoot();\n\n\t\tforeach ( $xml_root->children as $cnt => $xml_section ) {\n\t\t\tif (!isset($xml_section->attrs[\"id\"]) || (isset($xml_section->attrs[\"id\"]) && !in_array($xml_section->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t$section = array();\n\t\t\t\t$section = array(\"name\" => (isset($lang[$xml_section->attrs[\"name\"]]) ? $lang[$xml_section->attrs[\"name\"]] : $xml_section->attrs[\"name\"]), \"link\" => $xml_section->attrs[\"link\"]);\n\t\t\t\tif ($xml_section->children) {\n\t\t\t\t\tforeach ( $xml_section->children as $xml_subsection_cnt => $xml_subsection ) {\n\t\t\t\t\t\tif (!isset($xml_subsection->attrs[\"id\"]) || (isset($xml_subsection->attrs[\"id\"]) && !in_array($xml_subsection->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t\t\t\t$subsection = array();\n\t\t\t\t\t\t\t$subsection[\"name\"] = (isset($lang[$xml_subsection->attrs[\"name\"]]) ? $lang[$xml_subsection->attrs[\"name\"]] : $xml_subsection->attrs[\"name\"]);\n\t\t\t\t\t\t\t$subsection[\"link\"] = $xml_subsection->attrs[\"link\"];\n\t\t\t\t\t\t\tif ($xml_subsection->children) {\n\t\t\t\t\t\t\t\t$item = array();\n\t\t\t\t\t\t\t\tforeach ( $xml_subsection->children as $xml_item_cnt => $xml_item ) {\n\t\t\t\t\t\t\t\t\tif (!isset($xml_item->attrs[\"id\"]) || (isset($xml_item->attrs[\"id\"]) && !in_array($xml_item->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t\t\t\t\t\t\t$item[] = array(\"name\" => (isset($lang[$xml_item->attrs[\"name\"]]) ? $lang[$xml_item->attrs[\"name\"]] : $xml_item->attrs[\"name\"]), \"link\" => $xml_item->attrs[\"link\"]);\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\t$subsection[\"subsection\"] = $item;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$section[\"subsection\"][] = $subsection;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$map[] = $section;\n\t\t\t}\n\t\t}\n\t}\n\treturn $map;\n}", "function initialiseRecord() { //{{{\n global $map;\n \n $record = array();\n \n foreach (array_keys($map) as $tag) {\n $record[$tag] = array();\n }\n \n return $record;\n}", "private function initVarConfMap()\n {\n\n // Set the global $confMapLocal\n switch ( true )\n {\n case( isset( $this->conf_view[ 'navigation.' ][ 'map.' ] ) ):\n // local configuration\n $this->confMap = $this->conf_view[ 'navigation.' ][ 'map.' ];\n if ( $this->pObj->b_drs_map )\n {\n $prompt = 'Local configuration in: views.' . $this->conf_path . '.navigation.map';\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n break;\n // local configuration\n default:\n // global configuration\n $this->confMap = $this->pObj->conf[ 'navigation.' ][ 'map.' ];\n if ( $this->pObj->b_drs_map )\n {\n $prompt = 'Global configuration in: navigation.map';\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n break;\n // global configuration\n }\n // Set the global $confMapLocal\n//var_dump(__METHOD__, __LINE__, array_keys($this->confMap));\n\n return;\n }", "public function build_root_map() {\n\t\t$links = [];\n\t\tforeach ( $this->providers as $provider ) {\n\t\t\t$links = array_merge( $links, $provider->get_index_links( $this->max_entries ) );\n\t\t}\n\n\t\tif ( empty( $links ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $this->get_index( $links );\n\t}", "private function ParseFile() {\r\n\t\t$this->ini_array = parse_ini_file($this->$results_file, true); //Load the results into a array //\r\n\t}", "private function genSitemapXML() {\n $url_same = array();\n $sitemap_xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\" xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\">\n <!-- created by CSZ CMS Sitemap Generator www.cszcms.com -->'.\"\\n\";\n $sitemap_xml.= '<url>\n\t<loc>'.base_url().'</loc>\n\t<changefreq>always</changefreq>\n </url>'.\"\\n\";\n if($this->lang !== FALSE){ /* Language */\n foreach ($this->lang as $row) {\n $url = $this->Csz_model->base_link().'/lang/'.$row['lang_iso'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n if($this->menu_other !== FALSE){ /* Navigation */\n foreach ($this->menu_other as $row) {\n $chkotherlink = strpos($row['other_link'], BASE_URL);\n if($row['pages_id'] && $row['pages_id'] != NULL && $row['pages_id'] != 0){\n $pages = $this->Csz_model->getValue('page_url', 'pages', \"active = '1' AND pages_id = '\".$row['pages_id'].\"'\", '', 1, 'page_url', 'ASC'); \n if($row['drop_page_menu_id'] != 0 && $row['drop_page_menu_id'] != NULL){\n $main = $this->Csz_model->getValue('menu_name', 'page_menu', \"active = '1' AND page_menu_id = '\".$row['drop_page_menu_id'].\"'\", '', 1, 'menu_name', 'ASC'); \n $url = $this->Csz_model->base_link().'/'.$this->Csz_model->rw_link($main->menu_name).'/'.$pages->page_url;\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }else{\n $url = $this->Csz_model->base_link().'/'.$pages->page_url;\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }else if($row['other_link'] && $row['other_link'] != NULL && $chkotherlink !== FALSE){ \n if(!in_array($row['other_link'], $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$row['other_link'].'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $row['other_link'];\n }\n }else if($row['plugin_menu'] && $row['plugin_menu'] != NULL){\n $url = $this->Csz_model->base_link().'/plugin/'.$row['plugin_menu'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n }\n if($this->pages_content !== FALSE){ /* Pages Content without navigation */\n foreach ($this->pages_content as $row) {\n $url = $this->Csz_model->base_link().'/'.$row['page_url'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n if($this->plugin !== FALSE){ /* Plugin with sitemap config */\n foreach ($this->plugin as $row) {\n $plugin_db = $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sitemap_viewtable');\n if(!empty($plugin_db)){\n $plugindata = $this->Csz_model->getValueArray('*', $plugin_db, $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sqlextra_condition'), '', 0, $plugin_db.'_id', 'DESC');\n if($plugindata !== FALSE){\n foreach ($plugindata as $rs) {\n $url = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/view/'.$rs[$plugin_db.'_id'].'/'.$rs['url_rewrite'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n if($row['plugin_config_filename'] == 'article'){\n $urlamp = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/amp/'.$rs[$plugin_db.'_id'].'/'.$rs['url_rewrite'];\n if(!in_array($urlamp, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$urlamp.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $urlamp;\n }\n }\n }\n }\n }\n $plugin_cat_db = $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sitemap_cattable');\n if(!empty($plugin_cat_db)){\n $plugindata = $this->Csz_model->getValueArray('*', $plugin_cat_db, $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sqlextra_catcondition'), '', 0, $plugin_cat_db.'_id', 'DESC');\n if($plugindata !== FALSE){\n foreach ($plugindata as $rs) {\n $url = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/category/'.$rs['url_rewrite'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n }\n } \n }\n $sitemap_xml.= '</urlset>'.\"\\n\";\n if($sitemap_xml){\n /* Gen sitemap.xml */\n $file_path = FCPATH.\"sitemap.xml\";\n $fopen = fopen($file_path, 'wb') or die(\"can't open file\");\n fwrite($fopen, $sitemap_xml);\n fclose($fopen);\n /* Gen sitemap.xml.gz */\n $gzdata = @gzencode($sitemap_xml, 9);\n if($gzdata !== FALSE){\n $fopen1 = fopen(FCPATH.\"sitemap.xml.gz\", 'wb') or die(\"can't open file\");\n fwrite($fopen1, $gzdata);\n fclose($fopen1);\n }\n\t}\n }", "private function loadIni(){\n if(file_exists($this->fullPath.$this->iniFile)) {\n $arCfg = parse_ini_file($this->fullPath.$this->iniFile);\n $this->loadConfigs($arCfg);\n }\n }", "function si_custom_elements_icon_map( $icon_map ) {\n\t\t$icon_map['si_custom_elements'] = EXTENSION_URL . '/assets/svg/icons.svg';\n\t\treturn $icon_map;\n\t}", "public function map() {\n\t\treturn array(\n\t\t\t'name' => esc_html__( 'Image Grid', 'total-theme-core' ),\n\t\t\t'description' => esc_html__( 'Responsive image gallery', 'total-theme-core' ),\n\t\t\t'base' => 'vcex_image_grid',\n\t\t\t'icon' => 'vcex_element-icon vcex_element-icon--image-gallery',\n\t\t\t'admin_enqueue_js' => vcex_wpbakery_asset_url( 'js/backend-editor/vcex-image-gallery-view.min.js' ),\n\t\t\t'js_view' => 'vcexBackendViewImageGallery',\n\t\t\t'category' => vcex_shortcodes_branding(),\n\t\t\t'params' => Shortcode::get_params(),\n\t\t);\n\t}", "public static function parse_ini_file_extended($filename) {\r\n $p_ini = parse_ini_file($filename, true);\r\n $config = array();\r\n foreach($p_ini as $namespace => $properties){\r\n list($name, $extends) = explode(':', $namespace);\r\n $name = trim($name);\r\n $extends = trim($extends);\r\n // create namespace if necessary\r\n if(!isset($config[$name])) $config[$name] = array();\r\n // inherit base namespace\r\n if(isset($p_ini[$extends])){\r\n foreach($p_ini[$extends] as $prop => $val)\r\n $config[$name][$prop] = $val;\r\n }\r\n // overwrite / set current namespace values\r\n foreach($properties as $prop => $val)\r\n $config[$name][$prop] = $val;\r\n }\r\n return $config;\r\n }", "public function buildTaskMap(){\n\t\t$loadWebPageTask = DataClassLoader::createInstance('Modules.Website.Tasks.LoadStaticPage');\n\t\t$this->tasks['LoadWebsitePage'] = $loadWebPageTask;\n\t\t\n\t\t$this->taskMap['Inputs'][] = array('Enabled'=>'LoadWebsitePage.Enabled');\n\t\t$this->taskMap['Inputs'][] = array('Domain'=>'LoadWebsitePage.Domain');\n\t\t$this->taskMap['Inputs'][] = array('PagePath'=>'LoadWebsitePage.PagePath');\n\t\t\n\t\t//$showPageTask = DataClassLoader::createInstance('Modules.Website.Tasks.ShowPage');\n\t\t//$this->tasks['ShowWebPage'] = $showPageTask;\n\t\t\n\t\t\n\t\t//build the output HTML Task\n\t\t$outputHTMLTask = DataClassLoader::createInstance('Modules.Website.Tasks.SendHTMLResponse');\n\t\t$this->tasks['OutputHTML'] = $outputHTMLTask;\n\t\t\n\t\t$this->taskMap['LoadWebsitePage'][] = array('PageLoaded'=>'OutputHTML.Enabled');\n\t\t$this->taskMap['LoadWebsitePage'][] = array('WebsitePage.PageHTML'=>'OutputHTML.HTMLString');\n\t\t\n\t}", "function init_accessMap(){\n\t$map = array(\n\t\t/* user */\n\t\t'user.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'user.get_others' => array('root', 'admin'),\n\n\t\t/* logs */\n\t\t'logs.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'logs.get_others' => array('root', 'admin'),\n\n\t\t/* site */\n\t\t'site.add' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.get_others' => array('root', 'admin'),\n\t\t'site.update' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.update_others' => array('root', 'admin'),\n\t\t'site.remove' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.remove_others' => array('root', 'admin'),\n\n\t\t/* pattern */\n\t\t'pattern.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'pattern.get_others' => array('root', 'admin'),\n\t\t'pattern.add' => array('root', 'admin', 'developer', 'normal'),\n\t\t'pattern.remove' => array('root', 'admin', 'developer', 'normal'),\n\t\t'pattern.remove_others' => array('root', 'admin'),\n\n\t\t/* count data */\n\t\t'count.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'count.get_others' => array('root', 'admin'),\n\n\t\t/* ucenter entry show control */\n\t\t'ucenter.home' => array('root', 'admin', 'developer', 'normal'),\n\t\t'ucenter.sites' => array('root', 'admin', 'developer', 'normal'),\n\t\t'ucenter.logs' => array('root', 'admin', 'developer', 'normal'),\n\t\t'ucenter.logs_all' => array('root', 'admin'),\n\t\t'ucenter.sites_all' => array('root', 'admin'),\n\t\t'ucenter.visitors' => array('root', 'admin'),\n\t);\n\tAccessController::setMap($map);\n}", "private function addHeaderToStaticMap()\n {\n HeaderLoader::addStaticMap(\n [\n 'xmagentotags' => XMagentoTags::class,\n ]\n );\n }", "protected function _resourceMap()\n\t{\n\t\t$resourceMap = new \\ResourceMapGenerator();\n\t\t$id = '';\n\n\t\t// Retrieves the ID from alias\n\t\tif (substr(strtolower($this->_alias), -4) == '.rdf')\n\t\t{\n\t\t\t$lastSlash = strrpos($this->_alias, '/');\n\t\t\t$lastDot = strrpos($this->_alias, '.rdf');\n\t\t\t$id = substr($this->_alias, $lastSlash, $lastDot);\n\t\t}\n\n\t\t// Create download headers\n\t\t$resourceMap->pushDownload($this->config->get('webpath'));\n\t\texit;\n\t}", "public function mapClasses() {\n // TODO: this is needed when the class map is not created yet (i.e. at very first install).\n if (!is_dir($this->dir['tmp'])) {\n mkdir($this->dir['tmp']);\n }\n $fop = fopen(CLASS_MAP_FILE, 'w+');\n\n foreach ($this->modules_loaded as $module) {\n $autoload_paths = array('Common', 'Qtags');\n foreach ($autoload_paths as $autoload_path) {\n $full_autoload_path = $module['path'] . '/classes/' . $autoload_path;\n /**\n * Autoload module's qtags.\n */\n if (is_dir($full_autoload_path)) {\n $classes = $this->scanDirectory($full_autoload_path);\n foreach ($classes as $class) {\n // Parse the Qtag.\n $exp1 = explode('/', $class);\n $exp2 = explode('.', $exp1[count($exp1) - 1]);\n $item_name = $exp2[0];\n $this->class_map[$autoload_path][$item_name] = $full_autoload_path . '/' . $class;\n }\n }\n }\n }\n fwrite($fop, serialize($this->class_map));\n fclose($fop);\n }", "function buildMainMap()\r\n{\r\n\r\n // Add an image first for debug and change asap\r\n //$final_map = \"\r\n//<img class=\\\"main_map\\\" src=\\\"images/heatmapapi.png\\\" />\" ;\r\n\r\n $final_map = \"\r\n<div id=\\\"map\\\"></div>\" ;\r\n\r\n return $final_map ;\r\n}", "public function __construct($iniPath)\n {\n $confData = parse_ini_file($iniPath, true);\n\n foreach ($confData as $sectionName => $sectionValue) {\n foreach ($sectionValue as $name => $value) {\n $this->set($value, $sectionName, $name);\n }\n }\n }", "function __construct(){\n\t\t//$this->_array = $this->_file->_array;\n $this->_file = new xml_filehandle(\"./include/Settings/\",\"settings.xml\");\n foreach($this->_file->_array as $arrVal)\n {\n $this->_array[$arrVal['id']] = $arrVal;\n }\n\t}", "private function parseConfig(){\n\t\t\treturn parse_ini_file(BASE_PATH . 'config' . DIRECTORY_SEPARATOR . 'config.ini');\n\t\t}", "public static function parse($filename)\n\t{\n\t\ttry {\n\t\t\t$loaded = parse_ini_file($filename, true);\n\t\t} catch (Exception $e) {\n\t\t\trequire_once 'Syx/Config/Exception.php';\n\t\t\tthrow new Syx_Config_Exception($e->getMessage());\n\t\t}\n\n\t\t$iniArray = array();\n\t\tforeach ($loaded as $section => $data) {\n\t\t\tif (!is_array($data)) {\n\t\t\t\t$iniArray = array_merge_recursive($iniArray, self::_processKey(array(), $section, $data));\n\t\t\t} else {\n\t\t\t\t$config = array();\n\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\t$config = self::_processKey($config, $key, $value);\n\t\t\t\t}\n\t\t\t\t$iniArray[$section] = $config;\n\t\t\t}\n\t\t}\n\n\t\treturn $iniArray;\n\t}", "public function getConfMap()\n {\n return $this->confMap;\n }", "private function globals() {\n global $pagesArray;\n \n $xml = XML2Array::createArray(file_get_contents(GSDATAOTHERPATH.'website.xml'));\n \n // turn PRETTYURLS into boolean\n if ($xml['item']['PRETTYURLS']=='') $xml['item']['PRETTYURLS'] = false;\n else $xml['item']['PRETTYURLS'] = true;\n \n // globals array\n $globals = array(\n 'sitename' => $xml['item']['SITENAME']['@cdata'],\n 'siteurl' => $xml['item']['SITEURL']['@cdata'],\n 'template' => $xml['item']['TEMPLATE']['@cdata'],\n 'pages' => $pagesArray,\n 'permalink' => $xml['item']['PERMALINK'],\n 'prettyurls' => $xml['item']['PRETTYURLS'],\n );\n return $globals;\n }", "public function initMap()\n\t{\n\t\t$params =array();\n\t\t$this->add_VcMap($params);\n\t}", "public static function getMap()\n\t{\n\t\treturn [\n\t\t\tnew Main\\Entity\\IntegerField('TEMPLATE_ID', [\n\t\t\t\t'primary' => true,\n\t\t\t]),\n\t\t\tnew Main\\Entity\\StringField('PROVIDER', [\n\t\t\t\t'primary' => true,\n\t\t\t]),\n\t\t\tnew Main\\Entity\\ReferenceField('TEMPLATE', '\\Bitrix\\DocumentGenerator\\Model\\Template',\n\t\t\t\t['=this.TEMPLATE_ID' => 'ref.ID']\n\t\t\t),\n\t\t];\n\t}", "public static function generateClassFileMap($cache_file) {\n self::$reloaded = true;\n\n if (!self::$dirs) {\n self::initDirs();\n }\n\n $mapping = array();\n foreach (self::$dirs as $dir => $style) {\n // TODO: ignore .svn etc directories\n // RecursiveDirectoryIterator::FOLLOW_SYMLINKS == 0x00000200 was only added in 5.3.1\n $objects = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($dir,0x00000200),\n RecursiveIteratorIterator::SELF_FIRST\n );\n\n foreach($objects as $file => $object) {\n if (substr($file, -4) !== '.php') {\n continue;\n }\n\n $file = strtr($file, '\\\\', '/');\n if ($style === 'symfony') {\n $class = basename($file, '.php');\n $class = basename($class, '.class');\n } else {\n $class = str_replace('.php', '', $file);\n $class = str_replace(strtr($dir, '\\\\', '/').'/', '', $class);\n $class = str_replace('/', '_', $class);\n }\n\n $content = file_get_contents($file);\n if (stripos($content, 'class '.$class) !== false\n || stripos($content, 'interface '.$class) !== false\n ) {\n $mapping[$class] = $file;\n }\n }\n }\n\n if (empty($mapping)) {\n $mapping = false;\n }\n\n if (self::$cache) {\n $mappingstring = '<?php return '. var_export($mapping, true).';';\n file_put_contents($cache_file, $mappingstring);\n }\n\n return $mapping;\n }", "public function getDocStructure()\n {\n\n $xml_string = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\">';\n $xml_string .= '</urlset>';\n\n return $xml_string;\n\n }", "function Sitemap() {\n $time = FormatTime('Y-m-d', time());\n $url = SYSTEM::get('url');\n $modules = SYSTEM::get('modules');\n $enabled = CONFIG::getSection('enabled');\n $sitemap = SYSTEM::get('sitemap');\n $site_map =\n \"<\\x3Fxml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"\\x3F>\".LF.\n \"<urlset xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\".LF.\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=index</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t\\t<priority>0.8</priority>\".LF.\n \"\\t</url>\".LF;\n foreach ($modules as $module => $data) {\n if (in_array($module, $sitemap) && array_key_exists($module, $enabled)) {\n $gsm = '';\n $obj = strtoupper($module);\n $sections = CMS::call($obj)->getSections();\n unset($sections['drafts']);\n\n foreach ($sections as $id => $section) {\n $categories = CMS::call($obj)->getCategories($id);\n if (!empty($categories)) {\n $gsm .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.SECTION.$id.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t</url>\".LF;\n foreach ($categories as $key => $category) {\n $category = CMS::call($obj)->getCategory($key);\n $content = CMS::call($obj)->getContent($key);\n if (!empty($content)) {\n $gsm .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.SECTION.$id.CATEGORY.$key.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t</url>\".LF;\n foreach ($content as $i => $item) {\n $gsm .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.SECTION.$id.CATEGORY.$key.ITEM.$i.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".FormatTime('Y-m-d', $item['time']).\"</lastmod>\".LF.\n \"\\t</url>\".LF;\n }\n }\n }\n }\n }\n if (!empty($gsm)) {\n $site_map .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t</url>\".LF.$gsm;\n }\n }\n }\n $site_map .= \"</urlset>\";\n if (!file_put_contents(ROOT.'sitemap.xml', $site_map, LOCK_EX)) {\n CMS::call('LOG')->logPut('Error', '', 'Cannot save file sitemap.xml');\n }\n return CMS::call('SYSTEM')->createMainMenu();\n}", "function parse_ini_string($ini, $process_sections = false, $scanner_mode = null){\n\t\t$tempname = tempnam(sys_get_temp_dir(), 'ini');\n\t\t$fp = fopen($tempname, 'w');\n\t\tfwrite($fp, $ini);\n\t\t$ini = parse_ini_file($tempname, !empty($process_sections));\n\t\tfclose($fp);\n\t\t@unlink($tempname);\n\t\treturn $ini;\n\t}", "public function generateClassMap()\n {\n $classMap = array();\n foreach ($this->classMapDirs as $dir) {\n $dir = $this->baseDir . '/' . $dir;\n foreach (ClassMapGenerator::createMap($dir) as $class => $path) {\n $classMap[$class] = $this->getRelativePath($path);\n }\n }\n return $classMap;\n }", "function initMap() {\n\n\t\t// Instantiate the xajax object and configure it\n\t\trequire_once (t3lib_extMgm::extPath('xajax') . 'class.tx_xajax.php');\n\t\t$this->xajax = t3lib_div::makeInstance('tx_xajax'); // Make the instance\n\t\tif ($GLOBALS['TSFE']->metaCharset == 'utf-8') {\n\t\t\t$this->xajax->decodeUTF8InputOn(); // Decode form vars from utf8\n\t\t}\n\t\t$this->xajax->setCharEncoding($GLOBALS['TSFE']->metaCharset); \t\t// Encode of the response to utf-8 ???\n\t\t$this->xajax->setWrapperPrefix($this->prefixId); \t\t// To prevent conflicts, prepend the extension prefix\n\t\t$this->xajax->statusMessagesOn(); \t\t// Do you wnat messages in the status bar?\n\n\t\t// register the functions of the ajax requests\n\t\t$this->xajax->registerFunction(array('infomsg', &$this, 'ajaxGetInfomsg'));\n\t\t$this->xajax->registerFunction(array('activeRecords', &$this, 'ajaxGetActiveRecords'));\n\t\t$this->xajax->registerFunction(array('processCat', &$this, 'ajaxProcessCat'));\n\t\t$this->xajax->registerFunction(array('tab', &$this, 'ajaxGetPoiTab'));\n\t\t$this->xajax->registerFunction(array('search', &$this, 'ajaxSearch'));\n\t\t$this->xajax->registerFunction(array('processCatTree', &$this, 'ajaxProcessCatTree'));\n\t\t$this->xajax->registerFunction(array('getDynamicList', &$this, 'ajaxGetDynamicList'));\n\n\t\t$this->xajax->processRequests();\n\n\t\t// additional output using a template\n\t\t$template['total'] = $this->cObj2->getSubpart($this->templateCode,'###HEADER###');\n\t\t$markerArray = $subpartArray = array();\n\t\t$markerArray['###PATH###'] = t3lib_extMgm::siteRelpath('rggooglemap');\n\n\t\tif ($this->conf['map.']['addLanguage'] == 1) {\n\t\t\tif ($this->conf['map.']['addLanguage.']['override'] != '') {\n\t\t\t\t$markerArray['###MAP_KEY###'] .= '&hl=' . $this->conf['map.']['addLanguage.']['override'];\n\t\t\t} elseif ($GLOBALS['TSFE']->lang != '') {\n\t\t\t\t$markerArray['###MAP_KEY###'] .= '&hl=' . $GLOBALS['TSFE']->lang;\n\t\t\t}\n\t\t}\n\n\t\t$markerArray['###DYNAMIC_JS###'] = $this->getJs();\n\n\t\t// load spefic files if needed for clustering\n\t\tif ($this->conf['map.']['activateCluster'] == 1) { // gxmarkers\n\t\t\t$subpartArray['###CLUSTER_2###'] = '';\n\n\t\t} elseif ($this->conf['map.']['activateCluster'] == 2) { // markerclusterer\n\t\t\t$subpartArray['###CLUSTER_1###'] = '';\n\t\t} else { // no clustering\n\t\t\t$subpartArray['###CLUSTER_1###'] = $subpartArray['###CLUSTER_2###'] = '';\n\t\t}\n\n\t\t$totalJS = $this->cObj2->substituteMarkerArrayCached($template['total'],$markerArray, $subpartArray);\n\t\t$GLOBALS['TSFE']->additionalHeaderData['rggooglemap_xajax'] = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('xajax'));\n\t\t$GLOBALS['TSFE']->additionalHeaderData['rggooglemap_js'] = $totalJS;\n\t}", "function init($url=null) {\r\n $yamlSrce = file_get_contents($url ? $url : 'defaultmap.yaml');\r\n if (!($map = yaml_parse($yamlSrce))) {\r\n header('Content-Type: text/plain; charset=UTF-8');\r\n die();\r\n }\r\n if (!isset($map['uniqid']))\r\n $map['uniqid'] = uniqid('map',true);\r\n return $map;\r\n}", "protected function addIndex()\n {\n $sitemapIndexHeader = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n . ($this->includeGeneratorInfo ? $this::$generatorInfo : '')\n . '<sitemapindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"'\n . ' xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9'\n . ' http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd\"'\n . ' xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">'\n . '</sitemapindex>';\n $this->indexes[] = [\n 'xml' => new \\SimpleXMLElement($sitemapIndexHeader),\n 'filename' => '',\n ];\n }", "public static function load($mapName)\n {\n\n foreach (Conf::$confPath as $path) {\n\n if (!$this->source)\n $menuPath = $path.'/menu/'.$this->name.'/';\n else\n $menuPath = $path.'/menu/'.$this->source.'/';\n\n if (!file_exists($menuPath))\n continue;\n\n $folder = new LibFilesystemFolder($menuPath);\n\n foreach ($folder->getFiles() as $file)\n include $file->getName(true);\n\n // break after found data\n break;\n }\n\n }", "function __construct() {\r\n\t\t$this->ini = eZINI::instance(\"bfeztag_metadata.ini\");\r\n\t}", "protected function _initConfigs()\n {\n $registry = Zend_Registry::getInstance();\n \n $configs = array('config');\n \n foreach($configs AS $name) {\n $config = new Zend_Config_Ini(\n APPLICATION_PATH . '/configs/' . $name . '.ini',\n APPLICATION_ENV\n );\n $registry->set('config.' . $name, $config);\n }\n }", "function iniread() {\n\n\t $ini = $this->gtk_path . \"webos.ini\"; \n\t \n\t if (file_exists($ini)) {\n\t \n if ($fp = fopen ($ini , \"r\")) {\n $data = fread ($fp, filesize($ini));\n fclose ($fp);\n\t }\t \t \n \n\t\t if ($data) {\t \n \t\t $sets = explode(\"<@>\",$data);\n\t\t $myini = unserialize($sets[0]);\n\t\t }\n\t\t else {\n\t\t $myini = array();\n\t\t }\n\t //print_r($myini);\t\t \n\t\t //$this->console->write(\"Reading ini settings successfully.\");\t\t\t\t \n\t\t return ($myini);\n\t }\n\t else {\n\t\t //$this->console->write(\"Ini setting NOT readed !!!\");\t\t\n\t\t return (false);\n\t\t}\t\n\t}", "public function generateMap()\n {\n $map = array();\n $database = $this->binding->getDatabase()->getData();\n\n foreach ($database->classes as $class) {\n $map[$class->name] = $class->clusters;\n }\n\n $this->map = $map;\n $this->cache->save($this->getCacheKey(), $map);\n }", "function webmap_compo_lib_xml_build()\r\n{\r\n\t$this->webmap_compo_lib_xml_base();\r\n}", "protected function xmlActionMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/actions/action', 'actions')\n ->loop(true, '@name')\n ->attribute('class')\n ->attribute('method')\n ->attribute('shortcut')\n );\n \n return $map;\n }", "static function xmlList()\n\t{\n\t\treturn simplexml_load_file('http://ws.geonames.org/countryInfo');\n\t}", "protected function _initSetConstants() {\n // Them file cau hinh cac hang so su dung trong project\n $config = parse_ini_file(APPLICATION_PATH . '/configs/constant.ini');\n foreach($config as $key=>$value){\n // neu chua dinh nghia thi moi dinh nghia lai\n if(!defined($key)){\n define($key, $value);\n }\n }\n }", "private function prepareResultMap() {\n $resultMap = [];\n foreach ($this->encodings as $encoding) {\n $map = \"_\" . $encoding . \"Map\";\n foreach ($this->$map as $ru => $fo) {\n $resultMap[$ru][] = $fo;\n }\n }\n $this->_resultMap = $resultMap;\n }", "public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'FORUM_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t\t'title' => Loc::getMessage('FORUM_SITE_TABLE_FIELD_FORUM_ID'),\n\t\t\t),\n\t\t\t'SITE_ID' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'primary' => true,\n\t\t\t\t'validation' => array(__CLASS__, 'validateSiteId'),\n\t\t\t\t'title' => Loc::getMessage('FORUM_SITE_TABLE_FIELD_SITE_ID'),\n\t\t\t),\n\t\t\t'PATH2FORUM_MESSAGE' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'validation' => array(__CLASS__, 'validatePath'),\n\t\t\t\t'title' => Loc::getMessage('FORUM_SITE_TABLE_FIELD_SITE_ID'),\n\t\t\t),\n\t\t\t'FORUM' => array(\n\t\t\t\t'data_type' => 'Bitrix\\Forum\\Forum',\n\t\t\t\t'reference' => array('=this.FORUM_ID' => 'ref.ID')\n\t\t\t),\n\t\t\t'SITE' => array(\n\t\t\t\t'data_type' => 'Bitrix\\Main\\Site',\n\t\t\t\t'reference' => array('=this.SITE_ID' => 'ref.LID'),\n\t\t\t),\n\t\t);\n\t}", "private function getExtractSections()\n {\n return array(\n '$extract = new Extract(__FILE__, Extract::findStubLength(__FILE__));',\n '$dir = $extract->go();',\n 'set_include_path($dir . PATH_SEPARATOR . get_include_path());',\n );\n }", "private function read_config() {\n\t\t$sections = parse_ini_file($this->config['conf'], true);\n\t\tforeach ($sections as $sectionk => $sectionv) {\n\t\t\tforeach ($sectionv as $key => $var)\n\t\t\t\t$this->config[$sectionk . '.' . $key] = $var;\n\t\t}\n\t}", "public static function buildTableMap()\n {\n $dbMap = Propel::getServiceContainer()->getDatabaseMap(MenuConfigTableMap::DATABASE_NAME);\n if (!$dbMap->hasTable(MenuConfigTableMap::TABLE_NAME)) {\n $dbMap->addTableObject(new MenuConfigTableMap());\n }\n }", "static function WriteINI()\n {\n $content = \"\";\n\n foreach(self::$settings as $key => $data)\n {\n if(is_array($data))\n {\n $is_section = true;\n\n foreach($data as $dataKey => $dataValues)\n {\n if(is_long($dataKey))\n {\n $is_section = false;\n break;\n }\n }\n\n $content .= \"\\n\";\n\n //Write global array value\n if(!$is_section)\n {\n foreach($data as $dataKey => $dataValue)\n {\n $content .= $key . '[] = \"' . $dataValue . '\"' . \"\\n\";\n }\n }\n\n //Write section\n else\n {\n $content .= \"[\" . $key . \"]\\n\";\n\n foreach($data as $dataKey => $dataValue)\n {\n if(is_array($dataValue))\n {\n foreach($dataValue as $dataInnerValue)\n {\n $content .= $dataKey . '[] = \"' . $dataInnerValue . '\"' . \"\\n\";\n }\n }\n else\n {\n $content .= $dataKey . ' = \"' . $dataValue . '\"' . \"\\n\";\n }\n }\n }\n\n $content .= \"\\n\";\n }\n\n //Write global value\n else\n {\n $content .= $key . ' = \"' . $data . '\"' . \"\\n\";\n }\n }\n\n file_put_contents(self::$file, $content);\n }", "function buildFileMap()\r\n{\r\n return false;\r\n $base = getcwd();\r\n require_once(\"$base/lib/builders/FileMapBuilder.php\");\r\n $fmb = new Gravitycar\\lib\\builders\\FileMapBuilder();\r\n $fmb->run();\r\n}", "protected function _getDomMap()\n {\n $domMap = parent::_getDomMap();\n $domMap = reset($domMap);\n\n return [\n 'initSubscriptionResponse' => array_merge([\n 'transactionId' => 'transactionId',\n 'subscriptionPageUrl' => 'subscriptionPageUrl',\n 'status' => 'status',\n ], $domMap)\n ];\n }", "protected function initialisePatternMap()\n {\n // Define the XML-based scanner output patterns\n $xmlScannerPatterns = new Collection([\n self::XML_NMAP_REGEX => ScannerApp::SCANNER_NMAP,\n self::XML_BURP_REGEX => ScannerApp::SCANNER_BURP,\n self::XML_NEXPOSE_REGEX => ScannerApp::SCANNER_NEXPOSE,\n self::XML_NETSPARKER_REGEX => ScannerApp::SCANNER_NETSPARKER,\n self::XML_NESSUS_REGEX => ScannerApp::SCANNER_NESSUS,\n ]);\n\n // Define the CSV-based scanner output patterns\n $csvScannerPatterns = new Collection();\n\n // Define the JSON-based scanner output patterns\n $jsonScannerPatterns = new Collection();\n\n // Set the pattern Collection for each group of file types on the main Collection\n $this->scannerPatternMap->put(File::FILE_TYPE_XML, $xmlScannerPatterns);\n $this->scannerPatternMap->put(File::FILE_TYPE_CSV, $csvScannerPatterns);\n $this->scannerPatternMap->put(File::FILE_TYPE_JSON, $jsonScannerPatterns);\n\n return true;\n }", "public function getmaps(){\n //Some maps to test\n $map0=array(\n array(\"#\",\"#\",\"#\",\"#\"));\n\n $map1=array(\n array(\"#\"),\n array(\"#\"),\n array(\"#\"),\n array(\"#\"),\n array(\"#\"));\n\n $map2=array(\n array(\"#\",\"#\"),\n array(\"#\",\"#\"));\n\n $map3=array(\n array(\"#\",\"#\",\"#\",\"#\",\"#\"),\n array(\"#\",\"#\",\"#\",\"#\",\"#\"),\n array(\"#\",\"#\",\"#\",\"#\",\"#\"),\n array(\"#\",\"#\",\"#\",\"#\",\"#\"),\n array(\"#\",\"#\",\"#\",\"#\",\"#\"));\n\n $map4=array(\n array(\"#\",\"#\",\"#\"),\n array(\"#\",\"#\",\"#\"),\n array(\"#\",\"#\",\"#\"),\n array(\"#\",\"#\",\"#\"),\n array(\"#\",\"#\",\"#\"));\n\n $map5=array(\n array(\"#\",\"#\",\"#\",\"#\",\"#\"),\n array(\"#\",\"#\",\"#\",\"#\",\"#\"),\n array(\"#\",\"#\",\"#\",\"#\",\"#\"));\n\n return array($map0, $map1, $map2, $map3, $map4, $map5);\n }", "static public function getDataMap()\n {\n return array(\n 'fields' => array(\n 'rev' => array(\n 'type' => 'integer',\n ),\n 'cover' => array(\n 'type' => 'string',\n ),\n 'wiki_id' => array(\n 'type' => 'integer',\n ),\n 'title' => array(\n 'type' => 'string',\n ),\n 'html_cache' => array(\n 'type' => 'string',\n ),\n 'content' => array(\n 'type' => 'string',\n ),\n 'tags' => array(\n 'type' => 'raw',\n ),\n 'comment_tags' => array(\n 'type' => 'raw',\n ),\n 'model' => array(\n 'type' => 'string',\n ),\n 'has_video' => array(\n 'type' => 'integer',\n ),\n 'like_num' => array(\n 'type' => 'integer',\n ),\n 'dislike_num' => array(\n 'type' => 'integer',\n ),\n 'watched_num' => array(\n 'type' => 'integer',\n ),\n 'admin_id' => array(\n 'type' => 'integer',\n ),\n 'do_date' => array(\n 'type' => 'date',\n ),\n 'source' => array(\n 'type' => 'raw',\n ),\n 'tvsou_id' => array(\n 'type' => 'string',\n ),\n 'first_letter' => array(\n 'type' => 'string',\n ),\n 'douban_id' => array(\n 'type' => 'string',\n ),\n 'verify' => array(\n 'type' => 'integer',\n ),\n 'created_at' => array(\n 'type' => 'date',\n ),\n 'updated_at' => array(\n 'type' => 'date',\n ),\n ),\n 'references' => array(\n\n ),\n 'embeddeds' => array(\n\n ),\n 'relations' => array(\n\n ),\n );\n }", "function qode_listing_generate_listing_map_archive_vars($attributes){\n\n\t\t$posts_per_page = '-1';\n\t\t$max_num_pages = '';\n\t\t$found_posts = '';\n\t\t$type = '';\n\t\t$cat = '';\n\t\t$keyword = '';\n\t\t$next_page = '';\n\t\t$custom_fields = array();\n\t\t$tag = '';\n\t\t$location = '';\n\n\t\textract($attributes);\n\n\t\tnew Archive\\ArchiveGlobalVar($posts_per_page, $max_num_pages, $found_posts, $type, $cat, $keyword, $next_page, $custom_fields, $tag, $location );\n\n\t}", "public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'ID' => new Entity\\IntegerField('ID', array(\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true\n\t\t\t)),\n\t\t\t'PROFILE_ID' => new Entity\\IntegerField('PROFILE_ID', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'PROFILE_EXEC_ID' => new Entity\\IntegerField('PROFILE_EXEC_ID', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'DATE_EXEC' => new Entity\\DateTimeField('DATE_EXEC', array(\n\t\t\t\t'default_value' => ''\n\t\t\t)),\n\t\t\t'TYPE' => new Entity\\StringField('TYPE', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'ENTITY_ID' => new Entity\\IntegerField('ENTITY_ID', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'FIELDS' => new Entity\\TextField('FIELDS', array()),\n\t\t\t'PROFILE' => new Entity\\ReferenceField(\n\t\t\t\t'PROFILE',\n\t\t\t\t'\\Bitrix\\EsolImportxml\\ProfileTable',\n\t\t\t\tarray('=this.PROFILE_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t\t'PROFILE_EXEC' => new Entity\\ReferenceField(\n\t\t\t\t'PROFILE_EXEC',\n\t\t\t\t'\\Bitrix\\EsolImportxml\\ProfileExecTable',\n\t\t\t\tarray('=this.PROFILE_EXEC_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t\t'IBLOCK_ELEMENT' => new Entity\\ReferenceField(\n\t\t\t\t'IBLOCK_ELEMENT',\n\t\t\t\t'\\Bitrix\\Iblock\\ElementTable',\n\t\t\t\tarray('=this.ENTITY_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t\t'IBLOCK_SECTION' => new Entity\\ReferenceField(\n\t\t\t\t'IBLOCK_SECTION',\n\t\t\t\t'\\Bitrix\\Iblock\\SectionTable',\n\t\t\t\tarray('=this.ENTITY_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t);\n\t}", "public function __construct()\n {\n\t\t$this->ini_array = parse_ini_file(\"config.ini\", true);\n }", "protected function _generateContentMap($content_dir) {\n\t\t$files = $this->_readDirectoryRecursive($content_dir);\n\t\t\n\t\t//var_dump($files);exit;\n\t\t\n\t\t$content_map = array();\n\n\t\t$category = '';\n\t\t\n\t\tfor($i = 0; $i < count($files); $i++) {\n\n\t\t\t/*\n\t\t\t * The first directly level specifies the menu categories\n\t \t\t */\n\n\t\t\tif( ! is_array($files[$i]) && is_dir($files[$i]) ) {\n\t\t\t\t\n\t\t\t\t$category = trim(\n\t\t\t\t\tstr_replace($content_dir, '', $files[$i]), '/');\n\t\t\t\t\n\t\t\t\t$content_map[$category] = array();\n\t\t\t\t\t\t\t\t\n\t\t\t} else if( is_array($files[$i]) ) {\n\t\t\t\t\n\t\t\t\t /*\n\t\t\t\t * The second level specifies the actual content\n\t\t\t\t */\t\t\n\t\t\t\t\n\t\t\t\tfor($j = 0; $j < count($files[$i]); $j++) {\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t * We construct an array of data to be used in the render process\n\t\t\t\t\t */ \n\t\t\t\t\t\n\t\t\t\t\t//var_dump( $files[$i][$j] );\n\t\t\t\t\tif( is_array($files[$i][$j]) ) {\n\t\t\t\t\t\n\t\t\t\t\t\t$content_map[$category][] = $this->_generateProjectData(\n\t\t\t\t\t\t\t$content_dir,\n\t\t\t\t\t\t\t$files[$i][$j]\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}\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t/*\n\t\t * The last step is to sort the content_map by date\n\t\t */ \n\t\tforeach($content_map as $key => $value) {\n\t\t\n\t\t\tusort($content_map[$key], function($a, $b) {\n\t\t\t\t// var_dump($a);\n\t\t\t\t// var_dump($b);\n\t\t\t\t// exit;\n \t\treturn @strtotime($a['date']) < @strtotime($b['date']);\n \t\t});\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t//var_dump($content_map);exit;\n\t\t\t\t\n\t\treturn $content_map;\n\t\n\t}", "function get_map($source)\n{\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_json = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('person', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n 'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_datajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_socratajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'upload' => array('upload', 2),\n 'format' => array('format', 2),\n 'name' => array('name', 2),\n 'modified' => array('modified',1),\n );\n\n // 'dest_key' => array('source_key', dest_position, source_position)\n // 0/1/2 denotes root/extras/resources.\n $map_ckan = array(\n 'title' => array('title', 0, 0),\n 'notes' => array('notes', 0, 0),\n // hard-code publisher to orgnization.title in ckan_map for now.\n // todo: change this map structure.\n 'publisher' => array('place-holder', 1, 1),\n 'public_access_level' => array('access-level', 1, 1),\n 'contact_email' => array('contact-email', 1, 1),\n 'contact_name' => array('person', 1, 1),\n 'unique_id' => array('id', 1, 0),\n 'tags' => array('tags', 0, 1),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('data-dictiionary', 1, 1), // there is a typo.\n 'license_title' => array('license_title', 0, 0),\n 'spatial' => array('spatial-text', 1, 1),\n 'temporal' => array('dataset-reference-date', 1, 1),\n 'release_date' => array('issued', 1, 1),\n 'accrual_periodicity' => array('frequency-of-update', 1, 1),\n 'related_documents' => array('references', 1, 1),\n 'language' => array('metadata-language', 1, 1),\n 'homepage_url' => array('url', 1, 0),\n 'url' => array('url', 2, 2),\n 'name' => array('name', 2, 2),\n 'format' => array('format', 2, 2),\n );\n\n $ret_map = \"map_$source\";\n return isset($$ret_map) ? $$ret_map : null;\n}", "function venture_geo_get_map_path() {\n $files = array_keys(file_scan_directory(file_directory_path(), '^map_[0-9]{10}\\.xml$'));\n sort($files);\n return end($files);\n}", "function siteMap($node, $lang='en', $wide_info=false){\r\n\t\t$dir = \"sitemaps\";\r\n\t\t$lang = $this->CFG->lang;\r\n\t\t$db = $this->DB->dbName;\r\n\t\t$fname = \"sitemap_\".$db.\"_\".$node.\"_\".$lang.\".xml\";\r\n\t\tif(!($xml = $this->getCache($dir, $fname))){\r\n\t\t\t$xml = $this->cache__siteMap($node, $lang, $wide_info);\r\n\t\t\t$this->newCache($dir, $fname, $xml);\r\n\t\t\t//print \"newcache [$dir]\";\r\n\t\t} //else print \"readcache [$dir/$fname]\";\r\n\t\t//print \"<textarea>$xml</textarea>\";\r\n\t\treturn $xml;\r\n\t}", "public function createIniFile()\n {\n if (!empty($this->files)) {\n foreach ($this->files as $key => $val) {\n \n $iniFile = $this->picturesFolder . '/' . $val['id'] . '.ini';\n \n $extension = str_replace('.', '', $this->outputFileExtension);\n \n //Save producer infos\n $datas = \"uid = '\".$val['id'].\"'\" . \"\\r\\n\";\n $datas .= \"filename = '\".$val['id'].\"'\" . \"\\r\\n\";\n $datas .= \"extension = '\".$extension.\"'\" . \"\\r\\n\";\n\n $handle = fopen($iniFile, 'w+');\n if (fwrite($handle, $datas)) {\n fclose($handle);\n } \n }\n }\n return true;\n }", "private function generateMaps(): void\n {\n $this->socketMap = $this->streamMap = [\n self::RESOURCE => [\n self::READ => [],\n self::WRITE => []\n ],\n self::HANDLER => [\n self::READ => [],\n self::WRITE => []\n ]\n ];\n\n $socketCount = $streamCount = 0;\n\n\n\n // Sockets\n foreach ($this->sockets as $id => $binding) {\n /** @var resource|Socket $socket */\n $socket = $binding->getIoResource();\n $resourceId = $this->identifySocket($socket);\n\n if ($binding->isStreamBased()) {\n /** @var resource $socket */\n $this->streamMap[self::RESOURCE][$binding->ioMode][$resourceId] = $socket;\n $this->streamMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $streamCount++;\n } else {\n $this->socketMap[self::RESOURCE][$binding->ioMode][$resourceId] = $socket;\n $this->socketMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $socketCount++;\n }\n }\n\n\n // Streams\n foreach ($this->streams as $id => $binding) {\n /** @var resource $stream */\n $stream = $binding->getIoResource();\n $resourceId = (int)$stream;\n\n $this->streamMap[self::RESOURCE][$binding->ioMode][$resourceId] = $stream;\n $this->streamMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $streamCount++;\n }\n\n\n // Signals\n $this->signalMap = [];\n\n foreach ($this->signals as $id => $binding) {\n foreach (array_keys($binding->signals) as $number) {\n $this->signalMap[$number][$id] = $binding;\n }\n }\n\n // Cleanup\n if (!$socketCount) {\n $this->socketMap = null;\n }\n\n if (!$streamCount) {\n $this->streamMap = null;\n }\n\n $this->generateMaps = false;\n }", "private function getAdditionalInis(array &$iniFiles, &$replace)\n {\n $replace = true;\n\n if ($scanned = php_ini_scanned_files()) {\n $list = explode(',', $scanned);\n\n foreach ($list as $file) {\n $file = trim($file);\n if (preg_match('/xdebug.ini$/', $file)) {\n // Skip the file, no need for regex replacing\n $replace = false;\n } else {\n $iniFiles[] = $file;\n }\n }\n }\n\n return !empty($scanned);\n }", "public function __buildNavigation(){\n\t\t\t$nav = array();\n\t\t\t$xml = simplexml_load_file(ASSETS . '/navigation.xml');\n\n\t\t\t// Loop over the default Symphony navigation file, converting\n\t\t\t// it into an associative array representation\n\t\t\tforeach($xml->xpath('/navigation/group') as $n){\n\n\t\t\t\t$index = (string)$n->attributes()->index;\n\t\t\t\t$children = $n->xpath('children/item');\n\t\t\t\t$content = $n->attributes();\n\n\t\t\t\t// If the index is already set, increment the index and check again.\n\t\t\t\t// Rinse and repeat until the index is not set.\n\t\t\t\tif(isset($nav[$index])){\n\t\t\t\t\tdo{\n\t\t\t\t\t\t$index++;\n\t\t\t\t\t}while(isset($nav[$index]));\n\t\t\t\t}\n\n\t\t\t\t$nav[$index] = array(\n\t\t\t\t\t'name' => __(strval($content->name)),\n\t\t\t\t\t'index' => $index,\n\t\t\t\t\t'children' => array()\n\t\t\t\t);\n\n\t\t\t\tif(strlen(trim((string)$content->limit)) > 0){\n\t\t\t\t\t$nav[$index]['limit'] = (string)$content->limit;\n\t\t\t\t}\n\n\t\t\t\tif(count($children) > 0){\n\t\t\t\t\tforeach($children as $child){\n\t\t\t\t\t\t$item = array(\n\t\t\t\t\t\t\t'link' => (string)$child->attributes()->link,\n\t\t\t\t\t\t\t'name' => __(strval($child->attributes()->name)),\n\t\t\t\t\t\t\t'visible' => ((string)$child->attributes()->visible == 'no' ? 'no' : 'yes'),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$limit = (string)$child->attributes()->limit;\n\t\t\t\t\t\tif(strlen(trim($limit)) > 0) $item['limit'] = $limit;\n\n\t\t\t\t\t\t$nav[$index]['children'][] = $item;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Build the section navigation, grouped by their navigation groups\n\t\t\t$sections = Symphony::Database()->fetch(\"SELECT * FROM `tbl_sections` ORDER BY `sortorder` ASC\");\n\t\t\tif(is_array($sections) && !empty($sections)){\n\t\t\t\tforeach($sections as $s){\n\n\t\t\t\t\t$group_index = self::__navigationFindGroupIndex($nav, $s['navigation_group']);\n\n\t\t\t\t\tif($group_index === false){\n\t\t\t\t\t\t$group_index = General::array_find_available_index($nav, 0);\n\n\t\t\t\t\t\t$nav[$group_index] = array(\n\t\t\t\t\t\t\t'name' => $s['navigation_group'],\n\t\t\t\t\t\t\t'index' => $group_index,\n\t\t\t\t\t\t\t'children' => array()\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$nav[$group_index]['children'][] = array(\n\t\t\t\t\t\t'link' => '/publish/' . $s['handle'] . '/',\n\t\t\t\t\t\t'name' => $s['name'],\n\t\t\t\t\t\t'type' => 'section',\n\t\t\t\t\t\t'section' => array('id' => $s['id'], 'handle' => $s['handle']),\n\t\t\t\t\t\t'visible' => ($s['hidden'] == 'no' ? 'yes' : 'no')\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Loop over all the installed extensions to add in other navigation items\n\t\t\t$extensions = Symphony::ExtensionManager()->listInstalledHandles();\n\t\t\tforeach($extensions as $e){\n\t\t\t\t$info = Symphony::ExtensionManager()->about($e);\n\n\t\t\t\tif(isset($info['navigation']) && is_array($info['navigation']) && !empty($info['navigation'])){\n\t\t\t\t\tforeach($info['navigation'] as $item){\n\n\t\t\t\t\t\t$type = (isset($item['children']) ? Extension::NAV_GROUP : Extension::NAV_CHILD);\n\n\t\t\t\t\t\tswitch($type){\n\t\t\t\t\t\t\tcase Extension::NAV_GROUP:\n\n\t\t\t\t\t\t\t\t$index = General::array_find_available_index($nav, $item['location']);\n\n\t\t\t\t\t\t\t\t$nav[$index] = array(\n\t\t\t\t\t\t\t\t\t'name' => $item['name'],\n\t\t\t\t\t\t\t\t\t'index' => $index,\n\t\t\t\t\t\t\t\t\t'children' => array(),\n\t\t\t\t\t\t\t\t\t'limit' => (!is_null($item['limit']) ? $item['limit'] : null)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tforeach($item['children'] as $child){\n\t\t\t\t\t\t\t\t\tif(!isset($child['relative']) || $child['relative'] == true){\n\t\t\t\t\t\t\t\t\t\t$link = '/extension/' . $e . '/' . ltrim($child['link'], '/');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t$link = '/' . ltrim($child['link'], '/');\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$nav[$index]['children'][] = array(\n\t\t\t\t\t\t\t\t\t\t'link' => $link,\n\t\t\t\t\t\t\t\t\t\t'name' => $child['name'],\n\t\t\t\t\t\t\t\t\t\t'visible' => ($child['visible'] == 'no' ? 'no' : 'yes'),\n\t\t\t\t\t\t\t\t\t\t'limit' => (!is_null($child['limit']) ? $child['limit'] : null)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase Extension::NAV_CHILD:\n\n\t\t\t\t\t\t\t\tif(!isset($item['relative']) || $item['relative'] == true){\n\t\t\t\t\t\t\t\t\t$link = '/extension/' . $e . '/' . ltrim($item['link'], '/');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$link = '/' . ltrim($item['link'], '/');\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif(!is_numeric($item['location'])){\n\t\t\t\t\t\t\t\t\t// is a navigation group\n\t\t\t\t\t\t\t\t\t$group_name = $item['location'];\n\t\t\t\t\t\t\t\t\t$group_index = self::__navigationFindGroupIndex($nav, $item['location']);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// is a legacy numeric index\n\t\t\t\t\t\t\t\t\t$group_index = $item['location'];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$child = array(\n\t\t\t\t\t\t\t\t\t'link' => $link,\n\t\t\t\t\t\t\t\t\t'name' => $item['name'],\n\t\t\t\t\t\t\t\t\t'visible' => ($item['visible'] == 'no' ? 'no' : 'yes'),\n\t\t\t\t\t\t\t\t\t'limit' => (!is_null($item['limit']) ? $item['limit'] : null)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tif ($group_index === false) {\n\t\t\t\t\t\t\t\t\t$group_index = General::array_find_available_index($nav, 0);\n\t\t\t\t\t\t\t\t\t// add new navigation group\n\t\t\t\t\t\t\t\t\t$nav[$group_index] = array(\n\t\t\t\t\t\t\t\t\t\t'name' => $group_name,\n\t\t\t\t\t\t\t\t\t\t'index' => $group_index,\n\t\t\t\t\t\t\t\t\t\t'children' => array($child),\n\t\t\t\t\t\t\t\t\t\t'limit' => (!is_null($item['limit']) ? $item['limit'] : null)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// add new location by index\n\t\t\t\t\t\t\t\t\t$nav[$group_index]['children'][] = $child;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * After building the Navigation properties array. This is specifically\n\t\t\t * for extensions to add their groups to the navigation or items to groups,\n\t\t\t * already in the navigation. Note: THIS IS FOR ADDING ONLY! If you need\n\t\t\t * to edit existing navigation elements, use the `NavigationPreRender` delegate.\n\t\t\t *\n\t\t\t * @deprecated This delegate is deprecated and will be removed in the next\n\t\t\t * major release of Symphony. Extensions are encouraged to use provide the\n\t\t\t * `fetchNavigation` method instead.\n\t\t\t * @delegate ExtensionsAddToNavigation\n\t\t\t * @param string $context\n\t\t\t * '/backend/'\n\t\t\t * @param array $navigation\n\t\t\t */\n\t\t\tSymphony::ExtensionManager()->notifyMembers(\n\t\t\t\t'ExtensionsAddToNavigation', '/backend/', array('navigation' => &$nav)\n\t\t\t);\n\n\t\t\t$pageCallback = Administration::instance()->getPageCallback();\n\n\t\t\t$pageRoot = $pageCallback['pageroot'] . (isset($pageCallback['context'][0]) ? $pageCallback['context'][0] . '/' : '');\n\t\t\t$found = self::__findActiveNavigationGroup($nav, $pageRoot);\n\n\t\t\t// Normal searches failed. Use a regular expression using the page root. This is less\n\t\t\t// efficient and should never really get invoked unless something weird is going on\n\t\t\tif(!$found) self::__findActiveNavigationGroup($nav, '/^' . str_replace('/', '\\/', $pageCallback['pageroot']) . '/i', true);\n\n\t\t\tksort($nav);\n\t\t\t$this->_navigation = $nav;\n\t\t}", "function __construct($iniFile = \"config.ini\") {\n\n\t\t$this->_app = array();\n\n\t\t// Initialise application root path\n\t\t// Note: if you move this file class, you have to define its relative path from\n\t\t// the root application\n\t\t$this->_app[\"root\"] = realpath(dirname(__FILE__). DIRECTORY_SEPARATOR . \"..\" . DIRECTORY_SEPARATOR . \"..\");\n\t\t$iniFile = $this->_app[\"root\"] . DIRECTORY_SEPARATOR . $iniFile;\n\n\t\t// Ini config file\n\t\t//////////////////\n\n\t\t// Tests if the file exists and is readable\n\t\tif( !file_exists($iniFile) )\n\t\t\tthrow New \\Exception(sprintf('Config file not found: %s', $iniFile));\n\t\tif( !is_readable($iniFile) )\n\t\t\tthrow New \\Exception(sprintf('Config file not readable: %s', $iniFile));\n\t\t// Save file path\n\t\t$this->_iniFile = $iniFile;\n\n\t\t// Parse the ini file\n\t\t$this->_raw = parse_ini_file($iniFile, true);\n\n\t\t//echo \"Real path is: \" . $this->_app[\"root\"] . \"<br>\";\n\t\t//echo \"Real path is: \" . $this->getApp(\"root\") . \"<br>\" ;\n\n\t}", "private function _getXSIMap($actionParam){\n\t\t$arrayMap = array();\n\t\tforeach($actionParam->childNodes as $item){\n\t\t\tif($item->nodeType==1){\n\t\t\t\tif($item->localName=='item'){\n\t\t\t\t\t$index = null;\n\t\t\t\t\t$value = null;\n\t\t\t\t\tforeach($item->childNodes as $node){\n\t\t\t\t\t\tif($node->nodeType==1){\n\t\t\t\t\t\t\tif($node->localName=='key'){\n\t\t\t\t\t\t\t\t$index = (string) $node->nodeValue;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif($node->localName=='value'){\n\t\t\t\t\t\t\t\t\t$paramType = $node->getAttributeNS($this->_xmlSchemaNamespace, 'type');\n\t\t\t\t\t\t\t\t\tif($this->_isTypeLiteral($paramType)==true){\n\t\t\t\t\t\t\t\t\t\t$value = $this->_decodeXSDType($paramType, $node->nodeValue);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif($paramType=='ns2:Map'){\n\t\t\t\t\t\t\t\t\t\t\t$value = $this->_getXSIMap($node);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tif($paramType=='SOAP-ENC:Array'||$paramType=='enc:Array'){\n\t\t\t\t\t\t\t\t\t\t\t\t$value = $this->_getSoapArray($node);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$value = null;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($index!==null){\n\t\t\t\t\t\t$arrayMap[$index] = $value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$arrayMap[] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $arrayMap;\n\t}", "public function toXML()\r\n\t{\r\n\t\t// pass any configuration options defined as type=pass to the xml\r\n\t\t\r\n\t\t$source = explode('/', $this->config_file);\r\n\t\t$source = array_pop($source);\r\n\r\n\t\t$objConfigXml = new \\DOMDocument( );\r\n\t\t$objConfigXml->loadXML( \"<config source=\\\"$source\\\" />\" );\r\n\t\t\t\r\n\t\tforeach ( $this->getPass() as $key => $value )\r\n\t\t{\r\n\t\t\tif ($value instanceof \\SimpleXMLElement) \r\n\t\t\t{\r\n\t\t\t\t// just spit it back out again as XML\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$objElement = $objConfigXml->createElement($key);\r\n\t\t\t\t$objConfigXml->documentElement->appendChild( $objElement );\r\n\t\t\t\t\r\n\t\t\t\tforeach ($value->children() as $child) \r\n\t\t\t\t{\r\n\t\t\t\t\t// need to convert to DOMDocument.\r\n\t\t\t\t\t$domValue = dom_import_simplexml($child);\r\n\t\t\t\t\t$domValue = $objConfigXml->importNode($domValue, true);\r\n\t\t\t\t\t$objElement->appendChild($domValue);\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// simple string value\r\n\t\t\t\t\r\n\t\t\t\t$objElement = $objConfigXml->createElement( $key, Parser::escapeXml($value) );\r\n\t\t\t\t$objConfigXml->documentElement->appendChild( $objElement );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $objConfigXml;\r\n\t}", "protected function generate(){\n\t\tif ($this->isOptionSet('ini')) $this->_ini = $this->getOption('ini');\n\t\tif (!file_exists($this->getIni())){\n\t\t\t$this->setError('badIni');\n\t\t}\n\t\t\n\t\tif ($this->isError()) return;\n\t\t\n\t\t$this->setHandler();\n\t\t$this->_handler->generateKey();\n\t\t$this->_key = $this->_handler->getKey(); \n\t}" ]
[ "0.6298302", "0.5663068", "0.5564768", "0.53880966", "0.5346692", "0.53239864", "0.5299677", "0.5215316", "0.50380766", "0.500899", "0.50022036", "0.5001408", "0.49921328", "0.49877095", "0.4985223", "0.49799305", "0.49754384", "0.49635845", "0.49174458", "0.4886537", "0.4867606", "0.4856973", "0.4837681", "0.4807186", "0.4802975", "0.4796455", "0.4792413", "0.47735357", "0.47634447", "0.47592127", "0.47550032", "0.474542", "0.47234115", "0.47119668", "0.47057605", "0.47054344", "0.46963072", "0.46890303", "0.46808034", "0.46673977", "0.46657336", "0.46595988", "0.46529296", "0.46249667", "0.46152726", "0.46091238", "0.46090835", "0.45987412", "0.45907947", "0.45843625", "0.45822793", "0.4577581", "0.45734084", "0.4570229", "0.45699942", "0.4563508", "0.45543963", "0.45542687", "0.45521593", "0.45503584", "0.4548363", "0.45467448", "0.4526811", "0.45223525", "0.4502762", "0.4499507", "0.44926924", "0.44919312", "0.44883904", "0.44866562", "0.44649407", "0.4448432", "0.44472054", "0.4445202", "0.44407806", "0.4435191", "0.44232175", "0.4419891", "0.44196248", "0.4410802", "0.4410383", "0.43976295", "0.43915644", "0.4390635", "0.43845248", "0.43832278", "0.438239", "0.43789074", "0.43771726", "0.43760225", "0.43756124", "0.43708163", "0.43625832", "0.4361098", "0.43602046", "0.43578887", "0.43524504", "0.4346395", "0.43456018", "0.43455368" ]
0.7168414
0
Builds an XML Map used to parse services includes (xml)
protected function xmlServicesMapFactory() { $map = new Map(); $map->add( Path::factory('/fwk/services', 'services', array()) ->loop(true, '@xml') ->attribute('xmlMap') ); return $map; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function build_xml_map() {\n $this->_create_map();\n header(\"content-type: text/xml\");\n echo $this->result;\n }", "function generate_mapservice_conf_file(){\n\t\t$dom;\n\t\tif(!$dom = domxml_open_file($this->default_mapservconf_file)){\n\t\t\techo \"Could not open xml file: \" . $this->default_mapservconf_file;\n\t\t\treturn NULL; \n\t\t}\n\t\t$mapservice = $this->find_mapservice($dom);\n\t\t// map service not found\n\t\tif($mapservice == NULL){\n\t\t\techo \"could not find map-service named: \" . $mapservice_name ;\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\t$children = $mapservice->child_nodes();\n\t\t$n_children = count($children);\n\t\t\n\t\t// loop through to find <map-file>\n\t\t// and <layer-config> element\n\t\tfor($i = 0; $i < $n_children; $i++){\n\t\t\tswitch ($children[$i]->tagname){\n\t\t\t\tcase \"map-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_mapfile);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"layer-config-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_layerconf);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$dom->dump_file($this->output_mapservconf, false, false);\n\t\treturn $this->output_mapservconf;\n\t}", "protected function xmlPluginsMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/plugin', 'plugins')\n ->loop(true)\n ->attribute('class')\n ->attribute('service')\n ->addChildren(\n Path::factory('param', 'params')\n ->attribute('name')\n ->filter(array($this, 'propertizeString'))\n ->value('value')\n ->loop(true)\n )\n );\n\n return $map;\n }", "abstract protected function buildMap();", "protected function xmlIniMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/ini', 'ini', array())\n ->loop(true)\n ->attribute('category')\n ->value('value')\n );\n \n return $map;\n }", "public function getXMLPageMap() {\n\t\tstatic $xml;\n\n\t\tif (isset($xml)) return $xml;\n\t\t$cache = SA_SimpleCache::singleton('__XML_PAGES_MAP__');\n\t\tif ($xmlString = $cache->load()) {\n\t\t\t$xml = new SimpleXMLElement($xmlString);\n\t\t} else {\n\t\t\t$xml = new SimpleXMLElement('<?xml version=\"1.0\" standalone=\"yes\"?><pages/>');\n\t\t\t$this->xmlFileSystem($this->getPagesDir(), $xml);\n\t\t\t$cache->save($xml->asXML());\n\t\t}\n\t\treturn $xml;\n\t}", "function create_service_map($soap) {\n foreach ($this->services as $service) {\n require_once($service . '.php');\n if (class_exists($service)) {\n $c = (string) $service; \n $object = new $c();\n $soap->addObjectMap($object, 'urn:php-islandora-soapservice');\n }\n else {\n $this->log->lwrite(\"Could not load class $service, check the config files list \n of services to make sure they are correct\", 'SOAP_SERVER', NULL, NULL, 'ERROR');\n }\n }\n }", "protected function xmlListenersMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/listener', 'listeners')\n ->loop(true)\n ->attribute('class')\n ->attribute('service')\n ->addChildren(\n Path::factory('param', 'params')\n ->attribute('name')\n ->filter(array($this, 'propertizeString'))\n ->value('value')\n ->loop(true)\n )\n );\n \n return $map;\n }", "protected static function buildEventMaps()\n {\n \\Log::info('Building event cache');\n\n // Build event mapping from services in database\n\n //\tInitialize the event map\n $processEventMap = [];\n $broadcastEventMap = [];\n\n // Pull any custom swagger docs\n $result = ServiceModel::with(\n [\n 'serviceDocs' => function ($query){\n $query->where('format', ApiDocFormatTypes::SWAGGER);\n }\n ]\n )->get();\n\n //\tSpin through services and pull the events\n foreach ($result as $service) {\n $apiName = $service->name;\n try {\n if (empty($content = ServiceModel::getStoredContentForService($service))) {\n throw new \\Exception(' * No event content found for service.');\n continue;\n }\n\n $serviceEvents = static::parseSwaggerEvents($apiName, $content);\n\n //\tParse the events while we get the chance...\n $processEventMap[$apiName] = ArrayUtils::get($serviceEvents, 'process', []);\n $broadcastEventMap[$apiName] = ArrayUtils::get($serviceEvents, 'broadcast', []);\n\n unset($content, $service, $serviceEvents);\n } catch (\\Exception $ex) {\n \\Log::error(\" * System error building event map for service '$apiName'.\\n{$ex->getMessage()}\");\n }\n }\n\n static::$eventMap = ['process' => $processEventMap, 'broadcast' => $broadcastEventMap];\n\n //\tWrite event cache file\n \\Cache::forever(static::EVENT_CACHE_KEY, static::$eventMap);\n\n \\Log::info('Event cache build process complete');\n }", "protected function _getDomMap()\n {\n $domMap = parent::_getDomMap();\n $domMap = reset($domMap);\n\n return [\n 'initSubscriptionResponse' => array_merge([\n 'transactionId' => 'transactionId',\n 'subscriptionPageUrl' => 'subscriptionPageUrl',\n 'status' => 'status',\n ], $domMap)\n ];\n }", "protected static function buildEventMaps()\n {\n \\Log::info('Building event cache');\n\n // Build event mapping from services in database\n\n //\tInitialize the event map\n $eventMap = [];\n\n // Pull any custom swagger docs\n $result = ServiceModel::whereIsActive(true)->get();\n\n //\tSpin through services and pull the events\n /** @var ServiceModel $model */\n foreach ($result as $model) {\n $apiName = $model->name;\n try {\n /** @var BaseRestService $service */\n if (empty($service = ServiceManager::getService($apiName))) {\n throw new \\Exception('No service found.');\n }\n\n if ($service instanceof FileServiceInterface) {\n // don't want the full folder list here\n $accessList = (empty($service->getPermissions()) ? [] : ['', '*']);\n } else {\n $accessList = $service->getAccessList();\n }\n\n if (!empty($accessList)) {\n if (!empty($doc = $model->getDocAttribute())) {\n if (is_array($doc) && !empty($content = array_get($doc, 'content'))) {\n if (is_string($content)) {\n $content = ServiceModel::storedContentToArray($content, array_get($doc, 'format'),\n $model);\n if (!empty($content)) {\n $eventMap[$apiName] = static::parseSwaggerEvents($content, $accessList);\n }\n }\n }\n }\n }\n } catch (\\Exception $ex) {\n \\Log::error(\" * System error building event map for service '$apiName'.\\n{$ex->getMessage()}\");\n }\n\n unset($content, $service, $serviceEvents);\n }\n\n static::$eventMap = $eventMap;\n\n \\Log::info('Event cache build process complete');\n }", "function webmap_compo_lib_xml_build()\r\n{\r\n\t$this->webmap_compo_lib_xml_base();\r\n}", "public static function buildTableMap()\n {\n $dbMap = Propel::getServiceContainer()->getDatabaseMap(CKOrderXmlTableMap::DATABASE_NAME);\n if (!$dbMap->hasTable(CKOrderXmlTableMap::TABLE_NAME)) {\n $dbMap->addTableObject(new CKOrderXmlTableMap());\n }\n }", "private function generateXml()\n {\n\n $args = array(\n\n 'posts_per_page' => -1,\n 'numberposts' => -1,\n 'orderby' => 'post_type',\n 'order' => 'DESC',\n 'post_type' => apply_filters('fpcms_sitemap_post_types', array('post', 'page'))\n\n );\n\n if ($results = get_posts($args)) {\n\n $sitemap = new \\SimpleXMLElement($this->getDocStructure());\n\n foreach ($results as $result) {\n\n $url = $sitemap->addChild('url');\n $url->addChild('loc', get_permalink($result->ID));\n\n if (has_post_thumbnail($result->ID)) {\n\n if ($image = wp_get_attachment_image_src(get_post_thumbnail_id($result->ID))) {\n $url->addChild('image:image', $image[0]);\n }\n\n }\n\n $url->addChild('lastmod', mysql2date('Y-m-d', $result->post_date_gmt));\n\n if ($result->post_type == 'page') {\n\n //Pages should display higher than posts for the same keyword\n $url->addChild('priority', apply_filters('fpcms_sitemap_page_priority', '0.7'));\n\n } else {\n\n $url->addChild('priority', apply_filters('fpcms_sitemap_post_priority', '0.4'));\n\n }\n\n }\n\n return $sitemap->asXML();\n\n }\n\n }", "protected function getMap(): ReferenceMap\n {\n return new ReferenceMap(\n [\n new SrcNode(\n new \\SplFileInfo('folder/Example/ClassExample.php'),\n new FullClassName('Example', 'ClassExample'),\n [\n new Inheritance(0, new FullClassName('Example', 'ParentClassExample')),\n new Inheritance(0, new FullClassName('', 'FilterIterator')),\n new Dependency(0, new FullClassName('Example', 'AnotherClassExample')),\n new Dependency(0, new FullClassName('Vendor', 'ThirdPartyExample')),\n new Dependency(0, new FullClassName('', 'iterable')),\n new Composition(0, new FullClassName('Example', 'InterfaceExample')),\n new Composition(0, new FullClassName('Example', 'AnotherInterface')),\n new Composition(0, new FullClassName('', 'iterable')),\n new Mixin(0, new FullClassName('Example', 'TraitExample')),\n new Mixin(0, new FullClassName('', 'PHPDocElement'))\n ]\n )\n ],\n [\n new FullClassName('', 'iterable'),\n new FullClassName('', 'FilterIterator'),\n new FullClassName('', 'PHPDocElement'),\n ],\n [\n new ComposerPackage('main', [], [], [], [])\n ]\n );\n }", "public function loadXml($filename,$map_path){\r\n \r\n $this->rootPath = $this->_preparePath($map_path);\r\n \r\n if(!File::exists( $this->rootPath .DS. $filename ))\r\n App::critical_error ('XML document not found: '.$this->rootPath .DS. $filename);\r\n \r\n $xmlDoc = $this->_initDocument($this->rootPath .DS. $filename);\r\n \r\n //get the project elements\r\n $elements = $xmlDoc->getElementsByTagName('element');\r\n \r\n foreach($elements as $element){\r\n \r\n if(count($this->elements) == 0 ){\r\n $this->elements = $this->_loadElement($element);\r\n }\r\n else{\r\n $this->elements = array_merge($this->elements,$this->_loadElement($element));\r\n }\r\n }\r\n \r\n //isolate the template key\r\n if(!is_null($this->_templatekey) && !is_null($this->elements[$this->_templatekey]))\r\n $this->elements['templates'] = $this->elements[$this->_templatekey];\r\n \r\n //clean the element values\r\n //array_walk_recursive($this->element, array($this, '_clean'));\r\n \r\n return File::put(APP_PROJECT .DS. 'elements.php' ,serialize($this->elements)); \r\n }", "private function genSitemapXML() {\n $url_same = array();\n $sitemap_xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\" xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\">\n <!-- created by CSZ CMS Sitemap Generator www.cszcms.com -->'.\"\\n\";\n $sitemap_xml.= '<url>\n\t<loc>'.base_url().'</loc>\n\t<changefreq>always</changefreq>\n </url>'.\"\\n\";\n if($this->lang !== FALSE){ /* Language */\n foreach ($this->lang as $row) {\n $url = $this->Csz_model->base_link().'/lang/'.$row['lang_iso'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n if($this->menu_other !== FALSE){ /* Navigation */\n foreach ($this->menu_other as $row) {\n $chkotherlink = strpos($row['other_link'], BASE_URL);\n if($row['pages_id'] && $row['pages_id'] != NULL && $row['pages_id'] != 0){\n $pages = $this->Csz_model->getValue('page_url', 'pages', \"active = '1' AND pages_id = '\".$row['pages_id'].\"'\", '', 1, 'page_url', 'ASC'); \n if($row['drop_page_menu_id'] != 0 && $row['drop_page_menu_id'] != NULL){\n $main = $this->Csz_model->getValue('menu_name', 'page_menu', \"active = '1' AND page_menu_id = '\".$row['drop_page_menu_id'].\"'\", '', 1, 'menu_name', 'ASC'); \n $url = $this->Csz_model->base_link().'/'.$this->Csz_model->rw_link($main->menu_name).'/'.$pages->page_url;\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }else{\n $url = $this->Csz_model->base_link().'/'.$pages->page_url;\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }else if($row['other_link'] && $row['other_link'] != NULL && $chkotherlink !== FALSE){ \n if(!in_array($row['other_link'], $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$row['other_link'].'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $row['other_link'];\n }\n }else if($row['plugin_menu'] && $row['plugin_menu'] != NULL){\n $url = $this->Csz_model->base_link().'/plugin/'.$row['plugin_menu'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n }\n if($this->pages_content !== FALSE){ /* Pages Content without navigation */\n foreach ($this->pages_content as $row) {\n $url = $this->Csz_model->base_link().'/'.$row['page_url'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n if($this->plugin !== FALSE){ /* Plugin with sitemap config */\n foreach ($this->plugin as $row) {\n $plugin_db = $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sitemap_viewtable');\n if(!empty($plugin_db)){\n $plugindata = $this->Csz_model->getValueArray('*', $plugin_db, $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sqlextra_condition'), '', 0, $plugin_db.'_id', 'DESC');\n if($plugindata !== FALSE){\n foreach ($plugindata as $rs) {\n $url = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/view/'.$rs[$plugin_db.'_id'].'/'.$rs['url_rewrite'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n if($row['plugin_config_filename'] == 'article'){\n $urlamp = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/amp/'.$rs[$plugin_db.'_id'].'/'.$rs['url_rewrite'];\n if(!in_array($urlamp, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$urlamp.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $urlamp;\n }\n }\n }\n }\n }\n $plugin_cat_db = $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sitemap_cattable');\n if(!empty($plugin_cat_db)){\n $plugindata = $this->Csz_model->getValueArray('*', $plugin_cat_db, $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sqlextra_catcondition'), '', 0, $plugin_cat_db.'_id', 'DESC');\n if($plugindata !== FALSE){\n foreach ($plugindata as $rs) {\n $url = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/category/'.$rs['url_rewrite'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n }\n } \n }\n $sitemap_xml.= '</urlset>'.\"\\n\";\n if($sitemap_xml){\n /* Gen sitemap.xml */\n $file_path = FCPATH.\"sitemap.xml\";\n $fopen = fopen($file_path, 'wb') or die(\"can't open file\");\n fwrite($fopen, $sitemap_xml);\n fclose($fopen);\n /* Gen sitemap.xml.gz */\n $gzdata = @gzencode($sitemap_xml, 9);\n if($gzdata !== FALSE){\n $fopen1 = fopen(FCPATH.\"sitemap.xml.gz\", 'wb') or die(\"can't open file\");\n fwrite($fopen1, $gzdata);\n fclose($fopen1);\n }\n\t}\n }", "function venture_geo_process_map_xml($id, $params) { \n $output = '';\n if ($params) {\n $output = \" <state id=\\\"$id\\\">\\n\";\n foreach ($params as $name => $value) {\n if($value) \n $output .= \" <$name>$value</$name>\\n\";\n }\n $output .= \" </state>\\n\";\n }\n return $output;\n}", "public function generateMap()\n {\n try\n {\n // Select all published articles and pages.\n // Lessons and other new stuff to be added upon needed.\n $pgs = ORM::factory( 'Page' )\n ->where( 'status', '>', 0 )\n ->find_all()->as_array();\n\n $articles = ORM::factory( 'Article' )\n ->where( 'status', '>', 0 )\n ->find_all()->as_array();\n \n // Place found URLs into the container array.\n $pages = [];\n foreach ( array_merge( $pgs, $articles ) as $value )\n array_push ( $pages, $value->make_full_url () );\n \n // Select whatever is already in the map...\n $urls = [];\n foreach ( $this->map->children() as $node )\n $urls[] = ( string )$node->loc;\n\n // Delete redundant links\n foreach ( array_diff( $urls, $pages ) as $url )\n $this->removeEntry( $url, FALSE, TRUE );\n\n // Add missing links.\n foreach ( array_diff( $pages, $urls ) as $uri )\n $this->addEntry ( $uri, NULL, FALSE, TRUE );\n\n // Save result into the file.\n return $this->save();\n }\n catch ( Exception $e )\n {\n Kohana::$log->add( LOG_ERR, $e->getMessage() );\n return FALSE;\n }\n }", "function service_information() {\r\n\t\t$return_value = '<service name=\"' . $this->basename . '\">'\r\n\t\t. '<port name=\"' . $this->basename . 'Port\" binding=\"tns:' . $this->basename . 'Binding\">'\r\n\t\t. '<soap:address location=\"' . $this->api_url . '\"/>'\r\n\t\t. '</port>'\r\n\t\t. '</service>';\r\n\r\n\t\treturn $return_value;\r\n\t}", "private function generateSiteMapMain()\n {\n $this->load->model('extension/module/siteMapGenerate');\n $output = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $output .= '<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">';\n\n foreach ($this->includedFiles as $file) {\n $removeFromUrl = mb_substr($file, 0, mb_strrpos($file, '/'));;\n $clearFileUrl = str_replace($removeFromUrl . '/', '', $file);\n $output .= '<sitemap>';\n $output .= '<loc>' . $this->siteUrl . $clearFileUrl . '</loc>';\n $output .= '</sitemap>';\n }\n\n $output \t.= '</sitemapindex>';\n $this->response->addHeader('Content-Type: application/xml');\n\n $siteMapXmlUrl = DIR_MAIN . 'sitemap_custom.xml';\n $openedFile = fopen($siteMapXmlUrl, 'w');\n chmod($siteMapXmlUrl, 0775);\n file_put_contents($siteMapXmlUrl, $output);\n fclose($openedFile);\n }", "public static function addSiteMapElement($xml, $siteMapelementsArr){\n \n foreach ($siteMapelementsArr as $oneElement){\n //start at url node\n $url = $xml->addChild('url');\n \n //use loop to add all elements to url node\n foreach ($oneElement as $key=>$value) {\n if ($key == 'lastmod') {\n $value = date('Y-m-d', strtotime($value));\n }//force format date.\n \n $loc = $url->addChild($key, $value);\n }\n \n }\n \n }", "function find_mapservice($dom){\n\t\t$mapservice = NULL;\n\t\t// get all <map-service> elements\n\t\t$mapservices = $dom->get_elements_by_tagname(\"map-service\");\n\t\t$n_services = count($mapservices);\n\t\t// loop through all the services and find\n\t\t// the one whose name matches the mapservice\n\t\t// name that was passed into the constructor\n\t\tfor($i = 0; $i < $n_services; $i++){\n\t\t\t// get all the child nodes of\n\t\t\t// a <map-service> node\n\t\t\t$children = $mapservices[$i]->child_nodes();\n\t\t\t$n_children = count($children);\n\t\t\t$child_found = false;\n\t\t\t// go through the children and\n\t\t\t// find a <name> node\n\t\t\tfor($j = 0; $j < $n_children; $j++){\n\t\t\t\tif($children[$j]->tagname == \"name\"){\n\t\t\t\t\t// check if the <name> value \n\t\t\t\t\t// matches the name that was passed\n\t\t\t\t\t// in to the constructor. to get the\n\t\t\t\t\t// <name> value, we get the child node\n\t\t\t\t\t// of <name>, which should be a text node.\n\t\t\t\t\t$name_value = $children[$j]->child_nodes();\n\t\t\t\t\t$name_value = $name_value[0];\n\t\t\t\t\tif($name_value->get_content() == $this->mapservice_name){\n\t\t\t\t\t\t$child_found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if the <map-service> we are looking for \n\t\t\t// is found, terminate the loop\n\t\t\tif($child_found){\n\t\t\t\t$mapservice = $mapservices[$i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\t\n\t\treturn $mapservice;\n\t}", "private function getServiceMap()\n {\n $result = array(\n 'transport' => 'POST',\n 'envelope' => 'JSON-RPC-2.0',\n 'SMDVersion' => '2.0',\n 'contentType' => 'application/json',\n 'target' => !empty($_SERVER['REQUEST_URI']) ? substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], '?')) : '',\n 'services' => array(),\n 'description' => '',\n );\n\n foreach ($this->instances as $namespace => $instance) {\n $rc = new ReflectionClass($instance);\n\n // Get Class Description\n if ($rcDocComment = $this->getDocDescription($rc->getDocComment())) {\n $result['description'] .= $rcDocComment . PHP_EOL;\n }\n\n foreach ($rc->getMethods() as $method) {\n /** @var ReflectionMethod $method */\n if (!$method->isPublic() || in_array(strtolower($method->getName()), $this->hiddenMethods)) {\n continue;\n }\n\n $methodName = ($namespace ? $namespace . '.' : '') . $method->getName();\n $docComment = $method->getDocComment();\n\n $result['services'][$methodName] = array('parameters' => array());\n\n // set description\n if ($rmDocComment = $this->getDocDescription($docComment)) {\n $result['services'][$methodName]['description'] = $rmDocComment;\n }\n\n // @param\\s+([^\\s]*)\\s+([^\\s]*)\\s*([^\\s\\*]*)\n $parsedParams = array();\n if (preg_match_all('/@param\\s+([^\\s]*)\\s+([^\\s]*)\\s*([^\\n\\*]*)/', $docComment, $matches)) {\n foreach ($matches[2] as $number => $name) {\n $type = $matches[1][$number];\n $desc = $matches[3][$number];\n $name = trim($name, '$');\n\n $param = array('type' => $type, 'description' => $desc);\n $parsedParams[$name] = array_filter($param);\n }\n };\n\n // process params\n foreach ($method->getParameters() as $parameter) {\n $name = $parameter->getName();\n $param = array('name' => $name, 'optional' => $parameter->isDefaultValueAvailable());\n if (array_key_exists($name, $parsedParams)) {\n $param += $parsedParams[$name];\n }\n\n if ($param['optional']) {\n $param['default'] = $parameter->getDefaultValue();\n }\n\n $result['services'][$methodName]['parameters'][] = $param;\n }\n\n // set return type\n if (preg_match('/@return\\s+([^\\s]+)\\s*([^\\n\\*]+)/', $docComment, $matches)) {\n $returns = array('type' => $matches[1], 'description' => trim($matches[2]));\n $result['services'][$methodName]['returns'] = array_filter($returns);\n }\n }\n }\n\n return $result;\n }", "private function addHeaderToStaticMap()\n {\n HeaderLoader::addStaticMap(\n [\n 'xmagentotags' => XMagentoTags::class,\n ]\n );\n }", "function initMap() {\n\n\t\t// Instantiate the xajax object and configure it\n\t\trequire_once (t3lib_extMgm::extPath('xajax') . 'class.tx_xajax.php');\n\t\t$this->xajax = t3lib_div::makeInstance('tx_xajax'); // Make the instance\n\t\tif ($GLOBALS['TSFE']->metaCharset == 'utf-8') {\n\t\t\t$this->xajax->decodeUTF8InputOn(); // Decode form vars from utf8\n\t\t}\n\t\t$this->xajax->setCharEncoding($GLOBALS['TSFE']->metaCharset); \t\t// Encode of the response to utf-8 ???\n\t\t$this->xajax->setWrapperPrefix($this->prefixId); \t\t// To prevent conflicts, prepend the extension prefix\n\t\t$this->xajax->statusMessagesOn(); \t\t// Do you wnat messages in the status bar?\n\n\t\t// register the functions of the ajax requests\n\t\t$this->xajax->registerFunction(array('infomsg', &$this, 'ajaxGetInfomsg'));\n\t\t$this->xajax->registerFunction(array('activeRecords', &$this, 'ajaxGetActiveRecords'));\n\t\t$this->xajax->registerFunction(array('processCat', &$this, 'ajaxProcessCat'));\n\t\t$this->xajax->registerFunction(array('tab', &$this, 'ajaxGetPoiTab'));\n\t\t$this->xajax->registerFunction(array('search', &$this, 'ajaxSearch'));\n\t\t$this->xajax->registerFunction(array('processCatTree', &$this, 'ajaxProcessCatTree'));\n\t\t$this->xajax->registerFunction(array('getDynamicList', &$this, 'ajaxGetDynamicList'));\n\n\t\t$this->xajax->processRequests();\n\n\t\t// additional output using a template\n\t\t$template['total'] = $this->cObj2->getSubpart($this->templateCode,'###HEADER###');\n\t\t$markerArray = $subpartArray = array();\n\t\t$markerArray['###PATH###'] = t3lib_extMgm::siteRelpath('rggooglemap');\n\n\t\tif ($this->conf['map.']['addLanguage'] == 1) {\n\t\t\tif ($this->conf['map.']['addLanguage.']['override'] != '') {\n\t\t\t\t$markerArray['###MAP_KEY###'] .= '&hl=' . $this->conf['map.']['addLanguage.']['override'];\n\t\t\t} elseif ($GLOBALS['TSFE']->lang != '') {\n\t\t\t\t$markerArray['###MAP_KEY###'] .= '&hl=' . $GLOBALS['TSFE']->lang;\n\t\t\t}\n\t\t}\n\n\t\t$markerArray['###DYNAMIC_JS###'] = $this->getJs();\n\n\t\t// load spefic files if needed for clustering\n\t\tif ($this->conf['map.']['activateCluster'] == 1) { // gxmarkers\n\t\t\t$subpartArray['###CLUSTER_2###'] = '';\n\n\t\t} elseif ($this->conf['map.']['activateCluster'] == 2) { // markerclusterer\n\t\t\t$subpartArray['###CLUSTER_1###'] = '';\n\t\t} else { // no clustering\n\t\t\t$subpartArray['###CLUSTER_1###'] = $subpartArray['###CLUSTER_2###'] = '';\n\t\t}\n\n\t\t$totalJS = $this->cObj2->substituteMarkerArrayCached($template['total'],$markerArray, $subpartArray);\n\t\t$GLOBALS['TSFE']->additionalHeaderData['rggooglemap_xajax'] = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('xajax'));\n\t\t$GLOBALS['TSFE']->additionalHeaderData['rggooglemap_js'] = $totalJS;\n\t}", "function generate_map_file(){\n\t\t$map = ms_newMapObj($this->default_map_file);\n\t\t$n_layers = count($this->viewable_layers);\n\t\t// go through and create new \n\t\t// layer objects for those layers\n\t\t// that have their display property set\n\t\t// to true, adding them to the\n\t\t// map object\n\t\tfor($i = 0; $i < $n_layers; $i++){\n\t\t\tif($this->viewable_layers[$i]->display == \"true\"){\n\t\t\t\t$layer = ms_newLayerObj($map);\n\t\t\t\t$layer->set(\"name\", $this->viewable_layers[$i]->layer_name);\n\t\t\t\t$layer->set(\"status\", MS_OFF);\n\t\t\t\t$layer->set(\"template\", \"nepas.html\");\n\t\t\t\t$this->set_ms_layer_type($layer, $this->viewable_layers[$i]);\n\t\t\t\t$layer->set(\"connectiontype\", MS_POSTGIS);\n\t\t\t\t$layer->set(\"connection\", $this->dbconn->mapserver_conn_str);\n\t\t\t\t$this->set_ms_data_string($layer, $this->viewable_layers[$i]);\n\t\t\t\t$layer->setProjection($this->viewable_layers[$i]->layer_proj);\n\t\t\t\t// added to allow getfeatureinfo requests on\n\t\t\t\t// this layer via WMS\n\t\t\t\t$layer->setMetaData(\"WMS_INCLUDE_ITEMS\", \"all\");\n\t\t\t\t// generate a CLASSITEM directive \n\t\t\t\tif($this->viewable_layers[$i]->layer_ms_classitem != \"\")\n\t\t\t\t\t$layer->set(\"classitem\", $this->viewable_layers[$i]->layer_ms_classitem);\n\n\t\t\t\t// generate classes that this\n\t\t\t\t// layer contains\n\t\t\t\t$n_classes = count($this->viewable_layers[$i]->layer_classes);\n\t\t\t\tfor($j = 0; $j < $n_classes; $j++){\n\t\t\t\t\t$ms_class_obj = ms_newClassObj($layer);\n\t\t\t\t\t$ms_class_obj->set(\"name\", $this->viewable_layers[$i]->layer_classes[$j]->name);\n\t\t\t\t\t$ms_class_obj->setExpression($this->viewable_layers[$i]->layer_classes[$j]->expression);\n\t\t\t\t\tforeach($this->viewable_layers[$i]->layer_classes[$j]->styles as $style){\n\t\t\t\t\t\t$ms_style_obj = ms_newStyleObj($ms_class_obj);\n\t\t\t\t\t\t$ms_style_obj->color->setRGB($style->color_r,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$style->color_g,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$style->color_b);\n\t\t\t\t\t\t// set bg color\n\t\t\t\t\t\t$ms_style_obj->backgroundcolor->setRGB($style->bgcolor_r,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$style->bgcolor_g,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$style->bgcolor_b);\n\t\t\t\t\t\t// set outline color\n\t\t\t\t\t\t$ms_style_obj->outlinecolor->setRGB($style->outlinecolor_r,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$style->outlinecolor_g,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$style->outlinecolor_b);\n\t\t\t\t\t\tif($style->symbol_name != \"\"){\n\t\t\t\t\t\t\t$ms_style_obj->set(\"symbolname\", $style->symbol_name);\n\t\t\t\t\t\t\t// check for valid size\n\t\t\t\t\t\t\tif($style->symbol_size != \"\")\n\t\t\t\t\t\t\t\t$ms_style_obj->set(\"size\", $style->symbol_size);\n\t\t\t\t\t\t\t// check for valid angle\n\t\t\t\t\t\t\tif($style->angle != \"\")\n\t\t\t\t\t\t\t\t$ms_style_obj->set(\"angle\", $style->angle);\n\t\t\t\t\t\t\t// check for valid width\n\t\t\t\t\t\t\tif($style->width != \"\")\n\t\t\t\t\t\t\t\t$ms_style_obj->set(\"width\", $style->width);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($map->save($this->output_mapfile) == MS_FAILURE){\n\t\t\techo \"mapfile could not be saved\";\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\treturn $this->output_mapfile;\t\n\t}", "public function generateMap()\n {\n $map = array();\n $database = $this->binding->getDatabase()->getData();\n\n foreach ($database->classes as $class) {\n $map[$class->name] = $class->clusters;\n }\n\n $this->map = $map;\n $this->cache->save($this->getCacheKey(), $map);\n }", "public function getDocStructure()\n {\n\n $xml_string = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\">';\n $xml_string .= '</urlset>';\n\n return $xml_string;\n\n }", "private function _getXSIMap($actionParam){\n\t\t$arrayMap = array();\n\t\tforeach($actionParam->childNodes as $item){\n\t\t\tif($item->nodeType==1){\n\t\t\t\tif($item->localName=='item'){\n\t\t\t\t\t$index = null;\n\t\t\t\t\t$value = null;\n\t\t\t\t\tforeach($item->childNodes as $node){\n\t\t\t\t\t\tif($node->nodeType==1){\n\t\t\t\t\t\t\tif($node->localName=='key'){\n\t\t\t\t\t\t\t\t$index = (string) $node->nodeValue;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif($node->localName=='value'){\n\t\t\t\t\t\t\t\t\t$paramType = $node->getAttributeNS($this->_xmlSchemaNamespace, 'type');\n\t\t\t\t\t\t\t\t\tif($this->_isTypeLiteral($paramType)==true){\n\t\t\t\t\t\t\t\t\t\t$value = $this->_decodeXSDType($paramType, $node->nodeValue);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif($paramType=='ns2:Map'){\n\t\t\t\t\t\t\t\t\t\t\t$value = $this->_getXSIMap($node);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tif($paramType=='SOAP-ENC:Array'||$paramType=='enc:Array'){\n\t\t\t\t\t\t\t\t\t\t\t\t$value = $this->_getSoapArray($node);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$value = null;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($index!==null){\n\t\t\t\t\t\t$arrayMap[$index] = $value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$arrayMap[] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $arrayMap;\n\t}", "public function build_root_map() {\n\t\t$links = [];\n\t\tforeach ( $this->providers as $provider ) {\n\t\t\t$links = array_merge( $links, $provider->get_index_links( $this->max_entries ) );\n\t\t}\n\n\t\tif ( empty( $links ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $this->get_index( $links );\n\t}", "function Sitemap() {\n $time = FormatTime('Y-m-d', time());\n $url = SYSTEM::get('url');\n $modules = SYSTEM::get('modules');\n $enabled = CONFIG::getSection('enabled');\n $sitemap = SYSTEM::get('sitemap');\n $site_map =\n \"<\\x3Fxml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"\\x3F>\".LF.\n \"<urlset xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\".LF.\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=index</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t\\t<priority>0.8</priority>\".LF.\n \"\\t</url>\".LF;\n foreach ($modules as $module => $data) {\n if (in_array($module, $sitemap) && array_key_exists($module, $enabled)) {\n $gsm = '';\n $obj = strtoupper($module);\n $sections = CMS::call($obj)->getSections();\n unset($sections['drafts']);\n\n foreach ($sections as $id => $section) {\n $categories = CMS::call($obj)->getCategories($id);\n if (!empty($categories)) {\n $gsm .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.SECTION.$id.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t</url>\".LF;\n foreach ($categories as $key => $category) {\n $category = CMS::call($obj)->getCategory($key);\n $content = CMS::call($obj)->getContent($key);\n if (!empty($content)) {\n $gsm .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.SECTION.$id.CATEGORY.$key.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t</url>\".LF;\n foreach ($content as $i => $item) {\n $gsm .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.SECTION.$id.CATEGORY.$key.ITEM.$i.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".FormatTime('Y-m-d', $item['time']).\"</lastmod>\".LF.\n \"\\t</url>\".LF;\n }\n }\n }\n }\n }\n if (!empty($gsm)) {\n $site_map .=\n \"\\t<url>\".LF.\n \"\\t\\t<loc>\".$url.\"?module=\".$module.\"</loc>\".LF.\n \"\\t\\t<lastmod>\".$time.\"</lastmod>\".LF.\n \"\\t\\t<changefreq>weekly</changefreq>\".LF.\n \"\\t</url>\".LF.$gsm;\n }\n }\n }\n $site_map .= \"</urlset>\";\n if (!file_put_contents(ROOT.'sitemap.xml', $site_map, LOCK_EX)) {\n CMS::call('LOG')->logPut('Error', '', 'Cannot save file sitemap.xml');\n }\n return CMS::call('SYSTEM')->createMainMenu();\n}", "public function buildClassAliasMapFile() {}", "public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'ID' => new Entity\\IntegerField('ID', array(\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true\n\t\t\t)),\n\t\t\t'PROFILE_ID' => new Entity\\IntegerField('PROFILE_ID', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'PROFILE_EXEC_ID' => new Entity\\IntegerField('PROFILE_EXEC_ID', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'DATE_EXEC' => new Entity\\DateTimeField('DATE_EXEC', array(\n\t\t\t\t'default_value' => ''\n\t\t\t)),\n\t\t\t'TYPE' => new Entity\\StringField('TYPE', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'ENTITY_ID' => new Entity\\IntegerField('ENTITY_ID', array(\n\t\t\t\t'required' => true\n\t\t\t)),\n\t\t\t'FIELDS' => new Entity\\TextField('FIELDS', array()),\n\t\t\t'PROFILE' => new Entity\\ReferenceField(\n\t\t\t\t'PROFILE',\n\t\t\t\t'\\Bitrix\\EsolImportxml\\ProfileTable',\n\t\t\t\tarray('=this.PROFILE_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t\t'PROFILE_EXEC' => new Entity\\ReferenceField(\n\t\t\t\t'PROFILE_EXEC',\n\t\t\t\t'\\Bitrix\\EsolImportxml\\ProfileExecTable',\n\t\t\t\tarray('=this.PROFILE_EXEC_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t\t'IBLOCK_ELEMENT' => new Entity\\ReferenceField(\n\t\t\t\t'IBLOCK_ELEMENT',\n\t\t\t\t'\\Bitrix\\Iblock\\ElementTable',\n\t\t\t\tarray('=this.ENTITY_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t\t'IBLOCK_SECTION' => new Entity\\ReferenceField(\n\t\t\t\t'IBLOCK_SECTION',\n\t\t\t\t'\\Bitrix\\Iblock\\SectionTable',\n\t\t\t\tarray('=this.ENTITY_ID' => 'ref.ID'),\n\t\t\t\tarray('join_type' => 'LEFT')\n\t\t\t),\n\t\t);\n\t}", "function buildMainMap()\r\n{\r\n\r\n // Add an image first for debug and change asap\r\n //$final_map = \"\r\n//<img class=\\\"main_map\\\" src=\\\"images/heatmapapi.png\\\" />\" ;\r\n\r\n $final_map = \"\r\n<div id=\\\"map\\\"></div>\" ;\r\n\r\n return $final_map ;\r\n}", "final protected function buildDependencyMap() {\n\n\t\t$this->dependencyMap = array();\n\t\t$this->prioritiesHandlers = array();\n $p = new dummyPriorityhookHandler();\n\t\t$this->prioritiesHandlers[self::NORMAL] = $p;\n $this->priorityBased = array('min' => array(),'max' => array());\n\t\t//$this->priorityBased['min'][self::NORMAL][spl_object_hash($p)] = $p;\n\t\tforeach ($this->objects as $hash => $handler) {\n\t\t\t$this->priorityBased['min'][self::NORMAL][$hash] = $handler;\n\t\t\t$this->dependencyMap[$hash] = array('priority' => $this->prioritiesHandlers[self::NORMAL]);\n\t\t\t$this->priorityBased['max'][self::LATEST-1][$hash] = $handler;\n\t\t\t$handler->registerDependencies($this);\n\t\t}\n\t}", "protected function addSitemap()\n {\n $sitemapHeader = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n . ($this->includeGeneratorInfo ? $this::$generatorInfo : '')\n . '<urlset xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"'\n . ' xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9'\n . ' http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\"'\n . ' xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"></urlset>';\n $this->sitemaps[] = [\n 'xml' => new \\SimpleXMLElement($sitemapHeader),\n 'filename' => '',\n ];\n }", "public function sitemap_xml()\n {\n // Get All Pages.\n $this->data['pages'] = $this->pages->get_all(FALSE, 0, 'ASC', FALSE);\n // Get All Sermons.\n $this->data['sermons'] = $this->sermons->get_sermons(FALSE, FALSE, FALSE, 0, \"DESC\", FALSE);\n // Get All Posts\n $this->data['posts'] = $this->posts->get_all(FALSE, 0, 'ASC', FALSE);\n // Get All Post Categories\n $this->data['post_categories'] = $this->categories->get_all();\n\n // Set page content to xml.\n header(\"Content-Type: text/xml;charset=iso-8859-1\");\n $this->load->view(\"sitemap/sitemap\", $this->data);\n }", "private function generateMaps(): void\n {\n $this->socketMap = $this->streamMap = [\n self::RESOURCE => [\n self::READ => [],\n self::WRITE => []\n ],\n self::HANDLER => [\n self::READ => [],\n self::WRITE => []\n ]\n ];\n\n $socketCount = $streamCount = 0;\n\n\n\n // Sockets\n foreach ($this->sockets as $id => $binding) {\n /** @var resource|Socket $socket */\n $socket = $binding->getIoResource();\n $resourceId = $this->identifySocket($socket);\n\n if ($binding->isStreamBased()) {\n /** @var resource $socket */\n $this->streamMap[self::RESOURCE][$binding->ioMode][$resourceId] = $socket;\n $this->streamMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $streamCount++;\n } else {\n $this->socketMap[self::RESOURCE][$binding->ioMode][$resourceId] = $socket;\n $this->socketMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $socketCount++;\n }\n }\n\n\n // Streams\n foreach ($this->streams as $id => $binding) {\n /** @var resource $stream */\n $stream = $binding->getIoResource();\n $resourceId = (int)$stream;\n\n $this->streamMap[self::RESOURCE][$binding->ioMode][$resourceId] = $stream;\n $this->streamMap[self::HANDLER][$binding->ioMode][$resourceId][$id] = $binding;\n $streamCount++;\n }\n\n\n // Signals\n $this->signalMap = [];\n\n foreach ($this->signals as $id => $binding) {\n foreach (array_keys($binding->signals) as $number) {\n $this->signalMap[$number][$id] = $binding;\n }\n }\n\n // Cleanup\n if (!$socketCount) {\n $this->socketMap = null;\n }\n\n if (!$streamCount) {\n $this->streamMap = null;\n }\n\n $this->generateMaps = false;\n }", "static function xmlList()\n\t{\n\t\treturn simplexml_load_file('http://ws.geonames.org/countryInfo');\n\t}", "public function initMap()\n\t{\n\t\t$params =array();\n\t\t$this->add_VcMap($params);\n\t}", "public static function getMap()\n\t{\n\t\treturn [\n\t\t\tnew Main\\Entity\\IntegerField('TEMPLATE_ID', [\n\t\t\t\t'primary' => true,\n\t\t\t]),\n\t\t\tnew Main\\Entity\\StringField('PROVIDER', [\n\t\t\t\t'primary' => true,\n\t\t\t]),\n\t\t\tnew Main\\Entity\\ReferenceField('TEMPLATE', '\\Bitrix\\DocumentGenerator\\Model\\Template',\n\t\t\t\t['=this.TEMPLATE_ID' => 'ref.ID']\n\t\t\t),\n\t\t];\n\t}", "public static function buildTableMap()\n {\n $dbMap = Propel::getServiceContainer()->getDatabaseMap(ApInvoiceTableMap::DATABASE_NAME);\n if (!$dbMap->hasTable(ApInvoiceTableMap::TABLE_NAME)) {\n $dbMap->addTableObject(new ApInvoiceTableMap());\n }\n }", "protected function xmlActionMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/actions/action', 'actions')\n ->loop(true, '@name')\n ->attribute('class')\n ->attribute('method')\n ->attribute('shortcut')\n );\n \n return $map;\n }", "public function sitemap()\n {\n $mappy = new MappyService();\n return $mappy->construct();\n }", "public function build_route_map($routes) {}", "public function getResourceMap()\n\t{\n\t\t// First populate all the data\n\t\tif (!$this->populateRDFData())\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t// Creates new XMLWriter\n\t\t$writer = new XMLWriter;\n\n\t\t// Writes XML to buffer\n\t\t$writer->openMemory();\n\n\t\t// Sets document formatting\n\t\t$writer->setIndent(true);\n\t\t$writer->setIndentString(\" \");\n\n\t\t$writer->startDocument(\"1.0\", \"UTF-8\");\n\n\t\t$writer->startElement(\"rdf:RDF\");\n\n\t\t// Creates object with all the required name spaces\n\t\tforeach ($this->xmlNamespace as $ns => $url)\n\t\t{\n\t\t\t$writer->writeAttribute($ns, $url);\n\t\t}\n\n\t\t// Start main description\n\t\t$writer->startElement('rdf:Description');\n\t\t\t$writer->writeAttribute('rdf:about', $this->resourceURL);\n\t\t\t$writer->writeElement('dc:identifier', $this->id);\n\t\t\t$writer->writeElement('dcterms:title', $this->title);\n\n\t\t\t// Check if the author is an actual human\n\t\t\tif ($this->author_id >= 1000)\n\t\t\t{\n\t\t\t\t$writer->startElement('dcterms:creator');\n\t\t\t\t\t$writer->startElement('foaf:person');\n\t\t\t\t\t\t$writer->writeElement('foaf:name', $this->created_by);\n\t\t\t\t\t$writer->endElement();\n\t\t\t\t$writer->endElement();\n\t\t\t}\n\n\t\t\t$writer->writeElement('dcterms:created', $this->date_created);\n\t\t\t$writer->writeElement('dcterms:modified', $this->date_modified);\n\t\t\t$writer->writeElement('dc:type', $this->type);\n\t\t\t$writer->writeElement('dc:description', $this->intro);\n\n\t\t\t// Writes aggregation\n\t\t\tforeach ($this->aggregates as $child_id => $aggregation)\n\t\t\t{\n\t\t\t\t$writer->startElement('ore:aggregates');\n\t\t\t\t\t$writer->writeAttribute('rdf:resource', $aggregation['url']);\n\t\t\t\t$writer->endElement();\n\t\t\t}\n\n\t\t\t// Writes describer (should be RDF in this case)\n\t\t\t$writer->startElement('ore:isDescribedBy');\n\t\t\t\t$writer->writeAttribute('rdf:resource', $this->resourceURL . '.rdf');\n\t\t\t$writer->endElement();\n\n\t\t\t// Writes parents\n\t\t\tforeach ($this->aggregatedBy as $parent_id => $aggregation)\n\t\t\t{\n\t\t\t\t$writer->startElement('ore:isAggregatedBy');\n\t\t\t\t\t$writer->writeAttribute('rdf:resource', $this->componentURL . $parent_id);\n\t\t\t\t$writer->endElement();\n\t\t\t}\n\n\t\t\t$writer->writeElement('dcterms:issued', $this->date_published);\n\t\t// End rdf:description of main object\n\t\t$writer->endElement();\n\n\t\t// Describe each aggregation briefly\n\t\tforeach ($this->aggregates as $aggregation)\n\t\t{\n\t\t\t// If the child is also an aggregation, do not need to describe it as it has its own RDF descriptor\n\t\t\tif ($aggregation['standalone'] == 1)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$writer->startElement('rdf:Description');\n\t\t\t\t$writer->writeAttribute('rdf:about', $aggregation['url']);\n\t\t\t\t// Detects and describe the data accordingly\n\t\t\t\t$this->dataTypeDescriptor($aggregation, $writer);\n\t\t\t$writer->endElement();\n\t\t}\n\n\t\t// Describe this rdf briefly\n\t\t$writer->startElement('rdf:Description');\n\t\t\t$writer->writeAttribute('rdf:about', $this->resourceURL . '.rdf');\n\t\t\t$curtime = date(\"Y-m-d\\TH:i:sP\", $_SERVER['REQUEST_TIME']);\n\t\t\t$writer->startElement('dcterms:creator');\n\t\t\t\t$writer->writeAttribute('rdf:resource', Request::base());\n\t\t\t$writer->endElement();\n\t\t\t$writer->writeElement('dcterms:created', $curtime);\n\t\t\t$writer->writeElement('dcterms:modified', $curtime);\n\t\t\t$writer->startElement('ore:describes');\n\t\t\t\t$writer->writeAttribute('rdf:resource', $this->resourceURL);\n\t\t\t$writer->endElement();\n\t\t\t$writer->startElement('rdf:type');\n\t\t\t\t$writer->writeAttribute('rdf:resource', 'http://www.openarchives.org/ore/terms/ResourceMap/');\n\t\t\t$writer->endElement();\n\t\t$writer->endElement();\n\n\t\t$writer->endDocument();\n\n\t\t// Flush the memory and return it\n\t\treturn $writer->flush();\n\t}", "function GetMapContent($hide_mode_ids) {\n\tglobal $config;\n\n\t$lang = GetLangContent(\"map\");\n\n\t$map = array();\n\tif (file_exists($config[\"site_path\"].\"/include/map.xml\")) {\n\t\t$xml_parser = new SimpleXmlParser( $config[\"site_path\"].\"/include/map.xml\" );\n\t\t$xml_root = $xml_parser->getRoot();\n\n\t\tforeach ( $xml_root->children as $cnt => $xml_section ) {\n\t\t\tif (!isset($xml_section->attrs[\"id\"]) || (isset($xml_section->attrs[\"id\"]) && !in_array($xml_section->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t$section = array();\n\t\t\t\t$section = array(\"name\" => (isset($lang[$xml_section->attrs[\"name\"]]) ? $lang[$xml_section->attrs[\"name\"]] : $xml_section->attrs[\"name\"]), \"link\" => $xml_section->attrs[\"link\"]);\n\t\t\t\tif ($xml_section->children) {\n\t\t\t\t\tforeach ( $xml_section->children as $xml_subsection_cnt => $xml_subsection ) {\n\t\t\t\t\t\tif (!isset($xml_subsection->attrs[\"id\"]) || (isset($xml_subsection->attrs[\"id\"]) && !in_array($xml_subsection->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t\t\t\t$subsection = array();\n\t\t\t\t\t\t\t$subsection[\"name\"] = (isset($lang[$xml_subsection->attrs[\"name\"]]) ? $lang[$xml_subsection->attrs[\"name\"]] : $xml_subsection->attrs[\"name\"]);\n\t\t\t\t\t\t\t$subsection[\"link\"] = $xml_subsection->attrs[\"link\"];\n\t\t\t\t\t\t\tif ($xml_subsection->children) {\n\t\t\t\t\t\t\t\t$item = array();\n\t\t\t\t\t\t\t\tforeach ( $xml_subsection->children as $xml_item_cnt => $xml_item ) {\n\t\t\t\t\t\t\t\t\tif (!isset($xml_item->attrs[\"id\"]) || (isset($xml_item->attrs[\"id\"]) && !in_array($xml_item->attrs[\"id\"], $hide_mode_ids))) {\n\t\t\t\t\t\t\t\t\t\t$item[] = array(\"name\" => (isset($lang[$xml_item->attrs[\"name\"]]) ? $lang[$xml_item->attrs[\"name\"]] : $xml_item->attrs[\"name\"]), \"link\" => $xml_item->attrs[\"link\"]);\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\t$subsection[\"subsection\"] = $item;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$section[\"subsection\"][] = $subsection;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$map[] = $section;\n\t\t\t}\n\t\t}\n\t}\n\treturn $map;\n}", "public static function getMap()\n {\n return array(\n 'ID' => array(\n 'data_type' => 'integer',\n 'primary' => true,\n 'autocomplete' => true\n ),\n 'APP_ID' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateVarchar128'),\n ),\n 'CODE' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateVarchar128'),\n ),\n 'TYPE' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateType'),\n ),\n 'HANDLER' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateHandler'),\n ),\n 'DATE_ADD' => array(\n 'data_type' => 'datetime',\n 'default_value' => new Main\\Type\\DateTime(),\n ),\n 'AUTHOR_ID' => array(\n 'data_type' => 'integer',\n 'default_value' => 0,\n ),\n 'AUTHOR' => array(\n 'data_type' => '\\Bitrix\\Main\\UserTable',\n 'reference' => array(\n '=this.AUTHOR_ID' => 'ref.ID'\n ),\n 'join_type' => 'LEFT',\n ),\n );\n }", "public function tilemapservice() {\n $this->tilesdir = ROOT . DS . \"Data\" . DS . \"tiles\";\n // Set the content type to text/xml\n $this->response->type('text/xml');\n\n // List of all TileMaps\n $tileMaps = array();\n\n // Open the tiles directory and loop all layers assuming that one\n // subdirectory represents one layer.\n if ($handle = opendir($this->tilesdir)) {\n while (false !== ($layer = readdir($handle))) {\n // Exclude the current and parent directory and check if the\n // directory is not a file.\n if ($layer != \".\" && $layer != \"..\" && is_dir($this->tilesdir . DS . $layer)) {\n\n // Get the tilemapresource.xml file from the layer\n $resourceFile = \"$this->tilesdir/$layer/tilemapresource.xml\";\n // Check if the file exists and is readable\n if (!is_readable($resourceFile)) {\n throw new NotFoundException(\"Layer metadata not found.\");\n }\n\n // Open the xml file\n $doc = new DOMDocument();\n $doc->load($resourceFile);\n\n // Construct the layer url\n //$href = \"http://\" . $this->request->host() . \"/tms/1.0.0/\" . $layer . \"/\";\n $href = \"http://\" . $this->request->host() . DS . $this->rootService\n . DS . $this->tileMapService . DS . $layer . DS;\n // Extract the profile from the file\n $tileSetsNode = $doc->getElementsByTagName('TileSets')->item(0);\n $profile = $tileSetsNode->getAttribute('profile');\n // Extract the title from the file\n $titleNode = $doc->getElementsByTagName('Title')->item(0);\n $title = $titleNode->firstChild->textContent;\n // Finally extract the spatial reference system\n $srsNode = $doc->getElementsByTagName('SRS')->item(0);\n $srs = $srsNode->firstChild->textContent;\n\n // Add the current layer to the list of TileMaps\n array_push($tileMaps, array(\n 'href' => $href,\n 'title' => $title,\n 'srs' => $srs,\n 'profile' => $profile));\n }\n }\n // Close the directory handle\n closedir($handle);\n }\n\n // Set the list of TileMaps to the output\n $this->set('tileMaps', $tileMaps);\n // Set the url to the Root resource to the output\n $rootServices = \"http://\" . $this->request->host() . DS . $this->rootService;\n $this->set('rootServices', $rootServices);\n }", "function section__map(){\n return array(\n 'content'=>\"<div style='width:300px; height:300px' style='\n margin-left:auto; margin-right:auto;' id='map'></div>\",\n 'class'=>'main',\n 'label'=>'Map',\n 'order'=>'1'\n );\n }", "public static /*internal*/ function registerPrefixes()\n\t{\n\t\tif(count(self::$namespaces))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tself::$namespaces = array();\n\t\tself::$namespaces[self::xml] = 'xml';\n\t\tself::$namespaces[self::xmlns] = 'xmlms';\n\t\tself::$namespaces[self::rdf] = 'rdf';\n\t\tself::$namespaces[self::rdfs] = 'rdfs';\n\t\tself::$namespaces[self::owl] = 'owl';\n\t\tself::$namespaces[self::foaf] = 'foaf';\n\t\tself::$namespaces[self::skos] = 'skos';\n\t\tself::$namespaces[self::time] = 'time';\n\t\tself::$namespaces[self::dc] = 'dc';\n\t\tself::$namespaces[self::dcterms] = 'dct';\n\t\tself::$namespaces[self::rdfg] = 'rdfg';\n\t\tself::$namespaces[self::geo] = 'geo';\n\t\tself::$namespaces[self::frbr] = 'frbr';\n\t\tself::$namespaces[self::xhtml] = 'xhtml';\n\t\tself::$namespaces[self::xhv] = 'xhv';\n\t\tself::$namespaces[self::dcmit] = 'dcmit';\n\t\tself::$namespaces[self::xsd] = 'xsd';\n\t\tself::$namespaces[self::gn] = 'gn';\n\t\tself::$namespaces[self::exif] = 'exif';\n\t\tself::$namespaces[self::void] = 'void';\n\t\tself::$namespaces[self::olo] = 'olo';\t\t\n\t}", "function cc_update_map_address(){\n\t\n\t$path = ABSPATH . \"import/\";\n\t$file = FILE_XML_IMMOBILI; // nome del file\n\t$cometa = cc_get_unique_post_meta_values(\"_id_cometa\");\n\n\t$xml = @simplexml_load_file($path.$file);\t\n\n\tif($xml){\t\t\n\t\t\n\t\t$offerte = $xml->Offerte;\n\n\t\tif($offerte){\n\t\t\t\n\t\t\tforeach($offerte as $offerta){\n\t\t\t\t\n\t\t\t\t$idunique = (int) $offerta->Idimmobile; // campo univoco Cometa\n\t\t\t\t$post_id = array_search($idunique, $cometa);\n\t\t\t\t\n\t\t\t\tif(empty($post_id)) continue;\n\t\t\t\t\n\t\t\t\t$map_address = \"\";\n\n\t\t\t\t//$indirizzo = solo indirizzo (via e civico), map_adress = indirizzo completo con cap località e provincia per mappa\n\t\t\t\tif(!empty($offerta->Indirizzo)){\n\t\t\t\t\t$map_address .= (string) $offerta->Indirizzo;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!empty($offerta->NrCivico)){\n\t\t\t\t\t$map_address .= (string) \" \".$offerta->NrCivico;\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t// compilo map_address con cap, località e provincia solo se l'indirizzo (via + civico) è compilato\n\t\t\t\t// se non lo è vuol dire che non deve essere resa noto l'indirizzo esatto dell'immobile\n\t\t\t\tif(!empty($offerta->Comune) and !empty($map_address)){\n\n\t\t\t\t\t$comune = (string) $offerta->Comune;\n\t\t\t\t\t$comune = trim($comune);\n\t\t\t\t\t$map_address .= \", \";\n\n\t\t\t\t\t$cp = cc_get_cap_prov($comune);\n\t\t\t\t\tif(!empty($cp)) $map_address .= $cp['cap'].\" \"; \t\t\n\n\t\t\t\t\t$map_address .= $comune;\n\t\t\t\t\tif(!empty($cp)) $map_address .= \" (\".$cp['prov'].\")\"; \n\n\t\t\t\t}\n\n\t\t\t\t$map_address = trim($map_address);\n\t\t\t\tif($map_address[0] == ',') $map_address = substr($map_address, 2);\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tupdate_post_meta( $post_id, \"fave_property_map_address\", $map_address );\n\n\t\t\t\t$results[] = $post_id.\" => \".$idunique.\" - map_address: \".$map_address;\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$dbg = var_export($results, true);\n\t\n\t\t\tcc_import_immobili_error_log($dbg);\n\n\t\t\t\n\t\t}else{\n\t\t\tcc_import_immobili_error_log(\"no offerte!\");\n\t\t}\n\t\t\n\t}else{\n\t\tcc_import_immobili_error_log(\"no xml!\");\n\t}\n\t\n\t\n}", "function map(string $docuri) {\n $map = [\n 'title'=> 'carte '.$this->title,\n 'view'=> ['latlon'=> [47, 3], 'zoom'=> 6],\n ];\n $map['bases'] = [\n 'cartes'=> [\n 'title'=> \"Cartes IGN\",\n 'type'=> 'TileLayer',\n 'url'=> 'https://igngp.geoapi.fr/tile.php/cartes/{z}/{x}/{y}.jpg',\n 'options'=> [ 'minZoom'=> 0, 'maxZoom'=> 18, 'attribution'=> 'ign' ],\n ],\n 'orthos'=> [\n 'title'=> \"Ortho-images\",\n 'type'=> 'TileLayer',\n 'url'=> 'https://igngp.geoapi.fr/tile.php/orthos/{z}/{x}/{y}.jpg',\n 'options'=> [ 'minZoom'=> 0, 'maxZoom'=> 18, 'attribution'=> 'ign' ],\n ],\n 'whiteimg'=> [\n 'title'=> \"Fond blanc\",\n 'type'=> 'TileLayer',\n 'url'=> 'https://visu.gexplor.fr/utilityserver.php/whiteimg/{z}/{x}/{y}.jpg',\n 'options'=> [ 'minZoom'=> 0, 'maxZoom'=> 21 ],\n ],\n ];\n $map['defaultLayers'] = ['whiteimg'];\n \n $request_scheme = isset($_SERVER['REQUEST_SCHEME']) ? $_SERVER['REQUEST_SCHEME']\n : ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']=='on')) ? 'https' : 'http');\n foreach ($this->layers as $lyrid => $layer) {\n $overlay = [\n 'title'=> $layer['title'],\n 'type'=> 'UGeoJSONLayer',\n 'endpoint'=> \"$request_scheme://$_SERVER[SERVER_NAME]$_SERVER[SCRIPT_NAME]/$docuri/$lyrid\",\n ];\n foreach (['pointToLayer','style','minZoom','maxZoom'] as $key)\n if (isset($layer[$key]))\n $overlay[$key] = $layer[$key];\n elseif ($this->$key !== null)\n $overlay[$key] = $this->$key;\n\n $map['overlays'][$lyrid] = $overlay;\n if (isset($layer['displayedByDefault']))\n $map['defaultLayers'][] = $lyrid;\n }\n \n return new Map($map, \"$docuri/map\");\n }", "private function prepareResultMap() {\n $resultMap = [];\n foreach ($this->encodings as $encoding) {\n $map = \"_\" . $encoding . \"Map\";\n foreach ($this->$map as $ru => $fo) {\n $resultMap[$ru][] = $fo;\n }\n }\n $this->_resultMap = $resultMap;\n }", "public function mapClasses() {\n // TODO: this is needed when the class map is not created yet (i.e. at very first install).\n if (!is_dir($this->dir['tmp'])) {\n mkdir($this->dir['tmp']);\n }\n $fop = fopen(CLASS_MAP_FILE, 'w+');\n\n foreach ($this->modules_loaded as $module) {\n $autoload_paths = array('Common', 'Qtags');\n foreach ($autoload_paths as $autoload_path) {\n $full_autoload_path = $module['path'] . '/classes/' . $autoload_path;\n /**\n * Autoload module's qtags.\n */\n if (is_dir($full_autoload_path)) {\n $classes = $this->scanDirectory($full_autoload_path);\n foreach ($classes as $class) {\n // Parse the Qtag.\n $exp1 = explode('/', $class);\n $exp2 = explode('.', $exp1[count($exp1) - 1]);\n $item_name = $exp2[0];\n $this->class_map[$autoload_path][$item_name] = $full_autoload_path . '/' . $class;\n }\n }\n }\n }\n fwrite($fop, serialize($this->class_map));\n fclose($fop);\n }", "public static function getMap()\n { \n return array(\n 'ID' => array(\n 'data_type' => 'integer',\n 'primary' => true,\n 'autocomplete' => true,\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_ID_FIELD'),\n ),\n 'DATE_CHANGE' => array(\n 'data_type' => 'datetime',\n 'required' => true,\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_DATE_CHANGE_FIELD'),\n ),\n 'DATE_CREATE' => array(\n 'data_type' => 'datetime',\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_DATE_CREATE_FIELD'),\n ),\n 'ACTIVE' => array(\n 'data_type' => 'boolean',\n 'values' => array('N', 'Y'),\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_ACTIVE_FIELD'),\n ),\n 'SORT' => array(\n 'data_type' => 'integer',\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_SORT_FIELD'),\n ),\n 'NAME' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateName'),\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_NAME_FIELD'),\n ),\n 'DESCRIPTION' => array(\n 'data_type' => 'text',\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_DESCRIPTION_FIELD'),\n ),\n 'PARENT_CATEGORY_ID' => array(\n 'data_type' => 'integer',\n 'required' => true,\n 'title' => Loc::getMessage('SEOMETA_SECTION_CHPU_ENTITY_PARENT_CATEGORY_ID_FIELD'),\n ), \n );\n }", "function initialiseRecord() { //{{{\n global $map;\n \n $record = array();\n \n foreach (array_keys($map) as $tag) {\n $record[$tag] = array();\n }\n \n return $record;\n}", "public function prepare_getVillaMap($params)\n\t{\n\t\t$xml_string = \"strVillaURL=\".$params['strVillaURL'].\"\";\n\t\treturn $xml_string;\n\t}", "function si_custom_elements_icon_map( $icon_map ) {\n\t\t$icon_map['si_custom_elements'] = EXTENSION_URL . '/assets/svg/icons.svg';\n\t\treturn $icon_map;\n\t}", "public function get_sitemap_xml($url_list)\n {\n }", "function get_map($source)\n{\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_json = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('person', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n 'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_datajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'url' => array('accessURL', 2),\n 'format' => array('format', 2),\n );\n\n // 'dest_key' => array('source_key', dest_position)\n // for dest_position, 0/1/2 denotes root/extras/resources.\n $map_socratajson = array(\n 'title' => array('title', 0),\n 'notes' => array('description', 0),\n 'publisher' => array('publisher', 1),\n 'public_access_level' => array('accessLevel', 1),\n 'contact_email' => array('mbox', 1),\n 'contact_name' => array('contactPoint', 1),\n 'unique_id' => array('identifier', 1),\n 'tags' => array('keyword', 0),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('dataDictionary', 1),\n 'license_title' => array('license', 0),\n 'category' => array('theme', 1),\n 'spatial' => array('spatial', 1),\n 'temporal' => array('temporal', 1),\n 'release_date' => array('issued', 1),\n 'accrual_periodicity' => array('accrualPeriodicity', 1),\n 'related_documents' => array('references', 1),\n 'bureau_code' => array('bureauCode', 1),\n 'program_code' => array('programCode', 1),\n 'language' => array('language', 1),\n 'data_quality' => array('dataQuality', 1),\n 'homepage_url' => array('landingPage', 1),\n //'system_of_records' => array('systemOfRecords', 1),\n 'upload' => array('upload', 2),\n 'format' => array('format', 2),\n 'name' => array('name', 2),\n 'modified' => array('modified',1),\n );\n\n // 'dest_key' => array('source_key', dest_position, source_position)\n // 0/1/2 denotes root/extras/resources.\n $map_ckan = array(\n 'title' => array('title', 0, 0),\n 'notes' => array('notes', 0, 0),\n // hard-code publisher to orgnization.title in ckan_map for now.\n // todo: change this map structure.\n 'publisher' => array('place-holder', 1, 1),\n 'public_access_level' => array('access-level', 1, 1),\n 'contact_email' => array('contact-email', 1, 1),\n 'contact_name' => array('person', 1, 1),\n 'unique_id' => array('id', 1, 0),\n 'tags' => array('tags', 0, 1),\n 'tag_string' => array('keyword', 0),\n 'data_dictionary' => array('data-dictiionary', 1, 1), // there is a typo.\n 'license_title' => array('license_title', 0, 0),\n 'spatial' => array('spatial-text', 1, 1),\n 'temporal' => array('dataset-reference-date', 1, 1),\n 'release_date' => array('issued', 1, 1),\n 'accrual_periodicity' => array('frequency-of-update', 1, 1),\n 'related_documents' => array('references', 1, 1),\n 'language' => array('metadata-language', 1, 1),\n 'homepage_url' => array('url', 1, 0),\n 'url' => array('url', 2, 2),\n 'name' => array('name', 2, 2),\n 'format' => array('format', 2, 2),\n );\n\n $ret_map = \"map_$source\";\n return isset($$ret_map) ? $$ret_map : null;\n}", "private function generate_cache() \r\n\t{\r\n\t\t$contents = $this->check_solr_cache();\r\n\t\t$result = json_decode($contents, TRUE);\r\n\t\t$result = $result['response']['objects'];\r\n\t\t$geonames = new Geonames(DBNAME, DBUSER, DBPASS, DBTABLE);\r\n\t\t\r\n\t\t$out = \"{\\n\\\"items\\\": [\";\r\n\t\tforeach($result as $record) \r\n\t\t{\r\n\t\t\t$el = new Element();\r\n\t\t\t\r\n\t\t\t$el->pid = $record[EVENT_PID];\r\n\t\t\t$el->source = \"$this->server_base/islandora/object/$el->pid/\";\r\n\t\t\t\r\n\t\t\t$record = $record[EVENT_OBJECT];\r\n\t\t\t\r\n\t\t\t$el->group = $this->collection_name;\r\n\t\t\t$el->event_type = $this->get_event_type(); // Abstract function\r\n\t\t\t\r\n\t\t\t$el->date_type = \"Unknown\";\r\n\t\t\tif (isset($record[START_DATE][0]))\r\n\t\t\t{\r\n\t\t\t\t$el->start_date = Transformer::date_parse($record[START_DATE][0]);\r\n\t\t\t\t$el->date_type = Transformer::get_date_grain($el->start_date, $el->start_date);\r\n\t\t\t}\r\n\r\n\t\t\t$locgrain = \"Unknown\";\r\n\t\t\t$pointtype = \"Unknown\";\r\n\t\t\tif (isset($record[LOCATION_NAME][0]))\r\n\t\t\t{\r\n\t\t\t\t$point = $record[LOCATION_NAME][0];\r\n\t\t\t\t$location = $point;\r\n\r\n\t\t\t\t$geoxml = $geonames->get_results($point, 1, '', ''); \r\n\t\t\t\t\r\n\t\t\t\tif ($geoxml != NULL)\r\n\t\t\t\t{\r\n\t\t\t\t\t$geoxml = (object) $geoxml[0];\r\n\t\r\n\t\t\t\t\t$ctry = $geonames->get_country_name($geoxml->country_code);\r\n\t\t\t\t\tif ($ctry != \"\") \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$location .= \", $ctry\";\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t$el->location = $location;\r\n\t\t\t\t\t$el->asciiname = $geoxml->asciiname;\r\n\t\t\t\t\t$lat = $geoxml->latitude;\r\n\t\t\t\t\t$lon = $geoxml->longitude;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($lon != \"\" && $lat != \"\") \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$el->lat_lng = \"$lat,$lon\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$pointtype = \"Point\";\r\n\t\t\t\t\t$locgrain = $geonames->get_location_grain($geoxml->feature_class, $geoxml->feature_code);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$el->location_type = $locgrain;\r\n\t\t\t$el->point_type = $pointtype;\r\n\r\n\t\t\t$el->long_label = str_replace('\"', \"'\", $record[LONG_TITLE][0]);\r\n\t\t\t$el->label = Transformer::neat_trim($el->long_label, 35);\r\n\t\t\t$el->label = Transformer::format_label($el->label, $el->start_date, $el->end_date, $el->location);\r\n\t\t\t$el->description = str_replace('\"', \"\", $record[DESCRIPTION][0]);\r\n\t\t\t\r\n\t\t\t$out .= Transformer::output_element($el);\r\n\t\t}\r\n\t\t$out .= \"\\n]\\n}\";\r\n\t\t$this->write_cache($out);\r\n\t}", "function make_kml_head()\n{\n\t$output = \n'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<kml xmlns=\"http://earth.google.com/kml/2.2\">\n<Document>\n\t<name>Picture the past data</name>\n\t<Style id=\"photo_placemark_style_highlight\">\n\t\t<IconStyle>\n\t\t\t<scale>1.4</scale>\n\t\t\t<Icon>\n\t\t\t\t<href>' . SITE_ROOT . '/images/camera.png</href>\n\t\t\t</Icon>\n\t\t\t<hotSpot x=\"0.5\" y=\"0.5\" xunits=\"fraction\" yunits=\"fraction\"/>\n\t\t</IconStyle>\n\t\t<LabelStyle>\n\t\t\t<color>ff00aaff</color>\n\t\t</LabelStyle>\n\t</Style>\n\t<Style id=\"photo_placemark_style_normal\">\n\t\t<IconStyle>\n\t\t\t<scale>1.2</scale>\n\t\t\t<Icon>\n\t\t\t\t<href>' . SITE_ROOT . '/images/camera.png</href>\n\t\t\t</Icon>\n\t\t\t<hotSpot x=\"0.5\" y=\"0.5\" xunits=\"fraction\" yunits=\"fraction\"/>\n\t\t</IconStyle>\n\t\t<LabelStyle>\n\t\t\t<color>ff00aaff</color>\n\t\t</LabelStyle>\n\t</Style>\n\t<StyleMap id=\"photo_placemark_style\">\n\t\t<Pair>\n\t\t\t<key>normal</key>\n\t\t\t<styleUrl>#photo_placemark_style_normal</styleUrl>\n\t\t</Pair>\n\t\t<Pair>\n\t\t\t<key>highlight</key>\n\t\t\t<styleUrl>#photo_placemark_style_highlight</styleUrl>\n\t\t</Pair>\n\t</StyleMap>\n\t<Folder>\n\t\t<name>Picture the Past Photo Collection</name>\n\t\t<open>1</open>\n\t\t<LookAt>\n\t\t\t<longitude>-1.15050</longitude>\n\t\t\t<latitude>52.95333</latitude>\n\t\t\t<altitude>0</altitude>\n\t\t\t<range>873</range>\n\t\t\t<tilt>0.0</tilt>\n\t\t\t<heading>-16</heading>\n\t\t</LookAt>\n\t\t<Style>\n\t\t\t<ListStyle>\n\t\t\t\t<listItemType>check</listItemType>\n\t\t\t\t<bgColor>00ffffff</bgColor>\n\t\t\t</ListStyle>\n\t\t</Style>\n\t\t<Folder>\n\t\t\t<name>Photos</name>\n';\n\treturn $output; \n}", "protected function getArgumentMap()\n {\n $argMap = parent::getArgumentMap();\n\n //common paramters for all getXXXRecommendation style queries...\n $this->addParameterToMap($argMap, \"nbRec\", $this->parameter->getNbRecommendation() );\n $this->addParameterToMap($argMap, \"showAds\", $this->parameter->getShowAds() ? \"true\" : \"false\" );\n $this->addParameterToMap($argMap, \"userID\", $this->parameter->getUserId());\n $this->addParameterToMap($argMap, \"classID\", $this->parameter->getProfileMapId());\n $this->addParameterToMap($argMap, \"languageCode\", $this->parameter->getLanguageCode());\n $this->addParameterToMap($argMap, \"referURL\", $this->parameter->getRefererUrl());\n \n $bufferKeys = \"\";\n $bufferValues = \"\";\n\n //implode the key values pairs into separate strings\n Utils::implodeKeyValuePairsToSeparatedString( $this->parameter->getConditions(), \"_/_\", $bufferKeys, $bufferValues);\n\n //add parameters\n $this->addParameterToMap($argMap, \"attributeNames\", $bufferKeys);\n $this->addParameterToMap($argMap, \"attributeValues\", $bufferValues);\n\n return $argMap;\n }", "public function processIncludes() {}", "function get_features()\n{\n\tglobal $serverinfo;\n\n\tif (!($xml = file_get_contents($serverinfo)))\n\t{\n\t\tthrow new Exception(\"Serverinfo '$serverinfo' NOT found!\");\n\t}\n\t$matches = null;\n\tpreg_match_all('|(<!--\\s*)?<feature>([^<]+)</feature>\\s*(<!--\\s*(.*)\\s*-->)?|m', $xml, $matches, PREG_SET_ORDER);\n\t$features = array();\n\tforeach($matches as $feature)\n\t{\n\t\t$features[$feature[2]] = array(\n\t\t\t'name' => $feature[2],\n\t\t\t'enabled' => !$feature[1],\n\t\t\t'description' => !empty($feature[4]) ? $feature[4] : $feature[2],\n\t\t);\n\t}\n\treturn $features;\n}", "protected function _resourceMap()\n\t{\n\t\t$resourceMap = new \\ResourceMapGenerator();\n\t\t$id = '';\n\n\t\t// Retrieves the ID from alias\n\t\tif (substr(strtolower($this->_alias), -4) == '.rdf')\n\t\t{\n\t\t\t$lastSlash = strrpos($this->_alias, '/');\n\t\t\t$lastDot = strrpos($this->_alias, '.rdf');\n\t\t\t$id = substr($this->_alias, $lastSlash, $lastDot);\n\t\t}\n\n\t\t// Create download headers\n\t\t$resourceMap->pushDownload($this->config->get('webpath'));\n\t\texit;\n\t}", "public function getCidMap() {}", "public function getSitemapXml()\n {\n $sitemap = App::make(\"sitemap\");\n\n\n // add item to the sitemap (url, date, priority, freq)\n\n $translations = null;\n $now = new \\DateTime();\n // $sitemap->setCache('laravel.sitemap', 3600);\n// check if there is cached sitemap and build new only if is not\n if (1) {\n // add item with translations (url, date, priority, freq, images, title, translations)\n $translations = [];\n\n $translations = [\n ['language' => 'it', 'url' => URL::to(\"/it\")],\n ];\n $sitemap->add(URL::to(\"/en\"), $now->format('Y-m-d h:i:s'), '1', 'monthly', [], null, $translations);\n\n\n $translations = [\n ['language' => 'it', 'url' => URL::to(\"/it/jobs\")],\n ];\n $sitemap->add(URL::to(\"/en/jobs\"), $now->format('Y-m-d h:i:s'), '1', 'monthly', [], null, $translations);\n\n $translations = [\n ['language' => 'it', 'url' => URL::to(\"/it/company\")],\n ];\n $sitemap->add(URL::to(\"/en/company\"), $now->format('Y-m-d h:i:s'), '1', 'monthly', [], null, $translations);\n\n $translations = [\n ['language' => 'it', 'url' => URL::to(\"/it/login\")],\n ];\n $sitemap->add(URL::to(\"/en/login\"), $now->format('Y-m-d h:i:s'), '0.8', 'monthly', [], null, $translations);\n\n $translations = [\n ['language' => 'it', 'url' => URL::to(\"/it/register/user\")],\n ];\n $sitemap->add(URL::to(\"/en/register/user\"), $now->format('Y-m-d h:i:s'), '0.8', 'monthly', [], null, $translations);\n\n $translations = [\n ['language' => 'it', 'url' => URL::to(\"/it/password/recovery\")],\n ];\n $sitemap->add(URL::to(\"/en/password/recovery\"), $now->format('Y-m-d h:i:s'), '0.8', 'monthly', [], null, $translations);\n\n $translations = [\n ['language' => 'it', 'url' => URL::to(\"/it/manifesto\")],\n ];\n $sitemap->add(URL::to(\"/en/manifesto\"), $now->format('Y-m-d h:i:s'), '0.8', 'monthly', [], null, $translations);\n\n\n $translations = [\n ['language' => 'it', 'url' => URL::to(\"/it/tech\")],\n ];\n $sitemap->add(URL::to(\"/en/tech\"), $now->format('Y-m-d h:i:s'), '0.75', 'monthly', [], null, $translations);\n\n\n // get all posts from db\n $client = App::make('client.api');\n\n\n $response = $client->request('GET', \"/api/company?isVisible=true&offset=0&serializerGroup=sitemap\");\n $companies = json_decode($response->getBody()->getContents(), true);\n // add every post to the sitemap\n foreach ($companies as $company) {\n\n\n $sitemap->add(URL::to(\"/en/\" . $company['permalink']), $now->format('Y-m-d h:i:s'), \"0.7\", \"daily\");\n $sitemap->add(URL::to(\"/it/\" . $company['permalink']), $now->format('Y-m-d h:i:s'), \"0.7\", \"daily\");\n\n\n foreach ($company['vacancies'] as $vacancy) {\n $translations = [\n ];\n if ($vacancy['is_visible']) {\n $sitemap->add(URL::to(\"/en/\" . $company['permalink'] . \"/\" . $vacancy['permalink']), $now->format('Y-m-d h:i:s'), \"0.7\", \"daily\");\n $sitemap->add(URL::to(\"/it/\" . $company['permalink'] . \"/\" . $vacancy['permalink']), $now->format('Y-m-d h:i:s'), \"0.7\", \"daily\");\n }\n\n }\n\n }\n\n\n $response = $client->request('GET', \"/api/tags/category/JOBFUNCTION\");\n $jobFunctions = json_decode($response->getBody()->getContents(), true);\n foreach ($jobFunctions as $jobFunction) {\n\n $sitemap->add(\"http://meritocracy.is/job-opportunities/\" . $jobFunction['permalink_en'], $now->format('Y-m-d h:i:s'), \"0.7\", \"daily\");\n $sitemap->add(\"http://meritocracy.is/annunci-lavoro/\" . $jobFunction['permalink_it'], $now->format('Y-m-d h:i:s'), \"0.7\", \"daily\");\n }\n\n };\n\n\n // show your sitemap (options: 'xml' (default), 'html', 'txt', 'ror-rss', 'ror-rdf')\n return $sitemap->render('xml');\n\n }", "public function sitemap_feed() {\n $output = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $output .= '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\">';\n\n // Products\n $this->load->model('tool/image');\n\n $products = $this->{$this->callModel}->getProducts();\n\n foreach ($products as $product) {\n if ($product['image'] && file_exists(DIR_IMAGE . $product['image'])) {\n $product_name = $this->escape($product['name']);\n $date = (strtotime($product['date_modified']) == -62169984000) || (strtotime($product['date_modified']) == -62169962400) ? date('Y-m-d\\TH:i:sP', strtotime(0)) : date('Y-m-d\\TH:i:sP', strtotime($product['date_modified']));\n \n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link('product/product', 'product_id=' . $product['product_id'])) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= '  <lastmod>' . $date . '</lastmod>';\n $output .= ' <priority>1.0</priority>';\n $output .= ' <image:image>';\n $output .= ' <image:loc>' . $this->model_tool_image->resize($product['image'], 300, 200) . '</image:loc>';\n $output .= ' <image:caption>' . $product_name . '</image:caption>';\n $output .= ' <image:title>' . $product_name . '</image:title>';\n $output .= ' </image:image>';\n $output .= '</url>';\n }\n }\n\n // Categories\n $this->load->model('catalog/category');\n\n $output .= $this->getCategories(0);\n\n // Manufacturer\n $this->load->model('catalog/manufacturer');\n\n $manufacturers = $this->model_catalog_manufacturer->getManufacturers();\n\n foreach ($manufacturers as $manufacturer) {\n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link('product/manufacturer/info', 'manufacturer_id=' . $manufacturer['manufacturer_id'])) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= ' <priority>0.7</priority>';\n $output .= '</url>';\n\n if ($this->{$this->callModel}->getSetting('feed_manufacturer_product')) {\n $products = $this->{$this->callModel}->getProducts(array('filter_manufacturer_id' => $manufacturer['manufacturer_id']));\n\n foreach ($products as $product) {\n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link('product/product', 'manufacturer_id=' . $manufacturer['manufacturer_id'] . '&product_id=' . $product['product_id'])) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= ' <priority>1.0</priority>';\n $output .= '</url>';\n }\n }\n }\n\n // Information\n $this->load->model('catalog/information');\n\n $informations = $this->model_catalog_information->getInformations();\n\n foreach ($informations as $information) {\n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link('information/information', 'information_id=' . $information['information_id'])) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= ' <priority>0.5</priority>';\n $output .= '</url>';\n }\n\n // SEO Backpack - custom URL\n $this->load->model('extension/module/isenselabs_seo');\n $urls = $this->model_extension_module_isenselabs_seo->getCustomUrls();\n\n foreach ($urls as $url) {\n $output .= '<url>';\n $output .= ' <loc>' . $this->escape($this->url->link($url)) . '</loc>';\n $output .= ' <changefreq>weekly</changefreq>';\n $output .= ' <priority>0.5</priority>';\n $output .= '</url>';\n }\n\n // ===\n\n $output .= '</urlset>';\n\n $this->response->addHeader('Content-Type: application/xml');\n $this->response->setOutput($output);\n }", "public function sitemapAction() {\n\t\t\n\t\t$urls = array(\n\t\t\t'/',\n\t\t\t'/contact',\n\t\t\t'/map'\n\t\t);\n\t\t\n\t\t$regionDb = Yadda_Db_Table::getInstance('region');\n\t\t$select = $regionDb\n\t\t\t->select()\n\t\t\t->from('region', array('id'))\n\t\t\t->order('name');\n\t\t$regions = $regionDb->fetchAll($select);\n\t\tforeach ($regions as $region) {\n\t\t\t$urls[] = $this->view->url(array(), 'search').'?region='.urlencode($region['id']);\n\t\t}\n\t\t\n\t\t// generate XML\n\t\t\n\t\t$xml = new DOMDocument('1.0', 'utf-8');\n\t\t\n\t\t$urlset = $xml->createElement('urlset');\n\t\t$urlset->setAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');\n\t\t$xml->appendChild($urlset);\n\t\t\n\t\tforeach ($urls as $url) {\n\t\t\t$loc = $xml->createElement('loc', 'http://'.$_SERVER['HTTP_HOST'].$url);\n\t\t\t$url = $xml->createElement('url');\n\t\t\t$url->appendChild($loc);\n\t\t\t$urlset->appendChild($url);\n\t\t}\n\t\t\n\t\t$this->getResponse()->setHeader('Content-Type', 'text/xml');\n\t\t$this->getResponse()->setBody($xml->saveXML(null, LIBXML_NOEMPTYTAG));\n\t\t$this->getResponse()->sendResponse();\n\t\tdie;\n\t\t/*\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\n xmlns:image=\"http://www.sitemaps.org/schemas/sitemap-image/1.1\"\n xmlns:video=\"http://www.sitemaps.org/schemas/sitemap-video/1.1\">\n <url> \n <loc>http://www.example.com/foo.html</loc> \n <image:image>\n <image:loc>http://example.com/image.jpg</image:loc> \n </image:image>\n <video:video> \n <video:content_loc>http://www.example.com/video123.flv</video:content_loc>\n <video:thumbnail_loc>http://www.example.com/thumbs/123.jpg</video:thumbnail_loc>\n <video:player_loc allow_embed=\"yes\" autoplay=\"ap=1\">http://www.example.com/videoplayer.swf?video=123</video:player_loc>\n <video:title>Grilling steaks for summer</video:title> \n <video:description>Get perfectly done steaks every time</video:description>\n </video:video>\n </url>\n</urlset>\n\t\t */\n\t}", "public function getConfigurationsMap()\n {\n $sel = $this->getAllConfigurations();\n $arr = array();\n foreach ($sel as $cf)\n $arr[$cf->identifier] = $cf->identifier;\n \n return $arr;\n }", "abstract protected function buildData(DOMDocument $xml);", "protected function addIndex()\n {\n $sitemapIndexHeader = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n . ($this->includeGeneratorInfo ? $this::$generatorInfo : '')\n . '<sitemapindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"'\n . ' xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9'\n . ' http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd\"'\n . ' xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">'\n . '</sitemapindex>';\n $this->indexes[] = [\n 'xml' => new \\SimpleXMLElement($sitemapIndexHeader),\n 'filename' => '',\n ];\n }", "function xmlProvider() {\n\n return [\n [\n 'hello',\n 'hello',\n ],\n [\n '<element>hello</element>',\n '<element xmlns=\"http://sabredav.org/ns\">hello</element>'\n ],\n [\n '<element foo=\"bar\">hello</element>',\n '<element xmlns=\"http://sabredav.org/ns\" foo=\"bar\">hello</element>'\n ],\n [\n '<element x1:foo=\"bar\" xmlns:x1=\"http://example.org/ns\">hello</element>',\n '<element xmlns:x1=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\" x1:foo=\"bar\">hello</element>'\n ],\n [\n '<element xmlns=\"http://example.org/ns\">hello</element>',\n '<element xmlns=\"http://example.org/ns\">hello</element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\">hello</x1:element>',\n ],\n [\n '<element xmlns:foo=\"http://example.org/ns\">hello</element>',\n '<element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\">hello</element>',\n '<element>hello</element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\">hello</foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\">hello</foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\">hello</x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child>hello</child></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child>hello</child></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child>hello</child></x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child/></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child/></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child/></x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child a=\"b\"/></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child a=\"b\"/></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child a=\"b\"/></x1:element>',\n ],\n ];\n\n }", "static public function getDataMap()\n {\n return array(\n 'fields' => array(\n 'channel_code' => array(\n 'type' => 'string',\n ),\n 'time' => array(\n 'type' => 'date',\n ),\n ),\n 'references' => array(\n\n ),\n 'embeddeds' => array(\n\n ),\n 'relations' => array(\n\n ),\n );\n }", "public function getMap() {\n return [\n 'sku' => 'itemNo',\n 'shortDescription' => 'description',\n 'longDescription' => 'description2',\n 'measurementUnit' => 'unitOfMeasure',\n 'mpn' => 'vendorItemNo',\n 'ean' => 'eanNo',\n ];\n }", "protected function generate()\n {\n // first of all we will get the version, so we will later know about changes made DURING indexing\n $this->version = $this->findVersion();\n\n // get the iterator over our project files and create a regex iterator to filter what we got\n $recursiveIterator = $this->getProjectIterator();\n $regexIterator = new \\RegexIterator($recursiveIterator, '/^.+\\.php$/i', \\RecursiveRegexIterator::GET_MATCH);\n\n // get the list of enforced files\n $enforcedFiles= $this->getEnforcedFiles();\n\n // if we got namespaces which are omitted from enforcement we have to mark them as such\n $omittedNamespaces = array();\n if ($this->config->hasValue('enforcement/omit')) {\n $omittedNamespaces = $this->config->getValue('enforcement/omit');\n }\n\n // iterator over our project files and add array based structure representations\n foreach ($regexIterator as $file) {\n // get the identifiers if any.\n $identifier = $this->findIdentifier($file[0]);\n\n // if we got an identifier we can build up a new map entry\n if ($identifier !== false) {\n // We need to get our array of needles\n $needles = array(\n Invariant::ANNOTATION,\n Ensures::ANNOTATION,\n Requires::ANNOTATION,\n After::ANNOTATION,\n AfterReturning::ANNOTATION,\n AfterThrowing::ANNOTATION,\n Around::ANNOTATION,\n Before::ANNOTATION,\n Introduce::ANNOTATION,\n Pointcut::ANNOTATION\n );\n\n // If we have to enforce things like @param or @returns, we have to be more sensitive\n if ($this->config->getValue('enforcement/enforce-default-type-safety') === true) {\n $needles[] = '@var';\n $needles[] = '@param';\n $needles[] = '@return';\n }\n\n // check if the file has contracts and if it should be enforced\n $hasAnnotations = $this->findAnnotations($file[0], $needles);\n\n // create the entry\n $this->map[$identifier[1]] = array(\n 'cTime' => filectime($file[0]),\n 'identifier' => $identifier[1],\n 'path' => $file[0],\n 'type' => $identifier[0],\n 'hasAnnotations' => $hasAnnotations,\n 'enforced' => $this->isFileEnforced(\n $file[0],\n $identifier[1],\n $hasAnnotations,\n $enforcedFiles,\n $omittedNamespaces\n )\n );\n }\n }\n\n // save for later reuse.\n $this->save();\n }", "public function buildTaskMap(){\n\t\t$loadWebPageTask = DataClassLoader::createInstance('Modules.Website.Tasks.LoadStaticPage');\n\t\t$this->tasks['LoadWebsitePage'] = $loadWebPageTask;\n\t\t\n\t\t$this->taskMap['Inputs'][] = array('Enabled'=>'LoadWebsitePage.Enabled');\n\t\t$this->taskMap['Inputs'][] = array('Domain'=>'LoadWebsitePage.Domain');\n\t\t$this->taskMap['Inputs'][] = array('PagePath'=>'LoadWebsitePage.PagePath');\n\t\t\n\t\t//$showPageTask = DataClassLoader::createInstance('Modules.Website.Tasks.ShowPage');\n\t\t//$this->tasks['ShowWebPage'] = $showPageTask;\n\t\t\n\t\t\n\t\t//build the output HTML Task\n\t\t$outputHTMLTask = DataClassLoader::createInstance('Modules.Website.Tasks.SendHTMLResponse');\n\t\t$this->tasks['OutputHTML'] = $outputHTMLTask;\n\t\t\n\t\t$this->taskMap['LoadWebsitePage'][] = array('PageLoaded'=>'OutputHTML.Enabled');\n\t\t$this->taskMap['LoadWebsitePage'][] = array('WebsitePage.PageHTML'=>'OutputHTML.HTMLString');\n\t\t\n\t}", "protected function generateMapFile()\n {\n $namespace = $this->getNamespace();\n $class = $this->options['class'];\n\n $php = <<<EOD\n<?php\n\nnamespace $namespace;\n\nuse $namespace\\\\Base\\\\${class}Map as Base${class}Map;\nuse $namespace\\\\${class};\nuse \\\\Pomm\\\\Exception\\\\Exception;\nuse \\\\Pomm\\\\Query\\\\Where;\n\nclass ${class}Map extends Base${class}Map\n{\n}\n\nEOD;\n\n return $php;\n }", "public function __construct(XMLDocument $x = null) {\n \n // initialize the string map\n $this->dbc = new StringMap();\n \n // set the values\n $this->dbc->set(\"name\",\n $x->xpath(\"normalize-space(string(//database/@name))\")); \n $this->dbc->set(\"type\",\n $x->xpath(\"normalize-space(string(//database/type))\")); \n $this->dbc->set(\"driver\",\n $x->xpath(\"normalize-space(string(//database/driver))\")); \n $this->dbc->set(\"host\",\n $x->xpath(\"normalize-space(string(//database/host))\")); \n $this->dbc->set(\"port\",\n $x->xpath(\"normalize-space(string(//database/port))\")); \n $this->dbc->set(\"user\",\n $x->xpath(\"normalize-space(string(//database/user))\")); \n $this->dbc->set(\"pass\",\n $x->xpath(\"normalize-space(string(//database/pass))\")); \n $this->dbc->set(\"db\",\n $x->xpath(\"normalize-space(string(//database/db))\")); \n $this->dbc->set(\"ssl\",\n $x->xpath(\"normalize-space(string(//database/ssl))\")); \n $this->dbc->set(\"persistent\",\n $x->xpath(\"normalize-space(string(//database/persistent))\"));\n $this->dbc->set(\"charset\",\n $x->xpath(\"normalize-space(string(//database/charset))\")); \n $this->dbc->set(\"timeout\",\n $x->xpath(\"normalize-space(string(//database/timeout))\")); \n\n }", "protected function configure() {\n\n $this->xmlconfig = array(\n \"name\" => array(\"xpath\" => \"mads:authority/mads:name\", \"class_name\" => \"mads_name\"),\n\n \"permanent\" => array(\"xpath\" => \"mads:affiliation[mads:position = 'permanent resident']\",\n \"class_name\" => \"mads_affiliation\"),\n \"current\" => array(\"xpath\" => \"mads:affiliation[mads:position != 'permanent resident']\",\n \"class_name\" => \"mads_affiliation\"),\n \"netid\" => array(\"xpath\" => \"mads:identifier[@type='netid']\"),\n );\n }", "public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'FORUM_ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t\t'title' => Loc::getMessage('FORUM_SITE_TABLE_FIELD_FORUM_ID'),\n\t\t\t),\n\t\t\t'SITE_ID' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'primary' => true,\n\t\t\t\t'validation' => array(__CLASS__, 'validateSiteId'),\n\t\t\t\t'title' => Loc::getMessage('FORUM_SITE_TABLE_FIELD_SITE_ID'),\n\t\t\t),\n\t\t\t'PATH2FORUM_MESSAGE' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'validation' => array(__CLASS__, 'validatePath'),\n\t\t\t\t'title' => Loc::getMessage('FORUM_SITE_TABLE_FIELD_SITE_ID'),\n\t\t\t),\n\t\t\t'FORUM' => array(\n\t\t\t\t'data_type' => 'Bitrix\\Forum\\Forum',\n\t\t\t\t'reference' => array('=this.FORUM_ID' => 'ref.ID')\n\t\t\t),\n\t\t\t'SITE' => array(\n\t\t\t\t'data_type' => 'Bitrix\\Main\\Site',\n\t\t\t\t'reference' => array('=this.SITE_ID' => 'ref.LID'),\n\t\t\t),\n\t\t);\n\t}", "function siteMap($node, $lang='en', $wide_info=false){\r\n\t\t$dir = \"sitemaps\";\r\n\t\t$lang = $this->CFG->lang;\r\n\t\t$db = $this->DB->dbName;\r\n\t\t$fname = \"sitemap_\".$db.\"_\".$node.\"_\".$lang.\".xml\";\r\n\t\tif(!($xml = $this->getCache($dir, $fname))){\r\n\t\t\t$xml = $this->cache__siteMap($node, $lang, $wide_info);\r\n\t\t\t$this->newCache($dir, $fname, $xml);\r\n\t\t\t//print \"newcache [$dir]\";\r\n\t\t} //else print \"readcache [$dir/$fname]\";\r\n\t\t//print \"<textarea>$xml</textarea>\";\r\n\t\treturn $xml;\r\n\t}", "private function generateSiteMapCategories()\n {\n $max \t\t= $this->model_extension_module_siteMapGenerate->countCategories();\n $step \t\t= 50000;\n $count \t\t= 0;\n $fileNumber = 1;\n\n while ($count <= $max) {\n $output = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $output .= '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">';\n $categories\t= $this->model_extension_module_siteMapGenerate->getCategories($step, $count);\n\n foreach ($categories as $category) {\n $outputCategory = $this->generateUrlCategory($category['category_id'], $category['parent_id']);\n $output .= '<url>';\n $output .= '<loc>' . $outputCategory . '</loc>';\n $output .= '<changefreq>weekly</changefreq>';\n $output .= '<priority>1.0</priority>';\n $output .= '</url>';\n }\n\n $output \t.= '</urlset>';\n $this->response->addHeader('Content-Type: application/xml');\n\n $siteMapName = (!file_exists(DIR_MAIN . 'sitemap-categories.xml')) ? 'sitemap-categories' : 'sitemap-categories-' . $fileNumber;\n $siteMapXmlUrl = DIR_MAIN . $siteMapName . '.xml';\n $openedFile = fopen($siteMapXmlUrl, 'w');\n chmod($siteMapXmlUrl, 0775);\n file_put_contents($siteMapXmlUrl, $output);\n fclose($openedFile);\n\n array_push($this->includedFiles, $siteMapXmlUrl);\n\n if (file_exists(DIR_MAIN . 'sitemap-categories-' . $fileNumber . '.xml')) $fileNumber++;\n $count = $count + $step;\n }\n }", "public static function attributeMap();", "function init_accessMap(){\n\t$map = array(\n\t\t/* user */\n\t\t'user.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'user.get_others' => array('root', 'admin'),\n\n\t\t/* logs */\n\t\t'logs.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'logs.get_others' => array('root', 'admin'),\n\n\t\t/* site */\n\t\t'site.add' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.get_others' => array('root', 'admin'),\n\t\t'site.update' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.update_others' => array('root', 'admin'),\n\t\t'site.remove' => array('root', 'admin', 'developer', 'normal'),\n\t\t'site.remove_others' => array('root', 'admin'),\n\n\t\t/* pattern */\n\t\t'pattern.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'pattern.get_others' => array('root', 'admin'),\n\t\t'pattern.add' => array('root', 'admin', 'developer', 'normal'),\n\t\t'pattern.remove' => array('root', 'admin', 'developer', 'normal'),\n\t\t'pattern.remove_others' => array('root', 'admin'),\n\n\t\t/* count data */\n\t\t'count.get' => array('root', 'admin', 'developer', 'normal'),\n\t\t'count.get_others' => array('root', 'admin'),\n\n\t\t/* ucenter entry show control */\n\t\t'ucenter.home' => array('root', 'admin', 'developer', 'normal'),\n\t\t'ucenter.sites' => array('root', 'admin', 'developer', 'normal'),\n\t\t'ucenter.logs' => array('root', 'admin', 'developer', 'normal'),\n\t\t'ucenter.logs_all' => array('root', 'admin'),\n\t\t'ucenter.sites_all' => array('root', 'admin'),\n\t\t'ucenter.visitors' => array('root', 'admin'),\n\t);\n\tAccessController::setMap($map);\n}", "static public function getDataMap()\n {\n return array(\n 'fields' => array(\n 'rev' => array(\n 'type' => 'integer',\n ),\n 'cover' => array(\n 'type' => 'string',\n ),\n 'wiki_id' => array(\n 'type' => 'integer',\n ),\n 'title' => array(\n 'type' => 'string',\n ),\n 'html_cache' => array(\n 'type' => 'string',\n ),\n 'content' => array(\n 'type' => 'string',\n ),\n 'tags' => array(\n 'type' => 'raw',\n ),\n 'comment_tags' => array(\n 'type' => 'raw',\n ),\n 'model' => array(\n 'type' => 'string',\n ),\n 'has_video' => array(\n 'type' => 'integer',\n ),\n 'like_num' => array(\n 'type' => 'integer',\n ),\n 'dislike_num' => array(\n 'type' => 'integer',\n ),\n 'watched_num' => array(\n 'type' => 'integer',\n ),\n 'admin_id' => array(\n 'type' => 'integer',\n ),\n 'do_date' => array(\n 'type' => 'date',\n ),\n 'source' => array(\n 'type' => 'raw',\n ),\n 'tvsou_id' => array(\n 'type' => 'string',\n ),\n 'first_letter' => array(\n 'type' => 'string',\n ),\n 'douban_id' => array(\n 'type' => 'string',\n ),\n 'verify' => array(\n 'type' => 'integer',\n ),\n 'created_at' => array(\n 'type' => 'date',\n ),\n 'updated_at' => array(\n 'type' => 'date',\n ),\n ),\n 'references' => array(\n\n ),\n 'embeddeds' => array(\n\n ),\n 'relations' => array(\n\n ),\n );\n }", "public function getSitemapXml()\n {\n $this->addLine('<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">');\n\n $this->generateLinks();\n $this->generateCollections();\n\n $this->addLine('</urlset>');\n\n $output = implode('', $this->lines);\n\n return $output;\n }", "public static function buildTableMap()\n {\n $dbMap = Propel::getServiceContainer()->getDatabaseMap(MenuConfigTableMap::DATABASE_NAME);\n if (!$dbMap->hasTable(MenuConfigTableMap::TABLE_NAME)) {\n $dbMap->addTableObject(new MenuConfigTableMap());\n }\n }", "function getMaps(){\r\n require $this->sRessourcesFile;\r\n if (in_array(\"maps\", $this->aSelectedFields)){\r\n $aParams['sSchemaVmap'] = array('value' => $this->aProperties['schema_vmap'], 'type' => 'schema_name');\r\n $aParams['group_id'] = array('value' => $this->aValues['my_vitis_id'], 'type' => 'number');\r\n $oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getGroupMaps'], $aParams);\r\n\t\t$sListMapId = \"\";\r\n\t\t$aListMapName = array();\r\n\t\twhile($aLigne=$this->oConnection->oBd->ligneSuivante ($oPDOresult)) {\r\n\t\t\tif ($sListMapId == \"\"){\r\n\t\t\t\t$sListMapId = $aLigne[\"map_id\"];\r\n\t\t\t}else{\r\n\t\t\t\t$sListMapId .= \"|\".$aLigne[\"map_id\"];\r\n\t\t\t}\r\n $aListMapName[] = $aLigne[\"name\"];\r\n\t\t}\r\n\t\t$oPDOresult=$this->oConnection->oBd->fermeResultat();\r\n $this->aFields['maps'] = $sListMapId;\r\n $this->aFields['maps_label'] = implode(',', $aListMapName);\r\n }\r\n }", "final public static function classMap()\n {\n return array (\n 'KAMODeparture' => 'HslOnnelaStructKAMODeparture',\n 'KAMOLine' => 'HslOnnelaStructKAMOLine',\n 'KAMOStop' => 'HslOnnelaStructKAMOStop',\n);\n }", "public function generateSiteMapProducts()\n {\n $this->load->model('extension/module/siteMapGenerate');\n $max \t\t= $this->model_extension_module_siteMapGenerate->countProducts();\n $step \t\t= 50000;\n $count \t\t= 0;\n $fileNumber = 0;\n\n while ($count <= $max) {\n $products = $this->model_extension_module_siteMapGenerate->getProducts($step, $count);\n\n $output \t= '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $output\t\t .= '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">';\n foreach ($products as $product) {\n $productAlias \t= $this->model_extension_module_siteMapGenerate->getProductAlias($product['product_id']);\n $categoryInfo \t= $this->model_extension_module_siteMapGenerate->getCategoryInfo($product['category_id']);\n if (isset($categoryInfo) && !empty($categoryInfo)) {\n $categoryUrl \t= $this->generateUrlCategory($categoryInfo['category_id'], $categoryInfo['parent_id']);\n $fullProductUrl = $categoryUrl . '/' . $productAlias;\n\n $output\t\t .= '<url>';\n $output \t .= '<loc>' . $fullProductUrl . '</loc>';\n $output \t .= '<changefreq>weekly</changefreq>';\n $output \t .= '<priority>1.0</priority>';\n $output \t .= '</url>';\n }\n }\n $output \t .= '</urlset>';\n $this->response->addHeader('Content-Type: application/xml');\n\n $siteMapName = (!file_exists(DIR_MAIN . 'sitemap-products.xml')) ? 'sitemap-products' : 'sitemap-products-' . $fileNumber;\n $siteMapXmlUrl = DIR_MAIN . $siteMapName . '.xml';\n $openedFile = fopen($siteMapXmlUrl, 'w');\n chmod($siteMapXmlUrl, 0775);\n file_put_contents($siteMapXmlUrl, $output);\n fclose($openedFile);\n\n array_push($this->includedFiles, $siteMapXmlUrl);\n $fileNumber++;\n $count = $count + $step;\n }\n }", "protected function buildXml()\n\t{\n\t\t$xml = new DOMDocument('1.0', 'utf8');\n\t\t$cra_inquiry = $xml->createElement('LoanRecord');\n\t\t$cra_inquiry->appendChild($this->buildData($xml));\n\t\t\n\t\t$xml->appendChild($cra_inquiry);\n\t\t\n\t\treturn $xml;\n\t}", "public static function _register()\n {\n self::assignElements([\n 'ListingDurations' => ['type' => 'ListingDurationDefinitionsType', 'xmlns' => self::XMLNS],\n 'ShippingTermsRequired' => ['type' => 'ShippingTermRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferEnabled' => ['type' => 'BestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'DutchBINEnabled' => ['type' => 'DutchBINEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'UserConsentRequired' => ['type' => 'UserConsentRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'HomePageFeaturedEnabled' => ['type' => 'HomePageFeaturedEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ProPackEnabled' => ['type' => 'ProPackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BasicUpgradePackEnabled' => ['type' => 'BasicUpgradePackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ValuePackEnabled' => ['type' => 'ValuePackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ProPackPlusEnabled' => ['type' => 'ProPackPlusEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'AdFormatEnabled' => ['type' => 'AdFormatEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferCounterEnabled' => ['type' => 'BestOfferCounterEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferAutoDeclineEnabled' => ['type' => 'BestOfferAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketSpecialitySubscription' => ['type' => 'LocalMarketSpecialitySubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketRegularSubscription' => ['type' => 'LocalMarketRegularSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketPremiumSubscription' => ['type' => 'LocalMarketPremiumSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketNonSubscription' => ['type' => 'LocalMarketNonSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'ExpressEnabled' => ['type' => 'ExpressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ExpressPicturesRequired' => ['type' => 'ExpressPicturesRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'ExpressConditionRequired' => ['type' => 'ExpressConditionRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'MinimumReservePrice' => ['type' => 'MinimumReservePriceDefinitionType', 'xmlns' => self::XMLNS],\n 'TransactionConfirmationRequestEnabled' => ['type' => 'TCREnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SellerContactDetailsEnabled' => ['type' => 'SellerContactDetailsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'StoreInventoryEnabled' => ['type' => 'StoreInventoryEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SkypeMeTransactionalEnabled' => ['type' => 'SkypeMeTransactionalEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SkypeMeNonTransactionalEnabled' => ['type' => 'SkypeMeNonTransactionalEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalListingDistancesRegular' => ['type' => 'LocalListingDistancesRegularDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalListingDistancesSpecialty' => ['type' => 'LocalListingDistancesSpecialtyDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalListingDistancesNonSubscription' => ['type' => 'LocalListingDistancesNonSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdPaymentMethodEnabled' => ['type' => 'ClassifiedAdPaymentMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdShippingMethodEnabled' => ['type' => 'ClassifiedAdShippingMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdBestOfferEnabled' => ['type' => 'ClassifiedAdBestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdCounterOfferEnabled' => ['type' => 'ClassifiedAdCounterOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdAutoDeclineEnabled' => ['type' => 'ClassifiedAdAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdContactByPhoneEnabled' => ['type' => 'ClassifiedAdContactByPhoneEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdContactByEmailEnabled' => ['type' => 'ClassifiedAdContactByEmailEnabledDefintionType', 'xmlns' => self::XMLNS],\n 'SafePaymentRequired' => ['type' => 'SafePaymentRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdPayPerLeadEnabled' => ['type' => 'ClassifiedAdPayPerLeadEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ItemSpecificsEnabled' => ['type' => 'ItemSpecificsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PaisaPayFullEscrowEnabled' => ['type' => 'PaisaPayFullEscrowEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ISBNIdentifierEnabled' => ['type' => 'ISBNIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'UPCIdentifierEnabled' => ['type' => 'UPCIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'EANIdentifierEnabled' => ['type' => 'EANIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BrandMPNIdentifierEnabled' => ['type' => 'BrandMPNIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferAutoAcceptEnabled' => ['type' => 'BestOfferAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdAutoAcceptEnabled' => ['type' => 'ClassifiedAdAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CrossBorderTradeNorthAmericaEnabled' => ['type' => 'CrossBorderTradeNorthAmericaEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CrossBorderTradeGBEnabled' => ['type' => 'CrossBorderTradeGBEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CrossBorderTradeAustraliaEnabled' => ['type' => 'CrossBorderTradeAustraliaEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PayPalBuyerProtectionEnabled' => ['type' => 'PayPalBuyerProtectionEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BuyerGuaranteeEnabled' => ['type' => 'BuyerGuaranteeEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CombinedFixedPriceTreatmentEnabled' => ['type' => 'CombinedFixedPriceTreatmentEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'GalleryFeaturedDurations' => ['type' => 'ListingEnhancementDurationDefinitionType', 'xmlns' => self::XMLNS],\n 'INEscrowWorkflowTimeline' => ['type' => 'INEscrowWorkflowTimelineDefinitionType', 'xmlns' => self::XMLNS],\n 'PayPalRequired' => ['type' => 'PayPalRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProAdFormatEnabled' => ['type' => 'EBayMotorsProAdFormatEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProContactByPhoneEnabled' => ['type' => 'EBayMotorsProContactByPhoneEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProPhoneCount' => ['type' => 'EBayMotorsProPhoneCountDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProContactByAddressEnabled' => ['type' => 'EBayMotorsProContactByAddressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProStreetCount' => ['type' => 'EBayMotorsProStreetCountDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProCompanyNameEnabled' => ['type' => 'EBayMotorsProCompanyNameEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProContactByEmailEnabled' => ['type' => 'EBayMotorsProContactByEmailEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProBestOfferEnabled' => ['type' => 'EBayMotorsProBestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProAutoAcceptEnabled' => ['type' => 'EBayMotorsProAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProAutoDeclineEnabled' => ['type' => 'EBayMotorsProAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProPaymentMethodCheckOutEnabled' => ['type' => 'EBayMotorsProPaymentMethodCheckOutEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProShippingMethodEnabled' => ['type' => 'EBayMotorsProShippingMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProCounterOfferEnabled' => ['type' => 'EBayMotorsProCounterOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProSellerContactDetailsEnabled' => ['type' => 'EBayMotorsProSellerContactDetailsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketAdFormatEnabled' => ['type' => 'LocalMarketAdFormatEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketContactByPhoneEnabled' => ['type' => 'LocalMarketContactByPhoneEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketPhoneCount' => ['type' => 'LocalMarketPhoneCountDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketContactByAddressEnabled' => ['type' => 'LocalMarketContactByAddressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketStreetCount' => ['type' => 'LocalMarketStreetCountDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketCompanyNameEnabled' => ['type' => 'LocalMarketCompanyNameEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketContactByEmailEnabled' => ['type' => 'LocalMarketContactByEmailEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketBestOfferEnabled' => ['type' => 'LocalMarketBestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketAutoAcceptEnabled' => ['type' => 'LocalMarketAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketAutoDeclineEnabled' => ['type' => 'LocalMarketAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketPaymentMethodCheckOutEnabled' => ['type' => 'LocalMarketPaymentMethodCheckOutEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketShippingMethodEnabled' => ['type' => 'LocalMarketShippingMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketCounterOfferEnabled' => ['type' => 'LocalMarketCounterOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketSellerContactDetailsEnabled' => ['type' => 'LocalMarketSellerContactDetailsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdPhoneCount' => ['type' => 'ClassifiedAdPhoneCountDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdContactByAddressEnabled' => ['type' => 'ClassifiedAdContactByAddressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdStreetCount' => ['type' => 'ClassifiedAdStreetCountDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdCompanyNameEnabled' => ['type' => 'ClassifiedAdCompanyNameEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SpecialitySubscription' => ['type' => 'SpecialitySubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'RegularSubscription' => ['type' => 'RegularSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'PremiumSubscription' => ['type' => 'PremiumSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'NonSubscription' => ['type' => 'NonSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'ReturnPolicyEnabled' => ['type' => 'ReturnPolicyEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'HandlingTimeEnabled' => ['type' => 'HandlingTimeEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PayPalRequiredForStoreOwner' => ['type' => 'PayPalRequiredForStoreOwnerDefinitionType', 'xmlns' => self::XMLNS],\n 'ReviseQuantityAllowed' => ['type' => 'ReviseQuantityAllowedDefinitionType', 'xmlns' => self::XMLNS],\n 'RevisePriceAllowed' => ['type' => 'RevisePriceAllowedDefinitionType', 'xmlns' => self::XMLNS],\n 'StoreOwnerExtendedListingDurationsEnabled' => ['type' => 'StoreOwnerExtendedListingDurationsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'StoreOwnerExtendedListingDurations' => ['type' => 'StoreOwnerExtendedListingDurationsDefinitionType', 'xmlns' => self::XMLNS],\n 'PaymentMethod' => ['type' => 'PaymentMethodDefinitionType', 'xmlns' => self::XMLNS],\n 'Group1MaxFlatShippingCost' => ['type' => 'Group1MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'Group2MaxFlatShippingCost' => ['type' => 'Group2MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'Group3MaxFlatShippingCost' => ['type' => 'Group3MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxFlatShippingCostCBTExempt' => ['type' => 'MaxFlatShippingCostCBTExemptDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxFlatShippingCost' => ['type' => 'MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'VariationsEnabled' => ['type' => 'VariationsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'AttributeConversionEnabled' => ['type' => 'AttributeConversionEnabledFeatureDefinitionType', 'xmlns' => self::XMLNS],\n 'FreeGalleryPlusEnabled' => ['type' => 'FreeGalleryPlusEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'FreePicturePackEnabled' => ['type' => 'FreePicturePackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ItemCompatibilityEnabled' => ['type' => 'ItemCompatibilityEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxItemCompatibility' => ['type' => 'MaxItemCompatibilityDefinitionType', 'xmlns' => self::XMLNS],\n 'MinItemCompatibility' => ['type' => 'MinItemCompatibilityDefinitionType', 'xmlns' => self::XMLNS],\n 'ConditionEnabled' => ['type' => 'ConditionEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ConditionValues' => ['type' => 'ConditionValuesDefinitionType', 'xmlns' => self::XMLNS],\n 'ValueCategory' => ['type' => 'ValueCategoryDefinitionType', 'xmlns' => self::XMLNS],\n 'ProductCreationEnabled' => ['type' => 'ProductCreationEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'EANEnabled' => ['type' => 'EANEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ISBNEnabled' => ['type' => 'ISBNEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'UPCEnabled' => ['type' => 'UPCEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CompatibleVehicleType' => ['type' => 'CompatibleVehicleTypeDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxGranularFitmentCount' => ['type' => 'MaxGranularFitmentCountDefinitionType', 'xmlns' => self::XMLNS],\n 'PaymentOptionsGroup' => ['type' => 'PaymentOptionsGroupEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ShippingProfileCategoryGroup' => ['type' => 'ProfileCategoryGroupDefinitionType', 'xmlns' => self::XMLNS],\n 'PaymentProfileCategoryGroup' => ['type' => 'ProfileCategoryGroupDefinitionType', 'xmlns' => self::XMLNS],\n 'ReturnPolicyProfileCategoryGroup' => ['type' => 'ProfileCategoryGroupDefinitionType', 'xmlns' => self::XMLNS],\n 'VINSupported' => ['type' => 'VINSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'VRMSupported' => ['type' => 'VRMSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'SellerProvidedTitleSupported' => ['type' => 'SellerProvidedTitleSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'DepositSupported' => ['type' => 'DepositSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'GlobalShippingEnabled' => ['type' => 'GlobalShippingEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'AdditionalCompatibilityEnabled' => ['type' => 'AdditionalCompatibilityEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PickupDropOffEnabled' => ['type' => 'PickupDropOffEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'DigitalGoodDeliveryEnabled' => ['type' => 'DigitalGoodDeliveryEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'EpidSupported' => ['type' => 'EpidSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'KTypeSupported' => ['type' => 'KTypeSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'ProductRequiredEnabled' => ['type' => 'ProductRequiredEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticReturnsAcceptedValues' => ['type' => 'DomesticReturnsAcceptedDefinitionType', 'xmlns' => self::XMLNS],\n 'InternationalReturnsAcceptedValues' => ['type' => 'InternationalReturnsAcceptedDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticReturnsDurationValues' => ['type' => 'DomesticReturnsDurationDefinitionType', 'xmlns' => self::XMLNS],\n 'InternationalReturnsDurationValues' => ['type' => 'InternationalReturnsDurationDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticReturnsShipmentPayeeValues' => ['type' => 'DomesticReturnsShipmentPayeeDefinitionType', 'xmlns' => self::XMLNS],\n 'InternationalReturnsShipmentPayeeValues' => ['type' => 'InternationalReturnsShipmentPayeeDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticRefundMethodValues' => ['type' => 'DomesticRefundMethodCodeType', 'xmlns' => self::XMLNS],\n 'InternationalRefundMethodValues' => ['type' => 'InternationalRefundMethodCodeType', 'xmlns' => self::XMLNS],\n 'ReturnPolicyDescriptionEnabled' => ['type' => 'ReturnPolicyDescriptionEnabledDefinitionType', 'xmlns' => self::XMLNS]\n ], parent::NAME);\n\n self::assignAttributes([]);\n }", "public function map() {\n\t\treturn array(\n\t\t\t'name' => esc_html__( 'Image Grid', 'total-theme-core' ),\n\t\t\t'description' => esc_html__( 'Responsive image gallery', 'total-theme-core' ),\n\t\t\t'base' => 'vcex_image_grid',\n\t\t\t'icon' => 'vcex_element-icon vcex_element-icon--image-gallery',\n\t\t\t'admin_enqueue_js' => vcex_wpbakery_asset_url( 'js/backend-editor/vcex-image-gallery-view.min.js' ),\n\t\t\t'js_view' => 'vcexBackendViewImageGallery',\n\t\t\t'category' => vcex_shortcodes_branding(),\n\t\t\t'params' => Shortcode::get_params(),\n\t\t);\n\t}", "public static function getMap()\n {\n return array(\n 'ID' => array(\n 'data_type' => 'integer',\n 'primary' => true,\n 'autocomplete' => true,\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_ID_FIELD'),\n ),\n 'USER_ID' => array(\n 'data_type' => 'integer',\n 'validation' => array(__CLASS__, 'validateUser'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_USER_ID_FIELD'),\n ),\n 'ELEMENT_CODE' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateElementCode'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_ELEMENT_CODE_FIELD'),\n ),\n 'TITLE' => array(\n 'data_type' => 'string',\n 'required' => true,\n 'validation' => array(__CLASS__, 'validateTitle'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_TITLE_FIELD'),\n ),\n 'PASSWORD_ID' => array(\n 'data_type' => 'integer',\n 'validation' => array(__CLASS__, 'validatePassword'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_PASSWORD_ID_FIELD'),\n ),\n 'APP_ID' => array(\n 'data_type' => 'integer',\n 'validation' => array(__CLASS__, 'validateApp'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_APP_ID_FIELD'),\n ),\n 'SCOPE' => array(\n 'data_type' => 'text',\n 'save_data_modification' => function () {\n return array(\n function ($value) {\n return is_array($value) ? implode(',', $value) : '';\n }\n );\n },\n 'fetch_data_modification' => function () {\n return array(\n function ($value) {\n return explode(',', $value);\n }\n );\n },\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_SCOPE_FIELD'),\n ),\n 'QUERY' => array(\n 'data_type' => 'text',\n 'serialized' => true,\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_QUERY_FIELD'),\n ),\n 'OUTGOING_EVENTS' => array(\n 'data_type' => 'text',\n 'save_data_modification' => function () {\n return array(\n function ($value) {\n return is_array($value) ? implode(',', $value) : '';\n }\n );\n },\n 'fetch_data_modification' => function () {\n return array(\n function ($value) {\n return explode(',', $value);\n }\n );\n },\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_OUTGOING_EVENTS_FIELD'),\n ),\n 'OUTGOING_NEEDED' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateOutgoingQueryNeeded'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_OUTGOING_NEEDED_FIELD'),\n ),\n 'OUTGOING_HANDLER_URL' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateOutgoingHandlerUrl'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_OUTGOING_HANDLER_URL_FIELD'),\n ),\n 'WIDGET_NEEDED' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateWidgetNeeded'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_WIDGET_NEEDED_FIELD'),\n ),\n 'WIDGET_HANDLER_URL' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateWidgetHandlerUrl'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_WIDGET_HANDLER_URL_FIELD'),\n ),\n 'WIDGET_LIST' => array(\n 'data_type' => 'text',\n 'save_data_modification' => function () {\n return array(\n function ($value) {\n return is_array($value) ? implode(',', $value) : '';\n }\n );\n },\n 'fetch_data_modification' => function () {\n return array(\n function ($value) {\n return explode(',', $value);\n }\n );\n },\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_WIDGET_LIST_FIELD'),\n ),\n 'APPLICATION_TOKEN' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateApplicationToken'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_APPLICATION_TOKEN_FIELD'),\n ),\n 'APPLICATION_NEEDED' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateApplicationNeeded'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_APPLICATION_NEEDED_FIELD'),\n ),\n 'APPLICATION_ONLY_API' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateApplicationOnlyApi'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_APPLICATION_ONLY_API_FIELD'),\n ),\n 'BOT_ID' => array(\n 'data_type' => 'integer',\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_BOT_ID_FIELD'),\n ),\n 'BOT_HANDLER_URL' => array(\n 'data_type' => 'string',\n 'validation' => array(__CLASS__, 'validateBotHandlerUrl'),\n 'title' => Loc::getMessage('INTEGRATION_ENTITY_BOT_HANDLER_URL_FIELD'),\n ),\n 'USER' => new ReferenceField(\n 'USER',\n '\\Bitrix\\Main\\UserTable',\n array('=this.USER_ID' => 'ref.ID')\n ),\n );\n }", "public static function getMap()\n\t{\n\t\treturn [\n\t\t\tnew IntegerField(\n\t\t\t\t'ID',\n\t\t\t\t[\n\t\t\t\t\t'primary' => true,\n\t\t\t\t\t'autocomplete' => true,\n\t\t\t\t\t'title' => Loc::getMessage('SMARTSEO_SEO_TEXT_IBLOCK_SECTIONS_ENTITY_ID_FIELD')\n\t\t\t\t]\n\t\t\t),\n\t\t\tnew IntegerField(\n\t\t\t\t'SEO_TEXT_ID',\n\t\t\t\t[\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'title' => Loc::getMessage('SMARTSEO_SEO_TEXT_IBLOCK_SECTIONS_ENTITY_SEO_TEXT_ID_FIELD')\n\t\t\t\t]\n\t\t\t),\n\t\t\tnew IntegerField(\n\t\t\t\t'SECTION_ID',\n\t\t\t\t[\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'title' => Loc::getMessage('SMARTSEO_SEO_TEXT_IBLOCK_SECTIONS_ENTITY_SECTION_ID_FIELD')\n\t\t\t\t]\n\t\t\t),\n (new Reference('SEO_TEXT', SmartseoSeoTextTable::class, Join::on('this.SEO_TEXT_ID', 'ref.ID')))\n ->configureJoinType('left'),\n (new Reference('SECTION', \\Bitrix\\Iblock\\SectionTable::class, Join::on('this.SECTION_ID', 'ref.ID')))\n ->configureJoinType('left'),\n\t\t];\n\t}", "protected function _createCidToGidMap() {}" ]
[ "0.7044736", "0.6119876", "0.5788437", "0.56900597", "0.56242883", "0.5547064", "0.55125326", "0.55121243", "0.5498514", "0.5485582", "0.5394869", "0.52672815", "0.5255118", "0.519329", "0.51895106", "0.50757754", "0.50058645", "0.49868304", "0.4973628", "0.4959603", "0.49507436", "0.49200845", "0.49180052", "0.49006346", "0.4897781", "0.48888478", "0.4864115", "0.4848633", "0.48414993", "0.48309252", "0.48200685", "0.48034474", "0.47982398", "0.47471485", "0.471604", "0.47079098", "0.47040936", "0.4676232", "0.46731123", "0.46610466", "0.46446976", "0.46446526", "0.46411666", "0.4631732", "0.46130994", "0.459922", "0.4583173", "0.45760027", "0.45653066", "0.4563132", "0.4562135", "0.4558999", "0.45589083", "0.45464584", "0.45458788", "0.4541429", "0.45402044", "0.45371374", "0.45348254", "0.4534004", "0.4528429", "0.45274144", "0.4526711", "0.4509398", "0.45038202", "0.4501943", "0.44883496", "0.44759452", "0.4470823", "0.44693246", "0.4467771", "0.44624498", "0.44611493", "0.44572544", "0.44570366", "0.44520015", "0.44487464", "0.4448663", "0.44460595", "0.4437999", "0.44355398", "0.44352487", "0.4435069", "0.4434883", "0.44337133", "0.4431641", "0.44308963", "0.4430697", "0.44300902", "0.44112584", "0.44110715", "0.44072387", "0.44023865", "0.4399669", "0.43926802", "0.43853775", "0.43725818", "0.4371342", "0.43660307", "0.43598247" ]
0.6814833
1
$Id$ Implementation of hook_views_query_alter(). Modify query to sum ancestor's search scores for ead search, to improve search accuracy
function ead_import_views_query_alter(&$view, &$query){ if ($view->name === "collection_search"){ // create inner join on the child-ancestor table // to get all ancestors for a node $join = new views_join(); $join->table = 'ead_import_child_ancestor'; $join->field = 'child_nid'; $join->left_table = 'node'; $join->left_field = 'nid'; $join->type = 'INNER'; // add the join to the query $alias = $query->ensure_table("ead_import_child_ancestor", NULL, $join); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function query() {\n // Since attachment views don't validate the exposed input, parse the search\n // expression if required.\n if (!$this->parsed) {\n $this->query_parse_search_expression($this->value);\n }\n $required = FALSE;\n if (!isset($this->search_query)) {\n $required = TRUE;\n }\n else {\n $words = $this->search_query->words();\n if (empty($words)) {\n $required = TRUE;\n }\n }\n if ($required) {\n if ($this->operator == 'required') {\n $this->query->add_where($this->options['group'], 'FALSE');\n }\n }\n else {\n $search_index = $this->ensure_my_table();\n\n $search_condition = db_and();\n\n if (!$this->options['remove_score']) {\n // Create a new join to relate the 'serach_total' table to our current 'search_index' table.\n $join = new views_join;\n $join->construct('search_total', $search_index, 'word', 'word');\n $search_total = $this->query->add_relationship('search_total', $join, $search_index);\n\n $this->search_score = $this->query->add_field('', \"SUM($search_index.score * $search_total.count)\", 'score', array('aggregate' => TRUE));\n }\n\n if (empty($this->query->relationships[$this->relationship])) {\n $base_table = $this->query->base_table;\n }\n else {\n $base_table = $this->query->relationships[$this->relationship]['base'];\n }\n $search_condition->condition(\"$search_index.type\", $base_table);\n if (!$this->search_query->simple()) {\n $search_dataset = $this->query->add_table('search_dataset');\n $conditions = $this->search_query->conditions();\n $condition_conditions =& $conditions->conditions();\n foreach ($condition_conditions as $key => &$condition) {\n // Take sure we just look at real conditions.\n if (is_numeric($key)) {\n // Replace the conditions with the table alias of views.\n $this->search_query->condition_replace_string('d.', \"$search_dataset.\", $condition);\n }\n }\n $search_conditions =& $search_condition->conditions();\n $search_conditions = array_merge($search_conditions, $condition_conditions);\n }\n else {\n // Stores each condition, so and/or on the filter level will still work.\n $or = db_or();\n foreach ($words as $word) {\n $or->condition(\"$search_index.word\", $word);\n }\n\n $search_condition->condition($or);\n }\n\n $this->query->add_where($this->options['group'], $search_condition);\n $this->query->add_groupby(\"$search_index.sid\");\n $matches = $this->search_query->matches();\n $placeholder = $this->placeholder();\n $this->query->add_having_expression($this->options['group'], \"COUNT(*) >= $placeholder\", array($placeholder => $matches));\n }\n // Set to NULL to prevent PDO exception when views object is cached.\n $this->search_query = NULL;\n }", "function cbf_views_query_alter(&$view, &$query) {\n $filter_vocabulary = null;\n switch ($view->name) {\n case 'cbf2019_local_office':\n $filter_vocabulary = 'office';\n $filter_table = 'field_data_field_office';\n $filter_tid = 'field_office_tid';\n break;\n\n case 'cbf2019_local_events':\n case 'cbf2019_local_activities':\n $filter_vocabulary = 'vocabulary_1';\n $filter_table = 'field_data_taxonomy_vocabulary_1';\n $filter_tid = 'taxonomy_vocabulary_1_tid';\n break;\n\n case 'cbf2019_mappable':\n if ($view->current_display == 'block_4') {\n $filter_vocabulary = 'vocabulary_1';\n $filter_table = 'field_data_taxonomy_vocabulary_1';\n $filter_tid = 'taxonomy_vocabulary_1_tid';\n }\n break;\n }\n\n /*\n * The view is localised if the following conditions hold ...\n *\n * The view can be localised, and this invocation is the loading of the page\n * (refreshes use AJAX), and the $filter_table is not already in the query,\n * and the visitor's $localCity is known.\n */\n if (\n isset($filter_vocabulary)\n && strpos($_SERVER['REQUEST_URI'], '/views/ajax') === false\n && empty($query->get_table_info($filter_table))\n && !empty($localCity = cbf_visitor_city_string())\n ) {\n $city = taxonomy_get_term_by_name($localCity, $filter_vocabulary);\n $join = new views_join;\n $join->construct(\n $filter_table,\n $query->base_table,\n $query->base_field,\n 'entity_id',\n \"({$filter_table}.entity_type = '{$query->base_table}'\"\n . \" AND {$filter_table}.deleted = '0')\",\n 'INNER'\n );\n $query->add_relationship($filter_table, $join, $query->base_table);\n $query->add_where(1, \"{$filter_table}.{$filter_tid}\", reset($city)->tid, '=');\n }\n\n /*\n * The cbf2019_rated_content view supplies a 'More by' block ('block_1') and\n * a 'More on' block ('block_2'). We need to exclude the article on whose\n * page this block is being displayed.\n */\n if ($view->name == 'cbf2019_rated_content'\n && ($view->current_display == 'block_1'\n || $view->current_display == 'block_2')\n && is_numeric($view->args[0])\n && $view->args[0] > 0\n ) {\n $view->query->where[] = [\n 'conditions' => [\n [\n 'field' => 'node.nid',\n 'value' => $view->args[0],\n 'operator' => '!=',\n ],\n ],\n 'args' => [],\n 'type' => 'AND',\n ];\n }\n\n /*\n * The cbf2019_article_topics view definition shows only 'general' topics\n * and this code extends the query to include 'christian' topics when on\n * the 'christian' site. Ditto for cbf2019_speaker_listings.\n *\n * The tag 'add-christian-content' signals this is needed.\n */\n if (stripos($view->tag, 'add-christian-content') !== false) {\n $currentDomainId = domain_get_domain()['domain_id'];\n $christianDomainId = domain_load_domain_id('christian');\n if ($currentDomainId == $christianDomainId) {\n // We are on the 'christian' site so we want to see 'christian' topics\n foreach ($view->query->where as $i => $clause) {\n foreach ($clause['conditions'] as $j => $condition) {\n if (\n stripos($condition['field'], 'taxonomy_vocabulary_3_tid') !== false\n && $condition['operator'] == '='\n && $condition['value'] == '48'\n ) {\n $view->query->where[$i]['conditions'][$j]['operator'] = 'in';\n $view->query->where[$i]['conditions'][$j]['value'] = [ '47', '48' ];\n }\n }\n }\n }\n }\n}", "private function _getBaseSearchQuery()\n {\n $store = Mage::app()->getStore($this->getStoreId());\n $collection = Mage::helper('catalogsearch')\n ->getEngine()\n ->getResultCollection()\n ->addSearchFilter($this->getFulltextQuery());\n\n $allowedVisibilities = Mage::getSingleton('catalog/product_visibility')->getVisibleInSearchIds();\n $allowedStatuses = Mage::getSingleton('catalog/product_status')->getVisibleStatusIds();\n\n $query = $collection->getSearchEngineQuery()\n ->addFilter('terms', array('store_id' => $this->getStoreId()))\n ->addFilter('terms', array('visibility' => $allowedVisibilities))\n ->addFilter('terms', array('status' => $allowedStatuses))\n ->setLanguageCode(Mage::helper('smile_elasticsearch')->getLanguageCodeByStore($store))\n ->setPageParams(0, self::PREVIEW_SIZE)\n ->getRawQuery();\n\n return $this->_applyOptimizers($query);\n }", "private function sum_hits( $rows )\n {\n // Get the label for the hit field\n $hitsField = $this->sql_filterFields[ $this->curr_tableField ][ 'hits' ];\n\n // Init sum hits\n $sum_hits = 0;\n\n // Tree view flag\n $bTreeView = false;\n list( $table ) = explode( '.', $this->curr_tableField );\n // #i0117, 141223, dwildt, 1-/+\n //if ( in_array( $table, $this->arr_tablesWiTreeparentfield ) )\n if ( in_array( $this->curr_tableField, $this->arr_tablesWiTreeparentfield ) )\n {\n $bTreeView = true;\n }\n // Tree view flag\n // Tree view : get lowest uid_parent\n if ( $bTreeView )\n {\n // Get the field label\n $treeParentField = $this->sql_filterFields[ $this->curr_tableField ][ 'treeParentField' ];\n // Set lowest uid_parent 'unlimited'\n $lowestPid = 9999999;\n // LOOP all rows : set lowest pid\n foreach ( ( array ) $rows as $row )\n {\n if ( ( $row[ $treeParentField ] < $lowestPid ) && ( $row[ $treeParentField ] !== null ) )\n {\n $lowestPid = $row[ $treeParentField ];\n }\n }\n // LOOP all rows : set lowest pid\n }\n // Tree view : get lowest uid_parent\n // LOOP all rows : count hits\n foreach ( ( array ) $rows as $row )\n {\n // Default case : count each row\n if ( !$bTreeView )\n {\n $sum_hits = $sum_hits + $row[ $hitsField ];\n }\n // Default case : count each row\n // Tree view case : count top level rows only\n if ( $bTreeView )\n {\n if ( $row[ $treeParentField ] == $lowestPid )\n {\n $sum_hits = $sum_hits + $row[ $hitsField ];\n }\n }\n // Tree view case : count top level rows only\n }\n // LOOP all rows : count hits\n // Set class var $this->hits_sum\n $this->hits_sum[ $this->curr_tableField ] = ( int ) $sum_hits;\n\n return;\n }", "function _admin_search_query()\n {\n }", "function opensky_islandora_solr_query_alter($qp) {\n // dsm('opensky_islandora_solr_query_alter');\n\n // if sort is not set for search pages, then set it to keyDate desc\n if (current_path() == ISLANDORA_SOLR_SEARCH_PATH && !isset($qp->solrParams['sort'])) {\n $qp->solrParams['sort'] = 'keyDate desc';\n }\n\n if (isset($qp->internalSolrParams['collection'])) {\n $collection = $qp->internalSolrParams['collection'];\n\n // create $fq_new by removing all RELS_EXT_isMemberOfCollection_uri_ms\n // clauses\n $fq_new = array();\n $pat = 'RELS_EXT_isMemberOfCollection_uri_ms';\n if (isset($qp->solrParams['fq'])) {\n $fq_old = $qp->solrParams['fq'];\n unset($qp->solrParams['fq']);\n foreach ($fq_old as $item) {\n if (substr($item, 0, strlen($pat)) !== $pat) {\n $fq_new[] = $item;\n }\n }\n }\n\n // construct a filter to search all searchable sub-collections (those\n // that have no sub-collections).\n $searchable_collections = opensky_get_searchable_subcollections($collection);\n\n $children_params = array();\n foreach ($searchable_collections as $searchable) {\n $children_params[] = 'RELS_EXT_isMemberOfCollection_uri_ms:\"info:fedora/'.$searchable.'\"';\n }\n\n $searchable_collection_clause = implode(' OR ', $children_params);\n\n $qp->solrParams['fq'] = array_merge($fq_new, array($searchable_collection_clause));\n // dsm($qp->solrParams);\n }\n}", "public function query() {\n $this->ensureMyTable();\n\n $def = $this->definition;\n $def['table'] = 'taxonomy_term_field_data';\n\n if (!array_filter($this->options['vids'])) {\n $taxonomy_index = $this->query->addTable('taxonomy_index', $this->relationship);\n $def['left_table'] = $taxonomy_index;\n $def['left_field'] = 'tid';\n $def['field'] = 'tid';\n $def['type'] = empty($this->options['required']) ? 'LEFT' : 'INNER';\n }\n else {\n // If vocabularies are supplied join a subselect instead\n $def['left_table'] = $this->tableAlias;\n $def['left_field'] = 'nid';\n $def['field'] = 'nid';\n $def['type'] = empty($this->options['required']) ? 'LEFT' : 'INNER';\n $def['adjusted'] = TRUE;\n\n $query = Database::getConnection()->select('taxonomy_term_field_data', 'td');\n $query->addJoin($def['type'], 'taxonomy_index', 'tn', 'tn.tid = td.tid');\n $query->condition('td.vid', array_filter($this->options['vids']), 'IN');\n if (empty($this->query->options['disable_sql_rewrite'])) {\n $query->addTag('taxonomy_term_access');\n }\n $query->fields('td');\n $query->fields('tn', ['nid']);\n $def['table formula'] = $query;\n }\n\n $join = \\Drupal::service('plugin.manager.views.join')->createInstance('standard', $def);\n\n // use a short alias for this:\n $alias = $def['table'] . '_' . $this->table;\n\n $this->alias = $this->query->addRelationship($alias, $join, 'taxonomy_term_field_data', $this->relationship);\n }", "function display_elastic_search ($q, $filter=null, $from = 0, $size = 20, $callback = '')\n{\n\tglobal $elastic;\n\t\n\t$status = 404;\n\t\t\t\t\n\tif ($q == '')\n\t{\n\t\t$obj = new stdclass;\n\t\t$obj->hits = new stdclass;\n\t\t$obj->hits->total = 0;\n\t\t$obj->hits->hits = array();\n\t\t\n\t\t$status = 200;\n\t}\n\telse\n\t{\t\t\n\t\t// query type\t\t\n\t\t$query_json = '';\n\t\t\n\t\tif ($filter)\n\t\t{\n\t\t\tif (isset($filter->author))\n\t\t\t{\n\t\t\t\t// author search is different( but not working yet)\t\n\t\t\t\t$query_json = \t\t\n\t'{\n\t\"size\":50,\n \"query\": {\n \"bool\": {\n \"must\": [ {\n\t\t\t\t \"multi_match\" : {\n\t\t\t\t \"query\": \"<QUERY>\",\n\t\t\t\t \"fields\":[\"search_data.author\"] \n\t\t\t\t}\n\t\t\t\t}]\n }\n }\n\t}';\n\t\t\t$query_json = str_replace('<QUERY>', $q, $query_json);\n\t\t\t\n\t\t\t// echo $query_json;\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// default is search on fulltext fields\n\t\tif ($query_json == '')\n\t\t{\n\t\t\t$query_json = '{\n\t\t\t\"size\":50,\n\t\t\t\t\"query\": {\n\t\t\t\t\t\"bool\" : {\n\t\t\t\t\t\t\"must\" : [ {\n\t\t\t\t \"multi_match\" : {\n\t\t\t\t \"query\": \"<QUERY>\",\n\t\t\t\t \"fields\":[\"search_data.fulltext\", \"search_data.fulltext_boosted^4\"] \n\t\t\t\t}\n\t\t\t\t}],\n\t\t\t\"filter\": <FILTER>\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"aggs\": {\n\t\t\t\"type\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.type.keyword\" }\n\t\t\t },\n\t\t\t \"year\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.year\" }\n\t\t\t },\n\t\t\t \"container\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.container.keyword\" }\n\t\t\t },\n\t\t\t \"author\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.author.keyword\" }\n\t\t\t },\n\t\t\t \"classification\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.classification.keyword\" }\n\t\t\t } \n\n\t\t\t}\n\n\t\n\t\t\t}';\n\t\t\t\n\t\t\t$query_json = str_replace('<QUERY>', $q, $query_json);\n\t\t}\n\t\n\t$filter_string = '[]';\n\t\n\tif ($filter)\n\t{\n\t\t$f = array();\n\t\t\n\t\tif (isset($filter->year))\n\t\t{\n\t\t\t$one_filter = new stdclass;\n\t\t\t$one_filter->match = new stdclass;\n\t\t\t$one_filter->match->{'search_data.year'} = $filter->year;\n\t\t\t\n\t\t\t$f[] = $one_filter;\t\t\t\n\t\t}\n\n\t\t// this doesn't work\n\t\tif (isset($filter->author))\n\t\t{\n\t\t\t$one_filter = new stdclass;\n\t\t\t$one_filter->match = new stdclass;\n\t\t\t$one_filter->match->{'search_data.author'} = $filter->author;\n\t\t\t\n\t\t\t$f[] = $one_filter;\t\t\t\n\t\t}\n\t\t\n\t\t$filter_string = json_encode($f);\n\t}\n\t\n\t$query_json = str_replace('<FILTER>', $filter_string, $query_json);\n\t\n\t\n\t$resp = $elastic->send('POST', '_search?pretty', $post_data = $query_json);\n\t\n\n\t\t$obj = json_decode($resp);\n\n\t\t$status = 200;\n\t}\n\t\n\tapi_output($obj, $callback, 200);\n}", "private function _getBaseSearchQuery()\n {\n $store = Mage::app()->getStore($this->getStoreId());\n $collection = Mage::helper('catalogsearch')\n ->getEngine()\n ->getResultCollection();\n\n $allowedVisibilities = Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds();\n $allowedStatuses = Mage::getSingleton('catalog/product_status')->getVisibleStatusIds();\n\n $query = $collection->getSearchEngineQuery()\n ->addFilter('terms', array('visibility' => $allowedVisibilities))\n ->addFilter('terms', array('status' => $allowedStatuses));\n\n if ($this->getStoreId() != Mage_Core_Model_App::ADMIN_STORE_ID) {\n $query->addFilter('terms', array('store_id' => $this->getStoreId()));\n }\n\n // Append the query string for the virtual categories\n if ($rule = $this->getCategory()->getVirtualRulePreview()) {\n $queryString = $this->_getQueryStringFromRule($rule);\n $query->addFilter('query', array('query_string' => $queryString));\n }\n\n $query = $query->setLanguageCode(Mage::helper('smile_elasticsearch')->getLanguageCodeByStore($store));\n\n $query->setQueryType(\"category_products_layer\");\n\n // Mimic query assembling, because ->search() is never really called on it\n $eventData = new Varien_Object(\n array('query' => $query->getRawQuery(), 'query_type' => $query->getQueryType(), 'store_id' => $this->getStoreId())\n );\n Mage::dispatchEvent('smile_elasticsearch_query_assembled', array('query_data' => $eventData));\n\n $query = $eventData->getQuery();\n\n return $query;\n }", "function query_parse_search_expression($input) {\n if (!isset($this->search_query)) {\n $this->parsed = TRUE;\n $this->search_query = db_select('search_index', 'i', array('target' => 'slave'))->extend('viewsSearchQuery');\n $this->search_query->searchExpression($input, $this->view->base_table);\n $this->search_query->publicParseSearchExpression();\n }\n }", "public function buildQuery() {\n\t\t\tif (isset($this->postTypes[$this->postType])) {\n\t\t\t\t$this->SetFilter('type', array($this->postTypes[$this->postType] + 1));\n\t\t\t}\n\t\t\t$this->SetFilter('status', array(1));\n\t\t\tswitch ($this->matchMode) {\n\t\t\t\tcase 'any';\n\t\t\t\tdefault:\n\t\t\t\t\t$this->SetMatchMode(SPH_MATCH_ALL);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch ($this->sortMode) {\n\t\t\t\tcase 'posted':\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXTENDED, 'posted DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'relevance':\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXTENDED, '@relevance DESC, posted DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'top':\n\t\t\t\tdefault:\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXPR, 'upvotes - downvotes + @weight + LN(posted) * 1000');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->SetLimits((int) $this->currentPage, (int) $this->pageLimit, (int) $this->resultLimit);\n\t\t}", "function scorm_get_score_from_parent($sco,$userid,$grademethod=VALUESCOES) {\n $scores = NULL; \n $scores->scoes = 0;\n $scores->values = 0;\n $scores->scaled = 0;\n $scores->max = 0;\n $scores->sum = 0;\n\n $scoes_total = 0;\n $scoes_count = 0;\n $attempt = scorm_get_last_attempt($sco->scorm, $userid);\n $scoes = get_records('scorm_scoes', 'parent', $sco->identifier);\n foreach ($scoes as $sco)\n {\n $scoes_total++;\n if ($userdata=scorm_get_tracks($sco->id, $userid,$attempt)) {\n if (($userdata->status == 'completed') || ($userdata->success_status == 'passed')) {\n $scoes_count++;\n }\n\n $scoreraw = $userdata->score_raw; \n if (!empty($userdata->score_raw)) {\n $scores->values++;\n $scores->sum += $userdata->score_raw;\n $scores->max = ($userdata->score_raw > $scores->max)?$userdata->score_raw:$scores->max;\n } \n if (!empty($userdata->score_scaled)) {\n $scores->scaled = $scores->scaled + $userdata->score_scaled;\n } \n } \n }\n if ($scoes_count > 0) {\n $scores->scaled = ($scores->scaled)/($scoes_count);\n }\n switch ($grademethod) {\n case VALUEHIGHEST:\n return $scores->max;\n break; \n case VALUEAVERAGE:\n if ($scores->values > 0) {\n return $scores->sum/$scores->values;\n } else {\n return 0;\n } \n break; \n case VALUESUM:\n return $scores->sum;\n break; \n case VALUESCOES:\n return $scores->scaled;\n break; \n }\n}", "function university_adjust_queries($query) {\n // Adjust Programs Query\n if (\n !is_admin()\n AND is_post_type_archive('program')\n AND $query->is_main_query()\n ) {\n $query->set('orderby', 'title');\n $query->set('order', 'asc');\n $query->set('posts_per_page', -1);\n\n }\n // Adjust Events Query\n if (\n ! is_admin()\n AND is_post_type_archive('event')\n AND $query->is_main_query()\n ) {\n $today = date('Ymd');\n $query->set('meta_key', 'event_date');\n $query->set('orderby', 'meta_value_num');\n $query->set('order', 'asc');\n $query->set('meta_query', [\n [\n 'key' => 'event_date',\n 'compare' => '>=',\n 'value' => $today,\n 'type' => 'numeric'\n ]\n ]);\n }\n}", "private function makeQuerySplit(){\n\t\t\n\t\t$this->searchQ['select'] = array('l.name','l.level_id AS levelId','l.summary','l.sum_approach','l.sum_problems','l.address_line_1','l.address_line_2','l.town','l.county','l.postcode','l.country','l.phone','l.image','l.latitude','l.longitude','l.publish_address','l.publish_phone','l.approved','p.uri','p.urlname','e.level','y.listing_type');\n\t\t$this->searchQ['orderby'][] = 'levelId DESC';\n\t\t$this->searchQ['from'] = 'listing l, listing_level e, listing_type y, pages p'; //should always be the same...\n\t\t$this->searchQ['where'] = array('e.level_id = l.level_id','y.listing_type_id = l.listing_type_id','l.page_id = p.page_id','l.publish = 1');//,'p.publish = 1');\n\t\t\n\t\t\n\t\t//! freetext\n\t\tif( strlen($this->vars['term']) ){\n\t\t\t$this->searchQ['select'][] = \"MATCH(\" . $this->ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE) AS score\";\n\t\t\t//$this->searchQ['where'][] = \"MATCH(\" . $ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE)\";\n\t\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"score > 0\";\n\t\t\t$this->searchQ['orderby'][] = 'score DESC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t\n\t\t//! **** FILTERS ****\n\t\t//! profession\n\t\tif( isset($this->vars['profession']) && strlen($this->vars['profession']) ){\n\t\t\n\t\t\t//$this->searchQ['where'][] = \" l.listing_type_id IN (\" . implode(',', $this->vars['profession']) . \") \";\n\t\t\t$this->searchQ['where'][] = \" l.listing_type_id = \" . (int)$this->vars['profession'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! max price\n\t\tif( isset($this->vars['maxprice']) && is_numeric($this->vars['maxprice']) ){\n\t\t\n\t\t\t$this->searchQ['where'][] = \" l.hourly_rate <= \" . (int)$this->vars['maxprice'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! gender\n\t\tif( isset($this->vars['gender']) && in_array($this->vars['gender'] , array('M','F')) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_gender ltg';\n\t\t\t$this->searchQ['where'][] = \" ltg.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltg.gender = '\" . $this->vars['gender'] . \"' \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\n\t\t//! speciality\n\t\tif( isset($this->vars['speciality']) && is_numeric($this->vars['speciality']) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_age ltag';\n\t\t\t$this->searchQ['where'][] = \" ltag.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltag.age_id = \" . (int)$this->vars['speciality'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\tif( strlen($this->vars['location']) ){\n\t\t\t//! ** build the location query **\n\t\t\t\n\t\t\t$this->Geocode = new Geolocation( $this->vars['location']. ', UK' );\n\t\t\t$this->Geocode->lookup();\n\t\t\t$union = array();\n\t\t\t\n\t\t\t$this->doSearch = true;\n\t\t\t$this->searchQ['orderby'][] = 'distance ASC';\n\t\t\t$c = 1;\t\n\t\t\tforeach($this->searchLevels as $level_id => $distance){\n\t\t\t// set up the initial search variables\t\t\n\t\t\t//! location\n\t\t\t\t\n\t\t\t\t//load in current other query info for this level\n\t\t\t\t$l_select = $this->searchQ['select'];\n\t\t\t\t$l_where = $this->searchQ['where'];\n\t\t\t\t$l_having = $this->searchQ['having'];\n\t\t\t\t\n\t\t\t\t// using the OS grid as makes calculation simpler than using lng/lat - can use simple pythag rather than calculus functions\n\t\t\t\t// we shorten the list of rows needing the calculation by the greater / less than in the where\n\t\t\t\t\n\t\t\t\t$calculation = ' SQRT(POW(( l.easting - ' . round($this->Geocode->getOSEast()) . '),2) + POW((l.northing - ' . round($this->Geocode->getOSNorth()) . '),2)) ';\n\t\t\t\t$l_select[] = $calculation . \" AS distance\";\n\t\t\t\t$l_where[] = \"l.level_id = \" . $level_id;\n\t\t\t\t$l_where[] = \"northing < \" . round( $this->Geocode->getOSNorth() + $distance ) ; \n\t\t\t\t$l_where[] = \"northing > \" . round( $this->Geocode->getOSNorth() - $distance ) ;\n\t\t\t\t$l_where[] = \"easting < \" . round( $this->Geocode->getOSEast() + $distance ) ;\n\t\t\t\t$l_where[] = \"easting > \" . round( $this->Geocode->getOSEast() - $distance ) ;\n\t\t\t//\t$this->searchQ['where'][] = \"(\" . $calculation . \") <= \" . $this->searchDistance ;\n\t\t\t// use having rather than where\n\t\t\t\t$l_having[] = \"distance <= \" . $distance;\n\t\t\t\t//$this->searchQ['orderby'][] = 'distance ASC';\n\t\t\t\t\n\t\t\t\t$l_q = \"SELECT \" . (($this->numRows) && 1 == $c ?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $l_select). \"\n\t\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t\" . implode(' AND ', $l_where) ;\n\t\n\t\t\t\tif( count($l_having) ){\n\t\t\t\t\t$l_q .= \" HAVING \" . implode(' AND ' , $l_having);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$union[] = $l_q;\n\t\t\t\t$c++;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$q = '(' . implode(' ) UNION ALL (', $union) . ') ';\n\t\t\t\n\t\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \";\n\t\t\n\t\t\n\t\t}else{\n\t\t\n\t\t\n\t\t\t//! ** build the non-location query **\n\t\t\t$q = \"SELECT \" . (($this->numRows)?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $this->searchQ['select']). \"\n\t\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t\" . implode(' AND ', $this->searchQ['where']) ;\n\t\t\t\t\t\t\n\t\t\tif( isset($this->searchQ['having']) && count($this->searchQ['having']) ){\n\t\t\t\t$q .= \" HAVING \" . implode(' AND ' , $this->searchQ['having']);\n\t\t\t}\n\t\t\t\n\t\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\n\t\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \"; \n\t\t}\n\t\t//echo $q;\t\t\n\t\treturn $q;\n\t\t\n\t}", "public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }", "public function modifyQuery($query, SearchTerm $search);", "private function makeQuery(){\n\t\t\n\t\t$this->searchQ['select'] = array('l.name','l.summary','l.sum_approach','l.sum_problems','l.address_line_1','l.address_line_2','l.town','l.county','l.postcode','l.country','l.phone','l.latitude','l.longitude','l.publish_address','l.publish_phone','l.approved','p.uri','p.urlname','e.level','y.listing_type');\n\t\t$this->searchQ['select'][] = '(SELECT i.image FROM listing_images i WHERE l.listing_id=i.listing_id ORDER BY i.sort_order ASC LIMIT 1) AS image';\n\t\t$this->searchQ['from'] = 'listing_level e, listing_type y, pages p, listing l '; //should always be the same...\n\t\t$this->searchQ['where'] = array('e.level_id = l.level_id','y.listing_type_id = l.listing_type_id','l.page_id = p.page_id','l.publish = 1');//,'p.publish = 1');\n\t\t\n\t\t// set up the initial search variables\t\t\n\t\t//! location\n\t\tif( strlen($this->vars['location']) ){\n\t\t\n\t\t\t$this->Geocode = new Geolocation( $this->vars['location']. ', UK' );\n\t\t\t$this->Geocode->lookup();\n\t\t\t// using the OS grid as makes calculation simpler than using lng/lat - can use simple pythag rather than calculus functions\n\t\t\t// we shorten the list of rows needing the calculation by the greater / less than in the where\n\t\t\t\n\t\t\t$calculation = ' SQRT(POW(( l.easting - ' . round($this->Geocode->getOSEast()) . '),2) + POW((l.northing - ' . round($this->Geocode->getOSNorth()) . '),2)) ';\n\t\t\t$this->searchQ['select'][] = $calculation . \" AS distance\";\n\t\t\t$this->searchQ['where'][] = \"northing < \" . round( $this->Geocode->getOSNorth() + $this->searchDistance ) ; \n\t\t\t$this->searchQ['where'][] = \"northing > \" . round( $this->Geocode->getOSNorth() - $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting < \" . round( $this->Geocode->getOSEast() + $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting > \" . round( $this->Geocode->getOSEast() - $this->searchDistance ) ;\n\t\t//\t$this->searchQ['where'][] = \"(\" . $calculation . \") <= \" . $this->searchDistance ;\n\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"distance <= \" . $this->searchDistance;\n\t\t\t//$this->searchQ['orderby'][] = '(distance - ((l.level_id-1)*16000)) ASC'; // (x^3 -400^3)^(1/3)\n\t\t\t\n\t\t\t// using a exponential function to order distances based on the listing level and multiplying by 16000 m = 16km = 10 miles\n\t\t\t// then raising to power 3, deleteing the distance cubed and then 1/3 (cube root), so only makes a diffenrce within that area\n\t\t\t\n\t\t\t$this->searchQ['orderby'][] = ' POW( (POW( distance ,3) - POW(((l.level_id-1)*' . $this->levelMultiplier. '),3)),(1/3)) ASC ';\n\t\t\t$this->searchQ['orderby'][] = 'l.level_id DESC';\n\t\t\t$this->doSearch = true;\n\t\t}else{\n\t\t\t$this->searchQ['orderby'][] = 'l.level_id DESC';\n\t\t}\n\t\t\n\t\t//! freetext\n\t\tif( strlen($this->vars['term']) ){\n\t\t\t$this->searchQ['select'][] = \"MATCH(\" . $this->ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE) AS score\";\n\t\t\t//$this->searchQ['where'][] = \"MATCH(\" . $ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE)\";\n\t\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"score > 0\";\n\t\t\t$this->searchQ['orderby'][] = 'score DESC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t\n\t\t//! **** FILTERS ****\n\t\t//! profession\n\t\tif( isset($this->vars['profession']) && strlen($this->vars['profession']) ){\n\t\t\n\t\t\t//$this->searchQ['where'][] = \" l.listing_type_id IN (\" . implode(',', $this->vars['profession']) . \") \";\n\t\t\t$this->searchQ['where'][] = \" l.listing_type_id = \" . (int)$this->vars['profession'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! max price\n\t\tif( isset($this->vars['maxprice']) && is_numeric($this->vars['maxprice']) ){\n\t\t\n\t\t\t$this->searchQ['where'][] = \" l.hourly_rate <= \" . (int)$this->vars['maxprice'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! gender\n\t\tif( isset($this->vars['gender']) && in_array($this->vars['gender'] , array('M','F')) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_gender ltg';\n\t\t\t$this->searchQ['where'][] = \" ltg.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltg.gender = '\" . $this->vars['gender'] . \"' \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\n\t\t//! speciality\n\t\tif( isset($this->vars['speciality']) && is_numeric($this->vars['speciality']) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_age ltag';\n\t\t\t$this->searchQ['where'][] = \" ltag.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltag.age_id = \" . (int)$this->vars['speciality'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! ** build the query **\n\t\t$q = \"SELECT \" . (($this->numRows)?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $this->searchQ['select']). \"\n\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\tWHERE\n\t\t\t\t\t\" . implode(' AND ', $this->searchQ['where']) ;\n\n\t\tif( isset($this->searchQ['having']) && count($this->searchQ['having']) ){\n\t\t\t$q .= \" HAVING \" . implode(' AND ' , $this->searchQ['having']);\n\t\t}\n\t\t\n\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\t\n\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \"; \n\t\n\t\treturn $q;\n\t\t\n\t}", "public function hook_query_index(&$query) {\n\t //Your code here\n\t \n\t }", "function search_query($query){\n\t\tglobal $bBlog;\n\t\t$query = $this->replace($query);\n\t\t$words = explode(' ', $query);\n\t \n\t\t$sql = '';\n\t\tforeach ($words as $word){\n\t\t\t$this->make_tmp($word);\n\t\t\t$sql .= \" OR `string` = '\".$word.\"'\";\n\t\t}\n\t\treturn $bBlog->db->get_results(\"\n\t \tSELECT \n\t\t\t`article_id` AS `id`,\n\t\t\tSUM(points) AS points_sum\n\t\tFROM `\".T_SEARCH_TMP.\"`\n\t\tWHERE 0 \".$sql.\"\n\t\tGROUP BY `id`\n\t\tORDER BY `points_sum` DESC\n\t\tLIMIT 20;\n\t\t\");\n\t}", "private function internal_query($start, $limit, $year) {\n global $DB, $CFG;\n $from = '';\n $fromarray = array();\n $where = '';\n $wherearray = array();\n $total = '';\n\n $occurstable = year_tables::get_occurs_table($year);\n $docstable = year_tables::get_docs_table($year);\n\n $join = 0;\n foreach ($this->terms as $term) {\n foreach ($term->ids as $id) {\n $alias = \"o$join\";\n if ($join == 0) {\n $from .= \"{\" . $occurstable . \"} $alias \";\n $where .= \"$alias.wordid = ?\";\n $wherearray[] = $id;\n $total .= \"$alias.score\";\n } else {\n // Note: This line uses the id directly rather than as a ?\n // parameter, because.\n $from .= \"JOIN {\" . $occurstable . \"} $alias\n ON $alias.documentid = o0.documentid AND $alias.wordid = ? \";\n $fromarray[] = $id;\n $total .= \"+$alias.score\";\n }\n $join++;\n }\n }\n // Because it kills the server to search for a large number of terms\n // when the database is full, we need to limit it.\n $maxterms = $CFG->local_ousearch_maxterms;\n if ($join > $maxterms) {\n $referer = $_SERVER['HTTP_REFERER'];\n if (!$referer) {\n $referer = ''; // Use default.\n }\n throw new moodle_exception('toomanyterms', 'local_ousearch', $referer, $maxterms);\n }\n foreach ($this->negativeterms as $term) {\n if (count($term->ids) == 1) {\n $alias = \"o$join\";\n $from .= \"LEFT JOIN {\" . $occurstable . \"} $alias\n ON $alias.documentid = o0.documentid AND $alias.wordid = ?\";\n $fromarray[] = $term->ids[0];\n $total .= \"-(CASE WHEN $alias.score IS NULL THEN 0 ELSE 999999 END)\";\n $join++;\n }\n }\n\n list ($restrict, $restrictarray) = $this->internal_get_restrictions();\n $query = \"\n SELECT o0.documentid, $total AS totalscore, d.*,\n c.shortname AS courseshortname, c.fullname AS coursefullname,\n g.name AS groupname\n FROM $from\n JOIN {\" . $docstable . \"} d ON d.id = o0.documentid\n LEFT JOIN {course} c ON d.courseid = c.id\n LEFT JOIN {groups} g ON d.groupid = g.id\n WHERE $where\n $restrict\n AND $total > 0\n ORDER BY totalscore DESC, o0.documentid\";\n $queryarray = array_merge($fromarray, $wherearray, $restrictarray);\n $result = $DB->get_records_sql($query, $queryarray, $start, $limit);\n if (!$result) {\n $result = array();\n }\n return $result;\n }", "public function hook_query_index(&$query)\n\t{\n\t\t//Your code here\n\n\t}", "function calc_dream_mp_score_a($db, $dreamid, $personid) {\n global $pwpdo;\n $query = \"select pw_vote.vote as mpvote, pw_dyn_dreamvote.vote as dreamvote from\n pw_vote, pw_dyn_dreamvote, pw_division, pw_mp where\n pw_vote.division_id = pw_division.division_id and\n pw_dyn_dreamvote.division_number = pw_division.division_number and\n pw_dyn_dreamvote.division_date = pw_division.division_date\n and pw_vote.mp_id = pw_mp.mp_id\n and pw_mp.person = ? and pw_dyn_dreamvote.dream_id = ?\";\n\n $qrowarray=$pwpdo->fetch_all_rows($query,array($personid,$dreamid));\n $t = 0.0;\n $c = 0.0;\n foreach ($qrowarray as $qrow)\n {\n $weight = 1;\n $mpvote = $qrow['mpvote'];\n $mpvote = str_replace(\"tell\", \"\", $mpvote);\n $dreamvote = $qrow['dreamvote'];\n if ($dreamvote == \"aye3\" or $dreamvote == \"no3\") {\n $dreamvote = str_replace(\"3\", \"\", $dreamvote);\n $weight = 3;\n }\n $t += $weight;\n\n if ($mpvote == $dreamvote)\n $c += $weight;\n elseif ($mpvote == \"both\" or $dreamvote == \"both\")\n $c = $c + ($weight / 2);\n }\n\n return array($c, $t);\n}", "public function onAfterPrepare()\n {\n if (!$this->owner->searchString) {\n $this->owner->parent ??= EntryParentFromRequest::getParent();\n\n // Set default order from parent entry, if no category order was set.\n if (!$this->owner->category?->getEntryOrderBy()) {\n if ($orderBy = $this->owner->parent?->getDescendantsOrder()) {\n $this->owner->query->orderBy($orderBy);\n }\n }\n\n $this->owner->query->andWhere(['parent_id' => $this->owner->parent?->id]);\n }\n }", "function _fourD_analysis_calculate_project_goal_weight( $nid, $uid=0, $goals, $project ) {\n// fourD_analysis_debug('_fourD_analysis_calculate_project_goal_weight('.$nid.'); <br>----------------------------<br>' );\n// fourD_analysis_debug('_fourD_analysis_calculate_project_goal_weight('.$nid.'); $goals: '.print_r($goals, true) );\n //fourD_analysis_debug('_fourD_analysis_calculate_project_goal_weight('.$nid.'); $project: '.print_r($project, true) );\n \n if( !count($goals) || !$project ){\n return 0.0;\n }\n \n $weight = 0;\n $indirectParents = array();\n if( isset($project['project_goal']) ){\n foreach( $goals as $gid=>$g ){\n\n $goal = fourD_analysis_goal_entry_get($gid, $uid);\n// fourD_analysis_debug('----- _fourD_analysis_calculate_project_goal_weight; : Goal: '.$project['project_goal'][$gid]['title'].'; Info: '.print_r($goal, true) );\n\n if($goal && isset($goal['goal_weight']) ){\n if( isset($project['project_goal'][$gid]['rating']) ){\n \n// fourD_analysis_debug('+++++ _fourD_analysis_calculate_project_goal_weight; : Goal: '.$project['project_goal'][$gid]['title'].'; Info: '.print_r($project['project_goal'][$gid], true) );\n\n\n /* Direct parent and top-level are G1*W1 */\n if( _fourD_analysis_is_goal_applicable_to_project_input($nid, $g) ){\n $weight += ( $goal['goal_weight']*$project['project_goal'][$gid]['rating'] );\n// fourD_analysis_debug('_fourD_analysis_calculate_project_goal_weight; INPUT: Goal: '.$project['project_goal'][$gid]['title'].'; nid: '. $gid.'; W'.$gid.' = '.$goal['goal_weight'].'; G'.$gid.' = '.$project['project_goal'][$gid]['rating'].'; W'.$gid.'*G'.$gid.' = '.( $goal['goal_weight']*$project['project_goal'][$gid]['rating'] ). '; Cumlative: '.$weight );\n\n //fourD_analysis_debug('_fourD_analysis_calculate_project_goal_weight('.$nid.'); INPUT: Goal: '.print_r($project['project_goal'][$gid], true) );\n }\n /* Indirect parents are simply (*W6*W7) - Note: not (G6*W6+G7*W7) */\n// elseif( _fourD_analysis_is_goal_applicable_to_project($nid, $g) ){\n// $indirectParents[$gid] = $goal['goal_weight'];\n// fourD_analysis_debug('_fourD_analysis_calculate_project_goal_weight; APPLICABLE: Goal: '.$project['project_goal'][$gid]['title'].'; nid: '. $gid.'; W'.$gid.' = '.$goal['goal_weight'].'; G'.$gid.' = '.$project['project_goal'][$gid]['rating'].'; W'.$gid.'*G'.$gid.' = '.( $goal['goal_weight']*$project['project_goal'][$gid]['rating'] ). '; Cumlative: '.$weight );\n// }\n \n /* ALL parents are simply (*W6*W7) - Note: not (G6*W6+G7*W7) */\n if( _fourD_analysis_is_goal_parent_to_project($nid, $g) ){\n $indirectParents[$gid] = $goal['goal_weight'];\n// fourD_analysis_debug('_fourD_analysis_calculate_project_goal_weight; PARENT: Goal: '.$project['project_goal'][$gid]['title'].'; nid: '. $gid.'; W'.$gid.' = '.$goal['goal_weight'].'; G'.$gid.' = '.$project['project_goal'][$gid]['rating'].'; W'.$gid.'*G'.$gid.' = '.( $goal['goal_weight']*$project['project_goal'][$gid]['rating'] ). '; Cumlative: '.$weight );\n //fourD_analysis_debug('_fourD_analysis_calculate_project_goal_weight('.$nid.'); PARENT: Goal: '.print_r($project['project_goal'][$gid], true) );\n }\n \n \n// fourD_analysis_debug('_fourD_analysis_calculate_project_goal_weight; nid: '. $gid.'; W'.$gid.' = '.$goal['goal_weight'].'; G'.$gid.' = '.$project['project_goal'][$gid]['rating'].'; W'.$gid.'*G'.$gid.' = '.( $goal['goal_weight']*$project['project_goal'][$gid]['rating'] ). '; Cumlative: '.$weight );\n }\n\n else{\n /* ALL parents are simply (*W6*W7) - Note: not (G6*W6+G7*W7) */\n if( _fourD_analysis_is_goal_parent_to_project($nid, $g) ){\n $indirectParents[$gid] = $goal['goal_weight'];\n// fourD_analysis_debug('_fourD_analysis_calculate_project_goal_weight; PARENT: Goal: '.$project['project_goal'][$gid]['title'].'; nid: '. $gid.'; W'.$gid.' = '.$goal['goal_weight'].'; G'.$gid.' = '.$project['project_goal'][$gid]['rating'].'; W'.$gid.'*G'.$gid.' = '.( $goal['goal_weight']*$project['project_goal'][$gid]['rating'] ). '; Cumlative: '.$weight );\n //fourD_analysis_debug('_fourD_analysis_calculate_project_goal_weight('.$nid.'); PARENT: Goal: '.print_r($g, true) );\n }\n }\n }\n\n\n }\n\n /* Finally, factor in any indirect parents */\n foreach($indirectParents as $nid=>$w){\n $weight = ($weight*$w);\n }\n }\n \n return $weight;\n}", "function sopac_catalog_search() {\n global $pager_page_array, $pager_total, $locum_results_all, $locum_cfg;\n global $user;\n $account = user_load(array('uid' => $user->uid));\n // Load Required JS libraries\n drupal_add_js(drupal_get_path('module', 'sopac') .'/js/jquery.treeview.js');\n drupal_add_js(drupal_get_path('module', 'sopac') .'/js/jquery.rating.js');\n drupal_add_js(drupal_get_path('module', 'sopac') .'/js/facet-browser.js');\n require_once('sopac_social.php');\n $getvars = sopac_parse_get_vars();\n $actions = sopac_parse_uri();\n $locum = sopac_get_locum();\n $locum_cfg = $locum->locum_config;\n $no_circ = $locum->csv_parser($locum_cfg['location_limits']['no_request']);\n $valid_search_types = array('title', 'author', 'keyword', 'subject', 'series', 'callnum', 'tags', 'reviews'); // TODO handle this more dynamically\n\n $output = $getvars['output'];\n $sort = $getvars['sort'];\n $format = $getvars['search_format'];\n $location = $getvars['location'];\n $limit_avail = $getvars['limit_avail'];\n $pager_page_array = explode(',', $getvars['page']);\n // temp for advanced page. should this be broken out\n if($actions[1] == 'isn'){\n $actions[1] = 'keyword';\n }\n $search_type = $actions[1];\n if ($actions[3]) {\n $actions[2] = $actions[2] . \"/\" . $actions[3];\n }\n $search_term = $actions[2];\n // If there is a proper search query, we get that data here.\n if (in_array($actions[1], $valid_search_types)) {\n $valid_search = TRUE;\n\n // Save the search URL in a cookie\n $_SESSION['search_url'] = request_uri();\n\n if ($getvars['perpage']) {\n $limit = $getvars['perpage'];\n }\n elseif ($account->profile_perpage) {\n $limit = $account->profile_perpage;\n }\n else {\n $limit = variable_get('sopac_results_per_page', 10);\n }\n\n\n if ($user->uid && $limit != $account->profile_perpage) {\n $field = db_fetch_object(db_query(\"SELECT * FROM profile_fields WHERE name = 'profile_perpage'\"));\n db_query(\"INSERT INTO profile_values (fid, uid, value) VALUES (%d, %d, '%s') ON DUPLICATE KEY UPDATE value = '%s'\", $field->fid, $user->uid, $limit, $limit);\n }\n\n //if ($addl_search_args['limit']) {\n // $limit = $addl_search_args['limit'];\n //}\n //else {\n // $limit = variable_get('sopac_results_per_page', 20);\n //}\n\n // Initialize the pager if need be\n if ($pager_page_array[0]) {\n $page = $pager_page_array[0] + 1;\n }\n else {\n $page = 1;\n }\n $page_offset = $limit * ($page - 1);\n\n // Grab the faceted search arguments from the URL\n $facet_args = array();\n if (count($getvars['facet_series'])) {\n $facet_args['facet_series'] = $getvars['facet_series'];\n }\n if (count($getvars['facet_lang'])) {\n $facet_args['facet_lang'] = $getvars['facet_lang'];\n }\n if (count($getvars['facet_year'])) {\n $facet_args['facet_year'] = $getvars['facet_year'];\n }\n if (count($getvars['facet_decade'])) {\n $facet_args['facet_decade'] = $getvars['facet_decade'];\n }\n if (count($getvars['age'])) {\n $facet_args['age'] = $getvars['age'];\n }\n if (count($getvars['facet_subject'])) {\n $facet_args['facet_subject'] = $getvars['facet_subject'];\n }\n if (count($getvars['facet_lexile'])) {\n $facet_args['facet_lexile'] = $getvars['facet_lexile'];\n }\n\n // Hide suppressed records unless permission\n $show_inactive = user_access('show suppressed records');\n\n // Get the search results from Locum\n $locum_results_all = $locum->search($search_type, $search_term, $limit, $page_offset, $sort, $format, $location, $facet_args, FALSE, $limit_avail, $show_inactive);\n $num_results = $locum_results_all['num_hits'];\n $result_info['limit'] = $limit;\n $result_info['num_results'] = $num_results;\n $result_info['hit_lowest'] = $page_offset + 1;\n if (($page_offset + $limit) < $num_results) {\n $result_info['hit_highest'] = $page_offset + $limit;\n }\n else {\n $result_info['hit_highest'] = $num_results;\n }\n }\n\n // Construct the search form\n $search_form_cfg = variable_get('sopac_search_form_cfg', 'both');\n $search_form = sopac_search_form($search_form_cfg);\n\n // If we get results back, we begin creating the hitlist\n if ($num_results > 0) {\n // We need to determine how many result pages there are.\n $pager_total[0] = ceil($num_results / $limit);\n $hitlist = '';\n $hitnum = $page_offset + 1;\n\n // When limiting to available, sometimes the \"Last\" link takes the user beyond the number of\n // available items and errors out. This will step them back until they have at least 1 hit.\n if (!count($locum_results_all['results']) && $getvars['limit_avail']) {\n $uri_arr = explode('?', request_uri());\n $uri = $uri_arr[0];\n $getvars_tmp = $getvars;\n if ($getvars_tmp['page']) {\n if ($getvars_tmp['page'] == 1) {\n $getvars_tmp['page'] = '';\n }\n else {\n $getvars_tmp['page']--;\n }\n $pvars_tmp = trim(sopac_make_pagevars(sopac_parse_get_vars($getvars_tmp)));\n $gvar_indicator = $pvars_tmp ? '?' : '';\n $step_link = $uri . $gvar_indicator . $pvars_tmp;\n header('Location: ' . $step_link);\n }\n }\n\n // Loop through results.\n foreach ($locum_results_all['results'] as $locum_result) {\n\n // Grab Stdnum\n $stdnum = $locum_result['stdnum'][0];\n\n // Get the cover image\n $cover_img_url = $locum_result['cover_img'];\n $locum_result['sort'] = $sort;\n // Grab Syndetics reviews, etc..\n $review_links = $locum->get_syndetics($locum_result['stdnum'][0]);\n if (count($review_links)) {\n $locum_result['review_links'] = $review_links;\n }\n\n // Send it all off to the template\n if ($output == \"rss\") {\n $result_body .= theme('sopac_results_hitlist_rss', $hitnum, $cover_img_url, $locum_result, $locum_cfg, $no_circ);\n }\n else if ($output == \"xml\") {\n $result_body .= theme('sopac_results_hitlist_xml', $hitnum, $cover_img_url, $locum_result, $locum_cfg, $no_circ);\n }\n else {\n $result_body .= theme('sopac_results_hitlist', $hitnum, $cover_img_url, $locum_result, $locum_cfg, $no_circ);\n }\n $hitnum++;\n }\n\n $hitlist_pager = theme('pager', NULL, $limit, 0, NULL, 6);\n }\n else if ($valid_search) {\n $result_body .= theme('sopac_results_nohits', $locum_results_all, $locum->locum_config);\n }\n\n // Pull it all together into the search page template\n $result_page = $search_form . theme($output_template, $result_info, $hitlist_pager, $result_body, $locum_results_all, $locum->locum_config);\n\n // Check to see if we're doing RSS\n if ($output == \"rss\") {\n print theme('sopac_results_rss', $result_info, $search_term, $search_type, $result_body, $locum_results_all, $locum->locum_config);\n exit(0);\n }\n else if ($output == \"xml\") {\n print theme('sopac_results_xml', $result_info, $hitlist_pager, $result_body, $locum_results_all, $locum->locum_config);\n exit(0);\n }\n else {\n $result_page = $search_form . theme('sopac_results', $result_info, $hitlist_pager, $result_body, $locum_results_all, $locum->locum_config);\n }\n\n $search_feed_url = sopac_update_url(request_uri(), 'output', 'rss');\n drupal_add_feed($search_feed_url, 'Search for \"' . $search_term . '\"');\n\n return $result_page;\n\n}", "public function query() {\n if (!empty($this->value)) {\n $this->ensureMyTable();\n $field = \"$this->tableAlias.nid\";\n\n $configuration = array(\n 'type' => 'INNER',\n 'table' => 'menu_link_content_data',\n 'field' => 'link__uri',\n 'left_table' => 'node_field_data',\n 'left_field' => 'nid',\n 'operator' => '=',\n );\n $join = Views::pluginManager('join')->createInstance('standard', $configuration);\n $this->query->addRelationship('my_uu', $join, 'node_field_data');\n $this->query->addWhere($this->options['group'], $field, $this->value, '=');\n }\n }", "function gre_search_results()\n\t{\n\t\tglobal $wpdb,$post;\n\n\t\t\t$select = 'city,blurb,address,bedrooms,bathrooms,saleprice';\n\t\t\t$pre_where = '';\n\t\t\t$output = '';\n\t\t\t\n\t\t\tif( $_POST )\n\t\t\t{\n\t\t\t\t$search_type = $_POST['search-type'];\n\t\t\t\tif($search_type == 'fs')\n\t\t\t\t{\n\t\t\t\t\tif($_POST['location'] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$loc = $wpdb->escape($_POST['location']);\n\t\t\t\t\t\t$pre_where .= \"(address LIKE '%$loc%' OR postcode LIKE '%$loc%' OR city LIKE '%$loc%')\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($_POST['min'] != 'min' && ($_POST['max'] == '' || $_POST['max'] == 'max'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$min = $wpdb->escape($_POST['min']);\n\t\t\t\t\t\t$pre_where .= \" AND saleprice > $min\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(($_POST['min'] == '' || $_POST['min'] == 'min') && $_POST['max'] != 'max')\n\t\t\t\t\t{\n\t\t\t\t\t\t$max = $wpdb->escape($_POST['max']);\n\t\t\t\t\t\t$pre_where .= \" AND saleprice <= $max\";\n\t\t\t\t\t}\n\t\t\t\t\telse if($_POST['min'] != 'min' && $_POST['max'] != 'max')\n\t\t\t\t\t{\n\t\t\t\t\t\t$min = $wpdb->escape($_POST['min']);\n\t\t\t\t\t\t$max = $wpdb->escape($_POST['max']);\n\t\t\t\t\t\t$pre_where .= \" AND (saleprice >= $min AND saleprice <= $max)\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($_POST['beds'] != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$arr = explode('-',$_POST['beds']);\n\t\t\t\t\t\t$min = $wpdb->escape($arr[0]);\n\t\t\t\t\t\t$max = $wpdb->escape($arr[1]);\n\t\t\t\t\t\t$pre_where .= \" AND (bedrooms >= $min AND bedrooms <= $max)\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($_POST['baths'] != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$arr = explode('-',$_POST['baths']);\n\t\t\t\t\t\t$min = $wpdb->escape($arr[0]);\n\t\t\t\t\t\t$max = $wpdb->escape($arr[1]);\n\t\t\t\t\t\t$pre_where .= \" AND (bathrooms >= $min AND bathrooms <= $max)\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($_POST['sqft'] != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sqft = $wpdb->escape($_POST['sqft']);\n\t\t\t\t\t\t$pre_where .= \" AND acsf >= $sqft\";\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($_POST['price_change']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$pre_where .= \" AND reduceprice <> '0' AND saleprice > reduceprice\";\n\t\t\t\t\t\t$select .= \",reduceprice\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if($search_type == 'sh')\n\t\t\t\t{\n\t\t\t\t\tif($_POST['location'] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$loc = $wpdb->escape($_POST['location']);\n\t\t\t\t\t\t$pre_where .= \"(address LIKE '%$loc%' OR postcode LIKE '%$loc%' OR city LIKE '%$loc%')\";\n\t\t\t\t\t\t$pre_where .=\" AND saledate <> '0000-00-00'\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($_POST['min'] != 'min' && ($_POST['max'] == '' || $_POST['max'] == 'max'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$min = $wpdb->escape($_POST['min']);\n\t\t\t\t\t\t$pre_where .= \" AND saleprice >= $min\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(($_POST['min'] == '' || $_POST['min'] == 'min') && $_POST['max'] != 'max')\n\t\t\t\t\t{\n\t\t\t\t\t\t$max = $wpdb->escape($_POST['max']);\n\t\t\t\t\t\t$pre_where .= \" AND saleprice <= $max\";\n\t\t\t\t\t}\n\t\t\t\t\telse if($_POST['min'] != 'min' && $_POST['max'] != 'max')\n\t\t\t\t\t{\n\t\t\t\t\t\t$min = $wpdb->escape($_POST['min']);\n\t\t\t\t\t\t$max = $wpdb->escape($_POST['max']);\n\t\t\t\t\t\t$pre_where .= \" AND (saleprice >= $min AND saleprice <= $max)\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($_POST['beds'] != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$arr = explode('-',$_POST['beds']);\n\t\t\t\t\t\t$min = $wpdb->escape($arr[0]);\n\t\t\t\t\t\t$max = $wpdb->escape($arr[1]);\n\t\t\t\t\t\t$pre_where .= \" AND (bedrooms >= $min AND bedrooms <= $max)\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($_POST['baths'] != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$arr = explode('-',$_POST['baths']);\n\t\t\t\t\t\t$min = $wpdb->escape($arr[0]);\n\t\t\t\t\t\t$max = $wpdb->escape($arr[1]);\n\t\t\t\t\t\t$pre_where .= \" AND (bathrooms >= $min AND bathrooms <= $max)\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($_POST['sold'] != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$num_month = $wpdb->escape($_POST['sold']);\n\t\t\t\t\t\t$pre_where .= \" AND (saledate <= DATE_ADD(listdate, INTERVAL $num_month MONTH))\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif($_POST['location'] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$loc = $wpdb->escape($_POST['location']);\n\t\t\t\t\t\t$pre_where .= \"(address LIKE '%$loc%' OR postcode LIKE '%$loc%' OR city LIKE '%$loc%')\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$where .= (empty($pre_where))? \"\" : \"WHERE $pre_where\";\n\t\t\t\t\t\t\n\t\t\t\t$listing = $wpdb->get_results(\"SELECT $select FROM $wpdb->gre_search_listing $where\");\n\t\t\t\tif($listing)\n\t\t\t\t{\n\t\t\t\t\t$output .= \"<div>\";\n\t\t\t\t\tforeach ($listing as $row) \n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$output .= \"<div>City : $row->city</div>\";\n\t\t\t\t\t\t$output .= \"<div>Blurb : $row->blurb</div>\";\n\t\t\t\t\t\t$output .= \"<div>Address : $row->address</div>\";\n\t\t\t\t\t\t$output .= \"<div>Bedrooms : $row->bedrooms</div>\";\n\t\t\t\t\t\t$output .= \"<div>Bathrooms : $row->bathrooms</div>\";\n\t\t\t\t\t\t$output .= \"<div>Saleprice : $ \". number_format($row->saleprice) .\"</div>\";\n\t\t\t\t\t\tif($row->reduceprice)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= \"<div>Reduce Saleprice : $ \". number_format($row->reduceprice) .\"</div>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$output .= \"<hr/>\";\n\t\t\t\t\t}\n\t\t\t\t\t$output .= \"</div>\";\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$output .= \"<div>No Result Found</div>\";\n\t\t\t\t}\n\t\t\t\treturn '<br/>'.$output;\n\t\t\t}\n\t}", "public function execute()\n\t{\n\t\t$searchQuery = $this->searchPhrase ? '\"' . $this->searchPhrase . '\"' : '';\n\t\t$queryParams['attributesToRetrieve']\t= '*';\n\t\t$queryParams['maxValuesPerFacet']\t\t= '100';\n\t\t$queryParams['attributesToHighlight']\t= array();\n\t\t$queryParams['filters']\t\t\t\t\t= $this->filters;\n\t\t$queryParams['facetFilters']\t\t\t= $this->facetFilters;\n\t\t$queryParams['offset']\t\t\t\t\t= $this->start;\n\t\t$queryParams['length']\t\t\t\t\t= $this->limit;\n\n\t\t$queryParams['facets']\t\t\t\t\t= array($this->facetField);\n\n\t\t// We need to pass this query by setRawQueryParams for advsearch frontent.\n\t\t$queryParams['advancedSyntax']\t\t\t= 'true';\n\n\t\tif (count($this->rawQueryParams))\n\t\t{\n\t\t\t$queryParams = array_merge($queryParams, $this->rawQueryParams);\n\t\t}\n\n\t\t// This is something Juggad related to Osianama requirement.\n\t\tif (isset($queryParams['restrictSearchableAttributes']))\n\t\t{\n\t\t\t$searchQuery = $this->searchPhrase ? $this->searchPhrase : '';\n\t\t}\n\n\t\t$Data = $this->algoliaIndex->search($searchQuery, $queryParams);\n\n\t\tif (count($Data['hits']) > 0)\n\t\t{\n\t\t\t$this->total\t= $Data['nbHits'];\n\t\t\t$this->count\t= $Data['hitsPerPage'];\n\t\t\t$this->records\t= '';\n\n\t\t\tforeach ($Data['hits'] as $key => $row)\n\t\t\t{\n\t\t\t\tunset($row['_highlightResult']);\n\n\t\t\t\t$row['id']\t\t\t\t\t\t= $row['objectID'];\n\t\t\t\t$this->records['data'][$key]\t= (object) $row;\n\t\t\t}\n\n\t\t\tif ($this->facetField)\n\t\t\t{\n\t\t\t\t$this->records['facets'] = $Data['facets'];\n\t\t\t}\n\t\t}\n\t}", "public function createDefaultSearchQuery()\n {\n $qB = SearchEngine::getElasticaQueryBuilder();\n\n $keyword = Utility::convertArrayToString($this->searchEvent->getKeyword());\n $where = $this->searchEvent->getWhere();\n\n $keywordQuery = null;\n $whereQuery = null;\n $content = 0;\n if ($where) {\n if ($geoDistance = $this->container->get(\"nearby.handler\")->getGeoDistanceInfoByWhere()) {\n $whereQuery = $qB->query()->bool();\n $whereQuery->addShould(\n $qB->query()->match()->setFieldQuery(\"searchInfo.location\",$where)\n ->setFieldType(\"searchInfo.location\", \"phrase\")\n ->setFieldBoost(\"searchInfo.location\", 2)\n ->setFieldParam('searchInfo.location', 'slop', 30)\n );\n $whereQuery->addShould(\n $qB->query()->geo_distance(\n 'geoLocation',\n [\n 'lat' => $geoDistance['latitude'],\n 'lon' => $geoDistance['longitude'],\n ],\n $geoDistance['radius'])\n );\n $content |= 1;\n } else {\n $whereQuery = $qB->query()->match()->setFieldQuery('searchInfo.location',$where)\n ->setFieldType('searchInfo.location', 'phrase')\n ->setFieldParam('searchInfo.location', 'slop', 30);\n $content |= 1;\n }\n }\n\n if ($keyword) {\n $keywordQuery = $qB->query()->multi_match();\n\n $keywordQuery->setQuery($keyword)\n ->setTieBreaker(0.3)\n ->setOperator(\"and\")\n ->setFields([\n 'friendlyUrl^500',\n 'title.raw^200',\n 'title.analyzed^10',\n 'description^5',\n 'searchInfo.keyword^1',\n 'searchInfo.location^1',\n ]);\n\n $content |= 2;\n }\n\n /* ModStores Hooks */\n HookFire(\"baseconfiguration_before_setup_query\", [\n \"content\" => &$content,\n \"whereQuery\" => &$whereQuery,\n \"keywordQuery\" => &$keywordQuery\n ]);\n\n switch ($content) {\n case 1:\n $query = $whereQuery;\n break;\n case 2:\n $query = $keywordQuery;\n break;\n case 3:\n $query = $qB->query()->bool();\n $query->addMust($keywordQuery);\n $query->addMust($whereQuery);\n break;\n default:\n $query = $qB->query()->match_all();\n break;\n }\n\n /* ModStores Hooks */\n HookFire(\"baseconfiguration_before_return_query\", [\n \"query\" => &$query,\n ]);\n\n return $query;\n }", "public static function applyCostSearch($query, $search)\n { \n static::applyRelatedSearch($query, $search);\n }", "function process_query_index( $query )\n\t{\n\t\treturn $query;\n\t}", "function search_api_post_update_views_query_type() {\n $config_factory = \\Drupal::configFactory();\n $changed_cache = [];\n\n foreach ($config_factory->listAll('views.view.') as $view_config_name) {\n $view = $config_factory->getEditable($view_config_name);\n if (substr($view->get('base_table'), 0, 17) == 'search_api_index_') {\n $displays = $view->get('display');\n\n $update_query = $update_cache = FALSE;\n foreach ($displays as $id => $display) {\n if (($display['display_options']['query']['type'] ?? '') === 'views_query') {\n $displays[$id]['display_options']['query']['type'] = 'search_api_query';\n $update_query = TRUE;\n }\n if (in_array($display['display_options']['cache']['type'] ?? '', ['tag', 'time'])) {\n $displays[$id]['display_options']['cache']['type'] = 'none';\n $update_cache = TRUE;\n }\n }\n\n if ($update_query || $update_cache) {\n $view->set('display', $displays);\n // Mark the resulting configuration as trusted data. This avoids issues\n // with future schema changes.\n $view->save(TRUE);\n if ($update_cache) {\n $changed_cache[] = $view->get('id');\n }\n }\n }\n }\n\n if ($changed_cache) {\n $vars = ['@ids' => implode(', ', array_unique($changed_cache))];\n return t('The following views have had caching switched off. The selected caching mechanism does not work with views on Search API indexes. Please either use one of the Search API-specific caching options or \"None\": @ids.', $vars);\n }\n\n return NULL;\n}", "public function reindex(&$parentArray=array()) {\n\n\t\t$this->load->model(\"search_model\");\n\n\t\tif(count($parentArray)>5 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->buildCache();\n\n\t\t$this->search_model->addOrUpdate($this);\n\t\t// now find any related items and resave them.\n\t\t//\n\t\t// we build a parent array so we don't recurse\n\n\t\t// we might be rebuilding outside an instance, in which case we don't do this.\n\t\tif(!$this->instance) {\n\t\t\treturn;\n\t\t}\n\t\t$results = $this->search_model->find([\"searchText\"=>$this->getObjectId(), \"searchRelated\"=>true], false);\n\t\t$parentArray[] = $this->getObjectId();\n\n\t\tforeach($results[\"searchResults\"] as $result) {\n\t\t\tif(!in_array($result, $parentArray)) {\n\t\t\t\techo \"subIndex: \" . $result . \"\\n\";\n\t\t\t\t// $this->logging->logError(\"updating\", $result);\n\t\t\t\t$tempAsset = new Asset_model();\n\t\t\t\t$tempAsset->loadAssetById($result);\n\t\t\t\t$tempAsset->reindex($parentArray);\n\t\t\t\tif($this->config->item('enableCaching')) {\n\t\t\t\t\t$this->doctrineCache->setNamespace('searchCache_');\n\t\t\t\t\t$this->doctrineCache->delete($this->getObjectId());\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}", "function ml_wpsearch_search_query($query, $params)\n{\n $driver = DriverRegistry::getInstance()->get('marklogic');\n $new_query = $query;\n\n if (is_string($query))\n {\n $new_query = trim($query);\n if (!$new_query)\n {\n return null;\n }\n $searchExcludeArr = explode(PHP_EOL, $options['search_exclude']);\n\n foreach ($searchExcludeArr as $searchExclude) {\n\n $exitLoop = false;\n\n if (preg_match('/(\\w+)\\s(.+)\\s({?{?.+}?}?)/', $searchExclude, $matches)) {\n\n $elem = $matches[1];\n $oper = $matches[2];\n $value = $matches[3];\n\n if (preg_match('/^{{(\\w+)}}?/', $value, $specialMatches)) {\n\n switch($specialMatches[1]) {\n case 'today':\n $value = '\"' . date(\"Y-m-d\\TH:i:s+00:00\") . '\"';\n break;\n default:\n $exitLoop = true;\n break;\n }\n }\n\n if ($exitLoop)\n break;\n\n switch(ord($oper)) {\n case 61:\n $oper = \":\";\n break;\n case 62:\n $oper = \"GT\";\n break;\n case 38:\n $oper = \"LT\";\n break;\n default:\n break;\n }\n\n $new_query .= \" AND -{$elem} {$oper} {$value}\";\n\n }\n }\n }\n elseif (is_array($query))\n {\n if (!$query)\n {\n return null;\n }\n $new_query = wp_json_encode($query);\n }\n\n $options = Options::getOptions();\n\n // Provides way for changing search query and parameters.\n $new_params = apply_filters('ml_wpsearch_search_query_params', wp_parse_args($params, array(\n 'start' => 1,\n 'pageLength' => 10,\n 'view' => 'all',\n 'options' => $options['rest_config_option'],\n 'transform' => $options['rest_transform'],\n )));\n\n $new_query = apply_filters('ml_wpsearch_search_query_value', $new_query, $params);\n\n $results = $driver->search(stripslashes(sanitize_text_field($new_query)), $new_params, is_array($query)); // Assume structured query for arrays.\n\n return $results;\n}", "public function search_criteria_list($post_data){\n $userId = $post_data['userId']; \n $date = date(\"Y-m-d H:i:s\");\n $keyword = $post_data['keyword'];\n $latitude = $post_data['latitude'];\n $longitude = $post_data['longitude'];\n $limit = $post_data['limit'];\n $offset = $post_data['offset'];\n // $filter = $post_data['filter']; //fav_teacher/all\n // $type = $post_data['type']; // upcoming/past\n \n\n if(!empty($keyword)){\n $keyword = \"AND (s.searchName LIKE '%$keyword%' OR s.idealMovingDate LIKE '%$keyword%' OR s.houseType LIKE '%$keyword%' OR s.priceRange LIKE '%$keyword%' OR s.bedroom LIKE '%$keyword%')\";\n }\n\n if(!empty($latitude) && !empty($longitude))\n {\n $distance_in_km = \"( 6371 * acos( cos( radians($latitude) ) * cos( radians( lc.latitude) ) \n * cos( radians( lc.longitude ) - radians($longitude) ) + \n sin( radians($latitude) ) * sin( radians( lc.latitude ) ) ) ) \n AS distance_in_km\";\n }\n\n if (!empty($latitude) && !empty($longitude)) {\n $sql = \"SELECT s.searchId,s.userId,s.searchName,s.idealMovingDate,s.area,u.userId,u.firstName,u.lastName,((SELECT COUNT(*) from tribe t1 WHERE t1.searchId = s.searchId AND t1.status ='accept' AND t1.deleteFlag != 1)+1) as participantCount,\n (SELECT COUNT(*) from shortlistedproperty sp WHERE sp.searchId = s.searchId AND sp.deleteFlag !=1) as properties\n FROM searchcriteria s \n left join tribe t on s.searchId = t.searchId AND t.fromuserId = $userId\n left join users u on s.userId = u.userId\n left join shortlistedproperty p on s.searchId = p.searchId \n where s.searchId in (SELECT t.searchId from tribe t where (t.touserId =$userId OR t.fromuserId =$userId) AND t.status = 'accept' AND t.deleteFlag != 1) OR s.userId =$userId $keyword\n GROUP BY s.searchId ORDER BY s.createdAt DESC LIMIT $offset, $limit\";\n }else{\n $sql = \"SELECT s.searchId,s.userId,s.searchName,s.idealMovingDate,s.area,u.userId,u.firstName,u.lastName,((SELECT COUNT(*) from tribe t1 WHERE t1.searchId = s.searchId AND t1.status ='accept' AND t1.deleteFlag != 1)+1) as participantCount,\n (SELECT COUNT(*) from shortlistedproperty sp WHERE sp.searchId = s.searchId AND sp.deleteFlag !=1) as properties\n FROM searchcriteria s \n left join tribe t on s.searchId = t.searchId AND t.fromuserId = $userId\n left join users u on s.userId = u.userId\n left join shortlistedproperty p on s.searchId = p.searchId \n where s.searchId in (SELECT t.searchId from tribe t where (t.touserId = $userId OR t.fromuserId =$userId) AND t.status = 'accept' AND t.deleteFlag != 1) OR s.userId =$userId $keyword\n GROUP BY s.searchId ORDER BY s.createdAt DESC LIMIT $offset, $limit\";\n }\n\n //echo $sql;exit();\n $record = $this->db->query($sql);\n if($record->num_rows()>0){\n return $record->result_array();\n } \n }", "function searchwp_query_inject() {\n\t\tglobal $wpdb;\n\n\t\t$sql = '';\n\n\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t$this->get_woocommerce_ordering();\n\t\t}\n\n\t\tif ( $this->is_woocommerce_search() && ! empty( $this->ordering ) ) {\n\t\t\t// ratings need moar SQL\n\t\t\tif ( 'rating' === $this->ordering['wc_orderby'] ) {\n\t\t\t\t$sql = \" AVG( swpwpcommeta.meta_value ) as average_rating \";\n\t\t\t}\n\t\t}\n\n\t\treturn $sql;\n\t}", "private function makeQueryNoSplit(){\n\t\t\n\t\t$this->searchQ['select'] = array('l.name','l.summary','l.sum_approach','l.sum_problems','l.address_line_1','l.address_line_2','l.town','l.county','l.postcode','l.country','l.phone','l.image','l.latitude','l.longitude','l.publish_address','l.publish_phone','l.approved','p.uri','p.urlname','e.level','y.listing_type');\n\t\t$this->searchQ['orderby'][] = 'l.level_id DESC';\n\t\t$this->searchQ['from'] = 'listing l, listing_level e, listing_type y, pages p'; //should always be the same...\n\t\t$this->searchQ['where'] = array('e.level_id = l.level_id','y.listing_type_id = l.listing_type_id','l.page_id = p.page_id','l.publish = 1');//,'p.publish = 1');\n\t\t\n\t\t// set up the initial search variables\t\t\n\t\t//! location\n\t\tif( strlen($this->vars['location']) ){\n\t\t\n\t\t\t$this->Geocode = new Geolocation( $this->vars['location']. ', UK' );\n\t\t\t$this->Geocode->lookup();\n\t\t\t// using the OS grid as makes calculation simpler than using lng/lat - can use simple pythag rather than calculus functions\n\t\t\t// we shorten the list of rows needing the calculation by the greater / less than in the where\n\t\t\t\n\t\t\t$calculation = ' SQRT(POW(( l.easting - ' . round($this->Geocode->getOSEast()) . '),2) + POW((l.northing - ' . round($this->Geocode->getOSNorth()) . '),2)) ';\n\t\t\t$this->searchQ['select'][] = $calculation . \" AS distance\";\n\t\t\t$this->searchQ['where'][] = \"northing < \" . round( $this->Geocode->getOSNorth() + $this->searchDistance ) ; \n\t\t\t$this->searchQ['where'][] = \"northing > \" . round( $this->Geocode->getOSNorth() - $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting < \" . round( $this->Geocode->getOSEast() + $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting > \" . round( $this->Geocode->getOSEast() - $this->searchDistance ) ;\n\t\t//\t$this->searchQ['where'][] = \"(\" . $calculation . \") <= \" . $this->searchDistance ;\n\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"distance <= \" . $this->searchDistance;\n\t\t\t$this->searchQ['orderby'][] = 'distance ASC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! freetext\n\t\tif( strlen($this->vars['term']) ){\n\t\t\t$this->searchQ['select'][] = \"MATCH(\" . $this->ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE) AS score\";\n\t\t\t//$this->searchQ['where'][] = \"MATCH(\" . $ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE)\";\n\t\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"score > 0\";\n\t\t\t$this->searchQ['orderby'][] = 'score DESC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t\n\t\t//! **** FILTERS ****\n\t\t//! profession\n\t\tif( isset($this->vars['profession']) && strlen($this->vars['profession']) ){\n\t\t\n\t\t\t//$this->searchQ['where'][] = \" l.listing_type_id IN (\" . implode(',', $this->vars['profession']) . \") \";\n\t\t\t$this->searchQ['where'][] = \" l.listing_type_id = \" . (int)$this->vars['profession'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! max price\n\t\tif( isset($this->vars['maxprice']) && is_numeric($this->vars['maxprice']) ){\n\t\t\n\t\t\t$this->searchQ['where'][] = \" l.hourly_rate <= \" . (int)$this->vars['maxprice'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! gender\n\t\tif( isset($this->vars['gender']) && in_array($this->vars['gender'] , array('M','F')) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_gender ltg';\n\t\t\t$this->searchQ['where'][] = \" ltg.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltg.gender = '\" . $this->vars['gender'] . \"' \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\n\t\t//! speciality\n\t\tif( isset($this->vars['speciality']) && is_numeric($this->vars['speciality']) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_age ltag';\n\t\t\t$this->searchQ['where'][] = \" ltag.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltag.age_id = \" . (int)$this->vars['speciality'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! ** build the query **\n\t\t$q = \"SELECT \" . (($this->numRows)?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $this->searchQ['select']). \"\n\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\tWHERE\n\t\t\t\t\t\" . implode(' AND ', $this->searchQ['where']) ;\n\t\t\t\t\t\n\t\tif( isset($this->searchQ['having']) && count($this->searchQ['having']) ){\n\t\t\t$q .= \" HAVING \" . implode(' AND ' , $this->searchQ['having']);\n\t\t}\n\t\t\n\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\n\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \"; \n\t\t\t\n\t\treturn $q;\n\t\t\n\t}", "private function layeredSearch(): void\n {\n $this->setLimitAndOffset();\n $needles = $this->getNeedlesForPage();\n foreach ($this->layers as $Layer) {\n $Layer->quick_search = $this->config->quick_search;\n $Layer->resetNeedles();\n $Layer->searchAllNeedles($needles, $this->search_key);\n $needles = $Layer->getNeedles();\n }\n $this->saveNeedlesForPage($needles);\n }", "function event_PreSearchResults(&$data)\n\t{\n\t\tglobal $blog, $manager;\n\t\t$blogs = $data['blogs'];\n\t\t$query = $data['query'];\n\t\t$items =& $data['items'];\n\t\t$searchclass =& new SEARCH($query);\n\n\t\t$sqlquery = 'SELECT i.inumber as itemid FROM ';\n\t\t$tables = sql_table('item') . ' as i ';\n\t\t$where_str = '';\n\t\tif ($this->getOption('commentsearch') == 'yes') {\n\t\t \t$tables .= ' left join ' . sql_table('comment') . ' as cm'\n\t\t \t\t\t \t. ' on i.inumber = cm.citem ';\n\t\t \t$where_str .= 'xxx.cm.cbody';\n\t\t}\n\t\t\n\t\tif ($this->getOption('tagsearch') == 'yes' &&\n\t\t\t$manager->pluginInstalled('NP_TagEX')) {\n\t\t\t\t$tables .= ' left join ' . sql_table('plug_tagex') . ' as tag'\n\t\t\t\t\t\t\t. ' on i.inumber = tag.inum';\n\t\t\t\t$where_str .= ',xxx.tag.itags';\n\t\t}\n\t\tif ($this->getOption('trackbacksearch') == 'yes' &&\n\t\t\t$manager->pluginInstalled('NP_TrackBack')) {\n\t\t\t\t$tables .= ' left join ' . sql_table('plugin_tb') . ' as t'\n\t\t\t\t\t\t\t. ' on i.inumber = t.tb_id';\n\t\t\t\t$where_str .= ',xxx.t.title,xxx.t.excerpt';\n\t\t}\n\t\t$sqlquery .= $tables;\n\t\t$where = $searchclass->boolean_sql_where($where_str);\n\t\t$where = strtr($where, array('i.xxx.' => ''));\n\t\t$sqlquery .= ' WHERE i.idraft = 0'\n\t\t\t\t . ' and i.itime <= ' . mysqldate($blog -> getCorrectTime())\n\t\t\t\t . ' and i.iblog in (' . implode(',', $blogs) . ') '\n\t\t\t\t . ' and ' . $where;\n\t\t$res = sql_query($sqlquery);\n\t\t$array = array();\n\t\twhile ($itemid = mysql_fetch_row($res)) {\n\t\t\tarray_push($array, $itemid[0]);\n\t\t}\n\t\t$data['items'] = array_unique(array_merge($items,$array));\n\t}", "public function query() {\n /** @var Sql $query */\n $query = $this->query;\n\n $configuration = array(\n 'table' => 'node_field_revision',\n 'field' => 'vid',\n 'left_table' => 'node_field_data',\n 'left_field' => 'vid',\n 'operator' => '=',\n 'type'=>'INNER',\n 'left_query' => 'select max(vid) from node_field_revision where nid = nfr.nid',\n 'extra' => 'node_field_data.nid = nfr.nid',\n );\n\n /** @var Subquery $join */\n $join = Views::pluginManager('join')->createInstance('subquery', $configuration);\n\n $query->addRelationship(\"nfr\", $join ,'node_field_revision' );\n $query->addWhere(0, 'nfr.moderation_state', $this->value, 'IN');\n }", "private function _recalcAdv() {\n $this->_recalcEntity($this->adv, $this->advGroup->click_price); // @TODO Price is on advGroup. But this can be in the near future on every adv\n }", "public function count_search_criteria_list($post_data){\n $userId = $post_data['userId']; \n $date = date(\"Y-m-d H:i:s\");\n $keyword = $post_data['keyword'];\n $latitude = $post_data['latitude'];\n $longitude = $post_data['longitude'];\n // $filter = $post_data['filter']; //fav_teacher/all\n // $type = $post_data['type']; // upcoming/past\n \n\n if(!empty($keyword)){\n $keyword = \"AND (s.searchName LIKE '%$keyword%' OR s.idealMovingDate LIKE '%$keyword%' OR s.houseType LIKE '%$keyword%' OR s.priceRange LIKE '%$keyword%' OR s.bedroom LIKE '%$keyword%')\";\n }\n\n if(!empty($latitude) && !empty($longitude))\n {\n $distance_in_km = \"( 6371 * acos( cos( radians($latitude) ) * cos( radians( lc.latitude) ) \n * cos( radians( lc.longitude ) - radians($longitude) ) + \n sin( radians($latitude) ) * sin( radians( lc.latitude ) ) ) ) \n AS distance_in_km\";\n }\n\n if (!empty($latitude) && !empty($longitude)) {\n\n $sql = \"SELECT s.*,u.userId,u.firstName,u.lastName,((SELECT COUNT(*) from tribe t1 WHERE t1.searchId = s.searchId AND t1.status ='accept' AND t1.deleteFlag != 1) +1) as participantCount,\n (SELECT COUNT(*) from shortlistedproperty sp WHERE sp.searchId = s.searchId AND sp.deleteFlag !=1) as properties\n FROM searchcriteria s \n left join tribe t on s.searchId = t.searchId AND t.fromuserId = $userId\n left join users u on s.userId = u.userId\n left join shortlistedproperty p on s.searchId = p.searchId \n where s.searchId in (SELECT t.searchId from tribe t where (t.touserId =$userId OR t.fromuserId =$userId) AND t.status = 'accept' AND t.deleteFlag != 1) OR s.userId =$userId $keyword\n GROUP BY s.searchId ORDER BY s.createdAt DESC\";\n \n }else{\n $sql = \"SELECT s.*,u.userId,u.firstName,u.lastName,((SELECT COUNT(*) from tribe t1 WHERE t1.searchId = s.searchId AND t1.status ='accept' AND t1.deleteFlag != 1)+1) as participantCount,\n (SELECT COUNT(*) from shortlistedproperty sp WHERE sp.searchId = s.searchId AND sp.deleteFlag !=1) as properties\n FROM searchcriteria s \n left join tribe t on s.searchId = t.searchId AND t.fromuserId = $userId\n left join users u on s.userId = u.userId\n left join shortlistedproperty p on s.searchId = p.searchId \n where s.searchId in (SELECT t.searchId from tribe t where (t.touserId =$userId OR t.fromuserId =$userId) AND t.status = 'accept' AND t.deleteFlag != 1) OR s.userId =$userId $keyword\n GROUP BY s.searchId ORDER BY s.createdAt DESC\";\n \n }\n\n $record = $this->db->query($sql);\n return $record->num_rows();\n }", "public function actionIndex()\n { \n IF(ISSET($_GET['aid']))\n $aid=$_GET['aid'];\n ELSE\n $aid=NULL;\n \n IF(ISSET($_GET['id']))\n $eid=$_GET['id'];\n ELSE\n $eid=NULL;\n \n $searchModel = new AuditAnswerSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->query->andWhere(['audit_id'=>$aid,'establishment_id'=>$eid]);\n \n $summarySearchModel = new AuditSummarySearch();\n $summaryDataProvider = $summarySearchModel->search(Yii::$app->request->queryParams);\n $summaryDataProvider->query->andWhere(['audit_id'=>$aid,'establishment_id'=>$eid]);\n \n $myAverage = 0;\n $myTot =0;\n $myCnt = 0;\n \n foreach ($summaryDataProvider->models as $key => $value) {\n $myTot += $value['percentage'];\n $myCnt++; // This should be $myCnt\n }\n \n if ($myCnt>0){ // inside if use $myCnt\n $myAverage = $myTot/$myCnt; // here use $myTot/$myCnt\n }\n \n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'summarySearchModel' => $summarySearchModel,\n 'summaryDataProvider' => $summaryDataProvider,\n 'average'=>$myAverage,\n ]);\n }", "private function set_hits( $uid, $value, $row )\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS filter configuration\n //$conf_name = $this->conf_view['filter.'][$table . '.'][$field];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n // Set display hits flag\n // SWITCH first item\n switch ( true )\n {\n case( $uid == $conf_array[ 'first_item.' ][ 'option_value' ] ):\n $bool_displayHits = $conf_array[ 'first_item.' ][ 'display_hits' ];\n $bool_displayEmptyHits = $conf_array[ 'first_item.' ][ 'display_hits.' ][ 'display_empty_hits' ];\n break;\n default:\n $bool_displayHits = $conf_array[ 'wrap.' ][ 'item.' ][ 'display_hits' ];\n $bool_displayEmptyHits = $conf_array[ 'wrap.' ][ 'item.' ][ 'display_hits.' ][ 'display_empty_hits' ];\n break;\n }\n // SWITCH first item\n // Set display hits flag\n // RETURN hit shouldn't displayed\n if ( !$bool_displayHits )\n {\n return $value;\n }\n // RETURN hit shouldn't displayed\n // Get the label for the hit field\n $hitsField = $this->sql_filterFields[ $this->curr_tableField ][ 'hits' ];\n // Get the hit\n $hits = $row[ $hitsField ];\n\n // IF there is no hit and empty hits shouldn't displayed\n // RETURN item without any hit stdWrap\n if ( $hits < 1 && (!$bool_displayEmptyHits ) )\n {\n return $value;\n }\n // RETURN item without any hit stdWrap\n // IF there is no hit and empty hits shouldn't displayed\n // stdWrap the hit\n // SWITCH first item\n switch ( true )\n {\n case( $uid == $conf_array[ 'first_item.' ][ 'option_value' ] ):\n $stdWrap = $conf_array[ 'first_item.' ][ 'display_hits.' ][ 'stdWrap.' ];\n break;\n default:\n $stdWrap = $conf_array[ 'wrap.' ][ 'item.' ][ 'display_hits.' ][ 'stdWrap.' ];\n break;\n }\n // SWITCH first item\n $hits = $this->pObj->objWrapper4x->general_stdWrap( $hits, $stdWrap );\n // stdWrap the hit\n // Get behind flag\n // SWITCH first item\n switch ( true )\n {\n case( $uid == $conf_array[ 'first_item.' ][ 'option_value' ] ):\n $bool_behindItem = $conf_array[ 'first_item.' ][ 'display_hits.' ][ 'behindItem' ];\n break;\n default:\n $bool_behindItem = $conf_array[ 'wrap.' ][ 'item.' ][ 'display_hits.' ][ 'behindItem' ];\n break;\n }\n // SWITCH first item\n // Get behind flag\n // SWITCH behind flag\n switch ( $bool_behindItem )\n {\n case( true ):\n $value = $value . $hits;\n break;\n default:\n $value = $hits . $value;\n break;\n }\n // SWITCH behind flag\n\n unset( $uid );\n return $value;\n }", "function bb_customize_search_query ($query) {\n //$search_query = get_search_query();\n // $meta_query = array(\n // array(\n // 'key' => 'editorial_style_definition',\n // 'value' => $search_query,\n // 'compare' => 'EXISTS'\n // )\n // );\n \n // Change the query parameters\n $query->set( 'posts_per_page', -1 );\n $query->set( 'orderby', 'meta_value' );\n $query->set( 'order', 'ASC' );\n \n \n\n \n }", "function getTermHits($searchTerm,$organism_version_id){\n $searchTerm =trim($searchTerm);global $con;$hits=array();\n if(!$con)$con=getConnection();\n $query=\"select distinct t.transcript_id,transcript_name,t.gene_prediction_id from gene_by_annotation g, transcript_by_annotation t \n where gene_name ='$searchTerm' and g.organism_version_id=$organism_version_id and g.transcript_id=t.transcript_id\n and g.organism_version_id=t.organism_version_id\";\n $result = mysql_query($query,$con);\n if($result){\n while($row = mysql_fetch_assoc($result)){\n $hits[]=array('id'=>$row[\"transcript_id\"],\n 'name'=>$row[\"transcript_name\"],\n 'prediction_id'=>$row[\"gene_prediction_id\"]);\n }\n }\n if(count($hits)<=0){ \n $query=\"select distinct transcript_id,transcript_name,gene_prediction_id from transcript_by_annotation \";\n $query .=\" where transcript_name ='$searchTerm' and organism_version_id=$organism_version_id \";\n $result = mysql_query($query,$con);\n if($result){\n while($row = mysql_fetch_assoc($result)){\n $hits[]=array('id'=>$row[\"transcript_id\"],\n 'name'=>$row[\"transcript_name\"],'prediction_id'=>$row[\"gene_prediction_id\"]);\n }\n } \n }\n elseif(count($hits)<=0){ //check if cc founders transcript_name\n $query=\"select distinct t.transcript_id,t.transcript_name,t.gene_prediction_id \n from transcript_by_annotation t,cc_founders_transcripts c\n where c.transcript_name='$searchTerm' and t.organism_version_id=$organism_version_id and c.gene_prediction_id = t.gene_prediction_id \n and t.transcript_name=c.transcript_id \";\n $result = mysql_query($query,$con);\n if($result){ \n while($row = mysql_fetch_assoc($result)){ \n $hits[]=array('id'=>$row[\"transcript_id\"],\n 'name'=>$row[\"transcript_name\"],\n 'prediction_id'=>$row[\"gene_prediction_id\"]);\n }\n }\n }\n elseif(count($hits)<=0){ //check if cc founders gene_id\n $query=\"select distinct t.transcript_id,t.transcript_name,t.gene_prediction_id\"; \n $query.=\" from gene_by_annotation g,cc_founders_genes c,transcript_by_annotation t\n where c.gene_id ='$searchTerm' and c.gene_name=g.gene_name and g.gene_prediction_id=c.gene_prediction_id \n and g.organism_version_id=$organism_version_id and g.transcript_id=t.transcript_id \n and g.organism_version_id=t.organism_version_id \"; \n $result = mysql_query($query,$con);\n if($result){ \n while($row = mysql_fetch_assoc($result)){ \n $hits[]=array('id'=>$row[\"transcript_id\"],\n 'name'=>$row[\"transcript_name\"],\n 'prediction_id'=>$row[\"gene_prediction_id\"]);\n }\n }\n }\n return $hits;\n}", "public function hook_query_index(&$query) {\n/*\t //Your code here\n $userId = CRUDBooster::myId();\n//\t echo $userId;\n\t $isAdmin = CRUDBooster::isSuperadmin();\n\t $storeAssignedtoUser = DB::table('srv_centers')\n ->where('cms_user_id', '=', $userId)\n ->first();\n\t if ($isAdmin) {\n\n\t }else {\n\t $query->where('cms_users.id',$storeAssignedtoUser->cms_user_id);\n\t }\n*/\n\t }", "function replace_original_search_query() {\n\t\tglobal $wp_query;\n\n\t\tif ( ! empty( $this->original_query ) ) {\n\t\t\t$wp_query->set( 's', $this->original_query );\n\t\t}\n\t}", "function culturefeed_search_ui_set_noindex_metatag() {\n\n // Default noindex should be shown.\n $noindex = TRUE;\n\n $query = drupal_get_query_parameters(NULL, array('q'));\n // Start page should be indexed.\n if (empty($query)) {\n $noindex = FALSE;\n }\n else {\n\n // No index is FALSE, if user is filtering on entity type actor.\n if (isset($query['facet']['type'])) {\n\n $facets = $query['facet'];\n if ($query['facet']['type'][0] == 'actor') {\n unset($facets['type']);\n if (isset($query['facet']['category_flandersregion_id'])) {\n if (count($query['facet']['category_flandersregion_id']) <= 1) {\n unset($facets['category_flandersregion_id']);\n }\n }\n }\n\n // If type=actor is the only parameter with flandersregion, set noindex to false.\n if (count($facets) == 0) {\n $noindex = FALSE;\n }\n\n }\n\n // No index is FALSE, if user is filtering on actor type.\n if (isset($query['facet']['category_actortype_id'])) {\n\n $facets = $query['facet'];\n unset($facets['category_actortype_id']);\n unset($facets['type']);\n\n if (isset($query['facet']['category_flandersregion_id'])) {\n if (count($query['facet']['category_flandersregion_id']) <= 1) {\n unset($facets['category_flandersregion_id']);\n }\n }\n\n unset($query['location']);\n unset($query['regId']);\n unset($query['actors']);\n unset($query['facet']);\n\n // If type, flandersregion, location and/or regId was the only extra facet / parameters, set noindex to false.\n if (count($facets) == 0 && count($query) == 0) {\n $noindex = FALSE;\n }\n\n }\n\n // No index is FALSE, if user is filtering on event type.\n elseif (isset($query['facet']['category_eventtype_id'])) {\n\n if (count($query['facet']['category_eventtype_id']) == 1) {\n\n $facets = $query['facet'];\n unset($facets['category_eventtype_id']);\n\n if (isset($query['facet']['category_theme_id'])) {\n if (count($query['facet']['category_theme_id']) <= 1) {\n unset($facets['category_theme_id']);\n }\n }\n\n if (isset($query['facet']['category_flandersregion_id'])) {\n if (count($query['facet']['category_flandersregion_id']) <= 1) {\n unset($facets['category_flandersregion_id']);\n }\n }\n\n unset($query['location']);\n unset($query['regId']);\n unset($query['facet']);\n unset($query['voor-kinderen']);\n\n // If theme_id, flandersregion and/or regId was the only extra facet / parameters, set noindex to false.\n if (count($facets) == 0 && count($query) == 0) {\n $noindex = FALSE;\n }\n\n }\n\n }\n\n // No index is FALSE, if user is filtering on umv category and/or region.\n elseif (isset($query['facet']['category_umv_id'])) {\n\n if (count($query['facet']['category_umv_id']) == 1) {\n\n $facets = $query['facet'];\n unset($facets['category_umv_id']);\n\n if (isset($query['facet']['category_flandersregion_id'])) {\n if (count($query['facet']['category_flandersregion_id']) <= 1) {\n unset($facets['category_flandersregion_id']);\n }\n }\n\n unset($query['location']);\n unset($query['regId']);\n unset($query['facet']);\n\n // If flandersregion or regId was the only extra facet / parameters, set noindex to false.\n if (count($facets) == 0 && count($query) == 0) {\n $noindex = FALSE;\n }\n\n }\n\n }\n\n // No index is FALSE, if user is filtering on datetype today and max 1 flandersregion Id.\n elseif (isset($query['facet']['datetype'])) {\n\n if ($query['facet']['datetype'][0] == 'today') {\n\n $facets = $query['facet'];\n unset($facets['datetype']);\n\n if (isset($query['facet']['category_flandersregion_id'])) {\n\n if(count($query['facet']['category_flandersregion_id']) == 1) {\n unset($facets['category_flandersregion_id']);\n }\n\n }\n \n unset($query['facet']);\n\n // If datetype today was the only filter with max 1 flandersregion Id set noindex to false.\n if (count($facets) == 0 && count($query) == 0) {\n $noindex = FALSE;\n }\n\n }\n\n }\n\n // No index is FALSE, if user is filtering on flandersregion Id.\n elseif (isset($query['facet']['category_flandersregion_id'])) {\n\n if (count($query['facet']['category_flandersregion_id']) == 1) {\n\n $facets = $query['facet'];\n unset($facets['category_flandersregion_id']);\n unset($query['facet']);\n\n // If flandersregion Id was the only filter set noindex to false.\n if (count($facets) == 0 && count($query) == 0) {\n $noindex = FALSE;\n }\n\n }\n\n }\n\n // No index is FALSE, if user is filtering on location or region Id without additional facets.\n elseif (isset($query['regId']) || isset($query['location'])) {\n\n unset($query['location']);\n unset($query['regId']);\n\n // If location or regId was the only filter set noindex to false.\n if (count($query) == 0) {\n $noindex = FALSE;\n }\n\n }\n\n }\n\n // Add the \"noindex, follow\" meta tag if needed.\n if ($noindex) {\n culturefeed_search_set_noindex_metatag();\n }\n\n}", "private function sql_resWiHits()\n {\n // Count hits\n $bool_count = true;\n\n // Get query parts\n $select = $this->sql_select( $bool_count );\n $from = $this->sql_from();\n $where = $this->sql_whereWiHits();\n $groupBy = $this->sql_groupBy();\n $orderBy = $this->sql_orderBy();\n $limit = $this->sql_limit();\n\n// $query = $GLOBALS['TYPO3_DB']->SELECTquery\n// (\n// $select,\n// $from,\n// $where,\n// $groupBy,\n// $orderBy,\n// $limit\n// );\n//var_dump( __METHOD__, __LINE__, $query );\n // Execute query\n $arr_return = $this->pObj->objSqlFun->exec_SELECTquery\n (\n $select, $from, $where, $groupBy, $orderBy, $limit\n );\n // Execute query\n\n return $arr_return;\n }", "abstract function query( $p_filter_input );", "function EV_posts_modify_query($query) {\n\t\t// to get squirrely.\n\t\tif( ( preg_match('/edit.php/i', $_SERVER['REQUEST_URI']) ) && !isset($_GET['page']) ) {\n\t\t\tif( isset( $query->query_vars['showpostsoverride'] ) ) {\n\t\t\t\t// We have a bit of work to do to undo some of the things\n\t\t\t\t// that the edit.php page does. First, get rid of the hard-coded\n\t\t\t\t// 15 posts.\n\t\t\t\t$query->query = EV_url_remove_parameter( $query->query, 'showposts' );\n\t\t\t\tif( isset( $query->query_vars['showposts'] ) ) {\n\t\t\t\t\tunset( $query->query_vars['showposts'] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Our override variable is a bit tricky. We can't set showposts because\n\t\t\t\t// edit.php does and overwrites the value. We can't set posts_per_page\n\t\t\t\t// because it will be overwritten by the admin.php file. So, create a new\n\t\t\t\t// variable and set it, then substitute our value for the showposts value.\n\t\t\t\t$query->query_vars['showposts'] = $query->query_vars['showpostsoverride'];\n\t\t\t\t$query->query_vars['nopaging'] = false;\n\t\t\t\t$query->is_archive = $query->is_search = false;\n\t\t\t}\n\n\t\t\t// Just in case, get rid of any trailing ampersands to make the \n\t\t\t// query string pretty.\n\t\t\t$query->query = rtrim( $query->query, '&' );\n\n\t\t} else {\n\t\t\treturn $text;\n\t\t}\n\t}", "function search_vizitki()\n{\n\tglobal $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;\n\n\t// CONSTRUCT QUERY\n $sql = \"\n SELECT\n se_vizitkientries.vizitkientry_id,\n se_vizitkientries.vizitkientry_title,\n se_vizitkientries.vizitkientry_body,\n se_users.user_id,\n se_users.user_username,\n se_users.user_photo,\n se_users.user_fname,\n se_users.user_lname\n FROM\n se_vizitkientries,\n se_users,\n se_levels\n WHERE\n se_vizitkientries.vizitkientry_user_id=se_users.user_id &&\n se_users.user_level_id=se_levels.level_id &&\n (\n se_vizitkientries.vizitkientry_search='1' ||\n se_levels.level_vizitki_search='0'\n ) \n \";\n \n $sql .= \" && MATCH (`vizitkientry_title`, `vizitkientry_body`) AGAINST ('{$search_text}' IN BOOLEAN MODE)\";\n \n /*\n $sql .= \" && (\n vizitkientry_title LIKE '%$search_text%' ||\n vizitkientry_body LIKE '%$search_text%'\n )\n \";\n */\n \n\t// GET TOTAL ENTRIES\n $sql2 = $sql . \" LIMIT 201\";\n $resource = $database->database_query($sql2);\n\t$total_entries = $database->database_num_rows($resource);\n \n\t// IF NOT TOTAL ONLY\n\tif( $t==\"vizitki\" )\n {\n\t // MAKE vizitki PAGES\n\t $start = ($p - 1) * $results_per_page;\n\t $limit = $results_per_page+1;\n \n\t // SEARCH vizitkiS\n $sql3 = $sql . \" ORDER BY vizitkientry_id DESC LIMIT {$start}, {$limit}\";\n $resource = $database->database_query($sql3);\n \n\t while( $vizitkientry_info=$database->database_fetch_assoc($resource) )\n {\n\t // CREATE AN OBJECT FOR AUTHOR\n\t $profile = new se_user();\n\t $profile->user_info['user_id'] = $vizitkientry_info['user_id'];\n\t $profile->user_info['user_username'] = $vizitkientry_info['user_username'];\n\t $profile->user_info['user_photo'] = $vizitkientry_info['user_photo'];\n\t $profile->user_info['user_fname'] = $vizitkientry_info['user_fname'];\n\t $profile->user_info['user_lname'] = $vizitkientry_info['user_lname'];\n\t $profile->user_displayname();\n \n\t // IF EMPTY TITLE\n\t if( !trim($vizitkientry_info['vizitkientry_title']) )\n $vizitkientry_info['vizitkientry_title'] = SE_Language::get(589);\n \n $vizitkientry_info['vizitkientry_body'] = cleanHTML($vizitkientry_info['vizitkientry_body'], '');\n \n\t // IF BODY IS LONG\n\t if( strlen($vizitkientry_info['vizitkientry_body'])>150 )\n $vizitkientry_info['vizitkientry_body'] = substr($vizitkientry_info['vizitkientry_body'], 0, 147).\"...\";\n \n $result_url = $url->url_create('vizitki_entry', $vizitkientry_info['user_username'], $vizitkientry_info['vizitkientry_id']);\n $result_name = 1500118;\n $result_desc = 1500119;\n \n\t $results[] = array(\n 'result_url' => $result_url,\n\t\t\t\t'result_icon' => './images/icons/vizitki_vizitki48.gif',\n\t\t\t\t'result_name' => $result_name,\n\t\t\t\t'result_name_1' => $vizitkientry_info['vizitkientry_title'],\n\t\t\t\t'result_desc' => $result_desc,\n\t\t\t\t'result_desc_1' => $url->url_create('profile', $vizitkientry_info['user_username']),\n\t\t\t\t'result_desc_2' => $profile->user_displayname,\n\t\t\t\t'result_desc_3' => $vizitkientry_info['vizitkientry_body']\n );\n\t }\n \n\t // SET TOTAL RESULTS\n\t $total_results = $total_entries;\n\t}\n\n\t// SET ARRAY VALUES\n\tSE_Language::_preload_multi(1500118, 1500119, 1500120);\n\tif( $total_albums>200 )\n $total_albums = \"200+\";\n \n\t$search_objects[] = array(\n 'search_type' => 'vizitki',\n 'search_lang' => 1500120,\n 'search_total' => $total_entries\n );\n}", "function opensky_redirect_to_search_view ($pid) {\n // dsm('opensky_redirect_to_search_view redirecting to search: '. $pid);\n $options = array('query' => array(\n 'type'=>'dismax',\n 'collection'=>$pid\n ));\n drupal_goto('/islandora/search/',$options);\n}", "public function apply($query);", "abstract public function similaritySearch(string $query, int $k = 4, array $additionalArguments = []): array;", "function the_search_query()\n {\n }", "public function hook_query(&$query)\n {\n \n }", "public function hook_query(&$query)\n {\n \n }", "function childtheme_override_search_loop() {\r\n\tglobal $post;\r\n\tglobal $wp_query;\r\n\t$post_type = false;\r\n\r\n\t$rendered_terms = array();\r\n\t$search = urldecode( $_GET['s'] );\r\n\t$search = sanitize_text_field( $search );\r\n\r\n\tif ( ! empty( $_GET['filter'] ) ) {\r\n\t\t$post_type = urldecode( $_GET['filter'] );\r\n\t\t$post_type = sanitize_key( $post_type );\r\n\t}\r\n\r\n\tif ( $post_type ) {\r\n\t\t$post_type_object = get_post_type_object($post_type);\r\n\t\t$categories = array ( $post_type => $post_type_object->labels->name );\r\n\t} else {\r\n\t\t$categories = array(\r\n\t\t\t'destinations' => __('Destination Guides','indagare'), // destination taxonomy\r\n\t\t\t'hotel' => __('Hotels','indagare'),\r\n\t\t\t'restaurant' => __('Restaurants','indagare'),\r\n\t\t\t'shop' => __('Shops','indagare'),\r\n\t\t\t'activity' => __('Activities','indagare'),\r\n\t\t\t'article' => __('Articles','indagare'),\r\n\t\t\t'itinerary' => __('Itineraries','indagare'),\r\n\t\t\t'library' => __('Libraries','indagare'),\r\n\t\t\t'offer' => __('Offers','indagare'),\r\n\t\t\t'insidertrip' => __('Insider Trips','indagare'),\r\n\t\t);\r\n\t}\r\n\r\n\t$searchresults = array();\r\n\t$loaded_pid = array();\r\n\r\n\t$homeid = get_option('page_on_front');\r\n\r\n\twhile ( have_posts() ) {\r\n\t\tthe_post();\r\n\t\t// remove home from results\r\n\t\t$postid = get_the_ID();\r\n\t\tif ( $homeid !== $postid ) {\r\n\t\t\t$termid = false;\r\n\t\t\tif($postid == -1) {\r\n\t\t\t\t$postid = 'term:'.$post->term_id;\r\n\t\t\t\t$termid = true;\r\n\t\t\t}\r\n\t\t\tif ( !in_array( $postid, $loaded_pid ) ) {\r\n\t\t\t\t$loaded_pid[] = $postid;\r\n\t\t\t\tif($termid) {\r\n\t\t\t\t\t$searchresults[$post->post_type][] = $post;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$sort = $post->post_title . ' '. $post->ID;\r\n\t\t\t\t\tif($post->post_type == 'article') {\r\n\t\t\t\t\t\t$sort = $post->post_date . ' '. $post->ID;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$searchresults[$post->post_type][$sort] = $post;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tforeach ($categories as $group => $t) {\r\n\r\n\t\t/* We'll also perform a check to see if there are results for a post type. If there isn't, we'll omit it from the results */\r\n\r\n\t\tif (!array_key_exists($group, $searchresults))\r\n\t\t\tcontinue;\r\n\r\n\t\tif ( $group !== 'destinations' ) {\r\n\t\t\techo '<section class=\"related-articles contain results\">'.\"\\n\";\r\n\t\t}\r\n\r\n\t\techo '<div class=\"header divider\">';\r\n\r\n\t\tif ( $group == 'destinations' ) {\r\n\t\t\techo '<h2>'.__('Destination Guides','indagare').'</h2>'.\"\\n\";\r\n\t\t} else {\r\n\t\t\techo '<h2>'.$t.'</h2>'.\"\\n\";\r\n\t\t}\r\n\r\n\t\tif ( $group !== 'destinations' ) {\r\n\t\t\tif ( empty( $_GET['filter'] ) ) {\r\n\t\t\t\tif ( count( $searchresults[$group] ) > INDG_SEARCHPAGE_SECTIONCOUNT ) {\r\n\t\t\t\t\techo '<p class=\"view-more\"><a href=\"/?s='.urlencode( $search ).'&filter='.$group.'\">'.__('View All Results','indagare').'</a></p>'.\"\\n\";\r\n\t\t\t\t\tif($group == 'article') {\r\n\t\t\t\t\t\tksort($searchresults[$group]);\r\n\t\t\t\t\t\t$newarray = array_slice($searchresults[$group],-8,8,true);\r\n\t\t\t\t\t\trsort($newarray);\r\n\t\t\t\t\t\t$searchresults[$group] = $newarray;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$keys = array_rand($searchresults[$group],INDG_SEARCHPAGE_SECTIONCOUNT);\r\n\t\t\t\t\t\t$newarray = array();\r\n\t\t\t\t\t\tforeach($keys as $k) {\r\n\t\t\t\t\t\t\t$newarray[$k] = $searchresults[$group][$k];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$searchresults[$group] = $newarray;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if ($group == 'article') {\r\n\t\t\t\tksort($searchresults[$group]);\r\n\t\t\t\trsort($searchresults[$group]);\r\n\t\t\t}\r\n\t\t\tksort($searchresults[$group]);\r\n\t\t}\r\n\r\n\t\techo '</div>'.\"\\n\";\r\n\r\n\t\tif ( $group == 'destinations' ) {\r\n\t\t\techo '<section class=\"all-destinations contain\" location=\"AAAA\">'.\"\\n\";\r\n\t\t}\r\n\r\n\t\t/* Ok, we now need to spit out any post data we want to display in our results */\r\n\r\n\t\t$destlist = array();\r\n\t\t$destcount = 0;\r\n\t\t$destskip = 0;\r\n\r\n\t\tforeach ($searchresults[$group] as $post) {\r\n\t\t\tif ( $group == 'destinations' && empty( $_GET['filter'] ) ) {\r\n\r\n\t\t\t\t$destination = get_term_by( 'name', $post->post_title, 'destinations' );\r\n\t\t\t\t$destinationid = $destination->term_id;\r\n\t\t\t\t$destinationstree = destinationstaxtree($destination->term_id);\r\n\t\t\t\t$dest = $destinationstree['dest'];\r\n\t\t\t\t$reg = $destinationstree['reg'];\r\n\t\t\t\t$top = $destinationstree['top'];\r\n\t\t\t\t$depth = $destinationstree['depth'];\r\n\r\n\t\t\t\tif ( $depth!==3 && $destcount > 0 && !in_array($destinationid,$destlist) ) {\r\n\t\t\t\t\t$destlist[] = $destinationid;\r\n\t\t\t\t\t$destskip = 0;\r\n\t\t\t\t} else if ( $depth!==3 && $destcount == 0 ) {\r\n\t\t\t\t\t$destlist[] = $destinationid;\r\n\t\t\t\t\t$destskip = 0;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$destskip = 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$destcount++;\r\n\r\n//\t\t\t\techo $depth;\r\n\r\n\t\t\t\tif ( $depth == 1 ) {\r\n\t\t\t\t\t$destinations = get_terms( 'destinations', array( 'child_of' => $reg->term_id , 'parent' => $reg->term_id, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => false) );\r\n\t\t\t\t} else if ( $depth == 2 ) {\r\n\t\t\t\t\t$destinations = get_terms( 'destinations', array( 'include' => array($destination->term_id), 'hide_empty' => false) );\r\n\t\t\t\t}\r\n\r\n//\t\t\t\t\t\tif ( $destinations && $depth !== 3 && $destskip == 0 ) {\r\n\t\t\t\tif ( $destinations && $destskip == 0 ) {\r\n\t\t\t\t\tforeach ( $destinations as $term ) {\r\n\t\t\t\t\t\tif(!in_array($term->term_id, $rendered_terms)) {\r\n\t\t\t\t\t\t\t$rendered_terms[] = $term->term_id;\r\n\t\t\t\t\t\t\tprint render_destination_term($top, $reg, $term);\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} else {\r\n\t\t\t\techo '<article id=\"post-'.get_the_ID().'\" ';\r\n\t\t\t\tpost_class('contain');\r\n\t\t\t\techo '>';\r\n\t\t\t\tthematic_postheader();\r\n\t\t\t\techo '<div class=\"entry-content\">';\r\n\t\t\t\tthematic_content();\r\n\t\t\t\techo '</div><!-- .entry-content -->';\r\n\t\t\t\tthematic_postfooter();\r\n\t\t\t\techo '</article><!-- #post -->';\r\n\t\t\t}\r\n\t\t}\r\n\t\techo '</section>'.\"\\n\";\r\n\r\n\t}\r\n\r\n}", "function applyFinal($q, $settings, $trail_mlids);", "public function iaqScore();", "function five_get_ancestors(){\n\t\t\n\t\tglobal $wpdb;\n\t\t$result = $wpdb->get_results(\"SELECT ID, post_title, guid FROM $wpdb->posts WHERE post_type = 'page' AND post_parent = 0 AND post_status = 'publish'\");\n\t\treturn $result;\n\t\t}", "public function search($params)\n {\n\n $status = \\Yii::$app->requestedAction->id == 'index' ? 0 : 1;\n $status = isset($params['status']) && $params['status'] === 0 ? 0: $status;\n\n $query = Agency::find()\n ->where([\n 'agency.status'=>$status,\n ]);\n\n $query->joinWith('admin');\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => 10,\n ],\n 'sort' => [\n 'defaultOrder' => [\n 'create_at' => SORT_DESC,\n ]\n ],\n ]);\n\n// $dataProvider->setSort([\n// 'attributes' => [\n// /* 其它字段不要动 */\n// /* 下面这段是加入的 */\n// /*=============*/\n//// 'superior_name' => [\n//// 'asc' => ['superior.sup_id' => SORT_ASC],\n//// 'desc' => ['superior.sup_id' => SORT_DESC],\n//// 'label' => 'sup_id'\n//// ],\n// /*=============*/\n// ]\n// ]);\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'id' => $this->id,\n 'parent_id' => $this->parent_id,\n\n\n ]);\n\n\n $this->search_type ==1 && strlen($this->search_keywords)>0 && $query->andFilterWhere(['in', 'agency.id', $this->searchIds($this->search_keywords)]);\n $this->search_type ==2 && strlen($this->search_keywords)>0 && $query->andFilterWhere(['in', 'agency.parent_id', $this->searchParents($this->search_keywords)]);\n $this->search_type ==3 && strlen($this->search_keywords)>0 && $query->andFilterWhere(['in', 'agency.id', $this->searchIds($this->search_keywords,'code')]);\n\n isset($params['status']) && $params['status'] === 0 && $query->orFilterWhere(['in','agency.id',$this->seachIDS($this->search_keywords)]);\n return $dataProvider;\n }", "public function hook_query(&$query) {\n\n\t\t }", "public function hook_query(&$query) {\n\n\t\t }", "public function hook_query(&$query) {\n\n\t\t }", "public function hook_query(&$query) {\n\n\t\t }", "abstract public function score();", "public function getAuditData($setype,$date,$treeid){\n \n \n $ReturnData = array();\n $clause = \" deleted='0' AND created_by!='2' AND set_type = '$setype' AND date_of_audit BETWEEN \".$date;\n $query = \"SELECT * FROM actualtarget_audit_view WHERE \".$clause;\n $totaldiv = 0;\n $totScore = 0;\n $rowdata = $this->select($query);\n if( !empty($rowdata) ) {\n \n foreach( $rowdata as $row ) {\n $nm=\"\";\n $tree_division_id_arr = ($row->tree_division_id != \"\") ? explode(\"-\", $row->tree_division_id) : array(); \n for ($i = 0; $i < count($tree_division_id_arr); $i++) {\n if ($tree_division_id_arr[$i] == \"\")\n continue;\n if (is_numeric($tree_division_id_arr[$i])) { \n $nm.= $tree_division_id_arr[$i].\"-\";\n }\n }\n $score = $row->avg_mark ? $row->avg_mark : 0;\n $asd=substr($nm,'0','-1');\n $exp=explode(\"-\",$asd);\n @$newval = $exp[3]; \n if(is_array($treeid)) {\n if(in_array($newval, $treeid)) {\n $totaldiv += 1;\n $totScore = $totScore + $score;\n } } else {\n if($newval == $treeid) {\n $totaldiv += 1;\n $totScore = $totScore + $score;\n } \n }\n }\n }\n if($totScore != 0 || $totaldiv != 0){\n $sScore = $totScore/$totaldiv;\n }else{ $sScore = 0; }\n \n \n $ReturnData[\"totaldiv\"] = $totaldiv;\n $ReturnData[\"score\"]= $sScore;\n return $ReturnData; \n }", "function customtheme_search_filter($query) {\n\t\tif (isset($_GET['s']) && empty($_GET['s']) && $query->is_main_query()){\n\t\t\t$query->is_search = true;\n\t\t\t$query->is_home = false;\n\t\t}\n\t\treturn $query;\n\t}", "function view_score_bound(PaperInfo $prow, ReviewInfo $rrow = null) {\n // Returns the maximum view_score for an invisible review\n // field. Values are:\n // VIEWSCORE_ADMINONLY admin can view\n // VIEWSCORE_REVIEWERONLY ... and review author can view\n // VIEWSCORE_PC ... and any PC can view\n // VIEWSCORE_REVIEWER ... and external reviewers can view\n // VIEWSCORE_AUTHORDEC ... and authors can view when decisions visible\n // VIEWSCORE_AUTHOR ... and authors can view\n // So returning -3 means all scores are visible.\n // Deadlines are not considered.\n assert(!!$rrow);\n $rights = $this->rights($prow);\n if ($rights->can_administer) {\n return VIEWSCORE_ADMINONLY - 1;\n } else if ($rrow ? $this->is_owned_review($rrow) : $rights->allow_review) {\n return VIEWSCORE_REVIEWERONLY - 1;\n } else if (!$this->can_view_review($prow, $rrow)) {\n return VIEWSCORE_EMPTYBOUND;\n } else if ($rights->act_author_view\n && $prow->outcome !== 0\n && $rights->can_view_decision) {\n return VIEWSCORE_AUTHORDEC - 1;\n } else if ($rights->act_author_view) {\n return VIEWSCORE_AUTHOR - 1;\n } else if ($rights->allow_pc) {\n return VIEWSCORE_PC - 1;\n } else {\n return VIEWSCORE_REVIEWER - 1;\n }\n }", "protected function getViewsQuery()\n {\n return $this->viewsQuery;\n }", "protected function _getQuery()\n {\n $sArticleTable = $this->_getViewName('oxarticles');\n $sCategoryTable = $this->_getViewName('oxobject2category');\n $sJoinTable = $this->_getViewName('ettm_project2article');\n $oConfig = \\OxidEsales\\Eshop\\Core\\Registry::getConfig();\n $sContainerName = $oConfig->getRequestParameter('cmpid');\n $sProjectId = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->quote($oConfig->getRequestParameter('projectid'));\n\n // Has target langs selected?\n $sJoins = '';\n if ($oConfig->getRequestParameter('targetlangs') && 1 !== intval($oConfig->getRequestParameter('nofilter'))) {\n $aTargetLangIds = explode(',', $oConfig->getRequestParameter('targetlangs'));\n foreach ($aTargetLangIds as $iTargetLangId) {\n // Get view and create join statement\n $sTableName = getViewName('oxarticles', $iTargetLangId);\n $sJoins .= \"JOIN $sTableName ON $sTableName.OXID = $sArticleTable.OXID AND $sTableName.OXTITLE = ''\";\n }\n }\n\n if ('container1' === $sContainerName) {\n $sAddtionalJoint = '';\n if (\\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('catid')) {\n // A category is selected\n $sCatId = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->quote(\n \\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('catid')\n );\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID AND $sJoinTable.PROJECT_ID = $sProjectId\n INNER JOIN $sCategoryTable\n ON $sCategoryTable.OXOBJECTID = $sArticleTable.OXID AND $sCategoryTable.OXCATNID = $sCatId\n $sJoins\n WHERE $sJoinTable.OXID IS NULL\";\n } else {\n // No category is selected.\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID AND $sJoinTable.PROJECT_ID = $sProjectId\n $sJoins\n WHERE $sJoinTable.OXID IS NULL\";\n }\n\n\n\n } else {\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID\n WHERE $sJoinTable.OXID IS NOT NULL AND $sJoinTable.PROJECT_ID = $sProjectId\";\n }\n\n return $sQAdd;\n }", "function acf_location_rule_match_category_ancestor($match, $rule, $options) {\n $terms = 0;\n if (array_key_exists('post_taxonomy', $options)){\n $terms = $options['post_taxonomy'];\n }\n $data = acf_decode_taxonomy_term($rule['value']);\n $term = get_term_by('slug', $data['term'], $data['taxonomy']);\n if (!$term && is_numeric($data['term'])) {\n $term = get_term_by('id', $data['term'], $data['taxonomy']);\n }\n // this is where it's different than ACf\n // get terms so we can look at the parents\n if (is_array($terms)) {\n foreach ($terms as $index => $term_id) {\n $terms[$index] = get_term_by('id', intval($term_id), $term->taxonomy);\n }\n }\n if (!is_array($terms) && $options['post_id']) {\n $terms = wp_get_post_terms(intval($options['post_id']), $term->taxonomy);\n }\n if (!is_array($terms)) {\n $terms = array($terms);\n }\n $terms = array_filter($terms);\n $match = false;\n // collect a list of ancestors\n $ancestors = array();\n if (count($terms)) {\n foreach ($terms as $term_to_check) {\n $ancestors = array_merge(get_ancestors($term_to_check->term_id, $term->taxonomy));\n } // end foreach terms\n } // end if\n // see if the rule matches any term ancetor\n if ($term && in_array($term->term_id, $ancestors)) {\n $match = true;\n }\n\n if ($rule['operator'] == '!=') {\n // reverse the result\n $match = !$match;\n }\n return $match;\n}", "protected function modelQueryBuilder()\n {\n $queryTerm = $this->queryTerm();\n\n return Occasion::\n oldest('rank')->\n\n keywordBy($queryTerm['keyword_by'],\n $queryTerm['keyword'])->\n active($queryTerm['active']);\n }", "protected function addSearchClauses(\n SearchableSubquery $subquery,\n ColumnCollection $columns,\n array $words,\n $threshold\n ) {\n $whereBindings = $this->searchSelect($subquery, $columns, $words, $threshold);\n\n // For morphOne/morphMany support we need to port the bindings from JoinClauses.\n $joinBindings = array_flatten(array_pluck((array)$subquery->getQuery()->joins, 'bindings'));\n\n $this->addBinding($joinBindings, 'select');\n\n // Developer may want to skip the score threshold filtering by passing zero\n // value as threshold in order to simply order full result by relevance.\n // Otherwise we are going to add where clauses for speed improvement.\n if ($threshold > 0) {\n $this->searchWhere($subquery, $columns, $words, $whereBindings);\n }\n\n $this->query->where('relevance', '>=', new Expression($threshold));\n\n $this->query->orders = array_merge(\n [['column' => 'relevance', 'direction' => 'desc']],\n (array) $this->query->orders\n );\n }", "function viewSearchedJobs() {\n connectDatabase();\n\t\n $pk = mysql_real_escape_string($_GET['pk']);\n if (isset($_GET['start']))\n $start = $_GET['start'];\n else\n $start = 0;\n \n \n $result = queryDatabase(\"SELECT total, fk_job\n FROM search\n WHERE pk = $pk\");\n\n $row = mysql_fetch_object($result);\n \n $total = $row->total;\n \n if ($total > 0) {\n $results = (($start + 15) > $total) ? $total: ($start + 15);\n \n echo \"<div class=\\\"good\\\">Results \" . ($start + 1) . \"-$results of $total job(s) found</div><br />\";\n } else\n echo \"<div class=\\\"bad\\\">Your search did not match any jobs in our database</div><br />\";\n\n // fk_job parse\n if ($row->fk_job <> 'EMPTY') {\n $row->fk_job = explode(' ', $row->fk_job);\n \n $row->fk_job = array_slice($row->fk_job, $start, 15);\n \n if (count($row->fk_job) > 1) {\n $default = 1;\n \n foreach ($row->fk_job as $value) {\n if (!empty($value)) {\n if ($default == 1)\n $job_regexp = '[[:<:]]' . $value . '[[:>:]]';\n else\n $job_regexp .= '|[[:<:]]' . $value . '[[:>:]]';\n\n $default++;\n }\n }\n } elseif (count($row->fk_job) == 1)\n $job_regexp = '[[:<:]]' . $row->fk_job[0] . '[[:>:]]';\n\n $result = queryDatabase(\"SELECT pk, title, inserted, fk_location\n FROM job\n WHERE pk REGEXP '$job_regexp'\n ORDER BY pk DESC\");\n \n echo '<table cellspacing=\"0\" cellpadding=\"0\">';\n\n $default = 1;\n \n while ($row = mysql_fetch_object($result)) {\n $location = explodeFK($row->fk_location, 'location', 1);\n $row->inserted = substr($row->inserted, 5, 2) . \"/\" . substr($row->inserted, 8, 2) . \"/\" . substr($row->inserted, 0, 4);\n\n $backgroundColor = ($default%2) ? '#FFFACD': '#FFFFFF';\n \n $row->title = wordwrap($row->title, 30, \"\\n\", true);\n \n echo <<< END\n<tr>\n<td style=\"background-color:$backgroundColor; height:77px; text-align:left; vertical-align:top; width:280px;\">\n<strong>Title:</strong><br />\n<a href=\"javascript:popUp('detail.php?pk=$row->pk&apply=1')\">$row->title</a>\n</td>\n<td style=\"background-color:$backgroundColor; text-align:left; vertical-align:top; width:100px;\">\n<strong>Inserted:</strong><br />\n$row->inserted\n</td>\n<td style=\"background-color:$backgroundColor; text-align:left; vertical-align:top; width:245px;\">\n<strong>Location:</strong><br />\n$location\n</td>\n</tr>\nEND;\n\n $default++;\n }\n\n echo '</table>';\n \n if (($start - 15) >= 0) {\n $previous = $start - 15;\n echo \"<a href=\\\"./browse.php?pk=$pk&start=$previous\\\" alt=\\\"\\\">Previous 15 Jobs</a>&nbsp;&nbsp;&nbsp;\";\n }\n\n if (($start + 15) < $total) {\n $start += 15;\n $next = (($start + 15) <= $total) ? 15: ($total - $start);\n echo \"<a href=\\\"./browse.php?pk=$pk&start=$start\\\" alt=\\\"\\\">Next $next Job(s)</a>\";\n }\n \n }\n}", "public function searchAction() {\n $search = $this->getParam('search');\n\n\n $queryBuilder = new Application_Util_QueryBuilder($this->getLogger());\n\n $queryBuilderInput = array(\n 'searchtype' => 'simple',\n 'start' => '0',\n 'rows' => '10',\n 'sortOrder' => 'desc',\n 'sortField'=> 'score',\n 'docId' => null,\n 'query' => $search,\n 'author' => '',\n 'modifier' => 'contains_all',\n 'title' => '',\n 'titlemodifier' => 'contains_all',\n 'persons' => '',\n 'personsmodifier' => 'contains_all',\n 'referee' => '',\n 'refereemodifier' => 'contains_all',\n 'abstract' => '',\n 'abstractmodifier' => 'contains_all',\n 'fulltext' => '',\n 'fulltextmodifier' => 'contains_all',\n 'year' => '',\n 'yearmodifier' => 'contains_all',\n 'author_facetfq' => '',\n 'languagefq' => '',\n 'yearfq' => '',\n 'doctypefq' => '',\n 'has_fulltextfq' => '',\n 'belongs_to_bibliographyfq' => '',\n 'subjectfq' => '',\n 'institutefq' => ''\n );\n\n\n $query = $queryBuilder->createSearchQuery($queryBuilderInput, $this->getLogger());\n\n $result = array();\n\n $searcher = new Opus_SolrSearch_Searcher();\n try {\n $result = $searcher->search($query);\n }\n catch (Opus_SolrSearch_Exception $ex) {\n var_dump($ex);\n }\n\n $matches = $result->getReturnedMatches();\n\n $this->view->total = $result->getAllMatchesCount();\n $this->view->matches = $matches;\n }", "function apachesolr_term_reference_indexing_callback($node, $field_name, $index_key, array $field_info) {\n // Keep ancestors cached\n $ancestors = &drupal_static(__FUNCTION__, array());\n\n $fields = array();\n $vocab_names = array();\n if (!empty($node->{$field_name}) && function_exists('taxonomy_get_parents_all')) {\n $field = $node->$field_name;\n list($lang, $items) = each($field);\n foreach ($items as $item) {\n // Triple indexing of tids lets us do efficient searches (on tid)\n // and do accurate per field or per-vocabulary faceting.\n\n // By including the ancestors to a term in the index we make\n // sure that searches for general categories match specific\n // categories, e.g. Fruit -> apple, a search for fruit will find\n // content categorized with apple.\n if (!isset($ancestors[$item['tid']])) {\n $ancestors[$item['tid']] = taxonomy_get_parents_all($item['tid']);\n }\n foreach ($ancestors[$item['tid']] as $ancestor) {\n // Index parent term against the field. Note that this happens\n // regardless of whether the facet is set to show as a hierarchy or not.\n // We would need a separate field if we were to index terms without any\n // hierarchy at all.\n // If the term is singular, then we cannot add another value to the\n // document as the field is single\n if ($field_info['multiple']) {\n $fields[] = array(\n 'key' => $index_key,\n 'value' => $ancestor->tid,\n );\n }\n $fields[] = array(\n 'key' => 'tid',\n 'value' => $ancestor->tid,\n );\n $fields[] = array(\n 'key' => 'im_vid_' . $ancestor->vid,\n 'value' => $ancestor->tid,\n );\n $name = apachesolr_clean_text($ancestor->name);\n $vocab_names[$ancestor->vid][] = $name;\n // We index each name as a string for cross-site faceting\n // using the vocab name rather than vid in field construction .\n $fields[] = array(\n 'key' => 'sm_vid_' . apachesolr_vocab_name($ancestor->vid),\n 'value' => $name,\n );\n }\n }\n // Index the term names into a text field for MLT queries and keyword searching.\n foreach ($vocab_names as $vid => $names) {\n $fields[] = array(\n 'key' => 'tm_vid_' . $vid . '_names',\n 'value' => implode(' ', $names),\n );\n }\n }\n return $fields;\n}", "public function executeSearch(sfWebRequest $request) {\n \t// look into PHP buffering to facilitate with GATC setting before redirecting to exact match\n \t$this->getResponse()->setSlot('body_class','search');\n \t$this->query = trim($request->getParameter('q'));\n \tif(!in_array($this->query, sfConfig::get('app_search_default_queries'))) {\n \t\t$SA = new SearchAgent($this->query);\n \t\t// if exact match is found redirect to the part's route\n \t\tif($route = $SA->search()) $this->redirect($route);\n \t\telse { // otherwise, see if similar parts exist for the user's query\n \t\t\tif($this->similar_parts = $SA->getSimilarParts()) {\n\t \t\t\t$this->count = $this->similar_parts[0]['count'];\n\t \t\t\t$this->search_routes = $SA->getSearchRoutes();\n\t \t\t\t$this->search_routes_class = $this->getSearchRoutesClass(count($this->search_routes));\n\t \t\t\t$this->num_serps = $this->count <= sfConfig::get('app_search_pagination_max_items') ? 1 : ceil($this->count / sfConfig::get('app_search_pagination_max_items'));\n\t \t\t\t$item_count = count($this->similar_parts);\n\t \t\t\t$rem = $item_count % 2 == 0 ? 2 : 1;\n\t \t\t\t$this->bottom_idx = $item_count - $rem;\n\t \t\t\t$this->getResponse()->setTitle(\"Product Search: '{$this->query}'\");\n\t \t\t\treturn sfView::SUCCESS;\n \t\t\t} else {\n \t\t\t\t// there is nothing in the database like the user's query\n \t\t\t\t$this->getResponse()->setTitle(\"Product Search: '{$this->query}'\");\n \t\t\t\treturn sfView::ALERT;\n \t\t\t}\n \t\t}\n \t} else {\n \t\t// user didn't enter anything into search box\n \t\t$this->getResponse()->setTitle('Product Search: Missing Query Parameter');\n \t\treturn sfView::ALERT;\n \t}\n }", "public function applyDefaultSearchQuery(\\yii\\data\\ActiveDataProvider &$dataProvider);", "public function queryRelatedSearch($query){\n\t\t\treturn $this->query('RelatedSearch',$query);\n\t\t}", "private function ts_getDisplayHits()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Short var\n $currFilterWrap = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'wrap.' ];\n\n // Get TS value\n $display_hits = $currFilterWrap[ 'item.' ][ 'display_hits' ];\n\n // RETURN TS value\n return $display_hits;\n }", "public function tweak_search( $query ) {\n\n\t\tif( ! is_search() )\n\t\t\treturn $query;\n\n\t\tif( ! is_object( $query ) )\n\t\t\treturn $query;\n\n\t\tif( $query->is_main_query() && $query->is_search() && isset( $_GET['cgc-search'] ) ) {\n\n\t\t\t$search_params = $_GET;\n\n\t\t\tforeach( $search_params as $key => $param ) {\n\t\t\t\tif( 'cgc-search' != $key && 's_type' != $key ) {\n\t\t\t\t\tif( is_string( $param ) ) {\n\t\t\t\t\t\tif( substr( $key, 0, 2 ) == 's_' )\n\t\t\t\t\t\t\t$key = substr( $key, 2, strlen( $key ) );\n\t\t\t\t\t\t$query->set( $key, rawurldecode( $param ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$query->set( $key, $param );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//echo '<pre>'; print_r( $query ); echo '</pre>'; exit;\n\n\t\t}\n\n\t}", "function searchQuery($client, $textoAbuscar)\n {\n echo '<h2>SOLR: This is the result of your search in the Solr database with this text: \"'.$textoAbuscar.'\"</h2><br />';\n // get a select query instance\n $query = $client->createSelect();\n\n // get the facetset component\n $facetSet = $query->getFacetSet();\n\n // create a facet field instance and set options\n $facetSet->createFacetField('Rts')->setField('retweet_count');\n\n // set a query (all prices starting from 12)\n //$query->setQuery('price:[12 TO *]');\n $query->setQuery('full_text: *'.$textoAbuscar.'*');\n\n // set start and rows param (comparable to SQL limit) using fluent interface\n $query->setStart(2)->setRows(20);\n\n // set fields to fetch (this overrides the default setting 'all fields')\n //$query->setFields(array('ID','username','favorite_count', 'description','full_text'));\n\n // sort the results by price ascending\n //$query->addSort('price', $query::SORT_ASC);\n $query->addSort('favorite_count', $query::SORT_ASC);\n\n // this executes the query and returns the result\n $resultset = $client->select($query);\n\n // display the total number of documents found by solr\n echo 'NumFound: '.$resultset->getNumFound();\n\n // show documents using the resultset iterator\n foreach ($resultset as $document) {\n\n echo '<hr/><table>';\n\n // the documents are also iterable, to get all fields\n foreach ($document as $field => $value) {\n // this converts multivalue fields to a comma-separated string\n if (is_array($value)) {\n $value = implode(', ', $value);\n }\n\n echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';\n }\n\n echo '</table>';\n }\n\n // display facet counts\n echo '<hr/>Facet counts for field \"retweet_count\":<br/>';\n $facet = $resultset->getFacetSet()->getFacet('Rts');\n foreach ($facet as $value => $count) {\n echo $value . ' [' . $count . ']<br/>';\n }\n\n }", "public function actionAnalysis() { \r\n \t$currentTs = time();\r\n \t$request = Yii::$app->request;\r\n \t$identity = \\Yii::$app->user->getIdentity();\r\n \r\n \t$q = trim($request->post('q', $request->get('q', '')));\r\n \r\n \t$query = analysis::find();\r\n \t$query->orderBy(['id'=>SORT_ASC]);\r\n \r\n \t \r\n \t$op = $request->post('op', $request->get('opss', ''));\r\n \tif ($op == \"search\") {\r\n \t if (!empty($_REQUEST['type'])){\r\n \t\t\t$type = $_REQUEST['type'];\r\n \t\t\tif($type != 0){\r\n \t\t\t\t$queryf = pond::find();\r\n \t\t\t\t$queryf->andWhere(['type'=> $type]);\r\n \t\t\t\t$pondf = $queryf->all();\r\n \t\t\t\tforeach ($pondf as $obj){\r\n \t\t\t\t\t$arrId[] = $obj->id;\r\n \t\t\t\t}\r\n \t\t\t\t \r\n \t\t\t\tif($arrId){\r\n \t\t\t\t\t$query->andWhere(['pondId'=> $arrId]);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\t \r\n \t\tif (!empty($_REQUEST['q'])){\r\n \t\t\t$item = $_REQUEST['q'];\r\n \t\t\t$query->andWhere(['LIKE' ,'title','%'.$item.'%', false]);\r\n \t\t}\r\n \t}\r\n\r\n \t\t\tif ($q)\r\n \t\t\t\t$query->andWhere(['LIKE' ,'name','%'.$q.'%', false]);\r\n \t\t\t\t\t\r\n \t\t\t\t\t\r\n \t\t\t\t//actions\r\n \t\t\t\tswitch ($request->post('op')){\r\n \t\t\t\t\tcase 'delete':\r\n \t\t\t\t\t\t$this->analysisDelete();\r\n \t\t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t\t\t\r\n \t\t\t\t//paging\r\n \t\t\t\t$pagination = new Pagination([\r\n \t\t\t\t\t\t'defaultPageSize' => \\Yii::$app->params['ui']['defaultPageSize'],\r\n \t\t\t\t\t\t'totalCount' => $query->count(),\r\n \t\t\t\t]);\r\n \t\t\t\t$pagination->params = [\r\n \t\t\t\t\t\t'q'=>$q,\r\n \t\t\t\t\t\t'page'=>$pagination->page,\r\n \t\t\t\t];\r\n \t\t\t\t$query->offset($pagination->offset);\r\n \t\t\t\t$query->limit($pagination->limit);\r\n \t\t\t\t\t\r\n \t\t\t\t$list = $query->all();\r\n \t\t\t\t\t\r\n \t\t\t\t//get users\r\n \t\t\t\t$arrId = [];\r\n \t\t\t\t$arrUser = [];\r\n \t\t\t\t$arrPond = [];\r\n \t\t\t\tif (!empty($list)){\r\n \t\t\t\t\tforeach ($list as $obj){\r\n \t\t\t\t\t\t$arrId[] = $obj->createBy;\r\n \t\t\t\t\t}\r\n \t\t\t\t\t$modelsUser = User::find()->where(['id'=>$arrId])->all();\r\n \t\t\t\t\tif(!empty($modelsUser)){\r\n \t\t\t\t\t\tforeach ($modelsUser as $obj){\r\n \t\t\t\t\t\t\t$arrUser[$obj->id] = $obj->firstName.' '.$obj->lastName;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \r\n \t\t\t\t\t$objPond = Pond::find()->orderBy(['id'=>SORT_ASC])->all();\r\n \t\t\t\t\tforeach ($objPond as $dataPond){\r\n \t\t\t\t\t\t$objTypelist = Typelist::find()->where(['id'=>$dataPond->type])->all();\r\n \t\t\t\t\t\tforeach ($objTypelist as $obj){\r\n \t\t\t\t\t\t\t$arrPond[$dataPond->id] = $obj->name.' '.$dataPond->title;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \r\n \t\t\t\t$query = Typelist::find();\r\n \t\t\t\t$query->orderBy(['id'=>SORT_ASC]);\r\n \t\t\t\t$objTypelist = $query->all();\r\n \t\t\t\t$arrTypelist = [];\r\n \t\t\t\tforeach ($objTypelist as $dataTypelist){\r\n \t\t\t\t\t$arrTypelist[$dataTypelist->id] = $dataTypelist->name;\r\n \t\t\t\t}\r\n \t\t\t\t\t\r\n \t\t\t\techo $this->render('analysis', [\r\n \t\t\t\t\t\t'lst' => $list,\r\n \t\t\t\t\t\t'arrTypelist'=>$arrTypelist,\r\n \t\t\t\t\t\t'arrPond' => $arrPond,\r\n \t\t\t\t\t\t'pagination' => $pagination,\r\n \t\t\t\t\t\t'arrUser' =>$arrUser,\r\n \t\t\t\t\t\t'q'=>$q,\r\n \t\t\t\t]);\r\n }", "public function orderByRelevance(){\n\t\tif(!$this->full_text)\n\t\t\treturn $this;\n\t\t$against = Propel::getServiceContainer()->getReadConnection($this->getDbName())->quote($this->fulltext_text);\n\t\treturn $this->withColumn('match (title) against (' . $against . ' IN BOOLEAN MODE)', 's1')->\n\t\t\twithColumn('match(description) against (' . $against . ' IN BOOLEAN MODE)', 's2')->\n\t\t\taddDescendingOrderByColumn(\"(s1*2)+s2\");\n\t}", "function subsite_manager_search_subsite_hook($hook, $type, $returnvalue, $params){\n\t\t$join = \"JOIN \" . get_config(\"dbprefix\") . \"sites_entity se ON e.guid = se.guid\";\n\t\t$params['joins'] = array($join);\n\t\t$fields = array('name', 'description', 'url');\n\n\t\t$where = search_get_where_sql('se', $fields, $params, FALSE);\n\n\t\t$params['wheres'] = array($where);\n\t\t$params['count'] = TRUE;\n\t\t$count = elgg_get_entities($params);\n\n\t\t// no need to continue if nothing here.\n\t\tif (!$count) {\n\t\t\treturn array('entities' => array(), 'count' => $count);\n\t\t}\n\n\t\t$params['count'] = FALSE;\n\t\t$entities = elgg_get_entities($params);\n\n\t\t// add the volatile data for why these entities have been returned.\n\t\tforeach ($entities as $entity) {\n\t\t\t$title = search_get_highlighted_relevant_substrings($entity->name, $params['query']);\n\t\t\t$entity->setVolatileData('search_matched_title', $title);\n\n\t\t\t$desc = search_get_highlighted_relevant_substrings($entity->description, $params['query']);\n\t\t\t$entity->setVolatileData('search_matched_description', $desc);\n\n\t\t\t$icon = elgg_view_entity_icon($entity, 'tiny');\n\n\t\t\t$entity->setVolatileData(\"search_icon\", $icon);\n\t\t}\n\n\t\treturn array(\n\t\t\t'entities' => $entities,\n\t\t\t'count' => $count,\n\t\t);\n\t}", "function pre_query() {\n $this->view->field += $this->casetracker_fields;\n unset($this->view->field['cuid']); // this could be more surgical.\n }", "function includeSearch($query) {\n \n\tif ($query->is_search) {\n\t \n\t\t$query->set('post_type', array('post', 'produtos'));\n\t\t//$query->set('tag', '%'.get_search_query().'%');\n\t \n\t}\n\t return $query;\n\t \n\t}", "public function fullTextSearchScore($selectorName);", "public function getAvancement()\n {\n\n $usecases = $this->getUseCases();\n $diviseur = 0;\n $val = 0;\n foreach ($usecases as $usecase) {\n $diviseur = $diviseur + $usecase->poids;\n $val = $val + ($usecase->poids * $usecase->avancement);\n }\n $resultat = $val / $diviseur;\n\n return $resultat;\n }", "public function query($expression) {\n\t\t\t$posts = array();\n\t\t\t$results = parent::query($expression);\n\t\t\tif ($results) {\n\t\t\t\tif (isset($results['matches'])) {\n\t\t\t\t\tforeach ($results['matches'] as $postID => $data) {\n\t\t\t\t\t\t$posts[$postID] = $postID;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->totalFound = $results['total_found'];\n\t\t\t}\n\t\t\tif (!empty($posts)) {\n\t\t\t\t$sql = \"SELECT `a`.`postID`, `a`.`type`, `a`.`source`, `a`.`identifier`, \n\t\t\t\t\t\t\t`b`.`gameTitle`, `b`.`gameTitleURL`, `a`.`url`, `a`.`image`, `a`.`postTitle`, `a`.`postTitleURL`, `a`.`description`, \n\t\t\t\t\t\t\tIFNULL(`d`.`userName`, IFNULL(`e`.`name`, 'anonymous')) AS `posterName`, \n\t\t\t\t\t\t\t`a`.`poster`, `a`.`posterID`, `a`.`posted`, `c`.`comments`, \n\t\t\t\t\t\t\t`c`.`upVotes`, `c`.`downVotes` \n\t\t\t\t\t\tFROM `posts` `a` \n\t\t\t\t\t\tJOIN `gameTitles` `b` ON (`a`.`gameTitleID` = `b`.`gameTitleID`) \n\t\t\t\t\t\tJOIN `postStatistics` `c` ON (`a`.`postID` = `c`.`postID`) \n\t\t\t\t\t\tLEFT JOIN `users` `d` ON (`a`.`poster` = 'USER' AND `a`.`posterID` = `d`.`userID`) \n\t\t\t\t\t\tLEFT JOIN `adminUsers` `e` ON (`a`.`poster` = 'ADMIN' AND `a`.`posterID` = `e`.`adminUserID`) \n\t\t\t\t\t\tWHERE `a`.`postID` IN ('\".implode(\"', '\", $posts).\"') \n\t\t\t\t\t\tORDER BY `a`.`postID` = '\".implode(\"' DESC, `a`.`postID` = '\", $posts).\"' DESC\";\n\t\t\t\t$result = query($sql);\n\t\t\t\tif ($result->rowCount > 0) {\n\t\t\t\t\twhile ($row = $result->fetchRow()) {\n\t\t\t\t\t\t$row['poster'] = strtolower($row['poster']);\n\t\t\t\t\t\t$row['timeSubmitted'] = time() - strtotime($row['posted']);\n\t\t\t\t\t\tif ($row['timeSubmitted'] < 0) {\n\t\t\t\t\t\t\t$row['timeSubmitted'] = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($row['timeSubmitted'] < 60) {\n\t\t\t\t\t\t\t$period = 'second';\n\t\t\t\t\t\t} elseif ($row['timeSubmitted'] < 3600) {\n\t\t\t\t\t\t\t$row['timeSubmitted'] = round($row['timeSubmitted'] / 60);\n\t\t\t\t\t\t\t$period = 'minute';\n\t\t\t\t\t\t} elseif ($row['timeSubmitted'] < 86400) {\n\t\t\t\t\t\t\t$row['timeSubmitted'] = round($row['timeSubmitted'] / 3600);\n\t\t\t\t\t\t\t$period = 'hour';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$row['timeSubmitted'] = round($row['timeSubmitted'] / 86400);\n\t\t\t\t\t\t\t$period = 'day';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($row['timeSubmitted'] > 1) {\n\t\t\t\t\t\t\t$row['timeSubmitted'] = $row['timeSubmitted'].' '.$period.'s';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$row['timeSubmitted'] = $row['timeSubmitted'].' '.$period;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$posts[$row['postID']] = $row;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$posts = array();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $posts;\n\t\t}", "public function average(Query $query, string $field): float;", "function beeldgeluid_preprocess_search_results(&$variables, $hook) {\n //dsm($variables);\n}", "function displayResults($arrayName) \n{\n //Display Non-aggregated results: \n //(Non-Aggregated Arrays have the following elements:\n //value[0]Trimmed URL, value[1] Title, value[2] Snippet, value[3] Score, \n //value[4] Y/N Seen, value[5] Original URL, value[6] Cleaned Snippet placeholder)\n if ($_POST['result_type']==='Non-Aggregated' ) {\n //Loop through Array and check that values have been stored in it:\n foreach ($arrayName as $key => $value) {\n echo \"<p style=\\\"text-align:justify\\\">\n <a href=\\\"$value[5]\\\">$value[1]</a><br />\" \n . $value[2] //snippet\n . \"<br />Score: <strong>\" \n . number_format($value[3], 2, '.', '') //score\n . \"</strong>\" \n . \"<br /><a href=\\\"#top\\\"><small>new search</small></a></p>\";\n }\n } else if ($_POST['result_type']==='Aggregated'\n || $_POST['result_type']==='Weighted'\n ) {\n //Display Aggregated or Weighted results:\n //(Aggregated Arrays have the following elements:\n //value[0]Trimmed URL, value[1] Title, value[2] Snippet, value[3] Score, \n //value[4] Y/N Seen, value[5] Original URL, \n //value[6] Cleaned Snippet placeholder, value[7] coordinate placeholder)\n foreach ($arrayName as $key => $value) {\n echo \"<p class=\\\"text-center\\\">\n <a href=\\\"$value[4]\\\">$value[1]</a><br />\"\n . $value[2] //snippet\n . \"<br />Score: <strong>\" . number_format($value[3], 2, '.', '') \n . \"</strong>\"\n . \"<br /><a href=\\\"#top\\\"><small>new search</small></a></p>\";\n }\n } else {\n //Display Clustered Results\n //(Clustered Arrays have the following elements:\n //value[0]Trimmed URL, value[1] Title, value[2] Snippet, value[3] Score, \n //value[4] Original URL, value[5] Cleaned Snippet, \n //value[6] Coordinate)\n foreach ($arrayName as $key => $value) {\n echo \"<p style=\\\"text-align:justify\\\">\n <a href=\\\"$value[4]\\\">$value[1]</a><br />\"\n . $value[2] //snippet\n . \"<br />Score: <strong>\" . number_format($value[3], 2, '.', '') \n . \"</strong>\"\n . \"<br /><a href=\\\"#top\\\"><small>new search</small></a></p>\";\n }\n }\n}", "function summary_query() {\r\n $this->get_query_fields();\r\n \r\n // No way to do summaries on more than one field at a time.\r\n if (count($this->query_fields) > 1) {\r\n return;\r\n }\r\n \r\n $field = $this->query_fields[0]['field'];\r\n $date_handler = $this->query_fields[0]['date_handler'];\r\n \r\n // Get the SQL format for this granularity, like Y-m,\r\n // and use that as the grouping value.\r\n $format = $date_handler->views_formats($this->options['granularity'], 'sql');\r\n $this->formula = $date_handler->sql_format($format, $date_handler->sql_field($field['fullname']));\r\n \r\n // Add the computed field.\r\n $this->base_alias = $this->name_alias = $this->query->add_field(NULL, $this->formula, $field['query_name']);\r\n \r\n return $this->summary_basics(FALSE);\r\n }", "function catch_search( &$query ) {\n\tif ( !is_admin() && $query->is_main_query() ) :\n\t\tif ( isset( $_GET['buscar'] ) ) :\n\t\t\t$query->set( 'posts_per_page', 4 );\n\t\t\t$query->set( 'es_busqueda_vivienda', 1 );\n\t\tendif;\n\tendif;\n\t//remove_action( 'pre_get_posts', 'custom_post_author_archive' ); // run once!\n}", "public function matchedDocs() {\n\t\tthrow new \\Core\\Search\\Lucene\\Exception ( 'Wildcard query should not be directly used for search. Use $query->rewrite($index)' );\n\t}" ]
[ "0.63922375", "0.5687345", "0.5610112", "0.5465404", "0.5323646", "0.52082294", "0.51995945", "0.51544017", "0.5142923", "0.51165235", "0.5106122", "0.50598943", "0.50287026", "0.501357", "0.49986017", "0.49760142", "0.49670443", "0.49514598", "0.49207982", "0.48586658", "0.48554507", "0.48446074", "0.48307046", "0.48277065", "0.48116198", "0.48095548", "0.48082387", "0.47988302", "0.47970492", "0.47969538", "0.47965455", "0.47817722", "0.47765887", "0.47617278", "0.4761535", "0.47492406", "0.47477219", "0.4744326", "0.47361284", "0.47357795", "0.4720209", "0.471889", "0.47104862", "0.4705313", "0.46986398", "0.46774587", "0.46734256", "0.46723253", "0.46722054", "0.4663994", "0.46609554", "0.46523803", "0.4645651", "0.4644657", "0.46416688", "0.4640965", "0.4638208", "0.463697", "0.463697", "0.46191108", "0.46182543", "0.46128368", "0.46116698", "0.460256", "0.4601003", "0.4601003", "0.4601003", "0.4601003", "0.4599122", "0.45754328", "0.45743197", "0.45636633", "0.45525512", "0.45451197", "0.45446965", "0.45351472", "0.45349208", "0.45322365", "0.45289686", "0.45254964", "0.4524619", "0.4522154", "0.4521284", "0.45125002", "0.45105082", "0.4508104", "0.45036986", "0.45028418", "0.4498549", "0.44976935", "0.4490824", "0.44906977", "0.4480776", "0.4480489", "0.44796383", "0.44788948", "0.44727305", "0.44716182", "0.44712624", "0.4468743" ]
0.66665363
0
Reads string from specified file path and parses it as TOML.
public static function parseFile($path) { if(!is_file($path)) { throw new Exception('Invalid file path'); } $toml = file_get_contents($path); // Remove BOM if present $toml = preg_replace('/^' . pack('H*','EFBBBF') . '/', '', $toml); return self::parse($toml); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tidy_parse_file($filename, $config = null, $encoding = null, $use_include_path = false) {}", "function loadTemplateFile($filePath)\n{\n return loadTemplateString(file_get_contents($filePath));\n}", "public static function loadFile($path)\n {\n assert(is_string($path), 'Wrong type for argument 1. String expected');\n return \\simplexml_load_file($path, __CLASS__);\n }", "private function fileContent($path)\n\t{\n\t\tif ( !file_exists($path))\n\t\t{\n\t\t\tUtils_Configuration_XMLLoaderOpenFileException(\n\t\t\t\t'Nie ma pliku ' . $path);\n\t\t}\n\n\t\t$this->sXML = file_get_contents($path);\n\n\t\tif (false === $this->sXML)\n\t\t{\n\t\t\tUtils_Configuration_XMLLoaderOpenFileException(\n\t\t\t\t'Nie udalo sie odczytac zawartosci pliku ' . $path);\n\t\t}\n\t}", "public static function parsing($path, $array)\n {\n if (!file_exists($path)) {\n throw new Exceptions\\MyException ('Invalid path specified');\n }\n\n if (!is_readable($path)) {\n throw new Exceptions\\MyException ('File read error');\n }\n\n $temp = file_get_contents($path);\n\n foreach ($array as $mark => $text) {\n $pos = strripos($temp,'<!--'.$mark.'-->');\n\n if ($pos){\n $temp = substr_replace($temp,' '.$text.' ',$pos,0);}\n }\n return $temp; \n }", "function load_t2s_text(){\n\tglobal $config, $t2s_langfile, $t2s_text_stand, $templatepath;\n\t\n\tif (file_exists($templatepath.'/lang/'.$t2s_langfile)) {\n\t\t$TL = parse_ini_file($templatepath.'/lang/'.$t2s_langfile, true);\n\t} else {\n\t\tLOGGING(\"For selected T2S language no translation file still exist! Please go to LoxBerry Plugin translation and create a file for selected language \".substr($config['TTS']['messageLang'],0,2),3);\n\t\texit;\n\t}\n\treturn $TL;\n}", "function load_file($path){\n\tif (!file_exists($path)) system_die('File reading error - \"' . $path . '\"', 'Template->load_file');\n\t$this->template = @file($path);\n\tunset($this->result);\n\t$this->filename = $path;\n}", "public function parseXML($filePath) {\n \t$doc = $this->_loadXML($filePath);\n\n \t$texts = $doc->getElementsByTagName('text');\n \tforeach ($texts as $text) {\n \t\tdefine($text->getAttribute('id'), $text->nodeValue);\n \t}\n\n //\tthat's all folks!\n }", "public function parse($file);", "public function parse($file);", "public function readtpl(string $tpl_temp):string{\n\t\t$extension = explode('.',$tpl_temp);\n\t\t$extension = end($extension);\n\t\tif(strtolower($extension) == 'tpl'){\n\t\t\tif (!file_exists($this->template_dir . Options::get('template') . '/'.$tpl_temp)) \n\t\t\t\treturn \"Error loading template file <br />\";\n\t\t\telse\n\t\t\t\treturn file_get_contents($this->template_dir . Options::get('template') . '/'.$tpl_temp);\n\t\t}\n\t}", "public function loadTemplate($path);", "function transformFile($filePath)\n{\n return transformDOM(loadTemplateFile($filePath));\n}", "function readTemplates( $input )\r\n {\r \tglobal $CONFIG;\r\n \tif (isset($this->_rootAtts['relative'])) {\r\n\t\t\t$relative = $this->_rootAtts['relative'];\r\n\t\t} else {\r\n\t\t\t$relative = false;\r\n\t\t}\r\n\t\tif ($relative === false) {\r\n \t\t$this->_currentInput = $input;\r\n\t\t} else {\r\n\t\t\t$this->_currentInput = dirname($relative) . DIRECTORY_SEPARATOR . $input;\r\n\t\t}\r\n\r\n\t\t$content = $this->_getFileContents($this->getTemplateRoot().$input.'.'.$CONFIG['tpl']['ext']);\r\n\t\tif (patErrorManager::isError($content)) {\r\n\t\t\treturn $content;\r\n\t\t}\r\n\r\n\t\t$templates = $this->parseString($content);\r\n\r\n\t\treturn\t$templates;\r\n }", "public function actionGetText($filePath)\n {\n $file = new FileDoc();\n $file->loadFile($filePath);\n $text = $file->getTextUtf8();\n echo $text;\n }", "public function run()\n {\n $this->loadTextFile($this->text_file);\n }", "public function parse($path)\n\t{\n\t\tlibxml_use_internal_errors(true);\n\n\t\t$xml = simplexml_load_file($path, null, LIBXML_NOERROR);\n\n\t\tif ($xml === false)\n\t\t{\n\t\t\t$errors = libxml_get_errors();\n\t\t\t$latestError = array_pop($errors);\n\t\t\t$error = array(\n\t\t\t\t'message' => $latestError->message,\n\t\t\t\t'type' => $latestError->level,\n\t\t\t\t'code' => $latestError->code,\n\t\t\t\t'file' => $latestError->file,\n\t\t\t\t'line' => $latestError->line,\n\t\t\t);\n\t\t\tthrow new ParseException($error);\n\t\t}\n\n\t\t$data = new stdClass;\n\t\tforeach ($xml->children() as $node)\n\t\t{\n\t\t\t$data->{$node['name']} = $this->getValueFromNode($node);\n\t\t}\n\t\t$data = json_decode(json_encode($data), true);\n\n\t\treturn $data;\n\t}", "public function parse( $contents );", "public function load(string $file): string;", "public function readFile($path);", "protected function load()\n {\n if ($this->contentLoaded) {\n return;\n }\n\n $content = file_get_contents($this->path);\n\n if (!$content) {\n $this->contentLoaded = true;\n return;\n }\n\n preg_match_all('/\\@([a-z]+)\\s([^\\r\\n\\@]+)/i', $content, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $match) {\n $fullMatch = $match[0];\n $variable = $match[1];\n $value = $match[2];\n\n $content = str_replace($fullMatch, '', $content);\n $this->metadata[$variable] = $value;\n }\n\n $this->content = trim($content, \"\\r\\n\");\n $this->contentLoaded = true;\n }", "public function processTemplateFromFileProcessesTemplateFromFile() {\n\t\t$this->subject->processTemplateFromFile(\n\t\t\t'EXT:oelib/Tests/Unit/Fixtures/oelib.html'\n\t\t);\n\n\t\t$this->assertSame(\n\t\t\t'Hello world!' . LF,\n\t\t\t$this->subject->render()\n\t\t);\n\t}", "private function _get_translations_from_file () {\n\n\t\t$lang = file_exists(self::DIR_LANGS . $this->lang . '.php')\n\t\t\t\t\t? $this->lang : $this->_default_lang;\n\n\t\trequire self::DIR_LANGS . $lang . '.php';\n\n\t\treturn $t;\n\n\t}", "public function read($path) {\n return file_get_contents($path);\n }", "public function readFileTemplate(): string\n {\n $template = resource_path('templates/EnumModel.txt');\n\n if (!file_exists($template) || !is_readable($template)) {\n throw new Exception(sprintf('The path \"%s\" is not a file or not readable', $template));\n }\n $search = [\"/\", \"app\"];\n $replace = [\"\\\\\", \"App\"];\n $namespace = str_replace($search, $replace, $this->path);\n\n $values = [\n '$className' => $this->className,\n '$content' => $this->content,\n '$namespace' => $namespace\n ];\n\n return strtr(file_get_contents($template), $values);\n }", "public function readFile() {\n\t\ttry {\n\t\t\tparent::readFile();\n\t\t} catch (LFException $e) {\n\t\t\tthrow $e;\n\t\t}\n\n\t\t// convert all language values from utf-8 to the original charset\n\t\tif (!typo3Lib::isTypo3BackendInUtf8Mode()) {\n\t\t\t$this->localLang = typo3Lib::utf8($this->localLang, FALSE, array('default'));\n\t\t}\n\t}", "public function read($path)\n {\n return file_get_contents($path);\n }", "public function parseFile(string $filename);", "public function parseFile( $filename ) {\n if( $this->isInitialized == false ) throw new GPTParserException( \"GPT parser not initialized. Call init() first.\" );\n\n $lines = file( $filename, FILE_IGNORE_NEW_LINES );\n\n $this->context = GPTParserContext::get();\n $this->context->Filename = $filename;\n $this->context->Parser = $this;\n\n $this->lastWhitespace = 0;\n $this->scopes = array();\n\n $this->rootNodes = array();\n\n // Iterate over all lines\n foreach( $lines as $lineNumber => $line ) {\n $this->internalParse( $lineNumber, $line );\n }\n\n $result = \"\";\n\n // Render result\n foreach( $this->rootNodes as $rootNode ) {\n $result .= $rootNode->render( $this->PostProcessor );\n }\n\n return $result;\n }", "private function _loadXML($filePath) {\n \tif (substr($this->localizationPath, -1) != DIRECTORY_SEPARATOR) {\n \t\t$this->localizationPath = $this->localizationPath.DIRECTORY_SEPARATOR;\n \t}\n\n \t$filePath = $this->localizationPath.$filePath;\n\n \t//\tPARSING...\n \t$doc = new DOMDocument();\n \t$doc->preserveWhiteSpace = false;\n \t$doc->formatOutput = true;\n\n \tif (!$doc->load(realpath($filePath))) {\n \t\tthrow new Exception('Can not load locale '.$filePath);\n \t}\n\n \treturn $doc;\n }", "public function load($value)\n {\n $strip = Config::get('template')->strip;\n if (is_file($value)) {\n $this->dom = HtmlDomParser::file_get_html($value,\n $use_include_path = false, \n $context = null, \n $offset = -1, \n $maxLen = -1, \n $lowercase = true, \n $forceTagsClosed = true, \n $target_charset = DEFAULT_TARGET_CHARSET, \n $stripRN = $strip, \n $defaultBRText = DEFAULT_BR_TEXT, \n $defaultSpanText = DEFAULT_SPAN_TEXT);\n } else {\n $this->dom = HtmlDomParser::str_get_html($value,\n $lowercase = true, \n $forceTagsClosed = true, \n $target_charset = DEFAULT_TARGET_CHARSET, \n $stripRN = $strip, \n $defaultBRText = DEFAULT_BR_TEXT, \n $defaultSpanText = DEFAULT_SPAN_TEXT);\n }\n }", "protected function readTweaksFile()\n {\n $bookDir = $this->app['publishing.dir.book'];\n $themeDir = Toolkit::getCurrentThemeDir($this->app);\n\n // first path is the book Contents dir\n $contentsDir = $bookDir.'/Contents';\n\n // second path is the theme \"<format>/Config\" dir\n $configFormatDir = sprintf('%s/%s/Config', $themeDir, $this->format);\n\n // third path is the theme \"Common/Config\" dir\n $configCommonDir = sprintf('%s/Common/Config', $themeDir);\n\n // look for either one\n $dirs = [\n $contentsDir,\n $configFormatDir,\n $configCommonDir,\n ];\n\n $file = $this->app->getFirstExistingFile('html-tweaks.yml', $dirs);\n\n if (!$file) {\n $this->writeLn('No html-tweaks.yml file found. Looked up directories:', 'error');\n foreach ($dirs as $dir) {\n $this->writeLn('- '.$dir);\n }\n\n return;\n }\n\n $this->tweaks = Yaml::parse(file_get_contents($file));\n }", "abstract public function read($path);", "public function load($filename = '')\n {\n if ($this->isLoaded) \n {\n return;\n }\n\n if (empty($filename))\n {\n $filename = $this->filename;\n }\n\n if (!file_exists($filename))\n {\n IdmlAssembler::getProgressUpdater()->setWarning(\"Story with file {$filename} is not found.\");\n return;\n }\n\n $domDocument = new DOMDocument('1.0', 'UTF-8');\n $storyContent = file_get_contents($filename);\n $ok = $domDocument->loadXML(mb_convert_encoding($storyContent, 'UTF-8'));\n if ($ok === false)\n {\n IdmlAssembler::getProgressUpdater()->setWarning(\"Could not load xml for story {$filename}\");\n }\n\n $storyNodes = $domDocument->getElementsByTagName('Story');\n $storyNode = $storyNodes->item(1);\n $this->parse($storyNode);\n $this->isLoaded = true;\n }", "protected function _parseTemplate() {}", "function readTemplateFromFile ($fileName) {\n if (!$this->readFileIntoString($fileName,$s)) {\n $this->triggerError (\"Error while reading template file \" . $fileName . \".\");\n return false; }\n if (!$this->setTemplateString($s)) return false;\n return true; }", "protected function parseTemplate($templatePathAndFilename) {\n $templateSource = \\TYPO3\\FLOW3\\Utility\\Files::getFileContents($templatePathAndFilename, FILE_TEXT);\n if ($templateSource === FALSE) {\n throw new \\TYPO3\\Fluid\\View\\Exception\\InvalidTemplateResourceException(('\"' . $templatePathAndFilename) . '\" is not a valid template resource URI.', 1257246929);\n }\n return $this->templateParser->parse($templateSource);\n }", "function parseFile($filename){\n $file = @fopen($filename, \"rb\");\n if($file === false)\n return null;\n\n $text = fread($file, filesize($filename));\n if(($enc = mb_detect_encoding($text, 'UTF-8, ISO-8859-1, ISO-8859-2, CP-1250')) != 'UTF-8'){\n $text = iconv($enc, 'UTF-8', $text);\n }\n\n return $this->parse($text);\n }", "public function textfile($template = null) {\n if(is_null($template)) $template = $this->intendedTemplate();\n return textfile($this->diruri(), $template);\n }", "function yml_parse_file($ymlFile)\n {\n return yml::parseFile($ymlFile);\n }", "public function load($path);", "public function load($path);", "public function load($path);", "public function parse(string $content);", "public function parse(string $content);", "public function loadFile($filePath);", "public function parseFile($filename, $config = null, $encoding = null, $use_include_path = false) {}", "public function readToString() {\r\n\t\tif ($this->exists) {\r\n\t\t\t// read file\r\n\t\t\treturn file_get_contents ( $this->filename );\r\n\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function load_texts($file)\n{\n\n if (substr($file, -5) != '.json') {\n throw new Exception('Invalid language file found in language folder.');\n }\n\n $fname = strtolower(substr(basename($file), 0, - (strlen('.json'))));\n\n $GLOBALS[\"__LANGUAGE__{$fname}__\"] = json_decode(file_get_contents($file), true);\n}", "function load_string(&$string){ // loading template from string\n\t$this->template = array();\n\tforeach (preg_split('/\\r?\\n/', $string) as $tmp) array_push($this->template, $tmp.\"\\n\");\n\tunset($this->result);\n\tunset($this->filename);\n}", "public static function xmlParseFile($path)\n {\n self::_checkXmlParser();\n\n return @simplexml_load_file($path);\n }", "public static function xmlParseFile($path)\n {\n self::_checkXmlParser();\n\n return @simplexml_load_file($path);\n }", "public function input(string $file_contents);", "public static function load($path, $cache = false)\r\n {\r\n\r\n $hash = md5(filemtime($path) . $path);\r\n if ($cache && file_exists(Config::path('cache') . '/' . $hash . '.php')) {\r\n include(Config::path('cache') . '/' . $hash . '.php');\r\n } else {\r\n $yml = self::parse(file_get_contents($path));\r\n Cache::saveOutput($hash . '.php', self::createCache($yml));\r\n }\r\n\r\n return $yml;\r\n }", "protected function parseTemplateFile($file_path, &$result = array()) {\n if (false === ($source = file($file_path))) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $this->I18n(\"Can't get file content: {{ file }}\", array(\n 'file' => $file_path\n ))));\n return false;\n }\n $path = substr($file_path, strlen(WB_PATH));\n $module = dirname(substr($file_path, strlen(WB_PATH . '/modules/')));\n if (strpos($module, DIRECTORY_SEPARATOR) > 0) $module = substr($module, 0, strpos($module, DIRECTORY_SEPARATOR));\n $file = basename($file_path);\n $line_number = 1;\n foreach ($source as $line) {\n $hits = preg_match_all('/{I18n(.?)\\((.*?)\\)(.?)}/', $line, $matches);\n if ($hits > 0) {\n for($i = 0; $i < $hits; $i++) {\n foreach ($matches[$i] as $match) {\n if (!empty($match)) {\n if (preg_match('/(\\'(.*)\\')|(\"(.*)\")/', $match, $hit) == 1) {\n $text = trim($hit[0]);\n $result[] = array(\n 'module' => $module,\n 'path' => $path,\n 'file' => $file,\n 'key' => substr($text, 1, strlen($text) - 2),\n 'line' => $line_number\n );\n }\n }\n }\n }\n }\n $line_number++;\n }\n return true;\n }", "function libopml_parse_file($filename, $strict = true) {\n\t$file_content = file_get_contents($filename);\n\n\tif ($file_content === false) {\n\t\tthrow new LibOPML_Exception(\n\t\t\t$filename . ' cannot be found'\n\t\t);\n\t}\n\n\treturn libopml_parse_string($file_content, $strict);\n}", "public function read($path);", "public function loadYamlConfig($filepath);", "function textile($content)\n{\n $parser = new \\Netcarver\\Textile\\Parser();\n\n return $parser\n ->setDocumentType('html5')\n ->parse($content);\n}", "private function setContentsFromFile()\n {\n $this->file->typeChecker()->assertMarkdown();\n $this->contents = $this->file->contents();\n }", "function _loadDataText() {\r\n\t\treturn unserialize(file_get_contents($this->data_txt));\r\n\t}", "public function parse()\n {\n return include $this->filePath;\n }", "public static function fromHtmlFile(string $path): Renderer;", "public static function getContent ($path) {\n\t\treturn \\file_get_contents($path);\n\t}", "public static function get($_path)\r\n {\r\n if($this->isFile($_path))\r\n {\r\n return file_get_contents($_path);\r\n }\r\n }", "protected function _parseRTF($file_path_full) {\n\t\t$rtf = file_get_contents($file_path_full);\n\t\t$r = new rtf($rtf);\n\t\t$r->output(\"html\");\n\t\t$r->parse();\n\t\tif(count($r->err) == 0) {\n\t\t\t$out = nl2br($r->out) . $r->outstyles;\t\n\t\t\techo $out;\n\t\t\treturn $out;\n\t\t} else {\n\t\t\techo $r->err;\n\t\t\treturn '';\n\t\t}\n\t}", "public static function decodeFromFile($path);", "protected function loadFilePath($filepath)\n {\n if ($filepaths = $this->files($filepath)) {\n foreach ($filepaths as $file) {\n $contents = file_get_contents($file);\n\n preg_match_all('/^default: (.*)$/Um', $contents, $default);\n $default = $default[1];\n\n preg_match_all('/^replace: (.*)$/Um', $contents, $replace);\n $replace = $replace[1];\n\n if ($default) {\n if (count($default) == count($replace)) {\n $this->translations = array_merge($this->translations, array_combine($default, $replace));\n } else {\n throw new \\PhorkException(sprintf('The %s language file %s has mismatched definitions and replacements', $this->language, basename($file)));\n }\n }\n }\n }\n }", "function readTemplates( $input )\n\t{\n\t\t$this->_currentInput = $input;\n\n\t\t$templates\t=\t$this->parseString( $input );\n\t\t\n\t\treturn\t$templates;\n\t}", "public static function getRaw($path)\n\t{\n\t\tif(file_exists($path))\n\t\t{\n\t\t\treturn file_get_contents($path);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new \\He\\Exception('Aucun template trouvé à l\\'adresse '.$path.' !');\n\t\t}\n\t}", "public static function loadFile($path)\n {\n for($tok = strtok(file_get_contents($path), \"\\r\\n\"); $tok !== false; $tok = strtok(\"\\r\\n\")) {\n if ($tok[0] == '#')\n continue;\n $parts=explode('=', $tok, 2);\n if (isset($parts[1]))\n self::$values[$parts[0]] = str_replace('\\n', PHP_EOL, $parts[1]);\n }\n }", "public function loadTemplate($file) {\n $file = FilesystemUtils::getFullPath($file, CONTENT_DIR);\n $type = FilesystemUtils::getFileExtension($file);\n\n switch ($type) {\n case 'tpl':\n // Smarty template\n $this->output = $this->filterSmarty($file);\n break;\n\n case 'md':\n // Static Markdown file\n $this->output = $this->filterMarkdown($file);\n break;\n\n case 'tplmd':\n // Smarty template, with the output run through the Markdown parser\n $this->output = $this->filterMarkdown($this->filterSmarty($file), TRUE);\n break;\n\n case 'php':\n // PHP script\n $this->output = $this->filterPHP($file);\n break;\n\n case 'html':\n default:\n // HTML or other unsupported file; passed through unchanged\n $this->output = file_get_contents($file);\n break;\n }\n }", "function _get() {\n if( file_exists($this->_template) ) {\n $this->_text = file($this->_template);\n }\n else {\n $this->_text = array(\"Template file {$this->_template} could not be found.\");\n }\n }", "private function readTemplate($page)\n {\n // Evaluate the direcory, in which the templates are located.\n // This is the \"templates\" direcory relative from the actually called script.\n $template_path = sprintf(\n \"%s/%s/%s.%s\",\n dirname($_SERVER[\"SCRIPT_FILENAME\"]),\n $page->configuration->template_directory,\n $page->template_name,\n $page->configuration->template_extension\n );\n return file_get_contents($template_path);\n }", "public function getFileContent($filePath): string\n {\n return file_get_contents($this->rootDir . '/' . $filePath);\n }", "protected function parseXmlFile() {}", "public function loadString($content);", "protected function read() {\n\t\t$fileContent = trim(file_get_contents($this->filepath));\n\t\t$pattern = '/\\$([^=]+)=([^;]+);/';\n\t\t$matches = null;\n\t\t$matchesFound = preg_match_all($pattern, $fileContent, $matches);\n\t\t$configContents = array();\n\t\tif ($matchesFound) {\n\t\t\t$configContents = $matches[0];\n\t\t}\n\t\t$this->rows = array();\n\t\tforeach ($configContents as $configLine) {\n\t\t\t$this->rows[] = new ConfigFileRow($configLine, $this);\n\t\t}\n\t\t$this->rowIndex = -1;\n\t\tunset($fileContent);\n\t}", "public static function getContents($filePath)\n {\n //compose the file full path\n $path = Path::view($filePath);\n\n //get an instance of the view template class\n $template = Registry::get('template');\n \n //get the compiled file contents\n $contents = $template->compiled($path);\n\n //return the compiled template file contents\n return $contents;\n\n }", "public static function read_file_contents($path, $type = 'string')\n\t{\n\t\tif (!is_file($path)) return false;\n\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase \"array\":\n\t\t\t\treturn file($path);\n\t\t\tbreak;\n\t\t\tcase \"json\":\n\t\t\t\treturn json_decode(file_get_contents($path));\n\t\t\tbreak;\n\t\t\tcase \"json.php\":\n\t\t\t\t$data = file_get_contents($path);\n\t\t\t\treturn json_decode(trim(substr($data, strpos($data, \"\\n\"))));\n\t\t\tbreak;\n\t\t}\n\n\t\treturn file_get_contents($path);\n\t}", "function quest_read_layout_file( $file ) {\n\t\tWP_Filesystem();\n\t\tglobal $wp_filesystem;\n\t\treturn $wp_filesystem->get_contents( $file );\n\t}", "public function parseFile($file)\n {\n $ast = $this->getAST(\n $this->getContents($file)\n );\n return $this->converter->convert($ast);\n }", "private function read() \n {\n if ($this->lang == '') $this->lang = App::getLocale();\n $this->path = base_path().'/resources/lang/'.$this->lang.'/'.$this->file.'.php';\n $this->arrayLang = Lang::get($this->file);\n if (gettype($this->arrayLang) == 'string') $this->arrayLang = array();\n }", "function tidy_parse_string($input, $config = null, $encoding = null) {}", "private function load_demo_content_from_file(): string {\n\t\t$file = WEBSTORIES_PLUGIN_DIR_PATH . 'includes/data/stories/demo.json';\n\n\t\tif ( ! is_readable( $file ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$content = file_get_contents( $file ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents, WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown\n\n\t\tif ( ! $content ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $content;\n\t}", "function parselang()\n{\n $langdir = realpath(__DIR__ . \"/../../lang\") . DIRECTORY_SEPARATOR;\n $langfile = $langdir . \"lang.json\";\n $langfile = file_get_contents($langfile);\n $lang = json_decode($langfile, true);\n $lfile = $langdir . 'language.' . $lang[\"lang\"] . '.php';\n return (file_exists($lfile)) ? $lfile : $langdir . 'language.en.php';\n}", "public function fetch()\n {\n $path = $this->getPath();\n $string = \"\";\n if (is_file($path)) {\n $string = \\file_get_contents($path);\n } elseif (preg_match('/^string:/', $path)) {\n $string = preg_replace('/^string:/', '', $path);\n }\n return $string;\n }", "public function parse($file)\n {\n return $this->content;\n }", "public function getContents($path)\n {\n return file_get_contents($path);\n }", "function testLoadTemplatefile()\n {\n $result = $this->tpl->loadTemplatefile('loadtemplatefile.html', false, false);\n if (PEAR::isError($result)) {\n $this->assertTrue(false, 'Error loading template file: '. $result->getMessage());\n }\n $this->assertEquals('A template', trim($this->tpl->get()));\n }", "public function load($file);", "public function load($file);", "public function load($file);", "function remarks_xml2php($langdata_path)\n{\n\t# Converts updated XML file to corresponding PHP list\n\t# TODO:\n\t$handle = fopen($langdata_path.\"remarks.php\", \"w\");\n\t$string_data = <<<EOF\n<?php\n\\$REMARKS_ARRAY = array (\n\nEOF;\n\tfwrite($handle, $string_data);\n\n\t$measures = simplexml_load_file($langdata_path.\"remarks.xml\");\n\n\t$measure_count = 0;\n\tforeach($measures as $measure)\n\t{\n\t\t$measure_count++;\n\t\t$string_data = '\"'.$measure['id'].'\" => array ( ';\n\t\tfwrite($handle, \"\\t\".$string_data.\"\\n\");\n\t\t$ranges = $measure->range;\n\t\t$range_count = 0;\n\t\tforeach($ranges as $range)\n\t\t{\n\t\t\t$range_count++;\n\t\t\t$string_data = \"\\\"\".$range->key.\"\\\" => \\\"\".$range->value.\"\\\"\";\n\t\t\tif($range_count != count($ranges))\n\t\t\t{\n\t\t\t\t$string_data .= \", \";\n\t\t\t}\n\t\t\tfwrite($handle, \"\\t\\t\".$string_data.\"\\n\");\n\t\t}\n\n\t\t$string_data = \") \";\n\t\tfwrite($handle, \"\\t\".$string_data);\n\t\tif($measure_count < count($measures))\n\t\t{\n\t\t\t$string_data = \", \";\n\t\t\tfwrite($handle, $string_data.\"\\n\");\n\t\t}\n\t}\n\t$string_data = <<<EOF\n);\n\ninclude_once(\"../lang/lang_util.php\");\n?>\nEOF;\n\tfwrite($handle, \"\\n\".$string_data);\n\tfclose($handle);\n}", "public function get_content(): string {\n\t\t$content = $this->load_demo_content_from_file();\n\t\t$content = $this->localize_texts( $content );\n\t\t$content = $this->update_assets_urls( $content );\n\n\t\t// Quick sanity check to see if the JSON is still valid.\n\t\tif ( null === json_decode( $content, true ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $content;\n\t}", "abstract public function load($filename);", "public static function read(string $path)\n {\n if (! file_exists($path)) {\n return false;\n }\n\n return file_get_contents($path);\n }", "public function read($path)\n {\n }", "public static function readTemplateFile($dirname, $fileName, $isblock = false)\n {\n //\n // Load template data\n //\n if ($isblock) {\n $filePath = XOOPS_MODULE_PATH . '/' . $dirname . '/templates/blocks/' . $fileName;\n } else {\n $filePath = XOOPS_MODULE_PATH . '/' . $dirname . '/templates/' . $fileName;\n }\n\n if (!file_exists($filePath)) {\n return false;\n }\n\n $lines = file($filePath);\n if (false == $lines) {\n return false;\n }\n\n $tpldata = '';\n foreach ($lines as $line) {\n //\n // Unify linefeed to \"\\r\\n\"\n //\n $tpldata .= str_replace(\"\\n\", \"\\r\\n\", str_replace(\"\\r\\n\", \"\\n\", $line));\n }\n\n return $tpldata;\n }", "public static function parse ( $file )\n {\n $file_path = XT_PROJECT_DIR .'/'. $file;\n $cached_path = XT_PROJECT_DIR .'/cache/'. $file;\n\n // Check if YAML file was updated since the last caching\n if ( !file_exists ( $cached_path ) ||\n filemtime ( $file_path ) > filemtime ( $cached_path ) )\n {\n // Generate a new cache\n $cached_dir = dirname ( $cached_path );\n if ( !is_dir ( $cached_dir ) )\n {\n mkdir ( $cached_dir, 0777, true );\n chmod ( $cached_dir, 0777 );\n }\n\n // Parse, cache & return\n if ( extension_loaded ( 'yaml' ) )\n {\n $parsed = yaml_parse_file ( $file_path );\n }\n else\n {\n $parsed = yaml::load ( $file_path );\n }\n file_put_contents ( $cached_path, serialize ( $parsed ) );\n\n // Chmod file if it isn't already world-writeable\n $perms = substr ( decoct ( fileperms ( $cached_path ) ), -3 );\n if ( $perms != 777 ) chmod ( $cached_path, 0777 );\n return $parsed;\n }\n\n // Return cached file\n return unserialize ( file_get_contents ( $cached_path ) );\n }" ]
[ "0.57235503", "0.5707733", "0.56545484", "0.55041873", "0.54930955", "0.5492181", "0.5481962", "0.5474074", "0.5365802", "0.5365802", "0.5347656", "0.53309923", "0.5264904", "0.52642643", "0.52217174", "0.5221573", "0.5201459", "0.5138567", "0.5127056", "0.5122626", "0.5104767", "0.5099675", "0.5092993", "0.5070643", "0.5056553", "0.50428843", "0.5029494", "0.5026043", "0.5022079", "0.5021656", "0.5013904", "0.5013391", "0.4992963", "0.49708787", "0.49551827", "0.4946774", "0.49223268", "0.49195412", "0.49194115", "0.491293", "0.4908706", "0.4908706", "0.4908706", "0.49072897", "0.49072897", "0.4904903", "0.49014205", "0.49004743", "0.48942217", "0.48941433", "0.4888296", "0.4888296", "0.48834214", "0.48747945", "0.48734164", "0.4871635", "0.4867559", "0.48657", "0.48644906", "0.48604545", "0.48594838", "0.48591626", "0.48426783", "0.48407224", "0.47983044", "0.47971857", "0.479548", "0.4789286", "0.4787268", "0.4781403", "0.47692665", "0.4765782", "0.47624177", "0.4756272", "0.47521207", "0.4748804", "0.47446877", "0.47439933", "0.47426572", "0.47395107", "0.47242895", "0.47232738", "0.47225004", "0.47191063", "0.47030607", "0.4694215", "0.46915427", "0.46865457", "0.4674262", "0.46680468", "0.4663322", "0.4663322", "0.4663322", "0.46528563", "0.46528322", "0.4647391", "0.46433526", "0.46413025", "0.46411216", "0.4635898" ]
0.61673886
0
Parses a TOML string to retrieve a hashed array of data.
public static function parse($toml) { $result = new stdClass(); $pointer = & $result; // Pre-compile $toml = self::normalize($toml); // Split lines $aToml = explode("\n", $toml); for($ln = 0; $ln < count($aToml); $ln++) { $line = trim($aToml[$ln]); // Skip commented and empty lines if(empty($line) || $line[0] == '#') { continue; } // Array of Tables if(substr($line, 0, 2) == '[[' && substr($line, -2) == ']]') { // Set pointer at top level. $pointer = & $result; $tableName = substr($line, 2, -2); $aTable = self::parseTableName($tableName); $last = count($aTable) - 1; foreach($aTable as $i => $tableName) { $tableName = trim($tableName); if($tableName == "") { // Empty table name throw new Exception("Empty table keys aren't allowed"); } // Allow quoted table names if($tableName[0] == '"' && substr($tableName,-1) == '"') { $tableName = json_decode($tableName); } elseif(!ctype_alnum(str_replace(array('-', '_', '.'), '', $tableName))) // Check for proper keys { // Invalid table name throw new Exception("Invalid table name: " . $tableName); } // Create array of tables and move pointer forward if( is_array($pointer) && !isset($pointer[$tableName]) ) { $pointer[$tableName] = array(); } elseif(is_object($pointer) && !isset( $pointer->$tableName )) { $pointer->$tableName = array(); } if(is_array($pointer)) { $pointer = & $pointer[$tableName]; } else { $pointer = & $pointer->$tableName; } // Handle array of tables if($i < $last && is_array($pointer)) { end($pointer); $pointer = & $pointer[key($pointer)]; } } // Add item to array of tables $pointer[] = array(); end($pointer); $pointer = & $pointer[key($pointer)]; } // Single Tables elseif($line[0] == '[' && substr($line, -1) == ']') { // Set pointer at first level. $pointer = & $result; $tableName = substr($line, 1, -1); $tableName = trim($tableName); //$aTable = explode('.', $tableName); $aTable = self::parseTableName($tableName); $last = count($aTable) - 1; foreach($aTable as $i => $tableName) { if($tableName == "") { // Empty table name throw new Exception("Empty table keys aren't allowed on line " . $line); } // Allow quoted table names if(($tableName[0] == '"' && substr($tableName,-1) == '"') || ($tableName[0] == "'" && substr($tableName,-1) == "'")) { $tableName = json_decode($tableName); } elseif(!ctype_alnum(str_replace(array('-', '_', '.'), '', $tableName))) // Check for proper keys { // Invalid table name throw new Exception("Invalid table name: " . $tableName); } if( is_array($pointer) && !isset($pointer[$tableName]) ) { // Create table $pointer[$tableName] = new stdClass(); } elseif(is_object($pointer) && !isset( $pointer->$tableName )) { $pointer->$tableName = new stdClass(); } elseif($i == $last) { // Overwrite key throw new Exception('Key overwrite previous keys: ' . $line); } // Move pointer forward if( is_array($pointer) ) { $pointer = & $pointer[$tableName]; } else { $pointer = & $pointer->$tableName; } // Handle array of tables if(is_array($pointer)) { end($pointer); $pointer = & $pointer[key($pointer)]; } } } // Key = Values elseif(strpos($line, '=')) { $kv = explode('=', $line, 2); if(is_object($pointer) && !isset( $pointer->{trim($kv[0])} ) || is_array($pointer) && !isset( $pointer[trim($kv[0])] ) ) { // Multi-line strings if(substr(trim($kv[1]), 0, 3) == '"""') { if(strlen(trim($kv[1])) > 3 && substr(trim($kv[1]), -3) != '"""' || strlen(trim($kv[1])) == 3) { do { $ln++; $kv[1] .= "\n" . $aToml[$ln]; } while(strpos($aToml[$ln], '"""') === false); } } // Multi-line literal strings if(substr(trim($kv[1]), 0, 3) == "'''") { if(strlen(trim($kv[1])) > 3 && substr(trim($kv[1]), -3) != "'''" || strlen(trim($kv[1])) == 3) { do { $ln++; $kv[1] .= "\n" . $aToml[$ln]; } while(strpos($aToml[$ln], "'''") === false); } } // Set key=value $key = self::parseKeyValue(trim($kv[0]), trim($kv[1]), $pointer); } else { throw new Exception('Key overwrite previous keys: ' . $line); } } elseif($line[0] == '[' && substr($line, -1) != ']') { throw new Exception('Key groups have to be on a line by themselves: ' . $line); } else { throw new Exception('Syntax error on: ' . $line); } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function parse(string $string): array;", "public function parse($string)\n {\n return [];\n }", "public function parse($string);", "private function parseHAMLString($string, $data = array()) {\n\t\t$HAML = new HamlPHP(new FileStorage(dirname(__FILE__) . '/tmp/'));\n\t\t\n\t\t$content = $HAML->parseString($string);\n\t\treturn $HAML->evaluate($content, $data);\n\t}", "function tidy_parse_string($input, $config = null, $encoding = null) {}", "abstract public function parse($string);", "public function parse($input) {\n\t//--\n\treturn (array) $this->loadWithSource((array)$this->loadFromString((string)$input));\n\t//--\n}", "public function parse(string $content);", "public function parse(string $content);", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "public static function parse(string $content): array\n {\n $lines = explode(\"\\n\", $content);\n\n $object = [];\n\n foreach ($lines as $line) {\n if (preg_match('/^\\s*([\\w\\.\\-]+)\\s*=\\s*(.*)?\\s*$/', $line, $matches)) {\n $key = $matches[1];\n $value = $matches[2] ?? '';\n\n $length = $value ? strlen($value) : 0;\n if ($length > 0 && strpos($value, '\"') === 0 && substr($value, -1) === '\"') {\n $value = preg_replace('/\\\\n/gm', \"\\n\", $value);\n }\n\n $value = trim(preg_replace('/(^[\\'\"]|[\\'\"]$)/', '', $value));\n\n $object[$key] = $value;\n }\n }\n\n return $object;\n }", "public function fromString(string $string): array;", "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 }", "public function parse();", "public function parse();", "public function parse();", "public function parse(string $input);", "private function parse($input) {\n $tokens= [];\n foreach (new Tokens(new StringTokenizer($input)) as $type => $value) {\n $tokens[]= [$type, $value];\n }\n return $tokens;\n }", "public function parse2array() {\n\t\t/**\n\t\t * Thanks to Vladimir Struchkov <great_boba yahoo com> for providing the\n\t\t * code to extract base64 encoded values\n\t\t */\n\n\t\t$arr1 = explode( \"\\n\", str_replace( \"\\r\", '', $this->rawdata ) );\n\t\t$i = $j = 0;\n\t\t$arr2 = array();\n\n\t\t/* First pass, rawdata is splitted into raw blocks */\n\t\tforeach ( $arr1 as $v ) {\n\t\t\tif ( trim( $v ) == '' ) {\n\t\t\t\t++ $i;\n\t\t\t\t$j = 0;\n\t\t\t} else {\n\t\t\t\t$arr2[ $i ][ $j ++ ] = $v;\n\t\t\t}\n\t\t}\n\n\t\t/* Second pass, raw blocks are updated with their name/value pairs */\n\t\tforeach ( $arr2 as $k1 => $v1 ) {\n\t\t\t$i = 0;\n\t\t\t$decode = false;\n\t\t\tforeach ( $v1 as $v2 ) {\n\t\t\t\tif ( ereg( '::', $v2 ) ) { // base64 encoded, chunk start\n\t\t\t\t\t$decode = true;\n\t\t\t\t\t$arr = explode( ':', str_replace( '::', ':', $v2 ) );\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = base64_decode( $arr[1] );\n\t\t\t\t} elseif ( ereg( ':', $v2 ) ) {\n\t\t\t\t\t$decode = false;\n\t\t\t\t\t$arr = explode( ':', $v2 );\n\t\t\t\t\t$count = count( $arr );\n\t\t\t\t\tif ( $count != 2 ) {\n\t\t\t\t\t\tfor ( $i = $count - 1; $i > 1; -- $i ) {\n\t\t\t\t\t\t\t$arr[ $i - 1 ] .= ':' . $arr[ $i ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $arr[1];\n\t\t\t\t} else {\n\t\t\t\t\tif ( $decode ) { // base64 encoded, next chunk\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] .= base64_decode( $v2 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $v2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function parseAnnotations($str)\n {\n $annotations = [];\n preg_match_all($this->dataPattern, $str, $found);\n foreach ($found[2] as $key => $value) {\n $annotations[ $this->sanitizeKey($found[1][$key]) ][] = $this->parseValue(trim($value), $found[1][$key]);\n }\n\n return $annotations;\n }", "function xml2array($xml_string)\n {\n return \\Findforsikring\\Support\\Converters::xml2Array($xml_string);\n }", "abstract public function parse ();", "public function parse($text);", "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}", "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 }", "public function unserialize($string)\n {\n $result = array();\n parse_str($string, $result);\n\n return $result;\n }", "abstract public static function decode($string): array;", "public function parse( $contents );", "public function deserialize($strToken);", "private function parse(string $subject)\n {\n $result = [];\n\n preg_match_all('~[^\\[\\]]+|\\[(?<nested>(?R)*)\\]~', $subject, $matches);\n\n $matches = (array) $matches['nested'];\n\n foreach (array_filter($matches) as $match) {\n $item = [];\n $position = mb_strpos($match, '[');\n\n if (false !== $position) {\n $item['value'] = mb_substr($match, 0, $position);\n } else {\n $item['value'] = $match;\n }\n\n if ([] !== $children = $this->parse($match)) {\n $item['children'] = $children;\n }\n\n $result[] = $item;\n }\n\n return $result;\n }", "public abstract function parse($text);", "protected function parse($str) {\n return $this->fixture->parse(new StringInputSource($str));\n }", "public static function parsingToArray($string) {\n\n\t\t//remove punctuation\n\t\t\n\t\tforeach(WordsParser::$Punctuation as $pun)\n\t\t{\n\t\t\t$string = str_replace($pun, \" \", $string);\n\t\t}\n\t\t\n\t\t//remove newline,Tab, and double space.\n\t\t$string = str_replace(\"\\n\", \" \", $string);\n\t\t$string = str_replace(\"\\r\", \" \", $string);\n\t\t$string = str_replace(\" \", \" \", $string); \n\t\t$string = str_replace(\"\t\", \" \", $string);\n\t\t$arrtext = explode(\" \", $string);\n\t\tforeach($arrtext as $keyword)\n\t\t{\n\t\t\t$wordsArr[] = $keyword;\n\t\t}\n\t\t\n\t\treturn $wordsArr;\n\t}", "public function parse($data);", "public function parse($data);", "public function parse($data);", "function http_spreaker_parse($txt)\n{\n $needed_parts = array('nonce'=>1, 'username'=>1, 'timestamp'=>1, 'response'=>1);\n $data = array();\n $data = explode(\":\",$txt);\n $arrayReturn = array();\n if(count($needed_parts) != count($data)){\n \treturn false;\n }\n $i = 0;\n foreach($needed_parts as $key => $val){\n \t$arrayReturn[$key] = $data[$i];\n \t$i++;\n }\n return $arrayReturn;\n}", "public function parse(string $str): ?array;", "abstract protected function parse($data);", "private function oauth_parse_xml($xml_string) {\r\n $xml = simplexml_load_string($xml_string);\r\n $json = json_encode($xml);\r\n $array = json_decode($json, true);\r\n \r\n return $array;\r\n }", "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}", "public function parse() {\n\t\t$pointer = 0;\n\t\t$ar_line = array();\n\n\t\tforeach ($this->structure as $key => $length) {\n\t\t\t$ar_line[$key] = trim(substr($this->line, $pointer, $length), \"\\n\\r \");\n\t\t\t$pointer += $length;\n\t\t}\n\t\t$ar_line['stamp'] = md5(serialize($ar_line));\n\n\t\tif ($this->return == 'array') {\n\t\t\treturn $ar_line;\n\t\t}\n\t\treturn (object) $ar_line;\n\t}", "protected function processFrom(string $string): array\n {\n return \\json_decode($string, true);\n }", "public function deserializeAll(string $data);", "function _xmlToArray($rootTag, $sXml)\n\t{\n\t\t$aArray = array();\n\t\t$sXml = str_replace(\"<$rootTag>\",\"<$rootTag>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</$rootTag>\",\"</$rootTag>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<e>\",\"<e>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</e>\",\"</e>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<k>\",\"<k>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</k>\",\"|~|</k>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<v>\",\"<v>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</v>\",\"|~|</v>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<q>\",\"<q>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</q>\",\"|~|</q>|~|\",$sXml);\n\n\t\t$this->aObjArray = explode(\"|~|\",$sXml);\n\n\t\t$this->iPos = 0;\n\t\t$aArray = $this->_parseObjXml($rootTag);\n\n\t\tif ($this->bDecodeUTF8Input)\n\t\t{\n\t\t\tforeach ($aArray as $sKey => $sValue)\n\t\t\t{\n\t\t\t\t$aArray[$sKey] = $this->_decodeUTF8Data($sValue);\n\t\t\t}\n\t\t}\n\n\t\treturn $aArray;\n\t}", "protected function xml2array($xmlstring){\n\t\t$xml = simplexml_load_string($xmlstring, \"SimpleXMLElement\", LIBXML_NOCDATA);\n\t\t$jsonData = json_encode($xml);\n\t\treturn json_decode($jsonData, true);\n\t}", "public function parse($content);", "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 _loadDataText() {\r\n\t\treturn unserialize(file_get_contents($this->data_txt));\r\n\t}", "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}", "private function parse($contents) // {{{\n {\n $entries = array();\n preg_match_all(\"/@(\\\\w+?)\\\\{([^,]+?),(.*?)\\\\n\\\\s*?\\\\}\\\\s*?\\\\n/ms\", \n $contents, $entries, PREG_SET_ORDER);\n foreach ($entries as $entry)\n {\n $bibtex_type = $entry[1];\n $bibtex_name = $entry[2];\n $bibtex_contents = $entry[3].\",\\n\"; // Newline added so that all entries are followed by one\n preg_match_all(\"/(\\\\w+?)\\\\s*=\\\\s*\\\\{(.*?)\\\\},\\\\n/ms\", \n $bibtex_contents, $pairs, PREG_SET_ORDER);\n $params = array();\n foreach ($pairs as $pair)\n {\n $k = $pair[1];\n $v = $pair[2];\n $params[\"raw\"][$k] = Bibliography::unspace($v); // We keep the original BibTeX string in the \"raw\" subarray\n $params[$k] = Bibliography::removeBraces(\n Bibliography::replaceAccents(Bibliography::unspace($v)));\n }\n $params[\"bibtex_type\"] = $bibtex_type;\n $this->m_entries[$bibtex_name] = $params;\n }\n }", "function tokenText($str)\n{\n $matches = preg_split(\"/\\;\\s*\\\\$/uism\", $str);\n $object = array();\n foreach ($matches as $match) {\n preg_match(\"/\\\\$?(\\w+)\\:(.*)/uism\", trim($match), $_matches);\n $object[$_matches[1]] = rtrim($_matches[2], \";\");\n }\n return $object;\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 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 }", "protected function parse() {}", "protected function parse($string)\n {\n $this->setStringToBeParsed($string);\n\n // save for source map generation\n // $this->env->setFileContent($this->env->currentFileInfo->importedFile->getPath(), $this->input);\n\n $rules = $this->parsePrimary();\n // has the whole string been parsed?\n if ($this->position < $this->length) {\n throw new ILess_Exception_Parser(sprintf('There was an error while parsing the string. Near `%s`.',\n // FIXME: what about utf8?\n substr($this->input, $this->position, strpos($this->input, \"\\n\", $this->position) - $this->position)),\n null, $this->position, $this->env->currentFileInfo);\n }\n\n return $rules;\n }", "protected function parse($template) {\n return (new MustacheParser())->parse(new StringTokenizer($template));\n }", "private function parserString($producString){\n $arrayProduc = preg_split(\"/[\\t]/\", $producString);\n \n $initDate = $this->createDataTime($arrayProduc[3]);\n $expiryDate = $this->createDataTime($arrayProduc[4]);\n \n $producData = array(\n \"title\" => $arrayProduc[0],\n \"description\" => $arrayProduc[1],\n \"price\" => $arrayProduc[2],\n \"init\" => $initDate,\n \"expiry\" => $expiryDate,\n \"address\" => $arrayProduc[5],\n \"name\" => $arrayProduc[6],\n \"textOrigiin\" => $producString\n );\n \n return $producData;\n }", "public function parse($str)\r\n\t{\r\n\t\t$str = preg_replace('/[\\r\\n|\\r]/', \"\\n\", $str);\r\n\t\t$len = strlen($str);\r\n\t\t$tag_open = false;\r\n\t\t$tag_text = '';\r\n\t\t$tag = '';\r\n\t\t\r\n\t\t// set the document as the current tag.\r\n\t\t$this->current_tag = $this;\r\n\r\n\t\tfor($i=0; $i<$len; ++$i)\r\n\t\t{\r\n\t\t\tif($str[$i] === '[')\r\n\t\t\t{\r\n\t\t\t\tif($tag_open)\r\n\t\t\t\t\t$tag_text .= '[' . $tag;\r\n\t\t\t\t\r\n\t\t\t\t$tag_open = true;\r\n\t\t\t\t$tag = '';\r\n\t\t\t}\r\n\t\t\telse if($str[$i] === ']' && $tag_open)\r\n\t\t\t{\r\n\t\t\t\tif($tag !== '')\r\n\t\t\t\t{\r\n\t\t\t\t\t$bits = preg_split('/([ =])/', trim($tag), 2, PREG_SPLIT_DELIM_CAPTURE);\r\n\t\t\t\t\t$tag_attrs = (isset($bits[2]) ? $bits[1] . $bits[2] : '');\r\n\t\t\t\t\t$tag_closing = ($bits[0][0] === '/');\r\n\t\t\t\t\t$tag_name = ($bits[0][0] === '/' ? substr($bits[0], 1) : $bits[0]);\r\n\r\n\t\t\t\t\tif(isset($this->bbcodes[$tag_name]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->tag_text($tag_text);\r\n\t\t\t\t\t\t$tag_text = '';\r\n\r\n\t\t\t\t\t\tif($tag_closing)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(!$this->tag_close($tag_name))\r\n\t\t\t\t\t\t\t\t$tag_text = \"[{$tag}]\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(!$this->tag_open($tag_name, $this->parse_attribs($tag_attrs)))\r\n\t\t\t\t\t\t\t\t$tag_text = \"[{$tag}]\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$tag_text .= \"[{$tag}]\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$tag_text .= '[]';\r\n\t\t\t\t\r\n\t\t\t\t$tag_open = false;\r\n\t\t\t\t$tag = '';\r\n\t\t\t}\r\n\t\t\telse if($tag_open)\r\n\t\t\t\t$tag .= $str[$i];\r\n\t\t\telse\r\n\t\t\t\t$tag_text .= $str[$i];\r\n\t\t}\r\n\t\t\r\n\t\t$this->tag_text($tag_text);\r\n\r\n\t\tif($this->throw_errors && !$this->current_tag instanceof SBBCodeParser_Document)\r\n\t\t\tthrow new SBBCodeParser_MissingEndTagException(\"Missing closing tag for tag [{$this->current_tag->tag()}]\");\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function parse(string $text): array\n {\n $matches = [];\n preg_match_all($this->bitlyPattern, $text, $matches);\n return $matches[0];\n }", "public function parse(array $description);", "private function loadFromString($input) {\n\t//--\n\t$lines = explode(\"\\n\", (string)$input);\n\t//--\n\tforeach($lines as $k => $v) {\n\t\t$lines[$k] = (string) rtrim((string)$v, \"\\r\");\n\t} //end foreach\n\t//--\n\treturn (array) $lines;\n\t//--\n}", "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 getParsedInput();", "function wp_parse_str( $string, &$array ) {\n\tparse_str( $string, $array );\n\t$array = apply_filters( 'wp_parse_str', $array );\n}", "public function parseStringForCmsElementInfo($string);", "public function parseLogContent(string $content) : array;", "public function parseYamlToArray(): array\n {\n // Get the file contents\n $yaml = (file_get_contents($this->filePath));\n\n // Create an array of the lines in the yaml file\n $lines = explode(PHP_EOL, $yaml);\n\n // Initialize the array\n $array = [];\n\n // Loop through the lines\n foreach ($lines as $line) {\n // Check if the line matches the list format (space, space, dash, space)\n if (str_starts_with($line, \" - \")) {\n // Remove the list key from the line to just get the slug\n // and add it to the array. The index will be automatically\n // assigned by using $array[]\n $array[] = substr($line, 4);\n }\n }\n\n // Return the array\n return $array;\n }", "abstract public function parsePostData() : array;", "public function parse($input)\n {\n return [];\n }", "public function xmlToArray( $string )\n {\n\n $doc = new DOMDocument();\n $doc->loadXML( $string );\n $root = $doc->documentElement;\n\n return $this->DomNodeToArray( $root );\n }", "function unserialize($str)\n{\n}", "function parse_content($rawcontent){\n $content = explode(\"++++\", $rawcontent);\n //the defintion of the the title\n $metablock = $content[0];\n $rawmeta = explode(\"----\", $metablock);\n $meta = [];\n foreach ($rawmeta as $metaline) {\n //splits key from value\n $metaentry = explode(\":\", $metaline);\n //removes all spaces around the value\n $key = trim($metaentry[0]);\n $value = trim($metaentry[1]);\n $meta[$key] = $value;\n }\n //the splittet version: just the value\n $title = $meta[\"title\"];\n //the splittet text\n $text = $content[1];\n $result = compact(\"title\", \"text\", \"meta\");\n //returns the result\n return $result;\n}", "function getFormattedDataArray($str) {\n $replaced_str = str_replace(\"\\,\", \"&888;\", $str);\n $data_array = explode(\"\\n\", $replaced_str);\n array_pop($data_array);\n return $data_array;\n }", "protected static function parse_tag_string ($selector) {\n\t\t$attributes = [];\n\t\t/**\n\t\t * Attributes processing\n\t\t */\n\t\t$pos = mb_strpos($selector, '[');\n\t\tif ($pos !== false) {\n\t\t\t$regular_attributes = explode('][', mb_substr($selector, $pos + 1, -1));\n\t\t\t$selector = mb_substr($selector, 0, $pos);\n\t\t\tforeach ($regular_attributes as &$attr) {\n\t\t\t\t/**\n\t\t\t\t * For attribute without value we just put `true`, as this will be treated as boolean attribute\n\t\t\t\t */\n\t\t\t\t$attr = explode('=', $attr, 2);\n\t\t\t\t$attributes[$attr[0]] = isset($attr[1]) ? $attr[1] : true;\n\t\t\t}\n\t\t\tunset($regular_attributes, $attr);\n\t\t}\n\t\t/**\n\t\t * Classes processing\n\t\t */\n\t\t$pos = mb_strpos($selector, '.');\n\t\tif ($pos !== false) {\n\t\t\t$attributes['class'] = trim(str_replace('.', ' ', mb_substr($selector, $pos)));\n\t\t\t$selector = mb_substr($selector, 0, $pos);\n\t\t}\n\t\tunset($pos);\n\t\t/**\n\t\t * Id and tag determination\n\t\t */\n\t\t$selector = explode('#', $selector);\n\t\t$tag = $selector[0];\n\t\t/**\n\t\t * Convenient support of custom tags for Web Components\n\t\t *\n\t\t * Allows to write BananaHTML::custom_tag() that will be translated to <custom-tag></custom-tag>\n\t\t */\n\t\tif (isset($selector[1])) {\n\t\t\t$attributes['id'] = $selector[1];\n\t\t}\n\t\treturn [$tag, $attributes];\n\t}", "function xml_to_array($xml)\n {\n $xml = simplexml_load_string($xml, \"SimpleXMLElement\", LIBXML_NOCDATA);\n $root = $xml->getName();\n $data[\"$root\"] = json_decode(json_encode($xml), TRUE);\n\n return $data;\n }", "public function xmlToObject( $string )\n\t{\n\t\t$rows = array();\n\t\t$attr = array();\n\t\t$columns = array();\n\t\t$xml = simplexml_load_string( $string );\n\t\t$total = count( $xml->table->row );\n\n\t\tforeach ( $xml->table->columns as $column )\n\t\t{\n\t\t\tforeach ( $column as $key => $value)\n\t\t\t{\n\t\t\t\t$columns[(string) $value['name']] = (string) $value['display'];\n\t\t\t}\n\t\t}\n\t\t$rows['headers'] = $columns;\n\n\t\tfor( $i=0; $i < $total; $i++ )\n\t\t{\n\t\t\tforeach( $xml->table->row[$i]->attributes() as $name => $value )\n\t\t\t{\n\t\t\t\t$attr[(string) $name] = (string) $value;\n\t\t\t}\n\t\t\t$rows[] = (object) $attr;\n\t\t}\n\t\treturn $rows;\n\t}", "function http_digest_parse($txt)\n\t{\n\t\t// protect against missing data\n\t\t$needed_parts = array('nonce'=>1, 'nc'=>1, 'cnonce'=>1, 'qop'=>1, 'username'=>1, 'uri'=>1, 'response'=>1, 'realm'=>1);\n\t\t$data = array();\n\t\t$keys = implode('|', array_keys($needed_parts));\n\n\t\tpreg_match_all('@(' . $keys . ')=(?:([\\'\"])([^\\2]+?)\\2|([^\\s,]+))@', $txt, $matches, PREG_SET_ORDER);\n\n\t\tforeach ($matches as $m) {\n\t\t\t$data[$m[1]] = $m[3] ? $m[3] : $m[4];\n\t\t\tunset($needed_parts[$m[1]]);\n\t\t}\n\n\t\treturn $needed_parts ? false : $data;\n\t}", "function parseBISArray($str) {\n $str = substr($str, 1, -1); // Strip trailing quotes\n $bla = parseBISArray_helper($str);\n $result = array();\n\n foreach ($bla as $row) {\n foreach ($row as $child) {\n $result[] = $child;\n }\n if (count($row) == 0)\n $result[] = array();\n }\n //var_dump($result);\n return $result;\n}", "abstract public function parse($data, $type);", "public function decode($text)\n {\n $result = array();\n\n if (!empty($text)) {\n $xml = simplexml_load_string($text);\n if ($xml) {\n $this->convertXmlObjToArr($xml, $result);\n }\n }\n return $result;\n }", "private function unserializeInvoices($str) {\n\t\t$invoices = array();\n\t\t$temp = explode(\"|\", $str);\n\t\tforeach ($temp as $pair) {\n\t\t\t$pairs = explode(\"=\", $pair, 2);\n\t\t\tif (count($pairs) != 2)\n\t\t\t\tcontinue;\n\t\t\t$invoices[] = array('id' => $pairs[0], 'amount' => $pairs[1]);\n\t\t}\n\t\treturn $invoices;\n\t}", "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}", "public static function fromXml($string)\n {\n $xml = new \\SimpleXMLElement($string);\n\n $data = static::xmlToArray($xml);\n\n return static::decompile($data);\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}", "public static function parse($str)\n {\n $uri = new self($str);\n\n return array(\n $uri->driver,\n $uri->username,\n $uri->password,\n $uri->host,\n $uri->path,\n );\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}", "public function parseString($rawString)\n\t{\n\t\t$lines = explode(\"\\n\", trim((string) $rawString));\n\t\treturn $this->parseLines($lines);\n\t}", "abstract public function parseInput(array $input): array;", "function http_digest_parse($txt)\n{\n // protect against missing data\n $needed_parts = array('nonce'=>1, 'nc'=>1, 'cnonce'=>1, 'qop'=>1, 'username'=>1, 'uri'=>1, 'response'=>1);\n $data = array();\n\n preg_match_all('@(\\w+)=(?:([\\'\"])([^$2]+)$2|([^\\s,]+))@', $txt, $matches, PREG_SET_ORDER);\n \n foreach ($matches as $m) {\n $data[$m[1]] = $m[3] ? trim($m[3],\"\\\",'\") : trim($m[4],\"\\\",'\");\n unset($needed_parts[$m[1]]);\n }\n \n return $needed_parts ? false : $data;\n}", "public static function parseXML($xmlStr): array\n {\n /*Basic parsing using simplexml_load_string */ \n $xmlObj = simplexml_load_string($xmlStr);//SimpleXMLElement Object\n if(isset($xmlObj->link)){\n $item = ['name'=>$xmlObj->name, 'link'=>$xmlObj->link]; \n }else{\n $item = ['name'=>$xmlObj->name, 'link'=>''];\n }\n \n return $item;\n }", "public function parse(string $payload): array\n {\n if ($payload === '') {\n return [];\n }\n\n $format = $this->getFormat($payload);\n\n if ($format !== 'php' && \\is_file($payload)) {\n $payload = \\file_get_contents($payload);\n\n if ($payload === false) {\n throw new RuntimeException(\\sprintf('A error occurred during reading [%s].', $payload));\n }\n }\n\n return $this->getParser($format)->parse($payload);\n }", "public function parse($session_data){\n\t\t\n\t\tif ($session_data != '' && !is_array($session_data)){\n\t\t\treturn @unserialize($session_data);\n\t\t} else \n\t\t\treturn $session_data;\n\t\n\t}", "private function parseGrid($str){\n\t\t//TODO\n\t\treturn array();\n\t}", "abstract protected function parseContent($content = ''): array;", "public function decode(string $content): array;", "protected function _convertTagsStringToArray($tagName)\n {\n $tags = array();\n $tagNameArray = array_filter(explode(\"\\n\", preg_replace(\"/(\\'(.*?)\\')|(\\s+)/i\", \"$1\\n\", $tagName)), 'strlen');\n foreach ($tagNameArray as $key => $value) {\n $tags[$key] = trim($value, \" \\x22\\x27\");\n $tags[$key] = htmlspecialchars($tags[$key]);\n }\n return $tags;\n }", "public static function toArray($string)\n {\n return preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY);\n }" ]
[ "0.6193152", "0.58066905", "0.5773154", "0.5699143", "0.5625721", "0.5593281", "0.55290675", "0.54580534", "0.54580534", "0.5442852", "0.5442852", "0.5442852", "0.5442852", "0.54117453", "0.5340368", "0.5327414", "0.53221023", "0.53221023", "0.53221023", "0.5295252", "0.52804554", "0.526562", "0.522852", "0.52270454", "0.52254224", "0.52228045", "0.52221715", "0.5210501", "0.5207545", "0.52012545", "0.5193256", "0.5178708", "0.5149066", "0.51484877", "0.51269495", "0.5120165", "0.51088643", "0.51088643", "0.51088643", "0.50971895", "0.5086781", "0.50805444", "0.5078695", "0.50757205", "0.5064498", "0.50468785", "0.5013653", "0.50090885", "0.49819544", "0.49788654", "0.49768323", "0.49689478", "0.49343982", "0.4929378", "0.49203277", "0.49104434", "0.49006164", "0.48941383", "0.4889349", "0.48826045", "0.48791403", "0.48679307", "0.48541656", "0.48476037", "0.4841978", "0.48404866", "0.48400614", "0.48383754", "0.48311827", "0.4828858", "0.48128918", "0.48028556", "0.479383", "0.47913924", "0.47874093", "0.47827435", "0.47815332", "0.4776662", "0.47622788", "0.4759299", "0.47550362", "0.4746062", "0.47455382", "0.47419277", "0.4740108", "0.47366688", "0.47344932", "0.47285178", "0.47252497", "0.47092944", "0.4705899", "0.4705158", "0.46987742", "0.46966952", "0.46959603", "0.46934837", "0.4684411", "0.4681632", "0.46727836", "0.46712357", "0.46702117" ]
0.0
-1
Performs text modifications in order to normalize the TOML file for the parser. Kind of precompiler.
private static function normalize($toml) { // Cleanup EOL chars. $toml = str_replace(array("\r\n", "\n\r"), "\n", $toml); // Cleanup TABs $toml = str_replace("\t", " ", $toml); // Run, char by char. $normalized = ''; $openString = false; $openLString = false; $openMString = false; $openMLString = false; $openBrackets = 0; $openKeygroup = false; $lineBuffer = ''; $strLen = strlen($toml); for($i = 0; $i < $strLen; $i++) { $keep = true; if($toml[$i] == '[' && !$openString && !$openLString && !$openMString && !$openMLString) { // Keygroup or array definition start outside a string $openBrackets++; // Keygroup if($openBrackets == 1 && trim($lineBuffer) == '') { $openKeygroup = true; } } elseif($toml[$i] == ']' && !$openString && !$openLString && !$openMString && !$openMLString) { // Keygroup or array definition end outside a string if($openBrackets > 0) { $openBrackets--; if($openKeygroup) { $openKeygroup = false; } } else { throw new Exception("Unexpected ']' on: " . $lineBuffer); } } elseif($openBrackets > 0 && $toml[$i] == "\n") { // Multi-line keygroup definition is not alowed. if($openKeygroup) { throw new Exception('Multi-line keygroup definition is not allowed on: ' . $lineBuffer); } // EOLs inside array definition. We don't want them. $keep = false; } elseif(($openString || $openLString) && $toml[$i] == "\n") { // EOLs inside string should throw error. throw new Exception("Multi-line string not allowed on: " . $lineBuffer); } elseif($toml[$i] == '"' && $toml[$i - 1] != "\\" && !$openLString && !$openMLString) // String handling, allow escaped quotes. { // Check multi-line strings if(substr($toml, $i, 3) == '"""') { // Include the token inmediately. $i += 2; $normalized .= '"""'; $lineBuffer .= '"""';; $keep = false; $openMString = !$openMString; } elseif(!$openMString) // Simple strings { $openString = !$openString; } } elseif($toml[$i] == "'" && !$openString && !$openMString) // Literal string handling. { // Check multi-line strings if(substr($toml, $i, 3) == "'''") { // Include the token inmediately. $i += 2; $normalized .= "'''"; $lineBuffer .= "'''"; $keep = false; $openMLString = !$openMLString; } elseif(!$openMLString) // Simple strings { $openLString = !$openLString; } } elseif($toml[$i] == "\\" && $toml[$i-1] != "\\" && !in_array($toml[$i+1], array('b', 't', 'n', 'f', 'r', 'u', 'U', '"', "\\", ' '))) { // Reserved special characters inside strings should produce error if($openString) { throw new Exception('Reserved special characters inside strings are not allowed: ' . $toml[$i] . $toml[$i+1]); } // Cleanup escaped new lines and whitespaces from multi-line strings if($openMString) { while($toml[$i+1] == "\n" || $toml[$i+1] == " ") { $i++; $keep = false; } } } elseif($toml[$i] == '#' && !$openString && !$openKeygroup) { // Remove comments only at the end of the line. Doesn't catch comments inside array definition. while(isset($toml[$i]) && $toml[$i] != "\n") { $i++; } // Last char we know it's EOL. $keep = ($openBrackets == 0); } // Raw Lines if(isset($toml[$i])) { $lineBuffer .= $toml[$i]; if($toml[$i] == "\n") { $lineBuffer = ''; } if($keep) { $normalized .= $toml[$i]; } } } // Something went wrong. if($openBrackets) { throw new Exception('Syntax error found on TOML document. Missing closing bracket.'); } if($openString) { throw new Exception('Syntax error found on TOML document. Missing closing string delimiter.'); } if($openMString) { throw new Exception('Syntax error found on TOML document. Missing closing multi-line string delimiter.'); } if($openLString) { throw new Exception('Syntax error found on TOML document. Missing closing literal string delimiter.'); } if($openMLString) { throw new Exception('Syntax error found on TOML document. Missing closing multi-line literal string delimiter.'); } if($openKeygroup) { throw new Exception('Syntax error found on TOML document. Missing closing key group delimiter.'); } return $normalized; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reparse()\n\t{\n\t\t$for_edit = $this->generate_text_for_edit();\n\t\t$this->post_text = $for_edit['text'];\n\n\t\t// Emulate what happens when sent from the user\n\t\t$this->post_text = html_entity_decode($this->post_text);\n\t\tset_var($this->post_text, $this->post_text, 'string', true);\n\n\t\t$this->generate_text_for_storage($for_edit['allow_bbcode'], $for_edit['allow_urls'], $for_edit['allow_smilies']);\n\t}", "public static function pre_process() {}", "function pre_word() {\r\n\t\t//$this->code = preg_replace('/<ins\\s/is', '<ins stripme=\"y\" ', $this->code);\r\n\t\t//$this->code = str_replace('<span class=msoIns>', '<span stripme=\"y\">', $this->code);\r\n\t\tReTidy::non_DOM_deleteme('<style[^>]*? id=\"dynCom\"[^>]*?>');\r\n\t\tReTidy::non_DOM_deleteme('<script language=\"JavaScript\">');\r\n\t\tReTidy::non_DOM_stripme('<ins\\s[^>]*?>');\r\n\t\tReTidy::non_DOM_stripme('<span\\s+class=msoIns>');\r\n\t\tReTidy::non_DOM_stripme('<span\\s+class=msoDel>');\r\n\t\t$this->code = preg_replace('/<del\\s/is', '<del deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) class=msocomtxt/is', '<div$1 deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)class=MsoCommentReference>/is', '<span$1 deleteme=\"y\">', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)style=\\'[^\\']*?display\\s*:\\s*none[^\\']*?\\'/is', '<span$1 deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)style=\"[^\"]*?display\\s*:\\s*none[^\"]*?\\\"/is', '<span$1 deleteme=\"y\" ', $this->code);\r\n\t\t\r\n\t\t$this->code = preg_replace('/<(w:\\w+)[^<>]*?>(.*?)<\\/\\1>/is', '$2', $this->code); // will cause problems if there are nested tags with w: namespace\r\n\t\t\r\n\t//\t// microsoft classes to delete\r\n\t//\t$arrayMicrosoftClassesToDelete = array(\r\n\t//\t'msoIns',\r\n\t//\t'msoDel',\r\n\t//\t);\r\n\t//\tforeach($arrayMicrosoftClassesToDelete as $microsoftClass) {\r\n\t//\t\twhile(true) {\r\n\t//\t\t\t$this->code = preg_replace('/class=\"([^\"]*)' . ReTidy::preg_escape($microsoftClass) . '([^\"]*)\"/is', 'class=\"$1$2\"', $this->code, -1, $countA);\r\n\t//\t\t\t$this->code = str_replace(' class=' . ReTidy::preg_escape($microsoftClass), '', $this->code, $countB);\r\n\t//\t\t\tif($countA === 0 && $countB === 0) {\r\n\t//\t\t\t\tbreak;\r\n\t//\t\t\t}\t\t\t\t\r\n\t//\t\t}\r\n\t//\t}\r\n\t\t\r\n\t\t//$this->code = preg_replace('/\\n/', 'XXX\\n', $this->code);\r\n\t\t\r\n\t\t//<tr style='page-break-inside:avoid;height:11.25pt'> \r\n\t\t// <span lang=FR-CA style='font-size:9.0pt;font-family:\"Times New Roman\"; \r\n\t\t// color:black;layout-grid-mode:line'> \r\n\t\t// <td style='height:11.25pt;border:none' width=0 height=15></td> \r\n\t\t// </span> \r\n\t\t// </tr> \r\n\r\n\t\t// does this do anything?!?\r\n\t\t\r\n\t\t$this->code = str_replace('\r\n', ' \r\n', $this->code);\t\t\r\n\t}", "public function main()\n {\n $testSuitesDoc = new DOMDocument();\n $testSuitesDoc->load((string) $this->inFile);\n\n $this->fixDocument($testSuitesDoc);\n\n $this->transform($testSuitesDoc);\n }", "protected function compile() {\n if (TL_MODE == 'BE') {\n $this->genBeOutput();\n } else {\n $this->genFeOutput();\n }\n }", "public function compile()\n\t{\n\t\tif ($this->dirty() and $this->compile)\n\t\t{\n\t\t\t$compiler = new Compiler($this, $this->app);\n\t\t\t$this->contents = $compiler->run();\n\t\t}\n\t}", "private function applyTransformation() {\n if($this->transform !== NULL) {\n $xsl = new DOMDocument();\n $xsl->load($this->transform);\n $xslt = new XSLTProcessor();\n $xslt->importStyleSheet($xsl);\n $document = $xslt->transformToDoc($this->document);\n if ($document) {\n $xpath = new DOMXPath($document);\n // Set the Label\n $results = $xpath->query(\"*[local-name()='title']\");\n $results->item(0)->nodeValue = $this->label;\n // Set the Pid\n $results = $xpath->query(\"*[local-name()='identifier']\");\n $results->item(0)->nodeValue = $this->pid;\n if (isset($document->documentElement)) {\n return $this->importNode($document->documentElement, TRUE);\n }\n }\n }\n return NULL;\n }", "public function convert(): void\n {\n // go through files\n foreach ($this->getInFiles() as $file) {\n $bookmarks = $this->parse($file);\n // go through bookmarks\n foreach ($bookmarks as $name => $url) {\n // go through formats\n foreach ($this->formats as $format) {\n switch ($format) {\n case 'url':\n $contents = $this->urlContents($url);\n break;\n case 'webloc':\n $contents = $this->weblocContents($url);\n break;\n case 'desktop':\n $contents = $this->desktopContents($name, $url);\n break;\n default:\n // shouldn't be a case because of constructor validation\n break;\n }\n $this->writeFile($name, $format, $contents);\n }\n }\n }\n }", "public function apply($str)\n\t{\n\t\tif (extension_loaded('tidy') && class_exists('tidy'))\n\t\t{\n\t\t\t$config = array(\n\t\t\t\t'doctype' => 'strict',\n\t\t\t\t'drop-proprietary-attributes' => true,\n\t\t\t\t'drop-font-tags' => true,\n\t\t\t\t'escape-cdata' => true,\n\t\t\t\t'indent' => false,\n\t\t\t\t'join-classes' => false,\n\t\t\t\t'join-styles' => true,\n\t\t\t\t'lower-literals' => true,\n\t\t\t\t'output-xhtml' => true,\n\t\t\t\t'show-body-only' => true,\n\t\t\t\t'wrap' => 80\n\t\t\t);\n\t\t\t\n\t\t\t$str = '<p>tt</p>'.$str; // Fixes a big issue\n\t\t\t\n\t\t\t$tidy = new tidy;\n\t\t\t$tidy->parseString($str, $config, 'utf8');\n\t\t\t$tidy->cleanRepair();\n\t\t\t\n\t\t\t$str = (string) $tidy;\n\t\t\t\n\t\t\t$str = preg_replace('#^<p>tt</p>\\s?#','',$str);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$str = $this->miniTidy($str);\n\t\t}\n\t\t\n\t\t# Removing open comments, open CDATA and processing instructions\n\t\t$str = preg_replace('%<!--.*?-->%msu','',$str);\n\t\t$str = str_replace('<!--','',$str);\n\t\t$str = preg_replace('%<!\\[CDATA\\[.*?\\]\\]>%msu','',$str);\n\t\t$str = str_replace('<![CDATA[','',$str);\n\t\t\n\t\t# Transform processing instructions\n\t\t$str = str_replace('<?','&gt;?',$str);\n\t\t$str = str_replace('?>','?&lt;',$str);\n\t\t\n\t\t$str = html::decodeEntities($str,true);\n\t\t\n\t\t$this->content = '';\n\t\txml_parse($this->parser,'<all>'.$str.'</all>');\n\t\treturn $this->content;\n\t}", "public static function paragraphCorrectlyTransformedOnWayToDatabaseAndBackToRteProvider() {}", "protected function preprocessInternal()\n\t{\n\t\t// void\n\t}", "function post_process() {\n $this->_format_doc_comment();\n }", "public function convert()\n\t{\n\t\t$pattern1 = \"/\\/php>/siU\";\n\t\t$replace1 = \"/runphp>\";\n\t\t$pattern2 = \"/\\<php/siU\";\n\t\t$replace2 = \"<runphp\";\n\t\n\t\t$result1 = preg_replace($pattern1, $replace1, $this->content);\n\t\t$this->content = preg_replace($pattern2, $replace2, $result1);\n\t}", "public function convertData()\n {\n foreach ($this->dataToConvert as $node) {\n $title = $node->xpath('title');\n $fileMeta = $this->retrieveFileInfo($title);\n if (empty($fileMeta) || 201 == ($fileMeta['type']) || ($fileMeta['type']) <= 0) {\n $this->message(\"ignore slash: \" . $title . \": \" . json_encode($fileMeta));\n continue;\n }\n \n $text = $node->xpath('revision/text')[0];\n if (empty($text)) {\n continue;\n }\n\n if ($fileMeta['type'] == 3 || $fileMeta['type'] == 4 || $fileMeta['type'] == 7) {\n if (strlen($text) > 1024) {\n $this->saveFile($fileMeta, $text, \".wikitext\");\n } else {\n $this->message(\"Template: \" . json_encode($fileMeta) . \" -> \" . $text);\n }\n continue;\n } else if ($fileMeta['type'] == 200) {\n $draftpath = $this->output . \"Draft/\" . $fileMeta['filename'] . \".md\";\n @unlink($draftpath);\n }\n \n $text = $this->cleanText($text, $fileMeta);\n if (empty($text)) {\n $this->message(\"cleanText empty: \" . json_encode($fileMeta));\n continue;\n }\n\n if ($this->format === \"mediawiki\") {\n $this->saveFile($fileMeta, $text, \".wikitext\");\n continue;\n }\n\n try {\n $lang = getenv(\"WIKILANG\");\n $this->message(\"pandoc: {$fileMeta['filename']}: \");\n $errpath=$this->output . \"Errors/\" . $fileMeta['filename'];\n $procOpt = [];\n $procOpt[\"stdout\"] = $errpath . \".log\";\n $procOpt[\"stderr\"] = $errpath . \".err.log\";\n $procOpt[\"timeout\"] = 3;\n if ($lang == \"en\" || mb_strlen($text) > 16*1024) {\n $procOpt[\"timeout\"] = 6;\n }\n $this->pandocOptions[\"variable\"] = [\n \"\\\"cfmtitle={$fileMeta['title']}\\\"\",\n \"\\\"cfmurl={$fileMeta['url']}\\\"\",\n \"\\\"WIKILANG={$lang}\\\"\",\n \"\\\"stdout={$errpath}.log\\\"\"\n ];\n \n file_put_contents($errpath . \".wikitext\", $text);\n $this->runPandoc($text, $procOpt);\n $text = file_get_contents($procOpt[\"stdout\"]);\n @unlink($procOpt[\"stdout\"]);\n $stderr = file_get_contents($procOpt[\"stderr\"]);\n if (mb_strlen($stderr) > 0) {\n $this->message(\"Caught stderr {$fileMeta['filename']}: \", $stderr);\n } else {\n @unlink($procOpt[\"stderr\"]);\n }\n if (empty($text)) {\n continue;\n }\n @unlink($errpath . \".wikitext\");\n } catch (\\Throwable $e) {\n $errmsg=$e->getMessage();\n $this->message(\"Caught exception {$fileMeta['filename']}: \", $errmsg);\n continue;\n }\n $text .= $this->getMetaData($fileMeta);\n $this->saveFile($fileMeta, $text);\n $this->counter++;\n }\n }", "protected function updateRootLinesWithTranslations() {}", "function parse()\n {\n $params=$this->layoutManager->getPluginParams(\"L\");\n $tLang=$params[\"lang\"];\n $el=$this->getSubElements();\n $id=$el[\"ID\"][\"text\"];\n $textNode=$el[\"C\"][\"node\"];\n $layoutContents=$textNode->contents;\n $nContents=count($layoutContents);\n if($nContents==0)\n return;\n\n $curVar=1;\n $phpCode=array();\n $newContents=array();\n $currentNode=array(\"TYPE\"=>\"HTML\",\"TEXT\"=>\"\");\n $newContents[]=$currentNode;\n /* Supongamos una lista de layoutContents del tipo HTML - PHP - HTML : ej: a <?php echo \"p\";?> b\n * Para buscar la traduccion, hay que actuar como si fuera 1 solo layoutContent de tipo a %1 b\n * Por eso, el resultado debe ser 1 solo layoutcontent de tipo HTML, aunque dentro, contenga codigo php.\n * \n */\n $html=\"\";\n for($k=0;$k<$nContents;$k++)\n { \n if($layoutContents[$k][\"TYPE\"]==\"HTML\")\n {\n $html.=$layoutContents[$k][\"TEXT\"];\n }\n else\n {\n if($layoutContents[$k][\"TYPE\"]==\"PHP\")\n {\n $html.=\"{%\".$curVar.\"}\";\n $phpCode[$curVar]=$layoutContents[$k][\"TEXT\"];\n $curVar++;\n }\n else\n {\n // Se traduce el nodo HTML actual\n $currentNode[\"TEXT\"]=$this->parseTranslation($tLang,$id,$phpCode,$html);\n // Se copia el nodo que hemos encontrado, tal cual (no es ni PHP ni HTML)\n $newContents[]=$layoutContents[$k];\n // Se crea el siguiente nodo HTML.\n $currentNode=array(\"TYPE\"=>\"HTML\",\"TEXT\"=>\"\");\n $newContents[]=$currentNode;\n $html=\"\";\n $phpCode=array();\n $curVar=1;\n }\n \n }\n } \n // Al llegar aqui, nos queda el ultimo nodo HTML creado.Hay que parsearlo.\n $currentNode[\"TEXT\"]=$this->parseTranslation($tLang,$id,$phpCode,$html);\n return $newContents;\n }", "public function parse($tokens)\n {\n $parents = array();\n\n // flag : are we in a <pre> Tag ?\n $this->tagPreIn = false;\n\n /**\n * all the actions to do\n * @var Node[] $actions\n */\n $actions = array();\n\n // get the actions from the html tokens\n foreach ($tokens as $token) {\n if ($token->getType() === 'code') {\n $actions = array_merge($actions, $this->getTagAction($token, $parents));\n } elseif ($token->getType() === 'txt') {\n $actions = array_merge($actions, $this->getTextAction($token));\n }\n }\n\n // for each identified action, we have to clean up the begin and the end of the texte\n // based on tags that surround it\n\n // list of the tags to clean\n $tagsToClean = array(\n 'page', 'page_header', 'page_footer', 'form',\n 'table', 'thead', 'tfoot', 'tr', 'td', 'th', 'br',\n 'div', 'hr', 'p', 'ul', 'ol', 'li',\n 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',\n 'bookmark', 'fieldset', 'legend',\n 'draw', 'circle', 'ellipse', 'path', 'rect', 'line', 'g', 'polygon', 'polyline',\n 'option'\n );\n\n // foreach action\n $nb = count($actions);\n for ($k = 0; $k < $nb; $k++) {\n // if it is a Text\n if ($actions[$k]->getName() === 'write') {\n // if the tag before the text is a tag to clean => ltrim on the text\n if ($k>0 && in_array($actions[$k - 1]->getName(), $tagsToClean)) {\n $actions[$k]->setParam('txt', ltrim($actions[$k]->getParam('txt')));\n }\n\n // if the tag after the text is a tag to clean => rtrim on the text\n if ($k < $nb - 1 && in_array($actions[$k + 1]->getName(), $tagsToClean)) {\n $actions[$k]->setParam('txt', rtrim($actions[$k]->getParam('txt')));\n }\n\n // if the text is empty => remove the action\n if (!strlen($actions[$k]->getParam('txt'))) {\n unset($actions[$k]);\n }\n }\n }\n\n // if we are not on the level 0 => HTML validator ERROR\n if (count($parents)) {\n if (count($parents)>1) {\n $errorMsg = 'The following tags have not been closed:';\n } else {\n $errorMsg = 'The following tag has not been closed:';\n }\n\n $e = new HtmlParsingException($errorMsg.' '.implode(', ', $parents));\n $e->setInvalidTag($parents[0]);\n throw $e;\n }\n\n $this->verifyMustContain($actions, 'thead', 'tr');\n $this->verifyMustContain($actions, 'tfoot', 'tr');\n\n // save the actions to do\n $this->code = array_values($actions);\n }", "public function run()\n {\n $this->loadTextFile($this->text_file);\n }", "public function processTransformationRules()\n {\n $rulesText = '';\n\n #-----------------------------------------------------------------------------\n # If auto-generated rules were specified, generate the rules,\n # otherwise, get the from the configuration\n #-----------------------------------------------------------------------------\n if ($this->configuration->getTransformRulesSource() === Configuration::TRANSFORM_RULES_DEFAULT) {\n $rulesText = $this->autoGenerateRules();\n } else {\n $rulesText = $this->configuration->getTransformationRules();\n }\n \n $tablePrefix = $this->configuration->getTablePrefix();\n $schemaGenerator = new SchemaGenerator($this->dataProject, $this->configuration, $this->logger);\n\n list($schema, $parseResult) = $schemaGenerator->generateSchema($rulesText);\n\n ###print \"\\n\".($schema->toString()).\"\\n\";\n\n $this->schema = $schema;\n\n return $parseResult;\n }", "protected function compile()\n\t{\n\n\t\t$this->Template->tweetcontainer = $this->html;\n\n\t}", "protected function compile()\n\t{\n\t\tif (TL_MODE == 'BE')\n\t\t{\n\t\t\t$this->strTemplate = 'be_wildcard';\n\t\t\t$this->Template = new \\BackendTemplate($this->strTemplate);\n\t\t}\n\t}", "public function sanitizeFreeText()\n {\n if ($this->locations) {\n foreach ($this->locations as $id => $loc) {\n $loc->sanitizeFreeText();\n }\n }\n if ($this->virtualLocations) {\n foreach ($this->virtualLocations as $id => $loc) {\n $loc->sanitizeFreeText();\n }\n }\n if ($this->links) {\n foreach ($this->links as $id => $lin) {\n $lin->sanitizeFreeText();\n }\n }\n if ($this->recurrenceOverrides) {\n foreach ($this->recurrenceOverrides as $id => $rec) {\n $rec->sanitizeFreeText();\n }\n }\n\n $this->title = AdapterUtil::reencode($this->title);\n $this->description = AdapterUtil::reencode($this->description);\n $this->keywords = AdapterUtil::reencode($this->keywords);\n }", "public function transform(){\r\n\t\tswitch($this->processor){\r\n\t\t\tcase 'saxon':\r\n\t\t\t\t$this->runSaxon();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'salbotron':\r\n\t\t\tdefault:\r\n\t\t\t\t$this->runSalbatron();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "protected function preProcess() {}", "function run() {\n $paragraph_fields = getParagraphsFields();\n\n foreach ($paragraph_fields as $paragraph_field) {\n $parent_type = $paragraph_field->parent_type;\n $parent_field_name = $paragraph_field->parent_field_name;\n\n // We only care about cloned nodes right now, because nested paragraphs\n // should clone cleanly by default.\n if ($parent_type !== 'node') {\n logMessage(\"Not processing parent_type $parent_type, field $parent_field_name...\");\n continue;\n }\n\n $rows = getMultiplyParentedParagraphFieldRows($parent_type, $parent_field_name);\n foreach ($rows as $target_id => $row) {\n $parent_ids = $row->parent_ids;\n $parent_count = count($parent_ids);\n\n if ($parent_count > 0) {\n $parent_list = implode(', ', $parent_ids);\n logMessage(\"Paragraph #{$target_id} has {$parent_count} parents: {$parent_list}\");\n // We can leave this paragraph with its original parent,\n // but we wanna give clones to its other parents.\n $cloned_parent_ids = array_slice($parent_ids, 0, 1);\n if (!empty($cloned_parent_ids)) {\n repairParagraph($parent_type, $parent_field_name, (int) $cloned_parent_ids[0], (int) $target_id);\n }\n }\n }\n\n }\n}", "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 }", "public static function paragraphCorrectlyTransformedOnWayToDatabaseProvider() {}", "public function pre($t);", "public function process_text($text)\n {\n $new_text = $text;\n\n // Clean for the Lex Parser\n $new_text = $this->clean_text($new_text);\n // Parse\n $new_text = $this->parse_text($new_text);\n\n return $new_text;\n }", "public function preProcess();", "public function preProcess();", "function _parseSetup()\n\t{\n\t\t// =============================================================\n\t\t//\n\t\t// Build and configure the basic Text_Wiki object\n\t\t//\n\t\t\n\t\t// grab a rule set, if one is specified\n\t\t$rules = Yawp::getConfElem('Text_Wiki', 'rule');\n\t\tif ($rules) {\n\t\t\tsettype($rules, 'array');\n\t\t\tforeach ($rules as $key => $val) {\n\t\t\t\t// trim and force an inital upper-case character\n\t\t\t\t$rules[$key] = trim(ucwords(strtolower($val)));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// base Text_Wiki object\n\t\t$this->parse =& new Text_Wiki($rules);\n\t\t\n\t\t// parse paths; reverse them because we want the first listed to be\n\t\t// the first searched.\n\t\t$tmp = Yawp::getConfElem('Text_Wiki_Parse', 'path', array());\n\t\tsettype($tmp, 'array');\n\t\t$tmp = array_reverse($tmp);\n\t\tforeach ($tmp as $dir) {\n\t\t\t$this->parse->addPath('parse', $dir);\n\t\t}\n\t\t\n\t\t// render paths; reverse them because we want the first listed to be\n\t\t// the first searched.\n\t\t$tmp = Yawp::getConfElem('Text_Wiki_Render', 'path', array());\n\t\tsettype($tmp, 'array');\n\t\t$tmp = array_reverse($tmp);\n\t\tforeach ($tmp as $dir) {\n\t\t\t$this->parse->addPath('render', $dir);\n\t\t}\n\t\t\n\t\t// enable rules\n\t\t$tmp = Yawp::getConfElem('Text_Wiki', 'enable');\n\t\tsettype($tmp, 'array');\n\t\tforeach ($tmp as $rule) {\n\t\t\t$rule = trim(ucwords(strtolower($rule)));\n\t\t\t$this->parse->enableRule($rule);\n\t\t}\n\t\t\n\t\t// disable rules\n\t\t$tmp = Yawp::getConfElem('Text_Wiki', 'disable');\n\t\tsettype($tmp, 'array');\n\t\tforeach ($tmp as $rule) {\n\t\t\t$rule = trim(ucwords(strtolower($rule)));\n\t\t\t$this->parse->disableRule($rule);\n\t\t}\n\t\t\n\t\t// get the XHTML format configs\n\t\tforeach (Yawp::getConfGroup('Text_Wiki_Render_Xhtml') as $key => $val) {\n\t\t\t$this->parse->setFormatConf('Xhtml', $key, $val);\n\t\t}\n\t\t\n\t\t// loop through all rules in the set,\n\t\t// grab the parse and render configs for each rule,\n\t\t// and apply them.\n\t\tforeach ($this->parse->rules as $rule) {\n\t\t\t\n\t\t\t// parse config\n\t\t\t$tmp = Yawp::getConfGroup(\"Text_Wiki_Parse_$rule\");\n\t\t\tforeach ($tmp as $key => $val) {\n\t\t\t\t$this->parse->setParseConf($rule, $key, $val);\n\t\t\t}\n\t\t\t\n\t\t\t// render config\n\t\t\t$tmp = Yawp::getConfGroup(\"Text_Wiki_Render_Xhtml_$rule\");\n\t\t\tforeach ($tmp as $key => $val) {\n\t\t\t\t$this->parse->setRenderConf('Xhtml', $rule, $key, $val);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// =============================================================\n\t\t//\n\t\t// Override the basic config with YaWiki specifics\n\t\t//\n\t\t\n\t\t// -------------------------------------------------------------\n\t\t//\n\t\t// pages in the wiki for intra-links\n\t\t//\n\t\t\n\t\t$pageList = $this->store->getPageList($this->area);\n\t\t$this->parse->setRenderConf('Xhtml', 'Wikilink', 'pages', $pageList);\n\t\t$this->parse->setRenderConf('Xhtml', 'Freelink', 'pages', $pageList);\n\t\t\n\t\t// -------------------------------------------------------------\n\t\t// \n\t\t// are we running single- or multi-area? build the view_url and\n\t\t// new_url links respectively.\n\t\t//\n\t\t\n\t\tif ($this->conf['only_area']) {\n\t\t\t// single-area links\n\t\t\t$view_url = 'index.php?page=%s';\n\t\t\t$new_url = 'edit.php?page=%s';\n\t\t} else {\n\t\t\t// multi-area\n\t\t\tif ($this->conf['default_mod_rewrite_area'] == $this->area) {\n\t\t\t\t$view_url = $this->conf['absolute_url'].\"%s\";\n\t\t\t} else {\n\t\t\t\t$view_url = $this->conf['absolute_url'].\"{$this->area}/%s\";\n\t\t\t}\n\t\t\t$new_url = $this->conf['absolute_url'].\"edit.php?area={$this->area}&page=%s\";\n\t\t}\n\t\t\n\t\t$this->parse->setRenderConf('Xhtml', 'Wikilink', 'view_url', $view_url);\n\t\t$this->parse->setRenderConf('Xhtml', 'Wikilink', 'new_url', $new_url);\n\t\t\n\t\t$this->parse->setRenderConf('Xhtml', 'Freelink', 'view_url', $view_url);\n\t\t$this->parse->setRenderConf('Xhtml', 'Freelink', 'new_url', $new_url);\n\t\t\n\t\t\n\t\t// -------------------------------------------------------------\n\t\t//\n\t\t// build InterWiki sites list\n\t\t//\n\t\t\n\t\t// what's in the parser right now\n\t\t$sites = $this->parse->getRenderConf('Xhtml', 'Interwiki', 'sites');\n\t\t\n\t\t// add [yawiki] interwiki_site configs\n\t\tif (isset($this->conf['interwiki_site'])) {\n\t\t\tsettype($this->conf['interwiki_site'], 'array');\n\t\t\tforeach ($this->conf['interwiki_site'] as $val) {\n\t\t\t\t$tmp = explode(',', $val);\n\t\t\t\t$sites[trim($tmp[0])] = trim($tmp[1]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// add other local areas from the store if we are multi-area\n\t\tif (! $this->conf['only_area']) {\n\t\t\tforeach (array_keys($this->areaInfo) as $val) {\n\t\t\t\t$sites[$val] = \"index.php?area=$val&page=%s\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t// send back to the parser\n\t\t$this->parse->setRenderConf('Xhtml', 'Interwiki', 'sites', $sites);\n\t}", "protected function process($fromText, $toText)\n {\n // Lets get parsing\n $delimiters = $this->granularity[$this->stackPointer++];\n $hasNextStage = $this->stackPointer < count($this->granularity);\n\n // Actually perform diff\n $diff = $this->diff($fromText, $toText, $delimiters);\n $diff = is_array($diff) ? $diff : [];\n\n foreach ($diff as $fragment) {\n // increase granularity\n if ($fragment instanceof Replace && $hasNextStage) {\n $this->process(\n mb_substr($this->formText, $this->fromOffset, $fragment->getFromLen()),\n $fragment->getText()\n );\n } elseif ($fragment instanceof Copy && $this->lastEdit instanceof Copy) {\n // fuse copy ops whenever possible\n $this->edits[count($this->edits)-1]->increase($fragment->getFromLen());\n $this->fromOffset += $fragment->getFromLen();\n } else {\n $this->edits[] = $this->lastEdit = $fragment;\n $this->fromOffset += $fragment->getFromLen();\n }\n }\n\n $this->stackPointer--;\n }", "function __setTidyConfig() \n { \n if($this->_options[\"IsWord\"]){ \n $this->_tidy_config['word-2000'] = true; \n $this->_tidy_config['drop-proprietary-attributes'] = true; \n } \n else { \n $this->_tidy_config['word-2000'] = false; \n } \n if($this->_options[\"OutputXHTML\"]) { \n $this->_options[\"UseTidy\"] = true; \n $this->_tidy_config['output-xhtml'] = true; \n } \n else { \n $this->_tidy_config['output-xhtml'] = false; \n } \n }", "public function get_modified_content() {\n // First of all, get the contents\n $content = $this->get_content();\n\n $ast = $this->ast ?? null;\n\n // Check if has any traverser instruction\n if (!empty($this->node_instructions)) {\n // Prepare the traverser\n $this->apply_node_instructions();\n }\n\n // Check if any traverser was created\n if (!empty($this->traverser)) {\n // Let the traverser perform\n $ast = $this->traverser->traverse($this->get_ast());\n }\n\n // Check if the AST was created\n if (!empty($ast)) {\n // Convert it back to PHP\n $pretty_printer = new \\PhpParser\\PrettyPrinter\\Standard();\n $content = $pretty_printer->printFormatPreserving($ast, $this->ast, $this->tokens);\n\n // Fix some buggy issues with the format preserving\n $content = preg_replace(\"/(function .+?)\\n.+\\{/m\", '$1 {', $content);\n }\n\n return $content;\n }", "function transform($text, $page = null)\n\t{\n\t\tif (strtolower($page) == 'areamap') {\n\t\t\t$html = $this->_transformAreaMap($text);\n\t\t} else {\n\t\t\t$html = $this->parse->transform($text);\n\t\t}\n\t\t\n\t\treturn $html;\n\t}", "public function transform(ProjectDescriptor $project, Transformation $transformation) : void\n {\n $artifact = $transformation->getTransformer()->getTarget()\n . DIRECTORY_SEPARATOR\n . ($transformation->getArtifact()\n ?: 'source');\n\n /** @var FileDescriptor $file */\n foreach ($project->getFiles() as $file) {\n $filename = $file->getPath();\n $source = $file->getSource();\n\n $root = str_repeat('../', substr_count($filename, DIRECTORY_SEPARATOR) + 1);\n $path = $artifact . DIRECTORY_SEPARATOR . $filename;\n if (!file_exists(dirname($path))) {\n mkdir(dirname($path), 0755, true);\n }\n\n $source = htmlentities($source);\n file_put_contents(\n $path . '.html',\n <<<HTML\n<html>\n <head>\n <script\n type=\"text/javascript\"\n src=\"{$root}js/jquery-1.4.2.min.js\">\n </script>\n <script\n type=\"text/javascript\"\n src=\"{$root}syntax_highlighter/scripts/shCore.js\">\n </script>\n <script\n type=\"text/javascript\"\n src=\"{$root}syntax_highlighter/scripts/shBrushJScript.js\">\n </script>\n <script\n type=\"text/javascript\"\n src=\"{$root}syntax_highlighter/scripts/shBrushPhp.js\">\n </script>\n <script\n type=\"text/javascript\"\n src=\"{$root}syntax_highlighter/scripts/shBrushXml.js\">\n </script>\n <link\n href=\"{$root}syntax_highlighter/styles/shCore.css\" rel=\"stylesheet\"\n type=\"text/css\"\n />\n <link\n href=\"{$root}syntax_highlighter/styles/shCoreEclipse.css\"\n rel=\"stylesheet\" type=\"text/css\"\n />\n <link\n href=\"{$root}syntax_highlighter/styles/shThemeWordpress.css\"\n rel=\"stylesheet\" type=\"text/css\"\n />\n </head>\n <body>\n <pre class=\"brush: php\">${source}</pre>\n <script type=\"text/javascript\">\n SyntaxHighlighter.all();\n jQuery('.gutter div').each(function(key, data){\n jQuery(data).prepend('<a name=\"L'+jQuery(data).text()+'\"/>');\n });\n </script>\n </body>\n</html>\nHTML\n );\n }\n }", "public function compile(Compiler $compiler): void\n {\n // Echo line information into the generated code\n $compiler->addDebugInfo($this);\n\n // If there are no prefix and postfix set, usage\n // of this tag is useless and we just display the\n // contents\n if ($this->getAttribute('prefix') || $this->getAttribute('postfix')) {\n $this->compileComplex($compiler);\n } else {\n $compiler->subcompile($this->getNode('lines'));\n }\n }", "public function compile(\\DOMText $node, DataObject $processedObject);", "private function cleanUp() : void\n {\n\n // For every line.\n foreach ($this->contents as $lineId => $line) {\n\n // Test.\n preg_match('/( +)(\\*)( )(.+)/', $line, $output);\n\n // First option - this is proper comment line.\n // Second option - sth is wrong - ignore this line.\n if (isset($output[4]) === true && empty($output[4]) === false) {\n $this->contents[$lineId] = $output[4];\n } else {\n unset($this->contents[$lineId]);\n }\n }\n }", "protected function cleanup()\n {\n $this->internalInliner->setHTML('');\n $this->internalInliner->setCSS('');\n }", "function preProcess()\n {\t\n parent::preProcess( );\n\t\t \n\t}", "function parse($text)\n {\n // set the object property for the source text\n $this->source = $text;\n \n // reset the tokens.\n $this->tokens = array();\n \n // apply the parse() method of each requested rule to the source\n // text.\n foreach ($this->rules as $name) {\n // do not parse the rules listed in $disable\n if (! in_array($name, $this->disable)) {\n \n // load the parsing object\n $this->loadParseObj($name);\n \n // load may have failed; only parse if\n // an object is in the array now\n if (is_object($this->parseObj[$name])) {\n $this->parseObj[$name]->parse();\n }\n }\n }\n }", "public function process(): void {\n if($this->shouldCache() && $this->hasCache()) {\n $this->restoreCache();\n\n return;\n }\n\n $folders = [];\n foreach($this->sources_to_parse as $source_to_parse) {\n $folder = $source_to_parse->getFolderToParse();\n if(!isset($folders[$folder])) {\n $folders[$folder] = [\n 'extensions' => [],\n 'flags' => [],\n ];\n }\n $folders[$folder]['extensions'] = [...$folders[$folder]['extensions'], ...$source_to_parse->getExtensions()];\n $folders[$folder]['flags'] = [...$folders[$folder]['flags'], ...$source_to_parse->getFlags()];\n }\n\n foreach($folders as $folder => $folder_sources) {\n $folder_sources['extensions'] = array_values(array_unique($folder_sources['extensions']));\n $folder_sources['flags'] = array_values(array_unique($folder_sources['flags']));\n $code_data = $this->analyzer->parseFolder($folder, $folder_sources);\n $this->info_data[] = $code_data;\n $i = count($this->info_data) - 1;\n foreach($folder_sources['flags'] as $flag) {\n if(!isset($this->info_data_flag_refs[$flag])) {\n $this->info_data_flag_refs[$flag] = [];\n }\n $this->info_data_flag_refs[$flag][] = $i;\n }\n $this->flags = [...$this->flags, ...$folder_sources['flags']];\n }\n $this->flags = array_values(array_unique($this->flags));\n\n if($this->shouldCache()) {\n file_put_contents(\n $this->file_cache,\n \"<?php\\n\\nreturn \" .\n var_export([\n 'info_data' => $this->info_data,\n 'info_data_flag_refs' => $this->info_data_flag_refs,\n ], true) . ';',\n );\n }\n }", "public function cleanText($text, $fileMeta)\n {\n $callback = new cleanLink($this->flatten, $fileMeta);\n $callbackFix = new pandocFix();\n\n // decode inline html\n $text = html_entity_decode($text);\n\n if (mb_strpos($text, \"#\") === 0) {\n $ext=\".md\";\n $target=\"\";\n if (mb_stripos($text, \"#REDIRECT\") === 0) {\n $target = mb_substr($text, mb_strlen(\"#REDIRECT\"));\n } else if (mb_strpos($text, \"#重定向\") === 0) {\n $target = mb_substr($text, mb_strlen(\"#重定向\"));\n }\n\n $fileName = $fileMeta['filename'] . $ext;\n if (mb_strlen($target) > 4) {\n if ($fileMeta['type']<200) {\n $source = $fileMeta['directory'] . $fileName;\n unlink($source);\n file_put_contents(\n $this->output . \"Redirect/\" . $this->dataVersion . \".tsv\",\n $source . \"\\t\" . $target . \"\\n\",\n FILE_APPEND);\n return null;\n }\n $matches = [];\n preg_match('/\\[\\[(.*)\\]\\]/', $target, $matches, PREG_OFFSET_CAPTURE);\n if (count($matches)>1) {\n $dir=\"Page\";\n $mobj=$matches[1];\n if ($this->format === \"mediawiki\") {\n $dir = mb_substr($mobj[0],0,1);\n $ext = \".wikitext\";\n }\n $targetName = str_replace(' ', '_', $mobj[0]);\n $targetFile = $dir . \"/\" . $targetName . $ext;\n if ($fileMeta['type']>=200 && file_exists($this->output . $targetFile)) {\n $this->message(\"Redirect: \" . $fileMeta['filename'] . \" -> \" . $targetFile);\n if (array_key_exists($fileName, $this->outputTree['Redirect'])) {\n unlink($this->output . \"Redirect/\" . $fileName);\n }\n if (getenv(\"WIKILANG\") == \"en\") {\n $this->mapping(\n $this->output . \"Redirect/\" . mb_substr($fileName, 0, 1) . \".json\",\n $fileMeta['filename'],\n $targetName \n );\n } else {\n symlink(\"../\" . $targetFile, $this->output . \"Redirect/\" . $fileName);\n }\n } else {\n $this->message(\"Redirect target not exists: \" . $text . $targetFile);\n }\n\n $lagacyFile = $this->output . $dir . $fileName;\n if ($this->outputTree[$dir] && array_key_exists($fileName, $this->outputTree[$dir]) && filesize($lagacyFile) < 2048) {\n @unlink($lagacyFile);\n $this->message(\"Delete lagacy page: \" . $lagacyFile);\n } else {\n $this->message(\"Skip lagacy page: \", $lagacyFile);\n }\n return null;\n }\n }\n $this->message(\"Ignroe redirect: \" . $text);\n return null;\n }\n \n $pageMinSize=1024;\n if (getenv(\"WIKILANG\") == \"en\") {\n $pageMinSize*=16;\n }\n if (mb_strlen($text) < $pageMinSize) {\n $lagacyFile = $this->output . $fileMeta['directory'] . $fileMeta['filename'] . \".md\";\n if (@filesize($lagacyFile) < 2048) {\n @unlink($lagacyFile);\n }\n $this->message(\"Delete short page: \", $lagacyFile);\n return null;\n }\n \n // Hack to fix URLs for older version of pandoc\n if ($this->pandocBroken) {\n $text = preg_replace_callback('/\\[(http.+?)\\]/', [$callbackFix, 'urlFix'], $text);\n }\n\n // clean up links\n $text = preg_replace_callback('/\\[\\[(.+?)\\]\\]/', [$callback, \"cleanLink\"], $text);\n // remove comments\n return preg_replace('/<!--(.|\\s)*?-->/', '', $text);\n }", "private function _replaceElementTexts()\n {\n $collection = $this->_record;\n // If this option is set, it will loop through the $elementTexts provided,\n // find each one and manually update it (provided it exists).\n // The rest of the element texts will get added as per usual.\n foreach ($this->_elementTexts as $elementSetName => $textArray) {\n foreach ($textArray as $elementName => $elementTextSet) {\n $etRecordSet = $collection->getElementTexts($elementSetName, $elementName);\n foreach ($elementTextSet as $elementTextIndex => $textAttr) {\n // If we have an existing ElementText record, use that\n // instead of adding a new one.\n if (array_key_exists($elementTextIndex, $etRecordSet)) {\n $etRecord = $etRecordSet[$elementTextIndex];\n $etRecord->text = $textAttr['text'];\n $etRecord->html = $textAttr['html'];\n $etRecord->save();\n } else {\n // Otherwise we should just append the new text to the\n // pre-existing ones.\n $elementRecord = $collection->getElement($elementSetName, $elementName);\n $collection->addTextForElement($elementRecord, $textAttr['text'], $textAttr['html']);\n }\n }\n }\n }\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}", "protected function generate()\n {\n // first of all we will get the version, so we will later know about changes made DURING indexing\n $this->version = $this->findVersion();\n\n // get the iterator over our project files and create a regex iterator to filter what we got\n $recursiveIterator = $this->getProjectIterator();\n $regexIterator = new \\RegexIterator($recursiveIterator, '/^.+\\.php$/i', \\RecursiveRegexIterator::GET_MATCH);\n\n // get the list of enforced files\n $enforcedFiles= $this->getEnforcedFiles();\n\n // if we got namespaces which are omitted from enforcement we have to mark them as such\n $omittedNamespaces = array();\n if ($this->config->hasValue('enforcement/omit')) {\n $omittedNamespaces = $this->config->getValue('enforcement/omit');\n }\n\n // iterator over our project files and add array based structure representations\n foreach ($regexIterator as $file) {\n // get the identifiers if any.\n $identifier = $this->findIdentifier($file[0]);\n\n // if we got an identifier we can build up a new map entry\n if ($identifier !== false) {\n // We need to get our array of needles\n $needles = array(\n Invariant::ANNOTATION,\n Ensures::ANNOTATION,\n Requires::ANNOTATION,\n After::ANNOTATION,\n AfterReturning::ANNOTATION,\n AfterThrowing::ANNOTATION,\n Around::ANNOTATION,\n Before::ANNOTATION,\n Introduce::ANNOTATION,\n Pointcut::ANNOTATION\n );\n\n // If we have to enforce things like @param or @returns, we have to be more sensitive\n if ($this->config->getValue('enforcement/enforce-default-type-safety') === true) {\n $needles[] = '@var';\n $needles[] = '@param';\n $needles[] = '@return';\n }\n\n // check if the file has contracts and if it should be enforced\n $hasAnnotations = $this->findAnnotations($file[0], $needles);\n\n // create the entry\n $this->map[$identifier[1]] = array(\n 'cTime' => filectime($file[0]),\n 'identifier' => $identifier[1],\n 'path' => $file[0],\n 'type' => $identifier[0],\n 'hasAnnotations' => $hasAnnotations,\n 'enforced' => $this->isFileEnforced(\n $file[0],\n $identifier[1],\n $hasAnnotations,\n $enforcedFiles,\n $omittedNamespaces\n )\n );\n }\n }\n\n // save for later reuse.\n $this->save();\n }", "public function doEditingInPhp() \n {\n\n // get all text files with a .php extension into an array.\n $this->filesArray = glob($this->pathToDir . \"*.php\");\n // foreach loop to iterate each .php file\n // in given directory\n foreach ($this->filesArray as $file) {\n // list down all the .php files in that folder \n echo $file . ' ' . filesize($file) . 'kb ' . PHP_EOL;\n $contents = file_get_contents($file);\n // concatenating user input with the previously present text\n $contents = $this->textInput . PHP_EOL . $contents;\n // writing the new text in file\n file_put_contents($file, $contents);\n }\n\n $this->printDetails();\n }", "public function run()\n {\n// $this->parse();\n }", "public function pandocSetup()\n {\n $this->pandocOptions = [\n \"data-dir\" => \"app\",\n \"wrap\" => \"none\",\n \"from\" => \"mediawiki\",\n \"to\" => $this->format\n ];\n if (! empty($this->luafilter)) {\n $this->pandocOptions[\"lua-filter\"] = $this->luafilter;\n }\n\n if (! empty($this->template)) {\n $this->pandocOptions[\"template\"] = $this->template;\n }\n $this->message(\"pandoc: \" . json_encode($this->pandocOptions));\n $jsonFile = $this->output . \"tree.json\";\n if (file_exists($jsonFile)) {\n $tree = json_decode(file_get_contents($jsonFile), true); \n $this->outputTree = [];\n $dirTree = $tree[0]['contents'];\n foreach ($dirTree as $dir ) {\n $d = [];\n if (!empty($dir['contents'])) {\n foreach ($dir['contents'] as $r) {\n $d[$r['name']] = true;\n }\n }\n $this->outputTree[$dir['name']] = $d;\n }\n echo json_encode($this->outputTree);\n }\n }", "public function parse(): void\n {\n // TODO: Implement parse() method.\n }", "public function transform() {\n $input = DATABASE_XML;\t// default initial input\n for ($i = 0; $i < count($this->xslt); $i++) {\n $this->xslTransform($this->xslt[$i][\"xsl\"], $this->xslt[$i][\"param\"], $input);\n $input = TRANSFORMED_XML;\t// use result of last xsl transform for all subsequent inputs\n // if debugging is turned on, display transform information & output result\n // (particularly important for debugging more than one transform in a row)\n if ($this->debug) {\n\tprint \"XSLT transform with stylesheet \" . $this->xslt[$i][\"xsl\"];\n\tif (count($this->xslt[$i][\"param\"])) {\n\t print \"<br>\\nParameters: \\n\";\n\t foreach ($this->xslt[$i][\"param\"] as $key => $val) print \"$key => $val \\n\";\n\t}\n\tprint \"<br>\\n\";\n\tprint \"Result of transformation:<br>\\n\";\n\tprint $this->displayXML(TRANSFORMED_XML);\n }\n }\n // unbind used xslts\n unset($this->xslt);\n $this->xslt = array();\n }", "protected function parse()\n {\n\n $crawler = new Crawler($this->originalHTML);\n\n $this->tableOfContents = $crawler->filter('body > nav')->html();\n $this->body = $crawler->filter('body > main')->html();\n\n $this->reformatTableOfContents();\n $this->reformatBody();\n }", "function tidy_parse_file($filename, $config = null, $encoding = null, $use_include_path = false) {}", "protected function compile()\n {\n if (TL_MODE == 'BE')\n {\n $this->strTemplate = 'be_wildcard';\n $this->Template = new \\BackendTemplate($this->strTemplate);\n }\n\n if (empty(self::$wrappers))\n {\n return;\n }\n\n foreach (array_pop(self::$wrappers) as $key => $value)\n {\n $this->Template->{$key} = $value;\n }\n }", "function drush_uofm_xml_patch_preprocess($queue_name, $fake_xml, $filter = FALSE, $custom_builder = NULL) {\n $patch_file = drush_get_option(\"patch_file\", NULL);\n $patch_method = drush_get_option(\"patch_method\", NULL);\n if (is_file($patch_file)) {\n if (is_readable($patch_file)) {\n include_once($patch_file);\n if (isset($patch_method) && function_exists($patch_method)) {\n $new_xml = call_user_func_array($patch_method, [$fake_xml, new stdClass()]);\n if (is_string($new_xml)) {\n // Pass on to the normal preprocess function.\n drush_uofm_maintenance_preprocess($queue_name, $filter, $custom_builder);\n } else {\n drush_log(\"Interpreted function did not return a string.\", \"warning\");\n }\n }\n else {\n drush_log(\"Method {$patch_method} is not a function in the file {$patch_file}.\" , \"warning\");\n }\n }\n else {\n drush_log(\"File {$patch_file} is not readable\", \"warning\");\n }\n }\n else {\n drush_log(\"It appears {$patch_file} is not a file.\", \"warning\");\n }\n}", "function Process($parser, $text, $data)\r\n\t{\r\n\t\tob_start();\r\n\t\teval($data);\r\n\t\t$obj = &$this->GetCurrentObject();\r\n\t\t$obj->out .= ob_get_contents();\r\n\t\tob_end_clean();\r\n\t}", "private function parseDocument()\n {\n $doc_buffer = $this->specialCharacters($this->document);\n\n// if(preg_match(\"/<UL>(.*?)<\\/UL>/mi\", $doc_buffer)) {\n// $doc_buffer = str_replace(\"<UL>\", \"\", $doc_buffer);\n// $doc_buffer = str_replace(\"</UL>\", \"\", $doc_buffer);\n// $doc_buffer = preg_replace(\"/<LI>(.*?)<\\/LI>/mi\", \"\\\\f3\\\\'B7\\\\tab\\\\f{$this->font_face} \\\\1\\\\par\", $doc_buffer);\n// }\n\n// $doc_buffer = preg_replace(\"/<P>(.*?)<\\/P>/mi\", \"\\\\1\\\\par \", $doc_buffer);\n $doc_buffer = preg_replace('/<STRONG>(.*?)<\\/STRONG>/mi', \"}{\\b{$this->getDefaultFont()}\\\\1 }{{$this->getDefaultFont(false)}\", $doc_buffer);\n// $doc_buffer = preg_replace(\"/<EM>(.*?)<\\/EM>/mi\", \"\\\\i \\\\1\\\\i0 \", $doc_buffer);\n// $doc_buffer = preg_replace(\"/<U>(.*?)<\\/U>/mi\", \"\\\\ul \\\\1\\\\ul0 \", $doc_buffer);\n// $doc_buffer = preg_replace(\"/<STRIKE>(.*?)<\\/STRIKE>/mi\", \"\\\\strike \\\\1\\\\strike0 \", $doc_buffer);\n// $doc_buffer = preg_replace(\"/<SUB>(.*?)<\\/SUB>/mi\", \"{\\\\sub \\\\1}\", $doc_buffer);\n// $doc_buffer = preg_replace(\"/<SUP>(.*?)<\\/SUP>/mi\", \"{\\\\super \\\\1}\", $doc_buffer);\n\n //$doc_buffer = preg_replace(\"/<H1>(.*?)<\\/H1>/mi\", \"\\\\pard\\\\qc\\\\fs40 \\\\1\\\\par\\\\pard\\\\fs{$this->font_size} \", $doc_buffer);\n //$doc_buffer = preg_replace(\"/<H2>(.*?)<\\/H2>/mi\", \"\\\\pard\\\\qc\\\\fs32 \\\\1\\\\par\\\\pard\\\\fs{$this->font_size} \", $doc_buffer);\n\n// $doc_buffer = preg_replace(\"/<H1>(.*?)<\\/H1>/mi\", \"\\\\fs48\\\\b \\\\1\\\\b0\\\\fs{$this->font_size}\\\\par \", $doc_buffer);\n// $doc_buffer = preg_replace(\"/<H2>(.*?)<\\/H2>/mi\", \"\\\\fs36\\\\b \\\\1\\\\b0\\\\fs{$this->font_size}\\\\par \", $doc_buffer);\n// $doc_buffer = preg_replace(\"/<H3>(.*?)<\\/H3>/mi\", \"\\\\fs27\\\\b \\\\1\\\\b0\\\\fs{$this->font_size}\\\\par \", $doc_buffer);\n//\n//\n// $doc_buffer = preg_replace(\"/<HR(.*?)>/i\", \"\\\\brdrb\\\\brdrs\\\\brdrw30\\\\brsp20 \\\\pard\\\\par \", $doc_buffer);\n// $doc_buffer = str_replace(\"<BR>\", \"\\\\par \", $doc_buffer);\n// $doc_buffer = str_replace(\"<TAB>\", \"\\\\tab \", $doc_buffer);\n\n $doc_buffer = $this->nl2par($doc_buffer);\n\n return $doc_buffer;\n }", "function _fly_transform($new_source) {\n $tempFilename = tempnam(\"/tmp\", \"MODS_xml_initial_\");\n $data = str_replace(\n array('{|', '|}', '}', '{'), \n array('?', '?', '>', '<'), '{{|xml version=\"1.0\" |}}\n{xsl:stylesheet version=\"1.0\"\n xmlns:mods=\"http://www.loc.gov/mods/v3\"\n xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"}\n {xsl:template match=\"/ | @* | node()\"}\n {xsl:copy}\n {xsl:apply-templates select=\"@* | node()\" /}\n {/xsl:copy}\n {/xsl:template}\n {xsl:template match=\"/mods:mods/mods:relatedItem[@type=\\'host\\']/mods:titleInfo\"}{mods:titleInfo}{mods:title}' . $new_source . '{/mods:title}{/mods:titleInfo}{/xsl:template}\n{/xsl:stylesheet}');\n\n file_put_contents($tempFilename, $data);\n return $tempFilename;\n}", "function _preparse()\n {\n $options = PEAR::getStaticProperty('HTML_BBCodeParser','_options');\n $o = $options['open'];\n $c = $options['close'];\n $oe = $options['open_esc'];\n $ce = $options['close_esc'];\n \n $pattern = array( \"!(^|\\s)([-a-z0-9_.+]+@[-a-z0-9.]+\\.[a-z]{2,4})!i\");\n \n $replace = array( \"\\\\1\".$o.\"a href=\\\"mailto:\\\\2\\\"\".$c.\"\\\\2\".$o.\"/a\".$c);\n \n $this->_preparsed = preg_replace($pattern, $replace, $this->_text);\n }", "function modified()\r\n {\r\n if (!$this->isUpdating() && $this->_control!=null && ($this->_control->_controlstate & csLoading) != csLoading && $this->_control->_name != \"\")\r\n {\r\n $f=new Font();\r\n $fstring=$f->readFontString();\r\n\r\n $tstring=$this->readFontString();\r\n\r\n\r\n if ($this->_control->ParentFont)\r\n {\r\n $parent=$this->_control->Parent;\r\n if ($parent!=null) $fstring=$parent->Font->readFontString();\r\n }\r\n\r\n // check if font changed and if the ParentFont can be reset\r\n if ($fstring!=$tstring && $this->_control->DoParentReset)\r\n {\r\n $c=$this->_control;\r\n $c->ParentFont = 0;\r\n }\r\n\r\n if ($this->_control->methodExists(\"updateChildrenFonts\"))\r\n {\r\n $this->_control->updateChildrenFonts();\r\n }\r\n }\r\n }", "public function preFilter(Text $text)\n {\n foreach($text as $no => $line) {\n if ($line->isIndented()) {\n $line->flags |= Line::NOMARKDOWN + Line::CODEBLOCK;\n } elseif ($line->isBlank()) {\n $prev_no = $no;\n do {\n $prev_no -= 1;\n $prevline = isset($text[$prev_no]) ? $text[$prev_no] : null;\n } while ($prevline !== null && $prevline->isBlank());\n\n $next_no = $no;\n do {\n $next_no += 1;\n $nextline = isset($text[$next_no]) ? $text[$next_no] : null;\n } while ($nextline !== null && $nextline->isBlank());\n\n if ($prevline !== null && $prevline->isIndented() && $nextline !== null && $nextline->isIndented()) {\n $line->flags |= Line::NOMARKDOWN + Line::CODEBLOCK;\n }\n }\n\n }\n }", "private function _replaceElementTexts()\n {\n $item = $this->_record;\n // If this option is set, it will loop through the $elementTexts provided,\n // find each one and manually update it (provided it exists).\n // The rest of the element texts will get added as per usual.\n foreach ($this->_elementTexts as $elementSetName => $textArray) {\n foreach ($textArray as $elementName => $elementTextSet) {\n $etRecordSet = $item->getElementTexts($elementSetName, $elementName);\n foreach ($elementTextSet as $elementTextIndex => $textAttr) {\n // If we have an existing ElementText record, use that\n // instead of adding a new one.\n if (array_key_exists($elementTextIndex, $etRecordSet)) {\n $etRecord = $etRecordSet[$elementTextIndex];\n $etRecord->text = $textAttr['text'];\n $etRecord->html = $textAttr['html'];\n $etRecord->save();\n } else {\n // Otherwise we should just append the new text to the\n // pre-existing ones.\n $elementRecord = $item->getElement($elementSetName, $elementName);\n $item->addTextForElement($elementRecord, $textAttr['text'], $textAttr['html']);\n }\n }\n }\n }\n }", "protected function compile()\n\t{\n\t\t$this->Template->anchor = standardize($this->headline) . '-' . $this->id;\n\t}", "public function parse(): void\n {\n $this->template->assign('page_title', BL::getLabel($this->url->getModule()));\n $this->cssFiles->parse($this->template, 'cssFiles');\n $this->jsFiles->parse($this->template, 'jsFiles');\n\n $this->jsData->add('site', 'domain', SITE_DOMAIN);\n $this->jsData->add('editor', 'language', $this->getCKEditorLanguage());\n $this->jsData->add('Core', 'session_timeout', $this->getFirstPossibleSessionTimeout());\n\n if (!empty($this->get('fork.settings')->get('Core', 'theme'))) {\n $this->jsData->add('theme', 'theme', $this->get('fork.settings')->get('Core', 'theme'));\n $themePath = FRONTEND_PATH . '/Themes/' . $this->get('fork.settings')->get('Core', 'theme');\n $this->jsData->add('theme', 'path', $themePath);\n $this->jsData->add('theme', 'has_css', is_file($themePath . '/Core/Layout/Css/screen.css'));\n $this->jsData->add('theme', 'has_editor_css', is_file($themePath . '/Core/Layout/Css/editor_content.css'));\n }\n $this->template->assign('jsData', $this->jsData);\n }", "public function run() {\n\t\t$this->preRun();\n\n\t\t$this->changeTags();\n\n\t\t$this->postRun();\n\t}", "function structure_content() {\r\n\t\t// institutional links and maybe others) does not get fixed.\r\n\t\t//if($this->config['WET'] !== false) {\r\n\t\t//\tReTidy::DOM_init();\r\n\t\t//\tReTidy::DOM_clean_redundant_tags();\r\n\t\t//\tReTidy::DOM_save();\r\n\t\t//}\r\n\t\t//if($this->config['trust_headings'] !== true) {\r\n\t\t\tReTidy::remove_page_structure(true);\r\n\t\t//}\r\n\t\tReTidy::build_page_structure(true);\r\n\t\t//if($this->config['trust_headings'] !== true) {\r\n\t\t\t//ReTidy::check_page_structure();\r\n\t\t\tReTidy::fix_page_structure();\r\n\t\t//}\r\n\t\tReTidy::build_page_from_structure_arrays(true);\r\n\t\tif($this->config[\"normalize_heading_text\"] === 'all_indexical_content') {\r\n\t\t\tReTidy::normalize_all_indexical_content(true);\r\n\t\t}\r\n\t}", "function clean_rtf_from_jade_tables() {\r\n\t\t//$this->code = preg_replace('/class=[^\\s<>]*/', '', $this->code, -1, $d);\r\n\t\t//$this->code = preg_replace('/colspan=[0-9]*/', '', $this->code, -1, $e);\r\n\t\t//$this->code = preg_replace('/width=[0-9]*/', '', $this->code, -1, $f);\r\n\t\t//$this->code = str_replace('<p >', '', $this->code, $g);\r\n\t\t//$this->code = str_replace('<span >', '', $this->code, $h);\r\n\t\t//$this->code = str_replace('</p>', '', $this->code, $i);\r\n\t\t//$this->code = str_replace('</span>', '', $this->code, $j);\r\n\t\t//$this->code = str_replace('<p >', '', $this->code, $k);\t\t\r\n\t\t// INAC1168\r\n\t\tif($this->language === \"english\") {\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITIES<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSIBILITY<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TIMING GUIDELINES<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITIES</b></td>\r\n<td$2><b>RESPONSIBILITY</b></td>\r\n<td$3><b>TIMING GUIDELINES</b></td>\r\n</tr>\r\n<tr>\r\n<td$10>1.', $this->code, -1, $l);\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITIES<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSIBILITY<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TIMING GUIDELINES<\\/b>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITIES</b></td>\r\n<td$2><b>RESPONSIBILITY</b></td>\r\n<td$3><b>TIMING GUIDELINES</b></td>\r\n</tr>\r\n<tr>\r\n<td$9>1.', $this->code, -1, $m);\r\n\t\t}\r\n\t\tif($this->language === \"french\") {\r\n\t\tprint(\"<h1>french</h1>\");\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITÉS<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSABILITÉ<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>HORIZON<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TEMPOREL<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITÉS</b></td>\r\n<td$2><b>RESPONSABILITÉ</b></td>\r\n<td$3><b>HORIZON TEMPOREL</b></td>\r\n</tr>\r\n<tr>\r\n<td$10>1.', $this->code, -1, $n);\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITÉS<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSABILITÉ<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>HORIZON<\\/b>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TEMPOREL<\\/b>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITÉS</b></td>\r\n<td$2><b>RESPONSABILITÉ</b></td>\r\n<td$3><b>HORIZON TEMPOREL</b></td>\r\n</tr>\r\n<tr>\r\n<td$9>1.', $this->code, -1, $o);\t\t\r\n\t\t}\r\n\t\t//$this->code = preg_replace('/<span\\s*>/', '', $this->code, -1, $p);\r\n\t\t$this->code = preg_replace('/<tr height=\"0\">.*?<\\/tr>/', '', $this->code, -1, $q);\r\n\t\t\r\n\t\t$this->logMsgIf(\"clean_rtf_from_jade_tables\", $c + $d + $e + $f + $g + $h + $i + $j + $k + $l + $m + $n + $o + $p + $q);\r\n\t}", "private function apply_node_instructions() {\n // Add a new node visitor to the traverser\n $this->get_traverser()->addVisitor(new class($this) extends \\PhpParser\\NodeVisitorAbstract {\n public function __construct($file) {\n $this->file = $file;\n }\n\n /**\n * Applies all instructions to a node for a given type\n *\n * @param string $type The instruction type to be applied\n * @param \\PhpParser\\Node $node The node to be actioned\n * @return \\PhpParser\\Node\n */\n private function apply_instructions(string $type, \\PhpParser\\Node $node): \\PhpParser\\Node {\n // Retrieve all instructions by type\n $instructions = $this->file->get_instructions($type);\n\n // Check if has no leave instructions\n if (empty($instructions)) {\n return $node;\n }\n\n // Iterate over all instructions\n foreach($instructions as $instruction) {\n // Get the node type\n $instruction_node = $instruction->node;\n\n // Check if it's not the same as the current node\n if (!($node instanceof $instruction_node)) {\n continue;\n }\n\n // Extract the parameters\n $if = (array) $instruction->if;\n $do = (array) $instruction->do;\n\n // Check for all instructions\n foreach($if as $index => $cnd) {\n // Variable that will later handle if the condition was met\n $condition = false;\n\n // Check if condition is a callback\n if (is_callable($cnd)) {\n // Try matching it with the current node\n $condition = call_user_func_array($cnd, [$node]);\n } else {\n // Retrieve the index value\n $node_index = $node->{$index};\n\n // Check if the condition value is a string, and node index has a toString() method\n if (is_string($cnd[1]) && is_callable([$node_index, \"toString\"])) {\n // Call it\n $node_index = $node_index->toString();\n }\n\n // Evaluate the condition\n eval(\"\\$condition = \\$node_index \" . $cnd[0] . \" \" . escapeshellarg($cnd[1]) . \";\");\n }\n\n // Check if the condition was not met\n if (!$condition) {\n // Assert the failed condition\n $instruction->do_assertion(File\\Instruction::ASSERT_FAILED_CONDITION_NOT_MET, null);\n\n // Break the instruction\n break 2;\n }\n }\n\n // Do all instructions\n foreach($do as $action) {\n // Check if it's callable\n if (is_callable($action)) {\n // Just call the action\n call_user_func_array($action, [$node]);\n continue;\n }\n\n // Extract the action name\n $action_name = $action[\"action\"];\n unset($action[\"action\"]);\n\n // Check if is settings variables\n if ($action_name === \"set\") {\n // Iterate over all variables\n foreach($action[\"vars\"] ?? $action[\"variables\"] as $var => $value) {\n // Set the node variable value\n $node->{$var} = $value;\n }\n }\n }\n }\n\n return $node;\n }\n\n public function leaveNode(\\PhpParser\\Node $node) {\n return $this->apply_instructions(\"leave\", $node);\n }\n\n public function enterNode(\\PhpParser\\Node $node) {\n return $this->apply_instructions(\"enter\", $node);\n }\n });\n }", "public static function parse($text) : string\n\t{\n\t\tforeach(self::$schema as $code => $html)\n\t\t\t$text = str_replace($code, $html, $text);\n\n\t\treturn $text;\n\t}", "function _parse() {\n $txt = $this->_text;\n for($i=0; $i<count($txt); $i++) {\n $txt[$i] = preg_replace(\"@[{]([^}]+)[}]@e\", \"''.\\$this->_insert(\\\"\\\\1\\\").''\",$txt[$i]);\n }\n return join(\"\",$txt);\n }", "public static function unparse($text) : string\n\t{\n\t\tforeach(self::$schema as $code => $html)\n\t\t\t$text = str_replace($html, $code, $text);\n\n\t\treturn $text;\n\t}", "function _convert() {\n\t\tif ($this->hasError()) {\n\t\t\t$this->_raiseError(get_class($this).' : '.__FUNCTION__.' : can\\'t convert document, object has an error ...');\n\t\t\treturn false;\n\t\t}\n\t\t//get tmp path\n\t\t$tmpPath = CMS_file::getTmpPath();\n\t\tif (!$tmpPath) {\n\t\t\t$this->_raiseError(get_class($this).' : '.__FUNCTION__.' : can\\'t get temporary path to write in ...');\n\t\t\treturn false;\n\t\t}\n\t\t//generate random filename\n\t\t$filename = sensitiveIO::sanitizeAsciiString('filter_'.APPLICATION_LABEL.'_'.microtime());\n\t\twhile(is_file($tmpPath.'/'.$filename)) {\n\t\t\t$filename = sensitiveIO::sanitizeAsciiString('filter_'.APPLICATION_LABEL.'_'.microtime());\n\t\t}\n\t\t$this->_convertedDocument = $tmpPath.'/'.$filename;\n\t\tif (!touch($this->_convertedDocument)) {\n\t\t\t$this->_raiseError(get_class($this).' : '.__FUNCTION__.' : can\\'t create temporary document : '.$this->_convertedDocument);\n\t\t\treturn false;\n\t\t}\n\t\t//convert document\n\t\tif (!file_put_contents($this->_convertedDocument, html_entity_decode($this->stripTags(file_get_contents($this->_sourceDocument)), ENT_COMPAT, (strtolower(APPLICATION_DEFAULT_ENCODING) != 'utf-8' ? 'ISO-8859-1' : 'UTF-8')))) {\n\t\t\t$this->_raiseError(get_class($this).' : '.__FUNCTION__.' : can\\'t convert HTML document ... ');\n\t\t\treturn false;\n\t\t}\n\t\t//run some cleaning task on converted document command\n\t\t$this->_cleanConverted();\n\t\treturn true;\n\t}", "public function parseRecursive()\n {\n $this->isFileModified = false;\n $inputFile = new PhoreInputFile($this->logger);\n\n $envLoader = self::Config()->environmentLoader;\n if (is_callable($envLoader)) {\n $this->logger->debug(\"Running environment loader (defined in config)\");\n $this->environment = $envLoader();\n if ( ! is_array($this->environment))\n throw new \\InvalidArgumentException(\"environment-loader must return array. It returned \" . gettype($this->environment));\n }\n\n $this->templateDir->walkR(function(PhoreUri $relpath) use ($inputFile) {\n $relpath = phore_uri( substr( $relpath->getUri(), strlen($this->templateDir)));\n\n $this->logger->debug(\"Walking: $this->templateDir / $relpath...\");\n\n $inputFile->rewriteFile($relpath, $this->templateDir, $this->targetDir, $this->environment);\n });\n $this->isFileModified = $inputFile->isModified();\n }", "function PMA_transformation_text_plain__external($buffer, $options = array(), $meta = '') {\n // include './libraries/transformations/global.inc.php';\n\n // further operations on $buffer using the $options[] array.\n\n $allowed_programs = array();\n\n //\n // WARNING:\n //\n // It's up to administrator to allow anything here. Note that users may\n // specify any parameters, so when programs allow output redirection or\n // any other possibly dangerous operations, you should write wrapper\n // script that will publish only functions you really want.\n //\n // Add here program definitions like (note that these are NOT safe\n // programs):\n //\n //$allowed_programs[0] = '/usr/local/bin/tidy';\n //$allowed_programs[1] = '/usr/local/bin/validate';\n\n // no-op when no allowed programs\n if (count($allowed_programs) == 0) {\n return $buffer;\n }\n\n if (!isset($options[0]) || $options[0] == '' || !isset($allowed_programs[$options[0]])) {\n $program = $allowed_programs[0];\n } else {\n $program = $allowed_programs[$options[0]];\n }\n\n if (!isset($options[1]) || $options[1] == '') {\n $poptions = '-f /dev/null -i -wrap -q';\n } else {\n $poptions = $options[1];\n }\n\n if (!isset($options[2]) || $options[2] == '') {\n $options[2] = 1;\n }\n\n if (!isset($options[3]) || $options[3] == '') {\n $options[3] = 1;\n }\n\n // needs PHP >= 4.3.0\n $newstring = '';\n $descriptorspec = array(\n 0 => array(\"pipe\", \"r\"),\n 1 => array(\"pipe\", \"w\")\n );\n $process = proc_open($program . ' ' . $poptions, $descriptorspec, $pipes);\n if (is_resource($process)) {\n fwrite($pipes[0], $buffer);\n fclose($pipes[0]);\n\n while (!feof($pipes[1])) {\n $newstring .= fgets($pipes[1], 1024);\n }\n fclose($pipes[1]);\n // we don't currently use the return value\n $return_value = proc_close($process);\n }\n\n if ($options[2] == 1 || $options[2] == '2') {\n $retstring = htmlspecialchars($newstring);\n } else {\n $retstring = $newstring;\n }\n\n return $retstring;\n}", "function change_parsing_rules($puncts, $numbers, $entities) {\n $this->punct_breaks = $puncts;\n $this->num_breaks = $numbers;\n $this->ent_breaks = $entities;\n }", "protected function preVisitText(Text $element)\n\t{\n\t\t$elementCodeBuffers = $this->codeBufferManager->getProperties($element);\n\t\t$this->output .= $elementCodeBuffers->link(array(CodeBufferCollection::TAG_BEFORE));\n\t\treturn $this->enqueue($element);\n\t}", "function prep_atom_text_construct($data)\n {\n }", "protected function reformatTableOfContents()\n {\n $tableOfContentsXML = simplexml_load_string($this->tableOfContents);\n\n $reformatted = null;\n\n foreach ($tableOfContentsXML->li as $section) {\n $title = $section->a->asXML();\n\n $headings = [];\n foreach ($section->ul->li as $heading) {\n $headings[] = $heading->a->asXML();\n }\n\n $reformatted .= view('specification.toc.section', compact('title', 'headings'));\n }\n\n $this->tableOfContents = $reformatted;\n }", "function Module_MicroText () {\n MicroBuilder_Module_Base::MicroBuilder_Module_Base();\n }", "function process_data_alan($text) // \r\n\t{\r\n\t\t$re = '%# Collapse ws everywhere but in blacklisted elements.\r\n\t\t(?> # Match all whitespans other than single space.\r\n\t\t\t[^\\S ]\\s* # Either one [\\t\\r\\n\\f\\v] and zero or more ws,\r\n\t\t\t| \\s{2,} # or two or more consecutive-any-whitespace.\r\n\t\t\t) # Note: The remaining regex consumes no text at all...\r\n(?= # Ensure we are not in a blacklist tag.\r\n\t(?: # Begin (unnecessary) group.\r\n\t\t(?: # Zero or more of...\r\n\t\t\t[^<]++ # Either one or more non-\"<\"\r\n\t\t\t| < # or a < starting a non-blacklist tag.\r\n\t\t\t(?!/?(?:textarea|pre)\\b)\r\n\t\t\t)*+ # (This could be \"unroll-the-loop\"ified.)\r\n) # End (unnecessary) group.\r\n(?: # Begin alternation group.\r\n\t< # Either a blacklist start tag.\r\n\t(?>textarea|pre)\\b\r\n\t| \\z # or end of file.\r\n\t) # End alternation group.\r\n) # If we made it here, we are not in a blacklist tag.\r\n%ix';\r\n$text = preg_replace($re, \" \", $text);\r\nreturn $text;\r\n}", "private function _Parsing($template)\n {\n // ДИРЕКТИВЫ\n // Literal\n preg_match_all(\"~{literal}(.+?){/literal}~si\", $template, $match);\n foreach ($match[0] as $key => $val)\n {\n $template = str_replace($val, \"<LITERAL{$key}LITERAL>\", $template);\n }\n\n // подключение шаблонов директивой инклуде {инклуде \"дирнаме/филенаме\"}\n $template = preg_replace_callback(self::PATTERN_INCLUDE, [$this, '_Parsing_Include'], $template);\n // парсинг языковых конструкций\n $template = preg_replace_callback(self::PATTERN_TRANSLATION1, [$this, '_Parsing_Translation1'], $template);\n $template = preg_replace_callback(self::PATTERN_TRANSLATION2, [$this, '_Parsing_Translation2'], $template);\n // парсинг плагинов\n $template = preg_replace_callback(self::PATTERN_PLUGIN, [$this, '_Parsing_Controller'], $template);\n //\n\n // Вырезаем служебные комментарии\n $template = preg_replace('~{#(.*?)#}~s', '', $template);\n\n //\tциклы и логика\n $template = preg_replace('~{((foreach|for|while|if|switch|case|default) .+?)}~si', '<' . '?php $1 { ?' . '>', $template);\n $template = preg_replace('~{(/|/foreach|/for|/while|/if|/switch|/case|/default)}~si', '<' . '?php } ?' . '>', $template);\n $template = preg_replace('~{else if (.+?)}~si', '<' . '?php } else if $1 { ?' . '>', $template);\n $template = preg_replace('~{else}~si', '<' . '?php } else { ?' . '>', $template);\n $template = preg_replace('~{(break|continue)}~si', '<' . '?php $1; ?' . '>', $template);\n //\tпеременные установка\n $template = preg_replace('~{set ([^}]{1,255})}~si', '<' . '?php $1; ?' . '>', $template);\n\n //\tпеременные вывод\n $template = preg_replace('~{(\\$[^}]{1,255})}~si', '<' . '?php echo $1; ?' . '>', $template);\n //\tфункции и константы\n $template = preg_replace('~{([a-z]{1}[^}]{0,150})}~si', '<' . '?php echo $1; ?' . '>', $template);\n\n // Literal\n foreach ($match[1] as $key => $val)\n {\n $template = str_replace(\"<LITERAL{$key}LITERAL>\", trim($val), $template);\n }\n\n // ////\tпеременные вывод\n // $template = preg_replace('~([^{]?){(\\$[^}]{1,255})}([^}]?)~si', '$1<' . '?php echo $2; ?' . '>$3', $template);\n // ////\tфункции и константы\n // $template = preg_replace('~([^{]?){([a-z]{1}[^}]{0,150})}([^}]?)~si', '$1<' . '?php echo $2; ?' . '>$3', $template);\n\n //\n return $template;\n }", "private function buildText($textRunNode) {\n\t\t// populate the text, do we need this?\t\t\n // $this->text = (string)$node->children(\"a\", TRUE)->t;\n // echo \" --- style \" .\n\n foreach($textRunNode->children(\"a\", TRUE) as $childNode) {\n\t if($childNode->getName() === \"t\") {\n\t // we have text\n\t $this->text = (string)$childNode; \n\t\t\t} else if($childNode->getName() === \"rPr\") {\n\t\t\t\t// we have properties\n\t\t\t $attributes = $childNode->attributes();\n\t\t\t if((string)$attributes->b === '1') {\n\t\t\t $this->isBolded = true;\n\t\t }\n\t\t\t if((string)$attributes->i === '1') {\n\t $this->isItalics = true;\n\t\t }\n\t\t\t if((string)$attributes->u === 'sng') {\n\t\t\t $this->isUnderlined = true;\n\t\t\t $this->underlineType = Text::ONE_LINE;\n\t\t\t }\n\t\t\t if((string)$attributes->u === 'dbl') {\n\t\t\t $this->isUnderlined = true;\n\t\t\t $this->underlineType = Text::TWO_LINES;\n\t\t\t }\n\t\t\t if((string)$attributes->strike === 'sngStrike') {\n\t\t\t\t $this->Strikethrough = true;\n\t\t\t }\n\t\t\t if(isset($attributes->lang)) {\n\t\t\t $this->language = (string)$attributes->lang;\n\t\t\t }\n\t\t\t foreach($childNode->children(\"a\", TRUE) as $node2) {\n\t\t\t if((string)$node2->getName() === \"solidFill\") {\n\t\t\t $this->fillStyle = Text::SOLID;\n\t\t\t\t\t\t \n\t foreach($node2->children(\"a\", TRUE) as $node3) {\n\t $attr = $node3->attributes();\n\t \n\t if($node3->getName() === \"schemeClr\") {\n\t echo \"Scheme colour: \" . $attr->val . \" \";\n\t // TODO: insert logic to handle colours from scheme\n\t // ideally the actual colour should be added from\n\t // the theme, but that means processing the \n\t // \n\t\t\t\t\t\t\t} else if($node3->getName() === \"srgbClr\") {\n\t\t\t $this->colour = (string)$attr->val;\n\t\t\t\t\t\t\t}\n\t }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n }\n\t}", "public function apply()\n {\n\n\n $files = 'start';\n //$load is empty as we will use the .default file to select the data directory\n $load = '';\n $reload = 1;\n \n $this->process->loadFiles($this->helper->getModuleName(),$load,explode(\",\",$files),$reload);\n \n }", "public function convert()\n {\n $this->logger->debugTranslate('htmlconversion.converter.startLog');\n\n // Create a DOMDocument from the NLMXML input file\n if (!$this->loadNlmxmlDom()) {\n $this->logger->debugTranslate(\n 'htmlconversion.converter.nlmxmlDomErrorLog',\n $this->libxmlErrors()\n );\n $this->status = false;\n return;\n }\n\n if (!$this->transform()) {\n $this->status = false;\n return;\n }\n\n // Create the zip file with the HTML and the HTML assets\n $this->package();\n $this->status = true;\n }", "public function modifyTextContainer($oldName, $newName, $content, $language);", "protected function compile()\n\t{\n\t\t$lexer = new Lexer($this->template->getEnvironment());\n\t\t$stream = $lexer->tokenize(file_get_contents($this->filename), basename($this->filename));\n\n\t\t// unique class based on the filename\n\t\t// @todo fix problem with '-' in classes\n\t\t$class = $this->template->getEnvironment()->getCacheFilename($this->filename);\n\t\t$class = 'S' . substr($class, 0, -8) . '_Template';\n\n\t\t// writer object which contains the parsed PHP code\n\t\t$writer = new Writer();\n\t\t$writer->write(\"<?php\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('namespace Spoon\\Template;' . \"\\n\");\n\t\t$writer->write(\"\\n\");\n\t\t$writer->write('/* ' . $this->filename . ' */' . \"\\n\");\n\t\t$writer->write(\"class $class extends Renderer\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\t\t$writer->write('protected function display(array $context)' . \"\\n\");\n\t\t$writer->write(\"{\\n\");\n\t\t$writer->indent();\n\n\t\t$tags = $this->template->getEnvironment()->getTags();\n\n\t\t$token = $stream->getCurrent();\n\t\twhile(!$stream->isEof())\n\t\t{\n\t\t\tswitch($token->getType())\n\t\t\t{\n\t\t\t\tcase Token::TEXT:\n\t\t\t\t\t$text = new TextNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$text->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::VAR_START:\n\t\t\t\t\t$stream->next();\n\t\t\t\t\t$variable = new VariableNode($stream, $this->template->getEnvironment());\n\t\t\t\t\t$variable->compile($writer);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token::BLOCK_START:\n\t\t\t\t\t$token = $stream->next();\n\n\t\t\t\t\t// validate tag existence\n\t\t\t\t\tif(!isset($tags[$token->getValue()]))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new SyntaxError(\n\t\t\t\t\t\t\tsprintf('There is no such template tag \"%s\"', $token->getValue()),\n\t\t\t\t\t\t\t$token->getLine(),\n\t\t\t\t\t\t\t$this->filename\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$node = new $tags[$token->getValue()]($stream, $this->template->getEnvironment());\n\t\t\t\t\t$node->compile($writer);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif($token->getType() !== Token::EOF)\n\t\t\t{\n\t\t\t\t$token = $stream->next();\n\t\t\t}\n\n\t\t\telse break;\n\t\t}\n\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\t$writer->outdent();\n\t\t$writer->write(\"}\\n\");\n\t\treturn $writer->getSource();\n\t}", "function preProcess($docblock) {\n\t\t$docblock = str_replace(\"\\r\\n\", \"\\n\", $docblock);\n\t\t$docblock = str_replace(\"\\r\", \"\\n\", $docblock);\n\t\t$docblock = str_replace(\"/*\", \"\", $docblock);\n\t\t$docblock = str_replace(\"*/\", \"\", $docblock);\n\t\t$docblock = preg_replace(\"/[\\*=\\-]+/\", \"\", $docblock);\n\t\treturn $docblock;\n\t}", "protected function applyTransformation() {\n // no transformation for index\n }", "abstract protected function _preProcess();", "public function parse() : void\n\t{\n\t\tif (empty($this->srcPath) || empty($this->destPath))\n\t\t{\n\t\t\tthrow new \\Exception(\\sprintf('Please register source path and destination path before calling this \"%s\" method.', __METHOD__));\n\t\t}\n\n\t\t$srcContent = \\file_get_contents($this->srcPath);\n\n\t\tif (empty($srcContent))\n\t\t{\n\t\t\tthrow new \\Exception(\\sprintf('The \"%s\" is invalid or the file is corrupted!', $this->srcPath));\n\t\t}\n\n\t\t$parsedContent = ComponentHelper::parseContent($srcContent, $this->meta);\n\t\t\\file_put_contents($this->destPath, $parsedContent);\n\n\t\tPrinter::println(Printer::getColorizeMessage(\"Created \" . $this->destPath . \" file.\", 'green'));\n\t}", "protected function preprocessData() {}", "function unformatted($text) {\n $this->doc .= $this->_xmlEntities($text);\n }", "function remarks_xml2php($langdata_path)\n{\n\t# Converts updated XML file to corresponding PHP list\n\t# TODO:\n\t$handle = fopen($langdata_path.\"remarks.php\", \"w\");\n\t$string_data = <<<EOF\n<?php\n\\$REMARKS_ARRAY = array (\n\nEOF;\n\tfwrite($handle, $string_data);\n\n\t$measures = simplexml_load_file($langdata_path.\"remarks.xml\");\n\n\t$measure_count = 0;\n\tforeach($measures as $measure)\n\t{\n\t\t$measure_count++;\n\t\t$string_data = '\"'.$measure['id'].'\" => array ( ';\n\t\tfwrite($handle, \"\\t\".$string_data.\"\\n\");\n\t\t$ranges = $measure->range;\n\t\t$range_count = 0;\n\t\tforeach($ranges as $range)\n\t\t{\n\t\t\t$range_count++;\n\t\t\t$string_data = \"\\\"\".$range->key.\"\\\" => \\\"\".$range->value.\"\\\"\";\n\t\t\tif($range_count != count($ranges))\n\t\t\t{\n\t\t\t\t$string_data .= \", \";\n\t\t\t}\n\t\t\tfwrite($handle, \"\\t\\t\".$string_data.\"\\n\");\n\t\t}\n\n\t\t$string_data = \") \";\n\t\tfwrite($handle, \"\\t\".$string_data);\n\t\tif($measure_count < count($measures))\n\t\t{\n\t\t\t$string_data = \", \";\n\t\t\tfwrite($handle, $string_data.\"\\n\");\n\t\t}\n\t}\n\t$string_data = <<<EOF\n);\n\ninclude_once(\"../lang/lang_util.php\");\n?>\nEOF;\n\tfwrite($handle, \"\\n\".$string_data);\n\tfclose($handle);\n}", "function parse() {\n\t\tif (strstr($this->source, \"\\n\")) {\n\t\t\t$lines = explode(\"\\n\", $this->source);\n\t\t\t$this->buffer = \"\";\n\t\t\tforeach($lines as $line) {\n\t\t\t\t$this->parseLine($line);\t\n\t\t\t}\n\t\t} else {\n\t\t\t$this->addParagraph($this->source);\n\t\t}\n\t\t\n\t\treturn new DocblockModel($this->paragraphs, $this->tags);\n\t}", "public function run()\n { if (!version_compare($this->from_version, '7.0', '<')) {\n return;\n }\n \n $this->log(\"Fixing 6.x custom text area fields.\");\n $sql = \"UPDATE fields_meta_data \" .\n \"SET ext1 = '', \" .\n \"ext4 = '', \" .\n \"default_value = '' \" .\n \"WHERE type = 'text' \" .\n \"AND ext1 is null \" .\n \"AND ext4 is null\";\n \n $r = $this->db->query($sql);\n $this->log(\"Updated \" . $this->db->getAffectedRowCount($r) . \" Rows\");\n $this->log(\"Done Fixing 6.x custom text area fields.\");\n }", "private function getApertiumTranslation($text, $pretrans_src='', $pretrans_dst='')\n\t{\t\t\n\t\t$generate_tmx = false;\n\n\t\tif(is_array($pretrans_src) AND !empty($pretrans_src))\n\t\t{\n\t\t\tforeach($pretrans_src as $ind => $value)\n\t\t\t{\n\t\t\t\tif(strlen(trim($value)) < 5) //for some reason, Apertium crashes when loading arguments shorter than 5 chars from tmx\n\t\t\t\t{\n\t\t\t\t\tunset($pretrans_src[$ind]);\n\t\t\t\t\tunset($pretrans_dst[$ind]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$generate_tmx = !empty($pretrans_src);\n\t\t}\n\t\n\t\t$command = $this->config['apertium_command'].' -u -f '.$this->format.' '.$this->source_language.'-'.$this->target_language;\n\n\t\tif ($this->inputTMX != '') {\n\t\t\t$tempname_inputTMX = tempnam($this->config['temp_dir'], 'ap_temp_');\n\t\t\t$tempname_inputTMX = $this->config['temp_dir'] . basename($tempname_inputTMX);\n\t\t\t$tmx_file = fopen($tempname_inputTMX, \"w\");\n\t\t\tfwrite($tmx_file, $this->inputTMX);\n\t\t\tfclose($tmx_file);\n\t\t}\n\t\t\t\n\n\t\tif (isset($tempname_inputTMX)) {\n\t\t\tif ($generate_tmx) {\n\t\t\t\t/* Merging pretrans and external TMX */\n\t\t\t\t$tempname = $this->generateTMXApertium($pretrans_src, $pretrans_dst);\t\n\t\t\t\t$tempname_tmx = $this->mergeTMX(array($tempname, $tempname_inputTMX));\n\t\t\t\t$command .= ' -m \"'.$tempname_tmx.'\"';\n\t\t\t}\n\t\t\telse\t\n\t\t\t\t$command .= ' -m \"'.$tempname_inputTMX.'\"';\n\t\t}\n\t\telseif ($generate_tmx) {\n\t\t\t$tempname = $this->generateTMXApertium($pretrans_src, $pretrans_dst);\t\n\t\t\t$command .= ' -m \"'.$tempname.'\"';\n\t\t}\n\n\t\texecuteCommand($command, $text, $translation_result, $return_status);\n\n\t\tif (isset($tempname))\n\t\t\tunlink($tempname);\n\t\tif (isset($tempname_tmx))\n\t\t\tunlink($tempname_tmx);\n\t\tif (isset($tempname_inputTMX))\n\t\t\tunlink($tempname_inputTMX);\n\t\n\t\t/* $translation_result = html_entity_decode($translation_result, ENT_COMPAT, 'UTF-8'); \n\t\t * only useful if the\"-f html\" option is enabled in the apertium command\n\t\t */\n\t\n\t\treturn $translation_result;\n\t}", "public function htmlToEditor( $html )\n\t{\n\t\t$html = $this->_processNoParseCodes( $html, 1, true );\n\n\t\t/* Don't attempt to convert manually entered CODE and QUOTE as this can come from a preview where someone has entered\n\t\t * manual tags in the RTE and breaks because this below fires up the legacy parser which expects <br> and not PRE linebreaks, etc\n\t\t * And also they can retain the manual tags they entered.\n\t\t */\n\t\tif ( ! $this->lang->isRtl() )\n\t\t{\n\t\t\t/* RTL tries to move square brakcets around */\n\t\t\t$html = str_ireplace( '[code' , '<!--open:code-->' , $html );\n\t\t\t$html = str_ireplace( '[quote', '<!--open:quote-->', $html );\n\t\t\t$html = str_ireplace( '[url' , '<!--open:url-->', $html );\n\t\t\t$html = str_ireplace( '[img' , '<!--open:img-->', $html );\n\t\t}\n\t\t\n\t\t/* Editing an older post? */\n\t\tif ( $this->isBBCode( $html ) )\n\t\t{\n\t\t\tself::$NoBBCodeAutoLinkify = true;\n\t\t\t\n\t\t\t$html = $this->BBCodeToHtml( $html );\n\t\t\t\n\t\t\tself::$NoBBCodeAutoLinkify = false;\n\t\t}\n\t\t\n\t\t$html = str_replace( '<!--open:code-->' , '[code' , $html );\n\t\t$html = str_replace( '<!--open:quote-->', '[quote', $html );\n\t\t$html = str_replace( '<!--open:url-->' , '[url' , $html );\n\t\t$html = str_replace( '<!--open:img-->' , '[img' , $html );\n\t\t\n\t\t/* Dollar signs confuse CKEditor */\n\t\t$html = str_replace( '$', '&#36;', $html );\n\t\t\n\t\t/* We want to restore CODE boxes */\n\t\tif ( preg_match( '#<pre\\s+?class=[\"\\']_prettyXprint#i', $html ) AND self::$Perms['parseHtml'] )\n\t\t{\n\t\t\t$html = $this->preToCode( $html );\n\t\t}\n\t\t\n\t\t/* ARGH MY EYES ARGH MY EYES SOMEONE DID A BAD WORD */\n\t\t$html = $this->parseBadWords( $html );\n\t\t\n\t\t/* Make sure no parse tags are correct */\n\t\t$html = $this->_processNoParseCodes( $html, 2 );\n\t\t$html = $this->_processNoParseCodes( $html, 3 );\n\t\t\n\t\treturn $html;\n\t}", "function normalize_all_indexical_content($content_only = false) {\r\n\t\t// capitalized; in other words, do not trust that about them.\r\n\t\t$initial_trust_headings = $this->config['trust_headings'];\r\n\t\t$this->config['trust_headings'] = false;\r\n\t\t$this->findingTOC = true;\r\n\t\tReTidy::words_init();\r\n\t\t$this->headings_normalized = 0;\r\n\t\tif($content_only) {\r\n\t\t\t$initial_code = $this->code;\r\n\t\t\t$contentArray = ReTidy::getContentArray($this->code);\r\n\t\t\t$content = $contentArray[0];\r\n\t\t\t$strpos = strpos($this->code, $content);\r\n\t\t\t$pre_content = substr($this->code, 0, $strpos);\r\n\t\t\t$post_content = substr($this->code, $strpos + strlen($content));\r\n\t\t\t$this->code = $content;\r\n\t\t}\r\n\t\t//$allTags = OM::getAllTags($this->code);\r\n\t\t// any inline tags may be indexical by ignoring their heredity...\r\n\t\t$allTags = OM::getAllBlockOStrings_for_normalize_indexical_content($this->code);\r\n\t\t//print('all tags: ');var_dump($allTags);\r\n\t\tforeach($allTags as $tagStringValue) {\r\n\t\t\t$tagString = $tagStringValue[0];\r\n\t\t\t//print('tagString: ');var_dump($tagString);\r\n\t\t\tif(ReTidy::isIndexical($tagString)) {\r\n\t\t\t\t//print('ReTidy::normalize_heading(tagString): ');var_dump(ReTidy::normalize_heading($tagString));\r\n\t\t\t\t$this->code = ReTidy::str_replace_first($tagString, ReTidy::normalize_heading($tagString), $this->code);\r\n\t\t\t}// else {\r\n\t\t\t//\tprint('not indexical<br>');\r\n\t\t\t//}\r\n\t\t}\r\n\t\tif($content_only) {\r\n\t\t\t$this->code = $pre_content . $this->code . $post_content;\r\n\t\t}\r\n\t\t$this->findingTOC = false;\r\n\t\t$this->logMsgIf(\"headings normalized\", $this->headings_normalized);\r\n\t\t$this->config['trust_headings'] = $initial_trust_headings;\r\n\t}", "public function compile()\n {\n\n $this->buildPage();\n\n if (defined('DEBUG_MARKUP') && DEBUG_MARKUP) {\n ob_start();\n $checkXml = new DOMDocument();\n\n if ($this instanceof LibTemplateAjax)\n $checkXml->loadXML($this->compiled);\n else\n $checkXml->loadHTML($this->compiled);\n\n $errors = ob_get_contents();\n ob_end_clean();\n\n // nur im fehlerfall loggen\n if ('' !== trim($errors)) {\n\n $this->getResponse()->addWarning('Invalid XML response');\n\n SFiles::write(PATH_GW.'log/tpl_xml_errors.html', $errors.'<pre>'.htmlentities($this->compiled).'</pre>');\n SFiles::write(PATH_GW.'log/tpl_xml_errors_'.date('Y-md-H-i_s').'.html', $errors.'<pre>'.htmlentities($this->compiled).'</pre>');\n }\n }\n\n if ($this->keyCachePage) {\n $this->writeCachedPage($this->keyCachePage , $this->compiled);\n }\n\n $this->output = $this->compiled;\n\n\n }" ]
[ "0.63611025", "0.59148884", "0.55321354", "0.54098475", "0.5329849", "0.53037584", "0.52936816", "0.5195309", "0.51933354", "0.5166601", "0.5163352", "0.51458573", "0.51394856", "0.50745714", "0.5069186", "0.50641274", "0.5062607", "0.50573236", "0.49869856", "0.49699768", "0.49696442", "0.4950563", "0.4922846", "0.49219242", "0.4919718", "0.49143872", "0.49136183", "0.4902616", "0.48390597", "0.48290396", "0.48290396", "0.4828247", "0.48269844", "0.48006117", "0.4800381", "0.4793281", "0.47874796", "0.4786521", "0.47818592", "0.47641253", "0.47574827", "0.47566447", "0.47566158", "0.47490105", "0.47464404", "0.47378495", "0.47364607", "0.47324172", "0.47285154", "0.4727789", "0.47267964", "0.47182247", "0.4710679", "0.47083005", "0.4697955", "0.46970084", "0.4696735", "0.46916914", "0.46863756", "0.46861926", "0.46830225", "0.4679606", "0.46768796", "0.46760893", "0.46742663", "0.46604082", "0.46580717", "0.4655002", "0.46480757", "0.4643302", "0.4642959", "0.46240708", "0.46129435", "0.4612755", "0.46109715", "0.46056512", "0.45970547", "0.45966232", "0.45950067", "0.4593513", "0.45932683", "0.45892012", "0.4588066", "0.45874742", "0.45856696", "0.45840308", "0.4580689", "0.45791456", "0.45752558", "0.45745882", "0.4569486", "0.45624465", "0.45575362", "0.4555298", "0.45527524", "0.45445797", "0.4540473", "0.45307744", "0.45305672", "0.4525772", "0.45122945" ]
0.0
-1
Parses TOML table names and returns the hierarchy array of table names.
private static function parseTableName($name) { // Init buffer $buffer = ''; $strOpen = false; $names = array(); $strLen = strlen($name); for($i = 0; $i < $strLen; $i++) { if($name[$i] == '"') { // Toggle strings if( !$strOpen || ($strOpen && $name[$i - 1] != "\\") ) { $strOpen = !$strOpen; } } elseif($name[$i] == '.' && !$strOpen) { // Save and cleanup buffer. Continue. $names[] = $buffer; $buffer = ''; continue; } // Store char $buffer .= $name[$i]; } // Save last buffer if($buffer != '') { $names[] = $buffer; } return $names; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _get_table_names() {\n // Must be overridden.\n return array();\n }", "final public function fetchTableNames() {\n if ($this->tableNames !== null) {\n return array_values($this->tableNames);\n }\n\n $names = $this->fetchTableNamesDb();\n\n $this->tableNames = [];\n foreach ($names as $name) {\n $name = $this->stripPrefix($name);\n $this->tableNames[strtolower($name)] = $name;\n }\n\n return array_values($this->tableNames);\n }", "public function getTableNameParts(string $name): array;", "abstract public function getRegexMatchingTableNames();", "public function get_table_names() {\n // Must be overridden.\n $out = $this->_get_table_names();\n return $out;\n }", "abstract protected function fetchTableNamesDb();", "public function getTableNames()\n {\n $query = \"\n SELECT DISTINCT\n TABLE_NAME\n FROM INFORMATION_SCHEMA.TABLES\n WHERE\n TABLE_TYPE='BASE TABLE' AND\n TABLE_SCHEMA = ?\n ORDER BY TABLE_NAME\n \";\n\n $query = \"\n select\n RDB$RELATION_NAME as TABLE_NAME\n from RDB$RELATIONS\n where\n ((RDB$RELATION_TYPE = 0) or\n (RDB$RELATION_TYPE is null)) and\n (RDB$SYSTEM_FLAG = 0)\n order by (RDB$RELATION_NAME)\n \";\n\n\n $statement = $this->pdo->prepare($query);\n $statement->execute(array($this->getSchema()));\n\n $tableNames = array();\n while ($tableName = $statement->fetchColumn(0)) {\n $tableNames[] = $tableName;\n }\n\n return $tableNames;\n }", "public function getTableNames();", "public function tableNames() {\n\t\t$inArray = func_get_args();\n\t\t$retVal = array();\n\n\t\tforeach ( $inArray as $name ) {\n\t\t\t$retVal[$name] = $this->tableName( $name );\n\t\t}\n\n\t\treturn $retVal;\n\t}", "public function tableNamesN() {\n\t\t$inArray = func_get_args();\n\t\t$retVal = array();\n\n\t\tforeach ( $inArray as $name ) {\n\t\t\t$retVal[] = $this->tableName( $name );\n\t\t}\n\n\t\treturn $retVal;\n\t}", "abstract public function getTablesArray();", "public function getAllTables(): array\n {\n $names_Tables = [];\n $Schemas = $this->getALLschema();\n foreach ($Schemas as $schema) {\n $names_Tables[] = $schema->getNameTable();\n }\n return $names_Tables;\n }", "protected function cleanTableNames() {}", "public static function getAllTables(){\n\t\t\t$dir = BDDJSON::$EMPLACEMENT_FICHIERS_BY_CMD;\n\t\t\t$lesFichiers = scandir($dir);\n\t\t\t$tabReturn = array();\n\t\t\tforeach($lesFichiers as $unFichier){\n\t\t\t\t$tab = explode(\".\", $unFichier);\n\t\t\t\t$extension = \".\".$tab[count($tab)-1];\n\t\t\t\tif($extension==BDDJSON::$NOM_DOCUMENT){\n\t\t\t\t\t$nomComplet = \"\";\n\t\t\t\t\tfor($i=0;$i<count($tab)-1;$i++){\n\t\t\t\t\t\tif($i==0){\n\t\t\t\t\t\t\t$nomComplet .= $tab[$i];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$nomComplet .= \".\".$tab[$i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tabReturn, $nomComplet);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $tabReturn;\n\t\t}", "abstract public function getTables();", "public function getTablesNames()\n {\n return [\n 'users',\n 'roles',\n 'role_user',\n 'permissions',\n 'permission_role',\n 'permission_user',\n ];\n }", "public function getTables();", "public function getTables();", "public function getTables();", "function serendipity_parse_sql_tables($filename) {\n $in_table = 0;\n $queries = array();\n\n $fp = fopen($filename, 'r', 1);\n if ($fp) {\n while (!@feof($fp)) {\n $line = trim(fgets($fp, 4096));\n if ($in_table) {\n $def .= $line;\n if (preg_match('/^\\)\\s*(type\\=\\S+|\\{UTF_8\\})?\\s*\\;$/i', $line)) {\n $in_table = 0;\n array_push($queries, $def);\n }\n } else {\n if (preg_match('#^create table \\{PREFIX\\}\\S+\\s*\\(#i', $line)) {\n $in_table = 1;\n $def = $line;\n }\n\n if (preg_match('#^create\\s*(\\{fulltext\\}|unique|\\{fulltext_mysql\\})?\\s*index#i', $line)) {\n array_push($queries, $line);\n }\n }\n }\n fclose($fp);\n }\n\n return $queries;\n}", "public function getTables()\n {\n\treturn $this->query('select [name] from [tables]');\n }", "public function getTableNames(): array\n {\n return $this->tableNames;\n }", "static public function list_all_tables()\n\t{\n\t\t$file_array = array_filter( scandir( LOCAL_DOCUMENT_ROOT.\"/schema/\" ), \"Common::filter_table_folder\" );\n\t\t$table_array = array();\n\t\tforeach( $file_array as $file_name ) {\n\t\t\t$table_array[] = substr( $file_name, 0, -4 ); //remove .php\n\t\t}\n\t\treturn $table_array;\n\t}", "public function getTablesDefinition()\n {\n $query = $this->db_instance->query('SHOW TABLES');\n $tables_a = $query->result_array();\n $tables = array();\n\n foreach ($tables_a as $table) {\n $table = array_pop($table);\n $tables[$table] = $this->getDefinitionFromTable($table);\n }\n\n return $tables;\n }", "function getTableNames() {\n return [\"users\" => [], \"universities\" => [\"programs\", \"scholarships\", \"costs\"], \"students\" => []];\n}", "public static function getTableDefList(string $path) {\n // make build_# files from filenames in $path\n $list = [];\n $tdir = Path::endSep($path);\n $dir = scandir($tdir);\n foreach ($dir as $item) {\n $info = pathinfo($item);\n if (array_key_exists('extension', $info)) {\n if ($info['extension'] == 'toml') {\n $tdef = new TableDef();\n $tdef->readTOML($tdir . $info['filename'] . '.toml');\n $list[$tdef->getName()] = $tdef;\n }\n }\n }\n return $list;\n }", "abstract protected function loadTableChecks(string $tableName): array;", "public function delegateListTableNames();", "private function makeTableNamesArray($array){\n\n \t\t$tableNames;\n \t \t$count = 0;\n\n \t\n\t \tforeach($array as $row){\n\t $searchElement = $row['table_name'];\n\t if($count !=0 && $searchElement != $tableNames[$count-1] ){\n\t $tableNames[$count]=$searchElement;\n\t $count++;\n\t }\n\t else if ($count == 0){\n\t $tableNames[0] = $array[0]['table_name'];\n\t $count++;\n\t }\n\n\t }\n\n \treturn $tableNames;\n \t}", "protected static function get_tables(){\n\n\t\t$tables_by_model = static::_scandir(static::path(null, '', static::$models_dir));\n\n\t\tforeach ($tables_by_model as &$table) {\n\n\t\t\tif(stripos(File::get(static::$models_dir.'/'.$table), 'Filedb'))\n\t\t\t{\n\t\t\t\t$table_model_file = substr($table, 0, -4);\n\t\t\t\t$tables[] = $table_model_file::get_table($table_model_file);\n\t\t\t}\n\n\t\t\tunset($table);\n\t\t}\n\t\t\n\t\treturn $tables;\n\t}", "function getTables($selector = '.rptTable')\n\t{\n\t\t$tables = array();\n\t\tif(is_object($this->dom))\n\t\t{\n\t\t\t$contentTables = $this->dom->find($selector);\n\t\t\tforeach ($contentTables as $table)\n\t\t\t{\n\t\t\t\t$tables[] = $table->children();\n\t\t\t}\n\t\t}\n\n\t\treturn $tables ? $tables : array();\n\t}", "public function &getTables();", "protected function getTables() {\n \n $sm = $this->db->getSchemaManager();\n\n $tables = array(); \n \n foreach ($sm->listTables() as $table) {\n if ( strpos($table->getName(), $this->prefix) == 0 ) {\n foreach ($table->getColumns() as $column) {\n $tables[ $table->getName() ][ $column->getName() ] = $column->getType(); \n }\n // $output[] = \"Found table <tt>\" . $table->getName() . \"</tt>.\";\n }\n }\n \n return $tables;\n \n }", "public function getAllTables() {\n return array_unique(array_values($this->alias2table));\n }", "function tablesList ()\n {\n $sql = \"SELECT a.relname AS name\n FROM pg_class a, pg_user b\n WHERE ( relkind = 'r') and relname !~ '^pg_' AND relname !~ '^sql_'\n AND relname !~ '^xin[vx][0-9]+' AND b.usesysid = a.relowner\n AND NOT (EXISTS (SELECT viewname FROM pg_views WHERE viewname=a.relname));\";\n\n $result = $this->all($sql);\n\n if (!$result)\n {\n trigger_error(ERROR_NO_TABLE_LIST, E_USER_ERROR);\n exit;\n }\n else\n {\n $tables = array();\n foreach ($result as $item) $tables[] = $item['name'];\n return $tables;\n }\n }", "public function getEntityNamespaces() {\n return array_reduce($this->get(), function($carry, $item) {\n $carry[$item->table['name']] = $item->getName();\n return $carry;\n }, []);\n }", "protected function get_table_name() {\n\t\treturn Model::get_table_name( 'Indexable_Hierarchy' );\n\t}", "public function getListOfTables() {}", "public function retrieveAbleTables(): array\n {\n $tables = [];\n\n // iterate on every table\n foreach (DbalService::getTablesColumnsMap() as $table => $columns) {\n\n if ($table == $this->internalTable) {\n continue;\n }\n\n foreach ($columns as $columnName => $column) {\n // if the table has one or both columns,\n if (in_array($columnName, [$this->createdAtColumnName, $this->updatedAtColumnName])) {\n $tables[] = $table;\n break;\n }\n }\n\n }\n\n return $tables;\n }", "public function getAllTables()\n {\n return $this->connection->select(\n $this->grammar->compileGetAllTables(\n $this->parseSearchPath(\n $this->connection->getConfig('search_path') ?: $this->connection->getConfig('schema')\n )\n )\n );\n }", "function table_list()\n{\n\t//TODO - a similar function is in db_verify.php. Should probably all be moved to mysql_class.php.\n\n\t$exclude = array();\n\t$exclude[] = \"core\";\n\t$exclude[] = \"rbinary\";\n\t$exclude[] = \"parser\";\n\t$exclude[] = \"tmp\";\n\t$exclude[] = \"online\";\n\t$exclude[] = \"upload\";\n\t$exclude[] = \"user_extended_country\";\n\t$exclude[] = \"plugin\";\n\n\t$coreTables = e107::getDb()->db_TableList('nolan');\n\n\t$tables = array_diff($coreTables,$exclude);\n\n\tforeach($tables as $e107tab)\n\t{\n\t\t$count = e107::getDb()->gen(\"SELECT * FROM #\".$e107tab);\n\n\t\tif($count)\n\t\t{\n\t\t\t$tabs[$e107tab] = $count;\n\t\t}\n\t}\n\n\treturn $tabs;\n}", "function get_tables() {\r\n\t\t$tables = $this->query_array('SHOW TABLES');\r\n\t\t$table_names = array();\r\n\r\n\t\tforeach ($tables as $table) {\r\n\t\t\t$table_name = current($table);\r\n\r\n\t\t\t$table_names[$table_name] = $table_name;\r\n\r\n\t\t}\r\n\r\n\t\treturn $table_names;\r\n\r\n\t}", "function GetTablesList()\n\t{\n\t\t$this->FillTablesList();\n\t\t$res=array();\n\t\tforeach($this->lstTables as $tbl)\n\t\t\t$res[]=$tbl[\"name\"];\n\t\treturn $res;\n\t}", "public function getTableList()\n\t{\n\t\t$result = [];\n\t\tforeach ($this->manager->getDataSources($this->languageId) as $tableName => $tableInfo)\n\t\t{\n\t\t\t$result[] = [\n\t\t\t\t$tableName,\n\t\t\t\t$tableInfo['TABLE_DESCRIPTION'],\n\t\t\t];\n\t\t}\n\t\treturn $result;\n\t}", "function tableNames() {\n\t\treturn \"SELECT name FROM sqlite_master WHERE type='table' AND name!='sqlite_sequence' ORDER BY name\";\n\t}", "private function getTableNames(){\n $exceptions = array_merge(\n self::EXCEPTION_TABLES,\n explode(\",\",str_replace(' ','',$this->params['exceptions']))\n );\n $exceptions = array_filter($exceptions);\n $this->tables = DB::table('information_schema.tables')->select([\n 'table_name'\n ])->where('table_schema','public')->whereNotIn('table_name',$exceptions)->get();\n }", "function create_table_list(){\n $tables = \"{$this->table_name}\";\n if(isset($this->joined_tables) && count($this->joined_tables)){\n foreach($this->joined_tables as $t){\n if(array_key_exists('TABLE', $t) && array_key_exists('ON', $t)){\n $type = (array_key_exists('TYPE', $t)? $t['TYPE']: \"INNER JOIN\");\n $tables .= \" $type {$t['TABLE']} ON {$t['ON']}\";\n }\n }\n }\n return $tables;\n }", "public function getTableList()\n\t{\n\t\t$this->connect();\n\n\t\t$type = 'table';\n\n\t\t$query = $this->getQuery(true)\n\t\t\t->select('name')\n\t\t\t->from('sqlite_master')\n\t\t\t->where('type = :type')\n\t\t\t->bind(':type', $type)\n\t\t\t->order('name');\n\n\t\t$this->setQuery($query);\n\n\t\t$tables = $this->loadColumn();\n\n\t\treturn $tables;\n\t}", "protected function getTableObjects()\n {\n\n $sm = $this->app['db']->getSchemaManager();\n\n $tables = array();\n\n foreach ($sm->listTables() as $table) {\n if (strpos($table->getName(), $this->prefix) == 0) {\n $tables[$table->getName()] = $table;\n }\n }\n\n return $tables;\n\n }", "public function testResultGetTableNames()\n {\n $this->assertEquals(array('test'), $this->conn->query('SELECT * FROM test')->getTableNames());\n \t$this->assertEquals(array('test', 'child'), $this->conn->query('SELECT * FROM test INNER JOIN child ON test.id = child.idTest')->getTableNames(), \"test, child\");\n }", "protected function getTcaTables() {}", "public static function getTables() {\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 }", "public function getTables() {\n $stmt = $this->pdo->query(\"SELECT table_name \n FROM information_schema.tables \n WHERE table_schema= 'public' \n AND table_type='BASE TABLE'\n ORDER BY table_name\");\n $tableList = [];\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $tableList[] = $row['table_name'];\n }\n\n return $tableList;\n }", "abstract public function getTableName();", "abstract public function getTableName();", "abstract public function getTableName();", "abstract protected function getTableName();", "abstract protected function getTableName();", "public function getTables() {\n $stmt = $this->pdo->query(\"SELECT table_name \n FROM information_schema.tables \n WHERE table_schema= 'public' \n AND table_type='BASE TABLE'\n ORDER BY table_name\");\n $tableList = [];\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $tableList[] = $row['table_name'];\n }\n \n return $tableList;\n }", "public function getTables(){\n $pdo = $this->pdo;\n $statement = $pdo->prepare(\"SHOW TABLES FROM $this->name;\");\n $statement->execute();\n $tables = $statement->fetchAll($pdo::FETCH_NUM);\n foreach($tables as &$table)\n $table = $table[0];\n return $tables;\n }", "public function getAllTabelas() {\n \t$sql = \"select\n \t\t\t\t\ttable_name,\n \t\t\t\t\ttable_schema\n\t\t\t\tfrom\n\t\t\t\t\tINFORMATION_SCHEMA.TABLES\n\t\t\t\twhere\n\t\t\t\t\tTABLE_TYPE = 'BASE TABLE'\";\n \t\n \t$this->execute($sql);\n \t$aDados = array();\n \twhile ($aReg = $this->fetchReg()){\n \t\t$aDados[] = $aReg;\n \t}\n \treturn $aDados;\n }", "function get_table_annexe_name($name) {\r\n\t\t$arr = @split(\"_\",$name);\r\n\r\n\t\tif ($arr[count($arr)-1]>0) {\r\n\t\t\tarray_pop($arr);\r\n\t\t}\r\n\t\t$arr = @join(\"_\",$arr);\r\n\r\n\t\treturn $arr;\r\n}", "public function getFieldNames( $table );", "public function getTableName();", "public function getTableName();", "abstract protected function _listTables();", "public function getTableList()\n\t{\n\t\treturn [];\n\t}", "function table_names($includeViews=true)\n\t{\n\t\t// query\n\t\t$this->query(\"SHOW \".(!$includeViews ? \"FULL\" : \"\").\" TABLES\");\n\n\t\t// get table names\n\t\t$result = array();\n\t\tfor ($i=0; $info = mysqli_fetch_row($this->m_query_id); $i++)\n\t\t{\n\t\t\t// ignore views?\n\t\t\tif (!$includeViews && strtoupper($info[1]) == 'VIEW') continue;\n\n\t\t\t$result[$i][\"table_name\"] = $info[0];\n\t\t\t$result[$i][\"tablespace_name\"] = $this->m_database;\n\t\t\t$result[$i][\"database\"] = $this->m_database;\n\t\t}\n\n\t\t// return result\n\t\treturn $result;\n\t}", "private function getTableNames()\n {\n $this->tableNames = [\n 'eav_attribute' => $this->resource->getTableName('eav_attribute'),\n 'EnitureModules' => $this->resource->getTableName('EnitureModules'),\n ];\n }", "protected function findTableNames($schema = '')\n {\n $sql = 'SELECT\n rdb$relation_name\n FROM\n rdb$relations\n WHERE\n (rdb$view_blr is null) AND\n (rdb$system_flag is null OR rdb$system_flag=0)';\n try {\n $tables = $this->db->createCommand($sql)->queryColumn();\n } catch (Exception $e) {\n return false;\n }\n\n foreach ($tables as $key => $table) {\n $tables[$key] = strtolower(rtrim($table));\n }\n\n return $tables;\n }", "public function getTcaTables() {}", "public static function tables()\n {\n $tables = false;\n //\n $Tables = Driver::read('SHOW TABLES', Driver::INDEX);\n // die(var_dump($Tables));\n //\n foreach ($Tables as $row) {\n $target_tables[] = $row[0];\n }\n //\n if ($tables !== false) {\n $target_tables = array_intersect($target_tables, $tables);\n }\n //\n return $target_tables;\n }", "public function getTableName() ;", "public function findTableNames($schema='')\n\t{\n\t\tif($schema==='')\n\t\t{\n\t\t\t$sql=<<<EOD\nSELECT table_name, '{$schema}' as table_schema FROM user_tables\nEOD;\n\t\t\t$command=$this->getDbConnection()->createCommand($sql);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sql=<<<EOD\nSELECT object_name as table_name, owner as table_schema FROM all_objects\nWHERE object_type = 'TABLE' AND owner=:schema\nEOD;\n\t\t\t$command=$this->getDbConnection()->createCommand($sql);\n\t\t\t$command->bindParam(':schema',$schema);\n\t\t}\n\n\t\t$rows=$command->queryAll();\n\t\t$names=array();\n\t\tforeach($rows as $row)\n\t\t{\n\t\t\tif($schema===$this->getDefaultSchema() || $schema==='')\n\t\t\t\t$names[]=$row['TABLE_NAME'];\n\t\t\telse\n\t\t\t\t$names[]=$row['TABLE_SCHEMA'].'.'.$row['TABLE_NAME'];\n\t\t}\n\t\treturn $names;\n\t}", "private function _loadTableNames() {\n\t\tif ($this->_cache && $tableNames = $this->_cache->load('rsc_simpledb_tablenames')) {\n\t\t\t$this->_tableNames = $tableNames;\n\t\t}\n\n\t\t$this->_tableNames = $this->_db->listTables();\n\n\t\tif ($this->_cache) {\n\t\t\t$this->_saveTableNamesCache();\n\t\t}\n\t}", "protected static function get_eloquent_tables(){\n\n\t\t$tables_by_model = static::_scandir(static::path(null, '', static::$models_dir));\n\n\t\tforeach ($tables_by_model as &$table) {\n\n\t\t\tif(stripos(File::get(static::$models_dir.'/'.$table), 'Eloquent'))\n\t\t\t{\n\t\t\t\t$table_model_file = substr($table, 0, -4);\n\t\t\t\t$tables[] = $table_model_file::get_table($table_model_file);\n\t\t\t}\n\n\t\t\tunset($table);\n\t\t}\n\t\t\n\t\treturn $tables;\n\t}", "function get_managerDB_base_tableNames(){\n global $msManager_link, $managerDBname;\n $tableNameArr = array();\n $sql = \"SHOW TABLES FROM $managerDBname\";\n $result = mysqli_query($msManager_link, $sql);\n if($result){\n while($row = mysqli_fetch_row($result)){\n if(!strstr($row[0], 'SearchResults') && !strstr($row[0], 'SearchTasks') && !strstr($row[0], 'Plate_Conf')){\n array_push($tableNameArr, $row[0]);\n } \n }\n mysqli_free_result($result);\n }\n if($tableNameArr){\n return $tableNameArr;\n }else{\n return 0;\n } \n}", "public function getTablesName()\n {\n return array_keys($this->tables);\n }", "abstract public static function getTableName();", "abstract public static function getTableName();", "public function getDatabaseTableDefinitions() {}", "abstract protected function loadTableUniques(string $tableName): array;", "protected function _parseTagTable() {}", "protected function getAllTables()\n {\n return $this->getConnection()->select(\n $this->grammar->compileGetAllTables()\n );\n }", "public function getSubNodeNames();", "public function list_tables(){\n if (!$this->select_db($this->_currentDB))\n \t return FALSE;\n \t$tables=array();\n \t$table_exts=array($this->_index_ext,$this->_data_ext,$this->_frame_ext);\n \t$dbpath=$this->_db_root_dir.$this->_currentDB;\n \t$d=dir($dbpath);\n \twhile($tmp=$d->read()){\n $fileInfo = pathinfo($dbpath.'/'.$tmp);\n if(is_file($dbpath.'/'.$tmp) && $fileInfo['extension']=='txt'){\n \t$tmp=str_replace($table_exts,'',$tmp);\n \t\t$tables[]=$tmp;\t\n }\n \t}\n \t$tables=array_unique($tables);\n \treturn $tables;\n }", "public function classNameToTableNameMappings()\n {\n return [\n [\\Neos\\Party\\Domain\\Model\\Person::class, 'neos_party_domain_model_person'],\n ['SomePackage\\Domain\\Model\\Blob', 'somepackage_domain_model_blob'],\n [Security\\Policy\\Role::class, 'neos_flow_security_policy_role'],\n [Security\\Account::class, 'neos_flow_security_account'],\n ['Neos\\Flow\\Security\\Authorization\\Resource\\SecurityPublishingConfiguration', 'neos_flow_security_authorization_resource_securitypublishi_07c54']\n ];\n }", "abstract protected function loadTableIndexes(string $tableName): array;", "function Table_Names(){\n\t\t$database=DatabaseName();\n\t\t$tables = array();\n\t\t$list_tables_sql = \"SHOW TABLES FROM {$database};\";\n\t\t$result = mysql_query($list_tables_sql);\n\t\tif($result){\n\t\t\twhile($table = mysql_fetch_row($result))\n\t\t\t{\n\t\t\t\t$tables[] = $table[0];\n\t\t\t}\n\t\t}\n\t\treturn $tables;\n\t}", "public function getTables() {\n\t\treturn $this->adapter->getCol( \"SELECT name FROM sqlite_master\n\t\t\tWHERE type='table' AND name!='sqlite_sequence';\" );\n\t}", "function get_chado_table_list() {\n $sql_table_list = \"SELECT table_name FROM information_schema.tables WHERE table_schema = 'chado' ORDER BY table_name;\";\n $result_table = db_query($sql_table_list);\n $input_table = $result_table->fetchAll();\n $table_list = [];\n foreach ($input_table as $value) {\n $table_list[] = $value->table_name;\n }\n return $table_list;\n}", "abstract function tableName();", "function load_tables() {\n return $this->_load_tables('/oblyon/sql/');\n }", "function getTableNames() {\n\n //Gets tablenames from the database\n Global $serverInfo;\n $conn = connect();\n $sql = \"SHOW TABLES FROM \" . $serverInfo[3];\n $result = $conn->query($sql);\n\n //Outputs data if information was found\n $tableArray = [];\n if ($result->num_rows > 0) {\n\n //Writes found data into an array\n $i = 0;\n while ($row = $result->fetch_assoc() ) {\n $tableArray[$i] = $row[\"Tables_in_\" . $serverInfo[3] ];\n $i++;\n }\n return $tableArray;\n }\n}", "function getTableName($str){\n\t\t//$ditchMe = substr($str,-3,3);\n\t\t$ditchMe = strrchr($str,'_');\n\t\tif(strlen($ditchMe)>0){\n\t\t\t$arr = explode($ditchMe ,$str);\n\t\t\treturn $arr[0];\n\t\t}else{\n\t\t\treturn '';\n\t\t}\n\t\t\n\t//\treturn $tName;\n\t}", "public function get_tables()\n\t{\n\t\treturn $this->driver_query('table_list');\n\t}", "abstract public function tableName();", "abstract public function tableName();", "public function getAllTables()\n {\n return $this->connection->select(\n $this->grammar->compileGetAllTables((array) $this->connection->getConfig('schema'))\n );\n }" ]
[ "0.6384318", "0.632922", "0.6261423", "0.623077", "0.60588753", "0.6050146", "0.60328686", "0.6030407", "0.6005494", "0.5901493", "0.5889998", "0.58496225", "0.5742916", "0.5731007", "0.57150316", "0.564707", "0.56369394", "0.56369394", "0.56369394", "0.56118894", "0.5576609", "0.55726", "0.5561919", "0.5521438", "0.55151534", "0.550535", "0.54859626", "0.548057", "0.5480193", "0.5455072", "0.5415802", "0.5411073", "0.5362055", "0.535491", "0.5352739", "0.53403187", "0.5328789", "0.5317175", "0.5316686", "0.5308497", "0.53070295", "0.5290492", "0.5273522", "0.5272533", "0.52676755", "0.52552265", "0.52537096", "0.52404284", "0.52361673", "0.52317077", "0.5218077", "0.52165455", "0.5207699", "0.5188471", "0.51850986", "0.51850986", "0.51850986", "0.51795244", "0.51795244", "0.51692075", "0.514914", "0.5148307", "0.5137974", "0.5136039", "0.5135538", "0.5135538", "0.5125001", "0.5111056", "0.51109844", "0.51028687", "0.51009995", "0.50985634", "0.50957423", "0.50950897", "0.5087996", "0.50874275", "0.5083922", "0.5082412", "0.5077823", "0.50723654", "0.50723654", "0.50716007", "0.50511694", "0.5048243", "0.5046023", "0.5034587", "0.50341505", "0.5016659", "0.5008982", "0.50026095", "0.49958962", "0.4992113", "0.49825943", "0.4978877", "0.49780217", "0.49764487", "0.4970932", "0.49701634", "0.49701634", "0.49661702" ]
0.62113935
4
Parses TOML value and returns it to be assigned on the hashed array
private static function parseValue($val) { $parsedVal = null; // Cleanup $val = trim($val); if($val === '') { throw new Exception('Empty value not allowed'); } // Boolean if($val == 'true' || $val == 'false') { $parsedVal = ($val == 'true'); } // Literal multi-line string elseif(substr($val, 0, 3) == "'''" && substr($val, -3) == "'''") { $parsedVal = substr($val, 3, -3); // Trim first newline on multi-line string definition if($parsedVal[0] == "\n") { $parsedVal = substr($parsedVal, 1); } } // Literal string elseif($val[0] == "'" && substr($val, -1) == "'") { // No newlines allowed if(strpos($val, "\n") !== false) { throw new Exception('New lines not allowed on single line string literals.'); } $parsedVal = substr($val, 1, -1); } // Multi-line string elseif(substr($val, 0, 3) == '"""' && substr($val, -3) == '"""') { $parsedVal = substr($val, 3, -3); // Trim first newline on multi-line string definition if($parsedVal[0] == "\n") { $parsedVal = substr($parsedVal, 1); } // Use json_decode to finally parse the string. $parsedVal = json_decode('"' . str_replace("\n", '\n', $parsedVal) . '"'); } // String elseif($val[0] == '"' && substr($val, -1) == '"') { // TOML's specification says it's the same as for JSON format... so $parsedVal = json_decode($val); } // Numbers elseif(is_numeric(str_replace('_', '', $val))) { $val = str_replace('_', '', $val); $intVal = filter_var($val, FILTER_VALIDATE_INT); if($intVal !== false) { $parsedVal = $intVal; } else { $parsedVal = (float) $val; } } // Datetime. Parsed to UNIX time value. elseif(self::isISODate($val)) { $parsedVal = new DateTime($val); } // Single line array (normalized) elseif($val[0] == '[' && substr($val, -1) == ']') { $parsedVal = self::parseArray($val); } // Inline table (normalized) elseif($val[0] == '{' && substr($val, -1) == '}') { $parsedVal = self::parseInlineTable($val); } else { throw new Exception('Unknown value type: ' . $val); } return $parsedVal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function parseValue();", "abstract public function parse($value);", "function parseValue($value);", "protected function parse()\n {\n if($this->isRelationalKey()){\n $this->parsedValue = $this->makeRelationInstruction();\n } \n else {\n $this->parsedValue = $this->parseFlatValue($this->value);\n } \n }", "abstract public static function parse($value);", "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}", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "static public function load($value) {\n\t\t$value = trim ( $value );\n\t\t\n\t\tif (0 == strlen ( $value )) {\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\tswitch ($value [0]) {\n\t\t\tcase '[' :\n\t\t\t\treturn self::parseSequence ( $value );\n\t\t\tcase '{' :\n\t\t\t\treturn self::parseMapping ( $value );\n\t\t\tdefault :\n\t\t\t\treturn self::parseScalar ( $value );\n\t\t}\n\t}", "public function convertToDrupalValue($value);", "public function parse(string $value);", "public function parse();", "public function parse();", "public function parse();", "abstract public function parse ();", "public function parseValue($value)\n {\n return $value;\n }", "public function parseValue($value)\n\t{\n\n\t\treturn $value;\n\n\t}", "public function parse()\n {\n if ($this->object->extension() == 'md') {\n return (new Markdown())->parse($this->object->getValue());\n }\n\n return $this->object->getValue();\n }", "public function _parseFunc($theValue, $conf)\n {\n if (!empty($conf['if.']) && !$this->checkIf($conf['if.'])) {\n return $theValue;\n }\n // Indicates that the data is from within a tag.\n $inside = false;\n // Pointer to the total string position\n $pointer = 0;\n // Loaded with the current typo-tag if any.\n $currentTag = '';\n $stripNL = 0;\n $contentAccum = [];\n $contentAccumP = 0;\n $allowTags = strtolower(str_replace(' ', '', $conf['allowTags']));\n $denyTags = strtolower(str_replace(' ', '', $conf['denyTags']));\n $totalLen = strlen($theValue);\n do {\n if (!$inside) {\n if (!is_array($currentTag)) {\n // These operations should only be performed on code outside the typotags...\n // data: this checks that we enter tags ONLY if the first char in the tag is alphanumeric OR '/'\n $len_p = 0;\n $c = 100;\n do {\n $len = strcspn(substr($theValue, $pointer + $len_p), '<');\n $len_p += $len + 1;\n $endChar = ord(strtolower(substr($theValue, $pointer + $len_p, 1)));\n $c--;\n } while ($c > 0 && $endChar && ($endChar < 97 || $endChar > 122) && $endChar != 47);\n $len = $len_p - 1;\n } else {\n // If we're inside a currentTag, just take it to the end of that tag!\n $tempContent = strtolower(substr($theValue, $pointer));\n $len = strpos($tempContent, '</' . $currentTag[0]);\n if (is_string($len) && !$len) {\n $len = strlen($tempContent);\n }\n }\n // $data is the content until the next <tag-start or end is detected.\n // In case of a currentTag set, this would mean all data between the start- and end-tags\n $data = substr($theValue, $pointer, $len);\n if ($data != '') {\n if ($stripNL) {\n // If the previous tag was set to strip NewLines in the beginning of the next data-chunk.\n $data = preg_replace('/^[ ]*' . CR . '?' . LF . '/', '', $data);\n }\n // These operations should only be performed on code outside the tags...\n if (!is_array($currentTag)) {\n // Constants\n $tsfe = $this->getTypoScriptFrontendController();\n $tmpConstants = $tsfe->tmpl->setup['constants.'];\n if ($conf['constants'] && is_array($tmpConstants)) {\n foreach ($tmpConstants as $key => $val) {\n if (is_string($val)) {\n $data = str_replace('###' . $key . '###', $val, $data);\n }\n }\n }\n // Short\n if (is_array($conf['short.'])) {\n $shortWords = $conf['short.'];\n krsort($shortWords);\n foreach ($shortWords as $key => $val) {\n if (is_string($val)) {\n $data = str_replace($key, $val, $data);\n }\n }\n }\n // stdWrap\n if (is_array($conf['plainTextStdWrap.'])) {\n $data = $this->stdWrap($data, $conf['plainTextStdWrap.']);\n }\n // userFunc\n if ($conf['userFunc']) {\n $data = $this->callUserFunction($conf['userFunc'], $conf['userFunc.'], $data);\n }\n // Makelinks: (Before search-words as we need the links to be generated when searchwords go on...!)\n if ($conf['makelinks']) {\n $data = $this->http_makelinks($data, $conf['makelinks.']['http.']);\n $data = $this->mailto_makelinks($data, $conf['makelinks.']['mailto.']);\n }\n // Search Words:\n if ($tsfe->no_cache && $conf['sword'] && is_array($tsfe->sWordList) && $tsfe->sWordRegEx) {\n $newstring = '';\n do {\n $pregSplitMode = 'i';\n if (isset($tsfe->config['config']['sword_noMixedCase']) && !empty($tsfe->config['config']['sword_noMixedCase'])) {\n $pregSplitMode = '';\n }\n $pieces = preg_split('/' . $tsfe->sWordRegEx . '/' . $pregSplitMode, $data, 2);\n $newstring .= $pieces[0];\n $match_len = strlen($data) - (strlen($pieces[0]) + strlen($pieces[1]));\n $inTag = false;\n if (strstr($pieces[0], '<') || strstr($pieces[0], '>')) {\n // Returns TRUE, if a '<' is closer to the string-end than '>'.\n // This is the case if we're INSIDE a tag (that could have been\n // made by makelinks...) and we must secure, that the inside of a tag is\n // not marked up.\n $inTag = strrpos($pieces[0], '<') > strrpos($pieces[0], '>');\n }\n // The searchword:\n $match = substr($data, strlen($pieces[0]), $match_len);\n if (trim($match) && strlen($match) > 1 && !$inTag) {\n $match = $this->wrap($match, $conf['sword']);\n }\n // Concatenate the Search Word again.\n $newstring .= $match;\n $data = $pieces[1];\n } while ($pieces[1]);\n $data = $newstring;\n }\n }\n $contentAccum[$contentAccumP] .= $data;\n }\n $inside = true;\n } else {\n // tags\n $len = strcspn(substr($theValue, $pointer), '>') + 1;\n $data = substr($theValue, $pointer, $len);\n if (StringUtility::endsWith($data, '/>') && strpos($data, '<link ') !== 0) {\n $tagContent = substr($data, 1, -2);\n } else {\n $tagContent = substr($data, 1, -1);\n }\n $tag = explode(' ', trim($tagContent), 2);\n $tag[0] = strtolower($tag[0]);\n if ($tag[0][0] === '/') {\n $tag[0] = substr($tag[0], 1);\n $tag['out'] = 1;\n }\n if ($conf['tags.'][$tag[0]]) {\n $treated = false;\n $stripNL = false;\n // in-tag\n if (!$currentTag && !$tag['out']) {\n // $currentTag (array!) is the tag we are currently processing\n $currentTag = $tag;\n $contentAccumP++;\n $treated = true;\n // in-out-tag: img and other empty tags\n if (preg_match('/^(area|base|br|col|hr|img|input|meta|param)$/i', $tag[0])) {\n $tag['out'] = 1;\n }\n }\n // out-tag\n if ($currentTag[0] === $tag[0] && $tag['out']) {\n $theName = $conf['tags.'][$tag[0]];\n $theConf = $conf['tags.'][$tag[0] . '.'];\n // This flag indicates, that NL- (13-10-chars) should be stripped first and last.\n $stripNL = (bool)$theConf['stripNL'];\n // This flag indicates, that this TypoTag section should NOT be included in the nonTypoTag content.\n $breakOut = (bool)$theConf['breakoutTypoTagContent'];\n $this->parameters = [];\n if ($currentTag[1]) {\n $params = GeneralUtility::get_tag_attributes($currentTag[1]);\n if (is_array($params)) {\n foreach ($params as $option => $val) {\n $this->parameters[strtolower($option)] = $val;\n }\n }\n }\n $this->parameters['allParams'] = trim($currentTag[1]);\n // Removes NL in the beginning and end of the tag-content AND at the end of the currentTagBuffer.\n // $stripNL depends on the configuration of the current tag\n if ($stripNL) {\n $contentAccum[$contentAccumP - 1] = preg_replace('/' . CR . '?' . LF . '[ ]*$/', '', $contentAccum[$contentAccumP - 1]);\n $contentAccum[$contentAccumP] = preg_replace('/^[ ]*' . CR . '?' . LF . '/', '', $contentAccum[$contentAccumP]);\n $contentAccum[$contentAccumP] = preg_replace('/' . CR . '?' . LF . '[ ]*$/', '', $contentAccum[$contentAccumP]);\n }\n $this->data[$this->currentValKey] = $contentAccum[$contentAccumP];\n $newInput = $this->cObjGetSingle($theName, $theConf, '/parseFunc/.tags.' . $tag[0]);\n // fetch the content object\n $contentAccum[$contentAccumP] = $newInput;\n $contentAccumP++;\n // If the TypoTag section\n if (!$breakOut) {\n $contentAccum[$contentAccumP - 2] .= $contentAccum[$contentAccumP - 1] . $contentAccum[$contentAccumP];\n unset($contentAccum[$contentAccumP]);\n unset($contentAccum[$contentAccumP - 1]);\n $contentAccumP -= 2;\n }\n unset($currentTag);\n $treated = true;\n }\n // other tags\n if (!$treated) {\n $contentAccum[$contentAccumP] .= $data;\n }\n } else {\n // If a tag was not a typo tag, then it is just added to the content\n $stripNL = false;\n if (GeneralUtility::inList($allowTags, $tag[0]) || $denyTags !== '*' && !GeneralUtility::inList($denyTags, $tag[0])) {\n $contentAccum[$contentAccumP] .= $data;\n } else {\n $contentAccum[$contentAccumP] .= htmlspecialchars($data);\n }\n }\n $inside = false;\n }\n $pointer += $len;\n } while ($pointer < $totalLen);\n // Parsing nonTypoTag content (all even keys):\n reset($contentAccum);\n $contentAccumCount = count($contentAccum);\n for ($a = 0; $a < $contentAccumCount; $a++) {\n if ($a % 2 != 1) {\n // stdWrap\n if (is_array($conf['nonTypoTagStdWrap.'])) {\n $contentAccum[$a] = $this->stdWrap($contentAccum[$a], $conf['nonTypoTagStdWrap.']);\n }\n // userFunc\n if ($conf['nonTypoTagUserFunc']) {\n $contentAccum[$a] = $this->callUserFunction($conf['nonTypoTagUserFunc'], $conf['nonTypoTagUserFunc.'], $contentAccum[$a]);\n }\n }\n }\n return implode('', $contentAccum);\n }", "public function parsedVal()\n {\n if (!isset($this->parsedVal[$this->lang()])) {\n $val = $this->propertyVal();\n\n if ($val === null) {\n return null;\n }\n $val = $this->p()->parseVal($val);\n\n // Could be Translation instance\n // Could be array\n if (isset($val[$this->lang()])) {\n $val = $val[$this->lang()];\n }\n\n // Doing this in the parseVal method of abstract property\n // was causing multiple && l10n properties not to save.\n if (!is_array($val) && $this->p()['multiple']) {\n $val = explode($this->p()->multipleSeparator(), $val);\n }\n\n $this->parsedVal[$this->lang()] = $val;\n }\n return $this->parsedVal[$this->lang()];\n }", "private function parse($text)\n {\n // Parse iteration ({Each}..{/Each})\n $callback = array($this, 'iterationCallback');\n \n foreach($this->values as $key => $value)\n {\n // Check the type\n if(!is_array($value))\n {\n // Only allow array types here.\n continue;\n }\n\n $text = preg_replace_callback('/{Each:\\s*(' . $key . ')\\s+as\\s+([\\d\\w.]+)}(.+?)' . \n '{\\/Each: ' . $key . '}/s',\n $callback, $text);\n }\n \n // First search for simple values\n $callback = array($this, 'simpleValueCallback');\n \n // Define the tag format to use for smart tags\n $smartTagPrefix = $this->smartTags ? '<!--\\s*' : '';\n $smartTagSuffix = $this->smartTags ? '\\s*-->' : '';\n \n // Parse simple values\n $text = preg_replace_callback('/' . $smartTagPrefix . '{(QRCode|String|Integer|Decimal):\\s(' . \n '[\\d\\w.\\'\\s\\-]+)((\\s[\\d\\w]+=[\\d\\w.]+)*)}' . $smartTagSuffix . '/',\n $callback, $text);\n \n \n // Load any special tags that are undefinable by the model\n $text = preg_replace_callback('/' . $smartTagPrefix . '{(Subview):\\s(' . \n '[\\d\\w]+)((\\s[\\d\\w]+=[\\d\\w.]+)*)}' . $smartTagSuffix . '/',\n $callback, $text);\n\n // Search for conditionals\n $callback = array($this, 'conditionalCallback');\n $text = preg_replace_callback('/{If:\\s*(([\\w\\'\\d.\\-]+)\\s*(==|>|<|>=|<=|in|%|<>)\\s*([\\w\\'\\d.\\-]+))}(.+?)' . \n '{\\/If:\\s*\\\\1}/s',\n $callback, $text);\n \n \n return $text;\n }", "function _toType($value) {\n\tif (preg_match('/^(\"(.*)\"|\\'(.*)\\')/',$value,$matches)) {\n\t$value = (string)preg_replace('/(\\'\\'|\\\\\\\\\\')/',\"'\",end($matches));\n\t$value = preg_replace('/\\\\\\\\\"/','\"',$value);\n\t} elseif (preg_match('/^\\\\[(.+)\\\\]$/',$value,$matches)) {\n\t\t// Inline Sequence\n\n\t\t// Take out strings sequences and mappings\n\t\t$explode = $this->_inlineEscape($matches[1]);\n\n\t\t// Propogate value array\n\t\t$value = array();\n\t\tforeach ($explode as $v) {\n\t\t$value[] = $this->_toType($v);\n\t\t}\n\t} elseif (strpos($value,': ')!==false && !preg_match('/^{(.+)/',$value)) {\n\t\t// It's a map\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\t$value = array($key => $value);\n\t} elseif (preg_match(\"/{(.+)}$/\",$value,$matches)) {\n\t\t// Inline Mapping\n\n\t\t// Take out strings sequences and mappings\n\t\t$explode = $this->_inlineEscape($matches[1]);\n\n\t\t// Propogate value array\n\t\t$array = array();\n\t\tforeach ($explode as $v) {\n\t\t$array = $array + $this->_toType($v);\n\t\t}\n\t\t$value = $array;\n\t} elseif (strtolower($value) == 'null' or $value == '' or $value == '~') {\n\t\t$value = NULL;\n\t} elseif (preg_match ('/^[0-9]+$/', $value)) {\n\t// Cheeky change for compartibility with PHP < 4.2.0\n\t\t$value = (int)$value;\n\t} elseif (in_array(strtolower($value),\n\t\t\t\tarray('true', 'on', '+', 'yes', 'y'))) {\n\t\t$value = true;\n\t} elseif (in_array(strtolower($value),\n\t\t\t\tarray('false', 'off', '-', 'no', 'n'))) {\n\t\t$value = false;\n\t} elseif (is_numeric($value)) {\n\t\t$value = (float)$value;\n\t} else {\n\t\t// Just a normal string, right?\n\t\t$value = trim(preg_replace('/#(.+)$/','',$value));\n\t}\n\n\treturn $value;\n\t}", "function tidy_parse_string($input, $config = null, $encoding = null) {}", "function _parse() {\n $file = $this->_get_file();\n $search = array();\n $replace = array();\n $i = 0;\n foreach($this->_keys as $key => $value) {\n $search[$i] = $value;\n $replace[$i] = $this->_vals[$key];\n if(is_object($replace[$i])) {\n $replace[$i] = $replace[$i]->get_string();\n }\n ++$i;\n }\n return str_replace($search, $replace, $file);\n }", "protected function parse() {}", "function db2value($rec)\n {\n $languages = $this->getLanguages();\n if($this->isMlNode())\n {\n if(is_array($rec[$this->fieldName()]))\n {\n foreach($rec[$this->fieldName()] as $lng=>$value)\n {\n $result[$lng]=stripslashes($value);\n }\n } else $result = stripslashes($rec[$this->fieldName()]);\n }\n else\n {\n for ($i=0,$_i=count($languages);$i<$_i;$i++)\n {\n $result[$languages[$i]] = stripslashes($rec[$this->fieldName().'_'.$languages[$i]]);\n }\n }\n return $result;\n }", "private function parse ( $value ) : string\n\t{\n\t\tif ( \\is_string($value) )\n\t\t{ return $value; }\n\n\t\tif ( \\is_bool($value) )\n\t\t{ return $value ? 'true' : 'false'; }\n\n\t\tif ( \\is_object($value) )\n\t\t{\n\t\t\tif ( \\method_exists($value, '__toString') )\n\t\t\t{ return \\strval($value); }\n\n\t\t\treturn \\get_class($value);\n\t\t}\n\n\t\tif ( \\is_array($value) )\n\t\t{ return \\json_encode($value); }\n\n\t\treturn \\strval($value);\n\t}", "protected function unmarshall($value) {\n // look for our special prefix\n if (substr($value, 0, 19) == 'a:2:{i:0;s:3:\"PHP\";') {\n\n $array = unserialize($value);\n if ($array !== false)\n return $array[1];\n }\n \n return $value;\n }", "function _parse() {\n $txt = $this->_text;\n for($i=0; $i<count($txt); $i++) {\n $txt[$i] = preg_replace(\"@[{]([^}]+)[}]@e\", \"''.\\$this->_insert(\\\"\\\\1\\\").''\",$txt[$i]);\n }\n return join(\"\",$txt);\n }", "private function _parse($value)\n\t{\n\t\tif (is_object($value)) {\n\t\t\treturn $value;\n\t\t}\n\t\t\n\t\tif (is_array($value)) {\n\t\t\tforeach ($value as $k => $v) {\n\t\t\t\t$value[$k] = $this->_parse($v);\n\t\t\t}\n\t\t\treturn $value;\n\t\t}\n\t\t\n\t\tif (preg_match(\"/^[0-9]+$/\", $value)) {\n\t\t\treturn (int) $value;\n\t\t}\n\t\t\n\t\tif (preg_match(\"/^[0-9]+\\.[0-9]+$/\", $value)) {\n\t\t\treturn (float) $value;\n\t\t}\n\t\t\n\t\treturn $value;\n\t}", "protected function value_get(){\n\t\t\n\t\tif ( is_serialized( $this->value ) ) {\n\t\t\t$this->value = unserialize( $this->value );\n\t\t} elseif ( is_string( $this->value ) && 0 === strpos( $this->value, '{' ) && is_object( $_value = json_decode( $this->value ) ) ) {\n\t\t\t$this->value = (array) $_value;\n\t\t}\n\n\t\treturn $this->value;\n\t\t\n\t}", "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}", "protected function parseValue()\n {\n $expressions = array();\n while ($e = $this->parseExpression()) {\n $expressions[] = $e;\n if (!$this->matchChar(',')) {\n break;\n }\n }\n if (count($expressions) > 0) {\n return new ILess_Node_Value($expressions);\n }\n }", "protected function parseFlatValue($value)\n {\n if($parseParts = $this->getParseFunction($value)){\n if($parseParts[0] == \"slugify\"){\n $column = $parseParts[1];\n $model = $this->row->getColumns();\n $value = strtoupper(str_slug($model[$column], '_'));\n }\n if($parseParts[0] == \"imagify\"){\n $imageUrl = $parseParts[1];\n $size = getimagesize($imageUrl);\n $extension = image_type_to_extension($size[2]);\n $filename = time() . $extension;\n $file = Storage::put('/public/imported/'.$filename, file_get_contents($imageUrl), 'public');\n $url = 'public/imported/'.$filename;\n \n $value = $url;\n }\n }\n\n if($value == \"\"){\n $value = null;\n }\n \n return $value;\n }", "protected function _decodeValue()\n {\n switch ($this->_token) {\n case self::DATUM:\n $result = $this->_tokenValue;\n $this->_getNextToken();\n return ($result);\n break;\n case self::LBRACE:\n return ($this->_decodeObject());\n break;\n case self::LBRACKET:\n return ($this->_decodeArray());\n break;\n default:\n return null;\n break;\n }\n }", "public static function parseValue($val)\n\t{\n\t\treturn parse_string($val);\n\t}", "protected function parseTypedValue(TypedValue $value)\n {\n return $value->getValue();\n }", "private function _readValue($token) {}", "protected function parsedTemplateData(){\n if( $this->_parsedTemplateData === null ){\n $this->_parsedTemplateData = $this->getHelper('json')->decode( $this->templateData );\n }\n return $this->_parsedTemplateData;\n }", "public function getLiteralValue();", "function getValue() { return $this->readText(); }", "public function parse() {\n\t\t$pointer = 0;\n\t\t$ar_line = array();\n\n\t\tforeach ($this->structure as $key => $length) {\n\t\t\t$ar_line[$key] = trim(substr($this->line, $pointer, $length), \"\\n\\r \");\n\t\t\t$pointer += $length;\n\t\t}\n\t\t$ar_line['stamp'] = md5(serialize($ar_line));\n\n\t\tif ($this->return == 'array') {\n\t\t\treturn $ar_line;\n\t\t}\n\t\treturn (object) $ar_line;\n\t}", "function parse_content($rawcontent){\n $content = explode(\"++++\", $rawcontent);\n //the defintion of the the title\n $metablock = $content[0];\n $rawmeta = explode(\"----\", $metablock);\n $meta = [];\n foreach ($rawmeta as $metaline) {\n //splits key from value\n $metaentry = explode(\":\", $metaline);\n //removes all spaces around the value\n $key = trim($metaentry[0]);\n $value = trim($metaentry[1]);\n $meta[$key] = $value;\n }\n //the splittet version: just the value\n $title = $meta[\"title\"];\n //the splittet text\n $text = $content[1];\n $result = compact(\"title\", \"text\", \"meta\");\n //returns the result\n return $result;\n}", "public function parse($text);", "function getValue() { return $this->readText(); }", "function parseConvertValue($t){\r\n\t\tif($this->br2nl){\r\n\t\t\t$t = str_replace( \"<br>\" ,\"\\n\" ,$t);\r\n\t\t\t$t = str_replace( \"<br />\" ,\"\\n\" ,$t);\r\n\t\t\t$t = str_replace( \"&lt;br /&gt;\" ,\"\\n\" ,$t);\r\n\t\t}else{\r\n\t\t\t$t = str_replace( \"\\n\" , \"<br />\", $t );\r\n\t\t}\r\n\t\t$t = str_replace( \"&#39;\" , \"'\", $t );\r\n\t\t$t = str_replace( \"&#33;\" , \"!\", $t );\r\n\t\t$t = str_replace( \"&#036;\" , \"$\", $t );\r\n\t\t$t = str_replace( \"&#124;\" , \"|\", $t );\r\n\t\t$t = str_replace( \"&amp;\" , \"&\", $t );\r\n\t\t$t = str_replace( \"&gt;\" , \">\", $t );\r\n\t\t$t = str_replace( \"&lt;\" , \"<\", $t );\r\n\t\t$t = str_replace( \"&quot;\" , '\"', $t );\r\n\t\treturn $t;\r\n\t}", "abstract public function convertFromRawValue($value);", "public function parse($string);", "public function value() {\n if ($this->_m_value !== null)\n return $this->_m_value;\n $this->_m_value = $this->lookupTable()[($this->tag() - 213)];\n return $this->_m_value;\n }", "public abstract function parse($text);", "protected function normalizeValue($value) {\n\t\tif ($value instanceof PHPParser_Node) {\n\t\t\treturn $value;\n\t\t} elseif (is_null ( $value )) {\n\t\t\treturn new PHPParser_Node_Expr_ConstFetch ( new PHPParser_Node_Name ( 'null' ) );\n\t\t} elseif (is_bool ( $value )) {\n\t\t\treturn new PHPParser_Node_Expr_ConstFetch ( new PHPParser_Node_Name ( $value ? 'true' : 'false' ) );\n\t\t} elseif (is_int ( $value )) {\n\t\t\treturn new PHPParser_Node_Scalar_LNumber ( $value );\n\t\t} elseif (is_float ( $value )) {\n\t\t\treturn new PHPParser_Node_Scalar_DNumber ( $value );\n\t\t} elseif (is_string ( $value )) {\n\t\t\treturn new PHPParser_Node_Scalar_String ( $value );\n\t\t} elseif (is_array ( $value )) {\n\t\t\t$items = array ();\n\t\t\t$lastKey = - 1;\n\t\t\tforeach ( $value as $itemKey => $itemValue ) {\n\t\t\t\t// for consecutive, numeric keys don't generate keys\n\t\t\t\tif (null !== $lastKey && ++ $lastKey === $itemKey) {\n\t\t\t\t\t$items [] = new PHPParser_Node_Expr_ArrayItem ( $this->normalizeValue ( $itemValue ) );\n\t\t\t\t} else {\n\t\t\t\t\t$lastKey = null;\n\t\t\t\t\t$items [] = new PHPParser_Node_Expr_ArrayItem ( $this->normalizeValue ( $itemValue ), $this->normalizeValue ( $itemKey ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn new PHPParser_Node_Expr_Array ( $items );\n\t\t} else {\n\t\t\tthrow new LogicException ( 'Invalid value' );\n\t\t}\n\t}", "function Value($a){\n return new Parser(function($s) use($a){return new Maybe(new Tuple($s, $a));});\n }", "protected function to_plaintext( $value ) {\n\t\tif ( $this->is_microformat( $value ) || $this->is_embedded_html( $value ) ) {\n\t\t\treturn $value['value'];\n\t\t} elseif ( is_array( $value ) && isset( $value['text'] ) ) {\n\t\t\treturn $value['text'];\n\t\t}\n\t\treturn $value;\n\t}", "abstract public function parse($string);", "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 }", "private function value()\n {\n $this->white();\n switch ($this->currentByte) {\n case '{':\n return $this->obj();\n case '[':\n return $this->arr();\n case '\"':\n case \"'\":\n return $this->string();\n case '-':\n case '+':\n case '.':\n return $this->number();\n default:\n return \\is_numeric($this->currentByte) ? $this->number() : $this->word();\n }\n }", "function clean_value( $t )\n\t{\n\t\treturn $this->parse_clean_value( $t );\n\t}", "public static function parse($tpl, $hash) {\n\t\n\t foreach ($hash as $key => $value) \n\t {\n\t $tpl = str_replace('[+'.$key.'+]', $value, $tpl);\n\t }\n\t return $tpl;\n\t}", "protected function parseValue($value)\n {\n $catchFn = explode('::', $value);\n if (isset($catchFn[1])) {\n $fn = $catchFn[1];\n\n switch ($fn)\n {\n case 'hash': $value = $this->app->call('security')->encrypt($catchFn[0]); \n break;\n case 'int': $value = (int) $catchFn[0];\n break;\n }\n }\n return $value;\n }", "function readLabelledValue() {\n $l = $this->readUByte();\n\n $name = $this->readString($l);\n\n $type = $this->readUByte();\n $value = null;\n\n switch ($type) {\n case self::TYPE_VARIANT:\n case self::TYPE_NIL:\n break;\n\n case self::TYPE_BYTE:\n $value = $this->readUByte();\n break;\n\n case self::TYPE_ARRAY:\n $type = $this->readUByte();\n\n $value = array();\n while ($type) {\n $length = $this->readUByte();\n $value[] = ($length > 0) ? $this->readString($length) : null;\n\n $type = $this->readUByte();\n }\n break;\n\n case self::TYPE_WORD:\n $value = $this->readInt16();\n break;\n\n case self::TYPE_DWORD:\n $value = $this->readUInt32();\n break;\n\n case self::TYPE_DOUBLE:\n $value = $this->read(10);\n break;\n\n case self::TYPE_ENUM:\n case self::TYPE_STRING:\n $length = $this->readUByte();\n $value = ($length > 0) ? $this->readString($length) : null;\n break;\n\n case self::TYPE_BOOL_FALSE:\n $value = false;\n break;\n\n case self::TYPE_BOOL_TRUE:\n $value = true;\n break;\n\n case self::TYPE_BITMAP:\n $this->readUInt16();\n\n $this->read(2); // 0x0000\n\n $type = $this->readPascalString();\n\n $length = $this->readUInt16();\n\n $this->read(2); // 0x0000\n\n $data = $this->read($length);\n\n $value = array(\n \"type\" => $type,\n \"data\" => $data,\n );\n\n break;\n\n case self::TYPE_SET:\n $length = $this->readUByte();\n $value = array();\n while ($length) {\n $value[] = $this->readString($length);\n $length = $this->readUByte();\n }\n break;\n\n case self::TYPE_LONGSTRING:\n case self::TYPE_LONGSTRING2:\n $length = $this->readUInt32();\n $value = $this->readString($length);\n break;\n }\n\n return array($name, $value);\n }", "abstract protected function parse($data);", "public function getParsedValue()\n {\n return $this->parsedValue;\n }", "private function cleanValue($value) {\n if (is_array($value)) {\n foreach ($value as $key => $v) {\n $value[$key] = $this->cleanValue($v);\n }\n } else {\n if (strpos($value, ArrayHelper::PHP_CONTENT) === 0) {\n $value = substr($value, strlen(ArrayHelper::PHP_CONTENT));\n }\n }\n \n return $value;\n }", "public function getValue()\n {\n return self::decodeValue($this->value);\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"RuleName\",$param) and $param[\"RuleName\"] !== null) {\n $this->RuleName = $param[\"RuleName\"];\n }\n\n if (array_key_exists(\"MatchCodeList\",$param) and $param[\"MatchCodeList\"] !== null) {\n $this->MatchCodeList = [];\n foreach ($param[\"MatchCodeList\"] as $key => $value){\n $obj = new StringKV();\n $obj->deserialize($value);\n array_push($this->MatchCodeList, $obj);\n }\n }\n\n if (array_key_exists(\"CreateTime\",$param) and $param[\"CreateTime\"] !== null) {\n $this->CreateTime = $param[\"CreateTime\"];\n }\n\n if (array_key_exists(\"RuleCode\",$param) and $param[\"RuleCode\"] !== null) {\n $this->RuleCode = $param[\"RuleCode\"];\n }\n }", "public function parse(string $content);", "public function parse(string $content);", "private function PlainValue()\n\t{\n\t\tif ( $this->lexer->isNextToken( DocLexer::T_OPEN_CURLY_BRACES ) )\n\t\t\treturn $this->Arrayx();\n\n\t\tif ( $this->lexer->isNextToken( DocLexer::T_AT ) )\n\t\t\treturn $this->Annotation();\n\n\t\tif ( $this->lexer->isNextToken( DocLexer::T_IDENTIFIER ) )\n\t\t\treturn $this->Constant();\n\n\t\tswitch ( $this->lexer->lookahead['type'] )\n\t\t{\n\t\t\tcase DocLexer::T_STRING:\n\t\t\t\t$this->match( DocLexer::T_STRING );\n\n\t\t\t\treturn $this->lexer->token['value'];\n\n\t\t\tcase DocLexer::T_INTEGER:\n\t\t\t\t$this->match( DocLexer::T_INTEGER );\n\n\t\t\t\treturn (int) $this->lexer->token['value'];\n\n\t\t\tcase DocLexer::T_FLOAT:\n\t\t\t\t$this->match( DocLexer::T_FLOAT );\n\n\t\t\t\treturn (float) $this->lexer->token['value'];\n\n\t\t\tcase DocLexer::T_TRUE:\n\t\t\t\t$this->match( DocLexer::T_TRUE );\n\n\t\t\t\treturn true;\n\n\t\t\tcase DocLexer::T_FALSE:\n\t\t\t\t$this->match( DocLexer::T_FALSE );\n\n\t\t\t\treturn false;\n\n\t\t\tcase DocLexer::T_NULL:\n\t\t\t\t$this->match( DocLexer::T_NULL );\n\n\t\t\t\treturn null;\n\n\t\t\tdefault:\n\t\t\t\t$this->syntaxError( 'PlainValue' );\n\t\t}\n\n\t\treturn null;\n\t}", "public function parse()\n {\n $strBuffer = parent::parse();\n\n foreach($this->arrData['variables'] as $varName=>$varValue)\n {\n if (empty($varValue))\n {\n continue;\n }\n\n // Convert date values\n /*switch ($objVar['type'])\n {\n case 'date':\n $objVar['value'] = \\Date::parse(\\Config::get('dateFormat'), $objVar['value']);\n break;\n\n case 'time':\n $objVar['value'] = \\Date::parse(\\Config::get('timeFormat'), $objVar['value']);\n break;\n\n case 'datim':\n $objVar['value'] = \\Date::parse(\\Config::get('datimFormat'), $objVar['value']);\n break;\n }*/\n\n //$objVar['value'] = str_replace('$', '\\$', $objVar['value']);\n\n if (is_array($varValue))\n {\n $varValue = json_encode($varValue);\n }\n\n $strBuffer = preg_replace('/{%\\s*' . $varName . '\\s*%}/s', $varValue, $strBuffer);\n\n $strBuffer = preg_replace('/{%\\s*' . $varName . '\\|\\s*nl2br\\s*%}/s', nl2br($varValue), $strBuffer);\n }\n\n $strBuffer = preg_replace('/{%.*?%}/s', '', $strBuffer);\n\n return $strBuffer;\n }", "public function parse_template ($val) {\n\t\t$val = str_replace (\n\t\t\tarray (\n\t\t\t\t'\\\\{{', '\\\\}}', '\\\\{%', '\\\\%}', '\\\\{\"', '\\\\\"}', '\\\\{\\'', '\\\\\\'}',\n\t\t\t\t'\\\\{!', '\\\\!}', '\\\\{#', '\\\\#}'\n\t\t\t),\n\t\t\tarray (\n\t\t\t\t'#EOBRACE#', '#ECBRACE#', '#EOBLOCK#', '#ECBLOCK#', '#EOQUOTE#', '#ECQUOTE#',\n\t\t\t\t'#EOQUOTE#', '#ECQUOTE#', '#EOINCLUDE#', '#ECINCLUDE#', '#EOHARDCODE#',\n\t\t\t\t'#ECHARDCODE#'\n\t\t\t),\n\t\t\t$val\n\t\t);\n\t\t$val = preg_replace_callback ('/\\{\\{ ?(.*?) ?\\}\\}/', array ($this, 'replace_vars'), $val);\n\t\t$val = preg_replace_callback ('/\\{[\\'\"] ?(.*?) ?[\\'\"]\\}/', array ($this, 'replace_strings'), $val);\n\t\t$val = preg_replace_callback ('/\\{\\% ?(.*?) ?\\%\\}/', array ($this, 'replace_blocks'), $val);\n\t\t$val = preg_replace_callback ('/\\{\\! ?(.*?) ?\\!\\}/s', array ($this, 'replace_includes'), $val);\n\t\t$val = preg_replace_callback ('/\\{# ?(.*?) ?#\\}/s', array ($this, 'hard_codes'), $val);\n\t\t$val = str_replace (\n\t\t\tarray (\n\t\t\t\t'#EOBRACE#', '#ECBRACE#', '#EOBLOCK#', '#ECBLOCK#', '#EOQUOTE#', '#ECQUOTE#',\n\t\t\t\t'#EOINCLUDE#', '#ECINCLUDE#', '#EOHARDCODE#', '#ECHARDCODE#'),\n\t\t\tarray (\n\t\t\t\t'{{', '}}', '{%', '%}', '{\"', '\"}', '{!', '!}', '{#', '#}'\n\t\t\t),\n\t\t\t$val\n\t\t);\n\t\treturn $val;\n\t}", "public function parse($data);", "public function parse($data);", "public function parse($data);", "function parseValue($valueToken) {\n if ($this->isObject($valueToken)) {\n return $this->parseObject($valueToken);\n } elseif ($this->isArray($valueToken)) {\n return $this->parseArray($valueToken);\n }\n # it's the value itself\n return $this->processParameter($valueToken);\n }", "public function parse($field, $value) {\n $type = $this->fields[$field];\n return $type->parse($value);\n }", "public function parse($content);", "protected function parse($template) {\n return (new MustacheParser())->parse(new StringTokenizer($template));\n }", "public function parse( $contents );", "protected function parseValues()\n {\n\n $this->setValues([]);\n\n $matches = [];\n\n preg_match_all(\"/\\<(.+?)\\>/\", $this->getDomainRegex() . '/' . $this->getRegex(), $matches);\n\n if(!empty($matches[1])){\n foreach($matches[1] as $value){\n $this->values[$value] = null;\n }\n }\n }", "function acf_decode_taxonomy_term($value)\n{\n}", "function yml_parse($yml)\n {\n return yml::parse($yml);\n }", "protected function _parse($output)\n\t{\n\t\t$this->_CI->load->library('parser');\n\t\t$vars = $this->values();\n\t\t$output = $this->_CI->parser->parse_string($output, $vars, TRUE);\n\t\treturn $output;\n\t}", "private function parseValue($value) {\n return htmlspecialchars(html_entity_decode($value));\n }", "protected function _parseTemplate() {}", "function get_value($q, $string) {\n $t1=explode($q,$string);\n $t2=explode(\"<string>\",$t1[1]);\n $t3=explode(\"</string>\",$t2[1]);\n return $t3[0];\n}", "public function deserialize($strToken);", "public function getSchemaValue()\n {\n $value = $this->RAW();\n if ($value) {\n return [ 'html' => $this->RAW() ];\n }\n return null;\n }", "public function get_value($node) {\n \t$this->get_node_value($node, 0);\n// if($this->value) return html_entity_decode( htmlspecialchars_decode($this->value) );\n// return html_entity_decode( htmlspecialchars_decode($this->text) );\n \t\n \tif($this->value) return $this->value;\n \treturn $this->text;\n }", "public function fromRaw($value)\n {\n $type = $this->getDataType();\n\n if ($type === 'json') {\n $value = json_decode($value, true);\n } elseif ($type === 'array') {\n $value = (array) $value;\n } elseif ($type === 'list') {\n $value = explode(',', $value);\n } elseif ($type === 'boolean') {\n $value = (bool) $value;\n } elseif ($type === 'integer') {\n $value = (int) $value;\n } elseif ($type === 'float') {\n $value = (float) $value;\n }\n\n return $value;\n }", "function wp_kses_attr_parse($element)\n {\n }", "public function fromHash($hash)\n {\n return new TextLineValue(['value' => $hash]);\n }", "function format_value( $value, $post_id, $field )\n {\n return json_decode($value);\n }", "protected function _parseTagTable() {}", "private function getNativeValueFromDefinition($value)\n {\n if ($this->strStartsWith($value, \"'\") && $this->strEndsWith($value, \"'\")) {\n $value = trim(trim($value, \"'\")); // single quote\n } else {\n if ($this->strStartsWith($value, '\"') && $this->strEndsWith($value, '\"')) {\n $value = trim(trim($value, '\"')); // double quote\n } else {\n if ($value == 'true') {\n $value = true;\n } else {\n if ($value == 'false') {\n $value = false;\n } else {\n if (is_numeric($value)) {\n if (ctype_digit($value)) {\n return (integer)$value;\n } else {\n return (float)$value;\n }\n }\n }\n }\n }\n }\n\n return $value;\n }", "public function parse(string $input);", "final protected function parseValue($value)\n\t{\n if ('?' === $value) {\n return $value;\n }\n \n if (is_string($value)) {\n $value = '\\''.$this->_escapeString($value).'\\'';\n } elseif (isset($value[0]) && is_string($value[0]) && strtolower($value[0]) == 'exp'){\n $value = $this->_escapeString($value[1]);\n } elseif (is_array($value)) {\n $value = array_map(array($this, 'parseValue'),$value);\n } elseif (is_bool($value)){\n $value = $value ? '1' : '0';\n } elseif (is_null($value)){\n $value = 'null';\n }\n return $value;\n\t}", "function parseData(){\r\n\t\t$content = array();\r\n\t\t$this->page_id = $this->CFG->PostVars['pageid'];\r\n\t\tforeach($this->CFG->PostVars as $key=>$value){\r\n\t\t\tif(preg_match(\"/content_(.*)_(.*)/\", $key, $arr)){\r\n\t\t\t\t$field\t= $arr[1];\r\n\t\t\t\t$lang \t= $arr[2];\r\n\t\t\t\tif(is_array($content[$lang])){\r\n\t\t\t\t\t$content[$lang][$field] = $value;\r\n\t\t\t\t}\r\n\t\t\t\telse $content[$lang] = array($field => $value);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->content = $content;\r\n\t}", "private static function ConvertNodeValueToObject($value)\n\t{\n\t\tif (is_numeric($value)) {\n\t\t\tif (strcmp(strval(intval($value)), $value) === 0) {\n\t\t\t\treturn intval($value);\n\t\t\t} elseif (strcmp(sprintf('%.0f', floatval($value)), $value) === 0) {\n\t\t\t\treturn floatval($value);\n\t\t\t} else {\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t} elseif (strtolower($value) == 'true' || strtolower($value) == 'false') {\n\t\t\treturn filter_var($value, FILTER_VALIDATE_BOOLEAN);\n\t\t} else {\n\t\t\treturn $value;\n\t\t}\n\t}" ]
[ "0.6315014", "0.6214343", "0.6062418", "0.5992678", "0.5891263", "0.5742344", "0.56842184", "0.56842184", "0.56842184", "0.56842184", "0.565302", "0.5639727", "0.5555554", "0.55431974", "0.55431974", "0.55431974", "0.55232054", "0.54807866", "0.5375631", "0.5357513", "0.53440267", "0.53246045", "0.5307628", "0.52815425", "0.5277486", "0.52752155", "0.5268382", "0.5267798", "0.5260024", "0.52546453", "0.52526474", "0.5230295", "0.52130216", "0.51443213", "0.51404417", "0.51203465", "0.509463", "0.50825363", "0.5073085", "0.5061804", "0.50603426", "0.50587106", "0.50582343", "0.5030555", "0.50284016", "0.4997895", "0.49816674", "0.49476334", "0.4939319", "0.49277753", "0.49260432", "0.4922938", "0.4911217", "0.49010512", "0.4883433", "0.48818368", "0.48728994", "0.48721635", "0.4872132", "0.48684976", "0.4858704", "0.484691", "0.48419398", "0.48331997", "0.48212498", "0.48091266", "0.4798626", "0.47980496", "0.47980496", "0.4795711", "0.47952113", "0.4794045", "0.4786261", "0.4786261", "0.4786261", "0.4782237", "0.47790793", "0.47637084", "0.47613043", "0.47553125", "0.47505718", "0.47485915", "0.4746752", "0.4737103", "0.4736872", "0.47130805", "0.47126704", "0.47032568", "0.46966732", "0.46947524", "0.46946168", "0.46945587", "0.46913332", "0.4681984", "0.46807894", "0.467343", "0.46365505", "0.46345156", "0.46307907", "0.46281978" ]
0.5174732
33
Recursion function to parse all array values through self::parseValue()
private static function parseArray($val) { $result = array(); $openBrackets = 0; $openString = false; $openCurlyBraces = 0; $openLString = false; $buffer = ''; $strLen = strlen($val); for($i = 0; $i < $strLen; $i++) { if($val[$i] == '[' && !$openString && !$openLString) { $openBrackets++; if($openBrackets == 1) { // Skip first and last brackets. continue; } } elseif($val[$i] == ']' && !$openString && !$openLString) { $openBrackets--; if($openBrackets == 0) { // Allow terminating commas before the closing bracket if(trim($buffer) != '') { $result[] = self::parseValue( trim($buffer) ); } if (!self::checkDataType($result)) { throw new Exception('Data types cannot be mixed in an array: ' . $buffer); } // Skip first and last brackets. We're finish. return $result; } } elseif($val[$i] == '"' && $val[$i - 1] != "\\" && !$openLString) { $openString = !$openString; } elseif($val[$i] == "'" && !$openString) { $openLString = !$openLString; } elseif($val[$i] == "{" && !$openString && !$openLString) { $openCurlyBraces++; } elseif($val[$i] == "}" && !$openString && !$openLString) { $openCurlyBraces--; } if( ($val[$i] == ',' || $val[$i] == '}') && !$openString && !$openLString && $openBrackets == 1 && $openCurlyBraces == 0) { if ($val[$i] == '}') { $buffer .= $val[$i]; } $buffer = trim($buffer); if (!empty($buffer)) { $result[] = self::parseValue($buffer); if (!self::checkDataType($result)) { throw new Exception('Data types cannot be mixed in an array: ' . $buffer); } } $buffer = ''; } else { $buffer .= $val[$i]; } } // If we're here, something went wrong. throw new Exception('Wrong array definition: ' . $val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function parseValues($_values)\n\t{\n\t\t$use_ingroup = $this->field->parameters->get('use_ingroup', 0);\n\t\t$multiple = $use_ingroup || (int) $this->field->parameters->get('allow_multiple', 0);\n\n\t\t// Make sure we have an array of values\n\t\tif (!$_values)\n\t\t{\n\t\t\t$vals = array(array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$vals = !is_array($_values)\n\t\t\t\t? array($_values)\n\t\t\t\t: $_values;\n\t\t}\n\n\t\t// Compatibility with legacy storage, we no longer serialize all values to one, this way the field can be reversed and filtered\n\t\tif (count($vals) === 1 && is_string(reset($vals)))\n\t\t{\n\t\t\t$array = $this->unserialize_array(reset($vals), $force_array = false, $force_value = false);\n\t\t\t$vals = $array ?: $vals;\n\t\t}\n\n\t\t// Force multiple value format (array of arrays)\n\t\tif (!$multiple)\n\t\t{\n\t\t\tif (is_string(reset($vals)))\n\t\t\t{\n\t\t\t\t$vals = array($vals);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($vals as & $v)\n\t\t\t{\n\t\t\t\tif (!is_array($v))\n\t\t\t\t{\n\t\t\t\t\t$v = strlen($v) ? array($v) : array();\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($v);\n\t\t}\n\n\t\t//echo '<div class=\"alert alert-info\"><h2>parseValues(): ' . $this->field->label . '</h2><pre>'; print_r($vals); echo '</pre></div>';\n\t\treturn $vals;\n\t}", "public function values() {\n\t\t// Get arguments :\n\t\t$args = func_get_args();\n\t\t\n\t\t// Add values :\n\t\tif (is_array($args[0])) {\n\t\t\tif ( ! is_array(reset($args[0]))) {\n\t\t\t\t// Deal with normal case : ->values(array(val1, val2, ...), array(val1, val2, ...), ...)\n\t\t\t\tforeach($args as $values_array)\n\t\t\t\t\t$this->push(new \\Glue\\DB\\Fragment_Item_Values($values_array));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Array of arrays given, call this function recursively for each of them :\n\t\t\t\tforeach($args[0] as $arg)\n\t\t\t\t\t$this->values($arg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\t// List of values given, call this function recursively with the same values as an array :\n\t\t\t$this->values($args);\n\t\n\t\treturn $this;\n\t}", "function parseValues($workOnlyOnDataArr=0)\t{\n\t\t//Blog Hack\n\t\t$evalValues=$this->conf['blogData']?$this->metafeeditlib->getBlogEvalValues($this->conf):$this->conf[$this->conf['cmdKey'].'.']['evalValues.'];\t\t\n\t\t//$parseValues=array_merge(is_array($this->conf['parseValues.'])?$this->conf['parseValues.']:array(),is_array($evalValues)?$evalValues:array());\n\t\tif(is_array($this->conf['parseValues.'])) {\n\t\t\t$parseValues=$this->conf['parseValues.'];\n\t\t\tif (is_array($evalValues)) {\n\t\t\t\t$arr=$parseValues;\n\t\t\t\tforeach ($evalValues as $key=>$val) {\n\t\t\t\t\tif ($arr[$key]) {\n\t\t\t\t\t\t$arr[$key]=implode(',',array_merge(t3lib_div::trimexplode(',',$parseValues[$key]),t3lib_div::trimexplode(',',$evalValues[$key])));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$arr[$key]=$val;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$parseValues=$arr;\n\t\t\t}\n\t\t}\n\t\telse $parseValues = $evalValues;\n\t\t\n\t\tif ($workOnlyOnDataArr) {\n\t\t\t$theParseValues=array();\n\t\t\tforeach ($this->dataArr as $field=>$val) {\n\t\t\t\tif ($theParseValues[$field]) $parseValues[]=$parseValues[$field];\n\t\t\t}\n\t\t\tunset ($parseValues);\n\t\t\t$parseValues=&$theParseValues;\n\t\t}\n\n\t\tif (is_array($parseValues))\t{\n\t\t\treset($parseValues);\n\t\t\t while(list($theField,$theValue)=each($parseValues))\t{\t\t\t \t\n\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$theField.'###']='';\n\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$theField.'###']='';\n\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.str_replace('.','_',$theField).'###']='';\n\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.str_replace('.','_',$theField).'###']='';\n\t\t\t\t$listOfCommands = t3lib_div::trimExplode(',',$theValue,1);\n\t\t\t\twhile(list(,$cmd)=each($listOfCommands))\t{\n\t\t\t\t\t$cmdParts = preg_split('/\\[|\\]/',$cmd);\t// Point is to enable parameters after each command enclosed in brackets [..]. These will be in position 1 in the array.\n\t\t\t\t\t$theCmd=trim($cmdParts[0]);\n\t\t\t\t\tswitch($theCmd)\t{\n\t\t\t\t\t\tcase 'int':\n\t\t\t\t\t\t\t$this->dataArr[$theField]=intval($this->dataArr[$theField]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'lower':\n\t\t\t\t\t\tcase 'upper':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = $this->cObj->caseshift($this->dataArr[$theField],$theCmd);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'upperfirst':\n\t\t\t\t\t\t\t$val = $this->cObj->caseshift($this->dataArr[$theField],'lower');\n\t\t\t\t\t\t\t$this->dataArr[$theField]=strtoupper(substr($val,0,1)).substr($val,1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'nospace':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = str_replace(' ', '', $this->dataArr[$theField]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'alpha':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = preg_replace('/[^a-zA-Z]/','',$this->dataArr[$theField]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'num':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = preg_replace('/[^0-9]/','',$this->dataArr[$theField]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'alphanum':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = preg_replace('/[^a-zA-Z0-9]/','',$this->dataArr[$theField]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'alphanum_x':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = preg_replace('/[^a-zA-Z0-9_-]/','',$this->dataArr[$theField]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'trim':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = trim($this->dataArr[$theField]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'strip_tags':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = strip_tags($this->dataArr[$theField]);\n\t\t\t\t\t\t break;\n\t\t\t\t\t\tcase 'noaccents':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = removeaccents($this->dataArr[$theField]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'invert':\n\t\t\t\t\t\t\t$this->dataArr[$theField]=$this->dataArr[$theField]?0:1;\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'random':\n\t\t\t\t\t\t\t$this->dataArr[$theField] = substr(md5(uniqid(microtime(),1)),0,intval($cmdParts[1]));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'files':\n\t\t\t\t\t\t\t$this->processFiles($cmdParts,$theField);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'setEmptyIfAbsent':\n\t\t\t\t\t\t\tif (!isset($this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\t$this->dataArr[$theField]='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'multiple':\n\t\t\t\t\t\t\tif (is_array($this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\t$this->dataArr[$theField] = implode(',',$this->dataArr[$theField]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'checkArray':\n\t\t\t\t\t\t\tif (is_array($this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\treset($this->dataArr[$theField]);\n\t\t\t\t\t\t\t\t$val = 0;\n\t\t\t\t\t\t\t\twhile(list($kk,$vv)=each($this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\t\t$kk = t3lib_div::intInRange($kk,0);\n\t\t\t\t\t\t\t\t\tif ($kk<=30)\t{\n\t\t\t\t\t\t\t\t\t\tif ($vv)\t{\n\t\t\t\t\t\t\t\t\t\t\t$val|=pow(2,$kk);\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\t$this->dataArr[$theField] = $val;\n\t\t\t\t\t\t\t} else {$this->dataArr[$theField]=0;}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'uniqueHashInt':\n\t\t\t\t\t\t\t$otherFields = t3lib_div::trimExplode(';',$cmdParts[1],1);\n\t\t\t\t\t\t\t$hashArray=array();\n\t\t\t\t\t\t\twhile(list(,$fN)=each($otherFields))\t{\n\t\t\t\t\t\t\t\t$vv = $this->dataArr[$fN];\n\t\t\t\t\t\t\t\t$vv = preg_replace('/[[:space:]]/','',$vv);\n\t\t\t\t\t\t\t\t$vv = preg_replace('/[^[:alnum:]]/','',$vv);\n\t\t\t\t\t\t\t\t$vv = strtolower($vv);\n\t\t\t\t\t\t\t\t$hashArray[]=$vv;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->dataArr[$theField]=hexdec(substr(md5(serialize($hashArray)),0,8));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t // Call to user parse function\n\t\t$this->conf['parentObj']=&$this;\n\t\tif ($this->conf['userFunc_afterParse']) {\n\t\t\tt3lib_div::callUserFunction($this->conf['userFunc_afterParse'],$this->conf,$this);\n\t\t}\n\t}", "public function parseFromArray()\n {\n $this->value = $this->reader->next();\n }", "public function ParseFromArray() {\n $this->value = $this->reader->next();\n $this->clean();\n }", "function parse_incoming_recursively( &$data, $input=array(), $iteration = 0 )\n\t{\n\t\t// Crafty hacker could send something like &foo[][][][][][]....to kill Apache process\n\t\t// We should never have an input array deeper than 10..\n\t\t\n\t\tif( $iteration >= 10 )\n\t\t{\n\t\t\treturn $input;\n\t\t}\n\t\t\n\t\tif( count( $data ) )\n\t\t{\n\t\t\tforeach( $data as $k => $v )\n\t\t\t{\n\t\t\t\tif ( is_array( $v ) )\n\t\t\t\t{\n\t\t\t\t\t//$input = $this->parse_incoming_recursively( $data[ $k ], $input );\n\t\t\t\t\t$input[ $k ] = $this->parse_incoming_recursively( $data[ $k ], array(), $iteration+1 );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\t$k = $this->parse_clean_key( $k );\n\t\t\t\t\t$v = $this->parse_clean_value( $v );\n\t\t\t\t\t\n\t\t\t\t\t$input[ $k ] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $input;\n\t}", "function printValues($arr) {\n global $count;\n global $values;\n global $keys;\n \n // Check input is an array\n if(!is_array($arr)){\n die(\"ERROR: Input is not an array\");\n }\n \n /*\n Loop through array, if value is itself an array recursively call the\n function else add the value found to the output items array,\n and increment counter by 1 for each value found\n */\n foreach($arr as $key => $value){\n if(is_array($value)){\n printValues($value);\n } else{\n $values[] = $value;\n $count++;\n $keys[] = $key;\n }\n }\n \n // Return total count and values found in array\n return array('total' => $count, 'keys' => $keys, 'values' => $values);\n }", "abstract public function values(): array;", "function recursive_array_check_blank($element_value)\n{\n\n global $set;\n\n if (!is_array($element_value)) {\n if (!empty($element_value)) {\n $set = 1;\n }\n } else {\n\n foreach ($element_value as $value) {\n if ($set) {\n break;\n }\n recursive_array_check_blank($value);\n }\n\n }\n\n}", "function recursive_array_check_blank($element_value)\n{\n\n global $set;\n\n if (!is_array($element_value)) {\n if (!empty($element_value)) {\n $set = 1;\n }\n } else {\n\n foreach ($element_value as $value) {\n if ($set) {\n break;\n }\n recursive_array_check_blank($value);\n }\n\n }\n\n}", "protected function fixValue(array $value)/*# : array */\n {\n $result = [];\n foreach ($value as $k => $v) {\n if (false !== strpos($k, $this->field_splitter)) {\n $res = &$this->searchTree($k, $result, true);\n $res = is_array($v) ? $this->fixValue($v) : $v;\n } else {\n $result[$k] = is_array($v) ? $this->fixValue($v) : $v;\n }\n }\n return $result;\n }", "protected function recursiveArrayHandler($arrayText)\n {\n $matches = [];\n $arrayToBuild = [];\n if (preg_match_all(Patterns::$SPLIT_PATTERN_SHORTHANDSYNTAX_ARRAY_PARTS, $arrayText, $matches, PREG_SET_ORDER)) {\n foreach ($matches as $singleMatch) {\n $arrayKey = $this->unquoteString($singleMatch['Key']);\n if (!empty($singleMatch['VariableIdentifier'])) {\n $arrayToBuild[$arrayKey] = new ObjectAccessorNode($singleMatch['VariableIdentifier']);\n } elseif (array_key_exists('Number', $singleMatch) && (!empty($singleMatch['Number']) || $singleMatch['Number'] === '0')) {\n // Note: this method of casting picks \"int\" when value is a natural number and \"float\" if any decimals are found. See also NumericNode.\n $arrayToBuild[$arrayKey] = $singleMatch['Number'] + 0;\n } elseif ((array_key_exists('QuotedString', $singleMatch) && !empty($singleMatch['QuotedString']))) {\n $argumentString = $this->unquoteString($singleMatch['QuotedString']);\n $arrayToBuild[$arrayKey] = $this->buildArgumentObjectTree($argumentString);\n } elseif (array_key_exists('Subarray', $singleMatch) && !empty($singleMatch['Subarray'])) {\n $arrayToBuild[$arrayKey] = new ArrayNode($this->recursiveArrayHandler($singleMatch['Subarray']));\n }\n }\n }\n return $arrayToBuild;\n }", "protected function parseValues()\n {\n\n $this->setValues([]);\n\n $matches = [];\n\n preg_match_all(\"/\\<(.+?)\\>/\", $this->getDomainRegex() . '/' . $this->getRegex(), $matches);\n\n if(!empty($matches[1])){\n foreach($matches[1] as $value){\n $this->values[$value] = null;\n }\n }\n }", "protected function _parseNestedValues($values)\n {\n foreach ($values as $key => $value) {\n if ($value === '1') {\n $value = true;\n }\n if ($value === '') {\n $value = false;\n }\n\n if (strpos($key, '.') !== false) {\n $values = Set::insert($values, $key, $value);\n //$this->_parseNestedValues($values);\n } else {\n $values[$key] = $value;\n }\n }\n return $values;\n }", "protected function parse()\n {\n if($this->isRelationalKey()){\n $this->parsedValue = $this->makeRelationInstruction();\n } \n else {\n $this->parsedValue = $this->parseFlatValue($this->value);\n } \n }", "function pg_array_parse($array, $asText = true) {\n $s = $array;\n if ($asText) {\n $s = str_replace(\"{\", \"array('\", $s);\n $s = str_replace(\"}\", \"')\", $s); \n $s = str_replace(\",\", \"','\", $s); \n } else {\n $s = str_replace(\"{\", \"array(\", $s);\n $s = str_replace(\"}\", \")\", $s);\n }\n\t$ss = \"\\$retval = $s;\";\n eval($ss);\n\treturn $retval;\n}", "abstract public function parseInput(array $input): array;", "private function process_array($value) {\n return is_array($value);\n }", "abstract public static function getValues(): array;", "public function parse_array($value)\n\t{\n\t\tif ($value==null)\n\t\t\treturn array();\n\t\t\n\t\tif (is_array($value))\n\t\t\treturn $value;\n\t\t\t\n\t\t$value=trim($value,'{}');\n\t\t$result=explode(',',$value);\n\t\t\n\t\tfor($i=0; $i<count($result); $i++)\n\t\t\tif ($result[$i]=='NULL')\n\t\t\t\t$result[$i]=null;\n\t\t\t\t\n\t\treturn $result;\n\t}", "function get_values($arr)\n{\n $values = [];\n foreach ($arr as $item) {\n if (is_array($item)) {\n $values = array_merge($values, get_values($item));\n } else {\n $values[] = $item;\n }\n }\n return $values;\n}", "private function parseVars($vals, $tab =\"\")//optional recursive values for output\n {\n $rval = \"\";\n foreach($vals as $key => $val)\n {\n if( $this->cleanData($key, $val))\n {\n if(is_object($val))\n {\n $rval = $rval.$tab.\"Object: \".$key.\" of type: \".get_class($val).\"\\n\";\n $rval = $rval.$tab.\"{\\n\";\n $newAry = get_object_vars($val);\n $rval = $rval.$this->parseVars($newAry, $tab.\" \");\n $rval = $rval.$tab.\"}\\n\";\n }\n elseif(is_array($val))\n {\n $rval = $rval.$tab.\"Array: \".$key.\"\\n\";\n $rval = $rval.$tab.\"{\\n\";\n $rval = $rval.$this->parseVars($val, $tab.\" \");\n $rval = $rval.$tab.\"}\\n\";\n }\n else\n {\n if($val != \"\")\n $rval= $rval.$tab.$key.\" = \".$val.\"\\n\";\n else\n $rval= $rval.$tab.$key.\" = NULL\\n\";\n }\n }\n }\n return $rval;\n }", "function sanitizeArray($data = array())\r\n{\r\n foreach ($data as $k => $v) {\r\n if (!is_array($v) && !is_object($v)) { // deep enough to only be values? sanitize them now.\r\n $data[$k] = sanitizeValue($v);\r\n }\r\n if (is_array($v)) { // go deeper\r\n $data[$k] = sanitizeArray($v);\r\n }\r\n }\r\n return $data;\r\n}", "public function prepare_marc_values($value_arr, $subfields, $delimiter = ' ') {\n\n // Repeatable values can be returned as an array or a serialized value\n foreach ($subfields as $subfield) {\n if (is_array($value_arr[$subfield])) {\n\n foreach ($value_arr[$subfield] as $subkey => $subvalue) {\n\n if (is_array($subvalue)) {\n foreach ($subvalue as $sub_subvalue) {\n if ($i[$subkey]) { $pad[$subkey] = $delimiter; }\n $sv_tmp = trim($sub_subvalue);\n $matches = array();\n preg_match_all('/\\{u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]\\}/', $sv_tmp, $matches);\n foreach ($matches[0] as $match_string) {\n $code = hexdec($match_string);\n $character = html_entity_decode(\"&#$code;\", ENT_NOQUOTES, 'UTF-8');\n $sv_tmp = str_replace($match_string, $character, $sv_tmp);\n }\n if (trim($sub_subvalue)) { $marc_values[$subkey] .= $pad[$subkey] . $sv_tmp; }\n $i[$subkey] = 1;\n }\n } else {\n if ($i[$subkey]) { $pad[$subkey] = $delimiter; }\n\n // Process unicode for diacritics\n $sv_tmp = trim($subvalue);\n $matches = array();\n preg_match_all('/\\{u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]\\}/', $sv_tmp, $matches);\n foreach ($matches[0] as $match_string) {\n $code = hexdec($match_string);\n $character = html_entity_decode(\"&#$code;\", ENT_NOQUOTES, 'UTF-8');\n $sv_tmp = str_replace($match_string, $character, $sv_tmp);\n }\n\n if (trim($subvalue)) { $marc_values[$subkey] .= $pad[$subkey] . $sv_tmp; }\n $i[$subkey] = 1;\n }\n }\n }\n }\n\n if (is_array($marc_values)) {\n foreach ($marc_values as $mv) {\n $result[] = $mv;\n }\n }\n return $result;\n }", "protected function _filterValueRecursive(&$value)\n {\n if (is_array($value)) {\n array_walk($value, array($this, '_filterValueRecursive'));\n } else {\n $this->_filterValue($value);\n }\n }", "public function values() : array;", "public function parseValue();", "public function transfArray($valuepost) {\n\t\t$total = 0;\n\t\tforeach ( $valuepost as $value ) {\n\t\t\t$arr [$total] = $this->validStringForm ( $value );\n\t\t\t$total ++;\n\t\t}\n\t\treturn $arr;\n\t}", "abstract public function parse($value);", "protected function _decodeArray()\n {\n $result = array();\n $starttok = $tok = $this->_getNextToken(); // Move past the '['\n $index = 0;\n\n while ($tok && $tok != self::RBRACKET) {\n $result[$index++] = $this->_decodeValue();\n\n $tok = $this->_token;\n\n if ($tok == self::RBRACKET || !$tok) {\n break;\n }\n\n if ($tok != self::COMMA) {\n throw new Rx_Json_Exception('Missing \",\" in array encoding: ' . $this->_getProblemContext());\n }\n\n $tok = $this->_getNextToken();\n }\n\n $this->_getNextToken();\n return ($result);\n }", "function printValues($arr) {\r\n $db = mysqli_connect(\"localhost\", 'root', 'root') or die ('Unable to connect. Check your connection parameters.');\r\n mysqli_select_db($db,'nasa') or die(mysqli_error($db));\r\n global $count;\r\n global $values;\r\n global $keys;\r\n global $mes;\r\n global $estacion;\r\n // Check input is an array\r\n if(!is_array($arr)){\r\n die(\"ERROR: Input is not an array\");\r\n }\r\n \r\n /*\r\n Loop through array, if value is itself an array recursively call the\r\n function else add the value found to the output items array,\r\n and increment counter by 1 for each value found\r\n */\r\n foreach($arr as $key=>$value){\r\n \r\n if(is_array($value)){\r\n if($key == \"813\"){\r\n // $query = \"INSERT INTO tiempo (mes,estacion) VALUES (\" . $value[\"Month_ordinal\"] . \", '\" . $value[\"Season\"] . \"')\";\r\n // mysqli_query($db,$query) or die(mysqli_error($db));\r\n foreach($value as $key=>$valor){\r\n if($key == \"Month_ordinal\"){\r\n $mes = $valor;\r\n }\r\n if($key == \"Season\"){\r\n $estacion = $valor;\r\n }\r\n }\r\n \r\n $query = \"INSERT INTO tiempo (mes,estacion) VALUES (\" . $mes . \", '\" . $estacion . \"')\";\r\n mysqli_query($db,$query) or die(mysqli_error($db));\r\n }\r\n printValues($value);\r\n } else{\r\n $values[] = $value;\r\n $keys[] = $key;\r\n $count++;\r\n }\r\n }\r\n \r\n // Return total count and values found in array\r\n return array('total' => $count, 'values' => $values, 'keys' => $keys);\r\n}", "function check_value($input) { \n\t\tif (is_array($input)) {\n\t\t\t$retval=$this->flatten($input);\n\t\t} else {\n\t\t\t$retval=$input;\n\t\t\t$this->output[]=$retval;\n\t\t}\n\t}", "function flatten($input) {\n\t\t$retval=array();\n\t\t$count=0;\n\t\t// var_dump($input);\n\t\tif (is_array($input)){\n\t\t\tforeach($input as $y) {\n\t\t\t\t$retval[$count++]=$this->check_value($y);\n\t\t\t}\n\t\t} else {\n\t\t\t$this->output=$input;\n\t\t}\n\t}", "public static function array2ValuesRecursive(array $data)\n\t{\n\t\t$new_data = array();\n\n\t\tif(is_array($data))\n\t\t{\n\t\t\tforeach($data as $key=>$data_child)\n\t\t\t{\n\t\t\t\tif(is_array($data_child))\n\t\t\t\t{\n\t\t\t\t\t$data_temp = self::array2ValuesRecursive($data_child);\n\n\t\t\t\t\tarray_push($new_data, $data_temp);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif('user_name' === $key)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($new_data, $data);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($new_data, self::typeConversion($data_child));\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$new_data = self::typeConversion($data);\n\t\t}\n\n\t\treturn $new_data;\n\t}", "function update_nested_array(&$array, $ancestors, $value){\r\n if(empty($ancestors)){\r\n \r\n //acf_log('-------- Advanced Uploader: Second Pass (empty) --------');\r\n //acf_log('$array before:', $array);\r\n \r\n // Search: array([0] => url=C:/fakepath/image.gif&name=image.gif&size=465547&type=image%2Fgif)\r\n if(is_array($array)){\r\n \r\n foreach($array as &$row){\r\n \r\n if(!is_string($row) || stripos($row, 'url=') !== 0)\r\n continue;\r\n \r\n $file_parsed = null;\r\n parse_str(wp_specialchars_decode($row), $file_parsed);\r\n \r\n // Get global uploaded files to make sure the order is respected (check name & size)\r\n foreach($this->files as $file_uploaded){\r\n \r\n $file_parsed['name'] = wp_unslash($file_parsed['name']);\r\n \r\n if($file_uploaded['name'] !== $file_parsed['name'] || absint($file_uploaded['size']) !== absint($file_parsed['size']))\r\n continue;\r\n \r\n // Found. Replace with Attachment ID\r\n $row = $value;\r\n \r\n break 2;\r\n \r\n }\r\n \r\n }\r\n \r\n }else{\r\n \r\n // Search: 146 (Attachment ID already set before)\r\n if(is_numeric($array)){\r\n \r\n // Convert to array for next upload (if any)\r\n $array = acf_get_array($array);\r\n $array[] = $value;\r\n \r\n // Other: Native behavior\r\n }else{\r\n \r\n $array = $value;\r\n \r\n }\r\n \r\n }\r\n \r\n //acf_log('$array after:', $array);\r\n \r\n // return\r\n return true;\r\n \r\n }\r\n \r\n // shift the next ancestor from the array\r\n $k = array_shift($ancestors);\r\n \r\n // if exists\r\n if(isset($array[$k])){\r\n \r\n //acf_log('-------- Advanced Uploader: First Pass (!empty) --------');\r\n //acf_log('$array['.$k.']', $array[$k]);\r\n \r\n return $this->update_nested_array($array[$k], $ancestors, $value);\r\n \r\n }\r\n \r\n // return\r\n return false;\r\n \r\n }", "function widgetopts_sanitize_array( &$array ) {\n foreach ($array as &$value) {\n if( !is_array($value) ) {\n\t\t\t// sanitize if value is not an array\n $value = sanitize_text_field( $value );\n\t\t}else{\n\t\t\t// go inside this function again\n widgetopts_sanitize_array($value);\n\t\t}\n }\n\n return $array;\n}", "protected function parseValue()\n {\n $expressions = array();\n while ($e = $this->parseExpression()) {\n $expressions[] = $e;\n if (!$this->matchChar(',')) {\n break;\n }\n }\n if (count($expressions) > 0) {\n return new ILess_Node_Value($expressions);\n }\n }", "private function T_ARRAY($value) {\n\t\t$_convert = array('('=>'{',\t')'=>'}',);\n\t\t$js = $this->parseUntil(array(';'), $_convert, true);\n\t\tif (strpos($js, ':') === false) {\n\t\t\t$this->tmp = -1;\n\t\t\t$js = preg_replace_callback ('/([{, \\t\\n])(\\'.*\\')(|.*:(.*))([,} \\t\\n])/Uis', array($this, 'cb_T_ARRAY'), $js);\n\t\t}\n\t\treturn $js;\n\t}", "public function parse()\n {\n if (isset($this->schema->cmd)) {\n foreach ($this->schema->cmd as $key => $val) {\n if ($key === \"addNamespaces\") {\n $this->registerNamespaces($val);\n } elseif ($key === \"removeEmptyValues\") {\n $this->removeEmptyValues = $val ? true : false;\n } elseif ($key === \"sortResult\") {\n $this->sort = $val ? true : false;\n }\n }\n }\n\n $array = $this->parseRecursive($this->schema);\n\n if ($this->sort) {\n ksort($array);\n }\n\n return $array;\n }", "protected function cleanUpValue( $value ) {\n\t\t$cleanValue = [];\n\t\tif ( !is_array( $value ) ) {\n\t\t\treturn $cleanValue;\n\t\t}\n\t\tforeach ( $value as $singleValue ) {\n\t\t\t$singleValue = parent::cleanUpValue( $singleValue );\n\t\t\t// Remove options that we don't have here\n\t\t\tif ( !isset( $this->fields[ $singleValue ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$cleanValue[] = $singleValue;\n\t\t}\n\t\treturn $cleanValue;\n\t}", "private function array_flatten_recursive($input_value, $parent_key = \"\") {\r\n\t\t$output_value = array();\r\n\t\tforeach ($input_value as $key => $value) {\r\n\t\t\t$this_key = (empty($parent_key)) ? $key : $parent_key.\"[{$key}]\";\r\n\t\t\tif (is_array($value)) {\r\n\t\t\t\t$this_value = $this->array_flatten_recursive($value, $this_key);\r\n\t\t\t\tif (!empty($this_value)) { $output_value = array_merge($output_value, $this_value); } else { $output_value[$this_key] = null; }\r\n\t\t\t}\r\n\t\t\telse { $output_value[$this_key] = $value; }\r\n\t\t}\r\n\t\treturn $output_value;\r\n\t}", "protected function parse_array_attributes( $key ) {\n\t\t$value = $this->{$key};\n\t\tif ( ! is_array( $value ) ) {\n\t\t\treturn $this;\n\t\t}\n\t\t$first = reset( $value );\n\t\tif ( ! is_array( $first ) ) {\n\t\t\treturn $this;\n\t\t}\n\n\t\t// Options aren't affected with taxonomies.\n\t\t$tmp_array = array();\n\t\t$tmp_std = array();\n\n\t\tforeach ( $value as $arr ) {\n\t\t\t$tmp_array[ $arr['key'] ] = $arr['value'];\n\t\t\tif ( isset( $arr['selected'] ) && $arr['selected'] ) {\n\t\t\t\t$tmp_std[] = $arr['key'];\n\t\t\t}\n\n\t\t\t// Push default value to std on Text List.\n\t\t\tif ( empty( $arr['default'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( 'fieldset_text' === $this->type ) {\n\t\t\t\t$tmp_std[ $arr['value'] ] = $arr['default'];\n\t\t\t} else {\n\t\t\t\t$tmp_std[] = $arr['default'];\n\t\t\t}\n\t\t}\n\n\t\t// Parse JSON and dot notations.\n\t\t$this->{$key} = $this->parse_json_dot_notations( $tmp_array );\n\n\t\tif ( $tmp_std ) {\n\t\t\t$this->std = $tmp_std;\n\t\t}\n\t\treturn $this;\n\t}", "function parseBISArray($str) {\n $str = substr($str, 1, -1); // Strip trailing quotes\n $bla = parseBISArray_helper($str);\n $result = array();\n\n foreach ($bla as $row) {\n foreach ($row as $child) {\n $result[] = $child;\n }\n if (count($row) == 0)\n $result[] = array();\n }\n //var_dump($result);\n return $result;\n}", "private function __parseData($data, $parent, $inner = false) {\n\t\t$out = array();\n\t\tforeach ($data as $param) {\n\t\t\textract($param);\n\t\t\t\n\t\t\t$valueElement = $parent->createElement('value', null);\n\t\t\t\n\t\t\tswitch ($type) {\n\t\t\t\tcase 'array':\n\t\t\t\t\t$arrayEl = $valueElement->createElement('array', null);\n\t\t\t\t\t$dataEl = $arrayEl->createElement('data', null);\t\t\t\t\n\t\t\t\t\t$this->__parseData($value, $dataEl, true);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'struct':\n\t\t\t\t\t$structEl = $valueElement->createElement('struct', null);\n\t\t\t\t\tforeach ($value as $memberKey => $memberValue) {\n\t\t\t\t\t\t$memberEl = $structEl->createElement('member', null);\n\t\t\t\t\t\t$memberEl->createElement('name', $memberKey);\n\t\t\t\t\t\t$this->__parseData(array($memberValue), $memberEl, true);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'date':\n\t\t\t\t\t$valueElement->createElement('dateTime.iso8601', date('Ymd\\TH:i:s', strtotime($value) ));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'base64':\n\t\t\t\tcase 'string':\n\t\t\t\tcase 'int':\n\t\t\t\tcase 'double':\n\t\t\t\t\t$valueElement->createElement($type, $value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'boolean':\n\t\t\t\t\t$bool = (boolean)$value ? 'true' : 'false';\n\t\t\t\t\t$valueElement->createElement('boolean', $bool);\n\t\t\t\tbreak;\t\t\t\t\n\t\t\t}\n\n\t\t\tif ($inner == false) {\n\t\t\t\t$paramElement = $parent->createElement('param', null);\n\t\t\t\t$valueElement->setParent($paramElement);\n\t\t\t} else {\n\t\t\t\t$paramElement = $valueElement;\n\t\t\t}\n\t\t\t$out[] = $paramElement;\n\t\t}\n\t\treturn $out;\t\t\n\t}", "public function validateValue(array &$element, FormStateInterface $form_state) {\n $values = $form_state->getValue($element['#parents']);\n $supports_multiple = $this->fieldDefinition->getFieldStorageDefinition()->getCardinality() != 1;\n if ($supports_multiple) {\n $values = implode('|', $values);\n }\n $form_state->setValue($element['#parents'], $values);\n }", "private function getValues_processCollection($raw_input, $remaining_depth, $group_id, $group_fields,\n\t\t\t& $field_values, & $path = null, $depth = 0)\n\t{\n\t\tif ($remaining_depth > 0) {\n\t\t\t// We need to go deeper ...\n\t\t\tif ($path === null) {\n\t\t\t\t$path = array();\n\t\t\t}\n\t\t\tforeach($raw_input as $i => $raw_input_subtree) {\n\t\t\t\t$path[$depth] = $i;\n\t\t\t\t$this->getValues_processCollection($raw_input_subtree, $remaining_depth - 1, $group_id, $group_fields,\n\t\t\t\t\t$field_values[$i], $path, $depth + 1);\n\t\t\t}\n\t\t} else {\n\t\t\t// Deep enough.\n\t\t\tforeach ($group_fields as $fi => $f) {\n\t\t\t\t// Is field present in the form ?\n\t\t\t\tif (!isset($raw_input[$fi])) {\n\t\t\t\t\t// Ignore missing fields\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Validate value\n\t\t\t\t$validators = $this->toolbox->getFieldValidators($f['type']);\n\t\t\t\tif (!empty($validators)) {\n\t\t\t\t\t$this->setCollectionKey($group_id, $path);\n\t\t\t\t\tforeach ($validators as $vi => $v) {\n\t\t\t\t\t\t$v::validateField($this, $group_id, $fi, $f, $raw_input[$fi]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Call post-processor, if set\n\t\t\t\t$processor_class = $this->toolbox->getFieldValueProcessor($f['type']);\n\t\t\t\tif ($processor_class) {\n\t\t\t\t\t$processor_class::valuePostProcess($raw_input, $field_values, $this, $group_id, $fi, $f);\n\t\t\t\t} else {\n\t\t\t\t\t$field_values[$fi] = $raw_input[$fi] === '' ? null : $raw_input[$fi];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->unsetCollectionKey($group_id);\n\t\t}\n\t}", "private function addArray($incoming_data, $incoming_indent) {\n\t//--\n\t// print_r ($incoming_data);\n\t//--\n\tif(Smart::array_size($incoming_data) > 1) {\n\t\treturn $this->addArrayInline ($incoming_data, $incoming_indent);\n\t} //end if\n\t//--\n\t$key = key($incoming_data);\n\t$value = isset($incoming_data[$key]) ? $incoming_data[$key] : null;\n\tif($key === '__!YAMLZero') {\n\t\t$key = '0';\n\t} //end if\n\t//--\n\tif($incoming_indent == 0 && !$this->yaml_contains_group_alias && !$this->yaml_contains_group_anchor) { // Shortcut for root-level values.\n\t\tif($key || $key === '' || $key === '0') {\n\t\t\t$this->result[$key] = $value;\n\t\t} else {\n\t\t\t$this->result[] = $value;\n\t\t\tend($this->result);\n\t\t\t$key = key($this->result);\n\t\t} //end if else\n\t\t$this->path[$incoming_indent] = $key;\n\t\treturn;\n\t} //end if\n\t//--\n\t$history = array();\n\t//-- Unfolding inner array tree.\n\t$history[] = $tmp_arr = $this->result;\n\tforeach($this->path as $z => $k) {\n\t\t$history[] = $tmp_arr = $tmp_arr[$k];\n\t} //end foreach\n\t//--\n\tif($this->yaml_contains_group_alias) {\n\t\t$value = $this->referenceContentsByAlias($this->yaml_contains_group_alias);\n\t\t$this->yaml_contains_group_alias = false;\n\t} //end if\n\t//-- Adding string or numeric key to the innermost level or $this->arr.\n\tif(is_string($key) && $key == '<<') {\n\t\tif(!is_array ($tmp_arr)) {\n\t\t\t$tmp_arr = array ();\n\t\t} //end if\n\t\t$tmp_arr = array_merge($tmp_arr, $value);\n\t} elseif($key || $key === '' || $key === '0') {\n\t\tif (!is_array ($tmp_arr)) {\n\t\t\t$tmp_arr = array ($key=>$value);\n\t\t} else {\n\t\t\t$tmp_arr[$key] = $value;\n\t\t} //end if else\n\t} else {\n\t\tif(!is_array ($tmp_arr)) {\n\t\t\t$tmp_arr = array ($value); $key = 0;\n\t\t} else {\n\t\t\t$tmp_arr[] = $value;\n\t\t\tend($tmp_arr);\n\t\t\t$key = key($tmp_arr);\n\t\t} //end if else\n\t} //end if else\n\t//--\n\t$reverse_path = array_reverse($this->path);\n\t$reverse_history = array_reverse($history);\n\t$reverse_history[0] = $tmp_arr;\n\t$cnt = Smart::array_size($reverse_history) - 1;\n\tfor($i=0; $i<$cnt; $i++) {\n\t\t$reverse_history[$i+1][$reverse_path[$i]] = $reverse_history[$i];\n\t} //end for\n\t$this->result = $reverse_history[$cnt];\n\t$this->path[$incoming_indent] = $key;\n\t//--\n\tif($this->yaml_contains_group_anchor) {\n\t\t$this->yaml_arr_saved_groups[$this->yaml_contains_group_anchor] = $this->path;\n\t\tif(is_array ($value)) {\n\t\t\t$k = key($value);\n\t\t\tif(!is_int ($k)) {\n\t\t\t\t$this->yaml_arr_saved_groups[$this->yaml_contains_group_anchor][$incoming_indent + 2] = $k;\n\t\t\t} //end if\n\t\t} //end if\n\t\t$this->yaml_contains_group_anchor = false;\n\t} //end if\n\t//--\n}", "private function MethodCall()\n\t{\n\t\t$values = [];\n\n\t\tif ( !$this->lexer->isNextToken( DocLexer::T_OPEN_PARENTHESIS ) )\n\t\t\treturn $values;\n\n\t\t$this->match( DocLexer::T_OPEN_PARENTHESIS );\n\n\t\tif ( !$this->lexer->isNextToken( DocLexer::T_CLOSE_PARENTHESIS ) )\n\t\t\t$values = $this->Values();\n\n\t\t$this->match( DocLexer::T_CLOSE_PARENTHESIS );\n\n\t\treturn $values;\n\t}", "function parseArray($arrayToken) {\n\n # remove bounding brackets\n $arrayToken = substr($arrayToken, 1, -1);\n\n # split on elements\n $elementTokens = $this->splitTokens($arrayToken);\n\n # elements will be collected in plain array\n $params = array();\n foreach ($elementTokens as $elementToken) {\n $params[] = $this->parseValue($elementToken);\n }\n return $params;\n }", "protected function _convertFlatToRecursive(array $data)\n {\n $arr = array();\n foreach ($data as $key => $value) {\n if (($key === 'conditions' || $key === 'actions') && is_array($value)) {\n foreach ($value as $id=>$data) {\n $path = explode('--', $id);\n $node =& $arr;\n for ($i=0, $l=sizeof($path); $i<$l; $i++) {\n if (!isset($node[$key][$path[$i]])) {\n $node[$key][$path[$i]] = array();\n }\n $node =& $node[$key][$path[$i]];\n }\n foreach ($data as $k => $v) {\n $node[$k] = $v;\n }\n }\n } else {\n /**\n * Convert dates into Zend_Date\n */\n if (in_array($key, array('from_date', 'to_date')) && $value) {\n $value = Mage::app()->getLocale()->date(\n $value,\n Varien_Date::DATE_INTERNAL_FORMAT,\n null,\n false\n );\n }\n $this->setData($key, $value);\n }\n }\n\n return $arr;\n }", "protected abstract function formatArrayValue(array $value);", "public static function parse(&$i,$o=array(),$c=0)\n\t{\n\t\tif($c > self::max_recur_depth)\n\t\t\treturn $o;\n\t\tif(is_array($i) and count($i))\n\t\t{\n\t\t\tforeach($i as $k => $v)\n\t\t\t{\n\t\t\t\tif(is_array($v))\n\t\t\t\t\t$o[$k] = self::parse($i[$k],array(),$c+1);\n\t\t\t\telse\n\t\t\t\t\t$o[self::clear_key($k)] = self::clear_value($v);\n\t\t\t}\n\t\t}\n\t\treturn $o;\n\t}", "static function flatten_values($array, $fn=null){\n\t\tif(!$fn){\n\t\t\t$fn = function($v, $k) use (&$fn){\n\t\t\t\tif(is_array($v)){\n\t\t\t\t\tlist($key, $value) = each($v);\n\t\t\t\t\treturn $fn($value, $key);\n\t\t\t\t}else{\n\t\t\t\t\treturn $v;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tforeach($array as $k=>&$v){\n\t\t\t$v = $fn($v, $k);\n\t\t} unset($v);\n\t\treturn $array;\n\t}", "protected function _parse(){\n\t\tforeach ($this->dataArray['tables']['nat']['default-chains'] as $a => &$b){\n\t\t\t$b['iptables-rules'] = array();\n\t\t\t$this->transformToIPTables($b['rules'], $b['iptables-rules']);\n\t\t}\n\t\t\n\t\t// Now the IP chains...\n\t\tforeach ($this->dataArray['tables']['nat']['ip-chains'] as &$e){\n\t\t\t$e['iptables-rules'] = array();\n\t\t\t$this->transformToIPTables($e['rules'], $e['iptables-rules']);\n\t\t}\n\t\t\n\t\t// And finally, the others...\n\t\tforeach ($this->dataArray['tables']['nat']['other-chains'] as $h => &$i){\n\t\t\t$i['iptables-rules'] = array();\n\t\t\t$this->transformToIPTables($i['rules'], $i['iptables-rules']);\n\t\t}\n\t}", "public function toArray($_recursive = TRUE);", "public function testSetValues()\n {\n $tests = array(\n array(\n 'label' => __LINE__ . \" string input\",\n 'value' => \"write user * * //...\",\n 'error' => true\n ),\n array(\n 'label' => __LINE__ . \" bool input\",\n 'value' => true,\n 'error' => true\n ),\n array(\n 'label' => __LINE__ . \" string input, doubled-up space\",\n 'value' => array(\"writer user * * //...\"),\n 'error' => true\n ),\n array(\n 'label' => __LINE__ . \" string input, space in field\",\n 'value' => array(\"writ er user * * //...\"),\n 'error' => true\n ),\n array(\n 'label' => __LINE__ . \" string input, missing field\",\n 'value' => array(\"writer * * //...\"),\n 'error' => true\n ),\n array(\n 'label' => __LINE__ . \" string input, space in unquoted path\",\n 'value' => array(\"writ er user * * //test path/...\"),\n 'error' => true\n ),\n array(\n 'label' => __LINE__ . \" array input, name has space\",\n 'value' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"* \",\n 'host' => \"*\",\n 'path' => \"//test with spaces/...\"\n )\n ),\n 'error' => true,\n ),\n array(\n 'label' => __LINE__ . \" array input, missing type\",\n 'value' => array (\n 0 => array (\n 'mode' => \"write \",\n 'name' => \"*\",\n 'host' => \"*\",\n 'path' => \"//test with spaces/...\"\n )\n ),\n 'error' => true,\n ),\n array(\n 'label' => __LINE__ . \" array input, missing path\",\n 'value' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"*\",\n )\n ),\n 'error' => true,\n ),\n array(\n 'label' => __LINE__ . \" one string input, path has spaces.\",\n 'value' => array('write user * * \"//test with spaces/...\"'),\n 'error' => false,\n 'out' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"*\",\n 'path' => \"//test with spaces/...\"\n )\n )\n ),\n array(\n 'label' => __LINE__ . \" one array input, path has spaces.\",\n 'value' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"*\",\n 'path' => \"//test with spaces/...\"\n )\n ),\n 'error' => false,\n ),\n array(\n 'label' => __LINE__ . \" one string input.\",\n 'value' => array(\"write user * * //...\"),\n 'error' => false,\n 'out' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"*\",\n 'path' => \"//...\"\n )\n )\n ),\n array(\n 'label' => __LINE__ . \" four string input\",\n 'value' => array(\n \"write user * * //...\",\n \"read user bob * //test1/...\",\n \"review group testGroup * //test2/...\",\n \"open user * example.com //test3/...\"\n ),\n 'out' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"*\",\n 'path' => \"//...\"\n ),\n 1 => array (\n 'mode' => \"read\",\n 'type' => \"user\",\n 'name' => \"bob\",\n 'host' => \"*\",\n 'path' => \"//test1/...\"\n ),\n 2 => array (\n 'mode' => \"review\",\n 'type' => \"group\",\n 'name' => \"testGroup\",\n 'host' => \"*\",\n 'path' => \"//test2/...\"\n ),\n 3 => array (\n 'mode' => \"open\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"example.com\",\n 'path' => \"//test3/...\"\n )\n ),\n 'error' => false\n ),\n array(\n 'label' => __LINE__ . \" four array input\",\n 'value' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"*\",\n 'path' => \"//...\"\n ),\n 1 => array (\n 'mode' => \"read\",\n 'type' => \"user\",\n 'name' => \"bob\",\n 'host' => \"*\",\n 'path' => \"//test1/...\"\n ),\n 2 => array (\n 'mode' => \"review\",\n 'type' => \"group\",\n 'name' => \"testGroup\",\n 'host' => \"*\",\n 'path' => \"//test2/...\"\n ),\n 3 => array (\n 'mode' => \"open\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"example.com\",\n 'path' => \"//test3/...\"\n )\n ),\n 'error' => false\n ),\n array(\n 'label' => __LINE__ . \" mixed string/array input\",\n 'value' => array(\n \"write user * * //...\",\n array (\n 'mode' => \"read\",\n 'type' => \"user\",\n 'name' => \"bob\",\n 'host' => \"*\",\n 'path' => \"//test1/...\"\n ),\n 'review group testGroup * \"//test2 with spaces/...\"',\n 3 => array (\n 'mode' => \"open\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"example.com\",\n 'path' => \"//test3/...\"\n )\n ),\n 'out' => array (\n 0 => array (\n 'mode' => \"write\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"*\",\n 'path' => \"//...\"\n ),\n 1 => array (\n 'mode' => \"read\",\n 'type' => \"user\",\n 'name' => \"bob\",\n 'host' => \"*\",\n 'path' => \"//test1/...\"\n ),\n 2 => array (\n 'mode' => \"review\",\n 'type' => \"group\",\n 'name' => \"testGroup\",\n 'host' => \"*\",\n 'path' => \"//test2 with spaces/...\"\n ),\n 3 => array (\n 'mode' => \"open\",\n 'type' => \"user\",\n 'name' => \"*\",\n 'host' => \"example.com\",\n 'path' => \"//test3/...\"\n )\n ),\n 'error' => false\n ),\n );\n\n foreach ($tests as $test) {\n $label = $test['label'];\n\n $protect = new P4_Protections;\n\n try {\n $protect->setProtections($test['value']);\n\n if ($test['error']) {\n $this->fail(\"$label: Unexpected success.\");\n }\n\n $expected = array_key_exists('out', $test) ? $test['out'] : $test['value'];\n\n $this->assertSame(\n $expected,\n $protect->getProtections(),\n \"$label: Unexpected Output\"\n );\n } catch (InvalidArgumentException $e) {\n if (!$test['error']) {\n $this->fail(\"$label: Unexpected failure.\");\n } else {\n $this->assertTrue(true, \"$label: Expected exception found\");\n }\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n $this->fail($e->getMessage());\n } catch (Exception $e) {\n $this->fail(\n \"$label: Unexpected Exception (\" . get_class($e) . '): ' . $e->getMessage()\n );\n }\n }\n }", "public function analyseArray($array){\n for($i=0;$i<count($array);$i++){\n if(is_numeric($array[$i]) || $array[$i]==\"\" || (int)($array[$i+1])<=0 || (int)($array[$i+1])>=100){\n $this->price=0;\n return True;\n }\n elseif((int)($array[$i+1])<=12){\n $this->price=$this->price+10;\n }\n else{\n $this->price=$this->price+15;\n }\n //For one loop the function analyses 2 elements\n $i=$i+1;\n }\n if($this->box){\n $this->price=$this->price+20;\n }\n return False;\n }", "private function _parseFieldValue($value, $config)\n\t{\n\t\t// check if\n\t\tif (is_array($value)) {\n\t\t\tif (!$config['separator']) {\n\t\t\t\t$config['separator'] = \"\\n\";\n\t\t\t}\n\n\t\t\t$value = implode($config['separator'], $value);\n \t\t}\n\n \t\treturn $value;\n\t}", "final protected function shouldBeFlatArray ($value) {\n\t\t$arguments = func_get_args();\n\t\tforeach ($arguments as $argument) {\n\t\t\tif (!is_array($argument)) {\n\t\t\t\treturn $this->fail();\n\t\t\t} else {\n\n\t\t\t\t// Fail if child array key found\n\t\t\t\tforeach ($argument as $child) {\n\t\t\t\t\tif (is_array($child)) {\n\t\t\t\t\t\treturn $this->fail();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn $this->pass();\n\t}", "function _postProcess() {\r\n $item = current($this->_struct);\r\n \r\n $ret = array('_name'=>$item['tag'], '_attributes'=>array(), '_value'=>null);\r\n\r\n if (isset($item['attributes']) && count($item['attributes'])>0) {\r\n foreach ($item['attributes'] as $key => $data) {\r\n if (!is_null($data)) {\r\n $item['attributes'][$key] = str_replace($this->_replaceWith, $this->_replace, $item['attributes'][$key]);\r\n }\r\n }\r\n $ret['_attributes'] = $item['attributes'];\r\n if ($this->attributesDirectlyUnderParent)\r\n $ret = array_merge($ret, $item['attributes']);\r\n }\r\n\r\n if (isset($item['value']) && $item['value'] != null)\r\n $item['value'] = str_replace($this->_replaceWith, $this->_replace, $item['value']);\r\n \r\n switch ($item['type']) {\r\n case 'open':\r\n $children = array();\r\n while (($child = next($this->_struct)) !== FALSE ) {\r\n if ($child['level'] <= $item['level'])\r\n break;\r\n \r\n $subItem = $this->_postProcess();\r\n \r\n if (isset($subItem['_name'])) {\r\n if (!isset($children[$subItem['_name']]))\r\n $children[$subItem['_name']] = array();\r\n \r\n $children[$subItem['_name']][] = $subItem;\r\n }\r\n else {\r\n foreach ($subItem as $key=>$value) {\r\n if (isset($children[$key])) {\r\n if (is_array($children[$key]))\r\n $children[$key][] = $value;\r\n else\r\n $children[$key] = array($children[$key], $value);\r\n }\r\n else {\r\n $children[$key] = $value;\r\n }\r\n }\r\n }\r\n }\r\n \r\n if ($this->childTagsDirectlyUnderParent)\r\n $ret = array_merge($ret, $this->_condenseArray($children));\r\n else\r\n $ret['_value'] = $this->_condenseArray($children);\r\n \r\n break;\r\n case 'close':\r\n break;\r\n case 'complete':\r\n if (count($ret['_attributes']) > 0) {\r\n if (isset($item['value']))\r\n $ret['_value'] = $item['value'];\r\n }\r\n else {\r\n\t\t\tif (isset($item['value'])) {\r\n\t\t\t\t$ret = array($item['tag']=> $item['value']);\r\n\t\t\t} else {\r\n\t\t\t\t$ret = array($item['tag']=> \"\");\r\n\t\t\t}\r\n }\r\n break;\r\n }\r\n\r\n //added by Dan Coulter\r\n\r\n \r\n /*\r\n foreach ($ret as $key => $data) {\r\n if (!is_null($data) && !is_array($data)) {\r\n $ret[$key] = str_replace($this->_replaceWith, $this->_replace, $ret[$key]);\r\n }\r\n }\r\n */\r\n return $ret;\r\n }", "abstract public function gotValue( array $path, $value );", "public function init()\n {\n if (!is_array($this->values)) {\n $this->values = [$this->values];\n }\n }", "function DisplayArray($array) {\n foreach ($array as $value) {\n if (is_array($value)) {\n DisplayArray($value);\n } else {\n echo $value . \"<br>\";\n }\n }\n }", "public function getValues( array $arr = array() ){\n $values = isset( $arr['__post'] ) ? $arr['__post'] : $arr;\n if( !isset($arr[ self::returnName($this->getName()) ]) ){\n $formPrefix = $this->getName().'/';\n foreach( $values as $k => $v ){\n if( strpos( $k, $formPrefix ) == 0 ){\n $this->values[ substr( $k, strlen($formPrefix) ) ] = $v;\n }\n }\n } else {\n $data = $arr[ self::returnName( $this->getName() ) ];\n foreach( $data as $k => $v ){\n $this->values[ $k ] = $v;\n }\n }\n\n if( isset( $arr['__errors'] ) ){\n $this->errors = $arr['__errors'];\n }\n }", "public function parseArray($data, $element=null) {\n if ($element === null) {\n $element = &$this->xml;\n }\n foreach ($data as $key=>$value) {\n if (is_array($value)) {\n if (is_numeric(array_keys($value)[0])) {\n foreach ($value as $v) {\n if (is_array($v)) {\n $this->parseArray($v, $element->addChild($key));\n } else {\n $element->addChild($key, $this->parseValue($v));\n }\n }\n } else {\n $this->parseArray($value, $element->addChild($key));\n }\n } else {\n $element->addChild($key, $this->parseValue($value));\n }\n }\n }", "function BuildSubstitutionArray($subdataArray, &$substitutionItemList)\n {\n $key = NULL;\n if (is_array($subdataArray)) {\n foreach ($subdataArray as $key => $value) {\n if ($value == \"\" || $value == NULL) \n {\n $substitutionItemList[$key] = \"Empty\"; \n }\n else \n {\n $substitutionItemList[$key] = \"Data Found\";\n }\n //$substitutionItemList[$key] = \"anything\";\n if ($key != NULL) {\n BuildSubstitutionArray($value, $substitutionItemList);\n }\n }\n }\n if ($key != NULL) {\n BuildSubstitutionArray($value, $substitutionItemList);\n }\n }", "public function getValues()\n\t{\n\t\tif ($this->use_defaults) {\n\t\t\tforeach ($this->form_def['field_groups'] as $gi => $g) {\n\t\t\t\t// Read-only values are input-only\n\t\t\t\tif ($this->readonly || !empty($g['readonly'])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// $this->field_defaults should contain all defaults by now, but maybe some of values are missing.\n\t\t\t\tif (!isset($this->field_defaults[$gi])) {\n\t\t\t\t\t$this->field_defaults[$gi] = array();\n\t\t\t\t\tif (empty($g['collection_dimensions'])) {\n\t\t\t\t\t\t// Values for the group are missing, use defaults from the form definition.\n\t\t\t\t\t\tforeach ($g['fields'] as $fi => $f) {\n\t\t\t\t\t\t\tif (isset($f['default'])) {\n\t\t\t\t\t\t\t\t$this->field_defaults[$gi][$fi] = $f['default'];\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// Empty collection by default.\n\t\t\t\t\t\t$this->field_defaults[$gi] = array();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $this->field_defaults;\n\t\t} else {\n\t\t\tif ($this->field_values === null) {\n\t\t\t\t$this->field_values = array();\n\t\t\t\t//$this->field_values = $this->raw_input;\n\n\t\t\t\tforeach ($this->form_def['field_groups'] as $gi => $g) {\n\t\t\t\t\tif ($this->readonly || !empty($g['readonly'])) {\n\t\t\t\t\t\t// Read-only values are input-only\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (empty($g['collection_dimensions'])) {\n\t\t\t\t\t\t// Simple group\n\t\t\t\t\t\tif (isset($this->raw_input[$gi])) {\n\t\t\t\t\t\t\t$this->getValues_processCollection($this->raw_input[$gi], 0, $gi, $g['fields'],\n\t\t\t\t\t\t\t\t$this->field_values[$gi]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// No data, use empty \"object\"\n\t\t\t\t\t\t\t$this->field_values[$gi] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ($g['collection_dimensions'] >= 1) {\n\t\t\t\t\t\t// Validate fields for each item in collection.\n\t\t\t\t\t\tif (isset($this->raw_input[$gi])) {\n\t\t\t\t\t\t\t// Non-empty collection, walk it recursively.\n\t\t\t\t\t\t\t$this->getValues_processCollection($this->raw_input[$gi], $g['collection_dimensions'], $gi, $g['fields'],\n\t\t\t\t\t\t\t\t$this->field_values[$gi]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Missing data, it should not happen, but whatever ... use empty collection instead.\n\t\t\t\t\t\t\t$this->field_values[$gi] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->http_method == 'get') {\n\t\t\t\t\t// FIXME: This does not work with collections\n\t\t\t\t\t$this->field_values = array_replace_recursive($this->field_defaults, $this->field_values);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this->field_values;\n\t\t}\n\t}", "function parseValue($value);", "function array_contents(&$array, $max_depth=0, $depth=0, $ignore_ints=false)\n{\n\t$string = $indent = \"\";\n\tfor ($i = 0; $i < $depth; $i++) {\n\t\t$indent .= \"\\t\";\n\t}\n\tif (!empty($max_depth) && $depth >= $max_depth) {\n\t\treturn $indent.\"[Max Depth Reached]\\n\";\n\t}\n\tif (empty($array)) {\n\t\treturn $indent.\"[Empty]\\n\";\n\t}\n\treset($array);\n\twhile ( list($key,$value) = each($array) ) {\n\t\t$print_key = str_replace(\"\\n\",\"\\\\n\",str_replace(\"\\r\",\"\\\\r\",str_replace(\"\\t\",\"\\\\t\",addslashes($key))));\n\t\tif ($ignore_ints && gettype($key) == \"integer\") {\n\t\t\tcontinue;\n\t\t}\n\t\t$type = gettype($value);\n\t\tif ($type == \"array\" || $type == \"object\") {\n\t\t\t$string .= $indent\n\t\t\t\t\t. ((is_string($key)) ? \"\\\"$print_key\\\"\": $key) . \" => \"\n\t\t\t\t\t. (($type == \"array\")?\"array (\\n\":\"\")\n\t\t\t\t\t. (($type == \"object\")?\"new \".get_class($value).\" Object (\\n\":\"\");\n\t\t\t$string .= array_contents($value, $max_depth, $depth + 1, $ignore_ints);\n\t\t\t$string .= $indent . \"),\\n\";\n\t\t} else {\n\t\t\tif (is_string($value)) {\n\t\t\t\t$value = str_replace(\"\\n\",\"\\\\n\",str_replace(\"\\r\",\"\\\\r\",str_replace(\"\\t\",\"\\\\t\",addslashes($value))));\n\t\t\t}\n\t\t\t$string .= $indent\n\t\t\t\t\t. ((is_string($key)) ? \"\\\"$print_key\\\"\": $key) . \" => \"\n\t\t\t\t\t. ((is_string($value)) ? \"\\\"$value\\\"\": $value) . \",\\n\";\n\t\t}\n\t}\n\t$string[ strlen($string) - 2 ] = \" \";\n\treturn $string;\n}", "public function testArrayMapRecursive()\n\t{\n\t\t// test array\n\t\t$testArray = array(0 => array('string1' => 'This%20is%20a%20string'), 1 => array('string2' => 'This%20is%20a%20string'));\n\n\t\t// expected result\n\t\t$testResult = array(0 => array('string1' => 'This is a string'), 1 => array('string2' => 'This is a string'));\n\n\t\t// perform test\n\t\t$this->assertEquals($testResult, SpoonFilter::arrayMapRecursive('urldecode', $testArray));\n\n\n\t\t/* with allowedKeys parameter */\n\t\t// test array\n\t\t$testArray = array(0 => serialize(array('string1' => 'spoon')), 1 => serialize(array('string2' => 'rocks')));\n\n\t\t// expected result\n\t\t$testResult= array(0 => 'a:1:{s:7:\"string1\";s:5:\"spoon\";}', 1 => array('string2' => 'rocks'));\n\n\t\t// perform test\n\t\t$this->assertEquals($testResult, SpoonFilter::arrayMapRecursive('unserialize', $testArray, '1'));\n\n\n\t\t/* with allowedKeys parameter, depth of 4 */\n\t\t// test array\n\t\t$testArray = array(0 => array('array1' => array(array('spoon' => serialize('kicks'), 'serious' => serialize('ass')))), 1 => serialize(array('string2' => 'ass')));\n\n\t\t// expected result\n\t\t$testResult = array(0 => array('array1' => array(array('spoon' => 's:5:\"kicks\";', 'serious' => 'ass'))), 1 => array('string2' => 'ass'));\n\n\t\t// perform test\n\t\t$this->assertEquals($testResult, SpoonFilter::arrayMapRecursive('unserialize', $testArray, array('serious', '1')));\n\t}", "public function getVDefValues(array $array, $caller = NULL, $arrayKey = NULL) {\n\t\tif ($caller === NULL) {\n\t\t\t$caller = $this;\n\t\t}\n\t\tforeach($array as $key => $value) {\n\t\t\tif ($key === 'vDEF') {\n\t\t\t\t$caller->temporaryDceProperties[substr($arrayKey, 9)] = $value;\n\t\t\t}\n\t\t\telseif (is_array($value) && array_key_exists('el', $value)) {\n\t\t\t\t$propertyName = substr($key, 9);\n\t\t\t\t$values = array();\n\t\t\t\t$i = 1;\n\t\t\t\tif (is_array(current($value))) {\n\t\t\t\t\tforeach (current($value) as $entry) {\n\t\t\t\t\t\tif (is_array($entry)) {\n\t\t\t\t\t\t\t$entry = $entry['container_' . $propertyName]['el'];\n\t\t\t\t\t\t\tif (is_array($entry)) {\n\t\t\t\t\t\t\t\tforeach($entry as $k => $v) {\n\t\t\t\t\t\t\t\t\t$entry[$k] = $v['vDEF'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$values[$i++] = array('container_' . $propertyName => $entry);\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$caller->temporaryDceProperties[$propertyName] = $values;\n\t\t\t} elseif (is_array($value)) {\n\t\t\t\t$this->getVDefValues($value, $caller, $key);\n\t\t\t}\n\t\t}\n\t}", "final public static function parse(array $array,array $option):array\n {\n $return = [];\n $separator = self::getSeparator(1);\n $segment = Segment::getDelimiter(null,true);\n\n if(is_string($option['prepend']))\n {\n $prepend = self::parseValue($option['prepend'],$option['replaceAccent']);\n $return[] = $prepend;\n }\n\n foreach ($array as $key => $value)\n {\n $value = preg_split('~[^\\\\pL\\d'.$segment[0].$segment[1].']+~u',$value,-1,PREG_SPLIT_NO_EMPTY);\n\n if(!empty($value))\n {\n foreach ($value as $v)\n {\n if(is_string($v))\n {\n $v = self::parseValue($v,$option['replaceAccent']);\n\n if(!empty($v))\n $return[] = $v;\n }\n }\n }\n }\n\n if(is_string($option['append']))\n {\n $append = self::parseValue($option['append'],$option['replaceAccent']);\n $return[] = $append;\n }\n\n if(is_array($option['sliceLength']) && count($option['sliceLength']) === 2)\n {\n $keep = $return;\n\n $option['sliceLength'] = array_values($option['sliceLength']);\n $return = Arr::valuesSliceLength($option['sliceLength'][0],$option['sliceLength'][1],$return);\n\n if($option['keepNum'] === true)\n {\n foreach ($keep as $k => $v)\n {\n if(!array_key_exists($k,$return) && is_numeric($v))\n $return[$k] = $v;\n }\n\n ksort($return);\n }\n\n if($option['keepLast'] === true)\n {\n if(Arr::keyLast($keep) !== Arr::keyLast($return))\n $return[] = Arr::valueLast($keep);\n }\n }\n\n if(is_numeric($option['totalLength']) && !empty($option['totalLength']))\n {\n $reverse = Arr::valuesTotalLength($option['totalLength'],array_reverse($return));\n $return = array_reverse($reverse);\n }\n\n return $return;\n }", "function f_json_values($select){\n # repasso os valores em uma string todo o $post\n\n ## verifico quantas respostas e seleciona apeneas values ##\n # caso values esteja na raiz da array\n if (array_key_exists(\"values\", $select)) {\n $return = $select['values']; #exibe\n }\n\n # caso exista uma lista de resultados\n else{\n # conta quantas ocorrencias\n $temp['count'] = count($select);\n\n # seleciono cada sequancia\n for ($temp['some']=0; $temp['some'] < $temp['count']; $temp['some']++) {\n\n # trabalha o resultado de res\n if($temp['some'] <= 0) {\n\n # preenche quando em zero\n $temp['return'] = $select[$temp['some']]['values'];\n }else{\n\n # adiciona quando maior que zero\n $temp['return'] = $temp['return'] .\", \". $select[$temp['some']]['values'];\n }\n\n # aplico em return\n $return = $temp['return'];\n }\n }\n\n # retoorna a função\n return $return;\n}", "private function _parse($value)\n\t{\n\t\tif (is_object($value)) {\n\t\t\treturn $value;\n\t\t}\n\t\t\n\t\tif (is_array($value)) {\n\t\t\tforeach ($value as $k => $v) {\n\t\t\t\t$value[$k] = $this->_parse($v);\n\t\t\t}\n\t\t\treturn $value;\n\t\t}\n\t\t\n\t\tif (preg_match(\"/^[0-9]+$/\", $value)) {\n\t\t\treturn (int) $value;\n\t\t}\n\t\t\n\t\tif (preg_match(\"/^[0-9]+\\.[0-9]+$/\", $value)) {\n\t\t\treturn (float) $value;\n\t\t}\n\t\t\n\t\treturn $value;\n\t}", "public function testTransformParameterArrayToStatementArray()\n {\n // add test data\n $this->importTurtle('\n @prefix form: <http://form/> .\n @prefix kno: <'. $this->commonNamespaces->getUri('kno') .'> .\n @prefix rdfs: <'. $this->commonNamespaces->getUri('rdfs') .'> .\n\n form:type1 ;\n kno:has-property form:t1-p1 ;\n kno:has-property form:t1-p2 ;\n kno:has-property form:t1-p3 .\n\n form:t1-p1\n rdfs:label \"Root-Prop-1 DE\"@de ;\n rdfs:label \"Root-Prop-1 EN\"@en .\n\n form:t1-p2\n kno:restriction-reference-is-of-type form:type2 .\n\n form:type2\n kno:has-property form:t2-p1 ;\n kno:has-property form:t2-p2 .\n\n form:t2-p1\n rdfs:label \"Type2-Prop-1\"@en .\n ',\n $this->testGraph,\n $this->store\n );\n\n $this->commonNamespaces->add('form', 'http://form/');\n\n /*\n * set parameters for function to test\n */\n $typeUri = 'form:type1';\n $formInput = array(\n '__type' => $typeUri,\n '__idUri' => 'http://type1/',\n 'form:t1-p1' => 't1-p1-value',\n // sub entry 1\n 'form:t1-p2__uriSchema' => '%root-uri%?form:t2-p1?',\n 'form:t1-p2__type' => 'form:type2',\n 'form:type1__form:t1-p2__form:type2____idUri__0' => 'http://type1/sub-value1',\n 'form:type1__form:t1-p2__form:type2__form:t2-p1__0' => 'sub-value1',\n 'form:type1__form:t1-p2__form:type2__form:t2-p2__0' => 'sub-value2',\n // sub entry 2 (not yet \"created\", therefore needs an URI)\n 'form:type1__form:t1-p2__form:type2__form:t2-p1__1' => 'sub-value3',\n 'form:type1__form:t1-p2__form:type2__form:t2-p2__1' => 'sub-value4',\n 'form:type1__form:t1-p2__number' => '2',\n\n 'form:t1-p3' => 't1-p3-value',\n );\n\n $res = $this->fixture->transformParameterArrayToStatementArray($formInput);\n\n $this->assertEquals(\n array(\n $this->statementFactory->createStatement(\n $this->nodeFactory->createNamedNode('http://type1/'),\n $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('rdf')),\n $this->nodeFactory->createNamedNode($this->commonNamespaces->extendUri($typeUri))\n ),\n $this->statementFactory->createStatement(\n $this->nodeFactory->createNamedNode('http://type1/'),\n $this->nodeFactory->createNamedNode('http://form/t1-p1'),\n $this->nodeFactory->createLiteral('t1-p1-value')\n ),\n // root element ===> sub element 1\n $this->statementFactory->createStatement(\n $this->nodeFactory->createNamedNode('http://type1/'),\n $this->nodeFactory->createNamedNode('http://form/t1-p2'),\n $this->nodeFactory->createNamedNode('http://type1/sub-value1')\n ),\n $this->statementFactory->createStatement(\n $this->nodeFactory->createNamedNode('http://type1/sub-value1'),\n $this->nodeFactory->createNamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'),\n $this->nodeFactory->createNamedNode('http://form/type2')\n ),\n $this->statementFactory->createStatement(\n $this->nodeFactory->createNamedNode('http://type1/sub-value1'),\n $this->nodeFactory->createNamedNode('http://form/t2-p1'),\n $this->nodeFactory->createLiteral('sub-value1')\n ),\n $this->statementFactory->createStatement(\n $this->nodeFactory->createNamedNode('http://type1/sub-value1'),\n $this->nodeFactory->createNamedNode('http://form/t2-p2'),\n $this->nodeFactory->createLiteral('sub-value2')\n ),\n $this->statementFactory->createStatement(\n $this->nodeFactory->createNamedNode('http://type1/'),\n $this->nodeFactory->createNamedNode('http://form/t1-p2'),\n $this->nodeFactory->createNamedNode('http://type1/sub_value3')\n ),\n $this->statementFactory->createStatement(\n $this->nodeFactory->createNamedNode('http://type1/sub_value3'),\n $this->nodeFactory->createNamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'),\n $this->nodeFactory->createNamedNode('http://form/type2')\n ),\n $this->statementFactory->createStatement(\n $this->nodeFactory->createNamedNode('http://type1/sub_value3'),\n $this->nodeFactory->createNamedNode('http://form/t2-p1'),\n $this->nodeFactory->createLiteral('sub-value3')\n ),\n $this->statementFactory->createStatement(\n $this->nodeFactory->createNamedNode('http://type1/sub_value3'),\n $this->nodeFactory->createNamedNode('http://form/t2-p2'),\n $this->nodeFactory->createLiteral('sub-value4')\n ),\n $this->statementFactory->createStatement(\n $this->nodeFactory->createNamedNode('http://type1/'),\n $this->nodeFactory->createNamedNode('http://form/t1-p3'),\n $this->nodeFactory->createLiteral('t1-p3-value')\n )\n ),\n $res\n );\n }", "function array_trim_recursive($values, $charlist = \" \\t\\n\\r\\0\\x0B\")\n {\n if (is_array($values)) {\n return array_map('array_trim_recursive', $values);\n }\n\n return is_string($values) ? trim($values, $charlist) : $values;\n }", "function evalValues()\t{\n\t\t// Check required, set failure if not ok.\n\t\treset($this->requiredArr);\n\t\t$masterTable=$this->conf['blogData']?'tx_metafeedit_comments':$this->theTable;\n\t\t$tempArr=array();\n\t\twhile(list(,$theField)=each($this->requiredArr))\t{\n\t\t\tif (!trim($this->dataArr[$theField]) )\t{\n\t\t\t\tif ($this->conf['TCAN'][$this->theTable]['columns'][$theField]['config']['type']=='group' && $this->conf['TCAN'][$this->theTable]['columns'][$theField]['config']['internal_type']=='file')\t{\n\t\t\t\t\t\n\t\t\t\t\tif (!trim($this->dataArr[$theField.'_file']) )\t{\n\t\t\t\t\t\n\t\t\t\t\t\t$tempArr[]=$theField;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$tempArr[]=$theField;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Evaluate: This evaluates for more advanced things than 'required' does. But it returns the same error code, so you must let the required-message tell, if further evaluation has failed!\n\t\t$recExist=0;\n\t\t$evalValues=$this->conf['blogData']?$this->metafeeditlib->getBlogEvalValues($this->conf):$this->conf[$this->conf['cmdKey'].'.']['evalValues.'];\n\t\tif (is_array($evalValues))\t{\n\t\t\tswitch($this->conf['inputvar.']['cmd'])\t{\n\t\t\t\tcase 'edit':\n\t\t\t\t\tif (isset($this->dataArr['pid']))\t{\t\t\t// This may be tricked if the input has the pid-field set but the edit-field list does NOT allow the pid to be edited. Then the pid may be false.\n\t\t\t\t\t\t$recordTestPid = intval($this->dataArr['pid']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tempRecArr = $GLOBALS['TSFE']->sys_page->getRawRecord($masterTable,$this->dataArr[$this->conf['uidField']]);\n\t\t\t\t\t\t$recordTestPid = intval($tempRecArr['pid'])?intval($tempRecArr['pid']):$this->thePid;\n\t\t\t\t\t}\n\t\t\t\t\t$recExist=1;\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$recordTestPid = $this->thePid ? $this->thePid : t3lib_div::intval_positive($this->dataArr['pid']);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treset($evalValues);\n\t\t\twhile(list($theField,$theValue)=each($evalValues))\t{\n\t\t\t\t$listOfCommands = t3lib_div::trimExplode(',',$theValue,1);\n\t\t\t\twhile(list(,$cmd)=each($listOfCommands))\t{\n\t\t\t\t\t$cmdParts = preg_split('/\\[|\\]/',$cmd);\t// Point is to enable parameters after each command enclosed in brackets [..]. These will be in position 1 in the array.\n\t\t\t\t\t$theCmd = trim($cmdParts[0]);\n\t\t\t\t\tswitch($theCmd)\t{\n\t\t\t\t\t\tcase 'uniqueGlobal':\n\t\t\t\t\t\t\t\t$whereef= $GLOBALS['TSFE']->sys_page->enableFields($masterTable);\n\t\t\t\t\t\t\t\tif ($DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($masterTable,$theField,$this->dataArr[$theField],$whereef,'','','1'))\t{\n\t\t\t\t\t\t\t\tif (!$recExist || $DBrows[0][$this->conf['uidField']]!=$this->dataArr[$this->conf['uidField']])\t{\t// Only issue an error if the record is not existing (if new...) and if the record with the false value selected was not our self.\n\t\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_existed',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'uniqueFields':\n\n\t\t\t\t\t \t\t$i=0;\t\n\t\t\t\t\t\t\tforeach($cmdParts as $cmdP) {\n\t\t\t\t\t\t\t\tif ($i>0 && trim($cmdP)) $Where.= \" and \".$cmdParts[$i].\"='\".$this->dataArr[$cmdParts[$i]].\"'\";\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$whereef= $GLOBALS['TSFE']->sys_page->enableFields($masterTable);\n\t\t\t\t\t\t\tif ($DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($masterTable,$theField,$this->dataArr[$theField], 'AND pid IN ('.$recordTestPid.')'.$Where.$whereef,'','','1'))\t{\n\t\t\t\t\t\t\t\tif (!$recExist || $DBrows[0][$this->conf['uidField']]!=$this->dataArr[$this->conf['uidField']])\t{\t// Only issue an error if the record is not existing (if new...) and if the record with the false value selected was not our self.\n\t\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_mvalue_existed',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'uniqueLocal':\n\t\t\t\t\t\tcase 'uniqueInPid':\n\t\t\t\t\t\t\t$whereef= $GLOBALS['TSFE']->sys_page->enableFields($masterTable);\n\t\t\t\t\t\t\tif ($DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($masterTable,$theField,$this->dataArr[$theField], 'AND pid IN ('.$recordTestPid.')'.$whereef,'','','1'))\t{\n\t\t\t\t\t\t\tif (!$recExist || $DBrows[0][$this->conf['uidField']]!=$this->dataArr[$this->conf['uidField']])\t{\t// Only issue an error if the record is not existing (if new...) and if the record with the false value selected was not our self.\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_existed',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'twice':\n\t\t\t\t\t\t\tif (strcmp($this->dataArr[$theField], $this->dataArr[$theField.'_again']))\t{\n\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_twice',$this->conf));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'email':\n\t\t\t\t\t\t\tif (trim($this->dataArr[$theField])) {\n\t\t\t\t\t\t\t\tif (!$this->cObj->checkEmail($this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_valid_email',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'required':\n\t\t\t\t\t\t\tif (!trim($this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\tif ($this->conf['TCAN'][$this->theTable]['columns'][$theField]['config']['type']=='group' && $this->conf['TCAN'][$this->theTable]['columns'][$theField]['config']['internal_type']=='file')\t{\n\t\t\t\t\t\t\t\t\tif (!trim($this->dataArr[$theField.'_file']) )\t{\n\t\t\t\t\t\t\t\t\t\t$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_required',$this->conf));\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_required',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'atLeast':\n\t\t\t\t\t\t\t$chars=intval($cmdParts[1]);\n\t\t\t\t\t\t\tif (strlen($this->dataArr[$theField])<$chars)\t{\n\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = sprintf($this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_min_char',$this->conf)), $chars);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'invert':\n\t\t\t\t\t\t\t$this->dataArr[$theField]=$this->dataArr[$theField]?0:1;\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'atMost':\n\t\t\t\t\t\t\t$chars=intval($cmdParts[1]);\n\t\t\t\t\t\t\tif (strlen($this->dataArr[$theField])>$chars)\t{\n\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = sprintf($this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_max_char',$this->conf)), $chars);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'inBranch':\n\t\t\t\t\t\t\t$pars = explode(';',$cmdParts[1]);\n\t\t\t\t\t\t\tif (intval($pars[0]))\t{\n\t\t\t\t\t\t\t\t$pid_list = $this->cObj->getTreeList(\n\t\t\t\t\t\t\t\t\tintval($pars[0]),\n\t\t\t\t\t\t\t\t\tintval($pars[1]) ? intval($pars[1]) : 999,\n\t\t\t\t\t\t\t\t\tintval($pars[2])\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif (!$pid_list || !t3lib_div::inList($pid_list,$this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = sprintf($this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_notInList',$this->conf)), $pid_list);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'unsetEmpty':\n\t\t\t\t\t\t\tif (!$this->dataArr[$theField])\t{\n\t\t\t\t\t\t\t\t$hash = array_flip($tempArr);\n\t\t\t\t\t\t\t\tunset($hash[$theField]);\n\t\t\t\t\t\t\t\t$tempArr = array_keys($hash);\n\t\t\t\t\t\t\t\tunset($this->failureMsg[$theField]);\n\t\t\t\t\t\t\t\tunset($this->dataArr[$theField]);\t// This should prevent the field from entering the database.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//should go in parse values ?\n\t\t\t\t\t\tcase 'wwwURL':\n\t\t\t\t\t\t\t\tif ($this->dataArr[$theField]) {\n\t\t\t\t\t\t\t\t\t\t$wwwURLOptions = array (\n\t\t\t\t\t\t\t\t\t\t'AssumeProtocol' => 'http' ,\n\t\t\t\t\t\t\t\t\t\t\t\t'AllowBracks' => TRUE ,\n\t\t\t\t\t\t\t\t\t\t\t\t'AllowedProtocols' => array(0 => 'http', 1 => 'https', ) ,\n\t\t\t\t\t\t\t\t\t\t\t\t'Require' => array('Protocol' => FALSE , 'User' => FALSE , 'Password' => FALSE , 'Server' => TRUE , 'Resource' => FALSE , 'TLD' => TRUE , 'Port' => FALSE , 'QueryString' => FALSE , 'Anchor' => FALSE , ) ,\n\t\t\t\t\t\t\t\t\t\t\t\t'Forbid' => array('Protocol' => FALSE , 'User' => TRUE , 'Password' => TRUE , 'Server' => FALSE , 'Resource' => FALSE , 'TLD' => FALSE , 'Port' => TRUE , 'QueryString' => FALSE , 'Anchor' => FALSE , ) ,\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t$wwwURLResult = tx_metafeedit_srfeuserregister_pi1_urlvalidator::_ValURL($this->dataArr[$theField], $wwwURLOptions);\n\t\t\t\t\t\t\t\t\t\tif ($wwwURLResult['Result'] = 'EW_OK' ) {\n\t\t\t\t\t\t\t\t\t\t\t\t$this->dataArr[$theField] = $wwwURLResult['Value'];\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\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$theField.'###'] = is_array($this->failureMsg[$theField]) ? implode('<br />',$this->failureMsg[$theField]) : '';\n\t\t\t\t//$this->markerArray['###CSS_ERROR_FIELD_'.$theField.'###']=$this->markerArray['###EVAL_ERROR_FIELD_'.$theField.'###']?'tx-metafeedit-form-error ':'';\n\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$theField.'###']=is_array($this->failureMsg[$theField])?'tx-metafeedit-form-field-error ':'';\n\t\t\t}\n\t\t}\n\t\t//$this->failure=implode(',',$tempArr);\t //$failure will show which fields were not OK\n\t\tif (count($this->failureMsg) >0) {\n\t\t\t$this->failure=1;\n\t\t\tif (count($tempArr)) {\n\t\t\t\tforeach($tempArr as $ta) {\n\t\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$ta.'###']='tx-metafeedit-form-field-error ';\n\t\t\t\t}\n\t\t\t\t$this->failure=implode(',',$tempArr);\n\t\t\t}\n\t\t\t$this->markerArray['###EVAL_ERROR###'] = $this->metafeeditlib->makeErrorMarker($this->conf,$this->metafeeditlib->getLL('error_occured',$this->conf));\n\t\t} else { \n\t\t\t$this->failure=0;\n\t\t\tif (count($tempArr)) {\n\t\t\t\t$this->failure=implode(',',$tempArr);\n\t\t\t\t$this->markerArray['###EVAL_ERROR###'] = $this->metafeeditlib->makeErrorMarker($this->conf,$this->getFailure('_FORM', '_REQUIRED', $this->metafeeditlib->getLL('error_required',$this->conf))); \n\t\t\t}\n\t\t}\n\t\t\n\t\t// Call to user eval function\n\n\t\t\n\t\tif ($this->conf['userFunc_afterEval']) t3lib_div::callUserFunction($this->conf['userFunc_afterEval'],$this->conf,$this);\n\n\t}", "function chartjs_array_filter_recursive($input) {\r\n\tforeach ($input as &$value) {\r\n\t\tif (is_array($value)) {\r\n\t\t\t$value = chartjs_array_filter_recursive($value);\r\n\t\t}\r\n\t}\r\n\treturn array_filter($input);\r\n}", "function acf_update_nested_array(&$array, $ancestors, $value)\n{\n}", "abstract public function parsePostData() : array;", "function SS_cleanXMLArray($array){\n\tif (is_array($array)){\n\t\tforeach ($array as $k=>$a){\n\t\t\tif (is_array($a) && count($a)==1 && isset($a[0])){\n\t\t\t\t$array[$k] = SS_cleanXMLArray($a[0]);\n\t\t\t}\n\t\t}\n\t}\n\treturn $array;\n}", "function setValueByArray($a_values)\r\n\t{\r\n\t\tglobal $ilUser;\r\n\t\t\r\n\t\t$this->setAllValue($a_values[$this->getPostVar()][\"all\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"all\"][\"num_unit\"]);\r\n\t\t$this->setBottomValue($a_values[$this->getPostVar()][\"bottom\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"bottom\"][\"num_unit\"]);\r\n\t\t$this->setTopValue($a_values[$this->getPostVar()][\"top\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"top\"][\"num_unit\"]);\r\n\t\t$this->setLeftValue($a_values[$this->getPostVar()][\"left\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"left\"][\"num_unit\"]);\r\n\t\t$this->setRightValue($a_values[$this->getPostVar()][\"right\"][\"num_value\"].\r\n\t\t\t$a_values[$this->getPostVar()][\"right\"][\"num_unit\"]);\r\n\t}", "protected function initializeValues(): void\n {\n foreach ($this->params as $name => $infos) {\n if (!$this->is_sub_object && isset($infos['subobject']) && $infos['subobject']) {\n if (isset($infos['multivalues']) && $infos['multivalues']) {\n $this->values[$name] = [];\n } else {\n $tmp = get_class($this);\n $parts = explode('\\\\', $tmp);\n array_pop($parts);\n $class_name = implode('\\\\', $parts) . '\\\\' . $infos['type'];\n $class_name = str_replace('Entity', 'Datatype', $class_name);\n if (!class_exists($class_name)) {\n $class_name = str_replace(['\\\\EU\\\\', '\\\\AP\\\\', '\\\\EA\\\\'], '\\\\AM\\\\', $class_name);\n }\n $this->values[$name] = new $class_name();\n }\n } else {\n $this->values[$name] = null;\n }\n }\n }", "public function __invoke(string $value) : array\n {\n if ($value !== '') {\n return $this->parseRawValue($value);\n }\n return [];\n }", "public function setFromArray(array &$_data)\n {\n parent::setFromArray($_data);\n \n if (isset($_data['flatpath'])) {\n $this->_parsePath($_data['flatpath']);\n }\n }", "function parseValue($valueToken) {\n if ($this->isObject($valueToken)) {\n return $this->parseObject($valueToken);\n } elseif ($this->isArray($valueToken)) {\n return $this->parseArray($valueToken);\n }\n # it's the value itself\n return $this->processParameter($valueToken);\n }", "function parse($data) {\n $output=[];\n $val=0;\n foreach(str_split($data) as $value){\n switch($value){\n case 'i': $val++;break;\n case 'd': $val--; break;\n case 's': $val **= 2; break;\n case 'o': $output[] = $val; break;\n }\n }\n return $output;\n}", "function snmpwalk_values($device, $oid, $array, $mib = NULL, $mibdir = NULL)\n{\n $data = snmp_walk($device, $oid, \"-OQUs\", $mib, $mibdir);\n foreach (explode(\"\\n\", $data) as $entry)\n {\n list($oid,$value) = explode(\"=\", $entry, 2);\n $oid = trim($oid); $value = trim($value);\n list($oid, $index) = explode(\".\", $oid, 2);\n if (isset($oid) && isset($index) && is_valid_snmp_value($value))\n {\n $array[] = $value;\n }\n }\n\n return $array;\n}", "protected function getValueAsArray()\n {\n if(strpos($this->value, '|') > 1){\n $values = array_filter(explode(\"|\", $this->value));\n } else {\n $values = [$this->value];\n }\n return $values;\n }", "public function processField($arr){\n\t\t$return = array();\n\t\t$parts = explode(',', $arr);\n\t\t$seq = 0;\n\t\tfor($i=0; $i<count($parts); $i++){\n\t\t\tif('blank' == substr($parts[$i],0,5)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlist(,$list) = explode('_', $parts[$i])\t;\n\t\t\t//$list = str_replace('item_', '',$parts[$i]);\n\t\t\tlist($type, $fieldId) = explode('-',$list);\n\t\t\t$return[$type][$fieldId] = \tintval($seq);\n\t\t\t$seq++;\n\t\t}\n\n\t\treturn $return;\n\t}", "function pg_array_parse($s,$start=0,&$end=NULL){\n if (empty($s) || $s[0]!='{') return NULL;\n $return = array();\n $br = 0;\n $string = false;\n $quote='';\n $len = strlen($s);\n $v = '';\n for($i=$start+1; $i<$len;$i++){\n $ch = $s[$i];\n\n if (!$string && $ch=='}'){\n if ($v!=='' || !empty($return)){\n $return[] = $v;\n }\n $end = $i;\n break;\n }else\n if (!$string && $ch=='{'){\n $v = pg_array_parse($s,$i,$i);\n }else\n if (!$string && $ch==','){\n $return[] = $v;\n $v = '';\n }else\n if (!$string && ($ch=='\"' || $ch==\"'\")){\n $string = TRUE;\n $quote = $ch;\n }else\n if ($string && $ch==$quote && $s[$i-1]==\"\\\\\"){\n $v = substr($v,0,-1).$ch;\n }else\n if ($string && $ch==$quote && $s[$i-1]!=\"\\\\\"){\n $string = FALSE;\n }else{\n $v .= $ch;\n }\n }\n return $return;\n}", "protected function _tree($array) {\n\n\t\t\t$root = array(\n\t\t\t\t'children' => array()\n\t\t\t);\n\t\t\t$current = &$root;\n\n\t\t\tforeach ($array as $i => $node) {\n\n\t\t\t\t$result = $this->_tag($node);\n\t\t\t\t\n\t\t\t\tif ($result) {\n\t\t\t\t\t\n\t\t\t\t\tif (isset($result['tag'])) {\n\t\t\t\t\t\t$tag = $result['tag'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tag = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($result['arguments'])) {\n\t\t\t\t\t\t$arguments = $result['arguments'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$arguments = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($tag) {\n\t\t\t\t\t\t// If segment does not contain a closer\n\t\t\t\t\t\tif (!$result['closer']) {\n\t\t\t\t\t\t\t// clean up syntax if segment is isolated and \n\t\t\t\t\t\t\t// preceded by an plain text segment\n\t\t\t\t\t\t\t$last = ArrayMethods::last($current['children']);\n\t\t\t\t\t\t\tif ($result['isolated'] && is_string($last)) {\n\t\t\t\t\t\t\t\tarray_pop($current['children']);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current['children'][] = array(\n\t\t\t\t\t\t\t\t'index' => $i,\n\t\t\t\t\t\t\t\t'parent' => &$current,\n\t\t\t\t\t\t\t\t'children' => array(),\n\t\t\t\t\t\t\t\t'raw' => $result['source'],\n\t\t\t\t\t\t\t\t'tag' => $tag,\n\t\t\t\t\t\t\t\t'arguments' => $arguments,\n\t\t\t\t\t\t\t\t'delimiter' => $result['delimiter'],\n\t\t\t\t\t\t\t\t'number' => count($current['children'])\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$current = &$current['children'][count($current['children']) - 1];\n\t\t\t\t\t\t} else if (isset($current['tag']) && $result['tag'] == $current['tag']) {\n\t\t\t\t\t\t\t$start = $current['index'] + 1;\n\t\t\t\t\t\t\t$length = $i - $start;\n\t\t\t\t\t\t\t$current['source'] = implode(array_slice($array, $start, $length));\n\t\t\t\t\t\t\t$current = &$current['parent'];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$current['children'][] = array(\n\t\t\t\t\t\t\t'index' => $i,\n\t\t\t\t\t\t\t'parent' => &$current,\n\t\t\t\t\t\t\t'children' => array(),\n\t\t\t\t\t\t\t'raw' => $result['source'],\n\t\t\t\t\t\t\t'tag' => $tag,\n\t\t\t\t\t\t\t'arguments' => $arguments,\n\t\t\t\t\t\t\t'delimiter' => $result['delimiter'],\n\t\t\t\t\t\t\t'number' => count($current['children'])\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$current['children'][] = $node;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $root;\n\t\t}", "function jmap_xmlrpc_ee($parser, $name, $rebuild_xmlrpcvals = true)\n{\n\tif ($GLOBALS['_xh']['isf'] < 2)\n\t{\n\t\t$curr_elem = array_pop($GLOBALS['_xh']['stack']);\n\n\t\tswitch($name)\n\t\t{\n\t\t\tcase 'VALUE':\n\t\t\t\tif ($GLOBALS['_xh']['vt']=='value')\n\t\t\t\t{\n\t\t\t\t\t$GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac'];\n\t\t\t\t\t$GLOBALS['_xh']['vt']=$GLOBALS['xmlrpcString'];\n\t\t\t\t}\n\n\t\t\t\tif ($rebuild_xmlrpcvals)\n\t\t\t\t{\n\t\t\t\t\t$temp = new jmap_xmlrpcval($GLOBALS['_xh']['value'], $GLOBALS['_xh']['vt']);\n\t\t\t\t\tif (isset($GLOBALS['_xh']['php_class']))\n\t\t\t\t\t\t$temp->_php_class = $GLOBALS['_xh']['php_class'];\n\t\t\t\t\t$vscount = count($GLOBALS['_xh']['valuestack']);\n\t\t\t\t\tif ($vscount && $GLOBALS['_xh']['valuestack'][$vscount-1]['type']=='ARRAY')\n\t\t\t\t\t{\n\t\t\t\t\t\t$GLOBALS['_xh']['valuestack'][$vscount-1]['values'][] = $temp;\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$GLOBALS['_xh']['value'] = $temp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (isset($GLOBALS['_xh']['php_class']))\n\t\t\t\t\t{\n\t\t\t\t\t}\n\n\t\t\t\t\t$vscount = count($GLOBALS['_xh']['valuestack']);\n\t\t\t\t\tif ($vscount && $GLOBALS['_xh']['valuestack'][$vscount-1]['type']=='ARRAY')\n\t\t\t\t\t{\n\t\t\t\t\t\t$GLOBALS['_xh']['valuestack'][$vscount-1]['values'][] = $GLOBALS['_xh']['value'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'BOOLEAN':\n\t\t\tcase 'I4':\n\t\t\tcase 'INT':\n\t\t\tcase 'STRING':\n\t\t\tcase 'DOUBLE':\n\t\t\tcase 'DATETIME.ISO8601':\n\t\t\tcase 'BASE' . '64':\n\t\t\t\t$GLOBALS['_xh']['vt']=strtolower($name);\n\t\t\t\tif ($name=='STRING')\n\t\t\t\t{\n\t\t\t\t\t$GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac'];\n\t\t\t\t}\n\t\t\t\telseif ($name=='DATETIME.ISO8601')\n\t\t\t\t{\n\t\t\t\t\t$GLOBALS['_xh']['vt']=$GLOBALS['xmlrpcDateTime'];\n\t\t\t\t\t$GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac'];\n\t\t\t\t}\n\t\t\t\telseif ($name=='BASE' . '64')\n\t\t\t\t{\n\t\t\t\t\t$bas64FunctionNameDecode = 'base'. 64 . '_decode';\n\t\t\t\t\t$GLOBALS['_xh']['value']=$bas64FunctionNameDecode($GLOBALS['_xh']['ac']);\n\t\t\t\t}\n\t\t\t\telseif ($name=='BOOLEAN')\n\t\t\t\t{\n\t\t\t\t\tif ($GLOBALS['_xh']['ac']=='1' || strcasecmp($GLOBALS['_xh']['ac'], 'true') == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$GLOBALS['_xh']['value']=true;\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// log if receiveing something strange, even though we set the value to false anyway\n\t\t\t\t\t\t$GLOBALS['_xh']['value']=false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($name=='DOUBLE')\n\t\t\t\t{\n\t\t\t\t\tif (!preg_match('/^[+-eE0123456789 \\t.]+$/', $GLOBALS['_xh']['ac']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$GLOBALS['_xh']['value']='ERROR_NON_NUMERIC_FOUND';\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$GLOBALS['_xh']['value']=(double)$GLOBALS['_xh']['ac'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (!preg_match('/^[+-]?[0123456789 \\t]+$/', $GLOBALS['_xh']['ac']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$GLOBALS['_xh']['value']='ERROR_NON_NUMERIC_FOUND';\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$GLOBALS['_xh']['value']=(int)$GLOBALS['_xh']['ac'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//$GLOBALS['_xh']['ac']=''; // is this necessary?\n\t\t\t\t$GLOBALS['_xh']['lv']=3; // indicate we've found a value\n\t\t\t\tbreak;\n\t\t\tcase 'NAME':\n\t\t\t\t$GLOBALS['_xh']['valuestack'][count($GLOBALS['_xh']['valuestack'])-1]['name'] = $GLOBALS['_xh']['ac'];\n\t\t\t\tbreak;\n\t\t\tcase 'MEMBER':\n\t\t\t\tif ($GLOBALS['_xh']['vt'])\n\t\t\t\t{\n\t\t\t\t\t$vscount = count($GLOBALS['_xh']['valuestack']);\n\t\t\t\t\t$GLOBALS['_xh']['valuestack'][$vscount-1]['values'][$GLOBALS['_xh']['valuestack'][$vscount-1]['name']] = $GLOBALS['_xh']['value'];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'DATA':\n\t\t\t\t//$GLOBALS['_xh']['ac']=''; // is this necessary?\n\t\t\t\t$GLOBALS['_xh']['vt']=null; // reset this to check for 2 data elements in a row - even if they're empty\n\t\t\t\tbreak;\n\t\t\tcase 'STRUCT':\n\t\t\tcase 'ARRAY':\n\t\t\t\t// fetch out of stack array of values, and promote it to current value\n\t\t\t\t$curr_val = array_pop($GLOBALS['_xh']['valuestack']);\n\t\t\t\t$GLOBALS['_xh']['value'] = $curr_val['values'];\n\t\t\t\t$GLOBALS['_xh']['vt']=strtolower($name);\n\t\t\t\tif (isset($curr_val['php_class']))\n\t\t\t\t{\n\t\t\t\t\t$GLOBALS['_xh']['php_class'] = $curr_val['php_class'];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'PARAM':\n\t\t\t\t// add to array of params the current value,\n\t\t\t\t// unless no VALUE was found\n\t\t\t\tif ($GLOBALS['_xh']['vt'])\n\t\t\t\t{\n\t\t\t\t\t$GLOBALS['_xh']['params'][]=$GLOBALS['_xh']['value'];\n\t\t\t\t\t$GLOBALS['_xh']['pt'][]=$GLOBALS['_xh']['vt'];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'METHODNAME':\n\t\t\t\t$GLOBALS['_xh']['method']=preg_replace('/^[\\n\\r\\t ]+/', '', $GLOBALS['_xh']['ac']);\n\t\t\t\tbreak;\n\t\t\tcase 'NIL':\n\t\t\t\tif ($GLOBALS['xmlrpc_null_extension'])\n\t\t\t\t{\n\t\t\t\t\t$GLOBALS['_xh']['vt']='null';\n\t\t\t\t\t$GLOBALS['_xh']['value']=null;\n\t\t\t\t\t$GLOBALS['_xh']['lv']=3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// drop through intentionally if nil extension not enabled\n\t\t\tcase 'PARAMS':\n\t\t\tcase 'FAULT':\n\t\t\tcase 'METHODCALL':\n\t\t\tcase 'METHORESPONSE':\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "function array_walk_recursive(&$array, callable $callback, $arg = null): void\n{\n error_clear_last();\n if ($arg !== null) {\n $safeResult = \\array_walk_recursive($array, $callback, $arg);\n } else {\n $safeResult = \\array_walk_recursive($array, $callback);\n }\n if ($safeResult === false) {\n throw ArrayException::createFromPhpError();\n }\n}", "function cleanArrayInput($value)\n\t{\n\t\t$returnValue = 0;\n\t\t\n\t\t$tempValue = strip_tags( trim( $value ) ); \n\t\t\n\t\tif ( is_numeric( $tempValue ) )\n\t\t{\n\t\t\t$returnValue = $tempValue; \n\t\t}\n\t\t\n\t\treturn $returnValue;\n }", "protected function prepareValues(array $values) {\n $result = array();\n if (is_array($values) || !empty($values)) {\n foreach ($values as $k => $val) {\n if (is_array($val)) {\n $result[] = $this->prepareValues($val);\n } else {\n $result[] = $this->prepareValue($val);\n }\n }\n }\n return $result;\n }", "function printAll($a){\n foreach ($a as $k => $v) { #para cada elemento del array como clave imprime la clave\n echo $k, '<br>';\n printAllVals($v);\n echo '<br><br>';\n }\n\n}", "public function getValues(): array;", "public function getValues(): array;", "abstract public function values(): Seq;" ]
[ "0.6160349", "0.6029965", "0.59977025", "0.5938872", "0.59384584", "0.5835887", "0.5822228", "0.5759705", "0.57368875", "0.57368875", "0.5660413", "0.5632466", "0.559076", "0.55403626", "0.5529888", "0.5440726", "0.54395217", "0.5429909", "0.54120326", "0.54034454", "0.54012436", "0.54011595", "0.53764224", "0.5366908", "0.53484946", "0.53054625", "0.5295648", "0.52944803", "0.5291544", "0.5281549", "0.526917", "0.5265033", "0.5253442", "0.5225435", "0.5216457", "0.5212149", "0.51845646", "0.516332", "0.51513183", "0.51495534", "0.51428705", "0.51360995", "0.51340395", "0.51309735", "0.51282984", "0.51212734", "0.5098571", "0.50956535", "0.5081384", "0.50568956", "0.5052078", "0.50225383", "0.5007019", "0.5005509", "0.49951753", "0.49933746", "0.49820417", "0.49808007", "0.49754322", "0.49649474", "0.49575314", "0.49407154", "0.493818", "0.4937039", "0.4934042", "0.49307355", "0.49141726", "0.49100134", "0.49092928", "0.4902548", "0.49005565", "0.48926026", "0.48846558", "0.48833132", "0.48824012", "0.4874452", "0.48613814", "0.4857059", "0.48422545", "0.48373502", "0.4836635", "0.4834763", "0.48264733", "0.48240092", "0.4817276", "0.48118398", "0.48096237", "0.4806112", "0.48044628", "0.48030066", "0.4800355", "0.47917542", "0.4789266", "0.47867933", "0.47847384", "0.47837344", "0.47837314", "0.47773746", "0.47773746", "0.47763827" ]
0.6301702
0
Parse inline tables into common table array
private static function parseInlineTable($val) { // Check valid inline table if($val[0] == '{' && substr($val, -1) == '}') { $val = substr($val, 1, -1); } else { throw new Exception('Invalid inline table definition: ' . $val); } $result = new stdClass(); $openString = false; $openLString = false; $openBrackets = 0; $buffer = ''; $strLen = strlen($val); for($i = 0; $i < $strLen; $i++) { // Handle strings if($val[$i] == '"' && $val[$i - 1] != "\\") { $openString = !$openString; } elseif($val[$i] == "'") { $openLString = !$openLString; } elseif($val[$i] == "[" && !$openString && !$openLString) { $openBrackets++; } elseif($val[$i] == "]" && !$openString && !$openLString) { $openBrackets--; } if( $val[$i] == ',' && !$openString && !$openLString && $openBrackets == 0) { // Parse buffer $kv = explode('=', $buffer, 2); $result->{trim($kv[0])} = self::parseValue( trim($kv[1]) ); // Clear buffer $buffer = ''; } else { $buffer .= $val[$i]; } } // Parse last buffer $kv = explode('=', $buffer, 2); $result->{trim($kv[0])} = self::parseValue( trim($kv[1]) ); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _parseTagTable() {}", "abstract public function getTablesArray();", "function flip_tables() {\r\n\t\t$tables_flipped_counter = 0;\r\n\t\t$new_tables_array = array();\r\n\t\t$tables = OM::getAllOStrings($this->code, '<table', '</table>');\r\n\t\t//print('$tables: ');var_dump($tables);exit(0);\r\n\t\tforeach($tables as $table) {\r\n\t\t\t$new_table_array = array();\r\n\t\t\tpreg_match_all('/<(tr)([^<>]*?)>(.*?)<\\/\\1>/is', $table[0], $tr_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t//print('$tr_matches: ');var_dump($tr_matches);exit(0);\r\n\t\t\t$rowspan = 1;\r\n\t\t\t//$debug_counter = 0;\r\n\t\t\tforeach($tr_matches[0] as $index => $value) {\r\n\t\t\t\tpreg_match_all('/<(td|th)([^<>]*?)>(.*?)<\\/\\1>/is', $value[0], $cell_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t\tif($rowspan > 1) {\r\n\t\t\t\t\tforeach($cell_matches[0] as $index2 => $value2) {\r\n\t\t\t\t\t\tpreg_match_all('/rowspan=\"([^\"]*?)\"/is', $value2[0], $rowspan_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t\t\t\tif(sizeof($rowspan_matches[0]) > 0) {\r\n\t\t\t\t\t\t\t$rowspan = (int)$rowspan_matches[1][0][0];\r\n\t\t\t\t\t\t\t//print('$rowspan2: ');var_dump($rowspan);exit(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$new_table_array[$index2 + 1][] = $value2[0];\r\n\t\t\t\t\t} \r\n\t\t\t\t} else {\r\n\t\t\t\t\tforeach($cell_matches[0] as $index2 => $value2) {\r\n\t\t\t\t\t\tpreg_match_all('/rowspan=\"([^\"]*?)\"/is', $value2[0], $rowspan_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t\t\t\tif(sizeof($rowspan_matches[0]) > 0) {\r\n\t\t\t\t\t\t\t//print('$rowspan_matches: ');var_dump($rowspan_matches);exit(0);\r\n\t\t\t\t\t\t\t$rowspan = (int)$rowspan_matches[1][0][0] + 1;\r\n\t\t\t\t\t\t\t//print('$rowspan2: ');var_dump($rowspan);exit(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$new_table_array[$index2][] = $value2[0];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$rowspan--;\r\n\t\t\t\t/*if($debug_counter === 8) {\r\n\t\t\t\t\t//print('$new_table_array: ');var_dump($new_table_array);exit(0);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t$debug_counter++;*/\r\n\t\t\t}\r\n\t\t\t$new_tables_array[] = $new_table_array;\r\n\t\t}\r\n\t\t//print('$new_tables_array: ');var_dump($new_tables_array);exit(0);\r\n\t\t$reversed_tables = array_reverse($tables);\r\n\t\t$counter = sizeof($reversed_tables) - 1;\r\n\t\tforeach($reversed_tables as $table) {\r\n\t\t\t$new_table_code = '<table>\r\n';\r\n\t\t\tforeach($new_tables_array[$counter] as $row => $cells) {\r\n\t\t\t\t$new_table_code .= '<tr>\r\n';\r\n\t\t\t\tforeach($cells as $cell) {\r\n\t\t\t\t\t$cell = str_replace('colspan', 'XXXrow9o9spanXXX', $cell);\r\n\t\t\t\t\t$cell = str_replace('rowspan', 'colspan', $cell);\r\n\t\t\t\t\t$cell = str_replace('XXXrow9o9spanXXX', 'rowspan', $cell);\r\n\t\t\t\t\t$new_table_code .= $cell . '\r\n';\r\n\t\t\t\t}\r\n\t\t\t\t$new_table_code .= '</tr>\r\n';\r\n\t\t\t}\r\n\t\t\t$new_table_code .= '</table>';\r\n\t\t\t$this->code = substr($this->code, 0, $table[1]) . $new_table_code . '<table deleteme=\"y\"' . substr($this->code, $table[1] + 6);\r\n\t\t\t$counter--;\r\n\t\t\t$tables_flipped_counter++;\r\n\t\t}\r\n\t\t\r\n\t\t// fucking DOM...\r\n\t\t/*$query = '//' . ReTidy::get_html_namespace() . 'table';\r\n\t\t$tables = $this->xpath->query($query);\r\n\t\tforeach($tables as $table) {\r\n\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'tr';\r\n\t\t\t$trs = $this->xpath->query($query, $table);\r\n\t\t\t$new_table_array = array();\r\n\t\t\t$record_max_cells_per_row = 0;\r\n\t\t\t$row = 0;\r\n\t\t\tforeach($trs as $tr) {\r\n\t\t\t\t$max_cells_per_row = 0;\r\n\t\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'th | .//' . ReTidy::get_html_namespace() . 'td';\r\n\t\t\t\t$cells = $this->xpath->query($query, $tr);\r\n\t\t\t\t$new_tr_array = array();\r\n\t\t\t\tforeach($cells as $cell) {\r\n\t\t\t\t\t$new_tr_array[] = $cell;\r\n\t\t\t\t\t$max_cells_per_row++;\r\n\t\t\t\t}\r\n\t\t\t\t$new_table_array[$row] = $new_tr_array;\r\n\t\t\t\tif($max_cells_per_row > $record_max_cells_per_row) {\r\n\t\t\t\t\t$record_max_cells_per_row = $max_cells_per_row;\r\n\t\t\t\t}\r\n\t\t\t\t$row++;\r\n\t\t\t}\r\n\t\t\t//var_dump($new_table_array);\r\n\t\t\t//$new_table = new DOMElement('table');\r\n\t\t\t$new_table = $this->dom->createElementNS(self::$xhtmlns, 'table');\r\n\t\t\t$tr_counter = 0;\r\n\t\t\twhile($tr_counter < $record_max_cells_per_row) {\r\n\t\t\t\tprint('here4585687979789<br>');\r\n\t\t\t\t//$new_tr = new DOMElement('tr');\r\n\t\t\t\t$new_tr = $this->dom->createElementNS(self::$xhtmlns, 'tr');\r\n\t\t\t\tforeach($new_table_array as $row => $cells) {\r\n\t\t\t\t\tprint('here4585687979790<br>');\r\n\t\t\t\t\tforeach($cells as $index => $cell) {\r\n\t\t\t\t\t\tprint('here4585687979791<br>');\r\n\t\t\t\t\t\t//if($index === $tr_counter) {\r\n\t\t\t\t\t\t\tprint('here4585687979792<br>');\r\n\t\t\t\t\t\t\t//$clone = $cell->cloneNode(true);\r\n\t\t\t\t\t\t\t$new_tr->appendChild($cell);\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t$new_table->appendChild($new_tr);\r\n\t\t\t\t$tr_counter++;\r\n\t\t\t}\r\n\t\t\t$table->parentNode->appendChild($new_table);\r\n\t\t\t//$table->parentNode->appendChild(new DOMText(\"XXX9o9NewTagEndXXXccc9o9XXX\"));\r\n\t\t\t//$previousElement->appendChild(new DOMText(\"XXX9o9NewTagEndXXXstrong9o9XXX\"));\r\n\t\t\t//$tr_cell->appendChild(new DOMText(ReTidy::DOM_decoded_for_DOM_child_of($element_cell)));\r\n\t\t\t$table->setAttribute('deleteme', 'y');\r\n\t\t\t$tables_flipped_counter++;\r\n\t\t}*/\r\n\t\t$this->logMsgIf('tables flipped', $tables_flipped_counter);\r\n\t\treturn $tables_flipped_counter;\r\n\t}", "function getReferencedTableData($entity)\n{\n $tables = array();\n foreach($entity['fields'] as $f){\n $fk = getFK($entity['tablename'], $f['name']);\n \n $referenced_table = \"\";\n $title_field = \"\";\n $likely_page = \"\";\n // Get the referenced table and the title field to show\n // Now, what can we show? Is there a more useful field for\n // the valuelist than an id or the like? Maybe the title_field\n // of a page? Let's see if we can get one\n if ($fk['page'] == $entity[\"pagename\"]) {\n $page_info = getPageInfo($fk['ref_page']);\n $referenced_table = $page_info['tablename'];\n if (isMultipage($fk['ref_page'])) {\n $title_field = $page_info['title_field'];\n } else {\n $title_field = 'heading';\n }\n $likely_page = $fk['ref_page'];\n } else if ($fk['table'] == $entity['tablename']) {\n $referenced_table = $fk['ref_table'];\n //in principle, _sys_sections could be referenced - that's easy\n if ($referenced_table == '_sys_sections') {\n $title_field = 'heading';\n $likely_page = $fk['ref_page'];\n } else {\n // more likely are multipages\n $pk_field = getPKName($referenced_table);\n $pq = \"SELECT name,title_field FROM _sys_multipages WHERE tablename = '\".$referenced_table.\"'\";\n $result = pp_run_query($pq);\n $row = $result[0];\n if (count($result)>1) {\n $title_field = $pk_field;\n }\n //no chance of a good choice :-(\n else {\n // we have the one page for this table!\n $title_field = $row['title_field'];\n if ($title_field==\"\") {\n $title_field = $pk_field;\n }\n }\n $likely_page = $row['name'];\n }\n }\n if ($referenced_table != \"\") {\n $tables[] = array('fk'=>$fk,'table_name'=>$referenced_table, 'likely_page' => $likely_page , 'title_field' => $title_field);\n }\n }\n return $tables;\n}", "public function getTableOfContents();", "function rec_layout_tables($input) {\r\n\t$c = $ct = $cnt = 0;\r\n\t//preg_match_all('/<table[^>]*width=\"600\"[^>]*>.*?<\\/table>/is', $this->code, $tables);\r\n\tpreg_match_all('/<table[^>]*>.*?<\\/table>/is', $input, $tables);\r\n\tif(preg_match_all('/<table[^>]*>.*?<\\/table>/is', $tables, $tables_for_rec)) {\r\n\t\tforeach($tables_for_rec[0] as $index => $subtable) {\r\n\t\t\t$subtable = rec_layout_tables ($subtable);\r\n\t\t}\r\n\t}\t\t\r\n\tforeach($tables[0] as $index => $table) {\r\n\t\tif (preg_match('/<table[^>]*summary=\"[^\"]*\"[^>]*>/is', $table) || \r\n\t\tpreg_match('/<p[^>]*>(<strong>|).*?Table(au|) [0-9]{1,3}( |):.+?(<\\/strong>|)<\\/p>\\s*<table[^>]*>/is', $table) ||\r\n\t\tpreg_match('/<p[^>]*>(<strong>|).*?<a name=\"tab.+?(<\\/strong>|)<\\/p>\\s*<table[^>]*>/is', $table) ||\r\n\t\tpreg_match('/<p[^>]*>(<strong>|).*?<a id=\"tab.+?(<\\/strong>|)<\\/p>\\s*<table[^>]*>/is', $table)) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t$initial_table = $table;\r\n\t\t/*\r\n\t\t$biggest_width_for_table = \"0\";\r\n\t\t$width_type1 = \"\";\r\n\t\tpreg_match_all('/<tr[^>]>.*?<\\/tr>/is', $table, $trs);\r\n\t\tforeach($trs[0] as $index => $tr) {\r\n\t\t\tpreg_match_all('/<(td|th)[^>]*( width=\"([^\"]*)\")[^>]*>/is', $tr, $cell_widths1);\r\n\t\t\tpreg_match_all('/<(td|th)[^>]*( style=\"width:([^;]*);\")[^>]*>/is', $tr, $cell_widths2);\r\n\t\t\t$biggest_width1 = \"0\";\r\n\t\t\t$width_type1 = \"\";\r\n\t\t\t$biggest_width2 = \"0\";\r\n\t\t\t$width_type2 = \"\";\t\t\t\t\r\n\t\t\tforeach($cell_widths1[3] as $index => $cell_width) {\r\n\t\t\t\tpreg_match('/([0-9]*)([^0-9]*)/is', $cell_width, $width_match);\r\n\t\t\t\t$width_type1 = $width_match[2];\r\n\t\t\t\tif ($width_match[1] > $biggest_width1) {\r\n\t\t\t\t\t$biggest_width1 = $width_match[1];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tforeach($cell_widths2[3] as $index => $cell_width) {\r\n\t\t\t\tpreg_match('/([0-9]*)([^0-9]*)/is', $cell_width, $width_match);\r\n\t\t\t\t$width_type2 = $width_match[2];\r\n\t\t\t\tif ($width_match[1] > $biggest_width2) {\r\n\t\t\t\t\t$biggest_width2 = $width_match[1];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($biggest_width1 != 0) {\r\n\t\t\t\tif ($width_type1 == \"\") {\r\n\t\t\t\t\t$width_type1 = \"px\";\r\n\t\t\t\t}\r\n\t\t\t\t$biggest_width_for_tr = $biggest_width1;\r\n\t\t\t} else {\r\n\t\t\t\tif ($width_type2 == \"\") {\r\n\t\t\t\t\t$width_type2 = \"px\";\r\n\t\t\t\t}\r\n\t\t\t\t$biggest_width_for_tr = $biggest_width2;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$biggest_width_for_tr\t\t\t\r\n\t\t}\r\n\t\t*/\r\n\t\tforeach($this->config['layout_tables'] as $search => $replace) {\r\n\t\t\t$table = preg_replace(\"/\" . $search . \"/is\", $replace, $table, -1, $c);\r\n\t\t\t//$this->logMsgIf(\"layout_tables[\" . htmlentities($search) . \"]\", $c);\r\n\t\t\t//$ct += $c;\r\n\t\t}\r\n\t\t\r\n\t\tpreg_match('/<div style=\"width:100%;\">\\s*<div[^>]* style=\"clear:both;\">\\s*<div([^>]*) style=\"float:left;[^\"]*\">/is', $table, $first_cell_attributes);\r\n\r\n\t\tif (preg_match('/width:([^;]*);/is', $first_cell_attributes[1], $first_cell_width)){\r\n\t\t\t$table = preg_replace(\r\n\t\t\t'/<div([^>]*) style=\"clear:both;\">(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">/is', \r\n\t\t\t'<div$1 style=\"clear:both;\">$2<div$3 style=\"float:left;$4width:' . $first_cell_width[1] . ';\">', \r\n\t\t\t$table);\r\n\t\t}\r\n\t\t\r\n\t\tif(preg_match('/class=\"[^\"]*(width[0-9]{1,3})[^\"]*\"/is', $first_cell_attributes[1], $first_cell_width)) {\r\n\t\t\t$table = preg_replace(\r\n\t\t\t'/<div([^>]*) style=\"clear:both;\">(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">/is', \r\n\t\t\t'<div$1 style=\"clear:both;\">$2<div$3 style=\"float:left;$4\" class=\"' . $first_cell_width[1] . '\">', \r\n\t\t\t$table);\r\n\t\t}\r\n\t\t\r\n\t\tpreg_match('/<div style=\"width:100%;\">\\s*<div[^>]* style=\"clear:both;\">\\s*<div[^>]* style=\"float:left;[^\"]*\"[^>]*>.*?<\\/div>\\s*<div([^>]*) style=\"float:left;[^\"]*\">/is', $table, $second_cell_attributes);\t\t\t\t\t\t\r\n\t\t/*\r\n\t\tif (preg_match('/width:([^;]*);/is', $second_cell_attributes[1], $second_cell_width)){\r\n\t\t\t$table = preg_replace(\r\n\t\t\t'/<div([^>]*) style=\"clear:both;\">(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">(.*?)<\\/div>(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">/is', \r\n\t\t\t'<div$1 style=\"clear:both;\">$2<div$3 style=\"float:left;$4\">$5<\\/div>$6<div$7 style=\"float:left;$8' . $second_cell_width[1] . ';\">', \r\n\t\t\t$table);\r\n\t\t}\t\t\t\r\n\t\t\r\n\t\tif(preg_match('/class=\"[^\"]*(width[0-9]{1,3})[^\"]*\"/is', $second_cell_attributes[1], $second_cell_width)) {\r\n\t\t\t$table = preg_replace(\r\n\t\t\t'/<div([^>]*) style=\"clear:both;\">(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\"([^>]*)>(.*?)<\\/div>(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">/is', \r\n\t\t\t'<div$1 style=\"clear:both;\">$2<div$3 style=\"float:left;$4\"$5>$6<\\/div>$7<div$8 style=\"float:left;$9\" class=\"' . $second_cell_width[1] . '\">', \r\n\t\t\t$table);\r\n\t\t}\t\t\t\r\n\t\t*/\r\n\t\t$this->code = str_replace($initial_table, $table, $this->code, $ct);\r\n\t\t$cnt += $ct;\r\n\t}\r\n\t$this->logMsgIf(\"layout_tables\", $cnt);\r\n\treturn $output;\r\n}", "abstract public function getTables();", "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 getArray($rawhtml, $table_no=1){\n $html = str_get_html(clean_html($rawhtml));\n\n $tables = $html->find('table');\n //$table_no is valid\n if(is_numeric($table_no) && count($tables) >= $table_no){\n //empty existing contents of array\n unset($this->arr);\n $this->arr = array();\n\n $verifier = $table_no - 1;\n $table = $tables[$table_no - 1];\n $table->id = $verifier;\n $trCt = 0;\n //Loop through the rows\n foreach($table->find(\"tr\") as $tr){\n //check if parent table or grandparent table (in case of thead, tbody etc) is same table\n //this is to prevent nested table <tr>'s to be extracted together\n if($tr->parent()->id === $verifier || $tr->parent()->parent()->id === $verifier){\n $tdCt = 0;\n //Loop through the columns\n foreach($tr->find(\"td, th\") as $td){\n //replace all <hr> tags with <br/>\n foreach ($td->find(\"hr\") as $hr){\n $hr->outertext = \"<br/>\";\n }\n $this->arr[$trCt][$tdCt] = trim(strip_tags(preg_replace(\"/\\s+/\", \" \", $td->innertext), \"<br>\"));\n $tdCt++;\n }\n $trCt++;\n }\n }\n } else {\n echo \"Error in table number\";\n }\n return $this->arr;\n }", "function getReferencingTableData($entity)\n{\n $fks = getForeignKeys();\n $tables = array();\n \n foreach($fks as $fk){\n $referencing_table = \"\";\n $title_field = \"\";\n $likely_page = \"\";\n if ($fk['ref_page'] == $entity[\"pagename\"]) {\n $page_info = getPageInfo($fk['page']);\n $referencing_table = $page_info['tablename'];\n if (isMultipage($fk['page'])) {\n $title_field = $page_info['title_field'];\n } else {\n $title_field = 'heading';\n }\n $likely_page = $fk['page'];\n } else if ($fk['ref_table'] == $entity['tablename']) {\n $referencing_table = $fk['table'];\n //in principle, _sys_sections could be referenced - that's easy\n if ($referencing_table == '_sys_sections') {\n $title_field = 'heading';\n $likely_page = $fk['page'];\n } else {\n // more likely are multipages\n $pk_field = getPKName($referencing_table);\n $pq = \"SELECT name, title_field FROM _sys_multipages WHERE tablename = '\".$referencing_table.\"'\";\n $result = pp_run_query($pq);\n $row = $result[0];\n if (count($result)>1) {\n $title_field = $pk_field;\n }\n //no chance of a good choice :-(\n else {\n // we have the one page for this table!\n $title_field = $row['title_field'];\n if ($title_field==\"\") {\n $title_field = $pk_field;\n }\n }\n $likely_page = $row['name'];\n }\n }\n if ($referencing_table != \"\") {\n $tables[] = array('fk'=>$fk,'table_name'=>$referencing_table, 'likely_page' => $likely_page, 'title_field' => $title_field);\n }\n }\n return $tables;\n}", "function getRawData($tableName, $tableHeadArr) {\n $getTableDataSqlQuery = \"SELECT * FROM \" . $tableName;\n $sqlResult = oswQuery($getTableDataSqlQuery);\n $allRows = array();\n while ($oneSqlRow = oci_fetch_array($sqlResult)) {\n $oneRow = array();\n foreach ($tableHeadArr as $oneCol) {\n $oneRow[$oneCol] = $oneSqlRow[$tableHeadArr];\n }\n $allRows[] = $oneRow;\n }\n return $allRows;\n }", "function load_table_data($fields = '') {\n\t$output = array();\n\tif (is_array($this->line_items) && is_array($fields)) {\n\t foreach ($this->line_items as $key => $row) {\n\t\t$row_data = array();\n\t\tforeach ($fields as $idx => $element) {\n\t\t $row_data['r' . $idx] = $this->line_items[$key][$element->fieldname];\n\t\t}\n\t\t$output[] = $row_data;\n\t }\n\t}\n\treturn $output;\n }", "function getTables()\n {\n // Init global variables\n global $types, $classes, $makes;\n // Set each variable to array\n $types = get_types();\n $classes = get_classes();\n $makes = getMakes();\n }", "function tabla02($array01){\n\t$i = '0';\n\t$array02[$i++] = \"<table border=\\\"1\\\">\";\n\tforeach( $array01 as $key => $value){\n\t\tif ( $key == 'id' or $key == 'ID' or $key == 'Id'){\n\t\t\t$array02[$i++] = \"<tr><td>\".$key.\"</td><td>\".$value.\"</td><td> - </td></tr>\\n\";\n\t\t} else{\n\t\t\t$array02[$i++] = \"<tr><td>\".$key.\"</td><td>\".$value.\"</td><td>\".$value.\"</td></tr>\\n\";\n\t\t}\n\t}\n\t$array02[$i++] = \"</table>\";\n\treturn $array02;\n}", "public function getTables();", "public function getTables();", "public function getTables();", "protected function getTcaTables() {}", "public function &getTables();", "function serendipity_parse_sql_tables($filename) {\n $in_table = 0;\n $queries = array();\n\n $fp = fopen($filename, 'r', 1);\n if ($fp) {\n while (!@feof($fp)) {\n $line = trim(fgets($fp, 4096));\n if ($in_table) {\n $def .= $line;\n if (preg_match('/^\\)\\s*(type\\=\\S+|\\{UTF_8\\})?\\s*\\;$/i', $line)) {\n $in_table = 0;\n array_push($queries, $def);\n }\n } else {\n if (preg_match('#^create table \\{PREFIX\\}\\S+\\s*\\(#i', $line)) {\n $in_table = 1;\n $def = $line;\n }\n\n if (preg_match('#^create\\s*(\\{fulltext\\}|unique|\\{fulltext_mysql\\})?\\s*index#i', $line)) {\n array_push($queries, $line);\n }\n }\n }\n fclose($fp);\n }\n\n return $queries;\n}", "function parseData($data, $table, $measure, $isTwoCol, $type)\n\t{\n\t\t// Type 1 is regular data without metric/imperial\n\t\t// Type 2 is irregular key:value data\n\t\t// isTwoCol 0 is 1 column data\n\t\t// isTwoCol 1 is 2 column data, column headers set elsewhere.\n\n\t\tif ($type == 0)\n\t\t{\n\t\t\t$tbl = $data[\"spec\"]->$table->$measure;\n\t\t}\n\t\telse if ($type == 1)\n\t\t{\n\t\t\t$tbl = $data[\"spec\"]->$table->data;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tbl = $data[\"spec\"]->$table;\n\t\t}\n\n\t\tif ($type==2)\n\t\t{\n\t\t\tforeach($tbl as $key => $val)\n\t\t\t{\n\t\t\t\tif( $val != 'NA' )\n\t\t\t\t{\n\t\t\t\t\t$tableData .= '<tr><td class=\"head_cell\">'. $key . '</td><td class=\"data_cell\">'. $val .'</td></tr>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tforeach($tbl as $t){\n\t\t\t\tif( $t->value == 'NA' ) continue;\n\n\t\t\t\tif (!$isTwoCol)\n\t\t\t\t{\n\t\t\t\t\t$tableData .= '<tr><td class=\"head_cell\">'. $t->label . '</td><td class=\"data_cell\">'. $t->value .'</td></tr>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$tableData .= '<tr><td class=\"head_cell_b\">'. $t->label . '</td><td class=\"data_cell_a\">'. $t->valuea .'</td><td class=\"data_cell_b\">'. $t->valueb .'</td></tr>';\n\t\t\t\t}\n\t\t\t}\n\n\t\treturn $tableData;\n\t}", "public function getDataStructure()\n {\n // Get the list of tables\n // The first one is considered the \"main\" one\n $tables = t3lib_div::trimExplode(',', $this->providerData['tables']);\n $mainTable = $tables[0];\n // If an empty structure should be returned, initialize one\n if ($this->hasEmptyOutputStructure) {\n $structure = $this->initEmptyDataStructure($mainTable, tx_tesseract::IDLIST_STRUCTURE_TYPE);\n\n // Otherwise, assemble the structure\n } else {\n $structure = [];\n $uidsPerTable = [];\n $tagsPerItem = [];\n\n // Assemble list of tags\n $manualTags = [];\n // Get manually selected tags\n if (!empty($this->providerData['tags'])) {\n $manualTags = t3lib_div::trimExplode(',', $this->providerData['tags']);\n }\n // Get tags from expressions\n $expressionTags = [];\n if (!empty($this->providerData['tag_expressions'])) {\n $expressionTags = $this->parseExpressionField($this->providerData['tag_expressions']);\n }\n // Assemble final tags array\n $tags = $manualTags;\n if (count($expressionTags) > 0) {\n // Expression tags override manual tags\n if ($this->providerData['tags_override']) {\n $tags = $expressionTags;\n\n // Expression tags and manual tags are merged\n } else {\n $tags = array_merge($manualTags, $expressionTags);\n }\n }\n // Make sure each tag appears only once\n $finalTags = array_unique($tags);\n\n $where = '';\n // Assemble where clause based on selected tags, if any\n if (count($finalTags) > 0) {\n $where = 'uid_local IN (' . implode(',', $finalTags) . ') AND ';\n }\n\n // Add condition on tables\n if (!empty($this->providerData['tables'])) {\n $condition = '';\n foreach ($tables as $aTable) {\n if (!empty($condition)) {\n $condition .= ',';\n }\n $condition .= \"'\" . $aTable . \"'\";\n }\n $where .= 'tablenames IN (' . $condition . ') AND ';\n }\n // NOTE: not sure how tagpack uses/sets these fields\n // Anyway there's no TCA for table tx_tagpack_tags_relations_mm,\n // so the proper API cannot be used\n $where .= \"hidden='0' AND deleted='0'\";\n // Query the tags relations table\n // NOTE: results are sorted by table and by sorting\n // This respects the order in which tags were applied. Maybe this doesn't make sense after all. Could be reviewed at a later stage\n $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_local, uid_foreign, tablenames', 'tx_tagpack_tags_relations_mm', $where, '', 'tablenames ASC, sorting ASC');\n\n // Loop on the results and sort them by table\n while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n if (!isset($uidsPerTable[$row['tablenames']])) {\n $uidsPerTable[$row['tablenames']] = [];\n $tagsPerItem[$row['tablenames']] = [];\n }\n if (!isset($tagsPerItem[$row['tablenames']][$row['uid_foreign']])) {\n $tagsPerItem[$row['tablenames']][$row['uid_foreign']] = [];\n }\n $uidsPerTable[$row['tablenames']][$row['uid_foreign']] = $row['uid_foreign'];\n $tagsPerItem[$row['tablenames']][$row['uid_foreign']][] = $row['uid_local'];\n }\n // If the items should match all tags (\"AND\" logical operator chosen)\n // perform some post-process filtering, because such a condition\n // cannot be expressed simply in the SELECT query\n if ($this->providerData['logical_operator'] === 'AND') {\n foreach ($tagsPerItem as $table => $tableRows) {\n foreach ($tableRows as $uid_foreign => $uid_locals) {\n // Check if all chosen tags are matched by tags found per item\n $rest = array_diff($finalTags, $uid_locals);\n // At least one tag was not matched,\n // remove item from list\n if (count($rest) > 0) {\n unset($uidsPerTable[$table][$uid_foreign]);\n }\n }\n }\n }\n\n // Assemble data structure parts\n $count = 0;\n $uniqueTable = $mainTable;\n $uidList = '';\n $uidListWithTable = '';\n if (count($uidsPerTable) > 0) {\n // Set unique table name, if indeed unique\n if (count($uidsPerTable) === 1) {\n $uniqueTable = key($uidsPerTable);\n $Uids = array_unique($uidsPerTable[$uniqueTable]);\n $uidList = implode(',', $Uids);\n } else {\n $uniqueTable = '';\n $uidList = '';\n }\n // Loop on list of uid's per table and assemble lists of id's prepended with table names\n $prependedUids = [];\n $count = 0;\n foreach ($uidsPerTable as $aTable => $list) {\n $Uids = array_unique($list);\n foreach ($Uids as $id) {\n $prependedUids[] = $aTable . '_' . $id;\n ++$count;\n }\n }\n $uidListWithTable = implode(',', $prependedUids);\n }\n\n // Assemble final structure\n $structure['uniqueTable'] = $uniqueTable;\n $structure['uidList'] = $uidList;\n $structure['uidListWithTable'] = $uidListWithTable;\n $structure['count'] = $count;\n $structure['totalCount'] = $count;\n }\n\n return $structure;\n }", "protected function parseTable(&$template, $matches)\n {\n $tables = [];\n for ($i = 0; $i < count($matches[1]); $i ++) {\n $match = $matches[0][$i];\n $tag = $this->clean($matches[1][$i]);\n if ('TBL:' == substr($tag, 0, 4)) {\n $tags = explode(':', $tag, 3);\n $tables[$tags[1]] = [\n 'start' => $match,\n 'end' => null,\n 'expr' => $tags[2],\n 'content' => null\n ];\n }\n if ('TBLE:' == substr($tag, 0, 5)) {\n $tags = explode(':', $tag, 2);\n if (isset($tables[$tags[1]])) {\n $tables[$tags[1]]['end'] = $match;\n }\n }\n }\n $keys = array_keys($tables);\n for ($i = 0; $i < count($keys); $i ++) {\n if ($tables[$keys[$i]]['start'] && $tables[$keys[$i]]['end']) {\n // find table row begin \\trowd\n if (false !== ($s = strpos($template, $tables[$keys[$i]]['start']))) {\n $s = strrpos(substr($template, 0, $s - 1), '\\trowd ');\n }\n // find table row end \\row followed by \\pard\n if (false !== ($e = strpos($template, $tables[$keys[$i]]['end']))) {\n if (false !== ($e = strpos($template, '\\row ', $e))) {\n $e = strpos($template, '\\pard ', $e);\n }\n }\n if (is_int($s) && is_int($e)) {\n $header = substr($template, 0, $s);\n $content = substr($template, $s, $e - $s);\n $footer = substr($template, $e);\n $content = strtr($content, [\n $tables[$keys[$i]]['start'] => '',\n $tables[$keys[$i]]['end'] => ''\n ]);\n $tables[$keys[$i]]['content'] = $content;\n $template = $header.'%%TBL:'.$keys[$i].'%%'.$footer;\n }\n }\n }\n return $tables;\n }", "function tabla01($array01){\n\t$i = '0';\n\t$array02[$i++] = \"<table id=\\\"one-column-emphasis\\\" >\\n\n <colgroup>\\n\n \t<col class=\\\"oce-first\\\" />\\n\n </colgroup>\\n\n <tbody>\\n\";\n\tforeach( $array01 as $key => $value){\n\t\t$array02[$i++] = \"<tr><td>\".$key.\"</td><td>\".$value.\"</td></tr>\\n\";\n\t}\n\t$array02[$i++] = \"</tbody>\\n</table>\\n\";\n\treturn $array02;\n/*\n<table id=\\\"one-column-emphasis\\\" >\n <colgroup>\n \t<col class=\\\"oce-first\\\" />\n </colgroup>\n <tbody>\n \t<tr>\n \t<td></td>\n </tr>\n </tbody>\n</table>\n*/\n}", "function table_specific_links($table, $template = ''){\n\t\tif(isset($box->template)){\n\t\t\tswitch ($box->template){\n\t\t\t\tcase \"Annotation_Headings\":\n\t\n\t\t\t\t\t// IEA rows\n\t\t\t\t\t$rows = array();\n\t\t\t\t\t$tmp = explode(\"\\n|-\",$table);\n\t\t\t\t\tforeach ($tmp as $row){\n\t\t\t\t\t\tif (strpos($row,\"\\nIEA:\") > 0) $row = \"style='background:#ddffdd;' \".$row;\n\t\t\t\t\t\t$rows[] = $row;\n\t\t\t\t\t}\n\t\t\t\t\t$table = implode(\"\\n|-\",$rows);\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t} # end switch\t\n\t\t}\n\t\treturn $table;\n\t}", "public function getTableLayout()\n {\n return [\n 'headRows' => [0],\n 'table' => ['<table class=\"table table-striped table-hover table-condensed\">', '</table><br/>'],\n '0' => [ // Format für 1. Zeile\n 'tr' => ['<tr class=\"\">', '</tr>'],\n // Format für jede Spalte in der 1. Zeile\n 'defCol' => ['<td>', '</td>'],\n ],\n 'defRow' => [ // Formate für alle Zeilen\n 'tr' => ['<tr class=\"\">', '</tr>'],\n 'defCol' => ['<td>', '</td>'], // Format für jede Spalte in jeder Zeile\n ],\n 'defRowEven' => [ // Formate für alle geraden Zeilen\n 'tr' => ['<tr class=\"\">', '</tr>'],\n // Format für jede Spalte in jeder Zeile\n 'defCol' => ['<td>', '</td>'],\n ],\n ];\n }", "public function tableDataArray($in){\n $out = '';\n foreach($in as $k => $v){\n $out[$k] = '<td>'.$v.'</td>';\n }\n return($out);\n }", "public static function getTables() {\n }", "protected function _parse(){\n\t\tforeach ($this->dataArray['tables']['nat']['default-chains'] as $a => &$b){\n\t\t\t$b['iptables-rules'] = array();\n\t\t\t$this->transformToIPTables($b['rules'], $b['iptables-rules']);\n\t\t}\n\t\t\n\t\t// Now the IP chains...\n\t\tforeach ($this->dataArray['tables']['nat']['ip-chains'] as &$e){\n\t\t\t$e['iptables-rules'] = array();\n\t\t\t$this->transformToIPTables($e['rules'], $e['iptables-rules']);\n\t\t}\n\t\t\n\t\t// And finally, the others...\n\t\tforeach ($this->dataArray['tables']['nat']['other-chains'] as $h => &$i){\n\t\t\t$i['iptables-rules'] = array();\n\t\t\t$this->transformToIPTables($i['rules'], $i['iptables-rules']);\n\t\t}\n\t}", "function fetchTable($src, $rowCSS, $colCSS, $attrList = null) {\n if (is_object($src)) {\n $dom = $src;\n } elseif (is_string($src)) {\n if (is_array(parse_url($src))) {\n $html = scraperWiki::scrape($src);\n } else $html = $src;\n\n $dom = new simple_html_dom();\n $dom->load($html);\n }\n if (empty($attrList))\n $attrList = explode(' ', 'id src href abbr alt background bgcolor checked style target title type value');\n if (is_string($colCSS))\n $colCSS = explode(';', $colCSS);\n\n $tr = array();\n $tableColNr = 0;\n $trNodes = array();\n // first search all row nodes\n foreach($dom->find($rowCSS) as $trNr => $trNode) {\n $trNodes[] = $trNode;\n $tr[$trNr] = array();\n foreach($attrList as $attr) if ($trNode->$attr) $tr[$trNr][\"row_$attr\"] = $trNode->$attr;\n }\n\n // then walk all column queries and find cells\n for($qNr = 0; $qNr < count($colCSS); $qNr++) {\n $queryColNr = 0;\n for($trNr = 0; $trNr < count($trNodes); $trNr++) {\n $tdNodes = $trNodes[$trNr]->find($colCSS[$qNr]);\n if (count($tdNodes) > $queryColNr) $queryColNr = count($tdNodes);\n for($tdNr = 0; $tdNr < count($tdNodes); $tdNr++) {\n $tdNode = &$tdNodes[$tdNr];\n $prefix = $tdNode->tag . ($tableColNr + $tdNr);\n if ($tdNode->plaintext) $tr[$trNr][$prefix] = $tdNode->plaintext;\n if ($tdNode->innertext) $tr[$trNr][$prefix . '_html'] = $tdNode->innertext;\n foreach($attrList as $attr) if ($tdNode->$attr) $tr[$trNr][$prefix . '_' . $attr] = $tdNode->$attr;\n }\n }\n $tableColNr += $queryColNr;\n }\n return $tr;\n}", "function fetchTable($src, $rowCSS, $colCSS, $attrList = null) {\n if (is_object($src)) {\n $dom = $src;\n } elseif (is_string($src)) {\n if (is_array(parse_url($src))) {\n $html = scraperWiki::scrape($src);\n } else $html = $src;\n\n $dom = new simple_html_dom();\n $dom->load($html);\n }\n if (empty($attrList))\n $attrList = explode(' ', 'id src href abbr alt background bgcolor checked style target title type value');\n if (is_string($colCSS))\n $colCSS = explode(';', $colCSS);\n\n $tr = array();\n $tableColNr = 0;\n $trNodes = array();\n // first search all row nodes\n foreach($dom->find($rowCSS) as $trNr => $trNode) {\n $trNodes[] = $trNode;\n $tr[$trNr] = array();\n foreach($attrList as $attr) if ($trNode->$attr) $tr[$trNr][\"row_$attr\"] = $trNode->$attr;\n }\n\n // then walk all column queries and find cells\n for($qNr = 0; $qNr < count($colCSS); $qNr++) {\n $queryColNr = 0;\n for($trNr = 0; $trNr < count($trNodes); $trNr++) {\n $tdNodes = $trNodes[$trNr]->find($colCSS[$qNr]);\n if (count($tdNodes) > $queryColNr) $queryColNr = count($tdNodes);\n for($tdNr = 0; $tdNr < count($tdNodes); $tdNr++) {\n $tdNode = &$tdNodes[$tdNr];\n $prefix = $tdNode->tag . ($tableColNr + $tdNr);\n if ($tdNode->plaintext) $tr[$trNr][$prefix] = $tdNode->plaintext;\n if ($tdNode->innertext) $tr[$trNr][$prefix . '_html'] = $tdNode->innertext;\n foreach($attrList as $attr) if ($tdNode->$attr) $tr[$trNr][$prefix . '_' . $attr] = $tdNode->$attr;\n }\n }\n $tableColNr += $queryColNr;\n }\n return $tr;\n}", "function loadMYSQLArrayIntoTableArray($array_table_def, $data)\n{\n\t//this function breaks the table def up to process individual tables\n\tif (sizeof($data)>0)\n\t{\n\t\tfor ($i=0;$i<sizeof($data);$i++)\n\t\t{\n\t\t\t$array_table_def_with_data[$i] = $array_table_def;\n\t\t\tfor($j=0;$j<sizeof($array_table_def_with_data[$i]);$j++)\n\t\t\t{\n\t\t\t\tif (isset($array_table_def_with_data[$i][$j]['mysql_result_field']) && $array_table_def_with_data[$i][$j]['mysql_result_field'] !='')\n\t\t\t\t{\n\t\t\t\t\t$array_table_def_with_data[$i][$j]['value'] = $data[$i][$array_table_def_with_data[$i][$j]['mysql_result_field']];\n\t\t\t\t}\n\t\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\t$array_table_def_with_data = array();\n\t}\n\treturn $array_table_def_with_data;\n}", "function getTables($selector = '.rptTable')\n\t{\n\t\t$tables = array();\n\t\tif(is_object($this->dom))\n\t\t{\n\t\t\t$contentTables = $this->dom->find($selector);\n\t\t\tforeach ($contentTables as $table)\n\t\t\t{\n\t\t\t\t$tables[] = $table->children();\n\t\t\t}\n\t\t}\n\n\t\treturn $tables ? $tables : array();\n\t}", "abstract protected function loadTableChecks(string $tableName): array;", "function DOM_table_structure($table) {\r\n\t\t//$query = './/' . ReTidy::get_html_namespace() . 'thead';\r\n\t\t$query = './' . ReTidy::get_html_namespace() . 'thead';\r\n\t\t$theads = $this->xpath->query($query, $table);\r\n\t\t$number_theads = 0;\r\n\t\tforeach($theads as $thead) {\r\n\t\t\t$number_theads++;\r\n\t\t}\r\n\t\tif($number_theads > 1) {\r\n\t\t\tprint('Found ' . $number_theads . ' &lt;thead&gt;s, DOM_table_structure() has stopped. Problematic table:<br>' . ReTidy::DOM_getNodeString($table));exit(0);\r\n\t\t}\r\n\t\t//$query = './/' . ReTidy::get_html_namespace() . 'tfoot';\r\n\t\t$query = './' . ReTidy::get_html_namespace() . 'tfoot';\r\n\t\t$tfoots = $this->xpath->query($query, $table);\r\n\t\t$number_tfoots = 0;\r\n\t\tforeach($tfoots as $tfoot) {\r\n\t\t\t$number_tfoots++;\r\n\t\t}\r\n\t\tif($number_tfoots > 1) {\r\n\t\t\tprint('Found ' . $number_tfoots . ' &lt;tfoot&gt;s, DOM_table_structure() has stopped. Problematic table:<br>' . ReTidy::DOM_getNodeString($table));exit(0);\r\n\t\t}\r\n\t\t//$query = './/' . ReTidy::get_html_namespace() . 'tbody';\r\n\t\t$query = './' . ReTidy::get_html_namespace() . 'tbody';\r\n\t\t$tbodys = $this->xpath->query($query, $table);\r\n\t\t$number_tbodys = 0;\r\n\t\tforeach($tbodys as $tbody) {\r\n\t\t\t$number_tbodys++;\r\n\t\t}\r\n\t\t/*if($number_tbodys > 1) {\r\n\t\t\tprint('Found ' . $number_tbodys . ' &lt;tbody&gt;s, DOM_table_structure() has stopped. Problematic table:<br>' . ReTidy::DOM_getNodeString($table));exit(0);\r\n\t\t}*/\r\n\t\tif($this->config['trust_ths'] === false || ($number_theads === 0 && $number_tbodys === 0)) { // assume they are not there and apply them\r\n\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'tr';\r\n\t\t\t$trs = $this->xpath->query($query, $table);\r\n\t\t\t$first_tr = false;\r\n\t\t\t$first_tr_in_tbody = false;\r\n\t\t\t$last_tr = false;\r\n\t\t\t//$found_first_tr_in_tbody = false;\r\n\t\t\t$skipped_first_new_tbody = false;\r\n\t\t\tforeach($trs as $tr) {\r\n\t\t\t\t$second_last_tr = $last_tr;\r\n\t\t\t\t$last_tr = $tr;\r\n\t\t\t\tif($first_tr === false) {\r\n\t\t\t\t\t$first_tr = $tr;\r\n\t\t\t\t}\r\n\t\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'th | .//' . ReTidy::get_html_namespace() . 'td';\r\n\t\t\t\t$cells_in_tr = $this->xpath->query($query, $tr);\r\n\t\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'th | .//' . ReTidy::get_html_namespace() . 'td[@newtag=\"th\"]';\r\n\t\t\t\t$headers_in_tr = $this->xpath->query($query, $tr);\r\n\t\t\t\t//$last_number_cells_in_tr = $number_cells_in_tr;\r\n\t\t\t\tforeach($cells_in_tr as $first_cell_in_tr) { break; }\r\n\t\t\t\t$new_tbody = ReTidy::getAttribute($first_cell_in_tr, 'new_tbody')->nodeValue;\r\n\t\t\t\tif($new_tbody === 'true') {\r\n\t\t\t\t\tif(!$skipped_first_new_tbody) {\r\n\t\t\t\t\t\t$skipped_first_new_tbody = true;\r\n\t\t\t\t\t} else {$first_cell_in_tr_parent = $first_cell_in_tr->parentNode;\r\n\t\t\t\t\t\t$first_cell_in_tr_parent->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagEndXXXtbody9o9XXXXXX9o9NewTagBeginXXXtbody9o9XXX\"), $first_cell_in_tr_parent);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$number_cells_in_tr = 0;\r\n\t\t\t\t$number_empty_cells_in_tr = 0;\r\n\t\t\t\tforeach($cells_in_tr as $cell_in_tr) {\r\n\t\t\t\t\t$number_cells_in_tr++;\r\n\t\t\t\t\tif(ReTidy::isEmptyIgnoringWhitespaceAndAttributes($cell_in_tr)) {\r\n\t\t\t\t\t\t$number_empty_cells_in_tr++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//print('$number_empty_cells_in_tr: ');var_dump($number_empty_cells_in_tr);\r\n\t\t\t\t$number_headers_in_tr = 0;\r\n\t\t\t\tforeach($headers_in_tr as $header_in_tr) {\r\n\t\t\t\t\t$newtag_attribute = ReTidy::getAttribute($header_in_tr, \"newtag\");\r\n\t\t\t\t\tif($newtag_attribute->nodeValue === \"td\") {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$number_headers_in_tr++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(!$first_tr_in_tbody) {\r\n\t\t\t\t\t$number_headers_and_empty_in_tr = $number_headers_in_tr + $number_empty_cells_in_tr;\r\n\t\t\t\t\t//print('$number_cells_in_tr: ');var_dump($number_cells_in_tr);\r\n\t\t\t\t\t//print('$number_headers_in_tr: ');var_dump($number_headers_in_tr);\r\n\t\t\t\t\t//print('$number_headers_and_empty_in_tr: ');var_dump($number_headers_and_empty_in_tr);\r\n\t\t\t\t\t//exit(0);\r\n\t\t\t\t\tif($new_tbody === 'true') {\r\n\t\t\t\t\t\t$last_tr_in_thead = $last_tr;\r\n\t\t\t\t\t\t$first_tr_in_tbody = $tr;\r\n\t\t\t\t\t} elseif($number_headers_and_empty_in_tr === $number_cells_in_tr) {\r\n\t\t\t\t\t\t//$last_tr_in_table_head = $tr;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$last_tr_in_thead = $last_tr;\r\n\t\t\t\t\t\t$first_tr_in_tbody = $tr;\r\n\t\t\t\t\t\t//$found_first_tr_in_tbody = true;\r\n\t\t\t\t\t\t//break;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($number_tfoots === 1) { // then there is a simple solution\r\n\t\t\t\t$first_tr->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagBeginXXXthead9o9XXX\"), $first_tr);\r\n\t\t\t\t$tfoot->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagEndXXXthead9o9XXX\"), $tfoot);\r\n\t\t\t\t$node_after_tfoot = $tfoot->nextSibling;\r\n\t\t\t\t$node_after_tfoot->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagBeginXXXtbody9o9XXX\"), $node_after_tfoot);\r\n\t\t\t\t$first_tr->parentNode->appendChild(new DOMText(\"XXX9o9NewTagEndXXXtbody9o9XXX\"));\r\n\t\t\t} else {\r\n\t\t\t\tif($first_tr_in_tbody === false) {\r\n\t\t\t\t\tReTidy::warning('Applying table structure but how to apply &lt;tbody&gt; to table could not be determined since no content cells were identified');\r\n\t\t\t\t\t$first_tr_in_tbody = $tr;\r\n\t\t\t\t}\r\n\t\t\t\t// tfoot processing\r\n\t\t\t\t// this is not general enough\r\n\t\t\t\t/*$did_table_source = false;\r\n\t\t\t\tif($number_cells_in_tr === 1) { // then we call this table source information\r\n\t\t\t\t\t// clear any existing attributes\r\n\t\t\t\t\tif($cell_in_tr->hasAttributes()) {\r\n\t\t\t\t\t\tforeach($cell_in_tr->attributes as $source_information_cell_attribute) {\r\n\t\t\t\t\t\t\t$source_information_cell_attribute->nodeValue = 'stripme';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$moved_last_tr = $cell_in_tr->cloneNode(true);\r\n\t\t\t\t\t$moved_last_tr->setAttribute('newtag', 'div');\r\n\t\t\t\t\t$moved_last_tr->setAttribute('class', 'source');\r\n\t\t\t\t\t$node_after_table = $table->nextSibling;\r\n\t\t\t\t\t$node_after_table->parentNode->insertBefore($moved_last_tr, $node_after_table);\r\n\t\t\t\t\t$last_tr->setAttribute('deleteme', 'y');\r\n\t\t\t\t\t$did_table_source = true;\r\n\t\t\t\t}\r\n\t\t\t\tif(!$did_table_source) {*/\r\n\t\t\t\t\tif($last_tr === false) { // hack\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'th | .//' . ReTidy::get_html_namespace() . 'td';\r\n\t\t\t\t\t\t$cells_in_potential_tfoot_tr = $this->xpath->query($query, $last_tr);\r\n\t\t\t\t\t\t$adding_a_tfoot = false;\r\n\t\t\t\t\t\tforeach($cells_in_potential_tfoot_tr as $cell_in_potential_tfoot_tr) {\r\n\t\t\t\t\t\t\t$new_tfoot = ReTidy::getAttribute($cell_in_potential_tfoot_tr, 'new_tfoot')->nodeValue;\r\n\t\t\t\t\t\t\tif($new_tfoot === 'true') {\r\n\t\t\t\t\t\t\t\t$adding_a_tfoot = true;\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/*} else {\r\n\t\t\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'th | .//' . ReTidy::get_html_namespace() . 'td';\r\n\t\t\t\t\t$cells_in_potential_tfoot_tr = $this->xpath->query($query, $second_last_tr);\r\n\t\t\t\t\tforeach($cells_in_potential_tfoot_tr as $cell_in_potential_tfoot_tr) {\r\n\t\t\t\t\t\tif(ReTidy::isEmptyIgnoringWhitespaceAndAttributes($cell_in_potential_tfoot_tr)) {\r\n\t\t\t\t\t\t\t// look for the next one\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif(stripos(ReTidy::tagless(ReTidy::DOM_getNodeString($cell_in_potential_tfoot_tr)), 'total') === false) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else { // then we call this the tfoot\r\n\t\t\t\t\t\t\t\t$moved_second_last_tr = $second_last_tr->cloneNode(true);\r\n\t\t\t\t\t\t\t\t$first_tr_in_tbody->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagBeginXXXtfoot9o9XXX\"), $first_tr_in_tbody);\r\n\t\t\t\t\t\t\t\t$first_tr_in_tbody->parentNode->insertBefore($moved_second_last_tr, $first_tr_in_tbody);\r\n\t\t\t\t\t\t\t\t$first_tr_in_tbody->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagEndXXXtfoot9o9XXX\"), $first_tr_in_tbody);\r\n\t\t\t\t\t\t\t\t$second_last_tr->setAttribute('deleteme', 'y');\r\n\t\t\t\t\t\t\t}\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}*/\r\n\t\t\t\t// thead and tbody\r\n\t\t\t\tif($first_tr_in_tbody === $first_tr) {\r\n\t\t\t\t\tReTidy::warning('Applying table structure but how to apply &lt;thead&gt; to table could not be determined');\r\n\t\t\t\t\t$first_tr->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagBeginXXXtbody9o9XXX\"), $first_tr);\r\n\t\t\t\t\t$first_tr->parentNode->appendChild(new DOMText(\"XXX9o9NewTagEndXXXtbody9o9XXX\"));\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$first_tr->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagBeginXXXthead9o9XXX\"), $first_tr);\r\n\t\t\t\t\t//$last_tr_in_thead->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagEndXXXthead9o9XXX\"), $last_tr_in_thead);\r\n\t\t\t\t\t$first_tr_in_tbody->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagEndXXXthead9o9XXX\"), $first_tr_in_tbody);\r\n\t\t\t\t\t$first_tr_in_tbody->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagBeginXXXtbody9o9XXX\"), $first_tr_in_tbody);\r\n\t\t\t\t\t$first_tr->parentNode->appendChild(new DOMText(\"XXX9o9NewTagEndXXXtbody9o9XXX\"));\r\n\t\t\t\t\tif($adding_a_tfoot) {\r\n\t\t\t\t\t\t$moved_last_tr = $last_tr->cloneNode(true);\r\n\t\t\t\t\t\t//$first_tr_in_tbody->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagBeginXXXtfoot9o9XXX\"), $first_tr_in_tbody);\r\n\t\t\t\t\t\t//$first_tr_in_tbody->parentNode->insertBefore($moved_last_tr, $first_tr_in_tbody);\r\n\t\t\t\t\t\t//$first_tr_in_tbody->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagEndXXXtfoot9o9XXX\"), $first_tr_in_tbody);\r\n\t\t\t\t\t\t//$last_tr->setAttribute('deleteme', 'y');\r\n\t\t\t\t\t\t// (2017-03-31) validator now wants <tfoot>s at the bottom of the table for HTML5; shrug, it's a bit easier to code\r\n\t\t\t\t\t\t$last_tr->parentNode->appendChild(new DOMText(\"XXX9o9NewTagBeginXXXtfoot9o9XXX\"));\r\n\t\t\t\t\t\t$last_tr->parentNode->appendChild($moved_last_tr);\r\n\t\t\t\t\t\t$last_tr->parentNode->appendChild(new DOMText(\"XXX9o9NewTagEndXXXtfoot9o9XXX\"));\r\n\t\t\t\t\t\t$last_tr->setAttribute('deleteme', 'y');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t//var_dump(ReTidy::DOM_getNodeString($last_tr_in_thead));\r\n\t\t\t\t\t\tif(isset($last_tr_in_thead)) {\r\n\t\t\t\t\t\t\t//$last_tr_in_thead->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagEndXXXthead9o9XXX\"), $last_tr_in_thead);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$last_tr->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagEndXXXthead9o9XXX\"), $last_tr_in_thead);\r\n\t\t\t\t\t\t\tReTidy::warning('this needs revision... it causes problems when there\\'s no apparent thead and I\\'m not sure it\\'s working perfectly 4e57546767896892478');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t} else { // if we get to here then we work with the table structure in its problematic existing state (which should never happen since we should always redo the thead and tbody; regardless of their states)\r\n\t\t\t//print('here48794586409<br>');\r\n\t\t\tif($number_theads === 1) {\r\n\t\t\t\t//print('here48794586410<br>');\r\n\t\t\t\tif($number_tbodys === 0) {\r\n\t\t\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'tr';\r\n\t\t\t\t\t$trs = $this->xpath->query($query, $table);\r\n\t\t\t\t\t$first_non_thead_tr = false;\r\n\t\t\t\t\t$first_tr = false;\r\n\t\t\t\t\tforeach($trs as $tr) {\r\n\t\t\t\t\t\tif($first_tr === false) {\r\n\t\t\t\t\t\t\t$first_tr = $tr;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//$ancestry_array = ReTidy::DOM_getAncestryArray($tr);\r\n\t\t\t\t\t\t$parentNode = $tr->parentNode;\r\n\t\t\t\t\t\tif($parentNode->nodeName === \"thead\") {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$first_non_thead_tr = $tr;\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\tif($first_non_thead_tr === false) {\r\n\t\t\t\t\t\tReTidy::warning('Applying table structure but how to apply &lt;tbody&gt; to table could not be determined since no content cells were identified 2');\r\n\t\t\t\t\t\t$first_non_thead_tr = $tr;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//if(!ReTidy::isNode($first_non_thead_tr->parentNode)) {\r\n\t\t\t\t\t//\tvar_dump(ReTidy::DOM_getNodeString($first_non_thead_tr));\r\n\t\t\t\t\t//\tvar_dump(ReTidy::DOM_getNodeString($first_non_thead_tr->parentNode));exit(0);\r\n\t\t\t\t\t//}\r\n\t\t\t\t\t$first_non_thead_tr->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagBeginXXXtbody9o9XXX\"), $first_non_thead_tr);\r\n\t\t\t\t\t$tr->parentNode->appendChild(new DOMText(\"XXX9o9NewTagEndXXXtbody9o9XXX\"));\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// no need to do anything\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif($number_tbodys >= 1) {\r\n\t\t\t\t\t//print('here48794586411<br>');\r\n\t\t\t\t\t// here we want to put <thead> around <tr>s before <tbody>; will it ever come up?\r\n\t\t\t\t\tif($number_theads === 0) {\r\n\t\t\t\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'tr';\r\n\t\t\t\t\t\t$trs = $this->xpath->query($query, $table);\r\n\t\t\t\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'tbody/tr';\r\n\t\t\t\t\t\t$trs_in_tbody = $this->xpath->query($query, $table);\r\n\t\t\t\t\t\tif(sizeof($trs) === sizeof($trs_in_tbody)) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tReTidy::warning('Applying table structure but how to apply &lt;thead&gt; to table could not be determined since this code has not been written yet 3');exit(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//print('here48794586412<br>');\r\n\t\t\t\t\tif($number_theads === 0) {\r\n\t\t\t\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'tr';\r\n\t\t\t\t\t\t$trs = $this->xpath->query($query, $table);\r\n\t\t\t\t\t\t$last_non_tbody_tr = false;\r\n\t\t\t\t\t\t$first_tr = false;\r\n\t\t\t\t\t\tforeach($trs as $tr) {\r\n\t\t\t\t\t\t\tif($first_tr === false) {\r\n\t\t\t\t\t\t\t\t$first_tr = $tr;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$parentNode = $tr->parentNode;\r\n\t\t\t\t\t\t\tif($parentNode->nodeName === \"tbody\") {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$last_non_tbody_tr = $tr;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif($first_tr === false) {\r\n\t\t\t\t\t\t\tReTidy::warning('Applying table structure but how to apply &lt;tbody&gt; to table could not be determined since no content cells were identified 4');\r\n\t\t\t\t\t\t\t$first_tr = $tr;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$first_tr->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagBeginXXXtbody9o9XXX\"), $first_tr);\r\n\t\t\t\t\t\t$tbody->parentNode->insertBefore(new DOMText(\"XXX9o9NewTagEndXXXtbody9o9XXX\"), $tbody);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$query = './/@new_tbody';\r\n\t\t$new_tbody_attributes = $this->xpath->query($query, $table);\r\n\t\tforeach($new_tbody_attributes as $new_tbody_attribute) {\r\n\t\t\t$new_tbody_attribute->nodeValue = \"stripme\";\r\n\t\t}\r\n\t\t$query = './/@new_tfoot';\r\n\t\t$new_tfoot_attributes = $this->xpath->query($query, $table);\r\n\t\tforeach($new_tfoot_attributes as $new_tfoot_attribute) {\r\n\t\t\t$new_tfoot_attribute->nodeValue = \"stripme\";\r\n\t\t}\r\n\t\t$query = './/@tfoot_member';\r\n\t\t$tfoot_member_attributes = $this->xpath->query($query, $table);\r\n\t\tforeach($tfoot_member_attributes as $tfoot_member_attribute) {\r\n\t\t\t$tfoot_member_attribute->nodeValue = \"stripme\";\r\n\t\t}\r\n\t}", "abstract public function convertTable($tables);", "private function _readSubTableData() {}", "function get_table_fields($r) {\r\n\t$user_fields=$r->get_elements_by_tagname(\"user-field-get\");\r\n\t$out=array();\r\n\tfor($i=0;$i<count($user_fields);$i++) {\r\n\t\tlist($attr)=$user_fields[$i]->attributes();\r\n\t\t$str=$attr->value();\r\n\t\tlist($table,$fields)=explode(\".\",$str);\r\n\t\tif (array_key_exists($table,$out)) {\r\n\t\t\tif (!in_array($fields,$out[$table])) array_push($out[$table],$fields);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$tmp=array($fields);\r\n\t\t\t$out[$table]=$tmp;\r\n\t\t}\r\n\t}\r\n\treturn $out;\r\n}", "public function getTcaTables() {}", "private function prepareTables() {}", "protected function tableRows()\n {\n $tbody = DB::table($this->argument('table'))->get();\n\n return $tbody->map(function ($field) {\n return $this->selectRowByField($field);\n });\n }", "public function _GetCacheTableInfos()\n {\n $tableInfo = parent::_GetCacheTableInfos();\n $tableInfo[] = array('table' => 'module_image', 'id' => $this->_oTableRow->id);\n\n $this->LoadTableRow();\n $oImages = $this->_oTableRow->GetImages();\n while ($oImage = $oImages->Next()) {\n $tableInfo[] = array('table' => 'cms_media', 'id' => $oImage->id);\n }\n\n return $tableInfo;\n }", "function DOM_clean_table($table) {\r\n\t\t$parentNode = $table->parentNode;\r\n\t\tif($parentNode->nodeName === \"div\" && ReTidy::DOM_isConflationaryWithParentIgnoringWhitespace($table) && !$parentNode->hasAttributes()) {\r\n\t\t\t$parentNode->setAttribute(\"stripme\", \"y\");\r\n\t\t\tReTidy::DOM_strip_node($parentNode);\r\n\t\t}\r\n\t\t\r\n\t\t// empty tables...\r\n\t\tif(ReTidy::isEmptyElement($table)) {\r\n\t\t\t$table->setAttribute(\"stripme\", \"y\");\r\n\t\t\tReTidy::DOM_strip_node($table);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t// tables with only one datum\r\n\t\t$border_attribute = ReTidy::getAttribute($table, \"border\");\r\n\t\t//$blockString = DTD::getBlock();\r\n\t\t//$query = ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'th | ' . ReTidy::get_html_namespace() . 'thead/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'thead/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'th | ' . ReTidy::get_html_namespace() . 'tfoot/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'tfoot/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'th | ' . ReTidy::get_html_namespace() . 'tbody/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'tbody/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'th';\r\n\t\t$query = ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'th | ' . ReTidy::get_html_namespace() . 'thead/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'th | ' . ReTidy::get_html_namespace() . 'tfoot/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'th | ' . ReTidy::get_html_namespace() . 'tbody/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'th | ' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'thead/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'tfoot/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'tbody/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'td';\r\n\t\t$cells = $this->xpath->query($query, $table);\r\n\t\t$count_cells = $count_empty_cells = 0;\r\n\t\t$last_cell_with_content = false;\r\n\t\tforeach($cells as $cell) {\r\n\t\t\t$count_cells++;\r\n\t\t\tif(ReTidy::isEmptyElement($cell)) {\r\n\t\t\t\t$count_empty_cells++;\r\n\t\t\t} else {\r\n\t\t\t\t$last_cell_with_content = $cell;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//if($count_cells - $count_empty_cells < 2 && isset($last_cell_with_content)) {\r\n\t\tif($count_cells - $count_empty_cells < 2) {\r\n\t\t\t/*$table->setAttribute(\"deleteme\", \"y\");\r\n\t\t\t$firstElementChild = ReTidy::getFirstElementChild($last_cell_with_content);\r\n\t\t\t$isConflationaryBlock = false;\r\n\t\t\t// notice that this is not smart enough to catch multiple block elements as the single datum in a table.\r\n\t\t\tif($firstElementChild && ReTidy::DOM_isConflationaryWithParentIgnoringWhitespace($firstElementChild)) {\r\n\t\t\t\tforeach(explode(\"|\", $blockString) as $blockName) {\r\n\t\t\t\t\tif($blockName === $firstElementChild->nodeName) {\r\n\t\t\t\t\t\t$isConflationaryBlock = 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}\r\n\t\t\tif($isConflationaryBlock) {\r\n\t\t\t\t$new_node = $firstElementChild->cloneNode(true);\r\n\t\t\t} else {\r\n\t\t\t\t$last_cell_with_content->setAttribute(\"divme\", \"y\");\r\n\t\t\t\t$new_node = $last_cell_with_content->cloneNode(true);\r\n\t\t\t}*/\r\n\t\t\tif($border_attribute !== false) {\r\n\t\t\t\t//var_dump($border_attribute->nodeValue);\r\n\t\t\t\tif($border_attribute->nodeValue == 0) {\r\n\t\t\t\t\t// do nothing\r\n\t\t\t\t\t//$last_cell_with_content->setAttribute(\"divme\", \"stripme\");\r\n\t\t\t\t\t//$last_cell_with_content->setAttribute(\"stripme\", \"y\");\r\n\t\t\t\t\t//ReTidy::DOM_strip_node($last_cell_with_content);\r\n\t\t\t\t\tReTidy::DOM_strip_one_cell_table($table);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif($last_cell_with_content !== false) {\r\n\t\t\t\t\t\t$last_cell_with_content->setAttribute(\"divme\", \"y\");\r\n\t\t\t\t\t\tReTidy::addStyleWithoutOverwrite($last_cell_with_content, \"border: \" . $border_attribute->nodeValue . \"px solid black;\");\r\n\t\t\t\t\t\tReTidy::DOM_strip_all_but_datum_of_one_datum_table($table, $last_cell_with_content);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tReTidy::DOM_strip_one_cell_table($table);\r\n\t\t\t}\r\n\t\t\t//$table->parentNode->insertBefore($new_node, $table);\r\n\t\t}\r\n\t\t\r\n\t\t// eliminate layout tables (at least the kind that is only one cell with a table in it)\r\n\t\t// seems to be taken care of by the above\r\n\t\t/*$query = ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'th | ' . ReTidy::get_html_namespace() . 'thead/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'thead/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'th | ' . ReTidy::get_html_namespace() . 'tfoot/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'tfoot/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'th | ' . ReTidy::get_html_namespace() . 'tbody/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'tbody/' . ReTidy::get_html_namespace() . 'tr/' . ReTidy::get_html_namespace() . 'th';\r\n\t\t$cells = $this->xpath->query($query, $table);\r\n\t\t$count_cells = 0;\r\n\t\tforeach($cells as $cell) {\r\n\t\t\t$count_cells++;\r\n\t\t}\r\n\t\tif($count_cells === 1) {\r\n\t\t\t$query = '//' . ReTidy::get_html_namespace() . 'table';\r\n\t\t\t$tables_in_single_cell = $this->xpath->query($query, $table);\r\n\t\t\t$count_tables_in_single_cell = 0;\r\n\t\t\tforeach($tables_in_single_cell as $table_in_single_cell) {\r\n\t\t\t\t$count_tables_in_single_cell++;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif($count_tables_in_single_cell > 0) {\r\n\t\t\t\tReTidy::DOM_strip_one_cell_table($table);\r\n\t\t\t}\r\n\t\t}*/\r\n\t\t\r\n\t\t/*\r\n\t\t// take \"captions\" out of tables\r\n\t\t$query = ReTidy::get_html_namespace() . 'thead';\r\n\t\t$theads = $this->xpath->query($query, $table);\r\n\t\tforeach($theads as $thead) {\r\n\t\t\t$query = ReTidy::get_html_namespace() . 'tr[1]';\r\n\t\t\t$first_tr_in_theads = $this->xpath->query($query, $thead);\r\n\t\t\tforeach($first_tr_in_theads as $first_tr_in_thead) {\r\n\t\t\t\t// (there should only be one <thead> and only one first <tr> therein.\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($first_tr_in_thead) {\r\n\t\t\t$first_tr_table = $first_tr_in_thead;\r\n\t\t} else {\r\n\t\t\t$query = ReTidy::get_html_namespace() . 'tr[1]';\r\n\t\t\t$first_tr_tables = $this->xpath->query($query, $table);\r\n\t\t\tforeach($first_tr_tables as $first_tr_table) {\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\t$query = ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'th';\r\n\t\t$cells_in_first_tr = $this->xpath->query($query, $first_tr_table);\r\n\t\tforeach($cells_in_first_tr as $cell_in_first_tr) {\r\n\t\t\t$count429++;\r\n\t\t}\r\n\t\tif(strpos(trim(ReTidy::tagless($first_tr_table)), \"Table\") === 0 && $count429 === 1) {\r\n\t\t\t// then we want to take the caption out of the table\r\n\t\t\tif($thead) {\r\n\t\t\t\t// not sure if this is right since a thead could encompass many rows.\r\n\t\t\t\t//$thead->setAttribute(\"deleteme\", \"y\");\r\n\t\t\t\t// so:\r\n\t\t\t\t//$thead->setAttribute(\"stripme\", \"y\");\r\n\t\t\t\t//ReTidy::DOM_strip_node($thead);\r\n\t\t\t\t// maybe we do not want to do this at all\r\n\t\t\t}\r\n\t\t\tif($this->config['turn_captions_into'] === 'paragraphs') {\r\n\t\t\t\t$new_node = ReTidy::firstElementChild($first_tr_table)->cloneNode(true);\r\n\t\t\t\t$ps_in_new_node = $this->xpath->query('.//' . ReTidy::get_html_namespace() . 'p', $new_node);\r\n\t\t\t\t$number_of_ps = 0;\r\n\t\t\t\tforeach($ps_in_new_node as $index356435 => $value356435) {\r\n\t\t\t\t\tif($index356435 === 0) {\r\n\t\t\t\t\t\t$first_p_in_new_node = $value356435;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$number_of_ps++;\r\n\t\t\t\t}\r\n\t\t\t\tif($number_of_ps > 0) {\r\n\t\t\t\t\tif($number_of_ps === 1) {\r\n\t\t\t\t\t\tif(ReTidy::areConflationaryIgnoringWhiteSpace($new_node, $first_p_in_new_node)) {\r\n\t\t\t\t\t\t\t// it is unlikely but possible to have one paragraph that is not conflationary with the cell.\r\n\t\t\t\t\t\t\t$new_node = $first_p_in_new_node->cloneNode(true);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tprint(\"deal with one non-conflationary paragraph in the cell 43490434<br>\\r\\n\");\r\n\t\t\t\t\t\t\tprint(\"cell: \");var_dump(ReTidy::DOM_getNodeString($new_node));\r\n\t\t\t\t\t\t\texit(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tprint(\"deal with more than one paragraph in a table caption 43490435<br>\\r\\n\");\r\n\t\t\t\t\t\tprint(\"cell: \");var_dump(ReTidy::DOM_getNodeString($new_node));\r\n\t\t\t\t\t\texit(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$new_node->setAttribute('newtag', 'p');\r\n\t\t\t\t}\r\n\t\t\t\t$first_tr_table->setAttribute(\"deleteme\", \"y\");\r\n\t\t\t\tforeach($new_node->attributes as $attribute) {\r\n\t\t\t\t\t$attribute->nodeValue = \"stripme\";\r\n\t\t\t\t}\r\n\t\t\t\t$new_node->insertBefore(new DOMText('XXX9o9NewTagBeginXXXstrong9o9XXX'), $new_node->firstChild);\r\n\t\t\t\t$new_node->appendChild(new DOMText('XXX9o9NewTagEndXXXstrong9o9XXX'));\r\n\t\t\t\t$table->parentNode->insertBefore($new_node, $table);\r\n\t\t\t} elseif($this->config['turn_captions_into'] === 'captions') {\r\n\t\t\t\t$first_tr_table->setAttribute(\"stripme\", \"y\");\r\n\t\t\t\tReTidy::DOM_strip_node($first_tr_table);\r\n\t\t\t\tif($cell_in_first_tr->hasAttributes()) {\r\n\t\t\t\t\tforeach($cell_in_first_tr->attributes as $attribute) {\r\n\t\t\t\t\t\t$attribute->nodeValue = \"stripme\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$cell_in_first_tr->setAttribute('newtag', 'caption');\r\n\t\t\t\t$cell_in_first_tr->setAttribute('style', 'text-align: left;');\r\n\t\t\t\t$cell_in_first_tr->insertBefore(new DOMText(\"XXX9o9NewTagBeginXXXstrong9o9XXX\"), $cell_in_first_tr->firstChild);\r\n\t\t\t\t$cell_in_first_tr->appendChild(new DOMText(\"XXX9o9NewTagEndXXXstrong9o9XXX\"));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t//$previousElement = ReTidy::previousElement($table);\r\n\t\t\t$previousElement = ReTidy::previousElementIgnoringNesting($table);\r\n\t\t\t$tagless = trim(ReTidy::tagless($previousElement));\r\n\t\t\tpreg_match('/Table(au){0,1} [0-9]*:/is', $tagless, $matches45089);\r\n\t\t\tif(strpos($tagless, $matches45089[0]) === 0 && $previousElement->nodeName === \"p\") {\r\n\t\t\t\tif($this->config['turn_captions_into'] === 'captions') {\r\n\t\t\t\t\t$new_node = $previousElement->cloneNode(true);\r\n\t\t\t\t\t$previousElement->setAttribute(\"deleteme\", \"y\");\r\n\t\t\t\t\tif($new_node->hasAttributes()) {\r\n\t\t\t\t\t\tforeach($new_node->attributes as $attribute) {\r\n\t\t\t\t\t\t\t$attribute->nodeValue = \"stripme\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$new_node->setAttribute('newtag', 'caption');\r\n\t\t\t\t\t$new_node->setAttribute('style', 'text-align: left;');\r\n\t\t\t\t\t$new_node->insertBefore(new DOMText(\"XXX9o9NewTagBeginXXXstrong9o9XXX\"), $new_node->firstChild);\r\n\t\t\t\t\t$new_node->appendChild(new DOMText(\"XXX9o9NewTagEndXXXstrong9o9XXX\"));\r\n\t\t\t\t\tif($thead) {\r\n\t\t\t\t\t\t$table->insertBefore($new_node, $thead);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$table->insertBefore($new_node, $first_tr_table);\r\n\t\t\t\t\t}\r\n\t\t\t\t} elseif($this->config['turn_captions_into'] === 'paragraphs') {\r\n\t\t\t\t\t$query = './/' . ReTidy::get_html_namespace() . 'strong';\r\n\t\t\t\t\t$strongs735 = $this->xpath->query($query, $previousElement);\r\n\t\t\t\t\t$found_strong735 = false;\r\n\t\t\t\t\tforeach($strongs735 as $strong735) {\r\n\t\t\t\t\t\t$found_strong735 = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!$found_strong735) {\r\n\t\t\t\t\t\t$previousElement->insertBefore(new DOMText(\"XXX9o9NewTagBeginXXXstrong9o9XXX\"), $previousElement->firstChild);\r\n\t\t\t\t\t\t$previousElement->appendChild(new DOMText(\"XXX9o9NewTagEndXXXstrong9o9XXX\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// take bottom table notes (source information, etc...) out of tables\r\n\t\t// needs work to properly identify only bottom table notes...\r\n\t\t$query = ReTidy::get_html_namespace() . 'tfoot';\r\n\t\t$tfoots = $this->xpath->query($query, $table);\r\n\t\tforeach($tfoots as $tfoot) {\r\n\t\t\t$query = ReTidy::get_html_namespace() . 'tr[last()]';\r\n\t\t\t$first_tr_in_tfoots = $this->xpath->query($query, $tfoot);\r\n\t\t\tforeach($first_tr_in_tfoots as $first_tr_in_tfoot) {\r\n\t\t\t\t// (there should only be one <tfoot> and only one first <tr> therein.\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($first_tr_in_tfoot) {\r\n\t\t\t$last_tr_table = $first_tr_in_tfoot;\r\n\t\t} else {\r\n\t\t\t$query = ReTidy::get_html_namespace() . 'tr[last()]';\r\n\t\t\t$last_tr_tables = $this->xpath->query($query, $table);\r\n\t\t\tforeach($last_tr_tables as $last_tr_table) { }\r\n\t\t}\r\n\t\t$query = ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'th';\r\n\t\t$cells_in_last_tr = $this->xpath->query($query, $last_tr_table);\r\n\t\t$count430 = 0;\r\n\t\tforeach($cells_in_last_tr as $cell_in_last_tr) {\r\n\t\t\t$count430++;\r\n\t\t}\r\n\t\t$tagless = ReTidy::tagless($cell_in_last_tr);\r\n\t\tif($count430 === 1 && (stripos(trim($tagless), \"source\") === 0 || ReTidy::hasABulletForThePurposesOfTableSourceInformation(trim($tagless)))) {\r\n\t\t\t// then we want to take the table notes out of the table\r\n\t\t\t$last_tr_table->setAttribute(\"deleteme\", \"y\");\r\n\t\t\t$new_node = ReTidy::lastElementChild($last_tr_table)->cloneNode(true);\r\n\t\t\tforeach($new_node->attributes as $attribute) {\r\n\t\t\t\t$attribute->nodeValue = \"stripme\";\r\n\t\t\t}\r\n\t\t\t$new_node->setAttribute('newtag', 'div');\r\n\t\t\tif($this->config['table_note_size'] == '80percent') {\r\n\t\t\t\t//$new_node->setAttribute('class', 'fontSize80');\r\n\t\t\t\t// the file is not necessarily CLF2\r\n\t\t\t\t$new_node->setAttribute('style', 'font-size: 80%;');\r\n\t\t\t}\r\n\t\t\t//if($border_attribute !== false) { // ???\r\n\t\t\t//\tif($border_attribute->nodeValue === 0) {\r\n\t\t\t//\t\t// do nothing\r\n\t\t\t//\t} else {\r\n\t\t\t//\t\tReTidy::addStyleWithoutOverwrite($new_node, \"border: \" . $border_attribute->nodeValue . \"px solid black;\");\r\n\t\t\t//\t}\r\n\t\t\t//}\r\n\t\t\t$table->parentNode->insertBefore($new_node, $table->nextSibling);\r\n\t\t}\r\n\t\t*/\r\n\t\t$query = './/' . ReTidy::get_html_namespace() . 'tr';\r\n\t\t$trs = $this->xpath->query($query, $table);\r\n\t\t// another case that we would want to merge in: when for some number of columns; in each row out of these columns,\r\n\t\t// there is only content in one of the cells... not necessarily; empty cells could be considered data.\r\n\t\t/*\r\n\t\t\r\n\t\t// merge cells\r\n\t\t// check if this table is a difficult one that we want to avoid\r\n\t\t$proceed_with_merging = true;\r\n\t\tforeach($trs as $tr) {\r\n\t\t\t$query = ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'th';\r\n\t\t\t$cells = $this->xpath->query($query, $tr);\r\n\t\t\t$count_cells_in_row = 0;\r\n\t\t\tforeach($cells as $cell) {\r\n\t\t\t\t$colspan_amount = ReTidy::getColspan($cell);\r\n\t\t\t\twhile($colspan_amount > 1) {\r\n\t\t\t\t\t$colspan_amount--;\r\n\t\t\t\t\t$count_cells_in_row++;\r\n\t\t\t\t}\r\n\t\t\t\t$count_cells_in_row++;\r\n\t\t\t}\r\n\t\t\tif($count_cells_in_row !== $this->table_width) {\r\n\t\t\t\t$proceed_with_merging = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($proceed_with_merging) {\r\n\t\t\tforeach($trs as $tr) {\r\n\t\t\t\t// merge cells containing text that belongs in the same cell:\r\n\t\t\t\t// criteria for determining if cells should be joined:\r\n\t\t\t\t\t// * the text content of cells in a column that should be joined is of about the same length \r\n\t\t\t\t\t// (because a new cell exists where the text should simply wrap)?\r\n\t\t\t\t\t// * merging should begin at a row that has content in every cell?\r\n\t\t\t\t\t// * merging should end at the row before one where it could begin or at the end of the table\r\n\t\t\t\t\r\n\t\t\t\t// to simplify matters, we choose in rows without any rowspan or colspan\r\n\t\t\t\t// although we may want to consider rowspan later (because of the case where \"one part of a column\r\n\t\t\t\t// that should be joined is already joined\")\r\n\t\t\t\t$query = ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'th';\r\n\t\t\t\t$tr_cells = $cells = $this->xpath->query($query, $tr);\r\n\t\t\t\t$number_cells_in_row = 0;\r\n\t\t\t\tforeach($cells as $cell) {\r\n\t\t\t\t\t$number_cells_in_row++;\r\n\t\t\t\t}\r\n\t\t\t\tif($number_cells_in_row === $this->table_width) {\r\n\t\t\t\t\t$cells_in_this_row_have_content = true;\r\n\t\t\t\t\tforeach($cells as $cell) {\r\n\t\t\t\t\t\tif(ReTidy::isEmptyTag($cell)) {\r\n\t\t\t\t\t\t\t$cells_in_this_row_have_content = false;\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\tif($cells_in_this_row_have_content) {\r\n\t\t\t\t\t\t// then this is a candidate for merging so check the criteria\r\n\t\t\t\t\t\t// check if the text content in the cells is about the same length:\r\n\t\t\t\t\t\t// check if the cells look like they should be merged to a similar row or the end of the table:\r\n\t\t\t\t\t\t$nextElement = $tr;\r\n\t\t\t\t\t\twhile($nextElement = ReTidy::nextElement($nextElement)) {\r\n\t\t\t\t\t\t\t$query = ReTidy::get_html_namespace() . 'td | ' . ReTidy::get_html_namespace() . 'th';\r\n\t\t\t\t\t\t\t$cells4 = $this->xpath->query($query, $nextElement);\r\n\t\t\t\t\t\t\t$number_cells_in_row4 = 0;\r\n\t\t\t\t\t\t\tforeach($cells4 as $cell4) {\r\n\t\t\t\t\t\t\t\t$number_cells_in_row4++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif($number_cells_in_row4 === $this->table_width) {\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$cells_in_this_row_have_content4 = true;\r\n\t\t\t\t\t\t\t\tforeach($cells4 as $cell4) {\r\n\t\t\t\t\t\t\t\t\tif(ReTidy::isEmptyTag($cell4)) {\r\n\t\t\t\t\t\t\t\t\t\t$cells_in_this_row_have_content4 = false;\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\tif($cells_in_this_row_have_content4) {\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$element_cell_count = 0;\r\n\t\t\t\t\t\t\t\tforeach($cells4 as $element_cell) {\r\n\t\t\t\t\t\t\t\t\t$element_cell_count++;\r\n\t\t\t\t\t\t\t\t\t$tr_cell_count = 0;\r\n\t\t\t\t\t\t\t\t\tforeach($tr_cells as $tr_cell) {\r\n\t\t\t\t\t\t\t\t\t\t$tr_cell_count++;\r\n\t\t\t\t\t\t\t\t\t\tif($tr_cell_count === $element_cell_count) {\r\n\t\t\t\t\t\t\t\t\t\t\t//print(\"tr_cell\" . htmlentities(ReTidy::DOM_getNodeString($tr_cell)) . \"<br>\\r\\n\");\r\n\t\t\t\t\t\t\t\t\t\t\tif($element_cell->hasChildNodes()) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(!ReTidy::isEmptyTag($element_cell)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t//$tr_cell->nodeValue = ReTidy::decode_for_DOM($tr_cell->nodeValue) . \" \";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tr_cell->nodeValue .= \" \";\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tr_cell->appendChild(new DOMText(ReTidy::DOM_decoded_for_DOM_child_of($element_cell)));\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t$element_cell->nodeValue = \"\";\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\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$element_cell->parentNode->setAttribute(\"deleteme\", \"y\");\r\n\t\t\t\t\t\t\t} else {\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}\r\n\t\t\t}\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\t// (2011-10-26) we are doing very little table cleaning by now, due simply to the variety of ways <table>s may be misused (or possibly my lack of DOM coding skills)\r\n\t\t/*\r\n\t\t// eliminate empty rows then reduce rowspan on previous (along their column) cells\r\n\t\tforeach($trs as $tr) {\r\n\t\t\tif(ReTidy::isSpace(ReTidy::tagless($tr))) {\r\n\t\t\t\t$tr->setAttribute(\"deleteme\", \"y\");\r\n\t\t\t\t//if($tr->hasChildNodes()) {\r\n\t\t\t\t//\tforeach($tr->childNodes as $child) {\r\n\t\t\t\t//\t\tif($child->nodeType === 1) {\r\n\t\t\t\t//\t\t\t$child->setAttribute(\"deleteme\", \"y\");\r\n\t\t\t\t//\t\t}\r\n\t\t\t\t//\t}\r\n\t\t\t\t//}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tReTidy::DOM_build_table_grid($table);\r\n\t\t$mirrored_array = ReTidy::array_mirror($this->table_grid);\r\n\t\tforeach($mirrored_array as $index => $row) {\r\n\t\t\t$empty_row = true;\r\n\t\t\tforeach($row as $index2 => $value2) {\r\n\t\t\t\t$cell = $value2[0];\r\n\t\t\t\t//if(ReTidy::isEmpty($cell)) {\r\n\t\t\t\tif(ReTidy::isSpace(ReTidy::tagless($cell))) {\r\n\t\t\t\t\t//$last_non_spanning_cell = $cell;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$rowspan = ReTidy::getRowspan($cell);\r\n\t\t\t\tif($rowspan > 1 && $mirrored_array[$index-1][$index2][0] === $cell) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$empty_row = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif($empty_row) {\r\n\t\t\t\t//$tr = $last_non_spanning_cell->parentNode;\r\n\t\t\t\t//$tr->setAttribute(\"deleteme\", \"y\");\r\n\t\t\t\tforeach($row as $index2 => $value2) {\r\n\t\t\t\t\t$cell = $value2[0];\r\n\t\t\t\t\t$rowspan = ReTidy::getRowspan($cell);\r\n\t\t\t\t\tif($rowspan > 1) {\r\n\t\t\t\t\t\t$rowspan--;\r\n\t\t\t\t\t\tif($rowspan === 1) {\r\n\t\t\t\t\t\t\t$cell->setAttribute('rowspan', 'stripme');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cell->setAttribute('rowspan', $rowspan);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$cell->setAttribute(\"deleteme\", \"y\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// eliminate empty columns then reduce colspan on previous sibling cells\r\n\t\tReTidy::DOM_build_table_grid($table);\r\n\t\tforeach($this->table_grid as $index => $column) {\r\n\t\t\t$empty_column = true;\r\n\t\t\tforeach($column as $index2 => $value2) {\r\n\t\t\t\t$cell = $value2[0];\r\n\t\t\t\t//if(ReTidy::isEmpty($cell)) {\r\n\t\t\t\tif(ReTidy::isSpace(ReTidy::tagless($cell))) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$colspan = ReTidy::getColspan($cell);\r\n\t\t\t\tif($colspan > 1 && $this->table_grid[$index-1][$index2][0] === $cell) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$empty_column = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif($empty_column) {\r\n\t\t\t\tforeach($column as $index2 => $value2) {\r\n\t\t\t\t\t$cell = $value2[0];\r\n\t\t\t\t\t$colspan = ReTidy::getColspan($cell);\r\n\t\t\t\t\tif($colspan > 1) {\r\n\t\t\t\t\t\t$colspan--;\r\n\t\t\t\t\t\tif($colspan === 1) {\r\n\t\t\t\t\t\t\t$cell->setAttribute('colspan', 'stripme');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cell->setAttribute('colspan', $colspan);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t//var_dump(ReTidy::DOM_getNodeString($cell));print(\"<br>\\r\\n\");\r\n\t\t\t\t\t\t$cell->setAttribute(\"deleteme\", \"y\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t*/\r\n\t\t\r\n\r\n\t\tReTidy::DOM_empty_ths($table);\r\n\t\t/*\r\n\t\t// remove unnecessary <tbody>\r\n\t\t//$query = ReTidy::get_html_namespace() . 'tbody';\r\n\t\t//$tbodys = $this->xpath->query($query, $table);\r\n\t\t//foreach($tbodys as $tbody) {\r\n\t\t//\tif(ReTidy::DOM_isConflationaryWithParentIgnoringWhitespace($tbody)) {\r\n\t\t//\t\t$tbody->setAttribute(\"stripme\", \"y\");\r\n\t\t//\t\tReTidy::DOM_strip_node($tbody);\r\n\t\t//\t}\r\n\t\t//}\r\n\t\t// remove empty <thead>, <tbody>, <tfoot>? no.\r\n\t\t\r\n\t\t// cell splitting\r\n\t\t// it seems to be a rare case where the program will be able to determine when cells should be split\r\n\t\t// in other words; to determine when a putative datum cell is really many data\r\n\t\t// disabled 2011-09-09\r\n\t\tforeach($trs as $tr) {\r\n\t\t\t$array_cells_to_split = array();\r\n\t\t\t$saved_p_count = 0;\r\n\t\t\t$count_cells_with_large_number_of_ps = 0;\r\n\t\t\t$cells = $this->xpath->query('.//' . ReTidy::get_html_namespace() . 'td | .//' . ReTidy::get_html_namespace() . 'th', $tr);\r\n\t\t\tforeach($cells as $cell) {\r\n\t\t\t\t$p_in_cells = $this->xpath->query('.//' . ReTidy::get_html_namespace() . 'p', $cell);\r\n\t\t\t\t$count_ps_for_this_cell = 0;\r\n\t\t\t\tforeach($p_in_cells as $p_in_cell) {\r\n\t\t\t\t\t$count_ps_for_this_cell++;\r\n\t\t\t\t}\r\n\t\t\t\tif($count_ps_for_this_cell > 4) {\r\n\t\t\t\t\tif($saved_p_count < $count_ps_for_this_cell) {\r\n\t\t\t\t\t\t$saved_p_count = $count_ps_for_this_cell;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$array_cells_to_split[] = $cell;\r\n\t\t\t\t\t$count_cells_with_large_number_of_ps++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($count_cells_with_large_number_of_ps > 2) { // then do the splitting\r\n\t\t\t\tReTidy::splitCells($array_cells_to_split, $saved_p_count, 'row', $table);\r\n\t\t\t}\r\n\t\t}*/\r\n\t\treturn true;\r\n\t}", "public function retrieveAbleTables(): array\n {\n $tables = [];\n\n // iterate on every table\n foreach (DbalService::getTablesColumnsMap() as $table => $columns) {\n\n if ($table == $this->internalTable) {\n continue;\n }\n\n foreach ($columns as $columnName => $column) {\n // if the table has one or both columns,\n if (in_array($columnName, [$this->createdAtColumnName, $this->updatedAtColumnName])) {\n $tables[] = $table;\n break;\n }\n }\n\n }\n\n return $tables;\n }", "function table($text) {\n\t\t$output = \"\";\n\t\tif (!empty($text)) {\n\t\t\t$output .= '<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"100%\">';\n\t\t\t$array = explode(\"\\n\", $text);\n\t\t\tfor ($i=0; $i<count($array); $i++) {\n\t\t\t\tif (!empty($array[$i])) {\n\t\t\t\t\t$row = explode(\":\", $array[$i], 2);\n\t\t\t\t\t$title = isset($row[0]) ? $row[0] : '';\n\t\t\t\t\t$data = isset($row[1]) ? $row[1] : '';\n\t\t\t\t\tif ($i%2 == 0) {\n\t\t\t\t\t\t$output .= '<tr class=\"row_ab_a\"><td class=\"form_title\" width=\"30%\">'.$title.'</td><td bgcolor=\"#EBF1F6\" width=\"70%\">'.$data.'</td></tr>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$output .= '<tr class=\"row_ab_b\"><td class=\"form_title\">'.$title.'</td><td bgcolor=\"#FFFFFF\">'.$data.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$output .= '</table>';\n\t\t}\n\n\t\treturn $output;\n\t}", "public function importTables(array $tableArray)\n {\n $tables=array();\n foreach ($tableArray as $name => $tabledef) {\n //echo '<h2>Table: ' . $name . '</h2>';\n //Debug::dump($tabledef);\n $tableName = $this->xPrefix . $name;\n $columns = array();\n $indexes = array();\n $fkConstraints = array();\n $options = array();\n $idGeneratorType = 0;\n foreach ($tabledef['columns'] as $colName => $colOptions) {\n $colType = \\Doctrine\\DBAL\\Types\\Type::getType($colOptions['type']);\n unset($colOptions['type']);\n $columns[] = new Column($colName, $colType, $colOptions);\n }\n\n if (isset($tabledef['indexes'])) {\n foreach ($tabledef['indexes'] as $indexName => $indexDef) {\n $indexes[] = new Index(\n $indexName,\n $indexDef['columns'],\n $indexDef['unique'],\n $indexDef['primary']\n );\n }\n }\n\n if (isset($tabledef['constraint'])) {\n foreach ($tabledef['constraint'] as $constraintDef) {\n $fkConstraints[] = new ForeignKeyConstraint(\n $constraintDef['localcolumns'],\n $constraintDef['foreigntable'],\n $constraintDef['foreigncolumns'],\n $constraintDef['name'] = null,\n $constraintDef['options']\n );\n }\n }\n\n\t\t\tif (isset($tabledef['options']))\n\t\t\t\t$options = $tabledef['options'];\n $tables[] = new Table(\n $tableName,\n $columns,\n $indexes,\n $fkConstraints,\n $idGeneratorType,\n $options\n );\n }\n return $tables;\n }", "function create_tables_with_attributes($array, $tables, $old = \"\")\n{\n\tforeach($array as $key => $value)\n\t{\n\t\tif(is_string($key)) // if key is string, so leads to object (single table)\n\t\t{\n\t\t\t$key = mb_strtolower($key, 'UTF-8');\n\t\t\tif(is_array($value)) // array of values means there is more sub attributes under it\n\t\t\t{\n\t\t\t\tif($key == \"@attributes\")\n\t\t\t\t\tset_attributes_data_types($tables[$old][\"attributes\"], $value);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!array_key_exists($key, $tables))\n\t\t\t\t\t\t$tables[$key] = array(\"attributes\" => array(), \"keys\" => array()); //create new empty substance of array\n\n\t\t\t\t\t$old = $key; // set odl key\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if($key == \"@value\") // key is value so it represents value of the table\n\t\t\t\tset_value_type($tables[$old][\"value\"], $value, $old); // get data type of that value\n\t\t}\n\n\t\tif(is_array($value)) //if value is array (there are more sub tables) there is a need to call creating again...\n\t\t\t$tables = create_tables_with_attributes($value, $tables, $old);\n\t}\n\n\treturn $tables;\n}", "public function table_get_all($table);", "protected function getCleanableTableList() {}", "protected function analyzeExtensionTables() {}", "private function parseTable( SimpleXMLElement $table )\n {\n $fields = array();\n $indexes = array();\n\n foreach ( $table->declaration->field as $field )\n {\n $fieldName = (string) $field->name;\n $fields[$fieldName] = $this->parseField( $field ); \n }\n\n foreach ( $table->declaration->index as $index )\n {\n $indexName = (string) $index->name;\n $indexes[$indexName] = $this->parseIndex( $index );\n }\n\n return ezcDbSchema::createNewTable( $fields, $indexes );\n }", "function ciniki_tenants_reportChunkTable($ciniki, $tnid, &$report, $chunk) {\n\n if( isset($chunk['textlist']) && $chunk['textlist'] != '' ) {\n $report['text'] .= $chunk['textlist'];\n }\n\n $html = '<table cellpadding=\"5\">';\n $html .= \"<thead><tr>\";\n $pdfhtml = '<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" style=\"border: 0.1px solid #aaa;\">';\n $pdfhtml .= \"<thead><tr>\";\n foreach($chunk['columns'] as $col) {\n $html .= \"<th>\" . $col['label'] . \"</th>\";\n $pdfhtml .= '<th bgcolor=\"#dddddd\" style=\"border: 0.1px solid #aaa;' \n . (isset($col['pdfwidth']) ? 'width:' . $col['pdfwidth'] : '') . '\">' . $col['label'] . \"</th>\";\n }\n $html .= \"</tr></thead>\";\n $html .= \"<tbody>\";\n $pdfhtml .= \"</tr></thead>\";\n $pdfhtml .= \"<tbody>\";\n\n foreach($chunk['data'] as $row) {\n $html .= \"<tr>\";\n $pdfhtml .= '<tr nobr=\"true\">';\n foreach($chunk['columns'] as $col) {\n $html .= '<td style=\"border: 1px solid #aaa; padding: 5px;\">';\n $pdfhtml .= '<td style=\"border: 0.1px solid #aaa;' . (isset($col['pdfwidth']) ? 'width:' . $col['pdfwidth'] : '') . '\">' ;\n if( isset($row[$col['field']]) ) {\n $html .= preg_replace(\"/\\n/\", \"<br/>\", $row[$col['field']]);\n $pdfhtml .= preg_replace(\"/\\n/\", \"<br/>\", $row[$col['field']]);\n }\n $html .= \"</td>\";\n $pdfhtml .= \"</td>\";\n }\n $html .= \"</tr>\";\n $pdfhtml .= \"</tr>\";\n }\n $html .= \"</tbody>\";\n $html .= \"</table>\";\n $pdfhtml .= \"</tbody>\";\n $pdfhtml .= \"</table>\";\n\n $report['html'] .= $html;\n\n\n $report['pdf']->addHtml(1, $pdfhtml);\n\n return array('stat'=>'ok');\n}", "public function parseHtml($html)\n {\n // So as a quick fix, we'll str_replace those ahead of time\n // and then keep the Xpath parser consistent.\n $html = str_replace(\n [\n '<td>Vendor:</td>',\n '<td>Reference Number:</td>',\n '<td>Contract Date:</td>',\n '<td>Description of Work:</td>',\n '<td>Contract Period :</td>',\n '<td>Contract Period:</td>',\n '<td>Delivery Date:</td>',\n '<td>Contract Value:</td>',\n '<td>Comments:</td>',\n // Fixes for eg.\n // https://www.statcan.gc.ca/eng/about/contract/2004/62700-04-0035\n '<th class=\"row-stub\" scope=\"row\">Nom du vendeur:</th>',\n '<th class=\"row-stub\" scope=\"row\">Numéro de référence :</th>',\n '<th class=\"row-stub\" scope=\"row\">Description&nbsp;of&nbsp;Work:</th>',\n ],\n [\n '<th scope=\"row\">Vendor:</th>',\n '<th scope=\"row\">Reference Number:</th>',\n '<th scope=\"row\">Contract Date:</th>',\n '<th scope=\"row\">Description of Work:</th>',\n '<th scope=\"row\">Contract Period :</th>',\n '<th scope=\"row\">Contract Period :</th>',\n '<th scope=\"row\">Delivery Date:</th>',\n '<th scope=\"row\">Contract Value:</th>',\n '<th scope=\"row\">Comments:</th>',\n // Replacements per above\n '<th scope=\"row\">Vendor:</th>',\n '<th scope=\"row\">Reference Number:</th>',\n '<th scope=\"row\">Description of Work:</th>',\n\n ],\n $html\n );\n\n $keyArray = [\n 'vendorName' => 'Vendor',\n 'referenceNumber' => 'Reference Number',\n 'contractDate' => 'Contract Date',\n 'description' => 'Description of work',\n 'extraDescription' => 'Detailed Description',\n 'contractPeriodStart' => '',\n 'contractPeriodEnd' => '',\n 'contractPeriodRange' => 'Contract Period',\n 'deliveryDate' => 'Delivery Date',\n 'originalValue' => 'Original Contract Value',\n 'contractValue' => 'Contract Value',\n 'comments' => 'Comments',\n ];\n\n return Parsers::extractContractDataViaGenericXpathParser($html, \"//table//th[@scope='row']\", \"//table//td\", ' to ', $keyArray);\n }", "function parse_tablumps($data) {\n\n\t$data = str_replace(dAmnPHP::$tablumps['a1'], dAmnPHP::$tablumps['a2'], $data);\n\t$data = preg_replace(dAmnPHP::$tablumps['b1'], dAmnPHP::$tablumps['b2'], $data);\n\treturn preg_replace(\"/<([^>]+) (width|height|title|alt)=\\\"\\\"([^>]*?)>/\", \"<\\\\1\\\\3>\", $data);\n\n}", "protected function _readTable() {}", "protected function _readTable() {}", "public function _GetCacheTableInfos()\n {\n $aTableInfo = parent::_GetCacheTableInfos();\n $activePage = $this->getActivePageService()->getActivePage();\n $aTableInfo[] = array('table' => 'cms_tpl_page', 'id' => $activePage->id);\n $aTableInfo[] = array('table' => 'cms_portal', 'id' => '');\n $aTableInfo[] = array('table' => 'cms_division', 'id' => '');\n\n return $aTableInfo;\n }", "function tabla03($array01){\n\t$i = '0';\n\t$array02[$i++] = \"<table border=\\\"0\\\">\";\n\tforeach( $array01 as $value ){\n\t\tforeach( $value as $key => $value){\n\t\t\t$array02[$i++] = \"<tr><td>\".$key.\"</td><td>\".$value.\"</td></tr>\\n\";\n\t\t}\n\t\t// linea en blanco\n\t\t$array02[$i++] = \"<tr><td></td><td></td></tr>\\n\";\n\t}\n\t$array02[$i++] = \"</table>\";\n\treturn $array02;\n\n// foreach( $array02 as $value ){\n//\techo $value;\n//}\n}", "function multiTableRow($row_attrs, $cell_data, $istitle = false) {\n\t\t$ap = html_ap();\n\t\t(isset($row_attrs['class'])) ? $row_attrs['class'] .= ' ff' : $row_attrs['class'] = 'ff';\n\t\tif ( $istitle ) {\n\t\t\t$row_attrs['class'] .= ' align-center';\n\t\t}\n\t\t$return = html_ao('tr', $row_attrs);\n\t\tfor ( $c = 0; $c < count($cell_data); $c++ ) {\n\t\t\t$locAp = html_ap();\n\t\t\t$cellAttrs = array();\n\t\t\tforeach (array_slice($cell_data[$c],1) as $k => $v) {\n\t\t\t\t$cellAttrs[$k] = $v;\n\t\t\t}\n\t\t\t(isset($cellAttrs['class'])) ? $cellAttrs['class'] .= ' ff' : $cellAttrs['class'] = 'ff';\n\t\t\t$return .= html_ao('td', $cellAttrs);\n\t\t\tif ( $istitle ) {\n\t\t\t\t$return .= html_ao('strong');\n\t\t\t}\n\t\t\t$return .= $cell_data[$c][0];\n\t\t\tif ( $istitle ) {\n\t\t\t\t$return .= html_ac(html_ap() -1);\n\t\t\t}\n\t\t\t$return .= html_ac($locAp);\n\t\t}\n\t\t$return .= html_ac($ap);\n\t\treturn $return;\n\t}", "private function prepare_table()\n {\n global $g_dirs;\n\n $l_dao = new isys_cmdb_dao($this->database);\n $l_quicky = new isys_ajax_handler_quick_info();\n\n $l_table = \"<table width=\\\"100%\\\" class=\\\"report_listing\\\">\";\n\n foreach ($this->m_its_arr as $l_obj_id => $l_title) {\n unset($this->m_obj_arr);\n $l_table .= \"<tr style=\\\"\\\"><td onclick=\\\"collapse_it_service('\" . $l_obj_id . \"')\\\" id=\\\"\" . $l_obj_id . \"\\\" class=\\\"report_listing\\\"><img id=\\\"\" . $l_obj_id .\n \"_plusminus\\\" src=\\\"\" . $g_dirs[\"images\"] . \"dtree/nolines_plus.gif\\\" class=\\\"vam\\\">\";\n\n $l_table .= $l_quicky->get_quick_info($l_obj_id, $l_dao->get_obj_name_by_id_as_string($l_obj_id), C__LINK__OBJECT);\n\n $l_table .= \"<img src=\\\"\" . $g_dirs[\"images\"] . \"ajax-loading.gif\\\" id=\\\"ajax_loading_view_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\" class=\\\"vam\\\" /></td></tr>\";\n\n $l_table .= \"<tr id=\\\"childs_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\"><td><div id=\\\"childs_content_\" . $l_obj_id . \"\\\"></div>\";\n $l_table .= \"</td></tr>\";\n }\n\n $l_table .= \"</table>\";\n\n return $l_table;\n }", "public function fullTableRow($in){\n $out = '';\n $cols = array_keys($in);\n foreach($in as $k => $v){\n if(!isset($v)) $v = 'n/a';\n $out .= '<td><a title=\"'.$k.'\">'.$v.'</a></td>';\n }\n return('<tr>'.$out.'</tr>');\n }", "private function parse(array $data)\n {\n // Constants\n $aStatus = [ ];\n $aStatus[\\Foundation\\Debug\\Variable\\CContainer::KEY_IDENTICAL] = [ 'status' => 'identical', 'class' => 'info' ];\n $aStatus[\\Foundation\\Debug\\Variable\\CContainer::KEY_UPDATED] = [ 'status' => 'updated', 'class' => 'warning' ];\n $aStatus[\\Foundation\\Debug\\Variable\\CContainer::KEY_DELETED] = [ 'status' => 'deleted', 'class' => 'error' ];\n $aStatus[\\Foundation\\Debug\\Variable\\CContainer::KEY_ADDED] = [ 'status' => 'added', 'class' => 'success' ];\n $sReturn = '<thead><tr><th>KEY</th><th>STATUS</th><th>START</th><th>END</th></tr></thead>'\n . '<tbody>';\n foreach ($data as $key => $value) {\n if ($key === 0) {\n continue;\n }\n $sReturn .= '<tr class =\"' . $aStatus[$value['status']]['class'] . '\" >'\n //$sReturn .= '<tr>'\n . '<td>' . htmlentities($key, ENT_QUOTES, 'UTF-8') . '</td>'\n . '<td class =\"' . $aStatus[$value['status']]['class'] . '\" >' . $aStatus[$value['status']]['status'] . '</td>';\n if ($value['status'] == \\Foundation\\Debug\\Variable\\CContainer::KEY_IDENTICAL) {\n // Identical\n $sReturn .= '<td colspan=\"2\">' . $this->format($value['values']['start']) . '</td>';\n } else {\n // Updated or deleted or added\n if ($value['values']['type'] == \\Foundation\\Debug\\Variable\\CContainer::VALUE_OTHERS) {\n // Scalar\n $sReturn .= '<td>' . $this->format($value['values']['start']) . '</td>'\n . '<td>' . $this->format($value['values']['end']) . '</td>';\n } else {\n // Arrays\n $sReturn .= '<td colspan=\"2\"><table class=\"table table-striped table-bordered\">'\n . $this->parse($value['values']['end']) . '</table></td>';\n }\n }\n $sReturn .= '</tr>';\n }//foreach(...\n $sReturn .= '</tbody>';\n return $sReturn . PHP_EOL;\n }", "protected function reformatTableOfContents()\n {\n $tableOfContentsXML = simplexml_load_string($this->tableOfContents);\n\n $reformatted = null;\n\n foreach ($tableOfContentsXML->li as $section) {\n $title = $section->a->asXML();\n\n $headings = [];\n foreach ($section->ul->li as $heading) {\n $headings[] = $heading->a->asXML();\n }\n\n $reformatted .= view('specification.toc.section', compact('title', 'headings'));\n }\n\n $this->tableOfContents = $reformatted;\n }", "public function getTableDefinitions() {}", "public function _GetCacheTableInfos()\n {\n $aTables = parent::_GetCacheTableInfos();\n\n $oShop = TdbShop::GetInstance();\n $oActiveCategory = $oShop->GetActiveCategory();\n $oActiveItem = $oShop->GetActiveItem();\n if (!is_null($oActiveCategory)) {\n $aTables[] = array('table' => 'shop_category', 'id' => '');\n }\n\n if (!is_null($oActiveItem)) {\n $aTables[] = array('table' => 'shop_article', 'id' => $oActiveItem->id);\n }\n\n return $aTables;\n }", "public function loadArpTable() {\n\n if (!$this->snmp_template_id)\n return array();\n\n\n\n if ($this->arp_table) {\n return $this->arp_table;\n }\n\n try {\n\n $res = PNMSnmp::walk($this, '.1.3.6.1.2.1.4.22.1.2', Yii::app()->params['cacheTtlArp']);\n \n \n\n while (list($key, $data) = each($res)) {\n #$ip = preg_replace('/IP-MIB::ipNetToMediaPhysAddress\\.[0-9]+\\./', '', $key);\n $ip = preg_replace('/.1.3.6.1.2.1.4.22.1.2\\.[0-9]+\\./', '', $key);\n #$mac_snmp = strtolower(str_replace('STRING: ', '', $data));\n $mac_snmp = strtolower(str_replace('Hex-STRING: ', '', $data));\n\n /*\n $str = explode(':', $mac_snmp);\n $mac = null;\n for ($i = 0; $i < 6; $i++) {\n @$mac .= str_pad($str[$i], 2, \"0\", STR_PAD_LEFT) . (($str[$i + 1] !== null) ? ':' : '');\n }\n */\n\n $mac = str_replace(' ', ':', trim($mac_snmp));\n\n $this->arp_table[$mac] = $ip;\n }\n } catch (Exception $exc) {\n throw new Exception($exc->getMessage());\n }\n\n return $this->arp_table;\n }", "function MyMod_Handle_Files_Table($path,$table=array(),$prencells=0)\n {\n return\n array_merge\n (\n $this->MyMod_Handle_Files_Subdir_Rows($path),\n $this->MyMod_Handle_Files_Subdirs_Table($path,$prencells),\n $this->MyMod_Handle_Files_Path_Table($path,$prencells)\n );\n }", "public function parserCommonTable($body, $selector)\n {\n $crawler = new Crawler((string)$body);\n $crawler = $crawler->filter($selector);\n $tmp_crawler = $crawler->children();\n if ($tmp_crawler == null) return null;\n $data = $tmp_crawler->each(function (Crawler $node, $i) {\n return $node->children()->each(function (Crawler $node, $j) {\n $text = str_replace( chr( 194 ) . chr( 160 ), '', $node->text() );\n return $text;\n });\n });\n //Unset the title.\n unset($data[0]);\n return $data;\n }", "public function getTableFields($tableName)\n\t{\n\t\t$result = [];\n\t\t$tableInfo = $this->manager->getTableDescription($tableName, $this->languageId);\n\t\tif ($tableInfo)\n\t\t{\n\t\t\tforeach ($tableInfo['FIELDS'] as $fieldName => $fieldInfo)\n\t\t\t{\n\t\t\t\tif (isset($fieldInfo['FIELD_TYPE_EX']))\n\t\t\t\t{\n\t\t\t\t\t$type = $fieldInfo['FIELD_TYPE_EX'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$type = $fieldInfo['FIELD_TYPE'];\n\t\t\t\t}\n\n\t\t\t\t$result[] = [\n\t\t\t\t\t'CONCEPT_TYPE' => (isset($fieldInfo['IS_METRIC']) && $fieldInfo['IS_METRIC'] === 'Y' ? 'METRIC' : 'DIMENSION'),\n\t\t\t\t\t'ID' => $fieldName,\n\t\t\t\t\t'NAME' => $fieldInfo['FIELD_DESCRIPTION'],\n\t\t\t\t\t'DESCRIPTION' => $fieldInfo['FIELD_DESCRIPTION_FULL'] ?? '',\n\t\t\t\t\t'TYPE' => $this->mapType($type),\n\t\t\t\t\t'AGGREGATION_TYPE' => $fieldInfo['AGGREGATION_TYPE'] ?? null,\n\t\t\t\t\t'IS_PRIMARY' => $fieldInfo['IS_PRIMARY'] ?? null,\n\t\t\t\t\t'CONCAT_GROUP_BY' => $fieldInfo['CONCAT_GROUP_BY'] ?? null,\n\t\t\t\t\t'CONCAT_KEY' => $fieldInfo['CONCAT_KEY'] ?? null,\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "function clean_rtf_from_jade_tables() {\r\n\t\t//$this->code = preg_replace('/class=[^\\s<>]*/', '', $this->code, -1, $d);\r\n\t\t//$this->code = preg_replace('/colspan=[0-9]*/', '', $this->code, -1, $e);\r\n\t\t//$this->code = preg_replace('/width=[0-9]*/', '', $this->code, -1, $f);\r\n\t\t//$this->code = str_replace('<p >', '', $this->code, $g);\r\n\t\t//$this->code = str_replace('<span >', '', $this->code, $h);\r\n\t\t//$this->code = str_replace('</p>', '', $this->code, $i);\r\n\t\t//$this->code = str_replace('</span>', '', $this->code, $j);\r\n\t\t//$this->code = str_replace('<p >', '', $this->code, $k);\t\t\r\n\t\t// INAC1168\r\n\t\tif($this->language === \"english\") {\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITIES<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSIBILITY<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TIMING GUIDELINES<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITIES</b></td>\r\n<td$2><b>RESPONSIBILITY</b></td>\r\n<td$3><b>TIMING GUIDELINES</b></td>\r\n</tr>\r\n<tr>\r\n<td$10>1.', $this->code, -1, $l);\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITIES<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSIBILITY<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TIMING GUIDELINES<\\/b>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITIES</b></td>\r\n<td$2><b>RESPONSIBILITY</b></td>\r\n<td$3><b>TIMING GUIDELINES</b></td>\r\n</tr>\r\n<tr>\r\n<td$9>1.', $this->code, -1, $m);\r\n\t\t}\r\n\t\tif($this->language === \"french\") {\r\n\t\tprint(\"<h1>french</h1>\");\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITÉS<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSABILITÉ<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>HORIZON<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TEMPOREL<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITÉS</b></td>\r\n<td$2><b>RESPONSABILITÉ</b></td>\r\n<td$3><b>HORIZON TEMPOREL</b></td>\r\n</tr>\r\n<tr>\r\n<td$10>1.', $this->code, -1, $n);\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITÉS<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSABILITÉ<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>HORIZON<\\/b>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TEMPOREL<\\/b>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITÉS</b></td>\r\n<td$2><b>RESPONSABILITÉ</b></td>\r\n<td$3><b>HORIZON TEMPOREL</b></td>\r\n</tr>\r\n<tr>\r\n<td$9>1.', $this->code, -1, $o);\t\t\r\n\t\t}\r\n\t\t//$this->code = preg_replace('/<span\\s*>/', '', $this->code, -1, $p);\r\n\t\t$this->code = preg_replace('/<tr height=\"0\">.*?<\\/tr>/', '', $this->code, -1, $q);\r\n\t\t\r\n\t\t$this->logMsgIf(\"clean_rtf_from_jade_tables\", $c + $d + $e + $f + $g + $h + $i + $j + $k + $l + $m + $n + $o + $p + $q);\r\n\t}", "function readTable(string $tableName): array\r\n {\r\n $results = $this->querySimpleExecute('select * from ' . $tableName);\r\n $results = $this->formatData($results);\r\n return $results;\r\n }", "function DatesSchedulesTables($edit)\n {\n $tables=array();\n foreach ($this->ScheduleDates() as $date)\n {\n array_push($tables,$this->DateSchedulesTable($edit,$date));\n }\n\n return $tables;\n }", "public function getListOfTables() {}", "function table_from_array(&$data_array, $has_header = TRUE, $class = \"\", $id = \"\", $text_limit_to_trim = null) {\n if ((count($data_array) == 0) || (count(current($data_array)) == 0)) {\n trigger_error(\"Array to build HTML table is empty\", E_USER_NOTICE);\n return FALSE;\n }\n $table_object = new html_classes\\table($class, $id);\n\n foreach ($data_array as $row_index => $row_data) {\n if ($has_header && ($row_index === 0)) {\n $thead = $table_object->append_thead();\n $tr = $thead->append_tr();\n } else {\n if (!isset($tbody)) {\n $tbody = $table_object->append_tbody();\n }\n $tr = $tbody->append_tr();\n }\n foreach ($row_data as $col_index => $col_value) {\n if ($has_header && ($row_index === 0)) {\n $tr->append_th($col_value);\n } else {\n if (!is_object($col_value)) {\n if (is_numeric($col_value)) {\n if (is_float($col_value)) {\n $col_value = number_format($col_value, 2);\n } else {\n $col_value = number_format($col_value);\n }\n }\n if (is_numeric($text_limit_to_trim) && strlen($col_value) > $text_limit_to_trim) {\n $col_value = substr($col_value, 0, $text_limit_to_trim) . \"...\";\n }\n } else {\n if (is_numeric($text_limit_to_trim) && strlen($col_value->get_value()) > $text_limit_to_trim) {\n $col_value->set_value(substr($col_value->get_value(), 0, $text_limit_to_trim) . \"...\");\n }\n// d($col_value->get_value());\n }\n $tr->append_td($col_value);\n }\n }\n }\n// \\var_dump($table_object);\n return $table_object;\n}", "function Latex_Table_Multi($titles,$table,$spec=\"c\")\n {\n $clines=array();\n $rtable=array();\n \n $rids=array_keys($table);\n\n $width=0;\n foreach ($rids as $rid)\n {\n $row=$table[ $rid ];\n if (!is_array($row)) { $row=array($row); }\n if (!empty($row[ \"Row\" ])) { $row=$row[ \"Row\" ]; }\n if ($width<count($row)) { $width=count($row); }\n }\n \n foreach ($rids as $rid)\n {\n $row=$table[ $rid ];\n if (!is_array($row))\n {\n $row=array\n (\n $this->MultiCell($row,$width)\n );\n \n $table[ $rid ]=$row;\n }\n \n \n if (!is_array($row)) { $row=array($row); }\n if (!empty($row[ \"Row\" ])) { $row=$this->B($row[ \"Row\" ]); }\n \n $rtable[ $rid ]=array();\n $clines[ $rid ]=array();\n\n $cids=array_keys($row);\n for ($m=0;$m<count($cids);$m++)\n {\n $cid=$cids[ $m ];\n \n $cell=$row[ $cid ];\n \n $text=$cell;\n if (!empty($cell[ \"Text\" ]))\n {\n $text=$cell[ \"Text\" ];\n }\n \n $rtable[ $rid ][ $cid ]=$text;\n\n $start=$cid+1;\n $end=$start;\n if (!empty($cell[ \"Options\" ][ \"COLSPAN\" ]))\n {\n $end=$start+$cell[ \"Options\" ][ \"COLSPAN\" ]-1;\n }\n \n $clines[ $rid ][ $cid ]=\n \"\\\\cline{\".$start.\"-\".$end.\"}\";\n }\n }\n\n \n for ($n=0;$n<count($rids);$n++)\n {\n $rid=$rids[ $n ];\n \n $row=$table[ $rid ];\n \n if (!is_array($row))\n {\n $row=array\n (\n $this->MultiCell($row,$width)\n );\n }\n \n if (!empty($row[ \"Row\" ])) { $row=$row[ \"Row\" ]; }\n \n $cids=array_keys($row);\n foreach ($row as $cid => $cell)\n {\n if (!empty($cell[ \"Options\" ]))\n {\n if (!empty($cell[ \"Options\" ][ \"ROWSPAN\" ]))\n {\n for ($m=0;$m<$cell[ \"Options\" ][ \"ROWSPAN\" ]-1;$m++)\n {\n if ($rids[ $n+$m ])\n {\n $rrid=$rids[ $n+$m ];\n unset($clines[ $rrid ][ $cid ]);\n }\n }\n\n $rtable[ $rid ][ $cid ]=\n $this->Latex_Table_Multi_Row\n (\n $cell[ \"Options\" ][ \"ROWSPAN\" ],\n $rtable[ $rid ][ $cid ]\n ).\n \"\";\n }\n\n if (!empty($cell[ \"Options\" ][ \"COLSPAN\" ]))\n {\n $rtable[ $rid ][ $cid ]=\n $this->Latex_Table_Multi_Col\n (\n $cell[ \"Options\" ][ \"COLSPAN\" ],\n $rtable[ $rid ][ $cid ],\n $cid\n );\n }\n \n \n }\n }\n\n }\n \n $specs=array();\n for ($n=0;$n<$width;$n++)\n {\n array_push($specs,$spec);\n }\n \n $latex=\"\\\\begin{tabular}{|\".join(\"|\",$specs).\"|}\\n\\\\hline\\n\";\n for ($n=0;$n<count($rids);$n++)\n {\n $rid=$rids[ $n ];\n $latex.=\n join(\" &\\n\",$rtable[ $rid ]).\"\\\\\\\\\\n\".\n join(\" \",$clines[ $rid ]).\"\\n\".\n \"\";\n }\n\n $latex.=\"\\\\end{tabular}\\n\";\n\n //$this->ShowLatexCode($latex);exit();\n\n return $latex;\n }", "protected function getTableObjects()\n {\n\n $sm = $this->app['db']->getSchemaManager();\n\n $tables = array();\n\n foreach ($sm->listTables() as $table) {\n if (strpos($table->getName(), $this->prefix) == 0) {\n $tables[$table->getName()] = $table;\n }\n }\n\n return $tables;\n\n }", "private function getFieldsOnTable()\n{\n\n $returnArray=array(); \n foreach ($this->tableStructure as $ind => $fieldArray) { \n $returnArray[$fieldArray['columnName']]=$fieldArray['columnName'];\n }\n \n return $returnArray; \n}", "protected function parseSchemaAndTable($table)\n {\n $table = explode('.', $table);\n\n if (is_array($schema = $this->connection->getConfig('schema'))) {\n if (in_array($table[0], $schema)) {\n return [array_shift($table), implode('.', $table)];\n }\n\n $schema = head($schema);\n }\n\n return [$schema ?: 'public', implode('.', $table)];\n }", "public function tableRows(){\n\t\t$this->tableRows = $this->responseRows->length;\n\t\treturn $this->tableRows;\n\t}", "private function formatTable (array $detectedFiles) : array\n {\n $rows = [];\n\n foreach ($detectedFiles as $type => $data)\n {\n $rows[] = [\n \"<fg=yellow>{$type}</>\",\n $data[\"fileName\"],\n $data[\"digest\"],\n ];\n }\n\n return $rows;\n }", "public static function createTables()\n\t{\n\t\treturn (self::createContentTable());\n\t}", "function extract_tables($criteria = array())\n{\n\t$tables = array();\n\n\tforeach ($criteria as $table => $info)\n\t{\n\t\t$tables[$table] = $info['desc'];\n\t}\n\n\treturn $tables;\n}", "public function delegated_table(html_table $table) {\n\n if (empty($table->head)) {\n throw new coding_exception('Empty head in vmoodle report table');\n }\n\n if (empty($table->align)) {\n throw new coding_exception('Empty aligns in vmoodle report table');\n }\n\n if (empty($table->size)) {\n throw new coding_exception('Empty sizes in vmoodle report table');\n }\n\n if (empty($table->width)) {\n $table->width = '100%';\n }\n\n $str = '';\n $str = '<table width=\"'.$table->width.'\" class=\"generaltable\">';\n $str .= '<tr>';\n $maxcol = count($table->head);\n for ($i = 0 ; $i < $maxcol; $i++) {\n $hd = $table->head[$i];\n $class = '^header';\n if ($i == 0) {\n $class .= ' firstcol';\n }\n if ($i == $maxcol - 1) {\n $class .= ' lastcol';\n }\n $class .= ' c'.$i;\n\n if (!empty($table->colclasses[$i])) {\n $class .= ' '.$table->colclasses[$i];\n }\n\n $class = ' '.core_text::strtolower($table->align[$i]).'align';\n\n $str .= '<th class=\"'.$class.'\" scope=\"col\">'.$hd.'</th>';\n }\n $str .= '</tr>';\n\n $maxrows = count($table->data);\n for ($i = 0; $i < $maxrows; $i++) {\n\n if ($i == 0) {\n $class .= ' firstrow';\n }\n if ($i == $maxrows - 1) {\n $class .= ' lastrow';\n }\n\n if (!empty($table->rowclasses[$i])) {\n $class .= ' '.$table->rowclasses[$i];\n }\n\n if (!empty($table->rowclasses[$i])) {\n $class .= ' '.$table->rowclasses[$i];\n }\n\n if (is_object($table->data[$i])) {\n $rowcontent = '';\n $delegationattrs = ' delegated-fragment=\"'.$table->data[$i]->fragment.'\"';\n $delegationattrs .= ' delegated-context=\"'.urlencode($table->data[$i]->contextstring).'\"';\n if ($year = optional_param('year', false, PARAM_INT)) {\n $delegationattrs .= ' delegated-filter=\"year_'.$year.'\"';\n }\n $str .= '<tr class=\"delegated-content '.$class.'\" '.$delegationattrs.' ></tr>';\n } else {\n $str .= '<tr class=\"undelegated '.$class.'\" >';\n for ($j = 0; $j < $maxcol; $j++) {\n $align = 'leftalign';\n if (!empty($table->align[$j])) {\n $align = $table->align[$j];\n }\n if (!empty($table->data[$i][$j])) {\n $str .= '<td class=\"cell '.$align.' c'.$j.'\">'.$table->data[$i][$j].'</td>';\n } else {\n $str .= '<td class=\"cell '.$align.' c'.$j.'\"></td>';\n }\n }\n $str .= '</tr>';\n }\n\n }\n $str .= '<table>';\n\n return $str;\n }", "protected static function extractTableFromSQL($sql)\n {\n $exp = '/FROM `([^ \\(]*)`/ms';\n $returnArray = array();\n preg_match_all($exp, $sql, $matches);\n \n if(sizeof($matches) > 0 && sizeof($matches[0]) > 0)\n {\n foreach($matches[0] as $index => $value)\n {\n $returnArray = preg_replace($exp,'$1', $matches[0][$index]);\n }\n }\n else\n {\n $exp = '/UPDATE `([^ \\(]*)`/ms';\n $returnUpdateArray = array();\n preg_match_all($exp, $sql, $matches);\n\n if(sizeof($matches) > 0 && sizeof($matches[0]) > 0)\n {\n foreach($matches[0] as $index => $value)\n {\n $returnArray = preg_replace($exp,'$1', $matches[0][$index]);\n }\n }\n else\n {\n return '';\n }\n }\n \n return $returnArray;\n }", "private function getFormTableContent(){\n\t\t$s_style = 'font-size:'.$this->_emailFontSize.'; font-family:'.$this->_emailFontFamily.';';\n\t\t$bgCol1='#FFFFFF';\n\t\t$bgCol2='#e4edf9';\n\t\t$bgColDarkerBG='#cddaeb';\n\t\t$colOutline='#8a99ae';\n\t\t$rowCount=0;\n\t\t$NL=\"\\r\\n\";\n\t\t$s_ret='<table cellpadding=\"5\" cellspacing=\"0\" style=\"'.$s_style.'\">'.$NL;\n\t\tforeach($this->_formElements as $o_el){\n\t\t\tif(get_class($o_el)=='FormItBuilder_htmlBlock'){\n\t\t\t\t//do nothing\n\t\t\t}else{\n\t\t\t\tif($o_el->showInEmail()===true){\n\t\t\t\t\t\n\t\t\t\t\t$bgCol=$bgCol1;\n\t\t\t\t\tif($rowCount%2==0){\n\t\t\t\t\t\t$bgCol=$bgCol2;\n\t\t\t\t\t}\n\n\t\t\t\t\t$elType=get_class($o_el);\n\t\t\t\t\t$elId = $o_el->getId();\n\t\t\t\t\t\n\t\t\t\t\tswitch($elType){\n\t\t\t\t\t\tcase 'FormItBuilder_elementMatrix':\n\t\t\t\t\t\t\t$type = $o_el->getType();\n\t\t\t\t\t\t\t$cols = $o_el->getColumns();\n\t\t\t\t\t\t\t$rows = $o_el->getRows();\n\t\t\t\t\t\t\t$r_cnt=0;\n\t\t\t\t\t\t\t$s_val='<table cellpadding=\"5\" cellspacing=\"0\" style=\"'.$s_style.' font-size:10px;\"><tr><td>&nbsp;</td>';\n\t\t\t\t\t\t\t$c_cnt=0;\n\t\t\t\t\t\t\tforeach($cols as $column){\n\t\t\t\t\t\t\t\t$s_val.='<td style=\"'.($c_cnt==0?'border-left:1px solid '.$colOutline.'; ':'').'background-color:'.$bgColDarkerBG.'; border-right:1px solid '.$colOutline.'; border-bottom:1px solid '.$colOutline.'; border-top:1px solid '.$colOutline.';\"><em>'.htmlspecialchars($column).'</em></td>';\n\t\t\t\t\t\t\t\t$c_cnt++;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$s_val.='</tr>';\n\t\t\t\t\t\t\tforeach($rows as $row){\n\t\t\t\t\t\t\t\t$c_cnt=0;\n\t\t\t\t\t\t\t\t$s_val.='<tr><td style=\"'.($r_cnt==0?'border-top:1px solid '.$colOutline.'; ':'').'background-color:'.$bgColDarkerBG.'; border-right:1px solid '.$colOutline.'; border-left:1px solid '.$colOutline.'; border-bottom:1px solid '.$colOutline.';\"><em>'.htmlspecialchars($row).'</em></td>';\n\t\t\t\t\t\t\t\tforeach($cols as $column){\n\t\t\t\t\t\t\t\t\t$s_val.='<td style=\"text-align:center; border-right:1px solid '.$colOutline.'; border-bottom:1px solid '.$colOutline.';\">';\n\t\t\t\t\t\t\t\t\tswitch($type){\n\t\t\t\t\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\t\t\t\t\t$s_val.=htmlspecialchars($_REQUEST[$elId.'_'.$r_cnt.'_'.$c_cnt]);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\t\t\t\t$s_val.=($c_cnt==$_REQUEST[$elId.'_'.$r_cnt]?'&#10004;':'-');\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 'check':\n\t\t\t\t\t\t\t\t\t\t\tif(isset($_REQUEST[$elId.'_'.$r_cnt]) && in_array($c_cnt,$_REQUEST[$elId.'_'.$r_cnt])===true){\n\t\t\t\t\t\t\t\t\t\t\t\t$s_val.='&#10004;';\n\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t$s_val.='-';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$s_val.='</td>';\n\t\t\t\t\t\t\t\t\t$c_cnt++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$r_cnt++;\n\t\t\t\t\t\t\t\t$s_val.='</tr>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$s_val.='</table>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'FormItBuilder_elementFile':\n\t\t\t\t\t\t\tif(isset($_FILES[$elId])){\n\t\t\t\t\t\t\t\tif($_FILES[$elId]['size']==0){\n\t\t\t\t\t\t\t\t\t$s_val='None';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'FormItBuilder_elementDate':\n\t\t\t\t\t\t\t$s_val='[[+'.htmlspecialchars($o_el->getId()).'_0]] [[+'.htmlspecialchars($o_el->getId()).'_1]] [[+'.htmlspecialchars($o_el->getId()).'_2]]';\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$s_val='[[+'.htmlspecialchars($o_el->getId()).':nl2br]]';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$s_ret.='<tr valign=\"top\" bgcolor=\"'.$bgCol.'\"><td><b>'.htmlspecialchars($o_el->getLabel()).':</b></td><td>'.$s_val.'</td></tr>'.$NL;\n\t\t\t\t\t$rowCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$s_ret.='</table>'.$NL;\n\t\treturn $s_ret;\n\t}", "private function makeTableData(array $inputData)\n {\n // Empty template table elements.\n $td = new HtmlNode(kind: 'td');\n $th = new HtmlNode(kind: 'th');\n $span = new HtmlLeaf(kind: 'span');\n // Add dummy entries to fill last row\n $this->addDummyEntries($inputData);\n // Wrap top level nodes with table data or table header elements.\n $colCount = 1;\n $nodeCount = 1;\n $tableData = [];\n foreach ($inputData as $chunk) {\n $td_tmp = ($nodeCount <= $this->nCols & $this->enableHeaders)\n ? clone $th : clone $td;\n ++$nodeCount;\n // Check if input is of type htmlLeaf\n if ($chunk instanceof HtmlLeaf) {\n $td_tmp->appendChild($chunk);\n } else {\n $td_tmp->appendChild($span)->setContent(\"$chunk\");\n }\n\n // Reset $colCount at end of table row.\n $colCount = ($colCount == $this->nCols + 1) ? 1 : $colCount;\n // Style td and th\n $td_tmp->setAttributes(['class' => 'col' . $colCount]);\n $tableData[] = $td_tmp;\n ++$colCount;\n }\n return $tableData;\n }", "public static function getModifyableTables() {}", "abstract protected function loadTableUniques(string $tableName): array;", "function Parse() {\n\t\t\t$this->Rows = CDataParser::Parse($this->Rows); //Note, becomes CDataParserIterator, not CTableIterator\n\t\t}", "abstract public function getRegexMatchingTableNames();", "public function admin_get_tables() {}", "public function admin_get_tables() {}", "function create_table_list(){\n $tables = \"{$this->table_name}\";\n if(isset($this->joined_tables) && count($this->joined_tables)){\n foreach($this->joined_tables as $t){\n if(array_key_exists('TABLE', $t) && array_key_exists('ON', $t)){\n $type = (array_key_exists('TYPE', $t)? $t['TYPE']: \"INNER JOIN\");\n $tables .= \" $type {$t['TABLE']} ON {$t['ON']}\";\n }\n }\n }\n return $tables;\n }", "private function createTables() {\n \n foreach($this->G->tableInfo as $table) {\n $this->tables[$table[\"title\"]] = new IdaTable($table[\"title\"]);\n } \n }", "function arrayToTable($array_assoc):void {\n if (is_array($array_assoc)) {\n echo '<table class=\"table\">';\n echo '<thead>';\n echo '<tr>';\n list($table_title) = $array_assoc;\n foreach ($table_title as $key => &$value):\n echo '<th>' . $key . '</th>';\n endforeach;\n echo '</tr>';\n echo '</thead>';\n foreach ($array_assoc as &$master):\n echo '<tr>';\n foreach ($master as &$slave):\n echo '<td>' . $slave . '</td>';\n endforeach;\n echo '</tr>';\n endforeach;\n echo '</table>';\n }\n}", "function buildHTMLTable($dataSet){\n\n $tblHTML = \"<table class='cleanTbl'>\";\n\n foreach ($dataSet as $row) {\n\n $tblHTML = $tblHTML.\"<tr class='cleanTbl'>\";\n\n foreach($row as $col){\n\n $tblHTML = $tblHTML.\"<td class='cleanTbl'>$col</td>\";\n\n }\n $tblHTML = $tblHTML.\"</tr>\";\n\n }\n $tblHTML = $tblHTML.\"</table>\";\n\n return $tblHTML;\n}", "function getQuestionblocksTable($arrFilter)\n\t{\n\t\tglobal $ilUser, $ilDB;\n\t\t\n\t\t$where = \"\";\n\t\tif (is_array($arrFilter))\n\t\t{\n\t\t\tif (array_key_exists('title', $arrFilter) && strlen($arrFilter['title']))\n\t\t\t{\n\t\t\t\t$where .= \" AND \" . $ilDB->like('svy_qblk.title', 'text', \"%%\" . $arrFilter['title'] . \"%%\");\n\t\t\t}\n\t\t}\n \n\t\t$query_result = $ilDB->query(\"SELECT svy_qblk.*, svy_svy.obj_fi FROM svy_qblk , svy_qblk_qst, svy_svy WHERE \".\n\t\t\t\"svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND svy_svy.survey_id = svy_qblk_qst.survey_fi \".\n\t\t\t\"$where GROUP BY svy_qblk.questionblock_id, svy_qblk.title, svy_qblk.show_questiontext, svy_qblk.show_blocktitle, \".\n\t\t\t\"svy_qblk.owner_fi, svy_qblk.tstamp, svy_svy.obj_fi\");\n\t\t$rows = array();\n\t\tif ($query_result->numRows())\n\t\t{\n\t\t\t$survey_ref_ids = ilUtil::_getObjectsByOperations(\"svy\", \"write\");\n\t\t\t$surveytitles = array();\n\t\t\tforeach ($survey_ref_ids as $survey_ref_id)\n\t\t\t{\n\t\t\t\t$survey_id = ilObject::_lookupObjId($survey_ref_id);\n\t\t\t\t$surveytitles[$survey_id] = ilObject::_lookupTitle($survey_id);\t\t\t\t\n\t\t\t}\n\t\t\twhile ($row = $ilDB->fetchAssoc($query_result))\n\t\t\t{\n\t\t\t\t$questions_array =& $this->getQuestionblockQuestions($row[\"questionblock_id\"]);\n\t\t\t\t$counter = 1;\n\t\t\t\tforeach ($questions_array as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$questions_array[$key] = \"$counter. $value\";\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t\tif (strlen($surveytitles[$row[\"obj_fi\"]])) // only questionpools which are not in trash\n\t\t\t\t{\n\t\t\t\t\t$rows[$row[\"questionblock_id\"]] = array(\n\t\t\t\t\t\t\"questionblock_id\" => $row[\"questionblock_id\"],\n\t\t\t\t\t\t\"title\" => $row[\"title\"], \n\t\t\t\t\t\t\"svy\" => $surveytitles[$row[\"obj_fi\"]], \n\t\t\t\t\t\t\"contains\" => join($questions_array, \", \"),\n\t\t\t\t\t\t\"owner\" => $row[\"owner_fi\"]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $rows;\n\t}", "public function mainTable(){\n //selects needed\n $select[] = 'date_eos';\n\n //build where\n $where = 'overall_status = \"GO\" AND job_type != \"TIA\" ORDER BY crew_1 ASC';\n //add join\n $join = ' LEFT JOIN ' .$this->revTable . ' ON admin_jobs.id = admin_revisions_current.admin_id LEFT JOIN ' .$this->empTable . ' ON admin_jobs.crew_1 = employee.id';\n\n //build query\n $result = $this->runQuery($where,$select,$join);\n\n return $result;\n\n }", "function table_list()\n{\n\t//TODO - a similar function is in db_verify.php. Should probably all be moved to mysql_class.php.\n\n\t$exclude = array();\n\t$exclude[] = \"core\";\n\t$exclude[] = \"rbinary\";\n\t$exclude[] = \"parser\";\n\t$exclude[] = \"tmp\";\n\t$exclude[] = \"online\";\n\t$exclude[] = \"upload\";\n\t$exclude[] = \"user_extended_country\";\n\t$exclude[] = \"plugin\";\n\n\t$coreTables = e107::getDb()->db_TableList('nolan');\n\n\t$tables = array_diff($coreTables,$exclude);\n\n\tforeach($tables as $e107tab)\n\t{\n\t\t$count = e107::getDb()->gen(\"SELECT * FROM #\".$e107tab);\n\n\t\tif($count)\n\t\t{\n\t\t\t$tabs[$e107tab] = $count;\n\t\t}\n\t}\n\n\treturn $tabs;\n}", "private function parse(TableNode $arguments)\n {\n $fields = [];\n foreach ($arguments->getRowsHash() as $key => $value) {\n if (array_key_exists($key, $fields)) {\n if (is_array($fields[$key])) {\n $fields[$key][] = $value;\n } else {\n $fieldValue = $fields[$key];\n $fields[$key][] = $fieldValue;\n $fields[$key][] = $value;\n }\n } else {\n $fields[$key] = $value;\n }\n }\n\n return $fields;\n }" ]
[ "0.6481625", "0.6072879", "0.5817888", "0.5658257", "0.5631577", "0.5537207", "0.55142075", "0.54702276", "0.5461429", "0.5435652", "0.54218566", "0.5421293", "0.54068005", "0.53892195", "0.53548586", "0.53548586", "0.53548586", "0.5304485", "0.5294064", "0.5290103", "0.52672535", "0.5260273", "0.5234872", "0.5231494", "0.5194439", "0.51935756", "0.5164303", "0.5148521", "0.5147088", "0.51401305", "0.51401305", "0.5118843", "0.5118027", "0.51094073", "0.50942004", "0.50858134", "0.50807434", "0.50471586", "0.50366575", "0.5008567", "0.49980533", "0.49955067", "0.49828407", "0.49803734", "0.4965094", "0.49606588", "0.49519113", "0.4951827", "0.49432287", "0.49376684", "0.4937508", "0.49337593", "0.4928851", "0.49213687", "0.49067578", "0.4905898", "0.4903083", "0.48906207", "0.48869535", "0.4871335", "0.48663527", "0.48653552", "0.48592782", "0.48547947", "0.4852624", "0.48480555", "0.48445678", "0.48391035", "0.48322383", "0.48263323", "0.48160607", "0.48117405", "0.4810964", "0.48042542", "0.47950855", "0.4791862", "0.47911274", "0.47905463", "0.47881427", "0.47848666", "0.47831827", "0.4769681", "0.4768138", "0.4761514", "0.4753814", "0.47534907", "0.47456786", "0.47363257", "0.47358364", "0.4735245", "0.47253576", "0.47248062", "0.47197178", "0.47184324", "0.47165397", "0.47159755", "0.4715293", "0.47033897", "0.4702277", "0.46980467" ]
0.5895982
2
Function that takes a key expression and the current pointer to position in the right hierarchy. Then it sets the corresponding value on that position.
private static function parseKeyValue($key, $val, & $pointer) { // Flags $openQuote = false; $openDoubleQuote = false; // Buffer $buff = ''; // Parse for($i = 0; $i < strlen($key); $i++) { // Handle quoting if($key[$i] == '"') { if(!$openQuote) { if($openDoubleQuote) { $openDoubleQuote = false; } else { $openDoubleQuote = true; } continue; } } if($key[$i] == "'") { if(!$openDoubleQuote) { if($openQuote) { $openQuote = false; } else { $openQuote = true; } continue; } } // Handle dotted keys if($key[$i] == "." && !$openQuote && !$openDoubleQuote) { if(is_array($pointer)) { if(!isset($pointer[$buff])) { $pointer[$buff] = new stdClass(); } $pointer = & $pointer[$buff]; } else { if(!isset($pointer->{$buff})) { $pointer->{$buff} = new stdClass(); } $pointer = & $pointer->{$buff}; } // Cleanup buffer $buff = ''; continue; } $buff .= $key[$i]; } if(is_array($pointer)) { $pointer[$buff] = self::parseValue( $val ); } else { $pointer->{$buff} = self::parseValue( $val ); } return $buff; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set ($key, $value) {\n\t\t$this->root = $this->setLoop($key, $value, $this->root);\n\t}", "public function set($key, $value)\n {\n // lock\n if (!flock($this->handle, LOCK_EX)) return FALSE;\n if (fseek($this->handle, 0, SEEK_END) === -1) {\n flock($this->handle, LOCK_UN);\n return FALSE;\n }\n if (($pos = ftell($this->handle)) === FALSE) {\n flock($this->handle, LOCK_UN);\n return FALSE;\n }\n $cursor = $pos;\n\n // key lookup\n $lookup = $this->lookup($key);\n $node = array_pop($lookup);\n if ($node === NULL) return FALSE;\n\n // change value\n $index = current(array_keys($node));\n $node_type = self::KVNODE;\n $new_index = NULL;\n if ($value === NULL) unset($node[$key]);\n else $node[$key] = $value;\n\n // traverse tree up\n do {\n if (count($node) <= intval(self::NODE_SLOTS / 2) && !empty($lookup)) {\n $upnode = (array) array_pop($lookup);\n $new_index = current(array_keys($upnode));\n $sibling = $prev = array(NULL, NULL);\n\n foreach ($upnode as $k => $v) {\n if ($index === $k) $sibling = $prev; // left sibling\n else if ($index === $prev[0]) $sibling = array($k, $v); // right sibling\n\n if ($sibling[0] !== NULL) {\n list($sibling_type, $sibling_node) = $this->node($sibling[1]);\n if ($sibling_type === NULL || $sibling_node === NULL) {\n ftruncate($this->handle, $pos);\n flock($this->handle, LOCK_UN);\n return FALSE;\n }\n $node = array_merge($node, $sibling_node);\n unset($upnode[$sibling[0]]);\n }\n\n $prev = array($k, $v);\n $sibling = array(NULL, NULL);\n }\n\n array_push($lookup, $upnode);\n }\n\n ksort($node, SORT_STRING);\n if (count($node) <= self::NODE_SLOTS) $nodes = array($node);\n else $nodes = array_chunk($node, ceil(count($node) / ceil(count($node) / self::NODE_SLOTS)), TRUE);\n\n $upnode = array_merge(array(), (array) array_pop($lookup));\n if ($new_index === NULL) $new_index = current(array_keys($upnode));\n unset($upnode[$index]);\n\n foreach ($nodes as $_) {\n $serialized = self::serialize($node_type, $_);\n $to_write = pack('N', strlen($serialized)) . $serialized;\n if (fwrite($this->handle, $to_write, strlen($to_write)) !== strlen($to_write)) {\n ftruncate($this->handle, $pos);\n flock($this->handle, LOCK_UN);\n return FALSE;\n }\n $upnode[current(array_keys($_))] = $cursor;\n $cursor += strlen($to_write);\n }\n\n $node_type = self::KPNODE;\n $index = $new_index;\n $new_index = NULL;\n\n if (count($upnode) <= 1) {\n $root = current(array_values($upnode));\n break;\n } else array_push($lookup, $upnode);\n\n } while (($node = array_pop($lookup)));\n\n // write root\n if (!(fflush($this->handle) &&\n self::header($this->handle, $root) &&\n fflush($this->handle))) \n {\n ftruncate($this->handle, $pos);\n flock($this->handle, LOCK_UN);\n return FALSE;\n }\n\n flock($this->handle, LOCK_UN);\n\n return TRUE;\n }", "function set($key, $pVal, $exp) {\n\t\t\treturn $this->inst->set($key,$pVal,0,$exp);\n\t\t}", "public function setCur($key, \\RKW\\RkwSearch\\TreeTagger\\TreeTaggerRecord $item) {\n\n if ($this->checkData($item, 'cur', $key)) {\n $this->cur[$key] = $item;\n $this->bases[] = $item->getBase();\n }\n }", "protected function setOffset($key, $value){\r\n $this->_registry[$key] = $value;\r\n }", "public function setByKey($master, $key, $value, $expiry = 0) {}", "function update_assignment(&$item, $key) {\n\tif($key===\"operator\" && $item===\"equal\") $item = \"compare\";\n}", "function set_key($key)\n\t{\n\t\tif(empty($key) || !isset($GLOBALS['ACCESS_KEYS'][$key])) return;\n\t\tif(ACCESS_MODEL === \"roles\") {\n\t\t\tforeach($GLOBALS['ACCESS_KEYS'][$key] as $k) {\n\t\t\t\tif(substr($k, 0, 1) == '@') {\n\t\t\t\t\t// This key references another role - pull in all keys from that role\n\t\t\t\t\t$this->set_key(substr($k, 1));\n\t\t\t\t} else {\n\t\t\t\t\t$this->access_keys[] = $k;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(ACCESS_MODEL === \"discrete\") {\n\t\t\t$this->access_keys[] = $key;\n\t\t}\n\n\t\t$_SESSION['_ACCESS']['keys'] = $this->access_keys;\n\t}", "public function setCurrentKey($key)\n {\n $this->steps[$key];\n }", "abstract public function set ($key, $value);", "public function _recursivelyAssign(&$result,$keyArray,$value) {\n\t\t$k = array_shift($keyArray);\n\t\tif (count($keyArray) > 1) {\n\t\t\t$this->_recursivelyAssign($result[$k],$keyArray,$value);\n\t\t} else {\n\t\t\t$kk = $keyArray[0];\n\t\t\t$result[$k][$kk] = $value;\n\t\t}\n\t}", "public function set( $key , $value ) {\n\t\teval( '$this->items' . $this->nodelize( $key ) . ' = $value;' );\n\t}", "abstract public function set($key, $value);", "abstract public function set($key, $value);", "public static function set($key, $val) {\n $items = &static::$items;\n\n foreach(explode('.', $key) as $step) {\n $items = &$items[$step];\n }\n\n $items = $val;\n }", "public function offsetSet($key, $value)\n\t{\n\t\tif (is_null($key)) {\n\t\t\t$this->stack[] = $value;\n\t\t} else {\n\t\t\t$this->stack[$key] = $value;\n\t\t}\n\t}", "function SetKey( $i ) { $this->_key = $i; $this->SetValue('_key', $i ); }", "function setCurrent(&$array, $key)\n\t{\n\t reset($array);\n\t while (current($array)!==FALSE){\n\t if (key($array) == $key) {\n\t break;\n\t }\n\t next($array);\n\t }\n\t return current($array);\n\t}", "protected function setDotNotationKey($key, $value)\n\t{\n\t\t$splitKey = explode('.', $key);\n\t\t$root\t = &$this->data;\n\n\t\twhile ($part = array_shift($splitKey)) \n\t\t{\n\t\t\tif (!isset($root[$part]) AND count($splitKey)) \n\t\t\t{\n\t\t\t\t$root[$part] = [];\n\t\t\t}\n\n\t\t\t$root = &$root[$part];\n\t\t}\n\n\t\t$root = $value;\n\t}", "public function set($key, $value){\n\t\t$this->stack[$key] = $value;\n\t\treturn $this;\n\t}", "function set($keystr, $value)\n{\n\t$key = explode('/',$keystr);\n\tif (count($key) == 3) $block = array_shift($key);\n\t$id = $key[0];\n\t$attr = $key[1];\n\t$sattr = false;\n\tif (strpos($id,'=')) list($sattr,$svalue) = explode('=', $id);\n\n\tif (!$sattr and $id != '*') {\n\t\t$this->elements[$id][$attr] = $value;\n\t\treturn;\n\t}\n\n\tforeach($this->elements as $id => $tmp) {\n\t\tif ($block and !$this->isInBlock($id,$block)) continue;\n\t\tif ($sattr and $this->elements[$id][$sattr] != $svalue) continue;\n\t\t$this->elements[$id][$attr] = $value;\n\t}\n}", "public function offsetSet(mixed $key, mixed $value): void\n {\n $this->setArgument($key, $value);\n }", "public function setValue($key, $value = NULL, $parentKey = NULL){\n if (!empty($parentKey)) {\n $this->getClassVars()->addValue($key, $value, $parentKey);\n } else {\n $this->getClassVars()->addValue($key, $value);\n }\n }", "public function setData($key, $value = null)\n {\n if (is_string($key) && (strpos($key, '/') !== false)) {\n $this->_hasDataChanges = true;\n $keys = $this->_explodeCompoundKey($key);\n $result = $this->_hardTraverseDataKeys($keys);\n $result[1] = $value;\n return $this;\n }\n return parent::setData($key, $value);\n }", "public function __set($key, $val);", "public function setExpr($key, $value)\n {\n if (! $value instanceof Expr) {\n $value = new Expr($value);\n }\n\n $this->setProperty($key, $value);\n\n return $this;\n }", "public function setValue($key, $value);", "public function setValue($key, $value);", "protected function setDotNotationKey($key, $value)\n {\n $splitKey = explode('.', $key);\n $root = &$this->data;\n // Look for the key, creating nested keys if needed\n while ($part = array_shift($splitKey)) {\n if (!isset($root[$part]) && count($splitKey)) {\n $root[$part] = [];\n }\n $root = &$root[$part];\n }\n\n $root = $value;\n }", "public function set($key, $val) {\n\t\t// Check whether the field is writable\n\t\tif (!isset($this->fieldPermissions[$key]) || $this->fieldPermissions[$key] == self::READ_WRITE) {\n\t\t\t$this->data[$this->caret]['curr'][$key] = $val;\n\t\t\t$this->data[$this->caret]['valid'] = true;\n\t\t} else {\n\t\t\ttrigger_error(\"Column $key is not publicly accessible\", E_USER_ERROR);\n\t\t}\n\t}", "public function offsetSet($key, $value)\n {\n $this->setArgument($key, $value);\n }", "static function set(&$data,$value/*key subkey ... [TF]*/){\n $ar = func_get_args();\n array_shift($ar);\n array_shift($ar);\n $dat = $data; // local copy\n $nc = count($ar);\n if($nc>0 and is_bool($ar[$nc-1])){\n $create = array_pop($ar);\n $nc--;\n } else $create = FALSE;\n if(is_array($ar[0])) {\n $ar = $ar[0];\n $nc = count($ar);\n }\n if($nc==0){$data = $value; return(TRUE);} // special case\n $dstack = array();\n for($ii=0;$ii<$nc-1;$ii++){\n $dstack[] = $dat;\n if(!isset($dat[$ar[$ii]])){\n\tif($create) $dat = array(); else return(FALSE);\n }\n $dat = count($dat)>0?$dat[$ar[$ii]]:NULL;\n }\n if(!is_array($dat)){\n if($create) $dat = array(); else return(FALSE);\n }\n $dat[$ar[$ii--]] = $value;\n for(;$ii>=0;$ii--){\n $swap = $dat;\n $dat = array_pop($dstack);\n $dat[$ar[$ii]] = $swap;\n }\n $data = $dat;\n return(TRUE);\n }", "function assign_to($tpl, $key, $value = null)\n\t{\n\t\t$this->data[$tpl]->assign($key, $value);\n\t}", "function SetupKeyValues($key) {\n\t\t$sKeyFld = $key;\n\t\tif (!is_numeric($sKeyFld))\n\t\t\treturn FALSE;\n\t\t$this->product_id->CurrentValue = $sKeyFld;\n\t\treturn TRUE;\n\t}", "function set($key,$val) {\n\t\treturn $this->args[$key]=$val;\n\t}", "public function offsetSet( $key, $value );", "public function setVariable($key, $value, & $data) {\n\n if (strpos($key, $this->scopeGlue) === false) {\n $parts = explode('.', $key);\n } else {\n $parts = explode($this->scopeGlue, $key);\n }\n\n $i = 0;\n $count = count($parts);\n $d = & $data;\n\n while ($i < $count) {\n\n $key_part = $parts[$i];\n $key_part_int = filter_var($key_part, FILTER_VALIDATE_INT);\n $key_part_is_int = $key_part_int !== false;\n $set_value = ($i + 1) == $count;\n\n if ($key_part_is_int && is_object($d)) {\n $d = (array) $d;\n }\n\n if (!is_array($d) && !is_object($d)) {\n $d = array();\n }\n\n if (is_array($d)) {\n\n if ($key_part_is_int && !array_key_exists($key_part, $d)) {\n $key_part = $key_part_int;\n }\n\n if ($set_value) {\n\n $d[$key_part] = $value;\n\n } else {\n\n if (!isset($d[$key_part])) {\n $d[$key_part] = array();\n }\n\n $d = & $d[$key_part];\n }\n\n } else {\n\n if ($set_value) {\n\n $d->{$key_part} = $value;\n\n } else {\n\n if (!property_exists($d, $key_part)) {\n $d->{$key_part} = array();\n }\n\n $d = & $d->{$key_part};\n }\n }\n\n $i++;\n }\n }", "public function set( $key, $value );", "public function set( $key, $value );", "function array_set_current(array &$array, $key)\n {\n reset($array);\n while (current($array) !== false) {\n\n if (key($array) == $key) {\n break;\n }\n\n next($array);\n }\n return current($array);\n }", "public function __set(string $key, $value): void\n\t{\n\t\tif ($this->parentIsSet($key)) {\n\t\t\t$this->parentSet($key, $value);\n\n\t\t} else {\n\t\t\t$this->data[$key] = $value;\n\t\t}\n\t}", "public function setKey($key);", "public function __set($key,$value) {\n $cur = $this->key();\n if(!isset($this->_changed[$cur]) || !is_array($this->_changed[$cur])){\n $this->_changed[$cur]=[];\n }\n if($this->$key != $value){\n $this->_changed[$cur][$key] = $value;\n }\n $this->_data[$cur][$key] = $value;\n }", "public function val(string $sKey, $xValue)\n {\n $this->offsetSet($sKey, $xValue);\n }", "public function set($key, $data);", "static function setC(&$data,$value/*key subkey ...*/){\n $ar = array_slice(func_get_args(),2);\n if(is_array($ar[0])) $ar = $ar[0];\n return(call_user_func_array(array('ops_narray','set'),array(&$data,$value,$ar,TRUE)));\n }", "private function prefixValue(&$key)\n {\n $key = $this->prefix.$key;\n }", "public function setValue($bibtex_key, $p, $v) // {{{\n {\n $entry = $this->m_entries[$bibtex_key];\n $entry[$p] = $v;\n $entry[\"raw\"][$p] = $v;\n $this->m_entries[$bibtex_key] = $entry;\n }", "public function setNext($key, \\RKW\\RkwSearch\\TreeTagger\\TreeTaggerRecord $item) {\n\n if ($this->checkData($item, 'next', $key)) {\n $this->next[$key] = $item;\n $this->bases[] = $item->getBase();\n }\n }", "public function offsetSet($key, $value)\n {\n $this->bind($key, $value instanceof Closure ? $value : function () use ($value) {\n return $value;\n });\n }", "function _set($key,$value){\n switch($key){\n case 'value': case 'val': $this->set($value); return TRUE;\n case 'settings': $this->set_settings($value); return TRUE;\n case 'key': $this->set_key($value); return TRUE;\n }\n return FALSE;\n }", "public function __set($key, $value)\n {\n $this->stack[$key] = $value;\n }", "abstract protected function putValue($key, $value);", "public function testSet() {\n $data = $this->expanded;\n $match = $data;\n\n $data = Hash::set($data, 'key', 'value');\n $match['key'] = 'value';\n $this->assertEquals($match, $data);\n\n $data = Hash::set($data, 'key.key', 'value');\n $match['key'] = array('key' => 'value');\n $this->assertEquals($match, $data);\n\n $data = Hash::set($data, array(\n 'key.key.key' => 'value',\n 'true' => true,\n 'one.false' => false\n ));\n $match['key']['key'] = array('key' => 'value');\n $match['true']= true;\n $match['one']['false'] = false;\n $this->assertEquals($match, $data);\n }", "function set($key, $newvalue) {\n\t\t$this->valuemap[$key]= $newvalue;\n\t}", "public function setItem($key, $item);", "public function set($strKey, $varValue);", "public function __set($key, $value);", "public function set ($key, $value);", "public function set(string $key, $data);", "abstract public function Set(string $key, $value) : void;", "public function offsetSet($key, $value): void\n {\n $this->selection->offsetSet($key, $value);\n }", "public function modify($key, $value = null) {\n if (is_callable($key)) {\n foreach ($this->list as $item) {\n $key($item);\n }\n } else {\n foreach ($this->list as $item) {\n $item->$key = $value;\n }\n }\n }", "function setFormKey($key);", "function set($key,$val) {\n\t\treturn ($key=='_id')?FALSE:($this->item[$key]=$val);\n\t}", "abstract protected function setParameter($key, $value);", "public function getFieldsetDataValue($key);", "public function setData($key, $value);", "public function setData($key, $value);", "abstract protected function transformKey($key);", "public function offsetSet($key, $value) {}", "private function putVal($key, $value)\n {\n if ($key === null) {\n $key = $this->size;\n }\n if (!is_int($key) && !is_string($key)) {\n throw new ClassCastException(\n 'only integer and string types permitted for keys');\n }\n \n $node = $this->getNode($key);\n if ($node != null) {\n $oldValue = $node->getValue();\n $node->setValue($value);\n return $oldValue;\n }\n $node = new Node($this->last, $key, $value, null);\n if ($this->size == 0) {\n $this->first = $node;\n } else {\n $this->last->next = $node;\n }\n $this->size++;\n $this->last = $node;\n return null;\n }", "public function setPageKey($key);", "function assign($key, $value = null) \n\t{\n\t\tif (is_array($key)) \n\t\t{\n\t\t\tforeach ($key as $k => $v) \n\t\t\t{\n\t\t\t\t$this->data[$k] = $v;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->data[$key] = $value;\n\t\t}\n\t}", "function SetupKeyValues($key) {\r\n\t\t$sKeyFld = $key;\r\n\t\t$this->Cue->CurrentValue = $sKeyFld;\r\n\t\treturn TRUE;\r\n\t}", "protected function setArrayDataValue(array &$arrayPointer, $key, $value) {\n\t\t$keys = explode('.', $key);\n\n\t\t// Extract the last key\n\t\t$lastKey = array_pop($keys);\n\n\t\t// Walk/build the array to the specified key\n\t\twhile ($arrayKey = array_shift($keys)) {\n\t\t\tif (!array_key_exists($arrayKey, $arrayPointer)) {\n\t\t\t\t$arrayPointer[$arrayKey] = array();\n\t\t\t}\n\t\t\t$arrayPointer = &$arrayPointer[$arrayKey];\n\t\t}\n\n\t\t// Set the final key\n\t\t$arrayPointer[$lastKey] = $value;\n\t}", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function __set(string $key, $val): void;", "public function testUpdateKey()\n {\n }", "public function set($key, $value) {\n\n }", "public function setWrapperArgument($key, $value) {\n\t\t$this->arguments[$key] = $value;\n\t}", "public function set(string $key, $val, array &$array): void\n {\n $keys = explode('.', $key);\n $context = &$array;\n foreach ($keys as $ikey) {\n $context = &$context[$ikey];\n }\n\n $context = $val;\n }", "public function __set($key, $val)\n {\n\t\t$this->_setSmartyParams($key, $val);\n }", "public function setContext(string $key, $value);", "public function setLeftValue(BaseObject $node, $value)\n {\n $setter = self::forgeMethodName($node, 'set', 'left');\n return $node->$setter($value);\n }" ]
[ "0.59534645", "0.5910818", "0.58937365", "0.5745962", "0.5711098", "0.56755334", "0.56295234", "0.5579479", "0.55527425", "0.5552355", "0.55518085", "0.5463582", "0.54386973", "0.54386973", "0.5418863", "0.53951", "0.53818417", "0.53740895", "0.5357869", "0.53376144", "0.52868384", "0.52450234", "0.52386814", "0.5221218", "0.52191466", "0.521522", "0.52103823", "0.52103823", "0.52039695", "0.51775", "0.51479435", "0.51473594", "0.51345557", "0.5124928", "0.51184684", "0.51086724", "0.5101804", "0.5095802", "0.5095802", "0.50753254", "0.5071999", "0.50712204", "0.50519836", "0.50437915", "0.50422007", "0.50414836", "0.50357646", "0.5031111", "0.5029718", "0.5016862", "0.5001408", "0.499116", "0.49891707", "0.49850318", "0.49827906", "0.49774396", "0.49766007", "0.49762616", "0.49685082", "0.49606997", "0.49583197", "0.49451736", "0.4944856", "0.4939327", "0.49359018", "0.4932688", "0.49316797", "0.49229008", "0.49229008", "0.4920611", "0.4920216", "0.48966357", "0.48814523", "0.4881273", "0.48758385", "0.4866201", "0.4865841", "0.4865841", "0.4865841", "0.4865841", "0.4865841", "0.4865841", "0.4865841", "0.4865841", "0.4865841", "0.4865841", "0.4865841", "0.4865841", "0.4865841", "0.4865841", "0.4865841", "0.4865841", "0.4865841", "0.4864168", "0.4861653", "0.48616165", "0.48488376", "0.48452026", "0.4840547", "0.48387468", "0.48379272" ]
0.0
-1
Function that checks the data type of the first and last elements of an array, and returns false if they don't match
private static function checkDataType($array) { if(count($array) <= 1) { return true; } $last = count($array) - 1; $type = self::getCustomDataType($array[$last]); if ($type != self::getCustomDataType($array[0])) { return false; } else { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function strictTypeCheckForArrayElements(array $arr)\n {\n $firstType = null;\n\n foreach ($arr as $item) {\n if ($firstType == null) {\n $firstType = $this->detectType($item);\n } else {\n if ($firstType != $this->detectType($item)) {\n return false;\n }\n }\n }\n\n return true;\n }", "public static function arrayOfArray( $array )\n {\n $arr = array_shift( $array );\n // Checks to see if first item of the array is an array.\n if( is_array( $arr ) )\n {\n // First item is we assume the rest are.\n return true;\n }\n else\n {\n // First item isn't, we assume the rest are not.\n return false;\n }\n }", "function rest_is_array($maybe_array)\n {\n }", "function wpsl_is_multi_array( $array ) {\n\n foreach ( $array as $value ) {\n if ( is_array( $value ) ) return true;\n }\n\n return false;\n}", "protected function is_single($data){\n foreach ($data as $value){\n if (is_array($value)){\n return false;\n }\n return true;\n }\n }", "private function validateArrayElement($element, $type) {\n\n return gettype($element) == $type ? true : false;\n\n }", "function acf_is_array($array)\n{\n}", "public function validDataTypes();", "function acf_is_sequential_array($array)\n{\n}", "function is_numeric_array(iterable $array): bool\n{\n foreach ($array as $key => $_) {\n if (!is_integer($key)) {\n return false;\n }\n }\n\n return true;\n}", "function isSpecialArray($arr)\n{\n for ($i = 0; $i < count($arr); $i++) {\n if ($i % 2 == 0) {\n if ($arr[$i] % 2 != 0) {\n return false;\n }\n } else {\n if ($arr[$i] % 2 == 0) {\n return false;\n }\n }\n }\n return true;\n}", "public function testIsArray() {\n\t\t$array = array('one' => 1, 'two' => 2);\n\t\t$result = _::isArray($array);\n\t\t$this->assertTrue($result);\n\n\t\t// test that an object is not an array\n\t\t$object = (object)$array;\n\t\t$result = _::isArray($object);\n\t\t$this->assertFalse($result);\n\t}", "function array_is_multi(array $array)\n {\n return (count($array) !== count($array, true));\n }", "function wp_is_numeric_array($data)\n {\n }", "private function process_array($value) {\n return is_array($value);\n }", "public static function isArraySequential(array $array) {\n\t\treturn (array_keys($array) === range(0, count($array) - 1));\n\t}", "function array_is_list(array $arr): bool\n {\n if ($arr === []) {\n return true;\n }\n return array_keys($arr) === range(0, count($arr) - 1);\n }", "private function _isArray($value) {\n return is_array($value) && array_keys($value) === range(0, sizeof($value) - 1);\n }", "protected function validateArray($value){\n\t\treturn is_array($value);\n\t}", "function isNumber($tableauPost) {\n unset($tableauPost['type']);\n $tableau = array();\n foreach ($tableauPost as $key => $value) {\n if (is_numeric($value)) { //is_numeric\n $tableau[] = $value;\n }\n }\n if (count($tableauPost) != count($tableau)) {\n return false;\n }\n else {\n return true;\n }\n}", "function isValid($array){\n return $array['format_valid'];\n }", "public function is_valid_vb_spec($data_array) {\n\n // Check that there are at least two rows.\n if ( count($data_array) < 2 ) {\n $this->notifier->add('There must be at least two rows in the '\n . 'uploaded dataset.', 'error');\n return false;\n }\n\n // Split the dataset into the header row and the rest of the sheet\n $header = $data_array[0]; // Just the first row\n $data_array = array_slice($data_array, 1); // Everything but the first row\n\n // Count the number of timepoint columns and check that there is\n // at least one.\n $num_timepoint_cols = count(self::ordered_columns_of_type($header, 0));\n if ($num_timepoint_cols < 1) {\n $this->notifier->add(esc_html('There must be at least one timepoint column. '\n . 'None were found. Note that syntax for timepoint column '\n . 'headers is strict: the fieldname must be machine-readable '\n . 'as a date. Try formats like \"2012\" or \"2012-08\" or \"3Q 2008\".'),\n 'error', 108);\n return false;\n }\n\n // Count the number of level columns and check that there is\n // at least one.\n $num_level_cols = count(self::ordered_columns_of_type($header, 1));\n if ($num_level_cols < 1) {\n $this->notifier->add(esc_html('There must be at least one LEVEL column. '\n . 'None were found. Note that syntax for LEVEL column '\n . 'headers is strict: the fieldname must be of the form '\n . 'LEVEL<N>, where <N> is an integer.'),\n 'error', 109);\n return false;\n }\n\n return true;\n }", "public static function arrayIsList(array $array): bool\n\t{\n\t\t$expectedKey = 0;\n\t\tforeach ($array as $i => $value) {\n\t\t\tif ($i !== $expectedKey) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$expectedKey++;\n\t\t}\n\n\t\treturn true;\n\t}", "protected function isList($array)\n {\n return array_keys($array) === range(0, count($array) - 1);\n }", "protected function isValidArray($array)\n {\n return (!is_null($array) && is_array($array) && count($array) > 0);\n }", "private function array_validator(array $data)\n {\n if (!array_key_exists(0, $data))\n {\n $this->is_valid = false;\n return false;\n }\n\n if ($data[0] === false)\n {\n $this->is_empty = true;\n return false;\n }\n\n if (!is_array($data[0]))\n {\n // 1 dimensional data -- diverge from typical here to\n // function for 1 dimensional data?\n }\n\n $this->columns = $this->set_columns(array_keys($data[0]));\n \n if (empty($this->columns))\n {\n $this->is_empty = false;\n return false;\n }\n\n $this->set_number_of_columns(count($this->columns));\n $number_of_rows = 0;\n\n foreach ($data as $row)\n {\n ++$number_of_rows;\n if (count(array_keys($row)) > $this->number_of_columns)\n {\n // invalid data\n // data must have same number of columns throughout.\n // although, there is a desgin decision here: it is possible\n // that this ought to be considered valid data, and a filling\n // of the data could be performed... *thinking on that*\n }\n \n foreach ($this->columns as $key)\n {\n if (!array_key_exists($key, $row))\n {\n // invalid data? or possibly same decison as above\n // and fill the data...\n }\n }\n }\n\n $this->set_number_of_rows($number_of_rows);\n\n // valid array. from here, either pass $data to a building function\n // or simply say $this->data = $data. unsure of design yet.\n }", "function hasArray($arr) {\r\n\tforeach ($arr as $value) {\r\n\t\tif(is_array($value))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "public static function end($array)\n {\n $count = count($array);\n $count = $count > 0 ? $count - 1 : 0;\n $newArr = array_slice($array, $count, 1);\n\n return !empty($newArr[0]) ? $newArr[0] : false;\n }", "public function test_array_returns_true_when_not_optional_and_input_array() {\n\t\t$optional = false;\n\n\t\t$result = self::$validator->validate( array('test','test2'), $optional );\n\t\t$this->assertTrue( $result );\n\t}", "protected function _check($data)\n {\n if ($this->_count != 0) {\n $this->_type($data);\n } elseif (is_array($data)) {\n $this->_type($data);\n }\n }", "private function isNumericArray($array) {\n foreach ($array as $a => $b) {\n if (!is_int($a)) {\n return false;\n }\n }\n\n return true;\n }", "function isMultiDimentionalArray(array $array):bool\n{\n if (count($array) == count($array, COUNT_RECURSIVE))\n {\n return false;\n }else{\n return true;\n }\n}", "function checkForDataTypes($modifyModel = false) {\n $res = true;\n foreach ($this->listFields() as $fieldName) {\n $fieldInfo = $this->getFieldInfo($fieldName);\n $res = $this->_checkForDataType($fieldName, $fieldInfo, $modifyModel) && $res; \n }\n return $res;\n }", "private function isValidData($data) {\n\t\tif (!is_string($data) && !is_int($data) && !is_float($data) && !is_array($data)) {\n\t\t\tthrow new FlintstoneException('Invalid data type');\n\t\t}\n\n\t\treturn true;\n\t}", "function isArray($token) {\n $len = strlen($token);\n return $len >= 2 && '[' == $token[0] && ']' == $token[$len - 1];\n }", "public static function isSerializedArray($data)\n {\n return $data === null || (is_string($data) && preg_match('/^a:[0-9]+:{.*;}$/s', $data));\n }", "function is_array_numeric($array) {\n\n\tforeach ($array as $item) {\n\t\tif (!is_numeric($item)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isSequentialArray(array $array) {\n\treturn !$array || (\\array_keys($array) === \\range(0, \\count($array) - 1));\n}", "public function test_array_returns_true_when_optional_and_input_array() {\n\t\t$optional = true;\n\n\t\t$result = self::$validator->validate( array('test','test2'), $optional );\n\t\t$this->assertTrue( $result );\n\t}", "private function isDateType(array $type): bool\n {\n foreach ($type as $def) {\n if (strpos($def, 'Date') !== false) {\n return true;\n }\n }\n\n return false;\n }", "public function analyseArray($array){\n for($i=0;$i<count($array);$i++){\n if(is_numeric($array[$i]) || $array[$i]==\"\" || (int)($array[$i+1])<=0 || (int)($array[$i+1])>=100){\n $this->price=0;\n return True;\n }\n elseif((int)($array[$i+1])<=12){\n $this->price=$this->price+10;\n }\n else{\n $this->price=$this->price+15;\n }\n //For one loop the function analyses 2 elements\n $i=$i+1;\n }\n if($this->box){\n $this->price=$this->price+20;\n }\n return False;\n }", "private function valid_team_array() {\r\n if (!is_array($this->teams) || count($this->teams) < 2) {\r\n $this->error = 'Not enough teams in array shape passed';\r\n $this->reset_class_state();\r\n return false;\r\n }\r\n return true;\r\n }", "private function isInvalidArray($input) {\n\n return !is_array($input) || empty($input);\n }", "protected function is_type( $mf_array, $type ) {\n\t\treturn is_array( $mf_array ) && ! empty( $mf_array['type'] ) && is_array( $mf_array['type'] ) && in_array( $type, $mf_array['type'], true );\n\t}", "public function testEvaluateFailsWhenArrayNotSame(): void\n {\n $actual = [\n 'random' => 'value',\n 'date' => new DateTime('2019-10-10T01:01:01Z'),\n 'deep' => [\n 'deeper' => [\n 'date' => new DateTime('2019-10-10T00:00:00+0000'),\n ]\n ]\n ];\n\n $expected = [\n 'random' => 'value',\n 'date' => new DateTime('2019-10-10T00:00:00Z'),\n 'deep' => [\n 'deeper' => [\n 'date' => new DateTime('2019-10-10T00:00:00+0000'),\n ]\n ]\n ];\n\n $constraint = new ArraySameWithDates($expected);\n $result = $constraint->evaluate($actual, '', true);\n\n self::assertFalse($result);\n }", "function _field_checkarray_or($fval) \n {\n return $this->_field_checkarray($fval, 1);\n }", "public function check(array $data) {\n $filtered = $this->run($data);\n $chunked = $this->chunk($filtered);\n // build errors\n\t\t$errors = static::array_substitute($chunked, $this->messages);\n // remove null values, just keep errors as null values in errors means no error\n\t\t$msg = static::array_filter_recursive($errors, function($el) { return ! is_null($el); });\n // keep out empty arrays\n\t\t$msg = static::array_filter_recursive($msg, function($el) { return ! ( is_array($el) && empty($el));});\n // convert objects that repesents errors into arrays\n array_walk_recursive($msg, function(&$v, $k) { if (is_object($v)) $v = (array) $v;});\n\t\t$this->errors = $msg;\n\t\t$fail = ! empty($msg);\n\t\tif ($fail) return false;\n return $chunked;\n }", "protected function arrayIsList(array $array): bool\n {\n $encoded = json_encode($array);\n\n return false !== $encoded && $encoded[0] === '[';\n }", "function isAssocArray(array $arr)\r\n{\r\n return array_keys($arr) !== range(0, count($arr) - 1);\r\n}", "function last(array $array): mixed\n{\n return $array ? end($array) : null; // No falses.\n}", "public function testEvaluateReturnsEarlyWhenArraysSame(): void\n {\n $actual = [\n 'random' => 'value'\n ];\n\n $expected = [\n 'random' => 'value'\n ];\n\n $constraint = new ArraySameWithDates($expected);\n $result = $constraint->evaluate($actual, '', true);\n\n self::assertTrue($result);\n }", "public function isArray()\n {\n return \\is_array($this->value);\n }", "public function isValid() {\n\t\treturn !is_array($this->data) && count($this->data->getRawData()) > 0;\n\t}", "private function shouldSkipArray(\\PhpParser\\Node\\Expr\\Array_ $array) : bool\n {\n if (\\count($array->items) !== 2) {\n return \\true;\n }\n // can be totally empty in case of \"[, $value]\"\n if ($array->items[0] === null) {\n return \\true;\n }\n if ($array->items[1] === null) {\n return \\true;\n }\n return $this->isCallbackAtFunctionNames($array, ['register_shutdown_function', 'forward_static_call']);\n }", "private function isPlainArray($line) {\n\t//--\n\treturn (($line[0] == '[') && (substr($line, -1, 1) == ']'));\n\t//--\n}", "public function testLast()\r\n {\r\n self::assertEquals(3, Arr::last([1, 2, 3]));\r\n self::assertEquals('c', Arr::last(['a', 'b', 'c']));\r\n self::assertNotEquals('b', Arr::last(['a', 'b', 'c']));\r\n\r\n self::assertEquals(2, Arr::last([1, 2, 3], function ($value) {\r\n return $value === 2;\r\n }));\r\n self::assertEquals(null, Arr::last([1, 2, 3], function ($value) {\r\n return $value === 20;\r\n }));\r\n\r\n self::assertInternalType('int', Arr::last([1, 2, 3]));\r\n self::assertInternalType('string', Arr::last(['a', 'b', 'c']));\r\n }", "public static function isMultiArray( $arr ) {\n rsort( $arr );\n return isset( $arr[0] ) && is_array( $arr[0] );\n }", "function types_liaisons_existent($array){\n\tif (empty($array) or $array==array(''=>'')){\n\t\treturn '';\n\t}\n\treturn ' ';\n}", "public function validate(array $data);", "public function validate(array $data);", "public static function is_microformat_array( $mf ) {\n\t\treturn ( is_array( $mf ) && isset( $mf['items'] ) && is_array( $mf['items'] ) );\n\t}", "function isArray ($value)\r\n{\r\n\treturn is_array ($value);\r\n}", "public function testGetType0()\n{\n\n $actual = $this->array_->getType();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "private function isTrueArray($array) {\n if (is_array($array) && isset($array) && count($array)) {\n return TRUE;\n } else {\n return FALSE;\n }\n }", "function is_assoc_array(array $arr) {\n if (array() === $arr) return false;\n return array_keys($arr) !== range(0, count($arr) - 1);\n}", "function is_assoc_array(array $arr) {\n if (array() === $arr) return false;\n return array_keys($arr) !== range(0, count($arr) - 1);\n}", "function validateArrayValue($val) {\n\t\tif(!is_array($val)) return false;\n\t\t\n\t\t// Validate against Zend_Date,\n\t\t// but check for empty array keys (they're included in standard form submissions)\n\t\treturn (\n\t\t\tarray_key_exists('year', $val) \n\t\t\t&& (!$val['year'] || Zend_Date::isDate($val['year'], 'yyyy', $this->locale))\n\t\t\t&& array_key_exists('month', $val)\n\t\t\t&& (!$val['month'] || Zend_Date::isDate($val['month'], 'MM', $this->locale))\n\t\t\t&& array_key_exists('day', $val)\n\t\t\t&& (!$val['day'] || Zend_Date::isDate($val['day'], 'dd', $this->locale))\n\t\t);\n\t}", "public function testIsValid()\n {\n $this\n ->abstract\n ->expects($this->any())\n ->method('isValidType')\n ->with($this)\n ->will(\n $this->returnCallback(\n function ($object, $value) {\n return is_array($value);\n }\n )\n );\n\n $this->assertFalse(\n $this->abstract->isValid($this, null),\n 'A null value should not be valid.'\n );\n\n // force null as acceptable\n Property::set($this->abstract, 'nullable', true);\n\n $this->assertTrue(\n $this->abstract->isValid($this, null),\n 'A null value should be valid.'\n );\n\n $this->assertFalse(\n $this->abstract->isValid($this, 'This is a test.'),\n 'A string value should not be valid.'\n );\n\n $this->assertTrue(\n $this->abstract->isValid($this, array('This is a test.')),\n 'An array value should be valid.'\n );\n }", "protected function validate_array( $array, $prop, $schema ) {\n\t\tif ( ! wp_is_numeric_array( $array ) ) {\n\t\t\t$this->errors->add(\n\t\t\t\t$prop,\n\t\t\t\t__( 'This must be an array.', 'wporg' )\n\t\t\t);\n\t\t\t$this->append_error_data( $prop, 'error' );\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$results = array();\n\n\t\tif ( isset( $schema['minItems'] ) ) {\n\t\t\tif ( count( $array ) < $schema['minItems'] ) {\n\t\t\t\t$this->errors->add(\n\t\t\t\t\t$prop,\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'This must contain at least %d item.',\n\t\t\t\t\t\t\t'This must contain at least %d items.',\n\t\t\t\t\t\t\tabsint( $schema['minItems'] ),\n\t\t\t\t\t\t\t'wporg'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnumber_format_i18n( floatval( $schema['minItems'] ) )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->append_error_data( $prop, 'error' );\n\t\t\t\t$results[] = false;\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $schema['maxItems'] ) ) {\n\t\t\tif ( count( $array ) > $schema['maxItems'] ) {\n\t\t\t\t$this->errors->add(\n\t\t\t\t\t$prop,\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'This must contain at most %d item.',\n\t\t\t\t\t\t\t'This must contain at most %d items.',\n\t\t\t\t\t\t\tabsint( $schema['minItems'] ),\n\t\t\t\t\t\t\t'wporg'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnumber_format_i18n( floatval( $schema['maxItems'] ) )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->append_error_data( $prop, 'error' );\n\t\t\t\t$results[] = false;\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $schema['items']['type'] ) ) {\n\t\t\t$index = 0;\n\n\t\t\tforeach ( $array as $item ) {\n\t\t\t\t$results[] = $this->route_validation_for_type(\n\t\t\t\t\t$schema['items']['type'],\n\t\t\t\t\t$item,\n\t\t\t\t\t$prop . \"[$index]\",\n\t\t\t\t\t$schema['items']\n\t\t\t\t);\n\t\t\t\t$index ++;\n\t\t\t}\n\t\t}\n\n\t\treturn ! in_array( false, $results, true );\n\t}", "function isProps( $arr ){\n $test = array_values($arr)[0];\n\n return is_array($arr) \n && is_string($test)\n && !preg_match(\"/<\\/|\\/>/\", $test);\n}", "static function is_numeric($array){\n\t\tforeach($array as $k=>$v){\n\t\t\tif(!is_int($k)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function is_numerically_indexed_array( $arr ){\n\t\t\n\t\tforeach($arr as $key=>$val){\n\t\t\tif( !is_numeric($key) ){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "function has_no_sub_arrays($array) {\n if (!is_array($array)) {\n return true;\n }\n foreach ($array as $sub) {\n if (is_array($sub)) {\n return false;\n }\n }\n return true;\n}", "public static function IsValidDates($dttDateArray) {\n\t\t\tfor ($intIndex = 0; $intIndex < count($dttDateArray); $intIndex++) {\n\t\t\t\t// Start Date must be later than previous's Start Date and End Date\n\t\t\t\tif ($intIndex > 0) {\n\t\t\t\t\tif ($dttDateArray[$intIndex][0]->IsEarlierThan($dttDateArray[$intIndex-1][0])) return false;\n\t\t\t\t\tif (!$dttDateArray[$intIndex-1][1]) return false;\n\t\t\t\t\tif ($dttDateArray[$intIndex][0]->IsEarlierThan($dttDateArray[$intIndex-1][1])) return false;\n\t\t\t\t}\n\n\t\t\t\t// End Date must be later than start date (if applicable)\n\t\t\t\tif ($dttDateArray[$intIndex][1]) {\n\t\t\t\t\tif ($dttDateArray[$intIndex][0]->IsLaterThan($dttDateArray[$intIndex][1])) return false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "public static function isOneOrMany(array $array) {\n return (count($array) === 0)\n ? false\n : array_keys($array) !== range(0, count($array) - 1);\n }", "public function testGetArrayNumbers()\n\t{\n\t\t$this->assertIsArray(ParityGame\\getArrayNumbers());\n\t\t$this->assertFalse(empty(ParityGame\\getArrayNumbers()));\n\t}", "private function isArrayElement($line) {\n\t//--\n\tif(!$line) {\n\t\treturn false;\n\t} //end if\n\t//--\n\tif($line[0] != '-') {\n\t\treturn false;\n\t} //end if\n\t//--\n\tif(strlen($line) > 3) {\n\t\tif(substr($line, 0, 3) == '---') {\n\t\t\treturn false;\n\t\t} //end if\n\t} //end if\n\t//--\n\treturn true;\n\t//--\n}", "final protected function shouldBeFlatArray ($value) {\n\t\t$arguments = func_get_args();\n\t\tforeach ($arguments as $argument) {\n\t\t\tif (!is_array($argument)) {\n\t\t\t\treturn $this->fail();\n\t\t\t} else {\n\n\t\t\t\t// Fail if child array key found\n\t\t\t\tforeach ($argument as $child) {\n\t\t\t\t\tif (is_array($child)) {\n\t\t\t\t\t\treturn $this->fail();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn $this->pass();\n\t}", "public function validateOperationData(array $data): bool\n {\n if (count($data) < 6) {\n return false;\n }\n\n $date = self::validateDate($data[0]);\n $userType = self::validateUserType($data[2]);\n $operationType = self::validateOperationType($data[3]);\n $amount = self::validateAmount($data[4]);\n $currency = self::validateCurrency($data[5]);\n\n if (!$date || !$userType || !$operationType || !$amount || !$currency) {\n return false;\n }\n\n return true;\n }", "protected function isArrayStartDelimiter()\n {\n switch ($this->tokenizer->peek()) {\n case Tokens::T_ARRAY:\n case Tokens::T_SQUARED_BRACKET_OPEN:\n return true;\n }\n\n return false;\n }", "function isOk($arr) {\n return count(array_filter($arr)) == 0;\n }", "protected function validateArray(array $data, array $structure) : bool\n {\n // the array can't contain any values we're not expecting\n if(!empty(array_diff_key($data, $structure))) {\n return false;\n }\n\n // recursively perform the same validation on any nested arrays\n foreach($data as $dataIndex => $dataValue) {\n if(is_array($dataValue) && $this->_isAssociative($dataValue)) {\n $nestedStructure = [];\n $regex = '/^' . $dataIndex . '.(\\w+)/';\n\n foreach($structure as $structureIndex => $structureValue) {\n if(preg_match($regex, $structureIndex)) {\n $newIndex = preg_replace($regex, '$1', $structureIndex);\n $nestedStructure[$newIndex] = $structureValue;\n }\n }\n\n if(!$this->validateArray($dataValue, $nestedStructure)) {\n return false;\n }\n }\n }\n\n return true;\n }", "function emptyArray($beginTimeA, $endTimeA){\n if(count($beginTimeA) == 0) {\n return true;\n }\n else {\n return false;\n }\n}", "public function isMulti()\n {\n return $this->filter('is_scalar')->length !== $this->length;\n }", "function checkarray($arr1,$arr2,$val,$out,$nummod,$startrot,$endrot)\n {\n $flagfirst=\"true\";\n $flagsecond=\"true\";\n\n for($i=$startrot;$i<=$endrot;$i++)\n {\n $array1='';\n $array2='';\n if($i!=$arr2) // second array value\n {\n $array1=$arr1.\",\".$i;\n\n if($out[$array1][0]==$val OR $out[$array1][1]==$val) // first array 1,2 get 1\n {\n\n $flagfirst=\"false\";\n break;\n }\n }\n\n }\n\n for($i=1;$i<=$nummod;$i++)\n {\n $array1='';\n $array2='';\n\n $array2=$i.\",\".$arr2;\n if($out[$array2][0]==$val OR $out[$array2][1]==$val) // first array 1,2 get 1\n {\n $flagsecond=\"false\";\n break;\n }\n }\n\n if($flagfirst==\"false\" OR $flagsecond==\"false\")\n {\n return \"false\";\n }\n else \n {\n return \"true\";\n }\n }", "function validate(array $data)\n\t{\n\t}", "public function isIntegerInRangeRejectsOtherDataTypesDataProvider() {}", "public function testIncompatibleArrays2(): void\n {\n $this->expectException(IncompatibleVariableTypesException::class);\n $this->expectErrorMessage(\"Incompatible types 'MIXED' and 'SCALAR[INTEGER]'\");\n $this->unify(\n $this->createSequenceArray($this->createMixed()),\n $this->createSequenceArray($this->createInteger())\n );\n }", "function isStruct($array)\n {\n }", "public function test_array_returns_true_when_optional_and_input_empty() {\n\t\t$optional = true;\n\n\t\t$result = self::$validator->validate( null, $optional );\n\t\t$this->assertTrue( $result );\n\t}", "public function check() : bool\n {\n $validTypes = [...Type::numeric(), Type::STRING, Type::ARRAY];\n if (!in_array($this->property->getType(), $validTypes)) {\n return false;\n }\n\n [$min, $max] = $this->getMinMax();\n return isset($max) && $max !== $min;\n }", "function validate_coordonates($floats){\n\n\t$valid = true;\n\n\t$str = explode(',', $floats);\n\t$lat = floatval($str[0]);\n\t$lon = floatval($str[1]);\n\n\tif( count($str) > 0 && is_numeric($lat) && is_numeric($lon) ){\n\t\t// str is an array and lat & lon contain numeric strings...\n\n\t\t// check if strings contain only -,. and integer\n\t\t$string = str_split($floats);\n\t\t$period = 0;\n\t\tforeach($string as $k => $char){\n\t\t\tif( is_numeric($char) || $char === '-' || $char === ',' || $char === '.' || $char === ' ' ){\n\t\t\t\t// contain only ok chars\n\n\t\t\t\tif( $char === ',' ){\n\t\t\t\t\tif($string[$k+1] !== ' '){\n\t\t\t\t\t\t// there is no space near ,\n\t\t\t\t\t\t$valid = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif( $char === '-' ){\n\t\t\t\t\tif( !is_numeric($string[$k+1]) ){\n\t\t\t\t\t\t// there is no numeric char near -\n\t\t\t\t\t\t$valid = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif( $char === '.' ){\n\t\t\t\t\t$period++;\n\t\t\t\t}\n\n\t\t\t\tif( $period > 2 ){\n\t\t\t\t\t$valid = false;\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$valid = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif( $lat > -90 && $lat <= 90 && $valid === true){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\n\t\tif( $lon > -180 && $lon <= 180 && $valid === true ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}else{\n\t\treturn false;\n\t}\n}", "public static function inArray($item1, $item2)\n {\n\n // if two items are identical, then one is contained in the other\n if ($item1 === $item2)\n return true;\n\n // consider two nulls to be the same\n if (!isset($item1) && !isset($item2))\n return true;\n\n // if we have two values and they have different values, return false;\n // if we have two items where one is a value and the other is not,\n // return false\n $is_value1 = !is_array($item1) && !is_object($item1);\n $is_value2 = !is_array($item2) && !is_object($item2);\n\n if ($is_value1 === true && $is_value2 === true)\n {\n if ($item1 === $item2)\n return true;\n if ((is_int($item1) || is_float($item1)) && (is_int($item2) || is_float($item2)))\n {\n if (\\Flexio\\Tests\\Util::dblcompare((float)$item1, (float)$item2) == 0)\n return true;\n }\n return false;\n }\n if ($is_value1 === false && $is_value2 === true)\n return false;\n if ($is_value1 === true && $is_value2 === false)\n return false;\n\n // we're working with arrays or objects; cast them to arrays for\n // easy comparison\n $array1 = (array)$item1;\n $array2 = (array)$item2;\n\n // check if the input arrays are sequential or associative\n $is_associative_array1 = \\Flexio\\Base\\Util::isAssociativeArray($array1);\n $is_associative_array2 = \\Flexio\\Base\\Util::isAssociativeArray($array2);\n\n // if the two arrays are not of the same type, then array2 is\n // not contained in array1\n if ($is_associative_array1 !== $is_associative_array2)\n return false;\n\n // the two arrays are either both sequential or associative;\n // if they're sequential, make sure that the values of array2\n // are contained in array1; if they're associative, make sure\n // that the key/value pairs of array2 are in array1\n\n if ($is_associative_array2 === true)\n {\n foreach ($array2 as $key2 => $value2)\n {\n if (array_key_exists($key2, $array1) === false)\n return false;\n\n if (self::inArray($array1[$key2], $value2) === false)\n return false;\n }\n\n return true;\n }\n else\n {\n foreach ($array2 as $key2 => $value2)\n {\n $is_included = false;\n foreach ($array1 as $key1 => $value1)\n {\n if (self::inArray($value1, $value2) === false)\n continue;\n\n $is_included = true;\n break;\n }\n\n if ($is_included === false)\n return false;\n }\n\n return true;\n }\n\n return false;\n }", "public function isLastPartOfStringReturnsTrueForMatchingFirstPartDataProvider() {}", "public function isSequentialArray($array)\n {\n $counter = 0;\n foreach ($array as $key => $value) {\n if ($counter !== $key) {\n return false;\n }\n $counter++;\n }\n\n return true;\n }", "protected function arrayIsObject(array $array): bool\n {\n $encoded = json_encode($array);\n\n return false !== $encoded && $encoded[0] === '{';\n }", "function is_sorted($array) {\n $prev = $array[0];\n for ($i = 0; $i < count($array); $i++) {\n if ($prev > $array[$i]) return false;\n $prev = $array[$i];\n }\n return true;\n}", "function isAssoc(array $array): bool\n{\n if (empty($array)) {\n return false;\n }\n\n return ctype_digit(implode('', array_keys($array))) === false;\n}", "public static function isValidValue($value) {\n return is_array($value);\n }", "protected function isLiteralValid(array $literal)\n {\n // Matrix must have at least one row\n if (!count($literal)) {\n return false;\n }\n\n // Matrix must have at least one column\n if (!count($literal[0])) {\n return false;\n }\n\n // Matrix must have the same number of columns in each row\n $lastRow = false;\n\n foreach ($literal as $row) {\n $thisRow = count($row);\n\n if ($lastRow !== false && $lastRow != $thisRow) {\n return false;\n }\n\n $lastRow = $thisRow;\n }\n\n return true;\n }" ]
[ "0.6298559", "0.615921", "0.5957354", "0.59457254", "0.58980423", "0.5851669", "0.5833901", "0.58093876", "0.58070546", "0.57576126", "0.5728989", "0.5707374", "0.57060564", "0.5696079", "0.5689695", "0.5674041", "0.5648677", "0.5629497", "0.558549", "0.55695766", "0.5546822", "0.5543256", "0.5540864", "0.55231136", "0.5520908", "0.5499663", "0.5494497", "0.5493237", "0.5483982", "0.5455354", "0.54373676", "0.54132426", "0.54127896", "0.54014534", "0.53822535", "0.5378867", "0.53782344", "0.53701824", "0.5367493", "0.5333475", "0.53188413", "0.5304046", "0.5300644", "0.52960634", "0.52846444", "0.5279386", "0.52784437", "0.52775097", "0.52769655", "0.5275908", "0.52741146", "0.52579755", "0.525206", "0.5248971", "0.5235928", "0.5226336", "0.52238834", "0.520637", "0.52025265", "0.52025265", "0.5174475", "0.5167834", "0.5164386", "0.516295", "0.5152781", "0.5152781", "0.51432014", "0.51407534", "0.51362944", "0.51331604", "0.51278067", "0.5108902", "0.51027054", "0.5099183", "0.50935936", "0.50933677", "0.50920236", "0.50841874", "0.50732577", "0.5072324", "0.5067262", "0.5051182", "0.50384074", "0.5036578", "0.50348055", "0.5032483", "0.5012694", "0.5009124", "0.5007278", "0.50072324", "0.5004613", "0.5002775", "0.49901116", "0.49869207", "0.49842587", "0.49815947", "0.49802583", "0.49777368", "0.49722597", "0.49676996" ]
0.78253275
0
Returns the data type of a variable
private static function getCustomDataType($val) { if (!is_array($val)) { $type = "date"; } else { $type = gettype($val); } return $type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDatatype() {}", "function get_type(mixed $var, bool $scalars = false): string\n{\n if ($scalars && is_scalar($var)) {\n return 'scalar';\n }\n return get_debug_type($var);\n}", "public function getDataType(): string\n {\n return $this->col->getAttribute('data-type');\n }", "public final function getDataType () {\n // Do return ...\n return new S (gettype ($this->varContainer));\n }", "public function getDataType()\n {\n return $this->data_type;\n }", "function data_type($type) {\r\n\t\t$return_value = '';\r\n\t\t$type = (string) $type;\r\n\r\n\t\tswitch (strtolower($type)) {\r\n\t\t\t// supported scalar types\r\n\t\t\tcase 'ENTITIES':\r\n\t\t\tcase 'ENTITY':\r\n\t\t\tcase 'ID':\r\n\t\t\tcase 'IDREF':\r\n\t\t\tcase 'IDREFS':\r\n\t\t\tcase 'NCName':\r\n\t\t\tcase 'NMTOKEN':\r\n\t\t\tcase 'NMTOKENS':\r\n\t\t\tcase 'Name':\r\n\t\t\tcase 'anySimpleType':\r\n\t\t\tcase 'anyType':\r\n\t\t\tcase 'base64':\r\n\t\t\tcase 'base64Binary':\r\n\t\t\tcase 'boolean':\r\n\t\t\tcase 'byte':\r\n\t\t\tcase 'date':\r\n\t\t\tcase 'dateTime':\r\n\t\t\tcase 'decimal':\r\n\t\t\tcase 'double':\r\n\t\t\tcase 'duration':\r\n\t\t\tcase 'float':\r\n\t\t\tcase 'gDay':\r\n\t\t\tcase 'gMonth':\r\n\t\t\tcase 'gMonthDay':\r\n\t\t\tcase 'gYear':\r\n\t\t\tcase 'gYearMonth':\r\n\t\t\tcase 'hexBinary':\r\n\t\t\tcase 'i4':\r\n\t\t\tcase 'int':\r\n\t\t\tcase 'integer':\r\n\t\t\tcase 'language':\r\n\t\t\tcase 'long':\r\n\t\t\tcase 'negativeInteger':\r\n\t\t\tcase 'nonNegativeInteger':\r\n\t\t\tcase 'nonPositiveInteger':\r\n\t\t\tcase 'normalizedString':\r\n\t\t\tcase 'positiveInteger':\r\n\t\t\tcase 'short':\r\n\t\t\tcase 'string':\r\n\t\t\tcase 'time':\r\n\t\t\tcase 'timeInstant':\r\n\t\t\tcase 'token':\r\n\t\t\tcase 'unsignedByte':\r\n\t\t\tcase 'unsignedInt':\r\n\t\t\tcase 'unsignedLong':\r\n\t\t\tcase 'unsignedShort':\r\n\t\t\tcase 'ur-type':\r\n\t\t\t\t$return_value = 'xsd:' . $type;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\r\n\t\t\t\tforeach ($this->types as $id => $type_definition) {\r\n\r\n\t\t\t\t\tif ($type_definition['name'] == $type) {\r\n\t\t\t\t\t\t$return_value = 'tns:' . $type;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t} // end: if\r\n\t\t\t\t} // end: foreach\r\n\t\t} // end: switch\r\n\r\n\t\treturn $return_value;\r\n\t}", "public function get_datatype() {\n return $this->datatype;\n }", "function getType() \n {\n return $this->getValueByFieldName( 'statevar_type' );\n }", "public function getDataType() {}", "public static function getType($var)\n {\n if (is_object($var)) {\n return get_class($var);\n }\n if ($var === null) {\n return 'null';\n }\n if (is_string($var)) {\n return 'string';\n }\n if (is_array($var)) {\n return 'array';\n }\n if (is_int($var)) {\n return 'integer';\n }\n if (is_bool($var)) {\n return 'boolean';\n }\n if (is_float($var)) {\n return 'float';\n }\n if (is_resource($var)) {\n return 'resource';\n }\n return 'unknown';\n }", "protected function convertVarType($var) {\n\t\t$var = (string) $var;\n\t\tif ( is_numeric($var) ) {\n\t\t\t$var = (int) $var;\n\t\t} elseif ( strtolower($var) == 'true' || strtolower($var) == 'false' ) {\n\t\t\t$var = (strtolower($var)=='true') ? true : false;\n\t\t}\n\t\treturn $var;\n\t}", "public function getDataType()\n {\n return $this->_fields['DataType']['FieldValue'];\n }", "public static function type($var) : string\n\t{\n\t\treturn is_object($var) ? get_class($var) : gettype($var);\n\t}", "public function getDataType()\n {\n return $this->dataType;\n }", "public function getDataType()\n {\n return $this->dataType;\n }", "public function getDataType()\n {\n return $this->dataType;\n }", "public function getDataType()\n {\n return $this->dataType;\n }", "public function getType()\n {\n $rtn = $this->data['type'];\n\n return $rtn;\n }", "public function getDataType() {\n\t\treturn $this -> dataType;\n\t}", "public function getType()\n {\n return $this->_value->getType();\n }", "public function getValueType();", "public static function data_type() {\n\n\t\treturn 'string';\n\t}", "function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}", "public function getType()\n {\n $result = \"\";\n if (preg_match('/int/',$this->type))\n $result = \"int\";\n\n if (preg_match('/year/',$this->type))\n $result = \"int\";\n\n if (preg_match('/integer/',$this->type))\n $result = \"int\";\n\n if (preg_match('/tynyint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/smallint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/mediumint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/bigint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/varchar/',$this->type))\n $result = \"string\";\n\n if (preg_match('/char/',$this->type))\n $result = \"string\";\n\n if (preg_match('/text/',$this->type))\n $result = \"string\";\n\n if (preg_match('/tyntext/',$this->type))\n $result = \"string\";\n\n if (preg_match('/mediumtext/',$this->type))\n $result = \"string\";\n\n if (preg_match('/longtext/',$this->type))\n $result = \"string\";\n\n if (preg_match('/char/',$this->type))\n $result = \"string\";\n\n if (preg_match('/enum/',$this->type))\n $result = \"enum\";\n\n if (preg_match('/set/',$this->type))\n $result = \"string\";\n\n if (preg_match('/date/',$this->type))\n $result = \"date\";\n\n if (preg_match('/time/',$this->type))\n $result = \"time\";\n\n if (preg_match('/datetime/',$this->type))\n $result = \"datetime\";\n\n if (preg_match('/decimal/',$this->type))\n $result = \"float\";\n\n if (preg_match('/float/',$this->type))\n $result = \"float\";\n\n if (preg_match('/double/',$this->type))\n $result = \"double\";\n\n if (preg_match('/real/',$this->type))\n $result = \"real\";\n\n if (preg_match('/fixed/',$this->type))\n $result = \"float\";\n\n if (preg_match('/numeric/',$this->type))\n $result = \"float\";\n\n if (empty($result)){\n // $result = $this->type;\n $result = \"string\";\n }\n\n // TODO EVALUATES BIT, TIMESTAMP, VARBINARY, BLOB MySQL data types\n return $result;\n }", "function getType() ;", "function getType() ;", "function getType() ;", "public function getDataType() {\n return $this->dataType;\n }", "public function getType()\n {\n $value = $this->get(self::TYPE);\n return $value === null ? (integer)$value : $value;\n }", "public function getDataType(): string;", "public function getDataType(): string;", "public static function getTypeFromPHPVariable($variable)\n {\n if (is_object($variable)) {\n if ($variable instanceof \\DateTime) {\n return self::getType('date');\n } else if ($variable instanceof \\MongoId) {\n return self::getType('id');\n }\n } else {\n $type = gettype($variable);\n switch ($type) {\n case 'integer';\n return self::getType('int');\n }\n }\n return null;\n }", "private function GetType($value){\n\t\tswitch (true) {\n\t\t\tcase is_int($value):\n\t\t\t\t$type = PDO::PARAM_INT;\n\t\t\t\tbreak;\n\t\t\tcase is_bool($value):\n\t\t\t\t$type = PDO::PARAM_BOOL;\n\t\t\t\tbreak;\n\t\t\tcase is_null($value):\n\t\t\t\t$type = PDO::PARAM_NULL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$type = PDO::PARAM_STR;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $type;\n\t}", "public function type();", "public function type();", "public function type();", "public function type();", "public static function getShallowType($data) : string\n {\n $type = gettype($data);\n if (in_array($type, ['integer', 'double', 'float']) || $type === 'string' && is_numeric($data)) {\n $type = 'number';\n }\n if ($type === 'NULL') {\n $type = 'boolean';\n }\n if (in_array($type, ['unknown type', 'resouce', 'resource (closed)'])) {\n $type = 'unknown';\n }\n return $type;\n }", "public function getVariableType(ParsedDocument $document, Variable $variable): ?string\n {\n if ($variable->name === 'this') {\n return $document->getClassName();\n }\n\n $closestVariable = $this->findClosestVariableReferencesInDocument($variable, $document);\n\n if ($closestVariable === null) {\n return null;\n }\n\n return $this->getType($document, $closestVariable);\n }", "public function data_type($type) {\n\t\tstatic $types = array(\n\t\t\t'BIT' => array('type' => 'Binary', 'max_length' => 1, 'nullable' => FALSE),\n\t\t\t'DATETIME' => array('type' => 'Integer'),\n\t\t\t'IMAGE' => array('type' => 'Blob', 'max_length' => 2147483647),\n\t\t\t'MONEY' => array('type' => 'Decimal', 'precision' => 18, 'scale' => 4),\n\t\t\t'NTEXT' => array('type' => 'Text', 'max_length' => '1073741823'),\n\t\t\t'SMALLDATETIME' => array('type' => 'Integer'),\n\t\t\t'SMALLMONEY' => array('type' => 'Decimal', 'precision' => 10, 'scale' => 4),\n\t\t\t'SQL_VARIANT' => array('type' => 'Blob', 'varying' => TRUE),\n\t\t\t//'TABLE' => array('type' => 'Table'),\n\t\t\t'TINYINT' => array('type' => 'Integer', 'range' => array(0, 255)),\n\t\t\t'UNIQUEIDENTIFIER' => array('type' => 'String', 'max_length' => 38),\n\t\t);\n\n\t\t$type = strtoupper($type);\n\n\t\tif (isset($types[$type])) {\n\t\t\treturn $types[$type];\n\t\t}\n\n\t\treturn parent::data_type($type);\n\t}", "public function get_type();", "protected static function astVarType(\n Context $context,\n $node\n ) : Type {\n\n // Check for $$var or ${...} (whose idea was that anyway?)\n if(($node->children[0] instanceof Node)\n && ($node->children[0]->kind == \\ast\\AST_VAR\n || $node->children[0]->kind == \\ast\\AST_BINARY_OP)\n ) {\n return new Type(['mixed']);\n }\n\n if($node->children[0] instanceof Node) {\n return Type::none();\n }\n\n $variable_name = $node->children[0];\n\n // if(empty($scope[$current_scope]['vars'][$node->children[0]])\n if (!$context->getScope()->hasVariableWithName($variable_name)) {\n if(!superglobal($variable_name))\n Log::err(\n Log::EVAR,\n \"Variable \\${$node->children[0]} is not defined\",\n $context->getFile(),\n $node->lineno\n );\n } else {\n $variable =\n $context->getScope()->getVariableWithName($variable_name);\n\n return $variable->getType();\n\n /*\n if(!empty($scope[$current_scope]['vars'][$node->children[0]]['tainted'])\n ) {\n $tainted_by =\n $scope[$current_scope]['vars'][$node->children[0]]['tainted_by'];\n $taint = true;\n }\n */\n }\n\n return Type::none();\n }", "function getType();", "function getType();", "function getType();", "function getType();", "function getType();", "public function hasVariableType() {\n return $this->_has(4);\n }", "public function hasVariableType() {\n return $this->_has(4);\n }", "private function getDataType(DOMNode $property) {\n\t\t$typeAttr = $property->attributes->getNamedItem('datatype');\n\t\tif (!$typeAttr) {\n\t\t\t$typeAttr = $property->attributes->getNamedItem('type');\n\t\t}\n\t\tif ($typeAttr) {\n\t\t\tif (\\strcasecmp($typeAttr->nodeValue, 'string') == 0) {\n\t\t\t\treturn 'string';\n\t\t\t} elseif (\\strcasecmp($typeAttr->nodeValue, 'number') == 0) {\n\t\t\t\treturn 'number';\n\t\t\t} elseif (\\strcasecmp($typeAttr->nodeValue, 'boolean') == 0) {\n\t\t\t\treturn 'boolean';\n\t\t\t} elseif (\\strcasecmp($typeAttr->nodeValue, 'array') == 0) {\n\t\t\t\treturn 'array';\n\t\t\t} elseif (\\strcasecmp($typeAttr->nodeValue, 'object') == 0) {\n\t\t\t\treturn 'object';\n\t\t\t} elseif (\\strcasecmp($typeAttr->nodeValue, 'null') == 0) {\n\t\t\t\treturn 'null';\n\t\t\t}\n\t\t}\n\t\tif ($property->hasChildNodes()) {\n\t\t\treturn 'object';\n\t\t}\n\t\treturn 'string';\n\t}", "public function getType() : string\n {\n $rtn = $this->data['type'];\n\n return $rtn;\n }", "public function getDataTypeAttribute(): string\n {\n return $this->config['data_type'];\n }", "private function get_type() {\n\n\t}", "function oci_field_type($statement, $field)\n{\n}", "public function getFieldDataType() {\n\t\t$fieldDataType = '';\n\t\t$uitype = $this->get('uitype');\n\t\tif ($uitype == '9') {\n\t\t\t$fieldDataType = 'percent';\n\t\t}\n\n\t\tif (!$fieldDataType) {\n\t\t\t$webserviceField = $this->getWebserviceFieldObject();\n\t\t\t$fieldDataType = $webserviceField->getFieldDataType();\n\t\t\tswitch($fieldDataType) {\n\t\t\t\tcase 'text' : $fieldDataType = 'textArea'; break;\n\t\t\t\tcase 'boolean' : $fieldDataType = 'checkBox'; break;\n\t\t\t case 'multipicklist' : $fieldDataType = 'multiSelectCombo'; break;\n\t\t\t}\n\t\t}\n\t\treturn $fieldDataType;\n\t}", "abstract public function getValueType();", "function recognize_data_type($string)\n{\n\t$string = mb_strtolower(trim($string), 'UTF-8');\n\n\t// if the data type is empty string or any of bool representations set it as bool\n\tif(empty($string) || is_bool(filter_var($string, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)))\n\t\treturn \"BIT\";\n\tif(is_int(filter_var($string, FILTER_VALIDATE_INT))) // else if int set as int\n\t\treturn \"INT\";\n\tif(is_float(filter_var($string, FILTER_VALIDATE_FLOAT))) // or float\n\t\treturn \"FLOAT\";\n\n\treturn \"NTEXT\"; // if neither of them set it to NTEXT (doesn't mather if it is attribute or not, it will be decided later)\n}", "public function getDataType(): ?string {\n $val = $this->getBackingStore()->get('dataType');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'dataType'\");\n }", "public function get_data_type()\n {\n if( is_null( $this->file_name ) ) return NULL;\n $pos = strrpos( $this->file_name, '.' );\n return false === $pos ? '' : substr( $this->file_name, $pos + 1 );\n }", "public static function typeOfValue($value)\n {\n if (is_null($value)) {\n return self::TYPE_NULL;\n }\n if (is_int($value)) {\n return self::TYPE_INT;\n }\n if (is_bool($value)) {\n return self::TYPE_BOOL;\n }\n return self::TYPE_STR;\n }", "protected function getDataType($value)\n {\n if (is_bool($value))\n {\n return PDO::PARAM_BOOL;\n }\n if (is_null($value))\n {\n return PDO::PARAM_NULL;\n }\n if (is_integer($value))\n {\n return PDO::PARAM_INT;\n }\n return PDO::PARAM_STR;\n }", "public function type() : int;", "public function getType()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'type'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'type'];\n\t\t}\n\t}", "protected function _determineType($var, $resultGraph)\n {\n $type = null;\n // find in namedGraphs\n if (!$var instanceof Literal) {\n $iter = $this->dataset->findInNamedGraphs(\n null,\n $var,\n new Resource(RDF_NAMESPACE_URI.'type'),\n null,\n true\n );\n while ($iter->valid()) {\n $statement = $iter->current();\n $type = $statement->getObject1();\n $resultGraph->add($iter->current());\n break;\n }\n }\n // if no type information found find in default graph\n if (!$type) {\n if (!$var instanceof Literal) {\n $iter1 = $this->dataset->findInDefaultGraph(\n $var,\n new Resource(RDF_NAMESPACE_URI.'type'),\n null\n );\n $type = null;\n while ($iter1->valid()) {\n $statement = $iter1->current();\n $type = $statement->getObject1();\n $resultGraph->add($iter1->current());\n break;\n }\n }\n }\n return $type;\n }", "function xmlrpc_get_type($value)\n{\n}", "function variant_get_type($variant) {}", "function getValueType($opts)\n{\n $type = empty($opts['t']) ? '' : strtolower($opts['t']);\n switch($type)\n {\n case '32':\n $type = NumberFormatter::TYPE_INT32;\n echo '::TYPE_INT32 data type requested' . PHP_EOL;\n break;\n\n case '64':\n $type = NumberFormatter::TYPE_INT64;\n echo '::TYPE_INT64 data type requested' . PHP_EOL;\n break;\n\n case 'f':\n $type = NumberFormatter::TYPE_DOUBLE;\n echo '::TYPE_DOUBLE data type requested' . PHP_EOL;\n break;\n\n case 'c':\n $type = NumberFormatter::TYPE_CURRENCY;\n echo '::TYPE_CURRENCY data type requested' . PHP_EOL;\n break;\n\n default:\n $type = NumberFormatter::TYPE_DEFAULT;\n echo '::TYPE_DEFAULT data type requested' . PHP_EOL;\n }//end switch\n\n return $type;\n}", "public function getType() {\n\t\treturn $this->getDiscreteField()->getType();\n\t}", "public function getType()\n\t{\n\t\t$types = $this->getValidTypes();\n\n\t\treturn $types[$this->type];\n\t}", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "abstract protected function get_typestring();", "abstract public function assertJavascriptVariableType($variable, $not, $type);", "public function getType(string $parameter);", "function getType(): string;", "function getType(): string;", "public static function getType($value): string\n\t{\n\t\tif(is_string($value)) {\n\t\t\treturn 'string';\n\t\t} else if(is_int($value)) {\n\t\t\treturn 'integer';\n\t\t} else if(is_float($value)) {\n\t\t\treturn 'float';\n\t\t} else if(is_array($value)) {\n\t\t\treturn 'array';\n\t\t} else if(is_bool($value)) {\n\t\t\treturn 'boolean';\n\t\t} else if(is_object($value)) {\n\t\t\treturn 'object';\n\t\t}\n\t\treturn 'different';\n\t}", "public function getDataType($includeExtension = true)\n {\n $type = $this->type;\n if (!$includeExtension) {\n return Str::before($type, '.');\n }\n\n return $type;\n }", "function getDataType($key=false) {\n\t\t\n\t\t$output = $this->getDataTypes();\n\t\t\n\t\tif (!$key) {\n \t\treturn $output;\n \t} else {\n \t\treturn $output[$key];\n \t}\n\t\t\n\t}", "function _get_type() {\n\t\treturn $this->type();\n\n\t}", "public function get_type(): string;", "public function getProduct_type () {\n\t$preValue = $this->preGetValue(\"product_type\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_type;\n\treturn $data;\n}", "function &typed($value, string $namespace = 'default')\n{\n if (is_bool($value)) {\n return bool($value, $namespace);\n } elseif (is_string($value)) {\n return string($value, $namespace);\n } elseif (is_float($value)) {\n return float($value, $namespace);\n } elseif (is_int($value)) {\n return int($value, $namespace);\n } elseif (is_iterable($value)) {\n return iterable($value, $namespace);\n } elseif (is_callable($value, false)) {\n return func($value, $namespace);\n } elseif (is_object($value)) {\n return object($value, $namespace);\n } else {\n throw new InvalidArgumentException(\n sprintf('Couldn\\'t create a typed variable for \"%s\" type.', gettype($value))\n );\n }\n}", "private function checkType($var) {\n\t\tif(gettype($var) == \"string\") {\n\t\t\treturn \"'$var'\";\n\t\t}\n\t\treturn $var;\n\t}", "public function getTypeForID() {\n\t\treturn self::C_DATATYPE_INTEGER;\n\t}", "public function getType()\n {\n return isset($this->type) ? $this->type : 0;\n }", "public function getType();", "public function getType();", "public function getType();", "public function getType();" ]
[ "0.6849343", "0.67715", "0.67409503", "0.6708612", "0.6702939", "0.6687832", "0.661638", "0.65758705", "0.657483", "0.65472317", "0.65392345", "0.65278363", "0.6488414", "0.6484783", "0.6484783", "0.6484783", "0.6484783", "0.6484109", "0.64542216", "0.6450605", "0.64354527", "0.64075404", "0.6359485", "0.635849", "0.6352338", "0.63509893", "0.6350525", "0.63401234", "0.629118", "0.6286286", "0.6286286", "0.62666833", "0.6255598", "0.6252684", "0.6252684", "0.6252684", "0.6252684", "0.6228569", "0.61754185", "0.61688924", "0.6168604", "0.6164997", "0.6127993", "0.6127993", "0.6127993", "0.6127993", "0.6127993", "0.61271226", "0.61271226", "0.612026", "0.6095773", "0.604902", "0.60477823", "0.603664", "0.601307", "0.60031956", "0.59893113", "0.59852785", "0.5984988", "0.5945545", "0.594035", "0.5904641", "0.5899679", "0.58968115", "0.58869416", "0.5862211", "0.58529234", "0.5848442", "0.58239764", "0.5820949", "0.5820949", "0.5820949", "0.5820949", "0.5820949", "0.5820949", "0.5820949", "0.5820949", "0.5820949", "0.5820949", "0.58199644", "0.58199644", "0.58199644", "0.57933223", "0.57839125", "0.5770182", "0.5769889", "0.5769889", "0.57693106", "0.5753053", "0.5740906", "0.5734686", "0.572226", "0.57195467", "0.5713968", "0.5699728", "0.5678564", "0.56740624", "0.5673697", "0.5673697", "0.5673697", "0.5673697" ]
0.0
-1
Return whether the given value is a valid ISODate
public static function isISODate($val) { if(!is_string($val)) { return false; } // Use DateTime support to check for valid dates. try { $date = new DateTime($val); } catch(Exception $e) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run($value)\n {\n if ($value instanceof Date) {\n return true;\n }\n if (!is_string($value)) {\n return false;\n }\n if (preg_match(Date::ISO8601_REGEX, $value)) {\n return true;\n }\n\n return false;\n }", "private function check_date($value) : bool\n {\n // 'YYYY-MM-DDThh:mm:ss'\n // 'YYYY-MM-DD hh:mm:ss.u'\n // 'YYYY-MM-DD hh:mm:ss'\n // 'YYYY-MM-DD'\n // 'YYYYMMDD'\n\n if (!is_string($value))\n return false;\n\n // TODO: the \\DateTime::createFromFormat() can't handle certain\n // types of date time formats allowed by the standard (i.e, partial\n // times given by \".ttt\" in the following: YYYY-MM-DDThh:mm:ss.tttZ)\n $dt = \\DateTime::createFromFormat(\\DateTime::ISO8601, $value);\n if ($dt !== false)\n return true;\n\n $dt = \\DateTime::createFromFormat('Y-m-d H:i:s.u', $value);\n if ($dt !== false)\n return true;\n\n $dt = \\DateTime::createFromFormat('Y-m-d H:i:s', $value);\n if ($dt !== false)\n return true;\n\n $dt = \\DateTime::createFromFormat('Y-m-d', $value);\n if ($dt !== false)\n return true;\n\n $dt = \\DateTime::createFromFormat('Ymd', $value);\n if ($dt !== false)\n return true;\n\n return false;\n }", "public function validateDateTimeISO($data)\n {\n if($data =='now' || (strlen($data)>=23)) {\n try {\n $value_time = new DateTime($data);\n return true;\n } catch (Exception $e) {\n $this->errorFields[] = [$e.$this->errorMsg];\n // Is not a valida Date\n }\n }\n return false;\n }", "function isValidISODate ($var) {\n //Returns error message for an invalid date\n\n //Check for unsafe characters\n $msg = isSantizeString($var);\n if ($msg != \"\") {\n return $msg;\n }\n // Format yyyy-mm-dd or yy-mm-dd\n $tmpDate = explode(\"-\",$var);\n //if the date can't be split into 3 parts, then a \"-\" was missing\n if (count($tmpDate) != 3) {\n return \"Invalid Date\"; \n }\n\n // isValidInt does not validate numbers with leading zeros. Strip off the leading zeros.\n $tmpDate[0] = ltrim($tmpDate[0], \"0\"); \n $tmpDate[1] = ltrim($tmpDate[1], \"0\"); \n $tmpDate[2] = ltrim($tmpDate[2], \"0\"); \n\n //Make sure all of the parts are valid numbers\n if (isValidInt($tmpDate[0]) == \"\" && isValidInt($tmpDate[1]) == \"\" && isValidInt($tmpDate[2]) == \"\") {\n\n // Use checkdate to validate the date\n if (checkdate($tmpDate[1], $tmpDate[2], $tmpDate[0])) { //checkdate(month, day, year)\n return \"\";\n } else {\n return \"Invalid Date\";\n }\n } else {\n return \"Invalid Date\";\n }\n}", "function mycheck_isodate($str)\n{\n if (preg_match('/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/', $str)) {\n return TRUE;\n } else {\n return FALSE;\n }\n}", "public static function validateDate($value)\n {\n if (preg_match('/^' .\n '(\\d{4})-(\\d{2})-(\\d{2})T' . // YYYY-MM-DDT ex: 2014-01-01T\n '(\\d{2}):(\\d{2}):(\\d{2})' . // HH-MM-SS ex: 17:00:00\n '(Z|((-|\\+)\\d{2}:\\d{2}))' . // Z or +01:00 or -01:00\n '$/', $value, $parts) == true) {\n try {\n new \\DateTime($value);\n return true;\n } catch (\\Exception $e) {\n return false;\n }\n } else {\n return false;\n }\n }", "protected function validateDate($value) {\n if (preg_match(\"/^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$/\", $value))\n return true;\n $this->setError(t(\"Invalid date (YYYY-MM-DD)\"));\n return false;\n }", "protected function validateDate($value){\n\t\tif ($value instanceof DateTime) return true;\n\n\t\tif (strtotime($value) === false) return false;\n\n\t\t$date = date_parse($value);\n\n\t\treturn checkdate($date['month'], $date['day'], $date['year']);\n\t}", "function iso_date($date) {\n if (preg_match('/^\\d\\d-\\d\\d\\-\\d\\d$/', $date)) $date = \"20\" . $date;\n if (!preg_match('/^\\d\\d\\d\\d-\\d\\d\\-\\d\\d$/', $date)) {\n if (strlen($date) == 6) $date = \"20\" . $date; //150923 => 20150923\n $date = substr_replace($date, '-', 6, 0);\n $date = substr_replace($date, '-', 4, 0);\n }\n return date(\"Y-m-d\", strtotime($date)) == $date ? $date : false;\n }", "public function isValidDate() {\n\t\t// TODO\n\t\treturn TRUE;\n\t}", "public function isdate($input){\n\n if (!preg_match(\"/^(0[1-9]|[1-2][0-9]|3[0-1])-(0[1-9]|1[0-2])-[0-9]{4}$/\",$input)){\n return false;\n }\n return true;\n }", "public function validateDate($data)\n {\n\n if($data =='now' || (strlen($data)>=8 && strlen($data)<=10)) {\n try {\n $value_time = new DateTime($data);\n return true;\n } catch (Exception $e) {\n // Is not a valida Date\n }\n }\n return false;\n }", "function validate_date($date) {\n $d = \\DateTime::createFromFormat('Y-m-d', $date);\n return $d && $d->format('Y-m-d') === $date;\n }", "public function isDate();", "function validate_date() {\n # Check the date is in ISO date format\n if (ereg('(19|20)[0-9]{2}[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])', $this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Value\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for date ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Blank Date\n return \"0000-00-00\";\n }\n }", "static public function IsDate( $value )\r\n\t{\r\n\t\t$date = date( 'Y', strtotime( $value ) );\r\n\t\tif( $date == \"1969\" || $date == '' )\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "function valid_date( $value = '', $format = 'Y-m-d H:i:s' )\n\t{\n\t\t$date = date_parse($value);\n\t\t$valid = ( $date['error_count'] == 0 && checkdate($date['month'], $date['day'], $date['year']) );\n\t\t\n\t\t/*\n\t\t// Create a date depending on PHP version\n\t\t$version = explode('.', phpversion());\n\t\tif (((int) $version[0] >= 5 && (int) $version[1] >= 2 && (int) $version[2] > 17))\n\t\t{\n\t\t\t$d = DateTime::createFromFormat($format, $date);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$d = new DateTime(date($format, strtotime($date)));\n\t\t}\n\t\t*/\n\t\t/*\n\t\t// Check valid date\n\t\t$format = 'Y-m-d H:i:s';\n\t\t$d = new DateTime(date($format, strtotime($date)));\n\t\t$valid_date = ( $d && $d->format($format) == $date );\n\t\t// or\n\t\t$date = date_parse($date);\n\t\t$valid_date = ( $date['error_count'] == 0 && checkdate($date['month'], $date['day'], $date['year']) );\n\t\tif ( ! $valid_date )\n\t\t{\n\t\t\t$valid = false;\n\t\t\t$return_message[] = 'The approved date is invalid.';\n\t\t}\n\t\t*/\n\t\t\n\t\tif ( ! $valid )\n\t\t{\n\t\t\t$this->set_message('valid_date', 'The %s field has in invalid date.');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public static function validateDate($input)\r\n\t{\r\n\t\treturn preg_match('/\\d{2}-\\d{2}-\\d{4}/', $input) && (strlen($input) == 10);\r\n\t}", "function validateDate($date)\n\t\t{\n\t\t\t$d = DateTime::createFromFormat('Y-m-d', $date);\n\t\t\treturn $d && $d->format('Y-m-d') == $date;\n\t\t}", "function validateDate($date)\n\t\t{\n\t\t\t$d = DateTime::createFromFormat('Y-m-d', $date);\n\t\t\treturn $d && $d->format('Y-m-d') == $date;\n\t\t}", "function validateDate($value) {\n\tif(ereg(\"^(([1-9])|(0[1-9])|(1[0-2]))\\/(([0-9])|([0-2][0-9])|(3[0-1]))\\/(([0-9][0-9])|([1-2][0,9][0-9][0-9]))$\", $value, $regs)) {\n\t\techo \"true\";\n\t} else {\n\t\techo \"false\";\n\t}\n}", "function isDateValid($date) {\r\n //$uy = $uyear->format(\"Y\");\r\n //$sy = date(\"Y\");\r\n \r\n if(preg_match('^(((0[1-9]|[12]\\d|3[01])\\/(0[13578]|1[02])\\/((19|[2-9]\\d)\\d{2}))|((0[1-9]|[12]\\d|30)\\/(0[13456789]|1[012])\\/((19|[2-9]\\d)\\d{2}))|((0[1-9]|1\\d|2[0-8])\\/02\\/((19|[2-9]\\d)\\d{2}))|(29\\/02\\/((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$^', $date))\r\n return false;\r\n else\r\n return true;\r\n \r\n}", "private static function validateDate(string $date): bool\n {\n $date = \\DateTime::createFromFormat('Y-m-d', $date);\n\n if (!$date) {\n return false;\n }\n\n return true;\n }", "function isDateValid($dateInput){\n\t\t$d = DateTime::createFromFormat('Y-m-d', $dateInput);\n\t\treturn $d && $d->format('Y-m-d') === $dateInput;\n\t}", "public function validate(): bool\n {\n return !is_object($this->value) && !is_array($this->value) && strtotime($this->value);\n }", "function is_date ($date) {\n\t\n\t\treturn !(\n\t\t\tis_null($date) ||\n\t\t\t(gettype($date)!=='object') ||\n\t\t\t(get_class($date)!=='DateTime') ||\n\t\t\t($date->format('Y m j')==='-0001 11 30')\n\t\t);\n\t\n\t}", "function is_date($date) {\n\tif (preg_match('/^((1|2)[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/', $date) || preg_match('/^(0[1-9]|[1-2][0-9]|3[0-1])-(0[1-9]|1[0-2])-((1|2)[0-9]{3})$/', $date)){\n\t\t$date = explode('-', $date);\n\t\tif (checkdate($date[1], $date[2], $date[0]) || checkdate($date[1], $date[0], $date[2])) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n}", "function isValidDate($date) {\n $d = DateTime::createFromFormat('Y-m-d', $date);\n return $d && $d->format('Y-m-d') == $date;\n}", "public function valid_date($str)\n\t{\n\t\treturn ( ! ereg(\"^[0-9]{1,2}/[0-9]{1,2}/[0-9]{4}$\", $str)) ? FALSE : TRUE;\n\t}", "private function _is_date($date) {\n\t\tif (empty($date)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(!strpos($date,'-') && is_numeric($date)) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tlist( $y, $m, $d ) = explode('-', $date );\n\n\t\tif ( is_numeric($m) && is_numeric($d) && is_numeric($y) && checkdate( $m, $d, $y ) ) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isValid(mixed $value): bool\n {\n if (empty($value) || (!is_string($value) && !is_numeric($value))) {\n return false;\n }\n\n foreach ($this->formats as $format) {\n try {\n $date = Carbon::createFromFormat('!' . $format, $value);\n\n // Skip to next format, if unable to create by format\n if ($date === false) {\n continue;\n }\n\n // Pass, if exported format matches the string date (just like Laravel's\n // 'date_format' validation rule )\n if ($date->format($format) == $value) {\n return true;\n }\n\n // Edge-case: if the format contains 'p' token (timezone offset), e.g. RCF 3339 Extended Zulu,\n // then the \"format()\" output comparison might fail if +00:00 timezone offset is submitted.\n // The output of the format converts +00:00 to 'Z', which then fails format output comparison.\n if (\n (str_contains($format, 'p') && !str_contains($format, '\\\\p')) // Only when unescaped 'p' token is present\n && (str_ends_with($value, '+00:00') || str_ends_with($value, '-00:00'))\n && $date->eq($value)\n ) {\n return true;\n }\n } catch (ValueError|InvalidFormatException $e) {\n // Ignore value error / format exceptions. This is important when there are multiple\n // allowed formats...\n continue;\n }\n }\n\n return false;\n }", "function nrua_validateDate($date, $format = 'Y-m-d H:i:s')\n{\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "function is_date_valid($date)\n{\n $is_date_valid = false;\n\n if (strtotime($date)) {\n list($day, $month, $year) = explode('.', $date);\n $is_date_valid = checkdate($month, $day, $year);\n }\n\n return $is_date_valid;\n}", "public function is_date()\n {\n }", "protected function isValidDate($value)\n\t{\n\t\t$minValue=$this->getMinValue();\n\t\t$maxValue=$this->getMaxValue();\n\t\t \n\t\t$valid=true;\n\n\t\t$dateFormat = $this->getDateFormat();\n\t\tif (strlen($dateFormat)) \n\t\t{\n\t\t\t$value = pradoParseDate($value, $dateFormat);\n\t\t\tif (strlen($minValue)) \n\t\t\t\t$valid=$valid && ($value>=pradoParseDate($minValue, $dateFormat)); \n\t\t\tif (strlen($maxValue)) \n\t\t\t\t$valid=$valid && ($value <= pradoParseDate($maxValue, $dateFormat));\n\t\t\treturn $valid;\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$value=strtotime($value);\n\t\t\tif(strlen($minValue))\n\t\t\t\t$valid=$valid && ($value>=strtotime($minValue));\n\t\t\tif(strlen($maxValue))\n\t\t\t\t$valid=$valid && ($value<=strtotime($maxValue));\n\t\t\treturn $valid;\n\t\t} \n\t}", "function check_date($date_str)\r\n{\r\n\tif (strlen($date_str) != 10) return false;\r\n\t$pattern = \"/[0-9]{4}-[0-9]{2}-[0-9]{2}/\";\r\n\tif (!preg_match($pattern, $date_str)) return false;\r\n\t// correct format, now check ranges\r\n\treturn strtotime($date_str);\r\n}", "public function validate( $value )\n\t{\n\t\t$value = (string) $value;\n\t\t\n\t\tif( strlen( $value ) != 13 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$first_letter = substr( $value, 0, 1 );\n\t\t\n\t\tlist( $year, $month, $day ) = str_split( substr( $value, 1, 7 ), 2 );\n\t\tswitch( $first_letter )\n\t\t{\n\t\t\tcase '1':\n\t\t\t\t$year = '19' . $year;\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\t$year = '19' . $year;\n\t\t\t\tbreak;\n\t\t\tcase '5':\n\t\t\t\t$year = '20' . $year;\n\t\t\t\tbreak;\n\t\t\tcase '6':\n\t\t\t\t$year = '20' . $year;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\tif( ! RPC_Date::validDate( $year . '-' . $month . '-' . $day ) ||\n\t\t RPC_Date::getTimestamp( $year . '-' . $month . '-' . $day ) >= RPC_Date::getTimestamp( date( 'Y-m-d' ) ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public static function isDate($date)\n {\n if (!preg_match('/^([0-9]{4})-((?:0?[0-9])|(?:1[0-2]))-((?:0?[0-9])|(?:[1-2][0-9])|(?:3[01]))( [0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $matches)) {\n return false;\n }\n\n return checkdate((int) $matches[2], (int) $matches[3], (int) $matches[1]);\n }", "public static function validateDate($date)\n {\n $d = \\DateTime::createFromFormat('Y-m-d', $date);\n return $d && $d->format('Y-m-d') === $date;\n }", "static public function isDate($date)\n {\n if (!preg_match('/^([0-9]{4})-((0?[1-9])|(1[0-2]))-((0?[1-9])|([1-2][0-9])|(3[01]))( [0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $matches))\n return false;\n return checkdate((int)$matches[2], (int)$matches[5], (int)$matches[0]);\n }", "public function validateDate($date)\n {\n try {\n return new DateTime($date);\n } catch (Exception $e) {\n return false;\n }\n }", "public function check_date_format($date) {\n $datepieces = explode('-', $date);\n $return = true;\n\n if (count($datepieces) != 3) {\n $return = false;\n } else {\n foreach ($datepieces as $piece => $datepiece) {\n if (!is_numeric($datepiece)) {\n $return = false;\n break;\n }\n switch ($piece) {\n // Year check.\n case 0:\n if ((strlen($datepiece) != 4) || ($datepiece <= 0)) {\n $return = false;\n break 2;\n }\n break;\n\n // Month check.\n case 1:\n if ((strlen($datepiece) != 2) || ((int)$datepiece < 1) || ((int)$datepiece > 12)) {\n $return = false;\n break 2;\n }\n break;\n\n // Day check.\n case 2:\n if ((strlen($datepiece) != 2) || ((int)$datepiece < 1) || ((int)$datepiece > 31)) {\n $return = false;\n break 2;\n }\n break;\n }\n }\n }\n return $return;\n }", "private static function sanitizeDate($date){\r\n if (isset($date) && strlen(''.$date)==10 && preg_match(\"/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/\",$date)){\r\n return TRUE;\r\n } else {\r\n return FALSE;\r\n }\r\n }", "public static function isValidDate($date){\n return (DateTime::createFromFormat('d/m/Y', $date)) ? true : false;\n }", "function evalDate($value) {\n\t\tif (!$value) {\n\t\t\treturn false;\n\t\t}\n\t\t$checkValue = trim($value);\n\t\tif (strlen($checkValue) == 8) {\n\t\t\t$checkValue = substr($checkValue,0,2).'.'.substr($checkValue,2,2)\n\t\t\t\t.'.'.substr($checkValue,4,4) ;\n\t\t}\n\t\tlist($day,$month,$year) = split('\\.', $checkValue, 3);\n\t\tif(is_numeric($year) && is_numeric($month) && is_numeric($day)) {\n\t\t\treturn checkdate($month, $day, $year);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function is_date_format_valid($date)\n{\n return preg_match(\"/(0[1-9]|[12][0-9]|3[01])[ \\.](0[1-9]|1[012])[ \\.](19|20)\\d\\d/\", $date) !== 0;\n}", "private function isValidDate($date)\n\t{\n\t\t$date = str_replace('/', '-', $date);\n\t\treturn (date_create($date)) ? JFactory::getDate($date)->format(\"Y-m-d\") : null;\n\t}", "private function isValidDate($date)\n\t\t{\n\t\t\t$date = str_replace('/', '-', $date);\n\t\t\treturn (date_create($date)) ? Factory::getDate($date)->format(\"Y-m-d\") : null;\n\t\t}", "private function isValidDate($date) {\n $date = str_replace('/', '-', $date);\n return (date_create($date)) ? JFactory::getDate($date)->format(\"Y-m-d\") : null;\n }", "function validateDate($date,$format ='Y-m-d'){\n$d = dateTime::createFromFormat($format,$date);\n\nif($d && $d->format($format) == $date){\nreturn true;\n } else {\n return false;\n }\n}", "public static function date($str)\r\n {\r\n return (strtotime($str) !== FALSE);\r\n }", "protected function checkDate($date)\r\n\t{\r\n\t\tif(!$date)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tif(!preg_match('/^([1-3][0-9]{3,3})-(0?[1-9]|1[0-2])-(0?[1-9]|[1-2][1-9]|3[0-1])$/', $date)) {\r\n\t\t\t\tthrow new Exception ( 'checkDate() expects a SQL formatted date like 2009-12-24.' );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function _valid_date($field)\r\n\t{\r\n\t\t// Ignore if empty\r\n\t\tif (empty($this->{$field}))\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\r\n\t\t$date = date_parse($this->{$field});\r\n\r\n\t\treturn checkdate($date['month'], $date['day'],$date['year']);\r\n\t}", "function fechaInvalida($fecha){\n $valores = explode('-', $fecha);\n if(count($valores) == 3 && checkdate($valores[1], $valores[2], $valores[0])){\n return false;\n }\n return true;\n }", "function validateDate($date,$format = 'Y-m-d H:i:s') {\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "public static function isValidDate($date)\n {\n preg_match_all('/^([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})$/', $date, $matches);\n if (count($matches) == 4) {\n return checkdate($matches[2][0], $matches[1][0], $matches[3][0]);\n }\n return false;\n }", "function validateDate($date, $format = 'Y-m-d H:i:s')\n{\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "function validateDate($date, $format = 'Y-m-d H:i:s')\n{\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "public static function check_date($value, $format='dd.mm.yyyy') {\n\t\tif (strlen($value) >= 6 && strlen($format) == 10) { \n\t // find separator. Remove all other characters from $format \n\t $separator_only = str_replace(array('m','d','y'),'', $format); \n\t $separator = $separator_only[0]; // separator is first character \n\t \n\t if ($separator && strlen($separator_only) == 2) { \n\t // make regex \n\t $regexp = str_replace('mm', '(0?[1-9]|1[0-2])', $format); \n\t $regexp = str_replace('dd', '(0?[1-9]|[1-2][0-9]|3[0-1])', $regexp); \n\t $regexp = str_replace('yyyy', '(19|20)?[0-9][0-9]', $regexp); \n\t $regexp = str_replace($separator, \"\\\\\" . $separator, $regexp); \n\t \n\t if ($regexp != $value && preg_match('/'.$regexp.'\\z/', $value)) { \n\t // check date \n\t $arr=explode($separator,$value); \n\t $day=$arr[0]; \n\t $month=$arr[1]; \n\t $year=$arr[2]; \n\t \n\t if (@checkdate($month, $day, $year)) {\n\t return true; \n\t }\n\t } \n\t } \n\t } \n\t return false; \n\t}", "function validateDate($date, $format = 'Y-m-d')\n {\n $d = DateTime::createFromFormat($format, $date);\n // The Y ( 4 digits year ) returns TRUE for any integer with any number of digits so changing the comparison from == to === fixes the issue.\n return $d && $d->format($format) === $date;\n }", "function dateValidation($value) {\n\t$reg = \"/^(((0?[1-9]|1[012])\\/(0?[1-9]|1\\d|2[0-8])|(0?[13456789]|1[012])\\/(29|30)|(0?[13578]|1[02])\\/31)\\/(19|[2-9]\\d)\\d{2}|0?2\\/29\\/((19|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00)))$/\";\n\treturn preg_match($reg,$value);\n}", "function isValidateDate($date, $format = 'd-m-Y')\r\n {\r\n switch ($format) {\r\n case 'd-m-Y':\r\n if (preg_match(\"/^([0-9]{2})-([0-9]{2})-([0-9]{4})$/\", $date, $parts)) {\r\n //check weather the date is valid of not\r\n if (checkdate($parts[2], $parts[1], $parts[3]))\r\n return true;\r\n else\r\n return false;\r\n } else\r\n return false;\r\n break;\r\n case 'Y-m-d':\r\n if (preg_match(\"/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/\", $date, $parts)) {\r\n //check weather the date is valid of not\r\n if (checkdate($parts[2], $parts[3], $parts[1]))\r\n return true;\r\n else\r\n return false;\r\n } else\r\n return false;\r\n break;\r\n case 'd/m/Y':\r\n if (preg_match(\"/^([0-9]{2})\\/([0-9]{2})\\/([0-9]{4})$/\", $date, $parts)) {\r\n //check weather the date is valid of not\r\n if (checkdate($parts[2], $parts[1], $parts[3]))\r\n return true;\r\n else\r\n return false;\r\n } else\r\n return false;\r\n break;\r\n }\r\n }", "protected function isStandardDateFormat($value)\n {\n return preg_match('/^(\\d{4})-(\\d{1,2})-(\\d{1,2})$/', $value);\n }", "public function validateDate()\n {\n if (\n ($from = $this->getAvailableFrom()) &&\n ($till = $this->getAvailableTill()) &&\n $from->InPast() &&\n $till->InFuture()\n ) {\n return true;\n }\n\n return false;\n }", "public function isDateTime();", "function isDateType($type)\n{\n return($type == \"date\" or $type == \"year\" or isTimeType($type));\n}", "protected static function check_date($date) {\n $date_arr = explode(\"-\", $date);\n\n if (count($date_arr) == 3 && checkdate($date_arr[1], $date_arr[2], $date_arr[0])) {\n return false;\n } else {\n return true;\n }\n }", "function verifyDate($date) {\r\n $date = trim($date);\r\n if (!is_numeric($date) || strlen($date) != 8) {\r\n return false;\r\n }\r\n $year = substr($date, 0, 4);\r\n $month = substr($date, 4, 2);\r\n $day = substr($date, 6);\r\n if (!checkdate($month, $day, $year)) {\r\n return false;\r\n } else {\r\n return \"$year-$month-$day\";\r\n }\r\n}", "function validateDate($date, $format = 'Y-m-d H:i:s')\n {\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n }", "public static function is_date($string) {\n // \"Normal\" dates.\n if (strtotime($string) !== false) {\n return true;\n }\n\n // Quarterly dates.\n if ( preg_match(\"/([1-4]q|q[1-4]).*([\\d]{2,4})/i\", $string)\n || preg_match(\"/([\\d]{2,4}).*([1-4]q|q[1-4])/i\", $string) ) {\n return true;\n }\n\n return false;\n }", "public function date(string $field) : bool\n\t{\n\t\tif(Datetime::createFromFormat('Y-m-d', $this->data[$field]) === false)\n\t\t{\n\t\t\t$this->errors[$field] = \"Date incorrecte\";\n\n\t\t\treturn false;\n\t\t}\t\n\n\t\treturn true;\n\t}", "public function is_valid_date($datetime) {\n if(!isset($datetime)) return false;\n if(!date('U', strtotime($datetime)) == '0')\n return false;\n return true;\n }", "public function isValid(): bool\n {\n $value = $this->field->getValue();\n\n // field is empty and its not required. It's thus valid.\n if ($value == '' && $this->required == false) {\n return true;\n }\n\n $parsedDate = (array)date_parse($value);\n\n if (isset($parsedDate['warning_count']) &&\n isset($parsedDate['error_count']) &&\n $parsedDate['warning_count'] == 0 &&\n $parsedDate['error_count'] == 0 &&\n isset($parsedDate['year']) &&\n isset($parsedDate['month'])\n ) {\n return true;\n }\n\n return false;\n }", "private function isValidDateTime($date): bool\n {\n return date('Y-m-d H:i:s', strtotime($date)) === $date;\n }", "function validateDate($date, $format = 'd/m/Y H:i:s')\n{\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "function valid_date($str) \n\t{\n\t\t//if (ereg(\"([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})\", $str)) {\n\t\tif (preg_match(\"/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/\", $str)) \n\t\t{\n\t\t\t//$arr = split(\"-\", $str);\n\t\t\t$arr = preg_split(\"/-/\", $str);\n\t\t\t$yyyy = (int) $arr[0];\n\t\t\t$mm = (int) $arr[1];\n\t\t\t$dd = (int) $arr[2];\n\t\t\treturn checkdate($mm, $dd, $yyyy);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function validateDate($value) {\n\n is_a($value, 'DateTime') ||\n $value = strtotime($value);\n\n $value = date('Y-m-d', $value);\n\n if (!$value)\n $this->errors[] = 'Date ' . $value . ' is not a valid date';\n\n return $value;\n\n }", "public function checkDate($date)\n\t{\n\t\tif (preg_match(\"/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/\",$date)){\n\t return true;\n\t }\n\t else{\n\t \t$this->form_validation->set_message('checkDate','date should be as yyyy-mm-dd');\n\t return false;\n\t }\n\t}", "function valid_date($date){\r\n\t$day = date_day($date);\r\n\t$month = date_month($date);\r\n\t$year = date_year($date);\r\n\tif(!is_numeric($day) || !is_numeric($month) || !is_numeric($year)){\r\n\t\treturn FALSE;\r\n\t}elseif($month < 1 || $month > 12){\r\n\t\treturn FALSE;\r\n\t}elseif(($day < 1) || ($day > 30 && ($month == 4 || $month == 6 || $month == 9 || $month == 11 )) || ($day > 31)){\r\n\t\treturn FALSE;\r\n\t}elseif($month == 2 && ($day > 29 || ($day > 28 && (floor($year / 4) != $year / 4)))){\r\n\t\treturn FALSE;\r\n\t}else{\r\n\t\treturn TRUE;\r\n\t}\r\n}", "function _validateDate($date, $format = 'd/m/Y'){\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n }", "function checkIsValidDate($date, $format = 'Y-m-d H:i:s')\n {\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) === $date;\n }", "public function isValidPaydate($date);", "private function date ($param)\n {\n $this->type = 'date';\n $time = strtotime($this->value);\n if (FALSE === $time)\n {\n $this->SetError('date', 'The '.$this->SpacedKey.' field must be a valid date');\n return false;\n }\n return true;\n }", "public static function validate_date( $date )\n {\n return preg_match(\n '/^(19|20)\\d\\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/',\n $date );\n }", "function validateDate($date, $format = 'Y-m-d') {\n \t $d = DateTime::createFromFormat($format, $date);\n \t return $d && $d->format($format) === $date;\n }", "function verifyDate($date, $date_format)\n {\n $datetime=DateTime::createFromFormat($date_format, $date);\n $errors=DateTime::getLastErrors();\n if (!$datetime || !empty($errors['warning_count'])) //date was invalid\n {\n $date_check_ok=false;\n }\n else //everything OK\n {\n $date_check_ok=true;\n }\n\n return $date_check_ok;\n }", "function checkDateFormat($date)\n{\n //match the format of the date\n if (preg_match (\"/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/\", $date, $parts))\n {\n //check weather the date is valid of not\n if(checkdate($parts[2],$parts[3],$parts[1]))\n return true;\n else\n return false;\n }\n else\n return false;\n}", "private function isValidDateFormat($date)\n {\n if(!is_array($date)){\n return false;\n }\n if(sizeof($date) != 3){\n return false;\n }\n foreach($date as $elem){\n if(!is_numeric($elem)){\n return false;\n }\n }\n // There are only 12 months!\n if($date[0] > 12 || $date[0] < 1){\n return false;\n }\n // I don't want to type in special check for months like February so..\n if($date[1] > 31 || $date[1] < 1){\n return false;\n }\n // No crazy years\n if(strlen($date[2]) > 4 || strlen($date[2]) < 4){\n return false;\n }\n return true;\n }", "public static function validateDate($date) {\r\n if(preg_match(\"/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/\", $date)) // has to be YYYY-MM-DD\r\n {\r\n $dt = new DateTime($date);\r\n $d = $dt->format(self::dateDay);\r\n $m = $dt->format(self::dateMonth);\r\n $y = $dt->format(self::dateYear);\r\n if(!checkdate($m, $d, $y))\r\n {\r\n throw new Exception(\"Das Datum [\".$date.\"] entspricht keinem g&uuml;ltigen Format\");\r\n }\r\n else\r\n {\r\n return true; \r\n }\r\n }\r\n else\r\n {\r\n throw new Exception(\"Das Datum [\".$date.\"] entspricht nicht dem Format 'YYYY-MM-DD'\");\r\n }\r\n }", "public function hasDate() : bool;", "private function isValidDate($date)\n {\n try\n {\n $date = str_replace('/', '-', $date);\n return (date_create($date)) ? JFactory::getDate($date)->format(\"Y-m-d\") : null;\n }\n catch(Exception $e)\n {\n Gm_ceilingHelpersGm_ceiling::add_error_in_log($e->getMessage(), __FILE__, __FUNCTION__, func_get_args());\n }\n }", "public function validateParameterValue($value) {\n switch ($this->getType()) {\n case self::TYPE_TEXT:\n return is_string($value) || is_numeric($value) || is_bool($value);\n case self::TYPE_NUMERIC:\n return is_numeric($value);\n case self::TYPE_BOOLEAN:\n return is_bool($value) || $value === 0 || $value === 1;\n case self::TYPE_DATE:\n return date_create_from_format(\"Y-m-d\", $value) ? true : false;\n case self::TYPE_DATE_TIME:\n return date_create_from_format(\"Y-m-d H:i:s\", $value) ? true : false;\n }\n }", "public function checkValidity()\n {\n // le pb est que la propriété publicationDate est de type dateTime or les tests initiaux\n // se basent sur un format de type date --> ce qui génère une erreur de type notice\n \n return true;\n }", "function is_valid_time($timeStr){\n\n $dateObj = DateTime::createFromFormat('d.m.Y H:i', \"10.10.2020 \" . $timeStr);\n\n return ($dateObj !== false && $dateObj && $dateObj->format('G') == intval($timeStr));\n\n}", "private function validateDate($date, $format = 'Y-m-d H:i:s'){\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n }", "function isValidDate($params = array(), $options = array()) {\n\t\t$time = strtotime(array_shift($params));\n\t\tif ($time !== false && $time != -1) {\n\t\t\tif (!empty($options['return']) && $options['return'] == 'time') {\n\t\t\t\treturn $time;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private function checkDate($date) {\n // date/time\n\t$datetimePattern1 = '/^\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d:\\d\\d$/';\n // date\n\t$datetimePattern2 = '/^\\d\\d\\d\\d-\\d\\d-\\d\\d$/';\n return (preg_match($datetimePattern1, $date) ||\n preg_match($datetimePattern2, $date));\n }", "protected function hasDateType($string)\n {\n return (bool)preg_match(\n '/(' . implode('|\\s', $this->getDateTypes()) . '\\s*\\(|\\s)/i',\n trim($string)\n );\n }", "public function isValid()\n {\n if (is_null($this->delimiter)) {\n return false;\n }\n\n [$month, $year] = $this->getMonthYear();\n\n return checkdate($month, 1, $year);\n }", "function validDateTime($dateTime)\n\t{\n\t\tif (preg_match(\"/^(\\d{4})-(\\d{2})-(\\d{2}) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/\", $dateTime, $matches)) \n\t\t{\n\t\t\tif (checkdate($matches[2], $matches[3], $matches[1])) \n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}" ]
[ "0.74049497", "0.7397895", "0.7364437", "0.717261", "0.714827", "0.7120575", "0.7045961", "0.7041389", "0.68813264", "0.6844565", "0.68218493", "0.68178296", "0.6795506", "0.6793685", "0.678895", "0.6775554", "0.674608", "0.6706285", "0.6695407", "0.6695407", "0.6678262", "0.66644955", "0.6663715", "0.66243607", "0.65888053", "0.6588395", "0.6586069", "0.65781945", "0.6562437", "0.6553318", "0.65334064", "0.6523997", "0.6502943", "0.6474136", "0.6460694", "0.6459184", "0.64531225", "0.6385726", "0.63811284", "0.6376371", "0.63491267", "0.6346458", "0.63392574", "0.6334477", "0.6325621", "0.6316227", "0.63030285", "0.6299666", "0.6283553", "0.627558", "0.62694293", "0.62665814", "0.62641263", "0.6229625", "0.62278795", "0.6227012", "0.621367", "0.621367", "0.6195213", "0.61895347", "0.61877835", "0.6181427", "0.6170007", "0.61682314", "0.61657596", "0.61580795", "0.6156258", "0.61432964", "0.6136013", "0.61162406", "0.61028624", "0.60854715", "0.60775787", "0.6077169", "0.6072947", "0.6070863", "0.6070065", "0.6067838", "0.6062474", "0.6052723", "0.60456026", "0.60067797", "0.60062486", "0.5997509", "0.59915274", "0.5976275", "0.59623533", "0.5940948", "0.5940858", "0.59302205", "0.5922502", "0.5920472", "0.59185016", "0.5917814", "0.5916873", "0.5884483", "0.58825237", "0.58819926", "0.5861361", "0.5858902" ]
0.8178765
0
this up() migration is autogenerated, please modify it to your needs
public function up(Schema $schema): void { $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('CREATE TABLE mw_afsluiting_resultaat (afsluiting_id INT NOT NULL, resultaat_id INT NOT NULL, INDEX IDX_EBA6C1A2ECDAD1A9 (afsluiting_id), INDEX IDX_EBA6C1A2B0A9B358 (resultaat_id), PRIMARY KEY(afsluiting_id, resultaat_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_general_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE mw_resultaten (id INT AUTO_INCREMENT NOT NULL, naam VARCHAR(255) NOT NULL, active TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_general_ci` ENGINE = InnoDB'); $this->addSql('INSERT INTO mw_resultaten (naam,active) VALUES ("Overdracht naar buurteam",1), ("Postadres geregeld",1), ("Inkomen op orde",1), ("Administratie op orde",1), ("Toeleiding schuldhulpverlening",1), ("Werk gevonden/behouden",1), ("Herstel woningnet",1), ("Huisvesting eigen netwerk binnen Amsterdam",1), ("Huisvesting eigen netwerk buiten Amsterdam",1), ("huisvesting zelfstandig binnen Amsterdam",1), ("Huisvesting zelfstandig buiten Amsterdam",1), ("Huisvesting via Onder de pannen",1), ("Plaatsing Passantenpenion",1), ("Plaatsing MO/BW",1), ("Verwijzing GGD",1), ("Verwijzing GGZ",1), ("Organiseren somatische zorg",1), ("Jippie, het gaat weer helemaal top!",1) '); $this->addSql('ALTER TABLE mw_afsluiting_resultaat ADD CONSTRAINT FK_EBA6C1A2ECDAD1A9 FOREIGN KEY (afsluiting_id) REFERENCES mw_dossier_statussen (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE mw_afsluiting_resultaat ADD CONSTRAINT FK_EBA6C1A2B0A9B358 FOREIGN KEY (resultaat_id) REFERENCES mw_resultaten (id) ON DELETE CASCADE'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function up();", "abstract public function up();", "abstract public function up();", "abstract public function up();", "public function up()\n {\n $this->execute(\"\n ALTER TABLE `tcmn_communication` \n CHANGE `tcmn_pprs_id` `tcmn_pprs_id` SMALLINT(5) UNSIGNED NULL COMMENT 'person',\n CHANGE `tcmn_tmed_id` `tcmn_tmed_id` TINYINT(4) UNSIGNED NULL COMMENT 'medijs';\n \");\n }", "public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function up()\n {\n $this->execute(\"\n\n ALTER TABLE `cucp_user_company_position` \n ADD COLUMN `cucp_role` CHAR(20) NULL AFTER `cucp_name`;\n\n \");\n }", "public function up()\n\t{\n\t\t$this->dbforge->add_column($this->table, $this->field);\n\t}", "public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }", "public function up()\n {\n dbexec('ALTER TABLE #__subscriptions_coupons\n ADD `created_on` datetime DEFAULT NULL AFTER `usage`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n \n dbexec('ALTER TABLE #__subscriptions_vats\n ADD `created_on` datetime DEFAULT NULL AFTER `data`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n }", "public function up()\n\t{\n\t\t$this->dbforge->modify_column($this->table, $this->field);\n\t}", "public function safeUp()\n {\n $this->createTable(\n $this->tableName,\n [\n 'id' => $this->primaryKey(),\n 'user_id' => $this->integer(). ' UNSIGNED NOT NULL' ,\n 'source' => $this->string()->notNull(),\n 'source_id' => $this->string()->notNull(),\n ],\n 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'\n );\n\n $this->addForeignKey('fk_social_auth_user_id_to_user_id', $this->tableName, 'user_id', '{{%user}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n }", "public function up()\n {\n $user = $this->table('products', ['collation' => 'utf8mb4_persian_ci', 'engine' => 'InnoDB']);\n $user\n ->addColumn('name', STRING, [LIMIT => 20])\n ->addColumn('count', STRING, [LIMIT => 75])\n ->addColumn('code', STRING, [LIMIT => 100])\n ->addColumn('buy_price', STRING, [LIMIT => 30])\n ->addColumn('sell_price', STRING, [LIMIT => 30])\n ->addColumn('aed_price', STRING, [LIMIT => 50])\n ->addTimestamps()\n ->save();\n }", "public function up()\n {\n // Drop table 'table_name' if it exists\n $this->dbforge->drop_table('lecturer', true);\n\n // Table structure for table 'table_name'\n $this->dbforge->add_field(array(\n 'nip' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => true,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'nik' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => false,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'name' => array(\n 'type' => 'VARCHAR(24)',\n 'null' => false,\n ),\n\t\t\t'id_study_program' => array(\n\t\t\t\t'type' => 'VARCHAR(24)',\n\t\t\t\t'null' => false,\n\t\t\t)\n\n ));\n $this->dbforge->add_key('nik', true);\n $this->dbforge->create_table('lecturer');\n }", "public function up()\n\t{\n\t\t// are not setting the foreign key constraint, to allow the examination module to work without the intravitreal\n\t\t// injection module being installed\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'left_treatment_id', 'int(10) unsigned');\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'right_treatment_id', 'int(10) unsigned');\n\t}", "public function safeUp()\n {\n $this->createTable('tbl_hand_made_item',\n [\n \"id\" => \"int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY\",\n \"price\" => \"integer\",\n \"discount\" => \"integer\",\n \"preview_id\" => \"integer\",\n \"name\" => \"string\",\n \"description\" => \"text\",\n \"short_description\" => \"text\",\n \"slug\" => \"string\",\n ]\n );\n }", "public function preUp()\n {\n }", "public function up()\n\t{\n\t\t// create the purchase_order_details table\n\t\tSchema::create('purchase_order_details', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\t\t \n\t\t $table->integer('purchase_order_id')->unsigned();//->foreign()->references('id')->on('orders');\n\t\t $table->integer('product_id')->unsigned();//->foreign()->references('id')->on('products');\n\t\t $table->integer('quantity');\t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \n\t\t $table->integer('updated_by')->unsigned();\n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function up()\n {\n if (!$this->isEdu()) {\n return;\n }\n \n $this->edu_up();\n }", "public function up()\n\t{\t\t\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'2',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\t\t\n\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'3',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\n\t\t//\n\t}", "public function up()\n {\n $table = $this->table('qobo_translations_translations');\n $table->renameColumn('object_foreign_key', 'foreign_key');\n $table->renameColumn('object_model', 'model');\n $table->renameColumn('object_field', 'field');\n $table->renameColumn('translation', 'content');\n\n if (!$table->hasColumn('locale')) {\n $table->addColumn('locale', 'char', [\n 'default' => null,\n 'limit' => 6,\n ]);\n }\n $table->update();\n\n $table = TableRegistry::getTableLocator()->get(\"Translations.Translations\");\n $entities = $table->find()->all();\n foreach($entities as $entity) {\n $entity->setDirty('locale', true);\n $table->save($entity);\n }\n }", "public function up()\n {\n $this->addForeignKey('tours_fk', 'tours', 'id', 'tour_to_hotel', 'tour_id');\n\n $this->addForeignKey('t2h_fkh', 'tour_to_hotel', 'hotel_id', 'hotels', 'id');\n $this->addForeignKey('t2h_fkt', 'tour_to_hotel', 'tour_id', 'tours', 'id');\n }", "public function safeUp()\r\n {\r\n $this->createTable('tbl_job_application', array(\r\n 'id' => 'pk',\r\n 'job_id' => 'integer NOT NULL',\r\n 'user_id' => 'integer NULL',\r\n 'name' => 'string NOT NULL',\r\n 'email' => 'text NOT NULL',\r\n 'phone' => 'text NOT NULL',\r\n 'resume_details' => 'text NOT NULL',\r\n 'create_date' => 'datetime NOT NULL',\r\n 'update_date' => 'datetime NULL',\r\n ));\r\n }", "public function up()\n {\n $fields = array(\n 'first_login' => array('type' => 'char', 'constraint' => '1', 'default' => '1'),\n );\n $this->dbforge->add_column('user', $fields);\n }", "public function safeUp() {\n\n $this->createTable('word', [\n 'word_id' => Schema::TYPE_PK,\n 'word_lang_id' => $this->integer(),\n 'word_name' => $this->string(500) . ' NOT NULL',\n 'word_detais' => $this->string(1000),\n ]);\n\n // Add foreign key\n $this->addForeignKey('fk_language_word_1', 'word',\n 'word_lang_id', 'language', 'lang_id', 'CASCADE', 'NO ACTION');\n \n // Create index of foreign key\n $this->createIndex('word_lang_id_idx', 'word', 'word_lang_id');\n }", "public function safeUp()\n {\n $this->alterColumn('item_keuangan', 'created_at', \"TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00'\");\n\n /* Tambah Field */\n $this->addColumn('item_keuangan', 'status', \"TINYINT(1) NOT NULL DEFAULT '1' COMMENT '0=tidak aktif; 1=aktif;' AFTER `jenis`\");\n }", "public function up()\n {\n $this->addForeignKey(\n 'fk_category_product_from_category',\n 'category_product',\n 'category_id',\n 'category',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n\n $this->addForeignKey(\n 'fk_category_product_from_product',\n 'category_product',\n 'product_id',\n 'product',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n\t\t$this->dropColumn('korzet','utca'); \n\t\t$this->addColumn('korzet','utca','string NOT NULL');\n\t}", "public function up()\n {\n // $this->fields()->create([]);\n // $this->streams()->create([]);\n // $this->assignments()->create([]);\n }", "public function up()\n {\n Schema::table($this->table, function (Blueprint $table) {\n // $table->bigInteger('user_id')->default(0)->after('id'); // Example\n $table->dropColumn([\n // 'user_id', // Example\n ]);\n });\n }", "public function up()\n {\n $table = $this->table('admins');\n $table->addColumn('name', 'string')\n ->addColumn('role', 'string')\n ->addColumn('username', 'string')\n ->addColumn('password', 'string')\n ->addColumn('created', 'datetime')\n ->addColumn('modified', 'datetime', ['null' => true])\n ->create();\n\n\n $data = [ \n [\n 'name' => 'Pedro Santos', \n 'username' => '[email protected]',\n 'password' => '101010',\n 'role' => 'Suporte',\n 'modified' => false\n ],\n ];\n\n $adminTable = TableRegistry::get('Admins');\n foreach ($data as $value) {\n $adminTable->save($adminTable->newEntity($value));\n }\n }", "public function up(): void\n {\n try {\n // SM: We NEVER delete this table.\n if ($this->db->tableExists('prom2_pages')) {\n return;\n }\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"CREATE TABLE `prom2_pages` (\n `cntPageID` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `txtRelativeURL` varchar(255) NOT NULL COMMENT 'Relative URL',\n `txtTitle` varchar(70) NOT NULL COMMENT 'Title',\n `txtContent` text NOT NULL COMMENT 'Content',\n `blnRobots_DoNotAllow` bit(1) NOT NULL DEFAULT b'1',\n PRIMARY KEY (`cntPageID`),\n UNIQUE KEY `txtRelativeURL` (`txtRelativeURL`),\n KEY `txtTitle` (`txtTitle`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function up()\n\t{\n\t\t// Add data to committee-members\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Brian O\\'Sullivan',\n\t\t\t'role' => 'Chairman',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Anthony Barker',\n\t\t\t'role' => 'PRO',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\t\t\n\t}", "public function up()\n {\n $this->query(\"UPDATE `subscription_types` SET `user_label` = `name` WHERE `user_label` = '' OR `user_label` IS NULL;\");\n\n $this->table('subscription_types')\n ->changeColumn('user_label', 'string', ['null' => false])\n ->update();\n }", "public function safeUp()\n\t{\n $sql = <<<SQL\n alter table r add R8 inte;\nSQL;\n\t\t//$this->execute($sql);\n $sql = <<<SQL\n ALTER TABLE r ADD constraint FK_r8_elgz1 FOREIGN KEY (r8) REFERENCES elgz (elgz1) ON DELETE SET DEFAULT ON UPDATE CASCADE;\nSQL;\n //$this->execute($sql);\n\t}", "public function up()\n\t{\n\t\techo $this->migration('up');\n\n\t\tci('o_role_model')->migration_add('Cookie Admin', 'Cookie Designer and Eater', $this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function up()\n {\n\t\t$this->addColumn('{{%user}}', 'is_super', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `status`\");\n\t\t\n\t\t//Add new column for Option Group table\n\t\t$this->addColumn('{{%option_group}}', 'option_type', Schema::TYPE_STRING . \"(25) NULL DEFAULT 'text' AFTER `title`\");\n\t\t\n\t\t//Add new column for Order table\n\t\t$this->addColumn('{{%order}}', 'is_readed', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `shipment_method`\");\n }", "public function up()\n {\n $this->addColumn(\\backend\\models\\VodProfile::tableName(), 'language', \"char(5) not null default 'en-US'\");\n }", "public function up()\n {\n if (!Schema::hasTable($this->table))\n Schema::create($this->table, function (Blueprint $table)\n {\n $table->integer('parent_id')->unsigned()->index();\n $table->foreign('parent_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->integer('child_id')->unsigned()->index();\n $table->foreign('child_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->primary(['parent_id','child_id'],'organisation_relations_primary');\n\n $table->timestamps();\n $table->softDeletes();\n\n $table->engine = 'InnoDB';\n });\n }", "public function up(){\n $table = $this->table('users', array('id'=>false, 'primary_key'=>'id'));\n $table->addColumn('id', 'integer', array('identity'=>true, 'signed'=>false));\n $table->addColumn('email', 'string', array('limit'=>100));\n $table->save();\n }", "public function up() { return $this->run('up'); }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t// examples:\n\t\t\t\t'l_label' => 'VARCHAR(200) NULL DEFAULT NULL',\n\t\t\t\t'l_announce' => 'TEXT NULL DEFAULT NULL',\n\t\t\t\t//'l_content' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_principles_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_principles_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t// create the purchase_orders table\n\t\tSchema::create('purchase_orders', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\n\t\t $table->string('order_number', 128);\n\t\t $table->string('approved',50);\n\t\t $table->date('purchase_date');\t\t \t \t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \t\t \n\t\t $table->integer('updated_by')->unsigned();\t\t \n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'label' => 'VARCHAR(20) NULL DEFAULT NULL COMMENT \"language label\"',\n\t\t\t\t'code' => 'VARCHAR(5) NOT NULL COMMENT \"language code\"',\n\t\t\t\t'locale' => 'VARCHAR (5) NULL DEFAULT NULL',\n\n\t\t\t\t'visible' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not visible; 1 - visible\"',\n\t\t\t\t'published' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not published; 1 - published\"',\n\t\t\t\t'position' => 'INT UNSIGNED NOT NULL DEFAULT 0 COMMENT \"order by position DESC\"',\n\t\t\t\t'created' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - creation time\"',\n\t\t\t\t'modified' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - last entity modified time\"',\n\n\t\t\t\t'UNIQUE key_unique_code (code)',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\n\t\t$this->insert('{{language}}', array(\n\t\t\t'label' => 'рус',\n\t\t\t'code' => 'ru',\n\t\t\t'locale' => 'ru',\n\t\t));\n\t}", "public function up()\n {\n $this->execute('Update goods SET price_rub = price WHERE currency_id = 1');\n }", "public function up()\n\t{\n $this->dropColumn('calculo','fecha');\n\n //add column fecha in producto\n $this->addColumn('producto','fecha','date');\n\t}", "public function up(){\n Schema::table('entries', function (Blueprint $table) {\n $table->renameColumn('value', 'entry_value');\n });\n }", "public function safeUp() {\n\t$this->createTable('post', array(\n 'id' =>\"int(11) NOT NULL AUTO_INCREMENT\",\n 'created_on' =>\"int(11) NOT NULL\",\n 'title' =>\"varchar(255) NOT NULL\",\n 'context' =>\"text NOT NULL\",\n \"PRIMARY KEY (`id`)\"\n\t),'ENGINE=InnoDB DEFAULT CHARSET=utf8');\n }", "public function getUpSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` TEXT NOT NULL AFTER `positive_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function safeUp()\n {\n $this->addColumn('{{%organization}}', 'legal_entity', $this->string()->null());\n $this->addColumn('{{%organization}}', 'contact_name', $this->string()->null());\n $this->addColumn('{{%organization}}', 'about', $this->text()->null());\n $this->addColumn('{{%organization}}', 'picture', $this->string()->null());\n }", "public function up()\n {\n $this->table('agent_order_consignee_address')\n ->addColumn(Column::string('order_number')->setUnique()->setComment('订单编号'))\n \t\t->addColumn(Column::integer('agent_id')->setComment('代理商ID'))\n\t ->addColumn(Column::integer('create_time')->setDefault(1)->setComment('创建时间'))\n\t \n\t ->addColumn(Column::string('consignee_name')->setComment('收货人姓名'))\n\t ->addColumn(Column::string('consignee_phone')->setComment('收货人电话'))\n\t ->addColumn(Column::string('province')->setComment('省份'))\n\t ->addColumn(Column::string('city')->setComment('城市'))\n\t ->addColumn(Column::string('area')->setComment('地区'))\n\t ->addColumn(Column::string('address')->setComment('收货人详细地址'))\n ->create(); \n }", "public function up()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t'l_value' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_configuration_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_configuration_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function safeUp()\r\n {\r\n $this->up();\r\n }", "public function up(){\n // $table->table('kelas')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('NamaKelas', 'varchar', \"100\")\n // ->create();\n }", "public function safeUp()\n\t{\n\t\t$this->createTable('pesquisa', array(\n\t\t\t'id' => 'serial NOT NULL primary key',\n\t\t\t'nome' => 'varchar',\n\t\t));\n\t}", "public function safeUp()\n\t{\n\t\t$this->up();\n\t}", "public function safeUp()\n {\n $this->up();\n }", "public function safeUp()\n {\n $this->up();\n }", "public function up(){\n // $table->table('kelassiswa')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('Kelas_Id', 'int', \"11\")\n // ->addColumn('Peserta_Id', 'int', \"11\")\n // ->addForeignKey('Peserta_Id', 'peserta', \"Id\", \"CASCADE\")\n // ->addForeignKey('Kelas_Id', 'kelas', \"Id\")\n // ->create();\n\n }", "public function up()\n\t{\n\t\tSchema::table('project_sections', function($t){\n\t\t\t$t->integer('created_by_project_id')->nullable()->unsigned();\n\t\t\t$t->boolean('public')->default(0);\n\n $t->foreign('created_by_project_id')->references('id')->on('projects')->on_delete('SET NULL');\n\t\t});\n\t}", "public function up(){\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('ALTER TABLE `btm_tasks` ADD COLUMN `last_run` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `date_created`;');\n\t}", "public function up()\n {\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_create');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_mods');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_modpacks');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->boolean('solder_keys')->default(0);\n $table->boolean('solder_clients')->default(0);\n $table->boolean('modpacks_create')->default(0);\n $table->boolean('modpacks_manage')->default(0);\n $table->boolean('modpacks_delete')->default(0);\n });\n }", "public function up()\n {\n Schema::dropIfExists('db_question_new.t_answer_type');\n Schema::create('db_question_new.t_answer_type', function (Blueprint $table){\n $table->increments('id');\n t_field($table->integer('answer_type_no'),\"答案序号\");\n t_field($table->string('name'),\"步骤名字\");\n t_field($table->integer('subject'),\"科目id\");\n t_field($table->integer('open_flag')->default(1),\"开启与否\");\n }); \n }", "public function up()\n\t{\n\t\t$sql = \"create table tbl_rights\n\t\t\t\t(\n\t\t\t\t\titemname varchar(64) not null,\n\t\t\t\t\ttype integer not null,\n\t\t\t\t\tweight integer not null,\n\t\t\t\t\tprimary key (itemname),\n\t\t\t\t\tforeign key (itemname) references tbl_auth_item (name) on delete cascade on update cascade\n\t\t\t\t)\";\n\t\t $this->execute($sql);\n\t\t \n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable( 'tbl_auth_item', array(\n\t\t \"name\" => \"varchar(64) not null\",\n\t\t \"type\" => \"integer not null\",\n\t\t \"description\" => \"text\",\n\t\t \"bizrule\" => \"text\",\n\t\t \"data\" => \"text\",\n\t\t \"primary key (name)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_item_child\", array(\n \t\t\"parent\" => \" varchar(64) not null\",\n\t\t\"child\" => \" varchar(64) not null\",\n \t\t\"primary key (parent,child)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_assignment\",array(\n \t\t\"itemname\" => \"varchar(64) not null\",\n \t\t\"userid\" => \"varchar(64) not null\",\n \t\t\"bizrule\" => \"text\",\n \t\t\"data\"\t => \"text\",\n \t\t\"primary key (itemname,userid)\",\n\t\t));\n\n\t\t$this->addForeignKey('fk_auth_item_child_parent','tbl_auth_item_child','parent','tbl_auth_item','name','CASCADE','CASCADE');\n\t\t$this->addForeignKey('fk_auth_assignment_itemname','tbl_auth_assignment','itemname','tbl_auth_item','name');\n\t\t$this->addForeignKey('fk_auth_assignment_userid','tbl_auth_assignment','userid','tbl_user','id');\n\t}", "public function up()\n {\n // add foreign key for table `articles`\n $this->addForeignKey(\n 'fk-comments-article_id',\n 'comments',\n 'article_id',\n 'article',\n 'id'\n );\n }", "public function safeUp()\r\n\t{\r\n\t\t$this->up();\r\n\t}", "public function up()\n {\n\n $tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\n $this->createTable($this->createTableName, [\n 'id' => $this->primaryKey(),\n 'name' => $this->string()->notNull(),\n 'type' => $this->integer(1)->notNull(),\n 'location' => $this->text()->defaultValue(null),\n 'description' => $this->text()->defaultValue(null),\n 'created_by' => $this->integer()->notNull(),\n 'start_at' => $this->integer()->defaultValue(null),\n 'active' => $this->boolean()->defaultValue(true),\n\n ],$tableOptions);\n\n\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n\n $moduleInvite = Module::findOne(['name' => 'Actioncalendar', 'slug' => 'actioncalendar']);\n if(empty($moduleInvite)) {\n $this->batchInsert('{{%module}}', ['parent_id', 'name', 'slug', 'visible', 'sorting'], [\n [null, 'Actioncalendar', 'actioncalendar', 1, 22],\n ]);\n }\n\n }", "public function up()\n\t{\n\t\tSchema::table('user_hasil', function($table)\n\t\t{\n\t\t\t$table->create();\n\t\t\t$table->integer('user_id');\n\t\t\t$table->string('grade', 2);\n\t\t\t$table->decimal('hasil', 5, 2);\n\t\t\t$table->year('tahun');\n\t\t\t$table->timestamps();\n\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->on_update('cascade');\n\t\t});\n\t}", "public function safeUp()\r\n {\r\n $tableOptions = null;\r\n if ($this->db->driverName === 'mysql') {\r\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';\r\n }\r\n\r\n $this->createTable('{{%contact_msg}}', [\r\n 'id' => Schema::TYPE_PK,\r\n 'from_email' => Schema::TYPE_STRING . \"(320) NOT NULL\",\r\n 'to_email' => Schema::TYPE_STRING . \"(320) NULL\",\r\n 'subject' => Schema::TYPE_STRING . \"(300) NOT NULL\",\r\n 'text' => Schema::TYPE_TEXT,\r\n 'viewed' => Schema::TYPE_BOOLEAN . \"(1) NOT NULL DEFAULT '0'\",\r\n 'created_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n 'updated_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n ], $tableOptions);\r\n }", "public function up()\n {\n $this->alterColumn('{{%hystorical_data}}', 'project_id', $this->integer());\n\n $this->dropForeignKey('fk-hystorical_data-project_id',\n '{{%hystorical_data}}');\n\n $this->addForeignKey(\n 'fk-hystorical_data-project_id',\n '{{%hystorical_data}}',\n 'project_id',\n '{{%projects}}',\n 'id',\n 'SET NULL'\n );\n }", "public function up()\n\t{\n\t\tSchema::create('flows_steps', function($table) {\n\n\t\t\t$table->engine = 'InnoDB';\n\n\t\t $table->increments('stepid');\n\t\t $table->integer('flowid');\n\t\t $table->string('step', 100);\n\t\t $table->integer('roleid');\n\t\t $table->integer('parentid');\n\t\t $table->integer('state');\n\t\t $table->integer('page');\n\t\t $table->integer('condition2');\n\t\t $table->timestamps();\n\n\t\t});\n\t}", "public function safeUp()\n {\n $this->createTable('site_phrase', array(\n 'site_id' => self::MYSQL_TYPE_UINT,\n 'phrase' => 'string NOT NULL',\n 'hash' => 'varchar(32)',\n 'price' => 'decimal(10,2) NOT NULL',\n 'active' => self::MYSQL_TYPE_BOOLEAN,\n ));\n\n $this->addForeignKey('site_phrase_site_id', 'site_phrase', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT');\n }", "public function up()\n\t{\n\t\tSchema::table('devices', function($table)\n\t\t{\n\t\t\t$table->string('uuid')->unique;\n\t\t\t$table->drop_column('uid');\n\t\t});\n\t}", "public function up()\n\t{\n\t\t$this->execute(\"\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.*', 0, 'Edit invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.View', 0, 'View invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.*', 0, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.View', 0, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitem` VALUES('InvoiceEdit', 2, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('InvoiceView', 2, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FiitInvoiceItem.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FiitInvoiceItem.View');\n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FinvInvoice.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FinvInvoice.View');\n \");\n\t}", "public function up()\n {\n $this->createTable('post',[\n 'id' => $this->primaryKey(),\n 'author_id' => $this->integer(),\n 'title' => $this->string(255)->notNull()->unique(),\n 'content' => $this->text(),\n 'published_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'updated_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'status' => \"ENUM('draft','published')\",\n 'image' => $this->string(255)\n ]); \n\n $this->addForeignKey(\n 'fk_post_author_id',\n 'post',\n 'author_id',\n 'user',\n 'id',\n 'CASCADE',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n// $import->import();\n\t}", "public function up()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{rights}}\")){\n\t\t\t$this->dropTable(\"authItem\");\n\t\t}\n\n\t\t$this->createTable(\"{{rights}}\", array(\n\t\t\t\"itemname\" => \"varchar(64) CHARACTER SET UTF8 NOT NULL\",\n\t\t\t\"type\"\t => \"int not null\",\n\t\t\t\"weight\" => \"int not null\",\n\t\t\t\"PRIMARY KEY (itemname)\"\n\t\t\t));\n\t}", "public function up() {\r\n\t\t// UP\r\n\t\t$column = parent::Column();\r\n\t\t$column->setName('id')\r\n\t\t\t\t->setType('biginteger')\r\n\t\t\t\t->setIdentity(true);\r\n\t\tif (!$this->hasTable('propertystorage')) {\r\n\t\t\t$this->table('propertystorage', [\r\n\t\t\t\t\t\t'id' => false,\r\n\t\t\t\t\t\t'primary_key' => 'id'\r\n\t\t\t\t\t])->addColumn($column)\r\n\t\t\t\t\t->addColumn('path', 'text', ['limit' => 1024])\r\n\t\t\t\t\t->addColumn('name', 'text', ['limit' => 100])\r\n\t\t\t\t\t->addColumn('valuetype', 'integer',[])\r\n\t\t\t\t\t->addColumn('value', 'text', [])\r\n\t\t\t\t\t->create();\r\n\t\t}\r\n\t}", "public function up()\n {\n $perfis = [\n [\n 'id' => 1,\n 'perfil' => 'Genérico',\n 'ativo' => 1\n ]\n ];\n\n $this->insert('singular_perfil', $perfis);\n\n $usuarios = [\n [\n 'id' => 1,\n 'nome' => 'Singular Framework',\n 'login' => 'singular',\n 'senha' => 'singular',\n 'perfil_id' => 1\n ]\n ];\n\n $this->insert('singular_usuario', $usuarios);\n }", "public function safeUp()\n {\n $this->createTable('user', array(\n 'name' => 'string',\n 'username' => 'string NOT NULL',\n 'password' => 'VARCHAR(32) NOT NULL',\n 'salt' => 'VARCHAR(32) NOT NULL',\n 'role' => \"ENUM('partner', 'admin')\"\n ));\n }", "public function up()\n\t{\n\t\t$demoUser = new User();\n\t\t$demoUser->username = \"demo\";\n\t\t$demoUser->email = '[email protected]';\n\t\t$demoUser->password = 'password';\n\t\t$demoUser->create_time = new CDbExpression('NOW()');\n\t\t$demoUser->update_time = new CDbExpression('NOW()');\n\n\t\t$demoUser->save();\n\n\t\t$adminUser = new User();\n\t\t$adminUser->username = \"admin\";\n\t\t$adminUser->email = '[email protected]';\n\t\t$adminUser->password = 'password';\n\t\t$adminUser->create_time = new CDbExpression('NOW()');\n\t\t$adminUser->update_time = new CDbExpression('NOW()');\n\n\t\t$adminUser->save();\n\n\t}", "public function safeUp()\n {\n $tables = Yii::$app->db->schema->getTableNames();\n $dbType = $this->db->driverName;\n $tableOptions_mysql = \"CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB\";\n\n /* MYSQL */\n if (!in_array('question_tag', $tables)) {\n if ($dbType == \"mysql\") {\n $this->createTable('{{%question_tag}}', [\n 'question_id' => 'INT(11) NOT NULL',\n 'tag_id' => 'INT(11) NOT NULL',\n ], $tableOptions_mysql);\n }\n }\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t'like',\n\t\t\tarray(\n\t\t\t\t'id'=>'int(11) UNSIGNED NOT NULL AUTO_INCREMENT',\n\t\t\t\t'user_id' => 'int(11) UNSIGNED NOT NULL',\n\t\t\t\t'post_id' => 'int (11) NOT NULL',\n\t\t\t\t'status' => 'TINYINT(1)',\n\t\t\t\t'created_at' => 'int(11)',\n\t\t\t\t'updated_at' => 'int(11)',\n\t\t\t\t'PRIMARY KEY (id)',\n\t\t\t\t),\n\t\t\t'ENGINE=InnoDB'\n\n\t\t\t);\n\t}", "public function up()\n\t{\n\t\tSchema::table('entries', function($table) {\n $table->create();\n $table->increments('id');\n $table->string('title', 128);\n $table->string('body');\n $table->integer('users_id')->unsigned();\n $table->index('users_id');\n $table->integer('last_edited_by');\n $table->foreign('users_id')->references('id')->on('users')->on_delete('no action');\n $table->timestamps();\n });\n\t}", "public function up()\n {\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'password', $this->string()->null());\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'status', $this->integer()->null());\n }", "public function up()\n {\n\t\t$tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\t\t\n\t\t$TABLE_NAME = 'HaberDeneme12';\n $this->createTable($TABLE_NAME, [\n 'HaberID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(12)->notNull(),\n 'Baslik' => $this->string(128)->notNull(),\n 'Ozet' => $this->text()->notNull(),\n 'Detay' => $this->text()->notNull(),\n 'Resim' => $this->text()->notNull(),\n 'EklenmeTarihi' => $this->date(),\n 'GuncellenmeTarihi' => $this->date()\n ], $tableOptions);\n\t\t\n\t\t\n\t\t$TABLE_NAME = 'HaberKategoriDeneme12';\n\t\t $this->createTable($TABLE_NAME, [\n 'KategoriID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(20)->notNull()\n ], $tableOptions);\n\t\t\n }", "public function up()\n\t{\n\t\t$fields = array(\n \"`piezas` DECIMAL(3,2) DEFAULT NULL\",\n\n\t\t);\n\t\t$this->dbforge->add_column('rel_monto_servicios', $fields);\n\n\t}", "public function up()\n {\n $this->insert('key_value', [\n 'key' => 'day_feed_count_dnr',\n 'value' => '15',\n ]);\n }", "public function up()\n {\n // 创建操作记录表\n $tables = $this->table('history');\n // 用户动作\n $tables->addColumn('action', 'string', ['limit' => 20])\n ->addColumn('ip', 'string', ['limit' => 129])\n // 建立用户\n ->addColumn('user_id', 'integer')\n // 登录时间\n ->addColumn('operation_time', 'datetime')\n // 操作详情\n ->addColumn('desc', 'string',['limit'=>500,'null' => true])\n ->create();\n }", "public function up()\n {\n $table = $this->table('vehicle_model_suggestions');\n\n if (!$table->exists()) {\n $table\n ->addPrimaryKey('id')\n ->addColumn('vehicle_id', 'integer', ['null' => false])\n ->addColumn('vehicle_model_id', 'integer', ['null' => false])\n ->addColumn('suggestion', 'text')\n ->addTimestamps()\n ->addColumn('deleted_at', 'datetime')\n ->create();\n }\n }", "public function safeUp()\n {\n $this->insert('category',['name'=>'Uncategorized', 'slug'=>'uncategorized', 'description'=>'Default Category', 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()')]);\n $this->insert('user',['username'=>'Administrator', 'password_hash'=>'$2y$13$6yoLjvVORp/7EO1u8phYTuWYzhMSM4LVVsebZgcqEKj/EQLvo5nJK',\n 'email'=>'[email protected]',\n 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()'),\n 'status'=>1\n ]\n );\n }", "public function safeUp()\n {\n $this->createTable($this->tableName, [\n 'post_id' => $this->bigInteger()->notNull(),\n 'category_id' => $this->bigInteger()->notNull(),\n ]);\n\n $this->addForeignKey('post_category_post_id_fk', $this->tableName, 'post_id', '{{%post}}', 'id', 'CASCADE', 'CASCADE');\n $this->addForeignKey('post_category_category_id_fk', $this->tableName, 'category_id', '{{%category}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n Schema::table('categories', function(Blueprint $table)\n {\n $table->integer('parent_id', false, true)->nullable()->after('cat_order');\n });\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'application_id' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Ид приложения\"',\n\n\t\t\t\t'message' => 'TEXT NOT NULL DEFAULT \"\" COMMENT \"Оригинал\"',\n\t\t\t\t'category' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Категория\"',\n\t\t\t\t'language' => 'VARCHAR(5) NOT NULL DEFAULT \"\" COMMENT \"Язык\"',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t//\n\t\tSchema::create('options',function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->boolean('activate_pn');\n\t\t\t$table->string('basic_name');\n\t\t\t$table->string('basic_pass');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\t$o = new Option;\n\t\t$o->activate_pn = 0;\n\t\t$o->save();\n\t}", "public function up() {\n\t\t$this->dbforge->add_field(array(\n\t\t\t'id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t\t'auto_increment' => TRUE\n\t\t\t),\n\t\t\t'name' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t),\n\t\t\t'path' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t)\n\t\t));\n\t\t$this->dbforge->add_key('id', TRUE);\n\t\t$this->dbforge->add_key('path');\n\t\t$this->dbforge->create_table('categories');\n\n\t\t// Table structure for table 'event_categories'\n\t\t$this->dbforge->add_field(array(\n\t\t\t'event_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t),\n\t\t\t'category_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t),\n\t\t));\n\t\t$this->dbforge->add_key('event_id', TRUE);\n\t\t$this->dbforge->add_key('category_id', TRUE);\n\t\t$this->dbforge->create_table('event_categories');\n\t}", "public function up()\n {\n $this->createTable('usuario_refeicao', [\n 'id' => $this->primaryKey(),\n 'usuario_id' => $this->integer(),\n 'refeicao_id' => $this->integer(),\n 'alimento_id' => $this->integer(),\n 'data_consumo' => $this->date(),\n 'horario_consumo' => $this->time(),\n 'quantidade' => $this->double(5,2),\n 'created_at' => $this->integer(),\n 'updated_at' => $this->integer() \n ]);\n\n $this->addForeignKey('fk_usuariorefeicao_usuario_id', 'usuario_refeicao', 'usuario_id', \n 'user', 'id', 'CASCADE');\n $this->addForeignKey('fk_usuariorefeicao_refeicao_id', 'usuario_refeicao', 'refeicao_id', \n 'refeicoes', 'id', 'CASCADE');\n $this->addForeignKey('fk_usuariorefeicao_alimento_id', 'usuario_refeicao', \n 'alimento_id', 'alimentos', 'id', 'CASCADE');\n }" ]
[ "0.80072445", "0.7915632", "0.7915632", "0.7915632", "0.75720376", "0.7561417", "0.75285745", "0.7499062", "0.7494408", "0.7454009", "0.7446965", "0.74338573", "0.74321055", "0.7427382", "0.74184984", "0.7378431", "0.73753154", "0.73706865", "0.73640925", "0.7351718", "0.7329819", "0.73133403", "0.7299289", "0.7295341", "0.7292598", "0.7291943", "0.7291649", "0.72850096", "0.7284617", "0.7273328", "0.7272477", "0.72667634", "0.7263149", "0.7262631", "0.72570944", "0.72505975", "0.72503555", "0.72449917", "0.7241266", "0.7238051", "0.72190917", "0.72189677", "0.72044635", "0.72040004", "0.71960837", "0.71918035", "0.7190447", "0.71773696", "0.7176595", "0.71679395", "0.7165182", "0.7165182", "0.71600825", "0.71480834", "0.713639", "0.7130628", "0.7125675", "0.71237975", "0.7117571", "0.71055365", "0.71055365", "0.7105213", "0.7097307", "0.7093728", "0.7089113", "0.7086878", "0.70864815", "0.708361", "0.7083313", "0.7078737", "0.7070507", "0.70692027", "0.7066026", "0.7062314", "0.70593804", "0.7059261", "0.7056025", "0.70559174", "0.70555604", "0.70511854", "0.7048766", "0.7048317", "0.7047087", "0.7045256", "0.7044111", "0.70391047", "0.7038186", "0.7037226", "0.70344466", "0.7032878", "0.7032124", "0.7027117", "0.7015144", "0.7010595", "0.70071304", "0.6988995", "0.6985187", "0.6962824", "0.6961966", "0.69592977", "0.6957979" ]
0.0
-1
this down() migration is autogenerated, please modify it to your needs
public function down(Schema $schema): void { $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE mw_afsluiting_resultaat DROP FOREIGN KEY FK_EBA6C1A2B0A9B358'); $this->addSql('DROP TABLE mw_afsluiting_resultaat'); $this->addSql('DROP TABLE mw_resultaten'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function down()\n {\n //add your migration here \n }", "public function down()\n {\n //add your migration here\n }", "public function down()\n\t{\n $this->dropColumn('producto','fecha');\n\n //add column fecha in producto\n $this->addColumn('calculo','fecha','date');\n\t}", "public function down()\n {\n \t\n \t$this->createTable('os', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n \t$this->insert('os', ['id' => 1, 'name' => 'Any']);\n \t$this->insert('os', ['id' => 2, 'name' => 'CentOS']);\n \t$this->insert('os', ['id' => 3, 'name' => 'RHEL']);\n \t$this->insert('os', ['id' => 4, 'name' => 'Fedora']);\n \t \n \t$this->createTable('os_bit', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n\n return false;\n }", "public function down()\n {\n //Schema::dropIfExists('c');//回滚时执行\n\n }", "public function down()\n {\n $this->dbforge->drop_column('user', 'created_at');\n }", "public function down()\n {\n $this->dropForeignKey(\n 'fk-video-blog_id',\n 'video'\n );\n\n\n echo \"m160820_150846_video_create reverted.\\n\";\n\n }", "public function down()\n\t{\nDB::query(\n\"drop table haal;\");\nDB::query(\n\"drop table kandidaat;\");\nDB::query(\n\"drop table haaletaja;\");\nDB::query(\n\"drop table partei;\");\nDB::query(\n\"drop table valimisringkond;\");\n\t}", "public function down()\n\t{\n\t\t// Remove data from committee_members\n\t\tDB::table('committee_members')->where('id', '<', 3)->delete();\t\n\t}", "public function down(){\n $this->dropTable('users');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` INTEGER NOT NULL AFTER `quality_tweet`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n {\n Schema::table('attachments', function(Blueprint $table) {\n\n $table->dropColumn('viewable_id');\n $table->dropColumn('viewable_type');\n\n\n });\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nDROP TABLE IF EXISTS `movimiento`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n//\t\t$this->dbforge->drop_table('blog');\n\n//\t\t// Dropping a Column From a Table\n\t\t$this->dbforge->drop_column('categories', 'icon');\n\t}", "public function down()\n\t{\n\t\t// nothing to do here.\n\t}", "public function down(){\r\n $this->dbforge->drop_table('users'); //eliminacion de la tabla users\r\n }", "public function down()\n\t{\n\t\tSchema::drop('student');\n\t\t//\n\t}", "public function down()\n{\n\nSchema::drop('event_user');\nSchema::drop('events');\nSchema::drop('file');\nSchema::drop('file_ref');\nSchema::drop('groups');\nSchema::drop('project_user');\nSchema::drop('projects');\nSchema::drop('quicknote');\nSchema::drop('subtasks');\nSchema::drop('task_user');\nSchema::drop('tasks');\nSchema::drop('throttle');\nSchema::drop('timesheet');\nSchema::drop('todos');\nSchema::drop('user_profile');\nSchema::drop('users');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\n\n}", "public function down() \n {\n \n }", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n {\n $this->table('contents')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('education');\n\t}", "public function down()\n\t{\n\t\tSchema::drop('l_wardrobe_table');\n\t}", "public function down()\n\t{\n\t\techo $this->migration('down');\n\n\t\tci('o_role_model')->migration_remove($this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function safeDown()\n\t{\n $sql=\" ALTER TABLE `tbl_venta` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n //quitando la columna pto_venta de tbl_empleado\n $sql=\" ALTER TABLE `tbl_empleado` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n\t}", "public function down()\n {\n\tSchema::drop('quizzes');\n }", "public function down()\n {\n $this->output->writeln('Down migration is not available.');\n }", "public function down()\n {\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=0');\n\n $this->executeSQL('DROP TABLE link');\n $this->executeSQL('DROP TABLE link_category');\n\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=1');\n }", "public function down ()\n {\n }", "abstract public function down();", "abstract public function down();", "abstract public function down();", "public function down()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function down()\r\n {\r\n $this->dbforge->drop_table('users');\r\n }", "public function down() {\n\n\t}", "public function down()\n {\n $this->dbforge->drop_table('lecturer', true);\n }", "public function down()\n\t{\n\t\tSchema::drop('flows_steps');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE galaxiee (id INT AUTO_INCREMENT NOT NULL, idu_id INT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_8576D2AF376A6230 (idu_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE trou_noir (id INT AUTO_INCREMENT NOT NULL, id_g_id INT DEFAULT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_AB27242D95951086 (id_g_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE galaxiee ADD CONSTRAINT FK_8576D2AF376A6230 FOREIGN KEY (idu_id) REFERENCES univers (id)');\n $this->addSql('ALTER TABLE trou_noir ADD CONSTRAINT FK_AB27242D95951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('DROP TABLE trounoir');\n $this->addSql('ALTER TABLE galaxie DROP FOREIGN KEY FK_1C880711376A6230');\n $this->addSql('DROP INDEX IDX_1C880711376A6230 ON galaxie');\n $this->addSql('ALTER TABLE galaxie CHANGE idu_id id_u_id INT NOT NULL');\n $this->addSql('ALTER TABLE galaxie ADD CONSTRAINT FK_1C8807116F858F92 FOREIGN KEY (id_u_id) REFERENCES univers (id)');\n $this->addSql('CREATE INDEX IDX_1C8807116F858F92 ON galaxie (id_u_id)');\n $this->addSql('ALTER TABLE planete DROP FOREIGN KEY FK_490E3E5712013DEC');\n $this->addSql('DROP INDEX IDX_490E3E5712013DEC ON planete');\n $this->addSql('ALTER TABLE planete ADD id_s_id INT NOT NULL, ADD nb_sattelite INT NOT NULL, DROP ids_id, DROP nb_satelite');\n $this->addSql('ALTER TABLE planete ADD CONSTRAINT FK_490E3E574AEED04E FOREIGN KEY (id_s_id) REFERENCES systeme (id)');\n $this->addSql('CREATE INDEX IDX_490E3E574AEED04E ON planete (id_s_id)');\n $this->addSql('ALTER TABLE systeme DROP FOREIGN KEY FK_95796DE3CD7AFD24');\n $this->addSql('DROP INDEX IDX_95796DE3CD7AFD24 ON systeme');\n $this->addSql('ALTER TABLE systeme CHANGE idg_id id_g_id INT NOT NULL');\n $this->addSql('ALTER TABLE systeme ADD CONSTRAINT FK_95796DE395951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('CREATE INDEX IDX_95796DE395951086 ON systeme (id_g_id)');\n }", "public function down() {\n $this->dbforge->drop_column('timesheets_items', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'reason_desc', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'reason_desc', TRUE);\n\n // change reason to note\n $fields = array(\n 'reason' => array(\n 'name' => 'note',\n 'type' => \"VARCHAR\",\n 'constraint' => 200,\n 'null' => TRUE\n )\n );\n $this->dbforge->modify_column('timesheets_items', $fields);\n $this->dbforge->modify_column('timesheets_expenses', $fields);\n }", "public function down(): void\n {\n // Remove your data\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_orders');\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function down()\n {\n\tSchema::drop('activities');\n }", "public function down()\n {\n //return false;\n\t\t\n\t\t$TABLE_NAME = 'Haber';\n $this->dropTable($TABLE_NAME);\n\t\t\n\t\t$TABLE_NAME = 'HaberKategori';\n $this->dropTable($TABLE_NAME);\n }", "public function down(){\n $this->dbforge->drop_table('subcategories_news'); //eliminacion de la tabla subcategories_news\n }", "public function down()\n {\n }", "public function down()\n {\n }", "public function down()\n\t{\n\t\tDB::table('professor')->where('professor_id', '=', 1)->delete();\n\t\tDB::table('professor')->where('professor_id', '=', 2)->delete();\n\t\tDB::query('ALTER TABLE professor AUTO_INCREMENT = 1');\n\n\t\t//\n\t}", "public function down(): bool {\n\t\t// Remove & add logic to revert the migration here.\n\t\techo \"M230123030315BaseTables cannot be rolled back.\\n\";\n\t\treturn false;\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_inicio` `fecha_inicio` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_fin` `fecha_fin` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `descuento` `descuento` DECIMAL;\r\n\r\nALTER TABLE `promocion`\r\n ADD `descripcion` VARCHAR(70) AFTER `id`,\r\n ADD `estado` VARCHAR(11) AFTER `fecha_fin`,\r\n ADD `promocion_global` TINYINT(1) NOT NULL AFTER `descuento`;\r\n\r\nALTER TABLE `promocion` DROP `activo`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n\t\t//return false;\n\t}", "public function down(): void\n {\n try {\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"DROP TABLE IF EXISTS prom2_pages\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function down()\n\t{\n\t\t//\n\t\tSchema::drop('options');\n\t}", "public function change()\n {\n $this->schema->table('recurring_expenses',function($table){\n $table->date('end_repeat')->nullable();\n $table->boolean('ended')->default(false);\n $table->enum('repeat',['0','1','7','14','30','365'])->nullable();\n });\n\n $this->schema->table('expenses',function($table){\n $table->dropColumn('end_repeat');\n $table->dropColumn('repeat');\n $table->integer('parent_id')->nullable();\n $table->foreign('parent_id')->references('id')->on('expenses')->onDelete('cascade');\n });\n }", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->dropForeign('users_id_turma_foreign');\n });\n\n Schema::table('contato', function (Blueprint $table) {\n $table->dropForeign('contato_id_usuario_foreign');\n });\n\n Schema::table('monitores', function (Blueprint $table) {\n $table->dropForeign('monitores_id_turma_foreign');\n $table->dropForeign('monitores_id_usuario_foreign');\n });\n\n Schema::table('galeria_portifolio', function (Blueprint $table) {\n $table->dropForeign('galeria_portifolio_id_portifolio_foreign');\n });\n\n Schema::table('portifolio_alunos', function (Blueprint $table) {\n $table->dropForeign('portifolio_alunos_id_portifolio_foreign');\n $table->dropForeign('portifolio_alunos_id_usuario_foreign');\n });\n\n Schema::table('cobranca', function (Blueprint $table) {\n $table->dropForeign('cobranca_id_aluno_foreign');\n });\n\n Schema::table('lista_de_presenca', function (Blueprint $table) {\n $table->dropForeign('lista_de_presenca_id_usuario_foreign');\n });\n\n Schema::table('forum_da_turma', function (Blueprint $table) {\n $table->dropForeign('forum_da_turma_id_usuario_foreign');\n });\n\n Schema::table('posts_do_site', function (Blueprint $table) {\n $table->dropForeign('posts_do_site_id_usuario_foreign');\n });\n\n Schema::table('posts_do_forum', function (Blueprint $table) {\n $table->dropForeign('posts_do_forum_id_topico_foreign');\n $table->dropForeign('posts_do_forum_id_usuario_foreign');\n });\n }", "public function down()\n\t{\n\t\t$this->dropForeignKey('FK_task_creator','tbl_task');\n\n\t\t$this->dropTable('tbl_task');\n\t}", "public function down()\n {\n $this->table('articles')->drop()->save();\n $this->table('categories')->drop()->save();\n $this->table('football_ragistrations')->drop()->save();\n $this->table('friends')->drop()->save();\n $this->table('menus')->drop()->save();\n $this->table('picnic_ragistrations')->drop()->save();\n $this->table('products')->drop()->save();\n $this->table('profiles')->drop()->save();\n $this->table('skills')->drop()->save();\n $this->table('spouses')->drop()->save();\n $this->table('students')->drop()->save();\n $this->table('submenus')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down(){\n\t\tSchema::dropIfExists('cargo');\n\t}", "public function down()\n {\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )->save();\n\n $this->table('users')\n ->removeIndexByName('FK_users_roles')\n ->update();\n\n $this->table('users')\n ->addColumn('can_edit', 'boolean', [\n 'after' => 'enabled',\n 'default' => '0',\n 'length' => null,\n 'null' => false,\n ])\n ->removeColumn('role_id')\n ->update();\n\n $this->table('stundenplan')\n ->changeColumn('note', 'string', [\n 'default' => null,\n 'length' => 255,\n 'null' => true,\n ])\n ->removeColumn('loggedInNote')\n ->update();\n\n $this->table('roles')->drop()->save();\n }", "public function down()\n\t{\n\t\t//\n\t\tDB::query('TRUNCATE TABLE app_user_apps_publishes CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_fbapps CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_applications CASCADE');\n\t}", "protected abstract function do_down();", "public function down()\n\t{\n\t\t// Drop Table\n\t\tSchema::drop('activities_types');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE encherir_acheteur (encherir_id INT NOT NULL, acheteur_id INT NOT NULL, INDEX IDX_41ABAAFBB0BA17BB (encherir_id), INDEX IDX_41ABAAFB96A7BB5F (acheteur_id), PRIMARY KEY(encherir_id, acheteur_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE encherir_lot (encherir_id INT NOT NULL, lot_id INT NOT NULL, INDEX IDX_3C56919BB0BA17BB (encherir_id), INDEX IDX_3C56919BA8CBA5F7 (lot_id), PRIMARY KEY(encherir_id, lot_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFB96A7BB5F FOREIGN KEY (acheteur_id) REFERENCES acheteur (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFBB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BA8CBA5F7 FOREIGN KEY (lot_id) REFERENCES lot (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EB576A8');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EFC101A');\n $this->addSql('DROP INDEX IDX_503B7C878EB576A8 ON encherir');\n $this->addSql('DROP INDEX IDX_503B7C878EFC101A ON encherir');\n $this->addSql('ALTER TABLE encherir DROP id_acheteur_id, DROP id_lot_id');\n }", "public function down()\n {\n $this->table('accounting_entries')\n ->dropForeignKey(\n 'accounting_entry_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('associations_events')\n ->dropForeignKey(\n 'event_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('events')\n ->dropForeignKey(\n 'event_type_id'\n )->save();\n\n $this->table('members')\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics')\n ->dropForeignKey(\n 'statistics_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics_event')\n ->dropForeignKey(\n 'statistics_id'\n )\n ->dropForeignKey(\n 'event_id'\n )->save();\n\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('accounting_entries')->drop()->save();\n $this->table('accounting_entry_type')->drop()->save();\n $this->table('associations')->drop()->save();\n $this->table('associations_events')->drop()->save();\n $this->table('event_type')->drop()->save();\n $this->table('events')->drop()->save();\n $this->table('members')->drop()->save();\n $this->table('roles')->drop()->save();\n $this->table('statistics')->drop()->save();\n $this->table('statistics_event')->drop()->save();\n $this->table('statistics_type')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{user_block}}\")){\n\t\t\t$this->dropTable(\"{{user_block}}\");\n\t\t}\n\n\t}", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user_login`;\n\nALTER TABLE `user` DROP `user_mname`;\n\nALTER TABLE `user` DROP `user_user`;\n\nALTER TABLE `user` DROP `user_password`;\n\nALTER TABLE `user` DROP `user_date_lastlogin`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n\t{\n\t\tSchema::table('officers', function($t){\n\t\t\t$t->drop_column('role');\n\t\t});\n\t}", "public function safeDown()\n {\n $this->down();\n }", "public function safeDown()\n {\n $this->down();\n }", "public function down()\n\t{\n\t\tSchema::drop('refs');\n\t}", "public function down () {\n\t\treturn $this->rename_column ('headline', 'title', 'string', array ('limit' => 72));\n\t}", "public function down()\n\t{\n\t\tSchema::drop('appeals');\n\t}", "public function safeDown()\r\n {\r\n $this->down();\r\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n<<<<<<< HEAD\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n $this->addSql('ALTER TABLE liste_affaire_affaire DROP FOREIGN KEY FK_CA81ADF3F082E755');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152EBF396750');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E65450D2529');\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E6584CF0CF');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2FF631228');\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCE2687AC3');\n $this->addSql('ALTER TABLE sejour DROP FOREIGN KEY FK_96F52028E2687AC3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152E46135043');\n $this->addSql('DROP TABLE affaire');\n<<<<<<< HEAD\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE responsable_legal');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('DROP TABLE enfant');\n $this->addSql('DROP TABLE enfant_sejour');\n $this->addSql('DROP TABLE sejour');\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE etablissement');\n $this->addSql('DROP TABLE liste_affaire');\n $this->addSql('DROP TABLE responsable_legal');\n $this->addSql('DROP TABLE user');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user`;\n\nDROP TABLE IF EXISTS `question`;\n\nDROP TABLE IF EXISTS `answer`;\n\nDROP TABLE IF EXISTS `image`;\n\nDROP TABLE IF EXISTS `vote`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function down()\n {\n $this->table('mail_contents')->drop()->save();\n }", "public function down() {\n\t}", "public function down() {\n\t}", "public function down() {\n\t}", "public function down()\n {\n Schema::dropIfExists('reunion');\n }", "public function down(): void\n {\n $this->table('services')\n ->dropForeignKey(\n ['currency_id','billing_period_id']\n )->save();\n $this->execute('DELETE FROM currencies');\n $this->execute('DELETE FROM billing_periods');\n $this->table('services')->drop()->save();\n $this->table('currencies')->drop()->save();\n $this->table('billing_periods')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('article_category');\n\t}", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->renameColumn('first_name', 'name');\n $table->dropIndex('users_first_name_index');\n $table->dropIndex('users_created_at_index');\n $table->dropIndex('users_updated_at_index');\n $table->dropColumn(\"last_name\");\n $table->dropColumn(\"username\");\n $table->dropColumn(\"provider\");\n $table->dropColumn(\"provider_id\");\n $table->dropColumn(\"api_token\");\n $table->dropColumn(\"code\");\n $table->dropColumn(\"remember_token\");\n $table->dropColumn(\"role_id\");\n $table->dropColumn(\"last_login\");\n $table->dropColumn(\"status\");\n $table->dropColumn(\"root\");\n $table->dropColumn('backend');\n $table->dropColumn(\"photo_id\");\n $table->dropColumn(\"lang\");\n $table->dropColumn(\"color\");\n $table->dropColumn(\"about\");\n $table->dropColumn(\"facebook\");\n $table->dropColumn(\"twitter\");\n $table->dropColumn(\"linked_in\");\n $table->dropColumn(\"google_plus\");\n });\n }", "public function down()\n\t{\n\t\tSchema::drop('entries');\n\t}", "public function down()\n\t{\n\t\tSchema::table('precios_aterrizajes_despegues', function(Blueprint $table)\n\t\t{\n\t\t\t//\n\t\t});\n\t}", "public function down()\n{\nSchema::drop('statustype');\nSchema::drop('area');\nSchema::drop('region');\nSchema::drop('territory');\nSchema::drop('trackedevent');\nSchema::drop('zip_territory');\nSchema::drop('messagetype');\nSchema::drop('optintype');\nSchema::drop('representative');\nSchema::drop('pediatrician');\nSchema::drop('application_messagestatus');\nSchema::drop('application_optin');\nSchema::drop('application_trackedevent');\nSchema::drop('application');\n}", "public function down()\n\t{\n\t\tSchema::drop(Config::get('sentry::sentry.table.users_metadata'));\n\t}", "protected function tearDown(): void {\n $migration = include __DIR__.'/../database/migrations/create_all_visitors_tables.php.stub';\n $migration->down();\n\n $migrationTest = include __DIR__.'/Support/migrations/2023_01_12_000000_create_test_models_table.php';\n $migrationTest->down();\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_350001418F5EA509');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8B8F5EA509');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA148F5EA509');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0E8F5EA509');\n $this->addSql('ALTER TABLE cours DROP FOREIGN KEY FK_FDCA8C9CF46CD258');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8BF46CD258');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14F46CD258');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7F46CD258');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9A21BD112');\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_35000141A21BD112');\n $this->addSql('ALTER TABLE contacte DROP FOREIGN KEY FK_C794A022A21BD112');\n $this->addSql('ALTER TABLE demande DROP FOREIGN KEY FK_2694D7A5A21BD112');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14A6CC7B2');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7A21BD112');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EE455FCC0');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EBDDFA3C9');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EDC304035');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9E3797A94');\n $this->addSql('ALTER TABLE personne DROP FOREIGN KEY FK_FCEC9EFA76ED395');\n $this->addSql('ALTER TABLE reset_password_request DROP FOREIGN KEY FK_7CE748AA76ED395');\n $this->addSql('DROP TABLE absence');\n $this->addSql('DROP TABLE classe');\n $this->addSql('DROP TABLE classe_personne');\n $this->addSql('DROP TABLE contacte');\n $this->addSql('DROP TABLE cours');\n $this->addSql('DROP TABLE demande');\n $this->addSql('DROP TABLE matiere');\n $this->addSql('DROP TABLE matiere_classe');\n $this->addSql('DROP TABLE news');\n $this->addSql('DROP TABLE note');\n $this->addSql('DROP TABLE personne');\n $this->addSql('DROP TABLE personne_matiere');\n $this->addSql('DROP TABLE reset_password_request');\n $this->addSql('DROP TABLE salle');\n $this->addSql('DROP TABLE seance');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n\t{\n\t\tSchema::drop('stor_mem');\n\t}", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDEA76ED395');\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDE19FCD424');\n $this->addSql('DROP TABLE booking');\n $this->addSql('DROP TABLE product_image');\n $this->addSql('DROP TABLE family_page_container');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE time_line');\n $this->addSql('ALTER TABLE family DROP FOREIGN KEY FK_A5E6215B727ACA70');\n $this->addSql('DROP INDEX IDX_A5E6215B727ACA70 ON family');\n $this->addSql('ALTER TABLE family ADD page_content_id INT NOT NULL, DROP parent_id, DROP has_uniques_prices, DROP has_seasonal_products');\n $this->addSql('ALTER TABLE family ADD CONSTRAINT FK_A5E6215B8F409273 FOREIGN KEY (page_content_id) REFERENCES page_content (id)');\n $this->addSql('CREATE INDEX IDX_A5E6215B8F409273 ON family (page_content_id)');\n $this->addSql('ALTER TABLE link ADD page_container_id INT DEFAULT NULL, DROP url');\n $this->addSql('ALTER TABLE link ADD CONSTRAINT FK_36AC99F123D5B0C FOREIGN KEY (page_container_id) REFERENCES page_container (id)');\n $this->addSql('CREATE INDEX IDX_36AC99F123D5B0C ON link (page_container_id)');\n $this->addSql('ALTER TABLE product DROP content, DROP order_by, DROP is_generic, DROP type, CHANGE title label VARCHAR(50) NOT NULL COLLATE utf8mb4_unicode_ci');\n $this->addSql('ALTER TABLE unit DROP duration');\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398F5B7AF75');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95C8486F9AC');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6498486F9AC');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660D629F605');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660E308AC6F');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46CFFE9AD6');\n $this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADEE45BDBF');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95CEE45BDBF');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649EE45BDBF');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F464584665A');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C544584665A');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649D60322AC');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46DCD6110');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F462ADD6D8C');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C5459027487');\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398A76ED395');\n $this->addSql('DROP TABLE address');\n $this->addSql('DROP TABLE format');\n $this->addSql('DROP TABLE material');\n $this->addSql('DROP TABLE `order`');\n $this->addSql('DROP TABLE order_detail');\n $this->addSql('DROP TABLE picture');\n $this->addSql('DROP TABLE product');\n $this->addSql('DROP TABLE product_theme');\n $this->addSql('DROP TABLE role');\n $this->addSql('DROP TABLE stock');\n $this->addSql('DROP TABLE suppliers');\n $this->addSql('DROP TABLE theme');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n {\n Schema::dropIfExists('data');\n }", "public function down()\n\t{\n\t\tSchema::create('jobs',function($table){$table->increments('id');});\n\t\tSchema::create('job_location',function($table){$table->increments('id');});\n\t\tSchema::create('job_skill',function($table){$table->increments('id');});\n\t\tSchema::create('locations',function($table){$table->increments('id');});\n\t\tSchema::create('location_program',function($table){$table->increments('id');});\n\t\tSchema::create('location_scholarship',function($table){$table->increments('id');});\n\t\tSchema::create('positions',function($table){$table->increments('id');});\n\t\tSchema::create('programs',function($table){$table->increments('id');});\n\t\tSchema::create('program_subject',function($table){$table->increments('id');});\n\t\tSchema::create('scholarships',function($table){$table->increments('id');});\n\t\tSchema::create('scholarship_subject',function($table){$table->increments('id');});\n\t\tSchema::create('skills',function($table){$table->increments('id');});\n\t\tSchema::create('subjects',function($table){$table->increments('id');});\n\t}" ]
[ "0.7950277", "0.78636813", "0.76065636", "0.7493955", "0.7320625", "0.7245268", "0.7187498", "0.71543235", "0.715298", "0.7141911", "0.7135835", "0.71214414", "0.71154845", "0.71057886", "0.7098064", "0.70800334", "0.7078775", "0.70729095", "0.7068331", "0.7066272", "0.7053364", "0.7053364", "0.7042174", "0.7042174", "0.7042174", "0.7041765", "0.7040102", "0.7028846", "0.70253754", "0.7021679", "0.6988633", "0.6986877", "0.6978061", "0.6971848", "0.6944203", "0.6944203", "0.6944203", "0.6942135", "0.6941429", "0.6939214", "0.6935277", "0.69334567", "0.6928689", "0.6924838", "0.6924794", "0.6913486", "0.6902361", "0.6897891", "0.6897845", "0.6897824", "0.6897824", "0.68886673", "0.688262", "0.6874051", "0.6869844", "0.6863713", "0.6858435", "0.68545175", "0.68440175", "0.6842142", "0.6836981", "0.6836124", "0.6834763", "0.68303466", "0.68297166", "0.68282366", "0.6826686", "0.6824025", "0.68185335", "0.6811099", "0.68078107", "0.68056506", "0.68056506", "0.6789167", "0.67755204", "0.67742497", "0.6765081", "0.67597127", "0.67596203", "0.67564446", "0.67564446", "0.67564446", "0.6753443", "0.6753351", "0.6753351", "0.6753351", "0.6752681", "0.674581", "0.6743746", "0.67387754", "0.6733766", "0.67331296", "0.6731279", "0.67302275", "0.6727377", "0.67273724", "0.672722", "0.672607", "0.67173517", "0.67139125", "0.671303" ]
0.0
-1
Display a listing of the resource.
public function index() { $budgets = Budget::all(); foreach($budgets as $budget) { $budget->tag_name = $budget->tag()->name; } return $this->jsonResponse($budgets); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // handled by backbone routes }
{ "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